@adyen/kyc-components 4.5.0 → 4.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/README.md +31 -43
  2. package/dist/{AcceptTermsOfServiceComponent-Bo8nB0Eb.js → AcceptTermsOfServiceComponent-DTURkN9O.js} +17 -20
  3. package/dist/{AccountSetupRejected-DQcFbIXL.js → AccountSetupRejected-D7yqqcm_.js} +2 -2
  4. package/dist/{ActionBar-Bj1Km-LP.js → ActionBar-CdFYb-7S.js} +2 -2
  5. package/dist/{Address-C0rbmhQL.js → Address-BkeFTMl-.js} +16 -16
  6. package/dist/{Avatar-Cl1-jo6c.js → Avatar-BpQFX0rJ.js} +2 -2
  7. package/dist/{BusinessFinancingComponent-Bk0PbC9m.js → BusinessFinancingComponent-CshEgNjO.js} +5 -5
  8. package/dist/{BusinessFinancingDropin-BAYyFYt9.js → BusinessFinancingDropin-B2kKDCNB.js} +31 -34
  9. package/dist/{BusinessFinancingPage-Cc--qt48.js → BusinessFinancingPage-96zTF7BJ.js} +4 -4
  10. package/dist/{BusinessTypeSelectionPage-C63ujxOo.js → BusinessTypeSelectionPage-BVucjw8H.js} +9 -14
  11. package/dist/{Checkbox-DnP0i74G.js → Checkbox-Dwf4zXgj.js} +2 -2
  12. package/dist/{Confirm-Bf4Pjkty.js → Confirm-DOjzHnlC.js} +3 -3
  13. package/dist/{ConstitutionalDocument-CddO3OSY.js → ConstitutionalDocument-C4HWFtJ-.js} +336 -92
  14. package/dist/{ContactDetails-BZ7dqNuH.js → ContactDetails-ByrH32Jo.js} +12 -7
  15. package/dist/{ContextGuidance-0XKaQ9Ba.js → ContextGuidance-BUczCMV3.js} +2 -2
  16. package/dist/{CountryField-BTwq-LdM.js → CountryField-C9nbUmpe.js} +3 -3
  17. package/dist/{CreateIndividualComponent-B0RfIm2Q.js → CreateIndividualComponent-AOb8RP8N.js} +6 -6
  18. package/dist/{CreateTransferInstrumentComponent-XiVVyTGX.js → CreateTransferInstrumentComponent-BBytn3E3.js} +5 -5
  19. package/dist/{Currency-COs4cPiC.js → Currency-B1ApVUnP.js} +7 -7
  20. package/dist/{CustomerSupport-WsGepkci.js → CustomerSupport-DDtZA5jI.js} +11 -16
  21. package/dist/{DebugModal-BG-xZugG.js → DebugModal-wXFq4cg1.js} +127 -98
  22. package/dist/DecisionMakerDetails-Up9HU_qy.js +275 -0
  23. package/dist/{DecisionMakerDetailsPage-BNDJ4G9u.js → DecisionMakerDetailsPage-OeI7y1aX.js} +10 -10
  24. package/dist/{DecisionMakers-BkgGDV_d.js → DecisionMakers-5bUJ4S4V.js} +22 -259
  25. package/dist/{Dropzone-1307mgIt.js → Dropzone-Bf8v-4iJ.js} +4 -4
  26. package/dist/{EmbeddedStatus-C9Scvouz.js → EmbeddedStatus-DQmqyOzv.js} +3 -3
  27. package/dist/{EndStateLayout-D8bTvH_H.js → EndStateLayout-DZgYKmw6.js} +2 -2
  28. package/dist/{EntityAssociation-CFtBLGS6.js → EntityAssociation-Dc8O6xJv.js} +5 -5
  29. package/dist/{EntityGuidanceStatus-5wNdPvGh.js → EntityGuidanceStatus-DhCqUWGF.js} +4 -4
  30. package/dist/{ErrorPanel-DNuuMh-W.js → ErrorPanel-4HIDH4sr.js} +11 -12
  31. package/dist/{Field-DhgxtDHi.js → Field-CWq5XOh3.js} +2 -2
  32. package/dist/{FormNavigation-CNUCAuSA.js → FormNavigation-CDlQZRNb.js} +3 -3
  33. package/dist/{Individual.rules-BMayKVCw.js → Individual.rules-BhSXCdTl.js} +12 -12
  34. package/dist/{IndividualDropin-CNYG1UJb.js → IndividualDropin-DS8kUrXB.js} +252 -97
  35. package/dist/{InputDate-UU6golKr.js → InputDate-C2NEOpK4.js} +1 -1
  36. package/dist/{InputText-B_Dy6ooB.js → InputText-20pWI3ja.js} +2 -2
  37. package/dist/{Introduction-Dal7p5Mk.js → Introduction-D6x5z2oe.js} +4 -9
  38. package/dist/InvitedDecisionMakerComponent-Bg-DMehe.js +211 -0
  39. package/dist/{JpAddress-DEzR_98l.js → JpAddress-CX4IfNRB.js} +11 -11
  40. package/dist/{LandingLayout-CHRI270t.js → LandingLayout-y-X0NrR1.js} +2 -2
  41. package/dist/{LegalCompanyNameField-BtcoTH2A.js → LegalCompanyNameField-lEerISaT.js} +16 -16
  42. package/dist/{LegalRepresentativeDetailsPage-DkeUe4ta.js → LegalRepresentativeDetailsPage-C6dOsu1g.js} +5 -5
  43. package/dist/{Link-Bl_GjNYw.js → Link-DeFoaStC.js} +2 -2
  44. package/dist/{ListItem-DvSwwjUU.js → ListItem-BFxtRiVb.js} +3 -3
  45. package/dist/{LoaderWrapper-Coambg3s.js → LoaderWrapper-Bh1b67kY.js} +2 -2
  46. package/dist/{ManageIndividualComponent-Cg7imjd5.js → ManageIndividualComponent-DHYNg_KN.js} +5 -5
  47. package/dist/{ManageTermsOfServiceComponent-DIblbnOJ.js → ManageTermsOfServiceComponent-BNzELB7A.js} +4 -4
  48. package/dist/{ManageTransferInstrumentComponent-COucevgP.js → ManageTransferInstrumentComponent-9r84TFsu.js} +11 -11
  49. package/dist/{MaskedInput-CFPRK30D.js → MaskedInput-DPSvsK95.js} +5 -5
  50. package/dist/{MaybeModal-BBBJD1jn.js → MaybeModal-BbrppFfg.js} +3 -3
  51. package/dist/{Modal-DJLTbW4Y.js → Modal-CAVcW_pH.js} +2 -2
  52. package/dist/{Name-Bu38kdOA.js → Name-eQhc9Vta.js} +4 -4
  53. package/dist/{NewSummary-oIcQyhuq.js → NewSummary-B_xfd8vG.js} +5 -5
  54. package/dist/{OnboardingDropinComponent-DqQmqcO8.js → OnboardingDropinComponent-BRZuLCE8.js} +145 -218
  55. package/dist/{PayoutDetailsDropin-D7AR5BSQ.js → PayoutDetailsDropin-B6ZMIVid.js} +183 -1065
  56. package/dist/{PayoutDetailsPage-BCBGGB28.js → PayoutDetailsPage-BSzf6sev.js} +6 -6
  57. package/dist/{RadioGroup-DCmqcl_S.js → RadioGroup-BZ-EfNXM.js} +2 -2
  58. package/dist/{Review-DQA1vIzH.js → Review-BVeMAC7t.js} +6 -6
  59. package/dist/{RootBusinessDetailsPage--bsR-yKt.js → RootBusinessDetailsPage-OlgTozou.js} +6 -6
  60. package/dist/{RootBusinessLinesPage-DIYKqsLt.js → RootBusinessLinesPage-CUwKkzZU.js} +93 -91
  61. package/dist/{RootIndividualDetailsPage-CXKr1vhL.js → RootIndividualDetailsPage-CqP8gdvk.js} +7 -6
  62. package/dist/{Select-CyK-d8L8.js → Select-DSLn5CCG.js} +4 -4
  63. package/dist/{SignPCIComponent-BvAt735T.js → SignPCIComponent-CT6GL442.js} +12 -19
  64. package/dist/{SingpassSelection-Cidszm4a.js → SingpassSelection-BORgM-de.js} +144 -7
  65. package/dist/{SoleProprietorshipPage-CgAHjrJh.js → SoleProprietorshipPage-BylQa2F1.js} +5 -5
  66. package/dist/{SourceOfFundsPage-Rh40Ip6D.js → SourceOfFundsPage-Br-FaeUd.js} +270 -98
  67. package/dist/{StepProgressIndicator-C38x_hKs.js → StepProgressIndicator-ZZsrHrtb.js} +2 -2
  68. package/dist/{StoreProvider-o79GZkUo.js → StoreProvider-lJLpl6iE.js} +155 -148
  69. package/dist/{Summary-DbPdEnQi.js → Summary-DdFh8LL0.js} +25 -22
  70. package/dist/{TaxInformationField-C6DdzDTL.js → TaxInformationField-5nazrzc4.js} +568 -795
  71. package/dist/{TaxReportingDropin-Dc75TUYl.js → TaxReportingDropin-DAeAPOI5.js} +26 -26
  72. package/dist/{TextArea-XLgx9WmG.js → TextArea-D0eJRv8v.js} +2 -2
  73. package/dist/{TileGroup-DsYUn_bt.js → TileGroup-C8YY0Xwv.js} +3 -3
  74. package/dist/{TrustDetailsPage-B_QUEYM5.js → TrustDetailsPage-BHo4SFbD.js} +64 -65
  75. package/dist/{TrustMemberCompanyPage-aBW14Thb.js → TrustMemberCompanyPage-CZMF952c.js} +7 -7
  76. package/dist/{TrustMemberIndividualPage-DNgZI75l.js → TrustMemberIndividualPage-RSIXbPaf.js} +6 -6
  77. package/dist/{TrustMemberRoleAndTypePage-CbOyf3oB.js → TrustMemberRoleAndTypePage-BehlWyo7.js} +27 -27
  78. package/dist/{TrustMembersOverview-7waB6Dud.js → TrustMembersOverview-KI0J7peC.js} +16 -18
  79. package/dist/{UnincorporatedPartnershipIndividualPage-DFvESJUR.js → UnincorporatedPartnershipIndividualPage-CNf-sPP4.js} +5 -5
  80. package/dist/{UnincorporatedPartnershipMemberCompanyPage-j2xmgM94.js → UnincorporatedPartnershipMemberCompanyPage-OyKeY30-.js} +6 -6
  81. package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-BlJsglW1.js → UnincorporatedPartnershipMemberRoleAndTypePage-Bt21JX-F.js} +11 -11
  82. package/dist/{UnincorporatedPartnershipMembersOverview-1-yK01Ox.js → UnincorporatedPartnershipMembersOverview-DdTGn8QH.js} +7 -7
  83. package/dist/{VerificationErrorAlert-BsJqccUV.js → VerificationErrorAlert-ChGZqC_p.js} +3 -3
  84. package/dist/{ViewVerificationStatusComponent-Bx3tJek7.js → ViewVerificationStatusComponent-9RUetbsi.js} +3 -3
  85. package/dist/adyen-business-financing.js +4 -4
  86. package/dist/adyen-individual-configuration.js +4 -4
  87. package/dist/adyen-individual-status.js +4 -4
  88. package/dist/adyen-invited-decision-maker.js +4 -117
  89. package/dist/adyen-kyc-components.js +17 -17
  90. package/dist/adyen-onboarding.js +4 -4
  91. package/dist/adyen-terms-of-service-management.js +4 -4
  92. package/dist/adyen-terms-of-service-status.js +4 -4
  93. package/dist/adyen-transfer-instrument-configuration.js +4 -4
  94. package/dist/adyen-transfer-instrument-management.js +4 -4
  95. package/dist/adyen-verification-status.js +4 -4
  96. package/dist/{bafinUtils-sfpUKqEq.js → bafinUtils-m56sOqio.js} +2 -2
  97. package/dist/{commonValidators-h59h4U6_.js → commonValidators-cEWuPs2I.js} +1 -1
  98. package/dist/{dropinUtils-C78qUFNH.js → dropinUtils-B-qE8vvG.js} +53 -9
  99. package/dist/en-US-CJDkXFZ6.js +13 -0
  100. package/dist/en-US-CTbVLoNF.js +13 -0
  101. package/dist/en-US-CfazE4ht.js +13 -0
  102. package/dist/{en-US-G607HIyo.js → en-US-DPoDE0uz.js} +7 -7
  103. package/dist/en-US-DrUYyPhF.js +13 -0
  104. package/dist/{formUtils-D9HJXrvu.js → formUtils-DjInEErz.js} +3 -3
  105. package/dist/{getName-C1Pp12yX.js → getName-CzAV6RHp.js} +2 -2
  106. package/dist/{getProblemsForEntity-CyQdh7Lw.js → getProblemsForEntity-CVzYoCCC.js} +2 -2
  107. package/dist/getTrustedFields-BeaCYGD7.js +104 -0
  108. package/dist/{isEmpty-Dxhg5YWQ.js → isEmpty-CRqBruDc.js} +1 -1
  109. package/dist/japanSupportUtils-BK4rTASp.js +16 -0
  110. package/dist/{localizeDateString-ltj3KR-p.js → localizeDateString-BSZiJcEb.js} +2 -2
  111. package/dist/{mapExistingFile-J5xtIyOp.js → mapExistingFile-BcvOzQNH.js} +3 -76
  112. package/dist/{mapJpAddressSchemaToAddressLocalizations-BCTFanCP.js → mapJpAddressSchemaToAddressLocalizations-BgHjkrJG.js} +2 -36
  113. package/dist/{mapLegalEntityToIndividualSchema-fUEX0pyE.js → mapLegalEntityToIndividualSchema-_HlywUjg.js} +4 -4
  114. package/dist/{mapTransferInstrumentToPayoutAccount-BxS7kMUd.js → mapTransferInstrumentToPayoutAccount-69DkBhXm.js} +2 -2
  115. package/dist/omitObscuredFieldsIfUnchanged-tsdNkCyN.js +29 -0
  116. package/dist/{patternValidators-DmtoCjEe.js → patternValidators-DuOaKe_S.js} +2 -2
  117. package/dist/{process-field-configurations-Bo_HZH3p.js → process-field-configurations-DcWH0t4d.js} +2 -2
  118. package/dist/{resolveEnvironment-9pYwfLRr.js → resolveEnvironment-Bs-ygpN1.js} +17 -24
  119. package/dist/{roleMetadata-ZbDuZjur.js → roleMetadata-B-2OBUCV.js} +3 -3
  120. package/dist/style.css +230 -275
  121. package/dist/styles-CLV89_hH.js +230 -275
  122. package/dist/types/api/toggles/useToggles.d.ts +2 -1
  123. package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentClassification.d.ts +2 -1
  124. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +0 -29
  125. package/dist/types/components/BankAccount/forms/BankVerification/BankVerification.d.ts +1 -1
  126. package/dist/types/components/BankAccount/forms/BankVerification/verification/{widget → overlay}/types.d.ts +4 -14
  127. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +1 -1
  128. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +4 -5
  129. package/dist/types/components/Business/forms/rules.d.ts +1 -1
  130. package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +2 -2
  131. package/dist/types/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsGettingStarted.d.ts +6 -0
  132. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +2 -2
  133. package/dist/types/components/Business/tasks/BusinessDetailsDropin/validate.d.ts +7 -5
  134. package/dist/types/components/Business/utils/companyUtil.d.ts +2 -2
  135. package/dist/types/components/Business/utils/formatDataForSummary.d.ts +3 -2
  136. package/dist/types/components/Business/utils/submit.d.ts +1 -1
  137. package/dist/types/components/Business/utils/useCompanySearchFeature.d.ts +5 -0
  138. package/dist/types/components/BusinessLines/forms/SalesChannelsForm/types.d.ts +1 -1
  139. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +1 -1
  140. package/dist/types/components/Contract/tasks/PciDropin/PciDropin.d.ts +1 -1
  141. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +9 -9
  142. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +11 -0
  143. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +15 -0
  144. package/dist/types/components/Individual/forms/AdditionalPersonalDetails/validate.d.ts +5 -4
  145. package/dist/types/components/Individual/forms/BasicDetails/validate.d.ts +3 -3
  146. package/dist/types/components/Individual/forms/IdNowVerificationModal/IFrameWidget.d.ts +9 -0
  147. package/dist/types/components/Individual/forms/Individual.rules.d.ts +1 -1
  148. package/dist/types/components/Individual/mapping/mapIndividualSchemaToLegalEntity.d.ts +2 -2
  149. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +2 -2
  150. package/dist/types/components/Individual/tasks/DecisionMakers/InvitedDecisionMaker/InvitedDecisionMakerSubmitSuccess/InvitedDecisionMakerSubmitSuccess.d.ts +6 -1
  151. package/dist/types/components/Individual/tasks/DecisionMakers/hooks/useTaskStatusWithTimeout.d.ts +15 -0
  152. package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +14 -0
  153. package/dist/types/components/Shared/FormFlow/FormFlow.d.ts +1 -1
  154. package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +1 -0
  155. package/dist/types/components/Shared/FormWrapper/FormWrapper.d.ts +2 -1
  156. package/dist/types/components/Shared/devex/DebugListener/DebugTogglesAndSettings.d.ts +8 -0
  157. package/dist/types/components/Shared/devex/DebugListener/debugInfo.d.ts +2 -1
  158. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/RegistrationNumberTypeSelector/CompanyRegistrationNumberTypeSelector.d.ts +12 -0
  159. package/dist/types/components/Shared/fields/{IdFieldTypeSelector → BusinessRegistrationNumberField/RegistrationNumberTypeSelector}/getDefaultRegistrationNumberType.d.ts +4 -4
  160. package/dist/types/components/Shared/fields/{IdFieldTypeSelector → BusinessRegistrationNumberField/RegistrationNumberTypeSelector}/inferCompanyRegistrationNumberType.d.ts +3 -3
  161. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/fieldConfig.d.ts +1 -1
  162. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/registrationNumberTypes.d.ts +92 -0
  163. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +8 -1
  164. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +0 -483
  165. package/dist/types/components/Shared/fields/LegalCompanyNameField/LegalCompanyNameField.d.ts +1 -1
  166. package/dist/types/components/Shared/fields/LegalCompanyNameField/fieldConfig.d.ts +2 -2
  167. package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +1 -1
  168. package/dist/types/components/Shared/fields/LocalizedNameFields/validate.d.ts +2 -2
  169. package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -1
  170. package/dist/types/components/Shared/fields/PhoneField/types.d.ts +2 -0
  171. package/dist/types/components/Shared/fields/{IdFieldTypeSelector → TaxInformationField/TaxIdNumberTypeSelector}/TaxIdNumberTypeSelector.d.ts +5 -5
  172. package/dist/types/components/Shared/fields/{IdFieldTypeSelector → TaxInformationField/TaxIdNumberTypeSelector}/getDefaultTaxIdNumberType.d.ts +5 -5
  173. package/dist/types/components/Shared/fields/{IdFieldTypeSelector → TaxInformationField/TaxIdNumberTypeSelector}/inferTaxIdNumberType.d.ts +5 -5
  174. package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +1 -2
  175. package/dist/types/components/Shared/fields/TaxInformationField/taxIdNumberTypes.d.ts +232 -0
  176. package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +8 -0
  177. package/dist/types/components/Shared/fields/VatNumberField/VatNumberTypeSelector/VatNumberTypeSelector.d.ts +14 -0
  178. package/dist/types/components/Shared/fields/{IdFieldTypeSelector → VatNumberField/VatNumberTypeSelector}/getDefaultVatNumberType.d.ts +2 -2
  179. package/dist/types/components/Shared/fields/VatNumberField/VatNumberTypeSelector/inferVatNumberType.d.ts +3 -0
  180. package/dist/types/components/Shared/fields/VatNumberField/fieldConfig.d.ts +1 -2
  181. package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +10 -1
  182. package/dist/types/components/Shared/fields/VatNumberField/vatNumberTypes.d.ts +149 -0
  183. package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSummary.d.ts +5 -0
  184. package/dist/types/components/Shared/forms/Address/utils.d.ts +6 -1
  185. package/dist/types/components/Shared/forms/Address/validate.d.ts +3 -3
  186. package/dist/types/components/Trust/mapping/mapLegalEntityToTrust.d.ts +2 -2
  187. package/dist/types/components/Trust/mapping/mapTrustToLegalEntity.d.ts +2 -2
  188. package/dist/types/components/Trust/tasks/TrustDropin/validate.d.ts +2 -2
  189. package/dist/types/components/UnincorporatedPartnership/mapping/mapLegalEntityToUnincorporatedPartnership.d.ts +2 -2
  190. package/dist/types/components/UnincorporatedPartnership/mapping/mapUnincorporatedPartnershipToLegalEntity.d.ts +2 -2
  191. package/dist/types/components/index.d.ts +2 -2
  192. package/dist/types/context/FormRouterContext/FormRouterContext.d.ts +5 -0
  193. package/dist/types/context/FormRouterContext/FormRouterContextProvider.d.ts +1 -1
  194. package/dist/types/context/FormRouterContext/types.d.ts +1 -0
  195. package/dist/types/context/FormRouterContext/useFormRouterContext.d.ts +4 -0
  196. package/dist/types/context/SettingsContext/types.d.ts +2 -0
  197. package/dist/types/context/ToggleContext/ToggleContext.d.ts +2 -0
  198. package/dist/types/context/ToggleContext/ToggleContextProvider.d.ts +9 -0
  199. package/dist/types/context/{ExperimentContext → ToggleContext}/types.d.ts +42 -32
  200. package/dist/types/context/ToggleContext/useToggleContext.d.ts +1 -0
  201. package/dist/types/core/EmbedShell/EmbedShell.d.ts +3 -3
  202. package/dist/types/core/UIElement/UIElement.d.ts +3 -2
  203. package/dist/types/core/models/api/organization.d.ts +1 -1
  204. package/dist/types/embeds/baseEmbedProps.d.ts +3 -3
  205. package/dist/types/hooks/useFormComposer.d.ts +1 -0
  206. package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +1 -1
  207. package/dist/types/hooks/useTaskLandedEvent.d.ts +7 -0
  208. package/dist/types/language/types.d.ts +2 -9
  209. package/dist/types/language/utils.d.ts +2 -2
  210. package/dist/types/router/routeConfig.d.ts +1 -0
  211. package/dist/types/stores/globalStore/taskTypes.d.ts +1 -0
  212. package/dist/types/types/form-rules.d.ts +2 -2
  213. package/dist/types/utils/api/processCapabilitites.d.ts +1 -1
  214. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  215. package/dist/types/utils/japanSupportUtils.d.ts +2 -2
  216. package/dist/{types-Bbb9XYx7.js → types-C4u-zy-W.js} +2 -2
  217. package/dist/{types-_ugkpUNx.js → types-CTwBMnPB.js} +46 -37
  218. package/dist/{types-Dz6L62GR.js → types-Cop44iUw.js} +2 -2
  219. package/dist/{types-CQ2p58-6.js → types-Dv0COrvY.js} +3 -2
  220. package/dist/{types-C4ieOutZ.js → types-QKgg5_IB.js} +2 -2
  221. package/dist/{unincorporated-partnership-BC2PWEgm.js → unincorporated-partnership-DCtqSVs0.js} +2 -2
  222. package/dist/{useAssociatedLegalEntity-BSvkLl8Y.js → useAssociatedLegalEntity-COa3bZhe.js} +2 -2
  223. package/dist/{useBusinessDetailsData-BMzgGX4d.js → useBusinessDetailsData-DslnLoRz.js} +443 -397
  224. package/dist/{useCreateLegalEntity-i6pKh0i4.js → useCreateLegalEntity-CO7qV3Sc.js} +2 -2
  225. package/dist/{useForm-CdWcC_Oh.js → useForm-F0hPmSqd.js} +3 -3
  226. package/dist/{useFormContext-DGfVqoR2.js → useFormContext-EeYo1zte.js} +17 -8
  227. package/dist/{useGlobalData-B6jCg1Ek.js → useGlobalData-DKxTj6bo.js} +24 -15
  228. package/dist/{useMultiForm-Cmp2wrss.js → useMultiForm-CR9pqYjq.js} +4 -4
  229. package/dist/{useOnboardingStatus-Dm_xuWC2.js → useOnboardingStatus-D2I19RDh.js} +2 -2
  230. package/dist/{useScenarios-ho-q4vGs.js → useScenarios-BvV1t76w.js} +2 -2
  231. package/dist/{useTermsOfServiceStatus-Dof1-HII.js → useTermsOfServiceStatus-C0uqYCFG.js} +2 -2
  232. package/dist/{useToastContext-CflZZ_Su.js → useToastContext-Dl59lP3Q.js} +2 -2
  233. package/dist/{useUnincorporatedPartnershipMembers-rfHqZZWF.js → useUnincorporatedPartnershipMembers-BRQxcrvc.js} +5 -5
  234. package/dist/{useUpdateBusinessLines-vNF2Y_nP.js → useUpdateBusinessLines-FG7FE2l9.js} +6 -6
  235. package/dist/{useUpdateLegalEntity-CtdSLVIW.js → useUpdateLegalEntity-Dr3e1mG2.js} +3 -3
  236. package/dist/{utils-CPWcV5kL.js → utils-2-VlpJvY.js} +2 -2
  237. package/dist/{utils-DHB6YxqA.js → utils-Bmx7w6cI.js} +6 -6
  238. package/dist/{utils-CXn7BO_7.js → utils-CCjjhUUz.js} +53 -6
  239. package/dist/{utils-CF18b8u8.js → utils-CWrDCmo5.js} +22 -2
  240. package/dist/{utils-DXCw1aJK.js → utils-DCXRR-sY.js} +1 -1
  241. package/dist/{validate-DPhS2sGf.js → validate-B--uGfCw.js} +1 -1
  242. package/dist/{validate-BH9M6gvx.js → validate-DdW_lr56.js} +3 -3
  243. package/dist/{validationError-BDDYiyYy.js → validationError-DmyvOY60.js} +2 -2
  244. package/package.json +1 -5
  245. package/dist/RadioGroupCard-nQz2Uhca.js +0 -152
  246. package/dist/en-US--1W760fR.js +0 -13
  247. package/dist/en-US-CKLQU2sJ.js +0 -13
  248. package/dist/en-US-CozY33On.js +0 -13
  249. package/dist/en-US-DLY20x1O.js +0 -13
  250. package/dist/iframeWidget-D-vHGFmR.js +0 -234
  251. package/dist/instant-verification-UrnuHTYn.js +0 -40
  252. package/dist/japanSupportUtils-C5HeKRQ7.js +0 -16
  253. package/dist/manual-verification-BO8zgAYT.js +0 -41
  254. package/dist/types/components/BankAccount/forms/BankDocument/BankDocument.d.ts +0 -5
  255. package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirements.d.ts +0 -9
  256. package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirementsModal.d.ts +0 -6
  257. package/dist/types/components/BankAccount/forms/BankVerification/verification/widget/BankVerificationWidget.d.ts +0 -3
  258. package/dist/types/components/BankAccount/forms/BankVerification/verification/widget/iframeWidget.d.ts +0 -32
  259. package/dist/types/components/Business/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +0 -4
  260. package/dist/types/components/Business/utils/useCompanySearchExperiments.d.ts +0 -5
  261. package/dist/types/components/Shared/devex/DebugListener/DebugExperimentsAndSettings.d.ts +0 -7
  262. package/dist/types/components/Shared/fields/IdFieldTypeSelector/CompanyRegistrationNumberTypeSelector.d.ts +0 -20
  263. package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +0 -21
  264. package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferVatNumberType.d.ts +0 -3
  265. package/dist/types/context/ExperimentContext/ExperimentsContext.d.ts +0 -2
  266. package/dist/types/context/ExperimentContext/ExperimentsContextProvider.d.ts +0 -8
  267. package/dist/types/context/ExperimentContext/useExperimentsContext.d.ts +0 -1
  268. package/dist/types/utils/bankVerification/dom.d.ts +0 -1
