{"version":3,"file":"creditcard-2b925047.js","sources":["../../../client-app/src/apps/creditcard/i18n.ts","../../../client-app/src/apps/creditcard/pages/Application/helpers.tsx","../../../client-app/src/apps/creditcard/pages/Application/stages-fi.tsx","../../../client-app/src/apps/creditcard/pages/Application/stages-no.tsx","../../../client-app/src/apps/creditcard/pages/Application/Context.O1.tsx","../../../client-app/src/apps/creditcard/pages/Application/Context.O2.tsx","../../../client-app/src/apps/creditcard/pages/Application/Context.tsx","../../../client-app/src/apps/creditcard/pages/Application/loader.ts","../../../client-app/src/apps/creditcard/pages/Application/index.tsx","../../../client-app/src/apps/creditcard/pages/Offer/loader.ts","../../../client-app/src/apps/creditcard/pages/Offer/index.tsx","../../../client-app/src/apps/creditcard/pages/Sign/actions.ts","../../../client-app/src/apps/creditcard/pages/Sign/loader.ts","../../../client-app/src/apps/creditcard/pages/Sign/index.tsx","../../../client-app/src/apps/creditcard/pages/SetPin/loader.ts","../../../client-app/src/apps/creditcard/pages/SetPin/index.tsx","../../../client-app/src/apps/creditcard/pages/UploadDocuments/loader.ts","../../../client-app/src/apps/creditcard/pages/UploadDocuments/index.tsx","../../../client-app/src/apps/creditcard/pages/Status/loader.ts","../../../client-app/src/apps/creditcard/pages/Status/index.tsx","../../../client-app/src/apps/creditcard/pages/SignCompleted/index.tsx","../../../client-app/src/apps/creditcard/components/Insurance.tsx","../../../client-app/src/apps/creditcard/pages/ErrorPage/index.tsx","../../../client-app/src/apps/creditcard/components/App.tsx","../../../client-app/src/apps/creditcard/main.tsx"],"sourcesContent":["import i18next from 'i18next';\nimport { initReactI18next } from 'react-i18next';\nimport HttpApi from 'i18next-http-backend';\nimport { getRuntime } from '@n2-common/lib/runtime';\nimport { DocumentLanguageDetector } from '@n2-common/lib/DocumentLanguageDetector';\n\nconst runtime = getRuntime();\n\ni18next //\n .use(initReactI18next)\n .use(HttpApi)\n .use(DocumentLanguageDetector)\n .init({\n interpolation: { escapeValue: false },\n debug: false, //!runtime.isProd,\n ns: ['cc', 'common', 'validation'],\n backend: {\n loadPath: `${runtime.isProd ? '/client-apps' : ''}/locales/{{lng}}/{{ns}}.json?v=${runtime.build}`,\n },\n fallbackLng: false,\n load: 'languageOnly',\n react: {\n useSuspense: true,\n },\n });\n","import { CreditCardFiApplicantData } from '@n2-common/serverGeneratedTypings/creditCardFiApplicantData';\nimport { FormValuesFi } from './stages-fi';\nimport { FormValuesNo } from './stages-no';\nimport { CreditCardNoApplicantData } from '@n2-common/serverGeneratedTypings/creditCardNoApplicantData';\nimport { CreditCardNoApplicationInputModel } from '@n2-common/serverGeneratedTypings/creditCardNoApplicationInputModel';\n\ntype InferInputData = TCountry extends 'FI'\n ? CreditCardFiApplicantData\n : TCountry extends 'NO'\n ? CreditCardNoApplicantData\n : never;\n\nexport function cleanup(values: FormValuesNo | FormValuesFi) {\n return {\n Applicant: Object.entries(values.Applicant).reduce(\n (m, [key, value]) => ({ ...m, [key]: value != null ? value.toString() : null }),\n {} as InferInputData\n ),\n GAClientRef: 'not_consent',\n Consents: Object.entries(values.Consents).reduce((m, [key, value]) => (value ? [...m, key] : m), [] as string[]),\n };\n}\n\nexport function specifyAccommodationTypeOther(accommodationType: CreditCardNoApplicationInputModel['Applicant']['AccommodationType']) {\n return ['O'].includes(accommodationType);\n}\n\nexport function specifyAccomodationCost(accommodationType: CreditCardNoApplicationInputModel['Applicant']['AccommodationType']) {\n return !['H', ''].includes(accommodationType);\n}\n\nexport function applicantHasSharedEconomy(martialStatus: CreditCardNoApplicationInputModel['Applicant']['MaritalStatus']) {\n return ['C', 'M'].includes(martialStatus);\n}\n","import { CreditCardFiApplicantData } from '@n2-common/serverGeneratedTypings/creditCardFiApplicantData';\nimport { CreditCardFiApplicationInputModel } from '@n2-common/serverGeneratedTypings/creditCardFiApplicationInputModel';\nimport {\n AccomodationStatusValue,\n EmploymentStatusCode,\n MartialStatusValues,\n accommodationStatusCodesFi,\n employmentStatusCodeFi,\n martialStatusValues,\n} from '@n2-common/uiFieldValues/applicationFormFields';\nimport { type ConsentType, getConsentFieldDef } from '@n2-common/uiFieldValues/consents';\nimport { TFunction } from 'i18next';\nimport { StageField, WizardStage } from '@n2-common/components/MultiStageOnePageWizard/types';\nimport {\n FinnishAmountInput as AmountInput,\n EmailInput,\n FinnishSsnInput,\n FormikInput,\n FormikInputGroup,\n FormikSelect,\n FinnishMobilePhoneNumberInput,\n} from '@n2-common/ui';\nimport { getNationalIdValidation, mobileRequired } from '@n2-common/validation/fi';\nimport { emailRequired } from '@n2-common/validation/common/email';\nimport { addPleaseSelectOption } from '@n2-common/components/MultiStageOnePageWizard';\nimport { amount, amountNotEmpty } from '@n2-common/validation/common/amount';\nimport * as Yup from 'yup';\nimport { Config } from '.';\nimport { addComparrisonValidation } from '@n2-common/lib/yup-helpers';\nimport { cleanup, specifyAccommodationTypeOther, specifyAccomodationCost } from './helpers';\n\nfunction resolveStages(t: TFunction, provider: Backend = 'O1'): WizardStage[] {\n return [\n {\n legend: 'Hakijan tiedot',\n sectionNameForTracking: 'PersonalInformation', //\n fields: [\n {\n Component: FinnishSsnInput,\n name: 'Applicant.NationalId',\n componentProps: {\n label: 'Henkilötunnus',\n },\n validation: getNationalIdValidation(),\n },\n {\n Component: EmailInput,\n name: 'Applicant.Email',\n componentProps: {\n label: 'Sähköpostiosoite',\n helptext:\n 'Sähköpostiosoite, johon saat allekirjoitus-linkin, sekä muita tärkeitä tietoja. Käytämme sähköpostia kaikkeen viestintään, joten on tärkeää että annat henkilökohtaisen sähköpostiosoitteesi, jota luet säännöllisesti.',\n },\n validation: emailRequired(t),\n },\n {\n Component: FinnishMobilePhoneNumberInput,\n name: 'Applicant.Phonenumber',\n componentProps: {\n label: 'Matkapuhelin',\n helptext: 'Kirjoita tähän kenttään henkilökohtainen puhelinnumerosi ilman maatunnusta.',\n },\n validation: mobileRequired(),\n },\n {\n name: 'Applicant.MaritalStatus',\n validation: Yup.string().required(t('validation:string.required')).nullable(),\n componentProps: {\n label: 'Siviilisääty',\n helptext: 'Merkitse tähän kenttään tämänhetkinen siviilisäätysi',\n },\n Component: (props) => ,\n },\n {\n name: 'Applicant.NumberOfChildren',\n componentProps: {\n label: 'Taloudessa asuvien lasten lukumäärä',\n },\n Component: (props) => ,\n validation: amount(0, 20, t),\n },\n ],\n },\n {\n legend: 'Talous',\n sectionNameForTracking: 'Economy', //\n fields: [\n {\n name: 'Applicant.EmploymentStatus',\n validation: Yup.string().required(t('validation:string.required')).nullable(),\n componentProps: {\n label: 'Tämänhetkinen työtilanteesi',\n helptext: 'Merkitse tähän kenttään tämänhetkinen työtilanteesi',\n },\n Component: (props) => ,\n },\n {\n name: 'Applicant.AccommodationType',\n validation: Yup.string().required(t('validation:string.required')).nullable(),\n componentProps: {\n label: 'Asumismuoto',\n helptext: 'Valitse tähän kenttään tämänhetkinen asumismuosi valittavissa olevista vaihtoehdoista',\n },\n Component: (props) => ,\n },\n {\n name: 'Applicant.AccommodationTypeOther',\n componentProps: {\n label: 'Muu, mikä?',\n helptext:\n 'Kirjoita tähän kenttään oma osuutesi vuokrasta tai yhtiövastikkeesta (sis. hoito- ja rahoitusvastikkeen) kuukaudessa',\n },\n Component: (props) => ,\n validation: addComparrisonValidation(\n Yup.string(),\n 'Täytä pakolliset kentät',\n 'Applicant.AccommodationType',\n (val, other) => (specifyAccommodationTypeOther(other) ? !!val : true)\n ),\n hidden: (values) => !specifyAccommodationTypeOther(values['Applicant'].AccommodationType),\n },\n {\n name: 'Applicant.AccommodationCost',\n componentProps: {\n label: 'Sinun osuutesi vuokrasta / yhtiövastikkeesta',\n helptext:\n 'Kirjoita tähän kenttään oma osuutesi vuokrasta tai yhtiövastikkeesta (sis. hoito- ja rahoitusvastikkeen) kuukaudessa',\n },\n validation: addComparrisonValidation(\n Yup.number().nullable(),\n t('validation:amount.requiredZeroForEmpty', { fieldLabel: 'Majoituskustannukset' }),\n 'Applicant.AccommodationType',\n (val, other) => (specifyAccomodationCost(other) ? val != null && !isNaN(val) && val >= 0 : true)\n ),\n hidden: (values) => !specifyAccomodationCost(values.Applicant.AccommodationType),\n Component: AmountInput,\n },\n ...getMortageField(provider, t),\n {\n name: 'Applicant.HasCar',\n componentProps: {\n label: 'Onko sinulla oma tai leasing-auto?',\n helptext: 'Mikäli sinulla on auto, valitse “kyllä”.',\n },\n Component: (props) => (\n \n ),\n validation: Yup.string().nullable().required(t('validation:string.required')),\n },\n {\n name: 'Applicant.MonthlyIncome',\n componentProps: {\n label: 'Kuukausitulot (netto)',\n helptext:\n 'Kuukausitulosi verojen jälkeen. Mikäli saat palkkaa useammalta työnantajalta, voit yhdistää summan. Vuokratulot, tai lapsilisät eivät sisälly tähän kenttään.',\n },\n Component: AmountInput,\n validation: amountNotEmpty('Kuukausitulot', t),\n },\n ...getStudentLoanField(provider, t),\n {\n name: 'Applicant.OtherLoan',\n componentProps: {\n label: 'Osuutesi muista luotoista',\n helptext:\n 'Oma osuutesi auto-, moottoripyörä- ja venelainoista sekä kortti- ja kulutusluotoista (mukaan lukien luottosi Morrow Bankille)',\n },\n Component: AmountInput,\n validation: amountNotEmpty('Muu Laina', t),\n },\n ],\n },\n {\n legend: 'Luottokortin ehdot ja tietoa bonusohjelmasta',\n sectionNameForTracking: 'confirm',\n fields: [\n getConsentFieldDef('MKT_1_PROFILING_1', t, 'FI'),\n getConsentFieldDef('MKT_2_COOP_1', t, 'FI'),\n getConsentFieldDef('MKT_3_COMM_1', t, 'FI'),\n getConsentFieldDef('ConfirmSA', t, 'FI'),\n ],\n },\n ];\n}\n\nfunction getMortageField(provider: string, t: TFunction<'translation', undefined, 'translation'>): StageField[] {\n return provider == 'O2'\n ? [\n {\n name: 'Applicant.Mortgage',\n componentProps: {\n label: 'Sinun osuutesi asuntolainasta',\n helptext: 'Kirjoita tähän kenttään oma osuutesi voimassa olevasta asuntolainasta',\n },\n validation: addComparrisonValidation(\n Yup.number().nullable(),\n t('validation:amount.requiredZeroForEmpty', { fieldLabel: 'asuntolainasta' }),\n 'Applicant.AccommodationType',\n (val, other) => (!specifyAccomodationCost(other) ? val != null && !isNaN(val) && val >= 0 : true)\n ),\n hidden: (values) => specifyAccomodationCost(values.Applicant.AccommodationType),\n Component: AmountInput,\n },\n ]\n : [];\n}\n\nfunction getStudentLoanField(provider: string, t: TFunction<'translation', undefined, 'translation'>): StageField[] {\n return provider == 'O2'\n ? [\n {\n name: 'Applicant.StudentLoan',\n validation: amountNotEmpty('Opiskelijalainan kuukausikustannukset', t),\n componentProps: {\n label: 'Valtion takaama opintolaina',\n helptext: 'Kirjoita tähän kenttään tällä hetkellä voimassa olevien opintolainojesi jäljellä oleva kokonaissumma',\n },\n Component: AmountInput,\n },\n ]\n : [\n {\n name: 'Applicant.MortgageAndStudentLoan',\n componentProps: {\n label: 'Asunto- ja opintolainojesi yhteissumma (oma osuutesi)',\n helptext: 'Ilmoita tässä kentässä oma osuutesi asuntolainasta sekä valtion takaama opintolaina yhteensä.',\n },\n Component: AmountInput,\n validation: amountNotEmpty('Opiskelijalainan kuukausikustannukset', t),\n },\n ];\n}\n\nexport function cleanupFi(values: FormValuesFi): CreditCardFiApplicationInputModel {\n const cleaned: CreditCardFiApplicationInputModel = cleanup<'FI'>(values);\n if (!specifyAccommodationTypeOther(cleaned.Applicant.AccommodationType)) {\n cleaned.Applicant.AccommodationTypeOther = '';\n }\n\n if (!specifyAccomodationCost(cleaned.Applicant.AccommodationType)) {\n cleaned.Applicant.AccommodationCost = '';\n }\n\n return cleaned;\n}\n\nexport type CreditCardApplicant = Override<\n CreditCardFiApplicantData,\n {\n AccommodationType: AccomodationStatusValue | '';\n EmploymentStatus: EmploymentStatusCode | '';\n MaritalStatus: MartialStatusValues | '';\n }\n>;\n\nexport type FormValuesFi = Override;\n\nconst Applicant: CreditCardApplicant = {\n AccommodationCost: '',\n AccommodationType: '',\n AccommodationTypeOther: '',\n Email: '',\n EmploymentStatus: '',\n HasCar: '',\n MaritalStatus: '',\n MonthlyIncome: '',\n NationalId: '',\n NumberOfChildren: '',\n OtherLoan: '',\n Phonenumber: '',\n MortgageAndStudentLoan: '',\n Mortgage: '',\n StudentLoan: '',\n};\n\nconst initialValues: FormValuesFi = {\n Applicant,\n Consents: {},\n GAClientRef: '',\n};\n\nexport const config: Config<'FI'> = { cleanup: cleanupFi, initialValues, resolveStages };\n","import { WizardStage } from '@n2-common/components/MultiStageOnePageWizard/types';\nimport { CreditCardNoApplicationInputModel } from '@n2-common/serverGeneratedTypings/creditCardNoApplicationInputModel';\nimport { TFunction } from 'i18next';\nimport { Config } from '.';\nimport { AmountInput, EmailInput, NationalIdInput, PhoneNumberInput } from '@n2-common/ui/CustomInput';\nimport { nationalId } from '@n2-common/validation/no';\nimport { emailRequired } from '@n2-common/validation/common/email';\nimport { norwegianPhoneNumber } from '@n2-common/validation/no/phoneNumber';\nimport { stringRequired } from '@n2-common/validation/common/string';\nimport React from 'react';\nimport { FormikInput, FormikInputGroup, FormikSelect } from '@n2-common/ui';\nimport { addPleaseSelectOption } from '@n2-common/components/MultiStageOnePageWizard';\nimport {\n AccomodationStatusValue,\n EmploymentStatusCode,\n MartialStatusValues,\n accommodationStatusCodesNo,\n employmentStatusCodeNo,\n martialStatusValues,\n} from '@n2-common/uiFieldValues/applicationFormFields';\nimport * as Yup from 'yup';\nimport { CreditCardNoApplicantData } from '@n2-common/serverGeneratedTypings/creditCardNoApplicantData';\nimport { amountNotEmpty, amountNotNull } from '@n2-common/validation/common/amount';\nimport { ConsentType, getConsentFieldDef } from '@n2-common/uiFieldValues/consents';\nimport { addComparrisonValidation, addTest } from '@n2-common/lib/yup-helpers';\nimport { applicantHasSharedEconomy, cleanup, specifyAccommodationTypeOther, specifyAccomodationCost } from './helpers';\n\nexport type CreditCardApplicant = Override<\n CreditCardNoApplicantData,\n {\n AccommodationType: AccomodationStatusValue | '';\n EmploymentStatus: EmploymentStatusCode | '';\n MaritalStatus: MartialStatusValues | '';\n }\n>;\n\nexport type FormValuesNo = Override;\n\nconst emptyApplicant: CreditCardApplicant = {\n NationalId: '',\n Email: '',\n Phonenumber: '',\n AccommodationType: '',\n AccommodationTypeOther: '',\n AccommodationCost: '',\n MaritalStatus: '',\n NumberOfChildren: '',\n EmploymentStatus: '',\n HasCar: '',\n YearlyGrossIncome: '',\n ExtraEarningMonthly: '',\n PartnerGrossIncome: '',\n Mortgage: '',\n StudentLoan: '',\n CarLoan: '',\n};\nconst initialValues: FormValuesNo = {\n Applicant: emptyApplicant,\n Consents: {},\n GAClientRef: '',\n};\n\nfunction resolveStages(t: TFunction): WizardStage[] {\n return [\n {\n legend: 'Personopplysninger',\n sectionNameForTracking: 'PersonalInformation',\n fields: [\n {\n name: 'Applicant.NationalId',\n validation: nationalId.norwegianNationalId(),\n componentProps: {\n label: 'Personnummer',\n },\n Component: NationalIdInput,\n },\n {\n name: 'Applicant.Email',\n validation: emailRequired(t),\n componentProps: {\n label: 'E-postadresse',\n helptext: 'Den e-postadressen som du ønsker å motta kommunikasjon på',\n },\n Component: EmailInput,\n },\n {\n name: 'Applicant.Phonenumber',\n validation: norwegianPhoneNumber(t),\n componentProps: {\n label: 'Mobilnummer',\n helptext: 'Norsk telefonnummer, 8 siffer',\n },\n Component: PhoneNumberInput,\n },\n {\n name: 'Applicant.AccommodationType',\n validation: stringRequired(t),\n componentProps: {\n label: 'Boforhold',\n },\n Component: (props) =>\n React.createElement(FormikSelect, { ...props, options: addPleaseSelectOption(accommodationStatusCodesNo, t) }),\n },\n {\n name: 'Applicant.AccommodationTypeOther',\n validation: addComparrisonValidation(\n Yup.string(),\n t('validation:string.required'),\n 'Applicant.AccommodationType',\n (val, other) => {\n return specifyAccommodationTypeOther(other) ? !!val : true;\n }\n ),\n componentProps: {\n label: 'Spesifiser ditt boforhold',\n },\n hidden: (values) => !specifyAccommodationTypeOther(values['Applicant'].AccommodationType),\n Component: (props) => React.createElement(FormikInput, { ...props, type: 'text' }),\n },\n {\n name: 'Applicant.AccommodationCost',\n validation: addComparrisonValidation(\n Yup.number().nullable(),\n t('validation:amount.requiredZeroForEmpty', { fieldLabel: 'leiekostnader' }),\n 'Applicant.AccommodationType',\n (val, other) => {\n return specifyAccomodationCost(other) ? !isNaN(val) && val >= 0 : true;\n }\n ),\n componentProps: (values) => ({\n label: applicantHasSharedEconomy(values['Applicant'].MaritalStatus)\n ? 'Husholdningens leiekostnader/fellesutgifter'\n : 'leiekostnader/fellesutgifter',\n helptext: 'Husholdningens totale månedlige leiekostnader/fellesutgifter',\n }),\n hidden: (values) => !specifyAccomodationCost(values.Applicant.AccommodationType),\n Component: AmountInput,\n },\n {\n name: 'Applicant.MaritalStatus',\n validation: stringRequired(t),\n componentProps: {\n label: 'Sivilstatus',\n },\n Component: (props) =>\n React.createElement(FormikSelect, {\n ...props,\n options: addPleaseSelectOption(martialStatusValues(t), t),\n }),\n },\n {\n name: 'Applicant.NumberOfChildren',\n componentProps: {\n label: 'Antall barn som bor i husholdningen',\n },\n Component: (props) => ,\n validation: Yup.number()\n .min(0, 'Antall barn må angis')\n .max(16, 'Ugyldig antall barn. Sjekk at du har skrevet riktig verdi i feltet.')\n .required('Antall barn må angis. Skriv 0 hvis du ikke har barn'),\n },\n ],\n },\n {\n legend: `Økonomisk situasjon`,\n sectionNameForTracking: `Economical information`,\n fields: [\n {\n name: 'Applicant.HasCar',\n componentProps: (values) => ({\n label: applicantHasSharedEconomy(values['Applicant'].MaritalStatus)\n ? 'Eier eller leaser husholdningen bil?'\n : 'Eier eller leaser du bil?',\n helptext: applicantHasSharedEconomy(values['Applicant'].MaritalStatus)\n ? 'Dersom husholdningen eier eller leaser bil velg \"ja\".'\n : \"Velg 'ja' dersom du eier eller leaser bil på nåværende tidpsunkt\",\n }),\n Component: (props) => (\n \n ),\n validation: Yup.string().nullable().required(t('validation:string.required')),\n },\n {\n name: 'Applicant.EmploymentStatus',\n validation: stringRequired(t),\n componentProps: {\n label: 'Arbeidssituasjon',\n },\n Component: (props) =>\n React.createElement(FormikSelect, {\n //\n options: addPleaseSelectOption(employmentStatusCodeNo, t),\n ...props,\n }),\n },\n {\n name: 'Applicant.YearlyGrossIncome',\n validation: amountNotNull(t),\n componentProps: {\n label: 'Brutto årsinntekt',\n helptext: 'Din personlige brutto årsinntekt (før skatt)',\n },\n Component: AmountInput,\n },\n {\n name: 'Applicant.ExtraEarningMonthly',\n validation: amountNotNull(t),\n componentProps: {\n label: 'Månedlig skattefri leieinntekt i husholdningen',\n helptext: 'Oppgi husholdningens skattefrie inntekt ved utleie av bolig',\n },\n Component: AmountInput,\n },\n {\n name: 'Applicant.PartnerGrossIncome',\n hidden: (values) => !applicantHasSharedEconomy(values.Applicant.MaritalStatus),\n validation: addTest(\n Yup.number(),\n 'test-if-married',\n 'Partners brutto årsinntekt er påkrevd.',\n (val: unknown, values: FormValuesNo) =>\n !applicantHasSharedEconomy(values.Applicant.MaritalStatus) || (typeof val == 'number' && val >= 0)\n ),\n componentProps: {\n label: 'Partners brutto årsinntekt',\n helptext: 'Oppgi partners årlige inntekt før skatt',\n },\n Component: AmountInput,\n },\n {\n name: 'Applicant.Mortgage',\n validation: amountNotEmpty('hyreskostnad', t),\n componentProps: (values) => ({\n label: applicantHasSharedEconomy(values['Applicant'].MaritalStatus)\n ? 'Husholdningens samlede boliggjeld'\n : 'Boliggjeld (din andel)',\n helptext: applicantHasSharedEconomy(values['Applicant'].MaritalStatus)\n ? 'Skriv inn husholdningens samlede boliggjeld. Utestående lånebeløp.'\n : 'Oppgi din personlige totale utestående boliggjeld.',\n }),\n Component: AmountInput,\n },\n {\n name: 'Applicant.StudentLoan',\n validation: amountNotNull(t),\n componentProps: {\n label: 'Studiegjeld',\n helptext: 'Din nåværende personlige studiegjeld',\n },\n Component: AmountInput,\n },\n {\n name: 'Applicant.CarLoan',\n validation: amountNotNull(t),\n componentProps: {\n label: 'Gjeld til bil/båt/MC/bobil',\n helptext: 'Din nåværende personlige andel gjeld til bil/båt/MC/bobil (cirkabeløp)',\n },\n Component: AmountInput,\n },\n ],\n },\n {\n legend: 'Kredittkortvilkår og informasjon om bonusprogrammet',\n sectionNameForTracking: 'confirm',\n fields: [\n getConsentFieldDef('MKT_1_PROFILING_1', t, 'NO'),\n getConsentFieldDef('MKT_2_COOP_1', t, 'NO'),\n getConsentFieldDef('MKT_3_COMM_1_kredittkort', t, 'NO'),\n ],\n },\n ];\n}\n\nexport function cleanupNo(values: FormValuesNo): CreditCardNoApplicationInputModel {\n const cleaned: CreditCardNoApplicationInputModel = cleanup<'NO'>(values);\n\n if (!specifyAccommodationTypeOther(cleaned.Applicant.AccommodationType)) {\n cleaned.Applicant.AccommodationTypeOther = '';\n }\n if (!applicantHasSharedEconomy(cleaned.Applicant.MaritalStatus)) {\n cleaned.Applicant.PartnerGrossIncome = '';\n }\n\n if (!specifyAccomodationCost(cleaned.Applicant.AccommodationType)) {\n cleaned.Applicant.AccommodationCost = '';\n }\n\n return cleaned;\n}\n\nexport const config: Config<'NO'> = { cleanup: cleanupNo, initialValues, resolveStages };\n","import { PropsWithChildren } from 'react';\nimport { CreditCardApplicationContext, CreditCardApplicationContextType } from './Context';\nimport { ApplicationStatusModel } from '@n2-common/serverGeneratedTypings/applicationStatusModel';\nimport { NavigateFunction } from 'react-router-dom';\nimport { getApplicatId, pollForExpectedApplicationState, postLoanApplication } from '@n2-common/services/legacyApplicationApiService';\nimport { N2ApplicationStatus } from '@n2-common/serverGeneratedTypings/n2ApplicationStatus';\nimport { ApplicationPaths, navigateToStep } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { navigateToCorrectStep } from '../../components/App';\nimport { PostLoanApplicationResult } from '@n2-common/models';\n\ntype Result = PostLoanApplicationResult & { applicantId?: string; status?: ApplicationStatusModel };\n\nconst context: CreditCardApplicationContextType = {\n postCreditCardApplication: async function (country, input): Promise {\n const [, model] = await postLoanApplication(input, `/api/n2/creditcardapplication/${country}/submit`);\n const status = await pollForExpectedApplicationState(\n model.ApplicationGuid,\n '',\n (res: ApplicationStatusModel) =>\n [N2ApplicationStatus.Offer, N2ApplicationStatus.Declined, N2ApplicationStatus.ReadyForSigning].includes(res.Status),\n false\n );\n\n if (!status) {\n return { applicationId: model.ApplicationGuid, outcome: 'Pending' };\n }\n\n const applicantIdModel = await getApplicatId(model.ApplicationGuid);\n if (!applicantIdModel.ApplicantId) {\n throw new Error('Error fetching applicantId after submitting');\n }\n\n return {\n applicationId: model.ApplicationGuid,\n outcome: status.Status == N2ApplicationStatus.Offer ? 'Approve' : 'Decline',\n applicantId: applicantIdModel.ApplicantId,\n status,\n };\n },\n\n redirect: function (result: Result, navigate: NavigateFunction): void {\n if (result.outcome == 'Pending') {\n navigateToStep(ApplicationPaths.loadApplication, result.applicationId, navigate, result.applicantId);\n return;\n }\n if (!result.status || !result.applicantId) {\n throw new Error(\"Can't happen\");\n }\n navigateToCorrectStep({ ...result.status, IsMainApplicant: true }, result.applicantId, navigate);\n },\n};\n\nexport const CreditCardApplicationContextProvider: React.FC = ({ children }) => {\n return {children};\n};\n","import { PropsWithChildren } from 'react';\nimport { CreditCardApplicationContext, CreditCardApplicationContextType } from './Context';\nimport o2ApiService, { O2 } from '@n2-common/services/o2Service';\nimport { getTracking } from '@n2-common/lib/useTracking';\nimport { Outcome, OutcomeValues, PostLoanApplicationResult, redirect } from '@n2-common/models';\nimport pollForApplicationState from '@n2-common/services/o2Service/pollForApplicationState';\n\nconst context: CreditCardApplicationContextType = {\n async postCreditCardApplication(country, values): Promise {\n const application = { ...values, tracking: await getTracking() };\n const applicationId = await o2ApiService.postApplication(application, country, 'creditcard');\n const state = await pollForApplicationState(applicationId, null, (s) => s != null);\n if (!state) {\n return { outcome: 'Pending', applicationId };\n }\n if (state.status == 'Redirect') {\n return { outcome: 'Redirect', applicationId, applicantId: state.applicantId };\n }\n return { outcome: getOutcome(state.status), applicationId };\n },\n redirect,\n};\n\nexport const CreditCardApplicationContextProvider: React.FC = ({ children }) => {\n return {children};\n};\n\nfunction getOutcome(status: O2.State): Outcome {\n if ((OutcomeValues as ReadonlyArray).includes(status)) {\n return status as Outcome;\n }\n return 'Pending';\n}\n","import { createContext, useContext } from 'react';\nimport { CreditCardNoApplicationInputModel } from '@n2-common/serverGeneratedTypings/creditCardNoApplicationInputModel';\nimport { CreditCardFiApplicationInputModel } from '@n2-common/serverGeneratedTypings/creditCardFiApplicationInputModel';\nimport { PostLoanApplicationResult, redirect } from '@n2-common/models';\n\nexport { CreditCardApplicationContextProvider as O1CreditCardApplicationContextProvider } from './Context.O1';\nexport { CreditCardApplicationContextProvider as O2CreditCardApplicationContextProvider } from './Context.O2';\n\nexport type CreditCardApplicationContextType = {\n postCreditCardApplication: (\n country: Country,\n input: CreditCardNoApplicationInputModel | CreditCardFiApplicationInputModel\n ) => Promise;\n redirect: typeof redirect;\n};\n\nexport const CreditCardApplicationContext = createContext(null);\n\nexport function useCreditCardApplicationContext() {\n const context = useContext(CreditCardApplicationContext);\n if (!context) {\n throw new Error('useCreditCardApplicationContext hook is only useable in tree under LoanApplicationContextProvider element.');\n }\n return context;\n}\n","import { ApplicationPaths } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { safeRedirect } from '@n2-common/applicationPages/applicationStatusHelpers';\nimport { getApplicationIds } from '@n2-common/components/ApplicationContext';\nimport { getApplicationStatus } from '@n2-common/services/legacyApplicationApiService';\nimport { logErrorToServerside } from '@n2-common/services/serverSideLogging';\nimport { generatePath, LoaderFunctionArgs, redirect } from 'react-router-dom';\n\nexport async function wizardAppLoader({ request }: LoaderFunctionArgs) {\n const requestUrl = new URL(request.url);\n\n if (requestUrl.searchParams.has('applicationId')) {\n const { applicantId, applicationId } = await getApplicationIds(request);\n\n try {\n if (applicationId !== null && applicantId !== null) {\n const applicationStatus = await getApplicationStatus(applicationId, applicantId, request.signal);\n\n return safeRedirect(request.url, applicationStatus, applicantId);\n }\n } catch (err) {\n logErrorToServerside(\n `WizardAppPage called with applicationId witch was not valid - redirecting to new wizard.`,\n applicationId,\n applicantId,\n err\n );\n return redirect(generatePath(ApplicationPaths.wizard));\n }\n }\n return null;\n}\n","import { Headline } from '@n2-common/ui';\nimport { useTranslation } from 'react-i18next';\nimport { MultiStageOnePageWizard } from '@n2-common/components';\nimport type { SubmitFunc, WizardStage } from '@n2-common/components/MultiStageOnePageWizard/types';\nimport { submitSsnToGetGpid } from '@n2-common/services/legacyApplicationApiService';\nimport { startTransition, useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport { trackCoreBankEvent, trackEcommerceEvent } from '@n2-common/lib/gtm';\nimport { navigateToStep, ApplicationPaths } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { useNavigate } from 'react-router-dom';\nimport { useApplicationIdContext } from '@n2-common/components/ApplicationContext';\nimport { FormValuesFi, config as configFI } from './stages-fi';\nimport { FormValuesNo, config as configNO } from './stages-no';\nimport { TFunction } from 'i18next';\nimport { errorToAction } from '@n2-common/applicationPages/applicationErrorHelper';\nimport { useBackendContext } from '@n2-common/components/BackendContext';\nimport { O1CreditCardApplicationContextProvider, O2CreditCardApplicationContextProvider, useCreditCardApplicationContext } from './Context';\nimport { CreditCardFiApplicationInputModel } from '@n2-common/serverGeneratedTypings/creditCardFiApplicationInputModel';\nimport { CreditCardNoApplicationInputModel } from '@n2-common/serverGeneratedTypings/creditCardNoApplicationInputModel';\nimport { outcomeToECommerceStatus, shouldBeTracked } from '@n2-common/models';\nexport * from './loader';\n\nexport default function WizardApp() {\n const { provider } = useBackendContext();\n return provider != 'O2' ? (\n \n \n \n ) : (\n \n \n \n );\n}\n\nfunction WizardAppComponent({ provider }: { provider: Backend }) {\n const navigate = useNavigate();\n const [isSubmitting, setIsSubmitting] = useState(false);\n const { country, productType, applicantId, applicationId } = useApplicationIdContext(false, false);\n const formName = `${productType}-${country}`;\n const { t } = useTranslation(['common', 'validation', 'cc']);\n const { postCreditCardApplication, redirect } = useCreditCardApplicationContext();\n const [gpid, setGpid] = useState('');\n\n useLayoutEffect(() => {\n document.title = t('cc:wizard.headline');\n }, [t]);\n\n useEffect(() => {\n trackCoreBankEvent(productType, country, 'application_start');\n trackEcommerceEvent(productType, country, 'view_item', 0);\n }, [country, productType]);\n const { resolveStages, initialValues, cleanup } = useMemo>(() => {\n switch (country) {\n case 'FI':\n return configFI;\n case 'NO':\n return configNO;\n\n default:\n console.log(`Missing stages for country ${country}`);\n return {} as never;\n }\n }, [country]);\n\n const stages = useMemo(() => resolveStages(t, provider), [resolveStages, t, provider]);\n\n const onSsnStepFinished = useCallback(\n async (values: typeof initialValues) => {\n const cleanedValues = cleanup(values);\n\n try {\n const [, res] = await submitSsnToGetGpid({ Ssn: cleanedValues.Applicant.NationalId });\n setGpid(res.Gpid);\n trackEcommerceEvent(productType, country, 'begin_checkout', 0, res.Gpid);\n } catch (err) {\n console.error(err);\n return;\n }\n },\n [cleanup, country, productType]\n );\n\n const submit: SubmitFunc = useCallback(\n async (values, onProgress) => {\n if (isSubmitting) {\n return;\n }\n setIsSubmitting(true);\n const cleanedValues = cleanup(values);\n onProgress('Submitted');\n try {\n startTransition(() => onProgress({ type: 'Processing', message: t('FormSubmitButton.Processing') }));\n\n trackCoreBankEvent(productType, country, 'application_sent');\n\n const result = await postCreditCardApplication(country, cleanedValues);\n\n if (result.outcome != 'Redirect') {\n if (shouldBeTracked(result.outcome)) {\n trackEcommerceEvent(\n productType,\n country,\n 'add_shipping_info',\n 0,\n gpid,\n result.applicationId,\n outcomeToECommerceStatus(result.outcome)\n );\n trackCoreBankEvent(productType, country, 'application_status', outcomeToECommerceStatus(result.outcome));\n }\n startTransition(() => {\n onProgress('Done');\n setIsSubmitting(false);\n });\n }\n redirect(result, navigate);\n } catch (err) {\n const action = errorToAction(err, formName, applicationId, applicantId, provider);\n if (action) {\n onProgress({ type: 'Error', options: action });\n } else {\n // We can't recover from this :-(\n navigateToStep(ApplicationPaths.error, applicationId || '', navigate, null);\n }\n startTransition(() => {\n setIsSubmitting(false);\n onProgress('Error');\n });\n }\n },\n [\n applicantId,\n applicationId,\n cleanup,\n country,\n formName,\n gpid,\n isSubmitting,\n navigate,\n postCreditCardApplication,\n productType,\n provider,\n redirect,\n t,\n ]\n );\n\n return (\n <>\n {t('cc:wizard.headline')}\n \n \n );\n}\ntype GetInputModel = TCountry extends 'FI'\n ? CreditCardFiApplicationInputModel\n : TCountry extends 'NO'\n ? CreditCardNoApplicationInputModel\n : never;\n\ntype GetFormValueType = TCountry extends 'FI' ? FormValuesFi : TCountry extends 'NO' ? FormValuesNo : never;\n\nexport type Config = {\n cleanup: (values: GetFormValueType) => GetInputModel;\n initialValues: GetFormValueType;\n resolveStages: (t: TFunction, provider?: Backend) => WizardStage>[];\n};\n","import { ApplicationPaths } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { safeRedirect } from '@n2-common/applicationPages/applicationStatusHelpers';\nimport { assertDataIsNotResponse } from '@n2-common/asserts';\nimport { getApplicationIds } from '@n2-common/components/ApplicationContext';\nimport { ApplicationStatusModel } from '@n2-common/serverGeneratedTypings/applicationStatusModel';\nimport { N2ApplicationStatus } from '@n2-common/serverGeneratedTypings/n2ApplicationStatus';\nimport { N2Product } from '@n2-common/serverGeneratedTypings/n2Product';\nimport { getApplicationStatus } from '@n2-common/services/legacyApplicationApiService';\nimport { logErrorToServerside } from '@n2-common/services/serverSideLogging';\nimport { generatePath, LoaderFunctionArgs, redirect, useLoaderData } from 'react-router-dom';\n\nexport async function offerPageLoader({ request }: LoaderFunctionArgs) {\n const { applicantId, applicationId } = await getApplicationIds(request);\n\n if (applicantId === null || applicationId === null) {\n logErrorToServerside(`Missing applicationId or applicantId for request`, applicationId, applicantId, request);\n return redirect(generatePath(ApplicationPaths.error));\n }\n\n try {\n const applicationStatus = await getApplicationStatus(applicationId, applicantId, request.signal);\n\n if (!readyForOffer(applicationStatus)) {\n return safeRedirect(request.url, applicationStatus, applicantId);\n }\n\n return { applicationId, applicantId, applicationStatus };\n } catch (err) {\n logErrorToServerside(`Error loading data for OfferPage.`, applicationId, applicantId, err || {});\n return redirect(generatePath(ApplicationPaths.error));\n }\n}\n\nexport function useOfferPageLoaderData() {\n const data = useLoaderData() as Awaited>;\n assertDataIsNotResponse(data);\n return data;\n}\n\nexport function readyForOffer(applicationStatus: ApplicationStatusModel) {\n if (applicationStatus.Product !== N2Product.CreditCard) {\n return false;\n }\n if(applicationStatus.Status == N2ApplicationStatus.ReadyForSigning && applicationStatus.ApplicantCddPending){\n return true;\n }\n if (applicationStatus.Status !== N2ApplicationStatus.Offer) {\n return false;\n }\n if (!applicationStatus.IsMainApplicant) {\n return false;\n }\n return true;\n}\n","import { ApplicationPaths, navigateToStep } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { OfferBox } from '@n2-common/components';\nimport { trackSectionView } from '@n2-common/lib/gtm';\nimport { Button, ButtonRowContainer, Headline, HtmlContainer } from '@n2-common/ui';\nimport { useEffect, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useOfferPageLoaderData } from './loader';\nimport { useTranslation } from 'react-i18next';\nimport { getCurrencyCode } from '@n2-common/lib/money';\nimport { useApplicationIdContext } from '@n2-common/components/ApplicationContext';\nexport * from './loader';\n\nexport function Offer() {\n const { applicationStatus } = useOfferPageLoaderData();\n const { applicationId, applicantId, country } = useApplicationIdContext();\n const { t } = useTranslation('cc');\n\n const navigate = useNavigate();\n\n const handleNext = useCallback(\n () => navigateToStep(ApplicationPaths.cdd, applicationId, navigate, applicantId),\n [applicantId, applicationId, navigate]\n );\n\n useEffect(() => {\n document.title = t('offer.title');\n trackSectionView('CC', country, '2.0', 'Offer');\n }, [country, t]);\n\n return (\n <>\n {t('offer.headline')}\n ('offer.box.heading')}\n amount={applicationStatus?.OfferedAmount || 0}\n currency={getCurrencyCode(country)}\n description={('offer.box.description')} />}\n />\n \n \n \n \n );\n}\n","import { type ApplicationSignStatusModel } from '@n2-common/serverGeneratedTypings/applicationSignStatusModel';\nimport { Action, ActionState } from '@n2-common/ui/ActionList';\nimport { N2ApplicationStatus } from '@n2-common/serverGeneratedTypings/n2ApplicationStatus';\nimport { DocumentRequirement } from '@n2-common/components/UploadDocuments';\nimport { TFunction } from 'i18next';\nimport { SignLoaderData } from './loader';\nimport { assertDataIsNotResponse } from '@n2-common/asserts';\nimport { formatWithCurrencyNoDecimals } from '@n2-common/lib/money';\n\nexport function getActions(status: SignLoaderData, documentStatus: DocumentRequirement[], t: TFunction) {\n assertDataIsNotResponse(status);\n const { applicationStatus, applicationSignStatus, country } = status;\n const actions: Action<'start-signing' | 'set-pin' | 'select-pin' | 'documents'>[] = [];\n if (applicationStatus && applicationStatus.Status == N2ApplicationStatus.ReadyForSigning) {\n const state = getSignatureState(applicationSignStatus);\n if (state != 'invalid') {\n actions.push({\n name: t(`signature.actions.start-signing.${state}.title`),\n parameter: 'start-signing',\n state,\n description: t(`signature.actions.start-signing.${state}.description`, {\n amount: formatWithCurrencyNoDecimals(applicationStatus.OfferedAmount || 0, country),\n }),\n iconName: 'signIcon',\n });\n }\n }\n if (documentStatus.length) {\n const state = getDocumentationState(documentStatus);\n if (state != 'invalid') {\n actions.push({\n name: t(`signature.actions.documents.${state}.title`),\n description: t(`signature.actions.documents.${state}.description`),\n parameter: 'documents',\n state,\n iconName: 'multipleDocumentIcon',\n });\n }\n }\n if (applicationStatus && applicationStatus.Status == N2ApplicationStatus.ReadyForPinSelect) {\n actions.push({\n name: t('signature.actions.set-pin.ready.title'),\n description: t('signature.actions.set-pin.ready.description'),\n parameter: 'set-pin',\n state: 'ready',\n iconName: 'pinCodeIcon',\n });\n actions.push({\n name: t('signature.actions.select-pin.ready.title'),\n description: t('signature.actions.select-pin.ready.description'),\n parameter: 'select-pin',\n state: 'ready',\n iconName: 'pinCodeIcon',\n });\n }\n return actions;\n}\n\nfunction getSignatureState(signStatus: ApplicationSignStatusModel | null): ActionState {\n if (!signStatus) {\n return 'invalid';\n }\n return signStatus.MainApplicantHasSigned ? 'final' : 'ready';\n}\nfunction getDocumentationState(documentStatus: DocumentRequirement[]): ActionState {\n console.log(documentStatus);\n if (!documentStatus) {\n return 'invalid';\n }\n if (documentStatus.every((doc) => !doc.canUpload)) {\n return 'final';\n }\n if (documentStatus.every((doc) => doc.completed)) {\n return 'completed';\n }\n if (documentStatus.some((doc) => !doc.completed)) {\n return 'ready';\n }\n return 'pending';\n}\n","import { ApplicationPaths } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { safeRedirect } from '@n2-common/applicationPages/applicationStatusHelpers';\nimport { assertDataIsNotResponse } from '@n2-common/asserts';\nimport { getApplicationIds } from '@n2-common/components/ApplicationContext';\nimport { ApplicationStatusModel } from '@n2-common/serverGeneratedTypings/applicationStatusModel';\nimport { N2ApplicationStatus } from '@n2-common/serverGeneratedTypings/n2ApplicationStatus';\nimport { N2Product } from '@n2-common/serverGeneratedTypings/n2Product';\nimport { getApplicationDocumentStatus, getApplicationSignStatus, getApplicationStatus } from '@n2-common/services/legacyApplicationApiService';\nimport { logErrorToServerside } from '@n2-common/services/serverSideLogging';\nimport { generatePath, LoaderFunctionArgs, redirect, useLoaderData } from 'react-router-dom';\n\nexport async function signPageLoader({ request }: LoaderFunctionArgs) {\n const { applicantId, applicationId, country } = await getApplicationIds(request);\n\n if (applicantId === null || applicationId === null) {\n return redirect(generatePath(ApplicationPaths.error));\n }\n try {\n const applicationStatus = await getApplicationStatus(applicationId, applicantId, request.signal);\n\n if (!readyForSignPage(applicationStatus)) {\n return safeRedirect(request.url, applicationStatus, applicantId);\n }\n\n const [documentStatus, applicationSignStatus] = await Promise.all([\n getApplicationDocumentStatus(applicationId, applicantId, request.signal),\n getApplicationSignStatus(applicationId, request.signal),\n ]);\n\n return { applicantId, applicationId, applicationStatus, documentStatus, applicationSignStatus, country };\n } catch (err) {\n logErrorToServerside(`Error loading data for SignPage.`, applicationId, applicantId, err || {});\n return redirect(generatePath(ApplicationPaths.error));\n }\n}\n\nexport type SignLoaderData = Awaited>;\n\nexport function useSignPageLoaderData() {\n const data = useLoaderData() as SignLoaderData;\n assertDataIsNotResponse(data);\n return data;\n}\n\nfunction readyForSignPage(applicationStatus: ApplicationStatusModel) {\n if (applicationStatus.Product !== N2Product.CreditCard) {\n return false;\n }\n if (![N2ApplicationStatus.ReadyForSigning, N2ApplicationStatus.ReadyForPinSelect].includes(applicationStatus.Status)) {\n return false;\n }\n if (applicationStatus.IsMainApplicant) {\n return !applicationStatus.ApplicantCddPending;\n }\n return true;\n}\n","import { ActionList, ActionOptions, Button, ButtonRowContainer, Headline, Hero, Paragraph, useDismissableErrorMessage } from '@n2-common/ui';\nimport { ApplicationSignContextProps } from '@n2-common/components/Sign/SignCommon';\nimport { getActions } from './actions';\nimport { Dispatch, SetStateAction, useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport { SubmitProgressBox, type SubmitProgressBoxProps } from '@n2-common/ui/SubmitProgress';\nimport { setRandomPin, startCreditCardSigning } from '@n2-common/services/legacyApplicationApiService';\nimport { ApplicationPaths, navigateToStep } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { NavigateFunction, useNavigate } from 'react-router-dom';\nimport { useSignPageLoaderData } from './loader';\nimport { useTranslation } from 'react-i18next';\nimport { TFunction } from 'i18next';\nimport { O1DocumentationContextProvider, useDocumentationContext } from '@n2-common/components/UploadDocuments';\nimport { trackCoreBankEvent, trackSectionView } from '@n2-common/lib/gtm';\nimport { useApplicationIdContext } from '@n2-common/components/ApplicationContext';\nimport { CmsNotification } from '@n2-common/components';\nimport { logErrorToServerside, logInfoToServerSide } from '@n2-common/services/serverSideLogging';\nimport { errorToAction } from '@n2-common/applicationPages/applicationErrorHelper';\nexport * from './loader';\n\ntype ActionDispatcher = (actionType: ReturnType[number]['parameter']) => void;\n\nexport function SignaturePage(): JSX.Element {\n return (\n \n \n \n );\n}\nexport function SignatureComponent(): JSX.Element {\n const navigate = useNavigate();\n const { t } = useTranslation(['cc', 'common']);\n const status = useSignPageLoaderData();\n const { country } = useApplicationIdContext();\n const { requirements } = useDocumentationContext();\n const actions = useMemo(() => getActions(status, requirements, t), [requirements, status, t]);\n const showComplete = useMemo(() => actions.every((a) => ['final', 'completed'].includes(a.state)), [actions]);\n const [processing, setProcessing] = useState();\n const { setErrorMessage, ErrorOutput } = useDismissableErrorMessage();\n const dispatch = useMemo(() => getDispatcher(navigate, status, setProcessing, setErrorMessage, t), [navigate, setErrorMessage, status, t]);\n\n useEffect(() => {\n trackSectionView('CC', country, '4.0', 'Sign Overview');\n }, [country]);\n\n useEffect(() => {\n if(showComplete) {\n trackCoreBankEvent('CC', country, 'application_complete',\n undefined, status.applicationStatus.ApplicationId, status.applicationStatus?.IsAgentApplication);\n logInfoToServerSide(`All steps completed`, status.applicationId, status.applicantId);\n }\n }, [country, showComplete, status]);\n\n useLayoutEffect(() => {\n document.title = t('signature.title');\n }, [t]);\n\n return (\n <>\n {' '}\n \n \n {t('signature.headline')}\n {t('signature.description')}\n \n \n {showComplete && (\n <>\n {t('common:Sign.AllDone')}\n \n \n navigateToStep(ApplicationPaths.applicantActionsCompleted, status.applicationId, navigate, status.applicantId)\n }\n >\n {t('common:Sign.Complete')}\n \n \n \n )}\n {processing && }\n \n \n );\n}\n\nfunction getDispatcher(\n navigate: NavigateFunction,\n status: Partial,\n setProgress: Dispatch>,\n setAction: (action: ActionOptions) => void,\n t: TFunction\n) {\n const dispatch: ActionDispatcher = async (actionType) => {\n const { applicantId, applicationId } = status;\n if (!applicantId || !applicationId) {\n return navigate(ApplicationPaths.error);\n }\n try {\n switch (actionType) {\n case 'start-signing':\n {\n setProgress({\n processingText: t('signature.actions.start-signing.progress.processingText'),\n state: 'Processing',\n submitText: t('signature.actions.start-signing.progress.submitText'),\n });\n const result = await startCreditCardSigning(applicationId, applicantId);\n setProgress(undefined);\n location.assign(result.Url);\n }\n\n break;\n case 'set-pin':\n navigateToStep(ApplicationPaths.setPin, applicationId, navigate, applicantId);\n break;\n\n case 'select-pin':\n setProgress({\n processingText: t('signature.actions.select-pin.progress.processingText'),\n state: 'Processing',\n submitText: t('signature.actions.select-pin.progress.submitText'),\n });\n await setRandomPin(applicationId);\n setProgress(undefined);\n navigateToStep(ApplicationPaths.sign, applicationId, navigate, applicantId);\n break;\n\n case 'documents':\n navigateToStep(ApplicationPaths.uploadDocuments, applicationId, navigate, applicantId);\n break;\n\n default:\n throw new Error(`Action '${actionType}' is not implemented`);\n }\n } catch (err) {\n const action = errorToAction(err, () => dispatch(actionType), applicationId, applicantId);\n if (action) {\n setAction(action);\n } else {\n logErrorToServerside(`Unhandled error${err}`, applicationId, applicantId, err);\n setAction({ action: 'dismissable', message: `${err}` });\n }\n } finally {\n setProgress(undefined);\n }\n };\n return dispatch;\n}\n","import { ApplicationPaths } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { safeRedirect } from '@n2-common/applicationPages/applicationStatusHelpers';\nimport { assertDataIsNotResponse } from '@n2-common/asserts';\nimport { getApplicationIds } from '@n2-common/components/ApplicationContext';\nimport { ApplicationStatusModel } from '@n2-common/serverGeneratedTypings/applicationStatusModel';\nimport { N2ApplicationStatus } from '@n2-common/serverGeneratedTypings/n2ApplicationStatus';\nimport { N2Product } from '@n2-common/serverGeneratedTypings/n2Product';\nimport { getApplicationStatus, getSetPinUrl } from '@n2-common/services/legacyApplicationApiService';\nimport { logErrorToServerside, logInfoToServerSide } from '@n2-common/services/serverSideLogging';\nimport { generatePath, LoaderFunctionArgs, redirect, useLoaderData } from 'react-router-dom';\n\nexport async function setPinPageLoader({ request }: LoaderFunctionArgs) {\n const { applicantId, applicationId } = await getApplicationIds(request);\n\n if (applicantId === null || applicationId === null) {\n return redirect(generatePath(ApplicationPaths.error));\n }\n\n try {\n const applicationStatus = await getApplicationStatus(applicationId, applicantId, request.signal);\n\n if (!readySetPinPage(applicationStatus)) {\n return safeRedirect(request.url, applicationStatus, applicantId);\n }\n const setPinResponse = await getSetPinUrl(applicationId, applicantId, request.signal);\n if (setPinResponse.Error != null && setPinResponse.Url === null) {\n logInfoToServerSide(`Got error when fetching SetPi-url. Redirecting to safe page`, applicationId, applicantId);\n return safeRedirect(request.url, applicationStatus, applicantId); \n }\n\n return setPinResponse;\n } catch (err) {\n logErrorToServerside(`Error loading data for SetPinPage.`, applicationId, applicantId, err || {});\n return redirect(generatePath(ApplicationPaths.error));\n }\n}\n\nexport function useSetPinPageLoaderData() {\n const data = useLoaderData() as Awaited>;\n assertDataIsNotResponse(data);\n return data;\n}\n\nfunction readySetPinPage(applicationStatus: ApplicationStatusModel) {\n if (applicationStatus.Product !== N2Product.CreditCard) {\n return false;\n } if (applicationStatus.Status !== N2ApplicationStatus.ReadyForPinSelect) {\n return false;\n }\n // TODO: Implement predicate from status?\n return true;\n}\n","import { Headline } from '@n2-common/ui';\nimport { joinNames } from '@n2-common/ui/helpers';\nimport { SubmitProgressBox } from '@n2-common/ui/SubmitProgress';\nimport { useEffect, useLayoutEffect, useRef } from 'react';\nimport styles from './index.module.scss';\nimport { useSetPinPageLoaderData } from './loader';\nimport { useTranslation } from 'react-i18next';\nimport { useApplicationIdContext } from '@n2-common/components/ApplicationContext';\nimport { trackSectionView } from '@n2-common/lib/gtm';\nexport * from './loader';\n\nexport default function SetPinPage() {\n const { Url: url } = useSetPinPageLoaderData();\n const { t } = useTranslation('cc');\n const { country } = useApplicationIdContext();\n \n const iframeRef = useRef(null);\n useLayoutEffect(() => {\n document.title = t('setPin.title');\n }, [t]);\n\n useEffect(() => {\n trackSectionView('CC', country, '5.0', 'Set Pin');\n }, [country]);\n \n useEffect(() => {\n const iframe = iframeRef.current;\n if (!iframe || !url) {\n return;\n }\n const onIframeLoad = getOnIframeLoad(iframe);\n iframe.addEventListener('load', onIframeLoad, true);\n return () => iframe.removeEventListener('load', onIframeLoad);\n }, [url]);\n return (\n <>\n {t('setPin.headline')}\n {!url && ('setPin.processing')} />}\n {url && }\n \n );\n}\n\nfunction getOnIframeLoad(iframe: HTMLIFrameElement) {\n iframe.className = joinNames(styles.iframe, styles.loading) || '';\n return function onIframeLoad() {\n iframe.className = joinNames(styles.iframe, styles.done) || '';\n };\n}\n","import { ApplicationPaths } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { safeRedirect } from '@n2-common/applicationPages/applicationStatusHelpers';\nimport { assertDataIsNotResponse } from '@n2-common/asserts';\nimport { getApplicationIds } from '@n2-common/components/ApplicationContext';\nimport { DocumentRequirement } from '@n2-common/components/UploadDocuments';\nimport { documentRequirementMapper } from '@n2-common/components/UploadDocuments';\nimport { createPartialContext } from '@n2-common/components/UploadDocuments/Context.O1';\nimport useRefresh from '@n2-common/lib/useRefresh';\nimport { ApplicationStatusModel } from '@n2-common/serverGeneratedTypings/applicationStatusModel';\nimport { N2Product } from '@n2-common/serverGeneratedTypings/n2Product';\nimport { getApplicationDocumentStatus, getApplicationStatus } from '@n2-common/services/legacyApplicationApiService';\nimport { logErrorToServerside } from '@n2-common/services/serverSideLogging';\nimport { useCallback, useState } from 'react';\nimport { getI18n } from 'react-i18next';\nimport { generatePath, LoaderFunctionArgs, redirect, useLoaderData } from 'react-router-dom';\n\nexport async function uploadDocumentsPageLoader({ request }: LoaderFunctionArgs) {\n const { applicationId, applicantId, country } = await getApplicationIds(request);\n\n if (applicantId === null || applicationId === null) {\n return redirect(generatePath(ApplicationPaths.error));\n }\n try {\n const applicationStatus = await getApplicationStatus(applicationId, applicantId, request.signal);\n if (!readyForUploadDocumentsPage(applicationStatus)) {\n return safeRedirect(request.url, applicationStatus, applicantId);\n }\n\n const requirements = await getDocumentStatus(applicationId, applicantId, country, request.signal);\n\n return { applicationStatus, requirements, applicantId, applicationId, country };\n } catch (err) {\n logErrorToServerside(`Error loading data for UploadDocumentsPage.`, applicationId, applicantId, err || {});\n return redirect(generatePath(ApplicationPaths.error));\n }\n}\n\nasync function getDocumentStatus(applicationId: string, applicantId: string, country: Country, signal?: AbortSignal): Promise {\n return getApplicationDocumentStatus(applicationId, applicantId, signal).then((res) => res.Documents.map(documentRequirementMapper(country)));\n}\n\nexport function useUploadDocumentsPageLoaderData() {\n const { t } = getI18n();\n\n const loaderData = useLoaderData() as Awaited>;\n assertDataIsNotResponse(loaderData);\n\n const { applicationStatus, requirements: initialRequirements, applicantId, applicationId, country } = loaderData;\n\n const [requirements, setRequirements] = useState(initialRequirements);\n const refresh = useCallback(\n (signal?: AbortSignal) => {\n getDocumentStatus(applicationId, applicantId, country, signal) //\n .then((documentStatus) => {\n setRequirements(documentStatus);\n });\n },\n [applicantId, applicationId, country]\n );\n const { refreshUntil } = useRefresh(refresh, requirements);\n\n const context = createPartialContext(country, applicationId, applicantId, refreshUntil, t);\n\n return { applicationStatus, requirements, applicantId, applicationId, country, ...context };\n}\n\nfunction readyForUploadDocumentsPage(status: ApplicationStatusModel) {\n if (status.Product != N2Product.CreditCard) {\n return false;\n }\n return true;\n}\n","import { UploadDocumentsComponent } from '@n2-common/applicationPages';\nimport { ApplicationPaths, navigateToStep } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { ButtonRowContainer, Headline, Hero, Paragraph } from '@n2-common/ui';\nimport Button, { NavigateLink } from '@n2-common/ui/Button';\nimport { useCallback } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useNavigate } from 'react-router-dom';\nimport { useUploadDocumentsPageLoaderData } from './loader';\nimport { DocumentationContext } from '@n2-common/components/UploadDocuments/Context';\nimport { DocumentRequirement } from '@n2-common/components/UploadDocuments';\nexport * from './loader';\n\nexport function UploadDocumentsPage(): JSX.Element {\n const { t } = useTranslation('common');\n const data = useUploadDocumentsPageLoaderData();\n\n const navigate = useNavigate();\n const backHandler = useCallback(() => navigateToStep(ApplicationPaths.sign, data.applicationId, navigate, data.applicantId), [data, navigate]);\n\n return (\n \n ('Navigation.Back')} `} onClick={backHandler} />\n \n {t('Sign.Documents.Headline')}\n {t('Sign.Documents.SubHeadline')}\n \n \n \n \n \n \n );\n}\nfunction allDocumentsAreDone(documentStatus: DocumentRequirement[]): boolean {\n return documentStatus.every((doc) => doc.uploadedDocuments.length > 0);\n}\n","import { assertDataIsNotResponse } from '@n2-common/asserts';\nimport { N2ApplicationStatus } from '@n2-common/serverGeneratedTypings/n2ApplicationStatus';\nimport { useLoaderData } from 'react-router-dom';\nimport { type TFunction } from 'i18next';\nimport { getI18n } from 'react-i18next';\n\ntype StatusPageStatus = N2ApplicationStatus | 'SignCompleted' | 'SetPinCompleted';\n\nexport function getLandingPageLoader(status: StatusPageStatus) {\n return async function StatusPageLoader() {\n const i18n = getI18n();\n if (!i18n.isInitialized) {\n const t = await new Promise((resolve) => {\n i18n.on('initialized', () => resolve(i18n.getFixedT(null, 'cc', 'landingPages')));\n });\n return getStatusPageData(status, t);\n }\n return getStatusPageData(status, i18n.getFixedT(null, 'cc', 'landingPages'));\n };\n}\n\ntype StatusPageData = {\n heading: string;\n subheading: string;\n body?: string;\n linkText?: string;\n};\nexport function useStatusPageLoaderData() {\n const data = useLoaderData() as Awaited;\n assertDataIsNotResponse(data);\n return data;\n}\nexport function getStatusPageData(status: StatusPageStatus, t: TFunction): StatusPageData {\n return {\n heading: t(`${status}.Headline`, status),\n subheading: t(`${status}.SubHeadline`, ''),\n body: t(`${status}.Body`, ''),\n linkText: t(`${status}.LinkText`, ''),\n };\n}\n","import React from 'react';\nimport style from './style.module.scss';\nimport { ExternalLink, Headline, HtmlContainer, Section } from '@n2-common/ui';\nimport { useStatusPageLoaderData } from './loader';\n\nexport * from './loader';\n\ntype StatusPageProps = { linkKey?: Parameters[0]['linkKey'] };\nexport default function StatusPage({ linkKey }: StatusPageProps) {\n const data = useStatusPageLoaderData();\n return ;\n}\n\nexport function StatusPageComponent({ heading, subheading, body, linkKey, linkText }: ReturnType & StatusPageProps) {\n return (\n
\n {heading && {heading}}\n {subheading && {subheading}}\n {body && }\n {linkKey && linkText && (\n
\n \n {linkText}\n \n
\n )}\n
\n );\n}\n","import {ApplicationPaths, navigateToStep} from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport {useNavigate} from 'react-router-dom';\nimport {useEffect} from 'react';\nimport {pollForExpectedSignState} from '@n2-common/services/legacyApplicationApiService';\nimport {trackEcommerceEvent} from '@n2-common/lib/gtm';\nimport {useApplicationIdContext} from '@n2-common/components/ApplicationContext';\nimport {StatusPageComponent, getStatusPageData} from '../Status';\nimport {useTranslation} from 'react-i18next';\nimport {useApplicationSignContext} from \"@n2-common/components/Sign/SignCommon\";\n\nexport function SignCompletedPage() {\n const {applicantId, applicationId, country, productType} = useApplicationIdContext();\n const navigate = useNavigate();\n const {t} = useTranslation('cc');\n const {applicationStatus} = useApplicationSignContext();\n\n useEffect(() => {\n if (applicationStatus) {\n pollForExpectedSignState(applicationId, (res) => res.MainApplicantHasSigned).then(() => {\n trackEcommerceEvent(productType, country, 'add_payment_info', applicationStatus?.OfferedAmount ?? 0, applicationStatus.Gpid?.toString(), applicationId, 'approved', applicationStatus?.HasPpi ?? undefined);\n navigateToStep(ApplicationPaths.sign, applicationId, navigate, applicantId);\n });\n }\n }, [applicationId, navigate, applicantId, country, productType, applicationStatus]);\n return (\n <>\n \n \n );\n}\n","import { useApplicationIdContext } from '@n2-common/components/ApplicationContext';\nimport { ExternalLink } from '@n2-common/ui';\nimport style from './style.module.scss';\n\nexport function CreditCardPPIInfo(): JSX.Element {\n const { country } = useApplicationIdContext();\n switch (country) {\n case 'FI':\n return (\n
\n

