@adyen/kyc-components 3.83.0 → 3.85.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcceptTermsOfServiceComponent-DuGvxDCD.js → AcceptTermsOfServiceComponent-BW8S5c-F.js} +23 -20
- package/dist/Accordion-CxXXx4Ly.js +88 -0
- package/dist/{AccountSetupRejected-WRvC8Lhx.js → AccountSetupRejected-B0RVdTUw.js} +6 -6
- package/dist/{Address-DzNHaLQd.js → Address-BBHj9Aas.js} +10 -10
- package/dist/{Alert-Ce3pDSUY.js → Alert-Dz_jjJ1E.js} +3 -75
- package/dist/{Avatar-ERL8LlcN.js → Avatar-CCed5bJE.js} +2 -2
- package/dist/{BusinessDetailsDropin-CdWljVO6.js → BusinessDetailsMultiformDropin-B7HHvJeq.js} +2288 -272
- package/dist/BusinessFinancingComponent-D9cn6vVF.js +54 -0
- package/dist/{BusinessFinancingDropin-R940kp66.js → BusinessFinancingDropin-CCci5zHD.js} +185 -125
- package/dist/BusinessFinancingPage-DuRkxp4x.js +46 -0
- package/dist/{BusinessTypeSelectionPage-Dn1P9vc8.js → BusinessTypeSelectionPage-CQvrZNZZ.js} +12 -12
- package/dist/{Card-Cma0bwYR.js → Card-dFm_Z3TI.js} +6 -4
- package/dist/{CountryField-DrB-OFMR.js → CountryField-DunKeW_n.js} +220 -235
- package/dist/CreateIndividualComponent-wFiOsvgz.js +71 -0
- package/dist/CreateTransferInstrumentComponent-B_fQXq70.js +66 -0
- package/dist/{Currency-DD63TDvu.js → Currency-2wpP-9m3.js} +6 -6
- package/dist/{CustomerSupport-Cs9YbnBI.js → CustomerSupport-DyfNEq22.js} +11 -10
- package/dist/{DebugModal-AFNn6VI2.js → DebugModal-BMw5O5pH.js} +128 -42
- package/dist/{DecisionMakerDetailsPage-CUAalT7g.js → DecisionMakerDetailsPage-D-8hNnWf.js} +16 -10
- package/dist/DecisionMakers-DUjAziKs.js +831 -0
- package/dist/Divider-Ckm8Nfyb.js +239 -0
- package/dist/{Dropzone-DXfuqm2D.js → Dropzone-BtTUNjsc.js} +4 -4
- package/dist/{EmbeddedStatus-BjGURjyl.js → EmbeddedStatus-kQRIlMAC.js} +15 -16
- package/dist/{EndStateLayout-BuVgF0ER.js → EndStateLayout-CePzY6oB.js} +2 -2
- package/dist/{FormNavigation-DXaxaf1-.js → FormNavigation-a9y0a0iw.js} +3 -3
- package/dist/Image-TkXLA-UY.js +22 -0
- package/dist/{IndividualOnfidoDropin-fERsTakw.js → IndividualOnfidoDropin-CljBpKM8.js} +256 -401
- package/dist/{InputDate-By5i2Hlf.js → InputDate-DggMbeJG.js} +2 -2
- package/dist/{InputText-CqLs_M75.js → InputText-zem7Kt4i.js} +4 -7
- package/dist/{Introduction-3UWByITz.js → Introduction-DH4Tivyl.js} +4 -5
- package/dist/{JpAddress-C0iTeXx7.js → JpAddress-BEKjE0bR.js} +27 -10
- package/dist/LandingLayout-BLjTVlVb.js +60 -0
- package/dist/{LegalRepresentativeDetailsPage-DSppGGc6.js → LegalRepresentativeDetailsPage-Dny2mD-G.js} +5 -6
- package/dist/{Link-CaxhkJ24.js → Link-BZJgg2rS.js} +2 -2
- package/dist/ListItem-BqBZ36Qn.js +69 -0
- package/dist/ManageIndividualComponent-CHbI_tji.js +46 -0
- package/dist/ManageTermsOfServiceComponent-Dwsmig7o.js +58 -0
- package/dist/{ManageTransferInstrumentComponent-muOE0ZjV.js → ManageTransferInstrumentComponent-Btz3RWc6.js} +17 -17
- package/dist/{MaskedInput-OYLtVOZ6.js → MaskedInput-CSKFmTC0.js} +6 -6
- package/dist/MaybeModal-DraEs2gj.js +25 -0
- package/dist/{Modal-BaaNj5F-.js → Modal-DvB1odWq.js} +2 -2
- package/dist/OnboardingDropinComponent-KKy3000L.js +4274 -0
- package/dist/{PayoutDetailsDropin-DIJbRfg_.js → PayoutDetailsDropin-BFUH8RvF.js} +324 -97
- package/dist/RadioGroup-Br5v8w0a.js +144 -0
- package/dist/{RegistrationAddress-CbElOOZ6.js → RegistrationAddress-CP_kZ9NI.js} +39 -42
- package/dist/{Review-1Y__iPB0.js → Review-4b9BWdsh.js} +9 -8
- package/dist/RootBusinessDetailsPage-DO5202Yd.js +61 -0
- package/dist/{OnboardingDropinComponent-DIf93Tzb.js → RootBusinessLinesPage-D0tGN2u3.js} +866 -5062
- package/dist/{RootIndividualDetailsPage-BVr2fbYb.js → RootIndividualDetailsPage-2c_nvpAv.js} +5 -6
- package/dist/{SignPCIComponent-BcR2vNVB.js → SignPCIComponent-4UrP4tNd.js} +12 -11
- package/dist/{SingpassSelection-DDG-DpRN.js → SingpassSelection-DTOk81Y1.js} +11 -10
- package/dist/SoleProprietorshipPage-BL3u4nCi.js +60 -0
- package/dist/{SourceOfFundsPage-DF3muJcW.js → SourceOfFundsPage-HgGh-VDQ.js} +43 -65
- package/dist/{StepProgressIndicator-BUDjmmPK.js → StepProgressIndicator-sfM13J_b.js} +2 -2
- package/dist/{StoreProvider-DGxWcgrS.js → StoreProvider-DadhkEyO.js} +660 -195
- package/dist/{TaskItemStatus-Clfh9v2q.js → TaskItemStatus-DuJ01Ng6.js} +3 -14
- package/dist/{TaxInformationField-Bu8s2JZA.js → TaxInformationField-C4OeLAhU.js} +34 -31
- package/dist/{TaxReportingDropin-C1aPbXfp.js → TaxReportingDropin-2VcdfJvr.js} +64 -56
- package/dist/{TileGroup-AskMVW9b.js → TileGroup-B_9rid7_.js} +4 -4
- package/dist/{TrustDetailsPage-S0YwnBAx.js → TrustDetailsPage-COIeKAk2.js} +53 -44
- package/dist/TrustMemberCompanyPage-CwNG1bni.js +73 -0
- package/dist/TrustMemberIndividualPage-D57poDUv.js +66 -0
- package/dist/{UnincorporatedPartnershipIndividualPage-B_fmnaes.js → UnincorporatedPartnershipIndividualPage-oiEGWL8D.js} +5 -6
- package/dist/UnincorporatedPartnershipMemberCompanyPage-av-gOgOa.js +76 -0
- package/dist/{ViewVerificationStatusComponent-CivzRszd.js → ViewVerificationStatusComponent-Zk6t-F6h.js} +19 -13
- package/dist/adyen-business-financing.js +4 -5
- package/dist/adyen-individual-configuration.js +4 -5
- package/dist/adyen-individual-status.js +4 -5
- package/dist/adyen-kyc-components.js +39 -29
- package/dist/adyen-onboarding.js +4 -5
- package/dist/adyen-terms-of-service-management.js +4 -5
- package/dist/adyen-terms-of-service-status.js +4 -5
- package/dist/adyen-transfer-instrument-configuration.js +4 -5
- package/dist/adyen-transfer-instrument-management.js +4 -5
- package/dist/adyen-verification-status.js +4 -5
- package/dist/analytics-awjVudvY.js +123 -0
- package/dist/{bafinUtils-BJao1Xb_.js → bafinUtils-CAVAvSFg.js} +8 -99
- package/dist/bg-BG-BIOMFPaW.js +27 -0
- package/dist/bg-BG-BLe6BCNz.js +13 -0
- package/dist/bg-BG-BPsOhDfg.js +13 -0
- package/dist/bg-BG-BvLl6gaB.js +13 -0
- package/dist/bg-BG-CepHap8j.js +68 -0
- package/dist/bg-BG-Coja327N.js +24 -0
- package/dist/{bg-BG-GVhnrvRn.js → bg-BG-Cs_1PU3v.js} +5 -1
- package/dist/bg-BG-D5C7Gq2o.js +35 -0
- package/dist/bg-BG-DcxZ1tmt.js +32 -0
- package/dist/{bg-BG-Bot37sd7.js → bg-BG-Dp4LxSP7.js} +2 -1
- package/dist/bg-BG-er0t4jTs.js +27 -0
- package/dist/bg-BG-fr-xfUBV.js +110 -0
- package/dist/{bg-BG-fgdGvtqa.js → bg-BG-z3gZQvGq.js} +6 -1
- package/dist/commonValidators-DM04eNpa.js +24 -0
- package/dist/{cs-CZ-CVpbQMSY.js → cs-CZ-B2WAqmaW.js} +9 -1
- package/dist/cs-CZ-BP7niQM9.js +68 -0
- package/dist/cs-CZ-C0sNB1Fm.js +110 -0
- package/dist/{cs-CZ-DwiXbzIv.js → cs-CZ-C5lyVYlZ.js} +6 -1
- package/dist/cs-CZ-C9FuJCsg.js +35 -0
- package/dist/cs-CZ-CHzJM-ii.js +13 -0
- package/dist/cs-CZ-CQNBae2b.js +27 -0
- package/dist/{cs-CZ-BEynVkgn.js → cs-CZ-CyLqoG1j.js} +2 -1
- package/dist/cs-CZ-D4Hg-t16.js +32 -0
- package/dist/cs-CZ-DNWTRefA.js +27 -0
- package/dist/cs-CZ-DXtJsBPz.js +24 -0
- package/dist/cs-CZ-hT5w5It6.js +13 -0
- package/dist/cs-CZ-xoLsda7i.js +13 -0
- package/dist/da-DK-8dk9Q_Wk.js +110 -0
- package/dist/da-DK-BeSNTO9k.js +35 -0
- package/dist/{da-DK-Y6PJ69rt.js → da-DK-CYl2jko-.js} +6 -1
- package/dist/da-DK-D-PlwKvZ.js +27 -0
- package/dist/da-DK-D-TJghBi.js +13 -0
- package/dist/{da-DK-DLcvdXDS.js → da-DK-D-eeokQn.js} +9 -1
- package/dist/da-DK-DCJhV2qS.js +32 -0
- package/dist/da-DK-DWA8uOd8.js +24 -0
- package/dist/{da-DK-DmL_Ja3L.js → da-DK-DYpfNZdP.js} +2 -1
- package/dist/da-DK-DZwlENGe.js +13 -0
- package/dist/da-DK-Dc0QYG8m.js +68 -0
- package/dist/da-DK-XNMYSp7w.js +13 -0
- package/dist/da-DK-gnPgzwrG.js +27 -0
- package/dist/de-DE-4GAd_srm.js +27 -0
- package/dist/de-DE-BI7AAdOv.js +13 -0
- package/dist/{de-DE-BahIk-1-.js → de-DE-BXt1K0Tr.js} +2 -1
- package/dist/de-DE-CCmlaL2F.js +13 -0
- package/dist/de-DE-CCyKie8B.js +110 -0
- package/dist/de-DE-D3lLuF8z.js +27 -0
- package/dist/de-DE-D50lGOJE.js +24 -0
- package/dist/de-DE-DXR3EpEc.js +13 -0
- package/dist/{de-DE-CKZrABo7.js → de-DE-Dcs3W1fT.js} +9 -1
- package/dist/{de-DE-xdQMmrrt.js → de-DE-DlUEkik0.js} +6 -1
- package/dist/de-DE-Dp-2BAWQ.js +35 -0
- package/dist/de-DE-DwOQKCuU.js +32 -0
- package/dist/de-DE-Dz2OsS1F.js +68 -0
- package/dist/{hr-HR-CNzbyo9r.js → debugStore-BvbyN1Oi.js} +4 -5
- package/dist/dropinUtils-wWEQXoqU.js +196 -0
- package/dist/el-GR-5WvkRyW5.js +35 -0
- package/dist/{el-GR-TZUpX1j3.js → el-GR-B90M6tcZ.js} +2 -1
- package/dist/el-GR-BHG69mXl.js +68 -0
- package/dist/el-GR-CKHMsdx2.js +24 -0
- package/dist/el-GR-D7zMcBtK.js +110 -0
- package/dist/{el-GR-C_y2406P.js → el-GR-DBum-QDu.js} +9 -1
- package/dist/{el-GR-DR_5DKI1.js → el-GR-DZ8GheJK.js} +6 -1
- package/dist/el-GR-Ddnh0NhQ.js +27 -0
- package/dist/el-GR-DoCIcce-.js +13 -0
- package/dist/el-GR-DtFE64KX.js +13 -0
- package/dist/el-GR-Hk4NbZSY.js +32 -0
- package/dist/el-GR-XRux2Wpv.js +27 -0
- package/dist/el-GR-kYiInIQ9.js +13 -0
- package/dist/en-US-B96dpVon.js +27 -0
- package/dist/{en-US-DI1dH0ZB.js → en-US-BCFNoF5y.js} +5 -1
- package/dist/en-US-BQZhzROc.js +32 -0
- package/dist/en-US-BwDZ0WHW.js +110 -0
- package/dist/{en-US-DIdQJky-.js → en-US-CzEL6t1W.js} +24 -4
- package/dist/en-US-D-B35AoN.js +68 -0
- package/dist/en-US-D2yrwtzT.js +24 -0
- package/dist/en-US-DYpvuCLO.js +13 -0
- package/dist/{en-US-nL0-_PSp.js → en-US-DdeSoN_2.js} +2 -1
- package/dist/{en-US-BbAzROHT.js → en-US-Dg505Oh3.js} +2 -1
- package/dist/{en-US-BQpgt41j.js → en-US-DjF6iC7G.js} +17 -1
- package/dist/es-ES-BI_jdT67.js +68 -0
- package/dist/es-ES-BOoPqnPI.js +32 -0
- package/dist/{es-ES-BPDeEYGv.js → es-ES-BhNhIf08.js} +2 -1
- package/dist/es-ES-C4lENXHH.js +27 -0
- package/dist/{es-ES-DdT2wJTP.js → es-ES-C7XjLOHi.js} +9 -1
- package/dist/es-ES-C9oDOVSQ.js +35 -0
- package/dist/es-ES-CJMsyMAc.js +13 -0
- package/dist/es-ES-CXDJLKAI.js +27 -0
- package/dist/es-ES-CnNU6AJv.js +13 -0
- package/dist/{es-ES-keMO-LlU.js → es-ES-D0c0MoqK.js} +6 -1
- package/dist/es-ES-DF_L5EDd.js +24 -0
- package/dist/es-ES-JvAvmB2A.js +110 -0
- package/dist/es-ES-yMXcOjDL.js +13 -0
- package/dist/et-EE--cL_YqWe.js +27 -0
- package/dist/et-EE-3EQr-1cj.js +27 -0
- package/dist/et-EE-B1KmQWmI.js +35 -0
- package/dist/{et-EE-DftDBzjA.js → et-EE-BMgFCxds.js} +2 -1
- package/dist/et-EE-BR4OXRfV.js +13 -0
- package/dist/{et-EE-Y890kc89.js → et-EE-BUG05EDz.js} +9 -1
- package/dist/et-EE-Be__VK7Y.js +32 -0
- package/dist/et-EE-BuBiNLCi.js +24 -0
- package/dist/{et-EE-CLuAFAri.js → et-EE-C4Fwyr7-.js} +6 -1
- package/dist/et-EE-C8RrUpLm.js +13 -0
- package/dist/et-EE-C_PZO2aI.js +68 -0
- package/dist/et-EE-SJf3_Ega.js +110 -0
- package/dist/et-EE-sB7wkSA3.js +13 -0
- package/dist/fi-FI-BbqwYcLI.js +13 -0
- package/dist/fi-FI-Byvvcxxq.js +27 -0
- package/dist/{fi-FI-DKxJM0k6.js → fi-FI-CEzjKgiz.js} +9 -1
- package/dist/fi-FI-Cy2hAl0B.js +110 -0
- package/dist/fi-FI-DH6jpo9K.js +24 -0
- package/dist/fi-FI-DV1etLPT.js +35 -0
- package/dist/{fi-FI-CBHr-_To.js → fi-FI-bRXb-Q_i.js} +6 -1
- package/dist/fi-FI-bZzNB1WB.js +32 -0
- package/dist/fi-FI-fArobrt5.js +27 -0
- package/dist/fi-FI-hwzizPnr.js +68 -0
- package/dist/fi-FI-u5GxMZsq.js +13 -0
- package/dist/fi-FI-xqnQ38yC.js +13 -0
- package/dist/{fi-FI-LpkpSl5X.js → fi-FI-ysUrBilO.js} +2 -1
- package/dist/{fieldConfigurations-BzmPcPW1.js → fieldConfigurations-BZuo2e0d.js} +16 -313
- package/dist/{pl-PL-D6heiKsH.js → form-rules-DhbF2mY4.js} +3 -5
- package/dist/{fr-FR-CuSchzjE.js → fr-FR-BSvSKazD.js} +2 -1
- package/dist/fr-FR-BSynpexF.js +13 -0
- package/dist/fr-FR-BmW46mYd.js +110 -0
- package/dist/fr-FR-BnblnBsx.js +24 -0
- package/dist/fr-FR-CMjrAkKl.js +13 -0
- package/dist/fr-FR-CYZXbwc9.js +68 -0
- package/dist/fr-FR-CiwkAb3E.js +27 -0
- package/dist/fr-FR-Cr-Y1vIy.js +13 -0
- package/dist/{fr-FR-BxO1IR9C.js → fr-FR-DNJiLv9b.js} +9 -1
- package/dist/fr-FR-DZICoAHV.js +35 -0
- package/dist/fr-FR-E_UubsZ-.js +27 -0
- package/dist/{fr-FR-B3qQW3oG.js → fr-FR-JLPKgufm.js} +6 -1
- package/dist/fr-FR-cTKcuHqX.js +32 -0
- package/dist/{getName-DN1hhEuf.js → getName-DwJ2SEhe.js} +2 -2
- package/dist/{hasDataChanged-Di3pJ9RD.js → hasDataChanged-qmdT2J_a.js} +2 -2
- package/dist/{hr-HR-DST-QbRI.js → hr-HR-BLpGb4f2.js} +2 -1
- package/dist/hr-HR-Bhsop3CT.js +13 -0
- package/dist/hr-HR-ComCqan_.js +32 -0
- package/dist/{hr-HR-DMV2OsPs.js → hr-HR-D26Gz-HL.js} +6 -1
- package/dist/hr-HR-D5V7g9H2.js +13 -0
- package/dist/hr-HR-D8cBxUFa.js +13 -0
- package/dist/hr-HR-D9bzCN_d.js +35 -0
- package/dist/hr-HR-De5kHU8U.js +24 -0
- package/dist/hr-HR-DtfHQVe0.js +27 -0
- package/dist/hr-HR-TVOgDkBf.js +27 -0
- package/dist/{hr-HR-DghVS0jH.js → hr-HR-WMnlxMEY.js} +9 -1
- package/dist/hr-HR-bE6cvRCQ.js +68 -0
- package/dist/hr-HR-c1Si_0s4.js +110 -0
- package/dist/{hu-HU-CJh8OY-w.js → hu-HU-B2nrl0pw.js} +9 -1
- package/dist/hu-HU-BVfkOdJe.js +13 -0
- package/dist/{hu-HU-CPWGnq22.js → hu-HU-BZCFneWx.js} +6 -1
- package/dist/hu-HU-BcogZby3.js +24 -0
- package/dist/hu-HU-C5p7RWWD.js +35 -0
- package/dist/{hu-HU-BgHugMwG.js → hu-HU-Ca9Hex26.js} +2 -1
- package/dist/hu-HU-CibGC8KY.js +110 -0
- package/dist/hu-HU-D2j1ISVk.js +13 -0
- package/dist/hu-HU-DG-NUDx4.js +68 -0
- package/dist/hu-HU-DRONW_47.js +27 -0
- package/dist/hu-HU-DUGz5q5D.js +32 -0
- package/dist/hu-HU-I4-KFzvz.js +27 -0
- package/dist/hu-HU-hbVM6tMS.js +13 -0
- package/dist/{iframeWidget-CdgdGJSA.js → iframeWidget-Bdf5GkVq.js} +4 -4
- package/dist/{isEmpty-Cg1sEY56.js → isEmpty-DWL1114W.js} +2 -2
- package/dist/it-IT-BMjuva_2.js +110 -0
- package/dist/{it-IT-vJt2CGXz.js → it-IT-BRmX2jEi.js} +9 -1
- package/dist/it-IT-C7Sg1k4p.js +13 -0
- package/dist/it-IT-C_651bEP.js +13 -0
- package/dist/it-IT-Ckv8Ce4e.js +24 -0
- package/dist/it-IT-CwA8megO.js +13 -0
- package/dist/it-IT-DERflsUd.js +32 -0
- package/dist/it-IT-DIbH-udG.js +27 -0
- package/dist/it-IT-DuBLJIdz.js +27 -0
- package/dist/it-IT-Erh1DIlj.js +68 -0
- package/dist/{it-IT-p_DER3dq.js → it-IT-Qfzc8jnW.js} +2 -1
- package/dist/{it-IT-CRmaykgQ.js → it-IT-mScKLwBR.js} +6 -1
- package/dist/it-IT-mYyg3XGz.js +35 -0
- package/dist/ja-JP-BSYrPZsE.js +35 -0
- package/dist/ja-JP-BoxeBgOv.js +32 -0
- package/dist/{ja-JP-DT0qGp0i.js → ja-JP-CCnzjx-u.js} +32 -2
- package/dist/{ja-JP-C870wgmw.js → ja-JP-CHQ64lw1.js} +2 -1
- package/dist/ja-JP-CJ_j_HAA.js +27 -0
- package/dist/ja-JP-Cr_qjpZ2.js +110 -0
- package/dist/{ja-JP-a6UbRzaS.js → ja-JP-CvNJvxkQ.js} +22 -3
- package/dist/{ja-JP-DCOsVkrk.js → ja-JP-DyELKS9Q.js} +6 -1
- package/dist/ja-JP-FWHXsXlW.js +24 -0
- package/dist/ja-JP-GSbqID7o.js +13 -0
- package/dist/ja-JP-ThzG9vIo.js +68 -0
- package/dist/ja-JP-bz7ekGnF.js +27 -0
- package/dist/{ja-JP-Cm2wakN6.js → ja-JP-gRRH8Eph.js} +21 -13
- package/dist/jpAddressSchema-ULGNNt5U.js +27 -0
- package/dist/{localizeDateString-CjJb5ip4.js → localizeDateString--iXm1oBl.js} +1 -1
- package/dist/{lt-LT-Dxde15Cc.js → lt-LT-0RKZeraM.js} +2 -1
- package/dist/{lt-LT-CrCYV_jv.js → lt-LT-BJQDUanx.js} +9 -1
- package/dist/lt-LT-BLsIcCtE.js +27 -0
- package/dist/lt-LT-C5nNCk4_.js +13 -0
- package/dist/lt-LT-CBBDNCnp.js +27 -0
- package/dist/{lt-LT-0CK0Iin7.js → lt-LT-CLPQVRpJ.js} +6 -1
- package/dist/lt-LT-Ci357QYQ.js +13 -0
- package/dist/lt-LT-D5Rhxm1h.js +32 -0
- package/dist/lt-LT-DDdq07sX.js +24 -0
- package/dist/lt-LT-DSiutpRl.js +13 -0
- package/dist/lt-LT-DjNjg3Pl.js +110 -0
- package/dist/lt-LT-Nd1uRoIj.js +68 -0
- package/dist/lt-LT-i-T_HQ42.js +35 -0
- package/dist/{lv-LV-DDvnyHlO.js → lv-LV-Bh-WQp0K.js} +2 -1
- package/dist/lv-LV-BpRfRfMz.js +110 -0
- package/dist/lv-LV-BtX12dHJ.js +35 -0
- package/dist/lv-LV-C62XiDE5.js +13 -0
- package/dist/lv-LV-C7hMdPcY.js +27 -0
- package/dist/lv-LV-CEK8Re4d.js +13 -0
- package/dist/lv-LV-CG1zToz7.js +32 -0
- package/dist/lv-LV-CkyuY2ji.js +24 -0
- package/dist/lv-LV-CtIe38WU.js +27 -0
- package/dist/{lv-LV-CSxppAD_.js → lv-LV-Cu-MJMVO.js} +6 -1
- package/dist/lv-LV-DKhV24CI.js +68 -0
- package/dist/lv-LV-Dxe-A5vo.js +13 -0
- package/dist/{lv-LV-CaFrxG3S.js → lv-LV-h3nTokkM.js} +9 -1
- package/dist/mapAddressLocalizationToJpAddressSchema-vJWbpAyq.js +56 -0
- package/dist/{mapExistingFile-Dww-3m9M.js → mapExistingFile-Ct5Drm_t.js} +4 -4
- package/dist/mapJpAddressSchemaToAddressLocalizations-Btg-uZPu.js +147 -0
- package/dist/mapLegalEntityToIndividualOnfidoSchema-DQsaMiqB.js +203 -0
- package/dist/{mapTransferInstrumentToPayoutAccount-NoTqg5NI.js → mapTransferInstrumentToPayoutAccount-CRhSOuJd.js} +6 -3
- package/dist/nl-NL-BOJ6zuBr.js +13 -0
- package/dist/nl-NL-Bx5p0nXL.js +24 -0
- package/dist/nl-NL-CE4l8R5l.js +27 -0
- package/dist/nl-NL-Cjlmc0Ii.js +32 -0
- package/dist/{nl-NL-Uf_myU_8.js → nl-NL-D7gBNWEY.js} +2 -1
- package/dist/nl-NL-DOQPxTX-.js +13 -0
- package/dist/nl-NL-JChnFdCY.js +13 -0
- package/dist/nl-NL-NlkjOSYi.js +27 -0
- package/dist/nl-NL-O9GCHMDA.js +68 -0
- package/dist/nl-NL-PUQGh3Rp.js +35 -0
- package/dist/{nl-NL-BQJjhn7U.js → nl-NL-YzDSCWLL.js} +9 -1
- package/dist/nl-NL-oaBDOlm6.js +110 -0
- package/dist/{nl-NL-RfK34nkp.js → nl-NL-pVdpCCOx.js} +6 -1
- package/dist/no-NO--OoWld_l.js +13 -0
- package/dist/no-NO-B1_YJlMP.js +27 -0
- package/dist/no-NO-BTrfxWS7.js +110 -0
- package/dist/{no-NO-CSia2Bd5.js → no-NO-Big2B13b.js} +9 -1
- package/dist/no-NO-Bs3-6MDM.js +24 -0
- package/dist/{no-NO-DZ1y_9mq.js → no-NO-C-gCYc9q.js} +2 -1
- package/dist/no-NO-CA1aR6Wh.js +68 -0
- package/dist/{no-NO-BWzGost-.js → no-NO-CRULNwNn.js} +6 -1
- package/dist/no-NO-CY_XHrYd.js +32 -0
- package/dist/no-NO-Cp3-tDMw.js +13 -0
- package/dist/no-NO-Crlsj6HG.js +27 -0
- package/dist/no-NO-CuwTDFSf.js +13 -0
- package/dist/no-NO-kPnbGnBM.js +35 -0
- package/dist/pl-PL-1-MrLPXu.js +13 -0
- package/dist/pl-PL-BKDK0_G8.js +68 -0
- package/dist/pl-PL-BzhEoDb5.js +24 -0
- package/dist/pl-PL-C-MmQaeR.js +35 -0
- package/dist/pl-PL-C72GTDxW.js +110 -0
- package/dist/{pl-PL-6WyUmy0K.js → pl-PL-CL483jMb.js} +9 -1
- package/dist/pl-PL-C_MvVzPy.js +32 -0
- package/dist/pl-PL-CtDHmbhp.js +13 -0
- package/dist/{pl-PL-DFrOIiCG.js → pl-PL-CxCiWdAF.js} +6 -1
- package/dist/pl-PL-DGYFY42P.js +27 -0
- package/dist/pl-PL-DYxD6VJ_.js +27 -0
- package/dist/pl-PL-DtJ3sgVO.js +13 -0
- package/dist/{pl-PL-B1tVRX3A.js → pl-PL-LnVPufjb.js} +2 -1
- package/dist/process-field-configurations-B1Iwtpx2.js +304 -0
- package/dist/pt-BR-BfxgHKY4.js +27 -0
- package/dist/pt-BR-Br_cHzGx.js +13 -0
- package/dist/pt-BR-C0I_kTQ6.js +13 -0
- package/dist/pt-BR-CBAe0SnK.js +32 -0
- package/dist/pt-BR-Co8OqKh-.js +27 -0
- package/dist/pt-BR-CtFCi7U4.js +110 -0
- package/dist/pt-BR-DJOzf0y2.js +53 -0
- package/dist/pt-BR-DSENwwGu.js +24 -0
- package/dist/pt-BR-DnKEuslh.js +13 -0
- package/dist/pt-BR-Dw0UZ-Od.js +35 -0
- package/dist/pt-BR-NtLaWlnZ.js +68 -0
- package/dist/{pt-BR-CxjlToN4.js → pt-BR-apPtB2cK.js} +6 -1
- package/dist/{pt-BR-BD3-Ecm8.js → pt-BR-ur86nRrK.js} +2 -1
- package/dist/{pt-PT-CWYxqUbN.js → pt-PT-B3qoJ3Fr.js} +9 -1
- package/dist/pt-PT-Bf4IV7wp.js +13 -0
- package/dist/pt-PT-CIo3mlXL.js +24 -0
- package/dist/pt-PT-CLwCij2I.js +13 -0
- package/dist/{pt-PT-DpBfkgVw.js → pt-PT-CVNEcs32.js} +2 -1
- package/dist/{pt-PT-CU13UUwT.js → pt-PT-Coa6J7SM.js} +6 -1
- package/dist/pt-PT-DSxxVA0f.js +68 -0
- package/dist/pt-PT-DfVjLaAU.js +35 -0
- package/dist/pt-PT-Dm5DRDrd.js +32 -0
- package/dist/pt-PT-TKg5FLat.js +27 -0
- package/dist/pt-PT-XAn7WGle.js +110 -0
- package/dist/pt-PT-cjbtYBUX.js +13 -0
- package/dist/pt-PT-pKLoM66X.js +27 -0
- package/dist/resolveEnvironment-DC9P7X3D.js +164 -0
- package/dist/ro-RO-3rOfS17N.js +27 -0
- package/dist/ro-RO-4j2I7YM7.js +13 -0
- package/dist/ro-RO-B5YT9vP-.js +32 -0
- package/dist/{ro-RO-B2u2q1Ez.js → ro-RO-BTqq5BPM.js} +6 -1
- package/dist/ro-RO-Bybq8JFn.js +68 -0
- package/dist/ro-RO-CGhIjlpU.js +13 -0
- package/dist/ro-RO-Cmk-sVDr.js +13 -0
- package/dist/{ro-RO-BWQeseQ_.js → ro-RO-Ct_BJvsc.js} +9 -1
- package/dist/ro-RO-D3rQ93wa.js +27 -0
- package/dist/ro-RO-ECJHARCT.js +35 -0
- package/dist/ro-RO-ILTvlS9i.js +24 -0
- package/dist/{ro-RO-BF1Q86nQ.js → ro-RO-i7lojG2G.js} +2 -1
- package/dist/ro-RO-qX8X1Q1m.js +110 -0
- package/dist/{rules-4TEUMKya.js → rules-CzXw9tws.js} +10 -6
- package/dist/{sk-SK-Rd06VJ5k.js → sk-SK-B5brxU1N.js} +2 -1
- package/dist/sk-SK-Bo5nvxWQ.js +13 -0
- package/dist/sk-SK-C5Qmv4E6.js +13 -0
- package/dist/sk-SK-C6rMIxpz.js +68 -0
- package/dist/sk-SK-CjdK4BKW.js +110 -0
- package/dist/sk-SK-CjrLvDMx.js +27 -0
- package/dist/sk-SK-CmH1I1tp.js +27 -0
- package/dist/sk-SK-Cv23cDQO.js +24 -0
- package/dist/sk-SK-Do6CKNU4.js +13 -0
- package/dist/{sk-SK-DnNuh37c.js → sk-SK-FGK1FMMO.js} +9 -1
- package/dist/sk-SK-S6iF1WDH.js +32 -0
- package/dist/sk-SK-rSmwmSCa.js +35 -0
- package/dist/{sk-SK-BWA3fAcI.js → sk-SK-welR06By.js} +6 -1
- package/dist/{sl-SI-B7zbwoZn.js → sl-SI-B9N6vA08.js} +6 -1
- package/dist/sl-SI-BZpXMHiG.js +13 -0
- package/dist/sl-SI-C-C-KJCX.js +27 -0
- package/dist/{sl-SI-BuIFB5zU.js → sl-SI-CUCrzJQv.js} +2 -1
- package/dist/sl-SI-CedEO3kf.js +35 -0
- package/dist/sl-SI-CrTRlNnN.js +13 -0
- package/dist/{sl-SI-D212isFw.js → sl-SI-Cz28AFTz.js} +9 -1
- package/dist/sl-SI-DEaeEVKB.js +24 -0
- package/dist/sl-SI-DqUEy_Cm.js +32 -0
- package/dist/sl-SI-cY-L2ma-.js +13 -0
- package/dist/sl-SI-hnlbW1OT.js +27 -0
- package/dist/sl-SI-lPxRRPsh.js +110 -0
- package/dist/sl-SI-tPwbFvOI.js +68 -0
- package/dist/style.css +696 -597
- package/dist/styles-CLV89_hH.js +696 -597
- package/dist/sv-SE-7Cbo1oic.js +27 -0
- package/dist/sv-SE-BHfydid5.js +27 -0
- package/dist/sv-SE-BPpQ-05i.js +110 -0
- package/dist/sv-SE-BYUoi-08.js +35 -0
- package/dist/sv-SE-BtwPrLEA.js +13 -0
- package/dist/{sv-SE-BwJgkIDf.js → sv-SE-C6uPh9g5.js} +2 -1
- package/dist/sv-SE-CRBRuE8Z.js +32 -0
- package/dist/sv-SE-CXaMlJCI.js +24 -0
- package/dist/{sv-SE-Hi07uLM9.js → sv-SE-D6al0j6W.js} +6 -1
- package/dist/{sv-SE-Ca1bxZf3.js → sv-SE-DLl7OGxl.js} +9 -1
- package/dist/sv-SE-DsPdegWB.js +13 -0
- package/dist/sv-SE-K1QT1cOt.js +68 -0
- package/dist/sv-SE-WPziDPQa.js +13 -0
- package/dist/types/api/businessLines/businessLines.types.d.ts +10 -0
- package/dist/types/api/businessLines/useBusinessLines.d.ts +4 -2
- package/dist/types/api/businessLines/useCreateBusinessLine.d.ts +7 -0
- package/dist/types/api/companySearch/useCompanySearch.d.ts +1 -0
- package/dist/types/api/configurations/useScenarios.d.ts +12 -12
- package/dist/types/api/legalEntity/useLegalEntity.d.ts +16 -16
- package/dist/types/components/BankAccount/fields/BankAccountFormat/types.d.ts +2 -1
- package/dist/types/components/BankAccount/fields/PreferredCurrency/PreferredCurrency.d.ts +10 -0
- package/dist/types/components/BankAccount/forms/PayoutAccount/payoutAccountFormat.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/PayoutAccount/types.d.ts +2 -0
- package/dist/types/components/BankAccount/forms/PayoutCountryDetails/PayoutCountryDetails.d.ts +3 -0
- package/dist/types/components/BankAccount/forms/PayoutCountryDetails/types.d.ts +11 -0
- package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +6 -0
- package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +2 -0
- package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +4 -4
- package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/utils.d.ts +2 -0
- package/dist/types/components/BankAccount/mapping/mapPayoutAccountSchemaToApiBankAccount.d.ts +3 -2
- package/dist/types/components/BankAccount/mapping/mapPayoutDetailsToTransferInstrument.d.ts +2 -1
- package/dist/types/components/BankAccount/mapping/mapTransferInstrumentToPayoutAccount.d.ts +1 -1
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +53 -51
- package/dist/types/components/BankAccount/pages/PayoutDetailsPage.d.ts +1 -1
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +1 -1
- package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +3 -2
- package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +5 -3
- package/dist/types/components/Business/forms/RegistrationDocument/types.d.ts +3 -3
- package/dist/types/components/Business/forms/TaxDocument/types.d.ts +3 -3
- package/dist/types/components/Business/pages/RootBusinessDetailsPage.d.ts +1 -1
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +5 -4
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +2 -3
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +3 -3
- package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiform.d.ts +2 -1
- package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/utils.d.ts +0 -2
- package/dist/types/components/Business/utils/companyTypeMetadata.d.ts +3 -3
- package/dist/types/components/BusinessLines/fields/WebDataField/types.d.ts +2 -4
- package/dist/types/components/BusinessLines/tasks/BusinessLines/ExistingBusinessLines/BusinessLineModal.d.ts +5 -0
- package/dist/types/components/BusinessLines/tasks/BusinessLines/ExistingBusinessLines/ExistingBusinessLines.d.ts +8 -0
- package/dist/types/components/BusinessLines/tasks/utils.d.ts +13 -4
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +151 -151
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBasicCompanyInformation.d.ts +0 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBusinessInformation.d.ts +0 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +0 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingOwnershipStructure.d.ts +0 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingRegisteredAddress.d.ts +0 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +7 -5
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/sofStore.d.ts +1 -1
- package/dist/types/components/EFP/tasks/TaxReportingDropin/taxClassificationStore.d.ts +1 -1
- package/dist/types/components/EFP/tasks/TaxReportingDropin/utils.d.ts +6 -6
- package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/BusinessFinancingComponent.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +3 -3
- package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/content.d.ts +3 -3
- package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +3 -0
- package/dist/types/components/Individual/forms/Individual/IdVerification/idVerificationProviderId.d.ts +1 -1
- package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/idVerificationMethodMetadata.d.ts +3 -3
- package/dist/types/components/Individual/forms/IndividualOnfido/IdNowVerificationModal/isIdNowModalOpen.d.ts +3 -3
- package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaire.types.d.ts +4 -1
- package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaireModalContent.d.ts +3 -1
- package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +2 -2
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.d.ts +1 -1
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +2 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +56 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/RemediationAlerts/RemediationAlerts.d.ts +7 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/RemediationAlerts/remediation.config.d.ts +19 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +3 -0
- package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoStore.d.ts +1 -1
- package/dist/types/components/Shared/EntityAssociation/EntityAssociation.d.ts +1 -1
- package/dist/types/components/Shared/EntityAssociation/types.d.ts +2 -4
- package/dist/types/components/Shared/devex/DebugListener/DebugFormData.d.ts +1 -0
- package/dist/types/components/Shared/devex/DebugListener/debugStore.d.ts +5 -0
- package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +4 -4
- package/dist/types/components/Shared/forms/Address/localized/jp/JpAddress.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/localized/jp/mapAddressLocalizationToJpAddressSchema.d.ts +3 -0
- package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSchemaToAddressLocalizations.d.ts +3 -0
- package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSummary.d.ts +4 -0
- package/dist/types/components/Shared/forms/Address/utils.d.ts +3 -2
- package/dist/types/components/Shared/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +1 -2
- package/dist/types/components/Shared/forms/RegistrationAddress/types.d.ts +3 -2
- package/dist/types/components/Shared/tasks/TaskList/TaskList.d.ts +3 -1
- package/dist/types/components/Shared/tasks/TaskList/TaskListItem.d.ts +1 -1
- package/dist/types/components/Shared/tasks/TaskList/types.d.ts +1 -4
- package/dist/types/components/Shared/tasks/TaskList/utils.d.ts +1 -1
- package/dist/types/components/SoleProprietorship/pages/SoleProprietorshipPage.d.ts +1 -2
- package/dist/types/components/Trust/pages/TrustMemberCompanyPage.d.ts +1 -2
- package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +2 -2
- package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberCompanyPage.d.ts +1 -2
- package/dist/types/components/ui/atoms/Header/Header.d.ts +12 -0
- package/dist/types/components/ui/atoms/ListItem/ListItem.d.ts +1 -2
- package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.d.ts +3 -4
- package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +8 -9
- package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +29 -7
- package/dist/types/components/ui/molecules/Card/Card.d.ts +1 -1
- package/dist/types/components/ui/molecules/Card/types.d.ts +1 -0
- package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +2 -23
- package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +3 -3
- package/dist/types/components/ui/molecules/EmbeddedStatus/types.d.ts +23 -0
- package/dist/types/context/ExperimentContext/types.d.ts +4 -12
- package/dist/types/context/I18nProvider/I18nContext.d.ts +3 -0
- package/dist/types/context/SettingsContext/types.d.ts +2 -2
- package/dist/types/core/models/api/legal-entity-association.d.ts +1 -1
- package/dist/types/core/models/api/source-of-funds.d.ts +5 -0
- package/dist/types/core/models/api/transfer-instrument.d.ts +2 -0
- package/dist/types/core/process-field-configurations.d.ts +2 -2
- package/dist/types/datasets/generators/getAccountFormatForCountry.d.ts +1 -0
- package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +6 -8
- package/dist/types/hooks/useUboQuestionnaire.d.ts +25 -0
- package/dist/types/language/Language.d.ts +10 -0
- package/dist/types/language/types.d.ts +15 -1
- package/dist/types/stores/globalStore/taskTypes.d.ts +1 -1
- package/dist/types/{core → utils}/analytics.d.ts +5 -5
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/getSSNType.d.ts +1 -0
- package/dist/types/utils/textTransformation/toFullWidth.d.ts +6 -0
- package/dist/types/utils/translation.d.ts +1 -0
- package/dist/{types-IWh9Nm-W.js → types-28yvE9dj.js} +2 -2
- package/dist/{types-Dsz7b4S_.js → types-BzOpGekG.js} +2 -2
- package/dist/{types-CAznNNSI.js → types-DHmyPbAn.js} +5 -13
- package/dist/{useAssociatedLegalEntity-CPl7E0oh.js → useAssociatedLegalEntity-Cd77TYXt.js} +1 -1
- package/dist/{useDataset-CYBhIC5y.js → useDataset-B-72Ufk7.js} +3 -3
- package/dist/{useForm-NtB5fMq5.js → useForm-Aw38WiTE.js} +8 -79
- package/dist/useFormContext-Bx1n-f4V.js +222 -0
- package/dist/{useGlobalData-COgPG9qd.js → useGlobalData-BYJWYYpf.js} +10 -11
- package/dist/{RadioGroup-QZCH1TCn.js → useMultiForm-D-wGVJq1.js} +6 -342
- package/dist/{useOnboardingStatus-B8yCxKXz.js → useOnboardingStatus-AbPudgMj.js} +1 -1
- package/dist/{useScenarios-DesE_Dem.js → useScenarios-CEHvpucH.js} +2 -2
- package/dist/{useTermsOfServiceStatus-qtseJuA8.js → useTermsOfServiceStatus-BugRyfkQ.js} +1 -1
- package/dist/{useToastContext-D4w2gBxd.js → useToastContext-D58NfzLh.js} +2 -5
- package/dist/{useUnincorporatedPartnershipMembers-FOg1r690.js → useUnincorporatedPartnershipMembers-BOfx-rWR.js} +5 -5
- package/dist/{utils-BnQGsYPp.js → utils-D-PqLpBS.js} +2 -2
- package/dist/{utils-B1i9qK_1.js → utils-JAm-rEQS.js} +10 -10
- package/dist/{utils-BMvr9mIu.js → utils-qNiMqbmo.js} +16 -10
- package/dist/{validate-C6-L7Vfa.js → validate-6QHmaW1O.js} +3 -6
- package/dist/{validate-anwsdbQz.js → validate-9J9pJpyR.js} +8 -8
- package/dist/{validate-BiuAh7Ub.js → validate-BY5vrcXH.js} +2 -2
- package/dist/{validationError-zbgp4iB7.js → validationError-kAn6qx2R.js} +2 -2
- package/package.json +70 -70
- package/dist/BusinessFinancingComponent-BdV2XNEs.js +0 -45
- package/dist/BusinessFinancingPage-CutMOZIo.js +0 -40
- package/dist/CreateIndividualComponent-DcwNaN_i.js +0 -72
- package/dist/CreateTransferInstrumentComponent-BFYc-5Zc.js +0 -67
- package/dist/DecisionMakers-c18dspZ1.js +0 -593
- package/dist/ManageIndividualComponent-DBe5ValD.js +0 -47
- package/dist/ManageTermsOfServiceComponent-5GHjPbHb.js +0 -47
- package/dist/RootBusinessDetailsPage-Cy5mUuKv.js +0 -1915
- package/dist/SoleProprietorshipPage-XnNdoc8n.js +0 -50
- package/dist/TaskStatusIndicator-CEZcV_gi.js +0 -69
- package/dist/TrustMemberCompanyPage-DVm9LzCY.js +0 -60
- package/dist/TrustMemberIndividualPage-BqncnJnj.js +0 -66
- package/dist/UnincorporatedPartnershipMemberCompanyPage-DMBIT2KR.js +0 -64
- package/dist/analytics-B9jlnux-.js +0 -61
- package/dist/bg-BG-9uVrFuHv.js +0 -23
- package/dist/bg-BG-B0-ZcjR0.js +0 -22
- package/dist/bg-BG-Cp58y2fj.js +0 -13
- package/dist/bg-BG-Cr0ewJCW.js +0 -13
- package/dist/bg-BG-D5192UVe.js +0 -35
- package/dist/bg-BG-ZJvmfx01.js +0 -13
- package/dist/bg-BG-hFblesn-.js +0 -15
- package/dist/cs-CZ-7xfNBIeH.js +0 -13
- package/dist/cs-CZ-B8IPRc47.js +0 -15
- package/dist/cs-CZ-DMwpeH56.js +0 -13
- package/dist/cs-CZ-DOqH0WeT.js +0 -35
- package/dist/cs-CZ-De4wbl1W.js +0 -13
- package/dist/cs-CZ-Dk1ePReM.js +0 -22
- package/dist/cs-CZ-Wzc382q6.js +0 -23
- package/dist/da-DK-B45X2VaJ.js +0 -35
- package/dist/da-DK-BK6TE3SH.js +0 -13
- package/dist/da-DK-BTpZzEgA.js +0 -15
- package/dist/da-DK-CeNMXUfE.js +0 -23
- package/dist/da-DK-DC8dAHWf.js +0 -13
- package/dist/da-DK-DStNe471.js +0 -22
- package/dist/da-DK-R0sNbjuQ.js +0 -13
- package/dist/de-DE-CGoBPCPv.js +0 -22
- package/dist/de-DE-CWvgMDqU.js +0 -35
- package/dist/de-DE-CY7fT1B5.js +0 -13
- package/dist/de-DE-D9r_yUSr.js +0 -13
- package/dist/de-DE-DjOUNvp6.js +0 -15
- package/dist/de-DE-JI-7mvxy.js +0 -23
- package/dist/de-DE-ZQioXTGO.js +0 -13
- package/dist/el-GR-B06F8VNw.js +0 -13
- package/dist/el-GR-B69zcWyB.js +0 -22
- package/dist/el-GR-C3rkK_oc.js +0 -35
- package/dist/el-GR-C7ThPKtr.js +0 -13
- package/dist/el-GR-Cu9HwD-f.js +0 -15
- package/dist/el-GR-DfNOPkLq.js +0 -23
- package/dist/el-GR-kj1-bNjH.js +0 -13
- package/dist/en-US-BTYdAWXp.js +0 -15
- package/dist/en-US-BaWkkHh3.js +0 -13
- package/dist/en-US-DHq7VYFs.js +0 -23
- package/dist/es-ES-CKMfS8Yy.js +0 -22
- package/dist/es-ES-Cj7q7fWO.js +0 -15
- package/dist/es-ES-D6Uauj9W.js +0 -13
- package/dist/es-ES-DKCCgVF8.js +0 -35
- package/dist/es-ES-DOVPTeyf.js +0 -23
- package/dist/es-ES-Dm8otLm9.js +0 -13
- package/dist/es-ES-XCII5d8J.js +0 -13
- package/dist/et-EE-BJIsPOnh.js +0 -23
- package/dist/et-EE-Bc6ioJRG.js +0 -35
- package/dist/et-EE-DHwaH1by.js +0 -13
- package/dist/et-EE-DNcqO4R9.js +0 -13
- package/dist/et-EE-Dor3enPS.js +0 -15
- package/dist/et-EE-Dw-aPF7J.js +0 -22
- package/dist/et-EE-XPQ-Sf9x.js +0 -13
- package/dist/fi-FI-67pS4_t6.js +0 -13
- package/dist/fi-FI-BNcnKrJ9.js +0 -15
- package/dist/fi-FI-CLg2__EV.js +0 -13
- package/dist/fi-FI-D522KHGk.js +0 -23
- package/dist/fi-FI-DTgF3AuK.js +0 -13
- package/dist/fi-FI-Hhku9Lmc.js +0 -35
- package/dist/fi-FI-REYOX46I.js +0 -22
- package/dist/fr-FR-BYuKsZIb.js +0 -35
- package/dist/fr-FR-BZbWBKOT.js +0 -13
- package/dist/fr-FR-Bn3D6mmY.js +0 -15
- package/dist/fr-FR-CsogZlc6.js +0 -13
- package/dist/fr-FR-D7U2da1i.js +0 -13
- package/dist/fr-FR-D9qaP6nx.js +0 -22
- package/dist/fr-FR-DInQKkTd.js +0 -23
- package/dist/hr-HR-B3boX_dq.js +0 -13
- package/dist/hr-HR-BVzZeaDc.js +0 -13
- package/dist/hr-HR-CJ5rmUrZ.js +0 -13
- package/dist/hr-HR-CPO5Yw2B.js +0 -35
- package/dist/hr-HR-CbxEvbrE.js +0 -22
- package/dist/hr-HR-DzS44Gpv.js +0 -23
- package/dist/hu-HU-BJpO-WrQ.js +0 -13
- package/dist/hu-HU-BSOiZA7a.js +0 -15
- package/dist/hu-HU-CX5vJbE8.js +0 -13
- package/dist/hu-HU-CYfNXKwk.js +0 -13
- package/dist/hu-HU-D0C6UfXB.js +0 -22
- package/dist/hu-HU-mo_0ULJG.js +0 -35
- package/dist/hu-HU-xCvNM5TU.js +0 -23
- package/dist/it-IT-5QHf-hkt.js +0 -13
- package/dist/it-IT-Biduphjt.js +0 -22
- package/dist/it-IT-Cepap1v0.js +0 -13
- package/dist/it-IT-CjEYONJg.js +0 -23
- package/dist/it-IT-Dn9AGEIq.js +0 -13
- package/dist/it-IT-DvM-9LpM.js +0 -15
- package/dist/it-IT-Nl57jui-.js +0 -35
- package/dist/ja-JP-Ajo-tIow.js +0 -23
- package/dist/ja-JP-B2txEVPx.js +0 -22
- package/dist/ja-JP-D3oQAH7z.js +0 -35
- package/dist/ja-JP-DRJ0RpUn.js +0 -13
- package/dist/ja-JP-GXkLvnQ4.js +0 -15
- package/dist/lt-LT-3rmXgF6K.js +0 -13
- package/dist/lt-LT-B6CJ4ULI.js +0 -23
- package/dist/lt-LT-CVasDmF3.js +0 -35
- package/dist/lt-LT-C_YMgjp9.js +0 -22
- package/dist/lt-LT-DNjXmQPv.js +0 -15
- package/dist/lt-LT-Dsy0UVdI.js +0 -13
- package/dist/lt-LT-lJLUJnzd.js +0 -13
- package/dist/lv-LV-B3sT3_cw.js +0 -22
- package/dist/lv-LV-BiilWzcg.js +0 -13
- package/dist/lv-LV-CBex8RS9.js +0 -13
- package/dist/lv-LV-ChOoZuhc.js +0 -15
- package/dist/lv-LV-DPZgF65i.js +0 -13
- package/dist/lv-LV-DTtuyfHS.js +0 -23
- package/dist/lv-LV-Sbsv8-nD.js +0 -35
- package/dist/mapScriptLocalization-BXWQCCfg.js +0 -72
- package/dist/nl-NL-BHkRnVrj.js +0 -35
- package/dist/nl-NL-BHqiO21q.js +0 -15
- package/dist/nl-NL-BIcLB7e6.js +0 -13
- package/dist/nl-NL-CU6c8oyY.js +0 -13
- package/dist/nl-NL-DKYvsnqM.js +0 -13
- package/dist/nl-NL-G1wVnmzT.js +0 -22
- package/dist/nl-NL-Zcq0bXd-.js +0 -23
- package/dist/no-NO-BTtAuqCb.js +0 -22
- package/dist/no-NO-BWpBc9_J.js +0 -13
- package/dist/no-NO-Bj0_2wjm.js +0 -13
- package/dist/no-NO-BxReX6oF.js +0 -23
- package/dist/no-NO-CKT9kLAH.js +0 -15
- package/dist/no-NO-YuIAbtuI.js +0 -13
- package/dist/no-NO-kaAdT9B8.js +0 -35
- package/dist/pl-PL--qPaNyJD.js +0 -22
- package/dist/pl-PL-B87v7Wzw.js +0 -13
- package/dist/pl-PL-B8pWxq6T.js +0 -13
- package/dist/pl-PL-B9eq4QTe.js +0 -13
- package/dist/pl-PL-DD8JN4Qf.js +0 -35
- package/dist/pl-PL-T6uD5--R.js +0 -23
- package/dist/pt-BR-BljlblJ5.js +0 -23
- package/dist/pt-BR-CI2ZzGeN.js +0 -15
- package/dist/pt-BR-Cmr5LoAm.js +0 -22
- package/dist/pt-BR-CrKxuloz.js +0 -13
- package/dist/pt-BR-DMCle1o_.js +0 -30
- package/dist/pt-BR-DeDXIlM_.js +0 -35
- package/dist/pt-BR-DtLKiYpp.js +0 -60
- package/dist/pt-PT-BNJcehJa.js +0 -13
- package/dist/pt-PT-Cu735tNP.js +0 -13
- package/dist/pt-PT-D2elvnDU.js +0 -15
- package/dist/pt-PT-Dk48OVtf.js +0 -22
- package/dist/pt-PT-Gsd7I9Ff.js +0 -13
- package/dist/pt-PT-N0njcfLO.js +0 -23
- package/dist/pt-PT-Xm-pm3mb.js +0 -35
- package/dist/resolveEnvironment-DTf0YGQw.js +0 -84
- package/dist/ro-RO-B4ASHhK6.js +0 -13
- package/dist/ro-RO-B75duQ_N.js +0 -13
- package/dist/ro-RO-BLuOjrS0.js +0 -22
- package/dist/ro-RO-C3m6aJVP.js +0 -35
- package/dist/ro-RO-DL9V1CMj.js +0 -15
- package/dist/ro-RO-DkHxxgVT.js +0 -13
- package/dist/ro-RO-Ic1SzBgx.js +0 -23
- package/dist/sk-SK-BSioQTMW.js +0 -15
- package/dist/sk-SK-BVc-vNQm.js +0 -35
- package/dist/sk-SK-C1Ky2nl_.js +0 -22
- package/dist/sk-SK-CiD0FeLN.js +0 -23
- package/dist/sk-SK-Cv76Qa3V.js +0 -13
- package/dist/sk-SK-DUZblaeq.js +0 -13
- package/dist/sk-SK-DibZzOqt.js +0 -13
- package/dist/sl-SI-BB7iVcFI.js +0 -22
- package/dist/sl-SI-BylvpF-X.js +0 -15
- package/dist/sl-SI-CyNtynTN.js +0 -13
- package/dist/sl-SI-D9rl7bIN.js +0 -13
- package/dist/sl-SI-D_rqR0D7.js +0 -35
- package/dist/sl-SI-MZoDApq9.js +0 -23
- package/dist/sl-SI-vyebIKls.js +0 -13
- package/dist/sv-SE-1eeTTIj7.js +0 -13
- package/dist/sv-SE-B3zoXMuH.js +0 -35
- package/dist/sv-SE-BcTCn-cn.js +0 -13
- package/dist/sv-SE-DCFSf4Oj.js +0 -23
- package/dist/sv-SE-DbI-1JqN.js +0 -22
- package/dist/sv-SE-Dwz1yTrB.js +0 -15
- package/dist/sv-SE-Ez33Bdgp.js +0 -13
- package/dist/translation-C21WMjvq.js +0 -472
- package/dist/types/components/BusinessLines/forms/rules.d.ts +0 -5
- package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +0 -8
- package/dist/types/components/ui/atoms/Remove/Remove.d.ts +0 -2
- package/dist/types/components/ui/atoms/Remove/Remove.types.d.ts +0 -9
- package/dist/types/components/ui/molecules/Card/CardGroup.d.ts +0 -3
|
@@ -0,0 +1,4274 @@
|
|
|
1
|
+
;
|
|
2
|
+
{
|
|
3
|
+
try {
|
|
4
|
+
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "513c7a62-3e0a-47b9-9dd2-0a8bab72186d", e._sentryDebugIdIdentifier = "sentry-dbid-513c7a62-3e0a-47b9-9dd2-0a8bab72186d");
|
|
6
|
+
} catch (e) {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
;
|
|
10
|
+
import { b as useApiContext, j as useQuery, k as httpPost, m as useSettingsContext, o as httpGet, p as getLegalRepresentative, c as useLegalEntity, q as skipToken, r as doesLegalEntityRequiresLegalRepresentative, u as useTranslation, B as Button, t as Svg, v as Skeleton, w as translateStringOrObject, x as Typography, y as LegalEntityTypes, z as isPartOfTrustFromLegalEntity, C as hasSolePropInLegalEntity, G as hasOwnEntityAssociationOfType, H as isEmptyEntity, J as EntityTypes, K as DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING, M as TaskTypes, N as createLogger, O as TaskStatuses, P as useAnalyticsContext, U as Icon, V as IconButton, W as noop, X as useExperimentsContext, Y as isInstantVerifiedAccount, Z as getObscuredAccountNumber, $ as useGetTaskStatus, R as ROOT_LE, L as Loader, a0 as useGlobalStore, a1 as isPartOfUnincorporatedPartnership, a2 as getOwnSignatories, a3 as getOwnDecisionMakersLegalEntityIds, a4 as getOwnSolePropProblems, a5 as getOwnTrustProblems, a6 as getOwnUnincorporatedPartnershipProblems, a7 as getOwnEntityAssociations, a8 as TrustMemberTypes, a9 as CountryCodes, aa as isEmpty, a as addResourceBundles, _ as __variableDynamicImportRuntimeHelper, g as getLegalEntityCountry, ab as getDecisionMakerDescriptionMap, ac as TRUST_DEFAULT_DESCRIPTIONS_MAP, ad as Trans, ae as DEFAULT_TRUST_MEMBER_REQUIREMENTS, af as useI18nContext, ag as hasAllCapabilitiesResolved, ah as hasRejectedCapabilities, ai as objectsDeepEqual } from "./StoreProvider-DadhkEyO.js";
|
|
11
|
+
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
12
|
+
import { lazy, Suspense } from "preact/compat";
|
|
13
|
+
import { useMemo, useCallback, useEffect, useState, useRef } from "preact/hooks";
|
|
14
|
+
import { S as SettingNames, I as InputText } from "./InputText-zem7Kt4i.js";
|
|
15
|
+
import { u as useLocalStorage, a as useAccountHolder, b as useCapabilityProblems, v as validateLegalCompanyName, c as validateNotEmptyOnBlur, d as validateLatinSpaceMarkPunctuationOnlyOnBlur, r as resolveFieldMetadata, R as RadioGroupCard, T as TextArea, C as ContextGuidance, e as TrustedFieldsProviders } from "./fieldConfigurations-BZuo2e0d.js";
|
|
16
|
+
import { C as CompanyTypesValues, h as handleKeys, u as useSetting, n as nameFields, M as MultiSelectList, m as makeSelectItemForRole, N as Name, a as useSingpassMyInfoLogin, i as isBafinSignatoryFlow, s as showIdNowModal } from "./bafinUtils-CAVAvSFg.js";
|
|
17
|
+
import { u as useAssociatedLegalEntity } from "./useAssociatedLegalEntity-Cd77TYXt.js";
|
|
18
|
+
import cx from "classnames";
|
|
19
|
+
import { a as Alert } from "./Alert-Dz_jjJ1E.js";
|
|
20
|
+
import { u as useTermsOfServiceStatus, a as useTermsOfServiceAcceptanceInfos } from "./useTermsOfServiceStatus-BugRyfkQ.js";
|
|
21
|
+
import { u as useToastContext } from "./useToastContext-D58NfzLh.js";
|
|
22
|
+
import { S as StackLayout, m as mergeFieldMetadataIntoProps, g as getFieldProps, H as Header, E as ErrorPanel, c as createFormUtils, C as CountryField, a as COUNTRY_FIELD, s as summaryItem, b as getRoleName, d as summaryStep, e as Summary, U as UnincorporatedPartnershipMemberTypes, f as getRoleTagVariant } from "./CountryField-DunKeW_n.js";
|
|
23
|
+
import { C as Card, V as VerificationErrorAlert, u as useDeleteTransferInstrument } from "./Card-dFm_Z3TI.js";
|
|
24
|
+
import { signal } from "@preact/signals";
|
|
25
|
+
import { d as downloadFile } from "./file-CiG1D0zy.js";
|
|
26
|
+
import { A as Avatar } from "./Avatar-CCed5bJE.js";
|
|
27
|
+
import { L as LoaderWrapper, F as Field, a as useForm } from "./useForm-Aw38WiTE.js";
|
|
28
|
+
import { C as Confirm } from "./useDataset-B-72Ufk7.js";
|
|
29
|
+
import { T as TaskItemStatus } from "./TaskItemStatus-DuJ01Ng6.js";
|
|
30
|
+
import { g as getLegalEntityNameBasedOnType } from "./getName-DwJ2SEhe.js";
|
|
31
|
+
import { u as useCreateLegalEntity, a as useUpdateLegalEntity, R as RadioGroup } from "./RadioGroup-Br5v8w0a.js";
|
|
32
|
+
import { F as FormNavigation, A as ActionBar } from "./FormNavigation-a9y0a0iw.js";
|
|
33
|
+
import { K as KEYBOARD_KEYS } from "./Modal-DvB1odWq.js";
|
|
34
|
+
import { T as Tag } from "./Tag-DdkVScyr.js";
|
|
35
|
+
import { u as useUnincorporatedPartnershipMembers, d as deleteUnincorporatedPartnershipMember } from "./useUnincorporatedPartnershipMembers-BOfx-rWR.js";
|
|
36
|
+
const getPciStatus = async (legalEntityId, baseUrl, data) => {
|
|
37
|
+
return httpPost(
|
|
38
|
+
{
|
|
39
|
+
baseUrl,
|
|
40
|
+
path: `legalEntities/${legalEntityId}/pci/signingRequired`
|
|
41
|
+
},
|
|
42
|
+
data
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
const usePciStatus = (data, options) => {
|
|
46
|
+
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
47
|
+
return useQuery({
|
|
48
|
+
queryKey: ["pciStatus", data],
|
|
49
|
+
queryFn: () => getPciStatus(rootLegalEntityId.value, baseUrl.value, data),
|
|
50
|
+
...options
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
function useSalesChannelsSettings() {
|
|
54
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
55
|
+
return useMemo(() => {
|
|
56
|
+
const settings = [];
|
|
57
|
+
if (isSettingEnabled(SettingNames.RequirePciSignEcommerce)) {
|
|
58
|
+
settings.push("eCommerce");
|
|
59
|
+
}
|
|
60
|
+
if (isSettingEnabled(SettingNames.RequirePciSignPos)) {
|
|
61
|
+
settings.push("pos");
|
|
62
|
+
}
|
|
63
|
+
if (isSettingEnabled(SettingNames.RequirePciSignEcomMoto)) {
|
|
64
|
+
settings.push("ecomMoto");
|
|
65
|
+
}
|
|
66
|
+
if (isSettingEnabled(SettingNames.RequirePciSignPosMoto)) {
|
|
67
|
+
settings.push("posMoto");
|
|
68
|
+
}
|
|
69
|
+
return settings;
|
|
70
|
+
}, [isSettingEnabled]);
|
|
71
|
+
}
|
|
72
|
+
const getTaskTypes = async (id, baseUrl) => {
|
|
73
|
+
return httpGet({
|
|
74
|
+
baseUrl,
|
|
75
|
+
path: `legalEntities/${id}/configurations/tasks`
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const useTaskTypes = (options) => {
|
|
79
|
+
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
80
|
+
return useQuery({
|
|
81
|
+
queryKey: ["taskTypes"],
|
|
82
|
+
queryFn: () => getTaskTypes(rootLegalEntityId.value, baseUrl.value),
|
|
83
|
+
...options
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const getHasSeenIntroductionStorageKey = (legalEntityId) => `COMPLETED_INTRO-${legalEntityId}`;
|
|
87
|
+
const useHasSeenIntroduction = ({ legalEntityId }) => {
|
|
88
|
+
const [hasSeenIntroduction, setHasSeenIntroduction] = useLocalStorage(
|
|
89
|
+
getHasSeenIntroductionStorageKey(legalEntityId),
|
|
90
|
+
false
|
|
91
|
+
);
|
|
92
|
+
return { hasSeenIntroduction, setHasSeenIntroduction };
|
|
93
|
+
};
|
|
94
|
+
const getHasSeenSingpassSelectionStorageKey = (legalEntityId) => `COMPLETED_SINGPASS_SELECTION-${legalEntityId}`;
|
|
95
|
+
const useHasSeenSingpassSelection = ({
|
|
96
|
+
legalEntityId
|
|
97
|
+
}) => {
|
|
98
|
+
const [hasSeenSingpassSelection, setHasSeenSingpassSelection] = useLocalStorage(
|
|
99
|
+
getHasSeenSingpassSelectionStorageKey(legalEntityId),
|
|
100
|
+
false
|
|
101
|
+
);
|
|
102
|
+
return { hasSeenSingpassSelection, setHasSeenSingpassSelection };
|
|
103
|
+
};
|
|
104
|
+
const useAssociatedLegalRepresentative = (legalEntity) => {
|
|
105
|
+
const matchingAssociation = useMemo(() => {
|
|
106
|
+
if (!legalEntity) return void 0;
|
|
107
|
+
return getLegalRepresentative(legalEntity);
|
|
108
|
+
}, [legalEntity]);
|
|
109
|
+
const { data } = useLegalEntity(
|
|
110
|
+
doesLegalEntityRequiresLegalRepresentative(legalEntity) && matchingAssociation?.legalEntityId ? matchingAssociation.legalEntityId : skipToken
|
|
111
|
+
);
|
|
112
|
+
return data;
|
|
113
|
+
};
|
|
114
|
+
const getCanSeeEntitySelectionStorageKey = (legalEntityId) => `ENTITY_SELECTION_SEEN-${legalEntityId}`;
|
|
115
|
+
const useCanSeeEntitySelection = (legalEntityId) => {
|
|
116
|
+
const [canSeeEntitySelectionFromLocalStorage, setCanSeeEntitySelectionIntoLocalStorage] = useLocalStorage(getCanSeeEntitySelectionStorageKey(legalEntityId), true);
|
|
117
|
+
return {
|
|
118
|
+
canSeeEntitySelection: canSeeEntitySelectionFromLocalStorage,
|
|
119
|
+
setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const providerButton = "adyen-kyc-provider-button";
|
|
123
|
+
const providerButtonDisplayName = "adyen-kyc-provider-button-display-name";
|
|
124
|
+
const styles$4 = {
|
|
125
|
+
providerButton,
|
|
126
|
+
providerButtonDisplayName
|
|
127
|
+
};
|
|
128
|
+
const ProviderButton = ({ provider, onClick }) => {
|
|
129
|
+
const { t } = useTranslation("ui");
|
|
130
|
+
const providerLogo = {
|
|
131
|
+
singpassMyInfo: "singpass-logo",
|
|
132
|
+
singpassMyInfoBusiness: "singpass-logo"
|
|
133
|
+
};
|
|
134
|
+
const providerDisplayName = {
|
|
135
|
+
singpassMyInfo: "Singpass",
|
|
136
|
+
singpassMyInfoBusiness: "Singpass"
|
|
137
|
+
};
|
|
138
|
+
const buttonLabel = {
|
|
139
|
+
singpassMyInfo: t(($) => $["retrieveMyinfo"]),
|
|
140
|
+
singpassMyInfoBusiness: t(($) => $["retrieveMyinfoBusiness"])
|
|
141
|
+
};
|
|
142
|
+
return /* @__PURE__ */ jsx(Button, { onClick, fullWidth: true, variant: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$4.providerButton, children: [
|
|
143
|
+
buttonLabel[provider],
|
|
144
|
+
/* @__PURE__ */ jsx("span", { className: styles$4.providerButtonDisplayName, children: providerDisplayName[provider] }),
|
|
145
|
+
/* @__PURE__ */ jsx(Svg, { name: providerLogo[provider], type: "image" })
|
|
146
|
+
] }) });
|
|
147
|
+
};
|
|
148
|
+
const legalEntityTypeToSubtitleTranslationKey = {
|
|
149
|
+
[LegalEntityTypes.INDIVIDUAL]: "myInfoYouCanGetVerifiedDetails",
|
|
150
|
+
[LegalEntityTypes.ORGANIZATION]: "myInfoBusinessYouCanGetVerifiedDetails"
|
|
151
|
+
};
|
|
152
|
+
const legalEntityTypeToProviderButtonKey = {
|
|
153
|
+
[LegalEntityTypes.INDIVIDUAL]: "singpassMyInfo",
|
|
154
|
+
[LegalEntityTypes.ORGANIZATION]: "singpassMyInfoBusiness"
|
|
155
|
+
};
|
|
156
|
+
const successAlertTitleText = {
|
|
157
|
+
[LegalEntityTypes.INDIVIDUAL]: "myinfoDetailsRetrieved",
|
|
158
|
+
[LegalEntityTypes.ORGANIZATION]: "myinfoBusinessDetailsRetrieved"
|
|
159
|
+
};
|
|
160
|
+
const successAlertContentText = {
|
|
161
|
+
[LegalEntityTypes.INDIVIDUAL]: "yourDetailsArePreFilledInTheRelevantSections",
|
|
162
|
+
[LegalEntityTypes.ORGANIZATION]: "yourBusinesssDetailsArePreFilledInTheRelevantSections"
|
|
163
|
+
};
|
|
164
|
+
const SingpassBanner = ({
|
|
165
|
+
isLoading,
|
|
166
|
+
isSuccess,
|
|
167
|
+
errorMessage,
|
|
168
|
+
onClick,
|
|
169
|
+
onAlertClose,
|
|
170
|
+
onMessage,
|
|
171
|
+
legalEntityType
|
|
172
|
+
}) => {
|
|
173
|
+
const { t } = useTranslation("common");
|
|
174
|
+
const { baseUrl } = useApiContext();
|
|
175
|
+
const singpassEventListener = useCallback(
|
|
176
|
+
(event) => {
|
|
177
|
+
if (event.origin !== new URL(baseUrl.value).origin) return;
|
|
178
|
+
onMessage({ data: { isSuccessful: event.data.isSuccessful } });
|
|
179
|
+
},
|
|
180
|
+
[baseUrl.value, onMessage]
|
|
181
|
+
);
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
window.addEventListener("message", singpassEventListener);
|
|
184
|
+
return () => window.removeEventListener("message", singpassEventListener);
|
|
185
|
+
}, [singpassEventListener]);
|
|
186
|
+
const channel = new BroadcastChannel("sgidprovider");
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
channel.onmessage = onMessage;
|
|
189
|
+
return () => channel.close();
|
|
190
|
+
}, [channel, onMessage]);
|
|
191
|
+
if (isLoading) {
|
|
192
|
+
return /* @__PURE__ */ jsx(Skeleton, {});
|
|
193
|
+
}
|
|
194
|
+
if (isSuccess) {
|
|
195
|
+
const successTitleText = successAlertTitleText[legalEntityType];
|
|
196
|
+
const successContentText = successAlertContentText[legalEntityType];
|
|
197
|
+
return /* @__PURE__ */ jsx(
|
|
198
|
+
Alert,
|
|
199
|
+
{
|
|
200
|
+
variant: "success",
|
|
201
|
+
title: successTitleText && t(($) => $[successTitleText]),
|
|
202
|
+
onClose: onAlertClose,
|
|
203
|
+
children: successContentText && t(($) => $[successContentText])
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
const providerName = legalEntityTypeToProviderButtonKey[legalEntityType];
|
|
208
|
+
if (errorMessage) {
|
|
209
|
+
return /* @__PURE__ */ jsx(
|
|
210
|
+
Alert,
|
|
211
|
+
{
|
|
212
|
+
variant: "warning",
|
|
213
|
+
title: translateStringOrObject(t, errorMessage),
|
|
214
|
+
onClose: onAlertClose,
|
|
215
|
+
children: /* @__PURE__ */ jsxs(Typography, { variant: "body", children: [
|
|
216
|
+
t(($) => $["tryAgainOrContinueEnteringTheDetailsYourself"]),
|
|
217
|
+
providerName && /* @__PURE__ */ jsx(ProviderButton, { provider: providerName, onClick })
|
|
218
|
+
] })
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
const subtitleTranslationKey = legalEntityTypeToSubtitleTranslationKey[legalEntityType];
|
|
223
|
+
return /* @__PURE__ */ jsxs(
|
|
224
|
+
Alert,
|
|
225
|
+
{
|
|
226
|
+
className: cx("adyen-task-list-singpass-banner"),
|
|
227
|
+
icon: false,
|
|
228
|
+
title: t(($) => $["getSetUpInstantly"]),
|
|
229
|
+
children: [
|
|
230
|
+
subtitleTranslationKey && /* @__PURE__ */ jsx("div", { className: cx("adyen-task-list-singpass-banner__subtitle"), children: t(($) => $[subtitleTranslationKey]) }),
|
|
231
|
+
providerName && /* @__PURE__ */ jsx(ProviderButton, { provider: providerName, onClick })
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
const getBusinessLines = async (legalEntityId, baseUrl) => {
|
|
237
|
+
return httpGet({
|
|
238
|
+
baseUrl,
|
|
239
|
+
path: `legalEntities/${legalEntityId}/businessLines`
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
const useBusinessLines = (options) => {
|
|
243
|
+
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
244
|
+
return useQuery({
|
|
245
|
+
queryKey: ["businessLines"],
|
|
246
|
+
queryFn: () => getBusinessLines(rootLegalEntityId.value, baseUrl.value),
|
|
247
|
+
...options
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
const getPciQuestionnaire = async (legalEntityId, baseUrl, documentId) => {
|
|
251
|
+
return httpGet({
|
|
252
|
+
baseUrl,
|
|
253
|
+
path: `legalEntities/${legalEntityId}/pci/questionnaires/${documentId}`
|
|
254
|
+
});
|
|
255
|
+
};
|
|
256
|
+
const getPciQuestionnaireList = async (legalEntityId, baseUrl) => {
|
|
257
|
+
return httpGet({
|
|
258
|
+
baseUrl,
|
|
259
|
+
path: `legalEntities/${legalEntityId}/pci/questionnaires`
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
const usePciQuestionnaireList = (options) => {
|
|
263
|
+
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
264
|
+
return useQuery({
|
|
265
|
+
queryKey: ["pciQuestionnaireList"],
|
|
266
|
+
queryFn: () => getPciQuestionnaireList(rootLegalEntityId.value, baseUrl.value),
|
|
267
|
+
...options
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
const getTaskStatus = async (legalEntityId, baseUrl) => {
|
|
271
|
+
return httpGet({
|
|
272
|
+
baseUrl,
|
|
273
|
+
path: `legalEntities/${legalEntityId}/taskStatus`
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
const useTaskStatus = (options) => {
|
|
277
|
+
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
278
|
+
return useQuery({
|
|
279
|
+
queryKey: ["taskStatus"],
|
|
280
|
+
queryFn: () => getTaskStatus(rootLegalEntityId.value, baseUrl.value),
|
|
281
|
+
...options
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
const useLegalEntityType = ({
|
|
285
|
+
legalEntity
|
|
286
|
+
}) => {
|
|
287
|
+
const isTrust = isPartOfTrustFromLegalEntity(legalEntity);
|
|
288
|
+
const isSoleProprietor = hasSolePropInLegalEntity(legalEntity);
|
|
289
|
+
const hasLegalAssociation = isTrust || isSoleProprietor;
|
|
290
|
+
switch (legalEntity.type) {
|
|
291
|
+
case LegalEntityTypes.INDIVIDUAL:
|
|
292
|
+
case LegalEntityTypes.ORGANIZATION:
|
|
293
|
+
if (!hasLegalAssociation) return legalEntity.type;
|
|
294
|
+
if (isSoleProprietor) return LegalEntityTypes.SOLE_PROPRIETORSHIP;
|
|
295
|
+
if (isTrust) return LegalEntityTypes.TRUST;
|
|
296
|
+
break;
|
|
297
|
+
default:
|
|
298
|
+
return void 0;
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
const useCanSeeIntroduction = ({ legalEntity }) => {
|
|
302
|
+
const legalEntityType = useLegalEntityType({ legalEntity });
|
|
303
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
304
|
+
switch (legalEntityType) {
|
|
305
|
+
case LegalEntityTypes.INDIVIDUAL:
|
|
306
|
+
return !isSettingEnabled(SettingNames.HideOnboardingIntroductionIndividual);
|
|
307
|
+
case LegalEntityTypes.ORGANIZATION:
|
|
308
|
+
return !isSettingEnabled(SettingNames.HideOnboardingIntroductionOrganization);
|
|
309
|
+
case LegalEntityTypes.SOLE_PROPRIETORSHIP:
|
|
310
|
+
return !isSettingEnabled(SettingNames.HideOnboardingIntroductionSoleProprietor);
|
|
311
|
+
case LegalEntityTypes.TRUST:
|
|
312
|
+
return !isSettingEnabled(SettingNames.HideOnboardingIntroductionTrust);
|
|
313
|
+
default:
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
const capabilitiesToPreventTypeChange = [
|
|
318
|
+
"receivePayments",
|
|
319
|
+
"issueCard",
|
|
320
|
+
"useCard",
|
|
321
|
+
"withdrawFromAtm",
|
|
322
|
+
"withdrawFromAtmInRestrictedCountries",
|
|
323
|
+
"useCardInRestrictedCountries",
|
|
324
|
+
"useCardInRestrictedIndustries",
|
|
325
|
+
"issueBankAccount",
|
|
326
|
+
"sendToThirdParty",
|
|
327
|
+
"receiveFromThirdParty",
|
|
328
|
+
"getGrantOffers",
|
|
329
|
+
"receiveGrants"
|
|
330
|
+
];
|
|
331
|
+
const entityTypeToCorrespondingAccountHolderOption = {
|
|
332
|
+
[LegalEntityTypes.INDIVIDUAL]: "myName",
|
|
333
|
+
[LegalEntityTypes.ORGANIZATION]: "theCompanyIWorkFor",
|
|
334
|
+
[LegalEntityTypes.SOLE_PROPRIETORSHIP]: "mySoleProprietorName",
|
|
335
|
+
[LegalEntityTypes.TRUST]: "aTrust",
|
|
336
|
+
[LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: "anUnincorporatedPartnership"
|
|
337
|
+
};
|
|
338
|
+
const getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false, accountHolder) => {
|
|
339
|
+
if (accountHolder) {
|
|
340
|
+
return accountHolder;
|
|
341
|
+
}
|
|
342
|
+
if (!legalEntityResponse?.type) return void 0;
|
|
343
|
+
if (hasOwnEntityAssociationOfType(
|
|
344
|
+
LegalEntityTypes.SOLE_PROPRIETORSHIP,
|
|
345
|
+
legalEntityResponse.entityAssociations,
|
|
346
|
+
legalEntityResponse.id
|
|
347
|
+
)) {
|
|
348
|
+
return "mySoleProprietorName";
|
|
349
|
+
}
|
|
350
|
+
if (hasOwnEntityAssociationOfType(
|
|
351
|
+
LegalEntityTypes.TRUST,
|
|
352
|
+
legalEntityResponse.entityAssociations,
|
|
353
|
+
legalEntityResponse.id
|
|
354
|
+
)) {
|
|
355
|
+
return "aTrust";
|
|
356
|
+
}
|
|
357
|
+
if (hasOwnEntityAssociationOfType(
|
|
358
|
+
LegalEntityTypes.UNINCORPORATED_PARTNERSHIP,
|
|
359
|
+
legalEntityResponse.entityAssociations,
|
|
360
|
+
legalEntityResponse.id
|
|
361
|
+
)) {
|
|
362
|
+
return "anUnincorporatedPartnership";
|
|
363
|
+
}
|
|
364
|
+
if (isTypeChanging || !isEmptyEntity(legalEntityResponse)) {
|
|
365
|
+
return entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type];
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
const allowIndividualWithoutSoleProp = (capabilities) => !capabilities?.map((c) => c.replace("Commercial", "").replace("Consumer", "")).some((c) => capabilitiesToPreventTypeChange.includes(c));
|
|
369
|
+
const BusinessTypes = {
|
|
370
|
+
INDIVIDUAL: "individual",
|
|
371
|
+
COMPANY: "company",
|
|
372
|
+
INCORPORATED_PARTNERSHIP: "partnershipIncorporated",
|
|
373
|
+
UNINCORPORATED_PARTNERSHIP: "partnershipUnincorporated",
|
|
374
|
+
INDIVIDUAL_TRUSTEE: "individualTrustee",
|
|
375
|
+
COMPANY_TRUSTEE: "companyTrustee",
|
|
376
|
+
SOLE_PROPRIETORSHIP: "soleProprietorship",
|
|
377
|
+
INCORPORATE_ASSOCIATION: "associationIncorporated"
|
|
378
|
+
};
|
|
379
|
+
const businessTypeMapping = {
|
|
380
|
+
myName: {
|
|
381
|
+
[LegalEntityTypes.INDIVIDUAL]: BusinessTypes.INDIVIDUAL
|
|
382
|
+
},
|
|
383
|
+
theCompanyIWorkFor: {
|
|
384
|
+
[LegalEntityTypes.ORGANIZATION]: BusinessTypes.COMPANY
|
|
385
|
+
},
|
|
386
|
+
mySoleProprietorName: {
|
|
387
|
+
[LegalEntityTypes.INDIVIDUAL]: BusinessTypes.SOLE_PROPRIETORSHIP
|
|
388
|
+
},
|
|
389
|
+
aTrust: {
|
|
390
|
+
[LegalEntityTypes.INDIVIDUAL]: BusinessTypes.INDIVIDUAL_TRUSTEE,
|
|
391
|
+
[LegalEntityTypes.ORGANIZATION]: BusinessTypes.COMPANY_TRUSTEE
|
|
392
|
+
},
|
|
393
|
+
anUnincorporatedPartnership: {
|
|
394
|
+
[LegalEntityTypes.INDIVIDUAL]: BusinessTypes.UNINCORPORATED_PARTNERSHIP,
|
|
395
|
+
[LegalEntityTypes.ORGANIZATION]: BusinessTypes.UNINCORPORATED_PARTNERSHIP
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
const companyTypesMapping = {
|
|
399
|
+
[CompanyTypesValues.INCORPORATED_PARTNERSHIP]: BusinessTypes.INCORPORATED_PARTNERSHIP,
|
|
400
|
+
[CompanyTypesValues.INCORPORATED_ASSOCIATION]: BusinessTypes.INCORPORATE_ASSOCIATION,
|
|
401
|
+
[CompanyTypesValues.PUBLIC_COMPANY]: BusinessTypes.COMPANY,
|
|
402
|
+
[CompanyTypesValues.PRIVATE_COMPANY]: BusinessTypes.COMPANY,
|
|
403
|
+
[CompanyTypesValues.UNLISTED_PUBLIC_COMPANY]: BusinessTypes.COMPANY,
|
|
404
|
+
[CompanyTypesValues.GOVERNMENTAL_ORGANIZATION]: BusinessTypes.COMPANY,
|
|
405
|
+
[CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]: BusinessTypes.COMPANY,
|
|
406
|
+
[CompanyTypesValues.SOLE_PROPRIETORSHIP]: BusinessTypes.SOLE_PROPRIETORSHIP
|
|
407
|
+
};
|
|
408
|
+
const useBusinessSetup = (legalEntityResponse) => {
|
|
409
|
+
const { accountHolder } = useAccountHolder();
|
|
410
|
+
const accountHolderType = accountHolder || getDefaultAccountHolderType(legalEntityResponse);
|
|
411
|
+
const organizationType = legalEntityResponse?.organization?.type;
|
|
412
|
+
const businessSetup = accountHolderType === "theCompanyIWorkFor" && organizationType ? companyTypesMapping[organizationType] : businessTypeMapping[accountHolderType]?.[legalEntityResponse?.type];
|
|
413
|
+
return businessSetup;
|
|
414
|
+
};
|
|
415
|
+
function useDataMissingRemediations({
|
|
416
|
+
legalEntityId,
|
|
417
|
+
problems
|
|
418
|
+
}) {
|
|
419
|
+
const { t } = useTranslation("common");
|
|
420
|
+
const decisionMakersRemediationMessage = useMemo(() => {
|
|
421
|
+
const remediationCodes = problems[EntityTypes.LEGAL_ENTITY]?.[legalEntityId]?.missingData?.reduce((remediations, error) => {
|
|
422
|
+
const remediation = DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING[error.code];
|
|
423
|
+
return remediation ? [...remediations, remediation] : remediations;
|
|
424
|
+
}, []);
|
|
425
|
+
const uniqueRemediations = [...new Set(remediationCodes)];
|
|
426
|
+
switch (uniqueRemediations?.length) {
|
|
427
|
+
case void 0:
|
|
428
|
+
case 0:
|
|
429
|
+
return void 0;
|
|
430
|
+
case 1:
|
|
431
|
+
return uniqueRemediations[0] ? t(($) => $[`remediationMessage_${uniqueRemediations[0]}`]) : t(($) => $["missingMultipleDecisionMakers"]);
|
|
432
|
+
default:
|
|
433
|
+
return t(($) => $["missingMultipleDecisionMakers"]);
|
|
434
|
+
}
|
|
435
|
+
}, [problems, t, legalEntityId]);
|
|
436
|
+
return {
|
|
437
|
+
remediationMessages: {
|
|
438
|
+
[TaskTypes.DECISION_MAKER]: decisionMakersRemediationMessage
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
const logger$2 = createLogger();
|
|
443
|
+
const normalizeTaskStatuses = (taskStatuses) => {
|
|
444
|
+
return taskStatuses?.statuses?.reduce((acc, currentTask) => {
|
|
445
|
+
const status = TaskStatuses[currentTask.status];
|
|
446
|
+
const statusEntries = currentTask.taskStatusEntries;
|
|
447
|
+
acc[currentTask.type] = {
|
|
448
|
+
status: status ?? TaskStatuses.DETAILS_REQUIRED,
|
|
449
|
+
taskStatusEntries: statusEntries
|
|
450
|
+
};
|
|
451
|
+
return acc;
|
|
452
|
+
}, {});
|
|
453
|
+
};
|
|
454
|
+
const TASK_STATUS_POLLING_INTERVAL_MS = 3e3;
|
|
455
|
+
const TASK_STATUS_COMPLETED_POLLING_INTERVAL_MS = 6e3;
|
|
456
|
+
const getAccountTaskStatus = (accountId, payinPayoutTaskStatus) => {
|
|
457
|
+
const taskStatusEntries = payinPayoutTaskStatus?.taskStatusEntries;
|
|
458
|
+
const taskStatusEntry = taskStatusEntries?.find((entry) => entry.id.includes(accountId));
|
|
459
|
+
if (!taskStatusEntry) {
|
|
460
|
+
logger$2.warn(`No task status for this account: ${accountId}`);
|
|
461
|
+
return payinPayoutTaskStatus?.status ?? TaskStatuses.PROCESSING;
|
|
462
|
+
}
|
|
463
|
+
return TaskStatuses[taskStatusEntry.status];
|
|
464
|
+
};
|
|
465
|
+
const normalizedTaskStatusStore = signal(void 0);
|
|
466
|
+
const setNormalizedTaskStatusStore = (taskStatus) => {
|
|
467
|
+
normalizedTaskStatusStore.value = taskStatus;
|
|
468
|
+
};
|
|
469
|
+
const TaskListItem = ({
|
|
470
|
+
titleKey,
|
|
471
|
+
title,
|
|
472
|
+
icon,
|
|
473
|
+
status,
|
|
474
|
+
statusLabel,
|
|
475
|
+
onNavigateToTask,
|
|
476
|
+
disabled = false,
|
|
477
|
+
problems,
|
|
478
|
+
downloadHandler,
|
|
479
|
+
info,
|
|
480
|
+
loading = false,
|
|
481
|
+
showErrorAlerts = "onErrorStatus",
|
|
482
|
+
warningMessage,
|
|
483
|
+
deleteEntity,
|
|
484
|
+
testId,
|
|
485
|
+
enableTracking = true,
|
|
486
|
+
fallbackErrorMessage
|
|
487
|
+
}) => {
|
|
488
|
+
const { t } = useTranslation("common");
|
|
489
|
+
const userEvents = useAnalyticsContext();
|
|
490
|
+
const [isConfirmShown, setIsConfirmShown] = useState(false);
|
|
491
|
+
const isDeletable = !!deleteEntity;
|
|
492
|
+
const shouldShowErrorAlert = showErrorAlerts === "always" || showErrorAlerts === "onErrorStatus" && status === TaskStatuses.ERROR;
|
|
493
|
+
const handleNavigateToTask = () => {
|
|
494
|
+
if (enableTracking) {
|
|
495
|
+
userEvents.addJourneyEvent("Clicked button", {
|
|
496
|
+
actionType: "open",
|
|
497
|
+
task: void 0,
|
|
498
|
+
label: titleKey
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
onNavigateToTask?.();
|
|
502
|
+
};
|
|
503
|
+
const avatarVariant = disabled ? "disabled" : "primary";
|
|
504
|
+
const handleRemoveIntent = (event) => {
|
|
505
|
+
event.stopPropagation();
|
|
506
|
+
setIsConfirmShown(true);
|
|
507
|
+
};
|
|
508
|
+
const dismissConfirm = () => {
|
|
509
|
+
setIsConfirmShown(false);
|
|
510
|
+
};
|
|
511
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
512
|
+
/* @__PURE__ */ jsx(
|
|
513
|
+
Card,
|
|
514
|
+
{
|
|
515
|
+
stateful: onNavigateToTask && !loading && !disabled,
|
|
516
|
+
warningMessage,
|
|
517
|
+
onClick: loading ? void 0 : handleNavigateToTask,
|
|
518
|
+
onKeyDown: handleKeys(["Enter"], handleNavigateToTask ?? noop),
|
|
519
|
+
className: "adyen-task",
|
|
520
|
+
disabled,
|
|
521
|
+
children: /* @__PURE__ */ jsxs(
|
|
522
|
+
LoaderWrapper,
|
|
523
|
+
{
|
|
524
|
+
status: loading ? "loading" : "success",
|
|
525
|
+
formOpacityWhenLoading: 0.3,
|
|
526
|
+
loaderSize: "medium",
|
|
527
|
+
children: [
|
|
528
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-task-item", "data-testid": testId, children: [
|
|
529
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-task-item__header", children: [
|
|
530
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-task-item__heading", children: [
|
|
531
|
+
/* @__PURE__ */ jsx(Avatar, { variant: avatarVariant, iconName: icon }),
|
|
532
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-task-item__body", children: /* @__PURE__ */ jsx("span", { className: "adyen-task-item__title", children: title || t(($) => $[titleKey]) }) })
|
|
533
|
+
] }),
|
|
534
|
+
info && /* @__PURE__ */ jsxs("div", { className: "adyen-task-item__info", children: [
|
|
535
|
+
/* @__PURE__ */ jsx(Icon, { name: "info-circle" }),
|
|
536
|
+
/* @__PURE__ */ jsx("span", { children: info })
|
|
537
|
+
] })
|
|
538
|
+
] }),
|
|
539
|
+
/* @__PURE__ */ jsxs("aside", { className: "adyen-task-item__status", children: [
|
|
540
|
+
/* @__PURE__ */ jsx(
|
|
541
|
+
TaskItemStatus,
|
|
542
|
+
{
|
|
543
|
+
status,
|
|
544
|
+
statusLabel,
|
|
545
|
+
downloadHandler
|
|
546
|
+
}
|
|
547
|
+
),
|
|
548
|
+
isDeletable ? /* @__PURE__ */ jsx(
|
|
549
|
+
IconButton,
|
|
550
|
+
{
|
|
551
|
+
ariaLabel: t(($) => $["delete"]),
|
|
552
|
+
icon: "bin",
|
|
553
|
+
variant: "tertiary",
|
|
554
|
+
onClick: handleRemoveIntent,
|
|
555
|
+
disabled: isConfirmShown
|
|
556
|
+
}
|
|
557
|
+
) : /* @__PURE__ */ jsx(Icon, { name: "chevron-right" })
|
|
558
|
+
] })
|
|
559
|
+
] }),
|
|
560
|
+
shouldShowErrorAlert && /* @__PURE__ */ jsx(
|
|
561
|
+
VerificationErrorAlert,
|
|
562
|
+
{
|
|
563
|
+
className: "adyen-task-item-alert",
|
|
564
|
+
problems,
|
|
565
|
+
fallbackErrorMessage
|
|
566
|
+
}
|
|
567
|
+
)
|
|
568
|
+
]
|
|
569
|
+
}
|
|
570
|
+
)
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
isConfirmShown && isDeletable && /* @__PURE__ */ jsx(
|
|
574
|
+
Confirm,
|
|
575
|
+
{
|
|
576
|
+
title: t(($) => $["deleteItem"], { item: title }),
|
|
577
|
+
description: t(($) => $["thisActionIsPermanent"]),
|
|
578
|
+
onConfirm: deleteEntity,
|
|
579
|
+
confirmText: t(($) => $["delete"]),
|
|
580
|
+
onCancel: dismissConfirm,
|
|
581
|
+
critical: true
|
|
582
|
+
}
|
|
583
|
+
)
|
|
584
|
+
] });
|
|
585
|
+
};
|
|
586
|
+
const PayoutAccountTaskListItem = ({
|
|
587
|
+
account,
|
|
588
|
+
capabilityProblems,
|
|
589
|
+
onNavigateToTask,
|
|
590
|
+
payinPayoutTaskStatus
|
|
591
|
+
}) => {
|
|
592
|
+
const { t } = useTranslation("common");
|
|
593
|
+
const { showToast } = useToastContext();
|
|
594
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
595
|
+
const { mutateAsync: deleteTransferInstrument } = useDeleteTransferInstrument();
|
|
596
|
+
const isInstantVerificationAccount = isInstantVerifiedAccount(account);
|
|
597
|
+
const obscuredAccountNumber = getObscuredAccountNumber(account);
|
|
598
|
+
const getTaskStatus2 = useGetTaskStatus();
|
|
599
|
+
const status = isExperimentEnabled("UseTaskStatusApiForPayout") ? getAccountTaskStatus(account.id, payinPayoutTaskStatus) : getTaskStatus2(TaskTypes.PAYOUT, account.id);
|
|
600
|
+
const handleDeleteTransferInstrument = async () => {
|
|
601
|
+
try {
|
|
602
|
+
await deleteTransferInstrument(account.id);
|
|
603
|
+
showToast({ label: t(($) => $["transferInstrumentDeleted"]), variant: "success" });
|
|
604
|
+
} catch {
|
|
605
|
+
showToast({ label: t(($) => $["failedToDeletePayoutAccount"]), variant: "error" });
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
return /* @__PURE__ */ jsx(
|
|
609
|
+
TaskListItem,
|
|
610
|
+
{
|
|
611
|
+
disabled: isInstantVerificationAccount && status === TaskStatuses.PROCESSING,
|
|
612
|
+
onNavigateToTask: isInstantVerificationAccount ? void 0 : onNavigateToTask,
|
|
613
|
+
icon: "payout",
|
|
614
|
+
titleKey: "accountNumber",
|
|
615
|
+
title: obscuredAccountNumber,
|
|
616
|
+
status,
|
|
617
|
+
problems: capabilityProblems?.BankAccount?.[account.id],
|
|
618
|
+
fallbackErrorMessage: isInstantVerificationAccount ? t(($) => $["verificationErrorMessageTrustedTransferInstrument"]) : void 0,
|
|
619
|
+
deleteEntity: handleDeleteTransferInstrument
|
|
620
|
+
}
|
|
621
|
+
);
|
|
622
|
+
};
|
|
623
|
+
const TaskListGroup = ({ title, children }) => /* @__PURE__ */ jsxs("article", { className: "adyen-task-list-group", children: [
|
|
624
|
+
title && /* @__PURE__ */ jsx("header", { className: "adyen-task-list-group__header", children: /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "body-stronger", color: "secondary", children: title }) }),
|
|
625
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-card__body", children: /* @__PURE__ */ jsx(StackLayout, { gap: "xSmall", children }) })
|
|
626
|
+
] });
|
|
627
|
+
const LEGAL_ENTITY_BASE_TASKS = [
|
|
628
|
+
TaskTypes.INDIVIDUAL,
|
|
629
|
+
TaskTypes.BUSINESS_DETAILS,
|
|
630
|
+
TaskTypes.DECISION_MAKER_OVERVIEW
|
|
631
|
+
];
|
|
632
|
+
const CONTRACT_TASKS = [TaskTypes.SERVICE_AGREEMENT, TaskTypes.PCI_DSS];
|
|
633
|
+
function TaskList({ onNavigateToTask, singpassComponent }) {
|
|
634
|
+
const { data: rootLe, isLoading } = useLegalEntity(ROOT_LE);
|
|
635
|
+
const { data: existingBusinessLines, isLoading: isLoadingBl } = useBusinessLines();
|
|
636
|
+
const capabilityProblems = useCapabilityProblems() ?? {};
|
|
637
|
+
if (isLoading || !rootLe || isLoadingBl) {
|
|
638
|
+
return /* @__PURE__ */ jsx(Loader, { size: "large" });
|
|
639
|
+
}
|
|
640
|
+
return /* @__PURE__ */ jsx(
|
|
641
|
+
TaskListInner,
|
|
642
|
+
{
|
|
643
|
+
onNavigateToTask,
|
|
644
|
+
singpassComponent,
|
|
645
|
+
legalEntityResponse: rootLe,
|
|
646
|
+
capabilityProblems,
|
|
647
|
+
existingBusinessLines
|
|
648
|
+
}
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
function TaskListInner({
|
|
652
|
+
onNavigateToTask,
|
|
653
|
+
legalEntityResponse,
|
|
654
|
+
capabilityProblems,
|
|
655
|
+
singpassComponent,
|
|
656
|
+
existingBusinessLines
|
|
657
|
+
}) {
|
|
658
|
+
const userEvents = useAnalyticsContext();
|
|
659
|
+
const { t } = useTranslation("common");
|
|
660
|
+
const { showToast } = useToastContext();
|
|
661
|
+
const { rootLegalEntityId, baseUrl } = useApiContext();
|
|
662
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
663
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
664
|
+
const { accountHolder } = useAccountHolder();
|
|
665
|
+
const tasks = useGlobalStore().tasks.value;
|
|
666
|
+
const getTaskStatus2 = useGetTaskStatus();
|
|
667
|
+
const businessSetup = useBusinessSetup(legalEntityResponse);
|
|
668
|
+
const canSeeIntroduction = useCanSeeIntroduction({ legalEntity: legalEntityResponse });
|
|
669
|
+
const additionalSalesChannels = useSalesChannelsSettings();
|
|
670
|
+
const { remediationMessages } = useDataMissingRemediations({
|
|
671
|
+
legalEntityId: legalEntityResponse.id,
|
|
672
|
+
problems: capabilityProblems
|
|
673
|
+
});
|
|
674
|
+
const { data: pciStatus } = usePciStatus(
|
|
675
|
+
{ additionalSalesChannels },
|
|
676
|
+
{ enabled: tasks.includes(TaskTypes.PCI_DSS) }
|
|
677
|
+
);
|
|
678
|
+
const { data: pciQuestionnaireList } = usePciQuestionnaireList();
|
|
679
|
+
const { data: termsOfServiceStatus } = useTermsOfServiceStatus();
|
|
680
|
+
const { data: termsOfServiceStatusAcceptanceInfos } = useTermsOfServiceAcceptanceInfos();
|
|
681
|
+
const { data: taskStatuses } = useTaskStatus({
|
|
682
|
+
refetchInterval: (query) => {
|
|
683
|
+
const { data: response } = query.state || {};
|
|
684
|
+
const statuses = response?.statuses;
|
|
685
|
+
const areAllTasksFinishedOrEmpty = statuses?.length === 0 || statuses?.every((task) => task.status === "FINISHED");
|
|
686
|
+
return areAllTasksFinishedOrEmpty ? TASK_STATUS_COMPLETED_POLLING_INTERVAL_MS : TASK_STATUS_POLLING_INTERVAL_MS;
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
690
|
+
const hidePayoutAccountTaskExperiment = isExperimentEnabled("HidePayoutAccountTask");
|
|
691
|
+
const hidePciTaskExperiment = isExperimentEnabled("HidePciTask");
|
|
692
|
+
const showCustomerSupportV4 = isExperimentEnabled("ShowCustomerSupportV4");
|
|
693
|
+
const EnableSignPCIBeforeTOS = isExperimentEnabled("EnableSignPCIBeforeTOS");
|
|
694
|
+
const transferInstrumentLimit = useSetting("transferInstrumentLimit");
|
|
695
|
+
const normalizedTasks = normalizeTaskStatuses(taskStatuses);
|
|
696
|
+
setNormalizedTaskStatusStore(normalizedTasks);
|
|
697
|
+
const payinPayoutTaskStatus = normalizedTasks?.PAYOUT ?? normalizedTasks?.PAYIN;
|
|
698
|
+
const businessDetailsTaskStatus = normalizedTasks?.BUSINESS_DETAILS?.status ?? TaskStatuses.DETAILS_REQUIRED;
|
|
699
|
+
const businessLinesTaskStatus = existingBusinessLines?.length ?? 0 > 0 ? TaskStatuses.FINISHED : TaskStatuses.EMPTY;
|
|
700
|
+
const isReview = Boolean(
|
|
701
|
+
capabilityProblems?.LegalEntity?.[legalEntityResponse.id]?.isReviewRequired
|
|
702
|
+
);
|
|
703
|
+
const hasTrust = accountHolder === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
|
|
704
|
+
const hasUnincorporatedPartnership = accountHolder === "anUnincorporatedPartnership" || isPartOfUnincorporatedPartnership(legalEntityResponse);
|
|
705
|
+
const hasSoleProprietorship = accountHolder === "mySoleProprietorName" || hasSolePropInLegalEntity(legalEntityResponse);
|
|
706
|
+
const isLegalRepresentativeRequired = isExperimentEnabled("EnableAgeVerification") && doesLegalEntityRequiresLegalRepresentative(legalEntityResponse);
|
|
707
|
+
const legalRepresentative = isLegalRepresentativeRequired && getLegalRepresentative(legalEntityResponse);
|
|
708
|
+
const transferInstruments = legalEntityResponse?.transferInstruments || [];
|
|
709
|
+
const canAddPayoutAccount = legalEntityResponse?.organization?.legalName || legalEntityResponse?.individual?.name;
|
|
710
|
+
const hasPayinTaskNotPayout = tasks.includes(TaskTypes.PAYIN) && !tasks.includes(TaskTypes.PAYOUT);
|
|
711
|
+
const payoutTaskDescriptionKey = isReview ? "payoutAccountsDescriptionReview" : "payoutAccountsDescription";
|
|
712
|
+
const pciHasDocuments = !!pciQuestionnaireList?.data?.length;
|
|
713
|
+
const canSignPci = (
|
|
714
|
+
// PCI requires decision makers to be added
|
|
715
|
+
legalEntityResponse.type === LegalEntityTypes.ORGANIZATION && !!legalEntityResponse?.entityAssociations?.length || legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL && !!legalEntityResponse?.entityAssociations?.length
|
|
716
|
+
);
|
|
717
|
+
const canDownloadPci = !pciStatus?.signingRequired && pciHasDocuments;
|
|
718
|
+
const hasSignedPci = !pciStatus?.signingRequired && canSignPci;
|
|
719
|
+
const serviceAgreementTypes = termsOfServiceStatus?.termsOfServiceTypes ?? [];
|
|
720
|
+
const serviceAgreementAcceptanceInfos = termsOfServiceStatusAcceptanceInfos?.data ?? [];
|
|
721
|
+
const hasServiceAgreementSigners = legalEntityResponse.type === LegalEntityTypes.ORGANIZATION && getOwnSignatories(legalEntityResponse).length || Boolean(legalRepresentative) || legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL && !!legalEntityResponse?.individual;
|
|
722
|
+
const hasTaskOfGroupAccountDetails = tasks.some((task) => LEGAL_ENTITY_BASE_TASKS.includes(task));
|
|
723
|
+
const hasContractTasks = tasks.some((task) => CONTRACT_TASKS.includes(task));
|
|
724
|
+
const hasFinancingTasks = tasks.includes(TaskTypes.BUSINESS_FINANCING) || tasks.includes(TaskTypes.SOURCE_OF_FUNDS);
|
|
725
|
+
const showServiceAgreementTask = tasks.includes(TaskTypes.SERVICE_AGREEMENT) && (serviceAgreementTypes.length > 0 || serviceAgreementAcceptanceInfos.length > 0);
|
|
726
|
+
const showPciTask = tasks.includes(TaskTypes.PCI_DSS) && (canDownloadPci || pciStatus?.signingRequired) && !hidePciTaskExperiment;
|
|
727
|
+
const showContractTasks = hasContractTasks && (showPciTask || showServiceAgreementTask);
|
|
728
|
+
const shouldSignPciFirst = showServiceAgreementTask && showPciTask && !hasSignedPci;
|
|
729
|
+
const areServiceAgreementTasksDisabled = EnableSignPCIBeforeTOS ? !hasServiceAgreementSigners || shouldSignPciFirst : !hasServiceAgreementSigners;
|
|
730
|
+
const isPciTaskDisabled = !pciStatus?.signingRequired || !canSignPci;
|
|
731
|
+
const getBusinessTaskListTitleKey = () => {
|
|
732
|
+
if (hasUnincorporatedPartnership) {
|
|
733
|
+
return "tellUsMoreAboutPrimaryPartner";
|
|
734
|
+
} else if (tasks.includes(TaskTypes.BUSINESS_DETAILS)) {
|
|
735
|
+
return isReview ? "businessAccountDetailsDescriptionReview" : "businessAccountDetailsDescription";
|
|
736
|
+
} else if (canChangeEntityType) {
|
|
737
|
+
return "provideFewDetailsAboutYourself";
|
|
738
|
+
} else {
|
|
739
|
+
return "accountDetailsDescription";
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
const getEmptyBankAccountProblems = () => {
|
|
743
|
+
const transferInstrumentId = legalEntityResponse?.transferInstruments?.[0]?.id;
|
|
744
|
+
return transferInstrumentId ? capabilityProblems?.BankAccount?.[transferInstrumentId] : void 0;
|
|
745
|
+
};
|
|
746
|
+
const onEditBusinessSetupClick = () => {
|
|
747
|
+
userEvents.addTaskEvent("Clicked button", {
|
|
748
|
+
task: TaskTypes.TASKS_OVERVIEW,
|
|
749
|
+
actionType: "edit"
|
|
750
|
+
});
|
|
751
|
+
onNavigateToTask(TaskTypes.BUSINESS_TYPE_SELECTION);
|
|
752
|
+
};
|
|
753
|
+
const onPciDownload = async () => {
|
|
754
|
+
try {
|
|
755
|
+
const response = await getPciQuestionnaireList(rootLegalEntityId.value, baseUrl.value);
|
|
756
|
+
if (!response.data) return;
|
|
757
|
+
await Promise.all(
|
|
758
|
+
response.data.map(async (pciQuestionnaireInfo) => {
|
|
759
|
+
const pciQuestionnaire = await getPciQuestionnaire(
|
|
760
|
+
rootLegalEntityId.value,
|
|
761
|
+
baseUrl.value,
|
|
762
|
+
pciQuestionnaireInfo.id
|
|
763
|
+
);
|
|
764
|
+
await downloadFile(pciQuestionnaire.content, `${pciQuestionnaire.id}.pdf`);
|
|
765
|
+
})
|
|
766
|
+
);
|
|
767
|
+
} catch {
|
|
768
|
+
showToast({ label: t(($) => $["failedToDownloadPci"]), variant: "error" });
|
|
769
|
+
} finally {
|
|
770
|
+
userEvents.addTaskEvent("Clicked button", {
|
|
771
|
+
task: TaskTypes.PCI_DSS,
|
|
772
|
+
actionType: "download"
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
};
|
|
776
|
+
const handleOnNavigateToTaskReview = () => onNavigateToTask(TaskTypes.REVIEW);
|
|
777
|
+
const handleOnNavigateToTaskIndividual = () => onNavigateToTask(TaskTypes.INDIVIDUAL);
|
|
778
|
+
const handleOnNavigateToTaskBusinessDetails = () => onNavigateToTask(TaskTypes.BUSINESS_DETAILS);
|
|
779
|
+
const handleOnNavigateToTaskBusinessLines = () => onNavigateToTask(TaskTypes.ACQUIRING_BUSINESS_LINE);
|
|
780
|
+
const handleOnNavigateToTaskCustomerSupport = () => onNavigateToTask(TaskTypes.CUSTOMER_SUPPORT);
|
|
781
|
+
const handleOnNavigateToTaskDecisionMaker = () => onNavigateToTask(TaskTypes.DECISION_MAKER_OVERVIEW);
|
|
782
|
+
const handleOnNavigateToTaskTrust = () => onNavigateToTask(TaskTypes.TRUST);
|
|
783
|
+
const handleOnNavigateToTaskTrustMember = () => onNavigateToTask(TaskTypes.TRUST_MEMBER_OVERVIEW);
|
|
784
|
+
const handleOnNavigateToTaskPayout = (id) => hasPayinTaskNotPayout ? onNavigateToTask(TaskTypes.PAYIN, id) : onNavigateToTask(TaskTypes.PAYOUT, id);
|
|
785
|
+
const handleOnNavigateToPci = () => !canDownloadPci && onNavigateToTask(TaskTypes.PCI_DSS);
|
|
786
|
+
const handleOnNavigateToSoleProp = () => onNavigateToTask(TaskTypes.SOLE_PROPRIETOR_COMPANY);
|
|
787
|
+
const handleOnNavigateToServiceAgreement = () => onNavigateToTask(TaskTypes.SERVICE_AGREEMENT);
|
|
788
|
+
const handleOnNavigateToTaskLegalRepresentative = () => onNavigateToTask(TaskTypes.LEGAL_REPRESENTATIVE_DETAILS);
|
|
789
|
+
const handleOnNavigateToSourceOfFunds = () => onNavigateToTask(TaskTypes.SOURCE_OF_FUNDS);
|
|
790
|
+
const handleOnNavigateToBusinessFinancing = () => onNavigateToTask(TaskTypes.BUSINESS_FINANCING);
|
|
791
|
+
const handleOnNavigateToTaxReporting = () => onNavigateToTask(TaskTypes.TAX_REPORTING);
|
|
792
|
+
const showDecisionMakersWarning = Boolean(
|
|
793
|
+
getOwnDecisionMakersLegalEntityIds(legalEntityResponse).length && remediationMessages.DECISION_MAKER
|
|
794
|
+
);
|
|
795
|
+
useEffect(() => {
|
|
796
|
+
if (showDecisionMakersWarning) {
|
|
797
|
+
userEvents.addTaskEvent("Encountered error", {
|
|
798
|
+
task: TaskTypes.TASKS_OVERVIEW,
|
|
799
|
+
actionType: "alert",
|
|
800
|
+
returnValue: "missingDecisionMaker"
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
}, [showDecisionMakersWarning, userEvents]);
|
|
804
|
+
return /* @__PURE__ */ jsxs("div", { className: "adyen-task-list__container", children: [
|
|
805
|
+
canSeeIntroduction && /* @__PURE__ */ jsx("div", { className: "adyen-task-list__nav", children: /* @__PURE__ */ jsx(Button, { variant: "link", onClick: () => onNavigateToTask(TaskTypes.INTRODUCTION), children: t(($) => $["goToIntroduction"]) }) }),
|
|
806
|
+
canChangeEntityType && /* @__PURE__ */ jsxs("header", { className: "adyen-task-list__heading", children: [
|
|
807
|
+
/* @__PURE__ */ jsx(Typography, { el: "h1", variant: "title-l", children: t(($) => $["setUpYourAccount"]) }),
|
|
808
|
+
/* @__PURE__ */ jsxs(Typography, { el: "p", variant: "title", className: "adyen-task-list__description", children: [
|
|
809
|
+
/* @__PURE__ */ jsx(Typography, { el: "span", variant: "body-strongest", children: t(($) => $["yourBusinessSetup"], {
|
|
810
|
+
businessSetup: businessSetup ? t(($) => $[businessSetup]) : t(($) => $["unknown"])
|
|
811
|
+
}) }),
|
|
812
|
+
/* @__PURE__ */ jsx(
|
|
813
|
+
IconButton,
|
|
814
|
+
{
|
|
815
|
+
ariaLabel: t(($) => $["editBusinessSetup"]),
|
|
816
|
+
icon: "edit",
|
|
817
|
+
variant: "tertiary",
|
|
818
|
+
onClick: onEditBusinessSetupClick
|
|
819
|
+
}
|
|
820
|
+
)
|
|
821
|
+
] })
|
|
822
|
+
] }),
|
|
823
|
+
singpassComponent,
|
|
824
|
+
/* @__PURE__ */ jsxs(StackLayout, { children: [
|
|
825
|
+
hasTaskOfGroupAccountDetails && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $[getBusinessTaskListTitleKey()]), children: [
|
|
826
|
+
tasks.includes(TaskTypes.INDIVIDUAL) && /* @__PURE__ */ jsx(
|
|
827
|
+
TaskListItem,
|
|
828
|
+
{
|
|
829
|
+
onNavigateToTask: handleOnNavigateToTaskIndividual,
|
|
830
|
+
icon: "decision-maker",
|
|
831
|
+
titleKey: hasTrust ? "trusteePersonalDetails" : hasUnincorporatedPartnership ? "primaryPartnerDetails" : "personalDetails",
|
|
832
|
+
status: getTaskStatus2(TaskTypes.INDIVIDUAL),
|
|
833
|
+
problems: capabilityProblems?.LegalEntity?.[legalEntityResponse.id]
|
|
834
|
+
}
|
|
835
|
+
),
|
|
836
|
+
tasks.includes(TaskTypes.BUSINESS_DETAILS) && /* @__PURE__ */ jsx(
|
|
837
|
+
TaskListItem,
|
|
838
|
+
{
|
|
839
|
+
testId: TaskTypes.BUSINESS_DETAILS,
|
|
840
|
+
onNavigateToTask: handleOnNavigateToTaskBusinessDetails,
|
|
841
|
+
icon: "company",
|
|
842
|
+
titleKey: hasTrust ? "businessTrusteeDetails" : hasUnincorporatedPartnership ? "primaryPartnerDetails" : "businessDetails",
|
|
843
|
+
status: businessDetailsTaskStatus,
|
|
844
|
+
problems: capabilityProblems?.LegalEntity?.[legalEntityResponse.id]
|
|
845
|
+
}
|
|
846
|
+
),
|
|
847
|
+
hasSoleProprietorship && /* @__PURE__ */ jsx(
|
|
848
|
+
TaskListItem,
|
|
849
|
+
{
|
|
850
|
+
onNavigateToTask: handleOnNavigateToSoleProp,
|
|
851
|
+
icon: "company",
|
|
852
|
+
titleKey: canChangeEntityType ? "soleProprietorshipDetails" : "soleProprietorDetails",
|
|
853
|
+
status: getTaskStatus2(TaskTypes.SOLE_PROPRIETOR_COMPANY),
|
|
854
|
+
problems: getOwnSolePropProblems(legalEntityResponse, capabilityProblems)
|
|
855
|
+
}
|
|
856
|
+
),
|
|
857
|
+
isLegalRepresentativeRequired && /* @__PURE__ */ jsx(
|
|
858
|
+
TaskListItem,
|
|
859
|
+
{
|
|
860
|
+
onNavigateToTask: handleOnNavigateToTaskLegalRepresentative,
|
|
861
|
+
icon: "decision-maker",
|
|
862
|
+
titleKey: "legalRepresentative",
|
|
863
|
+
status: getTaskStatus2(TaskTypes.LEGAL_REPRESENTATIVE_DETAILS)
|
|
864
|
+
}
|
|
865
|
+
),
|
|
866
|
+
tasks.includes(TaskTypes.DECISION_MAKER_OVERVIEW) && /* @__PURE__ */ jsx(
|
|
867
|
+
TaskListItem,
|
|
868
|
+
{
|
|
869
|
+
onNavigateToTask: handleOnNavigateToTaskDecisionMaker,
|
|
870
|
+
icon: "decision-maker",
|
|
871
|
+
titleKey: hasUnincorporatedPartnership ? "entityDecisionMakers" : "decisionMakers",
|
|
872
|
+
status: getTaskStatus2(TaskTypes.DECISION_MAKER_OVERVIEW),
|
|
873
|
+
warningMessage: showDecisionMakersWarning ? remediationMessages[TaskTypes.DECISION_MAKER] : void 0
|
|
874
|
+
}
|
|
875
|
+
),
|
|
876
|
+
tasks.includes(TaskTypes.ACQUIRING_BUSINESS_LINE) && /* @__PURE__ */ jsx(
|
|
877
|
+
TaskListItem,
|
|
878
|
+
{
|
|
879
|
+
testId: TaskTypes.ACQUIRING_BUSINESS_LINE,
|
|
880
|
+
onNavigateToTask: handleOnNavigateToTaskBusinessLines,
|
|
881
|
+
icon: "solutionPayments",
|
|
882
|
+
titleKey: "businessLines",
|
|
883
|
+
status: businessLinesTaskStatus
|
|
884
|
+
}
|
|
885
|
+
),
|
|
886
|
+
showCustomerSupportV4 && tasks.includes(TaskTypes.CUSTOMER_SUPPORT) && /* @__PURE__ */ jsx(
|
|
887
|
+
TaskListItem,
|
|
888
|
+
{
|
|
889
|
+
onNavigateToTask: handleOnNavigateToTaskCustomerSupport,
|
|
890
|
+
icon: "webinar",
|
|
891
|
+
titleKey: "customerSupport",
|
|
892
|
+
status: normalizedTasks?.CUSTOMER_SUPPORT?.status ?? TaskStatuses.DETAILS_REQUIRED
|
|
893
|
+
}
|
|
894
|
+
)
|
|
895
|
+
] }),
|
|
896
|
+
hasTrust && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["trustDetailsDescription"]), children: [
|
|
897
|
+
/* @__PURE__ */ jsx(
|
|
898
|
+
TaskListItem,
|
|
899
|
+
{
|
|
900
|
+
onNavigateToTask: handleOnNavigateToTaskTrust,
|
|
901
|
+
icon: "trust",
|
|
902
|
+
titleKey: "trustDetails",
|
|
903
|
+
status: getTaskStatus2(TaskTypes.TRUST),
|
|
904
|
+
problems: getOwnTrustProblems(legalEntityResponse, capabilityProblems)
|
|
905
|
+
}
|
|
906
|
+
),
|
|
907
|
+
/* @__PURE__ */ jsx(
|
|
908
|
+
TaskListItem,
|
|
909
|
+
{
|
|
910
|
+
onNavigateToTask: handleOnNavigateToTaskTrustMember,
|
|
911
|
+
icon: "decision-maker",
|
|
912
|
+
titleKey: "trustMembers",
|
|
913
|
+
status: getTaskStatus2(TaskTypes.TRUST_MEMBER_OVERVIEW)
|
|
914
|
+
}
|
|
915
|
+
)
|
|
916
|
+
] }),
|
|
917
|
+
hasUnincorporatedPartnership && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["partnershipUnincorporated"]), children: [
|
|
918
|
+
/* @__PURE__ */ jsx(
|
|
919
|
+
TaskListItem,
|
|
920
|
+
{
|
|
921
|
+
onNavigateToTask: () => onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP),
|
|
922
|
+
icon: "trust",
|
|
923
|
+
titleKey: "unincorporatedDetails",
|
|
924
|
+
status: getTaskStatus2(TaskTypes.UNINCORPORATED_PARTNERSHIP),
|
|
925
|
+
problems: getOwnUnincorporatedPartnershipProblems(
|
|
926
|
+
legalEntityResponse,
|
|
927
|
+
capabilityProblems
|
|
928
|
+
)
|
|
929
|
+
}
|
|
930
|
+
),
|
|
931
|
+
/* @__PURE__ */ jsx(
|
|
932
|
+
TaskListItem,
|
|
933
|
+
{
|
|
934
|
+
onNavigateToTask: () => {
|
|
935
|
+
if (!isPartOfUnincorporatedPartnership(legalEntityResponse)) {
|
|
936
|
+
onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP);
|
|
937
|
+
} else {
|
|
938
|
+
onNavigateToTask(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW);
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
icon: "decision-maker",
|
|
942
|
+
titleKey: "unincorporatedPartnershipMembers",
|
|
943
|
+
status: getTaskStatus2(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW)
|
|
944
|
+
}
|
|
945
|
+
)
|
|
946
|
+
] }),
|
|
947
|
+
hasFinancingTasks && /* @__PURE__ */ jsxs(TaskListGroup, { children: [
|
|
948
|
+
tasks.includes(TaskTypes.SOURCE_OF_FUNDS) && /* @__PURE__ */ jsx(
|
|
949
|
+
TaskListItem,
|
|
950
|
+
{
|
|
951
|
+
onNavigateToTask: handleOnNavigateToSourceOfFunds,
|
|
952
|
+
icon: "cash-stack",
|
|
953
|
+
titleKey: "fundingSources",
|
|
954
|
+
status: normalizedTasks?.SOURCE_OF_FUNDS?.status ?? TaskStatuses.DETAILS_REQUIRED
|
|
955
|
+
}
|
|
956
|
+
),
|
|
957
|
+
tasks.includes(TaskTypes.BUSINESS_FINANCING) && /* @__PURE__ */ jsx(
|
|
958
|
+
TaskListItem,
|
|
959
|
+
{
|
|
960
|
+
onNavigateToTask: handleOnNavigateToBusinessFinancing,
|
|
961
|
+
icon: "capital",
|
|
962
|
+
titleKey: "businessFinancing",
|
|
963
|
+
status: normalizedTasks?.BUSINESS_FINANCING?.status ?? TaskStatuses.DETAILS_REQUIRED
|
|
964
|
+
}
|
|
965
|
+
)
|
|
966
|
+
] }),
|
|
967
|
+
tasks.includes(TaskTypes.TAX_REPORTING) && /* @__PURE__ */ jsx(TaskListGroup, { children: /* @__PURE__ */ jsx(
|
|
968
|
+
TaskListItem,
|
|
969
|
+
{
|
|
970
|
+
onNavigateToTask: handleOnNavigateToTaxReporting,
|
|
971
|
+
icon: "reporting",
|
|
972
|
+
titleKey: "taxReporting",
|
|
973
|
+
status: normalizedTasks?.TAX_REPORTING?.status ?? TaskStatuses.DETAILS_REQUIRED
|
|
974
|
+
}
|
|
975
|
+
) }),
|
|
976
|
+
(tasks.includes(TaskTypes.PAYOUT) || tasks.includes(TaskTypes.PAYIN)) && !hidePayoutAccountTaskExperiment && /* @__PURE__ */ jsx(
|
|
977
|
+
TaskListGroup,
|
|
978
|
+
{
|
|
979
|
+
title: canChangeEntityType ? t(($) => $["payoutBankAccounts"]) : t(
|
|
980
|
+
($) => $[hasPayinTaskNotPayout ? "payinAccountsDescription" : payoutTaskDescriptionKey]
|
|
981
|
+
),
|
|
982
|
+
children: transferInstruments.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
983
|
+
transferInstruments.map((transferInstrument) => /* @__PURE__ */ jsx(
|
|
984
|
+
PayoutAccountTaskListItem,
|
|
985
|
+
{
|
|
986
|
+
account: transferInstrument,
|
|
987
|
+
capabilityProblems,
|
|
988
|
+
onNavigateToTask: () => handleOnNavigateToTaskPayout(transferInstrument.id),
|
|
989
|
+
payinPayoutTaskStatus
|
|
990
|
+
},
|
|
991
|
+
transferInstrument.id
|
|
992
|
+
)),
|
|
993
|
+
!transferInstrumentLimit || transferInstruments.length < transferInstrumentLimit ? /* @__PURE__ */ jsxs(
|
|
994
|
+
Card,
|
|
995
|
+
{
|
|
996
|
+
stateful: true,
|
|
997
|
+
onClick: () => handleOnNavigateToTaskPayout(),
|
|
998
|
+
className: "adyen-task adyen-kyc-add-payout",
|
|
999
|
+
disabled: !canAddPayoutAccount,
|
|
1000
|
+
children: [
|
|
1001
|
+
/* @__PURE__ */ jsx(Icon, { name: "plus", className: "adyen-task-list__card-icon " }),
|
|
1002
|
+
/* @__PURE__ */ jsx("span", { children: canChangeEntityType ? t(($) => $["addExtraBankAccount"]) : t(
|
|
1003
|
+
($) => $[hasPayinTaskNotPayout ? "addExtraPayinAccount" : "addExtraPayoutAccount"]
|
|
1004
|
+
) })
|
|
1005
|
+
]
|
|
1006
|
+
}
|
|
1007
|
+
) : null
|
|
1008
|
+
] }) : /* @__PURE__ */ jsx(
|
|
1009
|
+
TaskListItem,
|
|
1010
|
+
{
|
|
1011
|
+
onNavigateToTask: () => handleOnNavigateToTaskPayout(),
|
|
1012
|
+
icon: "payout",
|
|
1013
|
+
titleKey: canChangeEntityType ? "bankAccountDetails" : hasPayinTaskNotPayout ? "payinDetails" : "payoutDetails",
|
|
1014
|
+
status: TaskStatuses.DETAILS_REQUIRED,
|
|
1015
|
+
disabled: !canAddPayoutAccount,
|
|
1016
|
+
problems: getEmptyBankAccountProblems()
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1019
|
+
}
|
|
1020
|
+
),
|
|
1021
|
+
showContractTasks && /* @__PURE__ */ jsxs(TaskListGroup, { title: t(($) => $["reviewAndSignLegalDisclosures"]), children: [
|
|
1022
|
+
showPciTask && /* @__PURE__ */ jsx(
|
|
1023
|
+
TaskListItem,
|
|
1024
|
+
{
|
|
1025
|
+
onNavigateToTask: handleOnNavigateToPci,
|
|
1026
|
+
icon: "pci",
|
|
1027
|
+
titleKey: "pciDssQuestionnaire",
|
|
1028
|
+
status: canDownloadPci ? TaskStatuses.DOWNLOAD : TaskStatuses.SIGN,
|
|
1029
|
+
statusLabel: canDownloadPci ? t(($) => $["downloadACopy"]) : void 0,
|
|
1030
|
+
downloadHandler: onPciDownload,
|
|
1031
|
+
disabled: isPciTaskDisabled,
|
|
1032
|
+
info: isPciTaskDisabled && !canDownloadPci ? t(($) => $["requiresDecisionMakers"]) : void 0
|
|
1033
|
+
}
|
|
1034
|
+
),
|
|
1035
|
+
showServiceAgreementTask && /* @__PURE__ */ jsx(
|
|
1036
|
+
TaskListItem,
|
|
1037
|
+
{
|
|
1038
|
+
onNavigateToTask: handleOnNavigateToServiceAgreement,
|
|
1039
|
+
icon: "contract",
|
|
1040
|
+
titleKey: "signServiceAgreement",
|
|
1041
|
+
disabled: areServiceAgreementTasksDisabled,
|
|
1042
|
+
status: serviceAgreementTypes.length ? TaskStatuses.SIGN : TaskStatuses.SIGNED,
|
|
1043
|
+
info: EnableSignPCIBeforeTOS && shouldSignPciFirst ? t(($) => $["signPciFirst"]) : !hasServiceAgreementSigners ? t(($) => $["requiresSignatory"]) : void 0
|
|
1044
|
+
}
|
|
1045
|
+
)
|
|
1046
|
+
] }),
|
|
1047
|
+
isReview && /* @__PURE__ */ jsx(TaskListGroup, { title: t(($) => $["pleaseEnsureTheFollowing"]), children: /* @__PURE__ */ jsx(
|
|
1048
|
+
TaskListItem,
|
|
1049
|
+
{
|
|
1050
|
+
onNavigateToTask: handleOnNavigateToTaskReview,
|
|
1051
|
+
icon: "review",
|
|
1052
|
+
titleKey: "submitReviewOfYourData",
|
|
1053
|
+
status: TaskStatuses.SUBMIT,
|
|
1054
|
+
problems: capabilityProblems?.LegalEntity?.[legalEntityResponse.id],
|
|
1055
|
+
showErrorAlerts: "always"
|
|
1056
|
+
}
|
|
1057
|
+
) })
|
|
1058
|
+
] })
|
|
1059
|
+
] });
|
|
1060
|
+
}
|
|
1061
|
+
const isNewEntity = Symbol("isNewEntity");
|
|
1062
|
+
const useExemptSettlor = ({
|
|
1063
|
+
trust
|
|
1064
|
+
}) => {
|
|
1065
|
+
const matchingAssociation = useMemo(() => {
|
|
1066
|
+
if (!trust) return void 0;
|
|
1067
|
+
return getOwnEntityAssociations(trust).find(
|
|
1068
|
+
(association) => association.type === TrustMemberTypes.SETTLOR && Boolean(association.settlorExemptionReason)
|
|
1069
|
+
);
|
|
1070
|
+
}, [trust]);
|
|
1071
|
+
const { data } = useLegalEntity(matchingAssociation?.legalEntityId ?? skipToken);
|
|
1072
|
+
return data;
|
|
1073
|
+
};
|
|
1074
|
+
const splitAtFirstOccurrence = (str, separator) => {
|
|
1075
|
+
const firstOccurrence = str.indexOf(separator);
|
|
1076
|
+
if (firstOccurrence === -1) return [str];
|
|
1077
|
+
return [str.slice(0, firstOccurrence), str.slice(firstOccurrence + 1)];
|
|
1078
|
+
};
|
|
1079
|
+
const getTrustMemberOwnerId = (trustMemberId, entityAssociations) => entityAssociations.find((association) => association.associatorId === trustMemberId)?.legalEntityId;
|
|
1080
|
+
const getFallbackName = (exemptSettlorAssociation) => {
|
|
1081
|
+
const [firstName, lastName] = splitAtFirstOccurrence(exemptSettlorAssociation.name ?? "", " ");
|
|
1082
|
+
return {
|
|
1083
|
+
firstName,
|
|
1084
|
+
lastName
|
|
1085
|
+
};
|
|
1086
|
+
};
|
|
1087
|
+
const convertEntityAssociationIntoTrustMember = (association, associations, exemptSettlorLE) => {
|
|
1088
|
+
if (association.settlorExemptionReason) {
|
|
1089
|
+
return {
|
|
1090
|
+
trustMemberType: "exemptSettlor",
|
|
1091
|
+
roles: [TrustMemberTypes.SETTLOR],
|
|
1092
|
+
legalEntityType: association.entityType,
|
|
1093
|
+
legalEntityId: association.legalEntityId,
|
|
1094
|
+
settlorExemptionReason: association.settlorExemptionReason,
|
|
1095
|
+
exemptSettlorName: association.entityType === LegalEntityTypes.INDIVIDUAL ? exemptSettlorLE?.individual?.name ?? getFallbackName(association) : void 0,
|
|
1096
|
+
name: association.name
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
if (association.entityType === LegalEntityTypes.ORGANIZATION)
|
|
1100
|
+
return {
|
|
1101
|
+
trustMemberType: "company",
|
|
1102
|
+
roles: [],
|
|
1103
|
+
legalEntityType: LegalEntityTypes.ORGANIZATION,
|
|
1104
|
+
legalEntityId: association.legalEntityId,
|
|
1105
|
+
name: association.name,
|
|
1106
|
+
ownerId: getTrustMemberOwnerId(association.legalEntityId, associations)
|
|
1107
|
+
};
|
|
1108
|
+
if (association.entityType === LegalEntityTypes.INDIVIDUAL)
|
|
1109
|
+
return {
|
|
1110
|
+
trustMemberType: "regular",
|
|
1111
|
+
roles: [],
|
|
1112
|
+
legalEntityType: LegalEntityTypes.INDIVIDUAL,
|
|
1113
|
+
legalEntityId: association.legalEntityId,
|
|
1114
|
+
name: association.name
|
|
1115
|
+
};
|
|
1116
|
+
throw new Error(`Not a valid trust member: ${JSON.stringify(association)}`);
|
|
1117
|
+
};
|
|
1118
|
+
const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations, exemptSettlorLE) => {
|
|
1119
|
+
const mappedTrustMembers = entityAssociations.reduce(
|
|
1120
|
+
(acc, entityAssociation) => {
|
|
1121
|
+
if (!Object.values(TrustMemberTypes).includes(entityAssociation.type) || entityAssociation.associatorId !== trustEntityId || !entityAssociation.legalEntityId) {
|
|
1122
|
+
return acc;
|
|
1123
|
+
}
|
|
1124
|
+
const trustMember = acc[entityAssociation.legalEntityId] ?? convertEntityAssociationIntoTrustMember(
|
|
1125
|
+
entityAssociation,
|
|
1126
|
+
entityAssociations,
|
|
1127
|
+
exemptSettlorLE
|
|
1128
|
+
);
|
|
1129
|
+
const trustMemberType = entityAssociation.type;
|
|
1130
|
+
acc[entityAssociation.legalEntityId] = {
|
|
1131
|
+
...trustMember,
|
|
1132
|
+
roles: [.../* @__PURE__ */ new Set([...trustMember.roles, trustMemberType])]
|
|
1133
|
+
};
|
|
1134
|
+
return acc;
|
|
1135
|
+
},
|
|
1136
|
+
{}
|
|
1137
|
+
);
|
|
1138
|
+
return Object.values(mappedTrustMembers);
|
|
1139
|
+
};
|
|
1140
|
+
const mapRootLegalEntityToTrustMember = (rootLegalEntity) => ({
|
|
1141
|
+
trustMemberType: "rootTrustee",
|
|
1142
|
+
roles: [TrustMemberTypes.TRUSTEE],
|
|
1143
|
+
legalEntityType: rootLegalEntity.type,
|
|
1144
|
+
legalEntityId: rootLegalEntity.id,
|
|
1145
|
+
name: getLegalEntityNameBasedOnType(rootLegalEntity)
|
|
1146
|
+
});
|
|
1147
|
+
const mapUndefinedBeneficiaryInfoToTrustMembers = (undefinedBeneficiaryInfo) => undefinedBeneficiaryInfo.map(({ reference, description }) => ({
|
|
1148
|
+
trustMemberType: "undefinedBeneficiary",
|
|
1149
|
+
roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
|
|
1150
|
+
reference,
|
|
1151
|
+
description
|
|
1152
|
+
}));
|
|
1153
|
+
const getTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => [
|
|
1154
|
+
mapRootLegalEntityToTrustMember(rootLegalEntity),
|
|
1155
|
+
...mapEntityAssociationsToTrustMembers(
|
|
1156
|
+
trustLE.id,
|
|
1157
|
+
trustLE.entityAssociations ?? [],
|
|
1158
|
+
exemptSettlorLE
|
|
1159
|
+
),
|
|
1160
|
+
...mapUndefinedBeneficiaryInfoToTrustMembers(trustLE.trust?.undefinedBeneficiaryInfo ?? [])
|
|
1161
|
+
];
|
|
1162
|
+
const combineRootLegalEntityWithEntityAssociations = (rootLegalEntity, entityAssociations) => {
|
|
1163
|
+
const allowedRolesForRootLegalEntity = [
|
|
1164
|
+
TrustMemberTypes.SETTLOR,
|
|
1165
|
+
TrustMemberTypes.PROTECTOR,
|
|
1166
|
+
TrustMemberTypes.DEFINED_BENEFICIARY
|
|
1167
|
+
];
|
|
1168
|
+
const roles = entityAssociations.map((entityAssociation) => entityAssociation.type).filter((role) => allowedRolesForRootLegalEntity.includes(role));
|
|
1169
|
+
return {
|
|
1170
|
+
trustMemberType: "rootTrustee",
|
|
1171
|
+
roles: [...roles, TrustMemberTypes.TRUSTEE],
|
|
1172
|
+
legalEntityType: rootLegalEntity.type,
|
|
1173
|
+
legalEntityId: rootLegalEntity.id,
|
|
1174
|
+
name: getLegalEntityNameBasedOnType(rootLegalEntity)
|
|
1175
|
+
};
|
|
1176
|
+
};
|
|
1177
|
+
const getRootTrusteeTrustMembers = (trustLE, rootLegalEntity, exemptSettlorLE) => {
|
|
1178
|
+
const entityAssociations = trustLE.entityAssociations ?? [];
|
|
1179
|
+
const rootLegalEntityAssociations = entityAssociations.filter(
|
|
1180
|
+
(a) => a.legalEntityId === rootLegalEntity.id
|
|
1181
|
+
);
|
|
1182
|
+
const nonRootLegalEntityAssociations = entityAssociations.filter(
|
|
1183
|
+
(a) => a.legalEntityId !== rootLegalEntity.id
|
|
1184
|
+
);
|
|
1185
|
+
return [
|
|
1186
|
+
combineRootLegalEntityWithEntityAssociations(rootLegalEntity, rootLegalEntityAssociations),
|
|
1187
|
+
...mapEntityAssociationsToTrustMembers(
|
|
1188
|
+
trustLE.id,
|
|
1189
|
+
nonRootLegalEntityAssociations ?? [],
|
|
1190
|
+
exemptSettlorLE
|
|
1191
|
+
),
|
|
1192
|
+
...mapUndefinedBeneficiaryInfoToTrustMembers(trustLE.trust?.undefinedBeneficiaryInfo ?? [])
|
|
1193
|
+
];
|
|
1194
|
+
};
|
|
1195
|
+
function useTrustMembers() {
|
|
1196
|
+
const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
|
|
1197
|
+
const { data: trust } = useAssociatedLegalEntity(rootLegalEntity, LegalEntityTypes.TRUST);
|
|
1198
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
1199
|
+
const exemptSettlor = useExemptSettlor({
|
|
1200
|
+
trust
|
|
1201
|
+
});
|
|
1202
|
+
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
1203
|
+
return useMemo(() => {
|
|
1204
|
+
if (!rootLegalEntity || !trust?.trust) return [];
|
|
1205
|
+
return allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust, rootLegalEntity, exemptSettlor) : getTrustMembers(trust, rootLegalEntity, exemptSettlor);
|
|
1206
|
+
}, [rootLegalEntity, trust, exemptSettlor, allowMoreRolesForMainRootTrustee]);
|
|
1207
|
+
}
|
|
1208
|
+
const useTrustMemberNavigation = ({ navigateTo, trust }) => {
|
|
1209
|
+
const { t } = useTranslation("trust");
|
|
1210
|
+
const { showToast } = useToastContext();
|
|
1211
|
+
const [trustMember, setTrustMember] = useState();
|
|
1212
|
+
const { setTrustMembers } = useGlobalStore();
|
|
1213
|
+
const trustMembers = useTrustMembers();
|
|
1214
|
+
const memberId = trustMember?.trustMemberType === "undefinedBeneficiary" ? trustMember.reference : trustMember?.legalEntityId;
|
|
1215
|
+
useEffect(() => setTrustMembers(trustMembers), [trustMembers]);
|
|
1216
|
+
const onNavigateToTrustMemberEditDetails = async (tm) => {
|
|
1217
|
+
try {
|
|
1218
|
+
if (tm.legalEntityId === isNewEntity) {
|
|
1219
|
+
setTrustMember(tm);
|
|
1220
|
+
}
|
|
1221
|
+
navigateTo(
|
|
1222
|
+
tm.trustMemberType === "company" ? TaskTypes.TRUST_MEMBER_COMPANY : TaskTypes.TRUST_MEMBER_INDIVIDUAL
|
|
1223
|
+
);
|
|
1224
|
+
} catch {
|
|
1225
|
+
showToast({ label: t(($) => $["failedToFetchTrustMemberDetails"]), variant: "error" });
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
const onNavigateToTrustMemberRoleAndType = (tm) => {
|
|
1229
|
+
setTrustMember(tm === "new" ? void 0 : tm);
|
|
1230
|
+
navigateTo(TaskTypes.TRUST_MEMBER_ROLE_AND_TYPE);
|
|
1231
|
+
};
|
|
1232
|
+
const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
|
|
1233
|
+
try {
|
|
1234
|
+
if (trust) {
|
|
1235
|
+
navigateTo(task);
|
|
1236
|
+
} else {
|
|
1237
|
+
navigateTo(TaskTypes.TRUST);
|
|
1238
|
+
}
|
|
1239
|
+
} catch {
|
|
1240
|
+
showToast({ label: t(($) => $["failedToFetchTrustDetails"]), variant: "error" });
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
return {
|
|
1244
|
+
trustMember,
|
|
1245
|
+
trustMemberId: memberId === isNewEntity ? void 0 : memberId,
|
|
1246
|
+
// Do not pass Symbol('isNewEntity') as trustMemberId
|
|
1247
|
+
trustMembers,
|
|
1248
|
+
onNavigateToTrust,
|
|
1249
|
+
onNavigateToTrustMemberRoleAndType,
|
|
1250
|
+
onNavigateToTrustMemberEditDetails
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
const DropinLayout = ({ content, footer }) => /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-dropin", children: [
|
|
1254
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__content", children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__content-main", children: content }) }),
|
|
1255
|
+
footer && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__footer-container", children: footer })
|
|
1256
|
+
] });
|
|
1257
|
+
const defaultFieldMetadata = {
|
|
1258
|
+
label: "legalCompanyName",
|
|
1259
|
+
helperText: "legalCompanyName__helperText",
|
|
1260
|
+
validators: validateNotEmptyOnBlur
|
|
1261
|
+
};
|
|
1262
|
+
const defaultFieldConfig = {
|
|
1263
|
+
[CountryCodes.Australia]: {
|
|
1264
|
+
label: "legalCompanyName",
|
|
1265
|
+
helperText: "legalCompanyName__helperText__AU",
|
|
1266
|
+
validators: validateNotEmptyOnBlur
|
|
1267
|
+
},
|
|
1268
|
+
[CountryCodes.HongKong]: {
|
|
1269
|
+
label: "legalCompanyName",
|
|
1270
|
+
helperText: "legalCompanyName__helperText__HK",
|
|
1271
|
+
validators: validateNotEmptyOnBlur
|
|
1272
|
+
},
|
|
1273
|
+
[CountryCodes.Netherlands]: {
|
|
1274
|
+
label: "legalCompanyName",
|
|
1275
|
+
helperText: "legalCompanyName__helperText__NL",
|
|
1276
|
+
validators: validateNotEmptyOnBlur
|
|
1277
|
+
},
|
|
1278
|
+
[CountryCodes.Singapore]: {
|
|
1279
|
+
label: "legalCompanyName",
|
|
1280
|
+
helperText: "legalCompanyName__helperText__SG",
|
|
1281
|
+
validators: validateNotEmptyOnBlur
|
|
1282
|
+
},
|
|
1283
|
+
[CountryCodes.UnitedStates]: ({ isBusiness }) => ({
|
|
1284
|
+
label: "legalCompanyName__US",
|
|
1285
|
+
helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
|
|
1286
|
+
validators: validateNotEmptyOnBlur
|
|
1287
|
+
})
|
|
1288
|
+
};
|
|
1289
|
+
const defaultFieldMetadataV4 = {
|
|
1290
|
+
label: "legalCompanyName",
|
|
1291
|
+
helperText: "legalCompanyName__helperText",
|
|
1292
|
+
validators: validateLegalCompanyName
|
|
1293
|
+
};
|
|
1294
|
+
const defaultFieldConfigV4 = {
|
|
1295
|
+
[CountryCodes.Australia]: {
|
|
1296
|
+
label: "legalCompanyName",
|
|
1297
|
+
helperText: "legalCompanyName__helperText__AU",
|
|
1298
|
+
validators: validateLegalCompanyName
|
|
1299
|
+
},
|
|
1300
|
+
[CountryCodes.HongKong]: {
|
|
1301
|
+
label: "legalCompanyName",
|
|
1302
|
+
helperText: "legalCompanyName__helperText__HK",
|
|
1303
|
+
validators: validateLegalCompanyName
|
|
1304
|
+
},
|
|
1305
|
+
[CountryCodes.Netherlands]: {
|
|
1306
|
+
label: "legalCompanyName",
|
|
1307
|
+
helperText: "legalCompanyName__helperText__NL",
|
|
1308
|
+
validators: validateLegalCompanyName
|
|
1309
|
+
},
|
|
1310
|
+
[CountryCodes.Singapore]: {
|
|
1311
|
+
label: "legalCompanyName",
|
|
1312
|
+
helperText: "legalCompanyName__helperText__SG",
|
|
1313
|
+
validators: validateLegalCompanyName
|
|
1314
|
+
},
|
|
1315
|
+
[CountryCodes.UnitedStates]: ({ isBusiness }) => ({
|
|
1316
|
+
label: "legalCompanyName__US",
|
|
1317
|
+
helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
|
|
1318
|
+
validators: validateLegalCompanyName
|
|
1319
|
+
}),
|
|
1320
|
+
[CountryCodes.Japan]: {
|
|
1321
|
+
label: "legalCompanyName__JP",
|
|
1322
|
+
helperText: void 0,
|
|
1323
|
+
validators: [...validateLegalCompanyName, validateLatinSpaceMarkPunctuationOnlyOnBlur]
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1326
|
+
const LEGAL_COMPANY_NAME_FIELD = [
|
|
1327
|
+
"legalCompanyName"
|
|
1328
|
+
];
|
|
1329
|
+
function LegalCompanyNameField({
|
|
1330
|
+
data,
|
|
1331
|
+
valid,
|
|
1332
|
+
errors,
|
|
1333
|
+
labels,
|
|
1334
|
+
helperText,
|
|
1335
|
+
readonly,
|
|
1336
|
+
handleChangeFor
|
|
1337
|
+
}) {
|
|
1338
|
+
const handleKeyDown = (e) => {
|
|
1339
|
+
if (e.key === KEYBOARD_KEYS.enter) {
|
|
1340
|
+
e.preventDefault();
|
|
1341
|
+
}
|
|
1342
|
+
};
|
|
1343
|
+
return /* @__PURE__ */ jsx(
|
|
1344
|
+
Field,
|
|
1345
|
+
{
|
|
1346
|
+
name: "legalCompanyName",
|
|
1347
|
+
label: labels.legalCompanyName,
|
|
1348
|
+
helper: helperText?.legalCompanyName,
|
|
1349
|
+
errorMessage: errors.legalCompanyName,
|
|
1350
|
+
isValid: valid.legalCompanyName,
|
|
1351
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1352
|
+
InputText,
|
|
1353
|
+
{
|
|
1354
|
+
...childProps,
|
|
1355
|
+
"aria-required": true,
|
|
1356
|
+
"aria-invalid": !valid.legalCompanyName,
|
|
1357
|
+
name: "legalCompanyName",
|
|
1358
|
+
value: data.legalCompanyName,
|
|
1359
|
+
readonly,
|
|
1360
|
+
onInput: handleChangeFor("legalCompanyName", "input"),
|
|
1361
|
+
onBlur: handleChangeFor("legalCompanyName", "blur"),
|
|
1362
|
+
onKeyDown: handleKeyDown
|
|
1363
|
+
}
|
|
1364
|
+
)
|
|
1365
|
+
}
|
|
1366
|
+
);
|
|
1367
|
+
}
|
|
1368
|
+
const convertExistingSettlorExemptionReasons = (existingReasons) => {
|
|
1369
|
+
if (!existingReasons || !existingReasons.length) return ["noneOfTheAbove"];
|
|
1370
|
+
return existingReasons;
|
|
1371
|
+
};
|
|
1372
|
+
const convertExistingTrustMember = (trustMember) => {
|
|
1373
|
+
switch (trustMember.trustMemberType) {
|
|
1374
|
+
case "undefinedBeneficiary":
|
|
1375
|
+
return {
|
|
1376
|
+
entityType: LegalEntityTypes.INDIVIDUAL,
|
|
1377
|
+
role: ["undefinedBeneficiary"],
|
|
1378
|
+
descriptionUndefinedBeneficiary: trustMember.description
|
|
1379
|
+
};
|
|
1380
|
+
case "regular":
|
|
1381
|
+
case "company":
|
|
1382
|
+
return {
|
|
1383
|
+
entityType: trustMember.legalEntityType,
|
|
1384
|
+
role: trustMember.roles,
|
|
1385
|
+
settlorExemptionReason: ["noneOfTheAbove"],
|
|
1386
|
+
country: trustMember.trustMemberType === "company" ? trustMember.country : void 0,
|
|
1387
|
+
legalCompanyName: trustMember.trustMemberType === "company" ? trustMember.name : void 0
|
|
1388
|
+
};
|
|
1389
|
+
case "rootTrustee":
|
|
1390
|
+
return {
|
|
1391
|
+
trustMemberType: trustMember.trustMemberType,
|
|
1392
|
+
entityType: trustMember.legalEntityType,
|
|
1393
|
+
role: trustMember.roles,
|
|
1394
|
+
settlorExemptionReason: ["noneOfTheAbove"]
|
|
1395
|
+
};
|
|
1396
|
+
case "exemptSettlor":
|
|
1397
|
+
return {
|
|
1398
|
+
entityType: trustMember.legalEntityType,
|
|
1399
|
+
role: ["settlor"],
|
|
1400
|
+
settlorExemptionReason: convertExistingSettlorExemptionReasons(
|
|
1401
|
+
trustMember.settlorExemptionReason
|
|
1402
|
+
),
|
|
1403
|
+
firstName: trustMember.exemptSettlorName?.firstName,
|
|
1404
|
+
lastName: trustMember.exemptSettlorName?.lastName,
|
|
1405
|
+
legalCompanyName: trustMember.name,
|
|
1406
|
+
country: trustMember.country
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
};
|
|
1410
|
+
const convertRootTrusteeTrustMember = (trustMember) => ({
|
|
1411
|
+
trustMemberType: trustMember.trustMemberType,
|
|
1412
|
+
entityType: trustMember.legalEntityType,
|
|
1413
|
+
role: trustMember.roles,
|
|
1414
|
+
settlorExemptionReason: ["noneOfTheAbove"]
|
|
1415
|
+
});
|
|
1416
|
+
const allowedCrossoverRolesMatrix = {
|
|
1417
|
+
settlor: ["secondaryTrustee", "protector"],
|
|
1418
|
+
secondaryTrustee: ["settlor", "protector", "definedBeneficiary"],
|
|
1419
|
+
protector: ["settlor", "secondaryTrustee", "definedBeneficiary"],
|
|
1420
|
+
definedBeneficiary: ["secondaryTrustee", "protector"],
|
|
1421
|
+
undefinedBeneficiary: []
|
|
1422
|
+
};
|
|
1423
|
+
const allowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType = {
|
|
1424
|
+
rootTrustee: {
|
|
1425
|
+
[LegalEntityTypes.INDIVIDUAL]: {
|
|
1426
|
+
settlor: ["secondaryTrustee", "protector"],
|
|
1427
|
+
secondaryTrustee: ["settlor", "protector", "definedBeneficiary"],
|
|
1428
|
+
protector: ["settlor", "secondaryTrustee", "definedBeneficiary"],
|
|
1429
|
+
definedBeneficiary: ["secondaryTrustee", "protector"],
|
|
1430
|
+
undefinedBeneficiary: []
|
|
1431
|
+
},
|
|
1432
|
+
[LegalEntityTypes.ORGANIZATION]: {
|
|
1433
|
+
settlor: ["secondaryTrustee", "protector"],
|
|
1434
|
+
secondaryTrustee: ["settlor", "protector"],
|
|
1435
|
+
protector: ["settlor", "secondaryTrustee"],
|
|
1436
|
+
definedBeneficiary: [],
|
|
1437
|
+
undefinedBeneficiary: []
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
};
|
|
1441
|
+
const getAllowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType = (trustMember) => {
|
|
1442
|
+
const { trustMemberType } = trustMember;
|
|
1443
|
+
if (trustMemberType === "undefinedBeneficiary") {
|
|
1444
|
+
return allowedCrossoverRolesMatrix;
|
|
1445
|
+
}
|
|
1446
|
+
const crossoverRolesByTrustMember = allowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType[trustMemberType];
|
|
1447
|
+
if (!crossoverRolesByTrustMember) {
|
|
1448
|
+
return allowedCrossoverRolesMatrix;
|
|
1449
|
+
}
|
|
1450
|
+
const crossoverRoles = crossoverRolesByTrustMember[trustMember.legalEntityType];
|
|
1451
|
+
if (!crossoverRoles) {
|
|
1452
|
+
return allowedCrossoverRolesMatrix;
|
|
1453
|
+
}
|
|
1454
|
+
return crossoverRoles;
|
|
1455
|
+
};
|
|
1456
|
+
const availablesRolesByTrustMemberTypeAndLegalEntityType = {
|
|
1457
|
+
rootTrustee: {
|
|
1458
|
+
[LegalEntityTypes.INDIVIDUAL]: ["settlor", "protector", "definedBeneficiary"],
|
|
1459
|
+
[LegalEntityTypes.ORGANIZATION]: ["settlor", "protector"]
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
const getAvailableRolesByTrustMemberTypeAndLegalEntityType = (currentRoles, trustMember) => {
|
|
1463
|
+
if (!currentRoles?.length) {
|
|
1464
|
+
const { trustMemberType, legalEntityType } = trustMember;
|
|
1465
|
+
const availableRolesByTrustMemberType = availablesRolesByTrustMemberTypeAndLegalEntityType[trustMemberType];
|
|
1466
|
+
if (!availableRolesByTrustMemberType) {
|
|
1467
|
+
return Object.values(TrustMemberTypes);
|
|
1468
|
+
}
|
|
1469
|
+
const availableRoles = availableRolesByTrustMemberType[legalEntityType];
|
|
1470
|
+
if (!availableRoles) {
|
|
1471
|
+
return Object.values(TrustMemberTypes);
|
|
1472
|
+
}
|
|
1473
|
+
return availableRoles;
|
|
1474
|
+
}
|
|
1475
|
+
const crossoverRolesMatrix = trustMember ? getAllowedCrossoverRolesMatrixByTrustMemberAndLegalEntityType(trustMember) : allowedCrossoverRolesMatrix;
|
|
1476
|
+
const roles = currentRoles.map((role) => [role, ...crossoverRolesMatrix[role]]).reduce(
|
|
1477
|
+
(existingAllowed, allowedForRole) => existingAllowed.filter((role) => allowedForRole.includes(role))
|
|
1478
|
+
);
|
|
1479
|
+
return roles.filter((r) => r !== "secondaryTrustee");
|
|
1480
|
+
};
|
|
1481
|
+
const getAvailableRoles = (currentRoles) => {
|
|
1482
|
+
if (!currentRoles?.length) return Object.values(TrustMemberTypes);
|
|
1483
|
+
return currentRoles.map((role) => [role, ...allowedCrossoverRolesMatrix[role]]).reduce(
|
|
1484
|
+
(existingAllowed, allowedForRole) => existingAllowed.filter((role) => allowedForRole.includes(role))
|
|
1485
|
+
);
|
|
1486
|
+
};
|
|
1487
|
+
const trustMemberLegalEntityTypes = [
|
|
1488
|
+
LegalEntityTypes.INDIVIDUAL,
|
|
1489
|
+
LegalEntityTypes.ORGANIZATION
|
|
1490
|
+
];
|
|
1491
|
+
const countriesWhereSettlorExemptionReasonNotApplicable = [CountryCodes.NewZealand];
|
|
1492
|
+
const settlorExemptionReasons = [
|
|
1493
|
+
"contributionBelowThreshold",
|
|
1494
|
+
"professionalServiceProvider",
|
|
1495
|
+
"deceased"
|
|
1496
|
+
];
|
|
1497
|
+
const settlorExemptionReasonWithNoneOfTheAbove = [
|
|
1498
|
+
...settlorExemptionReasons,
|
|
1499
|
+
"noneOfTheAbove"
|
|
1500
|
+
];
|
|
1501
|
+
const couldBeExemptSettlor = (data, country) => data.entityType === LegalEntityTypes.INDIVIDUAL && data.role !== void 0 && data.role.includes("settlor") && !data.role.some((role) => role !== "settlor") && (!country || !countriesWhereSettlorExemptionReasonNotApplicable.includes(country));
|
|
1502
|
+
const isExemptSettlor = (data) => data.settlorExemptionReason?.some((reason) => reason !== "noneOfTheAbove") ?? false;
|
|
1503
|
+
const isOrganizationAndSettlor = (data) => data.entityType === LegalEntityTypes.ORGANIZATION && data.role?.length === 1 && data.role[0] === "settlor";
|
|
1504
|
+
const roleAndTypeValidationRules = {
|
|
1505
|
+
entityType: {
|
|
1506
|
+
modes: ["blur"],
|
|
1507
|
+
validate: (entityType) => !isEmpty(entityType),
|
|
1508
|
+
errorMessage: "fieldIsRequired"
|
|
1509
|
+
},
|
|
1510
|
+
role: {
|
|
1511
|
+
modes: ["blur"],
|
|
1512
|
+
validate: (role) => !!role?.length,
|
|
1513
|
+
errorMessage: "fieldIsRequired"
|
|
1514
|
+
},
|
|
1515
|
+
descriptionUndefinedBeneficiary: {
|
|
1516
|
+
modes: ["blur"],
|
|
1517
|
+
validate: (description) => !isEmpty(description),
|
|
1518
|
+
errorMessage: "fieldIsRequired"
|
|
1519
|
+
},
|
|
1520
|
+
settlorExemptionReason: {
|
|
1521
|
+
modes: ["blur"],
|
|
1522
|
+
validate: (reasons) => Boolean(reasons?.length),
|
|
1523
|
+
errorMessage: "fieldIsRequired"
|
|
1524
|
+
},
|
|
1525
|
+
country: {
|
|
1526
|
+
modes: ["blur"],
|
|
1527
|
+
validate: (country) => !!country,
|
|
1528
|
+
errorMessage: "fieldIsRequired"
|
|
1529
|
+
},
|
|
1530
|
+
legalCompanyName: {
|
|
1531
|
+
modes: ["blur"],
|
|
1532
|
+
validate: (name) => !!name,
|
|
1533
|
+
errorMessage: "fieldIsRequired"
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
const CHARACTERS_LIMIT = 256;
|
|
1537
|
+
const leTypeCardDetails$1 = {
|
|
1538
|
+
[LegalEntityTypes.INDIVIDUAL]: {
|
|
1539
|
+
id: "individual",
|
|
1540
|
+
name: "naturalPersonTitle",
|
|
1541
|
+
description: "naturalPersonDescription"
|
|
1542
|
+
},
|
|
1543
|
+
[LegalEntityTypes.ORGANIZATION]: {
|
|
1544
|
+
id: "organization",
|
|
1545
|
+
name: "businessEntityTitle",
|
|
1546
|
+
description: "businessEntityDescription"
|
|
1547
|
+
}
|
|
1548
|
+
};
|
|
1549
|
+
const convertExistingTrustMemberToDefaultData = (trustMember, allowMoreRolesForMainRootTrusteeEnabled) => {
|
|
1550
|
+
if (!trustMember) {
|
|
1551
|
+
return {};
|
|
1552
|
+
}
|
|
1553
|
+
if (allowMoreRolesForMainRootTrusteeEnabled && trustMember.trustMemberType === "rootTrustee") {
|
|
1554
|
+
return convertRootTrusteeTrustMember(trustMember);
|
|
1555
|
+
}
|
|
1556
|
+
return convertExistingTrustMember(trustMember);
|
|
1557
|
+
};
|
|
1558
|
+
const TrustRoleAndEntityType = (props) => {
|
|
1559
|
+
const { t } = useTranslation(["common", "trust"]);
|
|
1560
|
+
const {
|
|
1561
|
+
existingTrustMember,
|
|
1562
|
+
isOrganizationSettlorWithExemptionEnabled,
|
|
1563
|
+
onChange,
|
|
1564
|
+
id,
|
|
1565
|
+
country,
|
|
1566
|
+
fieldValidationErrors,
|
|
1567
|
+
formVerificationErrors
|
|
1568
|
+
} = props;
|
|
1569
|
+
const trustRoleAndEntityTypeCountry = country;
|
|
1570
|
+
let mergedProps = props;
|
|
1571
|
+
mergedProps = mergeFieldMetadataIntoProps(
|
|
1572
|
+
"legalCompanyName",
|
|
1573
|
+
resolveFieldMetadata(
|
|
1574
|
+
defaultFieldConfig[trustRoleAndEntityTypeCountry],
|
|
1575
|
+
{ isBusiness: false },
|
|
1576
|
+
defaultFieldMetadata
|
|
1577
|
+
),
|
|
1578
|
+
mergedProps
|
|
1579
|
+
);
|
|
1580
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
1581
|
+
const allowMoreRolesForMainRootTrusteeEnabled = isExperimentEnabled(
|
|
1582
|
+
"AllowMoreRolesForMainRootTrustee"
|
|
1583
|
+
);
|
|
1584
|
+
const defaultData = convertExistingTrustMemberToDefaultData(
|
|
1585
|
+
existingTrustMember,
|
|
1586
|
+
allowMoreRolesForMainRootTrusteeEnabled
|
|
1587
|
+
);
|
|
1588
|
+
const formUtils = createFormUtils(mergedProps, t);
|
|
1589
|
+
const decideFields = (data2) => {
|
|
1590
|
+
if (data2.role?.includes("undefinedBeneficiary")) {
|
|
1591
|
+
return ["role", "descriptionUndefinedBeneficiary"];
|
|
1592
|
+
}
|
|
1593
|
+
if (data2.role?.length) {
|
|
1594
|
+
if (isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
|
|
1595
|
+
return ["role", "entityType", "settlorExemptionReason", "country", "legalCompanyName"];
|
|
1596
|
+
}
|
|
1597
|
+
if (couldBeExemptSettlor(data2, country)) {
|
|
1598
|
+
return isExemptSettlor(data2) ? ["role", "entityType", "settlorExemptionReason", "firstName", "lastName"] : ["role", "entityType", "settlorExemptionReason"];
|
|
1599
|
+
}
|
|
1600
|
+
return allowMoreRolesForMainRootTrusteeEnabled ? ["role", "entityType", "trustMemberType"] : ["role", "entityType"];
|
|
1601
|
+
}
|
|
1602
|
+
return ["role"];
|
|
1603
|
+
};
|
|
1604
|
+
const { data, valid, schema, errors, fieldProblems, handleChangeFor, isValid } = useForm({
|
|
1605
|
+
...props,
|
|
1606
|
+
schema: decideFields,
|
|
1607
|
+
rules: roleAndTypeValidationRules,
|
|
1608
|
+
defaultData,
|
|
1609
|
+
fieldProblems: fieldValidationErrors
|
|
1610
|
+
});
|
|
1611
|
+
const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && existingTrustMember?.trustMemberType === "rootTrustee" ? getAvailableRolesByTrustMemberTypeAndLegalEntityType(data.role, existingTrustMember) : getAvailableRoles(data.role);
|
|
1612
|
+
const { data: exemptSettlorLe } = useLegalEntity(
|
|
1613
|
+
isOrganizationSettlorWithExemptionEnabled && existingTrustMember && existingTrustMember.trustMemberType === "exemptSettlor" && existingTrustMember.legalEntityId !== isNewEntity && existingTrustMember.roles !== void 0 && existingTrustMember.roles.length === 1 && existingTrustMember.roles[0] === "settlor" ? existingTrustMember.legalEntityId : skipToken
|
|
1614
|
+
);
|
|
1615
|
+
useEffect(() => {
|
|
1616
|
+
if (exemptSettlorLe && exemptSettlorLe.organization) {
|
|
1617
|
+
handleChangeFor("country")(exemptSettlorLe.organization.registeredAddress.country);
|
|
1618
|
+
}
|
|
1619
|
+
}, [exemptSettlorLe]);
|
|
1620
|
+
useEffect(() => {
|
|
1621
|
+
onChange?.({
|
|
1622
|
+
schema,
|
|
1623
|
+
data,
|
|
1624
|
+
errors,
|
|
1625
|
+
valid,
|
|
1626
|
+
isValid,
|
|
1627
|
+
dataStoreId: id,
|
|
1628
|
+
fieldProblems
|
|
1629
|
+
});
|
|
1630
|
+
}, [schema, data, isValid, t, errors, valid, id, fieldProblems]);
|
|
1631
|
+
const onInputDescription = (e) => {
|
|
1632
|
+
const { value } = e.target;
|
|
1633
|
+
handleChangeFor("descriptionUndefinedBeneficiary")(value);
|
|
1634
|
+
};
|
|
1635
|
+
const changeRoles = (roles) => {
|
|
1636
|
+
handleChangeFor("role")(roles);
|
|
1637
|
+
if (roles.includes("undefinedBeneficiary")) {
|
|
1638
|
+
handleChangeFor("entityType")(void 0);
|
|
1639
|
+
} else {
|
|
1640
|
+
handleChangeFor("descriptionUndefinedBeneficiary")(void 0);
|
|
1641
|
+
}
|
|
1642
|
+
};
|
|
1643
|
+
const changeSettlorExemptionReasons = (exemptionReasons) => {
|
|
1644
|
+
if (exemptionReasons.includes("noneOfTheAbove")) {
|
|
1645
|
+
handleChangeFor("settlorExemptionReason")(
|
|
1646
|
+
data.settlorExemptionReason?.includes("noneOfTheAbove") ? exemptionReasons.filter((reason) => reason !== "noneOfTheAbove") : ["noneOfTheAbove"]
|
|
1647
|
+
);
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1650
|
+
handleChangeFor("settlorExemptionReason")(exemptionReasons);
|
|
1651
|
+
};
|
|
1652
|
+
const nameProps = getFieldProps(props, nameFields);
|
|
1653
|
+
const onEntityTypeChange = (value) => {
|
|
1654
|
+
if (isOrganizationSettlorWithExemptionEnabled && value === LegalEntityTypes.ORGANIZATION && data.role?.length === 1 && data.role[0] === "settlor") {
|
|
1655
|
+
changeSettlorExemptionReasons(["professionalServiceProvider"]);
|
|
1656
|
+
}
|
|
1657
|
+
handleChangeFor("entityType")(value);
|
|
1658
|
+
};
|
|
1659
|
+
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-trust__role-and-entity-type adyen-kyc-u-width-full", children: [
|
|
1660
|
+
/* @__PURE__ */ jsx(Header, { title: t(($) => $["roleAndEntityType"]) }),
|
|
1661
|
+
/* @__PURE__ */ jsx(
|
|
1662
|
+
ErrorPanel,
|
|
1663
|
+
{
|
|
1664
|
+
verificationErrors: formVerificationErrors,
|
|
1665
|
+
validationErrors: fieldValidationErrors,
|
|
1666
|
+
formUtils,
|
|
1667
|
+
id: "ariaErrorField"
|
|
1668
|
+
}
|
|
1669
|
+
),
|
|
1670
|
+
/* @__PURE__ */ jsx(
|
|
1671
|
+
Field,
|
|
1672
|
+
{
|
|
1673
|
+
el: "fieldset",
|
|
1674
|
+
name: "role",
|
|
1675
|
+
label: formUtils.getLabel("role", "selectTheApplicableRoles"),
|
|
1676
|
+
errorMessage: formUtils.getErrorMessage("role", errors, fieldProblems),
|
|
1677
|
+
isValid: valid.role,
|
|
1678
|
+
disabled: availableRoles.length === 0,
|
|
1679
|
+
showErrorIconBottom: true,
|
|
1680
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1681
|
+
MultiSelectList,
|
|
1682
|
+
{
|
|
1683
|
+
...childProps,
|
|
1684
|
+
options: Object.values(TrustMemberTypes),
|
|
1685
|
+
selected: data.role ?? [],
|
|
1686
|
+
onSelect: changeRoles,
|
|
1687
|
+
mapToSelectItem: (role) => ({
|
|
1688
|
+
...makeSelectItemForRole(role, t),
|
|
1689
|
+
disabled: !availableRoles.includes(role)
|
|
1690
|
+
})
|
|
1691
|
+
}
|
|
1692
|
+
)
|
|
1693
|
+
}
|
|
1694
|
+
),
|
|
1695
|
+
schema?.includes("entityType") && /* @__PURE__ */ jsx(
|
|
1696
|
+
Field,
|
|
1697
|
+
{
|
|
1698
|
+
el: "fieldset",
|
|
1699
|
+
name: "entityType",
|
|
1700
|
+
errorMessage: formUtils.getErrorMessage("entityType", errors, fieldProblems),
|
|
1701
|
+
label: formUtils.getLabel("entityType", "whatTypeOfYourMembersEntity"),
|
|
1702
|
+
classNameModifiers: ["entityType"],
|
|
1703
|
+
disabled: Boolean(existingTrustMember),
|
|
1704
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1705
|
+
RadioGroupCard,
|
|
1706
|
+
{
|
|
1707
|
+
...childProps,
|
|
1708
|
+
name: "entityType",
|
|
1709
|
+
options: trustMemberLegalEntityTypes,
|
|
1710
|
+
onSelect: onEntityTypeChange,
|
|
1711
|
+
selected: data.entityType,
|
|
1712
|
+
optionId: (option) => leTypeCardDetails$1[option].id,
|
|
1713
|
+
optionName: (option) => t(($) => $[leTypeCardDetails$1[option].name], { ns: "trust" }),
|
|
1714
|
+
optionDescription: (option) => t(($) => $[leTypeCardDetails$1[option].description], { ns: "trust" }),
|
|
1715
|
+
"aria-required": true,
|
|
1716
|
+
"aria-invalid": !valid.entityType,
|
|
1717
|
+
floatingRadio: true
|
|
1718
|
+
}
|
|
1719
|
+
)
|
|
1720
|
+
}
|
|
1721
|
+
),
|
|
1722
|
+
schema?.includes("descriptionUndefinedBeneficiary") && /* @__PURE__ */ jsx(
|
|
1723
|
+
Field,
|
|
1724
|
+
{
|
|
1725
|
+
name: "descriptionUndefinedBeneficiary",
|
|
1726
|
+
label: formUtils.getLabel("description"),
|
|
1727
|
+
isValid: valid.descriptionUndefinedBeneficiary,
|
|
1728
|
+
errorMessage: formUtils.getErrorMessage(
|
|
1729
|
+
"descriptionUndefinedBeneficiary",
|
|
1730
|
+
errors,
|
|
1731
|
+
fieldProblems
|
|
1732
|
+
),
|
|
1733
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1734
|
+
TextArea,
|
|
1735
|
+
{
|
|
1736
|
+
...childProps,
|
|
1737
|
+
name: "descriptionUndefinedBeneficiary",
|
|
1738
|
+
value: data.descriptionUndefinedBeneficiary,
|
|
1739
|
+
maxLength: CHARACTERS_LIMIT,
|
|
1740
|
+
onInput: onInputDescription,
|
|
1741
|
+
helper: t(($) => $["describeWhoIsABeneficiaryInYourTrust"], { ns: "trust" }),
|
|
1742
|
+
"aria-required": true,
|
|
1743
|
+
"aria-invalid": !valid.descriptionUndefinedBeneficiary
|
|
1744
|
+
}
|
|
1745
|
+
)
|
|
1746
|
+
}
|
|
1747
|
+
),
|
|
1748
|
+
schema?.includes("settlorExemptionReason") && !isOrganizationAndSettlor(data) && /* @__PURE__ */ jsx(
|
|
1749
|
+
Field,
|
|
1750
|
+
{
|
|
1751
|
+
el: "fieldset",
|
|
1752
|
+
name: "settlorExemptionReason",
|
|
1753
|
+
label: formUtils.getLabel("settlorExemptionReason", "whichOfTheseApplyToTheSettlor"),
|
|
1754
|
+
isValid: valid.settlorExemptionReason,
|
|
1755
|
+
errorMessage: formUtils.getErrorMessage("settlorExemptionReason", errors, fieldProblems),
|
|
1756
|
+
showErrorIconBottom: true,
|
|
1757
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1758
|
+
MultiSelectList,
|
|
1759
|
+
{
|
|
1760
|
+
...childProps,
|
|
1761
|
+
options: settlorExemptionReasonWithNoneOfTheAbove,
|
|
1762
|
+
selected: data.settlorExemptionReason ?? [],
|
|
1763
|
+
onSelect: changeSettlorExemptionReasons,
|
|
1764
|
+
mapToSelectItem: (reason) => ({
|
|
1765
|
+
id: reason,
|
|
1766
|
+
name: t(($) => $[reason], { ns: "trust" })
|
|
1767
|
+
})
|
|
1768
|
+
}
|
|
1769
|
+
)
|
|
1770
|
+
}
|
|
1771
|
+
),
|
|
1772
|
+
data.trustMemberType !== "rootTrustee" && (schema.includes("firstName") || schema.includes("lastName")) ? /* @__PURE__ */ jsx(
|
|
1773
|
+
Name,
|
|
1774
|
+
{
|
|
1775
|
+
...nameProps,
|
|
1776
|
+
data: {
|
|
1777
|
+
firstName: defaultData.firstName,
|
|
1778
|
+
lastName: defaultData.lastName
|
|
1779
|
+
},
|
|
1780
|
+
requiredFields: schema.filter(
|
|
1781
|
+
(field) => nameFields.includes(field)
|
|
1782
|
+
),
|
|
1783
|
+
labels: {
|
|
1784
|
+
firstName: "firstNameOfSettlor",
|
|
1785
|
+
lastName: "lastNameOfSettlor",
|
|
1786
|
+
enterNameExactlyAsAppearInID: "enterSettlorsFirstNameExactlyAsItAppearsInID",
|
|
1787
|
+
enterLastNameExactlyAsAppearInID: "enterSettlorsLastNameExactlyAsItAppearsInID"
|
|
1788
|
+
},
|
|
1789
|
+
errors,
|
|
1790
|
+
fieldValidationErrors: fieldProblems,
|
|
1791
|
+
handleFieldChange: handleChangeFor,
|
|
1792
|
+
valid,
|
|
1793
|
+
dataStoreId: id
|
|
1794
|
+
}
|
|
1795
|
+
) : void 0,
|
|
1796
|
+
isOrganizationSettlorWithExemptionEnabled && schema?.includes("country") && schema?.includes("legalCompanyName") ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1797
|
+
/* @__PURE__ */ jsx(
|
|
1798
|
+
CountryField,
|
|
1799
|
+
{
|
|
1800
|
+
data: formUtils.getFieldData(data, COUNTRY_FIELD),
|
|
1801
|
+
valid: formUtils.getFieldValid(valid, COUNTRY_FIELD),
|
|
1802
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, COUNTRY_FIELD),
|
|
1803
|
+
labels: formUtils.getFieldLabels(COUNTRY_FIELD),
|
|
1804
|
+
readonly: false,
|
|
1805
|
+
allowedCountries: void 0,
|
|
1806
|
+
handleChangeFor
|
|
1807
|
+
}
|
|
1808
|
+
),
|
|
1809
|
+
/* @__PURE__ */ jsx(
|
|
1810
|
+
LegalCompanyNameField,
|
|
1811
|
+
{
|
|
1812
|
+
data: formUtils.getFieldData(data, LEGAL_COMPANY_NAME_FIELD),
|
|
1813
|
+
valid: formUtils.getFieldValid(valid, LEGAL_COMPANY_NAME_FIELD),
|
|
1814
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, LEGAL_COMPANY_NAME_FIELD),
|
|
1815
|
+
labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
|
|
1816
|
+
helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
|
|
1817
|
+
legalCompanyName: "legalCompanyName__helperText"
|
|
1818
|
+
}),
|
|
1819
|
+
readonly: false,
|
|
1820
|
+
handleChangeFor
|
|
1821
|
+
}
|
|
1822
|
+
)
|
|
1823
|
+
] }) : void 0
|
|
1824
|
+
] });
|
|
1825
|
+
};
|
|
1826
|
+
const mapTrustMemberToEntityAssociations = (trustMember) => {
|
|
1827
|
+
if (trustMember.legalEntityId === isNewEntity) {
|
|
1828
|
+
throw Error("Cannot map a new trust member, you must create it first");
|
|
1829
|
+
}
|
|
1830
|
+
if (trustMember.trustMemberType === "exemptSettlor")
|
|
1831
|
+
return [
|
|
1832
|
+
{
|
|
1833
|
+
legalEntityId: trustMember.legalEntityId,
|
|
1834
|
+
entityType: trustMember.legalEntityType,
|
|
1835
|
+
type: TrustMemberTypes.SETTLOR,
|
|
1836
|
+
settlorExemptionReason: trustMember.settlorExemptionReason,
|
|
1837
|
+
name: trustMember.legalEntityType === LegalEntityTypes.INDIVIDUAL ? `${trustMember.exemptSettlorName?.firstName} ${trustMember.exemptSettlorName?.lastName}` : trustMember.name ?? ""
|
|
1838
|
+
}
|
|
1839
|
+
];
|
|
1840
|
+
return trustMember.roles.map((role) => ({
|
|
1841
|
+
legalEntityId: trustMember.legalEntityId,
|
|
1842
|
+
type: role
|
|
1843
|
+
}));
|
|
1844
|
+
};
|
|
1845
|
+
const addOrUpdateAssociatedTrustMember = async ({
|
|
1846
|
+
newOrUpdated,
|
|
1847
|
+
trust,
|
|
1848
|
+
updateLegalEntity
|
|
1849
|
+
}) => {
|
|
1850
|
+
const otherAssociations = getOwnEntityAssociations(trust).filter(
|
|
1851
|
+
(existingAssociation) => existingAssociation.legalEntityId !== newOrUpdated.legalEntityId
|
|
1852
|
+
);
|
|
1853
|
+
const updatedAssociations = mapTrustMemberToEntityAssociations(newOrUpdated);
|
|
1854
|
+
const patchLE = {
|
|
1855
|
+
entityAssociations: [...otherAssociations, ...updatedAssociations]
|
|
1856
|
+
};
|
|
1857
|
+
await updateLegalEntity({ ...patchLE, id: trust.id });
|
|
1858
|
+
};
|
|
1859
|
+
const updateRootTrusteeTrustMember = async ({
|
|
1860
|
+
trustMember,
|
|
1861
|
+
trust,
|
|
1862
|
+
updateLegalEntity
|
|
1863
|
+
}) => {
|
|
1864
|
+
const otherAssociations = getOwnEntityAssociations(trust).filter(
|
|
1865
|
+
(existingAssociation) => existingAssociation.legalEntityId !== trustMember.legalEntityId
|
|
1866
|
+
);
|
|
1867
|
+
const updatedAssociations = mapRootTrustMemberToEntityAssociations(trustMember);
|
|
1868
|
+
const patchLE = {
|
|
1869
|
+
entityAssociations: [...otherAssociations, ...updatedAssociations]
|
|
1870
|
+
};
|
|
1871
|
+
await updateLegalEntity({ ...patchLE, id: trust.id });
|
|
1872
|
+
};
|
|
1873
|
+
const mapRootTrustMemberToEntityAssociations = (trustMember) => trustMember.roles.filter((r) => r !== "secondaryTrustee").map((role) => ({
|
|
1874
|
+
legalEntityId: trustMember.legalEntityId,
|
|
1875
|
+
type: role
|
|
1876
|
+
}));
|
|
1877
|
+
const addOrUpdateUndefinedBeneficiary = async ({
|
|
1878
|
+
newOrUpdated,
|
|
1879
|
+
trust,
|
|
1880
|
+
updateLegalEntity
|
|
1881
|
+
}) => {
|
|
1882
|
+
const otherUndefinedBeneficiaries = trust.trust?.undefinedBeneficiaryInfo?.filter(
|
|
1883
|
+
(ub) => ub.reference !== newOrUpdated.reference
|
|
1884
|
+
) ?? [];
|
|
1885
|
+
const patchLE = {
|
|
1886
|
+
trust: {
|
|
1887
|
+
undefinedBeneficiaryInfo: [
|
|
1888
|
+
...otherUndefinedBeneficiaries,
|
|
1889
|
+
newOrUpdated.reference === isNewEntity ? {
|
|
1890
|
+
description: newOrUpdated.description
|
|
1891
|
+
} : {
|
|
1892
|
+
reference: newOrUpdated.reference,
|
|
1893
|
+
description: newOrUpdated.description
|
|
1894
|
+
}
|
|
1895
|
+
]
|
|
1896
|
+
}
|
|
1897
|
+
};
|
|
1898
|
+
await updateLegalEntity({ ...patchLE, id: trust.id });
|
|
1899
|
+
};
|
|
1900
|
+
const createExemptSettlor = async ({
|
|
1901
|
+
exemptSettlor,
|
|
1902
|
+
trust,
|
|
1903
|
+
handleCreateLegalEntity
|
|
1904
|
+
}) => {
|
|
1905
|
+
const exemptSettlorLE = {
|
|
1906
|
+
type: LegalEntityTypes.INDIVIDUAL,
|
|
1907
|
+
individual: {
|
|
1908
|
+
name: {
|
|
1909
|
+
firstName: exemptSettlor.exemptSettlorName?.firstName ?? "",
|
|
1910
|
+
lastName: exemptSettlor.exemptSettlorName?.lastName ?? ""
|
|
1911
|
+
},
|
|
1912
|
+
residentialAddress: {
|
|
1913
|
+
country: trust.trust.registeredAddress.country
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1917
|
+
return handleCreateLegalEntity(exemptSettlorLE);
|
|
1918
|
+
};
|
|
1919
|
+
const createOrganizationExemptSettlor = async ({
|
|
1920
|
+
exemptSettlor,
|
|
1921
|
+
handleCreateLegalEntity
|
|
1922
|
+
}) => {
|
|
1923
|
+
const exemptSettlorLE = {
|
|
1924
|
+
type: LegalEntityTypes.ORGANIZATION,
|
|
1925
|
+
organization: {
|
|
1926
|
+
legalName: exemptSettlor.name ?? "",
|
|
1927
|
+
registeredAddress: {
|
|
1928
|
+
country: exemptSettlor.country ?? "NL"
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
return handleCreateLegalEntity(exemptSettlorLE);
|
|
1933
|
+
};
|
|
1934
|
+
const exemptSettlorNamesTheSame = (existingSettlor, newSettlor) => JSON.stringify(existingSettlor.exemptSettlorName) === JSON.stringify(newSettlor.exemptSettlorName);
|
|
1935
|
+
const updateExemptSettlorName = async ({
|
|
1936
|
+
exemptSettlor,
|
|
1937
|
+
updateLegalEntity
|
|
1938
|
+
}) => {
|
|
1939
|
+
const exemptSettlorPatch = {
|
|
1940
|
+
individual: {
|
|
1941
|
+
name: {
|
|
1942
|
+
firstName: exemptSettlor.exemptSettlorName?.firstName,
|
|
1943
|
+
lastName: exemptSettlor.exemptSettlorName?.lastName
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
};
|
|
1947
|
+
return updateLegalEntity({
|
|
1948
|
+
...exemptSettlorPatch,
|
|
1949
|
+
id: exemptSettlor.legalEntityId
|
|
1950
|
+
});
|
|
1951
|
+
};
|
|
1952
|
+
const updateOrganizationExemptSettlorName = async ({
|
|
1953
|
+
exemptSettlor,
|
|
1954
|
+
updateLegalEntity
|
|
1955
|
+
}) => {
|
|
1956
|
+
const exemptSettlorPatch = {
|
|
1957
|
+
organization: {
|
|
1958
|
+
legalName: exemptSettlor.name,
|
|
1959
|
+
registeredAddress: {
|
|
1960
|
+
country: exemptSettlor.country
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
};
|
|
1964
|
+
return updateLegalEntity({
|
|
1965
|
+
...exemptSettlorPatch,
|
|
1966
|
+
id: exemptSettlor.legalEntityId
|
|
1967
|
+
});
|
|
1968
|
+
};
|
|
1969
|
+
const settlorExemptionReasonsList = "adyen-kyc-settlor-exemption-reasons-list";
|
|
1970
|
+
const styles$3 = {
|
|
1971
|
+
settlorExemptionReasonsList
|
|
1972
|
+
};
|
|
1973
|
+
const formatRolesForSummary = (roles, commonT) => roles.map((role) => commonT(($) => $[getRoleName(role)])).join(", ");
|
|
1974
|
+
const formatSettlorExemptionReasonsForSummary = (reasons, trustT) => /* @__PURE__ */ jsx("ul", { className: styles$3.settlorExemptionReasonsList, children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: trustT(($) => $[reason]) }, reason)) });
|
|
1975
|
+
const formatRoleAndEntityTypeSummary = (data, commonT, trustT, isOrganizationSettlorWithExemptionEnabled) => {
|
|
1976
|
+
const { trustMemberType, roles } = data;
|
|
1977
|
+
const role = formatRolesForSummary(roles, commonT);
|
|
1978
|
+
switch (trustMemberType) {
|
|
1979
|
+
case "undefinedBeneficiary":
|
|
1980
|
+
return {
|
|
1981
|
+
role,
|
|
1982
|
+
descriptionUndefinedBeneficiary: data.description
|
|
1983
|
+
};
|
|
1984
|
+
case "exemptSettlor":
|
|
1985
|
+
return {
|
|
1986
|
+
role,
|
|
1987
|
+
entityType: trustT(($) => $[data.legalEntityType]),
|
|
1988
|
+
firstName: data.exemptSettlorName?.firstName,
|
|
1989
|
+
lastName: data.exemptSettlorName?.lastName,
|
|
1990
|
+
country: isOrganizationSettlorWithExemptionEnabled ? data.country : void 0,
|
|
1991
|
+
legalCompanyName: isOrganizationSettlorWithExemptionEnabled ? data.name : void 0,
|
|
1992
|
+
settlorExemptionReason: summaryItem(
|
|
1993
|
+
"otherInformation",
|
|
1994
|
+
formatSettlorExemptionReasonsForSummary(data.settlorExemptionReason ?? [], trustT)
|
|
1995
|
+
)
|
|
1996
|
+
};
|
|
1997
|
+
case "company":
|
|
1998
|
+
case "rootTrustee":
|
|
1999
|
+
case "regular":
|
|
2000
|
+
return {};
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
2003
|
+
const summary = {
|
|
2004
|
+
formId: "summary",
|
|
2005
|
+
formName: "summary"
|
|
2006
|
+
};
|
|
2007
|
+
const regularForms$1 = {
|
|
2008
|
+
roleAndEntityType: {
|
|
2009
|
+
formId: "roleAndEntityType",
|
|
2010
|
+
formName: "roleAndEntityType",
|
|
2011
|
+
fields: ["role", "entityType"]
|
|
2012
|
+
},
|
|
2013
|
+
memberDetails: {
|
|
2014
|
+
formId: "memberDetails",
|
|
2015
|
+
formName: "memberDetails"
|
|
2016
|
+
},
|
|
2017
|
+
summary
|
|
2018
|
+
};
|
|
2019
|
+
const undefinedBeneficiaryForms = {
|
|
2020
|
+
roleAndEntityType: {
|
|
2021
|
+
formId: "roleAndEntityType",
|
|
2022
|
+
formName: "roleAndEntityType",
|
|
2023
|
+
fields: ["role", "entityType", "descriptionUndefinedBeneficiary"]
|
|
2024
|
+
},
|
|
2025
|
+
summary
|
|
2026
|
+
};
|
|
2027
|
+
const exemptSettlorForms = {
|
|
2028
|
+
roleAndEntityType: {
|
|
2029
|
+
formId: "roleAndEntityType",
|
|
2030
|
+
formName: "roleAndEntityType",
|
|
2031
|
+
fields: ["role", "entityType", "settlorExemptionReason"]
|
|
2032
|
+
},
|
|
2033
|
+
summary
|
|
2034
|
+
};
|
|
2035
|
+
const decideForms = (trustMember) => {
|
|
2036
|
+
if (trustMember === "incomplete") return regularForms$1;
|
|
2037
|
+
switch (trustMember.trustMemberType) {
|
|
2038
|
+
case "undefinedBeneficiary":
|
|
2039
|
+
return undefinedBeneficiaryForms;
|
|
2040
|
+
case "exemptSettlor":
|
|
2041
|
+
return exemptSettlorForms;
|
|
2042
|
+
case "rootTrustee":
|
|
2043
|
+
return exemptSettlorForms;
|
|
2044
|
+
case "regular":
|
|
2045
|
+
case "company":
|
|
2046
|
+
return regularForms$1;
|
|
2047
|
+
}
|
|
2048
|
+
};
|
|
2049
|
+
const convertDataToTrustMember = (data, existingTrustMember, isOrganizationSettlorWithExemptionReasonEnabled = false) => {
|
|
2050
|
+
const existingId = existingTrustMember ? existingTrustMember.trustMemberType === "undefinedBeneficiary" ? existingTrustMember.reference : existingTrustMember.legalEntityId : void 0;
|
|
2051
|
+
if (data.trustMemberType === "rootTrustee") {
|
|
2052
|
+
return {
|
|
2053
|
+
trustMemberType: "rootTrustee",
|
|
2054
|
+
roles: data.role ?? [],
|
|
2055
|
+
legalEntityType: data.entityType ?? LegalEntityTypes.ORGANIZATION,
|
|
2056
|
+
legalEntityId: "",
|
|
2057
|
+
name: data.firstName ?? ""
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
if (data.role?.length) {
|
|
2061
|
+
if (isExemptSettlor(data)) {
|
|
2062
|
+
if (isOrganizationSettlorWithExemptionReasonEnabled && data.entityType === LegalEntityTypes.ORGANIZATION) {
|
|
2063
|
+
return {
|
|
2064
|
+
trustMemberType: "exemptSettlor",
|
|
2065
|
+
roles: [TrustMemberTypes.SETTLOR],
|
|
2066
|
+
legalEntityType: LegalEntityTypes.ORGANIZATION,
|
|
2067
|
+
legalEntityId: existingId ?? isNewEntity,
|
|
2068
|
+
name: data.legalCompanyName ?? "",
|
|
2069
|
+
settlorExemptionReason: ["professionalServiceProvider"],
|
|
2070
|
+
country: data.country
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
return {
|
|
2074
|
+
trustMemberType: "exemptSettlor",
|
|
2075
|
+
roles: [TrustMemberTypes.SETTLOR],
|
|
2076
|
+
legalEntityType: LegalEntityTypes.INDIVIDUAL,
|
|
2077
|
+
settlorExemptionReason: data.settlorExemptionReason.filter(
|
|
2078
|
+
(reason) => reason !== "noneOfTheAbove"
|
|
2079
|
+
),
|
|
2080
|
+
exemptSettlorName: {
|
|
2081
|
+
firstName: data.firstName ?? "",
|
|
2082
|
+
lastName: data.lastName ?? ""
|
|
2083
|
+
},
|
|
2084
|
+
legalEntityId: existingId ?? isNewEntity
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
if (data.role.includes("undefinedBeneficiary"))
|
|
2088
|
+
return {
|
|
2089
|
+
trustMemberType: "undefinedBeneficiary",
|
|
2090
|
+
roles: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
|
|
2091
|
+
description: data.descriptionUndefinedBeneficiary ?? "",
|
|
2092
|
+
reference: existingId ?? isNewEntity
|
|
2093
|
+
};
|
|
2094
|
+
if (data.entityType === LegalEntityTypes.ORGANIZATION) {
|
|
2095
|
+
return {
|
|
2096
|
+
trustMemberType: "company",
|
|
2097
|
+
roles: data.role,
|
|
2098
|
+
legalEntityType: LegalEntityTypes.ORGANIZATION,
|
|
2099
|
+
legalEntityId: existingId ?? isNewEntity,
|
|
2100
|
+
name: data.legalCompanyName ?? "",
|
|
2101
|
+
country: data.country
|
|
2102
|
+
};
|
|
2103
|
+
}
|
|
2104
|
+
if (data.entityType === LegalEntityTypes.INDIVIDUAL)
|
|
2105
|
+
return {
|
|
2106
|
+
trustMemberType: "regular",
|
|
2107
|
+
roles: data.role,
|
|
2108
|
+
legalEntityType: LegalEntityTypes.INDIVIDUAL,
|
|
2109
|
+
legalEntityId: existingId ?? isNewEntity,
|
|
2110
|
+
name: ""
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
return "incomplete";
|
|
2114
|
+
};
|
|
2115
|
+
const logger$1 = createLogger();
|
|
2116
|
+
function RoleAndTypeDropin({
|
|
2117
|
+
trust,
|
|
2118
|
+
trustMemberLe,
|
|
2119
|
+
existingTrustMember,
|
|
2120
|
+
navigateToFullDropinFor,
|
|
2121
|
+
navigateBack,
|
|
2122
|
+
country
|
|
2123
|
+
}) {
|
|
2124
|
+
const { t: commonT } = useTranslation("common");
|
|
2125
|
+
const { t: trustT } = useTranslation("trust");
|
|
2126
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
2127
|
+
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
2128
|
+
const [trustMember, setTrustMember] = useState(
|
|
2129
|
+
existingTrustMember ?? "incomplete"
|
|
2130
|
+
);
|
|
2131
|
+
const [shouldValidate, setShouldValidate] = useState(false);
|
|
2132
|
+
const { showToast } = useToastContext();
|
|
2133
|
+
const isOrganizationSettlorWithExemptionReasonEnabled = (country2) => country2 === CountryCodes.Australia;
|
|
2134
|
+
const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(
|
|
2135
|
+
trust?.trust?.countryOfGoverningLaw
|
|
2136
|
+
);
|
|
2137
|
+
const formList = decideForms(trustMember);
|
|
2138
|
+
const forms = Object.values(formList);
|
|
2139
|
+
const [formValidity, setFormValidity] = useState({
|
|
2140
|
+
roleAndEntityType: false
|
|
2141
|
+
});
|
|
2142
|
+
const [activeForm, setActiveForm] = useState(regularForms$1.roleAndEntityType);
|
|
2143
|
+
const isSummaryStep = activeForm.formId === summaryStep.formId;
|
|
2144
|
+
const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
|
|
2145
|
+
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
2146
|
+
const addOrUpdateTrustMember = async (updated, existing) => {
|
|
2147
|
+
if (trust === void 0) {
|
|
2148
|
+
throw new Error("No associated trust");
|
|
2149
|
+
}
|
|
2150
|
+
try {
|
|
2151
|
+
switch (updated.trustMemberType) {
|
|
2152
|
+
case "undefinedBeneficiary":
|
|
2153
|
+
await addOrUpdateUndefinedBeneficiary({
|
|
2154
|
+
newOrUpdated: updated,
|
|
2155
|
+
trust,
|
|
2156
|
+
updateLegalEntity
|
|
2157
|
+
});
|
|
2158
|
+
break;
|
|
2159
|
+
case "exemptSettlor":
|
|
2160
|
+
if (!existing) {
|
|
2161
|
+
const newSettlorLE = isOrganizationSettlorWithExemptionEnabled && updated.legalEntityType === "organization" ? await createOrganizationExemptSettlor({
|
|
2162
|
+
exemptSettlor: updated,
|
|
2163
|
+
handleCreateLegalEntity: createLegalEntity
|
|
2164
|
+
}) : await createExemptSettlor({
|
|
2165
|
+
exemptSettlor: updated,
|
|
2166
|
+
trust,
|
|
2167
|
+
handleCreateLegalEntity: createLegalEntity
|
|
2168
|
+
});
|
|
2169
|
+
updated.legalEntityId = newSettlorLE.id;
|
|
2170
|
+
}
|
|
2171
|
+
if (existing && !exemptSettlorNamesTheSame(existing, updated)) ;
|
|
2172
|
+
if (existing && isOrganizationSettlorWithExemptionEnabled && updated.legalEntityType === "organization") ;
|
|
2173
|
+
await addOrUpdateAssociatedTrustMember({
|
|
2174
|
+
newOrUpdated: updated,
|
|
2175
|
+
trust,
|
|
2176
|
+
updateLegalEntity
|
|
2177
|
+
});
|
|
2178
|
+
break;
|
|
2179
|
+
case "regular":
|
|
2180
|
+
case "company":
|
|
2181
|
+
await addOrUpdateAssociatedTrustMember({
|
|
2182
|
+
newOrUpdated: updated,
|
|
2183
|
+
trust,
|
|
2184
|
+
updateLegalEntity
|
|
2185
|
+
});
|
|
2186
|
+
break;
|
|
2187
|
+
case "rootTrustee":
|
|
2188
|
+
if (allowMoreRolesForMainRootTrustee && existing) ;
|
|
2189
|
+
break;
|
|
2190
|
+
default:
|
|
2191
|
+
logger$1.warn(
|
|
2192
|
+
`Updating trust member type "${updated.trustMemberType}" is not implemented.`
|
|
2193
|
+
);
|
|
2194
|
+
}
|
|
2195
|
+
showToast({ label: commonT(($) => $["successfullyUpdatedDetails"]), variant: "success" });
|
|
2196
|
+
navigateBack();
|
|
2197
|
+
} catch (err) {
|
|
2198
|
+
logger$1.error(err);
|
|
2199
|
+
showToast({ label: commonT(($) => $["failedToUpdateDetails"]), variant: "error" });
|
|
2200
|
+
}
|
|
2201
|
+
};
|
|
2202
|
+
const summaryData = trustMember === "incomplete" ? {} : {
|
|
2203
|
+
roleAndEntityType: formatRoleAndEntityTypeSummary(
|
|
2204
|
+
trustMember,
|
|
2205
|
+
commonT,
|
|
2206
|
+
trustT,
|
|
2207
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
2208
|
+
)
|
|
2209
|
+
};
|
|
2210
|
+
const onNavigateToNextStep = () => {
|
|
2211
|
+
if (isSummaryStep && trustMember !== "incomplete") {
|
|
2212
|
+
addOrUpdateTrustMember(trustMember);
|
|
2213
|
+
return;
|
|
2214
|
+
}
|
|
2215
|
+
gotoFormByFormIndex(forms.findIndex((form) => form.formId === activeForm.formId) + 1);
|
|
2216
|
+
};
|
|
2217
|
+
const onTrustMemberChange = ({
|
|
2218
|
+
data,
|
|
2219
|
+
isValid = false,
|
|
2220
|
+
dataStoreId = void 0
|
|
2221
|
+
}) => {
|
|
2222
|
+
if (dataStoreId) {
|
|
2223
|
+
setFormValidity({ ...formValidity, [dataStoreId]: isValid });
|
|
2224
|
+
}
|
|
2225
|
+
setTrustMember(
|
|
2226
|
+
convertDataToTrustMember(
|
|
2227
|
+
data,
|
|
2228
|
+
existingTrustMember,
|
|
2229
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
2230
|
+
)
|
|
2231
|
+
);
|
|
2232
|
+
};
|
|
2233
|
+
const saveRolesAndNavigate = async () => {
|
|
2234
|
+
if (trustMember === "incomplete") return;
|
|
2235
|
+
if (hasRolesChanged(trustMember.roles, existingTrustMember?.roles)) {
|
|
2236
|
+
addOrUpdateTrustMember(trustMember);
|
|
2237
|
+
}
|
|
2238
|
+
navigateBack();
|
|
2239
|
+
};
|
|
2240
|
+
const hasRolesChanged = (newRoles = [], existingRoles = []) => newRoles.length !== existingRoles.length || !newRoles.every((newRole) => existingRoles.includes(newRole));
|
|
2241
|
+
const formsWithValidity = forms.map((form) => ({
|
|
2242
|
+
formId: form.formId,
|
|
2243
|
+
formName: form.formName,
|
|
2244
|
+
isValid: formValidity[form.formId]
|
|
2245
|
+
}));
|
|
2246
|
+
const gotoFormByFormIndex = (formIndex) => {
|
|
2247
|
+
const targetForm = forms[formIndex];
|
|
2248
|
+
if (!formValidity.roleAndEntityType || trustMember === "incomplete") {
|
|
2249
|
+
setShouldValidate(true);
|
|
2250
|
+
return;
|
|
2251
|
+
}
|
|
2252
|
+
if (trustMember.trustMemberType === "regular" || trustMember.trustMemberType === "company") {
|
|
2253
|
+
if (targetForm.formId === regularForms$1.memberDetails.formId) {
|
|
2254
|
+
navigateToFullDropinFor(trustMember);
|
|
2255
|
+
return;
|
|
2256
|
+
}
|
|
2257
|
+
if (targetForm.formId === summaryStep.formId) return;
|
|
2258
|
+
}
|
|
2259
|
+
setActiveForm(targetForm);
|
|
2260
|
+
};
|
|
2261
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2262
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__sidebar-wrapper", children: /* @__PURE__ */ jsx(
|
|
2263
|
+
FormNavigation,
|
|
2264
|
+
{
|
|
2265
|
+
forms: formsWithValidity,
|
|
2266
|
+
activeForm: formsWithValidity.find((form) => form.formId === activeForm.formId),
|
|
2267
|
+
taskName: "trustMembers",
|
|
2268
|
+
gotoForm: gotoFormByFormIndex
|
|
2269
|
+
}
|
|
2270
|
+
) }),
|
|
2271
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-container", children: [
|
|
2272
|
+
/* @__PURE__ */ jsx(
|
|
2273
|
+
"div",
|
|
2274
|
+
{
|
|
2275
|
+
className: activeForm.formId !== "roleAndEntityType" ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
2276
|
+
children: /* @__PURE__ */ jsx(
|
|
2277
|
+
TrustRoleAndEntityType,
|
|
2278
|
+
{
|
|
2279
|
+
id: "roleAndEntityType",
|
|
2280
|
+
existingTrustMember,
|
|
2281
|
+
onChange: onTrustMemberChange,
|
|
2282
|
+
shouldValidate,
|
|
2283
|
+
isOrganizationSettlorWithExemptionEnabled,
|
|
2284
|
+
country
|
|
2285
|
+
}
|
|
2286
|
+
)
|
|
2287
|
+
}
|
|
2288
|
+
),
|
|
2289
|
+
isSummaryStep && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
|
|
2290
|
+
Summary,
|
|
2291
|
+
{
|
|
2292
|
+
data: summaryData,
|
|
2293
|
+
forms: [undefinedBeneficiaryForms.roleAndEntityType],
|
|
2294
|
+
gotoForm: gotoFormByFormIndex
|
|
2295
|
+
}
|
|
2296
|
+
) }),
|
|
2297
|
+
/* @__PURE__ */ jsx(
|
|
2298
|
+
ActionBar,
|
|
2299
|
+
{
|
|
2300
|
+
onNext: onNavigateToNextStep,
|
|
2301
|
+
onHome: saveRolesAndNavigate,
|
|
2302
|
+
nextButtonLabel: isSummaryStep ? commonT(($) => $["submit"]) : commonT(($) => $["continue"]),
|
|
2303
|
+
homeButtonLabel: commonT(($) => $["saveAndGoToOverview"])
|
|
2304
|
+
}
|
|
2305
|
+
)
|
|
2306
|
+
] })
|
|
2307
|
+
] });
|
|
2308
|
+
return /* @__PURE__ */ jsx(DropinLayout, { content });
|
|
2309
|
+
}
|
|
2310
|
+
function TrustMemberRoleAndTypePage({
|
|
2311
|
+
trustId,
|
|
2312
|
+
memberId,
|
|
2313
|
+
navigateToFullDropinFor,
|
|
2314
|
+
navigateBack
|
|
2315
|
+
}) {
|
|
2316
|
+
const { i18n } = useTranslation();
|
|
2317
|
+
const { data: memberLe } = useLegalEntity(memberId ?? skipToken);
|
|
2318
|
+
const { data: trustLe } = useLegalEntity(trustId);
|
|
2319
|
+
const trustMembers = useTrustMembers();
|
|
2320
|
+
addResourceBundles(i18n, i18n.language, [
|
|
2321
|
+
{ ns: "trust", importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-CepHap8j.js"), "../language/cs-CZ.json": () => import("./cs-CZ-BP7niQM9.js"), "../language/da-DK.json": () => import("./da-DK-Dc0QYG8m.js"), "../language/de-DE.json": () => import("./de-DE-Dz2OsS1F.js"), "../language/el-GR.json": () => import("./el-GR-BHG69mXl.js"), "../language/en-US.json": () => import("./en-US-D-B35AoN.js"), "../language/es-ES.json": () => import("./es-ES-BI_jdT67.js"), "../language/et-EE.json": () => import("./et-EE-C_PZO2aI.js"), "../language/fi-FI.json": () => import("./fi-FI-hwzizPnr.js"), "../language/fr-FR.json": () => import("./fr-FR-CYZXbwc9.js"), "../language/hr-HR.json": () => import("./hr-HR-bE6cvRCQ.js"), "../language/hu-HU.json": () => import("./hu-HU-DG-NUDx4.js"), "../language/it-IT.json": () => import("./it-IT-Erh1DIlj.js"), "../language/ja-JP.json": () => import("./ja-JP-ThzG9vIo.js"), "../language/lt-LT.json": () => import("./lt-LT-Nd1uRoIj.js"), "../language/lv-LV.json": () => import("./lv-LV-DKhV24CI.js"), "../language/nl-NL.json": () => import("./nl-NL-O9GCHMDA.js"), "../language/no-NO.json": () => import("./no-NO-CA1aR6Wh.js"), "../language/pl-PL.json": () => import("./pl-PL-BKDK0_G8.js"), "../language/pt-BR.json": () => import("./pt-BR-NtLaWlnZ.js"), "../language/pt-PT.json": () => import("./pt-PT-DSxxVA0f.js"), "../language/ro-RO.json": () => import("./ro-RO-Bybq8JFn.js"), "../language/sk-SK.json": () => import("./sk-SK-C6rMIxpz.js"), "../language/sl-SI.json": () => import("./sl-SI-tPwbFvOI.js"), "../language/sv-SE.json": () => import("./sv-SE-K1QT1cOt.js") }), `../language/${i18n.language}.json`, 3) }
|
|
2322
|
+
]);
|
|
2323
|
+
if (!trustLe || memberId && !memberLe) {
|
|
2324
|
+
return /* @__PURE__ */ jsx(Loader, {});
|
|
2325
|
+
}
|
|
2326
|
+
const country = getLegalEntityCountry(memberLe ?? trustLe);
|
|
2327
|
+
const trustMember = memberId ? trustMembers.find(
|
|
2328
|
+
(tm) => tm.trustMemberType !== "undefinedBeneficiary" && tm.legalEntityId === memberId
|
|
2329
|
+
) : void 0;
|
|
2330
|
+
return /* @__PURE__ */ jsx(
|
|
2331
|
+
RoleAndTypeDropin,
|
|
2332
|
+
{
|
|
2333
|
+
trust: trustLe,
|
|
2334
|
+
trustMemberLe: memberLe,
|
|
2335
|
+
existingTrustMember: trustMember,
|
|
2336
|
+
country,
|
|
2337
|
+
navigateToFullDropinFor,
|
|
2338
|
+
navigateBack
|
|
2339
|
+
}
|
|
2340
|
+
);
|
|
2341
|
+
}
|
|
2342
|
+
const UNINCORPORATED_PARTNERSHIP__DEFAULT_DESCRIPTIONS_MAP = {
|
|
2343
|
+
[UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER]: "provideAtLeastOneSecondaryPartner",
|
|
2344
|
+
[UnincorporatedPartnershipMemberTypes.OWNER]: "provideAllOwners",
|
|
2345
|
+
[UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON]: "ifNoOwnersSpecifyControllingPersons"
|
|
2346
|
+
};
|
|
2347
|
+
const iconStatus = (current, min) => {
|
|
2348
|
+
const isSatisfied = current > 0 && current >= min;
|
|
2349
|
+
return isSatisfied ? "satisfied" : "empty";
|
|
2350
|
+
};
|
|
2351
|
+
const getEntityStatusRuleDescription = (country, currentTask, entityLabel) => {
|
|
2352
|
+
const defaultMessage = getDecisionMakerDescriptionMap(country)[entityLabel];
|
|
2353
|
+
switch (currentTask) {
|
|
2354
|
+
case TaskTypes.TRUST_MEMBER_OVERVIEW: {
|
|
2355
|
+
return TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel];
|
|
2356
|
+
}
|
|
2357
|
+
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW: {
|
|
2358
|
+
return UNINCORPORATED_PARTNERSHIP__DEFAULT_DESCRIPTIONS_MAP[entityLabel] || defaultMessage;
|
|
2359
|
+
}
|
|
2360
|
+
default: {
|
|
2361
|
+
return defaultMessage;
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
};
|
|
2365
|
+
const EntityStatusIcon = ({ status }) => {
|
|
2366
|
+
switch (status) {
|
|
2367
|
+
case "empty":
|
|
2368
|
+
return /* @__PURE__ */ jsx(
|
|
2369
|
+
Icon,
|
|
2370
|
+
{
|
|
2371
|
+
name: "checkmark-circle",
|
|
2372
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
|
|
2373
|
+
testId: "empty-icon"
|
|
2374
|
+
}
|
|
2375
|
+
);
|
|
2376
|
+
case "satisfied":
|
|
2377
|
+
return /* @__PURE__ */ jsx(
|
|
2378
|
+
Icon,
|
|
2379
|
+
{
|
|
2380
|
+
name: "checkmark",
|
|
2381
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--satisfied",
|
|
2382
|
+
testId: "satisfied-icon"
|
|
2383
|
+
}
|
|
2384
|
+
);
|
|
2385
|
+
default:
|
|
2386
|
+
return /* @__PURE__ */ jsx(
|
|
2387
|
+
Icon,
|
|
2388
|
+
{
|
|
2389
|
+
name: "circle",
|
|
2390
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
|
|
2391
|
+
testId: "empty-icon"
|
|
2392
|
+
}
|
|
2393
|
+
);
|
|
2394
|
+
}
|
|
2395
|
+
};
|
|
2396
|
+
const EntityGuidanceStatus = ({
|
|
2397
|
+
country,
|
|
2398
|
+
currentTask,
|
|
2399
|
+
entityLabel,
|
|
2400
|
+
status
|
|
2401
|
+
}) => {
|
|
2402
|
+
const { t } = useTranslation("common");
|
|
2403
|
+
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-status__container", children: [
|
|
2404
|
+
/* @__PURE__ */ jsx(EntityStatusIcon, { status }),
|
|
2405
|
+
/* @__PURE__ */ jsx(
|
|
2406
|
+
Tag,
|
|
2407
|
+
{
|
|
2408
|
+
className: "adyen-kyc-entity-status__tag",
|
|
2409
|
+
variant: getRoleTagVariant(entityLabel),
|
|
2410
|
+
children: t(($) => $[getRoleName(entityLabel)])
|
|
2411
|
+
},
|
|
2412
|
+
entityLabel
|
|
2413
|
+
),
|
|
2414
|
+
/* @__PURE__ */ jsx(
|
|
2415
|
+
"span",
|
|
2416
|
+
{
|
|
2417
|
+
className: "adyen-kyc-entity-status--text",
|
|
2418
|
+
"data-testid": `${entityLabel}-rule--description`,
|
|
2419
|
+
children: /* @__PURE__ */ jsx(
|
|
2420
|
+
Trans,
|
|
2421
|
+
{
|
|
2422
|
+
t,
|
|
2423
|
+
i18nKey: ($) => $[getEntityStatusRuleDescription(country, currentTask, entityLabel)]
|
|
2424
|
+
}
|
|
2425
|
+
)
|
|
2426
|
+
}
|
|
2427
|
+
)
|
|
2428
|
+
] });
|
|
2429
|
+
};
|
|
2430
|
+
const deleteAssociatedTrustMember = async ({
|
|
2431
|
+
associatedTrustMember,
|
|
2432
|
+
trust,
|
|
2433
|
+
asyncMutation
|
|
2434
|
+
}) => {
|
|
2435
|
+
const ownEntityAssociations = getOwnEntityAssociations(trust);
|
|
2436
|
+
const updatedTrustAssociations = {
|
|
2437
|
+
entityAssociations: ownEntityAssociations.filter(
|
|
2438
|
+
(entityAssociation) => entityAssociation.legalEntityId !== associatedTrustMember.legalEntityId
|
|
2439
|
+
)
|
|
2440
|
+
};
|
|
2441
|
+
await asyncMutation({ ...updatedTrustAssociations, id: trust.id });
|
|
2442
|
+
};
|
|
2443
|
+
const deleteUndefinedBeneficiary = async ({
|
|
2444
|
+
undefinedBeneficiary,
|
|
2445
|
+
trust,
|
|
2446
|
+
asyncMutation
|
|
2447
|
+
}) => {
|
|
2448
|
+
const existingUndefinedBeneficiaries = trust.trust?.undefinedBeneficiaryInfo ?? [];
|
|
2449
|
+
const updatedTrust = {
|
|
2450
|
+
trust: {
|
|
2451
|
+
undefinedBeneficiaryInfo: existingUndefinedBeneficiaries.filter(
|
|
2452
|
+
(ub) => ub.reference !== undefinedBeneficiary.reference
|
|
2453
|
+
)
|
|
2454
|
+
}
|
|
2455
|
+
};
|
|
2456
|
+
await asyncMutation({ ...updatedTrust, id: trust.id });
|
|
2457
|
+
};
|
|
2458
|
+
function useClickAwayListener(ref, onClickAway) {
|
|
2459
|
+
const handleClickAway = useCallback(
|
|
2460
|
+
(event) => {
|
|
2461
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
2462
|
+
onClickAway();
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
[ref, onClickAway]
|
|
2466
|
+
);
|
|
2467
|
+
useEffect(() => {
|
|
2468
|
+
document.addEventListener("mousedown", handleClickAway);
|
|
2469
|
+
return () => {
|
|
2470
|
+
document.removeEventListener("mousedown", handleClickAway);
|
|
2471
|
+
};
|
|
2472
|
+
}, [handleClickAway]);
|
|
2473
|
+
}
|
|
2474
|
+
const ClickAwayWrapper = ({ children, onClickAway, ...divProps }) => {
|
|
2475
|
+
const ref = useRef(null);
|
|
2476
|
+
useClickAwayListener(ref, onClickAway);
|
|
2477
|
+
return /* @__PURE__ */ jsx("div", { ref, ...divProps, children });
|
|
2478
|
+
};
|
|
2479
|
+
const actionsMenu = "adyen-kyc-actions-menu";
|
|
2480
|
+
const styles$2 = {
|
|
2481
|
+
actionsMenu
|
|
2482
|
+
};
|
|
2483
|
+
const ActionsMenu = ({ options, open, setOpen }) => {
|
|
2484
|
+
const menuItems = options.map(({ label, onSelect, icon }) => /* @__PURE__ */ jsx(
|
|
2485
|
+
Button,
|
|
2486
|
+
{
|
|
2487
|
+
onClick: (event) => {
|
|
2488
|
+
event.stopPropagation();
|
|
2489
|
+
setOpen(false);
|
|
2490
|
+
onSelect();
|
|
2491
|
+
},
|
|
2492
|
+
variant: "tertiary",
|
|
2493
|
+
icon,
|
|
2494
|
+
children: label
|
|
2495
|
+
},
|
|
2496
|
+
label
|
|
2497
|
+
));
|
|
2498
|
+
return open ? /* @__PURE__ */ jsx(ClickAwayWrapper, { onClickAway: () => setOpen(false), className: styles$2.actionsMenu, role: "menu", children: menuItems }) : null;
|
|
2499
|
+
};
|
|
2500
|
+
const EntityAssociation = ({
|
|
2501
|
+
name,
|
|
2502
|
+
types,
|
|
2503
|
+
status,
|
|
2504
|
+
actions,
|
|
2505
|
+
problems,
|
|
2506
|
+
infoContent,
|
|
2507
|
+
onNavigateToEntity,
|
|
2508
|
+
deleteEntity,
|
|
2509
|
+
isDeleteDisabled
|
|
2510
|
+
}) => {
|
|
2511
|
+
const { t } = useTranslation("common");
|
|
2512
|
+
const [showingActions, setShowingActions] = useState(false);
|
|
2513
|
+
const [isConfirmShown, setIsConfirmShown] = useState(false);
|
|
2514
|
+
const isDeletable = !!deleteEntity;
|
|
2515
|
+
const handleRemoveIntent = (event) => {
|
|
2516
|
+
event.stopPropagation();
|
|
2517
|
+
setIsConfirmShown(true);
|
|
2518
|
+
};
|
|
2519
|
+
const dismissConfirm = () => {
|
|
2520
|
+
setIsConfirmShown(false);
|
|
2521
|
+
};
|
|
2522
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2523
|
+
/* @__PURE__ */ jsxs(
|
|
2524
|
+
Card,
|
|
2525
|
+
{
|
|
2526
|
+
className: "adyen-kyc-entity-association",
|
|
2527
|
+
stateful: Boolean(onNavigateToEntity),
|
|
2528
|
+
onClick: onNavigateToEntity,
|
|
2529
|
+
onKeyDown: handleKeys(["Enter"], onNavigateToEntity ?? noop),
|
|
2530
|
+
children: [
|
|
2531
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-association__top", children: [
|
|
2532
|
+
/* @__PURE__ */ jsx("h3", { className: "adyen-kyc-entity-association__title", children: name }),
|
|
2533
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-association__info", children: [
|
|
2534
|
+
/* @__PURE__ */ jsx(TaskItemStatus, { status }),
|
|
2535
|
+
actions && /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-association__actions", children: [
|
|
2536
|
+
/* @__PURE__ */ jsx(
|
|
2537
|
+
IconButton,
|
|
2538
|
+
{
|
|
2539
|
+
variant: "tertiary",
|
|
2540
|
+
icon: "more-horiz",
|
|
2541
|
+
onClick: (event) => {
|
|
2542
|
+
event.stopPropagation();
|
|
2543
|
+
setShowingActions(!showingActions);
|
|
2544
|
+
},
|
|
2545
|
+
ariaLabel: t(($) => $["toggleAssociationMenu"], { name })
|
|
2546
|
+
}
|
|
2547
|
+
),
|
|
2548
|
+
/* @__PURE__ */ jsx(ActionsMenu, { options: actions, open: showingActions, setOpen: setShowingActions })
|
|
2549
|
+
] }),
|
|
2550
|
+
isDeletable && /* @__PURE__ */ jsx(
|
|
2551
|
+
IconButton,
|
|
2552
|
+
{
|
|
2553
|
+
ariaLabel: t(($) => $["delete"]),
|
|
2554
|
+
icon: "bin",
|
|
2555
|
+
variant: "tertiary",
|
|
2556
|
+
onClick: handleRemoveIntent,
|
|
2557
|
+
disabled: isConfirmShown || isDeleteDisabled
|
|
2558
|
+
}
|
|
2559
|
+
)
|
|
2560
|
+
] })
|
|
2561
|
+
] }),
|
|
2562
|
+
/* @__PURE__ */ jsx("div", { children: types.map((type) => /* @__PURE__ */ jsx(
|
|
2563
|
+
Tag,
|
|
2564
|
+
{
|
|
2565
|
+
className: "adyen-kyc-entity-association__tag",
|
|
2566
|
+
variant: getRoleTagVariant(type),
|
|
2567
|
+
children: t(($) => $[getRoleName(type)])
|
|
2568
|
+
},
|
|
2569
|
+
type
|
|
2570
|
+
)) }),
|
|
2571
|
+
status === TaskStatuses.ERROR && /* @__PURE__ */ jsx(
|
|
2572
|
+
VerificationErrorAlert,
|
|
2573
|
+
{
|
|
2574
|
+
className: "adyen-kyc-entity-association-alert",
|
|
2575
|
+
problems
|
|
2576
|
+
}
|
|
2577
|
+
),
|
|
2578
|
+
infoContent
|
|
2579
|
+
]
|
|
2580
|
+
}
|
|
2581
|
+
),
|
|
2582
|
+
isConfirmShown && isDeletable && /* @__PURE__ */ jsx(
|
|
2583
|
+
Confirm,
|
|
2584
|
+
{
|
|
2585
|
+
title: t(($) => $["deleteItem"], { item: name }),
|
|
2586
|
+
description: t(($) => $["thisActionIsPermanent"]),
|
|
2587
|
+
onConfirm: deleteEntity,
|
|
2588
|
+
confirmText: t(($) => $["delete"]),
|
|
2589
|
+
onCancel: dismissConfirm,
|
|
2590
|
+
critical: true
|
|
2591
|
+
}
|
|
2592
|
+
)
|
|
2593
|
+
] });
|
|
2594
|
+
};
|
|
2595
|
+
const CompanyTrustMemberTaskItem = ({
|
|
2596
|
+
companyTrustMember,
|
|
2597
|
+
taskStatus,
|
|
2598
|
+
onEditOwner,
|
|
2599
|
+
onAddOwner,
|
|
2600
|
+
onEdit,
|
|
2601
|
+
onDelete
|
|
2602
|
+
}) => {
|
|
2603
|
+
const { t } = useTranslation(["trust", "common"]);
|
|
2604
|
+
const actions = [
|
|
2605
|
+
{
|
|
2606
|
+
icon: "edit",
|
|
2607
|
+
onSelect: onEdit,
|
|
2608
|
+
label: t(($) => $["editTrustMember"], { trustMember: companyTrustMember.name })
|
|
2609
|
+
},
|
|
2610
|
+
companyTrustMember.ownerId ? {
|
|
2611
|
+
icon: "edit",
|
|
2612
|
+
onSelect: onEditOwner,
|
|
2613
|
+
label: t(($) => $["editOwnerOfTrustMember"], {
|
|
2614
|
+
trustMember: companyTrustMember.name
|
|
2615
|
+
})
|
|
2616
|
+
} : {
|
|
2617
|
+
icon: "plus",
|
|
2618
|
+
onSelect: onAddOwner,
|
|
2619
|
+
label: t(($) => $["addOwnerToTrustMember"], {
|
|
2620
|
+
trustMember: companyTrustMember.name
|
|
2621
|
+
})
|
|
2622
|
+
},
|
|
2623
|
+
{
|
|
2624
|
+
icon: "bin",
|
|
2625
|
+
onSelect: onDelete,
|
|
2626
|
+
label: t(($) => $["removeTrustMember"], { trustMember: companyTrustMember.name })
|
|
2627
|
+
}
|
|
2628
|
+
];
|
|
2629
|
+
const infoContent = companyTrustMember.ownerId ? void 0 : /* @__PURE__ */ jsx(
|
|
2630
|
+
Alert,
|
|
2631
|
+
{
|
|
2632
|
+
title: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2633
|
+
t(($) => $["helpUsVerifyCompany"], { ns: "common" }),
|
|
2634
|
+
" ",
|
|
2635
|
+
/* @__PURE__ */ jsx(Button, { onClick: onAddOwner, variant: "link", children: t(($) => $["providePersonalDetailsOfOwner"]) })
|
|
2636
|
+
] }),
|
|
2637
|
+
className: "add-owner-alert"
|
|
2638
|
+
}
|
|
2639
|
+
);
|
|
2640
|
+
return /* @__PURE__ */ jsx(
|
|
2641
|
+
EntityAssociation,
|
|
2642
|
+
{
|
|
2643
|
+
types: companyTrustMember.roles,
|
|
2644
|
+
name: companyTrustMember.name,
|
|
2645
|
+
status: taskStatus,
|
|
2646
|
+
actions,
|
|
2647
|
+
infoContent,
|
|
2648
|
+
onNavigateToEntity: onEdit
|
|
2649
|
+
},
|
|
2650
|
+
companyTrustMember.legalEntityId
|
|
2651
|
+
);
|
|
2652
|
+
};
|
|
2653
|
+
const ExemptSettlorTaskItem = ({
|
|
2654
|
+
exemptSettlor,
|
|
2655
|
+
taskStatus,
|
|
2656
|
+
onEdit,
|
|
2657
|
+
onDelete
|
|
2658
|
+
}) => {
|
|
2659
|
+
const { t } = useTranslation("trust");
|
|
2660
|
+
const settlorName = exemptSettlor.legalEntityType === LegalEntityTypes.INDIVIDUAL ? `${exemptSettlor.exemptSettlorName?.firstName} ${exemptSettlor.exemptSettlorName?.lastName}` : exemptSettlor.name ?? "";
|
|
2661
|
+
const actions = [
|
|
2662
|
+
{
|
|
2663
|
+
icon: "edit",
|
|
2664
|
+
onSelect: onEdit,
|
|
2665
|
+
label: t(($) => $["editTrustMember"], { trustMember: settlorName })
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
icon: "bin",
|
|
2669
|
+
onSelect: onDelete,
|
|
2670
|
+
label: t(($) => $["removeTrustMember"], { trustMember: settlorName })
|
|
2671
|
+
}
|
|
2672
|
+
];
|
|
2673
|
+
return /* @__PURE__ */ jsx(
|
|
2674
|
+
EntityAssociation,
|
|
2675
|
+
{
|
|
2676
|
+
types: exemptSettlor.roles,
|
|
2677
|
+
name: settlorName,
|
|
2678
|
+
status: taskStatus,
|
|
2679
|
+
actions,
|
|
2680
|
+
onNavigateToEntity: onEdit
|
|
2681
|
+
},
|
|
2682
|
+
exemptSettlor.legalEntityId
|
|
2683
|
+
);
|
|
2684
|
+
};
|
|
2685
|
+
const RegularTrustMemberTaskItem = ({
|
|
2686
|
+
trustMember,
|
|
2687
|
+
taskStatus,
|
|
2688
|
+
onEdit,
|
|
2689
|
+
onDelete
|
|
2690
|
+
}) => {
|
|
2691
|
+
const { t } = useTranslation("trust");
|
|
2692
|
+
const actions = [
|
|
2693
|
+
{
|
|
2694
|
+
icon: "edit",
|
|
2695
|
+
onSelect: onEdit,
|
|
2696
|
+
label: t(($) => $["editTrustMember"], { trustMember: trustMember.name })
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
icon: "bin",
|
|
2700
|
+
onSelect: onDelete,
|
|
2701
|
+
label: t(($) => $["removeTrustMember"], { trustMember: trustMember.name })
|
|
2702
|
+
}
|
|
2703
|
+
];
|
|
2704
|
+
return /* @__PURE__ */ jsx(
|
|
2705
|
+
EntityAssociation,
|
|
2706
|
+
{
|
|
2707
|
+
types: trustMember.roles,
|
|
2708
|
+
name: trustMember.name,
|
|
2709
|
+
status: taskStatus,
|
|
2710
|
+
actions,
|
|
2711
|
+
onNavigateToEntity: onEdit
|
|
2712
|
+
},
|
|
2713
|
+
trustMember.legalEntityId
|
|
2714
|
+
);
|
|
2715
|
+
};
|
|
2716
|
+
const RootTrusteeTaskItem = ({
|
|
2717
|
+
rootTrustee,
|
|
2718
|
+
taskStatus,
|
|
2719
|
+
onEdit
|
|
2720
|
+
}) => {
|
|
2721
|
+
const { t } = useTranslation("trust");
|
|
2722
|
+
const actions = [
|
|
2723
|
+
{
|
|
2724
|
+
icon: "edit",
|
|
2725
|
+
onSelect: onEdit,
|
|
2726
|
+
label: t(($) => $["editTrustMember"], { trustMember: rootTrustee.name })
|
|
2727
|
+
}
|
|
2728
|
+
];
|
|
2729
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
2730
|
+
const isAllowMoreRolesForMainRootTrustee = isExperimentEnabled(
|
|
2731
|
+
"AllowMoreRolesForMainRootTrustee"
|
|
2732
|
+
);
|
|
2733
|
+
return /* @__PURE__ */ jsx(
|
|
2734
|
+
EntityAssociation,
|
|
2735
|
+
{
|
|
2736
|
+
types: isExperimentEnabled("AllowMoreRolesForMainRootTrustee") ? rootTrustee.roles : [TrustMemberTypes.TRUSTEE],
|
|
2737
|
+
name: rootTrustee.name,
|
|
2738
|
+
status: taskStatus,
|
|
2739
|
+
actions: isAllowMoreRolesForMainRootTrustee ? actions : void 0
|
|
2740
|
+
}
|
|
2741
|
+
);
|
|
2742
|
+
};
|
|
2743
|
+
const UndefinedBeneficiaryTaskItem = ({
|
|
2744
|
+
undefinedBeneficiary,
|
|
2745
|
+
onEdit,
|
|
2746
|
+
onDelete
|
|
2747
|
+
}) => {
|
|
2748
|
+
const { t } = useTranslation("trust");
|
|
2749
|
+
const actions = [
|
|
2750
|
+
{
|
|
2751
|
+
icon: "edit",
|
|
2752
|
+
onSelect: onEdit,
|
|
2753
|
+
label: t(($) => $["editTrustMember"], {
|
|
2754
|
+
trustMember: t(($) => $["undefinedBeneficiary"])
|
|
2755
|
+
})
|
|
2756
|
+
},
|
|
2757
|
+
{
|
|
2758
|
+
icon: "bin",
|
|
2759
|
+
onSelect: onDelete,
|
|
2760
|
+
label: t(($) => $["removeTrustMember"], {
|
|
2761
|
+
trustMember: t(($) => $["undefinedBeneficiary"])
|
|
2762
|
+
})
|
|
2763
|
+
}
|
|
2764
|
+
];
|
|
2765
|
+
return /* @__PURE__ */ jsx(
|
|
2766
|
+
EntityAssociation,
|
|
2767
|
+
{
|
|
2768
|
+
name: undefinedBeneficiary.description,
|
|
2769
|
+
types: [TrustMemberTypes.UNDEFINED_BENEFICIARY],
|
|
2770
|
+
status: TaskStatuses.FINISHED,
|
|
2771
|
+
actions,
|
|
2772
|
+
onNavigateToEntity: onEdit
|
|
2773
|
+
},
|
|
2774
|
+
undefinedBeneficiary.reference
|
|
2775
|
+
);
|
|
2776
|
+
};
|
|
2777
|
+
const TrustMembersOverview = ({
|
|
2778
|
+
navigateBackToTaskList,
|
|
2779
|
+
navigateToEditTrustMember,
|
|
2780
|
+
navigateToEditTrustMemberOwner
|
|
2781
|
+
}) => {
|
|
2782
|
+
const { t, i18n } = useTranslation("trust");
|
|
2783
|
+
const { data: rootLe, isLoading } = useLegalEntity(ROOT_LE);
|
|
2784
|
+
const { data: trustLe, refetch: refetchTrust } = useAssociatedLegalEntity(
|
|
2785
|
+
rootLe,
|
|
2786
|
+
LegalEntityTypes.TRUST
|
|
2787
|
+
);
|
|
2788
|
+
const trustMembers = useTrustMembers();
|
|
2789
|
+
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
2790
|
+
const { showToast } = useToastContext();
|
|
2791
|
+
addResourceBundles(i18n, i18n.language, [
|
|
2792
|
+
{ ns: "trust", importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../language/bg-BG.json": () => import("./bg-BG-CepHap8j.js"), "../../language/cs-CZ.json": () => import("./cs-CZ-BP7niQM9.js"), "../../language/da-DK.json": () => import("./da-DK-Dc0QYG8m.js"), "../../language/de-DE.json": () => import("./de-DE-Dz2OsS1F.js"), "../../language/el-GR.json": () => import("./el-GR-BHG69mXl.js"), "../../language/en-US.json": () => import("./en-US-D-B35AoN.js"), "../../language/es-ES.json": () => import("./es-ES-BI_jdT67.js"), "../../language/et-EE.json": () => import("./et-EE-C_PZO2aI.js"), "../../language/fi-FI.json": () => import("./fi-FI-hwzizPnr.js"), "../../language/fr-FR.json": () => import("./fr-FR-CYZXbwc9.js"), "../../language/hr-HR.json": () => import("./hr-HR-bE6cvRCQ.js"), "../../language/hu-HU.json": () => import("./hu-HU-DG-NUDx4.js"), "../../language/it-IT.json": () => import("./it-IT-Erh1DIlj.js"), "../../language/ja-JP.json": () => import("./ja-JP-ThzG9vIo.js"), "../../language/lt-LT.json": () => import("./lt-LT-Nd1uRoIj.js"), "../../language/lv-LV.json": () => import("./lv-LV-DKhV24CI.js"), "../../language/nl-NL.json": () => import("./nl-NL-O9GCHMDA.js"), "../../language/no-NO.json": () => import("./no-NO-CA1aR6Wh.js"), "../../language/pl-PL.json": () => import("./pl-PL-BKDK0_G8.js"), "../../language/pt-BR.json": () => import("./pt-BR-NtLaWlnZ.js"), "../../language/pt-PT.json": () => import("./pt-PT-DSxxVA0f.js"), "../../language/ro-RO.json": () => import("./ro-RO-Bybq8JFn.js"), "../../language/sk-SK.json": () => import("./sk-SK-C6rMIxpz.js"), "../../language/sl-SI.json": () => import("./sl-SI-tPwbFvOI.js"), "../../language/sv-SE.json": () => import("./sv-SE-K1QT1cOt.js") }), `../../language/${i18n.language}.json`, 4) }
|
|
2793
|
+
]);
|
|
2794
|
+
if (isLoading || !rootLe || !trustLe) {
|
|
2795
|
+
return /* @__PURE__ */ jsx(Loader, { size: "large" });
|
|
2796
|
+
}
|
|
2797
|
+
const deleteTrustMember = async (trustMember) => {
|
|
2798
|
+
try {
|
|
2799
|
+
switch (trustMember.trustMemberType) {
|
|
2800
|
+
case "regular":
|
|
2801
|
+
case "exemptSettlor":
|
|
2802
|
+
case "company":
|
|
2803
|
+
await deleteAssociatedTrustMember({
|
|
2804
|
+
associatedTrustMember: trustMember,
|
|
2805
|
+
trust: trustLe,
|
|
2806
|
+
asyncMutation: updateLegalEntity
|
|
2807
|
+
});
|
|
2808
|
+
break;
|
|
2809
|
+
case "undefinedBeneficiary":
|
|
2810
|
+
await deleteUndefinedBeneficiary({
|
|
2811
|
+
undefinedBeneficiary: trustMember,
|
|
2812
|
+
trust: trustLe,
|
|
2813
|
+
asyncMutation: updateLegalEntity
|
|
2814
|
+
});
|
|
2815
|
+
break;
|
|
2816
|
+
case "rootTrustee":
|
|
2817
|
+
throw new Error("Cannot delete root trustee");
|
|
2818
|
+
}
|
|
2819
|
+
await refetchTrust();
|
|
2820
|
+
showToast({ variant: "success", label: t(($) => $["successFullyRemovedTrustMember"]) });
|
|
2821
|
+
} catch {
|
|
2822
|
+
showToast({ variant: "error", label: t(($) => $["failedToRemoveTrustMember"]) });
|
|
2823
|
+
}
|
|
2824
|
+
};
|
|
2825
|
+
return /* @__PURE__ */ jsx(
|
|
2826
|
+
TrustMembersOverviewInner,
|
|
2827
|
+
{
|
|
2828
|
+
trustMembers,
|
|
2829
|
+
deleteTrustMember,
|
|
2830
|
+
navigateBackToTaskList,
|
|
2831
|
+
navigateToEditTrustMember,
|
|
2832
|
+
navigateToEditTrustMemberOwner
|
|
2833
|
+
}
|
|
2834
|
+
);
|
|
2835
|
+
};
|
|
2836
|
+
const TrustMembersOverviewInner = ({
|
|
2837
|
+
trustMembers,
|
|
2838
|
+
deleteTrustMember,
|
|
2839
|
+
navigateBackToTaskList,
|
|
2840
|
+
navigateToEditTrustMember,
|
|
2841
|
+
navigateToEditTrustMemberOwner
|
|
2842
|
+
}) => {
|
|
2843
|
+
const { t } = useTranslation(["trust", "common"]);
|
|
2844
|
+
const trustMemberRequirements = DEFAULT_TRUST_MEMBER_REQUIREMENTS;
|
|
2845
|
+
const trustMembersWithOneOfGivenRoles = (roleTypes) => trustMembers.filter(
|
|
2846
|
+
({ roles }) => roleTypes.some((label) => roles.includes(label))
|
|
2847
|
+
);
|
|
2848
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
2849
|
+
const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
2850
|
+
const getTaskStatus2 = useGetTaskStatus();
|
|
2851
|
+
return /* @__PURE__ */ jsx(
|
|
2852
|
+
DropinLayout,
|
|
2853
|
+
{
|
|
2854
|
+
content: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-trust-members adyen-kyc-u-width-full", children: [
|
|
2855
|
+
/* @__PURE__ */ jsx(
|
|
2856
|
+
Header,
|
|
2857
|
+
{
|
|
2858
|
+
title: t(($) => $["trustMembers"]),
|
|
2859
|
+
description: t(($) => $["trustMembersDescription"])
|
|
2860
|
+
}
|
|
2861
|
+
),
|
|
2862
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-trust-members__container", children: trustMemberRequirements.map(({ roleTypes, min, label }) => /* @__PURE__ */ jsx(
|
|
2863
|
+
EntityGuidanceStatus,
|
|
2864
|
+
{
|
|
2865
|
+
country: CountryCodes.Australia,
|
|
2866
|
+
currentTask: TaskTypes.TRUST_MEMBER_OVERVIEW,
|
|
2867
|
+
entityLabel: label,
|
|
2868
|
+
status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min)
|
|
2869
|
+
},
|
|
2870
|
+
label
|
|
2871
|
+
)) }),
|
|
2872
|
+
/* @__PURE__ */ jsx(
|
|
2873
|
+
ContextGuidance,
|
|
2874
|
+
{
|
|
2875
|
+
title: t(($) => $["whatIsTheDifferenceBetweenTheseRoles"]),
|
|
2876
|
+
content: /* @__PURE__ */ jsx("ul", { className: "adyen-kyc-guidance-list", children: trustMemberRequirements.map(({ label }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, ns: "trust", i18nKey: ($) => $[`${label}GuideDescription`] }) }, label)) }),
|
|
2877
|
+
titleId: "whatIsTheDifferenceBetweenTheseRoles",
|
|
2878
|
+
contentId: "differenceBetweenTrustMemberRoles"
|
|
2879
|
+
}
|
|
2880
|
+
),
|
|
2881
|
+
/* @__PURE__ */ jsx(StackLayout, { gap: "small", children: trustMembers.map((trustMember) => {
|
|
2882
|
+
switch (trustMember.trustMemberType) {
|
|
2883
|
+
case "rootTrustee":
|
|
2884
|
+
return /* @__PURE__ */ jsx(
|
|
2885
|
+
RootTrusteeTaskItem,
|
|
2886
|
+
{
|
|
2887
|
+
rootTrustee: trustMember,
|
|
2888
|
+
taskStatus: getTaskStatus2(
|
|
2889
|
+
trustMember.legalEntityType == "organization" ? TaskTypes.TRUST_MEMBER_COMPANY : TaskTypes.TRUST_MEMBER_INDIVIDUAL,
|
|
2890
|
+
String(trustMember.legalEntityId)
|
|
2891
|
+
),
|
|
2892
|
+
onEdit: allowMoreRolesForMainRootTrustee ? () => navigateToEditTrustMember(trustMember) : () => {
|
|
2893
|
+
}
|
|
2894
|
+
},
|
|
2895
|
+
trustMember.legalEntityId
|
|
2896
|
+
);
|
|
2897
|
+
case "regular":
|
|
2898
|
+
return /* @__PURE__ */ jsx(
|
|
2899
|
+
RegularTrustMemberTaskItem,
|
|
2900
|
+
{
|
|
2901
|
+
trustMember,
|
|
2902
|
+
taskStatus: getTaskStatus2(
|
|
2903
|
+
TaskTypes.TRUST_MEMBER_INDIVIDUAL,
|
|
2904
|
+
String(trustMember.legalEntityId)
|
|
2905
|
+
),
|
|
2906
|
+
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
2907
|
+
onDelete: () => deleteTrustMember(trustMember)
|
|
2908
|
+
},
|
|
2909
|
+
trustMember.legalEntityId
|
|
2910
|
+
);
|
|
2911
|
+
case "company":
|
|
2912
|
+
return /* @__PURE__ */ jsx(
|
|
2913
|
+
CompanyTrustMemberTaskItem,
|
|
2914
|
+
{
|
|
2915
|
+
companyTrustMember: trustMember,
|
|
2916
|
+
taskStatus: getTaskStatus2(
|
|
2917
|
+
TaskTypes.TRUST_MEMBER_COMPANY,
|
|
2918
|
+
String(trustMember.legalEntityId)
|
|
2919
|
+
),
|
|
2920
|
+
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
2921
|
+
onDelete: () => deleteTrustMember(trustMember),
|
|
2922
|
+
onEditOwner: () => navigateToEditTrustMemberOwner(
|
|
2923
|
+
trustMember.ownerId,
|
|
2924
|
+
trustMember.legalEntityId
|
|
2925
|
+
),
|
|
2926
|
+
onAddOwner: () => navigateToEditTrustMemberOwner("", trustMember.legalEntityId)
|
|
2927
|
+
},
|
|
2928
|
+
trustMember.legalEntityId
|
|
2929
|
+
);
|
|
2930
|
+
case "exemptSettlor":
|
|
2931
|
+
return /* @__PURE__ */ jsx(
|
|
2932
|
+
ExemptSettlorTaskItem,
|
|
2933
|
+
{
|
|
2934
|
+
exemptSettlor: trustMember,
|
|
2935
|
+
taskStatus: getTaskStatus2(
|
|
2936
|
+
TaskTypes.TRUST_MEMBER_INDIVIDUAL,
|
|
2937
|
+
String(trustMember.legalEntityId)
|
|
2938
|
+
),
|
|
2939
|
+
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
2940
|
+
onDelete: () => deleteTrustMember(trustMember)
|
|
2941
|
+
},
|
|
2942
|
+
trustMember.legalEntityId
|
|
2943
|
+
);
|
|
2944
|
+
case "undefinedBeneficiary":
|
|
2945
|
+
return /* @__PURE__ */ jsx(
|
|
2946
|
+
UndefinedBeneficiaryTaskItem,
|
|
2947
|
+
{
|
|
2948
|
+
undefinedBeneficiary: trustMember,
|
|
2949
|
+
onEdit: () => navigateToEditTrustMember(trustMember),
|
|
2950
|
+
onDelete: () => deleteTrustMember(trustMember)
|
|
2951
|
+
},
|
|
2952
|
+
trustMember.reference
|
|
2953
|
+
);
|
|
2954
|
+
}
|
|
2955
|
+
}) }),
|
|
2956
|
+
/* @__PURE__ */ jsx(
|
|
2957
|
+
Button,
|
|
2958
|
+
{
|
|
2959
|
+
variant: "secondary",
|
|
2960
|
+
icon: "plus",
|
|
2961
|
+
onClick: (e) => {
|
|
2962
|
+
e.stopPropagation();
|
|
2963
|
+
navigateToEditTrustMember("new");
|
|
2964
|
+
},
|
|
2965
|
+
children: t(($) => $["addTrustMember"])
|
|
2966
|
+
}
|
|
2967
|
+
),
|
|
2968
|
+
/* @__PURE__ */ jsx(
|
|
2969
|
+
ActionBar,
|
|
2970
|
+
{
|
|
2971
|
+
onHome: navigateBackToTaskList,
|
|
2972
|
+
homeButtonLabel: t(($) => $["saveAndGoToOverview"], { ns: "common" })
|
|
2973
|
+
}
|
|
2974
|
+
)
|
|
2975
|
+
] })
|
|
2976
|
+
}
|
|
2977
|
+
);
|
|
2978
|
+
};
|
|
2979
|
+
const createDefaultMember = (selectedMember, selectedEntityType, selectedRoles) => {
|
|
2980
|
+
const firstRole = selectedRoles?.[0];
|
|
2981
|
+
return {
|
|
2982
|
+
memberType: selectedMember?.memberType || firstRole,
|
|
2983
|
+
roles: selectedRoles || selectedMember?.roles || [UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER],
|
|
2984
|
+
legalEntityType: selectedEntityType,
|
|
2985
|
+
legalEntityId: selectedMember?.legalEntityId || "",
|
|
2986
|
+
name: selectedMember?.name || ""
|
|
2987
|
+
};
|
|
2988
|
+
};
|
|
2989
|
+
const useUnincorporatedPartnershipNavigation = ({ navigateTo }) => {
|
|
2990
|
+
const [activeMember, setActiveMember] = useState();
|
|
2991
|
+
const { rootLegalEntityId } = useApiContext();
|
|
2992
|
+
const onNavigateToMember = async ({
|
|
2993
|
+
selectedMember,
|
|
2994
|
+
selectedRoles,
|
|
2995
|
+
selectedEntityType,
|
|
2996
|
+
roleAndType
|
|
2997
|
+
}) => {
|
|
2998
|
+
const createdMember = createDefaultMember(selectedMember, selectedEntityType, selectedRoles);
|
|
2999
|
+
setActiveMember(createdMember);
|
|
3000
|
+
if (rootLegalEntityId.value === createdMember?.legalEntityId) {
|
|
3001
|
+
navigateTo(
|
|
3002
|
+
createdMember.legalEntityType === LegalEntityTypes.INDIVIDUAL ? TaskTypes.INDIVIDUAL : TaskTypes.BUSINESS_DETAILS
|
|
3003
|
+
);
|
|
3004
|
+
return;
|
|
3005
|
+
}
|
|
3006
|
+
if (roleAndType) {
|
|
3007
|
+
navigateTo(TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_ROLE_AND_TYPE);
|
|
3008
|
+
return;
|
|
3009
|
+
}
|
|
3010
|
+
navigateTo(
|
|
3011
|
+
createdMember?.legalEntityType === LegalEntityTypes.ORGANIZATION ? TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY : TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL
|
|
3012
|
+
);
|
|
3013
|
+
};
|
|
3014
|
+
return {
|
|
3015
|
+
onNavigateToMember,
|
|
3016
|
+
activeMember,
|
|
3017
|
+
setActiveMember
|
|
3018
|
+
};
|
|
3019
|
+
};
|
|
3020
|
+
const adyenKycRoleAndTypeContainer = "adyen-kyc-adyen-kyc-role-and-type-container";
|
|
3021
|
+
const adyenKycRoleAndTypeActionBar = "adyen-kyc-adyen-kyc-role-and-type-action-bar";
|
|
3022
|
+
const inlineRadioGroup = "adyen-kyc-inline-radio-group";
|
|
3023
|
+
const styles$1 = {
|
|
3024
|
+
adyenKycRoleAndTypeContainer,
|
|
3025
|
+
adyenKycRoleAndTypeActionBar,
|
|
3026
|
+
inlineRadioGroup
|
|
3027
|
+
};
|
|
3028
|
+
const UnincorporatedPartnershipRadioGroup = ({
|
|
3029
|
+
memberType,
|
|
3030
|
+
errorMessage,
|
|
3031
|
+
handleChangeFor,
|
|
3032
|
+
value
|
|
3033
|
+
}) => {
|
|
3034
|
+
const { i18n } = useI18nContext();
|
|
3035
|
+
return /* @__PURE__ */ jsx(
|
|
3036
|
+
Field,
|
|
3037
|
+
{
|
|
3038
|
+
el: "fieldset",
|
|
3039
|
+
name: memberType,
|
|
3040
|
+
label: i18n.get(
|
|
3041
|
+
memberType === UnincorporatedPartnershipMemberTypes.OWNER ? "ownerDescriptionAsPartner" : "controllerDescriptionAsPartner"
|
|
3042
|
+
),
|
|
3043
|
+
className: styles$1.inlineRadioGroup,
|
|
3044
|
+
errorMessage,
|
|
3045
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
3046
|
+
RadioGroup,
|
|
3047
|
+
{
|
|
3048
|
+
...childProps,
|
|
3049
|
+
name: memberType,
|
|
3050
|
+
items: [
|
|
3051
|
+
{ id: "yes", name: "yes" },
|
|
3052
|
+
{ id: "no", name: "no" }
|
|
3053
|
+
],
|
|
3054
|
+
value,
|
|
3055
|
+
onChange: (id) => handleChangeFor(memberType)(
|
|
3056
|
+
id
|
|
3057
|
+
),
|
|
3058
|
+
horizontal: true
|
|
3059
|
+
}
|
|
3060
|
+
)
|
|
3061
|
+
}
|
|
3062
|
+
);
|
|
3063
|
+
};
|
|
3064
|
+
const unincorporatedPartnershipRoleAndTypeValidationRules = {
|
|
3065
|
+
entityType: {
|
|
3066
|
+
modes: ["blur"],
|
|
3067
|
+
validate: (entityType) => !isEmpty(entityType),
|
|
3068
|
+
errorMessage: "fieldIsRequired"
|
|
3069
|
+
},
|
|
3070
|
+
uboThroughControl: {
|
|
3071
|
+
modes: ["blur"],
|
|
3072
|
+
validate: (value) => !!value,
|
|
3073
|
+
errorMessage: "fieldIsRequired"
|
|
3074
|
+
},
|
|
3075
|
+
uboThroughOwnership: {
|
|
3076
|
+
modes: ["blur"],
|
|
3077
|
+
validate: (value) => !!value,
|
|
3078
|
+
errorMessage: "fieldIsRequired"
|
|
3079
|
+
}
|
|
3080
|
+
};
|
|
3081
|
+
const regularForms = {
|
|
3082
|
+
roleAndEntityType: {
|
|
3083
|
+
formId: "roleAndEntityType",
|
|
3084
|
+
formName: "roleAndEntityType",
|
|
3085
|
+
fields: ["role", "entityType"]
|
|
3086
|
+
},
|
|
3087
|
+
memberDetails: {
|
|
3088
|
+
formId: "memberDetails",
|
|
3089
|
+
formName: "memberDetails"
|
|
3090
|
+
}
|
|
3091
|
+
};
|
|
3092
|
+
const leTypeCardDetails = {
|
|
3093
|
+
[LegalEntityTypes.INDIVIDUAL]: {
|
|
3094
|
+
id: "individual",
|
|
3095
|
+
name: "individualMember",
|
|
3096
|
+
description: "partnerNotABusiness"
|
|
3097
|
+
},
|
|
3098
|
+
[LegalEntityTypes.ORGANIZATION]: {
|
|
3099
|
+
id: "organization",
|
|
3100
|
+
name: "companyMember",
|
|
3101
|
+
description: "partnerIsABusiness"
|
|
3102
|
+
}
|
|
3103
|
+
};
|
|
3104
|
+
function getUboStatus(roles, roleType, existingMember) {
|
|
3105
|
+
if (!existingMember) {
|
|
3106
|
+
return void 0;
|
|
3107
|
+
}
|
|
3108
|
+
return roles?.includes(roleType) ? "yes" : "no";
|
|
3109
|
+
}
|
|
3110
|
+
function UnincorporatedPartnershipRoleAndTypeDropin({
|
|
3111
|
+
onNavigateToMember,
|
|
3112
|
+
activeMember
|
|
3113
|
+
}) {
|
|
3114
|
+
const { t } = useTranslation(["common"]);
|
|
3115
|
+
const { t: unincorpPartnershipT } = useTranslation(["unincorpPartnership"]);
|
|
3116
|
+
const [shouldValidate, setShouldValidate] = useState(false);
|
|
3117
|
+
const activeForm = regularForms.roleAndEntityType;
|
|
3118
|
+
const formUtils = createFormUtils(
|
|
3119
|
+
{},
|
|
3120
|
+
t
|
|
3121
|
+
);
|
|
3122
|
+
const formsWithValidity = Object.values(regularForms).map((form) => ({
|
|
3123
|
+
formId: form.formId,
|
|
3124
|
+
formName: form.formName,
|
|
3125
|
+
isValid: false
|
|
3126
|
+
}));
|
|
3127
|
+
const existingMember = activeMember?.legalEntityId;
|
|
3128
|
+
const defaultData = {
|
|
3129
|
+
entityType: activeMember?.legalEntityType,
|
|
3130
|
+
uboThroughControl: getUboStatus(
|
|
3131
|
+
activeMember?.roles,
|
|
3132
|
+
UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON,
|
|
3133
|
+
existingMember
|
|
3134
|
+
),
|
|
3135
|
+
uboThroughOwnership: getUboStatus(
|
|
3136
|
+
activeMember?.roles,
|
|
3137
|
+
UnincorporatedPartnershipMemberTypes.OWNER,
|
|
3138
|
+
existingMember
|
|
3139
|
+
)
|
|
3140
|
+
};
|
|
3141
|
+
const decideFields = (data2) => {
|
|
3142
|
+
if (data2.entityType === LegalEntityTypes.INDIVIDUAL) {
|
|
3143
|
+
return ["entityType", "uboThroughControl", "uboThroughOwnership"];
|
|
3144
|
+
}
|
|
3145
|
+
return ["entityType"];
|
|
3146
|
+
};
|
|
3147
|
+
const { data, schema, errors, fieldProblems, handleChangeFor } = useForm({
|
|
3148
|
+
schema: decideFields,
|
|
3149
|
+
rules: unincorporatedPartnershipRoleAndTypeValidationRules,
|
|
3150
|
+
defaultData,
|
|
3151
|
+
shouldValidate
|
|
3152
|
+
});
|
|
3153
|
+
const onNextClick = () => {
|
|
3154
|
+
if (Object.values(data).some((fieldValue) => !fieldValue) && data.entityType !== LegalEntityTypes.ORGANIZATION) {
|
|
3155
|
+
setShouldValidate(true);
|
|
3156
|
+
return;
|
|
3157
|
+
}
|
|
3158
|
+
const selectedRoles = [
|
|
3159
|
+
UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER
|
|
3160
|
+
];
|
|
3161
|
+
if (data.entityType === LegalEntityTypes.INDIVIDUAL) {
|
|
3162
|
+
if (data.uboThroughControl === "yes") {
|
|
3163
|
+
selectedRoles.push(UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON);
|
|
3164
|
+
}
|
|
3165
|
+
if (data.uboThroughOwnership === "yes") {
|
|
3166
|
+
selectedRoles.push(UnincorporatedPartnershipMemberTypes.OWNER);
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
onNavigateToMember({
|
|
3170
|
+
selectedMember: activeMember,
|
|
3171
|
+
selectedRoles,
|
|
3172
|
+
selectedEntityType: data.entityType
|
|
3173
|
+
});
|
|
3174
|
+
};
|
|
3175
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$1.adyenKycRoleAndTypeContainer, children: [
|
|
3176
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-dropin__sidebar-wrapper", children: /* @__PURE__ */ jsx(
|
|
3177
|
+
FormNavigation,
|
|
3178
|
+
{
|
|
3179
|
+
forms: formsWithValidity,
|
|
3180
|
+
activeForm: formsWithValidity.find((form) => form.formId === activeForm.formId) || formsWithValidity?.[0],
|
|
3181
|
+
taskName: "unincorporatedPartnershipMembers",
|
|
3182
|
+
gotoForm: () => {
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
) }),
|
|
3186
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-container", children: [
|
|
3187
|
+
/* @__PURE__ */ jsx(
|
|
3188
|
+
"div",
|
|
3189
|
+
{
|
|
3190
|
+
className: "adyen-kyc-form-wrapper",
|
|
3191
|
+
children: /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-trust__role-and-entity-type adyen-kyc-u-width-full", children: [
|
|
3192
|
+
/* @__PURE__ */ jsx(
|
|
3193
|
+
Header,
|
|
3194
|
+
{
|
|
3195
|
+
title: t(($) => $["roleAndEntityType"]),
|
|
3196
|
+
description: unincorpPartnershipT(($) => $["partnerRoleDescription"])
|
|
3197
|
+
}
|
|
3198
|
+
),
|
|
3199
|
+
/* @__PURE__ */ jsx(
|
|
3200
|
+
Field,
|
|
3201
|
+
{
|
|
3202
|
+
el: "fieldset",
|
|
3203
|
+
name: "entityType",
|
|
3204
|
+
label: formUtils.getLabel("entityType", "whatTypeOfEntityIsPartner"),
|
|
3205
|
+
errorMessage: formUtils.getErrorMessage("entityType", errors, fieldProblems),
|
|
3206
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
3207
|
+
RadioGroupCard,
|
|
3208
|
+
{
|
|
3209
|
+
...childProps,
|
|
3210
|
+
name: "entityType",
|
|
3211
|
+
options: trustMemberLegalEntityTypes,
|
|
3212
|
+
selected: data?.entityType,
|
|
3213
|
+
onSelect: (option) => handleChangeFor("entityType")(option),
|
|
3214
|
+
optionId: (option) => leTypeCardDetails[option].id,
|
|
3215
|
+
optionName: (option) => unincorpPartnershipT(($) => $[leTypeCardDetails[option].name]),
|
|
3216
|
+
optionDescription: (option) => unincorpPartnershipT(($) => $[leTypeCardDetails[option].description]),
|
|
3217
|
+
"aria-required": true
|
|
3218
|
+
}
|
|
3219
|
+
)
|
|
3220
|
+
}
|
|
3221
|
+
),
|
|
3222
|
+
schema.includes("uboThroughOwnership") && /* @__PURE__ */ jsx(
|
|
3223
|
+
UnincorporatedPartnershipRadioGroup,
|
|
3224
|
+
{
|
|
3225
|
+
memberType: UnincorporatedPartnershipMemberTypes.OWNER,
|
|
3226
|
+
handleChangeFor,
|
|
3227
|
+
errorMessage: formUtils.getErrorMessage(
|
|
3228
|
+
UnincorporatedPartnershipMemberTypes.OWNER,
|
|
3229
|
+
errors,
|
|
3230
|
+
fieldProblems
|
|
3231
|
+
),
|
|
3232
|
+
value: data?.uboThroughOwnership
|
|
3233
|
+
}
|
|
3234
|
+
),
|
|
3235
|
+
schema.includes("uboThroughControl") && /* @__PURE__ */ jsx(
|
|
3236
|
+
UnincorporatedPartnershipRadioGroup,
|
|
3237
|
+
{
|
|
3238
|
+
memberType: UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON,
|
|
3239
|
+
handleChangeFor,
|
|
3240
|
+
errorMessage: formUtils.getErrorMessage(
|
|
3241
|
+
UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON,
|
|
3242
|
+
errors,
|
|
3243
|
+
fieldProblems
|
|
3244
|
+
),
|
|
3245
|
+
value: data?.uboThroughControl
|
|
3246
|
+
}
|
|
3247
|
+
)
|
|
3248
|
+
] })
|
|
3249
|
+
}
|
|
3250
|
+
),
|
|
3251
|
+
/* @__PURE__ */ jsx("div", { className: styles$1.adyenKycRoleAndTypeActionBar, children: /* @__PURE__ */ jsx(Button, { onClick: onNextClick, children: t(($) => $["continue"]) }) })
|
|
3252
|
+
] })
|
|
3253
|
+
] });
|
|
3254
|
+
}
|
|
3255
|
+
function UnincorporatedPartnershipMemberRoleAndTypePage({
|
|
3256
|
+
memberId,
|
|
3257
|
+
onNavigateToMember,
|
|
3258
|
+
navigateBack
|
|
3259
|
+
}) {
|
|
3260
|
+
const { i18n } = useTranslation();
|
|
3261
|
+
const { data: memberLe } = useLegalEntity(memberId || skipToken);
|
|
3262
|
+
const unincorporatedPartnershipMembers = useUnincorporatedPartnershipMembers();
|
|
3263
|
+
addResourceBundles(i18n, i18n.language, [
|
|
3264
|
+
{
|
|
3265
|
+
ns: "unincorpPartnership",
|
|
3266
|
+
importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-er0t4jTs.js"), "../language/cs-CZ.json": () => import("./cs-CZ-CQNBae2b.js"), "../language/da-DK.json": () => import("./da-DK-gnPgzwrG.js"), "../language/de-DE.json": () => import("./de-DE-D3lLuF8z.js"), "../language/el-GR.json": () => import("./el-GR-XRux2Wpv.js"), "../language/en-US.json": () => import("./en-US-B96dpVon.js"), "../language/es-ES.json": () => import("./es-ES-CXDJLKAI.js"), "../language/et-EE.json": () => import("./et-EE--cL_YqWe.js"), "../language/fi-FI.json": () => import("./fi-FI-fArobrt5.js"), "../language/fr-FR.json": () => import("./fr-FR-CiwkAb3E.js"), "../language/hr-HR.json": () => import("./hr-HR-DtfHQVe0.js"), "../language/hu-HU.json": () => import("./hu-HU-I4-KFzvz.js"), "../language/it-IT.json": () => import("./it-IT-DIbH-udG.js"), "../language/ja-JP.json": () => import("./ja-JP-bz7ekGnF.js"), "../language/lt-LT.json": () => import("./lt-LT-BLsIcCtE.js"), "../language/lv-LV.json": () => import("./lv-LV-C7hMdPcY.js"), "../language/nl-NL.json": () => import("./nl-NL-NlkjOSYi.js"), "../language/no-NO.json": () => import("./no-NO-Crlsj6HG.js"), "../language/pl-PL.json": () => import("./pl-PL-DYxD6VJ_.js"), "../language/pt-BR.json": () => import("./pt-BR-BfxgHKY4.js"), "../language/pt-PT.json": () => import("./pt-PT-TKg5FLat.js"), "../language/ro-RO.json": () => import("./ro-RO-3rOfS17N.js"), "../language/sk-SK.json": () => import("./sk-SK-CjrLvDMx.js"), "../language/sl-SI.json": () => import("./sl-SI-C-C-KJCX.js"), "../language/sv-SE.json": () => import("./sv-SE-BHfydid5.js") }), `../language/${i18n.language}.json`, 3)
|
|
3267
|
+
}
|
|
3268
|
+
]);
|
|
3269
|
+
if (memberId && !memberLe) {
|
|
3270
|
+
return /* @__PURE__ */ jsx(Loader, {});
|
|
3271
|
+
}
|
|
3272
|
+
const unincorporatedPartnershipMember = memberId ? unincorporatedPartnershipMembers.find((tm) => tm.legalEntityId === memberId) : void 0;
|
|
3273
|
+
return /* @__PURE__ */ jsx(
|
|
3274
|
+
UnincorporatedPartnershipRoleAndTypeDropin,
|
|
3275
|
+
{
|
|
3276
|
+
activeMember: unincorporatedPartnershipMember,
|
|
3277
|
+
onNavigateToMember,
|
|
3278
|
+
navigateBack
|
|
3279
|
+
}
|
|
3280
|
+
);
|
|
3281
|
+
}
|
|
3282
|
+
const alertHeader = "adyen-kyc-alert-header";
|
|
3283
|
+
const styles = {
|
|
3284
|
+
alertHeader
|
|
3285
|
+
};
|
|
3286
|
+
const isPrimaryPartner = (member) => member?.roles?.includes("primaryPartner");
|
|
3287
|
+
const isMemberMissingOwner = (member) => {
|
|
3288
|
+
return !isPrimaryPartner(member) && member.legalEntityType === LegalEntityTypes.ORGANIZATION && !member.ownerId;
|
|
3289
|
+
};
|
|
3290
|
+
const UnincorporatedPartnershipMembersOverview = ({
|
|
3291
|
+
navigateBackToTaskList,
|
|
3292
|
+
navigateToEditMember,
|
|
3293
|
+
navigateToEditMemberOwner
|
|
3294
|
+
}) => {
|
|
3295
|
+
const { t, i18n: i18next } = useTranslation(["unincorpPartnership", "common"]);
|
|
3296
|
+
const { data: rootLe } = useLegalEntity(ROOT_LE);
|
|
3297
|
+
const { data: partnershipLe, refetch: refetchPartnership } = useAssociatedLegalEntity(
|
|
3298
|
+
rootLe,
|
|
3299
|
+
LegalEntityTypes.UNINCORPORATED_PARTNERSHIP
|
|
3300
|
+
);
|
|
3301
|
+
const partnershipMembers = useUnincorporatedPartnershipMembers();
|
|
3302
|
+
const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
|
|
3303
|
+
const { setUnincorporatedPartnershipMembers } = useGlobalStore();
|
|
3304
|
+
addResourceBundles(i18next, i18next.language, [
|
|
3305
|
+
{
|
|
3306
|
+
ns: "unincorpPartnership",
|
|
3307
|
+
importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../language/bg-BG.json": () => import("./bg-BG-er0t4jTs.js"), "../../language/cs-CZ.json": () => import("./cs-CZ-CQNBae2b.js"), "../../language/da-DK.json": () => import("./da-DK-gnPgzwrG.js"), "../../language/de-DE.json": () => import("./de-DE-D3lLuF8z.js"), "../../language/el-GR.json": () => import("./el-GR-XRux2Wpv.js"), "../../language/en-US.json": () => import("./en-US-B96dpVon.js"), "../../language/es-ES.json": () => import("./es-ES-CXDJLKAI.js"), "../../language/et-EE.json": () => import("./et-EE--cL_YqWe.js"), "../../language/fi-FI.json": () => import("./fi-FI-fArobrt5.js"), "../../language/fr-FR.json": () => import("./fr-FR-CiwkAb3E.js"), "../../language/hr-HR.json": () => import("./hr-HR-DtfHQVe0.js"), "../../language/hu-HU.json": () => import("./hu-HU-I4-KFzvz.js"), "../../language/it-IT.json": () => import("./it-IT-DIbH-udG.js"), "../../language/ja-JP.json": () => import("./ja-JP-bz7ekGnF.js"), "../../language/lt-LT.json": () => import("./lt-LT-BLsIcCtE.js"), "../../language/lv-LV.json": () => import("./lv-LV-C7hMdPcY.js"), "../../language/nl-NL.json": () => import("./nl-NL-NlkjOSYi.js"), "../../language/no-NO.json": () => import("./no-NO-Crlsj6HG.js"), "../../language/pl-PL.json": () => import("./pl-PL-DYxD6VJ_.js"), "../../language/pt-BR.json": () => import("./pt-BR-BfxgHKY4.js"), "../../language/pt-PT.json": () => import("./pt-PT-TKg5FLat.js"), "../../language/ro-RO.json": () => import("./ro-RO-3rOfS17N.js"), "../../language/sk-SK.json": () => import("./sk-SK-CjrLvDMx.js"), "../../language/sl-SI.json": () => import("./sl-SI-C-C-KJCX.js"), "../../language/sv-SE.json": () => import("./sv-SE-BHfydid5.js") }), `../../language/${i18next.language}.json`, 4)
|
|
3308
|
+
}
|
|
3309
|
+
]);
|
|
3310
|
+
useEffect(
|
|
3311
|
+
() => setUnincorporatedPartnershipMembers(partnershipMembers),
|
|
3312
|
+
[partnershipMembers, setUnincorporatedPartnershipMembers]
|
|
3313
|
+
);
|
|
3314
|
+
const getTaskStatus2 = useGetTaskStatus();
|
|
3315
|
+
if (!rootLe || !partnershipLe) {
|
|
3316
|
+
return /* @__PURE__ */ jsx(Loader, { size: "large" });
|
|
3317
|
+
}
|
|
3318
|
+
const deleteMember = async (member) => {
|
|
3319
|
+
try {
|
|
3320
|
+
await deleteUnincorporatedPartnershipMember({
|
|
3321
|
+
associatedMember: member,
|
|
3322
|
+
unincorporatedPartnership: partnershipLe,
|
|
3323
|
+
updateLegalEntity
|
|
3324
|
+
});
|
|
3325
|
+
await refetchPartnership();
|
|
3326
|
+
} catch (error) {
|
|
3327
|
+
console.error(error);
|
|
3328
|
+
}
|
|
3329
|
+
};
|
|
3330
|
+
const getActions = (member) => {
|
|
3331
|
+
const baseActions = [
|
|
3332
|
+
{
|
|
3333
|
+
icon: "edit",
|
|
3334
|
+
onSelect: () => navigateToEditMember(member),
|
|
3335
|
+
label: t(($) => $["editTrustMember"], {
|
|
3336
|
+
trustMember: member.name
|
|
3337
|
+
})
|
|
3338
|
+
}
|
|
3339
|
+
];
|
|
3340
|
+
if (member.legalEntityType === LegalEntityTypes.ORGANIZATION && !isPrimaryPartner(member)) {
|
|
3341
|
+
const missingOwner = isMemberMissingOwner(member);
|
|
3342
|
+
baseActions.push({
|
|
3343
|
+
icon: missingOwner ? "plus" : "edit",
|
|
3344
|
+
onSelect: () => navigateToEditMemberOwner(member?.ownerId, member?.legalEntityId),
|
|
3345
|
+
label: t(($) => $[missingOwner ? "addOwnerToTrustMember" : "editOwnerOfTrustMember"], {
|
|
3346
|
+
trustMember: member.name
|
|
3347
|
+
})
|
|
3348
|
+
});
|
|
3349
|
+
}
|
|
3350
|
+
if (!isPrimaryPartner(member)) {
|
|
3351
|
+
baseActions.push({
|
|
3352
|
+
icon: "bin",
|
|
3353
|
+
onSelect: () => deleteMember(member),
|
|
3354
|
+
label: t(($) => $["removeTrustMember"], {
|
|
3355
|
+
trustMember: member.name
|
|
3356
|
+
})
|
|
3357
|
+
});
|
|
3358
|
+
}
|
|
3359
|
+
return baseActions;
|
|
3360
|
+
};
|
|
3361
|
+
const infoContent = (member) => /* @__PURE__ */ jsx(
|
|
3362
|
+
Alert,
|
|
3363
|
+
{
|
|
3364
|
+
className: styles.alertHeader,
|
|
3365
|
+
title: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3366
|
+
t(($) => $["helpUsVerifyCompany"], { ns: "common" }),
|
|
3367
|
+
" ",
|
|
3368
|
+
/* @__PURE__ */ jsx(
|
|
3369
|
+
Button,
|
|
3370
|
+
{
|
|
3371
|
+
onClick: (e) => {
|
|
3372
|
+
e.preventDefault();
|
|
3373
|
+
e.stopPropagation();
|
|
3374
|
+
navigateToEditMemberOwner(member?.ownerId, member?.legalEntityId);
|
|
3375
|
+
},
|
|
3376
|
+
variant: "link",
|
|
3377
|
+
children: t(($) => $["providePersonalDetailsOfOwner"])
|
|
3378
|
+
}
|
|
3379
|
+
)
|
|
3380
|
+
] })
|
|
3381
|
+
}
|
|
3382
|
+
);
|
|
3383
|
+
return /* @__PURE__ */ jsx(
|
|
3384
|
+
DropinLayout,
|
|
3385
|
+
{
|
|
3386
|
+
content: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-u-width-full", children: [
|
|
3387
|
+
/* @__PURE__ */ jsx(
|
|
3388
|
+
Header,
|
|
3389
|
+
{
|
|
3390
|
+
title: t(($) => $["partnershipMembers"]),
|
|
3391
|
+
description: t(($) => $["partnershipMembersDescription"])
|
|
3392
|
+
}
|
|
3393
|
+
),
|
|
3394
|
+
/* @__PURE__ */ jsxs(StackLayout, { children: [
|
|
3395
|
+
partnershipMembers.map((member) => {
|
|
3396
|
+
return /* @__PURE__ */ jsx(
|
|
3397
|
+
EntityAssociation,
|
|
3398
|
+
{
|
|
3399
|
+
types: member.roles,
|
|
3400
|
+
name: member.name,
|
|
3401
|
+
status: getTaskStatus2(
|
|
3402
|
+
member.legalEntityType === LegalEntityTypes.INDIVIDUAL ? TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL : TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY,
|
|
3403
|
+
member.legalEntityId
|
|
3404
|
+
),
|
|
3405
|
+
actions: getActions(member),
|
|
3406
|
+
onNavigateToEntity: () => navigateToEditMember(member),
|
|
3407
|
+
infoContent: isMemberMissingOwner(member) ? infoContent(member) : void 0
|
|
3408
|
+
},
|
|
3409
|
+
member.legalEntityId
|
|
3410
|
+
);
|
|
3411
|
+
}),
|
|
3412
|
+
/* @__PURE__ */ jsx(
|
|
3413
|
+
Button,
|
|
3414
|
+
{
|
|
3415
|
+
variant: "secondary",
|
|
3416
|
+
icon: "plus",
|
|
3417
|
+
onClick: () => navigateToEditMember(void 0),
|
|
3418
|
+
fullWidth: true,
|
|
3419
|
+
children: t(($) => $["addPartner"])
|
|
3420
|
+
}
|
|
3421
|
+
)
|
|
3422
|
+
] }),
|
|
3423
|
+
/* @__PURE__ */ jsx(
|
|
3424
|
+
ActionBar,
|
|
3425
|
+
{
|
|
3426
|
+
onHome: navigateBackToTaskList,
|
|
3427
|
+
homeButtonLabel: t(($) => $["saveAndGoToOverview"], { ns: "common" })
|
|
3428
|
+
}
|
|
3429
|
+
)
|
|
3430
|
+
] })
|
|
3431
|
+
}
|
|
3432
|
+
);
|
|
3433
|
+
};
|
|
3434
|
+
const useShouldShowIntroduction = ({
|
|
3435
|
+
legalEntity
|
|
3436
|
+
}) => {
|
|
3437
|
+
const canSeeIntroduction = useCanSeeIntroduction({ legalEntity });
|
|
3438
|
+
const { hasSeenIntroduction } = useHasSeenIntroduction({ legalEntityId: legalEntity.id });
|
|
3439
|
+
return canSeeIntroduction && !hasSeenIntroduction;
|
|
3440
|
+
};
|
|
3441
|
+
const useNavigation = ({ legalEntity, onNavigate }) => {
|
|
3442
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
3443
|
+
const userEvents = useAnalyticsContext();
|
|
3444
|
+
const showServiceAgreementsFirst = isSettingEnabled(SettingNames.ShowServiceAgreementsFirst);
|
|
3445
|
+
const showBusinessFinancingFirst = isSettingEnabled(SettingNames.ShowBusinessFinancingFirst);
|
|
3446
|
+
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
3447
|
+
const showIntroduction = useShouldShowIntroduction({ legalEntity });
|
|
3448
|
+
const { hasSeenSingpassSelection } = useHasSeenSingpassSelection({
|
|
3449
|
+
legalEntityId: legalEntity.id
|
|
3450
|
+
});
|
|
3451
|
+
const { accountHolder } = useAccountHolder();
|
|
3452
|
+
const { canSeeEntitySelection } = useCanSeeEntitySelection(legalEntity.id);
|
|
3453
|
+
const { isEligibleForSingpass } = useSingpassMyInfoLogin({
|
|
3454
|
+
legalEntity,
|
|
3455
|
+
accountHolder
|
|
3456
|
+
});
|
|
3457
|
+
const shouldShowSingpassSelection = isEligibleForSingpass && !hasSeenSingpassSelection;
|
|
3458
|
+
const [taskHistory, setTaskHistory] = useState(["default"]);
|
|
3459
|
+
const actualTasks = taskHistory.filter((task) => task !== "default");
|
|
3460
|
+
const handleNavigation = useCallback(
|
|
3461
|
+
(task) => {
|
|
3462
|
+
userEvents.updateBaseTrackingPayload({ task });
|
|
3463
|
+
onNavigate?.(task);
|
|
3464
|
+
},
|
|
3465
|
+
[onNavigate]
|
|
3466
|
+
);
|
|
3467
|
+
const navigateTo = useCallback(
|
|
3468
|
+
(task, deletePreviousHistory = false) => {
|
|
3469
|
+
const pushNewTask = () => setTaskHistory((taskHistory2) => deletePreviousHistory ? [task] : [...taskHistory2, task]);
|
|
3470
|
+
if (task === "default") {
|
|
3471
|
+
setTimeout(pushNewTask);
|
|
3472
|
+
} else {
|
|
3473
|
+
pushNewTask();
|
|
3474
|
+
handleNavigation(task);
|
|
3475
|
+
}
|
|
3476
|
+
},
|
|
3477
|
+
[handleNavigation]
|
|
3478
|
+
);
|
|
3479
|
+
const navigateBack = useCallback(
|
|
3480
|
+
(stepCount = 1) => {
|
|
3481
|
+
if (taskHistory.length <= 1) return;
|
|
3482
|
+
const prevTask = taskHistory[taskHistory.length - (stepCount + 1)];
|
|
3483
|
+
if (prevTask === "default") {
|
|
3484
|
+
throw Error("Cannot navigate back to 'default' task");
|
|
3485
|
+
}
|
|
3486
|
+
if (prevTask === TaskTypes.TASKS_OVERVIEW) {
|
|
3487
|
+
setTaskHistory([TaskTypes.TASKS_OVERVIEW]);
|
|
3488
|
+
handleNavigation?.(TaskTypes.TASKS_OVERVIEW);
|
|
3489
|
+
return;
|
|
3490
|
+
}
|
|
3491
|
+
setTaskHistory(taskHistory.slice(0, -1 * stepCount));
|
|
3492
|
+
handleNavigation?.(prevTask);
|
|
3493
|
+
userEvents.updateBaseTrackingPayload({ task: prevTask });
|
|
3494
|
+
},
|
|
3495
|
+
[taskHistory, handleNavigation]
|
|
3496
|
+
);
|
|
3497
|
+
useEffect(() => {
|
|
3498
|
+
if (!window.history.state) window.history.pushState({}, "");
|
|
3499
|
+
const handleBrowserBackButton = () => {
|
|
3500
|
+
if (window.history.state === null) window.history.pushState({}, "");
|
|
3501
|
+
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
3502
|
+
};
|
|
3503
|
+
window.addEventListener("popstate", handleBrowserBackButton);
|
|
3504
|
+
return () => {
|
|
3505
|
+
window.removeEventListener("popstate", handleBrowserBackButton);
|
|
3506
|
+
};
|
|
3507
|
+
}, [navigateTo]);
|
|
3508
|
+
useEffect(() => {
|
|
3509
|
+
const pushedTask = taskHistory[taskHistory.length - 1];
|
|
3510
|
+
if (pushedTask === "default") {
|
|
3511
|
+
const defaultTask = getDefaultTask({
|
|
3512
|
+
legalEntity,
|
|
3513
|
+
canSeeEntitySelection,
|
|
3514
|
+
showIntroduction,
|
|
3515
|
+
canChangeEntityType,
|
|
3516
|
+
shouldShowSingpassSelection,
|
|
3517
|
+
showServiceAgreementsFirst,
|
|
3518
|
+
showBusinessFinancingFirst
|
|
3519
|
+
});
|
|
3520
|
+
setTaskHistory([...taskHistory.slice(0, taskHistory.length - 1), defaultTask]);
|
|
3521
|
+
}
|
|
3522
|
+
}, [
|
|
3523
|
+
legalEntity,
|
|
3524
|
+
accountHolder,
|
|
3525
|
+
showIntroduction,
|
|
3526
|
+
canChangeEntityType,
|
|
3527
|
+
shouldShowSingpassSelection,
|
|
3528
|
+
showServiceAgreementsFirst,
|
|
3529
|
+
taskHistory,
|
|
3530
|
+
showBusinessFinancingFirst
|
|
3531
|
+
]);
|
|
3532
|
+
return {
|
|
3533
|
+
currentTask: actualTasks[actualTasks.length - 1],
|
|
3534
|
+
previousTask: actualTasks[actualTasks.length - 2],
|
|
3535
|
+
navigateBack,
|
|
3536
|
+
navigateTo
|
|
3537
|
+
};
|
|
3538
|
+
};
|
|
3539
|
+
const getDefaultTask = ({
|
|
3540
|
+
legalEntity,
|
|
3541
|
+
canSeeEntitySelection,
|
|
3542
|
+
canChangeEntityType,
|
|
3543
|
+
showIntroduction,
|
|
3544
|
+
shouldShowSingpassSelection,
|
|
3545
|
+
showServiceAgreementsFirst,
|
|
3546
|
+
showBusinessFinancingFirst
|
|
3547
|
+
}) => {
|
|
3548
|
+
const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
|
|
3549
|
+
if (showServiceAgreementsFirst) {
|
|
3550
|
+
return TaskTypes.SERVICE_AGREEMENT;
|
|
3551
|
+
}
|
|
3552
|
+
if (showBusinessFinancingFirst) {
|
|
3553
|
+
return TaskTypes.BUSINESS_FINANCING;
|
|
3554
|
+
}
|
|
3555
|
+
if (canChangeEntityType && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection)
|
|
3556
|
+
return TaskTypes.BUSINESS_TYPE_SELECTION;
|
|
3557
|
+
if (showIntroduction) return TaskTypes.INTRODUCTION;
|
|
3558
|
+
if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
|
|
3559
|
+
return TaskTypes.TASKS_OVERVIEW;
|
|
3560
|
+
};
|
|
3561
|
+
const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
3562
|
+
const hasOwnEntityAssocation = legalEntity.entityAssociations?.some(
|
|
3563
|
+
(ea) => ea.associatorId === legalEntity.id
|
|
3564
|
+
);
|
|
3565
|
+
const hasOrganizationType = legalEntity.organization?.type;
|
|
3566
|
+
return hasOwnEntityAssocation || !!hasOrganizationType;
|
|
3567
|
+
};
|
|
3568
|
+
const Introduction = lazy(
|
|
3569
|
+
async () => (await import("./Introduction-DH4Tivyl.js")).Introduction
|
|
3570
|
+
);
|
|
3571
|
+
const BusinessTypeSelectionPage = lazy(
|
|
3572
|
+
async () => (await import("./BusinessTypeSelectionPage-CQvrZNZZ.js")).BusinessTypeSelectionPage
|
|
3573
|
+
);
|
|
3574
|
+
const SingpassSelection = lazy(
|
|
3575
|
+
async () => (await import("./SingpassSelection-DTOk81Y1.js")).SingpassSelection
|
|
3576
|
+
);
|
|
3577
|
+
const AccountSetupRejected = lazy(
|
|
3578
|
+
async () => (await import("./AccountSetupRejected-B0RVdTUw.js")).AccountSetupRejected
|
|
3579
|
+
);
|
|
3580
|
+
const DecisionMakers = lazy(
|
|
3581
|
+
async () => (await import("./DecisionMakers-DUjAziKs.js")).DecisionMakers
|
|
3582
|
+
);
|
|
3583
|
+
const CustomerSupport = lazy(
|
|
3584
|
+
async () => (await import("./CustomerSupport-DyfNEq22.js")).CustomerSupport
|
|
3585
|
+
);
|
|
3586
|
+
const Review = lazy(async () => (await import("./Review-4b9BWdsh.js")).Review);
|
|
3587
|
+
const SignPCIComponent = lazy(
|
|
3588
|
+
async () => (await import("./SignPCIComponent-4UrP4tNd.js")).SignPCIComponent
|
|
3589
|
+
);
|
|
3590
|
+
const AcceptTermsOfService = lazy(
|
|
3591
|
+
async () => (await import("./AcceptTermsOfServiceComponent-BW8S5c-F.js")).AcceptTermsOfServiceComponent
|
|
3592
|
+
);
|
|
3593
|
+
const TaxReportingDropin = lazy(
|
|
3594
|
+
async () => (await import("./TaxReportingDropin-2VcdfJvr.js")).TaxReportingDropin
|
|
3595
|
+
);
|
|
3596
|
+
const PayoutDetailsPage = lazy(
|
|
3597
|
+
async () => (await import("./PayoutDetailsDropin-BFUH8RvF.js").then((n) => n.a)).PayoutDetailsPage
|
|
3598
|
+
);
|
|
3599
|
+
const RootBusinessDetailsPage = lazy(
|
|
3600
|
+
async () => (await import("./RootBusinessDetailsPage-DO5202Yd.js")).RootBusinessDetailsPage
|
|
3601
|
+
);
|
|
3602
|
+
const RootBusinessLinesPage = lazy(
|
|
3603
|
+
async () => (await import("./RootBusinessLinesPage-D0tGN2u3.js")).RootBusinessLinesPage
|
|
3604
|
+
);
|
|
3605
|
+
const SoleProprietorshipPage = lazy(
|
|
3606
|
+
async () => (await import("./SoleProprietorshipPage-BL3u4nCi.js")).SoleProprietorshipPage
|
|
3607
|
+
);
|
|
3608
|
+
const TrustMemberCompanyPage = lazy(
|
|
3609
|
+
async () => (await import("./TrustMemberCompanyPage-CwNG1bni.js")).TrustMemberCompanyPage
|
|
3610
|
+
);
|
|
3611
|
+
const UnincorporatedPartnershipMemberCompanyPage = lazy(
|
|
3612
|
+
async () => (await import("./UnincorporatedPartnershipMemberCompanyPage-av-gOgOa.js")).UnincorporatedPartnershipMemberCompanyPage
|
|
3613
|
+
);
|
|
3614
|
+
const BusinessFinancingPage = lazy(
|
|
3615
|
+
async () => (await import("./BusinessFinancingPage-DuRkxp4x.js")).BusinessFinancingPage
|
|
3616
|
+
);
|
|
3617
|
+
const TrustDetailsPage = lazy(
|
|
3618
|
+
async () => (await import("./TrustDetailsPage-COIeKAk2.js")).TrustDetailsPage
|
|
3619
|
+
);
|
|
3620
|
+
const SourceOfFundsPage = lazy(
|
|
3621
|
+
async () => (await import("./SourceOfFundsPage-HgGh-VDQ.js")).SourceOfFundsPage
|
|
3622
|
+
);
|
|
3623
|
+
const RootIndividualDetailsPage = lazy(
|
|
3624
|
+
async () => (await import("./RootIndividualDetailsPage-2c_nvpAv.js")).RootIndividualDetailsPage
|
|
3625
|
+
);
|
|
3626
|
+
const LegalRepresentativeDetailsPage = lazy(
|
|
3627
|
+
async () => (await import("./LegalRepresentativeDetailsPage-Dny2mD-G.js")).LegalRepresentativeDetailsPage
|
|
3628
|
+
);
|
|
3629
|
+
const TrustMemberIndividualPage = lazy(
|
|
3630
|
+
async () => (await import("./TrustMemberIndividualPage-D57poDUv.js")).TrustMemberIndividualPage
|
|
3631
|
+
);
|
|
3632
|
+
const UnincorporatedPartnershipIndividualPage = lazy(
|
|
3633
|
+
async () => (await import("./UnincorporatedPartnershipIndividualPage-oiEGWL8D.js")).UnincorporatedPartnershipIndividualPage
|
|
3634
|
+
);
|
|
3635
|
+
const DecisionMakerDetailsPage = lazy(
|
|
3636
|
+
async () => (await import("./DecisionMakerDetailsPage-D-8hNnWf.js")).DecisionMakerDetailsPage
|
|
3637
|
+
);
|
|
3638
|
+
function isIn(values, x) {
|
|
3639
|
+
return values.includes(x);
|
|
3640
|
+
}
|
|
3641
|
+
const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
3642
|
+
const logger = createLogger();
|
|
3643
|
+
function DropinComposer({
|
|
3644
|
+
legalEntityResponse,
|
|
3645
|
+
onSubmit,
|
|
3646
|
+
onNavigate = noop,
|
|
3647
|
+
openBankingPartnerConfigId
|
|
3648
|
+
}) {
|
|
3649
|
+
const { accountHolder, setAccountHolder } = useAccountHolder();
|
|
3650
|
+
const { setCanSeeEntitySelection } = useCanSeeEntitySelection(legalEntityResponse.id);
|
|
3651
|
+
const userEvents = useAnalyticsContext();
|
|
3652
|
+
const { experiments } = useExperimentsContext();
|
|
3653
|
+
const { setHasSeenSingpassSelection } = useHasSeenSingpassSelection({
|
|
3654
|
+
legalEntityId: legalEntityResponse.id
|
|
3655
|
+
});
|
|
3656
|
+
const { setHasSeenIntroduction } = useHasSeenIntroduction({
|
|
3657
|
+
legalEntityId: legalEntityResponse.id
|
|
3658
|
+
});
|
|
3659
|
+
const { currentTask, previousTask, navigateTo, navigateBack } = useNavigation({
|
|
3660
|
+
legalEntity: legalEntityResponse,
|
|
3661
|
+
onNavigate
|
|
3662
|
+
});
|
|
3663
|
+
const {
|
|
3664
|
+
rootLegalEntity: rootLegalEntitySignal,
|
|
3665
|
+
rootLegalEntityCountry: rootLegalEntityCountrySignal,
|
|
3666
|
+
taskTypes: taskTypesSignal,
|
|
3667
|
+
setRootLegalEntity,
|
|
3668
|
+
setTaskTypes,
|
|
3669
|
+
setAccountHolder: setAccountHolderInGlobalStore
|
|
3670
|
+
} = useGlobalStore();
|
|
3671
|
+
const rootLegalEntity = rootLegalEntitySignal.value;
|
|
3672
|
+
const rootLegalEntityCountry = rootLegalEntityCountrySignal.value;
|
|
3673
|
+
const taskTypes = taskTypesSignal.value;
|
|
3674
|
+
const { data: rawTaskTypes, isLoading: isLoadingConfiguration } = useTaskTypes();
|
|
3675
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
3676
|
+
useEffect(() => {
|
|
3677
|
+
if (!rawTaskTypes) {
|
|
3678
|
+
return;
|
|
3679
|
+
}
|
|
3680
|
+
let filteredTasks = rawTaskTypes;
|
|
3681
|
+
if (!isSettingEnabled(SettingNames.AllowBusinessLines)) {
|
|
3682
|
+
filteredTasks = rawTaskTypes?.filter((task) => task !== TaskTypes.ACQUIRING_BUSINESS_LINE);
|
|
3683
|
+
}
|
|
3684
|
+
setTaskTypes(filteredTasks);
|
|
3685
|
+
}, [rawTaskTypes, setTaskTypes]);
|
|
3686
|
+
const { data: legalEntityData, refetch: refetchLegalEntity } = useLegalEntity(
|
|
3687
|
+
legalEntityResponse.id,
|
|
3688
|
+
{
|
|
3689
|
+
refetchInterval: (query) => {
|
|
3690
|
+
const legalEntityData2 = query.state.data;
|
|
3691
|
+
if (legalEntityData2) {
|
|
3692
|
+
return !currentTask || !isIn(PAGES_WITH_POLLING, currentTask) || hasAllCapabilitiesResolved(legalEntityData2) || hasRejectedCapabilities(legalEntityData2) ? false : 3e3;
|
|
3693
|
+
}
|
|
3694
|
+
return 3e3;
|
|
3695
|
+
}
|
|
3696
|
+
}
|
|
3697
|
+
);
|
|
3698
|
+
useEffect(() => {
|
|
3699
|
+
if (legalEntityData && !objectsDeepEqual(legalEntityData, rootLegalEntity)) {
|
|
3700
|
+
setRootLegalEntity(legalEntityData);
|
|
3701
|
+
}
|
|
3702
|
+
}, [legalEntityData]);
|
|
3703
|
+
const [currentTransferInstrumentId, setCurrentTransferInstrumentId] = useState();
|
|
3704
|
+
const {
|
|
3705
|
+
isEligibleForSingpass,
|
|
3706
|
+
state: singpassLoginState,
|
|
3707
|
+
handleInitiateSingpassMyInfoLogin,
|
|
3708
|
+
handleSingpassMyInfoLoginSuccess,
|
|
3709
|
+
handleSingpassMyInfoLoginFailure,
|
|
3710
|
+
handleSingpassMyInfoLoginReset,
|
|
3711
|
+
trustedFields: singpassTrustedFields,
|
|
3712
|
+
trustedEntityAssociations
|
|
3713
|
+
} = useSingpassMyInfoLogin({
|
|
3714
|
+
legalEntity: rootLegalEntity,
|
|
3715
|
+
accountHolder
|
|
3716
|
+
});
|
|
3717
|
+
const singpassTabRef = useRef(null);
|
|
3718
|
+
const { data: trust, refetch: refetchTrust } = useAssociatedLegalEntity(
|
|
3719
|
+
rootLegalEntity,
|
|
3720
|
+
LegalEntityTypes.TRUST
|
|
3721
|
+
);
|
|
3722
|
+
const { data: unincorporatedPartnership, refetch: refetchUnincorporatedPartnership } = useAssociatedLegalEntity(rootLegalEntity, LegalEntityTypes.UNINCORPORATED_PARTNERSHIP);
|
|
3723
|
+
const { data: soleProp } = useAssociatedLegalEntity(
|
|
3724
|
+
rootLegalEntity,
|
|
3725
|
+
LegalEntityTypes.SOLE_PROPRIETORSHIP
|
|
3726
|
+
);
|
|
3727
|
+
const [parentId, setParentId] = useState();
|
|
3728
|
+
const [currentDecisionMakerId, setCurrentDecisionMakerId] = useState();
|
|
3729
|
+
const { data: currentDecisionMaker } = useLegalEntity(currentDecisionMakerId ?? skipToken);
|
|
3730
|
+
const associatedLegalRepresentative = useAssociatedLegalRepresentative(rootLegalEntity);
|
|
3731
|
+
const [targetLegalEntityType, setTargetLegalEntityType] = useState();
|
|
3732
|
+
const {
|
|
3733
|
+
trustMember,
|
|
3734
|
+
trustMemberId,
|
|
3735
|
+
onNavigateToTrust,
|
|
3736
|
+
onNavigateToTrustMemberRoleAndType,
|
|
3737
|
+
onNavigateToTrustMemberEditDetails
|
|
3738
|
+
} = useTrustMemberNavigation({
|
|
3739
|
+
trust,
|
|
3740
|
+
navigateTo
|
|
3741
|
+
});
|
|
3742
|
+
const {
|
|
3743
|
+
onNavigateToMember,
|
|
3744
|
+
activeMember: unincorporatedPartnershipMember,
|
|
3745
|
+
setActiveMember
|
|
3746
|
+
} = useUnincorporatedPartnershipNavigation({
|
|
3747
|
+
navigateTo
|
|
3748
|
+
});
|
|
3749
|
+
const handleSingpassSelectionNextClick = async (method) => {
|
|
3750
|
+
if (method === "singpass") {
|
|
3751
|
+
try {
|
|
3752
|
+
const authUrl = await handleInitiateSingpassMyInfoLogin();
|
|
3753
|
+
if (!authUrl) {
|
|
3754
|
+
throw new Error("OpenId authentication url not");
|
|
3755
|
+
}
|
|
3756
|
+
setHasSeenSingpassSelection(true);
|
|
3757
|
+
singpassTabRef.current = window.open(authUrl, "_blank");
|
|
3758
|
+
singpassTabRef.current?.focus();
|
|
3759
|
+
} catch (e) {
|
|
3760
|
+
logger.error(e);
|
|
3761
|
+
if (typeof e === "string") handleSingpassMyInfoLoginFailure(e);
|
|
3762
|
+
}
|
|
3763
|
+
}
|
|
3764
|
+
if (method === "manual") {
|
|
3765
|
+
setHasSeenSingpassSelection(true);
|
|
3766
|
+
}
|
|
3767
|
+
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
3768
|
+
};
|
|
3769
|
+
const onNavigateToDecisionMakerIndividual = async (task, id, parentId2) => {
|
|
3770
|
+
setParentId(parentId2 ?? rootLegalEntity.id);
|
|
3771
|
+
setCurrentDecisionMakerId(id);
|
|
3772
|
+
navigateTo(task);
|
|
3773
|
+
};
|
|
3774
|
+
const onNavigateToPayinOrPayout = async (id, task = TaskTypes.PAYOUT) => {
|
|
3775
|
+
if (id) {
|
|
3776
|
+
try {
|
|
3777
|
+
setCurrentTransferInstrumentId(id);
|
|
3778
|
+
} finally {
|
|
3779
|
+
navigateTo(task);
|
|
3780
|
+
}
|
|
3781
|
+
} else {
|
|
3782
|
+
setCurrentTransferInstrumentId(void 0);
|
|
3783
|
+
navigateTo(task);
|
|
3784
|
+
}
|
|
3785
|
+
};
|
|
3786
|
+
const onNavigateToTask = async (task, id) => {
|
|
3787
|
+
switch (task) {
|
|
3788
|
+
case TaskTypes.PAYOUT:
|
|
3789
|
+
await onNavigateToPayinOrPayout(id, TaskTypes.PAYOUT);
|
|
3790
|
+
break;
|
|
3791
|
+
case TaskTypes.PAYIN:
|
|
3792
|
+
await onNavigateToPayinOrPayout(id, TaskTypes.PAYIN);
|
|
3793
|
+
break;
|
|
3794
|
+
case TaskTypes.TRUST: {
|
|
3795
|
+
await onNavigateToTrust();
|
|
3796
|
+
break;
|
|
3797
|
+
}
|
|
3798
|
+
case TaskTypes.TRUST_MEMBER_OVERVIEW: {
|
|
3799
|
+
await onNavigateToTrust(TaskTypes.TRUST_MEMBER_OVERVIEW);
|
|
3800
|
+
break;
|
|
3801
|
+
}
|
|
3802
|
+
case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
|
|
3803
|
+
await navigateTo(TaskTypes.SOLE_PROPRIETOR_COMPANY);
|
|
3804
|
+
break;
|
|
3805
|
+
}
|
|
3806
|
+
default:
|
|
3807
|
+
navigateTo(task);
|
|
3808
|
+
}
|
|
3809
|
+
};
|
|
3810
|
+
const handleOnSubmit = async (data, backStepCount) => {
|
|
3811
|
+
onSubmit?.(data);
|
|
3812
|
+
await refetchLegalEntity();
|
|
3813
|
+
navigateBack(backStepCount);
|
|
3814
|
+
};
|
|
3815
|
+
useEffect(() => {
|
|
3816
|
+
userEvents.addJourneyEvent("Landed on page", { actionType: "start" });
|
|
3817
|
+
}, []);
|
|
3818
|
+
useEffect(() => {
|
|
3819
|
+
userEvents.updateBaseTrackingPayload({ task: currentTask });
|
|
3820
|
+
}, [currentTask]);
|
|
3821
|
+
useEffect(() => {
|
|
3822
|
+
if (hasRejectedCapabilities(rootLegalEntity)) {
|
|
3823
|
+
navigateTo(TaskTypes.CAPABILITY_REJECTED, true);
|
|
3824
|
+
}
|
|
3825
|
+
}, [rootLegalEntity]);
|
|
3826
|
+
useEffect(() => {
|
|
3827
|
+
const newAccountHolder = getDefaultAccountHolderType(rootLegalEntity, false, accountHolder);
|
|
3828
|
+
if (newAccountHolder !== accountHolder) setAccountHolder(newAccountHolder);
|
|
3829
|
+
}, [accountHolder, rootLegalEntity]);
|
|
3830
|
+
useEffect(() => setAccountHolderInGlobalStore(accountHolder), [accountHolder]);
|
|
3831
|
+
const { rootLegalEntityId } = useApiContext();
|
|
3832
|
+
rootLegalEntityId.value = rootLegalEntity.id;
|
|
3833
|
+
useEffect(() => {
|
|
3834
|
+
const enabledExperimentNames = Object.entries(experiments).filter(([key, value]) => key.includes("_") && value).map(([key]) => key);
|
|
3835
|
+
if (!enabledExperimentNames.length) return;
|
|
3836
|
+
enabledExperimentNames.forEach((experiment) => {
|
|
3837
|
+
const [name, variant] = experiment.split("_");
|
|
3838
|
+
userEvents.trackExperiment({ name, variant });
|
|
3839
|
+
});
|
|
3840
|
+
}, [experiments]);
|
|
3841
|
+
const singpassBanner = isEligibleForSingpass ? /* @__PURE__ */ jsx(
|
|
3842
|
+
SingpassBanner,
|
|
3843
|
+
{
|
|
3844
|
+
...singpassLoginState,
|
|
3845
|
+
onAlertClose: () => {
|
|
3846
|
+
handleSingpassMyInfoLoginReset();
|
|
3847
|
+
},
|
|
3848
|
+
onClick: async () => {
|
|
3849
|
+
try {
|
|
3850
|
+
const authUrl = await handleInitiateSingpassMyInfoLogin();
|
|
3851
|
+
singpassTabRef.current = window.open(authUrl);
|
|
3852
|
+
singpassTabRef.current?.focus();
|
|
3853
|
+
} catch (e) {
|
|
3854
|
+
logger.error(e);
|
|
3855
|
+
if (typeof e === "string") handleSingpassMyInfoLoginFailure(e);
|
|
3856
|
+
}
|
|
3857
|
+
},
|
|
3858
|
+
onMessage: async ({ data: { isSuccessful } }) => {
|
|
3859
|
+
if (isSuccessful) {
|
|
3860
|
+
handleSingpassMyInfoLoginSuccess();
|
|
3861
|
+
await refetchLegalEntity();
|
|
3862
|
+
singpassTabRef.current?.close();
|
|
3863
|
+
} else {
|
|
3864
|
+
handleSingpassMyInfoLoginFailure(
|
|
3865
|
+
legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL ? "weCouldntConnectToMyinfo" : "weCouldntConnectToMyinfoBusiness"
|
|
3866
|
+
);
|
|
3867
|
+
}
|
|
3868
|
+
},
|
|
3869
|
+
legalEntityType: legalEntityResponse?.type
|
|
3870
|
+
}
|
|
3871
|
+
) : void 0;
|
|
3872
|
+
if (isLoadingConfiguration) {
|
|
3873
|
+
return /* @__PURE__ */ jsx(Skeleton, {});
|
|
3874
|
+
}
|
|
3875
|
+
switch (currentTask) {
|
|
3876
|
+
case TaskTypes.BUSINESS_TYPE_SELECTION:
|
|
3877
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-display-flex adyen-kyc-u-justify-content-center", children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3878
|
+
BusinessTypeSelectionPage,
|
|
3879
|
+
{
|
|
3880
|
+
onComplete: async (newAccountHolder) => {
|
|
3881
|
+
setAccountHolder(newAccountHolder);
|
|
3882
|
+
setCanSeeEntitySelection(false);
|
|
3883
|
+
await refetchLegalEntity();
|
|
3884
|
+
navigateTo("default");
|
|
3885
|
+
},
|
|
3886
|
+
onBack: previousTask ? navigateBack : void 0
|
|
3887
|
+
}
|
|
3888
|
+
) }) });
|
|
3889
|
+
case TaskTypes.SINGPASS_SELECTION:
|
|
3890
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3891
|
+
SingpassSelection,
|
|
3892
|
+
{
|
|
3893
|
+
handleNextClick: handleSingpassSelectionNextClick,
|
|
3894
|
+
accountHolder,
|
|
3895
|
+
legalEntityType: rootLegalEntity.type
|
|
3896
|
+
}
|
|
3897
|
+
) });
|
|
3898
|
+
case TaskTypes.INTRODUCTION:
|
|
3899
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3900
|
+
Introduction,
|
|
3901
|
+
{
|
|
3902
|
+
onExitIntroduction: () => {
|
|
3903
|
+
setHasSeenIntroduction(true);
|
|
3904
|
+
navigateTo("default");
|
|
3905
|
+
},
|
|
3906
|
+
tasks: taskTypes
|
|
3907
|
+
}
|
|
3908
|
+
) });
|
|
3909
|
+
case TaskTypes.CAPABILITY_REJECTED:
|
|
3910
|
+
return /* @__PURE__ */ jsxs(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: [
|
|
3911
|
+
/* @__PURE__ */ jsx(AccountSetupRejected, {}),
|
|
3912
|
+
";"
|
|
3913
|
+
] });
|
|
3914
|
+
case TaskTypes.TASKS_OVERVIEW:
|
|
3915
|
+
return /* @__PURE__ */ jsx(TaskList, { onNavigateToTask, singpassComponent: singpassBanner });
|
|
3916
|
+
case TaskTypes.DECISION_MAKER_OVERVIEW:
|
|
3917
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3918
|
+
DecisionMakers,
|
|
3919
|
+
{
|
|
3920
|
+
onNavigateToIndividual: (legalEntityId) => onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER, legalEntityId),
|
|
3921
|
+
navigateBackToTaskList: navigateBack,
|
|
3922
|
+
trustedEntityAssociations
|
|
3923
|
+
}
|
|
3924
|
+
) });
|
|
3925
|
+
case TaskTypes.INDIVIDUAL:
|
|
3926
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3927
|
+
RootIndividualDetailsPage,
|
|
3928
|
+
{
|
|
3929
|
+
onSubmit: async (data) => {
|
|
3930
|
+
onSubmit?.(data);
|
|
3931
|
+
await refetchLegalEntity();
|
|
3932
|
+
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
3933
|
+
setTargetLegalEntityType(void 0);
|
|
3934
|
+
},
|
|
3935
|
+
handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW),
|
|
3936
|
+
isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.INDIVIDUAL,
|
|
3937
|
+
trustedFields: singpassTrustedFields,
|
|
3938
|
+
trustedFieldsProvider: isEligibleForSingpass ? TrustedFieldsProviders.SINGPASS : void 0
|
|
3939
|
+
}
|
|
3940
|
+
) });
|
|
3941
|
+
case TaskTypes.CUSTOMER_SUPPORT:
|
|
3942
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3943
|
+
CustomerSupport,
|
|
3944
|
+
{
|
|
3945
|
+
country: rootLegalEntityCountry,
|
|
3946
|
+
onSubmit: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
|
|
3947
|
+
}
|
|
3948
|
+
) });
|
|
3949
|
+
case TaskTypes.REVIEW:
|
|
3950
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(Review, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
|
|
3951
|
+
case TaskTypes.DECISION_MAKER:
|
|
3952
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3953
|
+
DecisionMakerDetailsPage,
|
|
3954
|
+
{
|
|
3955
|
+
decisionMakerId: currentDecisionMaker?.id,
|
|
3956
|
+
parentCompanyId: parentId,
|
|
3957
|
+
onSubmit: async (data, scenario) => {
|
|
3958
|
+
onSubmit?.(data);
|
|
3959
|
+
await refetchLegalEntity();
|
|
3960
|
+
if (isBafinSignatoryFlow({
|
|
3961
|
+
taskType: TaskTypes.DECISION_MAKER,
|
|
3962
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3963
|
+
// @ts-ignore basicDetails will be there when it's IndividualOnfidoSchema
|
|
3964
|
+
data,
|
|
3965
|
+
scenarios: scenario
|
|
3966
|
+
})) {
|
|
3967
|
+
showIdNowModal.value = true;
|
|
3968
|
+
} else {
|
|
3969
|
+
navigateBack();
|
|
3970
|
+
}
|
|
3971
|
+
},
|
|
3972
|
+
handleHomeClick: navigateBack,
|
|
3973
|
+
trustedFields: singpassTrustedFields,
|
|
3974
|
+
trustedFieldsProvider: isEligibleForSingpass ? TrustedFieldsProviders.SINGPASS : void 0,
|
|
3975
|
+
trustedRoles: trustedEntityAssociations.find((ea) => ea.reference === currentDecisionMaker?.id)?.types || []
|
|
3976
|
+
}
|
|
3977
|
+
) });
|
|
3978
|
+
case TaskTypes.TRUST_MEMBER_COMPANY_OWNER:
|
|
3979
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3980
|
+
DecisionMakerDetailsPage,
|
|
3981
|
+
{
|
|
3982
|
+
taskType: TaskTypes.TRUST_MEMBER_COMPANY_OWNER,
|
|
3983
|
+
parentCompanyId: parentId,
|
|
3984
|
+
decisionMakerId: currentDecisionMakerId,
|
|
3985
|
+
onSubmit: async (data) => {
|
|
3986
|
+
await handleOnSubmit(data);
|
|
3987
|
+
await refetchTrust();
|
|
3988
|
+
},
|
|
3989
|
+
handleHomeClick: navigateBack
|
|
3990
|
+
}
|
|
3991
|
+
) });
|
|
3992
|
+
case TaskTypes.TRUST_MEMBER_INDIVIDUAL:
|
|
3993
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
3994
|
+
TrustMemberIndividualPage,
|
|
3995
|
+
{
|
|
3996
|
+
memberId: trustMemberId,
|
|
3997
|
+
trustId: trust.id,
|
|
3998
|
+
newMember: trustMember?.legalEntityId === isNewEntity ? trustMember : void 0,
|
|
3999
|
+
onSubmit: async (data) => {
|
|
4000
|
+
await handleOnSubmit(data, 2);
|
|
4001
|
+
await refetchTrust();
|
|
4002
|
+
},
|
|
4003
|
+
handleBackClick: navigateBack,
|
|
4004
|
+
handleHomeClick: () => navigateTo(TaskTypes.TRUST_MEMBER_OVERVIEW)
|
|
4005
|
+
}
|
|
4006
|
+
) });
|
|
4007
|
+
case TaskTypes.TRUST_MEMBER_COMPANY:
|
|
4008
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4009
|
+
TrustMemberCompanyPage,
|
|
4010
|
+
{
|
|
4011
|
+
trustId: trust.id,
|
|
4012
|
+
trustMemberCompanyId: trustMemberId,
|
|
4013
|
+
newMember: trustMember?.legalEntityId === isNewEntity ? trustMember : void 0,
|
|
4014
|
+
onSubmit: async (data) => {
|
|
4015
|
+
await handleOnSubmit(data, 2);
|
|
4016
|
+
await refetchTrust();
|
|
4017
|
+
},
|
|
4018
|
+
handleHomeClick: navigateBack
|
|
4019
|
+
}
|
|
4020
|
+
) });
|
|
4021
|
+
case TaskTypes.BUSINESS_DETAILS:
|
|
4022
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4023
|
+
RootBusinessDetailsPage,
|
|
4024
|
+
{
|
|
4025
|
+
onSubmit: async (data) => {
|
|
4026
|
+
onSubmit?.(data);
|
|
4027
|
+
await refetchLegalEntity();
|
|
4028
|
+
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
4029
|
+
setTargetLegalEntityType(void 0);
|
|
4030
|
+
},
|
|
4031
|
+
handleHomeClick: navigateBack,
|
|
4032
|
+
isTargetLegalEntityType: targetLegalEntityType === LegalEntityTypes.ORGANIZATION
|
|
4033
|
+
}
|
|
4034
|
+
) });
|
|
4035
|
+
case TaskTypes.PAYOUT:
|
|
4036
|
+
case TaskTypes.PAYIN:
|
|
4037
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4038
|
+
PayoutDetailsPage,
|
|
4039
|
+
{
|
|
4040
|
+
taskType: currentTask,
|
|
4041
|
+
transferInstrumentId: currentTransferInstrumentId,
|
|
4042
|
+
setTransferInstrumentId: setCurrentTransferInstrumentId,
|
|
4043
|
+
handleHomeClick: navigateBack,
|
|
4044
|
+
openBankingPartnerConfigId,
|
|
4045
|
+
onSubmit: handleOnSubmit
|
|
4046
|
+
}
|
|
4047
|
+
) });
|
|
4048
|
+
case TaskTypes.TRUST:
|
|
4049
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4050
|
+
TrustDetailsPage,
|
|
4051
|
+
{
|
|
4052
|
+
taskType: TaskTypes.TRUST,
|
|
4053
|
+
trustId: trust?.id,
|
|
4054
|
+
onSubmit: (data) => handleOnSubmit(data, 1),
|
|
4055
|
+
handleHomeClick: navigateBack
|
|
4056
|
+
}
|
|
4057
|
+
) });
|
|
4058
|
+
case TaskTypes.TRUST_MEMBER_OVERVIEW:
|
|
4059
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4060
|
+
TrustMembersOverview,
|
|
4061
|
+
{
|
|
4062
|
+
navigateBackToTaskList: navigateBack,
|
|
4063
|
+
navigateToEditTrustMember: onNavigateToTrustMemberRoleAndType,
|
|
4064
|
+
navigateToEditTrustMemberOwner: (trustMemberOwnerId, trustMemberId2) => onNavigateToDecisionMakerIndividual(
|
|
4065
|
+
TaskTypes.TRUST_MEMBER_COMPANY_OWNER,
|
|
4066
|
+
trustMemberOwnerId,
|
|
4067
|
+
trustMemberId2
|
|
4068
|
+
)
|
|
4069
|
+
}
|
|
4070
|
+
) });
|
|
4071
|
+
case TaskTypes.TRUST_MEMBER_ROLE_AND_TYPE:
|
|
4072
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4073
|
+
TrustMemberRoleAndTypePage,
|
|
4074
|
+
{
|
|
4075
|
+
trustId: trust.id,
|
|
4076
|
+
memberId: trustMemberId,
|
|
4077
|
+
navigateToFullDropinFor: onNavigateToTrustMemberEditDetails,
|
|
4078
|
+
navigateBack: async () => {
|
|
4079
|
+
await refetchTrust();
|
|
4080
|
+
navigateBack();
|
|
4081
|
+
}
|
|
4082
|
+
}
|
|
4083
|
+
) });
|
|
4084
|
+
case TaskTypes.UNINCORPORATED_PARTNERSHIP:
|
|
4085
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4086
|
+
TrustDetailsPage,
|
|
4087
|
+
{
|
|
4088
|
+
taskType: TaskTypes.UNINCORPORATED_PARTNERSHIP,
|
|
4089
|
+
trustId: unincorporatedPartnership?.id,
|
|
4090
|
+
onSubmit: (data) => handleOnSubmit(data, 1),
|
|
4091
|
+
handleHomeClick: navigateBack
|
|
4092
|
+
}
|
|
4093
|
+
) });
|
|
4094
|
+
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW:
|
|
4095
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4096
|
+
UnincorporatedPartnershipMembersOverview,
|
|
4097
|
+
{
|
|
4098
|
+
navigateBackToTaskList: navigateBack,
|
|
4099
|
+
navigateToEditMember: (member) => onNavigateToMember({
|
|
4100
|
+
selectedMember: member,
|
|
4101
|
+
selectedEntityType: member?.legalEntityType,
|
|
4102
|
+
selectedRoles: member?.roles,
|
|
4103
|
+
roleAndType: true
|
|
4104
|
+
}),
|
|
4105
|
+
navigateToEditMemberOwner: (memberOwnerId, memberId) => {
|
|
4106
|
+
setActiveMember({ legalEntityId: memberId });
|
|
4107
|
+
onNavigateToDecisionMakerIndividual(
|
|
4108
|
+
TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER,
|
|
4109
|
+
memberOwnerId,
|
|
4110
|
+
memberId
|
|
4111
|
+
);
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
) });
|
|
4115
|
+
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY:
|
|
4116
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4117
|
+
UnincorporatedPartnershipMemberCompanyPage,
|
|
4118
|
+
{
|
|
4119
|
+
partnershipId: unincorporatedPartnership.id,
|
|
4120
|
+
partnershipMemberCompanyId: unincorporatedPartnershipMember?.legalEntityId,
|
|
4121
|
+
newMember: (
|
|
4122
|
+
// empty string for legalEntityId means it's a new member
|
|
4123
|
+
unincorporatedPartnershipMember?.legalEntityId === "" ? unincorporatedPartnershipMember : void 0
|
|
4124
|
+
),
|
|
4125
|
+
onSubmit: (data) => handleOnSubmit(data, 2),
|
|
4126
|
+
handleHomeClick: navigateBack
|
|
4127
|
+
}
|
|
4128
|
+
) });
|
|
4129
|
+
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER:
|
|
4130
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4131
|
+
DecisionMakerDetailsPage,
|
|
4132
|
+
{
|
|
4133
|
+
taskType: TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER,
|
|
4134
|
+
parentCompanyId: unincorporatedPartnershipMember?.legalEntityId,
|
|
4135
|
+
decisionMakerId: currentDecisionMakerId,
|
|
4136
|
+
onSubmit: async (data) => {
|
|
4137
|
+
await handleOnSubmit(data);
|
|
4138
|
+
await refetchUnincorporatedPartnership();
|
|
4139
|
+
},
|
|
4140
|
+
handleHomeClick: navigateBack
|
|
4141
|
+
}
|
|
4142
|
+
) });
|
|
4143
|
+
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL:
|
|
4144
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4145
|
+
UnincorporatedPartnershipIndividualPage,
|
|
4146
|
+
{
|
|
4147
|
+
memberId: unincorporatedPartnershipMember?.legalEntityId,
|
|
4148
|
+
partnershipId: unincorporatedPartnership.id,
|
|
4149
|
+
member: unincorporatedPartnershipMember,
|
|
4150
|
+
onSubmit: (data) => {
|
|
4151
|
+
handleOnSubmit(data, 2);
|
|
4152
|
+
refetchUnincorporatedPartnership();
|
|
4153
|
+
},
|
|
4154
|
+
handleBackClick: navigateBack,
|
|
4155
|
+
handleHomeClick: () => navigateTo(TaskTypes.TRUST_MEMBER_OVERVIEW)
|
|
4156
|
+
}
|
|
4157
|
+
) });
|
|
4158
|
+
case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_ROLE_AND_TYPE:
|
|
4159
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4160
|
+
UnincorporatedPartnershipMemberRoleAndTypePage,
|
|
4161
|
+
{
|
|
4162
|
+
memberId: unincorporatedPartnershipMember?.legalEntityId,
|
|
4163
|
+
onNavigateToMember,
|
|
4164
|
+
navigateBack: async () => {
|
|
4165
|
+
await refetchUnincorporatedPartnership();
|
|
4166
|
+
navigateBack();
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
) });
|
|
4170
|
+
case TaskTypes.PCI_DSS:
|
|
4171
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(SignPCIComponent, { onClose: navigateBack }) });
|
|
4172
|
+
case TaskTypes.SOLE_PROPRIETOR_COMPANY:
|
|
4173
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4174
|
+
SoleProprietorshipPage,
|
|
4175
|
+
{
|
|
4176
|
+
solePropId: soleProp?.id,
|
|
4177
|
+
onSubmit: (data) => handleOnSubmit(data, 1),
|
|
4178
|
+
handleHomeClick: navigateBack
|
|
4179
|
+
}
|
|
4180
|
+
) });
|
|
4181
|
+
case TaskTypes.SERVICE_AGREEMENT:
|
|
4182
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4183
|
+
AcceptTermsOfService,
|
|
4184
|
+
{
|
|
4185
|
+
legalEntityId: rootLegalEntity.id,
|
|
4186
|
+
onClose: navigateBack,
|
|
4187
|
+
asEmbedded: false,
|
|
4188
|
+
handleAddSigner: () => {
|
|
4189
|
+
onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER);
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
) });
|
|
4193
|
+
case TaskTypes.LEGAL_REPRESENTATIVE_DETAILS:
|
|
4194
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4195
|
+
LegalRepresentativeDetailsPage,
|
|
4196
|
+
{
|
|
4197
|
+
legalRepresentativeId: associatedLegalRepresentative?.id,
|
|
4198
|
+
onSubmit: handleOnSubmit,
|
|
4199
|
+
handleHomeClick: navigateBack
|
|
4200
|
+
}
|
|
4201
|
+
) });
|
|
4202
|
+
case TaskTypes.SOURCE_OF_FUNDS:
|
|
4203
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4204
|
+
SourceOfFundsPage,
|
|
4205
|
+
{
|
|
4206
|
+
onSubmit: handleOnSubmit,
|
|
4207
|
+
handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
|
|
4208
|
+
}
|
|
4209
|
+
) });
|
|
4210
|
+
case TaskTypes.BUSINESS_FINANCING:
|
|
4211
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
|
|
4212
|
+
BusinessFinancingPage,
|
|
4213
|
+
{
|
|
4214
|
+
onSubmit: async (data) => {
|
|
4215
|
+
onSubmit?.(data);
|
|
4216
|
+
await refetchLegalEntity();
|
|
4217
|
+
navigateTo(TaskTypes.TASKS_OVERVIEW);
|
|
4218
|
+
},
|
|
4219
|
+
handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW)
|
|
4220
|
+
}
|
|
4221
|
+
) });
|
|
4222
|
+
case TaskTypes.TAX_REPORTING:
|
|
4223
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(TaxReportingDropin, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
|
|
4224
|
+
case TaskTypes.ACQUIRING_BUSINESS_LINE:
|
|
4225
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(RootBusinessLinesPage, { handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW) }) });
|
|
4226
|
+
default:
|
|
4227
|
+
return null;
|
|
4228
|
+
}
|
|
4229
|
+
}
|
|
4230
|
+
function OnboardingDropinComponent({
|
|
4231
|
+
legalEntityId,
|
|
4232
|
+
openBankingPartnerConfigId
|
|
4233
|
+
}) {
|
|
4234
|
+
if (!legalEntityId) {
|
|
4235
|
+
throw new Error("Must provide at-least legalEntityId");
|
|
4236
|
+
}
|
|
4237
|
+
const { i18n } = useTranslation();
|
|
4238
|
+
addResourceBundles(i18n, i18n.language, [
|
|
4239
|
+
{
|
|
4240
|
+
ns: "common",
|
|
4241
|
+
importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../../language/locales/bg-BG.json": () => import("./bg-BG-BPsOhDfg.js"), "../../../language/locales/cs-CZ.json": () => import("./cs-CZ-CHzJM-ii.js"), "../../../language/locales/da-DK.json": () => import("./da-DK-XNMYSp7w.js"), "../../../language/locales/de-DE.json": () => import("./de-DE-BI7AAdOv.js"), "../../../language/locales/el-GR.json": () => import("./el-GR-DoCIcce-.js"), "../../../language/locales/en-US.instructions.json": () => import("./en-US.instructions-Ddr7AO05.js"), "../../../language/locales/en-US.json": () => import("./StoreProvider-DadhkEyO.js").then((n) => n.bK), "../../../language/locales/es-ES.json": () => import("./es-ES-CnNU6AJv.js"), "../../../language/locales/et-EE.json": () => import("./et-EE-BR4OXRfV.js"), "../../../language/locales/fi-FI.json": () => import("./fi-FI-u5GxMZsq.js"), "../../../language/locales/fr-FR.json": () => import("./fr-FR-CMjrAkKl.js"), "../../../language/locales/hr-HR.json": () => import("./hr-HR-Bhsop3CT.js"), "../../../language/locales/hu-HU.json": () => import("./hu-HU-D2j1ISVk.js"), "../../../language/locales/it-IT.json": () => import("./it-IT-C7Sg1k4p.js"), "../../../language/locales/ja-JP.json": () => import("./ja-JP-GSbqID7o.js"), "../../../language/locales/lt-LT.json": () => import("./lt-LT-DSiutpRl.js"), "../../../language/locales/lv-LV.json": () => import("./lv-LV-C62XiDE5.js"), "../../../language/locales/nl-NL.json": () => import("./nl-NL-BOJ6zuBr.js"), "../../../language/locales/no-NO.json": () => import("./no-NO-CuwTDFSf.js"), "../../../language/locales/pl-PL.json": () => import("./pl-PL-1-MrLPXu.js"), "../../../language/locales/pt-BR.json": () => import("./pt-BR-Br_cHzGx.js"), "../../../language/locales/pt-PT.json": () => import("./pt-PT-cjbtYBUX.js"), "../../../language/locales/ro-RO.json": () => import("./ro-RO-CGhIjlpU.js"), "../../../language/locales/sk-SK.json": () => import("./sk-SK-Do6CKNU4.js"), "../../../language/locales/sl-SI.json": () => import("./sl-SI-cY-L2ma-.js"), "../../../language/locales/sv-SE.json": () => import("./sv-SE-BtwPrLEA.js") }), `../../../language/locales/${i18n.language}.json`, 6)
|
|
4242
|
+
},
|
|
4243
|
+
{ ns: "ui", importFn: () => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../ui/language/bg-BG.json": () => import("./bg-BG-Cs_1PU3v.js"), "../../ui/language/cs-CZ.json": () => import("./cs-CZ-B2WAqmaW.js"), "../../ui/language/da-DK.json": () => import("./da-DK-D-eeokQn.js"), "../../ui/language/de-DE.json": () => import("./de-DE-Dcs3W1fT.js"), "../../ui/language/el-GR.json": () => import("./el-GR-DBum-QDu.js"), "../../ui/language/en-US.json": () => import("./en-US-DdeSoN_2.js"), "../../ui/language/es-ES.json": () => import("./es-ES-C7XjLOHi.js"), "../../ui/language/et-EE.json": () => import("./et-EE-BUG05EDz.js"), "../../ui/language/fi-FI.json": () => import("./fi-FI-CEzjKgiz.js"), "../../ui/language/fr-FR.json": () => import("./fr-FR-DNJiLv9b.js"), "../../ui/language/hr-HR.json": () => import("./hr-HR-WMnlxMEY.js"), "../../ui/language/hu-HU.json": () => import("./hu-HU-B2nrl0pw.js"), "../../ui/language/it-IT.json": () => import("./it-IT-BRmX2jEi.js"), "../../ui/language/ja-JP.json": () => import("./ja-JP-gRRH8Eph.js"), "../../ui/language/lt-LT.json": () => import("./lt-LT-BJQDUanx.js"), "../../ui/language/lv-LV.json": () => import("./lv-LV-h3nTokkM.js"), "../../ui/language/nl-NL.json": () => import("./nl-NL-YzDSCWLL.js"), "../../ui/language/no-NO.json": () => import("./no-NO-Big2B13b.js"), "../../ui/language/pl-PL.json": () => import("./pl-PL-CL483jMb.js"), "../../ui/language/pt-BR.json": () => import("./pt-BR-DJOzf0y2.js"), "../../ui/language/pt-PT.json": () => import("./pt-PT-B3qoJ3Fr.js"), "../../ui/language/ro-RO.json": () => import("./ro-RO-Ct_BJvsc.js"), "../../ui/language/sk-SK.json": () => import("./sk-SK-FGK1FMMO.js"), "../../ui/language/sl-SI.json": () => import("./sl-SI-Cz28AFTz.js"), "../../ui/language/sv-SE.json": () => import("./sv-SE-DLl7OGxl.js") }), `../../ui/language/${i18n.language}.json`, 5) }
|
|
4244
|
+
]);
|
|
4245
|
+
const { data: legalEntityData } = useLegalEntity(ROOT_LE);
|
|
4246
|
+
return !legalEntityData ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsx(
|
|
4247
|
+
DropinComposer,
|
|
4248
|
+
{
|
|
4249
|
+
legalEntityResponse: legalEntityData,
|
|
4250
|
+
openBankingPartnerConfigId
|
|
4251
|
+
}
|
|
4252
|
+
);
|
|
4253
|
+
}
|
|
4254
|
+
export {
|
|
4255
|
+
DropinLayout as D,
|
|
4256
|
+
EntityGuidanceStatus as E,
|
|
4257
|
+
LEGAL_COMPANY_NAME_FIELD as L,
|
|
4258
|
+
OnboardingDropinComponent as O,
|
|
4259
|
+
usePciStatus as a,
|
|
4260
|
+
useCanSeeIntroduction as b,
|
|
4261
|
+
useLegalEntityType as c,
|
|
4262
|
+
allowIndividualWithoutSoleProp as d,
|
|
4263
|
+
useDataMissingRemediations as e,
|
|
4264
|
+
EntityAssociation as f,
|
|
4265
|
+
defaultFieldMetadataV4 as g,
|
|
4266
|
+
defaultFieldMetadata as h,
|
|
4267
|
+
iconStatus as i,
|
|
4268
|
+
defaultFieldConfigV4 as j,
|
|
4269
|
+
defaultFieldConfig as k,
|
|
4270
|
+
useBusinessLines as l,
|
|
4271
|
+
useTrustMembers as m,
|
|
4272
|
+
normalizedTaskStatusStore as n,
|
|
4273
|
+
useSalesChannelsSettings as u
|
|
4274
|
+
};
|