@adyen/kyc-components 3.81.0 → 3.82.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcceptTermsOfServiceComponent-PDXa81vb.js → AcceptTermsOfServiceComponent-Do0w4uTc.js} +36 -10
- package/dist/{AccountSetupRejected-Du83gH0_.js → AccountSetupRejected-C7bZBsjo.js} +6 -4
- package/dist/Address-CX1FM8LF.js +1076 -0
- package/dist/Alert-DCYc9VpX.js +231 -0
- package/dist/{Avatar-Cd_8eqbA.js → Avatar-BaxjEBNy.js} +2 -2
- package/dist/BusinessDetailsDropin-yG7M7i9-.js +5088 -0
- package/dist/BusinessFinancingComponent-CZZcn51m.js +45 -0
- package/dist/{BusinessFinancingDropin-DioEfiqH.js → BusinessFinancingDropin-EfA32nOP.js} +43 -20
- package/dist/BusinessFinancingPage-Bb1dPIJF.js +40 -0
- package/dist/{BusinessTypeSelectionPage-uk6eDO5O.js → BusinessTypeSelectionPage-CjEomufR.js} +9 -5
- package/dist/Card-DsB6bxW-.js +145 -0
- package/dist/Confirm-X9nR52Md.js +64 -0
- package/dist/{ContractViewer-B2LwC3wV.js → ContractViewer-Byp71k2e.js} +33 -38
- package/dist/CountryField-DxBBjy81.js +864 -0
- package/dist/CreateIndividualComponent-Dyn173AJ.js +72 -0
- package/dist/CreateTransferInstrumentComponent-BT78AU6Z.js +67 -0
- package/dist/Currency-wsIZH1_j.js +238 -0
- package/dist/{CustomerSupport-C4n96PMt.js → CustomerSupport-B7VbKM8X.js} +10 -6
- package/dist/{DebugModal-CYO8HZDV.js → DebugModal-CZwhc_eY.js} +8 -5
- package/dist/{DecisionMakerDetailsPage-IT7x1ZRJ.js → DecisionMakerDetailsPage-Y7E2RfUW.js} +11 -4
- package/dist/{DecisionMakers-DkXmcSK4.js → DecisionMakers-DNepilyq.js} +224 -96
- package/dist/Dropzone-nt4AXJ-H.js +218 -0
- package/dist/{EmbeddedStatus-BS-fmZSm.js → EmbeddedStatus-D0gkDJMZ.js} +4 -4
- package/dist/{EndStateLayout-qrS2Eh-G.js → EndStateLayout-C2whNAgv.js} +2 -2
- package/dist/{FormFlow-BjHYz5-l.js → FormFlow-CRhuooj2.js} +8 -2
- package/dist/FormNavigation-BdFqTFAy.js +162 -0
- package/dist/{IndividualOnfidoDropin-B-y2VRFi.js → IndividualOnfidoDropin-BWM9aKLs.js} +2796 -64
- package/dist/InputDate-DydMc18N.js +43 -0
- package/dist/InputGroup-WBfGDV5F.js +32 -0
- package/dist/InputText-BCNFl9Ni.js +161 -0
- package/dist/{Introduction-CVSG_NSh.js → Introduction-1ZBVqCrd.js} +58 -4
- package/dist/LegalRepresentativeDetailsPage-B2yyvDKF.js +61 -0
- package/dist/Link-BGc9wGrL.js +35 -0
- package/dist/ManageIndividualComponent-CFvL5A-c.js +47 -0
- package/dist/ManageTermsOfServiceComponent-DTrzRxr1.js +47 -0
- package/dist/{ManageTransferInstrumentComponent-Byi222QQ.js → ManageTransferInstrumentComponent-B2cBS1y1.js} +25 -4
- package/dist/MaskedInput-DOTRZoSO.js +799 -0
- package/dist/MaybeModal-SjCkh5yq.js +25 -0
- package/dist/Modal-t5jbmZJu.js +136 -0
- package/dist/{OnboardingDropinComponent-CDK7PYx0.js → OnboardingDropinComponent-DegbZ_o6.js} +200 -41
- package/dist/PayoutDetailsDropin-58zkMbID.js +3694 -0
- package/dist/RadioGroup-Dkwl1v8z.js +143 -0
- package/dist/RegistrationAddress-DOqLUQEe.js +2334 -0
- package/dist/{Review-BCxsmMlz.js → Review-8WTYj81b.js} +8 -4
- package/dist/{RootBusinessDetailsPage-CIWtTZ1z.js → RootBusinessDetailsPage-FDWyaMpG.js} +65 -44
- package/dist/RootIndividualDetailsPage-SFgbb5Bk.js +77 -0
- package/dist/{SignPCIComponent-DzKFISwc.js → SignPCIComponent-bl7LzPjE.js} +17 -8
- package/dist/{SingpassSelection-ChRvdPZF.js → SingpassSelection-DukeaL-T.js} +6 -6
- package/dist/SoleProprietorshipPage-C-XJc7Iq.js +50 -0
- package/dist/{SourceOfFundsPage-DuUOdcam.js → SourceOfFundsPage-D-xLHf2C.js} +46 -24
- package/dist/Spacer-BK3jDget.js +18 -0
- package/dist/StepProgressIndicator-DHei86A6.js +78 -0
- package/dist/StoreProvider-B6-mwoeD.js +7072 -0
- package/dist/StructuredList-DaepaiVE.js +38 -0
- package/dist/{TaskItemStatus-DDwHsmh8.js → TaskItemStatus-BxzVEGbJ.js} +4 -3
- package/dist/{TaskStatusIndicator-Bmm2PsCZ.js → TaskStatusIndicator-Dfp2GcbN.js} +2 -2
- package/dist/TaxInformationField-r8gB7YBi.js +3062 -0
- package/dist/{TaxReportingDropin-kPcT1Kxt.js → TaxReportingDropin-5Lp9F8Ab.js} +25 -9
- package/dist/{TileGroup-BC8PSahf.js → TileGroup-jIldfSJ7.js} +4 -2
- package/dist/{TrustDetailsPage-lnVmcLSH.js → TrustDetailsPage-CjCSvds-.js} +506 -19
- package/dist/TrustMemberCompanyPage-Z6YT-R_a.js +60 -0
- package/dist/TrustMemberIndividualPage-qDN9m9Dv.js +66 -0
- package/dist/UnincorporatedPartnershipIndividualPage-iRZOCq2z.js +66 -0
- package/dist/UnincorporatedPartnershipMemberCompanyPage-9FlDLivA.js +64 -0
- package/dist/{ViewVerificationStatusComponent-D2V-RY2M.js → ViewVerificationStatusComponent-7D-3OVVA.js} +4 -3
- package/dist/adyen-business-financing.js +33 -22
- package/dist/adyen-individual.js +36 -27
- package/dist/adyen-kyc-components.js +28 -15
- package/dist/adyen-manage-individual.js +25 -26
- package/dist/adyen-manage-terms-of-service.js +26 -27
- package/dist/adyen-manage-transfer-instruments.js +40 -42
- package/dist/adyen-onboarding.js +3 -3
- package/dist/adyen-terms-of-service.js +41 -38
- package/dist/adyen-transfer-instrument.js +38 -29
- package/dist/adyen-verification-status.js +44 -36
- package/dist/analytics-CYiivYhI.js +61 -0
- package/dist/{bafinUtils-T6TnU7m4.js → bafinUtils-DSQnsLeT.js} +164 -10
- package/dist/basePatterns-BwdnMQxI.js +15 -0
- package/dist/bg-BG-CW9c658c.js +13 -0
- package/dist/bg-BG-CZ8v3rdy.js +30 -0
- package/dist/{bg-BG-Dlzl9Szn.js → bg-BG-D5192UVe.js} +1 -2
- package/dist/{bg-BG-NMIts2sa.js → bg-BG-QC5irNEG.js} +2 -4
- package/dist/commonValidators-CwkyFFVz.js +24 -0
- package/dist/{cs-CZ-BkyFDlAU.js → cs-CZ-DOqH0WeT.js} +1 -2
- package/dist/cs-CZ-Dx6momCa.js +30 -0
- package/dist/cs-CZ-dU9fnQ1g.js +13 -0
- package/dist/{cs-CZ-Csr_35T-.js → cs-CZ-t297LwYw.js} +2 -4
- package/dist/currency-BGwQyxBo.js +36 -0
- package/dist/{da-DK-B5KNtXL8.js → da-DK-B45X2VaJ.js} +1 -2
- package/dist/da-DK-BJ7aTPir.js +13 -0
- package/dist/{da-DK-Dm8o1giq.js → da-DK-BoQic3Gy.js} +2 -4
- package/dist/da-DK-D4H69PX3.js +30 -0
- package/dist/de-DE-C78RLE2G.js +13 -0
- package/dist/{de-DE-BA9tcpNQ.js → de-DE-CWvgMDqU.js} +1 -2
- package/dist/{de-DE-DMFaycio.js → de-DE-Dwagawx1.js} +2 -4
- package/dist/de-DE-wp5-H-ov.js +30 -0
- package/dist/dropinUtils-CkJv8r-0.js +192 -0
- package/dist/el-GR-BZRKurtr.js +13 -0
- package/dist/{el-GR-DIhHT2q_.js → el-GR-C3rkK_oc.js} +1 -2
- package/dist/el-GR-CK2heqPJ.js +30 -0
- package/dist/{el-GR-CGeBAkDN.js → el-GR-CxwhV-TX.js} +2 -4
- package/dist/emitEvent-CzZf80Am.js +28 -0
- package/dist/{en-US-DX4NHkX-.js → en-US-BbAzROHT.js} +2 -4
- package/dist/{en-US-TrwIHFh-.js → en-US-CAm3meB1.js} +1 -2
- package/dist/{en-US-SbE0c1gn.js → en-US-DIdQJky-.js} +1 -2
- package/dist/en-US.instructions-Ddr7AO05.js +22 -0
- package/dist/{es-ES-pXHx3ODy.js → es-ES-Bsoco8Fj.js} +2 -4
- package/dist/es-ES-BtUSEzkE.js +13 -0
- package/dist/{es-ES-RXwbiHjS.js → es-ES-DKCCgVF8.js} +1 -2
- package/dist/es-ES-Ds3-DtqZ.js +30 -0
- package/dist/et-EE-BCnK305R.js +13 -0
- package/dist/{et-EE-ZssIqWkO.js → et-EE-Bc6ioJRG.js} +1 -2
- package/dist/et-EE-Co-8akjV.js +30 -0
- package/dist/{et-EE-QLVnr6Vl.js → et-EE-DdGlUpaQ.js} +2 -4
- package/dist/{fi-FI-DT351N-G.js → fi-FI-ClnsYt3L.js} +2 -4
- package/dist/fi-FI-Cvar63RH.js +13 -0
- package/dist/fi-FI-DPNeTsJS.js +30 -0
- package/dist/{fi-FI-DmiggQEL.js → fi-FI-Hhku9Lmc.js} +1 -2
- package/dist/fieldConfigurations-CzZ2B1fa.js +458 -0
- package/dist/form-rules-DhbF2mY4.js +13 -0
- package/dist/fr-FR-B5543Fe-.js +13 -0
- package/dist/{fr-FR-N5wYE2BZ.js → fr-FR-BYuKsZIb.js} +1 -2
- package/dist/{fr-FR-BNXXNUX_.js → fr-FR-CJI0bIig.js} +2 -4
- package/dist/fr-FR-ChmNQciP.js +30 -0
- package/dist/getName-BkvLQ7My.js +41 -0
- package/dist/{hasDataChanged-e2EDb7Ni.js → hasDataChanged-B7dryhBQ.js} +2 -2
- package/dist/{hr-HR-B8AZ4eHJ.js → hr-HR-C0yWizOX.js} +2 -4
- package/dist/{hr-HR-5iwKtfgh.js → hr-HR-CPO5Yw2B.js} +1 -2
- package/dist/hr-HR-DqC8Cgs6.js +30 -0
- package/dist/hr-HR-ZreFlbK9.js +13 -0
- package/dist/hu-HU-B3BihdGh.js +13 -0
- package/dist/hu-HU-BOanVlKb.js +30 -0
- package/dist/{hu-HU-Aq1LsWah.js → hu-HU-mo_0ULJG.js} +1 -2
- package/dist/{hu-HU-DRi6Dz9U.js → hu-HU-wnSie9tz.js} +2 -4
- package/dist/iframeWidget-BfmN5KKM.js +234 -0
- package/dist/{payout-verification-instant-BIcnFP-p.js → instant-verification-Dvvkyfmp.js} +3 -3
- package/dist/isEmpty-CJ2g18ZH.js +23 -0
- package/dist/{it-IT-BeYbInCQ.js → it-IT-BeC2Y1F8.js} +2 -4
- package/dist/it-IT-Dd6xGSe-.js +13 -0
- package/dist/{it-IT-8DEagvb2.js → it-IT-Nl57jui-.js} +1 -2
- package/dist/it-IT-eCrTB65E.js +30 -0
- package/dist/ja-JP-BJljbFIZ.js +30 -0
- package/dist/{ja-JP-BhS-_dIx.js → ja-JP-CbgaW99b.js} +2 -2
- package/dist/{ja-JP-BGAJQs1g.js → ja-JP-D3oQAH7z.js} +1 -2
- package/dist/{ja-JP-C1OQ16fo.js → ja-JP-YoU7mNrK.js} +2 -4
- package/dist/ja-JP-iTbqSPNL.js +13 -0
- package/dist/keys-BpNgnAsD.js +23 -0
- package/dist/{localizeDateString-VqxvPF9j.js → localizeDateString-C4IzMd3y.js} +2 -2
- package/dist/{lt-LT-HZOWQKZT.js → lt-LT-CVasDmF3.js} +1 -2
- package/dist/lt-LT-DE-4IXNG.js +13 -0
- package/dist/{lt-LT-_MzAcXJo.js → lt-LT-DIe4cKlu.js} +2 -4
- package/dist/lt-LT-DckQGgoT.js +30 -0
- package/dist/lv-LV-CeivEZms.js +13 -0
- package/dist/lv-LV-DP9oRTFv.js +30 -0
- package/dist/{lv-LV-CRhXAjn6.js → lv-LV-DXgW5zWl.js} +2 -4
- package/dist/{lv-LV-F-Z4lDCV.js → lv-LV-Sbsv8-nD.js} +1 -2
- package/dist/{payout-verification-manual-DH9-DdlZ.js → manual-verification-BvZWqA00.js} +3 -3
- package/dist/mapExistingFile-D8NcT-or.js +231 -0
- package/dist/mapScriptLocalization-DBcq31SQ.js +72 -0
- package/dist/mapTransferInstrumentToPayoutAccount-CijqOJMZ.js +30 -0
- package/dist/{nl-NL-C-xUU2N3.js → nl-NL-BHkRnVrj.js} +1 -2
- package/dist/{nl-NL-Dbx0ZmI7.js → nl-NL-Cysslsh2.js} +2 -4
- package/dist/nl-NL-D2QKudfh.js +30 -0
- package/dist/nl-NL-DVENFpd5.js +13 -0
- package/dist/no-NO-C_snYWBc.js +30 -0
- package/dist/no-NO-Dn2UkdoI.js +13 -0
- package/dist/{no-NO-47ncaBZY.js → no-NO-kaAdT9B8.js} +1 -2
- package/dist/{no-NO-C0sfkp82.js → no-NO-zSnPtrDi.js} +2 -4
- package/dist/pl-PL-CQ6c2Qz_.js +30 -0
- package/dist/{pl-PL-CZLzkboH.js → pl-PL-DD8JN4Qf.js} +1 -2
- package/dist/pl-PL-DFAzuceF.js +13 -0
- package/dist/{pl-PL-DAPGaxWi.js → pl-PL-UB5J5JcB.js} +2 -4
- package/dist/pt-PT-C-hbNnsB.js +30 -0
- package/dist/{pt-PT-BY9rcwcF.js → pt-PT-CjsyP_OK.js} +2 -4
- package/dist/{pt-PT-CN4ws8N7.js → pt-PT-Xm-pm3mb.js} +1 -2
- package/dist/pt-PT-_o5xgnxS.js +13 -0
- package/dist/{resolveEnvironment-CDg6ksvB.js → resolveEnvironment-94mV6qts.js} +3 -3
- package/dist/ro-RO-BrTWk1Ui.js +30 -0
- package/dist/{ro-RO-RylOvc5g.js → ro-RO-C3m6aJVP.js} +1 -2
- package/dist/{ro-RO-DJLWmWZ4.js → ro-RO-C8yYXQc_.js} +2 -4
- package/dist/ro-RO-D7c_Rj8V.js +13 -0
- package/dist/{rules-BnJSV_NR.js → rules-D9wLpDnS.js} +5 -2
- package/dist/sk-SK-BBSuh2fA.js +13 -0
- package/dist/sk-SK-BTFtoPmI.js +30 -0
- package/dist/{sk-SK-BfJKbtGy.js → sk-SK-BVc-vNQm.js} +1 -2
- package/dist/{sk-SK-B7o3L57C.js → sk-SK-DbOE9C6n.js} +2 -4
- package/dist/sl-SI-BLTuWNf5.js +13 -0
- package/dist/sl-SI-BhVTSmhQ.js +30 -0
- package/dist/{sl-SI-C8CMAkD0.js → sl-SI-Br0UEUPL.js} +2 -4
- package/dist/{sl-SI-DklUFzaY.js → sl-SI-D_rqR0D7.js} +1 -2
- package/dist/style.css +3272 -3254
- package/dist/styles-CLV89_hH.js +3272 -3254
- package/dist/sv-SE-66rqYTxi.js +30 -0
- package/dist/{sv-SE-qduyDIzY.js → sv-SE-B3zoXMuH.js} +1 -2
- package/dist/sv-SE-BUfESAQK.js +13 -0
- package/dist/{sv-SE-Bwh0wKFk.js → sv-SE-BtXmvxx4.js} +2 -4
- package/dist/translation-BxcrjuWb.js +472 -0
- package/dist/types/api/industryCodes/industryCodes.types.d.ts +2 -0
- package/dist/types/api/industryCodes/useIndustryCodes.d.ts +6 -0
- package/dist/types/api/queryKeys.d.ts +2 -1
- package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +1 -0
- package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +3 -3
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +0 -9
- package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +0 -1
- package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +6 -0
- package/dist/types/components/Business/forms/rules.d.ts +1 -3
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -2
- package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiform.d.ts +1 -1
- package/dist/types/components/Contract/tasks/ServiceAgreementDropin/ServiceAgreementDropin.d.ts +1 -1
- package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -0
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +0 -1
- package/dist/types/components/EmbeddedDropins/AcceptTermsOfServiceComponent/AcceptTermsOfServiceComponent.d.ts +4 -3
- package/dist/types/components/Individual/forms/Individual/Individual.d.ts +4 -0
- package/dist/types/components/Individual/forms/Individual/ProofOfRelationship/types.d.ts +0 -5
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Trust/forms/Trust/Trust.d.ts +1 -0
- package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +1 -2
- package/dist/types/components/Trust/tasks/TrustMembers/TrustMembersOverview.d.ts +2 -1
- package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberCompanyPage.d.ts +2 -1
- package/dist/types/components/ui/atoms/ActionsMenu/ActionsMenu.d.ts +2 -1
- package/dist/types/components/ui/atoms/Button/Button.types.d.ts +3 -3
- package/dist/types/components/ui/atoms/ListItem/ListItem.d.ts +2 -1
- package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +0 -14
- package/dist/types/components/ui/atoms/RadioWithLabel/RadioWithLabel.d.ts +2 -1
- package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -0
- package/dist/types/components/ui/atoms/StepProgressIndicator/StepProgressIndicator.d.ts +2 -1
- package/dist/types/components/ui/atoms/StructuredList/StructuredList.d.ts +2 -1
- package/dist/types/components/ui/atoms/Svg/svgs.d.ts +0 -12
- package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +3 -2
- package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +1 -1
- package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +2 -1
- package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +2 -1
- package/dist/types/components/ui/molecules/InputEmail/InputEmail.d.ts +2 -1
- package/dist/types/components/ui/molecules/InputGroup/InputGroup.d.ts +2 -1
- package/dist/types/components/ui/molecules/InputTelephone/InputTelephone.d.ts +2 -1
- package/dist/types/components/ui/molecules/InputText/InputText.d.ts +2 -0
- package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +0 -1
- package/dist/types/components/ui/molecules/Tabs/Tabs.d.ts +1 -1
- package/dist/types/context/StateContext/types.d.ts +1 -1
- package/dist/types/core/models/api/accountIdentification.d.ts +5 -4
- package/dist/types/core/models/api/contracts.d.ts +1 -1
- package/dist/types/core/process-field-configurations.d.ts +14 -3
- package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +1 -1
- package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +1 -5
- package/dist/types/embeds/emitEvent.d.ts +14 -0
- package/dist/types/embeds/individual/adyen-individual.types.d.ts +2 -2
- package/dist/types/embeds/manage-individual/AdyenManageIndividual.d.ts +1 -1
- package/dist/types/embeds/manage-individual/adyen-manage-individual.types.d.ts +1 -1
- package/dist/types/embeds/manage-terms-of-service/AdyenManageTermsOfService.d.ts +1 -1
- package/dist/types/embeds/manage-terms-of-service/adyen-manage-terms-of-service.types.d.ts +1 -1
- package/dist/types/embeds/manage-transfer-instruments/AdyenManageTransferInstrument.d.ts +3 -4
- package/dist/types/embeds/manage-transfer-instruments/adyen-manage-transfer-instruments.types.d.ts +3 -4
- package/dist/types/embeds/terms-of-service/adyen-terms-of-service.types.d.ts +4 -3
- package/dist/types/embeds/transfer-instrument/adyen-transfer-instrument.types.d.ts +2 -2
- package/dist/types/embeds/verification-status/adyen-verification-status.types.d.ts +3 -3
- package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +2 -1
- package/dist/types/hooks/introduction/useShouldShowIntroduction.d.ts +2 -1
- package/dist/types/language/utils.d.ts +1 -1
- package/dist/types/utils/addLinkedFields.d.ts +7 -1
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/formUtils.d.ts +1 -1
- package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -1
- package/dist/types/utils/getName.d.ts +1 -1
- package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
- package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +5 -0
- package/dist/types/utils/translation.d.ts +6 -0
- package/dist/types-CAznNNSI.js +160 -0
- package/dist/types-DAyrP-xk.js +64 -0
- package/dist/types-Da02-5C7.js +74 -0
- package/dist/useAssociatedLegalEntity-Bw8j7jsT.js +33 -0
- package/dist/useDataset-BLJa9WLi.js +120 -0
- package/dist/useForm-CiqZ15MF.js +1694 -0
- package/dist/useFormContext-beqGS11A.js +23 -0
- package/dist/useGlobalData-DRn0XQ0c.js +205 -0
- package/dist/{useMultiForm-Cbf_MGdG.js → useMultiForm-B2RH71uE.js} +4 -2
- package/dist/{useOnboardingStatus-bmHIDRGr.js → useOnboardingStatus-D1idaeSA.js} +2 -2
- package/dist/useScenarios-MJLlpy2B.js +46 -0
- package/dist/{useTermsOfServiceStatus-CMtyaC84.js → useTermsOfServiceStatus-YnguYeSj.js} +2 -2
- package/dist/useToastContext-BBdhLX_K.js +51 -0
- package/dist/useUnincorporatedPartnershipMembers-TCYzsxr-.js +99 -0
- package/dist/utils-Bw6dVL0x.js +29 -0
- package/dist/{utils-B-s8erbM.js → utils-CMkU9dq6.js} +46 -4
- package/dist/utils-DNSfZiio.js +70 -0
- package/dist/utils-Drt88lUg.js +159 -0
- package/dist/validate-BacCnDiH.js +382 -0
- package/dist/{validate-CNlNB2Sq.js → validate-BlPEAs8d.js} +2 -2
- package/dist/validate-DQ_IsigQ.js +605 -0
- package/dist/validationError-eJqGwKE_.js +86 -0
- package/package.json +44 -45
- package/dist/BusinessDetailsDropin-DR8YA-wz.js +0 -2136
- package/dist/BusinessFinancingComponent-saZxipq7.js +0 -38
- package/dist/BusinessFinancingPage-D7NMT1SV.js +0 -35
- package/dist/CreateIndividualComponent-B_6j8j5H.js +0 -64
- package/dist/CreateTransferInstrumentComponent-DgZq6f2m.js +0 -55
- package/dist/LegalRepresentativeDetailsPage-R9h6n8e1.js +0 -55
- package/dist/ManageIndividualComponent-D3EZWpKz.js +0 -42
- package/dist/ManageTermsOfServiceComponent-C2BMpyzo.js +0 -40
- package/dist/RootIndividualDetailsPage-DGpYhDWo.js +0 -71
- package/dist/SoleProprietorshipPage-CF_TKUfD.js +0 -44
- package/dist/StoreProvider-pdSV8sgb.js +0 -31920
- package/dist/TrustMemberCompanyPage-6_h3PnmT.js +0 -54
- package/dist/TrustMemberIndividualPage-DPlQ6OnQ.js +0 -60
- package/dist/UnincorporatedPartnershipIndividualPage-Bgcip8u6.js +0 -60
- package/dist/UnincorporatedPartnershipMemberCompanyPage-k5Cc0TWw.js +0 -57
- package/dist/VerificationErrorAlert-BEgXW4gA.js +0 -77
- package/dist/bg-BG-BvSUDgGF.js +0 -13
- package/dist/cs-CZ-y4mvq4Lv.js +0 -13
- package/dist/da-DK-qgQOVjDp.js +0 -13
- package/dist/de-DE-pSdsxBpQ.js +0 -13
- package/dist/el-GR-Bvjk5Sw8.js +0 -13
- package/dist/en-US-Bq2Twy6x.js +0 -54
- package/dist/es-ES-Dy1uR2H_.js +0 -13
- package/dist/et-EE-d9V24rcf.js +0 -13
- package/dist/fi-FI-B0fnAFV2.js +0 -13
- package/dist/fr-FR-BoKzVp2q.js +0 -13
- package/dist/getFieldsWithExistingData-BPKk0HGd.js +0 -22
- package/dist/hr-HR-CF0AHQzi.js +0 -13
- package/dist/hu-HU-CSPhOvLC.js +0 -13
- package/dist/it-IT-BH-eqIKH.js +0 -13
- package/dist/ja-JP-B3yqM_FM.js +0 -13
- package/dist/lt-LT-Lzl_Cbw-.js +0 -13
- package/dist/lv-LV-y00wN1pj.js +0 -13
- package/dist/mapFinancialReportsToFinancialInformation-iVvcsDNu.js +0 -66
- package/dist/mapScriptLocalization-H2Re3k5X.js +0 -35
- package/dist/nl-NL-DmnFXAQC.js +0 -13
- package/dist/no-NO-DbvFfP96.js +0 -13
- package/dist/pl-PL--mmxopYA.js +0 -13
- package/dist/pt-PT-BVzXBFp7.js +0 -13
- package/dist/ro-RO-Cdmevo9A.js +0 -13
- package/dist/ru-RU-FZb2upqh.js +0 -13
- package/dist/sk-SK-nfeuTcY5.js +0 -13
- package/dist/sl-SI-DUTZDqkP.js +0 -13
- package/dist/sv-SE-BTx2XKAp.js +0 -13
- package/dist/useUpdateLegalEntity-D91nO-DU.js +0 -57
- package/dist/validate-DhvbSKV4.js +0 -40
- package/dist/zh-CN-wUb4MmTZ.js +0 -13
- package/dist/zh-TW-DNTXHLKa.js +0 -13
|
@@ -2,27 +2,59 @@
|
|
|
2
2
|
{
|
|
3
3
|
try {
|
|
4
4
|
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8deae5d4-2e44-4c12-8eb2-dac9caaf8aef", e._sentryDebugIdIdentifier = "sentry-dbid-8deae5d4-2e44-4c12-8eb2-dac9caaf8aef");
|
|
6
6
|
} catch (e) {
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
;
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { u as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { m as
|
|
10
|
+
import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
|
|
11
|
+
import { useRef, useEffect, useMemo, useState, useCallback } from "preact/hooks";
|
|
12
|
+
import { u as useScenarios } from "./useScenarios-MJLlpy2B.js";
|
|
13
|
+
import { R as RadioGroup, u as useCreateLegalEntity, a as useUpdateLegalEntity, b as RadioWithLabel } from "./RadioGroup-Dkwl1v8z.js";
|
|
14
|
+
import { u as useProviderStatus, A as Address, a as addressValidators, b as addressFormatters } from "./Address-CX1FM8LF.js";
|
|
15
|
+
import { c as contactDetailFields, C as ContactDetails, a as contactDetailsValidationRules, d as defaultFieldMetadata$1, f as fieldConfig, u as useValidatePhoneNumberImperatively, g as getAsyncPhoneValidationRules } from "./validate-BacCnDiH.js";
|
|
16
|
+
import { b as useApiContext, aA as useMutation, k as httpPost, ap as matchesRegex, aU as trimValWithOneSpace, aq as NO_ALPHABET_REGEX, ar as EMOJI_REGEX, as as hasRepeatedCharacters, at as isInvalidName, aV as INDIVIDUAL_VALID_CHAR_REGEX, aW as getFormattingRegEx, aX as SPECIAL_CHARS, a8 as CountryCodes, al as Scenarios, ak as DecisionMakerTypes, M as TaskTypes, a as useTranslation, j as useQuery, N as createLogger, u as useI18nContext, x as Typography, V as Icon, m as useSettingsContext, X as useExperimentsContext, y as LegalEntityTypes, aY as getLegalRepresentativeWarningMessage, af as objectsDeepEqual, aw as standardKatakanaValidator, ax as standardKanjiValidator, a9 as isEmpty, aZ as getAgeToday, a_ as euCountries, a$ as individualApiKeyMapping, ah as individualComponentsKeyMapping, aS as reverseMapping, b0 as getNomineeFromAssociation, b1 as drop, U as useAnalyticsContext, g as getLegalEntityCountry, b2 as getAllowedDecisionMakerRoles, b3 as filterOutUnwantedAssociationsIfRootLE, ay as cloneObject, b4 as individualDocumentMapping, b5 as individualObscuredFields, a6 as getOwnEntityAssociations, b6 as hasNomineesChanged, b7 as attachNomineeToRole, aG as doArraysMatch, B as Button, q as skipToken, o as httpGet, aC as useQueryClient, L as Loader, b8 as getAvailableDecisionMakerRoleTypes, b9 as allowedCountriesForNominee, ba as isLowRiskCountry, bb as getAgeRangeForLegalRepresentative, bc as isLegalRepresentativeNeeded, aD as keysOf, bd as listToRecord, be as pick, P as IconButton, w as translateStringOrObject, bf as individualOnfidoApiKeyMapping, bg as individualOnfidoBaseMapping, bh as individualOnfidoDocumentMapping, bi as individualOnfidoObscuredFields } from "./StoreProvider-B6-mwoeD.js";
|
|
17
|
+
import { F as FormContextProvider, a as FormFlow } from "./FormFlow-CRhuooj2.js";
|
|
18
|
+
import { u as useToastContext } from "./useToastContext-BBdhLX_K.js";
|
|
19
|
+
import { g as getAssociatedLeAnalyticsPayload } from "./analytics-CYiivYhI.js";
|
|
20
|
+
import { g as getIdDocument, a as getDocument, c as createDocumentRequest, d as documentApiUtils, b as getPropsFromConfigurations, e as composePerScenarioFormConfigurations, m as mergeAttachments, f as getFileExtention } from "./validate-DQ_IsigQ.js";
|
|
21
|
+
import { M as MultiSelectList, m as makeSelectItemForRole, n as nameFields, N as Name, a as useSingpassMyInfoLogin, b as idNowModalChildEntityId, L as LandingLayout, s as showIdNowModal, i as isBafinSignatoryFlow, c as shouldShowIdNowModal } from "./bafinUtils-DSQnsLeT.js";
|
|
22
|
+
import { f as validatePatternOnBlur, R as RadioGroupCard, C as ContextGuidance, I as Image, r as resolveFieldMetadata, e as TrustedFieldsProviders, a as useAccountHolder } from "./fieldConfigurations-CzZ2B1fa.js";
|
|
23
|
+
import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer, t as trackNavigation } from "./dropinUtils-CkJv8r-0.js";
|
|
24
|
+
import { u as useMultiForm } from "./useMultiForm-B2RH71uE.js";
|
|
25
|
+
import { u as uppercase, D as DocumentGuidance, m as mapExistingFile, g as getPageName, a as getPage, b as useScenarioConfiguration } from "./mapExistingFile-D8NcT-or.js";
|
|
26
|
+
import { b as addressFields, m as mapAddressLabels, g as getAddressSchemaForCountry, C as COUNTRIES_WITH_STATES_DATASET, a as getAddressSchemaLabelsByCountry } from "./utils-Drt88lUg.js";
|
|
27
|
+
import { i as isValidationError, p as processValidationErrors, a as isMaintenanceModeError } from "./validationError-eJqGwKE_.js";
|
|
28
|
+
import { u as useDataset, d as datasetIdentifier, a as datasetUtilities } from "./useDataset-BLJa9WLi.js";
|
|
29
|
+
import { i as individualIdNumberOptions, a as additionallIdNumberOptions, t as taxInformationDefaultFieldMetadata, b as taxInformationDefaultFieldConfig, T as TaxInformationField, M as MemoizedDocumentUpload, u as useCapabilities, g as getFieldsWithExistingData } from "./TaxInformationField-r8gB7YBi.js";
|
|
30
|
+
import { l as localizeDateString } from "./localizeDateString-C4IzMd3y.js";
|
|
31
|
+
import { o as omitObscuredFieldsIfUnchanged, I as IFrameWidget } from "./iframeWidget-BfmN5KKM.js";
|
|
32
|
+
import { g as getLocalizedIdDocumentTypeOptions } from "./utils-Bw6dVL0x.js";
|
|
33
|
+
import { F as FormHeader, E as ErrorPanel, c as createFormUtils, m as mergeFieldMetadataIntoProps, g as getFieldProps, C as CountryField, f as getFormProps, u as useFormRouterContext } from "./CountryField-DxBBjy81.js";
|
|
34
|
+
import { u as useFormContext } from "./useFormContext-beqGS11A.js";
|
|
35
|
+
import { lazy, forwardRef, memo } from "preact/compat";
|
|
36
|
+
import { F as Field, c as Select, L as LoaderWrapper, C as Checkbox } from "./useForm-CiqZ15MF.js";
|
|
37
|
+
import { L as Link } from "./Link-BGc9wGrL.js";
|
|
38
|
+
import { T as Trans } from "./translation-BxcrjuWb.js";
|
|
39
|
+
import { I as InputText, S as SettingNames } from "./InputText-BCNFl9Ni.js";
|
|
40
|
+
import { u as useAllowedCountries, m as mapSchemaFieldsToApiScriptLocalization, a as mapApiScriptLocalizationToSchemaFields } from "./mapScriptLocalization-DBcq31SQ.js";
|
|
41
|
+
import { a as Alert } from "./Alert-DCYc9VpX.js";
|
|
42
|
+
import { I as InputDate, f as formatDateObj } from "./InputDate-DydMc18N.js";
|
|
43
|
+
import { m as makeMask, n as numericInputs, a as nonInputs, b as alphaInputs, c as customInputs, s as spacer, d as alphanumericInputs, M as MaskedInput } from "./MaskedInput-DOTRZoSO.js";
|
|
44
|
+
import { i as isTruthyValidator } from "./commonValidators-CwkyFFVz.js";
|
|
45
|
+
import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-D9wLpDnS.js";
|
|
46
|
+
import { i as isEmpty$1 } from "./isEmpty-CJ2g18ZH.js";
|
|
47
|
+
import { f as formatObject } from "./utils-DNSfZiio.js";
|
|
22
48
|
import { signal, computed } from "@preact/signals";
|
|
23
49
|
import { Show } from "@preact/signals/utils";
|
|
24
|
-
import { T as TileGroup } from "./TileGroup-
|
|
25
|
-
import {
|
|
50
|
+
import { T as TileGroup } from "./TileGroup-jIldfSJ7.js";
|
|
51
|
+
import { M as Modal } from "./Modal-t5jbmZJu.js";
|
|
52
|
+
import { C as Confirm } from "./Confirm-X9nR52Md.js";
|
|
53
|
+
import { a as getIndividualLegalEntityName } from "./getName-BkvLQ7My.js";
|
|
54
|
+
import { D as Dropzone } from "./Dropzone-nt4AXJ-H.js";
|
|
55
|
+
import { c as createFormRules } from "./form-rules-DhbF2mY4.js";
|
|
56
|
+
import { Onfido } from "onfido-sdk-ui";
|
|
57
|
+
import { S as Spacer } from "./Spacer-BK3jDget.js";
|
|
26
58
|
const verifyIdNumber = async (legalEntityId, baseUrl, data) => {
|
|
27
59
|
return await httpPost(
|
|
28
60
|
{
|
|
@@ -103,11 +135,2713 @@ const nameFormatters = {
|
|
|
103
135
|
formatter: (val) => val ? trimValWithOneSpace(val).replace(specialCharsRegEx, "") : void 0
|
|
104
136
|
}
|
|
105
137
|
};
|
|
138
|
+
const CountryIdNumberPatterns = {
|
|
139
|
+
[CountryCodes.Brazil]: /^\d{11}$/,
|
|
140
|
+
[CountryCodes.Canada]: /^\d{9}$/,
|
|
141
|
+
[CountryCodes.Croatia]: /^\d{11}$/,
|
|
142
|
+
[CountryCodes.Denmark]: /^\d{10}$/,
|
|
143
|
+
[CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
|
|
144
|
+
[CountryCodes.Poland]: /^\d{11}$/,
|
|
145
|
+
[CountryCodes.Romania]: /^\d{13}$/,
|
|
146
|
+
[CountryCodes.Singapore]: /^[A-Z][0-9]{7}[A-Z]$/,
|
|
147
|
+
[CountryCodes.Spain]: {
|
|
148
|
+
dni: /(^[KL]?\d{8}[A-Z]$)/,
|
|
149
|
+
nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
|
|
150
|
+
},
|
|
151
|
+
[CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
|
|
152
|
+
[CountryCodes.UnitedStates]: {
|
|
153
|
+
// used by CountryCodes.PuertoRico
|
|
154
|
+
ssn: /^\d{9}$/,
|
|
155
|
+
ssnLastFour: /^\d{4}$/
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const DriversLicenseCardNumberPatterns = {
|
|
159
|
+
[CountryCodes.NewZealand]: /^[\d]{3}$/,
|
|
160
|
+
[CountryCodes.Australia]: /^[A-Z0-9]{5,11}$/
|
|
161
|
+
};
|
|
162
|
+
const DriversLicenseNumberPatterns = {
|
|
163
|
+
[CountryCodes.Australia]: /^[A-Za-z0-9]{5,11}$/,
|
|
164
|
+
[CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
|
|
165
|
+
[CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
|
|
166
|
+
};
|
|
167
|
+
const PassportNumberPatterns = {
|
|
168
|
+
[CountryCodes.Australia]: /^[A-Z0-9]{8,9}$/,
|
|
169
|
+
[CountryCodes.HongKong]: /^[A-Z0-9]{9}$/,
|
|
170
|
+
[CountryCodes.NewZealand]: /^[A-Z0-9]{8,9}$/
|
|
171
|
+
};
|
|
172
|
+
const ProofOfIdentityCardPatterns = {
|
|
173
|
+
[CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
|
|
174
|
+
};
|
|
175
|
+
const COUNTRY_ID_NUMBER_MASKS = {
|
|
176
|
+
[CountryCodes.PuertoRico]: { length: 4 },
|
|
177
|
+
[CountryCodes.UnitedStates]: { length: 4 }
|
|
178
|
+
};
|
|
179
|
+
const COUNTRY_ID_NUMBER_UNMASKED = {
|
|
180
|
+
[CountryCodes.PuertoRico]: { length: 9 },
|
|
181
|
+
[CountryCodes.UnitedStates]: { length: 9 }
|
|
182
|
+
};
|
|
183
|
+
const ID_NUMBER_VERIFICATION_COUNTRIES = [
|
|
184
|
+
CountryCodes.PuertoRico,
|
|
185
|
+
CountryCodes.UnitedStates
|
|
186
|
+
];
|
|
187
|
+
const FIELD = "idNumber";
|
|
188
|
+
const handleVerifyIdNumber = async (formData, verifyFn) => {
|
|
189
|
+
const country = formData.residencyCountry;
|
|
190
|
+
const verified = { field: "idNumber", isVerified: true };
|
|
191
|
+
if (formData.idNumberExempt || !country) {
|
|
192
|
+
return verified;
|
|
193
|
+
}
|
|
194
|
+
if (!ID_NUMBER_VERIFICATION_COUNTRIES.includes(country)) {
|
|
195
|
+
return verified;
|
|
196
|
+
}
|
|
197
|
+
const isCountryWithMaskedIdNumber = Object.keys(COUNTRY_ID_NUMBER_MASKS).includes(country);
|
|
198
|
+
const isValueMasked = formData.idNumber?.length === COUNTRY_ID_NUMBER_MASKS[country]?.length;
|
|
199
|
+
const hasCompleteValue = formData.idNumber?.length === COUNTRY_ID_NUMBER_UNMASKED[country]?.length;
|
|
200
|
+
if (isCountryWithMaskedIdNumber && isValueMasked) return verified;
|
|
201
|
+
if (!hasCompleteValue) {
|
|
202
|
+
return { field: "idNumber", isVerified: false };
|
|
203
|
+
}
|
|
204
|
+
const response = await verifyFn({
|
|
205
|
+
name: {
|
|
206
|
+
firstName: formData.firstName || "",
|
|
207
|
+
lastName: formData.lastName || ""
|
|
208
|
+
},
|
|
209
|
+
countryCode: country,
|
|
210
|
+
idNumber: formData.idNumber || ""
|
|
211
|
+
});
|
|
212
|
+
const isNotVerified = response?.status === 422 || response?.verified === "false";
|
|
213
|
+
if (isNotVerified)
|
|
214
|
+
return {
|
|
215
|
+
field: FIELD,
|
|
216
|
+
isVerified: false
|
|
217
|
+
};
|
|
218
|
+
return {
|
|
219
|
+
field: FIELD,
|
|
220
|
+
isVerified: true
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
const getAsyncIdNumberValidationRule = (verifyIdNumber2, personalDetails) => ({
|
|
224
|
+
idNumber: {
|
|
225
|
+
asyncValidate: async (idNumber) => {
|
|
226
|
+
if (!idNumber || !personalDetails) return false;
|
|
227
|
+
return (await handleVerifyIdNumber(personalDetails, verifyIdNumber2)).isVerified;
|
|
228
|
+
},
|
|
229
|
+
errorMessage: "unableToVerifyTheIdNumber",
|
|
230
|
+
modes: ["blur", "input"]
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
const defaultFieldMetadata = {
|
|
234
|
+
label: "idNumber"
|
|
235
|
+
};
|
|
236
|
+
const defaultFieldConfig = {
|
|
237
|
+
[CountryCodes.Brazil]: {
|
|
238
|
+
label: "cadastroDePessoasFisicas",
|
|
239
|
+
mask: {
|
|
240
|
+
mask: makeMask(
|
|
241
|
+
...numericInputs(3),
|
|
242
|
+
...nonInputs(" . "),
|
|
243
|
+
...numericInputs(3),
|
|
244
|
+
...nonInputs(" . "),
|
|
245
|
+
...numericInputs(3),
|
|
246
|
+
...nonInputs(" - "),
|
|
247
|
+
...numericInputs(2)
|
|
248
|
+
)
|
|
249
|
+
},
|
|
250
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Brazil]),
|
|
251
|
+
guidanceText: {
|
|
252
|
+
key: "enterNDigitsForExample",
|
|
253
|
+
values: {
|
|
254
|
+
numDigits: "11",
|
|
255
|
+
example: "231.002.999-00"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
[CountryCodes.Canada]: {
|
|
260
|
+
label: "socialInsuranceNumber",
|
|
261
|
+
mask: {
|
|
262
|
+
mask: makeMask(...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3))
|
|
263
|
+
},
|
|
264
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Canada]),
|
|
265
|
+
guidanceText: {
|
|
266
|
+
key: "enterNDigitsForExample",
|
|
267
|
+
values: {
|
|
268
|
+
numDigits: "9",
|
|
269
|
+
example: "046 454 286"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
[CountryCodes.Croatia]: {
|
|
274
|
+
label: "oib",
|
|
275
|
+
mask: { mask: makeMask(...numericInputs(11)) },
|
|
276
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Croatia]),
|
|
277
|
+
guidanceText: {
|
|
278
|
+
key: "enterNDigitsForExample",
|
|
279
|
+
values: {
|
|
280
|
+
numDigits: "11",
|
|
281
|
+
example: "94577403194"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
[CountryCodes.Denmark]: {
|
|
286
|
+
label: "detCentralePersonregister",
|
|
287
|
+
mask: {
|
|
288
|
+
mask: makeMask(...numericInputs(6), ...nonInputs(" - "), ...numericInputs(4))
|
|
289
|
+
},
|
|
290
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Denmark]),
|
|
291
|
+
guidanceText: {
|
|
292
|
+
key: "enterNDigitsForExample",
|
|
293
|
+
values: {
|
|
294
|
+
numDigits: "10",
|
|
295
|
+
example: "010111-1113"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
[CountryCodes.Italy]: {
|
|
300
|
+
label: "codiceFiscale",
|
|
301
|
+
mask: {
|
|
302
|
+
mask: makeMask(
|
|
303
|
+
...alphaInputs(6),
|
|
304
|
+
...numericInputs(2),
|
|
305
|
+
...customInputs(1, /^[ABCDEHLMPRST]$/),
|
|
306
|
+
...numericInputs(2),
|
|
307
|
+
...alphaInputs(1),
|
|
308
|
+
...numericInputs(3),
|
|
309
|
+
...alphaInputs(1)
|
|
310
|
+
),
|
|
311
|
+
transformOnType: uppercase
|
|
312
|
+
},
|
|
313
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Italy]),
|
|
314
|
+
guidanceText: {
|
|
315
|
+
key: "enterNCharactersWithAMixForExample",
|
|
316
|
+
values: {
|
|
317
|
+
numChars: "16",
|
|
318
|
+
example: "YULSQG40E60L271T"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
[CountryCodes.Poland]: {
|
|
323
|
+
label: "peselNumber",
|
|
324
|
+
mask: { mask: makeMask(...numericInputs(11)) },
|
|
325
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Poland]),
|
|
326
|
+
guidanceText: {
|
|
327
|
+
key: "enterNDigitsForExample",
|
|
328
|
+
values: {
|
|
329
|
+
numDigits: "11",
|
|
330
|
+
example: "23012224757"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
[CountryCodes.PuertoRico]: ({ idNumberType }) => {
|
|
335
|
+
switch (idNumberType) {
|
|
336
|
+
case "ssn":
|
|
337
|
+
return {
|
|
338
|
+
label: "socialSecurityNumber",
|
|
339
|
+
mask: {
|
|
340
|
+
mask: makeMask(
|
|
341
|
+
...numericInputs(3),
|
|
342
|
+
...nonInputs(" - "),
|
|
343
|
+
...numericInputs(2),
|
|
344
|
+
...nonInputs(" - "),
|
|
345
|
+
...numericInputs(4)
|
|
346
|
+
)
|
|
347
|
+
},
|
|
348
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssn),
|
|
349
|
+
guidanceText: {
|
|
350
|
+
key: "enterNDigitsForExample",
|
|
351
|
+
values: {
|
|
352
|
+
numDigits: "9",
|
|
353
|
+
example: "123-12-1234"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
case "ssnLastFour":
|
|
358
|
+
default:
|
|
359
|
+
return {
|
|
360
|
+
label: "last4DigitsOfSocialSecurityNumber",
|
|
361
|
+
mask: {
|
|
362
|
+
mask: makeMask(...numericInputs(4))
|
|
363
|
+
},
|
|
364
|
+
validators: {
|
|
365
|
+
modes: ["blur"],
|
|
366
|
+
validate: (val) => !!val && CountryIdNumberPatterns[CountryCodes.UnitedStates].ssnLastFour.test(val),
|
|
367
|
+
errorMessage: "mustContain4Digits"
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
[CountryCodes.Romania]: {
|
|
373
|
+
label: "codNumericPersonal",
|
|
374
|
+
mask: { mask: makeMask(...numericInputs(13)) },
|
|
375
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Romania]),
|
|
376
|
+
guidanceText: {
|
|
377
|
+
key: "enterNDigitsForExample",
|
|
378
|
+
values: {
|
|
379
|
+
numDigits: "13",
|
|
380
|
+
example: "8001011234567"
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
[CountryCodes.Singapore]: {
|
|
385
|
+
label: "nric",
|
|
386
|
+
mask: {
|
|
387
|
+
mask: makeMask(...alphaInputs(1), ...numericInputs(7), ...alphaInputs(1)),
|
|
388
|
+
transformOnType: uppercase
|
|
389
|
+
},
|
|
390
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Singapore]),
|
|
391
|
+
guidanceText: {
|
|
392
|
+
key: "enterNCharactersWithAMixForExample",
|
|
393
|
+
values: {
|
|
394
|
+
numChars: "9",
|
|
395
|
+
example: "T9123456J"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
[CountryCodes.Spain]: ({ idNumberType }) => {
|
|
400
|
+
switch (idNumberType) {
|
|
401
|
+
case "dni":
|
|
402
|
+
return {
|
|
403
|
+
label: "dni",
|
|
404
|
+
mask: {
|
|
405
|
+
mask: makeMask(
|
|
406
|
+
...customInputs(1, /^[KL]$/, true),
|
|
407
|
+
...numericInputs(8),
|
|
408
|
+
...alphaInputs(1)
|
|
409
|
+
),
|
|
410
|
+
transformOnType: uppercase
|
|
411
|
+
},
|
|
412
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Spain].dni),
|
|
413
|
+
guidanceText: {
|
|
414
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
415
|
+
values: {
|
|
416
|
+
minChars: "9",
|
|
417
|
+
maxChars: "10",
|
|
418
|
+
example: "12345678A or L12345678A"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
case "nie":
|
|
423
|
+
default:
|
|
424
|
+
return {
|
|
425
|
+
label: "nie",
|
|
426
|
+
mask: {
|
|
427
|
+
mask: makeMask(
|
|
428
|
+
...customInputs(1, /^[MXYZ]$/),
|
|
429
|
+
...numericInputs(7),
|
|
430
|
+
...numericInputs(1, true),
|
|
431
|
+
...alphaInputs(1)
|
|
432
|
+
),
|
|
433
|
+
transformOnType: uppercase
|
|
434
|
+
},
|
|
435
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Spain].nie),
|
|
436
|
+
guidanceText: {
|
|
437
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
438
|
+
values: {
|
|
439
|
+
minChars: "9",
|
|
440
|
+
maxChars: "10",
|
|
441
|
+
example: "X12345678A or Z6527153N"
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
[CountryCodes.Sweden]: {
|
|
448
|
+
label: "personnummer",
|
|
449
|
+
mask: {
|
|
450
|
+
mask: makeMask(
|
|
451
|
+
...numericInputs(6),
|
|
452
|
+
...numericInputs(2, true),
|
|
453
|
+
...nonInputs(" - "),
|
|
454
|
+
...numericInputs(4)
|
|
455
|
+
)
|
|
456
|
+
},
|
|
457
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.Sweden]),
|
|
458
|
+
guidanceText: {
|
|
459
|
+
key: "enterXOrYDigitsForExample",
|
|
460
|
+
values: {
|
|
461
|
+
xDigits: "10",
|
|
462
|
+
yDigits: "12",
|
|
463
|
+
example: "640823-3234 or 19640823-3234"
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
[CountryCodes.UnitedStates]: ({ idNumberType }) => {
|
|
468
|
+
switch (idNumberType) {
|
|
469
|
+
case "ssn":
|
|
470
|
+
return {
|
|
471
|
+
label: "socialSecurityNumber",
|
|
472
|
+
mask: {
|
|
473
|
+
mask: makeMask(
|
|
474
|
+
...numericInputs(3),
|
|
475
|
+
...nonInputs(" - "),
|
|
476
|
+
...numericInputs(2),
|
|
477
|
+
...nonInputs(" - "),
|
|
478
|
+
...numericInputs(4)
|
|
479
|
+
)
|
|
480
|
+
},
|
|
481
|
+
validators: validatePatternOnBlur(CountryIdNumberPatterns[CountryCodes.UnitedStates].ssn),
|
|
482
|
+
guidanceText: {
|
|
483
|
+
key: "enterNDigitsForExample",
|
|
484
|
+
values: {
|
|
485
|
+
numDigits: "9",
|
|
486
|
+
example: "123-12-1234"
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
case "ssnLastFour":
|
|
491
|
+
default:
|
|
492
|
+
return {
|
|
493
|
+
label: "last4DigitsOfSocialSecurityNumber",
|
|
494
|
+
mask: {
|
|
495
|
+
mask: makeMask(...numericInputs(4))
|
|
496
|
+
},
|
|
497
|
+
validators: {
|
|
498
|
+
modes: ["blur"],
|
|
499
|
+
validate: (val) => !!val && CountryIdNumberPatterns[CountryCodes.UnitedStates].ssnLastFour.test(val),
|
|
500
|
+
errorMessage: "mustContain4Digits"
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
[CountryCodes.NewZealand]: ({ idNumberType }) => {
|
|
506
|
+
switch (idNumberType) {
|
|
507
|
+
case "passport":
|
|
508
|
+
return {
|
|
509
|
+
label: "passportNumber",
|
|
510
|
+
mask: {
|
|
511
|
+
mask: makeMask(...alphanumericInputs(9)),
|
|
512
|
+
transformOnType: uppercase
|
|
513
|
+
},
|
|
514
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.NewZealand]),
|
|
515
|
+
guidanceText: {
|
|
516
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
517
|
+
values: {
|
|
518
|
+
minChars: "8",
|
|
519
|
+
maxChars: "9",
|
|
520
|
+
example: "RA000750"
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
case "driversLicense":
|
|
525
|
+
default:
|
|
526
|
+
return {
|
|
527
|
+
label: "licenseNumber",
|
|
528
|
+
mask: {
|
|
529
|
+
mask: makeMask(...alphaInputs(2), ...numericInputs(6)),
|
|
530
|
+
transformOnType: uppercase
|
|
531
|
+
},
|
|
532
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.NewZealand]),
|
|
533
|
+
guidanceText: {
|
|
534
|
+
key: "enterNCharactersWithAMixForExample",
|
|
535
|
+
values: {
|
|
536
|
+
numChars: "8",
|
|
537
|
+
example: "KA111112"
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
[CountryCodes.HongKong]: ({ idNumberType }) => {
|
|
544
|
+
switch (idNumberType) {
|
|
545
|
+
case "proofOfIdentityCard":
|
|
546
|
+
return {
|
|
547
|
+
label: "hkid",
|
|
548
|
+
mask: {
|
|
549
|
+
mask: makeMask(
|
|
550
|
+
...alphaInputs(1),
|
|
551
|
+
...alphaInputs(1, true),
|
|
552
|
+
...numericInputs(6),
|
|
553
|
+
...nonInputs("(", { displayEagerly: false }),
|
|
554
|
+
...customInputs(1, /^[0-9A]$/),
|
|
555
|
+
...nonInputs(")")
|
|
556
|
+
),
|
|
557
|
+
transformOnType: uppercase
|
|
558
|
+
},
|
|
559
|
+
validators: validatePatternOnBlur(ProofOfIdentityCardPatterns[CountryCodes.HongKong]),
|
|
560
|
+
guidanceText: {
|
|
561
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
562
|
+
values: {
|
|
563
|
+
minChars: "8",
|
|
564
|
+
maxChars: "9",
|
|
565
|
+
example: "Z683365(5) or AB123456(A)"
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
case "passport":
|
|
570
|
+
return {
|
|
571
|
+
label: "passportNumber",
|
|
572
|
+
mask: {
|
|
573
|
+
mask: makeMask(...alphanumericInputs(9)),
|
|
574
|
+
transformOnType: uppercase
|
|
575
|
+
},
|
|
576
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.HongKong]),
|
|
577
|
+
guidanceText: {
|
|
578
|
+
key: "enterNCharactersWithAMixForExample",
|
|
579
|
+
values: {
|
|
580
|
+
numChars: "9",
|
|
581
|
+
example: "H12345678"
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
case "driversLicense":
|
|
586
|
+
default:
|
|
587
|
+
return {
|
|
588
|
+
label: "licenseNumber",
|
|
589
|
+
mask: {
|
|
590
|
+
mask: makeMask(...alphanumericInputs(7), spacer, ...alphanumericInputs(1)),
|
|
591
|
+
transformOnType: uppercase
|
|
592
|
+
},
|
|
593
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.HongKong]),
|
|
594
|
+
guidanceText: {
|
|
595
|
+
key: "enterNCharactersForExample",
|
|
596
|
+
values: {
|
|
597
|
+
numChars: "8",
|
|
598
|
+
example: "A123452 0"
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
[CountryCodes.Australia]: ({ idNumberType }) => {
|
|
605
|
+
switch (idNumberType) {
|
|
606
|
+
case "passport":
|
|
607
|
+
return {
|
|
608
|
+
label: "passportNumber",
|
|
609
|
+
mask: {
|
|
610
|
+
mask: makeMask(...alphanumericInputs(9)),
|
|
611
|
+
transformOnType: uppercase
|
|
612
|
+
},
|
|
613
|
+
validators: validatePatternOnBlur(PassportNumberPatterns[CountryCodes.Australia]),
|
|
614
|
+
guidanceText: {
|
|
615
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
616
|
+
values: {
|
|
617
|
+
minChars: "8",
|
|
618
|
+
maxChars: "9",
|
|
619
|
+
example: "RA0123456"
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
case "driversLicense":
|
|
624
|
+
default:
|
|
625
|
+
return {
|
|
626
|
+
label: "licenseNumber",
|
|
627
|
+
mask: {
|
|
628
|
+
mask: makeMask(...alphanumericInputs(6), ...alphanumericInputs(5, true)),
|
|
629
|
+
transformOnType: uppercase
|
|
630
|
+
},
|
|
631
|
+
validators: validatePatternOnBlur(DriversLicenseNumberPatterns[CountryCodes.Australia]),
|
|
632
|
+
guidanceText: {
|
|
633
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
634
|
+
values: {
|
|
635
|
+
minChars: "5",
|
|
636
|
+
maxChars: "11",
|
|
637
|
+
example: "2093628291"
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
const licenseCardNumberDefaultMetadata = {
|
|
645
|
+
label: "licenseCardNumber"
|
|
646
|
+
};
|
|
647
|
+
const licenseCardNumberDefaultConfig = {
|
|
648
|
+
[CountryCodes.NewZealand]: {
|
|
649
|
+
label: "licenceVersionNumber",
|
|
650
|
+
mask: { mask: makeMask(...numericInputs(3)) },
|
|
651
|
+
validators: validatePatternOnBlur(DriversLicenseCardNumberPatterns[CountryCodes.NewZealand]),
|
|
652
|
+
guidanceText: {
|
|
653
|
+
key: "enterNDigitsForExample",
|
|
654
|
+
values: {
|
|
655
|
+
numDigits: "3",
|
|
656
|
+
example: "108"
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
[CountryCodes.Australia]: {
|
|
661
|
+
label: "licenseCardNumber",
|
|
662
|
+
mask: {
|
|
663
|
+
mask: makeMask(...alphanumericInputs(6), ...alphanumericInputs(5, true)),
|
|
664
|
+
transformOnType: uppercase
|
|
665
|
+
},
|
|
666
|
+
validators: validatePatternOnBlur(DriversLicenseCardNumberPatterns[CountryCodes.Australia]),
|
|
667
|
+
guidanceText: {
|
|
668
|
+
key: "enterXToYCharactersWithAMixForExample",
|
|
669
|
+
values: {
|
|
670
|
+
minChars: "5",
|
|
671
|
+
maxChars: "11",
|
|
672
|
+
example: "2093628291"
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
const idNumberExemptDefaultMetadata = {
|
|
678
|
+
label: "identityNumberExempt"
|
|
679
|
+
};
|
|
680
|
+
const idNumberExemptDefaultConfig = {
|
|
681
|
+
[CountryCodes.UnitedStates]: {
|
|
682
|
+
label: "identityNumberExempt__US"
|
|
683
|
+
},
|
|
684
|
+
[CountryCodes.Canada]: {
|
|
685
|
+
label: "identityNumberExempt__CA"
|
|
686
|
+
},
|
|
687
|
+
[CountryCodes.Singapore]: {
|
|
688
|
+
label: "uploadDocumentForNric"
|
|
689
|
+
}
|
|
690
|
+
};
|
|
106
691
|
const onfidoDocumentTypeMapping = [
|
|
107
692
|
{ id: "driversLicense", name: "driversLicense", hasBackPage: true },
|
|
108
693
|
{ id: "identityCard", name: "identityCard", hasBackPage: true },
|
|
109
694
|
{ id: "passport", name: "passport", hasBackPage: false }
|
|
110
695
|
];
|
|
696
|
+
const idVerificationProviderId = signal();
|
|
697
|
+
const showIndividualMotionCapture = signal(void 0);
|
|
698
|
+
const setShowIndividualMotionCapture = (showMotionCapture) => {
|
|
699
|
+
showIndividualMotionCapture.value = showMotionCapture;
|
|
700
|
+
};
|
|
701
|
+
const hasMotionCaptureScenario = signal(void 0);
|
|
702
|
+
const setHasMotionCaptureScenario = (scenarios) => {
|
|
703
|
+
hasMotionCaptureScenario.value = scenarios?.includes(Scenarios.L_MOTION);
|
|
704
|
+
};
|
|
705
|
+
const allowedRolesForMotionCapture = [DecisionMakerTypes.SIGNATORY];
|
|
706
|
+
const shouldShowMotionCapture = ({
|
|
707
|
+
capabilities,
|
|
708
|
+
userRoles,
|
|
709
|
+
taskType,
|
|
710
|
+
hasMotionScenario
|
|
711
|
+
}) => {
|
|
712
|
+
if (!hasMotionScenario) {
|
|
713
|
+
return false;
|
|
714
|
+
}
|
|
715
|
+
const isIndividual = taskType === TaskTypes.INDIVIDUAL;
|
|
716
|
+
const hasRequiredRole = userRoles?.some((role) => allowedRolesForMotionCapture.includes(role));
|
|
717
|
+
const hasRequiredCapability = capabilities?.issueBankAccount?.requested ?? false;
|
|
718
|
+
return (isIndividual || hasRequiredRole) && hasRequiredCapability;
|
|
719
|
+
};
|
|
720
|
+
const idDocumentUploadFields = [
|
|
721
|
+
"idDocumentType",
|
|
722
|
+
"idFrontPage",
|
|
723
|
+
"idBackPage",
|
|
724
|
+
"instantIdVerificationData"
|
|
725
|
+
];
|
|
726
|
+
function IdDocumentManualUpload(props) {
|
|
727
|
+
const { t } = useTranslation(["common", "individual"]);
|
|
728
|
+
const { data, id, name, errors, valid, handleFieldChange, country } = props;
|
|
729
|
+
if (!handleFieldChange) {
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
const isOptional = !(props?.formVerificationErrors && Object.keys(props?.formVerificationErrors)?.length === 0);
|
|
733
|
+
const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
|
|
734
|
+
const hasBackPage = (documentType) => {
|
|
735
|
+
if (documentType) {
|
|
736
|
+
return idDocumentTypeOptions.find(({ id: id2 }) => documentType === id2)?.hasBackPage;
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
const hasBack = hasBackPage(data?.idDocumentType);
|
|
740
|
+
const formUtils = createFormUtils(props, t);
|
|
741
|
+
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-individual-document-upload adyen-kyc-individual-document-upload--idDocument", children: [
|
|
742
|
+
/* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $["idDocument"]) }),
|
|
743
|
+
/* @__PURE__ */ jsx(
|
|
744
|
+
ErrorPanel,
|
|
745
|
+
{
|
|
746
|
+
verificationErrors: props?.formVerificationErrors,
|
|
747
|
+
validationErrors: props?.fieldValidationErrors,
|
|
748
|
+
formUtils,
|
|
749
|
+
id: "ariaErrorField"
|
|
750
|
+
}
|
|
751
|
+
),
|
|
752
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-document-upload__subtitle", children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["idUploadDocumentSubtitle"], values: { name } }) }),
|
|
753
|
+
/* @__PURE__ */ jsx(
|
|
754
|
+
Field,
|
|
755
|
+
{
|
|
756
|
+
name: "idDocumentType",
|
|
757
|
+
label: t(($) => $["selectDocumentType"]),
|
|
758
|
+
errorMessage: errors?.idDocumentType?.errorMessage,
|
|
759
|
+
isValid: valid?.idDocumentType,
|
|
760
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
761
|
+
Select,
|
|
762
|
+
{
|
|
763
|
+
...childProps,
|
|
764
|
+
onChange: handleFieldChange("idDocumentType", "input"),
|
|
765
|
+
name: "idDocumentType",
|
|
766
|
+
placeholder: t(($) => $["selectDocument"]),
|
|
767
|
+
selected: data?.idDocumentType,
|
|
768
|
+
items: idDocumentTypeOptions.map(({ id: id2, name: name2 }) => ({
|
|
769
|
+
id: id2,
|
|
770
|
+
name: t(($) => $[name2])
|
|
771
|
+
}))
|
|
772
|
+
}
|
|
773
|
+
)
|
|
774
|
+
}
|
|
775
|
+
),
|
|
776
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
|
|
777
|
+
" ",
|
|
778
|
+
t(($) => $["requirements"])
|
|
779
|
+
] }),
|
|
780
|
+
/* @__PURE__ */ jsxs("ul", { children: [
|
|
781
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["documentNotExpiredOrDamaged"], { ns: "individual" }) }),
|
|
782
|
+
/* @__PURE__ */ jsx("li", { children: hasBackPage(data?.idDocumentType) ? t(($) => $["includeFrontAndBack"], { ns: "individual" }) : t(($) => $["providePageWithPhotoAndCode"], { ns: "individual" }) }),
|
|
783
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["fullDocumentVisible"], { ns: "individual" }) }),
|
|
784
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["imagesInColor"], { ns: "individual" }) })
|
|
785
|
+
] }),
|
|
786
|
+
data?.idDocumentType && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
787
|
+
/* @__PURE__ */ jsx(DocumentGuidance, { type: data?.idDocumentType, className: "adyen-kyc-u-margin-y-16" }),
|
|
788
|
+
/* @__PURE__ */ jsx(
|
|
789
|
+
Dropzone,
|
|
790
|
+
{
|
|
791
|
+
name: "idFrontPage",
|
|
792
|
+
label: t(($) => $["frontPage"], { ns: "individual" }),
|
|
793
|
+
defaultData: data,
|
|
794
|
+
id,
|
|
795
|
+
isOptional,
|
|
796
|
+
shouldValidate: true,
|
|
797
|
+
handleFieldChange,
|
|
798
|
+
errors,
|
|
799
|
+
valid
|
|
800
|
+
}
|
|
801
|
+
)
|
|
802
|
+
] }),
|
|
803
|
+
data?.idDocumentType && hasBack && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-margin-top-16", children: /* @__PURE__ */ jsx(
|
|
804
|
+
Dropzone,
|
|
805
|
+
{
|
|
806
|
+
name: "idBackPage",
|
|
807
|
+
label: t(($) => $["backPage"], { ns: "individual" }),
|
|
808
|
+
defaultData: data,
|
|
809
|
+
id,
|
|
810
|
+
isOptional,
|
|
811
|
+
shouldValidate: true,
|
|
812
|
+
handleFieldChange,
|
|
813
|
+
errors,
|
|
814
|
+
valid
|
|
815
|
+
}
|
|
816
|
+
) })
|
|
817
|
+
] });
|
|
818
|
+
}
|
|
819
|
+
const getIdVerificationToken = async (rootLegalEntityId, baseUrl, request) => httpPost(
|
|
820
|
+
{
|
|
821
|
+
baseUrl,
|
|
822
|
+
path: `legalEntities/${rootLegalEntityId}/providers/idVerification/initiate`
|
|
823
|
+
},
|
|
824
|
+
request
|
|
825
|
+
);
|
|
826
|
+
const useIdVerificationToken = ({ firstName, lastName, residencyCountry }, legalEntityId, options2) => {
|
|
827
|
+
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
828
|
+
const data = firstName && lastName && residencyCountry ? {
|
|
829
|
+
name: { firstName, lastName },
|
|
830
|
+
country: residencyCountry,
|
|
831
|
+
origin: `${window.location.origin}/*`,
|
|
832
|
+
consents: [
|
|
833
|
+
{
|
|
834
|
+
name: "privacy_notices_read",
|
|
835
|
+
granted: true
|
|
836
|
+
}
|
|
837
|
+
],
|
|
838
|
+
...legalEntityId ? { legalEntityId } : {}
|
|
839
|
+
// Do not include legalEntityId if we don't know yet. Eg.: decision-makers flow the associated legalEntityId.
|
|
840
|
+
} : void 0;
|
|
841
|
+
return useQuery({
|
|
842
|
+
enabled: Boolean(firstName && lastName && residencyCountry),
|
|
843
|
+
queryKey: ["idVerificationToken", data],
|
|
844
|
+
queryFn: () => getIdVerificationToken(rootLegalEntityId.value, baseUrl.value, data),
|
|
845
|
+
...options2
|
|
846
|
+
});
|
|
847
|
+
};
|
|
848
|
+
const containerId = "adyen-kyc-id-verification";
|
|
849
|
+
const getOnfidoLocaleConfig = (i18n) => {
|
|
850
|
+
const language = i18n.locale.substring(0, 2);
|
|
851
|
+
return language === "en" ? {
|
|
852
|
+
locale: language,
|
|
853
|
+
phrases: {
|
|
854
|
+
"country_select.button_primary": i18n.get("continue"),
|
|
855
|
+
"doc_submit.title_id_back": i18n.get("identityCardBack"),
|
|
856
|
+
"doc_submit.title_id_front": i18n.get("identityCardFront"),
|
|
857
|
+
"doc_submit.title_license_back": i18n.get("drivinglicenseBack"),
|
|
858
|
+
"doc_submit.title_license_front": i18n.get("drivinglicenseFront"),
|
|
859
|
+
"doc_submit.title_passport": i18n.get("passportPhotoPage"),
|
|
860
|
+
"doc_submit.title_permit_back": i18n.get("residencePermitBack"),
|
|
861
|
+
"doc_submit.title_permit_front": i18n.get("residencePermitFront")
|
|
862
|
+
}
|
|
863
|
+
} : language;
|
|
864
|
+
};
|
|
865
|
+
const initOnfido = async ({
|
|
866
|
+
containerEl,
|
|
867
|
+
token,
|
|
868
|
+
i18n,
|
|
869
|
+
onIdVerificationComplete,
|
|
870
|
+
onIdVerificationError,
|
|
871
|
+
showMotionCapture
|
|
872
|
+
}) => {
|
|
873
|
+
const steps = [
|
|
874
|
+
{
|
|
875
|
+
type: "document",
|
|
876
|
+
options: {
|
|
877
|
+
documentTypes: {
|
|
878
|
+
passport: true,
|
|
879
|
+
driving_licence: true,
|
|
880
|
+
national_identity_card: true,
|
|
881
|
+
residence_permit: false
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
showMotionCapture ? { type: "face", options: { requestedVariant: "motion" } } : void 0
|
|
886
|
+
].filter(Boolean);
|
|
887
|
+
return Onfido.init({
|
|
888
|
+
token,
|
|
889
|
+
containerEl,
|
|
890
|
+
disableAnalytics: false,
|
|
891
|
+
onComplete: onIdVerificationComplete,
|
|
892
|
+
onError: onIdVerificationError,
|
|
893
|
+
steps,
|
|
894
|
+
language: getOnfidoLocaleConfig(i18n)
|
|
895
|
+
});
|
|
896
|
+
};
|
|
897
|
+
const logger$6 = createLogger();
|
|
898
|
+
function IdVerification({
|
|
899
|
+
minimumApplicantDetails,
|
|
900
|
+
legalEntityId,
|
|
901
|
+
onIdVerificationError,
|
|
902
|
+
onIdVerificationComplete
|
|
903
|
+
}) {
|
|
904
|
+
const containerRef = useRef(null);
|
|
905
|
+
const { i18n } = useI18nContext();
|
|
906
|
+
const {
|
|
907
|
+
data: tokenResponse,
|
|
908
|
+
isLoading,
|
|
909
|
+
isError
|
|
910
|
+
} = useIdVerificationToken(minimumApplicantDetails, legalEntityId);
|
|
911
|
+
const onfidoSdk = useRef();
|
|
912
|
+
useEffect(() => {
|
|
913
|
+
(async () => {
|
|
914
|
+
if (!tokenResponse) return;
|
|
915
|
+
const { sdkToken, id: providerId } = tokenResponse;
|
|
916
|
+
if (!containerRef.current) throw new Error("No container for Onfido found");
|
|
917
|
+
idVerificationProviderId.value = providerId;
|
|
918
|
+
onfidoSdk.current = await initOnfido({
|
|
919
|
+
containerEl: containerRef.current,
|
|
920
|
+
token: sdkToken,
|
|
921
|
+
i18n,
|
|
922
|
+
onIdVerificationError,
|
|
923
|
+
onIdVerificationComplete,
|
|
924
|
+
language: getOnfidoLocaleConfig(i18n),
|
|
925
|
+
showMotionCapture: showIndividualMotionCapture.value
|
|
926
|
+
});
|
|
927
|
+
})().catch(logger$6.error);
|
|
928
|
+
return async () => {
|
|
929
|
+
if (onfidoSdk.current) await onfidoSdk.current.tearDown();
|
|
930
|
+
};
|
|
931
|
+
}, [tokenResponse, i18n]);
|
|
932
|
+
return /* @__PURE__ */ jsx(
|
|
933
|
+
LoaderWrapper,
|
|
934
|
+
{
|
|
935
|
+
status: tokenResponse ? "success" : isLoading ? "loading" : isError ? "error" : "pending",
|
|
936
|
+
children: /* @__PURE__ */ jsx("div", { ref: containerRef, className: containerId })
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
function IdDocumentAlreadyUpload(props) {
|
|
941
|
+
const { onClickSubmitDocumentAgain } = props;
|
|
942
|
+
const { t } = useTranslation(["individual"]);
|
|
943
|
+
const { t: commonT } = useTranslation("common");
|
|
944
|
+
const formUtils = createFormUtils(props, commonT);
|
|
945
|
+
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-individual-document-upload adyen-kyc-individual-document-upload--idDocument", children: [
|
|
946
|
+
/* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $["documentVerification"]) }),
|
|
947
|
+
/* @__PURE__ */ jsx(
|
|
948
|
+
ErrorPanel,
|
|
949
|
+
{
|
|
950
|
+
verificationErrors: props?.formVerificationErrors,
|
|
951
|
+
validationErrors: props?.fieldValidationErrors,
|
|
952
|
+
formUtils,
|
|
953
|
+
id: "ariaErrorField"
|
|
954
|
+
}
|
|
955
|
+
),
|
|
956
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-upload-field__subtitle", children: t(($) => $["youHaveSuccessfullyProvidedTheIdDocument"]) }),
|
|
957
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
|
|
958
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
959
|
+
t(($) => $["madeAMistake"]),
|
|
960
|
+
" "
|
|
961
|
+
] }),
|
|
962
|
+
/* @__PURE__ */ jsx(
|
|
963
|
+
"button",
|
|
964
|
+
{
|
|
965
|
+
className: "adyen-kyc-link",
|
|
966
|
+
title: t(($) => $["submitIdDocumentsAgain"]),
|
|
967
|
+
type: "button",
|
|
968
|
+
onClick: onClickSubmitDocumentAgain,
|
|
969
|
+
children: t(($) => $["submitIdDocumentsAgain"])
|
|
970
|
+
}
|
|
971
|
+
)
|
|
972
|
+
] })
|
|
973
|
+
] });
|
|
974
|
+
}
|
|
975
|
+
const logger$5 = createLogger();
|
|
976
|
+
function IdDocumentInstantVerification(props) {
|
|
977
|
+
const { data, minimumApplicantDetails, legalEntityId, handleOnBack, handleFieldChange } = props;
|
|
978
|
+
const { i18n } = useI18nContext();
|
|
979
|
+
const handleIdVerificationComplete = (onfidoResult) => {
|
|
980
|
+
handleFieldChange?.("instantIdVerificationData")(onfidoResult);
|
|
981
|
+
handleFieldChange?.("idDocumentType")(onfidoResult.document_front?.type);
|
|
982
|
+
};
|
|
983
|
+
const onClickSubmitDocumentAgain = () => {
|
|
984
|
+
handleFieldChange?.("instantIdVerificationData")(null);
|
|
985
|
+
handleFieldChange?.("idDocumentType")(null);
|
|
986
|
+
};
|
|
987
|
+
const isAlreadyUploaded = !!data?.idDocumentType || !!data?.instantIdVerificationData;
|
|
988
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual-document-upload adyen-kyc-individual-document-upload--idDocument", children: isAlreadyUploaded ? /* @__PURE__ */ jsx(IdDocumentAlreadyUpload, { onClickSubmitDocumentAgain }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
989
|
+
minimumApplicantDetails && /* @__PURE__ */ jsx(
|
|
990
|
+
IdVerification,
|
|
991
|
+
{
|
|
992
|
+
minimumApplicantDetails,
|
|
993
|
+
legalEntityId,
|
|
994
|
+
onIdVerificationComplete: handleIdVerificationComplete,
|
|
995
|
+
onIdVerificationError: logger$5.error
|
|
996
|
+
}
|
|
997
|
+
),
|
|
998
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
|
|
999
|
+
i18n.get("canNotCompleteInstantVerification"),
|
|
1000
|
+
" ",
|
|
1001
|
+
/* @__PURE__ */ jsx(
|
|
1002
|
+
"button",
|
|
1003
|
+
{
|
|
1004
|
+
className: "adyen-kyc-link",
|
|
1005
|
+
title: i18n.get("goBackAndProvideDocumentScans"),
|
|
1006
|
+
type: "button",
|
|
1007
|
+
onClick: () => {
|
|
1008
|
+
handleOnBack?.();
|
|
1009
|
+
},
|
|
1010
|
+
children: i18n.get("goBackAndProvideDocumentScans")
|
|
1011
|
+
}
|
|
1012
|
+
)
|
|
1013
|
+
] })
|
|
1014
|
+
] }) });
|
|
1015
|
+
}
|
|
1016
|
+
function IdDocumentUpload(props) {
|
|
1017
|
+
const { idVerificationMethodSelected, minimumApplicantDetails, legalEntityId, country } = props;
|
|
1018
|
+
const { data: providerStatus } = useProviderStatus({
|
|
1019
|
+
providers: ["idDocument"],
|
|
1020
|
+
country
|
|
1021
|
+
});
|
|
1022
|
+
return idVerificationMethodSelected === "instantVerification" && providerStatus?.statuses.idDocument.enabled ? /* @__PURE__ */ jsx(
|
|
1023
|
+
IdDocumentInstantVerification,
|
|
1024
|
+
{
|
|
1025
|
+
...props,
|
|
1026
|
+
minimumApplicantDetails,
|
|
1027
|
+
legalEntityId
|
|
1028
|
+
}
|
|
1029
|
+
) : /* @__PURE__ */ jsx(IdDocumentManualUpload, { ...props });
|
|
1030
|
+
}
|
|
1031
|
+
const idVerificationMethods = ["instantVerification", "manualVerification"];
|
|
1032
|
+
const instantIdVerificationMethods = ["instantVerification"];
|
|
1033
|
+
const instantVerificationImage = lazy(
|
|
1034
|
+
() => import("./id-verification-instant-BUVBO4R3.js")
|
|
1035
|
+
);
|
|
1036
|
+
const manualVerificationImage = lazy(
|
|
1037
|
+
() => import("./id-verification-manual-B3YZALYU.js")
|
|
1038
|
+
);
|
|
1039
|
+
const methodsMetadata = {
|
|
1040
|
+
instantVerification: {
|
|
1041
|
+
name: "instantVerification",
|
|
1042
|
+
description: "instantIDVerificationDescription",
|
|
1043
|
+
svgImport: instantVerificationImage,
|
|
1044
|
+
provider: {
|
|
1045
|
+
name: "Onfido",
|
|
1046
|
+
svgName: `onfido-logo`
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
manualVerification: {
|
|
1050
|
+
name: "manualUpload",
|
|
1051
|
+
description: "manualIDVerificationDescription",
|
|
1052
|
+
svgImport: manualVerificationImage
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
const IdVerificationMethodOptionIcon = ({
|
|
1056
|
+
method
|
|
1057
|
+
}) => {
|
|
1058
|
+
const { svgImport } = methodsMetadata[method];
|
|
1059
|
+
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-radio-group-card__illustration", children: [
|
|
1060
|
+
/* @__PURE__ */ jsx(Image, { lazyLoadedImage: svgImport }),
|
|
1061
|
+
";"
|
|
1062
|
+
] });
|
|
1063
|
+
};
|
|
1064
|
+
const IdVerificationMethodOptionFooter = ({
|
|
1065
|
+
method
|
|
1066
|
+
}) => {
|
|
1067
|
+
const { t } = useTranslation("common");
|
|
1068
|
+
const { provider } = methodsMetadata[method];
|
|
1069
|
+
return provider ? /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "adyen-kyc-field-verification-methods__footer", children: [
|
|
1070
|
+
t(($) => $["poweredBy"]),
|
|
1071
|
+
/* @__PURE__ */ jsx(
|
|
1072
|
+
Icon,
|
|
1073
|
+
{
|
|
1074
|
+
className: "adyen-kyc-field-verification-methods__logo",
|
|
1075
|
+
name: provider.svgName,
|
|
1076
|
+
title: provider.name
|
|
1077
|
+
}
|
|
1078
|
+
)
|
|
1079
|
+
] }) : null;
|
|
1080
|
+
};
|
|
1081
|
+
function IdVerificationMethod$1(props) {
|
|
1082
|
+
const {
|
|
1083
|
+
data,
|
|
1084
|
+
fieldValidationErrors,
|
|
1085
|
+
formVerificationErrors,
|
|
1086
|
+
name,
|
|
1087
|
+
countryOfResidence,
|
|
1088
|
+
handleFieldChange,
|
|
1089
|
+
errors
|
|
1090
|
+
} = props;
|
|
1091
|
+
const { t } = useTranslation(["individual"]);
|
|
1092
|
+
const { t: commonT } = useTranslation("common");
|
|
1093
|
+
if (!handleFieldChange) {
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
const formUtils = createFormUtils(props, commonT);
|
|
1097
|
+
const allowedIdVerificationMethods = showIndividualMotionCapture.value ? instantIdVerificationMethods : idVerificationMethods;
|
|
1098
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-verification-method", children: [
|
|
1099
|
+
/* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $["verifyIndividualIdentity"], { name }) }),
|
|
1100
|
+
/* @__PURE__ */ jsx(
|
|
1101
|
+
ErrorPanel,
|
|
1102
|
+
{
|
|
1103
|
+
verificationErrors: formVerificationErrors,
|
|
1104
|
+
validationErrors: fieldValidationErrors,
|
|
1105
|
+
formUtils,
|
|
1106
|
+
id: "ariaErrorField"
|
|
1107
|
+
}
|
|
1108
|
+
),
|
|
1109
|
+
/* @__PURE__ */ jsx(
|
|
1110
|
+
Field,
|
|
1111
|
+
{
|
|
1112
|
+
el: "fieldset",
|
|
1113
|
+
name: "verificationMethods",
|
|
1114
|
+
errorMessage: formUtils.getErrorMessage(
|
|
1115
|
+
"idVerificationMethod",
|
|
1116
|
+
errors,
|
|
1117
|
+
fieldValidationErrors
|
|
1118
|
+
),
|
|
1119
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1120
|
+
RadioGroupCard,
|
|
1121
|
+
{
|
|
1122
|
+
...childProps,
|
|
1123
|
+
name: "idVerificationMethod",
|
|
1124
|
+
options: allowedIdVerificationMethods,
|
|
1125
|
+
onSelect: handleFieldChange("idVerificationMethod"),
|
|
1126
|
+
selected: data?.idVerificationMethod,
|
|
1127
|
+
optionId: (method) => method,
|
|
1128
|
+
optionName: (method) => methodsMetadata[method].name,
|
|
1129
|
+
optionDescription: (method) => methodsMetadata[method].description,
|
|
1130
|
+
className: "adyen-kyc-field-verification-methods",
|
|
1131
|
+
optionClassNames: () => ({
|
|
1132
|
+
label: "adyen-kyc-field-verification-methods__card"
|
|
1133
|
+
}),
|
|
1134
|
+
renderOptionIcon: (method) => /* @__PURE__ */ jsx(IdVerificationMethodOptionIcon, { method }),
|
|
1135
|
+
renderOptionFooter: (method) => /* @__PURE__ */ jsx(IdVerificationMethodOptionFooter, { method }),
|
|
1136
|
+
floatingRadio: true
|
|
1137
|
+
}
|
|
1138
|
+
)
|
|
1139
|
+
}
|
|
1140
|
+
),
|
|
1141
|
+
/* @__PURE__ */ jsx(
|
|
1142
|
+
ContextGuidance,
|
|
1143
|
+
{
|
|
1144
|
+
title: t(($) => $["howVerificationWithOnfidoWork"]),
|
|
1145
|
+
content: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1146
|
+
/* @__PURE__ */ jsx(Typography, { className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $["onfidoIsOurTrustedPartner"]) }),
|
|
1147
|
+
/* @__PURE__ */ jsxs("ul", { children: [
|
|
1148
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["usePhoneToScanId"]) }),
|
|
1149
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["onfidoWillGiveFeedbackInRealTime"]) }),
|
|
1150
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["theIdCheckWillBeAutomaticallyValidated"]) })
|
|
1151
|
+
] }),
|
|
1152
|
+
/* @__PURE__ */ jsx(Typography, { className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $["adyenKeepsDataAsLongAsLegallyRequired"]) }),
|
|
1153
|
+
/* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/policies-and-disclaimer/privacy-policy", external: true, children: commonT(($) => $["adyenPrivacyPolicy"]) })
|
|
1154
|
+
] }),
|
|
1155
|
+
titleId: "howVerificationWithOnfidoWork",
|
|
1156
|
+
contentId: "howVerificationWithOnfidoWorkContent"
|
|
1157
|
+
}
|
|
1158
|
+
),
|
|
1159
|
+
(countryOfResidence === CountryCodes.PuertoRico || countryOfResidence === CountryCodes.UnitedStates) && data?.idVerificationMethod === "instantVerification" && /* @__PURE__ */ jsx(
|
|
1160
|
+
Trans,
|
|
1161
|
+
{
|
|
1162
|
+
t,
|
|
1163
|
+
ns: "individual",
|
|
1164
|
+
i18nKey: ($) => $["byProceedingToTheNextStepYouConfirmThatYouHaveReadUnderstandAndAcceptTheTerms"],
|
|
1165
|
+
components: {
|
|
1166
|
+
el1: /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: "text" }),
|
|
1167
|
+
el2: /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true, children: "text" })
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
)
|
|
1171
|
+
] }) });
|
|
1172
|
+
}
|
|
1173
|
+
function IndividualIdNumberTypeSelector({
|
|
1174
|
+
country,
|
|
1175
|
+
selected,
|
|
1176
|
+
handleFieldChange
|
|
1177
|
+
}) {
|
|
1178
|
+
const { t } = useTranslation("common");
|
|
1179
|
+
const options2 = useMemo(
|
|
1180
|
+
() => individualIdNumberOptions[country] ?? [],
|
|
1181
|
+
[country]
|
|
1182
|
+
);
|
|
1183
|
+
useEffect(() => {
|
|
1184
|
+
if (!selected && options2.length > 0) {
|
|
1185
|
+
handleFieldChange(options2[0].id);
|
|
1186
|
+
}
|
|
1187
|
+
}, [options2, selected, handleFieldChange]);
|
|
1188
|
+
if (options2.length <= 1) return null;
|
|
1189
|
+
return /* @__PURE__ */ jsx(
|
|
1190
|
+
Field,
|
|
1191
|
+
{
|
|
1192
|
+
el: "fieldset",
|
|
1193
|
+
name: "individualIdNumberType",
|
|
1194
|
+
label: t(($) => $["whichTypeOfIdNumberDoYouHave"]),
|
|
1195
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1196
|
+
RadioGroup,
|
|
1197
|
+
{
|
|
1198
|
+
...childProps,
|
|
1199
|
+
name: "individualIdNumberType",
|
|
1200
|
+
items: options2,
|
|
1201
|
+
value: selected,
|
|
1202
|
+
onChange: (value) => handleFieldChange(value)
|
|
1203
|
+
}
|
|
1204
|
+
)
|
|
1205
|
+
}
|
|
1206
|
+
);
|
|
1207
|
+
}
|
|
1208
|
+
const PatriotActDisclosure = () => {
|
|
1209
|
+
const { t } = useTranslation("common");
|
|
1210
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-margin-bottom-12", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: t(($) => $["toHelpTheGovernmentFight"]) }) });
|
|
1211
|
+
};
|
|
1212
|
+
const decisionMakerRoleFields = ["role"];
|
|
1213
|
+
const DecisionMakerRole = (props) => {
|
|
1214
|
+
const {
|
|
1215
|
+
data,
|
|
1216
|
+
fieldValidationErrors,
|
|
1217
|
+
allowedRoles,
|
|
1218
|
+
trustedRoles = [],
|
|
1219
|
+
handleFieldChange,
|
|
1220
|
+
valid,
|
|
1221
|
+
errors
|
|
1222
|
+
} = props;
|
|
1223
|
+
const { t } = useTranslation("common");
|
|
1224
|
+
const formUtils = createFormUtils(props, t);
|
|
1225
|
+
const changeRoles = (roles) => {
|
|
1226
|
+
handleFieldChange?.("role", "input")(roles);
|
|
1227
|
+
};
|
|
1228
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field__role", children: formUtils.isRequiredField("role", false) && /* @__PURE__ */ jsx(
|
|
1229
|
+
Field,
|
|
1230
|
+
{
|
|
1231
|
+
el: "fieldset",
|
|
1232
|
+
name: "role",
|
|
1233
|
+
label: formUtils.getLabel("role", "selectAllTheRolesThatThisDecisionMakerHolds"),
|
|
1234
|
+
errorMessage: formUtils.getErrorMessage("role", errors, fieldValidationErrors),
|
|
1235
|
+
isValid: valid?.role,
|
|
1236
|
+
showErrorIconBottom: true,
|
|
1237
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1238
|
+
MultiSelectList,
|
|
1239
|
+
{
|
|
1240
|
+
...childProps,
|
|
1241
|
+
options: allowedRoles ?? [],
|
|
1242
|
+
selected: data?.role ?? [],
|
|
1243
|
+
onSelect: changeRoles,
|
|
1244
|
+
mapToSelectItem: (role) => ({
|
|
1245
|
+
...makeSelectItemForRole(role, t),
|
|
1246
|
+
disabled: allowedRoles && !allowedRoles.includes(role) || trustedRoles.includes(role)
|
|
1247
|
+
})
|
|
1248
|
+
}
|
|
1249
|
+
)
|
|
1250
|
+
}
|
|
1251
|
+
) });
|
|
1252
|
+
};
|
|
1253
|
+
const nomineeFields = [
|
|
1254
|
+
"nomineeDirector",
|
|
1255
|
+
"nomineeShareholder"
|
|
1256
|
+
];
|
|
1257
|
+
const NomineeRadioIds = {
|
|
1258
|
+
YES: "Yes",
|
|
1259
|
+
NO: "No"
|
|
1260
|
+
};
|
|
1261
|
+
const nomineeRadioItems = [
|
|
1262
|
+
{
|
|
1263
|
+
id: NomineeRadioIds.YES,
|
|
1264
|
+
name: "yes"
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
id: NomineeRadioIds.NO,
|
|
1268
|
+
name: "no"
|
|
1269
|
+
}
|
|
1270
|
+
];
|
|
1271
|
+
const NomineeDecisionMakerRole = (props) => {
|
|
1272
|
+
const { data, fieldValidationErrors, errors, handleFieldChange, valid } = props;
|
|
1273
|
+
const { t } = useTranslation("individual");
|
|
1274
|
+
const { t: commonT } = useTranslation("common");
|
|
1275
|
+
const formUtils = createFormUtils(props, commonT);
|
|
1276
|
+
if (!handleFieldChange) {
|
|
1277
|
+
return;
|
|
1278
|
+
}
|
|
1279
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1280
|
+
formUtils.isRequiredField("nomineeShareholder") && /* @__PURE__ */ jsx(
|
|
1281
|
+
Field,
|
|
1282
|
+
{
|
|
1283
|
+
el: "fieldset",
|
|
1284
|
+
name: "nomineeShareholder",
|
|
1285
|
+
classNameModifiers: ["nominee"],
|
|
1286
|
+
label: formUtils.getLabel("nomineeShareholder", "isThisPersonANomineeShareholder"),
|
|
1287
|
+
errorMessage: formUtils.getErrorMessage(
|
|
1288
|
+
"nomineeShareholder",
|
|
1289
|
+
errors,
|
|
1290
|
+
fieldValidationErrors
|
|
1291
|
+
),
|
|
1292
|
+
helper: t(($) => $["aNomineeShareholderHoldsShares"]),
|
|
1293
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1294
|
+
RadioGroup,
|
|
1295
|
+
{
|
|
1296
|
+
...childProps,
|
|
1297
|
+
name: "nomineeShareholder",
|
|
1298
|
+
items: nomineeRadioItems,
|
|
1299
|
+
value: data?.nomineeShareholder,
|
|
1300
|
+
disabled: false,
|
|
1301
|
+
onChange: handleFieldChange("nomineeShareholder"),
|
|
1302
|
+
"aria-required": true,
|
|
1303
|
+
"aria-invalid": !valid?.nomineeShareholder
|
|
1304
|
+
}
|
|
1305
|
+
)
|
|
1306
|
+
}
|
|
1307
|
+
),
|
|
1308
|
+
formUtils.isRequiredField("nomineeDirector") && /* @__PURE__ */ jsx(
|
|
1309
|
+
Field,
|
|
1310
|
+
{
|
|
1311
|
+
el: "fieldset",
|
|
1312
|
+
name: "nomineeDirector",
|
|
1313
|
+
classNameModifiers: ["nominee"],
|
|
1314
|
+
label: formUtils.getLabel("nomineeDirector", "isThisPersonANomineeDirector"),
|
|
1315
|
+
errorMessage: formUtils.getErrorMessage("nomineeDirector", errors, fieldValidationErrors),
|
|
1316
|
+
helper: t(($) => $["aNomineeDirectorIsAppointed"]),
|
|
1317
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1318
|
+
RadioGroup,
|
|
1319
|
+
{
|
|
1320
|
+
...childProps,
|
|
1321
|
+
name: "nomineeDirector",
|
|
1322
|
+
items: nomineeRadioItems,
|
|
1323
|
+
value: data?.nomineeDirector,
|
|
1324
|
+
disabled: false,
|
|
1325
|
+
onChange: handleFieldChange("nomineeDirector"),
|
|
1326
|
+
"aria-required": true,
|
|
1327
|
+
"aria-invalid": !valid?.nomineeDirector
|
|
1328
|
+
}
|
|
1329
|
+
)
|
|
1330
|
+
}
|
|
1331
|
+
)
|
|
1332
|
+
] });
|
|
1333
|
+
};
|
|
1334
|
+
const idNumberFields = ["idNumber", "idNumberExempt"];
|
|
1335
|
+
function IdentityNumber(props) {
|
|
1336
|
+
const { t } = useTranslation("common");
|
|
1337
|
+
const {
|
|
1338
|
+
country,
|
|
1339
|
+
data,
|
|
1340
|
+
errors,
|
|
1341
|
+
fieldValidationErrors,
|
|
1342
|
+
idNumberType,
|
|
1343
|
+
obscuredFields,
|
|
1344
|
+
requiredFields,
|
|
1345
|
+
optionalFields,
|
|
1346
|
+
fieldConfig: propFieldConfig,
|
|
1347
|
+
readOnlyFields,
|
|
1348
|
+
handleFieldChange,
|
|
1349
|
+
valid
|
|
1350
|
+
} = props;
|
|
1351
|
+
if (!handleFieldChange) {
|
|
1352
|
+
return;
|
|
1353
|
+
}
|
|
1354
|
+
const fieldConfig2 = propFieldConfig ?? defaultFieldConfig;
|
|
1355
|
+
const metadata = resolveFieldMetadata(
|
|
1356
|
+
fieldConfig2[country],
|
|
1357
|
+
{ idNumberType },
|
|
1358
|
+
defaultFieldMetadata
|
|
1359
|
+
);
|
|
1360
|
+
const idNumberExemptMetadata = resolveFieldMetadata(
|
|
1361
|
+
idNumberExemptDefaultConfig[country],
|
|
1362
|
+
{},
|
|
1363
|
+
idNumberExemptDefaultMetadata
|
|
1364
|
+
);
|
|
1365
|
+
const mergedProps = mergeFieldMetadataIntoProps(
|
|
1366
|
+
"idNumberExempt",
|
|
1367
|
+
idNumberExemptMetadata,
|
|
1368
|
+
mergeFieldMetadataIntoProps("idNumber", metadata, {
|
|
1369
|
+
requiredFields,
|
|
1370
|
+
optionalFields,
|
|
1371
|
+
obscuredFields,
|
|
1372
|
+
readOnlyFields
|
|
1373
|
+
})
|
|
1374
|
+
);
|
|
1375
|
+
const formUtils = createFormUtils(mergedProps, t);
|
|
1376
|
+
const errorMessage = formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors);
|
|
1377
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field__id-number", children: formUtils.isVisibleField("idNumber") && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1378
|
+
/* @__PURE__ */ jsx(
|
|
1379
|
+
MaskedInput,
|
|
1380
|
+
{
|
|
1381
|
+
name: "idNumber",
|
|
1382
|
+
type: "text",
|
|
1383
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
1384
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
1385
|
+
errorMessage,
|
|
1386
|
+
shouldValidate: errors?.idNumber?.hasError,
|
|
1387
|
+
isValid: !!valid?.idNumber,
|
|
1388
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
1389
|
+
"aria-invalid": !valid?.idNumber,
|
|
1390
|
+
disabled: data?.idNumberExempt,
|
|
1391
|
+
onBlur: handleFieldChange("idNumber", "blur"),
|
|
1392
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
1393
|
+
value: data?.idNumberExempt ? "" : data?.idNumber ?? "",
|
|
1394
|
+
onInput: (e) => {
|
|
1395
|
+
handleFieldChange("idNumber", "input")(e);
|
|
1396
|
+
handleFieldChange("idNumberExempt", "input")(false);
|
|
1397
|
+
},
|
|
1398
|
+
acceptObscuredValue: formUtils?.isObscured("idNumber"),
|
|
1399
|
+
...formUtils.getMask("idNumber")
|
|
1400
|
+
}
|
|
1401
|
+
),
|
|
1402
|
+
/* @__PURE__ */ jsx(Field, { name: "idNumberExempt", children: (childProps) => formUtils.isVisibleField("idNumberExempt") && /* @__PURE__ */ jsx(
|
|
1403
|
+
Checkbox,
|
|
1404
|
+
{
|
|
1405
|
+
...childProps,
|
|
1406
|
+
label: formUtils.getLabel("idNumberExempt"),
|
|
1407
|
+
checked: Boolean(data?.idNumberExempt),
|
|
1408
|
+
name: "idNumberExempt",
|
|
1409
|
+
onChange: handleFieldChange("idNumberExempt")
|
|
1410
|
+
}
|
|
1411
|
+
) })
|
|
1412
|
+
] }) });
|
|
1413
|
+
}
|
|
1414
|
+
function NameFields(props) {
|
|
1415
|
+
const { formProps, fieldConfigs } = props;
|
|
1416
|
+
const { t } = useTranslation("common");
|
|
1417
|
+
const { data, handleFieldChange, errors, fieldValidationErrors } = formProps;
|
|
1418
|
+
if (!handleFieldChange) {
|
|
1419
|
+
return;
|
|
1420
|
+
}
|
|
1421
|
+
const formUtils = createFormUtils(formProps, t);
|
|
1422
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: fieldConfigs.map(
|
|
1423
|
+
({ name, isValid, label, helper }) => formUtils.isRequiredField(name) && /* @__PURE__ */ jsx(
|
|
1424
|
+
Field,
|
|
1425
|
+
{
|
|
1426
|
+
name,
|
|
1427
|
+
label: formUtils.getLabel(label),
|
|
1428
|
+
errorMessage: formUtils.getErrorMessage(name, errors, fieldValidationErrors),
|
|
1429
|
+
isValid,
|
|
1430
|
+
helper: helper && formUtils.getLabel(helper),
|
|
1431
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1432
|
+
InputText,
|
|
1433
|
+
{
|
|
1434
|
+
...childProps,
|
|
1435
|
+
name,
|
|
1436
|
+
value: data?.[name],
|
|
1437
|
+
readonly: formUtils.isReadOnly(name),
|
|
1438
|
+
onInput: handleFieldChange(name, "input"),
|
|
1439
|
+
onBlur: handleFieldChange(name, "blur"),
|
|
1440
|
+
trimOnBlur: true,
|
|
1441
|
+
spellCheck: false,
|
|
1442
|
+
"aria-required": true,
|
|
1443
|
+
"aria-invalid": !isValid
|
|
1444
|
+
}
|
|
1445
|
+
)
|
|
1446
|
+
},
|
|
1447
|
+
name
|
|
1448
|
+
)
|
|
1449
|
+
) });
|
|
1450
|
+
}
|
|
1451
|
+
const jaHaniNameFields = [
|
|
1452
|
+
"jaHaniFirstName",
|
|
1453
|
+
"jaHaniLastName"
|
|
1454
|
+
];
|
|
1455
|
+
const jaKanaNameFields = [
|
|
1456
|
+
"jaKanaFirstName",
|
|
1457
|
+
"jaKanaLastName"
|
|
1458
|
+
];
|
|
1459
|
+
const LocalizedNameFields = (props) => {
|
|
1460
|
+
const { errors, id, handleFieldChange, country } = props;
|
|
1461
|
+
const jaHaniNameProps = getFieldProps(props, jaHaniNameFields);
|
|
1462
|
+
const jaKanaNameProps = getFieldProps(props, jaKanaNameFields);
|
|
1463
|
+
const nameProps = getFieldProps(props, nameFields);
|
|
1464
|
+
if (country === CountryCodes.Japan) {
|
|
1465
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1466
|
+
!!jaHaniNameProps?.requiredFields?.length && /* @__PURE__ */ jsx(
|
|
1467
|
+
NameFields,
|
|
1468
|
+
{
|
|
1469
|
+
fieldConfigs: [
|
|
1470
|
+
{
|
|
1471
|
+
name: "jaHaniLastName",
|
|
1472
|
+
label: "jaHaniLastName",
|
|
1473
|
+
isValid: jaHaniNameProps.valid?.jaHaniLastName
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
name: "jaHaniFirstName",
|
|
1477
|
+
label: "jaHaniFirstName",
|
|
1478
|
+
isValid: jaHaniNameProps.valid?.jaHaniFirstName
|
|
1479
|
+
}
|
|
1480
|
+
],
|
|
1481
|
+
formProps: {
|
|
1482
|
+
...jaHaniNameProps,
|
|
1483
|
+
dataStoreId: id,
|
|
1484
|
+
errors,
|
|
1485
|
+
handleFieldChange
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
),
|
|
1489
|
+
!!jaKanaNameProps?.requiredFields?.length && /* @__PURE__ */ jsx(
|
|
1490
|
+
NameFields,
|
|
1491
|
+
{
|
|
1492
|
+
fieldConfigs: [
|
|
1493
|
+
{
|
|
1494
|
+
name: "jaKanaLastName",
|
|
1495
|
+
label: "jaKanaLastName",
|
|
1496
|
+
isValid: jaKanaNameProps.valid?.jaKanaLastName
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
name: "jaKanaFirstName",
|
|
1500
|
+
label: "jaKanaFirstName",
|
|
1501
|
+
isValid: jaKanaNameProps.valid?.jaKanaFirstName
|
|
1502
|
+
}
|
|
1503
|
+
],
|
|
1504
|
+
formProps: {
|
|
1505
|
+
...jaKanaNameProps,
|
|
1506
|
+
dataStoreId: id,
|
|
1507
|
+
errors,
|
|
1508
|
+
handleFieldChange
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
),
|
|
1512
|
+
!!nameProps?.requiredFields?.length && /* @__PURE__ */ jsx(
|
|
1513
|
+
NameFields,
|
|
1514
|
+
{
|
|
1515
|
+
fieldConfigs: [
|
|
1516
|
+
{
|
|
1517
|
+
name: "lastName",
|
|
1518
|
+
label: "lastName__JP",
|
|
1519
|
+
isValid: nameProps.valid?.lastName
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
name: "firstName",
|
|
1523
|
+
label: "firstName__JP",
|
|
1524
|
+
isValid: nameProps.valid?.firstName
|
|
1525
|
+
}
|
|
1526
|
+
],
|
|
1527
|
+
formProps: {
|
|
1528
|
+
...nameProps,
|
|
1529
|
+
dataStoreId: id,
|
|
1530
|
+
errors,
|
|
1531
|
+
handleFieldChange
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
)
|
|
1535
|
+
] });
|
|
1536
|
+
}
|
|
1537
|
+
return /* @__PURE__ */ jsx(Name, { ...nameProps, dataStoreId: id, errors, handleFieldChange });
|
|
1538
|
+
};
|
|
1539
|
+
const isDecisionMakerTask = (taskType) => taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
|
|
1540
|
+
const DriversLicense = ({
|
|
1541
|
+
country,
|
|
1542
|
+
driversLicense,
|
|
1543
|
+
onIssuerStateChange,
|
|
1544
|
+
onLicenseNumberInput,
|
|
1545
|
+
onLicenseNumberBlur,
|
|
1546
|
+
onCardNumberInput,
|
|
1547
|
+
onCardNumberBlur,
|
|
1548
|
+
formUtils,
|
|
1549
|
+
isValid,
|
|
1550
|
+
errorMessages,
|
|
1551
|
+
shouldValidate
|
|
1552
|
+
}) => {
|
|
1553
|
+
const { i18n } = useI18nContext();
|
|
1554
|
+
const { dataset: auStates } = useDataset(datasetIdentifier.state("AU"));
|
|
1555
|
+
const isCountryAustralia = country === CountryCodes.Australia;
|
|
1556
|
+
const isCountryNewZealand = country === CountryCodes.NewZealand;
|
|
1557
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1558
|
+
isCountryAustralia && onIssuerStateChange !== void 0 && /* @__PURE__ */ jsx(
|
|
1559
|
+
Field,
|
|
1560
|
+
{
|
|
1561
|
+
name: "issuerState",
|
|
1562
|
+
label: formUtils.getLabel("issuerState"),
|
|
1563
|
+
isValid: isValid.issuerState,
|
|
1564
|
+
errorMessage: errorMessages.issuerState,
|
|
1565
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1566
|
+
Select,
|
|
1567
|
+
{
|
|
1568
|
+
...childProps,
|
|
1569
|
+
name: "issuerState",
|
|
1570
|
+
onChange: onIssuerStateChange,
|
|
1571
|
+
isInvalid: false,
|
|
1572
|
+
items: auStates,
|
|
1573
|
+
placeholder: i18n.get("selectState"),
|
|
1574
|
+
selected: driversLicense.issuerState
|
|
1575
|
+
}
|
|
1576
|
+
)
|
|
1577
|
+
}
|
|
1578
|
+
),
|
|
1579
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field-wrapper", children: [
|
|
1580
|
+
/* @__PURE__ */ jsx(
|
|
1581
|
+
MaskedInput,
|
|
1582
|
+
{
|
|
1583
|
+
name: "idNumber",
|
|
1584
|
+
type: "text",
|
|
1585
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
1586
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
1587
|
+
errorMessage: errorMessages.idNumber,
|
|
1588
|
+
shouldValidate,
|
|
1589
|
+
isValid: Boolean(isValid.idNumber),
|
|
1590
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
1591
|
+
"aria-invalid": !isValid.idNumber,
|
|
1592
|
+
onBlur: onLicenseNumberBlur,
|
|
1593
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
1594
|
+
value: driversLicense.idNumber ?? "",
|
|
1595
|
+
onInput: onLicenseNumberInput,
|
|
1596
|
+
acceptObscuredValue: formUtils?.isObscured("idNumber"),
|
|
1597
|
+
...formUtils.getMask("idNumber")
|
|
1598
|
+
}
|
|
1599
|
+
),
|
|
1600
|
+
/* @__PURE__ */ jsx(
|
|
1601
|
+
MaskedInput,
|
|
1602
|
+
{
|
|
1603
|
+
name: "licenseCardNumber",
|
|
1604
|
+
type: "text",
|
|
1605
|
+
label: formUtils.getLabel("licenseCardNumber", "licenseCardNumber"),
|
|
1606
|
+
formatGuidance: formUtils.getGuidanceText("licenseCardNumber"),
|
|
1607
|
+
errorMessage: errorMessages.licenseCardNumber,
|
|
1608
|
+
shouldValidate,
|
|
1609
|
+
isValid: Boolean(isValid.licenseCardNumber),
|
|
1610
|
+
"aria-required": formUtils.isRequiredField("licenseCardNumber"),
|
|
1611
|
+
"aria-invalid": !isValid.licenseCardNumber,
|
|
1612
|
+
onBlur: onCardNumberBlur,
|
|
1613
|
+
readonly: formUtils.isReadOnly("licenseCardNumber"),
|
|
1614
|
+
value: driversLicense.licenseCardNumber ?? "",
|
|
1615
|
+
onInput: onCardNumberInput,
|
|
1616
|
+
acceptObscuredValue: formUtils?.isObscured("licenseCardNumber"),
|
|
1617
|
+
...formUtils.getMask("licenseCardNumber")
|
|
1618
|
+
}
|
|
1619
|
+
)
|
|
1620
|
+
] }),
|
|
1621
|
+
(isCountryAustralia || isCountryNewZealand) && /* @__PURE__ */ jsx(
|
|
1622
|
+
ContextGuidance,
|
|
1623
|
+
{
|
|
1624
|
+
title: i18n.get("whereCanIFindTheseNumbersOnMyDriversLicense"),
|
|
1625
|
+
content: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1626
|
+
isCountryAustralia ? `${i18n.get("whereToFindNumbersOnDriversLicense")} ` : `${i18n.get("whereToFindNumbersOnDriversLicense__NZ")} `,
|
|
1627
|
+
/* @__PURE__ */ jsx(
|
|
1628
|
+
Link,
|
|
1629
|
+
{
|
|
1630
|
+
href: isCountryAustralia ? "https://www.usi.gov.au/about/forms-id/drivers-licence" : "https://www.nzta.govt.nz/driver-licences/getting-a-licence/your-driver-licence-explained/",
|
|
1631
|
+
children: i18n.get("iStillCantFindIt")
|
|
1632
|
+
}
|
|
1633
|
+
)
|
|
1634
|
+
] }),
|
|
1635
|
+
titleId: "whereCanIFindTheseNumbersOnMyDriversLicense",
|
|
1636
|
+
contentId: "whereToFindNumbersOnDriversLicense"
|
|
1637
|
+
}
|
|
1638
|
+
)
|
|
1639
|
+
] });
|
|
1640
|
+
};
|
|
1641
|
+
const TypeOfIdentity$1 = ({
|
|
1642
|
+
availableIdentityTypesOptions,
|
|
1643
|
+
selectedIdentityType,
|
|
1644
|
+
setSelectedIdentityType,
|
|
1645
|
+
label,
|
|
1646
|
+
errorMessage,
|
|
1647
|
+
isValid
|
|
1648
|
+
}) => {
|
|
1649
|
+
const { i18n } = useI18nContext();
|
|
1650
|
+
return /* @__PURE__ */ jsx(
|
|
1651
|
+
Field,
|
|
1652
|
+
{
|
|
1653
|
+
name: "typeOfIdentity",
|
|
1654
|
+
label,
|
|
1655
|
+
errorMessage,
|
|
1656
|
+
isValid,
|
|
1657
|
+
helper: i18n.get("typeOfIdentitySubtitle"),
|
|
1658
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1659
|
+
Select,
|
|
1660
|
+
{
|
|
1661
|
+
...childProps,
|
|
1662
|
+
name: "typeOfIdentity",
|
|
1663
|
+
isInvalid: false,
|
|
1664
|
+
items: availableIdentityTypesOptions.map(({ id, name }) => ({
|
|
1665
|
+
id,
|
|
1666
|
+
name: i18n.get(name)
|
|
1667
|
+
})),
|
|
1668
|
+
placeholder: i18n.get("selectOne"),
|
|
1669
|
+
selected: selectedIdentityType,
|
|
1670
|
+
onChange: (event) => setSelectedIdentityType(event.target.value)
|
|
1671
|
+
}
|
|
1672
|
+
)
|
|
1673
|
+
}
|
|
1674
|
+
);
|
|
1675
|
+
};
|
|
1676
|
+
const auIdentityValidationRules = {
|
|
1677
|
+
typeOfIdentity: [isTruthyValidator],
|
|
1678
|
+
issuerState: [isTruthyValidator]
|
|
1679
|
+
};
|
|
1680
|
+
const licenseCardNumberMetaData$1 = resolveFieldMetadata(
|
|
1681
|
+
licenseCardNumberDefaultConfig[CountryCodes.Australia],
|
|
1682
|
+
{},
|
|
1683
|
+
licenseCardNumberDefaultMetadata
|
|
1684
|
+
);
|
|
1685
|
+
function IdentityAu({
|
|
1686
|
+
labels,
|
|
1687
|
+
data,
|
|
1688
|
+
placeholders,
|
|
1689
|
+
helperText,
|
|
1690
|
+
requiredFields,
|
|
1691
|
+
readOnlyFields,
|
|
1692
|
+
optionalFields,
|
|
1693
|
+
obscuredFields,
|
|
1694
|
+
shouldValidate,
|
|
1695
|
+
fieldValidationErrors,
|
|
1696
|
+
handleFieldChange,
|
|
1697
|
+
validators,
|
|
1698
|
+
valid,
|
|
1699
|
+
errors
|
|
1700
|
+
}) {
|
|
1701
|
+
const initialFormUtilProps = {
|
|
1702
|
+
validators: {
|
|
1703
|
+
...auIdentityValidationRules,
|
|
1704
|
+
...validators
|
|
1705
|
+
},
|
|
1706
|
+
labels,
|
|
1707
|
+
obscuredFields,
|
|
1708
|
+
placeholders,
|
|
1709
|
+
helperText,
|
|
1710
|
+
readOnlyFields,
|
|
1711
|
+
optionalFields,
|
|
1712
|
+
requiredFields
|
|
1713
|
+
};
|
|
1714
|
+
const mergedProps = useMemo(() => {
|
|
1715
|
+
const idNumberMetadata = resolveFieldMetadata(
|
|
1716
|
+
defaultFieldConfig[CountryCodes.Australia],
|
|
1717
|
+
{ idNumberType: data?.typeOfIdentity },
|
|
1718
|
+
defaultFieldMetadata
|
|
1719
|
+
);
|
|
1720
|
+
return mergeFieldMetadataIntoProps(
|
|
1721
|
+
"idNumber",
|
|
1722
|
+
idNumberMetadata,
|
|
1723
|
+
mergeFieldMetadataIntoProps(
|
|
1724
|
+
"licenseCardNumber",
|
|
1725
|
+
licenseCardNumberMetaData$1,
|
|
1726
|
+
initialFormUtilProps
|
|
1727
|
+
)
|
|
1728
|
+
);
|
|
1729
|
+
}, [data?.typeOfIdentity]);
|
|
1730
|
+
const { t } = useTranslation("common");
|
|
1731
|
+
const formUtils = useMemo(() => createFormUtils(mergedProps, t), [mergedProps]);
|
|
1732
|
+
if (!handleFieldChange) {
|
|
1733
|
+
return;
|
|
1734
|
+
}
|
|
1735
|
+
if (data?.typeOfIdentity === "nationalIdNumber") {
|
|
1736
|
+
handleFieldChange("typeOfIdentity")(void 0);
|
|
1737
|
+
}
|
|
1738
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1739
|
+
/* @__PURE__ */ jsx(
|
|
1740
|
+
TypeOfIdentity$1,
|
|
1741
|
+
{
|
|
1742
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.AU,
|
|
1743
|
+
selectedIdentityType: data?.typeOfIdentity,
|
|
1744
|
+
setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
|
|
1745
|
+
label: formUtils.getLabel("typeOfIdentity"),
|
|
1746
|
+
isValid: Boolean(valid?.typeOfIdentity),
|
|
1747
|
+
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
|
|
1748
|
+
}
|
|
1749
|
+
),
|
|
1750
|
+
data?.typeOfIdentity === "passport" ? /* @__PURE__ */ jsx(
|
|
1751
|
+
MaskedInput,
|
|
1752
|
+
{
|
|
1753
|
+
name: "idNumber",
|
|
1754
|
+
type: "text",
|
|
1755
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
1756
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
1757
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
|
|
1758
|
+
shouldValidate,
|
|
1759
|
+
isValid: Boolean(valid?.idNumber),
|
|
1760
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
1761
|
+
"aria-invalid": !valid?.idNumber,
|
|
1762
|
+
onBlur: handleFieldChange("idNumber", "blur"),
|
|
1763
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
1764
|
+
value: data?.idNumber ?? "",
|
|
1765
|
+
onInput: handleFieldChange("idNumber", "input"),
|
|
1766
|
+
acceptObscuredValue: formUtils?.isObscured("idNumber"),
|
|
1767
|
+
...formUtils.getMask("idNumber")
|
|
1768
|
+
}
|
|
1769
|
+
) : data?.typeOfIdentity === "driversLicense" ? /* @__PURE__ */ jsx(
|
|
1770
|
+
DriversLicense,
|
|
1771
|
+
{
|
|
1772
|
+
country: CountryCodes.Australia,
|
|
1773
|
+
driversLicense: data,
|
|
1774
|
+
onIssuerStateChange: handleFieldChange("issuerState"),
|
|
1775
|
+
onLicenseNumberInput: handleFieldChange("idNumber", "input"),
|
|
1776
|
+
onLicenseNumberBlur: handleFieldChange("idNumber", "blur"),
|
|
1777
|
+
onCardNumberInput: handleFieldChange("licenseCardNumber", "input"),
|
|
1778
|
+
onCardNumberBlur: handleFieldChange("licenseCardNumber", "blur"),
|
|
1779
|
+
formUtils,
|
|
1780
|
+
isValid: {
|
|
1781
|
+
idNumber: Boolean(valid?.idNumber),
|
|
1782
|
+
licenseCardNumber: Boolean(valid?.licenseCardNumber),
|
|
1783
|
+
issuerState: Boolean(valid?.issuerState)
|
|
1784
|
+
},
|
|
1785
|
+
errorMessages: {
|
|
1786
|
+
idNumber: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
|
|
1787
|
+
licenseCardNumber: formUtils.getErrorMessage(
|
|
1788
|
+
"licenseCardNumber",
|
|
1789
|
+
errors,
|
|
1790
|
+
fieldValidationErrors
|
|
1791
|
+
),
|
|
1792
|
+
issuerState: formUtils.getErrorMessage("issuerState", errors, fieldValidationErrors)
|
|
1793
|
+
},
|
|
1794
|
+
shouldValidate
|
|
1795
|
+
}
|
|
1796
|
+
) : void 0
|
|
1797
|
+
] });
|
|
1798
|
+
}
|
|
1799
|
+
const identityValidationRules$1 = {
|
|
1800
|
+
typeOfIdentity: [isTruthyValidator]
|
|
1801
|
+
};
|
|
1802
|
+
function IdentityHK({
|
|
1803
|
+
labels,
|
|
1804
|
+
data,
|
|
1805
|
+
placeholders,
|
|
1806
|
+
helperText,
|
|
1807
|
+
requiredFields,
|
|
1808
|
+
readOnlyFields,
|
|
1809
|
+
optionalFields,
|
|
1810
|
+
obscuredFields,
|
|
1811
|
+
shouldValidate,
|
|
1812
|
+
fieldValidationErrors,
|
|
1813
|
+
handleFieldChange,
|
|
1814
|
+
validators,
|
|
1815
|
+
valid,
|
|
1816
|
+
errors
|
|
1817
|
+
}) {
|
|
1818
|
+
const [identityType, setIdentityType] = useState(
|
|
1819
|
+
data?.typeOfIdentity
|
|
1820
|
+
);
|
|
1821
|
+
if (data?.typeOfIdentity === "nationalIdNumber") {
|
|
1822
|
+
data.typeOfIdentity = void 0;
|
|
1823
|
+
}
|
|
1824
|
+
const initialFormUtilProps = {
|
|
1825
|
+
validators: {
|
|
1826
|
+
...identityValidationRules$1,
|
|
1827
|
+
...validators
|
|
1828
|
+
},
|
|
1829
|
+
labels,
|
|
1830
|
+
obscuredFields,
|
|
1831
|
+
placeholders,
|
|
1832
|
+
helperText,
|
|
1833
|
+
readOnlyFields,
|
|
1834
|
+
optionalFields,
|
|
1835
|
+
requiredFields
|
|
1836
|
+
};
|
|
1837
|
+
const mergedProps = useMemo(() => {
|
|
1838
|
+
const idNumberMetadata = resolveFieldMetadata(
|
|
1839
|
+
defaultFieldConfig[CountryCodes.HongKong],
|
|
1840
|
+
{
|
|
1841
|
+
idNumberType: identityType
|
|
1842
|
+
},
|
|
1843
|
+
defaultFieldMetadata
|
|
1844
|
+
);
|
|
1845
|
+
return mergeFieldMetadataIntoProps("idNumber", idNumberMetadata, initialFormUtilProps);
|
|
1846
|
+
}, [identityType]);
|
|
1847
|
+
useEffect(() => {
|
|
1848
|
+
if (data?.typeOfIdentity) {
|
|
1849
|
+
setIdentityType(data.typeOfIdentity);
|
|
1850
|
+
}
|
|
1851
|
+
}, [data?.typeOfIdentity]);
|
|
1852
|
+
const { t } = useTranslation("common");
|
|
1853
|
+
const formUtils = createFormUtils(mergedProps, t);
|
|
1854
|
+
if (!handleFieldChange) {
|
|
1855
|
+
return;
|
|
1856
|
+
}
|
|
1857
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1858
|
+
/* @__PURE__ */ jsx(
|
|
1859
|
+
TypeOfIdentity$1,
|
|
1860
|
+
{
|
|
1861
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.HK,
|
|
1862
|
+
selectedIdentityType: identityType,
|
|
1863
|
+
setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
|
|
1864
|
+
label: formUtils.getLabel("typeOfIdentity"),
|
|
1865
|
+
isValid: Boolean(valid?.typeOfIdentity),
|
|
1866
|
+
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
|
|
1867
|
+
}
|
|
1868
|
+
),
|
|
1869
|
+
/* @__PURE__ */ jsx(
|
|
1870
|
+
MaskedInput,
|
|
1871
|
+
{
|
|
1872
|
+
name: "idNumber",
|
|
1873
|
+
type: "text",
|
|
1874
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
1875
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
1876
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
|
|
1877
|
+
shouldValidate,
|
|
1878
|
+
isValid: Boolean(valid?.idNumber),
|
|
1879
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
1880
|
+
"aria-invalid": Boolean(!valid?.idNumber),
|
|
1881
|
+
onBlur: handleFieldChange("idNumber", "blur"),
|
|
1882
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
1883
|
+
value: data?.idNumber ?? "",
|
|
1884
|
+
onInput: handleFieldChange("idNumber", "input"),
|
|
1885
|
+
acceptObscuredValue: formUtils?.isObscured("idNumber"),
|
|
1886
|
+
...formUtils.getMask("idNumber")
|
|
1887
|
+
}
|
|
1888
|
+
)
|
|
1889
|
+
] });
|
|
1890
|
+
}
|
|
1891
|
+
const nzIdentityValidationRules = {
|
|
1892
|
+
typeOfIdentity: [isTruthyValidator]
|
|
1893
|
+
};
|
|
1894
|
+
const licenseCardNumberMetaData = resolveFieldMetadata(
|
|
1895
|
+
licenseCardNumberDefaultConfig[CountryCodes.NewZealand],
|
|
1896
|
+
{},
|
|
1897
|
+
licenseCardNumberDefaultMetadata
|
|
1898
|
+
);
|
|
1899
|
+
function IdentityNZ({
|
|
1900
|
+
labels,
|
|
1901
|
+
data,
|
|
1902
|
+
placeholders,
|
|
1903
|
+
helperText,
|
|
1904
|
+
requiredFields,
|
|
1905
|
+
readOnlyFields,
|
|
1906
|
+
optionalFields,
|
|
1907
|
+
obscuredFields,
|
|
1908
|
+
shouldValidate,
|
|
1909
|
+
fieldValidationErrors,
|
|
1910
|
+
handleFieldChange,
|
|
1911
|
+
validators,
|
|
1912
|
+
valid,
|
|
1913
|
+
errors
|
|
1914
|
+
}) {
|
|
1915
|
+
const [identityType, setIdentityType] = useState(
|
|
1916
|
+
data?.typeOfIdentity
|
|
1917
|
+
);
|
|
1918
|
+
if (data?.typeOfIdentity === "nationalIdNumber") {
|
|
1919
|
+
data.typeOfIdentity = void 0;
|
|
1920
|
+
}
|
|
1921
|
+
const initialFormUtilProps = {
|
|
1922
|
+
validators: {
|
|
1923
|
+
...nzIdentityValidationRules,
|
|
1924
|
+
...validators
|
|
1925
|
+
},
|
|
1926
|
+
labels,
|
|
1927
|
+
obscuredFields,
|
|
1928
|
+
placeholders,
|
|
1929
|
+
helperText,
|
|
1930
|
+
readOnlyFields,
|
|
1931
|
+
optionalFields,
|
|
1932
|
+
requiredFields
|
|
1933
|
+
};
|
|
1934
|
+
const mergedProps = useMemo(() => {
|
|
1935
|
+
const idNumberMetadata = resolveFieldMetadata(
|
|
1936
|
+
defaultFieldConfig[CountryCodes.NewZealand],
|
|
1937
|
+
{ idNumberType: identityType },
|
|
1938
|
+
defaultFieldMetadata
|
|
1939
|
+
);
|
|
1940
|
+
return mergeFieldMetadataIntoProps(
|
|
1941
|
+
"idNumber",
|
|
1942
|
+
idNumberMetadata,
|
|
1943
|
+
mergeFieldMetadataIntoProps(
|
|
1944
|
+
"licenseCardNumber",
|
|
1945
|
+
licenseCardNumberMetaData,
|
|
1946
|
+
initialFormUtilProps
|
|
1947
|
+
)
|
|
1948
|
+
);
|
|
1949
|
+
}, [identityType]);
|
|
1950
|
+
useEffect(() => {
|
|
1951
|
+
if (data?.typeOfIdentity) {
|
|
1952
|
+
setIdentityType(data.typeOfIdentity);
|
|
1953
|
+
}
|
|
1954
|
+
}, [data?.typeOfIdentity]);
|
|
1955
|
+
const { t } = useTranslation("common");
|
|
1956
|
+
const formUtils = createFormUtils(mergedProps, t);
|
|
1957
|
+
const today = /* @__PURE__ */ new Date();
|
|
1958
|
+
const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
|
|
1959
|
+
if (!handleFieldChange) {
|
|
1960
|
+
return;
|
|
1961
|
+
}
|
|
1962
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1963
|
+
/* @__PURE__ */ jsx(
|
|
1964
|
+
TypeOfIdentity$1,
|
|
1965
|
+
{
|
|
1966
|
+
availableIdentityTypesOptions: additionallIdNumberOptions.NZ,
|
|
1967
|
+
selectedIdentityType: identityType,
|
|
1968
|
+
setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
|
|
1969
|
+
label: formUtils.getLabel("typeOfIdentity"),
|
|
1970
|
+
isValid: !!valid?.typeOfIdentity,
|
|
1971
|
+
errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
|
|
1972
|
+
}
|
|
1973
|
+
),
|
|
1974
|
+
data?.typeOfIdentity === "passport" ? /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field-wrapper", children: [
|
|
1975
|
+
/* @__PURE__ */ jsx(
|
|
1976
|
+
MaskedInput,
|
|
1977
|
+
{
|
|
1978
|
+
name: "idNumber",
|
|
1979
|
+
type: "text",
|
|
1980
|
+
label: formUtils.getLabel("idNumber", "idNumber"),
|
|
1981
|
+
formatGuidance: formUtils.getGuidanceText("idNumber"),
|
|
1982
|
+
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
|
|
1983
|
+
shouldValidate,
|
|
1984
|
+
isValid: !!valid?.idNumber,
|
|
1985
|
+
"aria-required": formUtils.isRequiredField("idNumber"),
|
|
1986
|
+
"aria-invalid": !valid?.idNumber,
|
|
1987
|
+
onBlur: handleFieldChange("idNumber", "blur"),
|
|
1988
|
+
readonly: formUtils.isReadOnly("idNumber"),
|
|
1989
|
+
value: data?.idNumber ?? "",
|
|
1990
|
+
onInput: handleFieldChange("idNumber", "input"),
|
|
1991
|
+
acceptObscuredValue: formUtils?.isObscured("idNumber"),
|
|
1992
|
+
...formUtils.getMask("idNumber")
|
|
1993
|
+
}
|
|
1994
|
+
),
|
|
1995
|
+
/* @__PURE__ */ jsx(
|
|
1996
|
+
Field,
|
|
1997
|
+
{
|
|
1998
|
+
name: "expiryDate",
|
|
1999
|
+
label: formUtils.getLabel("passportExpiryDate"),
|
|
2000
|
+
errorMessage: formUtils.getErrorMessage("expiryDate", errors, fieldValidationErrors),
|
|
2001
|
+
isValid: valid?.expiryDate,
|
|
2002
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
2003
|
+
InputDate,
|
|
2004
|
+
{
|
|
2005
|
+
...childProps,
|
|
2006
|
+
name: "expiryDate",
|
|
2007
|
+
value: data?.expiryDate,
|
|
2008
|
+
placeholder: t(($) => $["datePlaceholder"]),
|
|
2009
|
+
readonly: formUtils.isReadOnly("expiryDate"),
|
|
2010
|
+
onInput: handleFieldChange("expiryDate", "input"),
|
|
2011
|
+
onBlur: handleFieldChange("expiryDate", "blur"),
|
|
2012
|
+
"aria-required": true,
|
|
2013
|
+
"aria-invalid": !valid?.expiryDate,
|
|
2014
|
+
min: formatDateObj(today),
|
|
2015
|
+
max: formatDateObj(maxExpiryDateSelection)
|
|
2016
|
+
}
|
|
2017
|
+
)
|
|
2018
|
+
}
|
|
2019
|
+
)
|
|
2020
|
+
] }) : data?.typeOfIdentity === "driversLicense" ? /* @__PURE__ */ jsx(
|
|
2021
|
+
DriversLicense,
|
|
2022
|
+
{
|
|
2023
|
+
country: CountryCodes.NewZealand,
|
|
2024
|
+
driversLicense: data,
|
|
2025
|
+
onLicenseNumberInput: handleFieldChange("idNumber", "input"),
|
|
2026
|
+
onLicenseNumberBlur: handleFieldChange("idNumber", "blur"),
|
|
2027
|
+
onCardNumberInput: handleFieldChange("licenseCardNumber", "input"),
|
|
2028
|
+
onCardNumberBlur: handleFieldChange("licenseCardNumber", "blur"),
|
|
2029
|
+
formUtils,
|
|
2030
|
+
isValid: {
|
|
2031
|
+
idNumber: Boolean(valid?.idNumber),
|
|
2032
|
+
licenseCardNumber: Boolean(valid?.licenseCardNumber)
|
|
2033
|
+
},
|
|
2034
|
+
errorMessages: {
|
|
2035
|
+
idNumber: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
|
|
2036
|
+
licenseCardNumber: formUtils.getErrorMessage(
|
|
2037
|
+
"licenseCardNumber",
|
|
2038
|
+
errors,
|
|
2039
|
+
fieldValidationErrors
|
|
2040
|
+
)
|
|
2041
|
+
},
|
|
2042
|
+
shouldValidate
|
|
2043
|
+
}
|
|
2044
|
+
) : void 0
|
|
2045
|
+
] });
|
|
2046
|
+
}
|
|
2047
|
+
const ERROR_CODES = {
|
|
2048
|
+
SSN_REMEDIATION: "1_316",
|
|
2049
|
+
SSN_4_DIGITS_VALIDATION: "1_3062",
|
|
2050
|
+
PERSONAL_DETAILS_VALIDATION: "1_30"
|
|
2051
|
+
};
|
|
2052
|
+
const getSSNType = (formVerifcationErrors, existingIdNumber) => {
|
|
2053
|
+
const individualDetailsError = formVerifcationErrors?.[ERROR_CODES.PERSONAL_DETAILS_VALIDATION];
|
|
2054
|
+
const fourDigitsValidationError = individualDetailsError?.[ERROR_CODES.SSN_4_DIGITS_VALIDATION]?.some((error) => error.code === ERROR_CODES.SSN_REMEDIATION);
|
|
2055
|
+
const ssnType = fourDigitsValidationError || existingIdNumber?.length === 9 ? "ssn" : "ssnLastFour";
|
|
2056
|
+
return ssnType;
|
|
2057
|
+
};
|
|
2058
|
+
const IdentityUS = forwardRef((props, ref) => {
|
|
2059
|
+
const { form } = useFormContext();
|
|
2060
|
+
const defaultIdNumber = form?.defaultData?.personalDetails?.idNumber;
|
|
2061
|
+
const ssnType = getSSNType(props.formVerificationErrors, defaultIdNumber);
|
|
2062
|
+
return /* @__PURE__ */ jsx(IdentityNumber, { ...props, idNumberType: ssnType, ref });
|
|
2063
|
+
});
|
|
2064
|
+
const additionalIdentityInfoFields$1 = [
|
|
2065
|
+
"typeOfIdentity",
|
|
2066
|
+
"licenseCardNumber",
|
|
2067
|
+
"issuerState",
|
|
2068
|
+
"expiryDate"
|
|
2069
|
+
];
|
|
2070
|
+
const identityFields = [
|
|
2071
|
+
...additionalIdentityInfoFields$1,
|
|
2072
|
+
"idNumber"
|
|
2073
|
+
];
|
|
2074
|
+
function Identity$1(props) {
|
|
2075
|
+
const { personalDetails, country, errors, idNumberType, handleFieldChange } = props;
|
|
2076
|
+
const identityProps = getFieldProps(personalDetails, idNumberFields);
|
|
2077
|
+
const { id: dataStoreId } = personalDetails;
|
|
2078
|
+
if (country === "US") {
|
|
2079
|
+
return /* @__PURE__ */ jsx(
|
|
2080
|
+
IdentityUS,
|
|
2081
|
+
{
|
|
2082
|
+
...identityProps,
|
|
2083
|
+
errors,
|
|
2084
|
+
dataStoreId,
|
|
2085
|
+
country,
|
|
2086
|
+
formVerificationErrors: personalDetails.formVerificationErrors,
|
|
2087
|
+
handleFieldChange
|
|
2088
|
+
}
|
|
2089
|
+
);
|
|
2090
|
+
}
|
|
2091
|
+
const countrySpecificIdentityMap = {
|
|
2092
|
+
[CountryCodes.Australia]: IdentityAu,
|
|
2093
|
+
[CountryCodes.HongKong]: IdentityHK,
|
|
2094
|
+
[CountryCodes.NewZealand]: IdentityNZ
|
|
2095
|
+
};
|
|
2096
|
+
const Identity2 = countrySpecificIdentityMap[country];
|
|
2097
|
+
if (!Identity2) {
|
|
2098
|
+
return /* @__PURE__ */ jsx(
|
|
2099
|
+
IdentityNumber,
|
|
2100
|
+
{
|
|
2101
|
+
...identityProps,
|
|
2102
|
+
errors,
|
|
2103
|
+
country,
|
|
2104
|
+
dataStoreId,
|
|
2105
|
+
idNumberType,
|
|
2106
|
+
handleFieldChange
|
|
2107
|
+
}
|
|
2108
|
+
);
|
|
2109
|
+
}
|
|
2110
|
+
const countrySpecificIdentityProps = getFieldProps(personalDetails, identityFields);
|
|
2111
|
+
return /* @__PURE__ */ jsx(
|
|
2112
|
+
Identity2,
|
|
2113
|
+
{
|
|
2114
|
+
...{
|
|
2115
|
+
...countrySpecificIdentityProps,
|
|
2116
|
+
dataStoreId
|
|
2117
|
+
},
|
|
2118
|
+
handleFieldChange
|
|
2119
|
+
}
|
|
2120
|
+
);
|
|
2121
|
+
}
|
|
2122
|
+
const personalDetailsFields = [
|
|
2123
|
+
...nameFields,
|
|
2124
|
+
"birthDate",
|
|
2125
|
+
...idNumberFields,
|
|
2126
|
+
...additionalIdentityInfoFields$1,
|
|
2127
|
+
"residencyCountry",
|
|
2128
|
+
"nationality",
|
|
2129
|
+
"jobTitle",
|
|
2130
|
+
...decisionMakerRoleFields,
|
|
2131
|
+
...nomineeFields,
|
|
2132
|
+
...contactDetailFields,
|
|
2133
|
+
"relationship",
|
|
2134
|
+
"taxInformation",
|
|
2135
|
+
"jaHaniFirstName",
|
|
2136
|
+
"jaHaniLastName",
|
|
2137
|
+
"jaKanaFirstName",
|
|
2138
|
+
"jaKanaLastName"
|
|
2139
|
+
];
|
|
2140
|
+
const relationshipOptions = [
|
|
2141
|
+
{
|
|
2142
|
+
id: "parent",
|
|
2143
|
+
name: "parent"
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
id: "guardian",
|
|
2147
|
+
name: "guardian"
|
|
2148
|
+
}
|
|
2149
|
+
];
|
|
2150
|
+
function PersonalDetails(props) {
|
|
2151
|
+
const { t } = useTranslation("common");
|
|
2152
|
+
const { i18n } = useI18nContext();
|
|
2153
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
2154
|
+
const allowedCountries = useAllowedCountries();
|
|
2155
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
2156
|
+
const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
|
|
2157
|
+
const isLegalAgeEnforced = isSettingEnabled(SettingNames.EnforceLegalAge);
|
|
2158
|
+
const { form } = useFormContext();
|
|
2159
|
+
const { handleChangeFor, triggerValidation } = form;
|
|
2160
|
+
const {
|
|
2161
|
+
data,
|
|
2162
|
+
formVerificationErrors,
|
|
2163
|
+
heading,
|
|
2164
|
+
id: personalDetailsId,
|
|
2165
|
+
fallbackCountry,
|
|
2166
|
+
underageRootIndividualName,
|
|
2167
|
+
readOnlyFields,
|
|
2168
|
+
taskType,
|
|
2169
|
+
trustedFieldsProvider,
|
|
2170
|
+
trustedRoles,
|
|
2171
|
+
valid,
|
|
2172
|
+
shouldValidate,
|
|
2173
|
+
fieldValidationErrors,
|
|
2174
|
+
errors
|
|
2175
|
+
} = props;
|
|
2176
|
+
const isTopLevelEntity = taskType === TaskTypes.INDIVIDUAL;
|
|
2177
|
+
const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
|
|
2178
|
+
const countryRequiringNationality = data?.residencyCountry ?? fallbackCountry;
|
|
2179
|
+
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
2180
|
+
const mergedProps = mergeFieldMetadataIntoProps(
|
|
2181
|
+
"taxInformation",
|
|
2182
|
+
resolveFieldMetadata(
|
|
2183
|
+
taxInformationDefaultFieldConfig[countryRequiringNationality],
|
|
2184
|
+
{
|
|
2185
|
+
taxIdNumberType: form.data.personalDetails?.taxInformation?.find(
|
|
2186
|
+
(taxId) => taxId.country === countryRequiringNationality
|
|
2187
|
+
)?.type,
|
|
2188
|
+
companyType: LegalEntityTypes.INDIVIDUAL
|
|
2189
|
+
},
|
|
2190
|
+
taxInformationDefaultFieldMetadata
|
|
2191
|
+
),
|
|
2192
|
+
props
|
|
2193
|
+
);
|
|
2194
|
+
const formUtils = createFormUtils(mergedProps, t);
|
|
2195
|
+
const decisionMakerRoleProps = getFieldProps(props, decisionMakerRoleFields);
|
|
2196
|
+
const nomineeProps = getFieldProps(props, nomineeFields);
|
|
2197
|
+
const contactDetailsFormProps = getFieldProps(props, contactDetailFields);
|
|
2198
|
+
const localizedNameFieldsProps = getFieldProps(props, [
|
|
2199
|
+
"jaHaniFirstName",
|
|
2200
|
+
"jaHaniLastName",
|
|
2201
|
+
"jaKanaFirstName",
|
|
2202
|
+
"jaKanaLastName",
|
|
2203
|
+
...nameFields
|
|
2204
|
+
]);
|
|
2205
|
+
const birthDateErrorMessage = formUtils.getErrorMessage(
|
|
2206
|
+
"birthDate",
|
|
2207
|
+
errors,
|
|
2208
|
+
fieldValidationErrors
|
|
2209
|
+
);
|
|
2210
|
+
const getAlertProps = () => {
|
|
2211
|
+
if (typeof birthDateErrorMessage !== "boolean") {
|
|
2212
|
+
return { title: i18n.get(birthDateErrorMessage), variant: "error" };
|
|
2213
|
+
}
|
|
2214
|
+
if (isLegalAgeEnforced) {
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
const translatableWarningMessage = getLegalRepresentativeWarningMessage({
|
|
2218
|
+
data,
|
|
2219
|
+
taskType
|
|
2220
|
+
});
|
|
2221
|
+
if (translatableWarningMessage) {
|
|
2222
|
+
return {
|
|
2223
|
+
title: i18n.get(translatableWarningMessage.title),
|
|
2224
|
+
variant: "warning",
|
|
2225
|
+
children: i18n.get(translatableWarningMessage.message),
|
|
2226
|
+
className: "adyen-kyc-u-margin-bottom-24"
|
|
2227
|
+
};
|
|
2228
|
+
}
|
|
2229
|
+
};
|
|
2230
|
+
const alertProps = getAlertProps();
|
|
2231
|
+
const handleFieldChange = (fieldName, mode) => handleChangeFor(fieldName, "personalDetails", mode);
|
|
2232
|
+
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__personal-details", "aria-describedby": "ariaErrorField", children: [
|
|
2233
|
+
/* @__PURE__ */ jsx(FormHeader, { heading }),
|
|
2234
|
+
/* @__PURE__ */ jsx(
|
|
2235
|
+
ErrorPanel,
|
|
2236
|
+
{
|
|
2237
|
+
verificationErrors: formVerificationErrors,
|
|
2238
|
+
validationErrors: fieldValidationErrors,
|
|
2239
|
+
formUtils,
|
|
2240
|
+
id: "ariaErrorField"
|
|
2241
|
+
}
|
|
2242
|
+
),
|
|
2243
|
+
data?.residencyCountry === "US" && isTopLevelEntity ? /* @__PURE__ */ jsx(PatriotActDisclosure, {}) : void 0,
|
|
2244
|
+
isLegalRepresentativeDetailsTask && underageRootIndividualName && /* @__PURE__ */ jsx(
|
|
2245
|
+
Alert,
|
|
2246
|
+
{
|
|
2247
|
+
variant: "info",
|
|
2248
|
+
className: "adyen-kyc-u-margin-bottom-10",
|
|
2249
|
+
title: i18n.get({
|
|
2250
|
+
key: "legalRepresentativeFor",
|
|
2251
|
+
values: {
|
|
2252
|
+
firstName: underageRootIndividualName.firstName,
|
|
2253
|
+
lastName: underageRootIndividualName.lastName
|
|
2254
|
+
}
|
|
2255
|
+
})
|
|
2256
|
+
}
|
|
2257
|
+
),
|
|
2258
|
+
/* @__PURE__ */ jsx(
|
|
2259
|
+
ContextGuidance,
|
|
2260
|
+
{
|
|
2261
|
+
title: i18n.get("whyDoINeedToFillInThisInformation"),
|
|
2262
|
+
content: i18n.get("reasonForFillingIndividualPersonalDetails"),
|
|
2263
|
+
titleId: "whyDoINeedToFillInThisInformation",
|
|
2264
|
+
contentId: "reasonForFillingIndividualPersonalDetails"
|
|
2265
|
+
}
|
|
2266
|
+
),
|
|
2267
|
+
isDecisionMakerTask(taskType) && trustedFieldsProvider === TrustedFieldsProviders.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, { color: "secondary", variant: "caption", children: i18n.get(
|
|
2268
|
+
"weSelectedSomeRolesBasedOnMyinfoBusinessDataAboutYourCompanysAppointmentHoldersAndShareholders"
|
|
2269
|
+
) }),
|
|
2270
|
+
isDecisionMakerTask(taskType) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2271
|
+
/* @__PURE__ */ jsx(
|
|
2272
|
+
DecisionMakerRole,
|
|
2273
|
+
{
|
|
2274
|
+
...decisionMakerRoleProps,
|
|
2275
|
+
taskType,
|
|
2276
|
+
dataStoreId: personalDetailsId,
|
|
2277
|
+
allowedRoles: props?.allowedRoles,
|
|
2278
|
+
trustedRoles,
|
|
2279
|
+
country: countryRequiringNationality,
|
|
2280
|
+
handleFieldChange
|
|
2281
|
+
}
|
|
2282
|
+
),
|
|
2283
|
+
/* @__PURE__ */ jsx(
|
|
2284
|
+
NomineeDecisionMakerRole,
|
|
2285
|
+
{
|
|
2286
|
+
...nomineeProps,
|
|
2287
|
+
roles: data?.role,
|
|
2288
|
+
country: countryRequiringNationality,
|
|
2289
|
+
handleFieldChange
|
|
2290
|
+
}
|
|
2291
|
+
)
|
|
2292
|
+
] }),
|
|
2293
|
+
/* @__PURE__ */ jsx(LocalizedNameFields, { ...localizedNameFieldsProps, handleFieldChange }),
|
|
2294
|
+
!isAgeVerificationEnabled && formUtils.isRequiredField("birthDate") && // we reverse the order of birthDate and Country field in age verification feature
|
|
2295
|
+
/* @__PURE__ */ jsx(
|
|
2296
|
+
Field,
|
|
2297
|
+
{
|
|
2298
|
+
name: "birthDate",
|
|
2299
|
+
label: formUtils.getLabel("birthDate"),
|
|
2300
|
+
errorMessage: isAgeVerificationEnabled && birthDateErrorMessage ? true : birthDateErrorMessage,
|
|
2301
|
+
isValid: fieldValidationErrors?.birthDate,
|
|
2302
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
2303
|
+
InputDate,
|
|
2304
|
+
{
|
|
2305
|
+
...childProps,
|
|
2306
|
+
name: "birthDate",
|
|
2307
|
+
value: data?.birthDate,
|
|
2308
|
+
placeholder: i18n.get("datePlaceholder"),
|
|
2309
|
+
readonly: formUtils.isReadOnly("birthDate"),
|
|
2310
|
+
onInput: handleFieldChange("birthDate", "input"),
|
|
2311
|
+
onBlur: handleFieldChange("birthDate", "blur"),
|
|
2312
|
+
"aria-required": true,
|
|
2313
|
+
"aria-invalid": !fieldValidationErrors?.birthDate,
|
|
2314
|
+
max: formatDateObj(/* @__PURE__ */ new Date())
|
|
2315
|
+
}
|
|
2316
|
+
)
|
|
2317
|
+
}
|
|
2318
|
+
),
|
|
2319
|
+
formUtils.isRequiredField("residencyCountry") && /* @__PURE__ */ jsx(
|
|
2320
|
+
CountryField,
|
|
2321
|
+
{
|
|
2322
|
+
data: { country: data?.residencyCountry },
|
|
2323
|
+
valid: { country: fieldValidationErrors?.residencyCountry },
|
|
2324
|
+
errors: {
|
|
2325
|
+
country: formUtils.getErrorMessage("residencyCountry", errors, fieldValidationErrors)
|
|
2326
|
+
},
|
|
2327
|
+
labels: { country: formUtils.getLabel("residencyCountry") },
|
|
2328
|
+
readonly: !isAllowedEditPrefilledCountry && !isDecisionMakerTask || formUtils.isReadOnly("residencyCountry"),
|
|
2329
|
+
allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
|
|
2330
|
+
handleChangeFor: () => (e) => {
|
|
2331
|
+
handleFieldChange("residencyCountry", "input")(e);
|
|
2332
|
+
handleChangeFor("country", "address")(e);
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
),
|
|
2336
|
+
isAgeVerificationEnabled && formUtils.isRequiredField("relationship") && underageRootIndividualName && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
2337
|
+
Field,
|
|
2338
|
+
{
|
|
2339
|
+
el: "fieldset",
|
|
2340
|
+
name: "relationship",
|
|
2341
|
+
label: i18n.get({
|
|
2342
|
+
key: "relationshipTo",
|
|
2343
|
+
values: {
|
|
2344
|
+
firstName: underageRootIndividualName.firstName,
|
|
2345
|
+
lastName: underageRootIndividualName.lastName
|
|
2346
|
+
}
|
|
2347
|
+
}),
|
|
2348
|
+
errorMessage: formUtils.getErrorMessage("relationship", {}, {}),
|
|
2349
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
2350
|
+
RadioGroup,
|
|
2351
|
+
{
|
|
2352
|
+
...childProps,
|
|
2353
|
+
name: "relationship",
|
|
2354
|
+
items: relationshipOptions,
|
|
2355
|
+
value: data?.relationship,
|
|
2356
|
+
onChange: handleFieldChange("relationship", "input"),
|
|
2357
|
+
"aria-required": true
|
|
2358
|
+
}
|
|
2359
|
+
)
|
|
2360
|
+
}
|
|
2361
|
+
) }),
|
|
2362
|
+
isAgeVerificationEnabled && formUtils.isRequiredField("birthDate") && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2363
|
+
/* @__PURE__ */ jsx(
|
|
2364
|
+
Field,
|
|
2365
|
+
{
|
|
2366
|
+
name: "birthDate",
|
|
2367
|
+
label: formUtils.getLabel("birthDate"),
|
|
2368
|
+
errorMessage: isAgeVerificationEnabled && birthDateErrorMessage ? true : birthDateErrorMessage,
|
|
2369
|
+
isValid: valid?.birthDate,
|
|
2370
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
2371
|
+
InputDate,
|
|
2372
|
+
{
|
|
2373
|
+
...childProps,
|
|
2374
|
+
name: "birthDate",
|
|
2375
|
+
value: data?.birthDate,
|
|
2376
|
+
placeholder: i18n.get("datePlaceholder"),
|
|
2377
|
+
readonly: formUtils.isReadOnly("birthDate"),
|
|
2378
|
+
onInput: handleFieldChange("birthDate", "input"),
|
|
2379
|
+
onBlur: handleFieldChange("birthDate", "blur"),
|
|
2380
|
+
"aria-required": true,
|
|
2381
|
+
"aria-invalid": !valid?.birthDate,
|
|
2382
|
+
max: formatDateObj(/* @__PURE__ */ new Date())
|
|
2383
|
+
}
|
|
2384
|
+
)
|
|
2385
|
+
}
|
|
2386
|
+
),
|
|
2387
|
+
isAgeVerificationEnabled && alertProps && /* @__PURE__ */ jsx(Alert, { ...alertProps })
|
|
2388
|
+
] }),
|
|
2389
|
+
/* @__PURE__ */ jsx(
|
|
2390
|
+
IndividualIdNumberTypeSelector,
|
|
2391
|
+
{
|
|
2392
|
+
country: data?.residencyCountry ?? fallbackCountry,
|
|
2393
|
+
selected: data?.typeOfIdentity,
|
|
2394
|
+
handleFieldChange: handleFieldChange("typeOfIdentity", "input")
|
|
2395
|
+
}
|
|
2396
|
+
),
|
|
2397
|
+
/* @__PURE__ */ jsx(
|
|
2398
|
+
Identity$1,
|
|
2399
|
+
{
|
|
2400
|
+
personalDetails: props,
|
|
2401
|
+
country: data?.residencyCountry ?? fallbackCountry,
|
|
2402
|
+
errors: errors ?? {},
|
|
2403
|
+
idNumberType: data?.typeOfIdentity,
|
|
2404
|
+
handleFieldChange
|
|
2405
|
+
}
|
|
2406
|
+
),
|
|
2407
|
+
formUtils.isRequiredField("nationality") && /* @__PURE__ */ jsx(
|
|
2408
|
+
CountryField,
|
|
2409
|
+
{
|
|
2410
|
+
data: { country: data?.nationality },
|
|
2411
|
+
valid: { country: valid?.nationality },
|
|
2412
|
+
name: "nationality",
|
|
2413
|
+
errors: {
|
|
2414
|
+
country: formUtils.getErrorMessage("nationality", errors, fieldValidationErrors)
|
|
2415
|
+
},
|
|
2416
|
+
labels: { country: formUtils.getLabel("nationality") },
|
|
2417
|
+
readonly: formUtils.isReadOnly("nationality"),
|
|
2418
|
+
handleChangeFor: () => handleFieldChange("nationality", "input")
|
|
2419
|
+
}
|
|
2420
|
+
),
|
|
2421
|
+
Boolean(contactDetailsFormProps?.requiredFields?.length) && /* @__PURE__ */ jsx(
|
|
2422
|
+
ContactDetails,
|
|
2423
|
+
{
|
|
2424
|
+
...contactDetailsFormProps,
|
|
2425
|
+
dataStoreId: personalDetailsId,
|
|
2426
|
+
country: data?.residencyCountry ?? fallbackCountry,
|
|
2427
|
+
handleFieldChange,
|
|
2428
|
+
triggerValidation: () => triggerValidation("personalDetails")
|
|
2429
|
+
}
|
|
2430
|
+
),
|
|
2431
|
+
formUtils.isRequiredField("jobTitle", false) && /* @__PURE__ */ jsx(
|
|
2432
|
+
Field,
|
|
2433
|
+
{
|
|
2434
|
+
name: "jobTitle",
|
|
2435
|
+
label: formUtils.getLabel("jobTitle"),
|
|
2436
|
+
errorMessage: formUtils.getErrorMessage("jobTitle", errors, fieldValidationErrors),
|
|
2437
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
2438
|
+
InputText,
|
|
2439
|
+
{
|
|
2440
|
+
...childProps,
|
|
2441
|
+
name: "jobTitle",
|
|
2442
|
+
value: data?.jobTitle,
|
|
2443
|
+
placeholder: formUtils.getPlaceholder("jobTitle"),
|
|
2444
|
+
readonly: formUtils.isReadOnly("jobTitle"),
|
|
2445
|
+
onInput: handleFieldChange("jobTitle", "input"),
|
|
2446
|
+
onBlur: handleFieldChange("jobTitle", "blur"),
|
|
2447
|
+
"aria-required": true,
|
|
2448
|
+
"aria-invalid": !valid?.jobTitle
|
|
2449
|
+
}
|
|
2450
|
+
)
|
|
2451
|
+
}
|
|
2452
|
+
),
|
|
2453
|
+
formUtils.isRequiredField("taxInformation", false) && /* @__PURE__ */ jsx(
|
|
2454
|
+
TaxInformationField,
|
|
2455
|
+
{
|
|
2456
|
+
data: { taxInformation: data?.taxInformation },
|
|
2457
|
+
valid: { taxInformation: valid?.taxInformation },
|
|
2458
|
+
errors: {
|
|
2459
|
+
taxInformation: formUtils.getErrorMessage(
|
|
2460
|
+
"taxInformation",
|
|
2461
|
+
errors,
|
|
2462
|
+
fieldValidationErrors
|
|
2463
|
+
)
|
|
2464
|
+
},
|
|
2465
|
+
labels: formUtils.getFieldLabels(["taxInformation"]),
|
|
2466
|
+
mask: formUtils.getMask("taxInformation"),
|
|
2467
|
+
guidanceText: formUtils.getFieldGuidanceText(["taxInformation"]),
|
|
2468
|
+
readonly: formUtils.isReadOnly("taxInformation"),
|
|
2469
|
+
shouldValidate,
|
|
2470
|
+
handleChangeFor: handleFieldChange,
|
|
2471
|
+
canExempt: false,
|
|
2472
|
+
country: countryRequiringNationality,
|
|
2473
|
+
entityType: LegalEntityTypes.INDIVIDUAL,
|
|
2474
|
+
defaultData: data?.taxInformation
|
|
2475
|
+
}
|
|
2476
|
+
)
|
|
2477
|
+
] });
|
|
2478
|
+
}
|
|
2479
|
+
const ProofOfRelationshipDocumentTypes = {
|
|
2480
|
+
BIRTH_CERTIFICATE: "birthCertificate",
|
|
2481
|
+
GUARDIANSHIP_CERTIFICATE: "guardianshipCertificate",
|
|
2482
|
+
ADOPTION_CERTIFICATE: "adoptionCertificate"
|
|
2483
|
+
};
|
|
2484
|
+
const proofOfRelationshipDocumentOptions = [
|
|
2485
|
+
{ id: ProofOfRelationshipDocumentTypes.BIRTH_CERTIFICATE, name: "birthCertificate" },
|
|
2486
|
+
{
|
|
2487
|
+
id: ProofOfRelationshipDocumentTypes.GUARDIANSHIP_CERTIFICATE,
|
|
2488
|
+
name: "guardianshipCertificate"
|
|
2489
|
+
},
|
|
2490
|
+
{
|
|
2491
|
+
id: ProofOfRelationshipDocumentTypes.ADOPTION_CERTIFICATE,
|
|
2492
|
+
name: "adoptionCertificate"
|
|
2493
|
+
}
|
|
2494
|
+
];
|
|
2495
|
+
function ProofOfRelationship({ id, ...props }) {
|
|
2496
|
+
const { i18n } = useI18nContext();
|
|
2497
|
+
const [proofOfRelationshipDocumentType, setProofOfRelationshipDocumentType] = useState(
|
|
2498
|
+
proofOfRelationshipDocumentOptions[0].id
|
|
2499
|
+
);
|
|
2500
|
+
const proofOfResidencyGuidanceContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2501
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
|
|
2502
|
+
" ",
|
|
2503
|
+
i18n.get("requirements")
|
|
2504
|
+
] }),
|
|
2505
|
+
/* @__PURE__ */ jsxs("ul", { children: [
|
|
2506
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("documentAddressedToName", { values: { name: props.name } }) }),
|
|
2507
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("showAddressStateCountry") }),
|
|
2508
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("fullDocumentVisibleWithReadableText") }),
|
|
2509
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("documentCannotBeDamaged") })
|
|
2510
|
+
] })
|
|
2511
|
+
] });
|
|
2512
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
2513
|
+
MemoizedDocumentUpload,
|
|
2514
|
+
{
|
|
2515
|
+
...props,
|
|
2516
|
+
documentField: "proofOfRelationship",
|
|
2517
|
+
documentType: "proofOfRelationship",
|
|
2518
|
+
heading: i18n.get("proofOfRelationship"),
|
|
2519
|
+
guidanceHeader: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-document-upload__subtitle adyen-kyc-u-margin-bottom-16", children: i18n.get("proofOfResidenceDocumentTypeLabel", { values: { name: props.name } }) }),
|
|
2520
|
+
documentTypeSelect: {
|
|
2521
|
+
selectedType: proofOfRelationshipDocumentType,
|
|
2522
|
+
setSelectedType: setProofOfRelationshipDocumentType,
|
|
2523
|
+
options: proofOfRelationshipDocumentOptions
|
|
2524
|
+
},
|
|
2525
|
+
guidanceContent: proofOfResidencyGuidanceContent,
|
|
2526
|
+
id
|
|
2527
|
+
}
|
|
2528
|
+
) });
|
|
2529
|
+
}
|
|
2530
|
+
const MemoizedProofOfRelationship = memo(
|
|
2531
|
+
ProofOfRelationship,
|
|
2532
|
+
(prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.name === nextProps.name
|
|
2533
|
+
);
|
|
2534
|
+
const ProofOfResidenceDocumentTypes = {
|
|
2535
|
+
BANK_STATEMENT: "bankStatement",
|
|
2536
|
+
UTILITY_BILL: "utilityBill",
|
|
2537
|
+
GOVERNMENT_ISSUED_CORRESPONDENCE: "governmentIssuedCorrespondence",
|
|
2538
|
+
TAXATION_DOCUMENT: "taxationDocument",
|
|
2539
|
+
EXTRACT_FROM_MUNICIPAL_PERSONAL_RECORDS_DATABASE: "extractFromMunicipalPersonalRecordsDatabase",
|
|
2540
|
+
SALARY_SLIP: "salarySlip",
|
|
2541
|
+
MORTGAGE_STATEMENT: "mortgageStatement",
|
|
2542
|
+
CERTIFICATE_OF_VOTER_REGISTRATION: "certificateOfVoterRegistration"
|
|
2543
|
+
};
|
|
2544
|
+
const proofOfResidenceDocumentOptions = [
|
|
2545
|
+
{ id: ProofOfResidenceDocumentTypes.BANK_STATEMENT, name: "bankStatementDocument" },
|
|
2546
|
+
{ id: ProofOfResidenceDocumentTypes.UTILITY_BILL, name: "utilityBill" },
|
|
2547
|
+
{
|
|
2548
|
+
id: ProofOfResidenceDocumentTypes.GOVERNMENT_ISSUED_CORRESPONDENCE,
|
|
2549
|
+
name: "governmentIssuedCorrespondence"
|
|
2550
|
+
},
|
|
2551
|
+
{ id: ProofOfResidenceDocumentTypes.TAXATION_DOCUMENT, name: "taxationDocument" },
|
|
2552
|
+
{
|
|
2553
|
+
id: ProofOfResidenceDocumentTypes.EXTRACT_FROM_MUNICIPAL_PERSONAL_RECORDS_DATABASE,
|
|
2554
|
+
name: "extractFromMunicipalPersonalRecordsDatabase"
|
|
2555
|
+
},
|
|
2556
|
+
{ id: ProofOfResidenceDocumentTypes.SALARY_SLIP, name: "salarySlip" },
|
|
2557
|
+
{ id: ProofOfResidenceDocumentTypes.MORTGAGE_STATEMENT, name: "mortgageStatement" },
|
|
2558
|
+
{
|
|
2559
|
+
id: ProofOfResidenceDocumentTypes.CERTIFICATE_OF_VOTER_REGISTRATION,
|
|
2560
|
+
name: "certificateOfVoterRegistration"
|
|
2561
|
+
}
|
|
2562
|
+
];
|
|
2563
|
+
function ProofOfResidency({ id, ...props }) {
|
|
2564
|
+
const { i18n } = useI18nContext();
|
|
2565
|
+
const [proofOfResidenceDocumentType, setProofOfResidenceDocumentType] = useState(
|
|
2566
|
+
proofOfResidenceDocumentOptions[0].id
|
|
2567
|
+
);
|
|
2568
|
+
const isMortgageOrVoterRegistration = proofOfResidenceDocumentType === ProofOfResidenceDocumentTypes.MORTGAGE_STATEMENT || proofOfResidenceDocumentType === ProofOfResidenceDocumentTypes.CERTIFICATE_OF_VOTER_REGISTRATION;
|
|
2569
|
+
const proofOfResidencyGuidanceContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2570
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__subtitle", children: [
|
|
2571
|
+
" ",
|
|
2572
|
+
i18n.get("requirements")
|
|
2573
|
+
] }),
|
|
2574
|
+
/* @__PURE__ */ jsxs("ul", { children: [
|
|
2575
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("documentAddressedToName", { values: { name: props.name } }) }),
|
|
2576
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("showAddressStateCountry") }),
|
|
2577
|
+
/* @__PURE__ */ jsx("li", { children: isMortgageOrVoterRegistration ? i18n.get("dateOnDocumentNoOlderThanXMonths", { values: { numberOfMonths: 12 } }) : i18n.get("dateOnDocumentNoOlderThanXMonths", { values: { numberOfMonths: 3 } }) }),
|
|
2578
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("fullDocumentVisibleWithReadableText") }),
|
|
2579
|
+
/* @__PURE__ */ jsx("li", { children: i18n.get("documentCannotBeDamaged") })
|
|
2580
|
+
] })
|
|
2581
|
+
] });
|
|
2582
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
2583
|
+
MemoizedDocumentUpload,
|
|
2584
|
+
{
|
|
2585
|
+
...props,
|
|
2586
|
+
documentField: "proofOfResidency",
|
|
2587
|
+
documentType: "proofOfResidency",
|
|
2588
|
+
heading: i18n.get("proofOfResidency"),
|
|
2589
|
+
guidanceHeader: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-document-upload__subtitle adyen-kyc-u-margin-bottom-16", children: i18n.get("proofOfResidenceDocumentTypeLabel", { values: { name: props.name } }) }),
|
|
2590
|
+
documentTypeSelect: {
|
|
2591
|
+
selectedType: proofOfResidenceDocumentType,
|
|
2592
|
+
setSelectedType: setProofOfResidenceDocumentType,
|
|
2593
|
+
options: proofOfResidenceDocumentOptions
|
|
2594
|
+
},
|
|
2595
|
+
guidanceContent: proofOfResidencyGuidanceContent,
|
|
2596
|
+
id
|
|
2597
|
+
}
|
|
2598
|
+
) });
|
|
2599
|
+
}
|
|
2600
|
+
const MemoizedProofOfResidencyUpload = memo(
|
|
2601
|
+
ProofOfResidency,
|
|
2602
|
+
(prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.name === nextProps.name
|
|
2603
|
+
);
|
|
2604
|
+
const individualForms = {
|
|
2605
|
+
personalDetails: {
|
|
2606
|
+
formId: "personalDetails",
|
|
2607
|
+
formName: "personalDetails",
|
|
2608
|
+
fields: personalDetailsFields
|
|
2609
|
+
},
|
|
2610
|
+
address: {
|
|
2611
|
+
formId: "address",
|
|
2612
|
+
formName: "address",
|
|
2613
|
+
fields: addressFields
|
|
2614
|
+
},
|
|
2615
|
+
idVerificationMethod: {
|
|
2616
|
+
formId: "idVerificationMethod",
|
|
2617
|
+
formName: "verificationMethod",
|
|
2618
|
+
fields: ["idVerificationMethod"]
|
|
2619
|
+
},
|
|
2620
|
+
idDocument: {
|
|
2621
|
+
formId: "idDocument",
|
|
2622
|
+
formName: "idDocument",
|
|
2623
|
+
fields: [...idDocumentUploadFields]
|
|
2624
|
+
},
|
|
2625
|
+
proofOfResidency: {
|
|
2626
|
+
formId: "proofOfResidency",
|
|
2627
|
+
formName: "proofOfResidency",
|
|
2628
|
+
fields: ["proofOfResidency"]
|
|
2629
|
+
},
|
|
2630
|
+
proofOfNationalId: {
|
|
2631
|
+
formId: "proofOfNationalId",
|
|
2632
|
+
formName: "proofOfNationalId",
|
|
2633
|
+
fields: ["proofOfNationalId"]
|
|
2634
|
+
},
|
|
2635
|
+
proofOfRelationship: {
|
|
2636
|
+
formId: "proofOfRelationship",
|
|
2637
|
+
formName: "proofOfRelationship",
|
|
2638
|
+
fields: ["proofOfRelationship"]
|
|
2639
|
+
}
|
|
2640
|
+
};
|
|
2641
|
+
const personalDetailsFormID = individualForms.personalDetails.formId;
|
|
2642
|
+
const addressFormID = individualForms.address.formId;
|
|
2643
|
+
const idDocumentFormID = individualForms.idDocument.formId;
|
|
2644
|
+
const idVerificationMethodFormID$1 = individualForms.idVerificationMethod.formId;
|
|
2645
|
+
const proofOfResidencyFormID$1 = individualForms.proofOfResidency.formId;
|
|
2646
|
+
const proofOfNationalIdFormID$1 = individualForms.proofOfNationalId.formId;
|
|
2647
|
+
const proofOfRelationshipFormID$1 = individualForms.proofOfRelationship.formId;
|
|
2648
|
+
const individualDocumentForms = [
|
|
2649
|
+
idVerificationMethodFormID$1,
|
|
2650
|
+
idDocumentFormID,
|
|
2651
|
+
proofOfResidencyFormID$1,
|
|
2652
|
+
proofOfNationalIdFormID$1,
|
|
2653
|
+
proofOfRelationshipFormID$1
|
|
2654
|
+
];
|
|
2655
|
+
function Individual(props) {
|
|
2656
|
+
const { t } = useTranslation(["individual", "common"]);
|
|
2657
|
+
const { form } = useFormContext();
|
|
2658
|
+
const { errors, valid, fieldProblems: fieldValidationErrors, handleChangeFor } = form;
|
|
2659
|
+
const {
|
|
2660
|
+
activeForm: propActiveForm,
|
|
2661
|
+
allowedRoles,
|
|
2662
|
+
country,
|
|
2663
|
+
data,
|
|
2664
|
+
onBack,
|
|
2665
|
+
onNext,
|
|
2666
|
+
parentLegalEntity,
|
|
2667
|
+
setHideFooter,
|
|
2668
|
+
taskType,
|
|
2669
|
+
trustedFields,
|
|
2670
|
+
trustedFieldsProvider,
|
|
2671
|
+
trustedRoles,
|
|
2672
|
+
legalEntityId
|
|
2673
|
+
} = props;
|
|
2674
|
+
const personalFormProps = getFormProps(props, personalDetailsFormID);
|
|
2675
|
+
const addressFormProps = getFormProps(props, addressFormID);
|
|
2676
|
+
const idDocumentFormProps = getFormProps(props, idDocumentFormID);
|
|
2677
|
+
const idVerificationMethodFormProps = getFormProps(props, idVerificationMethodFormID$1);
|
|
2678
|
+
const proofOfResidencyFormProps = getFormProps(props, proofOfResidencyFormID$1);
|
|
2679
|
+
const proofOfNationalIdFormProps = getFormProps(props, proofOfNationalIdFormID$1);
|
|
2680
|
+
const proofOfRelationshipFormProps = getFormProps(props, proofOfRelationshipFormID$1);
|
|
2681
|
+
const fullName = `${data?.personalDetails?.firstName} ${data?.personalDetails?.lastName}`;
|
|
2682
|
+
const minimumApplicantDetails = {
|
|
2683
|
+
firstName: data?.personalDetails?.firstName,
|
|
2684
|
+
lastName: data?.personalDetails?.lastName,
|
|
2685
|
+
residencyCountry: data?.personalDetails?.residencyCountry
|
|
2686
|
+
};
|
|
2687
|
+
const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
|
|
2688
|
+
const { data: providerStatus } = useProviderStatus({
|
|
2689
|
+
providers: ["idDocument"],
|
|
2690
|
+
country
|
|
2691
|
+
});
|
|
2692
|
+
useEffect(() => {
|
|
2693
|
+
const isIdDocumentFormActive = propActiveForm?.formId === idDocumentFormID;
|
|
2694
|
+
const isInstantIdVerificationEnabled = data?.idVerificationMethod?.idVerificationMethod === "instantVerification" && providerStatus?.statuses.idDocument.enabled;
|
|
2695
|
+
const isIdAlreadyUploaded = data?.idDocument?.instantIdVerificationData || data?.idDocument?.idDocumentType;
|
|
2696
|
+
setHideFooter?.(
|
|
2697
|
+
Boolean(isIdDocumentFormActive && !isIdAlreadyUploaded && isInstantIdVerificationEnabled)
|
|
2698
|
+
);
|
|
2699
|
+
}, [
|
|
2700
|
+
propActiveForm,
|
|
2701
|
+
data?.idVerificationMethod?.idVerificationMethod,
|
|
2702
|
+
data?.idDocument?.instantIdVerificationData,
|
|
2703
|
+
data?.idDocument?.idDocumentType
|
|
2704
|
+
]);
|
|
2705
|
+
const handleFieldChange = (formName) => (fieldName, mode) => handleChangeFor(fieldName, formName, mode);
|
|
2706
|
+
const capabilities = useCapabilities();
|
|
2707
|
+
const hasMotionCaptureScenarioValue = hasMotionCaptureScenario?.value;
|
|
2708
|
+
useEffect(() => {
|
|
2709
|
+
setShowIndividualMotionCapture(
|
|
2710
|
+
shouldShowMotionCapture({
|
|
2711
|
+
capabilities,
|
|
2712
|
+
userRoles: data?.personalDetails?.role,
|
|
2713
|
+
taskType,
|
|
2714
|
+
hasMotionScenario: hasMotionCaptureScenarioValue
|
|
2715
|
+
})
|
|
2716
|
+
);
|
|
2717
|
+
}, [data?.personalDetails?.role, capabilities, taskType, hasMotionCaptureScenarioValue]);
|
|
2718
|
+
const renderActiveForm = (activeForm) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2719
|
+
activeForm.formId === personalDetailsFormID && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
|
|
2720
|
+
PersonalDetails,
|
|
2721
|
+
{
|
|
2722
|
+
...personalFormProps,
|
|
2723
|
+
data: data?.personalDetails ?? {},
|
|
2724
|
+
heading: isLegalRepresentativeDetailsTask ? t(($) => $["legalRepresentativeDetails"]) : t(($) => $["personalDetails"], { ns: "common" }),
|
|
2725
|
+
taskType,
|
|
2726
|
+
id: personalDetailsFormID,
|
|
2727
|
+
allowedRoles,
|
|
2728
|
+
underageRootIndividualName: parentLegalEntity?.individual?.name,
|
|
2729
|
+
fallbackCountry: country,
|
|
2730
|
+
trustedFieldsProvider,
|
|
2731
|
+
trustedRoles,
|
|
2732
|
+
errors: errors?.personalDetails,
|
|
2733
|
+
fieldValidationErrors: fieldValidationErrors?.personalDetails,
|
|
2734
|
+
valid: valid?.personalDetails
|
|
2735
|
+
}
|
|
2736
|
+
) }),
|
|
2737
|
+
activeForm.formId === addressFormID && /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-wrapper", children: [
|
|
2738
|
+
/* @__PURE__ */ jsx(FormHeader, { heading: t(($) => $["providePersonalAddress"]) }),
|
|
2739
|
+
/* @__PURE__ */ jsx(
|
|
2740
|
+
ContextGuidance,
|
|
2741
|
+
{
|
|
2742
|
+
title: t(($) => $["whyDoINeedToFillInThisInformation"], { ns: "common" }),
|
|
2743
|
+
content: t(($) => $["weHaveToMakeSureThatEveryone"]),
|
|
2744
|
+
titleId: "whyDoINeedToFillInThisInformation",
|
|
2745
|
+
contentId: "reasonForFillingIndividualAddressDetails"
|
|
2746
|
+
}
|
|
2747
|
+
),
|
|
2748
|
+
/* @__PURE__ */ jsx(
|
|
2749
|
+
Address,
|
|
2750
|
+
{
|
|
2751
|
+
...addressFormProps,
|
|
2752
|
+
id: addressFormID,
|
|
2753
|
+
data: {
|
|
2754
|
+
...data?.address,
|
|
2755
|
+
country: data?.personalDetails?.residencyCountry ?? data?.address?.country ?? country
|
|
2756
|
+
},
|
|
2757
|
+
addressType: "residentialAddress",
|
|
2758
|
+
optionalFields: ["otherAddressInformation"],
|
|
2759
|
+
trustedFields: trustedFields?.address,
|
|
2760
|
+
hideCountry: true,
|
|
2761
|
+
errors: errors?.address,
|
|
2762
|
+
fieldValidationErrors: fieldValidationErrors?.address,
|
|
2763
|
+
valid: valid?.address,
|
|
2764
|
+
handleFieldChange: handleFieldChange("address")
|
|
2765
|
+
}
|
|
2766
|
+
)
|
|
2767
|
+
] }),
|
|
2768
|
+
activeForm.formId === idVerificationMethodFormID$1 && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
|
|
2769
|
+
IdVerificationMethod$1,
|
|
2770
|
+
{
|
|
2771
|
+
...idVerificationMethodFormProps,
|
|
2772
|
+
data: data?.idVerificationMethod,
|
|
2773
|
+
name: fullName,
|
|
2774
|
+
id: idVerificationMethodFormID$1,
|
|
2775
|
+
countryOfResidence: data?.personalDetails?.residencyCountry,
|
|
2776
|
+
errors: errors?.idVerificationMethod,
|
|
2777
|
+
fieldValidationErrors: fieldValidationErrors?.idVerificationMethod,
|
|
2778
|
+
valid: valid?.idVerificationMethod,
|
|
2779
|
+
handleFieldChange: handleFieldChange("idVerificationMethod")
|
|
2780
|
+
}
|
|
2781
|
+
) }),
|
|
2782
|
+
activeForm.formId === idDocumentFormID && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
|
|
2783
|
+
IdDocumentUpload,
|
|
2784
|
+
{
|
|
2785
|
+
...idDocumentFormProps,
|
|
2786
|
+
data: data?.idDocument,
|
|
2787
|
+
name: fullName,
|
|
2788
|
+
minimumApplicantDetails,
|
|
2789
|
+
id: idDocumentFormID,
|
|
2790
|
+
legalEntityId,
|
|
2791
|
+
handleOnBack: onBack,
|
|
2792
|
+
handleOnNext: onNext,
|
|
2793
|
+
idVerificationMethodSelected: data?.idVerificationMethod?.idVerificationMethod,
|
|
2794
|
+
errors: errors.idDocument,
|
|
2795
|
+
fieldValidationErrors: fieldValidationErrors.idDocument,
|
|
2796
|
+
valid: valid.idDocument,
|
|
2797
|
+
handleFieldChange: handleFieldChange("idDocument"),
|
|
2798
|
+
country: data?.personalDetails?.residencyCountry ?? data?.address?.country ?? country
|
|
2799
|
+
}
|
|
2800
|
+
) }),
|
|
2801
|
+
activeForm.formId === proofOfResidencyFormID$1 && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
|
|
2802
|
+
MemoizedProofOfResidencyUpload,
|
|
2803
|
+
{
|
|
2804
|
+
...proofOfResidencyFormProps,
|
|
2805
|
+
data: data?.proofOfResidency,
|
|
2806
|
+
id: proofOfResidencyFormID$1,
|
|
2807
|
+
name: fullName,
|
|
2808
|
+
errors: errors.proofOfResidency,
|
|
2809
|
+
fieldValidationErrors: fieldValidationErrors.proofOfResidency,
|
|
2810
|
+
valid: valid.proofOfResidency,
|
|
2811
|
+
handleFieldChange: handleFieldChange("proofOfResidency")
|
|
2812
|
+
}
|
|
2813
|
+
) }),
|
|
2814
|
+
activeForm.formId === proofOfNationalIdFormID$1 && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
|
|
2815
|
+
MemoizedDocumentUpload,
|
|
2816
|
+
{
|
|
2817
|
+
...proofOfNationalIdFormProps,
|
|
2818
|
+
data: data?.proofOfNationalId,
|
|
2819
|
+
documentField: "proofOfNationalId",
|
|
2820
|
+
documentType: "registrationDocument",
|
|
2821
|
+
heading: t(($) => $["proofOfNationalId"], { ns: "common" }),
|
|
2822
|
+
id: proofOfNationalIdFormID$1,
|
|
2823
|
+
errors: errors.proofOfNationalId,
|
|
2824
|
+
fieldValidationErrors: fieldValidationErrors.proofOfNationalId,
|
|
2825
|
+
valid: valid.proofOfNationalId,
|
|
2826
|
+
handleFieldChange: handleFieldChange("proofOfNationalId")
|
|
2827
|
+
}
|
|
2828
|
+
) }),
|
|
2829
|
+
activeForm.formId === proofOfRelationshipFormID$1 && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
|
|
2830
|
+
MemoizedProofOfRelationship,
|
|
2831
|
+
{
|
|
2832
|
+
...proofOfRelationshipFormProps,
|
|
2833
|
+
data: data?.proofOfRelationship,
|
|
2834
|
+
id: proofOfRelationshipFormID$1,
|
|
2835
|
+
name: fullName,
|
|
2836
|
+
errors: errors.proofOfRelationship,
|
|
2837
|
+
fieldValidationErrors: fieldValidationErrors.proofOfRelationship,
|
|
2838
|
+
valid: valid.proofOfRelationship,
|
|
2839
|
+
handleFieldChange: handleFieldChange("proofOfRelationship")
|
|
2840
|
+
}
|
|
2841
|
+
) })
|
|
2842
|
+
] });
|
|
2843
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual", children: renderActiveForm(propActiveForm) });
|
|
2844
|
+
}
|
|
111
2845
|
const jaHaniNameValidationRules = {
|
|
112
2846
|
jaHaniFirstName: [
|
|
113
2847
|
{
|
|
@@ -797,12 +3531,12 @@ function IndividualDropin({
|
|
|
797
3531
|
[country, matchingScenario, data, taskType, problems]
|
|
798
3532
|
);
|
|
799
3533
|
useEffect(() => {
|
|
800
|
-
const derivedProps2 = getPropsFromConfigurations(
|
|
801
|
-
fieldConfigurations,
|
|
802
|
-
individualForms,
|
|
803
|
-
problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
804
|
-
problems?.missingData ?? [],
|
|
805
|
-
legalEntityResponse ? getFieldsWithExistingData(
|
|
3534
|
+
const derivedProps2 = getPropsFromConfigurations({
|
|
3535
|
+
scenarioConfiguration: fieldConfigurations,
|
|
3536
|
+
forms: individualForms,
|
|
3537
|
+
remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
3538
|
+
dataMissingErrors: problems?.missingData ?? [],
|
|
3539
|
+
fieldsWithExistingData: legalEntityResponse ? getFieldsWithExistingData(
|
|
806
3540
|
legalEntityResponse,
|
|
807
3541
|
individualApiKeyMapping,
|
|
808
3542
|
individualDocumentMapping,
|
|
@@ -814,13 +3548,11 @@ function IndividualDropin({
|
|
|
814
3548
|
"personalDetails.issuerState"
|
|
815
3549
|
]
|
|
816
3550
|
) : [],
|
|
817
|
-
fieldsFromCustomRules,
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
true
|
|
823
|
-
);
|
|
3551
|
+
customRules: fieldsFromCustomRules,
|
|
3552
|
+
legalEntityType: legalEntityResponse?.type,
|
|
3553
|
+
legalEntityTrustedFields: [],
|
|
3554
|
+
remediationFieldAsOptional: true
|
|
3555
|
+
});
|
|
824
3556
|
const updatedDerivedProps = mandateIdVerificationForMotionCapture(
|
|
825
3557
|
showIndividualMotionCapture?.value,
|
|
826
3558
|
derivedProps2
|
|
@@ -1947,11 +4679,10 @@ const individualOnfidoRules = ({
|
|
|
1947
4679
|
}
|
|
1948
4680
|
},
|
|
1949
4681
|
isDirectorRequiredForCountry: () => {
|
|
1950
|
-
const
|
|
1951
|
-
|
|
4682
|
+
const decisionMakerCountry = rootLegalEntity ? getLegalEntityCountry(rootLegalEntity) : country;
|
|
4683
|
+
if (getAvailableDecisionMakerRoleTypes(decisionMakerCountry, matchingScenario).some(
|
|
1952
4684
|
(maker) => maker.roleType === DecisionMakerTypes.DIRECTOR
|
|
1953
|
-
)
|
|
1954
|
-
if (isDirectorRequired) {
|
|
4685
|
+
)) {
|
|
1955
4686
|
return "REQUIRED";
|
|
1956
4687
|
}
|
|
1957
4688
|
},
|
|
@@ -2056,7 +4787,7 @@ function Identity(props) {
|
|
|
2056
4787
|
optionalFields,
|
|
2057
4788
|
requiredFields
|
|
2058
4789
|
]);
|
|
2059
|
-
const
|
|
4790
|
+
const licenseCardNumberMetaData2 = resolveFieldMetadata(
|
|
2060
4791
|
licenseCardNumberDefaultConfig[country],
|
|
2061
4792
|
{},
|
|
2062
4793
|
licenseCardNumberDefaultMetadata
|
|
@@ -2072,12 +4803,12 @@ function Identity(props) {
|
|
|
2072
4803
|
idNumberMetadata,
|
|
2073
4804
|
mergeFieldMetadataIntoProps(
|
|
2074
4805
|
"licenseCardNumber",
|
|
2075
|
-
|
|
4806
|
+
licenseCardNumberMetaData2,
|
|
2076
4807
|
initialFormUtilProps
|
|
2077
4808
|
)
|
|
2078
4809
|
);
|
|
2079
|
-
}, [country, data?.typeOfIdentity, initialFormUtilProps,
|
|
2080
|
-
const { t } = useTranslation();
|
|
4810
|
+
}, [country, data?.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData2]);
|
|
4811
|
+
const { t } = useTranslation("common");
|
|
2081
4812
|
const formUtils = useMemo(() => createFormUtils(mergedProps, t), [mergedProps, t]);
|
|
2082
4813
|
const { form } = useFormContext();
|
|
2083
4814
|
const defaultIdNumber = form?.defaultData?.additionalPersonalDetails?.idNumber;
|
|
@@ -2486,7 +5217,7 @@ const basicDetailsFields = [
|
|
|
2486
5217
|
"jaKanaLastName"
|
|
2487
5218
|
];
|
|
2488
5219
|
function BasicDetails(props) {
|
|
2489
|
-
const { t } = useTranslation();
|
|
5220
|
+
const { t } = useTranslation("common");
|
|
2490
5221
|
const { i18n } = useI18nContext();
|
|
2491
5222
|
const {
|
|
2492
5223
|
form: { triggerValidation }
|
|
@@ -3162,7 +5893,8 @@ function IdVerificationMethod(props) {
|
|
|
3162
5893
|
fieldValidationErrors,
|
|
3163
5894
|
hasLiveSelfieErrorCode
|
|
3164
5895
|
} = props;
|
|
3165
|
-
const { t, i18n } = useTranslation(["individual"
|
|
5896
|
+
const { t, i18n } = useTranslation(["individual"]);
|
|
5897
|
+
const { t: commonT } = useTranslation("common");
|
|
3166
5898
|
const userEvents = useAnalyticsContext();
|
|
3167
5899
|
const extractDocumentInformation2 = useExtractDocumentInformation();
|
|
3168
5900
|
const {
|
|
@@ -3350,7 +6082,7 @@ function IdVerificationMethod(props) {
|
|
|
3350
6082
|
handlers.handleUpdateDocument();
|
|
3351
6083
|
};
|
|
3352
6084
|
const modalProvidedData = resolvedData || comparableExistingData;
|
|
3353
|
-
const formUtils = createFormUtils(props,
|
|
6085
|
+
const formUtils = createFormUtils(props, commonT);
|
|
3354
6086
|
isNextStepDisabled.value = showLoadingSpinner;
|
|
3355
6087
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3356
6088
|
/* @__PURE__ */ jsx(
|
|
@@ -3372,17 +6104,17 @@ function IdVerificationMethod(props) {
|
|
|
3372
6104
|
lazyLoadedImage: passportFrontGreenImage
|
|
3373
6105
|
}
|
|
3374
6106
|
),
|
|
3375
|
-
title:
|
|
6107
|
+
title: commonT(($) => $["identityVerification"]),
|
|
3376
6108
|
description: showIndividualMotionCapture?.value ? t(($) => $["toHelpProtectAgainstFraudAndKeepOurServices"]) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3377
|
-
|
|
6109
|
+
commonT(($) => $["takeOrUploadAPhoto"]),
|
|
3378
6110
|
" ",
|
|
3379
|
-
/* @__PURE__ */ jsx(Link, { href: "https://onfido.com", external: true, inline: true, children:
|
|
6111
|
+
/* @__PURE__ */ jsx(Link, { href: "https://onfido.com", external: true, inline: true, children: commonT(($) => $["onfido"]) })
|
|
3380
6112
|
] }),
|
|
3381
6113
|
error: error ? /* @__PURE__ */ jsx(
|
|
3382
6114
|
Alert,
|
|
3383
6115
|
{
|
|
3384
6116
|
variant: "error",
|
|
3385
|
-
title:
|
|
6117
|
+
title: commonT(($) => $[error.key], { ...error.options?.values })
|
|
3386
6118
|
}
|
|
3387
6119
|
) : void 0,
|
|
3388
6120
|
actions: /* @__PURE__ */ jsx(Fragment, { children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : !hasExistingDocument && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -3393,7 +6125,7 @@ function IdVerificationMethod(props) {
|
|
|
3393
6125
|
onClick: launchOnfido,
|
|
3394
6126
|
disabled: status === "extractionLoading",
|
|
3395
6127
|
loading: status === "extractionLoading",
|
|
3396
|
-
children:
|
|
6128
|
+
children: commonT(($) => $["startVerification"])
|
|
3397
6129
|
}
|
|
3398
6130
|
),
|
|
3399
6131
|
!showIndividualMotionCapture?.value && /* @__PURE__ */ jsx(
|
|
@@ -3402,7 +6134,7 @@ function IdVerificationMethod(props) {
|
|
|
3402
6134
|
onClick: () => setStatus("confirmManualFlowModal"),
|
|
3403
6135
|
variant: "secondary",
|
|
3404
6136
|
fullWidth: true,
|
|
3405
|
-
children:
|
|
6137
|
+
children: commonT(($) => $["addDetailsManually"])
|
|
3406
6138
|
}
|
|
3407
6139
|
)
|
|
3408
6140
|
] }) }),
|
|
@@ -3421,11 +6153,11 @@ function IdVerificationMethod(props) {
|
|
|
3421
6153
|
" ",
|
|
3422
6154
|
/* @__PURE__ */ jsx(Link, { href: "https://onfido.com/facial-scan-policy-and-release/", external: true, inline: true, children: t(($) => $["onfidoFacialScanPolicy"]) }),
|
|
3423
6155
|
" ",
|
|
3424
|
-
/* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children:
|
|
6156
|
+
/* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: commonT(($) => $["privacyPolicy"]) }),
|
|
3425
6157
|
" ",
|
|
3426
|
-
|
|
6158
|
+
commonT(($) => $["and"]),
|
|
3427
6159
|
" ",
|
|
3428
|
-
/* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true, children:
|
|
6160
|
+
/* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true, children: commonT(($) => $["termsOfService"]) }),
|
|
3429
6161
|
"."
|
|
3430
6162
|
] })
|
|
3431
6163
|
)
|
|
@@ -3456,7 +6188,7 @@ function IdVerificationMethod(props) {
|
|
|
3456
6188
|
{
|
|
3457
6189
|
title: t(($) => $["deleteIdDocument"]),
|
|
3458
6190
|
description: t(($) => $["youMayBeAskedToReUpload"]),
|
|
3459
|
-
confirmText:
|
|
6191
|
+
confirmText: commonT(($) => $["deleteDocument"]),
|
|
3460
6192
|
onCancel: handleCancelDeleteDocument,
|
|
3461
6193
|
onConfirm: handleDeleteDocument,
|
|
3462
6194
|
critical: true
|
|
@@ -3490,6 +6222,7 @@ const ManualIdUpload = () => {
|
|
|
3490
6222
|
const valid = form.valid.manualIdUpload;
|
|
3491
6223
|
const errors = form.errors.manualIdUpload;
|
|
3492
6224
|
const name = `${form.data.basicDetails?.firstName} ${form.data.basicDetails?.lastName}`;
|
|
6225
|
+
const country = form.data.additionalPersonalDetails?.country;
|
|
3493
6226
|
const handleFieldChange = (fieldName, mode) => handleChangeFor(fieldName, "manualIdUpload", mode);
|
|
3494
6227
|
return /* @__PURE__ */ jsx(
|
|
3495
6228
|
IdDocumentManualUpload,
|
|
@@ -3498,7 +6231,8 @@ const ManualIdUpload = () => {
|
|
|
3498
6231
|
valid,
|
|
3499
6232
|
errors,
|
|
3500
6233
|
name,
|
|
3501
|
-
handleFieldChange
|
|
6234
|
+
handleFieldChange,
|
|
6235
|
+
country
|
|
3502
6236
|
}
|
|
3503
6237
|
);
|
|
3504
6238
|
};
|
|
@@ -3573,7 +6307,7 @@ function SignatoryQuestionnaire(props) {
|
|
|
3573
6307
|
] });
|
|
3574
6308
|
}
|
|
3575
6309
|
const UboQuestionnaireModalContent = ({ modalType }) => {
|
|
3576
|
-
const { t } = useTranslation();
|
|
6310
|
+
const { t } = useTranslation("common");
|
|
3577
6311
|
const { i18n } = useI18nContext();
|
|
3578
6312
|
switch (modalType) {
|
|
3579
6313
|
case "isOwner":
|
|
@@ -4669,12 +7403,12 @@ function IndividualOnfidoDropin({
|
|
|
4669
7403
|
[country, matchingScenario, data, isExperimentEnabled, parentLegalEntity, taskType, problems]
|
|
4670
7404
|
);
|
|
4671
7405
|
useEffect(() => {
|
|
4672
|
-
const derivedProps2 = getPropsFromConfigurations(
|
|
4673
|
-
fieldConfigurations,
|
|
4674
|
-
individualOnfidoForms,
|
|
4675
|
-
problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
4676
|
-
problems?.missingData ?? [],
|
|
4677
|
-
legalEntityResponse ? getFieldsWithExistingData(
|
|
7406
|
+
const derivedProps2 = getPropsFromConfigurations({
|
|
7407
|
+
scenarioConfiguration: fieldConfigurations,
|
|
7408
|
+
forms: individualOnfidoForms,
|
|
7409
|
+
remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
7410
|
+
dataMissingErrors: problems?.missingData ?? [],
|
|
7411
|
+
fieldsWithExistingData: legalEntityResponse ? getFieldsWithExistingData(
|
|
4678
7412
|
legalEntityResponse,
|
|
4679
7413
|
individualOnfidoApiKeyMapping,
|
|
4680
7414
|
individualOnfidoDocumentMapping,
|
|
@@ -4685,13 +7419,11 @@ function IndividualOnfidoDropin({
|
|
|
4685
7419
|
"additionalPersonalDetails.issuerState"
|
|
4686
7420
|
]
|
|
4687
7421
|
) : [],
|
|
4688
|
-
fieldsFromCustomRules,
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
true
|
|
4694
|
-
);
|
|
7422
|
+
customRules: fieldsFromCustomRules,
|
|
7423
|
+
legalEntityType: legalEntityResponse?.type,
|
|
7424
|
+
legalEntityTrustedFields: [],
|
|
7425
|
+
remediationFieldAsOptional: true
|
|
7426
|
+
});
|
|
4695
7427
|
const updatedDerivedProps = mandateIdVerificationForMotionCapture(
|
|
4696
7428
|
showIndividualMotionCapture?.value,
|
|
4697
7429
|
derivedProps2
|