@adyen/kyc-components 3.81.0 → 3.82.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-PDXa81vb.js → AcceptTermsOfServiceComponent-Do0w4uTc.js} +36 -10
  2. package/dist/{AccountSetupRejected-Du83gH0_.js → AccountSetupRejected-C7bZBsjo.js} +6 -4
  3. package/dist/Address-CX1FM8LF.js +1076 -0
  4. package/dist/Alert-DCYc9VpX.js +231 -0
  5. package/dist/{Avatar-Cd_8eqbA.js → Avatar-BaxjEBNy.js} +2 -2
  6. package/dist/BusinessDetailsDropin-yG7M7i9-.js +5088 -0
  7. package/dist/BusinessFinancingComponent-CZZcn51m.js +45 -0
  8. package/dist/{BusinessFinancingDropin-DioEfiqH.js → BusinessFinancingDropin-EfA32nOP.js} +43 -20
  9. package/dist/BusinessFinancingPage-Bb1dPIJF.js +40 -0
  10. package/dist/{BusinessTypeSelectionPage-uk6eDO5O.js → BusinessTypeSelectionPage-CjEomufR.js} +9 -5
  11. package/dist/Card-DsB6bxW-.js +145 -0
  12. package/dist/Confirm-X9nR52Md.js +64 -0
  13. package/dist/{ContractViewer-B2LwC3wV.js → ContractViewer-Byp71k2e.js} +33 -38
  14. package/dist/CountryField-DxBBjy81.js +864 -0
  15. package/dist/CreateIndividualComponent-Dyn173AJ.js +72 -0
  16. package/dist/CreateTransferInstrumentComponent-BT78AU6Z.js +67 -0
  17. package/dist/Currency-wsIZH1_j.js +238 -0
  18. package/dist/{CustomerSupport-C4n96PMt.js → CustomerSupport-B7VbKM8X.js} +10 -6
  19. package/dist/{DebugModal-CYO8HZDV.js → DebugModal-CZwhc_eY.js} +8 -5
  20. package/dist/{DecisionMakerDetailsPage-IT7x1ZRJ.js → DecisionMakerDetailsPage-Y7E2RfUW.js} +11 -4
  21. package/dist/{DecisionMakers-DkXmcSK4.js → DecisionMakers-DNepilyq.js} +224 -96
  22. package/dist/Dropzone-nt4AXJ-H.js +218 -0
  23. package/dist/{EmbeddedStatus-BS-fmZSm.js → EmbeddedStatus-D0gkDJMZ.js} +4 -4
  24. package/dist/{EndStateLayout-qrS2Eh-G.js → EndStateLayout-C2whNAgv.js} +2 -2
  25. package/dist/{FormFlow-BjHYz5-l.js → FormFlow-CRhuooj2.js} +8 -2
  26. package/dist/FormNavigation-BdFqTFAy.js +162 -0
  27. package/dist/{IndividualOnfidoDropin-B-y2VRFi.js → IndividualOnfidoDropin-BWM9aKLs.js} +2796 -64
  28. package/dist/InputDate-DydMc18N.js +43 -0
  29. package/dist/InputGroup-WBfGDV5F.js +32 -0
  30. package/dist/InputText-BCNFl9Ni.js +161 -0
  31. package/dist/{Introduction-CVSG_NSh.js → Introduction-1ZBVqCrd.js} +58 -4
  32. package/dist/LegalRepresentativeDetailsPage-B2yyvDKF.js +61 -0
  33. package/dist/Link-BGc9wGrL.js +35 -0
  34. package/dist/ManageIndividualComponent-CFvL5A-c.js +47 -0
  35. package/dist/ManageTermsOfServiceComponent-DTrzRxr1.js +47 -0
  36. package/dist/{ManageTransferInstrumentComponent-Byi222QQ.js → ManageTransferInstrumentComponent-B2cBS1y1.js} +25 -4
  37. package/dist/MaskedInput-DOTRZoSO.js +799 -0
  38. package/dist/MaybeModal-SjCkh5yq.js +25 -0
  39. package/dist/Modal-t5jbmZJu.js +136 -0
  40. package/dist/{OnboardingDropinComponent-CDK7PYx0.js → OnboardingDropinComponent-DegbZ_o6.js} +200 -41
  41. package/dist/PayoutDetailsDropin-58zkMbID.js +3694 -0
  42. package/dist/RadioGroup-Dkwl1v8z.js +143 -0
  43. package/dist/RegistrationAddress-DOqLUQEe.js +2334 -0
  44. package/dist/{Review-BCxsmMlz.js → Review-8WTYj81b.js} +8 -4
  45. package/dist/{RootBusinessDetailsPage-CIWtTZ1z.js → RootBusinessDetailsPage-FDWyaMpG.js} +65 -44
  46. package/dist/RootIndividualDetailsPage-SFgbb5Bk.js +77 -0
  47. package/dist/{SignPCIComponent-DzKFISwc.js → SignPCIComponent-bl7LzPjE.js} +17 -8
  48. package/dist/{SingpassSelection-ChRvdPZF.js → SingpassSelection-DukeaL-T.js} +6 -6
  49. package/dist/SoleProprietorshipPage-C-XJc7Iq.js +50 -0
  50. package/dist/{SourceOfFundsPage-DuUOdcam.js → SourceOfFundsPage-D-xLHf2C.js} +46 -24
  51. package/dist/Spacer-BK3jDget.js +18 -0
  52. package/dist/StepProgressIndicator-DHei86A6.js +78 -0
  53. package/dist/StoreProvider-B6-mwoeD.js +7072 -0
  54. package/dist/StructuredList-DaepaiVE.js +38 -0
  55. package/dist/{TaskItemStatus-DDwHsmh8.js → TaskItemStatus-BxzVEGbJ.js} +4 -3
  56. package/dist/{TaskStatusIndicator-Bmm2PsCZ.js → TaskStatusIndicator-Dfp2GcbN.js} +2 -2
  57. package/dist/TaxInformationField-r8gB7YBi.js +3062 -0
  58. package/dist/{TaxReportingDropin-kPcT1Kxt.js → TaxReportingDropin-5Lp9F8Ab.js} +25 -9
  59. package/dist/{TileGroup-BC8PSahf.js → TileGroup-jIldfSJ7.js} +4 -2
  60. package/dist/{TrustDetailsPage-lnVmcLSH.js → TrustDetailsPage-CjCSvds-.js} +506 -19
  61. package/dist/TrustMemberCompanyPage-Z6YT-R_a.js +60 -0
  62. package/dist/TrustMemberIndividualPage-qDN9m9Dv.js +66 -0
  63. package/dist/UnincorporatedPartnershipIndividualPage-iRZOCq2z.js +66 -0
  64. package/dist/UnincorporatedPartnershipMemberCompanyPage-9FlDLivA.js +64 -0
  65. package/dist/{ViewVerificationStatusComponent-D2V-RY2M.js → ViewVerificationStatusComponent-7D-3OVVA.js} +4 -3
  66. package/dist/adyen-business-financing.js +33 -22
  67. package/dist/adyen-individual.js +36 -27
  68. package/dist/adyen-kyc-components.js +28 -15
  69. package/dist/adyen-manage-individual.js +25 -26
  70. package/dist/adyen-manage-terms-of-service.js +26 -27
  71. package/dist/adyen-manage-transfer-instruments.js +40 -42
  72. package/dist/adyen-onboarding.js +3 -3
  73. package/dist/adyen-terms-of-service.js +41 -38
  74. package/dist/adyen-transfer-instrument.js +38 -29
  75. package/dist/adyen-verification-status.js +44 -36
  76. package/dist/analytics-CYiivYhI.js +61 -0
  77. package/dist/{bafinUtils-T6TnU7m4.js → bafinUtils-DSQnsLeT.js} +164 -10
  78. package/dist/basePatterns-BwdnMQxI.js +15 -0
  79. package/dist/bg-BG-CW9c658c.js +13 -0
  80. package/dist/bg-BG-CZ8v3rdy.js +30 -0
  81. package/dist/{bg-BG-Dlzl9Szn.js → bg-BG-D5192UVe.js} +1 -2
  82. package/dist/{bg-BG-NMIts2sa.js → bg-BG-QC5irNEG.js} +2 -4
  83. package/dist/commonValidators-CwkyFFVz.js +24 -0
  84. package/dist/{cs-CZ-BkyFDlAU.js → cs-CZ-DOqH0WeT.js} +1 -2
  85. package/dist/cs-CZ-Dx6momCa.js +30 -0
  86. package/dist/cs-CZ-dU9fnQ1g.js +13 -0
  87. package/dist/{cs-CZ-Csr_35T-.js → cs-CZ-t297LwYw.js} +2 -4
  88. package/dist/currency-BGwQyxBo.js +36 -0
  89. package/dist/{da-DK-B5KNtXL8.js → da-DK-B45X2VaJ.js} +1 -2
  90. package/dist/da-DK-BJ7aTPir.js +13 -0
  91. package/dist/{da-DK-Dm8o1giq.js → da-DK-BoQic3Gy.js} +2 -4
  92. package/dist/da-DK-D4H69PX3.js +30 -0
  93. package/dist/de-DE-C78RLE2G.js +13 -0
  94. package/dist/{de-DE-BA9tcpNQ.js → de-DE-CWvgMDqU.js} +1 -2
  95. package/dist/{de-DE-DMFaycio.js → de-DE-Dwagawx1.js} +2 -4
  96. package/dist/de-DE-wp5-H-ov.js +30 -0
  97. package/dist/dropinUtils-CkJv8r-0.js +192 -0
  98. package/dist/el-GR-BZRKurtr.js +13 -0
  99. package/dist/{el-GR-DIhHT2q_.js → el-GR-C3rkK_oc.js} +1 -2
  100. package/dist/el-GR-CK2heqPJ.js +30 -0
  101. package/dist/{el-GR-CGeBAkDN.js → el-GR-CxwhV-TX.js} +2 -4
  102. package/dist/emitEvent-CzZf80Am.js +28 -0
  103. package/dist/{en-US-DX4NHkX-.js → en-US-BbAzROHT.js} +2 -4
  104. package/dist/{en-US-TrwIHFh-.js → en-US-CAm3meB1.js} +1 -2
  105. package/dist/{en-US-SbE0c1gn.js → en-US-DIdQJky-.js} +1 -2
  106. package/dist/en-US.instructions-Ddr7AO05.js +22 -0
  107. package/dist/{es-ES-pXHx3ODy.js → es-ES-Bsoco8Fj.js} +2 -4
  108. package/dist/es-ES-BtUSEzkE.js +13 -0
  109. package/dist/{es-ES-RXwbiHjS.js → es-ES-DKCCgVF8.js} +1 -2
  110. package/dist/es-ES-Ds3-DtqZ.js +30 -0
  111. package/dist/et-EE-BCnK305R.js +13 -0
  112. package/dist/{et-EE-ZssIqWkO.js → et-EE-Bc6ioJRG.js} +1 -2
  113. package/dist/et-EE-Co-8akjV.js +30 -0
  114. package/dist/{et-EE-QLVnr6Vl.js → et-EE-DdGlUpaQ.js} +2 -4
  115. package/dist/{fi-FI-DT351N-G.js → fi-FI-ClnsYt3L.js} +2 -4
  116. package/dist/fi-FI-Cvar63RH.js +13 -0
  117. package/dist/fi-FI-DPNeTsJS.js +30 -0
  118. package/dist/{fi-FI-DmiggQEL.js → fi-FI-Hhku9Lmc.js} +1 -2
  119. package/dist/fieldConfigurations-CzZ2B1fa.js +458 -0
  120. package/dist/form-rules-DhbF2mY4.js +13 -0
  121. package/dist/fr-FR-B5543Fe-.js +13 -0
  122. package/dist/{fr-FR-N5wYE2BZ.js → fr-FR-BYuKsZIb.js} +1 -2
  123. package/dist/{fr-FR-BNXXNUX_.js → fr-FR-CJI0bIig.js} +2 -4
  124. package/dist/fr-FR-ChmNQciP.js +30 -0
  125. package/dist/getName-BkvLQ7My.js +41 -0
  126. package/dist/{hasDataChanged-e2EDb7Ni.js → hasDataChanged-B7dryhBQ.js} +2 -2
  127. package/dist/{hr-HR-B8AZ4eHJ.js → hr-HR-C0yWizOX.js} +2 -4
  128. package/dist/{hr-HR-5iwKtfgh.js → hr-HR-CPO5Yw2B.js} +1 -2
  129. package/dist/hr-HR-DqC8Cgs6.js +30 -0
  130. package/dist/hr-HR-ZreFlbK9.js +13 -0
  131. package/dist/hu-HU-B3BihdGh.js +13 -0
  132. package/dist/hu-HU-BOanVlKb.js +30 -0
  133. package/dist/{hu-HU-Aq1LsWah.js → hu-HU-mo_0ULJG.js} +1 -2
  134. package/dist/{hu-HU-DRi6Dz9U.js → hu-HU-wnSie9tz.js} +2 -4
  135. package/dist/iframeWidget-BfmN5KKM.js +234 -0
  136. package/dist/{payout-verification-instant-BIcnFP-p.js → instant-verification-Dvvkyfmp.js} +3 -3
  137. package/dist/isEmpty-CJ2g18ZH.js +23 -0
  138. package/dist/{it-IT-BeYbInCQ.js → it-IT-BeC2Y1F8.js} +2 -4
  139. package/dist/it-IT-Dd6xGSe-.js +13 -0
  140. package/dist/{it-IT-8DEagvb2.js → it-IT-Nl57jui-.js} +1 -2
  141. package/dist/it-IT-eCrTB65E.js +30 -0
  142. package/dist/ja-JP-BJljbFIZ.js +30 -0
  143. package/dist/{ja-JP-BhS-_dIx.js → ja-JP-CbgaW99b.js} +2 -2
  144. package/dist/{ja-JP-BGAJQs1g.js → ja-JP-D3oQAH7z.js} +1 -2
  145. package/dist/{ja-JP-C1OQ16fo.js → ja-JP-YoU7mNrK.js} +2 -4
  146. package/dist/ja-JP-iTbqSPNL.js +13 -0
  147. package/dist/keys-BpNgnAsD.js +23 -0
  148. package/dist/{localizeDateString-VqxvPF9j.js → localizeDateString-C4IzMd3y.js} +2 -2
  149. package/dist/{lt-LT-HZOWQKZT.js → lt-LT-CVasDmF3.js} +1 -2
  150. package/dist/lt-LT-DE-4IXNG.js +13 -0
  151. package/dist/{lt-LT-_MzAcXJo.js → lt-LT-DIe4cKlu.js} +2 -4
  152. package/dist/lt-LT-DckQGgoT.js +30 -0
  153. package/dist/lv-LV-CeivEZms.js +13 -0
  154. package/dist/lv-LV-DP9oRTFv.js +30 -0
  155. package/dist/{lv-LV-CRhXAjn6.js → lv-LV-DXgW5zWl.js} +2 -4
  156. package/dist/{lv-LV-F-Z4lDCV.js → lv-LV-Sbsv8-nD.js} +1 -2
  157. package/dist/{payout-verification-manual-DH9-DdlZ.js → manual-verification-BvZWqA00.js} +3 -3
  158. package/dist/mapExistingFile-D8NcT-or.js +231 -0
  159. package/dist/mapScriptLocalization-DBcq31SQ.js +72 -0
  160. package/dist/mapTransferInstrumentToPayoutAccount-CijqOJMZ.js +30 -0
  161. package/dist/{nl-NL-C-xUU2N3.js → nl-NL-BHkRnVrj.js} +1 -2
  162. package/dist/{nl-NL-Dbx0ZmI7.js → nl-NL-Cysslsh2.js} +2 -4
  163. package/dist/nl-NL-D2QKudfh.js +30 -0
  164. package/dist/nl-NL-DVENFpd5.js +13 -0
  165. package/dist/no-NO-C_snYWBc.js +30 -0
  166. package/dist/no-NO-Dn2UkdoI.js +13 -0
  167. package/dist/{no-NO-47ncaBZY.js → no-NO-kaAdT9B8.js} +1 -2
  168. package/dist/{no-NO-C0sfkp82.js → no-NO-zSnPtrDi.js} +2 -4
  169. package/dist/pl-PL-CQ6c2Qz_.js +30 -0
  170. package/dist/{pl-PL-CZLzkboH.js → pl-PL-DD8JN4Qf.js} +1 -2
  171. package/dist/pl-PL-DFAzuceF.js +13 -0
  172. package/dist/{pl-PL-DAPGaxWi.js → pl-PL-UB5J5JcB.js} +2 -4
  173. package/dist/pt-PT-C-hbNnsB.js +30 -0
  174. package/dist/{pt-PT-BY9rcwcF.js → pt-PT-CjsyP_OK.js} +2 -4
  175. package/dist/{pt-PT-CN4ws8N7.js → pt-PT-Xm-pm3mb.js} +1 -2
  176. package/dist/pt-PT-_o5xgnxS.js +13 -0
  177. package/dist/{resolveEnvironment-CDg6ksvB.js → resolveEnvironment-94mV6qts.js} +3 -3
  178. package/dist/ro-RO-BrTWk1Ui.js +30 -0
  179. package/dist/{ro-RO-RylOvc5g.js → ro-RO-C3m6aJVP.js} +1 -2
  180. package/dist/{ro-RO-DJLWmWZ4.js → ro-RO-C8yYXQc_.js} +2 -4
  181. package/dist/ro-RO-D7c_Rj8V.js +13 -0
  182. package/dist/{rules-BnJSV_NR.js → rules-D9wLpDnS.js} +5 -2
  183. package/dist/sk-SK-BBSuh2fA.js +13 -0
  184. package/dist/sk-SK-BTFtoPmI.js +30 -0
  185. package/dist/{sk-SK-BfJKbtGy.js → sk-SK-BVc-vNQm.js} +1 -2
  186. package/dist/{sk-SK-B7o3L57C.js → sk-SK-DbOE9C6n.js} +2 -4
  187. package/dist/sl-SI-BLTuWNf5.js +13 -0
  188. package/dist/sl-SI-BhVTSmhQ.js +30 -0
  189. package/dist/{sl-SI-C8CMAkD0.js → sl-SI-Br0UEUPL.js} +2 -4
  190. package/dist/{sl-SI-DklUFzaY.js → sl-SI-D_rqR0D7.js} +1 -2
  191. package/dist/style.css +3272 -3254
  192. package/dist/styles-CLV89_hH.js +3272 -3254
  193. package/dist/sv-SE-66rqYTxi.js +30 -0
  194. package/dist/{sv-SE-qduyDIzY.js → sv-SE-B3zoXMuH.js} +1 -2
  195. package/dist/sv-SE-BUfESAQK.js +13 -0
  196. package/dist/{sv-SE-Bwh0wKFk.js → sv-SE-BtXmvxx4.js} +2 -4
  197. package/dist/translation-BxcrjuWb.js +472 -0
  198. package/dist/types/api/industryCodes/industryCodes.types.d.ts +2 -0
  199. package/dist/types/api/industryCodes/useIndustryCodes.d.ts +6 -0
  200. package/dist/types/api/queryKeys.d.ts +2 -1
  201. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +1 -0
  202. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +3 -3
  203. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +0 -9
  204. package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +0 -1
  205. package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +6 -0
  206. package/dist/types/components/Business/forms/rules.d.ts +1 -3
  207. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -2
  208. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiform.d.ts +1 -1
  209. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/ServiceAgreementDropin.d.ts +1 -1
  210. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +1 -0
  211. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +0 -1
  212. package/dist/types/components/EmbeddedDropins/AcceptTermsOfServiceComponent/AcceptTermsOfServiceComponent.d.ts +4 -3
  213. package/dist/types/components/Individual/forms/Individual/Individual.d.ts +4 -0
  214. package/dist/types/components/Individual/forms/Individual/ProofOfRelationship/types.d.ts +0 -5
  215. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +1 -1
  216. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  217. package/dist/types/components/Trust/forms/Trust/Trust.d.ts +1 -0
  218. package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +1 -2
  219. package/dist/types/components/Trust/tasks/TrustMembers/TrustMembersOverview.d.ts +2 -1
  220. package/dist/types/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberCompanyPage.d.ts +2 -1
  221. package/dist/types/components/ui/atoms/ActionsMenu/ActionsMenu.d.ts +2 -1
  222. package/dist/types/components/ui/atoms/Button/Button.types.d.ts +3 -3
  223. package/dist/types/components/ui/atoms/ListItem/ListItem.d.ts +2 -1
  224. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +0 -14
  225. package/dist/types/components/ui/atoms/RadioWithLabel/RadioWithLabel.d.ts +2 -1
  226. package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -0
  227. package/dist/types/components/ui/atoms/StepProgressIndicator/StepProgressIndicator.d.ts +2 -1
  228. package/dist/types/components/ui/atoms/StructuredList/StructuredList.d.ts +2 -1
  229. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +0 -12
  230. package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +3 -2
  231. package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +1 -1
  232. package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +2 -1
  233. package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +2 -1
  234. package/dist/types/components/ui/molecules/InputEmail/InputEmail.d.ts +2 -1
  235. package/dist/types/components/ui/molecules/InputGroup/InputGroup.d.ts +2 -1
  236. package/dist/types/components/ui/molecules/InputTelephone/InputTelephone.d.ts +2 -1
  237. package/dist/types/components/ui/molecules/InputText/InputText.d.ts +2 -0
  238. package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +0 -1
  239. package/dist/types/components/ui/molecules/Tabs/Tabs.d.ts +1 -1
  240. package/dist/types/context/StateContext/types.d.ts +1 -1
  241. package/dist/types/core/models/api/accountIdentification.d.ts +5 -4
  242. package/dist/types/core/models/api/contracts.d.ts +1 -1
  243. package/dist/types/core/process-field-configurations.d.ts +14 -3
  244. package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +1 -1
  245. package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +1 -5
  246. package/dist/types/embeds/emitEvent.d.ts +14 -0
  247. package/dist/types/embeds/individual/adyen-individual.types.d.ts +2 -2
  248. package/dist/types/embeds/manage-individual/AdyenManageIndividual.d.ts +1 -1
  249. package/dist/types/embeds/manage-individual/adyen-manage-individual.types.d.ts +1 -1
  250. package/dist/types/embeds/manage-terms-of-service/AdyenManageTermsOfService.d.ts +1 -1
  251. package/dist/types/embeds/manage-terms-of-service/adyen-manage-terms-of-service.types.d.ts +1 -1
  252. package/dist/types/embeds/manage-transfer-instruments/AdyenManageTransferInstrument.d.ts +3 -4
  253. package/dist/types/embeds/manage-transfer-instruments/adyen-manage-transfer-instruments.types.d.ts +3 -4
  254. package/dist/types/embeds/terms-of-service/adyen-terms-of-service.types.d.ts +4 -3
  255. package/dist/types/embeds/transfer-instrument/adyen-transfer-instrument.types.d.ts +2 -2
  256. package/dist/types/embeds/verification-status/adyen-verification-status.types.d.ts +3 -3
  257. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +2 -1
  258. package/dist/types/hooks/introduction/useShouldShowIntroduction.d.ts +2 -1
  259. package/dist/types/language/utils.d.ts +1 -1
  260. package/dist/types/utils/addLinkedFields.d.ts +7 -1
  261. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  262. package/dist/types/utils/formUtils.d.ts +1 -1
  263. package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -1
  264. package/dist/types/utils/getName.d.ts +1 -1
  265. package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
  266. package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +5 -0
  267. package/dist/types/utils/translation.d.ts +6 -0
  268. package/dist/types-CAznNNSI.js +160 -0
  269. package/dist/types-DAyrP-xk.js +64 -0
  270. package/dist/types-Da02-5C7.js +74 -0
  271. package/dist/useAssociatedLegalEntity-Bw8j7jsT.js +33 -0
  272. package/dist/useDataset-BLJa9WLi.js +120 -0
  273. package/dist/useForm-CiqZ15MF.js +1694 -0
  274. package/dist/useFormContext-beqGS11A.js +23 -0
  275. package/dist/useGlobalData-DRn0XQ0c.js +205 -0
  276. package/dist/{useMultiForm-Cbf_MGdG.js → useMultiForm-B2RH71uE.js} +4 -2
  277. package/dist/{useOnboardingStatus-bmHIDRGr.js → useOnboardingStatus-D1idaeSA.js} +2 -2
  278. package/dist/useScenarios-MJLlpy2B.js +46 -0
  279. package/dist/{useTermsOfServiceStatus-CMtyaC84.js → useTermsOfServiceStatus-YnguYeSj.js} +2 -2
  280. package/dist/useToastContext-BBdhLX_K.js +51 -0
  281. package/dist/useUnincorporatedPartnershipMembers-TCYzsxr-.js +99 -0
  282. package/dist/utils-Bw6dVL0x.js +29 -0
  283. package/dist/{utils-B-s8erbM.js → utils-CMkU9dq6.js} +46 -4
  284. package/dist/utils-DNSfZiio.js +70 -0
  285. package/dist/utils-Drt88lUg.js +159 -0
  286. package/dist/validate-BacCnDiH.js +382 -0
  287. package/dist/{validate-CNlNB2Sq.js → validate-BlPEAs8d.js} +2 -2
  288. package/dist/validate-DQ_IsigQ.js +605 -0
  289. package/dist/validationError-eJqGwKE_.js +86 -0
  290. package/package.json +44 -45
  291. package/dist/BusinessDetailsDropin-DR8YA-wz.js +0 -2136
  292. package/dist/BusinessFinancingComponent-saZxipq7.js +0 -38
  293. package/dist/BusinessFinancingPage-D7NMT1SV.js +0 -35
  294. package/dist/CreateIndividualComponent-B_6j8j5H.js +0 -64
  295. package/dist/CreateTransferInstrumentComponent-DgZq6f2m.js +0 -55
  296. package/dist/LegalRepresentativeDetailsPage-R9h6n8e1.js +0 -55
  297. package/dist/ManageIndividualComponent-D3EZWpKz.js +0 -42
  298. package/dist/ManageTermsOfServiceComponent-C2BMpyzo.js +0 -40
  299. package/dist/RootIndividualDetailsPage-DGpYhDWo.js +0 -71
  300. package/dist/SoleProprietorshipPage-CF_TKUfD.js +0 -44
  301. package/dist/StoreProvider-pdSV8sgb.js +0 -31920
  302. package/dist/TrustMemberCompanyPage-6_h3PnmT.js +0 -54
  303. package/dist/TrustMemberIndividualPage-DPlQ6OnQ.js +0 -60
  304. package/dist/UnincorporatedPartnershipIndividualPage-Bgcip8u6.js +0 -60
  305. package/dist/UnincorporatedPartnershipMemberCompanyPage-k5Cc0TWw.js +0 -57
  306. package/dist/VerificationErrorAlert-BEgXW4gA.js +0 -77
  307. package/dist/bg-BG-BvSUDgGF.js +0 -13
  308. package/dist/cs-CZ-y4mvq4Lv.js +0 -13
  309. package/dist/da-DK-qgQOVjDp.js +0 -13
  310. package/dist/de-DE-pSdsxBpQ.js +0 -13
  311. package/dist/el-GR-Bvjk5Sw8.js +0 -13
  312. package/dist/en-US-Bq2Twy6x.js +0 -54
  313. package/dist/es-ES-Dy1uR2H_.js +0 -13
  314. package/dist/et-EE-d9V24rcf.js +0 -13
  315. package/dist/fi-FI-B0fnAFV2.js +0 -13
  316. package/dist/fr-FR-BoKzVp2q.js +0 -13
  317. package/dist/getFieldsWithExistingData-BPKk0HGd.js +0 -22
  318. package/dist/hr-HR-CF0AHQzi.js +0 -13
  319. package/dist/hu-HU-CSPhOvLC.js +0 -13
  320. package/dist/it-IT-BH-eqIKH.js +0 -13
  321. package/dist/ja-JP-B3yqM_FM.js +0 -13
  322. package/dist/lt-LT-Lzl_Cbw-.js +0 -13
  323. package/dist/lv-LV-y00wN1pj.js +0 -13
  324. package/dist/mapFinancialReportsToFinancialInformation-iVvcsDNu.js +0 -66
  325. package/dist/mapScriptLocalization-H2Re3k5X.js +0 -35
  326. package/dist/nl-NL-DmnFXAQC.js +0 -13
  327. package/dist/no-NO-DbvFfP96.js +0 -13
  328. package/dist/pl-PL--mmxopYA.js +0 -13
  329. package/dist/pt-PT-BVzXBFp7.js +0 -13
  330. package/dist/ro-RO-Cdmevo9A.js +0 -13
  331. package/dist/ru-RU-FZb2upqh.js +0 -13
  332. package/dist/sk-SK-nfeuTcY5.js +0 -13
  333. package/dist/sl-SI-DUTZDqkP.js +0 -13
  334. package/dist/sv-SE-BTx2XKAp.js +0 -13
  335. package/dist/useUpdateLegalEntity-D91nO-DU.js +0 -57
  336. package/dist/validate-DhvbSKV4.js +0 -40
  337. package/dist/zh-CN-wUb4MmTZ.js +0 -13
  338. package/dist/zh-TW-DNTXHLKa.js +0 -13
