PageSourceSearch

https://www.thomann.at/static/script/checkout2_CheckoutApp_tsx.hash-68e062d490936de7cc6a.js

js thomann.at collected 2026-10-06 16:17:54 UTC 122,267 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];if(null!=s)for(var a in s)s.hasOwnProperty(a)&&(e[a]=s[a])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:thomann-sentry":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af891b3f-8168-4692-b18d-d265d190fd00",e._sentryDebugIdIdentifier="sentry-dbid-af891b3f-8168-4692-b18d-d265d190fd00")}catch(e){}}(),(globalThis.webpackChunk||=[]).push([["checkout2_CheckoutApp_tsx"],{"./checkout2/CheckoutApp.tsx"(e,t,s){s.r(t),s.d(t,{default:()=>ca});var a=s("../../../packages/platform/globals/src/static-urls.ts"),r=s("../../../packages/platform/design-system/src/icons/icons.tsx"),i=s("../../../packages/platform/design-system/src/info-box/info-box.tsx"),n=s("../../../packages/platform/design-system/src/typography/text.tsx"),o=s("../../../node_modules/react/jsx-runtime.js");const l=({title:e,text:t})=>(0,o.jsx)("div",{className:"col-span-12 lg:col-span-6 lg:col-start-4","data-testid":"general-backend-error",children:(0,o.jsx)(i.w4,{variant:"error",icon:(0,o.jsx)(i.ZF,{variant:"error",children:(0,o.jsx)(r.ee,{})}),className:"mt-6",title:e,children:(0,o.jsx)(n.EY,{children:t})})});s("../../../node_modules/core-js/modules/es.array.includes.js"),s("../../../node_modules/core-js/modules/es.iterator.constructor.js"),s("../../../node_modules/core-js/modules/es.iterator.filter.js"),s("../../../node_modules/core-js/modules/es.iterator.find.js");const c=e=>["PayPalExpress","AmazonPayments"].includes(e.paymentMethod?.paymentMethodToken||""),d=e=>null!==e&&e.length>1,p=(e,t)=>e.find(e=>e.token===t)||void 0;var m=s("../../../packages/platform/design-system/src/notification/notification.tsx"),u=s("../../../node_modules/react/index.js");s("../../../node_modules/core-js/modules/es.iterator.map.js");const h=e=>{const t=e.properties.find(e=>null!==e.carrierPools);return!!t&&(t.carrierPools?.includes("SPEDITION")??!1)},g=e=>!!e,x=e=>"pickup"===e,y=(e,t,s)=>!(!e||!t)&&(!!x(s)||t.options.filter(e=>e.isSelectable).length>1),f=(e,t,s)=>s?(t&&""!==t||(t=e),s.options.find(e=>e.key===t)||s.defaultOption):null;var N=s("../../../node_modules/clsx/dist/clsx.mjs");const b=({active:e})=>(0,o.jsx)("li",{className:"flex flex-auto items-center justify-center p-2 md:p-4",role:"presentation",children:(0,o.jsx)("div",{className:(0,N.$)("h-px w-full",e?"bg-secondary-400":"bg-neutral-300")})}),j=e=>`${(0,a.Tt)()}images/checkout2/stepper/${e}.svg`,v=({stepIndex:e,text:t,iconName:s,done:a,active:r,isClickable:i,onClickStep:n})=>{const l=(0,u.useMemo)(()=>!(!i||r||!a),[i,r,a]),c=(0,u.useCallback)(()=>{n(e)},[n,e]);return(0,o.jsxs)("li",{className:"relative flex flex-col items-center","aria-current":r?"step":"false",children:[(0,o.jsx)("div",{className:(0,N.$)("absolute -top-8 mb-2 hidden whitespace-nowrap text-base text-neutral-400 md:block",{"text-secondary-400":r||a}),children:t}),(0,o.jsx)(k,{index:e,onClick:l?c:void 0,children:(0,o.jsx)("img",{className:"size-10",src:j(s),alt:t})})]})},k=({index:e,onClick:t,children:s})=>t?(0,o.jsx)("button",{"data-testid":`stepper-step-button-${e}`,className:"bg-transparent border-0",onClick:t,children:s}):(0,o.jsx)(o.Fragment,{children:s});var C=s("./checkout2/data/consts.ts"),I=s("./checkout2/utils/helpers.ts"),S=s("./lib/snippet-resolver.ts");const T=(0,u.createContext)(void 0),L=()=>{const e=(0,u.useContext)(T);if(!e)throw new Error("useCheckoutContext must be used within CheckoutContext.Provider");return e},A=()=>{const{schema:e,currentView:t,showView:s,configuration:a,availableShippingOptions:r,setDidAnEdit:i,formData:n}=L(),l=Object.values(C.UT).findIndex(e=>e.ID===t);return(0,o.jsx)("ol",{className:"col-span-12 flex flex-row md:mt-8 lg:col-span-8 lg:col-start-3","data-testid":"checkout-stepper",children:Object.keys(C.UT).map((c,p)=>{const m=C.UT[c];let h=!0;return m.ID===C.UT.LOGIN.ID&&(h=!a?.customer),m.ID===C.UT.SHIPPING.ID&&(h=y(e.properties.selectedShippingCarrier??null,r,n.shippingAddress?.addressType)),m.ID===C.UT.PAYMENT.ID&&(h=d(e.properties.paymentMethod.properties.paymentMethodToken.enum??null)),h?(0,o.jsxs)(u.Fragment,{children:[(0,o.jsx)(v,{stepIndex:p,active:m.ID===t,done:p<l,text:(0,S.t)(m.name),isClickable:!0,iconName:(0,I.QX)(m,p,l),onClickStep:()=>(e=>{i(!0),s(e)})(m.ID)}),p<Object.keys(C.UT).length-1&&(0,o.jsx)(b,{active:p<l})]},m.ID):void 0})})};var P=s("../../../packages/platform/design-system/src/button/button.tsx");const E="step-control-button",D=({isLoading:e,loadingLabel:t,label:s})=>(0,o.jsx)(P.tA,{id:E,className:"w-100 mx-auto mb-4 flex min-w-56 items-center justify-center md:mb-6 md:w-auto",isLoading:e,loadingLabel:t,type:"submit",icon:(0,o.jsx)(r.HK,{}),iconPosition:"right","data-testid":"step-control-button",children:s}),M=e=>{const t=e[0];if(!O(t))return;const s=t.data;"string"==typeof s.key&&_(s.key)},_=e=>{const t=document.querySelector("#"+e);t&&w(t)},O=e=>void 0!==e&&"data"in e,w=e=>{const t=e.getBoundingClientRect(),s=window.scrollY+t.top;window.scrollTo({top:s-100,behavior:"smooth"})};var B=s("../../../packages/platform/design-system/src/typography/headline.tsx"),U=s("../../../packages/features/checkout/src/utils.ts"),R=s("../../../packages/platform/forms/src/use-form.ts"),G=s("../../../packages/platform/forms/src/form-country-combobox.tsx"),$=s("./lib/components/fx/Inputs/Text/ControlledInputText.tsx"),H=s("./lib/components/fx/Inputs/Text/Extensions/InputBadge.tsx"),z=s("./lib/components/fx/Inputs/Text/Extensions/InputExtensionCollection.tsx"),F=s("./lib/components/fx/Inputs/Text/Extensions/InputInfo.tsx");const V=()=>{const e="billingAddress",{configuration:t,formData:s,formValidationErrors:a,softValidationErrors:r,updateValue:i,validateValue:n,schema:l}=L(),c=s.billingAddress,d=t.initialStaticData.countryGroups,p=a[e]||{},m=r[e]||{},u=l.properties[e],h=(0,R.mN)({defaultValues:{countryCode:(()=>{for(const e of d){const t=e.options.find(e=>e.value===c.countryCode.toLowerCase());if(t)return t}})()}}),{control:g,setValue:x}=h,y=()=>{const e=!!u?.properties.euVatNumber,t="object"!=typeof c.company&&void 0!==c.company,s=null!==c.company&&""!==c.company;return!!(e&&t&&s)},f=t=>s=>{i(e,t,s.target.value)},N=t=>s=>{i(e,t,(0,U.yh)(s.target.value)),n(e,t,s.target.value)};return y()||c.euVatNumber&&(c.euVatNumber=""),y()&&""===(0,U.yh)(c.euVatNumber)&&(c.euVatNumber=void 0,m[C.py.BILLING.EU_VAT_NUM
1BER]=void 0),(0,o.jsxs)("div",{"data-testid":"billing-address-form",className:"mb-4 grid grid-cols-2 gap-x-4 lg:gap-x-6",children:[(0,o.jsx)("div",{className:"col-span-2",children:(0,o.jsx)($.a,{optional:!0,autoComplete:"billing organization",name:C.py.BILLING.COMPANY_NAME,maxLength:u?.properties.company.maxLength,placeholder:(0,S.t)("nc_general.form.firmaband"),value:c.company,errorMessages:p[C.py.BILLING.COMPANY_NAME],infoMessages:m[C.py.BILLING.COMPANY_NAME],onChange:f(C.py.BILLING.COMPANY_NAME),onBlur:N(C.py.BILLING.COMPANY_NAME)})}),y()&&(0,o.jsx)("div",{"data-testid":"vat-number",className:"col-span-2",children:(0,o.jsx)($.a,{optional:!1,errorMessages:p[C.py.BILLING.EU_VAT_NUMBER],infoMessages:m[C.py.BILLING.EU_VAT_NUMBER],placeholder:(0,S.t)("general.form.euvatnumber.short"),maxLength:u?.properties.euVatNumber?.maxLength,"data-tracking-name":"billing_vatnumber",value:c.euVatNumber,name:C.py.BILLING.EU_VAT_NUMBER,onChange:f(C.py.BILLING.EU_VAT_NUMBER),onBlur:N(C.py.BILLING.EU_VAT_NUMBER),children:(0,o.jsxs)(z.A,{children:[(0,o.jsx)(H.A,{label:(0,S.t)("general.form.optional")}),(0,o.jsx)(F.A,{children:(0,S.t)("general.form.euvatnumber.text")})]})})}),(0,o.jsx)("div",{className:"col-span-1",children:(0,o.jsx)($.a,{autoComplete:"billing given-name",maxLength:u?.properties.firstName.maxLength,placeholder:(0,S.t)("nc_general.form.vorname"),errorMessages:p[C.py.BILLING.FIRST_NAME],infoMessages:m[C.py.BILLING.FIRST_NAME],value:c.firstName,name:C.py.BILLING.FIRST_NAME,onChange:f(C.py.BILLING.FIRST_NAME),onBlur:N(C.py.BILLING.FIRST_NAME)})}),(0,o.jsx)("div",{className:"col-span-1",children:(0,o.jsx)($.a,{autoComplete:"billing family-name",maxLength:u?.properties.lastName.maxLength,placeholder:(0,S.t)("nc_general.form.nachname"),errorMessages:p[C.py.BILLING.LAST_NAME],infoMessages:m[C.py.BILLING.LAST_NAME],value:c.lastName,name:C.py.BILLING.LAST_NAME,onChange:f(C.py.BILLING.LAST_NAME),onBlur:N(C.py.BILLING.LAST_NAME)})}),(0,o.jsx)("div",{className:"col-span-2",children:(0,o.jsx)($.a,{autoComplete:"billing street-address",maxLength:u?.properties.street.maxLength,placeholder:(0,S.t)("general.form.streetandnumber"),errorMessages:p[C.py.BILLING.STREET],infoMessages:m[C.py.BILLING.STREET],value:c.street,name:C.py.BILLING.STREET,onChange:f(C.py.BILLING.STREET),onBlur:N(C.py.BILLING.STREET)})}),(0,o.jsx)("div",{className:"col-span-1",children:(0,o.jsx)($.a,{autoComplete:"billing postal-code",maxLength:u?.properties.zipCode.maxLength,placeholder:(0,S.t)("nc_general.form.plz"),errorMessages:p[C.py.BILLING.ZIP_CODE],infoMessages:m[C.py.BILLING.ZIP_CODE],value:c.zipCode,name:C.py.BILLING.ZIP_CODE,onChange:f(C.py.BILLING.ZIP_CODE),onBlur:N(C.py.BILLING.ZIP_CODE)})}),(0,o.jsx)("div",{className:"col-span-1",children:(0,o.jsx)($.a,{autoComplete:"billing address-level2",maxLength:u?.properties.city.maxLength,placeholder:(0,S.t)("nc_general.form.ort"),errorMessages:p[C.py.BILLING.CITY],infoMessages:m[C.py.BILLING.CITY],value:c.city,name:C.py.BILLING.CITY,onChange:f(C.py.BILLING.CITY),onBlur:N(C.py.BILLING.CITY)})}),(0,o.jsx)("div",{className:"col-span-2 mt-4",children:(0,o.jsx)(G.W,{"data-testid":"countryCode","data-tracking-name":"billing_country",name:C.py.BILLING.COUNTRY_CODE,label:(0,S.t)("general.checkout.country"),items:d,errors:(0,U.Cl)(p[C.py.BILLING.COUNTRY_CODE])??void 0,control:g,onSelect:t=>(t=>{p[C.py.BILLING.COUNTRY_CODE]=void 0,x(C.py.BILLING.COUNTRY_CODE,t),i(e,C.py.BILLING.COUNTRY_CODE,t.value.toUpperCase())})(t)})})]})},Y=(0,u.forwardRef)(({onSubmit:e,children:t,formId:s,...a},r)=>{const i=(0,u.useCallback)(t=>{t.preventDefault(),e()},[e]);return(0,o.jsx)("form",{...a,ref:r,"data-checkout2-form-id":s,onSubmit:i,children:t})});Y.displayName="FormWrapper";var K=s("./lib/components/fx/Inputs/PhoneNumber/index.tsx");const Z=()=>{const e="personalDetails",{configuration:t,formData:s,formValidationErrors:a,setFormValidationErrors:l,updateValue:c,setFormData:d,validateValue:p,schema:m,softValidationErrors:u}=L(),h=a[e]||{},g=u[e]||{},x=s[e],y=t.initialStaticData.phoneNumberCountries,f=m.properties[e],N=y.find(e=>e.value===x.phoneNumberCountry.toLowerCase())||y[0],b=t=>s=>{c(e,t,s.target.value)},j=f?.required?.includes("phoneNumber"),v=j&&"hauler"===t.availableShippingOptions.defaultOption?.key;return(0,o.jsxs)("div",{className:"mb-6 md:mb-8 lg:mb-10",children:[(0,o.jsx)($.a,{autoComplete:"email","data-testid":"email-input",optional:!f?.required?.includes("email"),maxLength:f?.properties.email.maxLength,name:C.py.CONTACT.EMAIL,placeholder:(0,S.t)("general.form.email"),value:x.email,errorMessages:h[C.py.CONTACT.EMAIL],infoMessages:g[C.py.CONTACT.EMAIL],onChange:b(C.py.CONTACT.EMAIL),onBlur:(k=C.py.CONTACT.EMAIL,t=>{c(e,k,(0,U.yh)(t.target.value)),p(e,k,t.target.value)})}),(j||v)&&(0,o.jsx)(i.w4,{className:"mt-8",icon:(0,o.jsx)(i.ZF,{children:(0,o.jsx)(r.X3,{})}),"data-testid":"phone-number-warning",children:(0,o.jsx)(n.mE,{html:v?(0,S.t)("general.checkout.contacts.phone.spedi"):(0,S.t)("general.checkout.contacts.phone.carrier")})}),(0,o.jsx)(K.g,{"data-testid":"phone-number-input",countrySelectName:C.py.CONTACT.PHONE_NUMBER_COUNTRY,countrySelectClassName:"border-r-0 rounded-r-none pe-1.5 md:pe-3 w-20 md:w-32 grow-0 shrink-0 mt-0",phoneNumberInputClassName:"mt-0",fieldWrapperClassName:"grow",inputName:C.py.CONTACT.PHONE_NUMBER,inputLabel:(0,S.t)("general.form.telephoneNumber"),phoneNumber:x.phoneNumber,errorMessages:h[C.py.CONTACT.PHONE_NUMBER],inputPlaceholder:(0,S.t)("nc_shoppingbasket.checkout.telephonnumber"),isMandatory:j,selectInputOptions:y,selectedOption:N,onCountryChange:t=>{l(t=>{const s={...t[e]};return delete s[C.py.CONTACT.PHONE_NUMBER],{...t,[e]:s}}),x.phoneNumberCountry=t.target.value,d({...s,personalDetails:x})},onInputChange:b(C.py.CONTACT.PHONE_NUMBER)})]});var k};var J=s("../../../packages/platform/avo-tracking/src/init-avo.ts"),q=s("../../../packages/platform/design-system/src/card/card.tsx"),W=s("../../../node_modules/debounce/index.js"),Q=s("../../../packages/platform/design-system/src/forms/merge-refs.ts"),
1X=s("../../../packages/platform/design-system/src/forms/inputs/text-input.tsx");const ee=({value:e,onChange:t,clearInputButtonLabel:s,searchButtonLabel:a,onSubmit:i,isDisabled:n,ref:l,...c})=>{const d=(0,u.useRef)(null);return(0,o.jsx)(X.ks,{ref:(0,Q.P)([d,l]),className:"!pr-20",value:e,type:"search",isDisabled:n,trailing:(0,o.jsxs)(o.Fragment,{children:[e&&(0,o.jsx)(X.ZK,{label:s,isDisabled:n,onClick:e=>{t("",e),d.current?.focus()},children:(0,o.jsx)(r.US,{className:"pointer-events-none"})}),(0,o.jsx)(X.ZK,{label:a,isDisabled:n,onClick:i,children:(0,o.jsx)(r.WI,{className:"pointer-events-none"})})]}),onChange:e=>{t(e.target.value,e)},...c})},te=({defaultValue:e="",onDebounceChange:t,debounceDelay:s=200,...a})=>{const[r,i]=(0,u.useState)(e),n=(0,u.useRef)(t);(0,u.useEffect)(()=>{n.current=t},[t]);const l=(0,u.useMemo)(()=>(0,W.A)(e=>{n.current(e)},s),[s]);return(0,u.useEffect)(()=>()=>{l.clear()},[l]),(0,o.jsx)(ee,{value:r,onChange:e=>{i(e),l(e)},...a})};var se=s("../../../packages/platform/design-system/src/tabs/tabs.tsx"),ae=s("../../../packages/platform/fetch/src/use-fetch.ts"),re=s("../../../packages/platform/design-system/src/info-box/info-box-condensed.tsx");const ie=({title:e,text:t,imageServerUrl:s,button:a})=>(0,o.jsxs)("div",{className:"relative size-full",children:[(0,o.jsx)("img",{alt:"",className:"absolute inset-0 size-full object-cover",src:`${s}/pics/images/checkout2/pulf/map-placeholder.png`}),(0,o.jsx)("div",{className:"relative flex size-full items-center justify-center p-4",children:(0,o.jsxs)(re.Pu,{className:"max-w-96",icon:(0,o.jsx)(i.ZF,{children:(0,o.jsx)(r.ee,{})}),title:e,children:[(0,o.jsx)(n.EY,{children:t}),a]})})]});var ne=s("../../../packages/platform/design-system/src/disclosure/disclosure.tsx"),oe=s("../../../packages/platform/design-system/src/tag/tag.tsx");const le=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],ce=e=>`${e.hours.toString().padStart(2,"0")}:${e.minutes.toString().padStart(2,"0")}`,de=e=>`${ce(e.from)} - ${ce(e.to)}`,pe=({openingHours:e,labels:t})=>(0,o.jsx)("table",{className:"w-full border-separate border-spacing-y-1.5 px-8 [&_td:nth-child(2)]:text-right",children:(0,o.jsx)("tbody",{children:le.map(s=>{const a=e[s];return 0===a.length?(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{children:(0,o.jsx)(n.Uf,{size:"2",children:t[s]})}),(0,o.jsx)("td",{children:(0,o.jsx)(n.Uf,{size:"2",children:t.closed})})]},s):(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{children:(0,o.jsx)(n.m$,{size:"2",children:t[s]})}),(0,o.jsx)("td",{children:a.map(e=>(0,o.jsx)(n.m$,{size:"2",children:de(e)},`${e.from.hours.toString()}:${e.from.minutes.toString()}`))})]},s)})})}),me="PARCEL_LOCKER",ue=({location:e,isSelected:t,onSelect:s,openingHours:a,kilometersLabel:i,openingHoursLabel:l,noOpeningHoursText:c,weekdayLabels:d,selectOption:p,selectedOption:m,hideSelectButton:h})=>{const[g,x]=(0,u.useState)(!1),{id:y,name:f,type:b,addressLine:j,postalCode:v,city:k,distance:C}=e;return(0,o.jsxs)("div",{className:(0,N.$)("relative flex flex-col gap-2 rounded-lg bg-default-default p-4 shadow-100 transition-shadow","border border-default-default after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:border-4 after:transition-colors",t?"after:border-brand-default":"after:border-basic-transparent"),children:[(0,o.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,o.jsxs)("div",{className:"flex gap-2",children:[b===me&&(0,o.jsx)(r.y$,{className:"size-6 shrink-0"}),b!==me&&(0,o.jsx)(r.L$,{className:"size-6 shrink-0"}),(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)(B.$j,{level:"4",visualLevel:"6","data-testid":"pulf-location-name",children:f}),(0,o.jsxs)(n.EY,{size:"base",children:[j,(0,o.jsx)("br",{}),v," ",k]})]})]}),(0,o.jsx)(oe.vw,{className:"shrink-0",label:(I=C,(I/1e3).toFixed(1)+" "+i)})]}),(0,o.jsx)(ne.E,{isOpen:g,trigger:(0,o.jsx)(P.a6,{className:"self-start",icon:(0,o.jsx)(r.ZL,{className:"size-4"}),children:l}),content:a?(0,o.jsx)(pe,{labels:d,openingHours:a}):(0,o.jsx)(n.I,{children:c}),onIsOpenChange:x}),!h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(P.JD,{size:"small",className:"hidden self-center md:block md:self-end","data-testid":"pulf-location-select",icon:t?(0,o.jsx)(r.Sr,{}):(0,o.jsx)(r.Vp,{}),iconPosition:"left",onClick:()=>{s(y)},children:t?m:p}),(0,o.jsx)(P.tA,{size:"small",className:"self-center md:hidden","data-testid":"pulf-location-select-mobile",icon:t?(0,o.jsx)(r.Sr,{}):void 0,iconPosition:"left",onClick:()=>{s(y)},children:t?m:p})]})]});var I},he=({locations:e,hasSearched:t,isSearching:s,isZipCodeInvalid:a,error:r,selectedLocationId:i,onSelectLocation:l,onReg
1isterLocationCardElement:c,onContinueWithHomeDelivery:d,labels:p})=>s?(0,o.jsx)(re.Pu,{className:"mx-auto max-w-96",title:p.loadingTitle,children:(0,o.jsx)(n.EY,{children:p.loadingText})}):a?(0,o.jsx)(re.Pu,{className:"mx-auto max-w-96",title:p.invalidZipCodeTitle,children:(0,o.jsx)(n.EY,{children:p.invalidZipCodeText})}):r?(0,o.jsxs)(re.Pu,{className:"mx-auto max-w-96",title:p.errorStateTitle,children:[(0,o.jsx)(n.EY,{children:p.errorStateText}),(0,o.jsx)(P.tA,{onClick:()=>{d()},children:p.errorStateButtonLabel})]}):t?0===e.length?(0,o.jsx)(re.Pu,{className:"mx-auto max-w-96",title:p.noResultsTitle,children:(0,o.jsx)(n.EY,{children:p.noResultsText})}):(0,o.jsx)(o.Fragment,{children:e.map(e=>(0,o.jsx)("div",{ref:t=>{c(e.id,t)},"data-testid":"pulf-location",className:"w-full lg:max-w-96",children:(0,o.jsx)(ue,{location:e,isSelected:i===e.id,kilometersLabel:p.kilometers,noOpeningHoursText:p.noOpeningHoursText,openingHours:e.openingHours,openingHoursLabel:p.openingHours,selectOption:p.selectOption,selectedOption:p.selectedOption,weekdayLabels:p.weekdayLabels,onSelect:l})},e.id))}):(0,o.jsx)(re.Pu,{className:"mx-auto max-w-96",title:p.emptyStateTitle,children:(0,o.jsx)(n.EY,{children:p.emptyStateText})});var ge=s("../../../node_modules/@vis.gl/react-google-maps/dist/index.modern.mjs"),xe=s("../../../node_modules/@vis.gl/react-google-maps/dist/chunks/use-map-3d-BOXDWF5P.mjs");const ye=({isSelected:e})=>(0,o.jsxs)("svg",{width:"35",height:"43",viewBox:"0 0 35 43",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("circle",{cx:"17.1162",cy:"17.4492",r:"15",fill:"white"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1167 40.95C16.0067 42.5533 16.0056 42.5525 16.0056 42.5525L16.0002 42.5487L15.9881 42.5403L15.9478 42.512C15.9139 42.488 15.8659 42.4538 15.8049 42.4098C15.6829 42.3217 15.5084 42.1938 15.2891 42.0281C14.8507 41.6966 14.2316 41.2128 13.4921 40.5911C12.0158 39.35 10.0449 37.5476 8.06888 35.3001C4.16623 30.8614 0 24.4097 0 16.95C0 7.56852 7.68376 0 17.1167 0C26.5496 0 34.2333 7.56852 34.2333 16.95C34.2333 24.4097 30.0671 30.8614 26.1644 35.3001C24.1884 37.5476 22.2175 39.35 20.7413 40.5911C20.0017 41.2128 19.3827 41.6966 18.9442 42.0281C18.7249 42.1938 18.5505 42.3217 18.4284 42.4098C18.3674 42.4538 18.3195 42.488 18.2855 42.512L18.2452 42.5403L18.2332 42.5487L18.2292 42.5515C18.2292 42.5515 18.2266 42.5533 17.1167 40.95ZM17.1167 40.95L18.2266 42.5533C17.5589 43.0156 16.6734 43.0148 16.0056 42.5525L17.1167 40.95ZM17.1167 3.17716C9.31565 3.17716 3.11712 9.41236 3.11712 16.95C3.11712 24.4876 9.31565 30.7228 17.1167 30.7228C24.9177 30.7228 31.1162 24.4876 31.1162 16.95C31.1162 9.41236 24.9177 3.17716 17.1167 3.17716Z",fill:e?"#7E00F3":"#111827"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7504 9.11801C11.8927 8.95844 12.0963 8.86719 12.3101 8.86719H21.9223C22.1361 8.86719 22.3397 8.95844 22.482 9.11801L25.176 12.1388C25.2985 12.2762 25.3662 12.4539 25.3662 12.638V22.0415C25.3662 22.4557 25.0304 22.7915 24.6162 22.7915H21.1561C21.1538 22.7915 21.1515 22.7915 21.1492 22.7915H13.0456C13.0433 22.7915 13.0409 22.7915 13.0386 22.7915H9.61621C9.202 22.7915 8.86621 22.4557 8.86621 22.0415V12.638C8.86621 12.4539 8.93393 12.2762 9.05646 12.1388L11.7504 9.11801ZM16.3474 21.2915H13.7956V17.4077H16.3474L16.3474 21.2915ZM20.3992 21.2915H17.8474L17.8474 17.4077H20.3992V21.2915ZM21.8992 21.2915V16.6577C21.8992 16.2434 21.5634 15.9077 21.1492 15.9077H13.0456C12.6314 15.9077 12.2956 16.2434 12.2956 16.6577V21.2915H10.3662V13.388H23.8662V21.2915H21.8992ZM22.9424 11.888H11.29L12.6462 10.3672H21.5862L22.9424 11.888Z",fill:e?"#7E00F3":"#111827"})]}),fe=({isSelected:e})=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"35",height:"43",fill:"none",viewBox:"0 0 35 43",children:[(0,o.jsx)("circle",{cx:"17.116",cy:"17.449",r:"15",fill:"#fff"}),(0,o.jsx)("path",{fill:e?"#7E00F3":"#111827",d:"M23.635 10.45c1.05 0 1.815.88 1.815 1.857v10.285c0 .977-.766 1.857-1.815 1.857H10.598c-1.05 0-1.815-.88-1.815-1.857V12.307c0-.978.765-1.858 1.815-1.858zm-12.852 12h2.889v-10h-2.889zm4.889 0h2.889v-10h-2.89zm4.888 0h2.89v-10h-2.89z"}),(0,o.jsx)("path",{fill:e?"#7E00F3":"#111827",d:"M17.117 40.95c-1.11 1.603-1.111 1.602-1.111 1.602L16 42.55l-.012-.009-.04-.028-.143-.102a30 30 0 0 1-.516-.382 45 45 0 0 1-1.797-1.437 51 51 0 0 1-5.423-5.29C4.166 30.86 0 24.41 0 16.95 0 7.569 7.684 0 17.117 0s17.116 7.569 17.116 16.95c0 7.46-4.166 13.911-8.069 18.35a51 51 0 0 1-5.423 5.291 45 45 0 0 1-1.797 1.437 30 30 0 0 1-.659.484l-.04.028-.012.009-.004.002s-.002.002-1.112-1.601m0 0 1.11 1.603a1.95 1.95 0 0 1-2.221 0zm0-37.773c-7.801 0-14 6.235-14 13.773s6.199 13.773 14 13.773c7.8 0 14-6.235 14-13.773s-6.2-13.773-14-13.773"})]}),Ne={lat:49.801825,lng:10.731804},be=.01,je=e=>{const t=e.map(e=>e.latitude),s=e.map(e=>e.longitude);return{north:Math.max(...t)+be,south:Math.min(...t)-be,east:Math.max(...s)+be,west:Math.min(...s)-be}},ve=({locations:e,selectedLocationId:t})=>{const s=(0,ge.ko)();return(0,u.useEffect)(()=>{const a=e.find(e=>e.id===t);s&&a&&(s.setZoom(14),s.panTo({lat:a.latitude,lng:a.longitude}))},[s,e,t]),null},ke=({locations:e})=>{const t=(0,ge.ko)();return(0,u.useEffect)(()=>
1{if(!t||0===e.length)return;const s=new google.maps.LatLngBounds;for(const t of e)s.extend({lat:t.latitude,lng:t.longitude});t.setOptions({restriction:null}),t.fitBounds(s,48),t.setOptions({restriction:{latLngBounds:je(e)}})},[t,e]),null},Ce=({mapId:e,locations:t,selectedLocationId:s,onSelectLocation:a})=>(0,o.jsxs)(ge.T5,{disableDefaultUI:!0,defaultCenter:Ne,defaultZoom:14,mapId:e,maxZoom:16,children:[(0,o.jsx)(ke,{locations:t}),(0,o.jsx)(ve,{locations:t,selectedLocationId:s}),t.map(e=>(0,o.jsxs)(ge.J8,{position:{lat:e.latitude,lng:e.longitude},onClick:()=>{a(e.id)},children:["PARCEL_LOCKER"===e.type&&(0,o.jsx)(fe,{isSelected:s===e.id}),"PARCEL_LOCKER"!==e.type&&(0,o.jsx)(ye,{isSelected:s===e.id})]},e.id))]}),Ie=({labels:e,imageServerUrl:t,onRetry:s,children:a})=>{const r=(0,xe.l)();return r===xe.m.FAILED||r===xe.m.AUTH_FAILURE?(0,o.jsx)(ie,{button:(0,o.jsx)(P.tA,{onClick:s,children:e.errorButtonLabel}),imageServerUrl:t,text:e.errorText,title:e.errorTitle}):r!==xe.m.LOADED?(0,o.jsx)(ie,{imageServerUrl:t,text:e.loadingText,title:e.loadingTitle}):a},Se=({apiKey:e,mapId:t,imageServerUrl:s,locations:a,selectedLocationId:r,onSelectLocation:i,labels:n})=>{const[l,c]=(0,u.useState)(0);return(0,o.jsx)(xe.t,{apiKey:e,children:(0,o.jsx)(Ie,{imageServerUrl:s,labels:n,onRetry:()=>{c(e=>e+1)},children:(0,o.jsx)(Ce,{locations:a,mapId:t,selectedLocationId:r,onSelectLocation:i})})},l)},Te=({apiKey:e,mapId:t,csrfToken:s,finderState:a,imageServerUrl:r,isGoogleMapsConsentGiven:i,setIsGoogleMapsConsentGiven:n,onLocationSelected:l,onContinueWithHomeDelivery:c,errorMessage:d,labels:p})=>{const{zipCode:h,prefillCount:g,isZipCodeInvalid:x,hasSearched:y,isSearching:f,locations:b,searchError:j,selectedLocationId:v,searchByZipCode:k,clearSearch:C,selectLocationId:I}=a,[S,T]=(0,u.useState)("list"),L=(0,u.useRef)({}),A=b.find(e=>e.id===v),E=h?void 0:d,D=h?d:void 0,M=e=>{I(e);const t=b.find(t=>t.id===e);t&&l(t)},{trigger:_,error:O}=(0,ae.n_)("checkout2_googleMapsConsentAjax.html"),w=async()=>{try{await _({csrfToken:s}),n(!0)}catch{}};let U;return(0,u.useEffect)(()=>{v&&L.current[v]?.scrollIntoView({behavior:"smooth",block:"nearest"})},[v]),U=i?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Se,{apiKey:e,imageServerUrl:r,labels:{loadingTitle:p.mapLoadingTitle,loadingText:p.mapLoadingText,errorTitle:p.mapErrorTitle,errorText:p.mapErrorText,errorButtonLabel:p.mapErrorButtonLabel},locations:b,mapId:t,selectedLocationId:v,onSelectLocation:M}),f&&(0,o.jsx)("div",{className:"absolute inset-0",children:(0,o.jsx)(ie,{imageServerUrl:r,text:p.mapLoadingText,title:p.mapLoadingTitle})}),A&&(0,o.jsx)("div",{className:"absolute inset-x-4 bottom-4 lg:hidden",children:(0,o.jsx)(ue,{isSelected:!1,kilometersLabel:p.kilometers,location:A,noOpeningHoursText:p.noOpeningHoursText,openingHours:A.openingHours,openingHoursLabel:p.openingHours,selectOption:p.selectOption,selectedOption:p.selectedOption,weekdayLabels:p.weekdayLabels,hideSelectButton:!0,onSelect:M})})]}):O?(0,o.jsx)(ie,{button:(0,o.jsx)(P.tA,{onClick:()=>{w()},children:p.mapErrorButtonLabel}),imageServerUrl:r,text:p.mapErrorText,title:p.mapErrorTitle}):(0,o.jsx)(ie,{button:(0,o.jsx)(P.tA,{onClick:()=>{w()},children:p.mapConsentButtonLabel}),imageServerUrl:r,text:p.mapConsentText,title:p.mapConsentTitle}),(0,o.jsxs)("div",{children:[(0,o.jsx)(B.$j,{level:"3",visualLevel:"5",className:"mb-4",id:"pulf-search-heading",children:p.searchHeading}),(0,o.jsxs)(se.iA,{className:"mt-2 gap-2 lg:flex-row",value:S,onValueChange:e=>{T("map"===e?"map":"list")},children:[(0,o.jsxs)("div",{className:"flex flex-col gap-2 lg:w-96 lg:shrink-0",children:[(0,o.jsx)(te,{className:"w-full","data-testid":"pulf-zip-code-search",clearInputButtonLabel:p.searchClearButton,defaultValue:h,helperText:E,isInvalid:Boolean(E),label:p.searchLabel,searchButtonLabel:p.searchStartButton,onDebounceChange:e=>{e?k(e):C()},onSubmit:()=>{k(h)},onKeyDown:e=>{"Enter"===e.key&&e.preventDefault()}},g),(0,o.jsxs)(se.wb,{"aria-labelledby":"pulf-search-heading",className:"mb-6 lg:hidden",children:[(0,o.jsx)(se.yC,{label:p.listTabLabel,value:"list"}),(0,o.jsx)(se.yC,{label:p.mapTabLabel,value:"map"})]}),(0,o.jsxs)(se.JS,{forceMount:!0,className:(0,N.$)("flex-col gap-2 overflow-auto lg:flex lg:h-[600px]","list"===S?"flex":"hidden"),value:"list",children:[D&&(0,o.jsx)(m.Mu,{text:D}),(0,o.jsx)(he,{error:j,hasSearched:y,isSearching:f,isZipCodeInvalid:x,locations:b,selectedLocationId:v,labels:{kilometers:p.kilometers,openingHours:p.openingHours,noOpeningHoursText:p.noOpeningHoursText,weekdayLabels:p.weekdayLabels,selectOption:p.selectOption,selectedOption:p.selectedOption,loadingTitle:p.listLoadingTitle,loadingText:p.mapLoadingText,emptyStateTitle:p.emptyStateTitle,emptyStateText:p.emptyStateText,noResultsTitle:p.noResultsTitle,noResultsText:p.noResultsText,errorStateTitle:p.errorStateTitle,errorStateText:p.errorStateText,errorStateButtonLabel:p.errorStateButtonLabel,invali
1dZipCodeTitle:p.invalidZipCodeTitle,invalidZipCodeText:p.invalidZipCodeText},onContinueWithHomeDelivery:c,onRegisterLocationCardElement:(e,t)=>{L.current[e]=t},onSelectLocation:M})]})]}),(0,o.jsx)(se.JS,{forceMount:!0,className:(0,N.$)("relative h-[400px] lg:h-auto lg:min-w-[400px] lg:flex-1","map"===S?"block":"hidden","lg:block"),value:"map",children:(0,o.jsx)(q.N,{className:"size-full p-4",children:U})})]})]})},Le=({parts:e=[]})=>{const t=e.filter(e=>!(!e||!e.trim()));return t.length>0?(0,o.jsxs)("span",{className:"break-words",children:[t.join(" "),(0,o.jsx)("br",{})]}):null},Ae=({address:e,isSelected:t,determineCountryName:s,selectAddress:a})=>(0,o.jsxs)(q.Ih,{className:(0,N.$)("relative my-2 flex flex-col items-center gap-2 p-4 shadow-100 transition-shadow after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:border-2 after:transition-colors md:flex-row md:justify-between",t?"after:border-brand-default":"after:border-basic-transparent"),children:[(0,o.jsxs)("div",{children:["packstation"===e.type?(0,o.jsx)(Le,{parts:[`${(0,S.t)("nc_general.form.zusatz.postnumber")} ${e.packstationPostNumber}`]}):(0,o.jsx)(Le,{parts:[e.companyName??""]}),(0,o.jsx)(Le,{parts:[e.firstName??"",e.lastName??""]}),"packstation"===e.type?(0,o.jsx)(Le,{parts:[`${(0,S.t)("general.mythomann.addressbook.packstation")} ${e.packstationNumber}`]}):(0,o.jsx)(Le,{parts:[e.addressLine1??""]}),(0,o.jsx)(Le,{parts:[e.postalCode??"",e.city??""]}),(0,o.jsx)(Le,{parts:[s(e.countryIso2||e.countryCode||"")]})]}),t?(0,o.jsx)(P.JD,{className:"w-full md:w-auto",icon:(0,o.jsx)(r.Sr,{}),iconPosition:"left",onClick:()=>{a(e)},children:(0,S.t)("general.checkout.pulf.selected")}):(0,o.jsx)(P.JD,{className:"w-full md:w-auto",onClick:()=>{a(e)},children:(0,S.t)("nc_shoppingbasket.addressbook.useAddress.short")})]}),Pe=({containerHeight:e,addresses:t,selectedAddressId:s,determineCountryName:a,selectAddress:r})=>(0,o.jsx)("div",{className:"pt-6",style:e?{height:e}:{},children:(0,o.jsx)("div",{className:"h-full max-h-96 overflow-y-auto overflow-x-hidden [-webkit-mask-image:linear-gradient(to_bottom,black_calc(100%-2rem),transparent_100%)] [mask-image:linear-gradient(to_bottom,black_calc(100%-2rem),transparent_100%)]",children:t.map(e=>(0,o.jsx)(Ae,{address:e,isSelected:s===e.id,determineCountryName:a,selectAddress:e=>{r(e)}},e.id))})}),Ee=({containerHeight:e,setContainerHeight:t})=>{const s=(0,u.useRef)(void 0);(0,u.useEffect)(()=>{void 0===e&&s?.current&&t(s.current.offsetHeight)},[s,e,t]);const a="shippingAddress",{configuration:r,formData:i,formValidationErrors:n,softValidationErrors:l,updateValue:c,validateValue:d,schema:p}=L(),m=r.initialStaticData.countryGroups,h=i[a]||{id:"",firstName:"",lastName:"",city:"",countryCode:i.billingAddress.countryCode,street:"",zipCode:"",company:"",addressType:"postal",packstationPostNumber:"",packstationNumber:""},g=(0,R.mN)({defaultValues:{countryCode:(()=>{for(const e of m){const t=e.options.find(e=>e.value===h.countryCode?.toLowerCase());if(t)return t}})()}}),{control:x,setValue:y}=g,f=p.properties[a],N=n[a]||{},b=l[a]||{},j=e=>t=>{c(a,e,t.target.value)},v=e=>t=>{c(a,e,(0,U.yh)(t.target.value)),d(a,e,t.target.value)};return(0,o.jsxs)("div",{ref:s,className:"grid grid-cols-2 gap-x-4 lg:gap-x-6",children:[(0,o.jsx)("div",{className:"col-span-2",children:(0,o.jsx)($.a,{"data-testid":"shipping-address-company",className:"mt-0",optional:!0,autoComplete:"shipping organization",maxLength:f?.properties.company.maxLength,name:C.py.SHIPPING.COMPANY_NAME,placeholder:(0,S.t)("nc_general.form.firmaband.checkout2"),value:h.company,errorMessages:N.company,infoMessages:b.company,onChange:j(C.py.SHIPPING.COMPANY_NAME),onBlur:v(C.py.SHIPPING.COMPANY_NAME)})}),(0,o.jsx)("div",{className:"col-span-1",children:(0,o.jsx)($.a,{"data-testid":"shipping-address-first-name",autoComplete:"shipping given-name",maxLength:f?.properties.firstName.maxLength,name:C.py.SHIPPING.FIRST_NAME,placeholder:(0,S.t)("nc_general.form.vorname"),value:h.firstName,errorMessages:N.firstName,infoMessages:b.firstName,onChange:j(C.py.SHIPPING.FIRST_NAME),onBlur:v(C.py.SHIPPING.FIRST_NAME)})}),(0,o.jsx)("div",{className:"col-span-1",children:(0,o.jsx)($.a,{"data-testid":"shipping-address-last-name",autoComplete:"shipping family-name",maxLength:f?.properties.lastName.maxLength,name:C.py.SHIPPING.LAST_NAME,placeholder:(0,S.t)("nc_general.form.nachname"),value:h.lastName,errorMessages:N.lastName,infoMessages:b.lastName,onChange:j(C.py.SH
1IPPING.LAST_NAME),onBlur:v(C.py.SHIPPING.LAST_NAME)})}),(0,o.jsx)("div",{className:"col-span-2",children:(0,o.jsx)($.a,{"data-testid":"shipping-address-street",autoComplete:"shipping street-address",maxLength:f?.properties.street.maxLength,name:C.py.SHIPPING.STREET,placeholder:(0,S.t)("general.form.streetandnumber"),value:h.street,errorMessages:N.street,infoMessages:b.street,onChange:j(C.py.SHIPPING.STREET),onBlur:v(C.py.SHIPPING.STREET)})}),(0,o.jsx)("div",{className:"col-span-1",children:(0,o.jsx)($.a,{"data-testid":"shipping-address-postal-code",autoComplete:"shipping postal-code",maxLength:f?.properties.zipCode.maxLength,name:C.py.SHIPPING.ZIP_CODE,placeholder:(0,S.t)("nc_general.form.plz"),value:h.zipCode,errorMessages:N.zipCode,infoMessages:b.zipCode,onChange:j(C.py.SHIPPING.ZIP_CODE),onBlur:v(C.py.SHIPPING.ZIP_CODE)})}),(0,o.jsx)("div",{className:"col-span-1",children:(0,o.jsx)($.a,{"data-testid":"shipping-address-city",autoComplete:"shipping address-level2",maxLength:f?.properties.city.maxLength,name:C.py.SHIPPING.CITY,placeholder:(0,S.t)("nc_general.form.ort"),value:h.city,errorMessages:N.city,infoMessages:b.city,onChange:j(C.py.SHIPPING.CITY),onBlur:v(C.py.SHIPPING.CITY)})}),(0,o.jsx)("div",{className:"col-span-2 mt-4",children:(0,o.jsx)(G.W,{"data-testid":"countryCode","data-tracking-name":"shipping_country",name:C.py.SHIPPING.COUNTRY_CODE,label:(0,S.t)("general.checkout.country"),items:m,errors:(0,U.Cl)(N[C.py.SHIPPING.COUNTRY_CODE])??void 0,control:x,onSelect:e=>(e=>{N[C.py.SHIPPING.COUNTRY_CODE]=void 0,y(C.py.SHIPPING.COUNTRY_CODE,e),c(a,C.py.SHIPPING.COUNTRY_CODE,e.value.toUpperCase())})(e)})})]})};var De=s("../../../node_modules/dhl-packstation-validator/src/Postnummer.js"),Me=s("./lib/components/fx/Inputs/Text/ControlledInputSearch.tsx");const _e=({address:e,selectPackstation:t})=>(0,o.jsxs)("div",{"data-testid":"packstation-result",className:"cursor-pointer",onClick:()=>{t(e)},children:[(0,o.jsxs)(n.EY,{className:"mt-1 font-bold",children:[(0,S.t)("nc_general.form.zusatz.packstationNumber")," ",e.packstationNumber]}),(0,o.jsxs)(n.EY,{className:"mb-2",children:[e.packstationNumber,", ",e.zip," ",e.city]}),(0,o.jsx)("hr",{})]},e.packstationNumber);var Oe=s("./checkout2/data/form.ts"),we=(s("../../../node_modules/core-js/modules/es.iterator.for-each.js"),s("../../../node_modules/core-js/modules/es.iterator.reduce.js"),s("./lib/AppFactory.ts")),Be=s("../../../node_modules/json-schema-library/dist/index.mjs");const Ue=(e,t)=>(0,we.S)().getLanguageResources().resolve(e,t),Re=e=>{const t=("string"==typeof e.key&&e.key?e.key:e.pointer||"").replace(/#/g,"").split("/").filter(e=>!!e);return t?.[t.length-1]||""},Ge=(e,t,s)=>{const a=Re(e);return{type:"error",code:`${t}`,name:`${t}-${a}`,path:`${a}`,message:Ue(s),data:e}},$e=(e,t,s)=>{const a=((e,t,s)=>(0,Be.Fc)(e,{drafts:[(0,Be.a4)(Be.pQ,{errors:t,...s?{formats:s}:{}})]}))(e,(r=t,i=Be.pQ.errors,Object.keys(i).reduce((e,t)=>{const s=C.Z9[t]?e=>{const s=Re(e),a=r?.[s]?.[C.Z9[t]]||r?.[s]?.default||r.default;return Ge(e,t,a)}:((e,t)=>s=>Ge(s,e,t))(t,r.default);return{...e,[t]:s}},{})),s);var r,i;return{validateForm:e=>{try{return a.validate((0,Oe.Xm)(e)).errors}catch(e){}}}},He=e=>e.replace(/#/g,""),ze=e=>{let t=He(e.pointer||"");return""===t&&(t=He("string"==typeof e.key?e.key:"")),Fe(t)},Fe=e=>{const t=e.split("/").filter(e=>!!e);return t?.[0]||""},Ve=(e,t,s,a=void 0,r=!1)=>{const i=(0,I.pN)(t);return r&&Object.keys(i.properties).forEach(e=>{Object.prototype.hasOwnProperty.call(i,e)&&(i.properties[e].required=[])}),Ye($e(i,s).validateForm(e),a)},Ye=(e,t)=>t?e.filter(e=>{const s=ze(e.data);return t.includes(s)}):e,Ke=(e,t,s)=>{const a={};return t.forEach(t=>{const r=Re(t.data),i=t.type,n=s[e],o="string"==typeof t.code?C.Z9[t.code]:void 0;if(n&&n[r]){const e=n[r][i]||n[r][o]||n[r].default||void 0;a[r]=e?Ue(e):t.message}else a[r]=t.message}),a},Ze=e=>"pickup"===e?.addressType&&!De.A.isValid(e?.pickupPostNumber),Je=(e,t)=>"pickup"===e?.addressType&&(!e?.pickupStationId||e.pickupStationId!==t),qe=[C.py.SHIPPING.FIRST_NAME,C.py.SHIPPING.LAST_NAME,C.py.SHIPPING.PICKUP_POST_NUMBER].map(e=>`shippingAddress/${e}`);var We=s("./lib/legacyAjax.ts");const Qe="Finder",Xe="ManualInput",et=({containerHeight:e})=>{const[t,s]=(0,u.useState)(Xe),[r,i]=(0,u.useState)(""),[n,l]=(0,u.useState)(""),[c,d]=(0,u.useState)(!1),[p,m]=(0,u.useState)([]),h="shippingAddress",{formData:g,setFormData:x,formValidationErrors:y,setFormValidationErrors:f,softValidationErrors:N,setSoftValidationErrors:b,schema:j,validateValue:v,updateValue:k,configuration:I,showValidationErrorMessages:T}=L(),A=(()=>
1{if(!g.useDedicatedShippingAddress)return!1;const e=y.shippingAddress;return!!e&&!!(e.packstationPostNumber||e.packstationNumber||e.city||e.zipCode)})(),P=g.shippingAddress??{},E={addressType:P.addressType,firstName:P.firstName??g.billingAddress.firstName,lastName:P.lastName??g.billingAddress.lastName,company:P.company,street:P.street,postalCode:P.zipCode,city:P.city,countryCode:"DE",packstationNumber:P.packstationNumber,packstationPostNumber:P.packstationPostNumber},D=(0,u.useCallback)((e,a=!1)=>{e!==t&&(a||(f({}),b({})),s(e))},[t,f,b]);(0,u.useEffect)(()=>{t===Qe&&A&&D(Xe,!0)},[A,t,D]);const M=(0,u.useCallback)((0,W.A)(e=>{d(!0),(0,We.Ls)("checkout2_packstationLookup.html",{zip:"",city:e},e=>{Array.isArray(e)&&m(e),d(!1)},()=>{m([]),d(!1)})},300),[p]),_=e=>{const t=e.target.value;i(t),t&&t.length>1?M(t):m([])},O=e=>{const t={...g.shippingAddress,addressType:"packstation",zipCode:e.zip,city:e.city,countryCode:e.countryCode,firstName:E.firstName,lastName:E.lastName,packstationNumber:e.packstationNumber};w(t),D(Xe),T(Ve(t,I.schema.properties.shippingAddress,I.initialStaticData.validationConfig,["shippingAddress"]))},w=e=>{const t={...g.shippingAddress,...e};x({...g,shippingAddress:t})};(0,u.useEffect)(()=>{w(E)},[]);const B=j.properties[h],R=y[h]||{},G=N[h]||{};let H;(0,Oe.Im)(R.packstationNumber)||(H=n.trim()?[(0,S.t)("general.validation.packstation.number.invalid")]:[(0,S.t)("nc_shoppingbasket.checkout.packstationNumber.fail")]);const z=E.packstationPostNumber&&E.packstationPostNumber.length>0;let F;z&&!De.A.isValid(E.packstationPostNumber)?F=[(0,S.t)("nc_shoppingbasket.checkout.packstation.validierung")]:!z&&R?.packstationPostNumber&&(F=R?.packstationPostNumber);const V=e=>t=>{k(h,e,t.target.value)},Y=e=>t=>{k(h,e,(0,U.yh)(t.target.value)),v(h,e,t.target.value)};return(0,o.jsxs)("div",{className:"pt-6",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 pb-8 lg:gap-x-6",children:[(0,o.jsx)($.a,{"data-testid":"packstation-first-name",className:"mt-0",name:C.py.SHIPPING.FIRST_NAME,placeholder:(0,S.t)("nc_general.form.vorname"),value:E.firstName,errorMessages:R.firstName,infoMessages:G.firstName,onChange:V(C.py.SHIPPING.FIRST_NAME),onBlur:Y(C.py.SHIPPING.FIRST_NAME)}),(0,o.jsx)($.a,{"data-testid":"packstation-last-name",className:"mt-0",name:C.py.SHIPPING.LAST_NAME,placeholder:(0,S.t)("nc_general.form.nachname"),value:E.lastName,errorMessages:R.lastName,infoMessages:G.lastName,onChange:V(C.py.SHIPPING.LAST_NAME),onBlur:Y(C.py.SHIPPING.LAST_NAME)}),(0,o.jsx)($.a,{"data-testid":"packstation-post-number",className:"col-span-2",placeholder:(0,S.t)("nc_general.form.zusatz.postnumber"),value:E.packstationPostNumber,name:C.py.SHIPPING.PACKSTATION_POST_NUMBER,errorMessages:F,onChange:V(C.py.SHIPPING.PACKSTATION_POST_NUMBER),onBlur:Y(C.py.SHIPPING.PACKSTATION_POST_NUMBER)})]}),(0,o.jsxs)(se.iA,{value:t,defaultValue:Xe,onValueChange:s,children:[(0,o.jsxs)(se.wb,{children:[(0,o.jsx)(se.yC,{value:Xe,label:(0,S.t)("nc_shoppingbasket.packstation.search.manually"),onClick:()=>D(Xe)},Xe),(0,o.jsx)(se.yC,{"data-testid":"packstation-form-search-tab",value:Qe,label:(0,S.t)("nc_shoppingbasket.checkout.packstationSearch"),onClick:()=>D(Qe)},Qe)]}),(0,o.jsx)(se.JS,{value:Xe,children:(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 pt-6 lg:gap-x-6",children:[(0,o.jsx)($.a,{"data-testid":"packstation-number",className:"col-span-2 mt-0",placeholder:(0,S.t)("nc_general.form.zusatz.packstationNumber"),value:E.packstationNumber,name:C.py.SHIPPING.PACKSTATION_NUMBER,errorMessages:H,onChange:e=>{l(e.target.value),k(h,"packstationNumber",e.target.value)},onBlur:Y(C.py.SHIPPING.PACKSTATION_NUMBER)}),(0,o.jsx)($.a,{"data-testid":"packstation-postal-code",maxLength:B?.properties.zipCode.maxLength,name:C.py.SHIPPING.ZIP_CODE,placeholder:(0,S.t)("nc_general.form.plz"),value:E.postalCode,errorMessages:R.zipCode,infoMessages:G.zipCode,onChange:V(C.py.SHIPPING.ZIP_CODE),onBlur:Y(C.py.SHIPPING.ZIP_CODE)}),(0,o.jsx)($.a,{"data-testid":"packstation-city",maxLength:B?.properties.city.maxLength,name:C.py.SHIPPING.CITY,placeholder:(0,S.t)("nc_general.form.ort"),value:E.city,errorMessages:R.city,infoMessages:G.city,onChange:V(C.py.SH
1IPPING.CITY),onBlur:Y(C.py.SHIPPING.CITY)})]})}),(0,o.jsx)(se.JS,{value:Qe,children:(0,o.jsxs)("div",{className:"pt-6",children:[(0,o.jsx)(Me.p,{className:"mt-0","data-testid":"packstation-form-search-input",placeholder:(0,S.t)("nc_shoppingbasket.checkout.packstationSearch"),value:r||"",onChange:_,onClear:_}),c&&(0,o.jsx)("div",{className:"flex justify-center pt-4",children:(0,o.jsx)("img",{alt:"loading",src:`${(0,a.Tt)()}images/misc/loader-black.gif`})}),p.length>0&&(0,o.jsx)("div",{className:"pt-4",style:e?{height:e}:{},children:(0,o.jsx)("div",{className:"h-full max-h-96 overflow-y-auto overflow-x-hidden",children:p.map(e=>(0,o.jsx)(_e,{address:e,selectPackstation:O},e.packstationNumber))})})]})})]})]})},tt="AddressForm",st="AddressBook",at="Packstation",rt="Pickup",it=e=>"packstation"===e?at:tt,nt=(e,t)=>e!==rt&&"pickup"===t?.addressType,ot=(e,t)=>({id:e?.id,firstName:e?.firstName,lastName:e?.lastName,countryCode:e?.countryCode,addressType:t}),lt="col-span-12 lg:col-span-6 lg:col-start-4",ct={Packstation:"pickup_station",Pickup:"pickup_station",AddressBook:"addressbook",AddressForm:"my_address"},dt=()=>{const[e,t]=(0,u.useState)(void 0),s="shippingAddress",{configuration:a,formData:i,formValidationErrors:l,countries:c,setFormData:d,setFormValidationErrors:p,setSoftValidationErrors:m,updateCountry:h,isGoogleMapsConsentGiven:g,setIsGoogleMapsConsentGiven:x,schema:y,setSelectedPulfLocation:f,pickupLocationFinderState:b}=L(),[j,v]=(0,u.useState)(i.useDedicatedShippingAddress??!1),[k,T]=(0,u.useState)(void 0),A=e=>{if(e===j)return;v(e),T(void 0);const t=(0,I.pN)(i);if(t.useDedicatedShippingAddress=e,e)return t.shippingAddress={addressType:"postal",countryCode:i.billingAddress?.countryCode},void d(t);const s=t.shippingAddress?.countryCode,a=t.billingAddress?.countryCode;t.shippingAddress=void 0,d(t),s&&s!==a&&h(a||"",t)},D=i[s]||{id:"",firstName:"",lastName:"",city:"",countryCode:i.billingAddress.countryCode,street:"",zipCode:"",company:"",addressType:"",packstationPostNumber:"",packstationNumber:""},[M,O]=(0,u.useState)(()=>"pickup"===D.addressType?rt:it(D.addressType));(0,u.useEffect)(()=>{b.zipCode&&p(e=>e[s]?.[C.py.SHIPPING.PICKUP_STATION_ID]?{...e,[s]:{...e[s],[C.py.SHIPPING.PICKUP_STATION_ID]:void 0}}:e)},[b.zipCode,p]);const w=Object.keys(l?.[s]??{}).length>0,U=M===st&&w?it(i.shippingAddress?.addressType):M,R=e=>{J.RL.deliveryMethodSelected({deliveryMethod:ct[e]??ct[tt]}),nt(e,i.shippingAddress)&&(b.clearSelectedLocation(),f(null));const t=i.shippingAddress?.zipCode||i.billingAddress?.zipCode;e!==rt||!t||b.hasSearched||b.isSearching||b.prefillZipCode(t);const s=((e,t)=>{const s=nt(e,t);return e===at?{action:"setShippingAddress",shippingAddress:ot(t,"packstation"),forceDedicatedShippingAddress:!0}:e===tt?s?{action:"useBillingAddress"}:{action:"setShippingAddress",shippingAddress:{...t,addressType:"postal"},forceDedicatedShippingAddress:!1}:e===rt&&"pickup"!==t?.addressType?{action:"setShippingAddress",shippingAddress:ot(t,"pickup"),forceDedicatedShippingAddress:!0}:{action:"none"}})(e,i.shippingAddress);"useBillingAddress"===s.action?A(!1):"setShippingAddress"===s.action&&(s.forceDedicatedShippingAddress&&v(!0),d({...i,...s.forceDedicatedShippingAddress&&{useDedicatedShippingAddress:!0},...e===rt&&{selectedShippingCarrier:{key:C.lg.DHL}},shippingAddress:s.shippingAddress})),p({}),m({})},G=y.properties.shippingAddress?.properties.addressType?.enum?.includes("pickup")??!1,$=a.initialStaticData.shouldDisplayPulf&&G;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:lt,children:(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",className:"-mb-4 md:-mb-6 lg:-mb-8",id:"shipping-address-headline",children:(0,S.t)("general.checkout.address.deliveryMethod")})}),(0,o.jsx)("div",{className:(0,N.$)("shipping-address-form",U===rt?"col-span-12 lg:col-span-10 lg:col-start-2":lt),"data-testid":"shipping-address-form",children:(0,o.jsxs)(se.iA,{className:"contents",value:U,defaultValue:tt,onValueChange:O,children:[(0,o.jsx)("div",{children:(0,o.jsx)(se.A3,{children:(0,o.jsxs)(se.wb,{"aria-labelledby":"shipping-address-headline",className:"mb-5 gap-3 py-2",children:[(0,o.jsx)(se.yC,{size:"medium","data-testid":"tab-address-form-shipping",value:tt,label:(0,S.t)("general.checkout.address.myaddress"),icon:(0,o.jsx)(r.fA,{}),onClick:()=>R(tt)},tt),a.addresses?.length>0&&(0,o.jsx)(se.yC,{size:"medium",value:st,label:(0,S.t)("nc_shoppingbasket.addressbook"),icon:(0,o.jsx)(r.vP,{}),onClick:()=>R(st)},st),a.initialStaticData.isPackstationAvailable&&!$&&(0,o.jsx)(se.yC,{size:"medium","data-testid":"address-form-packstation-tab",value:at,label:(0,S.t)("nc_general.form.packstation"),icon:(0,o.jsx)(r.L$,{}),onClick:()=>R(at)},at),$&&(0,o.jsx)(se.yC,{size:"medium",className:"whitespace-nowrap","data-testid":"address-form-pickup-tab",value:rt,label:(0,S.t)("general.checkout.pulf.tabs.pickupStation"),icon:(0,o.jsx)(r.L$,{}),onClick:()=>R(rt)},rt)]})})}),(0,o.jsx)(se.JS,{value:tt,children:(0,o.jsxs)("div",{className:"grid grid-cols-12 gap-4 md:gap-6 lg:gap-8",children:[(0,o.jsx)("div",{className:"col-span-12",children:(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,o.jsx)(q.Ih,{className:(0,N.$)("relative flex flex-col justify-center gap-2 p-4 shadow-100 transition-shadow after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:border-2 after:transition-colors",j?"after:border-basic-transparent":"after:border-brand-default"),children:(0,o.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,o.jsx)(n.EY,{className:"font-bold",children:(0,S.t)("general.checkout.billingaddressselector")}),(0,o.jsx)(P.JD,{size:"small","data-testid":"dedicated-shipping-address-checkbox",icon:j?void 0:(0,o.jsx)(r.Sr,{}),iconPosition:"left",onClick:()=>A(!1),children:j?(0,S.t)("general.checkout.pulf.select"):(0,S.t)("general.checkout.pulf.selected")})]})}),(0,o.jsx)(q.Ih,{className:(0,N.$)("relative flex flex-col justify-center gap-2 p-4 shadow-100 transition-shadow after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:border-2 after:transition-colors",j?"after:border-brand-default":"after:border-basic-transparent"),children:(0,o.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,o.jsx)(n.EY,{className:"font-bold",children:(0,S.t)("general.checkout.differentaddressselector")}),(0,o.jsx)(P.JD,{size:"small","data-testid":"add-new-shipping-address-button",onClick:()=>A(!0),children:(0,S.t)("general.checkout.differentaddressbutton")})]})})]})}),j&&(0,o.jsx)("div",{className:"col-span-12","data-testid":"address-form-fields",children:(0,o.jsx)(Ee,{setContainerHeight:t})})]})}),a.addresses?.length>0&&(0,o.jsx)(se.JS,{value:st,children:(0,o.jsx)(Pe,{addresses:a.addresses,selectedAddressId:k,containerHeight:e,determineCountryName:e=>(c.find(t=>t.value===e)||c[0]).label,selectAddress:e=>{T(e.id);const t=e.countryIso2||e.countryCode||D.countryCode,s=D.countryCode!==t;D.company=e.companyName??"",D.firstName=e.firstName??"",D.lastName=e.lastName??"",D.street=e.addressLine1,D.zipCode=e.postalCode,D.city=e.city,D.countryCode=t,D.addressType=e?.type||"postal",D.packstationPostNumber=e.packstationPostNumber,D.packstationNumber=e.packstationNumber,D.pickupStationId=void 0,D.pickupLocationType=void 0,D.pickupPostNumber=void 0;const a={...i,shippingAddress:D,useDedicatedShippingAddress:!0};if(v(!0),s)return h(t,a);d(a),p({}),m({})}})}),a.initialStaticData.isPackstationAvailable&&(0,o.jsx)(se.JS,{value:at,children:(0,o.jsx)(et,{containerHeight:e})}
1),$&&(0,o.jsx)(se.JS,{value:rt,id:C.py.SHIPPING.PICKUP_STATION_ID,children:(0,o.jsx)(Te,{apiKey:a.initialStaticData.pulfGoogleMapsApiKey,mapId:a.initialStaticData.pulfGoogleMapsMapId,csrfToken:a.initialStaticData.csrfToken,finderState:b,imageServerUrl:a.initialStaticData.urls.imageServerUrl,isGoogleMapsConsentGiven:g,setIsGoogleMapsConsentGiven:x,labels:{searchHeading:(0,S.t)("general.checkout.pulf.search.heading"),searchClearButton:(0,S.t)("general.checkout.pulf.search.clear"),searchStartButton:(0,S.t)("general.checkout.pulf.search.start"),searchLabel:(0,S.t)("general.checkout.pulf.search.label"),invalidZipCodeTitle:(0,S.t)("general.checkout.pulf.invalidZip.title"),invalidZipCodeText:(0,S.t)("general.checkout.pulf.invalidZip.text"),kilometers:(0,S.t)("general.checkout.pulf.location.km"),openingHours:(0,S.t)("general.checkout.pulf.openingHours"),noOpeningHoursText:(0,S.t)("general.checkout.pulf.openingHours.none"),weekdayLabels:{monday:(0,S.t)("general.checkout.pulf.monday"),tuesday:(0,S.t)("general.checkout.pulf.tuesday"),wednesday:(0,S.t)("general.checkout.pulf.wednesday"),thursday:(0,S.t)("general.checkout.pulf.thursday"),friday:(0,S.t)("general.checkout.pulf.friday"),saturday:(0,S.t)("general.checkout.pulf.saturday"),sunday:(0,S.t)("general.checkout.pulf.sunday"),closed:(0,S.t)("general.checkout.pulf.closed")},selectOption:(0,S.t)("general.checkout.pulf.select"),selectedOption:(0,S.t)("general.checkout.pulf.selected"),emptyStateTitle:(0,S.t)("general.checkout.pulf.emptyState.title"),emptyStateText:(0,S.t)("general.checkout.pulf.emptyState.text"),noResultsTitle:(0,S.t)("general.checkout.pulf.noResults.title"),noResultsText:(0,S.t)("general.checkout.pulf.noResults.text"),errorStateTitle:(0,S.t)("general.checkout.pulf.errorState.title"),errorStateText:(0,S.t)("general.checkout.pulf.errorState.text"),errorStateButtonLabel:(0,S.t)("general.checkout.pulf.errorState.button"),mapConsentTitle:(0,S.t)("general.checkout.pulf.mapConsent.title"),mapConsentText:(0,S.t)("general.checkout.pulf.mapConsent.text"),mapConsentButtonLabel:(0,S.t)("general.checkout.pulf.mapConsent.button"),mapLoadingTitle:(0,S.t)("general.checkout.pulf.mapLoading.title"),mapLoadingText:(0,S.t)("general.checkout.pulf.mapLoading.text"),listLoadingTitle:(0,S.t)("nc_shoppingbasket.cba.tab.summary.waitingtext2"),mapErrorTitle:(0,S.t)("general.checkout.pulf.mapErrror.title"),mapErrorText:(0,S.t)("general.checkout.pulf.mapErrror.text"),mapErrorButtonLabel:(0,S.t)("general.checkout.pulf.mapErrror.button"),listTabLabel:(0,S.t)("general.checkout.pulf.tabs.list"),mapTabLabel:(0,S.t)("general.checkout.pulf.tabs.map")},errorMessage:l[s]?.[C.py.SHIPPING.PICKUP_STATION_ID]?.[0],onContinueWithHomeDelivery:()=>{R(tt),O(tt)},onLocationSelected:e=>{f(e),D.addressType="pickup",D.company=e.name,D.pickupStationId=e.id,D.pickupLocationType=e.type,D.street=e.addressLine,D.zipCode=e.postalCode,D.city=e.city,D.countryCode=D.countryCode||i.billingAddress.countryCode,D.firstName=D.firstName||i.billingAddress.firstName,D.lastName=D.lastName||i.billingAddress.lastName,v(!0),d({...i,shippingAddress:D,useDedicatedShippingAddress:!0}),p({}),m({}),b.zipCode&&_(E)}})})]})})]})};var pt=s("./checkout2/utils/checkoutDebugger.ts"),mt=s("./checkout2/utils/measurement.ts");const ut=()=>{const{configuration:e,submitStep:t,showView:s,formData:a,setFormData:r,showValidationErrorMessages:i,setFormValidationErrors:l,isLoading:c,schema:d,pickupLocationFinderState:p}=L(),m=!!d.properties.shippingAddress,u=e.initialStaticData;return(0,o.jsx)("div",{className:"col-span-12 grid grid-cols-12 gap-4 md:gap-6 lg:gap-8",children:(0,o.jsxs)(Y,{className:"contents","data-testid":"step-details",formId:"details",method:"post",onSubmit:()=>{const e=(0,Oe.Mm)(a),n=((e,t)=>"pickup"!==t?.addressType?e:e.filter(e=>!("data"in e)||"shippingAddress"!==ze(e.data)||Re(e.data)===C.py.SHIPPING.PICKUP_STATION_ID))(Ve(e,d,u.validationConfig,["billingAddress","shippingAddress","personalDetails"],!1),a?.shippingAddress),o=Ve(e,d,u.validationConfig,void 0,!1),c=Je(a?.shippingAddress,p?.selectedLocationId);return n.length>0||c?((0,pt.nw)("detail step could not proceed"),i(n),c&&l(e=>({...e,shippingAddress:{...e.shippingAddress,[C.py.SHIPPING.PICKUP_STATION_ID]:[Ue(u.validationConfig.default??"")]}})),void(n.length>0?M(n):_(C.py.SHIPPING.PICKUP_STATION_ID))):t(e,C.UT.DETAILS.formSections,e=>{(0,mt.u)({event:"details",action:"onSubmit",data:{addressType:a.useDedicatedShippingAddress?"packstation"===a?.shippingAddress?.addressType?"dedicated_packstation":"pickup"===a?.shippingAddress?.addressType?"dedicated_pickup_station":"dedicated_shipping":"billing"}});const t=((e,t)=>x(a.shippingAddress?.addressType)||0!==t.length||Ze(a.shippingAddress)?(e=>y(e.schema.properties.selectedShippingCarrier??null,e.availableShippingOptions??null,a.shippingAddress?.addressType))(e)?C.UT.SHIPPING.ID:C.UT.PAYMENT.ID:C.UT.SUMMARY.ID)(e,o);var i;t===C.UT.SHIPPING.ID&&x(a?.shippingAddress?.addressType)&&r({...a,shippingAddress:(i=a.shippingAddress,i&&{...i,firstName:"",lastName:""})}),s(t,!0)},x(a?.shippingAddress?.addressType)?qe:[])},children:[(0,o.jsxs)("div",{className:"col-span-12 lg:col-span-6 lg:col-start-4",children:[(0,o.jsx)(B.$j,{level:"1",visualLevel:"2",className:"mb-4 md:mb-6 lg:mb-8",children:(0,S.t)("general.checkout.details.headline")}
1),(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",children:(0,S.t)("general.checkout.details.billingAddress")}),(0,o.jsx)(V,{}),(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",children:(0,S.t)("general.checkout.details.contact")}),(0,o.jsx)(Z,{})]}),m&&(0,o.jsx)(dt,{}),(0,o.jsxs)("div",{className:"col-span-12 lg:col-span-6 lg:col-start-4",children:[(0,o.jsx)(D,{isLoading:c,loadingLabel:(0,S.t)("general.a11y.isLoading"),label:(0,S.t)("general.checkout.step.next")}),(0,o.jsx)(n.mE,{html:(0,S.t)("general.checkout.details.privacy",{url:u.urls.privacy}),className:"text-center"})]})]})})};var ht=s("../../../packages/features/captcha/src/use-captcha.ts"),gt=s("../../../packages/platform/data-layer-helper/src/data-layer-helper.ts"),xt=s("./lib/LocationService.ts"),yt=s("./lib/components/fx/Atoms/Buttons/TextButton.tsx"),ft=s("./lib/components/fx/Inputs/Captcha/index.tsx"),Nt=s("./lib/components/fx/Inputs/Text/ControlledInputPassword.tsx");const bt=({onUpdateFormData:e,errorMessages:t,email:s,password:a,hasLoginFailed:r=!1,controller:i,setHasLoginFailed:l})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)($.a,{"data-testid":"login-email",name:"email",value:s,placeholder:(0,S.t)("general.form.email"),errorMessages:t.email?[t.email.email]:[],onChange:t=>{e("email",t.target.value.trim())},onBlur:()=>{r&&l(!1)}}),(0,o.jsx)(Nt.u,{"data-testid":"login-password",value:a,errorMessages:t.password?[t.password.password]:[],name:"password",type:"password",placeholder:(0,S.t)("general.checkout.recognition.password"),onChange:t=>{e("password",t.target.value)},onBlur:e=>{r&&l(!1)}}),!!r&&(0,o.jsx)(n.EY,{className:"mt-0.5 text-semantic-error md:mt-1 lg:mt-2",size:"2",children:(0,S.t)("general.checkout.recognition.loginError")}),(0,o.jsx)(ft.B,{controller:i,onChange:t=>{e("captcha",t)}})]});var jt=s("../../../packages/platform/design-system/src/link/link.tsx");const vt=({homepageUrl:e,returnToLoginHandler:t,returnToLoginLabel:s,returnToHomeLabel:a,infoBoxLabel:l})=>(0,o.jsxs)("div",{className:"grid gap-4",children:[(0,o.jsx)(i.w4,{variant:"success",icon:(0,o.jsx)(i.ZF,{variant:"success",children:(0,o.jsx)(r.ee,{})}),children:(0,o.jsx)(n.EY,{children:l})}),(0,o.jsxs)("div",{className:"grid w-full grid-cols-1 gap-2 md:grid-cols-2 md:gap-4",children:[(0,o.jsx)(jt.VA,{className:"w-full",href:e,label:a}),(0,o.jsx)(P.JD,{className:"w-full",onClick:t,children:s})]})]});var kt=s("./lib/validation/email/EmailValidation.ts");const Ct=({value:e,onChange:t,onFocus:s,errors:a,isLoading:r,returnToLogin:i})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.EY,{children:(0,S.t)("general.password.lost.intro")}),(0,o.jsx)($.a,{placeholder:(0,S.t)("general.form.email"),value:e,errorMessages:a,isLoading:r,onChange:t,onFocus:s}),(0,o.jsxs)("div",{className:"mt-4 grid w-full grid-cols-1 gap-2 md:grid-cols-2 md:gap-4",children:[(0,o.jsx)(P.JD,{onClick:i,children:(0,S.t)("general.cancel")}),(0,o.jsx)(P.tA,{isLoading:r,type:"submit",children:(0,S.t)("general.customer.pwlost.submit")})]})]});var It=s("./checkout2/utils/ajaxRequestsHelpers.ts");const St=({returnToLogin:e,staticData:t})=>{const[s,a]=(0,u.useState)(""),[r,i]=(0,u.useState)(void 0),[n,l]=(0,u.useState)([]),[c,d]=(0,u.useState)(!1);return(0,o.jsx)(Y,{formId:C.UT.LOGIN.ID,onSubmit:async()=>{var e;e=s,kt.A.isValid(e)?await(0,It.d7)(s,()=>d(!0),()=>d(!1),i):l([(0,S.t)("general.kundencenter.login.wrongemail")])},children:(0,o.jsxs)("div",{className:"login-password-reset login-password-reset--align-left","data-testid":"password-reset-form",children:[(0,o.jsx)(B.$j,{level:"1",visualLevel:"2",className:"mb-4 md:mb-6 lg:mb-8",children:(0,S.t)("general.password.lost.title")}),!r&&(0,o.jsx)(Ct,{value:s,isLoading:c,errors:n,returnToLogin:e,onChange:e=>{a(e.target.value.trim())},onFocus:()=>{l([])}}),r&&(0,o.jsx)(vt,{homepageUrl:t.urls.index,returnToLoginHandler:e,returnToHomeLabel:(0,S.t)("general.alp.button.toStartPage"),returnToLoginLabel:(0,S.t)("general.checkout.recognition.login"),infoBoxLabel:(0,S.t)("general.password.lost.thanks",{email:s})})]})})};var Tt=s("./lib/components/fx/Components/Accordion/index.tsx"),Lt=s("./basket/AmazonPay2/AmazonPay2Manager.ts"),At=s("./basket/FX/RegularBasket/Content/Filled/BasketActions/ExpressCheckouts/AmazonPayments/AmazonPay2Button.tsx"),Pt=s("./lib/components/fx/Atoms/Icon/index.tsx"),Et=s("./lib/components/fx/Components/Image/ResponsiveImage.tsx");const Dt=({svgUrl:e,onClick:t,className:s,children:a})=>{const r=(0,u.useMemo)(()=>({url:e}),[e]);return(0,o.jsxs)(Tt.bm,{icon:Pt.A.ICON_NAME.ARROW,className:(0,N.$)("express-accordion-element relative flex items-center justify-between border-b border-neutral-300 pr-8 hover:cursor-pointer hover:text-primary-500 lg:border-neutral-200",s),onClick:t,children:[a,(0,o.jsx)(Et.w,{className:"absolute right-0 top-1/2 max-h-6 -translate-y-2/4 md:max-h-7",image:r})]})},Mt="AmazonPayButton",_t=({settings:e,checkoutType:t})=>{const s=(0,u.useMemo)(()=>`${(0,a.Tt)()}images/basket/amazon-logo.svg`,[]),r=(0,u.useRef)(null);return(0,u.useEffect)(()=>{new Lt.u(e).renderButton(Mt,()=>{r.current&&"none"!==r.current.style.display&&(r.current.style.display="none")})}
1,[e]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(At.L,{containerId:Mt,buttonRef:r}),(0,o.jsx)(Dt,{className:"express-accordion-element--amazon",svgUrl:s,onClick:()=>(Lt.u.logAmazonPayButtonClicked(t),r.current&&r.current.click(),!1),children:(0,o.jsx)("div",{"data-testid":"express-amazon-pay",children:(0,S.t)("general.basket.action.amazonPayments.label")})})]})};var Ot=s("./payPalExpress/PayPalExpressPopup/index.tsx");const wt=()=>{const{submitOrder:e,configuration:t,countries:s,updateCountry:r,formData:i}=L(),[n,l]=(0,u.useState)(!1),[c,d]=(0,u.useState)(!1),p=(0,u.useMemo)(()=>`${(0,a.Tt)()}images/basket/pay-pal-logo.svg`,[]),m=async()=>{h(),l(!0),(0,mt.u)({event:"expressPaymentMethod",action:"onClick",data:{payment_type:"PayPalExpress"}}),await e({paymentMethod:{paymentMethodToken:"PayPalExpress"}})},h=()=>{d(!1)},g=s.find(e=>e.value===t.shop.country.iso)||s[0];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Dt,{className:(0,N.$)("express-accordion-element--paypal",{"fx-loader fx-loader--animate":n}),svgUrl:p,onClick:()=>{(()=>{if(!t.initialStaticData.shouldDisplayPayPalExpressDeliveryNotice)return m();d(!0)})()},children:(0,o.jsx)("div",{"data-testid":"express-paypal",children:(0,S.t)("general.basket.action.payPalExpress.label")})}),c&&(0,o.jsx)(Ot.A,{isCustomerKnown:void 0!==t.customer,allCountries:s,initialCountry:g,checkoutRedirectUrl:void 0,onConfirm:m,onCountrySubmit:async e=>{await r(e,{...i,billingAddress:{countryCode:e}})},onClose:h})]})},Bt=({amazonPaySettings:e,shouldDisplayAmazonPay:t,shouldDisplayPaypalExpress:s,heading:a,description:r,checkoutType:i})=>(0,o.jsxs)("div",{children:[(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",className:"mb-0.5 mt-6 md:mb-1 md:mt-8 lg:mb-2 lg:mt-10",children:a}),(0,o.jsxs)(n.EY,{className:"mb-6",children:[r,"."]}),(0,o.jsxs)(Tt.nD,{className:"express-payment m-0",children:[e&&t&&(0,o.jsx)(_t,{settings:e,checkoutType:i}),s&&(0,o.jsx)(wt,{})]})]}),Ut=()=>{const{isLoading:e,configuration:t,showView:s,isVoucherCheckout:a,isDownloadCheckout:l}=L(),[c,d]=(0,u.useState)({}),[p,m]=(0,u.useState)({}),[h,g]=(0,u.useState)(!1),[x,y]=(0,u.useState)(!1),[f,N]=(0,u.useState)(!1),b=e=>!!t.paymentMethodConfiguration.paymentMethods.find(t=>t.token===e),j=b("AmazonPayments"),v=b("PayPalExpress"),{controller:k,isProcessing:T,formRef:A}=(0,ht.e)(),E=()=>{(0,gt.Wp)({event:"mythomann_usage",action:"forgot_password"}),N(!0)};return(0,o.jsxs)("div",{className:"col-span-12 lg:col-span-6 lg:col-start-4",children:[!f&&(0,o.jsxs)(Y,{ref:A,"data-testid":`step-${C.UT.LOGIN.ID}`,formId:C.UT.LOGIN.ID,method:"post",onSubmit:async()=>{const e=t.initialStaticData.loginSchema,s=Ve(c,e,t.initialStaticData.validationConfig),r={};if(s.forEach(e=>{const s=Re(e.data);r[s]=Ke(C.UT.LOGIN.ID,[e],t.initialStaticData.validationConfig)}),m(r),s.length<=0){const{secret:e,duration:t}=await k.run(),s=await(0,It.Uu)({email:c.email,password:c.password,captcha:e,captcha_duration:t});if(!0===s?.forcePasswordReset&&g(!0),(0,gt.JD)({event:"login",location:"checkout",success:s?.success?"1":"0"}),!0===s?.success)return void(a||l||!s?.shouldRedirectToOldCheckout?s?.nextShopSettings?.nextUrl?xt.A.setLocation(s.nextShopSettings.nextUrl):(0,I.T8)():xt.A.setLocation(s?.checkoutUrl));y(!0)}},children:[(0,o.jsx)(B.$j,{level:"1",visualLevel:"2",className:"mb-4 md:mb-6 lg:mb-8",children:(0,S.t)("general.checkout.login.headline")}),(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",children:(0,S.t)("general.checkout.login.account")}),(0,o.jsx)(bt,{email:c.email,password:c.password,errorMessages:p,hasLoginFailed:x,setHasLoginFailed:y,controller:k,onUpdateFormData:(e,t)=>{const s=(0,I.pN)(c);s[e]=t,d(s)}}),!h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"mt-4 flex flex-col justify-between md:flex-row md:gap-4",children:[(0,o.jsx)(P.tA,{"data-testid":"login-submit",isLoading:e||T,className:"w-full",type:"submit",children:(0,S.t)("general.checkout.login.submit")}),(0,o.jsx)("div",{className:"my-2 flex flex-col items-center md:hidden md:items-start",children:(0,o.jsx)(yt.Q,{primary:!0,onClick:E,children:(0,S.t)("general.password.lost.label")})}),(0,o.jsx)(P.JD,{"data-testid":"login-guest",className:"w-full",onClick:()=>{(0,gt.JD)({event:"guest_checkout_selected",parameters:{checkout_type:(0,U.Pq)(t.initialStaticData.checkoutType)}}),s(C.UT.DETAILS.ID)},children:(0,S.t)("general.checkout.login.continue")})]}),(0,o.jsx)("div",{className:"relative -left-4 my-2 hidden flex-col items-center md:flex md:items-start",children:(0,o.jsx)(yt.Q,{className:"ml-0",primary:!0,"data-testid":"password-reset-button",onClick:E,children:(0,S.t)("general.password.lost.label")})})]}),h&&(0,o.jsxs)("div",{className:"my-2 flex flex-col items-center md:items-start",children:[(0,o.jsx)(i.w4,{icon:(0,o.jsx)(i.ZF,{variant:"error",children:(0,o.jsx)(r.ee,{})}),variant:"error",className:"mb-4 mt-5 md:mb-6 lg:mb-8",children:(0,o.jsx)(n.EY,{children:(0,S.t)("general.login.passwordResetRequired")})}),(0,o.jsx)(P.tA,{onClick:()=>N(!0),children:(0,S.t)("general.mythomann.passwordLost.reset")})]})]}),f&&(0,o.jsx)(St,{returnToLogin:()=>N(!1),staticData:t.initialStaticData}),!f&&(j||v)&&(0,o.jsx)(Bt,{amazonPaySettings:t.paymentMethodConfiguration.expressSettings.amazonPay,shouldDisplayAmazonPay:j,shouldDisplayPaypalExpress:v,heading:(0,S.t)("general.checkout.payment.express"),description:(0,S.t)("general.checkout.express.paymentMethodsDescription"),checkoutType:t.initialStaticData.checkoutType})]})},Rt=({paymentMethodAccountOwnerField:e})=>
1{const{formData:t,formValidationErrors:s,updateValue:a,schema:r}=L(),i=s.paymentMethod?.[e]?.[0];return(0,o.jsx)(X.ks,{isInvalid:!!i,helperText:i||null,label:(0,S.t)("general.genericPayment.accountOwner"),maxLength:r.properties.paymentMethod.properties[e]?.maxLength,name:e,value:t.paymentMethod?.[e]||"",onChange:t=>{a("paymentMethod",e,t.target.value)},onBlur:t=>{a("paymentMethod",e,t.target.value)}})};var Gt=s("./lib/components/fx/Inputs/Radio/index.tsx");const $t=({token:e,imagePaths:t,label:s,longDescription:r,hasError:i,onChange:l=()=>{},isChecked:c,extendedComponents:d})=>(0,o.jsxs)("div",{"data-testid":"payment-method",className:"mb-6 last-of-type:mb-0 lg:mb-8",children:[(0,o.jsx)(Gt.U,{defaultChecked:c,classNameLabel:(0,N.$)({"before:border-semantic-error":i}),name:"paymentMethodToken",value:e,onChange:l,children:(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)(n.EY,{as:"span",children:s}),!!t.length&&t.map(e=>(0,o.jsx)("div",{className:"overflow-hidden rounded-sm border border-neutral-200 px-1 py-0.5",children:(0,o.jsx)("img",{className:"h-5 w-6",src:`${(0,a.Tt)()}images/${e}`,alt:s})},e))]})}),c&&(0,o.jsxs)("div",{className:"ml-12 flex flex-col gap-4",children:[(0,o.jsx)(n.EY,{as:"span",size:"2",children:r}),d]})]}),Ht=()=>{const e="paymentMethod",{formValidationErrors:t,setFormValidationErrors:s,updateValue:a,paymentMethodConfiguration:r,formData:i}=L(),l=(e=>e.filter(e=>!e.isExpress))(r.paymentMethods),c=p(r.paymentMethods,i.paymentMethod?.paymentMethodToken),d=r=>{t[e]=void 0,s({...t,[e]:void 0}),a("paymentMethod","paymentMethodToken",r.target.value)},m=e=>{switch(e.token){case"Blik":return(0,o.jsx)(Rt,{paymentMethodAccountOwnerField:C.py.PAYMENT.BLIK_ACCOUNT_OWNER});case"Bancontact":return(0,o.jsx)(Rt,{paymentMethodAccountOwnerField:C.py.PAYMENT.BANCONTACT_ACCOUNT_OWNER});default:return null}};return(0,o.jsxs)("div",{"data-testid":"payment-selection",className:"mb-6 border-y border-neutral-200 py-6 md:mb-8 lg:mb-10",children:[l.map(s=>(0,o.jsx)($t,{isChecked:c?.token===s.token,hasError:t[e]?.paymentMethodToken?.length>0,extendedComponents:m(s),onChange:d,...s},s.paymentId)),t[e]?.paymentMethod&&(0,o.jsx)(n.EY,{className:"mt-1 text-semantic-error md:mt-2 lg:mt-4",children:t[e].paymentMethod})]})},zt=()=>{const{configuration:e,showView:t,submitStep:s,formData:a,isLoading:r,showValidationErrorMessages:i,schema:l}=L(),c=e.initialStaticData;return(0,o.jsx)("div",{className:"col-span-12 lg:col-span-6 lg:col-start-4",children:(0,o.jsxs)(Y,{"data-testid":"step-payment",formId:"payment",method:"post",onSubmit:()=>{const e=(0,Oe.Mm)(a),r=Ve(e,l,c.validationConfig,["paymentMethod"],!0);if(r.length>0)return(0,pt.nw)("payment step could not proceed"),void i(r);s(e,C.UT.PAYMENT.formSections,()=>{(0,mt.u)({event:"payment",action:"onSubmit",data:{paymentMethodToken:a.paymentMethod?.paymentMethodToken}}),t(C.UT.SUMMARY.ID)})},children:[(0,o.jsx)(B.$j,{level:"1",visualLevel:"2",className:"mb-4 md:mb-6 lg:mb-8",children:(0,S.t)("general.checkout.payment.headline")}),(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",className:"mb-4 md:mb-6 lg:mb-8",children:(0,S.t)("general.checkout.payment.select")}),(0,o.jsx)(Ht,{}),(0,o.jsx)(D,{isLoading:r,loadingLabel:(0,S.t)("general.a11y.isLoading"),label:(0,S.t)("general.checkout.step.next")}),(0,o.jsx)(n.mE,{className:"text-center",html:(0,S.t)("general.checkout.details.privacy",{url:c.urls.privacy})})]})})};var Ft=s("../../../node_modules/@floating-ui/react/dist/floating-ui.react.mjs"),Vt=s("../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs"),Yt=s("../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs"),Kt=s("../../../node_modules/react-dom/index.js"),Zt=s("../../../packages/platform/design-system/src/button/icon-button.tsx"),Jt=s("../../../packages/platform/design-system/src/use-media-query.ts");const qt=({children:e,trigger:t,alignment:s="start",isOpen:a,onIsOpenChange:i,closeLabel:n})=>{const l=(0,Jt.vo)(),{isOpen:c,onOpenChange:d}=((e,t)=>{const[s,a]=(0,u.useState)(!1),r=e??s;return{isOpen:r,onOpenChange:t??a,controlProps:r?{}:{"aria-controls":void 0}}})(a,i),{refs:p,floatingStyles:m,context:h}=(0,Ft.we)({open:c,onOpenChange:d,middleware:[(0,Vt.cY)(16),(0,Vt.RK)({alignment:s,allowedPlacements:["top","bottom"]}),(0,Vt.BN)()],whileElementsMounted:Yt.ll}),g=(0,Ft.kp)(h),x=(0,Ft.s9)(h),y=(0,Ft.It)(h),{getReferenceProps:f,getFloatingProps:N}=(0,Ft.bv)([g,x,y]);return t?(0,o.jsxs)(o.Fragment,{children:[(0,u.cloneElement)(t,{ref:p.setReference,...f()}),c&&(0,Kt.createPortal)((0,o.jsxs)(o.Fragment,{children:[l&&(0,o.jsx)("div",{className:"fixed z-10 size-full bg-neutral-black/80"}),(0,o.jsx)(Ft.s3,{context:h,children:(0,o.jsxs)("div",{ref:p.setFloating,style:l?{position:"fixed",bottom:0,left:0,width:"100%",borderBottomRightRadius:0,borderBottomLeftRadius:0}:m,className:"relative z-20 max-w-screen-md rounded-lg bg-default-default py-5 pl-5 pr-12 shadow-100",...N(),children:[(0,o.jsx)("div",{className:"absolute right-2 top-2",children:(0,o.jsx)(Zt.NS,{label:n,size:"xsmall",onClick:()=>{d(!1)},children:(0,o.jsx)(r.US,{})})}),e]})})]}),document.body)]}):null},Wt=()=>{const e="shippingAddress",{formData:t,formValidationErrors:s,softValidationErrors:a,updateV
1alue:i,validateValue:l,selectedPulfLocation:c,showView:d}=L(),p=t[e]??{},m=s[e]||{},u=a[e]||{},h="PARCEL_LOCKER"===c?.type,g=p.pickupPostNumber&&p.pickupPostNumber.length>0;let x;g&&!De.A.isValid(p.pickupPostNumber)?x=[(0,S.t)("nc_shoppingbasket.checkout.packstation.validierung")]:!g&&m?.pickupPostNumber&&(x=m?.pickupPostNumber);const y=t=>s=>{i(e,t,s.target.value)},f=t=>s=>{i(e,t,(0,U.yh)(s.target.value)),l(e,t,s.target.value)};return(0,o.jsxs)("div",{className:"mb-16",children:[(0,o.jsx)(B.$j,{level:"1",visualLevel:"2",className:"mb-6",children:(0,S.t)("general.checkout.pulf.tabs.collection.headline")}),(0,o.jsxs)(q.N,{className:"mb-5 flex flex-col gap-3 p-4",children:[(0,o.jsxs)("div",{className:"flex items-stretch justify-between gap-2",children:[(0,o.jsxs)("div",{className:"flex gap-2",children:[h?(0,o.jsx)(r.y$,{className:"size-6 shrink-0"}):(0,o.jsx)(r.L$,{className:"size-6 shrink-0"}),(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)(B.$j,{level:"4",visualLevel:"6",children:c?.name}),(0,o.jsxs)(n.EY,{size:"base",children:[p.street,(0,o.jsx)("br",{}),p.zipCode," ",p.city]})]})]}),(0,o.jsx)("div",{className:"flex flex-col items-end justify-between",children:"number"==typeof c?.distance&&(0,o.jsx)(oe.vw,{className:"shrink-0",label:`${N=c.distance,(N/1e3).toFixed(1)} ${(0,S.t)("general.checkout.pulf.location.km")}`})})]}),(0,o.jsx)(P.JD,{size:"small",className:"self-end",icon:(0,o.jsx)(r.qU,{}),iconPosition:"left",onClick:()=>{d(C.UT.DETAILS.ID,!0)},children:(0,S.t)("general.edit")})]}),(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",className:"mb-5",children:(0,S.t)("general.checkout.details.contact")}),(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-4 pb-6",children:[(0,o.jsx)($.a,{"data-testid":"pickup-first-name",className:"mt-0",name:C.py.SHIPPING.FIRST_NAME,placeholder:(0,S.t)("nc_general.form.vorname"),value:p.firstName,errorMessages:m.firstName,infoMessages:u.firstName,onChange:y(C.py.SHIPPING.FIRST_NAME),onBlur:f(C.py.SHIPPING.FIRST_NAME)}),(0,o.jsx)($.a,{"data-testid":"pickup-last-name",className:"mt-0",name:C.py.SHIPPING.LAST_NAME,placeholder:(0,S.t)("nc_general.form.nachname"),value:p.lastName,errorMessages:m.lastName,infoMessages:u.lastName,onChange:y(C.py.SHIPPING.LAST_NAME),onBlur:f(C.py.SHIPPING.LAST_NAME)}),(0,o.jsx)($.a,{"data-testid":"pickup-post-number",className:"col-span-2 mt-0",placeholder:(0,S.t)("nc_general.form.zusatz.postnumber"),value:p.pickupPostNumber,name:C.py.SHIPPING.PICKUP_POST_NUMBER,errorMessages:x,onChange:y(C.py.SHIPPING.PICKUP_POST_NUMBER),onBlur:f(C.py.SHIPPING.PICKUP_POST_NUMBER)})]}),(0,o.jsxs)(qt,{closeLabel:(0,S.t)("general.close"),trigger:(0,o.jsx)(P.a6,{className:"mb-6 md:mb-8",icon:(0,o.jsx)(r.ee,{}),iconPosition:"left",children:(0,S.t)("general.checkout.pulf.postNumber.info.label")}),children:[(0,o.jsx)(n.EY,{weight:"bold",children:(0,S.t)("nc_general.form.zusatz.postnumber")}),(0,o.jsx)(n.EY,{children:(0,S.t)("general.checkout.pulf.postNumber.info.text")})]})]});var N},Qt=({carrierKey:e,carrierName:t,carrierPartner:s,flipLogoAndCarrierName:r})=>{let i=`planetthumb115x37at0.6/pics/images/shipping/${e}-logo.png`;return s&&(i=`planetthumb115x37at0.6/pics/images/shipping/partner/${s.logoFileName}`),(0,o.jsxs)(o.Fragment,{children:[!r&&t,(0,o.jsx)("div",{className:(0,N.$)("h-6 w-8 rounded border border-neutral-200 px-1 py-0.5",e.toLowerCase()),children:(0,o.jsx)("img",{className:(0,N.$)("size-full object-contain",t.toLowerCase()),src:`${(0,a.Ov)()}${i}`,alt:s&&s.name?s.name:e})}),r&&t]})},Xt=({carrierKey:e,carrierName:t,carrierPartner:s,aggregatedPrice:a,estimatedShippingDateSnippet:r,descriptionSnippet:i,flipLogoAndCarrierName:l})=>(0,o.jsxs)("div",{"data-testid":"shipping-option-content",className:"flex flex-wrap items-center justify-between",children:[(0,o.jsx)("div",{className:"mr-1 md:mr-2 lg:mr-4",children:(0,o.jsx)("div",{className:"flex items-center gap-2","data-testid":"shipping-option-carrier",children:(0,o.jsx)(Qt,{carrierKey:e,carrierName:t,carrierPartner:s,flipLogoAndCarrierName:l})})}),(0,o.jsx)("div",{"data-testid":"shipping-option-price",className:"whitespace-nowrap font-semibold",children:"0.0000"===a.grossPrice?(0,S.t)("nc_shoppingbasket.versandkosten.kostenlos"):(0,o.jsx)(o.Fragment,{children:a?a.formattedPrice:"unpredictable"})}),r&&(0,o.jsx)("div",{"data-testid":"shipping-option-estimation",className:"m-0 mt-2 w-full",children:(0,o.jsx)(n.mE,{html:r})}),i&&(0,o.jsx)(n.mE,{html:i,className:"m-0 mt-2 w-full"})]}),es=({shippingOption:e,hasError:t,onChange:s,isChecked:a})=>{const{basket:r}=L(),i=h(r.shippingOption)?(0,S.t)("general.carrier.heavyGoods"):e.name;return(0,o.jsx)("div",{className:"mb-1 last-of-type:mb-0 md:mb-2 lg:mb-4",children:(0,o.jsx)(Gt.U,{name:"shippingOption",value:e.key,defaultChecked:a,classNameLabel:(0,N.$)("[&>div:first-child]:w-full",{"before:border-semantic-error":t}
1),onChange:s,children:(0,o.jsx)(Xt,{carrierKey:e.key,carrierName:i,carrierPartner:e.carrierPartner,estimatedShippingDateSnippet:e.estimatedShippingDateSnippet,descriptionSnippet:e.key===C.lg.CLICK_AND_COLLECT?(0,S.t)("general.checkout.summary.shippingBody.ClickCollect"):null,aggregatedPrice:e.aggregatedPrice,flipLogoAndCarrierName:!1})})})},ts=({availableShippingOptions:e,selectedShippingOption:t,updateValue:s})=>{const a=e.options,r=e=>{s("selectedShippingCarrier","key",e.target.value)};return(0,o.jsx)("div",{className:"mb-6 border-y border-neutral-200 py-6 md:mb-8 lg:mb-10",children:a.map(e=>e.isSelectable?(0,o.jsx)(es,{shippingOption:e,hasError:!1,isChecked:t?.key===e.key,onChange:r},e.key):null)})},ss=()=>{const{availableShippingOptions:e,updateValue:t,configuration:s,showView:a,schema:r,formData:i,submitStep:l,isLoading:c,showValidationErrorMessages:d,setFormValidationErrors:p}=L(),m=s.initialStaticData;return(0,o.jsx)("div",{className:"col-span-12 lg:col-span-6 lg:col-start-4",children:(0,o.jsxs)(Y,{"data-testid":"step-shipping",formId:"shipping",method:"post",onSubmit:()=>{const e=(0,Oe.Mm)(i),t=Ve(e,r,m.validationConfig,["shippingMethod"],!0),s=Ve(e,r,m.validationConfig,void 0,!1),n=x(i.shippingAddress?.addressType)?(e=>e.filter(e=>!("path"in e)||"pickupPostNumber"!==e.path))(Ye(s,["shippingAddress"])):[],o=[...t,...n],c=Ze(i.shippingAddress);return o.length>0||c?((0,pt.nw)("shipping step could not proceed"),d(o),void(c?(p(e=>({...e,shippingAddress:{...e.shippingAddress,pickupPostNumber:[(0,S.t)("nc_shoppingbasket.checkout.packstation.validierung")]}})),_("pickupPostNumber")):M(o))):l(e,C.UT.SHIPPING.formSections,()=>{(0,mt.u)({event:"shipping",action:"onSubmit",data:{selectedShippingOptionKey:i.selectedShippingCarrier?.key}}),a((e=>0===e.length?C.UT.SUMMARY.ID:C.UT.PAYMENT.ID)(s))})},children:["pickup"===i.shippingAddress?.addressType?(0,o.jsx)(Wt,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(B.$j,{level:"1",visualLevel:"2",className:"mb-4 md:mb-6 lg:mb-8",children:(0,S.t)("general.checkout.shipping.screen.headline")}),(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",className:"mb-4 md:mb-6 lg:mb-8",children:(0,S.t)("general.checkout.shipping.subtitle")}),(0,o.jsx)(ts,{availableShippingOptions:e,selectedShippingOption:f(r.properties.selectedShippingCarrier?.properties.key.default,i.selectedShippingCarrier?.key,e),updateValue:t})]}),(0,o.jsx)(D,{isLoading:c,loadingLabel:(0,S.t)("general.a11y.isLoading"),label:(0,S.t)("general.checkout.step.next")}),(0,o.jsx)(n.mE,{className:"text-center",html:(0,S.t)("general.checkout.details.privacy",{url:m.urls.privacy})})]})})};s("../../../node_modules/core-js/modules/es.iterator.some.js");const as=({name:e,title:t,tooltip:s,editSnippet:a,onClickEdit:i,children:n})=>{const l=void 0!==i;return(0,o.jsxs)("div",{"data-testid":`summary-block-${e}`,className:"border-t border-neutral-300 pb-4 pt-2 md:pb-6 md:pt-4",children:[(t||l)&&(0,o.jsxs)("div",{className:"mb-4 flex justify-between gap-2",children:[t&&(0,o.jsxs)("div",{className:"flex items-start md:items-center",children:[(0,o.jsx)(B.$j,{level:"2",visualLevel:"4",children:t}),s&&s]}),l&&(0,o.jsx)(Zt.EO,{className:"ml-auto",id:`summary-edit-button-${e}`,label:a??(0,S.t)("general.edit"),"data-testid":"summary-edit-button",onClick:i,children:(0,o.jsx)(r.qU,{})})]}),n]})};var rs=s("../../../node_modules/libphonenumber-js/min/exports/isSupportedCountry.js"),is=s("../../../node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js");const ns=({shippingAddress:e,shippingCountryName:t})=>(0,o.jsxs)("div",{children:[(0,o.jsx)(Le,{parts:[e.firstName??"",e.lastName??""]}),(0,o.jsx)(Le,{parts:[`${(0,S.t)("nc_general.form.zusatz.postnumber")} ${e.packstationPostNumber}`]}),(0,o.jsx)(Le,{parts:[`${(0,S.t)("general.mythomann.addressbook.packstation")} ${e.packstationNumber}`]}),(0,o.jsx)(Le,{parts:[e.zipCode??"",e.city??""]}),(0,o.jsx)(Le,{parts:[t]})]}),os=({shippingAddress:e,shippingCountryName:t})=>(0,o.jsxs)("div",{children:[(0,o.jsx)(Le,{parts:[e.firstName??"",e.lastName??""]}),(0,o.jsx)(Le,{parts:[`${(0,S.t)("nc_general.form.zusatz.postnumber")} ${e.pickupPostNumber}`]}),e.company&&(0,o.jsxs)(n.EY,{as:"span",weight:"bold",className:"break-words",children:[e.company,(0,o.jsx)("br",{})]}),(0,o.jsx)(Le,{parts:[e.street??""]}),(0,o.jsx)(Le,{parts:[e.zipCode??"",e.city??""]}),(0,o.jsx)(Le,{parts:[t]})]}),ls=({shippingAddress:e,shippingCountryName:t})=>(0,o.jsxs)("div",{children:[(0,o.jsx)(Le,{parts:[e.company??""]}
1),(0,o.jsx)(Le,{parts:[e.firstName??"",e.lastName??""]}),(0,o.jsx)(Le,{parts:[e.street??""]}),(0,o.jsx)(Le,{parts:[e.zipCode??"",e.city??""]}),(0,o.jsx)(Le,{parts:[t]})]}),cs=({billingAddress:e,shippingAddress:t,personalDetails:s,countries:a})=>{const{formData:r}=L(),i=(0,u.useMemo)(()=>a.reduce((t,s)=>s.value===e?.[C.py.BILLING.COUNTRY_CODE]?s.presentationLabel:t,""),[a,e]),l=!!r.useDedicatedShippingAddress,c="pickup"===t?.addressType,d=r.selectedShippingCarrier?.key===C.lg.CLICK_AND_COLLECT,p=(0,u.useMemo)(()=>a.reduce((e,s)=>s.value===t?.[C.py.SHIPPING.COUNTRY_CODE]?s.label:e,""),[a,t]),m=(0,u.useMemo)(()=>a.reduce((e,t)=>"DE"===t.value?t.presentationLabel:e,""),[a]),h=s[C.py.CONTACT.PHONE_NUMBER]?.trim()??"",g=s?.[C.py.CONTACT.PHONE_NUMBER_COUNTRY]?.toUpperCase();let x="";if(h&&g){const e=(0,rs.J)(g)?(0,is.l)(h,g):void 0;x=e?.isValid()?e.formatInternational():h}const y=!!e[C.py.BILLING.COMPANY_NAME];return(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 lg:gap-x-6",children:[(0,o.jsxs)("div",{"data-testid":"summary-billing-address",children:[(0,o.jsx)(n.EY,{className:"font-bold",children:l||d?(0,S.t)("general.checkout.details.billingAddress"):(0,S.t)("general.address")}),(0,o.jsx)(Le,{parts:[e[C.py.BILLING.COMPANY_NAME]]}),y&&(0,o.jsx)(Le,{parts:[e[C.py.BILLING.EU_VAT_NUMBER]]}),null!==e[C.py.BILLING.NIF_NUMBER]&&void 0!==e[C.py.BILLING.NIF_NUMBER]&&""!==e[C.py.BILLING.NIF_NUMBER].trim()&&(0,o.jsx)(Le,{parts:[e[C.py.BILLING.NIF_NUMBER]]}),(0,o.jsx)(Le,{parts:[e[C.py.BILLING.FIRST_NAME],e[C.py.BILLING.LAST_NAME]]}),(0,o.jsx)(Le,{parts:[e[C.py.BILLING.STREET]]}),(0,o.jsx)(Le,{parts:[e[C.py.BILLING.ZIP_CODE],e[C.py.BILLING.CITY]]}),(0,o.jsx)(Le,{parts:[i]})]}),d&&(0,o.jsx)("div",{"data-testid":"summary-click-and-collect-address",children:(0,o.jsxs)(n.EY,{className:"whitespace-pre-line",children:[(0,o.jsx)("span",{className:"font-bold",children:"Thomann Warenausgabe"}),`\nHans-Thomann-Straße 6\n96138 Burgebrach-Treppendorf\n${m}`]})}),l&&(0,o.jsxs)("div",{"data-testid":"summary-shipping-address",children:[(0,o.jsxs)(n.EY,{className:"font-bold",children:[(0,S.t)("general.checkout.details.shippingAddress"),"pickup"===t.addressType&&` - ${(0,S.t)("general.checkout.pulf.summary.pickupLocation")}`]}),"packstation"===t.addressType&&(0,o.jsx)(ns,{shippingAddress:t,shippingCountryName:p}),c&&(0,o.jsx)(os,{shippingAddress:t,shippingCountryName:p}),"packstation"!==t.addressType&&!c&&(0,o.jsx)(ls,{shippingAddress:t,shippingCountryName:p})]}),(0,o.jsxs)("div",{"data-testid":"summary-contact-details",children:[(0,o.jsx)(n.EY,{className:"font-bold",children:(0,S.t)("general.checkout.details.contact")}),(0,o.jsx)(Le,{parts:[s[C.py.CONTACT.EMAIL]]}),(0,o.jsx)(Le,{parts:[x]})]})]})};var ds=s("./checkout2/components/Views/Partials/Summary/BasketSummaryPriceItem.tsx");const ps=({promotion:e,checkoutType:t,removePromotionRoute:s,csrfToken:a})=>{const{promotionCode:i}=e,{trigger:l}=(0,ae.n_)(s);return(0,o.jsxs)("div",{className:"order-prices-position grid grid-cols-3",children:[(0,o.jsxs)("div",{className:"position-label col-span-2",children:[(0,o.jsx)(n.EY,{children:(0,S.t)("general.promotion.text")}),(0,o.jsx)(n.EY,{className:"text-sm text-neutral-400","data-testid":"summary-promotion-code",children:i}),(0,o.jsx)(P.a6,{"data-testid":"summary-promotion-remove-button",icon:(0,o.jsx)(r.d7,{}),onClick:()=>{(async()=>{(await l({promotionCode:i.trim(),checkoutType:t,[C.Cb.CSRF_TOKEN]:a})).success&&(0,I.T8)()})()},children:(0,S.t)("general.kundencenter.retoure.first.remove")})]}),(0,o.jsx)("div",{className:"whitespace-nowrap text-right",children:(0,o.jsxs)(n.EY,{as:"span",className:"fx-typography-subheadline ml-4 block whitespace-nowrap",children:["-",e?.totalDiscount?.savingsAbsoluteAggregatedPrices?.primary?.formattedPrice]})})]},i)},ms=({voucher:e,checkoutType:t,removeVoucherRoute:s,csrfToken:a,isVoucherCheckout:i})=>{const{trigger:l}=(0,ae.n_)(s);return(0,o.jsxs)("div",{className:"order-prices-position grid grid-cols-3",children:[(0,o.jsxs)("div",{className:"position-label col-span-2",children:[(0,o.jsx)(n.EY,{children:(0,S.t)("general.voucherBasket.headline")}),(0,o.jsx)(n.EY,{className:"text-sm text-neutral-400","data-testid":"summary-voucher-code",children:e.voucherNumber}),!i&&(0,o.jsx)(P.a6,{"data-testid":"summary-voucher-remove-button",icon:(0,o.jsx)(r.d7,{}),onClick:()=>{(async()=>{(await l({voucherNumber:e.voucherNumber.trim(),checkoutType:t,[C.Cb.CSRF_TOKEN]:a})).success&&(0,I.T8)()})()},children:(0,S.t)("general.kundencenter.retoure.first.remove")})]}),(0,o.jsxs)("div",{className:"whitespace-nowrap text-right",children:[(0,o.jsxs)(n.EY,{as:"span",className:"fx-typography-subheadline ml-4 block whitespace-nowrap",children:["-",e.usedAmountAggregatedPrices?.primary?.formattedPrice]}),e.usedAmountAggregatedPrices?.secondary&&(0,o.jsxs)(n.EY,{as:"span",className:"summary-product__price--secondary whitespace-nowrap text-grey-500",children:["-",e.usedAmountAggregatedPrices.secondary?.formattedPrice]})]})]},e.voucherNumber)},us=()=>{const{basket:e,configuration:t,schema:s}=L();if(!(0,I.T3)(t))return(0,o.jsxs)("div",{className:"flex flex-col gap-0.5 md:gap-1 lg:gap-2",children:[(0,o.jsx)(ds.n,{label:(0,S.t)("general.basket.subtotal"),aggregatedPrices:e.aggregatedPricesOfPositions}),g(s.properties.selectedShippingCarrier)&&(0,o.jsx)(ds.n,{label:(0,S.t)("nc_shoppingbasket.versandkosten"),aggregatedPrices:e.aggregatedShippingCost}),e.vouchers.length>0&&(0,o.jsx)(o.Fragment,{children:e.vouchers.map(e=>(0,o.jsx)(ms,{voucher:e,checkoutType:t.initialStaticData.checkoutType,removeVoucherRoute:t.initialStaticData.urls.removeVoucherRoute,csrfToken:t.initialStaticData.csrfToken,isVoucherCheckout:(0,I.T3)(t)},e.voucherNumber))}),e.promotions.length>0&&(0,o.jsx)(o.Fragment,{children:e.promotions.map(e=>(0,o.jsx)(ps,{promotion:e,checkoutType:t.initialStaticData.checkoutType,removePromotionRoute:t.initialStaticData.urls.removePromotionRoute,csrfToken:t.initialStaticData.csrfToken},e.promotionCode))}),(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"grid grid-cols-2",children:[(0,o.jsx)(B.$j,{level:"4",children:(0,S.t)("general.sum")}),(0,o.jsxs)("div",{className:"text-right","data-testid":"order-prices-total",children:[(0,o.jsx)(B.$j,{level:"3",className:"ml-4 whitespace-nowrap",children:e.aggregatedPricesOfBasket.primary.formattedPrice}),e.aggregatedPricesOfBasket.secondary&&(0,o.jsx)(n.EY,{as:"span",className:"text-grey-500",children:e.aggregatedPricesOfBasket.secondary.formattedPrice})]})]}),(0,o.jsx)(n.EY,{className:"text-right",children:(0,S.t)(e.aggregatedPricesOfBasket.primary.includesVat?"nc_general.country.vat.brutto":"nc_general.country.vat.netto")})]})]})};s("../../../node_modules/core-js/modules/es.json.parse.js");var hs=s("../../../packages/platform/design-system/src/image/simple-image.tsx"),gs=s("../../../packages/features/product/src/availability/availability.tsx"),xs=s("./common/GuaranteeLabel/collectGuaranteeLabels.ts"),ys=s("./common/GuaranteeLabel/guaranteeLabelButton.tsx");const fs=({addonRelations:e})=>e.length?(0,o.jsxs)("div",{className:"mt-1",children:[(0,o.jsx)(n.EY,{as:"span",className:"font-bold uppercase","data-testid":"summary-gift-label",children:"GIVEAWAY"}),e.map(e=>(0,o.jsxs)("div",{className:"mt-2 flex items-center",children:[(0,o.jsx)("img",{className:"mr-3 size-7 flex-none mix-blend-multiply",src:`${C.Qq}thumb50x50/pics/prod/${e.article?.mainImage?.fileName||"sorrynopic.png"}`,alt:`${e.article?.manufacturer??""} ${e.article?.model??""}`}),(0,o.jsx)(n.EY,{as:"span",size:"1",children:`${e.quantity}x ${e.article?.manufacturer??""} ${e.article?.model??""}`})]},e.addonArticleId))]}):null;var Ns=s("../../../packages/features/checkout/src/campaign-utils.ts");const bs=({campaigns:e})=>(0,Ns.q)(e)?(0,o.jsx)("div",{className:"mb-1",children:(0,o.jsx)(oe.yR,{label:"Cyberweek"})}):null,js=({position:e,shouldDisplayUVPAndStrikePrice:t})=>{const{article:s,discount:r}=e;if(!s)return null;const{manufacturer:i,model:l,mainImage:c,availability:d,texts:p,hasStrikePrice:m,strikePrice:u,hasUvp:h,uvpPrice:g,strikePriceSavingPercentage:x,uvpSavingPercentage:y}=s,f=(0,xs.q)(s),b=`${C.Qq}thumb144x144/pics/prod/${c?.fileName||"sorrynopic.png"}`,j=!(!e.prices?.secondary?.currency?.symbol||e.prices.secondary.currency.symbol===e.prices.primary?.currency?.symbol);return(0,o.jsxs)("div",{className:"relative mt-1 flex border-t border-neutral-100",children:[r&&(0,o.jsx)(hs.ch,{className:"absolute -top-1 right-12 w-6 p-0.5",alt:r.badge||"",src:`${(0,a.Tt)()}images/basket/promo/${r?.badge}.png`}),(0,o.jsx)("div",{className:"mb-2 mr-2 flex size-14 flex-none items-center justify-center bg-neutral-100 md:mr-6 md:size-20",children:(0,o.jsx)("img",{"data-testid":"summary-product-image",className:"p-0.5 mix-blend-multiply",src:b,alt:`${i} ${l}`})}),(0,o.jsxs)("div",{className:"flex flex-1 flex-col justify-evenly py-1",children:[(0,o.jsx)(bs,{campaigns:s.campaigns}),(0,o.jsxs)(n.EY,{as:"span","data-testid":"summary-product-name",children:[`${e.quantity}x `,(0,o.jsx)(n.EY,{as:"span",className:"font-bold",children:`${i} `}),l]}),(0,o.jsxs)("div",{className:"mt-1 flex w-full flex-wrap items-start justify-between md:mt-2",children:[(0,o.jsx)(gs.e,{token:d.token??"",text:s.isDownload?(0,S.t)("general.article.availability.download.label"):d.textShort??"",isDownload:s.isDownload}),(0,o.jsxs)("div",{className:"summary-product-prices ml-auto text-right",children:[(0,o.jsx)(n.EY,{as:"span","data-testid":"product-price",className:(0,N.$)("bl-4 fx-typography-subheadline block whitespace-nowrap",{"text-red-500":t&&m}),children:e.aggregatedPrices?.primary?.formattedPrice}),j&&(0,o.jsx)(n.EY,{as:"span",className:"summary-product__price--secondary whitespace-nowrap text-grey-500",children:e.aggregatedPrices?.secondary?.formattedPrice}),t&&(m||h)&&(0,o.jsxs)("div",{className:"mt-1 flex flex-row items-center justify-between gap-1",children:[(0,o.jsx)(n.EY,{as:"span",size:"2","data-testid":"strike-UVP-price-text",className:"whitespace-normal text-neutral-700",children:m&&u?`${(0,S.t)("general.price.xDaysBestPrice",{numberOfDays:30})}: ${u}`:`${(0,S.t)("general.uvp")}: ${g}`}),(0,o.jsx)(n.EY,{as:"span",size:"2","data-testid":"strike-UVP-percentage",className:(0,N.$)("rounded-sm p-1 font-semibold",{"bg-red-50 text-red-500":m,"bg-neutral-200 text-neutral-600":h&&!m}),children:`-${m&&x?x:y}%`})]})]})]}),p?.subTitle&&(0,o.jsx)(n.EY,{"data-testid":"product-sub-title",size:"1",className:"mt-2 md:mt-4 lg:mt-6",children:p.subTitle}),(0,o.jsx)(fs,{addonRelations:s.addonRelations}),f.length>0&&(0,o.jsx)("div",{className:"mt-2","data-testid":"guarantee-label-trigger",children:(0,o.jsx)(ys.L,{guaranteeLabels:f,size:"xsmall"})})]})]},e.articleId)},vs=({promotion:e})=>{const{promotion:t,totalDiscount:s,promotionCode:r,type:i}=e;if(!r&&!t)return null;const l=(0,S.t)("general.promotion.text"),c=t?.code;return(0,o.jsxs)("div",{className:"mt-1 flex border-t border-neutral-100 py-2","data-testid":"basket-promotion-item",children:[(0,o.jsx)("div",{className:"mb-2 mr-2 flex size-14 flex-none items-center justify-center bg-neutral-100 md:mr-6 md:size-20",children:(0,o.jsx)(hs.ch,{className:"w-8 p-0.5 mix-blend-multiply",alt:i||"",src:`${(0,a.Tt)()}images/basket/promo/${t?.promotionBadge}.png`})}),(0,o.jsx)("div",{className:"flex flex-1 flex-col justify-center",children:(0,o.jsxs)("div",{className:"flex items-start justify-between",children:[(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)(n.EY,{as:"span",className:"font-bold","data-testid":"promotion-name",children:l}),c&&(0,o.jsx)(n.EY,{size:"1",className:"text-neutral-500",children:c})]}),(0,o.jsx)("div",{className:"ml-auto text-right",children:(0,o.jsxs)(n.EY,{as:"span","data-testid":"promotion-discount-value",className:"fx-typography-subheadline text-green-600 block whitespace-nowrap font-bold",children:["-",s?.savingsAbsoluteAggregatedPrices?.primary?.formattedPrice||""]})})]})})]})},ks=({position:e})=>{const{article:t}=e;if(!t)return null;const{manufacturer:s,model:a,mainImage:r,availability:i}=t,l=!(!e.prices?.secondary?.currency?.symbol||e.prices.secondary.currency.symbol===e.prices?.primary?.currency?.symbol),c=e=>`${C.Qq}thumb144x144/pics/prod/${e||"sorrynopic.png"}`;return(0,o.jsxs)("div",{className:"mt-1 flex border-t border-neutral-100",children:[(0,o.jsx)("div",{className:"mb-2 mr-2 flex size-14 flex-none items-center justify-center bg-neutral-100 md:mr-6 md:size-20",children:(0,o.jsx)("img",{"data-testid":"summary-product-image",className:"p-0.5 mix-blend-multiply",src:c(r?.fileName??""),alt:`${s} ${a}`})}),(0,o.jsxs)("div",{className:"flex flex-1 flex-col justify-evenly py-1",children:[(0,o.jsxs)(n.EY,{as:"span","data-testid":"summary-product-name",children:[`${e.quantity}x `,(0,o.jsx)(n.EY,{as:"span",className:"font-bold",children:`${s} `}),a]}),(0,o.jsxs)("div",{className:"mt-1 flex w-full flex-wrap items-start justify-between md:mt-2",children:[(0,o.jsx)(gs.e,{token:i.token??"",text:i.textShort??"",isDownload:!1}),(0,o.jsxs)("div",{className:"summary-product-prices text-right",children:[(0,o.jsx)(n.EY,{as:"span","data-testid":"product-price",className:"fx-typography-subheadline block whitespace-nowrap",children:e.aggregatedPrices?.primary?.formattedPrice}),l&&(0,o.jsx)(n.EY,{as:"span",className:"summary-product__price--secondary whitespace-nowrap text-grey-500",children:e.aggregatedPrices?.secondary?.formattedPrice})]})]}),(0,o.jsx)("div",{className:"mt-4",children:t.creativeBundleComponents?.map(e=>{if(!e.selectedComponentArticle)return null;const{manufacturer:t,model:s,mainImage:a}=e.selectedComponentArticle.componentArticle||{};return(0,o.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[(0,o.jsx)("div",{className:"bg-neutral-100",children:(0,o.jsx)("img",{src:c(a?.fileName||""),alt:`${t} ${s}`,className:"size-8 object-contain mix-blend-multiply"})}),(0,o.jsx)(n.EY,{as:"span",size:"2",className:"font-medium",children:`${e.quantity}x ${t} ${s}`})]},`${e.creativeBundleId}-${a?.fileName}`)})})]})]},e.articleId)},Cs=({position:e,thumbOffset:t,theme:s,price:a})=>{const r=`${t}tthumb144x80/pics/images/mythomann/coupons/web-${s}.png`,i=!(!e.prices?.secondary?.currency?.symbol||e.prices.secondary?.currency.symbol===e.prices.primary?.currency?.symbol);return(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsx)("div",{className:"mb-2 mr-2 flex size-14 flex-none items-center justify-center bg-neutral-100 md:mr-6 md:size-20",children:(0,o.jsx)("img",{className:"p-0.5 mix-blend-multiply",src:r,alt:`Thomann ${(0,S.t)("general.giftcard")} - ${s}`,"data-testid":"summary-product-image"})}),(0,o.jsxs)("div",{className:"grow",children:[`${e.quantity}x `,(0,o.jsx)(n.EY,{as:"span",className:"font-bold",children:"Thomann "}),(0,S.t)("general.giftcard")]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(n.EY,{as:"span","data-testid":"product-price",className:"fx-typography-subheadline block",children:e.aggregatedPrices?.primary?.formattedPrice}),i&&(0,o.jsx)(n.EY,{as:"span",className:"text-grey-500",children:`${e.prices?.secondary?.rawPrice??""} ${e.prices?.secondary?.currency?.symbol??""}`})]})]},`${e.articleId}-${s}-${parseInt(a.toString())}`)},Is=220,Ss=({thumbOffset:e})=>{const{basket:t,hasBasketMergeNotification:s,isRegularCheckout:a,configuration:n}=L(),l=(0,u.useRef)(void 0),[c,d]=(0,u.useState)(0),[p,m]=(0,u.useState)(Is);(0,u.useEffect)(()=>
1{if(!l?.current)return;const e=()=>{d(l.current.clientHeight),p!==Is&&m(c)},t=(0,W.A)(e,150);return e(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[l,c,p]);const h=c>Is,g=s&&a;return(0,o.jsxs)("div",{children:[g&&(0,o.jsx)(i.w4,{className:"mb-4",icon:(0,o.jsx)(i.ZF,{variant:"success",children:(0,o.jsx)(r.Kj,{})}),variant:"success",title:(0,S.t)("general.checkout.summary.basketMerge.header"),children:(0,S.t)("general.checkout.summary.basketMerge.text")}),(0,o.jsx)("div",{className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:`${h?p:c}px`},children:(0,o.jsxs)("div",{ref:l,children:[t.positions.map(t=>{if("VOUCHER_ARTICLE"===t.type){const{theme:s,price:a}=JSON.parse(t.customData);return(0,o.jsx)(Cs,{position:t,thumbOffset:e,theme:s,price:a},`${t.articleId}-${s}-${parseInt(a.toString())}`)}return"CREATIVE_BUNDLE"===t.type?(0,o.jsx)(ks,{position:t},t.articleId.toFixed(1)):(0,o.jsx)(js,{position:t,shouldDisplayUVPAndStrikePrice:n.initialStaticData.shouldDisplayUVPAndStrikePrice},t.articleId)}),t.promotions.map(e=>(0,o.jsx)(vs,{promotion:e},e.promotionCode))]})}),h&&p===Is&&(0,o.jsx)("div",{className:"h-10 w-full -translate-y-full bg-gradient-to-t from-neutral-white to-basic-transparent"}),h&&(0,o.jsx)(P.a6,{icon:p===Is?(0,o.jsx)(r.c1,{}):(0,o.jsx)(r.QG,{}),className:"mx-auto flex",onClick:()=>{m(p===Is?c:Is)},children:p===Is?(0,o.jsx)("div",{children:(0,S.t)("nc_general.showall")}):(0,o.jsx)("div",{children:(0,S.t)("general.showLess")})})]})},Ts=({paymentMethod:e})=>{return(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[!!e.imagePaths.length&&(0,o.jsx)("div",{className:"mr-1 flex flex-wrap gap-1 md:mr-2 lg:mr-4",children:e.imagePaths.map(t=>(0,o.jsx)("div",{className:"overflow-hidden rounded-sm border border-neutral-200 px-1 py-0.5",children:(0,o.jsx)("img",{className:"h-5 w-6",src:`${(0,a.Tt)()}images/${t}`,alt:e.label})},t))}),(0,o.jsx)(n.EY,{"data-testid":"payment-method-name",as:"span",children:e.label})]}),(t=e.token,"PaidByVoucher"!==t&&(0,o.jsx)(n.EY,{className:"mt-4","data-testid":"payment-description",children:`${e.longDescription} ${(0,S.t)("general.basket.paymentMethod.textShort")}`}))]});var t},Ls=({shippingOption:e,selectedPaymentMethod:t})=>{const{configuration:s,basket:a,formData:r}=L(),l=e.key===C.lg.CLICK_AND_COLLECT,c="PrePayment"===t.token,d=h(a.shippingOption)||"hauler"===e.key?(0,S.t)("general.carrier.heavyGoods"):e.name;return e?.isSelectable?(0,o.jsx)(Xt,{carrierKey:e.key,carrierName:d,carrierPartner:e.carrierPartner,estimatedShippingDateSnippet:c?l?null:(0,S.t)("general.summaryPage.shippingDelivery.bankTransfer"):e.estimatedShippingDateSnippet,descriptionSnippet:l?c?(0,S.t)("general.thankyou.regular.subheadline.waitForPayment.ClickAndCollect",{mail:r.personalDetails?.[C.py.CONTACT.EMAIL]}):(0,S.t)("general.checkout.summary.shippingBody.ClickCollect"):null,flipLogoAndCarrierName:!0,aggregatedPrice:e.aggregatedPrice}):(0,o.jsx)(i.w4,{children:(0,o.jsx)(n.mE,{html:(0,S.t)("general.checkout.shipping.warning.unpredictable",{contactUrl:s.initialStaticData.urls.contact})})})},As=()=>(0,o.jsx)(qt,{closeLabel:"",trigger:(0,o.jsx)(Zt.NS,{size:"small",label:"",children:(0,o.jsx)(r.ee,{})}),children:(0,o.jsx)("div",{children:(0,o.jsx)(n.EY,{children:(0,S.t)("general.checkout.summary.preferredShippingExplanation")})})}),Ps=({label:e})=>{const{submitOrder:t,isLoading:s,formData:a}=L();return(0,o.jsx)(P.tA,{"data-testid":"summary-purchase-button",type:"button",isLoading:s,icon:(0,o.jsx)(r.HK,{}),iconPosition:"right",onClick:()=>{t(a)},children:e})};var Es=s("../../../packages/platform/design-system/src/accordion/accordion.tsx"),Ds=s("../../../packages/platform/globals/src/ab-switch.ts"),Ms=s("./lib/AbSwitch/TestGroups.ts"),_s=s("../../../packages/platform/design-system/src/forms/inputs/text-area.tsx");const Os=()=>{const e=C.tL.ADDITIONAL_OPTIONS,{formData:t,updateValue:s,schema:a}=L(),r=a.properties[e],i=t[e]?.[C.py.ADDITIONAL_OPTIONS.COMMENT]||"";return(0,o.jsx)(_s.f,{className:"test-id-comment-tab",label:(0,S.t)("nc_shoppingbasket.checkout.yourComment.short"),name:C.py.ADDITIONAL_OPTIONS.COMMENT,maxLength:r?.properties?.comment?.maxLength,maxLengthLabel:(0,S.t)("general.textarea.maxlength.indicator"),value:i,hasAutoGrow:!0,rows:3,onBlur:(n=C.py.ADDITIONAL_OPTIONS.COMMENT,t=>{s(e,n,(0,U.yh)(t.target.value))}),onChange:(t=>a=>{(0,gt.Wp)({event:"checkout_comment_initiated"}),s(e,t,a.target.value)})(C.py.ADDITIONAL_OPTIONS.COMMENT)});var n};var ws=s("../../../packages/platform/design-system/src/forms/datepicker/date-helper.ts"),Bs=s("../../../packages/platform/design-system/src/forms/datepicker/datepicker.tsx");const Us=()=>
1{const e=C.tL.ADDITIONAL_OPTIONS,{updateValue:t,formData:s}=L(),a=s.additionalOptions.preferredShippingDate??"",r=(0,ws.Ec)(),i=(0,ws.J4)((0,ws.Ec)(),6),l=(0,ws.Ec)(),c=(0,ws.J4)((0,ws.Ec)(),6);l.setHours(0,0,0,0),c.setHours(23,59,59,999);const d=e=>e.toLocaleDateString("en-CA"),p=s=>{(e=>{if(""===e)return!0;const t=new Date(e);return t>=l&&t<=c})(s)&&(t(e,C.py.ADDITIONAL_OPTIONS.PREFERRED_SHIPPING_DATE,s),(0,gt.Wp)({event:"dispatch_date_selected"}))};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.mE,{html:(0,S.t)("general.checkout.shipping.desiredDate.text")}),(0,o.jsxs)("div",{className:"mt-6 flex flex-col justify-between gap-4 md:flex-row",children:[(0,o.jsx)(Bs.t,{"data-testid":"summary-dispatch-date-input",label:(0,S.t)("general.checkout.shippingDate"),min:d(r),max:d(i),value:a,onDateChange:p}),""!==a&&(0,o.jsx)(P.tA,{onClick:()=>p(""),children:(0,S.t)("general.checkout.options.shippingDate.reset")})]})]})};var Rs=s("../../../packages/platform/design-system/src/forms/checkbox/checkbox.tsx");const Gs=()=>{const e=C.tL.ADDITIONAL_OPTIONS,{configuration:t,formData:s,updateValue:a}=L(),[{electronicRetoure:r}]=(0,u.useState)(s[e]||{electronicRetoure:!1}),{weeeData:i}=t;return(0,o.jsxs)("div",{className:"space-y-6",children:[(0,o.jsx)(n.mE,{html:(0,S.t)("general.electronicretoure.checkout.options.subtext.existing",{link:"compinfo_environment.html#electronic"})}),(0,o.jsx)(n.EY,{children:(0,S.t)("general.electronicretoure.checkout.options.qualifiedproducts")}),(0,o.jsx)("ul",{className:"list-disc pl-6",children:i.map(e=>(0,o.jsx)("li",{children:e.count+"x "+e.name},e.name))}),(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsx)(Rs.S,{name:"electronicRetoure",isSelected:r||!1,onChange:t=>{a(e,C.py.ADDITIONAL_OPTIONS.ELECTRONIC_RETURN,t)},children:(0,S.t)("general.electronicretoure.checkout.options.cta")}),r&&(0,o.jsx)("div",{className:"text-sm text-semantic-success",children:(0,S.t)("general.electronicretoure.checkout.options.success")})]})]})};var $s=s("./basket/FX/RegularBasket/voucher-and-promotion-events.ts");const Hs=()=>{const{configuration:e}=L(),t=e.initialStaticData,{checkoutType:s}=t,{redeemPromotionRoute:a}=t.urls,{trigger:r,isMutating:i}=(0,ae.n_)(a),[n,l]=(0,u.useState)({promotionCode:"",errors:[]});return!(0,I.T3)(e)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(X.ks,{"data-testid":"summary-add-promotion-input",label:(0,S.t)("general.promotion.text"),id:C.py.ADDITIONAL_OPTIONS.PROMOTION_ADD_FIELD,name:C.py.ADDITIONAL_OPTIONS.PROMOTION_ADD_FIELD,value:n.promotionCode,helperText:n.errors.length>0?n.errors[0]:void 0,isInvalid:n.errors.length>0,maxLength:128,onChange:e=>l({promotionCode:e.target.value,errors:[]})}),(0,o.jsx)(P.tA,{"data-testid":"summary-add-promotion-button",className:"my-2",isDisabled:n.promotionCode.length<1,isLoading:i,id:C.py.ADDITIONAL_OPTIONS.PROMOTION_ADD_SUBMIT,name:C.py.ADDITIONAL_OPTIONS.PROMOTION_ADD_SUBMIT,onClick:()=>{(async()=>{if(""===n.promotionCode.trim())return;let t;try{t=await r({promotionCode:n.promotionCode.trim(),checkoutType:s,[C.Cb.CSRF_TOKEN]:e.initialStaticData.csrfToken})}catch(e){const t=(0,ae.HH)(e);if(400===t?.statusCode)return(0,I.T8)()}t?.success?((0,$s.AJ)(n.promotionCode.trim()),(0,I.T8)()):((0,$s.Hu)(t?.errorCode),l({...n,errors:[t?.errorMessage]}))})()},children:(0,S.t)("nc_shoppingbasket.checkout.options.gutschein.redeem")})]})},zs=()=>{const{configuration:e}=L(),t=e.initialStaticData,{checkoutType:s}=t,{redeemVoucherRoute:a}=t.urls,[r,i]=(0,u.useState)({number:"",errors:[]}),{trigger:n}=(0,ae.n_)(a);if(a)return!(0,I.T3)(e)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(X.ks,{"data-testid":"summary-add-voucher-input",label:(0,S.t)("nc_kundencenter.mainpage.coupon.couponnumber"),id:C.py.ADDITIONAL_OPTIONS.COUPON_ADD_FIELD,name:C.py.ADDITIONAL_OPTIONS.COUPON_ADD_FIELD,value:r.number,helperText:r.errors.length>0?r.errors[0]:void 0,isInvalid:r.errors.length>0,maxLength:40,onChange:e=>i({number:e.target.value,errors:[]})}),(0,o.jsx)(P.tA,{"data-testid":"summary-add-voucher-button",className:"my-2",isDisabled:r.number.length<1,id:C.py.ADDITIONAL_OPTIONS.COUPON_ADD_SUBMIT,name:C.py.ADDITIONAL_OPTIONS.COUPON_ADD_SUBMIT,onClick:()=>{(async()=>
1{if(""===r.number.trim())return;let t;try{t=await n({voucherNumber:r.number.trim(),checkoutType:s,[C.Cb.CSRF_TOKEN]:e.initialStaticData.csrfToken})}catch(e){const t=(0,ae.HH)(e);if(400===t?.statusCode)return(0,I.T8)()}t.success?((0,gt.JD)({event:"voucher_added"}),(0,I.T8)()):((0,gt.JD)({event:"voucher_warning_displayed",parameters:{warning_type:"invalid"}}),i({...r,errors:[t?.errorMessage]}))})()},children:(0,S.t)("nc_shoppingbasket.checkout.options.gutschein.redeem")})]})};var Fs=s("./lib/AbSwitch/TestKeys.ts");const Vs=({additionalOptionsSchema:e})=>null==e?null:(0,o.jsxs)("div",{className:"mt-6 bg-neutral-100 p-6","data-testid":"summary-options",children:[(0,o.jsx)(B.$j,{level:"3",visualLevel:"4",className:"mb-4",children:(0,S.t)("general.options")}),(0,o.jsxs)(Es.n,{children:[!!e.properties?.voucherNumber&&(0,o.jsx)(Es.A,{"data-testid":"summary-add-voucher-accordion",level:"4",label:(0,S.t)("general.checkout.options.redeemThomannGiftCoupon.short"),children:(0,o.jsx)(zs,{})}),!!e.properties?.promotionCode&&(0,Ds.x)(Fs.A.CHECKOUT_PROMOTIONS).belongsTo(Ms.A.ACTIVE)&&(0,o.jsx)(Es.A,{"data-testid":"summary-add-promotion-accordion",level:"4",label:(0,S.t)("general.promotion.redeem.title"),children:(0,o.jsx)(Hs,{})}),!!e.properties?.preferredShippingDate&&(0,o.jsx)(Es.A,{"data-testid":"summary-dispatch-date-accordion",level:"4",label:(0,S.t)("general.checkout.shippingDate"),children:(0,o.jsx)(Us,{})}),!!e.properties?.comment&&(0,o.jsx)(Es.A,{level:"4",label:(0,S.t)("nc_general.shoutbox.comment.placeholder"),children:(0,o.jsx)(Os,{})}),!!e.properties?.electronicRetoure&&(0,o.jsx)(Es.A,{label:void 0,titleImage:(0,o.jsx)("img",{src:`${(0,a.Tt)()}images/checkout2/summary/electronic-recycling-logo.png`,alt:(0,S.t)("general.electronicretoure.checkout.options.title"),className:"w-32"}),children:(0,o.jsx)(Gs,{})})]})]});var Ys=s("./common/Measurement/Events/Checkout/summary.ts"),Ks=s("./debug/sentry.ts");const Zs=()=>{const{schema:e,formData:t,configuration:s,availableShippingOptions:a,showView:l,paymentMethodConfiguration:c,setDidAnEdit:m}=L(),h=s.initialStaticData,x=p(c.paymentMethods,t.paymentMethod?.paymentMethodToken),N={[C.L9.CREDIT_CARD]:"general.creditCard",[C.L9.PAYPAL]:"nc_kundencenter_hilfstabs.zaart.16",[C.L9.IDEAL]:"nc_kundencenter_hilfstabs.zaart.25",[C.L9.BANCONTACT]:"nc_kundencenter_hilfstabs.zaart.26"};if((0,u.useEffect)(()=>{let e;return x?.token===Lt.u.getPaymentMethodToken()&&(Lt.u.bindChangeAction(s.initialFormData.paymentMethod.amazonCheckoutSessionId,"summary-edit-button-payment",Lt.w.CHANGED_PAYMENT),Lt.u.bindChangeAction(s.initialFormData.paymentMethod.amazonCheckoutSessionId,"summary-edit-button-detail",Lt.w.CHANGED_ADDRESS)),x?.token&&(e=setTimeout(()=>{(0,mt.u)({event:Ys.t,action:"onReady",data:{paymentMethodToken:x?.token,carrierName:t.selectedShippingCarrier?.key}})},1337)),()=>{clearTimeout(e)}},[s.initialFormData.paymentMethod.amazonCheckoutSessionId,t.selectedShippingCarrier?.key,x?.token]),(0,u.useEffect)(()=>{x||((0,Ks.v4)(e=>{e.setTags({mod:"checkout2",evt:"summary.errors.invalidPaymentMethod"}),(0,Ks.wd)("summary.errors.invalidPaymentMethod","error")}),l(C.UT.PAYMENT.ID))},[x,l]),!x)return null;const b=()=>{const s=f(e.properties.selectedShippingCarrier?.properties.key.default,t.selectedShippingCarrier?.key,a);return y(e.properties.selectedShippingCarrier,a)&&s&&-1===C.Sr.indexOf(s.key)},j=p(c.paymentMethods,t.paymentMethod?.paymentMethodToken)?.isExpress&&"regular"!==s.initialStaticData.checkoutType?void 0:()=>{x.isExpress||(m(!0),l(C.UT.DETAILS.ID))};return(0,o.jsx)("div",{className:"col-span-12",children:(0,o.jsxs)("div",{"data-testid":"step-summary2","data-checkout2-form-id":"summary",className:"mx-auto max-w-[1176px]",children:[(0,o.jsx)(B.$j,{level:"1",visualLevel:"2",className:"mb-2 md:mb-4 lg:mb-6",children:(0,S.t)("general.checkout.summary.headline")}),(0,o.jsxs)("div",{className:"grid gap-x-16 lg:grid-cols-[5fr_3fr]",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"summary mb-6",children:[(0,o.jsx)(as,{name:"detail",title:(0,S.t)("general.checkout.step.details"),editSnippet:(0,S.t)("general.checkout.summary.editAddress"),onClickEdit:j,children:(0,o.jsx)(cs,{billingAddress:t.billingAddress,shippingAddress:t.shippingAddress,personalDetails:t.personalDetails,countries:h.countries})}),g(e.properties.selectedShippingCarrier)&&(0,o.jsx)(as,{name:"shipping",title:b()?(0,S.t)("general.checkout.summary.shippingPreferred"):(0,S.t)("general.checkout.step.shipping"),tooltip:b()?(0,o.jsx)(As,{}):null,editSnippet:(0,S.t)("general.checkout.summary.editShipping"),onClickEdit:f(e.properties.selectedShippingCarrier?.properties.key.default,t.selectedShippingCarrier?.key,a)&&y(e.properties.selectedShippingCarrier,a)?()=>{m(!0),y(e.properties.selectedShippingCarrier,a)&&l(C.UT.SHIPPING.ID)}:void 0,children:(0,o.jsx)(Ls,{shippingOption:f(e.properties.selectedShippingCarrier?.properties.key.default,t.selectedShippingCarrier?.key,a),selectedPaymentMethod:x})}),(0,o.jsx)(as,{name:"payment",title:(0,S.t)("general.checkout.payment.method"),editSnippet:(0,S.t)("general.checkout.summary.editPayment"),onClickEdit:c.paymentMethods.length>1?()=>{if(m(!0),d(e.properties.paymentMethod.properties.paymentMethodToken.enum)&&!x.isExpress)return l(C.UT.PAYMENT.ID)}:void 0,children:(0,o.jsx)(Ts,{paymentMethod:x})}),(0,o.jsx)(as,{name:"order",title:(0,S.t)("general.checkout.summary.order"),editSnippet:(0,S.t)("general.checkout.summary.editOrder"),onClickEdit:void 0,children:(0,o.jsx)(Ss,{thumbOffset:s.thumbOffset})})]}),(0,o.jsx)(Vs,{additionalOptionsSchema:s?.schema.properties.additionalOptions})]}),(0,o.jsx)(as,{name:"prices",children:(0,o.jsxs)("div",{"data-testid":"order-total-and-subtotal",className:"flex flex-col gap-5",children:[!!s.schema.properties.selectedShippingCarrier&&(t.useDedicatedShippingAddress?"US"===t?.shippingAddress?.countryCode:"US"===t.billingAddress?.countryCode)&&(0,o.jsx)(i.w4,{"data-testid":"us-customs-warning-info-box",icon:(0,o.jsx)(i.ZF,{variant:"error",children:(0,o.jsx)(r.yt,{})}),className:"mt-4 md:mt-8",variant:"error",children:(0,o.jsx)(n.mE,{html:(0,S.t)("general.tariffs.warning.text"),size:"base"})}),(0,o.jsx)(us,{}),(0,o.jsx)(Ps,{label:(v=x.token,Object.values(C.L9).some(e=>e===v)?(0,S.t)("general.checkout.pay.with.button.cta",{value:(0,S.t)(N[v])}):(0,S.t)("general.checkout.summary.submit"))}),(0,o.jsx)(n.mE,{html:(0,S.t)("general.checkout.summary.legal",{terms:h.urls.terms,cancellation:h.urls.cancellation,liability:h.urls.liability}),size:"2",className:"legal text-center"})]})})]})]})});var v},Js=()=>{const{isLoading:e,errorMessage:t,currentView:s,paymentMethodConfiguration:a,formData:r,didAnEdit:i,setDidAnEdit:n}=L();return(0,u.useEffect)(()=>{!1===e&&(0,I.$p)()},[e]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"mb-16 mt-4 grid grid-cols-12 gap-4 md:mb-32 md:mt-6 md:gap-6 lg:gap-8",children:[!p(a.paymentMethods,r.paymentMethod?.paymentMethodToken??"")?.isExpress&&C.UT.LOGIN.ID!==s&&(0,o.jsx)(A,{}),t&&(0,o.jsx)(l,{title:t.title,text:t.text}),C.UT.LOGIN.ID===s&&(0,o.jsx)(Ut,{}),C.UT.DETAILS.ID===s&&(0,o.jsx)(ut,{}),C.UT.SHIPPING.ID===s&&(0,o.jsx)(ss,{}),C.UT.PAYMENT.ID===s&&(0,o.jsx)(zt,{}),C.UT.SUMMARY.ID===s&&(0,o.jsx)(Zs,{})]}),i&&C.UT.SUMMARY.ID===s&&(0,o.jsx)("div",{className:"fixed inset-x-0 bottom-6 mx-auto w-96 max-w-full px-4 md:bottom-16 md:px-0",children:(0,o.jsx)(m.dV,{text:(0,S.t)("general.checkout.changesSaved"),closeLabel:(0,S.t)("general.close"),onClose:()=>n(!1)})})]})},qs=({staticData:e})=>(0,o.jsxs)("div",{className:"flex flex-col gap-4 text-center md:gap-6 lg:gap-8","data-checkout2-form-id":"error",children:[(0,o.jsx)("img",{className:"mx-auto w-28 md:w-44",src:`${(0,a.Tt)()}images/checkout2/error/sad-tv.svg`,alt:`${(0,S.t)("nc_general.fehler")} ${(0,S.t)("general.bild")}`}),(0,o.jsx)(B.$j,{level:"1",visualLevel:"2",children:(0,S.t)("general.checkout.errorpage.headline")}),(0,o.jsxs)("div",{children:[(0,o.jsx)(n.mE,{html:(0,S.t)("general.checkout.errorpage.description.line1")}),(0,o.jsx)(n.EY,{children:(0,S.t)("general.checkout.errorpage.description.line2")})]}),(0,o.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 md:flex-row md:gap-4",children:[(0,o.jsx)(jt.VA,{href:e.urls.index,className:"w-full max-w-xs",label:(0,S.t)("general.checkout.exit.back")}),(0,o.jsx)(jt.bO,{href:e.urls.contact,className:"w-full max-w-xs",label:(0,S.t)("general.contactus")})]})]});class Ws extends u.Component{constructor(e){super(e),this.state={hasError:!1}}componentDidCatch(e,t){(0,Ks.Cp)(e),this.setState({hasError:!0})}render(){return this.state.hasError?(0,o.jsx)(qs,{staticData:this.props.staticData}):(0,o.jsx)(o.Fragment,{children:this.props.children})}}s("../../../node_modules/core-js/modules/es.json.stringify.js"),s("../../../node_modules/core-js/modules/web.url-search-params.delete.js"),s("../../../node_modules/core-js/modules/web.url-search-params.has.js"),s("../../../node_modules/core-js/modules/web.url-search-params.size.js");const Qs={DE:/^\d{5}$/,PL:/^\d{2}-\d{3}$/},Xs=[];var ea=s("./lib/NotificationDispatcher/index.tsx"),ta=s("../../../packages/platform/globals/src/event-bus.ts"),sa=s("./lib/UrlBuilder/UrlBuilder.ts"),aa=s("./navi/fx/reducedHeaderPopover.tsx");const ra=(e,t)=>{const s={currentView:e};(0,pt.SF)(`LocationService.pushState(${JSON.stringify(s)}, ${t})`),xt.A.pushState(s,`${document.title} - ${e}`,t)};let ia;const na=e=>Object.values(C.UT).findIndex(t=>t.ID===e),oa=[C.py.PAYMENT.BANCONTACT_ACCOUNT_OWNER,C.py.PAYMENT.BLIK_ACCOUNT_OWNER],la=e=>{const[t]=(0,u.useState)(e),[s]=(0,u.useState)(e.initialStaticData.countries),[a,r]=(0,u.useState)(e.availableShippingOptions),[i,n]=(0,u.useState)(e.checkoutOrderabilityStatus),[l,p]=(0,u.useState)(t.paymentMethodConfiguration),[h,g]=(0,u.useState)(t.basket),[x,f]=(0,u.useState)(t.schema),[N,b]=(0,u.useState)(t.initialFormData),[j,v]=(0,u.useState)({}),[k,T]=(0,u.useState)({}),[L,A]=(0,u.useState)(""),[P,E]=(0,u.useState)(!1),[D,M]=(0,u.useState)(null),[_,O]=(0,u.useState)(t.isGoogleMapsConsentGiven),w=(({countryCode:e,csrfToken:t,shippingMethodKeys:s,locationTypes:a})=>{const[r,i]=(0,u.useState)(""),[n,o]=(0,u.useState)(0),[l,c]=(0,u.useState)(!1),[d,p]=(0,u.useState)(null),{trigger:m,data:h,error:g,isMutating:x,reset:y}=(0,ae.n_)("checkout2_pulfAjax.html"),f=r=>{i(r),((e,t)=>{const s=Qs[t.toUpperCase()];return!s||s.test(e.trim())})(r,e)?(c(!1),m({zipCode:r,radiusInMeters:1e4,csrfToken:t,shippingMethods:s,locationTypes:a},{throwOnError:!1})):c(!0)};return{zipCode:r,prefillCount:n,isZipCodeInvalid:l,hasSearched:Boolean(h),isSearching:x,locations:h?.locations??Xs,searchError:g,selectedLocationId:d,searchByZipCode:f,prefillZipCode:e=>{o(e=>e+1),f(e)},clearSearch:()=>{i(""),c(!1),p(null),y()},selectLocationId:p,clearSelectedLocation:()=>{p(null)}}})({countryCode:N.shippingAddress?.countryCode??"",csrfToken:t.initialStaticData.csrfToken,shippingMethodKeys:a?.options?.map(e=>e.key)??[],locationTypes:x.properties.shippingAddress?.properties.pickupLocationType?.enum??[]}),[B,R]=(0,u.useState)(t.paymentErrorMessage?{text:t.paymentErrorMessage}:void 0),[G,$]=(0,u.useState)(!1),H=(0,I.T3)(e),z=(0,I.H8)(e),F=(0,I.$l)(e),{hasBasketMergeNotification:V=!1}=e?.initialStaticData||{},Y=(0,u.useCallback)((e,t=!1,s=!1)=>{let r=e;if(!1!==t||r!==C.UT.SHIPPING.ID||y(x.properties.selectedShippingCarrier,a,N.shippingAddress?.addressType)||(r=C.UT.PAYMENT.ID),r
1===C.UT.PAYMENT.ID){const e=l.paymentMethods;if(1===e.length){const t=e[0].token;N.paymentMethod?.paymentMethodToken!==t&&b({...N,paymentMethod:{paymentMethodToken:t}}),r=C.UT.SUMMARY.ID}else d(x.properties.paymentMethod.properties.paymentMethodToken.enum)||(r=C.UT.SUMMARY.ID)}A(r),(e=>{(0,pt.SF)("update browser history");const t=new sa.j$(document.location.href).setModuleParameterIfPossible(e);ra(e,t.build())})(r),s||R(void 0)},[x,a,l,N]);(0,u.useEffect)(()=>{let t=!!e.customer;if(!t){const s=(0,Oe.Xm)((0,I.pN)(e.initialFormData.billingAddress));Object.keys(s).length>2&&(t=!0)}let s=C.UT.LOGIN.ID;t&&(s=((e,t)=>{let s=C.UT.SUMMARY.ID;const a=e[0];if(a&&"data"in a){const e=ze(a.data);Object.keys(C.UT).forEach(t=>{const a=C.UT[t];a.formSections.includes(e)&&(s=a.ID)})}return s!==C.UT.DETAILS.ID&&Ze(t)&&(s=C.UT.SHIPPING.ID),s})(Ve((0,Oe.Mm)(e.initialFormData),e.schema,e.initialStaticData.validationConfig),e.initialFormData.shippingAddress));const a=window.location.search;"countryChanged"===new URLSearchParams(a).get("action")&&(s=C.UT.DETAILS.ID),e.checkoutOrderabilityStatus.isOrderable||"noSelectableShippingOptionAvailable"===e.checkoutOrderabilityStatus.info&&(s=C.UT.DETAILS.ID),(0,mt.P)(e),Y(s,!1,!0),(e=>{void 0===ia&&(ia=e),(0,pt.SF)("initialise browser history");const t=new sa.j$(document.location.href),s=t.queryParameters.get("amazonCheckoutSessionId","");t.removeAllQueryParameters().setModuleParameterIfPossible(e),s&&t.queryParameters.set("amazonCheckoutSessionId",s),((e,t)=>{const s={currentView:e};(0,pt.SF)(`LocationService.replaceState(${JSON.stringify(s)}, ${t})`),xt.A.replaceState(s,`${document.title} - ${e}`,t)})(e,t.build()),ra(e,t.build())})(s)},[]),(0,u.useEffect)(()=>{const e=()=>{((e,t,s,a,r,i)=>{let n;if(n=c(a)?C.UT.SUMMARY.ID:r?C.UT.DETAILS.ID:C.UT.LOGIN.ID,c(a)&&e!==C.UT.SUMMARY.ID)return void s(C.UT.SUMMARY.ID,!0,!1);const o=(()=>{const e=window.location.pathname.match(/_([^_]+)\.html$/);return e?e[1]:null})();if(e===n&&ia===e||e===ia&&o===ia)return void(e=>{(0,ta.J)().emit(aa.J,()=>{const t=new sa.j$(document.location.href).setModuleParameterIfPossible(e);ra(e,t.build()),ra(e,t.build())})})(e);const l=o||C.UT.DETAILS.ID,d=((e,t)=>Je(e,t)?C.UT.DETAILS.ID:Ze(e)?C.UT.SHIPPING.ID:void 0)(a?.shippingAddress,i);d&&na(l)>na(d)?s(d,!1,!1):t(l)})(L,A,Y,N,t.customer,w?.selectedLocationId)};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[L,A,Y,N,t,w?.selectedLocationId]);const K=async(s,a)=>{$(!0);const r=(0,I.pN)(a);await(0,I.r6)(t.initialStaticData.urls.ajax,s,(0,Oe.Mm)(r),e.initialStaticData.csrfToken)},Z=e=>{if(!e)return;n(e.checkoutOrderabilityStatus);const t=e.availableShippingOptions||void 0;if(t){r(t);const e=N.selectedShippingCarrier?.key,s=t.options.some(t=>t.key===e);e&&!s&&b({...N,selectedShippingCarrier:{key:""}})}const s=e.paymentMethodConfiguration||void 0;s&&p(s);const a=e.basket||void 0;a&&g(a);const i=e.schema||void 0;i&&f(i)},J=(e,s,a)=>Ve({[e]:s},a,t.initialStaticData.validationConfig,[e],!0),q=e=>{const s={};e.forEach(a=>{if(!("data"in a))return;const r=ze(a.data),i=Re(a.data),n=Ke(r,e,t.initialStaticData.validationConfig),o=s[r]||{};o[i]=[n[i]],s[r]=o}),v(s)},W=(e,s,a)=>{const r=x.properties[e];r||(0,Ks.v4)(t=>{t.setTags({mod:"checkout2",evt:"frontend.validateValue"}),t.setExtra("schema",JSON.stringify(Object.keys(x.properties))),(0,Ks.wd)(`SectionSchema is undefined for key: "${e}"`,"error")});const i=J(s,a,r),n=Ke(e,i,t.initialStaticData.validationConfig)[s],o=j[e]||{};o[s]=oa.includes(s)&&n?[n]:[];const l={...j,[e]:o};v(l)};return{configuration:t,isLoading:G,setIsLoading:$,updateCountry:K,currentView:L,showView:Y,formData:N,countries:s,setFormData:b,validateFormField:J,formValidationErrors:j,setFormValidationErrors:v,showValidationErrorMessages:q,submitStep:async(s,a,r,i=[])=>{$(!0);const n=await(0,ae.nz)(t.initialStaticData.urls.ajax,{arg:{[C.Cb.ACTION]:C.b4.VALIDATE,[C.Cb.FORM_DATA]:s,[C.Cb.CSRF_TOKEN]:e.initialStaticData.csrfToken}}).catch(e=>{const t=(0,ae.HH)(e);400===t?.statusCode&&(0,I.T8)()});n&&!1===n.success&&(0,I.T8)();const o=n?n?.data:void 0;Z(o),$(!1);const l=(c=n?n?.validationErrors:[],d=a,c?.filter(e=>d.find(t=>t===Fe(e.path)))).filter(e=>!i.some(t=>e.path.endsWith(t)));var c,d;l.length>0?(e=>{q(e.map(e=>({type:e.type,name:"backendError",code:"",message:e.message,data:{pointer:e.path,schema:{},value:void 0},path:e.path})))})(l):n&&!0===n?.success&&n?.data&&r(o)}
1,submitOrder:async t=>{(0,gt.JD)({event:"order_submitted",parameters:{checkout_type:(0,U.Pq)(e.initialStaticData.checkoutType),payment_type:t.paymentMethod?.paymentMethodToken??"",has_dispatch_date:!!t.additionalOptions?.preferredShippingDate,has_comment:!!t.additionalOptions?.comment,has_voucher:e.basket.vouchers.length>0}}),(0,U.Ee)(t)||$(!0);const s={formData:(0,Oe.Mm)(t),[C.Cb.CSRF_TOKEN]:e.initialStaticData.csrfToken};await(0,I.KS)((0,U.$y)(e.initialStaticData.checkoutType),s,e=>{if(e?.action&&e?.postData){const t=(0,I.UA)(e.postData);return(0,I.Lq)(e.action,t)}return $(!1),(0,I.NA)(e?.redirectUrl||e?.action)},(e,t)=>{var s;$(!1),s=(0,S.t)("general.error.generic.text"),ea.A.dispatch((0,o.jsx)(m.Mu,{text:s}))})},softValidationErrors:k,setSoftValidationErrors:T,updateValue:(e,t,s)=>{t!==C.py.BILLING.ZIP_CODE&&t!==C.py.BILLING.NIF_NUMBER&&t!==C.py.BILLING.EU_VAT_NUMBER||(s=s.toUpperCase()),W(e,t,s),((e,t,s)=>{const a=x.properties[e].properties[t];if(!a?.softValidationRestriction)return;const r=a.softValidationRestriction,i=k[e]||{},n=s.match(new RegExp(r.pattern,"u"));i[t]=Array.isArray(n)?[]:[Ue(r.message)];const o={...k,[e]:i};T(o)})(e,t,s);const a=N[e]||{};"object"==typeof a&&(a[t]=s);let r=N.selectedShippingCarrier;if(t===C.py.BILLING.ZIP_CODE&&(r={key:""}),b({...N,selectedShippingCarrier:r,[e]:a}),t!==C.py.BILLING.COUNTRY_CODE)return;if(e!==C.tL.BILLING&&e!==C.tL.SHIPPING)return;const i=(0,I.pN)(N);K(s,i)},validateValue:W,availableShippingOptions:a,setAvailableShippingOptions:r,basket:h,setBasket:g,schema:x,removeVoucherFromBasket:async s=>{$(!0);const a=await(0,It.Q2)(t.initialStaticData.urls.ajax,C.b4.REMOVE_VOUCHER_FROM_BASKET,{voucherNumber:s,[C.Cb.CSRF_TOKEN]:e.initialStaticData.csrfToken});Z(a?.data),$(!1)},checkoutOrderabilityStatus:i,errorMessage:B,setErrorMessage:R,isVoucherCheckout:H,isRegularCheckout:z,isDownloadCheckout:F,hasBasketMergeNotification:V,paymentMethodConfiguration:l,didAnEdit:P,setDidAnEdit:E,isGoogleMapsConsentGiven:_,setIsGoogleMapsConsentGiven:O,selectedPulfLocation:D,setSelectedPulfLocation:M,pickupLocationFinderState:w}},ca=({flow:e,checkoutData:t,initialStaticData:s,paymentErrorMessage:r,isGoogleMapsConsentGiven:i})=>{const n={schema:t.schema,addresses:t.addresses,customer:t.customer,basket:t.basket,shop:t.shop,initialFormData:t.initialFormData,initialStaticData:s,paymentErrorMessage:r,isGoogleMapsConsentGiven:i,thumbOffset:(0,a.Ov)()??"",availableShippingOptions:t.availableShippingOptions,flow:e??[],paymentMethodConfiguration:t.paymentMethodConfiguration,weeeData:t.weeeData,checkoutOrderabilityStatus:t.checkoutOrderabilityStatus};return(0,o.jsx)(Ws,{staticData:s,children:(0,o.jsx)(T.Provider,{value:la(n),children:(0,o.jsx)(Js,{})})})}},"./lib/components/fx/Inputs/Text/Extensions/InputInfo.tsx"(e,t,s){var a=s("../../../node_modules/react/index.js"),r=s("./lib/components/fx/Atoms/Icon/index.tsx"),i=s("./lib/components/fx/Components/Tooltip/Tooltip.tsx"),n=s("../../../node_modules/react/jsx-runtime.js");s.d(t,["A",0,({children:e,contentClassName:t})=>{const s=(0,a.useMemo)(()=>()=>(0,n.jsx)(r.A,{className:"fx-size--md",iconName:r.A.ICON_NAME.INFO}),[r.A.ICON_NAME.INFO]),o=(0,a.useMemo)(()=>()=>(0,n.jsx)(a.Fragment,{children:e}),[e]);return(0,n.jsx)(i.m,{type:i.I.WITH_ICON,className:"fx-input-info fx-tooltip--allow-hover-no",position:i.m.POSITION.INPUT,iconName:r.A.ICON_NAME.INFO,Trigger:s,Content:o,contentProps:{className:t}})}])}}]);

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.