Lue lisää Maksuturvavakuutuksesta

\n
Morrow Bankin asiakkaana saat ilmaisen maksuturvavakuutuksen kolmen ensimmäisen kuukauden ajan.
\n

\n Vakuutuksen hinta maksuvapaa jakson jälkeen on 0,9% jäljellä olevasta jäljellä olevasta saldosta\n kuukauden lopussa. Ilmoitamme sinulle sähköpostitse ennen ilmaisen ajanjakson päättymistä ja voit\n peruuttaa vakuutuksen, milloin tahansa tuona aikana ilman lisäkustannuksia!\n

\n
Voit hakea vakuutuksen jos:
\n
    \n
  • Olet täyttänyt 20 vuotta mutta olet alle 65-vuotias.
  • \n
  • \n Olet kirjoilla Suomessa ja olet Kelan tai vastaavan norjalaisen, tanskalaisen tai ruotsalaisen laitoksen\n sairausvakuutuksen piirissä.\n
  • \n
  • \n Olet ollut vakituisessa työssä tai yrittäjänä vähintään 18 viikkotunnin\n työajalla vähintään edeltäneiden 180 päivän ajan. Koeaika voidaan laskea mukaan 180\n päivään, jos koeajalta on siirrytty keskeytyksettä vakituiseen työsuhteeseen.\n Työntekijällä tarkoitetaan vakituisessa tai määräaikaisessa työssä olevaa\n henkilöä, jonka sopimukseen perustuva työsuhteen pituus on vähintään 12 kuukautta.\n Yrittäjällä tarkoitetaan sinua, joka harjoitat yritystoimintaa ja työskentelet yrityksessä, jonka\n toimintaa verotetaan kokonaan tai osittain sinun elinkeinotoimintanasi.\n
  • \n
  • \n Olet täysin työkykyinen siten, että:\n
      \n
    • Suoritat työtehtäväsi esteittä.
    • \n
    • et ole oikeutettu korvaukseen sairauden tai tapaturman vuoksi
    • \n
    \n
  • \n
  • Et saa palkkatukea etkä tee sopeutettua työtä sairauden tai tapaturman vuoksi.
  • \n
  • \n Et ole saanut korvausta sairauden tai tapaturman vuoksi yli 30 peräkkäiseltä päivältä\n hakemuksen jättämistä edeltäneiden 360 päivän aikana.\n
  • \n
  • \n Sinulla ei tietosi mukaan ole sairautta tai vammaa eikä sinua ole kohdannut tapaturma, joka voi aiheuttaa\n sairauslomaa.\n
  • \n
  • \n Sinua ei ole irtisanottu, et ole saanut irtisanomisilmoitusta etkä ole tietoinen tulevasta irtisanomisesta tai\n irtisanomisilmoituksesta. Tietoisuuteen samaistetaan tieto, joka on ollut yleisesti saatavilla\n työpaikalla/yrityksessä tai julkisuudessa, sekä se, että sinun on ollut perusteltua olettaa\n työttömyyden riskin olevan olemassa.\n
  • \n
