"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87260],{9768:(e,t,o)=>{o.d(t,{R:()=>c});var n=o(63276),i=o(44364),a=o(63381),l=o(36384);let r={S:16,M:26,XL:24},c={browserLocationFailedMessage:[l.Il.labelHeadlineLarge,{alignItems:"baseline",display:"flex"}],container:{width:"100%"},content:{background:i.l.GLOBAL.WHITE,display:"flex",flexDirection:"column",height:"100%",paddingBottom:a.E.SIZE_60,[n.MQ.M]:{paddingBottom:a.E.SIZE_50}},currentLocation:[l.Il.smallCopyTight,{color:i.l.LIGHT.GRAY_70,display:"block",marginTop:a.E.SIZE_10,[n.MQ.M]:[l.Il.bodyCopy,{marginTop:a.E.SIZE_20}],[n.MQ.XL]:l.Il.bodyCopyTight}],infoContainer:[l.Il.smallCopyTight,{"> p":{whiteSpace:"break-spaces"},color:i.l.LIGHT.GRAY_70,marginTop:a.E.SIZE_20,[n.MQ.M]:l.Il.bodyCopy,[n.MQ.XL]:l.Il.bodyCopyTight}],infoLink:[l.Il.smallCopyTight,{"&:hover span, &:focus span":{color:i.l.GLOBAL.BLACK},color:i.l.LIGHT.GRAY_70,[n.MQ.M]:l.Il.bodyCopy,[n.MQ.XL]:l.Il.bodyCopyTight}],loadingIndicator:{marginTop:a.E.SIZE_30},locationPropsCard:{justifyContent:"flex-start"},locationPropsCardWrapper:{"& svg":{color:i.l.GLOBAL.BLACK},background:i.l.LIGHT.GRAY_10,color:i.l.GLOBAL.BLACK},locationPropsContainer:{marginTop:a.E.SIZE_80},locationPropsTitle:[l.gI.tertiaryHeadline.base,{textAlign:"left",marginBottom:a.E.SIZE_20}],locationShippingCheckIcon:{marginRight:a.E.SIZE_10,svg:{height:"15px",width:"20px",[n.MQ.M]:{height:"16px",width:"22px"}}},locationShippingMsg:[l.Il.secondaryHeadline,{color:i.l.LIGHT.GRAY_70,display:"flex",marginTop:a.E.SIZE_20}],locationSubNav:{padding:"0 ".concat(a.E.SIZE_20,"px ").concat(a.E.SIZE_50,"px ").concat(a.E.SIZE_20,"px"),[n.MQ.M]:{padding:0},[n.MQ.L]:{paddingLeft:a.E.SIZE_60}},useCurrentLocationButton:[l.Il.labelHeadlineLarge,{alignItems:"baseline",display:"flex","&:hover":{color:i.l.GLOBAL.ORANGE}}],useCurrentLocationContainer:{marginTop:a.E.SIZE_40},useCurrentLocationIcon:{marginLeft:a.E.SIZE_10,svg:{height:r.S,width:r.S},[n.MQ.M]:{svg:{height:r.M,width:r.M}},[n.MQ.XL]:{svg:{height:r.XL,width:r.XL}}},userCurrentLocationLoader:{paddingTop:12,[n.MQ.M]:{paddingTop:17}}}},51794:(e,t,o)=>{o.d(t,{A:()=>y});var n=o(29747),i=o(29607),a=o(14232),l=o(57532),r=o(10983),c=o(20735),s=o(77086),d=o(24964),u=o(14579),p=o(51263),h=o(88554),m=o(70630),g=o(61430),E=o(9526),I=o(63276),L=o(44364),b=o(63381),S=o(36384);let A={bodySection:{marginTop:b.E.SIZE_40,"p:first-of-type":{marginTop:0},p:[S.Il.bodyCopy,{marginTop:b.E.SIZE_20}]},closeButton:{justifyContent:"center",marginTop:b.E.SIZE_60,width:"100%"},container:{padding:"".concat(b.E.SIZE_10,"px 0"),[I.MQ.L]:{padding:0}},content:[S.Il.jumboHeadline,{color:L.l.GLOBAL.BLACK,marginTop:b.E.SIZE_50,[I.MQ.L]:S.gI.primaryHeadline.XL,textAlign:"center"}],iconName:[S.Il.jumboHeadline,{color:L.l.GLOBAL.TEAL,display:"flex",justifyContent:"center",marginTop:b.E.SIZE_50,[I.MQ.L]:S.gI.primaryHeadline.XL}]},C=function(e){let{body:t,content:o,isOpen:i,onClose:a,iconName:l}=e,{lessThan:c}=(0,g.A)();return(0,n.Y)(m.default,{contentLabel:o,hasDefaultPadding:!1,theme:E.wD.LIGHT,isFullscreen:c.L,onClose:a,isOpen:i,overlayZIndex:921,"data-element":"Modal","data-component":"ValuePropModal",children:(0,n.FD)(u.default,{css:A.container,"data-element":"Grid",children:[(0,n.FD)(p.default,{gridColumnL:"1/13","data-element":"GridItem",children:[(0,n.Y)(r.default,{name:l,css:A.iconName,"data-element":"Icon"}),(0,n.Y)("h2",{css:A.content,children:o}),(0,n.Y)("div",{css:A.bodySection,children:(0,n.Y)(h.A,{"data-element":"Markdown",children:t})})]}),(0,n.Y)(p.default,{gridColumnL:"1/13","data-element":"GridItem",children:(0,n.Y)(d.A,{onClick:a,css:A.closeButton,"data-element":"Button",children:"Got it"})})]})})},_=[{body:"We use your location to find the best market prices in your area.",iconName:c.Ze.TAG,content:"Better\n Pricing"},{body:"When we have a more accurate location, we can calculate a more accurate delivery time. Typically faster.",iconName:c.Ze.FREE_SHIPPING,content:"Faster\n delivery"},{body:"Your location allow us to recommend verified local shops in your area.",iconName:c.Ze.SHOPS_BIG,content:"Verified\n local shops"}];function f(e){let{body:t,cardStyles:o,content:i,iconName:l}=e,[d,u]=(0,a.useState)(!1);return(0,n.FD)("div",{css:[s.A.propsCard,o],"data-component":"PropsCard",children:[(0,n.FD)("div",{children:[(0,n.Y)(r.default,{name:l,css:s.A.propsIcon,"data-element":"Icon"}),(0,n.FD)("p",{css:s.A.propsCardContent,children:[(0,n.Y)("span",{children:i}),(0,n.Y)(r.default,{name:c.Ze.CHEVRON_RIGHT,onClick:function(){u(!0)},css:s.A.showAllIcon,"data-element":"Icon"})]})]}),(0,n.Y)(C,{body:t,content:i,iconName:l,isOpen:d,onClose:()=>{u(e=>!e)},"data-element":"ValuePropModal"})]})}let y=function(e){let{cardStyles:t,cardWrapperStyles:o,customContainerStyles:a,titleStyles:r}=e;return(0,n.FD)("div",{css:[s.A.cardContainer,a],"data-component":"LocationProps",children:[(0,n.Y)("h3",{css:[s.A.cardTitle,r],children:(0,l.ui)("userZipModal.title3")}),(0,n.Y)("div",{css:[s.A.cardWrapper,o],children:_.map((e,o)=>(0,i.n)(f,{...e,key:o,cardStyles:t}))})]})}},77086:(e,t,o)=>{o.d(t,{A:()=>s});var n=o(18079),i=o(63276),a=o(44364),l=o(63381),r=o(36384);let c={S:{width:15,height:15},M:{width:20,height:20},L:{width:34,height:34}},s={cardContainer:{marginTop:l.E.SIZE_40,[i.MQ.XL]:{marginTop:l.E.SIZE_60}},cardTitle:[r.gI.secondaryHeadline.XL,{color:a.l.ORANGE.SHADE_85,fontWeight:700,marginBottom:l.E.SIZE_20,textAlign:"center",[i.MQ.M]:{marginBottom:l.E.SIZE_40}}],cardWrapper:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"},changeMyZipCta:{"&:hover":{border:"".concat(n.s.SOLID_GRAY_20_2PX," !important")},alignItems:"center",background:a.l.GLOBAL.WHITE,border:"none",color:a.l.GLOBAL.ORANGE,display:"flex",justifyContent:"center",width:"335px"},closeIcon:{marginTop:l.E.SIZE_15,"& svg":{color:a.l.GLOBAL.WHITE,height:c.S.height,width:c.S.width,[i.MQ.M]:{width:c.M.width,height:c.M.height},[i.MQ.L]:{width:c.L.width,height:c.L.height}}},container:{alignItems:"center",backgroundColor:a.l.GLOBAL.ORANGE,display:"flex",flexDirection:"column",height:"100vh",overflowX:"hidden",overflowY:"auto",padding:"".concat(l.E.SIZE_100,"px ").concat(l.E.SIZE_20,"px ").concat(l.E.SIZE_40,"px"),width:"100%"},ctaWrapper:{marginTop:l.E.SIZE_60},icon:{},locationIcon:{height:"52px",width:"39px","& svg":{width:"100%",height:"100%",color:"white"}},modalTitle:[r.gI.primaryHeadline.base,{color:a.l.GLOBAL.WHITE,fontWeight:700,margin:"".concat(l.E.SIZE_10,"px 0"),textAlign:"center",[i.MQ.M]:[r.gI.primaryHeadline.M,{margin:"".concat(l.E.SIZE_20,"px 0")}],[i.MQ.XL]:r.gI.primaryHeadline.XL}],propsCard:{"& svg":{color:a.l.GLOBAL.WHITE},"&:nth-child(2)":{margin:"0 ".concat(l.E.SIZE_10,"px"),[i.MQ.M]:{margin:"0 ".concat(l.E.SIZE_20,"px")}},background:a.l.ORANGE.SHADE_15,borderRadius:"15px",color:a.l.GLOBAL.WHITE,height:"100px",padding:l.E.SIZE_15,width:"104px",[i.MQ.M]:{height:"110.27px",width:" 122px"}},propsCardContent:[r.Il.labelCopyTight,{display:"flex",fontWeight:"bold",marginTop:l.E.SIZE_15}],propsIcon:{height:"27px"},secondaryCta:{"&:hover":{border:"".concat(n.s.SOLID_GRAY_20_2PX," !important")},alignItems:"center",background:a.l.GLOBAL.ORANGE,border:n.s.SOLID_ORANGE_SHADE_30_2PX,color:a.l.GLOBAL.WHITE,display:"flex",justifyContent:"center",marginTop:l.E.SIZE_30,width:"335px"},showAllIcon:{svg:{cursor:"pointer"}},zipCodeText:[r.gI.primaryHeadline.base,{fontWeight:700,color:a.l.GLOBAL.BLACK,[i.MQ.M]:r.gI.primaryHeadline.M,[i.MQ.XL]:r.gI.primaryHeadline.XL}]}},87260:(e,t,o)=>{o.d(t,{A:()=>er});var n=o(29747),i=o(89617),a=o.n(i),l=o(14232),r=o(22607),c=o(63381),s=o(46605),d=o(57532),u=o(18079),p=o(63276),h=o(44364),m=o(64398),g=o(96861),E=o(36384);let I={actionIcon:{[p.MQ.S]:{display:"none"},[p.MQ.M]:{display:"inherit",svg:{display:"block",height:c.E.SIZE_20,width:c.E.SIZE_20}}},clearSearch:[E.Il.labelCopyTight,{color:h.l.LIGHT.GRAY_70}],comboboxWrapper:{width:"100%","input::-webkit-outer-spin-button, input::-webkit-inner-spin-button":{margin:0,WebkitAppearance:"none"}},errorMessage:E.Il.labelHeadlineLarge,input:[E.Il.labelHeadlineLarge,g.Yv,{backgroundColor:"inherit",border:"none",margin:0,MozAppearance:"textfield",padding:0,width:"100%"}],inputContainer:{alignItems:"center",borderBottom:u.s.SOLID_BLACK_1PX,display:"flex",paddingBottom:c.E.SIZE_15,position:"relative",[p.MQ.M]:{borderBottom:u.s.SOLID_BLACK_1PX,paddingBottom:c.E.SIZE_15}},label:[E.Il.labelHeadlineLarge,{color:h.l.LIGHT.GRAY_70,left:0,opacity:1,pointerEvents:"none",position:"absolute",top:0,width:"100%"}],labelHidden:{opacity:0},listbox:{listStyle:"none",zIndex:m.M.FRONT}},L=(e,t)=>"".concat(e,"-").concat(t),b=e=>({invalidID:L("".concat(e,"-listbox-item"),"invalid"),labelID:"".concat(e,"-autocomplete"),listboxID:"".concat(e,"-listbox"),listboxItemID:"".concat(e,"-listbox-item")});var S=o(10983);let A=function(e){let{clearSearchComponent:t,icon:o,onClick:i,value:a}=e;return a?(0,n.Y)("button",{onClick:i,css:I.clearSearch,children:t}):o?(0,n.Y)(S.default,{name:o,css:I.actionIcon}):null},C=function(e){let{children:t,id:o,...i}=e;return(0,n.Y)("li",{id:o,...i,"data-component":"AutocompleteResultsItem",children:t})},_=function(e){let{index:t,result:o}=e;return(0,n.FD)(C,{"data-element":"AutocompleteResultsItem","data-component":"AutocompleteResultItemDefault",children:["[",t,"]: ",o.main,", ",o.secondary]})},f={DEFAULT_SELECTED_INDEX:-1,DEFAULT_VALUE:"",MINIMUM_CHARACTER_BEFORE_ERROR:0},y=function(e){let{children:t,clearSearchComponent:o=(0,d.ui)("common.search.cancelButtonClear"),errorLabel:i,focusOnMount:a=!1,icon:u,inputMaxLength:p,inputValidationRegEx:h,inputValue:m=f.DEFAULT_VALUE,isLoadingResults:g,label:E,minimumCharacterBeforeError:S=f.MINIMUM_CHARACTER_BEFORE_ERROR,onChange:C,onInvalidInput:y,onIsLoadingValueSelection:v,onValueSelectionSuccess:M,onInputResultMatch:T,resultItemComponent:x=_,results:D,testId:R,...w}=e,Y=b((0,l.useId)()),[G,Z]=(0,l.useState)(!1),[H,B]=(0,l.useState)(m),[O,F]=(0,l.useState)(f.DEFAULT_VALUE),[N,k]=(0,l.useState)(f.DEFAULT_SELECTED_INDEX),P=(0,l.useRef)(null),Q=H.length<1,U=D.length>0,W=D.find(e=>e.main.includes(H)),X=!W&&H.length>S&&!g,V=!!W&&W.main===H&&!X,K=()=>{P.current&&P.current.focus()},j=()=>{P.current&&P.current.blur()};(0,l.useEffect)(()=>{a&&setTimeout(()=>{K()},s.E.MS100)},[a]),(0,l.useEffect)(()=>{y&&y(X)},[X,y]),(0,l.useEffect)(()=>{T&&T(V)},[V,T]),(0,l.useEffect)(()=>{Z(!X&&U&&!Q),F(X?Y.invalidID:f.DEFAULT_VALUE)},[U,Q,Y.invalidID,X,D]);let z=()=>{C(f.DEFAULT_VALUE),k(f.DEFAULT_SELECTED_INDEX),Z(!1),B(f.DEFAULT_VALUE)};(0,l.useEffect)(()=>{m&&(C(m),B(m),K())},[m,C]);let q=e=>{U&&(F(L(Y.listboxItemID,D[e].main)),k(e))},J=(e,t)=>{v(!0),B(D[e].main),F(f.DEFAULT_VALUE),Z(!1),t&&K(),M(D[e]),j()},$=X&&i,ee={marginTop:G||$?c.E.SIZE_40:0};return(0,n.FD)("div",{...w,"data-component":"Autocomplete",children:[(0,n.FD)("div",{css:I.inputContainer,children:[(0,n.Y)("label",{id:Y.labelID,css:[I.label,!!H&&I.labelHidden],children:E}),(0,n.Y)("div",{css:I.comboboxWrapper,children:(0,n.Y)("div",{"aria-expanded":G,"aria-haspopup":"listbox","aria-owns":Y.listboxID,role:"combobox",children:(0,n.Y)("input",{"aria-activedescendant":O,"aria-autocomplete":"list","aria-controls":Y.listboxID,"aria-labelledby":Y.labelID,"data-testid":R,css:I.input,maxLength:p,onChange:e=>{let t=e.currentTarget.value;h&&(t=t.replace(h,"")),C(t),B(t),N!==f.DEFAULT_SELECTED_INDEX&&k(f.DEFAULT_SELECTED_INDEX)},onKeyDown:e=>{let t=D.length-1;switch(["e","E","+","-","."].includes(e.key)&&e.preventDefault(),e.keyCode){case r._.ARROW_DOWN:e.preventDefault(),q(N===t?0:N+1);break;case r._.ARROW_UP:e.preventDefault(),q(0===N?t:N-1);break;case r._.HYPHEN:case r._.HYPHEN_FIREFOX:e.preventDefault();break;case r._.ENTER:e.preventDefault(),(U||O)&&J(0*N);break;case r._.ESCAPE:z()}},ref:P,type:"number",role:"number",value:H})})}),(0,n.Y)(A,{clearSearchComponent:o,icon:u,value:H,onClick:z,"data-element":"AutocompleteActions"})]}),(0,n.FD)("ul",{"aria-labelledby":Y.labelID,css:[I.listbox,ee],id:Y.listboxID,role:G?"listbox":"",children:[G&&D.map((e,t)=>(0,n.Y)(x,{index:t,inputValue:H,listboxItemID:Y.listboxItemID,onItemSelected:J,result:e,selectedIndex:N},t)),$&&(0,n.Y)("li",{css:I.errorMessage,id:Y.invalidID,children:i})]}),!G&&!X&&t]})};var v=o(51263),M=o(20735),T=o(85450),x=o(88554),D=o(51794),R=o(87115),w=o(51557),Y=o(13932),G=o(24095),Z=o(50220),H=o(88772),B=o(22020),O=o(26779),F=o(99595),N=o(80912),k=o(52980),P=o(49801),Q=o(78096),U=o(99371),W=o(76709),X=o(72219),V=o(24964),K=o(40994),j=o(19009);let z={listBoxButton:{alignItems:"baseline",color:h.l.GLOBAL.BLACK,cursor:"pointer",display:"flex",padding:"".concat(c.E.SIZE_02,"px 0")},listboxItem:[E.Il.labelHeadlineLarge,{position:"relative"}],listboxItemHighlight:{color:h.l.LIGHT.GRAY_70},listboxItemSecondary:[E.Il.bodyCopyTight,{marginLeft:c.E.SIZE_10}],listboxItemSelected:{outline:u.s.FOCUS_STATE}},q={display:"flex",justifyContent:"space-between",width:"100%"},J=function(e){let{index:t,inputValue:o,listboxItemID:i,onItemSelected:a,result:l,selectedIndex:r}=e,c=(0,Z.CN)(e=>e.setBrowserLocationFailed),{main:d,secondary:u}=l,p=t===r,h=L(i,d);return(0,n.Y)(C,{id:h,"aria-label":"".concat(d," ").concat(u&&u),"aria-selected":p,css:z.listboxItem,role:"option","data-element":"AutocompleteResultsItem","data-component":"AutocompleteResultItemLocation",children:(0,n.FD)("div",{tabIndex:-1,onClick:()=>{a(t,!0)},"data-testid":"location-result",css:[z.listBoxButton,p&&z.listboxItemSelected],style:q,role:"button",children:[(0,n.FD)("div",{children:[(0,n.Y)("span",{css:z.listboxItemHighlight,children:o}),(0,n.FD)("span",{children:[d.replace(o,"")," "]}),u&&(0,n.Y)("span",{css:z.listboxItemSecondary,children:u})]}),(0,n.Y)("div",{children:(0,n.Y)(V.A,{css:z.button,style:K.l.OUTLINED,theme:j.C.LIGHT,onClick:()=>{setTimeout(()=>{c&&c(!1)},s.E.MS3000)},"data-element":"Button",children:"Select"})})]})})};var $=o(9768);let ee=function(){return(0,n.Y)("div",{css:$.R.useCurrentLocationContainer,"data-component":"BrowserLocationFailed",children:(0,n.Y)("span",{css:$.R.browserLocationFailedMessage,children:(0,n.Y)(x.A,{"data-element":"Markdown",children:(0,d.ui)("location.browserLocationFailedMessage")})})})};var et=o(42507);let eo=(e,t)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(e,function(e){(e.code==e.PERMISSION_DENIED||2===e.code)&&t(e.code)}):alert((0,d.ui)("location.locationSupportError"))},en=function(e){let{onCurrentLocationError:t,onCurrentLocationSuccess:o}=e,[i,a]=(0,l.useState)(null),[r,c]=(0,l.useState)(!1),s=(0,l.useCallback)(e=>{var n,i,l;if(!(null===(l=window)||void 0===l?void 0:null===(i=l.google)||void 0===i?void 0:null===(n=i.maps)||void 0===n?void 0:n.Geocoder)){t((0,d.ui)("location.errorMessage"));return}new window.google.maps.Geocoder().geocode(e,(e,n)=>{if(n===window.google.maps.GeocoderStatus.OK&&e){if(e[0]){let n=(0,et.S)(e[0].address_components);n?o({id:e[0].place_id,main:n}):t((0,d.ui)("location.geolocationNoResults"))}}else t((0,d.ui)("location.geocoderFailure",{status:n}));a(null)})},[o,t]);return(0,l.useEffect)(()=>{window.google&&i&&s({location:i})},[i,s]),(0,n.Y)("div",{css:$.R.useCurrentLocationContainer,"data-component":"UseCurrentLocation",children:r?(0,n.Y)(T.default,{customContainerStyles:$.R.userCurrentLocationLoader,label:(0,d.ui)("location.loadingCurrentLocationLabel")}):(0,n.FD)("button",{css:$.R.useCurrentLocationButton,onClick:()=>{c(!0),eo(e=>{let{coords:t}=e;k.A.addToDataLayer({event:"isGeolocation",lat:t.latitude,lng:t.longitude}),a({lat:t.latitude,lng:t.longitude})},e=>{1===e&&t("location.browserLocationBlockedMessage"),2===e&&t("location.browserLocationFailedMessage"),c(!1)})},children:[(0,n.Y)("span",{children:(0,d.ui)("location.useCurrentLocationLabel")}),(0,n.Y)(S.default,{css:$.R.useCurrentLocationIcon,name:"geolocation"})]})})};var ei=function(e){return e.ERROR="error",e.SUCCESS="success",e}(ei||{});let ea=(e,t)=>e.filter(e=>e.formatted_address&&e.formatted_address.toLowerCase().includes(t.toLowerCase())).map(e=>({id:e.place_id||"",main:t,secondary:e.formatted_address.replace(RegExp(t,"i"),"")})),el=(0,l.memo)(e=>{let{isError:t,isStateAbbr:o,modalMessageAvailable:i}=e,a=(0,G.Z0)(e=>e.coreShipHandlingMode),l=(0,H.J)(e=>e.isDealerTire);return i&&a&&a>2&&!t&&!o&&!l?(0,n.Y)("p",{css:$.R.currentLocation,children:(0,d.ui)("location.oversizeInfo")}):null}),er=function(e){let{currentLocation:t,focusInputOnMount:o,onCurrentLocationError:i,onLocationChangeSuccess:r,...c}=e,[u,p]=(0,l.useState)([]),[h,m]=(0,l.useState)(""),[g,E]=(0,l.useState)(!1),[I,L]=(0,l.useState)(!1),[b,A]=(0,l.useState)(""),[C,_]=(0,l.useState)(""),[f,G]=(0,l.useState)(!1),{closeModal:V,itemLink:K,vehicleMetadata:j}=(0,B.ZS)(e=>({closeModal:e.closeModal,itemLink:e.itemLink,vehicleMetadata:e.vehicleMetadata})),z="vehicleGuidedShopping"===(0,X.a)(e=>e.searchState),q=(0,Y.p0)(e=>e.handleCloseSubNav),{browserLocationFailed:et,hideUseCurrentLocation:eo,setBrowserLocationFailed:ei}=(0,Z.CN)(e=>({browserLocationFailed:e.browserLocationFailed,hideUseCurrentLocation:e.hideUseCurrentLocation,setBrowserLocationFailed:e.setBrowserLocationFailed})),{isError:er,setIsError:ec,isDealerTire:es}=(0,H.J)(e=>({isError:e.isError,setIsError:e.setIsError,isDealerTire:e.isDealerTire})),ed=(0,W.uF)(e=>e.setCartShipping),eu=(0,w.c1)(e=>e.openGuidedQuestionsModal),{isSourcePirelliWidget:ep}=(0,F.A)(),eh=(0,l.useCallback)(e=>{""===e&&p([]),m(e)},[m]);(0,l.useEffect)(()=>{let e=!1;return 5===h.length&&((0,P.rH)(h).then(t=>{!e&&t.length>0&&p(ea(t,h)),E(!1)}).catch(()=>{E(!1)}),E(!0)),()=>{e=!0,E(!1)}},[h]);let em=(0,n.Y)(x.A,{children:(0,d.ui)("location.errorLabel")}),eg=u.length>0,eE=(0,d.ui)("location.contentLabel"),eI=document.querySelector('[aria-label="'.concat((0,d.ui)("common.modal.close",{contentLabel:eE}),'"]')),eL=document.querySelector('[aria-label="'.concat((0,d.ui)("nav.close")," ").concat(R.T.LOCATION,'"]'));(0,l.useEffect)(()=>{let e,t="success"===b&&!er;return t&&(e=setTimeout(()=>{q(),ei&&ei(!1)},s.E.MS1500)),()=>{t&&clearTimeout(e)}},[q,er,b,ei]);let eb=(0,O.A)();async function eS(e){try{await r({userLocationGooglePlacesId:e.id,userLocationZip:e.main}),e.main&&(a().set(N.W[N.y.USER_LOCATION_ZIP],e.main),a().set(N.W[N.y.ZIP_SET_BY],"userInput"),k.A.addToDataLayer({event:"isServerlocation",zip:e.main,source:"userInput"})),ed(void 0),(0,l.startTransition)(()=>{G(!1),A("success")}),K&&setTimeout(()=>{V(),z?eu(K||"",j):eb.push(K)},s.E.MS1500)}catch(e){eA(e.code)}eI?eI.focus():eL&&eL.focus()}function eA(e){i&&i(e),A("error"),ec(!0),_(e),Q.A.error("handleCurrentLocationError: ".concat(e))}let eC=(null==t?void 0:t.stateAbbr)==="AK"||(null==t?void 0:t.stateAbbr)==="HI"||(null==t?void 0:t.stateAbbr)==="PR",e_={success:(0,n.Y)("div",{children:er?(0,n.Y)("div",{css:$.R.locationShippingMsg,children:(0,d.ui)("location.errorLabel")}):(0,n.FD)("div",{children:[(0,n.Y)(x.A,{children:(0,d.ui)("location.successMessage",{location:"".concat(null==t?void 0:t.cityName,", ").concat(null==t?void 0:t.stateAbbr,", ").concat(null==t?void 0:t.zip)})}),(0,n.FD)("div",{css:$.R.locationShippingMsg,children:[(0,n.Y)(S.default,{css:$.R.locationShippingCheckIcon,name:M.Ze.CHECKMARK}),(0,n.Y)("span",{children:es?(0,d.ui)("location.successShipMessageNotFree"):eC?(0,d.ui)("location.successShipMessageNotFree"):ep?(0,d.ui)("location.successShipMessageWidget"):(0,d.ui)("location.successShipMessage")})]})]})}),error:(0,n.Y)(x.A,{children:(0,d.ui)(C||"location.errorMessage")})},ef=t&&t.cityName&&t.stateAbbr&&t.zip;return(0,n.Y)(v.default,{css:$.R.container,...c,"data-element":"GridItem","data-component":"Location",children:(0,n.FD)("div",{css:$.R.content,children:[(0,n.Y)(y,{icon:M.Ze.SEARCH,label:(0,d.ui)("location.inputLabel"),errorLabel:em,inputMaxLength:5,focusOnMount:o,inputValidationRegEx:U.fe,isLoadingResults:g,minimumCharacterBeforeError:5,onChange:eh,onInvalidInput:function(e){I!==e&&L(e)},onIsLoadingValueSelection:G,onValueSelectionSuccess:eS,results:u,resultItemComponent:J,testId:"location-input","data-element":"Autocomplete"}),f&&(0,n.Y)(T.default,{customContainerStyles:$.R.loadingIndicator}),!eg&&!b&&!I&&(0,n.FD)("div",{children:[ef&&(0,n.Y)("span",{css:$.R.currentLocation,children:"".concat((0,d.ui)("location.currentLocationLabel")," ").concat(null==t?void 0:t.cityName,", ").concat(null==t?void 0:t.stateAbbr," ").concat(null==t?void 0:t.zip)}),!eo&&(0,n.Y)(en,{onCurrentLocationSuccess:eS,onCurrentLocationError:eA}),(0,n.Y)(D.A,{customContainerStyles:$.R.locationPropsContainer,titleStyles:$.R.locationPropsTitle,cardWrapperStyles:$.R.locationPropsCard,cardStyles:$.R.locationPropsCardWrapper}),et&&(0,n.Y)(ee,{})]}),b&&(0,n.Y)("div",{css:$.R.infoContainer,children:e_[b]}),(0,n.Y)(el,{modalMessageAvailable:!!b,isError:er,isStateAbbr:eC,"data-element":"OversizeInfo"})]})})}}}]);