PageSourceSearch

https://www.liber.se/_next/static/chunks/pages/[opco]/[locale]/checkout-b18d6b7e2de83344.js

js liber.se collected 2026-10-02 07:35:10 UTC 79,319 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[769],{16817:(e,t,r)=>{"use strict";r.d(t,{_:()=>a});var l=r(29454),i=r(14232),n=r(72028),s=r(36148);let a=()=>{let e=(0,s.x)(),[t,r]=i.useState(!1);return i.useEffect(()=>{if(!/^\?disableMaintenanceMode/.test(window.location.search))return l.A.get(n.U.MAINTENANCE_MODE_DISABLED)?r(!1):r(!!(null==e?void 0:e.webshopMaintenanceMode));r(!1),l.A.set(n.U.MAINTENANCE_MODE_DISABLED,"true",{expires:365})},[]),{isMaintenanceMode:t}}},27714:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[opco]/[locale]/checkout",function(){return r(67303)}])},31688:(e,t,r)=>{"use strict";r.d(t,{B:()=>i,Q:()=>n});var l=r(79077);let i=l.default.div.withConfig({componentId:"sc-71ee7524-0"})(["display:flex;flex-wrap:wrap;transition:opacity 5s ease-in-out;background:white;width:100%;& > div > div > div{color:",";}",""],e=>{let{theme:t}=e;return t.palette.secondary.main},e=>{let{productsQuantity:t,maxProductQtyPerLine:r}=e;return t>r&&(0,l.css)(["& > div > div{-webkit-mask-image:none;margin-bottom:3rem;}& > div > div > div{width:100%;display:flex;flex-wrap:wrap;}"])}),n=l.default.div.withConfig({componentId:"sc-71ee7524-1"})(["display:block;width:100%;p{max-width:35rem;}"])},48712:(e,t,r)=>{"use strict";r.d(t,{n:()=>p});var l=r(3576),i=r(62701),n=r(37876),s=r(29454),a=r(89099),o=r(61),d=r(38776),c=r(8255),u=r(72028),m=r(30534),h=r(70360),g=r(41496);let p=e=>{let t,{cmsNavBar:r,cmsFooter:p,children:v}=e,{currentLocale:f,setCurrentLocale:y}=(0,g.Ym)(),b=(0,a.useRouter)();if("plantyn"===(0,g.$d)()){let{content:e}=(0,g.NA)((0,i._)((0,l._)({},c.Z.LanguageBanner),{currentLocale:f}));t=e}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.oJ,{locale:f}),!(()=>!!s.A.get(u.U.LANGUAGE_PREFERENCE))&&t&&(0,n.jsx)(o.vZ,{continueButtonText:null==t?void 0:t.buttonContinue,continueText:null==t?void 0:t.textContinue,changeLanguageText:null==t?void 0:t.textChangeLanguage,onChangeLanguage:()=>void(s.A.set(u.U.LANGUAGE_PREFERENCE,null==p?void 0:p.changeLanguageTo),y(p.changeLanguageTo),b.push("/".concat(null==p?void 0:p.changeLanguageTo,"/home"))),onSelectContinue:()=>s.A.set(u.U.LANGUAGE_PREFERENCE,null==t?void 0:t.language)}),r&&(0,n.jsx)(h.h,{cmsNavBar:r,locale:f,simpleNavbar:!0}),(0,n.jsxs)(o.Mx,{numberOfColumns:18,columnWidth:"1fr",topRowHeight:"5rem",bottomRowHeight:"20rem",children:[(0,n.jsx)(o.d8,{type:o.yp.Navbar,children:r&&(0,n.jsx)(d.B,{cmsData:r,simpleNavbar:!0})}),(0,n.jsx)(o.d8,{children:v})]}),p&&(0,n.jsx)(m.R,{cmsFooter:(0,l._)({},p)})]})}},55590:(e,t,r)=>{"use strict";r.d(t,{E:()=>i,g:()=>l});let l=function(e,t,r,l){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=i?[l?e.informationTextB2b:e.informationTextB2c].filter(Boolean):[e.infoText1,e.infoText2].filter(Boolean);return{locale:t,currency:r,title:e.title,total:{key:l&&e.excludingShippingTextLiber?"".concat(e.totalPriceText," ").concat(e.excludingShippingTextLiber):e.totalPriceText,value:0},totalTaxText:e.totalTaxText,shipping:{key:i&&!l&&e.shipmentTextLiberB2c||e.shipmentText,value:0,label:i&&!l&&e.shipmentTextValueLiberB2c||e.shipmentTextValue},buttonText:e.buttonText,extraInfo:n,products:[],editUrl:"",qtySingularTextWithPrice:e.qtySingularTextWithPrice,qtyPluralTextWithPrice:e.qtyPluralTextWithPrice,taxDetails:{hideContent:e.hideVatLabel,showContent:e.showVatLabel,description:e.vatDescription},priceWithoutTaxes:{key:e.totalPriceWithoutTaxLabel,value:0},taxes:[]}},i=function(e,t,r,l){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=i?[l?e.informationTextB2b:e.informationTextB2c].filter(Boolean):[e.infoText1,e.infoText2].filter(Boolean);return{locale:t,currency:r,title:e.title,total:{key:l&&e.excludingShippingTextLiber?"".concat(e.totalPriceText," ").concat(e.excludingShippingTextLiber):e.totalPriceText,value:0},totalTaxText:e.totalTaxText,shipping:{key:i&&!l&&e.shipmentTextLiberB2c||e.shipmentText,value:0,label:i&&!l&&e.shipmentTextValueLiberB2c||e.shipmentTextValue},subtotal:{key:e.subtotalText,value:0},buttonText:e.buttonText,extraInfo:n,products:[],editUrl:""}}},63235:(e,t,r)=>{"use strict";r.d(t,{e:()=>i});var l=r(68563);let i=(e,t)=>{let r=t.copyType,i=[l.D.INSPECTION_COPY,l.D.USE_COPY,l.D.TEACHER_COPY].find(e=>e.key===r);return i?e[i.value]:null==e?void 0:e.regularCopy}},67303:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CheckoutPage:()=>tN,__N_SSG:()=>tT,default:()=>tS});var l=r(37876),i=r(14232),n=r(68235),s=r(18595),a=r(89099),o=r(1645),d=r(61),c=r(58458),u=r(3576),m=r(62701),h=r(75625);r(93754);var g=r(9919),p=r(39175),v=r(82092),f=r(55590),y=r(68563),b=r(17046);let x=e=>e.copyType===y.D.TEACHER_COPY.key,j=e=>e.copyType!==y.D.REGULAR_COPY.key,C=e=>0===e.price||"0"===e.price||void 0===e.price||""===e.price,T=e=>!!e&&e.items.some(x),N=e=>!!e&&e.items.some(C),S=e=>!!e&&e.items.some(j),E=(e,t)=>["NL"].includes(e)?t.replace(" ","").split(/([0-9]+)/).filter(e=>e.length).join(" "):t,w=(e,t,r)=>{let l=e.findIndex(e=>e.key===t);l>=0?e[l].value+=r:e.push({key:t,value:r})},A=e=>e.reduce((e,t)=>
1{if(0===t.basePrice&&t.groupMembers)A(t.groupMembers).forEach(t=>{let{key:r,value:l}=t;w(e,r,l)});else{let{key:r,value:l}=(e=>{let t="".concat(e.taxRate," %"),r=e.basePrice?e.basePrice*e.quantity:0,l=(0,b.z0)(r)*e.taxRate/100;return{key:t,value:(0,b.z0)(l)}})(t);w(e,r,l)}return[...e]},[]),D=(e,t)=>{var r,l,i;return{key:null!=(l=null==(r=e.total)?void 0:r.key)?l:"",value:null!=(i=null==t?void 0:t.priceTotal)?i:0}},I=(e,t)=>{var r,l;let i=0;return t&&(i=(null==t?void 0:t.items).reduce((e,t)=>(0===t.basePrice&&t.groupMembers?t.groupMembers.forEach(t=>{let{basePrice:r,quantity:l}=t;e+=r*l}):e+=(t.basePrice||0)*t.quantity,e),0)),{value:i,key:null!=(l=null==(r=e.priceWithoutTaxes)?void 0:r.key)?l:""}},P=(e,t)=>{var r,l,i,n,s;return{key:null!=(i=null==(r=e.shipping)?void 0:r.key)?i:"",label:null!=(n=null==(l=e.shipping)?void 0:l.label)?n:"",value:null!=(s=null==t?void 0:t.shippingCost)?s:0}};var k=r(40813),M=r(63235),O=r(83371),F=r(41496),_=r(72786);async function L(e,t){let{country:r,postcode:l,streetName:i,houseNumber:n,houseNumberAddition:s,city:a}=t;if(!r||!l||!i||!n||!a)return{valid:!0};try{let t=await e.validateAddress({country:r,postcode:l,streetName:i,houseNumber:n,houseNumberAddition:s,city:a});return{valid:t.valid,error:t.valid?void 0:"addressValidationInvalid",suggestions:t.suggestions}}catch(e){return console.error("[Validation] Shipping address validation error:",e),{valid:!1,error:"addressValidationInvalid"}}}async function R(e,t){let{billingCountry:r,billingPostcode:l,billingStreetName:i,billingHouseNumber:n,billingHouseNumberAddition:s,billingCity:a}=t;if(!r||!l||!i||!n||!a)return{valid:!0};try{let t=await e.validateAddress({country:r,postcode:l,streetName:i,houseNumber:n,houseNumberAddition:s,city:a});return{valid:t.valid,error:t.valid?void 0:"addressValidationInvalid",suggestions:t.suggestions}}catch(e){return console.error("[Validation] Billing address validation error:",e),{valid:!1,error:"addressValidationInvalid"}}}let U=()=>{let{addressValidationService:e}=i.useContext(_.e),[t,r]=(0,i.useState)(!1),[l,n]=(0,i.useState)(null),s=(0,i.useCallback)(async t=>{if(!e)return{valid:!0};r(!0),n(null);try{let r=await L(e,t);return!r.valid&&r.error&&n(r.error),r}catch(t){let e=t instanceof Error?t.message:"Unknown error";return n(e),{valid:!1,error:e}}finally{r(!1)}},[e]);return{validateShippingAddress:s,validateBillingAddress:(0,i.useCallback)(async t=>{if(!e)return{valid:!0};r(!0),n(null);try{let r=await R(e,t);return!r.valid&&r.error&&n(r.error),r}catch(t){let e=t instanceof Error?t.message:"Unknown error";return n(e),{valid:!1,error:e}}finally{r(!1)}},[e]),isValidating:t,error:l,clearCache:(0,i.useCallback)(()=>{e&&e.clearCache(),n(null)},[e])}};var B=r(16817),V=r(48497),q=r(79077);let Y=q.default.div.withConfig({componentId:"sc-d693c31a-0"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;width:90rem;padding:1rem 5rem;margin:0 auto;@media screen and (max-width:600px){width:100%;padding:1rem 1rem;}"]),W=q.default.div.withConfig({componentId:"sc-d693c31a-1"})(["display:flex;flex-direction:row;justify-content:flex-start;align-content:center;align-items:center;padding:1rem 0;"]),$=q.default.div.withConfig({componentId:"sc-d693c31a-2"})(["display:flex;flex-direction:row;justify-content:space-between;width:100%;align-items:flex-start;@media screen and (min-width:601px){form,> div{width:55%;}aside{width:35%;}}@media screen and (max-width:600px){flex-direction:column;form{width:100%;}aside{width:100%;}}"]),z=q.default.div.withConfig({componentId:"sc-d693c31a-3"})(["width:35%;padding:1rem 0;@media screen and (max-width:600px){justify-content:center;display:flex;width:100%;}"]),H=q.default.div.withConfig({componentId:"sc-d693c31a-4"})(["display:",";"],e=>{let{toHide:t}=e;return t?"none":"block"}),Z=q.default.div.withConfig({componentId:"sc-19934531-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start;width:90rem;padding:1rem 5rem;margin:0 auto;aside{width:35%;}@media screen and (max-width:600px){flex-direction:column;width:100%;padding:1rem 1rem;aside{width:100%;}}"]),K=q.default.div.withConfig({componentId:"sc-19934531-1"})(["@media screen and (min-width:601px){width:55%;}"]);q.default.div.withConfig({componentId:"sc-19934531-2"})(["padding-top:4rem;"]);let G=(e,t)=>e?"".concat(e).concat((0,b.Zr)(t)):t;var Q=r(39149),X=r.n(Q);let J=e=>{var t,r,n,s;let{register:a,disabled:o=!1,findInputCmsData:d,errors:c,control:u,userDetails:m,formErrorFor:h,namePrefix:g,emailBlacklist:p,readOnlyName:v,readOnlyEmail:f}=e,y=G(g,"firstName"),b=G(g,"lastName"),x=G(g,"email"),j=G(g,"confirmEmail"),C=d(y),T=d(b),N=d(x),S=d(j);i.useEffect(()=>{a(y),a(b),a(x),a(j)},[a,y,b,x,j]);let E=u.validFieldsRef.current,w=(null==p?void 0:p.some(e=>null==m?void 0:m.email.includes(e)))||!1,A=(null==m?void 0:m.firstName)?v:void 0,D=(null==m?void 0:m.lastName)?v:void 0,I=!!A,P=!!D,k=(null==m?void 0:m.email)?f:void 0,M=!!k,O=(0,q.css)(["display:none !important;"]),F=(0,q.css)(["margin-top:1.2rem;"]);
1return(0,l.jsxs)(l.Fragment,{children:[C&&(0,l.jsx)(ee,{type:"text",label:C.label,placeholder:C.placeholder,name:y,ref:a,htmlFor:y,disabled:o,errors:c[y],errorMessage:h(null==(t=c[y])?void 0:t.message),success:E[y],defaultValue:null==m?void 0:m.firstName,readOnly:A,customLabelStyle:I?O:void 0,$_css:I?O:void 0}),T&&(0,l.jsx)(et,{type:"text",label:T.label,placeholder:T.placeholder,name:b,htmlFor:b,ref:a,disabled:o,errors:c[b],errorMessage:h(null==(r=c[b])?void 0:r.message),customLabelStyle:P?O:F,success:E[y],defaultValue:null==m?void 0:m.lastName,readOnly:D,$_css2:P?O:void 0}),N&&(0,l.jsx)(er,{type:"email",label:N.label,placeholder:N.placeholder,name:x,htmlFor:x,ref:a,disabled:o,errors:c[x],errorMessage:h(null==(n=c[x])?void 0:n.message),customLabelStyle:M?O:I&&P?void 0:F,success:E[x],defaultValue:w?"":null==m?void 0:m.email,readOnly:k,$_css3:M?O:void 0}),S&&(0,l.jsx)(el,{type:"email",label:S.label,placeholder:S.placeholder,name:j,htmlFor:j,ref:a,disabled:o,errors:c[j],errorMessage:h(null==(s=c[j])?void 0:s.message),customLabelStyle:M?O:I&&P?void 0:F,success:E[j],defaultValue:w?"":null==m?void 0:m.email,readOnly:k,$_css4:M?O:void 0})]})};var ee=(0,q.default)(g.pd).withConfig({componentId:"sc-1de51bdd-0"})(["",""],e=>e.$_css),et=(0,q.default)(g.pd).withConfig({componentId:"sc-1de51bdd-1"})(["",""],e=>e.$_css2),er=(0,q.default)(g.pd).withConfig({componentId:"sc-1de51bdd-2"})(["",""],e=>e.$_css3),el=(0,q.default)(g.pd).withConfig({componentId:"sc-1de51bdd-3"})(["",""],e=>e.$_css4),ei=r(12133);let en=q.default.span.withConfig({componentId:"sc-4cc030c9-0"})(["margin-bottom:",";"],e=>e.theme.font.size.smaller),es=q.default.div.withConfig({componentId:"sc-4cc030c9-1"})(["display:flex;flex-direction:column;align-content:flex-start;"]),ea=q.default.div.withConfig({componentId:"sc-4cc030c9-2"})(["display:flex;"]),eo=q.default.div.withConfig({componentId:"sc-4cc030c9-3"})(["display:flex;flex-direction:column;"]),ed=q.default.div.withConfig({componentId:"sc-4cc030c9-4"})(["position:relative;","{position:absolute;z-index:2;right:-0.5rem;bottom:-1.2rem;display:block;width:auto;transform:scale(0.5);}"],ei.P);var ec=r(23557),eu=r(31688);let em=e=>{var t;let{userInstitutions:r,register:n,getAddresses:s,formErrorFor:a,errors:o,userDetails:c,findInputCmsData:h,control:p,setValueInParentForm:v,cmsData:f,disabled:y,cmsDataCustomMapper:b,namePrefix:x,omitUserInformation:j,hideSchoolSelectionField:C=!1}=e,T=i.useRef(null),[N,S]=i.useState(!1),[E,w]=i.useState({loading:!1,error:!1}),[A,D]=i.useState([]),[I,P]=i.useState(null),{onlyBusinessOrders:k}=(0,F.h)(),M="usage"===x?"selectedUsageSchool":G(x,"schoolName"),O=G(x,"institutions"),_=(0,i.useCallback)(X()(async e=>{w({error:!1,loading:!0}),D([]);let t=e.target.value.trim();if(t.length>0&&s)try{let e=await s(t);D(e)}catch(e){D([]),w({error:!0,loading:!1});return}else D([]);w(e=>(0,m._)((0,u._)({},e),{loading:!1}))},200),[s]),L=i.useCallback(e=>{P(e)},[]);i.useEffect(()=>{I&&v(I)},[I]);let R=(null==A?void 0:A.map(e=>({id:e.delivery.schoolNumber,title:e.delivery.schoolName,subtitle:[...new Set([e.delivery.streetName,e.delivery.houseNumber,e.delivery.city])].filter(Boolean).join(", "),value:e})))||null,U=p.validFieldsRef.current;return i.useEffect(()=>{S(0===((null==r?void 0:r.length)||0))},[r]),i.useEffect(()=>{let e=setTimeout(()=>{if(null==T?void 0:T.current){var e,t;null==T||null==(t=T.current)||null==(e=t.querySelector("input"))||e.click()}},500);return()=>clearTimeout(e)},[T,r]),(0,l.jsxs)(l.Fragment,{children:[f&&r&&!k&&s&&(0,l.jsx)(g.mM,{style:{margin:"1rem 0"},children:null==b?void 0:b.userDeliveryAddressTitle}),r&&(0,l.jsx)(es,{ref:T,children:r.map(e=>(0,l.jsx)(ea,{children:(0,l.jsx)(g.U6,{name:O,disabled:y,onClick:()=>{S(!1),L(e)},value:JSON.stringify(e),children:(0,l.jsxs)(eo,{children:[(0,l.jsx)("span",{children:e.delivery.schoolName}),(0,l.jsxs)("span",{children:[e.delivery.streetName," ",e.delivery.houseNumber]}),(0,l.jsxs)(en,{children:[e.delivery.postalCode," ",e.delivery.country," ",e.delivery.city]})]})})},e.delivery.schoolNumber))}),s&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(H,{toHide:k||C,children:(0,l.jsx)(g.U6,{name:O,disabled:y,onClick:()=>S(!0),value:null==b?void 0:b.differentSchoolAddressOptionLabel,label:null==b?void 0:b.differentSchoolAddressOptionLabel,checked:N})}),N&&R&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(ed,{children:[E.loading&&(0,l.jsx)(d.kt,{}),(0,l.jsx)(ec.Ul,{customLabelStyle:{marginTop:"1rem"},children:(null==f?void 0:f.schoolAddressSearchInputLabel)&&"object"==typeof(null==f?void 0:f.schoolAddressSearchInputLabel)&&(0,l.jsx)(eu.Q,{children:(0,l.jsx)(d.rM,{htmlCode:null==f?void 0:f.schoolAddressSearchInputLabel})})}),(0,l.jsx)(g.NJ,{onChange:_,onOptionSelected:L,options:R,success:U[M],errors:o[M],errorMessage:a(null==(t=o[M])?void 0:t.message),placeholder:null==f?void 0:f.schoolSearchPlaceholder})]}),I&&(0,l.jsxs)(eo,{style:{marginTop:"1rem"},children:[(0,l.jsx)("span",{children:I.delivery.schoolName}),(0,l.jsxs)("span",{children:[I.delivery.streetName," ",I.delivery.houseNumber]}),(0,l.jsxs)(en,{children:[I.delivery.postalCode," ",I.delivery.country," ",I.delivery.city]})]})]})]}),s&&!j&&(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}}),!j&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.mM,{style:{margin:"1rem 0"},children:null==f?void 0:f.personalInformationTitle}),(0,l.jsx)(J,{namePrefix:e.namePrefix,control:p,register:n,findInputCmsData:h,errors:o,userDetails:c,formErrorFor:a,cmsData:f,emailBlacklist:null==f?void 0:f.forbiddenEmailDomains})]})]})},eh=q.default.div.withConfig({componentId:"sc-832e0fc3-0"})(["background-color:#fff8e6;border:1px solid ",";border-radius:4px;padding:1rem;margin-top:1rem;margin-bottom:1rem;"],e=>{let{theme:t}=e;return t.palette.common.warning}),eg=q.default.div.withConfig({componentId:"sc-832e0fc3-1"})(["color:",";font-weight:600;margin-bottom:0.5rem;display:flex;align-items:center;gap:0.5rem;"],e=>{let{theme:t}=e;return t.palette.common.warning}),ep=q.default.div.withConfig({componentId:"sc-832e0fc3-2"})(["background-color:#ffffff;border:1px solid ",";border-radius:4px;padding:0.75rem;margin:0.75rem 0;font-size:0.9rem;line-height:1.4;"],e=>{let{theme:t}=e;return t.palette.common.grey.border}),ev=q.default.div.withConfig({componentId:"sc-832e0fc3-3"})(["display:flex;gap:0.5rem;margin-top:0.75rem;"]),ef=e=>{let{suggestions:t,onAccept:r,acceptButtonLabel:i="Use suggested address",warningTitle:n="Address correction available",warningMessage:s="We found a more accurate version of your address:"}=e;return(0,l.jsxs)(eh,{children:[(0,l.jsx)(eg,{children:n}),(0,l.jsx)("div",{children:s}),(0,l.jsx)(ep,{children:(e=>{let t=[];if(e.streetName){let r=e.streetName;e.houseNumber&&(r+=" ".concat(e.houseNumber)),e.houseNumberAddition&&(r+=" ".concat(e.houseNumberAddition)),t.push(r)}
1if(e.postcode||e.city){let r=[e.postcode,e.city].filter(Boolean).join(" ");t.push(r)}return t.join(", ")})(t)}),(0,l.jsx)(ev,{children:(0,l.jsx)(d.$n,{variant:"primary",label:i,onClick:r,type:"button"})})]})},ey=q.default.div.withConfig({componentId:"sc-a2066cb4-0"})(["display:flex;justify-content:space-between;",";@media screen and (max-width:600px){flex-direction:column;div:nth-child(n){width:100%;}}"],e=>{let{theme:t}=e;return t.customization.checkoutForm.showZipCodeAsRow?"flex-direction: row; div:first-child { width: 45%; } div:last-child { width: 25%;}":"flex-direction: column;"}),eb=e=>{var t,r,i,n,s,a;let{cmsData:o,register:d,disabled:c=!1,findInputCmsData:u,errors:m,control:h,formErrorFor:p,countriesOption:v,trigger:f,namePrefix:y,userDetails:b,cmsDataCustomMapper:x,readOnlyName:j,readOnlyEmail:C,suggestions:T,onAcceptSuggestion:N,suggestionLabels:S}=e,E=G(y,"houseNumber"),w=G(y,"houseNumberAddition"),A=G(y,"streetName"),D=G(y,"postcode"),I=G(y,"city"),P=G(y,"country"),k=u(E),M=u(w),O=u(A),F=u(D),_=u(I),L=u(P),R=h.validFieldsRef.current;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.mM,{style:{margin:"1rem 0"},children:x.deliveryAddressTitle||o.deliveryAddressTitle}),(0,l.jsx)(J,{control:h,register:d,findInputCmsData:u,errors:m,formErrorFor:p,namePrefix:y,userDetails:b,emailBlacklist:null==o?void 0:o.forbiddenEmailDomains,cmsData:o,readOnlyName:j,readOnlyEmail:C}),L&&(0,l.jsx)(g.$k,{name:P,ref:d,selectLabel:L.label,options:v||[],disabled:c,success:R[P],errors:m[P],errorMessage:p(null==(t=m[P])?void 0:t.message),customLabelStyle:(0,q.css)(["margin-top:1.2rem;margin-bottom:1.2rem;"]),onChange:()=>null==f?void 0:f()}),F&&k&&M&&(0,l.jsxs)(ey,{children:[(0,l.jsx)("div",{children:(0,l.jsx)(g.pd,{type:"text",label:F.label,placeholder:F.placeholder,name:D,htmlFor:D,ref:d,disabled:c,errors:m[D],autoComplete:"shipping postal-code",errorMessage:p(null==(r=m[D])?void 0:r.message),customLabelStyle:(0,q.css)(["margin-top:1.2rem;"]),success:R[D]})}),(0,l.jsx)("div",{children:(0,l.jsx)(g.pd,{type:"text",label:k.label,placeholder:k.placeholder,name:E,htmlFor:E,ref:d,disabled:c,maxLength:20,errors:m[E],autoComplete:"no",errorMessage:p(null==(i=m[E])?void 0:i.message),customLabelStyle:(0,q.css)(["margin-top:1.2rem;width:25%;"]),success:R[E]})}),(0,l.jsx)("div",{children:(0,l.jsx)(g.pd,{type:"text",label:M.label,placeholder:M.placeholder,name:w,htmlFor:w,ref:d,disabled:c,maxLength:10,errors:m[w],autoComplete:"no",errorMessage:p(null==(n=m[w])?void 0:n.message),customLabelStyle:(0,q.css)(["margin-top:1.2rem;"]),success:R[w]})})]}),O&&(0,l.jsx)(g.pd,{type:"text",label:O.label,placeholder:O.placeholder,name:A,htmlFor:A,ref:d,disabled:c,errors:m[A],autoComplete:"shipping street-address",errorMessage:p(null==(s=m[A])?void 0:s.message),customLabelStyle:(0,q.css)(["margin-top:1.2rem;"]),success:R[A]}),_&&(0,l.jsx)(g.pd,{type:"text",label:_.label,placeholder:_.placeholder,name:I,htmlFor:I,ref:d,disabled:c,errors:m[I],autoComplete:"shipping locality",errorMessage:p(null==(a=m[I])?void 0:a.message),customLabelStyle:(0,q.css)(["margin-top:1.2rem;"]),success:R[I]}),T&&N&&(0,l.jsx)(ef,{suggestions:T,onAccept:N,warningTitle:null==S?void 0:S.title,warningMessage:null==S?void 0:S.message,acceptButtonLabel:null==S?void 0:S.acceptButton})]})},ex=e=>{let{cmsData:t,register:r,disabled:i,findInputCmsData:n,isSchoolAddress:s,schoolAddressAllowed:a,userAddressAllowed:o,cmsDataCustomMapper:d,namePrefix:c,isTeacherUser:u,readOnlyName:m,readOnlyEmail:h}=e,p=G(e.namePrefix,"typeOrder"),v="billing"===c,f=n(v?"particularInvoice":"particular"),y=n(v?"businessInvoice":"business");return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(H,{toHide:!u||!a||!o,children:[(0,l.jsx)(g.mM,{style:{margin:"1rem 0"},children:d.typeOfOrderTitle}),(0,l.jsx)(W,{style:{display:"inline-flex"},children:(0,l.jsx)(g.U6,{label:null==f?void 0:f.label,htmlFor:"particular",name:p,value:"particular",ref:r,disabled:i,defaultChecked:!s})}),(0,l.jsx)(W,{style:{display:"inline-flex"},children:(0,l.jsx)(g.U6,{label:y.label,htmlFor:"business",name:p,value:"business",ref:r,disabled:i,defaultChecked:s})})]}),s?(0,l.jsx)(em,{namePrefix:e.namePrefix,cmsData:t,register:r,setValueInParentForm:e.setValueInParentForm,userInstitutions:e.userInstitutions,errors:e.errors,userDetails:e.userDetails,control:e.control,getAddresses:e.getAddresses,findInputCmsData:n,disabled:e.loading,trigger:e.trigger,formErrorFor:e.formErrorFor,cmsDataCustomMapper:d}):(0,l.jsx)(eb,{userDetails:e.userDetails,namePrefix:e.namePrefix,cmsData:e.cmsData,register:e.register,disabled:e.loading,findInputCmsData:e.findInputCmsData,errors:e.errors,control:e.control,formErrorFor:e.formErrorFor,countriesOption:e.countriesOption,trigger:e.trigger,cmsDataCustomMapper:d,readOnlyName:m,readOnlyEmail:h,suggestions:e.suggestions,onAcceptSuggestion:e.onAcceptSuggestion,suggestionLabels:e.suggestionLabels})]})};var ej=r(56986);let eC=e=>{let{cmsData:t,register:r,findInputCmsData:i,cmsDataCustomMapper:n,readOnlyName:s,readOnlyEmail:a}=e,{priceType:o}=(0,ej.Z)();return(0,l.jsx)(l.Fragment,{children:"b2b"===o?(0,l.jsx)(em,{namePrefix:e.namePrefix,cmsData:t,register:r,setValueInParentForm:e.setValueInParentForm,userInstitutions:e.userInstitutions,errors:e.errors,userDetails:e.userDetails,control:e.control,getAddresses:e.getAddresses,findInputCmsData:i,disabled:e.loading,trigger:e.trigger,formErrorFor:e.formErrorFor,cmsDataCustomMapper:n,hideSchoolSelectionField:!0}):(0,l.jsx)(eb,{userDetails:e.userDetails,namePrefix:e.namePrefix,cmsData:e.cmsData,register:e.register,disabled:e.loading,findInputCmsData:e.findInputCmsData,errors:e.errors,control:e.control,formErrorFor:e.formErrorFor,countriesOption:e.countriesOption,trigger:e.trigger,cmsDataCustomMapper:n,readOnlyName:s,readOnlyEmail:a,suggestions:e.suggestions,onAcceptSuggestion:e.onAcceptSuggestion,suggestionLabels:e.suggestionLabels})})},eT=e=>{var t;let{cmsData:r,register:i,findInputCmsData:n,errors:s,loading:a,c
1ontrol:o,userDetails:d,formErrorFor:c,countriesOption:u,getValues:m,trigger:h,hasFreeProducts:p,disabled:v,setValueInParentForm:f,userInstitutions:y,getAddresses:b,isSchoolAddress:x,cmsDataCustomMapper:j,isActive:C,isShippingSchoolAddress:T,isTeacherUser:N,suggestions:S,onAcceptSuggestion:E,suggestionLabels:w}=e,{onlyBusinessOrders:A,onlyPrivateBilling:D}=(0,F.h)(),I=n("sameDeliveryAddress"),P=!!(N&&!D),k=D||!A&&!p,M=T&&P||!T&&k,O=(0,F.$d)();return(0,l.jsxs)(H,{toHide:A,children:[(0,l.jsx)(g.mM,{children:r.billingAddressTitle}),M&&(0,l.jsxs)(l.Fragment,{children:[r.billingAddressText&&(0,l.jsx)(g.XF,{children:r.billingAddressText}),(0,l.jsx)(W,{children:(0,l.jsx)(g.GL,{name:"sameDeliveryAddress",htmlFor:"sameDeliveryAddress",label:null!=(t=I.label)?t:"Same as delivery address",ref:i,disabled:v,defaultChecked:!p||A})})]}),C&&(0,l.jsx)(ex,{cmsData:r,register:i,disabled:a,findInputCmsData:n,errors:s,loading:a,control:o,userDetails:d,formErrorFor:c,countriesOption:u,getValues:m,trigger:h,namePrefix:"billing",setValueInParentForm:f,userInstitutions:y,getAddresses:b,cmsDataCustomMapper:j,isSchoolAddress:"boolean"==typeof x?x:P,userAddressAllowed:k,schoolAddressAllowed:P,isTeacherUser:N,readOnlyName:!0,readOnlyEmail:"noordhoff"===O,suggestions:S,onAcceptSuggestion:E,suggestionLabels:w})]})},eN=e=>{var t;let{cmsData:r,register:i,findInputCmsData:n,errors:s,loading:a,control:o,userDetails:d,formErrorFor:c,countriesOption:u,getValues:m,trigger:h,disabled:p,setValueInParentForm:v,userInstitutions:f,getAddresses:y,cmsDataCustomMapper:b,isActive:x,suggestions:j,onAcceptSuggestion:C,suggestionLabels:T}=e,N=n("sameDeliveryAddress"),{priceType:S}=(0,ej.Z)();return(0,l.jsxs)(H,{toHide:"b2b"===S,children:[(0,l.jsx)(g.mM,{children:r.billingAddressTitle}),"b2c"===S&&(0,l.jsxs)(l.Fragment,{children:[r.billingAddressText&&(0,l.jsx)(g.XF,{children:r.billingAddressText}),(0,l.jsx)(W,{children:(0,l.jsx)(g.GL,{name:"sameDeliveryAddress",htmlFor:"sameDeliveryAddress",label:null!=(t=N.label)?t:"Same as delivery address",ref:i,disabled:p,defaultChecked:!0})})]}),x&&(0,l.jsx)(eC,{cmsData:r,register:i,disabled:a,findInputCmsData:n,errors:s,loading:a,control:o,userDetails:d,formErrorFor:c,countriesOption:u,getValues:m,trigger:h,namePrefix:"billing",setValueInParentForm:v,userInstitutions:f,getAddresses:y,cmsDataCustomMapper:b,readOnlyName:!0,readOnlyEmail:!1,suggestions:j,onAcceptSuggestion:C,suggestionLabels:T})]})},eS=q.default.aside.withConfig({componentId:"sc-6f9488b7-0"})(["background-color:",";padding:2rem;small{font-size:",";}"],e=>{let{theme:t}=e;return t.palette.common.grey.light},e=>{let{theme:t}=e;return t.font.size.smaller}),eE=q.default.div.withConfig({componentId:"sc-6f9488b7-1"})(["margin:2rem 0;"]),ew=q.default.div.withConfig({componentId:"sc-6f9488b7-2"})(["display:flex;justify-content:space-between;margin:0.5rem 0;"]),eA=q.default.div.withConfig({componentId:"sc-6f9488b7-3"})(["> div{justify-content:space-between;}"]);var eD=r(87810);let eI=q.default.div.withConfig({componentId:"sc-59e54255-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-content:flex-start;padding:1rem 0;border-bottom:1px solid ",";"],e=>{let{theme:t}=e;return t.palette.common.separator}),eP=q.default.div.withConfig({componentId:"sc-59e54255-1"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;width:80%;"]),ek=e=>{let{title:t,tags:r,price:i,totalPrice:n,basePrice:s,productUrl:a,locale:o,currency:c,qtyText:u,quantity:m,privateOnlyWarning:h="",teacherOnlyWarning:p="",outOfStockWarning:v="",exceedingMaxQuantityWarning:f="",notDisplayableWarning:y=""}=e,x=(0,F.DP)(),{showTaxAmountOnCartAndCheckout:j}=(0,F.h)();return(0,l.jsxs)(eI,{children:[(0,l.jsxs)(eP,{children:[(0,l.jsx)(d.N_,{href:a,customStyle:{marginBottom:"0.5rem"},children:(0,l.jsxs)(g.Ub,{bold:!0,style:{fontSize:x.mobile.font.headings.bodySmall.size},children:[" ",t," "]})}),r&&(0,l.jsxs)(g.Ub,{style:{fontSize:x.mobile.font.headings.bodySmall.size},children:[" ",r]}),u&&(0,l.jsxs)(g.Ub,{style:{fontSize:x.mobile.font.headings.bodySmall.size,marginTop:"1rem"},children:[m,"\xa0",u,"\xa0",j?(0,b.$g)(s,o,c):(0,b.$g)(i,o,c)]}),(y||v||h||p||f)&&(0,l.jsxs)(eD.k3,{children:[(0,l.jsx)(eD.id,{}),(0,l.jsx)("span",{children:y||v||p||h||f})]})]}),(0,l.jsx)(g.Ub,{style:{fontSize:x.mobile.font.headings.bodySmall.size},children:j?(0,b.$g)((0,b.Vz)(s,m),o,c):(0,b.$g)(n||(0,b.Vz)(i,m),o,c)})]})};var eM=r(89143);let eO=(0,eM.CS)(q.default.div.withConfig({componentId:"sc-1587a27c-0"})(["overflow:hidden;max-height:0px;"])),eF=q.default.button.withConfig({componentId:"sc-1587a27c-1"})(["border:0;background:transparent;color:",";font-size:",";cursor:pointer;outline:none;"],e=>{let{theme:t}=e;return t.palette.secondary.main},e=>{let{theme:t}=e;return t.font.size.smaller}),e_=q.default.span.withConfig({componentId:"sc-1587a27c-2"})(["color:",";font-size:",";"],e=>{let{theme:t}=e;return t.palette.common.grey.low},e=>{let{theme:t}=e;return t.font.size.smaller}),eL=q.default.div.withConfig({componentId:"sc-1587a27c-3"})(["margin-bottom:",";"],e=>{let{theme:t}=e;return t.font.size.small}),eR=e=>{let{children:t,description:r,hideContent:n,showContent:s}=e,[a,o]=(0,i.useState)(!0),[d,c]=(0,eM.zh)(()=>({}));return(0,i.useEffect)(()=>{c({maxHeight:500*!a})},[a]),(0,l.jsxs)(i.Fragment,{children:[(0,l.jsxs)(eL,{children:[(0,l.jsxs)(e_,{children:[" ",r," "]})," ",(0,l.jsxs)(eF,{onClick:()=>{o(!a)},children:[" ",a?s:n]})]}),(0,l.jsx)(eO,{"data-testid":"expandable-content",style:d,children:t})]})},eU=e=>{let{title:t,subtotal:r,shipping:i,total:n,extraInfo:s,products:a,editUrl:o,taxDetails:c,priceWithoutTaxes:h,taxes:p,children:v,locale:f,currency:y,qtySingularTextWithPrice:x,qtyPluralTextWithPrice:j,totalTaxText:C,totalTaxes:T}=e,N=(0,F.DP)(),S=(0,q.css)(["font-size:",";"],N.font.size.smaller),{showTaxAmountOnCartAndCheckout:E}=(0,F.h)();return(0,l.jsxs)(eS,{"data-cy":"checkout-purchase-box",children:[(0,l.jsxs)(ew,{children:[(0,l.jsx)(g.f_,{style:{margin:"0.5rem 0"},children:t}),o&&(0,l.jsx)(d.N_,{href:o,children:(0,l.jsx)(d.Ah,{alt:"edit cart",color:N.palette.secondary.main,width:18,height:18,inlineSvg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>'})})]}),a&&a.map((e,t)=>{var r,i,n,s;return(0,l.jsx)(ek,{title:e.title,productUrl:e.productUrl,currency:y,price:null!=(r=e.price)?r:0,totalPrice:null!=(i=e.totalPrice)?i:0,basePrice:null!=(n=e.basePrice)?n:0,taxRate:null!=(s=e.taxRate)?s:0,locale:f,tags:e.tags,qtyText:1!==e.quantity?j:x,quantity:e.quantity,teacherOnlyWarning:e.teacherOnlyWarning,privateOnlyWarning:e.privateOnlyWarning,outOfStockWarning:e.outOfStockWarning,exceedingMaxQuantityWarning:e.exceedingMaxQuantityWarning,notDisplayableWarning:e.notDisplayableWarning},t+e.title)}),r&&(0,l.jsxs)(ew,{children:[(0,l.jsx)(g.XF,{children:r.key}),(0,l.jsx)(g.XF,{children:(0,b.$g)(r.value,f,y)})]}),i&&(0,l.jsxs)(ew,{children:[(0,l.jsx)(g.Ub,{children:i.key}),(0,l.jsx)(g.Ub,{style:{color:(0,b.DU)(N.palette.common,0===i.value?"greenSuccess":"foreground")},children:0===i.value?i.label:(0,b.$g)(i.value,f,y)})]}),E&&(0,l.jsx)(eA,{children:(0,l.jsxs)(g.mO,{children:[(0,l.jsx)(g.Ub,{children:C}),(0,l.jsx)(g.Ub,{children:(0,b.$g)(T,f,y)})]})}),n&&(0,l.jsxs)(ew,{children:[(0,l.jsx)(g.Ub,{bold:!0,children:n.key}),(0,l.jsx)(g.Ub,{bold:!0,children:(0,b.$g)(n.value,f,y)})]}),v&&(0,l.jsx)(eE,{children:v}),c&&(0,l.jsxs)(eR,(0,m._)((0,u._)({},c),{children:[(0,l.jsxs)(ew,{children:[(0,l.jsx)(g.Ub,{bold:!0,children:null==h?void 0:h.key}),(0,l.jsx)(g.Ub,{bold:!0,children:(0,b.$g)(null==h?void 0:h.value,f,y)})]}),p&&p.map((e,t)=>(0,l.jsxs)(ew,{children:[(0,l.jsx)(g.Ub,{children:e.key}),(0,l.jsx)(g.Ub,{children:(0,b.$g)(e.value,f,y)})]},t))]})),s&&(0,l.jsx)("div",{children:s.map((e,t)=>(0,l.jsx)(d.t5,{iconType:"check",text:e,fontColor:"grey",iconColor:N.palette.common.grey.low,customStyles:(0,q.css)(["span{","}"],S)},t))})]})},eB=e=>{var t,r;let{cmsData:i,register:n,disabled:s=!1,errors:a,findInputCmsData:o,control:d,formErrorFor:c}=e,u=o("activationEmail"),m=o("activationEmailConfirm"),{activationEmail
1:h,activationEmailConfirm:p}=d.validFieldsRef.current;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.mM,{style:{margin:"1rem 0"},children:null==i?void 0:i.digitalActivationTitle}),(0,l.jsx)(g.pd,{type:"email",label:u.label,placeholder:u.placeholder,name:"activationEmail",htmlFor:"activationEmail",ref:n,customInputStyle:{marginBottom:"1rem"},disabled:s,helperText:u.helperText,errors:a.activationEmail,errorMessage:c(null==(t=a.activationEmail)?void 0:t.message),success:h}),(0,l.jsx)(g.pd,{type:"email",label:m.label,placeholder:m.placeholder,name:"activationEmailConfirm",htmlFor:"activationEmailConfirm",ref:n,customInputStyle:{marginBottom:"1rem"},disabled:s,helperText:m.helperText,errors:a.activationEmailConfirm,errorMessage:c(null==(r=a.activationEmailConfirm)?void 0:r.message),success:p})]})},eV=q.default.div.withConfig({componentId:"sc-aae20bba-0"})(["display:flex;flex-direction:column;.StripeElement{margin:1.5rem 0;cursor:pointer;border:1px solid ",";}.StripeElement--complete{border:1px solid ",";}.StripeElement--empty{color:",";}.StripeElement--focus{border:1px solid ",";box-shadow:0px 0px 5px 0px ",";}.StripeElement--invalid{border:1px solid ",";}"],e=>e.theme.palette.common.grey.border,e=>e.theme.palette.common.successGood,e=>e.theme.palette.common.grey.neutral,e=>e.theme.palette.secondary.main,e=>e.theme.palette.secondary.main,e=>e.theme.palette.common.error),eq=e=>{var t,r,i;let{cmsData:n,register:s,disabled:a,findInputCmsData:o,enableInvoices:d,paymentMethodsEnabled:c,cart:u,hasSpecialCopy:m}=e,h=o("ideal"),p=o("postPay"),v=o("bancontact"),f=o("klarna"),y=c.ideal&&h,b=c.bancontact,x=c.klarna&&f,j=c.invoice&&d&&p,C=u&&N(u),{onlyBusinessOrders:T}=(0,F.h)();return(0,l.jsxs)(eV,{children:[(0,l.jsx)(g.mM,{style:{margin:"1rem 0"},children:null==n?void 0:n.paymentMethodTitle}),y&&!C&&(0,l.jsx)(W,{children:(0,l.jsx)(g.U6,{label:h.label,htmlFor:"iDEAL",name:"paymentType",value:"ideal",ref:s,disabled:a,defaultChecked:c.ideal,image:null==(t=h.inputImage)?void 0:t.file.url})}),b&&!C&&(0,l.jsx)(W,{children:(0,l.jsx)(g.U6,{label:v.label,htmlFor:v.label,name:"paymentType",value:"bancontact",ref:s,disabled:a,defaultChecked:!c.ideal&&c.bancontact,image:null==(r=v.inputImage)?void 0:r.file.url})}),x&&!C&&(0,l.jsx)(W,{children:(0,l.jsx)(g.U6,{label:f.label,htmlFor:f.label,name:"paymentType",value:"klarna",ref:s,disabled:a,defaultChecked:c.klarna,image:null==(i=f.inputImage)?void 0:i.file.url})}),j&&(0,l.jsx)("div",{children:(0,l.jsx)(g.U6,{label:p.label,htmlFor:"postPay",name:"paymentType",value:"invoice",ref:s,helperText:null==p?void 0:p.helperText,defaultChecked:C||m||T})}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}})]})},eY=e=>{let{cmsData:t,register:r,findInputCmsData:i,errors:n,loading:s,control:a,userDetails:o,formErrorFor:d,countriesOption:c,getValues:u,trigger:m,setValueInParentForm:h,userInstitutions:g,getAddresses:p,isSchoolAddress:v,isCartZeroPriced:f,cmsDataCustomMapper:y,hasTeacherCopy:b,expectUsageSchoolAddress:x,usageSchoolAddress:j,isTeacherUser:C,suggestions:T,onAcceptSuggestion:N,suggestionLabels:S}=e,{onlyBusinessOrders:E,disablePrivateOnTeacherCopies:w}=(0,F.h)(),A=E||C,D=!E&&!(w&&b);return(0,l.jsx)(ex,{cmsData:t,register:r,disabled:s,findInputCmsData:i,errors:n,loading:s,control:a,userDetails:o,formErrorFor:d,countriesOption:c,getValues:u,trigger:m,setValueInParentForm:h,userInstitutions:x?j?[j]:[]:g,getAddresses:x?void 0:p,isSchoolAddress:"boolean"==typeof v?v:A&&(!D||f),cmsDataCustomMapper:y,schoolAddressAllowed:A,userAddressAllowed:D,isTeacherUser:C,suggestions:T,onAcceptSuggestion:N,suggestionLabels:S})},eW=e=>{let{cmsData:t,register:r,findInputCmsData:i,errors:n,loading:s,control:a,userDetails:o,formErrorFor:d,countriesOption:c,getValues:u,trigger:m,setValueInParentForm:h,userInstitutions:g,getAddresses:p,cmsDataCustomMapper:v,expectUsageSchoolAddress:f,usageSchoolAddress:y,suggestions:b,onAcceptSuggestion:x,suggestionLabels:j}=e;return(0,l.jsx)(eC,{cmsData:t,register:r,disabled:s,findInputCmsData:i,errors:n,loading:s,control:a,userDetails:o,formErrorFor:d,countriesOption:c,getValues:u,trigger:m,setValueInParentForm:h,userInstitutions:f?y?[y]:[]:g,getAddresses:f?void 0:p,cmsDataCustomMapper:v,suggestions:b,onAcceptSuggestion:x,suggestionLabels:j})},e$=q.default.div.withConfig({componentId:"sc-9d4d469f-0"})([""]),ez=e=>{var t,r;let{cmsData:i,register:n,disabled:s=!1,findInputCmsData:a,errors:o,itemsTypeDigital:d,formErrorFor:c}=e,u=a("termsAndConditions"),m=a("notReturnConsent");return(0,l.jsxs)(e$,{children:[(0,l.jsx)(g.mM,{style:{margin:"1rem 0"},children:null==i?void 0:i.termsAndConditionsTitle}),(0,l.jsx)(g.GL,{name:"termsAndConditions",htmlFor:"termsAndConditions",richText:u.labelLink,ref:n,disabled:s,helperText:u.helperText,hasRichText:!0,errors:o.termsAndConditions,errorMessage:c(null==(t=o.termsAndConditions)?void 0:t.message)}),d&&(0,l.jsx)(g.GL,{name:"notReturnConsent",htmlFor:"notReturnConsent",richText:m.labelLink,ref:n,disabled:s,hasRichText:!0,errors:o.notReturnConsent,errorMessage:c(null==(r=o.notReturnConsent)?void 0:r.message)}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}})]})},eH=e=>{var t,r,i;let{cmsData:n,cart:s,locale:a,currency:o,products:c,title:u,subtitle:m,backToCartLabel:h}
1=e,p=null==n?void 0:n.checkoutPurchaseBox;return(0,l.jsxs)(Z,{children:[(0,l.jsxs)(K,{children:[(0,l.jsx)(g.fV,{hasStripe:!0,children:u}),(0,l.jsx)(d.qn,{content:m}),(0,l.jsx)(d.N_,{href:"/".concat(a,"/cart"),borderVariant:"roundedPill",variant:"primary",children:(0,l.jsx)("strong",{children:h})})]}),(0,l.jsx)(eU,{locale:a,currency:o,total:{value:(null==s?void 0:s.priceTotal)||0,key:(null==p?void 0:p.totalPriceText)||""},products:c,extraInfo:[null!=(t=null==p?void 0:p.infoText1)?t:"",null!=(r=null==p?void 0:p.infoText2)?r:""],shipping:{key:null!=(i=null==p?void 0:p.shipmentText)?i:"",value:0,label:null==p?void 0:p.shipmentTextValue},title:null==p?void 0:p.title})]})},eZ=e=>{var t,r,i;let{cmsData:n,cart:s,locale:a,currency:o,products:c}=e,{removeItemsFromCart:u}=(0,F._$)(),{priceType:m}=(0,ej.Z)(),h=null==n?void 0:n.checkoutPurchaseBox;return(0,l.jsxs)(Z,{children:[(0,l.jsxs)(K,{children:[(0,l.jsxs)(g.fV,{hasStripe:!0,children:[" ",null==n?void 0:n.textWarningPageTitle]}),(0,l.jsxs)(g.XF,{children:[null==n?void 0:n.textWarningPageText," "]}),(0,l.jsx)(d.N_,{variant:"primary",borderVariant:"roundedPill",onEvent:()=>void u(s.items.filter(e=>e.copyType===y.D.INSPECTION_COPY.key||e.copyType===y.D.USE_COPY.key||C(e)).map(e=>({id:e.id,quantity:0,copyType:e.copyType,price:e.price})),void 0,m),href:"/".concat(a,"/cart"),customStyle:{margin:"2rem 0"},children:null==n?void 0:n.linkBackToCart}),(0,l.jsx)(g.mM,{style:{margin:0},children:null==n?void 0:n.textAreYouATeacher}),(0,l.jsx)(g.XF,{children:null==n?void 0:n.textTeacherInstructions}),(0,l.jsx)(d.N_,{variant:"border",borderVariant:"roundedPill",target:"_blank",href:null==n?void 0:n.linkChangeSchool,customStyle:{margin:"2rem 0"},children:null==n?void 0:n.linkSelectSchool})]}),(0,l.jsx)(eU,{locale:a,currency:o,total:{value:null==s?void 0:s.priceTotal,key:null==h?void 0:h.totalPriceText},products:c,extraInfo:[null!=(t=null==h?void 0:h.infoText1)?t:"",null!=(r=null==h?void 0:h.infoText2)?r:""],shipping:{key:null!=(i=null==h?void 0:h.shipmentText)?i:"",value:0,label:null==h?void 0:h.shipmentTextValue},title:null==h?void 0:h.title})]})},eK=e=>{let{cmsData:t,register:r,findInputCmsData:i,errors:n,loading:s,control:a,userDetails:o,formErrorFor:d,trigger:c,setValueInParentForm:u,userInstitutions:m,getAddresses:h,cmsDataCustomMapper:p}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(em,{namePrefix:"usage",cmsData:t,register:r,setValueInParentForm:u,userInstitutions:m,errors:n,userDetails:o,control:a,getAddresses:h,findInputCmsData:i,disabled:s,trigger:c,formErrorFor:d,cmsDataCustomMapper:p,omitUserInformation:!0}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}})]})},eG=e=>(e&&Object.keys(e).forEach(t=>{e[t]="string"==typeof e[t]?e[t].trim():eG(e[t])}),e);function eQ(e,t){var r;return{schoolNumber:e[t].schoolNumber,schoolName:e[t].schoolName,houseNumber:e[t].houseNumber,houseNumberAddition:null!=(r=e[t].houseNumberAddition)?r:"",streetName:e[t].streetName,postalCode:E(e[t].country,e[t].postalCode),city:e[t].city,country:e[t].country}}let eX=function(e,t){var r,l;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"delivery",n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s="billing"===i&&n,a=(0,u._)({firstName:s?"":e.firstName,lastName:s?"":e.lastName,email:s?"":e.email,address:"business"===e.typeOrder?eQ(e.selectedSchool,i):(r="delivery"===i,(0,m._)((0,u._)({},r&&e.selectedUsageSchool?{schoolNumber:e.selectedUsageSchool.delivery.schoolNumber,schoolName:e.selectedUsageSchool.delivery.schoolName}:{}),{houseNumber:e.houseNumber,houseNumberAddition:null!=(l=e.houseNumberAddition)?l:"",streetName:e.streetName,postalCode:E(e.country,e.postcode),city:e.city,country:e.country}))},t&&{activationEmail:e.activationEmail});return eG(a),a};var eJ=r(39091);(0,eJ.xS)({mixed:{required:"requiredField",oneOf:"shouldBeChecked"},string:{min:"atLeastTwoCharacters",max:"maximumEightyCharacters",matches:"notMatching",email:"mustBeValidEmail",postcodeMatch:"pleaseEnterACorrectZipCode",emailDomainMatch:"forbiddenDomain",addressValidationInvalid:"addressValidationInvalid"}});let e0=/^[0-9][A-Za-z0-9_ /-]*$/,e1=/^([a-z]|[0-9]|[ÅÂÀÁÂÄàáäâåaÈÉÊËèéêëeÌÍÎÏìíîïiÖÔÒÓòóôöoùúûüuÙÚÛÜçÇñÑß()']|\s|-|\.)*$/i,e2=(e,t)=>function(r,l){return!!r&&e.some(e=>e.isoCode===l.parent[t]&&new RegExp("".concat(e.postalCodeRegex)).test(r))},e3=eJ.Yj().min(2).required().matches(e1),e5=eJ.Yj().min(2).required().matches(e1).max(30),e7=eJ.Yj(),e4=e=>eJ.Yj().email().required().test("emailDomainMatch","forbiddenDomain",function(t){return!!t&&!e.some(e=>-1!==t.indexOf(e))}),e9=(e,t)=>
1eJ.Yj().when("typeOrder",(0,u._)({is:"particular",then:e},void 0!==t&&{otherwise:t})),e6=e=>eJ.Yj().when("sameDeliveryAddress",{is:!1,then:e}),e8=e=>eJ.Yj().when(["sameDeliveryAddress","billingTypeOrder"],{is:(e,t)=>!e&&"particular"===t,then:e}),te=(e,t)=>eJ.Yj().when(["sameDeliveryAddress"],{is:t=>!t&&"b2c"===e,then:t}),tt=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return{billingFirstName:e6(e3),billingLastName:e6(e3),billingEmail:e6(e4(e)),billingPostcode:te(r,eJ.Yj().required().test("postcodeMatch","pleaseEnterACorrectZipCode",e2(t,"billingCountry"))),billingHouseNumber:te(r,eJ.Yj().matches(e0).required().max(20)),billingHouseNumberAddition:eJ.Yj().max(10),billingStreetName:te(r,e3),billingCity:te(r,e3),billingCountry:te(r,eJ.Yj().min(2).required())}},tr=e=>{let{hasPrintProducts:t,forbiddenEmails:r,allowedCountries:l,enableLabelInformation:i,requireUsageAddress:n,isLiberCheckout:s,priceType:a}=e;return(0,u._)({},n?{selectedUsageSchool:eJ.Ik().required()}:{},(e=>{let{hasPrintProducts:t,forbiddenEmails:r,allowedCountries:l,enableLabelInformation:i,isLiberCheckout:n,priceType:s}=e;return n?(0,u._)({},((e,t,r)=>({firstName:e5,lastName:e5,email:e4(e),confirmEmail:e4(e).oneOf([eJ.KR("email"),null],"emailDoesNotMatch"),country:eJ.Yj().required(),postcode:"b2c"===r?eJ.Yj().required().test("postcodeMatch","pleaseEnterACorrectZipCode",e2(t,"country")):eJ.Yj(),houseNumber:"b2c"===r?eJ.Yj().required().matches(e0).max(20):eJ.Yj(),houseNumberAddition:eJ.Yj().max(10),streetName:"b2c"===r?e3:eJ.Yj(),sameDeliveryAddress:eJ.lc(),paymentType:e7,city:"b2c"===r?e3:eJ.Yj()}))(r,l,s),tt(r,l,s),(0,u._)({billingSchoolName:eJ.Yj(),schoolName:"b2c"===s?eJ.Yj():eJ.Yj().required(),termsAndConditions:eJ.lc().oneOf([!0]).required()},i&&(0,u._)({orderReference:eJ.Yj().required()},t&&{labelInformation:eJ.Yj().required(),deliveryEmail:e4(r),deliveryPhone:eJ.Yj().required()}))):(0,u._)({},((e,t)=>({firstName:e5,lastName:e5,email:e4(e),confirmEmail:e4(e).oneOf([eJ.KR("email"),null],"emailDoesNotMatch"),country:eJ.Yj().required(),postcode:e9(eJ.Yj().required().test("postcodeMatch","pleaseEnterACorrectZipCode",e2(t,"country"))),houseNumber:e9(eJ.Yj().required().matches(e0).max(20)),houseNumberAddition:eJ.Yj().max(10),streetName:e9(e3),sameDeliveryAddress:eJ.lc(),paymentType:e7,city:e9(e3)}))(r,l),{billingFirstName:e6(e3),billingLastName:e6(e3),billingEmail:e6(e4(r)),billingPostcode:e8(eJ.Yj().required().test("postcodeMatch","pleaseEnterACorrectZipCode",e2(l,"billingCountry"))),billingHouseNumber:e8(eJ.Yj().matches(e0).required().max(20)),billingHouseNumberAddition:eJ.Yj().max(10),billingStreetName:e8(e3),billingCity:e8(e3),billingCountry:e8(eJ.Yj().min(2).required())},(0,u._)({billingSchoolName:eJ.Yj().when("billingTypeOrder",{is:"business",then:eJ.Yj().required()}),schoolName:eJ.Yj().when("typeOrder",{is:"business",then:eJ.Yj().required()}),termsAndConditions:eJ.lc().oneOf([!0]).required()},i&&(0,u._)({orderReference:eJ.Yj().required()},t&&{labelInformation:eJ.Yj().required(),deliveryEmail:e4(r),deliveryPhone:eJ.Yj().required()})))})({hasPrintProducts:t,forbiddenEmails:r,allowedCountries:l,enableLabelInformation:i,requireUsageAddress:n,isLiberCheckout:s,priceType:a}))},tl=e=>eJ.Ik().shape(e.isDigital?(e=>{let{hasPrintProducts:t,forbiddenEmails:r,allowedCountries:l,enableLabelInformation:i,requireUsageAddress:n,isLiberCheckout:s,priceType:a}=e;return(0,m._)((0,u._)({},tr({hasPrintProducts:t,forbiddenEmails:r,allowedCountries:l,enableLabelInformation:i,requireUsageAddress:n,isLiberCheckout:s,priceType:a})),{activationEmail:e4(r),activationEmailConfirm:e4(r).oneOf([eJ.KR("activationEmail"),null],"emailDoesNotMatch"),notReturnConsent:eJ.lc().oneOf([!0]).required()})})(e):tr(e)),ti=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],n=e4(i),s=(null==l?void 0:l.email)&&n.isValidSync(null==l?void 0:l.email),a=e.sameDeliveryAddress?eX((0,m._)((0,u._)({},e),{firstName:(null==l?void 0:l.firstName)||e.firstName,lastName:(null==l?void 0:l.lastName)||e.lastName,email:s?null==l?void 0:l.email:e.email}),!1,"billing",r):{firstName:e.billingFirstName,lastName:e.billingLastName,email:e.billingEmail||e.email,address:"business"===e.billingTypeOrder?eQ(e.selectedBillingSchool,"billing"):{houseNumber:e.billingHouseNumber,houseNumberAddition:null!=(t=e.billingHouseNumberAddition)?t:"",streetName:e.billingStreetName,postalCode:E(e.billingCountry,e.billingPostcode),city:e.b
1illingCity,country:e.billingCountry}};return eG(a),a},tn=(e,t,r,l,i)=>{let n=e4(i),s=(null==l?void 0:l.email)&&n.isValidSync(null==l?void 0:l.email)?l.email:e.email,a={firstName:(null==l?void 0:l.firstName)||e.firstName,fullName:(null==l?void 0:l.fullName)||null,lastName:(null==l?void 0:l.lastName)||e.lastName,email:s,jwt:t||null,currency:r};return eG(a),a},ts=e=>({typeOfOrderTitle:e.typeOfOrderTitle,userDeliveryAddressTitle:e.userDeliveryAddressTitle,differentSchoolAddressOptionLabel:e.differentSchoolAddressOptionLabel,deliveryAddressTitle:e.deliveryAddressTitle}),ta=e=>({typeOfOrderTitle:e.billingTypeTitle,userDeliveryAddressTitle:e.userBillingAddressTitle,differentSchoolAddressOptionLabel:e.differentBillingSchoolAddressOptionLabel,deliveryAddressTitle:e.billingDeliveryAddressTitle}),to=(e,t)=>t?e[t]||t:"",td=e=>{var t,r,n,s,a,y,b;let{userDetails:x,cmsData:E,cmsDataCart:w,cart:_,cmsFormErrors:L,paymentMethodsEnabled:R,countriesOptions:q,loading:W,userInstitutions:H,locale:Z,currency:K,defaultCountry:G,jwt:Q,onCountryChange:X,getAddresses:J,requestOrder:ee,privateOnlyWarning:et,teacherOnlyWarning:er,outOfStockWarning:el,exceedingMaxQuantityWarning:ei,notDisplayableWarning:en}=e,{tracker:es}=(0,F.sr)(),[ea,eo]=i.useState([]),{b2cPriceEnabled:ed}=(0,F.h)(),[ec]=i.useState((0,f.g)(null==E?void 0:E.checkoutPurchaseBo
1x,Z,K,!1,ed)),eu=(0,F.bY)(),em=(0,o.x0)(x,null==_?void 0:_.items),[eh,eg]=i.useState([]),{isMaintenanceMode:ep}=(0,B._)(),ev=(0,F.rX)();i.useEffect(()=>{var e,t,r,l,i,n;let s=null==_?void 0:_.items.map(e=>(0,v.UU)(e,K));null==es||es.checkoutStarted({total:null!=(e=null==_?void 0:_.priceTotal)?e:0,currency:K,orderId:null!=(t=null==_?void 0:_.orderId)?t:"",affiliation:"",revenue:null!=(r=null==_?void 0:_.priceTotal)?r:0,shipping:null!=(l=null==_?void 0:_.shippingCost)?l:0,tax:null!=(i=null==_?void 0:_.totalTaxes)?i:0,discount:null!=(n=null==_?void 0:_.discountRate)?n:0,products:s})},[es]);let{disablePrivateOnTeacherCopies:ef,enableLabelInformation:ey,onlyBusinessOrders:eb,onlyPrivateBilling:ex,enableOrderReference:ej,maxUseCopy:eC,maxInspectionCopy:eN,enableAddressValidation:eS}=(0,F.h)(),{validateShippingAddress:eE,validateBillingAddress:ew,isValidating:eA}=U(),[eD,eI]=i.useState(),[eP,ek]=i.useState(),eM=e=>{var t,r,l,i;return{title:e.title,tags:"".concat(e.copyType?(0,M.e)(E.checkoutPurchaseBox.copyTypes,e):e.tags),price:Number(null!=(t=e.price)?t:0),basePrice:Number(null!=(r=e.basePrice)?r:0),taxRate:Number(null!=(l=e.taxRate)?l:0),productUrl:"/webshop/product/".concat(e.productUrl),currency:K,locale:Z,quantity:e.quantity,outOfStockWarning:(0,c.jL)(e)?w.outOfStockProductText:"",exceedingMaxQuantityWarning:(0,c.dD)({maxUseCopy:eC,maxInspectionCopy:eN})(e)?w.exceedingMaxQuantityProductText:"",teacherOnlyWarning:(0,V.NI)(x,e)||em?"":w.teacherOnlyProductText,privateOnlyWarning:!(0,V.NI)(x,e)&&em?w.teacherNotAllowedProductText:"",notDisplayableWarning:(0,c.vD)(e)?w.notDisplayableProductText:"",totalPrice:null!=(i=e.totalPrice)?i:0}},eO=(e=>null==e?void 0:e.items.some(e=>{var t;return null==(t=e.purchaseConditions)?void 0:t.requiresActivationEmail}))(_),eF=null!=(a=null==_?void 0:_.items.some(e=>{var t;return null==(t=e.purchaseConditions)?void 0:t.impliesShippingCosts}))&&a,e_=!!(ex&&em&&S(_)),{register:eL,handleSubmit:eR,watch:eV,errors:eW,control:e$,getValues:eG,setValue:eQ,setError:eJ,unregister:e0,trigger:e1,formState:{isSubmitting:e2}}=(0,h.mN)({mode:"onTouched",resolver:(0,p.t)(tl({isDigital:!!eO,hasPrintProducts:eF,forbiddenEmails:null!=(y=null==E?void 0:E.forbiddenEmailDomains)?y:[],allowedCountries:null!=(b=null==E?void 0:E.countries)?b:[],enableLabelInformation:ey,requireUsageAddress:e_}))}),e3=e=>to(L,e),e5=e=>null==E?void 0:E.inputFields.find(t=>t.id===e&&t),e7=eV("country"),e4=eu.currency,e9=eV("sameDeliveryAddress"),e6=eV("typeOrder"),e8=e6?"business"===e6:void 0,te="business"===eV("billingTypeOrder")||e9&&e8,tt=!!eV("selectedSchool"),tr=eV("paymentType"),td=te||e_||ex&&tt,tc=eV("notReturnConsent"),tu=eV("termsAndConditions");i.useEffect(()=>{e1("notReturnConsent")},[tc,e1]),i.useEffect(()=>{e1("termsAndConditions")},[tu,e1]);let[tm]=i.useState(!(null==_?void 0:_.items)||(null==_?void 0:_.items.length)===0),th="invoice"===tr&&(null==E?void 0:E.payButtonTextInvoicePayment)?null==E?void 0:E.payButtonTextInvoicePayment:null==E?void 0:E.payButtonText;i.useEffect(()=>{_&&e7&&X(_,e7)},[e7]),i.useEffect(()=>{let e=null==q?void 0:q.find(e=>{let{value:t}=e;return t===G});e&&eQ("country",e.value),e8||(e0("schoolName"),e0("schoolNumber"))},[e8]),i.useEffect(()=>{td||"invoice"!==tr||eQ("paymentType","ideal")},[td,tr,eQ]),i.useEffect(()=>{if(e9)eQ("billingCountry",void 0);else{let e=null==q?void 0:q.find(e=>{let{value:t}=e;return t===G});e&&eQ("billingCountry",e.value)}},[e9]),i.useEffect(()=>{_&&eg(A(_.items)),eo((0,k.m)((null==_?void 0:_.items)||[],eM))},[_]);let tg=null==_?void 0:_.items.some(e=>!(0,o.ZF)(x,e)&&(j(e)||C(e))),tp=(null==_?void 0:_.items.length)&&0===_.priceTotal,tv=[Object.keys(eW).length>0,tm,W,eA,""===tr].some(e=>e),tf=async e=>{var t;if(eS){if("particular"===e.typeOrder){let t=await eE(e);if(!t.valid){t.suggestions&&eI(t.suggestions),eJ("city",{type:"manual",message:t.error}),setTimeout(()=>{var e;null==(e=document.querySelector('[name="city"]'))||e.scrollIntoView({behavior:"smooth",block:"center"})},100);return}eI(void 0)}if(!e9&&"particular"===e.billingTypeOrder){let t=await ew(e);if(!t.valid){t.suggestions&&ek(t.suggestions),eJ("billingCity",{type:"manual",message:t.error}),setTimeout(()=>{var e;
1null==(e=document.querySelector('[name="billingCity"]'))||e.scrollIntoView({behavior:"smooth",block:"center"})},100);return}ek(void 0)}}let r=eX(e,eO),l=ti(e,eb,x,null!=(t=null==E?void 0:E.forbiddenEmailDomains)?t:[]),i=tn(l,Q,e4,x,(null==E?void 0:E.forbiddenEmailDomains)||[]);null==es||es.checkoutStepCompleted({checkoutId:"",step:0,shippingMethod:"",paymentMethod:e.paymentType}),await ee((0,u._)({customer:i,billing:l,shipping:r,methodType:e.paymentType,locale:Z,customerOrderType:ex?"private":"business"===e.typeOrder||"business"===e.billingTypeOrder||ef&&T(_)?"business":"private",orderReference:e.orderReference||"",deliveryEmail:e.deliveryEmail||"",deliveryPhone:e.deliveryPhone||""},e.labelInformation&&{labelInformation:e.labelInformation})),ev.save(O.f.TRACK_NEXT_ORDER,"true")};if(tg)return(0,l.jsx)(eZ,{locale:Z,currency:K,cmsData:E,cart:_,products:ea});if(en||el||et||er||ei){let e=en?E.checkoutErrorMessageNotDisplayable:"",t=el?E.checkoutErrorMessageOutOfStock:"",r=ei?E.checkoutErrorMessageExceedingMaxQuantity:"",i=er?E.checkoutErrorMessage:"",n=et?E.checkoutErrorMessagePrivateOnly:"";return(0,l.jsx)(eH,{locale:Z,currency:K,cmsData:E,cart:_,products:ea,title:E.checkoutErrorTitle||"There is an error on the products in the cart",subtitle:e||t||i||n||r||"Please get back to the cart and resolve the issues",backToCartLabel:E.backToCartText||"back to cart"})}return(0,l.jsxs)(Y,{children:[(0,l.jsxs)(g._,{hasStripe:!0,children:[" ",null==E?void 0:E.pageTitle]}),(0,l.jsxs)($,{children:[(0,l.jsxs)("form",{id:"checkout-form",onSubmit:e=>{e.preventDefault(),e.stopPropagation()},autoComplete:"on",children:[e_&&(0,l.jsx)(eK,{cmsData:E,register:eL,disabled:W,findInputCmsData:e5,errors:eW,control:e$,userDetails:x,formErrorFor:e3,countriesOption:q,getValues:eG,trigger:e1,setValueInParentForm:e=>{e?(eL("selectedUsageSchool"),eQ("selectedUsageSchool",e)):eQ("selectedUsageSchool",void 0),e1()},userInstitutions:H,getAddresses:J,cmsDataCustomMapper:E&&ta(E),hasSpecialProducts:S(_)}),(0,l.jsx)(eY,{cmsData:E,register:eL,disabled:W,findInputCmsData:e5,errors:eW,control:e$,userDetails:x,formErrorFor:e3,countriesOption:q,getValues:eG,trigger:e1,setValueInParentForm:e=>{e?(eL("schoolName"),eQ("schoolName",e.delivery.schoolName),eL("country"),eQ("country",e.delivery.country),eL("selectedSchool"),eQ("selectedSchool",e)):(eQ("schoolName",void 0),eQ("selectedSchool",void 0)),e1()},userInstitutions:H,getAddresses:J,isSchoolAddress:e8,isCartZeroPriced:!!tp,cmsDataCustomMapper:E&&ts(E),hasTeacherCopy:T(_),expectUsageSchoolAddress:e_,usageSchoolAddress:eV("selectedUsageSchool"),isTeacherUser:em,suggestions:eD,onAcceptSuggestion:()=>{if(eD){var e,t,r,l,i;eQ("streetName",null!=(e=eD.streetName)?e:""),eQ("houseNumber",null!=(t=eD.houseNumber)?t:""),eQ("houseNumberAddition",null!=(r=eD.houseNumberAddition)?r:""),eQ("city",null!=(l=eD.city)?l:""),eQ("postcode",null!=(i=eD.postcode)?i:""),eI(void 0),e1()}},suggestionLabels:{title:L.addressSuggestionTitle,message:L.addressSuggestionMessage,acceptButton:L.addressSuggestionAcceptButton}}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}}),eO&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eB,{cmsData:E,register:eL,errors:eW,findInputCmsData:e5,control:e$,disabled:W,formErrorFor:e3}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}})]}),(0,l.jsx)(eT,{cmsData:E,register:eL,setValueInParentForm:e=>{e?(eL("billingSchoolName"),eQ("billingSchoolName",e.delivery.schoolName),eL("selectedBillingSchool"),eQ("selectedBillingSchool",e)):(eQ("billingSchoolName",void 0),eQ("selectedBillingSchool",void 0)),e1()},userInstitutions:H,errors:eW,userDetails:x,control:e$,getAddresses:J,findInputCmsData:e5,disabled:W,isSchoolAddress:te,formErrorFor:e3,isActive:!e9,countriesOption:q,getValues:eG,trigger:e1,hasFreeProducts:N(_),isShippingSchoolAddress:e8,cmsDataCustomMapper:E&&ta(E),isTeacherUser:em,suggestions:eP,onAcceptSuggestion:()=>{if(eP){var e,t,r,l,i;eQ("billingStreetName",null!=(e=eP.streetName)?e:""),eQ("billingHouseNumber",null!=(t=eP.houseNumber)?t:""),eQ("billingHouseNumberAddition",null!=(r=eP.houseNumberAddition)?r:""),eQ("billingCity",null!=(l=eP.city)?l:""),eQ("billingPostcode",null!=(i=eP.postcode)?i:""),ek(void 0),e1()}},suggestionLabels:{title:L.addressSuggestionTitle,message:L.addressSuggestionMessage,acceptButton:L.addressSuggestionAcceptButton}}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}}),ej&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.pd,{type:"text",ref:eL,label:E.orderReferenceLabel||"Order Reference",placeholder:E.orderReferencePlaceholder||"Enter your reference",name:"orderReference",htmlFor:"orderReference",maxLength:10,errors:!!eW.orderReference,errorMessage:e3(null==(t=eW.orderReference)?void 0:t.message)}),(0,l.jsx)("br",{})]}),ey&&(0,l.jsx)(l.Fragment,{children:eF?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.pd,{type:"text",ref:eL,label:E.labelInformationLabel||"Godsm\xe4rkning",placeholder:E.labelInformationPlaceholder||"Ange godsm\xe4rkning",name:"labelInformation",htmlFor:"labelInformation",maxLength:45,errors:!!eW.labelInformation,errorMessage:e3(null==(r=eW.labelInformation)?void 0:r.message)}),(0,l.jsx)("br",{}),(0,l.jsx)(g.pd,{type:"text",ref:eL,label:E.deliveryEmail||"E-mail for delivery",placeholder:E.deliveryEmailPlaceholder||"Enter your e-mail for delivery",name:"deliveryEmail",htmlFor:"deliveryEmail",maxLength:45,errors:!!eW.deliveryEmail,errorMessage:e3(null==(n=eW.deliveryEmail)?void 0:n.message)}),(0,l.jsx)("br",{}),(0,l.jsx)(g.pd,{type:"text",ref:eL,label:E.deliveryPhone||"Phonenumber for delivery",placeholder:E.deliveryPhonePlaceholder||"Enter phonenumber for delivery",name:"deliveryPhone",htmlFor:"deliveryPhone",maxLength:32,errors:!!eW.deliveryPhone,errorMessage:e3(null==(s=eW.deliveryPhone)?void 0:s.message)}),(0,l.jsx)("br",{})]}):null}),(0,l.jsx)(eq,{cmsData:E,register:eL,disabled:W,findInputCmsData:e5,errors:eW,enableInvoices:td,formErrorFor:e3,paymentMethodsEnabled:R,control:e$,userDetails:x,paymentTypeValue:tr,cart:_,hasSpecialCopy:S(_)}),(0,l.jsx)(ez,{cmsData:E,register:eL,disabled:W,findInputCmsData:e5,errors:eW,itemsTypeDigital:eO,formErrorFor:e3})]}),(0,l.jsx)(eU,(0,m._)((0,u._)({},ec),{taxes:eh,total:D(ec,_),shipping:P(ec,_),priceWithoutTaxes:I(ec,_),products:ea.slice().reverse(),editUrl:"/".concat(Z,"/cart"),totalTaxes:null==_?void 0:_.totalTaxes}))]}),(0,l.jsx)(z,{children:W?(0,l.jsx)(d.kt,{}):(0,l.jsx)("div",{"data-cy":"checkout-submit-button",children:(0,l.jsx)(d.$n,{type:"button",variant:"primary",label:th,isBlock:!0,isDisabled:e2||tv||ep,onClick:()=>{eR(tf)()}})})})]})},tc=e=>{var t,r,n,s,a,y,b;let{userDetails:x,cmsData:E,cmsDataCart:w,cart:_,cmsFormErrors:L,paymentMethodsEnabled:R,countriesOptions:q,loading:W,userInstitutions:H,jwt:Z,onCountryChange:K,getAddresses:G,requestOrder:Q,privateOnlyWarning:X,teacherOnlyWarning:J,outOfStockWarning:ee,exceedingMaxQuantityWarning:et,notDisplayableWarning:er}=e,el="sv-SE",{tracker:ei}=(0,F.sr)(),[en,es]=i.useState([]),{priceType:ea}=(0,ej.Z)(),{b2cPriceEnabled:eo}
1=(0,F.h)(),[ed]=i.useState((0,f.g)(null==E?void 0:E.checkoutPurchaseBox,el,"SEK","b2b"===ea,eo)),ec=(0,F.bY)(),eu=(0,o.x0)(x,null==_?void 0:_.items),[em,eh]=i.useState([]),{isMaintenanceMode:eg}=(0,B._)(),ep=(0,F.rX)();i.useEffect(()=>{var e,t,r,l,i,n;let s=null==_?void 0:_.items.map(e=>(0,v.UU)(e,"SEK"));null==ei||ei.checkoutStarted({total:null!=(e=null==_?void 0:_.priceTotal)?e:0,currency:"SEK",orderId:null!=(t=null==_?void 0:_.orderId)?t:"",affiliation:"",revenue:null!=(r=null==_?void 0:_.priceTotal)?r:0,shipping:null!=(l=null==_?void 0:_.shippingCost)?l:0,tax:null!=(i=null==_?void 0:_.totalTaxes)?i:0,discount:null!=(n=null==_?void 0:_.discountRate)?n:0,products:s})},[ei]);let{enableOrderReference:ev,maxUseCopy:ef,maxInspectionCopy:ey,enableAddressValidation:eb}=(0,F.h)(),{validateShippingAddress:ex,validateBillingAddress:eC,isValidating:eT}=U(),[eS,eE]=i.useState(),[ew,eA]=i.useState(),eD="b2c"===ea,eI=e=>{var t,r,l,i;return{title:e.title,tags:"".concat(e.copyType?(0,M.e)(E.checkoutPurchaseBox.copyTypes,e):e.tags),price:Number(null!=(t=e.price)?t:0),basePrice:Number(null!=(r=e.basePrice)?r:0),taxRate:Number(null!=(l=e.taxRate)?l:0),productUrl:"/webshop/product/".concat(e.productUrl),currency:"SEK",locale:el,quantity:e.quantity,outOfStockWarning:(0,c.jL)(e)?w.outOfStockProductText:"",exceedingMaxQuantityWarning:(0,c.dD)({maxUseCopy:ef,maxInspectionCopy:ey})(e)?w.exceedingMaxQuantityProductText:"",teacherOnlyWarning:(0,V.NI)(x,e)||eu?"":w.teacherOnlyProductText,privateOnlyWarning:!(0,V.NI)(x,e)&&eu?w.teacherNotAllowedProductText:"",notDisplayableWarning:(0,c.vD)(e)?w.notDisplayableProductText:"",totalPrice:null!=(i=e.totalPrice)?i:0}},eP=(e=>null==e?void 0:e.items.some(e=>{var t;return null==(t=e.purchaseConditions)?void 0:t.requiresActivationEmail}))(_),ek=null!=(a=null==_?void 0:_.items.some(e=>{var t;return null==(t=e.purchaseConditions)?void 0:t.impliesShippingCosts}))&&a,{register:eM,handleSubmit:eO,watch:eF,errors:e_,control:eL,getValues:eR,setValue:eV,setError:eY,unregister:e$,trigger:eK,formState:{isSubmitting:eG}}=(0,h.mN)({mode:"onBlur",resolver:(0,p.t)(tl({isDigital:!!eP,hasPrintProducts:ek,forbiddenEmails:null!=(y=null==E?void 0:E.forbiddenEmailDomains)?y:[],allowedCountries:null!=(b=null==E?void 0:E.countries)?b:[],enableLabelInformation:!0,requireUsageAddress:!1,isLiberCheckout:!0,priceType:ea})),defaultValues:{sameDeliveryAddress:!0}}),eQ=e=>to(L,e),eJ=e=>null==E?void 0:E.inputFields.find(t=>t.id===e&&t),e0=eF("country"),e1=ec.currency,e2=!eD||eF("sameDeliveryAddress"),e3=eF("typeOrder"),e5=e3?"business"===e3:void 0,e7=eF("paymentType"),e4=!eD,e9=eF("notReturnConsent"),e6=eF("termsAndConditions");i.useEffect(()=>{eK("notReturnConsent")},[e9,eK]),i.useEffect(()=>{eK("termsAndConditions")},[e6,eK]);let[e8]=i.useState(!(null==_?void 0:_.items)||(null==_?void 0:_.items.length)===0),te="invoice"===e7&&(null==E?void 0:E.payButtonTextInvoicePayment)?null==E?void 0:E.payButtonTextInvoicePayment:null==E?void 0:E.payButtonText;i.useEffect(()=>{_&&e0&&K(_,e0)},[e0]),i.useEffect(()=>{let e=null==q?void 0:q.find(e=>{let{value:t}=e;return"SE"===t});e&&eV("country",e.value),e5||(e$("schoolName"),e$("schoolNumber"))},[e5]),i.useEffect(()=>{e4||"invoice"!==e7||eV("paymentType","ideal")},[e4,e7,eV]),i.useEffect(()=>{if(e2)eV("billingCountry",void 0);else{let e=null==q?void 0:q.find(e=>{let{value:t}=e;return"SE"===t});e&&eV("billingCountry",e.value)}},[e2]),i.useEffect(()=>{_&&eh(A(_.items)),es((0,k.m)((null==_?void 0:_.items)||[],eI))},[_]);let tt=null==_?void 0:_.items.some(e=>!(0,o.ZF)(x,e)&&(j(e)||C(e))),tr=(null==_?void 0:_.items.length)&&0===_.priceTotal,td=[Object.keys(e_).length>0,e8,W,eT,""===e7].some(e=>e),tc=async e=>{var t;if(eb&&"b2c"===ea){let t=await ex(e);if(!t.valid){t.suggestions&&eE(t.suggestions),eY("city",{type:"manual",message:t.error}),setTimeout(()=>{var e;null==(e=document.querySelector('[name="city"]'))||e.scrollIntoView({behavior:"smooth",block:"center"})},100);return}if(eE(void 0),!e2){let t=await eC(e);if(!t.valid){t.suggestions&&eA(t.suggestions),eY("billingCity",{type:"manual",message:t.error}),setTimeout(()=>{var e;
1null==(e=document.querySelector('[name="billingCity"]'))||e.scrollIntoView({behavior:"smooth",block:"center"})},100);return}eA(void 0)}}let r=(0,m._)((0,u._)({},e),{typeOrder:eD?"particular":"business",sameDeliveryAddress:!eD||e.sameDeliveryAddress}),l=eX(r,eP),i=ti(r,!eD,x,null!=(t=null==E?void 0:E.forbiddenEmailDomains)?t:[]),n=tn(i,Z,e1,x,(null==E?void 0:E.forbiddenEmailDomains)||[]);null==ei||ei.checkoutStepCompleted({checkoutId:"",step:0,shippingMethod:"",paymentMethod:e.paymentType});let s=(0,u._)({customer:n,billing:i,shipping:l,methodType:e.paymentType,locale:el,customerOrderType:eD?"private":"business",orderReference:e.orderReference||"",deliveryEmail:e.deliveryEmail||"",deliveryPhone:e.deliveryPhone||""},e.labelInformation&&{labelInformation:e.labelInformation});await Q(s),ep.save(O.f.TRACK_NEXT_ORDER,"true")};if(tt)return(0,l.jsx)(eZ,{locale:el,currency:"SEK",cmsData:E,cart:_,products:en});if(er||ee||X||J||et){let e=er?E.checkoutErrorMessageNotDisplayable:"",t=ee?E.checkoutErrorMessageOutOfStock:"",r=et?E.checkoutErrorMessageExceedingMaxQuantity:"",i=J?E.checkoutErrorMessage:"",n=X?E.checkoutErrorMessagePrivateOnly:"";return(0,l.jsx)(eH,{locale:el,currency:"SEK",cmsData:E,cart:_,products:en,title:E.checkoutErrorTitle||"There is an error on the products in the cart",subtitle:e||t||i||n||r||"Please get back to the cart and resolve the issues",backToCartLabel:E.backToCartText||"back to cart"})}return(0,l.jsxs)(Y,{children:[(0,l.jsxs)(g._,{hasStripe:!0,children:[" ",null==E?void 0:E.pageTitle]}),(0,l.jsxs)($,{children:[(0,l.jsxs)("form",{id:"checkout-form",onSubmit:eO(tc),autoComplete:"on",children:[(0,l.jsx)(eW,{cmsData:E,register:eM,disabled:W,findInputCmsData:eJ,errors:e_,control:eL,userDetails:x,formErrorFor:eQ,countriesOption:q,getValues:eR,trigger:eK,setValueInParentForm:e=>{e?(eM("schoolName"),eV("schoolName",e.delivery.schoolName),eM("country"),eV("country",e.delivery.country),eM("selectedSchool"),eV("selectedSchool",e)):(eV("schoolName",void 0),eV("selectedSchool",void 0)),eK()},userInstitutions:H,getAddresses:G,isCartZeroPriced:!!tr,cmsDataCustomMapper:E&&ts(E),hasTeacherCopy:T(_),expectUsageSchoolAddress:!1,usageSchoolAddress:eF("selectedUsageSchool"),suggestions:eS,onAcceptSuggestion:()=>{if(eS){var e,t,r,l,i;eV("streetName",null!=(e=eS.streetName)?e:""),eV("houseNumber",null!=(t=eS.houseNumber)?t:""),eV("houseNumberAddition",null!=(r=eS.houseNumberAddition)?r:""),eV("city",null!=(l=eS.city)?l:""),eV("postcode",null!=(i=eS.postcode)?i:""),eE(void 0),eK()}},suggestionLabels:{title:L.addressSuggestionTitle,message:L.addressSuggestionMessage,acceptButton:L.addressSuggestionAcceptButton}}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}}),eP&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eB,{cmsData:E,register:eM,errors:e_,findInputCmsData:eJ,control:eL,disabled:W,formErrorFor:eQ}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}})]}),(0,l.jsx)(eN,{cmsData:E,register:eM,setValueInParentForm:e=>{e?(eM("billingSchoolName"),eV("billingSchoolName",e.delivery.schoolName),eM("selectedBillingSchool"),eV("selectedBillingSchool",e)):(eV("billingSchoolName",void 0),eV("selectedBillingSchool",void 0)),eK()},userInstitutions:H,errors:e_,userDetails:x,control:eL,getAddresses:G,findInputCmsData:eJ,disabled:W,formErrorFor:eQ,isActive:!e2,countriesOption:q,getValues:eR,trigger:eK,hasFreeProducts:N(_),isShippingSchoolAddress:e5,cmsDataCustomMapper:E&&ta(E),suggestions:ew,onAcceptSuggestion:()=>{if(ew){var e,t,r,l,i;eV("billingStreetName",null!=(e=ew.streetName)?e:""),eV("billingHouseNumber",null!=(t=ew.houseNumber)?t:""),eV("billingHouseNumberAddition",null!=(r=ew.houseNumberAddition)?r:""),eV("billingCity",null!=(l=ew.city)?l:""),eV("billingPostcode",null!=(i=ew.postcode)?i:""),eA(void 0),eK()}},suggestionLabels:{title:L.addressSuggestionTitle,message:L.addressSuggestionMessage,acceptButton:L.addressSuggestionAcceptButton}}),(0,l.jsx)(g.d$,{style:{margin:"2rem 0"}}),ev&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.pd,{type:"text",ref:eM,label:E.orderReferenceLabel||"Order Reference",placeholder:E.orderReferencePlaceholder||"Enter your reference",name:"orderReference",htmlFor:"orderReference",maxLength:10,errors:!!e_.orderReference,errorMessage:eQ(null==(t=e_.orderReference)?void 0:t.message)}),(0,l.jsx)("br",{})]}),ek?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g.pd,{type:"text",ref:eM,label:E.labelInformationLabel||"Godsm\xe4rkning",placeholder:E.labelInformationPlaceholder||"Ange godsm\xe4rkning",name:"labelInformation",htmlFor:"labelInformation",maxLength:45,errors:!!e_.labelInformation,errorMessage:eQ(null==(r=e_.labelInformation)?void 0:r.message)}),(0,l.jsx)("br",{}),(0,l.jsx)(g.pd,{type:"text",ref:eM,label:E.deliveryEmail||"E-mail for delivery",placeholder:E.deliveryEmailPlaceholder||"Enter your e-mail for delivery",name:"deliveryEmail",htmlFor:"deliveryEmail",maxLength:45,errors:!!e_.deliveryEmail,errorMessage:eQ(null==(n=e_.deliveryEmail)?void 0:n.message)}),(0,l.jsx)("br",{}),(0,l.jsx)(g.pd,{type:"text",ref:eM,label:E.deliveryPhone||"Phonenumber for delivery",placeholder:E.deliveryPhonePlaceholder||"Enter phonenumber for delivery",name:"deliveryPhone",htmlFor:"deliveryPhone",maxLength:45,errors:!!e_.deliveryPhone,errorMessage:eQ(null==(s=e_.deliveryPhone)?void 0:s.message)}),(0,l.jsx)("br",{})]}):null,(0,l.jsx)(eq,{cmsData:E,register:eM,disabled:W,findInputCmsData:eJ,errors:e_,enableInvoices:e4,formErrorFor:eQ,paymentMethodsEnabled:eD?R:{invoice:!0},control:eL,userDetails:x,paymentTypeValue:e7,cart:_,hasSpecialCopy:S(_)}),(0,l.jsx)(ez,{cmsData:E,register:eM,disabled:W,findInputCmsData:eJ,errors:e_,itemsTypeDigital:eP,formErrorFor:eQ})]}),(0,l.jsx)(eU,(0,m._)((0,u._)({},ed),{taxes:em,total:D(ed,_),shipping:P(ed,_),priceWithoutTaxes:I(ed,_),products:en.slice().reverse(),editUrl:"/".concat(el,"/cart"),totalTaxes:null==_?void 0:_.totalTaxes}))]}),(0,l.jsx)(z,{children:W?(0,l.jsx)(d.kt,{}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(d.$n,{type:"submit",variant:"primary",label:te,isBlock:!0,isDisabled:eG||td||eg,form:"checkout-form"})})})]})};var tu=r(61902),tm=r(4241);let th=i.createContext({paymentService:null}),tg=e=>{let{children:t}=e,r=(0,tu.useStripe)(),i=null;if(r){let e=(()=>{let e="invoice",t=async t=>Promise.resolve({paymentMethod:{type:e,billing_details:{name:"".concat(t.firstName," ").concat(t.lastName),email:t.email,address:{city:t.address.city,country:t.address.country,state:"",postal_code:t.address.postalCode,line1:"".concat(t.address.streetName," , ").concat(t.address.houseNumber),line2:""}}}});return{type:e,createPaymentMethod:t}})(),t=(e=>{let t="bancontact",r=async r=>{var l;let i=(null==(l=r.address)?void 0:l.houseNumberAddition)?" , ".concat(r.address.houseNumberAddition):"";return e.createPaymentMethod({type:t,billing_details:{name:"".concat(r.firstName," ").concat(r.lastName),email:r.email,address:{city:r.address.city,country:r.address.country,state:"",postal_code:r.address.postalCode,line1:"".concat(r.address.streetName," , ").concat(r.address.houseNumber).concat(i)}}})};return{type:t,createPaymentMethod:r}})(r),l=(e=>{let t="ideal",r=async(r,l)=>null==e?void 0:e.createPaymentMethod({type:t,ideal:{bank:l},billing_details:{name:"".concat(r.firstName," ").concat(r.lastName),email:r.email,address:{city:r.address.city,country:r.address.country,state:"",postal_code:r.address.postalCode,line1:"".concat(r.address.streetName," , ").concat(r.address.houseNumber)}}});return{type:t,confirmPayment:(t,r)=>e.confirmIdealPayment(r,{return_url:t}),createPaymentMethod:r}})(r),n=(e=>{let t="klarna",r=async r=>{var l;let i=(null==(l=r.address)?void 0:l.houseNumberAddition)?" , ".concat(r.address.houseNumberAddition):"";return e.createPaymentMethod({type:t,billing_details:{name:"".concat(r.firstName," ").concat(r.lastName),email:r.email,address:{city:r.address.city,country:r.address.country,state:"",postal_code:r.address.postalCode,line1:"".concat(r.address.streetName," , ").concat(r.address.houseNumber).concat(i)}}})};return{type:t,createPaymentMethod:r}})(r);i=((e,t,r,l,i)=>{let n={ideal:t,bancontact:r,klarna:l,invoice:i};return{createPaymentMethod:(e,t,r)=>n[t].createPaymentMethod(e,r),confirmPaymentIdealV2:(t,r)=>e.confirmIdealPayment(t,{payment_method:{ideal:{}},return_url:r}),confirmPaymentBancontactV2:(t,r,l)=>e.confirmBancontactPayment(t,{return_url:r,payment_method:{billing_details:{name:l}}}),confirmPaymentKlarna:(t,r,l)=>e.confirmKlarnaPayment(t,{return_url:r,payment_method:{billing_details:{address:{country:l}}}}),confirmPaymentInvoiceV2:e=>{location.href=e},confirmPayment:(e,t,r)=>n[r].confirmPayment(t,e)}})(r,l,t,n,e)}return(0,l.jsx)(th.Provider,{value:{paymentService:i},children:t})},tp=e=>{let{children:t}=e,r=(0,F.bY)(),[n,s]=i.useState(r.stripePublicKey||""),a=i.useMemo(()=>n?(0,tm.c)(n):null,[n]);return i.useEffect(()=>{n||fetch("/api/config/stripe").then(e=>e.json()).then(e=>s(e.publicKey)).catch(console.error)},[]),(0,l.jsx)(tu.Elements,{stripe:a,children:(0,l.jsx)(tg,{children:t})})};var tv=r(64691);let tf=()=>{let{checkout:e}=(0,tv._)(),{paymentService:t}=i.useContext(th),[r,l]=i.useState(),[n,s]=i.useState(!1);
1return{error:r,loading:n,requestOrder:async r=>{let{customer:i,billing:n,shipping:a,methodType:o,locale:d,customerOrderType:c,orderReference:m,labelInformation:h,deliveryEmail:g,deliveryPhone:p}=r;s(!0);try{l(void 0);let r=""+window.location.origin+(d?"/".concat(d):"")+"/purchase-status/:orderId",{paymentSecret:s,orderId:v,paymentUser:f}=await e((0,u._)({customer:i,paymentMethod:{type:o},billing:n,shipping:a,locale:d,customerOrderType:c,orderReference:m,deliveryEmail:g,deliveryPhone:p},h&&{labelInformation:h}),r),y=r.replace(":orderId",v);"invoice"===o&&(null==t||t.confirmPaymentInvoiceV2(y)),"bancontact"===o&&(null==t||t.confirmPaymentBancontactV2(s,y,f)),"ideal"===o&&await (null==t?void 0:t.confirmPaymentIdealV2(s,y)),"klarna"===o&&await (null==t?void 0:t.confirmPaymentKlarna(s,y,n.address.country))}catch(e){l(e)}finally{s(!1)}}}},ty=(e,t)=>e.filter(e=>t.has(e.delivery.country)),tb=(e,t)=>async r=>ty(await e(r),t),tx=e=>{var t;let{cmsData:r,cmsFormErrors:n,locale:s,currency:u,defaultCountry:m,cmsDataCart:h}=e,{error:g,loading:p,requestOrder:v}=tf(),{cart:f,isUpdatingCart:y,updateCartBySelectedCountry:b}=(0,F._$)(),{userDetails:x,jwt:j}=(0,F.xc)(),{getInstitutions:C,userInstitutions:T}=(0,F.aO)(j),N=(0,a.useRouter)(),S=!f||(null==(t=f.items)?void 0:t.length)===0,{bancontactPaymentEnabled:E,idealPaymentEnabled:w,maxUseCopy:A,maxInspectionCopy:D}=(0,F.h)(),{priceType:I}=(0,ej.Z)(),P=(0,c.R$)(null==f?void 0:f.items),k=(0,c.LK)(null==f?void 0:f.items),M=(0,c.D5)(null==f?void 0:f.items,{maxUseCopy:A,maxInspectionCopy:D}),O=(0,c.q2)(x,null==f?void 0:f.items),_=(0,o.x0)(x,null==f?void 0:f.items),L=O&&!_,R=O&&_;i.useEffect(()=>{!y&&S&&N.push("/")},[f,y]);let U=i.useMemo(()=>{var e;return null==(e=r.countries)?void 0:e.map(e=>({label:e.name,value:e.isoCode}))},[r.countries]),B=i.useMemo(()=>{var e;return new Set(null==(e=r.countries)?void 0:e.map(e=>e.isoCode))},[r.countries]),V=i.useMemo(()=>ty(T,B),[T,B]),q=i.useMemo(()=>tb(C,B),[C,B]),Y=i.useCallback((e,t)=>{b(e,t,I)},[I,b]);return S?(0,l.jsx)(d.kt,{}):(0,l.jsx)(td,{error:g,locale:s,currency:u,userDetails:x,cart:f,loading:y||p,cmsData:r,cmsDataCart:h,getAddresses:q,cmsFormErrors:n,paymentMethodsEnabled:{bancontact:E,ideal:w,invoice:!0},requestOrder:v,jwt:j,userInstitutions:V,countriesOptions:U,onCountryChange:Y,defaultCountry:m,teacherOnlyWarning:L,privateOnlyWarning:R,outOfStockWarning:k,exceedingMaxQuantityWarning:M,notDisplayableWarning:P})},tj=e=>{var t;let{cmsData:r,cmsFormErrors:n,cmsDataCart:s}=e,{error:u,loading:m,requestOrder:h}=tf(),{cart:g,isUpdatingCart:p,updateCartBySelectedCountry:v}=(0,F._$)(),{userDetails:f,jwt:y}=(0,F.xc)(),{getInstitutions:b,userInstitutions:x}=(0,F.aO)(y),j=(0,a.useRouter)(),C=!g||(null==(t=g.items)?void 0:t.length)===0,{klarnaPaymentEnabled:T,maxUseCopy:N,maxInspectionCopy:S}=(0,F.h)(),{priceType:E}=(0,ej.Z)(),w=(0,c.R$)(null==g?void 0:g.items),A=(0,c.LK)(null==g?void 0:g.items),D=(0,c.D5)(null==g?void 0:g.items,{maxUseCopy:N,maxInspectionCopy:S}),I=(0,c.q2)(f,null==g?void 0:g.items),P=(0,o.x0)(f,null==g?void 0:g.items),k=I&&!P,M=I&&P;i.useEffect(()=>{!p&&C&&j.push("/")},[g,p]);let O=i.useMemo(()=>{var e;return null==(e=r.countries)?void 0:e.map(e=>({label:e.name,value:e.isoCode}))},[r.countries]),_=i.useMemo(()=>{var e;return new Set(null==(e=r.countries)?void 0:e.map(e=>e.isoCode))},[r.countries]),L=i.useMemo(()=>ty(x,_),[x,_]),R=i.useMemo(()=>tb(b,_),[b,_]),U=i.useCallback((e,t)=>{v(e,t,E)},[E,v]);return C?(0,l.jsx)(d.kt,{}):(0,l.jsx)(tc,{error:u,userDetails:f,cart:g,loading:p||m,cmsData:r,cmsDataCart:s,getAddresses:R,cmsFormErrors:n,paymentMethodsEnabled:{klarna:T,invoice:!0},requestOrder:h,jwt:y,userInstitutions:L,countriesOptions:O,onCountryChange:U,teacherOnlyWarning:k,privateOnlyWarning:M,outOfStockWarning:A,exceedingMaxQuantityWarning:D,notDisplayableWarning:w})};var tC=r(48712),tT=!0;let tN=e=>{let{cmsCheckoutPage:t,cmsCartPage:r,cmsFormErrors:a,locale:o,currency:d,canonicalUrl:c,defaultCountry:u}=e,{tracker:m}=(0,F.sr)(),h=(0,F.$d)(),{b2cPriceEnabled:g}=(0,F.h)();return i.useEffect(()=>{null==m||m.page({category:s.D.CATEGORY_E_COMMERCE,type:s.D.TYPE_CHECKOUT})},[m]),(0,l.jsxs)(tp,{children:[t.pageMetadata&&(0,l.jsx)(n.b,{metadata:t.pageMetadata,defaultCanonicalUrl:c}),(0,l.jsx)({liber:g?tj:tx,noordhoff:tx,plantyn:tx}[h],{locale:o,cmsData:t,cmsFormErrors:a,currency:d,defaultCountry:u,cmsDataCart:r})]})};tN.layout=tC.n;let tS=tN},68235:(e,t,r)=>{"use strict";r.d(t,{b:()=>s});var l=r(37876),i=r(77328),n=r.n(i);let s=e=>{let{metadata:t,defaultCanonicalUrl:r,structuredData:i,customData:s,noIndex:a}=e;if(!t)return null;let{title:o,description:d,keywords:c=[],hreflangLinks:u=[],canonicalUrl:m,image:h,robotsTags:g=[]}=t,p=e=>e.startsWith("http")?e:"https:".concat(e),v=m||r,f=((e,t)=>{let r=[...e];return t&&r.push("noindex"),[...new Set(r)].join(", ")||null})(g,a);return(0,l.jsxs)(n(),{children:[f&&(0,l.jsx)("meta",{name:"robots",content:f}),o&&(0,l.jsx)("title",{children:o}),d&&(0,l.jsx)("meta",{name:"description",content:d}),c.length>0&&(0,l.jsx)("meta",{name:"keywords",content:c.join(", ")}),v&&(0,l.jsx)("link",{rel:"canonical",href:v}),u.length>0&&u.map(e=>(0,l.jsx)("link",{rel:"alternate",href:e.url,hrefLang:e.language},e.language)),o&&(0,l.jsx)("meta",{property:"og:title",content:o}),d&&(0,l.jsx)("meta",{property:"og:description",content:d}),h&&(0,l.jsx)("meta",{property:"og:image",content:p(h.file.url)}),o&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,l.jsx)("meta",{name:"twitter:title",content:o}),d&&(0,l.jsx)("meta",{name:"twitter:description",content:d}),h&&(0,l.jsx)("meta",{name:"twitter:image",content:p(h.file.url)})]}),i&&(0,l.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:i}}),s]})}},82092:(e,t,r)=>{"use strict";r.d(t,{UU:()=>l}),r(6655);let l=(e,t,r)=>{var l,i,n,s,a,o,d;return{name:e.title,productId:e.id,sku:"",category:null!=(n=e.category)?n:"",brand:e.nameBrand?e.nameBrand.join(","):"",variant:null!=(s=null==e?void 0:e.copyType)?s:"",price:e.price?Number.parseFloat(e.price.toString()):0,quantity:e.quantity,currency:t,cartId:null!=r?r:"",ean:null!=(a=null==e||null==(l=e.ean)?void 0:l.toString())?a:"",isbn:null!=(o=null==e?void 0:e.isbn)?o:"",edition:null!=(d=null==e||null==(i=e.edition)?void 0:i.toString())?d:"",title:e.title,subject:null==e?void 0:e.subject,domain:(null==e?void 0:e.domains)?e.domains.join(","):"",educationLevel:(null==e?void 0:e.educationLevels)?e.educationLevels.join(","):"",stream:(null==e?void 0:e.streams)?e.streams.join(","):"",yearGroup:(null==e?void 0:e.yearGroup)||"",productType:(null==e?void 0:e.type)||""}}},87810:(e,t,r)=>{"use strict";r.d(t,{mc:()=>a,nW:()=>c,k3:()=>o,id:()=>d});var l,i=r(79077),n=r(14232);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)({}).hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(null,arguments)}let a=i.default.div.withConfig({componentId:"sc-5db2ae00-0"})(["display:flex;flex-direction:row;flex-wrap:no-wrap;justify-content:space-between;align-items:center;margin:2.5rem 0 1.5rem;padding-bottom:2.5rem;box-sizing:border-box;@media screen and (max-width:600px){flex-wrap:wrap;margin:0;padding:2.5rem 1.5rem 1.875rem;}"]),o=i.default.div.withConfig({componentId:"sc-5db2ae00-1"})(["display:inline-flex;align-items:center;padding:0.7rem 1rem;margin-top:0.7rem;max-width:90%;background-color:#ffeae5;>
1 span{display:inline-block;width:calc(100% - 24px);}"]),d=(0,i.default)(e=>n.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:20,height:18},e),l||(l=n.createElement("path",{fill:"current",d:"M2.47 18h15.06c1.54 0 2.5-1.67 1.73-3L11.73 1.99c-.77-1.33-2.69-1.33-3.46 0L.74 15c-.77 1.33.19 3 1.73 3M10 11c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1m1 4H9v-2h2z"})))).withConfig({componentId:"sc-5db2ae00-2"})(["fill:#cc2200;margin-right:0.7rem;"]),c=i.default.div.withConfig({componentId:"sc-5db2ae00-3"})(["margin-bottom:1rem;color:",";"],e=>{let{theme:t}=e;return t.palette.secondary.main})}},e=>{e.O(0,[283,636,593,792],()=>e(e.s=27714)),_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.