"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34832,64919],{21899:(e,t,n)=>{n.d(t,{W:()=>a});let a={APPNAME:"WebChatCarline",BASELIVEAGENTCONTENTURL:"https://c.la2s-core1.sfdc-lywfpd.salesforceliveagent.com/content",BASELIVEAGENTURL:"https://d.la2s-core1.sfdc-lywfpd.salesforceliveagent.com/chat",BUTTONID:"5731L000000M5ik",DEPLOYMENTID:"5721L000000M49L",EMBEDDED_SERVICE_DEFAULT_LINK:"https://service.force.com",EMBEDDED_SERVICE_LINK:"https://dealertire--dtstaging.sandbox.my.salesforce.com/embeddedservice/5.0/esw.min.js",ESWLIVEAGENTDEVNAME:"WebChatCarline2",ISOFFLINESUPPORTENABLED:!1,ORGID:"00DRu000001EGy9",SANDBOX_LINK:"https://dealertire--dtstaging.sandbox.my.salesforce.com",SANDBOX_LINK_LIVEAGENT:"https://dealertire--dtstaging.sandbox.my.salesforce-sites.com/liveAgentSetupFlow"}},25838:(e,t,n)=>{n.d(t,{g:()=>a});let a={APPOINTMENT_CONFIRMED:"ExpAppointmentConfirmed",CHECK_USER_TYPE:"Check user type",CLICK_INSTALLATION_NAME:"Click installation name",CLICK_INSTALLER:"Tire installation card clicked",CLICK_PAST_SEARCH:"Click past search",CLICK_PIN_ON_INSTALLATION_SHOPS_MAP:"Click pin on installation shops map",CLICK_YELP_REVIEW:"Click Yelp Review",COVERAGE:"Coverage",EMPLOYEE_PROGRAM:"Employee program",ERROR_ON_COMPONENT:"Error on component",ERROR_PAGE:"Error page",EXPEDITED_ADD_TO_CART:"ExpAddtoCart",EXPEDITED_APPOINTMENT_CONFIRMED:"ExpAppointmentConfirmed",EXPEDITED_FEDEX:"ExpFedEx",EXPEDITED_SCHEDULE_TIME:"ExpScheduleTime",EXPEDITED_SHIP_TO_HOME:"ExpShipToHomeTab",EXPEDITED_SHIP_TO_ME:"ExpShipToMe",INSTALLATION_EVENT_ON_ALL_SHOPS_MAP_MODAL_SUFFIX:" on all shops map modal",INSTALLATION_EVENT_ON_ALL_SHOPS_MODAL_SUFFIX:" on all shops modal",INSTALLATION_EVENT_ON_PDP_SUFFIX:" on PDP",INSTALLATION_EVENT_ON_SHOP_DETAIL_MODAL_SUFFIX:" on shop detail modal",LOCATION_POPUP:"ST Location Popup",ORDER_COMPLETED:"ST Order Completed",ORDER_NUMBER:"orderNumber",PAYPAL_ORDER_DETAIL:"Paypal Order Detail",PAYPAL_ORDER_SHIPPING_DETAIL:"Paypal Order Shipping Detail",PLACE_ORDER:"Place order",SEARCH_BY_BOARD:"ST SearchByBoard",SEARCH_ENTRY:"ST SearchEntry",SELECT_INSTALLATION:"Select installation",SELECT_INSTALLER:"Installer shop selected",SIMPLESNAP:"ST SimpleSnap",UNSELECT_COVERAGE:"unselect coverage",UNSELECT_INSTALLER:"installer unselect"}},26779:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(14e3),l=n(82562),o=n(20721);let i=function(){let e=(0,a.useRouter)();return{...e,push:(t,n)=>{let a=(0,o.NI)(t);l.o.routeChangeStart.emit(a),e.push(t,n)},replace:(t,n)=>{let a=(0,o.NI)(t);l.o.routeChangeStart.emit(a),e.replace(t,n)}}}},31369:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(14e3);let l=function(){return(0,a.usePathname)(),(0,a.useSearchParams)(),window.location.href.replace(window.location.origin,"")}},33397:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Q});var a=n(29747),l=n(18847),o=n.n(l),i=n(14e3),s=n(14232),r=n(72219),d=n(23204),c=n(88772),E=n(31369),u=n(72747),p=n(26779),m=n(86089);async function _(e){return await (0,m.q$)({endpoint:"/cj",includeAuthorization:!0,method:"get",query:{cjevent:e}})}async function T(e){return await (0,m.q$)({endpoint:"/promotion",includeAuthorization:!0,query:e,method:"get"})}var A=n(12055),h=n(25838),I=n(80912),w=n(79478),L=n(21899),S=n(35667),f=n(52980),O=n(938),N=n(70266),C=n(78096),g=n(45882),y=n(55005),D=n(64919),R=n(32384),P=n(30903),v=n(55720),b=n(43772),G=n(8441),M=n(98123);let k=o()(()=>Promise.all([n.e(98874),n.e(82909),n.e(30429)]).then(n.bind(n,30429)),{loadableGenerated:{webpack:()=>[30429]}}),F=(0,s.memo)(()=>{let e=(0,i.usePathname)(),t=(0,u.A)(),n=(0,s.useCallback)(()=>{let e=(0,O.j)();return M.DY.indexOf(null!=t?t:"")>-1||M.oT.some(t=>null==e?void 0:e.has(t))},[t]);return(0,s.useEffect)(()=>{!n()&&setTimeout(()=>window.scrollTo(0,0))},[e,n]),null}),B=(0,s.memo)(()=>{let e=(0,p.A)(),t=(0,i.usePathname)(),n=(0,i.useSearchParams)(),{setFilterPills:a,setRouteQueryParamOptions:l}=(0,r.a)(e=>({setFilterPills:e.setFilterPills,setRouteQueryParamOptions:e.setRouteQueryParamOptions})),o=(0,d.Z)(e=>e.setIsSearchOpen),c=(0,s.useCallback)(t=>{let[,n]=t.split("?"),a=new URLSearchParams(n);if(a.get("code")){R.ds.setItem(I.W[I.y.ID_ME_VERIFICATION_CODE],a.get("code"));let t=R.ds.getItem(I.W[I.y.ID_ME_CALLBACK_URL]);t&&e.push(t)}},[e]),E=(0,s.useCallback)(async()=>{let[,e]=window.location.hash.split("#");if(e){e.includes(M.DB)&&c(e);let t=new URLSearchParams(e),n={},i=[];for(let e of t.keys())n[e]=t.get(e);if(n.brand&&i.push({type:"brand",label:n.brand}),n.category||n.subtype){let{queryText:e,queryType:t}=b.pi.action,a=await (0,A.S)({additionalQueryText:"",queryText:e,queryType:t});M.h_.filter(e=>n[e]).forEach(e=>{let t="".concat(e,"=").concat(n[e]);a.siteSearchResultGroupList.some(n=>n.siteSearchResultList.some(n=>{let{action:a}=n;return a.type===G.xJ.LINK&&a.link.href===t&&!!n.label&&(i.push({type:e,label:n.label}),!0)}))})}i.length&&(a(i),l({routes:[w.ph[w.bw.VEHICLE_CATALOG],w.ph[w.bw.TIRE_SIZE_CATALOG_OR_CATEGORY]],params:n}),o(!0))}},[o,a,l,c]);return(0,s.useEffect)(()=>{(null==t?void 0:t.includes("/paid"))||(null==t?void 0:t.includes("/p/"))||E()},[t,n,E]),null}),H=(0,s.memo)(()=>{let{setIsSearchOpen:e}=(0,d.Z)(e=>({setIsSearchOpen:e.setIsSearchOpen})),{setRouteQueryParamOptions:t,setFilterPills:n}=(0,r.a)(e=>({setRouteQueryParamOptions:e.setRouteQueryParamOptions,setFilterPills:e.setFilterPills})),a=(0,s.useCallback)(()=>{let a={},l=window.location.hash;if(l.includes("openSearch")){let o=new URLSearchParams(l.replace("#","?")).get("promo");o?(a.promotion=o.toString(),n([{type:"promotion",label:o}])):n([]),t({routes:[w.ph[w.bw.VEHICLE_CATALOG],w.ph[w.bw.TIRE_SIZE_CATALOG_OR_CATEGORY]],params:a}),e(!0)}},[n,e,t]),l=e=>{C.A.info(e),e&&e.buttonFieldValAfterClick&&""!==e.buttonFieldValAfterClick?window.location.href="#openSearch&promo=".concat(e.buttonFieldValAfterClick):window.location.href="#openSearch"};return(0,s.useEffect)(()=>(a(),window.openSearchModalWithPromoId=l,window.addEventListener("hashchange",a),()=>{window.removeEventListener("hashchange",a)}),[a]),null}),U=(0,s.memo)(()=>{let e=(0,p.A)(),{setFilterPills:t,setRouteQueryParamOptions:n}=(0,r.a)(e=>({setFilterPills:e.setFilterPills,setRouteQueryParamOptions:e.setRouteQueryParamOptions})),a=(0,d.Z)(e=>e.setIsSearchOpen),l=(0,s.useCallback)(async()=>{let l=(0,O.j)(),o=null==l?void 0:l.get("promotionId");if(!o)return;let i=await T({promotion:o});if(i.isSuccess){let e={promotion:i.data.promotionId};n({routes:[w.ph[w.bw.VEHICLE_CATALOG],w.ph[w.bw.TIRE_SIZE_CATALOG_OR_CATEGORY]],params:e}),t([{type:"promotion",label:i.data.promotionName}]),a(!0)}else e.push(w.ph[w.bw.HOME])},[e,a,t,n]);return(0,s.useEffect)(()=>{l()},[l]),null}),Y=(0,s.memo)(()=>((0,s.useEffect)(()=>{"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual")},[]),null)),x=(0,s.memo)(()=>{let e=(0,u.A)(),t=(0,s.useRef)(24),n=(0,s.useRef)(""),a=(0,s.useCallback)(()=>{let e=document.documentElement,t=document.body,n="scrollTop",a="scrollHeight",l=Math.round((e[n]||t[n])/((e[a]||t[a])-e.clientHeight)*100);return isNaN(l)?"":l},[]),l=(0,s.useCallback)(()=>{let l=a();if(e&&n.current!=e&&(n.current=e,t.current=24),l&&l>t.current){var o,i,s;let n=(0,O.S)();(0,y.uj)(g.B.PAGE_SCROLL_MILESTONE,{name:null!==(o=window.location.href)&&void 0!==o?o:"",page_scroll_milestone:t.current+1,path:null!=e?e:"",query:null!=n?n:"",title:null!==(i=document.title)&&void 0!==i?i:"",url:null!==(s=window.location.href)&&void 0!==s?s:""}),t.current+=25}},[a,e]);return(0,s.useEffect)(()=>(window.addEventListener("scroll",l,!1),()=>{window.removeEventListener("scroll",l)}),[l]),null}),V=(0,s.memo)(()=>((0,s.useEffect)(()=>{window.onload=v.NS},[]),null)),j=(0,s.memo)(()=>{let e=(0,s.useCallback)(async()=>{let e=(0,O.j)(),t=null==e?void 0:e.get("cjevent");t&&"string"==typeof t&&await _(t)},[]);return(0,s.useEffect)(()=>{e()},[e]),null}),W=(0,s.memo)(()=>{let{userDetail:e,userType:t}=(0,c.J)(e=>({userDetail:e.userDetail,userType:e.userType}));return e&&t!==S.ve.NONE?(0,a.Y)(k,{email:e.username}):null});function X(){var e;let t=(0,E.A)(),n=null!==(e=(0,u.A)())&&void 0!==e?e:"";return(0,s.useEffect)(()=>{let e=w.sg[n];if(e!==w.bw.PRODUCT_DETAIL||t.includes("#")||(e=w.bw.PRODUCT_LINE),e){let t=w.nR[e];f.A.addToDataLayer({event:"PageType",pageType:t})}},[t,n]),null}function K(){let e=(0,i.usePathname)()===w.ph[w.bw.DT_EMPLOYEES],{isDealerTire:t,accountType:n,company:a}=(0,c.J)(t=>({isDealerTire:t.isDealerTire||e,accountType:t.accountType,company:t.company})),l=(0,s.useMemo)(()=>({accountTypeCompany:a,accountType:n}),[a,n]);return(0,s.useEffect)(()=>{let e=document.getElementById(v.aH.GLADLYCHAT_CONTAINER);t?null==e||e.setAttribute("style","display:none !important"):null==e||e.setAttribute("style","display:block !important")},[t]),(0,s.useEffect)(()=>{if(t){if(window.embedded_svc)(0,D.U)(L.W.EMBEDDED_SERVICE_DEFAULT_LINK);else{let e=document.createElement("script");e.setAttribute("src",L.W.EMBEDDED_SERVICE_LINK),e.onload=function(){(0,D.U)(null)},document.body.appendChild(e)}(0,N.X)(h.g.EMPLOYEE_PROGRAM,l)}},[t,l]),null}function q(){let e=(0,E.A)();return(0,s.useEffect)(()=>{0>e.indexOf("/sso-redirect")&&R.ds.setItem("sso_redirect_last_url",e)},[e]),null}function Q(){let e=(0,P.Dm)();return(0,a.FD)(a.FK,{children:[(0,a.Y)(F,{"data-element":"NotScrollTopOnRouteChangeEffect"}),(0,a.FD)(s.Suspense,{fallback:null,"data-element":"Suspense",children:[(0,a.Y)(B,{"data-element":"FiltersEffect"}),(0,a.Y)(X,{"data-element":"PageTypeGAEvent"}),(0,a.Y)(q,{"data-element":"PreviousUrl"})]}),(0,a.Y)(U,{"data-element":"PromotionsEffect"}),(0,a.Y)(Y,{"data-element":"ScrollRestorationEffect"}),(0,a.Y)(x,{"data-element":"RudderstackScrollEventEffect"}),(0,a.Y)(V,{"data-element":"GladlyEffect"}),(0,a.Y)(j,{"data-element":"CJCookieEffect"}),e?null:(0,a.Y)(W,{}),(0,a.Y)(K,{"data-element":"DealerTireChat"}),(0,a.Y)(H,{"data-element":"SearchModalEffect"})]})}},55720:(e,t,n)=>{n.d(t,{$p:()=>_,Bj:()=>h,Fh:()=>m,NS:()=>w,aH:()=>E,mN:()=>T,mr:()=>u,y$:()=>I,zF:()=>p});var a=n(80912),l=n(79478),o=n(52980),i=n(54292),s=n(78096),r=n(55005),d=n(45882),c=n(32384);let E={SCRIPT_ID:"gladly-script",SCRIPT_EXTRA_ID:"gladly-script-extra",SCRIPT_SRC:"https://cdn.gladly.com/chat-sdk/widget.js",GLADLYCHAT_CONTAINER:"gladlyChat_container"},u=a.W[a.y.GLADLY_MESSAGE_NOTIFICATION],p=["message:received","sidekick:opened","campaign:triggered","sidekick:closed","conversation:ended","conversation:started","customer:onboarded","message:sent","quick-action:selected","search:result-selected"];function m(){return'!function(c,n,r,t){if(!c[r]){var i,d,p=[];d="PROD"!==t&&t?"STAGING"===t?"https://cdn.gladly.qa/gladly/chat-sdk/widget.js":t:"https://cdn.gladly.com/chat-sdk/widget.js",c[r]={init:function(){i=arguments;var e={then:function(t){return p.push({type:"t",next:t}),e},catch:function(t){return p.push({type:"c",next:t}),e}};return e}},c.__onHelpAppHostReady__=function(t){if(delete c.__onHelpAppHostReady__,(c[r]=t).loaderCdn=d,i)for(var e=t.init.apply(t,i),n=0;n