@adyen/kyc-components 4.0.0-compact.4 → 4.0.0-compact.8
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/{4-people-BzyXLUF9.js → 4-people-BtDi7O9A.js} +2 -2
- package/dist/{AcceptTermsOfServiceComponent-BpEgUWXz.js → AcceptTermsOfServiceComponent-kRAMcIqz.js} +37 -29
- package/dist/{Accordion-C7tT1-lq.js → Accordion-s3uIJ_O9.js} +2 -2
- package/dist/{AccountSetupRejected-Bx9bf2P2.js → AccountSetupRejected-WvT8wynP.js} +4 -4
- package/dist/{ActionBar-BYag3Mhx.js → ActionBar-BOto3kIR.js} +2 -2
- package/dist/{Address-BG5_sFfZ.js → Address-DfQEZqfV.js} +83 -288
- package/dist/{Alert-CjdHpM1t.js → Alert-_9nVl6uE.js} +3 -3
- package/dist/{Avatar-BbYg2DuO.js → Avatar-B1FMn4jz.js} +2 -2
- package/dist/{BusinessFinancingComponent-C6IiU1SV.js → BusinessFinancingComponent-DgeP0WtS.js} +7 -7
- package/dist/{BusinessFinancingDropin-BGSfIRyw.js → BusinessFinancingDropin-BpaTs3Tb.js} +691 -300
- package/dist/{BusinessFinancingPage-B6B4tyGt.js → BusinessFinancingPage-qodSYGAB.js} +5 -5
- package/dist/{BusinessTypeSelectionPage-0jkL0xW-.js → BusinessTypeSelectionPage-CsvC5c2P.js} +59 -39
- package/dist/Card-OQuFzmxm.js +90 -0
- package/dist/{debouncedInputEvent-BdLyqQK5.js → Checkbox-CQQWg0dg.js} +3 -38
- package/dist/Confirm-DqMkw97y.js +64 -0
- package/dist/ConstitutionalDocument-B1vSvDTu.js +2361 -0
- package/dist/ContactDetails-171etkPM.js +396 -0
- package/dist/ContextGuidance-PEl3_E1Y.js +34 -0
- package/dist/{ContractViewer-Byp71k2e.js → ContractViewer-DcQHIGMU.js} +2 -2
- package/dist/CountryField-61GLcHq3.js +66 -0
- package/dist/CreateIndividualComponent-U4BUiWzp.js +65 -0
- package/dist/{CreateTransferInstrumentComponent-BNvXg6_9.js → CreateTransferInstrumentComponent-CHPjKshD.js} +6 -13
- package/dist/{Currency-DpseKPZa.js → Currency-8vOxnPYI.js} +68 -13
- package/dist/{CustomerSupport-BzpGH7XC.js → CustomerSupport-DcnFyc9J.js} +13 -10
- package/dist/{DebugModal-DyH69DXv.js → DebugModal-yKPZa0En.js} +12 -9
- package/dist/{DecisionMakerDetailsPage-BiCWUl-E.js → DecisionMakerDetailsPage-bIZxlptv.js} +19 -21
- package/dist/{DecisionMakers-WTQe_49J.js → DecisionMakers-rudvJ8LE.js} +41 -25
- package/dist/Dropzone-Brt8j_On.js +224 -0
- package/dist/{EmbeddedStatus-CcwyilpG.js → EmbeddedStatus-C6KmRWYa.js} +3 -3
- package/dist/{EndStateLayout-DUFAp0sp.js → EndStateLayout-CNBH6HSv.js} +2 -2
- package/dist/EntityAssociation-CvfmwTx0.js +178 -0
- package/dist/{EntityGuidanceStatus-Bpa8WnR_.js → EntityGuidanceStatus-DfqozWFu.js} +4 -3
- package/dist/ErrorPanel-8g7vzs2J.js +194 -0
- package/dist/Field-GFhXhBL7.js +141 -0
- package/dist/{FormNavigation-BP2ZV8AF.js → FormNavigation-CuO_QOlJ.js} +3 -3
- package/dist/{FormWrapper-D2abCVld.js → FormWrapper-MyJZP-4s.js} +10 -10
- package/dist/Header-B9Tv_mvA.js +83 -0
- package/dist/Image-8l9eOMtL.js +27 -0
- package/dist/Individual.rules-NmFmV4le.js +383 -0
- package/dist/IndividualDropin-D_UTW3Pt.js +5168 -0
- package/dist/InputDate-D741B4uo.js +43 -0
- package/dist/InputGroup-WBfGDV5F.js +32 -0
- package/dist/InputText-BstgOD1h.js +134 -0
- package/dist/{Introduction-Ee8931m9.js → Introduction-586MDoqe.js} +4 -4
- package/dist/{JpAddress-Br78ZY9o.js → JpAddress-D5DwOic-.js} +62 -28
- package/dist/LandingLayout-DfrTphbg.js +60 -0
- package/dist/LegalCompanyNameField-Z2dNj0Qq.js +138 -0
- package/dist/{LegalRepresentativeDetailsPage-kZbXv8m2.js → LegalRepresentativeDetailsPage-Dkufg--B.js} +7 -12
- package/dist/Link-hYPpX6dq.js +35 -0
- package/dist/List-BAzyC6sw.js +83 -0
- package/dist/{ListItem-DKLPtRMQ.js → ListItem-DCNK7Kw1.js} +3 -3
- package/dist/LoaderWrapper-Brwtj1ws.js +42 -0
- package/dist/{ManageIndividualComponent-CrAC6lmI.js → ManageIndividualComponent-HmFUwG8J.js} +5 -5
- package/dist/{ManageTermsOfServiceComponent-D188174Y.js → ManageTermsOfServiceComponent-CEXRN-aQ.js} +5 -5
- package/dist/{ManageTransferInstrumentComponent-DDIhJrq3.js → ManageTransferInstrumentComponent-BZMoocXD.js} +20 -15
- package/dist/{Spacer-BT5nYRXK.js → MaskedInput-D1fbApUW.js} +29 -635
- package/dist/{MaybeModal-QG3JQV0A.js → MaybeModal-D1Kv1uXL.js} +3 -3
- package/dist/{Modal-B8fxl0iP.js → Modal-BRPW5V15.js} +5 -5
- package/dist/Name-DNcNeuyc.js +81 -0
- package/dist/OnboardingDropinComponent-Jp7jobVe.js +2672 -0
- package/dist/{PayoutDetailsDropin-D_ee4PgW.js → PayoutDetailsDropin-CQ8jWnhg.js} +257 -161
- package/dist/Radio-BMtxBpnn.js +39 -0
- package/dist/RadioGroup-BLGCNZj6.js +100 -0
- package/dist/RadioGroupCard-Dp6kxT2Z.js +152 -0
- package/dist/{Review-BDXmgIlE.js → Review-DsexJYqW.js} +8 -7
- package/dist/RootBusinessDetailsPage-W6I6u26i.js +50 -0
- package/dist/{RootBusinessLinesPage-CbaRG8zg.js → RootBusinessLinesPage-BfW_VGr0.js} +166 -82
- package/dist/{RootIndividualDetailsPage-D4hpO1W0.js → RootIndividualDetailsPage-CU0ERRgH.js} +10 -19
- package/dist/{useForm-BsQfbbso.js → Select-_jyQwO_g.js} +22 -779
- package/dist/{SignPCIComponent-4qzKpijW.js → SignPCIComponent-DqNgUb0y.js} +16 -13
- package/dist/{SingpassSelection-BB6R98e_.js → SingpassSelection-CInOhNfV.js} +9 -7
- package/dist/{SoleProprietorshipPage-Z5lqmwWa.js → SoleProprietorshipPage-Bgg5nHmh.js} +6 -5
- package/dist/{SourceOfFundsPage-BA638WTW.js → SourceOfFundsPage-DWz_BoML.js} +200 -421
- package/dist/Spacer-BK3jDget.js +18 -0
- package/dist/{StepProgressIndicator-Bs1V38Kt.js → StepProgressIndicator-DsULqiFr.js} +2 -2
- package/dist/StoreProvider-DwuHWsNs.js +4793 -0
- package/dist/StructuredList-CVMZBzwq.js +61 -0
- package/dist/{Summary-BOSxxPjv.js → Summary-BtqxXkko.js} +22 -6
- package/dist/{InputText-qTMbrUXW.js → TaskVerificationStatus-DQVG3_xF.js} +3 -123
- package/dist/TaxInformationField-QyHTiEoc.js +3741 -0
- package/dist/{TaxReportingDropin-CQzNhf9Q.js → TaxReportingDropin-Cs21XUR6.js} +38 -37
- package/dist/TextArea-DFDjCEZ2.js +103 -0
- package/dist/TileGroup-6wc032O1.js +203 -0
- package/dist/{TrustDetailsPage-BLNK52Za.js → TrustDetailsPage-BpITz9Vt.js} +59 -37
- package/dist/TrustMemberCompanyPage-Web2yU9Z.js +68 -0
- package/dist/{TrustMemberIndividualPage-q2iayL78.js → TrustMemberIndividualPage-tBGM6dM8.js} +13 -15
- package/dist/{TrustMemberRoleAndTypePage-C1WVoqKI.js → TrustMemberRoleAndTypePage-CJEVcHdE.js} +136 -35
- package/dist/{TrustMembersOverview-5UGm_iG9.js → TrustMembersOverview-DefELe9P.js} +14 -13
- package/dist/{UnincorporatedPartnershipIndividualPage-CyqUGlhC.js → UnincorporatedPartnershipIndividualPage-BXQiQmMN.js} +12 -14
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-D_J_JQ00.js → UnincorporatedPartnershipMemberCompanyPage-DhzsjYbl.js} +11 -7
- package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-C98KZ4pT.js → UnincorporatedPartnershipMemberRoleAndTypePage-OdKCGjaA.js} +28 -17
- package/dist/{UnincorporatedPartnershipMembersOverview-C5jfbcPJ.js → UnincorporatedPartnershipMembersOverview-DSeUBGiY.js} +10 -9
- package/dist/{VerificationErrorAlert-BJ9X1Bkv.js → VerificationErrorAlert-I8hQrG1X.js} +4 -23
- package/dist/{ViewVerificationStatusComponent-KnTqf4d6.js → ViewVerificationStatusComponent-CneXbSXW.js} +5 -4
- package/dist/accountHolderUtils-CPiTlzkl.js +66 -0
- package/dist/adyen-business-financing.js +8 -4
- package/dist/adyen-individual-configuration.js +8 -4
- package/dist/adyen-individual-status.js +5 -4
- package/dist/adyen-invited-decision-maker.js +87 -0
- package/dist/adyen-kyc-components.js +22 -20
- package/dist/adyen-onboarding.js +8 -4
- package/dist/adyen-terms-of-service-management.js +8 -4
- package/dist/adyen-terms-of-service-status.js +5 -4
- package/dist/adyen-transfer-instrument-configuration.js +8 -4
- package/dist/adyen-transfer-instrument-management.js +5 -4
- package/dist/adyen-verification-status.js +8 -4
- package/dist/{arrow-right-KxA3SvQj.js → arrow-right-BoqwUH_d.js} +2 -2
- package/dist/bafinUtils-u4rPfeF0.js +80 -0
- package/dist/{bag-BPumznWh.js → bag-BXVWLrwo.js} +2 -2
- package/dist/{bank-D6FiNBhs.js → bank-1GvaHPAZ.js} +2 -2
- package/dist/{bin-Bz6KOIeE.js → bin-Ba-3ll8T.js} +2 -2
- package/dist/{business-lines-DboUCbXw.js → business-lines-BAqTbnBw.js} +2 -2
- package/dist/{capital-GVQ3svwN.js → capital-9TKHySO7.js} +2 -2
- package/dist/{cash-stack-D9AoDDwt.js → cash-stack-DwYu4xNy.js} +2 -2
- package/dist/{certificate-CdEWgHQf.js → certificate-N2YFedpI.js} +2 -2
- package/dist/{checkmark-Q7x6tGhy.js → checkmark-D9dGhGpG.js} +2 -2
- package/dist/{checkmark-circle-x7dzbp3I.js → checkmark-circle-CFWClLQ6.js} +2 -2
- package/dist/{checkmark-circle-fill-CsvN5_PL.js → checkmark-circle-fill-DEB-tuGl.js} +2 -2
- package/dist/{checkmark-small-D35myntq.js → checkmark-small-D3VNx2lo.js} +2 -2
- package/dist/{chevron-down-C2iDorpW.js → chevron-down-C7SUSYfl.js} +2 -2
- package/dist/{chevron-left-ztPO84q-.js → chevron-left-BXmd-S46.js} +2 -2
- package/dist/{chevron-right-C_JN0oDt.js → chevron-right-jE6RwM2B.js} +2 -2
- package/dist/{chevron-up-CgG8n25g.js → chevron-up-BdfNcqzq.js} +2 -2
- package/dist/{circle-Bt3Nlr3q.js → circle-BJPTMCWB.js} +2 -2
- package/dist/{circle-small-filled-YMzP6yQU.js → circle-small-filled-BuO8Vg8j.js} +2 -2
- package/dist/{clock-BZHremOA.js → clock-DAzaBRWk.js} +2 -2
- package/dist/{coins-fkAk6dCo.js → coins-DYdzG5e_.js} +2 -2
- package/dist/commonValidators-BWyE1hKM.js +24 -0
- package/dist/company-types-value-D_mKv5PT.js +23 -0
- package/dist/{contract-BTa4HltT.js → contract-BfJb1t6M.js} +2 -2
- package/dist/{cross-Cn09MtQ_.js → cross-CDS_eot4.js} +2 -2
- package/dist/{cross-circle-fill-maan7Z5S.js → cross-circle-fill-C-EJ57Yn.js} +2 -2
- package/dist/{cross-circle-fill-small-DCz52AuN.js → cross-circle-fill-small-DkPjsuBH.js} +2 -2
- package/dist/currency-CrdnaaDu.js +35 -0
- package/dist/da-DK-B3Pg-MWO.js +13 -0
- package/dist/{da-DK-Dc0QYG8m.js → da-DK-Cd5IQPv3.js} +8 -1
- package/dist/{da-DK-CoTdzXlA.js → da-DK-DQ4ZYSea.js} +2 -2
- package/dist/da-DK-DzcTI92X.js +13 -0
- package/dist/datasetUtil-BHQp0-xL.js +58 -0
- package/dist/{de-DE-Dz2OsS1F.js → de-DE-C9NH2zMh.js} +8 -1
- package/dist/{de-DE-z0cPgxGN.js → de-DE-CkbOZ6S_.js} +2 -2
- package/dist/de-DE-S6qDey1L.js +13 -0
- package/dist/de-DE-dPfrbCii.js +13 -0
- package/dist/debouncedInputEvent-Cv2S512Y.js +46 -0
- package/dist/{decision-makers-group-CgddXgrx.js → decision-makers-group-DrvpnEqj.js} +2 -2
- package/dist/{digital-wallet-D_IpxnkN.js → digital-wallet-Bx5YM1LY.js} +2 -2
- package/dist/{document-1-C08ut-Dt.js → document-1-qlSTF558.js} +2 -2
- package/dist/{document-blurred-2Zpodj3_.js → document-blurred-BiWap0xs.js} +2 -2
- package/dist/{document-cut-off-ClS7RiOp.js → document-cut-off-aQezqOif.js} +2 -2
- package/dist/{document-expired-CjksBq-N.js → document-expired-BhBXaWWQ.js} +2 -2
- package/dist/{document-front-DiAairT3.js → document-front-DYuhZGeQ.js} +2 -2
- package/dist/{document-person-vxlA6C5f.js → document-person-CDbnTOdV.js} +2 -2
- package/dist/{download-Drhk9k1f.js → download-BZQB1WkZ.js} +2 -2
- package/dist/{dropinUtils-BYk71qFP.js → dropinUtils-NHYW3kj5.js} +4 -4
- package/dist/{edit-1-CFoDTMvQ.js → edit-1-DAqtnOIx.js} +2 -2
- package/dist/{en-US-BzrLvydZ.js → en-US-CjjPhkB5.js} +2 -2
- package/dist/{en-US-CzEL6t1W.js → en-US-D1sB335h.js} +9 -3
- package/dist/en-US-DLY20x1O.js +13 -0
- package/dist/{en-US-D-B35AoN.js → en-US-DYP6rAvA.js} +8 -1
- package/dist/{en-US-fyGPkcqX.js → en-US-cVpRgdC8.js} +2 -2
- package/dist/es-ES--IvNed_Q.js +13 -0
- package/dist/{es-ES-DUn82eVS.js → es-ES-BAolMrZ0.js} +2 -2
- package/dist/es-ES-BYl5-PFR.js +13 -0
- package/dist/{es-ES-BI_jdT67.js → es-ES-DK-7qtDf.js} +8 -1
- package/dist/{external-link-DCMYUMfW.js → external-link-Cg6pJaSJ.js} +2 -2
- package/dist/{fi-FI-hwzizPnr.js → fi-FI-BJLU1JHw.js} +8 -1
- package/dist/fi-FI-BUixKfXH.js +13 -0
- package/dist/{fi-FI-C3TTCFBv.js → fi-FI-D8WrLxxq.js} +2 -2
- package/dist/fi-FI-DFxljML-.js +13 -0
- package/dist/fieldConfigurations-BUT9DTUH.js +21 -0
- package/dist/filterProblemsByTaskForms-Cz7iQtms.js +30 -0
- package/dist/form-rules-DhbF2mY4.js +13 -0
- package/dist/formUtils-Dg7QeiCj.js +107 -0
- package/dist/{fr-FR-CYZXbwc9.js → fr-FR-B2je0smB.js} +8 -1
- package/dist/fr-FR-BM-qNLci.js +13 -0
- package/dist/{fr-FR-BbKadiaZ.js → fr-FR-Beljeilc.js} +2 -2
- package/dist/fr-FR-DPehHVb6.js +13 -0
- package/dist/{funds-in-D8bj0aoE.js → funds-in-CInoUdmG.js} +2 -2
- package/dist/{getName-9MyzlDpt.js → getName-DAC824XH.js} +2 -2
- package/dist/getProblemsForEntity-Cx2uHyD0.js +24 -0
- package/dist/getProps-Cc3J2-z9.js +148 -0
- package/dist/getTrustedFields-C5-mXl-l.js +64 -0
- package/dist/{gift-CQ_DEma7.js → gift-omNInZeB.js} +2 -2
- package/dist/{graph-BJmqglH2.js → graph-DunG_uu1.js} +2 -2
- package/dist/{graph-up-Bq6adtlX.js → graph-up-BZze4i6m.js} +2 -2
- package/dist/{headquarter-DNYyuuFq.js → headquarter-BhpSibFO.js} +2 -2
- package/dist/{hotel-BuNql78Z.js → hotel-Cp7VgGCJ.js} +2 -2
- package/dist/{house-B6sNRj-B.js → house-BhyBQdR3.js} +2 -2
- package/dist/{id-blurred-9dzBOWCE.js → id-blurred-B5lHEP8M.js} +2 -2
- package/dist/{id-cut-off-CohJCI2h.js → id-cut-off-Ba1FRzKO.js} +2 -2
- package/dist/{id-front-CSZfvdRg.js → id-front-CpNWN6nG.js} +2 -2
- package/dist/{id-glare-Q2JWo5ts.js → id-glare-DgCQON8k.js} +2 -2
- package/dist/{iframeWidget-OATZoluK.js → iframeWidget-DbWZPZHG.js} +4 -4
- package/dist/{image-BSihO8lR.js → image-CmB0ioUM.js} +2 -2
- package/dist/{info-vHTZWoJ7.js → info-Bb_-xIEK.js} +2 -2
- package/dist/{info-filled-SQotHmT9.js → info-filled-CK8LB339.js} +2 -2
- package/dist/{instant-verification-Dvvkyfmp.js → instant-verification-UrnuHTYn.js} +2 -2
- package/dist/isEmpty-CzqpRnGb.js +23 -0
- package/dist/isNewEntity-7Vw_eQBr.js +13 -0
- package/dist/{it-IT-CGhQqmiU.js → it-IT-5a7NHVFo.js} +2 -2
- package/dist/it-IT-D63gRTDc.js +13 -0
- package/dist/it-IT-DOBp2-MP.js +13 -0
- package/dist/{it-IT-Erh1DIlj.js → it-IT-Dhwa9Ecj.js} +8 -1
- package/dist/{ja-JP-D1vtig2x.js → ja-JP-B3wVYIJU.js} +38 -38
- package/dist/{ja-JP-ThzG9vIo.js → ja-JP-Bc4U0S8-.js} +9 -2
- package/dist/{ja-JP-DGNXrNMK.js → ja-JP-Bv3ru9Xq.js} +21 -14
- package/dist/{ja-JP-CSz7fEkn.js → ja-JP-CceCDXLB.js} +2 -2
- package/dist/ja-JP-DL0IjTzn.js +13 -0
- package/dist/{ja-JP-CvREJ56h.js → ja-JP-DSvZhFNY.js} +5 -5
- package/dist/{ja-JP-C6Go-kaC.js → ja-JP-g6VOUGXZ.js} +4 -4
- package/dist/japanSupportUtils-Bn6j_2Iu.js +16 -0
- package/dist/jpAddressSchema-DEOyz9Yo.js +26 -0
- package/dist/{localizeDateString-CtnAUzr_.js → localizeDateString-rX5kfMAS.js} +2 -2
- package/dist/{location-Q4oKvnkl.js → location-itJfxrDQ.js} +2 -2
- package/dist/{mail-BOdyoVqB.js → mail-VHTlAusn.js} +2 -2
- package/dist/{manual-verification-BvZWqA00.js → manual-verification-BO8zgAYT.js} +2 -2
- package/dist/{mapExistingFile-Iep6Rez8.js → mapExistingFile-euVcQ8wC.js} +81 -7
- package/dist/mapJpAddressSchemaToAddressLocalizations-A0yOTAyr.js +162 -0
- package/dist/{mapLegalEntityToIndividualOnfidoSchema-BGAZ4tOn.js → mapLegalEntityToIndividualSchema-BeggFrAo.js} +63 -3
- package/dist/{mapTransferInstrumentToPayoutAccount-C6ha6E0S.js → mapTransferInstrumentToPayoutAccount-DZ5tvBdP.js} +3 -2
- package/dist/{minus-circle-filled-kC2IUvKz.js → minus-circle-filled-ZhtJ0GD3.js} +2 -2
- package/dist/{nl-NL-O9GCHMDA.js → nl-NL-B0fvINJj.js} +8 -1
- package/dist/{nl-NL-OHlJx2bn.js → nl-NL-CmURERx_.js} +2 -2
- package/dist/nl-NL-KQ6bciOb.js +13 -0
- package/dist/nl-NL-SjOGmGk5.js +13 -0
- package/dist/no-NO-BAWVf0GX.js +13 -0
- package/dist/no-NO-Ds3VioxT.js +13 -0
- package/dist/{no-NO-CA1aR6Wh.js → no-NO-Jw7Gae-a.js} +8 -1
- package/dist/{no-NO-DEYydng4.js → no-NO-qyqWODMp.js} +2 -2
- package/dist/{onfido-logo-BWSv__sQ.js → onfido-logo-BSkKPH10.js} +2 -2
- package/dist/{options-horizontal-CBmbNv7R.js → options-horizontal-GuXvLvV3.js} +2 -2
- package/dist/{partner-CPjsrePY.js → partner-QD27Vy4w.js} +2 -2
- package/dist/{passport-blurred-B4UDQfmc.js → passport-blurred-CVG493IJ.js} +2 -2
- package/dist/{passport-cut-off-C0N2mgLk.js → passport-cut-off-COzA_TmB.js} +2 -2
- package/dist/{passport-front-BwA7wR91.js → passport-front-WJleLixT.js} +2 -2
- package/dist/{passport-front-green-BL4HmtsB.js → passport-front-green-CZVkCa1n.js} +2 -2
- package/dist/{passport-glare-Mg2ixsYA.js → passport-glare-BP5WnJZj.js} +2 -2
- package/dist/patternValidators-EfBVKdNn.js +83 -0
- package/dist/{pay-by-link-plane-BVZndh67.js → pay-by-link-plane-BpY8Q6-B.js} +2 -2
- package/dist/{payout-ChUEoLjt.js → payout-DtB68BcZ.js} +2 -2
- package/dist/{payout-verification-instant-5u-wvFKv.js → payout-verification-instant-BzpfOQLD.js} +2 -2
- package/dist/{payout-verification-manual-BH2mu0UW.js → payout-verification-manual-gNEoeZkV.js} +2 -2
- package/dist/{person-DGjUU4S4.js → person-IVZG3t3_.js} +2 -2
- package/dist/{plaid-logo-CtActXTN.js → plaid-logo-FsZ7kfL-.js} +2 -2
- package/dist/{plus-CWXA5wdX.js → plus-DiALAL8-.js} +2 -2
- package/dist/{plus-circle-filled-CbC0u2Y1.js → plus-circle-filled-BzHtTqEN.js} +2 -2
- package/dist/{process-field-configurations-BBc1EBeB.js → process-field-configurations-CAtKO6CG.js} +4 -4
- package/dist/{pt-BR-NtLaWlnZ.js → pt-BR-BaTE6BB_.js} +8 -1
- package/dist/pt-BR-BfDe_8iW.js +13 -0
- package/dist/{pt-BR-DWAziFjb.js → pt-BR-BxoOF8jB.js} +2 -2
- package/dist/pt-BR-Ct4s4jXV.js +13 -0
- package/dist/{recurring-CkL4cCM2.js → recurring-DKNs9K3x.js} +2 -2
- package/dist/{reporting-DerosUNm.js → reporting-D5ABpLO_.js} +2 -2
- package/dist/resolveEnvironment-D3grZ1cC.js +84 -0
- package/dist/{revenue-accelerate-Dp4Ns_5c.js → revenue-accelerate-D7Sp0V4a.js} +2 -2
- package/dist/{review-CxIN9azU.js → review-D4TUjcWF.js} +2 -2
- package/dist/roleMetadata-CkOicLV_.js +66 -0
- package/dist/{save-Fgy7EDid.js → save-BfqO2JBI.js} +2 -2
- package/dist/{search-C4GZ-Rc1.js → search-Cmzbf5zI.js} +2 -2
- package/dist/{show-yPjPmEf8.js → show-IdbU1C6P.js} +2 -2
- package/dist/{singpass-logo-BkMSwiGY.js → singpass-logo-wY4xsmTX.js} +2 -2
- package/dist/{singpass-verification-instant-hY4eGFwl.js → singpass-verification-instant-JCqTr7Mv.js} +2 -2
- package/dist/{singpass-verification-manual-DwhRpy5Q.js → singpass-verification-manual-DQ7XW6R3.js} +2 -2
- package/dist/sl-SI-BAIm-qBe.js +13 -0
- package/dist/{sl-SI-C5vfq7vv.js → sl-SI-DTvJT7fC.js} +2 -2
- package/dist/{sl-SI-tPwbFvOI.js → sl-SI-DbfswGh0.js} +8 -1
- package/dist/sl-SI-hxwQIw_i.js +13 -0
- package/dist/{solution-payments-CNAat9h7.js → solution-payments-DpyE_sdS.js} +2 -2
- package/dist/{store-IuAkDRAp.js → store-Btc4GcmU.js} +2 -2
- package/dist/style.css +1364 -1368
- package/dist/styles-CLV89_hH.js +1364 -1368
- package/dist/summaryItem-CAQCQSkt.js +18 -0
- package/dist/sv-SE-0PQ-U1u6.js +13 -0
- package/dist/sv-SE-BZNey_8S.js +13 -0
- package/dist/{sv-SE-K1QT1cOt.js → sv-SE-D_Efxy3s.js} +8 -1
- package/dist/{sv-SE-BrO9NKWs.js → sv-SE-N-Hqwcjq.js} +2 -2
- package/dist/{tax-reporting-graph-DjzwRgE6.js → tax-reporting-graph-hgoilCHZ.js} +2 -2
- package/dist/{terminal-1-_me9J9h0.js → terminal-1-D1pwXCoi.js} +2 -2
- package/dist/{tink-logo-BcIv93ND.js → tink-logo-DDyjz5eJ.js} +2 -2
- package/dist/types/api/address/useAddressCleanse.d.ts +1 -1
- package/dist/types/api/address/useRetrieveAddress.d.ts +1 -1
- package/dist/types/api/address/useRetrieveFromPostcodeJp.d.ts +1 -1
- package/dist/types/api/address/useSearchAddress.d.ts +1 -2
- package/dist/types/api/businessLines/useBusinessLines.d.ts +3 -3
- package/dist/types/api/businessLines/useCreateBusinessLine.d.ts +2 -2
- package/dist/types/api/businessLines/useDeleteBusinessLine.d.ts +2 -2
- package/dist/types/api/businessLines/useUpdateBusinessLines.d.ts +2 -2
- package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +2 -2
- package/dist/types/api/check/useCheck.d.ts +1 -2
- package/dist/types/api/companyDataSet/useClearCompanyData.d.ts +2 -2
- package/dist/types/api/companySearch/useCompanySearch.d.ts +1 -2
- package/dist/types/api/companySelection/useCompanySelection.d.ts +1 -1
- package/dist/types/api/configurations/useScenarios.d.ts +3 -161
- package/dist/types/api/configurations/useSupportedCountries.d.ts +1 -1
- package/dist/types/api/configurations/useTaskTypes.d.ts +1 -1
- package/dist/types/api/configurations/useVersionConfiguration.d.ts +1 -1
- package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +2 -2
- package/dist/types/api/datasets/useLegalForms.d.ts +1 -1
- package/dist/types/api/datasets/useNaceCodes.d.ts +1 -1
- package/dist/types/api/datasets/useSourceOfFundsTypes.d.ts +1 -1
- package/dist/types/api/documentValidation/useDocumentValidate.d.ts +2 -4
- package/dist/types/api/documents/useCreateDocument.d.ts +2 -2
- package/dist/types/api/documents/useDeleteDocument.d.ts +2 -2
- package/dist/types/api/documents/useDocument.d.ts +2 -2
- package/dist/types/api/documents/useDocuments.d.ts +1 -1
- package/dist/types/api/documents/useUpdateDocument.d.ts +2 -2
- package/dist/types/api/entityVerifications/useVerifyIdNumber.d.ts +2 -2
- package/dist/types/api/idNowProvider/useIdNowProvider.d.ts +3 -4
- package/dist/types/api/idVerificationProviders/idVerificationStartCheck.d.ts +2 -2
- package/dist/types/api/idVerificationProviders/useExtractDocumentInformation.d.ts +2 -2
- package/dist/types/api/idVerificationProviders/useIdVerificationToken.d.ts +3 -3
- package/dist/types/api/industryCodes/useIndustryCodes.d.ts +1 -2
- package/dist/types/api/legalEntity/useConfirmReview.d.ts +2 -2
- package/dist/types/api/legalEntity/useLegalEntity.d.ts +8 -389
- package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +2 -2
- package/dist/types/api/onboardingStatus/useGenerateOnboardingLink.d.ts +2 -2
- package/dist/types/api/onboardingStatus/useOnboardingStatus.d.ts +1 -1
- package/dist/types/api/openId/useOpenIdAuthorizationLink.d.ts +1 -2
- package/dist/types/api/pci/usePciQuestionnaireList.d.ts +1 -1
- package/dist/types/api/pci/usePciStatus.d.ts +1 -1
- package/dist/types/api/pci/usePciTemplate.d.ts +1 -1
- package/dist/types/api/pci/useSignPci.d.ts +2 -3
- package/dist/types/api/providersConfiguration/useProviderStatus.d.ts +1 -1
- package/dist/types/api/queryKeys.d.ts +1 -1
- package/dist/types/api/taskStatus/useTaskStatus.d.ts +2 -2
- package/dist/types/api/taxClassification/useTaxClassification.d.ts +1 -1
- package/dist/types/api/termsOfService/useAcceptTermsOfService.d.ts +2 -3
- package/dist/types/api/termsOfService/useAcceptedTermsOfService.d.ts +1 -7
- package/dist/types/api/termsOfService/useTermsOfService.d.ts +1 -1
- package/dist/types/api/termsOfService/useTermsOfServiceAcceptanceInfos.d.ts +1 -1
- package/dist/types/api/termsOfService/useTermsOfServiceStatus.d.ts +1 -1
- package/dist/types/api/tinVerification/useVerifyTin.d.ts +1 -1
- package/dist/types/api/transferInstruments/useBankVerificationProviders.d.ts +1 -1
- package/dist/types/api/transferInstruments/useCreateTrustedTransferInstrument.d.ts +1 -1
- package/dist/types/api/transferInstruments/useDeleteTransferInstrument.d.ts +1 -1
- package/dist/types/api/transferInstruments/useHandleBankVerificationError.d.ts +1 -1
- package/dist/types/api/transferInstruments/useTransferInstrument.d.ts +2 -2
- package/dist/types/api/transferInstruments/useTransferInstruments.d.ts +1 -1
- package/dist/types/api/transferInstruments/useUpdateTransferInstrument.d.ts +1 -1
- package/dist/types/api/transferInstruments/useUpdateTrustedTransferInstrument.d.ts +1 -1
- package/dist/types/api/types.d.ts +3 -2
- package/dist/types/api/uiAnalytics/useAnalyticsSession.d.ts +2 -2
- package/dist/types/api/uiAnalytics/usePushAnalyticEvent.d.ts +2 -2
- package/dist/types/api/validation/useValidateAccountIdentification.d.ts +2 -3
- package/dist/types/api/validation/useValidatePhoneNumber.d.ts +1 -1
- package/dist/types/components/{Shared → Apps}/tasks/TaskList/utils.d.ts +1 -5
- package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentClassification.d.ts +1 -2
- package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +0 -1
- package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +1 -0
- package/dist/types/components/BankAccount/forms/BankVerification/verification/overlay/BankVerificationOverlay.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutDetails/rules.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +0 -1
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +439 -439
- package/dist/types/components/BankAccount/pages/PayoutDetailsPage.d.ts +3 -3
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -1
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +1 -1
- package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +1 -1
- package/dist/types/components/Business/forms/AdditionalInformation/AdditionalInformation.d.ts +0 -2
- package/dist/types/components/Business/forms/AdditionalInformation/utils.d.ts +0 -3
- package/dist/types/components/Business/forms/BusinessDetails/form-ids.d.ts +2 -0
- package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +12 -11
- package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +2 -1
- package/dist/types/components/Business/forms/BusinessSelection/BusinessInformationCard/BusinessInformationCard.d.ts +4 -4
- package/dist/types/components/Business/forms/CompanyStructure/CompanyStructure.d.ts +0 -1
- package/dist/types/components/{Shared → Business}/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +1 -1
- package/dist/types/components/{Shared → Business}/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
- package/dist/types/components/{Shared → Business}/forms/FinancialInformation/mapping/mapFinancialReportsToFinancialInformation.d.ts +1 -1
- package/dist/types/components/Business/forms/rules.d.ts +11 -11
- package/dist/types/components/Business/mapping/businessDetails/businessBankAccountTaxIdUtils.d.ts +7 -0
- package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +4 -2
- package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +8 -1
- package/dist/types/components/Business/pages/RootBusinessDetailsPage.d.ts +1 -2
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +0 -2
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +4 -2
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +3 -4
- package/dist/types/components/Business/utils/companyUtil.d.ts +0 -10
- package/dist/types/components/BusinessLines/constants.d.ts +2 -0
- package/dist/types/components/BusinessLines/fields/SctaField/types.d.ts +1 -1
- package/dist/types/components/BusinessLines/fields/WebDataField/types.d.ts +1 -1
- package/dist/types/components/BusinessLines/pages/RootBusinessLinesPage.d.ts +1 -2
- package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLineModal/BusinessLineModal.d.ts +2 -1
- package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +1 -1
- package/dist/types/components/BusinessLines/tasks/types.d.ts +2 -0
- package/dist/types/components/BusinessLines/tasks/utils.d.ts +8 -4
- package/dist/types/components/BusinessLines/tasks/validate.d.ts +0 -2
- package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -1
- package/dist/types/components/EFP/fields/LegalFormField/LegalFormField.d.ts +1 -1
- package/dist/types/components/EFP/fields/NaceCodeField/NaceCodeField.d.ts +1 -1
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +5771 -541
- package/dist/types/components/EFP/mapping/mapBusinessFinancingToLegalEntity.d.ts +3 -2
- package/dist/types/components/EFP/mapping/mapLegalEntityToBusinessFinancing.d.ts +1 -1
- package/dist/types/components/EFP/pages/BusinessFinancingPage.d.ts +1 -2
- package/dist/types/components/EFP/pages/SourceOfFundsPage.d.ts +1 -2
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/AdditionalFieldsForBusinessFinancingSoleProprietor.d.ts +2 -0
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingSoleProprietorPersonalInformation.d.ts +4 -0
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +28 -0
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +14 -3
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +10 -1
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +20 -21
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +6 -4
- package/dist/types/components/EFP/tasks/TaxReportingDropin/utils.d.ts +1 -2
- package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +2 -1
- package/dist/types/components/EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent.d.ts +2 -2
- package/dist/types/components/EmbeddedDropins/InvitedDecisionMakerComponent/InvitedDecisionMakerComponent.d.ts +4 -0
- package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/DropinComposer.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/RouterDropinComposer.d.ts +4 -0
- package/dist/types/components/Individual/fields/DriversLicense/DriversLicense.types.d.ts +1 -1
- package/dist/types/components/Individual/fields/IdentityNumber/fieldConfig.d.ts +4 -3
- package/dist/types/components/Individual/forms/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +29 -0
- package/dist/types/components/Individual/forms/{IndividualOnfido/AdditionalPersonalDetails → AdditionalPersonalDetails}/Identity/Identity.types.d.ts +3 -3
- package/dist/types/components/Individual/forms/{IndividualOnfido/AdditionalPersonalDetails → AdditionalPersonalDetails}/Identity/TypeOfIdentity/index.d.ts +2 -2
- package/dist/types/components/Individual/forms/AdditionalPersonalDetails/Identity/validate.d.ts +4 -0
- package/dist/types/components/Individual/forms/{IndividualOnfido/AdditionalPersonalDetails → AdditionalPersonalDetails}/validate.d.ts +8 -8
- package/dist/types/components/Individual/forms/BasicDetails/BasicDetails.types.d.ts +22 -0
- package/dist/types/components/Individual/forms/BasicDetails/validate.d.ts +8 -0
- package/dist/types/components/Individual/forms/{IndividualOnfido/DataConflictsModal → DataConflictsModal}/ConflictRow.d.ts +1 -1
- package/dist/types/components/Individual/forms/{IndividualOnfido/DataConflictsModal → DataConflictsModal}/DataConflictsModal.d.ts +1 -1
- package/dist/types/components/Individual/forms/{Individual/IdDocumentUpload → IdDocumentUpload}/types.d.ts +5 -15
- package/dist/types/components/Individual/forms/{Individual/IdDocumentUpload → IdDocumentUpload}/utils.d.ts +1 -1
- package/dist/types/components/Individual/forms/IdNowVerificationModal/isIdNowModalOpen.d.ts +18 -0
- package/dist/types/components/Individual/forms/{IndividualOnfido/IdVerificationMethod → IdVerificationMethod}/IdVerificationMethod.types.d.ts +5 -4
- package/dist/types/components/Individual/forms/{IndividualOnfido/IdVerificationMethod → IdVerificationMethod}/OnfidoVerificationModal/OnfidoVerificationModal.d.ts +1 -1
- package/dist/types/components/Individual/forms/{IndividualOnfido/IdVerificationMethod → IdVerificationMethod}/UploadedDocument/UploadedDocument.d.ts +1 -1
- package/dist/types/components/Individual/forms/{IndividualOnfido/IdVerificationMethod → IdVerificationMethod}/individualOnfidoConflictsSchema.d.ts +5 -5
- package/dist/types/components/Individual/forms/IdVerificationMethod/mapExtractionResultToSchema.d.ts +4 -0
- package/dist/types/components/Individual/forms/{IndividualOnfido/IdVerificationMethod → IdVerificationMethod}/validateExtractionResult.d.ts +3 -3
- package/dist/types/components/Individual/forms/{IndividualOnfido/IndividualOnfido.d.ts → Individual.d.ts} +6 -2
- package/dist/types/components/Individual/forms/{IndividualOnfido/IndividualOnfido.rules.d.ts → Individual.rules.d.ts} +8 -9
- package/dist/types/components/Individual/forms/{IndividualOnfido/IndividualOnfido.types.d.ts → Individual.types.d.ts} +16 -15
- package/dist/types/components/Individual/forms/{Individual/ProofOfRelationship → ProofOfRelationship}/types.d.ts +1 -1
- package/dist/types/components/Individual/forms/{Individual/ProofOfResidency → ProofOfResidency}/types.d.ts +1 -1
- package/dist/types/components/Individual/forms/{IndividualOnfido/SignatoryQuestionnaire → SignatoryQuestionnaire}/SignatoryQuestionnaire.types.d.ts +1 -1
- package/dist/types/components/Individual/forms/{IndividualOnfido/UboQuestionnaire → UboQuestionnaire}/UboQuestionnaire.types.d.ts +2 -2
- package/dist/types/components/Individual/forms/{IndividualOnfido/UboQuestionnaire → UboQuestionnaire}/UboQuestionnaireModalContent.d.ts +1 -1
- package/dist/types/components/Individual/forms/form-ids.d.ts +2 -0
- package/dist/types/components/Individual/helpers/bafinUtils.d.ts +3 -2
- package/dist/types/components/Individual/helpers/mandateIdVerificationForMotionCapture.d.ts +2 -3
- package/dist/types/components/Individual/helpers/roleUtils.d.ts +1 -1
- package/dist/types/components/Individual/mapping/adjustOnfidoIdentificationData.d.ts +1 -1
- package/dist/types/components/Individual/mapping/getOnfidoIdentityTypeToApiIdentityTypeMap.d.ts +1 -1
- package/dist/types/components/Individual/mapping/individualKeyMappings.d.ts +6 -12
- package/dist/types/components/Individual/mapping/mapApiDocumentToIndividualDocuments.d.ts +2 -2
- package/dist/types/components/Individual/mapping/mapIndividualDocumentToApiDocument.d.ts +2 -3
- package/dist/types/components/Individual/mapping/{mapIndividualOnfidoSchemaToLegalEntity.d.ts → mapIndividualSchemaToLegalEntity.d.ts} +1 -1
- package/dist/types/components/Individual/mapping/{mapLegalEntityToIndividualOnfidoSchema.d.ts → mapLegalEntityToIndividualSchema.d.ts} +1 -1
- package/dist/types/components/Individual/pages/DecisionMakerDetailsPage.d.ts +6 -7
- package/dist/types/components/Individual/pages/LegalRepresentativeDetailsPage.d.ts +2 -2
- package/dist/types/components/Individual/pages/RootIndividualDetailsPage.d.ts +2 -2
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +2 -14
- package/dist/types/components/Individual/tasks/DecisionMakers/RemediationAlerts/remediation.config.d.ts +0 -2
- package/dist/types/components/Individual/tasks/DecisionMakers/types.d.ts +8 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
- package/dist/types/components/Individual/tasks/IndividualDropin/IndividualDropin.d.ts +2 -2
- package/dist/types/components/Individual/tasks/IndividualDropin/individualFormConfig.d.ts +3 -3
- package/dist/types/components/Shared/EntityAssociation/EntityAssociation.d.ts +0 -1
- package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/fieldConfig.d.ts +10 -0
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +2 -1
- package/dist/types/components/Shared/fields/CountryField/types.d.ts +2 -1
- package/dist/types/components/Shared/fields/CountryOfGoverningLawField/CountryOfGoverningLawField.d.ts +1 -1
- package/dist/types/components/Shared/fields/CountryOfGoverningLawField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/Currency/Currency.d.ts +1 -1
- package/dist/types/components/Shared/fields/Currency/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/DBANameField/DBANameField.d.ts +1 -1
- package/dist/types/components/Shared/fields/DBANameField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/DateOfIncorporationField/DateOfIncorporationField.d.ts +1 -1
- package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +3 -1
- package/dist/types/components/Shared/fields/EInvoicingCodeField/EInvoicingCodeField.d.ts +1 -1
- package/dist/types/components/Shared/fields/EInvoicingCodeField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +119 -1
- package/dist/types/components/Shared/fields/IndustryCodeField/IndustryCodeField.d.ts +1 -1
- package/dist/types/components/Shared/fields/IndustryCodeField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/LegalCompanyNameField/fieldConfig.d.ts +12 -6
- package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +3 -1
- package/dist/types/components/{Individual → Shared}/fields/LocalizedNameFields/types.d.ts +2 -2
- package/dist/types/components/Shared/fields/LocalizedNameFields/validate.d.ts +5 -0
- package/dist/types/components/Shared/fields/NumberOfEmployees/NumberOfEmployees.d.ts +1 -1
- package/dist/types/components/Shared/fields/NumberOfEmployees/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -1
- package/dist/types/components/Shared/fields/PhoneField/fieldConfig.d.ts +5 -0
- package/dist/types/components/Shared/fields/PhoneField/types.d.ts +2 -1
- package/dist/types/components/Shared/fields/StateField/StateField.d.ts +1 -1
- package/dist/types/components/Shared/fields/StateField/fieldConfig.d.ts +8 -0
- package/dist/types/components/Shared/fields/StateField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockExchangeMICField/StockExchangeMICField.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockExchangeMICField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockISINField/StockISINField.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockISINField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockTickerSymbol/StockTickerSymbolField.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockTickerSymbol/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +1 -1
- package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +6 -0
- package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +2 -1
- package/dist/types/components/Shared/fields/VatNumberField/VatNumberField.d.ts +1 -1
- package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/Address.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +1 -1
- package/dist/types/components/Trust/forms/Trust/rules.d.ts +2 -2
- package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +1 -1
- package/dist/types/components/Trust/pages/TrustDetailsPage.d.ts +1 -2
- package/dist/types/components/Trust/pages/TrustMemberCompanyPage.d.ts +3 -3
- package/dist/types/components/Trust/pages/TrustMemberIndividualPage.d.ts +5 -5
- package/dist/types/components/Trust/pages/TrustMemberRoleAndTypePage.d.ts +2 -2
- package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +1 -1
- package/dist/types/components/Trust/tasks/TrustDropin/TrustMultiform.d.ts +2 -1
- package/dist/types/components/Trust/tasks/TrustMembers/TrustMembersOverview.d.ts +1 -2
- package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +1 -1
- package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipIndividualPage.d.ts +5 -5
- package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberCompanyPage.d.ts +3 -3
- package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberRoleAndTypePage.d.ts +1 -1
- package/dist/types/components/ui/atoms/Card/Card.d.ts +19 -0
- package/dist/types/components/ui/atoms/Loader/Loader.d.ts +11 -1
- package/dist/types/components/ui/atoms/MultiSelectList/MultiSelectList.d.ts +0 -1
- package/dist/types/components/ui/atoms/Svg/Svg.d.ts +0 -1
- package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +1 -1
- package/dist/types/components/ui/molecules/ErrorPanel/ErrorPanel.d.ts +0 -1
- package/dist/types/context/ExperimentContext/types.d.ts +19 -42
- package/dist/types/context/QueryContext/QueryClient.d.ts +1 -1
- package/dist/types/context/StateContext/types.d.ts +2 -3
- package/dist/types/core/models/api/individual.d.ts +3 -0
- package/dist/types/core/models/api/instant-id-verification.d.ts +1 -1
- package/dist/types/core/models/api/legal-arrangement.d.ts +3 -0
- package/dist/types/core/models/api/legal-entity-association.d.ts +1 -1
- package/dist/types/core/process-field-configurations.d.ts +0 -5
- package/dist/types/core/services/types.d.ts +1 -1
- package/dist/types/core/user-events.d.ts +4 -2
- package/dist/types/embeds/baseEmbedProps.d.ts +0 -21
- package/dist/types/embeds/business-financing/adyen-business-financing.d.ts +2 -1
- package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +5 -0
- package/dist/types/embeds/individual-configuration/adyen-individual-configuration.d.ts +5 -1
- package/dist/types/embeds/individual-configuration/adyen-individual-configuration.types.d.ts +7 -2
- package/dist/types/embeds/individual-status/adyen-individual-status.types.d.ts +5 -0
- package/dist/types/embeds/invited-decision-maker/adyen-invited-decision-maker.d.ts +5 -0
- package/dist/types/embeds/invited-decision-maker/adyen-invited-decision-maker.types.d.ts +39 -0
- package/dist/types/embeds/onboarding/adyen-onboarding.d.ts +2 -1
- package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +5 -0
- package/dist/types/embeds/terms-of-service-management/adyen-terms-of-service-management.d.ts +5 -1
- package/dist/types/embeds/terms-of-service-management/adyen-terms-of-service-management.types.d.ts +5 -0
- package/dist/types/embeds/terms-of-service-status/adyen-terms-of-service-status.types.d.ts +5 -0
- package/dist/types/embeds/transfer-instrument-configuration/adyen-transfer-instrument-configuration.d.ts +2 -1
- package/dist/types/embeds/transfer-instrument-configuration/adyen-transfer-instrument-configuration.types.d.ts +5 -0
- package/dist/types/embeds/transfer-instrument-management/adyen-transfer-instrument-management.types.d.ts +5 -0
- package/dist/types/embeds/verification-status/adyen-verification-status.d.ts +2 -1
- package/dist/types/embeds/verification-status/adyen-verification-status.types.d.ts +5 -0
- package/dist/types/hooks/useAssociatedLegalEntity.d.ts +1 -1
- package/dist/types/hooks/useForm/types.d.ts +0 -8
- package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +4 -2
- package/dist/types/hooks/usePageLandedEvent.d.ts +7 -0
- package/dist/types/hooks/useUboQuestionnaire.d.ts +2 -2
- package/dist/types/language/types.d.ts +7 -2
- package/dist/types/language/utils.d.ts +1 -2
- package/dist/types/router/DefaultRouteRedirect.d.ts +8 -0
- package/dist/types/router/MemoryRouterContext.d.ts +9 -0
- package/dist/types/router/OnboardingRouter.d.ts +39 -0
- package/dist/types/router/SuspenseRoute.d.ts +7 -0
- package/dist/types/router/getDefaultTask.d.ts +16 -0
- package/dist/types/router/routeConfig.d.ts +68 -0
- package/dist/types/router/useCurrentTask.d.ts +5 -0
- package/dist/types/router/useNavigate.d.ts +7 -0
- package/dist/types/stores/formState.d.ts +1 -1
- package/dist/types/stores/globalStore/taskStatus.d.ts +5 -3
- package/dist/types/types/assert.d.ts +1 -0
- package/dist/types/types/form-rules.d.ts +0 -1
- package/dist/types/utils/addLinkedFields.d.ts +0 -2
- package/dist/types/utils/analytics/debouncedInputEvent.d.ts +1 -0
- package/dist/types/utils/analytics/getPrefilledDetails.d.ts +28 -0
- package/dist/types/utils/api/processCapabilitites.d.ts +14 -2
- package/dist/types/utils/birthDateUtils.d.ts +0 -17
- package/dist/types/utils/entityAssociationUtil.d.ts +3 -4
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/fieldConfigurations.d.ts +0 -2
- package/dist/types/utils/formUtils.d.ts +1 -6
- package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -2
- package/dist/types/utils/getFieldsWithExistingData.d.ts +2 -3
- package/dist/types/utils/getName.d.ts +1 -1
- package/dist/types/utils/japanSupportUtils.d.ts +2 -1
- package/dist/types/utils/logger.d.ts +0 -1
- package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
- package/dist/types/utils/performance.d.ts +64 -0
- package/dist/types/utils/regex/patternValidators.d.ts +1 -1
- package/dist/types/utils/translation.d.ts +3 -2
- package/dist/types/utils/validatorUtils.d.ts +2 -1
- package/dist/types/utils/verification/helpers/verifyIdNumber.d.ts +3 -2
- package/dist/{types-Dk94b8kx.js → types-B7GElie6.js} +21 -44
- package/dist/{types-fRMvVcuU.js → types-BveVR11j.js} +2 -2
- package/dist/{types-DtV30rT3.js → types-COOK2jmb.js} +3 -26
- package/dist/{types-Q8QbiVOz.js → types-DlIEfVQ_.js} +2 -2
- package/dist/unincorporated-partnership-MeN1dp53.js +97 -0
- package/dist/{upload-BF65P4KM.js → upload-BmUXjsaU.js} +2 -2
- package/dist/{us-check-CYY6Crhr.js → us-check-C1rTBsCY.js} +2 -2
- package/dist/{us-check-account-number-C7KE5YzX.js → us-check-account-number-9lI1dXNC.js} +2 -2
- package/dist/{us-check-routing-number-DUbhsYAR.js → us-check-routing-number-s_KaAGSM.js} +2 -2
- package/dist/{useAssociatedLegalEntity-CtNg5gYS.js → useAssociatedLegalEntity-BMeOu2ox.js} +3 -2
- package/dist/useBusinessDetailsData-CAiFFs88.js +5197 -0
- package/dist/useBusinessLines-DG-LapFA.js +29 -0
- package/dist/useCanSeeIntroduction-DJUYy5a5.js +48 -0
- package/dist/{useCreateLegalEntity-DIzVLIrw.js → useCreateLegalEntity-BzRbiLpn.js} +3 -2
- package/dist/useDataMissingRemediations-x7yza9Ka.js +41 -0
- package/dist/useDataset-CDtTEXqi.js +76 -0
- package/dist/useDeleteTransferInstrument-S3FmBm7Z.js +32 -0
- package/dist/useForm-De1DLL-w.js +582 -0
- package/dist/{FormFlow-DX2A0gcf.js → useFormContext-BPBBPKhK.js} +26 -31
- package/dist/{useGlobalData-CO2a2RhB.js → useGlobalData-DemxVumJ.js} +3 -3
- package/dist/useId-BZ0PA7jP.js +24 -0
- package/dist/{useMultiForm-BkNgL1zi.js → useMultiForm-Cs0-iUXR.js} +46 -37
- package/dist/useNavigate-DdA-YVRy.js +265 -0
- package/dist/{useOnboardingStatus-BB5IzxTg.js → useOnboardingStatus-DeOWI7wU.js} +3 -2
- package/dist/usePciQuestionnaireList-rxdFFrP5.js +29 -0
- package/dist/useSalesChannels-CI133F-6.js +65 -0
- package/dist/{useScenarios-yIXrDacU.js → useScenarios-BE647UZ3.js} +7 -5
- package/dist/useSetting-BkKRHr6e.js +19 -0
- package/dist/useTaskStatus-DdTyBvAb.js +51 -0
- package/dist/{useTermsOfServiceStatus-BRdLkis6.js → useTermsOfServiceStatus-uSdmiCT3.js} +3 -2
- package/dist/{useToastContext-BQYYaLd-.js → useToastContext-B1vl-x5N.js} +6 -17
- package/dist/useTrustMembers-BOp5wFXa.js +163 -0
- package/dist/{useUnincorporatedPartnershipMembers-fl3LbBcx.js → useUnincorporatedPartnershipMembers-D7WsY1Dm.js} +5 -5
- package/dist/useUpdateBusinessLines-CdYUvjtv.js +339 -0
- package/dist/{useUpdateLegalEntity-CIZP-vhE.js → useUpdateLegalEntity-3og4ank0.js} +4 -3
- package/dist/utils-CHdXRuoO.js +159 -0
- package/dist/utils-CK72-tJC.js +29 -0
- package/dist/{utils-_N6wjH1k.js → utils-CXUBcmhg.js} +6 -6
- package/dist/utils-CYscdqdR.js +58 -0
- package/dist/{utils-BtBmicYe.js → utils-Ds83U_vM.js} +26 -22
- package/dist/{documentUtils-CmY7W1gB.js → validate-CoZiS4Ny.js} +171 -6
- package/dist/{validate-yIqc2enK.js → validate-TM7n49em.js} +10 -2
- package/dist/{validationError-BcmQ2z0b.js → validationError-DozI7J9X.js} +3 -3
- package/dist/{warning-circle-fill-CEN1WL7A.js → warning-circle-fill-DBvt921B.js} +2 -2
- package/dist/{warning-diamond-filled-BfXMlVrG.js → warning-diamond-filled-Lb2od2ry.js} +2 -2
- package/dist/{webinar-DqjqrNEv.js → webinar-m9nuFZBt.js} +2 -2
- package/dist/{yapily-logo-CZ4ywjwA.js → yapily-logo-BduxhNRA.js} +2 -2
- package/package.json +88 -56
- package/dist/Card-BHab7Kyt.js +0 -82
- package/dist/ConstitutionalDocument--Z--xpF7.js +0 -143
- package/dist/CountryField-BIYJvEAW.js +0 -843
- package/dist/CreateIndividualComponent-3t1p_6gB.js +0 -71
- package/dist/EntityAssociation-0B8bfpR4.js +0 -159
- package/dist/IndividualOnfido-BxhmIQwc.js +0 -9662
- package/dist/IndividualOnfidoDropin-Cy08-w8F.js +0 -2575
- package/dist/OnboardingDropinComponent-Cu2pv74K.js +0 -7623
- package/dist/RootBusinessDetailsPage-ChobUam3.js +0 -49
- package/dist/StoreProvider-DTMSAVgy.js +0 -7707
- package/dist/TrustMemberCompanyPage-DwVARA6c.js +0 -64
- package/dist/da-DK-CrtuBoDC.js +0 -118
- package/dist/da-DK-uHPPFvD-.js +0 -13
- package/dist/de-DE-SMf6w4NJ.js +0 -13
- package/dist/de-DE-mH3MobT9.js +0 -13
- package/dist/en-US-d4WBvUW7.js +0 -118
- package/dist/es-ES-BqpvBqmR.js +0 -13
- package/dist/es-ES-CnyVffM-.js +0 -118
- package/dist/fi-FI-DPegZzTc.js +0 -13
- package/dist/fi-FI-kXC-0USa.js +0 -118
- package/dist/fr-FR-6YOKsDLQ.js +0 -13
- package/dist/fr-FR-BPGwsLDa.js +0 -13
- package/dist/getFieldsWithExistingData-D6K7_vTh.js +0 -22
- package/dist/hasDataChanged-6p9Ib-IH.js +0 -19
- package/dist/id-verification-instant-BUVBO4R3.js +0 -58
- package/dist/id-verification-manual-B3YZALYU.js +0 -55
- package/dist/it-IT-B1eJg9RL.js +0 -13
- package/dist/it-IT-DyCHFg-b.js +0 -118
- package/dist/ja-JP-PnqAHl14.js +0 -13
- package/dist/mapFinancialReportsToFinancialInformation-CeqxQKYv.js +0 -67
- package/dist/mapJpAddressSchemaToAddressLocalizations-C22nFO39.js +0 -63
- package/dist/nl-NL-DkbhmJAw.js +0 -118
- package/dist/nl-NL-cVVIDG7s.js +0 -13
- package/dist/no-NO-C_tmZ39d.js +0 -13
- package/dist/no-NO-Df5qUoTc.js +0 -118
- package/dist/pt-BR-BOOm5lRR.js +0 -118
- package/dist/pt-BR-CMiGlY3k.js +0 -13
- package/dist/resolveEnvironment-DV8jSeQ4.js +0 -164
- package/dist/rules-Cu3mKCzh.js +0 -317
- package/dist/sl-SI-C3nGkfNb.js +0 -13
- package/dist/sl-SI-CGvCdquD.js +0 -118
- package/dist/sv-SE-BP2Oun8l.js +0 -118
- package/dist/sv-SE-CXn28ybc.js +0 -13
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/mandatoryFields.d.ts +0 -3
- package/dist/types/components/Individual/fields/DecisionMakerRole/DecisionMakerRole.d.ts +0 -3
- package/dist/types/components/Individual/fields/DecisionMakerRole/NomineeDecisionMakerRole.d.ts +0 -10
- package/dist/types/components/Individual/fields/DecisionMakerRole/types.d.ts +0 -23
- package/dist/types/components/Individual/fields/NameFields/validate.d.ts +0 -4
- package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/IdDocumentAlreadyUpload.d.ts +0 -2
- package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/IdDocumentInstantVerification.d.ts +0 -3
- package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/IdDocumentUpload.d.ts +0 -3
- package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/IdVerificationMethod.d.ts +0 -3
- package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/idVerificationMethodMetadata.d.ts +0 -15
- package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/types.d.ts +0 -14
- package/dist/types/components/Individual/forms/Individual/Individual.d.ts +0 -9
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/Identity.d.ts +0 -2
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityAu/IdentityAu.d.ts +0 -2
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityAu/validate.d.ts +0 -3
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityHK/IdentityHK.d.ts +0 -2
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityHK/validate.d.ts +0 -3
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityNZ/IdentityNZ.d.ts +0 -2
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityNZ/validate.d.ts +0 -3
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/TypeOfIdentity/index.d.ts +0 -11
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/identityUS/IdentityUS.d.ts +0 -4
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/types.d.ts +0 -14
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/PersonalDetails.d.ts +0 -3
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/types.d.ts +0 -41
- package/dist/types/components/Individual/forms/Individual/PersonalDetails/validate.d.ts +0 -21
- package/dist/types/components/Individual/forms/Individual/rules.d.ts +0 -40
- package/dist/types/components/Individual/forms/Individual/types.d.ts +0 -51
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +0 -29
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/Identity/validate.d.ts +0 -4
- package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +0 -22
- package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/validate.d.ts +0 -6
- package/dist/types/components/Individual/forms/IndividualOnfido/IdNowVerificationModal/isIdNowModalOpen.d.ts +0 -17
- package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/mapExtractionResultToSchema.d.ts +0 -4
- package/dist/types/components/Individual/helpers/isOnfidoAutofillFlowEnabled.d.ts +0 -4
- package/dist/types/components/Individual/mapping/adjustIdentificationData.d.ts +0 -3
- package/dist/types/components/Individual/mapping/getIdentityTypeToApiIdentityTypeMap.d.ts +0 -3
- package/dist/types/components/Individual/mapping/individualOnfidoKeyMappings.d.ts +0 -8
- package/dist/types/components/Individual/mapping/mapIndividualToLegalEntity.d.ts +0 -3
- package/dist/types/components/Individual/mapping/mapLegalEntityToIndividual.d.ts +0 -3
- package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoDropin.d.ts +0 -2
- package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/individualOnfidoFormConfig.d.ts +0 -4
- package/dist/types/components/Shared/forms/BusinessTypeSelection/EntityTypeRadioGroupCard.d.ts +0 -11
- package/dist/types/components/ui/molecules/Card/Card.d.ts +0 -3
- package/dist/types/components/ui/molecules/Card/types.d.ts +0 -26
- package/dist/types/embeds/EmbedBaseElement.d.ts +0 -41
- package/dist/types/embeds/EmbedCore.d.ts +0 -22
- package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +0 -14
- package/dist/types/embeds/individual-configuration/AdyenIndividual.d.ts +0 -12
- package/dist/types/embeds/individual-status/AdyenManageIndividual.d.ts +0 -12
- package/dist/types/embeds/onboarding/AdyenOnboarding.d.ts +0 -12
- package/dist/types/embeds/terms-of-service-management/AdyenTermsOfService.d.ts +0 -12
- package/dist/types/embeds/terms-of-service-status/AdyenManageTermsOfService.d.ts +0 -12
- package/dist/types/embeds/transfer-instrument-configuration/AdyenTransferInstrument.d.ts +0 -16
- package/dist/types/embeds/transfer-instrument-management/AdyenManageTransferInstrument.d.ts +0 -14
- package/dist/types/embeds/verification-status/AdyenVerificationStatus.d.ts +0 -20
- package/dist/useBusinessDetailsData-kMDQy2r1.js +0 -2441
- package/dist/useDataset-D1R4kueP.js +0 -220
- package/dist/useUpdateBusinessLines-DWsML109.js +0 -46
- package/dist/validate-C4R1LPcu.js +0 -41
- /package/dist/types/components/{Shared → Apps}/tasks/TaskList/PayoutAccountTaskListItem.d.ts +0 -0
- /package/dist/types/components/{Shared → Apps}/tasks/TaskList/TaskList.d.ts +0 -0
- /package/dist/types/components/{Shared → Apps}/tasks/TaskList/TaskListGroup.d.ts +0 -0
- /package/dist/types/components/{Shared → Apps}/tasks/TaskList/TaskListItem.d.ts +0 -0
- /package/dist/types/components/{Shared → Apps}/tasks/TaskList/types.d.ts +0 -0
- /package/dist/types/components/{Shared → Business}/forms/FinancialInformation/FinancialInformation.d.ts +0 -0
- /package/dist/types/components/{Shared → Business}/forms/FinancialInformation/ReportedValue.d.ts +0 -0
- /package/dist/types/components/{Shared → Business}/forms/FinancialInformation/types.d.ts +0 -0
- /package/dist/types/components/{Shared → Business}/forms/FinancialInformation/validate.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/AdditionalPersonalDetails → AdditionalPersonalDetails}/AdditionalPersonalDetails.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/AdditionalPersonalDetails → AdditionalPersonalDetails}/Identity/Identity.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/BasicDetails → BasicDetails}/BasicDetails.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/GuidanceQuestion → GuidanceQuestion}/GuidanceQuestion.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{Individual/IdDocumentUpload → IdDocumentUpload}/IdDocumentManualUpload.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/IdNowVerificationModal → IdNowVerificationModal}/IdNowVerificationModal.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{Individual/IdVerification → IdVerification}/IdVerification.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{Individual/IdVerification → IdVerification}/idVerificationProviderId.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{Individual/IdVerification → IdVerification}/types.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/IdVerificationMethod → IdVerificationMethod}/IdVerificationMethod.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/ManualIdUpload → ManualIdUpload}/ManualIdUpload.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{Individual/ProofOfRelationship → ProofOfRelationship}/index.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{Individual/ProofOfResidency → ProofOfResidency}/ProofOfResidency.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/SignatoryQuestionnaire → SignatoryQuestionnaire}/SignatoryQuestionnaire.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/SignatoryQuestionnaire → SignatoryQuestionnaire}/SignatoryQuestionnaireModalContent.d.ts +0 -0
- /package/dist/types/components/Individual/forms/{IndividualOnfido/UboQuestionnaire → UboQuestionnaire}/UboQuestionnaire.d.ts +0 -0
- /package/dist/types/components/Individual/tasks/{IndividualOnfidoDropin/IndividualOnfidoStore.d.ts → IndividualDropin/IndividualStore.d.ts} +0 -0
- /package/dist/types/components/{Individual → Shared}/fields/LocalizedNameFields/LocalizedNameFields.d.ts +0 -0
|
@@ -1,2575 +0,0 @@
|
|
|
1
|
-
;
|
|
2
|
-
{
|
|
3
|
-
try {
|
|
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] = "314b090f-77c1-4305-aa1d-369208f3b6f7", e._sentryDebugIdIdentifier = "sentry-dbid-314b090f-77c1-4305-aa1d-369208f3b6f7");
|
|
6
|
-
} catch (e) {
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
;
|
|
10
|
-
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
11
|
-
import { useMemo, useState, useEffect, useCallback, useRef } from "preact/hooks";
|
|
12
|
-
import { u as useScenarios } from "./useScenarios-yIXrDacU.js";
|
|
13
|
-
import { b as useApiContext, a0 as useMutation, k as httpPost, aE as matchesRegex, aQ as trimValWithOneSpace, aF as NO_ALPHABET_REGEX, aG as EMOJI_REGEX, aH as hasRepeatedCharacters, aI as isInvalidName, b0 as INDIVIDUAL_VALID_CHAR_REGEX, aO as getFormattingRegEx, aP as SPECIAL_CHARS, C as CountryCodes, aL as standardKatakanaValidator, aM as standardKanjiValidator, W as isEmpty, O as TaskTypes, r as LegalEntityTypes, b1 as getAgeToday, b2 as euCountries, b3 as individualApiKeyMapping, a_ as reverseMapping, b4 as getNomineeFromAssociation, b5 as individualComponentsKeyMapping, b6 as drop, P as createLogger, K as useAccountHolder, V as useI18nContext, a3 as useAnalyticsContext, X as useExperimentsContext, $ as useVersionConfiguration, o as useSettingsContext, g as getLegalEntityCountry, b7 as getAllowedDecisionMakerRoles, b8 as filterOutUnwantedAssociationsIfRootLE, aB as cloneObject, b9 as individualDocumentMapping, ba as individualObscuredFields, ag as getOwnEntityAssociations, bb as hasNomineesChanged, bc as attachNomineeToRole, aV as doArraysMatch, j as useQuery, w as skipToken, m as httpGet, u as useTranslation, a2 as useQueryClient, B as Button, L as Loader, bd as individualOnfidoApiKeyMapping, am as Scenarios, an as DecisionMakerTypes, be as individualOnfidoDocumentMapping, bf as individualOnfidoObscuredFields } from "./StoreProvider-DTMSAVgy.js";
|
|
14
|
-
import { u as useCreateLegalEntity } from "./useCreateLegalEntity-DIzVLIrw.js";
|
|
15
|
-
import { u as useUpdateLegalEntity } from "./useUpdateLegalEntity-CIZP-vhE.js";
|
|
16
|
-
import { h as useProviderStatus, l as addressValidators, n as addressFormatters, o as mapAddressLabels } from "./Address-BG5_sFfZ.js";
|
|
17
|
-
import { c as contactDetailsValidationRules, u as useValidatePhoneNumberImperatively } from "./validate-C4R1LPcu.js";
|
|
18
|
-
import { F as FormContextProvider, a as FormFlow } from "./FormFlow-DX2A0gcf.js";
|
|
19
|
-
import { a as useToastContext } from "./useToastContext-BQYYaLd-.js";
|
|
20
|
-
import { g as getPropsFromConfigurations, c as composePerScenarioFormConfigurations } from "./process-field-configurations-BBc1EBeB.js";
|
|
21
|
-
import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer } from "./dropinUtils-BYk71qFP.js";
|
|
22
|
-
import { u as useMultiForm } from "./useMultiForm-BkNgL1zi.js";
|
|
23
|
-
import { m as mapExistingFile, g as getPageName, a as getPage, u as useScenarioConfiguration } from "./mapExistingFile-Iep6Rez8.js";
|
|
24
|
-
import { x as getSSNType, y as defaultFieldMetadata, z as defaultFieldConfig, A as defaultFieldMetadata$1, B as fieldConfig, t as taxInformationDefaultFieldMetadata, f as taxInformationDefaultFieldConfig, D as isEmpty$1, E as getTrustedFields, F as getAsyncIdNumberValidationRule, G as getAsyncPhoneValidationRules, H as setHasMotionCaptureScenario, I as showIndividualMotionCapture, p as individualForms, J as Individual, K as individualDocumentForms, L as idVerificationProviderId, M as idNowModalChildEntityId, N as LandingLayout, w as showIdNowModal, O as check4DigitSsnFailed, P as individualOnfidoRules, o as individualOnfidoForms, Q as isNextStepDisabled, R as shouldShowIdNowModal, U as IndividualOnfido, i as isCompatibleJapanVersion, V as JP_ADDRESS_REQUIRED_FIELDS, W as GuidanceQuestionValues, X as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./IndividualOnfido-BxhmIQwc.js";
|
|
25
|
-
import { i as isValidationError, p as processValidationErrors, a as isMaintenanceModeError } from "./validationError-BcmQ2z0b.js";
|
|
26
|
-
import { g as getIdDocument, a as getDocument, c as createDocumentRequest, d as documentApiUtils, m as mergeAttachments, b as getFileExtention } from "./documentUtils-CmY7W1gB.js";
|
|
27
|
-
import { a as datasetUtilities, C as Confirm } from "./useDataset-D1R4kueP.js";
|
|
28
|
-
import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-D6K7_vTh.js";
|
|
29
|
-
import { l as localizeDateString } from "./localizeDateString-CtnAUzr_.js";
|
|
30
|
-
import { o as omitObscuredFieldsIfUnchanged, I as IFrameWidget } from "./iframeWidget-OATZoluK.js";
|
|
31
|
-
import { r as resolveFieldMetadata, w as getLocalizedIdDocumentTypeOptions, I as Image } from "./Spacer-BT5nYRXK.js";
|
|
32
|
-
import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE } from "./rules-Cu3mKCzh.js";
|
|
33
|
-
import { f as formatObject } from "./utils-DNSfZiio.js";
|
|
34
|
-
import { m as mapSchemaFieldsToApiScriptLocalization, a as mapApiScriptLocalizationToSchemaFields } from "./mapAddressLocalizationToJpAddressSchema-vJWbpAyq.js";
|
|
35
|
-
import { Show } from "@preact/signals/utils";
|
|
36
|
-
import { m as mapJpAddressSchemaToAddressLocalizations, a as mapJpAddressSummary } from "./mapJpAddressSchemaToAddressLocalizations-C22nFO39.js";
|
|
37
|
-
import { g as getOnfidoIdentityTypeToApiIdentityTypeMap, i as individualFormDefaultData, m as mapLegalEntityToIndividualOnfidoSchema } from "./mapLegalEntityToIndividualOnfidoSchema-BGAZ4tOn.js";
|
|
38
|
-
import { lazy } from "preact/compat";
|
|
39
|
-
import { M as Modal } from "./Modal-B8fxl0iP.js";
|
|
40
|
-
import { a as Alert } from "./Alert-CjdHpM1t.js";
|
|
41
|
-
import { a as getIndividualLegalEntityName } from "./getName-9MyzlDpt.js";
|
|
42
|
-
const verifyIdNumber = async (legalEntityId, baseUrl, data) => {
|
|
43
|
-
return await httpPost(
|
|
44
|
-
{
|
|
45
|
-
baseUrl,
|
|
46
|
-
path: `legalEntities/${legalEntityId}/verifications/idNumber`,
|
|
47
|
-
// Handler for unhappy flows, i.e. status != 200, in the idNumber verification process
|
|
48
|
-
errorHandler: async (response) => {
|
|
49
|
-
const responseData = await response;
|
|
50
|
-
if (responseData.status === 422) {
|
|
51
|
-
return { status: 422, message: responseData.detail, errorCode: responseData.errorCode };
|
|
52
|
-
}
|
|
53
|
-
if (responseData.status === 500) {
|
|
54
|
-
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
data
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
const useVerifyIdNumber = (options) => {
|
|
62
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
63
|
-
return useMutation({
|
|
64
|
-
mutationFn: (data) => verifyIdNumber(rootLegalEntityId.value, baseUrl.value, data),
|
|
65
|
-
...options
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
const startVerificationCheck = async (rootLegalEntityId, baseUrl, data) => {
|
|
69
|
-
return httpPost(
|
|
70
|
-
{
|
|
71
|
-
baseUrl,
|
|
72
|
-
path: `legalEntities/${rootLegalEntityId}/providers/idVerification/process`
|
|
73
|
-
},
|
|
74
|
-
data
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
const useIdVerificationStartCheck = (options) => {
|
|
78
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
79
|
-
return useMutation({
|
|
80
|
-
mutationFn: (data) => startVerificationCheck(rootLegalEntityId.value, baseUrl.value, data),
|
|
81
|
-
...options
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
const nameValidationRulesV4 = {
|
|
85
|
-
firstName: [
|
|
86
|
-
{
|
|
87
|
-
modes: ["blur"],
|
|
88
|
-
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
89
|
-
errorMessage: "nameMustContainLetters"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
modes: ["blur"],
|
|
93
|
-
validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && !isInvalidName(input) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, input),
|
|
94
|
-
errorMessage: "checkForTypos"
|
|
95
|
-
}
|
|
96
|
-
],
|
|
97
|
-
lastName: [
|
|
98
|
-
{
|
|
99
|
-
modes: ["blur"],
|
|
100
|
-
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
101
|
-
errorMessage: "nameMustContainLetters"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
modes: ["blur"],
|
|
105
|
-
validate: (input) => !matchesRegex(EMOJI_REGEX, input) && !hasRepeatedCharacters(input) && !isInvalidName(input) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, input),
|
|
106
|
-
errorMessage: "checkForTypos"
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
};
|
|
110
|
-
const specialCharsRegEx = getFormattingRegEx(SPECIAL_CHARS.replace("-", ""));
|
|
111
|
-
const nameFormatters = {
|
|
112
|
-
firstName: {
|
|
113
|
-
// formatter: trimValWithOneSpace // just trim
|
|
114
|
-
// Example - removing disallowed chars as they are input: then they don't end up in state
|
|
115
|
-
formatter: (val) => val ? trimValWithOneSpace(val).replace(specialCharsRegEx, "") : void 0
|
|
116
|
-
// trim & replace
|
|
117
|
-
},
|
|
118
|
-
lastName: {
|
|
119
|
-
formatter: (val) => val ? trimValWithOneSpace(val).replace(specialCharsRegEx, "") : void 0
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
const customerSupportPresubmitProcess = (legalEntityResponse, legalEntityToSubmit) => {
|
|
123
|
-
if (legalEntityResponse.type === "individual") {
|
|
124
|
-
return processCustomerSupportForIndividual(legalEntityResponse, legalEntityToSubmit);
|
|
125
|
-
}
|
|
126
|
-
if (legalEntityResponse.type === "organization") {
|
|
127
|
-
return processCustomerSupportForOrganization(legalEntityResponse, legalEntityToSubmit);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
const processCustomerSupportForOrganization = (legalEntityResponse, legalEntityToSubmit) => {
|
|
131
|
-
if (!legalEntityResponse.organization?.support) {
|
|
132
|
-
return legalEntityToSubmit.organization?.support ?? void 0;
|
|
133
|
-
}
|
|
134
|
-
if (legalEntityResponse.organization?.countryOfGoverningLaw !== legalEntityToSubmit.organization?.countryOfGoverningLaw) {
|
|
135
|
-
const customerSupport = legalEntityResponse.organization?.support;
|
|
136
|
-
const country = legalEntityToSubmit.organization?.countryOfGoverningLaw;
|
|
137
|
-
switch (country) {
|
|
138
|
-
case CountryCodes.Japan:
|
|
139
|
-
return unsetCustomerSupportNumber(customerSupport);
|
|
140
|
-
default:
|
|
141
|
-
return customerSupport;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
const processCustomerSupportForIndividual = (legalEntityResponse, legalEntityToSubmit) => {
|
|
146
|
-
if (!legalEntityResponse.individual?.support) {
|
|
147
|
-
return legalEntityToSubmit.individual?.support ?? void 0;
|
|
148
|
-
}
|
|
149
|
-
if (legalEntityResponse.individual?.residentialAddress.country !== legalEntityToSubmit.individual?.residentialAddress.country) {
|
|
150
|
-
const customerSupport = legalEntityResponse.individual?.support;
|
|
151
|
-
const country = legalEntityToSubmit.individual?.residentialAddress.country;
|
|
152
|
-
switch (country) {
|
|
153
|
-
case CountryCodes.Japan:
|
|
154
|
-
return unsetCustomerSupportNumber(customerSupport);
|
|
155
|
-
default:
|
|
156
|
-
return customerSupport;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
const unsetCustomerSupportNumber = (customerSupport) => {
|
|
161
|
-
return customerSupport ? {
|
|
162
|
-
email: customerSupport.email,
|
|
163
|
-
phone: { number: "", type: "mobile" }
|
|
164
|
-
} : void 0;
|
|
165
|
-
};
|
|
166
|
-
const onfidoDocumentTypeMapping = [
|
|
167
|
-
{ id: "driversLicense", name: "driversLicense", hasBackPage: true },
|
|
168
|
-
{ id: "identityCard", name: "identityCard", hasBackPage: true },
|
|
169
|
-
{ id: "passport", name: "passport", hasBackPage: false }
|
|
170
|
-
];
|
|
171
|
-
const jaHaniNameValidationRules = {
|
|
172
|
-
jaHaniFirstName: [
|
|
173
|
-
{
|
|
174
|
-
modes: ["blur"],
|
|
175
|
-
validate: (input) => standardKanjiValidator(input),
|
|
176
|
-
errorMessage: "nameMustContainLetters"
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
jaHaniLastName: [
|
|
180
|
-
{
|
|
181
|
-
modes: ["blur"],
|
|
182
|
-
validate: (input) => standardKanjiValidator(input),
|
|
183
|
-
errorMessage: "nameMustContainLetters"
|
|
184
|
-
}
|
|
185
|
-
]
|
|
186
|
-
};
|
|
187
|
-
const jaKanaNameValidationRules = {
|
|
188
|
-
jaKanaFirstName: [
|
|
189
|
-
{
|
|
190
|
-
modes: ["blur"],
|
|
191
|
-
validate: (input) => standardKatakanaValidator(input),
|
|
192
|
-
errorMessage: "nameMustContainLetters"
|
|
193
|
-
}
|
|
194
|
-
],
|
|
195
|
-
jaKanaLastName: [
|
|
196
|
-
{
|
|
197
|
-
modes: ["blur"],
|
|
198
|
-
validate: (input) => standardKatakanaValidator(input),
|
|
199
|
-
errorMessage: "nameMustContainLetters"
|
|
200
|
-
}
|
|
201
|
-
]
|
|
202
|
-
};
|
|
203
|
-
const isNotOutOfRangeBirthDateValidatorRule$1 = {
|
|
204
|
-
modes: ["blur"],
|
|
205
|
-
validate: (birthDate) => !isEmpty(birthDate) && new Date(birthDate) < /* @__PURE__ */ new Date(),
|
|
206
|
-
errorMessage: "invalidDateOfBirth"
|
|
207
|
-
};
|
|
208
|
-
const buildMinimumAgeValidationRule$1 = (minimumAge) => ({
|
|
209
|
-
modes: ["blur"],
|
|
210
|
-
validate: (birthDate) => !!birthDate && getAgeToday(birthDate) >= minimumAge,
|
|
211
|
-
errorMessage: {
|
|
212
|
-
key: "youMustXYearsOldToContinue",
|
|
213
|
-
values: { minimumAge: minimumAge.toString() }
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
const getCountrySpecificMinimumAgeValidationRule$1 = (country) => {
|
|
217
|
-
if (!country) {
|
|
218
|
-
return buildMinimumAgeValidationRule$1(13);
|
|
219
|
-
}
|
|
220
|
-
if ([...euCountries, CountryCodes.UnitedKingdom, CountryCodes.Switzerland].some(
|
|
221
|
-
(c) => c === country
|
|
222
|
-
)) {
|
|
223
|
-
return buildMinimumAgeValidationRule$1(16);
|
|
224
|
-
}
|
|
225
|
-
switch (country) {
|
|
226
|
-
case CountryCodes.HongKong:
|
|
227
|
-
case CountryCodes.Singapore:
|
|
228
|
-
return buildMinimumAgeValidationRule$1(18);
|
|
229
|
-
default:
|
|
230
|
-
return buildMinimumAgeValidationRule$1(13);
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
const personalDetailsValidators = ({
|
|
234
|
-
country,
|
|
235
|
-
isExperimentEnabled = () => false,
|
|
236
|
-
isSettingEnabled = () => false,
|
|
237
|
-
taskType,
|
|
238
|
-
idNumberType,
|
|
239
|
-
phonePrefix,
|
|
240
|
-
idNumberExempt,
|
|
241
|
-
idNumber,
|
|
242
|
-
existingIdNumber,
|
|
243
|
-
formVerificationErrors,
|
|
244
|
-
taxIdNumberType
|
|
245
|
-
}) => ({
|
|
246
|
-
taxInformation: resolveFieldMetadata(
|
|
247
|
-
taxInformationDefaultFieldConfig[country],
|
|
248
|
-
{
|
|
249
|
-
taxIdNumberType,
|
|
250
|
-
companyType: LegalEntityTypes.INDIVIDUAL
|
|
251
|
-
},
|
|
252
|
-
taxInformationDefaultFieldMetadata
|
|
253
|
-
)?.validators,
|
|
254
|
-
birthDate: (() => {
|
|
255
|
-
const baseValidators = [isNotOutOfRangeBirthDateValidatorRule$1];
|
|
256
|
-
if (isSettingEnabled("enforceLegalAge")) {
|
|
257
|
-
return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
|
|
258
|
-
}
|
|
259
|
-
if (isExperimentEnabled("EnableAgeVerification")) {
|
|
260
|
-
if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
|
|
261
|
-
return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
|
|
262
|
-
}
|
|
263
|
-
return [...baseValidators, getCountrySpecificMinimumAgeValidationRule$1(country)];
|
|
264
|
-
}
|
|
265
|
-
return baseValidators;
|
|
266
|
-
})(),
|
|
267
|
-
...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
|
|
268
|
-
...contactDetailsValidationRules,
|
|
269
|
-
phoneNumber: resolveFieldMetadata(
|
|
270
|
-
fieldConfig[phonePrefix ?? country],
|
|
271
|
-
{},
|
|
272
|
-
defaultFieldMetadata$1
|
|
273
|
-
)?.validators,
|
|
274
|
-
idNumber: (() => {
|
|
275
|
-
const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
|
|
276
|
-
return idNumberExempt ? {
|
|
277
|
-
validate: () => {
|
|
278
|
-
return idNumberExempt || !isEmpty(idNumber);
|
|
279
|
-
},
|
|
280
|
-
modes: ["blur"]
|
|
281
|
-
} : resolveFieldMetadata(
|
|
282
|
-
defaultFieldConfig[country],
|
|
283
|
-
{ idNumberType: derivedIdNumberType },
|
|
284
|
-
defaultFieldMetadata
|
|
285
|
-
)?.validators;
|
|
286
|
-
})(),
|
|
287
|
-
...jaHaniNameValidationRules,
|
|
288
|
-
...jaKanaNameValidationRules
|
|
289
|
-
});
|
|
290
|
-
const mandateIdVerificationForMotionCapture = (showMotionCapture, derivedProps) => {
|
|
291
|
-
if (!derivedProps) {
|
|
292
|
-
return void 0;
|
|
293
|
-
}
|
|
294
|
-
const copiedDerivedProps = { ...derivedProps };
|
|
295
|
-
if (showMotionCapture) {
|
|
296
|
-
const idVerificationFields = [
|
|
297
|
-
...derivedProps.requiredFields.idVerificationMethod ?? [],
|
|
298
|
-
"idVerificationMethod"
|
|
299
|
-
];
|
|
300
|
-
copiedDerivedProps.allFields.idVerificationMethod = idVerificationFields;
|
|
301
|
-
copiedDerivedProps.requiredFields.idVerificationMethod = idVerificationFields;
|
|
302
|
-
}
|
|
303
|
-
return copiedDerivedProps;
|
|
304
|
-
};
|
|
305
|
-
const mapApiDocumentToIndividualDocuments = (entityId) => {
|
|
306
|
-
const idDocument2 = getIdDocument(entityId);
|
|
307
|
-
const proofOfResidency = getDocument(entityId, "proofOfResidency");
|
|
308
|
-
const proofOfNationalId = getDocument(entityId, "proofOfNationalIdNumber");
|
|
309
|
-
const proofOfRelationship = getDocument(entityId, "proofOfRelationship");
|
|
310
|
-
return {
|
|
311
|
-
idDocument: idDocument2 ? mapApiIdDocumentToSchema(idDocument2) : void 0,
|
|
312
|
-
proofOfResidency: proofOfResidency ? { proofOfResidency: [mapExistingFile(getPageName(proofOfResidency))] } : void 0,
|
|
313
|
-
proofOfNationalId: proofOfNationalId ? { proofOfNationalId: [mapExistingFile(getPageName(proofOfNationalId))] } : void 0,
|
|
314
|
-
proofOfRelationship: proofOfRelationship ? { proofOfRelationship: [mapExistingFile(getPageName(proofOfRelationship))] } : void 0
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
|
-
const mapApiIdDocumentToSchema = (idDocument2) => {
|
|
318
|
-
const { type, attachments, modificationDate } = idDocument2;
|
|
319
|
-
const { hasBackPage } = getLocalizedIdDocumentTypeOptions().find(({ id }) => id === type);
|
|
320
|
-
let frontPage;
|
|
321
|
-
let backPage;
|
|
322
|
-
if (attachments?.length === 1) {
|
|
323
|
-
frontPage = getPage(idDocument2);
|
|
324
|
-
} else {
|
|
325
|
-
frontPage = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
|
|
326
|
-
backPage = hasBackPage ? getPage(idDocument2, "back") : void 0;
|
|
327
|
-
}
|
|
328
|
-
return {
|
|
329
|
-
...frontPage ? { idFrontPage: [mapExistingFile(frontPage.pageName ?? "")] } : {},
|
|
330
|
-
...backPage ? { idBackPage: [mapExistingFile(backPage.pageName ?? "")] } : {},
|
|
331
|
-
idDocumentType: type,
|
|
332
|
-
modificationDate
|
|
333
|
-
};
|
|
334
|
-
};
|
|
335
|
-
const mapIndividualDocumentToApiDocument = async (data, entityId) => {
|
|
336
|
-
if (!data) return void 0;
|
|
337
|
-
const { proofOfNationalId, proofOfResidency, proofOfRelationship } = data;
|
|
338
|
-
const idDocument2 = "idDocument" in data ? data.idDocument : data.manualIdUpload;
|
|
339
|
-
const entityType = "legalEntity";
|
|
340
|
-
const documents = await Promise.all([
|
|
341
|
-
idDocument2?.idFrontPage ? createDocumentRequest({
|
|
342
|
-
entityId,
|
|
343
|
-
entityType,
|
|
344
|
-
documentType: idDocument2.idDocumentType,
|
|
345
|
-
page1: idDocument2.idFrontPage?.[0],
|
|
346
|
-
page2: idDocument2.idBackPage?.[0]
|
|
347
|
-
}) : void 0,
|
|
348
|
-
proofOfNationalId?.proofOfNationalId ? createDocumentRequest({
|
|
349
|
-
entityId,
|
|
350
|
-
entityType,
|
|
351
|
-
documentType: "proofOfNationalIdNumber",
|
|
352
|
-
page1: proofOfNationalId.proofOfNationalId[0]
|
|
353
|
-
}) : void 0,
|
|
354
|
-
proofOfResidency?.proofOfResidency ? createDocumentRequest({
|
|
355
|
-
entityId,
|
|
356
|
-
entityType,
|
|
357
|
-
documentType: "proofOfResidency",
|
|
358
|
-
description: proofOfResidency?.description,
|
|
359
|
-
page1: proofOfResidency.proofOfResidency[0]
|
|
360
|
-
}) : void 0,
|
|
361
|
-
proofOfRelationship?.proofOfRelationship ? createDocumentRequest({
|
|
362
|
-
entityId,
|
|
363
|
-
entityType,
|
|
364
|
-
documentType: "proofOfRelationship",
|
|
365
|
-
description: proofOfRelationship?.description,
|
|
366
|
-
page1: proofOfRelationship.proofOfRelationship[0]
|
|
367
|
-
}) : void 0
|
|
368
|
-
]);
|
|
369
|
-
return documents.filter(Boolean);
|
|
370
|
-
};
|
|
371
|
-
const getIdentityTypeToApiIdentityTypeMap = (data) => {
|
|
372
|
-
const { residencyCountry } = data;
|
|
373
|
-
switch (residencyCountry) {
|
|
374
|
-
case CountryCodes.HongKong:
|
|
375
|
-
return {
|
|
376
|
-
passport: "passport",
|
|
377
|
-
driversLicense: "driversLicense",
|
|
378
|
-
proofOfIdentityCard: "nationalIdNumber"
|
|
379
|
-
};
|
|
380
|
-
default:
|
|
381
|
-
return {
|
|
382
|
-
nationalIdNumber: "nationalIdNumber",
|
|
383
|
-
passport: "passport",
|
|
384
|
-
driversLicense: "driversLicense",
|
|
385
|
-
proofOfIdentityCard: "identityCard"
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
const adjustIdentificationData = (data, apiData) => {
|
|
390
|
-
const { typeOfIdentity, idNumber, idNumberExempt } = data;
|
|
391
|
-
const identificationData = {
|
|
392
|
-
...apiData,
|
|
393
|
-
number: idNumber,
|
|
394
|
-
type: getIdentityTypeToApiIdentityTypeMap(data)[typeOfIdentity] ?? "nationalIdNumber"
|
|
395
|
-
};
|
|
396
|
-
switch (typeOfIdentity) {
|
|
397
|
-
case "passport":
|
|
398
|
-
return {
|
|
399
|
-
...identificationData,
|
|
400
|
-
cardNumber: ""
|
|
401
|
-
};
|
|
402
|
-
case "driversLicense":
|
|
403
|
-
return {
|
|
404
|
-
...identificationData,
|
|
405
|
-
expiryDate: ""
|
|
406
|
-
};
|
|
407
|
-
default:
|
|
408
|
-
return idNumber === void 0 && idNumberExempt === void 0 ? void 0 : {
|
|
409
|
-
...identificationData,
|
|
410
|
-
expiryDate: "",
|
|
411
|
-
cardNumber: "",
|
|
412
|
-
nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
const mapIndividualToLegalEntity = (data) => {
|
|
417
|
-
const requestObj = {
|
|
418
|
-
...formatObject(data, individualApiKeyMapping)
|
|
419
|
-
};
|
|
420
|
-
requestObj.type = LegalEntityTypes.INDIVIDUAL;
|
|
421
|
-
const { personalDetails } = data;
|
|
422
|
-
if (!personalDetails) return requestObj;
|
|
423
|
-
requestObj.individual.identificationData = adjustIdentificationData(
|
|
424
|
-
personalDetails,
|
|
425
|
-
requestObj.individual.identificationData
|
|
426
|
-
);
|
|
427
|
-
const localization = [
|
|
428
|
-
mapSchemaFieldsToApiScriptLocalization(personalDetails, "jaHani"),
|
|
429
|
-
mapSchemaFieldsToApiScriptLocalization(personalDetails, "jaKana")
|
|
430
|
-
].filter(({ fields }) => !isEmpty$1(fields));
|
|
431
|
-
if (localization.length) {
|
|
432
|
-
requestObj.individual.name.localization = localization;
|
|
433
|
-
}
|
|
434
|
-
if (personalDetails.phoneNumber?.number) {
|
|
435
|
-
requestObj.individual.phone = {
|
|
436
|
-
number: personalDetails.phoneNumber.number,
|
|
437
|
-
type: "mobile"
|
|
438
|
-
};
|
|
439
|
-
} else {
|
|
440
|
-
delete requestObj.individual.phone;
|
|
441
|
-
}
|
|
442
|
-
return requestObj;
|
|
443
|
-
};
|
|
444
|
-
const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity, isLegalRepresentative) => {
|
|
445
|
-
let individualData = formatObject(
|
|
446
|
-
legalEntity,
|
|
447
|
-
individualComponentsKeyMapping
|
|
448
|
-
);
|
|
449
|
-
individualData = {
|
|
450
|
-
...individualData,
|
|
451
|
-
personalDetails: {
|
|
452
|
-
...individualData?.personalDetails,
|
|
453
|
-
...isChangingType && {
|
|
454
|
-
firstName: "",
|
|
455
|
-
lastName: ""
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
if (!individualData.personalDetails?.idNumberExempt) {
|
|
460
|
-
individualData.personalDetails.idNumberExempt = false;
|
|
461
|
-
}
|
|
462
|
-
const apiIdentityTypeToIdentityTypeMap = reverseMapping(
|
|
463
|
-
getIdentityTypeToApiIdentityTypeMap(individualData.personalDetails)
|
|
464
|
-
);
|
|
465
|
-
if (legalEntity?.individual?.identificationData?.type) {
|
|
466
|
-
individualData.personalDetails.typeOfIdentity = apiIdentityTypeToIdentityTypeMap[legalEntity.individual.identificationData.type];
|
|
467
|
-
}
|
|
468
|
-
if (legalEntity?.documentDetails?.length) {
|
|
469
|
-
individualData = {
|
|
470
|
-
...individualData,
|
|
471
|
-
...mapApiDocumentToIndividualDocuments(legalEntity?.id)
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
if (legalEntity?.individual?.residentialAddress.country === "JP" && legalEntity.individual?.name?.localization) {
|
|
475
|
-
for (const scriptLoc of legalEntity.individual.name.localization) {
|
|
476
|
-
individualData.personalDetails = {
|
|
477
|
-
...individualData.personalDetails,
|
|
478
|
-
...mapApiScriptLocalizationToSchemaFields(scriptLoc)
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (!parentLegalEntity?.entityAssociations) {
|
|
483
|
-
return individualData;
|
|
484
|
-
}
|
|
485
|
-
const associations = parentLegalEntity?.entityAssociations?.filter((ea) => ea.legalEntityId === legalEntity?.id) ?? [];
|
|
486
|
-
if (isRoleFieldNeeded) {
|
|
487
|
-
individualData.personalDetails.role = associations.map((ea) => ea.type);
|
|
488
|
-
individualData.personalDetails.jobTitle = associations.find(
|
|
489
|
-
({ jobTitle }) => Boolean(jobTitle)
|
|
490
|
-
)?.jobTitle;
|
|
491
|
-
}
|
|
492
|
-
individualData.personalDetails = getNomineeFromAssociation(
|
|
493
|
-
associations,
|
|
494
|
-
individualData.personalDetails
|
|
495
|
-
);
|
|
496
|
-
if (isLegalRepresentative) {
|
|
497
|
-
individualData.personalDetails.relationship = associations.find(
|
|
498
|
-
({ relationship }) => Boolean(relationship)
|
|
499
|
-
)?.relationship;
|
|
500
|
-
}
|
|
501
|
-
return individualData;
|
|
502
|
-
};
|
|
503
|
-
const identityBase = {
|
|
504
|
-
role: {
|
|
505
|
-
rule: "requiredIfDecisionMakerTask"
|
|
506
|
-
},
|
|
507
|
-
firstName: {
|
|
508
|
-
rule: "REQUIRED"
|
|
509
|
-
},
|
|
510
|
-
lastName: {
|
|
511
|
-
rule: "REQUIRED"
|
|
512
|
-
},
|
|
513
|
-
birthDate: {
|
|
514
|
-
rule: "REQUIRED"
|
|
515
|
-
},
|
|
516
|
-
phoneNumber: {
|
|
517
|
-
rules: ["requiredIfPhoneScenarioDisabled", "contactsIfRequiredForRole"]
|
|
518
|
-
},
|
|
519
|
-
email: {
|
|
520
|
-
rule: "contactsIfRequiredForRole"
|
|
521
|
-
},
|
|
522
|
-
jobTitle: {
|
|
523
|
-
rule: "jobTitleIfRequiredForRole"
|
|
524
|
-
},
|
|
525
|
-
nationality: {
|
|
526
|
-
rule: "nationalityIfRequiredForRole"
|
|
527
|
-
},
|
|
528
|
-
address: {
|
|
529
|
-
rule: "addressIfRequiredForCountry"
|
|
530
|
-
},
|
|
531
|
-
otherAddressInformation: {
|
|
532
|
-
rule: "otherAddressInfoIfRequiredForCountry"
|
|
533
|
-
},
|
|
534
|
-
country: {
|
|
535
|
-
rule: "REQUIRED"
|
|
536
|
-
},
|
|
537
|
-
postalCode: {
|
|
538
|
-
rule: "postalCodeIfRequiredForCountry"
|
|
539
|
-
},
|
|
540
|
-
city: {
|
|
541
|
-
rule: "cityIfRequiredForCountry"
|
|
542
|
-
},
|
|
543
|
-
stateOrProvince: {
|
|
544
|
-
rule: "stateOrProvinceIfRequiredForCountry"
|
|
545
|
-
},
|
|
546
|
-
residencyCountry: {
|
|
547
|
-
rule: "REQUIRED"
|
|
548
|
-
},
|
|
549
|
-
proofOfResidency: {
|
|
550
|
-
rule: "isProofOfResidencyRequired"
|
|
551
|
-
},
|
|
552
|
-
proofOfNationalId: {
|
|
553
|
-
rule: "isProofOfNationalIdRequired"
|
|
554
|
-
},
|
|
555
|
-
relationship: {
|
|
556
|
-
rule: "legalRepresentativeRelationshipRequired"
|
|
557
|
-
},
|
|
558
|
-
proofOfRelationship: {
|
|
559
|
-
rule: "isProofOfRelationshipRequired"
|
|
560
|
-
},
|
|
561
|
-
nomineeDirector: {
|
|
562
|
-
rule: "nomineeDirectorRequiredForCountry"
|
|
563
|
-
},
|
|
564
|
-
nomineeShareholder: {
|
|
565
|
-
rule: "nomineeShareHolderRequiredForCountry"
|
|
566
|
-
},
|
|
567
|
-
jaHaniFirstName: {
|
|
568
|
-
rule: "japaneseFirstAndLastNames"
|
|
569
|
-
},
|
|
570
|
-
jaHaniLastName: {
|
|
571
|
-
rule: "japaneseFirstAndLastNames"
|
|
572
|
-
},
|
|
573
|
-
jaKanaFirstName: {
|
|
574
|
-
rule: "japaneseFirstAndLastNames"
|
|
575
|
-
},
|
|
576
|
-
jaKanaLastName: {
|
|
577
|
-
rule: "japaneseFirstAndLastNames"
|
|
578
|
-
},
|
|
579
|
-
idDocumentType: {
|
|
580
|
-
// If the user has a missing ID error and chooses manual flow
|
|
581
|
-
rule: "isManualIdFlowAndHasMissingData"
|
|
582
|
-
}
|
|
583
|
-
};
|
|
584
|
-
const identityNumber$1 = {
|
|
585
|
-
idNumber: {
|
|
586
|
-
rule: "idNumberRules",
|
|
587
|
-
obscured: true
|
|
588
|
-
},
|
|
589
|
-
idNumberExempt: {
|
|
590
|
-
rules: ["idNumberExemptIfApplicableCountry", "isDirectorIdNumberRequiredForCountry"]
|
|
591
|
-
},
|
|
592
|
-
idDocumentType: {
|
|
593
|
-
rule: "manualIdDocumentRequired"
|
|
594
|
-
},
|
|
595
|
-
idFrontPage: {
|
|
596
|
-
rule: "idFrontPageIfManualUpload"
|
|
597
|
-
},
|
|
598
|
-
idBackPage: {
|
|
599
|
-
rule: "backPageIfRequiredForDocumentType"
|
|
600
|
-
},
|
|
601
|
-
idVerificationMethod: {
|
|
602
|
-
rule: "idVerificationRequired"
|
|
603
|
-
},
|
|
604
|
-
instantIdVerificationData: {
|
|
605
|
-
rule: "instantVerificationDataRule"
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
const additionalIdentityInfo$1 = {
|
|
609
|
-
typeOfIdentity: {
|
|
610
|
-
rules: ["requiredIfCountryUsesMultipleTypesOfIdentity", "isDirectorIdNumberRequiredForCountry"]
|
|
611
|
-
},
|
|
612
|
-
issuerState: {
|
|
613
|
-
rule: "issuerStateRequired"
|
|
614
|
-
},
|
|
615
|
-
licenseCardNumber: {
|
|
616
|
-
rule: "licenseCardNumberRules"
|
|
617
|
-
},
|
|
618
|
-
expiryDate: {
|
|
619
|
-
rule: "expiryDateRequired"
|
|
620
|
-
}
|
|
621
|
-
};
|
|
622
|
-
const idDocument = {
|
|
623
|
-
idVerificationMethod: {
|
|
624
|
-
rule: "REQUIRED"
|
|
625
|
-
},
|
|
626
|
-
idDocumentType: {
|
|
627
|
-
rule: "REQUIRED"
|
|
628
|
-
},
|
|
629
|
-
idFrontPage: {
|
|
630
|
-
rule: "idFrontPageIfManualUpload"
|
|
631
|
-
},
|
|
632
|
-
idBackPage: {
|
|
633
|
-
rule: "backPageIfRequiredForDocumentType"
|
|
634
|
-
}
|
|
635
|
-
};
|
|
636
|
-
const nationality$1 = {
|
|
637
|
-
nationality: {
|
|
638
|
-
rule: "REQUIRED"
|
|
639
|
-
}
|
|
640
|
-
};
|
|
641
|
-
const phoneNumberBase$1 = {
|
|
642
|
-
phoneNumber: {
|
|
643
|
-
rule: "contactsIfRequiredForRole"
|
|
644
|
-
}
|
|
645
|
-
};
|
|
646
|
-
const taxInformationBase$1 = {
|
|
647
|
-
taxInformation: { rule: "countryUsesTaxId" }
|
|
648
|
-
};
|
|
649
|
-
const fieldsPerScenario = {
|
|
650
|
-
L0: drop("address", "birthDate").from(identityBase),
|
|
651
|
-
L1: identityBase,
|
|
652
|
-
L_TAXINFO: { ...identityBase, ...taxInformationBase$1 },
|
|
653
|
-
L1_ID: {
|
|
654
|
-
...identityBase,
|
|
655
|
-
...identityNumber$1,
|
|
656
|
-
...additionalIdentityInfo$1
|
|
657
|
-
},
|
|
658
|
-
L1_IDO: {
|
|
659
|
-
// TODO: change idNumber rule to optional once optional fields are implemented
|
|
660
|
-
...identityBase,
|
|
661
|
-
...identityNumber$1,
|
|
662
|
-
...additionalIdentityInfo$1
|
|
663
|
-
},
|
|
664
|
-
L1_NAT: {
|
|
665
|
-
...identityBase,
|
|
666
|
-
...identityNumber$1,
|
|
667
|
-
...additionalIdentityInfo$1,
|
|
668
|
-
...nationality$1
|
|
669
|
-
},
|
|
670
|
-
L1_IDDOC: idDocument,
|
|
671
|
-
L_PH: phoneNumberBase$1
|
|
672
|
-
};
|
|
673
|
-
const parseIndividualScenarios = (scenarios) => composePerScenarioFormConfigurations(scenarios, fieldsPerScenario);
|
|
674
|
-
const parseConfiguration$1 = ({ scenarios }) => parseIndividualScenarios(scenarios);
|
|
675
|
-
const logger$1 = createLogger();
|
|
676
|
-
function IndividualDropin({
|
|
677
|
-
taskType = TaskTypes.INDIVIDUAL,
|
|
678
|
-
parentLegalEntity,
|
|
679
|
-
legalEntityResponse,
|
|
680
|
-
handleHomeClick,
|
|
681
|
-
isTargetLegalEntityType,
|
|
682
|
-
country: parentCountry,
|
|
683
|
-
problems: propProblems,
|
|
684
|
-
trustMember,
|
|
685
|
-
onSubmit: externalOnSubmit,
|
|
686
|
-
asModal = false,
|
|
687
|
-
handleBackClick: externalBackClick,
|
|
688
|
-
trustedFields,
|
|
689
|
-
trustedFieldsProvider,
|
|
690
|
-
trustedRoles
|
|
691
|
-
}) {
|
|
692
|
-
const { baseUrl, rootLegalEntityId } = useApiContext();
|
|
693
|
-
const { accountHolder, setAccountHolder } = useAccountHolder();
|
|
694
|
-
const { i18n } = useI18nContext();
|
|
695
|
-
const userEvents = useAnalyticsContext();
|
|
696
|
-
const { showToast, clearToasts } = useToastContext();
|
|
697
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
698
|
-
const { data: versionData } = useVersionConfiguration();
|
|
699
|
-
const { isSettingEnabled } = useSettingsContext();
|
|
700
|
-
const isRoleFieldNeeded = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
|
|
701
|
-
const isLegalRepresentative = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
|
|
702
|
-
const dataFromResponse = useMemo(() => {
|
|
703
|
-
if (legalEntityResponse) {
|
|
704
|
-
return mapLegalEntityToIndividual(
|
|
705
|
-
legalEntityResponse,
|
|
706
|
-
isTargetLegalEntityType,
|
|
707
|
-
isRoleFieldNeeded,
|
|
708
|
-
parentLegalEntity,
|
|
709
|
-
isLegalRepresentative
|
|
710
|
-
);
|
|
711
|
-
}
|
|
712
|
-
return {
|
|
713
|
-
personalDetails: {
|
|
714
|
-
residencyCountry: parentCountry
|
|
715
|
-
},
|
|
716
|
-
address: {
|
|
717
|
-
country: parentCountry
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
}, [
|
|
721
|
-
legalEntityResponse,
|
|
722
|
-
parentCountry,
|
|
723
|
-
isTargetLegalEntityType,
|
|
724
|
-
parentLegalEntity,
|
|
725
|
-
isRoleFieldNeeded,
|
|
726
|
-
isLegalRepresentative
|
|
727
|
-
]);
|
|
728
|
-
const documentUtils = documentApiUtils({
|
|
729
|
-
baseUrl: baseUrl.value,
|
|
730
|
-
rootLegalEntityId: rootLegalEntityId.value
|
|
731
|
-
});
|
|
732
|
-
let roleTypes = [];
|
|
733
|
-
const [matchingScenario, setMatchingScenario] = useState();
|
|
734
|
-
const [validationErrors, setValidationErrors] = useState();
|
|
735
|
-
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
736
|
-
const [documents, setDocuments] = useState();
|
|
737
|
-
const [existingAttachments, setExistingAttachments] = useState();
|
|
738
|
-
const [country, setCountry] = useState(
|
|
739
|
-
dataFromResponse?.personalDetails?.residencyCountry ?? parentCountry
|
|
740
|
-
);
|
|
741
|
-
const [hideFooter, setHideFooter] = useState(false);
|
|
742
|
-
const [derivedProps, setDerivedProps] = useState();
|
|
743
|
-
const associatedLegalEntityTrustedFields = useMemo(
|
|
744
|
-
() => legalEntityResponse ? getTrustedFields(legalEntityResponse, individualComponentsKeyMapping) : {},
|
|
745
|
-
[legalEntityResponse]
|
|
746
|
-
);
|
|
747
|
-
const { data: providerStatus } = useProviderStatus({
|
|
748
|
-
providers: ["address", "idDocument"],
|
|
749
|
-
country: legalEntityResponse ? getLegalEntityCountry(legalEntityResponse) : country
|
|
750
|
-
});
|
|
751
|
-
const problems = useMemo(
|
|
752
|
-
() => ({
|
|
753
|
-
...propProblems,
|
|
754
|
-
validationErrors
|
|
755
|
-
}),
|
|
756
|
-
[propProblems, validationErrors]
|
|
757
|
-
);
|
|
758
|
-
useEffect(() => {
|
|
759
|
-
userEvents.updateBaseTrackingPayload({ task: taskType });
|
|
760
|
-
userEvents.addTaskEvent("Landed on page", {
|
|
761
|
-
actionType: "start"
|
|
762
|
-
});
|
|
763
|
-
}, []);
|
|
764
|
-
const individualFieldValidations = useCallback(
|
|
765
|
-
(data2) => ({
|
|
766
|
-
personalDetails: personalDetailsValidators({
|
|
767
|
-
country: data2?.personalDetails?.residencyCountry ?? country,
|
|
768
|
-
isExperimentEnabled,
|
|
769
|
-
isSettingEnabled,
|
|
770
|
-
taskType,
|
|
771
|
-
idNumberType: data2?.personalDetails?.typeOfIdentity,
|
|
772
|
-
phonePrefix: data2?.personalDetails?.phoneNumber?.phoneCountryCode,
|
|
773
|
-
idNumberExempt: data2?.personalDetails?.idNumberExempt,
|
|
774
|
-
idNumber: data2?.personalDetails?.idNumber,
|
|
775
|
-
existingIdNumber: dataFromResponse.personalDetails?.idNumber,
|
|
776
|
-
formVerificationErrors: propProblems?.verificationErrors?.personalDetails,
|
|
777
|
-
taxIdNumberType: data2?.personalDetails?.taxInformation?.length ? data2?.personalDetails?.taxInformation[0]?.type : void 0
|
|
778
|
-
}),
|
|
779
|
-
address: addressValidators({
|
|
780
|
-
isExperimentEnabled,
|
|
781
|
-
country: data2?.personalDetails?.residencyCountry ?? country,
|
|
782
|
-
i18n
|
|
783
|
-
})
|
|
784
|
-
}),
|
|
785
|
-
[isExperimentEnabled, isSettingEnabled, taskType]
|
|
786
|
-
);
|
|
787
|
-
const validatePhoneNumber = useValidatePhoneNumberImperatively();
|
|
788
|
-
const { mutateAsync: verifyIdNumber2 } = useVerifyIdNumber();
|
|
789
|
-
const individualFieldAsyncValidations = useCallback(
|
|
790
|
-
(data2) => ({
|
|
791
|
-
personalDetails: {
|
|
792
|
-
phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber,
|
|
793
|
-
idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2?.personalDetails).idNumber
|
|
794
|
-
}
|
|
795
|
-
}),
|
|
796
|
-
[getAsyncPhoneValidationRules, getAsyncIdNumberValidationRule]
|
|
797
|
-
);
|
|
798
|
-
const defaultData = useMemo(
|
|
799
|
-
() => ({
|
|
800
|
-
...dataFromResponse,
|
|
801
|
-
...documents,
|
|
802
|
-
idVerificationMethod: {
|
|
803
|
-
idVerificationMethod: "instantVerification"
|
|
804
|
-
}
|
|
805
|
-
}),
|
|
806
|
-
[legalEntityResponse, documents, isTargetLegalEntityType, dataFromResponse]
|
|
807
|
-
);
|
|
808
|
-
const formatters = useMemo(
|
|
809
|
-
() => ({
|
|
810
|
-
personalDetails: {
|
|
811
|
-
...nameFormatters
|
|
812
|
-
},
|
|
813
|
-
address: addressFormatters
|
|
814
|
-
}),
|
|
815
|
-
[]
|
|
816
|
-
);
|
|
817
|
-
const form = useMultiForm({
|
|
818
|
-
requiredFields: derivedProps?.requiredFields,
|
|
819
|
-
defaultData,
|
|
820
|
-
rules: individualFieldValidations,
|
|
821
|
-
asyncRules: individualFieldAsyncValidations,
|
|
822
|
-
optionalFields: derivedProps?.optionalFields,
|
|
823
|
-
formatters,
|
|
824
|
-
obscuredFields: {
|
|
825
|
-
personalDetails: ["idNumber"]
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
const { data = dataFromResponse } = form;
|
|
829
|
-
useEffect(() => {
|
|
830
|
-
setCountry(data?.personalDetails?.residencyCountry ?? parentCountry);
|
|
831
|
-
}, [data?.personalDetails?.residencyCountry, parentCountry]);
|
|
832
|
-
const { data: scenarios } = useScenarios(country, LegalEntityTypes.INDIVIDUAL);
|
|
833
|
-
useEffect(() => {
|
|
834
|
-
if (!scenarios) return;
|
|
835
|
-
setHasMotionCaptureScenario(scenarios);
|
|
836
|
-
setMatchingScenario(scenarios);
|
|
837
|
-
}, [scenarios]);
|
|
838
|
-
const { fieldConfigurations } = useScenarioConfiguration({
|
|
839
|
-
parseConfiguration: parseConfiguration$1,
|
|
840
|
-
legalEntityType: LegalEntityTypes.INDIVIDUAL,
|
|
841
|
-
setLoadingStatus,
|
|
842
|
-
country
|
|
843
|
-
});
|
|
844
|
-
const fieldsFromCustomRules = useMemo(
|
|
845
|
-
() => rules({
|
|
846
|
-
matchingScenario,
|
|
847
|
-
data,
|
|
848
|
-
country: data?.personalDetails?.residencyCountry ?? country,
|
|
849
|
-
taskType,
|
|
850
|
-
isExperimentEnabled,
|
|
851
|
-
rootLegalEntity: parentLegalEntity,
|
|
852
|
-
problems,
|
|
853
|
-
version: versionData?.version
|
|
854
|
-
}),
|
|
855
|
-
[country, matchingScenario, data, taskType, problems]
|
|
856
|
-
);
|
|
857
|
-
useEffect(() => {
|
|
858
|
-
const derivedProps2 = getPropsFromConfigurations({
|
|
859
|
-
scenarioConfiguration: fieldConfigurations,
|
|
860
|
-
forms: individualForms,
|
|
861
|
-
remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
862
|
-
dataMissingErrors: problems?.missingData ?? [],
|
|
863
|
-
fieldsWithExistingData: legalEntityResponse ? getFieldsWithExistingData(
|
|
864
|
-
legalEntityResponse,
|
|
865
|
-
individualApiKeyMapping,
|
|
866
|
-
individualDocumentMapping,
|
|
867
|
-
// We ignore these fields for the purposes of this rule because we know them to be problematic
|
|
868
|
-
[
|
|
869
|
-
"personalDetails.typeOfIdentity",
|
|
870
|
-
"personalDetails.idNumber",
|
|
871
|
-
"address.stateOrProvince",
|
|
872
|
-
"personalDetails.issuerState"
|
|
873
|
-
]
|
|
874
|
-
) : [],
|
|
875
|
-
customRules: fieldsFromCustomRules,
|
|
876
|
-
legalEntityType: legalEntityResponse?.type,
|
|
877
|
-
legalEntityTrustedFields: [],
|
|
878
|
-
remediationFieldAsOptional: true
|
|
879
|
-
});
|
|
880
|
-
const updatedDerivedProps = mandateIdVerificationForMotionCapture(
|
|
881
|
-
showIndividualMotionCapture?.value,
|
|
882
|
-
derivedProps2
|
|
883
|
-
);
|
|
884
|
-
setDerivedProps(updatedDerivedProps);
|
|
885
|
-
}, [
|
|
886
|
-
fieldConfigurations,
|
|
887
|
-
legalEntityResponse,
|
|
888
|
-
fieldsFromCustomRules,
|
|
889
|
-
problems?.remediationActions,
|
|
890
|
-
problems?.missingData
|
|
891
|
-
]);
|
|
892
|
-
const forms = useMemo(() => {
|
|
893
|
-
const formsWithUpdatedName = {
|
|
894
|
-
...individualForms,
|
|
895
|
-
idDocument: {
|
|
896
|
-
...individualForms.idDocument,
|
|
897
|
-
formName: data.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "instantVerification" : "idDocument"
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
|
-
const requiredForms = getRequiredForms(
|
|
901
|
-
formsWithUpdatedName,
|
|
902
|
-
derivedProps?.requiredFields,
|
|
903
|
-
derivedProps?.optionalFields
|
|
904
|
-
).filter(
|
|
905
|
-
// Prevent showing the ID verification method step when onfido is not enabled
|
|
906
|
-
(form2) => form2.formId !== "idVerificationMethod" || providerStatus?.statuses?.idDocument?.enabled
|
|
907
|
-
);
|
|
908
|
-
return addValidityToForms(requiredForms, form.isValid, problems);
|
|
909
|
-
}, [
|
|
910
|
-
derivedProps,
|
|
911
|
-
form.isValid,
|
|
912
|
-
problems,
|
|
913
|
-
providerStatus?.statuses?.idDocument?.enabled,
|
|
914
|
-
data.idVerificationMethod?.idVerificationMethod
|
|
915
|
-
]);
|
|
916
|
-
if (isRoleFieldNeeded && parentLegalEntity) {
|
|
917
|
-
roleTypes = getAllowedDecisionMakerRoles(parentLegalEntity, taskType);
|
|
918
|
-
}
|
|
919
|
-
useEffect(() => {
|
|
920
|
-
if (!legalEntityResponse?.documentDetails?.length) return;
|
|
921
|
-
documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then((res) => {
|
|
922
|
-
setExistingAttachments(res[0].attachments);
|
|
923
|
-
setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
|
|
924
|
-
}).catch(() => {
|
|
925
|
-
showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
|
|
926
|
-
});
|
|
927
|
-
}, [legalEntityResponse]);
|
|
928
|
-
const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
|
|
929
|
-
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
930
|
-
const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
|
|
931
|
-
const submitLegalEntity = async ({
|
|
932
|
-
dataSubmitted,
|
|
933
|
-
legalEntity,
|
|
934
|
-
idDocumentType
|
|
935
|
-
}) => {
|
|
936
|
-
let updatedLegalEntity;
|
|
937
|
-
const existingLeId = legalEntityResponse?.id;
|
|
938
|
-
if (legalEntity.individual && legalEntityResponse?.individual?.support) {
|
|
939
|
-
legalEntity.individual.support = customerSupportPresubmitProcess(
|
|
940
|
-
legalEntityResponse,
|
|
941
|
-
legalEntity
|
|
942
|
-
);
|
|
943
|
-
}
|
|
944
|
-
if (!existingLeId) {
|
|
945
|
-
updatedLegalEntity = await createLegalEntity(legalEntity);
|
|
946
|
-
userEvents.addTaskEvent("Success", {
|
|
947
|
-
actionType: "submit",
|
|
948
|
-
countryOfRegistration: dataSubmitted.personalDetails?.residencyCountry,
|
|
949
|
-
roles: dataSubmitted.personalDetails?.role
|
|
950
|
-
});
|
|
951
|
-
} else {
|
|
952
|
-
const patchLegalEntity = { ...drop("type").from(legalEntity), id: existingLeId };
|
|
953
|
-
updatedLegalEntity = await updateLegalEntity(patchLegalEntity);
|
|
954
|
-
userEvents.addTaskEvent("Success", {
|
|
955
|
-
actionType: "submit",
|
|
956
|
-
countryOfRegistration: dataSubmitted.personalDetails?.residencyCountry,
|
|
957
|
-
documentType: idDocumentType
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
return updatedLegalEntity;
|
|
961
|
-
};
|
|
962
|
-
const { mutateAsync: getIdVerificationStartCheck } = useIdVerificationStartCheck();
|
|
963
|
-
const handleInstantIdVerificationStartCheck = async (onfidoResponse, legalEntityId) => {
|
|
964
|
-
const providerId = idVerificationProviderId.value;
|
|
965
|
-
if (!providerId) throw Error("idVerificationProviderId not yet set");
|
|
966
|
-
const data2 = {
|
|
967
|
-
providerId,
|
|
968
|
-
legalEntityId,
|
|
969
|
-
captureMetadata: onfidoResponse
|
|
970
|
-
};
|
|
971
|
-
await getIdVerificationStartCheck(data2);
|
|
972
|
-
};
|
|
973
|
-
const submitDocuments = async ({
|
|
974
|
-
forms: forms2,
|
|
975
|
-
legalEntity,
|
|
976
|
-
dataSubmitted
|
|
977
|
-
}) => {
|
|
978
|
-
if (!isDocumentsRequired(forms2)) return;
|
|
979
|
-
if (dataSubmitted.idDocument?.instantIdVerificationData) {
|
|
980
|
-
if (providerStatus?.statuses?.idDocument?.enabled === false) {
|
|
981
|
-
throw new Error("Provider unexpectedly disabled instant verification flow");
|
|
982
|
-
}
|
|
983
|
-
await handleInstantIdVerificationStartCheck(
|
|
984
|
-
dataSubmitted.idDocument.instantIdVerificationData,
|
|
985
|
-
legalEntity.id
|
|
986
|
-
);
|
|
987
|
-
} else {
|
|
988
|
-
const formattedDocuments = await mapIndividualDocumentToApiDocument(
|
|
989
|
-
dataSubmitted,
|
|
990
|
-
legalEntity.id
|
|
991
|
-
);
|
|
992
|
-
if (!formattedDocuments || formattedDocuments.length === 0) {
|
|
993
|
-
if (existingAttachments?.length)
|
|
994
|
-
logger$1.log(
|
|
995
|
-
"User has already uploaded documents and is not changing them, nothing needs to be done"
|
|
996
|
-
);
|
|
997
|
-
else
|
|
998
|
-
logger$1.error(
|
|
999
|
-
`formattedDocuments is empty, but there are no existing documents. Something has gone wrong`
|
|
1000
|
-
);
|
|
1001
|
-
return;
|
|
1002
|
-
}
|
|
1003
|
-
formattedDocuments[0].attachments = mergeAttachments(
|
|
1004
|
-
existingAttachments ?? [],
|
|
1005
|
-
formattedDocuments[0]?.attachments ?? []
|
|
1006
|
-
).filter((attachment) => attachment.content);
|
|
1007
|
-
const uploadedDocuments = await documentUtils.uploadDocuments(
|
|
1008
|
-
formattedDocuments,
|
|
1009
|
-
legalEntity.id
|
|
1010
|
-
);
|
|
1011
|
-
uploadedDocuments?.forEach((doc) => {
|
|
1012
|
-
userEvents.addTaskEvent("Success", {
|
|
1013
|
-
actionType: "upload",
|
|
1014
|
-
documentType: doc.type,
|
|
1015
|
-
fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? void 0
|
|
1016
|
-
});
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
};
|
|
1020
|
-
const hasRolesChanged = (legalEntity, existingEntityAssociations, newRoles) => {
|
|
1021
|
-
const existingRoles = existingEntityAssociations?.filter((ea) => ea.legalEntityId === legalEntity.id)?.map(({ type }) => type);
|
|
1022
|
-
return !doArraysMatch(existingRoles, newRoles);
|
|
1023
|
-
};
|
|
1024
|
-
const attachAssociationToParentLegalEntity = async ({
|
|
1025
|
-
legalEntity,
|
|
1026
|
-
parentLE,
|
|
1027
|
-
dataSubmitted
|
|
1028
|
-
}) => {
|
|
1029
|
-
const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? dataSubmitted?.personalDetails?.role : taskType === TaskTypes.TRUST_MEMBER_INDIVIDUAL || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL ? trustMember?.roles : null;
|
|
1030
|
-
const existingEntityAssociations = getOwnEntityAssociations(parentLE);
|
|
1031
|
-
if (newRoles && (hasRolesChanged(legalEntity, existingEntityAssociations, newRoles) || dataFromResponse.personalDetails?.jobTitle !== dataSubmitted?.personalDetails?.jobTitle || hasNomineesChanged(dataFromResponse.personalDetails, dataSubmitted.personalDetails))) {
|
|
1032
|
-
const updatedParentLegalEntity = {
|
|
1033
|
-
entityAssociations: [
|
|
1034
|
-
...newRoles.map((role) => ({
|
|
1035
|
-
type: role,
|
|
1036
|
-
legalEntityId: legalEntity.id,
|
|
1037
|
-
...DECISION_MAKER_TYPES_WITH_JOBTITLE.some((type) => type === role) && {
|
|
1038
|
-
jobTitle: dataSubmitted?.personalDetails?.jobTitle
|
|
1039
|
-
}
|
|
1040
|
-
})) || [],
|
|
1041
|
-
...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
|
|
1042
|
-
]
|
|
1043
|
-
};
|
|
1044
|
-
if (updatedParentLegalEntity.entityAssociations) {
|
|
1045
|
-
updatedParentLegalEntity.entityAssociations = updatedParentLegalEntity.entityAssociations.map(
|
|
1046
|
-
(ea) => attachNomineeToRole(ea, country, dataSubmitted.personalDetails)
|
|
1047
|
-
);
|
|
1048
|
-
}
|
|
1049
|
-
await updateLegalEntity({ ...updatedParentLegalEntity, id: parentLE.id });
|
|
1050
|
-
}
|
|
1051
|
-
if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity.id) || dataFromResponse?.personalDetails?.relationship !== dataSubmitted?.personalDetails?.relationship)) {
|
|
1052
|
-
const newEntityAssociation = {
|
|
1053
|
-
type: "legalRepresentative",
|
|
1054
|
-
legalEntityId: legalEntity.id,
|
|
1055
|
-
relationship: dataSubmitted?.personalDetails?.relationship
|
|
1056
|
-
};
|
|
1057
|
-
const updatedParentLegalEntity = {
|
|
1058
|
-
entityAssociations: [newEntityAssociation, ...existingEntityAssociations]
|
|
1059
|
-
};
|
|
1060
|
-
await updateLegalEntity({ ...updatedParentLegalEntity, id: parentLE.id });
|
|
1061
|
-
}
|
|
1062
|
-
};
|
|
1063
|
-
const onSubmit = async () => {
|
|
1064
|
-
setLoadingStatus("loading");
|
|
1065
|
-
const dataSubmitted = omitObscuredFieldsIfUnchanged(
|
|
1066
|
-
individualObscuredFields,
|
|
1067
|
-
data,
|
|
1068
|
-
dataFromResponse
|
|
1069
|
-
);
|
|
1070
|
-
if (!dataSubmitted) {
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
try {
|
|
1074
|
-
const legalEntity = mapIndividualToLegalEntity(dataSubmitted);
|
|
1075
|
-
const idDocumentType = idDocumentTypeOptions.find(
|
|
1076
|
-
({ id }) => dataSubmitted?.idDocument?.idDocumentType === id
|
|
1077
|
-
)?.id;
|
|
1078
|
-
legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
|
|
1079
|
-
taskType,
|
|
1080
|
-
legalEntityResponse,
|
|
1081
|
-
accountHolder || void 0
|
|
1082
|
-
);
|
|
1083
|
-
const createdLegalEntity = await submitLegalEntity({
|
|
1084
|
-
dataSubmitted,
|
|
1085
|
-
legalEntity,
|
|
1086
|
-
idDocumentType
|
|
1087
|
-
});
|
|
1088
|
-
setAccountHolder(accountHolder);
|
|
1089
|
-
await submitDocuments({ forms, legalEntity: createdLegalEntity, dataSubmitted });
|
|
1090
|
-
if (parentLegalEntity) {
|
|
1091
|
-
await attachAssociationToParentLegalEntity({
|
|
1092
|
-
legalEntity: createdLegalEntity,
|
|
1093
|
-
parentLE: parentLegalEntity,
|
|
1094
|
-
dataSubmitted
|
|
1095
|
-
});
|
|
1096
|
-
}
|
|
1097
|
-
setLoadingStatus("success");
|
|
1098
|
-
clearToasts();
|
|
1099
|
-
externalOnSubmit?.(dataSubmitted);
|
|
1100
|
-
} catch (e) {
|
|
1101
|
-
logger$1.error("Failed to update individual", e);
|
|
1102
|
-
if (isValidationError(e)) {
|
|
1103
|
-
setValidationErrors(processValidationErrors(e, TaskTypes.INDIVIDUAL));
|
|
1104
|
-
} else if (isMaintenanceModeError(e)) {
|
|
1105
|
-
showToast({
|
|
1106
|
-
label: i18n.get("maintenanceModeMessage"),
|
|
1107
|
-
variant: "error",
|
|
1108
|
-
duration: "indefinite"
|
|
1109
|
-
});
|
|
1110
|
-
} else {
|
|
1111
|
-
showToast({ label: i18n.get("failedToUpdateDetails"), variant: "error" });
|
|
1112
|
-
}
|
|
1113
|
-
setLoadingStatus("success");
|
|
1114
|
-
userEvents.addTaskEvent("Encountered error", {
|
|
1115
|
-
actionType: "submit",
|
|
1116
|
-
returnType: e.errorCode,
|
|
1117
|
-
returnValue: e.title
|
|
1118
|
-
});
|
|
1119
|
-
}
|
|
1120
|
-
};
|
|
1121
|
-
const isDocumentsRequired = (forms2) => forms2.some((form2) => individualDocumentForms.includes(form2.formId));
|
|
1122
|
-
const datasetUtils = datasetUtilities(i18n.locale);
|
|
1123
|
-
const formatIdDocument = (idDocument2) => {
|
|
1124
|
-
if (!idDocument2) return void 0;
|
|
1125
|
-
const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
|
|
1126
|
-
(document2) => idDocument2.instantIdVerificationData?.document_front.type === document2.id
|
|
1127
|
-
) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
|
|
1128
|
-
if (!documentType) return void 0;
|
|
1129
|
-
const frontPage = idDocument2.idFrontPage?.[0];
|
|
1130
|
-
const backPage = idDocument2.idBackPage?.[0];
|
|
1131
|
-
if (!frontPage) return void 0;
|
|
1132
|
-
return {
|
|
1133
|
-
documentType: i18n.get(documentType.name),
|
|
1134
|
-
...backPage && documentType.hasBackPage ? {
|
|
1135
|
-
frontPage: frontPage.name,
|
|
1136
|
-
backPage: backPage.name
|
|
1137
|
-
} : {
|
|
1138
|
-
fileName: frontPage.name
|
|
1139
|
-
}
|
|
1140
|
-
};
|
|
1141
|
-
};
|
|
1142
|
-
const formatFileSummaryData = ({
|
|
1143
|
-
idDocument: idDocument2,
|
|
1144
|
-
proofOfNationalId,
|
|
1145
|
-
proofOfResidency,
|
|
1146
|
-
proofOfRelationship
|
|
1147
|
-
}) => {
|
|
1148
|
-
const proofOfNationalIdFile = proofOfNationalId?.proofOfNationalId?.[0];
|
|
1149
|
-
const proofOfResidencyFile = proofOfResidency?.proofOfResidency?.[0];
|
|
1150
|
-
const proofOfRelationshipFile = proofOfRelationship?.proofOfRelationship?.[0];
|
|
1151
|
-
return {
|
|
1152
|
-
...(idDocument2?.idDocumentType || idDocument2?.instantIdVerificationData) && {
|
|
1153
|
-
idDocument: formatIdDocument(idDocument2)
|
|
1154
|
-
},
|
|
1155
|
-
...proofOfNationalIdFile && {
|
|
1156
|
-
proofOfNationalId: {
|
|
1157
|
-
fileName: proofOfNationalIdFile.name
|
|
1158
|
-
}
|
|
1159
|
-
},
|
|
1160
|
-
...proofOfResidencyFile && {
|
|
1161
|
-
proofOfResidency: {
|
|
1162
|
-
fileName: proofOfResidencyFile.name
|
|
1163
|
-
}
|
|
1164
|
-
},
|
|
1165
|
-
...proofOfRelationshipFile && {
|
|
1166
|
-
proofOfRelationship: {
|
|
1167
|
-
fileName: proofOfRelationshipFile.name
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
};
|
|
1171
|
-
};
|
|
1172
|
-
const formatDataForSummary = () => {
|
|
1173
|
-
let summaryData = cloneObject(data);
|
|
1174
|
-
if (summaryData.personalDetails?.residencyCountry) {
|
|
1175
|
-
summaryData.personalDetails.residencyCountry = datasetUtils.getCountryName(
|
|
1176
|
-
summaryData.personalDetails.residencyCountry
|
|
1177
|
-
);
|
|
1178
|
-
}
|
|
1179
|
-
if (summaryData.personalDetails?.nationality) {
|
|
1180
|
-
summaryData.personalDetails.nationality = datasetUtils.getCountryName(
|
|
1181
|
-
summaryData.personalDetails.nationality
|
|
1182
|
-
);
|
|
1183
|
-
}
|
|
1184
|
-
if (summaryData.address) {
|
|
1185
|
-
summaryData.address = mapAddressLabels(summaryData.address, datasetUtils);
|
|
1186
|
-
}
|
|
1187
|
-
if (isDocumentsRequired(forms)) {
|
|
1188
|
-
individualDocumentForms.forEach((formId) => delete summaryData[formId]);
|
|
1189
|
-
summaryData = { ...summaryData, ...formatFileSummaryData(data) };
|
|
1190
|
-
}
|
|
1191
|
-
if (summaryData.personalDetails?.accountHolder) {
|
|
1192
|
-
summaryData.personalDetails.accountHolder = i18n.get(
|
|
1193
|
-
summaryData.personalDetails.accountHolder
|
|
1194
|
-
);
|
|
1195
|
-
}
|
|
1196
|
-
if (summaryData.personalDetails?.birthDate) {
|
|
1197
|
-
summaryData.personalDetails.birthDate = localizeDateString(
|
|
1198
|
-
summaryData.personalDetails.birthDate,
|
|
1199
|
-
i18n.locale
|
|
1200
|
-
);
|
|
1201
|
-
}
|
|
1202
|
-
if (summaryData.personalDetails?.phoneNumber) {
|
|
1203
|
-
delete summaryData.personalDetails.phoneNumber;
|
|
1204
|
-
summaryData.personalDetails.phoneNumber = data.personalDetails?.phoneNumber?.number;
|
|
1205
|
-
}
|
|
1206
|
-
if (summaryData.personalDetails?.taxInformation) {
|
|
1207
|
-
const taxInformation = summaryData.personalDetails.taxInformation.find(
|
|
1208
|
-
(taxId) => taxId.country === data.personalDetails?.nationality
|
|
1209
|
-
);
|
|
1210
|
-
if (taxInformation) {
|
|
1211
|
-
delete summaryData.personalDetails.taxInformation;
|
|
1212
|
-
summaryData.personalDetails[taxInformation.type] = taxInformation.number;
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
return summaryData;
|
|
1216
|
-
};
|
|
1217
|
-
const summaryOmittedKeys = [
|
|
1218
|
-
...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
|
|
1219
|
-
...data?.personalDetails?.idNumberExempt ? ["idNumber"] : []
|
|
1220
|
-
];
|
|
1221
|
-
const {
|
|
1222
|
-
handleNextClick,
|
|
1223
|
-
handleBackClick,
|
|
1224
|
-
activeForm,
|
|
1225
|
-
shouldValidate,
|
|
1226
|
-
gotoFormByFormIndex,
|
|
1227
|
-
steps
|
|
1228
|
-
} = useFormComposer({
|
|
1229
|
-
problems,
|
|
1230
|
-
externalBackClick,
|
|
1231
|
-
forms,
|
|
1232
|
-
onSubmit,
|
|
1233
|
-
triggerValidation: form.triggerValidation
|
|
1234
|
-
// TODO: figure out type of nested keys
|
|
1235
|
-
});
|
|
1236
|
-
return /* @__PURE__ */ jsx(FormContextProvider, { form, children: /* @__PURE__ */ jsx(
|
|
1237
|
-
FormFlow,
|
|
1238
|
-
{
|
|
1239
|
-
summary: {
|
|
1240
|
-
data: formatDataForSummary(),
|
|
1241
|
-
omitted: {
|
|
1242
|
-
keys: summaryOmittedKeys
|
|
1243
|
-
},
|
|
1244
|
-
problems
|
|
1245
|
-
},
|
|
1246
|
-
asModal,
|
|
1247
|
-
currentStep: steps.current,
|
|
1248
|
-
disableNextButton: hideFooter,
|
|
1249
|
-
forms,
|
|
1250
|
-
activeForm,
|
|
1251
|
-
gotoFormByFormIndex,
|
|
1252
|
-
handleBackClick,
|
|
1253
|
-
handleCancelClick: handleHomeClick,
|
|
1254
|
-
handleNextClick,
|
|
1255
|
-
loadingStatus,
|
|
1256
|
-
totalSteps: steps.total,
|
|
1257
|
-
children: /* @__PURE__ */ jsx(
|
|
1258
|
-
Individual,
|
|
1259
|
-
{
|
|
1260
|
-
...derivedProps,
|
|
1261
|
-
data,
|
|
1262
|
-
country,
|
|
1263
|
-
activeForm,
|
|
1264
|
-
forms,
|
|
1265
|
-
taskType,
|
|
1266
|
-
problems,
|
|
1267
|
-
onNext: handleNextClick,
|
|
1268
|
-
onBack: handleBackClick,
|
|
1269
|
-
setHideFooter,
|
|
1270
|
-
legalEntityId: legalEntityResponse?.id,
|
|
1271
|
-
allowedRoles: roleTypes,
|
|
1272
|
-
shouldValidate,
|
|
1273
|
-
accountHolder,
|
|
1274
|
-
parentLegalEntity,
|
|
1275
|
-
trustedFields: !parentLegalEntity ? trustedFields : associatedLegalEntityTrustedFields,
|
|
1276
|
-
trustedFieldsProvider,
|
|
1277
|
-
trustedRoles
|
|
1278
|
-
}
|
|
1279
|
-
)
|
|
1280
|
-
}
|
|
1281
|
-
) });
|
|
1282
|
-
}
|
|
1283
|
-
const isNotOutOfRangeBirthDateValidatorRule = {
|
|
1284
|
-
modes: ["blur"],
|
|
1285
|
-
validate: (birthDate) => !isEmpty(birthDate) && new Date(birthDate) < /* @__PURE__ */ new Date(),
|
|
1286
|
-
errorMessage: "invalidDateOfBirth"
|
|
1287
|
-
};
|
|
1288
|
-
const buildMinimumAgeValidationRule = (minimumAge) => ({
|
|
1289
|
-
modes: ["blur"],
|
|
1290
|
-
validate: (birthDate) => !!birthDate && getAgeToday(birthDate) >= minimumAge,
|
|
1291
|
-
errorMessage: {
|
|
1292
|
-
key: "youMustXYearsOldToContinue",
|
|
1293
|
-
values: { minimumAge: minimumAge.toString() }
|
|
1294
|
-
}
|
|
1295
|
-
});
|
|
1296
|
-
const getCountrySpecificMinimumAgeValidationRule = (country) => {
|
|
1297
|
-
if (!country) {
|
|
1298
|
-
return buildMinimumAgeValidationRule(13);
|
|
1299
|
-
}
|
|
1300
|
-
if ([...euCountries, CountryCodes.UnitedKingdom, CountryCodes.Switzerland].some(
|
|
1301
|
-
(c) => c === country
|
|
1302
|
-
)) {
|
|
1303
|
-
return buildMinimumAgeValidationRule(16);
|
|
1304
|
-
}
|
|
1305
|
-
switch (country) {
|
|
1306
|
-
case CountryCodes.HongKong:
|
|
1307
|
-
case CountryCodes.Singapore:
|
|
1308
|
-
return buildMinimumAgeValidationRule(18);
|
|
1309
|
-
default:
|
|
1310
|
-
return buildMinimumAgeValidationRule(13);
|
|
1311
|
-
}
|
|
1312
|
-
};
|
|
1313
|
-
const additionalPersonalDetailsValidators = ({
|
|
1314
|
-
country,
|
|
1315
|
-
isExperimentEnabled = () => false,
|
|
1316
|
-
isSettingEnabled = () => false,
|
|
1317
|
-
taskType,
|
|
1318
|
-
idNumberType,
|
|
1319
|
-
idNumberExempt,
|
|
1320
|
-
idNumber,
|
|
1321
|
-
existingIdNumber,
|
|
1322
|
-
formVerificationErrors,
|
|
1323
|
-
i18n,
|
|
1324
|
-
taxIdNumberType
|
|
1325
|
-
}) => ({
|
|
1326
|
-
taxInformation: resolveFieldMetadata(
|
|
1327
|
-
taxInformationDefaultFieldConfig[country],
|
|
1328
|
-
{
|
|
1329
|
-
taxIdNumberType,
|
|
1330
|
-
companyType: LegalEntityTypes.INDIVIDUAL
|
|
1331
|
-
},
|
|
1332
|
-
taxInformationDefaultFieldMetadata
|
|
1333
|
-
)?.validators,
|
|
1334
|
-
birthDate: (() => {
|
|
1335
|
-
const baseValidators = [isNotOutOfRangeBirthDateValidatorRule];
|
|
1336
|
-
if (isSettingEnabled("enforceLegalAge")) {
|
|
1337
|
-
return [...baseValidators, buildMinimumAgeValidationRule(18)];
|
|
1338
|
-
}
|
|
1339
|
-
if (isExperimentEnabled("EnableAgeVerification")) {
|
|
1340
|
-
if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
|
|
1341
|
-
return [...baseValidators, buildMinimumAgeValidationRule(18)];
|
|
1342
|
-
}
|
|
1343
|
-
return [...baseValidators, getCountrySpecificMinimumAgeValidationRule(country)];
|
|
1344
|
-
}
|
|
1345
|
-
return baseValidators;
|
|
1346
|
-
})(),
|
|
1347
|
-
...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
|
|
1348
|
-
...contactDetailsValidationRules,
|
|
1349
|
-
idNumber: (() => {
|
|
1350
|
-
const derivedIdNumberType = country === CountryCodes.UnitedStates || country === CountryCodes.PuertoRico ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
|
|
1351
|
-
return idNumberExempt ? {
|
|
1352
|
-
validate: () => {
|
|
1353
|
-
return idNumberExempt || !isEmpty(idNumber);
|
|
1354
|
-
},
|
|
1355
|
-
modes: ["blur"]
|
|
1356
|
-
} : resolveFieldMetadata(
|
|
1357
|
-
defaultFieldConfig[country],
|
|
1358
|
-
{ idNumberType: derivedIdNumberType },
|
|
1359
|
-
defaultFieldMetadata
|
|
1360
|
-
)?.validators;
|
|
1361
|
-
})(),
|
|
1362
|
-
...addressValidators({
|
|
1363
|
-
isExperimentEnabled,
|
|
1364
|
-
country,
|
|
1365
|
-
i18n
|
|
1366
|
-
})
|
|
1367
|
-
});
|
|
1368
|
-
const basicDetailsValidators = ({
|
|
1369
|
-
isExperimentEnabled = () => false
|
|
1370
|
-
}) => ({
|
|
1371
|
-
...contactDetailsValidationRules,
|
|
1372
|
-
...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0
|
|
1373
|
-
});
|
|
1374
|
-
const getIdNowProviderIdentificationStatus = async (rootLegalEntityId, baseUrl, legalEntityId) => {
|
|
1375
|
-
return httpGet({
|
|
1376
|
-
baseUrl,
|
|
1377
|
-
path: `legalEntities/${rootLegalEntityId}/child/${legalEntityId}/provider/idnow/identification/status`,
|
|
1378
|
-
errorHandler: async (response) => {
|
|
1379
|
-
const responseData = await response;
|
|
1380
|
-
if (responseData.status === 404) {
|
|
1381
|
-
return { status: 404, message: responseData.detail, errorCode: responseData.errorCode };
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
});
|
|
1385
|
-
};
|
|
1386
|
-
const useIdNowIdentificationStatus = (legalEntityId, options) => {
|
|
1387
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
1388
|
-
return useQuery({
|
|
1389
|
-
queryKey: legalEntityId === skipToken ? [] : ["idNowProviderIdentificationStatus", legalEntityId],
|
|
1390
|
-
queryFn: legalEntityId === skipToken ? skipToken : () => getIdNowProviderIdentificationStatus(
|
|
1391
|
-
rootLegalEntityId.value,
|
|
1392
|
-
baseUrl.value,
|
|
1393
|
-
legalEntityId
|
|
1394
|
-
),
|
|
1395
|
-
...options
|
|
1396
|
-
});
|
|
1397
|
-
};
|
|
1398
|
-
const idNowProviderStartIdentification = async (rootLegalEntityId, baseUrl, legalEntityId) => {
|
|
1399
|
-
return httpPost({
|
|
1400
|
-
baseUrl,
|
|
1401
|
-
path: `legalEntities/${rootLegalEntityId}/child/${legalEntityId}/provider/idnow/identification/start`
|
|
1402
|
-
});
|
|
1403
|
-
};
|
|
1404
|
-
const useIdNowStartIdentification = (legalEntityId, options) => {
|
|
1405
|
-
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
1406
|
-
return useQuery({
|
|
1407
|
-
queryKey: legalEntityId === skipToken ? [] : ["idNowProviderStartIdentification", legalEntityId],
|
|
1408
|
-
queryFn: legalEntityId === skipToken ? skipToken : () => idNowProviderStartIdentification(rootLegalEntityId.value, baseUrl.value, legalEntityId),
|
|
1409
|
-
...options
|
|
1410
|
-
});
|
|
1411
|
-
};
|
|
1412
|
-
const idnowHeader = "adyen-kyc-idnow-header";
|
|
1413
|
-
const idnowVerificationHeaderIframeContainer = "adyen-kyc-idnow-verification-header-iframe-container";
|
|
1414
|
-
const idnowVerificationHeaderIframe = "adyen-kyc-idnow-verification-header-iframe";
|
|
1415
|
-
const idnowVerificationHeaderImage = "adyen-kyc-idnow-verification-header-image";
|
|
1416
|
-
const styles = {
|
|
1417
|
-
idnowHeader,
|
|
1418
|
-
idnowVerificationHeaderIframeContainer,
|
|
1419
|
-
idnowVerificationHeaderIframe,
|
|
1420
|
-
idnowVerificationHeaderImage
|
|
1421
|
-
};
|
|
1422
|
-
const passportFrontGreenImage = lazy(
|
|
1423
|
-
() => import("./passport-front-green-BL4HmtsB.js")
|
|
1424
|
-
);
|
|
1425
|
-
const isIdNowSuccessful = (status) => {
|
|
1426
|
-
const providerStatus = status?.providerStatus;
|
|
1427
|
-
return providerStatus === "SUCCESS" || providerStatus === "SUCCESS_DATA_CHANGED" || providerStatus === "REVIEW_PENDING";
|
|
1428
|
-
};
|
|
1429
|
-
const IdNowVerificationModal = ({ handleFinish }) => {
|
|
1430
|
-
const { t } = useTranslation(["individual", "common"]);
|
|
1431
|
-
const [isConfirmPresented, setIsConfirmPresented] = useState(false);
|
|
1432
|
-
const [genericError, setGenericError] = useState(false);
|
|
1433
|
-
const widgetContainerRef = useRef(null);
|
|
1434
|
-
const iFrameRef = useRef(null);
|
|
1435
|
-
const iFrameWidgetRef = useRef(null);
|
|
1436
|
-
const [page, setPage] = useState(1);
|
|
1437
|
-
const queryClient = useQueryClient();
|
|
1438
|
-
const { showToast } = useToastContext();
|
|
1439
|
-
const {
|
|
1440
|
-
data: idNowStatus,
|
|
1441
|
-
isLoading: isStatusLoading,
|
|
1442
|
-
refetch: refetchIdNowIdentificationStatus
|
|
1443
|
-
} = useIdNowIdentificationStatus(idNowModalChildEntityId.value?.id ?? skipToken, {
|
|
1444
|
-
enabled: !!idNowModalChildEntityId.value?.id,
|
|
1445
|
-
refetchOnMount: "always",
|
|
1446
|
-
refetchInterval: 1e4,
|
|
1447
|
-
// poll every 10 seconds
|
|
1448
|
-
retry: (failureCount, error) => {
|
|
1449
|
-
if ("status" in error && error.status === 404) return false;
|
|
1450
|
-
return failureCount < 3;
|
|
1451
|
-
}
|
|
1452
|
-
});
|
|
1453
|
-
const {
|
|
1454
|
-
data: idNowStart,
|
|
1455
|
-
isLoading,
|
|
1456
|
-
isError: idNowStartError,
|
|
1457
|
-
refetch: refetchIdNowStartIdentification
|
|
1458
|
-
} = useIdNowStartIdentification(idNowModalChildEntityId.value?.id ?? skipToken, {
|
|
1459
|
-
enabled: !!idNowModalChildEntityId.value?.id && page === 2
|
|
1460
|
-
});
|
|
1461
|
-
const handleDismiss = () => {
|
|
1462
|
-
setIsConfirmPresented(true);
|
|
1463
|
-
};
|
|
1464
|
-
const handleCancelDismiss = () => {
|
|
1465
|
-
setIsConfirmPresented(false);
|
|
1466
|
-
};
|
|
1467
|
-
const handleConfirmDismiss = () => {
|
|
1468
|
-
setPage(1);
|
|
1469
|
-
setGenericError(false);
|
|
1470
|
-
setIsConfirmPresented(false);
|
|
1471
|
-
showIdNowModal.value = false;
|
|
1472
|
-
if (idNowStartError && idNowModalChildEntityId.value?.id) {
|
|
1473
|
-
queryClient.resetQueries({
|
|
1474
|
-
queryKey: ["idNowProviderStartIdentification", idNowModalChildEntityId.value?.id]
|
|
1475
|
-
});
|
|
1476
|
-
}
|
|
1477
|
-
idNowModalChildEntityId.value = void 0;
|
|
1478
|
-
iFrameWidgetRef.current?.unmount();
|
|
1479
|
-
iFrameRef.current?.remove();
|
|
1480
|
-
handleFinish?.();
|
|
1481
|
-
};
|
|
1482
|
-
if (idNowStatus?.status === "finished") {
|
|
1483
|
-
if (isIdNowSuccessful(idNowStatus)) {
|
|
1484
|
-
showToast({
|
|
1485
|
-
label: t(($) => $["successfullyUpdatedDetails"], { ns: "common" }),
|
|
1486
|
-
variant: "success"
|
|
1487
|
-
});
|
|
1488
|
-
handleConfirmDismiss();
|
|
1489
|
-
} else {
|
|
1490
|
-
if (page === 2) {
|
|
1491
|
-
handleConfirmDismiss();
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
if (!isLoading && idNowStartError) {
|
|
1496
|
-
setGenericError(true);
|
|
1497
|
-
setPage(1);
|
|
1498
|
-
}
|
|
1499
|
-
const initializeIdNowWidget = useCallback(async (url) => {
|
|
1500
|
-
const container = widgetContainerRef.current;
|
|
1501
|
-
if (!container) {
|
|
1502
|
-
return;
|
|
1503
|
-
}
|
|
1504
|
-
const iFrame = document.createElement("iframe");
|
|
1505
|
-
iFrameRef.current = iFrame;
|
|
1506
|
-
iFrame.setAttribute("allowFullscreen", "true");
|
|
1507
|
-
iFrame.classList.add(styles.idnowVerificationHeaderIframe);
|
|
1508
|
-
iFrame.setAttribute("height", "800");
|
|
1509
|
-
iFrame.setAttribute(
|
|
1510
|
-
"allow",
|
|
1511
|
-
"camera *;microphone *;geolocation *;clipboard-read *;clipboard-write *"
|
|
1512
|
-
);
|
|
1513
|
-
container.appendChild(iFrame);
|
|
1514
|
-
try {
|
|
1515
|
-
iFrameWidgetRef.current = new IFrameWidget(iFrame, url, "idnow", "");
|
|
1516
|
-
await iFrameWidgetRef.current.mountAndWaitForResponse();
|
|
1517
|
-
} catch (err) {
|
|
1518
|
-
console.error("Error occurred:", err);
|
|
1519
|
-
setGenericError(true);
|
|
1520
|
-
setPage(1);
|
|
1521
|
-
}
|
|
1522
|
-
}, []);
|
|
1523
|
-
useEffect(() => {
|
|
1524
|
-
if (page === 2 && !isLoading && idNowStart && idNowStart?.url) {
|
|
1525
|
-
(async () => {
|
|
1526
|
-
await refetchIdNowIdentificationStatus();
|
|
1527
|
-
await initializeIdNowWidget(idNowStart.url);
|
|
1528
|
-
})();
|
|
1529
|
-
}
|
|
1530
|
-
return () => {
|
|
1531
|
-
iFrameWidgetRef.current?.unmount();
|
|
1532
|
-
iFrameRef.current?.remove();
|
|
1533
|
-
};
|
|
1534
|
-
}, [isLoading, page, initializeIdNowWidget, refetchIdNowIdentificationStatus, idNowStart]);
|
|
1535
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1536
|
-
!isStatusLoading && /* @__PURE__ */ jsxs(
|
|
1537
|
-
Modal,
|
|
1538
|
-
{
|
|
1539
|
-
size: page === 2 ? "large" : "medium",
|
|
1540
|
-
showCloseButton: !isLoading && !isStatusLoading,
|
|
1541
|
-
onClose: handleDismiss,
|
|
1542
|
-
ariaLabel: t(($) => $["identityVerification"], { ns: "common" }),
|
|
1543
|
-
children: [
|
|
1544
|
-
page === 1 && /* @__PURE__ */ jsx("div", { className: styles.idnowHeader, children: /* @__PURE__ */ jsx(
|
|
1545
|
-
LandingLayout,
|
|
1546
|
-
{
|
|
1547
|
-
media: /* @__PURE__ */ jsx(
|
|
1548
|
-
Image,
|
|
1549
|
-
{
|
|
1550
|
-
className: styles.idnowVerificationHeaderImage,
|
|
1551
|
-
lazyLoadedImage: passportFrontGreenImage
|
|
1552
|
-
}
|
|
1553
|
-
),
|
|
1554
|
-
title: t(($) => $["identityVerification"], { ns: "common" }),
|
|
1555
|
-
description: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1556
|
-
t(($) => $["idNowDescription"], { ns: "individual" }),
|
|
1557
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
1558
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
1559
|
-
getIndividualLegalEntityName(idNowModalChildEntityId.value) && t(($) => $["idNowDescriptionName"], {
|
|
1560
|
-
ns: "individual",
|
|
1561
|
-
name: getIndividualLegalEntityName(idNowModalChildEntityId.value)
|
|
1562
|
-
})
|
|
1563
|
-
] }),
|
|
1564
|
-
error: !isLoading && genericError ? /* @__PURE__ */ jsx(
|
|
1565
|
-
Alert,
|
|
1566
|
-
{
|
|
1567
|
-
variant: "error",
|
|
1568
|
-
title: t(($) => $["thereWasAnErrorTryAgain"], { ns: "common" })
|
|
1569
|
-
}
|
|
1570
|
-
) : void 0,
|
|
1571
|
-
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1572
|
-
/* @__PURE__ */ jsx(
|
|
1573
|
-
Button,
|
|
1574
|
-
{
|
|
1575
|
-
onClick: async () => {
|
|
1576
|
-
setGenericError(false);
|
|
1577
|
-
setPage(2);
|
|
1578
|
-
await refetchIdNowStartIdentification();
|
|
1579
|
-
},
|
|
1580
|
-
disabled: isLoading || isStatusLoading || idNowStatus?.status === "finished" && isIdNowSuccessful(idNowStatus),
|
|
1581
|
-
fullWidth: true,
|
|
1582
|
-
children: idNowStatus?.status === "pending" ? t(($) => $["continueVerification"], { ns: "common" }) : t(($) => $["startVerification"], { ns: "common" })
|
|
1583
|
-
}
|
|
1584
|
-
),
|
|
1585
|
-
/* @__PURE__ */ jsx(
|
|
1586
|
-
Button,
|
|
1587
|
-
{
|
|
1588
|
-
disabled: isLoading || isStatusLoading,
|
|
1589
|
-
variant: "tertiary",
|
|
1590
|
-
onClick: handleConfirmDismiss,
|
|
1591
|
-
fullWidth: true,
|
|
1592
|
-
children: t(($) => $["finishLater"], { ns: "common" })
|
|
1593
|
-
}
|
|
1594
|
-
)
|
|
1595
|
-
] })
|
|
1596
|
-
}
|
|
1597
|
-
) }),
|
|
1598
|
-
page === 2 && (isLoading ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsx(
|
|
1599
|
-
"div",
|
|
1600
|
-
{
|
|
1601
|
-
ref: widgetContainerRef,
|
|
1602
|
-
className: styles.idnowVerificationHeaderIframeContainer
|
|
1603
|
-
}
|
|
1604
|
-
))
|
|
1605
|
-
]
|
|
1606
|
-
}
|
|
1607
|
-
),
|
|
1608
|
-
isConfirmPresented && /* @__PURE__ */ jsx(
|
|
1609
|
-
Confirm,
|
|
1610
|
-
{
|
|
1611
|
-
confirmText: t(($) => $["leave"], { ns: "common" }),
|
|
1612
|
-
onCancel: handleCancelDismiss,
|
|
1613
|
-
onConfirm: handleConfirmDismiss,
|
|
1614
|
-
title: t(($) => $["unsavedChanges"], { ns: "common" })
|
|
1615
|
-
}
|
|
1616
|
-
)
|
|
1617
|
-
] });
|
|
1618
|
-
};
|
|
1619
|
-
const adjustOnfidoIdentificationData = (data, apiData) => {
|
|
1620
|
-
const { typeOfIdentity, idNumber, idNumberExempt } = data;
|
|
1621
|
-
const identificationData = {
|
|
1622
|
-
...apiData,
|
|
1623
|
-
number: idNumber,
|
|
1624
|
-
type: getOnfidoIdentityTypeToApiIdentityTypeMap(data)[typeOfIdentity] ?? "nationalIdNumber"
|
|
1625
|
-
};
|
|
1626
|
-
switch (typeOfIdentity) {
|
|
1627
|
-
case "passport":
|
|
1628
|
-
return {
|
|
1629
|
-
...identificationData,
|
|
1630
|
-
cardNumber: ""
|
|
1631
|
-
};
|
|
1632
|
-
case "driversLicense":
|
|
1633
|
-
return {
|
|
1634
|
-
...identificationData,
|
|
1635
|
-
expiryDate: ""
|
|
1636
|
-
};
|
|
1637
|
-
default:
|
|
1638
|
-
return idNumber === void 0 && idNumberExempt === void 0 ? void 0 : {
|
|
1639
|
-
...identificationData,
|
|
1640
|
-
expiryDate: "",
|
|
1641
|
-
cardNumber: "",
|
|
1642
|
-
nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
|
|
1643
|
-
};
|
|
1644
|
-
}
|
|
1645
|
-
};
|
|
1646
|
-
const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEnabled, matchingScenario) => {
|
|
1647
|
-
const legalEntity = {
|
|
1648
|
-
...formatObject(individualOnfido, individualOnfidoApiKeyMapping),
|
|
1649
|
-
type: LegalEntityTypes.INDIVIDUAL
|
|
1650
|
-
};
|
|
1651
|
-
if (individualOnfido.additionalPersonalDetails) {
|
|
1652
|
-
if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && matchingScenario?.includes(Scenarios.L_TAXINFO) && individualOnfido.additionalPersonalDetails?.idNumber && individualOnfido.additionalPersonalDetails?.typeOfIdentity && individualOnfido.additionalPersonalDetails?.country === CountryCodes.Spain) {
|
|
1653
|
-
legalEntity.individual.taxInformation = [
|
|
1654
|
-
{
|
|
1655
|
-
country: individualOnfido.additionalPersonalDetails.country,
|
|
1656
|
-
number: individualOnfido.additionalPersonalDetails.idNumber,
|
|
1657
|
-
type: individualOnfido.additionalPersonalDetails.typeOfIdentity.toUpperCase()
|
|
1658
|
-
}
|
|
1659
|
-
];
|
|
1660
|
-
}
|
|
1661
|
-
legalEntity.individual.identificationData = adjustOnfidoIdentificationData(
|
|
1662
|
-
individualOnfido.additionalPersonalDetails,
|
|
1663
|
-
legalEntity.individual.identificationData
|
|
1664
|
-
);
|
|
1665
|
-
}
|
|
1666
|
-
const nameLocalization = [
|
|
1667
|
-
mapSchemaFieldsToApiScriptLocalization(individualOnfido.basicDetails ?? {}, "jaHani"),
|
|
1668
|
-
mapSchemaFieldsToApiScriptLocalization(individualOnfido.basicDetails ?? {}, "jaKana")
|
|
1669
|
-
].filter(({ fields }) => !isEmpty$1(fields));
|
|
1670
|
-
if (nameLocalization.length) {
|
|
1671
|
-
legalEntity.individual.name.localization = nameLocalization;
|
|
1672
|
-
}
|
|
1673
|
-
const addressLocalizations = mapJpAddressSchemaToAddressLocalizations(
|
|
1674
|
-
individualOnfido.additionalPersonalDetails
|
|
1675
|
-
);
|
|
1676
|
-
if (addressLocalizations.length > 0)
|
|
1677
|
-
legalEntity.individual.residentialAddress.localization = addressLocalizations;
|
|
1678
|
-
if (individualOnfido.basicDetails?.phoneNumber) {
|
|
1679
|
-
const phone = {
|
|
1680
|
-
number: individualOnfido.basicDetails.phoneNumber.number,
|
|
1681
|
-
type: "mobile"
|
|
1682
|
-
};
|
|
1683
|
-
if (phone.number && legalEntity.individual) {
|
|
1684
|
-
legalEntity.individual.phone = phone;
|
|
1685
|
-
} else {
|
|
1686
|
-
delete legalEntity?.individual?.phone;
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
return legalEntity;
|
|
1690
|
-
};
|
|
1691
|
-
const identityOnfidoBase = {
|
|
1692
|
-
role: {
|
|
1693
|
-
rule: "requiredIfDecisionMakerTask"
|
|
1694
|
-
},
|
|
1695
|
-
firstName: {
|
|
1696
|
-
rule: "REQUIRED"
|
|
1697
|
-
},
|
|
1698
|
-
lastName: {
|
|
1699
|
-
rule: "REQUIRED"
|
|
1700
|
-
},
|
|
1701
|
-
birthDate: {
|
|
1702
|
-
rule: "REQUIRED"
|
|
1703
|
-
},
|
|
1704
|
-
phoneNumber: {
|
|
1705
|
-
rules: ["requiredIfPhoneScenarioDisabled", "contactsIfRequiredForRole"]
|
|
1706
|
-
},
|
|
1707
|
-
email: {
|
|
1708
|
-
rule: "contactsIfRequiredForRole"
|
|
1709
|
-
},
|
|
1710
|
-
jobTitle: {
|
|
1711
|
-
rule: "jobTitleIfRequiredForRole"
|
|
1712
|
-
},
|
|
1713
|
-
placeOfBirth: {
|
|
1714
|
-
rule: "isPlaceOfBirthRequired"
|
|
1715
|
-
},
|
|
1716
|
-
nationality: {
|
|
1717
|
-
rule: "nationalityIfRequiredForRole"
|
|
1718
|
-
},
|
|
1719
|
-
address: {
|
|
1720
|
-
rule: "addressIfRequiredForCountry"
|
|
1721
|
-
},
|
|
1722
|
-
otherAddressInformation: {
|
|
1723
|
-
rule: "otherAddressInfoIfRequiredForCountry"
|
|
1724
|
-
},
|
|
1725
|
-
country: {
|
|
1726
|
-
rule: "REQUIRED"
|
|
1727
|
-
},
|
|
1728
|
-
postalCode: {
|
|
1729
|
-
rule: "postalCodeIfRequiredForCountry"
|
|
1730
|
-
},
|
|
1731
|
-
city: {
|
|
1732
|
-
rule: "cityIfRequiredForCountry"
|
|
1733
|
-
},
|
|
1734
|
-
stateOrProvince: {
|
|
1735
|
-
rule: "stateOrProvinceIfRequiredForCountry"
|
|
1736
|
-
},
|
|
1737
|
-
proofOfResidency: {
|
|
1738
|
-
rule: "isProofOfResidencyRequired"
|
|
1739
|
-
},
|
|
1740
|
-
proofOfNationalId: {
|
|
1741
|
-
rule: "isProofOfNationalIdRequired"
|
|
1742
|
-
},
|
|
1743
|
-
relationship: {
|
|
1744
|
-
rule: "legalRepresentativeRelationshipRequired"
|
|
1745
|
-
},
|
|
1746
|
-
proofOfRelationship: {
|
|
1747
|
-
rule: "isProofOfRelationshipRequired"
|
|
1748
|
-
},
|
|
1749
|
-
nomineeDirector: {
|
|
1750
|
-
rules: ["isGuidedDecisionMakersFlowDisabled", "nomineeDirectorRequiredForCountry"]
|
|
1751
|
-
},
|
|
1752
|
-
nomineeShareholder: {
|
|
1753
|
-
rules: ["isGuidedDecisionMakersFlowDisabled", "nomineeShareHolderRequiredForCountry"]
|
|
1754
|
-
},
|
|
1755
|
-
idVerificationMethod: {
|
|
1756
|
-
rule: "isIdVerificationMethodRequired"
|
|
1757
|
-
},
|
|
1758
|
-
idDocument: {
|
|
1759
|
-
// (either from Onfido or previously-uploaded document)
|
|
1760
|
-
rule: "isUsingInstantVerificationOrHasExistingDocument"
|
|
1761
|
-
},
|
|
1762
|
-
idDocumentType: {
|
|
1763
|
-
// If the user has a missing ID error and chooses manual flow
|
|
1764
|
-
rule: "isManualIdFlowAndHasMissingData"
|
|
1765
|
-
},
|
|
1766
|
-
/**
|
|
1767
|
-
* Below fields only relevant if manual ID is needed
|
|
1768
|
-
* @see identityNumber
|
|
1769
|
-
* @see idDocRequired
|
|
1770
|
-
*/
|
|
1771
|
-
idFrontPage: {
|
|
1772
|
-
rule: "hasChosenIdType"
|
|
1773
|
-
},
|
|
1774
|
-
idBackPage: {
|
|
1775
|
-
rule: "backPageIfRequiredForIdType"
|
|
1776
|
-
},
|
|
1777
|
-
// Fields required for Guided decision makers flow
|
|
1778
|
-
isSignatory: {
|
|
1779
|
-
rules: ["isGuidedDecisionMakersFlowEnabled", "requiredIfDecisionMakerTask"]
|
|
1780
|
-
},
|
|
1781
|
-
isOwner: {
|
|
1782
|
-
rules: ["isGuidedDecisionMakersFlowEnabled", "requiredIfDecisionMakerTask"]
|
|
1783
|
-
},
|
|
1784
|
-
isControllingPerson: {
|
|
1785
|
-
rules: ["isGuidedDecisionMakersFlowEnabled", "requiredIfDecisionMakerTask"]
|
|
1786
|
-
},
|
|
1787
|
-
isDirector: {
|
|
1788
|
-
rules: [
|
|
1789
|
-
"isGuidedDecisionMakersFlowEnabled",
|
|
1790
|
-
"requiredIfDecisionMakerTask",
|
|
1791
|
-
"isDirectorRequiredForCountry"
|
|
1792
|
-
]
|
|
1793
|
-
},
|
|
1794
|
-
isNomineeDirector: {
|
|
1795
|
-
rules: [
|
|
1796
|
-
"isGuidedDecisionMakersFlowEnabled",
|
|
1797
|
-
"requiredIfDecisionMakerTask",
|
|
1798
|
-
"nomineeDirectorRequiredForCountry"
|
|
1799
|
-
]
|
|
1800
|
-
},
|
|
1801
|
-
isNomineeShareholder: {
|
|
1802
|
-
rules: [
|
|
1803
|
-
"isGuidedDecisionMakersFlowEnabled",
|
|
1804
|
-
"requiredIfDecisionMakerTask",
|
|
1805
|
-
"nomineeShareHolderRequiredForCountry"
|
|
1806
|
-
]
|
|
1807
|
-
},
|
|
1808
|
-
// Japanese name fields
|
|
1809
|
-
jaHaniFirstName: {
|
|
1810
|
-
rule: "japanSpecificField"
|
|
1811
|
-
},
|
|
1812
|
-
jaHaniLastName: {
|
|
1813
|
-
rule: "japanSpecificField"
|
|
1814
|
-
},
|
|
1815
|
-
jaKanaFirstName: {
|
|
1816
|
-
rule: "japanSpecificField"
|
|
1817
|
-
},
|
|
1818
|
-
jaKanaLastName: {
|
|
1819
|
-
rule: "japanSpecificField"
|
|
1820
|
-
},
|
|
1821
|
-
// Japanese address fields
|
|
1822
|
-
jaHaniAddress: {
|
|
1823
|
-
rule: "japanSpecificField"
|
|
1824
|
-
},
|
|
1825
|
-
jaHaniCity: {
|
|
1826
|
-
rule: "japanSpecificField"
|
|
1827
|
-
},
|
|
1828
|
-
jaHaniStateOrProvince: {
|
|
1829
|
-
rule: "japanSpecificField"
|
|
1830
|
-
},
|
|
1831
|
-
jaKanaCity: {
|
|
1832
|
-
rule: "japanSpecificField"
|
|
1833
|
-
},
|
|
1834
|
-
jaKanaStateOrProvince: {
|
|
1835
|
-
rule: "japanSpecificField"
|
|
1836
|
-
}
|
|
1837
|
-
};
|
|
1838
|
-
const identityNumber = {
|
|
1839
|
-
idNumber: {
|
|
1840
|
-
rule: "idNumberRules",
|
|
1841
|
-
obscured: true
|
|
1842
|
-
},
|
|
1843
|
-
idNumberExempt: {
|
|
1844
|
-
rules: ["idNumberExemptIfApplicableCountry", "isDirectorIdNumberRequiredForCountry"]
|
|
1845
|
-
},
|
|
1846
|
-
idDocumentType: {
|
|
1847
|
-
// If the user chooses to not provide an ID number, we'll need an ID from them
|
|
1848
|
-
rule: "isManualIdFlowAndNotProvidingIdNumber"
|
|
1849
|
-
}
|
|
1850
|
-
};
|
|
1851
|
-
const additionalIdentityInfo = {
|
|
1852
|
-
typeOfIdentity: {
|
|
1853
|
-
rules: ["requiredIfCountryUsesMultipleTypesOfIdentity", "isDirectorIdNumberRequiredForCountry"]
|
|
1854
|
-
},
|
|
1855
|
-
issuerState: {
|
|
1856
|
-
rule: "issuerStateRequired"
|
|
1857
|
-
},
|
|
1858
|
-
licenseCardNumber: {
|
|
1859
|
-
rule: "licenseCardNumberRules"
|
|
1860
|
-
},
|
|
1861
|
-
expiryDate: {
|
|
1862
|
-
rule: "expiryDateRequired"
|
|
1863
|
-
}
|
|
1864
|
-
};
|
|
1865
|
-
const idDocRequired = {
|
|
1866
|
-
// These fields are relevant for the manual ID flow only.
|
|
1867
|
-
// If we get `L1_IDDOC` then we know we need to require a manual ID upload when the manual flow is used
|
|
1868
|
-
idDocumentType: {
|
|
1869
|
-
rule: "isManualIdFlow"
|
|
1870
|
-
}
|
|
1871
|
-
};
|
|
1872
|
-
const nationality = {
|
|
1873
|
-
nationality: {
|
|
1874
|
-
rule: "REQUIRED"
|
|
1875
|
-
}
|
|
1876
|
-
};
|
|
1877
|
-
const phoneNumberBase = {
|
|
1878
|
-
phoneNumber: {
|
|
1879
|
-
rule: "contactsIfRequiredForRole"
|
|
1880
|
-
}
|
|
1881
|
-
};
|
|
1882
|
-
const taxInformationBase = {
|
|
1883
|
-
taxInformation: { rule: "countryUsesTaxId" }
|
|
1884
|
-
};
|
|
1885
|
-
const individualOnfidoFieldsPerScenario = {
|
|
1886
|
-
L0: drop("address", "birthDate").from(identityOnfidoBase),
|
|
1887
|
-
L1: identityOnfidoBase,
|
|
1888
|
-
L1_ID: {
|
|
1889
|
-
...identityOnfidoBase,
|
|
1890
|
-
...identityNumber,
|
|
1891
|
-
...additionalIdentityInfo
|
|
1892
|
-
},
|
|
1893
|
-
L1_IDO: {
|
|
1894
|
-
// TODO: change idNumber rule to optional once optional fields are implemented
|
|
1895
|
-
...identityOnfidoBase,
|
|
1896
|
-
...identityNumber,
|
|
1897
|
-
...additionalIdentityInfo
|
|
1898
|
-
},
|
|
1899
|
-
L1_NAT: {
|
|
1900
|
-
...identityOnfidoBase,
|
|
1901
|
-
...identityNumber,
|
|
1902
|
-
...additionalIdentityInfo,
|
|
1903
|
-
...nationality
|
|
1904
|
-
},
|
|
1905
|
-
L_TAXINFO: { ...identityOnfidoBase, ...taxInformationBase },
|
|
1906
|
-
L1_IDDOC: idDocRequired,
|
|
1907
|
-
L_PH: phoneNumberBase
|
|
1908
|
-
};
|
|
1909
|
-
const parseIndividualOnfidoScenarios = (scenarios) => composePerScenarioFormConfigurations(scenarios, individualOnfidoFieldsPerScenario);
|
|
1910
|
-
const parseConfiguration = ({ scenarios }) => parseIndividualOnfidoScenarios(scenarios);
|
|
1911
|
-
const logger = createLogger();
|
|
1912
|
-
function IndividualOnfidoDropin({
|
|
1913
|
-
taskType = TaskTypes.INDIVIDUAL,
|
|
1914
|
-
parentLegalEntity,
|
|
1915
|
-
legalEntityResponse,
|
|
1916
|
-
handleHomeClick,
|
|
1917
|
-
isTargetLegalEntityType,
|
|
1918
|
-
country: parentCountry,
|
|
1919
|
-
problems: propProblems,
|
|
1920
|
-
onSubmit: externalOnSubmit,
|
|
1921
|
-
asModal = false,
|
|
1922
|
-
handleBackClick: externalBackClick,
|
|
1923
|
-
trustedFields,
|
|
1924
|
-
trustedFieldsProvider,
|
|
1925
|
-
trustedRoles
|
|
1926
|
-
}) {
|
|
1927
|
-
const { baseUrl, rootLegalEntityId } = useApiContext();
|
|
1928
|
-
const { accountHolder, setAccountHolder } = useAccountHolder();
|
|
1929
|
-
const { i18n } = useI18nContext();
|
|
1930
|
-
const { t } = useTranslation("individual");
|
|
1931
|
-
const userEvents = useAnalyticsContext();
|
|
1932
|
-
const { showToast, clearToasts } = useToastContext();
|
|
1933
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
1934
|
-
const { data: versionData } = useVersionConfiguration();
|
|
1935
|
-
const { isSettingEnabled } = useSettingsContext();
|
|
1936
|
-
const queryClient = useQueryClient();
|
|
1937
|
-
const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
|
|
1938
|
-
const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
|
|
1939
|
-
const defaultCountry = "NL";
|
|
1940
|
-
const { data: providerStatus } = useProviderStatus({
|
|
1941
|
-
providers: ["idDocument"],
|
|
1942
|
-
country: legalEntityResponse ? getLegalEntityCountry(legalEntityResponse) : defaultCountry
|
|
1943
|
-
});
|
|
1944
|
-
const isInstantVerificationEnabled = providerStatus?.statuses?.idDocument?.enabled ?? true;
|
|
1945
|
-
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
1946
|
-
const isRoleFieldNeeded = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
|
|
1947
|
-
const dataFromResponse = useMemo(() => {
|
|
1948
|
-
const formStateData = individualFormDefaultData.value;
|
|
1949
|
-
individualFormDefaultData.value = null;
|
|
1950
|
-
if (legalEntityResponse) {
|
|
1951
|
-
return {
|
|
1952
|
-
...mapLegalEntityToIndividualOnfidoSchema(
|
|
1953
|
-
legalEntityResponse,
|
|
1954
|
-
isTargetLegalEntityType,
|
|
1955
|
-
isRoleFieldNeeded,
|
|
1956
|
-
parentLegalEntity
|
|
1957
|
-
),
|
|
1958
|
-
...formStateData
|
|
1959
|
-
};
|
|
1960
|
-
}
|
|
1961
|
-
return {
|
|
1962
|
-
additionalPersonalDetails: {
|
|
1963
|
-
country: parentCountry
|
|
1964
|
-
},
|
|
1965
|
-
...formStateData
|
|
1966
|
-
};
|
|
1967
|
-
}, [
|
|
1968
|
-
legalEntityResponse,
|
|
1969
|
-
parentCountry,
|
|
1970
|
-
isTargetLegalEntityType,
|
|
1971
|
-
isRoleFieldNeeded,
|
|
1972
|
-
parentLegalEntity
|
|
1973
|
-
]);
|
|
1974
|
-
const [matchingScenario, setMatchingScenario] = useState();
|
|
1975
|
-
const [validationErrors, setValidationErrors] = useState();
|
|
1976
|
-
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
1977
|
-
const [existingAttachments, setExistingAttachments] = useState();
|
|
1978
|
-
const [documents, setDocuments] = useState();
|
|
1979
|
-
const [country, setCountry] = useState(
|
|
1980
|
-
dataFromResponse?.additionalPersonalDetails?.country ?? parentCountry
|
|
1981
|
-
);
|
|
1982
|
-
const [derivedProps, setDerivedProps] = useState();
|
|
1983
|
-
const [nextHandler, setNextHandler] = useState();
|
|
1984
|
-
const problems = useMemo(
|
|
1985
|
-
() => ({
|
|
1986
|
-
...propProblems,
|
|
1987
|
-
validationErrors
|
|
1988
|
-
}),
|
|
1989
|
-
[propProblems, validationErrors]
|
|
1990
|
-
);
|
|
1991
|
-
const hasVerificationErrors = propProblems?.verificationErrors && Object.keys(propProblems.verificationErrors).length > 0;
|
|
1992
|
-
useEffect(() => {
|
|
1993
|
-
userEvents.updateBaseTrackingPayload({ task: taskType });
|
|
1994
|
-
userEvents.addTaskEvent("Landed on page", {
|
|
1995
|
-
actionType: "start"
|
|
1996
|
-
});
|
|
1997
|
-
}, []);
|
|
1998
|
-
const individualFieldValidations = useCallback(
|
|
1999
|
-
(data2) => ({
|
|
2000
|
-
basicDetails: basicDetailsValidators({
|
|
2001
|
-
isExperimentEnabled
|
|
2002
|
-
}),
|
|
2003
|
-
additionalPersonalDetails: additionalPersonalDetailsValidators({
|
|
2004
|
-
country: data2?.additionalPersonalDetails?.country ?? country,
|
|
2005
|
-
isExperimentEnabled,
|
|
2006
|
-
isSettingEnabled,
|
|
2007
|
-
taskType,
|
|
2008
|
-
idNumberType: data2?.additionalPersonalDetails?.typeOfIdentity,
|
|
2009
|
-
idNumberExempt: data2?.additionalPersonalDetails?.idNumberExempt,
|
|
2010
|
-
idNumber: data2?.additionalPersonalDetails?.idNumber,
|
|
2011
|
-
existingIdNumber: dataFromResponse.additionalPersonalDetails?.idNumber,
|
|
2012
|
-
formVerificationErrors: problems?.verificationErrors?.additionalPersonalDetails,
|
|
2013
|
-
i18n,
|
|
2014
|
-
taxIdNumberType: data2?.additionalPersonalDetails?.taxInformation?.length ? data2?.additionalPersonalDetails?.taxInformation[0]?.type : void 0
|
|
2015
|
-
})
|
|
2016
|
-
}),
|
|
2017
|
-
[
|
|
2018
|
-
country,
|
|
2019
|
-
dataFromResponse.additionalPersonalDetails?.idNumber,
|
|
2020
|
-
i18n,
|
|
2021
|
-
isExperimentEnabled,
|
|
2022
|
-
isSettingEnabled,
|
|
2023
|
-
problems?.verificationErrors?.additionalPersonalDetails,
|
|
2024
|
-
taskType
|
|
2025
|
-
]
|
|
2026
|
-
);
|
|
2027
|
-
const validatePhoneNumber = useValidatePhoneNumberImperatively();
|
|
2028
|
-
const { mutateAsync: verifyIdNumber2 } = useVerifyIdNumber();
|
|
2029
|
-
const individualFieldAsyncValidations = useCallback(
|
|
2030
|
-
(data2) => ({
|
|
2031
|
-
basicDetails: {
|
|
2032
|
-
phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber
|
|
2033
|
-
},
|
|
2034
|
-
additionalPersonalDetails: {
|
|
2035
|
-
idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2?.additionalPersonalDetails).idNumber
|
|
2036
|
-
}
|
|
2037
|
-
}),
|
|
2038
|
-
[verifyIdNumber2, validatePhoneNumber]
|
|
2039
|
-
);
|
|
2040
|
-
const defaultData = useMemo(() => {
|
|
2041
|
-
if (!documents) return dataFromResponse;
|
|
2042
|
-
return {
|
|
2043
|
-
...dataFromResponse,
|
|
2044
|
-
...drop("idDocument").from(documents),
|
|
2045
|
-
idVerificationMethod: {
|
|
2046
|
-
idDocument: documents.idDocument,
|
|
2047
|
-
idVerificationMethod: "existingDocument"
|
|
2048
|
-
}
|
|
2049
|
-
};
|
|
2050
|
-
}, [documents, dataFromResponse]);
|
|
2051
|
-
const form = useMultiForm({
|
|
2052
|
-
requiredFields: derivedProps?.requiredFields,
|
|
2053
|
-
defaultData,
|
|
2054
|
-
rules: individualFieldValidations,
|
|
2055
|
-
asyncRules: individualFieldAsyncValidations,
|
|
2056
|
-
optionalFields: derivedProps?.optionalFields,
|
|
2057
|
-
obscuredFields: {
|
|
2058
|
-
/**takes care of scenario when the 4 digit provided is wrong based on verification errors and
|
|
2059
|
-
* we need to show validation error for defaultData which is already saved
|
|
2060
|
-
**/
|
|
2061
|
-
additionalPersonalDetails: check4DigitSsnFailed(
|
|
2062
|
-
problems?.verificationErrors?.additionalPersonalDetails
|
|
2063
|
-
) ? [] : ["idNumber"]
|
|
2064
|
-
}
|
|
2065
|
-
});
|
|
2066
|
-
const documentUtils = documentApiUtils({
|
|
2067
|
-
baseUrl: baseUrl.value,
|
|
2068
|
-
rootLegalEntityId: rootLegalEntityId.value
|
|
2069
|
-
});
|
|
2070
|
-
const { data, requiredFields } = form;
|
|
2071
|
-
useEffect(() => {
|
|
2072
|
-
setCountry(data?.additionalPersonalDetails?.country ?? parentCountry);
|
|
2073
|
-
}, [data?.additionalPersonalDetails?.country, parentCountry]);
|
|
2074
|
-
const { data: scenarios } = useScenarios(country, LegalEntityTypes.INDIVIDUAL);
|
|
2075
|
-
useEffect(() => {
|
|
2076
|
-
if (!scenarios) return;
|
|
2077
|
-
setHasMotionCaptureScenario(scenarios);
|
|
2078
|
-
setMatchingScenario(scenarios);
|
|
2079
|
-
}, [scenarios]);
|
|
2080
|
-
const { fieldConfigurations } = useScenarioConfiguration({
|
|
2081
|
-
parseConfiguration,
|
|
2082
|
-
legalEntityType: LegalEntityTypes.INDIVIDUAL,
|
|
2083
|
-
setLoadingStatus,
|
|
2084
|
-
country
|
|
2085
|
-
});
|
|
2086
|
-
const fieldsFromCustomRules = useMemo(
|
|
2087
|
-
() => individualOnfidoRules({
|
|
2088
|
-
matchingScenario,
|
|
2089
|
-
data,
|
|
2090
|
-
country: data?.additionalPersonalDetails?.country ?? country,
|
|
2091
|
-
taskType,
|
|
2092
|
-
isExperimentEnabled,
|
|
2093
|
-
rootLegalEntity: parentLegalEntity,
|
|
2094
|
-
problems,
|
|
2095
|
-
version: versionData?.version
|
|
2096
|
-
}),
|
|
2097
|
-
[
|
|
2098
|
-
country,
|
|
2099
|
-
matchingScenario,
|
|
2100
|
-
data,
|
|
2101
|
-
isExperimentEnabled,
|
|
2102
|
-
parentLegalEntity,
|
|
2103
|
-
taskType,
|
|
2104
|
-
problems,
|
|
2105
|
-
versionData?.version
|
|
2106
|
-
]
|
|
2107
|
-
);
|
|
2108
|
-
useEffect(() => {
|
|
2109
|
-
const derivedProps2 = getPropsFromConfigurations({
|
|
2110
|
-
scenarioConfiguration: fieldConfigurations,
|
|
2111
|
-
forms: individualOnfidoForms,
|
|
2112
|
-
remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
2113
|
-
dataMissingErrors: problems?.missingData ?? [],
|
|
2114
|
-
fieldsWithExistingData: legalEntityResponse ? getFieldsWithExistingData(
|
|
2115
|
-
legalEntityResponse,
|
|
2116
|
-
individualOnfidoApiKeyMapping,
|
|
2117
|
-
individualOnfidoDocumentMapping,
|
|
2118
|
-
[
|
|
2119
|
-
"additionalPersonalDetails.typeOfIdentity",
|
|
2120
|
-
"additionalPersonalDetails.idNumber",
|
|
2121
|
-
"additionalPersonalDetails.stateOrProvince",
|
|
2122
|
-
"additionalPersonalDetails.issuerState"
|
|
2123
|
-
]
|
|
2124
|
-
) : [],
|
|
2125
|
-
customRules: fieldsFromCustomRules,
|
|
2126
|
-
legalEntityType: legalEntityResponse?.type,
|
|
2127
|
-
legalEntityTrustedFields: [],
|
|
2128
|
-
remediationFieldAsOptional: true
|
|
2129
|
-
});
|
|
2130
|
-
const updatedDerivedProps = mandateIdVerificationForMotionCapture(
|
|
2131
|
-
showIndividualMotionCapture?.value,
|
|
2132
|
-
derivedProps2
|
|
2133
|
-
);
|
|
2134
|
-
if (updatedDerivedProps) {
|
|
2135
|
-
setDerivedProps(updatedDerivedProps);
|
|
2136
|
-
}
|
|
2137
|
-
}, [
|
|
2138
|
-
fieldConfigurations,
|
|
2139
|
-
legalEntityResponse,
|
|
2140
|
-
fieldsFromCustomRules,
|
|
2141
|
-
problems?.remediationActions,
|
|
2142
|
-
problems?.missingData
|
|
2143
|
-
]);
|
|
2144
|
-
useEffect(() => {
|
|
2145
|
-
if (!legalEntityResponse?.documentDetails?.length) return;
|
|
2146
|
-
documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then((res) => {
|
|
2147
|
-
setExistingAttachments(res[0].attachments);
|
|
2148
|
-
setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
|
|
2149
|
-
}).catch(() => {
|
|
2150
|
-
showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
|
|
2151
|
-
});
|
|
2152
|
-
}, []);
|
|
2153
|
-
const forms = useMemo(() => {
|
|
2154
|
-
const requiredForms = getRequiredForms(
|
|
2155
|
-
individualOnfidoForms,
|
|
2156
|
-
derivedProps?.requiredFields,
|
|
2157
|
-
derivedProps?.optionalFields
|
|
2158
|
-
);
|
|
2159
|
-
const filteredForms = !isInstantVerificationEnabled ? requiredForms.filter((f) => f.formId !== "idVerificationMethod") : requiredForms;
|
|
2160
|
-
return addValidityToForms(filteredForms, form.isValid, problems);
|
|
2161
|
-
}, [derivedProps, form.isValid, isInstantVerificationEnabled, problems]);
|
|
2162
|
-
const { mutateAsync: getIdVerificationStartCheck } = useIdVerificationStartCheck();
|
|
2163
|
-
const handleInstantIdVerificationStartCheck = async (onfidoResponse, legalEntityId) => {
|
|
2164
|
-
const providerId = idVerificationProviderId.value;
|
|
2165
|
-
if (!providerId) throw Error("idVerificationProviderId not yet set");
|
|
2166
|
-
const data2 = {
|
|
2167
|
-
providerId,
|
|
2168
|
-
legalEntityId,
|
|
2169
|
-
captureMetadata: onfidoResponse
|
|
2170
|
-
};
|
|
2171
|
-
await getIdVerificationStartCheck(data2);
|
|
2172
|
-
};
|
|
2173
|
-
const roleTypes = isRoleFieldNeeded && parentLegalEntity ? getAllowedDecisionMakerRoles(parentLegalEntity, taskType, matchingScenario) : [];
|
|
2174
|
-
const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
|
|
2175
|
-
const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
|
|
2176
|
-
const submitLegalEntity = async ({
|
|
2177
|
-
dataSubmitted,
|
|
2178
|
-
legalEntity,
|
|
2179
|
-
idDocumentType
|
|
2180
|
-
}) => {
|
|
2181
|
-
let updatedLegalEntity;
|
|
2182
|
-
const existingLeId = legalEntityResponse?.id;
|
|
2183
|
-
if (legalEntity.individual && legalEntityResponse?.individual?.support) {
|
|
2184
|
-
legalEntity.individual.support = customerSupportPresubmitProcess(
|
|
2185
|
-
legalEntityResponse,
|
|
2186
|
-
legalEntity
|
|
2187
|
-
);
|
|
2188
|
-
}
|
|
2189
|
-
if (!existingLeId) {
|
|
2190
|
-
updatedLegalEntity = await createLegalEntity(legalEntity);
|
|
2191
|
-
userEvents.addTaskEvent("Success", {
|
|
2192
|
-
actionType: "submit",
|
|
2193
|
-
countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country,
|
|
2194
|
-
roles: dataSubmitted.basicDetails?.role
|
|
2195
|
-
});
|
|
2196
|
-
} else {
|
|
2197
|
-
updatedLegalEntity = await updateLegalEntity({
|
|
2198
|
-
...drop("type").from(legalEntity),
|
|
2199
|
-
id: existingLeId
|
|
2200
|
-
});
|
|
2201
|
-
userEvents.addTaskEvent("Success", {
|
|
2202
|
-
actionType: "submit",
|
|
2203
|
-
countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country,
|
|
2204
|
-
documentType: idDocumentType
|
|
2205
|
-
});
|
|
2206
|
-
}
|
|
2207
|
-
return updatedLegalEntity;
|
|
2208
|
-
};
|
|
2209
|
-
const submitDocuments = async ({
|
|
2210
|
-
legalEntity,
|
|
2211
|
-
dataSubmitted
|
|
2212
|
-
}) => {
|
|
2213
|
-
const idDocument2 = dataSubmitted.idVerificationMethod?.idDocument;
|
|
2214
|
-
if (idDocument2?.instantIdVerificationData) {
|
|
2215
|
-
if (providerStatus?.statuses?.idDocument?.enabled === false) {
|
|
2216
|
-
throw new Error("Provider unexpectedly disabled instant verification flow");
|
|
2217
|
-
}
|
|
2218
|
-
await handleInstantIdVerificationStartCheck(
|
|
2219
|
-
idDocument2.instantIdVerificationData,
|
|
2220
|
-
legalEntity.id
|
|
2221
|
-
);
|
|
2222
|
-
} else {
|
|
2223
|
-
const formattedDocuments = await mapIndividualDocumentToApiDocument(
|
|
2224
|
-
dataSubmitted,
|
|
2225
|
-
legalEntity.id
|
|
2226
|
-
);
|
|
2227
|
-
if (!formattedDocuments || formattedDocuments?.length === 0) {
|
|
2228
|
-
if (existingAttachments?.length)
|
|
2229
|
-
logger.log(
|
|
2230
|
-
"User has already uploaded documents and is not changing them, nothing needs to be done"
|
|
2231
|
-
);
|
|
2232
|
-
else
|
|
2233
|
-
logger.error(
|
|
2234
|
-
`formattedDocuments is empty, but there are no existing documents. Something has gone wrong`
|
|
2235
|
-
);
|
|
2236
|
-
return;
|
|
2237
|
-
}
|
|
2238
|
-
formattedDocuments[0].attachments = mergeAttachments(
|
|
2239
|
-
existingAttachments ?? [],
|
|
2240
|
-
formattedDocuments[0]?.attachments ?? []
|
|
2241
|
-
).filter((attachment) => attachment.content);
|
|
2242
|
-
const uploadedDocuments = await documentUtils.uploadDocuments(
|
|
2243
|
-
formattedDocuments,
|
|
2244
|
-
legalEntity.id
|
|
2245
|
-
);
|
|
2246
|
-
uploadedDocuments?.forEach((doc) => {
|
|
2247
|
-
userEvents.addTaskEvent("Success", {
|
|
2248
|
-
actionType: "upload",
|
|
2249
|
-
documentType: doc.type,
|
|
2250
|
-
fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? void 0
|
|
2251
|
-
});
|
|
2252
|
-
});
|
|
2253
|
-
}
|
|
2254
|
-
};
|
|
2255
|
-
const hasRolesChanged = (legalEntityId, existingEntityAssociations, newRoles) => {
|
|
2256
|
-
const existingRoles = existingEntityAssociations?.filter((association) => association.legalEntityId === legalEntityId).map(({ type }) => type);
|
|
2257
|
-
return !doArraysMatch(existingRoles, newRoles);
|
|
2258
|
-
};
|
|
2259
|
-
const attachAssociationToParentLegalEntity = async ({
|
|
2260
|
-
legalEntity,
|
|
2261
|
-
parentLE,
|
|
2262
|
-
dataSubmitted
|
|
2263
|
-
}) => {
|
|
2264
|
-
const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? dataSubmitted?.basicDetails?.role : null;
|
|
2265
|
-
const existingEntityAssociations = getOwnEntityAssociations(parentLE);
|
|
2266
|
-
if (newRoles && (hasRolesChanged(legalEntity?.id, existingEntityAssociations, newRoles) || dataFromResponse.basicDetails?.jobTitle !== dataSubmitted?.basicDetails?.jobTitle || hasNomineesChanged(dataFromResponse.basicDetails, dataSubmitted.basicDetails))) {
|
|
2267
|
-
const updatedParentLegalEntity = {
|
|
2268
|
-
entityAssociations: [
|
|
2269
|
-
...newRoles.map((role) => ({
|
|
2270
|
-
type: role,
|
|
2271
|
-
legalEntityId: legalEntity.id,
|
|
2272
|
-
...DECISION_MAKER_TYPES_WITH_JOBTITLE$1.some((type) => type === role) && {
|
|
2273
|
-
jobTitle: dataSubmitted?.basicDetails?.jobTitle
|
|
2274
|
-
}
|
|
2275
|
-
})) || [],
|
|
2276
|
-
...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
|
|
2277
|
-
]
|
|
2278
|
-
};
|
|
2279
|
-
const nomineeDataSource = !isGuidedDecisionMakersFlowDisabled && isGuidedDecisionMakersFlowEnabled ? dataSubmitted?.uboQuestionnaire : dataSubmitted.basicDetails;
|
|
2280
|
-
if (nomineeDataSource && updatedParentLegalEntity.entityAssociations) {
|
|
2281
|
-
updatedParentLegalEntity.entityAssociations = updatedParentLegalEntity.entityAssociations.map(
|
|
2282
|
-
(ea) => attachNomineeToRole(ea, country, nomineeDataSource)
|
|
2283
|
-
);
|
|
2284
|
-
}
|
|
2285
|
-
await updateLegalEntity({ ...updatedParentLegalEntity, id: parentLE.id });
|
|
2286
|
-
}
|
|
2287
|
-
};
|
|
2288
|
-
const onSubmit = async () => {
|
|
2289
|
-
setLoadingStatus("loading");
|
|
2290
|
-
const dataSubmitted = omitObscuredFieldsIfUnchanged(
|
|
2291
|
-
individualOnfidoObscuredFields,
|
|
2292
|
-
data,
|
|
2293
|
-
dataFromResponse
|
|
2294
|
-
);
|
|
2295
|
-
if (!dataSubmitted) {
|
|
2296
|
-
return;
|
|
2297
|
-
}
|
|
2298
|
-
try {
|
|
2299
|
-
const legalEntity = mapIndividualOnfidoSchemaToLegalEntity(
|
|
2300
|
-
dataSubmitted,
|
|
2301
|
-
isExperimentEnabled,
|
|
2302
|
-
matchingScenario
|
|
2303
|
-
);
|
|
2304
|
-
const idDocumentType = idDocumentTypeOptions.find(
|
|
2305
|
-
({ id }) => dataSubmitted?.idVerificationMethod?.idDocument?.idDocumentType === id
|
|
2306
|
-
)?.id;
|
|
2307
|
-
legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
|
|
2308
|
-
taskType,
|
|
2309
|
-
legalEntityResponse,
|
|
2310
|
-
accountHolder || void 0
|
|
2311
|
-
);
|
|
2312
|
-
const submittedLegalEntity = await submitLegalEntity({
|
|
2313
|
-
dataSubmitted,
|
|
2314
|
-
legalEntity,
|
|
2315
|
-
idDocumentType
|
|
2316
|
-
});
|
|
2317
|
-
setAccountHolder(accountHolder);
|
|
2318
|
-
if (dataSubmitted.idVerificationMethod && dataSubmitted.idVerificationMethod?.idVerificationMethod !== "existingDocument" || hasVerificationErrors) {
|
|
2319
|
-
const isBafinSignatory = dataSubmitted?.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN);
|
|
2320
|
-
if (!isBafinSignatory) {
|
|
2321
|
-
await submitDocuments({ legalEntity: submittedLegalEntity, dataSubmitted });
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
if (parentLegalEntity) {
|
|
2325
|
-
await attachAssociationToParentLegalEntity({
|
|
2326
|
-
legalEntity: submittedLegalEntity,
|
|
2327
|
-
parentLE: parentLegalEntity,
|
|
2328
|
-
dataSubmitted
|
|
2329
|
-
});
|
|
2330
|
-
queryClient.invalidateQueries({
|
|
2331
|
-
queryKey: ["legalEntity", parentLegalEntity.id],
|
|
2332
|
-
refetchType: "all"
|
|
2333
|
-
});
|
|
2334
|
-
}
|
|
2335
|
-
idNowModalChildEntityId.value = submittedLegalEntity;
|
|
2336
|
-
setLoadingStatus("success");
|
|
2337
|
-
clearToasts();
|
|
2338
|
-
externalOnSubmit?.(dataSubmitted, matchingScenario);
|
|
2339
|
-
} catch (e) {
|
|
2340
|
-
const eventsAdditionalData = {};
|
|
2341
|
-
logger.error("Failed to update individual", e);
|
|
2342
|
-
if (isValidationError(e)) {
|
|
2343
|
-
const getErrors = processValidationErrors(e, TaskTypes.INDIVIDUAL);
|
|
2344
|
-
if (getErrors && !Object.keys(getErrors).length) {
|
|
2345
|
-
showToast({ label: i18n.get("failedToUpdateDetails"), variant: "error" });
|
|
2346
|
-
eventsAdditionalData.unmappedErrorNames = e.invalidFields?.map((field) => field.name).filter(Boolean);
|
|
2347
|
-
} else {
|
|
2348
|
-
setValidationErrors(getErrors);
|
|
2349
|
-
}
|
|
2350
|
-
} else if (isMaintenanceModeError(e)) {
|
|
2351
|
-
showToast({
|
|
2352
|
-
label: i18n.get("maintenanceModeMessage"),
|
|
2353
|
-
variant: "error",
|
|
2354
|
-
duration: "indefinite"
|
|
2355
|
-
});
|
|
2356
|
-
} else {
|
|
2357
|
-
showToast({ label: i18n.get("failedToUpdateDetails"), variant: "error" });
|
|
2358
|
-
}
|
|
2359
|
-
setLoadingStatus("success");
|
|
2360
|
-
userEvents.addTaskEvent("Encountered error", {
|
|
2361
|
-
actionType: "submit",
|
|
2362
|
-
additionalData: eventsAdditionalData,
|
|
2363
|
-
returnType: e?.errorCode,
|
|
2364
|
-
returnValue: e?.title || "backend"
|
|
2365
|
-
});
|
|
2366
|
-
}
|
|
2367
|
-
};
|
|
2368
|
-
const datasetUtils = datasetUtilities(i18n.locale);
|
|
2369
|
-
const formatIdDocument = (idDocument2) => {
|
|
2370
|
-
if (!idDocument2) return void 0;
|
|
2371
|
-
const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
|
|
2372
|
-
(document2) => idDocument2.instantIdVerificationData?.document_front.type === document2.id
|
|
2373
|
-
) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
|
|
2374
|
-
if (!documentType) return void 0;
|
|
2375
|
-
const frontPage = idDocument2.idFrontPage?.[0];
|
|
2376
|
-
const backPage = idDocument2.idBackPage?.[0];
|
|
2377
|
-
if (!frontPage) return void 0;
|
|
2378
|
-
return {
|
|
2379
|
-
documentType: i18n.get(documentType.name),
|
|
2380
|
-
...backPage && documentType.hasBackPage ? {
|
|
2381
|
-
frontPage: frontPage.name,
|
|
2382
|
-
backPage: backPage.name
|
|
2383
|
-
} : {
|
|
2384
|
-
fileName: frontPage.name
|
|
2385
|
-
}
|
|
2386
|
-
};
|
|
2387
|
-
};
|
|
2388
|
-
const formatFileSummaryData = ({
|
|
2389
|
-
idVerificationMethod,
|
|
2390
|
-
manualIdUpload,
|
|
2391
|
-
proofOfNationalId,
|
|
2392
|
-
proofOfResidency,
|
|
2393
|
-
proofOfRelationship
|
|
2394
|
-
}) => {
|
|
2395
|
-
const proofOfNationalIdFile = proofOfNationalId?.proofOfNationalId?.[0];
|
|
2396
|
-
const proofOfResidencyFile = proofOfResidency?.proofOfResidency?.[0];
|
|
2397
|
-
const proofOfRelationshipFile = proofOfRelationship?.proofOfRelationship?.[0];
|
|
2398
|
-
const idDocument2 = idVerificationMethod?.idVerificationMethod === "manualVerification" ? manualIdUpload : idVerificationMethod?.idDocument;
|
|
2399
|
-
return {
|
|
2400
|
-
...(idDocument2?.idDocumentType || idDocument2?.instantIdVerificationData) && {
|
|
2401
|
-
idDocument: formatIdDocument(idDocument2)
|
|
2402
|
-
},
|
|
2403
|
-
...proofOfNationalIdFile && {
|
|
2404
|
-
proofOfNationalId: {
|
|
2405
|
-
fileName: proofOfNationalIdFile.name
|
|
2406
|
-
}
|
|
2407
|
-
},
|
|
2408
|
-
...proofOfResidencyFile && {
|
|
2409
|
-
proofOfResidency: {
|
|
2410
|
-
fileName: proofOfResidencyFile.name,
|
|
2411
|
-
description: proofOfResidency?.description
|
|
2412
|
-
}
|
|
2413
|
-
},
|
|
2414
|
-
...proofOfRelationshipFile && {
|
|
2415
|
-
proofOfRelationship: {
|
|
2416
|
-
fileName: proofOfRelationshipFile.name,
|
|
2417
|
-
description: proofOfRelationship?.description
|
|
2418
|
-
}
|
|
2419
|
-
}
|
|
2420
|
-
};
|
|
2421
|
-
};
|
|
2422
|
-
const isManualVerificationOrExistingDoc = (idVerificationMethod) => idVerificationMethod === "manualVerification" || idVerificationMethod === "existingDocument";
|
|
2423
|
-
const formatDataForSummary = () => {
|
|
2424
|
-
let summaryData = cloneObject(data);
|
|
2425
|
-
if (summaryData?.basicDetails?.phoneNumber) {
|
|
2426
|
-
summaryData.basicDetails.phoneNumber = summaryData.basicDetails.phoneNumber.number;
|
|
2427
|
-
}
|
|
2428
|
-
if (summaryData.additionalPersonalDetails?.nationality) {
|
|
2429
|
-
summaryData.additionalPersonalDetails.nationality = datasetUtils.getCountryName(
|
|
2430
|
-
summaryData.additionalPersonalDetails.nationality
|
|
2431
|
-
);
|
|
2432
|
-
}
|
|
2433
|
-
if (data.additionalPersonalDetails) {
|
|
2434
|
-
if (isCompatibleJapanVersion(country, versionData?.version)) {
|
|
2435
|
-
summaryData.additionalPersonalDetails = {
|
|
2436
|
-
...drop(...JP_ADDRESS_REQUIRED_FIELDS).from(summaryData.additionalPersonalDetails),
|
|
2437
|
-
...mapJpAddressSummary(data.additionalPersonalDetails, datasetUtils)
|
|
2438
|
-
};
|
|
2439
|
-
} else {
|
|
2440
|
-
summaryData.additionalPersonalDetails = {
|
|
2441
|
-
...summaryData.additionalPersonalDetails,
|
|
2442
|
-
...mapAddressLabels(data.additionalPersonalDetails, datasetUtils)
|
|
2443
|
-
};
|
|
2444
|
-
}
|
|
2445
|
-
}
|
|
2446
|
-
if (summaryData.basicDetails?.accountHolder) {
|
|
2447
|
-
summaryData.basicDetails.accountHolder = i18n.get(summaryData.basicDetails.accountHolder);
|
|
2448
|
-
}
|
|
2449
|
-
if (summaryData.additionalPersonalDetails?.birthDate) {
|
|
2450
|
-
summaryData.additionalPersonalDetails.birthDate = localizeDateString(
|
|
2451
|
-
summaryData.additionalPersonalDetails.birthDate,
|
|
2452
|
-
i18n.locale
|
|
2453
|
-
);
|
|
2454
|
-
}
|
|
2455
|
-
if (isManualVerificationOrExistingDoc(summaryData.idVerificationMethod?.idVerificationMethod) || summaryData.proofOfResidency) {
|
|
2456
|
-
const fileSummaryData = formatFileSummaryData(data);
|
|
2457
|
-
summaryData = { ...summaryData, ...fileSummaryData };
|
|
2458
|
-
summaryData.manualIdUpload = { ...summaryData.idDocument };
|
|
2459
|
-
summaryData.idVerificationMethod.idDocument = { ...summaryData.idDocument };
|
|
2460
|
-
}
|
|
2461
|
-
if (summaryData.additionalPersonalDetails?.taxInformation) {
|
|
2462
|
-
const taxInformation = summaryData.additionalPersonalDetails.taxInformation.find(
|
|
2463
|
-
(taxId) => taxId.country === data.additionalPersonalDetails?.nationality
|
|
2464
|
-
);
|
|
2465
|
-
if (taxInformation) {
|
|
2466
|
-
delete summaryData.additionalPersonalDetails.taxInformation;
|
|
2467
|
-
summaryData.additionalPersonalDetails[taxInformation.type] = taxInformation.number;
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
if (summaryData?.signatoryQuestionnaire) {
|
|
2471
|
-
summaryData.signatoryQuestionnaire = data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES ? [i18n.get("signatorySummaryLabel")] : [];
|
|
2472
|
-
}
|
|
2473
|
-
if (summaryData?.uboQuestionnaire) {
|
|
2474
|
-
const roleFieldToLabelMap = {
|
|
2475
|
-
isOwner: "ownerSummaryLabel",
|
|
2476
|
-
isControllingPerson: "controllingPersonSummaryLabel",
|
|
2477
|
-
isDirector: "directorSummaryLabel"
|
|
2478
|
-
};
|
|
2479
|
-
summaryData.uboQuestionnaire = Object.keys(roleFieldToLabelMap).flatMap(
|
|
2480
|
-
(field) => data?.uboQuestionnaire?.[field] === GuidanceQuestionValues.YES ? [t(($) => $[roleFieldToLabelMap[field]])] : []
|
|
2481
|
-
);
|
|
2482
|
-
}
|
|
2483
|
-
return summaryData;
|
|
2484
|
-
};
|
|
2485
|
-
const omittedKeysForSummary = [
|
|
2486
|
-
...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
|
|
2487
|
-
...data?.additionalPersonalDetails?.idNumberExempt ? ["idNumber"] : [],
|
|
2488
|
-
...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
|
|
2489
|
-
];
|
|
2490
|
-
const isUploadEmpty = !data?.manualIdUpload || Object.keys(data?.manualIdUpload).length === 0;
|
|
2491
|
-
const omittedFormsForSummary = [
|
|
2492
|
-
// 1. Omit idDocument if instant OR (manual/existing AND upload is empty)
|
|
2493
|
-
...data?.idVerificationMethod?.idVerificationMethod === "instantVerification" || isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) && isUploadEmpty ? ["idDocument"] : [],
|
|
2494
|
-
// 2. Omit idVerificationMethod if manual or existing
|
|
2495
|
-
...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod"] : []
|
|
2496
|
-
];
|
|
2497
|
-
const customLabelsForSummary = {
|
|
2498
|
-
idVerificationMethod: data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "idVerificationMethod" : "idDocument"
|
|
2499
|
-
};
|
|
2500
|
-
const {
|
|
2501
|
-
handleNextClick,
|
|
2502
|
-
handleBackClick,
|
|
2503
|
-
activeForm,
|
|
2504
|
-
shouldValidate,
|
|
2505
|
-
gotoFormByFormIndex,
|
|
2506
|
-
steps
|
|
2507
|
-
} = useFormComposer({
|
|
2508
|
-
problems,
|
|
2509
|
-
externalBackClick,
|
|
2510
|
-
forms,
|
|
2511
|
-
onSubmit,
|
|
2512
|
-
triggerValidation: form.triggerValidation
|
|
2513
|
-
// TODO: figure out type of nested keys
|
|
2514
|
-
});
|
|
2515
|
-
const isVerificationMethod = activeForm?.formId === "idVerificationMethod";
|
|
2516
|
-
const disableNextButton = isVerificationMethod && !activeForm?.isValid || isNextStepDisabled.value;
|
|
2517
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2518
|
-
/* @__PURE__ */ jsx(Show, { when: shouldShowIdNowModal, children: /* @__PURE__ */ jsx(IdNowVerificationModal, { handleFinish: handleHomeClick }) }),
|
|
2519
|
-
/* @__PURE__ */ jsx(FormContextProvider, { form, children: /* @__PURE__ */ jsx(
|
|
2520
|
-
FormFlow,
|
|
2521
|
-
{
|
|
2522
|
-
summary: {
|
|
2523
|
-
data: formatDataForSummary(),
|
|
2524
|
-
omitted: {
|
|
2525
|
-
keys: omittedKeysForSummary,
|
|
2526
|
-
forms: omittedFormsForSummary
|
|
2527
|
-
},
|
|
2528
|
-
problems,
|
|
2529
|
-
labels: customLabelsForSummary
|
|
2530
|
-
},
|
|
2531
|
-
asModal,
|
|
2532
|
-
currentStep: steps.current,
|
|
2533
|
-
disableNextButton,
|
|
2534
|
-
forms,
|
|
2535
|
-
activeForm,
|
|
2536
|
-
gotoFormByFormIndex,
|
|
2537
|
-
handleBackClick,
|
|
2538
|
-
handleCancelClick: handleHomeClick,
|
|
2539
|
-
handleNextClick: nextHandler || handleNextClick,
|
|
2540
|
-
loadingStatus,
|
|
2541
|
-
totalSteps: steps.total,
|
|
2542
|
-
children: /* @__PURE__ */ jsx(
|
|
2543
|
-
IndividualOnfido,
|
|
2544
|
-
{
|
|
2545
|
-
...derivedProps,
|
|
2546
|
-
requiredFields,
|
|
2547
|
-
data,
|
|
2548
|
-
defaultCountry: country,
|
|
2549
|
-
activeForm,
|
|
2550
|
-
forms,
|
|
2551
|
-
scenarios,
|
|
2552
|
-
taskType,
|
|
2553
|
-
problems,
|
|
2554
|
-
onNext: handleNextClick,
|
|
2555
|
-
onBack: handleBackClick,
|
|
2556
|
-
legalEntityId: legalEntityResponse?.id,
|
|
2557
|
-
allowedRoles: roleTypes,
|
|
2558
|
-
shouldValidate,
|
|
2559
|
-
accountHolder,
|
|
2560
|
-
parentLegalEntity,
|
|
2561
|
-
trustedFields,
|
|
2562
|
-
trustedFieldsProvider,
|
|
2563
|
-
trustedRoles,
|
|
2564
|
-
setNextHandler,
|
|
2565
|
-
handleHomeClick
|
|
2566
|
-
}
|
|
2567
|
-
)
|
|
2568
|
-
}
|
|
2569
|
-
) })
|
|
2570
|
-
] });
|
|
2571
|
-
}
|
|
2572
|
-
export {
|
|
2573
|
-
IndividualOnfidoDropin as I,
|
|
2574
|
-
IndividualDropin as a
|
|
2575
|
-
};
|