@adyen/kyc-components 3.89.1 → 3.90.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.
Files changed (159) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-De5XWtcz.js → AcceptTermsOfServiceComponent-jlzA4hRO.js} +42 -60
  2. package/dist/{Accordion-CW9GGywE.js → Accordion-48qDUfrn.js} +1 -1
  3. package/dist/{AccountSetupRejected-_IN29uU8.js → AccountSetupRejected-eL8cEb4U.js} +3 -3
  4. package/dist/{ActionBar-CkNDXAZ3.js → ActionBar-BO6XSNuM.js} +1 -1
  5. package/dist/{Address-CIRweyT6.js → Address-BCTZUD2J.js} +25 -56
  6. package/dist/{Alert-Dr-PTLt5.js → Alert-DlSROjS7.js} +6 -6
  7. package/dist/{Avatar-DttOKUv4.js → Avatar-1DJaB2Fj.js} +1 -1
  8. package/dist/{BusinessDetailsMultiformDropin-ByrdkEK1.js → BusinessDetailsDropin-lXErWzqC.js} +1268 -3090
  9. package/dist/{BusinessFinancingComponent-D5Edu6Jp.js → BusinessFinancingComponent-C6wgWrZx.js} +6 -5
  10. package/dist/{BusinessFinancingDropin-D2J61fEL.js → BusinessFinancingDropin-Doz0wI42.js} +23 -33
  11. package/dist/{BusinessFinancingPage-C06ar5yw.js → BusinessFinancingPage-CWkMdnqc.js} +3 -3
  12. package/dist/{BusinessTypeSelectionPage-CP0UXFG_.js → BusinessTypeSelectionPage-DFJqkG5_.js} +8 -9
  13. package/dist/{Card-thNJfUJi.js → Card-I1r9oUx8.js} +2 -2
  14. package/dist/{ConstitutionalDocument-Dzckgb-_.js → ConstitutionalDocument-DdFjrLEq.js} +3 -3
  15. package/dist/{CountryField-CJeBvrKJ.js → CountryField-BO-n2nAh.js} +6 -6
  16. package/dist/{CreateIndividualComponent-BDAKxFP2.js → CreateIndividualComponent-D14kgQET.js} +5 -5
  17. package/dist/{CreateTransferInstrumentComponent-vfia76fK.js → CreateTransferInstrumentComponent-DOM7CWHW.js} +4 -4
  18. package/dist/{Currency-CJF_TGyQ.js → Currency-U_NBiYL_.js} +7 -7
  19. package/dist/{CustomerSupport-C_fh3_q2.js → CustomerSupport-gUFWyk3X.js} +10 -10
  20. package/dist/{DebugModal-8s0KmcYQ.js → DebugModal-B-9dnXq3.js} +9 -9
  21. package/dist/{DecisionMakerDetailsPage-BcaNuUzU.js → DecisionMakerDetailsPage-Y59IaBti.js} +6 -6
  22. package/dist/{DecisionMakers-BShMorMY.js → DecisionMakers-CXX7UaII.js} +20 -20
  23. package/dist/{EmbeddedStatus-Bsq1fp5z.js → EmbeddedStatus-DY5iLZFD.js} +2 -2
  24. package/dist/{EndStateLayout-BzHmhWSo.js → EndStateLayout-CwW4wDY8.js} +1 -1
  25. package/dist/{EntityAssociation-CzUai3Yh.js → EntityAssociation-CYAh0KGI.js} +8 -8
  26. package/dist/{EntityGuidanceStatus-B6luxhbo.js → EntityGuidanceStatus-Dkb_9kLQ.js} +2 -2
  27. package/dist/FormFlow-Dgc0gB-O.js +186 -0
  28. package/dist/{FormNavigation-trlYkLTT.js → FormNavigation-BE3rLf_S.js} +3 -3
  29. package/dist/{FormWrapper-CmShqeDn.js → FormWrapper-B7su5eh3.js} +10 -10
  30. package/dist/{IndividualOnfido-BziAZ51z.js → IndividualOnfido-DH3VYYau.js} +71 -74
  31. package/dist/{IndividualOnfidoDropin-DQpZ6OI1.js → IndividualOnfidoDropin-SiWSMsi9.js} +30 -33
  32. package/dist/{InputText-DmMvZip7.js → InputText-DR70nC51.js} +6 -6
  33. package/dist/{Introduction-Wu-LBXX2.js → Introduction-C2X6DyHw.js} +4 -4
  34. package/dist/{JpAddress-Bl9Ppmv5.js → JpAddress-CvQyBExq.js} +8 -8
  35. package/dist/{LegalRepresentativeDetailsPage-Cxy69AD6.js → LegalRepresentativeDetailsPage-Wf7cQkQn.js} +4 -4
  36. package/dist/{ListItem-DvTbHRWc.js → ListItem-BBHNYCCw.js} +2 -2
  37. package/dist/{ManageIndividualComponent-DIf-I6d0.js → ManageIndividualComponent-DPh2Jp_T.js} +4 -4
  38. package/dist/{ManageTermsOfServiceComponent-BK3ywG-g.js → ManageTermsOfServiceComponent-4-iML1dO.js} +4 -4
  39. package/dist/{ManageTransferInstrumentComponent-DHfft4DJ.js → ManageTransferInstrumentComponent-D8MMBSWg.js} +12 -12
  40. package/dist/{MaybeModal-Bw31z92e.js → MaybeModal-Us27ek4u.js} +15 -4
  41. package/dist/{Modal-B-CzUny3.js → Modal-W8cfdxrr.js} +4 -4
  42. package/dist/{OnboardingDropinComponent-Dc5Z3bna.js → OnboardingDropinComponent-HHq3dL3N.js} +1406 -1731
  43. package/dist/{PayoutDetailsDropin-DrESJrLF.js → PayoutDetailsDropin-M9FYw20B.js} +62 -42
  44. package/dist/ProgressBar-B7gTQncy.js +47 -0
  45. package/dist/{Review-CN0zdu0c.js → Review-CUNKnKSZ.js} +7 -7
  46. package/dist/{RootBusinessDetailsPage-DsCMT0gE.js → RootBusinessDetailsPage-DC0qALED.js} +7 -22
  47. package/dist/{RootBusinessLinesPage-D0djzhVg.js → RootBusinessLinesPage-B8gUQ93t.js} +146 -41
  48. package/dist/{RootIndividualDetailsPage-C49Q1XPl.js → RootIndividualDetailsPage-ULrh2_YN.js} +6 -6
  49. package/dist/{SignPCIComponent-Dm45H-8u.js → SignPCIComponent-MnotetIL.js} +10 -10
  50. package/dist/{SingpassSelection-DR7s4WiD.js → SingpassSelection-BWdMU1Lv.js} +4 -4
  51. package/dist/{SoleProprietorshipPage-C2_d7XKS.js → SoleProprietorshipPage-C9mxOyGm.js} +5 -19
  52. package/dist/{SourceOfFundsPage-SHeYHpGr.js → SourceOfFundsPage-bptpOZNp.js} +25 -25
  53. package/dist/{fieldConfigurations-Kb-fhpg7.js → Spacer-D-c-0ch_.js} +34 -24
  54. package/dist/{StepProgressIndicator-yqQhirdb.js → StepProgressIndicator--8FNnauI.js} +1 -1
  55. package/dist/{StoreProvider-BHckWEYg.js → StoreProvider-D_0Pta7w.js} +130 -98
  56. package/dist/{Summary-Df0SenAt.js → Summary-D741mrWG.js} +4 -4
  57. package/dist/{TaxReportingDropin-CKin6_Er.js → TaxReportingDropin-D2gjRJag.js} +16 -16
  58. package/dist/{TrustDetailsPage-C699_2RX.js → TrustDetailsPage-Dj64OqRJ.js} +27 -27
  59. package/dist/{TrustMemberCompanyPage-Bgh-8J6_.js → TrustMemberCompanyPage-DlnCvpf5.js} +6 -22
  60. package/dist/{TrustMemberIndividualPage-2gZsrdqt.js → TrustMemberIndividualPage-D8LSPYGf.js} +4 -4
  61. package/dist/{TrustMemberRoleAndTypePage-BB41jjVq.js → TrustMemberRoleAndTypePage-CN7oQduU.js} +15 -15
  62. package/dist/{TrustMembersOverview-DkpHLa-c.js → TrustMembersOverview-C2VH8NIl.js} +12 -12
  63. package/dist/{UnincorporatedPartnershipIndividualPage-uZBKkJwX.js → UnincorporatedPartnershipIndividualPage-fN2QrGh4.js} +4 -4
  64. package/dist/{UnincorporatedPartnershipMemberCompanyPage-CVa6qF3n.js → UnincorporatedPartnershipMemberCompanyPage-BUEeNfv-.js} +6 -22
  65. package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-Ctl2MPKX.js → UnincorporatedPartnershipMemberRoleAndTypePage-DeUAOKnx.js} +9 -9
  66. package/dist/{UnincorporatedPartnershipMembersOverview-DZPLX8gp.js → UnincorporatedPartnershipMembersOverview-EeE4JNAc.js} +9 -9
  67. package/dist/{VerificationErrorAlert-BVoljWxM.js → VerificationErrorAlert-COgw5uh1.js} +4 -4
  68. package/dist/{ViewVerificationStatusComponent-B_gl5t76.js → ViewVerificationStatusComponent-CaPz-G-G.js} +4 -4
  69. package/dist/adyen-business-financing.js +8 -4
  70. package/dist/adyen-individual-configuration.js +2 -2
  71. package/dist/adyen-individual-status.js +2 -2
  72. package/dist/adyen-kyc-components.js +20 -20
  73. package/dist/adyen-onboarding.js +2 -2
  74. package/dist/adyen-terms-of-service-management.js +2 -2
  75. package/dist/adyen-terms-of-service-status.js +2 -2
  76. package/dist/adyen-transfer-instrument-configuration.js +2 -2
  77. package/dist/adyen-transfer-instrument-management.js +2 -2
  78. package/dist/adyen-verification-status.js +2 -2
  79. package/dist/cross-circle-fill-maan7Z5S.js +17 -0
  80. package/dist/{debouncedInputEvent-C-zXYOuE.js → debouncedInputEvent-ZbuNEN6W.js} +2 -2
  81. package/dist/{documentUtils-l4Di7U18.js → documentUtils-XUGK4RIp.js} +3 -3
  82. package/dist/{dropinUtils-Cm6ETaTL.js → dropinUtils-Dggo6PZA.js} +4 -4
  83. package/dist/en-US-AgtwE4Fl.js +63 -0
  84. package/dist/{getFieldsWithExistingData-BdYN38hE.js → getFieldsWithExistingData-KwCfBJn2.js} +1 -1
  85. package/dist/{getName-BUZJBcAE.js → getName-B1UTZRuu.js} +2 -9
  86. package/dist/{hasDataChanged-D9Qx_JCQ.js → hasDataChanged-CSn4V18R.js} +2 -2
  87. package/dist/{iframeWidget-CemJJ3EA.js → iframeWidget-BDp1ajgy.js} +4 -4
  88. package/dist/info-filled-SQotHmT9.js +17 -0
  89. package/dist/{localizeDateString-DyXarzIl.js → localizeDateString-CZrFwyd0.js} +1 -1
  90. package/dist/{mapExistingFile-COnTFqXJ.js → mapExistingFile-D5fqNt1l.js} +2 -2
  91. package/dist/{mapFinancialReportsToFinancialInformation-BK4mXy3k.js → mapFinancialReportsToFinancialInformation-eCMwJnwj.js} +3 -3
  92. package/dist/{mapJpAddressSchemaToAddressLocalizations-BulGG0pe.js → mapJpAddressSchemaToAddressLocalizations-i8O5_wuI.js} +3 -3
  93. package/dist/{mapLegalEntityToIndividualOnfidoSchema-BMDtouhh.js → mapLegalEntityToIndividualOnfidoSchema-Cyg_384J.js} +3 -3
  94. package/dist/{mapTransferInstrumentToPayoutAccount-MpVqVhGS.js → mapTransferInstrumentToPayoutAccount-BOYDxAUf.js} +1 -1
  95. package/dist/{process-field-configurations-kh7VAcBh.js → process-field-configurations-ClLFHxX6.js} +3 -3
  96. package/dist/{resolveEnvironment-D-9wHJs2.js → resolveEnvironment-D8CEfrp4.js} +3 -3
  97. package/dist/{rules-DFisB-1M.js → rules-Cr3Ka8oq.js} +5 -5
  98. package/dist/style.css +268 -233
  99. package/dist/styles-CLV89_hH.js +268 -233
  100. package/dist/types/api/companySelection/useCompanySelection.d.ts +2 -18
  101. package/dist/types/components/Business/forms/AdditionalInformation/AdditionalInformation.d.ts +8 -2
  102. package/dist/types/components/Business/forms/BasicInformation/BasicInformation.d.ts +1 -3
  103. package/dist/types/components/Business/forms/BasicInformation/types.d.ts +5 -18
  104. package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +0 -21
  105. package/dist/types/components/Business/forms/BusinessSelection/BusinessSelection.d.ts +13 -2
  106. package/dist/types/components/Business/forms/BusinessSelection/types.d.ts +0 -11
  107. package/dist/types/components/Business/forms/CompanyStructure/CompanyStructure.d.ts +3 -2
  108. package/dist/types/components/Business/forms/CompanyStructure/types.d.ts +0 -6
  109. package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +1 -2
  110. package/dist/types/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsDropin.d.ts +3 -3
  111. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +7 -4
  112. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +23 -2
  113. package/dist/types/components/BusinessLines/forms/SctaForm/SctaInfoModal.d.ts +3 -0
  114. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/ServiceAgreementDropin.d.ts +1 -1
  115. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +2 -2
  116. package/dist/types/components/Shared/FormFlow/FormFlow.d.ts +1 -1
  117. package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +0 -2
  118. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  119. package/dist/types/components/ui/atoms/Link/Link.types.d.ts +1 -1
  120. package/dist/types/components/ui/atoms/Loader/Loader.d.ts +1 -5
  121. package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
  122. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +4 -0
  123. package/dist/types/context/ExperimentContext/types.d.ts +6 -5
  124. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  125. package/dist/{types-DJeg3Tz6.js → types-CR2U3VAD.js} +1 -1
  126. package/dist/{types-1iAHHNsZ.js → types-DjTezJBU.js} +1 -1
  127. package/dist/{types-CHr4VLHl.js → types-Dk94b8kx.js} +7 -6
  128. package/dist/{types-BDHLVBb5.js → types-Gm2SleFm.js} +1 -1
  129. package/dist/{useAssociatedLegalEntity-qIkD-MFM.js → useAssociatedLegalEntity-Pgb7_79V.js} +1 -1
  130. package/dist/{useCreateLegalEntity-CDFKMwwk.js → useCreateLegalEntity-Ba2rxRgb.js} +2 -2
  131. package/dist/{useDataset-D1AsbWmY.js → useDataset-RNFlX1-i.js} +4 -4
  132. package/dist/{useForm-DzONzNQu.js → useForm-C261ZUdn.js} +10 -9
  133. package/dist/{useGlobalData-B5sNYBl5.js → useGlobalData-COSDbjgb.js} +5 -5
  134. package/dist/{useMultiForm-Dd80_VRc.js → useMultiForm--zHGgbxw.js} +3 -3
  135. package/dist/{useOnboardingStatus-YrIRg4io.js → useOnboardingStatus-DytPj9Ai.js} +1 -1
  136. package/dist/{useScenarios-BkCy7ImD.js → useScenarios-eYrKID9N.js} +2 -2
  137. package/dist/{useTermsOfServiceStatus-D2rhp6YQ.js → useTermsOfServiceStatus-BYJqq3Oi.js} +1 -1
  138. package/dist/{useToastContext-5JlKjAbN.js → useToastContext-CqIJgGTa.js} +2 -2
  139. package/dist/{useUnincorporatedPartnershipMembers-Dwj2XshB.js → useUnincorporatedPartnershipMembers-HC3erocB.js} +4 -4
  140. package/dist/{useUpdateBusinessLines-DzLgvolo.js → useUpdateBusinessLines-Dq3B1Jvy.js} +2 -2
  141. package/dist/{useUpdateLegalEntity-BzuSuul0.js → useUpdateLegalEntity-BPQX_o3v.js} +3 -3
  142. package/dist/{utils-DjzolTRQ.js → utils-B_eQ3Eny.js} +3 -3
  143. package/dist/{utils-Da-KDnEH.js → utils-BbmGXGUy.js} +6 -6
  144. package/dist/{validate-D7GAD2-j.js → validate-ArlZWHo0.js} +1 -1
  145. package/dist/{validate-B48OR9iz.js → validate-B_v0PjtX.js} +1 -1
  146. package/dist/{validationError-DzkunflV.js → validationError-BQZWqXfp.js} +1 -1
  147. package/package.json +2 -2
  148. package/dist/FormFlow-CEyVMiHY.js +0 -224
  149. package/dist/en-US-CBsokt1L.js +0 -42
  150. package/dist/types/components/Business/forms/AdditionalInformation/AdditionalInformationMultiform.d.ts +0 -9
  151. package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +0 -11
  152. package/dist/types/components/Business/forms/BusinessDetails/BusinessDetails.d.ts +0 -3
  153. package/dist/types/components/Business/forms/BusinessSelection/BusinessSelectionMultiform.d.ts +0 -14
  154. package/dist/types/components/Business/forms/CompanyStructure/CompanyStructureMultiform.d.ts +0 -4
  155. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiformDropin.d.ts +0 -5
  156. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/types.d.ts +0 -2
  157. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/utils.d.ts +0 -23
  158. /package/dist/types/components/Business/{tasks/BusinessDetailsMultiformDropin → forms/BusinessDetails}/BusinessDetailsMultiform.d.ts +0 -0
  159. /package/dist/types/components/Business/tasks/{BusinessDetailsMultiformDropin → BusinessDetailsDropin}/validate.d.ts +0 -0
@@ -2,39 +2,53 @@
2
2
  {
3
3
  try {
4
4
  let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "582cd106-fb31-4b3c-a94e-67d7a9285dcb", e._sentryDebugIdIdentifier = "sentry-dbid-582cd106-fb31-4b3c-a94e-67d7a9285dcb");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "790fa728-b17f-44b2-a039-31d0c565a6f9", e._sentryDebugIdIdentifier = "sentry-dbid-790fa728-b17f-44b2-a039-31d0c565a6f9");
6
6
  } catch (e) {
7
7
  }
8
8
  }
9
9
  ;
10
- import { b as useApiContext, j as useQuery, k as httpPost, m as httpGet, o as useSettingsContext, p as useLocalStorage, g as getLegalEntityCountry, C as CountryCodes, q as isPartOfTrustFromLegalEntity, r as LegalEntityTypes, t as hasSolePropInLegalEntity, v as getLegalRepresentative, c as useLegalEntity, w as skipToken, x as doesLegalEntityRequiresLegalRepresentative, u as useTranslation, B as Button, y as Skeleton, z as translateStringOrObject, G as Typography, H as hasOwnEntityAssociationOfType, J as isEmptyEntity, K as useAccountHolder, M as EntityTypes, N as DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING, O as TaskTypes, P as createLogger, U as TaskStatuses, V as useI18nContext, W as isEmpty, i as isUndefinedOrNull, X as IconButton, Y as isISIN, Z as useExperimentsContext, R as ROOT_LE, L as Loader, $ as entriesOf, a0 as useAnalyticsContext, a1 as useMutation, a2 as useQueryClient, a3 as Icon, a4 as noop, a5 as isInstantVerifiedAccount, a6 as getObscuredAccountNumber, a7 as useGetTaskStatus, a8 as useGlobalStore, a9 as isPartOfUnincorporatedPartnership, aa as getOwnSignatories, ab as getOwnDecisionMakersLegalEntityIds, ac as getOwnSolePropProblems, ad as getOwnTrustProblems, ae as getOwnUnincorporatedPartnershipProblems, af as getOwnEntityAssociations, ag as TrustMemberTypes, ah as hasAllCapabilitiesResolved, ai as hasRejectedCapabilities, aj as objectsDeepEqual, a as addResourceBundles, _ as __variableDynamicImportRuntimeHelper } from "./StoreProvider-BHckWEYg.js";
10
+ import { b as useApiContext, j as useQuery, k as httpPost, m as httpGet, o as useSettingsContext, p as useLocalStorage, g as getLegalEntityCountry, C as CountryCodes, q as isPartOfTrustFromLegalEntity, r as LegalEntityTypes, t as hasSolePropInLegalEntity, v as getLegalRepresentative, c as useLegalEntity, w as skipToken, x as doesLegalEntityRequiresLegalRepresentative, u as useTranslation, B as Button, y as Skeleton, z as translateStringOrObject, G as Typography, H as hasOwnEntityAssociationOfType, J as isEmptyEntity, K as useAccountHolder, M as EntityTypes, N as DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING, O as TaskTypes, P as createLogger, U as TaskStatuses, V as useI18nContext, W as isEmpty, i as isUndefinedOrNull, X as useExperimentsContext, Y as IconButton, Z as isISIN, R as ROOT_LE, L as Loader, $ as useMutation, a0 as entriesOf, a1 as useQueryClient, a2 as useAnalyticsContext, a3 as Icon, a4 as noop, a5 as isInstantVerifiedAccount, a6 as getObscuredAccountNumber, a7 as useGetTaskStatus, a8 as useGlobalStore, a9 as isPartOfUnincorporatedPartnership, aa as getOwnSignatories, ab as getOwnDecisionMakersLegalEntityIds, ac as getOwnSolePropProblems, ad as getOwnTrustProblems, ae as getOwnUnincorporatedPartnershipProblems, af as getOwnEntityAssociations, ag as TrustMemberTypes, ah as hasAllCapabilitiesResolved, ai as hasRejectedCapabilities, aj as objectsDeepEqual, a as addResourceBundles, _ as __variableDynamicImportRuntimeHelper } from "./StoreProvider-D_0Pta7w.js";
11
11
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
12
12
  import { lazy, Suspense } from "preact/compat";
13
13
  import { useMemo, useReducer, useCallback, useEffect, useState, useRef } from "preact/hooks";
14
- import { S as SettingNames, I as InputText, T as TaskVerificationStatus } from "./InputText-DmMvZip7.js";
15
- import { T as TrustedFieldsProviders, I as Image, v as validatePatternOnBlur, a as validateNotEmptyOnBlur, m as makeMask, n as numericInputs, s as spacer, M as MaskedInput, b as alphanumericInputs, u as uppercase, c as nonInputs, d as alphaInputs, S as StateContextSetter, C as ContextGuidance, r as resolveFieldMetadata, e as validateLegalCompanyName, f as validateLatinSpaceMarkPunctuationOnlyOnBlur, g as validateJaKanaLegalCompanyName, h as validateJaHaniLegalCompanyName, R as RadioGroupCard, i as useCapabilityProblems } from "./fieldConfigurations-Kb-fhpg7.js";
16
- import { g as getTrustedFieldsProvider, C as CompanyTypesValues, a as getCompanyRegistrationNumberOptions, s as stateFormatGuidanceText, b as businessRegistrationNumberMasks, c as businessRegistrationNumberPatterns, v as vatNumberOptions, d as getVatNumberOptions, T as TAX_INFORMATION_FIELD, r as requestingBanking, e as requestingIssuing, f as exemptedFromTaxDefaultFieldMetadata, h as exemptedFromTaxDefaultFieldConfig, t as taxInformationDefaultFieldMetadata, i as taxInformationDefaultFieldConfig, j as TaxInformationField, k as toFullWidth, S as StateCodesUS, l as handleKeys, u as useAllowedCountries, m as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, n as COUNTRIES_USING_COMPANY_SEARCH, o as useSetting, p as individualOnfidoForms, q as individualForms, w as isBafinSignatoryFlow, x as showIdNowModal } from "./IndividualOnfido-BziAZ51z.js";
17
- import { u as useAssociatedLegalEntity } from "./useAssociatedLegalEntity-qIkD-MFM.js";
14
+ import { S as SettingNames, I as InputText, T as TaskVerificationStatus } from "./InputText-DR70nC51.js";
15
+ import { T as TrustedFieldsProviders, I as Image, v as validatePatternOnBlur, a as validateNotEmptyOnBlur, m as makeMask, n as numericInputs, s as spacer, M as MaskedInput, b as alphanumericInputs, u as uppercase, c as alphaInputs, d as nonInputs, S as StateContextSetter, C as ContextGuidance, r as resolveFieldMetadata, e as validateLegalCompanyName, f as validateLatinSpaceMarkPunctuationOnlyOnBlur, g as validateJaKanaLegalCompanyName, h as validateJaHaniLegalCompanyName, R as RadioGroupCard, i as useCapabilityProblems } from "./Spacer-D-c-0ch_.js";
16
+ import { g as getTrustedFieldsProvider, C as CompanyTypesValues, a as getCompanyRegistrationNumberOptions, s as stateFormatGuidanceText, b as businessRegistrationNumberMasks, c as businessRegistrationNumberPatterns, v as vatNumberOptions, d as getVatNumberOptions, T as TAX_INFORMATION_FIELD, r as requestingBanking, e as requestingIssuing, t as taxInformationDefaultFieldMetadata, f as taxInformationDefaultFieldConfig, h as TaxInformationField, i as toFullWidth, u as useAllowedCountries, j as COUNTRY_OF_GOVERNING_LAW_POSSIBLE, S as StateCodesUS, k as handleKeys, l as COUNTRIES_USING_COMPANY_SEARCH, m as useSetting, n as individualOnfidoForms, o as individualForms, p as isBafinSignatoryFlow, q as showIdNowModal } from "./IndividualOnfido-DH3VYYau.js";
17
+ import { u as useAssociatedLegalEntity } from "./useAssociatedLegalEntity-Pgb7_79V.js";
18
18
  import cx from "classnames";