@@ -2,35 +2,37 @@
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] = "0207ef05-039e-432b-966f-3a3d1edce9c5", e._sentryDebugIdIdentifier = "sentry-dbid-0207ef05-039e-432b-966f-3a3d1edce9c5");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "851cc85b-13b2-4e4a-8680-34e190646115", e._sentryDebugIdIdentifier = "sentry-dbid-851cc85b-13b2-4e4a-8680-34e190646115");
6
6
  } catch (e) {
7
7
  }
8
8
  }
9
9
  ;
10
- import { bq as getNestedPropertyKeys, aa as CountryCodes, L as LegalEntityTypes, ah as objectsDeepEqual, u as useTranslation, aB as Header, y as TaskTypes, aS as keysOf, J as useExperimentsContext, v as useAccountHolder, ac as translateTranslatable } from "./StoreProvider-o79GZkUo.js";
11
- import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
12
- import { memo } from "preact/compat";
13
- import { useState, useRef, useEffect, useCallback, useMemo } from "preact/hooks";
14
- import { F as Field } from "./Field-DhgxtDHi.js";
15
- import { S as Select } from "./Select-CyK-d8L8.js";
16
- import { T as TextArea } from "./TextArea-XLgx9WmG.js";
17
- import { S as StateContextSetter } from "./validate-BH9M6gvx.js";
18
- import { u as useForm } from "./useForm-CdWcC_Oh.js";
19
- import { u as uppercase, D as DocumentGuidance } from "./mapExistingFile-J5xtIyOp.js";
20
- import { D as Dropzone } from "./Dropzone-1307mgIt.js";
21
- import { E as ErrorPanel } from "./ErrorPanel-DNuuMh-W.js";
22
- import { c as createFormUtils } from "./formUtils-D9HJXrvu.js";
23
- import { C as Checkbox } from "./Checkbox-DnP0i74G.js";
24
- import { C as CompanyTypesValues } from "./bafinUtils-sfpUKqEq.js";
25
- import { m as makeMask, n as numericInputs, a as nonInputs, d as alphanumericInputs, c as customInputs, b as alphaInputs, s as spacer, M as MaskedInput } from "./MaskedInput-CFPRK30D.js";
10
+ import { bp as getNestedPropertyKeys, a9 as CountryCodes, L as LegalEntityTypes, u as useTranslation, z as Icon, ah as objectsDeepEqual, aB as Header, w as TaskTypes, aS as keysOf, H as useToggleContext, t as useAccountHolder, ab as translateTranslatable } from "./StoreProvider-lJLpl6iE.js";
11
+ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
12
+ import { lazy, memo } from "preact/compat";
13
+ import { useMemo, useState, useRef, useEffect, useCallback } from "preact/hooks";
14
+ import { F as Field } from "./Field-CWq5XOh3.js";
15
+ import { S as Select } from "./Select-DSLn5CCG.js";
16
+ import { T as TextArea } from "./TextArea-D0eJRv8v.js";
17
+ import { S as StateContextSetter } from "./validate-DdW_lr56.js";
18
+ import { u as useForm } from "./useForm-F0hPmSqd.js";
19
+ import cx from "classnames";
20
+ import { I as Image } from "./unincorporated-partnership-DCtqSVs0.js";
21
+ import { D as Dropzone } from "./Dropzone-Bf8v-4iJ.js";
22
+ import { E as ErrorPanel } from "./ErrorPanel-4HIDH4sr.js";
23
+ import { c as createFormUtils } from "./formUtils-DjInEErz.js";
24
+ import { C as Checkbox } from "./Checkbox-Dwf4zXgj.js";
25
+ import { C as CompanyTypesValues } from "./bafinUtils-m56sOqio.js";
26
+ import { m as makeMask, n as numericInputs, a as nonInputs, d as alphanumericInputs, c as customInputs, b as alphaInputs, s as spacer, M as MaskedInput } from "./MaskedInput-DPSvsK95.js";
26
27
  import { r as resolveFieldMetadata } from "./fieldConfigurations-BUT9DTUH.js";
