1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[163],{5874:function(e,l,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/my-pages/checkout",function(){return r(6876)}])},222:function(e,l,r){"use strict";var i=r(5893);r(7294);var n=r(5119),t=r(2558);l.Z=()=>{let e=(0,t.nt)(t.gR.shared("Common"),["noOrderConfirmation"]);return(0,i.jsx)(n.bZ,{variant:"info",fullWidth:!0,children:(0,i.jsx)(n.xv,{mb:0,children:e.noOrderConfirmation})})}},5882:function(e,l,r){"use strict";r.d(l,{Z:function(){return g}});var i=r(5893);r(7294);var n=r(7460),t=r(5119),a=r(2729),s=r(8806),o=r(6812);function d(){let e=(0,a._)(["\n query GetCheckoutTranslations {\n b2BMyPagesTranslations {\n key\n value\n }\n}\n "]);return d=function(){return e},e}let u={},c=(0,s.Ps)(d());var v=r(7866),m=r(1953),x=r(919),h=r(2385),b=r(2558),p=r(1065),f=r(9008),y=r.n(f);let j=e=>{var l;let{breadcrumbsLinks:r}=e,n=(0,b.nt)("myPages_common",["home"]),a=(0,b.nt)("myPages",m.hA),s=null!==(l=null==r?void 0:r.map(e=>{var l,r;return{...e,title:null!==(r=e.title)&&void 0!==r?r:a[null!==(l=e.titleTranslationKey)&&void 0!==l?l:""]}}))&&void 0!==l?l:[];return(0,i.jsx)(t.Oo,{links:[{id:"home",url:"/",title:n.home},...s]})},C=e=>{var l,r,a,s,d,m;let{headerQueryResult:b,footerQueryResult:f,translationsQueryResult:C,userData:g,reqData:T,useNavigation:k,breadcrumbsLinks:A,featureFlagsQueryResult:_,children:w}=e,P=(0,x.R)(null==T?void 0:T.headers),R=function(e){let l={...u};return o.a(c,l)}(),S=null===(l=R.data)||void 0===l?void 0:l.b2BMyPagesTranslations,D={...(null==C?void 0:null===(r=C.data)||void 0===r?void 0:r.translations)?(0,x.Mo)(null==C?void 0:null===(a=C.data)||void 0===a?void 0:a.translations):{},...(0,x.fV)("myPages",null!=S?S:[])},O=A[A.length-1]||null;return(0,i.jsxs)(n.iz,{featureFlagsProviderProps:{features:_},localesContextProviderProps:{localeCode:P,translations:D},userData:g,children:[(0,i.jsx)(y(),{children:(0,i.jsx)("title",{children:O.title||!!O.titleTranslationKey&&D["Website_myPages_".concat(O.titleTranslationKey)]||"Focus Nordic"})}),b&&(0,i.jsx)(h.h4,{headerQueryResult:b}),R.loading?(0,i.jsx)(h.aN,{minh:"100vh"}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.kC,{backgroundColor:"white",w:1,justifyContent:"center",children:(0,i.jsx)(t.kC,{flex:1,maxw:p.c$,py:{_:1.5},px:2,children:(0,i.jsx)(j,{breadcrumbsLinks:A})})}),(0,i.jsx)(t.kC,{w:1,h:1,flexDirection:"column",alignItems:"center",backgroundColor:"grey-7",minh:p.cr,children:(0,i.jsx)(t.kC,{flexDirection:"column",alignItems:"center",w:1,maxw:p.c$,minh:p.cr,mt:{_:2,m:7},mb:{_:9,m:7},px:{_:0,m:2},overflow:"unset",children:(0,i.jsxs)(t.kC,{w:1,flex:1,alignItems:"flex-start",justifyContent:"flex-start",flexWrap:"wrap",flexDirection:{_:"column",xl:"row-reverse"},children:[k&&(0,i.jsx)(t.kC,{w:{_:1,xl:.25},mt:{_:0,xl:6},mb:{_:4,xl:0},flexDirection:"column",children:(0,i.jsx)(v.W,{customerName:null!==(m=null==g?void 0:null===(d=g.user)||void 0===d?void 0:null===(s=d.currentCustomer)||void 0===s?void 0:s.name)&&void 0!==m?m:""})}),(0,i.jsx)(t.kC,{w:{_:1,...k&&{xl:.75}},pr:{_:0,xl:k?4:0},flexDirection:"column",flex:1,children:w})]})})})]}),f&&(0,i.jsx)(h.$_,{footerQueryResult:f})]})};var g=e=>{let{headerQueryResult:l,footerQueryResult:r,translationsQueryResult:n,userData:t,reqData:a,useNavigation:s,isFirstServerCall:o,routes:d,customerName:u,breadcrumbsLinks:c,featureFlagsQueryResult:v,children:m}=e,{headerResult:x,footerResult:h,translationsResult:p,userResult:f,featureFlagsResult:y}=(0,b.Vi)({isFirstServerCall:o,headerQueryResult:l,footerQueryResult:r,translationsQueryResult:n,userData:t,featureFlagsQueryResult:v});return(0,i.jsx)(C,{headerQueryResult:x,footerQueryResult:h,translationsQueryResult:p,userData:null!=f?f:{},reqData:a,useNavigation:s,routes:d,customerName:u,breadcrumbsLinks:c,featureFlagsQueryResult:y,children:m})}},7866:function(e,l,r){"use strict";r.d(l,{W:function(){return v},s:function(){return a}});var i=r(5893),n=r(7294),t=r(5119);let a=e=>(0,i.jsx)(t.kC,{flex:1,w:1,p:{_:2,l:3},mb:{_:5,l:3},backgroundColor:"white",...e});a.Title=e=>(0,i.jsx)(t.xv,{variant:"headline-4",mb:1,ml:{_:2,l:0},...e}),a.Subtitle=e=>(0,i.jsx)(t.xv,{textColor:"grey-4",mb:2,ml:{_:2,l:0},...e});var s=r(1065),o=r(3053),d=r(1953),u=r(7460),c=r(1163);let v=e=>{let{customerName:l}=e,r=(0,o.nt)("myPages",d.hA),{localeCode:a}=n.useContext(u.Wy),v=(0,c.useRouter)(),m=n.useMemo(()=>(0,d.MR)(d.Hi,a),[a]);return(0,i.jsx)(t.$6,{children:(0,i.jsxs)(n.Fragment,{children:[(0,i.jsx)(t.xv,{mb:0,py:1.25,px:1.5,fontSize:2.25,textColor:"black",children:l}),(0,i.jsx)("ul",{children:m.map(e=>{let l=v.pathname.startsWith("".concat(s.Ku,"/").concat(e.path));return(null==e?void 0:e.hideFromNavigation)?null:(0,i.jsx)(t.$6.Link,{href:"".concat(s.Ku,"/").concat(e.path),className:l?"active":"",children:(0,i.jsx)(t.xv,{as:"span",textColor:"black",children:r[e.titleTranslationKey]})},e.path)})})]})})}},1953:function(e,l,r){"use strict";r.d(l,{Hi:function(){return c},Kz:function(){return a},MR:function(){return m},P2:function(){return u},fF:function(){return n},fR:function(){return i},hA:function(){return v},v5:function(){return o},vj:function(){return t},wD:function(){return s},yn:function(){return d}});let i={titleTranslationKey:"checkout_checkoutTitle",path:"checkout",hideFromNavigation:!0},n={path:"customer-information",titleTranslationKey:"customerInformation_customerInformationPageTitle"},t={path:"customer-ledger",titleTranslationKey:"customerLedger_customerLedgerPageTitle"},a={path:"order-history",titleTranslationKey:"orderHistory_orderHistoryPageTitle"},s={path:"backorders-list",titleTranslationKey:"backordersList_backordersListPageTitle"},o={path:"tracking",titleTranslationKey:"orderTracking_orderTrackingPageTitle"}
1,d={path:"users",titleTranslationKey:"usersOverview_usersOverviewPageTitle"},u={path:"invoices-and-credit-memos",titleTranslationKey:"invoicesAndCreditMemos_invoicesAndCreditMemosPageTitle",excludedCultures:["ro-ro"]},c=[i,n,t,a,d,s,o,u],v=c.map(e=>e.titleTranslationKey),m=(e,l)=>e.filter(e=>{var r;return!(null===(r=e.excludedCultures)||void 0===r?void 0:r.includes(l))})},6876:function(e,l,r){"use strict";r.r(l),r.d(l,{__N_SSP:function(){return G},default:function(){return W}});var i=r(5893),n=r(7294),t=r(5882),a=r(5119),s=r(1065),o=r(7460),d=r(2558),u=r(9469),c=r(3749),v=r(1326),m=r(7866),x=r(2729),h=r(8806),b=r(6812),p=r(319);function f(){let e=(0,x._)(["\n query GetCheckout {\n allOrderAddresses {\n id\n name\n address\n addressTwo\n postalCode\n city\n country\n isDefault\n }\n}\n "]);return f=function(){return e},e}function y(){let e=(0,x._)(["\n mutation CreateOrder($input: CheckoutInput!) {\n createOrder(input: $input) {\n ... on Order {\n id\n }\n ... on Error {\n code\n message\n }\n ... on CreateOrderError {\n message\n code\n }\n }\n}\n "]);return y=function(){return e},e}let j={},C=(0,h.Ps)(f()),g=(0,h.Ps)(y());var T=r(7223),k=r(3990),A=r(2283),_=r(919);let w=n.createContext({setIsDropShipAddress:()=>{},isDropShipAddress:!1}),P=e=>{let{localeCode:l}=n.useContext(o.Wy),{data:r}=function(e){let l={...j,...e};return b.a(C,l)}({fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),[t,a]=n.useState(!1),s=(0,_.WE)(null==r?void 0:r.allOrderAddresses),d=(0,A.cI)({defaultValues:{deliveryOption:T.pA.Partial,countryCode:(0,_.bT)(l).toUpperCase(),shippingAddress:{country:(0,_.bT)(l).toUpperCase()},selectedAddress:null==s?void 0:s.id}});return n.useEffect(()=>{if(!(null==r?void 0:r.allOrderAddresses))return;let e=(0,_.WE)(r.allOrderAddresses);e&&d.setValue("selectedAddress",e.id)},[r]),(0,i.jsx)(w.Provider,{value:{checkoutData:r,form:d,isDropShipAddress:t,setIsDropShipAddress:a},...e})},R=()=>n.useContext(w),S=[{value:"AL",label:"Albania (Shqip\xebria)"},{value:"AD",label:"Andorra (Andorra)"},{value:"AM",label:"Armenia, (Hayast\xe1n)"},{value:"AT",label:"Austria (\xd6sterreich)"},{value:"AZ",label:"Azerbaijan (AzÉrbaycan)"},{value:"BY",label:"Belarus (BielaruÅ, ÐелаÑÑÑÑ)"},{value:"BE",label:"Belgium"},{value:"BA",label:"Bosnia and Herzegovina (Bosnia I Hercegov\xedna, ÐоÑна и ХеÑÑеговина)"},{value:"BG",label:"Bulgaria (Bulgariya, ÐÑлгаÑиÑ)"},{value:"CZ",label:"Czech Republic (Äesk\xe1 republika)"},{value:"HR",label:"Croatia (Hrvatska)"},{value:"CY",label:"Cyprus (ÎÏÏÏÎ¿Ï Kıbrıs)"},{value:"DK",label:"Denmark (Danmark)"},{value:"EE",label:"Estonia (Eesti)"},{value:"FO",label:"Faroe Islands (F\xf8royar)"},{value:"FI",label:"Finland (Suomi)"},{value:"FR",label:"France (France)"},{value:"GR",label:"Greece (Hellas ÎλλάÏ)"},{value:"GL",label:"Greenland"},{value:"GE",label:"Georgia (Sak'art'velo á¡áá¥áá ááááá)"},{value:"DE",label:"Germany (Deutschland)"},{value:"HU",label:"Hungary (Magyarorsz\xe1g)"},{value:"IS",label:"Iceland (\xcdsland)"},{value:"IE",label:"Ireland (Ireland, \xc9ire)"},{value:"IT",label:"Italy (Italia)"},{value:"XK",label:"Kosovo (Kosova, ÐоÑово)"},{value:"LV",label:"Latvia (Latvija)"},{value:"LI",label:"Liechtenstein (Liechtenstein)"},{value:"LT",label:"Lithuania (Lietuva)"},{value:"LU",label:"Luxemburg (Luxembourg, Luxemburg, L\xebtezebuerg)"},{value:"MT",label:"Malta (Malta)"},{value:"MD",label:"Moldova (Moldova)"},{value:"ME",label:"Montenegro (Crna Gora ЦÑна ÐоÑа)"},{value:"NL",label:"Netherlands (Nederland, Nederl\xe2n)"},{value:"MK",label:"North Macedonia (Severna Makedonija СевеÑна ÐакедониÑа)"},{value:"NO",label:"Norway, (Norge)"},{value:"PL",label:"Poland (Polska)"},{value:"PT",label:"Portugal (Portugal)"},{value:"RO",label:"Romania (Rom\xe2nia)"},{value:"RU",label:"Russian (Rossi\xe2 РоÑÑиÑ)"},{value:"RS",label:"Serbia (Srbija СÑбиÑа)"},{value:"ES",label:"Spain (Espa\xf1a, Espanya, Espainia)"},{value:"SK",label:"Slovakia (Slovensko)"},{value:"SI",label:"Slovenia (Slovenija)"},{value:"SE",label:"Sweden (Sverige)"},{value:"CH",label:"Switzerland (Suisse, Schweiz, Svizzera, Svizra)"},{value:"TR",label:"Turkey (T\xfcrkiye)"},{value:"UA",label:"Ukraine (UkraÑna УкÑаÑна)"},{value:"GB",label:"United Kingdom"},{value:"AX",label:"\xc5land Island (Ahvenanmaa)"}];var D=r(2261);let O=e=>{var l,r,n,t,o;let{form:u}=R(),{register:c,errors:v}=u,m=(0,d.nt)("myPages_checkout",["deliveryNameTitle","deliveryAddressTitle","deliveryAddressTitleTwo","deliveryZipCodeTitle","deliveryCityTitle","dropshipCompleteAddressTitle","deliveryCountryTitle"]);return(0,i.jsxs)(a.kC,{flexDirection:"column",flex:1,children:[(0,i.jsx)(a.xv,{variant:"headline-6",mb:2,children:m.dropshipCompleteAddressTitle}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.nv,{label:m.deliveryNameTitle,name:"shippingAddress.name",error:!!(null===(l=v.shippingAddress)||void 0===l?void 0:l.name),inputRef:c({required:!0,validate:D.HH}),maxLength:35})}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.nv,{label:m.deliveryAddressTitle,name:"shippingAddress.addressOne",error:!!(null===(r=v.shippingAddress)||void 0===r?void 0:r.addressOne),inputRef:c({required:!0,validate:D.HH}),maxLength:35})}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.nv,{label:m.deliveryAddressTitleTwo,name:"shippingAddress.addressTwo",inputRef:c(),maxLength:35})}),(0,i.jsxs)(a.kC,{flex:1,w:1,flexDirection:{_:"column",s:"row"},children:[(0,i.jsx)(a.kC,{mb:2,flex:1,pr:{s:2},children:(0,i.jsx)(a.nv,{label:m.deliveryZipCodeTitle,name:"shippingAddress.postalCode",error:!!(null===(n=v.shippingAddress)||void 0===n?void 0:n.postalCode),inputRef:c({required:!0,validate:D.HH}),maxLength:20})}),(0,i.jsx)(a.kC,{mb:2,flex:2,children:(0,i.jsx)(a.nv,{label:m.deliveryCityTitle,name:"shippingAddress.city",error:!!(null===(t=v.shippingAddress)||void 0===t?void 0:t.city),inputRef:c({required:!0,validate:D.HH}),maxLength:s.P_})})]}),(0,i.jsx)(a.kC,{mb:4,children:(0,i.jsx)(a.Ph,{"aria-label":m.deliveryCountryTitle,label:m.deliveryCountryTitle,options:S,name:"shippingAddress.country",error:!!(null===(o=v.shippingAddress)||void 0===o?void 0:o.country),inputRef:c({required:!0,validate:D.HH})})})]})};var E=r(5152);let L=r.n(E)()(()=>
1Promise.all([r.e(810),r.e(544)]).then(r.bind(r,5544)),{loadableGenerated:{webpack:()=>[5544]},ssr:!1}),N=e=>{var l,r,t,s,u,c;let{form:v,isDropShipAddress:x,setIsDropShipAddress:h}=R(),{register:b,trigger:p,errors:f,getValues:y,setValue:j}=v,{userData:C}=(0,o.SE)(),g=!!(null==C?void 0:null===(r=C.user)||void 0===r?void 0:null===(l=r.currentCustomer)||void 0===l?void 0:l.usingDropship),[A,_]=n.useState(!1);n.useEffect(()=>{x?j("deliveryOption",T.pA.Full):j("deliveryOption",T.pA.Partial),_(x)},[x]);let w=(0,d.nt)("myPages_checkout",["deliveryTitle","dropshipAddressTitle","deliveryOptionsTitle","partialDeliveryTitle","fullDeliveryTitle","freeFreightTitle","notificationsTitle","smsNotificationTitle","phoneTitle","phoneErrorMessage"]);return(0,i.jsx)(m.s,{flex:1,children:(0,i.jsxs)(a.kC,{flexDirection:"column",flex:1,children:[(0,i.jsx)(a.xv,{variant:"headline-6",mb:2,children:w.deliveryTitle}),g&&(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.XZ,{label:w.dropshipAddressTitle,onChange:()=>h(e=>!e)})}),x&&(0,i.jsx)(a.kC,{flexDirection:"column",children:(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(O,{})})}),!x&&(0,i.jsx)(a.kC,{mb:4,children:e.orderAddresses&&(0,i.jsx)(a.Ph,{name:"selectedAddress",error:!!f.selectedAddress,inputRef:b({required:!0}),"aria-label":w.deliveryTitle,options:null===(t=e.orderAddresses)||void 0===t?void 0:t.map(e=>({label:"".concat(e.name,", ").concat(e.address,", ").concat(e.addressTwo,", ").concat(e.postalCode,", ").concat(e.country),value:e.id}))})}),(0,i.jsx)(a.xv,{variant:"headline-6",mb:2,children:w.deliveryOptionsTitle}),(0,i.jsx)(a.kC,{borderBottom:g,borderColor:g?"grey-1":void 0,pb:g?2:void 0,mb:g?4:void 0,children:(0,i.jsxs)(a.kC,{flex:1,flexDirection:{_:"column",s:"row"},maxw:60,justifyContent:"space-between",children:[(0,i.jsxs)(a.kC,{flexDirection:{_:"column",s:"row"},children:[!x&&(0,i.jsx)(a.kC,{pr:{s:2},mb:2,children:(0,i.jsx)(a.Y8,{label:w.partialDeliveryTitle,name:"deliveryOption",value:T.pA.Partial,inputRef:b({required:!0})})}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.Y8,{label:w.fullDeliveryTitle,name:"deliveryOption",value:T.pA.Full,inputRef:b({required:!0})})})]}),(0,i.jsx)(a.kC,{mb:2,flexDirection:{_:"column",s:"row"},children:(null==C?void 0:null===(s=C.user)||void 0===s?void 0:s.isSeller)&&(0,i.jsx)(a.XZ,{label:w.freeFreightTitle,name:"freeFreight",inputRef:b()})})]})}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.xv,{variant:"headline-6",mb:2,children:w.notificationsTitle}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.XZ,{label:w.smsNotificationTitle,checked:A,onChange:()=>{x||_(e=>!e)}})}),A&&(0,i.jsx)(a.kC,{flex:1,w:1,maxw:60,children:(0,i.jsx)(n.Suspense,{fallback:(0,i.jsx)(k.a,{}),children:(0,i.jsx)(L,{name:"smsNotification.phone",register:b,trigger:p,getValues:y,label:w.phoneTitle,helperText:(null===(u=f.smsNotification)||void 0===u?void 0:u.phone)&&w.phoneErrorMessage,error:!!(null===(c=f.smsNotification)||void 0===c?void 0:c.phone)})})})]})]})})};var M=r(2385);let I=e=>{var l,r,n;let{form:t}=R(),{register:s,errors:u}=t,{userData:c}=(0,o.SE)(),v=e.invoiceAddress||(null==c?void 0:null===(r=c.user)||void 0===r?void 0:null===(l=r.currentCustomer)||void 0===l?void 0:l.invoiceAddress),x=(0,d.nt)("myPages_checkout",["invoiceTitle","companyNameTitle","invoiceAddressTitle","invoiceZipCodeTitle","invoiceCityTitle","invoiceCountryTitle","invoiceAddressInfo","orderDetailsTitle","clientReferenceNumberTitle","clientReferencePerson","orderProcessorMessageTitle","sellerMessageTitle"]),h=e=>null!=e?e:void 0;return(0,i.jsxs)(m.s,{alignItems:"flex-start",flexDirection:{_:"column",xl:"row"},flex:1,w:1,children:[(0,i.jsxs)(a.kC,{flexDirection:"column",flex:1,mr:{xl:4},children:[(0,i.jsx)(a.xv,{variant:"headline-6",mb:2,children:x.invoiceTitle}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.nv,{label:x.companyNameTitle,disabled:!0,name:"billingAddress.name",value:h(null==v?void 0:v.name)})}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.nv,{label:x.invoiceAddressTitle,disabled:!0,name:"billingAddress.addressOne",value:h(null==v?void 0:v.addressOne)})}),(0,i.jsxs)(a.kC,{flex:1,w:1,flexDirection:{_:"column",s:"row"},children:[(0,i.jsx)(a.kC,{mb:2,flex:1,pr:{s:2},children:(0,i.jsx)(a.nv,{label:x.invoiceZipCodeTitle,disabled:!0,name:"billingAddress.postalCode",value:h(null==v?void 0:v.postalCode)})}),(0,i.jsx)(a.kC,{mb:2,flex:2,children:(0,i.jsx)(a.nv,{label:x.invoiceCityTitle,disabled:!0,name:"billingAddress.city",value:h(null==v?void 0:v.city)})})]}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.nv,{label:x.invoiceCountryTitle,disabled:!0,name:"billingAddress.country",value:h(null==v?void 0:v.country)})}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(M.Eb,{content:x.invoiceAddressInfo})})]}),(0,i.jsxs)(a.kC,{flexDirection:"column",flex:1,justifyContent:"start",w:1,children:[(0,i.jsx)(a.xv,{variant:"headline-6",mb:2,children:x.orderDetailsTitle}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.nv,{label:x.clientReferenceNumberTitle,name:"externalReferenceNumber",error:!!u.externalReferenceNumber,inputRef:s(),maxLength:35})}),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.nv,{label:x.clientReferencePerson,name:"clientReferencePerson",error:!!u.clientReferencePerson,inputRef:s(),maxLength:35})}
1),(0,i.jsx)(a.kC,{mb:2,children:(0,i.jsx)(a.Kx,{label:x.orderProcessorMessageTitle,rows:5,name:"orderProcessorMessage",error:!!u.orderProcessorMessage,maxLength:200,inputRef:s()})}),(null==c?void 0:null===(n=c.user)||void 0===n?void 0:n.isSeller)&&(0,i.jsx)(a.kC,{children:(0,i.jsx)(a.Kx,{label:x.sellerMessageTitle,rows:5,name:"sellerMessage",error:!!u.sellerMessage,maxLength:200,inputRef:s()})})]})]})};var K=r(823),F=r(5041),H=r(1163),B=r(222);let z=()=>{var e,l,r,t;let x=(0,d.nt)("myPages_checkout",["checkoutSubmitCta","checkoutTitle","orderTitle","invoiceTitle","deliveryTitle","checkoutConsentTitle"]),h=(0,d.nt)("myPages",["orderCreationErrorMessage"]),{localeCode:b}=n.useContext(o.Wy),{cart:f}=(0,d.jD)(),{userData:y}=(0,o.SE)(),C=(0,d.Je)(),k=(0,d.nu)(),A=null==y?void 0:null===(l=y.user)||void 0===l?void 0:null===(e=l.currentCustomer)||void 0===e?void 0:e.invoiceAddress,w=n.useRef(),[P,S]=n.useState(!1),[D,O]=n.useState(!1),[E,L]=n.useState(!1),[M,z]=function(e){let l={...j};return p.D(g,l)}(),[Z,q]=n.useState([]),[G,W]=n.useState(""),{form:V,checkoutData:Q,isDropShipAddress:U}=R(),{handleSubmit:X}=V,$=(0,H.useRouter)(),{features:Y}=(0,d.gV)(),J=e=>{var l,r,i,n,t,a,s;let{selectedAddress:o,countryCode:d,...u}=e,c=null==Q?void 0:null===(l=Q.allOrderAddresses)||void 0===l?void 0:l.find(e=>e.id===o);L(!0);let v={...u,...!U&&{shippingAddress:{name:null!==(r=null==c?void 0:c.name)&&void 0!==r?r:"",addressOne:null!==(i=null==c?void 0:c.address)&&void 0!==i?i:"",addressTwo:null!==(n=null==c?void 0:c.addressTwo)&&void 0!==n?n:"",postalCode:null!==(t=null==c?void 0:c.postalCode)&&void 0!==t?t:"",city:null!==(a=null==c?void 0:c.city)&&void 0!==a?a:"",country:null!==(s=null==c?void 0:c.country)&&void 0!==s?s:""}},...f.items&&{cartItems:f.items.map(e=>{var l,r,i;let n=C&&k&&(null===(l=e.price)||void 0===l?void 0:l.netPrice)!==(null===(i=e.product)||void 0===i?void 0:null===(r=i.price)||void 0===r?void 0:r.netPrice);return(0,_.Ic)(e,n)})}};f.items&&q(f.items),M({variables:{input:v},update:(e,l)=>{let{data:r}=l,i=null==r?void 0:r.createOrder;if((null==i?void 0:i.__typename)==="Order"){let l=e.readQuery({query:K.tt});e.writeQuery({query:K.tt,data:{...l,...(null==l?void 0:l.cart)&&{cart:{...l.cart,items:[]}}}})}else(null==i?void 0:i.__typename)==="CreateOrderError"&&W(h.orderCreationErrorMessage)}})};return(0,d.Z5)(T.gw.B2B,1,f.items),n.useEffect(()=>{var e,l,r,i,n;(null===(l=z.data)||void 0===l?void 0:null===(e=l.createOrder)||void 0===e?void 0:e.__typename)==="Order"?((0,_.Qc)({userType:T.gw.B2B,orderId:null!==(n=z.data.createOrder.id)&&void 0!==n?n:"",revenue:(0,F.netPriceSum)(Z),cartItems:Z,tax:0,shipping:0}),$.push("checkout/order-confirmation/".concat(z.data.createOrder.id))):(z.error||(null===(i=z.data)||void 0===i?void 0:null===(r=i.createOrder)||void 0===r?void 0:r.__typename)==="CreateOrderError")&&L(!1)},[z,Z,$]),n.useEffect(()=>{var e;O((0,_.G0)(null!==(e=null==f?void 0:f.items)&&void 0!==e?e:[]))},[f.items]),(0,i.jsxs)(a.kC,{w:1,flexDirection:"column",children:[(0,i.jsx)(m.s.Title,{children:x.checkoutTitle}),(0,i.jsxs)(a.kC,{w:1,alignItems:"flex-start",flexDirection:{_:"column",l:"row"},children:[(0,i.jsxs)(a.kC,{w:1,mr:3,flexDirection:"column",children:[Y.isCheckoutNotificationEnabled&&(0,i.jsx)(a.kC,{w:1,mb:3,children:(0,i.jsx)(B.Z,{})}),(0,i.jsx)(m.s,{flex:1,children:(0,i.jsx)(c.A.ProductList,{columnLayoutBreakpoint:"xl",shouldInitCart:!0,isSubmittingOrder:E})}),!!(null===(r=f.items)||void 0===r?void 0:r.length)&&Q&&y&&(0,i.jsxs)(a.kC,{flexDirection:"column",ref:w,as:"form",onSubmit:X(J),children:[(0,i.jsx)(m.s.Title,{children:x.orderTitle}),(0,i.jsx)(I,{invoiceAddress:A}),(0,i.jsx)(m.s.Title,{children:x.deliveryTitle}),(0,i.jsx)(N,{orderAddresses:Q.allOrderAddresses})]})]}),!!(null===(t=f.items)||void 0===t?void 0:t.length)&&(0,i.jsx)(a.kC,{w:1,maxw:{l:38},position:{l:"sticky"},top:u.bA.px(s.d0.desktop+3),children:(0,i.jsxs)(m.s,{flexDirection:"column",flex:1,children:[(0,i.jsx)(c.A.Summary,{}),(0,i.jsx)(v.V.PriceRow,{title:x.invoiceTitle,price:(0,_.Ig)({currency:f.currency,netPrice:0},b)}),(0,i.jsxs)(a.kC,{py:1.5,children:[(0,i.jsx)(v.V.ConsentCheckbox,{onChange:()=>S(!P)}),(0,i.jsx)(v.V.ConsentLabel,{labelText:x.checkoutConsentTitle})]}),(0,i.jsx)(a.zx,{variant:"green",type:"button",disabled:!P||z.loading||D||E,onClick:()=>{X(J)()},children:x.checkoutSubmitCta})]})})]}),G&&(0,i.jsx)(a.FN,{type:"error",message:G,onClose:()=>W("")})]})},Z=()=>(0,i.jsx)(P,{children:(0,i.jsx)(z,{})});var q=r(1953),G=!0,W=e=>(0,i.jsx)(t.Z,{...e,breadcrumbsLinks:[{id:q.fR.path,url:q.fR.path,titleTranslationKey:q.fR.titleTranslationKey}],children:(0,i.jsx)(Z,{})})},9008:function(e,l,r){e.exports=r(3867)}},function(e){e.O(0,[510,483,888,774,179],function(){return e(e.s=5874)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.