19
- import { a as Alert } from "./Alert-Dr-PTLt5.js";
20
- import { u as useTermsOfServiceStatus, a as useTermsOfServiceAcceptanceInfos } from "./useTermsOfServiceStatus-D2rhp6YQ.js";
21
- import { a as useToastContext } from "./useToastContext-5JlKjAbN.js";
22
- import { c as createFormUtils, H as Header, L as List, g as getFormProps, E as ErrorPanel, a as Link, m as mergeFieldMetadataIntoProps, C as CountryField, S as StackLayout, b as COUNTRY_FIELD, U as UnincorporatedPartnershipMemberTypes } from "./CountryField-CJeBvrKJ.js";
23
- import { C as Card } from "./Card-thNJfUJi.js";
19
+ import { a as Alert } from "./Alert-DlSROjS7.js";
20
+ import { u as useTermsOfServiceStatus, a as useTermsOfServiceAcceptanceInfos } from "./useTermsOfServiceStatus-BYJqq3Oi.js";
21
+ import { a as useToastContext } from "./useToastContext-CqIJgGTa.js";
22
+ import { c as createFormUtils, H as Header, L as List, g as getFormProps, E as ErrorPanel, a as Link, m as mergeFieldMetadataIntoProps, C as CountryField, b as COUNTRY_FIELD, S as StackLayout, U as UnincorporatedPartnershipMemberTypes } from "./CountryField-BO-n2nAh.js";
23
+ import { C as Card } from "./Card-I1r9oUx8.js";
24
24
  import { signal } from "@preact/signals";
25
25
  import { d as downloadFile } from "./file-CiG1D0zy.js";
26
- import { C as Checkbox, u as useDebouncedCallback } from "./debouncedInputEvent-C-zXYOuE.js";
27
- import { F as Field, u as useForm, S as Select, L as LoaderWrapper } from "./useForm-DzONzNQu.js";
28
- import { R as RadioGroup, I as InputDate, f as formatDateObj, o as operationalAddressIsSameIds, A as Address, a as operationalAddressIsSameItems, g as getAddressSchemaForCountry, C as COUNTRIES_WITH_STATES_DATASET, u as useAddressCleanse, b as formatAddressForCleanse, m as mapAddressData, c as applyVerifiedBusinessData$1, d as getNestedTrustedFields, e as getAddressSchemaLabelsByCountry, S as STATE_FIELD, h as StateField, i as useFormContext } from "./Address-CIRweyT6.js";
29
- import { u as useGlobalDataSlice, a as useGlobalData, b as useStateContext } from "./useGlobalData-B5sNYBl5.js";
30
- import { I as InputNumber, a as InputCurrency, C as CURRENCY_FIELD, b as Currency, L as LegalFormField } from "./Currency-CJF_TGyQ.js";
31
- import { c as currencyByCountry } from "./types-1iAHHNsZ.js";
26
+ import { C as Checkbox, u as useDebouncedCallback } from "./debouncedInputEvent-ZbuNEN6W.js";
27
+ import { F as Field, u as useForm, S as Select, L as LoaderWrapper } from "./useForm-C261ZUdn.js";
28
+ import { R as RadioGroup, I as InputDate, f as formatDateObj, A as Address, u as useFormContext, g as getAddressSchemaForCountry, C as COUNTRIES_WITH_STATES_DATASET, a as useAddressCleanse, b as formatAddressForCleanse, m as mapAddressData, c as getNestedTrustedFields, d as getAddressSchemaLabelsByCountry, S as STATE_FIELD, e as StateField } from "./Address-BCTZUD2J.js";
29
+ import { u as useGlobalDataSlice } from "./useGlobalData-COSDbjgb.js";
30
+ import { I as InputNumber, a as InputCurrency, C as CURRENCY_FIELD, b as Currency, L as LegalFormField } from "./Currency-U_NBiYL_.js";
31
+ import { c as currencyByCountry } from "./types-DjTezJBU.js";
32
32
  import { createElement } from "preact";