27
- import { S as SettingNames } from "./types-CQ2p58-6.js";
28
- import { C as COUNTRIES_WITH_STATES_DATASET } from "./utils-CF18b8u8.js";
28
+ import { S as SettingNames } from "./types-Dv0COrvY.js";
29
+ import { C as COUNTRIES_WITH_STATES_DATASET } from "./utils-CWrDCmo5.js";
29
30
  import { c as createFormRules } from "./form-rules-DhbF2mY4.js";
30
- import { i as isJapanLocalizationEnabled } from "./japanSupportUtils-C5HeKRQ7.js";
31
- import { i as isDateOlderThanAYear } from "./Address-C0rbmhQL.js";
32
- import { v as validatePatternOnBlur, a as validateNotEmptyOnBlur } from "./patternValidators-DmtoCjEe.js";
33
- import { R as RadioGroup } from "./RadioGroup-DCmqcl_S.js";
31
+ import { i as isJapanLocalizationEnabled } from "./japanSupportUtils-BK4rTASp.js";
32
+ import { i as isDateOlderThanAYear } from "./Address-BkeFTMl-.js";
33
+ import { u as uppercase } from "./mapExistingFile-BcvOzQNH.js";
34
+ import { v as validatePatternOnBlur, a as validateNotEmptyOnBlur } from "./patternValidators-DuOaKe_S.js";
35
+ import { R as RadioGroup } from "./RadioGroup-BZ-EfNXM.js";
34
36
  const getFieldsWithExistingData = (legalEntity, keyMapping, documentMapping, knownProblematicFields = []) => {
35
37
  const apiFieldsWithExistingData = getNestedPropertyKeys(legalEntity);
36
38
  const nonDocumentFields = apiFieldsWithExistingData.map((field) => keyMapping[field]).filter(Boolean).filter((field) => !knownProblematicFields.includes(field));
@@ -2151,6 +2153,74 @@ const getTaxInformationPlaceholderText = ({
2151
2153
  return "11-0000000";
2152
2154
  }
2153
2155
  };
2156
+ const getDocumentGuidancePrefix = (documentType) => {
2157
+ switch (documentType) {
2158
+ case "passport":
2159
+ return "passport";
2160
+ case "driversLicense":
2161
+ case "identityCard":
2162
+ return "id";
2163
+ case "bankStatement":
2164
+ case "vatDocument":
2165
+ case "registrationDocument":
2166
+ case "proofOfAddress":
2167
+ case "proofOfResidency":
2168
+ default:
2169
+ return "document";
2170
+ }
2171
+ };
2172
+ const documentBlurredImage = lazy(() => import("./document-blurred-BiWap0xs.js"));
2173
+ const documentCutOffImage = lazy(() => import("./document-cut-off-aQezqOif.js"));
2174
+ const documentExpiredImage = lazy(() => import("./document-expired-BhBXaWWQ.js"));
2175
+ const documentFrontImage = lazy(() => import("./document-front-DYuhZGeQ.js"));
2176
+ const idBlurredImage = lazy(() => import("./id-blurred-B5lHEP8M.js"));
2177
+ const idCutOffImage = lazy(() => import("./id-cut-off-Ba1FRzKO.js"));
2178
+ const idFrontImage = lazy(() => import("./id-front-CpNWN6nG.js"));
2179
+ const idGlareImage = lazy(() => import("./id-glare-DgCQON8k.js"));
2180
+ const passportBlurredImage = lazy(() => import("./passport-blurred-CVG493IJ.js"));
2181
+ const passportCutOffImage = lazy(() => import("./passport-cut-off-COzA_TmB.js"));
2182
+ const passportFrontImage = lazy(() => import("./passport-front-WJleLixT.js"));
2183
+ const passportGlareImage = lazy(() => import("./passport-glare-BP5WnJZj.js"));
2184
+ const documentMap = {
2185
+ "document-blurred": documentBlurredImage,
2186
+ "document-cutoff": documentCutOffImage,
2187
+ "document-expired": documentExpiredImage,
2188
+ "document-front": documentFrontImage,
2189
+ "id-blurred": idBlurredImage,
2190
+ "id-cutoff": idCutOffImage,
2191
+ "id-front": idFrontImage,
2192
+ "id-glare": idGlareImage,
2193
+ "passport-blurred": passportBlurredImage,
2194
+ "passport-cutoff": passportCutOffImage,
2195
+ "passport-front": passportFrontImage,
2196
+ "passport-glare": passportGlareImage
2197
+ };
2198
+ function DocumentGuidance({ type, className }) {
2199
+ const { t } = useTranslation("ui");
2200
+ const documentGuidanceItems = useMemo(() => {
2201
+ const guidancePrefix = getDocumentGuidancePrefix(type);
2202
+ const guidanceItems = [
2203
+ { svgName: `${guidancePrefix}-front`, translationKey: "good", valid: true },
2204
+ { svgName: `${guidancePrefix}-cutoff`, translationKey: "notCutOff" },
2205
+ { svgName: `${guidancePrefix}-blurred`, translationKey: "notBlurry" },
2206
+ guidancePrefix === "document" ? { svgName: `document-expired`, translationKey: "notExpired" } : { svgName: `${guidancePrefix}-glare`, translationKey: "noGlare" }
2207
+ ];
2208
+ return type === "constitutionalDocument" ? guidanceItems.filter((item) => item.svgName !== "document-expired") : guidanceItems;
2209
+ }, [type]);
2210
+ return /* @__PURE__ */ jsx("div", { className: cx("adyen-kyc-document-guidance", className), children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-document-guidance__container", children: documentGuidanceItems.map((item) => /* @__PURE__ */ jsxs("figure", { className: "adyen-kyc-document-guidance__item", children: [
2211
+ /* @__PURE__ */ jsx(Image, { lazyLoadedImage: documentMap[item.svgName] }),
2212
+ /* @__PURE__ */ jsxs("figcaption", { className: "adyen-kyc-document-guidance__description", children: [
2213
+ item.valid ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "adyen-kyc-document-guidance__icon" }) : /* @__PURE__ */ jsx(
2214
+ Icon,
2215
+ {
2216
+ name: "cross",
2217
+ className: "adyen-kyc-document-guidance__icon adyen-kyc-document-guidance__icon--invalid"
2218
+ }
2219
+ ),
2220
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-document-guidance__description-text", children: t(($) => $[item.translationKey]) })
2221
+ ] })
2222
+ ] }, item.translationKey)) }) });
2223
+ }
2154
2224
  const descriptionField = "adyen-kyc-description-field";