\n \n Lue tärkeitä tietoja vakuutuksesta ja sen rajoituksista täältä:{' '}\n \n ennakko-ostotiedot, IPID ja vakuutusehdot.\n \n \n
\n );\n case 'NO':\n return (\n
\n

Les om betalingsforsikringen vår:

\n
Som kunde i Morrow Bank får du tegne en betalingsforsikring som er kostnadsfri i opptil to måneder.
\n

\n Forsikringen vil, fra den kostnadsfrie perioden utløper, koste 0,9% av saldo ved hver månedsslutt. Vi vil varsle deg på e-post\n før den kostnadsfrie perioden utløper og du står fritt til å si den opp uten ekstra kostnad i perioden.\n

\n
For å være dekket av Betalingsforsikringen, må du oppfylle alle kriteriene under:
\n
    \n
  • \n er fylt 20 år men ikke fylt 66 år, og er bosatt i Norge og registrert i Folkeregisteret, og er medlem av norsk folketrygd\n eller tilsvarende svensk eller dansk instans,\n
  • \n
  • er ikke kjent med forestående arbeidsledighet/permittering,
  • \n
  • \n kan utføre ditt vanlige arbeid uten innskrenkninger og ikke har vært sykemeldt i mer enn 30 dager sammenhengende i løpet\n av de siste 360 dagene,\n
  • \n
  • \n ikke er kjent med eksisterende sykdom/skade. Er heller ikke kjent med sykdom,symptomer eller tegn som direkte eller\n indirekte kan føre til kritisk sykdom eller dødsfall, og er ansatt eller selvstendig næringsdrivende, og jobber minst 16\n timer i uken, i minst seks sammenhengende måneder hos arbeidsgiver/i næringsvirksomhet umiddelbart forut for inntreden i\n forsikringsavtalen. Med ansatt menes fast ansatt eller midlertidig ansatt med en avtalt kontraktsperiode på minst 12\n måneder. Med selvstendig næringsdrivende menes en som for egen regning og risiko driver en vedvarende virksomhet som er\n egnet til å gi nettoinntekt.\n
  • \n
\n \n For viktig informasjon om forsikringen og begrensninger, les{' '}\n \n forkjøpsinformasjonen, IPID og vilkår.\n \n \n
\n );\n default:\n return <>;\n }\n}\n","import { useTranslation } from 'react-i18next';\nimport { useApplicationIdContext } from '@n2-common/components/ApplicationContext';\nimport {Headline, HtmlContainer, Paragraph} from \"@n2-common/ui\";\ntype ErrorPageProps = { headline?: string; subheadline?: string; body?: string };\nconst ErrorPage = (props: ErrorPageProps): JSX.Element => {\n const { applicationId } = useApplicationIdContext(false, false);\n const { t } = useTranslation('cc');\n const {\n headline = t('landingPages.Error.Headline'),\n subheadline = t('landingPages.Error.SubHeadline'),\n body = t('landingPages.Error.Body', ''),\n } = props;\n return (\n <>\n {headline}\n {subheadline}\n {body && }\n \n \n );\n};\n\nfunction ReloadLink({ applicationId }: { applicationId?: string }) {\n const { t } = useTranslation('common');\n const onClick = () => {\n location.replace(`${location.pathname}?applicationId?${applicationId}`);\n };\n\n return applicationId ? (\n \n
\n
\n \n {'< '} {t('Navigation.Back')}\n \n
\n ) : null;\n}\n\nexport default ErrorPage;\n","import { PageLayout } from '@n2-common/applicationPages/AppBase/AppBase';\nimport { ApplicationPaths, navigateToStep } from '@n2-common/applicationPages/ApplicationFormsHelpers';\nimport { ReactRouterErrorBoundary } from '@n2-common/applicationPages/ReactRouterErrorBoundary';\nimport { createHashRouter, NavigateFunction, RouterProvider, type Location } from 'react-router-dom';\nimport WizardApp, { wizardAppLoader } from '../pages/Application';\nimport { CddPage, InsurancePage, SblCompleted } from '@n2-common/applicationPages/';\nimport { applicationLoader, commonNavigateToCorrectStepForSingleApplicantProducts } from '@n2-common/applicationPages/applicationStatusHelpers';\nimport { ApplicationStatusModel } from '@n2-common/serverGeneratedTypings/applicationStatusModel';\nimport { N2Product } from '@n2-common/serverGeneratedTypings/n2Product';\nimport { Offer, offerPageLoader } from '../pages/Offer';\nimport { SignaturePage, signPageLoader } from '../pages/Sign';\nimport SetPinPage, { setPinPageLoader } from '../pages/SetPin';\nimport { UploadDocumentsPage, uploadDocumentsPageLoader } from '../pages/UploadDocuments';\nimport { Suspense, useMemo } from 'react';\nimport { SignCompletedPage } from '../pages/SignCompleted';\nimport { Spinner } from '@n2-common/ui';\nimport StatusPage, { getLandingPageLoader } from '../pages/Status';\nimport { N2ApplicationStatus } from '@n2-common/serverGeneratedTypings/n2ApplicationStatus';\nimport { afterCddFuncForPpiProducts } from '@n2-common/applicationPages/CddPage';\nimport { CreditCardPPIInfo } from './Insurance';\nimport { logErrorToServerside } from '@n2-common/services/serverSideLogging';\nimport { AreYouSureYouDoNotWantPpiBox } from '@n2-common/applicationPages/InsurancePage';\nimport { useBackendContext } from '@n2-common/components/BackendContext';\nimport { getLinkKey } from '@n2-common/applicationPages/DeclinedWithLink';\nimport ErrorPage from \"../pages/ErrorPage\";\n\ntype Router = Parameters[0]['router'];\ntype AppProps = { antiforgeryToken: string | undefined };\n\nexport const navigateToCorrectStep = (application: ApplicationStatusModel, applicantId: string, navigate: NavigateFunction) => {\n if (application.Product !== N2Product.CreditCard) {\n logErrorToServerside('product is not creditcard, navigating to notfound', application.ApplicationId, applicantId, application);\n navigateToStep(ApplicationPaths.notFound, application.ApplicationId, navigate, applicantId);\n return;\n }\n return commonNavigateToCorrectStepForSingleApplicantProducts(application, applicantId, navigate);\n};\n\nexport const App = ({ antiforgeryToken }: AppProps) => {\n const { country } = useBackendContext();\n const ccRouter: Router = useMemo(\n () =>\n createHashRouter([\n {\n element: ,\n children: [\n {\n path: ApplicationPaths.loadApplication,\n loader: applicationLoader,\n },\n {\n path: ApplicationPaths.wizard,\n loader: wizardAppLoader,\n element: ,\n },\n {\n path: ApplicationPaths.cdd,\n element: (\n \n ),\n },\n {\n path: ApplicationPaths.offer,\n loader: offerPageLoader,\n element: ,\n },\n {\n path: ApplicationPaths.insurance,\n element: (\n }\n >\n \n \n ),\n },\n {\n path: ApplicationPaths.sign,\n loader: signPageLoader,\n element: ,\n },\n {\n path: ApplicationPaths.signCompleted,\n element: ,\n },\n {\n path: ApplicationPaths.sblCompleted,\n element: ,\n },\n {\n path: ApplicationPaths.applicantActionsCompleted,\n loader: getLandingPageLoader(\"ApplicantActionsCompleted\" as N2ApplicationStatus),\n element: ,\n },\n {\n path: ApplicationPaths.uploadDocuments,\n loader: uploadDocumentsPageLoader,\n element: ,\n },\n {\n path: ApplicationPaths.declined,\n loader: getLandingPageLoader(N2ApplicationStatus.Declined),\n element: ,\n },\n {\n path: ApplicationPaths.declinedFromAgent,\n loader: getLandingPageLoader(N2ApplicationStatus.Declined),\n element: ,\n },\n {\n path: ApplicationPaths.canceled,\n loader: getLandingPageLoader(N2ApplicationStatus.Cancelled),\n element: ,\n },\n {\n path: ApplicationPaths.completed,\n loader: getLandingPageLoader(N2ApplicationStatus.Completed),\n element: ,\n },\n {\n path: ApplicationPaths.notFound,\n loader: getLandingPageLoader(N2ApplicationStatus.NotFound),\n element: ,\n },\n {\n path: ApplicationPaths.setPinError,\n element: ,\n },\n {\n path: ApplicationPaths.error,\n element: ,\n },\n {\n path: ApplicationPaths.setPin,\n loader: setPinPageLoader,\n element: ,\n },\n {\n path: ApplicationPaths.setPinCompleted,\n loader: getLandingPageLoader('SetPinCompleted'),\n element: ,\n },\n {\n path: ApplicationPaths.inProgress,\n loader: getLandingPageLoader(N2ApplicationStatus.InProgress),\n element: ,\n },\n ],\n errorElement: ,\n },\n ]),\n [antiforgeryToken, country]\n );\n\n return (\n }>\n \n \n );\n};\n\nfunction showProgressBar(location: Location) {\n return ![\n ApplicationPaths.wizard, //\n ApplicationPaths.declined,\n ApplicationPaths.canceled,\n ].includes(location.pathname as ApplicationPaths);\n}\n","import './i18n';\n\nimport CookieConsent from '@n2-common/components/CookieConsent';\nimport React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nimport { App } from './components/App';\nimport { BackendContextProvider } from '@n2-common/components/BackendContext';\nimport { O2 } from '@n2-common/services/o2Service';\n\nconst rootEl = document.getElementById('root');\nif (!rootEl) {\n throw new Error(\"Missing root element with id='root' in DOM\");\n}\nconst country = rootEl.dataset.country as Country;\nconst provider = (rootEl.dataset.provider || 'O1') as Backend;\n\nconst applicationType = `${country}-CC` as O2.ApplicationType;\nrootEl.dataset.product = applicationType;\n\nReactDOM.createRoot(rootEl as HTMLElement).render(\n \n \n \n \n \n \n);\n"],"names":["runtime","getRuntime","i18next","initReactI18next","HttpApi","DocumentLanguageDetector","cleanup","values","m","key","value","specifyAccommodationTypeOther","accommodationType","specifyAccomodationCost","applicantHasSharedEconomy","martialStatus","resolveStages","t","provider","FinnishSsnInput","getNationalIdValidation","EmailInput","emailRequired","FinnishMobilePhoneNumberInput","mobileRequired","Yup.string","props","jsx","FormikSelect","addPleaseSelectOption","martialStatusValues","FormikInput","amount","employmentStatusCodeFi","accommodationStatusCodesFi","addComparrisonValidation","val","other","Yup.number","AmountInput","getMortageField","FormikInputGroup","amountNotEmpty","getStudentLoanField","getConsentFieldDef","cleanupFi","cleaned","Applicant","initialValues","config","emptyApplicant","nationalId.norwegianNationalId","NationalIdInput","norwegianPhoneNumber","PhoneNumberInput","stringRequired","React","accommodationStatusCodesNo","employmentStatusCodeNo","amountNotNull","addTest","cleanupNo","context","country","input","model","postLoanApplication","status","pollForExpectedApplicationState","res","N2ApplicationStatus","applicantIdModel","getApplicatId","result","navigate","navigateToStep","ApplicationPaths","navigateToCorrectStep","CreditCardApplicationContextProvider","children","CreditCardApplicationContext","application","getTracking","applicationId","o2ApiService","state","pollForApplicationState","getOutcome","redirect","OutcomeValues","createContext","useCreditCardApplicationContext","useContext","wizardAppLoader","request","applicantId","getApplicationIds","applicationStatus","getApplicationStatus","safeRedirect","err","logErrorToServerside","generatePath","WizardApp","useBackendContext","O1CreditCardApplicationContextProvider","WizardAppComponent","O2CreditCardApplicationContextProvider","useNavigate","isSubmitting","setIsSubmitting","useState","productType","useApplicationIdContext","formName","useTranslation","postCreditCardApplication","gpid","setGpid","useLayoutEffect","useEffect","trackCoreBankEvent","trackEcommerceEvent","useMemo","configFI","configNO","stages","onSsnStepFinished","useCallback","cleanedValues","submitSsnToGetGpid","submit","onProgress","startTransition","shouldBeTracked","outcomeToECommerceStatus","action","errorToAction","jsxs","Fragment","Headline","MultiStageOnePageWizard","offerPageLoader","readyForOffer","useOfferPageLoaderData","data","useLoaderData","assertDataIsNotResponse","N2Product","Offer","handleNext","trackSectionView","OfferBox","getCurrencyCode","HtmlContainer","ButtonRowContainer","Button","getActions","documentStatus","applicationSignStatus","actions","getSignatureState","formatWithCurrencyNoDecimals","getDocumentationState","signStatus","doc","signPageLoader","readyForSignPage","getApplicationDocumentStatus","getApplicationSignStatus","useSignPageLoaderData","SignaturePage","O1DocumentationContextProvider","SignatureComponent","requirements","useDocumentationContext","showComplete","a","processing","setProcessing","setErrorMessage","ErrorOutput","useDismissableErrorMessage","dispatch","getDispatcher","_a","logInfoToServerSide","CmsNotification","Hero","Paragraph","ActionList","SubmitProgressBox","setProgress","setAction","actionType","startCreditCardSigning","setRandomPin","setPinPageLoader","readySetPinPage","setPinResponse","getSetPinUrl","useSetPinPageLoaderData","SetPinPage","url","iframeRef","useRef","iframe","onIframeLoad","getOnIframeLoad","styles","joinNames","uploadDocumentsPageLoader","readyForUploadDocumentsPage","getDocumentStatus","signal","documentRequirementMapper","useUploadDocumentsPageLoaderData","getI18n","loaderData","initialRequirements","setRequirements","refresh","refreshUntil","useRefresh","createPartialContext","UploadDocumentsPage","backHandler","DocumentationContext","NavigateLink","UploadDocumentsComponent","allDocumentsAreDone","getLandingPageLoader","i18n","resolve","getStatusPageData","useStatusPageLoaderData","StatusPage","linkKey","StatusPageComponent","heading","subheading","body","linkText","style","Section","ExternalLink","SignCompletedPage","useApplicationSignContext","pollForExpectedSignState","CreditCardPPIInfo","ErrorPage","headline","subheadline","ReloadLink","onClick","commonNavigateToCorrectStepForSingleApplicantProducts","App","antiforgeryToken","ccRouter","createHashRouter","PageLayout","showProgressBar","applicationLoader","CddPage","afterCddFuncForPpiProducts","InsurancePage","AreYouSureYouDoNotWantPpiBox","SblCompleted","ReactRouterErrorBoundary","Suspense","Spinner","RouterProvider","location","rootEl","applicationType","ReactDOM","CookieConsent","BackendContextProvider"],"mappings":"oqDAMA,MAAMA,GAAUC,GAAW,EAE3BC,GACK,IAAIC,EAAgB,EACpB,IAAIC,EAAO,EACX,IAAIC,EAAwB,EAC5B,KAAK,CACF,cAAe,CAAE,YAAa,EAAM,EACpC,MAAO,GACP,GAAI,CAAC,KAAM,SAAU,YAAY,EACjC,QAAS,CACL,SAAU,8CAAyEL,GAAQ,KAAK,EACpG,EACA,YAAa,GACb,KAAM,eACN,MAAO,CACH,YAAa,EACjB,CACJ,CAAC,ECZE,SAASM,GAAkCC,EAAqC,CAC5E,MAAA,CACH,UAAW,OAAO,QAAQA,EAAO,SAAS,EAAE,OACxC,CAACC,EAAG,CAACC,EAAKC,CAAK,KAAO,CAAE,GAAGF,EAAG,CAACC,CAAG,EAAGC,GAAS,KAAOA,EAAM,WAAa,IAAK,GAC7E,CAAC,CACL,EACA,YAAa,cACb,SAAU,OAAO,QAAQH,EAAO,QAAQ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