@@ -0,0 +1,2334 @@
1
+ ;
2
+ {
3
+ try {
4
+ let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9c30df7a-d45f-4d71-8cb5-297fa2ae0ee4", e._sentryDebugIdIdentifier = "sentry-dbid-9c30df7a-d45f-4d71-8cb5-297fa2ae0ee4");
6
+ } catch (e) {
7
+ }
8
+ }
9
+ ;
10
+ import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
11
+ import { memo } from "preact/compat";
12
+ import { af as objectsDeepEqual, a as useTranslation, y as LegalEntityTypes, a8 as CountryCodes, X as useExperimentsContext } from "./StoreProvider-B6-mwoeD.js";
13
+ import { M as MemoizedDocumentUpload, k as getCompanyRegistrationNumberOptions, s as stateFormatGuidanceText, m as businessRegistrationNumberMasks, n as businessRegistrationNumberPatterns, v as vatNumberOptions, o as getVatNumberOptions } from "./TaxInformationField-r8gB7YBi.js";
14
+ import { F as Field, C as Checkbox, a as useForm } from "./useForm-CiqZ15MF.js";
15
+ import { m as makeMask, n as numericInputs, s as spacer, M as MaskedInput, a as nonInputs, b as alphaInputs, d as alphanumericInputs } from "./MaskedInput-DOTRZoSO.js";
16
+ import { useMemo, useCallback, useEffect, useRef } from "preact/hooks";
17
+ import { R as RadioGroup } from "./RadioGroup-Dkwl1v8z.js";
18
+ import { C as CompanyTypesValues } from "./bafinUtils-DSQnsLeT.js";
19
+ import { f as validatePatternOnBlur, c as validateNotEmptyOnBlur, C as ContextGuidance } from "./fieldConfigurations-CzZ2B1fa.js";
20
+ import { I as InputText } from "./InputText-BCNFl9Ni.js";
21
+ import { u as uppercase } from "./mapExistingFile-D8NcT-or.js";
22
+ import { createElement } from "preact";
23
+ import { f as getFormProps, F as FormHeader, E as ErrorPanel, c as createFormUtils } from "./CountryField-DxBBjy81.js";
24
+ import { S as StateContextSetter } from "./validate-DQ_IsigQ.js";
25
+ import { o as operationalAddressIsSameIds, A as Address, h as operationalAddressIsSameItems } from "./Address-CX1FM8LF.js";
26
+ const ConstitutionalDocumentTypes = {
27
+ BUSINESS_NAME_FILING: "doingBusinessAsNameFiling",
28
+ TAX_FILING: "taxFiling",
29
+ EMPLOYER_IDENTIFICATION_NUMBER_VERIFICATION_LETTER: "einVerificationLetter",
30
+ BUSINESS_REGISTRATION_DOCUMENT: "businessRegistrationDocument",
31
+ TRUST_DEED: "trustDeed",
32
+ TRUST_INSTRUMENT: "trustInstrument",
33
+ PARTNERSHIP_AGREEMENT: "partnershipAgreement",
34
+ MEETING_MINUTES: "meetingMinutes"
35
+ };
36
+ const getConstitutionDocumentTypeOptionsMapping = (legalEntityType, country) => {
37
+ switch (legalEntityType) {
38
+ case LegalEntityTypes.SOLE_PROPRIETORSHIP:
39
+ switch (country) {
40
+ case "FR":
41
+ return [
42
+ {
43
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
44
+ name: "doingBusinessAsNameFiling__FR"
45
+ },
46
+ { id: ConstitutionalDocumentTypes.TAX_FILING, name: "taxFiling" },
47
+ {
48
+ id: ConstitutionalDocumentTypes.BUSINESS_REGISTRATION_DOCUMENT,
49
+ name: "businessRegistrationDocument__FR"
50
+ }
51
+ ];
52
+ case "US":
53
+ return [
54
+ {
55
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
56
+ name: "doingBusinessAsNameFiling__US"
57
+ },
58
+ { id: ConstitutionalDocumentTypes.TAX_FILING, name: "taxFiling__US" },
59
+ {
60
+ id: ConstitutionalDocumentTypes.EMPLOYER_IDENTIFICATION_NUMBER_VERIFICATION_LETTER,
61
+ name: "einVerificationLetter"
62
+ }
63
+ ];
64
+ default:
65
+ return [
66
+ {
67
+ id: ConstitutionalDocumentTypes.BUSINESS_NAME_FILING,
68
+ name: "doingBusinessAsNameFiling"
69
+ },
70
+ { id: ConstitutionalDocumentTypes.TAX_FILING, name: "taxFiling" }
71
+ ];
72
+ }
73
+ case LegalEntityTypes.UNINCORPORATED_PARTNERSHIP:
74
+ return [
75
+ {
76
+ id: ConstitutionalDocumentTypes.PARTNERSHIP_AGREEMENT,
77
+ name: "partnershipAgreement"
78
+ },
79
+ {
80
+ id: ConstitutionalDocumentTypes.MEETING_MINUTES,
81
+ name: "meetingMinutes"
82
+ }
83
+ ];
84
+ default:
85
+ return [
86
+ { id: ConstitutionalDocumentTypes.TRUST_DEED, name: "trustDeed" },
87
+ { id: ConstitutionalDocumentTypes.TRUST_INSTRUMENT, name: "trustInstrument" }
88
+ ];
89
+ }
90
+ };
91
+ function getLegalEntityTypeBasedConstitutionalDocumentHeaderDescriptionTranslationkey(legalEntityType) {
92
+ switch (legalEntityType) {
93
+ case LegalEntityTypes.SOLE_PROPRIETORSHIP:
94
+ return "constitutionalDocumentSoleProprietorshipHeaderDescription";
95
+ case LegalEntityTypes.TRUST:
96
+ return "constitutionalDocumentTrustHeaderDescription";
97
+ case LegalEntityTypes.UNINCORPORATED_PARTNERSHIP:
98
+ return "constitutionalDocumentUnincorporatedPartnershipDescription";
99
+ default:
100
+ return "constitutionalDocumentHeaderDescription";
101
+ }
102
+ }
103
+ const unincorporatedPartnershipRequirementsVariants = ["Name", "Details", "UpToDate"];
104
+ function ConstitutionalDocumentUpload({
105
+ id,
106
+ legalEntityType,
107
+ ...props
108
+ }) {
109
+ const { t } = useTranslation("common");
110
+ const isUnincorporatedPartnership = legalEntityType === LegalEntityTypes.UNINCORPORATED_PARTNERSHIP;
111
+ const constitutionalDocumentRequirements = getConstitutionDocumentTypeOptionsMapping(
112
+ legalEntityType,
113
+ props.country
114
+ );
115
+ const guidanceContent = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-upload-field__guidance adyen-kyc-u-margin-bottom-24", children: [
116
+ /* @__PURE__ */ jsx("strong", { children: t(($) => $["uploadOneOfTheseDocuments"]) }),
117
+ /* @__PURE__ */ jsx("ul", { children: constitutionalDocumentRequirements?.map(({ name }, i) => /* @__PURE__ */ jsx("li", { children: t(($) => $[name]) }, i)) }),
118
+ isUnincorporatedPartnership && /* @__PURE__ */ jsxs(Fragment, { children: [
119
+ /* @__PURE__ */ jsx("strong", { children: t(($) => $["documentRequirements"]) }),
120
+ /* @__PURE__ */ jsx("ul", { children: unincorporatedPartnershipRequirementsVariants.map((item, i) => /* @__PURE__ */ jsx("li", { children: t(
121
+ ($) => $[`documentRequirementsUnincorporatedPartnership${item}`]
122
+ ) }, i)) })
123
+ ] }),
124
+ props.country !== "US" && !isUnincorporatedPartnership && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-u-margin-y-16", children: /* @__PURE__ */ jsxs("span", { children: [
125
+ t(($) => $["infoInUploadedDocumentIsTrue"]),
126
+ " "
127
+ ] }) })
128
+ ] });
129
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
130
+ MemoizedDocumentUpload,
131
+ {
132
+ ...props,
133
+ documentType: "constitutionalDocument",
134
+ documentField: "constitutionalDocument",
135
+ heading: t(($) => $["constitutionalDocumentHeader"]),
136
+ description: t(
137
+ ($) => $[getLegalEntityTypeBasedConstitutionalDocumentHeaderDescriptionTranslationkey(
138
+ legalEntityType
139
+ )]
140
+ ),
141
+ guidanceContent,
142
+ id,
143
+ hidePageCount: true
144
+ }
145
+ ) });
146
+ }
147
+ const MemoizedConstitutionalDocument = memo(
148
+ ConstitutionalDocumentUpload,
149
+ (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.shouldValidate === nextProps.shouldValidate
150
+ );
151
+ function CompanyRegistrationNumberTypeSelector({
152
+ country,
153
+ companyType,
154
+ selected,
155
+ setSelected,
156
+ exemptedOption
157
+ }) {
158
+ const { t } = useTranslation("common");
159
+ const options = useMemo(() => {
160
+ const availableOptions = getCompanyRegistrationNumberOptions(country, companyType) ?? [];
161
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
162
+ return [
163
+ ...availableOptions,
164
+ {
165
+ id: "exempted",
166
+ name: exemptedOption
167
+ }
168
+ ];
169
+ }, [companyType, country, exemptedOption]);
170
+ const handleSelect = useCallback(
171
+ (selectedStr) => {
172
+ const newSelected = selectedStr;
173
+ if (newSelected === "exempted") {
174
+ if (exemptedOption) {
175
+ setSelected(newSelected);
176
+ }
177
+ return;
178
+ }
179
+ setSelected(newSelected);
180
+ },
181
+ [exemptedOption, setSelected]
182
+ );
183
+ useEffect(() => {
184
+ if (options.length > 0 && (!selected || !options.some((option) => option.id === selected))) {
185
+ if (selected === "exempted") return;
186
+ setSelected(options[0].id);
187
+ }
188
+ }, [options, selected, setSelected]);
189
+ if (options.length <= 1) return null;
190
+ return /* @__PURE__ */ jsx(
191
+ Field,
192
+ {
193
+ el: "fieldset",
194
+ name: "companyRegistrationNumberType",
195
+ label: t(($) => $["whichTypeOfRegistrationNumberDoYouHave"]),
196
+ children: (childProps) => /* @__PURE__ */ jsx(
197
+ RadioGroup,
198
+ {
199
+ ...childProps,
200
+ name: "companyRegistrationNumberType",
201
+ items: options,
202
+ value: selected,
203
+ onChange: handleSelect
204
+ }
205
+ )
206
+ }
207
+ );
208
+ }
209
+ const registrationNumberDefaultFieldMetadata = {
210
+ label: "registrationNumber"
211
+ };
212
+ const registrationNumberDefaultFieldConfig = {
213
+ [CountryCodes.Australia]: ({ companyType }) => {
214
+ if (companyType === CompanyTypesValues.INCORPORATED_ASSOCIATION) {
215
+ return {
216
+ label: "incorporatedAssociationRegistrationNumber",
217
+ mask: businessRegistrationNumberMasks[CountryCodes.Australia].associationIncorporated,
218
+ validators: validatePatternOnBlur(
219
+ businessRegistrationNumberPatterns[CountryCodes.Australia].associationIncorporated
220
+ ),
221
+ helperText: "findYourIncorporatedAssociationNumberInThePublicRegistryForYourState",
222
+ guidanceText: {
223
+ key: "enterXToYCharactersForExample",
224
+ values: {
225
+ minChars: "3",
226
+ maxChars: "20",
227
+ example: "200312345A"
228
+ }
229
+ }
230
+ };
231
+ }
232
+ return {
233
+ label: "australianBusinessNumberAcn",
234
+ mask: businessRegistrationNumberMasks[CountryCodes.Australia].default,
235
+ validators: validatePatternOnBlur(
236
+ businessRegistrationNumberPatterns[CountryCodes.Australia].default
237
+ ),
238
+ guidanceText: {
239
+ key: "enterNDigitsForExample",
240
+ values: {
241
+ numDigits: "9",
242
+ example: "123 456 789"
243
+ }
244
+ }
245
+ };
246
+ },
247
+ [CountryCodes.Austria]: ({ registrationNumberType }) => registrationNumberType === "ZVR" ? {
248
+ label: "zentralesVereinsregisterId",
249
+ mask: businessRegistrationNumberMasks[CountryCodes.Austria].ZVR,
250
+ validators: validatePatternOnBlur(
251
+ businessRegistrationNumberPatterns[CountryCodes.Austria].ZVR
252
+ ),
253
+ guidanceText: {
254
+ key: "enterTheRemainingNDigitsForExample",
255
+ values: {
256
+ numDigits: "9-10",
257
+ example: "AT-ZVR-555769679"
258
+ }
259
+ }
260
+ } : {
261
+ label: "firmenbuchnummer",
262
+ mask: businessRegistrationNumberMasks[CountryCodes.Austria].firmenbuchnummer,
263
+ validators: validatePatternOnBlur(
264
+ businessRegistrationNumberPatterns[CountryCodes.Austria].firmenbuchnummer
265
+ ),
266
+ guidanceText: {
267
+ key: "enterAMaximumOfNCharactersWithAMixForExample",
268
+ values: {
269
+ maxChars: "9",
270
+ example: "T1001a, FN89060n"
271
+ }
272
+ }
273
+ },
274
+ [CountryCodes.Belgium]: {
275
+ label: "enterpriseNumber",
276
+ mask: businessRegistrationNumberMasks[CountryCodes.Belgium].default,
277
+ validators: validatePatternOnBlur(
278
+ businessRegistrationNumberPatterns[CountryCodes.Belgium].default
279
+ ),
280
+ guidanceText: {
281
+ key: "enterNDigitsForExample",
282
+ values: {
283
+ numDigits: "10",
284
+ example: "1234567890"
285
+ }
286
+ }
287
+ },
288
+ [CountryCodes.Brazil]: {
289
+ label: "CNPJ",
290
+ mask: businessRegistrationNumberMasks[CountryCodes.Brazil].default,
291
+ validators: validatePatternOnBlur(
292
+ businessRegistrationNumberPatterns[CountryCodes.Brazil].default
293
+ ),
294
+ guidanceText: {
295
+ key: "enterNDigitsForExample",
296
+ values: {
297
+ numDigits: "14",
298
+ example: "28.773.626/8318-21"
299
+ }
300
+ }
301
+ },
302
+ [CountryCodes.Bulgaria]: {
303
+ label: "uniqueIdentificationCode",
304
+ mask: businessRegistrationNumberMasks[CountryCodes.Bulgaria].default,
305
+ validators: validatePatternOnBlur(
306
+ businessRegistrationNumberPatterns[CountryCodes.Bulgaria].default
307
+ ),
308
+ guidanceText: {
309
+ key: "enterNDigitsForExample",
310
+ values: {
311
+ numDigits: "9",
312
+ example: "812114069"
313
+ }
314
+ }
315
+ },
316
+ [CountryCodes.Canada]: {
317
+ label: "businessIncorporationNumber",
318
+ mask: businessRegistrationNumberMasks[CountryCodes.Canada].default,
319
+ validators: validatePatternOnBlur(
320
+ businessRegistrationNumberPatterns[CountryCodes.Canada].default
321
+ ),
322
+ guidanceText: {
323
+ key: "enterXToYCharactersForExample",
324
+ values: {
325
+ minChars: "5",
326
+ maxChars: "10",
327
+ example: "BC1234567"
328
+ }
329
+ }
330
+ },
331
+ [CountryCodes.Croatia]: ({ companyType }) => {
332
+ switch (companyType) {
333
+ case CompanyTypesValues.SOLE_PROPRIETORSHIP:
334
+ return {
335
+ label: "MBO",
336
+ mask: businessRegistrationNumberMasks[CountryCodes.Croatia].soleProprietorship,
337
+ validators: validatePatternOnBlur(
338
+ businessRegistrationNumberPatterns[CountryCodes.Croatia].soleProprietorship
339
+ ),
340
+ guidanceText: {
341
+ key: "enterNDigitsForExample",
342
+ values: {
343
+ numDigits: "8",
344
+ example: "12345678"
345
+ }
346
+ }
347
+ };
348
+ default:
349
+ return {
350
+ label: "MBS",
351
+ mask: businessRegistrationNumberMasks[CountryCodes.Croatia].default,
352
+ validators: validatePatternOnBlur(
353
+ businessRegistrationNumberPatterns[CountryCodes.Croatia].default
354
+ ),
355
+ guidanceText: {
356
+ key: "enterNDigitsForExample",
357
+ values: {
358
+ numDigits: "9",
359
+ example: "080020970"
360
+ }
361
+ }
362
+ };
363
+ }
364
+ },
365
+ [CountryCodes.Cyprus]: {
366
+ label: "cyRegistrationNumber",
367
+ mask: businessRegistrationNumberMasks[CountryCodes.Cyprus].default,
368
+ validators: validatePatternOnBlur(
369
+ businessRegistrationNumberPatterns[CountryCodes.Cyprus].default
370
+ ),
371
+ guidanceText: {
372
+ key: "enterEnglishLetterFollowedByXtoYDigitsForExample",
373
+ values: {
374
+ minDigits: "1",
375
+ maxDigits: "8",
376
+ example: "C12345678"
377
+ }
378
+ }
379
+ },
380
+ [CountryCodes.CzechRepublic]: {
381
+ label: "ICO",
382
+ mask: businessRegistrationNumberMasks[CountryCodes.CzechRepublic].default,
383
+ validators: validatePatternOnBlur(
384
+ businessRegistrationNumberPatterns[CountryCodes.CzechRepublic].default
385
+ ),
386
+ guidanceText: {
387
+ key: "enterXToYDigitsForExample",
388
+ values: {
389
+ minDigits: "8",
390
+ maxDigits: "10",
391
+ example: "12345678"
392
+ }
393
+ }
394
+ },
395
+ [CountryCodes.Denmark]: {
396
+ label: "CVR-nummer",
397
+ mask: businessRegistrationNumberMasks[CountryCodes.Denmark].default,
398
+ validators: validatePatternOnBlur(
399
+ businessRegistrationNumberPatterns[CountryCodes.Denmark].default
400
+ ),
401
+ guidanceText: {
402
+ key: "enterNDigitsForExample",
403
+ values: {
404
+ numDigits: "8",
405
+ example: "22756214"
406
+ }
407
+ }
408
+ },
409
+ [CountryCodes.Estonia]: {
410
+ label: "registrikood",
411
+ mask: businessRegistrationNumberMasks[CountryCodes.Estonia].default,
412
+ validators: validatePatternOnBlur(
413
+ businessRegistrationNumberPatterns[CountryCodes.Estonia].default
414
+ ),
415
+ guidanceText: {
416
+ key: "enterNDigitsForExample",
417
+ values: {
418
+ numDigits: "8",
419
+ example: "10345833"
420
+ }
421
+ }
422
+ },
423
+ [CountryCodes.Finland]: {
424
+ label: "YTunnus",
425
+ mask: businessRegistrationNumberMasks[CountryCodes.Finland].default,
426
+ validators: validatePatternOnBlur(
427
+ businessRegistrationNumberPatterns[CountryCodes.Finland].default
428
+ ),
429
+ guidanceText: {
430
+ key: "enterNDigitsForExample",
431
+ values: {
432
+ numDigits: "8",
433
+ example: "1234567-8"
434
+ }
435
+ }
436
+ },
437
+ [CountryCodes.France]: ({ registrationNumberType }) => registrationNumberType === "RNA" ? {
438
+ label: "rnaNumber",
439
+ mask: businessRegistrationNumberMasks[CountryCodes.France].RNA,
440
+ validators: validatePatternOnBlur(
441
+ businessRegistrationNumberPatterns[CountryCodes.France].RNA
442
+ ),
443
+ guidanceText: {
444
+ key: "enterTheRemainingNDigitsForExample",
445
+ values: {
446
+ numDigits: "9",
447
+ example: "W123456789 or W9M1234567"
448
+ }
449
+ }
450
+ } : {
451
+ label: "siret",
452
+ mask: businessRegistrationNumberMasks[CountryCodes.France].SIRET,
453
+ validators: validatePatternOnBlur(
454
+ businessRegistrationNumberPatterns[CountryCodes.France].SIRET
455
+ ),
456
+ guidanceText: {
457
+ key: "enterNDigitsForExample",
458
+ values: {
459
+ numDigits: "14",
460
+ example: "542051180-00066"
461
+ }
462
+ }
463
+ },
464
+ [CountryCodes.Germany]: {
465
+ label: "handelsregisternummerOrVereinsregisternummer",
466
+ mask: businessRegistrationNumberMasks[CountryCodes.Germany].default,
467
+ validators: validatePatternOnBlur(
468
+ businessRegistrationNumberPatterns[CountryCodes.Germany].default
469
+ ),
470
+ guidanceText: {
471
+ key: "enterAMaximumOfNCharactersWithAMixForExample",
472
+ values: {
473
+ maxChars: "20",
474
+ example: "HRB100484, HRA123456ABCDE-A1234, VR350378A"
475
+ }
476
+ }
477
+ },
478
+ [CountryCodes.Gibraltar]: {
479
+ label: "companyRegistrationNumber",
480
+ mask: businessRegistrationNumberMasks[CountryCodes.Gibraltar].default,
481
+ validators: validatePatternOnBlur(
482
+ businessRegistrationNumberPatterns[CountryCodes.Gibraltar].default
483
+ ),
484
+ guidanceText: {
485
+ key: "enterAMaximumOfNCharactersForExample",
486
+ values: {
487
+ maxChars: "8",
488
+ example: "04366849"
489
+ }
490
+ }
491
+ },
492
+ [CountryCodes.Greece]: {
493
+ label: "GEMI-number",
494
+ mask: businessRegistrationNumberMasks[CountryCodes.Greece].default,
495
+ validators: validatePatternOnBlur(
496
+ businessRegistrationNumberPatterns[CountryCodes.Greece].default
497
+ ),
498
+ guidanceText: {
499
+ key: "enterNDigitsForExample",
500
+ values: {
501
+ numDigits: "12",
502
+ example: "757001000000"
503
+ }
504
+ }
505
+ },
506
+ [CountryCodes.Guernsey]: {
507
+ label: "registrationNumber",
508
+ mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
509
+ validators: validatePatternOnBlur(
510
+ businessRegistrationNumberPatterns[CountryCodes.Guernsey].default
511
+ ),
512
+ guidanceText: {
513
+ key: "enterAMaximumOfNDigitsForExample",
514
+ values: {
515
+ maxDigits: "9",
516
+ example: "123456"
517
+ }
518
+ }
519
+ },
520
+ [CountryCodes.HongKong]: {
521
+ label: "companyRegistrationNumber__HK",
522
+ mask: businessRegistrationNumberMasks[CountryCodes.HongKong].default,
523
+ validators: validatePatternOnBlur(
524
+ businessRegistrationNumberPatterns[CountryCodes.HongKong].default
525
+ ),
526
+ guidanceText: {
527
+ key: "enterNDigitsForExample",
528
+ values: {
529
+ numDigits: "7",
530
+ example: "1234567"
531
+ }
532
+ }
533
+ },
534
+ [CountryCodes.Hungary]: ({ companyType }) => {
535
+ if (companyType === CompanyTypesValues.SOLE_PROPRIETORSHIP) {
536
+ return {
537
+ label: "huRegistrationNumberForSoleProp",
538
+ mask: businessRegistrationNumberMasks[CountryCodes.Hungary].nyilvantartasiSzam,
539
+ validators: validatePatternOnBlur(
540
+ businessRegistrationNumberPatterns[CountryCodes.Hungary].nyilvantartasiSzam
541
+ ),
542
+ guidanceText: {
543
+ key: "enterXToYDigitsForExample",
544
+ values: {
545
+ minDigits: "7",
546
+ maxDigits: "10",
547
+ example: "06123456"
548
+ }
549
+ }
550
+ };
551
+ }
552
+ return {
553
+ label: "huRegistrationNumber",
554
+ mask: businessRegistrationNumberMasks[CountryCodes.Hungary].default,
555
+ validators: validatePatternOnBlur(
556
+ businessRegistrationNumberPatterns[CountryCodes.Hungary].default
557
+ ),
558
+ guidanceText: {
559
+ key: "enterNDigitsForExample",
560
+ values: {
561
+ numDigits: "10",
562
+ example: "06-12-345678"
563
+ }
564
+ }
565
+ };
566
+ },
567
+ [CountryCodes.Ireland]: {
568
+ label: "companyNumber",
569
+ mask: businessRegistrationNumberMasks[CountryCodes.Ireland].default,
570
+ validators: validatePatternOnBlur(
571
+ businessRegistrationNumberPatterns[CountryCodes.Ireland].default
572
+ ),
573
+ guidanceText: {
574
+ key: "enterAMaximumOfNDigitsForExample",
575
+ values: {
576
+ maxDigits: "8",
577
+ example: "10123456"
578
+ }
579
+ }
580
+ },
581
+ [CountryCodes.IsleOfMan]: {
582
+ label: "registrationNumber",
583
+ mask: businessRegistrationNumberMasks[CountryCodes.IsleOfMan].default,
584
+ validators: validatePatternOnBlur(
585
+ businessRegistrationNumberPatterns[CountryCodes.IsleOfMan].default
586
+ ),
587
+ guidanceText: {
588
+ key: "enterNDigitsAndThen1LetterForExample",
589
+ values: {
590
+ numDigits: "6",
591
+ example: "114293C"
592
+ }
593
+ }
594
+ },
595
+ [CountryCodes.Italy]: ({ registrationNumberType }) => {
596
+ switch (registrationNumberType) {
597
+ case "CCIAA":
598
+ return {
599
+ label: "CCIAA",
600
+ mask: businessRegistrationNumberMasks[CountryCodes.Italy].CCIAA,
601
+ validators: validatePatternOnBlur(
602
+ businessRegistrationNumberPatterns[CountryCodes.Italy].CCIAA
603
+ ),
604
+ guidanceText: {
605
+ key: "enterNLettersAndThenXToYDigitsForExample",
606
+ values: {
607
+ numLetters: "2",
608
+ minDigits: "6",
609
+ maxDigits: "7",
610
+ example: "TO0091712"
611
+ }
612
+ }
613
+ };
614
+ case "partitaIVA":
615
+ default:
616
+ return {
617
+ label: "codiceFiscalePartitaIVA",
618
+ validators: validatePatternOnBlur(/^\d{11}$/),
619
+ mask: {
620
+ mask: makeMask(spacer, ...numericInputs(11))
621
+ },
622
+ guidanceText: {
623
+ key: "enterTheRemainingNDigitsForExample",
624
+ values: {
625
+ numDigits: "11",
626
+ example: "47040001100"
627
+ }
628
+ }
629
+ };
630
+ }
631
+ },
632
+ [CountryCodes.Japan]: {
633
+ label: "corporateRegistrationNumber",
634
+ mask: businessRegistrationNumberMasks[CountryCodes.Japan].default,
635
+ validators: validatePatternOnBlur(
636
+ businessRegistrationNumberPatterns[CountryCodes.Japan].default
637
+ ),
638
+ guidanceText: {
639
+ key: "enterAMaximumOfNCharactersForExample",
640
+ values: {
641
+ maxChars: "12",
642
+ example: "224863141686"
643
+ }
644
+ }
645
+ },
646
+ [CountryCodes.Jersey]: {
647
+ label: "registrationNumber",
648
+ mask: businessRegistrationNumberMasks[CountryCodes.Jersey].default,
649
+ validators: validatePatternOnBlur(
650
+ businessRegistrationNumberPatterns[CountryCodes.Jersey].default
651
+ ),
652
+ guidanceText: {
653
+ key: "enterAMaximumOfNCharactersForExample",
654
+ values: {
655
+ maxChars: "9",
656
+ example: "123722"
657
+ }
658
+ }
659
+ },
660
+ [CountryCodes.Latvia]: {
661
+ label: "lvRegistrationNumber",
662
+ mask: businessRegistrationNumberMasks[CountryCodes.Latvia].default,
663
+ validators: validatePatternOnBlur(
664
+ businessRegistrationNumberPatterns[CountryCodes.Latvia].default
665
+ ),
666
+ guidanceText: {
667
+ key: "enterNDigitsForExample",
668
+ values: {
669
+ numDigits: "11",
670
+ example: "50003251661"
671
+ }
672
+ }
673
+ },
674
+ [CountryCodes.Liechtenstein]: {
675
+ label: "liRegistrationNumber",
676
+ mask: businessRegistrationNumberMasks[CountryCodes.Liechtenstein].default,
677
+ validators: validatePatternOnBlur(
678
+ businessRegistrationNumberPatterns[CountryCodes.Liechtenstein].default
679
+ ),
680
+ guidanceText: {
681
+ key: "enterTheRemainingNDigitsForExample",
682
+ values: {
683
+ numDigits: "11",
684
+ example: "FL-0001.012.124-5"
685
+ }
686
+ }
687
+ },
688
+ [CountryCodes.Lithuania]: {
689
+ label: "ltRegistrationNumber",
690
+ mask: businessRegistrationNumberMasks[CountryCodes.Lithuania].default,
691
+ validators: validatePatternOnBlur(
692
+ businessRegistrationNumberPatterns[CountryCodes.Lithuania].default
693
+ ),
694
+ guidanceText: {
695
+ key: "enterXToYDigitsForExample",
696
+ values: {
697
+ minDigits: "6",
698
+ maxDigits: "9",
699
+ example: "123456789"
700
+ }
701
+ }
702
+ },
703
+ [CountryCodes.Luxembourg]: {
704
+ label: "luRegistrationNumber",
705
+ mask: businessRegistrationNumberMasks[CountryCodes.Luxembourg].default,
706
+ validators: validatePatternOnBlur(
707
+ businessRegistrationNumberPatterns[CountryCodes.Luxembourg].default
708
+ ),
709
+ guidanceText: {
710
+ key: "enter1LetterAndThenNDigitsForExample",
711
+ values: {
712
+ example: "C127766"
713
+ }
714
+ }
715
+ },
716
+ [CountryCodes.Malta]: {
717
+ label: "companyRegistrationNumber",
718
+ mask: businessRegistrationNumberMasks[CountryCodes.Malta].default,
719
+ validators: validatePatternOnBlur(
720
+ businessRegistrationNumberPatterns[CountryCodes.Malta].default
721
+ ),
722
+ guidanceText: {
723
+ key: "enterTheRemainingXToYDigitsForExample",
724
+ values: {
725
+ minDigits: "4",
726
+ maxDigits: "6",
727
+ example: "C 43070, P 1234"
728
+ }
729
+ }
730
+ },
731
+ [CountryCodes.Malaysia]: {
732
+ label: "SSM",
733
+ mask: businessRegistrationNumberMasks[CountryCodes.Malaysia].default,
734
+ validators: validatePatternOnBlur(
735
+ businessRegistrationNumberPatterns[CountryCodes.Malaysia].default
736
+ ),
737
+ guidanceText: {
738
+ key: "enterXOrYDigitsForExample",
739
+ values: {
740
+ xDigits: "7",
741
+ yDigits: "12",
742
+ example: "1234567, 201901000005"
743
+ }
744
+ }
745
+ },
746
+ [CountryCodes.Mexico]: {
747
+ label: "RFC",
748
+ mask: businessRegistrationNumberMasks[CountryCodes.Mexico].default,
749
+ validators: validatePatternOnBlur(
750
+ businessRegistrationNumberPatterns[CountryCodes.Mexico].default
751
+ ),
752
+ guidanceText: {
753
+ key: "enterNDigitsForExample",
754
+ values: {
755
+ numDigits: "12",
756
+ example: "LFM200817DGA"
757
+ }
758
+ }
759
+ },
760
+ [CountryCodes.Monaco]: ({ companyType }) => companyType === CompanyTypesValues.SOLE_PROPRIETORSHIP ? {
761
+ label: "mcRegistrationNumberSoleProp",
762
+ mask: businessRegistrationNumberMasks[CountryCodes.Monaco].soleProprietorship,
763
+ validators: validatePatternOnBlur(
764
+ businessRegistrationNumberPatterns[CountryCodes.Monaco].soleProprietorship
765
+ ),
766
+ guidanceText: {
767
+ key: "enterXToYCharactersWithAMixForExample",
768
+ values: {
769
+ minChars: "8",
770
+ maxChars: "11",
771
+ example: "8732P92873"
772
+ }
773
+ }
774
+ } : {
775
+ label: "mcRegistrationNumber",
776
+ mask: businessRegistrationNumberMasks[CountryCodes.Monaco].default,
777
+ validators: validatePatternOnBlur(
778
+ businessRegistrationNumberPatterns[CountryCodes.Monaco].default
779
+ ),
780
+ guidanceText: {
781
+ key: "enterXToYCharactersWithAMixForExample",
782
+ values: {
783
+ minChars: "8",
784
+ maxChars: "11",
785
+ example: "84SB02071"
786
+ }
787
+ }
788
+ },
789
+ [CountryCodes.Netherlands]: {
790
+ label: "chamberOfCommerceRegistrationNumber",
791
+ mask: businessRegistrationNumberMasks[CountryCodes.Netherlands].default,
792
+ validators: validatePatternOnBlur(
793
+ businessRegistrationNumberPatterns[CountryCodes.Netherlands].default
794
+ ),
795
+ guidanceText: {
796
+ key: "enterNDigitsForExample",
797
+ values: {
798
+ numDigits: "8",
799
+ example: "34179503"
800
+ }
801
+ }
802
+ },
803
+ [CountryCodes.NewZealand]: ({ registrationNumberType }) => registrationNumberType === "NZBN" ? {
804
+ label: "NZBN",
805
+ mask: businessRegistrationNumberMasks[CountryCodes.NewZealand].NZBN,
806
+ validators: validatePatternOnBlur(
807
+ businessRegistrationNumberPatterns[CountryCodes.NewZealand].NZBN
808
+ ),
809
+ guidanceText: {
810
+ key: "enterNDigitsForExample",
811
+ values: {
812
+ numDigits: "13",
813
+ example: "1234567890123"
814
+ }
815
+ }
816
+ } : {
817
+ label: "companyNumberNZ",
818
+ mask: businessRegistrationNumberMasks[CountryCodes.NewZealand].companyNumberNZ,
819
+ validators: validatePatternOnBlur(
820
+ businessRegistrationNumberPatterns[CountryCodes.NewZealand].companyNumberNZ
821
+ ),
822
+ guidanceText: {
823
+ key: "enterNDigitsForExample",
824
+ values: {
825
+ numDigits: "7",
826
+ example: "1234567"
827
+ }
828
+ }
829
+ },
830
+ [CountryCodes.Norway]: {
831
+ label: "organisasjonsnummer",
832
+ mask: businessRegistrationNumberMasks[CountryCodes.Norway].default,
833
+ validators: validatePatternOnBlur(
834
+ businessRegistrationNumberPatterns[CountryCodes.Norway].default
835
+ ),
836
+ guidanceText: {
837
+ key: "enterNDigitsForExample",
838
+ values: {
839
+ numDigits: "9",
840
+ example: "923609016"
841
+ }
842
+ }
843
+ },
844
+ [CountryCodes.Poland]: ({ registrationNumberType }) => registrationNumberType === "krsNumber" ? {
845
+ label: "krsNumber",
846
+ mask: businessRegistrationNumberMasks[CountryCodes.Poland].krsNumber,
847
+ validators: validatePatternOnBlur(
848
+ businessRegistrationNumberPatterns[CountryCodes.Poland].krsNumber
849
+ ),
850
+ guidanceText: {
851
+ key: "enterNDigitsForExample",
852
+ values: {
853
+ numDigits: "10",
854
+ example: "1234567890"
855
+ }
856
+ }
857
+ } : {
858
+ label: "regon",
859
+ mask: businessRegistrationNumberMasks[CountryCodes.Poland].regon,
860
+ validators: validatePatternOnBlur(
861
+ businessRegistrationNumberPatterns[CountryCodes.Poland].regon
862
+ ),
863
+ guidanceText: {
864
+ key: "enterNDigitsForExample",
865
+ values: {
866
+ numDigits: "9",
867
+ example: "123456789"
868
+ }
869
+ }
870
+ },
871
+ [CountryCodes.Portugal]: {
872
+ label: "NIPC",
873
+ mask: businessRegistrationNumberMasks[CountryCodes.Portugal].default,
874
+ validators: validatePatternOnBlur(
875
+ businessRegistrationNumberPatterns[CountryCodes.Portugal].default
876
+ ),
877
+ guidanceText: {
878
+ key: "enterNDigitsForExample",
879
+ values: {
880
+ numDigits: "9",
881
+ example: "123456789"
882
+ }
883
+ }
884
+ },
885
+ [CountryCodes.PuertoRico]: {
886
+ // should exactly match CountryCodes.UnitedStates
887
+ },
888
+ [CountryCodes.Romania]: ({ registrationNumberType }) => registrationNumberType === "roRegNumberOldFormat" ? {
889
+ label: "roRegNumberOldFormat_label",
890
+ mask: businessRegistrationNumberMasks[CountryCodes.Romania].roRegNumberOldFormat,
891
+ validators: validatePatternOnBlur(
892
+ businessRegistrationNumberPatterns[CountryCodes.Romania].roRegNumberOldFormat
893
+ ),
894
+ guidanceText: {
895
+ key: "roRegNumberOldFormat_maskGuidance"
896
+ }
897
+ } : {
898
+ label: "roRegNumberNewFormat_label",
899
+ mask: businessRegistrationNumberMasks[CountryCodes.Romania].roRegNumberNewFormat,
900
+ validators: validatePatternOnBlur(
901
+ businessRegistrationNumberPatterns[CountryCodes.Romania].roRegNumberNewFormat
902
+ ),
903
+ guidanceText: {
904
+ key: "roRegNumberNewFormat_maskGuidance"
905
+ }
906
+ },
907
+ [CountryCodes.Singapore]: {
908
+ label: "uen",
909
+ mask: businessRegistrationNumberMasks[CountryCodes.Singapore].default,
910
+ validators: validatePatternOnBlur(
911
+ businessRegistrationNumberPatterns[CountryCodes.Singapore].default
912
+ ),
913
+ guidanceText: {
914
+ key: "enterXToYCharactersWithAMixForExample",
915
+ values: {
916
+ minChars: "9",
917
+ maxChars: "10",
918
+ example: "200312345A"
919
+ }
920
+ }
921
+ },
922
+ [CountryCodes.Slovakia]: {
923
+ label: "skRegistrationNumber",
924
+ mask: businessRegistrationNumberMasks[CountryCodes.Slovakia].default,
925
+ validators: validatePatternOnBlur(
926
+ businessRegistrationNumberPatterns[CountryCodes.Slovakia].default
927
+ ),
928
+ guidanceText: {
929
+ key: "enterNDigitsForExample",
930
+ values: {
931
+ numDigits: "8",
932
+ example: "12345678"
933
+ }
934
+ }
935
+ },
936
+ [CountryCodes.Slovenia]: {
937
+ label: "siRegistrationNumber",
938
+ mask: businessRegistrationNumberMasks[CountryCodes.Slovenia].default,
939
+ validators: validatePatternOnBlur(
940
+ businessRegistrationNumberPatterns[CountryCodes.Slovenia].default
941
+ ),
942
+ guidanceText: {
943
+ key: "enterNDigitsForExample",
944
+ values: {
945
+ numDigits: "10",
946
+ example: "1006500006"
947
+ }
948
+ }
949
+ },
950
+ [CountryCodes.Spain]: {
951
+ label: "NIF",
952
+ mask: businessRegistrationNumberMasks[CountryCodes.Spain].default,
953
+ validators: validatePatternOnBlur(
954
+ businessRegistrationNumberPatterns[CountryCodes.Spain].default
955
+ ),
956
+ guidanceText: {
957
+ key: "enter1LetterAndThenNDigitsForExample",
958
+ values: {
959
+ numDigits: "8",
960
+ example: "A39000013"
961
+ }
962
+ }
963
+ },
964
+ [CountryCodes.Sweden]: {
965
+ label: "organisationsnummer",
966
+ mask: businessRegistrationNumberMasks[CountryCodes.Sweden].default,
967
+ validators: validatePatternOnBlur(
968
+ businessRegistrationNumberPatterns[CountryCodes.Sweden].default
969
+ ),
970
+ guidanceText: {
971
+ key: "enterNDigitsForExample",
972
+ values: {
973
+ numDigits: "10",
974
+ example: "202100-5489"
975
+ }
976
+ }
977
+ },
978
+ [CountryCodes.Switzerland]: {
979
+ label: "chRegistrationNumber",
980
+ mask: businessRegistrationNumberMasks[CountryCodes.Switzerland].default,
981
+ validators: validatePatternOnBlur(
982
+ businessRegistrationNumberPatterns[CountryCodes.Switzerland].default
983
+ ),
984
+ guidanceText: {
985
+ key: "enterTheRemainingNDigitsForExample",
986
+ values: {
987
+ numDigits: "9",
988
+ example: "CHE-123.456.789"
989
+ }
990
+ }
991
+ },
992
+ [CountryCodes.UnitedArabEmirates]: {
993
+ label: "commercialLicence",
994
+ validators: validateNotEmptyOnBlur
995
+ },
996
+ [CountryCodes.UnitedKingdom]: ({ companyType, registrationNumberType }) => {
997
+ const defaultConfig = {
998
+ label: "companyNumber",
999
+ mask: businessRegistrationNumberMasks[CountryCodes.UnitedKingdom].default,
1000
+ validators: validatePatternOnBlur(
1001
+ businessRegistrationNumberPatterns[CountryCodes.UnitedKingdom].default
1002
+ ),
1003
+ guidanceText: {
1004
+ key: "enterNCharactersForExample",
1005
+ values: {
1006
+ numChars: "8",
1007
+ example: "43668490"
1008
+ }
1009
+ }
1010
+ };
1011
+ switch (companyType) {
1012
+ case "nonProfit":
1013
+ switch (registrationNumberType) {
1014
+ case "charity":
1015
+ return {
1016
+ label: "charityNumber",
1017
+ mask: businessRegistrationNumberMasks[CountryCodes.UnitedKingdom].nonProfit,
1018
+ validators: validatePatternOnBlur(
1019
+ businessRegistrationNumberPatterns[CountryCodes.UnitedKingdom].nonProfit
1020
+ ),
1021
+ guidanceText: {
1022
+ key: "enterThreeDifferingOptionsForExample",
1023
+ values: {
1024
+ firstOption: "6, 7 or 8 digits",
1025
+ secondOption: "6 digits with a 2-letter prefix",
1026
+ thirdOption: "6 digits with a suffix like -0",
1027
+ firstExample: "123456",
1028
+ secondExample: "SC012345",
1029
+ thirdExample: "123456-0"
1030
+ }
1031
+ }
1032
+ };
1033
+ default:
1034
+ return defaultConfig;
1035
+ }
1036
+ default:
1037
+ return defaultConfig;
1038
+ }
1039
+ },
1040
+ [CountryCodes.UnitedStates]: ({ state }) => ({
1041
+ label: "registrationNumber__US",
1042
+ mask: state ? businessRegistrationNumberMasks[CountryCodes.UnitedStates][state] : businessRegistrationNumberMasks[CountryCodes.UnitedStates].default,
1043
+ validators: state ? validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.UnitedStates][state]) : validatePatternOnBlur(
1044
+ businessRegistrationNumberPatterns[CountryCodes.UnitedStates].default
1045
+ ),
1046
+ guidanceText: state ? stateFormatGuidanceText[state] : stateFormatGuidanceText.default
1047
+ })
1048
+ };
1049
+ const exemptFromRegistrationNumberDefaultFieldMetadata = {
1050
+ label: "iDontHaveARegistrationNumber"
1051
+ };
1052
+ const exemptFromRegistrationNumberDefaultFieldConfig = {
1053
+ [CountryCodes.Australia]: {
1054
+ label: "doNotHaveAcn"
1055
+ },
1056
+ [CountryCodes.Austria]: {
1057
+ label: "doNotHaveFirmenbuchnummer"
1058
+ },
1059
+ [CountryCodes.Finland]: {
1060
+ label: "doNotHaveYTunnus"
1061
+ },
1062
+ [CountryCodes.HongKong]: {
1063
+ label: "iDoNotHaveCompanyRegistrationNumber"
1064
+ },
1065
+ [CountryCodes.Germany]: {
1066
+ label: "doNotHaveHandelsregisternummerOrVereinsregisternummer"
1067
+ },
1068
+ [CountryCodes.Lithuania]: {
1069
+ label: "doNotHaveLtRegistrationNumber"
1070
+ },
1071
+ [CountryCodes.Luxembourg]: {
1072
+ label: "doNotHaveLuRegistrationNumber"
1073
+ },
1074
+ [CountryCodes.Poland]: {
1075
+ label: "doNotHaveRegonKrsNumber"
1076
+ },
1077
+ [CountryCodes.PuertoRico]: {
1078
+ label: "doNotHaveEIN"
1079
+ },
1080
+ [CountryCodes.Sweden]: {
1081
+ label: "doNotHaveOrganisationsnummer"
1082
+ },
1083
+ [CountryCodes.Switzerland]: {
1084
+ label: "doNotHaveChRegistrationNumber"
1085
+ }
1086
+ };
1087
+ const inferCompanyRegistrationNumberType = (registrationNumber, country, companyType) => {
1088
+ const optionsForCountry = getCompanyRegistrationNumberOptions(country, companyType);
1089
+ const metadataFn = registrationNumberDefaultFieldConfig[country];
1090
+ if (!optionsForCountry) return void 0;
1091
+ if (optionsForCountry.length === 1)
1092
+ return optionsForCountry[0].id;
1093
+ if (!optionsForCountry || !metadataFn) return void 0;
1094
+ const allMetaData = optionsForCountry.reduce(
1095
+ (acc, option) => {
1096
+ const meta = typeof metadataFn === "function" ? metadataFn({
1097
+ registrationNumberType: option.id,
1098
+ companyType
1099
+ }) : metadataFn;
1100
+ if (meta.label && !acc[meta.label]) {
1101
+ acc[meta.label] = meta;
1102
+ }
1103
+ return acc;
1104
+ },
1105
+ {}
1106
+ );
1107
+ for (const option of optionsForCountry) {
1108
+ const fieldMetadata = allMetaData[option.name];
1109
+ if (!fieldMetadata?.validators) continue;
1110
+ const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
1111
+ if (validators.every((validator) => validator.validate(registrationNumber))) {
1112
+ return option.id;
1113
+ }
1114
+ }
1115
+ };
1116
+ function getDefaultRegistrationNumberType(registrationNumber, country, companyType) {
1117
+ return registrationNumber ? inferCompanyRegistrationNumberType(registrationNumber, country, companyType) : getCompanyRegistrationNumberOptions(country, companyType)?.[0]?.id;
1118
+ }
1119
+ const BUSINESS_REGISTRATION_NUMBER_FIELD = ["registrationNumber", "registrationNumberType", "exemptedFromRegistrationNumber"];
1120
+ function BusinessRegistrationNumberField({
1121
+ data,
1122
+ valid,
1123
+ errors,
1124
+ labels,
1125
+ mask,
1126
+ guidanceText,
1127
+ helperText,
1128
+ placeholders,
1129
+ readonly,
1130
+ shouldValidate,
1131
+ optional,
1132
+ handleChangeFor,
1133
+ country,
1134
+ canExempt,
1135
+ companyType
1136
+ }) {
1137
+ const registrationNumberOptions = getCompanyRegistrationNumberOptions(country, companyType);
1138
+ const defaultType = getDefaultRegistrationNumberType(
1139
+ data.registrationNumber,
1140
+ country,
1141
+ companyType
1142
+ );
1143
+ const showExemptedOption = canExempt && !!registrationNumberOptions && registrationNumberOptions.length > 1;
1144
+ const registrationNumberType = data.exemptedFromRegistrationNumber ? "exempted" : data.registrationNumberType ? data.registrationNumberType : defaultType;
1145
+ const handleRegistrationNumberChange = (e, mode) => {
1146
+ const value = typeof e === "string" ? e : e.target?.value;
1147
+ handleChangeFor("registrationNumber", mode)(value);
1148
+ handleChangeFor("registrationNumberType")(registrationNumberType);
1149
+ };
1150
+ const handleExemptedFromRegistrationNumber = (exempt) => {
1151
+ if (exempt) handleChangeFor("registrationNumber")("");
1152
+ handleChangeFor("exemptedFromRegistrationNumber")(exempt);
1153
+ };
1154
+ const handleCompanyRegistrationNumberTypeChange = (regNumberType) => {
1155
+ if (regNumberType === "exempted") {
1156
+ if (!canExempt) {
1157
+ throw Error(`${country} does not allow tax exemptions`);
1158
+ }
1159
+ handleChangeFor("registrationNumber")("");
1160
+ handleChangeFor("exemptedFromRegistrationNumber")(true);
1161
+ handleChangeFor("registrationNumberType")(void 0);
1162
+ return;
1163
+ }
1164
+ if (canExempt && data.exemptedFromRegistrationNumber === true) {
1165
+ handleChangeFor("exemptedFromRegistrationNumber")(false);
1166
+ }
1167
+ handleChangeFor("registrationNumber")("");
1168
+ handleChangeFor("registrationNumberType")(regNumberType);
1169
+ };
1170
+ if (registrationNumberType && registrationNumberType !== "exempted") {
1171
+ const countryHasType = registrationNumberOptions?.find(
1172
+ (option) => option.id === registrationNumberType
1173
+ );
1174
+ if (!countryHasType) {
1175
+ handleChangeFor("registrationNumberType")(defaultType);
1176
+ }
1177
+ }
1178
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field__business-registration", children: [
1179
+ /* @__PURE__ */ jsx(
1180
+ CompanyRegistrationNumberTypeSelector,
1181
+ {
1182
+ companyType,
1183
+ country,
1184
+ setSelected: handleCompanyRegistrationNumberTypeChange,
1185
+ selected: registrationNumberType,
1186
+ exemptedOption: showExemptedOption ? labels.exemptedFromRegistrationNumber : false
1187
+ }
1188
+ ),
1189
+ /* @__PURE__ */ jsx(
1190
+ MaskedInput,
1191
+ {
1192
+ "aria-required": true,
1193
+ "aria-invalid": !valid.registrationNumber,
1194
+ name: "registrationNumber",
1195
+ type: "text",
1196
+ value: data?.registrationNumber ?? "",
1197
+ label: labels.registrationNumber ?? "",
1198
+ formatGuidance: guidanceText?.registrationNumber ?? "",
1199
+ placeholder: placeholders?.registrationNumber,
1200
+ errorMessage: errors.registrationNumber,
1201
+ isValid: Boolean(valid.registrationNumber),
1202
+ onInput: (e) => handleRegistrationNumberChange(e, "input"),
1203
+ onBlur: (e) => handleRegistrationNumberChange(e, "blur"),
1204
+ disabled: data.exemptedFromRegistrationNumber,
1205
+ optional,
1206
+ readonly,
1207
+ shouldValidate: !optional && shouldValidate,
1208
+ helper: helperText?.registrationNumber,
1209
+ ...mask
1210
+ }
1211
+ ),
1212
+ canExempt && !showExemptedOption && /* @__PURE__ */ jsx(Field, { name: "exemptedFromRegistrationNumber", children: (childProps) => /* @__PURE__ */ jsx(
1213
+ Checkbox,
1214
+ {
1215
+ ...childProps,
1216
+ "aria-required": false,
1217
+ "aria-invalid": false,
1218
+ name: "exemptedFromRegistrationNumber",
1219
+ value: "exemptedFromRegistrationNumber",
1220
+ checked: Boolean(data.exemptedFromRegistrationNumber),
1221
+ label: labels?.exemptedFromRegistrationNumber,
1222
+ readonly,
1223
+ onChange: handleExemptedFromRegistrationNumber
1224
+ }
1225
+ ) })
1226
+ ] });
1227
+ }
1228
+ const DBA_NAME_FIELD = [
1229
+ "hasDoingBusinessAs",
1230
+ "doingBusinessAs"
1231
+ ];
1232
+ function DBANameField({
1233
+ data,
1234
+ valid,
1235
+ errors,
1236
+ labels,
1237
+ helperText,
1238
+ readonly,
1239
+ handleChangeFor
1240
+ }) {
1241
+ const { t } = useTranslation("common");
1242
+ const hasDoingBusinessAsValue = useMemo(() => {
1243
+ if (typeof data.hasDoingBusinessAs !== "boolean") return void 0;
1244
+ return data.hasDoingBusinessAs ? "yes" : "no";
1245
+ }, [data.hasDoingBusinessAs]);
1246
+ const handleHasDoingBusinessAsChange = (val) => {
1247
+ handleChangeFor("hasDoingBusinessAs")(val === "yes" ? true : false);
1248
+ };
1249
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1250
+ /* @__PURE__ */ jsx(
1251
+ Field,
1252
+ {
1253
+ el: "fieldset",
1254
+ name: "hasDoingBusinessAsName",
1255
+ label: labels.hasDoingBusinessAs ?? t(($) => $["hasDba"]),
1256
+ helper: helperText?.hasDoingBusinessAs ?? t(($) => $["hasDba__helperText"]),
1257
+ isValid: valid.hasDoingBusinessAs,
1258
+ errorMessage: errors.hasDoingBusinessAs,
1259
+ children: (childProps) => /* @__PURE__ */ jsx(
1260
+ RadioGroup,
1261
+ {
1262
+ ...childProps,
1263
+ name: "hasDoingBusinessAs",
1264
+ items: [
1265
+ { id: "yes", name: "yes" },
1266
+ { id: "no", name: "no" }
1267
+ ],
1268
+ value: hasDoingBusinessAsValue,
1269
+ onChange: handleHasDoingBusinessAsChange,
1270
+ horizontal: true
1271
+ }
1272
+ )
1273
+ }
1274
+ ),
1275
+ data.hasDoingBusinessAs && /* @__PURE__ */ jsx(
1276
+ Field,
1277
+ {
1278
+ name: "doingBusinessAs",
1279
+ label: labels.doingBusinessAs ?? t(($) => $["dbaName"]),
1280
+ errorMessage: errors.doingBusinessAs,
1281
+ isValid: valid.doingBusinessAs,
1282
+ children: (childProps) => /* @__PURE__ */ jsx(
1283
+ InputText,
1284
+ {
1285
+ ...childProps,
1286
+ "aria-required": true,
1287
+ "aria-invalid": !valid.doingBusinessAs,
1288
+ name: "doingBusinessAs",
1289
+ value: data.doingBusinessAs,
1290
+ readonly,
1291
+ onInput: handleChangeFor("doingBusinessAs", "input"),
1292
+ onBlur: handleChangeFor("doingBusinessAs", "blur")
1293
+ }
1294
+ )
1295
+ }
1296
+ )
1297
+ ] });
1298
+ }
1299
+ const doingBusinessAsAbsentFieldMetadata = {
1300
+ validators: [validateNotEmptyOnBlur]
1301
+ };
1302
+ const doingBusinessAsFieldMetadata = {
1303
+ label: "doingBusinessAs",
1304
+ validators: [validateNotEmptyOnBlur]
1305
+ };
1306
+ const vatAbsenceReasonMetadata = {
1307
+ validators: [validateNotEmptyOnBlur]
1308
+ };
1309
+ const defaultFieldMetadata = {
1310
+ label: "vatNumber"
1311
+ };
1312
+ const defaultFieldConfig = {
1313
+ [CountryCodes.Austria]: {
1314
+ label: "UST-ID",
1315
+ validators: validatePatternOnBlur(/^ATU\d{8}$/),
1316
+ mask: {
1317
+ mask: makeMask(...nonInputs("ATU", { includeInValue: true }), spacer, ...numericInputs(8))
1318
+ },
1319
+ guidanceText: {
1320
+ key: "enterTheRemainingNDigitsForExample",
1321
+ values: {
1322
+ numDigits: "8",
1323
+ example: "ATU51507409"
1324
+ }
1325
+ }
1326
+ },
1327
+ [CountryCodes.Belgium]: {
1328
+ label: "euVatNumber",
1329
+ validators: validatePatternOnBlur(/^BE[10]\d{9}$/),
1330
+ mask: {
1331
+ mask: makeMask(...nonInputs("BE", { includeInValue: true }), spacer, ...numericInputs(10))
1332
+ },
1333
+ guidanceText: {
1334
+ key: "enterTheRemainingNDigitsForExample",
1335
+ values: {
1336
+ numDigits: "10",
1337
+ example: "BE1234567890"
1338
+ }
1339
+ }
1340
+ },
1341
+ [CountryCodes.Bulgaria]: {
1342
+ label: "identifikacionenNomerDDS",
1343
+ validators: validatePatternOnBlur(/^BG\d{9,10}$/),
1344
+ mask: {
1345
+ mask: makeMask(
1346
+ ...nonInputs("BG", { includeInValue: true }),
1347
+ spacer,
1348
+ ...numericInputs(9),
1349
+ ...numericInputs(1, true)
1350
+ )
1351
+ },
1352
+ guidanceText: {
1353
+ key: "enterTheRemainingXToYDigitsForExample",
1354
+ values: {
1355
+ minDigits: "9",
1356
+ maxDigits: "10",
1357
+ example: "BG1234567890"
1358
+ }
1359
+ }
1360
+ },
1361
+ [CountryCodes.Croatia]: {
1362
+ label: "PDVIdBrojOIB",
1363
+ validators: validatePatternOnBlur(/^HR\d{11}$/),
1364
+ mask: {
1365
+ mask: makeMask(...nonInputs("HR", { includeInValue: true }), spacer, ...numericInputs(11))
1366
+ },
1367
+ guidanceText: {
1368
+ key: "enterTheRemainingNDigitsForExample",
1369
+ values: {
1370
+ numDigits: "11",
1371
+ example: "HR94577403194"
1372
+ }
1373
+ }
1374
+ },
1375
+ [CountryCodes.Cyprus]: {
1376
+ label: "arithmosEngraphes",
1377
+ validators: validatePatternOnBlur(/^CY[A-Z0-9]{9}$/),
1378
+ mask: {
1379
+ mask: makeMask(
1380
+ ...nonInputs("CY", { includeInValue: true }),
1381
+ spacer,
1382
+ ...alphanumericInputs(9)
1383
+ ),
1384
+ transformOnType: uppercase
1385
+ },
1386
+ guidanceText: {
1387
+ key: "enterTheRemainingNCharactersForExample",
1388
+ values: {
1389
+ numChars: "9",
1390
+ example: "CY12345678X"
1391
+ }
1392
+ }
1393
+ },
1394
+ [CountryCodes.CzechRepublic]: {
1395
+ label: "DIC",
1396
+ validators: validatePatternOnBlur(/^CZ\d{8,10}$/),
1397
+ mask: {
1398
+ mask: makeMask(
1399
+ ...nonInputs("CZ", { includeInValue: true }),
1400
+ spacer,
1401
+ ...numericInputs(8),
1402
+ ...numericInputs(2, true)
1403
+ )
1404
+ },
1405
+ guidanceText: {
1406
+ key: "enterTheRemainingXToYDigitsForExample",
1407
+ values: {
1408
+ minDigits: "8",
1409
+ maxDigits: "10",
1410
+ example: "CZ00177041"
1411
+ }
1412
+ }
1413
+ },
1414
+ [CountryCodes.Denmark]: ({ vatNumberType }) => {
1415
+ switch (vatNumberType) {
1416
+ case "stamregister":
1417
+ return {
1418
+ label: "stamregister",
1419
+ validators: validatePatternOnBlur(/^SE\d{8}$/),
1420
+ mask: {
1421
+ mask: makeMask(
1422
+ ...nonInputs("SE", { includeInValue: true }),
1423
+ spacer,
1424
+ ...numericInputs(8)
1425
+ )
1426
+ },
1427
+ guidanceText: {
1428
+ key: "enterTheRemainingNDigitsForExample",
1429
+ values: {
1430
+ numDigits: "8",
1431
+ example: "SE12345678"
1432
+ }
1433
+ }
1434
+ };
1435
+ case "momsregistreringsnummerCVR":
1436
+ default:
1437
+ return {
1438
+ label: "momsregistreringsnummerCVR",
1439
+ validators: validatePatternOnBlur(/^DK\d{8}$/),
1440
+ mask: {
1441
+ mask: makeMask(
1442
+ ...nonInputs("DK", { includeInValue: true }),
1443
+ spacer,
1444
+ ...numericInputs(8)
1445
+ )
1446
+ },
1447
+ guidanceText: {
1448
+ key: "enterTheRemainingNDigitsForExample",
1449
+ values: {
1450
+ numDigits: "8",
1451
+ example: "DK12345678"
1452
+ }
1453
+ }
1454
+ };
1455
+ }
1456
+ },
1457
+ [CountryCodes.Estonia]: {
1458
+ label: "kaibemaksukohustuslaseNumber",
1459
+ validators: validatePatternOnBlur(/^EE\d{9}$/),
1460
+ mask: {
1461
+ mask: makeMask(...nonInputs("EE", { includeInValue: true }), spacer, ...numericInputs(9))
1462
+ },
1463
+ guidanceText: {
1464
+ key: "enterTheRemainingNDigitsForExample",
1465
+ values: {
1466
+ numDigits: "9",
1467
+ example: "EE100254507"
1468
+ }
1469
+ }
1470
+ },
1471
+ [CountryCodes.Finland]: {
1472
+ label: "arvonlisaveronumeroMervardesskattenummer",
1473
+ validators: validatePatternOnBlur(/^FI\d{8}$/),
1474
+ mask: {
1475
+ mask: makeMask(...nonInputs("FI", { includeInValue: true }), spacer, ...numericInputs(8))
1476
+ },
1477
+ guidanceText: {
1478
+ key: "enterTheRemainingNDigitsForExample",
1479
+ values: {
1480
+ numDigits: "9",
1481
+ example: "FI12345678"
1482
+ }
1483
+ }
1484
+ },
1485
+ [CountryCodes.France]: ({ vatNumberType }) => {
1486
+ const sharedMetadata = {
1487
+ validators: validatePatternOnBlur(/^FR\d{11}$/),
1488
+ mask: {
1489
+ mask: makeMask(...nonInputs("FR", { includeInValue: true }), spacer, ...numericInputs(11))
1490
+ }
1491
+ };
1492
+ switch (vatNumberType) {
1493
+ case "NumeroDeTVA":
1494
+ return {
1495
+ ...sharedMetadata,
1496
+ label: "NumeroDeTVA",
1497
+ guidanceText: {
1498
+ key: "enterTheRemainingNDigitsForExample",
1499
+ values: {
1500
+ numDigits: "11",
1501
+ example: "FR12999999999"
1502
+ }
1503
+ }
1504
+ };
1505
+ case "numeroDIdentificationALATaxe":
1506
+ default:
1507
+ return {
1508
+ ...sharedMetadata,
1509
+ label: "numeroDIdentificationALATaxe",
1510
+ guidanceText: {
1511
+ key: "enterTheRemainingNDigitsForExample",
1512
+ values: {
1513
+ numDigits: "11",
1514
+ example: "FR12345678901"
1515
+ }
1516
+ }
1517
+ };
1518
+ }
1519
+ },
1520
+ [CountryCodes.Germany]: {
1521
+ label: "USt-IdNr",
1522
+ validators: validatePatternOnBlur(/^DE\d{9}$/),
1523
+ mask: {
1524
+ mask: makeMask(...nonInputs("DE", { includeInValue: true }), spacer, ...numericInputs(9))
1525
+ },
1526
+ guidanceText: {
1527
+ key: "enterTheRemainingNDigitsForExample",
1528
+ values: {
1529
+ numDigits: "9",
1530
+ example: "DE115235681"
1531
+ }
1532
+ }
1533
+ },
1534
+ [CountryCodes.Greece]: {
1535
+ label: "grTaxId",
1536
+ validators: validatePatternOnBlur(/^EL\d{9}$/),
1537
+ mask: {
1538
+ mask: makeMask(...nonInputs("EL", { includeInValue: true }), spacer, ...numericInputs(9))
1539
+ },
1540
+ guidanceText: {
1541
+ key: "enterTheRemainingNDigitsForExample",
1542
+ values: {
1543
+ numDigits: "9",
1544
+ example: "EL123456789"
1545
+ }
1546
+ }
1547
+ },
1548
+ [CountryCodes.Hungary]: {
1549
+ label: "huTaxId",
1550
+ validators: validatePatternOnBlur(/^HU\d{8}$/),
1551
+ mask: {
1552
+ mask: makeMask(...nonInputs("HU", { includeInValue: true }), spacer, ...numericInputs(8))
1553
+ },
1554
+ guidanceText: {
1555
+ key: "enterTheRemainingNDigitsForExample",
1556
+ values: {
1557
+ numDigits: "8",
1558
+ example: "HU12345678"
1559
+ }
1560
+ }
1561
+ },
1562
+ [CountryCodes.Ireland]: {
1563
+ label: "vatNumber",
1564
+ validators: validatePatternOnBlur(/^IE[A-Z0-9]{8,9}$/),
1565
+ mask: {
1566
+ mask: makeMask(
1567
+ ...nonInputs("IE", { includeInValue: true }),
1568
+ spacer,
1569
+ ...alphanumericInputs(8),
1570
+ ...alphanumericInputs(1, true)
1571
+ ),
1572
+ transformOnType: uppercase
1573
+ },
1574
+ guidanceText: {
1575
+ key: "enterTheRemainingXToYCharactersForExample",
1576
+ values: {
1577
+ minChars: "8",
1578
+ maxChars: "9",
1579
+ example: "IE999999XX"
1580
+ }
1581
+ }
1582
+ },
1583
+ [CountryCodes.Italy]: {
1584
+ label: "partitaIVA",
1585
+ validators: validatePatternOnBlur(/^IT\d{11}$/),
1586
+ mask: {
1587
+ mask: makeMask(...nonInputs("IT", { includeInValue: true }), spacer, ...numericInputs(11))
1588
+ },
1589
+ guidanceText: {
1590
+ key: "enterTheRemainingNDigitsForExample",
1591
+ values: {
1592
+ numDigits: "11",
1593
+ example: "IT47040001100"
1594
+ }
1595
+ }
1596
+ },
1597
+ [CountryCodes.Latvia]: {
1598
+ label: "lvTaxId",
1599
+ validators: validatePatternOnBlur(/^LV\d{11}$/),
1600
+ mask: {
1601
+ mask: makeMask(...nonInputs("LV", { includeInValue: true }), spacer, ...numericInputs(11))
1602
+ },
1603
+ guidanceText: {
1604
+ key: "enterTheRemainingNDigitsForExample",
1605
+ values: {
1606
+ numDigits: "11",
1607
+ example: "LV43603021620"
1608
+ }
1609
+ }
1610
+ },
1611
+ [CountryCodes.Liechtenstein]: {
1612
+ label: "vatRegistrationNumber",
1613
+ validators: validatePatternOnBlur(/^[0-9]{1,6}$/),
1614
+ mask: {
1615
+ mask: makeMask(...numericInputs(1), ...numericInputs(5, true))
1616
+ },
1617
+ guidanceText: {
1618
+ key: "enterAMaximumOfNDigitsForExample",
1619
+ values: {
1620
+ maxDigits: "6",
1621
+ example: "123456"
1622
+ }
1623
+ }
1624
+ },
1625
+ [CountryCodes.Lithuania]: {
1626
+ label: "PVMmoketojoKodas",
1627
+ validators: validatePatternOnBlur(/^LT\d{9,12}$/),
1628
+ mask: {
1629
+ mask: makeMask(
1630
+ ...nonInputs("LT", { includeInValue: true }),
1631
+ spacer,
1632
+ ...numericInputs(9),
1633
+ ...numericInputs(3, true)
1634
+ )
1635
+ },
1636
+ guidanceText: {
1637
+ key: "enterTheRemainingXToYDigitsForExample",
1638
+ values: {
1639
+ minDigits: "9",
1640
+ maxDigits: "12",
1641
+ example: "LT664517219"
1642
+ }
1643
+ }
1644
+ },
1645
+ [CountryCodes.Luxembourg]: {
1646
+ label: "numeroDIdentificationALATaxe",
1647
+ validators: validatePatternOnBlur(/^LU\d{8}$/),
1648
+ mask: {
1649
+ mask: makeMask(...nonInputs("LU", { includeInValue: true }), spacer, ...numericInputs(8))
1650
+ },
1651
+ guidanceText: {
1652
+ key: "enterTheRemainingNDigitsForExample",
1653
+ values: {
1654
+ numDigits: "8",
1655
+ example: "LU18928066"
1656
+ }
1657
+ }
1658
+ },
1659
+ [CountryCodes.Malaysia]: {
1660
+ label: "SST",
1661
+ validators: validatePatternOnBlur(/^([A-Z]\d{2}[-]\d{4}[-]\d{8}|\d{12})$/),
1662
+ guidanceText: {
1663
+ key: "enterXOrYCharactersForExample",
1664
+ values: {
1665
+ xChars: "12",
1666
+ yChars: "14",
1667
+ example: "123456789012, D11-1808-20032117"
1668
+ }
1669
+ }
1670
+ },
1671
+ [CountryCodes.Malta]: {
1672
+ label: "vatNumber",
1673
+ validators: validatePatternOnBlur(/^MT\d{8}$/),
1674
+ mask: {
1675
+ mask: makeMask(...nonInputs("MT", { includeInValue: true }), spacer, ...numericInputs(8))
1676
+ },
1677
+ guidanceText: {
1678
+ key: "enterTheRemainingNDigitsForExample",
1679
+ values: {
1680
+ numDigits: "8",
1681
+ example: "MT12345678"
1682
+ }
1683
+ }
1684
+ },
1685
+ [CountryCodes.Monaco]: {
1686
+ label: "numeroDIdentificationALATaxe",
1687
+ validators: validatePatternOnBlur(/^FR[0-9]{11}$/),
1688
+ mask: {
1689
+ mask: makeMask(...nonInputs("FR", { includeInValue: true }), spacer, ...numericInputs(11))
1690
+ },
1691
+ guidanceText: {
1692
+ key: "enterTheRemainingNDigitsForExample",
1693
+ values: {
1694
+ numDigits: "11",
1695
+ example: "FR12345678999"
1696
+ }
1697
+ }
1698
+ },
1699
+ [CountryCodes.Netherlands]: {
1700
+ label: "btwNummer",
1701
+ validators: validatePatternOnBlur(/^NL\d{9}B\d{2}$/),
1702
+ mask: {
1703
+ mask: makeMask(
1704
+ ...nonInputs("NL", { includeInValue: true }),
1705
+ spacer,
1706
+ ...numericInputs(9),
1707
+ spacer,
1708
+ ...nonInputs("B", { includeInValue: true }),
1709
+ spacer,
1710
+ ...numericInputs(2)
1711
+ ),
1712
+ transformOnType: uppercase
1713
+ },
1714
+ guidanceText: {
1715
+ key: "enterTheRemainingNCharactersForExample",
1716
+ values: {
1717
+ numChars: "12",
1718
+ example: "NL123456789B01"
1719
+ }
1720
+ }
1721
+ },
1722
+ [CountryCodes.Norway]: {
1723
+ label: "mvanummer",
1724
+ validators: validatePatternOnBlur(/^\d{9}MVA$/),
1725
+ mask: {
1726
+ mask: makeMask(
1727
+ ...numericInputs(9),
1728
+ ...nonInputs("MVA", { includeInValue: true, displayEagerly: true })
1729
+ )
1730
+ },
1731
+ guidanceText: {
1732
+ key: "enterNDigitsForExample",
1733
+ values: {
1734
+ numDigits: "9",
1735
+ example: "123456789MVA"
1736
+ }
1737
+ }
1738
+ },
1739
+ [CountryCodes.Poland]: {
1740
+ label: "NIP",
1741
+ validators: validatePatternOnBlur(/^PL\d{10}$/),
1742
+ mask: {
1743
+ mask: makeMask(...nonInputs("PL", { includeInValue: true }), spacer, ...numericInputs(10))
1744
+ },
1745
+ guidanceText: {
1746
+ key: "enterTheRemainingNDigitsForExample",
1747
+ values: {
1748
+ numDigits: "10",
1749
+ example: "PL1234567890"
1750
+ }
1751
+ }
1752
+ },
1753
+ [CountryCodes.Portugal]: {
1754
+ label: "numerodeIVA",
1755
+ validators: validatePatternOnBlur(/^PT\d{9}$/),
1756
+ mask: {
1757
+ mask: makeMask(...nonInputs("PT", { includeInValue: true }), spacer, ...numericInputs(9))
1758
+ },
1759
+ guidanceText: {
1760
+ key: "enterTheRemainingNDigitsForExample",
1761
+ values: {
1762
+ numDigits: "9",
1763
+ example: "PT123456789"
1764
+ }
1765
+ }
1766
+ },
1767
+ [CountryCodes.Romania]: {
1768
+ label: "codulDeIdentificareFiscala",
1769
+ validators: validatePatternOnBlur(/^RO\d{2,12}$/),
1770
+ mask: {
1771
+ mask: makeMask(
1772
+ ...nonInputs("RO", { includeInValue: true }),
1773
+ spacer,
1774
+ ...numericInputs(2),
1775
+ ...numericInputs(8, true)
1776
+ )
1777
+ },
1778
+ guidanceText: {
1779
+ key: "enterTheRemainingXToYDigitsForExample",
1780
+ values: {
1781
+ minDigits: "2",
1782
+ maxDigits: "10",
1783
+ example: "RO12345678"
1784
+ }
1785
+ }
1786
+ },
1787
+ [CountryCodes.Slovakia]: {
1788
+ label: "skTaxId",
1789
+ validators: validatePatternOnBlur(/^SK\d{10}$/),
1790
+ mask: {
1791
+ mask: makeMask(...nonInputs("SK", { includeInValue: true }), spacer, ...numericInputs(10))
1792
+ },
1793
+ guidanceText: {
1794
+ key: "enterTheRemainingNDigitsForExample",
1795
+ values: {
1796
+ numDigits: "10",
1797
+ example: "SK1234567890"
1798
+ }
1799
+ }
1800
+ },
1801
+ [CountryCodes.Slovenia]: {
1802
+ label: "siTaxId",
1803
+ validators: validatePatternOnBlur(/^SI\d{8}$/),
1804
+ mask: {
1805
+ mask: makeMask(...nonInputs("SI", { includeInValue: true }), spacer, ...numericInputs(8))
1806
+ },
1807
+ guidanceText: {
1808
+ key: "enterTheRemainingNDigitsForExample",
1809
+ values: {
1810
+ numDigits: "8",
1811
+ example: "SI12345678"
1812
+ }
1813
+ }
1814
+ },
1815
+ [CountryCodes.Spain]: {
1816
+ label: "NIFdeIVA",
1817
+ validators: validatePatternOnBlur(/^ES[A-Z0-9]\d{7}[A-Z0-9]$/),
1818
+ mask: {
1819
+ mask: makeMask(
1820
+ ...nonInputs("ES", { includeInValue: true }),
1821
+ spacer,
1822
+ ...alphanumericInputs(9)
1823
+ ),
1824
+ transformOnType: uppercase
1825
+ },
1826
+ guidanceText: {
1827
+ key: "enterTheRemainingNCharactersForExample",
1828
+ values: {
1829
+ numChars: "9",
1830
+ example: "ES12345678X"
1831
+ }
1832
+ }
1833
+ },
1834
+ [CountryCodes.Sweden]: {
1835
+ label: "vatNummerMomsregistreringsnummerOrMomsnummer",
1836
+ validators: validatePatternOnBlur(/^SE\d{12}$/),
1837
+ mask: {
1838
+ mask: makeMask(...nonInputs("SE", { includeInValue: true }), spacer, ...numericInputs(12))
1839
+ },
1840
+ guidanceText: {
1841
+ key: "enterTheRemainingNDigitsForExample",
1842
+ values: {
1843
+ numDigits: "12",
1844
+ example: "SE123456789001"
1845
+ }
1846
+ }
1847
+ },
1848
+ [CountryCodes.Switzerland]: {
1849
+ label: "Mehrwertsteuernummer",
1850
+ // CHE123456789TVA | CHE....MWST | CHE.......IVA
1851
+ validators: validatePatternOnBlur(/^CHE\d{9}(TVA|MWST|IVA)$/),
1852
+ mask: {
1853
+ mask: makeMask(
1854
+ ...nonInputs("CHE", { includeInValue: true }),
1855
+ ...nonInputs(" - "),
1856
+ ...numericInputs(3),
1857
+ ...nonInputs(" . "),
1858
+ ...numericInputs(3),
1859
+ ...nonInputs(" . "),
1860
+ ...numericInputs(3),
1861
+ spacer,
1862
+ ...alphaInputs(3),
1863
+ ...alphaInputs(1, true)
1864
+ ),
1865
+ transformOnType: uppercase
1866
+ },
1867
+ guidanceText: {
1868
+ key: "enterTheRemainingNDigitsThenXToYLettersForExample",
1869
+ values: {
1870
+ numDigits: "9",
1871
+ minLetters: "3",
1872
+ maxLetters: "4",
1873
+ example: "CHE-123.456.789 TVA"
1874
+ }
1875
+ }
1876
+ },
1877
+ [CountryCodes.UnitedArabEmirates]: {
1878
+ label: "vatRegistrationNumber",
1879
+ validators: validateNotEmptyOnBlur
1880
+ },
1881
+ [CountryCodes.UnitedKingdom]: {
1882
+ label: "vatRegistrationNumber",
1883
+ validators: validatePatternOnBlur(/^GB\d{9,12}$/),
1884
+ mask: {
1885
+ mask: makeMask(
1886
+ ...nonInputs("GB", { includeInValue: true }),
1887
+ spacer,
1888
+ ...numericInputs(9),
1889
+ ...numericInputs(3, true)
1890
+ )
1891
+ },
1892
+ guidanceText: {
1893
+ key: "enterTheRemainingXToYDigitsForExample",
1894
+ values: {
1895
+ minDigits: "9",
1896
+ maxDigits: "12",
1897
+ example: "GB1234567890"
1898
+ }
1899
+ }
1900
+ },
1901
+ /**
1902
+ * NOT YET SUPPORTED
1903
+ * These are brought over from the old pattern files. We have no idea if they are accurate or not.
1904
+ * See https://en.wikipedia.org/wiki/VAT_identification_number
1905
+ */
1906
+ [CountryCodes.Albania]: {
1907
+ validators: validatePatternOnBlur(/^[JKLM][A-Z0-9]{8}[A-Z]$/)
1908
+ },
1909
+ [CountryCodes.Belarus]: {
1910
+ validators: validatePatternOnBlur(/^\d{9}$/)
1911
+ },
1912
+ [CountryCodes.RussianFederation]: {
1913
+ validators: validatePatternOnBlur(/^(\d{10}|\d{12})$/)
1914
+ },
1915
+ [CountryCodes.SanMarino]: {
1916
+ validators: validatePatternOnBlur(/^\d{5}$/)
1917
+ },
1918
+ [CountryCodes.Serbia]: {
1919
+ validators: validatePatternOnBlur(/^\d{9}$/)
1920
+ },
1921
+ [CountryCodes.Turkey]: {
1922
+ validators: validatePatternOnBlur(/^\d{10}$/)
1923
+ },
1924
+ [CountryCodes.Ukraine]: {
1925
+ validators: validatePatternOnBlur(/^\d{12}$/)
1926
+ },
1927
+ [CountryCodes.Argentina]: {
1928
+ validators: validatePatternOnBlur(/^\d{11}$/)
1929
+ },
1930
+ [CountryCodes.Chile]: {
1931
+ validators: validatePatternOnBlur(/^\d{9}$/)
1932
+ },
1933
+ [CountryCodes.Colombia]: {
1934
+ validators: validatePatternOnBlur(/^\d{10}$/)
1935
+ },
1936
+ [CountryCodes.CostaRica]: {
1937
+ validators: validatePatternOnBlur(/^\d{9,12}$/)
1938
+ },
1939
+ [CountryCodes.Ecuador]: {
1940
+ validators: validatePatternOnBlur(/^\d{13}$/)
1941
+ },
1942
+ [CountryCodes.Guatemala]: {
1943
+ validators: validatePatternOnBlur(/^\d{8}$/)
1944
+ },
1945
+ [CountryCodes.Peru]: {
1946
+ validators: validatePatternOnBlur(/^\d{11}$/)
1947
+ },
1948
+ [CountryCodes.Venezuela]: {
1949
+ validators: validatePatternOnBlur(/^[JGVE]-\d{8}-?\d$/)
1950
+ }
1951
+ };
1952
+ const inferVatNumberType = (vatNumber, country) => {
1953
+ const optionsForCountry = vatNumberOptions[country];
1954
+ const metadataFn = defaultFieldConfig[country];
1955
+ if (!optionsForCountry || !metadataFn) return void 0;
1956
+ for (const option of optionsForCountry) {
1957
+ const fieldMetadata = typeof metadataFn === "function" ? metadataFn({
1958
+ vatNumberType: option.id
1959
+ }) : metadataFn;
1960
+ if (!fieldMetadata.validators) continue;
1961
+ const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
1962
+ if (validators.every((validator) => validator.validate(vatNumber))) {
1963
+ return option.id;
1964
+ }
1965
+ }
1966
+ };
1967
+ function getDefaultVatNumberType(vatNumber, country) {
1968
+ return vatNumber ? inferVatNumberType(vatNumber, country) : vatNumberOptions[country]?.[0]?.id;
1969
+ }
1970
+ function VatNumberTypeSelector({
1971
+ country,
1972
+ companyType,
1973
+ selected,
1974
+ setSelected,
1975
+ exemptedOption
1976
+ }) {
1977
+ const { t } = useTranslation("common");
1978
+ const handleSelect = useCallback(
1979
+ (selectedStr) => {
1980
+ const newSelected = selectedStr;
1981
+ if (newSelected === "exempted") {
1982
+ if (exemptedOption) {
1983
+ setSelected(newSelected);
1984
+ }
1985
+ return;
1986
+ }
1987
+ setSelected(newSelected);
1988
+ },
1989
+ [exemptedOption, setSelected]
1990
+ );
1991
+ const options = useMemo(() => {
1992
+ const availableOptions = getVatNumberOptions(country, companyType) ?? [];
1993
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
1994
+ return [
1995
+ ...availableOptions,
1996
+ {
1997
+ id: "exempted",
1998
+ name: exemptedOption
1999
+ }
2000
+ ];
2001
+ }, [country, companyType, exemptedOption]);
2002
+ useEffect(() => {
2003
+ if (!selected && options.length > 0) {
2004
+ handleSelect(options[0].id);
2005
+ }
2006
+ }, [options, selected, handleSelect]);
2007
+ if (options.length <= 1) return null;
2008
+ return /* @__PURE__ */ jsx(
2009
+ Field,
2010
+ {
2011
+ el: "fieldset",
2012
+ name: "vatNumberType",
2013
+ label: t(($) => $["whichTypeOfTaxIdNumberDoYouHave"]),
2014
+ children: (childProps) => /* @__PURE__ */ jsx(
2015
+ RadioGroup,
2016
+ {
2017
+ ...childProps,
2018
+ name: "vatNumberType",
2019
+ items: options,
2020
+ value: selected,
2021
+ onChange: handleSelect
2022
+ }
2023
+ )
2024
+ }
2025
+ );
2026
+ }
2027
+ const VAT_NUMBER_FIELD = [
2028
+ "vatNumber",
2029
+ "vatNumberType",
2030
+ "exemptedFromVat",
2031
+ "vatAbsenceReason"
2032
+ ];
2033
+ function VatNumberField({
2034
+ data,
2035
+ valid,
2036
+ errors,
2037
+ labels,
2038
+ mask,
2039
+ guidanceText,
2040
+ placeholders,
2041
+ readonly,
2042
+ optional,
2043
+ shouldValidate,
2044
+ handleChangeFor,
2045
+ canExempt,
2046
+ country
2047
+ }) {
2048
+ const { isExperimentEnabled } = useExperimentsContext();
2049
+ const options = vatNumberOptions[country];
2050
+ const defaultType = getDefaultVatNumberType(data.vatNumber, country);
2051
+ const vatAbsenceReasons = isExperimentEnabled("ShowExtraTaxExemptionReasons") ? ["belowTaxThreshold", "industryExemption", "countryWithoutVatOrGstSystem"] : ["belowTaxThreshold", "industryExemption"];
2052
+ const showVatExemptedOptions = canExempt && options?.length > 1;
2053
+ const vatNumberType = data.exemptedFromVat ? "exempted" : data.vatNumberType ? data.vatNumberType : defaultType;
2054
+ const handleVatNumberChange = (e, mode) => {
2055
+ const value = typeof e === "string" ? e : e.target?.value;
2056
+ handleChangeFor("vatNumber", mode)(value);
2057
+ handleChangeFor("vatNumberType")(vatNumberType);
2058
+ };
2059
+ const handleVatNumberTypeChange = (vatType, exemptValue) => {
2060
+ if (vatType === "exempted") {
2061
+ if (!canExempt) {
2062
+ throw Error(`${country} does not allow VAT exemptions`);
2063
+ }
2064
+ handleChangeFor("exemptedFromVat")(exemptValue);
2065
+ handleChangeFor("vatNumber")(null);
2066
+ handleChangeFor("vatNumberType")(void 0);
2067
+ return;
2068
+ }
2069
+ handleChangeFor("vatNumberType")(vatType);
2070
+ };
2071
+ if (vatNumberType && vatNumberType !== "exempted") {
2072
+ const countryHasType = options.find((option) => option.id === vatNumberType);
2073
+ if (!countryHasType) {
2074
+ handleChangeFor("vatNumberType")(defaultType);
2075
+ }
2076
+ }
2077
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field__vat-number", children: [
2078
+ /* @__PURE__ */ jsx(
2079
+ VatNumberTypeSelector,
2080
+ {
2081
+ country,
2082
+ setSelected: handleVatNumberTypeChange,
2083
+ selected: vatNumberType,
2084
+ exemptedOption: showVatExemptedOptions ? labels.exemptedFromVat : false
2085
+ }
2086
+ ),
2087
+ /* @__PURE__ */ jsx(
2088
+ MaskedInput,
2089
+ {
2090
+ type: "text",
2091
+ "aria-required": true,
2092
+ "aria-invalid": !valid.vatNumber,
2093
+ name: "vatNumber",
2094
+ value: data?.vatNumber ?? "",
2095
+ label: labels.vatNumber ?? "",
2096
+ formatGuidance: guidanceText?.vatNumber ?? "",
2097
+ placeholder: placeholders?.vatNumber,
2098
+ errorMessage: errors.vatNumber,
2099
+ isValid: Boolean(valid.vatNumber),
2100
+ onInput: (e) => handleVatNumberChange(e, "input"),
2101
+ onBlur: (e) => handleVatNumberChange(e, "blur"),
2102
+ disabled: data.exemptedFromVat,
2103
+ readonly,
2104
+ optional,
2105
+ shouldValidate,
2106
+ ...mask
2107
+ }
2108
+ ),
2109
+ canExempt && !showVatExemptedOptions && /* @__PURE__ */ jsx(Field, { name: "exemptedFromVat", children: (childProps) => /* @__PURE__ */ jsx(
2110
+ Checkbox,
2111
+ {
2112
+ ...childProps,
2113
+ "aria-required": false,
2114
+ "aria-invalid": false,
2115
+ name: "exemptedFromVat",
2116
+ label: labels?.exemptedFromVat,
2117
+ value: "exemptedFromVat",
2118
+ checked: Boolean(data.exemptedFromVat),
2119
+ onChange: (e) => handleVatNumberTypeChange("exempted", e)
2120
+ }
2121
+ ) }),
2122
+ data.exemptedFromVat && /* @__PURE__ */ jsx(
2123
+ Field,
2124
+ {
2125
+ el: "fieldset",
2126
+ name: "vatAbsenceReason",
2127
+ label: labels?.vatAbsenceReason,
2128
+ errorMessage: errors.vatAbsenceReason,
2129
+ isValid: valid.vatAbsenceReason,
2130
+ children: (childProps) => /* @__PURE__ */ jsx(
2131
+ RadioGroup,
2132
+ {
2133
+ ...childProps,
2134
+ name: "vatAbsenceReason",
2135
+ onChange: handleChangeFor("vatAbsenceReason"),
2136
+ value: data.vatAbsenceReason,
2137
+ items: vatAbsenceReasons.map((reason) => ({ id: reason, name: reason }))
2138
+ }
2139
+ )
2140
+ }
2141
+ )
2142
+ ] });
2143
+ }
2144
+ const registrationAddressValidationRules = {
2145
+ operationalAddressIsSame: {
2146
+ modes: ["blur"],
2147
+ validate: (operationalAddressIsSame) => !!operationalAddressIsSame,
2148
+ errorMessage: "fieldIsRequired"
2149
+ }
2150
+ };
2151
+ const registrationAddressFields = [
2152
+ "registrationAddress",
2153
+ "operationalAddress",
2154
+ "operationalAddressIsSame"
2155
+ ];
2156
+ const registrationAddressForms = {
2157
+ registrationAddress: {
2158
+ formId: "registrationAddress"
2159
+ },
2160
+ operationalAddress: {
2161
+ formId: "operationalAddress"
2162
+ }
2163
+ };
2164
+ const registrationAddressFormID = registrationAddressForms.registrationAddress.formId;
2165
+ const operationalAddressFormID = registrationAddressForms.operationalAddress.formId;
2166
+ function RegistrationAddress(props) {
2167
+ const { t } = useTranslation("common");
2168
+ const { id, heading, description, country, data, validators, problems } = props;
2169
+ const {
2170
+ requiredFields: registrationAddressRequiredFields,
2171
+ optionalFields: registrationAddressOptionalFields,
2172
+ readOnlyFields: registrationAddressReadOnlyFields,
2173
+ obscuredFields: registrationAddressObscuredFields,
2174
+ verifyFields: registrationAddressVerifyFields,
2175
+ trustedFields: registrationAddressTrustedFields
2176
+ } = getFormProps(props, registrationAddressFormID);
2177
+ const {
2178
+ data: formData,
2179
+ valid: formValid,
2180
+ errors: formErrors,
2181
+ fieldProblems: formFieldProblems,
2182
+ handleChangeFor,
2183
+ setValid
2184
+ } = useForm({
2185
+ ...props,
2186
+ schema: ["operationalAddressIsSame"],
2187
+ defaultData: data,
2188
+ rules: validators || registrationAddressValidationRules,
2189
+ obscuredFields: [],
2190
+ optionalFields: registrationAddressOptionalFields,
2191
+ trustedFields: registrationAddressTrustedFields
2192
+ });
2193
+ const mergedProps = {
2194
+ ...props,
2195
+ requiredFields: registrationAddressRequiredFields,
2196
+ optionalFields: registrationAddressOptionalFields,
2197
+ readOnlyFields: registrationAddressReadOnlyFields,
2198
+ obscuredFields: registrationAddressObscuredFields,
2199
+ trustedFields: registrationAddressTrustedFields
2200
+ };
2201
+ const formUtils = createFormUtils(mergedProps, t);
2202
+ const stateRef = useRef({ setState: null });
2203
+ useEffect(() => {
2204
+ stateRef?.current?.setState?.({
2205
+ type: "addToState",
2206
+ value: {
2207
+ data: formData,
2208
+ valid: formValid,
2209
+ errors: formErrors,
2210
+ fieldProblems: formFieldProblems,
2211
+ dataStoreId: id,
2212
+ schema: [
2213
+ "registrationAddress",
2214
+ "operationalAddressIsSame",
2215
+ ...isOperationAddressNotSame() ? ["operationalAddress"] : []
2216
+ ]
2217
+ }
2218
+ });
2219
+ }, [formData, formValid, formErrors, formFieldProblems]);
2220
+ const isOperationAddressNotSame = () => formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME;
2221
+ const registrationAddressFormProps = getFormProps(props, registrationAddressFormID);
2222
+ const operationalAddressFormProps = getFormProps(props, operationalAddressFormID);
2223
+ const handleRegistrationAddressChange = (state) => {
2224
+ handleChangeFor("registrationAddress")(state.data);
2225
+ setValid("registrationAddress", Boolean(state.isValid));
2226
+ };
2227
+ const handleOperationalAddressChange = (state) => {
2228
+ handleChangeFor("operationalAddress")(state.data);
2229
+ setValid("operationalAddress", Boolean(state.isValid));
2230
+ };
2231
+ const handleOperationalAddressIsSameChange = (value) => {
2232
+ handleChangeFor("operationalAddressIsSame")(value);
2233
+ if (value === "OperationAddressAnswerYes") setValid("operationalAddress", true);
2234
+ };
2235
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2236
+ /* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
2237
+ /* @__PURE__ */ jsx(FormHeader, { heading, description }),
2238
+ /* @__PURE__ */ jsx(
2239
+ ErrorPanel,
2240
+ {
2241
+ verificationErrors: id ? problems?.verificationErrors?.[id] : void 0,
2242
+ validationErrors: id ? problems?.validationErrors?.[id] : void 0,
2243
+ formUtils,
2244
+ id: "ariaErrorField"
2245
+ }
2246
+ ),
2247
+ /* @__PURE__ */ jsx(
2248
+ ContextGuidance,
2249
+ {
2250
+ titleId: "whyDoINeedToFillInThisInformation",
2251
+ contentId: "reasonForFillingCompanyAddressDetails",
2252
+ title: t(($) => $["whyDoINeedToFillInThisInformation"]),
2253
+ content: t(($) => $["reasonForFillingCompanyAddressDetails"])
2254
+ }
2255
+ ),
2256
+ /* @__PURE__ */ jsx(
2257
+ Address,
2258
+ {
2259
+ ...registrationAddressFormProps,
2260
+ data: { ...registrationAddressFormProps?.data, country },
2261
+ hideCountry: true,
2262
+ id,
2263
+ addressType: "registrationAddress",
2264
+ optionalFields: ["otherAddressInformation"],
2265
+ onChange: handleRegistrationAddressChange
2266
+ }
2267
+ ),
2268
+ /* @__PURE__ */ jsx(
2269
+ FormHeader,
2270
+ {
2271
+ className: "adyen-kyc-u-margin-top-32",
2272
+ heading: t(($) => $["operationalAddressHeader"])
2273
+ }
2274
+ ),
2275
+ /* @__PURE__ */ jsx(
2276
+ Field,
2277
+ {
2278
+ el: "fieldset",
2279
+ name: "operationalAddressIsSame",
2280
+ label: formUtils.getLabel("operationalAddressIsSame"),
2281
+ errorMessage: formErrors.operationalAddressIsSame?.errorMessage,
2282
+ children: (childProps) => /* @__PURE__ */ jsx(
2283
+ RadioGroup,
2284
+ {
2285
+ ...childProps,
2286
+ name: "operationalAddressIsSame",
2287
+ items: operationalAddressIsSameItems,
2288
+ value: formData.operationalAddressIsSame,
2289
+ disabled: formUtils.isReadOnly("operationalAddressIsSame"),
2290
+ onChange: handleOperationalAddressIsSameChange,
2291
+ "aria-required": true,
2292
+ "aria-invalid": !formValid.operationalAddressIsSame
2293
+ }
2294
+ )
2295
+ }
2296
+ ),
2297
+ isOperationAddressNotSame() && /* @__PURE__ */ createElement(
2298
+ Address,
2299
+ {
2300
+ ...operationalAddressFormProps,
2301
+ key: "operationalAddress",
2302
+ data: { ...operationalAddressFormProps?.data, country },
2303
+ hideCountry: true,
2304
+ id,
2305
+ optionalFields: ["otherAddressInformation"],
2306
+ addressType: "operationalAddress",
2307
+ onChange: handleOperationalAddressChange
2308
+ }
2309
+ )
2310
+ ] });
2311
+ }
2312
+ export {
2313
+ BUSINESS_REGISTRATION_NUMBER_FIELD as B,
2314
+ DBA_NAME_FIELD as D,
2315
+ MemoizedConstitutionalDocument as M,
2316
+ RegistrationAddress as R,
2317
+ VAT_NUMBER_FIELD as V,
2318
+ defaultFieldConfig as a,
2319
+ registrationNumberDefaultFieldConfig as b,
2320
+ doingBusinessAsFieldMetadata as c,
2321
+ defaultFieldMetadata as d,
2322
+ doingBusinessAsAbsentFieldMetadata as e,
2323
+ DBANameField as f,
2324
+ BusinessRegistrationNumberField as g,
2325
+ VatNumberField as h,
2326
+ exemptFromRegistrationNumberDefaultFieldMetadata as i,
2327
+ registrationAddressFields as j,
2328
+ getDefaultVatNumberType as k,
2329
+ exemptFromRegistrationNumberDefaultFieldConfig as l,
2330
+ getDefaultRegistrationNumberType as m,
2331
+ inferCompanyRegistrationNumberType as n,
2332
+ registrationNumberDefaultFieldMetadata as r,
2333
+ vatAbsenceReasonMetadata as v
2334
+ };