2155
2225
  const styles = {
2156
2226
  descriptionField
@@ -2313,96 +2383,442 @@ const MemoizedDocumentUpload = memo(
2313
2383
  DocumentUpload,
2314
2384
  (prevProps, nextProps) => prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.errors, nextProps.errors) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.documentTypeSelect, nextProps.documentTypeSelect) && prevProps.documentField === nextProps.documentField && prevProps.name === nextProps.name && prevProps.country === nextProps.country && prevProps.companyType === nextProps.companyType
2315
2385
  );
2316
- const companyRegistrationNumberOptions = {
2317
- [CountryCodes.Australia]: [
2318
- {
2319
- id: "incorporatedAssociationRegistrationNumber",
2320
- name: "incorporatedAssociationRegistrationNumber",
2321
- applicableOnlyFor: [CompanyTypesValues.INCORPORATED_ASSOCIATION]
2322
- },
2323
- {
2324
- id: "australianBusinessNumberAcn",
2325
- name: "australianBusinessNumberAcn",
2326
- applicableOnlyFor: [
2327
- CompanyTypesValues.PRIVATE_COMPANY,
2328
- CompanyTypesValues.PUBLIC_COMPANY,
2329
- CompanyTypesValues.UNLISTED_PUBLIC_COMPANY,
2330
- CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
2331
- CompanyTypesValues.INCORPORATED_PARTNERSHIP,
2332
- CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
2333
- CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
2334
- CompanyTypesValues.SOLE_PROPRIETORSHIP
2335
- ]
2386
+ const countryToTaxInfoTypeMap = {
2387
+ US: "EIN",
2388
+ AU: "ABN",
2389
+ NZ: "IRD",
2390
+ HK: "BRN",
2391
+ SG: "GST"
2392
+ };
2393
+ const isFinancialInformationRequired = (isFinancialInformationFeatureEnabled, taskType, country, capabilities, legalEntityType) => {
2394
+ const isOrganization = legalEntityType === LegalEntityTypes.ORGANIZATION;
2395
+ if (!isFinancialInformationFeatureEnabled || !COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
2396
+ return void 0;
2397
+ }
2398
+ if (country === CountryCodes.UnitedKingdom && (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY || taskType === TaskTypes.BUSINESS_DETAILS)) {
2399
+ return "REQUIRED";
2400
+ }
2401
+ if (taskType === TaskTypes.BUSINESS_DETAILS && isOrganization) {
2402
+ if (keysOf(capabilities ?? {}).some((capability) => capability === "issueBankAccount")) {
2403
+ return "REQUIRED";
2336
2404
  }
2337
- ],
2338
- [CountryCodes.Austria]: [
2339
- {
2340
- id: "firmenbuchnummer",
2341
- name: "firmenbuchnummer"
2342
- },
2343
- {
2344
- id: "ZVR",
2345
- name: "zentralesVereinsregisterId",
2346
- applicableOnlyFor: [
2347
- CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
2348
- CompanyTypesValues.INCORPORATED_ASSOCIATION
2349
- ]
2405
+ }
2406
+ return void 0;
2407
+ };
2408
+ function requestingIssuing(rootLegalEntity) {
2409
+ const capabilities = rootLegalEntity?.capabilities ?? {};
2410
+ return "issueCard" in capabilities && capabilities.issueCard?.requested === true || "issueCardConsumer" in capabilities && capabilities.issueCardConsumer?.requested === true || "issueCardCommercial" in capabilities && capabilities.issueCardCommercial?.requested === true || "useCard" in capabilities && capabilities.useCard?.requested === true || "useCardConsumer" in capabilities && capabilities.useCardConsumer?.requested === true || "useCardCommercial" in capabilities && capabilities.useCardCommercial?.requested === true;
2411
+ }
2412
+ function requestingBanking(rootLegalEntity) {
2413
+ const capabilities = rootLegalEntity?.capabilities ?? {};
2414
+ return "issueBankAccount" in capabilities && capabilities.issueBankAccount?.requested === true || "sendToThirdParty" in capabilities && capabilities.sendToThirdParty?.requested === true || "receiveFromThirdParty" in capabilities && capabilities.receiveFromThirdParty?.requested === true;
2415
+ }
2416
+ const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
2417
+ CountryCodes.Australia,
2418
+ CountryCodes.Gibraltar,
2419
+ CountryCodes.Guernsey,
2420
+ CountryCodes.HongKong,
2421
+ CountryCodes.Ireland,
2422
+ CountryCodes.IsleOfMan,
2423
+ CountryCodes.Jersey,
2424
+ CountryCodes.Malta,
2425
+ CountryCodes.PuertoRico,
2426
+ CountryCodes.Spain,
2427
+ CountryCodes.UnitedKingdom,
2428
+ CountryCodes.UnitedStates
2429
+ ];
2430
+ const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [
2431
+ CountryCodes.HongKong,
2432
+ CountryCodes.PuertoRico,
2433
+ CountryCodes.UnitedStates
2434
+ ];
2435
+ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS = [
2436
+ CountryCodes.HongKong
2437
+ ];
2438
+ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
2439
+ CountryCodes.Austria,
2440
+ CountryCodes.Canada,
2441
+ CountryCodes.Finland,
2442
+ CountryCodes.Germany,
2443
+ CountryCodes.Lithuania,
2444
+ CountryCodes.Luxembourg,
2445
+ CountryCodes.NewZealand,
2446
+ CountryCodes.Poland,
2447
+ CountryCodes.Sweden,
2448
+ CountryCodes.Switzerland
2449
+ ];
2450
+ const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [
2451
+ CountryCodes.Canada,
2452
+ CountryCodes.UnitedStates
2453
+ ];
2454
+ const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS = [
2455
+ CountryCodes.Germany
2456
+ ];
2457
+ const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
2458
+ CountryCodes.Australia,
2459
+ CountryCodes.Canada,
2460
+ CountryCodes.Gibraltar,
2461
+ CountryCodes.HongKong,
2462
+ CountryCodes.NewZealand,
2463
+ CountryCodes.PuertoRico,
2464
+ CountryCodes.Singapore,
2465
+ CountryCodes.UnitedStates,
2466
+ CountryCodes.Guernsey,
2467
+ CountryCodes.Jersey,
2468
+ CountryCodes.IsleOfMan,
2469
+ CountryCodes.Mexico,
2470
+ CountryCodes.Brazil,
2471
+ CountryCodes.Japan
2472
+ ];
2473
+ const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [
2474
+ CountryCodes.Singapore
2475
+ ];
2476
+ const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
2477
+ // strictly a subset of countries which use tax ID
2478
+ // right now in all countries companies must provide a tax ID - but maybe there will be exemptions in future?
2479
+ ];
2480
+ const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS = [
2481
+ // strictly a subset of countries which use tax ID
2482
+ CountryCodes.Canada,
2483
+ CountryCodes.PuertoRico,
2484
+ CountryCodes.UnitedStates
2485
+ ];
2486
+ const COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION = [
2487
+ CountryCodes.HongKong,
2488
+ CountryCodes.Singapore
2489
+ ];
2490
+ const COUNTRIES_THAT_USES_UEN_OR_GST = [CountryCodes.Singapore];
2491
+ const COUNTRIES_USING_COMPANY_SEARCH = [
2492
+ CountryCodes.UnitedStates
2493
+ ];
2494
+ const COUNTRY_OF_GOVERNING_LAW_POSSIBLE = [
2495
+ CountryCodes.UnitedKingdom
2496
+ ];
2497
+ const COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
2498
+ CountryCodes.Austria,
2499
+ CountryCodes.Belgium,
2500
+ CountryCodes.Croatia,
2501
+ CountryCodes.Cyprus,
2502
+ CountryCodes.Estonia,
2503
+ CountryCodes.Finland,
2504
+ CountryCodes.France,
2505
+ CountryCodes.Germany,
2506
+ CountryCodes.Greece,
2507
+ CountryCodes.Ireland,
2508
+ CountryCodes.Italy,
2509
+ CountryCodes.Latvia,
2510
+ CountryCodes.Lithuania,
2511
+ CountryCodes.Luxembourg,
2512
+ CountryCodes.Malta,
2513
+ CountryCodes.Netherlands,
2514
+ CountryCodes.Portugal,
2515
+ CountryCodes.Slovakia,
2516
+ CountryCodes.Slovenia,
2517
+ CountryCodes.Spain,
2518
+ CountryCodes.UnitedKingdom
2519
+ ];
2520
+ const COUNTRIES_REQUIRING_E_INVOICING_CODE = [
2521
+ /**
2522
+ * @description These are the countries for which E-Invoicing code is a compliance requirement. There will be more in the future.
2523
+ */
2524
+ CountryCodes.Italy
2525
+ ];
2526
+ const COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 = [
2527
+ CountryCodes.Australia
2528
+ ];
2529
+ const TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION = [
2530
+ // The following countries are commented out just to make it more clear that these
2531
+ // use tax id but since it's the same field as business registration we don't want
2532
+ // to remove those here and have a bad ux. So instead in the map schema part
2533
+ // we copy over the values to the taxinformation object
2534
+ // CountryCodes.Estonia,
2535
+ // CountryCodes.Finland,
2536
+ // CountryCodes.France,
2537
+ // CountryCodes.Latvia,
2538
+ // CountryCodes.Lithuania,
2539
+ // CountryCodes.Portugal,
2540
+ // CountryCodes.Spain,
2541
+ CountryCodes.Austria,
2542
+ CountryCodes.Belgium,
2543
+ CountryCodes.Croatia,
2544
+ CountryCodes.Cyprus,
2545
+ CountryCodes.Germany,
2546
+ CountryCodes.Greece,
2547
+ CountryCodes.Ireland,
2548
+ CountryCodes.Italy,
2549
+ CountryCodes.Luxembourg,
2550
+ CountryCodes.Malta,
2551
+ CountryCodes.Netherlands,
2552
+ CountryCodes.Slovakia,
2553
+ CountryCodes.Slovenia,
2554
+ CountryCodes.UnitedKingdom
2555
+ ];
2556
+ function isUsingCompanySearch(country, taskType) {
2557
+ return taskType === TaskTypes.BUSINESS_DETAILS && COUNTRIES_USING_COMPANY_SEARCH.includes(country);
2558
+ }
2559
+ const isRegistrationNumberAbsentStateV4Scenario = (country, entityType) => {
2560
+ return country === CountryCodes.Australia && (entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || entityType === CompanyTypesValues.INCORPORATED_PARTNERSHIP) || country === CountryCodes.NewZealand;
2561
+ };
2562
+ const rules = ({
2563
+ data,
2564
+ defaultData,
2565
+ country,
2566
+ taskType,
2567
+ isFeatureEnabled = () => false,
2568
+ isSettingEnabled = () => false,
2569
+ accountHolder,
2570
+ rootLegalEntity,
2571
+ tinMatched
2572
+ }) => {
2573
+ const countryRequiresDateOfIncorporationForCompanies = () => {
2574
+ if (COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION.includes(country)) {
2575
+ return "REQUIRED";
2350
2576
  }
2351
- ],
2352
- [CountryCodes.Croatia]: [
2353
- { id: "MBO", name: "MBO", applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP] },
2354
- {
2355
- id: "MBS",
2356
- name: "MBS",
2357
- applicableOnlyFor: [
2358
- CompanyTypesValues.PRIVATE_COMPANY,
2359
- CompanyTypesValues.PUBLIC_COMPANY,
2360
- CompanyTypesValues.UNLISTED_PUBLIC_COMPANY,
2361
- CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
2362
- CompanyTypesValues.INCORPORATED_PARTNERSHIP,
2363
- CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
2364
- CompanyTypesValues.NON_PROFIT_OR_CHARITABLE
2365
- ]
2577
+ };
2578
+ const countryRequiresFinancialInformation = () => {
2579
+ if (isFeatureEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
2580
+ const isFinancialInformationFeatureEnabled = isFeatureEnabled(
2581
+ "EnableFinancialInformationComponentV4"
2582
+ );
2583
+ const leType = rootLegalEntity?.type;
2584
+ return isFinancialInformationRequired(
2585
+ isFinancialInformationFeatureEnabled,
2586
+ taskType,
2587
+ country,
2588
+ rootLegalEntity?.capabilities,
2589
+ leType
2590
+ );
2366
2591
  }
2367
- ],
2368
- [CountryCodes.France]: [
2369
- {
2370
- id: "SIRET",
2371
- name: "siret"
2592
+ };
2593
+ return createFormRules({
2594
+ requireDoingBusinessAsName: () => {
2595
+ return data.additionalInformation?.hasDoingBusinessAs ? "REQUIRED" : void 0;
2372
2596
  },
2373
- {
2374
- id: "RNA",
2375
- name: "rnaNumber",
2376
- applicableOnlyFor: [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]
2377
- }
2378
- ],
2379
- [CountryCodes.Hungary]: [
2380
- {
2381
- id: "nyilvantartasiSzam",
2382
- name: "huRegistrationNumberForSoleProp",
2383
- applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
2384
- }
2385
- ],
2386
- [CountryCodes.Italy]: [
2387
- {
2388
- id: "partitaIVA",
2389
- name: "codiceFiscalePartitaIVA"
2597
+ countryRequiresStateOrProvince: () => {
2598
+ if (COUNTRIES_WITH_STATES_DATASET.includes(country)) {
2599
+ return "REQUIRED";
2600
+ }
2390
2601
  },
2391
- {
2392
- id: "CCIAA",
2393
- name: "CCIAA"
2394
- }
2602
+ ifPubliclyTradedCompany: () => {
2603
+ if (data.companyStructure?.entityType === CompanyTypesValues.PUBLIC_COMPANY) {
2604
+ return "REQUIRED";
2605
+ }
2606
+ },
2607
+ countryUsesVat: () => {
2608
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2609
+ return data.additionalInformation?.exemptedFromVat ? "OPTIONAL" : "REQUIRED";
2610
+ }
2611
+ },
2612
+ vatNumberType: () => {
2613
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2614
+ return "OPTIONAL";
2615
+ }
2616
+ },
2617
+ isVatExempt: () => {
2618
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2619
+ return data.additionalInformation?.exemptedFromVat ? "REQUIRED" : "OPTIONAL";
2620
+ }
2621
+ },
2622
+ countryUsesTaxId: () => {
2623
+ const isExemptFromTax = Boolean(
2624
+ data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax
2625
+ );
2626
+ if (TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country) && rootLegalEntity?.type === "organization" && // SOE-5931 - TODO: investigate L scenario returned to show this on the backend
2627
+ keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount")) {
2628
+ return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
2629
+ }
2630
+ if (COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country) && !(taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country))) {
2631
+ return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
2632
+ }
2633
+ },
2634
+ companyRegistrationNumberExemptionAllowed: () => {
2635
+ const isExemptFromRegistrationNumber = Boolean(
2636
+ data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber
2637
+ );
2638
+ if (isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && isRegistrationNumberAbsentStateV4Scenario(country, data.companyStructure?.entityType)) {
2639
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2640
+ }
2641
+ switch (taskType) {
2642
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2643
+ if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS.includes(country))
2644
+ return;
2645
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2646
+ }
2647
+ default: {
2648
+ switch (country) {
2649
+ case CountryCodes.Germany: {
2650
+ if (data.companyStructure?.entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) {
2651
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2652
+ }
2653
+ return;
2654
+ }
2655
+ case CountryCodes.Denmark: {
2656
+ if (data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) {
2657
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2658
+ }
2659
+ return;
2660
+ }
2661
+ // We're no longer collecting registration numbers for new HK entities, but for existing,
2662
+ // we want to offer the exemption if they have a registration number attached. See OXP-7075
2663
+ case CountryCodes.HongKong: {
2664
+ if (country === CountryCodes.HongKong && !defaultData?.additionalInformation?.registrationNumber)
2665
+ return;
2666
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2667
+ }
2668
+ default: {
2669
+ if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS.includes(country))
2670
+ return;
2671
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2672
+ }
2673
+ }
2674
+ }
2675
+ }
2676
+ },
2677
+ countryOfGoverningLawRequired: () => {
2678
+ if (isFeatureEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(data.basicInformation?.country)) {
2679
+ return "REQUIRED";
2680
+ }
2681
+ },
2682
+ countryRequiresRegistrationNumber: () => {
2683
+ const isExemptFromRegistrationNumber = Boolean(
2684
+ data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber
2685
+ );
2686
+ switch (taskType) {
2687
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2688
+ if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2689
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS.includes(country)) {
2690
+ return "OPTIONAL";
2691
+ }
2692
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2693
+ }
2694
+ default: {
2695
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
2696
+ return "OPTIONAL";
2697
+ }
2698
+ if (country === CountryCodes.HongKong) {
2699
+ if (!defaultData?.additionalInformation?.registrationNumber) return;
2700
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2701
+ }
2702
+ if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) {
2703
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2704
+ }
2705
+ }
2706
+ }
2707
+ },
2708
+ registrationNumberType: () => {
2709
+ switch (taskType) {
2710
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2711
+ if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2712
+ return "OPTIONAL";
2713
+ }
2714
+ default: {
2715
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
2716
+ return "OPTIONAL";
2717
+ }
2718
+ if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
2719
+ return "OPTIONAL";
2720
+ }
2721
+ }
2722
+ },
2723
+ countryUsesUenOrGst: () => {
2724
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2725
+ return;
2726
+ }
2727
+ if (COUNTRIES_THAT_USES_UEN_OR_GST.includes(country)) {
2728
+ return "REQUIRED";
2729
+ }
2730
+ },
2731
+ countryHasTaxExemptions: () => {
2732
+ const isExemptFromTax = Boolean(
2733
+ data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax
2734
+ );
2735
+ switch (taskType) {
2736
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2737
+ if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
2738
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2739
+ }
2740
+ default: {
2741
+ if (isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") {
2742
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2743
+ }
2744
+ if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) {
2745
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2746
+ }
2747
+ }
2748
+ }
2749
+ },
2750
+ usingCompanySearch: () => {
2751
+ if (isUsingCompanySearch(country, taskType)) {
2752
+ return "REQUIRED";
2753
+ }
2754
+ },
2755
+ countryRequiresFinancialInformation,
2756
+ isDateOfIncorporationRequired: () => {
2757
+ return countryRequiresDateOfIncorporationForCompanies() || countryRequiresFinancialInformation();
2758
+ },
2759
+ isFinancialReportingFieldsRequired: () => {
2760
+ return countryRequiresFinancialInformation() === "REQUIRED" && isDateOlderThanAYear(data.additionalInformation?.dateOfIncorporation) ? "REQUIRED" : void 0;
2761
+ },
2762
+ isIndustryCodeRequired: () => {
2763
+ const needsBusinessLine = requestingIssuing(rootLegalEntity) || requestingBanking(rootLegalEntity);
2764
+ if (isSettingEnabled(SettingNames.AllowBusinessLines) && needsBusinessLine) {
2765
+ return "REQUIRED";
2766
+ }
2767
+ },
2768
+ annualTurnoverRequired: () => {
2769
+ if (data.companyFinancialInformation?.reportedValueOption === "annualTurnover") {
2770
+ return "REQUIRED";
2771
+ }
2772
+ },
2773
+ balanceSheetTotalRequired: () => {
2774
+ if (data.companyFinancialInformation?.reportedValueOption === "balanceSheetTotal") {
2775
+ return "REQUIRED";
2776
+ }
2777
+ },
2778
+ isEInvoicingCodeEnabled: () => {
2779
+ if (isFeatureEnabled("EnableEInvoicingCodeField") && COUNTRIES_REQUIRING_E_INVOICING_CODE.includes(country)) {
2780
+ return "REQUIRED";
2781
+ }
2782
+ },
2783
+ ifCountryUsAndTinFailed: () => {
2784
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2785
+ return;
2786
+ }
2787
+ if (tinMatched === false && country === CountryCodes.UnitedStates) {
2788
+ return "REQUIRED";
2789
+ }
2790
+ },
2791
+ businessRequiresCompanyType: () => {
2792
+ if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2793
+ return "REQUIRED";
2794
+ }
2795
+ },
2796
+ japaneseLegalCompanyName: () => {
2797
+ if (isJapanLocalizationEnabled(isFeatureEnabled, country)) {
2798
+ return "REQUIRED";
2799
+ }
2800
+ }
2801
+ });
2802
+ };
2803
+ const taxIdNumberOptions = {
2804
+ [CountryCodes.Australia]: [
2805
+ {
2806
+ id: "ABN",
2807
+ name: "australianBusinessNumberAbn"
2808
+ }
2395
2809
  ],
2396
- [CountryCodes.Monaco]: [
2810
+ [CountryCodes.Austria]: [
2397
2811
  {
2398
- id: "mcRegistrationNumberSoleProp",
2399
- name: "mcRegistrationNumberSoleProp",
2400
- applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
2401
- },
2812
+ id: "STEUERNUMMER",
2813
+ name: "taxInformationNumber__AT"
2814
+ }
2815
+ ],
2816
+ [CountryCodes.Belgium]: [
2402
2817
  {
2403
- id: "mcRegistrationNumber",
2404
- name: "mcRegistrationNumber",
2818
+ id: "BUSINESS_NUMMER",
2819
+ name: "businessNumber",
2405
2820
  applicableOnlyFor: [
2821
+ CompanyTypesValues.SOLE_PROPRIETORSHIP,
2406
2822
  CompanyTypesValues.PRIVATE_COMPANY,
2407
2823
  CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
2408
2824
  CompanyTypesValues.INCORPORATED_ASSOCIATION,
@@ -2411,193 +2827,52 @@ const companyRegistrationNumberOptions = {
2411
2827
  CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
2412
2828
  CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
2413
2829
  ]
2830
+ },
2831
+ {
2832
+ id: "NUMERO_NATIONAL",
2833
+ name: "taxInformationNumber__BE_Individual",
2834
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
2414
2835
  }
2415
2836
  ],
2416
- [CountryCodes.NewZealand]: [
2837
+ [CountryCodes.Brazil]: [{ id: "CNPJ", name: "CNPJ" }],
2838
+ [CountryCodes.Canada]: [{ id: "BUSINESS_NUMBER", name: "businessNumber" }],
2839
+ [CountryCodes.Croatia]: [
2417
2840
  {
2418
- id: "NZBN",
2419
- name: "NZBN"
2420
- },
2841
+ id: "OIB",
2842
+ name: "taxInformationNumber__HR"
2843
+ }
2844
+ ],
2845
+ [CountryCodes.Cyprus]: [
2421
2846
  {
2422
- id: "companyNumberNZ",
2423
- name: "companyNumberNZ",
2424
- applicableOnlyFor: [
2425
- CompanyTypesValues.PRIVATE_COMPANY,
2426
- CompanyTypesValues.PUBLIC_COMPANY,
2427
- CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
2428
- ]
2847
+ id: "TIC",
2848
+ name: "taxInformationNumber__CY"
2429
2849
  }
2430
2850
  ],
2431
- [CountryCodes.Romania]: [
2851
+ [CountryCodes.Estonia]: [
2432
2852
  {
2433
- id: "roRegNumberNewFormat",
2434
- name: "roRegNumberNewFormat_label"
2853
+ id: "ISIKUKOOD",
2854
+ name: "taxInformationNumber__ET_Individual",
2855
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
2435
2856
  },
2436
2857
  {
2437
- id: "roRegNumberOldFormat",
2438
- name: "roRegNumberOldFormat_label"
2858
+ id: "registrikood",
2859
+ name: "registrikood",
2860
+ applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
2439
2861
  }
2440
2862
  ],
2441
- [CountryCodes.Poland]: [
2863
+ [CountryCodes.Finland]: [
2442
2864
  {
2443
- id: "regon",
2444
- name: "regon"
2865
+ id: "HENKILOTUNNUS",
2866
+ name: "taxInformationNumber__FI",
2867
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
2445
2868
  },
2446
2869
  {
2447
- id: "krsNumber",
2448
- name: "krsNumber"
2870
+ id: "YTUNNUS",
2871
+ name: "YTunnus",
2872
+ applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
2449
2873
  }
2450
2874
  ],
2451
- [CountryCodes.UnitedKingdom]: [
2452
- {
2453
- id: "charity",
2454
- name: "charityNumber",
2455
- applicableOnlyFor: [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]
2456
- },
2457
- {
2458
- id: "companyNumber",
2459
- name: "companyNumber",
2460
- applicableOnlyFor: [
2461
- CompanyTypesValues.PRIVATE_COMPANY,
2462
- CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
2463
- CompanyTypesValues.INCORPORATED_ASSOCIATION,
2464
- CompanyTypesValues.INCORPORATED_PARTNERSHIP,
2465
- CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
2466
- CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
2467
- CompanyTypesValues.UNLISTED_PUBLIC_COMPANY,
2468
- CompanyTypesValues.PUBLIC_COMPANY
2469
- ]
2470
- }
2471
- ]
2472
- };
2473
- const getCompanyRegistrationNumberOptions = (country, companyType) => {
2474
- const optionsForCountry = companyRegistrationNumberOptions[country];
2475
- if (!companyType || !optionsForCountry) return optionsForCountry;
2476
- return optionsForCountry.filter(
2477
- (option) => option.applicableOnlyFor?.includes(companyType) ?? true
2478
- );
2479
- };
2480
- const individualIdNumberOptions = {
2481
- [CountryCodes.Spain]: [
2482
- {
2483
- id: "dni",
2484
- name: "dni"
2485
- },
2486
- {
2487
- id: "nie",
2488
- name: "nie"
2489
- }
2490
- ]
2491
- };
2492
- const additionallIdNumberOptions = {
2493
- [CountryCodes.NewZealand]: [
2494
- {
2495
- id: "driversLicense",
2496
- name: "driversLicense"
2497
- },
2498
- {
2499
- id: "passport",
2500
- name: "passportNumber"
2501
- }
2502
- ],
2503
- [CountryCodes.HongKong]: [
2504
- {
2505
- id: "proofOfIdentityCard",
2506
- name: "stateIssuedProofOfIdentityCard"
2507
- },
2508
- {
2509
- id: "driversLicense",
2510
- name: "driversLicense"
2511
- },
2512
- {
2513
- id: "passport",
2514
- name: "passportNumber"
2515
- }
2516
- ],
2517
- [CountryCodes.Australia]: [
2518
- {
2519
- id: "driversLicense",
2520
- name: "driversLicense"
2521
- },
2522
- {
2523
- id: "passport",
2524
- name: "passportNumber"
2525
- }
2526
- ]
2527
- };
2528
- const taxIdNumberOptions = {
2529
- [CountryCodes.Australia]: [
2530
- {
2531
- id: "ABN",
2532
- name: "australianBusinessNumberAbn"
2533
- }
2534
- ],
2535
- [CountryCodes.Austria]: [
2536
- {
2537
- id: "STEUERNUMMER",
2538
- name: "taxInformationNumber__AT"
2539
- }
2540
- ],
2541
- [CountryCodes.Belgium]: [
2542
- {
2543
- id: "BUSINESS_NUMMER",
2544
- name: "businessNumber",
2545
- applicableOnlyFor: [
2546
- CompanyTypesValues.SOLE_PROPRIETORSHIP,
2547
- CompanyTypesValues.PRIVATE_COMPANY,
2548
- CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
2549
- CompanyTypesValues.INCORPORATED_ASSOCIATION,
2550
- CompanyTypesValues.INCORPORATED_PARTNERSHIP,
2551
- CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
2552
- CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
2553
- CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
2554
- ]
2555
- },
2556
- {
2557
- id: "NUMERO_NATIONAL",
2558
- name: "taxInformationNumber__BE_Individual",
2559
- applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
2560
- }
2561
- ],
2562
- [CountryCodes.Brazil]: [{ id: "CNPJ", name: "CNPJ" }],
2563
- [CountryCodes.Canada]: [{ id: "BUSINESS_NUMBER", name: "businessNumber" }],
2564
- [CountryCodes.Croatia]: [
2565
- {
2566
- id: "OIB",
2567
- name: "taxInformationNumber__HR"
2568
- }
2569
- ],
2570
- [CountryCodes.Cyprus]: [
2571
- {
2572
- id: "TIC",
2573
- name: "taxInformationNumber__CY"
2574
- }
2575
- ],
2576
- [CountryCodes.Estonia]: [
2577
- {
2578
- id: "ISIKUKOOD",
2579
- name: "taxInformationNumber__ET_Individual",
2580
- applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
2581
- },
2582
- {
2583
- id: "registrikood",
2584
- name: "registrikood",
2585
- applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
2586
- }
2587
- ],
2588
- [CountryCodes.Finland]: [
2589
- {
2590
- id: "HENKILOTUNNUS",
2591
- name: "taxInformationNumber__FI",
2592
- applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
2593
- },
2594
- {
2595
- id: "YTUNNUS",
2596
- name: "YTunnus",
2597
- applicableOnlyFor: [CompanyTypesValues.PRIVATE_COMPANY]
2598
- }
2599
- ],
2600
- [CountryCodes.France]: [
2875
+ [CountryCodes.France]: [
2601
2876
  {
2602
2877
  id: "SIRET",
2603
2878
  name: "siret",
@@ -2842,80 +3117,6 @@ const taxIdNumberOptions = {
2842
3117
  }
2843
3118
  ]
2844
3119
  };
2845
- const vatNumberOptions = {
2846
- [CountryCodes.Austria]: [{ id: "UST-ID", name: "UST-ID" }],
2847
- [CountryCodes.Belgium]: [{ id: "euVatNumber", name: "euVatNumber" }],
2848
- [CountryCodes.Bulgaria]: [{ id: "identifikacionenNomerDDS", name: "identifikacionenNomerDDS" }],
2849
- [CountryCodes.Croatia]: [{ id: "PDVIdBrojOIB", name: "PDVIdBrojOIB" }],
2850
- [CountryCodes.Cyprus]: [{ id: "arithmosEngraphes", name: "arithmosEngraphes" }],
2851
- [CountryCodes.CzechRepublic]: [{ id: "DIC", name: "DIC" }],
2852
- [CountryCodes.Denmark]: [
2853
- {
2854
- id: "momsregistreringsnummerCVR",
2855
- name: "momsregistreringsnummerCVR"
2856
- },
2857
- {
2858
- id: "stamregister",
2859
- name: "stamregister"
2860
- }
2861
- ],
2862
- [CountryCodes.Estonia]: [
2863
- { id: "kaibemaksukohustuslaseNumber", name: "kaibemaksukohustuslaseNumber" }
2864
- ],
2865
- [CountryCodes.Finland]: [
2866
- {
2867
- id: "arvonlisaveronumeroMervardesskattenummer",
2868
- name: "arvonlisaveronumeroMervardesskattenummer"
2869
- }
2870
- ],
2871
- [CountryCodes.France]: [
2872
- {
2873
- id: "numeroDIdentificationALATaxe",
2874
- name: "numeroDIdentificationALATaxe"
2875
- },
2876
- {
2877
- id: "NumeroDeTVA",
2878
- name: "NumeroDeTVA"
2879
- }
2880
- ],
2881
- [CountryCodes.Germany]: [{ id: "USt-IdNr", name: "USt-IdNr" }],
2882
- [CountryCodes.Greece]: [{ id: "grTaxId", name: "grTaxId" }],
2883
- [CountryCodes.Hungary]: [{ id: "huTaxId", name: "huTaxId" }],
2884
- [CountryCodes.Ireland]: [{ id: "vatNumber", name: "vatNumber" }],
2885
- [CountryCodes.Italy]: [{ id: "partitaIVA", name: "partitaIVA" }],
2886
- [CountryCodes.Latvia]: [{ id: "lvTaxId", name: "lvTaxId" }],
2887
- [CountryCodes.Liechtenstein]: [{ id: "vatRegistrationNumber", name: "vatRegistrationNumber" }],
2888
- [CountryCodes.Lithuania]: [{ id: "PVMmoketojoKodas", name: "PVMmoketojoKodas" }],
2889
- [CountryCodes.Luxembourg]: [
2890
- { id: "numeroDIdentificationALATaxe", name: "numeroDIdentificationALATaxe" }
2891
- ],
2892
- [CountryCodes.Malaysia]: [{ id: "SST", name: "SST" }],
2893
- [CountryCodes.Malta]: [{ id: "vatNumber", name: "vatNumber" }],
2894
- [CountryCodes.Monaco]: [
2895
- { id: "numeroDIdentificationALATaxe", name: "numeroDIdentificationALATaxe" }
2896
- ],
2897
- [CountryCodes.Netherlands]: [{ id: "btwNummer", name: "btwNummer" }],
2898
- [CountryCodes.Norway]: [{ id: "mvanummer", name: "mvanummer" }],
2899
- [CountryCodes.Poland]: [{ id: "NIP", name: "NIP" }],
2900
- [CountryCodes.Portugal]: [{ id: "numerodeIVA", name: "numerodeIVA" }],
2901
- [CountryCodes.Romania]: [
2902
- { id: "codulDeIdentificareFiscala", name: "codulDeIdentificareFiscala" }
2903
- ],
2904
- [CountryCodes.Slovakia]: [{ id: "skTaxId", name: "skTaxId" }],
2905
- [CountryCodes.Slovenia]: [{ id: "siTaxId", name: "siTaxId" }],
2906
- [CountryCodes.Spain]: [{ id: "NIFdeIVA", name: "NIFdeIVA" }],
2907
- [CountryCodes.Sweden]: [
2908
- {
2909
- id: "vatNummerMomsregistreringsnummerOrMomsnummer",
2910
- name: "vatNummerMomsregistreringsnummerOrMomsnummer"
2911
- }
2912
- ],
2913
- [CountryCodes.Switzerland]: [{ id: "Mehrwertsteuernummer", name: "Mehrwertsteuernummer" }],
2914
- [CountryCodes.UnitedArabEmirates]: [
2915
- { id: "vatRegistrationNumber", name: "vatRegistrationNumber" }
2916
- ],
2917
- [CountryCodes.UnitedKingdom]: [{ id: "vatRegistrationNumber", name: "vatRegistrationNumber" }]
2918
- };
2919
3120
  const getTaxIdNumberOptions = (country, companyType) => {
2920
3121
  const optionsForCountry = taxIdNumberOptions[country];
2921
3122
  if (!companyType || !optionsForCountry) return optionsForCountry;
@@ -2923,430 +3124,6 @@ const getTaxIdNumberOptions = (country, companyType) => {
2923
3124
  (option) => option.applicableOnlyFor?.includes(companyType) ?? true
2924
3125
  );
2925
3126
  };
2926
- const getVatNumberOptions = (country, companyType) => {
2927
- const optionsForCountry = vatNumberOptions[country];
2928
- if (!companyType || !optionsForCountry) return optionsForCountry;
2929
- return optionsForCountry.filter(
2930
- (option) => option.applicableOnlyFor?.includes(companyType) ?? true
2931
- );
2932
- };
2933
- const countryToTaxInfoTypeMap = {
2934
- US: "EIN",
2935
- AU: "ABN",
2936
- NZ: "IRD",
2937
- HK: "BRN",
2938
- SG: "GST"
2939
- };
2940
- const isFinancialInformationRequired = (isFinancialInformationExperimentEnabled, taskType, country, capabilities, legalEntityType) => {
2941
- const isOrganization = legalEntityType === LegalEntityTypes.ORGANIZATION;
2942
- if (!isFinancialInformationExperimentEnabled || !COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
2943
- return void 0;
2944
- }
2945
- if (country === CountryCodes.UnitedKingdom && (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY || taskType === TaskTypes.BUSINESS_DETAILS)) {
2946
- return "REQUIRED";
2947
- }
2948
- if (taskType === TaskTypes.BUSINESS_DETAILS && isOrganization) {
2949
- if (keysOf(capabilities ?? {}).some((capability) => capability === "issueBankAccount")) {
2950
- return "REQUIRED";
2951
- }
2952
- }
2953
- return void 0;
2954
- };
2955
- function requestingIssuing(rootLegalEntity) {
2956
- const capabilities = rootLegalEntity?.capabilities ?? {};
2957
- return "issueCard" in capabilities && capabilities.issueCard?.requested === true || "issueCardConsumer" in capabilities && capabilities.issueCardConsumer?.requested === true || "issueCardCommercial" in capabilities && capabilities.issueCardCommercial?.requested === true || "useCard" in capabilities && capabilities.useCard?.requested === true || "useCardConsumer" in capabilities && capabilities.useCardConsumer?.requested === true || "useCardCommercial" in capabilities && capabilities.useCardCommercial?.requested === true;
2958
- }
2959
- function requestingBanking(rootLegalEntity) {
2960
- const capabilities = rootLegalEntity?.capabilities ?? {};
2961
- return "issueBankAccount" in capabilities && capabilities.issueBankAccount?.requested === true || "sendToThirdParty" in capabilities && capabilities.sendToThirdParty?.requested === true || "receiveFromThirdParty" in capabilities && capabilities.receiveFromThirdParty?.requested === true;
2962
- }
2963
- const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
2964
- CountryCodes.Australia,
2965
- CountryCodes.Gibraltar,
2966
- CountryCodes.Guernsey,
2967
- CountryCodes.HongKong,
2968
- CountryCodes.Ireland,
2969
- CountryCodes.IsleOfMan,
2970
- CountryCodes.Jersey,
2971
- CountryCodes.Malta,
2972
- CountryCodes.PuertoRico,
2973
- CountryCodes.Spain,
2974
- CountryCodes.UnitedKingdom,
2975
- CountryCodes.UnitedStates
2976
- ];
2977
- const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [
2978
- CountryCodes.HongKong,
2979
- CountryCodes.PuertoRico,
2980
- CountryCodes.UnitedStates
2981
- ];
2982
- const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS = [
2983
- CountryCodes.HongKong
2984
- ];
2985
- const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
2986
- CountryCodes.Austria,
2987
- CountryCodes.Canada,
2988
- CountryCodes.Finland,
2989
- CountryCodes.Germany,
2990
- CountryCodes.Lithuania,
2991
- CountryCodes.Luxembourg,
2992
- CountryCodes.NewZealand,
2993
- CountryCodes.Poland,
2994
- CountryCodes.Sweden,
2995
- CountryCodes.Switzerland
2996
- ];
2997
- const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [
2998
- CountryCodes.Canada,
2999
- CountryCodes.UnitedStates
3000
- ];
3001
- const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS = [
3002
- CountryCodes.Germany
3003
- ];
3004
- const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
3005
- CountryCodes.Australia,
3006
- CountryCodes.Canada,
3007
- CountryCodes.Gibraltar,
3008
- CountryCodes.HongKong,
3009
- CountryCodes.NewZealand,
3010
- CountryCodes.PuertoRico,
3011
- CountryCodes.Singapore,
3012
- CountryCodes.UnitedStates,
3013
- CountryCodes.Guernsey,
3014
- CountryCodes.Jersey,
3015
- CountryCodes.IsleOfMan,
3016
- CountryCodes.Mexico,
3017
- CountryCodes.Brazil,
3018
- CountryCodes.Japan
3019
- ];
3020
- const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [
3021
- CountryCodes.Singapore
3022
- ];
3023
- const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
3024
- // strictly a subset of countries which use tax ID
3025
- // right now in all countries companies must provide a tax ID - but maybe there will be exemptions in future?
3026
- ];
3027
- const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS = [
3028
- // strictly a subset of countries which use tax ID
3029
- CountryCodes.Canada,
3030
- CountryCodes.PuertoRico,
3031
- CountryCodes.UnitedStates
3032
- ];
3033
- const COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION = [
3034
- CountryCodes.HongKong,
3035
- CountryCodes.Singapore
3036
- ];
3037
- const COUNTRIES_THAT_USES_UEN_OR_GST = [CountryCodes.Singapore];
3038
- const COUNTRIES_USING_COMPANY_SEARCH = [
3039
- CountryCodes.UnitedStates
3040
- ];
3041
- const COUNTRY_OF_GOVERNING_LAW_POSSIBLE = [
3042
- CountryCodes.UnitedKingdom
3043
- ];
3044
- const COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
3045
- CountryCodes.Austria,
3046
- CountryCodes.Belgium,
3047
- CountryCodes.Croatia,
3048
- CountryCodes.Cyprus,
3049
- CountryCodes.Estonia,
3050
- CountryCodes.Finland,
3051
- CountryCodes.France,
3052
- CountryCodes.Germany,
3053
- CountryCodes.Greece,
3054
- CountryCodes.Ireland,
3055
- CountryCodes.Italy,
3056
- CountryCodes.Latvia,
3057
- CountryCodes.Lithuania,
3058
- CountryCodes.Luxembourg,
3059
- CountryCodes.Malta,
3060
- CountryCodes.Netherlands,
3061
- CountryCodes.Portugal,
3062
- CountryCodes.Slovakia,
3063
- CountryCodes.Slovenia,
3064
- CountryCodes.Spain,
3065
- CountryCodes.UnitedKingdom
3066
- ];
3067
- const COUNTRIES_REQUIRING_E_INVOICING_CODE = [
3068
- /**
3069
- * @description These are the countries for which E-Invoicing code is a compliance requirement. There will be more in the future.
3070
- */
3071
- CountryCodes.Italy
3072
- ];
3073
- const COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 = [
3074
- CountryCodes.Australia
3075
- ];
3076
- const TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION = [
3077
- // The following countries are commented out just to make it more clear that these
3078
- // use tax id but since it's the same field as business registration we don't want
3079
- // to remove those here and have a bad ux. So instead in the map schema part
3080
- // we copy over the values to the taxinformation object
3081
- // CountryCodes.Estonia,
3082
- // CountryCodes.Finland,
3083
- // CountryCodes.France,
3084
- // CountryCodes.Latvia,
3085
- // CountryCodes.Lithuania,
3086
- // CountryCodes.Portugal,
3087
- // CountryCodes.Spain,
3088
- CountryCodes.Austria,
3089
- CountryCodes.Belgium,
3090
- CountryCodes.Croatia,
3091
- CountryCodes.Cyprus,
3092
- CountryCodes.Germany,
3093
- CountryCodes.Greece,
3094
- CountryCodes.Ireland,
3095
- CountryCodes.Italy,
3096
- CountryCodes.Luxembourg,
3097
- CountryCodes.Malta,
3098
- CountryCodes.Netherlands,
3099
- CountryCodes.Slovakia,
3100
- CountryCodes.Slovenia,
3101
- CountryCodes.UnitedKingdom
3102
- ];
3103
- function isUsingCompanySearch(country, taskType) {
3104
- return taskType === TaskTypes.BUSINESS_DETAILS && COUNTRIES_USING_COMPANY_SEARCH.includes(country);
3105
- }
3106
- const isRegistrationNumberAbsentStateV4Scenario = (country, entityType) => {
3107
- return country === CountryCodes.Australia && (entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || entityType === CompanyTypesValues.INCORPORATED_PARTNERSHIP) || country === CountryCodes.NewZealand;
3108
- };
3109
- const rules = ({
3110
- data,
3111
- defaultData,
3112
- country,
3113
- taskType,
3114
- isExperimentEnabled = () => false,
3115
- isSettingEnabled = () => false,
3116
- accountHolder,
3117
- rootLegalEntity,
3118
- tinMatched
3119
- }) => {
3120
- const countryRequiresDateOfIncorporationForCompanies = () => {
3121
- if (COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION.includes(country)) {
3122
- return "REQUIRED";
3123
- }
3124
- };
3125
- const countryRequiresFinancialInformation = () => {
3126
- if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
3127
- const isFinancialInformationExperimentEnabled = isExperimentEnabled(
3128
- "EnableFinancialInformationComponentV4"
3129
- );
3130
- const leType = rootLegalEntity?.type;
3131
- return isFinancialInformationRequired(
3132
- isFinancialInformationExperimentEnabled,
3133
- taskType,
3134
- country,
3135
- rootLegalEntity?.capabilities,
3136
- leType
3137
- );
3138
- }
3139
- };
3140
- return createFormRules({
3141
- requireDoingBusinessAsName: () => {
3142
- return data.additionalInformation?.hasDoingBusinessAs ? "REQUIRED" : void 0;
3143
- },
3144
- countryRequiresStateOrProvince: () => {
3145
- if (COUNTRIES_WITH_STATES_DATASET.includes(country)) {
3146
- return "REQUIRED";
3147
- }
3148
- },
3149
- ifPubliclyTradedCompany: () => {
3150
- if (data.companyStructure?.entityType === CompanyTypesValues.PUBLIC_COMPANY) {
3151
- return "REQUIRED";
3152
- }
3153
- },
3154
- countryUsesVat: () => {
3155
- if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
3156
- return data.additionalInformation?.exemptedFromVat ? "OPTIONAL" : "REQUIRED";
3157
- }
3158
- },
3159
- vatNumberType: () => {
3160
- if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
3161
- return "OPTIONAL";
3162
- }
3163
- },
3164
- isVatExempt: () => {
3165
- if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
3166
- return data.additionalInformation?.exemptedFromVat ? "REQUIRED" : "OPTIONAL";
3167
- }
3168
- },
3169
- countryUsesTaxId: () => {
3170
- const isExemptFromTax = Boolean(
3171
- data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax
3172
- );
3173
- if (TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country) && rootLegalEntity?.type === "organization" && // SOE-5931 - TODO: investigate L scenario returned to show this on the backend
3174
- keysOf(rootLegalEntity.capabilities ?? {}).includes("issueBankAccount")) {
3175
- return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
3176
- }
3177
- if (COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country) && !(taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country))) {
3178
- return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
3179
- }
3180
- },
3181
- companyRegistrationNumberExemptionAllowed: () => {
3182
- const isExemptFromRegistrationNumber = Boolean(
3183
- data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber
3184
- );
3185
- if (isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && isRegistrationNumberAbsentStateV4Scenario(country, data.companyStructure?.entityType)) {
3186
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
3187
- }
3188
- switch (taskType) {
3189
- case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
3190
- if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS.includes(country))
3191
- return;
3192
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
3193
- }
3194
- default: {
3195
- switch (country) {
3196
- case CountryCodes.Germany: {
3197
- if (data.companyStructure?.entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) {
3198
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
3199
- }
3200
- return;
3201
- }
3202
- case CountryCodes.Denmark: {
3203
- if (data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) {
3204
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
3205
- }
3206
- return;
3207
- }
3208
- // We're no longer collecting registration numbers for new HK entities, but for existing,
3209
- // we want to offer the exemption if they have a registration number attached. See OXP-7075
3210
- case CountryCodes.HongKong: {
3211
- if (country === CountryCodes.HongKong && !defaultData?.additionalInformation?.registrationNumber)
3212
- return;
3213
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
3214
- }
3215
- default: {
3216
- if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS.includes(country))
3217
- return;
3218
- return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
3219
- }
3220
- }
3221
- }
3222
- }
3223
- },
3224
- countryOfGoverningLawRequired: () => {
3225
- if (isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(data.basicInformation?.country)) {
3226
- return "REQUIRED";
3227
- }
3228
- },
3229
- countryRequiresRegistrationNumber: () => {
3230
- const isExemptFromRegistrationNumber = Boolean(
3231
- data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber
3232
- );
3233
- switch (taskType) {
3234
- case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
3235
- if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
3236
- if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS.includes(country)) {
3237
- return "OPTIONAL";
3238
- }
3239
- return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
3240
- }
3241
- default: {
3242
- if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
3243
- return "OPTIONAL";
3244
- }
3245
- if (country === CountryCodes.HongKong) {
3246
- if (!defaultData?.additionalInformation?.registrationNumber) return;
3247
- return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
3248
- }
3249
- if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) {
3250
- return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
3251
- }
3252
- }
3253
- }
3254
- },
3255
- registrationNumberType: () => {
3256
- switch (taskType) {
3257
- case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
3258
- if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
3259
- return "OPTIONAL";
3260
- }
3261
- default: {
3262
- if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
3263
- return "OPTIONAL";
3264
- }
3265
- if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
3266
- return "OPTIONAL";
3267
- }
3268
- }
3269
- },
3270
- countryUsesUenOrGst: () => {
3271
- if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
3272
- return;
3273
- }
3274
- if (COUNTRIES_THAT_USES_UEN_OR_GST.includes(country)) {
3275
- return "REQUIRED";
3276
- }
3277
- },
3278
- countryHasTaxExemptions: () => {
3279
- const isExemptFromTax = Boolean(
3280
- data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax
3281
- );
3282
- switch (taskType) {
3283
- case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
3284
- if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
3285
- return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
3286
- }
3287
- default: {
3288
- if (isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") {
3289
- return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
3290
- }
3291
- if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) {
3292
- return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
3293
- }
3294
- }
3295
- }
3296
- },
3297
- usingCompanySearch: () => {
3298
- if (isUsingCompanySearch(country, taskType)) {
3299
- return "REQUIRED";
3300
- }
3301
- },
3302
- countryRequiresFinancialInformation,
3303
- isDateOfIncorporationRequired: () => {
3304
- return countryRequiresDateOfIncorporationForCompanies() || countryRequiresFinancialInformation();
3305
- },
3306
- isFinancialReportingFieldsRequired: () => {
3307
- return countryRequiresFinancialInformation() === "REQUIRED" && isDateOlderThanAYear(data.additionalInformation?.dateOfIncorporation) ? "REQUIRED" : void 0;
3308
- },
3309
- isIndustryCodeRequired: () => {
3310
- const needsBusinessLine = requestingIssuing(rootLegalEntity) || requestingBanking(rootLegalEntity);
3311
- if (isSettingEnabled(SettingNames.AllowBusinessLines) && needsBusinessLine) {
3312
- return "REQUIRED";
3313
- }
3314
- },
3315
- annualTurnoverRequired: () => {
3316
- if (data.companyFinancialInformation?.reportedValueOption === "annualTurnover") {
3317
- return "REQUIRED";
3318
- }
3319
- },
3320
- balanceSheetTotalRequired: () => {
3321
- if (data.companyFinancialInformation?.reportedValueOption === "balanceSheetTotal") {
3322
- return "REQUIRED";
3323
- }
3324
- },
3325
- isEInvoicingCodeEnabled: () => {
3326
- if (isExperimentEnabled("EnableEInvoicingCodeField") && COUNTRIES_REQUIRING_E_INVOICING_CODE.includes(country)) {
3327
- return "REQUIRED";
3328
- }
3329
- },
3330
- ifCountryUsAndTinFailed: () => {
3331
- if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
3332
- return;
3333
- }
3334
- if (tinMatched === false && country === CountryCodes.UnitedStates) {
3335
- return "REQUIRED";
3336
- }
3337
- },
3338
- businessRequiresCompanyType: () => {
3339
- if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY) {
3340
- return "REQUIRED";
3341
- }
3342
- },
3343
- japaneseLegalCompanyName: () => {
3344
- if (isJapanLocalizationEnabled(isExperimentEnabled, country)) {
3345
- return "REQUIRED";
3346
- }
3347
- }
3348
- });
3349
- };
3350
3127
  const inferTaxIdNumberType = (taxInformation, country, companyType) => {
3351
3128
  if (!taxInformation) return void 0;
3352
3129
  const optionsForCountry = getTaxIdNumberOptions(country, companyType);
@@ -3482,7 +3259,7 @@ function TaxInformationField({
3482
3259
  entityType,
3483
3260
  defaultData
3484
3261
  }) {
3485
- const { isExperimentEnabled } = useExperimentsContext();
3262
+ const { isFeatureEnabled } = useToggleContext();
3486
3263
  const { t } = useTranslation("common");
3487
3264
  const { accountHolder } = useAccountHolder();
3488
3265
  const currentCountryTaxInformation = useMemo(
@@ -3492,7 +3269,7 @@ function TaxInformationField({
3492
3269
  const isUsSoleProp = country === "US" && entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP;
3493
3270
  const options = getTaxIdNumberOptions(country, entityType);
3494
3271
  const showTaxIdExemptedOptions = canExempt && (options?.length ?? 0) > 1 || isUsSoleProp;
3495
- const canSaveAbsentState = isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust";
3272
+ const canSaveAbsentState = isFeatureEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust";
3496
3273
  const exemptionLabel = isUsSoleProp ? t(($) => $["socialSecurityNumber"]) : labels.exemptedFromTax;
3497
3274
  const shouldRenderInput = isUsSoleProp ? currentCountryTaxInformation?.type === "EIN" : !data.isUen;
3498
3275
  const taxIdNumberType = useMemo(() => {
@@ -3691,31 +3468,27 @@ function TaxInformationField({
3691
3468
  }
3692
3469
  export {
3693
3470
  COUNTRY_OF_GOVERNING_LAW_POSSIBLE as C,
3471
+ DocumentGuidance as D,
3694
3472
  MemoizedDocumentUpload as M,
3695
3473
  StateCodesUS as S,
3696
3474
  TaxInformationField as T,
3697
3475
  taxInformationDefaultFieldConfig as a,
3698
- additionallIdNumberOptions as b,
3699
- taxIdNumberOptions as c,
3700
- TAX_INFORMATION_FIELD as d,
3701
- requestingIssuing as e,
3702
- getTaxInformationPlaceholderText as f,
3476
+ taxIdNumberOptions as b,
3477
+ TAX_INFORMATION_FIELD as c,
3478
+ requestingIssuing as d,
3479
+ getTaxInformationPlaceholderText as e,
3480
+ countryToTaxInfoTypeMap as f,
3703
3481
  getFieldsWithExistingData as g,
3704
- isUsingCompanySearch as h,
3705
- individualIdNumberOptions as i,
3706
- getCompanyRegistrationNumberOptions as j,
3707
- countryToTaxInfoTypeMap as k,
3708
- isRegistrationNumberAbsentStateV4Scenario as l,
3709
- getTaxIdNumberOptions as m,
3710
- COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT as n,
3711
- rules as o,
3712
- businessRegistrationNumberMasks as p,
3713
- businessRegistrationNumberPatterns as q,
3482
+ isRegistrationNumberAbsentStateV4Scenario as h,
3483
+ isUsingCompanySearch as i,
3484
+ getTaxIdNumberOptions as j,
3485
+ COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT as k,
3486
+ rules as l,
3487
+ businessRegistrationNumberMasks as m,
3488
+ businessRegistrationNumberPatterns as n,
3489
+ exemptedFromTaxDefaultFieldMetadata as o,
3490
+ exemptedFromTaxDefaultFieldConfig as p,
3714
3491
  requestingBanking as r,
3715
3492
  stateFormatGuidanceText as s,
3716
- taxInformationDefaultFieldMetadata as t,
3717
- getVatNumberOptions as u,
3718
- vatNumberOptions as v,
3719
- exemptedFromTaxDefaultFieldMetadata as w,
3720
- exemptedFromTaxDefaultFieldConfig as x
3493
+ taxInformationDefaultFieldMetadata as t
3721
3494
  };