PageSourceSearch

https://www.santanderconsumer.fi/_next/static/chunks/@b2c-dk/consumer-loan-flow.9593340a01aa6305.js

js santanderconsumer.fi collected 2026-09-25 00:40:26 UTC 86,610 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2497],{800:e=>{e.exports=function(e,a,t){var n=-1,i=e.length;a<0&&(a=-a>i?0:i+a),(t=t>i?i:t)<0&&(t+=i),i=a>t?0:t-a>>>0,a>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+a];return o}},2702:(e,a,t)=>{var n=t(58470);e.exports=function(e){return null==e?"":n(e)}},4e3:(e,a,t)=>{t.d(a,{A:()=>s});var n=t(54568),i=t(7620),o=t(38247),r=t(86985);let s=(0,i.forwardRef)(function({name:e,texts:a,prefix:t,dependentFields:i,options:s,required:l,valid:c,validate:d,...p},u){return(0,n.jsx)(o.A,{required:l&&(a.errors?.required??!0),dependentFields:i,valid:c,validate:d,children:(0,n.jsx)(r.A,{label:a.label,sublabel:a.sublabel,help:a.help,placeholder:a.placeholder,readOnlyNoValueReplacement:a.readOnlyNoValueReplacement,options:s??a.options,name:`${t?t+".":""}${e}`,"data-name":e,ref:u,selectOptions:a.selectOptions,selectedOptions:a.selectedOptions,...p})})})},6243:(e,a,t)=>{var n=t(38026),i="object"==typeof self&&self&&self.Object===Object&&self;e.exports=n||i||Function("return this")()},8587:(e,a,t)=>{var n=t(51959),i=Object.prototype,o=i.hasOwnProperty,r=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var a=o.call(e,s),t=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=r.call(e);return n&&(a?e[s]=t:delete e[s]),i}},10218:(e,a,t)=>{t.d(a,{A:()=>s});var n=t(54568),i=t(7620),o=t(38247),r=t(88918);let s=(0,i.forwardRef)(function({name:e,texts:a,prefix:t,dependentFields:i,required:s,valid:l,validate:c,...d},p){return(0,n.jsx)(o.A,{required:s&&(a.errors?.required??!0),dependentFields:i,valid:l,validate:c,children:(0,n.jsx)(r.A,{label:a.label,sublabel:a.sublabel,help:a.help,placeholder:a.placeholder,readOnlyNoValueReplacement:a.readOnlyNoValueReplacement,selectedTitle:a.selectedTitle,name:`${t?t+".":""}${e}`,"data-name":e,ref:p,...d})})})},14934:(e,a,t)=>{t.d(a,{A:()=>D});var n=t(54568),i=t(48442),o=t(10891),r=t(39818),s=t(7620),l=t(94786),c=t(21524),d=t(38247),p=t(35636),u=t(66343),m=t(69872),g=t(36626),h=t(79900),f=t(88918),A=t(79320),y=t(98445),C=t(80827),x=t(3584),v=t(80013);function b({texts:e,state:a,prefix:t,disabled:i,onLookupByName:o,onLookupByRegistrationNumber:r,askForCarPrice:w,...S}){var D,I;let P,j=t?t+".":"",{previewMode:k}=(0,x.A)(),{formats:T}=(0,v.A)(),R=e=>({key:e.modelVariantId,text:e.description}),q=(0,s.useRef)(null),L=(0,s.useRef)(null),F=(0,s.useRef)(null),[N,E]=(0,s.useState)(a.details),[M,$]=(0,s.useState)(a.searchByRegistrationNumber),[O,U]=(0,s.useState)(a.registrationNumber),[H,B]=(0,s.useState)(),[V,z]=(0,s.useState)(a.modelVariantId),[_,K]=(0,s.useState)(a.details?[a.details]:[]),Z=_?.length>0,[W,G]=(0,s.useState)(!1),[Y,X]=(0,s.useState)([]),J={carSearched:(0,l.fY)(`${j}${y.f.CarSearched}`),registrationNumber:(0,l.fY)(`${j}${y.f.RegistrationNumber}`),details:(0,l.fY)(`${j}${y.f.Details}`)},Q=async e=>{try{return await o(e)}finally{q.current?.focus()}},ee=async()=>{if(O&&r)try{G(!0),K([]);let e=await r(O);K(e),B(O),J.carSearched.unregister(),setTimeout(async()=>{await J.registrationNumber.validate({shouldFocus:!0})},50),e?.length||setTimeout(()=>F.current?.focus(),50)}finally{G(!1)}},ea=(0,s.useMemo)(()=>i||W||!O||O===H,[i,W,H,O]),et=async e=>{"Enter"===(e.key||e.type)&&(e.preventDefault(),ea||await ee())},en=async(a,t)=>{U(a?.toUpperCase()),E(void 0),Z&&B(void 0),K([]),z(void 0),a?(t&&(t.validate=!0),J.carSearched.register({required:e.searchRequiredMessage}),J.carSearched.reset()):(J.registrationNumber.error&&J.registrationNumber.reset(),t&&(t.validate=!1),J.carSearched.unregister())},ei=(0,s.useMemo)(()=>({required:a=>Z||!!a||(e.registrationNumber?.errors?.required??!1),notFound:a=>Z||H!==a?.toUpperCase()||(e.registrationNumber?.errors?.invalid??!1)}),[Z,H,e.registrationNumber?.errors?.invalid,e.registrationNumber?.errors?.required]);return D=()=>{E(void 0),K([]),U(void 0),z(void 0),setTimeout(()=>J.details.reset(),200),M||J.carSearched.unregister()},I=[M],P=(0,s.useRef)(!0),(0,s.useEffect)(()=>{let e=()=>void 0;if(P.current||(e=D()),e&&"function"==typeof e)return e},I),(0,s.useEffect)(()=>{P.current=!1},[]),(0,s.useEffect)(()=>{_&&X(_.map(R))},[_]),(0,s.useEffect)(()=>
1{if(void 0===V)return;let e=_.find(e=>e.modelVariantId===V);J.details.setValue(e),J.carSearched.unregister()},[_,V]),(0,n.jsxs)(c.A,{...S,children:[r&&(0,n.jsxs)(n.Fragment,{children:[e.searchByRegistrationNumber&&(0,n.jsx)(d.A,{validate:{required:a=>"boolean"==typeof a||(e.searchByRegistrationNumber.errors?.required??!1)},children:(0,n.jsx)(p.A,{label:e.searchByRegistrationNumber.label,sublabel:e.searchByRegistrationNumber.sublabel,help:e.searchByRegistrationNumber.help,options:e.searchByRegistrationNumber.options,disabled:i||W,value:M,name:`${j}${y.f.SearchByRegistrationNumber}`,"data-name":y.f.SearchByRegistrationNumber,onKeyChange:$})}),(0,n.jsxs)(u.A,{show:!0===M||k,animation:"none",children:[e.registrationNumber&&(0,n.jsx)(d.A,{valid:e=>!e.error&&(_.length>0||void 0),validate:ei,children:(0,n.jsx)(m.A,{ref:F,label:e.registrationNumber.label,placeholder:e.registrationNumber.placeholder,sublabel:e.registrationNumber.sublabel,help:e.registrationNumber.help,disabled:i||W,allowedCharactersRegex:"[\\p{L}\\p{N} ]",addon:(0,n.jsx)(g.default,{className:C("CarLookup-module_findCarButton__EKk63",{invalid:!!J.carSearched.error}),name:"findCar",ref:L,label:e.findCarButton.label,disabled:ea,loading:W,onClick:ee,onBlur:()=>J.carSearched.validate(),"data-name":"findCarButton"}),name:`${j}${y.f.RegistrationNumber}`,"data-name":y.f.RegistrationNumber,value:O,onValueChange:en,onKeyDown:et,autoComplete:"off",onBlur:e=>{e.relatedTarget!==L.current&&J.carSearched.validate()}})}),(0,n.jsx)(u.A,{show:!!J.carSearched.error||k,children:(0,n.jsx)(h.A,{valid:!1,className:"CarLookup-module_findCarValidation__aMu-x","data-name":"registrationNumber.errors",children:J.carSearched.error})}),(0,n.jsx)(u.A,{show:_.length>0||k,children:(0,n.jsx)(d.A,{required:e.modelVariant.errors?.required??!0,children:(0,n.jsx)(p.A,{label:e.modelVariant.label,sublabel:e.modelVariant.sublabel,help:e.modelVariant.help,options:k?[{key:"",text:"Sample Car Variant"}]:Y,disabled:i||W,value:V,name:`${j}${y.f.ModelVariantId}`,"data-name":"modelVariant",onValueChange:z,vertical:!0})})})]})]}),e.details&&(0,n.jsx)(u.A,{show:!1===M||!r||k,animation:"none",children:(0,n.jsx)(d.A,{required:e.details.errors?.required??!0,children:(0,n.jsx)(f.A,{ref:q,label:e.details.label,placeholder:e.details.placeholder,sublabel:e.details.sublabel,help:e.details.help,selectedTitle:e.details.selectedTitle,disabled:i||W,name:`${j}${y.f.Details}`,"data-name":y.f.Details,value:N,options:Q,onSelectable:e=>e?.modelVariantId!==null,onGetText:e=>e.description,onGetSelectedTemplate:e=>(0,n.jsx)("p",{children:e?.description}),onValueChange:E,allowedCharactersRegex:"[\\p{L}\\p{N} ,.+/\\-]",minChars:3})})}),(w||k)&&e.carPrice&&(0,n.jsx)(A.A,{name:`${j}${y.f.CarPrice}`,prefix:t,required:!0,texts:e.carPrice,format:T.money,disabled:i,validateOnChange:!1,value:a?.details?.estimatedPrice,min:e.carPrice.range?.min,max:e.carPrice.range?.max})]})}var w=t(23629);let{component:S}=(0,i.T)("sn-step-car");function D({id:e,texts:a,state:t,onBack:i,onContinue:s,onLookupByName:l,onLookupByRegistrationNumber:c,askForCarPrice:d,...p}){let{valid:u,loading:m,submitted:g,handleStateChange:h}=(0,o.A)();return(0,n.jsxs)(r.A,{id:e,onSubmit:s,onStateChange:h,...a.step,...p,className:S(),children:[(0,n.jsx)(b,{texts:a.carLookup,state:t??{},onLookupByName:l,onLookupByRegistrationNumber:c,disabled:m,"data-name":"carLookup",askForCarPrice:d}),(0,n.jsx)(w.A,{texts:a.navigation,onBack:i,continueDisabled:!u||g,loading:m,"data-name":"navigation"})]})}},15240:e=>{e.exports=function(e){return e.split("")}},17280:(e,a,t)=>{var n=t(15240),i=t(64796),o=t(80592);e.exports=function(e){return i(e)?o(e):n(e)}},17674:e=>{e.exports=function(e,a){for(var t=-1,n=null==e?0:e.length,i=Array(n);++t<n;)i[t]=a(e[t],t,e);return i}},18955:(e,a,t)=>{var n=t(98579);e.exports=function(e,a){for(var t=e.length;t--&&n(a,e[t],0)>-1;);return t}},20442:(e,a,t)=>{t.d(a,{UL:()=>n,ln:()=>i});var n=t(60638);function i(){return`${function(){let e=(0,n.get)("_ga")?.toString();if(!e)return"";let a=e.split(".");return a&&4===a.length?a.slice(-2).join("."):""}()} # ${function(){let e=(0,n.find)(/^_ga_.+$/)?.toString();if(!e)return"";let a=/GS\d\.\d\.s([^$]+)\$/.exec(e);return a?.[1]??""}()}`}},21860:e=>{var a=/\s/;e.exports=function(e){for(var t=e.length;t--&&a.test(e.charAt(t)););return t}},22573:(e,a,t)=>{t.d(a,{A:()=>r});var n=t(54568);let{component:i,element:o}=(0,t(48442).T)("sn-separated-content");function r({className:e,hideTop:a,hideBottom:t,children:s}){return(0,n.jsxs)("div",{className:i(e),"data-component":"SeparatedContent",children:[!a&&(0,n.jsx)("hr",{className:o("line")}),(0,n.jsx)("div",{className:o("content"),children:s}),!t&&(0,n.jsx)("hr",{className:o("line")})]})}},23156:(e,a,t)=>{t.r(a),t.d(a,{Flow:()=>aZ,default:()=>aW});var n,i,o,r,s,l,c,d,p,u,m,g,h,f,A,y,C,x,v=t(54568),b=t(7620),w=t(82676),S=t(7152),D=t(93830),I=t(16531),P=t(2456),j=t(50039),k=t(99015),T=t(41867),R=t(65939),q=t(41055),L=t(98445),F=t(54558),N=t(77406),E=t.n(N),M=t(16069),$=t(70126),O=((n={}).CreateApplicationDk="CreateApplicationDk",n),U=((i={}).Pending="Pending",i.Approved="Approved",i.Declined="Declined",i.Cancelled="Cancelled",i.Investigation="Investigation",i.Signed="Signed",i.Initial="Initial",i),H=((o={}
1).Undefined="Undefined",o.Subaio="Subaio",o.Monthio="Monthio",o),B=((r={}).OtherInformationRequiredDataDk="OtherInformationRequiredDataDk",r.TermsAndConditionsRequiredDataDk="TermsAndConditionsRequiredDataDk",r.RegisterPaymentServiceRequiredDataDk="RegisterPaymentServiceRequiredDataDk",r.ApplicantAddressRequiredDataDk="ApplicantAddressRequiredDataDk",r.CoApplicantAddressRequiredDataDk="CoApplicantAddressRequiredDataDk",r.ApplicantAuthenticationRequiredDataDk="ApplicantAuthenticationRequiredDataDk",r.CoApplicantAuthenticationRequiredDataDk="CoApplicantAuthenticationRequiredDataDk",r.DocumentsRequiredDataDk="DocumentsRequiredDataDk",r.OtherApplicantAuthenticationDataDk="OtherApplicantAuthenticationDataDk",r.ApplicantPsd2ConsentRequiredDataDk="ApplicantPsd2ConsentRequiredDataDk",r.CoApplicantPsd2ConsentRequiredDataDk="CoApplicantPsd2ConsentRequiredDataDk",r.Signing="SigningDataDk",r.AmlRequiredDataDk="AmlRequiredDataDk",r),V=((s={}).TermsAndConditionsDk="TermsAndConditionsDk",s.RegisterPaymentServiceDk="RegisterPaymentServiceDk",s.OtherInformationDk="OtherInformationDk",s.AddressDk="AddressDk",s.CoAddressDk="CoAddressDk",s.CoTaxConsentDk="CoTaxConsentDk",s.DocumentsRequiredDk="DocumentsRequiredDk",s.SignContractDk="SignContractDk",s.InstantUpsellDk="InstantUpsellDk",s),z=((l={}).Applicant="Applicant",l.CoApplicant="CoApplicant",l),_=t(48442),K=t(10891),Z=t(39818),W=t(16681),G=t(23629),Y=t(89691),X=t(47780),J=t(10218),Q=((c={}).FirstName="firstName",c.LastName="lastName",c.Address="address",c);function ee({texts:e,state:a,disabled:t,onGetAddresses:n,prefix:i="","data-name":o,readOnly:r,...s}){let l=e=>e&&(!!e.id||!!e.city&&!!e.houseNumber&&!!e.streetName),c=async e=>{if(e&&e.id&&!e.streetName){let a=(await n(e.id))[0];Object.assign(e,a)}};return(0,v.jsxs)(Y.A,{disabled:t,name:i||o,title:e.title,...s,children:[(0,v.jsx)(X.A,{required:!0,texts:e.firstName,disabled:t,prefix:i,name:Q.FirstName,"data-name":Q.FirstName,value:a?.firstName,maxLength:100,readOnly:!!r}),(0,v.jsx)(X.A,{required:!0,texts:e.lastName,disabled:t,prefix:i,name:Q.LastName,"data-name":Q.LastName,value:a?.lastName,maxLength:100,readOnly:!!r}),(0,v.jsx)(J.A,{required:!0,texts:e.address,disabled:t,prefix:i,name:Q.Address,"data-name":Q.Address,value:a?.address,options:n,onSelectable:l,onGetText:e=>e.fullAddress+(l(e)?"":" "),onValueChange:c,readOnly:!!r})]})}let{component:ea}=(0,_.T)("sn-step-address");function et({id:e,texts:a,state:t,onBack:n,onContinue:i,onGetAddresses:o,...r}){let{valid:s,loading:l,submitted:c,handleStateChange:d}=(0,K.A)();return(0,v.jsxs)(Z.A,{id:e,onSubmit:i,onStateChange:d,...a.step,...r,className:ea(),children:[(0,v.jsx)(ee,{texts:a,state:t??{},"data-name":W.V.Applicant,disabled:l,onGetAddresses:o}),(0,v.jsx)(G.A,{texts:a.navigation,onBack:n,continueDisabled:!s||c,loading:l,"data-name":"navigation"})]})}var en=t(70260),ei=t(57232),eo=t(3584),er=t(30897),es=t(19239),el=t(15388),ec=t(27246),ed=t(37410),ep=t(80013),eu=((d={}).Ssn="ssn",d.Phone="phone",d.Email="email",d.EmailConfirmation="emailConfirmation",d.ProductConsent="productConsent",d.ProductConsentToggle="productConsentToggle",d);function em({texts:e,state:a,disabled:t,hideSsn:n,children:i,settings:o,prefix:r=W.V.Applicant,validation:s}){let{fields:l,mainDialingCode:c,texts:{countryCode:d}}=(0,ep.A)(),{email:p}=el.y$;return(0,v.jsxs)(v.Fragment,{children:[e.ssn&&(!n||r==W.V.CoApplicant)&&(0,v.jsx)(X.A,{required:!0,validate:o?.readOnlyFields?.ssn?void 0:{format:a=>a&&l.ssn.valid(a)||(e.ssn?.errors?.invalid??!1),age:a=>a&&(l.ssn.parse(a).age??0)>=(e.ssn?.minAge??20)||(e.ssn?.errors?.tooYoung??!1),...s?.ssn?.validate},dependentFields:s?.ssn?.dependentFields,texts:e.ssn,formatter:l.ssn,disabled:t,name:eu.Ssn,prefix:r,value:a.ssn,readOnly:o?.readOnlyFields?.ssn,autoComplete:"off"}),e.phone&&(0,v.jsx)(ec.A,{required:!0,validate:s?.phone?.validate,dependentFields:s?.phone?.dependentFields,texts:e.phone,disabled:t,prefix:r,name:eu.Phone,value:a.phone??c,handler:l.phone,countryCodeText:d}),e.email&&(0,v.jsx)(X.A,{required:!0,validate:{format:a=>p.valid(a)||(e.email.errors?.invalid??!1),...s?.email?.validate},dependentFields:s?.email?.dependentFields,texts:e.email,disabled:t,prefix:r,name:eu.Email,value:a.email}),e.emailConfirmation&&(0,v.jsx)(X.A,{required:!0,validate:{format:a=>p.valid(a)||(e.emailConfirmation.errors?.invalid??!1),...s?.emailConfirmation?.validate},dependentFields:s?.emailConfirmation?.dependentFields,texts:e.emailConfirmation,disabled:t,prefix:r,name:eu.EmailConfirmation,value:a.emailConfirmation}
1),i,e.productConsentToggle&&e.productConsent&&(0,v.jsx)(ed.A,{name:`${r}.${eu.ProductConsentToggle}`,"data-name":eu.ProductConsentToggle,description:e.productConsentToggle.description,link:e.productConsentToggle.link,expanded:e.productConsentToggle.expanded,children:(0,v.jsx)(ei.A,{name:eu.ProductConsent,value:a?.productConsent??!1,prefix:r,texts:e.productConsent})})]})}var eg=((p={}).DigitalConsent="digitalConsent",p),eh=((u={}).Applicant="applicant",u.CoApplicant="coApplicant",u.DigitalConsent="digitalConsent",u);let{component:ef,element:eA}=(0,_.T)("sn-step-personal-info");function ey({id:e,texts:a,state:t,withCoApplicant:n,isTopup:i,onBack:o,onContinue:r,...s}){let{previewMode:l}=(0,eo.A)(),c=(e=>{let{fields:a}=(0,ep.A)("dk"),t=(e,a)=>!!e&&!!a&&e.toLowerCase()===a.toLowerCase(),n=(e,t)=>!!e&&!!t&&a.ssn.format(e)===a.ssn.format(t);return{applicant:{ssn:{validate:{alreadyUsed:(a,t)=>!n(a,t?.coApplicant?.ssn)||(e.applicant.ssn?.errors?.alreadyUsed??!1)},dependentFields:`${eh.CoApplicant}.${eu.Ssn}`},phone:{validate:{alreadyUsed:(a,n)=>!t(a,n?.coApplicant?.phone)||(e.applicant.phone.errors?.alreadyUsed??!1)},dependentFields:`${eh.CoApplicant}.${eu.Phone}`},email:{validate:{alreadyUsed:(a,n)=>!t(a,n?.coApplicant?.email)||(e.applicant.email.errors?.alreadyUsed??!1),notEqual:(a,n)=>!n?.applicant?.emailConfirmation||t(a,n?.applicant?.emailConfirmation)||(e.applicant.email.errors?.notEqual??!1)},dependentFields:[`${eh.CoApplicant}.${eu.Email}`,`${eh.Applicant}.${eu.EmailConfirmation}`]},emailConfirmation:{validate:{notEqual:(a,n)=>!n?.applicant?.email||t(a,n?.applicant?.email)||(e.applicant.emailConfirmation.errors?.notEqual??!1)},dependentFields:`${eh.Applicant}.${eu.Email}`}},coApplicant:{ssn:{validate:{alreadyUsed:(a,t)=>!n(a,t?.applicant?.ssn)||(e.coApplicant?.ssn?.errors?.alreadyUsed??!1)},dependentFields:`${eh.Applicant}.${eu.Ssn}`},phone:{validate:{alreadyUsed:(a,n)=>!t(a,n?.applicant?.phone)||(e.coApplicant?.phone?.errors?.alreadyUsed??!1)},dependentFields:`${eh.Applicant}.${eu.Phone}`},email:{validate:{alreadyUsed:(a,n)=>!t(a,n?.applicant?.email)||(e.coApplicant?.email?.errors?.alreadyUsed??!1),notEqual:(a,n)=>!n?.coApplicant?.emailConfirmation||t(a,n?.coApplicant?.emailConfirmation)||(e.coApplicant?.email?.errors?.notEqual??!1)},dependentFields:[`${eh.Applicant}.${eu.Email}`,`${eh.CoApplicant}.${eu.EmailConfirmation}`]},emailConfirmation:{validate:{notEqual:(a,n)=>!n?.coApplicant?.email||t(a,n?.coApplicant?.email)||(e.coApplicant?.emailConfirmation?.errors?.notEqual??!1)},dependentFields:`${eh.CoApplicant}.${eu.Email}`}}}})(a),[d,p]=(0,b.useState)(!!t?.withCoApplicant&&n);return(0,v.jsx)(er.A,{id:e,texts:a,state:t,onBack:o,onContinue:r,className:ef(),...s,withCoApplicant:n,beforeCoApplicant:t?.withCoApplicant&&n&&!a.coApplicantToggle?(0,v.jsx)("hr",{}):null,onToggleApplicant:p,renderApplicant:e=>(0,v.jsx)(em,{texts:e.texts,state:e.state??{},disabled:e.disabled,hideSsn:i,prefix:e.prefix,validation:c[e.prefix],settings:e.settings}),children:a.digitalConsent&&(0,v.jsxs)(es.A,{texts:a.digitalConsent,className:eA("digital-consent"),prefix:eh.DigitalConsent,children:[(d||l)&&a.applicant.title&&(0,v.jsx)(en.A,{tag:"h2","data-name":`${eh.Applicant}.title`,children:a.applicant.title}),(0,v.jsx)(ei.A,{prefix:eh.Applicant,name:eg.DigitalConsent,value:t?.applicant?.digitalConsent??!1,texts:a.applicant.digitalConsent}),(d||l)&&a.coApplicant?.digitalConsent&&(0,v.jsxs)(v.Fragment,{children:[a.coApplicant.title&&(0,v.jsx)(en.A,{tag:"h2","data-name":`${eh.CoApplicant}.title`,children:a.coApplicant.title}),(0,v.jsx)(ei.A,{prefix:eh.CoApplicant,name:eg.DigitalConsent,value:t?.coApplicant?.digitalConsent??!1,texts:a.coApplicant.digitalConsent})]})]})})}var eC=t(82434),ex=t(76023);let{element:ev,component:eb}=(0,_.T)("sn-waiting-for-consents");function ew({id:e,texts:a,onContinue:t,withCoApplicant:n,useThreeSections:i,state:o,...r}){let s=(0,b.useMemo)(()=>{let e=o?.applicantHasTaxConsent&&o?.coApplicantHasTaxConsent!==!1?a.psd2ConsentHeroImage:a.taxConsentHeroImage;return{...a,step:{...a.step,heroImage:e??a.step.heroImage},summary:(n&&i?a.firstSummary:a.summary)??a.summary}}
1,[a,n,i,o]);return(0,v.jsxs)(eC.A,{className:eb(),id:e,texts:s,onContinue:t,...r,children:[n&&s.extraSummary&&(0,v.jsx)(ex.A,{"data-testid":"extra-summary",className:ev("extra-summary"),...s.extraSummary}),n&&i&&s.thirdSummary&&(0,v.jsx)(ex.A,{"data-testid":"extra-summary",className:ev("extra-summary"),...s.thirdSummary})]})}var eS=t(19787),eD=t(72136),eI=t(66343),eP=t(15866),ej=((m={}).PoliticallyExposedPerson="politicallyExposedPerson",m.ThirdPartyDeclaration="thirdPartyDeclaration",m);let{component:ek,element:eT}=(0,_.T)("sn-step-other-information-applicant");function eR({texts:e,state:a,disabled:t,prefix:n="applicant"}){let{previewMode:i}=(0,eo.A)(),[o,r]=(0,b.useState)(a.politicallyExposedPerson);return(0,v.jsxs)(Y.A,{title:e.title,name:n,className:ek(),children:[(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.politicallyExposedPerson.errors?.required??!1)},texts:e.politicallyExposedPerson,disabled:t,name:ej.PoliticallyExposedPerson,prefix:n,value:o,onValueChange:r,...o&&{"aria-describedby":`${n}.${ej.PoliticallyExposedPerson}.info`}}),e.politicallyExposedPerson.info&&(0,v.jsx)(eI.A,{show:!0===o||i,animation:"none",children:(0,v.jsx)(eP.A,{type:"warning",id:`${n}.${ej.PoliticallyExposedPerson}.info`,className:eT("message"),label:e.politicallyExposedPerson.info.label,"data-name":`${ej.PoliticallyExposedPerson}.info`,children:(0,v.jsx)(en.A,{tag:"span",children:e.politicallyExposedPerson.info.content})})}),(0,v.jsx)(ei.A,{required:!0,texts:e.thirdPartyDeclaration,disabled:t,name:ej.ThirdPartyDeclaration,prefix:n,value:a?.thirdPartyDeclaration})]})}let{component:eq}=(0,_.T)("sn-step-other-information");function eL({id:e,texts:a,state:t,onBack:n,onContinue:i,showLoanPurpose:o,withCoApplicant:r,...s}){let{valid:l,loading:c,submitted:d,handleStateChange:p}=(0,K.A)();return(0,v.jsxs)(Z.A,{id:e,onSubmit:i,onStateChange:p,...a.step,...s,className:eq(),children:[o&&(0,v.jsx)(Y.A,{children:(0,v.jsx)(eS.A,{texts:a.loanPurpose,state:t??{},disabled:c,"data-name":"loanPurpose"})}),(0,v.jsx)(eR,{texts:{...a.applicant,title:r?a.applicant.title:void 0},state:t?.applicant||{},disabled:c,prefix:W.V.Applicant}),r&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("hr",{}),(0,v.jsx)(eR,{texts:a.coApplicant,state:t?.coApplicant||{},disabled:c,prefix:W.V.CoApplicant})]}),(0,v.jsx)(G.A,{texts:a.navigation,onBack:n,"data-name":"navigation",continueDisabled:!l||d,loading:c})]})}var eF=((g={}).RegistrationNumber="registrationNumber",g.AccountNumber="accountNumber",g);let{component:eN}=(0,_.T)("sn-payment-service"),eE=(e,a,t)=>RegExp(`^\\d{${a}${t?","+t:""}}$`).test(e);function eM({texts:e,state:a,disabled:t}){return(0,v.jsxs)(Y.A,{className:eN(),disabled:t,name:"paymentService",title:e.title,children:[(0,v.jsx)(X.A,{required:!0,validate:{format:a=>a&&eE(a,4)||(e.registrationNumber.errors?.invalid??!1)},texts:e.registrationNumber,disabled:t,name:eF.RegistrationNumber,value:a?.registrationNumber,maxLength:4}),(0,v.jsx)(X.A,{required:!0,validate:{format:a=>a&&eE(a,7,10)||(e.accountNumber.errors?.invalid??!1)},texts:e.accountNumber,disabled:t,name:eF.AccountNumber,value:a?.accountNumber,maxLength:10})]})}let{component:e$}=(0,_.T)("sn-step-register-payment-service");function eO({id:e,texts:a,state:t,onBack:n,onContinue:i,...o}){let{valid:r,loading:s,submitted:l,handleStateChange:c}=(0,K.A)();return(0,v.jsxs)(Z.A,{id:e,onSubmit:i,onStateChange:c,...a.step,...o,className:e$(),children:[(0,v.jsx)(eM,{texts:a.paymentService,state:t??{},disabled:s}),(0,v.jsx)(G.A,{texts:a.navigation,onBack:n,continueDisabled:!r||l,loading:s,"data-name":"navigation"})]})}var eU=t(21524),eH=t(24775),eB=t(64119);let{component:eV}=(0,_.T)("sn-step-other-applicant-resume");function ez({id:e,texts:a,onContinue:t,...n}){let{loading:i,submitted:o,handleStateChange:r}=(0,K.A)();return(0,v.jsxs)(Z.A,{id:e,onSubmit:t,onStateChange:r,faq:a.step.faq,footer:a.step.footer,n
1ameInProgressBar:a.step.nameInProgressBar,nameInUrl:a.step.nameInUrl,...n,className:eV(),children:[a.identifyMessage&&(0,v.jsx)(eH.A,{texts:a.identifyMessage,type:"success","data-name":"identifyMessage"}),(a.step.heading||a.step.preamble)&&(0,v.jsxs)(eU.A,{color:"yellow-light",children:[a.step.heading&&(0,v.jsx)("h1",{"data-name":"heading",children:a.step.heading}),a.step.preamble&&(0,v.jsx)(en.A,{tag:"div","data-name":"preamble",children:a.step.preamble})]}),(0,v.jsx)(ex.A,{...a.summary,"data-name":"summary"}),(0,v.jsx)(eB.A,{disabled:i||o,texts:a.auth,"data-name":"auth"})]})}var e_=t(66845),eK=t(31746),eZ=t(4692),eW=t(64203),eG=t(79344),eY=t(42493),eX=t(45135),eJ=t(21548),eQ=t(14934),e0=t(79320),e1=((h={}).Card="card",h.MoreLoans="moreLoans",h.TotalLoanAmount="totalLoanAmount",h.MortgageLoan="mortgageLoan",h.MortgageLoanMontlyAmount="mortgageLoanMontlyAmount",h.HouseLoan="houseLoan",h.HouseLoanMontlyAmount="houseLoanMontlyAmount",h.StudentLoan="studentLoan",h.StudentLoanMontlyAmount="studentLoanMontlyAmount",h.CarLoan="carLoan",h.CarLoanMontlyAmount="carLoanMontlyAmount",h.OtherLoan="otherLoan",h.OtherLoanMontlyAmount="otherLoanMontlyAmount",h),e2=t(54157);let{component:e4}=(0,_.T)("sn-step-economy-applicant");function e5({texts:e,state:a,disabled:t,children:n,prefix:i=W.V.Applicant}){let{previewMode:o}=(0,eo.A)(),{formats:r}=(0,ep.A)(),[s,l]=(0,b.useState)(a.moreLoans),[c,d]=(0,b.useState)(a.mortgageLoan),[p,u]=(0,b.useState)(a.moreLoans),[m,g]=(0,b.useState)(a.moreLoans),[h,f]=(0,b.useState)(a.moreLoans),[A,y]=(0,b.useState)(a.moreLoans);return(0,v.jsxs)(Y.A,{title:e.title,className:e4(),"data-name":i,children:[e.sourceOfFunds&&(0,v.jsx)(e2.A,{name:"sourceOfFunds",texts:e.sourceOfFunds,state:a,prefix:i,disabled:t,showEmployment:!0,showEmployedSince:!0,noDefaultEmploymentDates:!0,showEmployerName:!1,hidePrimaryIncomeRepayment:!0}),e.card&&(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.card.errors?.required??!1)},texts:e.card,disabled:t,value:a?.card,prefix:i,name:e1.Card}),e.moreLoans?.label&&(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.moreLoans.errors?.required??!1)},texts:e.moreLoans,disabled:t,value:a.moreLoans,prefix:i,name:e1.MoreLoans,onKeyChange:l}),e.totalLoanAmount?.label&&(0,v.jsx)(eI.A,{show:s||o,children:(0,v.jsx)(e0.A,{required:!0,validate:{format:a=>a&&a>0||(e.totalLoanAmount.errors?.invalid??!1)},format:r.money,texts:e.totalLoanAmount,prefix:i,name:e1.TotalLoanAmount,disabled:t,value:a.totalLoanAmount,validateOnChange:!1})}),e.mortgageLoan?.label&&(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.mortgageLoan.errors?.required??!1)},texts:e.mortgageLoan,disabled:t,value:a.mortgageLoan,prefix:i,name:e1.MortgageLoan,onKeyChange:d}),e.mortgageLoanMontlyAmount&&(0,v.jsx)(eI.A,{show:c||o,children:(0,v.jsx)(e0.A,{required:!0,validate:{format:a=>a&&a>0||(e.mortgageLoanMontlyAmount.errors?.invalid??!1)},format:r.money,texts:e.mortgageLoanMontlyAmount,prefix:i,name:e1.MortgageLoanMontlyAmount,disabled:t,value:a.mortgageLoanMontlyAmount,validateOnChange:!1})}),e.houseLoan?.label&&(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.houseLoan.errors?.required??!1)},texts:e.houseLoan,disabled:t,value:a.houseLoan,prefix:i,name:e1.HouseLoan,onKeyChange:u}),e.houseLoanMontlyAmount&&(0,v.jsx)(eI.A,{show:p||o,children:(0,v.jsx)(e0.A,{required:!0,validate:{format:a=>a&&a>0||(e.houseLoanMontlyAmount.errors?.invalid??!1)},format:r.money,texts:e.houseLoanMontlyAmount,prefix:i,name:e1.HouseLoanMontlyAmount,disabled:t,value:a.houseLoanMontlyAmount,validateOnChange:!1})}),e.studentLoan?.label&&(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.studentLoan.errors?.required??!1)},texts:e.studentLoan,disabled:t,value:a.studentLoan,prefix:i,name:e1.StudentLoan,onKeyChange:g}),e.studentLoanMontlyAmount&&(0,v.jsx)(eI.A,{show:m||o,children:(0,v.jsx)(e0.A,{required:!0,validate:{format:a=>a&&a>0||(e.studentLoanMontlyAmount.errors?.invalid??!1)},format:r.money,texts:e.studentLoanMontlyAmount,prefix:i,name:e1.StudentLoanMontlyAmount,disabled:t,value:a.studentLoanMontlyAmount,validateOnChange:!1})}),e.carLoan?.label&&(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.carLoan.errors?.required??!1)}
1,texts:e.carLoan,disabled:t,value:a.carLoan,prefix:i,name:e1.CarLoan,onKeyChange:f}),e.carLoanMontlyAmount&&(0,v.jsx)(eI.A,{show:h||o,children:(0,v.jsx)(e0.A,{required:!0,validate:{format:a=>a&&a>0||(e.carLoanMontlyAmount.errors?.invalid??!1)},format:r.money,texts:e.carLoanMontlyAmount,prefix:i,name:e1.CarLoanMontlyAmount,disabled:t,value:a.carLoanMontlyAmount,validateOnChange:!1})}),e.otherLoan?.label&&(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.otherLoan.errors?.required??!1)},texts:e.otherLoan,disabled:t,value:a.otherLoan,prefix:i,name:e1.OtherLoan,onKeyChange:y}),e.otherLoanMontlyAmount&&(0,v.jsx)(eI.A,{show:A||o,children:(0,v.jsx)(e0.A,{required:!0,validate:{format:a=>a&&a>0||(e.otherLoanMontlyAmount.errors?.invalid??!1)},format:r.money,texts:e.otherLoanMontlyAmount,prefix:i,name:e1.OtherLoanMontlyAmount,disabled:t,value:a.otherLoanMontlyAmount,validateOnChange:!1})}),n]})}let{component:e6}=(0,_.T)("sn-step-economy");function e3({id:e,texts:a,state:t,withCoApplicant:n,...i}){return(0,v.jsx)(er.A,{id:e,texts:a,state:t,className:e6(),withCoApplicant:n,disableCoApplicantToggleWithWarning:i.disableCoApplicantToggleWithWarning,beforeCoApplicant:t?.withCoApplicant&&n&&!a.coApplicantToggle?(0,v.jsx)("hr",{}):null,...i,renderApplicant:e=>(0,v.jsx)(e5,{prefix:e.prefix,texts:{...e.texts,title:void 0},state:e.state??{},disabled:e.disabled})})}var e8=t(5534),e7=t(80962),e9=t(4e3),ae=t(5697),aa=t(79840),at=t(58423),an=((f={}).Private="Private",f.Leased="Leased",f.Company="Company",f),ai=((A={}).NumberOfCars="numberOfCars",A.Ownership="ownership",A.Costs="costs",A.ServiceIncluded="serviceIncluded",A.Age="age",A.PublicTransportCosts="publicTransportCosts",A.FuelCosts="fuelCosts",A);let ao="cars",ar="number",as=e=>e?.ownership===an.Leased,al=e=>e?.ownership===an.Leased,ac=e=>e?.ownership===an.Private||e?.ownership===an.Leased&&e?.serviceIncluded===!1,{element:ad}=(0,_.T)("sn-cars");function ap({texts:e,state:a,prefix:t,disabled:n}){let{formats:i}=(0,ep.A)(),o=t?t+".":"",r=`${o}${ao}.`,[s,l]=(0,b.useState)(a.cars||Array.from(Array(e.numberOfCars.defaultValue??0)).map(()=>({}))),c=e=>{e&&(as(e)||(e.costs=void 0),al(e)||(e.serviceIncluded=void 0),ac(e)||(e.age=void 0))};return(0,v.jsxs)(eU.A,{noPadding:!0,name:ao,children:[(0,v.jsx)(aa.A,{texts:{...e.numberOfCars,format:{...i.integer,...e.numberOfCars.format}},prefix:t,name:ai.NumberOfCars,disabled:n,value:s?.length,onValueChange:(e=0)=>{let a=[...s];a.splice(Math.min(s.length,e),Math.max(s.length-e),...Array.from(Array(Math.max(e-s.length,0))).map(()=>({}))),l(a)}}),e.car.ownership.label&&(0,v.jsx)(at.A,{children:s?.map((a,t)=>(0,v.jsx)(eI.A,{show:!0,children:(0,v.jsxs)(eU.A,{color:"yellow-light",className:ad("car-item"),children:[(0,v.jsx)(e7.A,{required:!0,texts:{...e.car.ownership,label:e.car.ownership.label?.replace(`{${ar}}`,`${ae.sH.format(t+1,i.ordinal)}`)},prefix:`${r}${t}`,name:ai.Ownership,disabled:n,value:a?.ownership,onKeyChange:e=>((e,a)=>{if(!a)return;let t=[...s];t[e].ownership=a,c(t[e]),l(t)})(t,e)}),(0,v.jsx)(eI.A,{show:as(a),animation:"none",children:(0,v.jsx)(e0.A,{required:!0,texts:{...e.car.costs,label:e.car.costs.label?.replace(`{${ar}}`,`${ae.sH.format(t+1,i.ordinal)}`)},format:i.money,prefix:`${r}${t}`,name:ai.Costs,disabled:n,value:a?.costs,validateOnChange:!1})}),(0,v.jsx)(eI.A,{show:al(a),animation:"none",children:(0,v.jsx)(eD.A,{validate:{required:a=>"boolean"==typeof a||(e.car.serviceIncluded.errors?.required??!1)},texts:{...e.car.serviceIncluded,label:e.car.serviceIncluded.label?.replace(`{${ar}}`,`${ae.sH.format(t+1,i.ordinal)}`)},prefix:`${r}${t}`,name:ai.ServiceIncluded,disabled:n,value:a?.serviceIncluded,onKeyChange:e=>{let a;(a=[...s])[t].serviceIncluded=e,c(a[t]),l(a)}})}),(0,v.jsx)(eI.A,{show:ac(a),animation:"none",children:(0,v.jsx)(e7.A,{required:!0,texts:{...e.car.age,label:e.car.age.label?.replace(`{${ar}}`,`${ae.sH.format(t+1,i.ordinal)}`)},prefix:`${r}${t}`,name:ai.Age,disabled:n,value:a?.age})})]},t)},t))}),e.publicTransportCosts.label&&0===(s??[]).length&&(0,v.jsx)(e0.A,{required:!0,texts:e.publicTransportCosts,format:i.money,prefix:t,name:ai.PublicTransportCosts,disabled:n,value:a.publicTransportCosts,validateOnChange:!1}),e.fuelCosts.label&&(s??[]).some(e=>e.ownership&&e.ownership!==an.Company)&&(0,v.jsx)(e0.A,{required:!0,texts:e.fuelCosts,format:i.money,prefix:t,name:ai.FuelCosts,disabled:n,value:a.fuelCosts,validateOnChange:!1})]})}var au=((y={}).NumberOfChildren="numberOfChildren",y.Age="age",y);let am="children",{element:ag}=(0,_.T)("sn-children");function ah({texts:e,state:a,prefix:t,skipAge:n,disabled:i}){let{formats:o}=(0,ep.A)(),r=t?t+".":"",[s,l]=(0,b.useState)(a.children||Array.from(Array(e.numberOfChildren.defaultValue??0)).map(()=>({})));return(0,v.jsxs)(eU.A,{noPadding:!0,name:am,children:[(0,v.jsx)(aa.A,{texts:{...e.numberOfChildren,format:{...o.integer,...e.numberOfChildren.format}},prefix:t,name:au.NumberOfChildren,disabled:i,value:s?.length,onValueChange:(e=0)=>{let a=[...s];a.splice(Math.min(s.length,e),Math.max(s.length-e),...Array.from(Array(Math.max(e-s.length,0))).map(()=>({}))),l(a)}}),!n&&(0,v.jsx)(at.A,{className:ag("children-list"),children:s?.map((a,t)=>(0,v.jsx)(eI.A,{show:!0,children:(0,v.jsx)(e7.A,{required:!0,texts:{...e.child.age,label:e.child.age.label?.replace("{number}",`${ae.sH.format(t+1,o.ordinal)}`)},prefix:`${r}${am}.${t}`,name:au.Age,disabled:i,value:a?.age},t)},t))})]})}var af=t(71692),aA=t(37378),ay=t(51200),aC=t(43031);let{component:ax}=(0,_.T)("sn-step-living-situation");function av({id:e,texts:a,state:t,onBack:n,onContinue:i,...o}){return(0,v.jsx)(er.A,{id:e,texts:a,state:t,onBack:n,onContinue:i,
1className:ax(),beforeCoApplicant:(0,v.jsx)("hr",{}),renderApplicant:e=>(function({texts:e,state:a,prefix:t,disabled:n},i,o){let r,{previewMode:s}=(0,eo.A)(),l={applicant:(r=e=>({[e8.Lh.Citizenships]:{validate:{required:a=>("string"==typeof a||Array.isArray(a))&&0!==a.length||(e?.citizenships?.errors?.required??!1),count:a=>!!a&&("string"==typeof a||Array.isArray(a))&&a.length<=5||(e?.citizenships?.errors?.invalid??!1)}},[e8.Lh.SharedHousehold]:{validate:{required:a=>void 0!==a||(e?.sharedHousehold?.errors?.required??!1)}},[e8.Lh.ResidencePermit]:{validate:{required:a=>"string"==typeof a||(e?.residencePermit?.errors?.required??!1)}}}))(i.applicant),coApplicant:r(i.coApplicant)},[c,d]=(0,b.useState)(a.sharedHousehold),[p,u]=(0,b.useState)(!1),[m,g]=(0,b.useState)(a.maritalStatus),[h,f]=(0,b.useState)(!1),A=e=>{switch(g(e),e){case e8.j9.Married:case e8.j9.Cohabiting:f(!o.withCoApplicant);break;default:f(!1)}};return(0,b.useEffect)(()=>{A(a.maritalStatus)},[a?.maritalStatus]),(0,v.jsxs)(v.Fragment,{children:[e.employment&&(0,v.jsx)(aA.A,{state:a??{},texts:e.employment,disabled:n,prefix:t,showEmployedSince:o.employmentConfig?.showEmployedSince,showEmployerName:o.employmentConfig?.showEmployerName,showEmployedTo:o.employmentConfig?.showEmployedTo,noDefaultEmploymentDates:o.employmentConfig?.noDefaultEmploymentDates,"data-name":"employment"}),e.sharedHousehold&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(eD.A,{name:e8.Lh.SharedHousehold,prefix:t,texts:e.sharedHousehold,value:c,onKeyChange:d,disabled:n,validate:l[t][e8.Lh.SharedHousehold]?.validate}),(0,v.jsxs)(eI.A,{show:!1===c||s,animation:"none",children:[e.household&&(0,v.jsx)(ay.A,{texts:e.household,state:a,prefix:t,disabled:n,"data-name":"household"}),e.children&&(0,v.jsx)(ah,{skipAge:o.childrenConfig?.skipAge??!0,texts:e.children,state:a,prefix:t,disabled:n})]})]}),!e.sharedHousehold&&(0,v.jsxs)(v.Fragment,{children:[e.household&&(0,v.jsx)(ay.A,{texts:e.household,state:a,prefix:t,disabled:n,showHousingCostFor:[aC.B.Condominium,aC.B.Tenancy,aC.B.SecondhandApartment,aC.B.CollectiveHousing],"data-name":"household"}),e.children&&(0,v.jsx)(ah,{skipAge:o.childrenConfig?.skipAge??!1,texts:e.children,state:a,prefix:t,disabled:n})]}),e.cars&&(0,v.jsx)(ap,{texts:e.cars,state:a,prefix:t,disabled:n}),e.maritalStatus&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(e7.A,{name:e8.Lh.MaritalStatus,prefix:t,texts:e.maritalStatus,value:m,disabled:n,required:!0,onValueChange:A}),e.householdBudget&&(0,v.jsx)(eI.A,{show:h||s,animation:"none",children:(0,v.jsx)(af.A,{name:e8.Lh.HouseholdBudget,prefix:t,texts:e.householdBudget,disabled:n,state:a.householdBudget??{}})})]}),e.citizenships&&o.onGetCountries&&(0,v.jsx)(e9.A,{name:e8.Lh.Citizenships,validate:l[t].citizenships?.validate,dependentFields:l[t].citizenships?.dependentFields,texts:e.citizenships,disabled:n,prefix:t,value:a?.citizenships,options:o.onGetCountries,onKeyChange:(e,a)=>{let t=a?.map(e=>e).map(e=>e.region);u((t&&t.length>0&&t?.every(e=>"Other"===e))??!1)},input:!0}),e.residencePermit&&o.onGetCountries&&(0,v.jsx)(eI.A,{show:p||!!a?.residencePermit||s,animation:"none",children:(0,v.jsx)(eD.A,{validate:l[t].residencePermit?.validate,dependentFields:l[t].residencePermit?.dependentFields,prefix:t,name:e8.Lh.ResidencePermit,texts:e.residencePermit,value:a?.residencePermit})})]})})(e,a,o),...o})}var ab=t(1490),aw=t(31313),aS=t(58737),aD=t(3066),aI=t(94236),aP=t(31326),aj=t(44150),ak=t(50687),aT=t(63702),aR=((C={}).ConsumerLoan="ConsumerLoan",C.AutoDirect="AutoDirect",C.ClimateLoan="ClimateLoan",C),aq=((x={}).SessionId="sessionId",x.ApplicationId="applicationId",x.ApplicationClosed="closed",x.LoanAmount="loanAmount",x.LoanDuration="loanDuration",x.IsDurationInMonths="isDurationInMonths",x.PaymentTerms="paymentTerms",x.ObjectPrice="objectPrice",x.DownPayment="downPayment",x.ApplicationSpecificProtocolId="aspid",x.CampaignId="camp_id",x.CustomerSourceReference="csref",x.Fingerprint="fp",x.AdServiceFingerprint="adServiceFingerprint",x.Tests="tests",x);let aL=(e,a)=>{let t=Array.isArray(a)?a:[a];return e?.moreInformation?.find(e=>t.includes(e.dataType))};var aF=t(83838),aN=function(e,a,t=1e4){let n={};return new Promise((i,o)=>{n.cancelHandler=()=>{n.abortSignal?.(),o(aF.c)};let r=()=>{let s=e().toCancellable().then(e=>a(e)?i(e):Promise.delay(t).then(r,o),o);return n.abortSignal=s.cancel,s};r().catch(()=>{})}).toCancellable(()=>n.cancelHandler?.())},aE=t(20442),aM=t(8267),a$=t(64513),aO=t(68415),aU=t(74503);let aH=(e,a,t,n,i)=>{void 0===e?i(a):n(a,e?t.doneStatusLabel:t.awaitingStatusLabel)},aB=(e,a,t,n,i,o)=>{let r="Tax"===e?a===z.Applicant?t.awaitingApplicantTaxConsentStatus:t.awaitingCoApplicantTaxConsentStatus:a===z.Applicant?t.awaitingApplicantPsd2ConsentStatus:t.awaitingCoApplicantPsd2ConsentStatus;r?(n("consentsStatusHeading",r.heading),n("consentsStatusPreamble",r.preamble)):(i("consentsStatusHeading"),i("consentsStatusPreamble"));let s=a===z.Applicant?t.mainApplicantTitle:t.coApplicantTitle;s?n("consentsSummaryApplicantTitle",s):i("consentsSummaryApplicantTitle"),n("consentsSummaryApplicantSsn",o(a===z.Applicant?"mainApplicantSsn":"coApplicantSsn"))};function aV(e,a){return(a?e:12*e).toString()}function az({texts:e,settings:a,previewMode:t}){var n;let i=(0,w.t0)()??a,{error:o,safeCall:r,setCustomError:s}=(0,e_.A)(),{state:l,mergeState:c,setState:d,resetState:p}=(0,eK.A)(),[u,m]=(0,b.useState)(!!t),g=(0,b.useMemo)(()=>!!e.waitingForConsents.awaitingApplicantTaxConsentStatus,[e.waitingForConsents.awaitingApplicantTaxConsentStatus]),h=function(e,a){let{formats:t,fields:n}=(0,ep.A)(),{replaced:i,add:o,remove:r,get:s,addEmpty:l,addNumericOrRemove:c}=(0,aU.A)(e);return(0,b.useEffect)(()=>
1{if(a.waitingForConsents?.applicantHasTaxConsent)if(a.data?.psd2Type===H.Monthio||a.waitingForConsents?.applicantHasPsd2Consent)if(a.waitingForConsents?.coApplicantHasTaxConsent)if(a.waitingForConsents?.coApplicantHasPsd2Consent)if(a.waitingForConsents?.applicantHasPsd2Consent)r("consentsStatusHeading"),r("consentsStatusPreamble"),r("consentsSummaryApplicantTitle"),r("consentsSummaryApplicantSsn");else aB("Psd2",z.Applicant,e.waitingForConsents,o,r,s);else aB("Psd2",z.CoApplicant,e.waitingForConsents,o,r,s);else aB("Tax",z.CoApplicant,e.waitingForConsents,o,r,s);else aB("Psd2",z.Applicant,e.waitingForConsents,o,r,s);else aB("Tax",z.Applicant,e.waitingForConsents,o,r,s)},[a.waitingForConsents,a.data?.psd2Type,o,r,e.waitingForConsents]),(0,b.useEffect)(()=>aH(a.waitingForConsents?.applicantHasTaxConsent,"awaitingApplicantTaxConsent",e.waitingForConsents,o,r),[a.waitingForConsents?.applicantHasTaxConsent,o,r,e.waitingForConsents]),(0,b.useEffect)(()=>aH(a.waitingForConsents?.applicantHasPsd2Consent,"awaitingApplicantPsd2Consent",e.waitingForConsents,o,r),[a.waitingForConsents?.applicantHasPsd2Consent,o,r,e.waitingForConsents]),(0,b.useEffect)(()=>aH(a.waitingForConsents?.coApplicantHasTaxConsent,"awaitingCoApplicantTaxConsent",e.waitingForConsents,o,r),[a.waitingForConsents?.coApplicantHasTaxConsent,o,r,e.waitingForConsents]),(0,b.useEffect)(()=>aH(a.waitingForConsents?.coApplicantHasPsd2Consent,"awaitingCoApplicantPsd2Consent",e.waitingForConsents,o,r),[a.waitingForConsents?.coApplicantHasPsd2Consent,o,r,e.waitingForConsents]),(0,b.useEffect)(()=>{if(!a.data?.calculation&&!a.data?.offer){l("loanAmount"),l("monthlyPayment"),l("totalCreditCost"),l("totalRepayment"),l("interestRate"),l("annualPercentageRate"),l("installmentsAmount"),l("repaymentPeriod"),l("monthlyFee"),l("setUpFee"),l("insuranceMonthlyPayment");return}c("loanAmount",a.data?.calculation?.loanAmount??a.data?.offer?.loanAmount,t.money),c("monthlyPayment",a.data?.calculation?.monthlyPayment??a.data?.offer?.monthlyPayment,t.money),c("totalCreditCost",a.data?.calculation?.totalCreditCost??a.data?.offer?.totalCreditCost,t.money),c("totalRepayment",a.data?.calculation?.totalRepayment??a.data?.offer?.totalRepayment,t.money),c("interestRate",a.data?.calculation?.interestRate??a.data?.offer?.interestRate,t.percentage),c("annualPercentageRate",a.data?.calculation?.annualPercentageRate??a.data?.offer?.annualPercentageRate,t.percentage);let n=a.data?.calculation?.installmentsAmount??a.data?.offer?.installmentsAmount;c("installmentsAmount",n,t.integer);let i=a.data?.calculation?.repaymentPeriod??a.data?.offer?.repaymentPeriod,s=12*i!==n?"~":"";ae.sH.isNumeric(i)?o("repaymentPeriod",`${s}${ae.sH.format(i,t.integer)}`):r("repaymentPeriod"),c("monthlyFee",a.data?.calculation?.monthlyFee??a.data?.offer?.monthlyFee,t.money),c("setUpFee",a.data?.calculation?.setUpFee??a.data?.offer?.setUpFee,t.money);let d=e.insuranceProtection.pricePercent;ae.sH.isNumeric(d)?o("insurancePercent",ae.sH.format(d/100,t.percentage)):l("insurancePercent"),c("insuranceMonthlyPayment",a.data?.offer?.insuranceMonthlyPayment??a.data?.calculation?.insuranceMonthlyPayment??a.data?.calculation?.monthlyPayment*d/100,{...t.money,precision:0})},[a.data?.calculation,a.data?.offer,t,c,l,o,r,e.insuranceProtection.pricePercent]),(0,b.useEffect)(()=>{let e=a.data?.offer?.loanAmount;ae.sH.isNumeric(e)&&o("offeredLoanAmount",ae.sH.format(e,t.money));let n=a.data?.offer?.expirationDate;n&&o("offerExpirationDate",n);let i=a.data?.offer?.disposableIncome;ae.sH.isNumeric(i)&&o("disposableIncome",ae.sH.format(i,t.money))},[a.data?.offer,t.money,o]),(0,b.useEffect)(()=>{let e=a.data?.applicant?.anonymizedSsn??n.ssn.anonymize(a.personalInfo?.applicant?.ssn);e&&o("mainApplicantSsn",e)},[o,n.ssn,a.data?.applicant?.anonymizedSsn,a.personalInfo?.applicant?.ssn]),(0,b.useEffect)(()=>{let e=a.data?.coApplicant?.anonymizedSsn??n.ssn.anonymize(a.personalInfo?.coApplicant?.ssn);e&&o("coApplicantSsn",e)},[o,n.ssn,a.data?.coApplicant?.anonymizedSsn,a.personalInfo?.coApplicant?.ssn]),(0,b.useEffect)(()=>{let e=aL(a.data,[B.OtherApplicantAuthenticationDataDk,B.CoApplicantAuthenticationRequiredDataDk,B.Signing]),t=n.ssn.anonymize(e?.awaitingApplicantSsn);t&&o("awaitingApplicantSsn",t)},[o,n.ssn,a.data,a.data?.moreInformation]),(0,b.useEffect)(()=>
1{if(!a.data?.calculation)return l("monthlyPaymentRange");let e=a.data?.calculation?.min?.monthlyPayment,n=a.data?.calculation?.max?.monthlyPayment;if(ae.sH.isNumeric(e)&&ae.sH.isNumeric(n))return o("monthlyPaymentRange",e===n?ae.sH.format(e,t.money):`${ae.sH.format(e,t.money)} - ${ae.sH.format(n,t.money)}`);c("monthlyPaymentRange",a.data?.calculation?.monthlyPayment,t.money)},[a.data?.calculation,t.money,o,c,l]),(0,b.useEffect)(()=>{if(!a.data?.calculation)return l("totalCreditCostRange");let e=a.data?.calculation?.min?.totalCreditCost,n=a.data?.calculation?.max?.totalCreditCost;if(ae.sH.isNumeric(e)&&ae.sH.isNumeric(n))return o("totalCreditCostRange",e===n?ae.sH.format(e,t.money):`${ae.sH.format(e,t.money)} - ${ae.sH.format(n,t.money)}`);c("totalCreditCostRange",a.data?.calculation?.totalCreditCost,t.money)},[a.data?.calculation,t.money,o,l,c]),(0,b.useEffect)(()=>{if(!a.data?.calculation)return l("totalRepaymentRange");let e=a.data?.calculation?.min?.totalRepayment,n=a.data?.calculation?.max?.totalRepayment;if(ae.sH.isNumeric(e)&&ae.sH.isNumeric(n))return o("totalRepaymentRange",e===n?ae.sH.format(e,t.money):`${ae.sH.format(e,t.money)} - ${ae.sH.format(n,t.money)}`);c("totalRepaymentRange",a.data?.calculation?.totalRepayment,t.money)},[a.data?.calculation,t.money,o,l,c]),(0,b.useEffect)(()=>{if(!a.data?.calculation)return l("interestRateRange");let e=a.data?.calculation?.min?.interestRate,n=a.data?.calculation?.max?.interestRate;if(ae.sH.isNumeric(e)&&ae.sH.isNumeric(n))return o("interestRateRange",e===n?ae.sH.format(e,t.percentage):`${ae.sH.format(e,t.percentage)} - ${ae.sH.format(n,t.percentage)}`);c("interestRateRange",a.data?.calculation?.interestRate,t.percentage)},[a.data?.calculation,t.percentage,o,l,c]),(0,b.useEffect)(()=>{if(!a.data?.calculation)return l("annualPercentageRateRange");let e=a.data?.calculation?.min?.annualPercentageRate,n=a.data?.calculation?.max?.annualPercentageRate;if(ae.sH.isNumeric(e)&&ae.sH.isNumeric(n))return o("annualPercentageRateRange",e===n?ae.sH.format(e,t.percentage):`${ae.sH.format(e,t.percentage)} - ${ae.sH.format(n,t.percentage)}`);c("annualPercentageRateRange",a.data?.calculation?.annualPercentageRate,t.percentage)},[a.data?.calculation,t.percentage,o,l,c]),(0,b.useEffect)(()=>{if(!a.data?.calculation){l("minMonthlyPayment"),l("maxMonthlyPayment");return}c("minMonthlyPayment",a.data?.calculation?.min?.monthlyPayment,t.money),c("maxMonthlyPayment",a.data?.calculation?.max?.monthlyPayment,t.money)},[a.data?.calculation,t.money,o,l,c]),(0,b.useEffect)(()=>{if(!a.data?.calculation){l("minTotalCreditCost"),l("maxTotalCreditCost");return}c("minTotalCreditCost",a.data?.calculation?.min?.totalCreditCost,t.money),c("maxTotalCreditCost",a.data?.calculation?.max?.totalCreditCost,t.money)},[a.data?.calculation,t.money,o,l,c]),(0,b.useEffect)(()=>{if(!a.data?.calculation){l("minTotalRepayment"),l("maxTotalRepayment");return}c("minTotalRepayment",a.data?.calculation?.min?.totalRepayment,t.money),c("maxTotalRepayment",a.data?.calculation?.max?.totalRepayment,t.money)},[a.data?.calculation,t.money,o,l,c]),(0,b.useEffect)(()=>{if(!a.data?.calculation){l("minInterestRate"),l("maxInterestRate");return}c("minInterestRate",a.data?.calculation?.min?.interestRate,t.percentage),c("maxInterestRate",a.data?.calculation?.max?.interestRate,t.percentage)},[a.data?.calculation,t.percentage,o,l,c]),(0,b.useEffect)(()=>{if(!a.data?.calculation){l("minAnnualPercentageRate"),l("maxAnnualPercentageRate");return}c("minAnnualPercentageRate",a.data?.calculation?.min?.annualPercentageRate,t.percentage),c("maxAnnualPercentageRate",a.data?.calculation?.max?.annualPercentageRate,t.percentage)},[a.data?.calculation,t.percentage,o,l,c]),i}(e,l),{getQueryParam:f}=(0,eZ.A)(),A=f(aq.SessionId)??l.sessionId,y=(0,b.useMemo)(()=>(function(e,a){if(!e.apiBaseUrl)throw Error("missing flow api base url");let t=M.OZ.join(e.apiBaseUrl,"consumerloan","v1"),n=M.OZ.join(e.apiBaseUrl,"v1","dictionaries"),i=M.OZ.join(e.apiBaseUrl,"v1","lookups"),o=M.OZ.join(e.apiBaseUrl,"documentupload","v1","uploads"),r=(0,F.pY)(a);return r.interceptors.request.use(a=>(a.headers||(a.headers=new q.$t),a.headers["x-country"]="dk",a.headers["Ocp-Apim-Subscription-Key"]=e.subscriptionKey??"",a.withCredentials=!0,a)),{sessionId:a,bankAccount:{validate:async e=>(await r.post(M.OZ.join(t,"bank-account","validate"),{bankAccount:e})).data},loanCalculation:{calculate:async(e,a,n,i,o)=>(await r.post(M.OZ.join(t,"loan-calculation","calculate"),{includeMinMax:!0,loanAmount:e,duration:a,isDurationInMonths:n,productC
1ode:i,applicationId:o})).data},documents:{async upload(e,a,t){for(let[n,i]of Object.entries(t))for(let[t,s]of Object.entries(i))for(let i of s)if((i?.size??0)>0){let s=new FormData;s.append("files",i,i.name),await r.post(M.OZ.join(o,a,"documents",n),s,{headers:{"Content-Type":"multipart/form-data","x-actor-role":e,"x-document-id":E()(t,"{}")}})}}},application:{create:async e=>(await r.post(M.OZ.join(t,"applications"),e)).data,async update(e,a){await r.put(M.OZ.join(t,"applications",e),a)},async get(e){let a=await r.get(M.OZ.join(t,"applications",e));return(0,$.rF)(a.data),a.data}},initial:{get:async e=>(await r.get(M.OZ.join(t,"initial"),{signal:e?.signal})).data},dictionaries:{countries:async e=>(await r.get(M.OZ.join(n,"countries"),{params:{search:e}})).data.map(e=>({...e,details:{region:e.region}})),addresses:async e=>(await r.get(M.OZ.join(n,"addresses"),{params:{search:e}})).data},lookups:{cars:{async byName(e){let a=L.P.WhitePlate;return(await r.get(M.OZ.join(i,"cars","by-name"),{params:{search:e,vehicleType:a}})).data},async byRegistrationNumber(e){let a=L.P.WhitePlate;return(await r.get(M.OZ.join(i,"cars","by-registration"),{params:{search:e,vehicleType:a}})).data}}}}})(i,A),[A,i]),C=(0,b.useCallback)(async e=>{try{let a=await y.initial.get({signal:e});if(!a?.applicant?.anonymizedSsn)return!1;return c({data:{initial:a},personalInfo:{applicant:{ssn:a.applicant.anonymizedSsn},coApplicant:{ssn:a?.coApplicant?.anonymizedSsn}}}),!0}catch(a){if(e?.aborted)throw a;return console.error("Session probe failed",a),!1}},[y]),{getAuthStatus:x,authWithIframe:S,authWithPopup:D,authWithRedirect:I,authRedirecting:P,authenticating:k}=(0,j.h)(C),T=x(eW.i.Applicant),R=(0,ep.A)(),[N,_]=(0,b.useState)(!1),[K,Z]=(0,b.useState)(!1),W={...h.insuranceProtection.trackedProduct,pricePercent:h.insuranceProtection.pricePercent},G=(n=h.trackedProduct,{productImpression:(e="consumer-loan",a=window.location.pathname)=>{let t=n;"insurance"===e&&(t=W),aO.I4.resetECommerce(),aO.I4.push({event:"productImpressions",ecommerce:{currencyCode:t.currency,impressions:[{id:t.id,name:t.name,brand:t.brand,category:t.category,list:a}]}})},addProductDetailView:(e,a=window.location.pathname)=>aO.I4.push({event:"productDetailView",ecommerce:{currencyCode:n.currency,detail:{actionField:{list:a},products:[{id:n.id,name:n.name,price:"",brand:n.brand,category:n.category}]}}}),addInteraction:(e,a,t=document.location.pathname)=>aO.I4.push({event:"Interactions",eventCategory:e,eventAction:a,eventLabel:t}),addToCart:(e,a,t,i=window.location.pathname)=>aO.I4.push({event:"addToCart",ecommerce:{currencyCode:n.currency,add:{actionField:{list:i},products:[{id:n.id,name:n.name,price:(t?.data?.calculation?.loanAmount??t?.loanCalculation?.loanAmount??0)?.toString(),category:n.category,brand:n.brand,variant:aV(t?.data?.calculation?.installmentsAmount??0,!0),quantity:"1",topup:t?.data?.isTopup==!0?"yes":"no",psd2Type:t?.data?.psd2Type??""}]}},decision:t.data?.status?.toLowerCase()??"",applicationID:t.data?.applicationId??""}),checkout:(e,a,t,i=window.location.pathname)=>aO.I4.push({event:"checkout",ecommerce:{currencyCode:n.currency,checkout:{actionField:{step:e.toString(),option:i},products:[{id:n.id,name:n.id,price:(a?.data?.offer?.loanAmount??a?.data?.calculation?.loanAmount??a?.loanCalculation?.loanAmount??0).toString(),category:n.category,brand:n.brand,variant:aV(a?.data?.offer?.installmentsAmount??a?.data?.calculation?.installmentsAmount??a?.loanCalculation?.loanDuration??0,a?.data?.offer?.installmentsAmount!=null||a?.data?.calculation?.installmentsAmount!=null||t),quantity:"1",coapplicant:a?.data?.coApplicant??a?.personalInfo?.withCoApplicant?"yes":"no",topup:a?.data?.isTopup==!0?"yes":"no",psd2Type:a?.data?.psd2Type??""}]}},decision:a.data?.status?.toLowerCase()??"",applicationID:a.data?.applicationId??""}),addInsuranceToCart:(e,a,t,n=window.location.pathname)=>{let i={id:W.id,name:W.name,price:(e?.data?.calculation?.monthlyPayment*(W.pricePercent??0)/100).toString()??"",category:W.category,brand:W.brand,variant:"Applicant",quantity:"1",topup:e?.data?.isTopup==!0?"yes":"no",psd2Type:e?.data?.psd2Type??""};aO.I4.push({event:"addToCart",ecommerce:{currencyCode:W.currency,add:{actionField:{list:n},products:[...a?[i]:[],...t?[{...i,variant:"Co-applicant"}]:[]]}},decision:e.data?.status?.toLowerCase()??"",applicationID:e.data?.applicationId??""})},purchase:e=>{let a=e?.data?.offer?.applicantHasInsurance,t=e?.data?.offer?.coApplicantHasInsurance,i={id:W.id,name:W.name,price:((e?.data?.offer?.monthlyPayment??0)*(W.pricePercent??0)/100).toString()??"",category:W.category,brand:W.brand,variant:"Ap
1plicant",quantity:"1",topup:e?.data?.isTopup==!0?"yes":"no",psd2Type:e?.data?.psd2Type??""};aO.I4.pushApplicantIdentifiers(e?.data?.applicant),aO.I4.push({event:"purchase",ecommerce:{purchase:{actionField:{id:e.data?.applicationId??"",affiliation:n.brand,revenue:(e.data?.offer?.loanAmount??0).toString()},products:[{name:n.name,id:n.id,price:(e.data?.offer?.loanAmount??e.loanCalculation?.loanAmount??0).toString(),brand:n.brand,variant:aV(e?.data?.offer?.installmentsAmount??0,!0),category:n.category,quantity:"1",topup:e?.data?.isTopup==!0?"yes":"no",coapplicant:e?.data?.coApplicant?"yes":"no",psd2Type:e?.data?.psd2Type??""},...a?[i]:[],...t?[{...i,variant:"Co-applicant"}]:[]]}},decision:e.data?.status?.toLowerCase()??"",applicationID:e.data?.applicationId??""})},mouseflow:{formSubmit:e=>{window._mfq=window._mfq||[];let a=`#${e}_form`;window._mfq.push(["formSubmitAttempt",a]),window._mfq.push(["formSubmitSuccess",a])}}}),Y=()=>l.loanCalculation?.isDurationInMonths??h.loanCalculation.calculator.isDurationInMonths??!1,{back:X,navigate:J,redirect:Q,buildUrl:ee,redirecting:ea,prepareRedirect:en}=(0,eG.A)(e=>{switch(e){case ej.insuranceProtection.step.id:G.productImpression("insurance");break;case ej.economy.step.id:G.addToCart(1,e,l);break;case ej.livingSituation.step.id:G.checkout(2,l,Y());break;case ej.completed.step.id:if(l.documentUploadPostSigning||l.termsAndConditions||l.instantUpsellCalculation||l.registerPaymentService||l.otherInformation||l.signing)return l?.data?.uniqueUserId&&aO.I4.pushUniqueUserId(l.data.uniqueUserId),G.purchase(l),aO.I4.pushApplicationStatus("applicationBooked",l?.data?.offer?.loanAmount??0,l?.data?.wasUnderInvestigation,void 0,l?.data?.isTopup,l?.data?.applicationId,l?.data?.psd2Type,h.trackedProduct.id,h.trackedProduct.name);return{closed:!0}}}),ei=async(e,a=eW.i.FirstApplicant)=>{if(!e||![eY.hT.CurityParLogin,eY.hT.MitId,eY.hT.NemId].includes(e))throw Error(`Unsupported authentication type: '${e}'`);await es(e,a,ej.scoring.step,ej.resume.step)},eo=(e,a,t)=>{if(e.response?.status===401||e.response?.status===404||e.response?.data?.errors?.auth)throw s({callback:async()=>{a&&t?await es(eY.hT.TaxConsent,a,t,t,t):l.data.applicationId?J(ej.resume.step):J(ej.loanCalculation.step)},...h.errors.custom?.authenticationFailed,sessionId:y.sessionId,errorMessage:"Authentication failed",closable:!1,errorCode:e.response?.status||401}),Error("Authentication failed");throw e},er=async e=>{if(!e?.applicant&&!e?.coApplicant)throw Error("missing document upload data");e?.applicant&&await y.documents.upload(z.Applicant,l?.data?.applicationId,e?.applicant.documents),e?.coApplicant&&await y.documents.upload(z.CoApplicant,l?.data?.applicationId,e?.coApplicant.documents)},es=async(e,a,t,n,o)=>{if(!e)throw Error("Undefined authentication type.");if(i.skipAuthPage)J(t);else{let r=n?encodeURIComponent(ee(i,l,n)).replace("%20","+"):void 0,s=o?encodeURIComponent(ee(i,l,o)).replace("%20","+"):void 0,c=encodeURIComponent(ee(i,l,t)).replace("%20","+");await Q(`${i.apiBaseUrl}/v1/auth?country=${i.countryCode}&type=${e}&sessionId=${y.sessionId}&tokenKey=${a}&redirectUrl=${c}&clientId=${i.clientId}&scope=${i.scope}${r?`&cancelUrl=${r}`:""}${s?`&failUrl=${s}`:""}`,t)}},el=(e,a)=>e&&!a?(d("signing",{signingUrl:e}),Q(e,ej.verifying.step)):null,ec=(0,b.useMemo)(()=>aM.UI.isEmpty(l.data?.calculation),[l.data?.calculation]),ed=()=>c({data:{calculation:void 0}}),eu=async(e,a,t)=>{try{c({data:{calculation:{}}});let n={},o=n[e]?.[a]??await y.loanCalculation.calculate(e,a,t,i.productCode);n[e]||(n[e]={}),n[e][a]||(n[e][a]=o),((e,a={})=>c({data:{calculation:e,calculations:a}}))(o,n)}catch(e){throw ed(),e}},em=(0,b.useMemo)(()=>{let e=f(aq.LoanAmount,parseFloat(l.params?.loanAmount??"")),a=f(aq.LoanDuration,parseFloat(l.params?.loanDuration??"")),t=f(aq.IsDurationInMonths,(0,aM.oh)(aq.IsDurationInMonths,h.loanCalculation.calculator.isDurationInMonths??!1,l.params)),n=f(aq.PaymentTerms,parseInt(l.params?.paymentTerms??"")),i=f(aq.ObjectPrice,parseFloat(l.params?.objectPrice??"")),o=f(aq.DownPayment,parseFloat(l.params?.downPayment??"0")),r=ae.sH.isNumeric(e)?e:ae.sH.isNumeric(i)?i-o:void 0,s=ae.sH.isNumeric(a)?a:ae.sH.isNumeric(n)?Math.
1ceil(n/12):void 0;if(r&&s)return{loanAmount:r,loanDuration:s,isDurationInMonths:t}},[f,l.params,h.loanCalculation.calculator.isDurationInMonths]),eg=(0,b.useMemo)(()=>(0,aM.D9)({loanAmount:void 0,loanDuration:void 0,isDurationInMonths:h.loanCalculation.calculator.isDurationInMonths},l.loanCalculation,em),[l.loanCalculation,em,h.loanCalculation.calculator.isDurationInMonths]),eh=(e,a)=>{if(aL(e,B.DocumentsRequiredDataDk))return ef(e)?J(ej.otherApplicantResume.step):J(ej.documentUploadPreSigning.step);J(a)},ef=e=>{let a=aL(e,B.OtherApplicantAuthenticationDataDk);if(!a)return!1;let t=aL(e,B.DocumentsRequiredDataDk);return null!=t.missingDocuments&&(!!(t.missingDocuments.coApplicant&&Object.values(t.missingDocuments.coApplicant).some(e=>null!==e)&&e.coApplicant&&e.coApplicant?.anonymizedSsn?.slice(0,6)===a.awaitingApplicantSsn?.slice(0,6)||t.missingDocuments.applicant&&Object.values(t.missingDocuments.applicant).some(e=>null!==e)&&e.applicant.anonymizedSsn?.slice(0,6)===a.awaitingApplicantSsn?.slice(0,6))||!1)},eA=e=>{if(aL(e,B.OtherApplicantAuthenticationDataDk))return void J(ej.otherApplicantResume.step);let a=aL(e,B.TermsAndConditionsRequiredDataDk);return!!a&&(h.insuranceProtection.safe&&(a.applicant.insuranceEligible||a.coApplicant?.insuranceEligible)||!h.insuranceProtection.safe&&(a.applicant.showInsuranceConsent&&l.insuranceProtection?.applicant===void 0||a.coApplicant?.showInsuranceConsent&&l.insuranceProtection?.coApplicant===void 0)?J(ej.insuranceProtection.step):J(ej.termsAndConditions.step),!0)},ex=(0,b.useMemo)(()=>{let e={...h.personalInfo},a=[{key:R.mainDialingCode,text:R.name,details:{code:R.code}}];return e.applicant.phone={...e.applicant.phone,dialingCode:{...e.applicant.phone.dialingCode,options:a}},e.coApplicant&&(e.coApplicant.phone={...e.coApplicant.phone,dialingCode:{...e.coApplicant.phone.dialingCode,options:a}}),e.coApplicantToggle=void 0,e},[R,h.personalInfo]),ev=(0,b.useMemo)(()=>{if(l.data?.loanDetails){let e=h.instantUpsellCalculation.calculator;e&&(e.settings?.durationBands.forEach(e=>e.minDuration=l.loanCalculation?.loanDuration??l.data.loanDetails?.loanDuration??e.minDuration),e.loanAmount.range={min:l.data.loanDetails?.loanAmount??e.loanAmount.range.min,max:l.data.offer?.maxApprovedAmount??e.loanAmount.range.max},e.loanAmount.defaultValue=l.data.loanDetails?.loanAmount,e.loanDuration.defaultValue=l.loanCalculation?.loanDuration??l.data.loanDetails?.loanDuration)}return h.instantUpsellCalculation},[h.instantUpsellCalculation,l.data?.loanDetails,l.data?.offer?.maxApprovedAmount,l.loanCalculation?.loanDuration]),eb=(0,b.useMemo)(()=>l.data?.offer?.loanAmount!=null&&l.data?.loanDetails?.loanAmount!=null&&l.data?.offer?.loanAmount<l.data?.loanDetails?.loanAmount,[l.data?.offer?.loanAmount,l.data?.loanDetails?.loanAmount]),eS=(0,b.useMemo)(()=>null==l.instantUpsellCalculation&&l.data?.offer?.maxApprovedAmount!=null&&l.data?.offer?.maxApprovedAmount>l.data?.offer?.loanAmount,[l.instantUpsellCalculation,l.data?.offer?.maxApprovedAmount,l.data?.offer?.loanAmount]);(0,b.useEffect)(()=>{if(!i.shouldPreauthenticate)return;let e=new AbortController;return S({authType:eY.hT.CurityParSso,tokenKey:eW.i.Applicant,signal:e.signal}).catch(a=>{if(!e.signal.aborted)throw a}),()=>e.abort()},[i.shouldPreauthenticate,A]),(0,b.useEffect)(()=>{!i.shouldPreauthenticate||"authenticated"!==T||l.params?.applicationId&&(c({data:{applicationId:l.params.applicationId}}),J(ej.scoring.step))},[T,l?.params?.applicationId,i.shouldPreauthenticate]);let eD=e=>{if(aL(e,B.OtherApplicantAuthenticationDataDk)&&!aL(e,B.ApplicantPsd2ConsentRequiredDataDk)&&!aL(e,B.CoApplicantAuthenticationRequiredDataDk))return void J(ej.otherApplicantResume.step);if(aL(e,[B.ApplicantPsd2ConsentRequiredDataDk,B.CoApplicantAuthenticationRequiredDataDk,B.CoApplicantPsd2ConsentRequiredDataDk]))J(ej.waitingForConsents.step);else if(aL(e,B.ApplicantAddressRequiredDataDk))J(ej.address.step);else if(aL(e,B.CoApplicantAddressRequiredDataDk))J(ej.coAddress.step);else if(eA(e))return},eI=async()=>{if(l.data?.isTopup||N)return;let e=await eP();c({data:{isTopup:e}}),e?G.addToCart(1,ej.economy.step.id,l):J(ej.resume.step)},eP=async()=>{let e=await y.application.get(l.params?.applicationId??"").catch(()=>void 0);return _(!0),!!e?.isTopup&&e?.status==U.Initial&&(p({loanCalculation:{loanAmount:e.loanDetail
1s.loanAmount,loanDuration:e.loanDetails.loanDuration,isDurationInMonths:e.loanDetails.isDurationInMonths},personalInfo:{applicant:{ssn:e.applicant.anonymizedSsn.replaceAll("X","0"),digitalConsent:!1,email:"",emailConfirmation:"",phone:"",productConsent:!0}},params:l.params,accessibleSteps:l.accessibleSteps,etag:l.etag,urlPrefix:l.urlPrefix}),!0)},ej={loanCalculation:(0,eX.A)("loanCalculation",eJ.A,h.loanCalculation,{onEnter:()=>{G.productImpression(),G.addProductDetailView(l),l.loanCalculation||ed()},onCalculate:eu,onContinue:async e=>{if(!e)throw Error("missing Loan Calculation information");d("loanCalculation",{...e,isDurationInMonths:h.loanCalculation.calculator.isDurationInMonths}),G.mouseflow.formSubmit(h.loanCalculation.step.nameInUrl);let a=x(eW.i.Applicant);if(i.shouldPreauthenticate&&"failed"===a)try{await D()}catch{i.productCode===aR.AutoDirect?(en({step:ej.car.step}),I({redirectUrl:ee(i,l,ej.car.step)})):(en({step:ej.economy.step}),I({redirectUrl:ee(i,l,ej.economy.step)}));return}i.productCode===aR.AutoDirect?J(ej.car.step):J(ej.economy.step)},preventBack:!0,initial:e=>!e.applicationId,loading:ec||i.shouldPreauthenticate&&k,skipContinuePopup:K},eg),car:(0,eX.A)("car",eQ.A,h.car,{onBack:X,onEnter:()=>{eg||l.loanCalculation||Q(i,l,ej.loanCalculation.step)},onContinue:async e=>{if(!e)throw Error("missing Car information");l.loanCalculation||d("loanCalculation",eg),d("car",e),J(ej.economy.step)},onLookupByName:async e=>{let a=[];return await r(async()=>{a=await y.lookups.cars.byName(e)}),a},onLookupByRegistrationNumber:async e=>{let a=[];return await r(async()=>{a=await y.lookups.cars.byRegistrationNumber(e)}),a},initial:e=>!e.applicationId},l.car),economy:(0,eX.A)("economy",e3,{...h.economy,coApplicantToggle:h.personalInfo.coApplicantToggle},{withCoApplicant:!0,disableCoApplicantToggleWithWarning:i.flags?.disableCoApplicantToggleWithWarning,onBack:X,onEnter:async()=>{Z(!0),!u&&(l.params?.applicationId&&await eI(),l.personalInfo||aO.I4.sfcmcInit(),em||l.loanCalculation||Q(i,l,ej.loanCalculation.step))},onContinue:async e=>{let a=e?.withCoApplicant;if(!e?.applicant||a&&!e?.coApplicant)throw Error("missing Economy information");await r(async()=>{d("economy",e),c({personalInfo:{withCoApplicant:e.withCoApplicant}});let a=l.loanCalculation?.loanAmount===em?.loanAmount&&l.loanCalculation?.loanDuration===em?.loanDuration;!em||l.data?.calculation&&a||(d("loanCalculation",eg),await eu(em.loanAmount,em.loanDuration,em.isDurationInMonths)),G.mouseflow.formSubmit(h.economy.step.nameInUrl),J(ej.livingSituation.step)})},initial:e=>!e.applicationId||l?.data?.isTopup||!N},l.economy),livingSituation:(0,eX.A)("livingSituation",av,h.livingSituation,{withCoApplicant:l.personalInfo?.withCoApplicant,onBack:X,onContinue:async e=>{if(!e?.applicant||l.personalInfo?.withCoApplicant&&!e?.coApplicant)throw Error("missing Living Situation information");G.mouseflow.formSubmit(h.livingSituation.step.nameInUrl),await r(async()=>{d("livingSituation",e),J(ej.personalInfo.step)})},onGetCountries:y.dictionaries.countries},l.livingSituation),personalInfo:(0,eX.A)("personalInfo",ey,ex,{onEnter:async()=>{!u&&(l.params?.applicationId&&await eI(),l.economy||J(ej.economy.step),em||l.loanCalculation||Q(i,l,ej.loanCalculation.step))},onBack:X,withCoApplicant:!!l.economy?.withCoApplicant,isTopup:l.data?.isTopup,onContinue:async e=>{let a=l.economy?.withCoApplicant;if(!e?.applicant||a&&!e?.coApplicant)throw Error("missing Personal information");(0,$.s5)(e),aO.I4.sfmcSendEmailAndPhone(e.applicant.email,e.applicant.phone),G.mouseflow.formSubmit(ex.step.nameInUrl),await r(async()=>{l.loanCalculation||d("loanCalculation",eg),l.data?.isTopup&&e.applicant&&l.personalInfo?.applicant&&(e.applicant.ssn=l.personalInfo.applicant.ssn),d("personalInfo",{...l.personalInfo,...e});let a=e.applicant?.ssn;a&&aO.I4.pushUniqueUserId((0,a$.gc)((0,a$.p_)(a))),aO.I4.pushContactData(l?.personalInfo?.applicant),G.checkout(1,l,Y()),G.addInteraction("button","Auth with BankID"),G.checkout(3,l,Y()),g?J(ej.waitingForConsents.step):await es(eY.hT.TaxConsent,eW.i.Applicant,ej.submitting.step,ej.personalInfo.step,ej.personalInfo.step)})},initial:e=>!e.applicationId,settings:{applicant:{readOnlyFields:{ssn:!!l.data?.initial?.applicant?.anonymizedSsn}}}},l.personalInfo),submitting:(0,eX.A)("submitting",ab.A,h.submitting,{disabled:!!o,interval:i.processingInterval||1e3,onEnter:async()=>{!u&&(l.data?.applicationId||await r(async()=>{let e,a;c({data:{applicationId:(await y.application.create((e={applicant:{...l.personalInfo.applicant,productC
1onsentText:a$.yO.removeHtmlTags(h.personalInfo.applicant.productConsent?.content),digitalConsentText:a$.yO.removeHtmlTags(h.personalInfo.applicant.digitalConsent.content)}},l?.personalInfo?.withCoApplicant&&l.personalInfo.coApplicant&&(e.coApplicant={...l.personalInfo.coApplicant,productConsentText:a$.yO.removeHtmlTags(h.personalInfo.coApplicant?.productConsent?.content),digitalConsentText:a$.yO.removeHtmlTags(h.personalInfo.coApplicant?.digitalConsent.content)}),a=l.params?.adServiceFingerprint?[l.params?.adServiceFingerprint]:[l.params?.camp_id,l.params?.aspid],{productCode:i.productCode,customerSourceReference:l.params?.csref??l.params?.fp,adServiceFingerprint:a.some(e=>e)?a.map(e=>e??"NULL").join(":"):void 0,dataType:O.CreateApplicationDk,loanCalculation:eg,personalInfo:e,economy:l.economy,livingSituation:{...l.livingSituation,applicant:{...l.livingSituation.applicant,householdBudget:l.livingSituation.applicant?.householdBudget?.isShared?l.livingSituation.applicant.householdBudget.share:100},coApplicant:l.livingSituation.coApplicant?{...l.livingSituation.coApplicant,householdBudget:l.livingSituation.coApplicant?.householdBudget?.isShared?l.livingSituation.coApplicant.householdBudget.share:100}:void 0},car:l.car,documentSignSuccessPostbackUrl:ee(i,l,ej.verifying.step),documentSignFailurePostbackUrl:ee(i,l,ej.otherInformation.step),alternativDocumentSigningUrl:ee(i,l,ej.resume.step)+"?applicationId={0}",topupApplicationId:l.params?.applicationId})).catch(e=>eo(e,eW.i.Applicant,ej.submitting.step))).id}})}))},onProcess:async({cancel:e})=>{if(u)return;let a=l.data?.applicationId;await r(async()=>{let t=await y.application.get(a).catch(a=>{e(),eo(a,eW.i.Applicant,ej.submitting.step)});t?.moreInformation?.length&&!aL(t,[B.ApplicantAuthenticationRequiredDataDk])&&(c({data:t}),eD(t))})},preventBack:!0}),waitingForConsents:(0,eX.A)("waitingForConsents",ew,h.waitingForConsents,{withCoApplicant:l.personalInfo?.withCoApplicant,onEnter:async()=>{if(u)return;let e=!g||!!l.data?.applicationId;d("waitingForConsents",{applicantHasTaxConsent:e,applicantHasPsd2Consent:e&&!aL(l.data,B.ApplicantPsd2ConsentRequiredDataDk),coApplicantHasTaxConsent:e&&!aL(l.data,B.CoApplicantAuthenticationRequiredDataDk),coApplicantHasPsd2Consent:e&&!aL(l.data,B.CoApplicantPsd2ConsentRequiredDataDk)})},onContinue:async()=>{if(u)return;let e=!g||!!l.data?.applicationId,a=e&&!aL(l.data,B.ApplicantPsd2ConsentRequiredDataDk),t=e&&!aL(l.data,B.CoApplicantAuthenticationRequiredDataDk),n=e&&!aL(l.data,B.CoApplicantPsd2ConsentRequiredDataDk);G.mouseflow.formSubmit(h.waitingForConsents.step.nameInUrl);let i=()=>(aO.I4.push({event:"Interactions",eventCategory:"PSD2",eventAction:"redirect_to_vendor",eventLabel:l.data?.psd2Type??""}),es(eY.hT.Psd2Consent,eW.i.Applicant,ej.submitting.step,ej.waitingForConsents.step,ej.psd2Fail.step));e?l.data?.psd2Type===H.Monthio||a?t?n?a?J(ej.submitting.step):await i():await es(eY.hT.Psd2Consent,eW.i.CoApplicant,ej.coSubmitting.step,ej.waitingForConsents.step,ej.psd2Fail.step):await es(eY.hT.TaxConsent,eW.i.CoApplicant,ej.coSubmitting.step,ej.waitingForConsents.step,ej.waitingForConsents.step):await i():await es(eY.hT.TaxConsent,eW.i.Applicant,ej.submitting.step,ej.waitingForConsents.step,ej.waitingForConsents.step)},useThreeSections:l.data?.psd2Type===H.Monthio,preventBack:!!l.data?.applicationId},l.waitingForConsents),address:(0,eX.A)("address",et,{...h.address,title:l.personalInfo?.withCoApplicant?h.address.title:void 0},{onBack:X,onContinue:async e=>{if(!e)throw Error("missing Address information");G.checkout(4,l,Y()),G.mouseflow.formSubmit(h.address.step.nameInUrl),await r(async()=>{await y.application.update(l.data.applicationId,{dataType:V.AddressDk,...e});let a=await aN(()=>y.application.get(l.data.applicationId).catch(eo),e=>!aL(e,[B.ApplicantAuthenticationRequiredDataDk,B.CoApplicantAuthenticationRequiredDataDk,B.ApplicantAddressRequiredDataDk]),i.processingInterval);c({data:a}),eD(a)})},onGetAddresses:y.dictionaries.addresses},l.address),coSubmitting:(0,eX.A)("coSubmitting",ab.A,h.coSubmitting,{disabled:!!o,interval:i.processingInterval||1e3,onEnter:async()=>{!u&&aL(l.data,B.CoApplicantAuthenticationRequiredDataDk)&&await r(async()=>{let e=l.data?.applicationId;await y.application.update(e,{dataType:V.CoTaxConsentDk}
1).catch(e=>eo(e,eW.i.CoApplicant,ej.coSubmitting.step))})},onProcess:async({cancel:e})=>{u||await r(async()=>{let a=l.data?.applicationId,t=await y.application.get(a).catch(a=>{e(),eo(a,eW.i.CoApplicant,ej.coSubmitting.step)});t?.moreInformation?.length&&!aL(t,B.CoApplicantAuthenticationRequiredDataDk)&&(c({data:t}),eD(t))})},preventBack:!0}),coAddress:(0,eX.A)("coAddress",et,h.coAddress,{onBack:X,onContinue:async e=>{if(!e)throw Error("missing Address information for co-applicant");await r(async()=>{d("coAddress",e),await y.application.update(l.data.applicationId,{dataType:V.CoAddressDk,...e});let a=await aN(()=>y.application.get(l.data.applicationId).catch(eo),e=>!aL(e,[B.ApplicantAuthenticationRequiredDataDk,B.CoApplicantAuthenticationRequiredDataDk,B.CoApplicantAddressRequiredDataDk]),i.processingInterval);c({data:a}),eD(a)})},onGetAddresses:y.dictionaries.addresses},l.coAddress),insuranceProtection:(0,eX.A)("insuranceProtection",aw.A,h.insuranceProtection,{withCoApplicant:l.personalInfo?.withCoApplicant,onBack:X,onContinue:async e=>{if(!e||!e.applicant&&!e.coApplicant)throw Error("missing insurance protection");G.mouseflow.formSubmit(h.insuranceProtection.step.nameInUrl),d("insuranceProtection",e),(e?.applicant?.insuranceProtection||e?.coApplicant?.insuranceProtection)&&G.addInsuranceToCart(l,!!e?.applicant?.insuranceProtection,!!e?.coApplicant?.insuranceProtection),J(ej.termsAndConditions.step)},settings:aL(l?.data,B.TermsAndConditionsRequiredDataDk)},l.insuranceProtection),termsAndConditions:(0,eX.A)("termsAndConditions",aw.A,h.termsAndConditions,{withCoApplicant:l.personalInfo?.withCoApplicant,onBack:X,onContinue:async e=>{if(!e?.applicant||l.personalInfo?.withCoApplicant&&!e?.coApplicant)throw Error("missing terms and conditions");G.checkout(5,l,Y()),G.mouseflow.formSubmit(h.termsAndConditions.step.nameInUrl),await r(async()=>{d("termsAndConditions",e),await y.application.update(l.data.applicationId,{dataType:V.TermsAndConditionsDk,googleCookieId:(0,aE.ln)(),applicant:{...e.applicant,...l.insuranceProtection?.applicant},coApplicant:e.coApplicant?{...e.coApplicant,...l.insuranceProtection?.coApplicant}:void 0}),ed(),J(ej.scoring.step)})}},l.termsAndConditions),scoring:(0,eX.A)("scoring",ab.A,h.scoring,{disabled:!!o,interval:i.processingInterval||1e3,onProcess:async({cancel:e})=>{u||await r(async()=>{let a=await y.application.get(l.data.applicationId).catch(a=>(e(),eo(a)));switch(c({data:a}),!l.data.calculation&&a.loanDetails.loanAmount&&a.loanDetails.loanDuration&&await eu(a.loanDetails.loanAmount,a.loanDetails.loanDuration,h.loanCalculation.calculator.isDurationInMonths),aO.I4.pushUniqueUserId(a?.uniqueUserId),!l.personalInfo&&d("personalInfo",{withCoApplicant:!!a.coApplicant}),!l.economy&&d("economy",{withCoApplicant:!!a.coApplicant}),a.status){case U.Pending:let t,n,i;t=aL(a,B.ApplicantPsd2ConsentRequiredDataDk),n=aL(a,B.CoApplicantAuthenticationRequiredDataDk),i=aL(a,B.CoApplicantPsd2ConsentRequiredDataDk),t||n||i?eD(a):aL(a,B.TermsAndConditionsRequiredDataDk)&&eA(a);break;case U.Approved:let o;aL(a,B.OtherApplicantAuthenticationDataDk)?J(ej.otherApplicantResume.step):aL(a,B.AmlRequiredDataDk)||aL(a,B.RegisterPaymentServiceRequiredDataDk)?J(ej.approved.step):aL(a,B.Signing)?(o=aL(a,B.Signing)).hasApplicantDocumentsBeenSigned&&o.hasCoApplicantDocumentsBeenSigned?J(ej.investigation.step):!o.hasApplicantDocumentsBeenSigned&&o.applicantDocumentSigningUrl?el(o.applicantDocumentSigningUrl):!o.hasCoApplicantDocumentsBeenSigned&&o.coApplicantDocumentSigningUrl?J(ej.waitingForSigning.step):J(ej.approved.step):J(ej.approved.step);break;case U.Signed:eh(a,ej.completed.step);break;case U.Declined:eh(a,ej.declined.step);break;case U.Cancelled:eh(a,ej.cancelled.step);break;case U.Investigation:eh(a,ej.investigation.step)}await new Promise(e=>setTimeout(e,2e3))})},preventBack:!0}),approved:(0,eX.A)("approved",aS.A,h.approved,{onEnter:()=>{ed()},onContinue:async e=>{if(!e)throw Error("missing form data");l?.data?.offer&&(G.checkout(6,l,Y()),G.mouseflow.formSubmit(h.approved.step.nameInUrl),aO.I4.pushApplicationStatus("applicationSubmitted",l?.data?.offer?.loanAmount??0,l?.data?.wasUnderInvestigation,void 0,!1,l?.data?.applicationId,l?.data?.psd2Type,h.trackedProduct.id,h.trackedProduct.name)),aL(l.data,B.DocumentsRequiredDataDk)?J(ej.documentUploadPreSigning.step):aL(l.data,B.RegisterPaymentServiceRequiredDataDk)?J(ej.registerPaymentService.step):J(ej.otherInformation.step)},onContinueWithInstantUpsell:()=>{J(ej.instantUpsellCalculation.step)},downsell:eb,instantUpsell:eS,preventBack:!0},l.approved),instantUpsellCalculation:(0,eX.A)("instantUpsellCalculation",eJ.A,ev,{onCalculate:eu,onBack:()=>{ed(),X()},onContinue:async e=>{if(!e)throw Error("missing Loan Calculation information");d("instantUpsellCalculation",e),await y.application.update(l.data.applicationId,{dataType:V.InstantUpsellDk,...e,isDurationInMonths:ev.calculator?.isDurationInMonths}),J(ej.scoring.step)},preventBack:!1,loading:ec},l.instantUpsellCalculation),declined:(0,eX.A)("declined",aD.A,h.declined,{onBack:()=>{Q(i,l)},onContinue:async()=>{let e=h.declined.navigation?.continue?.url;e&&await Q(e)},type:"error",preventBack:!0,final:!0}),cancelled:(0,eX.A)("cancelled",aD.A,h.cancelled,{onBack:()=>{Q(i,l)},onContinue:async()=>{let e=h.cancelled.navigation?.continue?.url;e&&await Q(e)},type:"error",preventBack:!0,final:!0}),documentUploadPreSigning:(0,eX.A)("documentUploadPreSigning",aI.A,h.documentUploadPreSigning,{...aL(l.data,B.DocumentsRequiredDataDk),withCoApplicant:l.data?.coApplicant!=null,onBack:X,onContinue:async e=>{if(!e)throw Error("missing form data");await r(async()=>{d("documentUploadPreSigning",e),await er(e),"Approved"==l.data.status?aL(l.data,B.RegisterPaymentServiceRequiredDataDk)?J(ej.registerPaymentService.step):J(ej.otherInformation.step):J(ej.investigation.step)})}},l.documentUploadPreSigning),investigation:(0,eX.A)("investigation",aD.A,h.investigation,{onBack:()=>{Q(i,l)},onContinue:async()=>{let e=h.investigation.navigation?.continue?.url;e&&await Q(e)},type:"warning",preventBack:!0,final:!0}),registerPaymentService:(0,eX.A)("registerPaymentService",eO,h.registerPaymentService,{onBack:X,onContinue:async e=>{if(!e)throw Error("missing form data");G.checkout(7,l,Y()),G.mouseflow.formSubmit(h.registerPaymentService.step.nameInUrl),await r(async()=>{d("registerPaymentService",e),await y.application.update(l.data.applicationId,{dataType:V.RegisterPaymentServiceDk,...e}),J(ej.otherInformation.step)})}},l.registerPaymentService),otherInformation:(0,eX.A)("otherInformation",eL,h.otherInformation,{withCoApplicant:l.data?.coApplicant!=null,onBack:X,onContinue:async e=>{if(!e?.applicant||l.data?.coApplicant!=null&&!e?.coApplicant)throw Error("missing Other information");await r(async()=>{await y.application.update(l.data.applicationId,{dataType:V.OtherInformationDk,...e}),d("otherInformation",e);let a=await aN(()=>y.application.get(l.data.applicationId).catch(eo),e=>null!=aL(e,B.Signing),i.processingInterval);c({data:a}),G.checkout(8,l,Y()),G.mouseflow.formSubmit(h.otherInformation.step.nameInUrl),G.addInteraction("button","Sign with BankID");let t=aL(a,B.Signing);await el(t?.applicantDocumentSigningUrl,t?.hasApplicantDocumentsBeenSigned)})}
1,showLoanPurpose:i.productCode!==aR.AutoDirect},l.otherInformation),waitingForSigning:(0,eX.A)("waitingForSigning",eC.A,h.waitingForSigning,{onContinue:async()=>{let e=await aN(()=>y.application.get(l.data.applicationId).catch(eo),e=>null!=aL(e,B.Signing),i.processingInterval);c({data:e});let a=aL(e,B.Signing);await el(a?.coApplicantDocumentSigningUrl,a?.hasCoApplicantDocumentsBeenSigned)},preventBack:!0}),verifying:(0,eX.A)("verifying",ab.A,h.verifying,{disabled:!!o,interval:i.processingInterval||5e3,onEnter:async()=>{u||await r(async()=>{await y.application.update(l.data?.applicationId,{dataType:V.SignContractDk})})},onProcess:async({cancel:e})=>{u||await r(async()=>{let a=await y.application.get(l.data.applicationId).catch(a=>(e(),eo(a)));c({data:a});let t=aL(a,B.Signing);return t?!t?.hasCoApplicantDocumentsBeenSigned&&t?.coApplicantDocumentSigningUrl?J(ej.waitingForSigning.step):void 0:a.status==U.Signed?aL(a,B.DocumentsRequiredDataDk)?J(ej.documentUploadPostSigning.step):J(ej.completed.step):void J(ej.investigation.step)})},preventBack:!0}),documentUploadPostSigning:(0,eX.A)("documentUploadPostSigning",aI.A,h.documentUploadPostSigning,{...aL(l.data,B.DocumentsRequiredDataDk),withCoApplicant:l.data?.coApplicant!=null,onBack:X,onContinue:async e=>{if(!e)throw Error("missing form data");await r(async()=>{d("documentUploadPostSigning",e),await er(e),J(ej.completed.step)})}},l.documentUploadPostSigning),completed:(0,eX.A)("completed",aP.A,h.completed,{preventBack:!0,final:!0,hideMobileSection:i.flags?.hideCompletedMobileSection}),resume:(0,eX.A)("resume",aj.A,h.resume,{onEnter:async()=>{if(N)return;let e=await eP();c({data:{isTopup:e}}),e&&J(ej.economy.step)},onContinue:async e=>r(async()=>{if(!(l.params?.applicationId?(c({data:{applicationId:l.params.applicationId}}),!0):s({callback:()=>{J(ej.loanCalculation.step)},errorMessage:"Missing id"})))return!1;if(i.shouldPreauthenticate&&"failed"===T)try{await D(),J(ej.scoring.step)}catch{en({step:ej.scoring.step}),I({redirectUrl:ee(i,l,ej.scoring.step)})}else await ei(e?.authType)}),preventBack:!0,initial:e=>!!e.applicationId,loading:i.shouldPreauthenticate&&k},{}),otherApplicantResume:(0,eX.A)("otherApplicantResume",ez,h.otherApplicantResume,{onContinue:e=>r(()=>ei(e?.authType,eW.i.SecondApplicant)),preventBack:!0},{}),psd2Fail:(0,eX.A)("psd2Fail",aD.A,h.psd2Fail,{onBack:()=>{Q(i,l)},onContinue:async()=>{let e=h.psd2Fail.navigation?.continue?.url;e&&await Q(e)},type:"warning",preventBack:!0,initial:!0,final:!0})};return(0,v.jsx)(ak.default,{onEditMode:()=>m(!0),children:(0,v.jsx)(aT.A,{name:"ConsumerLoanFlow",previewMode:u,session:{timeout:i.sessionTimeout??36e5,onSessionExpired:()=>{let e=l.params?.applicationId??l.data?.applicationId;s({callback:()=>{J(e?ej.resume.step:ej.loanCalculation.step,{applicationId:e})},sessionId:y.sessionId,...h.errors.custom?.sessionExpired})},prompt:()=>!ea.current&&!P.current},flowTexts:h,children:Object.values(ej).map(e=>(0,v.jsx)(e.type,{...e.step},e.step.id))})})}var a_=t(2822);t(67254),t(49505);let aK={disableCoApplicantToggleWithWarning:w.$7},aZ=function({id:e,texts:a,settings:t,state:n,previewMode:i}){let o=(0,S.A)();return(0,v.jsx)(D.Ay,{settings:t,children:(0,v.jsx)(I.A,{countryCode:t.countryCode,children:(0,v.jsx)(P.A,{id:e,state:()=>n||{sessionId:o()},children:(0,v.jsx)(j.A,{settings:t,children:(0,v.jsx)(w.Z6,{settings:t,resolvers:aK,children:(0,v.jsxs)(k.A,{children:[(0,v.jsx)(a_.V,{children:(0,v.jsx)(az,{texts:a,settings:t,previewMode:i})}),(0,v.jsx)(T.A,{...a.errors.default})]})})})})})})};function aW({onLoad:e,onRouteChanged:a,previewMode:t,useMemoryRouter:n,...i}){let o=`consumer-loan:dk:${i.settings.productCode}`;return(0,b.useEffect)(()=>e?.(o),[]),(0,v.jsx)(b.StrictMode,{children:(0,v.jsx)(R.A,{basePath:i.settings.basePath,onRouteChanged:a,useMemory:n??t,children:(0,v.jsx)(aZ,{...i,id:o,previewMode:t})})})}},26854:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},27814:(e,a,t)=>{var n=t(21860),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},29702:(e,a,t)=>{var n=t(800);e.exports=function(e,a,t){var i=e.length;return t=void 0===t?i:t,!a&&t>=i?e:n(e,a,t)}},32603:e=>{e.exports=Array.isArray},37410:(e,a,t)=>{t.d(a,{A:()=>p});var n=t(54568),i=t(7620),o=t(48442),r=t(34397),s=t(66343),l=t(66562),c=t(70260);
1let{component:d}=(0,o.T)("sn-link-toggle"),p=(0,i.forwardRef)(function({name:e,description:a,link:t,className:o,disabled:p,expanded:u,children:m,"data-name":g,onLinkClicked:h},f){let[A,y]=(0,i.useState)(u),C=(0,i.useMemo)(()=>r.Ft.split(a?.replace(/(<([^>]+)>)/gi,"")),[a]),x=e=>{h?.(),y(!A),e?.preventDefault()};return(0,n.jsxs)("div",{ref:f,className:d(o,{disabled:p}),"data-component":"LinkToggle","data-id":e,children:[(0,n.jsx)("span",{"data-name":g,children:C.map((a,o)=>(0,n.jsx)(i.Fragment,{children:a.isPlaceholder&&"{link}"===a.value?(0,n.jsx)(l.A,{onClick:x,disabled:p,hover:!0,"aria-expanded":!!A,"aria-controls":`${e}-content`,children:t??a.value}):(0,n.jsx)(c.A,{children:a.value??""})},o))}),(0,n.jsx)(s.A,{show:!0===A,animation:"none",children:(0,n.jsx)("div",{id:`${e}-content`,children:m})})]})});p.displayName="LinkToggle"},38026:(e,a,t)=>{e.exports="object"==typeof t.g&&t.g&&t.g.Object===Object&&t.g},43031:(e,a,t)=>{t.d(a,{B:()=>o,L:()=>r});var n,i,o=((n={}).Condominium="Condominium",n.OwnedHouse="OwnedHouse",n.Tenancy="Tenancy",n.SecondhandApartment="SecondhandApartment",n.CollectiveHousing="CollectiveHousing",n.LivingAtHome="LivingAtHome",n.RightOfOccupancy="RightOfOccupancy",n.SpouseOwned="SpouseOwned",n.CompanyOwned="CompanyOwned",n.Other="Other",n),r=((i={}).AccommodationType="accommodationType",i.HousingCost="housingCost",i)},50678:(e,a,t)=>{var n=t(51959),i=t(8587),o=t(97552),r=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?i(e):o(e)}},51200:(e,a,t)=>{t.d(a,{A:()=>m});var n=t(54568),i=t(7620),o=t(52542),r=t(21524),s=t(80962),l=t(66343),c=t(79320),d=t(43031),p=t(80013),u=t(3584);function m({texts:e,state:a,prefix:t,name:g,disabled:h,showHousingCostFor:f,...A}){let y=g?g+".":"",{previewMode:C}=(0,u.A)(),{formats:x}=(0,p.A)(),[v,b]=(0,i.useState)((0,o.$K)(e.accommodationType.options,a.accommodationType)?.key),w=(0,i.useMemo)(()=>{let a=e.housingCost.sublabels?.accommodationType.find(e=>e.key===v)?.text;return a?{...e.housingCost,sublabel:a}:e.housingCost},[v,e.housingCost]);return(0,n.jsxs)(r.A,{noPadding:!0,...A,children:[(0,n.jsx)(s.A,{name:`${y}${d.L.AccommodationType}`,prefix:t,value:v,onKeyChange:b,texts:e.accommodationType,disabled:h,required:!0}),(0,n.jsx)(l.A,{show:!f||f.includes(v)||C,children:(0,n.jsx)(c.A,{name:`${y}${d.L.HousingCost}`,prefix:t,texts:w,value:a.housingCost??e.housingCost.defaultValue,format:x.money,disabled:h,required:!0})})]})}},51959:(e,a,t)=>{e.exports=t(6243).Symbol},54157:(e,a,t)=>{t.d(a,{A:()=>d});var n=t(54568),i=t(7620),o=t(21524),r=t(37378),s=t(22573),l=t(97532),c=t(44469);function d({texts:e,state:a,prefix:t,name:p,disabled:u,showEmployment:m,showEmployerName:g=!0,hideBottom:h=!1,hidePrimaryIncomeRepayment:f=!1,showEmployedSince:A,showEmployedTo:y,showMonthlyIncome:C,employedSince:x,employedTo:v,employmentType:b,noDefaultEmploymentDates:w,...S}){let[D,I]=(0,i.useState)(a??{}),[P,j]=(0,i.useState)(a??{}),[k,T]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{a.repaymentSource&&j(e=>({...e,repaymentSource:a.repaymentSource,primaryIncomeRepayment:!1}))},[a.repaymentSource]),(0,i.useEffect)(()=>T([c.p.Unemployed,c.p.Student].includes(D.employmentType)),[D.employmentType]),(0,n.jsxs)(o.A,{name:p,noPadding:!0,...S,children:[!!m&&(0,n.jsx)(r.A,{texts:e,state:D,disabled:u,prefix:t,showEmployedSince:A,showEmployedTo:y,showEmployerName:g,showMonthlyIncome:C,employedSince:x,employedTo:v,employmentType:b,noDefaultEmploymentDates:w,onStateChanged:I}),(0,n.jsx)(s.A,{hideTop:!m,hideBottom:h,children:(0,n.jsx)(l.A,{texts:e,state:P,disabled:u,prefix:t,primaryIncomeRepaymentDisabled:k,onPrimaryIncomeRepaymentChanged:e=>j(a=>({...a,primaryIncomeRepayment:e})),hidePrimaryIncomeRepayment:f})})]})}},55859:e=>{e.exports=function(e){return e!=e}},56423:e=>{e.exports=function(e,a,t,n){for(var i=e.length,o=t+(n?1:-1);n?o--:++o<i;)if(a(e[o],o,e))return o;return -1}},58470:(e,a,t)=>{var n=t(51959),i=t(17674),o=t(32603),r=t(60054),s=1/0,l=n?n.prototype:void 0,c=l?l.toString:void 0;e.exports=function e(a){if("string"==typeof a)return a;
1if(o(a))return i(a,e)+"";if(r(a))return c?c.call(a):"";var t=a+"";return"0"==t&&1/a==-s?"-0":t}},60054:(e,a,t)=>{var n=t(50678),i=t(26854);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},64796:e=>{var a=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return a.test(e)}},65135:e=>{e.exports=function(e,a,t){for(var n=t-1,i=e.length;++n<i;)if(e[n]===a)return n;return -1}},71692:(e,a,t)=>{t.d(a,{A:()=>u});var n,i=t(54568),o=t(21524),r=t(72136),s=t(66343),l=t(74952),c=t(7620),d=((n={}).IsShared="isShared",n.Share="share",n),p=t(3584);function u({name:e,texts:a,state:t,prefix:n,disabled:m,...g}){let{previewMode:h}=(0,p.A)(),f=[n,e].filter(Boolean).join("."),[A,y]=(0,c.useState)(t.isShared),[C,x]=(0,c.useState)(t.share??a.share?.defaultValue??50);return(0,i.jsx)(o.A,{name:e,noPadding:!0,...g,children:a.isShared&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.A,{validate:{required:e=>"boolean"==typeof e||(a.isShared?.errors?.required??!1)},name:d.IsShared,prefix:f,texts:a.isShared,value:A,disabled:m,onValueChange:y}),a.share&&(0,i.jsx)(s.A,{show:!!A||h,animation:"none",children:(0,i.jsx)(l.A,{name:d.Share,prefix:f,texts:a.share,disabled:m,value:C,onValueChange:x,required:!0})})]})})}},77076:(e,a,t)=>{var n=t(98579);e.exports=function(e,a){for(var t=-1,i=e.length;++t<i&&n(a,e[t],0)>-1;);return t}},77406:(e,a,t)=>{var n=t(58470),i=t(27814),o=t(29702),r=t(18955),s=t(77076),l=t(17280),c=t(2702);e.exports=function(e,a,t){if((e=c(e))&&(t||void 0===a))return i(e);if(!e||!(a=n(a)))return e;var d=l(e),p=l(a),u=s(d,p),m=r(d,p)+1;return o(d,u,m).join("")}},80592:e=>{var a="\\ud800-\\udfff",t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",i="[^"+a+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",r="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+t+"|"+n+")?",l="[\\ufe0e\\ufe0f]?",c="(?:\\u200d(?:"+[i,o,r].join("|")+")"+l+s+")*",d=RegExp(n+"(?="+n+")|"+("(?:"+[i+t+"?",t,o,r,"["+a+"]"].join("|"))+")"+(l+s+c),"g");e.exports=function(e){return e.match(d)||[]}},97552:e=>{var a=Object.prototype.toString;e.exports=function(e){return a.call(e)}},98445:(e,a,t)=>{t.d(a,{P:()=>r,f:()=>o});var n,i,o=((n={}).SearchByRegistrationNumber="searchByRegistrationNumber",n.Details="details",n.RegistrationNumber="registrationNumber",n.ModelVariantId="modelVariantId",n.CarSearched="carSearched",n.CarPrice="carPrice",n),r=((i={}).WhitePlate="WhitePlate",i.YellowPlate="YellowPlate",i)},98579:(e,a,t)=>{var n=t(56423),i=t(55859),o=t(65135);e.exports=function(e,a,t){return a==a?o(e,a,t):n(e,i,t)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.