33
- import { S as StructuredList, a as datasetUtilities, C as Confirm } from "./useDataset-D1AsbWmY.js";
34
- import { K as KEYBOARD_KEYS } from "./Modal-B-CzUny3.js";
35
- import { V as VerificationErrorAlert, u as useDeleteTransferInstrument } from "./VerificationErrorAlert-BVoljWxM.js";
36
- import { A as Avatar } from "./Avatar-DttOKUv4.js";
37
- import { g as getLegalEntityNameBasedOnType } from "./getName-BUZJBcAE.js";
33
+ import { S as StructuredList, a as datasetUtilities, C as Confirm } from "./useDataset-RNFlX1-i.js";
34
+ import { K as KEYBOARD_KEYS } from "./Modal-W8cfdxrr.js";
35
+ import { V as VerificationErrorAlert, u as useDeleteTransferInstrument } from "./VerificationErrorAlert-COgw5uh1.js";
36
+ import { A as Avatar } from "./Avatar-1DJaB2Fj.js";
37
+ import { g as getLegalEntityNameBasedOnType } from "./getName-B1UTZRuu.js";
38
+ const operationalAddressIsSameIds = {
39
+ OPERATIONAL_ADDRESS_IS_SAME: "OperationAddressAnswerYes",
40
+ OPERATIONAL_ADDRESS_IS_NOT_SAME: "OperationAddressAnswerNo"
41
+ };
42
+ const operationalAddressIsSameItems = [
43
+ {
44
+ id: operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME,
45
+ name: "operationalAddressIsSameItemName"
46
+ },
47
+ {
48
+ id: operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME,
49
+ name: "operationalAddressIsNotSameItemName"
50
+ }
51
+ ];
38
52
  const getPciStatus = async (legalEntityId, baseUrl, data) => {
39
53
  const filteredData = {
40
54
  ...data,
@@ -1584,7 +1598,7 @@ function BusinessRegistrationNumberField({
1584
1598
  const showExemptedOption = canExempt && !!registrationNumberOptions && registrationNumberOptions.length > 1;
1585
1599
  const registrationNumberType = data.exemptedFromRegistrationNumber ? "exempted" : data.registrationNumberType ? data.registrationNumberType : defaultType;
1586
1600
  const handleRegistrationNumberChange = (e, mode) => {
1587
- const value = typeof e === "string" ? e : e.target?.value;
1601
+ const value = typeof e === "string" ? e : e.currentTarget.value;
1588
1602
  handleChangeFor("registrationNumber", mode)(value);
1589
1603
  handleChangeFor("registrationNumberType")(registrationNumberType);
1590
1604
  };
@@ -2238,62 +2252,420 @@ const eInvoicingCodeFieldMetadata = {
2238
2252
  }
2239
2253
  }
2240
2254
  };
2241
- const vatAbsenceReasonMetadata = {
2242
- validators: [validateNotEmptyOnBlur]
2255
+ const industryCodeFieldValidation = () => ({
2256
+ industryCodes: {
2257
+ modes: ["blur"],
2258
+ validate: (industryCode) => !isEmpty(industryCode),
2259
+ errorMessage: "fieldIsRequired"
2260
+ }
2261
+ });
2262
+ const industryCodeFieldMetadata = {
2263
+ label: "industry",
2264
+ validators: [
2265
+ industryCodeFieldValidation().industryCodes
2266
+ ]
2243
2267
  };
2244
- const defaultFieldMetadata$2 = {
2245
- label: "vatNumber"
2268
+ const selectedBusinessLine = signal(void 0);
2269
+ const shouldSignNewPci = signal(false);
2270
+ const industryCodesContent = "adyen-kyc-industry-codes-content";
2271
+ const industryCodesSelection = "adyen-kyc-industry-codes-selection";
2272
+ const styles$1 = {
2273
+ industryCodesContent,
2274
+ industryCodesSelection
2246
2275
  };
2247
- const defaultFieldConfig$2 = {
2248
- [CountryCodes.Austria]: {
2249
- label: "UST-ID",
2250
- validators: validatePatternOnBlur(/^ATU\d{8}$/),
2251
- mask: {
2252
- mask: makeMask(...nonInputs("ATU", { includeInValue: true }), spacer, ...numericInputs(8))
2253
- },
2254
- guidanceText: {
2255
- key: "enterTheRemainingNDigitsForExample",
2256
- values: {
2257
- numDigits: "8",
2258
- example: "ATU51507409"
2259
- }
2276
+ const mapSelectedCodes = (selectedCodes) => {
2277
+ return selectedCodes && selectedCodes.length > 0 ? selectedCodes.map((i) => {
2278
+ return {
2279
+ value: i,
2280
+ touched: !!i.id
2281
+ };
2282
+ }) : [{ value: { id: "", name: "" }, touched: false }];
2283
+ };
2284
+ function IndustryCodeField({
2285
+ data,
2286
+ valid,
2287
+ errors,
2288
+ labels,
2289
+ placeholders,
2290
+ readonly,
2291
+ handleChangeFor,
2292
+ guidanceText,
2293
+ setErrors,
2294
+ // need to manually set errors due to nested select components
2295
+ setValid,
2296
+ // need to manually set validation due to nested select components
2297
+ businessLineTypes,
2298
+ single = false,
2299
+ industryCodes,
2300
+ existingBusinessLines
2301
+ }) {
2302
+ const { t } = useTranslation("ui");
2303
+ const industryCodesRef = useRef(null);
2304
+ const { isExperimentEnabled } = useExperimentsContext();
2305
+ const singleIndustryCode = single || !!selectedBusinessLine.value || // when editing a business line, only single dropdown should render
2306
+ isExperimentEnabled("EnableLimitToSingleBusinessLine");
2307
+ const allIndustryCodeSelectItems = useMemo(
2308
+ () => industryCodes?.map((entry) => ({
2309
+ id: entry.code,
2310
+ name: `${entry.code} - ${entry.description}`
2311
+ })) ?? [],
2312
+ [industryCodes]
2313
+ );
2314
+ const selectableIndustryCodes = useMemo(() => {
2315
+ if (!businessLineTypes.includes("acquiring")) return allIndustryCodeSelectItems;
2316
+ const selectedIds = data.industryCodes?.map((c) => c.id);
2317
+ const existingIds = (existingBusinessLines ?? []).map((b) => b.industryCode);
2318
+ return allIndustryCodeSelectItems.filter((item) => {
2319
+ const isDuplicate = selectedIds?.includes(item.id) || existingIds?.includes(item.id);
2320
+ return !isDuplicate;
2321
+ });
2322
+ }, [allIndustryCodeSelectItems, businessLineTypes, data.industryCodes, existingBusinessLines]);
2323
+ const selectedCodes = data.industryCodes;
2324
+ const [items, setItems] = useState(mapSelectedCodes(selectedCodes));
2325
+ useEffect(() => {
2326
+ setItems(mapSelectedCodes(selectedCodes));
2327
+ }, [selectedCodes]);
2328
+ const updateIndustryCodes = (value) => {
2329
+ handleChangeFor("industryCodes")(value);
2330
+ };
2331
+ const addIndustryCodeField = (e) => {
2332
+ if (items[items.length - 1].value.id === "") {
2333
+ handleIndustryCodeFocusOut(e, items.length - 1);
2334
+ return;
2260
2335
  }
2261
- },
2262
- [CountryCodes.Belgium]: {
2263
- label: "euVatNumber",
2264
- validators: validatePatternOnBlur(/^BE[10]\d{9}$/),
2265
- mask: {
2266
- mask: makeMask(...nonInputs("BE", { includeInValue: true }), spacer, ...numericInputs(10))
2267
- },
2268
- guidanceText: {
2269
- key: "enterTheRemainingNDigitsForExample",
2270
- values: {
2271
- numDigits: "10",
2272
- example: "BE1234567890"
2273
- }
2336
+ const newItems = [...items, { value: { id: "", name: "" }, touched: false }];
2337
+ setItems(newItems);
2338
+ updateIndustryCodes(newItems.map((item) => item.value));
2339
+ };
2340
+ const removeField = (indexToRemove) => {
2341
+ const newItems = items.filter((_, index) => index !== indexToRemove);
2342
+ setItems(newItems);
2343
+ updateIndustryCodes(newItems.map((item) => item.value));
2344
+ };
2345
+ const handleSelectIndustryCode = (indexToUpdate, selectedItem) => {
2346
+ setItems((prevItems) => {
2347
+ const newItems = [...prevItems];
2348
+ newItems[indexToUpdate] = {
2349
+ value: {
2350
+ id: selectedItem.id,
2351
+ name: selectedItem.name
2352
+ },
2353
+ touched: true
2354
+ };
2355
+ updateIndustryCodes(
2356
+ newItems.map((item) => {
2357
+ return {
2358
+ id: item.value.id,
2359
+ name: item.value.name
2360
+ };
2361
+ })
2362
+ );
2363
+ return newItems;
2364
+ });
2365
+ };
2366
+ const handleIndustryCodeFocusOut = (e, index) => {
2367
+ if (industryCodesRef.current && !industryCodesRef.current.contains(e.relatedTarget)) {
2368
+ setItems((prevItems) => {
2369
+ if (prevItems[index].value.id || prevItems[index].touched) {
2370
+ return prevItems;
2371
+ }
2372
+ const newItems = [...prevItems];
2373
+ newItems[index] = { ...newItems[index], touched: true };
2374
+ const isGroupInvalid = newItems.some((item) => item.value.id === "");
2375
+ if (isGroupInvalid) {
2376
+ setErrors?.(
2377
+ "industryCodes",
2378
+ {
2379
+ isValid: false,
2380
+ errorMessage: "fieldIsRequired",
2381
+ hasError: true
2382
+ },
2383
+ "industryCodesForm"
2384
+ );
2385
+ setValid?.("industryCodes", false, "industryCodesForm");
2386
+ } else {
2387
+ setErrors?.("industryCodes", null, "industryCodesForm");
2388
+ setValid?.("industryCodes", true, "industryCodesForm");
2389
+ }
2390
+ return newItems;
2391
+ });
2274
2392
  }
2275
- },
2276
- [CountryCodes.Bulgaria]: {
2277
- label: "identifikacionenNomerDDS",
2278
- validators: validatePatternOnBlur(/^BG\d{9,10}$/),
2279
- mask: {
2280
- mask: makeMask(
2281
- ...nonInputs("BG", { includeInValue: true }),
2282
- spacer,
2283
- ...numericInputs(9),
2284
- ...numericInputs(1, true)
2285
- )
2286
- },
2287
- guidanceText: {
2288
- key: "enterTheRemainingXToYDigitsForExample",
2289
- values: {
2290
- minDigits: "9",
2291
- maxDigits: "10",
2292
- example: "BG1234567890"
2293
- }
2393
+ };
2394
+ return /* @__PURE__ */ jsx(
2395
+ Field,
2396
+ {
2397
+ name: "industryCodes",
2398
+ label: labels?.industryCodes || t(($) => $["industry"]),
2399
+ errorMessage: errors.industryCodes,
2400
+ isValid: valid.industryCodes,
2401
+ formatGuidance: guidanceText.industryCodes,
2402
+ showErrorIcon: false,
2403
+ children: (childProps) => /* @__PURE__ */ jsx(Wrapper, { single: singleIndustryCode, children: /* @__PURE__ */ jsx("div", { className: styles$1.industryCodesContent, ref: industryCodesRef, children: items.map((code, index) => {
2404
+ const isInvalid = code.touched && code.value.id === "";
2405
+ return /* @__PURE__ */ jsxs("div", { className: styles$1.industryCodesSelection, children: [
2406
+ /* @__PURE__ */ jsx(
2407
+ Select,
2408
+ {
2409
+ ...childProps,
2410
+ id: `industryCodeSelection-${index}`,
2411
+ name: `industryCodeSelection-${index}`,
2412
+ selected: code.value,
2413
+ placeholder: placeholders?.industryCodes || t(($) => $["industryCode__placeholder"]),
2414
+ items: allIndustryCodeSelectItems,
2415
+ excludedValues: allIndustryCodeSelectItems.filter(
2416
+ (i) => !selectableIndustryCodes.includes(i)
2417
+ ),
2418
+ readonly: !!data.industryCodes && readonly || !!industryCodes && selectableIndustryCodes.length === 0,
2419
+ onSelect: (selectedItem) => handleSelectIndustryCode(index, selectedItem),
2420
+ isInvalid,
2421
+ onBlur: (e) => handleIndustryCodeFocusOut(e, index)
2422
+ }
2423
+ ),
2424
+ !singleIndustryCode && /* @__PURE__ */ jsxs(Fragment, { children: [
2425
+ /* @__PURE__ */ jsx(
2426
+ IconButton,
2427
+ {
2428
+ ariaLabel: t(($) => $["removeIndustryCode"]),
2429
+ variant: "tertiary",
2430
+ icon: "minusCircleFilled",
2431
+ circle: true,
2432
+ onClick: () => removeField(index),
2433
+ disabled: items.length === 1 || readonly
2434
+ }
2435
+ ),
2436
+ /* @__PURE__ */ jsx(
2437
+ IconButton,
2438
+ {
2439
+ ariaLabel: t(($) => $["addIndustryCode"]),
2440
+ variant: "tertiary",
2441
+ icon: "plusCircleFilled",
2442
+ circle: true,
2443
+ onClick: addIndustryCodeField,
2444
+ disabled: readonly || code.value.id === "" || code.value.id !== "" && index !== items.length - 1 || selectableIndustryCodes.length === 0
2445
+ }
2446
+ )
2447
+ ] })
2448
+ ] }, code.value.id);
2449
+ }) }) })
2294
2450
  }
2451
+ );
2452
+ }
2453
+ function Wrapper({ single, children }) {
2454
+ return single ? children : /* @__PURE__ */ jsx(List, { dividers: false, variant: "grouped-primary", children });
2455
+ }
2456
+ const stockExchangeMICFieldMetadata = {
2457
+ label: "stockExchangeMIC",
2458
+ validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
2459
+ mask: {
2460
+ mask: makeMask(...alphanumericInputs(4)),
2461
+ transformOnType: uppercase
2295
2462
  },
2296
- [CountryCodes.Croatia]: {
2463
+ guidanceText: {
2464
+ key: "enterNCharactersForExample",
2465
+ values: {
2466
+ numChars: "4",
2467
+ example: "XNAS"
2468
+ }
2469
+ }
2470
+ };
2471
+ const STOCK_EXCHANGE_MIC_FIELD = [
2472
+ "stockExchangeMIC"
2473
+ ];
2474
+ function StockExchangeMICField({
2475
+ data,
2476
+ valid,
2477
+ errors,
2478
+ labels,
2479
+ placeholders,
2480
+ readonly,
2481
+ mask,
2482
+ guidanceText,
2483
+ shouldValidate,
2484
+ handleChangeFor
2485
+ }) {
2486
+ return /* @__PURE__ */ jsx(
2487
+ MaskedInput,
2488
+ {
2489
+ name: "stockExchangeMIC",
2490
+ type: "text",
2491
+ label: labels.stockExchangeMIC ?? "",
2492
+ formatGuidance: guidanceText?.stockExchangeMIC,
2493
+ placeholder: placeholders?.stockExchangeMIC,
2494
+ ...mask,
2495
+ errorMessage: errors.stockExchangeMIC,
2496
+ isValid: valid.stockExchangeMIC ?? false,
2497
+ value: data.stockExchangeMIC ?? "",
2498
+ readonly,
2499
+ shouldValidate,
2500
+ onInput: handleChangeFor("stockExchangeMIC", "input"),
2501
+ onBlur: handleChangeFor("stockExchangeMIC", "blur"),
2502
+ "aria-required": true,
2503
+ "aria-invalid": !valid.stockExchangeMIC
2504
+ }
2505
+ );
2506
+ }
2507
+ const stockISINFieldMetadata = {
2508
+ label: "stockISIN",
2509
+ validators: [
2510
+ validateNotEmptyOnBlur,
2511
+ {
2512
+ modes: ["blur"],
2513
+ validate: (value) => !!value && isISIN(value)
2514
+ }
2515
+ ],
2516
+ mask: {
2517
+ mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
2518
+ transformOnType: uppercase
2519
+ },
2520
+ helperText: "stockISINHelper",
2521
+ guidanceText: {
2522
+ key: "validationPleaseEnterAValidStockISIN",
2523
+ values: {
2524
+ example: "NL0012969182"
2525
+ }
2526
+ }
2527
+ };
2528
+ const STOCK_ISIN_FIELD = ["stockISIN"];
2529
+ function StockISINField({
2530
+ data,
2531
+ valid,
2532
+ errors,
2533
+ labels,
2534
+ placeholders,
2535
+ readonly,
2536
+ mask,
2537
+ guidanceText,
2538
+ shouldValidate,
2539
+ handleChangeFor
2540
+ }) {
2541
+ return /* @__PURE__ */ jsx(
2542
+ MaskedInput,
2543
+ {
2544
+ name: "stockISIN",
2545
+ type: "text",
2546
+ label: labels.stockISIN ?? "",
2547
+ formatGuidance: guidanceText?.stockISIN,
2548
+ placeholder: placeholders?.stockISIN,
2549
+ ...mask,
2550
+ errorMessage: errors.stockISIN,
2551
+ isValid: valid.stockISIN ?? false,
2552
+ value: data.stockISIN ?? "",
2553
+ readonly,
2554
+ shouldValidate,
2555
+ onInput: handleChangeFor("stockISIN", "input"),
2556
+ onBlur: handleChangeFor("stockISIN", "blur"),
2557
+ "aria-required": true,
2558
+ "aria-invalid": !valid.stockISIN
2559
+ }
2560
+ );
2561
+ }
2562
+ const stockTickerSymbolFieldMetadata = {
2563
+ label: "stockTickerSymbol",
2564
+ validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
2565
+ mask: {
2566
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
2567
+ transformOnType: uppercase
2568
+ },
2569
+ guidanceText: {
2570
+ key: "enterAMaximumOfNCharactersForExample",
2571
+ values: {
2572
+ maxChars: "5",
2573
+ example: "ADYEN"
2574
+ }
2575
+ }
2576
+ };
2577
+ const STOCK_TICKER_SYMBOL_FIELD = [
2578
+ "stockTickerSymbol"
2579
+ ];
2580
+ function StockTickerSymbolField({
2581
+ data,
2582
+ valid,
2583
+ errors,
2584
+ labels,
2585
+ placeholders,
2586
+ readonly,
2587
+ mask,
2588
+ guidanceText,
2589
+ shouldValidate,
2590
+ handleChangeFor
2591
+ }) {
2592
+ return /* @__PURE__ */ jsx(
2593
+ MaskedInput,
2594
+ {
2595
+ name: "stockTickerSymbol",
2596
+ type: "text",
2597
+ label: labels.stockTickerSymbol ?? "",
2598
+ formatGuidance: guidanceText?.stockTickerSymbol,
2599
+ placeholder: placeholders?.stockTickerSymbol,
2600
+ ...mask,
2601
+ errorMessage: errors.stockTickerSymbol,
2602
+ isValid: valid.stockTickerSymbol ?? false,
2603
+ value: data.stockTickerSymbol ?? "",
2604
+ readonly,
2605
+ shouldValidate,
2606
+ onInput: handleChangeFor("stockTickerSymbol", "input"),
2607
+ onBlur: handleChangeFor("stockTickerSymbol", "blur"),
2608
+ "aria-required": true,
2609
+ "aria-invalid": !valid.stockTickerSymbol
2610
+ }
2611
+ );
2612
+ }
2613
+ const vatAbsenceReasonMetadata = {
2614
+ validators: [validateNotEmptyOnBlur]
2615
+ };
2616
+ const defaultFieldMetadata$2 = {
2617
+ label: "vatNumber"
2618
+ };
2619
+ const defaultFieldConfig$2 = {
2620
+ [CountryCodes.Austria]: {
2621
+ label: "UST-ID",
2622
+ validators: validatePatternOnBlur(/^ATU\d{8}$/),
2623
+ mask: {
2624
+ mask: makeMask(...nonInputs("ATU", { includeInValue: true }), spacer, ...numericInputs(8))
2625
+ },
2626
+ guidanceText: {
2627
+ key: "enterTheRemainingNDigitsForExample",
2628
+ values: {
2629
+ numDigits: "8",
2630
+ example: "ATU51507409"
2631
+ }
2632
+ }
2633
+ },
2634
+ [CountryCodes.Belgium]: {
2635
+ label: "euVatNumber",
2636
+ validators: validatePatternOnBlur(/^BE[10]\d{9}$/),
2637
+ mask: {
2638
+ mask: makeMask(...nonInputs("BE", { includeInValue: true }), spacer, ...numericInputs(10))
2639
+ },
2640
+ guidanceText: {
2641
+ key: "enterTheRemainingNDigitsForExample",
2642
+ values: {
2643
+ numDigits: "10",
2644
+ example: "BE1234567890"
2645
+ }
2646
+ }
2647
+ },
2648
+ [CountryCodes.Bulgaria]: {
2649
+ label: "identifikacionenNomerDDS",
2650
+ validators: validatePatternOnBlur(/^BG\d{9,10}$/),
2651
+ mask: {
2652
+ mask: makeMask(
2653
+ ...nonInputs("BG", { includeInValue: true }),
2654
+ spacer,
2655
+ ...numericInputs(9),
2656
+ ...numericInputs(1, true)
2657
+ )
2658
+ },
2659
+ guidanceText: {
2660
+ key: "enterTheRemainingXToYDigitsForExample",
2661
+ values: {
2662
+ minDigits: "9",
2663
+ maxDigits: "10",
2664
+ example: "BG1234567890"
2665
+ }
2666
+ }
2667
+ },
2668
+ [CountryCodes.Croatia]: {
2297
2669
  label: "PDVIdBrojOIB",
2298
2670
  validators: validatePatternOnBlur(/^HR\d{11}$/),
2299
2671
  mask: {
@@ -2902,439 +3274,83 @@ const inferVatNumberType = (vatNumber, country) => {
2902
3274
  function getDefaultVatNumberType(vatNumber, country) {
2903
3275
  return vatNumber ? inferVatNumberType(vatNumber, country) : vatNumberOptions[country]?.[0]?.id;
2904
3276
  }
2905
- const industryCodeFieldValidation = () => ({
2906
- industryCodes: {
2907
- modes: ["blur"],
2908
- validate: (industryCode) => !isEmpty(industryCode),
2909
- errorMessage: "fieldIsRequired"
2910
- }
2911
- });
2912
- const industryCodeFieldMetadata = {
2913
- label: "industry",
2914
- validators: [
2915
- industryCodeFieldValidation().industryCodes
2916
- ]
2917
- };
2918
- const selectedBusinessLine = signal(void 0);
2919
- const shouldSignNewPci = signal(false);
2920
- const industryCodesContent = "adyen-kyc-industry-codes-content";
2921
- const industryCodesSelection = "adyen-kyc-industry-codes-selection";
2922
- const styles$1 = {
2923
- industryCodesContent,
2924
- industryCodesSelection
2925
- };
2926
- const mapSelectedCodes = (selectedCodes) => {
2927
- return selectedCodes && selectedCodes.length > 0 ? selectedCodes.map((i) => {
2928
- return {
2929
- value: i,
2930
- touched: !!i.id
2931
- };
2932
- }) : [{ value: { id: "", name: "" }, touched: false }];
2933
- };
2934
- function IndustryCodeField({
2935
- data,
2936
- valid,
2937
- errors,
2938
- labels,
2939
- placeholders,
2940
- readonly,
2941
- handleChangeFor,
2942
- guidanceText,
2943
- setErrors,
2944
- // need to manually set errors due to nested select components
2945
- setValid,
2946
- // need to manually set validation due to nested select components
2947
- businessLineTypes,
2948
- single = false,
2949
- industryCodes,
2950
- existingBusinessLines
2951
- }) {
2952
- const { t } = useTranslation("ui");
2953
- const industryCodesRef = useRef(null);
2954
- const singleIndustryCode = single || !!selectedBusinessLine.value;
2955
- const allIndustryCodeSelectItems = useMemo(
2956
- () => industryCodes?.map((entry) => ({
2957
- id: entry.code,
2958
- name: `${entry.code} - ${entry.description}`
2959
- })) ?? [],
2960
- [industryCodes]
3277
+ function VatNumberTypeSelector({
3278
+ country,
3279
+ companyType,
3280
+ selected,
3281
+ setSelected,
3282
+ exemptedOption
3283
+ }) {
3284
+ const { t } = useTranslation("common");
3285
+ const handleSelect = useCallback(
3286
+ (selectedStr) => {
3287
+ const newSelected = selectedStr;
3288
+ if (newSelected === "exempted") {
3289
+ if (exemptedOption) {
3290
+ setSelected(newSelected, true);
3291
+ }
3292
+ return;
3293
+ }
3294
+ setSelected(newSelected, false);
3295
+ },
3296
+ [exemptedOption, setSelected]
2961
3297
  );
2962
- const selectableIndustryCodes = useMemo(() => {
2963
- if (!businessLineTypes.includes("acquiring")) return allIndustryCodeSelectItems;
2964
- const selectedIds = data.industryCodes?.map((c) => c.id);
2965
- const existingIds = (existingBusinessLines ?? []).map((b) => b.industryCode);
2966
- return allIndustryCodeSelectItems.filter((item) => {
2967
- const isDuplicate = selectedIds?.includes(item.id) || existingIds?.includes(item.id);
2968
- return !isDuplicate;
2969
- });
2970
- }, [allIndustryCodeSelectItems, businessLineTypes, data.industryCodes, existingBusinessLines]);
2971
- const selectedCodes = data.industryCodes;
2972
- const [items, setItems] = useState(mapSelectedCodes(selectedCodes));
3298
+ const options = useMemo(() => {
3299
+ const availableOptions = getVatNumberOptions(country, companyType) ?? [];
3300
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
3301
+ return [
3302
+ ...availableOptions,
3303
+ {
3304
+ id: "exempted",
3305
+ name: exemptedOption
3306
+ }
3307
+ ];
3308
+ }, [country, companyType, exemptedOption]);
2973
3309
  useEffect(() => {
2974
- setItems(mapSelectedCodes(selectedCodes));
2975
- }, [selectedCodes]);
2976
- const updateIndustryCodes = (value) => {
2977
- handleChangeFor("industryCodes")(value);
2978
- };
2979
- const addIndustryCodeField = (e) => {
2980
- if (items[items.length - 1].value.id === "") {
2981
- handleIndustryCodeFocusOut(e, items.length - 1);
2982
- return;
2983
- }
2984
- const newItems = [...items, { value: { id: "", name: "" }, touched: false }];
2985
- setItems(newItems);
2986
- updateIndustryCodes(newItems.map((item) => item.value));
2987
- };
2988
- const removeField = (indexToRemove) => {
2989
- const newItems = items.filter((_, index) => index !== indexToRemove);
2990
- setItems(newItems);
2991
- updateIndustryCodes(newItems.map((item) => item.value));
2992
- };
2993
- const handleSelectIndustryCode = (indexToUpdate, selectedItem) => {
2994
- setItems((prevItems) => {
2995
- const newItems = [...prevItems];
2996
- newItems[indexToUpdate] = {
2997
- value: {
2998
- id: selectedItem.id,
2999
- name: selectedItem.name
3000
- },
3001
- touched: true
3002
- };
3003
- updateIndustryCodes(
3004
- newItems.map((item) => {
3005
- return {
3006
- id: item.value.id,
3007
- name: item.value.name
3008
- };
3009
- })
3010
- );
3011
- return newItems;
3012
- });
3013
- };
3014
- const handleIndustryCodeFocusOut = (e, index) => {
3015
- if (industryCodesRef.current && !industryCodesRef.current.contains(e.relatedTarget)) {
3016
- setItems((prevItems) => {
3017
- if (prevItems[index].value.id || prevItems[index].touched) {
3018
- return prevItems;
3019
- }
3020
- const newItems = [...prevItems];
3021
- newItems[index] = { ...newItems[index], touched: true };
3022
- const isGroupInvalid = newItems.some((item) => item.value.id === "");
3023
- if (isGroupInvalid) {
3024
- setErrors?.(
3025
- "industryCodes",
3026
- {
3027
- isValid: false,
3028
- errorMessage: "fieldIsRequired",
3029
- hasError: true
3030
- },
3031
- "industryCodesForm"
3032
- );
3033
- setValid?.("industryCodes", false, "industryCodesForm");
3034
- } else {
3035
- setErrors?.("industryCodes", null, "industryCodesForm");
3036
- setValid?.("industryCodes", true, "industryCodesForm");
3037
- }
3038
- return newItems;
3039
- });
3310
+ if (!selected && options.length > 0) {
3311
+ handleSelect(options[0].id);
3040
3312
  }
3041
- };
3313
+ }, [options, selected, handleSelect]);
3314
+ if (options.length <= 1) return null;
3042
3315
  return /* @__PURE__ */ jsx(
3043
3316
  Field,
3044
3317
  {
3045
- name: "industryCodes",
3046
- label: labels?.industryCodes || t(($) => $["industry"]),
3047
- errorMessage: errors.industryCodes,
3048
- isValid: valid.industryCodes,
3049
- formatGuidance: guidanceText.industryCodes,
3050
- showErrorIcon: false,
3051
- children: (childProps) => /* @__PURE__ */ jsx(Wrapper, { single: singleIndustryCode, children: /* @__PURE__ */ jsx("div", { className: styles$1.industryCodesContent, ref: industryCodesRef, children: items.map((code, index) => {
3052
- const isInvalid = code.touched && code.value.id === "";
3053
- return /* @__PURE__ */ jsxs("div", { className: styles$1.industryCodesSelection, children: [
3054
- /* @__PURE__ */ jsx(
3055
- Select,
3056
- {
3057
- ...childProps,
3058
- id: `industryCodeSelection-${index}`,
3059
- name: `industryCodeSelection-${index}`,
3060
- selected: code.value,
3061
- placeholder: placeholders?.industryCodes || t(($) => $["industryCode__placeholder"]),
3062
- items: allIndustryCodeSelectItems,
3063
- excludedValues: allIndustryCodeSelectItems.filter(
3064
- (i) => !selectableIndustryCodes.includes(i)
3065
- ),
3066
- readonly: !!data.industryCodes && readonly || !!industryCodes && selectableIndustryCodes.length === 0,
3067
- onSelect: (selectedItem) => handleSelectIndustryCode(index, selectedItem),
3068
- isInvalid,
3069
- onBlur: (e) => handleIndustryCodeFocusOut(e, index)
3070
- }
3071
- ),
3072
- !singleIndustryCode && /* @__PURE__ */ jsxs(Fragment, { children: [
3073
- /* @__PURE__ */ jsx(
3074
- IconButton,
3075
- {
3076
- ariaLabel: t(($) => $["removeIndustryCode"]),
3077
- variant: "tertiary",
3078
- icon: "minusCircleFilled",
3079
- circle: true,
3080
- onClick: () => removeField(index),
3081
- disabled: items.length === 1 || readonly
3082
- }
3083
- ),
3084
- /* @__PURE__ */ jsx(
3085
- IconButton,
3086
- {
3087
- ariaLabel: t(($) => $["addIndustryCode"]),
3088
- variant: "tertiary",
3089
- icon: "plusCircleFilled",
3090
- circle: true,
3091
- onClick: addIndustryCodeField,
3092
- disabled: readonly || code.value.id === "" || code.value.id !== "" && index !== items.length - 1 || selectableIndustryCodes.length === 0
3093
- }
3094
- )
3095
- ] })
3096
- ] }, code.value.id);
3097
- }) }) })
3318
+ el: "fieldset",
3319
+ name: "vatNumberType",
3320
+ label: t(($) => $["whichTypeOfTaxIdNumberDoYouHave"]),
3321
+ children: (childProps) => /* @__PURE__ */ jsx(
3322
+ RadioGroup,
3323
+ {
3324
+ ...childProps,
3325
+ name: "vatNumberType",
3326
+ items: options,
3327
+ value: selected,
3328
+ onChange: handleSelect
3329
+ }
3330
+ )
3098
3331
  }
3099
3332
  );
3100
3333
  }
3101
- function Wrapper({ single, children }) {
3102
- return single ? children : /* @__PURE__ */ jsx(List, { dividers: false, variant: "grouped-primary", children });
3103
- }
3104
- const stockExchangeMICFieldMetadata = {
3105
- label: "stockExchangeMIC",
3106
- validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
3107
- mask: {
3108
- mask: makeMask(...alphanumericInputs(4)),
3109
- transformOnType: uppercase
3110
- },
3111
- guidanceText: {
3112
- key: "enterNCharactersForExample",
3113
- values: {
3114
- numChars: "4",
3115
- example: "XNAS"
3116
- }
3117
- }
3118
- };
3119
- const STOCK_EXCHANGE_MIC_FIELD = [
3120
- "stockExchangeMIC"
3334
+ const VAT_NUMBER_FIELD = [
3335
+ "vatNumber",
3336
+ "vatNumberType",
3337
+ "exemptedFromVat",
3338
+ "vatAbsenceReason"
3121
3339
  ];
3122
- function StockExchangeMICField({
3340
+ function VatNumberField({
3123
3341
  data,
3124
3342
  valid,
3125
3343
  errors,
3126
3344
  labels,
3127
- placeholders,
3128
- readonly,
3129
3345
  mask,
3130
3346
  guidanceText,
3347
+ placeholders,
3348
+ readonly,
3349
+ optional,
3131
3350
  shouldValidate,
3132
- handleChangeFor
3133
- }) {
3134
- return /* @__PURE__ */ jsx(
3135
- MaskedInput,
3136
- {
3137
- name: "stockExchangeMIC",
3138
- type: "text",
3139
- label: labels.stockExchangeMIC ?? "",
3140
- formatGuidance: guidanceText?.stockExchangeMIC,
3141
- placeholder: placeholders?.stockExchangeMIC,
3142
- ...mask,
3143
- errorMessage: errors.stockExchangeMIC,
3144
- isValid: valid.stockExchangeMIC ?? false,
3145
- value: data.stockExchangeMIC ?? "",
3146
- readonly,
3147
- shouldValidate,
3148
- onInput: handleChangeFor("stockExchangeMIC", "input"),
3149
- onBlur: handleChangeFor("stockExchangeMIC", "blur"),
3150
- "aria-required": true,
3151
- "aria-invalid": !valid.stockExchangeMIC
3152
- }
3153
- );
3154
- }
3155
- const stockISINFieldMetadata = {
3156
- label: "stockISIN",
3157
- validators: [
3158
- validateNotEmptyOnBlur,
3159
- {
3160
- modes: ["blur"],
3161
- validate: (value) => !!value && isISIN(value)
3162
- }
3163
- ],
3164
- mask: {
3165
- mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
3166
- transformOnType: uppercase
3167
- },
3168
- helperText: "stockISINHelper",
3169
- guidanceText: {
3170
- key: "validationPleaseEnterAValidStockISIN",
3171
- values: {
3172
- example: "NL0012969182"
3173
- }
3174
- }
3175
- };
3176
- const STOCK_ISIN_FIELD = ["stockISIN"];
3177
- function StockISINField({
3178
- data,
3179
- valid,
3180
- errors,
3181
- labels,
3182
- placeholders,
3183
- readonly,
3184
- mask,
3185
- guidanceText,
3186
- shouldValidate,
3187
- handleChangeFor
3188
- }) {
3189
- return /* @__PURE__ */ jsx(
3190
- MaskedInput,
3191
- {
3192
- name: "stockISIN",
3193
- type: "text",
3194
- label: labels.stockISIN ?? "",
3195
- formatGuidance: guidanceText?.stockISIN,
3196
- placeholder: placeholders?.stockISIN,
3197
- ...mask,
3198
- errorMessage: errors.stockISIN,
3199
- isValid: valid.stockISIN ?? false,
3200
- value: data.stockISIN ?? "",
3201
- readonly,
3202
- shouldValidate,
3203
- onInput: handleChangeFor("stockISIN", "input"),
3204
- onBlur: handleChangeFor("stockISIN", "blur"),
3205
- "aria-required": true,
3206
- "aria-invalid": !valid.stockISIN
3207
- }
3208
- );
3209
- }
3210
- const stockTickerSymbolFieldMetadata = {
3211
- label: "stockTickerSymbol",
3212
- validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
3213
- mask: {
3214
- mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
3215
- transformOnType: uppercase
3216
- },
3217
- guidanceText: {
3218
- key: "enterAMaximumOfNCharactersForExample",
3219
- values: {
3220
- maxChars: "5",
3221
- example: "ADYEN"
3222
- }
3223
- }
3224
- };
3225
- const STOCK_TICKER_SYMBOL_FIELD = [
3226
- "stockTickerSymbol"
3227
- ];
3228
- function StockTickerSymbolField({
3229
- data,
3230
- valid,
3231
- errors,
3232
- labels,
3233
- placeholders,
3234
- readonly,
3235
- mask,
3236
- guidanceText,
3237
- shouldValidate,
3238
- handleChangeFor
3239
- }) {
3240
- return /* @__PURE__ */ jsx(
3241
- MaskedInput,
3242
- {
3243
- name: "stockTickerSymbol",
3244
- type: "text",
3245
- label: labels.stockTickerSymbol ?? "",
3246
- formatGuidance: guidanceText?.stockTickerSymbol,
3247
- placeholder: placeholders?.stockTickerSymbol,
3248
- ...mask,
3249
- errorMessage: errors.stockTickerSymbol,
3250
- isValid: valid.stockTickerSymbol ?? false,
3251
- value: data.stockTickerSymbol ?? "",
3252
- readonly,
3253
- shouldValidate,
3254
- onInput: handleChangeFor("stockTickerSymbol", "input"),
3255
- onBlur: handleChangeFor("stockTickerSymbol", "blur"),
3256
- "aria-required": true,
3257
- "aria-invalid": !valid.stockTickerSymbol
3258
- }
3259
- );
3260
- }
3261
- function VatNumberTypeSelector({
3262
- country,
3263
- companyType,
3264
- selected,
3265
- setSelected,
3266
- exemptedOption
3267
- }) {
3268
- const { t } = useTranslation("common");
3269
- const handleSelect = useCallback(
3270
- (selectedStr) => {
3271
- const newSelected = selectedStr;
3272
- if (newSelected === "exempted") {
3273
- if (exemptedOption) {
3274
- setSelected(newSelected, true);
3275
- }
3276
- return;
3277
- }
3278
- setSelected(newSelected, false);
3279
- },
3280
- [exemptedOption, setSelected]
3281
- );
3282
- const options = useMemo(() => {
3283
- const availableOptions = getVatNumberOptions(country, companyType) ?? [];
3284
- if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
3285
- return [
3286
- ...availableOptions,
3287
- {
3288
- id: "exempted",
3289
- name: exemptedOption
3290
- }
3291
- ];
3292
- }, [country, companyType, exemptedOption]);
3293
- useEffect(() => {
3294
- if (!selected && options.length > 0) {
3295
- handleSelect(options[0].id);
3296
- }
3297
- }, [options, selected, handleSelect]);
3298
- if (options.length <= 1) return null;
3299
- return /* @__PURE__ */ jsx(
3300
- Field,
3301
- {
3302
- el: "fieldset",
3303
- name: "vatNumberType",
3304
- label: t(($) => $["whichTypeOfTaxIdNumberDoYouHave"]),
3305
- children: (childProps) => /* @__PURE__ */ jsx(
3306
- RadioGroup,
3307
- {
3308
- ...childProps,
3309
- name: "vatNumberType",
3310
- items: options,
3311
- value: selected,
3312
- onChange: handleSelect
3313
- }
3314
- )
3315
- }
3316
- );
3317
- }
3318
- const VAT_NUMBER_FIELD = [
3319
- "vatNumber",
3320
- "vatNumberType",
3321
- "exemptedFromVat",
3322
- "vatAbsenceReason"
3323
- ];
3324
- function VatNumberField({
3325
- data,
3326
- valid,
3327
- errors,
3328
- labels,
3329
- mask,
3330
- guidanceText,
3331
- placeholders,
3332
- readonly,
3333
- optional,
3334
- shouldValidate,
3335
- handleChangeFor,
3336
- canExempt,
3337
- country
3351
+ handleChangeFor,
3352
+ canExempt,
3353
+ country
3338
3354
  }) {
3339
3355
  const { isExperimentEnabled } = useExperimentsContext();
3340
3356
  const options = vatNumberOptions[country];
@@ -3343,7 +3359,7 @@ function VatNumberField({
3343
3359
  const showVatExemptedOptions = canExempt && options?.length > 1;
3344
3360
  const vatNumberType = data.exemptedFromVat ? "exempted" : data.vatNumberType ? data.vatNumberType : defaultType;
3345
3361
  const handleVatNumberChange = (e, mode) => {
3346
- const value = typeof e === "string" ? e : e.target?.value;
3362
+ const value = typeof e === "string" ? e : e.currentTarget.value;
3347
3363
  handleChangeFor("vatNumber", mode)(value);
3348
3364
  handleChangeFor("vatNumberType")(vatNumberType);
3349
3365
  };
@@ -3641,16 +3657,10 @@ const legalFormFieldMetadata = {
3641
3657
  validators: [validateNotEmptyOnBlur]
3642
3658
  };
3643
3659
  const isBankAccountRequestedForOrganization = signal(void 0);
3644
- const setIsBankAccountRequestedForOrganization = (hasRequest) => {
3645
- isBankAccountRequestedForOrganization.value = hasRequest;
3646
- };
3647
3660
  const tinMatched = signal(void 0);
3648
3661
  const businessMismatchModalOpen = signal(false);
3649
3662
  const verifiedBusiness = signal(void 0);
3650
3663
  const isVerifiedSingleCompanySearchResult = signal(false);
3651
- const setVerifiedBusiness = (company) => {
3652
- verifiedBusiness.value = company;
3653
- };
3654
3664
  const divider = "adyen-kyc-divider";
3655
3665
  const styles = {
3656
3666
  divider
@@ -3711,7 +3721,7 @@ function VerifiedBusinessCard({
3711
3721
  ] });
3712
3722
  }
3713
3723
  const LazyJpAddress = lazy(
3714
- async () => (await import("./JpAddress-Bl9Ppmv5.js")).JpAddress
3724
+ async () => (await import("./JpAddress-CvQyBExq.js")).JpAddress
3715
3725
  );
3716
3726
  const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
3717
3727
  const ADDITIONAL_INFORMATION_FIELDS = [
@@ -3730,38 +3740,25 @@ const ADDITIONAL_INFORMATION_FIELDS = [
3730
3740
  ...registrationAddressFields
3731
3741
  ];
3732
3742
  function AdditionalInformation({
3733
- data,
3734
- labels,
3735
- placeholders,
3736
- helperText,
3737
- readOnly,
3738
- shouldValidate,
3739
- formVerificationErrors,
3740
- fieldValidationErrors,
3741
- allFields,
3742
- requiredFields,
3743
- obscuredFields,
3744
- optionalFields,
3745
- readOnlyFields,
3746
- trustedFields,
3743
+ id,
3747
3744
  country,
3748
- companyType = CompanyTypesValues.PRIVATE_COMPANY,
3749
- showCompanyStructure
3745
+ companyType,
3746
+ shouldValidate,
3747
+ validationErrors = {},
3748
+ verificationErrors = {}
3750
3749
  }) {
3751
- const { basicInformation } = useGlobalData();
3752
- const { sliceData, updateStateSlice } = useGlobalDataSlice(ADDITIONAL_INFORMATION_FORM_ID);
3753
- const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
3754
- const { t, i18n } = useTranslation(["business"]);
3755
- const { t: commonT } = useTranslation("common");
3750
+ const { t, i18n } = useTranslation(["common", "business"]);
3751
+ const { form } = useFormContext();
3756
3752
  const { isExperimentEnabled } = useExperimentsContext();
3753
+ const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
3757
3754
  const verifiedBusiness$1 = verifiedBusiness.value;
3758
3755
  const showVerified = !!verifiedBusiness$1;
3759
3756
  const showStockData = companyType === CompanyTypesValues.PUBLIC_COMPANY;
3760
3757
  const addressSchema = getAddressSchemaForCountry(country).filter(
3761
3758
  (field) => !COUNTRIES_WITH_STATES_DATASET.includes(country) ? field !== "stateOrProvince" : true
3762
3759
  );
3763
- const currentCountryTaxInformation = sliceData?.taxInformation?.find(
3764
- (tax) => tax.country === country
3760
+ const currentCountryTaxInformation = form.data?.additionalInformation?.taxInformation?.find(
3761
+ (taxId) => taxId.country === country
3765
3762
  );
3766
3763
  const businessLineTypes = [];
3767
3764
  if (requestingBanking(rootLegalEntity)) {
@@ -3770,61 +3767,85 @@ function AdditionalInformation({
3770
3767
  if (requestingIssuing(rootLegalEntity)) {
3771
3768
  businessLineTypes.push("issuing");
3772
3769
  }
3773
- const initialFormUtilsProps = useMemo(
3774
- () => ({
3775
- data,
3776
- labels,
3777
- placeholders,
3778
- helperText,
3779
- readOnly,
3780
- allFields,
3781
- requiredFields,
3782
- readOnlyFields,
3783
- optionalFields,
3784
- obscuredFields,
3785
- trustedFields,
3786
- shouldValidate
3787
- }),
3788
- [
3789
- data,
3790
- labels,
3791
- placeholders,
3792
- helperText,
3793
- readOnly,
3794
- allFields,
3795
- requiredFields,
3796
- readOnlyFields,
3797
- optionalFields,
3798
- obscuredFields,
3799
- trustedFields,
3800
- shouldValidate
3801
- ]
3770
+ const [addressToCheck, setAddressToCheck] = useDebouncedState(500);
3771
+ const { data: cleansedRegistrationAddress } = useAddressCleanse(
3772
+ {
3773
+ text: addressToCheck,
3774
+ country
3775
+ },
3776
+ { enabled: Boolean(addressToCheck) }
3802
3777
  );
3803
- const getFormSchema = useCallback(
3804
- (currentData) => {
3805
- const fieldsToRemove = [];
3806
- if (currentData.exemptedFromVat) {
3807
- fieldsToRemove.push("vatNumber");
3808
- } else {
3809
- fieldsToRemove.push("vatAbsenceReason");
3810
- }
3811
- if (currentData.exemptedFromTax && !isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4")) {
3812
- fieldsToRemove.push("taxInformation");
3813
- }
3814
- if (currentData.exemptedFromRegistrationNumber) {
3815
- fieldsToRemove.push("registrationNumber");
3778
+ const mustProvideOperationalAddress = cleansedRegistrationAddress?.poBox ?? false;
3779
+ useEffect(
3780
+ () => setAddressToCheck(
3781
+ formatAddressForCleanse(form.data?.additionalInformation?.registrationAddress ?? {})
3782
+ ),
3783
+ [form.data?.additionalInformation?.registrationAddress, setAddressToCheck]
3784
+ );
3785
+ const verifiedAddress = useMemo(() => {
3786
+ if (!verifiedBusiness$1) return void 0;
3787
+ return verifiedBusiness$1.isPrincipalAddress || verifiedBusiness$1.state && form.data?.basicInformation?.stateOrProvince !== verifiedBusiness$1.state ? { operationalAddress: { ...mapAddressData(verifiedBusiness$1), country } } : {
3788
+ registrationAddress: {
3789
+ ...mapAddressData(verifiedBusiness$1),
3790
+ country,
3791
+ stateOrProvince: form.data?.basicInformation?.stateOrProvince
3816
3792
  }
3817
- if (!currentData.hasDoingBusinessAs) {
3818
- fieldsToRemove.push("doingBusinessAs");
3793
+ };
3794
+ }, [verifiedBusiness$1, form.data?.basicInformation?.stateOrProvince, country]);
3795
+ const handleChangeFor = useCallback(
3796
+ (fieldName, mode) => form.handleChangeFor(fieldName, "additionalInformation", mode),
3797
+ [form]
3798
+ );
3799
+ const handleRegistrationAddressChange = (state) => {
3800
+ handleChangeFor("registrationAddress")(state.data);
3801
+ form.setValid("registrationAddress", Boolean(state.isValid), "additionalInformation");
3802
+ };
3803
+ const handleOperationalAddressChange = (state) => {
3804
+ handleChangeFor("operationalAddress")(state.data);
3805
+ form.setValid("operationalAddress", Boolean(state.isValid), "additionalInformation");
3806
+ };
3807
+ const handleOperationalAddressIsSameChange = useCallback(
3808
+ (isChecked) => {
3809
+ if (isChecked) {
3810
+ handleChangeFor("operationalAddressIsSame")(
3811
+ operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME
3812
+ );
3813
+ form.setValid("operationalAddress", true, "additionalInformation");
3814
+ } else {
3815
+ handleChangeFor("operationalAddressIsSame")(
3816
+ operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
3817
+ );
3819
3818
  }
3820
- return initialFormUtilsProps.requiredFields?.filter(
3821
- (field) => !fieldsToRemove.includes(field)
3822
- ) ?? [...DBA_NAME_FIELD];
3823
3819
  },
3824
- [initialFormUtilsProps.requiredFields, isExperimentEnabled]
3820
+ [form, handleChangeFor]
3825
3821
  );
3826
- const mergedFieldProps = useMemo(
3827
- () => initialFormUtilsProps.allFields?.reduce((acc, field) => {
3822
+ if (form.data?.additionalInformation?.operationalAddressIsSame === null) {
3823
+ handleOperationalAddressIsSameChange(true);
3824
+ }
3825
+ useEffect(() => {
3826
+ if (mustProvideOperationalAddress && form.data?.additionalInformation?.operationalAddressIsSame !== operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME) {
3827
+ handleOperationalAddressIsSameChange(false);
3828
+ }
3829
+ }, [
3830
+ handleOperationalAddressIsSameChange,
3831
+ mustProvideOperationalAddress,
3832
+ form.data?.additionalInformation?.operationalAddressIsSame
3833
+ ]);
3834
+ const formUtils = useMemo(() => {
3835
+ const initialProps = {
3836
+ data: form.data?.additionalInformation ?? {},
3837
+ fieldValidationErrors: validationErrors,
3838
+ formVerificationErrors: verificationErrors,
3839
+ allFields: form.allFields?.additionalInformation ?? [],
3840
+ requiredFields: form.requiredFields?.additionalInformation ?? [],
3841
+ optionalFields: form.optionalFields?.additionalInformation ?? [],
3842
+ trustedFields: form.trustedFields?.additionalInformation ?? [],
3843
+ obscuredFields: form.obscuredFields?.additionalInformation ?? [],
3844
+ errors: form.errors?.additionalInformation ?? {},
3845
+ valid: form.valid?.additionalInformation ?? {},
3846
+ handleFieldChange: handleChangeFor
3847
+ };
3848
+ const formUtilProps = initialProps.allFields?.reduce((acc, field) => {
3828
3849
  switch (field) {
3829
3850
  case "hasDoingBusinessAs":
3830
3851
  return mergeFieldMetadataIntoProps(
@@ -3833,11 +3854,7 @@ function AdditionalInformation({
3833
3854
  acc
3834
3855
  );
3835
3856
  case "doingBusinessAs":
3836
- return mergeFieldMetadataIntoProps(
3837
- "doingBusinessAs",
3838
- doingBusinessAsFieldMetadata,
3839
- acc
3840
- );
3857
+ return mergeFieldMetadataIntoProps("doingBusinessAs", doingBusinessAsFieldMetadata, acc);
3841
3858
  case "registrationNumber":
3842
3859
  return mergeFieldMetadataIntoProps(
3843
3860
  field,
@@ -3845,27 +3862,13 @@ function AdditionalInformation({
3845
3862
  registrationNumberDefaultFieldConfig[country],
3846
3863
  {
3847
3864
  companyType,
3848
- registrationNumberType: sliceData?.registrationNumberType ?? getDefaultRegistrationNumberType(
3849
- sliceData?.registrationNumber,
3850
- country,
3851
- companyType
3852
- ),
3865
+ registrationNumberType: form.data?.additionalInformation?.registrationNumberType,
3853
3866
  isExperimentEnabled
3854
3867
  },
3855
3868
  registrationNumberDefaultFieldMetadata
3856
3869
  ),
3857
3870
  acc
3858
3871
  );
3859
- case "exemptedFromRegistrationNumber":
3860
- return mergeFieldMetadataIntoProps(
3861
- field,
3862
- resolveFieldMetadata(
3863
- exemptFromRegistrationNumberDefaultFieldConfig[country],
3864
- {},
3865
- exemptFromRegistrationNumberDefaultFieldMetadata
3866
- ),
3867
- acc
3868
- );
3869
3872
  case "taxInformation":
3870
3873
  return mergeFieldMetadataIntoProps(
3871
3874
  field,
@@ -3879,24 +3882,12 @@ function AdditionalInformation({
3879
3882
  ),
3880
3883
  acc
3881
3884
  );
3882
- case "exemptedFromTax":
3883
- return mergeFieldMetadataIntoProps(
3884
- field,
3885
- resolveFieldMetadata(
3886
- exemptedFromTaxDefaultFieldConfig[country],
3887
- {},
3888
- exemptedFromTaxDefaultFieldMetadata
3889
- ),
3890
- acc
3891
- );
3892
3885
  case "vatNumber":
3893
3886
  return mergeFieldMetadataIntoProps(
3894
3887
  field,
3895
3888
  resolveFieldMetadata(
3896
3889
  defaultFieldConfig$2[country],
3897
- {
3898
- vatNumberType: sliceData?.vatNumberType ?? getDefaultVatNumberType(sliceData?.vatNumber, country)
3899
- },
3890
+ { vatNumberType: form.data?.additionalInformation?.vatNumberType },
3900
3891
  defaultFieldMetadata$2
3901
3892
  ),
3902
3893
  acc
@@ -3932,154 +3923,57 @@ function AdditionalInformation({
3932
3923
  default:
3933
3924
  return acc;
3934
3925
  }
3935
- }, initialFormUtilsProps),
3936
- [
3937
- companyType,
3938
- country,
3939
- currentCountryTaxInformation?.type,
3940
- initialFormUtilsProps,
3941
- isExperimentEnabled,
3942
- sliceData
3943
- ]
3944
- );
3945
- const mergedDefaultData = useMemo(() => {
3946
- if (!verifiedBusiness$1) return data;
3947
- return {
3948
- ...data,
3949
- registrationAddress: {
3950
- address: verifiedBusiness$1.street,
3951
- city: verifiedBusiness$1.city,
3952
- postalCode: verifiedBusiness$1.zipCode,
3953
- stateOrProvince: verifiedBusiness$1.state,
3954
- country: verifiedBusiness$1.country
3955
- }
3956
- };
3957
- }, [data, verifiedBusiness$1]);
3958
- const {
3959
- schema: formSchema,
3960
- data: formData,
3961
- errors: formErrors,
3962
- valid: formValid,
3963
- fieldProblems: formFieldProblems,
3926
+ }, initialProps);
3927
+ return createFormUtils(formUtilProps ?? initialProps, t);
3928
+ }, [
3929
+ companyType,
3930
+ country,
3931
+ currentCountryTaxInformation?.type,
3932
+ form.allFields?.additionalInformation,
3933
+ form.data?.additionalInformation,
3934
+ form.errors?.additionalInformation,
3935
+ form.obscuredFields?.additionalInformation,
3936
+ form.optionalFields?.additionalInformation,
3937
+ form.requiredFields?.additionalInformation,
3938
+ form.trustedFields?.additionalInformation,
3939
+ form.valid?.additionalInformation,
3964
3940
  handleChangeFor,
3965
- resetToDefaultData,
3966
- setValid
3967
- } = useForm({
3968
- schema: getFormSchema,
3969
- defaultData: mergedDefaultData,
3970
- rules: mergedFieldProps?.validators,
3971
- optionalFields: mergedFieldProps?.optionalFields,
3972
- obscuredFields: mergedFieldProps?.obscuredFields,
3973
- trustedFields: mergedFieldProps?.trustedFields,
3974
- fieldProblems: fieldValidationErrors,
3975
- shouldValidate
3976
- });
3977
- const datasetUtils = datasetUtilities(i18n.language);
3978
- const formUtils = createFormUtils(
3979
- mergedFieldProps ?? initialFormUtilsProps,
3980
- commonT
3981
- );
3982
- useEffect(() => {
3983
- updateStateSlice({
3984
- schema: formSchema,
3985
- data: formData,
3986
- errors: formErrors,
3987
- valid: formValid,
3988
- fieldProblems: formFieldProblems
3989
- });
3990
- }, [formSchema, formData, formErrors, formValid, formFieldProblems, updateStateSlice]);
3991
- const [addressToCheck, setAddressToCheck] = useDebouncedState(500);
3992
- const { data: cleansedRegistrationAddress } = useAddressCleanse(
3993
- {
3994
- text: addressToCheck,
3995
- country: formData?.registrationAddress?.country ?? country
3996
- },
3997
- { enabled: Boolean(addressToCheck) && country !== CountryCodes.Japan }
3998
- );
3999
- const mustProvideOperationalAddress = cleansedRegistrationAddress?.poBox ?? false;
4000
- useEffect(
4001
- () => setAddressToCheck(formatAddressForCleanse(formData?.registrationAddress ?? {})),
4002
- [formData?.registrationAddress, setAddressToCheck]
4003
- );
4004
- const verifiedAddress = useMemo(() => {
4005
- if (!verifiedBusiness$1) return void 0;
4006
- return verifiedBusiness$1.isPrincipalAddress || verifiedBusiness$1.state && basicInformation?.stateOrProvince !== verifiedBusiness$1.state ? { operationalAddress: { ...mapAddressData(verifiedBusiness$1), country } } : {
4007
- registrationAddress: {
4008
- ...mapAddressData(verifiedBusiness$1),
4009
- country,
4010
- stateOrProvince: basicInformation?.stateOrProvince
4011
- }
4012
- };
4013
- }, [verifiedBusiness$1, basicInformation?.stateOrProvince, country]);
4014
- useEffect(() => {
4015
- applyVerifiedBusinessData$1(verifiedBusiness$1, handleChangeFor);
4016
- if (basicInformation && verifiedBusiness$1?.name) {
4017
- basicInformation.legalCompanyName = verifiedBusiness$1.name;
4018
- }
4019
- }, [verifiedBusiness$1]);
4020
- useEffect(() => {
4021
- if (!verifiedBusiness$1 && !showCompanyStructure) resetToDefaultData();
4022
- }, [verifiedBusiness$1]);
3941
+ t,
3942
+ isExperimentEnabled,
3943
+ validationErrors,
3944
+ verificationErrors
3945
+ ]);
4023
3946
  const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
4024
3947
  const { data: industryCodes } = useIndustryCodes(businessLineTypes, i18n.language, {
4025
3948
  enabled: showField(INDUSTRY_CODE_FIELD)
4026
3949
  });
4027
- const handleRegistrationAddressChange = (state) => {
4028
- handleChangeFor("registrationAddress")(state.data);
4029
- setValid("registrationAddress", Boolean(state.isValid));
4030
- };
4031
- const handleOperationalAddressChange = (state) => {
4032
- handleChangeFor("operationalAddress")(state.data);
4033
- setValid("operationalAddress", Boolean(state.isValid));
4034
- };
4035
- const handleOperationalAddressIsSameChange = useCallback(
4036
- (isChecked) => {
4037
- if (isChecked) {
4038
- handleChangeFor("operationalAddressIsSame")(
4039
- operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME
4040
- );
4041
- setValid("operationalAddress", true);
4042
- } else {
4043
- handleChangeFor("operationalAddressIsSame")(
4044
- operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
4045
- );
4046
- }
4047
- },
4048
- [handleChangeFor, setValid]
4049
- );
4050
- useEffect(() => {
4051
- if (mustProvideOperationalAddress && formData.operationalAddressIsSame !== operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME) {
4052
- handleOperationalAddressIsSameChange(false);
4053
- }
4054
- }, [
4055
- handleOperationalAddressIsSameChange,
4056
- mustProvideOperationalAddress,
4057
- formData.operationalAddressIsSame
4058
- ]);
3950
+ const datasetUtils = datasetUtilities(i18n.language);
4059
3951
  const registrationAddressDescription = useMemo(() => {
4060
- if (formData.registrationAddress?.country) {
4061
- return ["US", "NL", "CZ"].includes(formData.registrationAddress.country) ? t(($) => $["youBusinessOfficalAddressInTheCounty"], {
4062
- country: datasetUtils.getCountryName(formData.registrationAddress.country)
3952
+ if (country) {
3953
+ return ["US", "NL", "CZ"].includes(country) ? t(($) => $["youBusinessOfficalAddressInTheCounty"], {
3954
+ ns: "business",
3955
+ country: datasetUtils.getCountryName(country)
4063
3956
  }) : t(($) => $["youBusinessOfficalAddressInCounty"], {
4064
- country: datasetUtils.getCountryName(formData.registrationAddress.country)
3957
+ ns: "business",
3958
+ country: datasetUtils.getCountryName(country)
4065
3959
  });
4066
3960
  }
4067
- return t(($) => $["youBusinessOfficalAddress"]);
4068
- }, [datasetUtils, formData?.registrationAddress?.country, i18n]);
4069
- return /* @__PURE__ */ jsxs("form", { id: ADDITIONAL_INFORMATION_FORM_ID, className: "adyen-kyc-additional-information", children: [
3961
+ return t(($) => $["youBusinessOfficalAddress"], { ns: "business" });
3962
+ }, [country, datasetUtils, t]);
3963
+ return /* @__PURE__ */ jsxs("form", { id, className: "adyen-kyc-additional-information", children: [
4070
3964
  /* @__PURE__ */ jsx(Header, { title: t(($) => $["additionalInformationFormHeading"], { ns: "business" }) }),
4071
3965
  /* @__PURE__ */ jsx(
4072
3966
  ErrorPanel,
4073
3967
  {
4074
3968
  id: "ariaErrorField",
4075
- verificationErrors: formVerificationErrors,
4076
- validationErrors: fieldValidationErrors,
3969
+ verificationErrors,
3970
+ validationErrors,
4077
3971
  formUtils
4078
3972
  }
4079
3973
  ),
4080
3974
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__content", children: [
4081
3975
  showVerified && /* @__PURE__ */ jsxs("section", { children: [
4082
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["verifiedInformation"]) }) }),
3976
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["verifiedInformation"], { ns: "business" }) }) }),
4083
3977
  /* @__PURE__ */ jsx(
4084
3978
  VerifiedBusinessCard,
4085
3979
  {
@@ -4089,7 +3983,7 @@ function AdditionalInformation({
4089
3983
  )
4090
3984
  ] }),
4091
3985
  /* @__PURE__ */ jsxs("section", { children: [
4092
- showVerified && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["otherBusinessInformation"]) }) }),
3986
+ showVerified && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["otherBusinessInformation"], { ns: "business" }) }) }),
4093
3987
  /* @__PURE__ */ jsxs("fieldset", { children: [
4094
3988
  showField(LEGAL_FORM_FIELDS) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4095
3989
  LegalFormField,
@@ -4097,21 +3991,37 @@ function AdditionalInformation({
4097
3991
  name: "legalForm",
4098
3992
  countryCode: country,
4099
3993
  data: {
4100
- legalForm: formUtils.getFieldData(formData, LEGAL_FORM_FIELDS)?.legalForm
3994
+ legalForm: formUtils.getFieldData(
3995
+ form.data?.additionalInformation ?? {},
3996
+ LEGAL_FORM_FIELDS
3997
+ )?.legalForm
4101
3998
  },
4102
- valid: formUtils.getFieldValid(formValid, LEGAL_FORM_FIELDS),
4103
- errorMessage: formErrors.legalForm?.errorMessage,
3999
+ valid: formUtils.getFieldValid(
4000
+ form.valid?.additionalInformation ?? {},
4001
+ LEGAL_FORM_FIELDS
4002
+ ),
4003
+ errorMessage: form.errors.additionalInformation?.legalForm?.errorMessage,
4104
4004
  handleChangeFor,
4105
4005
  readonly: false,
4106
4006
  label: formUtils.getLabel("legalForm", "businessStructure")
4107
4007
  }
4108
4008
  ) }),
4109
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4009
+ showField(DBA_NAME_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4110
4010
  DBANameField,
4111
4011
  {
4112
- data: formUtils.getFieldData(formData, DBA_NAME_FIELD),
4113
- valid: formUtils.getFieldValid(formValid, DBA_NAME_FIELD),
4114
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DBA_NAME_FIELD),
4012
+ data: formUtils.getFieldData(
4013
+ form.data?.additionalInformation ?? {},
4014
+ DBA_NAME_FIELD
4015
+ ),
4016
+ valid: formUtils.getFieldValid(
4017
+ form.valid?.additionalInformation ?? {},
4018
+ DBA_NAME_FIELD
4019
+ ),
4020
+ errors: formUtils.getFieldErrors(
4021
+ form.errors?.additionalInformation ?? {},
4022
+ validationErrors,
4023
+ DBA_NAME_FIELD
4024
+ ),
4115
4025
  labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
4116
4026
  hasDoingBusinessAs: "hasDba"
4117
4027
  }),
@@ -4122,11 +4032,17 @@ function AdditionalInformation({
4122
4032
  showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4123
4033
  BusinessRegistrationNumberField,
4124
4034
  {
4125
- data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
4126
- valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
4035
+ data: formUtils.getFieldData(
4036
+ form.data?.additionalInformation ?? {},
4037
+ BUSINESS_REGISTRATION_NUMBER_FIELD
4038
+ ),
4039
+ valid: formUtils.getFieldValid(
4040
+ form.valid?.additionalInformation ?? {},
4041
+ BUSINESS_REGISTRATION_NUMBER_FIELD
4042
+ ),
4127
4043
  errors: formUtils.getFieldErrors(
4128
- formErrors,
4129
- formFieldProblems,
4044
+ form.errors?.additionalInformation ?? {},
4045
+ validationErrors,
4130
4046
  BUSINESS_REGISTRATION_NUMBER_FIELD
4131
4047
  ),
4132
4048
  labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
@@ -4141,18 +4057,24 @@ function AdditionalInformation({
4141
4057
  shouldValidate,
4142
4058
  handleChangeFor,
4143
4059
  country,
4144
- canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
4060
+ canExempt: showField(["exemptedFromRegistrationNumber"]),
4145
4061
  companyType
4146
4062
  }
4147
4063
  ) }),
4148
4064
  showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4149
4065
  TaxInformationField,
4150
4066
  {
4151
- data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
4152
- valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
4067
+ data: formUtils.getFieldData(
4068
+ form.data?.additionalInformation ?? {},
4069
+ TAX_INFORMATION_FIELD
4070
+ ),
4071
+ valid: formUtils.getFieldValid(
4072
+ form.valid?.additionalInformation ?? {},
4073
+ TAX_INFORMATION_FIELD
4074
+ ),
4153
4075
  errors: formUtils.getFieldErrors(
4154
- formErrors,
4155
- formFieldProblems,
4076
+ form.errors?.additionalInformation ?? {},
4077
+ validationErrors,
4156
4078
  TAX_INFORMATION_FIELD
4157
4079
  ),
4158
4080
  labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
@@ -4163,19 +4085,29 @@ function AdditionalInformation({
4163
4085
  readonly: formUtils.isReadOnly("taxInformation"),
4164
4086
  shouldValidate,
4165
4087
  handleChangeFor,
4166
- canExempt: formUtils.isRequiredField("exemptedFromTax"),
4088
+ canExempt: showField(["exemptedFromTax"]),
4167
4089
  country,
4168
4090
  entityType: companyType,
4169
- defaultData: data?.taxInformation,
4170
- registrationNumber: formData?.registrationNumber
4091
+ defaultData: form.defaultData?.additionalInformation?.taxInformation,
4092
+ registrationNumber: form.data?.additionalInformation?.registrationNumber
4171
4093
  }
4172
4094
  ) }),
4173
4095
  showField(VAT_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4174
4096
  VatNumberField,
4175
4097
  {
4176
- data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
4177
- valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
4178
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
4098
+ data: formUtils.getFieldData(
4099
+ form.data?.additionalInformation ?? {},
4100
+ VAT_NUMBER_FIELD
4101
+ ),
4102
+ valid: formUtils.getFieldValid(
4103
+ form.valid?.additionalInformation ?? {},
4104
+ VAT_NUMBER_FIELD
4105
+ ),
4106
+ errors: formUtils.getFieldErrors(
4107
+ form.errors?.additionalInformation ?? {},
4108
+ validationErrors,
4109
+ VAT_NUMBER_FIELD
4110
+ ),
4179
4111
  labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
4180
4112
  exemptedFromVat: "iDontHaveAVatNumber"
4181
4113
  }),
@@ -4185,18 +4117,24 @@ function AdditionalInformation({
4185
4117
  readonly: formUtils.isReadOnly("vatNumber"),
4186
4118
  handleChangeFor,
4187
4119
  country,
4188
- canExempt: formUtils.isRequiredField("exemptedFromVat") || formUtils.isOptionalField("exemptedFromVat"),
4120
+ canExempt: showField(["exemptedFromVat"]),
4189
4121
  shouldValidate
4190
4122
  }
4191
4123
  ) }),
4192
4124
  formUtils.isRequiredField("eInvoicingCode", false) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4193
4125
  EInvoicingCodeField,
4194
4126
  {
4195
- data: formUtils.getFieldData(formData, EINVOICING_CODE_FIELD),
4196
- valid: formUtils.getFieldValid(formValid, EINVOICING_CODE_FIELD),
4127
+ data: formUtils.getFieldData(
4128
+ form.data?.additionalInformation ?? {},
4129
+ EINVOICING_CODE_FIELD
4130
+ ),
4131
+ valid: formUtils.getFieldValid(
4132
+ form.valid?.additionalInformation ?? {},
4133
+ EINVOICING_CODE_FIELD
4134
+ ),
4197
4135
  errors: formUtils.getFieldErrors(
4198
- formErrors,
4199
- formFieldProblems,
4136
+ form.errors?.additionalInformation ?? {},
4137
+ validationErrors,
4200
4138
  EINVOICING_CODE_FIELD
4201
4139
  ),
4202
4140
  labels: formUtils.getFieldLabels(EINVOICING_CODE_FIELD),
@@ -4210,11 +4148,17 @@ function AdditionalInformation({
4210
4148
  showField(INDUSTRY_CODE_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", "data-testid": "industryCode", children: /* @__PURE__ */ jsx(
4211
4149
  IndustryCodeField,
4212
4150
  {
4213
- data: formUtils.getFieldData(formData, INDUSTRY_CODE_FIELD),
4214
- valid: formUtils.getFieldValid(formValid, INDUSTRY_CODE_FIELD),
4151
+ data: formUtils.getFieldData(
4152
+ form.data?.additionalInformation ?? {},
4153
+ INDUSTRY_CODE_FIELD
4154
+ ),
4155
+ valid: formUtils.getFieldValid(
4156
+ form.valid?.additionalInformation ?? {},
4157
+ INDUSTRY_CODE_FIELD
4158
+ ),
4215
4159
  errors: formUtils.getFieldErrors(
4216
- formErrors,
4217
- formFieldProblems,
4160
+ form.errors?.additionalInformation ?? {},
4161
+ validationErrors,
4218
4162
  INDUSTRY_CODE_FIELD
4219
4163
  ),
4220
4164
  labels: {
@@ -4237,11 +4181,17 @@ function AdditionalInformation({
4237
4181
  showField(DATE_OF_INCORPORATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4238
4182
  DateOfIncorporationField,
4239
4183
  {
4240
- data: formUtils.getFieldData(formData, DATE_OF_INCORPORATION_FIELD),
4241
- valid: formUtils.getFieldValid(formValid, DATE_OF_INCORPORATION_FIELD),
4184
+ data: formUtils.getFieldData(
4185
+ form.data?.additionalInformation ?? {},
4186
+ DATE_OF_INCORPORATION_FIELD
4187
+ ),
4188
+ valid: formUtils.getFieldValid(
4189
+ form.valid?.additionalInformation ?? {},
4190
+ DATE_OF_INCORPORATION_FIELD
4191
+ ),
4242
4192
  errors: formUtils.getFieldErrors(
4243
- formErrors,
4244
- formFieldProblems,
4193
+ form.errors?.additionalInformation ?? {},
4194
+ validationErrors,
4245
4195
  DATE_OF_INCORPORATION_FIELD
4246
4196
  ),
4247
4197
  labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
@@ -4255,16 +4205,22 @@ function AdditionalInformation({
4255
4205
  ] })
4256
4206
  ] }),
4257
4207
  showStockData && /* @__PURE__ */ jsxs("section", { children: [
4258
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["stockExchangeInformation"]) }) }),
4208
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-additional-information__section-heading", children: /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["stockExchangeInformation"], { ns: "business" }) }) }),
4259
4209
  /* @__PURE__ */ jsxs("fieldset", { children: [
4260
4210
  showField(STOCK_EXCHANGE_MIC_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4261
4211
  StockExchangeMICField,
4262
4212
  {
4263
- data: formUtils.getFieldData(formData, STOCK_EXCHANGE_MIC_FIELD),
4264
- valid: formUtils.getFieldValid(formValid, STOCK_EXCHANGE_MIC_FIELD),
4213
+ data: formUtils.getFieldData(
4214
+ form.data?.additionalInformation ?? {},
4215
+ STOCK_EXCHANGE_MIC_FIELD
4216
+ ),
4217
+ valid: formUtils.getFieldValid(
4218
+ form.valid?.additionalInformation ?? {},
4219
+ STOCK_EXCHANGE_MIC_FIELD
4220
+ ),
4265
4221
  errors: formUtils.getFieldErrors(
4266
- formErrors,
4267
- formFieldProblems,
4222
+ form.errors?.additionalInformation ?? {},
4223
+ validationErrors,
4268
4224
  STOCK_EXCHANGE_MIC_FIELD
4269
4225
  ),
4270
4226
  labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
@@ -4279,11 +4235,17 @@ function AdditionalInformation({
4279
4235
  showField(STOCK_ISIN_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4280
4236
  StockISINField,
4281
4237
  {
4282
- data: formUtils.getFieldData(formData, STOCK_ISIN_FIELD),
4283
- valid: formUtils.getFieldValid(formValid, STOCK_ISIN_FIELD),
4238
+ data: formUtils.getFieldData(
4239
+ form.data?.additionalInformation ?? {},
4240
+ STOCK_ISIN_FIELD
4241
+ ),
4242
+ valid: formUtils.getFieldValid(
4243
+ form.valid?.additionalInformation ?? {},
4244
+ STOCK_ISIN_FIELD
4245
+ ),
4284
4246
  errors: formUtils.getFieldErrors(
4285
- formErrors,
4286
- formFieldProblems,
4247
+ form.errors?.additionalInformation ?? {},
4248
+ validationErrors,
4287
4249
  STOCK_ISIN_FIELD
4288
4250
  ),
4289
4251
  labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
@@ -4298,11 +4260,17 @@ function AdditionalInformation({
4298
4260
  showField(STOCK_TICKER_SYMBOL_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4299
4261
  StockTickerSymbolField,
4300
4262
  {
4301
- data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
4302
- valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
4263
+ data: formUtils.getFieldData(
4264
+ form.data?.additionalInformation ?? {},
4265
+ STOCK_TICKER_SYMBOL_FIELD
4266
+ ),
4267
+ valid: formUtils.getFieldValid(
4268
+ form.valid?.additionalInformation ?? {},
4269
+ STOCK_TICKER_SYMBOL_FIELD
4270
+ ),
4303
4271
  errors: formUtils.getFieldErrors(
4304
- formErrors,
4305
- formFieldProblems,
4272
+ form.errors?.additionalInformation ?? {},
4273
+ validationErrors,
4306
4274
  STOCK_TICKER_SYMBOL_FIELD
4307
4275
  ),
4308
4276
  labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
@@ -4318,7 +4286,7 @@ function AdditionalInformation({
4318
4286
  ] }),
4319
4287
  /* @__PURE__ */ jsxs("section", { "data-testid": "registeredBusinessAddress", children: [
4320
4288
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__section-heading", children: [
4321
- /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["registeredBusinessAddress"]) }),
4289
+ /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["registeredBusinessAddress"], { ns: "business" }) }),
4322
4290
  /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: registrationAddressDescription })
4323
4291
  ] }),
4324
4292
  country === CountryCodes.Japan ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
@@ -4326,7 +4294,7 @@ function AdditionalInformation({
4326
4294
  {
4327
4295
  id: ADDITIONAL_INFORMATION_FORM_ID,
4328
4296
  addressType: "registrationAddress",
4329
- data: { ...mergedDefaultData?.registrationAddress, country },
4297
+ data: { ...form.data.additionalInformation?.registrationAddress, country },
4330
4298
  shouldValidate,
4331
4299
  onChange: handleRegistrationAddressChange
4332
4300
  }
@@ -4336,18 +4304,20 @@ function AdditionalInformation({
4336
4304
  id: ADDITIONAL_INFORMATION_FORM_ID,
4337
4305
  addressType: "registrationAddress",
4338
4306
  data: {
4339
- ...mergedDefaultData?.registrationAddress,
4307
+ ...form.data.additionalInformation?.registrationAddress,
4340
4308
  country
4341
4309
  },
4342
- labels: getAddressSchemaLabelsByCountry(
4343
- data?.registrationAddress?.country ?? country
4344
- ),
4310
+ labels: getAddressSchemaLabelsByCountry(country),
4345
4311
  requiredFields: addressSchema,
4346
4312
  shouldValidate,
4347
4313
  hideCountry: true,
4348
4314
  optionalFields: ["otherAddressInformation"],
4349
- readOnlyFields: verifiedBusiness$1?.state && verifiedBusiness$1?.state === basicInformation?.stateOrProvince ? ["stateOrProvince"] : [],
4350
- trustedFields: getNestedTrustedFields("registrationAddress", data, trustedFields),
4315
+ readOnlyFields: verifiedBusiness$1?.state && verifiedBusiness$1?.state === form.data.basicInformation?.stateOrProvince ? ["stateOrProvince"] : [],
4316
+ trustedFields: getNestedTrustedFields(
4317
+ "registrationAddress",
4318
+ form.data.additionalInformation,
4319
+ form.trustedFields?.additionalInformation
4320
+ ),
4351
4321
  onChange: handleRegistrationAddressChange,
4352
4322
  verifiedBusiness: verifiedBusiness$1,
4353
4323
  verifiedAddress: verifiedAddress?.registrationAddress,
@@ -4357,35 +4327,36 @@ function AdditionalInformation({
4357
4327
  ] }),
4358
4328
  /* @__PURE__ */ jsxs("section", { "data-testid": "principalPlaceOfBusiness", children: [
4359
4329
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__section-heading", children: [
4360
- /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["principalPlaceOfBusiness"]) }),
4361
- /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: t(($) => $["thePhysicalLocationWhereABusiness"]) })
4330
+ /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["principalPlaceOfBusiness"], { ns: "business" }) }),
4331
+ /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: t(($) => $["thePhysicalLocationWhereABusiness"], { ns: "business" }) })
4362
4332
  ] }),
4363
4333
  !mustProvideOperationalAddress && /* @__PURE__ */ jsx(
4364
4334
  Field,
4365
4335
  {
4336
+ el: "fieldset",
4366
4337
  name: "operationalAddressIsSame",
4367
- errorMessage: formErrors.operationalAddressIsSame,
4368
- isValid: formValid.operationalAddressIsSame,
4338
+ errorMessage: form.errors?.additionalInformation?.operationalAddressIsSame?.errorMessage,
4339
+ isValid: form.valid?.additionalInformation?.operationalAddressIsSame,
4369
4340
  children: (childProps) => /* @__PURE__ */ jsx(
4370
4341
  Checkbox,
4371
4342
  {
4372
4343
  ...childProps,
4373
4344
  "aria-required": formUtils.isRequiredField("operationalAddressIsSame"),
4374
- "aria-invalid": !formValid.operationalAddressIsSame,
4345
+ "aria-invalid": !form.valid?.additionalInformation?.operationalAddressIsSame,
4375
4346
  name: "operationalAddressIsSame",
4376
4347
  label: formUtils.getLabel("sameAsRegisteredAddress"),
4377
- checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
4348
+ checked: form.data?.additionalInformation?.operationalAddressIsSame ? form.data?.additionalInformation?.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
4378
4349
  onChange: handleOperationalAddressIsSameChange
4379
4350
  }
4380
4351
  )
4381
4352
  }
4382
4353
  ),
4383
- formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && (country === CountryCodes.Japan ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
4354
+ form.data?.additionalInformation?.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && (country === CountryCodes.Japan ? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Loader, {}), children: /* @__PURE__ */ jsx(
4384
4355
  LazyJpAddress,
4385
4356
  {
4386
4357
  id: ADDITIONAL_INFORMATION_FORM_ID,
4387
4358
  addressType: "operationalAddress",
4388
- data: { ...mergedDefaultData?.operationalAddress, country },
4359
+ data: { ...form.data.additionalInformation.operationalAddress, country },
4389
4360
  shouldValidate,
4390
4361
  onChange: handleOperationalAddressChange
4391
4362
  }
@@ -4395,17 +4366,19 @@ function AdditionalInformation({
4395
4366
  id: ADDITIONAL_INFORMATION_FORM_ID,
4396
4367
  addressType: "operationalAddress",
4397
4368
  data: {
4398
- ...mergedDefaultData?.operationalAddress,
4369
+ ...form.defaultData?.additionalInformation?.operationalAddress,
4399
4370
  country
4400
4371
  },
4401
- labels: getAddressSchemaLabelsByCountry(
4402
- data?.operationalAddress?.country ?? country
4403
- ),
4372
+ labels: getAddressSchemaLabelsByCountry(country),
4404
4373
  requiredFields: addressSchema,
4405
4374
  shouldValidate,
4406
4375
  hideCountry: true,
4407
4376
  optionalFields: ["otherAddressInformation"],
4408
- trustedFields: getNestedTrustedFields("operationalAddress", data, trustedFields),
4377
+ trustedFields: getNestedTrustedFields(
4378
+ "operationalAddress",
4379
+ form.data?.additionalInformation,
4380
+ form.trustedFields?.additionalInformation
4381
+ ),
4409
4382
  onChange: handleOperationalAddressChange,
4410
4383
  verifiedBusiness: verifiedBusiness$1,
4411
4384
  verifiedAddress: verifiedAddress?.operationalAddress,
@@ -4515,13 +4488,6 @@ const handleKeyDown = (e) => {
4515
4488
  e.preventDefault();
4516
4489
  }
4517
4490
  };
4518
- const CountryFieldValidation = () => ({
4519
- country: {
4520
- modes: ["blur"],
4521
- validate: (country) => !isEmpty(country),
4522
- errorMessage: "fieldIsRequired"
4523
- }
4524
- });
4525
4491
  const COUNTRY_OF_GOVERNING_LAW_FIELD = [
4526
4492
  "countryOfGoverningLaw"
4527
4493
  ];
@@ -4565,13 +4531,6 @@ function CountryOfGoverningLawField({
4565
4531
  }
4566
4532
  );
4567
4533
  }
4568
- const CountryOfGoverningLawFieldValidation = () => ({
4569
- countryOfGoverningLaw: {
4570
- modes: ["blur"],
4571
- validate: (countryOfGoverningLaw) => !isEmpty(countryOfGoverningLaw),
4572
- errorMessage: "fieldIsRequired"
4573
- }
4574
- });
4575
4534
  const defaultFieldMetadata$1 = {
4576
4535
  label: "legalCompanyName",
4577
4536
  helperText: "legalCompanyName__helperText",
@@ -4592,483 +4551,110 @@ const defaultFieldConfig$1 = {
4592
4551
  label: "legalCompanyName",
4593
4552
  helperText: "legalCompanyName__helperText__NL",
4594
4553
  validators: validateNotEmptyOnBlur
4595
- },
4596
- [CountryCodes.Singapore]: {
4597
- label: "legalCompanyName",
4598
- helperText: "legalCompanyName__helperText__SG",
4599
- validators: validateNotEmptyOnBlur
4600
- },
4601
- [CountryCodes.UnitedStates]: ({ isBusiness }) => ({
4602
- label: "legalCompanyName__US",
4603
- helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
4604
- validators: validateNotEmptyOnBlur
4605
- })
4606
- };
4607
- const defaultFieldMetadataV4 = {
4608
- label: "legalCompanyName",
4609
- helperText: "legalCompanyName__helperText",
4610
- validators: validateLegalCompanyName
4611
- };
4612
- const defaultFieldConfigV4 = {
4613
- [CountryCodes.Australia]: {
4614
- label: "legalCompanyName",
4615
- helperText: "legalCompanyName__helperText__AU",
4616
- validators: validateLegalCompanyName
4617
- },
4618
- [CountryCodes.HongKong]: {
4619
- label: "legalCompanyName",
4620
- helperText: "legalCompanyName__helperText__HK",
4621
- validators: validateLegalCompanyName
4622
- },
4623
- [CountryCodes.Netherlands]: {
4624
- label: "legalCompanyName",
4625
- helperText: "legalCompanyName__helperText__NL",
4626
- validators: validateLegalCompanyName
4627
- },
4628
- [CountryCodes.Singapore]: {
4629
- label: "legalCompanyName",
4630
- helperText: "legalCompanyName__helperText__SG",
4631
- validators: validateLegalCompanyName
4632
- },
4633
- [CountryCodes.UnitedStates]: ({ isBusiness }) => ({
4634
- label: "legalCompanyName__US",
4635
- helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
4636
- validators: validateLegalCompanyName
4637
- }),
4638
- [CountryCodes.Japan]: {
4639
- label: "legalCompanyName__JP",
4640
- helperText: void 0,
4641
- validators: [...validateLegalCompanyName, validateLatinSpaceMarkPunctuationOnlyOnBlur]
4642
- }
4643
- };
4644
- const defaultJaHaniLegalCompanyNameFieldMetadata = {
4645
- label: "jaHaniLegalCompanyName"
4646
- };
4647
- const defaultJaKanaLegalCompanyNameFieldMetadata = {
4648
- label: "jaKanaLegalCompanyName"
4649
- };
4650
- const defaultJaHaniLegalCompanyNameFieldConfig = {
4651
- label: "jaHaniLegalCompanyName",
4652
- validators: validateJaHaniLegalCompanyName
4653
- };
4654
- const defaultJaKanaLegalCompanyNameFieldConfig = {
4655
- label: "jaKanaLegalCompanyName",
4656
- validators: validateJaKanaLegalCompanyName
4657
- };
4658
- const localizedLegalCompanyNameFieldConfig = {
4659
- jaHaniLegalCompanyName: {
4660
- config: defaultJaHaniLegalCompanyNameFieldConfig,
4661
- metadata: defaultJaHaniLegalCompanyNameFieldMetadata
4662
- },
4663
- jaKanaLegalCompanyName: {
4664
- config: defaultJaKanaLegalCompanyNameFieldConfig,
4665
- metadata: defaultJaKanaLegalCompanyNameFieldMetadata
4666
- }
4667
- };
4668
- const defaultFieldMetadata = {
4669
- label: "stateOrProvince",
4670
- placeholder: "stateOrProvince__placeHolder",
4671
- validators: validateNotEmptyOnBlur
4672
- };
4673
- const defaultFieldConfig = {
4674
- [CountryCodes.Australia]: {
4675
- label: "state",
4676
- placeholder: "selectState",
4677
- validators: validateNotEmptyOnBlur
4678
- },
4679
- [CountryCodes.Brazil]: {
4680
- label: "state",
4681
- placeholder: "selectState",
4682
- validators: validateNotEmptyOnBlur
4683
- },
4684
- [CountryCodes.Canada]: {
4685
- label: "provinceOrTerritory",
4686
- placeholder: "selectProvinceOrTerritory",
4687
- validators: validateNotEmptyOnBlur
4688
- },
4689
- [CountryCodes.NewZealand]: {
4690
- label: "region",
4691
- validators: validateNotEmptyOnBlur
4692
- },
4693
- [CountryCodes.UnitedStates]: ({ isBusiness }) => ({
4694
- label: isBusiness ? "stateOrProvince__US__business" : "state",
4695
- placeholder: "stateOrProvince__placeHolder__US",
4696
- validators: validateNotEmptyOnBlur
4697
- })
4698
- };
4699
- const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
4700
- const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [
4701
- StateCodesUS.Arkansas,
4702
- StateCodesUS.Connecticut,
4703
- StateCodesUS.Georgia,
4704
- StateCodesUS.Hawaii,
4705
- StateCodesUS.Indiana,
4706
- StateCodesUS.Kentucky,
4707
- StateCodesUS.Maryland,
4708
- StateCodesUS.Minnesota,
4709
- StateCodesUS.Missouri,
4710
- StateCodesUS.Montana,
4711
- StateCodesUS.NewHampshire,
4712
- StateCodesUS.NewMexico,
4713
- StateCodesUS.SouthCarolina,
4714
- StateCodesUS.Utah,
4715
- StateCodesUS.Vermont,
4716
- StateCodesUS.Wisconsin,
4717
- StateCodesUS.Wyoming
4718
- ];
4719
- const KNOWN_DISALLOWED_INDEX_DATASET_STATES = [
4720
- StateCodesUS.California,
4721
- StateCodesUS.Florida,
4722
- StateCodesUS.Illinois,
4723
- StateCodesUS.Texas
4724
- ];
4725
- const handleCompanyDataset = async (rootLegalEntityId, baseUrl, data) => {
4726
- const requestPayload = {
4727
- companyId: data.company.id,
4728
- country: "US",
4729
- state: data.state
4730
- };
4731
- const searchRequest = async (path) => {
4732
- return httpPost(
4733
- {
4734
- baseUrl,
4735
- path: `legalEntities/${rootLegalEntityId}/companyDataset${path ? "/" + path : ""}`
4736
- },
4737
- requestPayload
4738
- );
4739
- };
4740
- const getCompanyDataset = async () => await searchRequest();
4741
- const refreshCompanyDataset = async () => await searchRequest("refreshed");
4742
- const date = (/* @__PURE__ */ new Date()).toDateString();
4743
- const isDataCompliant = data.company.lastUpdate ? Date.parse(date) - Date.parse(data.company.lastUpdate) < LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW : false;
4744
- if (data.state) {
4745
- return isDataCompliant && !KNOWN_DISALLOWED_INDEX_DATASET_STATES.includes(data.state) ? await getCompanyDataset() : await refreshCompanyDataset();
4746
- }
4747
- return isDataCompliant ? await getCompanyDataset() : await refreshCompanyDataset();
4748
- };
4749
- const useVerifyTin = (data, options) => {
4750
- const { rootLegalEntityId, baseUrl } = useApiContext();
4751
- return useQuery({
4752
- queryKey: ["verifyTin", data],
4753
- queryFn: data ? () => verifyTin(rootLegalEntityId.value, baseUrl.value, data) : skipToken,
4754
- retry: 0,
4755
- ...options
4756
- });
4757
- };
4758
- const verifyTin = async (legalEntityId, baseUrl, data) => {
4759
- return httpPost(
4760
- {
4761
- baseUrl,
4762
- path: `legalEntities/${legalEntityId}/verifyTin`
4763
- },
4764
- data
4765
- );
4766
- };
4767
- const useCompanySelection = (data, options) => {
4768
- const { rootLegalEntityId, baseUrl } = useApiContext();
4769
- return useQuery({
4770
- queryKey: ["companySelection", data],
4771
- queryFn: data ? () => handleCompanySelection(rootLegalEntityId.value, baseUrl.value, data) : skipToken,
4772
- retry: 0,
4773
- ...options,
4774
- // TODO: Remove this once Moody's resolves &amp; bug
4775
- select: (data2) => {
4776
- const transformedResults = {
4777
- ...data2,
4778
- name: data2.name.replaceAll("&amp;", "&")
4779
- };
4780
- return transformedResults;
4781
- }
4782
- });
4783
- };
4784
- const handleCompanySelection = async (rootLegalEntityId, baseUrl, data) => {
4785
- const [companyDatasetResult, tinMatch] = await Promise.all([
4786
- handleCompanyDataset(rootLegalEntityId, baseUrl, {
4787
- company: data.company,
4788
- state: data.state
4789
- }),
4790
- verifyTin(rootLegalEntityId, baseUrl, { name: data.name, tin: data.tin })
4791
- ]);
4792
- return {
4793
- ...companyDatasetResult,
4794
- tinMatched: tinMatch?.matched
4795
- };
4796
- };
4797
- const stripWhitespace = (str) => str.replace(/\s/g, "");
4798
- const toNormalizedString = (s) => stripWhitespace(s.toLowerCase());
4799
- const isNormalizedStringMatch = (s1, s2) => toNormalizedString(s1) === toNormalizedString(s2);
4800
- function BusinessInformation({ fetching, selectedBusiness }) {
4801
- const { t } = useTranslation(["common", "business"]);
4802
- const businessInformationClasses = cx("adyen-kyc-business-information", {
4803
- "adyen-kyc-business-information--fetching": fetching
4804
- });
4805
- const items = useMemo(
4806
- () => selectedBusiness ? entriesOf(selectedBusiness).reduce(
4807
- (acc, [key, value]) => {
4808
- switch (key) {
4809
- case "legalForm":
4810
- if (value) acc[0].details = value;
4811
- break;
4812
- case "name":
4813
- if (value) acc[1].details = value;
4814
- break;
4815
- case "address":
4816
- if (value) acc[2].details = value;
4817
- break;
4818
- }
4819
- return acc;
4820
- },
4821
- [
4822
- {
4823
- term: t(($) => $["legalForm"], { ns: "common" }),
4824
- details: ""
4825
- },
4826
- {
4827
- term: t(($) => $["legalCompanyName__US"], { ns: "common" }),
4828
- details: ""
4829
- },
4830
- {
4831
- term: t(($) => $["address"], { ns: "common" }),
4832
- details: ""
4833
- }
4834
- ]
4835
- ).filter((item) => !!item.details) : [],
4836
- [selectedBusiness, t]
4837
- );
4838
- if (fetching) {
4839
- return /* @__PURE__ */ jsx("div", { className: businessInformationClasses, children: /* @__PURE__ */ jsx(Loader, { size: "large" }) });
4840
- }
4841
- if (!fetching) {
4842
- return /* @__PURE__ */ jsx("div", { className: businessInformationClasses, children: /* @__PURE__ */ jsx(StructuredList, { items }) });
4843
- }
4844
- return null;
4845
- }
4846
- function BusinessInformationCard({
4847
- result,
4848
- selectedBusinessId,
4849
- currentBusinessSelection,
4850
- fetching,
4851
- fetchingError,
4852
- invalidTin,
4853
- setIsBusinessSelection,
4854
- handleSelectBusiness,
4855
- refetchCompanySelection,
4856
- handleConfirmSelection,
4857
- handleBackClick
4858
- }) {
4859
- const { t } = useTranslation(["common", "business"]);
4860
- const excludeResultAsGovernmentEntity = useMemo(
4861
- () => isBankAccountRequestedForOrganization.value && currentBusinessSelection?.organizationType === "GOVERNMENTAL_ORGANIZATION",
4862
- [currentBusinessSelection]
4863
- );
4864
- const showSelectButton = useMemo(
4865
- () => !fetching && !fetchingError && currentBusinessSelection && !excludeResultAsGovernmentEntity,
4866
- [currentBusinessSelection, excludeResultAsGovernmentEntity, fetching, fetchingError]
4867
- );
4868
- const handleGoBack = () => {
4869
- if (handleBackClick) {
4870
- handleBackClick();
4871
- } else {
4872
- setIsBusinessSelection?.(false);
4873
- }
4874
- };
4875
- return /* @__PURE__ */ jsx(
4876
- Card,
4877
- {
4878
- "aria-selected": selectedBusinessId === result.id,
4879
- className: "adyen-kyc-business-information-card",
4880
- title: result.name,
4881
- subTitle: result.registrationNumber,
4882
- stateful: true,
4883
- fetching: fetching && selectedBusinessId === result.id,
4884
- active: selectedBusinessId === result.id,
4885
- headerButton: selectedBusinessId === result.id && showSelectButton ? /* @__PURE__ */ jsx(
4886
- Button,
4887
- {
4888
- onClick: () => handleConfirmSelection(currentBusinessSelection),
4889
- testId: "selectBusiness",
4890
- disabled: invalidTin,
4891
- children: t(($) => $["thisIsMyBusiness"], { ns: "business" })
4892
- }
4893
- ) : null,
4894
- onClick: () => handleSelectBusiness(result),
4895
- onKeyDown: handleKeys(["Enter"], () => handleSelectBusiness(result)),
4896
- children: selectedBusinessId === result.id && /* @__PURE__ */ jsxs(Fragment, { children: [
4897
- /* @__PURE__ */ jsx(Divider, {}),
4898
- invalidTin && /* @__PURE__ */ jsx(
4899
- Alert,
4900
- {
4901
- variant: "warning",
4902
- type: "callToAction",
4903
- title: t(($) => $["businessSelection__invalidTin"], { ns: "business" }),
4904
- actions: /* @__PURE__ */ jsx(Button, { testId: "backBtn", onClick: handleGoBack, variant: "link", children: t(($) => $["back"], { ns: "common" }) }),
4905
- testId: "invalidTin"
4906
- }
4907
- ),
4908
- fetchingError && /* @__PURE__ */ jsx(
4909
- Alert,
4910
- {
4911
- variant: "info",
4912
- type: "callToAction",
4913
- title: t(($) => $["businessSelection__failedToLoad"], { ns: "business" }),
4914
- actions: /* @__PURE__ */ jsx(
4915
- Button,
4916
- {
4917
- testId: "reloadBusiness",
4918
- onClick: () => refetchCompanySelection(),
4919
- variant: "link",
4920
- children: t(($) => $["tryAgain"], { ns: "common" })
4921
- }
4922
- ),
4923
- testId: "failedToLoad"
4924
- }
4925
- ),
4926
- excludeResultAsGovernmentEntity && /* @__PURE__ */ jsx(
4927
- Alert,
4928
- {
4929
- variant: "info",
4930
- type: "callToAction",
4931
- title: t(($) => $["businessSelection__unableToOnboardGovernmentEntity"], {
4932
- ns: "business"
4933
- }),
4934
- actions: /* @__PURE__ */ jsx(Button, { onClick: handleGoBack, variant: "link", children: t(($) => $["goBack"], { ns: "common" }) })
4935
- }
4936
- ),
4937
- !fetchingError && !excludeResultAsGovernmentEntity && /* @__PURE__ */ jsx(BusinessInformation, { fetching, selectedBusiness: currentBusinessSelection })
4938
- ] })
4939
- }
4940
- );
4941
- }
4942
- function BusinessSelection({
4943
- showCompanyStructure,
4944
- loading,
4945
- searchResults,
4946
- proceedToManualDataEntry,
4947
- handleNextClick,
4948
- setIsBusinessSelection,
4949
- setShowCompanyStructure
4950
- }) {
4951
- const { t } = useTranslation(["common", "business"]);
4952
- const userEvents = useAnalyticsContext();
4953
- const { basicInformation } = useGlobalData();
4954
- const {
4955
- state: { currentState }
4956
- } = useStateContext();
4957
- const [selectedBusinessId, setSelectedBusinessId] = useState();
4958
- const [fetchParams, setFetchParams] = useState();
4959
- const {
4960
- data: businessData,
4961
- isError: fetchingError,
4962
- isLoading: fetching,
4963
- refetch: refetchCompanySelection
4964
- } = useCompanySelection(fetchParams);
4965
- if (fetching) {
4966
- setVerifiedBusiness(void 0);
4967
- }
4968
- const [prevBusinessData, setPrevBusinessData] = useState(businessData);
4969
- if (prevBusinessData !== businessData) {
4970
- if (businessData?.tinMatched === true && !verifiedBusiness.value) {
4971
- userEvents.addPageEvent("Success", {
4972
- actionType: "select",
4973
- returnValue: "companySelection"
4974
- });
4975
- if (!businessData?.legalForm) {
4976
- setShowCompanyStructure(true);
4977
- handleNextClick();
4978
- }
4979
- setVerifiedBusiness(businessData);
4980
- } else {
4981
- userEvents.addPageEvent("Encountered error", {
4982
- actionType: "select",
4983
- returnValue: "companySelection"
4984
- });
4985
- }
4986
- setPrevBusinessData(businessData);
4987
- }
4988
- const currentTin = basicInformation?.taxInformation?.find(
4989
- (taxId) => taxId.country === basicInformation.country
4990
- )?.number;
4991
- const handleSelectBusiness = useCallback(
4992
- async (result) => {
4993
- if ((!selectedBusinessId || selectedBusinessId !== result.id) && currentTin) {
4994
- userEvents.addPageEvent("Clicked button", {
4995
- actionType: "select",
4996
- label: "selectBusiness",
4997
- additionalData: {
4998
- companyIdx: searchResults?.findIndex((searchResult) => searchResult.id === result.id)
4999
- }
5000
- });
5001
- setSelectedBusinessId(result.id);
5002
- setFetchParams({
5003
- company: result,
5004
- state: basicInformation?.stateOrProvince,
5005
- name: result.name,
5006
- tin: currentTin
5007
- });
5008
- }
5009
- },
5010
- [searchResults, basicInformation?.stateOrProvince, selectedBusinessId, currentTin, userEvents]
5011
- );
5012
- const handleConfirmSelection = async () => {
5013
- handleNextClick();
5014
- };
5015
- const showLoader = loading || fetching && searchResults?.length === 1;
5016
- const businessSelectionClasses = cx("adyen-kyc-business-selection", {
5017
- "adyen-kyc-business-selection--loading": showLoader
5018
- });
5019
- const loaderClasses = cx("adyen-kyc-business-selection__loader", {
5020
- "adyen-kyc-business-selection__loader--hide": !showLoader
5021
- });
5022
- if (searchResults?.length) {
5023
- const idxNameMatch = searchResults.findIndex(
5024
- (result) => isNormalizedStringMatch(
5025
- currentState?.data?.basicInformation?.legalCompanyName || "",
5026
- result.name
5027
- )
5028
- );
5029
- if (idxNameMatch > -1) {
5030
- searchResults.unshift(searchResults.splice(idxNameMatch, 1)[0]);
5031
- }
4554
+ },
4555
+ [CountryCodes.Singapore]: {
4556
+ label: "legalCompanyName",
4557
+ helperText: "legalCompanyName__helperText__SG",
4558
+ validators: validateNotEmptyOnBlur
4559
+ },
4560
+ [CountryCodes.UnitedStates]: ({ isBusiness }) => ({
4561
+ label: "legalCompanyName__US",
4562
+ helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
4563
+ validators: validateNotEmptyOnBlur
4564
+ })
4565
+ };
4566
+ const defaultFieldMetadataV4 = {
4567
+ label: "legalCompanyName",
4568
+ helperText: "legalCompanyName__helperText",
4569
+ validators: validateLegalCompanyName
4570
+ };
4571
+ const defaultFieldConfigV4 = {
4572
+ [CountryCodes.Australia]: {
4573
+ label: "legalCompanyName",
4574
+ helperText: "legalCompanyName__helperText__AU",
4575
+ validators: validateLegalCompanyName
4576
+ },
4577
+ [CountryCodes.HongKong]: {
4578
+ label: "legalCompanyName",
4579
+ helperText: "legalCompanyName__helperText__HK",
4580
+ validators: validateLegalCompanyName
4581
+ },
4582
+ [CountryCodes.Netherlands]: {
4583
+ label: "legalCompanyName",
4584
+ helperText: "legalCompanyName__helperText__NL",
4585
+ validators: validateLegalCompanyName
4586
+ },
4587
+ [CountryCodes.Singapore]: {
4588
+ label: "legalCompanyName",
4589
+ helperText: "legalCompanyName__helperText__SG",
4590
+ validators: validateLegalCompanyName
4591
+ },
4592
+ [CountryCodes.UnitedStates]: ({ isBusiness }) => ({
4593
+ label: "legalCompanyName__US",
4594
+ helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
4595
+ validators: validateLegalCompanyName
4596
+ }),
4597
+ [CountryCodes.Japan]: {
4598
+ label: "legalCompanyName__JP",
4599
+ helperText: void 0,
4600
+ validators: [...validateLegalCompanyName, validateLatinSpaceMarkPunctuationOnlyOnBlur]
5032
4601
  }
5033
- if (searchResults?.length && !showCompanyStructure || showLoader) {
5034
- return /* @__PURE__ */ jsxs("div", { className: businessSelectionClasses, children: [
5035
- /* @__PURE__ */ jsx("div", { className: loaderClasses, "data-testId": "business-selection-loader", children: /* @__PURE__ */ jsx(Loader, { size: "large" }) }),
5036
- !!(searchResults?.length && !showCompanyStructure && !showLoader) && /* @__PURE__ */ jsxs(Fragment, { children: [
5037
- /* @__PURE__ */ jsx(Header, { title: t(($) => $["businessSelectionFormHeading"], { ns: "common" }) }),
5038
- /* @__PURE__ */ jsx(StackLayout, { children: searchResults?.map((result) => /* @__PURE__ */ jsx(
5039
- BusinessInformationCard,
5040
- {
5041
- result,
5042
- selectedBusinessId,
5043
- currentBusinessSelection: businessData,
5044
- fetching,
5045
- fetchingError,
5046
- invalidTin: businessData?.tinMatched === false,
5047
- handleSelectBusiness,
5048
- refetchCompanySelection,
5049
- handleConfirmSelection,
5050
- setIsBusinessSelection
5051
- },
5052
- result.id
5053
- )) }),
5054
- /* @__PURE__ */ jsxs(
5055
- Typography,
5056
- {
5057
- el: "span",
5058
- color: "secondary",
5059
- className: "adyen-kyc-business-selection__footer",
5060
- children: [
5061
- t(($) => $["businessSelection__footer"], { ns: "business" }),
5062
- /* @__PURE__ */ jsx(Button, { variant: "link", onClick: proceedToManualDataEntry, testId: "manualDataEntry", children: t(($) => $["businessSelection__footerButton"], { ns: "business" }) })
5063
- ]
5064
- }
5065
- )
5066
- ] })
5067
- ] });
4602
+ };
4603
+ const defaultJaHaniLegalCompanyNameFieldMetadata = {
4604
+ label: "jaHaniLegalCompanyName"
4605
+ };
4606
+ const defaultJaKanaLegalCompanyNameFieldMetadata = {
4607
+ label: "jaKanaLegalCompanyName"
4608
+ };
4609
+ const defaultJaHaniLegalCompanyNameFieldConfig = {
4610
+ label: "jaHaniLegalCompanyName",
4611
+ validators: validateJaHaniLegalCompanyName
4612
+ };
4613
+ const defaultJaKanaLegalCompanyNameFieldConfig = {
4614
+ label: "jaKanaLegalCompanyName",
4615
+ validators: validateJaKanaLegalCompanyName
4616
+ };
4617
+ const localizedLegalCompanyNameFieldConfig = {
4618
+ jaHaniLegalCompanyName: {
4619
+ config: defaultJaHaniLegalCompanyNameFieldConfig,
4620
+ metadata: defaultJaHaniLegalCompanyNameFieldMetadata
4621
+ },
4622
+ jaKanaLegalCompanyName: {
4623
+ config: defaultJaKanaLegalCompanyNameFieldConfig,
4624
+ metadata: defaultJaKanaLegalCompanyNameFieldMetadata
5068
4625
  }
5069
- return null;
5070
- }
5071
- const BASIC_INFORMATION_FORM_ID = "basicInformation";
4626
+ };
4627
+ const defaultFieldMetadata = {
4628
+ label: "stateOrProvince",
4629
+ placeholder: "stateOrProvince__placeHolder",
4630
+ validators: validateNotEmptyOnBlur
4631
+ };
4632
+ const defaultFieldConfig = {
4633
+ [CountryCodes.Australia]: {
4634
+ label: "state",
4635
+ placeholder: "selectState",
4636
+ validators: validateNotEmptyOnBlur
4637
+ },
4638
+ [CountryCodes.Brazil]: {
4639
+ label: "state",
4640
+ placeholder: "selectState",
4641
+ validators: validateNotEmptyOnBlur
4642
+ },
4643
+ [CountryCodes.Canada]: {
4644
+ label: "provinceOrTerritory",
4645
+ placeholder: "selectProvinceOrTerritory",
4646
+ validators: validateNotEmptyOnBlur
4647
+ },
4648
+ [CountryCodes.NewZealand]: {
4649
+ label: "region",
4650
+ validators: validateNotEmptyOnBlur
4651
+ },
4652
+ [CountryCodes.UnitedStates]: ({ isBusiness }) => ({
4653
+ label: isBusiness ? "stateOrProvince__US__business" : "state",
4654
+ placeholder: "stateOrProvince__placeHolder__US",
4655
+ validators: validateNotEmptyOnBlur
4656
+ })
4657
+ };
5072
4658
  const BASIC_INFORMATION_FIELDS = [
5073
4659
  ...COUNTRY_FIELD,
5074
4660
  ...LEGAL_COMPANY_NAME_FIELD,
@@ -5079,98 +4665,58 @@ const BASIC_INFORMATION_FIELDS = [
5079
4665
  ...BUSINESS_REGISTRATION_NUMBER_FIELD,
5080
4666
  ...COUNTRY_OF_GOVERNING_LAW_FIELD
5081
4667
  ];
4668
+ const FormDescription = ({
4669
+ description,
4670
+ t
4671
+ }) => {
4672
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-header__description", children: [
4673
+ description,
4674
+ " ",
4675
+ /* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/privacy-policy", external: true, children: t(($) => $["privacyStatement"]) })
4676
+ ] });
4677
+ };
5082
4678
  function BasicInformation({
5083
- data,
5084
- labels,
5085
- placeholders,
5086
- helperText,
5087
- readOnly,
5088
- shouldValidate,
5089
- formVerificationErrors,
5090
- fieldValidationErrors,
5091
- allFields,
5092
- requiredFields,
5093
- obscuredFields,
5094
- optionalFields,
5095
- readOnlyFields,
5096
- trustedFields,
4679
+ id,
5097
4680
  country,
5098
- companyType = CompanyTypesValues.PRIVATE_COMPANY,
4681
+ shouldValidate,
4682
+ validationErrors = {},
4683
+ verificationErrors = {},
5099
4684
  isTopLevelEntity,
5100
- className,
5101
- showBusinessSelection,
5102
- showCompanyStructure,
5103
- isActiveForm,
5104
- loading,
5105
- searchResults,
5106
- proceedToManualDataEntry,
5107
- handleNextClick,
5108
- setShowBusinessSelection,
5109
- setShowCompanyStructure,
5110
- disableCountry
4685
+ disableCountry,
4686
+ companyType
5111
4687
  }) {
5112
- const { updateStateSlice, sliceData } = useGlobalDataSlice(BASIC_INFORMATION_FORM_ID);
5113
4688
  const { t } = useTranslation(["common", "business"]);
5114
4689
  const { isSettingEnabled } = useSettingsContext();
5115
4690
  const { isExperimentEnabled } = useExperimentsContext();
4691
+ const { form } = useFormContext();
5116
4692
  const allowedCountries = useAllowedCountries();
5117
4693
  const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
5118
- const verifiedBusiness$1 = verifiedBusiness.value;
5119
- const currentCountryTaxInformation = sliceData?.taxInformation?.find(
4694
+ const state = form.data?.basicInformation?.stateOrProvince;
4695
+ const currentCountryTaxInformation = form.data?.basicInformation?.taxInformation?.find(
5120
4696
  (tax) => tax.country === country
5121
4697
  );
5122
- const getFormSchema = useCallback(
5123
- (currentData) => {
5124
- const fieldsToRemove = [];
5125
- if (currentData.country !== CountryCodes.UnitedKingdom) {
5126
- fieldsToRemove.push("countryOfGoverningLaw");
5127
- }
5128
- if (currentData.exemptedFromTax) {
5129
- fieldsToRemove.push("taxInformation");
5130
- }
5131
- return requiredFields?.filter((field) => !fieldsToRemove.includes(field)) ?? [
5132
- ...COUNTRY_FIELD,
5133
- ...LEGAL_COMPANY_NAME_FIELD
5134
- ];
5135
- },
5136
- [requiredFields]
5137
- );
5138
- const initialFormUtilsProps = useMemo(
5139
- () => ({
5140
- labels,
5141
- placeholders,
5142
- helperText,
5143
- readOnly,
5144
- allFields,
5145
- requiredFields,
5146
- readOnlyFields,
5147
- optionalFields,
5148
- obscuredFields,
5149
- trustedFields,
5150
- shouldValidate
5151
- }),
5152
- [
5153
- allFields,
5154
- helperText,
5155
- labels,
5156
- obscuredFields,
5157
- optionalFields,
5158
- placeholders,
5159
- readOnly,
5160
- readOnlyFields,
5161
- requiredFields,
5162
- trustedFields,
5163
- shouldValidate
5164
- ]
4698
+ const handleChangeFor = useCallback(
4699
+ (fieldName, mode) => form.handleChangeFor(fieldName, "basicInformation", mode),
4700
+ [form]
5165
4701
  );
5166
- const mergedFieldProps = useMemo(
5167
- () => initialFormUtilsProps.allFields?.reduce((acc, field) => {
4702
+ const formUtils = useMemo(() => {
4703
+ const initialProps = {
4704
+ data: form.data?.basicInformation ?? {},
4705
+ fieldValidationErrors: validationErrors,
4706
+ formVerificationErrors: verificationErrors,
4707
+ allFields: form.allFields?.basicInformation ?? [],
4708
+ requiredFields: form.requiredFields?.basicInformation ?? [],
4709
+ optionalFields: form.optionalFields?.basicInformation ?? [],
4710
+ trustedFields: form.trustedFields?.basicInformation ?? [],
4711
+ obscuredFields: form.obscuredFields?.basicInformation ?? [],
4712
+ errors: form.errors?.basicInformation ?? {},
4713
+ valid: form.valid?.basicInformation ?? {},
4714
+ handleFieldChange: handleChangeFor
4715
+ };
4716
+ const formUtilProps = initialProps.allFields?.reduce((acc, field) => {
5168
4717
  switch (field) {
5169
4718
  case "country":
5170
- return {
5171
- ...acc,
5172
- validators: { ...acc.validators, ...CountryFieldValidation() }
5173
- };
4719
+ return acc;
5174
4720
  case "legalCompanyName":
5175
4721
  return mergeFieldMetadataIntoProps(
5176
4722
  field,
@@ -5182,10 +4728,7 @@ function BasicInformation({
5182
4728
  acc
5183
4729
  );
5184
4730
  case "countryOfGoverningLaw":
5185
- return {
5186
- ...acc,
5187
- validators: { ...acc.validators, ...CountryOfGoverningLawFieldValidation() }
5188
- };
4731
+ return acc;
5189
4732
  case "stateOrProvince":
5190
4733
  return mergeFieldMetadataIntoProps(
5191
4734
  field,
@@ -5216,24 +4759,14 @@ function BasicInformation({
5216
4759
  registrationNumberDefaultFieldConfig[country],
5217
4760
  {
5218
4761
  companyType,
5219
- registrationNumberType: sliceData?.registrationNumberType,
5220
- state: sliceData?.stateOrProvince,
4762
+ registrationNumberType: form.data?.additionalInformation?.registrationNumberType,
4763
+ state,
5221
4764
  isExperimentEnabled
5222
4765
  },
5223
4766
  registrationNumberDefaultFieldMetadata
5224
4767
  ),
5225
4768
  acc
5226
4769
  );
5227
- case "exemptedFromRegistrationNumber":
5228
- return mergeFieldMetadataIntoProps(
5229
- field,
5230
- resolveFieldMetadata(
5231
- exemptFromRegistrationNumberDefaultFieldConfig[country],
5232
- {},
5233
- exemptFromRegistrationNumberDefaultFieldMetadata
5234
- ),
5235
- acc
5236
- );
5237
4770
  case "jaHaniLegalCompanyName":
5238
4771
  return mergeFieldMetadataIntoProps(
5239
4772
  field,
@@ -5257,116 +4790,75 @@ function BasicInformation({
5257
4790
  default:
5258
4791
  return acc;
5259
4792
  }
5260
- }, initialFormUtilsProps),
5261
- [
5262
- initialFormUtilsProps,
5263
- isExperimentEnabled,
5264
- country,
5265
- currentCountryTaxInformation?.type,
5266
- companyType,
5267
- sliceData
5268
- ]
5269
- );
5270
- const {
5271
- schema: formSchema,
5272
- data: formData,
5273
- errors: formErrors,
5274
- valid: formValid,
5275
- fieldProblems: formFieldProblems,
5276
- handleChangeFor
5277
- } = useForm({
5278
- schema: getFormSchema,
5279
- defaultData: data,
5280
- rules: mergedFieldProps?.validators,
5281
- optionalFields: mergedFieldProps?.optionalFields,
5282
- obscuredFields: mergedFieldProps?.obscuredFields,
5283
- trustedFields: mergedFieldProps?.trustedFields,
5284
- fieldProblems: fieldValidationErrors,
5285
- shouldValidate
5286
- });
5287
- const formUtils = createFormUtils(
5288
- mergedFieldProps ?? initialFormUtilsProps,
5289
- t
5290
- );
5291
- useEffect(() => {
5292
- updateStateSlice({
5293
- schema: formSchema,
5294
- data: formData,
5295
- errors: formErrors,
5296
- valid: formValid,
5297
- fieldProblems: formFieldProblems
5298
- });
5299
- }, [formSchema, formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
5300
- useEffect(() => {
5301
- if (!isActiveForm && !searchResults?.length) setShowBusinessSelection(false);
5302
- }, [isActiveForm, searchResults?.length, setShowBusinessSelection]);
5303
- useEffect(() => {
5304
- if (showBusinessSelection && showCompanyStructure && isActiveForm) {
5305
- handleNextClick();
5306
- if (verifiedBusiness$1) setShowBusinessSelection(false);
5307
- }
4793
+ }, initialProps);
4794
+ return createFormUtils(formUtilProps ?? initialProps, t);
5308
4795
  }, [
5309
- showBusinessSelection,
5310
- showCompanyStructure,
5311
- handleNextClick,
5312
- isActiveForm,
5313
- verifiedBusiness$1,
5314
- setShowBusinessSelection
4796
+ companyType,
4797
+ country,
4798
+ currentCountryTaxInformation?.type,
4799
+ form.allFields?.basicInformation,
4800
+ form.data?.additionalInformation?.registrationNumberType,
4801
+ form.data?.basicInformation,
4802
+ form.errors?.basicInformation,
4803
+ form.obscuredFields?.basicInformation,
4804
+ form.optionalFields?.basicInformation,
4805
+ form.requiredFields?.basicInformation,
4806
+ form.trustedFields?.basicInformation,
4807
+ form.valid?.basicInformation,
4808
+ handleChangeFor,
4809
+ isExperimentEnabled,
4810
+ state,
4811
+ t,
4812
+ validationErrors,
4813
+ verificationErrors
5315
4814
  ]);
5316
- const classNames = className ? cx("adyen-kyc-basic-information", className) : "adyen-kyc-basic-information";
5317
4815
  const showField = (fieldKeys) => fieldKeys.some((field) => {
5318
4816
  switch (field) {
4817
+ case "registrationNumberType":
5319
4818
  case "registrationNumber": {
5320
- return (formUtils.isRequiredField(field) || formUtils.isOptionalField(field)) && formData?.stateOrProvince;
4819
+ return (formUtils.isRequiredField(field) || formUtils.isOptionalField(field)) && form.data.basicInformation?.stateOrProvince;
5321
4820
  }
5322
4821
  default:
5323
4822
  return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
5324
4823
  }
5325
4824
  });
5326
4825
  const legalCompanyNameFields = useLegalCompanyNameField({
5327
- data: formData,
5328
- valid: formValid,
5329
- errors: formErrors,
5330
- fieldProblems: formFieldProblems,
4826
+ data: form.data.basicInformation ?? {},
4827
+ valid: form.valid.basicInformation ?? {},
4828
+ errors: form.errors.basicInformation ?? {},
4829
+ fieldProblems: form.fieldProblems.basicInformation ?? {},
5331
4830
  country,
5332
4831
  formUtils,
5333
4832
  handleChange: handleChangeFor
5334
4833
  });
5335
- if (showBusinessSelection) {
5336
- return /* @__PURE__ */ jsx(
5337
- BusinessSelection,
4834
+ return /* @__PURE__ */ jsxs("form", { id, className: "adyen-kyc-basic-information", children: [
4835
+ /* @__PURE__ */ jsx(Header, { title: t(($) => $["basicInformationFormHeading"], { ns: "business" }), children: /* @__PURE__ */ jsx(
4836
+ FormDescription,
5338
4837
  {
5339
- showCompanyStructure,
5340
- loading,
5341
- searchResults,
5342
- proceedToManualDataEntry,
5343
- handleNextClick,
5344
- setIsBusinessSelection: setShowBusinessSelection,
5345
- setShowCompanyStructure
4838
+ slot: "description",
4839
+ description: t(($) => $["basicInformationFormDescription"], { ns: "business" }),
4840
+ t
5346
4841
  }
5347
- );
5348
- }
5349
- return /* @__PURE__ */ jsxs("form", { id: BASIC_INFORMATION_FORM_ID, className: classNames, children: [
5350
- /* @__PURE__ */ jsx(Header, { title: t(($) => $["basicInformationFormHeading"], { ns: "business" }), children: /* @__PURE__ */ jsxs("template", { slot: "description", children: [
5351
- t(($) => $["basicInformationFormDescription"], { ns: "business" }),
5352
- " ",
5353
- /* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/privacy-policy", external: true, children: t(($) => $["privacyStatement"]) })
5354
- ] }) }),
4842
+ ) }),
5355
4843
  /* @__PURE__ */ jsx(
5356
4844
  ErrorPanel,
5357
4845
  {
5358
4846
  id: "ariaErrorField",
5359
- verificationErrors: formVerificationErrors,
5360
- validationErrors: fieldValidationErrors,
4847
+ verificationErrors,
4848
+ validationErrors,
5361
4849
  formUtils
5362
4850
  }
5363
4851
  ),
5364
4852
  /* @__PURE__ */ jsx("fieldset", { children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
5365
4853
  CountryField,
5366
4854
  {
5367
- data: formUtils.getFieldData(formData, COUNTRY_FIELD),
5368
- valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
5369
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
4855
+ data: formUtils.getFieldData(form.data?.basicInformation ?? {}, COUNTRY_FIELD),
4856
+ valid: formUtils.getFieldValid(form.valid?.basicInformation ?? {}, COUNTRY_FIELD),
4857
+ errors: formUtils.getFieldErrors(
4858
+ form.errors?.basicInformation ?? {},
4859
+ validationErrors,
4860
+ COUNTRY_FIELD
4861
+ ),
5370
4862
  labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
5371
4863
  country: "countryRegionOfEstablishment"
5372
4864
  }),
@@ -5375,61 +4867,73 @@ function BasicInformation({
5375
4867
  allowedCountries: isTopLevelEntity ? allowedCountries : void 0
5376
4868
  }
5377
4869
  ) }) }),
5378
- COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(formData.country ?? country) && showField(COUNTRY_OF_GOVERNING_LAW_FIELD) && /* @__PURE__ */ jsx(
5379
- CountryOfGoverningLawField,
5380
- {
5381
- data: formUtils.getFieldData(formData, COUNTRY_OF_GOVERNING_LAW_FIELD),
5382
- country: sliceData?.country,
5383
- valid: formUtils.getFieldValid(formValid, COUNTRY_OF_GOVERNING_LAW_FIELD),
5384
- errors: formUtils.getFieldErrors(
5385
- formErrors,
5386
- formFieldProblems,
5387
- COUNTRY_OF_GOVERNING_LAW_FIELD
5388
- ),
5389
- labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
5390
- readonly: false,
5391
- allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
5392
- handleChangeFor
5393
- }
5394
- ),
5395
- // fields shown here are abstracted by useLegalCompanyNameField
5396
- legalCompanyNameFields.map((field) => /* @__PURE__ */ jsx(
5397
- Field,
5398
- {
5399
- name: field?.name ?? "",
5400
- label: field?.label,
5401
- helper: field?.helper,
5402
- errorMessage: field?.errorMessage,
5403
- isValid: field?.isValid,
5404
- children: (childProps) => /* @__PURE__ */ jsx(
5405
- InputText,
5406
- {
5407
- ...childProps,
5408
- "aria-required": true,
5409
- "aria-invalid": !field?.isValid,
5410
- name: field?.name,
5411
- value: field?.value,
5412
- readonly: field?.readonly,
5413
- onInput: field ? field.onInput : () => {
5414
- },
5415
- transformInput: field?.transformInput,
5416
- transformMode: field?.transformMode,
5417
- onBlur: field?.onBlur,
5418
- onKeyDown: field?.onKeyDown
5419
- }
5420
- )
5421
- },
5422
- field?.name
5423
- )),
5424
- COUNTRIES_USING_COMPANY_SEARCH.includes(formData.country ?? country) && /* @__PURE__ */ jsxs("fieldset", { children: [
4870
+ /* @__PURE__ */ jsxs("fieldset", { children: [
4871
+ COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(country) && showField(COUNTRY_OF_GOVERNING_LAW_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4872
+ CountryOfGoverningLawField,
4873
+ {
4874
+ data: formUtils.getFieldData(
4875
+ form.data?.basicInformation ?? {},
4876
+ COUNTRY_OF_GOVERNING_LAW_FIELD
4877
+ ),
4878
+ country,
4879
+ valid: formUtils.getFieldValid(
4880
+ form.valid?.basicInformation ?? {},
4881
+ COUNTRY_OF_GOVERNING_LAW_FIELD
4882
+ ),
4883
+ errors: formUtils.getFieldErrors(
4884
+ form.errors?.basicInformation ?? {},
4885
+ validationErrors,
4886
+ COUNTRY_OF_GOVERNING_LAW_FIELD
4887
+ ),
4888
+ labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
4889
+ readonly: false,
4890
+ allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
4891
+ handleChangeFor
4892
+ }
4893
+ ) }),
4894
+ // fields shown here are abstracted by useLegalCompanyNameField
4895
+ legalCompanyNameFields.map((field) => /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
4896
+ Field,
4897
+ {
4898
+ name: field?.name ?? "",
4899
+ label: field?.label,
4900
+ helper: field?.helper,
4901
+ errorMessage: field?.errorMessage,
4902
+ isValid: Boolean(field?.isValid),
4903
+ children: (childProps) => /* @__PURE__ */ jsx(
4904
+ InputText,
4905
+ {
4906
+ ...childProps,
4907
+ "aria-required": true,
4908
+ "aria-invalid": !field?.isValid,
4909
+ name: field?.name,
4910
+ value: field?.value,
4911
+ readonly: field?.readonly,
4912
+ onInput: field ? field.onInput : () => {
4913
+ },
4914
+ transformInput: field?.transformInput,
4915
+ transformMode: field?.transformMode,
4916
+ onBlur: field?.onBlur,
4917
+ onKeyDown: field?.onKeyDown
4918
+ }
4919
+ )
4920
+ },
4921
+ field?.name
4922
+ ) }, field?.name)),
5425
4923
  showField(TAX_INFORMATION_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
5426
4924
  TaxInformationField,
5427
4925
  {
5428
- data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
5429
- valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
4926
+ data: formUtils.getFieldData(
4927
+ form.data?.basicInformation ?? {},
4928
+ TAX_INFORMATION_FIELD
4929
+ ),
4930
+ valid: formUtils.getFieldValid(
4931
+ form.valid?.basicInformation ?? {},
4932
+ TAX_INFORMATION_FIELD
4933
+ ),
5430
4934
  errors: formUtils.getFieldErrors(
5431
- formErrors,
5432
- formFieldProblems,
4935
+ form.errors?.basicInformation ?? {},
4936
+ validationErrors,
5433
4937
  TAX_INFORMATION_FIELD
5434
4938
  ),
5435
4939
  labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
@@ -5442,33 +4946,43 @@ function BasicInformation({
5442
4946
  shouldValidate,
5443
4947
  handleChangeFor,
5444
4948
  canExempt: showField(["exemptedFromTax"]),
5445
- registrationNumber: formData.registrationNumber,
5446
- country: formData.country ?? country,
4949
+ registrationNumber: form.data.additionalInformation?.registrationNumber,
4950
+ country,
5447
4951
  entityType: companyType,
5448
- defaultData: data?.taxInformation
4952
+ defaultData: form.defaultData?.basicInformation?.taxInformation
5449
4953
  }
5450
4954
  ) }),
5451
4955
  showField(STATE_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
5452
4956
  StateField,
5453
4957
  {
5454
- data: formUtils.getFieldData(formData, STATE_FIELD),
5455
- valid: formUtils.getFieldValid(formValid, STATE_FIELD),
5456
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STATE_FIELD),
4958
+ data: formUtils.getFieldData(form.data?.basicInformation ?? {}, STATE_FIELD),
4959
+ valid: formUtils.getFieldValid(form.valid?.basicInformation ?? {}, STATE_FIELD),
4960
+ errors: formUtils.getFieldErrors(
4961
+ form.errors?.basicInformation ?? {},
4962
+ validationErrors,
4963
+ STATE_FIELD
4964
+ ),
5457
4965
  labels: formUtils.getFieldLabels(STATE_FIELD),
5458
4966
  placeholders: formUtils.getFieldPlaceholders(STATE_FIELD),
5459
4967
  readonly: formUtils.isReadOnly("stateOrProvince"),
5460
4968
  handleChangeFor,
5461
- selectedCountry: formData.country
4969
+ selectedCountry: country
5462
4970
  }
5463
4971
  ) }),
5464
4972
  showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
5465
4973
  BusinessRegistrationNumberField,
5466
4974
  {
5467
- data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
5468
- valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
4975
+ data: formUtils.getFieldData(
4976
+ form.data?.basicInformation ?? {},
4977
+ BUSINESS_REGISTRATION_NUMBER_FIELD
4978
+ ),
4979
+ valid: formUtils.getFieldValid(
4980
+ form.valid?.basicInformation ?? {},
4981
+ BUSINESS_REGISTRATION_NUMBER_FIELD
4982
+ ),
5469
4983
  errors: formUtils.getFieldErrors(
5470
- formErrors,
5471
- formFieldProblems,
4984
+ form.errors?.basicInformation ?? {},
4985
+ validationErrors,
5472
4986
  BUSINESS_REGISTRATION_NUMBER_FIELD
5473
4987
  ),
5474
4988
  labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
@@ -5482,8 +4996,8 @@ function BasicInformation({
5482
4996
  optional: formUtils.isOptionalField("registrationNumber"),
5483
4997
  shouldValidate,
5484
4998
  handleChangeFor,
5485
- country: formData.country ?? country,
5486
- canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
4999
+ country,
5000
+ canExempt: showField(["exemptedFromRegistrationNumber"]),
5487
5001
  companyType
5488
5002
  }
5489
5003
  ) })
@@ -5506,6 +5020,32 @@ const useClearCompanyData = (options) => {
5506
5020
  ...options
5507
5021
  });
5508
5022
  };
5023
+ const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
5024
+ const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [
5025
+ StateCodesUS.Arkansas,
5026
+ StateCodesUS.Connecticut,
5027
+ StateCodesUS.Georgia,
5028
+ StateCodesUS.Hawaii,
5029
+ StateCodesUS.Indiana,
5030
+ StateCodesUS.Kentucky,
5031
+ StateCodesUS.Maryland,
5032
+ StateCodesUS.Minnesota,
5033
+ StateCodesUS.Missouri,
5034
+ StateCodesUS.Montana,
5035
+ StateCodesUS.NewHampshire,
5036
+ StateCodesUS.NewMexico,
5037
+ StateCodesUS.SouthCarolina,
5038
+ StateCodesUS.Utah,
5039
+ StateCodesUS.Vermont,
5040
+ StateCodesUS.Wisconsin,
5041
+ StateCodesUS.Wyoming
5042
+ ];
5043
+ const KNOWN_DISALLOWED_INDEX_DATASET_STATES = [
5044
+ StateCodesUS.California,
5045
+ StateCodesUS.Florida,
5046
+ StateCodesUS.Illinois,
5047
+ StateCodesUS.Texas
5048
+ ];
5509
5049
  const KOMPANY_SEARCH_FAILURE = "Kompany index and deep search both failed to complete";
5510
5050
  const useCompanySearch = (data, options) => {
5511
5051
  const { rootLegalEntityId, baseUrl } = useApiContext();
@@ -5576,6 +5116,74 @@ const handleCompanySearch = async (rootLegalEntityId, baseUrl, data) => {
5576
5116
  }
5577
5117
  return await searchByCompanyName();
5578
5118
  };
5119
+ const handleCompanyDataset = async (rootLegalEntityId, baseUrl, data) => {
5120
+ const requestPayload = {
5121
+ companyId: data.company.id,
5122
+ country: "US",
5123
+ state: data.state
5124
+ };
5125
+ const searchRequest = async (path) => {
5126
+ return httpPost(
5127
+ {
5128
+ baseUrl,
5129
+ path: `legalEntities/${rootLegalEntityId}/companyDataset${path ? "/" + path : ""}`
5130
+ },
5131
+ requestPayload
5132
+ );
5133
+ };
5134
+ const getCompanyDataset = async () => await searchRequest();
5135
+ const refreshCompanyDataset = async () => await searchRequest("refreshed");
5136
+ const date = (/* @__PURE__ */ new Date()).toDateString();
5137
+ const isDataCompliant = data.company.lastUpdate ? Date.parse(date) - Date.parse(data.company.lastUpdate) < LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW : false;
5138
+ if (data.state) {
5139
+ return isDataCompliant && !KNOWN_DISALLOWED_INDEX_DATASET_STATES.includes(data.state) ? await getCompanyDataset() : await refreshCompanyDataset();
5140
+ }
5141
+ const companyData = isDataCompliant ? await getCompanyDataset() : await refreshCompanyDataset();
5142
+ return {
5143
+ ...companyData,
5144
+ name: companyData.name.replaceAll("&amp;", "&")
5145
+ };
5146
+ };
5147
+ const useVerifyTin = (data, options) => {
5148
+ const { rootLegalEntityId, baseUrl } = useApiContext();
5149
+ return useQuery({
5150
+ queryKey: ["verifyTin", data],
5151
+ queryFn: data ? () => verifyTin(rootLegalEntityId.value, baseUrl.value, data) : skipToken,
5152
+ retry: 0,
5153
+ ...options
5154
+ });
5155
+ };
5156
+ const verifyTin = async (legalEntityId, baseUrl, data) => {
5157
+ return httpPost(
5158
+ {
5159
+ baseUrl,
5160
+ path: `legalEntities/${legalEntityId}/verifyTin`
5161
+ },
5162
+ data
5163
+ );
5164
+ };
5165
+ const useCompanySelection = (data, options) => {
5166
+ const { rootLegalEntityId, baseUrl } = useApiContext();
5167
+ return useQuery({
5168
+ queryKey: ["companySelection", data],
5169
+ queryFn: data ? () => handleCompanySelection(rootLegalEntityId.value, baseUrl.value, data) : skipToken,
5170
+ retry: 0,
5171
+ ...options
5172
+ });
5173
+ };
5174
+ const handleCompanySelection = async (rootLegalEntityId, baseUrl, data) => {
5175
+ const [companyDatasetResult, tinMatch] = await Promise.all([
5176
+ handleCompanyDataset(rootLegalEntityId, baseUrl, {
5177
+ company: data.company,
5178
+ state: data.state
5179
+ }),
5180
+ verifyTin(rootLegalEntityId, baseUrl, { name: data.name, tin: data.tin })
5181
+ ]);
5182
+ return {
5183
+ ...companyDatasetResult,
5184
+ tinMatched: tinMatch?.matched
5185
+ };
5186
+ };
5579
5187
  const mapOrganizationTypeToCompanyType = (organizationType) => {
5580
5188
  switch (organizationType) {
5581
5189
  case "BUSINESS":
@@ -5634,10 +5242,152 @@ const applyVerifiedBusinessData = (form, country, verifiedData) => {
5634
5242
  )(verifiedAddress.operationalAddress);
5635
5243
  }
5636
5244
  };
5245
+ function BusinessInformation({ fetching, selectedBusiness }) {
5246
+ const { t } = useTranslation(["common", "business"]);
5247
+ const businessInformationClasses = cx("adyen-kyc-business-information", {
5248
+ "adyen-kyc-business-information--fetching": fetching
5249
+ });
5250
+ const items = useMemo(
5251
+ () => selectedBusiness ? entriesOf(selectedBusiness).reduce(
5252
+ (acc, [key, value]) => {
5253
+ switch (key) {
5254
+ case "legalForm":
5255
+ if (value) acc[0].details = value;
5256
+ break;
5257
+ case "name":
5258
+ if (value) acc[1].details = value;
5259
+ break;
5260
+ case "address":
5261
+ if (value) acc[2].details = value;
5262
+ break;
5263
+ }
5264
+ return acc;
5265
+ },
5266
+ [
5267
+ {
5268
+ term: t(($) => $["legalForm"], { ns: "common" }),
5269
+ details: ""
5270
+ },
5271
+ {
5272
+ term: t(($) => $["legalCompanyName__US"], { ns: "common" }),
5273
+ details: ""
5274
+ },
5275
+ {
5276
+ term: t(($) => $["address"], { ns: "common" }),
5277
+ details: ""
5278
+ }
5279
+ ]
5280
+ ).filter((item) => !!item.details) : [],
5281
+ [selectedBusiness, t]
5282
+ );
5283
+ if (fetching) {
5284
+ return /* @__PURE__ */ jsx("div", { className: businessInformationClasses, children: /* @__PURE__ */ jsx(Loader, { size: "large" }) });
5285
+ }
5286
+ if (!fetching) {
5287
+ return /* @__PURE__ */ jsx("div", { className: businessInformationClasses, children: /* @__PURE__ */ jsx(StructuredList, { items }) });
5288
+ }
5289
+ return null;
5290
+ }
5291
+ function BusinessInformationCard({
5292
+ result,
5293
+ selectedBusinessId,
5294
+ currentBusinessSelection,
5295
+ fetching,
5296
+ fetchingError,
5297
+ invalidTin,
5298
+ setIsBusinessSelection,
5299
+ handleSelectBusiness,
5300
+ refetchCompanySelection,
5301
+ handleConfirmSelection,
5302
+ handleBackClick
5303
+ }) {
5304
+ const { t } = useTranslation(["common", "business"]);
5305
+ const excludeResultAsGovernmentEntity = useMemo(
5306
+ () => isBankAccountRequestedForOrganization.value && currentBusinessSelection?.organizationType === "GOVERNMENTAL_ORGANIZATION",
5307
+ [currentBusinessSelection]
5308
+ );
5309
+ const showSelectButton = useMemo(
5310
+ () => !fetching && !fetchingError && currentBusinessSelection && !excludeResultAsGovernmentEntity,
5311
+ [currentBusinessSelection, excludeResultAsGovernmentEntity, fetching, fetchingError]
5312
+ );
5313
+ const handleGoBack = () => {
5314
+ if (handleBackClick) {
5315
+ handleBackClick();
5316
+ } else {
5317
+ setIsBusinessSelection?.(false);
5318
+ }
5319
+ };
5320
+ return /* @__PURE__ */ jsx(
5321
+ Card,
5322
+ {
5323
+ "aria-selected": selectedBusinessId === result.id,
5324
+ className: "adyen-kyc-business-information-card",
5325
+ title: result.name,
5326
+ subTitle: result.registrationNumber,
5327
+ stateful: true,
5328
+ fetching: fetching && selectedBusinessId === result.id,
5329
+ active: selectedBusinessId === result.id,
5330
+ headerButton: selectedBusinessId === result.id && showSelectButton ? /* @__PURE__ */ jsx(
5331
+ Button,
5332
+ {
5333
+ onClick: () => handleConfirmSelection(currentBusinessSelection),
5334
+ testId: "selectBusiness",
5335
+ disabled: invalidTin,
5336
+ children: t(($) => $["thisIsMyBusiness"], { ns: "business" })
5337
+ }
5338
+ ) : null,
5339
+ onClick: () => handleSelectBusiness(result),
5340
+ onKeyDown: handleKeys(["Enter"], () => handleSelectBusiness(result)),
5341
+ children: selectedBusinessId === result.id && /* @__PURE__ */ jsxs(Fragment, { children: [
5342
+ /* @__PURE__ */ jsx(Divider, {}),
5343
+ invalidTin && /* @__PURE__ */ jsx(
5344
+ Alert,
5345
+ {
5346
+ variant: "warning",
5347
+ type: "callToAction",
5348
+ title: t(($) => $["businessSelection__invalidTin"], { ns: "business" }),
5349
+ actions: /* @__PURE__ */ jsx(Button, { testId: "backBtn", onClick: handleGoBack, variant: "link", children: t(($) => $["back"], { ns: "common" }) }),
5350
+ testId: "invalidTin"
5351
+ }
5352
+ ),
5353
+ fetchingError && /* @__PURE__ */ jsx(
5354
+ Alert,
5355
+ {
5356
+ variant: "info",
5357
+ type: "callToAction",
5358
+ title: t(($) => $["businessSelection__failedToLoad"], { ns: "business" }),
5359
+ actions: /* @__PURE__ */ jsx(
5360
+ Button,
5361
+ {
5362
+ testId: "reloadBusiness",
5363
+ onClick: () => refetchCompanySelection(),
5364
+ variant: "link",
5365
+ children: t(($) => $["tryAgain"], { ns: "common" })
5366
+ }
5367
+ ),
5368
+ testId: "failedToLoad"
5369
+ }
5370
+ ),
5371
+ excludeResultAsGovernmentEntity && /* @__PURE__ */ jsx(
5372
+ Alert,
5373
+ {
5374
+ variant: "info",
5375
+ type: "callToAction",
5376
+ title: t(($) => $["businessSelection__unableToOnboardGovernmentEntity"], {
5377
+ ns: "business"
5378
+ }),
5379
+ actions: /* @__PURE__ */ jsx(Button, { onClick: handleGoBack, variant: "link", children: t(($) => $["goBack"], { ns: "common" }) })
5380
+ }
5381
+ ),
5382
+ !fetchingError && !excludeResultAsGovernmentEntity && /* @__PURE__ */ jsx(BusinessInformation, { fetching, selectedBusiness: currentBusinessSelection })
5383
+ ] })
5384
+ }
5385
+ );
5386
+ }
5637
5387
  const BUSINESS_SELECTION_FIELDS = [
5638
5388
  "hasSelectedBusiness"
5639
5389
  ];
5640
- function BusinessSelectionMultiform({
5390
+ function BusinessSelection({
5641
5391
  country,
5642
5392
  validationErrors = {},
5643
5393
  verificationErrors = {},
@@ -5900,79 +5650,22 @@ const companyTypeMetadata = {
5900
5650
  }
5901
5651
  };
5902
5652
  const companyTypeOptions = Object.keys(companyTypeMetadata);
5903
- const CompanyStructureValidation = {
5904
- entityType: {
5905
- modes: ["blur"],
5906
- validate: (entityType) => !isEmpty(entityType),
5907
- errorMessage: "fieldIsRequired"
5908
- }
5909
- };
5910
- const COMPANY_STRUCTURE_FORM_ID = "companyStructure";
5911
5653
  const companyStructureFields = ["entityType"];
5912
5654
  function CompanyStructure({
5913
- data,
5914
- labels,
5915
- formVerificationErrors,
5916
- fieldValidationErrors,
5917
- requiredFields,
5655
+ id,
5918
5656
  country,
5919
- showCompanyStructure,
5920
- shouldValidate
5657
+ validationErrors = {},
5658
+ verificationErrors = {}
5921
5659
  }) {
5922
5660
  const { t } = useTranslation(["common", "business"]);
5923
- const { isExperimentEnabled } = useExperimentsContext();
5661
+ const { form } = useFormContext();
5924
5662
  const { accountHolder } = useAccountHolder();
5925
5663
  const { isSettingEnabled } = useSettingsContext();
5926
5664
  const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
5927
- const verifiedBusiness$1 = verifiedBusiness.value;
5928
- const { updateStateSlice } = useGlobalDataSlice(COMPANY_STRUCTURE_FORM_ID);
5929
- const schema = requiredFields ? [...requiredFields] : companyStructureFields;
5930
- const {
5931
- schema: formSchema,
5932
- data: formData,
5933
- valid: formValid,
5934
- errors: formErrors,
5935
- fieldProblems: formFieldProblems,
5936
- handleChangeFor,
5937
- setData,
5938
- setValid
5939
- } = useForm({
5940
- schema,
5941
- defaultData: data,
5942
- rules: CompanyStructureValidation,
5943
- fieldProblems: fieldValidationErrors,
5944
- shouldValidate
5945
- });
5946
- const formUtils = createFormUtils({ labels, requiredFields }, t);
5947
- useEffect(() => {
5948
- if (!showCompanyStructure && !verifiedBusiness$1 && !data?.entityType) {
5949
- setValid("entityType", false);
5950
- return setData("entityType", data?.entityType);
5951
- }
5952
- if (!verifiedBusiness$1 && data?.entityType) {
5953
- return handleChangeFor("entityType")(data?.entityType);
5954
- }
5955
- const type = mapOrganizationTypeToCompanyType(verifiedBusiness$1?.organizationType);
5956
- if (verifiedBusiness$1 && type && data?.entityType !== type) {
5957
- return handleChangeFor("entityType")(type);
5958
- }
5959
- }, [
5960
- data?.entityType,
5961
- isExperimentEnabled,
5962
- setData,
5963
- setValid,
5964
- showCompanyStructure,
5965
- verifiedBusiness$1
5966
- ]);
5967
- useEffect(() => {
5968
- updateStateSlice({
5969
- schema: formSchema,
5970
- data: formData,
5971
- errors: formErrors,
5972
- valid: formValid,
5973
- fieldProblems: formFieldProblems
5974
- });
5975
- }, [formSchema, formData, formErrors, formValid, formFieldProblems, updateStateSlice]);
5665
+ const formUtils = createFormUtils(
5666
+ { requiredFields: form.requiredFields?.companyStructure ?? [] },
5667
+ t
5668
+ );
5976
5669
  const excludedTypes = [
5977
5670
  CompanyTypesValues.INCORPORATED_PARTNERSHIP,
5978
5671
  CompanyTypesValues.INCORPORATED_ASSOCIATION
@@ -5980,9 +5673,9 @@ function CompanyStructure({
5980
5673
  if (isBankAccountRequestedForOrganization.value) {
5981
5674
  excludedTypes.push(CompanyTypesValues.GOVERNMENTAL_ORGANIZATION);
5982
5675
  }
5983
- const companyTypeRadioOptions = canChangeEntityType && accountHolder !== "aTrust" ? companyTypeOptions.filter((companyType) => !excludedTypes.includes(companyType)) : companyTypeOptions;
5676
+ const companyTypeRadioOptions = canChangeEntityType && accountHolder !== "aTrust" && accountHolder !== "anUnincorporatedPartnership" ? companyTypeOptions.filter((companyType) => !excludedTypes.includes(companyType)) : companyTypeOptions;
5984
5677
  const companyTypeExamples2 = useCompanyTypeExamples(country);
5985
- return /* @__PURE__ */ jsxs("form", { children: [
5678
+ return /* @__PURE__ */ jsxs("form", { id, className: "adyen-kyc-company-structure", children: [
5986
5679
  /* @__PURE__ */ jsx(
5987
5680
  Header,
5988
5681
  {
@@ -5993,10 +5686,10 @@ function CompanyStructure({
5993
5686
  /* @__PURE__ */ jsx(
5994
5687
  ErrorPanel,
5995
5688
  {
5996
- verificationErrors: formVerificationErrors,
5997
- validationErrors: fieldValidationErrors,
5998
- formUtils,
5999
- id: "ariaErrorField"
5689
+ id: "ariaErrorField",
5690
+ verificationErrors,
5691
+ validationErrors,
5692
+ formUtils
6000
5693
  }
6001
5694
  ),
6002
5695
  /* @__PURE__ */ jsx(
@@ -6004,9 +5697,12 @@ function CompanyStructure({
6004
5697
  {
6005
5698
  el: "fieldset",
6006
5699
  name: "entityType",
6007
- errorMessage: formUtils.getErrorMessage("entityType", formErrors, formFieldProblems),
6008
- isValid: formValid.entityType,
6009
- classNameModifiers: ["entityType"],
5700
+ errorMessage: formUtils.getErrorMessage(
5701
+ "entityType",
5702
+ form.errors?.companyStructure,
5703
+ validationErrors
5704
+ ),
5705
+ isValid: form.valid?.companyStructure?.entityType,
6010
5706
  children: (childProps) => /* @__PURE__ */ jsx(
6011
5707
  EntityTypeRadioGroupCard,
6012
5708
  {
@@ -6016,11 +5712,11 @@ function CompanyStructure({
6016
5712
  optionId: (option) => companyTypeMetadata[option].id,
6017
5713
  optionName: (option) => t(($) => $[companyTypeMetadata[option].name], { ns: "business" }),
6018
5714
  optionDescription: (option) => t(($) => $[companyTypeMetadata[option].description], { ns: "business" }),
6019
- selected: formData.entityType,
6020
- onSelect: handleChangeFor("entityType"),
5715
+ selected: form.data?.companyStructure?.entityType,
5716
+ onSelect: form.handleChangeFor("entityType", "companyStructure"),
6021
5717
  examples: companyTypeExamples2,
6022
5718
  "aria-required": true,
6023
- "aria-invalid": !formValid.entityType
5719
+ "aria-invalid": !form.valid?.companyStructure?.entityType
6024
5720
  }
6025
5721
  )
6026
5722
  }
@@ -7100,86 +6796,86 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
7100
6796
  return hasOwnEntityAssocation || !!hasOrganizationType;
7101
6797
  };
7102
6798
  const Introduction = lazy(
7103
- async () => (await import("./Introduction-Wu-LBXX2.js")).Introduction
6799
+ async () => (await import("./Introduction-C2X6DyHw.js")).Introduction
7104
6800
  );
7105
6801
  const BusinessTypeSelectionPage = lazy(
7106
- async () => (await import("./BusinessTypeSelectionPage-CP0UXFG_.js")).BusinessTypeSelectionPage
6802
+ async () => (await import("./BusinessTypeSelectionPage-DFJqkG5_.js")).BusinessTypeSelectionPage
7107
6803
  );
7108
6804
  const SingpassSelection = lazy(
7109
- async () => (await import("./SingpassSelection-DR7s4WiD.js")).SingpassSelection
6805
+ async () => (await import("./SingpassSelection-BWdMU1Lv.js")).SingpassSelection
7110
6806
  );
7111
6807
  const AccountSetupRejected = lazy(
7112
- async () => (await import("./AccountSetupRejected-_IN29uU8.js")).AccountSetupRejected
6808
+ async () => (await import("./AccountSetupRejected-eL8cEb4U.js")).AccountSetupRejected
7113
6809
  );
7114
6810
  const DecisionMakers = lazy(
7115
- async () => (await import("./DecisionMakers-BShMorMY.js")).DecisionMakers
6811
+ async () => (await import("./DecisionMakers-CXX7UaII.js")).DecisionMakers
7116
6812
  );
7117
6813
  const CustomerSupport = lazy(
7118
- async () => (await import("./CustomerSupport-C_fh3_q2.js")).CustomerSupport
6814
+ async () => (await import("./CustomerSupport-gUFWyk3X.js")).CustomerSupport
7119
6815
  );
7120
- const Review = lazy(async () => (await import("./Review-CN0zdu0c.js")).Review);
6816
+ const Review = lazy(async () => (await import("./Review-CUNKnKSZ.js")).Review);
7121
6817
  const SignPCIComponent = lazy(
7122
- async () => (await import("./SignPCIComponent-Dm45H-8u.js")).SignPCIComponent
6818
+ async () => (await import("./SignPCIComponent-MnotetIL.js")).SignPCIComponent
7123
6819
  );
7124
6820
  const AcceptTermsOfService = lazy(
7125
- async () => (await import("./AcceptTermsOfServiceComponent-De5XWtcz.js")).AcceptTermsOfServiceComponent
6821
+ async () => (await import("./AcceptTermsOfServiceComponent-jlzA4hRO.js")).AcceptTermsOfServiceComponent
7126
6822
  );
7127
6823
  const TaxReportingDropin = lazy(
7128
- async () => (await import("./TaxReportingDropin-CKin6_Er.js")).TaxReportingDropin
6824
+ async () => (await import("./TaxReportingDropin-D2gjRJag.js")).TaxReportingDropin
7129
6825
  );
7130
6826
  const PayoutDetailsPage = lazy(
7131
- async () => (await import("./PayoutDetailsDropin-DrESJrLF.js").then((n) => n.a)).PayoutDetailsPage
6827
+ async () => (await import("./PayoutDetailsDropin-M9FYw20B.js").then((n) => n.a)).PayoutDetailsPage
7132
6828
  );
7133
6829
  const RootBusinessDetailsPage = lazy(
7134
- async () => (await import("./RootBusinessDetailsPage-DsCMT0gE.js")).RootBusinessDetailsPage
6830
+ async () => (await import("./RootBusinessDetailsPage-DC0qALED.js")).RootBusinessDetailsPage
7135
6831
  );
7136
6832
  const RootBusinessLinesPage = lazy(
7137
- async () => (await import("./RootBusinessLinesPage-D0djzhVg.js")).RootBusinessLinesPage
6833
+ async () => (await import("./RootBusinessLinesPage-B8gUQ93t.js")).RootBusinessLinesPage
7138
6834
  );
7139
6835
  const SoleProprietorshipPage = lazy(
7140
- async () => (await import("./SoleProprietorshipPage-C2_d7XKS.js")).SoleProprietorshipPage
6836
+ async () => (await import("./SoleProprietorshipPage-C9mxOyGm.js")).SoleProprietorshipPage
7141
6837
  );
7142
6838
  const TrustMemberCompanyPage = lazy(
7143
- async () => (await import("./TrustMemberCompanyPage-Bgh-8J6_.js")).TrustMemberCompanyPage
6839
+ async () => (await import("./TrustMemberCompanyPage-DlnCvpf5.js")).TrustMemberCompanyPage
7144
6840
  );
7145
6841
  const TrustMemberIndividualPage = lazy(
7146
- async () => (await import("./TrustMemberIndividualPage-2gZsrdqt.js")).TrustMemberIndividualPage
6842
+ async () => (await import("./TrustMemberIndividualPage-D8LSPYGf.js")).TrustMemberIndividualPage
7147
6843
  );
7148
6844
  const TrustMemberRoleAndTypePage = lazy(
7149
- async () => (await import("./TrustMemberRoleAndTypePage-BB41jjVq.js")).TrustMemberRoleAndTypePage
6845
+ async () => (await import("./TrustMemberRoleAndTypePage-CN7oQduU.js")).TrustMemberRoleAndTypePage
7150
6846
  );
7151
6847
  const TrustMembersOverview = lazy(
7152
- async () => (await import("./TrustMembersOverview-DkpHLa-c.js")).TrustMembersOverview
6848
+ async () => (await import("./TrustMembersOverview-C2VH8NIl.js")).TrustMembersOverview
7153
6849
  );
7154
6850
  const UnincorporatedPartnershipMemberCompanyPage = lazy(
7155
- async () => (await import("./UnincorporatedPartnershipMemberCompanyPage-CVa6qF3n.js")).UnincorporatedPartnershipMemberCompanyPage
6851
+ async () => (await import("./UnincorporatedPartnershipMemberCompanyPage-BUEeNfv-.js")).UnincorporatedPartnershipMemberCompanyPage
7156
6852
  );
7157
6853
  const UnincorporatedPartnershipIndividualPage = lazy(
7158
- async () => (await import("./UnincorporatedPartnershipIndividualPage-uZBKkJwX.js")).UnincorporatedPartnershipIndividualPage
6854
+ async () => (await import("./UnincorporatedPartnershipIndividualPage-fN2QrGh4.js")).UnincorporatedPartnershipIndividualPage
7159
6855
  );
7160
6856
  const UnincorporatedPartnershipMemberRoleAndTypePage = lazy(
7161
- async () => (await import("./UnincorporatedPartnershipMemberRoleAndTypePage-Ctl2MPKX.js")).UnincorporatedPartnershipMemberRoleAndTypePage
6857
+ async () => (await import("./UnincorporatedPartnershipMemberRoleAndTypePage-DeUAOKnx.js")).UnincorporatedPartnershipMemberRoleAndTypePage
7162
6858
  );
7163
6859
  const UnincorporatedPartnershipMembersOverview = lazy(
7164
- async () => (await import("./UnincorporatedPartnershipMembersOverview-DZPLX8gp.js")).UnincorporatedPartnershipMembersOverview
6860
+ async () => (await import("./UnincorporatedPartnershipMembersOverview-EeE4JNAc.js")).UnincorporatedPartnershipMembersOverview
7165
6861
  );
7166
6862
  const BusinessFinancingPage = lazy(
7167
- async () => (await import("./BusinessFinancingPage-C06ar5yw.js")).BusinessFinancingPage
6863
+ async () => (await import("./BusinessFinancingPage-CWkMdnqc.js")).BusinessFinancingPage
7168
6864
  );
7169
6865
  const TrustDetailsPage = lazy(
7170
- async () => (await import("./TrustDetailsPage-C699_2RX.js")).TrustDetailsPage
6866
+ async () => (await import("./TrustDetailsPage-Dj64OqRJ.js")).TrustDetailsPage
7171
6867
  );
7172
6868
  const SourceOfFundsPage = lazy(
7173
- async () => (await import("./SourceOfFundsPage-SHeYHpGr.js")).SourceOfFundsPage
6869
+ async () => (await import("./SourceOfFundsPage-bptpOZNp.js")).SourceOfFundsPage
7174
6870
  );
7175
6871
  const RootIndividualDetailsPage = lazy(
7176
- async () => (await import("./RootIndividualDetailsPage-C49Q1XPl.js")).RootIndividualDetailsPage
6872
+ async () => (await import("./RootIndividualDetailsPage-ULrh2_YN.js")).RootIndividualDetailsPage
7177
6873
  );
7178
6874
  const LegalRepresentativeDetailsPage = lazy(
7179
- async () => (await import("./LegalRepresentativeDetailsPage-Cxy69AD6.js")).LegalRepresentativeDetailsPage
6875
+ async () => (await import("./LegalRepresentativeDetailsPage-Wf7cQkQn.js")).LegalRepresentativeDetailsPage
7180
6876
  );
7181
6877
  const DecisionMakerDetailsPage = lazy(
7182
- async () => (await import("./DecisionMakerDetailsPage-BcaNuUzU.js")).DecisionMakerDetailsPage
6878
+ async () => (await import("./DecisionMakerDetailsPage-Y59IaBti.js")).DecisionMakerDetailsPage
7183
6879
  );
7184
6880
  function isIn(values, x) {
7185
6881
  return values.includes(x);
@@ -7721,7 +7417,13 @@ function DropinComposer({
7721
7417
  AcceptTermsOfService,
7722
7418
  {
7723
7419
  legalEntityId: rootLegalEntity.id,
7724
- onClose: navigateBack,
7420
+ onClose: () => {
7421
+ userEvents.addPageEvent("Clicked button", {
7422
+ actionType: "back",
7423
+ label: "back"
7424
+ });
7425
+ navigateBack();
7426
+ },
7725
7427
  asEmbedded: false,
7726
7428
  handleAddSigner: () => {
7727
7429
  onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER);
@@ -7774,7 +7476,7 @@ function OnboardingDropinComponent({
7774
7476
  }
7775
7477
  const { i18n } = useTranslation();
7776
7478
  addResourceBundles(i18n, [
7777
- { ns: "common", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../../language/locales/bg-BG.json": () => import("./bg-BG-4gJjMBoz.js"), "../../../language/locales/cs-CZ.json": () => import("./cs-CZ-CxB0DJQ6.js"), "../../../language/locales/da-DK.json": () => import("./da-DK-DqkN5oIu.js"), "../../../language/locales/de-DE.json": () => import("./de-DE-COuUdtao.js"), "../../../language/locales/el-GR.json": () => import("./el-GR-CjhbnLfE.js"), "../../../language/locales/en-US.instructions.json": () => import("./en-US.instructions-Ddr7AO05.js"), "../../../language/locales/en-US.json": () => import("./StoreProvider-BHckWEYg.js").then((n) => n.bN), "../../../language/locales/es-ES.json": () => import("./es-ES-DNGEW6V_.js"), "../../../language/locales/et-EE.json": () => import("./et-EE-Be9wlXLD.js"), "../../../language/locales/fi-FI.json": () => import("./fi-FI-CoI_94Fv.js"), "../../../language/locales/fr-FR.json": () => import("./fr-FR-Br7OeDIe.js"), "../../../language/locales/hr-HR.json": () => import("./hr-HR-iodfRS4f.js"), "../../../language/locales/hu-HU.json": () => import("./hu-HU-CEb_Wl4I.js"), "../../../language/locales/it-IT.json": () => import("./it-IT-BAvsF2TB.js"), "../../../language/locales/ja-JP.json": () => import("./ja-JP-US4BD67C.js"), "../../../language/locales/lt-LT.json": () => import("./lt-LT-os-nxAb0.js"), "../../../language/locales/lv-LV.json": () => import("./lv-LV-9NRF8DKM.js"), "../../../language/locales/nl-NL.json": () => import("./nl-NL-BwKrj-29.js"), "../../../language/locales/no-NO.json": () => import("./no-NO-B6OPS2CA.js"), "../../../language/locales/pl-PL.json": () => import("./pl-PL-B0BQdtqx.js"), "../../../language/locales/pt-BR.json": () => import("./pt-BR-BKQRvAfq.js"), "../../../language/locales/pt-PT.json": () => import("./pt-PT-D2Xe-OdG.js"), "../../../language/locales/ro-RO.json": () => import("./ro-RO-WGnCVll9.js"), "../../../language/locales/sk-SK.json": () => import("./sk-SK-Cq_DSPZu.js"), "../../../language/locales/sl-SI.json": () => import("./sl-SI-C3gfuen3.js"), "../../../language/locales/sv-SE.json": () => import("./sv-SE-zTiw1bUU.js") }), `../../../language/locales/${lang}.json`, 6) },
7479
+ { ns: "common", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../../language/locales/bg-BG.json": () => import("./bg-BG-4gJjMBoz.js"), "../../../language/locales/cs-CZ.json": () => import("./cs-CZ-CxB0DJQ6.js"), "../../../language/locales/da-DK.json": () => import("./da-DK-DqkN5oIu.js"), "../../../language/locales/de-DE.json": () => import("./de-DE-COuUdtao.js"), "../../../language/locales/el-GR.json": () => import("./el-GR-CjhbnLfE.js"), "../../../language/locales/en-US.instructions.json": () => import("./en-US.instructions-Ddr7AO05.js"), "../../../language/locales/en-US.json": () => import("./StoreProvider-D_0Pta7w.js").then((n) => n.bN), "../../../language/locales/es-ES.json": () => import("./es-ES-DNGEW6V_.js"), "../../../language/locales/et-EE.json": () => import("./et-EE-Be9wlXLD.js"), "../../../language/locales/fi-FI.json": () => import("./fi-FI-CoI_94Fv.js"), "../../../language/locales/fr-FR.json": () => import("./fr-FR-Br7OeDIe.js"), "../../../language/locales/hr-HR.json": () => import("./hr-HR-iodfRS4f.js"), "../../../language/locales/hu-HU.json": () => import("./hu-HU-CEb_Wl4I.js"), "../../../language/locales/it-IT.json": () => import("./it-IT-BAvsF2TB.js"), "../../../language/locales/ja-JP.json": () => import("./ja-JP-US4BD67C.js"), "../../../language/locales/lt-LT.json": () => import("./lt-LT-os-nxAb0.js"), "../../../language/locales/lv-LV.json": () => import("./lv-LV-9NRF8DKM.js"), "../../../language/locales/nl-NL.json": () => import("./nl-NL-BwKrj-29.js"), "../../../language/locales/no-NO.json": () => import("./no-NO-B6OPS2CA.js"), "../../../language/locales/pl-PL.json": () => import("./pl-PL-B0BQdtqx.js"), "../../../language/locales/pt-BR.json": () => import("./pt-BR-BKQRvAfq.js"), "../../../language/locales/pt-PT.json": () => import("./pt-PT-D2Xe-OdG.js"), "../../../language/locales/ro-RO.json": () => import("./ro-RO-WGnCVll9.js"), "../../../language/locales/sk-SK.json": () => import("./sk-SK-Cq_DSPZu.js"), "../../../language/locales/sl-SI.json": () => import("./sl-SI-C3gfuen3.js"), "../../../language/locales/sv-SE.json": () => import("./sv-SE-zTiw1bUU.js") }), `../../../language/locales/${lang}.json`, 6) },
7778
7480
  { ns: "ui", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../ui/language/bg-BG.json": () => import("./bg-BG-D9J6LnkI.js"), "../../ui/language/cs-CZ.json": () => import("./cs-CZ-DY_pQqAT.js"), "../../ui/language/da-DK.json": () => import("./da-DK-jK7c9UL0.js"), "../../ui/language/de-DE.json": () => import("./de-DE-wmerDL2e.js"), "../../ui/language/el-GR.json": () => import("./el-GR-Btrk_npt.js"), "../../ui/language/en-US.json": () => import("./en-US-gsp7CD_E.js"), "../../ui/language/es-ES.json": () => import("./es-ES-Qnc0Q6JH.js"), "../../ui/language/et-EE.json": () => import("./et-EE-TzXANcP2.js"), "../../ui/language/fi-FI.json": () => import("./fi-FI-Dn2MC8uW.js"), "../../ui/language/fr-FR.json": () => import("./fr-FR-BWX14yb7.js"), "../../ui/language/hr-HR.json": () => import("./hr-HR-CZLSQruE.js"), "../../ui/language/hu-HU.json": () => import("./hu-HU-kp8Go5hZ.js"), "../../ui/language/it-IT.json": () => import("./it-IT-B0YGvVgW.js"), "../../ui/language/ja-JP.json": () => import("./ja-JP-Dz9IVH4p.js"), "../../ui/language/lt-LT.json": () => import("./lt-LT-l9rzkFg9.js"), "../../ui/language/lv-LV.json": () => import("./lv-LV-DYbb5pkt.js"), "../../ui/language/nl-NL.json": () => import("./nl-NL-BMUYBqlF.js"), "../../ui/language/no-NO.json": () => import("./no-NO-DKbWxgF-.js"), "../../ui/language/pl-PL.json": () => import("./pl-PL-B0zGy_b4.js"), "../../ui/language/pt-BR.json": () => import("./pt-BR--kaJvtE6.js"), "../../ui/language/pt-PT.json": () => import("./pt-PT-BZ5ZZm6G.js"), "../../ui/language/ro-RO.json": () => import("./ro-RO-CdSsgoUG.js"), "../../ui/language/sk-SK.json": () => import("./sk-SK-BiBWPJUf.js"), "../../ui/language/sl-SI.json": () => import("./sl-SI-DtdGMD6i.js"), "../../ui/language/sv-SE.json": () => import("./sv-SE-kR514dO1.js") }), `../../ui/language/${lang}.json`, 5) }
7779
7481
  ]);
7780
7482
  const { data: legalEntityData } = useLegalEntity(ROOT_LE);
@@ -7787,111 +7489,84 @@ function OnboardingDropinComponent({
7787
7489
  );
7788
7490
  }
7789
7491
  export {
7790
- VAT_NUMBER_FIELD as $,
7492
+ salesChannelsWithWebData as $,
7791
7493
  AdditionalInformation as A,
7792
- BasicInformation as B,
7494
+ BusinessSelection as B,
7793
7495
  CompanyStructure as C,
7794
- useDebouncedState as D,
7496
+ eInvoicingCodeFieldMetadata as D,
7795
7497
  EntityTypeRadioGroupCard as E,
7796
7498
  FinancialInformation as F,
7797
- legalFormFieldMetadata as G,
7798
- stockTickerSymbolFieldMetadata as H,
7799
- stockISINFieldMetadata as I,
7800
- stockExchangeMICFieldMetadata as J,
7801
- dateOfIncorporationFieldMetadata as K,
7802
- industryCodeFieldMetadata as L,
7803
- eInvoicingCodeFieldMetadata as M,
7804
- vatAbsenceReasonMetadata as N,
7499
+ vatAbsenceReasonMetadata as G,
7500
+ exemptFromRegistrationNumberDefaultFieldMetadata as H,
7501
+ doingBusinessAsFieldMetadata as I,
7502
+ doingBusinessAsAbsentFieldMetadata as J,
7503
+ defaultFieldMetadata$2 as K,
7504
+ defaultFieldConfig$2 as L,
7505
+ defaultFieldMetadata as M,
7506
+ defaultFieldConfig as N,
7805
7507
  OnboardingDropinComponent as O,
7806
- defaultFieldMetadata$2 as P,
7807
- defaultFieldConfig$2 as Q,
7808
- doingBusinessAsFieldMetadata as R,
7809
- doingBusinessAsAbsentFieldMetadata as S,
7810
- useIndustryCodes as T,
7811
- INDUSTRY_CODE_FIELD as U,
7812
- VerifiedBusinessCard as V,
7813
- LEGAL_FORM_FIELDS as W,
7814
- DBA_NAME_FIELD as X,
7815
- DBANameField as Y,
7816
- BUSINESS_REGISTRATION_NUMBER_FIELD as Z,
7817
- BusinessRegistrationNumberField as _,
7508
+ defaultFieldMetadataV4 as P,
7509
+ defaultFieldMetadata$1 as Q,
7510
+ defaultFieldConfigV4 as R,
7511
+ defaultFieldConfig$1 as S,
7512
+ useBusinessLines as T,
7513
+ financialInfoValidationWithEmployeesRules as U,
7514
+ tinMatched as V,
7515
+ businessMismatchModalOpen as W,
7516
+ useCompanySearch as X,
7517
+ useVerifyTin as Y,
7518
+ handleCompanySelection as Z,
7519
+ applyVerifiedBusinessData as _,
7818
7520
  usePciStatus as a,
7819
- VatNumberField as a0,
7820
- EInvoicingCodeField as a1,
7821
- EINVOICING_CODE_FIELD as a2,
7822
- IndustryCodeField as a3,
7823
- DATE_OF_INCORPORATION_FIELD as a4,
7824
- DateOfIncorporationField as a5,
7825
- STOCK_EXCHANGE_MIC_FIELD as a6,
7826
- StockExchangeMICField as a7,
7827
- STOCK_ISIN_FIELD as a8,
7828
- StockISINField as a9,
7829
- applyVerifiedBusinessData as aA,
7830
- salesChannelsWithWebData as aB,
7831
- SALES_CHANNELS_FIELD as aC,
7832
- WEB_DATA_FIELD as aD,
7833
- shouldSignNewPci as aE,
7834
- SCTA_FIELD as aF,
7835
- Divider as aG,
7836
- selectedBusinessLine as aH,
7837
- usePciQuestionnaireList as aI,
7838
- businessLinesConfigurations as aJ,
7839
- businessLinesForms as aK,
7840
- useTrustMembers as aL,
7841
- isNewEntity as aM,
7842
- LegalCompanyNameField as aN,
7843
- exemptFromRegistrationNumberDefaultFieldConfig as aO,
7844
- registrationAddressFields as aP,
7845
- RegistrationAddress as aQ,
7846
- STOCK_TICKER_SYMBOL_FIELD as aa,
7847
- StockTickerSymbolField as ab,
7848
- ADDITIONAL_INFORMATION_FORM_ID as ac,
7849
- localizedLegalCompanyNameFieldConfig as ad,
7850
- defaultFieldMetadata as ae,
7851
- defaultFieldConfig as af,
7852
- defaultFieldMetadataV4 as ag,
7853
- defaultFieldMetadata$1 as ah,
7854
- defaultFieldConfigV4 as ai,
7855
- defaultFieldConfig$1 as aj,
7856
- useLegalCompanyNameField as ak,
7857
- COUNTRY_OF_GOVERNING_LAW_FIELD as al,
7858
- CountryOfGoverningLawField as am,
7859
- LEGAL_COMPANY_NAME_FIELD as an,
7860
- isBankAccountRequestedForOrganization as ao,
7861
- companyTypeOptions as ap,
7862
- useCompanyTypeExamples as aq,
7863
- BusinessSelectionMultiform as ar,
7864
- isVerifiedSingleCompanySearchResult as as,
7865
- exemptFromRegistrationNumberDefaultFieldMetadata as at,
7866
- CountryOfGoverningLawFieldValidation as au,
7867
- CountryFieldValidation as av,
7868
- financialInfoValidationWithEmployeesRules as aw,
7869
- CompanyStructureValidation as ax,
7870
- tinMatched as ay,
7871
- businessMismatchModalOpen as az,
7521
+ useIndustryCodes as a0,
7522
+ IndustryCodeField as a1,
7523
+ INDUSTRY_CODE_FIELD as a2,
7524
+ SALES_CHANNELS_FIELD as a3,
7525
+ WEB_DATA_FIELD as a4,
7526
+ shouldSignNewPci as a5,
7527
+ SCTA_FIELD as a6,
7528
+ Divider as a7,
7529
+ selectedBusinessLine as a8,
7530
+ usePciQuestionnaireList as a9,
7531
+ businessLinesConfigurations as aa,
7532
+ businessLinesForms as ab,
7533
+ useTrustMembers as ac,
7534
+ isNewEntity as ad,
7535
+ LegalCompanyNameField as ae,
7536
+ LEGAL_COMPANY_NAME_FIELD as af,
7537
+ DBA_NAME_FIELD as ag,
7538
+ BUSINESS_REGISTRATION_NUMBER_FIELD as ah,
7539
+ VAT_NUMBER_FIELD as ai,
7540
+ exemptFromRegistrationNumberDefaultFieldConfig as aj,
7541
+ DBANameField as ak,
7542
+ BusinessRegistrationNumberField as al,
7543
+ VatNumberField as am,
7544
+ registrationAddressFields as an,
7545
+ RegistrationAddress as ao,
7546
+ operationalAddressIsSameItems as ap,
7872
7547
  useCanSeeIntroduction as b,
7873
7548
  useLegalEntityType as c,
7874
7549
  allowIndividualWithoutSoleProp as d,
7875
7550
  useDataMissingRemediations as e,
7876
7551
  filterProblemsByTaskForms as f,
7877
7552
  getForms as g,
7878
- getDefaultRegistrationNumberType as h,
7879
- getDefaultVatNumberType as i,
7880
- FIELDS_NEEDED_FOR_COMPANY_SEARCH as j,
7881
- companyTypeMetadata as k,
7882
- documentFormsIds as l,
7883
- inferCompanyRegistrationNumberType as m,
7553
+ BasicInformation as h,
7554
+ getDefaultRegistrationNumberType as i,
7555
+ getDefaultVatNumberType as j,
7556
+ FIELDS_NEEDED_FOR_COMPANY_SEARCH as k,
7557
+ isVerifiedSingleCompanySearchResult as l,
7558
+ companyTypeMetadata as m,
7884
7559
  normalizedTaskStatusStore as n,
7885
- registrationNumberDefaultFieldConfig as o,
7886
- useCompanySearch as p,
7887
- useCompanySelection as q,
7560
+ operationalAddressIsSameIds as o,
7561
+ documentFormsIds as p,
7562
+ inferCompanyRegistrationNumberType as q,
7888
7563
  registrationNumberDefaultFieldMetadata as r,
7889
- setIsBankAccountRequestedForOrganization as s,
7890
- useVerifyTin as t,
7564
+ registrationNumberDefaultFieldConfig as s,
7565
+ stockTickerSymbolFieldMetadata as t,
7891
7566
  useSalesChannels as u,
7892
7567
  verifiedBusiness as v,
7893
- useClearCompanyData as w,
7894
- useBusinessLines as x,
7895
- isNormalizedStringMatch as y,
7896
- setVerifiedBusiness as z
7568
+ stockISINFieldMetadata as w,
7569
+ stockExchangeMICFieldMetadata as x,
7570
+ dateOfIncorporationFieldMetadata as y,
7571
+ industryCodeFieldMetadata as z
7897
7572
  };