PageSourceSearch

https://www.munsterhuis.nl/_next/static/chunks/9007-2a481da55a1ce4cf.js

js munsterhuis.nl collected 2026-09-26 09:58:45 UTC 175,089 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9007],{0:e=>{e.exports={"finance-banner":"FinanceBanner_finance-banner__K2VZh","finance-banner__image":"FinanceBanner_finance-banner__image__5T44S"}},577:e=>{e.exports={progress:"FormProgress_progress___Gpg8",progress__track:"FormProgress_progress__track__Q9rxw",progress__bar:"FormProgress_progress__bar__hKv9L",progress__steps:"FormProgress_progress__steps__gwN59",step:"FormProgress_step__gOTsY",step__title:"FormProgress_step__title__a89lf",step__status:"FormProgress_step__status__lvYHh",step__icon:"FormProgress_step__icon__veMZ9","step--active":"FormProgress_step--active__Pp35U","step--completed":"FormProgress_step--completed__g0hio"}},1246:e=>{e.exports={field:"FormFieldFinanceCalculator_field__0SIHQ",field__label:"FormFieldFinanceCalculator_field__label__VBNpn",field__list:"FormFieldFinanceCalculator_field__list__qh4G4",radio__label:"FormFieldFinanceCalculator_radio__label___JLSw",summary:"FormFieldFinanceCalculator_summary__vQlOp",summary__item:"FormFieldFinanceCalculator_summary__item__wodwk",summary__title:"FormField
1FinanceCalculator_summary__title__xlZG3",summary__value:"FormFieldFinanceCalculator_summary__value__SEOO7",summary__icon:"FormFieldFinanceCalculator_summary__icon__FAwwQ",divider:"FormFieldFinanceCalculator_divider__WfGZp","price-per-month":"FormFieldFinanceCalculator_price-per-month__0XUam","price-per-month__title":"FormFieldFinanceCalculator_price-per-month__title__QcNpO","price-per-month__value":"FormFieldFinanceCalculator_price-per-month__value__dE4Yc","price-per-month__vat":"FormFieldFinanceCalculator_price-per-month__vat__tVX2L",disclaimer:"FormFieldFinanceCalculator_disclaimer__dWErd"}},2397:(e,l,a)=>{"use strict";a.d(l,{A:()=>o});var t=a(95155),r=a(79121),n=a(31774),i=a.n(n);function o(e){let{children:l,className:a,...n}=e;return(0,t.jsx)("label",{className:(0,r.A)(i().label,a),...n,children:l})}},2533:e=>{e.exports={radio:"Radio_radio__D_Yrr",radio__field:"Radio_radio__field__DsxrV",radio__label:"Radio_radio__label__ske9s",radio__check:"Radio_radio__check__xWWIw",radio__dot:"Radio_radio__dot__QLE13",radio__title:"Radio_radio__title__bB6nG","radio--active":"Radio_radio--active__BEFcb","radio--disabled":"Radio_radio--disabled__Wq3wo","radio--error":"Radio_radio--error__5ffWn"}},3547:e=>{e.exports={collapse:"FormSummaryCollapse_collapse__gsipb","collapse--opened":"FormSummaryCollapse_collapse--opened__alZq7",collapse__toggle:"FormSummaryCollapse_collapse__toggle__9LQtw",collapse__icon:"FormSummaryCollapse_collapse__icon__TwxuO",collapse__title:"FormSummaryCollapse_collapse__title__3JRs0",collapse__collapse:"FormSummaryCollapse_collapse__collapse__jmWLb",collapse__content:"FormSummaryCollapse_collapse__content__8QQ7T"}},4611:e=>{e.exports={"license-plate":"InputLicensePlate_license-plate__brK2c","license-plate__field":"InputLicensePlate_license-plate__field__86qoZ"}},4762:e=>{e.exports={field:"FormFieldLeaseCalculator_field__11KUV",field__label:"FormFieldLeaseCalculator_field__label__BZCLG",field__list:"FormFieldLeaseCalculator_field__list__iwy8i",field__comment:"FormFieldLeaseCalculator_field__comment__Xm4vN","lease-info":"FormFieldLeaseCalculator_lease-info__YiKDC","lease-info__title":"FormFieldLeaseCalculator_lease-info__title__aTeva","lease-info__text":"FormFieldLeaseCalculator_lease-info__text__CG5dA","product-title":"FormFieldLeaseCalculator_product-title__A4vKL",radio__label:"FormFieldLeaseCalculator_radio__label__WFECH","price-per-month":"FormFieldLeaseCalculator_price-per-month__gCgPN","price-per-month__title":"FormFieldLeaseCalculator_price-per-month__title__VC07j","price-per-month__value":"FormFieldLeaseCalculator_price-per-month__value__Ws7kG","price-per-month__vat":"FormFieldLeaseCalculator_price-per-month__vat__ocsFy","quality-mark":"FormFieldLeaseCalculator_quality-mark__o53FE",disclaimer:"FormFieldLeaseCalculator_disclaimer__usj3P",divider:"FormFieldLeaseCalculator_divider__tWOgp","price-per-month__column":"FormFieldLeaseCalculator_price-per-month__column__q1t5o","price-per-month__excess-km":"FormFieldLeaseCalculator_price-per-month__excess-km__8LjIA"}},5519:(e,l,a)=>{"use strict";a.r(l),a.d(l,{default:()=>i});var t=a(95155),r=a(72346);let n=e=>["http:","https:","ftp:","ftps:","mailto:","tel:","#"].some(l=>{var a;return null==(a=null==e?void 0:e.startsWith(l))||a});function i(e){let{href:l,children:a,addWebspace:i=!1,...o}=e,{basePath:s}=(0,r.t)();return!n(l)&&i&&(l="".concat(s).concat(l).replace(/\/$/,"")),(0,t.jsx)("a",{href:l||"/",...o,children:a})}},5729:(e,l,a)=>{"use strict";a.d(l,{PageDataContextProvider:()=>i,Y:()=>o});var t=a(95155),r=a(12115);let n=r.createContext({});function i(e){let{children:l,pageFeatures:a=[]}=e,r=a.find(e=>{let{type:l}=e;return"vehicle"===l});return(0,t.jsx)(n.Provider,{value:{brand:null==r?void 0:r.brand,model:null==r?void 0:r.model,vehicleState:null==r?void 0:r.vehicleState},children:l})}let o=()=>(0,r.useContext)(n)},6094:(e,l,a)=>{"use strict";a.d(l,{A:()=>s});var t=a(95155),r=a(31695),n=a(79121),i=a(85402),o=a.n(i);function s(e){let{span:l={},order:a,className:i="",verticalAlignment:s,horizontalAlignment:c,style:u={},children:d}=e;return Object.entries(l).map(e=>{let[l,a]=e;u["--grid-column-".concat(l)]=a}),Object.entries(null!=a?a:{}).map(e=>{let[l,a]=e;u["--order-".concat(l)]=a}),(0,t.jsx)("div",{className:(0,n.A)(i,o()["blocks-column"],s?o()["blocks-column--vertical-align-".concat(s)]:"",c?o()["blocks-column--horizontal-align-".concat(c)]:""),style:u,children:(0,t.jsx)(r.ColumnAlignmentContextProvider,{horizontalAlignment:null!=c?c:"",verticalAlignment:null!=s?s:"",children:d})})}},6235:(e,l,a)=>{"use strict";a.d(l,{A:()=>s});var t=a(99028),r=a(73510),n=a(87403),i=a(7402),o=a(12115);function s(){let{form:e,steps:l,stepIndex:a,values:s,submitId:c}
1=(0,t.xW)(),u=(0,r.useFormVehicleContext)(),d=(0,n.ge)();return(0,o.useCallback)((t,r)=>{var n,o,m,_,p,v,h,f;if(!e)return;let{dataLayer:x={}}=e,b=[(0,i.fO)(u)].filter(Boolean).map((e,l)=>({...e,index:l})),g=[(0,i.aF)(d)].filter(Boolean).map((e,l)=>({...e,index:l})),y=c&&x.clientEmail?s[x.clientEmail]:null;window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"form",form_id:e.id,form_cta:null==r?void 0:r.toLowerCase(),form_name:e.name.toLowerCase(),form_step_name:c?"completed":null==(o=l[a])||null==(n=o.name)?void 0:n.toLowerCase(),form_step:c?"completed":"step-".concat(a+1),form_vp:"/form/".concat((null==(m=x.category)?void 0:m.toLowerCase())||"other","/").concat(e.name.toLowerCase(),"/").concat(c?"completed":"step-".concat(a+1)),form_category:(null==(_=x.category)?void 0:_.toLowerCase())||"other",form_priority:x.purchase?"primary":"secondary",form_type:t,...c?{submission_id:c}:null,...y?{client_email:y}:null,...b.length?{items:b}:null,...g.length?{jobs:g}:null}),c&&x.purchase&&window.dataLayer.push({event:"purchase",form_id:e.id,form_cta:null==r?void 0:r.toLowerCase(),form_name:e.name.toLowerCase(),form_step_name:c?"completed":null==(v=l[a])||null==(p=v.name)?void 0:p.toLowerCase(),form_step:"completed",form_vp:"/form/".concat((null==(h=x.category)?void 0:h.toLowerCase())||"other","/").concat(e.name.toLowerCase(),"/completed"),form_category:(null==(f=x.category)?void 0:f.toLowerCase())||"other",form_priority:x.purchase?"primary":"secondary",form_type:t,...c?{submission_id:c}:null,...y?{client_email:y}:null,...b.length?{items:b}:null,...g.length?{jobs:g}:null})},[e,l,a,s,c,u,d])}},7402:(e,l,a)=>{"use strict";function t(e){var l,a,t,r,n,i,o,s,c,u,d,m;let _=null!=(l=e.attributes)?l:{};return{job_id:null!=(a=e.externalId)?a:null,job_title:e.title,job_department:null!=(t=_.department)?t:null,job_category:null!=(r=_.category)?r:null,job_contract_type:null!=(n=_.employmentType)?n:null,job_location_country:null!=(i=_.locationCountry)?i:null,job_education_level:null!=(o=_.education)?o:null,job_experience_years:null!=(s=_.experience)?s:null,job_salary_min:null!=(c=_.salaryMin)?c:null,job_salary_max:null!=(u=_.salaryMax)?u:null,job_salary_currency:"EUR",job_posted_date:null!=(d=_.publishDate)?d:null,job_company:null!=(m=_.company)?m:null}}function r(e){let l;if(e.type){var a,t,r,n,i,o,s,c,u,d,m,_;Object.entries(l={job_id:null!=(a=e.externalId)?a:null,job_title:e.title,job_department:null!=(t=e.department)?t:null,job_category:null!=(r=e.category)?r:null,job_contract_type:null!=(n=e.employmentType)?n:null,job_location_city:null!=(i=e.locationCity)?i:null,job_location_country:null!=(o=e.locationCountry)?o:null,job_education_level:null!=(s=e.education)?s:null,job_experience_years:null!=(c=e.experience)?c:null,job_salary_min:null!=(u=e.salaryMin)?u:null,job_salary_max:null!=(d=e.salaryMax)?d:null,job_salary_currency:"EUR",job_posted_date:null!=(m=e.publishDate)?m:null,job_company:null!=(_=e.company)?_:null}).forEach(e=>{let[a,t]=e;(null==t||""===t)&&delete l[a]})}return l}function n(e){let l;if(e.type){var a,t,r,n,i,o,s,c,u,d,m,_,p,v,h,f,x,b,g,y,A,j,N,k,C,F,S,w;Object.entries(l={item_id:e.id,item_brand:null==(a=e.brand)?void 0:a.toLowerCase(),item_model:null==(t=e.model)?void 0:t.toLowerCase(),item_type:null==(r=e.edition)?void 0:r.toLowerCase(),item_license_plate:null==(n=e.licensePlate)?void 0:n.toLowerCase(),item_construction_year:e.constructionYear,item_fuel_type:null==(i=e.fuel)?void 0:i.toLowerCase(),item_stock_type:"",item_body:null==(o=e.body)?void 0:o.toLowerCase(),item_transmission:null==(s=e.transmission)?void 0:s.toLowerCase(),item_odometer_distance:e.mileage,item_color:null==(c=e.color)?void 0:c.toLowerCase(),item_online_date:null==(u=e.onlineDate)?void 0:u.toISOString(),item_condition:null==(d=e.vehicleState)?void 0:d.toLowerCase(),item_category:null==(m=e.vehicleType)?void 0:m.toLowerCase(),item_stock_status:null==(_=e.stockStatus)?void 0:_.toLowerCase(),sale_price:null==(v=e.prices)||null==(p=v.purchase)?void 0:p.value,catalog_price:null!=(w=null==(f=e.prices)||null==(h=f.purchase)?void 0:h.previousValue)?w:null==(b=e.prices)||null==(x=b.purchase)?void 0:x.value,private_finance_price:null==(y=e.prices)||null==(g=y.finance)?void 0:g.value,business_finance_price:null==(j=e.prices)||null==(A=j.businessFinance)?void 0:A.value,private_lease_price:null==(k=e.prices)||null==(N=k.privateLease)?void 0:N.value,business_lease_price:null==(F=e.prices)||null==(C=F.businessLease)?void 0:C.value,affiliation:null==(S=e.establishment)?void 0:S.toLowerCase(),currency:"EUR"}
1).forEach(e=>{let[a,t]=e;(null==t||""===t)&&delete l[a]})}return l}a.d(l,{aF:()=>r,aW:()=>t,fO:()=>n})},8778:(e,l,a)=>{"use strict";a.d(l,{LazyLoadingContextProvider:()=>i,R:()=>o});var t=a(95155),r=a(12115);let n=r.createContext(!0);function i(e){let{children:l,lazyLoading:a}=e;return(0,t.jsx)(n.Provider,{value:a,children:l})}let o=()=>(0,r.useContext)(n)},9856:(e,l,a)=>{"use strict";a.r(l),a.d(l,{default:()=>s});var t=a(95155),r=a(12115);function n(e){let{children:l,async:a,...n}=e,[i,o]=(0,r.useState)(!1),s=(0,r.useRef)(null);return((0,r.useEffect)(()=>{o(!0)},[]),(0,r.useEffect)(()=>{var e;if(!s.current)return;let l=document.createElement("script");l.text=s.current.innerHTML,Array.from(s.current.attributes).forEach(e=>{l.setAttribute(e.name,e.value)}),null==(e=s.current.parentNode)||e.replaceChild(l,s.current)},[i]),i)?(0,t.jsx)("script",{ref:s,...n,children:l}):null}var i=a(24089);let o=e=>{if(e instanceof i.Hg&&"script"===e.name&&"application/ld+json"!==e.attribs.type)return(0,t.jsx)(n,{...(0,i.$5)(e.attribs),children:(0,i.zd)(e.children,{replace:o})})};function s(e){let{html:l}=e;return(0,t.jsx)(t.Fragment,{children:(0,i.Ay)(l,{replace:o})})}},11287:(e,l,a)=>{"use strict";a.d(l,{A:()=>_});var t=a(95155),r=a(12115),n=a(79121),i=a(2397),o=a(15601),s=a(95415),c=a(50955),u=a(15140),d=a.n(u);let m=r.forwardRef((e,l)=>{let{id:a,active:u,value:m,label:_,disabled:p,error:v,loading:h=!1,icon:f,className:x,fieldClassName:b,loaderClassName:g,iconClassName:y,showError:A=!0,errorId:j,autoComplete:N,...k}=e,C=(0,r.useId)(),F=j||"".concat(a||C,"-error");return void 0===u&&(u=!!m),(0,t.jsxs)("div",{children:[_?(0,t.jsx)(i.A,{htmlFor:null!=a?a:C,children:_}):null,(0,t.jsxs)("div",{className:(0,n.A)(x,d().input,u?d()["input--active"]:"",p?d()["input--disabled"]:"",v?d()["input--error"]:""),children:[(0,t.jsx)("input",{ref:l,value:m,className:(0,n.A)(b,d().input__field),id:null!=a?a:C,disabled:p,autoComplete:N,"aria-invalid":!!v,"aria-errormessage":v?F:void 0,...k}),h?(0,t.jsx)(c.A,{className:(0,n.A)(g,d().input__loader)}):f?(0,t.jsx)(s.A,{icon:f,className:(0,n.A)(y,d().input__icon)}):null]}),v&&A?(0,t.jsx)(o.A,{id:F,children:v}):null]})});m.displayName="Input";let _=m},11937:e=>{e.exports={checkbox:"Checkbox_checkbox__Htffz",checkbox__field:"Checkbox_checkbox__field__y9_Eo",checkbox__label:"Checkbox_checkbox__label__i_WP8",checkbox__check:"Checkbox_checkbox__check__Wtmfi",checkbox__title:"Checkbox_checkbox__title__lXNrz","checkbox--active":"Checkbox_checkbox--active__G9VNb","checkbox--disabled":"Checkbox_checkbox--disabled__xB2J_","checkbox--error":"Checkbox_checkbox--error__wEC26"}},12432:e=>{e.exports={faq:"Faq_faq__4zGob",faq__item:"Faq_faq__item__5VlXy","faq__item--opened":"Faq_faq__item--opened__Yz_c_",faq__toggle:"Faq_faq__toggle__YxYcj",faq__icon:"Faq_faq__icon__KDnD9",faq__title:"Faq_faq__title__G6qzr",faq__collapse:"Faq_faq__collapse__vv9vd",faq__content:"Faq_faq__content__C6tC_"}},15140:e=>{e.exports={input:"Input_input__M0DKQ",input__field:"Input_input__field__8_ind",input__loader:"Input_input__loader__x6AYZ",input__icon:"Input_input__icon__yzefS","input--hover":"Input_input--hover__XsgtK","input--focus":"Input_input--focus__KJRs_","input--disabled":"Input_input--disabled__0ZLNM","input--error":"Input_input--error__rKA31"}},15183:(e,l,a)=>{"use strict";a.d(l,{A:()=>r});var t=a(95604);function r(){let e=(0,t.useFormatter)();return(l,a)=>e.number(l,{style:"currency",currency:"EUR",maximumFractionDigits:Number.isInteger(Number(l))?0:void 0,...a})}},15601:(e,l,a)=>{"use strict";a.d(l,{A:()=>i});var t=a(95155),r=a(91674),n=a.n(r);function i(e){let{id:l,children:a}=e;return(0,t.jsx)("div",{id:l,className:n().error,children:a})}},16522:(e,l,a)=>{"use strict";a.d(l,{A:()=>u});var t=a(95155),r=a(12115),n=a(79121),i=a(95415),o=a(11937),s=a.n(o);let c=r.forwardRef((e,l)=>{let{id:a,checked:o,label:c,disabled:u,error:d,showError:m,errorId:_,className:p,fieldClassName:v,labelClassName:h,checkClassName:f,iconClassName:x,titleClassName:b,icon:g="check",...y}=e,A=(0,r.useId)();return(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:(0,n.A)(p,s().checkbox,o?s()["checkbox--active"]:"",u?s()["checkbox--disabled"]:"",d?s()["checkbox--error"]:""),children:[(0,t.jsx)("input",{ref:l,className:(0,n.A)(v,s().checkbox__field),type:"checkbox",id:null!=a?a:A,checked:o,disabled:u,...y}),(0,t.jsxs)("label",{className:(0,n.A)(h,s().checkbox__label),htmlFor:null!=a?a:A,children:[(0,t.jsx)("span",{className:(0,n.A)(f,
1s().checkbox__check),children:(0,t.jsx)(i.A,{icon:g,className:(0,n.A)(x,s().checkbox__icon)})}),(0,t.jsx)("span",{className:(0,n.A)(b,s().checkbox__title),children:c})]})]})})});c.displayName="Checkbox";let u=c},17221:(e,l,a)=>{"use strict";a.d(l,{kt:()=>r,T4:()=>n});var t=a(89057);function r(){var e,l,a,r,n;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o={primary:new t.A(null!=(e=i.colorPrimary)?e:"#007AFC"),secondary:new t.A(null!=(l=i.colorSecondary)?l:"#090C9B"),tertiary:new t.A(null!=(a=i.colorTertiary)?a:"#EBEB00"),light:new t.A(null!=(r=i.colorLight)?r:"#FCFCFC"),dark:new t.A(null!=(n=i.colorDark)?n:"#293744"),black:new t.A("#000"),white:new t.A("#fff"),success:new t.A("#00C466"),error:new t.A("#E12304"),warning:new t.A("#FFC043"),accent:new t.A("#04BFE7")};return Object.entries(o).forEach(e=>{let[l,a]=e;for(let e=1;e<10;e+=1)Object.entries({white:o.white,black:o.black}).forEach(t=>{let[r,n]=t,i=a.mix(n,e/10,{space:"srgb"});Object.assign(o,{["".concat(l,"-").concat(10*e,"-").concat(r)]:i})})}),o}function n(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new t.A("#000"),a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new t.A("#fff");return Math.abs(e.contrast(a,"APCA"))<Math.abs(e.contrast(l,"APCA"))}a(33185)},18046:e=>{e.exports={disclosure:"SantanderFinanceDisclosure_disclosure__DmEzQ",disclosure__list:"SantanderFinanceDisclosure_disclosure__list__OYVlL",disclosure__row:"SantanderFinanceDisclosure_disclosure__row__AYQRm",disclosure__label:"SantanderFinanceDisclosure_disclosure__label__yo5cI",disclosure__value:"SantanderFinanceDisclosure_disclosure__value__HgH1G",disclosure__notice:"SantanderFinanceDisclosure_disclosure__notice__qdvxN"}},18247:e=>{e.exports={choice:"ChoiceSegmented_choice__4Lc2x",choice__label:"ChoiceSegmented_choice__label__xJKm4",choice__check:"ChoiceSegmented_choice__check__ikyC9",choice__title:"ChoiceSegmented_choice__title___cDhW","choice--active":"ChoiceSegmented_choice--active__Y0eB_","choice--error":"ChoiceSegmented_choice--error__kSyHr"}},18588:(e,l,a)=>{"use strict";a.d(l,{v8:()=>o,z:()=>i});var t=a(95155),r=a(12115);let n=r.createContext(null);function i(e){let{children:l,...a}=e;return(0,t.jsx)(n.Provider,{value:{...a},children:l})}let o=()=>(0,r.useContext)(n)},18704:e=>{e.exports={picture:"Picture_picture__5xgM8",picture__image:"Picture_picture__image__kmjsA"}},18904:(e,l,a)=>{"use strict";a.d(l,{A:()=>c});var t=a(95155),r=a(12115),n=a(11287),i=a(33070),o=a(95604);let s=r.forwardRef((e,l)=>{let{value:a,...r}=e,s=(0,o.useTranslations)();return(0,t.jsx)(i.HG,{getInputRef:l,customInput:n.A,decimalSeparator:s("decimal_separator"),thousandSeparator:s("thousand_separator"),value:a?Number(a):a,...r})});s.displayName="InputNumber";let c=s},19488:e=>{e.exports={"license-plate":"LicensePlate_license-plate__SiR82"}},22891:e=>{e.exports={block:"FormFieldVehicleAppraisal_block__JtCZx",loading:"FormFieldVehicleAppraisal_loading__YTsLe",loading__spinner:"FormFieldVehicleAppraisal_loading__spinner__bNTMk",spin:"FormFieldVehicleAppraisal_spin__KCqtm",bar:"FormFieldVehicleAppraisal_bar__TUMBs",slide:"FormFieldVehicleAppraisal_slide__L8VVW","bar--range":"FormFieldVehicleAppraisal_bar--range__5gmUx",bar__dot:"FormFieldVehicleAppraisal_bar__dot__eEkNF","bar__dot--from":"FormFieldVehicleAppraisal_bar__dot--from__lqevU","bar__dot--till":"FormFieldVehicleAppraisal_bar__dot--till__G7lsa",bar__label:"FormFieldVehicleAppraisal_bar__label__0Kusc",price:"FormFieldVehicleAppraisal_price__ry4jk",price__label:"FormFieldVehicleAppraisal_price__label__fO1hd",price__value:"FormFieldVehicleAppraisal_price__value__pqZ9s"}},23212:(e,l,a)=>{"use strict";a.d(l,{A:()=>u});var t=a(95155),r=a(12115),n=a(79121),i=a(35142),o=a(18247),s=a.n(o);let c=r.forwardRef((e,l)=>{let{as:a=i.A,checked:r,disabled:o,error:c,className:u,labelClassName:d,checkClassName:m,titleClassName:_,icon:p="check",...v}=e;return(0,t.jsx)(a,{ref:l,className:(0,n.A)(s().choice,r?s()["choice--active"]:"",o?s()["choice--disabled"]:"",c?s()["choice--error"]:"",u),labelClassName:(0,n.A)(s().choice__label,d),checkClassName:(0,n.A)(s().choice__check,m),titleClassName:(0,n.A)(s().choice__title,_),checked:r,disabled:o,error:c,icon:p,...v})});c.displayName="ChoiceSegmented";let u=c},27733:(e,l,a)=>{"use strict";a.d(l,{A:()=>
1o});var t=a(95155),r=a(79121),n=a(74718),i=a.n(n);function o(e){let{children:l,className:a}=e;return(0,t.jsx)("div",{className:(0,r.A)(i().container,a),children:l})}},29372:e=>{e.exports={icon:"Icon_icon__xxW96","icon--facebook":"Icon_icon--facebook__aEelF","icon--instagram":"Icon_icon--instagram__uJpaQ","icon--youtube":"Icon_icon--youtube__BifAO","icon--twitter":"Icon_icon--twitter__afEtf","icon--linkedin":"Icon_icon--linkedin__Tq4H2","icon--tiktok":"Icon_icon--tiktok__6Ou0q","icon--whatsapp":"Icon_icon--whatsapp__ZXuK1","icon-material":"Icon_icon-material__Y48Qx"}},31508:e=>{e.exports={form:"PortalLicensePlateChoice_form__mxCIt",choices:"PortalLicensePlateChoice_choices__JJJru","choice-title":"PortalLicensePlateChoice_choice-title__ToRr4"}},31695:(e,l,a)=>{"use strict";a.d(l,{ColumnAlignmentContextProvider:()=>i,o:()=>o});var t=a(95155),r=a(12115);let n=r.createContext({horizontalAlignment:"",verticalAlignment:""});function i(e){let{children:l,...a}=e;return(0,t.jsx)(n.Provider,{value:a,children:l})}let o=()=>(0,r.useContext)(n)},31774:e=>{e.exports={label:"Label_label__jQBTV"}},34139:(e,l,a)=>{"use strict";a.d(l,{A:()=>s});var t=a(95155),r=a(79121),n=a(86412),i=a(19488),o=a.n(i);function s(e){let{licensePlate:l="",className:a}=e;return(0,t.jsx)("div",{className:(0,r.A)(o()["license-plate"],a),children:(0,n.B)(l)})}},35142:(e,l,a)=>{"use strict";a.d(l,{A:()=>u});var t=a(95155),r=a(12115),n=a(79121),i=a(95415),o=a(2533),s=a.n(o);let c=r.forwardRef((e,l)=>{let{id:a,checked:o,label:c,disabled:u,error:d,className:m,fieldClassName:_,labelClassName:p,checkClassName:v,iconClassName:h,titleClassName:f,icon:x,...b}=e,g=(0,r.useId)();return(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:(0,n.A)(m,s().radio,o?s()["radio--active"]:"",u?s()["radio--disabled"]:"",d?s()["radio--error"]:""),children:[(0,t.jsx)("input",{ref:l,className:(0,n.A)(_,s().radio__field),type:"radio",id:null!=a?a:g,checked:o,disabled:u,...b}),(0,t.jsxs)("label",{className:(0,n.A)(p,s().radio__label),htmlFor:null!=a?a:g,children:[(0,t.jsx)("span",{className:(0,n.A)(v,s().radio__check),children:x?(0,t.jsx)(i.A,{icon:x,className:(0,n.A)(h,s().radio__icon)}):(0,t.jsx)("span",{className:(0,n.A)(h,s().radio__dot)})}),(0,t.jsx)("span",{className:(0,n.A)(f,s().radio__title),children:c})]})]})})});c.displayName="Radio";let u=c},35281:e=>{e.exports={container:"FormFieldCheckboxList_container__r0upN","container--checkbox-horizontal":"FormFieldCheckboxList_container--checkbox-horizontal__u2bMi","container--checkbox-vertical":"FormFieldCheckboxList_container--checkbox-vertical__L5GAE","container--checkbox-extended-horizontal":"FormFieldCheckboxList_container--checkbox-extended-horizontal__1wnRx","container--checkbox-extended-vertical":"FormFieldCheckboxList_container--checkbox-extended-vertical__Gnaoc"}},35706:(e,l,a)=>{"use strict";a.d(l,{B0:()=>c,Xp:()=>s,aG:()=>u,jE:()=>d});let t=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],r=e=>{let l=e.getFullYear(),a="".concat(e.getMonth()+1).padStart(2,"0"),t="".concat(e.getDate()).padStart(2,"0");return"".concat(l,"-").concat(a,"-").concat(t)},n=(e,l)=>{var a;let t=null!=(a=e.departments)?a:[];if(l){let e=t.filter(e=>e.type===l);if(e.length>0)return e}return t},i=(e,l)=>{var a,n;let i=t[l.getDay()],o=null==(a=e.regularOpeningTimes)?void 0:a[i],s=o?{closed:o.closed,windows:o.closed?[]:o.slots}:null,c=r(l);for(let l of null!=(n=e.alternativeOpeningTimes)?n:[])c>=l.fromDate&&c<=l.tillDate&&(s=l.closed?{closed:!0,windows:[]}:{closed:!1,windows:[{from:l.fromTime,till:l.tillTime}]});return s},o=e=>{let l=e.filter(e=>!e.closed).flatMap(e=>e.windows);return 0===l.length?{closed:!0,windows:[]}:{closed:!1,windows:[...l].sort((e,l)=>e.from<l.from?-1:+(e.from>l.from))}},s=(e,l,a)=>{if(!e)return null;let t=n(e,l);if(0===t.length)return null;let r=t.map(e=>i(e,a)).filter(e=>null!==e);return 0===r.length?null:o(r)},c=(e,l,a)=>{let t=s(e,l,a);return null===t||!t.closed},u=(e,l)=>e.some(e=>l>=e.from&&l<e.till),d=(e,l,a)=>{if(!e||0===e.length)return[];let r=t[l.getDay()];return e.map(e=>{var l,t;let n=null==(l=e.openingTimes)?void 0:l[r];if(!n)return null;let i=n.closed?[]:null!=(t=n.slots)?t:[{from:n.from,till:n.till}],o=i.find(e=>e.from&&e.till&&a>=e.from&&a<e.till);if(o)return{name:e.name,status:"open",closingTime:o.till};let s=i.filter(e=>e.from&&e.till&&a<e.from).sort((e,l)=>e.from<l.from?-1:+(e.from>l.from))[0];return s?{name:e.name,status:"opening-later",openingTime:s.from}:{name:e.name,status:"closed"}}).filter(e=>null!==e)}},39540:e=>{e.exports={field:"FormFieldMileage_field__4zhy5",field__info:"FormFieldMileage_field__info__n3QC3"}},40936:e=>{e.exports={button:"Button_button__mZH5u","button--full-width":"Button_button--full-width__y_Hur","button--square":"Button_button--square__KVDXz","button--primary":"Button_button--primary__WuF8Z","button--primary-outlined":"Button_button--primary-outlined__eizty","button--secondary":"Button_button--secondary__pwMfk","button--secondary-outlined":"Button_button--secondary-outlined__rvJhS","button--tertiary":"Button_button--tertiary___c3Y3","button--tertiary-outlined":"Button_button--tertiary-outlined__S7nX4","button--w
1hite":"Button_button--white__W7t6N","button--white-outlined":"Button_button--white-outlined__A5gM4","button--dark":"Button_button--dark__lk6K1","button--dark-outlined":"Button_button--dark-outlined__eZ2UY","button--ghost-10":"Button_button--ghost-10__0_R4c","button--transparent":"Button_button--transparent__KJGXl","button--highlight":"Button_button--highlight__A8ogB","button--highlight-outlined":"Button_button--highlight-outlined__J4Mlw","button--outlined":"Button_button--outlined__gwPZ4","button--sm":"Button_button--sm__RjOZ3","button--lg":"Button_button--lg__p4F1N",button__icon:"Button_button__icon__4OMZx",button__title:"Button_button__title__JiojJ",button__loader:"Button_button__loader__BRntx","button--loading":"Button_button--loading__5Cz00"}},41704:(e,l,a)=>{"use strict";a.d(l,{A:()=>u});var t=a(95155),r=a(12115),n=a(79121),i=a(11287),o=a(4611),s=a.n(o);let c=r.forwardRef((e,l)=>{let{className:a,fieldClassName:r,type:o="text",maxLength:c=8,...u}=e;return(0,t.jsx)(i.A,{ref:l,type:o,maxLength:c,className:(0,n.A)(s()["license-plate"],a),fieldClassName:(0,n.A)(s()["license-plate__field"],r),...u})});c.displayName="InputLicensePlate";let u=c},42425:(e,l,a)=>{"use strict";a.d(l,{A:()=>U});var t=a(95155),r=a(80560),n=a.n(r),i=a(79121),o=a(27733),s=a(12115),c=a(65890),u=a(60115),d=a(99028),m=a(84795),_=a(97176),p=a.n(_),v=a(9847),h=a(95604),f=a(76538),x=a.n(f),b=a(98804),g=a(51863),y=a(15183),A=a(81068),j=a(55120);function N(e){var l,a,r,n,o,s,c,u,m,_,p,f,N,k,C,F,S,w,q,T,P,E,I,L,O,M,V,B,D;let{field:{name:W,type:z,props:R}}=e,{values:Y,files:U}=(0,d.xW)(),H=(0,h.useTranslations)(),{params:K}=(0,b.f)(),{params:Q}=(0,g.K)(),{label:Z}=R,G=Y[W],J=[],X=(0,v.useFormatter)(),$=(0,y.A)(),ee=(0,A.A)();if(!G)return null;if("licensePlate"===z)(null==G?void 0:G.licensePlate)&&J.push({title:Z,value:G.licensePlate}),(null==G?void 0:G.brand)&&(null==G?void 0:G.model)&&(J.push({title:H("form.summary.brand"),value:G.brand}),J.push({title:H("form.summary.model"),value:G.model}));else if("address"===z)(null==G?void 0:G.postalCode)&&J.push({title:H("form.summary.postal_code"),value:G.postalCode}),(null==G?void 0:G.houseNumber)&&J.push({title:H("form.summary.house_number"),value:G.houseNumber}),(null==G?void 0:G.street)&&J.push({title:H("form.summary.street_name"),value:G.street}),(null==G?void 0:G.city)&&J.push({title:H("form.summary.city"),value:G.city});else if("financeCalculator"===z&&(null==G?void 0:G.calculatorType)==="santander"){let e=ee({...G,term:""===G.term||null==G.term?void 0:Number(G.term)});J.push(...e.map(e=>({title:e.label,value:e.value})))}else if("financeCalculator"===z)void 0!==(null==G?void 0:G.financeType)&&J.push({title:H("form.summary.finance_type"),value:H("form.finance_calculator.type.".concat(G.financeType))}),void 0!==(null==G?void 0:G.duration)&&J.push({title:H("form.summary.duration"),value:G.duration}),void 0!==(null==G?void 0:G.deposit)&&J.push({title:H("form.summary.deposit"),value:$(G.deposit)}),void 0!==(null==G?void 0:G.finalTerm)&&J.push({title:H("form.summary.final_term"),value:$(G.finalTerm)}),void 0!==(null==G?void 0:G.purchasePrice)&&J.push({title:H("form.summary.purchase_price"),value:$(G.purchasePrice)}),"businessFinance"===G.financeType&&void 0!==(null==G?void 0:G.vatAmount)&&"true"!==(0,j.A)("HIDE_FINANCE_CALCULATOR_VAT_AMOUNT")&&J.push({title:H("form.summary.vat_amount"),value:$(G.vatAmount)}),void 0!==(null==G?void 0:G.credit)&&J.push({title:H("form.summary.credit"),value:$(G.credit)}),void 0!==(null==G?void 0:G.totalPrice)&&J.push({title:H("form.summary.total_price"),value:$(G.totalPrice)}),void 0!==(null==G?void 0:G.interest)&&("finance"===G.financeType||"businessFinance"===G.financeType&&"true"!==(0,j.A)("HIDE_FINANCE_CALCULATOR_INTEREST"))&&J.push({title:H("form.summary.interest"),value:H("percent",{value:G.interest})}),void 0!==(null==G?void 0:G.pricePerMonth)&&J.push({title:(0,t.jsxs)(t.Fragment,{children:[H("form.summary.price_per_month"),"businessFinance"===G.financeType?(0,t.jsx)("span",{className:(0,i.A)(x().summary__vat),children:H("form.finance_calculator.summary.excluding_vat.business_finance")}):null]}),value:$(G.pricePerMonth)});else if("vehicleAppraisal"===z)(null==G?void 0:G.licensePlate)&&J.push({title:H("form.summary.license_plate"),value:G.licensePlate}),(null==G?void 0:G.brand)&&(null==G?void 0:G.model)&&(J.push({title:H("form.summary.brand"),value:G.brand}),J.push({title:H("form.summary.model"),value:G.model})),(null==G?void 0:G.mileage)&&J.push({title:H("form.summary.mileage"),value:X.number(G.mileage,{style:"unit",unit:"kilometer"})}),(null==G?void 0:G.priceIndication)&&"deliver_directly"===R.priceConfiguration&&J.push({title:H("form.summary.price_indication"),value:$(G.priceIndication)});else if("date"===z)J.push({title:Z,value:H("datetime",{value:new Date(G)},{dateTime:{datetime:{year:"numeric",month:"long",day:"numeric"}}})});else if("number"===z)J.push({title:Z,value:X.number(G)});else if("mileage"===z)J.push({title:Z,value:X.number(G,{style:"unit",unit:"kilometer"})});
1else if("groupedUploads"===z)R.uploads.forEach(e=>{var l;let a=null==(l=U[W])?void 0:l[e.name];a&&J.push({title:e.label,value:a.name})});else if("establishment"===z)J.push({title:Z,value:null!=(l=null==G?void 0:G.name)?l:""});else if("checkboxList"===z)(null==G?void 0:G.length)>0&&J.push({title:Z,value:null==G?void 0:G.join(", ")});else if("leaseCalculator"===z){(null==G?void 0:G.leaseType)&&J.push({title:H("form.summary.lease_type"),value:H("form.lease_calculator.type.".concat(G.leaseType))}),(null==G?void 0:G.duration)&&J.push({title:H("form.summary.duration"),value:X.number(G.duration,{style:"unit",unit:"month",unitDisplay:"long"})}),(null==G?void 0:G.mileage)&&J.push({title:H("form.summary.mileage_per_year"),value:X.number(G.mileage,{style:"unit",unit:"kilometer"})});let e=(null==G?void 0:G.calculatorType)==="vwpfsRunning";(null==G?void 0:G.ownRisk)&&J.push({title:H("form.summary.own_risk"),value:e?null!=(c=null==Q||null==(n=Q.ownRiskLevel)||null==(r=n.items)||null==(a=r.find(e=>String(e.value)===String(G.ownRisk)))?void 0:a.label)?c:"":null!=(u=null==K||null==(s=K.OwnRiskLevel)||null==(o=s.values[G.ownRisk])?void 0:o.text)?u:""}),(null==G?void 0:G.tyreProduct)&&J.push({title:H("form.summary.tyre_product"),value:e?null!=(k=null==Q||null==(p=Q.tireProduct)||null==(_=p.items)||null==(m
1=_.find(e=>String(e.value)===String(G.tyreProduct)))?void 0:m.label)?k:"":null!=(C=null==K||null==(N=K.TireProduct)||null==(f=N.values[G.tyreProduct])?void 0:f.text)?C:""}),(null==G?void 0:G.replacementVehicle)&&J.push({title:H("form.summary.replacement_vehicle"),value:e?null!=(P=null==Q||null==(w=Q.reliefVehicleProduct)||null==(S=w.items)||null==(F=S.find(e=>String(e.value)===String(G.replacementVehicle)))?void 0:F.label)?P:"":null!=(E=null==K||null==(T=K.ReliefVehicleProduct)||null==(q=T.values[G.replacementVehicle])?void 0:q.text)?E:""}),(null==G?void 0:G.province)&&J.push({title:H("form.summary.province"),value:e?null!=(B=null==Q||null==(O=Q.province)||null==(L=O.items)||null==(I=L.find(e=>String(e.value)===String(G.province)))?void 0:I.label)?B:"":null!=(D=null==K||null==(V=K.Province)||null==(M=V.values[G.province])?void 0:M.text)?D:""}),e&&(null==G?void 0:G.prePayment)&&J.push({title:H("form.summary.pre_payment"),value:$(G.prePayment)}),(null==G?void 0:G.price)&&J.push({title:(0,t.jsxs)(t.Fragment,{children:[H("form.summary.lease_price"),"businessLease"===G.leaseType?(0,t.jsx)("span",{className:(0,i.A)(x().summary__vat),children:H("form.lease_calculator.summary.excluding_vat.business_lease")}):null]}),value:$(G.price)}),(null==G?void 0:G.excessKmPrice)&&G.excessKmPrice>0&&J.push({title:H("form.summary.excess_km_price"),value:$(G.excessKmPrice)})}else if("event"===z){let e=Array.isArray(G)?G.map(e=>e.title).join(", "):null==G?void 0:G.title;e&&J.push({title:Z,value:e})}else"dateTimeOpeningHours"===z?((null==G?void 0:G.date)&&J.push({title:H("form.summary.date"),value:H("datetime",{value:new Date(G.date)},{dateTime:{datetime:{year:"numeric",month:"long",day:"numeric"}}})}),(null==G?void 0:G.time)&&J.push({title:H("form.summary.time"),value:G.time})):"checkbox"===z||J.push({title:Z,value:G});return(0,t.jsx)(t.Fragment,{children:J.map((e,l)=>(0,t.jsxs)("div",{className:(0,i.A)(x().summary__field),children:[(0,t.jsx)("p",{className:(0,i.A)(x()["summary__field-title"]),children:e.title}),(0,t.jsx)("p",{className:(0,i.A)(x()["summary__field-value"]),children:e.value})]},l))})}var k=a(73510),C=a(87403);function F(){var e,l,a;let{steps:r,stepIndex:n}=(0,d.xW)(),o=(0,k.useFormVehicleContext)(),s=(0,C.ge)(),c=(0,h.useTranslations)();return(0,t.jsxs)(t.Fragment,{children:[s.title?(0,t.jsxs)("div",{className:(0,i.A)(x().summary__item),children:[(0,t.jsx)("p",{className:(0,i.A)(x().summary__title),children:c("form.summary.vacancy")}),(0,t.jsx)("div",{className:(0,i.A)(x().vehicle__info),children:(0,t.jsxs)("p",{className:(0,i.A)(x().vehicle__title),children:[s.title,(0,t.jsx)("br",{}),s.locationCity]})})]}):null,o.brand?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,i.A)(x().summary__item),children:(0,t.jsxs)("div",{className:(0,i.A)(x().vehicle),children:[(0,t.jsxs)("div",{className:(0,i.A)(x().vehicle__info),children:[(0,t.jsxs)("p",{className:(0,i.A)(x().vehicle__title),children:[o.brand," ",o.model]}),(0,t.jsx)("p",{className:(0,i.A)(x().vehicle__text),children:o.edition})]}),o.image?(0,t.jsx)(m.A,{url:o.image.url,width:"100px",className:(0,i.A)(x().vehicle__media)}):null]})}),Object.entries(null!=(l=o.prices)?l:{}).filter(e=>{let[,l]=e;return null!==l.value}).length>0?(0,t.jsx)("div",{className:(0,i.A)(x().summary__item),children:(0,t.jsx)("div",{className:(0,i.A)(x().prices),children:Object.entries(null!=(a=o.prices)?a:{}).filter(e=>{let[,l]=e;return null!==l.value}).map(e=>{var l,a,r,n,s;let[u,d]=e;return(0,t.jsxs)("div",{className:(0,i.A)(x().price),children:[(0,t.jsxs)("span",{className:(0,i.A)(x().price__start),children:[(0,t.jsx)("span",{className:(0,i.A)(x().price__title),children:c("".concat(null!=(l=o.type)?l:"vehicle",".price.").concat(p()(u),".title"))}),null==(a=d.includingVat)||a?null:(0,t.jsx)("span",{className:(0,i.A)(x().price__vat),children:c("".concat(null!=(r=o.type)?r:"vehicle",".price.").concat(p()(u),".excluding_vat").concat("model"===o.type?".form_summary":""))})]}),(0,t.jsxs)("span",{className:(0,i.A)(x().price__end),children:[d.previousValue?(0,t.jsx)("span",{className:(0,i.A)(x()["price__previous-value"]),children:c("".concat(null!=(n=o.type)?n:"vehicle",".price.").concat(p()(u),".value"),{value:d.previousValue})}
1):null,(0,t.jsx)("span",{className:(0,i.A)(x().price__value),children:c("".concat(null!=(s=o.type)?s:"vehicle",".price.").concat(p()(u),".value"),{value:d.value})})]})]},u)})})}):null]}):null,null==r||null==(e=r.filter((e,l)=>l<=n))?void 0:e.map((e,l)=>(0,t.jsxs)("div",{className:(0,i.A)(x().summary__item),children:[(0,t.jsx)("p",{className:(0,i.A)(x().summary__title),children:e.name}),(0,t.jsx)("div",{className:(0,i.A)(x().summary__fields),children:e.fields.map((e,l)=>(0,t.jsx)(N,{field:e},l))})]},l))]})}var S=a(75598),w=a(95415),q=a(3547),T=a.n(q);function P(){let e=(0,h.useTranslations)(),[l,a]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:(0,i.A)(T().collapse,l?T()["collapse--opened"]:""),children:[(0,t.jsxs)("button",{type:"button",className:(0,i.A)(T().collapse__toggle),onClick:()=>a(!l),title:e("form.summary.collapse_title"),children:[(0,t.jsx)(w.A,{icon:"expand_more",className:(0,i.A)(T().collapse__icon)}),(0,t.jsx)("span",{className:(0,i.A)(T().collapse__title),children:e("form.summary.collapse_title")})]}),(0,t.jsx)(S.S,{isOpened:l,theme:{collapse:(0,i.A)(T().collapse__collapse),content:(0,i.A)(T().collapse__content)},children:(0,t.jsx)("div",{className:(0,i.A)(T().collapse__body),children:(0,t.jsx)(F,{})})})]})}var E=a(577),I=a.n(E);function L(){var e,l;let{steps:a,stepIndex:r,submitId:n,setStepIndex:o}=(0,d.xW)(),s=null==a?void 0:a.filter((e,l)=>l<=r||0===e.rules.length);return(null!=(e=null==s?void 0:s.length)?e:0)<2?null:(0,t.jsxs)("div",{className:(0,i.A)(I().progress),style:{"--steps":null!=(l=null==s?void 0:s.length)?l:1,"--active-step":r+1},children:[(0,t.jsx)("div",{className:(0,i.A)(I().progress__track),children:(0,t.jsx)("div",{className:(0,i.A)(I().progress__bar)})}),(0,t.jsx)("div",{className:(0,i.A)(I().progress__steps),children:null==s?void 0:s.map((e,l)=>{let a=n||l<r?"completed":l===r?"active":"todo";return(0,t.jsxs)("div",{className:(0,i.A)(I().step,I()["step--".concat(a)]),children:[(0,t.jsx)("span",{className:(0,i.A)(I().step__title),onClick:()=>l<r&&!n&&o(l),children:e.name}),(0,t.jsx)("div",{className:(0,i.A)(I().step__status),onClick:()=>l<r&&!n&&o(l),children:(0,t.jsx)(w.A,{icon:"check",className:(0,i.A)(I().step__icon)})})]},e.name)})})]})}var O=a(59317),M=a(72346),V=a(54805),B=a(88992),D=a(6235),W=a(61774),z=a.n(W),R=a(17221),Y=a(98463);function U(e){var l,a;let{open:r=!1,minStepIndex:m,maxStepIndex:_,close:p,resetOnClose:v=!0,type:f="overlay",cta:x=""}=e,b=(0,h.useTranslations)(),{config:g}=(0,M.t)(),y=(0,s.useId)(),{addItem:A,removeItem:N}=(0,B.L)(e=>({addItem:e.addItem,removeItem:e.removeItem})),{form:k,reset:C,stepIndex:S,submitId:w,setStepIndex:q}=(0,d.xW)(),T=(0,D.A)(),E=(0,R.kt)(null==g?void 0:g.style),I=null!=(a=null==g||null==(l=g.style)?void 0:l.modalHeaderBackgroundColor)?a:"primary-40-black",W=(0,R.T4)(E[I],E.dark,E.white)?"light":"dark";(0,s.useEffect)(()=>{r&&T(f,x)},[r,k,S,w]),(0,s.useEffect)(()=>()=>{N(y)},[]),(0,s.useEffect)(()=>{r?A(y):N(y)},[r]),(0,s.useEffect)(()=>{if(!r)return;window.location.hash="#step-".concat(S);let e=e=>{S>0?q(S-1):(U(),window.location.hash="#")};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)}},[S,r]);let U=()=>{C(v),void 0!==p&&p()};return(0,t.jsxs)(n(),{isOpen:r,onRequestClose:U,closeTimeoutMS:300,portalClassName:z()["form-overlay"],overlayClassName:{base:z()["form-overlay__overlay"],afterOpen:z()["form-overlay__overlay--open"],beforeClose:z()["form-overlay__overlay--closing"]},className:{base:z()["form-overlay__content"],afterOpen:z()["form-overlay__content--open"],beforeClose:z()["form-overlay__content--closing"]},bodyOpenClassName:null,children:[(0,t.jsxs)("div",{className:(0,i.A)(z()["form-overlay__header"]),children:[(0,t.jsxs)("div",{className:(0,i.A)(z()["form-overlay__header-top"]),children:[(0,t.jsx)(V.default,{className:(0,i.A)(z()["form-overlay__logo-image"]),src:"true"===(0,j.A)("APP_TEST_MODE")?
1"/placeholder.svg":(0,Y.I)
1("dark"===W?g.logoDarkBackgroundUrl:g.logoLightBackgroundUrl,{force_format:"original"}).href,alt:"Logo"}),(0,t.jsx)(u.default,{type:"button",theme:"ghost-10",title:b("modal.close"),size:"sm",icon:"close",showText:!1,onClick:U,className:(0,i.A)(z()["form-overlay__close"])})]}),(0,t.jsx)("div",{className:(0,i.A)(z()["form-overlay__header-content"]),children:(0,t.jsx)(L,{})})]}),(0,t.jsx)("div",{className:(0,i.A)(z()["form-overlay__body"]),children:(0,t.jsxs)(o.A,{children:[(0,t.jsx)(O.A,{className:(0,i.A)(z()["form-overlay__finance-banner"])}),(0,t.jsxs)("div",{className:(0,i.A)(z()["form-overlay__layout"]),children:[(0,t.jsxs)("div",{className:(0,i.A)(z()["form-overlay__panel"]),children:[(0,t.jsx)(O.A,{className:(0,i.A)(z()["form-overlay__finance-banner-mobile"])}),(0,t.jsx)("div",{className:(0,i.A)(z()["form-overlay__step"]),children:(0,t.jsx)(c.A,{minStepIndex:m,maxStepIndex:_,close:U})}),(0,t.jsx)("div",{className:(0,i.A)(z()["form-overlay__mobile-summary"]),children:(0,t.jsx)(P,{})})]}),(0,t.jsx)("div",{className:(0,i.A)(z()["form-overlay__sidebar"]),children:(0,t.jsxs)("div",{className:(0,i.A)(z()["form-overlay__desktop-summary"]),children:[(0,t.jsx)("p",{className:(0,i.A)("h5",z()["form-overlay__summary-title"]),children:b("form.summary.title")}),(0,t.jsx)("div",{children:(0,t.jsx)(F,{})})]})})]})]})})]})}n().setAppElement("body")},43216:(e,l,a)=>{"use strict";a.d(l,{Fd:()=>m,QO:()=>d,V0:()=>s,cf:()=>u});var t=a(12115),r=a(82496),n=a(21124),i=a(55120);let o=async e=>(0,r.A)().get("/vehicle/".concat(e,"/lease/default-params"),{}).then(e=>e.data).catch(()=>null);(0,t.cache)((0,n.unstable_cache)(o,["ponMobility","fetchCachedDefaultParams"],{revalidate:60}));let s=async(e,l,a,t,n,i,o)=>(0,r.A)().get("/vehicle/".concat(e,"/lease/calculate-price"),{params:{Duration:l,YearlyKm:a,OwnRiskLevel:t,TireProduct:n,ReliefVehicleProduct:i,Province:o}}).then(e=>e.data).catch(()=>null),c=async e=>(0,r.A)().get("/vehicle/".concat(e,"/lease/running-calculator/default-params"),{}).then(e=>e.data).catch(()=>null);(0,t.cache)((0,n.unstable_cache)(c,["vwpfsRunningCalculator","fetchCachedRunningCalculatorDefaultParams"],{revalidate:60}));let u=async(e,l,a,t,n,i,o,s)=>(0,r.A)().get("/vehicle/".concat(e,"/lease/running-calculator/calculate-price"),{params:{Duration:l,YearlyKm:a,TireProduct:t,ReliefVehicleProduct:n,Province:o,OwnRiskLevel:i,PrePayment:s}}).then(e=>e.data).catch(()=>null),d=async(e,l)=>(0,r.A)().get("/vehicle/".concat(e,"/lease/autotelex/calculator"),{params:{leasePriceType:l}}).then(e=>e.data).catch(()=>null),m=async e=>(0,r.A)().get("/v/".concat(e,"/lease"),{params:{project:(0,i.A)("DATAMOTIVE_PROJECT_ID")}}).then(e=>e.data).catch(()=>null)},43926:e=>{e.exports={"button--previous":"FormStep_button--previous__Qv6qM","recaptcha-disclaimer":"FormStep_recaptcha-disclaimer__ouO92"}},44155:(e,l,a)=>{"use strict";a.d(l,{default:()=>u});var t=a(95155),r=a(12115),n=a(75598),i=a(79121),o=a(95415),s=a(12432),c=a.n(s);function u(e){let{faqs:l}=e,[a,s]=(0,r.useState)(null),u=(0,r.useId)();return(0,t.jsx)("div",{className:(0,i.A)(c().faq),children:l.map((e,l)=>{let r=a===l;return(0,t.jsxs)("div",{className:(0,i.A)(c().faq__item,r?c()["faq__item--opened"]:""),children:[(0,t.jsxs)("button",{type:"button",className:(0,i.A)(c().faq__toggle),onClick:()=>s(r?null:l),title:e.title,"aria-expanded":r?"true":"false","aria-controls":"".concat(u,"-").concat(l),children:[(0,t.jsx)("span",{className:(0,i.A)(c().faq__title),children:e.title}),(0,t.jsx)(o.A,{icon:"expand_more",className:(0,i.A)(c().faq__icon)})]}),(0,t.jsx)(n.S,{isOpened:r,theme:{collapse:(0,i.A)(c().faq__collapse),content:(0,i.A)(c().faq__content)},children:(0,t.jsx)("div",{id:"".concat(u,"-").concat(l),className:(0,i.A)(c().faq__body),dangerouslySetInnerHTML:{__html:e.text}})})]},l)})})}},44318:e=>{e.exports={"rc-tooltip-toggle":"Tooltip_rc-tooltip-toggle__Tffx3","rc-tooltip-toggle--visible":"Tooltip_rc-tooltip-toggle--visible__pkSZd",tooltip:"Tooltip_tooltip__i_aQx"}},47541:(e,l,a)=>{"use strict";a.d(l,{A:()=>o});var t=a(95155),r=a(79121),n=a(65630),i=a.n(n);function o(e){let{error:l,children:a}=e;return(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:(0,r.A)(i().choices,l?i()["choices--error"]:""),children:a})})}},48806:e=>{e.exports={modal:"Modal_modal__eVTZW",modal__overlay:"Modal_modal__overlay__UyRnF","modal__overlay--open":"Modal_modal__overlay--open__r_3d2","modal__overlay--closing":"Modal_modal__overlay--closing__qatkh",modal__content:"Modal_modal__content__Tg5et","modal__content--open":"Modal_modal__content--open__FYtdH","modal__content--closing":"Modal_modal__content--closing__bfOHY",modal__header:"Modal_modal__header__CXfgn","modal__header-buttons":"Modal_modal__header-buttons__objDU","modal__header-content":"Modal_modal__header-content__EUpg4",modal__close:"Modal_modal__close__SHMnb",modal__body:"Modal_modal__body__34lGG","modal__sticky-buttons":"Modal_modal__sticky-buttons__2itKf",modal__footer:"Modal_modal__footer__nrMGx","modal--sm":"Modal_modal--sm__oMEdy","modal--lg":"Modal_modal--lg__akDvG"}},49055:(e,l,a)=>{"use strict";a.d(l,{A:()=>u});var t=a(95155),r=a(12115),n=a(79121),i=a(35142),o=a(66132),s=a.n(o);let c=r.forwardRef((e,l)=>{let{as:a=i.A,checked:r,disabled:o,error:c,className:u,labelClassName:d,checkClassName:m,icon:_,...p}=e;return(0,t.jsx)(a,{ref:l,className:(0,n.A)(s().choice,r?s()["choice--active"]:"",o?s()["choice--disabled"]:"",c?s()["choice--error"]:"",u),labelClassName:(0,n.A)(s().choice__label,d),checkClassName:(0,n.A)(s().choice__check,m),checked:r,disabled:o,error:c,icon:_,...p})});c.displayName="ChoiceExtended";let u=c},50955:(e,l,a)=>{"use strict";a.d(l,{A:()=>
1o});var t=a(95155),r=a(79121),n=a(66808),i=a.n(n);function o(e){let{className:l}=e;return(0,t.jsxs)("div",{className:(0,r.A)(i().loader,l),children:[(0,t.jsx)("div",{className:(0,r.A)(i().loader__dot)}),(0,t.jsx)("div",{className:(0,r.A)(i().loader__dot)}),(0,t.jsx)("div",{className:(0,r.A)(i().loader__dot)})]})}},51863:(e,l,a)=>{"use strict";a.d(l,{K:()=>o,VwpfsRunningCalculatorContextProvider:()=>i});var t=a(95155),r=a(12115);let n=r.createContext({});function i(e){let{children:l,params:a}=e;return(0,t.jsx)(n.Provider,{value:{params:a},children:l})}let o=()=>(0,r.useContext)(n)},52482:(e,l,a)=>{"use strict";a.d(l,{Ei:()=>u,Hf:()=>m,O5:()=>_,eD:()=>d,hc:()=>i,i_:()=>s,ld:()=>c,rM:()=>o});var t=a(12115),r=a(3369),n=a(82496);let i=async e=>(0,n.A)().get("/form/".concat(e),{}).then(e=>e.data).catch(()=>null);(0,t.cache)(i);let o=async(e,l,a,t,r,i,o,s)=>(0,n.A)().put("/form/".concat(e,"/submit"),{...l,dependencyData:a,webspaceKey:t,utm:r,recaptchaToken:s},{headers:{"accept-language":i,"x-dm-referrer":o}}).then(e=>Promise.resolve(e.data)).catch(e=>Promise.reject(e.response.data)),s=(e,l)=>{let a=new AbortController;return{promise:(0,n.A)().get("/form/".concat(e,"/vehicle"),{signal:a.signal,params:{licensePlate:l}}).then(e=>({status:"success",data:e.data})).catch(e=>r.A.isCancel(e)?{status:"cancel",data:null}:{status:"error",data:null}),controller:a}},c=(e,l,a)=>{let t=new AbortController;return{promise:(0,n.A)().get("/form/".concat(e,"/address"),{signal:t.signal,params:{postalCode:l,houseNumber:a}}).then(e=>({status:"success",data:e.data})).catch(e=>r.A.isCancel(e)?{status:"cancel",data:null}:{status:"error",data:null}),controller:t}},u=(e,l,a,t,i,o,s,c)=>{let u=new AbortController;return{promise:(0,n.A)().get("/form/".concat(e,"/finance"),{signal:u.signal,params:{purchasePrice:l,interest:a,duration:t,deposit:s,finalTerm:c,maxFinalTermPercentage:o,vatAmount:i}}).then(e=>({status:"success",data:e.data})).catch(e=>r.A.isCancel(e)?{status:"cancel",data:null}:{status:"error",data:null}),controller:u}},d=(e,l,a)=>{let t=new AbortController;return{promise:(0,n.A)().get("/form/".concat(e,"/vehicle-appraisal"),{signal:t.signal,params:{licensePlate:l,mileage:a}}).then(e=>({status:"success",data:e.data,message:void 0})).catch(e=>{var l,a,t;return r.A.isCancel(e)?{status:"cancel",data:null,message:void 0}:{status:"error",data:null,message:null!=(t=null==(a=e.response)||null==(l=a.data)?void 0:l.message)?t:null}}),controller:t}},m=async e=>(0,n.A)().get("/event/".concat(e,"/time-slot")).then(e=>e.data).catch(()=>{throw Error("Failed to fetch time slots")}),_=async e=>(0,n.A)().get(e).then(e=>e.data).catch(()=>({status:"UNKNOWN",amount:null}))},54478:e=>{e.exports={select:"Select_select__DOFfJ",select__field:"Select_select__field__hR88y",select__icon:"Select_select__icon__9LzIp","select--hover":"Select_select--hover__1MHMD","select--focus":"Select_select--focus__Fq_vg","select--disabled":"Select_select--disabled__MztRj","select--active":"Select_select--active__2FUIE","select--error":"Select_select--error__M4vCu"}},54805:(e,l,a)=>{"use strict";a.r(l),a.d(l,{default:()=>n});var t=a(95155),r=a(8778);function n(e){let{likelyLCP:l,alt:a="",...n}=e,i=(0,r.R)();return(0,t.jsx)("img",{...i?{loading:"lazy"}:{...l?{fetchPriority:"high"}:null},...n,alt:a})}},57495:(e,l,a)=>{"use strict";a.d(l,{A:()=>o});var t=a(95155),r=a(79121),n=a(70108),i=a.n(n);function o(e){let{children:l}=e;return(0,t.jsx)("div",{className:(0,r.A)(i().grid),children:l})}},59317:(e,l,a)=>{"use strict";a.d(l,{A:()=>i});var t=a(95155),r=a(99028),n=a(59707);function i(e){var l;let{className:a}=e,{form:i}=(0,r.xW)();return(null==i||null==(l=i.steps)?void 0:l.some(e=>{var l;return null==(l=e.fields)?void 0:l.some(e=>"financeCalculator"===e.type)}))?(0,t.jsx)("div",{className:a,children:(0,t.jsx)(n.default,{})}):null}},59707:(e,l,a)=>{"use strict";a.d(l,{default:()=>d});var t=a(95155),r=a(79121),n=a(55120),i=a(54805),o=a(98463),s=a(95604),c=a(0),u=a.n(c);function d(){let e=(0,s.useTranslations)();return(0,t.jsx)("div",{className:(0,r.A)(u()["finance-banner"]),children:(0,t.jsx)(i.default,{className:(0,r.A)(u()["finance-banner__image"]),src:(0,o.I)("".concat((0,n.A)("OBJECT_STORAGE_ENDPOINT"),"/shared/banners/afm_banner_1.svg"),{force_format:"original"}).href,alt:e("banners.afm_banner_alt"),loading:"lazy"})})}},60115:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>Button});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(95155),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(12115),_utilities_classNames__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(79121),_components_icons_Icon__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(95415),_components_links_Link__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(5519),_components_forms_FormOverlay__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(42425),_components_forms_Form__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(93760),_components_loaders_LoaderDots__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(50955),_services_formService__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(52482),_Button_module_scss__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(40936),_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(_Button_module_scss__WEBPACK_IMPORTED_MODULE_8__);function Button(param){let{title="",href,type,theme="primary",size="",target="_self",fullWidth=!1,className="",icon="east",showText=!0,showIcon=!0,onclick,onClick,formId,loading,disabled,addWebspace=!1,as=href?_components_links_Link__WEBPACK_IMPORTED_MODULE_3__.default:"button",customAttributes={}}=param,[form,setForm]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),[formOpen,setFormOpen]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[formLoading,setFormLoading]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),Tag=as,openForm=()=>{if(form)return void setFormOpen(!0);formId&&(setFormLoading(!0),(0,_services_formService__WEBPACK_IMPORTED_MODULE_7__.hc)(formId).then(e=>{setForm(e),setFormOpen(!0)}).finally(()=>{setFormLoading(!1)}))};return formLoading&&(loading=!0),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(Tag,{className:(0,_utilities_classNames__WEBPACK_IMPORTED_MODULE_9__.A)(_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default().button,_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default()["button--".concat(theme)],size?_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default()["button--".concat(size)]:"",fullWidth?_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default()["button--full-width"]:"",showText?"":_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default()["button--square"],loading?_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default()["button--loading"]:"",className),title,href,type,onClick,disabled,...onclick?{onClick:()=>eval(onclick)}:null,...formId?{onClick:()=>openForm()}:null,...href?{target,rel:"_blank"===target?"noreferrer noopener":"",addWebspace}:null,...customAttributes,children:[showText?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:(0,_utilities_classNames__WEBPACK_IMPORTED_MODULE_9__.A)(_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default().button__title),children:title}):null,showIcon?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_icons_Icon__WEBPACK_IMPORTED_MODULE_2__.A,{icon:icon,className:(0,_utilities_classNames__WEBPACK_IMPORTED_MODULE_9__.A)(_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default().button__icon)}):null,loading?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_loaders_LoaderDots__WEBPACK_IMPORTED_MODULE_6__.A,{className:(0,_utilities_classNames__WEBPACK_IMPORTED_MODULE_9__.A)(_Button_module_scss__WEBPACK_IMPORTED_MODULE_8___default().button__loader)}):null]}),formId&&form?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_forms_Form__WEBPACK_IMPORTED_MODULE_5__.A,{form:form,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_forms_FormOverlay__WEBPACK_IMPORTED_MODULE_4__.A,{open:formOpen,close:()=>setFormOpen(!1),cta:title})}):null]})}},61774:e=>{e.exports={"form-overlay":"FormOverlay_form-overlay__ot6Wq","form-overlay__overlay":"FormOverlay_form-overlay__overlay__GTJ5x","form-overlay__overlay--open":"FormOverlay_form-overlay__overlay--open__HBA6N","form-overlay__overlay--closing":"FormOverlay_form-overlay__overlay--closing__ELT3N","form-overlay__content":"FormOverlay_form-overlay__content__MS0fJ","form-overlay__content--open":"FormOverlay_form-overlay__content--open__ytrVN","form-overlay__content--closing":"FormOverlay_form-overlay__content--closing__3gZuE","form-overlay__header":"FormOverlay_form-overlay__header__a1CcH","form-overlay__header-top":"FormOverlay_form-overlay__header-top__9axJb","form-overlay__logo-image":"FormOverlay_form-overlay__logo-image__qMpam","form-overlay__header-content":"FormOverlay_form-overlay__header-content__Tq7cz","form-overlay__body":"FormOverlay_form-overlay__body___I42s","form-overlay__layout":"FormOverlay_form-overlay__layout__iZRB_","form-overlay__panel":"FormOverlay_form-overlay__panel__Ob0kQ","form-overlay__sidebar":"FormOverlay_form-overlay__sidebar__Tb20d","form-overlay__mobile-summary":"FormOverlay_form-overlay__mobile-summary__2Fm4M","form-overlay__desktop-summary":"FormOverlay_form-overlay__desktop-summary__dB_m_","form-overlay__summary-title":"FormOverlay_form-overlay__summary-title__ZXhQC","form-overlay__footer":"FormOverlay_form-overlay__footer__nAHhZ","form-overlay__finance-banner":"FormOverlay_form-overlay__finance-banner__R3otX","form-overlay__finance-banner-mobile":"FormOverlay_form-overlay__finance-banner-mobile__kRpHB"}},61866:()=>{},65630:e=>
1{e.exports={choices:"ChoiceSegmentedContainer_choices___Lnuj","choices--error":"ChoiceSegmentedContainer_choices--error__zWl0W"}},65890:(e,l,a)=>{"use strict";a.d(l,{A:()=>lY});var t=a(95155),r=a(24089),n=a(22544),i=a(35068),o=a(11287),s=a(99028),c=a(6094),u=a(95604);function d(e){var l,a,r;let{field:d}=e,m=(0,u.useTranslations)(),{register:_,formState:{errors:p}}=(0,n.xW)(),{values:v,setValue:h}=(0,s.xW)(),f=_(d.name,{value:v[d.name],validate:(e,l)=>{let a=(0,i.Yj)();return"email"===d.type&&(a=a.email(m("form.email_validation"))),d.required&&(a=a.required(m("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsx)(o.A,{...f,required:d.required,type:"text",value:null!=(r=v[d.name])?r:"",placeholder:d.props.placeholder,label:d.props.label,error:null==(a=p[d.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{f.onChange(e),h([d.name],e.target.value)}})})}var m=a(12115),_=a(78317);function p(e){var l,a,r;let{field:o}=e,d=(0,u.useTranslations)(),p=(0,m.useId)(),{register:v,formState:{errors:h}}=(0,n.xW)(),{values:f,setValue:x}=(0,s.xW)(),b=v(o.name,{value:f[o.name],validate:(e,l)=>{let a=(0,i.Yj)();return o.required&&(a=a.required(d("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:o.props.colSize,lg:o.props.colSize},children:(0,t.jsx)(_.A,{...b,id:p,required:o.required,value:null!=(r=f[o.name])?r:"",active:!!f[o.name],placeholder:o.props.placeholder,label:o.props.label,error:null==(a=h[o.name])||null==(l=a.message)?void 0:l.toString(),options:o.props.choices.map(e=>({value:e,title:e})),onChange:e=>{b.onChange(e),x([o.name],e.target.value)}})})}var v=a(79121),h=a(2397),f=a(15601),x=a(95415),b=a(80516),g=a.n(b);let y=m.forwardRef((e,l)=>{let{id:a,active:r,label:n,disabled:i,error:o,icon:s,showError:c=!0,errorId:u,...d}=e,_=(0,m.useId)(),p=u||"".concat(a||_,"-error");return(0,t.jsxs)("div",{children:[(0,t.jsx)(h.A,{htmlFor:null!=a?a:_,children:n}),(0,t.jsxs)("div",{className:(0,v.A)(g().textarea,r?g()["textarea--active"]:"",i?g()["textarea--disabled"]:"",o?g()["textarea--error"]:""),children:[(0,t.jsx)("textarea",{ref:l,className:(0,v.A)(g().textarea__field),id:null!=a?a:_,disabled:i,"aria-invalid":!!o,"aria-errormessage":o?p:void 0,...d}),s?(0,t.jsx)(x.A,{icon:s,className:(0,v.A)(g().textarea__icon)}):null]}),o&&c?(0,t.jsx)(f.A,{id:p,children:o}):null]})});y.displayName="Textarea";let A=y;function j(e){var l,a,r;let{field:o}=e,d=(0,u.useTranslations)(),_=(0,m.useId)(),{register:p,formState:{errors:v}}=(0,n.xW)(),{values:h,setValue:f}=(0,s.xW)(),x=p(o.name,{value:h[o.name],validate:(e,l)=>{let a=(0,i.Yj)();return o.required&&(a=a.required(d("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:o.props.colSize,lg:o.props.colSize},children:(0,t.jsx)(A,{...x,id:_,required:o.required,value:null!=(r=h[o.name])?r:"",active:!!h[o.name],placeholder:o.props.placeholder,label:o.props.label,error:null==(a=v[o.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{x.onChange(e),f([o.name],e.target.value)}})})}var N=a(41704),k=a(52482),C=a(86412),F=a(82158),S=a(69357),w=a(60115),q=a(13778),T=a(49055),P=a(34139),E=a(31508),I=a.n(E);function L(e){var l,a;let r=(0,u.useTranslations)(),n=(0,m.useId)(),{vehicles:i}=(0,q.usePortalStore)(e=>{var l,a;return{vehicles:null!=(a=null==(l=e.customer)?void 0:l.vehicles)?a:[]}}),[o,s]=(0,m.useState)(null!=(a=null==(l=i[0])?void 0:l.licensePlate)?a:""),{open:c,close:d,header:_=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h3",{children:r("modal.license_plate_choice.title")}),(0,t.jsx)("p",{children:r("modal.license_plate_choice.text")})]}),buttonTitle:p=r("modal.license_plate_choice.button"),onChoice:h}=e;return(0,m.useEffect)(()=>{var e,l;c&&s(null!=(l=null==(e=i[0])?void 0:e.licensePlate)?l:"")},[c]),(0,t.jsx)(S.A,{size:"sm",open:c,close:d,header:_,body:(0,t.jsxs)("div",{className:(0,v.A)(I().form),children:[(0,t.jsx)("div",{className:(0,v.A)(I().choices),children:i.map(e=>(0,t.jsx)(T.A,{value:e.licensePlate,name:n,checked:o===e.licensePlate,titleClassName:(0,v.A)(I()["choice-title"]),label:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{children:[e.brand," ",e.model]}),(0,t.jsx)(P.A,{licensePlate:e.licensePlate})]}),onChange:e=>s(e.target.value)},e.id))}),(0,t.jsx)(w.default,{title:p,onClick:()=>h(o)})]}),button:null})}
1var O=a(89121),M=a.n(O);let V={shouldValidate:!0};function B(e){var l,a,r,o;let{field:d}=e,_=(0,u.useTranslations)(),p=(0,q.usePortalStore)(e=>{var l;return{vehicles:null==(l=e.customer)?void 0:l.vehicles}}),h=d.name.split("."),f=(0,m.useId)(),{register:b,setValue:g,formState:{errors:y}}=(0,n.xW)(),{form:{id:A},values:j,loading:S,setValue:w,addLoading:T,removeLoading:P}=(0,s.xW)(),E=(0,m.useRef)(null),[I,O]=(0,m.useState)(!1),[B,D]=(0,m.useState)([]),W=null!=(r=(0,F.bf)(j,h))?r:{},z=null!=(o=(0,F.bf)(y,h))?o:{},{licensePlate:R="",brand:Y="",model:U=""}=W,H=S.includes(d.name),K=()=>{T(d.name);let{promise:e,controller:l}=(0,k.i_)(A,R);E.current=l,e.then(e=>{let{status:l,data:a}=e;"cancel"!==l&&(P(d.name),g("".concat(d.name,".brand"),null==a?void 0:a.brand,V),g("".concat(d.name,".licensePlate"),R,V),w([...h],e=>({...e,brand:null==a?void 0:a.brand,model:null==a?void 0:a.model})))})};(0,m.useEffect)(()=>()=>{var e;P(d.name),null==(e=E.current)||e.abort()},[]),(0,m.useEffect)(()=>{var e;let l=null!=(e=p.vehicles)?e:[];D(l),""===R&&1===l.length&&(g("".concat(d.name,".licensePlate"),l[0].licensePlate,V),w([...h],e=>({...e,licensePlate:(0,C.B)(l[0].licensePlate)})))},[p.vehicles]),(0,m.useEffect)(()=>{var e;P(d.name),null==(e=E.current)||e.abort(),6===R.replace(/-|\s/g,"").length&&K()},[R]);let Q=b("".concat(d.name,".licensePlate"),{value:R,validate:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1?arguments[1]:void 0,a=(0,i.Yj)(),t=(0,i.Yj)();return d.required&&(a=a.required(_("form.required"))),""!==e&&(a=a.test("licensePlate",_("form.input.license_plate.message.error"),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return 6===e.replace(/-|\s/g,"").length})),6===e.replace(/-|\s/g,"").length&&(t=t.required(_("form.input.license_plate.message.unknown"))),(0,i.Ik)({licensePlate:a,brand:t}).validate((0,F.bf)(l,h)).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsxs)("div",{className:(0,v.A)(M().field),children:[(0,t.jsx)(N.A,{...Q,id:f,required:d.required,type:"text",value:null!=R?R:"",active:!!R,placeholder:d.props.placeholder,label:d.props.label,error:H?null:null==z||null==(a=z.licensePlate)||null==(l=a.message)?void 0:l.toString(),loading:H,onChange:e=>{g("".concat(d.name,".brand"),"",V),Q.onChange(e),w([...h],l=>({...l,licensePlate:(0,C.B)(e.target.value),brand:"",model:""}))}}),(0,t.jsx)("input",{type:"hidden",...b("".concat(d.name,".brand"),{value:Y})}),Y&&U?(0,t.jsxs)("span",{className:(0,v.A)(M().field__vehicle),children:[(0,t.jsx)(x.A,{icon:"check",className:(0,v.A)(M().field__icon)}),(0,t.jsxs)("span",{className:(0,v.A)(M().field__text),children:[Y," ",U]})]}):null,(null==B?void 0:B.length)>1?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{className:(0,v.A)(M().field__button),onClick:()=>O(!0),type:"button",children:_("form.input.license_plate.choice_license_plate")}),(0,t.jsx)(L,{open:I,close:()=>O(!1),onChoice:e=>{g("".concat(d.name,".brand"),"",V),g("".concat(d.name,".licensePlate"),(0,C.B)(e),V),w([...h],l=>({...l,licensePlate:(0,C.B)(e),brand:"",model:""})),O(!1)}})]}):null]})})}var D=a(18904);function W(e){let{field:l}=e,a=(0,u.useTranslations)(),{control:r}=(0,n.xW)(),{values:o,setValue:d}=(0,s.xW)();return(0,t.jsx)(c.A,{span:{sm:12,md:l.props.colSize,lg:l.props.colSize},children:(0,t.jsx)(n.xI,{control:r,name:l.name,rules:{value:o[l.name],validate:(e,t)=>{let r=(0,i.Yj)();return l.required&&(r=r.required(a("form.required"))),r.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}},render:e=>{var a,r;let{field:{onChange:n,onBlur:i,ref:s},fieldState:{error:c}}=e;return(0,t.jsx)(D.A,{ref:s,name:l.name,required:l.required,value:null!=(r=o[l.name])?r:"",placeholder:l.props.placeholder,label:l.props.label,onValueChange:e=>{n(e.value),d([l.name],e.value)},decimalScale:"mileage"===l.type?0:void 0,suffix:"mileage"===l.type?" km":void 0,onBlur:i,error:null==c||null==(a=c.message)?void 0:a.toString()})}})})}var z=a(47957),R=a.n(z);let Y={shouldValidate:!0,shouldDirty:!0,shouldTouch:!0};function U(e){var l;let{field:a}=e,r=(0,u.useTranslations)(),d=[{key:"postalCode",props:{placeholder:r("form.input.zipcode.placeholder"),label:r("form.input.zipcode.label"),maxLength:7}}
1,{key:"houseNumber",props:{placeholder:r("form.input.house_number.placeholder"),label:r("form.input.house_number.label")}},{key:"street",props:{placeholder:r("form.input.street_name.placeholder"),label:r("form.input.street_name.label")}},{key:"city",props:{placeholder:r("form.input.city.placeholder"),label:r("form.input.city.label")}}],{physicalAddress:_}=(0,q.usePortalStore)(e=>{var l;return{physicalAddress:null==(l=e.customer)?void 0:l.physicalAddress}}),{register:p,setValue:v,formState:{errors:h}}=(0,n.xW)(),{form:{id:f},values:x,loading:b,setValue:g,addLoading:y,removeLoading:A}=(0,s.xW)(),j=(0,m.useRef)(null),N=(0,m.useRef)(null),{postalCode:C="",houseNumber:F="",street:S="",city:w=""}=null!=(l=x[a.name])?l:{},T=b.includes("".concat(a.name)),P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";y("".concat(a.name));let{promise:t,controller:r}=(0,k.ld)(f,null==e?void 0:e.replace(/-|\s/g,"").toUpperCase(),null==l?void 0:l.replace(/-|\s/g,"").toUpperCase());j.current=r,t.then(e=>{let{status:l,data:t}=e;"cancel"!==l&&(A("".concat(a.name)),t&&(v("".concat(a.name,".street"),t.street,Y),v("".concat(a.name,".city"),t.city,Y),g([a.name,"street"],t.street),g([a.name,"city"],t.city)))})};(0,m.useEffect)(()=>()=>{var e,l;A("".concat(a.name)),null==(e=j.current)||e.abort(),null==(l=N.current)||l.cancel()},[]),(0,m.useEffect)(()=>{if(!_||C||F||S||w)return;let e={postalCode:_.postalCode,houseNumber:_.houseNumber,street:_.street,city:_.city};v(a.name,e),g([a.name],e)},[_]);let E=(e,l)=>{var t,r;A("".concat(a.name)),null==(t=j.current)||t.abort(),null==(r=N.current)||r.cancel();let{postalCode:n="",houseNumber:i="",...o}={...x[a.name],[e]:l};6===n.replace(/-|\s/g,"").length&&i.replace(/-|\s/g,"")&&(y("".concat(a.name)),N.current=R()(P,500),N.current(n,i))},I=e=>{switch(e){case"postalCode":return"postal-code";case"houseNumber":return"address-line2";case"street":return"address-line1";case"city":return"address-level2";default:return}};return(0,t.jsx)(t.Fragment,{children:d.map(e=>{var l,n,s,u,d,m,_;let{key:v,props:f}=e,b=p("".concat(a.name,".").concat(v),{value:null==(l=x[a.name])?void 0:l[v],validate:(e,l)=>{let t=(0,i.Yj)();return a.required&&(t=t.required(r("form.required"))),"postalCode"===v&&""!==e&&(t=t.test("postalCode",r("form.input.zipcode.message.error"),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return/^\d{4}[a-zA-Z]{2}$/.test(e.replace(/-|\s/g,""))})),"houseNumber"===v&&""!==e&&(t=t.matches(/^\d+[a-zA-Z0-9\-]*$/,r("form.input.house_number.message.error"))),"street"===v&&""!==e&&(t=t.matches(/^[a-zA-Z\s\-\.]+$/,r("form.input.street_name.message.error"))),"city"===v&&""!==e&&(t=t.matches(/^[a-zA-Z\s\-]+$/,r("form.input.city.message.error"))),t.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:6,lg:6},children:(0,t.jsx)(o.A,{...b,required:a.required,loading:!!["street","city"].includes(v)&&T,type:"text",autoComplete:I(v),value:null!=(_=null==(n=x[a.name])?void 0:n[v])?_:"",active:!!(null==(s=x[a.name])?void 0:s[v]),...f,error:null==(m=h[a.name])||null==(d=m[v])||null==(u=d.message)?void 0:u.toString(),onChange:e=>{b.onChange(e),g([a.name,v],e.target.value),["street","city"].includes(v)||E(v,e.target.value)}})},v)})})}var H=a(16522);function K(e){var l,a,r,o;let{field:d}=e,_=(0,u.useTranslations)(),p=(0,m.useId)(),v="".concat(d.name||p,"-error"),{register:h,formState:{errors:x}}=(0,n.xW)(),{values:b,setValue:g}=(0,s.xW)(),y=h(d.name,{value:null!=(r=b[d.name])&&r,validate:(e,l)=>{let a=(0,i.zM)();return d.required&&(a=a.required(_("form.required")).oneOf([!0],_("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),A=null==(a=x[d.name])||null==(l=a.message)?void 0:l.toString();return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsxs)("div",{children:[(0,t.jsx)(H.A,{...y,id:p,required:d.required,checked:null!=(o=b[d.name])&&o,label:(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:d.props.label}}),error:A,showError:!1,errorId:v,onChange:e=>{y.onChange(e),g([d.name],e.target.checked)}}),A?(0,t.jsx)(f.A,{id:v,children:A}):null]})})}function Q(e){let{field:l}=e;return(0,t.jsx)(c.A,{span:{sm:12,md:l.props.colSize,lg:l.props.colSize},children:(0,t.jsx)("div",{dangerouslySetInnerHTML:{__html:l.props.value}})})}var Z=a(9856),G=a(73510),J=a(82845),X=a(1246),$=a.n(X),ee=a(15183),el=a(85637),ea=a(97176),et=a.n(ea),er=a(55120),en=a(83900),ei=a(81068),eo=a(18046),es=a.n(eo);function ec(e){var l,a,r,n;let{calculation:i,className:o}=e,s=(0,u.useMessages)(),c=(0,ei.A)()(i),d=null!=(n=null==(r=s.form)||null==(a=r.santander_finance_calculator)||null==(l=a.disclosure)?void 0:l.notice)?n:"";return 0===c.length?null:(0,t.jsxs)("div",{className:(0,v.A)(es().disclosure,o),children:[(0,t.jsx)("dl",{className:(0,v.A)(es().disclosure__list),children:c.map(e=>(0,t.jsxs)("div",{className:(0,v.A)(es().disclosure__row),children:[(0,t.jsx)("dt",{className:(0,v.A)(es().disclosure__label),children:e.label}
1),(0,t.jsx)("dd",{className:(0,v.A)(es().disclosure__value),children:e.value})]},e.label))}),d?(0,t.jsx)("div",{className:(0,v.A)(es().disclosure__notice),dangerouslySetInnerHTML:{__html:d}}):null]})}var eu=a(18588),ed=a(82496);let em=async(e,l,a,t,r)=>(0,ed.A)().get("/vehicle/".concat(e,"/finance/santander"),{params:{loanAmount:l,term:a,balloon:t||void 0,downpayment:r||void 0}}).then(e=>e.data).catch(()=>null),e_=[12,24,36,48,60,72],ep={12:65,24:55,36:45,48:35,60:25,72:15},ev=e=>{var l;return null!=(l=ep[e])?l:0},eh=(e,l)=>Math.round(e*ev(l)/100);var ef=a(4762),ex=a.n(ef);let eb={shouldValidate:!0,shouldDirty:!0,shouldTouch:!0};function eg(e){var l,a,r,o,d,_,p,h,f,x,b,g,y,A;let{field:j}=e,N=(0,m.useId)(),k=(0,u.useTranslations)(),C=(0,ee.A)(),F=(0,G.useFormVehicleContext)(),S=(0,eu.v8)(),{register:w,setValue:q,formState:{errors:P}}=(0,n.xW)(),{values:E,setValue:I,addLoading:L,removeLoading:O}=(0,s.xW)(),M=null!=(g=E[j.name])?g:{},V=null!=(A=null!=(y=null==(a=F.prices)||null==(l=a.purchase)?void 0:l.value)?y:null==S||null==(o=S.prices)||null==(r=o.purchase)?void 0:r.value)?A:null,B=(null==(d=j.props)?void 0:d.defaultTerm)&&e_.includes(j.props.defaultTerm)?j.props.defaultTerm:60,{term:W=B,balloon:z="",downpayment:R=""}=M,Y=V?eh(V,Number(W)):0,{data:U,isFetching:H}=(0,en.useQuery)({queryKey:["santanderFinanceCalculation",{slug:null==S?void 0:S.slug,loanAmount:V,term:W,balloon:z,downpayment:R}],queryFn:()=>{var e;return em(null!=(e=null==S?void 0:S.slug)?e:"undefined",Number(V),Number(W),""===z?void 0:Number(z),""===R?void 0:Number(R))},keepPreviousData:!0,enabled:!!((null==S?void 0:S.slug)&&V&&W),staleTime:3e5});if((0,m.useEffect)(()=>{H?L("".concat(j.name)):O("".concat(j.name))},[H]),(0,m.useEffect)(()=>{I([j.name,"instalment"],null==U?void 0:U.instalment),I([j.name,"apr"],null==U?void 0:U.apr),I([j.name,"totalLoanAmount"],null==U?void 0:U.totalLoanAmount),I([j.name,"loanAmount"],null==U?void 0:U.loanAmount),q("".concat(j.name,".instalment"),null==U?void 0:U.instalment),q("".concat(j.name,".apr"),null==U?void 0:U.apr),q("".concat(j.name,".totalLoanAmount"),null==U?void 0:U.totalLoanAmount),q("".concat(j.name,".loanAmount"),null==U?void 0:U.loanAmount)},[U]),(0,m.useEffect)(()=>(I([j.name,"term"],W),I([j.name,"balloon"],z),I([j.name,"downpayment"],R),()=>{O("".concat(j.name))}),[]),!V)return null;let K=(e,l)=>{q("".concat(j.name,".").concat(e),l,eb),I([j.name,e],l)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:k("form.santander_finance_calculator.term.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:e_.map(e=>{var l,a,r;return(0,t.jsx)(T.A,{...w("".concat(j.name,".term"),{value:W,validate:e=>{let l=(0,i.Yj)();return j.required&&(l=l.required(k("form.required"))),l.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:e,label:(0,t.jsx)("span",{className:"text--sm",children:e}
1),id:"".concat(N,"-term-").concat(e),required:j.required,checked:Number(W)===e,error:null==(r=P[j.name])||null==(a=r.term)||null==(l=a.message)?void 0:l.toString(),onChange:()=>K("term",e)},e)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:6,lg:6},children:(0,t.jsx)(D.A,{...w("".concat(j.name,".downpayment"),{value:R}),label:k("form.santander_finance_calculator.downpayment.label"),id:"".concat(N,"-downpayment"),required:!1,value:R,prefix:"€ ",max:V,active:""!==R,error:null==(h=P[j.name])||null==(p=h.downpayment)||null==(_=p.message)?void 0:_.toString(),onValueChange:e=>{K("downpayment",""!==e.value?Math.min(Number(e.value),V):"")}})}),(0,t.jsx)(c.A,{span:{sm:12,md:6,lg:6},children:(0,t.jsx)(D.A,{...w("".concat(j.name,".balloon"),{value:z}),label:k("form.santander_finance_calculator.balloon.label"),id:"".concat(N,"-balloon"),required:!1,value:z,prefix:"€ ",max:Y,active:""!==z,error:null==(b=P[j.name])||null==(x=b.balloon)||null==(f=x.message)?void 0:f.toString(),onValueChange:e=>{K("balloon",""!==e.value&&Y?Math.min(Number(e.value),Y):""!==e.value?Number(e.value):"")}})}),U&&"number"==typeof U.instalment?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{children:[(0,t.jsx)("hr",{className:(0,v.A)(ex().divider)}),(0,t.jsxs)("div",{className:(0,v.A)(ex()["price-per-month"]),children:[(0,t.jsx)("p",{className:(0,v.A)(ex()["price-per-month__title"]),children:k("form.santander_finance_calculator.summary.instalment_per_month")}),(0,t.jsx)("div",{className:(0,v.A)(ex()["price-per-month__column"]),children:(0,t.jsx)("p",{className:(0,v.A)(ex()["price-per-month__value"]),children:C(U.instalment)})})]}),(0,t.jsx)(ec,{calculation:U})]})}):null]})}let ey={shouldValidate:!0,shouldDirty:!0,shouldTouch:!0};function eA(e){var l,a,r;let{field:o}=e,d=(0,m.useId)(),_=(0,u.useTranslations)(),{register:p,setValue:h,formState:{errors:f}}=(0,n.xW)(),{values:x,setValue:b}=(0,s.xW)(),g=null!=(r=x[o.name])?r:{},y=(0,G.useFormVehicleContext)(),{displayPriceConfiguration:A="finance"}=o.props,j=(0,J.WO)(),{prices:N={}}=y,k=Object.entries(N).reduce((e,l)=>{let[a,t]=l;return null!==t.value&&(e[a]=t),e},{}),C=["finance","businessFinance"];"automatic"===A?null!==j&&["finance","businessFinance"].includes(j)&&(C=[j]):"all"!==A&&(C=[A]);let F=C.filter(e=>e in k);C=F.length>0?F:C,(null==(l=k.finance)?void 0:l.type)==="santanderFinance"&&C.includes("finance")&&(C=["finance"]);let{financeType:S=C[0]}=g,w=C.includes(S)?S:C[0],q=(null==(a=k[w])?void 0:a.type)==="santanderFinance";(0,m.useEffect)(()=>{b([o.name,"financeType"],w),b([o.name,"calculatorType"],q?"santander":"local")},[w,q]);let P=e=>{h("".concat(o.name,".financeType"),e,ey),b([o.name,"financeType"],e)};return(0,t.jsxs)(t.Fragment,{children:[C&&C.length>1?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)($().field),children:[(0,t.jsx)("p",{className:(0,v.A)($().field__label),children:_("form.finance_calculator.label")}),(0,t.jsx)("div",{className:(0,v.A)($().field__list),children:C.map(e=>{var l,a,r;return(0,t.jsx)(T.A,{...p("".concat(o.name,".financeType"),{value:e,validate:e=>{let l=(0,i.Yj)();return o.required&&(l=l.required(_("form.required"))),l.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)($().radio__label),value:e,label:(0,t.jsx)("span",{className:"text--sm",children:_("form.finance_calculator.type.".concat(e))}),id:"".concat(d,"-type-").concat(e),required:o.required,checked:e===w,error:null==(r=f[o.name])||null==(a=r.financeType)||null==(l=a.message)?void 0:l.toString(),onChange:()=>P(e)},e)})})]})}):null,q?(0,t.jsx)(eg,{field:o}):(0,t.jsx)(ej,{field:o,financeType:w})]})}function ej(e){var l,a,r,o,d,_,p,h,f,b,g,y,A,j,N,C,F,S,w,q;let{field:P,financeType:E}=e,I=(0,m.useId)(),L=(0,u.useTranslations)(),O=(0,ee.A)(),{register:M,setValue:V,formState:{errors:B}}=(0,n.xW)(),{form:{id:W},values:z,setValue:R,addLoading:Y,removeLoading:U}=(0,s.xW)(),H=null!=(y=z[P.name])?y:{},K=(0,m.useRef)(void 0),Q=(0,m.useRef)(!0),J=(0,m.useRef)(null),X=(0,G.useFormVehicleContext)(),{fallbackDurations:ea=[12,24,36,48,60]}=P.props,en=null==(a=X.prices)||null==(l=a.purchase)?void 0:l.value,ei=null!=(A=null==(o=X.prices)||null==(r=o[E])?void 0:r.metadata)?A:{purchasePrice:en,duration:ea.at(-1)},eo=null==(d=X.interestRates)?void 0:d["finance"===E?"private":"business"],es=eo?eo.map(e=>e.duration):ea,{purchasePrice:ec=ei.purchasePrice,duration:eu=null!=(j=ei.duration)?j:"",deposit:ed=null!=(N=ei.deposit)?N:"",maxDeposit:em=null!=(C=ei.maxDeposit)?C:ec,finalTerm:e_=null!=(F=ei.finalTerm)?F:"",maxFinalTerm:ep=(null!=(S=ei.maxFinalTerm)?S:!!ec)?ec-(ed||0):void 0,credit:ev=ei.credit,interest:eh=ei.interest,pricePerMonth:ef=ei.pricePerMonth,totalPrice:ex=ei.totalPrice,vatAmount:eb=null!=(w=ei.vatAmou
1nt)?w:0}=H,{rate:eg,maxFinalTermPercentage:eA}=null!=(q=null==eo?void 0:eo.find(e=>e.duration===Number(eu)))?q:{},ej=()=>{if(!ec||!eg||!eu||""===ed||""===e_)return;Y("".concat(P.name));let{promise:e,controller:l}=(0,k.Ei)(W,ec,eg,eu,eb,eA,ed,e_);J.current=l,e.then(e=>{let{status:l,data:a}=e;"cancel"!==l&&(U("".concat(P.name)),a&&(V("".concat(P.name),a,ey),R([P.name],{...a,financeType:E})))})};(0,m.useEffect)(()=>{Q.current||(V("purchasePrice",ei.purchasePrice),V("duration",ei.duration),V("deposit",ei.deposit),V("finalTerm",ei.finalTerm),R([P.name,"purchasePrice"],ei.purchasePrice),R([P.name,"duration"],ei.duration),R([P.name,"deposit"],ei.deposit),R([P.name,"finalTerm"],ei.finalTerm))},[E]),(0,m.useEffect)(()=>{var e;return U("".concat(P.name)),null==(e=J.current)||e.abort(),K.current=setTimeout(()=>ej(),500),ec&&eg&&eu&&""!==ed&&""!==e_&&Y("".concat(P.name)),()=>{clearTimeout(K.current)}},[ec,eg,eu,eA,ed,e_]),(0,m.useEffect)(()=>{V("".concat(P.name,".finalTerm"),ep),R([P.name,"finalTerm"],ep)},[ep]),(0,m.useEffect)(()=>{Q.current=!1,clearTimeout(K.current),ej()},[]),(0,m.useEffect)(()=>(V(P.name,{financeType:E,duration:eu,deposit:ed,finalTerm:e_,purchasePrice:ec,credit:ev,interest:eh,totalPrice:ex,pricePerMonth:ef,vatAmount:eb}),R([P.name],{financeType:E,duration:eu,deposit:ed,finalTerm:e_,purchasePrice:ec,credit:ev,interest:eh,totalPrice:ex,pricePerMonth:ef,vatAmount:eb}),()=>{var e;U("".concat(P.name)),clearTimeout(K.current),null==(e=J.current)||e.abort()}),[]);let eN=(e,l)=>{V("".concat(P.name,".").concat(e),l,ey),R([P.name,e],l)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)($().field),children:[(0,t.jsx)("p",{className:(0,v.A)($().field__label),children:L("form.finance_calculator.duration.label")}),(0,t.jsx)("div",{className:(0,v.A)($().field__list),children:es.map(e=>{var l,a,r;return(0,t.jsx)(T.A,{...M("".concat(P.name,".duration"),{value:eu,validate:(e,l)=>{let a=(0,i.Yj)();return P.required&&(a=a.required(L("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)($().radio__label),value:e,label:(0,t.jsx)("span",{className:"text--sm",children:e}),id:"".concat(I,"-duration-").concat(e),required:P.required,checked:eu===e,error:null==(r=B[P.name])||null==(a=r.duration)||null==(l=a.message)?void 0:l.toString(),onChange:e=>eN("duration",Number(e.target.value))},e)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:6,lg:6},children:(0,t.jsx)(D.A,{...M("".concat(P.name,".deposit"),{value:ed,validate:(e,l)=>{let a=(0,i.Yj)();return P.required&&(a=a.required(L("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),label:L("form.finance_calculator.deposit.label"),id:"".concat(I,"-deposit"),required:P.required,value:ed,prefix:"€ ",max:em,active:""!==ed,error:null==(h=B[P.name])||null==(p=h.deposit)||null==(_=p.message)?void 0:_.toString(),onValueChange:e=>{eN("deposit",""!==e.value&&em?Math.min(Number(e.value),em):""!==e.value?Number(e.value):"")}})}),(0,t.jsx)(c.A,{span:{sm:12,md:6,lg:6},children:(0,t.jsx)(D.A,{...M("".concat(P.name,".finalTerm"),{value:e_,validate:(e,l)=>{let a=(0,i.Yj)();return P.required&&(a=a.required(L("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),label:L("form.finance_calculator.final_term.label"),id:"".concat(I,"-finalTerm"),required:P.required,value:e_,prefix:"€ ",max:ep,active:""!==e_,error:null==(g=B[P.name])||null==(b=g.finalTerm)||null==(f=b.message)?void 0:f.toString(),onValueChange:e=>{eN("finalTerm",""!==e.value&&ep?Math.min(Number(e.value),ep):""!==e.value?Number(e.value):"")}})}),"number"==typeof ef?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:(0,v.A)($().summary),children:[(0,t.jsxs)("div",{className:(0,v.A)($().summary__item),children:[(0,t.jsxs)("p",{className:(0,v.A)($().summary__title),children:[(0,t.jsx)("span",{children:L("form.finance_calculator.summary.purchase_amount")}),L("form.finance_calculator.summary.purchase_amount_tooltip.".concat(et()(E)))?(0,t.jsx)(el.A,{overlay:L("form.finance_calculator.summary.purchase_amount_tooltip.".concat(et()(E))),className:(0,v.A)($().summary__tooltip),children:(0,t.jsx)(x.A,{icon:"info",className:(0,v.A)($().summary__icon)})}):null]}
1),(0,t.jsx)("p",{className:(0,v.A)($().summary__value),children:void 0!==ec?O(ec):""})]}),"businessFinance"===E&&void 0!==eb&&"true"!==(0,er.A)("HIDE_FINANCE_CALCULATOR_VAT_AMOUNT")?(0,t.jsxs)("div",{className:(0,v.A)($().summary__item),children:[(0,t.jsxs)("p",{className:(0,v.A)($().summary__title),children:[(0,t.jsx)("span",{children:L("form.finance_calculator.summary.vat_amount")}),L("form.finance_calculator.summary.vat_amount_tooltip.".concat(et()(E)))?(0,t.jsx)(el.A,{overlay:L("form.finance_calculator.summary.vat_amount_tooltip.".concat(et()(E))),className:(0,v.A)($().summary__tooltip),children:(0,t.jsx)(x.A,{icon:"info",className:(0,v.A)($().summary__icon)})}):null]}),(0,t.jsx)("p",{className:(0,v.A)($().summary__value),children:void 0!==eb?O(eb):""})]}):null,(0,t.jsxs)("div",{className:(0,v.A)($().summary__item),children:[(0,t.jsxs)("p",{className:(0,v.A)($().summary__title),children:[(0,t.jsx)("span",{children:L("form.finance_calculator.summary.credit_amount_loan_amount")}),L("form.finance_calculator.summary.credit_amount_loan_amount_tooltip.".concat(et()(E)))?(0,t.jsx)(el.A,{overlay:L("form.finance_calculator.summary.credit_amount_loan_amount_tooltip.".concat(et()(E))),className:(0,v.A)($().summary__tooltip),children:(0,t.jsx)(x.A,{icon:"info",className:(0,v.A)($().summary__icon)})}):null]}),(0,t.jsx)("p",{className:(0,v.A)($().summary__value),children:void 0!==ev?O(ev):""})]}),(0,t.jsxs)("div",{className:(0,v.A)($().summary__item),children:[(0,t.jsxs)("p",{className:(0,v.A)($().summary__title),children:[(0,t.jsx)("span",{children:L("form.finance_calculator.summary.total_price_of_credit")}),L("form.finance_calculator.summary.total_price_of_credit_tooltip.".concat(et()(E)))?(0,t.jsx)(el.A,{overlay:L("form.finance_calculator.summary.total_price_of_credit_tooltip.".concat(et()(E))),className:(0,v.A)($().summary__tooltip),children:(0,t.jsx)(x.A,{icon:"info",className:(0,v.A)($().summary__icon)})}):null]}),(0,t.jsx)("p",{className:(0,v.A)($().summary__value),children:void 0!==ex?O(ex):""})]}),("finance"===E||"businessFinance"===E&&"true"!==(0,er.A)("HIDE_FINANCE_CALCULATOR_INTEREST"))&&(0,t.jsxs)("div",{className:(0,v.A)($().summary__item),children:[(0,t.jsxs)("p",{className:(0,v.A)($().summary__title),children:[(0,t.jsx)("span",{children:L("form.finance_calculator.summary.annual_interest")}),L("form.finance_calculator.summary.annual_interest_tooltip.".concat(et()(E)))?(0,t.jsx)(el.A,{overlay:L("form.finance_calculator.summary.annual_interest_tooltip.".concat(et()(E))),className:(0,v.A)($().summary__tooltip),children:(0,t.jsx)(x.A,{icon:"info",className:(0,v.A)($().summary__icon)})}):null]}),(0,t.jsx)("p",{className:(0,v.A)($().summary__value),children:void 0!==eh?L("percent",{value:eh}):""})]})]}),(0,t.jsx)("hr",{className:(0,v.A)($().divider)}),(0,t.jsxs)("div",{className:(0,v.A)($()["price-per-month"]),children:[(0,t.jsxs)("p",{className:(0,v.A)($()["price-per-month__title"]),children:[L("form.finance_calculator.summary.finance_per_month"),"businessFinance"===E?(0,t.jsx)("span",{className:(0,v.A)($()["price-per-month__vat"]),children:L("form.finance_calculator.summary.excluding_vat.business_finance")}):null]}),(0,t.jsx)("p",{className:(0,v.A)($()["price-per-month__value"]),children:O(ef)})]})]})}):null,"finance"===E&&X.financeDisclaimer?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsx)("div",{className:(0,v.A)($().disclaimer),children:(0,t.jsx)(Z.default,{html:X.financeDisclaimer})})}):null]})}var eN=a(9847),ek=a(39540),eC=a.n(ek);function eF(e){var l;let{field:a}=e,r=(0,u.useTranslations)(),o=a.name.split("."),{vehicles:d}=(0,q.usePortalStore)(e=>{var l;return{vehicles:null==(l=e.customer)?void 0:l.vehicles}}),{control:m}=(0,n.xW)(),{values:_,setValue:p,steps:h}=(0,s.xW)(),f=null!=(l=(0,F.bf)(_,o))?l:"",x=h.reduce((e,l)=>[...e,...l.fields],[]).find(e=>["licensePlate","vehicleAppraisal"].includes(e.type)),b=x?(0,F.bf)(_,[...x.name.split("."),"licensePlate"]):"",g=null==d?void 0:d.find(e=>e.licensePlate===b),y=(0,eN.useFormatter)();return(0,t.jsx)(c.A,{span:{sm:12,md:a.props.colSize,lg:a.props.colSize},children:(0,t.jsxs)("div",{className:(0,v.A)(eC().field),children:[(0,t.jsx)(n.xI,{control:m,name:a.name,rules:{value:f,validate:(e,l)=>{let t=(0,i.Yj)();return a.required&&(t=t.required("Dit veld is verplicht")),t.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}},render:e=>{var l;
1let{field:{onChange:r,onBlur:n,ref:i},fieldState:{error:s}}=e;return(0,t.jsx)(D.A,{ref:i,name:a.name,required:a.required,value:f,placeholder:a.props.placeholder,label:a.props.label,onValueChange:e=>{r(e.value),p([...o],e.value)},decimalScale:0,suffix:" km",onBlur:n,error:null==s||null==(l=s.message)?void 0:l.toString()})}}),(null==g?void 0:g.mileage)?(0,t.jsx)("p",{className:(0,v.A)(eC().field__info),children:r("form.input.mileage.info",{vehicle_mileage:y.number(g.mileage,{style:"unit",unit:"kilometer"})})}):null]})})}function eS(e){var l,a,r;let{field:d}=e,_=(0,u.useTranslations)(),{firstName:p}=(0,q.usePortalStore)(e=>{var l;return{firstName:null==(l=e.customer)?void 0:l.firstName}}),{register:v,setValue:h,formState:{errors:f}}=(0,n.xW)(),{values:x,setValue:b}=(0,s.xW)(),g=null!=(r=x[d.name])?r:"";(0,m.useEffect)(()=>{p&&!g&&(h(d.name,p),b([d.name],p))},[p]);let y=v(d.name,{value:x[d.name],validate:(e,l)=>{let a=(0,i.Yj)();return d.required&&(a=a.required(_("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsx)(o.A,{...y,required:d.required,type:"text",autoComplete:"given-name",value:g,placeholder:d.props.placeholder,label:d.props.label,error:null==(a=f[d.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{y.onChange(e),b([d.name],e.target.value)}})})}function ew(e){var l,a,r;let{field:d}=e,_=(0,u.useTranslations)(),{lastName:p}=(0,q.usePortalStore)(e=>{var l;return{lastName:null==(l=e.customer)?void 0:l.lastName}}),{register:v,setValue:h,formState:{errors:f}}=(0,n.xW)(),{values:x,setValue:b}=(0,s.xW)(),g=null!=(r=x[d.name])?r:"";(0,m.useEffect)(()=>{p&&!g&&(h(d.name,p),b([d.name],p))},[p]);let y=v(d.name,{value:x[d.name],validate:(e,l)=>{let a=(0,i.Yj)();return d.required&&(a=a.required(_("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsx)(o.A,{...y,required:d.required,type:"text",autoComplete:"family-name",value:g,placeholder:d.props.placeholder,label:d.props.label,error:null==(a=f[d.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{y.onChange(e),b([d.name],e.target.value)}})})}function eq(e){var l,a,r;let{field:d}=e,_=(0,u.useTranslations)(),{email:p}=(0,q.usePortalStore)(e=>{var l;return{email:null==(l=e.customer)?void 0:l.email}}),{register:v,setValue:h,formState:{errors:f}}=(0,n.xW)(),{values:x,setValue:b}=(0,s.xW)(),g=null!=(r=x[d.name])?r:"";(0,m.useEffect)(()=>{p&&!g&&(h(d.name,p),b([d.name],p))},[p]);let y=v(d.name,{value:x[d.name],validate:(e,l)=>{let a=(0,i.Yj)().matches(/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,}$/,_("form.email_validation"));return d.required&&(a=a.required(_("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsx)(o.A,{...y,required:d.required,type:"email",autoComplete:"email",value:g,placeholder:d.props.placeholder,label:d.props.label,error:null==(a=f[d.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{y.onChange(e),b([d.name],e.target.value)}})})}function eT(e){var l,a,r;let{field:d}=e,_=(0,u.useTranslations)(),{phone:p}=(0,q.usePortalStore)(e=>{var l;return{phone:null==(l=e.customer)?void 0:l.telephone}}),{register:v,setValue:h,formState:{errors:f}}=(0,n.xW)(),{values:x,setValue:b}=(0,s.xW)(),g=null!=(r=x[d.name])?r:"";(0,m.useEffect)(()=>{p&&!g&&(h(d.name,p),b([d.name],p))},[p]);let y=v(d.name,{value:x[d.name],validate:(e,l)=>{let a=(0,i.Yj)().matches(/^(\+31[1-9]\d{8}|0[1-9]\d{8}|0[1-9]\d{1,3}[-\s]\d{4,8})$/,_("form.phone_validation"));return d.required&&(a=a.required(_("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsx)(o.A,{...y,required:d.required,type:"tel",autoComplete:"tel",value:g,placeholder:d.props.placeholder,label:d.props.label,error:null==(a=f[d.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{y.onChange(e),b([d.name],e.target.value)}})})}var eP=a(95822),eE=a(50700),eI=a(22891),eL=a.n(eI);function eO(e){var l;let{field:a}=e,{form:{id:r},values:i,setValue:o,loading:d,addLoading:_,removeLoading:p}=(0,s.xW)(),{register:h,setValue:f}=(0,n.xW)(),x=(0,m.useRef)(null),b=(0,u.useTranslations)(),[g,y]=(0,eP.A)({}),[A,j]=(0,m.useState)(null),N=h("".concat(a.name,".appraisalError"),{validate:e=>e||!0}),C="deliver_directly"===a.props.priceConfiguration,{licensePlate:F="",mileage:S,brand:w,model:q,priceIndication:T}=null!=(l=i[a.name])?l:{},P=()=>{if(!r||!F||!w||!S)return;_("".concat(a.name,".appraisal")),j(null);let{promise:e,controller:l}=(0,k.eD)(r,F,S);x.current=l,e.then(e=>{let{status:l,data:t,message:r}=e;if("cancel"!==l){if("error"===l){let e=null!=r?r:b("form.input.vehicle_appraisal.message.error");j(e),f("".concat(a.name,".appraisalError"),e,{shouldValidate:!0}),p("".concat(a.name,".appraisal"));return}f("".concat(a.name,".appraisalError"),"",{shouldValidate:!0}),o([a.name,"priceIndication"],null==t?void 0:t.prices.trade),p("".concat(a.name,".appraisal"))}})};return(0,m.useEffect)(()=>()=>{var e;p("".concat(a.name,".appraisal")),null==(e=x.current)||e.abort()},[]),(0,m.useEffect)(()=>{o([a.name,"priceIndication"],void 0),j(null),f("".concat(a.name,".appraisalError"),"",{shouldValidate:!0})},[S,F]),(0,m.useEffect)(()=>{var e;p("".concat(a.name,".appraisal")),null==(e=x.current)||e.abort(),C&&S&&w&&(y({mileage:S,brand:w},500),_("".concat(a.name,".appraisal")))},[S,w]),(0,m.useEffect)(()=>{P()},[g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"hidden",...N}),(0,t.jsx)(B,{field:{name:a.name,type:"licensePlate",required:a.required,props:{colSize:6,label:b("form.input.license_plate.label"),placeholder:""}}}),(0,t.jsx)(eF,{field:{name:"".concat(a.name,".mileage"),type:"mileage",required:a.required,props:{colSize:6,label:b("form.input.mileage.label"),placeholder:""}}}),A?(0,t.jsx)(c.A,{className:(0,v.A)(eL().block),span:{sm:12,md:12,lg:12},children:A}):null,C&&!A&&(T||d.includes("".concat(a.name,".appraisal")))?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(eL().block),children:[d.includes("".concat(a.name,".appraisal"))?(0,t.jsxs)("div",{className:(0,v.A)(eL().loading),children:[(0,t.jsx)("div",{className:(0,v.A)(eL().loading__spinner)}),(0,t.jsx)("span",{children:b("form.input.vehicle_appraisal.loader.label_1")})]}):null,T?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,v.A)(eL().bar),children:(0,t.jsx)("div",{className:(0,v.A)(eL().bar__dot),children:(0,t.jsx)("div",{className:(0,v.A)(eL().bar__label),children:(0,t.jsx)(eE.Ay,{end:T,duration:2.5,separator:b("thousand_separator"),decimal
1:b("decimal_separator"),decimals:2*!Number.isInteger(Number(T)),prefix:"€ "})})})}),(0,t.jsxs)("div",{className:(0,v.A)(eL().price),children:[(0,t.jsx)("span",{className:(0,v.A)(eL().price__label),children:b.rich("form.input.vehicle_appraisal.price.label",{brand:w,model:q})}),(0,t.jsx)("span",{className:(0,v.A)(eL().price__value,"h2"),children:(0,t.jsx)(eE.Ay,{end:T,duration:2.5,separator:b("thousand_separator"),decimal:b("decimal_separator"),decimals:2*!Number.isInteger(Number(T)),prefix:"€ "})})]})]}):null]})}):null]})}var eM=a(50955),eV=a(93629),eB=a.n(eV);let eD=m.forwardRef((e,l)=>{let{id:a,name:r,file:n,active:i,label:o,error:s,loading:c,className:u,fieldClassName:d,labelClassName:_,accept:p,onChange:h,onBlur:b,showError:g=!0,errorId:y}=e,A=(0,m.useId)(),j=y||"".concat(a||A,"-error"),[N,k]=(0,m.useState)(null);return void 0===i&&(i=!!n),(0,m.useEffect)(()=>{k((null==n?void 0:n.type.startsWith("image/"))?URL.createObjectURL(n):null)},[n]),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:(0,v.A)(u,eB().upload,i?eB()["upload--active"]:"",s?eB()["upload--error"]:""),children:[(0,t.jsx)("input",{ref:l,type:"file",className:(0,v.A)(d,eB().upload__field),id:null!=a?a:A,name:r,onChange:e=>{var l;h(null==(l=e.target.files)?void 0:l[0]),e.target.value=""},onBlur:b,accept:p,"aria-invalid":!!s,"aria-errormessage":s?j:void 0}),(0,t.jsxs)("label",{className:(0,v.A)(_,eB().upload__label),htmlFor:null!=a?a:A,onClick:e=>{n&&(e.preventDefault(),h())},children:[(0,t.jsx)("span",{className:(0,v.A)(eB().upload__preview),children:N?(0,t.jsx)("img",{src:N,alt:null==n?void 0:n.name,className:(0,v.A)(eB().upload__image)}):(0,t.jsx)(x.A,{icon:n?"description":"upload",className:(0,v.A)(eB().upload__icon)})}),(0,t.jsx)("span",{className:(0,v.A)(eB().upload__title),children:n?n.name:o}),c?(0,t.jsx)(eM.A,{className:(0,v.A)(eB().upload__loader)}):(0,t.jsx)("span",{className:(0,v.A)(eB().upload__action),children:n?"Verwijderen":"Bestand kiezen"})]})]}),s&&g?(0,t.jsx)(f.A,{id:j,children:s}):null]})});eD.displayName="Upload";let eW=eD,ez=function(e){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=new AbortController,t=new FormData;return t.append("file",e),{promise:(0,ed.A)().post("/project/".concat((0,er.A)("DATAMOTIVE_PROJECT_ID"),"/file/").concat(+!!l),t,{signal:a.signal}).then(e=>e.data).catch(e=>Promise.reject(e)),controller:a}};var eR=a(75326),eY=a.n(eR);let eU={image:["image/*"],pdf:[".pdf"],word:[".doc",".docx"]};function eH(e){let{field:l}=e,a=(0,u.useTranslations)(),r=(0,m.useRef)({}),{control:o}=(0,n.xW)(),{values:d,files:_,setValue:p,setFile:h,loading:f,addLoading:x,removeLoading:b}=(0,s.xW)();return(0,m.useEffect)(()=>()=>{l.props.uploads.forEach(e=>{var a;b("".concat(l.name,".").concat(e.name)),null==(a=r.current["".concat(l.name,".").concat(e.name)])||a.abort()})},[]),(0,t.jsx)(c.A,{span:{sm:12,md:l.props.colSize,lg:l.props.colSize},children:(0,t.jsx)("div",{children:l.props.uploads.map(e=>{var s;return(0,t.jsx)("div",{className:(0,v.A)(eY().item),children:(0,t.jsx)(n.xI,{control:o,name:"".concat(l.name,".").concat(e.name),rules:{value:null==(s=d[l.name])?void 0:s[e.name],validate:(l,t)=>{let r=(0,i.Yj)();return e.required&&(r=r.required(a("form.required"))),r.validate(l).then(()=>!0).catch(e=>e.errors.at(0))}},render:a=>{var n,i;let{field:{onChange:o,onBlur:s,ref:c},fieldState:{error:u}}=a;return(0,t.jsx)(eW,{ref:c,name:"".concat(l.name,".").concat(e.name),file:null==(n=_[l.name])?void 0:n[e.name],label:e.label,error:null==u||null==(i=u.message)?void 0:i.toString(),loading:f.includes("".concat(l.name,".").concat(e.name)),accept:e.allowedFileTypes.map(e=>{var l;return null==(l=eU[e])?void 0:l.join(",")}).filter(e=>e).join(","),onChange:a=>{var t,n;if(h([l.name,e.name],a),b("".concat(l.name,".").concat(e.name)),null==(t=r.current["".concat(l.name,".").concat(e.name)])||t.abort(),a){x("".concat(l.name,".").concat(e.name));let{promise:t,controller:i}=ez(a,null!=(n=e.private)&&n);r.current["".concat(l.name,".").concat(e.name)]=i,t.then(a=>{var t,r;p([l.name,e.name],null!=(t=null==a?void 0:a.id)?t:""),o(null!=(r=null==a?void 0:a.id)?r:""),s(),b("".concat(l.name,".").concat(e.name))})}else p([l.name,e.name],""),o(""),s()}})}})},e.name)})})})}var eK=a(35142),eQ=a(23212),eZ=a(47541),eG=a(67869),eJ=a.n(eG);function eX(e){var l,a;let{field:r}=e,o=(0,u.useTranslations)(),d=(0,m.useId)(),_="".concat(r.name||d,"-error"),{register:p,formState:{errors:x}}=(0,n.xW)(),{values:b,setValue:g}=(0,s.xW)(),y="radio-segmented"===r.props.variant?eZ.A:"div",A=null==(a=x[r.name])||null==(l=a.message)?void 0:l.toString();return(0,t.jsx)(c.A,{span:{sm:12,md:r.props.colSize,lg:r.props.colSize},children:(0,t.jsxs)("div",{children:[(0,t.jsx)(h.A,{children:r.props.label}),(0,t.jsx)(y,{className:(0,v.A)(eJ().container,eJ()["container--".concat(r.props.variant)]),..."radio-segmented"===r.props.variant?{error:!!A}:null,children:r.props.choices.map(e=>{var l,a,n;let s=p(r.name,{value:null!=(n=b[r.name])?n:"",validate:(e,l)=>{let a=(0,i.Yj)();return r.required&&(a=a.required(o("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}
1),c={value:e,required:r.required,checked:b[r.name]===e,label:e,error:null==(a=x[r.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{s.onChange(e),g([r.name],e.target.value)}};return["radio-horizontal","radio-vertical"].includes(r.props.variant)?(0,t.jsx)(eK.A,{...s,...c},e):["radio-extended-horizontal","radio-extended-vertical"].includes(r.props.variant)?(0,t.jsx)(T.A,{...s,...c},e):["radio-segmented"].includes(r.props.variant)?(0,t.jsx)(eQ.A,{...s,...c},e):null})}),A?(0,t.jsx)(f.A,{id:_,children:A}):null]})})}var e$=a(21124);let e0=async function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"nl";return(0,ed.A)().get("/content/establishment",{params:{establishments:[e]},headers:{"Accept-Language":l}}).then(e=>e.data.at(0)).catch(()=>null)};(0,m.cache)(e0);let e1=(0,e$.unstable_cache)(async function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"nl";return(0,ed.A)().get("/content/establishment",{params:{establishments:e},headers:{"Accept-Language":l}}).then(e=>e.data).catch(()=>[])},["establishmentService","fetchEstablishments"],{revalidate:60});(0,m.cache)(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"nl";return e1(JSON.parse(e),l)});let e2=async()=>(0,ed.A)().get("/content/project/".concat((0,er.A)("DATAMOTIVE_PROJECT_ID"),"/establishment")).then(e=>e.data).catch(()=>[]);(0,m.cache)(e2);var e5=a(87201);function e9(e){let{field:l}=e,a=(0,u.useTranslations)(),{data:r}=(0,en.useQuery)({queryKey:["allEstablishments"],queryFn:()=>e2(),placeholderData:[],keepPreviousData:!0,staleTime:3e5}),o=(0,m.useMemo)(()=>{var e;return null!=(e=null==r?void 0:r.filter(e=>{var a,t;return 0===(null!=(a=l.props.establishments)?a:[]).length||(null!=(t=l.props.establishments)?t:[]).includes(e.id)}
1))?e:[]},[r,l.props.establishments]),d=(0,m.useId)(),{control:p,setValue:v}=(0,n.xW)(),{values:h,setValue:f}=(0,s.xW)(),x=(0,e5.Y)(),b=h[l.name];return(0,m.useEffect)(()=>{if(null==b?void 0:b.id)return;let e=o.find(e=>e.id===(null==x?void 0:x.id));e&&(v(l.name,e),f([l.name],e))},[x,o]),(0,t.jsx)(c.A,{span:{sm:12,md:l.props.colSize,lg:l.props.colSize},children:(0,t.jsx)(n.xI,{control:p,name:l.name,rules:{value:b,validate:(e,t)=>{let r=(0,i.Ik)().shape({id:(0,i.ai)().required(),name:(0,i.Yj)().required()}).default(void 0);return l.required&&(r=r.required(a("form.required"))),r.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}},render:e=>{var a,r;let{field:{onChange:n,onBlur:i,ref:s},fieldState:{error:c}}=e;return(0,t.jsx)(_.A,{ref:s,id:d,name:l.name,required:l.required,value:null!=(r=null==b?void 0:b.id)?r:"",active:!!(null==b?void 0:b.id),placeholder:l.props.placeholder,label:l.props.label,error:null==c||null==(a=c.message)?void 0:a.toString(),options:o.map(e=>({value:"".concat(e.id),title:e.name})),onChange:e=>{let a=e.target.value?o.find(l=>"".concat(l.id)===e.target.value):void 0;n(a),f([l.name],a)},onBlur:i})}})})}var e4=a(35281),e8=a.n(e4);function e6(e){var l;let{field:a}=e,r=(0,u.useTranslations)(),o=(0,m.useId)(),d="".concat(a.name||o,"-error"),{control:_}=(0,n.xW)(),{values:p,setValue:x}=(0,s.xW)(),b="checkbox-segmented"===a.props.variant?eZ.A:"div",g=null!=(l=p[a.name])?l:[];return(0,t.jsx)(c.A,{span:{sm:12,md:a.props.colSize,lg:a.props.colSize},children:(0,t.jsx)(n.xI,{control:_,name:a.name,rules:{value:g,validate:(e,l)=>{let t=(0,i.YO)();return a.required&&(t=t.min(1,r("form.input.checkbox_list.required")).required(r("form.input.checkbox_list.required"))),t.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}},render:e=>{var l,r;let{field:{onChange:n,onBlur:i},fieldState:{error:o}}=e;return(0,t.jsxs)("div",{children:[(0,t.jsx)(h.A,{children:a.props.label}),(0,t.jsx)(b,{className:(0,v.A)(e8().container,e8()["container--".concat(a.props.variant)]),..."checkbox-segmented"===a.props.variant?{error:!!o}:null,children:a.props.choices.map(e=>{var l,r;let s={name:a.name,value:e,required:a.required,checked:null!=(r=g.includes(e))&&r,label:e,error:null==o||null==(l=o.message)?void 0:l.toString(),onBlur:i,onChange:l=>{let{target:{checked:t}}=l;n([...g.filter(l=>l!==e),...t?[e]:[]]),x([a.name],function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return l=l.filter(l=>l!==e),t&&l.push(e),l})}};return["checkbox-horizontal","checkbox-vertical"].includes(a.props.variant)?(0,t.jsx)(H.A,{...s},e):["checkbox-extended-horizontal","checkbox-extended-vertical"].includes(a.props.variant)?(0,t.jsx)(T.A,{as:H.A,...s},e):["checkbox-segmented"].includes(a.props.variant)?(0,t.jsx)(eQ.A,{as:H.A,...s},e):null})}),(null==o||null==(l=o.message)?void 0:l.toString())?(0,t.jsx)(f.A,{id:d,children:null==o||null==(r=o.message)?void 0:r.toString()}):null]})}})})}var e7=a(70740),e3=a(88334);a(99157),a(61866);var le=a(72346),ll=a(19867),la=a(8323),lt=a(74226);function lr(e){let{label:l,error:a,showError:r=!0,errorId:n,calendarClassName:i,...s}=e,c=(0,u.useTranslations)(),{locale:d}=(0,le.t)(),_=(0,m.useId)(),p=n||"".concat(s.name||_,"-error"),b=s.id||"".concat(s.name||_,"-input");return(0,t.jsxs)("div",{children:[l?(0,t.jsx)(h.A,{htmlFor:b,children:l}):null,(0,t.jsx)(e7.Ay,{...s,id:b,calendarClassName:(0,v.A)(i,a?"react-datepicker--error":""),locale:d,dateFormat:"P",renderCustomHeader:e=>{let{date:l,decreaseMonth:a,increaseMonth:r,prevMonthButtonDisabled:n,nextMonthButtonDisabled:i,decreaseYear:o,increaseYear:s,prevYearButtonDisabled:u,nextYearButtonDisabled:d}=e;return(0,t.jsxs)("div",{className:(0,v.A)("react-datepicker__navs"),children:[(0,t.jsxs)("div",{className:(0,v.A)("react-datepicker__nav","react-datepicker__nav--month"),children:[(0,t.jsx)("button",{className:(0,v.A)("react-datepicker__nav-button",n?"react-datepicker__nav-button--disabled":""),onClick:a,disabled:n,type:"button","aria-label":c("form.input.date.previous_month"),children:(0,t.jsx)(x.A,{icon:"chevron_left"})}),(0,t.jsx)("span",{className:(0,v.A)("react-datepicker__nav-value"),children:(0,lt.A)(l,"MMMM")}),(0,t.jsx)("button",{className:(0,v.A)("react-datepicker__nav-button",i?"react-datepicker__nav-button--disabled":""),onClick:r,disabled:i,type:"button","aria-label":c("form.input.date.next_month"),children:(0,t.jsx)(x.A,{icon:"chevron_right"})})]}),(0,t.jsxs)("div",{className:(0,v.A)("react-datepicker__nav","react-datepicker__nav--year"),children:[(0,t.jsx)("button",{className:(0,v.A)("react-datepicker__nav-button",u?"react-datepicker__nav-button--disabled":""),onClick:o,disabled:u,type:"button","aria-label":c("form.input.date.previous_year"),children:(0,t.jsx)(x.A,{icon:"chevron_left"})}),(0,t.jsx)("span",{className:(0,v.A)("react-datepicker__nav-value"),children:(0,lt.A)(l,"yyyy")}),(0,t.jsx)("button",{className:(0,v.A)("react-datepicker__nav-button",d?"react-datepicker__nav-button--disabled":""),onClick:s,disabled:d,type:"button","aria-label":c("form.input.date.next_year"),children:(0,t.jsx)(x.A,{icon:"chevron_right"})})]})]})},customInput:(0,t.jsx)(o.A,{id:b,showError:!1,error:a,errorId:p,icon:"event","aria-label":l||"Select date"}),showPopperArrow:!1,popperPlacement:"bottom-start",popperProps:{strategy:"absolute"},popperModifiers:[(0,e3.BN)({padding:8})]}),a&&r?(0,t.jsx)(f.A,{id:p,children:a}):null]})}(0,e7.E)("nl",ll.A),(0,e7.E)("en",la.A);var ln=a(87109),li=a(20712);let lo=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ls(e){var l;let{field:a}=e,r=(0,u.useTranslations)(),{control:o}=(0,n.xW)(),{values:d,setValue:m}
1=(0,s.xW)(),_=null!=(l=d[a.name])?l:"",{futureDates:p,futureRange:v,pastDates:h,pastRange:f,days:x}=a.props,b=e=>x.includes(lo[e.getDay()]),g=new Date,y=new Date;return h?(g=void 0,null!==f.max&&(g=(0,ln.A)(new Date,f.max))):p&&null!==v.min&&(g=(0,li.A)(new Date,v.min)),p?(y=void 0,null!==v.max&&(y=(0,li.A)(new Date,v.max))):h&&null!==f.min&&(y=(0,ln.A)(new Date,f.min)),(0,t.jsx)(c.A,{span:{sm:12,md:a.props.colSize,lg:a.props.colSize},children:(0,t.jsx)(n.xI,{control:o,name:a.name,rules:{value:_,validate:(e,l)=>{let t=(0,i.Yj)();return a.required&&(t=t.required(r("form.required"))),t.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}},render:e=>{var l,r,n;let{field:{onChange:i,onBlur:o},fieldState:{error:s}}=e;return(0,t.jsx)(lr,{name:a.name,error:null==s||null==(l=s.message)?void 0:l.toString(),placeholderText:a.props.placeholder,selected:_?new Date(_):null,inline:"inline"===a.props.variant,label:a.props.label,onChange:e=>{let l=e?(0,lt.A)(e,"yyyy-MM-dd"):"";i(l),m([a.name],l)},onBlur:o,minDate:g,maxDate:y,excludeDateIntervals:h&&p&&(f.min||v.min)?[{start:(0,ln.A)(new Date,null!=(r=f.min)?r:0),end:(0,li.A)(new Date,(null!=(n=v.min)?n:1)-1)}]:[],filterDate:b})}})})}var lc=a(40449),lu=a(86381),ld=a.n(lu);function lm(e){var l,a;let{field:r}=e,o=(0,u.useTranslations)(),d=(0,m.useId)(),p="".concat(r.name||d,"-error"),{control:x}=(0,n.xW)(),{values:b,setValue:g}=(0,s.xW)(),y=null!=(l=(0,F.bf)(b,[r.name]))?l:"",[A,j]=y.split(":"),{colSize:N,label:k,min:C="00:00",max:S="23:59",interval:w="1"}=r.props,[q,T]=C.split(":").map(e=>Number(e)),[P,E]=S.split(":").map(e=>Number(e)),I=(0,lc.A)({start:new Date().setHours(0,0),end:new Date().setHours(P,E)},{step:Number(w)}).filter(e=>{let l=60*e.getHours()+e.getMinutes();return l>=60*q+T&&l<60*P+E}).reduce((e,l)=>{var a;let t=l.getHours(),r=l.getMinutes();return{...e,[t]:[...null!=(a=e[t])?a:[],r]}},{}
1),L=Object.keys(I),O=A&&null!=(a=I[Number(A)])?a:[],M="".concat(d,"-hour");return(0,t.jsx)(c.A,{span:{sm:12,md:N,lg:N},children:(0,t.jsxs)("div",{children:[(0,t.jsx)(h.A,{htmlFor:M,children:k}),(0,t.jsx)(n.xI,{control:x,name:r.name,rules:{value:y,validate:(e,l)=>{let a=(0,i.Yj)().matches(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,o("form.required"));return r.required&&(a=a.required(o("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}},render:e=>{var l;let{field:{onChange:a,onBlur:n},fieldState:{error:i}}=e,s=null==i||null==(l=i.message)?void 0:l.toString();return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:(0,v.A)(ld().time),children:[(0,t.jsxs)("div",{className:(0,v.A)(ld().time__select),children:[(0,t.jsx)(_.A,{id:M,value:A,name:"".concat(r.name,".hour"),placeholder:o("form.input.time.hour"),options:L.map(e=>({value:"".concat(e).padStart(2,"0"),title:"".concat(e).padStart(2,"0")})),active:!!A,showError:!1,error:A?"":s,errorId:p,onChange:e=>{var l;let t=e.target.value,n=j&&(null==(l=I[Number(t)])?void 0:l.includes(Number(j)))?j:"";g([r.name],t?"".concat(t,":").concat(n):void 0),a(t?"".concat(t,":").concat(n):void 0)}}),(0,t.jsx)("span",{children:o("form.input.time.hour")})]}),(0,t.jsx)("div",{className:(0,v.A)(ld().time__colon),children:":"}),(0,t.jsxs)("div",{className:(0,v.A)(ld().time__select),children:[(0,t.jsx)(_.A,{value:j,name:"".concat(r.name,".minute"),placeholder:o("form.input.time.minute"),options:O.map(e=>({value:"".concat(e).padStart(2,"0"),title:"".concat(e).padStart(2,"0")})),active:!!j,disabled:!A,showError:!1,error:s,errorId:p,onChange:e=>{g([r.name],"".concat(A,":").concat(e.target.value)),a("".concat(A,":").concat(e.target.value))},onBlur:n}),(0,t.jsx)("span",{children:o("form.input.time.minute")})]})]}),s?(0,t.jsx)(f.A,{id:p,children:s}):null]})}})]})})}var l_=a(98804),lp=a(51863),lv=a(43216),lh=a(44155),lf=a(82931);let lx={shouldValidate:!0,shouldDirty:!0,shouldTouch:!0},lb=e=>{var l,a;return null!=(a=null==e?void 0:e.defaultValue)?a:(null==e||null==(l=e.items)?void 0:l.length)===1?e.items[0].value:void 0},lg={autotelexAdsBusinessLease:1,autotelexAdsPrivateLease:2},ly=e=>lf.A.sanitize(e,{ADD_ATTR:["target"]}),lA=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function lj(e){var l;let{field:a}=e,r=(0,m.useId)(),o=(0,u.useTranslations)(),d=(0,G.useFormVehicleContext)(),{register:_,formState:{errors:p}}=(0,n.xW)(),{values:h,setValue:f}=(0,s.xW)(),x=null!=(l=h[a.name])?l:{},{displayPriceConfiguration:b="automatic"}=a.props,g=(0,J.WO)(),{prices:y={}}=d,A=Object.entries(y).reduce((e,l)=>{let[a,t]=l;return null!==t.value&&(e[a]=t),e},{}),j=["privateLease","businessLease"];if("automatic"===b){null!==g&&["privateLease","businessLease"].includes(g)&&(j=[g]);let e=j.filter(e=>e in A);j=e.length>0?e:j}else"all"!==b&&(j=[b]);let{leaseType:N=j[0]}=x,k=A[N];return(0,m.useEffect)(()=>{f([a.name,"leaseType"],N)},[]),(0,m.useEffect)(()=>{let e=(null==k?void 0:k.type)==="ponMobilityPrivateLease"?"ponMobility":(null==k?void 0:k.type)==="runningCalculatorPrivateLease"?"vwpfsRunning":(null==k?void 0:k.type)==="autotelexAdsPrivateLease"||(null==k?void 0:k.type)==="autotelexAdsBusinessLease"?"autotelexAds":"";f([a.name,"calculatorType"],e)},[N]),(0,t.jsxs)(t.Fragment,{children:[j&&j.length>1?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:o("form.lease_calculator.lease_type.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:j.map(e=>{var l,n,s;return(0,t.jsx)(T.A,{..._("".concat(a.name,".leaseType"),{value:e,validate:(e,l)=>{let t=(0,i.Yj)();return a.required&&(t=t.required(o("form.required"))),t.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:e,label:(0,t.jsx)("span",{className:"text--sm",children:o("form.lease_calculator.type.".concat(e))}),id:"".concat(r,"-type-").concat(e),required:a.required,checked:e===N,error:null==(s=p[a.name])||null==(n=s.leaseType)||null==(l=n.message)?void 0:l.toString(),onChange:l=>{f([a.name],{leaseType:e})}},e)})})]})}):null,(null==k?void 0:k.type)==="ponMobilityPrivateLease"?(0,t.jsx)(lk,{field:a,leaseType:N,leasePrice:k}):(null==k?void 0:k.type)==="runningCalculatorPrivateLease"?(0,t.jsx)(lC,{field:a,leaseType:N,leasePrice:k}):(0,t.jsx)(lN,{field:a,leaseType:N,leasePrice:k})]})}function lN(e){var l,a,r,o,d,_,p,h,f;let{field:x,leaseType:b,leasePrice:g}=e,y=(0,m.useId)(),A=(0,u.useTranslations)(),j=(0,eN.useFormatter)(),N=(0,ee.A)(),k=(0,eu.v8)(),{register:C,setValue:F,formState:{errors:S}}=(0,n.xW)(),{values:w,setValue:q}=(0,s.xW)(),P=(0,m.useRef)(!0),E=null!=(_=w[x.name])?_:{},{fallbackDurations:I,fallbackMileages:L}=x.props,O=(null==g?void 0:g.type)?lg[g.type]:void 0,{data:M}=(0,en.useQuery)({queryKey:["autotelexLeaseCalculator",{slug:null==k?void 0:k.slug,leasePriceType:O}],queryFn:()=>{var e;return(0,lv.QO)(null!=(e=null==k?void 0:k.slug)?e:"undefined",O)},keepPreviousData:!0,enabled:!!((null==k?void 0:k.slug)&&O),staleTime:216e5}),V=null==M?void 0:M.text,B=(null!=(p=null==V?void 0:V.calculationMainInfoTextBlocks)?p:[]).filter(e=>e.title&&e.text).map(e=>({title:e.title,text:ly(e.linkUrl?"".concat(e.text,'<p><a href="').concat(lA(e.linkUrl),'" target="_blank" rel="noopener noreferrer">
1').concat(lA(e.linkText||e.linkUrl),"</a></p>"):e.text)})),D=null!=(h=null==g||null==(l=g.metadata)?void 0:l.matrix)?h:I.reduce((e,l)=>[...e,...L.map(e=>({mileage:e,duration:l,price:void 0}))],[]),W=D.map(e=>e.duration).filter((e,l,a)=>a.indexOf(e)===l).sort((e,l)=>e-l),z=D.map(e=>e.mileage).filter((e,l,a)=>a.indexOf(e)===l).sort((e,l)=>e-l),R=W.includes(null==g||null==(a=g.metadata)?void 0:a.duration)?g.metadata.duration:W.at(-1),Y=z.includes(null==g||null==(r=g.metadata)?void 0:r.mileage)?g.metadata.mileage:z.at(0),{duration:U=R,mileage:H=Y,price:K=null==(o=D.find(e=>e.duration===U&&e.mileage===H))?void 0:o.price}=E,Q=D.find(e=>e.duration===U&&e.mileage===H),Z=null!=(f=null==Q?void 0:Q.exceededKilometerPrice)?f:null==g||null==(d=g.metadata)?void 0:d.exceededKilometerPrice,G=null!=Z?parseFloat(String(Z))/100:void 0;(0,m.useEffect)(()=>{var e;q([x.name,"price"],null==(e=D.find(e=>e.duration===U&&e.mileage===H))?void 0:e.price)},[b,U,H]),(0,m.useEffect)(()=>{q([x.name,"excessKmPrice"],G)},[b,U,H]),(0,m.useEffect)(()=>{P.current||(q([x.name,"duration"],R),q([x.name,"mileage"],Y))},[b]),(0,m.useEffect)(()=>{P.current=!1,q([x.name,"duration"],U),q([x.name,"mileage"],H)},[]);let J=(e,l)=>{F("".concat(x.name,".").concat(e),l,lx),q([x.name,e],l)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:A("form.lease_calculator.duration.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:W.map(e=>{var l,a,r;return(0,t.jsx)(T.A,{...C("".concat(x.name,".duration"),{value:U,validate:(e,l)=>{let a=(0,i.Yj)();return x.required&&(a=a.required(A("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:e,label:(0,t.jsx)("span",{className:"text--sm",children:e}),id:"".concat(y,"-duration-").concat(e),disabled:!D.some(l=>l.duration===e&&l.mileage===H),required:x.required,checked:U===e,error:null==(r=S[x.name])||null==(a=r.duration)||null==(l=a.message)?void 0:l.toString(),onChange:l=>J("duration",e)},e)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:A("form.lease_calculator.mileage.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:z.map(e=>{var l,a,r;return(0,t.jsx)(T.A,{...C("".concat(x.name,".mileage"),{value:H,validate:(e,l)=>{let a=(0,i.Yj)();return x.required&&(a=a.required(A("form.required"))),a.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:e,label:(0,t.jsx)("span",{className:"text--sm",children:j.number(e,{style:"unit",unit:"kilometer"})}),id:"".concat(y,"-mileage-").concat(e),disabled:!D.some(l=>l.duration===U&&l.mileage===e),required:x.required,checked:H===e,error:null==(r=S[x.name])||null==(a=r.mileage)||null==(l=a.message)?void 0:l.toString(),onChange:l=>J("mileage",e)},e)})})]})}),K?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{children:[(0,t.jsx)("hr",{className:(0,v.A)(ex().divider)}),(0,t.jsxs)("div",{className:(0,v.A)(ex()["price-per-month"]),children:[(0,t.jsxs)("p",{className:(0,v.A)(ex()["price-per-month__title"]),children:[A("form.lease_calculator.summary.lease_per_month"),"businessLease"===b?(0,t.jsx)("span",{className:(0,v.A)(ex()["price-per-month__vat"]),children:A("form.lease_calculator.summary.excluding_vat.business_lease")}):null]}),(0,t.jsxs)("div",{className:(0,v.A)(ex()["price-per-month__column"]),children:[(0,t.jsx)("p",{className:(0,v.A)(ex()["price-per-month__value"]),children:N(K)}),void 0!==G&&G>0?(0,t.jsxs)("p",{className:(0,v.A)(ex()["price-per-month__excess-km"]),children:[A("form.lease_calculator.summary.excess_km_price")," ",N(G)]}):null]})]})]})}):null,(null==V?void 0:V.calculationMainInfoText)||B.length>0?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex()["lease-info"]),children:[(null==V?void 0:V.calculationMainInfoTextHeader)?(0,t.jsx)("p",{className:(0,v.A)(ex()["lease-info__title"]),children:V.calculationMainInfoTextHeader}):null,(null==V?void 0:V.calculationMainInfoText)?(0,t.jsx)("div",{className:(0,v.A)(ex()["lease-info__text"]),dangerouslySetInnerHTML:{__html:ly(V.calculationMainInfoText)}}):null,B.length>0?(0,t.jsx)(lh.default,{faqs:B}):null]})}):null]})}function lk(e){var l,a,r,o,d;let{field:p,leaseType:h,leasePrice:f}=e,x=(0,m.useId)(),b=(0,u.useTranslations)(),g=(0,eN.useFormatter)(),y=(0,ee.A)(),{params:A}=(0,l_.f)(),j=(0,eu.v8)(),{register:N,setValue:k,formState:{errors:C}}=(0,n.xW)(),{values:F,setValue:S,addLoading:w,removeLoading:q}=(0,s.xW)(),{Duration:P,YearlyKm:E,OwnRiskLevel:I,TireProduct:L,ReliefVehicleProduct:O,Province:M}=null!=A?A:{},{duration:V=null==P?void 0:P.defaultValue,mileage:B=null==E?void 0:E.defaultValue,ownRisk:D=null==I?void 0:I.defaultValue,tyreProduct:W=null==L?void 0:L.defaultValue,replacementVehicle:z=null==O?void 0:O.defaultValue,province:R=null==M?void 0:M.defaultValue,price:Y}=null!=(d=F[p.name])?d:{},{data:U,isFetching:H}=(0,en.useQuery)({queryKey:["ponMobilityLeasePriceCalculation",{slug:null==j?void 0:j.slug,duration:V,mileage:B,ownRisk:D,tyreProduct:W,replacementVehicle:z,province:R}],queryFn:()=>{var e;return(0,lv.V0)(null!=(e=null==j?void 0:j.slug)?e:"undefined",V,B,D,W,z,R)},keepPreviousData:!0,enabled:!!((null==j?void 0:j.slug)&&V&&B&&D&&W&&z&&R),staleTime:3e5});if((0,m.useEffect)(()=>{H?w("".concat(p.name)):q("".concat(p.name))},[H]),(0,m.useEffect)(()=>{var e,l;S([p.name,"price"],null==U||null==(e=U.price)?void 0:e.stockPrice.price),S([p.name,"excessKmPrice"],(null==U||null==(l=U.equipment)?void 0:l.VWExcessKmTotalCt)?U.equipment.VWExcessKmTotalCt/100:void 0)},[U]),(0,m.useEffect)(()=>(S([p.name,"duration"],V),S([p.name,"mileage"],B),S([p.name,"ownRisk"],D),S([p.name,"tyreProduct"],W),S([p.name,"replacementVehicle"],z),S([p.name,"province"],R),()=>{q("".concat(p.name))}),[]),!P||!E||!I||!L||!O||!M)return null;let K=(e,l)=>{k("".concat(p.name,".").concat(e),l,lx),S([p.name,e],l)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:b("form.lease_calculator.duration.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:[...Array((P.values.max-P.values.min)/P.values.step+1)].map((e,l)=>{var a,r,n;let o=P.values.min+l*P.values.step;return(0,t.jsx)(T.A,{...N("".concat(p.name,".duration"),{value:V,validate:(e,l)=>{let a=(0,i.Yj)();return(a=a.required(b("form.required"))).validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:o,label:(0,t.jsx)("span",{className:"text--sm",children:o}),id:"".concat(x,"-duration-").concat(o),required:!0,checked:V===o,error:null==(n=C[p.name])||null==(r=n.duration)||null==(a=r.message)?void 0:a.toString(),onChange:e=>K("duration",o)},o)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:b("form.lease_calculator.mileage.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:[...Array((E.values.max-E.values.min)/E.values.step+1)].map((e,l)=>{var a,r,n;let o=E.values.min+l*E.values.step;return(0,t.jsx)(T.A,{...N("".concat(p.name,".mileage"),{value:B,val
1idate:(e,l)=>{let a=(0,i.Yj)();return(a=a.required(b("form.required"))).validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:o,label:(0,t.jsx)("span",{className:"text--sm",children:g.number(o,{style:"unit",unit:"kilometer"})}),id:"".concat(x,"-mileage-").concat(o),required:!0,checked:B===o,error:null==(n=C[p.name])||null==(r=n.mileage)||null==(a=r.message)?void 0:a.toString(),onChange:e=>K("mileage",o)},o)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:b("form.lease_calculator.own_risk.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:Object.entries(I.values).map(e=>{var l,a,r;let[n,{text:o}]=e;return(0,t.jsx)(T.A,{...N("".concat(p.name,".ownRisk"),{value:D,validate:(e,l)=>{let a=(0,i.Yj)();return(a=a.required(b("form.required"))).validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:n,label:(0,t.jsx)("span",{className:"text--sm",children:o}),id:"".concat(x,"-ownRisk-").concat(n),required:!0,checked:D===n,error:null==(r=C[p.name])||null==(a=r.ownRisk)||null==(l=a.message)?void 0:l.toString(),onChange:e=>K("ownRisk",n)},n)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:b("form.lease_calculator.tyre_product.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:Object.entries(L.values).map(e=>{var l,a,r;let[n,{text:o}]=e;return(0,t.jsx)(T.A,{...N("".concat(p.name,".tyreProduct"),{value:W,validate:(e,l)=>{let a=(0,i.Yj)();return(a=a.required(b("form.required"))).validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:n,label:(0,t.jsx)("span",{className:"text--sm",children:o}),id:"".concat(x,"-tyreProduct-").concat(n),required:!0,checked:W===n,error:null==(r=C[p.name])||null==(a=r.tyreProduct)||null==(l=a.message)?void 0:l.toString(),onChange:e=>K("tyreProduct",n)},n)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:b("form.lease_calculator.replacement_vehicle.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:Object.entries(O.values).map(e=>{var l,a,r;let[n,{text:o}]=e;return(0,t.jsx)(T.A,{...N("".concat(p.name,".replacementVehicle"),{value:z,validate:(e,l)=>{let a=(0,i.Yj)();return(a=a.required(b("form.required"))).validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:n,label:(0,t.jsx)("span",{className:"text--sm",children:o}),id:"".concat(x,"-replacementVehicle-").concat(n),required:!0,checked:z===n,error:null==(r=C[p.name])||null==(a=r.replacementVehicle)||null==(l=a.message)?void 0:l.toString(),onChange:e=>K("replacementVehicle",n)},n)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsx)("div",{className:(0,v.A)(ex().field),children:(0,t.jsx)(_.A,{...N("".concat(p.name,".province"),{value:R,validate:(e,l)=>{let a=(0,i.Yj)();return(a=a.required(b("form.required"))).validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),id:"".concat(x,"-province"),required:!0,value:R,active:!!R,placeholder:b("form.lease_calculator.province.placeholder"),label:b("form.lease_calculator.province.label"),error:null==(r=C[p.name])||null==(a=r.province)||null==(l=a.message)?void 0:l.toString(),options:Object.entries(M.values).map(e=>{let[l,{text:a}]=e;return{value:l,title:a}}),onChange:e=>K("province",e.target.value)})})}),Y?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{children:[(0,t.jsx)("hr",{className:(0,v.A)(ex().divider)}),(0,t.jsxs)("div",{className:(0,v.A)(ex()["price-per-month"]),children:[(0,t.jsxs)("p",{className:(0,v.A)(ex()["price-per-month__title"]),children:[b("form.lease_calculator.summary.lease_per_month"),"businessLease"===h?(0,t.jsx)("span",{className:(0,v.A)(ex()["price-per-month__vat"]),children:b("form.lease_calculator.summary.excluding_vat.business_lease")}):null]}),(0,t.jsxs)("div",{className:(0,v.A)(ex()["price-per-month__column"]),children:[(0,t.jsx)("p",{className:(0,v.A)(ex()["price-per-month__value"]),children:y(Y)}),(null==U||null==(o=U.equipment)?void 0:o.VWExcessKmTotalCt)&&U.equipment.VWExcessKmTotalCt>0?(0,t.jsxs)("p",{className:(0,v.A)(ex()["price-per-month__excess-km"]),children:[b("form.lease_calculator.summary.excess_km_price")," ",y(U.equipment.VWExcessKmTotalCt/100)]}):null]})]})]})}):null]})}function lC(e){var l,a,r,o,d,p,h,f,x,b,g,y,A,j;let{field:N,leaseType:k,leasePrice:C}=e,F=(0,m.useId)(),S=(0,u.useTranslations)(),w=(0,ee.A)(),{params:q}=(0,lp.K)(),P=(0,eu.v8)(),{register:E,setValue:I,trigger:L,formState:{errors:O}}=(0,n.xW)(),{values:M,setValue:V,addLoading:B,removeLoading:W}=(0,s.xW)(),{duration:z,yearlyKm:R,tireProduct:Y,reliefVehicleProduct:U,ownRiskLevel:H,province:K,prePayment:Q}=null!=q?q:{},{duration:Z=lb(z),mileage:G=lb(R),tyreProduct:J=lb(Y),replacementVehicle:X=lb(U),ownRisk:$=lb(H),province:el=lb(K),prePayment:ea=null!=(A=null==Q?void 0:Q.defaultValue)?A:null,price:et,disclaimer:er,qualityMark:ei}=null!=(y=M[N.name])?y:{},[eo,es]=(0,m.useState)(ea),ec=eo!==ea,ed=""===eo||null===eo?void 0:Number(eo);(0,m.useEffect)(()=>
1{if(!ec)return;let e=setTimeout(()=>es(ea),500);return()=>{clearTimeout(e)}},[ea,ec]);let{data:em,isFetching:e_}=(0,en.useQuery)({queryKey:["vwpfsRunningCalculatorLeasePriceCalculation",{slug:null==P?void 0:P.slug,duration:Z,mileage:G,tyreProduct:J,replacementVehicle:X,ownRisk:$,province:el,prePayment:ed}],queryFn:()=>{var e;return(0,lv.cf)(null!=(e=null==P?void 0:P.slug)?e:"undefined",Z,G,J,X,$,el,ed)},keepPreviousData:!0,enabled:!!((null==P?void 0:P.slug)&&Z&&G),staleTime:3e5}),ep=null!=(j=null==em||null==(l=em.metadata)?void 0:l.lease_price_inc_vat)?j:null==em?void 0:em.value,ev=!!em&&void 0===ep&&void 0!==ed;if((0,m.useEffect)(()=>{e_||ec?B("".concat(N.name)):W("".concat(N.name))},[e_,ec]),(0,m.useEffect)(()=>{L("".concat(N.name,".prePayment"))},[ev]),(0,m.useEffect)(()=>{var e,l,a,t;V([N.name,"price"],ep),V([N.name,"disclaimer"],(null==em||null==(e=em.metadata)?void 0:e.disclaimer)||void 0),V([N.name,"qualityMark"],(null==em||null==(l=em.metadata)?void 0:l.qualityMark)||void 0),V([N.name,"excessKmComment"],(null==em||null==(a=em.metadata)?void 0:a.excess_km_comment)||void 0),V([N.name,"excessKmPrice"],(null==em||null==(t=em.metadata)?void 0:t.excess_km_price_ct)?em.metadata.excess_km_price_ct/100:void 0)},[em]),(0,m.useEffect)(()=>(V([N.name,"duration"],Z),V([N.name,"mileage"],G),V([N.name,"tyreProduct"],J),V([N.name,"replacementVehicle"],X),V([N.name,"ownRisk"],$),V([N.name,"province"],el),V([N.name,"prePayment"],ea),()=>{W("".concat(N.name))}),[]),!(null==z?void 0:z.items)||!(null==R?void 0:R.items))return null;let eh=(e,l)=>{I("".concat(N.name,".").concat(e),l,lx),V([N.name,e],l)};return(0,t.jsxs)(t.Fragment,{children:[(null==em||null==(a=em.metadata)?void 0:a.product)?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsx)("p",{className:(0,v.A)(ex()["product-title"]),children:em.metadata.product})}):null,(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:S("form.lease_calculator.duration.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:z.items.map(e=>{var l,a,r;let{value:n,label:o}=e;return(0,t.jsx)(T.A,{...E("".concat(N.name,".duration"),{value:Z,validate:e=>{let l=(0,i.Yj)();return(l=l.required(S("form.required"))).validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:n,label:(0,t.jsx)("span",{className:"text--sm",children:o}),id:"".concat(F,"-duration-").concat(n),required:!0,checked:Z===n,error:null==(r=O[N.name])||null==(a=r.duration)||null==(l=a.message)?void 0:l.toString(),onChange:()=>eh("duration",n)},n)})})]})}),(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:S("form.lease_calculator.mileage.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:R.items.map(e=>{var l,a,r;let{value:n,label:o}=e;return(0,t.jsx)(T.A,{...E("".concat(N.name,".mileage"),{value:G,validate:e=>{let l=(0,i.Yj)();return(l=l.required(S("form.required"))).validate(e).then(()=>!0).catch(e=>e.errors.at(0))}}),labelClassName:(0,v.A)(ex().radio__label),value:n,label:(0,t.jsx)("span",{className:"text--sm",children:o}),id:"".concat(F,"-mileage-").concat(n),required:!0,checked:G===n,error:null==(r=O[N.name])||null==(a=r.mileage)||null==(l=a.message)?void 0:l.toString(),onChange:()=>eh("mileage",n)},n)})}),(null==em||null==(r=em.metadata)?void 0:r.excess_km_comment)?(0,t.jsx)("p",{className:(0,v.A)(ex().field__comment),dangerouslySetInnerHTML:{__html:ly(em.metadata.excess_km_comment)}}):null]})}),Q?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)(D.A,{...E("".concat(N.name,".prePayment"),{value:ea,validate:()=>!ev||S("form.lease_calculator.pre_payment.too_high")}),id:"".concat(F,"-prePayment"),required:!1,value:ea,prefix:"€ ",decimalScale:0,allowNegative:!1,active:""!==ea,label:S("form.lease_calculator.pre_payment.label"),error:null==(p=O[N.name])||null==(d=p.prePayment)||null==(o=d.message)?void 0:o.toString(),onValueChange:e=>eh("prePayment",""!==e.value?Number(e.value):"")}),(null==em||null==(h=em.metadata)?void 0:h.rate_comment)?(0,t.jsx)("p",{className:(0,v.A)(ex().field__comment),dangerouslySetInnerHTML:{__html:ly(em.metadata.rate_comment)}}):null]})}):null,(null==Y?void 0:Y.items)&&Y.items.length>0?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:S("form.lease_calculator.tyre_product.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:Y.items.map(e=>{var l,a,r;let{value:n,label:i}=e;return(0,t.jsx)(T.A,{...E("".concat(N.name,".tyreProduct"),{value:J}),labelClassName:(0,v.A)(ex().radio__label),value:n,label:(0,t.jsx)("span",{className:"text--sm",children:i}),id:"".concat(F,"-tyreProduct-").concat(n),required:!1,checked:J===n,error:null==(r=O[
1N.name])||null==(a=r.tyreProduct)||null==(l=a.message)?void 0:l.toString(),onChange:()=>eh("tyreProduct",n)},n)})})]})}):null,(null==U?void 0:U.items)&&U.items.length>0?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:S("form.lease_calculator.replacement_vehicle.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:U.items.map(e=>{var l,a,r;let{value:n,label:i}=e;return(0,t.jsx)(T.A,{...E("".concat(N.name,".replacementVehicle"),{value:X}),labelClassName:(0,v.A)(ex().radio__label),value:n,label:(0,t.jsx)("span",{className:"text--sm",children:i}),id:"".concat(F,"-replacementVehicle-").concat(n),required:!1,checked:X===n,error:null==(r=O[N.name])||null==(a=r.replacementVehicle)||null==(l=a.message)?void 0:l.toString(),onChange:()=>eh("replacementVehicle",n)},n)})})]})}):null,(null==H?void 0:H.items)&&H.items.length>0?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{className:(0,v.A)(ex().field),children:[(0,t.jsx)("p",{className:(0,v.A)(ex().field__label),children:S("form.lease_calculator.own_risk.label")}),(0,t.jsx)("div",{className:(0,v.A)(ex().field__list),children:H.items.map(e=>{var l,a,r;let{value:n,label:i}=e;return(0,t.jsx)(T.A,{...E("".concat(N.name,".ownRisk"),{value:$}),labelClassName:(0,v.A)(ex().radio__label),value:n,label:(0,t.jsx)("span",{className:"text--sm",children:i}),id:"".concat(F,"-ownRisk-").concat(n),required:!1,checked:$===n,error:null==(r=O[N.name])||null==(a=r.ownRisk)||null==(l=a.message)?void 0:l.toString(),onChange:()=>eh("ownRisk",n)},n)})})]})}):null,(null==K?void 0:K.items)&&K.items.length>0?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsx)("div",{className:(0,v.A)(ex().field),children:(0,t.jsx)(_.A,{...E("".concat(N.name,".province"),{value:el}),id:"".concat(F,"-province"),required:!1,value:el,active:!!el,placeholder:S("form.lease_calculator.province.placeholder"),label:S("form.lease_calculator.province.label"),error:null==(b=O[N.name])||null==(x=b.province)||null==(f=x.message)?void 0:f.toString(),options:K.items.map(e=>{let{value:l,label:a}=e;return{value:String(l),title:a}}),onChange:e=>eh("province",e.target.value)})})}):null,et?(0,t.jsx)(c.A,{span:{sm:12,md:12,lg:12},children:(0,t.jsxs)("div",{children:[(0,t.jsx)("hr",{className:(0,v.A)(ex().divider)}),(0,t.jsxs)("div",{className:(0,v.A)(ex()["price-per-month"]),children:[(0,t.jsx)("p",{className:(0,v.A)(ex()["price-per-month__title"]),children:S("form.lease_calculator.summary.lease_per_month")}),(0,t.jsxs)("div",{className:(0,v.A)(ex()["price-per-month__column"]),children:[(0,t.jsx)("p",{className:(0,v.A)(ex()["price-per-month__value"]),children:w(et)}),(null==em||null==(g=em.metadata)?void 0:g.excess_km_price_ct)&&em.metadata.excess_km_price_ct>0?(0,t.jsxs)("p",{className:(0,v.A)(ex()["price-per-month__excess-km"]),children:[S("form.lease_calculator.summary.excess_km_price")," ",w(em.metadata.excess_km_price_ct/100)]}):null]})]})]})}):null]})}function lF(e){var l,a,r;let{field:d}=e,m=(0,u.useTranslations)(),{register:_,formState:{errors:p}}=(0,n.xW)(),{values:v,setValue:h}=(0,s.xW)(),f=null!=(r=v[d.name])?r:"",x=_(d.name,{value:v[d.name],validate:e=>{let l=(0,i.Yj)().matches(/^[A-Z]{2}\d{2}[A-Z0-9]{4}\d{7}([A-Z0-9]?){0,16}$/,m("form.iban_validation"));return d.required&&(l=l.required(m("form.required"))),l.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsx)(o.A,{...x,required:d.required,type:"text",autoComplete:"off",value:f,placeholder:d.props.placeholder,label:d.props.label,error:null==(a=p[d.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{x.onChange(e),h([d.name],e.target.value)}})})}function lS(e){var l,a,r;let{field:d}=e,m=(0,u.useTranslations)(),{register:_,formState:{errors:p}}=(0,n.xW)(),{values:v,setValue:h}=(0,s.xW)(),f=null!=(r=v[d.name])?r:"",x=_(d.name,{value:v[d.name],validate:e=>{let l=(0,i.Yj)().matches(/^(\+[1-9]\d{7,14}|06[-\s]?\d{8}
1)$/,m("form.mobile_validation"));return d.required&&(l=l.required(m("form.required"))),l.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsx)(o.A,{...x,required:d.required,type:"tel",autoComplete:"tel",value:f,placeholder:d.props.placeholder,label:d.props.label,error:null==(a=p[d.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{x.onChange(e),h([d.name],e.target.value)}})})}function lw(e){var l,a,r;let{field:d}=e,m=(0,u.useTranslations)(),{register:_,formState:{errors:p}}=(0,n.xW)(),{values:v,setValue:h}=(0,s.xW)(),f=null!=(r=v[d.name])?r:"",x=_(d.name,{value:v[d.name],validate:e=>{let l=(0,i.Yj)().matches(/^NL\d{9}B\d{2}$/,{message:m("form.vat_number_validation"),excludeEmptyString:!0});return d.required&&(l=l.required(m("form.required"))),l.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}});return(0,t.jsx)(c.A,{span:{sm:12,md:d.props.colSize,lg:d.props.colSize},children:(0,t.jsx)(o.A,{...x,required:d.required,type:"text",autoComplete:"off",value:f,placeholder:d.props.placeholder,label:d.props.label,error:null==(a=p[d.name])||null==(l=a.message)?void 0:l.toString(),onChange:e=>{x.onChange(e),h([d.name],e.target.value)}})})}var lq=a(65960),lT=a.n(lq);function lP(e){let{field:l}=e,a=(0,u.useTranslations)(),r=(0,u.useFormatter)(),i=(0,m.useId)();function o(e){let t=[e.title];if(!l.props.hideTimeSlotTimes){let l=r.dateTime(new Date(e.startTime),{hour:"2-digit",minute:"2-digit"}),a=r.dateTime(new Date(e.endTime),{hour:"2-digit",minute:"2-digit"});t.push("(".concat(l," - ").concat(a,")"))}if(!l.props.hideAvailableSpots){let l=e.maxRegistrations-e.registrationCount,r=l<=0?a("form.event.full"):a("form.event.available",{available:l,max:e.maxRegistrations});t.push("\xb7 ".concat(r))}return t.join(" ")}let d="".concat(l.name||i,"-error"),{control:_}=(0,n.xW)(),{values:p,setValue:x}=(0,s.xW)(),b="checkbox"===l.props.variant,g=p[l.name],{data:y=[],isError:A}=(0,en.useQuery)({queryKey:["eventTimeSlots",l.props.eventId],queryFn:()=>(0,k.Hf)(l.props.eventId),enabled:!!l.props.eventId,staleTime:3e5});return(0,t.jsx)(c.A,{span:{sm:12,md:l.props.colSize,lg:l.props.colSize},children:(0,t.jsx)(n.xI,{control:_,name:l.name,rules:{value:g,validate:e=>!l.required||(b?!!Array.isArray(e)&&e.length>0||a("form.required"):!!e||a("form.required"))},render:e=>{let{field:{onChange:r,onBlur:n},fieldState:{error:i}}=e;return(0,t.jsxs)("div",{children:[(0,t.jsx)(h.A,{children:l.props.label}),A&&(0,t.jsx)(f.A,{children:a("error.text")}),(0,t.jsx)("div",{className:(0,v.A)(lT().container),children:y.map(e=>{var a,s;let c=e.registrationCount>=e.maxRegistrations,u=o(e);if(b){let a=Array.isArray(g)&&g.some(l=>l.id===e.id);return(0,t.jsx)(H.A,{name:l.name,value:String(e.id),checked:a,disabled:c,label:u,error:null==i||null==(s=i.message)?void 0:s.toString(),onBlur:n,onChange:a=>{let{target:{checked:t}}=a,n=[...(Array.isArray(g)?g:[]).filter(l=>l.id!==e.id),...t?[{id:e.id,title:e.title}]:[]];r(n),x([l.name],n)}},e.id)}return(0,t.jsx)(eK.A,{name:l.name,value:String(e.id),checked:(null==g?void 0:g.id)===e.id,disabled:c,label:u,error:null==i||null==(a=i.message)?void 0:a.toString(),onBlur:n,onChange:()=>{let a={id:e.id,title:e.title};r(a),x([l.name],a)}},e.id)})}),(null==i?void 0:i.message)?(0,t.jsx)(f.A,{id:d,children:i.message.toString()}):null]})}})})}let lE=e=>(null!=e?e:[]).flatMap(e=>{var l;return null!=(l=null==e?void 0:e.fields)?l:[]}),lI=e=>{var l,a;let{steps:t,values:r}=(0,s.xW)(),n=(0,e5.Y)(),i=lE(t).find(e=>(null==e?void 0:e.type)==="establishment"),o=i?r[i.name]:void 0;return null!=(a=null!=(l=null!=e?e:null==o?void 0:o.id)?l:null==n?void 0:n.id)?a:void 0},lL=e=>{let{data:l}=(0,en.useQuery)({queryKey:["establishmentDetail",e],queryFn:()=>e?e0(e):Promise.resolve(null),enabled:!!e,staleTime:3e5});return null!=l?l:null};var lO=a(35706);let lM={text:d,textarea:j,email:eq,phone:eT,mobile:lS,number:W,date:ls,time:lm,select:p,address:U,licensePlate:B,checkbox:K,checkboxList:e6,radio:eX,firstName:eS,lastName:ew,mileage:eF,financeCalculator:eA,vehicleAppraisal:eO,textBlock:Q,groupedUploads:eH,establishment:e9,leaseCalculator:lj,iban:lF,vatNumber:lw,event:lP,dateTimeOpeningHours:function(e){var l,a,r,o,d,p;let{field:x}=e,b=(0,u.useTranslations)(),g=(0,m.useId)(),y="".concat(x.name||g,"-error"),{control:A,setValue:j}=(0,n.xW)(),{values:N,setValue:k}=(0,s.xW)(),{departmentType:C,establishmentId:F,interval:S="15"}=x.props,w=null!=(r=null==(l=N[x.name])?void 0:l.date)?r:"",q=null!=(o=null==(a=N[x.name])?void 0:a.time)?o:"",[T,P]=q.split(":"),E=lI(null!=F?F:void 0),I=lL(E),L=!E,O=!L&&!w,M=e=>(0,lO.B0)(I,C,e);(0,m.useEffect)(()=>{w&&!L&&(M(new Date("".concat(w,"T00:00:00")))||(j("".concat(x.name,".date"),""),k([x.name,"date"],"")))},[I]);let V=I&&w?(0,lO.Xp)(I,C,new Date("".concat(w,"T00:00:00"))):null,B=null!==V&&(V.closed||0===V.windows.length),D=(B?[]:(null!=(d=null==V?void 0:V.windows)?d:[]).flatMap(e=>{let[l,a]=e.from.split(":").map(e=>Number(e)),[t,r]=e.till.split(":").map(e=>Number(e)),n=60*l+a,i=60*t+r;return(0,lc.A)({start:new Date().setHours(0,0),end:new Date().setHours(t,r)},{step:Number(S)}).filter(e=>{let l=60*e.getHours()+e.getMinutes();return l>=n&&l<i})})).reduce((e,l)=>{var a;let t=l.getHours(),r=l.getMinutes();return{...e,[t]:[...null!=(a=e[t])?a:[],r]}},{}
1),W=Object.keys(D),z=T&&null!=(p=D[Number(T)])?p:[],R="".concat(g,"-hour");return(0,m.useEffect)(()=>{var e;q&&!L&&!O&&(!B&&(null!=(e=D[Number(T)])?e:[]).includes(Number(P))||(j("".concat(x.name,".time"),void 0),k([x.name,"time"],void 0)))},[I,w]),(0,t.jsx)(c.A,{span:{sm:12,md:x.props.colSize,lg:x.props.colSize},children:(0,t.jsxs)("div",{children:[(0,t.jsx)(n.xI,{control:A,name:"".concat(x.name,".date"),rules:{value:w,validate:e=>{let l=(0,i.Yj)();return x.required&&(l=l.required(b("form.required"))),l.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}},render:e=>{var l;let{field:{onChange:a,onBlur:r},fieldState:{error:n}}=e;return(0,t.jsx)(lr,{name:"".concat(x.name,".date"),error:null==n||null==(l=n.message)?void 0:l.toString(),placeholderText:L?b("form.opening_hours.select_establishment_first"):x.props.label,disabled:L,selected:w?new Date(w):null,label:x.props.label,onChange:e=>{let l=e?(0,lt.A)(e,"yyyy-MM-dd"):"";a(l),k([x.name,"date"],l)},onBlur:r,minDate:new Date,maxDate:(0,li.A)(new Date,365),filterDate:M})}}),(0,t.jsx)(n.xI,{control:A,name:"".concat(x.name,".time"),rules:{value:q,validate:e=>{let l=(0,i.Yj)().matches(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,b("form.required"));return x.required&&(l=l.required(b("form.required"))),l.validate(e).then(()=>!0).catch(e=>e.errors.at(0))}},render:e=>{var l;let{field:{onChange:a,onBlur:r},fieldState:{error:n}}=e,i=null==n||null==(l=n.message)?void 0:l.toString(),o=L||O,s=L?b("form.opening_hours.select_establishment_first"):O?b("form.opening_hours.select_date_first"):"";return(0,t.jsxs)("div",{children:[(0,t.jsx)(h.A,{htmlFor:R,children:"\xa0"}),(0,t.jsxs)("div",{className:(0,v.A)(ld().time),children:[(0,t.jsxs)("div",{className:(0,v.A)(ld().time__select),children:[(0,t.jsx)(_.A,{id:R,value:T,name:"".concat(x.name,".time.hour"),placeholder:o?s:b("form.input.time.hour"),disabled:o,options:W.map(e=>({value:"".concat(e).padStart(2,"0"),title:"".concat(e).padStart(2,"0")})),active:!!T,showError:!1,error:T?"":i,errorId:y,onChange:e=>{var l;let t=e.target.value,r=P&&(null==(l=D[Number(t)])?void 0:l.includes(Number(P)))?P:"";k([x.name,"time"],t?"".concat(t,":").concat(r):void 0),a(t?"".concat(t,":").concat(r):void 0)}}),(0,t.jsx)("span",{children:b("form.input.time.hour")})]}),(0,t.jsx)("div",{className:(0,v.A)(ld().time__colon),children:":"}),(0,t.jsxs)("div",{className:(0,v.A)(ld().time__select),children:[(0,t.jsx)(_.A,{value:P,name:"".concat(x.name,".time.minute"),placeholder:b("form.input.time.minute"),options:z.map(e=>({value:"".concat(e).padStart(2,"0"),title:"".concat(e).padStart(2,"0")})),active:!!P,disabled:!T||o,showError:!1,error:i,errorId:y,onChange:e=>{k([x.name,"time"],"".concat(T,":").concat(e.target.value)),a("".concat(T,":").concat(e.target.value))},onBlur:r}),(0,t.jsx)("span",{children:b("form.input.time.minute")})]})]}),i?(0,t.jsx)(f.A,{id:y,children:i}):null]})}})]})})}};function lV(e){let{fields:l=[]}=e;return(0,t.jsx)(t.Fragment,{children:l.map(e=>{let l=lM[e.type];return l?(0,t.jsx)(l,{field:e},e.name):null})})}var lB=a(57495),lD=a(87403);function lW(){var e,l,a,n;let i=(0,u.useTranslations)(),o=(0,G.useFormVehicleContext)(),c=(0,lD.ge)(),d=(0,e5.Y)(),{webspace:_="",locale:p}=(0,le.t)(),{form:v,setValue:h,values:f,submitting:x,loading:b}=(0,s.xW)(),[g,y]=(0,m.useState)(""),[A,j]=(0,m.useState)("selecting"),[N,C]=(0,m.useState)(null),[F,S]=(0,m.useState)(null),q=(0,m.useMemo)(()=>{var e,l,a;let t=[...(null==v||null==(e=v.payment)?void 0:e.options)||[]],r=null==o||null==(a=o.prices)||null==(l=a.purchase)?void 0:l.value;return t.some(e=>"purchase"===e.key)||null==r||t.push({key:"purchase",label:"Purchase",amount:Number(r)}),t},[null==v||null==(e=v.payment)?void 0:e.options,o]);(0,m.useEffect)(()=>{let e=e=>{var l;(null==(l=e.data)?void 0:l.type)==="PAYMENT_STATUS"&&(j(e.data.status),"completed"===e.data.status&&(h(["paymentCompleted"],!0),h(["paymentData"],e.data.paymentData)),N&&(N.close(),C(null)))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[N,h]),(0,m.useEffect)(()=>{if(N){let e=setInterval(()=>{N.closed&&(j("selecting"),C(null),clearInterval(e))},1e3);return()=>clearInterval(e)}},[N]);let T=e=>{y(e),h(["selectedPaymentOption"],e)},P=(e,l)=>{let a=async()=>{try{let a=await (0,k.O5)(e);if("PAID"===a.status.action)return j("completed"),l&&(l.close(),C(null)),!0;return!1}catch(e){return console.error("Error checking payment status:",e),!1}};a().then(e=>{if(e)return;let l=setInterval(async()=>{await a()&&clearInterval(l)},3e3);setTimeout(()=>{clearInterval(l)},6e5)})},E=async()=>
1{if(!g)return;let e=q.find(e=>e.key===g);if(e){j("pending");try{var l,a,t;let r={...f,paymentData:{amount:100*e.amount,label:e.label}},n=JSON.parse(null!=(t=sessionStorage.getItem("dm-utm"))?t:"{}"),i={brand:o.brand,model:o.model,edition:o.edition,licensePlate:o.licensePlate,manufacturingYear:o.constructionYear,fuelType:o.fuel,vehicleType:o.vehicleState,vehicleNumber:o.vehicleNumber,vehicleSlug:o.slug,bikeObjectId:o.bikeObjectId,bikeAccountId:o.bikeAccountId,bikeBarcode:o.bikeBarcode,purchasePreviousPrice:null==(a=o.prices)||null==(l=a.purchase)?void 0:l.previousValue,searchTerms:o.searchTerms,vacancyTitle:c.title,vacancyLocationCity:c.locationCity,vacancyExternalId:c.externalId,establishment:null==d?void 0:d.id,gtmUserId:localStorage.getItem("dm-user-id")||null};Object.keys(i).forEach(e=>{i[e]||delete i[e]});let s=await (0,k.rM)(v.id,r,i,_,n,p,window.location.href);if(s.id&&S(s.id),s.redirectUrl){let e=window.open(s.redirectUrl,"payment","width=800,height=600,scrollbars=yes,resizable=yes");e?(C(e),e.focus(),P(s.statusUrl,e)):window.location.href=s.redirectUrl}else throw Error("No payment redirect URL received")}catch(e){console.error("Payment error:",e),j("failed")}}};return"completed"===A?(0,t.jsx)(lB.A,{children:(0,t.jsxs)("div",{style:{gridColumn:"span 12"},children:[(0,t.jsx)("h3",{children:i("form.payment.success.title")}),v.successPage.text?(0,r.Ay)((null==(n=v.successPage.text)?void 0:n.startsWith("<"))?v.successPage.text:"<p>".concat(v.successPage.text,"</p>")):(0,t.jsx)("p",{children:i("form.payment.success.message")})]})}):"failed"===A?(0,t.jsx)(lB.A,{children:(0,t.jsxs)("div",{style:{gridColumn:"span 12"},children:[(0,t.jsx)("h3",{children:i("form.payment.error.title")}),(0,t.jsx)("p",{children:i("form.payment.error.message")}),(0,t.jsx)(w.default,{type:"button",title:i("form.payment.retry"),onClick:()=>j("selecting")})]})}):"pending"===A?(0,t.jsx)(lB.A,{children:(0,t.jsxs)("div",{style:{gridColumn:"span 12"},children:[(0,t.jsx)("h3",{children:i("form.payment.pending.title")}),(0,t.jsx)("p",{children:i("form.payment.pending.message")}),(0,t.jsx)("div",{style:{textAlign:"center",padding:"2rem"},children:(0,t.jsx)("div",{className:"spinner"})})]})}):(0,t.jsxs)(lB.A,{children:[(0,t.jsxs)("div",{style:{gridColumn:"span 12"},children:[(0,t.jsx)("h3",{children:(null==v||null==(l=v.payment)?void 0:l.title)||i("form.payment.title")}),(null==v||null==(a=v.payment)?void 0:a.description)&&(0,t.jsx)("div",{style:{marginBottom:"1.5rem"},children:(0,r.Ay)(v.payment.description.startsWith("<")?v.payment.description:"<p>".concat(v.payment.description,"</p>"))})]}),q.length>0&&(0,t.jsxs)("div",{style:{gridColumn:"span 12"},children:[(0,t.jsx)("h4",{children:i("form.payment.select_option")}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",marginBottom:"2rem"},children:q.map((e,l)=>(0,t.jsxs)("label",{style:{display:"flex",alignItems:"center",padding:"1rem",border:g===e.key?"2px solid #007bff":"1px solid #ddd",borderRadius:"8px",cursor:"pointer",backgroundColor:g===e.key?"#f8f9fa":"white"},children:[(0,t.jsx)("input",{type:"radio",name:"paymentOption",value:e.key,checked:g===e.key,onChange:()=>T(e.key),style:{marginRight:"1rem"}}),(0,t.jsxs)("div",{style:{flex:1},children:[(0,t.jsx)("strong",{children:e.label}),(0,t.jsxs)("div",{style:{fontSize:"0.9em",color:"#666"},children:["€",e.amount.toFixed(2)]})]})]},"".concat(e.key,"-").concat(l)))})]}),(0,t.jsx)("div",{style:{gridColumn:"span 12"},children:(0,t.jsx)(w.default,{title:i("form.payment.proceed"),onClick:E,disabled:!g||x||b.length>0,loading:x||b.length>0})})]})}var lz=a(43926),lR=a.n(lz);function lY(e){var l,a,i,c,d,m,_;let{minStepIndex:p,maxStepIndex:h,close:f}=e,b=(0,u.useTranslations)(),{form:g,steps:y,stepIndex:A,submitId:j,submitting:N,loading:k,values:C,handleSubmit:F,setStepIndex:S}=(0,s.xW)(),q=(0,n.xW)(),T=A;void 0!==p&&(T=Math.max(p,T)),void 0!==h&&(T=Math.min(h,T));let P=null==y?void 0:y.at(T),E=g.payment.enabled,I=null==P?void 0:P.isPaymentStep,L=T===(null==y?void 0:y.length)-1&&!E;return L&&j&&g.successPage.redirect?(0,t.jsxs)(lB.A,{children:[(0,t.jsxs)("div",{style:{gridColumn:"span 12"},children:[(0,t.jsx)("p",{className:"h5",children:b("form.last_completed_step.redirect_page.title")}),(0,t.jsx)("p",{children:b("form.last_completed_step.redirect_page.text")})]}),(0,t.jsx)("div",{style:{gridColumn:"span 12"},children:(0,t.jsx)(w.default,{type:"button",title:b("form.last_completed_step.redirect_page.button"),href:g.successPage.redirect})})]}):L&&j?(0,t.jsxs)(lB.A,{children:[(0,t.jsx)("div",{style:{gridColumn:"span 12"},children:(0,r.Ay)((null==(d=g.successPage.text)?void 0:d.startsWith("<"))?g.successPage.text:"<p>".concat(g.successPage.text,"</p>"))}),f?(0,t.jsx)("div",{style:{gridColumn:"span 12"},children:(0,t.jsx)(w.default,{type:"button",icon:"close",title:b("form.last_completed_step.button"),onClick:f})}):null]}):I?(0,t.jsxs)("div",{children:[T>0&&(0,t.jsxs)("button",{type:"button",className:(0,v.A)(lR()["button--previous"]),onClick:()=>S(T-1),children:[(0,t.jsx)(x.A,{icon:"chevron_left"}),(0,t.jsx)("span",{children:b("form.previous_step_button")})]}),(0,t.jsx)(lW,{})]}):(0,t.jsxs)("form",{noValidate:!0,onSubmit:q.handleSubmit(F),name:null==g||null==(l=g.name)?void 0:l.replace(/\W/g,"_"),children:[T>0&&(0,t.jsxs)("button",{type:"button",className:(0,v.A)(lR()["button--previous"]),onClick:()=>S(T-1),children:[(0,t.jsx)(x.A,{icon:"chevron_left"}),(0,t.jsx)("span",{children:b("form.previous_step_button")})]}),(0,t.jsxs)(lB.A,{children:[(0,t.jsx)(lV,{fields:null!=(m=null==P?void 0:P.fields)?m:[]}
1),(null==g||null==(a=g.spamProtection)?void 0:a.reCaptchaEnabled)&&(null==g||null==(i=g.spamProtection)?void 0:i.reCaptchaSiteKey)&&(0,t.jsxs)("div",{style:{gridColumn:"span 12"},children:[L&&(0,t.jsx)("div",{className:(0,v.A)(lR()["recaptcha-disclaimer"]),children:b("form.recaptcha.disclaimer")}),q.formState.errors.recaptchaToken&&(0,t.jsx)(o.A,{type:"hidden",error:b("form.recaptcha.invalid")})]}),(0,t.jsx)("div",{style:{gridColumn:"span 12"},children:(0,t.jsx)(w.default,{title:null!=(_=null==P?void 0:P.submitButtonText)?_:E&&T===(null==y?void 0:y.length)-2?b("form.payment_button"):L?b("form.last_step_button"):b("form.next_step_button",{stepName:null==y||null==(c=y.at(T+1))?void 0:c.name}),disabled:N||k.length>0,loading:N||k.length>0})}),(()=>{var e,l;let a=null==P||null==(e=P.fields)?void 0:e.find(e=>"leaseCalculator"===e.type);if(!a)return null;let{qualityMark:r,disclaimer:n}=null!=(l=C[a.name])?l:{};return r||n?(0,t.jsxs)("div",{style:{gridColumn:"span 12"},children:[r?(0,t.jsx)("span",{className:(0,v.A)(ex()["quality-mark"]),dangerouslySetInnerHTML:{__html:r}}):null,n?(0,t.jsx)("div",{className:(0,v.A)(ex().disclaimer),dangerouslySetInnerHTML:{__html:n}}):null]}):null})()]})]})}},65960:e=>{e.exports={container:"FormFieldEvent_container__v29xS"}},66132:e=>{e.exports={choice:"ChoiceExtended_choice__zbiMm",choice__check:"ChoiceExtended_choice__check__czxep",choice__label:"ChoiceExtended_choice__label__AOU_h",radio__title:"ChoiceExtended_radio__title__dr65s","choice--disabled":"ChoiceExtended_choice--disabled__PzX1C","choice--active":"ChoiceExtended_choice--active__sNslk","choice--error":"ChoiceExtended_choice--error__08TIu"}},66808:e=>{e.exports={loader:"LoaderDots_loader__cdhpO",loader__dot:"LoaderDots_loader__dot__ByVis","dot-pulse":"LoaderDots_dot-pulse__2GaAH"}},67869:e=>{e.exports={container:"FormFieldRadio_container__O5TS_","container--radio-horizontal":"FormFieldRadio_container--radio-horizontal__MA6x0","container--radio-vertical":"FormFieldRadio_container--radio-vertical__yVaNs","container--radio-extended-horizontal":"FormFieldRadio_container--radio-extended-horizontal__gIoTK","container--radio-extended-vertical":"FormFieldRadio_container--radio-extended-vertical__rs2Uv"}},69357:(e,l,a)=>{"use strict";a.d(l,{A:()=>_});var t=a(95155),r=a(80560),n=a.n(r),i=a(79121),o=a(60115),s=a(12115),c=a(88992),u=a(95604),d=a(48806),m=a.n(d);function _(e){let l=(0,u.useTranslations)(),a=(0,s.useId)(),{addItem:r,removeItem:d}=(0,c.L)(e=>({addItem:e.addItem,removeItem:e.removeItem})),{open:_=!1,close:p,headerButtons:v=(0,t.jsx)(o.default,{theme:"ghost-10",title:l("modal.close"),size:"sm",icon:"close",showText:!1,onClick:p,className:(0,i.A)(m().modal__close)}),header:h,body:f,footer:x,button:b,size:g="md",portalClassName:y,overlayClassName:A,className:j,headerClassName:N,bodyClassName:k,footerClassName:C}=e;return(0,s.useEffect)(()=>()=>{d(a)},[]),(0,s.useEffect)(()=>{_?r(a):d(a)},[_]),(0,t.jsxs)(n(),{isOpen:_,onRequestClose:p,closeTimeoutMS:300,portalClassName:(0,i.A)(m().modal,g?m()["modal--".concat(g)]:"",y),overlayClassName:{base:(0,i.A)(m().modal__overlay,A),afterOpen:(0,i.A)(m()["modal__overlay--open"]),beforeClose:(0,i.A)(m()["modal__overlay--closing"])},className:{base:(0,i.A)(m().modal__content,j),afterOpen:(0,i.A)(m()["modal__content--open"]),beforeClose:(0,i.A)(m()["modal__content--closing"])}
1,bodyOpenClassName:null,preventScroll:!0,children:[(0,t.jsxs)("div",{className:(0,i.A)(m().modal__header,N),children:[v?(0,t.jsx)("div",{className:(0,i.A)(m()["modal__header-buttons"]),children:v}):null,h?(0,t.jsx)("div",{className:(0,i.A)(m()["modal__header-content"]),children:h}):null]}),(0,t.jsxs)("div",{className:(0,i.A)(m().modal__body,k),children:[f,b?(0,t.jsx)("div",{className:(0,i.A)(m()["modal__sticky-buttons"]),children:b}):null]}),x?(0,t.jsx)("div",{className:(0,i.A)(m().modal__footer,C),children:x}):null]})}n().setAppElement("body")},70108:e=>{e.exports={grid:"Grid_grid__J2mgd"}},73510:(e,l,a)=>{"use strict";a.r(l),a.d(l,{FormVehicleContext:()=>n,FormVehicleContextProvider:()=>i,useFormVehicleContext:()=>o});var t=a(95155),r=a(12115);let n=r.createContext({});function i(e){let{children:l,...a}=e;return(0,t.jsx)(n.Provider,{value:{...a},children:l})}let o=()=>(0,r.useContext)(n)},74718:e=>{e.exports={container:"Container_container__fHtBw"}},75326:e=>{e.exports={item:"FormFieldGroupedUploads_item__0BK8x"}},75598:(e,l,a)=>{"use strict";a.d(l,{S:()=>i});var t=a(95155);let r={display:"grid",transition:"grid-template-rows 0.3s ease"},n={overflow:"hidden",minHeight:0};function i(e){let{isOpened:l,theme:a,children:i}=e;return(0,t.jsx)("div",{className:null==a?void 0:a.collapse,"aria-hidden":!l,style:{...r,gridTemplateRows:l?"1fr":"0fr"},children:(0,t.jsx)("div",{className:null==a?void 0:a.content,style:n,children:i})})}},76538:e=>{e.exports={summary__item:"FormSummary_summary__item__oLGId",summary__title:"FormSummary_summary__title__tkm0t",summary__fields:"FormSummary_summary__fields__mAKSt",summary__field:"FormSummary_summary__field__Keurn","summary__field-title":"FormSummary_summary__field-title__fOhw1","summary__field-value":"FormSummary_summary__field-value__iKccq",summary__vat:"FormSummary_summary__vat__e6l4y",vehicle:"FormSummary_vehicle__aBOx5",vehicle__title:"FormSummary_vehicle__title__BSM4m",vehicle__text:"FormSummary_vehicle__text__adgYd",vehicle__media:"FormSummary_vehicle__media__k_yFl",prices:"FormSummary_prices__VGD2B",price:"FormSummary_price__I3bnk",price__start:"FormSummary_price__start__nus7d",price__title:"FormSummary_price__title__FfKqz",price__vat:"FormSummary_price__vat__YPtZd",price__end:"FormSummary_price__end__FzrXs",price__value:"FormSummary_price__value__n7aKo","price__previous-value":"FormSummary_price__previous-value__hd0k_"}},78317:(e,l,a)=>{"use strict";a.d(l,{A:()=>m});var t=a(95155),r=a(12115),n=a(79121),i=a(2397),o=a(95415),s=a(15601),c=a(54478),u=a.n(c);let d=r.forwardRef((e,l)=>{let{id:a,active:c,label:d,labelVisuallyHidden:m=!1,options:_=[],disabled:p,error:v,placeholder:h,icon:f="expand_more",showError:x=!0,errorId:b,...g}=e,y=(0,r.useId)(),A=b||"".concat(a||y,"-error");return(0,t.jsxs)("div",{children:[d?(0,t.jsx)(i.A,{htmlFor:null!=a?a:y,className:m?"visually-hidden":void 0,children:d}):null,(0,t.jsxs)("div",{className:(0,n.A)(u().select,c?u()["select--active"]:"",p?u()["select--disabled"]:"",v?u()["select--error"]:""),children:[(0,t.jsxs)("select",{ref:l,className:(0,n.A)(u().select__field),id:null!=a?a:y,disabled:p,"aria-invalid":!!v,"aria-errormessage":v?A:void 0,...g,children:[h?(0,t.jsx)("option",{value:"",children:h}):null,_.map((e,l)=>{let{value:a,title:r,disabled:n}=e;return(0,t.jsx)("option",{value:a,disabled:n,children:r},l)})]}),(0,t.jsx)(o.A,{icon:f,className:(0,n.A)(u().select__icon)})]}),v&&x?(0,t.jsx)(s.A,{id:A,children:v}):null]})});d.displayName="Select";let m=d},79121:(e,l,a)=>{"use strict";function t(){for(var e=arguments.length,l=Array(e),a=0;a<e;a++)l[a]=arguments[a];return l.map(e=>null==e?void 0:e.trim()).filter(e=>e).join(" ").trim()}a.d(l,{A:()=>t})},80516:e=>{e.exports={textarea:"Textarea_textarea__Qf93w",textarea__field:"Textarea_textarea__field__TMq0m",textarea__icon:"Textarea_textarea__icon__pTIc6","textarea--hover":"Textarea_textarea--hover__Z7NI0","textarea--focus":"Textarea_textarea--focus__pk9Qt","textarea--disabled":"Textarea_textarea--disabled__rU4cV","textarea--active":"Textarea_textarea--active__9_8n4","textarea--error":"Textarea_textarea--error__hnoBj"}},81068:(e,l,a)=>{"use strict";a.d(l,{A:()=>i});var t=a(95604),r=a(9847),n=a(15183);function i(){let e=(0,t.useTranslations)(),l=(0,r.useFormatter)(),a=(0,n.A)();return t=>{let{purchasePrice:r,instalment:n,apr:i,totalLoanAmount:o,term:s,loanAmount:c,balloon:u,downpayment:d}=t,m=[];return"number"==typeof r&&m.push({label:e("form.santander_finance_calculator.disclosure.purchase_price"),value:a(r)}),"number"==typeof n&&m.push({label:e("form.santander_finance_calculator.disclosure.instalment"),value:e("form.santander_finance_calculator.per_month",{value:a(n)})}),"number"==typeof i&&m.push({label:e("form.santander_finance_calculator.disclosure.apr"),value:e("percent",{value:i})}),"number"==typeof c&&m.push({label:e("form.santander_finance_calculator.disclosure.loan_amount"),value:a(c)}),"number"==typeof s&&m.push({label:e("form.santander_finance_calculator.disclosure.term"),value:l.number(s,{style:"unit",unit:"month",unitDisplay:"long"})}),"number"==typeof o&&m.push({label:e("form.santander_finance_calculator.disclosure.total_loan_amount"),value:a(o)}),"number"==typeof d&&d>0&&m.push({label:e("form.santander_finance_calculator.disclosure.downpayment"),value:a(d)}),"number"==typeof u&&u>0&&m.push({label:e("form.santander_finance_calculator.disclosure.balloon"),value:a(u)}),m}}},82158:(e,l,a)=>{"use strict";function t(e,l,a){let t=e;return l.forEach((e,r)=>{if(r<l.length-1){t[e]||(t[e]={}),t=t[e];return}t[e]=a}),e}function r(e,l){return l.forEach(l=>{e=null==e?void 0:e[l]}),e}function n(e,l){let a=e;return l.forEach((e,t)=>{if(t<l.length-1){a=null==a?void 0:a[e];return}delete a[e]}),e}a.d(l,{HJ:()=>t,WE:()=>n,bf:()=>r})},82845:(e,l,a)=>{"use strict";a.d(l,{WO:()=>o,o5:()=>i});var t=a(95155),r=a(12115);let n=r.createContext(null);function i(e){let{children:l,priceType:a}=e;return(0,t.jsx)(n.Provider,{value:a,children:l})}let o=()=>(0,r.useContext)(n)},84795:(e,l,a)=>{"use strict";a.d(l,{A:()=>u});var t=a(95155),r=a(79121),n=a(98463),i=a(54805),o=a(18704),s=a.n(o);let c=[{key:"sm",breakpoint:0,container:327,targetPixel:1,viewport:375,fluid:!0},{key:"",breakpoint:376,container:415-415/375*48,targetPixel:415/375,viewport:415,fluid:!0},{key:"",breakpoint:416,container:523.2,targetPixel:1.6,viewport:600,fluid:!0},{key:"md",breakpoint:600,container:672,targetPixel:1,viewport:768,fluid:!0},{key:"",breakpoint:769,container:1024-1024/768*96,targetPixel:1024/768,viewport:1024,fluid:!0},{key:"lg",breakpoint:1024,container:1366-1366/1380*200,targetPixel:1366/1380,viewport:1366,fluid:!0},{key:"",breakpoint:1367,container:1920-1920/1380*200,targetPixel:1920/1380,viewport:1920,fluid:!0},{key:"",breakpoint:1921,container:1920-1920/1380*200,targetPixel:1920/1380,viewport:1920,fluid:!1}];function u(e){var l;let{url:a,breakpoints:o={},mimeType:u,width:d="100cw",height:m,ratio:_,objectPosition:p={x:50,y:50},objectFit:v="cover",params:h={},maxPixelRatio:f=2,multiple:x=20,className:b="",alt:g="",...y}=e,A=0,j=0,N=[],k=!0,C={},F=e=>e.slice(-2),S=(e,l)=>{let a=F(e),t=Number(e.slice(0,-2));return"cw"===a?l.container*t/100:"vw"===a?l.viewport*t/100:"px"===a?l.targetPixel*t:Math.round(t)};
1c.forEach(e=>{let l=null==o?void 0:o[e.key];u=(null==l?void 0:l.mimeType)||u,d=(null==l?void 0:l.width)||d,m=(null==l?void 0:l.height)||m,_=(null==l?void 0:l.ratio)||_,a=(null==l?void 0:l.url)||a,v=(null==l?void 0:l.objectFit)||v,p=(null==l?void 0:l.objectPosition)||p,h=(null==l?void 0:l.params)||h,"contain"===v&&Object.assign(h,{func:"fit",fit_enlarge:1}),"fill"===v&&Object.assign(h,{func:"cover"}),((null==l?void 0:l.height)||(null==l?void 0:l.ratio)||(null==l?void 0:l.url))&&(k=!0);let t="image/svg+xml"===u,r={unit:F(d),exactWidth:Math.round(d?S(d,e):0),width:0,height:0};if(r.width=Math.ceil(r.exactWidth/x)*x,r.height=Math.round(m?S(m,e):r.width&&_?r.width/_:0),e.key&&(C["--object-fit-".concat(e.key)]=v,C["--object-position-".concat(e.key)]="".concat(p.x,"% ").concat(p.y,"%"),_&&(C["--aspect-ratio-".concat(e.key)]="".concat(_))),k){let l={};if(A=r.width,j=r.height,t)l[""]=(0,n.I)(a,{...h,force_format:"original"}).href;else for(let e=1;e<=f;e++)l["".concat(r.width*e,"w")]=(0,n.I)(a,{...h,...t?{force_format:"original"}:{width:r.width*e||void 0,height:r.height*e||void 0,gravity:"".concat(p.x,"p,").concat(p.y,"p"),force_format:"webp"}}).href;N.push({media:"(min-width: ".concat(e.breakpoint,"px)"),src:(0,n.I)(a,{...h,...t?{force_format:"original"}:{width:r.width||void 0,height:r.height||void 0,gravity:"".concat(p.x,"p,").concat(p.y,"p"),force_format:"webp"}}).href,srcSet:l,sizes:t?{}:{"":e.fluid?"".concat(r.exactWidth/(e.viewport/100),"vw"):"".concat(r.exactWidth,"px")},width:r.width||void 0,height:r.height||void 0})}else{A=Math.max(r.width,A),j=Math.max(r.height,j);for(let l=1;l<=f;l++){let i=N.at(-1);if(!i)return;i.src=(0,n.I)(a,{...h,...t?{force_format:"original"}:{width:A||void 0,height:j||void 0,gravity:"".concat(p.x,"p,").concat(p.y,"p"),force_format:"webp"}}).href,t||(i.srcSet["".concat(r.width*l,"w")]=(0,n.I)(a,{...h,...t?{force_format:"original"}:{width:r.width*l||void 0,height:r.height*l||void 0,gravity:"".concat(p.x,"p,").concat(p.y,"p"),force_format:"webp"}}).href,i.sizes["(min-width: ".concat(e.breakpoint,"px)")]=e.fluid?"".concat(r.exactWidth/(e.viewport/100),"vw"):"".concat(r.exactWidth,"px")),i.width=A||void 0,i.height=j||void 0}}k=!1});let w=N.map(e=>({...e,srcSet:Object.entries(e.srcSet).map(e=>{let[l,a]=e;return"".concat(a," ").concat(l).trim()}).join(", ")||void 0,sizes:Object.entries(e.sizes).map(e=>{let[l,a]=e;return"".concat(l," ").concat(a).trim()}).reverse().join(", ")||void 0})),{media:q,...T}=null!=(l=w.at(0))?l:{},P=w.slice(1).reverse();return(0,t.jsxs)("picture",{className:(0,r.A)(s().picture),style:C,children:[P.map((e,l)=>(0,t.jsx)("source",{...e,src:void 0},l)),(0,t.jsx)(i.default,{...T,...y,className:(0,r.A)(s().picture__image,b),alt:g})]})}},85402:e=>{e.exports={block:"Block_block__64Y6f","block--text-like":"Block_block--text-like__7ooG7","block--media":"Block_block--media__n_iX3","block--buttons":"Block_block--buttons__3gRC_","block--youtube":"Block_block--youtube__6hqmg","block__youtube-facade":"Block_block__youtube-facade__kicl3","block__youtube-thumbnail":"Block_block__youtube-thumbnail__kaCvp","block__youtube-play":"Block_block__youtube-play__oS11Q","block--panel":"Block_block--panel__6Iz5f","block--panel--background":"Block_block--panel--background__WDFJP","block--panel--pane":"Block_block--panel--pane__tGzS1","block--panel--pane--background-image":"Block_block--panel--pane--background-image__uys9s","block--panel--pane--background-slides":"Block_block--panel--pane--background-slides__k9TLe","block--panel--pane--background-video":"Block_block--panel--pane--background-video__N_m2H","block--panel--pane--body":"Block_block--panel--pane--body__RfRRi","block--panel--pane--content":"Block_block--panel--pane--content__g2wxW","block--panel-transparent":"Block_block--panel-transparent__eCi11","blocks-column":"Block_blocks-column__qsMG0","blocks-column--vertical-align-start":"Block_blocks-column--vertical-align-start__uh_KI","blocks-column--vertical-align-center":"Block_blocks-column--vertical-align-center__QMOzf","blocks-column--vertical-align-end":"Block_blocks-column--vertical-align-end__SiyEF","blocks-column--vertical-align-stretch":"Block_blocks-column--vertical-align-stretch__F6CQS","blocks-column--horizontal-align-start":"Block_blocks-column--horizontal-align-start__KFUgL","block--logos":"Block_block--logos__fEa2g",block__logos:"Block_block__logos__sIJ1P","blocks-column--horizontal-align-center":"Block_blocks-column--horizontal-align-center__La95q","blocks-column--horizontal-align-en
1d":"Block_blocks-column--horizontal-align-end__0euHu","blocks-column--horizontal-align-stretch":"Block_blocks-column--horizontal-align-stretch__qSiX5"}},85637:(e,l,a)=>{"use strict";a.d(l,{A:()=>u});var t=a(95155),r=a(12115),n=a(76065);a(19711);var i=a(44318),o=a.n(i),s=a(79121);let c=300;function u(e){let{overlay:l,placement:a="top",className:i,ariaLabel:u,children:d}=e,[m,_]=(0,r.useState)(!1),[p,v]=(0,r.useState)(!1),[h,f]=(0,r.useState)(!1),x=(0,r.useRef)(void 0);return(0,t.jsx)(n.A,{visible:m,onVisibleChange:e=>{_(e),v(!0),clearTimeout(x.current),x.current=setTimeout(()=>v(!1),c)},afterVisibleChange:e=>f(e),placement:a,overlay:l,overlayClassName:(0,s.A)(o().tooltip,m&&h?"rc-tooltip--visible":"",p?"rc-tooltip--fading":""),trigger:["hover","click"],overlayStyle:{"--transition-duration":"".concat(c,"ms")},children:(0,t.jsx)("button",{className:(0,s.A)(o()["rc-tooltip-toggle"],m?o()["rc-tooltip-toggle--visible"]:"",i),type:"button","aria-label":u,children:d})})}},86381:e=>{e.exports={time:"FormFieldTime_time__M07iL",time__colon:"FormFieldTime_time__colon__NS_bk",time__select:"FormFieldTime_time__select__1aBAY"}},86412:(e,l,a)=>{"use strict";function t(e){var l;return(null!=(l=e.replaceAll("-","").match(/[a-zA-Z]+|[0-9]+/g))?l:[]).map(e=>4===e.length?e.substring(0,2)+"-"+e.substring(2,4):e).join("-").toUpperCase()}a.d(l,{B:()=>t})},87201:(e,l,a)=>{"use strict";a.d(l,{FormEstablishmentContextProvider:()=>i,Y:()=>o});var t=a(95155),r=a(12115);let n=r.createContext({});function i(e){let{children:l,...a}=e;return(0,t.jsx)(n.Provider,{value:{...a},children:l})}let o=()=>(0,r.useContext)(n)},87403:(e,l,a)=>{"use strict";a.d(l,{ge:()=>o,wg:()=>i});var t=a(95155),r=a(12115);let n=r.createContext({});function i(e){let{children:l,...a}=e;return(0,t.jsx)(n.Provider,{value:{...a},children:l})}let o=()=>(0,r.useContext)(n)},88992:(e,l,a)=>{"use strict";a.d(l,{OverflowHiddenStoreInitializer:()=>u,L:()=>c});var t=a(12115),r=a(95988);let n="datamotive-frontend";function i(){return window.self!==window.top}function o(){if(!window.rootDomainUrl)return null;try{return new URL(window.rootDomainUrl).origin}catch(e){return null}}function s(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i())return;let a=o();a&&window.parent.postMessage({source:n,event:e,...l},a)}let c=(0,r.vt)(e=>({items:[],addItem:l=>e(e=>({items:[...e.items.filter(e=>e!==l),l]})),removeItem:l=>e(e=>({items:[...e.items.filter(e=>e!==l)]}))})),u=()=>{let{items:e}=c(e=>({items:e.items})),l=e.length,a=l>0,r=(0,t.useRef)(a);return(0,t.useEffect)(()=>{window.document.body.classList[l>0?"add":"remove"]("body--overflow-hidden")},[l]),(0,t.useEffect)(()=>{r.current!==a&&(r.current=a,s(a?"overlay_opened":"overlay_closed"))},[a]),null}},89121:e=>{e.exports={field:"FormFieldLicensePlate_field__QkpSc",field__vehicle:"FormFieldLicensePlate_field__vehicle__BG7h7",field__icon:"FormFieldLicensePlate_field__icon__vrDE6",field__text:"FormFieldLicensePlate_field__text__6nWgW",field__button:"FormFieldLicensePlate_field__button__FVaM1"}},91674:e=>{e.exports={error:"Error_error__rUKBw"}},93629:e=>{e.exports={upload:"Upload_upload__OnEik",upload__field:"Upload_upload__field__Ne3OB",upload__label:"Upload_upload__label__Uktwr",upload__preview:"Upload_upload__preview__uOm_v",upload__icon:"Upload_upload__icon__i0Vtu",upload__image:"Upload_upload__image__DtQo4",upload__title:"Upload_upload__title__Pj_SC",upload__action:"Upload_upload__action__4Cgf2","upload--active":"Upload_upload--active__pHZle","upload--error":"Upload_upload--error__aKq40"}},93760:(e,l,a)=>{"use strict";a.d(l,{A:()=>g});var t=a(95155),r=a(12115),n=a(32511),i=a.n(n),o=a(52482),s=a(99028),c=a(22544),u=a(82158),d=a(73510),m=a(87403),_=a(87201),p=a(72346),v=a(20712),h=a(24415);function f(e){let{siteKey:l,enabled:a=!1}=e,[t,n]=(0,r.useState)(!1),i=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!a||!l)return void n(!1);if(document.querySelector('script[src*="recaptcha/api.js"]')){window.grecaptcha&&window.grecaptcha.ready(()=>{n(!0)});return}let e=document.createElement("script");return e.src="https://www.google.com/recaptcha/api.js?render=".concat(l),e.async=!0,e.defer=!0,e.onload=()=>{window.grecaptcha&&window.grecaptcha.ready(()=>{n(!0)})},document.head.appendChild(e),i.current=e,()=>{i.current&&i.current.parentNode&&i.current.parentNode.removeChild(i.current)}},[l,a]);let o=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"submit";if(!a||!l||!t||!window.grecaptcha)return null;try{return await window.grecaptcha.execute(l,{action:e})}catch(e){return console.error("reCAPTCHA execution failed:",e),null}};return{isReady:t,executeRecaptcha:o}}var x=a(5729);let b=e=>e?""+e:"";function g(e){var l,a,n,g,y;let{form:A=null,children:j}=e,[N,k]=(0,r.useState)(0),[C,F]=(0,r.useState)(null),[S,w]=(0,r.useState)({}),[q,T]=(0,r.useState)({}),[P,E]=(0,r.useState)(!1),[I,L]=(0,r.useState)([]),{brand:O,model:M,vehicleState:V}=(0,x.Y)(),{webspace:B="",locale:D}
1=(0,p.t)(),W=(0,d.useFormVehicleContext)(),z=(0,m.ge)(),R=(0,_.Y)(),{executeRecaptcha:Y}=f((0,r.useMemo)(()=>{var e,l,a;return{siteKey:null==A||null==(e=A.spamProtection)?void 0:e.reCaptchaSiteKey,enabled:null!=(a=null==A||null==(l=A.spamProtection)?void 0:l.reCaptchaEnabled)&&a}},[null==A||null==(l=A.spamProtection)?void 0:l.reCaptchaSiteKey,null==A||null==(a=A.spamProtection)?void 0:a.reCaptchaEnabled])),U=null!=(g=null==A?void 0:A.steps.filter(e=>0===e.rules.length||e.rules.every(e=>{let l=e.documentField.split("."),a=(0,u.bf)(S,l),t=l.at(0),r=A.steps.reduce((e,l)=>null!=e?e:l.fields.find(e=>e.name===t),null),n=(null==r?void 0:r.type)==="establishment"?null==a?void 0:a.name:a;return"equals"===e.comparison?(null==r?void 0:r.type)==="checkboxList"?!!Array.isArray(n)&&n.some(l=>b(l)===e.value):(null==r?void 0:r.type)==="checkbox"?(n?"1":"0")===e.value:b(n)===e.value:"is_not"===e.comparison?b(n)!==e.value:"is_empty"===e.comparison?""===b(n):"is_not_empty"===e.comparison?""!==b(n):"gt"===e.comparison?n>e.value:"gte"===e.comparison?n>=e.value:"lt"===e.comparison?n<e.value:"lte"===e.comparison?n<=e.value:"gt_days"===e.comparison?(0,h.A)(new Date(n)).getTime()>(0,v.A)((0,h.A)(Date.now()),e.value).getTime():"gte_days"===e.comparison?(0,h.A)(new Date(n)).getTime()>=(0,v.A)((0,h.A)(Date.now()),e.value).getTime():"lt_days"===e.comparison?(0,h.A)(new Date(n)).getTime()<(0,v.A)((0,h.A)(Date.now()),e.value).getTime():"lte_days"===e.comparison&&(0,h.A)(new Date(n)).getTime()<=(0,v.A)((0,h.A)(Date.now()),e.value).getTime()})))?g:[],H=(null==A||null==(n=A.payment)?void 0:n.enabled)?[...U,{name:A.payment.title||"Payment",submitButtonText:"Complete Payment",fields:[],rules:[],isPaymentStep:!0}]:U,K=null!=(y=U.reduce((e,l)=>[...e,...l.fields],[]))?y:[],Q=(0,c.mN)({mode:"onTouched"}),Z=()=>{let e={};return Object.entries(S).forEach(l=>{let[a,t]=l,r=K.find(e=>e.name===a);r&&("establishment"===r.type&&(t=null==t?void 0:t.id),"event"===r.type&&(t=Array.isArray(t)?t.map(e=>e.id):null==t?void 0:t.id),Object.assign(e,{[a]:t}))}),e},G=async()=>{var e,l,a,t,r,n;if(!A)return;let i=H[N];if(null==i?void 0:i.isPaymentStep)return;if(N<H.length-1)return k(N+1);let s=JSON.parse(null!=(t=sessionStorage.getItem("dm-utm"))?t:"{}"),c=K.find(e=>"establishment"===e.type),u=null!=(r=S[null==c?void 0:c.name])?r:R,d={brand:W.brand||O,model:W.model||M,edition:W.edition,licensePlate:W.licensePlate,manufacturingYear:W.constructionYear,fuelType:W.fuel,vehicleType:W.vehicleState||V,vehicleNumber:W.vehicleNumber,vehicleSlug:W.slug,bikeObjectId:W.bikeObjectId,bikeAccountId:W.bikeAccountId,bikeBarcode:W.bikeBarcode,establishment:null==u?void 0:u.id,searchTerms:W.searchTerms,vacancyTitle:z.title,vacancyLocationCity:z.locationCity,vacancyExternalId:z.externalId,gtmUserId:localStorage.getItem("dm-user-id")||null,fingerprint:"function"==typeof window.getFingerprint?window.getFingerprint():null,tid:"function"==typeof window.getTid?window.getTid():null,purchasePreviousPrice:null!=(n=null==(l=W.prices)||null==(e=l.purchase)?void 0:e.previousValue)?n:null};Object.entries(d).forEach(e=>{let[l,a]=e;a||delete d[l]}),E(!0);let m=null;if(null==(a=A.spamProtection)?void 0:a.reCaptchaEnabled)try{m=await Y("form_submit")}catch(e){Q.setError("recaptchaToken",{type:"submit",message:"Failed to generate reCAPTCHA token:"})}(0,o.rM)(A.id,Z(),d,B,s,D,"".concat(window.location.origin).concat(window.location.pathname),m).then(e=>{F(e.id),A.successPage.redirect&&(window.location.href=A.successPage.redirect)}).catch(e=>{let l=e.message;Object.entries(l).forEach(e=>{let[l,a]=e;Q.setError(l,{type:"submit",message:a})}),l.recaptchaToken&&Q.setError("recaptchaToken",{type:"submit",message:l.recaptchaToken});let a=H.find(e=>e.fields.some(e=>Object.keys(l).map(e=>e.split(".")[0]).includes(e.name)));a&&k(H.indexOf(a))}).finally(()=>{E(!1)})},J=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];k(0),F(null),(C||e)&&(w({}),T({}),L([]),Q.reset())};return(0,t.jsx)(s.hN,{form:A,steps:H,stepIndex:N,submitId:C,submitting:P,values:S,files:q,loading:I,setValue:(e,l)=>{w(a=>(0,u.HJ)(i()(a),e,"function"==typeof l?l((0,u.bf)(a,e)):l))},setFile:(e,l)=>{T(a=>(0,u.HJ)(i()(a),e,l))},setStepIndex:e=>{!C&&e<N&&k(e)},addLoading:e=>{L(l=>[...l.filter(l=>l!==e),e])},removeLoading:e=>{L(l=>l.filter(l=>l!==e))},reset:J,handleSubmit:G,children:(0,t.jsx)(c.Op,{...Q,children:j})})}},95415:(e,l,a)=>{"use strict";a.d(l,{A:()=>
1o});var t=a(95155),r=a(79121),n=a(29372),i=a.n(n);function o(e){let{icon:l,className:a="",...n}=e,o=["facebook","instagram","youtube","twitter","linkedin","tiktok","whatsapp"].includes(l);return(0,t.jsx)("span",{className:(0,r.A)(o?i()["icon--".concat(l)]:"material-symbol",i()[o?"icon":"icon-material"],a),...n,...!o&&{"data-material-symbol":l}})}},95822:(e,l,a)=>{"use strict";a.d(l,{A:()=>r});var t=a(12115);function r(e){let[l,a]=(0,t.useState)(e),r=(0,t.useRef)(null),n=(e,l)=>{var t;clearTimeout(null!=(t=r.current)?t:void 0),r.current=setTimeout(()=>{a(e)},l)};return(0,t.useEffect)(()=>()=>{var e;clearTimeout(null!=(e=r.current)?e:void 0)},[]),[l,n]}},98463:(e,l,a)=>{"use strict";a.d(l,{I:()=>r});var t=a(55120);function r(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return{href:""};let a=(0,t.A)("CLOUDIMAGE_TOKEN")&&!e.toString().includes(".cloudimg.io/v")?new URL("/v7/".concat(e),"https://".concat((0,t.A)("CLOUDIMAGE_TOKEN"),".cloudimg.io/")):new URL(e);return Object.entries(l).forEach(e=>{let[l,t]=e;t&&("gravity"!==l||"50p,50p"!==t)&&a.searchParams.set(l,t)}),"true"===(0,t.A)("APP_TEST_MODE")?{href:"/placeholder.svg"}:a}},98804:(e,l,a)=>{"use strict";a.d(l,{PonMobilityContextProvider:()=>i,f:()=>o});var t=a(95155),r=a(12115);let n=r.createContext({});function i(e){let{children:l,params:a}=e;return(0,t.jsx)(n.Provider,{value:{params:a},children:l})}let o=()=>(0,r.useContext)(n)},99028:(e,l,a)=>{"use strict";a.d(l,{hN:()=>i,xW:()=>o});var t=a(95155),r=a(12115);let n=r.createContext({form:null,steps:[],stepIndex:0,submitId:null,submitting:!1,values:{},files:{},loading:[],setValue:()=>{},setFile:()=>{},setStepIndex:()=>{},addLoading:()=>{},removeLoading:()=>{},handleSubmit:()=>{},reset:()=>{}});function i(e){let{children:l,...a}=e;return(0,t.jsx)(n.Provider,{value:{...a},children:l})}let o=()=>(0,r.useContext)(n)}}]);

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.