@adyen/kyc-components 4.26.1 → 4.27.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/{AcceptTermsOfServiceWorkflow-DXSq3XzA.js → AcceptTermsOfServiceWorkflow-CO6qEeAD.js} +4 -4
- package/dist/{Accordion-BAdwrgCR.js → Accordion-CTQfC17W.js} +1 -1
- package/dist/{AccountSetupRejected-BLEWjmc8.js → AccountSetupRejected-CFvogFuo.js} +2 -2
- package/dist/{AdaptiveWorkflow-DwdMyu1A.js → AdaptiveWorkflow-CTKpyw02.js} +22 -22
- package/dist/{AdaptiveWorkflowComponent-DPv1YHos.js → AdaptiveWorkflowComponent-CvTwsWi3.js} +5 -5
- package/dist/{AddressFields-B0QVYM-e.js → AddressFields-vl2AeVHz.js} +33 -72
- package/dist/{Avatar-C2zeqSSB.js → Avatar-yJfk9A6l.js} +1 -1
- package/dist/{BusinessFinancingDropin-evYHYnXE.js → BusinessFinancingDropin-tSylhmJS.js} +123 -55
- package/dist/{BusinessFinancingPage-C_agz96E.js → BusinessFinancingPage-9AcfHWyP.js} +6 -6
- package/dist/{BusinessRegistrationNumberField-DeYcZlQS.js → BusinessRegistrationNumberField-B6w6LvSZ.js} +6 -6
- package/dist/{BusinessRegistrationNumberFieldGroup-D9D0BPdp.js → BusinessRegistrationNumberFieldGroup-CICYxSyn.js} +6 -6
- package/dist/{BusinessTypeSelectionPage-DmgeZsex.js → BusinessTypeSelectionPage-lLt_PL1z.js} +13 -13
- package/dist/{Button-Dwr6jvJZ.js → Button-BYafPrZH.js} +1 -1
- package/dist/{Checkbox-BLyyDG9b.js → Checkbox-DXF-eRBj.js} +8 -8
- package/dist/{ComponentGroup-BLvYZoxp.js → ComponentGroup-DNspJrHk.js} +3 -3
- package/dist/{ConstitutionalDocument-B3o3NLMO.js → ConstitutionalDocument-Dg3dmkpH.js} +19 -26
- package/dist/{ContactDetails-7zYbKJtH.js → ContactDetails-5W0oQVYG.js} +5 -5
- package/dist/{ContextGuidance-C2AXK9Ep.js → ContextGuidance-BrbPzdaI.js} +3 -3
- package/dist/{CountryField-Bl8gp3wu.js → CountryField-DlMYQYfd.js} +4 -4
- package/dist/{Currency-Be6zg8XM.js → Currency-BCJuV60i.js} +16 -10
- package/dist/{CustomerSupport-lUVh_sWN.js → CustomerSupport-Bdg11WcM.js} +29 -16
- package/dist/{DateField-CO2CodgD.js → DateField-DfnBDOVl.js} +4 -4
- package/dist/{DebugModal-l52lDfKB.js → DebugModal-D1RMhAfR.js} +228 -10
- package/dist/{DecisionMakerDetails-9y6Fm96G.js → DecisionMakerDetails-Cv_NdD0z.js} +79 -174
- package/dist/{DecisionMakerDetailsPage-9kRW2Zh8.js → DecisionMakerDetailsPage-dTsh8vkz.js} +9 -9
- package/dist/{DecisionMakers-CYjKftby.js → DecisionMakers-DAhjhaMS.js} +17 -18
- package/dist/{Dropzone-QRtCFpVT.js → Dropzone-rk15b_Tb.js} +7 -7
- package/dist/{EmailField-D-Ndm0JS.js → EmailField-BOX8HtRe.js} +4 -4
- package/dist/{EmbeddedStatus-4YjyzkcD.js → EmbeddedStatus-mdQsQfof.js} +2 -2
- package/dist/{EndStateLayout-C5Pqler-.js → EndStateLayout-B-M90Rnh.js} +2 -2
- package/dist/{EntityAssociation-CS8XqKk-.js → EntityAssociation-B5Zq7_F6.js} +6 -6
- package/dist/{ErrorPanel-DaipnVsu.js → ErrorPanel-BLvDkiVa.js} +10 -17
- package/dist/{GlobalEntryModal-COOjZvh7.js → GlobalEntryModal-DZsHeRPL.js} +439 -298
- package/dist/{GlobalEntryPage-C9SGXXJk.js → GlobalEntryPage-RyQIoaWL.js} +7 -8
- package/dist/{Icon-_YUEZg1p.js → Icon-jVvV1zXc.js} +1 -1
- package/dist/{IdentityNumber-D_cOLEsP.js → IdentityNumber-C8CMJtgD.js} +5 -5
- package/dist/{IdentityNumberFieldGroup-CoLugvku.js → IdentityNumberFieldGroup-Cj5U1Onz.js} +2 -2
- package/dist/{IdentityScreeningWorkflow-B_nLC0Ru.js → IdentityScreeningWorkflow-BCDn25Or.js} +12 -13
- package/dist/{IndividualDropin-CRKk-szG.js → IndividualDropin-B6dY0iN3.js} +149 -231
- package/dist/{IndustryCodeFieldGroup-0vRXN8GP.js → IndustryCodeFieldGroup-B649faYk.js} +5 -5
- package/dist/{InputDate-Cxk_f6Us.js → InputDate-3rYzWzXX.js} +8 -4
- package/dist/{InputText-CObXfKKh.js → InputText-OCbzlaaN.js} +2 -2
- package/dist/{Introduction-CmhxGGzY.js → Introduction-Duow8A7U.js} +6 -6
- package/dist/{InvitedDecisionMakerComponent-BkHurym6.js → InvitedDecisionMakerComponent-BVQ37JLZ.js} +13 -14
- package/dist/{JpAddressFields-CuvfbjX6.js → JpAddressFields-Bh7Bvw__.js} +9 -10
- package/dist/{LegalCompanyNameField-CkINYTFB.js → LegalCompanyNameField-Yj5Fa3-I.js} +5 -5
- package/dist/{LegalRepresentativeDetailsPage-mlE80SrL.js → LegalRepresentativeDetailsPage-C10ojT9w.js} +4 -4
- package/dist/{Link-D0Yqc2r0.js → Link-DwPkGikd.js} +1 -1
- package/dist/{ListItem-DY-qq1lS.js → ListItem-n927geYb.js} +2 -2
- package/dist/{Modal-DnDjAzqZ.js → Modal-jjSjdW5W.js} +3 -3
- package/dist/{Name-Dhj905G8.js → Name-D-A5XBTb.js} +4 -4
- package/dist/{NumberField-BlDjTB0U.js → NumberField-D291GWYR.js} +4 -4
- package/dist/{PatriotActDisclosure-jNLKR-RM.js → PatriotActDisclosure-DMjKJEKH.js} +10 -10
- package/dist/{PayoutDetailsDropin-DO1CtLRd.js → PayoutDetailsDropin-B5MNHR3S.js} +41 -43
- package/dist/{PayoutDetailsPage-C-W1PCRf.js → PayoutDetailsPage-DMAxzS2V.js} +5 -5
- package/dist/{Review-BLcoVl6O.js → Review-BDontauk.js} +6 -6
- package/dist/{RootBusinessDetailsPage-DNZi9Zgj.js → RootBusinessDetailsPage-INMIQvN4.js} +4 -4
- package/dist/{RootBusinessLinesPage-D2IPigk5.js → RootBusinessLinesPage-BiIb7UVU.js} +22 -23
- package/dist/{RootIndividualDetailsPage-Cfa9R28c.js → RootIndividualDetailsPage-BS5BgowF.js} +6 -6
- package/dist/{Select-C0Pp8Jeb.js → Select-BRK2a2V5.js} +92 -92
- package/dist/{SignPCIComponent-I3asF5GE.js → SignPCIComponent-B5JmN8BT.js} +14 -14
- package/dist/{SingpassSelection-C4Ptdwzb.js → SingpassSelection-B84oJmvG.js} +5 -5
- package/dist/{SoleProprietorshipPage-CiI2VKw_.js → SoleProprietorshipPage-C-jxJkmQ.js} +4 -4
- package/dist/{SourceOfFundsPage-DrJqgPMf.js → SourceOfFundsPage-C27vODL5.js} +24 -24
- package/dist/{SourceOfFundsWorkflow-tE06S4__.js → SourceOfFundsWorkflow-DOqaH_wk.js} +4 -4
- package/dist/StateField-CRLgYS1X.js +364 -0
- package/dist/{Step-CLZTcCEQ.js → Step-BTVKO9gW.js} +5 -5
- package/dist/Summary-C9Nr0dot.js +21 -0
- package/dist/{SummarySection-v-mSwYL0.js → SummarySection-D67yguze.js} +5 -19
- package/dist/{Task-CUr-Zb5N.js → Task-BaQ6wqz5.js} +7 -7
- package/dist/{TaskGroup-BGUboNOL.js → TaskGroup-C7lBWbYp.js} +3 -3
- package/dist/{TaskListItem-DMkmZn3B.js → TaskListItem-Cu3fSvOJ.js} +10 -10
- package/dist/{TaskStepperContextProvider-9wlnwii7.js → TaskStepperContextProvider-DiMf4UV6.js} +1 -1
- package/dist/{TaskVerificationStatus-zoxTZ2mt.js → TaskVerificationStatus-C1CllzL1.js} +17 -17
- package/dist/{TaxInformationFieldGroup-CraKcKMs.js → TaxInformationFieldGroup-vQoQHydJ.js} +7 -7
- package/dist/{TaxReportingDropin-B-ywMdBt.js → TaxReportingDropin-CTnL6VMm.js} +13 -15
- package/dist/{TaxReportingWorkflow-BmUdyOKl.js → TaxReportingWorkflow-5_eG0AcD.js} +4 -4
- package/dist/{TermsOfServiceManagement-D1Yv4Z5p.js → TermsOfServiceManagement-xL-xisqE.js} +46 -43
- package/dist/{TextArea-CyFcFhHo.js → TextArea-CcaUENX2.js} +4 -4
- package/dist/{TextField-D61xVlV2.js → TextField-fhhAQSKg.js} +5 -5
- package/dist/{TrustDetailsPage-D2FS-As0.js → TrustDetailsPage-DcNS-XWz.js} +61 -54
- package/dist/{TrustMemberCompanyPage-DDcSOUi2.js → TrustMemberCompanyPage-xtxgO6d4.js} +5 -5
- package/dist/{TrustMemberIndividualPage-CJBz1p3R.js → TrustMemberIndividualPage-BMWAg_eS.js} +4 -4
- package/dist/{TrustMemberRoleAndTypePage-OeN1HW_E.js → TrustMemberRoleAndTypePage-DR3pLJf9.js} +43 -36
- package/dist/{TrustMembersOverview-DkrEZL6_.js → TrustMembersOverview-D-jTaw37.js} +13 -13
- package/dist/{UboTaskItem-Dc6ExVuW.js → UboTaskItem-DsoetWEU.js} +7 -7
- package/dist/{UnincorporatedPartnershipIndividualPage-D0ZYvh8k.js → UnincorporatedPartnershipIndividualPage-3sSr2dCv.js} +4 -4
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-BtapkuO6.js → UnincorporatedPartnershipMemberCompanyPage-s6NiptRo.js} +5 -5
- package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-CbdYYTQT.js → UnincorporatedPartnershipMemberRoleAndTypePage-Cr6UEryR.js} +9 -9
- package/dist/{UnincorporatedPartnershipMembersOverview-Cs1DHVNP.js → UnincorporatedPartnershipMembersOverview-CbwWOxQs.js} +6 -6
- package/dist/{VerificationErrorAlert-D9sBE-Tj.js → VerificationErrorAlert-Bm7-u85-.js} +3 -3
- package/dist/{WebsiteField-BCoO-m_7.js → WebsiteField-DTlbxzaa.js} +5 -5
- package/dist/{Workflow-driWy_eJ.js → Workflow-DT43cTzE.js} +6 -6
- package/dist/{accountHolderUtils-BAbeRIOy.js → accountHolderUtils-D0E9se-W.js} +1 -1
- package/dist/adyen-business-financing.js +7 -7
- package/dist/adyen-individual-configuration.js +6 -6
- package/dist/adyen-individual-status.js +5 -5
- package/dist/adyen-invited-decision-maker.js +3 -3
- package/dist/adyen-onboarding.js +30 -30
- package/dist/adyen-terms-of-service-management.js +3 -3
- package/dist/adyen-terms-of-service-status.js +3 -3
- package/dist/adyen-transfer-instrument-configuration.js +5 -5
- package/dist/adyen-transfer-instrument-management.js +13 -13
- package/dist/adyen-verification-status.js +3 -3
- package/dist/{bafinUtils-COyCy9xG.js → bafinUtils-CvQzDDfD.js} +519 -531
- package/dist/{constants-fGRziJEH.js → constants-BOu8Hnt9.js} +6 -6
- package/dist/{dropinUtils-cIGIoJvF.js → dropinUtils-DfyQ8xFE.js} +165 -364
- package/dist/en-US-8KLaHQaT.js +7 -0
- package/dist/{en-US-Cz4JoU20.js → en-US-BMMx67Za.js} +16 -2
- package/dist/{en-US-nYL_eSJ-.js → en-US-BfRvYdHX.js} +8 -2
- package/dist/en-US-DGdFfmUC.js +136 -0
- package/dist/{en-US.instructions-BVNIyLRs.js → en-US.instructions-myDXMUbk.js} +2 -1
- package/dist/{error-B9rHWK9Q.js → error-CUHwmdwD.js} +2 -2
- package/dist/formatDataForSummary-BMFPIUER.js +498 -0
- package/dist/{formatValidationError-BJqU7LCU.js → formatValidationError-B5GNhAeh.js} +2 -2
- package/dist/{getDefaultRegistrationNumberType-BcV1GDOs.js → getDefaultRegistrationNumberType-CyaKz1Fj.js} +4 -4
- package/dist/{getProblemsForEntity-mdb3Bfpj.js → getProblemsForEntity-FHk416BA.js} +1 -1
- package/dist/{getTrustedDecisionMakers-D89oYOLp.js → getTrustedDecisionMakers-DByctgob.js} +1 -1
- package/dist/{getValidationError-dcpAlebZ.js → getValidationError-B4YX_EgR.js} +2 -2
- package/dist/{legalArrangementUtils-Crgt_L7h.js → legalArrangementUtils-CHlmmcB8.js} +11 -2
- package/dist/{mapAddressLocalizationToJpAddressSchema-B9pzYF3B.js → mapAddressLocalizationToJpAddressSchema-BrQMDBLX.js} +2 -2
- package/dist/{mapExistingFile-BXfeQxev.js → mapExistingFile-CqbTLZ6i.js} +1 -1
- package/dist/mapJpAddressSchemaToAddressLocalizations-BL4eAlDH.js +19 -0
- package/dist/{mapTransferInstrumentToPayoutAccount-Ba_L9EEB.js → mapTransferInstrumentToPayoutAccount-DhwdciyT.js} +2 -2
- package/dist/{processCapabilities-FL4-KAbd.js → processCapabilities-B75YIdXZ.js} +11 -4
- package/dist/{processValidationErrors-DWdgik5u.js → processValidationErrors-Dtt1FnM2.js} +4 -4
- package/dist/{resolveEnvironment-BnKqnU98.js → resolveEnvironment-CpWP_8og.js} +53 -16
- package/dist/roleMetadata-BW4HRw1l.js +57 -0
- package/dist/style.css +218 -230
- package/dist/styles-DYaAeu4q.js +218 -230
- package/dist/trustMemberType-Ix2sf6e_.js +13 -0
- package/dist/types/api/address/useAddressCleanse.d.ts +2 -0
- package/dist/types/api/address/useRetrieveAddress.d.ts +1 -0
- package/dist/types/api/address/useRetrieveFromPostcodeJp.d.ts +1 -0
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +7 -2
- package/dist/types/components/Business/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
- package/dist/types/components/Business/forms/rules.d.ts +3 -1
- package/dist/types/components/Business/utils/formatDataForSummary.d.ts +2 -1
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +78 -0
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +3 -0
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +2 -1
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +6 -3
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +3 -0
- package/dist/types/components/GlobalEntry/fields/DbaQuestionnaire/DbaQuestionnaire.d.ts +3 -0
- package/dist/types/components/GlobalEntry/fields/DbaQuestionnaire/types.d.ts +5 -0
- package/dist/types/components/GlobalEntry/fields/LlcQuestionnaire/LlcQuestionnaire.d.ts +3 -0
- package/dist/types/components/GlobalEntry/fields/LlcQuestionnaire/types.d.ts +5 -0
- package/dist/types/components/GlobalEntry/fields/PaperworkQuestionnaire/PaperworkQuestionnaire.d.ts +1 -6
- package/dist/types/components/GlobalEntry/fields/PaperworkQuestionnaire/fieldConfig.d.ts +11 -0
- package/dist/types/components/GlobalEntry/fields/PaperworkQuestionnaire/types.d.ts +6 -1
- package/dist/types/components/GlobalEntry/fields/Questionnaire/Questionnaire.d.ts +2 -0
- package/dist/types/components/GlobalEntry/fields/Questionnaire/types.d.ts +17 -0
- package/dist/types/components/GlobalEntry/fields/TrustQuestionnaire/TrustQuestionnaire.d.ts +3 -0
- package/dist/types/components/GlobalEntry/fields/TrustQuestionnaire/types.d.ts +5 -0
- package/dist/types/components/GlobalEntry/forms/EntityInformation/EntityInformation.d.ts +1 -3
- package/dist/types/components/GlobalEntry/forms/EntityInformation/types.d.ts +1 -2
- package/dist/types/components/GlobalEntry/forms/RegistrationInformation/types.d.ts +5 -1
- package/dist/types/components/GlobalEntry/mapping/globalEntryKeyMapping.d.ts +0 -3
- package/dist/types/components/GlobalEntry/mapping/mapGlobalEntrySchemaToLegalEntity.d.ts +2 -3
- package/dist/types/components/GlobalEntry/mapping/mapLegalEntityToGlobalEntrySchema.d.ts +1 -6
- package/dist/types/components/GlobalEntry/rules.d.ts +5 -2
- package/dist/types/components/GlobalEntry/utils/getAvailableCompanyStructures.d.ts +2 -1
- package/dist/types/components/GlobalEntry/utils/submitGlobalEntry.d.ts +1 -4
- package/dist/types/components/GlobalEntry/utils/utils.d.ts +7 -4
- package/dist/types/components/Individual/forms/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +1 -2
- package/dist/types/components/Individual/forms/Individual.rules.d.ts +7 -6
- package/dist/types/components/Individual/helpers/findRelevantTaxInformation.d.ts +8 -2
- package/dist/types/components/Individual/helpers/getSubmittableTaxInformation.d.ts +20 -0
- package/dist/types/components/Individual/mapping/mapIndividualSchemaToLegalEntity.d.ts +5 -3
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +6 -67
- package/dist/types/components/Individual/tasks/IndividualDropin/IndividualSummary.d.ts +27 -0
- package/dist/types/components/Individual/utils/formatDataForSummary.d.ts +49 -0
- package/dist/types/components/Shared/FormFlow/FormFlow.d.ts +1 -1
- package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +0 -5
- package/dist/types/components/Shared/Summary/Summary.d.ts +10 -7
- package/dist/types/components/Shared/Summary/types.d.ts +3 -21
- package/dist/types/components/Shared/SummarySection/SummaryBulletList.d.ts +8 -0
- package/dist/types/components/Shared/devex/DebugListener/DebugTheme.d.ts +2 -0
- package/dist/types/components/Shared/devex/DebugListener/customTheme.d.ts +49 -0
- package/dist/types/components/Shared/fields/RegistrationAndOperationalAddressFields/types.d.ts +2 -0
- package/dist/types/components/Shared/fields/RegistrationAndOperationalAddressFields/utils.d.ts +2 -4
- package/dist/types/components/Shared/fields/ReportedValueOptionField/types.d.ts +3 -0
- package/dist/types/components/Shared/forms/Address/constants.d.ts +2 -0
- package/dist/types/components/Shared/forms/Address/localized/jp/JpAddressFields.d.ts +2 -9
- package/dist/types/components/Shared/forms/Address/localized/jp/mapAddressLocalizationToJpAddressSchema.d.ts +2 -2
- package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSchemaToAddressLocalizations.d.ts +2 -2
- package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSummary.d.ts +2 -4
- package/dist/types/components/Shared/forms/Address/rules.d.ts +13 -0
- package/dist/types/components/Shared/forms/Address/types.d.ts +7 -1
- package/dist/types/components/Shared/forms/Address/utils.d.ts +5 -11
- package/dist/types/components/Trust/forms/Trust/rules.d.ts +3 -1
- package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +2 -3
- package/dist/types/components/Trust/utils/formatDataForSummary.d.ts +2 -1
- package/dist/types/core/EmbedShell/EmbedShell.d.ts +4 -1
- package/dist/types/core/EmbedShell/useTheme.d.ts +9 -0
- package/dist/types/embeds/onboarding/adyen-onboarding.d.ts +1 -1
- package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +8 -0
- package/dist/types/hooks/useStoredStateOrProvince.d.ts +9 -0
- package/dist/types/types/datasets/state-code.d.ts +36 -1
- package/dist/types/types/form-rules.d.ts +2 -2
- package/dist/types/utils/analytics/getPrefilledDetails.d.ts +3 -0
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/fieldConfigurations.d.ts +1 -1
- package/dist/types/utils/legalArrangementUtils.d.ts +2 -0
- package/dist/{types-BymnGWO9.js → types-DVMWWwBT.js} +1 -1
- package/dist/{form-rules-CZbkNMEw.js → unincorporatedPartnership-CiU2fnqv.js} +38 -4
- package/dist/{useBusinessDetailsData-BJau7oMt.js → useBusinessDetailsData-BtEHoBoN.js} +100 -90
- package/dist/{useCanSeeIntroduction-BQuCt-eO.js → useCanSeeIntroduction-kxOGIxnh.js} +2 -2
- package/dist/useCreateLegalEntity-CgzVD39K.js +24 -0
- package/dist/{useDataMissingRemediations-DKjYzfe2.js → useDataMissingRemediations-BfC7ECSn.js} +1 -1
- package/dist/{useForm-VDjedfk9.js → useForm-CiHfxEX0.js} +3 -3
- package/dist/{useHideTaskStepper-BgCN--mG.js → useHideTaskStepper-Betx9MGy.js} +1 -1
- package/dist/{useId-Cs-bSalH.js → useId-ChrmzN7R.js} +2 -2
- package/dist/{useNavigate-CKp2oemi.js → useNavigate-xbrKpFCu.js} +33 -33
- package/dist/{useSalesChannels-D0q-Vat7.js → useSalesChannels-C2qQmPGf.js} +1 -1
- package/dist/{useTaskLandedEvent-QBmeEeS6.js → useTaskLandedEvent-Brv74FDb.js} +1 -1
- package/dist/{useTrustMembers-COumqoMC.js → useTrustMembers-BA5fCul_.js} +3 -3
- package/dist/{useUnincorporatedPartnershipMembers-DcfQJdVZ.js → useUnincorporatedPartnershipMembers-J6rxK5Ie.js} +2 -2
- package/dist/{utils-BFxg3gPM.js → utils-ChZNfG5_.js} +1 -1
- package/dist/{utils-BiPEtEaV.js → utils-ClAXyRqf.js} +4 -5
- package/dist/{utils-B6TRzLRs.js → utils-Do6-kryk.js} +3 -3
- package/dist/utils-VV2acmQG.js +49 -0
- package/dist/{validate-Dt3Xmp_L.js → validate-BHOzYoxU.js} +26 -2
- package/dist/{validate-BN38Qq-w.js → validate-D5990ODb.js} +20 -9
- package/dist/{validate-D3JIeysp.js → validate-Dtiozjlb.js} +4 -4
- package/dist/{validate-_7WKym8c.js → validate-NJNmUaTh.js} +11 -5
- package/dist/{validateExtractionResult-IRRMwcNi.js → validateExtractionResult-D3AuQo5-.js} +3 -3
- package/package.json +6 -5
- package/dist/Image-CxnjHtP1.js +0 -33
- package/dist/List-qvNxW9lm.js +0 -72
- package/dist/StateField-BBGSo1NG.js +0 -296
- package/dist/en-US-U0d3NI20.js +0 -7
- package/dist/mapJpAddressSchemaToAddressLocalizations-kHaGv8kC.js +0 -75
- package/dist/mapLegalEntityToIndividualSchema-D6qGKj-2.js +0 -254
- package/dist/trustMemberGuidance-BpeDHAJP.js +0 -27
- package/dist/types/components/Shared/NewSummary/NewSummary.d.ts +0 -10
- package/dist/types/components/Shared/Summary/summaryItem.d.ts +0 -17
- package/dist/types/components/Shared/forms/Address/localized/jp/jpAddressSchema.d.ts +0 -17
- package/dist/unincorporatedPartnership-BbNowjM2.js +0 -11
|
@@ -1,41 +1,40 @@
|
|
|
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] = "9cd4a731-32bf-4407-9bc3-10af39f1116b", e._sentryDebugIdIdentifier = "sentry-dbid-9cd4a731-32bf-4407-9bc3-10af39f1116b");
|
|
4
4
|
} catch (e) {}
|
|
5
5
|
import { n as addResourceBundles, r as useTranslation } from "./translation-CpH8D2NK.js";
|
|
6
|
-
import {
|
|
6
|
+
import { C as Alert, M as _rolldown_dynamic_import_helper_default, O as useAllowedCountries, gt as useAccountHolder, j as Header, ot as isEmpty } from "./resolveEnvironment-CpWP_8og.js";
|
|
7
7
|
import { t as createLogger } from "./logger-Z8AeTE4x.js";
|
|
8
8
|
import { t as Typography } from "./Typography-CAc_f5Iq.js";
|
|
9
9
|
import { t as Loader } from "./Loader-BDaKGf77.js";
|
|
10
|
-
import { t as Button } from "./Button-
|
|
10
|
+
import { t as Button } from "./Button-BYafPrZH.js";
|
|
11
11
|
import { s as useApiContext } from "./http-C8rt2BZk.js";
|
|
12
12
|
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-BK-HHa65.js";
|
|
13
13
|
import { t as useSettingsContext } from "./useSettingsContext-Bpf4UqRT.js";
|
|
14
14
|
import { s as keysOf } from "./genUtils-nphCwt1A.js";
|
|
15
15
|
import { t as StackLayout } from "./StackLayout-J1ynSX-P.js";
|
|
16
16
|
import { t as CountryCodes } from "./country-code-CJk2hdPu.js";
|
|
17
|
-
import { y as reverseMapping } from "./processCapabilities-
|
|
17
|
+
import { y as reverseMapping } from "./processCapabilities-B75YIdXZ.js";
|
|
18
18
|
import { t as TaskTypes } from "./taskTypes-3vSkMBDm.js";
|
|
19
19
|
import { f as hasSolePropInLegalEntity, s as getOwnEntityAssociations } from "./entityAssociationUtil-BlfcBl3i.js";
|
|
20
|
-
import { i as useToggleContext, r as useDebouncedCallback } from "./Checkbox-
|
|
21
|
-
import { i as useAnalyticsContext } from "./Modal-
|
|
22
|
-
import { t as InputText } from "./InputText-
|
|
23
|
-
import { t as ListItem } from "./ListItem-
|
|
24
|
-
import {
|
|
20
|
+
import { i as useToggleContext, r as useDebouncedCallback } from "./Checkbox-DXF-eRBj.js";
|
|
21
|
+
import { i as useAnalyticsContext } from "./Modal-jjSjdW5W.js";
|
|
22
|
+
import { t as InputText } from "./InputText-OCbzlaaN.js";
|
|
23
|
+
import { t as ListItem } from "./ListItem-n927geYb.js";
|
|
24
|
+
import { t as getFormSlice } from "./getFormSlice-CxtXJ0-P.js";
|
|
25
25
|
import { t as Card } from "./Card-BCGLpdw7.js";
|
|
26
|
-
import { r as useToastContext } from "./useId-
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { o as StructuredList, r as formatObject, s as Confirm } from "./utils-
|
|
30
|
-
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
|
|
31
|
-
import { d as COUNTRIES_WITH_STATES_DATASET,
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { a as
|
|
36
|
-
import { a as defaultFieldMetadata, i as defaultFieldConfigV4, o as defaultFieldMetadataV4, r as defaultFieldConfig, t as LEGAL_COMPANY_NAME_FIELD } from "./LegalCompanyNameField-
|
|
37
|
-
import { n as BusinessRegistrationNumberField, t as BUSINESS_REGISTRATION_NUMBER_FIELD } from "./BusinessRegistrationNumberField-
|
|
38
|
-
import { r as SOLE_PROP_COUNTRIES, t as ALLOWED_UNINCORPORATED_PARTNERSHIP_COUNTRIES } from "./legalArrangementUtils-Crgt_L7h.js";
|
|
26
|
+
import { r as useToastContext } from "./useId-ChrmzN7R.js";
|
|
27
|
+
import { a as resolveFieldMetadata, c as getPropsFromConfigurations, r as createFormRules } from "./unincorporatedPartnership-CiU2fnqv.js";
|
|
28
|
+
import { o as Field, p as LoaderWrapper } from "./Select-BRK2a2V5.js";
|
|
29
|
+
import { o as StructuredList, r as formatObject, s as Confirm } from "./utils-Do6-kryk.js";
|
|
30
|
+
import { a as CountryOfGoverningLawField, c as useCompanyTypeExamples, d as companySearchQueryOptions, f as useCompanySearch, h as useClearCompanyData, i as COUNTRY_OF_GOVERNING_LAW_FIELD, l as useCompanySelection, m as useStoredStateOrProvince, n as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, o as useLegalCompanyNameField, p as trackPerformance, r as isNormalizedStringMatch, t as CountryOfGoverningLawFieldValidation, u as verifyTinQueryOptions } from "./validate-D5990ODb.js";
|
|
31
|
+
import { d as COUNTRIES_WITH_STATES_DATASET, h as useUpdateLegalEntity, n as StateField, p as isJapanLocalizationEnabled, r as stateFieldMetadata, t as STATE_FIELD } from "./StateField-CRLgYS1X.js";
|
|
32
|
+
import { R as useMultiForm, U as summaryStep, V as useFormComposer, W as FormContextProvider, b as useFormContext, c as List, l as COUNTRY_FIELD, p as isBusinessSelectionLegalArrangementError, t as addValidityToForms, u as CountryField, v as createFormUtils, x as FormFlow } from "./dropinUtils-DfyQ8xFE.js";
|
|
33
|
+
import { D as COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER, E as COUNTRIES_USING_COMPANY_SEARCH, F as isRegistrationNumberAbsentStateV4Scenario, H as getValidCompanyTypesForTaxIdNumberType, L as mapJapaneseLegalNamesToLocalization, M as REGISTRATION_NUMBER_EXEMPTION_RULES, N as TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION, P as isRegistrationExemptionAllowed, R as mapLocalizationToJapaneseLegalNames, S as COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION, T as COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT, W as TileGroup, _ as getTaxInformationPlaceholderText, c as DataConflictsModal, j as COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4, k as COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES, l as TAX_INFORMATION_FIELD, u as TaxInformationField, v as taxInformationDefaultFieldConfig, y as taxInformationDefaultFieldMetadata } from "./bafinUtils-CvQzDDfD.js";
|
|
34
|
+
import { a as getValidCompanyTypesForRegistrationNumberType, l as registrationNumberDefaultFieldConfig, r as inferCompanyRegistrationNumberType, u as registrationNumberDefaultFieldMetadata } from "./getDefaultRegistrationNumberType-CyaKz1Fj.js";
|
|
35
|
+
import { a as TRUST_COUNTRIES, i as SOLE_PROP_COUNTRIES, n as INDIVIDUALS_WHO_TRADE_COUNTRIES, t as ALLOWED_UNINCORPORATED_PARTNERSHIP_COUNTRIES } from "./legalArrangementUtils-CHlmmcB8.js";
|
|
36
|
+
import { a as defaultFieldMetadata, i as defaultFieldConfigV4, o as defaultFieldMetadataV4, r as defaultFieldConfig, t as LEGAL_COMPANY_NAME_FIELD } from "./LegalCompanyNameField-Yj5Fa3-I.js";
|
|
37
|
+
import { n as BusinessRegistrationNumberField, t as BUSINESS_REGISTRATION_NUMBER_FIELD } from "./BusinessRegistrationNumberField-B6w6LvSZ.js";
|
|
39
38
|
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
40
39
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
41
40
|
import { createModel, signal, useModel, useSignal } from "@preact/signals";
|
|
@@ -234,7 +233,7 @@ function BusinessSelection({ id, country }) {
|
|
|
234
233
|
const { data: companySearchResponse, isLoading: searching } = useCompanySearch({
|
|
235
234
|
name: companySearchStateModel.companySearchName.value ?? "",
|
|
236
235
|
country,
|
|
237
|
-
state: form.data.
|
|
236
|
+
state: form.data.registrationInformation?.stateOrProvince,
|
|
238
237
|
registrationNumber: form.data.registrationInformation?.registrationNumber
|
|
239
238
|
});
|
|
240
239
|
const { data: selectData, error: selectError, mutateAsync: selectCompany, reset: resetSelectMutationState } = useCompanySelection();
|
|
@@ -381,7 +380,8 @@ var companyTypeMetadata = {
|
|
|
381
380
|
var companyTypeOptions = Object.keys(companyTypeMetadata);
|
|
382
381
|
//#endregion
|
|
383
382
|
//#region src/components/GlobalEntry/utils/getAvailableCompanyStructures.ts
|
|
384
|
-
function getAvailableCompanyStructures({ country, registrationNumberType, registrationNumberExempt, taxIdNumberType, legalEntity }) {
|
|
383
|
+
function getAvailableCompanyStructures({ country, registrationNumberType, registrationNumberExempt, taxIdNumberType, legalEntity, isSingleMemberLlc }) {
|
|
384
|
+
if (isSingleMemberLlc) return ["privateCompany"];
|
|
385
385
|
const companyTypeRadioOptions = !!legalEntity.capabilities?.issueBankAccount?.requested ? companyTypeOptions.filter((companyType) => companyType !== "governmentalOrganization") : companyTypeOptions;
|
|
386
386
|
const validCompanyTypesByRegistrationNumber = registrationNumberExempt && isRegistrationExemptionAllowed({ country }) ? REGISTRATION_NUMBER_EXEMPTION_RULES[country] ?? [] : getValidCompanyTypesForRegistrationNumberType(country, registrationNumberType);
|
|
387
387
|
const validCompanyTypesForRegistrationNumber = new Set(validCompanyTypesByRegistrationNumber);
|
|
@@ -390,6 +390,60 @@ function getAvailableCompanyStructures({ country, registrationNumberType, regist
|
|
|
390
390
|
return constrainedCompanyTypeRadioOptions.length > 0 ? constrainedCompanyTypeRadioOptions : companyTypeRadioOptions;
|
|
391
391
|
}
|
|
392
392
|
//#endregion
|
|
393
|
+
//#region src/components/GlobalEntry/utils/utils.ts
|
|
394
|
+
var getGlobalEntryCompanyType = (legalEntity, data) => {
|
|
395
|
+
if (data.entityInformation.entitySetup === "partOfABusiness" || isSingleMemberLLC(data)) return data.companyStructure?.organizationType ?? legalEntity?.organization?.type;
|
|
396
|
+
if (data.entityInformation.entitySetup === "justMe") {
|
|
397
|
+
const hasSoleProprietorshipAssociation = legalEntity && hasSolePropInLegalEntity(legalEntity);
|
|
398
|
+
return data.registrationInformation?.filedPaperwork === "yes" || hasSoleProprietorshipAssociation ? "soleProprietorship" : void 0;
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
var isPaperworkQuestionAsked = (data) => {
|
|
402
|
+
const { country, entitySetup } = data.entityInformation ?? {};
|
|
403
|
+
if (!country) return false;
|
|
404
|
+
if (entitySetup === "partOfABusiness") return ALLOWED_UNINCORPORATED_PARTNERSHIP_COUNTRIES.includes(country);
|
|
405
|
+
return entitySetup === "justMe" && SOLE_PROP_COUNTRIES.includes(country);
|
|
406
|
+
};
|
|
407
|
+
var getFiledPaperwork = (data) => {
|
|
408
|
+
if (isPaperworkQuestionAsked(data)) return data.registrationInformation?.filedPaperwork ?? null;
|
|
409
|
+
return data.entityInformation?.entitySetup === "partOfABusiness" ? "yes" : "no";
|
|
410
|
+
};
|
|
411
|
+
var isTrustQuestionAsked = (data) => data.entityInformation.entitySetup === "partOfABusiness" && getFiledPaperwork(data) === "yes" && !!data.entityInformation.country && TRUST_COUNTRIES.includes(data.entityInformation.country);
|
|
412
|
+
var isSingleMemberLLC = (data) => data.entityInformation?.entitySetup === "justMe" && data.entityInformation.country === CountryCodes.UnitedStates && data.registrationInformation?.isLimitedLiabilityCorporation === "yes";
|
|
413
|
+
var isUsingCompanySearch = (data) => {
|
|
414
|
+
const country = data.entityInformation.country;
|
|
415
|
+
return !!country && COUNTRIES_USING_COMPANY_SEARCH.includes(country) && (data.entityInformation.entitySetup === "partOfABusiness" && getFiledPaperwork(data) === "yes" || isSingleMemberLLC(data));
|
|
416
|
+
};
|
|
417
|
+
var isUnincorporatedPartnership = (data) => data.entityInformation?.entitySetup === "partOfABusiness" && getFiledPaperwork(data) === "no" && data.registrationInformation?.unincorporatedOrganizationType === "unincorporatedPartnership";
|
|
418
|
+
var isTrust = (data) => data.entityInformation?.entitySetup === "partOfABusiness" && getFiledPaperwork(data) === "yes" && data.registrationInformation?.isTrust === "yes";
|
|
419
|
+
/**
|
|
420
|
+
* `justMe` is a natural person unless they represent a single-member LLC. Being part of a business
|
|
421
|
+
* only makes the entity an `organization` when the primary partner is not an individual, because an
|
|
422
|
+
* individual partner in an unincorporated partnership stays an individual legal entity.
|
|
423
|
+
*/
|
|
424
|
+
var determineLegalEntityType = (data) => isSingleMemberLLC(data) || data.entityInformation?.entitySetup === "partOfABusiness" && data.primaryPartner?.primaryPartnerType !== "individual" ? "organization" : "individual";
|
|
425
|
+
/**
|
|
426
|
+
* The account holder is derived from the form data, not sent to the API and is kept client-side.
|
|
427
|
+
*/
|
|
428
|
+
var determineAccountHolder = (data) => {
|
|
429
|
+
const entitySetup = data.entityInformation?.entitySetup;
|
|
430
|
+
/** Derived, because the question is not put to the user in every country */
|
|
431
|
+
const filedPaperwork = getFiledPaperwork(data);
|
|
432
|
+
if (isSingleMemberLLC(data)) return "theCompanyIWorkFor";
|
|
433
|
+
if (isTrustQuestionAsked(data) && data.registrationInformation.isTrust === "yes") return "aTrust";
|
|
434
|
+
if (entitySetup === "justMe") return filedPaperwork === "yes" ? "mySoleProprietorName" : "myName";
|
|
435
|
+
if (entitySetup === "partOfABusiness") {
|
|
436
|
+
if (isUnincorporatedPartnership(data)) return "anUnincorporatedPartnership";
|
|
437
|
+
if (isTrust(data)) return "aTrust";
|
|
438
|
+
if (filedPaperwork === "yes") return "theCompanyIWorkFor";
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
var determineEntityAssociations = (data, accountHolder, legalEntity) => {
|
|
442
|
+
const ownAssociations = getOwnEntityAssociations(legalEntity);
|
|
443
|
+
if (!ownAssociations || ownAssociations.length === 0) return;
|
|
444
|
+
return accountHolder !== determineAccountHolder(data) ? [] : void 0;
|
|
445
|
+
};
|
|
446
|
+
//#endregion
|
|
393
447
|
//#region src/components/GlobalEntry/forms/CompanyStructure/CompanyStructure.tsx
|
|
394
448
|
var COMPANY_STRUCTURE_FIELDS = ["organizationType"];
|
|
395
449
|
function CompanyStructure({ id, country, legalEntity }) {
|
|
@@ -407,7 +461,8 @@ function CompanyStructure({ id, country, legalEntity }) {
|
|
|
407
461
|
registrationNumberType: registrationInformation?.registrationNumberType,
|
|
408
462
|
registrationNumberExempt: registrationInformation?.exemptedFromRegistrationNumber,
|
|
409
463
|
taxIdNumberType: registrationInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type,
|
|
410
|
-
legalEntity
|
|
464
|
+
legalEntity,
|
|
465
|
+
isSingleMemberLlc: isSingleMemberLLC(form.data)
|
|
411
466
|
});
|
|
412
467
|
const companyTypeExamples = useCompanyTypeExamples(country);
|
|
413
468
|
const tiles = options.filter((option) => !!companyTypeMetadata[option]).map((option) => {
|
|
@@ -499,12 +554,8 @@ var EntitySetupField = ({ data, valid, errors, handleChangeFor }) => {
|
|
|
499
554
|
};
|
|
500
555
|
//#endregion
|
|
501
556
|
//#region src/components/GlobalEntry/forms/EntityInformation/EntityInformation.tsx
|
|
502
|
-
var ENTITY_INFORMATION_FIELDS = [
|
|
503
|
-
|
|
504
|
-
...STATE_FIELD,
|
|
505
|
-
...ENTITY_SETUP_FIELD
|
|
506
|
-
];
|
|
507
|
-
var EntityInformation = ({ id, country }) => {
|
|
557
|
+
var ENTITY_INFORMATION_FIELDS = [...COUNTRY_FIELD, ...ENTITY_SETUP_FIELD];
|
|
558
|
+
var EntityInformation = ({ id }) => {
|
|
508
559
|
const { form } = useFormContext();
|
|
509
560
|
const { t: commonT } = useTranslation("common");
|
|
510
561
|
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
@@ -515,7 +566,6 @@ var EntityInformation = ({ id, country }) => {
|
|
|
515
566
|
optionalFields,
|
|
516
567
|
trustedFields
|
|
517
568
|
}, commonT);
|
|
518
|
-
const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
|
|
519
569
|
return /* @__PURE__ */ jsxs("form", {
|
|
520
570
|
id,
|
|
521
571
|
children: [
|
|
@@ -532,15 +582,6 @@ var EntityInformation = ({ id, country }) => {
|
|
|
532
582
|
allowedCountries,
|
|
533
583
|
handleChangeFor
|
|
534
584
|
}),
|
|
535
|
-
showField(STATE_FIELD) && /* @__PURE__ */ jsx(StateField, {
|
|
536
|
-
data: { stateOrProvince: data?.stateOrProvince },
|
|
537
|
-
valid: { stateOrProvince: valid?.stateOrProvince },
|
|
538
|
-
errors: { stateOrProvince: formUtils.getErrorMessage("stateOrProvince", errors, fieldProblems) },
|
|
539
|
-
selectedCountry: country,
|
|
540
|
-
readonly: false,
|
|
541
|
-
handleChangeFor,
|
|
542
|
-
labelOverride: commonT(($) => $["whereIsYourBusinessRegistered"])
|
|
543
|
-
}),
|
|
544
585
|
/* @__PURE__ */ jsx(EntitySetupField, {
|
|
545
586
|
data: { entitySetup: data?.entitySetup },
|
|
546
587
|
valid: { entitySetup: valid?.entitySetup },
|
|
@@ -622,41 +663,186 @@ var PrimaryPartner = ({ id }) => {
|
|
|
622
663
|
});
|
|
623
664
|
};
|
|
624
665
|
//#endregion
|
|
625
|
-
//#region src/components/GlobalEntry/fields/
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
* The paperwork answer dictates whether the entity is:
|
|
629
|
-
* A) a pure individual or a sole prop, or
|
|
630
|
-
* B) a registered business or an unincorporated partnership.
|
|
631
|
-
*/
|
|
632
|
-
function PaperworkQuestionnaire({ data, valid, handleChangeFor, errors, label }) {
|
|
633
|
-
const { t } = useTranslation(["globalEntry", "common"]);
|
|
666
|
+
//#region src/components/GlobalEntry/fields/Questionnaire/Questionnaire.tsx
|
|
667
|
+
function Questionnaire({ name, label, helper, selected, tiles, isValid, errorMessage, isHorizontal, onChange, onHelpClick }) {
|
|
668
|
+
const { t } = useTranslation("common");
|
|
634
669
|
return /* @__PURE__ */ jsx(Field, {
|
|
635
670
|
el: "fieldset",
|
|
636
|
-
name
|
|
671
|
+
name,
|
|
637
672
|
label,
|
|
638
|
-
|
|
639
|
-
|
|
673
|
+
helper,
|
|
674
|
+
isValid,
|
|
675
|
+
errorMessage,
|
|
640
676
|
children: () => /* @__PURE__ */ jsxs(StackLayout, { children: [/* @__PURE__ */ jsx(Button, {
|
|
641
677
|
variant: "link",
|
|
642
|
-
onClick: () =>
|
|
643
|
-
children: /* @__PURE__ */ jsx(Typography, { children: t(($) => $["whatDoesThisMean"]
|
|
678
|
+
onClick: () => onHelpClick?.(),
|
|
679
|
+
children: /* @__PURE__ */ jsx(Typography, { children: t(($) => $["whatDoesThisMean"]) })
|
|
644
680
|
}), /* @__PURE__ */ jsx(TileGroup, {
|
|
645
|
-
name
|
|
646
|
-
selected:
|
|
647
|
-
isHorizontal
|
|
648
|
-
onChange
|
|
649
|
-
tiles
|
|
650
|
-
label: t(($) => $["yes"], { ns: "common" }),
|
|
651
|
-
value: "yes"
|
|
652
|
-
}, {
|
|
653
|
-
label: t(($) => $["no"], { ns: "common" }),
|
|
654
|
-
value: "no"
|
|
655
|
-
}]
|
|
681
|
+
name,
|
|
682
|
+
selected: selected ?? "",
|
|
683
|
+
isHorizontal,
|
|
684
|
+
onChange,
|
|
685
|
+
tiles
|
|
656
686
|
})] })
|
|
657
687
|
});
|
|
658
688
|
}
|
|
659
689
|
//#endregion
|
|
690
|
+
//#region src/components/GlobalEntry/fields/DbaQuestionnaire/DbaQuestionnaire.tsx
|
|
691
|
+
var DBA_QUESTIONNAIRE_FIELD = ["doingBusinessAs"];
|
|
692
|
+
function DbaQuestionnaire({ data, valid, errors, handleChangeFor }) {
|
|
693
|
+
const { t: commonT } = useTranslation("common");
|
|
694
|
+
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
695
|
+
return /* @__PURE__ */ jsx(Questionnaire, {
|
|
696
|
+
name: "doingBusinessAs",
|
|
697
|
+
label: globalEntryT(($) => $["doYouUseABusinessNameThatsDifferentFromYourLegalName"]),
|
|
698
|
+
helper: globalEntryT(($) => $["thisIsAlsoCalledATradingNameOperatingNameOrDoingBusinessAs"]),
|
|
699
|
+
selected: data.doingBusinessAs,
|
|
700
|
+
isValid: valid.doingBusinessAs,
|
|
701
|
+
errorMessage: errors.doingBusinessAs,
|
|
702
|
+
isHorizontal: true,
|
|
703
|
+
onChange: handleChangeFor("doingBusinessAs"),
|
|
704
|
+
tiles: [{
|
|
705
|
+
label: commonT(($) => $["yes"]),
|
|
706
|
+
value: "yes"
|
|
707
|
+
}, {
|
|
708
|
+
label: commonT(($) => $["no"]),
|
|
709
|
+
value: "no"
|
|
710
|
+
}]
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
//#endregion
|
|
714
|
+
//#region src/components/GlobalEntry/fields/LlcQuestionnaire/LlcQuestionnaire.tsx
|
|
715
|
+
var LLC_QUESTIONNAIRE_FIELD = ["isLimitedLiabilityCorporation"];
|
|
716
|
+
function LlcQuestionnaire({ data, valid, errors, handleChangeFor }) {
|
|
717
|
+
const { t: commonT } = useTranslation("common");
|
|
718
|
+
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
719
|
+
return /* @__PURE__ */ jsx(Questionnaire, {
|
|
720
|
+
name: "isLimitedLiabilityCorporation",
|
|
721
|
+
label: globalEntryT(($) => $["isYourBusinessRegisteredAsALimitedLiabilityCorporation"]),
|
|
722
|
+
selected: data.isLimitedLiabilityCorporation,
|
|
723
|
+
isValid: valid.isLimitedLiabilityCorporation,
|
|
724
|
+
errorMessage: errors.isLimitedLiabilityCorporation,
|
|
725
|
+
isHorizontal: true,
|
|
726
|
+
onChange: handleChangeFor("isLimitedLiabilityCorporation"),
|
|
727
|
+
tiles: [{
|
|
728
|
+
label: commonT(($) => $["yes"]),
|
|
729
|
+
value: "yes"
|
|
730
|
+
}, {
|
|
731
|
+
label: commonT(($) => $["no"]),
|
|
732
|
+
value: "no"
|
|
733
|
+
}]
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/components/GlobalEntry/fields/PaperworkQuestionnaire/fieldConfig.ts
|
|
738
|
+
var paperworkQuestionnaireDefaultFieldConfig = ({ entitySetup }) => {
|
|
739
|
+
switch (entitySetup) {
|
|
740
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithAGovernmentAuthority" };
|
|
741
|
+
default: return { label: "areYourBusinessActivitiesRegisteredWithAGovernmentAuthority" };
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
var paperworkQuestionnaireFieldConfig = {
|
|
745
|
+
[CountryCodes.Australia]: ({ entitySetup }) => {
|
|
746
|
+
switch (entitySetup) {
|
|
747
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithAGovernmentAuthority" };
|
|
748
|
+
default: return { label: "haveYouRegisteredYourIndividualBusiness" };
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
[CountryCodes.Canada]: ({ entitySetup }) => {
|
|
752
|
+
switch (entitySetup) {
|
|
753
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithAGovernmentAuthority" };
|
|
754
|
+
default: return { label: "haveYouRegisteredYourIndividualBusiness" };
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
[CountryCodes.France]: ({ entitySetup }) => {
|
|
758
|
+
switch (entitySetup) {
|
|
759
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithTheINPI" };
|
|
760
|
+
default: return { label: "areYouRegisteredAsAnAutoOrMicroEntrepreneur" };
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
[CountryCodes.Germany]: ({ entitySetup }) => {
|
|
764
|
+
switch (entitySetup) {
|
|
765
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithTheHandelregister" };
|
|
766
|
+
default: return { label: "areYouRegisteredAsAFreiberufler" };
|
|
767
|
+
}
|
|
768
|
+
},
|
|
769
|
+
[CountryCodes.Mexico]: () => {
|
|
770
|
+
return { label: "areYouRegisteredAsAPersonaFisica" };
|
|
771
|
+
},
|
|
772
|
+
[CountryCodes.Netherlands]: ({ entitySetup }) => {
|
|
773
|
+
switch (entitySetup) {
|
|
774
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithAGovernmentAuthority" };
|
|
775
|
+
default: return { label: "haveYouRegisteredYourIndividualBusiness" };
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
[CountryCodes.Singapore]: ({ entitySetup }) => {
|
|
779
|
+
switch (entitySetup) {
|
|
780
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithAGovernmentAuthority" };
|
|
781
|
+
default: return { label: "haveYouRegisteredYourIndividualBusiness" };
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
[CountryCodes.UnitedKingdom]: ({ entitySetup }) => {
|
|
785
|
+
switch (entitySetup) {
|
|
786
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithCompaniesHouse" };
|
|
787
|
+
default: return { label: "areYouRegisteredAsASoleTrader" };
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
[CountryCodes.UnitedStates]: ({ entitySetup }) => {
|
|
791
|
+
switch (entitySetup) {
|
|
792
|
+
case "partOfABusiness": return { label: "hasYourOrganizationFiledRegistrationPaperworkWithAStateAgency" };
|
|
793
|
+
default: return { label: "doYouHaveAnEin" };
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/components/GlobalEntry/fields/PaperworkQuestionnaire/PaperworkQuestionnaire.tsx
|
|
799
|
+
var PAPERWORK_QUESTIONNAIRE_FIELD = ["filedPaperwork"];
|
|
800
|
+
function PaperworkQuestionnaire({ data, valid, handleChangeFor, errors, country, entitySetup }) {
|
|
801
|
+
const { t: commonT } = useTranslation("common");
|
|
802
|
+
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
803
|
+
const { label } = resolveFieldMetadata(paperworkQuestionnaireFieldConfig[country], { entitySetup }, paperworkQuestionnaireDefaultFieldConfig({ entitySetup }));
|
|
804
|
+
return /* @__PURE__ */ jsx(Questionnaire, {
|
|
805
|
+
name: "filedPaperwork",
|
|
806
|
+
label: label ? globalEntryT(($) => $[label]) : void 0,
|
|
807
|
+
selected: data.filedPaperwork,
|
|
808
|
+
isValid: valid.filedPaperwork,
|
|
809
|
+
errorMessage: errors.filedPaperwork,
|
|
810
|
+
isHorizontal: true,
|
|
811
|
+
onChange: handleChangeFor("filedPaperwork"),
|
|
812
|
+
onHelpClick: () => {},
|
|
813
|
+
tiles: [{
|
|
814
|
+
label: commonT(($) => $["yes"]),
|
|
815
|
+
value: "yes"
|
|
816
|
+
}, {
|
|
817
|
+
label: commonT(($) => $["no"]),
|
|
818
|
+
value: "no"
|
|
819
|
+
}]
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region src/components/GlobalEntry/fields/TrustQuestionnaire/TrustQuestionnaire.tsx
|
|
824
|
+
var TRUST_QUESTIONNAIRE_FIELD = ["isTrust"];
|
|
825
|
+
function TrustQuestionnaire({ data, valid, errors, handleChangeFor }) {
|
|
826
|
+
const { t: commonT } = useTranslation("common");
|
|
827
|
+
const { t: globalEntryT } = useTranslation("globalEntry");
|
|
828
|
+
return /* @__PURE__ */ jsx(Questionnaire, {
|
|
829
|
+
name: "isTrust",
|
|
830
|
+
label: globalEntryT(($) => $["isYourOrganizationATrust"]),
|
|
831
|
+
selected: data.isTrust,
|
|
832
|
+
isValid: valid.isTrust,
|
|
833
|
+
errorMessage: errors.isTrust,
|
|
834
|
+
isHorizontal: true,
|
|
835
|
+
onChange: handleChangeFor("isTrust"),
|
|
836
|
+
tiles: [{
|
|
837
|
+
label: commonT(($) => $["yes"]),
|
|
838
|
+
value: "yes"
|
|
839
|
+
}, {
|
|
840
|
+
label: commonT(($) => $["no"]),
|
|
841
|
+
value: "no"
|
|
842
|
+
}]
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
//#endregion
|
|
660
846
|
//#region src/components/GlobalEntry/fields/UnincorporatedOrganizationTypeField/UnincorporatedOrganizationTypeField.tsx
|
|
661
847
|
var UNINCORPORATED_ORGANIZATION_TYPE_FIELD = ["unincorporatedOrganizationType"];
|
|
662
848
|
var UnincorporatedOrganizationTypeField = ({ data, valid, errors, handleChangeFor }) => {
|
|
@@ -670,23 +856,15 @@ var UnincorporatedOrganizationTypeField = ({ data, valid, errors, handleChangeFo
|
|
|
670
856
|
value: "unincorporatedAssociation",
|
|
671
857
|
icon: "trust"
|
|
672
858
|
}];
|
|
673
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
674
|
-
el: "fieldset",
|
|
859
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Questionnaire, {
|
|
675
860
|
name: "unincorporatedOrganizationType",
|
|
676
861
|
label: t(($) => $["whichBestDescribesYourOrganization"]),
|
|
677
862
|
errorMessage: errors.unincorporatedOrganizationType,
|
|
678
863
|
isValid: valid?.unincorporatedOrganizationType,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}), /* @__PURE__ */ jsx(TileGroup, {
|
|
684
|
-
name: "unincorporatedOrganizationType",
|
|
685
|
-
selected: data?.unincorporatedOrganizationType ?? "",
|
|
686
|
-
onChange: (value) => handleChangeFor("unincorporatedOrganizationType")(value),
|
|
687
|
-
tiles,
|
|
688
|
-
isHorizontal: true
|
|
689
|
-
})] })
|
|
864
|
+
selected: data?.unincorporatedOrganizationType,
|
|
865
|
+
onChange: handleChangeFor("unincorporatedOrganizationType"),
|
|
866
|
+
tiles,
|
|
867
|
+
isHorizontal: true
|
|
690
868
|
}), data?.unincorporatedOrganizationType === "unincorporatedAssociation" && /* @__PURE__ */ jsx(Alert, {
|
|
691
869
|
variant: "error",
|
|
692
870
|
title: t(($) => $["unincorporatedAssociationsArentSupported"]),
|
|
@@ -697,63 +875,17 @@ var UnincorporatedOrganizationTypeField = ({ data, valid, errors, handleChangeFo
|
|
|
697
875
|
})] });
|
|
698
876
|
};
|
|
699
877
|
//#endregion
|
|
700
|
-
//#region src/components/GlobalEntry/utils/utils.ts
|
|
701
|
-
var getGlobalEntryCompanyType = (legalEntity, data) => {
|
|
702
|
-
if (data.entityInformation.entitySetup === "partOfABusiness") return data.companyStructure?.organizationType ?? legalEntity?.organization?.type;
|
|
703
|
-
if (data.entityInformation.entitySetup === "justMe") {
|
|
704
|
-
const hasSoleProprietorshipAssociation = legalEntity && hasSolePropInLegalEntity(legalEntity);
|
|
705
|
-
return data.registrationInformation?.filedPaperwork === "yes" || hasSoleProprietorshipAssociation ? "soleProprietorship" : void 0;
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
var isPaperworkQuestionAsked = (data) => {
|
|
709
|
-
const { country, entitySetup } = data.entityInformation ?? {};
|
|
710
|
-
if (!country) return false;
|
|
711
|
-
if (entitySetup === "partOfABusiness") return ALLOWED_UNINCORPORATED_PARTNERSHIP_COUNTRIES.includes(country);
|
|
712
|
-
return entitySetup === "justMe" && SOLE_PROP_COUNTRIES.includes(country);
|
|
713
|
-
};
|
|
714
|
-
var getFiledPaperwork = (data) => {
|
|
715
|
-
if (isPaperworkQuestionAsked(data)) return data.registrationInformation?.filedPaperwork ?? null;
|
|
716
|
-
return data.entityInformation?.entitySetup === "partOfABusiness" ? "yes" : "no";
|
|
717
|
-
};
|
|
718
|
-
var isSoleProprietorship = (data) => data.entityInformation?.entitySetup === "justMe" && getFiledPaperwork(data) === "yes";
|
|
719
|
-
var isUnincorporatedPartnership = (data) => data.entityInformation?.entitySetup === "partOfABusiness" && getFiledPaperwork(data) === "no" && data.registrationInformation?.unincorporatedOrganizationType === "unincorporatedPartnership";
|
|
720
|
-
/**
|
|
721
|
-
* `justMe` is always a natural person. Being part of a business only makes the entity an
|
|
722
|
-
* `organization` when the primary partner is not an individual, because an individual partner in an
|
|
723
|
-
* unincorporated partnership stays an individual legal entity.
|
|
724
|
-
*/
|
|
725
|
-
var determineLegalEntityType = (data) => data.entityInformation?.entitySetup === "partOfABusiness" && data.primaryPartner?.primaryPartnerType !== "individual" ? "organization" : "individual";
|
|
726
|
-
/**
|
|
727
|
-
* The account holder is derived from the form data, not sent to the API and is kept client-side.
|
|
728
|
-
*/
|
|
729
|
-
var determineAccountHolder = (data) => {
|
|
730
|
-
const entitySetup = data.entityInformation?.entitySetup;
|
|
731
|
-
/** Derived, because the question is not put to the user in every country */
|
|
732
|
-
const filedPaperwork = getFiledPaperwork(data);
|
|
733
|
-
if (entitySetup === "justMe") return filedPaperwork === "yes" ? "mySoleProprietorName" : "myName";
|
|
734
|
-
if (entitySetup === "partOfABusiness") {
|
|
735
|
-
if (isUnincorporatedPartnership(data)) return "anUnincorporatedPartnership";
|
|
736
|
-
if (filedPaperwork === "yes") return "theCompanyIWorkFor";
|
|
737
|
-
}
|
|
738
|
-
};
|
|
739
|
-
var determineEntityAssociations = (data, accountHolder, legalEntity, newSoleProp) => {
|
|
740
|
-
/** Sole props are the only association we create and associate in Global Entry */
|
|
741
|
-
if (newSoleProp) return [{
|
|
742
|
-
type: "soleProprietorship",
|
|
743
|
-
legalEntityId: newSoleProp.id
|
|
744
|
-
}];
|
|
745
|
-
const ownAssociations = getOwnEntityAssociations(legalEntity);
|
|
746
|
-
if (!ownAssociations || ownAssociations.length === 0) return;
|
|
747
|
-
return accountHolder !== determineAccountHolder(data) ? [] : void 0;
|
|
748
|
-
};
|
|
749
|
-
//#endregion
|
|
750
878
|
//#region src/components/GlobalEntry/forms/RegistrationInformation/RegistrationInformation.tsx
|
|
751
879
|
var REGISTRATION_INFORMATION_FIELDS = [
|
|
752
880
|
...PAPERWORK_QUESTIONNAIRE_FIELD,
|
|
881
|
+
...DBA_QUESTIONNAIRE_FIELD,
|
|
882
|
+
...TRUST_QUESTIONNAIRE_FIELD,
|
|
883
|
+
...LLC_QUESTIONNAIRE_FIELD,
|
|
753
884
|
...UNINCORPORATED_ORGANIZATION_TYPE_FIELD,
|
|
754
885
|
...LEGAL_COMPANY_NAME_FIELD,
|
|
755
886
|
"jaHaniLegalCompanyName",
|
|
756
887
|
"jaKanaLegalCompanyName",
|
|
888
|
+
...STATE_FIELD,
|
|
757
889
|
...COUNTRY_OF_GOVERNING_LAW_FIELD,
|
|
758
890
|
...BUSINESS_REGISTRATION_NUMBER_FIELD,
|
|
759
891
|
...TAX_INFORMATION_FIELD
|
|
@@ -782,6 +914,17 @@ var RegistrationInformation = ({ id, shouldValidate, legalEntity, country }) =>
|
|
|
782
914
|
t: businessT
|
|
783
915
|
});
|
|
784
916
|
const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
|
|
917
|
+
/**
|
|
918
|
+
* State is asked for in business search but may not be updated if user does not
|
|
919
|
+
* find results or opts for manual flow.
|
|
920
|
+
* It is stored client side for use when users encounter the State field in other forms
|
|
921
|
+
* and it was not saved on the legal entity.
|
|
922
|
+
*/
|
|
923
|
+
const { setStoredStateOrProvince } = useStoredStateOrProvince({ legalEntityId: legalEntity.id });
|
|
924
|
+
const handleStateChange = (key, mode) => (event) => {
|
|
925
|
+
handleChangeFor(key, mode)(event);
|
|
926
|
+
setStoredStateOrProvince(event.target.value);
|
|
927
|
+
};
|
|
785
928
|
return /* @__PURE__ */ jsxs("form", {
|
|
786
929
|
id,
|
|
787
930
|
children: [
|
|
@@ -793,7 +936,26 @@ var RegistrationInformation = ({ id, shouldValidate, legalEntity, country }) =>
|
|
|
793
936
|
data: { filedPaperwork: data.filedPaperwork },
|
|
794
937
|
valid: { filedPaperwork: valid.filedPaperwork },
|
|
795
938
|
errors: { filedPaperwork: formUtils.getErrorMessage("filedPaperwork", errors, fieldProblems) },
|
|
796
|
-
|
|
939
|
+
country,
|
|
940
|
+
entitySetup: form.data.entityInformation.entitySetup,
|
|
941
|
+
handleChangeFor
|
|
942
|
+
}),
|
|
943
|
+
showField(DBA_QUESTIONNAIRE_FIELD) && /* @__PURE__ */ jsx(DbaQuestionnaire, {
|
|
944
|
+
data: { doingBusinessAs: data.doingBusinessAs },
|
|
945
|
+
valid: { doingBusinessAs: valid.doingBusinessAs },
|
|
946
|
+
errors: { doingBusinessAs: formUtils.getErrorMessage("doingBusinessAs", errors, fieldProblems) },
|
|
947
|
+
handleChangeFor
|
|
948
|
+
}),
|
|
949
|
+
showField(TRUST_QUESTIONNAIRE_FIELD) && /* @__PURE__ */ jsx(TrustQuestionnaire, {
|
|
950
|
+
data: { isTrust: data.isTrust },
|
|
951
|
+
valid: { isTrust: valid.isTrust },
|
|
952
|
+
errors: { isTrust: formUtils.getErrorMessage("isTrust", errors, fieldProblems) },
|
|
953
|
+
handleChangeFor
|
|
954
|
+
}),
|
|
955
|
+
showField(LLC_QUESTIONNAIRE_FIELD) && /* @__PURE__ */ jsx(LlcQuestionnaire, {
|
|
956
|
+
data: { isLimitedLiabilityCorporation: data.isLimitedLiabilityCorporation },
|
|
957
|
+
valid: { isLimitedLiabilityCorporation: valid.isLimitedLiabilityCorporation },
|
|
958
|
+
errors: { isLimitedLiabilityCorporation: formUtils.getErrorMessage("isLimitedLiabilityCorporation", errors, fieldProblems) },
|
|
797
959
|
handleChangeFor
|
|
798
960
|
}),
|
|
799
961
|
showField(COUNTRY_OF_GOVERNING_LAW_FIELD) && /* @__PURE__ */ jsx(CountryOfGoverningLawField, {
|
|
@@ -829,6 +991,15 @@ var RegistrationInformation = ({ id, shouldValidate, legalEntity, country }) =>
|
|
|
829
991
|
onKeyDown: field?.onKeyDown
|
|
830
992
|
})
|
|
831
993
|
}, field?.name)),
|
|
994
|
+
showField(STATE_FIELD) && /* @__PURE__ */ jsx(StateField, {
|
|
995
|
+
data: { stateOrProvince: data.stateOrProvince },
|
|
996
|
+
valid: { stateOrProvince: valid.stateOrProvince },
|
|
997
|
+
errors: { stateOrProvince: formUtils.getErrorMessage("stateOrProvince", errors, fieldProblems) },
|
|
998
|
+
selectedCountry: country,
|
|
999
|
+
readonly: false,
|
|
1000
|
+
handleChangeFor: handleStateChange,
|
|
1001
|
+
labelOverride: commonT(($) => $["whereIsYourBusinessRegistered"])
|
|
1002
|
+
}),
|
|
832
1003
|
showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx(TaxInformationField, {
|
|
833
1004
|
data: {
|
|
834
1005
|
taxInformation: data.taxInformation,
|
|
@@ -872,7 +1043,7 @@ var RegistrationInformation = ({ id, shouldValidate, legalEntity, country }) =>
|
|
|
872
1043
|
optional: formUtils.isOptionalField("registrationNumber"),
|
|
873
1044
|
handleChangeFor,
|
|
874
1045
|
country,
|
|
875
|
-
state:
|
|
1046
|
+
state: data.stateOrProvince,
|
|
876
1047
|
canExempt: showField(["exemptedFromRegistrationNumber"]),
|
|
877
1048
|
companyType
|
|
878
1049
|
})
|
|
@@ -941,7 +1112,7 @@ function useCompanySearchNextClickOverrides({ country, multiForm, companySearchS
|
|
|
941
1112
|
const companySearchInput = {
|
|
942
1113
|
name: legalCompanyName,
|
|
943
1114
|
country,
|
|
944
|
-
state: multiForm.data.
|
|
1115
|
+
state: multiForm.data.registrationInformation?.stateOrProvince,
|
|
945
1116
|
registrationNumber: multiForm.data.registrationInformation?.registrationNumber
|
|
946
1117
|
};
|
|
947
1118
|
searchResponse = await trackPerformance("companySearch", () => queryClient.fetchQuery(companySearchQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), companySearchInput, userEvents)), userEvents);
|
|
@@ -1047,7 +1218,7 @@ var getRootElement = () => {
|
|
|
1047
1218
|
const onboardingWC = document.querySelector("adyen-onboarding");
|
|
1048
1219
|
return (onboardingWC && onboardingWC?.shadowRoot) ?? document;
|
|
1049
1220
|
};
|
|
1050
|
-
var isEntityInformationField = (fieldName) => fieldName === "country"
|
|
1221
|
+
var isEntityInformationField = (fieldName) => fieldName === "country";
|
|
1051
1222
|
var getRelatedFields = (country) => {
|
|
1052
1223
|
const baseFields = [
|
|
1053
1224
|
"legalCompanyName",
|
|
@@ -1080,7 +1251,7 @@ function usePrefetchCompanySearch({ country, multiForm, activeFormId, isUsingCom
|
|
|
1080
1251
|
const companySearchInput = {
|
|
1081
1252
|
name: multiForm.data.registrationInformation?.legalCompanyName ?? "",
|
|
1082
1253
|
country: multiForm.data.entityInformation?.country,
|
|
1083
|
-
state: multiForm.data.
|
|
1254
|
+
state: multiForm.data.registrationInformation?.stateOrProvince,
|
|
1084
1255
|
registrationNumber: multiForm.data.registrationInformation?.registrationNumber
|
|
1085
1256
|
};
|
|
1086
1257
|
await queryClient.prefetchQuery(companySearchQueryOptions(rootLegalEntityId.peek(), baseUrl.peek(), companySearchInput, userEvents));
|
|
@@ -1088,7 +1259,7 @@ function usePrefetchCompanySearch({ country, multiForm, activeFormId, isUsingCom
|
|
|
1088
1259
|
baseUrl,
|
|
1089
1260
|
country,
|
|
1090
1261
|
multiForm.data.entityInformation?.country,
|
|
1091
|
-
multiForm.data.
|
|
1262
|
+
multiForm.data.registrationInformation?.stateOrProvince,
|
|
1092
1263
|
multiForm.data.registrationInformation?.legalCompanyName,
|
|
1093
1264
|
multiForm.data.registrationInformation?.registrationNumber,
|
|
1094
1265
|
multiForm.valid.entityInformation,
|
|
@@ -1123,43 +1294,32 @@ var determineEntitySetup = (legalEntity, accountHolder) => {
|
|
|
1123
1294
|
if (legalEntity.type === "individual") return "justMe";
|
|
1124
1295
|
return "partOfABusiness";
|
|
1125
1296
|
};
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
* the registration details the root does not, so editing an existing proprietorship prefills.
|
|
1130
|
-
*/
|
|
1131
|
-
var mapLegalEntityToGlobalEntrySchema = (legalEntity, accountHolder, associatedSoleProp) => {
|
|
1132
|
-
const soleProprietorship = associatedSoleProp?.soleProprietorship ?? (legalEntity.type === "soleProprietorship" ? legalEntity.soleProprietorship : void 0);
|
|
1133
|
-
const isSoleProprietorship = !!soleProprietorship;
|
|
1134
|
-
const taxInformation = isSoleProprietorship ? soleProprietorship.taxInformation : legalEntity.organization?.taxInformation;
|
|
1135
|
-
const registrationNumber = isSoleProprietorship ? soleProprietorship.registrationNumber : legalEntity.organization?.registrationNumber;
|
|
1297
|
+
var mapLegalEntityToGlobalEntrySchema = (legalEntity, accountHolder) => {
|
|
1298
|
+
const taxInformation = legalEntity.organization?.taxInformation;
|
|
1299
|
+
const registrationNumber = legalEntity.organization?.registrationNumber;
|
|
1136
1300
|
const currentCountryTaxInformation = taxInformation?.find((taxInformationItem) => taxInformationItem.country === getLegalEntityCountry(legalEntity));
|
|
1137
1301
|
const isUen = currentCountryTaxInformation?.type === "UEN";
|
|
1138
1302
|
const country = getLegalEntityCountry(legalEntity);
|
|
1139
|
-
const companyType = legalEntity.organization?.type
|
|
1303
|
+
const companyType = legalEntity.organization?.type;
|
|
1140
1304
|
const registrationNumberExemption = !registrationNumber && !!companyType && isRegistrationExemptionAllowed({
|
|
1141
1305
|
country,
|
|
1142
1306
|
companyType
|
|
1143
1307
|
}) ? true : legalEntity.organization?.registrationNumberAbsent;
|
|
1144
|
-
const stateOrProvince = [
|
|
1145
|
-
legalEntity.organization?.registeredAddress,
|
|
1146
|
-
legalEntity.individual?.residentialAddress,
|
|
1147
|
-
soleProprietorship?.registeredAddress
|
|
1148
|
-
].find((address) => address?.street && address?.stateOrProvince)?.stateOrProvince;
|
|
1308
|
+
const stateOrProvince = [legalEntity.organization?.registeredAddress, legalEntity.individual?.residentialAddress].find((address) => address?.street && address?.stateOrProvince)?.stateOrProvince;
|
|
1149
1309
|
return {
|
|
1150
1310
|
entityInformation: {
|
|
1151
1311
|
entitySetup: determineEntitySetup(legalEntity, accountHolder),
|
|
1152
|
-
country: getLegalEntityCountry(legalEntity)
|
|
1153
|
-
stateOrProvince
|
|
1312
|
+
country: getLegalEntityCountry(legalEntity)
|
|
1154
1313
|
},
|
|
1155
1314
|
registrationInformation: {
|
|
1156
1315
|
...mapLocalizationToJapaneseLegalNames(legalEntity.organization?.localization),
|
|
1316
|
+
stateOrProvince,
|
|
1157
1317
|
filedPaperwork: accountHolder === "anUnincorporatedPartnership" ? "no" : taxInformation && taxInformation.length > 0 || registrationNumber ? "yes" : void 0,
|
|
1158
1318
|
unincorporatedOrganizationType: accountHolder === "anUnincorporatedPartnership" ? "unincorporatedPartnership" : void 0,
|
|
1159
|
-
legalCompanyName:
|
|
1319
|
+
legalCompanyName: legalEntity.organization?.legalName,
|
|
1160
1320
|
registrationNumber: isUen ? currentCountryTaxInformation?.number : registrationNumber,
|
|
1161
|
-
exemptedFromRegistrationNumber:
|
|
1162
|
-
countryOfGoverningLaw:
|
|
1321
|
+
exemptedFromRegistrationNumber: registrationNumberExemption,
|
|
1322
|
+
countryOfGoverningLaw: legalEntity.organization?.countryOfGoverningLaw,
|
|
1163
1323
|
taxInformation,
|
|
1164
1324
|
isUen
|
|
1165
1325
|
},
|
|
@@ -1202,7 +1362,7 @@ function RegistrationNumberMismatchModal({ companySearchStateModel, country, reg
|
|
|
1202
1362
|
const registrationNumberType = data?.exemptedFromRegistrationNumber ? "exempted" : data?.registrationNumberType;
|
|
1203
1363
|
const { label: registrationNumberLabel } = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
|
|
1204
1364
|
registrationNumberType: registrationNumberType === "exempted" ? void 0 : registrationNumberType,
|
|
1205
|
-
state: form.data.
|
|
1365
|
+
state: form.data.registrationInformation?.stateOrProvince || void 0
|
|
1206
1366
|
}, registrationNumberDefaultFieldMetadata);
|
|
1207
1367
|
return /* @__PURE__ */ jsx(DataConflictsModal, {
|
|
1208
1368
|
providedData,
|
|
@@ -1243,6 +1403,9 @@ var globalEntryFieldRuleConfigurations = {
|
|
|
1243
1403
|
countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" },
|
|
1244
1404
|
selectedBusinessId: { rule: "businessSelectionRequired" },
|
|
1245
1405
|
filedPaperwork: { rule: "filedPaperworkRequired" },
|
|
1406
|
+
doingBusinessAs: { rule: "doingBusinessAsRequired" },
|
|
1407
|
+
isTrust: { rule: "isTrustRequired" },
|
|
1408
|
+
isLimitedLiabilityCorporation: { rule: "isLimitedLiabilityCorporationRequired" },
|
|
1246
1409
|
unincorporatedOrganizationType: { rule: "unincorporatedOrganizationTypeRequired" },
|
|
1247
1410
|
legalCompanyName: { rule: "legalCompanyNameRequired" },
|
|
1248
1411
|
jaHaniLegalCompanyName: { rule: "jaHaniLegalCompanyName" },
|
|
@@ -1255,115 +1418,97 @@ var globalEntryFieldRuleConfigurations = {
|
|
|
1255
1418
|
};
|
|
1256
1419
|
var globalEntryCustomRules = ({ accountHolder, data, isFeatureEnabled = () => false, isSettingEnabled = () => false, country, rootLegalEntity }) => {
|
|
1257
1420
|
const filedPaperwork = getFiledPaperwork(data);
|
|
1258
|
-
const
|
|
1421
|
+
const isUsIndividual = data.entityInformation?.entitySetup === "justMe" && country === CountryCodes.UnitedStates;
|
|
1422
|
+
const llcAnswer = data.registrationInformation?.isLimitedLiabilityCorporation;
|
|
1423
|
+
const isLlcQuestionRequired = isUsIndividual && filedPaperwork === "yes";
|
|
1424
|
+
const hasDeterminedBusinessType = !isLlcQuestionRequired || !!llcAnswer;
|
|
1425
|
+
const isSingleMemberLlc = isSingleMemberLLC(data);
|
|
1426
|
+
const isTrustQuestionRequired = isTrustQuestionAsked(data);
|
|
1427
|
+
const isTrust = isTrustQuestionRequired && data.registrationInformation.isTrust === "yes";
|
|
1428
|
+
const canCollectOrganizationDetails = !isTrustQuestionRequired || data.registrationInformation.isTrust === "no";
|
|
1429
|
+
const hasFiledPaperwork = filedPaperwork === "yes" && hasDeterminedBusinessType;
|
|
1259
1430
|
const hasAnsweredPaperworkQuestion = !!filedPaperwork;
|
|
1260
1431
|
const isPartOfABusiness = data.entityInformation?.entitySetup === "partOfABusiness";
|
|
1261
|
-
const
|
|
1432
|
+
const isOrganization = isPartOfABusiness || isSingleMemberLlc;
|
|
1262
1433
|
const isExemptFromRegistrationNumber = Boolean(data.registrationInformation?.exemptedFromRegistrationNumber);
|
|
1263
1434
|
const existingRegistrationNumber = rootLegalEntity?.type === "soleProprietorship" ? rootLegalEntity.soleProprietorship?.registrationNumber : rootLegalEntity?.organization?.registrationNumber;
|
|
1264
1435
|
const isUnincorporatedOrganization = isPartOfABusiness && filedPaperwork === "no";
|
|
1265
|
-
const isRegisteredOrganization =
|
|
1436
|
+
const isRegisteredOrganization = isOrganization && hasFiledPaperwork && canCollectOrganizationDetails;
|
|
1266
1437
|
return createFormRules({
|
|
1267
1438
|
entitySetupRequired: () => "REQUIRED",
|
|
1268
1439
|
countryRequired: () => "REQUIRED",
|
|
1269
|
-
|
|
1270
|
-
if (isPartOfABusiness && isUsingCompanySearch(country, TaskTypes.GLOBAL_ENTRY) && COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
|
|
1271
|
-
},
|
|
1272
|
-
businessSelectionRequired: () => isUsingCompanySearch(country, TaskTypes.GLOBAL_ENTRY) && isRegisteredOrganization ? "REQUIRED" : void 0,
|
|
1440
|
+
businessSelectionRequired: () => isUsingCompanySearch(data) ? "REQUIRED" : void 0,
|
|
1273
1441
|
organizationTypeRequired: () => isRegisteredOrganization ? "REQUIRED" : void 0,
|
|
1274
1442
|
countryOfGoverningLawRequired: () => {
|
|
1275
|
-
if (isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(country) &&
|
|
1443
|
+
if (isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(country) && isOrganization && hasAnsweredPaperworkQuestion && canCollectOrganizationDetails) return "REQUIRED";
|
|
1276
1444
|
},
|
|
1277
1445
|
filedPaperworkRequired: () => isPaperworkQuestionAsked(data) ? "REQUIRED" : void 0,
|
|
1446
|
+
doingBusinessAsRequired: () => data.entityInformation.entitySetup === "justMe" && filedPaperwork === "no" && INDIVIDUALS_WHO_TRADE_COUNTRIES.includes(country) ? "REQUIRED" : void 0,
|
|
1447
|
+
isTrustRequired: () => isTrustQuestionRequired ? "REQUIRED" : void 0,
|
|
1448
|
+
requireStateOrProvinceForCompanySearch: () => {
|
|
1449
|
+
if (isUsingCompanySearch(data) && COUNTRIES_WITH_STATES_DATASET.includes(country)) return "REQUIRED";
|
|
1450
|
+
},
|
|
1451
|
+
isLimitedLiabilityCorporationRequired: () => isLlcQuestionRequired ? "REQUIRED" : void 0,
|
|
1278
1452
|
unincorporatedOrganizationTypeRequired: () => isUnincorporatedOrganization ? "REQUIRED" : void 0,
|
|
1279
|
-
legalCompanyNameRequired: () =>
|
|
1453
|
+
legalCompanyNameRequired: () => isRegisteredOrganization ? "REQUIRED" : void 0,
|
|
1280
1454
|
jaHaniLegalCompanyName: () => {
|
|
1281
|
-
if (
|
|
1455
|
+
if (isRegisteredOrganization && isJapanLocalizationEnabled(isSettingEnabled, country)) return "REQUIRED";
|
|
1282
1456
|
},
|
|
1283
1457
|
jaKanaLegalCompanyName: () => {
|
|
1284
|
-
if (
|
|
1458
|
+
if (isRegisteredOrganization && isJapanLocalizationEnabled(isSettingEnabled, country)) return "REQUIRED";
|
|
1285
1459
|
},
|
|
1286
1460
|
countryRequiresRegistrationNumber: () => {
|
|
1287
|
-
if (!
|
|
1288
|
-
if (
|
|
1289
|
-
|
|
1290
|
-
if (
|
|
1461
|
+
if (!isRegisteredOrganization) return;
|
|
1462
|
+
if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
|
|
1463
|
+
if (country === CountryCodes.HongKong) {
|
|
1464
|
+
if (!existingRegistrationNumber) return;
|
|
1291
1465
|
return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
|
|
1292
1466
|
}
|
|
1293
|
-
if (
|
|
1294
|
-
if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
|
|
1295
|
-
if (country === CountryCodes.HongKong) {
|
|
1296
|
-
if (!existingRegistrationNumber) return;
|
|
1297
|
-
return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
|
|
1298
|
-
}
|
|
1299
|
-
if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return isExemptFromRegistrationNumber ? void 0 : "REQUIRED";
|
|
1300
|
-
}
|
|
1467
|
+
if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return isExemptFromRegistrationNumber ? void 0 : "REQUIRED";
|
|
1301
1468
|
},
|
|
1302
1469
|
registrationNumberType: () => {
|
|
1303
|
-
if (!
|
|
1304
|
-
if (
|
|
1305
|
-
if (
|
|
1306
|
-
|
|
1307
|
-
if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
|
|
1308
|
-
return "OPTIONAL";
|
|
1309
|
-
}
|
|
1470
|
+
if (!isRegisteredOrganization) return;
|
|
1471
|
+
if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) return "OPTIONAL";
|
|
1472
|
+
if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
|
|
1473
|
+
return "OPTIONAL";
|
|
1310
1474
|
},
|
|
1311
1475
|
companyRegistrationNumberExemptionAllowed: () => {
|
|
1312
|
-
if (!
|
|
1313
|
-
if (
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
case CountryCodes.HongKong:
|
|
1330
|
-
if (!existingRegistrationNumber) return;
|
|
1331
|
-
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
1332
|
-
case CountryCodes.Australia:
|
|
1333
|
-
case CountryCodes.NewZealand:
|
|
1334
|
-
if (!isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4")) return;
|
|
1335
|
-
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
1336
|
-
default: return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
1337
|
-
}
|
|
1476
|
+
if (!isRegisteredOrganization) return;
|
|
1477
|
+
if (!isRegistrationExemptionAllowed({ country })) return;
|
|
1478
|
+
/**
|
|
1479
|
+
* Country-specific guard checks before applying the shared exemption rule result.
|
|
1480
|
+
*
|
|
1481
|
+
* - HK first enforces the legacy registration-number presence guard for existing entities.
|
|
1482
|
+
* - AU/NZ then enforce the absent-state V4 feature flag gate.
|
|
1483
|
+
*/
|
|
1484
|
+
switch (country) {
|
|
1485
|
+
case CountryCodes.HongKong:
|
|
1486
|
+
if (!existingRegistrationNumber) return;
|
|
1487
|
+
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
1488
|
+
case CountryCodes.Australia:
|
|
1489
|
+
case CountryCodes.NewZealand:
|
|
1490
|
+
if (!isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4")) return;
|
|
1491
|
+
return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
1492
|
+
default: return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
|
|
1338
1493
|
}
|
|
1339
1494
|
},
|
|
1340
1495
|
taxInformationRequired: () => {
|
|
1341
1496
|
const requiredUnlessExempt = Boolean(data.registrationInformation?.exemptedFromTax) ? "OPTIONAL" : "REQUIRED";
|
|
1342
1497
|
const usesTaxIdInsteadOfVat = COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country);
|
|
1343
|
-
if (!
|
|
1344
|
-
if (
|
|
1345
|
-
if (
|
|
1346
|
-
|
|
1347
|
-
if (country === CountryCodes.Italy && data.registrationInformation?.registrationNumberType === "CCIAA") return requiredUnlessExempt;
|
|
1348
|
-
}
|
|
1349
|
-
if (usesTaxIdInsteadOfVat) return requiredUnlessExempt;
|
|
1350
|
-
}
|
|
1351
|
-
if (isSoleProp) {
|
|
1352
|
-
if (COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country)) return;
|
|
1353
|
-
if (usesTaxIdInsteadOfVat) return requiredUnlessExempt;
|
|
1498
|
+
if (!isRegisteredOrganization) return;
|
|
1499
|
+
if (rootLegalEntity?.type === "organization" && keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount")) {
|
|
1500
|
+
if (TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country)) return requiredUnlessExempt;
|
|
1501
|
+
if (country === CountryCodes.Italy && data.registrationInformation?.registrationNumberType === "CCIAA") return requiredUnlessExempt;
|
|
1354
1502
|
}
|
|
1503
|
+
if (usesTaxIdInsteadOfVat) return requiredUnlessExempt;
|
|
1355
1504
|
},
|
|
1356
1505
|
countryHasTaxExemptions: () => {
|
|
1357
|
-
if (!
|
|
1506
|
+
if (!isRegisteredOrganization) return;
|
|
1358
1507
|
const isExemptFromTax = Boolean(data.registrationInformation?.exemptedFromTax);
|
|
1359
|
-
if (isSoleProp) {
|
|
1360
|
-
if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
|
|
1361
|
-
return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
|
|
1362
|
-
}
|
|
1363
1508
|
if (isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
|
|
1364
1509
|
if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
|
|
1365
1510
|
},
|
|
1366
|
-
primaryPartnerTypeRequired: () => isUnincorporatedOrganization && data.registrationInformation.unincorporatedOrganizationType === "unincorporatedPartnership" ? "REQUIRED" : void 0
|
|
1511
|
+
primaryPartnerTypeRequired: () => isTrust || isUnincorporatedOrganization && data.registrationInformation.unincorporatedOrganizationType === "unincorporatedPartnership" ? "REQUIRED" : void 0
|
|
1367
1512
|
});
|
|
1368
1513
|
};
|
|
1369
1514
|
//#endregion
|
|
@@ -1396,6 +1541,7 @@ function buildRequiredForms({ config: { forms, requiredFields, optionalFields, i
|
|
|
1396
1541
|
*/
|
|
1397
1542
|
var globalEntryKeyMappingForOrgs = {
|
|
1398
1543
|
"entityInformation.country": "organization.registeredAddress.country",
|
|
1544
|
+
"registrationInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
|
|
1399
1545
|
"registrationInformation.legalCompanyName": "organization.legalName",
|
|
1400
1546
|
"registrationInformation.registrationNumber": "organization.registrationNumber",
|
|
1401
1547
|
"registrationInformation.exemptedFromRegistrationNumber": "organization.registrationNumberAbsent",
|
|
@@ -1404,40 +1550,16 @@ var globalEntryKeyMappingForOrgs = {
|
|
|
1404
1550
|
"companyStructure.organizationType": "organization.type"
|
|
1405
1551
|
};
|
|
1406
1552
|
var globalEntryKeyMappingForIndividuals = { "entityInformation.country": "individual.residentialAddress.country" };
|
|
1407
|
-
var globalEntryKeyMappingForSoleProps = {
|
|
1408
|
-
"entityInformation.country": "soleProprietorship.registeredAddress.country",
|
|
1409
|
-
"registrationInformation.legalCompanyName": "soleProprietorship.name",
|
|
1410
|
-
"registrationInformation.registrationNumber": "soleProprietorship.registrationNumber",
|
|
1411
|
-
"registrationInformation.taxInformation": "soleProprietorship.taxInformation",
|
|
1412
|
-
"registrationInformation.exemptedFromTax": "soleProprietorship.taxAbsent",
|
|
1413
|
-
"registrationInformation.countryOfGoverningLaw": "soleProprietorship.countryOfGoverningLaw"
|
|
1414
|
-
};
|
|
1415
1553
|
/** Api-keyed mapping, for building the legal entity request from the form schema */
|
|
1416
1554
|
var globalEntryApiKeyMappingForOrgs = reverseMapping(globalEntryKeyMappingForOrgs);
|
|
1417
|
-
/** Api-keyed mapping, for building the sole proprietorship request from the form schema */
|
|
1418
|
-
var globalEntryApiKeyMappingForSoleProps = reverseMapping(globalEntryKeyMappingForSoleProps);
|
|
1419
1555
|
/** Api-keyed mapping, for building the legal entity request from the form schema */
|
|
1420
1556
|
var globalEntryApiKeyMappingForIndividuals = reverseMapping(globalEntryKeyMappingForIndividuals);
|
|
1421
1557
|
//#endregion
|
|
1422
1558
|
//#region src/components/GlobalEntry/mapping/mapGlobalEntrySchemaToLegalEntity.ts
|
|
1423
|
-
var
|
|
1424
|
-
const { soleProprietorship } = formatObject(data, globalEntryApiKeyMappingForSoleProps);
|
|
1425
|
-
return {
|
|
1426
|
-
type: "soleProprietorship",
|
|
1427
|
-
soleProprietorship: {
|
|
1428
|
-
...soleProprietorship,
|
|
1429
|
-
/**
|
|
1430
|
-
* A proprietorship always has a governing law, but the field is only put to the user in the
|
|
1431
|
-
* countries that can differ from where they registered, so the rest fall back to that.
|
|
1432
|
-
*/
|
|
1433
|
-
countryOfGoverningLaw: data.registrationInformation?.countryOfGoverningLaw ?? data.entityInformation?.country
|
|
1434
|
-
}
|
|
1435
|
-
};
|
|
1436
|
-
};
|
|
1437
|
-
var mapGlobalEntrySchemaToLegalEntity = (data, legalEntity, accountHolder, isFeatureEnabled, newSoleProp) => {
|
|
1559
|
+
var mapGlobalEntrySchemaToLegalEntity = (data, legalEntity, accountHolder, isFeatureEnabled) => {
|
|
1438
1560
|
const isOrg = determineLegalEntityType(data) === "organization";
|
|
1439
1561
|
const mapping = isOrg ? globalEntryApiKeyMappingForOrgs : globalEntryApiKeyMappingForIndividuals;
|
|
1440
|
-
const entityAssociations = determineEntityAssociations(data, accountHolder, legalEntity
|
|
1562
|
+
const entityAssociations = determineEntityAssociations(data, accountHolder, legalEntity);
|
|
1441
1563
|
const entity = {
|
|
1442
1564
|
...formatObject(data, mapping),
|
|
1443
1565
|
id: legalEntity.id,
|
|
@@ -1513,29 +1635,26 @@ var mergeVerifiedCompanyData = ({ entity, legalEntity, verifiedCompanyData }) =>
|
|
|
1513
1635
|
organization
|
|
1514
1636
|
};
|
|
1515
1637
|
};
|
|
1516
|
-
var
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
});
|
|
1526
|
-
} else
|
|
1527
|
-
/**
|
|
1528
|
-
* Created first so the entity can be associated to it below, which keeps this to a single
|
|
1529
|
-
* write against the entity itself.
|
|
1530
|
-
*/
|
|
1531
|
-
newSoleProp = await createLegalEntity(mappedSolePropData);
|
|
1532
|
-
}
|
|
1533
|
-
const { type: targetType, ...legalEntityData } = mergeVerifiedCompanyData({
|
|
1534
|
-
entity: mapGlobalEntrySchemaToLegalEntity(data, legalEntity, accountHolder, isFeatureEnabled, newSoleProp ? newSoleProp : void 0),
|
|
1638
|
+
var getAddressPayload = (address) => {
|
|
1639
|
+
const country = address.country;
|
|
1640
|
+
const requiresStateOrProvince = COUNTRIES_WITH_STATES_DATASET.includes(country) && COUNTRIES_USING_COMPANY_SEARCH.includes(country);
|
|
1641
|
+
if (Boolean(address.street && address.city && address.postalCode && (requiresStateOrProvince ? !!address.stateOrProvince : true))) return address;
|
|
1642
|
+
return { country: address.country };
|
|
1643
|
+
};
|
|
1644
|
+
var submitGlobalEntry = async ({ legalEntity, data, updateLegalEntity, accountHolder, isFeatureEnabled, verifiedCompanyData }) => {
|
|
1645
|
+
const mappedData = mergeVerifiedCompanyData({
|
|
1646
|
+
entity: mapGlobalEntrySchemaToLegalEntity(data, legalEntity, accountHolder, isFeatureEnabled),
|
|
1535
1647
|
legalEntity,
|
|
1536
1648
|
verifiedCompanyData
|
|
1537
1649
|
});
|
|
1538
1650
|
/**
|
|
1651
|
+
* If the request does not have a complete address, send only its country
|
|
1652
|
+
* to avoid validation errors.
|
|
1653
|
+
*/
|
|
1654
|
+
if (mappedData.organization?.registeredAddress) mappedData.organization.registeredAddress = getAddressPayload(mappedData.organization.registeredAddress);
|
|
1655
|
+
if (mappedData.organization?.principalPlaceOfBusiness) mappedData.organization.principalPlaceOfBusiness = getAddressPayload(mappedData.organization.principalPlaceOfBusiness);
|
|
1656
|
+
const { type: targetType, ...legalEntityData } = mappedData;
|
|
1657
|
+
/**
|
|
1539
1658
|
* LEM rejects a change of type in the same request as the data
|
|
1540
1659
|
*/
|
|
1541
1660
|
if (targetType !== legalEntity.type) await updateLegalEntity({
|
|
@@ -1559,10 +1678,6 @@ var globalEntryValidationRules = ({ data, legalEntity, isFeatureEnabled = () =>
|
|
|
1559
1678
|
taxIdNumberType,
|
|
1560
1679
|
companyType
|
|
1561
1680
|
}, taxInformationDefaultFieldMetadata).validators;
|
|
1562
|
-
const registrationNumberValidators = resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
|
|
1563
|
-
registrationNumberType: data?.registrationInformation?.registrationNumberType,
|
|
1564
|
-
state: data?.entityInformation?.stateOrProvince
|
|
1565
|
-
}, registrationNumberDefaultFieldMetadata).validators;
|
|
1566
1681
|
return {
|
|
1567
1682
|
businessSelection: { selectedBusinessId: {
|
|
1568
1683
|
validate: (value) => !isEmpty(value),
|
|
@@ -1573,15 +1688,40 @@ var globalEntryValidationRules = ({ data, legalEntity, isFeatureEnabled = () =>
|
|
|
1573
1688
|
validate: (value) => !!value,
|
|
1574
1689
|
modes: ["blur", "input"]
|
|
1575
1690
|
} },
|
|
1576
|
-
entityInformation: {
|
|
1691
|
+
entityInformation: {
|
|
1692
|
+
country: {
|
|
1693
|
+
validate: (value) => !!value,
|
|
1694
|
+
modes: ["blur", "input"]
|
|
1695
|
+
},
|
|
1696
|
+
entitySetup: {
|
|
1697
|
+
validate: (value) => !!value,
|
|
1698
|
+
modes: ["blur", "input"]
|
|
1699
|
+
}
|
|
1700
|
+
},
|
|
1577
1701
|
primaryPartner: { primaryPartnerType: {
|
|
1578
1702
|
validate: (value) => !!value,
|
|
1579
1703
|
modes: ["blur", "input"]
|
|
1580
1704
|
} },
|
|
1581
1705
|
registrationInformation: {
|
|
1706
|
+
doingBusinessAs: {
|
|
1707
|
+
validate: (value) => !!value,
|
|
1708
|
+
modes: ["blur", "input"]
|
|
1709
|
+
},
|
|
1710
|
+
isTrust: {
|
|
1711
|
+
validate: (value) => !!value,
|
|
1712
|
+
modes: ["blur", "input"]
|
|
1713
|
+
},
|
|
1714
|
+
isLimitedLiabilityCorporation: {
|
|
1715
|
+
validate: (value) => !!value,
|
|
1716
|
+
modes: ["blur", "input"]
|
|
1717
|
+
},
|
|
1582
1718
|
countryOfGoverningLaw: countryOfGoverningLawValidators,
|
|
1583
1719
|
legalCompanyName: legalCompanyNameValidators,
|
|
1584
|
-
|
|
1720
|
+
stateOrProvince: stateValidators,
|
|
1721
|
+
registrationNumber: resolveFieldMetadata(registrationNumberDefaultFieldConfig[country], {
|
|
1722
|
+
registrationNumberType: data?.registrationInformation?.registrationNumberType,
|
|
1723
|
+
state: data?.registrationInformation?.stateOrProvince
|
|
1724
|
+
}, registrationNumberDefaultFieldMetadata).validators,
|
|
1585
1725
|
taxInformation: taxInformationValidators,
|
|
1586
1726
|
unincorporatedOrganizationType: {
|
|
1587
1727
|
validate: (value) => !!value && value !== "unincorporatedAssociation",
|
|
@@ -1594,10 +1734,7 @@ var globalEntryValidationRules = ({ data, legalEntity, isFeatureEnabled = () =>
|
|
|
1594
1734
|
//#region src/components/GlobalEntry/tasks/GlobalEntry.tsx
|
|
1595
1735
|
var GlobalEntry = ({ activeForm, legalEntity, shouldValidate, country }) => {
|
|
1596
1736
|
switch (activeForm.formId) {
|
|
1597
|
-
case globalEntryForms.entityInformation.formId: return /* @__PURE__ */ jsx(EntityInformation, {
|
|
1598
|
-
id: activeForm.formId,
|
|
1599
|
-
country
|
|
1600
|
-
});
|
|
1737
|
+
case globalEntryForms.entityInformation.formId: return /* @__PURE__ */ jsx(EntityInformation, { id: activeForm.formId });
|
|
1601
1738
|
case globalEntryForms.registrationInformation.formId: return /* @__PURE__ */ jsx(RegistrationInformation, {
|
|
1602
1739
|
id: activeForm.formId,
|
|
1603
1740
|
legalEntity,
|
|
@@ -1652,7 +1789,7 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1652
1789
|
"../language/da-DK.json": () => import("./da-DK-Dhr4p-qj.js"),
|
|
1653
1790
|
"../language/de-DE.json": () => import("./de-DE-QDT6VVq9.js"),
|
|
1654
1791
|
"../language/el-GR.json": () => import("./el-GR-V2cZ5gjl.js"),
|
|
1655
|
-
"../language/en-US.json": () => import("./en-US-
|
|
1792
|
+
"../language/en-US.json": () => import("./en-US-BMMx67Za.js"),
|
|
1656
1793
|
"../language/es-ES.json": () => import("./es-ES-SsReQJzQ.js"),
|
|
1657
1794
|
"../language/es-LA.json": () => import("./es-LA-DTXCg1tj.js"),
|
|
1658
1795
|
"../language/et-EE.json": () => import("./et-EE-Bg3WOS9m.js"),
|
|
@@ -1714,12 +1851,16 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1714
1851
|
legalEntity: rootLegalEntity,
|
|
1715
1852
|
isFeatureEnabled
|
|
1716
1853
|
}), [isFeatureEnabled, rootLegalEntity]);
|
|
1717
|
-
|
|
1718
|
-
const
|
|
1719
|
-
const defaultData = useMemo(() =>
|
|
1854
|
+
const { storedStateOrProvince } = useStoredStateOrProvince({ legalEntityId: rootLegalEntity.id });
|
|
1855
|
+
const initialStoredStateOrProvince = useRef(storedStateOrProvince).current;
|
|
1856
|
+
const defaultData = useMemo(() => {
|
|
1857
|
+
const mappedData = mapLegalEntityToGlobalEntrySchema(rootLegalEntity, accountHolder);
|
|
1858
|
+
mappedData.registrationInformation.stateOrProvince = mappedData.registrationInformation.stateOrProvince ?? initialStoredStateOrProvince;
|
|
1859
|
+
return mappedData;
|
|
1860
|
+
}, [
|
|
1720
1861
|
rootLegalEntity,
|
|
1721
|
-
|
|
1722
|
-
|
|
1862
|
+
accountHolder,
|
|
1863
|
+
initialStoredStateOrProvince
|
|
1723
1864
|
]);
|
|
1724
1865
|
const multiForm = useMultiForm({
|
|
1725
1866
|
defaultData,
|
|
@@ -1758,6 +1899,7 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1758
1899
|
});
|
|
1759
1900
|
setDerivedProps(props);
|
|
1760
1901
|
}, [rootLegalEntity?.type, rules]);
|
|
1902
|
+
const isSingleMemberLlc = isSingleMemberLLC(data);
|
|
1761
1903
|
/**
|
|
1762
1904
|
* The company structures that are still valid given the registration number type and tax ID
|
|
1763
1905
|
* number type currently in the form.
|
|
@@ -1767,12 +1909,14 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1767
1909
|
registrationNumberType: data.registrationInformation?.registrationNumberType,
|
|
1768
1910
|
registrationNumberExempt: data.registrationInformation?.exemptedFromRegistrationNumber,
|
|
1769
1911
|
taxIdNumberType: data.registrationInformation?.taxInformation?.find((taxInformation) => taxInformation.country === country)?.type,
|
|
1770
|
-
legalEntity: rootLegalEntity
|
|
1912
|
+
legalEntity: rootLegalEntity,
|
|
1913
|
+
isSingleMemberLlc
|
|
1771
1914
|
}), [
|
|
1772
1915
|
country,
|
|
1773
1916
|
data.registrationInformation?.exemptedFromRegistrationNumber,
|
|
1774
1917
|
data.registrationInformation?.registrationNumberType,
|
|
1775
1918
|
data.registrationInformation?.taxInformation,
|
|
1919
|
+
isSingleMemberLlc,
|
|
1776
1920
|
rootLegalEntity
|
|
1777
1921
|
]);
|
|
1778
1922
|
/**
|
|
@@ -1813,8 +1957,7 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1813
1957
|
inferredCompanyStructure
|
|
1814
1958
|
]);
|
|
1815
1959
|
const { mutateAsync: updateLegalEntity, isPending: isUpdatingLegalEntity } = useUpdateLegalEntity();
|
|
1816
|
-
const
|
|
1817
|
-
const isLoading = isUpdatingLegalEntity || isCreatingLegalEntity || isLoadingAssociatedSoleProp;
|
|
1960
|
+
const isLoading = isUpdatingLegalEntity;
|
|
1818
1961
|
/**
|
|
1819
1962
|
* Form writes only reach the state on the next render so this prevents
|
|
1820
1963
|
* outdated data from being submitted. In Global Entry, we submit the form
|
|
@@ -1830,10 +1973,8 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1830
1973
|
try {
|
|
1831
1974
|
const newAccountHolder = await submitGlobalEntry({
|
|
1832
1975
|
legalEntity: rootLegalEntity,
|
|
1833
|
-
associatedSoleProp,
|
|
1834
1976
|
data: submittedData,
|
|
1835
1977
|
updateLegalEntity,
|
|
1836
|
-
createLegalEntity,
|
|
1837
1978
|
accountHolder,
|
|
1838
1979
|
isFeatureEnabled,
|
|
1839
1980
|
verifiedCompanyData: companySearchStateModel.verifiedBusiness.peek()
|
|
@@ -1857,7 +1998,7 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1857
1998
|
country,
|
|
1858
1999
|
multiForm,
|
|
1859
2000
|
activeFormId: activeForm.formId,
|
|
1860
|
-
isUsingCompanySearch: isUsingCompanySearch(
|
|
2001
|
+
isUsingCompanySearch: isUsingCompanySearch(data)
|
|
1861
2002
|
});
|
|
1862
2003
|
const { attemptBusinessSearch, confirmBusinessSelection } = useCompanySearchNextClickOverrides({
|
|
1863
2004
|
country,
|
|
@@ -1888,7 +2029,7 @@ var GlobalEntryModal = ({ rootLegalEntity, onComplete }) => {
|
|
|
1888
2029
|
}
|
|
1889
2030
|
const overrideNextClick = async () => {
|
|
1890
2031
|
if (!activeForm.isValid) return handleNextClick();
|
|
1891
|
-
if (!
|
|
2032
|
+
if (!isUsingCompanySearch(data)) return handleNextClick();
|
|
1892
2033
|
switch (activeForm.formId) {
|
|
1893
2034
|
case globalEntryForms.registrationInformation.formId: {
|
|
1894
2035
|
const currentForms = await attemptBusinessSearch();
|