@adyen/kyc-components 4.0.0-beta.1 → 4.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcceptTermsOfServiceComponent-BQ4Yct7L.js → AcceptTermsOfServiceComponent-i222mdxX.js} +53 -49
- package/dist/{AccountSetupRejected-UVhxMcAe.js → AccountSetupRejected-DHph9lFl.js} +6 -6
- package/dist/{Avatar-NEiNEcRx.js → Avatar-vCjWXfC7.js} +2 -2
- package/dist/{BusinessDetailsDropin-l0xfPekL.js → BusinessDetailsDropin-DQcfiSR8.js} +333 -287
- package/dist/{BusinessFinancingComponent-Bs-poF2d.js → BusinessFinancingComponent-DC3jzBrq.js} +3 -3
- package/dist/{BusinessFinancingDropin-DoRzdS4n.js → BusinessFinancingDropin-D2lMEbNh.js} +161 -264
- package/dist/{BusinessFinancingPage-DSlmJmOK.js → BusinessFinancingPage-BPD2cSDR.js} +3 -3
- package/dist/{BusinessTypeSelectionPage-Bmi_8K2g.js → BusinessTypeSelectionPage-Cdp8joPJ.js} +82 -87
- package/dist/{CZ-BhoS6sd6.js → CZ-BiPeoA9G.js} +11 -1
- package/dist/{ContractViewer-R4-gfVmp.js → ContractViewer-B0bZ14Ts.js} +305 -296
- package/dist/{CreateIndividualComponent-D3aXuYRk.js → CreateIndividualComponent-D9wnexv4.js} +7 -7
- package/dist/{CreateTransferInstrumentComponent-C-ncZ-A8.js → CreateTransferInstrumentComponent-COzPdQjC.js} +4 -4
- package/dist/{CustomerSupport-CMFRgQNa.js → CustomerSupport-NGBoBg3N.js} +27 -32
- package/dist/{DebugModal-BEmhG3UP.js → DebugModal-I2U6TjGT.js} +43 -35
- package/dist/{DecisionMakerDetailsPage-DI2Ubmef.js → DecisionMakerDetailsPage-BN-H1sJF.js} +3 -3
- package/dist/{DecisionMakers-BKhtcs_K.js → DecisionMakers-CZ5-IRtU.js} +128 -23
- package/dist/{EmbeddedStatus-BsZsXbKc.js → EmbeddedStatus-Blr0seRl.js} +6 -6
- package/dist/FormEndState-JB6QFSet.js +59 -0
- package/dist/{FormFlow-Bt-mu4Wm.js → FormFlow-DjvdNEiV.js} +18 -19
- package/dist/{HU-v3vOxRm8.js → HU-D8vJYkDH.js} +10 -1
- package/dist/{IndividualOnfidoDropin-DGMCOm9M.js → IndividualOnfidoDropin-DHhyO2ai.js} +732 -739
- package/dist/{Introduction-DJ6qIUPC.js → Introduction-erRXgreE.js} +32 -34
- package/dist/LandingLayout-B45lEjOv.js +84 -0
- package/dist/{LegalRepresentativeDetailsPage-CyHwQR_W.js → LegalRepresentativeDetailsPage-rS5K4657.js} +3 -3
- package/dist/{ManageIndividualComponent-BIMCvcr2.js → ManageIndividualComponent-BEzE5lkX.js} +8 -12
- package/dist/{ManagePCIComponent-Blj60xLa.js → ManagePCIComponent-BgdGfAuT.js} +5 -5
- package/dist/{ManageTermsOfServiceComponent-CsM23jq3.js → ManageTermsOfServiceComponent-BWkwy6YC.js} +7 -8
- package/dist/{ManageTransferInstrumentComponent-Vut9_bRn.js → ManageTransferInstrumentComponent-B8kRNftW.js} +21 -29
- package/dist/{OnboardingDropinComponent-BW6er2HU.js → OnboardingDropinComponent-DBW5N3Dr.js} +243 -281
- package/dist/{ProviderButton-DAsW5EVa.js → ProviderButton-B58n0cRC.js} +12 -13
- package/dist/{Review-DWDbL9-9.js → Review-O6Al47Cu.js} +11 -11
- package/dist/{RootBusinessDetailsPage-BTYIldSf.js → RootBusinessDetailsPage-q_6wAcer.js} +3 -3
- package/dist/{RootIndividualDetailsPage-DCxJ3ycQ.js → RootIndividualDetailsPage-CiXgSJsV.js} +3 -3
- package/dist/{SignPCIComponent-kHaxhkWa.js → SignPCIComponent-cqRNhGdl.js} +17 -19
- package/dist/{SingpassSelection-Dmlbiq4Z.js → SingpassSelection-BWEJ3Yi-.js} +6 -9
- package/dist/{SoleProprietorshipPage-Bdhs90-q.js → SoleProprietorshipPage-CRcJSpn9.js} +3 -3
- package/dist/{SourceOfFundsPage-Bj22DAFv.js → SourceOfFundsPage-BxLGXTHb.js} +500 -481
- package/dist/{StoreProvider-BmzY19Td.js → StoreProvider-ClKLaHzy.js} +8753 -10118
- package/dist/{TaskItemStatus-CB6FEOnk.js → TaskItemStatus-DrTIwCTx.js} +14 -14
- package/dist/TaskStatusIndicator-CTtKjo0m.js +69 -0
- package/dist/{TaxReportingDropin-jofokkei.js → TaxReportingDropin-DFZ2ehfk.js} +82 -101
- package/dist/{TileGroup-i5Jc08ns.js → TileGroup-BtE472I1.js} +6 -8
- package/dist/{TrustDetailsPage-B6HmvYUf.js → TrustDetailsPage-CGiiTbfR.js} +71 -73
- package/dist/{TrustMemberCompanyPage-D3VJOq6a.js → TrustMemberCompanyPage-oLNhg0hg.js} +4 -4
- package/dist/{TrustMemberIndividualPage-1aeOYsnG.js → TrustMemberIndividualPage-Bgsis586.js} +3 -3
- package/dist/{UnincorporatedPartnershipIndividualPage-Bt7e6ncF.js → UnincorporatedPartnershipIndividualPage-DPE3grqL.js} +3 -3
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-Ck5C_SEU.js → UnincorporatedPartnershipMemberCompanyPage-HUnc9g0g.js} +3 -3
- package/dist/{VerificationErrorAlert-DhtKOmjt.js → VerificationErrorAlert-BBdJmGJu.js} +10 -8
- package/dist/{ViewVerificationStatusComponent-DtKLcCGI.js → ViewVerificationStatusComponent-DDtXG_pM.js} +12 -13
- package/dist/adyen-business-financing.js +8 -12
- package/dist/adyen-individual.js +6 -4
- package/dist/adyen-kyc-components.js +135 -118
- package/dist/adyen-manage-individual.js +2 -2
- package/dist/adyen-manage-pci.js +2 -2
- package/dist/adyen-manage-terms-of-service.js +2 -2
- package/dist/adyen-manage-transfer-instruments.js +2 -2
- package/dist/adyen-onboarding.js +14 -6
- package/dist/adyen-sign-pci.js +8 -15
- package/dist/adyen-terms-of-service.js +18 -6
- package/dist/adyen-transfer-instrument.js +10 -6
- package/dist/{adyen-transfer-instrument.vue_vue_type_script_lang-BE-ro1iH.js → adyen-transfer-instrument.vue_vue_type_script_lang-DQBzahGy.js} +5 -1
- package/dist/adyen-verification-status.js +2 -2
- package/dist/bg-BG-BY3Wa361.js +54 -0
- package/dist/bg-BG-BvSUDgGF.js +13 -0
- package/dist/bg-BG-HpLj_LOM.js +16 -0
- package/dist/cs-CZ-BEFeaKsV.js +54 -0
- package/dist/cs-CZ-CQ_M3lEp.js +16 -0
- package/dist/cs-CZ-y4mvq4Lv.js +13 -0
- package/dist/{css-CQUoQdd2.js → css-BJGWcW8A.js} +2 -2
- package/dist/da-DK-D6UK8XT9.js +54 -0
- package/dist/da-DK-k4JW3iVF.js +16 -0
- package/dist/da-DK-qgQOVjDp.js +13 -0
- package/dist/de-DE-B3nctkG8.js +13 -0
- package/dist/de-DE-C7mjtS5w.js +16 -0
- package/dist/de-DE-DUl6gRKv.js +54 -0
- package/dist/de-DE-pSdsxBpQ.js +13 -0
- package/dist/decision-makers-group-CgddXgrx.js +1944 -0
- package/dist/el-GR-B5j7VZ3E.js +54 -0
- package/dist/el-GR-Bvjk5Sw8.js +13 -0
- package/dist/el-GR-CEQrkYHW.js +16 -0
- package/dist/el-GR-CdgLZhuO.js +13 -0
- package/dist/en-US-Bq2Twy6x.js +54 -0
- package/dist/en-US-DDagIr01.js +16 -0
- package/dist/en-US-DSoLr6rp.js +13 -0
- package/dist/es-ES-BRfK6tX7.js +13 -0
- package/dist/es-ES-Cavm0szq.js +54 -0
- package/dist/es-ES-DB1c74Kv.js +16 -0
- package/dist/es-ES-Dy1uR2H_.js +13 -0
- package/dist/et-EE-DUWZ2Vqm.js +54 -0
- package/dist/et-EE-d9V24rcf.js +13 -0
- package/dist/et-EE-xIegUSuv.js +16 -0
- package/dist/fi-FI-B0fnAFV2.js +13 -0
- package/dist/fi-FI-DVa-ccaW.js +54 -0
- package/dist/fi-FI-NCxneAqU.js +16 -0
- package/dist/fr-FR-BoKzVp2q.js +13 -0
- package/dist/fr-FR-CY9emHgF.js +54 -0
- package/dist/fr-FR-Dk6Lw2On.js +13 -0
- package/dist/fr-FR-daiUnUwo.js +16 -0
- package/dist/{getFieldsWithExistingData-BW8_TEQl.js → getFieldsWithExistingData-BY--eXBQ.js} +3 -4
- package/dist/{hasDataChanged-Mu0HyZ3E.js → hasDataChanged-CwfuS4et.js} +4 -4
- package/dist/hr-HR-BAUywqDj.js +16 -0
- package/dist/hr-HR-CF0AHQzi.js +13 -0
- package/dist/hr-HR-CnP5sqih.js +54 -0
- package/dist/hu-HU-3GQojIHR.js +16 -0
- package/dist/hu-HU-BTlpbCpc.js +54 -0
- package/dist/hu-HU-CSPhOvLC.js +13 -0
- package/dist/it-IT-BH-eqIKH.js +13 -0
- package/dist/it-IT-D7G4BaP7.js +13 -0
- package/dist/it-IT-GgHc0cHR.js +54 -0
- package/dist/it-IT-pDWPFHEh.js +16 -0
- package/dist/ja-JP-B3yqM_FM.js +13 -0
- package/dist/ja-JP-BhS-_dIx.js +54 -0
- package/dist/ja-JP-DTW_hY1L.js +13 -0
- package/dist/ja-JP-scPXJ93L.js +16 -0
- package/dist/{json-DWikzB4g.js → json-Dk6RRAV8.js} +2 -2
- package/dist/{localizeDateString-QtCjf8Fg.js → localizeDateString-CKCBXzSn.js} +6 -6
- package/dist/lt-LT-BcGNy8Ti.js +16 -0
- package/dist/lt-LT-DTQGR9M0.js +54 -0
- package/dist/lt-LT-Lzl_Cbw-.js +13 -0
- package/dist/lv-LV-BQ4F1GrV.js +54 -0
- package/dist/lv-LV-CBD07r1Y.js +16 -0
- package/dist/lv-LV-y00wN1pj.js +13 -0
- package/dist/{mapFinancialReportsToFinancialInformation-C-2jp0wg.js → mapFinancialReportsToFinancialInformation-D_6u_bSS.js} +19 -12
- package/dist/minus-circle-filled-BGKeHaxJ.js +17 -0
- package/dist/nl-NL-BxJUDHMK.js +16 -0
- package/dist/nl-NL-CFzm75Jw.js +13 -0
- package/dist/nl-NL-CUcML482.js +54 -0
- package/dist/nl-NL-DmnFXAQC.js +13 -0
- package/dist/no-NO-BBCvsecq.js +54 -0
- package/dist/no-NO-DbvFfP96.js +13 -0
- package/dist/no-NO-Drup6Jyy.js +16 -0
- package/dist/pl-PL--mmxopYA.js +13 -0
- package/dist/pl-PL-BXv8Mmzb.js +16 -0
- package/dist/pl-PL-kGaeUP-w.js +54 -0
- package/dist/{plaintext-B39yQnOr.js → plaintext-9WNCwUtz.js} +2 -2
- package/dist/plus-circle-filled-Cnf1oJTm.js +17 -0
- package/dist/preact/adyen-transfer-instrument.js +1 -1
- package/dist/pt-PT-BVzXBFp7.js +13 -0
- package/dist/pt-PT-D8nU-UM2.js +16 -0
- package/dist/pt-PT-DpDxAynk.js +13 -0
- package/dist/pt-PT-JVqqgvPs.js +54 -0
- package/dist/{resolveEnvironment-Dx0BPNMa.js → resolveEnvironment-DQH1ab0S.js} +3 -3
- package/dist/ro-RO-C83h2zHZ.js +54 -0
- package/dist/ro-RO-CG33OwqS.js +16 -0
- package/dist/ro-RO-Cdmevo9A.js +13 -0
- package/dist/ru-RU-FZb2upqh.js +13 -0
- package/dist/{rules-CUANHpja.js → rules-CCnLDGvk.js} +43 -70
- package/dist/sk-SK-CgLJIuJw.js +54 -0
- package/dist/sk-SK-DV_xkO69.js +16 -0
- package/dist/sk-SK-nfeuTcY5.js +13 -0
- package/dist/sl-SI-B5yeoadY.js +16 -0
- package/dist/sl-SI-BzeVaC1Z.js +54 -0
- package/dist/sl-SI-DUTZDqkP.js +13 -0
- package/dist/style.css +417 -605
- package/dist/styles-CLV89_hH.js +417 -605
- package/dist/sv-SE-BTx2XKAp.js +13 -0
- package/dist/sv-SE-CVmo11gI.js +54 -0
- package/dist/sv-SE-CfxyR53r.js +16 -0
- package/dist/sv-SE-rckxD-43.js +13 -0
- package/dist/types/api/companySelection/useCompanySelection.d.ts +18 -1
- package/dist/types/api/configurations/useScenarios.d.ts +6 -6
- package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +1 -0
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +0 -306
- package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +2 -1
- package/dist/types/components/Business/forms/BasicInformation/types.d.ts +2 -1
- package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +1 -1
- package/dist/types/components/Business/forms/rules.d.ts +1 -0
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsFormConfig.d.ts +1 -2
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +0 -3
- package/dist/types/components/EFP/fields/LegalFormField/types.d.ts +4 -2
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +5 -307
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +2 -2
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +1 -2
- package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +0 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.d.ts +1 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/GuidanceQuestion/GuidanceQuestion.d.ts +7 -3
- package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.d.ts +0 -1
- package/dist/types/components/Individual/mapping/adjustOnfidoIdentificationData.d.ts +3 -0
- package/dist/types/components/Individual/mapping/getOnfidoIdentityTypeToApiIdentityTypeMap.d.ts +3 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersGettingStarted.d.ts +5 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersModalContent.d.ts +1 -0
- package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoStore.d.ts +6 -0
- package/dist/types/components/Shared/FormNavigation/FormNavigationItem.d.ts +1 -2
- package/dist/types/components/Shared/Introduction/copy.d.ts +2 -2
- package/dist/types/components/Shared/Summary/Summary.d.ts +0 -1
- package/dist/types/components/Shared/devex/DebugListener/DebugModal.d.ts +0 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +5 -7
- package/dist/types/components/Shared/fields/CountryField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/CountryOfGoverningLawField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/Currency/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/DBANameField/types.d.ts +1 -3
- package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/EInvoicingCodeField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/FinancialReportingDate/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultRegistrationNumberType.d.ts +16 -0
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultVatNumberType.d.ts +13 -0
- package/dist/types/components/Shared/fields/LegalCompanyNameField/LegalCompanyNameField.d.ts +1 -2
- package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +12 -0
- package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/types.d.ts +5 -0
- package/dist/types/components/Shared/fields/NumberOfEmployees/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -2
- package/dist/types/components/Shared/fields/PhoneField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StateField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockExchangeMICField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockISINField/types.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 -2
- package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +5 -3
- package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/VatNumberField/VatNumberField.d.ts +1 -1
- package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +2 -4
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Shared/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +1 -1
- package/dist/types/components/Shared/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
- package/dist/types/components/Shared/forms/FinancialInformation/types.d.ts +1 -1
- package/dist/types/components/Shared/tasks/TaskList/TaskItemStatus.d.ts +1 -2
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRadioGroup.d.ts +2 -3
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRoleAndType.d.ts +1 -2
- package/dist/types/components/ui/atoms/Accordion/Accordion.d.ts +1 -2
- package/dist/types/components/ui/atoms/Button/Button.d.ts +2 -3
- package/dist/types/components/ui/atoms/Button/Button.types.d.ts +3 -3
- package/dist/types/components/ui/atoms/Field/Field.d.ts +3 -6
- package/dist/types/components/ui/atoms/Field/Field.types.d.ts +9 -12
- package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +4 -6
- package/dist/types/components/ui/atoms/InputBase/InputBase.d.ts +4 -4
- package/dist/types/components/ui/atoms/List/List.d.ts +12 -0
- package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
- package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +3 -3
- package/dist/types/components/ui/atoms/Remove/Remove.d.ts +1 -2
- package/dist/types/components/ui/atoms/Select/Select.d.ts +1 -2
- package/dist/types/components/ui/atoms/Select/Select.types.d.ts +1 -0
- package/dist/types/components/ui/atoms/SelectButton/SelectButton.d.ts +1 -2
- package/dist/types/components/ui/atoms/SelectButton/SelectButton.types.d.ts +3 -4
- package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -2
- package/dist/types/components/ui/atoms/SelectList/SelectList.types.d.ts +2 -2
- package/dist/types/components/ui/atoms/SelectListItem/SelectListItem.types.d.ts +3 -3
- package/dist/types/components/ui/atoms/Svg/svgs.d.ts +6 -0
- package/dist/types/components/ui/atoms/TextArea/TextArea.d.ts +1 -2
- package/dist/types/components/ui/atoms/Tile/Tile.d.ts +1 -2
- package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +10 -0
- package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +8 -0
- package/dist/types/components/ui/molecules/Card/Card.d.ts +1 -2
- package/dist/types/components/ui/molecules/Card/types.d.ts +3 -3
- package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +2 -2
- package/dist/types/components/ui/molecules/Dropzone/Dropzone.d.ts +1 -2
- package/dist/types/components/ui/molecules/Dropzone/FilePicker.d.ts +2 -4
- package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +2 -2
- package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +2 -2
- package/dist/types/components/ui/molecules/FormEndState/FormEndState.d.ts +0 -1
- package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +1 -2
- package/dist/types/components/ui/molecules/InputDate/InputDate.d.ts +3 -3
- package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +2 -2
- package/dist/types/constants/keys.d.ts +2 -0
- package/dist/types/context/ExperimentContext/types.d.ts +8 -0
- package/dist/types/core/EmbedShell/EmbedShell.d.ts +1 -0
- package/dist/types/core/UIElement/UIElement.d.ts +1 -0
- package/dist/types/core/models/api/financialReport.d.ts +2 -2
- package/dist/types/core/models/api/get-scenarios.d.ts +1 -1
- package/dist/types/core/models/api/legal-arrangement.d.ts +10 -2
- package/dist/types/core/models/api/organization.d.ts +8 -0
- package/dist/types/core/user-events.d.ts +1 -1
- package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +1 -1
- package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +6 -1
- package/dist/types/embeds/individual/adyen-individual.types.d.ts +6 -1
- package/dist/types/embeds/onboarding/AdyenOnboarding.d.ts +1 -0
- package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +4 -1
- package/dist/types/embeds/sign-pci/AdyenSignPci.d.ts +0 -1
- package/dist/types/embeds/sign-pci/adyen-sign-pci.types.d.ts +5 -3
- package/dist/types/embeds/terms-of-service/adyen-terms-of-service.types.d.ts +7 -1
- package/dist/types/embeds/transfer-instrument/AdyenTransferInstrument.d.ts +2 -1
- package/dist/types/embeds/transfer-instrument/adyen-transfer-instrument.types.d.ts +7 -2
- package/dist/types/hooks/useForm/types.d.ts +0 -2
- package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +28 -0
- package/dist/types/hooks/useMultiForm/types.d.ts +36 -34
- package/dist/types/hooks/useMultiForm/useMultiForm.d.ts +1 -1
- package/dist/types/language/Language.d.ts +1 -7
- package/dist/types/language/i18n.d.ts +2 -0
- package/dist/types/language/types.d.ts +3 -0
- package/dist/types/language/utils.d.ts +11 -2
- package/dist/types/types/datasets/country-code.d.ts +249 -249
- package/dist/types/utils/entityAssociationUtil.d.ts +1 -2
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/eventHandlers/handleKeys.d.ts +2 -2
- package/dist/types/utils/getDisplayErrorMessage.d.ts +2 -2
- package/dist/types/utils/getName.d.ts +2 -2
- package/dist/types/utils/makeSelectItemForRole.d.ts +2 -2
- package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +1 -0
- package/dist/types/utils/regex/patternValidators.d.ts +2 -0
- package/dist/types/utils/simulateTextChangeFromKeyboardEvent.d.ts +2 -2
- package/dist/types/utils/urlUtils.d.ts +1 -0
- package/dist/types/utils/validatorUtils.d.ts +2 -0
- package/dist/{useMultiForm-Bwx2nVhh.js → useMultiForm-KQwxav4F.js} +158 -135
- package/dist/{useOnboardingStatus-Cwba-HzS.js → useOnboardingStatus-BMyj9Pwn.js} +1 -1
- package/dist/{useSalesChannelsSettings-BLzegVJh.js → useSalesChannelsSettings-43TfSoxc.js} +2 -2
- package/dist/{useTermsOfServiceStatus-C-i9mF4m.js → useTermsOfServiceStatus-CBHKWYSb.js} +1 -1
- package/dist/{useUpdateLegalEntity-xQlAqIqy.js → useUpdateLegalEntity-D8dw9Oc3.js} +2 -2
- package/dist/{utils-DXv7uAh6.js → utils-CL9qlD-O.js} +18 -11
- package/dist/{validate-BN5p-GhK.js → validate-CeF0YKvL.js} +2 -2
- package/dist/vue/adyen-transfer-instrument.js +5 -4
- package/dist/{yaml-jFdy-qnY.js → yaml-CBkrSAtc.js} +2 -2
- package/dist/zh-CN-wUb4MmTZ.js +13 -0
- package/dist/zh-TW-DNTXHLKa.js +13 -0
- package/package.json +28 -27
- package/dist/FormEndState-C3HCmXcw.js +0 -32
- package/dist/SourceOfFunds.module-xwHIboir.js +0 -128
- package/dist/bg-BG-COTwZXwN.js +0 -2040
- package/dist/cs-CZ-DUlgJKVq.js +0 -2040
- package/dist/da-DK-BDzDHhVR.js +0 -2040
- package/dist/de-DE-B3TpRjZX.js +0 -994
- package/dist/de-DE-DJdgXqS_.js +0 -2040
- package/dist/el-GR-CFEuLvxK.js +0 -994
- package/dist/el-GR-D5i9BNyh.js +0 -2040
- package/dist/en-US-ghR-1_C2.js +0 -994
- package/dist/es-ES-BtWn2FOQ.js +0 -994
- package/dist/es-ES-VOSWszW5.js +0 -2040
- package/dist/et-EE-Bp4Ngsn4.js +0 -2040
- package/dist/fi-FI-DaujOE-a.js +0 -2040
- package/dist/fr-FR-BdPZxk11.js +0 -2040
- package/dist/fr-FR-HvIkGqJf.js +0 -994
- package/dist/hr-HR-BY7C7NxY.js +0 -2040
- package/dist/hu-HU-DHCty-Tc.js +0 -2040
- package/dist/it-IT-BMsuhZEQ.js +0 -2040
- package/dist/it-IT-CjbZahlB.js +0 -994
- package/dist/ja-JP-4jufT0xh.js +0 -994
- package/dist/ja-JP-BYDz1z2G.js +0 -2040
- package/dist/lt-LT-DNJ9V9xV.js +0 -2040
- package/dist/lv-LV-CFJwN5wq.js +0 -2040
- package/dist/nl-NL-B3xjfpMi.js +0 -994
- package/dist/nl-NL-DibAf790.js +0 -2040
- package/dist/no-NO-DHCy5rXx.js +0 -2040
- package/dist/pl-PL-eZBNH5HH.js +0 -2040
- package/dist/pt-PT-BpYDD-PX.js +0 -994
- package/dist/pt-PT-CiN_Wmfe.js +0 -2040
- package/dist/ro-RO-CgyMTvLc.js +0 -2040
- package/dist/ru-RU-BlgIj-Q4.js +0 -994
- package/dist/sk-SK-B5qlQB_U.js +0 -2040
- package/dist/sl-SI-8PPfrGzL.js +0 -2040
- package/dist/sv-SE-7lcf_fB9.js +0 -994
- package/dist/sv-SE-ZWLw6D3j.js +0 -2040
- package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/RichText.d.ts +0 -5
- package/dist/types/utils/sanitizeHtml.d.ts +0 -3
- package/dist/types/utils/useStateFromProp.d.ts +0 -9
- package/dist/zh-CN-xYZH718R.js +0 -994
- package/dist/zh-TW-DqBBNurv.js +0 -994
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
{
|
|
3
3
|
try {
|
|
4
4
|
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2f44333d-554c-4aff-bf9a-44054bd93740", e._sentryDebugIdIdentifier = "sentry-dbid-2f44333d-554c-4aff-bf9a-44054bd93740");
|
|
6
6
|
} catch (e) {
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
;
|
|
10
10
|
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
11
|
-
import { p as useApiContext, q as useQuery, r as httpGet,
|
|
11
|
+
import { p as useApiContext, q as useQuery, r as httpGet, bh as useInvalidateRootLegalEntity, bi as useMutation, bk as httpPost, bA as formatObject, y as LegalEntityType, G as Typography, eD as Currencies, ap as useI18nContext, aB as Field, eE as InputGroup, bu as Select, bE as InputText, bG as InputDate, aF as TextArea, aY as RadioGroup, aH as CountryField, b5 as Modal, B as Alert, _ as Button, bb as Confirm, ar as isEmpty, aw as useForm, eF as useGlobalDataSlice, az as ErrorPanel, aA as createFormUtils, L as Loader, a4 as Icon, ds as getFormProps, a1 as Card, b8 as StructuredList, $ as IconButton, di as isEmpty$1, bp as Svg, a6 as useToastContext, Y as createLogger, eG as Dropzone, cl as createDocumentRequest, bq as useQueryClient, b as useLegalEntity, R as ROOT_LE, ei as useStateContext, a0 as useAnalyticsContext, eH as useLegalEntities, cy as getPropsFromConfigurations, bQ as getRequiredForms, bR as addValidityToForms, bS as useFormComposer, cp as documentApiUtils, eo as FormWrapper, ac as useCapabilityProblems, bl as getProblemsForEntity, V as EntityType, g as getLegalEntityCountry } from "./StoreProvider-ClKLaHzy.js";
|
|
12
12
|
import { useState, useMemo, useEffect, useCallback, useRef } from "preact/hooks";
|
|
13
|
-
import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-
|
|
14
|
-
import { h as hasDataChanged } from "./hasDataChanged-
|
|
13
|
+
import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-D8dw9Oc3.js";
|
|
14
|
+
import { h as hasDataChanged } from "./hasDataChanged-CwfuS4et.js";
|
|
15
15
|
import { signal } from "@preact/signals";
|
|
16
|
-
import { s as styles, T as TaskStatusIndicator } from "./SourceOfFunds.module-xwHIboir.js";
|
|
17
16
|
import { a as formatAmountWithCurrency } from "./formatCurrency-CMOSdJMB.js";
|
|
18
|
-
import { l as localizeDateString } from "./localizeDateString-
|
|
17
|
+
import { l as localizeDateString } from "./localizeDateString-CKCBXzSn.js";
|
|
19
18
|
import { t as toCapitalized } from "./toCapitalized-Bq7laD0b.js";
|
|
20
|
-
import { A as Avatar } from "./Avatar-
|
|
21
|
-
import isURL from "validator/es/lib/isURL.js";
|
|
19
|
+
import { A as Avatar } from "./Avatar-vCjWXfC7.js";
|
|
22
20
|
import { v as validateDateNotInTheFuture } from "./validate-CuwYJGc9.js";
|
|
23
|
-
import { T as TileGroup } from "./TileGroup-
|
|
24
|
-
import {
|
|
21
|
+
import { T as TileGroup } from "./TileGroup-BtE472I1.js";
|
|
22
|
+
import { T as TaskStatusIndicator } from "./TaskStatusIndicator-CTtKjo0m.js";
|
|
23
|
+
import { L as LandingLayout } from "./LandingLayout-B45lEjOv.js";
|
|
24
|
+
import { n as normalizedTaskStatusStore } from "./OnboardingDropinComponent-DBW5N3Dr.js";
|
|
25
25
|
const getBusinessLines = async (legalEntityId, baseUrl) => {
|
|
26
26
|
return httpGet({
|
|
27
27
|
baseUrl,
|
|
@@ -99,6 +99,62 @@ const useSourceOfFundsTypes = (options) => {
|
|
|
99
99
|
...options
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
+
const sourceOfFunds = "adyen-kyc-source-of-funds";
|
|
103
|
+
const sourceOfFundsWrapperLoading = "adyen-kyc-source-of-funds-wrapper-loading";
|
|
104
|
+
const sourceOfFundsWrapperHeading = "adyen-kyc-source-of-funds-wrapper-heading";
|
|
105
|
+
const sourceOfFundsWrapperDescription = "adyen-kyc-source-of-funds-wrapper-description";
|
|
106
|
+
const sourceOfFundsGettingStarted = "adyen-kyc-source-of-funds-getting-started";
|
|
107
|
+
const sourceOfFundsGettingStartedHeading = "adyen-kyc-source-of-funds-getting-started-heading";
|
|
108
|
+
const sourceOfFundsGettingStartedBody = "adyen-kyc-source-of-funds-getting-started-body";
|
|
109
|
+
const sourceOfFundsGettingStartedError = "adyen-kyc-source-of-funds-getting-started-error";
|
|
110
|
+
const sourceOfFundsGettingStartedErrorActions = "adyen-kyc-source-of-funds-getting-started-error-actions";
|
|
111
|
+
const sourceOfFundsGettingStartedCards = "adyen-kyc-source-of-funds-getting-started-cards";
|
|
112
|
+
const sourceOfFundsGettingStartedCardsCard = "adyen-kyc-source-of-funds-getting-started-cards-card";
|
|
113
|
+
const sourceOfFundsGettingStartedCardsCardHeader = "adyen-kyc-source-of-funds-getting-started-cards-card-header";
|
|
114
|
+
const sourceOfFundsGettingStartedCardsCardBody = "adyen-kyc-source-of-funds-getting-started-cards-card-body";
|
|
115
|
+
const sourceOfFundsGettingStartedActions = "adyen-kyc-source-of-funds-getting-started-actions";
|
|
116
|
+
const sourceOfFundsAdditionalDataForm = "adyen-kyc-source-of-funds-additional-data-form";
|
|
117
|
+
const sourceOfFundsThirdPartyFundingFinancierGroup = "adyen-kyc-source-of-funds-third-party-funding-financier-group";
|
|
118
|
+
const sourceOfFundsThirdPartyFundingNameAvatarGroup = "adyen-kyc-source-of-funds-third-party-funding-name-avatar-group";
|
|
119
|
+
const sourceOfFundsThirdPartyFundingNameAddressGroup = "adyen-kyc-source-of-funds-third-party-funding-name-address-group";
|
|
120
|
+
const sourceOfFundsSofFinancierFormError = "adyen-kyc-source-of-funds-sof-financier-form-error";
|
|
121
|
+
const sourceOfFundsSofFinancierFormNameGroup = "adyen-kyc-source-of-funds-sof-financier-form-name-group";
|
|
122
|
+
const sourceOfFundsFinancierFooter = "adyen-kyc-source-of-funds-financier-footer";
|
|
123
|
+
const sourceOfFundsGridContainer = "adyen-kyc-source-of-funds-grid-container";
|
|
124
|
+
const sourceOfFundsUploadModalContentField = "adyen-kyc-source-of-funds-upload-modal-content-field";
|
|
125
|
+
const sourceOfFundsUploadModalContentFieldRadioGroup = "adyen-kyc-source-of-funds-upload-modal-content-field-radio-group";
|
|
126
|
+
const sourceOfFundsUploadModalContentRequirementsContainer = "adyen-kyc-source-of-funds-upload-modal-content-requirements-container";
|
|
127
|
+
const sourceOfFundsUploadListHeading = "adyen-kyc-source-of-funds-upload-list-heading";
|
|
128
|
+
const sourceOfFundsModal = "adyen-kyc-source-of-funds-modal";
|
|
129
|
+
const styles = {
|
|
130
|
+
sourceOfFunds,
|
|
131
|
+
sourceOfFundsWrapperLoading,
|
|
132
|
+
sourceOfFundsWrapperHeading,
|
|
133
|
+
sourceOfFundsWrapperDescription,
|
|
134
|
+
sourceOfFundsGettingStarted,
|
|
135
|
+
sourceOfFundsGettingStartedHeading,
|
|
136
|
+
sourceOfFundsGettingStartedBody,
|
|
137
|
+
sourceOfFundsGettingStartedError,
|
|
138
|
+
sourceOfFundsGettingStartedErrorActions,
|
|
139
|
+
sourceOfFundsGettingStartedCards,
|
|
140
|
+
sourceOfFundsGettingStartedCardsCard,
|
|
141
|
+
sourceOfFundsGettingStartedCardsCardHeader,
|
|
142
|
+
sourceOfFundsGettingStartedCardsCardBody,
|
|
143
|
+
sourceOfFundsGettingStartedActions,
|
|
144
|
+
sourceOfFundsAdditionalDataForm,
|
|
145
|
+
sourceOfFundsThirdPartyFundingFinancierGroup,
|
|
146
|
+
sourceOfFundsThirdPartyFundingNameAvatarGroup,
|
|
147
|
+
sourceOfFundsThirdPartyFundingNameAddressGroup,
|
|
148
|
+
sourceOfFundsSofFinancierFormError,
|
|
149
|
+
sourceOfFundsSofFinancierFormNameGroup,
|
|
150
|
+
sourceOfFundsFinancierFooter,
|
|
151
|
+
sourceOfFundsGridContainer,
|
|
152
|
+
sourceOfFundsUploadModalContentField,
|
|
153
|
+
sourceOfFundsUploadModalContentFieldRadioGroup,
|
|
154
|
+
sourceOfFundsUploadModalContentRequirementsContainer,
|
|
155
|
+
sourceOfFundsUploadListHeading,
|
|
156
|
+
sourceOfFundsModal
|
|
157
|
+
};
|
|
102
158
|
const additionalDataSchemaKeys = [
|
|
103
159
|
"description",
|
|
104
160
|
"dateOfFundsReceived",
|
|
@@ -204,54 +260,52 @@ const getServiceTranslationKey = (service) => {
|
|
|
204
260
|
};
|
|
205
261
|
const getGettingStartedCardDetails = (sourceOfFundsType, i18n, data) => {
|
|
206
262
|
const details = [];
|
|
207
|
-
sourceOfFundsType
|
|
208
|
-
var _a, _b, _c;
|
|
263
|
+
sourceOfFundsType?.forEach((type) => {
|
|
209
264
|
switch (type) {
|
|
210
265
|
case "amount":
|
|
211
266
|
details.push({
|
|
212
267
|
term: i18n.get("amount"),
|
|
213
|
-
details:
|
|
268
|
+
details: data?.amount?.currency && data?.amount?.value ? formatAmountWithCurrency(data.amount.value, data.amount.currency) : ""
|
|
214
269
|
});
|
|
215
270
|
break;
|
|
216
271
|
case "description":
|
|
217
272
|
details.push({
|
|
218
273
|
term: i18n.get("description"),
|
|
219
|
-
details:
|
|
274
|
+
details: data?.description || ""
|
|
220
275
|
});
|
|
221
276
|
break;
|
|
222
277
|
case "dateOfFundsReceived":
|
|
223
278
|
details.push({
|
|
224
279
|
term: i18n.get("date"),
|
|
225
|
-
details: localizeDateString(
|
|
280
|
+
details: localizeDateString(data?.dateOfFundsReceived || "", i18n.locale)
|
|
226
281
|
});
|
|
227
282
|
break;
|
|
228
283
|
case "purpose":
|
|
229
284
|
details.push({
|
|
230
285
|
term: i18n.get("reason"),
|
|
231
|
-
details:
|
|
286
|
+
details: data?.purpose || ""
|
|
232
287
|
});
|
|
233
288
|
break;
|
|
234
289
|
case "relationship":
|
|
235
|
-
details.push({ term: i18n.get("relationship"), details:
|
|
290
|
+
details.push({ term: i18n.get("relationship"), details: data?.relationship || "" });
|
|
236
291
|
break;
|
|
237
292
|
case "originatorLegalEntityId":
|
|
238
293
|
details.push({
|
|
239
294
|
term: i18n.get("benefactorDetails"),
|
|
240
295
|
details: [
|
|
241
|
-
|
|
242
|
-
/* @__PURE__ */ jsx(Typography, { color: "secondary", children:
|
|
296
|
+
data?.legalName ? `${data?.legalName}` : `${data?.firstName} ${data?.lastName}`,
|
|
297
|
+
/* @__PURE__ */ jsx(Typography, { color: "secondary", children: data?.country || "" }, "location")
|
|
243
298
|
]
|
|
244
299
|
});
|
|
245
300
|
break;
|
|
246
301
|
case "financiers":
|
|
247
|
-
|
|
248
|
-
var _a2, _b2;
|
|
302
|
+
data?.financiers?.map((financier) => {
|
|
249
303
|
return details.push({
|
|
250
304
|
term: i18n.get("investor"),
|
|
251
305
|
details: [
|
|
252
|
-
`${financier
|
|
253
|
-
/* @__PURE__ */ jsx(Typography, { color: "secondary", children:
|
|
254
|
-
/* @__PURE__ */ jsx(Typography, { color: "secondary", children:
|
|
306
|
+
`${financier?.firstName} ${financier?.lastName}`,
|
|
307
|
+
/* @__PURE__ */ jsx(Typography, { color: "secondary", children: financier?.location || "" }, "location"),
|
|
308
|
+
/* @__PURE__ */ jsx(Typography, { color: "secondary", children: financier?.amount?.currency && financier?.amount?.value ? formatAmountWithCurrency(
|
|
255
309
|
financier.amount.value,
|
|
256
310
|
financier.amount.currency
|
|
257
311
|
) || "" : "" }, "value")
|
|
@@ -262,19 +316,19 @@ const getGettingStartedCardDetails = (sourceOfFundsType, i18n, data) => {
|
|
|
262
316
|
case "cryptocurrencyExchange":
|
|
263
317
|
details.push({
|
|
264
318
|
term: i18n.get("cryptocurrencyExchange"),
|
|
265
|
-
details:
|
|
319
|
+
details: data?.cryptocurrencyExchange || ""
|
|
266
320
|
});
|
|
267
321
|
break;
|
|
268
322
|
case "dateOfSourceEvent":
|
|
269
323
|
details.push({
|
|
270
324
|
term: i18n.get("dateOfSourceEvent"),
|
|
271
|
-
details: localizeDateString(
|
|
325
|
+
details: localizeDateString(data?.dateOfSourceEvent || "", i18n.locale)
|
|
272
326
|
});
|
|
273
327
|
break;
|
|
274
328
|
case "website":
|
|
275
329
|
details.push({
|
|
276
330
|
term: i18n.get("website"),
|
|
277
|
-
details:
|
|
331
|
+
details: data?.website || ""
|
|
278
332
|
});
|
|
279
333
|
break;
|
|
280
334
|
}
|
|
@@ -309,7 +363,7 @@ const typesRequiringAdditionalData = [
|
|
|
309
363
|
const getSourceOfFundsRequiredForms = (data) => {
|
|
310
364
|
return Object.fromEntries(
|
|
311
365
|
Object.entries(sourceOfFundsForms).filter(([form]) => {
|
|
312
|
-
if (!
|
|
366
|
+
if (!data?.type || !typesRequiringAdditionalData.includes(data?.type))
|
|
313
367
|
return form !== sourceOfFundsForms.additionalData.formId;
|
|
314
368
|
return form;
|
|
315
369
|
})
|
|
@@ -321,7 +375,6 @@ const getInputErrors = ({
|
|
|
321
375
|
key,
|
|
322
376
|
value
|
|
323
377
|
}) => {
|
|
324
|
-
var _a, _b, _c, _d;
|
|
325
378
|
const isEmpty2 = value === "" || value === null || value === void 0;
|
|
326
379
|
let errors = { ...formErrors };
|
|
327
380
|
if (isEmpty2) {
|
|
@@ -330,15 +383,15 @@ const getInputErrors = ({
|
|
|
330
383
|
errors = { ...formErrors, [key]: void 0 };
|
|
331
384
|
}
|
|
332
385
|
if (["amount", "currency"].includes(key)) {
|
|
333
|
-
if (
|
|
386
|
+
if (data?.amount?.value && data?.amount?.currency) {
|
|
334
387
|
errors = { ...formErrors, amount: void 0 };
|
|
335
388
|
}
|
|
336
|
-
if (!
|
|
389
|
+
if (!data?.amount?.currency) {
|
|
337
390
|
errors = { ...formErrors, amount: "currencyIsRequired" };
|
|
338
391
|
}
|
|
339
|
-
if (!
|
|
392
|
+
if (!data?.amount?.value) {
|
|
340
393
|
errors = { ...formErrors, amount: "amountIsRequired" };
|
|
341
|
-
} else if (isNaN(data
|
|
394
|
+
} else if (isNaN(data?.amount.value)) {
|
|
342
395
|
errors = { ...formErrors, amount: "pleaseEnterAValidAmount" };
|
|
343
396
|
}
|
|
344
397
|
}
|
|
@@ -611,34 +664,32 @@ const parseSOFDocumentDescription = (i18n, documentDescription) => {
|
|
|
611
664
|
};
|
|
612
665
|
const MISSING_DATA_SOF_UPLOAD_CODE = "2_8224";
|
|
613
666
|
const parseOriginatorDetails = (originatorDetails, businessLine) => {
|
|
614
|
-
var _a, _b, _c, _d, _e;
|
|
615
667
|
const copiedBusinessLine = { ...businessLine };
|
|
616
668
|
if (copiedBusinessLine.sourceOfFunds) {
|
|
617
669
|
if (originatorDetails.organization) {
|
|
618
670
|
copiedBusinessLine.sourceOfFunds.legalName = originatorDetails.organization.legalName;
|
|
619
|
-
copiedBusinessLine.sourceOfFunds.country =
|
|
671
|
+
copiedBusinessLine.sourceOfFunds.country = originatorDetails.organization?.registeredAddress?.country;
|
|
620
672
|
copiedBusinessLine.sourceOfFunds.originatorType = "organization";
|
|
621
673
|
}
|
|
622
674
|
if (originatorDetails.individual) {
|
|
623
|
-
copiedBusinessLine.sourceOfFunds.firstName =
|
|
624
|
-
copiedBusinessLine.sourceOfFunds.lastName =
|
|
625
|
-
copiedBusinessLine.sourceOfFunds.country =
|
|
675
|
+
copiedBusinessLine.sourceOfFunds.firstName = originatorDetails.individual.name?.firstName;
|
|
676
|
+
copiedBusinessLine.sourceOfFunds.lastName = originatorDetails.individual.name?.lastName;
|
|
677
|
+
copiedBusinessLine.sourceOfFunds.country = originatorDetails.individual.residentialAddress?.country;
|
|
626
678
|
copiedBusinessLine.sourceOfFunds.originatorType = "individual";
|
|
627
679
|
}
|
|
628
680
|
}
|
|
629
681
|
return copiedBusinessLine;
|
|
630
682
|
};
|
|
631
683
|
const getSourceOfFundsPayload = (sofType, additionalData) => {
|
|
632
|
-
var _a, _b;
|
|
633
684
|
switch (sofType) {
|
|
634
685
|
case "business":
|
|
635
686
|
return {
|
|
636
687
|
adyenProcessedFunds: false,
|
|
637
688
|
type: "business",
|
|
638
|
-
description: additionalData
|
|
689
|
+
description: additionalData?.description,
|
|
639
690
|
amount: {
|
|
640
|
-
currency:
|
|
641
|
-
value:
|
|
691
|
+
currency: additionalData?.amount?.currency ?? "USD",
|
|
692
|
+
value: additionalData?.amount?.value ?? 0
|
|
642
693
|
}
|
|
643
694
|
};
|
|
644
695
|
case "employment":
|
|
@@ -650,19 +701,19 @@ const getSourceOfFundsPayload = (sofType, additionalData) => {
|
|
|
650
701
|
return {
|
|
651
702
|
adyenProcessedFunds: false,
|
|
652
703
|
type: "donations",
|
|
653
|
-
dateOfFundsReceived: additionalData
|
|
654
|
-
purpose: additionalData
|
|
655
|
-
relationship: additionalData
|
|
656
|
-
originatorLegalEntityId: additionalData
|
|
704
|
+
dateOfFundsReceived: additionalData?.dateOfFundsReceived,
|
|
705
|
+
purpose: additionalData?.purpose,
|
|
706
|
+
relationship: additionalData?.relationship,
|
|
707
|
+
originatorLegalEntityId: additionalData?.originatorLegalEntityId
|
|
657
708
|
};
|
|
658
709
|
case "inheritance":
|
|
659
710
|
return {
|
|
660
711
|
adyenProcessedFunds: false,
|
|
661
712
|
type: "inheritance",
|
|
662
|
-
dateOfFundsReceived: additionalData
|
|
663
|
-
amount: additionalData
|
|
664
|
-
relationship: additionalData
|
|
665
|
-
originatorLegalEntityId: additionalData
|
|
713
|
+
dateOfFundsReceived: additionalData?.dateOfFundsReceived,
|
|
714
|
+
amount: additionalData?.amount,
|
|
715
|
+
relationship: additionalData?.relationship,
|
|
716
|
+
originatorLegalEntityId: additionalData?.originatorLegalEntityId
|
|
666
717
|
};
|
|
667
718
|
case "financialAid":
|
|
668
719
|
return {
|
|
@@ -698,22 +749,22 @@ const getSourceOfFundsPayload = (sofType, additionalData) => {
|
|
|
698
749
|
return {
|
|
699
750
|
adyenProcessedFunds: false,
|
|
700
751
|
type: "thirdPartyFunding",
|
|
701
|
-
financiers: additionalData
|
|
752
|
+
financiers: additionalData?.financiers
|
|
702
753
|
};
|
|
703
754
|
case "cryptocurrencyIncome":
|
|
704
755
|
return {
|
|
705
756
|
adyenProcessedFunds: false,
|
|
706
757
|
type: "cryptocurrencyIncome",
|
|
707
|
-
cryptocurrencyExchange: additionalData
|
|
758
|
+
cryptocurrencyExchange: additionalData?.cryptocurrencyExchange
|
|
708
759
|
};
|
|
709
760
|
case "assetSale":
|
|
710
761
|
return {
|
|
711
762
|
adyenProcessedFunds: false,
|
|
712
763
|
type: "assetSale",
|
|
713
|
-
cryptocurrencyExchange: additionalData
|
|
714
|
-
dateOfSourceEvent: additionalData
|
|
715
|
-
description: additionalData
|
|
716
|
-
amount: additionalData
|
|
764
|
+
cryptocurrencyExchange: additionalData?.cryptocurrencyExchange,
|
|
765
|
+
dateOfSourceEvent: additionalData?.dateOfSourceEvent,
|
|
766
|
+
description: additionalData?.description,
|
|
767
|
+
amount: additionalData?.amount
|
|
717
768
|
};
|
|
718
769
|
case "loans":
|
|
719
770
|
return {
|
|
@@ -724,9 +775,9 @@ const getSourceOfFundsPayload = (sofType, additionalData) => {
|
|
|
724
775
|
return {
|
|
725
776
|
adyenProcessedFunds: false,
|
|
726
777
|
type: "gamblingWinnings",
|
|
727
|
-
dateOfSourceEvent: additionalData
|
|
728
|
-
website: additionalData
|
|
729
|
-
amount: additionalData
|
|
778
|
+
dateOfSourceEvent: additionalData?.dateOfSourceEvent,
|
|
779
|
+
website: additionalData?.website && !additionalData.website.startsWith("http://") && !additionalData.website.startsWith("https://") ? `https://${additionalData.website}` : additionalData?.website,
|
|
780
|
+
amount: additionalData?.amount
|
|
730
781
|
};
|
|
731
782
|
default:
|
|
732
783
|
return { adyenProcessedFunds: true };
|
|
@@ -734,16 +785,16 @@ const getSourceOfFundsPayload = (sofType, additionalData) => {
|
|
|
734
785
|
};
|
|
735
786
|
const parseSofOriginatorPayload = (additionalData) => {
|
|
736
787
|
let sofOriginator;
|
|
737
|
-
if (
|
|
788
|
+
if (additionalData?.originatorType === "individual") {
|
|
738
789
|
sofOriginator = {
|
|
739
790
|
type: LegalEntityType.INDIVIDUAL,
|
|
740
791
|
individual: {
|
|
741
792
|
name: {
|
|
742
|
-
firstName:
|
|
743
|
-
lastName:
|
|
793
|
+
firstName: additionalData?.firstName ?? "",
|
|
794
|
+
lastName: additionalData?.lastName ?? ""
|
|
744
795
|
},
|
|
745
796
|
residentialAddress: {
|
|
746
|
-
country: additionalData
|
|
797
|
+
country: additionalData?.country
|
|
747
798
|
}
|
|
748
799
|
}
|
|
749
800
|
};
|
|
@@ -751,9 +802,9 @@ const parseSofOriginatorPayload = (additionalData) => {
|
|
|
751
802
|
sofOriginator = {
|
|
752
803
|
type: LegalEntityType.ORGANIZATION,
|
|
753
804
|
organization: {
|
|
754
|
-
legalName:
|
|
805
|
+
legalName: additionalData?.legalName ?? "",
|
|
755
806
|
registeredAddress: {
|
|
756
|
-
country: additionalData
|
|
807
|
+
country: additionalData?.country
|
|
757
808
|
}
|
|
758
809
|
}
|
|
759
810
|
};
|
|
@@ -772,15 +823,15 @@ const formatDateForInput = (isoDateString) => {
|
|
|
772
823
|
return "";
|
|
773
824
|
}
|
|
774
825
|
};
|
|
775
|
-
const getSofCardDetails = (i18n,
|
|
776
|
-
if (!
|
|
826
|
+
const getSofCardDetails = (i18n, sourceOfFunds2) => {
|
|
827
|
+
if (!sourceOfFunds2) {
|
|
777
828
|
return "";
|
|
778
829
|
}
|
|
779
|
-
if (
|
|
830
|
+
if (sourceOfFunds2?.adyenProcessedFunds) {
|
|
780
831
|
return i18n.get("sofTypeAdyenLabel");
|
|
781
832
|
}
|
|
782
|
-
if (
|
|
783
|
-
return i18n.get(`sofType${toCapitalized(
|
|
833
|
+
if (sourceOfFunds2?.type) {
|
|
834
|
+
return i18n.get(`sofType${toCapitalized(sourceOfFunds2?.type)}Label`);
|
|
784
835
|
}
|
|
785
836
|
return "";
|
|
786
837
|
};
|
|
@@ -795,10 +846,9 @@ const getRelevantErrors = (problems, targetCodes) => {
|
|
|
795
846
|
);
|
|
796
847
|
};
|
|
797
848
|
const getUniqueRemediationActions = (error) => {
|
|
798
|
-
var _a;
|
|
799
849
|
const allActions = [
|
|
800
850
|
...error.remediatingActions || [],
|
|
801
|
-
...
|
|
851
|
+
...error.subErrors?.flatMap((sub) => sub.remediatingActions || []) || []
|
|
802
852
|
];
|
|
803
853
|
return allActions.filter((action, i, arr) => arr.findIndex((a) => a.code === action.code) === i);
|
|
804
854
|
};
|
|
@@ -819,48 +869,45 @@ function AdditionalDataForAssetSale(props) {
|
|
|
819
869
|
name: "amount",
|
|
820
870
|
label: formUtils.getLabel("amount", "saleAmount"),
|
|
821
871
|
errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
|
|
822
|
-
children: (childProps) =>
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
);
|
|
863
|
-
}
|
|
872
|
+
children: (childProps) => /* @__PURE__ */ jsxs(
|
|
873
|
+
InputGroup,
|
|
874
|
+
{
|
|
875
|
+
...childProps,
|
|
876
|
+
id: "currencyGroup",
|
|
877
|
+
isFocused,
|
|
878
|
+
isInvalid: Boolean(!valid.amount && errors.amount),
|
|
879
|
+
children: [
|
|
880
|
+
/* @__PURE__ */ jsx(
|
|
881
|
+
Select,
|
|
882
|
+
{
|
|
883
|
+
name: "currency",
|
|
884
|
+
"aria-label": i18n.get("currency"),
|
|
885
|
+
isMulti: false,
|
|
886
|
+
items: allowedCurrencies,
|
|
887
|
+
selected: data.amount?.currency,
|
|
888
|
+
placeholder: i18n.get("select"),
|
|
889
|
+
onChange: handleAmountChange("currency"),
|
|
890
|
+
minimal: true
|
|
891
|
+
}
|
|
892
|
+
),
|
|
893
|
+
/* @__PURE__ */ jsx(
|
|
894
|
+
InputText,
|
|
895
|
+
{
|
|
896
|
+
...childProps,
|
|
897
|
+
name: "amount",
|
|
898
|
+
value: data.amount?.value,
|
|
899
|
+
readonly: formUtils.isReadOnly("amount"),
|
|
900
|
+
onInput: handleAmountChange("amount"),
|
|
901
|
+
onBlur: handleOnAmountBlur,
|
|
902
|
+
"aria-required": true,
|
|
903
|
+
"aria-invalid": !valid.amount,
|
|
904
|
+
isValid: valid.amount,
|
|
905
|
+
onFocusHandler: () => setIsFocused(true)
|
|
906
|
+
}
|
|
907
|
+
)
|
|
908
|
+
]
|
|
909
|
+
}
|
|
910
|
+
)
|
|
864
911
|
}
|
|
865
912
|
),
|
|
866
913
|
/* @__PURE__ */ jsx(
|
|
@@ -927,48 +974,45 @@ function AdditionalDataForBusiness(props) {
|
|
|
927
974
|
errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
|
|
928
975
|
helper: i18n.get("useFiguresFromTheMostRecentYearAvailable"),
|
|
929
976
|
helperPosition: "below",
|
|
930
|
-
children: (childProps) =>
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
}
|
|
970
|
-
);
|
|
971
|
-
}
|
|
977
|
+
children: (childProps) => /* @__PURE__ */ jsxs(
|
|
978
|
+
InputGroup,
|
|
979
|
+
{
|
|
980
|
+
...childProps,
|
|
981
|
+
id: "currencyGroup",
|
|
982
|
+
isFocused,
|
|
983
|
+
isInvalid: Boolean(!valid.amount && errors.amount),
|
|
984
|
+
children: [
|
|
985
|
+
/* @__PURE__ */ jsx(
|
|
986
|
+
Select,
|
|
987
|
+
{
|
|
988
|
+
name: "currency",
|
|
989
|
+
"aria-label": i18n.get("currency"),
|
|
990
|
+
isMulti: false,
|
|
991
|
+
items: allowedCurrencies,
|
|
992
|
+
selected: data.amount?.currency,
|
|
993
|
+
placeholder: i18n.get("select"),
|
|
994
|
+
onChange: handleAmountChange("currency"),
|
|
995
|
+
minimal: true
|
|
996
|
+
}
|
|
997
|
+
),
|
|
998
|
+
/* @__PURE__ */ jsx(
|
|
999
|
+
InputText,
|
|
1000
|
+
{
|
|
1001
|
+
...childProps,
|
|
1002
|
+
name: "amount",
|
|
1003
|
+
value: data.amount?.value,
|
|
1004
|
+
readonly: formUtils.isReadOnly("amount"),
|
|
1005
|
+
onInput: handleAmountChange("amount"),
|
|
1006
|
+
onBlur: handleOnAmountBlur,
|
|
1007
|
+
"aria-required": true,
|
|
1008
|
+
"aria-invalid": !valid.amount,
|
|
1009
|
+
isValid: valid.amount,
|
|
1010
|
+
onFocusHandler: () => setIsFocused(true)
|
|
1011
|
+
}
|
|
1012
|
+
)
|
|
1013
|
+
]
|
|
1014
|
+
}
|
|
1015
|
+
)
|
|
972
1016
|
}
|
|
973
1017
|
),
|
|
974
1018
|
/* @__PURE__ */ jsx(
|
|
@@ -1064,7 +1108,7 @@ function AdditionalDataOriginatorLegalEntity(props) {
|
|
|
1064
1108
|
)
|
|
1065
1109
|
}
|
|
1066
1110
|
),
|
|
1067
|
-
|
|
1111
|
+
data?.originatorType === "organization" && /* @__PURE__ */ jsx(
|
|
1068
1112
|
Field,
|
|
1069
1113
|
{
|
|
1070
1114
|
name: "legalName",
|
|
@@ -1087,7 +1131,7 @@ function AdditionalDataOriginatorLegalEntity(props) {
|
|
|
1087
1131
|
)
|
|
1088
1132
|
}
|
|
1089
1133
|
),
|
|
1090
|
-
|
|
1134
|
+
data?.originatorType === "individual" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1091
1135
|
/* @__PURE__ */ jsx(
|
|
1092
1136
|
Field,
|
|
1093
1137
|
{
|
|
@@ -1141,14 +1185,14 @@ function AdditionalDataOriginatorLegalEntity(props) {
|
|
|
1141
1185
|
}
|
|
1142
1186
|
)
|
|
1143
1187
|
] }),
|
|
1144
|
-
|
|
1188
|
+
data?.originatorType && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1145
1189
|
/* @__PURE__ */ jsx(
|
|
1146
1190
|
Field,
|
|
1147
1191
|
{
|
|
1148
1192
|
name: "relationship",
|
|
1149
1193
|
label: formUtils.getLabel(
|
|
1150
1194
|
"relationship",
|
|
1151
|
-
isDonations &&
|
|
1195
|
+
isDonations && data?.originatorType === "individual" ? "yourRelationshipToDonor" : data?.originatorType === "organization" ? "yourRelationshipToOrganization" : "yourRelationshipToDecedent"
|
|
1152
1196
|
),
|
|
1153
1197
|
errorMessage: formUtils.getErrorMessage("relationship", errors, fieldProblems),
|
|
1154
1198
|
isValid: valid.relationship,
|
|
@@ -1178,7 +1222,7 @@ function AdditionalDataOriginatorLegalEntity(props) {
|
|
|
1178
1222
|
},
|
|
1179
1223
|
labels: {
|
|
1180
1224
|
country: i18n.get(
|
|
1181
|
-
isDonations &&
|
|
1225
|
+
isDonations && data?.originatorType === "individual" ? "donorsCountryOfResidence" : data?.originatorType === "organization" ? "organizationsCountryOfOperation" : "decedentsCountryOfDeath"
|
|
1182
1226
|
)
|
|
1183
1227
|
},
|
|
1184
1228
|
readonly: formUtils.isReadOnly("country"),
|
|
@@ -1272,48 +1316,45 @@ function AdditionalDataForGambling(props) {
|
|
|
1272
1316
|
name: "amount",
|
|
1273
1317
|
label: formUtils.getLabel("amount", "totalAmountWon"),
|
|
1274
1318
|
errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
|
|
1275
|
-
children: (childProps) =>
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
}
|
|
1315
|
-
);
|
|
1316
|
-
}
|
|
1319
|
+
children: (childProps) => /* @__PURE__ */ jsxs(
|
|
1320
|
+
InputGroup,
|
|
1321
|
+
{
|
|
1322
|
+
...childProps,
|
|
1323
|
+
id: "currencyGroup",
|
|
1324
|
+
isFocused: focusedInput === "amount",
|
|
1325
|
+
isInvalid: Boolean(!valid.amount && errors.amount),
|
|
1326
|
+
children: [
|
|
1327
|
+
/* @__PURE__ */ jsx(
|
|
1328
|
+
Select,
|
|
1329
|
+
{
|
|
1330
|
+
name: "currency",
|
|
1331
|
+
"aria-label": i18n.get("currency"),
|
|
1332
|
+
isMulti: false,
|
|
1333
|
+
items: allowedCurrencies,
|
|
1334
|
+
selected: data.amount?.currency,
|
|
1335
|
+
placeholder: i18n.get("select"),
|
|
1336
|
+
onChange: handleAmountChange("currency"),
|
|
1337
|
+
minimal: true
|
|
1338
|
+
}
|
|
1339
|
+
),
|
|
1340
|
+
/* @__PURE__ */ jsx(
|
|
1341
|
+
InputText,
|
|
1342
|
+
{
|
|
1343
|
+
...childProps,
|
|
1344
|
+
name: "amount",
|
|
1345
|
+
value: data.amount?.value,
|
|
1346
|
+
readonly: formUtils.isReadOnly("amount"),
|
|
1347
|
+
onInput: handleAmountChange("amount"),
|
|
1348
|
+
onBlur: handleOnAmountBlur,
|
|
1349
|
+
"aria-required": true,
|
|
1350
|
+
"aria-invalid": !valid.amount,
|
|
1351
|
+
isValid: valid.amount,
|
|
1352
|
+
onFocusHandler: () => setFocusedInput("amount")
|
|
1353
|
+
}
|
|
1354
|
+
)
|
|
1355
|
+
]
|
|
1356
|
+
}
|
|
1357
|
+
)
|
|
1317
1358
|
}
|
|
1318
1359
|
),
|
|
1319
1360
|
/* @__PURE__ */ jsx(
|
|
@@ -1404,48 +1445,45 @@ function AdditionalDataForInheritance(props) {
|
|
|
1404
1445
|
name: "amount",
|
|
1405
1446
|
label: formUtils.getLabel("amount", "inheritanceAmount"),
|
|
1406
1447
|
errorMessage: formUtils.getErrorMessage("amount", errors, fieldProblems),
|
|
1407
|
-
children: (childProps) =>
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
}
|
|
1447
|
-
);
|
|
1448
|
-
}
|
|
1448
|
+
children: (childProps) => /* @__PURE__ */ jsxs(
|
|
1449
|
+
InputGroup,
|
|
1450
|
+
{
|
|
1451
|
+
...childProps,
|
|
1452
|
+
id: "currencyGroup",
|
|
1453
|
+
isFocused,
|
|
1454
|
+
isInvalid: Boolean(!valid.amount && errors.amount),
|
|
1455
|
+
children: [
|
|
1456
|
+
/* @__PURE__ */ jsx(
|
|
1457
|
+
Select,
|
|
1458
|
+
{
|
|
1459
|
+
name: "currency",
|
|
1460
|
+
"aria-label": i18n.get("currency"),
|
|
1461
|
+
isMulti: false,
|
|
1462
|
+
items: allowedCurrencies ?? [],
|
|
1463
|
+
selected: data.amount?.currency,
|
|
1464
|
+
placeholder: i18n.get("select"),
|
|
1465
|
+
onChange: handleAmountChange("currency"),
|
|
1466
|
+
minimal: true
|
|
1467
|
+
}
|
|
1468
|
+
),
|
|
1469
|
+
/* @__PURE__ */ jsx(
|
|
1470
|
+
InputText,
|
|
1471
|
+
{
|
|
1472
|
+
...childProps,
|
|
1473
|
+
name: "amount",
|
|
1474
|
+
value: data.amount?.value,
|
|
1475
|
+
readonly: formUtils.isReadOnly("amount"),
|
|
1476
|
+
onInput: handleAmountChange("amount"),
|
|
1477
|
+
onBlur: handleOnAmountBlur,
|
|
1478
|
+
"aria-required": true,
|
|
1479
|
+
"aria-invalid": !valid.amount,
|
|
1480
|
+
isValid: valid.amount,
|
|
1481
|
+
onFocusHandler: () => setIsFocused(true)
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
]
|
|
1485
|
+
}
|
|
1486
|
+
)
|
|
1449
1487
|
}
|
|
1450
1488
|
),
|
|
1451
1489
|
/* @__PURE__ */ jsx(
|
|
@@ -1460,7 +1498,7 @@ function AdditionalDataForInheritance(props) {
|
|
|
1460
1498
|
{
|
|
1461
1499
|
...childProps,
|
|
1462
1500
|
name: "dateOfFundsReceived",
|
|
1463
|
-
value: data.dateOfFundsReceived,
|
|
1501
|
+
value: formatDateForInput(data.dateOfFundsReceived),
|
|
1464
1502
|
onInput: handleChangeFor("dateOfFundsReceived", "input"),
|
|
1465
1503
|
onBlur: handleChangeFor("dateOfFundsReceived", "blur"),
|
|
1466
1504
|
"aria-required": true,
|
|
@@ -1482,17 +1520,16 @@ const SOFFinancierModal = (props) => {
|
|
|
1482
1520
|
const [isFocused, setIsFocused] = useState(false);
|
|
1483
1521
|
const [errorMessage, setErrorMessage] = useState("");
|
|
1484
1522
|
const handleInputUpdate = (key, e) => {
|
|
1485
|
-
var _a, _b;
|
|
1486
1523
|
const inputEl = e.target;
|
|
1487
1524
|
setErrorMessage("");
|
|
1488
|
-
const value = inputEl
|
|
1525
|
+
const value = inputEl?.value;
|
|
1489
1526
|
let inputData = {
|
|
1490
1527
|
[key]: value
|
|
1491
1528
|
};
|
|
1492
1529
|
if (["amount", "currency"].includes(key)) {
|
|
1493
1530
|
const amountValue = {
|
|
1494
|
-
currency: key === "currency" ? value :
|
|
1495
|
-
value: key === "currency" ?
|
|
1531
|
+
currency: key === "currency" ? value : formData?.amount?.currency,
|
|
1532
|
+
value: key === "currency" ? formData?.amount?.value : value
|
|
1496
1533
|
};
|
|
1497
1534
|
inputData = { amount: amountValue };
|
|
1498
1535
|
}
|
|
@@ -1505,19 +1542,17 @@ const SOFFinancierModal = (props) => {
|
|
|
1505
1542
|
setFormErrors(errors);
|
|
1506
1543
|
};
|
|
1507
1544
|
const handleOnAmountBlur = () => {
|
|
1508
|
-
var _a;
|
|
1509
1545
|
setIsFocused(false);
|
|
1510
1546
|
const errors = getInputErrors({
|
|
1511
1547
|
formErrors,
|
|
1512
1548
|
data: formData,
|
|
1513
1549
|
key: "amount",
|
|
1514
|
-
value:
|
|
1550
|
+
value: formData?.amount?.value
|
|
1515
1551
|
});
|
|
1516
1552
|
setFormErrors(errors);
|
|
1517
1553
|
};
|
|
1518
1554
|
const allFieldsFilled = (data) => {
|
|
1519
|
-
|
|
1520
|
-
return (data == null ? void 0 : data.firstName) && (data == null ? void 0 : data.lastName) && (data == null ? void 0 : data.location) && ((_a = data == null ? void 0 : data.amount) == null ? void 0 : _a.currency) && !Number.isNaN(Number((_b = data == null ? void 0 : data.amount) == null ? void 0 : _b.value));
|
|
1555
|
+
return data?.firstName && data?.lastName && data?.location && data?.amount?.currency && !Number.isNaN(Number(data?.amount?.value));
|
|
1521
1556
|
};
|
|
1522
1557
|
const handleFinancierSave = () => {
|
|
1523
1558
|
if (formData && allFieldsFilled(formData)) {
|
|
@@ -1531,8 +1566,7 @@ const SOFFinancierModal = (props) => {
|
|
|
1531
1566
|
"amount"
|
|
1532
1567
|
];
|
|
1533
1568
|
const errors = fields.reduce((acc, key) => {
|
|
1534
|
-
|
|
1535
|
-
const value = key === "amount" ? (_a = formData == null ? void 0 : formData.amount) == null ? void 0 : _a.value : formData == null ? void 0 : formData[key];
|
|
1569
|
+
const value = key === "amount" ? formData?.amount?.value : formData?.[key];
|
|
1536
1570
|
return {
|
|
1537
1571
|
...acc,
|
|
1538
1572
|
...getInputErrors({
|
|
@@ -1585,7 +1619,7 @@ const SOFFinancierModal = (props) => {
|
|
|
1585
1619
|
{
|
|
1586
1620
|
...childProps,
|
|
1587
1621
|
name: "firstName",
|
|
1588
|
-
value: formData
|
|
1622
|
+
value: formData?.firstName,
|
|
1589
1623
|
onInput: (e) => handleInputUpdate("firstName", e),
|
|
1590
1624
|
onBlur: (e) => handleInputUpdate("firstName", e),
|
|
1591
1625
|
"aria-required": true,
|
|
@@ -1607,7 +1641,7 @@ const SOFFinancierModal = (props) => {
|
|
|
1607
1641
|
{
|
|
1608
1642
|
...childProps,
|
|
1609
1643
|
name: "lastName",
|
|
1610
|
-
value: formData
|
|
1644
|
+
value: formData?.lastName,
|
|
1611
1645
|
onInput: (e) => handleInputUpdate("lastName", e),
|
|
1612
1646
|
onBlur: (e) => handleInputUpdate("lastName", e),
|
|
1613
1647
|
"aria-required": true,
|
|
@@ -1633,7 +1667,7 @@ const SOFFinancierModal = (props) => {
|
|
|
1633
1667
|
{
|
|
1634
1668
|
...childProps,
|
|
1635
1669
|
name: "location",
|
|
1636
|
-
value: formData
|
|
1670
|
+
value: formData?.location,
|
|
1637
1671
|
onInput: (e) => handleInputUpdate("location", e),
|
|
1638
1672
|
onBlur: (e) => handleInputUpdate("location", e),
|
|
1639
1673
|
"aria-required": true,
|
|
@@ -1651,36 +1685,33 @@ const SOFFinancierModal = (props) => {
|
|
|
1651
1685
|
label: i18n.get("investmentAmount"),
|
|
1652
1686
|
errorMessage: formErrors.amount,
|
|
1653
1687
|
isValid: !formErrors.amount,
|
|
1654
|
-
children: (childProps) => {
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
)
|
|
1682
|
-
] });
|
|
1683
|
-
}
|
|
1688
|
+
children: (childProps) => /* @__PURE__ */ jsxs(InputGroup, { ...childProps, id: "currencyGroup", isFocused, children: [
|
|
1689
|
+
/* @__PURE__ */ jsx(
|
|
1690
|
+
Select,
|
|
1691
|
+
{
|
|
1692
|
+
minimal: true,
|
|
1693
|
+
name: "currency",
|
|
1694
|
+
"aria-label": i18n.get("currency"),
|
|
1695
|
+
isMulti: false,
|
|
1696
|
+
items: allowedCurrencies,
|
|
1697
|
+
selected: formData?.amount?.currency,
|
|
1698
|
+
placeholder: i18n.get("select"),
|
|
1699
|
+
onChange: (e) => handleInputUpdate("currency", e)
|
|
1700
|
+
}
|
|
1701
|
+
),
|
|
1702
|
+
/* @__PURE__ */ jsx(
|
|
1703
|
+
InputText,
|
|
1704
|
+
{
|
|
1705
|
+
...childProps,
|
|
1706
|
+
name: "amount",
|
|
1707
|
+
value: formData?.amount?.value,
|
|
1708
|
+
onInput: (e) => handleInputUpdate("amount", e),
|
|
1709
|
+
onBlur: handleOnAmountBlur,
|
|
1710
|
+
"aria-required": true,
|
|
1711
|
+
onFocusHandler: () => setIsFocused(true)
|
|
1712
|
+
}
|
|
1713
|
+
)
|
|
1714
|
+
] })
|
|
1684
1715
|
}
|
|
1685
1716
|
)
|
|
1686
1717
|
] }),
|
|
@@ -1702,7 +1733,6 @@ const SOFFinancierModal = (props) => {
|
|
|
1702
1733
|
] });
|
|
1703
1734
|
};
|
|
1704
1735
|
function AdditionalDataForThirdParty(props) {
|
|
1705
|
-
var _a;
|
|
1706
1736
|
const [showFinancierModal, setShowFinancierModal] = useState(false);
|
|
1707
1737
|
const [activeFinancier, setActiveFinancier] = useState();
|
|
1708
1738
|
const [activeIndex, setActiveIndex] = useState();
|
|
@@ -1760,35 +1790,32 @@ function AdditionalDataForThirdParty(props) {
|
|
|
1760
1790
|
children: i18n.get("addAtLeastOneInvestor")
|
|
1761
1791
|
}
|
|
1762
1792
|
),
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
"button",
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
className: styles.
|
|
1771
|
-
|
|
1772
|
-
/* @__PURE__ */ jsxs("div", { className: styles.
|
|
1773
|
-
/* @__PURE__ */
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
index
|
|
1790
|
-
);
|
|
1791
|
-
}),
|
|
1793
|
+
data.financiers?.map((financier, index) => /* @__PURE__ */ jsxs(
|
|
1794
|
+
"button",
|
|
1795
|
+
{
|
|
1796
|
+
type: "button",
|
|
1797
|
+
onClick: () => handleShowUpdateFinancierModal(index),
|
|
1798
|
+
className: styles.sourceOfFundsThirdPartyFundingFinancierGroup,
|
|
1799
|
+
children: [
|
|
1800
|
+
/* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsThirdPartyFundingNameAvatarGroup, children: [
|
|
1801
|
+
/* @__PURE__ */ jsx(Avatar, { iconName: "user", circle: true }),
|
|
1802
|
+
/* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsThirdPartyFundingNameAddressGroup, children: [
|
|
1803
|
+
/* @__PURE__ */ jsxs(Typography, { el: "div", variant: "body-strongest", children: [
|
|
1804
|
+
financier.firstName,
|
|
1805
|
+
" ",
|
|
1806
|
+
financier.lastName
|
|
1807
|
+
] }),
|
|
1808
|
+
/* @__PURE__ */ jsx(Typography, { el: "div", variant: "caption", children: financier.location })
|
|
1809
|
+
] })
|
|
1810
|
+
] }),
|
|
1811
|
+
/* @__PURE__ */ jsx("div", { children: financier.amount?.currency && financier.amount?.value ? formatAmountWithCurrency(
|
|
1812
|
+
financier.amount.value,
|
|
1813
|
+
financier.amount?.currency
|
|
1814
|
+
) : "" })
|
|
1815
|
+
]
|
|
1816
|
+
},
|
|
1817
|
+
index
|
|
1818
|
+
)),
|
|
1792
1819
|
/* @__PURE__ */ jsx(
|
|
1793
1820
|
"button",
|
|
1794
1821
|
{
|
|
@@ -1812,6 +1839,17 @@ function AdditionalDataForThirdParty(props) {
|
|
|
1812
1839
|
)
|
|
1813
1840
|
] });
|
|
1814
1841
|
}
|
|
1842
|
+
function canParseUrl(url) {
|
|
1843
|
+
if (URL.canParse) {
|
|
1844
|
+
return URL.canParse(url);
|
|
1845
|
+
}
|
|
1846
|
+
try {
|
|
1847
|
+
new URL(url);
|
|
1848
|
+
return true;
|
|
1849
|
+
} catch {
|
|
1850
|
+
return false;
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1815
1853
|
const sourceOfFundsTypeValidations = {
|
|
1816
1854
|
type: {
|
|
1817
1855
|
modes: ["blur"],
|
|
@@ -1833,24 +1871,26 @@ const sourceOfFundsAdditionalDataValidations = {
|
|
|
1833
1871
|
},
|
|
1834
1872
|
{
|
|
1835
1873
|
modes: ["blur"],
|
|
1836
|
-
validate: (website) => website ?
|
|
1874
|
+
validate: (website) => website ? canParseUrl(
|
|
1875
|
+
website?.startsWith("http:") || website?.startsWith("https:") ? website : `https://${website}`
|
|
1876
|
+
) : false,
|
|
1837
1877
|
errorMessage: "validationPleaseEnterAValidUrl"
|
|
1838
1878
|
}
|
|
1839
1879
|
],
|
|
1840
1880
|
amount: [
|
|
1841
1881
|
{
|
|
1842
1882
|
modes: ["blur"],
|
|
1843
|
-
validate: (amount) => !isEmpty(amount
|
|
1883
|
+
validate: (amount) => !isEmpty(amount?.currency),
|
|
1844
1884
|
errorMessage: "currencyIsRequired"
|
|
1845
1885
|
},
|
|
1846
1886
|
{
|
|
1847
1887
|
modes: ["blur"],
|
|
1848
|
-
validate: (amount) => !isEmpty(amount
|
|
1888
|
+
validate: (amount) => !isEmpty(amount?.value),
|
|
1849
1889
|
errorMessage: "amountIsRequired"
|
|
1850
1890
|
},
|
|
1851
1891
|
{
|
|
1852
1892
|
modes: ["blur"],
|
|
1853
|
-
validate: (amount) => !Number.isNaN(Number(amount
|
|
1893
|
+
validate: (amount) => !Number.isNaN(Number(amount?.value)),
|
|
1854
1894
|
errorMessage: "pleaseEnterAValidAmount"
|
|
1855
1895
|
}
|
|
1856
1896
|
],
|
|
@@ -1935,8 +1975,8 @@ function SourceOfFundsAdditionalData(props) {
|
|
|
1935
1975
|
sourceOfFundsType
|
|
1936
1976
|
} = props;
|
|
1937
1977
|
const getFormSchema = useMemo(
|
|
1938
|
-
() => getAdditionalDataSchemaKeys(sourceOfFundsType, defaultData
|
|
1939
|
-
[sourceOfFundsType, defaultData
|
|
1978
|
+
() => getAdditionalDataSchemaKeys(sourceOfFundsType, defaultData?.originatorType),
|
|
1979
|
+
[sourceOfFundsType, defaultData?.originatorType]
|
|
1940
1980
|
);
|
|
1941
1981
|
const [schema, setSchema] = useState(getFormSchema);
|
|
1942
1982
|
const {
|
|
@@ -1955,14 +1995,13 @@ function SourceOfFundsAdditionalData(props) {
|
|
|
1955
1995
|
shouldValidate
|
|
1956
1996
|
});
|
|
1957
1997
|
useEffect(() => {
|
|
1958
|
-
setSchema(getAdditionalDataSchemaKeys(sourceOfFundsType, formData
|
|
1998
|
+
setSchema(getAdditionalDataSchemaKeys(sourceOfFundsType, formData?.originatorType));
|
|
1959
1999
|
}, [formData.originatorType]);
|
|
1960
2000
|
const handleAmountChange = (key) => (e) => {
|
|
1961
|
-
var _a, _b;
|
|
1962
2001
|
const isCurrencyKey = key === "currency";
|
|
1963
2002
|
const amountValue = {
|
|
1964
|
-
currency: isCurrencyKey ? e.target.value :
|
|
1965
|
-
value: isCurrencyKey ?
|
|
2003
|
+
currency: isCurrencyKey ? e.target.value : formData.amount?.currency,
|
|
2004
|
+
value: isCurrencyKey ? formData.amount?.value : e.target.value
|
|
1966
2005
|
};
|
|
1967
2006
|
const fieldEvent = {
|
|
1968
2007
|
target: {
|
|
@@ -2085,7 +2124,7 @@ function SourceOfFundsAdditionalData(props) {
|
|
|
2085
2124
|
ErrorPanel,
|
|
2086
2125
|
{
|
|
2087
2126
|
verificationErrors: formVerificationErrors,
|
|
2088
|
-
validationErrors: props
|
|
2127
|
+
validationErrors: props?.fieldValidationErrors,
|
|
2089
2128
|
formUtils,
|
|
2090
2129
|
id: "ariaErrorField"
|
|
2091
2130
|
}
|
|
@@ -2135,11 +2174,11 @@ function SourceOfFundsType(props) {
|
|
|
2135
2174
|
label: i18n.get("sofTypeAdyenLabel"),
|
|
2136
2175
|
icon: getIconById("adyen")
|
|
2137
2176
|
},
|
|
2138
|
-
...
|
|
2177
|
+
...categories?.map((item) => ({
|
|
2139
2178
|
value: item.id,
|
|
2140
2179
|
label: i18n.get(`sofType${toCapitalized(item.name)}Label`),
|
|
2141
2180
|
icon: getIconById(item.id)
|
|
2142
|
-
}))
|
|
2181
|
+
})) ?? []
|
|
2143
2182
|
];
|
|
2144
2183
|
const errorMessage = formUtils.getErrorMessage("type", formErrors, formFieldProblems);
|
|
2145
2184
|
return /* @__PURE__ */ jsx(Field, { el: "fieldset", name: "type", children: () => /* @__PURE__ */ jsx(
|
|
@@ -2148,7 +2187,7 @@ function SourceOfFundsType(props) {
|
|
|
2148
2187
|
name: "type",
|
|
2149
2188
|
tiles: categoryItems,
|
|
2150
2189
|
errorMessage: typeof errorMessage !== "boolean" ? i18n.get(errorMessage) : errorMessage,
|
|
2151
|
-
selected:
|
|
2190
|
+
selected: formData?.type ? formData.type : [],
|
|
2152
2191
|
onChange: handleChangeFor("type", "input")
|
|
2153
2192
|
}
|
|
2154
2193
|
) });
|
|
@@ -2195,7 +2234,7 @@ function SourceOfFunds(props) {
|
|
|
2195
2234
|
const { i18n } = useI18nContext();
|
|
2196
2235
|
const { activeForm, activeBusinessLine, sourceOfFundsType } = props;
|
|
2197
2236
|
const { data: sourceOfFundsTypesData, isLoading } = useSourceOfFundsTypes();
|
|
2198
|
-
const formWrapperClasses = (formId) =>
|
|
2237
|
+
const formWrapperClasses = (formId) => activeForm?.formId !== formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper";
|
|
2199
2238
|
const pageHeadings = useMemo(
|
|
2200
2239
|
() => getPageHeadings(sourceOfFundsType ?? "adyen"),
|
|
2201
2240
|
[sourceOfFundsType]
|
|
@@ -2203,19 +2242,19 @@ function SourceOfFunds(props) {
|
|
|
2203
2242
|
return isLoading || !activeBusinessLine ? /* @__PURE__ */ jsx("div", { className: styles.sourceOfFundsWrapperLoading, children: /* @__PURE__ */ jsx(Loader, {}) }) : /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-wrapper", children: [
|
|
2204
2243
|
/* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsWrapperHeading, children: [
|
|
2205
2244
|
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get(
|
|
2206
|
-
|
|
2245
|
+
activeForm?.formId === "additionalData" ? pageHeadings.heading : {
|
|
2207
2246
|
key: "selectASourceOfFunding",
|
|
2208
2247
|
values: {
|
|
2209
2248
|
type: getServiceTranslationSelectTitle(
|
|
2210
2249
|
i18n,
|
|
2211
|
-
|
|
2250
|
+
activeBusinessLine?.service || ""
|
|
2212
2251
|
).toLowerCase()
|
|
2213
2252
|
}
|
|
2214
2253
|
}
|
|
2215
2254
|
) }),
|
|
2216
2255
|
/* @__PURE__ */ jsxs(Typography, { className: styles.sourceOfFundsWrapperDescription, children: [
|
|
2217
|
-
|
|
2218
|
-
|
|
2256
|
+
activeForm?.formId === "additionalData" && pageHeadings.description && i18n.get(pageHeadings.description),
|
|
2257
|
+
sourceOfFundsTypesData?.length === 0 && i18n.get("noCategoriesAvailable")
|
|
2219
2258
|
] })
|
|
2220
2259
|
] }),
|
|
2221
2260
|
sofErrorMessage.value && /* @__PURE__ */ jsxs(
|
|
@@ -2232,21 +2271,21 @@ function SourceOfFunds(props) {
|
|
|
2232
2271
|
]
|
|
2233
2272
|
}
|
|
2234
2273
|
),
|
|
2235
|
-
|
|
2274
|
+
activeForm?.formId === "sourceOfFundsType" && /* @__PURE__ */ jsx("div", { className: formWrapperClasses("sourceOfFundsType"), children: /* @__PURE__ */ jsx(
|
|
2236
2275
|
SourceOfFundsType,
|
|
2237
2276
|
{
|
|
2238
2277
|
categories: sourceOfFundsTypesData,
|
|
2239
2278
|
...getFormProps(props, sourceOfFundsForms.sourceOfFundsType.formId)
|
|
2240
2279
|
}
|
|
2241
2280
|
) }),
|
|
2242
|
-
|
|
2281
|
+
activeForm?.formId === "additionalData" && /* @__PURE__ */ jsx("div", { className: formWrapperClasses("additionalData"), children: /* @__PURE__ */ jsx(
|
|
2243
2282
|
SourceOfFundsAdditionalData,
|
|
2244
2283
|
{
|
|
2245
2284
|
...getFormProps(props, sourceOfFundsForms.additionalData.formId),
|
|
2246
2285
|
sourceOfFundsType
|
|
2247
2286
|
}
|
|
2248
2287
|
) }),
|
|
2249
|
-
|
|
2288
|
+
activeForm?.formId === "companySourceOfFunds" && /* @__PURE__ */ jsx("div", { className: formWrapperClasses("companySourceOfFunds"), children: /* @__PURE__ */ jsx("div", { children: i18n.get("uploadADocument") }) })
|
|
2250
2289
|
] });
|
|
2251
2290
|
}
|
|
2252
2291
|
function SourceOfFundsGettingStartedCard(props) {
|
|
@@ -2268,7 +2307,7 @@ function SourceOfFundsGettingStartedCard(props) {
|
|
|
2268
2307
|
children: i18n.get("start")
|
|
2269
2308
|
}
|
|
2270
2309
|
),
|
|
2271
|
-
children: isEdit &&
|
|
2310
|
+
children: isEdit && meta?.length && /* @__PURE__ */ jsx(
|
|
2272
2311
|
StructuredList,
|
|
2273
2312
|
{
|
|
2274
2313
|
className: styles.sourceOfFundsGettingStartedCardsCardDescription,
|
|
@@ -2289,64 +2328,55 @@ const SourceOfFundsGettingStarted = ({
|
|
|
2289
2328
|
legalEntity,
|
|
2290
2329
|
isSoFDocumentMissing
|
|
2291
2330
|
}) => {
|
|
2292
|
-
var _a, _b, _c;
|
|
2293
2331
|
const { i18n } = useI18nContext();
|
|
2294
|
-
const hasSourceOfFunds = businessLines
|
|
2332
|
+
const hasSourceOfFunds = businessLines?.some(
|
|
2295
2333
|
(businessLine) => !isEmpty$1(businessLine.sourceOfFunds)
|
|
2296
2334
|
);
|
|
2297
2335
|
const sofDocuments = useMemo(
|
|
2298
|
-
() =>
|
|
2299
|
-
var _a2;
|
|
2300
|
-
return ((_a2 = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _a2.filter((doc) => doc.type === "proofOfFundingOrWealthSource")) ?? [];
|
|
2301
|
-
},
|
|
2336
|
+
() => legalEntity?.documentDetails?.filter((doc) => doc.type === "proofOfFundingOrWealthSource") ?? [],
|
|
2302
2337
|
[legalEntity]
|
|
2303
2338
|
);
|
|
2304
2339
|
const mapBusinessLines = useCallback(
|
|
2305
2340
|
(lines) => {
|
|
2306
|
-
|
|
2307
|
-
const completedBusinessLines = businessLines.every((line) => {
|
|
2308
|
-
var _a3;
|
|
2309
|
-
return (_a3 = line == null ? void 0 : line.sourceOfFunds) == null ? void 0 : _a3.type;
|
|
2310
|
-
});
|
|
2341
|
+
const completedBusinessLines = businessLines.every((line) => line?.sourceOfFunds?.type);
|
|
2311
2342
|
const cards = lines.map((line) => {
|
|
2312
|
-
var _a3, _b2, _c2, _d, _e;
|
|
2313
2343
|
const SoF = mapSourceOfFundToSourceOfFundsSchema(line);
|
|
2314
2344
|
return {
|
|
2315
2345
|
title: getServiceTranslation(i18n, line.service || ""),
|
|
2316
|
-
type:
|
|
2317
|
-
isEdit: !!
|
|
2346
|
+
type: line?.sourceOfFunds?.type,
|
|
2347
|
+
isEdit: !!line?.sourceOfFunds?.type || !!line?.sourceOfFunds?.adyenProcessedFunds,
|
|
2318
2348
|
onClick: () => handleSourceOfFundsClick(SoF, line),
|
|
2319
2349
|
meta: [
|
|
2320
2350
|
{
|
|
2321
2351
|
term: i18n.get("sourceOfFunds"),
|
|
2322
|
-
details: getSofCardDetails(i18n, line
|
|
2352
|
+
details: getSofCardDetails(i18n, line?.sourceOfFunds)
|
|
2323
2353
|
},
|
|
2324
2354
|
...getGettingStartedCardDetails(
|
|
2325
2355
|
getAdditionalDataSchemaKeys(
|
|
2326
|
-
|
|
2327
|
-
|
|
2356
|
+
line?.sourceOfFunds?.type || "adyen",
|
|
2357
|
+
line?.sourceOfFunds?.originatorType
|
|
2328
2358
|
),
|
|
2329
2359
|
i18n,
|
|
2330
|
-
line
|
|
2360
|
+
line?.sourceOfFunds
|
|
2331
2361
|
)
|
|
2332
2362
|
]
|
|
2333
2363
|
};
|
|
2334
|
-
}).sort((a) =>
|
|
2364
|
+
}).sort((a) => a?.type ? 1 : -1);
|
|
2335
2365
|
const uploadCard = {
|
|
2336
2366
|
title: getServiceTranslation(i18n),
|
|
2337
2367
|
type: "",
|
|
2338
|
-
isEdit: !!
|
|
2368
|
+
isEdit: !!sofDocuments?.length,
|
|
2339
2369
|
onClick: handleNavigateToUploadPage,
|
|
2340
|
-
meta:
|
|
2370
|
+
meta: sofDocuments?.length ? sofDocuments.map((doc) => ({
|
|
2341
2371
|
term: i18n.get("fileName"),
|
|
2342
2372
|
details: [
|
|
2343
|
-
doc
|
|
2344
|
-
/* @__PURE__ */ jsx(Typography, { color: "secondary", children: parseSOFDocumentDescription(i18n, doc
|
|
2373
|
+
doc?.fileName,
|
|
2374
|
+
/* @__PURE__ */ jsx(Typography, { color: "secondary", children: parseSOFDocumentDescription(i18n, doc?.description) || "" }, "docDescription")
|
|
2345
2375
|
]
|
|
2346
2376
|
})) : []
|
|
2347
2377
|
};
|
|
2348
|
-
if (completedBusinessLines && (isSoFDocumentMissing ||
|
|
2349
|
-
if (
|
|
2378
|
+
if (completedBusinessLines && (isSoFDocumentMissing || sofDocuments?.length)) {
|
|
2379
|
+
if (uploadCard.meta?.length) {
|
|
2350
2380
|
cards.push(uploadCard);
|
|
2351
2381
|
} else {
|
|
2352
2382
|
cards.unshift(uploadCard);
|
|
@@ -2379,27 +2409,61 @@ const SourceOfFundsGettingStarted = ({
|
|
|
2379
2409
|
"data-testid": "source-of-funds-getting-started",
|
|
2380
2410
|
children: [
|
|
2381
2411
|
!hasSourceOfFunds && /* @__PURE__ */ jsx(
|
|
2382
|
-
|
|
2383
|
-
{
|
|
2384
|
-
type: "image",
|
|
2385
|
-
testId: "source-of-funds-getting-started-icon",
|
|
2386
|
-
name: "source-of-funds",
|
|
2387
|
-
className: styles.sourceOfFundsGettingStartedIcon
|
|
2388
|
-
}
|
|
2389
|
-
),
|
|
2390
|
-
hasSourceOfFunds && /* @__PURE__ */ jsx(
|
|
2391
|
-
TaskStatusIndicator,
|
|
2412
|
+
LandingLayout,
|
|
2392
2413
|
{
|
|
2393
|
-
|
|
2414
|
+
media: /* @__PURE__ */ jsx(
|
|
2415
|
+
Svg,
|
|
2416
|
+
{
|
|
2417
|
+
type: "image",
|
|
2418
|
+
testId: "source-of-funds-getting-started-icon",
|
|
2419
|
+
name: "source-of-funds"
|
|
2420
|
+
}
|
|
2421
|
+
),
|
|
2422
|
+
title: i18n.get("fundingSourcesForFinancialProducts"),
|
|
2423
|
+
description: i18n.get("inTheNextStepWellCollectInformation"),
|
|
2424
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2425
|
+
/* @__PURE__ */ jsx(
|
|
2426
|
+
Button,
|
|
2427
|
+
{
|
|
2428
|
+
fullWidth: true,
|
|
2429
|
+
testId: "source-of-funds-getting-primary-button",
|
|
2430
|
+
onClick: handleGettingStartedClick,
|
|
2431
|
+
children: i18n.get("gettingStarted")
|
|
2432
|
+
}
|
|
2433
|
+
),
|
|
2434
|
+
handleCancelClick && /* @__PURE__ */ jsx(
|
|
2435
|
+
Button,
|
|
2436
|
+
{
|
|
2437
|
+
variant: "tertiary",
|
|
2438
|
+
fullWidth: true,
|
|
2439
|
+
testId: "source-of-funds-getting-cancel-button",
|
|
2440
|
+
onClick: handleCancelClick,
|
|
2441
|
+
children: i18n.get("backToTaskList")
|
|
2442
|
+
}
|
|
2443
|
+
)
|
|
2444
|
+
] })
|
|
2394
2445
|
}
|
|
2395
2446
|
),
|
|
2396
|
-
/* @__PURE__ */ jsx(Typography, { className: styles.sourceOfFundsGettingStartedHeading, el: "h2", variant: "title-l", children: i18n.get("fundingSourcesForFinancialProducts") }),
|
|
2397
2447
|
hasSourceOfFunds && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2448
|
+
/* @__PURE__ */ jsx(
|
|
2449
|
+
TaskStatusIndicator,
|
|
2450
|
+
{
|
|
2451
|
+
taskStatus: normalizedTaskStatusStore?.value?.SOURCE_OF_FUNDS?.status
|
|
2452
|
+
}
|
|
2453
|
+
),
|
|
2454
|
+
/* @__PURE__ */ jsx(
|
|
2455
|
+
Typography,
|
|
2456
|
+
{
|
|
2457
|
+
className: styles.sourceOfFundsGettingStartedHeading,
|
|
2458
|
+
el: "h2",
|
|
2459
|
+
variant: "title-l",
|
|
2460
|
+
children: i18n.get("fundingSourcesForFinancialProducts")
|
|
2461
|
+
}
|
|
2462
|
+
),
|
|
2398
2463
|
/* @__PURE__ */ jsx(Typography, { className: styles.sourceOfFundsGettingStartedBody, children: i18n.get("addAllSourcesOfFundsBeingUsed") }),
|
|
2399
2464
|
errorObjects && errorObjects.map((errorObj, index) => {
|
|
2400
|
-
var _a2, _b2;
|
|
2401
2465
|
const uniqueActions = getUniqueRemediationActions(errorObj);
|
|
2402
|
-
const errorItems =
|
|
2466
|
+
const errorItems = errorObj.subErrors?.map((subError) => subError.message) || [];
|
|
2403
2467
|
return /* @__PURE__ */ jsxs(
|
|
2404
2468
|
Alert,
|
|
2405
2469
|
{
|
|
@@ -2407,7 +2471,7 @@ const SourceOfFundsGettingStarted = ({
|
|
|
2407
2471
|
className: styles.sourceOfFundsGettingStartedError,
|
|
2408
2472
|
variant: "error",
|
|
2409
2473
|
children: [
|
|
2410
|
-
|
|
2474
|
+
errorObj?.subErrors?.length && /* @__PURE__ */ jsx("ul", { children: errorItems.map((item, i) => /* @__PURE__ */ jsx("li", { children: item }, i)) }),
|
|
2411
2475
|
uniqueActions.length > 0 && /* @__PURE__ */ jsx("div", { className: styles.sourceOfFundsGettingStartedErrorActions, children: uniqueActions.filter((action) => action.code !== "1_519").map((action, i) => /* @__PURE__ */ jsx(
|
|
2412
2476
|
Button,
|
|
2413
2477
|
{
|
|
@@ -2433,42 +2497,17 @@ const SourceOfFundsGettingStarted = ({
|
|
|
2433
2497
|
children: i18n.get("backToTaskList")
|
|
2434
2498
|
}
|
|
2435
2499
|
)
|
|
2436
|
-
] }),
|
|
2437
|
-
!hasSourceOfFunds && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2438
|
-
/* @__PURE__ */ jsx(Typography, { className: styles.sourceOfFundsGettingStartedBody, children: i18n.get("inTheNextStepWellCollectInformation") }),
|
|
2439
|
-
/* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsGettingStartedActions, children: [
|
|
2440
|
-
/* @__PURE__ */ jsx(
|
|
2441
|
-
Button,
|
|
2442
|
-
{
|
|
2443
|
-
fullWidth: true,
|
|
2444
|
-
testId: "source-of-funds-getting-primary-button",
|
|
2445
|
-
onClick: handleGettingStartedClick,
|
|
2446
|
-
children: i18n.get("gettingStarted")
|
|
2447
|
-
}
|
|
2448
|
-
),
|
|
2449
|
-
handleCancelClick && /* @__PURE__ */ jsx(
|
|
2450
|
-
Button,
|
|
2451
|
-
{
|
|
2452
|
-
variant: "tertiary",
|
|
2453
|
-
fullWidth: true,
|
|
2454
|
-
testId: "source-of-funds-getting-cancel-button",
|
|
2455
|
-
onClick: handleCancelClick,
|
|
2456
|
-
children: i18n.get("cancel")
|
|
2457
|
-
}
|
|
2458
|
-
)
|
|
2459
|
-
] })
|
|
2460
2500
|
] })
|
|
2461
2501
|
]
|
|
2462
2502
|
}
|
|
2463
2503
|
);
|
|
2464
2504
|
};
|
|
2465
2505
|
const SOFUploadModal = (props) => {
|
|
2466
|
-
var _a, _b;
|
|
2467
2506
|
const { i18n } = useI18nContext();
|
|
2468
2507
|
const { showToast } = useToastContext();
|
|
2469
2508
|
const logger2 = createLogger();
|
|
2470
2509
|
const { businessLines, handleModalClose, documentUtils } = props;
|
|
2471
|
-
const firstService =
|
|
2510
|
+
const firstService = businessLines?.length === 1 ? businessLines?.[0]?.service : void 0;
|
|
2472
2511
|
const [selectedService, setSelectedService] = useState(
|
|
2473
2512
|
firstService
|
|
2474
2513
|
);
|
|
@@ -2483,16 +2522,15 @@ const SOFUploadModal = (props) => {
|
|
|
2483
2522
|
const serviceRadioItems = useMemo(() => {
|
|
2484
2523
|
return businessLines.map((businessLine) => ({
|
|
2485
2524
|
id: businessLine.service,
|
|
2486
|
-
name: getServiceTranslationKey(
|
|
2525
|
+
name: getServiceTranslationKey(businessLine?.service || "")
|
|
2487
2526
|
}));
|
|
2488
2527
|
}, [businessLines]);
|
|
2489
2528
|
const canUpload = useMemo(() => selectedService && documentType, [selectedService, documentType]);
|
|
2490
|
-
const selectedBusinessLineId =
|
|
2529
|
+
const selectedBusinessLineId = businessLines?.find((businessLine) => businessLine.service === selectedService)?.id || "";
|
|
2491
2530
|
const documentLists = useMemo(() => {
|
|
2492
|
-
|
|
2493
|
-
const selectedType = (_b2 = (_a2 = businessLines == null ? void 0 : businessLines.find(
|
|
2531
|
+
const selectedType = businessLines?.find(
|
|
2494
2532
|
(businessLine) => businessLine.service === selectedService
|
|
2495
|
-
)
|
|
2533
|
+
)?.sourceOfFunds?.type;
|
|
2496
2534
|
if (selectedType) {
|
|
2497
2535
|
const lists = getDocumentLists(selectedType);
|
|
2498
2536
|
const items = lists.map((list) => ({
|
|
@@ -2536,7 +2574,7 @@ const SOFUploadModal = (props) => {
|
|
|
2536
2574
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Modal, { onClose: handleModalClose, ariaLabel: i18n.get("uploadASupportingDocument"), inset: true, children: /* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsModal, children: [
|
|
2537
2575
|
/* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h2", children: i18n.get("uploadASupportingDocument") }),
|
|
2538
2576
|
/* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsUploadModalContent, children: [
|
|
2539
|
-
|
|
2577
|
+
businessLines?.length > 1 ? /* @__PURE__ */ jsx(
|
|
2540
2578
|
Field,
|
|
2541
2579
|
{
|
|
2542
2580
|
el: "fieldset",
|
|
@@ -2578,9 +2616,9 @@ const SOFUploadModal = (props) => {
|
|
|
2578
2616
|
)
|
|
2579
2617
|
}
|
|
2580
2618
|
),
|
|
2581
|
-
|
|
2619
|
+
documentRequirements?.length ? /* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsUploadModalContentRequirementsContainer, children: [
|
|
2582
2620
|
/* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "div", children: i18n.get("documentShouldShow") }),
|
|
2583
|
-
/* @__PURE__ */ jsx("ul", { children: documentRequirements
|
|
2621
|
+
/* @__PURE__ */ jsx("ul", { children: documentRequirements?.map((requirement) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", el: "div", children: i18n.get(requirement) }) }, requirement)) })
|
|
2584
2622
|
] }) : null,
|
|
2585
2623
|
canUpload && /* @__PURE__ */ jsx(
|
|
2586
2624
|
Dropzone,
|
|
@@ -2604,7 +2642,6 @@ const SourceOfFundsUpload = ({
|
|
|
2604
2642
|
legalEntity,
|
|
2605
2643
|
handleNavigateToSummary
|
|
2606
2644
|
}) => {
|
|
2607
|
-
var _a;
|
|
2608
2645
|
const { i18n } = useI18nContext();
|
|
2609
2646
|
const [showUploadModal, setShowUploadModal] = useState(false);
|
|
2610
2647
|
const [docToDelete, setDocToDelete] = useState(void 0);
|
|
@@ -2621,16 +2658,10 @@ const SourceOfFundsUpload = ({
|
|
|
2621
2658
|
setShowUploadModal(true);
|
|
2622
2659
|
};
|
|
2623
2660
|
const documents = useMemo(
|
|
2624
|
-
() =>
|
|
2625
|
-
var _a2;
|
|
2626
|
-
return ((_a2 = legalEntity.documentDetails) == null ? void 0 : _a2.filter((doc) => doc.type === "proofOfFundingOrWealthSource")) ?? [];
|
|
2627
|
-
},
|
|
2661
|
+
() => legalEntity.documentDetails?.filter((doc) => doc.type === "proofOfFundingOrWealthSource") ?? [],
|
|
2628
2662
|
[legalEntity]
|
|
2629
2663
|
);
|
|
2630
|
-
const sourceOfFundsCategories =
|
|
2631
|
-
var _a2;
|
|
2632
|
-
return (_a2 = line.sourceOfFunds) == null ? void 0 : _a2.type;
|
|
2633
|
-
})) == null ? void 0 : _a.filter(Boolean);
|
|
2664
|
+
const sourceOfFundsCategories = businessLines?.map((line) => line.sourceOfFunds?.type)?.filter(Boolean);
|
|
2634
2665
|
const handleFileDelete = async (documentId) => {
|
|
2635
2666
|
if (documentUtils.deleteDocument) {
|
|
2636
2667
|
try {
|
|
@@ -2652,7 +2683,7 @@ const SourceOfFundsUpload = ({
|
|
|
2652
2683
|
return /* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsUploadList, children: [
|
|
2653
2684
|
/* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsUploadListHeading, children: [
|
|
2654
2685
|
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: i18n.get("supportingDocuments") }),
|
|
2655
|
-
/* @__PURE__ */ jsx(Typography, { className: styles.sourceOfFundsWrapperDescription, children:
|
|
2686
|
+
/* @__PURE__ */ jsx(Typography, { className: styles.sourceOfFundsWrapperDescription, children: sourceOfFundsCategories?.length > 1 ? i18n.get("weNeedProofOfFundingPlural", {
|
|
2656
2687
|
values: {
|
|
2657
2688
|
category1_name: sourceOfFundsCategories[0] ? i18n.get(
|
|
2658
2689
|
`sofType${toCapitalized(sourceOfFundsCategories[0])}Label`
|
|
@@ -2669,7 +2700,7 @@ const SourceOfFundsUpload = ({
|
|
|
2669
2700
|
}
|
|
2670
2701
|
}) })
|
|
2671
2702
|
] }),
|
|
2672
|
-
documents
|
|
2703
|
+
documents?.map((document) => /* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsThirdPartyFundingFinancierGroup, children: [
|
|
2673
2704
|
/* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsThirdPartyFundingNameAvatarGroup, children: [
|
|
2674
2705
|
/* @__PURE__ */ jsx(Avatar, { iconName: "document", circle: true }),
|
|
2675
2706
|
/* @__PURE__ */ jsxs("div", { className: styles.sourceOfFundsThirdPartyFundingNameAddressGroup, children: [
|
|
@@ -2701,18 +2732,18 @@ const SourceOfFundsUpload = ({
|
|
|
2701
2732
|
] })
|
|
2702
2733
|
}
|
|
2703
2734
|
),
|
|
2704
|
-
handleNavigateToSummary && /* @__PURE__ */ jsx("div", { className: styles.sourceOfFundsGettingStartedActions, children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleNavigateToSummary, children:
|
|
2735
|
+
handleNavigateToSummary && /* @__PURE__ */ jsx("div", { className: styles.sourceOfFundsGettingStartedActions, children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleNavigateToSummary, children: documents?.length > 0 ? i18n.get("finish") : i18n.get("cancel") }) }),
|
|
2705
2736
|
!!docToDelete && /* @__PURE__ */ jsx(
|
|
2706
2737
|
Confirm,
|
|
2707
2738
|
{
|
|
2708
2739
|
title: i18n.get({
|
|
2709
2740
|
key: "areYouSureYouWantToDeleteThisDocument",
|
|
2710
2741
|
values: {
|
|
2711
|
-
deleteDocName:
|
|
2742
|
+
deleteDocName: docToDelete?.fileName || ""
|
|
2712
2743
|
}
|
|
2713
2744
|
}),
|
|
2714
2745
|
confirmText: i18n.get("delete"),
|
|
2715
|
-
onConfirm: () => handleFileDelete(docToDelete
|
|
2746
|
+
onConfirm: () => handleFileDelete(docToDelete?.id),
|
|
2716
2747
|
onCancel: () => setDocToDelete(void 0),
|
|
2717
2748
|
critical: true
|
|
2718
2749
|
}
|
|
@@ -2733,7 +2764,6 @@ function SourceOfFundsDropin({
|
|
|
2733
2764
|
problems,
|
|
2734
2765
|
handleHomeClick
|
|
2735
2766
|
}) {
|
|
2736
|
-
var _a, _b, _c;
|
|
2737
2767
|
const { data: legalEntity, isLoading: isLoadingRootLegalEntity } = useLegalEntity(ROOT_LE);
|
|
2738
2768
|
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
2739
2769
|
const [activeBusinessLine, setActiveBusinessLine] = useState();
|
|
@@ -2751,33 +2781,24 @@ function SourceOfFundsDropin({
|
|
|
2751
2781
|
const { i18n } = useI18nContext();
|
|
2752
2782
|
const userEvents = useAnalyticsContext();
|
|
2753
2783
|
const { showToast } = useToastContext();
|
|
2754
|
-
const { data: businessLinesData } = useBusinessLines();
|
|
2784
|
+
const { data: businessLinesData, isLoading: isLoadingBusinessLines } = useBusinessLines();
|
|
2755
2785
|
const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
|
|
2756
2786
|
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
2757
2787
|
const { mutateAsync: updateSoFMutation } = useUpdateSourceOfFunds();
|
|
2758
2788
|
const filteredBusinessLines = useMemo(() => {
|
|
2759
|
-
return businessLinesData
|
|
2789
|
+
return businessLinesData?.filter(
|
|
2760
2790
|
(businessLine) => ALLOWED_SOF_SERVICES.includes(businessLine.service)
|
|
2761
2791
|
);
|
|
2762
2792
|
}, [businessLinesData]);
|
|
2763
2793
|
const isSoFDocumentMissing = useMemo(
|
|
2764
|
-
() =>
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
(verificationError) => (verificationError == null ? void 0 : verificationError.code) === MISSING_DATA_SOF_UPLOAD_CODE
|
|
2771
|
-
);
|
|
2772
|
-
}
|
|
2773
|
-
)) ?? false;
|
|
2774
|
-
},
|
|
2775
|
-
[legalEntity == null ? void 0 : legalEntity.problems]
|
|
2794
|
+
() => legalEntity?.problems?.some(
|
|
2795
|
+
(problem) => problem?.verificationErrors?.some(
|
|
2796
|
+
(verificationError) => verificationError?.code === MISSING_DATA_SOF_UPLOAD_CODE
|
|
2797
|
+
)
|
|
2798
|
+
) ?? false,
|
|
2799
|
+
[legalEntity?.problems]
|
|
2776
2800
|
);
|
|
2777
|
-
const idsToFetch = (
|
|
2778
|
-
var _a2;
|
|
2779
|
-
return (_a2 = businessLine.sourceOfFunds) == null ? void 0 : _a2.originatorLegalEntityId;
|
|
2780
|
-
}).filter((id) => Boolean(id))) ?? [];
|
|
2801
|
+
const idsToFetch = filteredBusinessLines?.map((businessLine) => businessLine.sourceOfFunds?.originatorLegalEntityId).filter((id) => Boolean(id)) ?? [];
|
|
2781
2802
|
const legalEntityResults = useLegalEntities(idsToFetch, {
|
|
2782
2803
|
staleTime: 5 * 60 * 1e3
|
|
2783
2804
|
// 5 minutes
|
|
@@ -2788,7 +2809,6 @@ function SourceOfFundsDropin({
|
|
|
2788
2809
|
return null;
|
|
2789
2810
|
}
|
|
2790
2811
|
return filteredBusinessLines.map((businessLine, index) => {
|
|
2791
|
-
var _a2;
|
|
2792
2812
|
const result = legalEntityResults[index];
|
|
2793
2813
|
let updatedBusinessLine = { ...businessLine };
|
|
2794
2814
|
if (result && result.data) {
|
|
@@ -2797,7 +2817,7 @@ function SourceOfFundsDropin({
|
|
|
2797
2817
|
logger.error(`Error fetching legal entity for BL ${businessLine.id}:`, result.error);
|
|
2798
2818
|
showToast({ label: i18n.get("unableToLoadRelatedEntity"), variant: "error" });
|
|
2799
2819
|
}
|
|
2800
|
-
if (
|
|
2820
|
+
if (updatedBusinessLine.sourceOfFunds?.adyenProcessedFunds) {
|
|
2801
2821
|
updatedBusinessLine.sourceOfFunds.type = "adyen";
|
|
2802
2822
|
}
|
|
2803
2823
|
return updatedBusinessLine;
|
|
@@ -2845,34 +2865,28 @@ function SourceOfFundsDropin({
|
|
|
2845
2865
|
});
|
|
2846
2866
|
}, [userEvents]);
|
|
2847
2867
|
const canSubmitForm = useMemo(
|
|
2848
|
-
() =>
|
|
2849
|
-
var _a2, _b2;
|
|
2850
|
-
return activeSourceOfFund ? !isEmpty((_b2 = (_a2 = currentState.data) == null ? void 0 : _a2.sourceOfFundsType) == null ? void 0 : _b2.type) && hasDataChanged(activeSourceOfFund, currentState.data) : false;
|
|
2851
|
-
},
|
|
2868
|
+
() => activeSourceOfFund ? !isEmpty(currentState.data?.sourceOfFundsType?.type) && hasDataChanged(activeSourceOfFund, currentState.data) : false,
|
|
2852
2869
|
[activeSourceOfFund, currentState.data]
|
|
2853
2870
|
);
|
|
2854
2871
|
const derivedProps = useMemo(
|
|
2855
2872
|
() => getPropsFromConfigurations(
|
|
2856
2873
|
{},
|
|
2857
2874
|
sourceOfFundsForms,
|
|
2858
|
-
|
|
2859
|
-
|
|
2875
|
+
problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
2876
|
+
problems?.missingData ?? [],
|
|
2860
2877
|
// TODO fix this to take existing fields into account
|
|
2861
2878
|
// getFieldsWithExistingData(legalEntityResponse, sourceOfFundsApiKeyMapping),
|
|
2862
2879
|
[],
|
|
2863
2880
|
{},
|
|
2864
2881
|
{},
|
|
2865
2882
|
{},
|
|
2866
|
-
legalEntity
|
|
2883
|
+
legalEntity?.type
|
|
2867
2884
|
),
|
|
2868
|
-
[problems
|
|
2885
|
+
[problems?.remediationActions, problems?.missingData, legalEntity]
|
|
2869
2886
|
);
|
|
2870
2887
|
const sourceOfFundsRequiredForms = useMemo(
|
|
2871
|
-
() =>
|
|
2872
|
-
|
|
2873
|
-
return getSourceOfFundsRequiredForms((_a2 = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a2.sourceOfFundsType);
|
|
2874
|
-
},
|
|
2875
|
-
[(_a = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a.sourceOfFundsType]
|
|
2888
|
+
() => getSourceOfFundsRequiredForms(currentState?.data?.sourceOfFundsType),
|
|
2889
|
+
[currentState?.data?.sourceOfFundsType]
|
|
2876
2890
|
);
|
|
2877
2891
|
const forms = useMemo(() => {
|
|
2878
2892
|
const requiredForms = getRequiredForms(
|
|
@@ -2886,9 +2900,9 @@ function SourceOfFundsDropin({
|
|
|
2886
2900
|
const createOrUpdateOriginator = async (additionalData) => {
|
|
2887
2901
|
let originatorLegalEntityId;
|
|
2888
2902
|
const sofOriginator = parseSofOriginatorPayload(additionalData);
|
|
2889
|
-
if (additionalData
|
|
2903
|
+
if (additionalData?.originatorLegalEntityId) {
|
|
2890
2904
|
try {
|
|
2891
|
-
sofOriginator.id = additionalData
|
|
2905
|
+
sofOriginator.id = additionalData?.originatorLegalEntityId;
|
|
2892
2906
|
if (sofOriginator.type) {
|
|
2893
2907
|
delete sofOriginator.type;
|
|
2894
2908
|
}
|
|
@@ -2897,14 +2911,14 @@ function SourceOfFundsDropin({
|
|
|
2897
2911
|
id: sofOriginator.id
|
|
2898
2912
|
};
|
|
2899
2913
|
const le = await updateLegalEntity(patchLegalEntity);
|
|
2900
|
-
originatorLegalEntityId = le
|
|
2914
|
+
originatorLegalEntityId = le?.id;
|
|
2901
2915
|
} catch (e) {
|
|
2902
2916
|
logger.log("Error updating originator legal entity", e);
|
|
2903
2917
|
}
|
|
2904
2918
|
} else {
|
|
2905
2919
|
try {
|
|
2906
2920
|
const le = await createLegalEntity(sofOriginator);
|
|
2907
|
-
originatorLegalEntityId = le
|
|
2921
|
+
originatorLegalEntityId = le?.id;
|
|
2908
2922
|
} catch (e) {
|
|
2909
2923
|
logger.log("Error creating originator legal entity", e);
|
|
2910
2924
|
}
|
|
@@ -2912,10 +2926,9 @@ function SourceOfFundsDropin({
|
|
|
2912
2926
|
return originatorLegalEntityId;
|
|
2913
2927
|
};
|
|
2914
2928
|
const handleSubmit = useCallback(async () => {
|
|
2915
|
-
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2918
|
-
if (!sofType || !(activeBusinessLine == null ? void 0 : activeBusinessLine.id)) {
|
|
2929
|
+
const sofData = { ...currentState?.data };
|
|
2930
|
+
const sofType = sofData?.sourceOfFundsType?.type;
|
|
2931
|
+
if (!sofType || !activeBusinessLine?.id) {
|
|
2919
2932
|
return;
|
|
2920
2933
|
}
|
|
2921
2934
|
const eventsAdditionalData = {};
|
|
@@ -2923,11 +2936,16 @@ function SourceOfFundsDropin({
|
|
|
2923
2936
|
const { additionalData } = sofData;
|
|
2924
2937
|
const sofPayload = getSourceOfFundsPayload(sofType, additionalData);
|
|
2925
2938
|
if (sofType === "donations" || sofType === "inheritance") {
|
|
2926
|
-
|
|
2927
|
-
|
|
2939
|
+
try {
|
|
2940
|
+
sofPayload.originatorLegalEntityId = await createOrUpdateOriginator(additionalData);
|
|
2941
|
+
} catch (e) {
|
|
2942
|
+
setSofErrorMessage(e?.message || i18n.get("errorUpdatingSourceOfFunds"));
|
|
2943
|
+
logger.log("Error updating source of funds", e);
|
|
2944
|
+
}
|
|
2945
|
+
eventsAdditionalData.originatorType = additionalData?.originatorType ?? "";
|
|
2928
2946
|
}
|
|
2929
2947
|
if (sofType === "thirdPartyFunding") {
|
|
2930
|
-
eventsAdditionalData.financiers = `${
|
|
2948
|
+
eventsAdditionalData.financiers = `${additionalData?.financiers?.length || 0} investor(s)`;
|
|
2931
2949
|
}
|
|
2932
2950
|
const sofMutationPayload = {
|
|
2933
2951
|
...sofPayload,
|
|
@@ -2945,13 +2963,14 @@ function SourceOfFundsDropin({
|
|
|
2945
2963
|
setActiveSourceOfFund({});
|
|
2946
2964
|
gotoFormByFormIndex(0);
|
|
2947
2965
|
setSofErrorMessage("");
|
|
2948
|
-
|
|
2966
|
+
showToast({ label: i18n.get("successAddedFundingSources"), variant: "success" });
|
|
2967
|
+
handleHomeClick?.();
|
|
2949
2968
|
} catch (e) {
|
|
2950
|
-
setSofErrorMessage(
|
|
2969
|
+
setSofErrorMessage(e?.message || i18n.get("errorUpdatingSourceOfFunds"));
|
|
2951
2970
|
logger.log("Error updating source of funds", e);
|
|
2952
2971
|
}
|
|
2953
2972
|
setLoadingStatus("success");
|
|
2954
|
-
}, [currentState
|
|
2973
|
+
}, [currentState?.data, handleHomeClick]);
|
|
2955
2974
|
const handleGettingStarted = useCallback(() => {
|
|
2956
2975
|
setGettingStarted(!gettingStarted);
|
|
2957
2976
|
}, [gettingStarted]);
|
|
@@ -2984,14 +3003,14 @@ function SourceOfFundsDropin({
|
|
|
2984
3003
|
const handleNavigateToUploadPage = () => {
|
|
2985
3004
|
setShowUploadPage(true);
|
|
2986
3005
|
};
|
|
2987
|
-
return /* @__PURE__ */ jsx("div", { className: styles.sourceOfFunds, children: loading || isLoadingRootLegalEntity ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3006
|
+
return /* @__PURE__ */ jsx("div", { className: styles.sourceOfFunds, children: loading || isLoadingRootLegalEntity || isLoadingBusinessLines || areLegalEntitiesLoading ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2988
3007
|
gettingStarted && !showUploadPage && legalEntity && /* @__PURE__ */ jsx(
|
|
2989
3008
|
SourceOfFundsGettingStarted,
|
|
2990
3009
|
{
|
|
2991
3010
|
handleCancelClick: handleHomeClick,
|
|
2992
3011
|
handleGettingStartedClick: handleGettingStarted,
|
|
2993
3012
|
businessLines: allBusinessLines,
|
|
2994
|
-
problems: legalEntity
|
|
3013
|
+
problems: legalEntity?.problems,
|
|
2995
3014
|
handleSourceOfFundsClick,
|
|
2996
3015
|
handleNavigateToUploadPage,
|
|
2997
3016
|
legalEntity,
|
|
@@ -3032,7 +3051,7 @@ function SourceOfFundsDropin({
|
|
|
3032
3051
|
activeForm,
|
|
3033
3052
|
shouldValidate,
|
|
3034
3053
|
activeBusinessLine,
|
|
3035
|
-
sourceOfFundsType:
|
|
3054
|
+
sourceOfFundsType: currentState?.data?.sourceOfFundsType?.type,
|
|
3036
3055
|
ref: formRef,
|
|
3037
3056
|
data: activeSourceOfFund
|
|
3038
3057
|
}
|