(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1736],{4600:function(e,n,o){"use strict";o.r(n),o.d(n,{default:function(){return M}});var i=o(4988),t=o(4235),l=o(3888),a=o.n(l),r=o(4194),s=o(6652),u=o(2614),d=o(3412),c=o(2011),p=o(31),g=o(4064),b=o(3303),m=o(5947),f=o.n(m),h=o(1549),v=["title","description","closeButtonAriaLabel"],P=["isValidating"],k=a()(()=>Promise.all([o.e(9666),o.e(4836),o.e(9781),o.e(5906)]).then(o.bind(o,4836)).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,x=(0,t.Z)(e,v),y=(0,b.T)(x),{inputField:{label:C="",errorMessage:R="",noProductsAvailableErrorMessage:_="",buttonActionText:A=""}={},idkPostalCodeLink:{text:L="",to:E="",icon:{icon:Z="",alt:j=""}={}}={}}=null!==(o=null==y?void 0:y.regionalization)&&void 0!==o?o:{},w=(0,r.useRef)(null),S=(0,p.kP)(),{isValidating:T}=S,B=(0,t.Z)(S,P),{modal:F,closeModal:N}=(0,s.l8)(),{0:z,1:O}=(0,r.useState)(""),{loading:V,setRegion:D,regionError:G,setRegionError:I}=(0,g.Z)(),K=(n=(0,i.Z)(function*(){T||(yield D({session:B,onSuccess:()=>{l(),O(""),N()},postalCode:z,errorMessage:R,noProductsAvailableErrorMessage:_}))}),function(){return n.apply(this,arguments)}),$=!!(!(null!==d.deliveryPromise&&void 0!==d.deliveryPromise&&d.deliveryPromise.mandatory)||B.postalCode),q={href:E,children:(0,h.jsxs)(h.Fragment,{children:[L,!!Z&&(0,h.jsx)(u.Z,{name:Z,"aria-label":j,width:20,height:20})]})};return(0,h.jsx)(h.Fragment,{children:F&&(0,h.jsx)(k,{title:a,description:m,overlayProps:{className:"section ".concat(f().section," section-region-modal")},closeButtonAriaLabel:M,inputRef:w,inputValue:z,inputLabel:C,errorMessage:G,idkPostalCodeLinkProps:E?q:null,onInput:e=>{""!==G&&I(""),O(e.currentTarget.value)},onSubmit:K,fadeOutOnSubmit:!1,onClear:()=>{O(""),I("")},inputButtonActionText:V?"...":A,dismissible:$})})}RegionModal.$componentKey="RegionModal";var M=RegionModal},5947:function(e){e.exports={section:"section_section__DLuEd"}}}]);