@adyen/kyc-components 4.24.1 → 4.25.0-beta.0
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/{AcceptTermsOfServiceWorkflow-CyMefc3t.js → AcceptTermsOfServiceWorkflow-DVUes-ba.js} +2 -2
- package/dist/{AccountSetupRejected-D63dyojj.js → AccountSetupRejected-B19onnyG.js} +1 -1
- package/dist/{AdaptiveWorkflow-DC4QviLh.js → AdaptiveWorkflow-q5TVr4ET.js} +1 -1
- package/dist/{AdaptiveWorkflowComponent-CsNPizq0.js → AdaptiveWorkflowComponent-CBxlKnJq.js} +54 -54
- package/dist/{AddressFields-BeeqIqdc.js → AddressFields-DR4xhVNv.js} +9 -9
- package/dist/{Alert-Cc7p0N5h.js → Alert-Bv9M3wLb.js} +1 -1
- package/dist/{BusinessFinancingDropin-DYJS13vd.js → BusinessFinancingDropin-B71xoa3g.js} +95 -57
- package/dist/{BusinessFinancingPage-DbTrQ1kt.js → BusinessFinancingPage-DlttycNJ.js} +27 -27
- package/dist/{BusinessRegistrationNumberField-DKka8aVU.js → BusinessRegistrationNumberField-CpRV1Keg.js} +4 -4
- package/dist/{BusinessRegistrationNumberFieldGroup-Df6_sDA0.js → BusinessRegistrationNumberFieldGroup-BBOUoIDC.js} +4 -4
- package/dist/{BusinessTypeSelectionPage-C0xUipfe.js → BusinessTypeSelectionPage-DiZhzyXz.js} +7 -7
- package/dist/{Button-DPJ1k02w.js → Button-DpPFIUJx.js} +34 -29
- package/dist/{ComponentGroup-Cw_2w0Rf.js → ComponentGroup-BcVd3jTE.js} +1 -1
- package/dist/{Confirm-DoN9R9Z3.js → Confirm-D8WH4e1L.js} +2 -2
- package/dist/{ConstitutionalDocument-Bbo7P_gi.js → ConstitutionalDocument-BBXjyAH3.js} +14 -14
- package/dist/{ContactDetails-CUjFd94x.js → ContactDetails-e8rkZO7f.js} +6 -6
- package/dist/{ContextGuidance-BQPwRscq.js → ContextGuidance-DPPaigJE.js} +1 -1
- package/dist/{CountryField-DT6-Jr_b.js → CountryField-C7eHHmYk.js} +4 -4
- package/dist/{Currency-C-sSDMn7.js → Currency-BEr0RDjy.js} +83 -6
- package/dist/{CustomerSupport-C2DrnwDs.js → CustomerSupport-DVMEfZdZ.js} +6 -6
- package/dist/{DataConflictsModal-CCaMgguu.js → DataConflictsModal-BqfTUq4v.js} +6 -6
- package/dist/{DebugModal-QeIdCXu5.js → DebugModal-CGPSu2md.js} +16 -16
- package/dist/{DecisionMakerDetails-Dhi6hsrv.js → DecisionMakerDetails-mi5oGeCi.js} +8 -8
- package/dist/{DecisionMakerDetailsPage-DLgKrPA3.js → DecisionMakerDetailsPage-BUvvs6i9.js} +28 -28
- package/dist/{DecisionMakers-B6Qd9fuT.js → DecisionMakers-B2dpzHQ-.js} +32 -32
- package/dist/{Dropzone-BhMYy4nr.js → Dropzone-DAKOThpd.js} +4 -4
- package/dist/{EndStateLayout-zZPm8S5M.js → EndStateLayout-BOdEeTDy.js} +9 -9
- package/dist/{EntityAssociation-C2_Xuvf5.js → EntityAssociation-ty8DqPkJ.js} +5 -5
- package/dist/{ErrorPanel-D4JNFkvi.js → ErrorPanel-D1ygAX21.js} +2 -2
- package/dist/{Field-DwDJQVSS.js → Field-CBvXkDKh.js} +1 -1
- package/dist/{GlobalEntryModal-iZSUeMQf.js → GlobalEntryModal-DLC7METR.js} +783 -86
- package/dist/{GlobalEntryPage-w4KJOeYb.js → GlobalEntryPage-C2vMcR6i.js} +28 -28
- package/dist/{IdentityNumber-3V6ZqvHB.js → IdentityNumber-DhO403_T.js} +6 -6
- package/dist/{IdentityNumberFieldGroup-CAjlgTWn.js → IdentityNumberFieldGroup-CqAj0moi.js} +2 -2
- package/dist/{IdentityScreeningWorkflow-Bx89cmUF.js → IdentityScreeningWorkflow-Dm2p1_2e.js} +7 -7
- package/dist/{IndividualDropin-BgOmBeoT.js → IndividualDropin-CKnMrjDj.js} +161 -54
- package/dist/{IndustryCodeFieldGroup-BDtoeaUz.js → IndustryCodeFieldGroup-DEYxiu_j.js} +4 -4
- package/dist/{InputDate-ANdv1rKt.js → InputDate-B0RNGCq2.js} +2 -3
- package/dist/{InputText-CFDEmEtp.js → InputText-CwPK55J0.js} +1 -1
- package/dist/{Introduction-D8hMB7Wb.js → Introduction-CTVUoae1.js} +3 -3
- package/dist/{InvitedDecisionMakerComponent-DZZe5Ruk.js → InvitedDecisionMakerComponent-XVUjKp4X.js} +55 -55
- package/dist/{JpAddressFields-BIh4120-.js → JpAddressFields-DWDTt4lQ.js} +5 -5
- package/dist/{LegalCompanyNameField-Cosyjk52.js → LegalCompanyNameField-C3zITaw1.js} +3 -3
- package/dist/{LegalName-CtqIpsfy.js → LegalName-DsYl9ReT.js} +3 -3
- package/dist/{LegalRepresentativeDetailsPage-Mpm8AjdQ.js → LegalRepresentativeDetailsPage-CYHPpiXJ.js} +28 -28
- package/dist/{maskHelpers-C0wnCoJl.js → MaskedInput-W1FzWAVl.js} +68 -68
- package/dist/{MaybeModal-C4ySaA8A.js → MaybeModal-DJ-s5rk2.js} +2 -2
- package/dist/{Modal-CHES6970.js → Modal-DeXa4MBg.js} +1 -1
- package/dist/{Name-CdCsijr5.js → Name-C1GAvkWn.js} +4 -4
- package/dist/{NewSummary-D55f70wB.js → NewSummary-C9CV9wJk.js} +4 -4
- package/dist/{NodeRenderer-smgxe7Ni.js → NodeRenderer-CnaWNStD.js} +15 -15
- package/dist/{PatriotActDisclosure-DA6nqTmC.js → PatriotActDisclosure-CnVpPsAg.js} +8 -8
- package/dist/{PayoutDetailsDropin-CPK9u_TO.js → PayoutDetailsDropin-BPms6ZOq.js} +32 -32
- package/dist/{PayoutDetailsPage-LH-4BMk7.js → PayoutDetailsPage-BTBHMzw7.js} +3 -3
- package/dist/{RadioGroup-Bf3DlQnZ.js → RadioGroup-CY33MT83.js} +2 -2
- package/dist/{RadioWithLabel-DQIOEYpF.js → RadioWithLabel-BmUFWDxq.js} +1 -1
- package/dist/{Review-9sjGKoQu.js → Review-CGI0RQO6.js} +2 -2
- package/dist/{RootBusinessDetailsPage-DRN6p6wB.js → RootBusinessDetailsPage-BswHBSIN.js} +1 -1
- package/dist/{RootBusinessLinesPage-uxn9f5K8.js → RootBusinessLinesPage-BQxhfHmx.js} +18 -18
- package/dist/{RootIndividualDetailsPage-BDoKkhcN.js → RootIndividualDetailsPage-CFxtnnY4.js} +28 -28
- package/dist/{Select-phAxjMBQ.js → Select-prMx73V9.js} +35 -36
- package/dist/{SignPCIComponent-BNlTxxJz.js → SignPCIComponent-B1kmyOe5.js} +34 -34
- package/dist/{SingpassSelection-B6_DsZtn.js → SingpassSelection-GiZOYWUI.js} +4 -4
- package/dist/{SoleProprietorshipPage-Dx-pfSwo.js → SoleProprietorshipPage-D84M0iEW.js} +1 -1
- package/dist/{SourceOfFundsPage-ChO-R9o4.js → SourceOfFundsPage-B0SzrryD.js} +22 -22
- package/dist/{SourceOfFundsWorkflow-DuU_n82x.js → SourceOfFundsWorkflow-j-GhdsMt.js} +2 -2
- package/dist/{StateField-BpMwetvd.js → StateField-BYoE_vV0.js} +5 -5
- package/dist/{Step-CctAUYbs.js → Step-BWQnXZ9F.js} +2 -2
- package/dist/{StructuredList-nPasiuLi.js → StructuredList-BHUmeWeh.js} +1 -1
- package/dist/{Summary-DM31WxLr.js → Summary-BxGf1dI5.js} +6 -6
- package/dist/{Task-C12uuPWD.js → Task-B5aOUY4b.js} +23 -14
- package/dist/{TaskGroup-z3ONGLnB.js → TaskGroup-DJXCb94w.js} +1 -1
- package/dist/{TaskListItem-Dx3hKOqG.js → TaskListItem-0-jRJAy9.js} +4 -4
- package/dist/{TaxInformationField-Cc-NDAVo.js → TaxInformationField-DUjQEF-s.js} +4 -4
- package/dist/{TaxInformationFieldGroup-DI2LzuNr.js → TaxInformationFieldGroup-CrTl9kqF.js} +5 -5
- package/dist/{TaxReportingDropin-LNgisxBc.js → TaxReportingDropin-DAdIs3_N.js} +8 -8
- package/dist/{TaxReportingWorkflow-9_9ECX6A.js → TaxReportingWorkflow-P9mRynVj.js} +2 -2
- package/dist/{TermsOfServiceManagement-BGrBal0j.js → TermsOfServiceManagement-BnyyCgPN.js} +34 -34
- package/dist/{TextArea-qGEo3PFG.js → TextArea-C12oXMzX.js} +1 -1
- package/dist/{TileGroup-D1-M64Ul.js → TileGroup-DKwpyGqw.js} +1 -1
- package/dist/{ToastContextProvider-DjYKMflX.js → ToastContextProvider-D2doAiSZ.js} +1 -1
- package/dist/{TrustDetailsPage-cx6yEd6Q.js → TrustDetailsPage-CfjP1Q7K.js} +25 -25
- package/dist/{TrustMemberCompanyPage-DZh9Wn9-.js → TrustMemberCompanyPage-taBHdjIB.js} +3 -3
- package/dist/{TrustMemberIndividualPage--tTWII4G.js → TrustMemberIndividualPage-DdwlWwLJ.js} +28 -28
- package/dist/{TrustMemberRoleAndTypePage-DEzesajA.js → TrustMemberRoleAndTypePage-DAeIxczv.js} +15 -17
- package/dist/{TrustMembersOverview-BpJGWVT5.js → TrustMembersOverview-Bb_rf907.js} +7 -7
- package/dist/{UboTaskItem-DP5LOGom.js → UboTaskItem-RFRcZeJr.js} +23 -13
- package/dist/{UnincorporatedPartnershipIndividualPage-DelW_XAz.js → UnincorporatedPartnershipIndividualPage-lWGiysru.js} +28 -28
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-BdnBsGK9.js → UnincorporatedPartnershipMemberCompanyPage-oo1cNUHe.js} +2 -2
- package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-DpdTiLc-.js → UnincorporatedPartnershipMemberRoleAndTypePage-Cqus5hkL.js} +8 -8
- package/dist/{UnincorporatedPartnershipMembersOverview-BBeans9j.js → UnincorporatedPartnershipMembersOverview-hzs-FlQ0.js} +5 -5
- package/dist/{VerificationErrorAlert-CixajVtq.js → VerificationErrorAlert-B-WILibe.js} +1 -1
- package/dist/{Workflow-BJbKhY38.js → Workflow-CymBPsE3.js} +27 -17
- package/dist/adyen-business-financing.js +33 -31
- package/dist/adyen-individual-configuration.js +57 -55
- package/dist/adyen-individual-status.js +31 -29
- package/dist/adyen-invited-decision-maker.js +7 -5
- package/dist/adyen-onboarding.js +41 -39
- package/dist/adyen-terms-of-service-management.js +6 -4
- package/dist/adyen-terms-of-service-status.js +6 -4
- package/dist/adyen-transfer-instrument-configuration.js +31 -29
- package/dist/adyen-transfer-instrument-management.js +39 -37
- package/dist/adyen-verification-status.js +7 -5
- package/dist/{bg-BG-DqfAUTUt.js → bg-BG-Cdrkwxmc.js} +2 -2
- package/dist/{bg-BG-BPzEcioF.js → bg-BG-ClMsmcda.js} +16 -2
- package/dist/bg-BG-DfbtcqF4.js +7 -0
- package/dist/{businessRegistrationNumberPatterns-A08SLm03.js → businessRegistrationNumberPatterns-Bd2bazr4.js} +2 -2
- package/dist/{constants-C8yo0_RA.js → constants-C7-xFqmm.js} +4 -4
- package/dist/cs-CZ-CajuRLo4.js +7 -0
- package/dist/{cs-CZ-BwO4yrI4.js → cs-CZ-DpiH1UkS.js} +2 -2
- package/dist/{cs-CZ-D4ml1o2f.js → cs-CZ-DyLd-erd.js} +16 -2
- package/dist/{da-DK-CE7jnGea.js → da-DK-B-BJLcqw.js} +2 -2
- package/dist/da-DK-BEwmSejn.js +7 -0
- package/dist/{da-DK-BoINgPRU.js → da-DK-Dhr4p-qj.js} +16 -2
- package/dist/{de-DE-DKkoZQ0X.js → de-DE-BxTGFyOs.js} +2 -2
- package/dist/de-DE-PyK3jl-6.js +7 -0
- package/dist/{de-DE-By2U6vch.js → de-DE-QDT6VVq9.js} +16 -2
- package/dist/{dropinUtils-DTBezwYT.js → dropinUtils-DaA6mmQp.js} +16 -11
- package/dist/{el-GR-Cvms0L4K.js → el-GR-IQwyd9ws.js} +2 -2
- package/dist/el-GR-KPFghikv.js +7 -0
- package/dist/{el-GR-CdTXa4cP.js → el-GR-V2cZ5gjl.js} +16 -2
- package/dist/en-US-BRCWc67V.js +7 -0
- package/dist/{error-BvgoQFEI.js → error-CQMSa-H_.js} +2 -2
- package/dist/{es-ES-BQrdtEfn.js → es-ES-Cg2IadcX.js} +2 -2
- package/dist/{es-ES-DT39ZlR7.js → es-ES-SsReQJzQ.js} +16 -2
- package/dist/es-ES-z4jLCvkJ.js +7 -0
- package/dist/{es-LA-DQGPNeqX.js → es-LA-DTXCg1tj.js} +16 -2
- package/dist/{es-LA-BxtxM3Ty.js → es-LA-DvMpG4FP.js} +2 -2
- package/dist/es-LA-Dx4QymCh.js +7 -0
- package/dist/et-EE-1EhDxtTe.js +7 -0
- package/dist/{et-EE-S_MAXUF8.js → et-EE-Bg3WOS9m.js} +16 -2
- package/dist/{et-EE-V-YOCgoh.js → et-EE-eGeytyQh.js} +2 -2
- package/dist/{fi-FI-ThDP-8F8.js → fi-FI-B1RyWVH2.js} +16 -2
- package/dist/{fi-FI-CVBmM-U1.js → fi-FI-C02wZfgW.js} +2 -2
- package/dist/fi-FI-Dc2RMc_u.js +7 -0
- package/dist/{form-rules-B0RwhsVw.js → form-rules-DhuNdiqF.js} +1 -1
- package/dist/{formUtils-DVDcdZsP.js → formUtils-DAKrWwgL.js} +1 -1
- package/dist/{formatValidationError-q_w9DTrl.js → formatValidationError-z2D5oU1e.js} +1 -1
- package/dist/{fr-FR-D3maHIWS.js → fr-FR-C3Zi7-JE.js} +16 -2
- package/dist/{fr-FR-BIyJL6Jj.js → fr-FR-CE7k9H5_.js} +2 -2
- package/dist/fr-FR-DswL4wQ1.js +7 -0
- package/dist/{getDefaultRegistrationNumberType-CIu4WMln.js → getDefaultRegistrationNumberType-BzOpwR5x.js} +214 -214
- package/dist/{hr-HR-BOYktLQ2.js → hr-HR-B12DcJ3l.js} +2 -2
- package/dist/{hr-HR-BUI-Ac0o.js → hr-HR-CH9yGEPn.js} +16 -2
- package/dist/hr-HR-DI2D_V50.js +7 -0
- package/dist/{hu-HU-BPjEsgnX.js → hu-HU-DpUG3GwC.js} +16 -2
- package/dist/{hu-HU-CO_7jvk9.js → hu-HU-cosbDuos.js} +2 -2
- package/dist/hu-HU-lyRcZjGI.js +7 -0
- package/dist/individualdetails-UIslI4gf.js +34 -0
- package/dist/{it-IT-W1FjGb6L.js → it-IT-BEEsgu4Z.js} +16 -2
- package/dist/it-IT-Bn4CEcmI.js +7 -0
- package/dist/{it-IT-CNr6PIu3.js → it-IT-CiKoOxzk.js} +2 -2
- package/dist/ja-JP-CAX_xwUx.js +7 -0
- package/dist/{ja-JP-avJECfKw.js → ja-JP-CcXk7Gcc.js} +16 -2
- package/dist/{ja-JP-DAClbueM.js → ja-JP-D7PEVMmT.js} +2 -2
- package/dist/lt-LT-BdgYuJW7.js +7 -0
- package/dist/{lt-LT-DoYCfhZU.js → lt-LT-C2oxTakB.js} +2 -2
- package/dist/{lt-LT-wP0YuKeO.js → lt-LT-CGgbFwbx.js} +16 -2
- package/dist/lv-LV-Bz5c0Psg.js +7 -0
- package/dist/{lv-LV-BW0BscAd.js → lv-LV-C_KVkpid.js} +2 -2
- package/dist/{lv-LV-DW_mgZjM.js → lv-LV-Ck_aQ4ML.js} +16 -2
- package/dist/{mapExistingFile-2QXrkhqJ.js → mapExistingFile-BrDc9SLg.js} +1 -1
- package/dist/{mapJpAddressSchemaToAddressLocalizations-D3VO2nhc.js → mapJpAddressSchemaToAddressLocalizations-wwD6Rp3Q.js} +1 -1
- package/dist/{mapLegalEntityToIndividualSchema-Crz7aXZB.js → mapLegalEntityToIndividualSchema-Cs24QJ_x.js} +4 -4
- package/dist/{mapTransferInstrumentToPayoutAccount-BrbrK2wk.js → mapTransferInstrumentToPayoutAccount-BpXU-nP1.js} +1 -1
- package/dist/nl-NL-BE2cQh0x.js +7 -0
- package/dist/{nl-NL-DR5SCDAF.js → nl-NL-CwNBy0Ku.js} +2 -2
- package/dist/{nl-NL-7kT4I7Tj.js → nl-NL-_hbzuQ0h.js} +16 -2
- package/dist/{no-NO-BoEKDB8U.js → no-NO-B_ijkAtf.js} +16 -2
- package/dist/{no-NO-P8SZ1t-h.js → no-NO-VqkeNhzB.js} +2 -2
- package/dist/no-NO-vgzpp44v.js +7 -0
- package/dist/{pl-PL-BY6KUTBO.js → pl-PL-Bp218jDD.js} +2 -2
- package/dist/pl-PL-DgDSRVmp.js +7 -0
- package/dist/{pl-PL-B6DeEX-m.js → pl-PL-u6DrL8IY.js} +16 -2
- package/dist/{processValidationErrors-CjsNfiRK.js → processValidationErrors-DsZ6_OXy.js} +2 -2
- package/dist/pt-BR-BaKp-J8F.js +7 -0
- package/dist/{pt-BR-CsQI9W3I.js → pt-BR-CPS77pGy.js} +16 -2
- package/dist/{pt-BR-CrLCMcSz2.js → pt-BR-CPbFPNwq2.js} +2 -2
- package/dist/{pt-PT-DDYnXawl.js → pt-PT-Bz39smeX.js} +2 -2
- package/dist/{pt-PT-i_EH0CM6.js → pt-PT-DIKqQR6V.js} +16 -2
- package/dist/pt-PT-Df48oeP5.js +7 -0
- package/dist/{resolveEnvironment-CAymXEQ9.js → resolveEnvironment-g21Gu4Y_.js} +38 -39
- package/dist/ro-RO-CTMsv_EY.js +7 -0
- package/dist/{ro-RO-B7CJDsKz.js → ro-RO-Cg1nG9ns.js} +16 -2
- package/dist/{ro-RO-BA5GhaCE.js → ro-RO-jNItoBZk.js} +2 -2
- package/dist/{roleMetadata-Dm1FVuPT.js → roleMetadata-CQeuOFRE.js} +1 -1
- package/dist/{sk-SK-NU95U8E2.js → sk-SK-CRfiVN3e.js} +16 -2
- package/dist/{sk-SK-BeNF_m_j.js → sk-SK-CsSqXqf_.js} +2 -2
- package/dist/sk-SK-oqO5I3Aw.js +7 -0
- package/dist/sl-SI-CQhJFnpj.js +7 -0
- package/dist/{sl-SI-B6Kv1DgA.js → sl-SI-Dpr3StsS.js} +16 -2
- package/dist/{sl-SI-Bxu4m_5e.js → sl-SI-PRqWis0E.js} +2 -2
- package/dist/style.css +965 -704
- package/dist/styles-DYaAeu4q.js +965 -704
- package/dist/{sv-SE-DKTrk_eI.js → sv-SE-CH4wMrUZ.js} +16 -2
- package/dist/sv-SE-CmevESLi.js +7 -0
- package/dist/{sv-SE-B-CXDaXM.js → sv-SE-Dv-rMOdB.js} +2 -2
- package/dist/types/adaptiveWorkflow/components/Layout/Workflow/WorkflowEndState/WorkflowEndState.d.ts +1 -2
- package/dist/types/adaptiveWorkflow/context/WorkflowContext/WorkflowContextProvider.d.ts +2 -0
- package/dist/types/api/createLegalEntity/createLegalEntity.types.d.ts +3 -0
- package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +14 -11
- package/dist/types/api/legalEntity/legalEntity.types.d.ts +10 -30
- package/dist/types/api/legalEntity/useLegalEntity.d.ts +80 -66
- package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +15 -15
- package/dist/types/components/BankAccount/forms/BankDocument/validate.d.ts +0 -3
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +1 -1
- package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +2 -1
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +524 -7805
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBusinessInformation.d.ts +1 -0
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +1 -0
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +22 -5
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +1 -0
- package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +2 -1
- package/dist/types/components/GlobalEntry/companySearchStore.d.ts +22 -0
- package/dist/types/components/GlobalEntry/forms/BusinessSelection/BusinessInformationCard/BusinessInformationCard.d.ts +20 -0
- package/dist/types/components/GlobalEntry/forms/BusinessSelection/BusinessSelection.d.ts +3 -0
- package/dist/types/components/GlobalEntry/forms/BusinessSelection/types.d.ts +8 -0
- package/dist/types/components/GlobalEntry/hooks/useCompanySearchNextClickOverrides.d.ts +26 -0
- package/dist/types/components/GlobalEntry/modals/LegalArrangementModal.d.ts +10 -0
- package/dist/types/components/GlobalEntry/modals/RegistrationNumberMismatchModal.d.ts +16 -0
- package/dist/types/components/GlobalEntry/modals/TinMismatchModal.d.ts +6 -0
- package/dist/types/components/GlobalEntry/rules.d.ts +3 -2
- package/dist/types/components/GlobalEntry/tasks/GlobalEntryModal.d.ts +2 -0
- package/dist/types/components/GlobalEntry/tasks/types.d.ts +2 -0
- package/dist/types/components/GlobalEntry/utils/applyVerifiedCompanyData.d.ts +19 -0
- package/dist/types/components/GlobalEntry/utils/buildRequiredForms.d.ts +1 -0
- package/dist/types/components/GlobalEntry/validate.d.ts +2 -0
- package/dist/types/components/Individual/forms/IdNowVerificationModal/isIdNowModalOpen.d.ts +12 -10
- package/dist/types/components/Individual/tasks/IndividualDropin/IndividualGettingStarted/IndividualGettingStarted.d.ts +5 -0
- package/dist/types/components/Individual/tasks/IndividualDropin/IndividualGettingStarted/IndividualGettingStartedModalContent.d.ts +1 -0
- package/dist/types/components/Shared/fields/Name/validate.d.ts +1 -2
- package/dist/types/components/Shared/forms/Address/validate.formats.d.ts +1 -2
- package/dist/types/components/Trust/mapping/mapTrustToLegalEntity.d.ts +2 -1
- package/dist/types/components/UnincorporatedPartnership/mapping/mapUnincorporatedPartnershipToLegalEntity.d.ts +2 -1
- package/dist/types/context/SettingsContext/types.d.ts +0 -2
- package/dist/types/core/EmbedShell/EmbedShell.d.ts +3 -1
- package/dist/types/embeds/baseEmbedProps.d.ts +3 -0
- package/dist/types/embeds/business-financing/adyen-business-financing.d.ts +1 -1
- package/dist/types/embeds/individual-configuration/adyen-individual-configuration.d.ts +1 -1
- package/dist/types/embeds/invited-decision-maker/adyen-invited-decision-maker.d.ts +1 -1
- package/dist/types/embeds/onboarding/adyen-onboarding.d.ts +1 -1
- package/dist/types/embeds/onboarding-workflow/adyen-onboarding-workflow.d.ts +1 -1
- package/dist/types/embeds/terms-of-service-management/adyen-terms-of-service-management.d.ts +1 -1
- package/dist/types/embeds/transfer-instrument-configuration/adyen-transfer-instrument-configuration.d.ts +1 -1
- package/dist/types/embeds/verification-status/adyen-verification-status.d.ts +1 -1
- package/dist/types/utils/decodeJwt.d.ts +0 -5
- package/dist/types/utils/genUtils.d.ts +0 -9
- package/dist/types/utils/getProps.d.ts +0 -8
- package/dist/{types-Cwq1JAWT.js → types-B28r2lAW.js} +1 -2
- package/dist/{useBusinessDetailsData-sWGe796Y.js → useBusinessDetailsData-FHWhosZj.js} +69 -413
- package/dist/{useCanSeeIntroduction-DQbanJNE.js → useCanSeeIntroduction-X0L-NhMZ.js} +1 -1
- package/dist/{useDataset-CdLBLq98.js → useDataset-BMitsLFp.js} +1 -1
- package/dist/{useForm-CWrbJG44.js → useForm-BFeaSvlP.js} +1 -1
- package/dist/{useMultiForm-BxASst0O.js → useMultiForm-CM3lpilP.js} +1 -1
- package/dist/{useNavigate-n4tia10x.js → useNavigate-BqrdWTzq.js} +32 -32
- package/dist/{useSalesChannels-B06_h460.js → useSalesChannels-huIL6Dhk.js} +1 -1
- package/dist/{useTrustMembers-DtOJPaaV.js → useTrustMembers-CurK1nMF.js} +1 -1
- package/dist/{useUnincorporatedPartnershipMembers-CxDZCOte.js → useUnincorporatedPartnershipMembers-DLGY4jqB.js} +1 -1
- package/dist/{utils-CJcGZvj1.js → utils-D8pwjFm5.js} +1 -1
- package/dist/{utils-Ck_mZapQ.js → utils-Dnwr-Kc0.js} +207 -207
- package/dist/{utils-BWumuCvl.js → utils-lIizXlcC.js} +1 -1
- package/dist/validate-C1ZPhUgV.js +443 -0
- package/dist/{validate-D-l4YRka.js → validate-D8sQbtil.js} +1 -1
- package/dist/{validate-BCNnfwPW.js → validate-k6dACmjX.js} +2 -2
- package/dist/{validate-96E_RrNB.js → validate-t6pT7AaZ.js} +2 -2
- package/dist/{validateExtractionResult-D3d0xx90.js → validateExtractionResult-D41PgEa-.js} +2 -2
- package/dist/{validationError-DV6t8Ubb.js → validationError-CLDQ0Qwt.js} +2 -2
- package/package.json +1 -1
- package/dist/bg-BG-B2xaZ3wB.js +0 -7
- package/dist/cs-CZ-ywYpJk1F.js +0 -7
- package/dist/da-DK-DH5YNYFM.js +0 -7
- package/dist/de-DE-vdy64knk.js +0 -7
- package/dist/el-GR-ChapyKa7.js +0 -7
- package/dist/en-US-B7HQdrn_.js +0 -7
- package/dist/es-ES-DCUvAmKI.js +0 -7
- package/dist/es-LA-ChRHGYJP.js +0 -7
- package/dist/et-EE-HHgM0CfO.js +0 -7
- package/dist/fi-FI-DCYPQ6vS.js +0 -7
- package/dist/fr-FR-BzyefnBh.js +0 -7
- package/dist/hr-HR-6Wj5Tf60.js +0 -7
- package/dist/hu-HU-Bwm4UqZz.js +0 -7
- package/dist/it-IT-DgRuEpeD.js +0 -7
- package/dist/ja-JP--tMJF7eu.js +0 -7
- package/dist/lt-LT-DqtpAjOg.js +0 -7
- package/dist/lv-LV-ZmyUvPst.js +0 -7
- package/dist/nl-NL-CePL3t7P.js +0 -7
- package/dist/no-NO-DGCfRiU8.js +0 -7
- package/dist/pl-PL-D-s-JI6X.js +0 -7
- package/dist/pt-BR-BvNR77Ru.js +0 -7
- package/dist/pt-PT-qAzFgjvF.js +0 -7
- package/dist/ro-RO-B3Fcn95o.js +0 -7
- package/dist/sk-SK-CcoUWnJ4.js +0 -7
- package/dist/sl-SI-DxomO9JQ.js +0 -7
- package/dist/sv-SE-BzPNBHOj.js +0 -7
- package/dist/validate-DKwCZSlM.js +0 -178
|
@@ -1,58 +1,371 @@
|
|
|
1
1
|
try {
|
|
2
2
|
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
3
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
3
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a8a6b4fc-829a-4a1c-8661-6c7fca42e759", e._sentryDebugIdIdentifier = "sentry-dbid-a8a6b4fc-829a-4a1c-8661-6c7fca42e759");
|
|
4
4
|
} catch (e) {}
|
|
5
5
|
import { n as addResourceBundles, r as useTranslation } from "./translation-DbATp_35.js";
|
|
6
6
|
import { t as createLogger } from "./logger-Z8AeTE4x.js";
|
|
7
7
|
import { t as Typography } from "./Typography-CAc_f5Iq.js";
|
|
8
|
-
import { t as
|
|
8
|
+
import { t as Loader } from "./Loader-BVtlpTeo.js";
|
|
9
|
+
import { t as Button } from "./Button-DpPFIUJx.js";
|
|
10
|
+
import { s as useApiContext } from "./http-DsJtugN1.js";
|
|
9
11
|
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-BK-HHa65.js";
|
|
10
12
|
import { t as useAccountHolder } from "./useAccountHolder-BpIX1iBG.js";
|
|
11
13
|
import { s as keysOf } from "./genUtils-nphCwt1A.js";
|
|
14
|
+
import { y as isEmpty } from "./validatorUtils-D2O6AAZn.js";
|
|
12
15
|
import { t as useToggleContext } from "./useToggleContext-B_YexrbT.js";
|
|
13
16
|
import { t as _rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper-sGNwd-kR.js";
|
|
14
17
|
import { t as StackLayout } from "./StackLayout-IUdNMDgW.js";
|
|
15
18
|
import { t as Header } from "./Header-DVLlJ6we.js";
|
|
16
19
|
import { t as useAllowedCountries } from "./useAllowedCountries-qyvo-c6A.js";
|
|
17
20
|
import { t as CountryCodes } from "./country-code-CJk2hdPu.js";
|
|
18
|
-
import { t as Alert } from "./Alert-
|
|
21
|
+
import { t as Alert } from "./Alert-Bv9M3wLb.js";
|
|
19
22
|
import { y as reverseMapping } from "./processCapabilities-CWE5UFt8.js";
|
|
20
23
|
import { t as TaskTypes } from "./taskTypes-3vSkMBDm.js";
|
|
21
24
|
import { f as hasSolePropInLegalEntity, s as getOwnEntityAssociations } from "./entityAssociationUtil-CY0grcyH.js";
|
|
25
|
+
import { t as useAnalyticsContext } from "./useAnalyticsContext-gSnRnYgV.js";
|
|
22
26
|
import { t as useAssociatedLegalEntity } from "./useAssociatedLegalEntity-BdcoiUby.js";
|
|
23
27
|
import { t as Card } from "./Card-BCGLpdw7.js";
|
|
24
28
|
import { t as useToastContext } from "./useToastContext-B6Mqc2HY.js";
|
|
29
|
+
import { t as LoaderWrapper } from "./LoaderWrapper-Dc88hY-P.js";
|
|
30
|
+
import { t as Confirm } from "./Confirm-D8WH4e1L.js";
|
|
31
|
+
import { a as CountryOfGoverningLawField, c as useCompanyTypeExamples, d as companySearchQueryOptions, f as useCompanySearch, i as COUNTRY_OF_GOVERNING_LAW_FIELD, l as useCompanySelection, m as useClearCompanyData, n as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, o as useLegalCompanyNameField, p as trackPerformance, r as isNormalizedStringMatch, t as CountryOfGoverningLawFieldValidation, u as verifyTinQueryOptions } from "./validate-C1ZPhUgV.js";
|
|
25
32
|
import { t as useCreateLegalEntity } from "./useCreateLegalEntity-CYZd_62a.js";
|
|
26
33
|
import { t as useUpdateLegalEntity } from "./useUpdateLegalEntity-B7LRg8m0.js";
|
|
27
|
-
import { a as useFormComposer, i as FormFlow, o as FormContextProvider, r as useFormContext, t as addValidityToForms } from "./dropinUtils-
|
|
28
|
-
import { i as getPropsFromConfigurations, t as createFormRules } from "./form-rules-
|
|
34
|
+
import { a as useFormComposer, i as FormFlow, o as FormContextProvider, r as useFormContext, t as addValidityToForms } from "./dropinUtils-DaA6mmQp.js";
|
|
35
|
+
import { i as getPropsFromConfigurations, t as createFormRules } from "./form-rules-DhuNdiqF.js";
|
|
29
36
|
import { t as List } from "./List-ywoRPg-q.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { t as
|
|
33
|
-
import { t as
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
37
|
+
import { t as StructuredList } from "./StructuredList-BHUmeWeh.js";
|
|
38
|
+
import { n as summaryStep } from "./Summary-BxGf1dI5.js";
|
|
39
|
+
import { t as createFormUtils } from "./formUtils-DAKrWwgL.js";
|
|
40
|
+
import { t as useMultiForm } from "./useMultiForm-CM3lpilP.js";
|
|
41
|
+
import { a as getValidCompanyTypesForRegistrationNumberType, l as registrationNumberDefaultFieldConfig, r as inferCompanyRegistrationNumberType, u as registrationNumberDefaultFieldMetadata } from "./getDefaultRegistrationNumberType-BzOpwR5x.js";
|
|
42
|
+
import { A as mapLocalizationToJapaneseLegalNames, C as COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4, D as isRegistrationNumberAbsentStateV4Scenario, E as isRegistrationExemptionAllowed, O as isUsingCompanySearch, S as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS, T as TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION, _ as COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP, b as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS, c as taxInformationDefaultFieldConfig, f as getValidCompanyTypesForTaxIdNumberType, g as COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION, h as COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION, k as mapJapaneseLegalNamesToLocalization, l as taxInformationDefaultFieldMetadata, s as getTaxInformationPlaceholderText, v as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, w as REGISTRATION_NUMBER_EXEMPTION_RULES, x as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES, y as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER } from "./utils-Dnwr-Kc0.js";
|
|
43
|
+
import { t as Field } from "./Field-CBvXkDKh.js";
|
|
36
44
|
import { t as getFormSlice } from "./getFormSlice-C1ma6Xd4.js";
|
|
37
|
-
import {
|
|
38
|
-
import { C as isRegistrationNumberAbsentStateV4Scenario, E as mapLocalizationToJapaneseLegalNames, S as isRegistrationExemptionAllowed, T as mapJapaneseLegalNamesToLocalization, _ as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES, b as REGISTRATION_NUMBER_EXEMPTION_RULES, c as taxInformationDefaultFieldConfig, d as COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION, f as COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION, g as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS, h as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER, k as getValidCompanyTypesForTaxIdNumberType, l as taxInformationDefaultFieldMetadata, m as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, p as COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP, s as getTaxInformationPlaceholderText, v as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS, w as isUsingCompanySearch, x as TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION, y as COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 } from "./utils-Ck_mZapQ.js";
|
|
39
|
-
import { n as CountryField, t as COUNTRY_FIELD } from "./CountryField-DT6-Jr_b.js";
|
|
40
|
-
import { c as COUNTRIES_WITH_STATES_DATASET } from "./utils-BWumuCvl.js";
|
|
41
|
-
import { n as StateField, r as stateFieldMetadata, t as STATE_FIELD } from "./StateField-BpMwetvd.js";
|
|
45
|
+
import { r as isBusinessSelectionLegalArrangementError } from "./validationError-CLDQ0Qwt.js";
|
|
42
46
|
import { t as ListItem } from "./ListItem-CYTpdOMa.js";
|
|
43
|
-
import {
|
|
44
|
-
import { t as
|
|
47
|
+
import { t as TileGroup } from "./TileGroup-DKwpyGqw.js";
|
|
48
|
+
import { n as CountryField, t as COUNTRY_FIELD } from "./CountryField-C7eHHmYk.js";
|
|
49
|
+
import { c as COUNTRIES_WITH_STATES_DATASET } from "./utils-lIizXlcC.js";
|
|
50
|
+
import { n as StateField, r as stateFieldMetadata, t as STATE_FIELD } from "./StateField-BYoE_vV0.js";
|
|
51
|
+
import { a as defaultFieldMetadata, i as defaultFieldConfigV4, o as defaultFieldMetadataV4, r as defaultFieldConfig, t as LEGAL_COMPANY_NAME_FIELD } from "./LegalCompanyNameField-C3zITaw1.js";
|
|
52
|
+
import { t as InputText } from "./InputText-CwPK55J0.js";
|
|
45
53
|
import { t as resolveFieldMetadata } from "./fieldConfigurations-CZCFghnK.js";
|
|
46
|
-
import { n as TaxInformationField, r as isJapanLocalizationEnabled, t as TAX_INFORMATION_FIELD } from "./TaxInformationField-
|
|
47
|
-
import { n as BusinessRegistrationNumberField, t as BUSINESS_REGISTRATION_NUMBER_FIELD } from "./BusinessRegistrationNumberField-
|
|
54
|
+
import { n as TaxInformationField, r as isJapanLocalizationEnabled, t as TAX_INFORMATION_FIELD } from "./TaxInformationField-DUjQEF-s.js";
|
|
55
|
+
import { n as BusinessRegistrationNumberField, t as BUSINESS_REGISTRATION_NUMBER_FIELD } from "./BusinessRegistrationNumberField-CpRV1Keg.js";
|
|
48
56
|
import { r as SOLE_PROP_COUNTRIES, t as ALLOWED_UNINCORPORATED_PARTNERSHIP_COUNTRIES } from "./legalArrangementUtils-C68JdH6I.js";
|
|
57
|
+
import { t as DataConflictsModal } from "./DataConflictsModal-BqfTUq4v.js";
|
|
49
58
|
import { r as formatObject } from "./utils-DdHbAadK.js";
|
|
50
|
-
import { useCallback, useEffect, useMemo, useState } from "preact/compat";
|
|
59
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/compat";
|
|
60
|
+
import { useContext as useContext$1, useMemo as useMemo$1, useRef as useRef$1 } from "preact/hooks";
|
|
51
61
|
import { Fragment as Fragment$1, jsx, jsxs } from "preact/jsx-runtime";
|
|
52
|
-
import { signal } from "@preact/signals";
|
|
62
|
+
import { createModel, signal, useModel, useSignal } from "@preact/signals";
|
|
63
|
+
import { useQueryClient } from "@tanstack/preact-query";
|
|
64
|
+
import { createContext as createContext$1 } from "preact";
|
|
65
|
+
import { Show } from "@preact/signals/utils";
|
|
53
66
|
//#region src/components/GlobalEntry/globalEntryStore.ts
|
|
54
67
|
var showGlobalEntryModal = signal(false);
|
|
55
68
|
//#endregion
|
|
69
|
+
//#region src/components/GlobalEntry/utils/applyVerifiedCompanyData.ts
|
|
70
|
+
var mergeVerifiedCompanyData = (data, country, verifiedData, options) => {
|
|
71
|
+
const registrationInformation = {
|
|
72
|
+
...data.registrationInformation,
|
|
73
|
+
legalCompanyName: verifiedData.name
|
|
74
|
+
};
|
|
75
|
+
if (!options?.preserveRegistrationNumber && country !== CountryCodes.UnitedStates && verifiedData.registrationNumber) {
|
|
76
|
+
registrationInformation.registrationNumber = verifiedData.registrationNumber;
|
|
77
|
+
registrationInformation.registrationNumberType = inferCompanyRegistrationNumberType(verifiedData.registrationNumber, country, verifiedData.companyType);
|
|
78
|
+
}
|
|
79
|
+
const companyType = options?.companyTypeOverride ?? verifiedData.companyType;
|
|
80
|
+
return {
|
|
81
|
+
...data,
|
|
82
|
+
registrationInformation,
|
|
83
|
+
companyStructure: companyType ? { organizationType: companyType } : data.companyStructure
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Writes a confirmed provider selection into the form and hands back the data it wrote.
|
|
88
|
+
*
|
|
89
|
+
* Form writes only reach the state on the next render, so a caller that confirms a selection and
|
|
90
|
+
* submits in the same tick would otherwise send the answers from before the confirmation. The
|
|
91
|
+
* return value is those answers, saving the caller from deriving them a second time.
|
|
92
|
+
*/
|
|
93
|
+
var applyVerifiedCompanyData = (form, country, verifiedData, options) => {
|
|
94
|
+
if (!verifiedData) return form.data;
|
|
95
|
+
const confirmedData = mergeVerifiedCompanyData(form.data, country, verifiedData, options);
|
|
96
|
+
const confirmedRegistration = confirmedData.registrationInformation;
|
|
97
|
+
const confirmedCompanyType = confirmedData.companyStructure?.organizationType;
|
|
98
|
+
form.handleChangeFor("registrationInformation", "legalCompanyName")(confirmedRegistration?.legalCompanyName);
|
|
99
|
+
if (confirmedRegistration?.registrationNumber) form.handleChangeFor("registrationInformation", "registrationNumber")(confirmedRegistration?.registrationNumber);
|
|
100
|
+
if (confirmedRegistration?.registrationNumberType) form.handleChangeFor("registrationInformation", "registrationNumberType")(confirmedRegistration?.registrationNumberType);
|
|
101
|
+
if (confirmedCompanyType) form.handleChangeFor("companyStructure", "organizationType")(confirmedCompanyType);
|
|
102
|
+
return confirmedData;
|
|
103
|
+
};
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/components/GlobalEntry/companySearchStore.ts
|
|
106
|
+
var CompanySearchStateModel = createModel((userEvents) => {
|
|
107
|
+
const companySearchName = signal();
|
|
108
|
+
const selectedCompany = signal(void 0);
|
|
109
|
+
const verifiedBusiness = signal(void 0);
|
|
110
|
+
const verificationMatched = signal(void 0);
|
|
111
|
+
/** We cannot allow selections in a few situations, this is used to track them */
|
|
112
|
+
const disallowedSelectionReason = signal(void 0);
|
|
113
|
+
/** Only used for MixPanel tracking, not meant to be exposed */
|
|
114
|
+
const selectedCompanyIdx = signal(-1);
|
|
115
|
+
/** Deliberately leaves `companySearchName` alone, so the results page can refetch its list */
|
|
116
|
+
const resetCompanySearchData = () => {
|
|
117
|
+
selectedCompany.value = void 0;
|
|
118
|
+
verifiedBusiness.value = void 0;
|
|
119
|
+
verificationMatched.value = void 0;
|
|
120
|
+
disallowedSelectionReason.value = void 0;
|
|
121
|
+
selectedCompanyIdx.value = -1;
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
companySearchName,
|
|
125
|
+
selectedCompany,
|
|
126
|
+
verifiedBusiness,
|
|
127
|
+
verificationMatched,
|
|
128
|
+
disallowedSelectionReason,
|
|
129
|
+
resetCompanySearchData,
|
|
130
|
+
disallowSelection: (reason) => {
|
|
131
|
+
resetCompanySearchData();
|
|
132
|
+
disallowedSelectionReason.value = reason;
|
|
133
|
+
},
|
|
134
|
+
setVerificationMatched: (value) => {
|
|
135
|
+
resetCompanySearchData();
|
|
136
|
+
verificationMatched.value = value;
|
|
137
|
+
},
|
|
138
|
+
selectCompany: (selected, idx, country) => {
|
|
139
|
+
resetCompanySearchData();
|
|
140
|
+
selectedCompany.value = selected;
|
|
141
|
+
verificationMatched.value = country === CountryCodes.UnitedStates ? selected.tinMatched : selected.registrationNumberMatched;
|
|
142
|
+
/** `-1` indicates auto-selection, not a manual user interaction */
|
|
143
|
+
if (idx > -1) {
|
|
144
|
+
selectedCompanyIdx.value = idx;
|
|
145
|
+
selectBusinessAnalytics(userEvents, idx);
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
confirmCompany: (multiform, country, options) => {
|
|
149
|
+
verifiedBusiness.value = selectedCompany.value;
|
|
150
|
+
const confirmedData = applyVerifiedCompanyData(multiform, country, selectedCompany.value, options);
|
|
151
|
+
if (selectedCompanyIdx.value > -1) confirmBusinessAnalytics(userEvents, selectedCompanyIdx.value);
|
|
152
|
+
return confirmedData;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
function selectBusinessAnalytics(userEvents, idx) {
|
|
157
|
+
userEvents.addPageEvent("Clicked button", {
|
|
158
|
+
actionType: "select",
|
|
159
|
+
label: "selectBusiness",
|
|
160
|
+
additionalData: { companyIdx: idx }
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function confirmBusinessAnalytics(userEvents, idx) {
|
|
164
|
+
userEvents.addPageEvent("Clicked button", {
|
|
165
|
+
actionType: "select",
|
|
166
|
+
label: "confirmBusiness",
|
|
167
|
+
additionalData: { companyIdx: idx }
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/components/GlobalEntry/forms/BusinessSelection/BusinessInformationCard/BusinessInformationCard.tsx
|
|
172
|
+
function BusinessInformation({ fetching, selectedBusiness }) {
|
|
173
|
+
const { t } = useTranslation(["common", "business"]);
|
|
174
|
+
const cardDetails = useMemo$1(() => {
|
|
175
|
+
if (!selectedBusiness) return [];
|
|
176
|
+
const address = selectedBusiness.registeredAddress ?? selectedBusiness.principalPlaceOfBusinessAddress;
|
|
177
|
+
const addressDetails = address && typeof address !== "string" && "fullAddress" in address ? address.fullAddress : void 0;
|
|
178
|
+
return [
|
|
179
|
+
{
|
|
180
|
+
term: t(($) => $["legalForm"], { ns: "common" }),
|
|
181
|
+
details: selectedBusiness.legalForm
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
term: t(($) => $["legalCompanyName"], { ns: "common" }),
|
|
185
|
+
details: selectedBusiness.name
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
term: t(($) => $["address"], { ns: "common" }),
|
|
189
|
+
details: addressDetails
|
|
190
|
+
}
|
|
191
|
+
].filter((item) => !!item.details);
|
|
192
|
+
}, [selectedBusiness, t]);
|
|
193
|
+
if (fetching) return /* @__PURE__ */ jsx(Loader, { size: "large" });
|
|
194
|
+
return /* @__PURE__ */ jsx(StructuredList, { items: cardDetails });
|
|
195
|
+
}
|
|
196
|
+
function BusinessInformationCard({ result, isSelected, currentBusinessSelection, fetching, error, handleSelectBusiness, retryCompanySelection }) {
|
|
197
|
+
const { t } = useTranslation(["common", "business"]);
|
|
198
|
+
const isLegalArrangementError = error && isBusinessSelectionLegalArrangementError(error);
|
|
199
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
200
|
+
selected: isSelected,
|
|
201
|
+
onClick: isSelected ? void 0 : handleSelectBusiness,
|
|
202
|
+
children: /* @__PURE__ */ jsxs(StackLayout, { children: [/* @__PURE__ */ jsx(ListItem, {
|
|
203
|
+
avatar: {
|
|
204
|
+
iconName: "company",
|
|
205
|
+
circle: true
|
|
206
|
+
},
|
|
207
|
+
title: result.name,
|
|
208
|
+
description: result.registrationNumber,
|
|
209
|
+
accessory: fetching && isSelected ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : null
|
|
210
|
+
}), isSelected && !fetching && !isLegalArrangementError && /* @__PURE__ */ jsx(StackLayout, { children: error ? /* @__PURE__ */ jsx(Alert, {
|
|
211
|
+
variant: "info",
|
|
212
|
+
type: "callToAction",
|
|
213
|
+
title: t(($) => $["businessDetailsFailedToLoad"], { ns: "business" }),
|
|
214
|
+
actions: /* @__PURE__ */ jsx(Button, {
|
|
215
|
+
testId: "reloadBusiness",
|
|
216
|
+
onClick: retryCompanySelection,
|
|
217
|
+
variant: "link",
|
|
218
|
+
children: t(($) => $["tryAgain"], { ns: "common" })
|
|
219
|
+
}),
|
|
220
|
+
testId: "failedToLoad"
|
|
221
|
+
}) : /* @__PURE__ */ jsx(Card, {
|
|
222
|
+
variant: "secondary",
|
|
223
|
+
padding: "large",
|
|
224
|
+
children: /* @__PURE__ */ jsx(BusinessInformation, {
|
|
225
|
+
fetching,
|
|
226
|
+
selectedBusiness: currentBusinessSelection
|
|
227
|
+
})
|
|
228
|
+
}) })] })
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function CompanyNotListedCard({ isSelected, handleSelectBusiness, fetching }) {
|
|
232
|
+
const { t } = useTranslation(["business"]);
|
|
233
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
234
|
+
selected: isSelected,
|
|
235
|
+
onClick: isSelected ? void 0 : handleSelectBusiness,
|
|
236
|
+
children: /* @__PURE__ */ jsx(ListItem, {
|
|
237
|
+
title: t(($) => $["myBusinessIsntHere"], { ns: "business" }),
|
|
238
|
+
accessory: fetching && isSelected ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : null
|
|
239
|
+
})
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/components/GlobalEntry/forms/BusinessSelection/BusinessSelection.tsx
|
|
244
|
+
var BUSINESS_SELECTION_FIELDS = ["selectedBusinessId"];
|
|
245
|
+
function BusinessSelection({ id, country }) {
|
|
246
|
+
const { t: businessT } = useTranslation("business");
|
|
247
|
+
const { t: commonT } = useTranslation("common");
|
|
248
|
+
const { baseUrl, rootLegalEntityId } = useApiContext();
|
|
249
|
+
const { form } = useFormContext();
|
|
250
|
+
const queryClient = useQueryClient();
|
|
251
|
+
const userEvents = useAnalyticsContext();
|
|
252
|
+
const logger = createLogger();
|
|
253
|
+
const companySearchStateModel = useContext$1(CompanySearchStateContext);
|
|
254
|
+
const { data, valid, errors, requiredFields, optionalFields, trustedFields, fieldProblems, handleChange: handleChangeFor } = getFormSlice(form, "businessSelection");
|
|
255
|
+
const { data: companySearchResponse, isLoading: searching } = useCompanySearch({
|
|
256
|
+
name: companySearchStateModel.companySearchName.value ?? "",
|
|
257
|
+
country,
|
|
258
|
+
state: form.data.entityInformation?.stateOrProvince,
|
|
259
|
+
registrationNumber: form.data.registrationInformation?.registrationNumber
|
|
260
|
+
});
|
|
261
|
+
const { data: selectData, error: selectError, mutateAsync: selectCompany, reset: resetSelectMutationState } = useCompanySelection();
|
|
262
|
+
const { mutateAsync: clearCompanyData } = useClearCompanyData();
|
|
263
|
+
const currentTin = form.data.registrationInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number;
|
|
264
|
+
const currentRegistrationNumber = form.data.registrationInformation?.registrationNumber;
|
|
265
|
+
/**
|
|
266
|
+
* This ID is internal to this form, controlling selection for UI & data flow purposes. The
|
|
267
|
+
* multiform state is used to determine whether the form is set & valid, ready for the user to progress.
|
|
268
|
+
*/
|
|
269
|
+
const selectedId = useSignal("");
|
|
270
|
+
const isSelectPending = useSignal(false);
|
|
271
|
+
const selectedCompanyIdx = companySearchResponse?.results.findIndex((searchResult) => searchResult.resultId === selectedId.value);
|
|
272
|
+
/**
|
|
273
|
+
* Reset the selection when re-entering the form.
|
|
274
|
+
*
|
|
275
|
+
* The mutation makes this a bit awkward, as we won't have any data when re-entering. Whilst we
|
|
276
|
+
* could perhaps auto-select the result, without caching, we'd have another spinner & wait time for
|
|
277
|
+
* the user. Better to force a manual re-selection to work around our rough implementation details.
|
|
278
|
+
*/
|
|
279
|
+
const isInitializedRef = useRef$1(false);
|
|
280
|
+
if (!isInitializedRef.current) {
|
|
281
|
+
if (data?.selectedBusinessId) {
|
|
282
|
+
handleChangeFor("selectedBusinessId", "blur")("");
|
|
283
|
+
form.setErrors("businessSelection", "selectedBusinessId", null);
|
|
284
|
+
}
|
|
285
|
+
isInitializedRef.current = true;
|
|
286
|
+
}
|
|
287
|
+
const fetchCompanyData = async (result) => {
|
|
288
|
+
isSelectPending.value = true;
|
|
289
|
+
resetSelectMutationState();
|
|
290
|
+
try {
|
|
291
|
+
const companySelectionParams = {
|
|
292
|
+
id: result.resultId,
|
|
293
|
+
name: result.name,
|
|
294
|
+
tin: currentTin ?? "",
|
|
295
|
+
registrationNumber: currentRegistrationNumber ?? "",
|
|
296
|
+
country
|
|
297
|
+
};
|
|
298
|
+
const companySelectionResponse = await selectCompany(companySelectionParams);
|
|
299
|
+
handleChangeFor("selectedBusinessId", "blur")(result.resultId);
|
|
300
|
+
companySearchStateModel.selectCompany(companySelectionResponse, selectedCompanyIdx, country);
|
|
301
|
+
} catch (e) {
|
|
302
|
+
if (isBusinessSelectionLegalArrangementError(e)) {
|
|
303
|
+
companySearchStateModel.disallowSelection("LEGAL_ARRANGEMENT");
|
|
304
|
+
handleChangeFor("selectedBusinessId", "blur")("LEGAL_ARRANGEMENT_ERR");
|
|
305
|
+
} else logger.error(e);
|
|
306
|
+
} finally {
|
|
307
|
+
isSelectPending.value = false;
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
const handleSelectBusiness = (result) => {
|
|
311
|
+
selectedId.value = result.resultId;
|
|
312
|
+
companySearchStateModel.resetCompanySearchData();
|
|
313
|
+
fetchCompanyData(result);
|
|
314
|
+
};
|
|
315
|
+
const handleSelectNotListed = async () => {
|
|
316
|
+
selectedId.value = "notListed";
|
|
317
|
+
companySearchStateModel.resetCompanySearchData();
|
|
318
|
+
await clearCompanyData();
|
|
319
|
+
if (country !== CountryCodes.UnitedStates) return handleChangeFor("selectedBusinessId", "blur")("notListed");
|
|
320
|
+
try {
|
|
321
|
+
isSelectPending.value = true;
|
|
322
|
+
const tinVerificationParams = {
|
|
323
|
+
name: form.data.registrationInformation?.legalCompanyName ?? "",
|
|
324
|
+
tin: currentTin ?? ""
|
|
325
|
+
};
|
|
326
|
+
const { matched } = await queryClient.fetchQuery(verifyTinQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), tinVerificationParams, userEvents));
|
|
327
|
+
companySearchStateModel.setVerificationMatched(!!matched);
|
|
328
|
+
} catch (e) {
|
|
329
|
+
logger.error(e);
|
|
330
|
+
companySearchStateModel.setVerificationMatched(false);
|
|
331
|
+
} finally {
|
|
332
|
+
handleChangeFor("selectedBusinessId", "blur")("notListed");
|
|
333
|
+
isSelectPending.value = false;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
const formUtils = createFormUtils({
|
|
337
|
+
requiredFields,
|
|
338
|
+
optionalFields,
|
|
339
|
+
trustedFields
|
|
340
|
+
}, commonT);
|
|
341
|
+
return /* @__PURE__ */ jsx("form", {
|
|
342
|
+
id,
|
|
343
|
+
children: /* @__PURE__ */ jsxs(LoaderWrapper, {
|
|
344
|
+
loaderSize: "large",
|
|
345
|
+
status: searching ? "loading" : "success",
|
|
346
|
+
children: [/* @__PURE__ */ jsx(Header, { title: businessT(($) => $["businessSelectionFormHeading"]) }), /* @__PURE__ */ jsx(Field, {
|
|
347
|
+
el: "fieldset",
|
|
348
|
+
name: "selectedBusinessId",
|
|
349
|
+
errorMessage: formUtils.getErrorMessage("selectedBusinessId", errors, fieldProblems),
|
|
350
|
+
isValid: valid?.selectedBusinessId,
|
|
351
|
+
children: () => /* @__PURE__ */ jsxs(StackLayout, { children: [companySearchResponse?.results.map((result) => /* @__PURE__ */ jsx(BusinessInformationCard, {
|
|
352
|
+
result,
|
|
353
|
+
isSelected: selectedId.value === result.resultId,
|
|
354
|
+
currentBusinessSelection: selectData,
|
|
355
|
+
fetching: isSelectPending.value,
|
|
356
|
+
error: selectError,
|
|
357
|
+
handleSelectBusiness: () => handleSelectBusiness(result),
|
|
358
|
+
retryCompanySelection: () => fetchCompanyData(result)
|
|
359
|
+
}, result.resultId)), /* @__PURE__ */ jsx(CompanyNotListedCard, {
|
|
360
|
+
isSelected: selectedId.value === "notListed",
|
|
361
|
+
handleSelectBusiness: handleSelectNotListed,
|
|
362
|
+
fetching: isSelectPending.value
|
|
363
|
+
})] })
|
|
364
|
+
})]
|
|
365
|
+
})
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
//#endregion
|
|
56
369
|
//#region src/components/GlobalEntry/companyTypeMetadata.ts
|
|
57
370
|
var companyTypeMetadata = {
|
|
58
371
|
privateCompany: {
|
|
@@ -600,6 +913,11 @@ var globalEntryForms = {
|
|
|
600
913
|
formName: "registrationInformationFormName",
|
|
601
914
|
fields: REGISTRATION_INFORMATION_FIELDS
|
|
602
915
|
},
|
|
916
|
+
businessSelection: {
|
|
917
|
+
formId: "businessSelection",
|
|
918
|
+
formName: "businessSelectionFormName",
|
|
919
|
+
fields: BUSINESS_SELECTION_FIELDS
|
|
920
|
+
},
|
|
603
921
|
companyStructure: {
|
|
604
922
|
formId: "companyStructure",
|
|
605
923
|
formName: "companyStructureFormName",
|
|
@@ -612,6 +930,141 @@ var globalEntryForms = {
|
|
|
612
930
|
}
|
|
613
931
|
};
|
|
614
932
|
//#endregion
|
|
933
|
+
//#region src/components/GlobalEntry/hooks/useCompanySearchNextClickOverrides.ts
|
|
934
|
+
function useCompanySearchNextClickOverrides({ country, multiForm, companySearchStateModel, getRequiredForms, skipBusinessSelection, setLoadingStatus, isTinMatched, tinMismatchModalOpen, legalArrangementModalOpen, registrationNumberMismatchModalOpen, confirmSelection }) {
|
|
935
|
+
const { baseUrl, rootLegalEntityId } = useApiContext();
|
|
936
|
+
const userEvents = useAnalyticsContext();
|
|
937
|
+
const queryClient = useQueryClient();
|
|
938
|
+
const { mutateAsync: selectCompany } = useCompanySelection();
|
|
939
|
+
const { mutateAsync: clearCompanyData } = useClearCompanyData();
|
|
940
|
+
const logger = createLogger();
|
|
941
|
+
const getInferredRegistrationNumberType = () => {
|
|
942
|
+
const selectedCompany = companySearchStateModel.selectedCompany.peek();
|
|
943
|
+
if (country === CountryCodes.UnitedStates || !selectedCompany?.registrationNumber) return;
|
|
944
|
+
return inferCompanyRegistrationNumberType(selectedCompany.registrationNumber, country, selectedCompany.companyType);
|
|
945
|
+
};
|
|
946
|
+
const isVerificationFailed = () => country === CountryCodes.UnitedStates ? !companySearchStateModel.verificationMatched.value : companySearchStateModel.verificationMatched.value === false;
|
|
947
|
+
/**
|
|
948
|
+
* Returns `null` for non-navs, such as showing the TIN mismatch modal for 0 or 1 results
|
|
949
|
+
*/
|
|
950
|
+
const attemptBusinessSearch = async () => {
|
|
951
|
+
const formsWithoutSearchResults = getRequiredForms({ skipBusinessSelection: true });
|
|
952
|
+
const legalCompanyName = multiForm.data.registrationInformation?.legalCompanyName;
|
|
953
|
+
if (!legalCompanyName) return formsWithoutSearchResults;
|
|
954
|
+
setLoadingStatus("loading");
|
|
955
|
+
companySearchStateModel.resetCompanySearchData();
|
|
956
|
+
let searchResponse = {
|
|
957
|
+
results: [],
|
|
958
|
+
provider: "NO_PROVIDER"
|
|
959
|
+
};
|
|
960
|
+
try {
|
|
961
|
+
companySearchStateModel.companySearchName.value = legalCompanyName;
|
|
962
|
+
const companySearchInput = {
|
|
963
|
+
name: legalCompanyName,
|
|
964
|
+
country,
|
|
965
|
+
state: multiForm.data.entityInformation?.stateOrProvince,
|
|
966
|
+
registrationNumber: multiForm.data.registrationInformation?.registrationNumber
|
|
967
|
+
};
|
|
968
|
+
searchResponse = await trackPerformance("companySearch", () => queryClient.fetchQuery(companySearchQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), companySearchInput, userEvents)), userEvents);
|
|
969
|
+
} catch (e) {
|
|
970
|
+
logger.error(e);
|
|
971
|
+
setLoadingStatus("error");
|
|
972
|
+
skipBusinessSelection.value = true;
|
|
973
|
+
return formsWithoutSearchResults;
|
|
974
|
+
}
|
|
975
|
+
const tin = multiForm.data.registrationInformation?.taxInformation?.find((taxId) => taxId.country === country)?.number ?? "";
|
|
976
|
+
const registrationNumber = multiForm.data.registrationInformation?.registrationNumber ?? "";
|
|
977
|
+
skipBusinessSelection.value = searchResponse.results.length === 0;
|
|
978
|
+
const currentForms = getRequiredForms({ skipBusinessSelection: skipBusinessSelection.peek() });
|
|
979
|
+
switch (searchResponse.results.length) {
|
|
980
|
+
case 0:
|
|
981
|
+
if (country === CountryCodes.UnitedStates) try {
|
|
982
|
+
const verifyTinQueryInput = {
|
|
983
|
+
name: legalCompanyName,
|
|
984
|
+
tin
|
|
985
|
+
};
|
|
986
|
+
const tinVerificationResponse = await queryClient.fetchQuery(verifyTinQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), verifyTinQueryInput, userEvents));
|
|
987
|
+
setLoadingStatus("success");
|
|
988
|
+
companySearchStateModel.setVerificationMatched(!!tinVerificationResponse.matched);
|
|
989
|
+
if (companySearchStateModel.verificationMatched.value) return currentForms;
|
|
990
|
+
tinMismatchModalOpen.value = true;
|
|
991
|
+
return null;
|
|
992
|
+
} catch (e) {
|
|
993
|
+
logger.error(e);
|
|
994
|
+
setLoadingStatus("error");
|
|
995
|
+
return currentForms;
|
|
996
|
+
}
|
|
997
|
+
setLoadingStatus("success");
|
|
998
|
+
return currentForms;
|
|
999
|
+
case 1:
|
|
1000
|
+
if (!isNormalizedStringMatch(legalCompanyName, searchResponse.results[0].name)) {
|
|
1001
|
+
setLoadingStatus("success");
|
|
1002
|
+
return currentForms;
|
|
1003
|
+
}
|
|
1004
|
+
try {
|
|
1005
|
+
const companySelectionResponse = await selectCompany({
|
|
1006
|
+
name: legalCompanyName,
|
|
1007
|
+
tin,
|
|
1008
|
+
registrationNumber,
|
|
1009
|
+
id: searchResponse.results[0].resultId,
|
|
1010
|
+
country
|
|
1011
|
+
});
|
|
1012
|
+
companySearchStateModel.selectCompany(companySelectionResponse, -1, country);
|
|
1013
|
+
setLoadingStatus("success");
|
|
1014
|
+
if (isVerificationFailed()) {
|
|
1015
|
+
await clearCompanyData();
|
|
1016
|
+
return currentForms;
|
|
1017
|
+
}
|
|
1018
|
+
confirmSelection();
|
|
1019
|
+
skipBusinessSelection.value = true;
|
|
1020
|
+
return getRequiredForms({
|
|
1021
|
+
skipBusinessSelection: skipBusinessSelection.peek(),
|
|
1022
|
+
skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!getInferredRegistrationNumberType()
|
|
1023
|
+
});
|
|
1024
|
+
} catch (e) {
|
|
1025
|
+
logger.error(e);
|
|
1026
|
+
setLoadingStatus("error");
|
|
1027
|
+
await clearCompanyData();
|
|
1028
|
+
return formsWithoutSearchResults;
|
|
1029
|
+
}
|
|
1030
|
+
default:
|
|
1031
|
+
setLoadingStatus("success");
|
|
1032
|
+
return currentForms;
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
const confirmBusinessSelection = async () => {
|
|
1036
|
+
const selectedBusinessId = multiForm.data.businessSelection?.selectedBusinessId;
|
|
1037
|
+
if (companySearchStateModel.disallowedSelectionReason.value) {
|
|
1038
|
+
switch (companySearchStateModel.disallowedSelectionReason.value) {
|
|
1039
|
+
case "LEGAL_ARRANGEMENT":
|
|
1040
|
+
legalArrangementModalOpen.value = true;
|
|
1041
|
+
break;
|
|
1042
|
+
default:
|
|
1043
|
+
logger.error("Unhandled disallowed selection reason");
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
return null;
|
|
1047
|
+
}
|
|
1048
|
+
switch (selectedBusinessId) {
|
|
1049
|
+
case "notListed":
|
|
1050
|
+
if (country === CountryCodes.UnitedStates && isVerificationFailed()) isTinMatched.value = false;
|
|
1051
|
+
return getRequiredForms({});
|
|
1052
|
+
default:
|
|
1053
|
+
if (isVerificationFailed()) {
|
|
1054
|
+
if (country === CountryCodes.UnitedStates) tinMismatchModalOpen.value = true;
|
|
1055
|
+
else registrationNumberMismatchModalOpen.value = true;
|
|
1056
|
+
return null;
|
|
1057
|
+
}
|
|
1058
|
+
confirmSelection();
|
|
1059
|
+
return getRequiredForms({ skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!getInferredRegistrationNumberType() });
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1062
|
+
return {
|
|
1063
|
+
attemptBusinessSearch,
|
|
1064
|
+
confirmBusinessSelection
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
//#endregion
|
|
615
1068
|
//#region src/components/GlobalEntry/mapping/mapLegalEntityToGlobalEntrySchema.ts
|
|
616
1069
|
var determineEntitySetup = (legalEntity, accountHolder) => {
|
|
617
1070
|
if (accountHolder === "anUnincorporatedPartnership" && legalEntity.type === "individual") return "partOfABusiness";
|
|
@@ -636,10 +1089,16 @@ var mapLegalEntityToGlobalEntrySchema = (legalEntity, accountHolder, associatedS
|
|
|
636
1089
|
country,
|
|
637
1090
|
companyType
|
|
638
1091
|
}) ? true : legalEntity.organization?.registrationNumberAbsent;
|
|
1092
|
+
const stateOrProvince = [
|
|
1093
|
+
legalEntity.organization?.registeredAddress,
|
|
1094
|
+
legalEntity.individual?.residentialAddress,
|
|
1095
|
+
soleProprietorship?.registeredAddress
|
|
1096
|
+
].find((address) => address?.street && address?.stateOrProvince)?.stateOrProvince;
|
|
639
1097
|
return {
|
|
640
1098
|
entityInformation: {
|
|
641
1099
|
entitySetup: determineEntitySetup(legalEntity, accountHolder),
|
|
642
|
-
country: getLegalEntityCountry(legalEntity)
|
|
1100
|
+
country: getLegalEntityCountry(legalEntity),
|
|
1101
|
+
stateOrProvince
|
|
643
1102
|
},
|
|
644
1103
|
registrationInformation: {
|
|
645
1104
|
...mapLocalizationToJapaneseLegalNames(legalEntity.organization?.localization),
|
|
@@ -657,6 +1116,71 @@ var mapLegalEntityToGlobalEntrySchema = (legalEntity, accountHolder, associatedS
|
|
|
657
1116
|
};
|
|
658
1117
|
};
|
|
659
1118
|
//#endregion
|
|
1119
|
+
//#region src/components/GlobalEntry/modals/LegalArrangementModal.tsx
|
|
1120
|
+
/**
|
|
1121
|
+
* This component can likely be deleted when Global Entry is fully supported and search fully supports legal arrangements returned
|
|
1122
|
+
* from providers.
|
|
1123
|
+
*/
|
|
1124
|
+
function LegalArrangementModal({ onCancel, onConfirm }) {
|
|
1125
|
+
const { t } = useTranslation(["common", "business"]);
|
|
1126
|
+
return /* @__PURE__ */ jsx(Confirm, {
|
|
1127
|
+
title: t(($) => $["thisBusinessIsntRegisteredAsACompany"], { ns: "business" }),
|
|
1128
|
+
description: t(($) => $["ifThisIsYourBusinessGoBackAndChooseADifferentSetup"], { ns: "business" }),
|
|
1129
|
+
cancelText: t(($) => $["close"], { ns: "common" }),
|
|
1130
|
+
confirmText: t(($) => $["continue"], { ns: "common" }),
|
|
1131
|
+
onCancel,
|
|
1132
|
+
onConfirm,
|
|
1133
|
+
analyticsEventLabel: "legalArrangementModal"
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
//#endregion
|
|
1137
|
+
//#region src/components/GlobalEntry/modals/RegistrationNumberMismatchModal.tsx
|
|
1138
|
+
function RegistrationNumberMismatchModal({ companySearchStateModel, country, registrationNumberMismatchModalOpen, confirmDataSelection }) {
|
|
1139
|
+
const { t } = useTranslation(["common", "business"]);
|
|
1140
|
+
const { form } = useFormContext();
|
|
1141
|
+
const { data } = getFormSlice(form, "registrationInformation");
|
|
1142
|
+
const providedData = {
|
|
1143
|
+
registrationNumber: data?.registrationNumber,
|
|
1144
|
+
registrationNumberType: data?.registrationNumberType
|
|
1145
|
+
};
|
|
1146
|
+
const detectedData = {
|
|
1147
|
+
registrationNumber: companySearchStateModel.selectedCompany.value?.registrationNumber,
|
|
1148
|
+
registrationNumberType: void 0
|
|
1149
|
+
};
|
|
1150
|
+
const registrationNumberType = data?.exemptedFromRegistrationNumber ? "exempted" : data?.registrationNumberType;
|
|
1151
|
+
const { label: registrationNumberLabel } = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
|
|
1152
|
+
registrationNumberType: registrationNumberType === "exempted" ? void 0 : registrationNumberType,
|
|
1153
|
+
state: form.data.entityInformation?.stateOrProvince || void 0
|
|
1154
|
+
}, registrationNumberDefaultFieldMetadata);
|
|
1155
|
+
return /* @__PURE__ */ jsx(DataConflictsModal, {
|
|
1156
|
+
providedData,
|
|
1157
|
+
detectedData,
|
|
1158
|
+
conflictingProperties: ["registrationNumber"],
|
|
1159
|
+
formatters: {},
|
|
1160
|
+
labels: { registrationNumber: providedData.registrationNumberType === detectedData.registrationNumberType ? registrationNumberLabel : "registrationNumber" },
|
|
1161
|
+
title: t(($) => $["verifyYourBusinesssDetails"], { ns: "business" }),
|
|
1162
|
+
explanation: t(($) => $["selectTheOptionWithTheMostCorrectDetailsToContinue"], { ns: "business" }),
|
|
1163
|
+
onCancel: () => registrationNumberMismatchModalOpen.value = false,
|
|
1164
|
+
onContinue: confirmDataSelection,
|
|
1165
|
+
listOnly: true
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
//#endregion
|
|
1169
|
+
//#region src/components/GlobalEntry/modals/TinMismatchModal.tsx
|
|
1170
|
+
function TinMismatchModal({ onCancel, onConfirm }) {
|
|
1171
|
+
const { t } = useTranslation(["common", "business"]);
|
|
1172
|
+
const modalDescriptionKey = typeof useContext$1(CompanySearchStateContext).selectedCompany.value === "undefined" ? "theEinDidntMatchLegalBusinessName" : "itLooksLikeThisBusinessUsesADifferentEIN";
|
|
1173
|
+
return /* @__PURE__ */ jsx(Confirm, {
|
|
1174
|
+
title: t(($) => $["employerIdentificationNumberDoesntMatch"], { ns: "business" }),
|
|
1175
|
+
description: t(($) => $[modalDescriptionKey], { ns: "business" }),
|
|
1176
|
+
cancelText: t(($) => $["close"], { ns: "common" }),
|
|
1177
|
+
confirmText: t(($) => $["continue"], { ns: "common" }),
|
|
1178
|
+
onCancel,
|
|
1179
|
+
onConfirm,
|
|
1180
|
+
analyticsEventLabel: "tinVerificationFailureModal"
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
//#endregion
|
|
660
1184
|
//#region src/components/GlobalEntry/rules.ts
|
|
661
1185
|
var globalEntryFieldRuleConfigurations = {
|
|
662
1186
|
entitySetup: { rule: "entitySetupRequired" },
|
|
@@ -665,6 +1189,7 @@ var globalEntryFieldRuleConfigurations = {
|
|
|
665
1189
|
country: { rule: "countryRequired" },
|
|
666
1190
|
stateOrProvince: { rule: "requireStateOrProvinceForCompanySearch" },
|
|
667
1191
|
countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" },
|
|
1192
|
+
selectedBusinessId: { rule: "businessSelectionRequired" },
|
|
668
1193
|
filedPaperwork: { rule: "filedPaperworkRequired" },
|
|
669
1194
|
unincorporatedOrganizationType: { rule: "unincorporatedOrganizationTypeRequired" },
|
|
670
1195
|
legalCompanyName: { rule: "legalCompanyNameRequired" },
|
|
@@ -676,7 +1201,7 @@ var globalEntryFieldRuleConfigurations = {
|
|
|
676
1201
|
taxInformation: { rule: "taxInformationRequired" },
|
|
677
1202
|
exemptedFromTax: { rule: "countryHasTaxExemptions" }
|
|
678
1203
|
};
|
|
679
|
-
var globalEntryCustomRules = ({ accountHolder, data, isFeatureEnabled = () => false, country,
|
|
1204
|
+
var globalEntryCustomRules = ({ accountHolder, data, isFeatureEnabled = () => false, country, rootLegalEntity }) => {
|
|
680
1205
|
const filedPaperwork = getFiledPaperwork(data);
|
|
681
1206
|
const hasFiledPaperwork = filedPaperwork === "yes";
|
|
682
1207
|
const hasAnsweredPaperworkQuestion = !!filedPaperwork;
|
|
@@ -690,8 +1215,9 @@ var globalEntryCustomRules = ({ accountHolder, data, isFeatureEnabled = () => fa
|
|
|
690
1215
|
entitySetupRequired: () => "REQUIRED",
|
|
691
1216
|
countryRequired: () => "REQUIRED",
|
|
692
1217
|
requireStateOrProvinceForCompanySearch: () => {
|
|
693
|
-
if (isPartOfABusiness && isUsingCompanySearch(country,
|
|
1218
|
+
if (isPartOfABusiness && isUsingCompanySearch(country, TaskTypes.GLOBAL_ENTRY) && COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
|
|
694
1219
|
},
|
|
1220
|
+
businessSelectionRequired: () => isUsingCompanySearch(country, TaskTypes.GLOBAL_ENTRY) && isRegisteredOrganization ? "REQUIRED" : void 0,
|
|
695
1221
|
organizationTypeRequired: () => isRegisteredOrganization ? "REQUIRED" : void 0,
|
|
696
1222
|
countryOfGoverningLawRequired: () => {
|
|
697
1223
|
if (isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(country) && (isPartOfABusiness || isSoleProp) && hasAnsweredPaperworkQuestion) return "REQUIRED";
|
|
@@ -792,12 +1318,16 @@ var globalEntryCustomRules = ({ accountHolder, data, isFeatureEnabled = () => fa
|
|
|
792
1318
|
//#region src/components/GlobalEntry/utils/buildRequiredForms.ts
|
|
793
1319
|
function buildRequiredForms({ config: { forms, requiredFields, optionalFields, isValid }, options }) {
|
|
794
1320
|
/**
|
|
1321
|
+
* Skip business selection if:
|
|
1322
|
+
* - Company search is unavailable, or returned nothing to choose between
|
|
1323
|
+
*
|
|
795
1324
|
* Skip company structure if:
|
|
796
|
-
* - Only a single company structure is available
|
|
1325
|
+
* - Only a single company structure is available, or a provider supplied a usable one
|
|
797
1326
|
*/
|
|
798
1327
|
const filteredForms = [];
|
|
799
1328
|
for (const formId in forms) {
|
|
800
1329
|
const form = forms[formId];
|
|
1330
|
+
if (formId === "businessSelection" && options?.skipBusinessSelection) continue;
|
|
801
1331
|
if (formId === "companyStructure" && options?.skipCompanyStructure) continue;
|
|
802
1332
|
if (requiredFields || optionalFields) {
|
|
803
1333
|
if (!requiredFields?.[formId] && !optionalFields?.[formId]) continue;
|
|
@@ -813,7 +1343,6 @@ function buildRequiredForms({ config: { forms, requiredFields, optionalFields, i
|
|
|
813
1343
|
*/
|
|
814
1344
|
var globalEntryKeyMappingForOrgs = {
|
|
815
1345
|
"entityInformation.country": "organization.registeredAddress.country",
|
|
816
|
-
"entityInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
|
|
817
1346
|
"registrationInformation.legalCompanyName": "organization.legalName",
|
|
818
1347
|
"registrationInformation.registrationNumber": "organization.registrationNumber",
|
|
819
1348
|
"registrationInformation.exemptedFromRegistrationNumber": "organization.registrationNumberAbsent",
|
|
@@ -821,13 +1350,9 @@ var globalEntryKeyMappingForOrgs = {
|
|
|
821
1350
|
"registrationInformation.countryOfGoverningLaw": "organization.countryOfGoverningLaw",
|
|
822
1351
|
"companyStructure.organizationType": "organization.type"
|
|
823
1352
|
};
|
|
824
|
-
var globalEntryKeyMappingForIndividuals = {
|
|
825
|
-
"entityInformation.country": "individual.residentialAddress.country",
|
|
826
|
-
"entityInformation.stateOrProvince": "individual.residentialAddress.stateOrProvince"
|
|
827
|
-
};
|
|
1353
|
+
var globalEntryKeyMappingForIndividuals = { "entityInformation.country": "individual.residentialAddress.country" };
|
|
828
1354
|
var globalEntryKeyMappingForSoleProps = {
|
|
829
1355
|
"entityInformation.country": "soleProprietorship.registeredAddress.country",
|
|
830
|
-
"entityInformation.stateOrProvince": "soleProprietorship.registeredAddress.stateOrProvince",
|
|
831
1356
|
"registrationInformation.legalCompanyName": "soleProprietorship.name",
|
|
832
1357
|
"registrationInformation.registrationNumber": "soleProprietorship.registrationNumber",
|
|
833
1358
|
"registrationInformation.taxInformation": "soleProprietorship.taxInformation",
|
|
@@ -925,6 +1450,11 @@ var globalEntryValidationRules = ({ data, legalEntity, isFeatureEnabled = () =>
|
|
|
925
1450
|
state: data?.entityInformation?.stateOrProvince
|
|
926
1451
|
}, registrationNumberDefaultFieldMetadata).validators;
|
|
927
1452
|
return {
|
|
1453
|
+
businessSelection: { selectedBusinessId: {
|
|
1454
|
+
validate: (value) => !isEmpty(value),
|
|
1455
|
+
modes: ["blur", "input"],
|
|
1456
|
+
errorMessage: "fieldIsRequired"
|
|
1457
|
+
} },
|
|
928
1458
|
companyStructure: { organizationType: {
|
|
929
1459
|
validate: (value) => !!value,
|
|
930
1460
|
modes: ["blur", "input"]
|
|
@@ -960,6 +1490,10 @@ var GlobalEntry = ({ activeForm, legalEntity, shouldValidate, country }) => {
|
|
|
960
1490
|
shouldValidate,
|
|
961
1491
|
country
|
|
962
1492
|
});
|
|
1493
|
+
case globalEntryForms.businessSelection.formId: return /* @__PURE__ */ jsx(BusinessSelection, {
|
|
1494
|
+
id: activeForm.formId,
|
|
1495
|
+
country
|
|
1496
|
+
});
|
|
963
1497
|
case globalEntryForms.companyStructure.formId: return /* @__PURE__ */ jsx(CompanyStructure, {
|
|
964
1498
|
id: activeForm.formId,
|
|
965
1499
|
country,
|
|
@@ -971,43 +1505,59 @@ var GlobalEntry = ({ activeForm, legalEntity, shouldValidate, country }) => {
|
|
|
971
1505
|
};
|
|
972
1506
|
//#endregion
|
|
973
1507
|
//#region src/components/GlobalEntry/tasks/GlobalEntryModal.tsx
|
|
1508
|
+
var CompanySearchStateContext = createContext$1({});
|
|
974
1509
|
var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
975
1510
|
const { i18n, t } = useTranslation(["common", "globalEntry"]);
|
|
976
1511
|
const { isFeatureEnabled } = useToggleContext();
|
|
977
1512
|
const logger = createLogger();
|
|
978
1513
|
const { showToast } = useToastContext();
|
|
979
1514
|
const { accountHolder: accountHolderMaybe } = useAccountHolder();
|
|
1515
|
+
const userEvents = useAnalyticsContext();
|
|
1516
|
+
const { mutateAsync: clearCompanyData } = useClearCompanyData();
|
|
980
1517
|
const [derivedProps, setDerivedProps] = useState();
|
|
981
1518
|
const accountHolder = accountHolderMaybe ?? (rootLegalEntity.type === "individual" ? "myName" : "theCompanyIWorkFor");
|
|
1519
|
+
const companySearchStateModel = useModel(() => new CompanySearchStateModel(userEvents));
|
|
1520
|
+
const tinMismatchModalOpen = useSignal(false);
|
|
1521
|
+
const legalArrangementModalOpen = useSignal(false);
|
|
1522
|
+
const registrationNumberMismatchModalOpen = useSignal(false);
|
|
1523
|
+
const skipBusinessSelection = useSignal(true);
|
|
1524
|
+
const [searchStatus, setSearchStatus] = useState("success");
|
|
1525
|
+
/**
|
|
1526
|
+
* Distinct from the model's `verificationMatched`, which updates the moment the API answers. This
|
|
1527
|
+
* only records the outcome once the user navigates forward, and it is deliberately inert: unlike
|
|
1528
|
+
* Business Details, Global Entry has no tax document step to insert, so remediation is left to the
|
|
1529
|
+
* task that does collect documents.
|
|
1530
|
+
*/
|
|
1531
|
+
const isTinMatched = useSignal(void 0);
|
|
982
1532
|
addResourceBundles(i18n, [{
|
|
983
1533
|
ns: "globalEntry",
|
|
984
1534
|
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* #__PURE__ */ Object.assign({
|
|
985
|
-
"../language/bg-BG.json": () => import("./bg-BG-
|
|
986
|
-
"../language/cs-CZ.json": () => import("./cs-CZ-
|
|
987
|
-
"../language/da-DK.json": () => import("./da-DK-
|
|
988
|
-
"../language/de-DE.json": () => import("./de-DE-
|
|
989
|
-
"../language/el-GR.json": () => import("./el-GR-
|
|
1535
|
+
"../language/bg-BG.json": () => import("./bg-BG-ClMsmcda.js"),
|
|
1536
|
+
"../language/cs-CZ.json": () => import("./cs-CZ-DyLd-erd.js"),
|
|
1537
|
+
"../language/da-DK.json": () => import("./da-DK-Dhr4p-qj.js"),
|
|
1538
|
+
"../language/de-DE.json": () => import("./de-DE-QDT6VVq9.js"),
|
|
1539
|
+
"../language/el-GR.json": () => import("./el-GR-V2cZ5gjl.js"),
|
|
990
1540
|
"../language/en-US.json": () => import("./en-US-Cz4JoU20.js"),
|
|
991
|
-
"../language/es-ES.json": () => import("./es-ES-
|
|
992
|
-
"../language/es-LA.json": () => import("./es-LA-
|
|
993
|
-
"../language/et-EE.json": () => import("./et-EE-
|
|
994
|
-
"../language/fi-FI.json": () => import("./fi-FI-
|
|
995
|
-
"../language/fr-FR.json": () => import("./fr-FR-
|
|
996
|
-
"../language/hr-HR.json": () => import("./hr-HR-
|
|
997
|
-
"../language/hu-HU.json": () => import("./hu-HU-
|
|
998
|
-
"../language/it-IT.json": () => import("./it-IT-
|
|
999
|
-
"../language/ja-JP.json": () => import("./ja-JP-
|
|
1000
|
-
"../language/lt-LT.json": () => import("./lt-LT-
|
|
1001
|
-
"../language/lv-LV.json": () => import("./lv-LV-
|
|
1002
|
-
"../language/nl-NL.json": () => import("./nl-NL-
|
|
1003
|
-
"../language/no-NO.json": () => import("./no-NO-
|
|
1004
|
-
"../language/pl-PL.json": () => import("./pl-PL-
|
|
1005
|
-
"../language/pt-BR.json": () => import("./pt-BR-
|
|
1006
|
-
"../language/pt-PT.json": () => import("./pt-PT-
|
|
1007
|
-
"../language/ro-RO.json": () => import("./ro-RO-
|
|
1008
|
-
"../language/sk-SK.json": () => import("./sk-SK-
|
|
1009
|
-
"../language/sl-SI.json": () => import("./sl-SI-
|
|
1010
|
-
"../language/sv-SE.json": () => import("./sv-SE-
|
|
1541
|
+
"../language/es-ES.json": () => import("./es-ES-SsReQJzQ.js"),
|
|
1542
|
+
"../language/es-LA.json": () => import("./es-LA-DTXCg1tj.js"),
|
|
1543
|
+
"../language/et-EE.json": () => import("./et-EE-Bg3WOS9m.js"),
|
|
1544
|
+
"../language/fi-FI.json": () => import("./fi-FI-B1RyWVH2.js"),
|
|
1545
|
+
"../language/fr-FR.json": () => import("./fr-FR-C3Zi7-JE.js"),
|
|
1546
|
+
"../language/hr-HR.json": () => import("./hr-HR-CH9yGEPn.js"),
|
|
1547
|
+
"../language/hu-HU.json": () => import("./hu-HU-DpUG3GwC.js"),
|
|
1548
|
+
"../language/it-IT.json": () => import("./it-IT-BEEsgu4Z.js"),
|
|
1549
|
+
"../language/ja-JP.json": () => import("./ja-JP-CcXk7Gcc.js"),
|
|
1550
|
+
"../language/lt-LT.json": () => import("./lt-LT-CGgbFwbx.js"),
|
|
1551
|
+
"../language/lv-LV.json": () => import("./lv-LV-Ck_aQ4ML.js"),
|
|
1552
|
+
"../language/nl-NL.json": () => import("./nl-NL-_hbzuQ0h.js"),
|
|
1553
|
+
"../language/no-NO.json": () => import("./no-NO-B_ijkAtf.js"),
|
|
1554
|
+
"../language/pl-PL.json": () => import("./pl-PL-u6DrL8IY.js"),
|
|
1555
|
+
"../language/pt-BR.json": () => import("./pt-BR-CPS77pGy.js"),
|
|
1556
|
+
"../language/pt-PT.json": () => import("./pt-PT-DIKqQR6V.js"),
|
|
1557
|
+
"../language/ro-RO.json": () => import("./ro-RO-Cg1nG9ns.js"),
|
|
1558
|
+
"../language/sk-SK.json": () => import("./sk-SK-CRfiVN3e.js"),
|
|
1559
|
+
"../language/sl-SI.json": () => import("./sl-SI-Dpr3StsS.js"),
|
|
1560
|
+
"../language/sv-SE.json": () => import("./sv-SE-CH4wMrUZ.js")
|
|
1011
1561
|
}), `../language/${lang}.json`, 3)
|
|
1012
1562
|
}]);
|
|
1013
1563
|
addResourceBundles(i18n, [{
|
|
@@ -1115,41 +1665,55 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1115
1665
|
const inferredCompanyStructure = useMemo(() => {
|
|
1116
1666
|
return availableCompanyStructures.length === 1 ? availableCompanyStructures[0] : void 0;
|
|
1117
1667
|
}, [availableCompanyStructures]);
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
options: {
|
|
1133
|
-
skipSummary: true,
|
|
1134
|
-
skipCompanyStructure: !!inferredCompanyStructure
|
|
1135
|
-
}
|
|
1136
|
-
});
|
|
1137
|
-
}, [
|
|
1668
|
+
const getRequiredForms = useCallback((options) => buildRequiredForms({
|
|
1669
|
+
config: {
|
|
1670
|
+
forms: globalEntryForms,
|
|
1671
|
+
requiredFields: derivedProps?.requiredFields,
|
|
1672
|
+
optionalFields: derivedProps?.optionalFields,
|
|
1673
|
+
isValid: formValidity ?? {},
|
|
1674
|
+
legalEntityResponse: rootLegalEntity
|
|
1675
|
+
},
|
|
1676
|
+
options: {
|
|
1677
|
+
skipSummary: true,
|
|
1678
|
+
skipCompanyStructure: !!inferredCompanyStructure,
|
|
1679
|
+
...options
|
|
1680
|
+
}
|
|
1681
|
+
}), [
|
|
1138
1682
|
derivedProps?.optionalFields,
|
|
1139
1683
|
derivedProps?.requiredFields,
|
|
1140
1684
|
formValidity,
|
|
1141
|
-
|
|
1685
|
+
inferredCompanyStructure,
|
|
1686
|
+
rootLegalEntity
|
|
1687
|
+
]);
|
|
1688
|
+
const forms = useMemo(() => getRequiredForms({
|
|
1689
|
+
skipBusinessSelection: skipBusinessSelection.value,
|
|
1690
|
+
skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!inferredCompanyStructure
|
|
1691
|
+
}), [
|
|
1692
|
+
getRequiredForms,
|
|
1693
|
+
skipBusinessSelection.value,
|
|
1694
|
+
companySearchStateModel.verifiedBusiness.value,
|
|
1142
1695
|
inferredCompanyStructure
|
|
1143
1696
|
]);
|
|
1144
1697
|
const { mutateAsync: updateLegalEntity, isPending: isUpdatingLegalEntity } = useUpdateLegalEntity();
|
|
1145
1698
|
const { mutateAsync: createLegalEntity, isPending: isCreatingLegalEntity } = useCreateLegalEntity();
|
|
1146
1699
|
const isLoading = isUpdatingLegalEntity || isCreatingLegalEntity || isLoadingAssociatedSoleProp;
|
|
1700
|
+
/**
|
|
1701
|
+
* Form writes only reach the state on the next render so this prevents
|
|
1702
|
+
* outdated data from being submitted. In Global Entry, we submit the form
|
|
1703
|
+
* on navigation so the re-render hasn't happened yet.
|
|
1704
|
+
*/
|
|
1705
|
+
const pendingSubmitData = useRef();
|
|
1706
|
+
const confirmSelection = (options) => {
|
|
1707
|
+
pendingSubmitData.current = companySearchStateModel.confirmCompany(multiForm, country, options);
|
|
1708
|
+
};
|
|
1147
1709
|
const handleSubmit = async () => {
|
|
1710
|
+
const submittedData = pendingSubmitData.current ?? data;
|
|
1711
|
+
pendingSubmitData.current = void 0;
|
|
1148
1712
|
try {
|
|
1149
1713
|
const newAccountHolder = await submitGlobalEntry({
|
|
1150
1714
|
legalEntity: rootLegalEntity,
|
|
1151
1715
|
associatedSoleProp,
|
|
1152
|
-
data,
|
|
1716
|
+
data: submittedData,
|
|
1153
1717
|
updateLegalEntity,
|
|
1154
1718
|
createLegalEntity,
|
|
1155
1719
|
accountHolder,
|
|
@@ -1170,9 +1734,114 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1170
1734
|
forms,
|
|
1171
1735
|
triggerValidation
|
|
1172
1736
|
});
|
|
1737
|
+
const { attemptBusinessSearch, confirmBusinessSelection } = useCompanySearchNextClickOverrides({
|
|
1738
|
+
country,
|
|
1739
|
+
multiForm,
|
|
1740
|
+
companySearchStateModel,
|
|
1741
|
+
getRequiredForms,
|
|
1742
|
+
skipBusinessSelection,
|
|
1743
|
+
setLoadingStatus: setSearchStatus,
|
|
1744
|
+
isTinMatched,
|
|
1745
|
+
tinMismatchModalOpen,
|
|
1746
|
+
legalArrangementModalOpen,
|
|
1747
|
+
registrationNumberMismatchModalOpen,
|
|
1748
|
+
confirmSelection
|
|
1749
|
+
});
|
|
1750
|
+
const [companyStructure, setCompanyStructure] = useState(data.companyStructure?.organizationType);
|
|
1751
|
+
if (inferredCompanyStructure && companyStructure !== inferredCompanyStructure && !companySearchStateModel.verifiedBusiness.value?.legalForm && activeForm?.formId === globalEntryForms.registrationInformation.formId) {
|
|
1752
|
+
setCompanyStructure(inferredCompanyStructure);
|
|
1753
|
+
multiForm.handleChangeFor("companyStructure", "organizationType")(inferredCompanyStructure);
|
|
1754
|
+
}
|
|
1755
|
+
/**
|
|
1756
|
+
* Current country value must be kept in sync with what is selected in entityInformation form
|
|
1757
|
+
*/
|
|
1758
|
+
const [prevCountry, setPrevCountry] = useState(data.entityInformation?.country);
|
|
1759
|
+
if (data.entityInformation?.country && prevCountry !== data.entityInformation.country) {
|
|
1760
|
+
setPrevCountry(data.entityInformation.country);
|
|
1761
|
+
companySearchStateModel.resetCompanySearchData();
|
|
1762
|
+
multiForm.handleChangeFor("companyStructure", "organizationType")(void 0);
|
|
1763
|
+
}
|
|
1173
1764
|
const overrideNextClick = async () => {
|
|
1174
1765
|
if (!activeForm.isValid) return handleNextClick();
|
|
1175
|
-
return handleNextClick();
|
|
1766
|
+
if (!(isUsingCompanySearch(country, TaskTypes.GLOBAL_ENTRY) && data.registrationInformation?.filedPaperwork === "yes")) return handleNextClick();
|
|
1767
|
+
switch (activeForm.formId) {
|
|
1768
|
+
case globalEntryForms.registrationInformation.formId: {
|
|
1769
|
+
const currentForms = await attemptBusinessSearch();
|
|
1770
|
+
if (currentForms === null) return;
|
|
1771
|
+
return handleNextClick(currentForms);
|
|
1772
|
+
}
|
|
1773
|
+
case globalEntryForms.businessSelection.formId: {
|
|
1774
|
+
const currentForms = await confirmBusinessSelection();
|
|
1775
|
+
if (currentForms === null) return;
|
|
1776
|
+
return handleNextClick(currentForms);
|
|
1777
|
+
}
|
|
1778
|
+
default: return handleNextClick();
|
|
1779
|
+
}
|
|
1780
|
+
};
|
|
1781
|
+
const tinMismatchConfirm = async () => {
|
|
1782
|
+
tinMismatchModalOpen.value = false;
|
|
1783
|
+
/**
|
|
1784
|
+
* Only true when there are no search results.
|
|
1785
|
+
*
|
|
1786
|
+
* If the user is on business selection, we don't want to remove the page from under them, as nav
|
|
1787
|
+
* gets strange when doing so. It's only dropped when they're still on registration information,
|
|
1788
|
+
* the only other place this modal opens from.
|
|
1789
|
+
*/
|
|
1790
|
+
skipBusinessSelection.value = activeForm.formId !== globalEntryForms.businessSelection.formId;
|
|
1791
|
+
confirmSelection();
|
|
1792
|
+
if (country === CountryCodes.UnitedStates && companySearchStateModel.verificationMatched.value === false) isTinMatched.value = false;
|
|
1793
|
+
handleNextClick(getRequiredForms({
|
|
1794
|
+
skipBusinessSelection: skipBusinessSelection.peek(),
|
|
1795
|
+
skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm
|
|
1796
|
+
}));
|
|
1797
|
+
};
|
|
1798
|
+
/** Resolves the registration number mismatch modal */
|
|
1799
|
+
const confirmDataSelection = async (resolvedData) => {
|
|
1800
|
+
const userProvided = resolvedData.registrationNumber !== companySearchStateModel.selectedCompany.value?.registrationNumber;
|
|
1801
|
+
userEvents.addPageEvent("Clicked button", {
|
|
1802
|
+
actionType: "select",
|
|
1803
|
+
label: "confirmCompanyConflictResolution",
|
|
1804
|
+
additionalData: { selection: userProvided ? "manual" : "recommended" }
|
|
1805
|
+
});
|
|
1806
|
+
/**
|
|
1807
|
+
* If the user is on 'Business Selection', we don't want to remove the page out from under them as
|
|
1808
|
+
* nav can get a bit weird when doing so. Instead, we'll only remove it from the flow if the user is
|
|
1809
|
+
* still on 'Basic Information', the only other place this modal is accessible from.
|
|
1810
|
+
*/
|
|
1811
|
+
skipBusinessSelection.value = activeForm.formId !== globalEntryForms.businessSelection.formId;
|
|
1812
|
+
if (userProvided) {
|
|
1813
|
+
registrationNumberMismatchModalOpen.value = false;
|
|
1814
|
+
/**
|
|
1815
|
+
* The user keeps their own registration number, but the rest of the provider's data
|
|
1816
|
+
* (legal name, addresses, financial information) is still worth applying.
|
|
1817
|
+
*
|
|
1818
|
+
* The provider's company type can only be applied if it's compatible with the user's
|
|
1819
|
+
* registration number — a GB charity number, for example, cannot belong to a
|
|
1820
|
+
* `privateCompany`. When it isn't compatible we discard it and fall back to the company
|
|
1821
|
+
* types the registration number allows: exactly one means we can infer it, otherwise the
|
|
1822
|
+
* user picks it on the company structure step.
|
|
1823
|
+
*/
|
|
1824
|
+
const providerCompanyType = companySearchStateModel.selectedCompany.value?.companyType;
|
|
1825
|
+
const resolvedCompanyType = !!providerCompanyType && availableCompanyStructures.includes(providerCompanyType) ? providerCompanyType : inferredCompanyStructure;
|
|
1826
|
+
confirmSelection({
|
|
1827
|
+
preserveRegistrationNumber: true,
|
|
1828
|
+
companyTypeOverride: resolvedCompanyType
|
|
1829
|
+
});
|
|
1830
|
+
await clearCompanyData();
|
|
1831
|
+
handleNextClick(getRequiredForms({
|
|
1832
|
+
skipBusinessSelection: skipBusinessSelection.peek(),
|
|
1833
|
+
skipCompanyStructure: !!resolvedCompanyType
|
|
1834
|
+
}));
|
|
1835
|
+
return;
|
|
1836
|
+
} else {
|
|
1837
|
+
confirmSelection();
|
|
1838
|
+
registrationNumberMismatchModalOpen.value = false;
|
|
1839
|
+
const inferredRegistrationNumberType = resolvedData.registrationNumber ? inferCompanyRegistrationNumberType(resolvedData.registrationNumber, country, companySearchStateModel.verifiedBusiness.value?.companyType) : void 0;
|
|
1840
|
+
handleNextClick(getRequiredForms({
|
|
1841
|
+
skipBusinessSelection: skipBusinessSelection.peek(),
|
|
1842
|
+
skipCompanyStructure: !!companySearchStateModel.verifiedBusiness.value?.legalForm || !!inferredRegistrationNumberType
|
|
1843
|
+
}));
|
|
1844
|
+
}
|
|
1176
1845
|
};
|
|
1177
1846
|
return /* @__PURE__ */ jsx(FormContextProvider, {
|
|
1178
1847
|
form: multiForm,
|
|
@@ -1185,16 +1854,44 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1185
1854
|
forms,
|
|
1186
1855
|
gotoFormByFormIndex,
|
|
1187
1856
|
gotoFormByFormId,
|
|
1188
|
-
loadingStatus: isLoading ? "loading" :
|
|
1857
|
+
loadingStatus: isLoading ? "loading" : searchStatus,
|
|
1189
1858
|
currentStep: steps.current,
|
|
1190
1859
|
totalSteps: steps.total,
|
|
1191
1860
|
isGlobalEntry: true,
|
|
1192
1861
|
disableNextButton: data?.registrationInformation?.unincorporatedOrganizationType === "unincorporatedAssociation",
|
|
1193
|
-
children: /* @__PURE__ */
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1862
|
+
children: /* @__PURE__ */ jsxs(CompanySearchStateContext.Provider, {
|
|
1863
|
+
value: companySearchStateModel,
|
|
1864
|
+
children: [
|
|
1865
|
+
/* @__PURE__ */ jsx(GlobalEntry, {
|
|
1866
|
+
activeForm,
|
|
1867
|
+
shouldValidate,
|
|
1868
|
+
legalEntity: rootLegalEntity,
|
|
1869
|
+
country
|
|
1870
|
+
}),
|
|
1871
|
+
/* @__PURE__ */ jsx(Show, {
|
|
1872
|
+
when: tinMismatchModalOpen,
|
|
1873
|
+
children: /* @__PURE__ */ jsx(TinMismatchModal, {
|
|
1874
|
+
onCancel: () => tinMismatchModalOpen.value = false,
|
|
1875
|
+
onConfirm: tinMismatchConfirm
|
|
1876
|
+
})
|
|
1877
|
+
}),
|
|
1878
|
+
/* @__PURE__ */ jsx(Show, {
|
|
1879
|
+
when: legalArrangementModalOpen,
|
|
1880
|
+
children: /* @__PURE__ */ jsx(LegalArrangementModal, {
|
|
1881
|
+
onCancel: () => legalArrangementModalOpen.value = false,
|
|
1882
|
+
onConfirm: () => legalArrangementModalOpen.value = false
|
|
1883
|
+
})
|
|
1884
|
+
}),
|
|
1885
|
+
/* @__PURE__ */ jsx(Show, {
|
|
1886
|
+
when: registrationNumberMismatchModalOpen,
|
|
1887
|
+
children: /* @__PURE__ */ jsx(RegistrationNumberMismatchModal, {
|
|
1888
|
+
companySearchStateModel,
|
|
1889
|
+
country,
|
|
1890
|
+
registrationNumberMismatchModalOpen,
|
|
1891
|
+
confirmDataSelection
|
|
1892
|
+
})
|
|
1893
|
+
})
|
|
1894
|
+
]
|
|
1198
1895
|
})
|
|
1199
1896
|
})
|
|
1200
1897
|
});
|