1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="4d8ece9c-1786-adb6-4210-997ce21c2bda")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,946955,e=>{"use strict";e.s(["CALCULATOR_STEPS",()=>el,"OnlinePriceCalculatorFormWrapper",()=>ec],946955);var t,a=e.i(843476),r=e.i(777481),s=e.i(703646);let l=async({locale:e,products:t})=>{let a=t.map(t=>c({locale:e,product_id:t.id}));return(await Promise.all(a)).map(e=>({...e.data,attributes:e.data.attributes.map(e=>({...e,values:e.values.map(e=>({...e,selected:!1}))}))}))},c=({locale:e,product_id:t})=>(0,s.fetchData)({uri:`/store/calculator/products/${t}`,method:"GET",locale:e}),o=async({locale:e,products:t})=>{let a={data:t.map(e=>{let t=e.attributes.flatMap(e=>e.values.filter(e=>e.selected).map(e=>({id:e.id})));return{id:e.id,values:t}}).filter(e=>e.values.length>0)};return(0,s.fetchData)({uri:"/store/calculator",method:"PUT",locale:e,body:a})};var n=e.i(326347),i=e.i(389205),d=e.i(831551);let u=({currentStep:e,prevStep:t,nextStep:r,disableNextButton:s=!1})=>{let{t:l}=(0,i.useTranslations)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:(0,d.cn)("hidden w-full justify-between py-4 sm:flex sm:py-6 md:py-8","ea-online-price-calculator-navigation ea-online-price-calculator-navigation__desktop"),children:[(0,a.jsx)("div",{children:e!==el.SELECT_PRODUCT&&(0,a.jsx)(n.Button,{variant:"outline",className:(0,d.cn)("border-none text-lg text-primary shadow-none","ea-online-price-calculator-navigation__prev-button ea-online-price-calculator-navigation__prev-button-desktop"),onClick:()=>t(),children:l("text246").toUpperCase()})}),(0,a.jsx)("div",{children:e!==el.SUMMARY&&(0,a.jsx)(n.Button,{className:(0,d.cn)(" text-lg","ea-online-price-calculator-navigation__next-button ea-online-price-calculator-navigation__next-button-desktop"),onClick:()=>r(),disabled:s,children:e===el.SELECT_PRODUCT?l("text1027").toUpperCase():l("text1357").toUpperCase()})})]}),(0,a.jsxs)("div",{className:(0,d.cn)("flex w-full flex-col gap-4 py-4 sm:hidden sm:py-6 md:py-8","ea-online-price-calculator-navigation ea-online-price-calculator-navigation__mobile"),children:[(0,a.jsx)("div",{children:e!==el.SUMMARY&&(0,a.jsx)(n.Button,{className:(0,d.cn)("h-14 w-full text-lg","ea-online-price-calculator-navigation__next-button ea-online-price-calculator-navigation__next-button-mobile"),disabled:s,onClick:()=>r(),children:e===el.SELECT_PRODUCT?l("text1027").toUpperCase():l("text1357").toUpperCase()})}),(0,a.jsx)("div",{children:e!==el.SELECT_PRODUCT&&(0,a.jsx)(n.Button,{variant:"outline",className:(0,d.cn)("h-14 w-full border-none text-lg text-primary shadow-none","ea-online-price-calculator-navigation__prev-button ea-online-price-calculator-navigation__prev-button-mobile"),onClick:()=>t(),children:l("text246").toUpperCase()})})]})]})};var m=e.i(433990);let p=({product:e,selectAttribute:t})=>{let{t:r}=(0,i.useTranslations)();return e?(0,a.jsx)("div",{className:(0,d.cn)("w-full px-0 sm:px-4 lg:px-20","ea-calculator-select-product-attributes"),children:(0,a.jsxs)("div",{className:(0,d.cn)("rounded-lg border border-border p-8","ea-calculator-select-product-attributes__product"),children:[(0,a.jsx)("h2",{className:(0,d.cn)("text-2xl font-bold sm:text-3xl","ea-calculator-select-product-attributes__product-name"),children:e.name}),(0,a.jsxs)("div",{className:(0,d.cn)("py-4","ea-calculator-select-product-attributes__product-attributes"),children:[!e.attributes.length&&(0,a.jsx)("div",{className:(0,d.cn)("w-full pt-8 text-center text-lg font-semibold sm:text-xl","ea-calculator-select-product-attributes__no-attributes"),children:r("text1371")}),e.attributes?.map((r,s)=>(0,a.jsxs)("div",{className:(0,d.cn)("flex flex-col items-start justify-start py-2","ea-calculator-select-product-attributes__attribute"),children:[!!s&&(0,a.jsx)(m.Separator,{className:(0,d.cn)("mb-6 mt-2","ea-calculator-select-product-attributes__separator")}),(0,a.jsxs)("div",{className:(0,d.cn)("text-lg font-bold sm:text-xl","ea-calculator-select-product-attributes__attribute-name"),children:[`${s+1}
2.`," ",r.name]}),(0,a.jsx)("div",{className:(0,d.cn)("flex items-center justify-between gap-2 py-2","ea-calculator-select-product-attributes__attribute-values"),children:r.values?.map(s=>(0,a.jsx)("div",{onClick:()=>t(e.id,r.id,s.id),className:(0,d.cn)("flex h-9 cursor-pointer items-center justify-center rounded-md border border-border px-4 sm:h-12 sm:px-6 lg:h-[59px]",s.selected&&"cursor-default border-success-foreground bg-success","ea-calculator-select-product-attributes__attribute-value"),children:s.name},s.id))})]},r.id))]})]})}):(0,a.jsx)("div",{className:(0,d.cn)("w-full py-20 text-center text-xl font-bold sm:py-32 sm:text-2xl md:text-3xl","ea-calculator-select-product-attributes__no-product-error"),children:r("text1363")})};var x=e.i(16578),h=e.i(947858),b=e.i(963435),g=e.i(271645),f=e.i(499222),j=e.i(73357),v=e.i(552047);let _=({products:e,onProductRemove:t,onProductAdd:r,onSelectForAttributes:s,selectedProductAttributes:l})=>{let c=(0,g.useRef)(null);return(0,a.jsx)("div",{className:(0,d.cn)("w-full flex-grow","ea-calculator-selected-products"),children:(0,a.jsx)(h.Carousel,{emblaRef:c,options:{slidesToScroll:1},className:{container:(0,d.cn)("mx-20 items-center gap-4"),main:(0,d.cn)("h-[110px] w-full px-2 py-2 sm:h-[134px]"),slide:(0,d.cn)("flex h-[64px] w-[300px] items-center sm:h-[80px]"),arrows:(0,d.cn)("top-[calc(50%-18px)] bg-transparent sm:top-[calc(50%-32px)]")},showArrows:!0,customArrowIcons:{left:(0,a.jsx)("div",{className:(0,d.cn)("flex h-[30px] w-[30px] items-center justify-center rounded-full border border-border bg-white sm:h-[56px] sm:w-[56px]","ea-calculator-selected-products-slider__left-arrow-wrapper"),children:(0,a.jsx)(j.FiChevronLeft,{className:(0,d.cn)("h-4 w-4 text-accent-foreground sm:h-8 sm:w-8","ea-calculator-selected-products-slider__left-arrow")})}),right:(0,a.jsx)("div",{className:(0,d.cn)("flex h-[30px] w-[30px] items-center justify-center rounded-full border border-border bg-white sm:h-[56px] sm:w-[56px]","ea-calculator-selected-products-slider__right-arrow"),children:(0,a.jsx)(j.FiChevronRight,{className:(0,d.cn)("h-4 w-4 text-accent-foreground sm:h-8 sm:w-8","ea-calculator-selected-products-slider__right-arrow")})})},slides:[...e?.map((e,r)=>(0,a.jsx)(y,{product:e,onRemove:()=>t(e),setSelectedForAttributes:()=>s(e),isSelected:l?.id===e.id},r)),(0,a.jsx)(N,{onProductAdd:()=>r()},e.length)]})})},y=({product:e,onRemove:t,setSelectedForAttributes:r,isSelected:s})=>(0,a.jsxs)("div",{className:(0,d.cn)("col-span-1 grid h-[64px] max-h-[64px] w-full cursor-pointer grid-cols-12 gap-2 rounded-lg border border-border px-4 py-2 sm:h-[80px] sm:max-h-[80px]","hover:border-success-foreground hover:bg-success hover:shadow-lg hover:outline hover:outline-1 hover:outline-success-foreground",s&&"border-success-foreground bg-success outline outline-1 outline-success-foreground","ea-calculator-product-slider-card"),onClick:()=>r(),children:[(0,a.jsx)("div",{className:(0,d.cn)("col-span-3 flex h-full items-center justify-center px-2","ea-calculator-product-slider-card__image-wrapper"),children:(0,a.jsx)(f.default,{src:e?.image?.url||"/images/placeholder.png",alt:(0,x.resolveImageAlt)(e?.image,e?.name,e?.name||"Image alt"),width:"0",height:"0",sizes:(0,b.buildImageSizes)([{min:"sm",size:"160px"},{size:"100vw"}]),className:(0,d.cn)("h-auto w-full object-contain","ea-calculator-product-slider-card__image")})}),(0,a.jsx)("div",{className:(0,d.cn)("col-span-7 flex items-center justify-start","ea-calculator-product-slider-card__name-wrapper"),children:(0,a.jsx)("h2",{className:(0,d.cn)("text-sm sm:text-lg sm:leading-5","ea-calculator-product-slider-card__name"),children:e.name})}),(0,a.jsx)("div",{className:(0,d.cn)("col-span-2 flex h-full items-center justify-center text-gray-400","ea-calculator-product-slider-card__close-icon-wrapper"),children:(0,a.jsx)(v.IoCloseCircleOutline,{onClick:()=>t(),className:(0,d.cn)("h-5 w-5 hover:text-destructive-foreground sm:h-6 sm:w-6","ea-calculator-product-slider-card__close-icon")})})]}),N=({onProductAdd:e})=>{let{t}=(0,i.useTranslations)();return(0,a.jsxs)("div",{className:(0,d.cn)("col-span-1 flex h-[48px] w-full cursor-pointer grid-cols-12 items-center justify-center gap-4 whitespace-nowrap rounded-lg border border-border bg-success-foreground py-4 pr-4 text-lg text-white sm:h-[56px]","hover:text-success","ea-calculator-product-slider-add-product-slide"),onClick:()=>e(),children:[(0,a.jsx)(j.FiPlus,{className:(0,d.cn)("","ea-calculator-product-slider-add-product-slide__icon")}),(0,a.jsx)("h2",{className:(0,d.cn)("","ea-calculator-product-slider-add-product-slide__text"),children:t("text1359").toUpperCase()})]})};var w=e.i(927193);let S=({products:e,onProductRemove:t,onProductAdd:r,selectedProductAttributes:s,setSelectedProductAttributes:l,selectedProductsWithAttributes:c,selectAttribute:o})=>c?(0,a.jsxs)("div",{className:(0,d.cn)("min-h-[500px] w-full","ea-calculator-product-attributes__wrapper"),children:[(0,a.jsx)(_,{products:e,onProductRemove:t,onProductAdd:r,selectedProductAttributes:s,onSelectForAttributes:l}),!!c&&(0,a.jsx)(p,{product:c.find(e=>e.id===s?.id),selectAttribute:o})]}):(0,a.jsx)("div",{className:(0,d.cn)("flex min-h-[400px] w-full items-center justify-center","ea-calculator-product-attributes__spinner-wrapper"),children:(0,a.jsx)(w.Spinner,{className:(0,d.cn)("h-12 w-12 sm:h-20 sm:w-20","ea-calculator-product-attributes__spinner")})}),C=({product:e,isSelected:t,toggleSelected:r})=>(0,a.jsxs)("div",{className:(0,d.cn)("col-span-1 grid min-h-[120px] w-full cursor-pointer grid-cols-12 gap-2 rounded-lg border border-border px-4 py-4","hover:border-success-foreground hover:bg-success hover:shadow-lg hover:outline hover:outline-1 hover:outline-success-foreground",t&&"border-success-foreground bg-success outline outline-1 outline-success-foreground ","ea-calculator-product-card"),onClick:()=>r(e),children:[(0,a.jsx)("div",{className:(0,d.cn)("col-span-3 flex h-full items-center justify-center px-2","ea-calculator-product-card__image-wrapper"),children:(0,a.jsx)(f.default,{src:e?.image?.url||"/images/placeholder.png",alt:(0,x.resolveImageAlt)(e?.image,e?.name,e?.name||"Image alt"),width:"0",height:"0",sizes:(0,b.buildImageSizes)([{min:"sm",size:"220px"},{size:"100vw"}]),className:"ea-calculator-product-card__image h-auto w-full object-contain"})}),(0,a.jsx)("div",{className:(0,d.cn)("col-span-7 flex h-full items-center justify-start","ea-calculator-product-card__name-wrapper"),children:(0,a.jsx)("h2",{className:(0,d.cn)("text-sm sm:text-lg","ea-calculator-product-card__name"),children:e.name})}),(0,a.jsx)("div",{className:(0,d.cn)("col-span-2 flex h-full items-center justify-center text-success-foreground","ea-calculator-product-card__checked-icon-wrapper"),children:!!t&&(0,a.jsx)(j.FiCheckCircle,{className:(0,d.cn)("h-5 w-5","ea-calculator-product-card__checked-icon")})})]}),F=({products:e,isLoadingProducts:t,selectedProducts:r,addToSelectedProducts:s,removeFromSelectedProducts:l})=>{let{t:c}=(0,i.useTranslations)(),o=e=>{r.includes(e)?l(e):s(e)};return t?(0,a.jsx)("div",{className:(0,d.cn)("flex min-h-[400px] w-full items-center justify-center","ea-calculator-select-product__spinner-wrapper"),children:(0,a.jsx)(w.Spinner,{className:(0,d.cn)("h-12 w-12 sm:h-20 sm:w-20","ea-calculator-select-product__spinner")})}):e?(0,a.jsxs)("div",{className:(0,d.cn)("w-full","ea-calculator-select-product"),children:[(0,a.jsx)("h2",{className:(0,d.cn)("w-full text-lg font-bold sm:text-2xl","ea-calculator-select-product__title"),children:c("text1356")}),(0,a.jsx)("div",{className:(0,d.cn)("grid w-full grid-cols-1 gap-2 py-4 sm:grid-cols-2 sm:gap-5 md:gap-8 lg:grid-cols-3","ea-calculator-select-product__grid"),children:e.map(e=>(0,a.jsx)(C,{product:e,isSelected:r.includes(e),toggleSelected:o},e.id))})]}):(0,a.jsx)("div",{children:c("No products")})};e.i(247167);var T=e.i(172636),E=e.i(742292),A=e.i(653145),L=e.i(158836),I=e.i(795868),P=e.i(81619),R=e.i(83415),D=e.i(999911),M=e.i(95180),k=e.i(127542),O=e.i(510906),U=e.i(991896),q=e.i(501658),z=e.i(164993),V=e.i(41893),B=e.i(572226);function G(e){let{t}=(0,i.useTranslations)(),{errors:r}=(0,A.useFormState)({control:e.control}),[s,l]=(0,g.useState)(!1),[c,o]=(0,g.useState)(!1),u=()=>
2o(!0),m=()=>o(!1),p=(0,U.useLocaleStore)(e=>e.currentLocale),x=O.localeMapping[p]||q.enUS,h=(0,g.useMemo)(()=>{let o=r[e.name];if("select"===e.type){if(!e.options)throw Error("Select type requires options prop");return(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:t})=>(0,a.jsxs)(E.FormItem,{className:(0,d.cn)("relative min-h-[56px]",e.label&&"flex flex-col items-start justify-start gap-3"),children:[e.showLabelTag&&e.label&&(0,a.jsx)(I.Label,{className:"text-base font-semibold text-foreground/50 sm:text-lg",children:e.label}),(0,a.jsx)(E.FormControl,{children:(0,a.jsx)("div",{className:(0,d.cn)("relative",e.label&&"w-full"),children:(0,a.jsxs)(D.Select,{value:String(t.value),onValueChange:e=>{t.onChange(e)},disabled:e.isDisabled,children:[(0,a.jsxs)(D.SelectTrigger,{className:(0,d.cn)("min-h-[56px] cursor-pointer rounded-md border border-border bg-input !pl-0",e.className?.selectTrigger),isClearable:e.clearable&&t.value,onClear:()=>t.onChange(null),clearableIconPossition:"right",children:[!e.withoutLabel&&(0,a.jsx)(E.FormLabel,{htmlFor:e.name,className:(0,d.cn)("absolute left-5 top-4 z-[1] cursor-pointer select-none text-foreground/50 transition-all duration-100",t.value&&""!==t.value?"!top-[10px] text-xs":"text-base",o&&"text-destructive"),isRequired:!1,children:!!e.label&&`${e.label}${e.required?"*":""}`}),(0,a.jsx)("div",{className:t.value&&""!==t.value&&!e.withoutLabel?"pl-4 pt-[20px]":"pl-4",children:(0,a.jsx)(D.SelectValue,{placeholder:e.placeholder,className:"pl-[30px]"})})]}),(0,a.jsx)(D.SelectContent,{children:e.options?.map?.(e=>(0,a.jsx)(D.SelectItem,{value:String(e.value),children:e.label},e.value))})]})})}),e.description&&(0,a.jsx)("p",{className:"ml-3 h-5 py-1 text-[12px] text-sm leading-4 text-muted-foreground",children:e.description}),(0,a.jsx)(E.FormMessage,{})]})})}if("multiselect"===e.type){if(!e.options)throw Error("MultiSelect type requires options prop");return(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:r})=>(0,a.jsxs)(E.FormItem,{className:"relative min-h-[56px]",children:[(0,a.jsx)(E.FormControl,{children:(0,a.jsx)(V.MultiSelectWithChilds,{options:e.options,isMulti:!0,placeholder:e.placeholder,value:r.value,onChange:r.onChange,isDisabled:e.isDisabled,noOptionsMessage:()=>t("text477"),stylesConfig:{},menuPlacement:e.menuPlacement||"bottom",classNamesConfig:{valueContainer:()=>(0,d.cn)("pl-4 bg-input"),control:()=>(0,d.cn)("!min-h-[60px] bg-input"),menu:()=>(0,d.cn)("!z-[100] !bg-input"),menuList:()=>(0,d.cn)("!z-[100] !bg-input block")},variant:"outlined"})}),e.description&&(0,a.jsx)("p",{className:"ml-3 h-5 py-1 text-[12px] text-sm leading-4 text-muted-foreground",children:e.description}),(0,a.jsx)(E.FormMessage,{})]})})}if("radio"===e.type){if(!e.options)throw Error("Radio type requires options prop");return(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:t})=>(0,a.jsxs)(E.FormItem,{required:e.required,className:"flex flex-col gap-2 p-[1px]",children:[e.label&&(0,a.jsx)(E.FormLabel,{className:"cursor-text select-none",children:e.label}),(0,a.jsx)(E.FormControl,{children:(0,a.jsx)(R.RadioGroup,{value:String(t.value),onValueChange:t.onChange,disabled:e.isDisabled,className:"flex flex-row gap-4 pl-2",children:e.options?.map?.(e=>(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(R.RadioGroupItem,{id:`radiogroupitem-${e.value}`,value:String(e.value)}),(0,a.jsx)(I.Label,{className:"flex items-center",htmlFor:`radiogroupitem-${e.value}`,children:(0,a.jsx)("p",{className:"text-sm font-semibold text-foreground",children:e.label})})]},e.value))})}),e.description&&(0,a.jsx)("p",{className:"ml-3 h-5 py-1 text-[12px] text-sm leading-4 text-muted-foreground",children:e.description}),(0,a.jsx)(E.FormMessage,{})]})})}if("checkbox"===e.type)return(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:t})=>(0,a.jsxs)(E.FormItem,{required:e.required,children:[(0,a.jsx)(E.FormControl,{children:(0,a.jsxs)("div",{className:"flex w-full flex-row items-center gap-2",children:[(0,a.jsx)(T.Checkbox,{...t,checked:t.value,onCheckedChange:t.onChange,disabled:e.isDisabled,"aria-disabled":e.isDisabled,className:"rounded-[4px] data-[state=checked]:bg-secondary"}),e.label&&(0,a.jsx)(E.FormLabel,{children:e.label})]})}),(0,a.jsx)(E.FormMessage,{})]})});if("tel"===e.type)return(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:t})=>
2(0,a.jsxs)(E.FormItem,{required:e.required,className:(0,d.cn)("min-h-[56px] rounded-md border focus-within:border-primary",e.className?.wrapper),children:[(0,a.jsx)(E.FormControl,{className:"min-h-[56px]",children:(0,a.jsx)(P.PhoneInputField,{placeholder:e.placeholder,type:e.type,...t,disabled:e.isDisabled,"aria-disabled":e.isDisabled,className:(0,d.cn)("rounded-md bg-input","ea-phone-input__wrapper"),inputClassName:(0,d.cn)("bg-input"),inputStyle:{height:"54px",width:"100%",borderEndEndRadius:"40px",borderStartEndRadius:"40px",border:"none",fontSize:"16px",lineHeight:"20px"},countrySelectorStyleProps:{buttonClassName:"bg-input",buttonStyle:{height:"54px",width:"80px",borderStartStartRadius:"40px",borderEndStartRadius:"40px",paddingLeft:"12px",border:"none"}}})}),e.description&&(0,a.jsx)("p",{className:"ml-3 h-5 py-1 text-[12px] text-sm leading-4 text-muted-foreground",children:e.description}),(0,a.jsx)(E.FormMessage,{})]})});if("checkbox-group"===e.type){if(!e.options)throw Error("CheckboxGroup type requires options prop");return(0,a.jsx)("div",{className:"flex flex-col gap-4",children:(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:t})=>(0,a.jsxs)(E.FormItem,{required:e.required,className:"flex flex-col gap-4",children:[e.options?.map?.(r=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(T.Checkbox,{id:r.value.toString(),value:r.value,checked:t.value.includes(r.value),onCheckedChange:t.onChange,disabled:e.isDisabled,className:"rounded-[4px] data-[state=checked]:bg-secondary"}),(0,a.jsx)(I.Label,{className:"cursor-text select-none",htmlFor:r.value.toString(),children:r.label})]},r.value)),(0,a.jsx)(E.FormMessage,{})]})})})}return"date"===e.type?(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:t,fieldState:r})=>{let c=r.error;return(0,a.jsxs)(E.FormItem,{className:"relative min-h-[56px]",children:[(0,a.jsx)(E.FormControl,{children:(0,a.jsxs)(M.Popover,{open:s,onOpenChange:l,children:[(0,a.jsx)(M.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(n.Button,{variant:"outline",type:"button",className:(0,d.cn)("h-[56px] w-full justify-start rounded-md border border-border bg-input p-3 pl-10 text-left text-base font-normal !normal-case hover:bg-primary/40",!t.value&&"text-foreground/50",c&&"border-destructive text-destructive"),disabled:e.isDisabled,children:[(0,a.jsx)(B.CalendarIcon,{className:"absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),t.value&&!isNaN(new Date(t.value))?(0,k.format)(new Date(t.value),"PPP",{locale:x}):e.placeholder||"Pick a date"]})}),(0,a.jsx)(M.PopoverContent,{side:"bottom",align:"start",className:"w-auto p-0",children:(0,a.jsx)(O.Calendar,{mode:"single",selected:t.value,onSelect:e=>{t.onChange(e),l(!1)},disabled:e.isDisabled,initialFocus:!0,fromYear:1920,toYear:new Date().getFullYear()+5})})]})}),e.description&&(0,a.jsx)("p",{className:"ml-3 h-5 py-1 text-[12px] text-sm leading-4 text-muted-foreground",children:e.description}),(0,a.jsx)(E.FormMessage,{})]})}}):"textarea"===e.type?(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:t})=>(0,a.jsxs)(E.FormItem,{required:e.required,className:(0,d.cn)("min-h-[56px]",e.label&&"flex flex-col items-start justify-start gap-3",e.className?.wrapper),children:[e.label&&(0,a.jsx)(I.Label,{className:"text-base font-bold text-foreground sm:text-lg",children:e.label}),(0,a.jsx)(E.FormControl,{className:"min-h-[56px]",children:(0,a.jsx)(z.Textarea,{id:e.name,placeholder:e.placeholder,...t,disabled:e.isDisabled,"aria-disabled":e.isDisabled,rows:8,className:(0,d.cn)("w-full rounded-lg border border-border bg-input p-5 text-base",o&&"border-destructive text-destructive",e.className?.wrapper)})}),e.description&&(0,a.jsx)("p",{className:"ml-3 h-5 py-1 text-[12px] text-sm leading-4 text-muted-foreground",children:e.description}),(0,a.jsx)(E.FormMessage,{})]})}):(0,a.jsx)(E.FormField,{control:e.control,name:e.name,render:({field:t})=>(0,a.jsxs)(E.FormItem,{className:"relative min-h-[56px]",children:[(0,a.jsx)(E.FormControl,{children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)(E.FormLabel,{htmlFor:e.name,className:(0,d.cn)("absolute left-5 top-4 z-[1] flex cursor-text select-none items-center gap-2 font-normal text-foreground
2/50 transition-all duration-100",t.value&&""!=t.value?"!top-[10px] text-xs":"text-base",o&&"text-destructive"),isRequired:!1,children:[e.labelIcon&&(0,a.jsx)("div",{className:(0,d.cn)("text-primary",t.value&&""!=t.value?"text-sm":"text-lg"),children:e.labelIcon}),`${e.label}${e.required?"*":""}`]}),(0,a.jsx)(L.Input,{id:e.name,type:e.type,...c&&{type:"text"},...t,disabled:e.isDisabled,"aria-disabled":e.isDisabled,placeholder:e.placeholder,className:{main:` 3 focus block w-full rounded-md border border-border bg-input p-3 pl-[26px] text-base 4 transition-all hover:outline-0 hover:ring-0 focus:ring-0 5 ${t.value&&""!=t.value?"pt-[30px]":""} 6 ${o&&"border-destructive text-destructive"} 7 `,wrapper:"h-[56px] bg-input"},after:"password"===e.type&&(0,a.jsx)(n.Button,{type:"button",variant:"ghost",size:"icon",className:o&&"text-destructive",onMouseDown:u,onMouseUp:m,onMouseLeave:m,onTouchStart:u,onTouchEnd:m,children:c?(0,a.jsx)(j.FiEyeOff,{}):(0,a.jsx)(j.FiEye,{})})})]})}),e.description&&(0,a.jsx)("p",{className:"ml-3 h-5 py-1 text-[12px] text-sm leading-4 text-muted-foreground",children:e.description}),(0,a.jsx)(E.FormMessage,{})]})})},[e.control,e.isDisabled,e.required,e.label,e.name,e.options,e.placeholder,e.type,e.description,e.labelIcon,e.className,r[e.name],c,s]);return(0,a.jsx)("div",{className:(0,d.cn)(e.className?.wrapper,"rounded-[28px]"),children:h})}var Y=e.i(150915),K=e.i(266027),$=e.i(801937);let W=()=>{let{t:e}=(0,i.useTranslations)(),[t,s]=(0,g.useState)(!1),l=(0,A.useFormContext)(),c=(0,U.useLocaleStore)(e=>e.currentLocale),o=(0,K.useQuery)({queryKey:[r.CacheKey.COUNTRIES,c],queryFn:()=>(0,$.fetchCountries)({locale:c,query:{results:999}})}),n=o.data?.data.map(e=>({value:e.id,label:e.name}));return(0,a.jsxs)("div",{className:(0,d.cn)("min-h-[300px] rounded-lg border border-border p-4 md:p-8","ea-calculator-summary-form"),children:[(0,a.jsx)("h2",{className:(0,d.cn)("text-2xl font-bold md:text-3xl","ea-calculator-summary-form__title"),children:e("text360")}),(0,a.jsx)("p",{className:(0,d.cn)("my-6 text-sm text-gray-400 md:text-lg","ea-calculator-summary-form__description"),children:e("text1365")}),(0,a.jsxs)("div",{className:(0,d.cn)("grid grid-cols-2 gap-4","ea-calculator-summary-form__fields"),children:[(0,a.jsxs)("div",{className:"col-span-2 flex gap-2 py-1 sm:py-2",children:[(0,a.jsx)("h4",{className:(0,d.cn)("font-semibold transition-colors duration-100 sm:text-lg",!t&&"text-primary"),children:e("text156")}),(0,a.jsx)(Y.Switch,{classNames:{wrapper:(0,d.cn)("sm:h-7 sm:w-14","data-[state=checked]:bg-primary data-[state=unchecked]:bg-primary"),thumb:(0,d.cn)("sm:h-6 sm:w-6 bg-white transition-all duration-300 ease-in-out","sm:data-[state=checked]:translate-x-7")},checked:t,onCheckedChange:e=>{s(e),l.setValue("is_company",e)}}),(0,a.jsx)("h4",{className:(0,d.cn)("font-semibold transition-colors duration-100 sm:text-lg",t&&"text-primary"),children:e("text200")})]}),(0,a.jsx)("h3",{className:(0,d.cn)("col-span-2 text-lg font-bold md:text-2xl","ea-calculator-summary-form__subtitle"),children:t?e("text200"):e("text156")}),!t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"col-span-2 md:col-span-1",children:(0,a.jsx)(G,{control:l.control,name:"name",label:e("text33"),required:!0})}),(0,a.jsx)("div",{className:"col-span-2 md:col-span-1",children:(0,a.jsx)(G,{control:l.control,name:"surname",label:e("text34"),required:!0})})]}),t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,name:"company",label:e("text328")})}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,name:"ico",label:e("text42")})}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,name:"dic",label:e("text43")})}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,name:"ic_dph",label:e("text44")})})]}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,name:"phone",label:e("text36"),required:!0})}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,name:"email",label:e("text35"),required:!0})}),(0,a.jsxs)("div",{className:"col-span-2 grid grid-cols-1 gap-4 sm:grid-cols-12",children:[(0,a.jsx)("div",{className:"col-span-1 sm:col-span-6",children:(0,a.jsx)(G,{control:l.control,name:"address",label:e("text157")})}),(0,a.jsx)("div",{className:"col-span-1 sm:col-span-6",children:(0,a.jsx)(G,{control:l.control,name:"street_number",label:e("text438")})}),(0,a.jsx)("div",{className:"col-span-1 sm:col-span-8",children:(0,a.jsx)(G,{control:l.control,name:"city",label:e("text39")})}),(0,a.jsx)("div",{className:"col-span-1 sm:col-span-4",children:(0,a.jsx)(G,{control:l.control,name:"postcode",label:e("text40")}
7)})]}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,name:"country.id",label:e("text519"),placeholder:e("text904"),type:"select",options:n||[]})}),(0,a.jsx)("h3",{className:(0,d.cn)("col-span-2 mt-4 text-lg font-bold md:text-2xl","ea-calculator-summary-form__subtitle"),children:e("text1366")}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,name:"place_of_execution",label:e("text1138"),required:!0})}),(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(G,{control:l.control,type:"date",name:"max_contact_date",placeholder:e("text1354")})}),(0,a.jsx)("div",{className:(0,d.cn)("col-span-2",""),children:(0,a.jsx)(G,{control:l.control,name:"note",type:"textarea",label:e("text57"),className:{wrapper:"h-[128px]"}})}),(0,a.jsxs)("div",{className:"col-span-2 mt-4",children:[(0,a.jsx)(E.FormField,{control:l.control,name:"gdpr",render:({field:t})=>(0,a.jsxs)(E.FormItem,{className:(0,d.cn)("col-span-12 flex items-center gap-2","ea-contact-form__gdpr-checkbox-item ea-contact-form__checkbox-item"),children:[(0,a.jsx)(E.FormControl,{children:(0,a.jsx)(T.Checkbox,{ref:t.ref,name:t.name,disabled:t.disabled,checked:t.value,onCheckedChange:t.onChange,className:(0,d.cn)("rounded-[4px]","ea-calculator-summary-form__gdpr-checkbox",l.formState.errors.gdpr&&"border border-destructive")}
7)}),(0,a.jsxs)(E.FormLabel,{className:(0,d.cn)("","ea-calculator-summary-form__gdpr-checkbox-label"),children:[e("text613")," ",(0,a.jsx)("span",{className:(0,d.cn)("text-primary",l.formState.errors.gdpr&&"text-destructive-foreground"),children:e("text614")})]})]})}),l.formState.errors.gdpr&&(0,a.jsx)("div",{className:"mt-1 pl-9 text-sm text-destructive",children:l.formState.errors.gdpr.message})]})]})]})};var Q=e.i(143103);let H=({productsEstimated:e})=>{let t=(0,U.useLocaleStore)(e=>e.currentLocale),{t:r}=(0,i.useTranslations)(),s=(0,Q.useGlobalStore)(e=>e.generalLayout.currency),[l,c]=(0,g.useState)(!1),o=(0,A.useFormContext)(),u=async()=>{c(!0);try{let e=new URL("/store/calculator/pdf","https://api.cobak.sk").toString(),a=o.getValues("is_company"),r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/pdf",Locale:t},body:JSON.stringify({...!a&&{name:o.getValues("name"),surname:o.getValues("surname")},...a&&{company:o.getValues("company"),ico:o.getValues("ico"),dic:o.getValues("dic"),ic_dph:o.getValues("ic_dph")},address:o.getValues("address"),street_number:o.getValues("street_number"),city:o.getValues("city"),postcode:o.getValues("postcode")}),credentials:"include"});if(!r.ok){console.error("Failed to fetch PDF:",r.statusText),c(!1);return}let s=await r.arrayBuffer(),l=new Blob([s],{type:"application/pdf"}),n=window.URL.createObjectURL(l),i=document.createElement("a");i.href=n,i.download="calculator-estimate.pdf",document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n),c(!1)}catch(e){console.error("Error downloading PDF:",e),c(!1)}},p=e.data.reduce((e,t)=>e+t.total_price_with_vat,0).toFixed(2);return(0,a.jsxs)("div",{className:(0,d.cn)("flex flex-col gap-6 rounded-lg border border-border bg-[#F7F7F7] p-4 md:p-8","ea-calculator-summary-summary"),children:[(0,a.jsxs)("div",{className:(0,d.cn)("flex flex-col gap-2","ea-calculator-summary-summary__products"),children:[e.data.map((e,t)=>(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[!!t&&(0,a.jsx)(m.Separator,{className:"bg-border/70 px-1"}),(0,a.jsxs)("div",{className:(0,d.cn)("flex w-full justify-between","ea-calculator-summary-summary__product"),children:[(0,a.jsx)("h2",{className:(0,d.cn)("text-sm font-bold md:text-lg","ea-calculator-summary-summary__product-name"),children:e.name}),(0,a.jsxs)("h2",{className:(0,d.cn)("text-sm font-bold md:text-lg","ea-calculator-summary-summary__product-price"),children:[e.price_before_service_with_vat," ",s]})]}),!!e.services.length&&(0,a.jsx)("div",{children:e.services.map(e=>(0,a.jsxs)("div",{className:(0,d.cn)("flex w-full justify-between","ea-calculator-summary-summary__service"),children:[(0,a.jsx)("h2",{className:(0,d.cn)("text-xs font-semibold md:text-lg","ea-calculator-summary-summary__service-name"),children:e.name}),(0,a.jsxs)("h2",{className:(0,d.cn)("text-xs font-semibold md:text-lg","ea-calculator-summary-summary__service-price"),children:[e.price_with_vat," ",s]})]},e.id))})]},e.id)),(0,a.jsx)(m.Separator,{className:""})]}),(0,a.jsxs)("div",{className:(0,d.cn)("flex w-full justify-between","ea-calculator-summary-summary__total"),children:[(0,a.jsx)("h2",{className:(0,d.cn)("text-xl font-bold md:text-2xl","ea-calculator-summary-summary__total-title"),children:r("text26")}),(0,a.jsxs)("h2",{className:(0,d.cn)("text-xl font-bold md:text-2xl","ea-calculator-summary-summary__total-price"),children:[p," ",s]})]}),(0,a.jsx)(m.Separator,{className:""}),(0,a.jsxs)("div",{className:(0,d.cn)("flex flex-col gap-3","ea-calculator-summary-summary__actions"),children:[(0,a.jsx)(n.Button,{className:(0,d.cn)("h-20 w-full md:px-12 md:py-4","ea-calculator-summary-summary__submit"),children:r("text1368")}),(0,a.jsx)(n.Button,{type:"button",className:(0,d.cn)("w-full gap-3 border-primary","ea-calculator-summary-summary__download"),variant:"outline",onClick:u,disabled:l,children:l?(0,a.jsx)(w.Spinner,{className:"text-primary"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j.FiDownload,{}),r("text1369")]})})]})]})};var J=e.i(266058),X=e.i(563701),Z=e.i(994836),ee=e.i(236953),et=e.i(994814),ea=e.i(618566),er=e.i(681307);let es=()=>{let{t:e}=(0,i.useTranslations)(),t=(0,U.useLocaleStore)(e=>e.currentLocale),{formValidationMessages:l}=(0,ee.useFormValidationMessages)(e),c=(0,ea.useRouter)(),{executeRecaptcha:o}=(0,J.useRecaptcha)(),n=(0,A.useForm)({resolver:(0,et.zodResolver)(er.z.object({name:er.z.string().min(1,l.CANT_BE_EMPTY_VALIDATION_MESSAGE()),surname:er.z.string().min(1,l.CANT_BE_EMPTY_VALIDATION_MESSAGE()),company:er.z.string().optional(),ico:er.z.string().optional(),dic:er.z.string().optional(),ic_dph:er.z.string().optional(),email:er.z.string().email(l.EMAIL_INVALID_VALIDATION_MESSAGE()),phone:er.z.string().min(12,l.CANT_BE_EMPTY_PHONE_VALIDATION_MESSAGE()),address:er.z.string().optional(),street_number:er.z.string().optional(),city:er.z.string().optional(),postcode:er.z.string().optional(),place_of_execution:er.z.string().min(1,l.CANT_BE_EMPTY_VALIDATION_MESSAGE()),note:er.z.string().optional(),max_contact_date:er.z.date().optional(),is_company:er.z.boolean().optional(),country:er.z.any().optional(),gdpr:er.z.boolean().default(!1).refine(e=>!0===e,{message:l.GDPR_VALIDATION_MESSAGE()})}).superRefine((e,t)=>
7{e.is_company?e.company&&""!==e.company.trim()||t.addIssue({code:"custom",path:["company"],message:l.CANT_BE_EMPTY_VALIDATION_MESSAGE()}):(e.name&&""!==e.name.trim()||t.addIssue({code:"custom",path:["name"],message:l.CANT_BE_EMPTY_VALIDATION_MESSAGE()}),e.surname&&""!==e.surname.trim()||t.addIssue({code:"custom",path:["surname"],message:l.CANT_BE_EMPTY_VALIDATION_MESSAGE()}))})),defaultValues:{is_company:!1,name:"",surname:"",company:"",ico:"",dic:"",ic_dph:"",email:"",phone:"",address:"",street_number:"",city:"",postcode:"",place_of_execution:"",country:{id:void 0},note:"",gdpr:!1}}),{data:u,isLoading:m}=(0,K.useQuery)({queryKey:[r.CacheKey.CALCULATOR_ESTIMATE,t],queryFn:()=>(({locale:e})=>(0,s.fetchData)({uri:"/store/calculator/estimate",method:"GET",locale:e}))({locale:t}),refetchOnWindowFocus:!1}),{toast:p}=(0,X.useToast)();if(m)return(0,a.jsx)("div",{className:"flex min-h-[400px] w-full items-center justify-center",children:(0,a.jsx)(w.Spinner,{className:"h-12 w-12 sm:h-20 sm:w-20"})});if(!u)return(0,a.jsx)("div",{children:"Price estimation error"});let x=n.handleSubmit(async a=>{try{let r;o&&(r=await o(J.CaptchaAction.CALCULATOR_ORDER));let l={...a,max_contact_date:a.max_contact_date?.toISOString()||void 0,"g-recaptcha-response":r};(({locale:e,body:t})=>(0,s.fetchData)({uri:"/store/calculator",method:"POST",locale:e,body:t}))({locale:t,body:l}).then(t=>{p({title:e("text1372"),variant:"success"}),c.push(Z.ROUTES.ORDER_CONFIRM())})}catch(e){}},t=>{t.gdpr&&p({title:e("text2095"),description:t.gdpr.message,variant:"destructive"})});return(0,a.jsx)(A.FormProvider,{...n,children:(0,a.jsxs)("form",{onSubmit:x,className:(0,d.cn)("grid w-full grid-cols-1 gap-4 md:grid-cols-10 md:gap-8","ea-calculator-summary__form"),children:[(0,a.jsx)("div",{className:(0,d.cn)("md:col-span-6","ea-calculator-summary__form-container"),children:(0,a.jsx)(W,{})}),(0,a.jsx)("div",{className:(0,d.cn)("md:col-span-4","ea-calculator-summary__form-summary"),children:(0,a.jsx)(H,{productsEstimated:u})})]})})};var el=((t={})[t.SELECT_PRODUCT=0]="SELECT_PRODUCT",t[t.SELECT_PRODUCT_ATTRIBUTES=1]="SELECT_PRODUCT_ATTRIBUTES",t[t.SUMMARY=2]="SUMMARY",t);let ec=()=>{let e=(0,U.useLocaleStore)(e=>e.currentLocale),[t,c]=(0,g.useState)([]),[n,i]=(0,g.useState)(0),[m,p]=(0,g.useState)(t[0]),[x,h]=(0,g.useState)([]),[b,f]=(0,g.useState)(!1),{data:j}=(0,K.useQuery)({queryKey:[r.CacheKey.PRODUCTS_WITH_ATTRIBUTES,e,t.map(e=>e.id)],queryFn:()=>l({locale:e,products:t}),refetchOnWindowFocus:!1,enabled:0!==n}),[v,_]=(0,g.useState)(),{data:y,isLoading:N}=(0,K.useQuery)({queryKey:[r.CacheKey.ADVISORIES_CATEGORIES,e],queryFn:()=>(({locale:e})=>(0,s.fetchData)({uri:"/store/calculator/products",method:"GET",locale:e}))({locale:e}),refetchOnWindowFocus:!1}),{isLoading:C}=(0,K.useQuery)({queryKey:[r.CacheKey.CALCULATOR,e],queryFn:()=>(({locale:e})=>(0,s.fetchData)({uri:"/store/calculator",method:"GET",locale:e}))({locale:e}).then(e=>{if(!y)return;let t=e.data.map(e=>e.id);c(y.data.filter(e=>t.includes(e.id))),h(e.data),t.length>0&&!b&&i(1)}),refetchOnWindowFocus:!1,enabled:!!y});(0,g.useEffect)(()=>{j&&_(e=>{let t=new Map(j.map?.(e=>[e.id,e])),a=e?.filter?.(e=>t.has?.(e.id))??[],r=new Map(a.map?.(e=>[e.id,e])),s=j.map?.(e=>{let t=r.get?.(e.id);if(t){let a=e.attributes.map?.(e=>{let a=t.attributes.find?.(t=>t.id===e.id);if(a){let t=e.values.map?.(e=>{let t=a.values.find?.(t=>t.id===e.id);return t?{...e,selected:t.selected}:e});return{...e,values:t}}let r=e.values.map?.((e,t)=>({...e,selected:0===t}));return{...e,values:r}});return{...e,attributes:a}}let a=x.find(t=>t.id===e.id);if(a){let t=e.attributes.map(e=>{let t=e.values.map(e=>({...e,selected:a.values.some(t=>t.id===e.id)}));return{...e,values:t}});return{...e,attributes:t}}let s=e.attributes.map?.(e=>{let t=e.values.map((e,t)=>({...e,selected:0===t}));return{...e,values:t}});return{...e,attributes:s}});return f(!0),s})},[j,x,b,t]),(0,g.useEffect)(()=>{if(void 0===v)return;let a=t.map(e=>e.id);o({locale:e,products:v.filter(e=>a.includes(e.id))})},[e,v,t]),(0,g.useEffect)(()=>{p(t[0])},[t]);let T=(e,t,a)=>{_(r=>{if(r)return r.map(r=>{if(r.id===e){let e=r.attributes.map(e=>{if(e.id===t){let t=e.values.map(e=>({...e,selected:e.id===a}));return{...e,values:t}}return e});return{...r,attributes:e}}return r})})},E=e=>{c(t=>[...t,e])},A=e=>{c(t=>t.filter(t=>t.id!==e.id))},L=async()=>{1===n?v&&o({locale:e,products:v}).then(()=>{i(2)}
7).catch():2!==n&&i(e=>e+1)},I=()=>{0!==n&&i(e=>e-1)};return(0,a.jsxs)("div",{className:(0,d.cn)("w-full","ea-online-price-calculator-form-wrapper"),children:[!C&&(0,a.jsx)("div",{className:(0,d.cn)("flex min-h-[400px]","ea-online-price-calculator-component-wrapper"),children:(()=>{switch(n){case 0:return(0,a.jsx)(F,{products:y?.data,isLoadingProducts:N,selectedProducts:t,addToSelectedProducts:E,removeFromSelectedProducts:A});case 1:return(0,a.jsx)(S,{products:t,selectedProductAttributes:m,setSelectedProductAttributes:p,selectedProductsWithAttributes:v,onProductRemove:A,onProductAdd:()=>I(),selectAttribute:T});case 2:return(0,a.jsx)(es,{})}})()}),C&&(0,a.jsx)("div",{className:"flex min-h-[400px] w-full items-center justify-center",children:(0,a.jsx)(w.Spinner,{className:"h-12 w-12 sm:h-20 sm:w-20"})}),(0,a.jsx)(u,{currentStep:n,nextStep:L,prevStep:I,disableNextButton:0===t.length})]})}}]); 8 9//# debugId=4d8ece9c-1786-adb6-4210-997ce21c2bda 10//# sourceMappingURL=015_kdfrh7e3l.js.map
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.