(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1736],{54600:function(e,n,o){"use strict";o.r(n),o.d(n,{default:function(){return M}});var i=o(74988),t=o(34235),l=o(73888),a=o.n(l),r=o(44194),s=o(16652),u=o(2614),d=o(43412),c=o(52011),p=o(97358),g=o(34064),b=o(3303),m=o(45947),f=o.n(m),h=o(31549),v=["title","description","closeButtonAriaLabel"],P=["isValidating","isSessionReady"],k=a()(()=>Promise.all([o.e(9237),o.e(7522),o.e(9465),o.e(9701),o.e(5906)]).then(o.bind(o,49465)).then(e=>e.RegionModal),{ssr:!1,loadableGenerated:{webpack:()=>[null]}});function RegionModal(e){var n,o,{onPostalCodeChange:l}=(0,c.z0)(),{title:a,description:m,closeButtonAriaLabel:M}=e,y=(0,t.Z)(e,v),x=(0,b.T)(y),{inputField:{label:R="",errorMessage:C="",noProductsAvailableErrorMessage:_="",buttonActionText:A=""}={},idkPostalCodeLink:{text:L="",to:E="",icon:{icon:S="",alt:Z=""}={}}={}}=null!==(o=null==x?void 0:x.regionalization)&&void 0!==o?o:{},j=(0,r.useRef)(null),w=(0,p.kP)(),{isValidating:T,isSessionReady:B}=w,F=(0,t.Z)(w,P),{modal:N,closeModal:z}=(0,s.l8)(),{0:O,1:V}=(0,r.useState)(""),{loading:D,setRegion:G,regionError:I,setRegionError:K}=(0,g.Z)(),$=(n=(0,i.Z)(function*(){T||(yield G({session:F,onSuccess:()=>{l(),V(""),z()},postalCode:O,errorMessage:C,noProductsAvailableErrorMessage:_}))}),function(){return n.apply(this,arguments)}),q=!!(!(null!==d.deliveryPromise&&void 0!==d.deliveryPromise&&d.deliveryPromise.mandatory)||F.postalCode),H={href:E,children:(0,h.jsxs)(h.Fragment,{children:[L,!!S&&(0,h.jsx)(u.Z,{name:S,"aria-label":Z,width:20,height:20})]})};return(0,h.jsx)(h.Fragment,{children:N&&(0,h.jsx)(k,{title:a,description:m,overlayProps:{className:"section ".concat(f().section," section-region-modal")},closeButtonAriaLabel:M,inputRef:j,inputValue:O,inputLabel:R,errorMessage:I,idkPostalCodeLinkProps:E?H:null,onInput:e=>{""!==I&&K(""),V(e.currentTarget.value)},onSubmit:$,fadeOutOnSubmit:!1,onClear:()=>{V(""),K("")},inputButtonActionText:D?"...":A,dismissible:q})})}RegionModal.$componentKey="RegionModal";var M=RegionModal},45947:function(e){e.exports={section:"section_section__DLuEd"}}}]);