@adyen/kyc-components 3.91.0 → 3.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/dist/{4-people-BzyXLUF9.js → 4-people-BtDi7O9A.js} +2 -2
  2. package/dist/{AcceptTermsOfServiceComponent-Bl8Skw0p.js → AcceptTermsOfServiceComponent-T7eWi57Z.js} +17 -14
  3. package/dist/{Accordion-BxBwztLx.js → Accordion-Boa_Vira.js} +2 -2
  4. package/dist/{AccountSetupRejected-DWnI467S.js → AccountSetupRejected-LAVhMMBt.js} +4 -4
  5. package/dist/{ActionBar-BI8EL50o.js → ActionBar-CK8dwgSJ.js} +1 -1
  6. package/dist/{Address-BUrDDnmR.js → Address-ki-bCjUJ.js} +23 -289
  7. package/dist/{Alert-B83aFhFn.js → Alert-TCEgDc2-.js} +3 -3
  8. package/dist/{Avatar-CWGv3_UH.js → Avatar-AC-D1DKh.js} +2 -2
  9. package/dist/{BusinessFinancingComponent-Dp9pkrSs.js → BusinessFinancingComponent-Cf-EEnyR.js} +6 -6
  10. package/dist/{BusinessFinancingDropin-CxDQONVa.js → BusinessFinancingDropin-DeLlYaOF.js} +30 -22
  11. package/dist/{BusinessFinancingPage-CK4iko3V.js → BusinessFinancingPage-DtX8x3Zp.js} +4 -4
  12. package/dist/{BusinessTypeSelectionPage-BbCt3hSM.js → BusinessTypeSelectionPage-6Ltt53Mu.js} +58 -33
  13. package/dist/{Card-CQrP0PXC.js → Card-Det7uTiv.js} +2 -2
  14. package/dist/{debouncedInputEvent-CFFx_oML.js → Checkbox-D8rB6_HN.js} +3 -38
  15. package/dist/Confirm-Ctfqp-1b.js +64 -0
  16. package/dist/ConstitutionalDocument-TJAc9nDQ.js +2358 -0
  17. package/dist/ContextGuidance-CCknw_Y1.js +34 -0
  18. package/dist/CountryField-DzmOWqiE.js +66 -0
  19. package/dist/{CreateIndividualComponent-B6ecxCd8.js → CreateIndividualComponent-_H34wdze.js} +6 -6
  20. package/dist/{CreateTransferInstrumentComponent-Chqddjgy.js → CreateTransferInstrumentComponent-CmnVEFaB.js} +5 -12
  21. package/dist/{Currency-CkQVLmOQ.js → Currency-C2egEHMF.js} +64 -8
  22. package/dist/{CustomerSupport-BDynvVnl.js → CustomerSupport-DLfbNC-J.js} +12 -10
  23. package/dist/{DebugModal-DAu7rz8a.js → DebugModal-C0uG_A8N.js} +8 -7
  24. package/dist/{DecisionMakerDetailsPage-BBqNmh_M.js → DecisionMakerDetailsPage-BTR-hRwO.js} +6 -6
  25. package/dist/{DecisionMakers-Ddvw0N__.js → DecisionMakers-B4qQ3M6Y.js} +27 -21
  26. package/dist/Dropzone-CKT3THCY.js +218 -0
  27. package/dist/{EmbeddedStatus-BSK268B-.js → EmbeddedStatus-Bst5MPzi.js} +3 -3
  28. package/dist/{EndStateLayout-B8KmFejY.js → EndStateLayout-Ck_Lvgng.js} +2 -2
  29. package/dist/{EntityAssociation-DBPiXzNF.js → EntityAssociation-bcF_I_DK.js} +8 -8
  30. package/dist/{EntityGuidanceStatus-QEzHcb28.js → EntityGuidanceStatus-D6VoRE_0.js} +4 -3
  31. package/dist/ErrorPanel-CFN2G9Vz.js +190 -0
  32. package/dist/Field-B3Vy1-QZ.js +142 -0
  33. package/dist/{FormNavigation-DLJbUsy3.js → FormNavigation-Brw-75s0.js} +3 -3
  34. package/dist/{FormWrapper-41qnDF4W.js → FormWrapper-BcNyCMkD.js} +10 -10
  35. package/dist/Header-YafgG5Nz.js +83 -0
  36. package/dist/Image-Cvb4hnru.js +44 -0
  37. package/dist/{IndividualOnfido-pGSPtITh.js → IndividualOnfidoDropin-Dy5obHs1.js} +3833 -5548
  38. package/dist/InputDate-UCHQ3zOB.js +43 -0
  39. package/dist/InputGroup-WBfGDV5F.js +32 -0
  40. package/dist/InputText-DGKAS6ZI.js +134 -0
  41. package/dist/{Introduction-DaRfsN8P.js → Introduction-DOxSVZ6X.js} +4 -4
  42. package/dist/{JpAddress-BrtEV6zM.js → JpAddress-DClXaVjy.js} +22 -10
  43. package/dist/LandingLayout-co7NR2te.js +60 -0
  44. package/dist/{LegalRepresentativeDetailsPage-XcmRRT7P.js → LegalRepresentativeDetailsPage-DOP3L2r9.js} +4 -4
  45. package/dist/Link-DWTJ55UO.js +35 -0
  46. package/dist/List-BAzyC6sw.js +83 -0
  47. package/dist/{ListItem-DlRGqcSA.js → ListItem-B8D-kUHN.js} +3 -3
  48. package/dist/LoaderWrapper-CUz5NRFr.js +42 -0
  49. package/dist/{ManageIndividualComponent-BpzsaZ1O.js → ManageIndividualComponent-DND7vuna.js} +5 -5
  50. package/dist/{ManageTermsOfServiceComponent-D9i2HO5I.js → ManageTermsOfServiceComponent-ylDupO1E.js} +5 -5
  51. package/dist/{ManageTransferInstrumentComponent-C6LYppym.js → ManageTransferInstrumentComponent-CgUfGP5E.js} +16 -13
  52. package/dist/{Spacer-w89ksCbG.js → MaskedInput-Cn0VAuEp.js} +17 -631
  53. package/dist/{MaybeModal-DW5SxNsJ.js → MaybeModal-CWCEHeOg.js} +3 -3
  54. package/dist/{Modal-B4wxf7HK.js → Modal-pyBUluei.js} +2 -2
  55. package/dist/OnboardingDropinComponent-DwKImil4.js +2306 -0
  56. package/dist/{PayoutDetailsDropin-BKXxBApD.js → PayoutDetailsDropin-lYVb5WCQ.js} +105 -76
  57. package/dist/Radio-BMtxBpnn.js +39 -0
  58. package/dist/RadioGroup-DPc8nUuk.js +98 -0
  59. package/dist/RadioGroupCard-Pj9qq4uW.js +150 -0
  60. package/dist/{Review-DSdM3vGX.js → Review-gkTjl3a8.js} +7 -7
  61. package/dist/{RootBusinessDetailsPage-CqpiMFn9.js → RootBusinessDetailsPage-DjwEzuLA.js} +5 -5
  62. package/dist/{RootBusinessLinesPage-DUIp_zfH.js → RootBusinessLinesPage-2-U3mf6i.js} +104 -50
  63. package/dist/{RootIndividualDetailsPage-BpTbnRMJ.js → RootIndividualDetailsPage-BFYP63_i.js} +6 -6
  64. package/dist/{useForm-_Kjd_HFb.js → Select-D1rFT3T8.js} +10 -775
  65. package/dist/{SignPCIComponent-B-nJZ1cD.js → SignPCIComponent-DqElmjjG.js} +13 -11
  66. package/dist/{SingpassSelection-D7wRmaLb.js → SingpassSelection-eruroIiQ.js} +9 -7
  67. package/dist/{SoleProprietorshipPage-DUVjo6fc.js → SoleProprietorshipPage-7YdzA7iH.js} +4 -4
  68. package/dist/{SourceOfFundsPage-CFDBqD8v.js → SourceOfFundsPage-C_wiSoc4.js} +39 -26
  69. package/dist/Spacer-BK3jDget.js +18 -0
  70. package/dist/{StepProgressIndicator-BvU4jA3I.js → StepProgressIndicator-DLoEzGro.js} +1 -1
  71. package/dist/{StoreProvider-CyzNf7KK.js → StoreProvider-D9IR5HNN.js} +331 -222
  72. package/dist/StructuredList-9dnJRdx_.js +61 -0
  73. package/dist/{Summary-QyNHKBjO.js → Summary-Bq94iVfc.js} +10 -5
  74. package/dist/{InputText-DLAmX8CW.js → TaskVerificationStatus-BLCkXEn6.js} +3 -123
  75. package/dist/TaxInformationField-c-ZWfhUk.js +3134 -0
  76. package/dist/{TaxReportingDropin-Bn2xYbVw.js → TaxReportingDropin-ajO0q4eZ.js} +20 -17
  77. package/dist/TextArea-D9eJloeE.js +103 -0
  78. package/dist/TileGroup-CaY3i_T7.js +203 -0
  79. package/dist/{TrustDetailsPage-D0sr6zMt.js → TrustDetailsPage-BWXZX4-u.js} +40 -27
  80. package/dist/{TrustMemberCompanyPage-4sIP-M16.js → TrustMemberCompanyPage-CJj2BpXu.js} +5 -5
  81. package/dist/{TrustMemberIndividualPage-CelIjIAw.js → TrustMemberIndividualPage-BXp9RXDw.js} +4 -4
  82. package/dist/{TrustMemberRoleAndTypePage-C3CRy717.js → TrustMemberRoleAndTypePage-gYJ5U6RH.js} +24 -14
  83. package/dist/{TrustMembersOverview-HrRgAsno.js → TrustMembersOverview-Chmnt5jS.js} +13 -12
  84. package/dist/{UnincorporatedPartnershipIndividualPage-Dre5_Nuk.js → UnincorporatedPartnershipIndividualPage-DckUiPPY.js} +4 -4
  85. package/dist/{UnincorporatedPartnershipMemberCompanyPage-woQiy94h.js → UnincorporatedPartnershipMemberCompanyPage-Bx0A5Bit.js} +5 -5
  86. package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-DrirgJXY.js → UnincorporatedPartnershipMemberRoleAndTypePage-CEE1hzIn.js} +23 -16
  87. package/dist/{UnincorporatedPartnershipMembersOverview-BBiRqJkR.js → UnincorporatedPartnershipMembersOverview-wB8K9r6g.js} +10 -9
  88. package/dist/{VerificationErrorAlert-B_ovSmUS.js → VerificationErrorAlert-DZ5OOTBN.js} +4 -4
  89. package/dist/{ViewVerificationStatusComponent-CDQk4Nxa.js → ViewVerificationStatusComponent-BVY4YUJf.js} +4 -4
  90. package/dist/adyen-business-financing.js +3 -3
  91. package/dist/adyen-individual-configuration.js +3 -3
  92. package/dist/adyen-individual-status.js +3 -3
  93. package/dist/adyen-kyc-components.js +21 -20
  94. package/dist/adyen-onboarding.js +3 -3
  95. package/dist/adyen-terms-of-service-management.js +3 -3
  96. package/dist/adyen-terms-of-service-status.js +3 -3
  97. package/dist/adyen-transfer-instrument-configuration.js +3 -3
  98. package/dist/adyen-transfer-instrument-management.js +3 -3
  99. package/dist/adyen-verification-status.js +3 -3
  100. package/dist/{arrow-right-KxA3SvQj.js → arrow-right-BoqwUH_d.js} +2 -2
  101. package/dist/bafinUtils-Wct4TWLH.js +149 -0
  102. package/dist/{bag-BPumznWh.js → bag-BXVWLrwo.js} +2 -2
  103. package/dist/{bank-D6FiNBhs.js → bank-1GvaHPAZ.js} +2 -2
  104. package/dist/{bin-Bz6KOIeE.js → bin-Ba-3ll8T.js} +2 -2
  105. package/dist/{business-lines-DboUCbXw.js → business-lines-BAqTbnBw.js} +2 -2
  106. package/dist/{capital-GVQ3svwN.js → capital-9TKHySO7.js} +2 -2
  107. package/dist/{cash-stack-D9AoDDwt.js → cash-stack-DwYu4xNy.js} +2 -2
  108. package/dist/{certificate-CdEWgHQf.js → certificate-N2YFedpI.js} +2 -2
  109. package/dist/{checkmark-Q7x6tGhy.js → checkmark-D9dGhGpG.js} +2 -2
  110. package/dist/{checkmark-circle-x7dzbp3I.js → checkmark-circle-CFWClLQ6.js} +2 -2
  111. package/dist/{checkmark-circle-fill-CsvN5_PL.js → checkmark-circle-fill-DEB-tuGl.js} +2 -2
  112. package/dist/{checkmark-small-D35myntq.js → checkmark-small-D3VNx2lo.js} +2 -2
  113. package/dist/{chevron-down-C2iDorpW.js → chevron-down-C7SUSYfl.js} +2 -2
  114. package/dist/{chevron-left-ztPO84q-.js → chevron-left-BXmd-S46.js} +2 -2
  115. package/dist/{chevron-right-C_JN0oDt.js → chevron-right-jE6RwM2B.js} +2 -2
  116. package/dist/{chevron-up-CgG8n25g.js → chevron-up-BdfNcqzq.js} +2 -2
  117. package/dist/{circle-Bt3Nlr3q.js → circle-BJPTMCWB.js} +2 -2
  118. package/dist/{circle-small-filled-YMzP6yQU.js → circle-small-filled-BuO8Vg8j.js} +2 -2
  119. package/dist/{clock-BZHremOA.js → clock-DAzaBRWk.js} +2 -2
  120. package/dist/{coins-fkAk6dCo.js → coins-DYdzG5e_.js} +2 -2
  121. package/dist/commonValidators-DcFd5CHs.js +24 -0
  122. package/dist/{contract-BTa4HltT.js → contract-BfJb1t6M.js} +2 -2
  123. package/dist/{cross-Cn09MtQ_.js → cross-CDS_eot4.js} +2 -2
  124. package/dist/{cross-circle-fill-maan7Z5S.js → cross-circle-fill-C-EJ57Yn.js} +2 -2
  125. package/dist/{cross-circle-fill-small-DCz52AuN.js → cross-circle-fill-small-DkPjsuBH.js} +2 -2
  126. package/dist/currency-CrdnaaDu.js +35 -0
  127. package/dist/datasetUtil-BHQp0-xL.js +58 -0
  128. package/dist/debouncedInputEvent-Cv2S512Y.js +46 -0
  129. package/dist/{decision-makers-group-CgddXgrx.js → decision-makers-group-DrvpnEqj.js} +2 -2
  130. package/dist/{digital-wallet-D_IpxnkN.js → digital-wallet-Bx5YM1LY.js} +2 -2
  131. package/dist/{document-1-C08ut-Dt.js → document-1-qlSTF558.js} +2 -2
  132. package/dist/{document-blurred-2Zpodj3_.js → document-blurred-BiWap0xs.js} +2 -2
  133. package/dist/{document-cut-off-ClS7RiOp.js → document-cut-off-aQezqOif.js} +2 -2
  134. package/dist/{document-expired-CjksBq-N.js → document-expired-BhBXaWWQ.js} +2 -2
  135. package/dist/{document-front-DiAairT3.js → document-front-DYuhZGeQ.js} +2 -2
  136. package/dist/{document-person-vxlA6C5f.js → document-person-CDbnTOdV.js} +2 -2
  137. package/dist/{download-Drhk9k1f.js → download-BZQB1WkZ.js} +2 -2
  138. package/dist/{dropinUtils-DCWhMKpQ.js → dropinUtils-BpJn607e.js} +4 -4
  139. package/dist/{edit-1-CFoDTMvQ.js → edit-1-DAqtnOIx.js} +2 -2
  140. package/dist/{en-US-BzrLvydZ.js → en-US-CjjPhkB5.js} +2 -2
  141. package/dist/{external-link-DCMYUMfW.js → external-link-Cg6pJaSJ.js} +2 -2
  142. package/dist/fieldConfig-BPwb1GHc.js +134 -0
  143. package/dist/fieldConfigurations-BUT9DTUH.js +21 -0
  144. package/dist/form-rules-DhbF2mY4.js +13 -0
  145. package/dist/formUtils-BlVlgetw.js +137 -0
  146. package/dist/{funds-in-D8bj0aoE.js → funds-in-CInoUdmG.js} +2 -2
  147. package/dist/{getName-l7X1ZGKx.js → getName-CzpJ9tV7.js} +2 -2
  148. package/dist/getProps-CLJfvUMb.js +156 -0
  149. package/dist/{gift-CQ_DEma7.js → gift-omNInZeB.js} +2 -2
  150. package/dist/{graph-BJmqglH2.js → graph-DunG_uu1.js} +2 -2
  151. package/dist/{graph-up-Bq6adtlX.js → graph-up-BZze4i6m.js} +2 -2
  152. package/dist/{hasDataChanged-BXawTZla.js → hasDataChanged-8e8x8zjz.js} +2 -2
  153. package/dist/{headquarter-DNYyuuFq.js → headquarter-BhpSibFO.js} +2 -2
  154. package/dist/{hotel-BuNql78Z.js → hotel-Cp7VgGCJ.js} +2 -2
  155. package/dist/{house-B6sNRj-B.js → house-BhyBQdR3.js} +2 -2
  156. package/dist/{id-blurred-9dzBOWCE.js → id-blurred-B5lHEP8M.js} +2 -2
  157. package/dist/{id-cut-off-CohJCI2h.js → id-cut-off-Ba1FRzKO.js} +2 -2
  158. package/dist/{id-front-CSZfvdRg.js → id-front-CpNWN6nG.js} +2 -2
  159. package/dist/{id-glare-Q2JWo5ts.js → id-glare-DgCQON8k.js} +2 -2
  160. package/dist/{id-verification-instant-BUVBO4R3.js → id-verification-instant-Byt4Oul6.js} +2 -2
  161. package/dist/{id-verification-manual-B3YZALYU.js → id-verification-manual-CvcTkOSY.js} +2 -2
  162. package/dist/{iframeWidget-CbtmWmoO.js → iframeWidget-D6BlBF0m.js} +4 -4
  163. package/dist/{image-BSihO8lR.js → image-CmB0ioUM.js} +2 -2
  164. package/dist/{info-vHTZWoJ7.js → info-Bb_-xIEK.js} +2 -2
  165. package/dist/{info-filled-SQotHmT9.js → info-filled-CK8LB339.js} +2 -2
  166. package/dist/{instant-verification-Dvvkyfmp.js → instant-verification-UrnuHTYn.js} +2 -2
  167. package/dist/isEmpty-CsYVgjoD.js +23 -0
  168. package/dist/japanSupportUtils-iATUjnbf.js +17 -0
  169. package/dist/jpAddressSchema-De6ix57p.js +28 -0
  170. package/dist/{localizeDateString-BX5t59Ip.js → localizeDateString-BHDr1NID.js} +2 -2
  171. package/dist/{location-Q4oKvnkl.js → location-itJfxrDQ.js} +2 -2
  172. package/dist/{mail-BOdyoVqB.js → mail-VHTlAusn.js} +2 -2
  173. package/dist/makeSelectItemForRole-Bm2NwBxD.js +133 -0
  174. package/dist/{manual-verification-BvZWqA00.js → manual-verification-BO8zgAYT.js} +2 -2
  175. package/dist/{mapExistingFile-Bd7nsoK8.js → mapExistingFile-DNBa6Ekj.js} +80 -5
  176. package/dist/mapJpAddressSchemaToAddressLocalizations-BNb8d51F.js +147 -0
  177. package/dist/{mapLegalEntityToIndividualOnfidoSchema-CQF6zsO7.js → mapLegalEntityToIndividualOnfidoSchema-DREgz5Ms.js} +63 -3
  178. package/dist/{mapTransferInstrumentToPayoutAccount-CacHlKHM.js → mapTransferInstrumentToPayoutAccount-C5NqOfNW.js} +2 -2
  179. package/dist/{minus-circle-filled-kC2IUvKz.js → minus-circle-filled-ZhtJ0GD3.js} +2 -2
  180. package/dist/{onfido-logo-BWSv__sQ.js → onfido-logo-BSkKPH10.js} +2 -2
  181. package/dist/{options-horizontal-CBmbNv7R.js → options-horizontal-GuXvLvV3.js} +2 -2
  182. package/dist/{partner-CPjsrePY.js → partner-QD27Vy4w.js} +2 -2
  183. package/dist/{passport-blurred-B4UDQfmc.js → passport-blurred-CVG493IJ.js} +2 -2
  184. package/dist/{passport-cut-off-C0N2mgLk.js → passport-cut-off-COzA_TmB.js} +2 -2
  185. package/dist/{passport-front-BwA7wR91.js → passport-front-WJleLixT.js} +2 -2
  186. package/dist/{passport-front-green-BL4HmtsB.js → passport-front-green-CZVkCa1n.js} +2 -2
  187. package/dist/{passport-glare-Mg2ixsYA.js → passport-glare-BP5WnJZj.js} +2 -2
  188. package/dist/patternValidators-BXduwLbz.js +83 -0
  189. package/dist/{pay-by-link-plane-BVZndh67.js → pay-by-link-plane-BpY8Q6-B.js} +2 -2
  190. package/dist/{payout-ChUEoLjt.js → payout-DtB68BcZ.js} +2 -2
  191. package/dist/{payout-verification-instant-5u-wvFKv.js → payout-verification-instant-BzpfOQLD.js} +2 -2
  192. package/dist/{payout-verification-manual-BH2mu0UW.js → payout-verification-manual-gNEoeZkV.js} +2 -2
  193. package/dist/{person-DGjUU4S4.js → person-IVZG3t3_.js} +2 -2
  194. package/dist/{plaid-logo-CtActXTN.js → plaid-logo-FsZ7kfL-.js} +2 -2
  195. package/dist/{plus-CWXA5wdX.js → plus-DiALAL8-.js} +2 -2
  196. package/dist/{plus-circle-filled-CbC0u2Y1.js → plus-circle-filled-BzHtTqEN.js} +2 -2
  197. package/dist/{process-field-configurations-BZQqH4-M.js → process-field-configurations-B26ehyAw.js} +3 -3
  198. package/dist/{recurring-CkL4cCM2.js → recurring-DKNs9K3x.js} +2 -2
  199. package/dist/{reporting-DerosUNm.js → reporting-D5ABpLO_.js} +2 -2
  200. package/dist/{resolveEnvironment-C6JtHmZc.js → resolveEnvironment-B5Yrsa4J.js} +3 -3
  201. package/dist/{revenue-accelerate-Dp4Ns_5c.js → revenue-accelerate-D7Sp0V4a.js} +2 -2
  202. package/dist/{review-CxIN9azU.js → review-D4TUjcWF.js} +2 -2
  203. package/dist/roleMetadata-DmgqzhZJ.js +66 -0
  204. package/dist/{rules-ClDW_ZSK.js → rules-B_6RrE9T.js} +6 -5
  205. package/dist/{save-Fgy7EDid.js → save-BfqO2JBI.js} +2 -2
  206. package/dist/{search-C4GZ-Rc1.js → search-Cmzbf5zI.js} +2 -2
  207. package/dist/{show-yPjPmEf8.js → show-IdbU1C6P.js} +2 -2
  208. package/dist/{singpass-logo-BkMSwiGY.js → singpass-logo-wY4xsmTX.js} +2 -2
  209. package/dist/{singpass-verification-instant-hY4eGFwl.js → singpass-verification-instant-JCqTr7Mv.js} +2 -2
  210. package/dist/{singpass-verification-manual-DwhRpy5Q.js → singpass-verification-manual-DQ7XW6R3.js} +2 -2
  211. package/dist/{solution-payments-CNAat9h7.js → solution-payments-DpyE_sdS.js} +2 -2
  212. package/dist/{store-IuAkDRAp.js → store-Btc4GcmU.js} +2 -2
  213. package/dist/style.css +965 -993
  214. package/dist/styles-CLV89_hH.js +965 -993
  215. package/dist/summaryItem-CAQCQSkt.js +18 -0
  216. package/dist/{tax-reporting-graph-DjzwRgE6.js → tax-reporting-graph-hgoilCHZ.js} +2 -2
  217. package/dist/{terminal-1-_me9J9h0.js → terminal-1-D1pwXCoi.js} +2 -2
  218. package/dist/{tink-logo-BcIv93ND.js → tink-logo-DDyjz5eJ.js} +2 -2
  219. package/dist/types/api/businessLines/useCreateBusinessLine.d.ts +1 -1
  220. package/dist/types/api/businessLines/useDeleteBusinessLine.d.ts +1 -1
  221. package/dist/types/api/businessLines/useUpdateBusinessLines.d.ts +1 -1
  222. package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +1 -1
  223. package/dist/types/api/companyDataSet/useClearCompanyData.d.ts +1 -1
  224. package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +1 -1
  225. package/dist/types/api/documentValidation/useDocumentValidate.d.ts +1 -1
  226. package/dist/types/api/documents/useCreateDocument.d.ts +1 -1
  227. package/dist/types/api/documents/useDeleteDocument.d.ts +1 -1
  228. package/dist/types/api/documents/useDocument.d.ts +1 -1
  229. package/dist/types/api/documents/useUpdateDocument.d.ts +1 -1
  230. package/dist/types/api/entityVerifications/useVerifyIdNumber.d.ts +2 -2
  231. package/dist/types/api/idVerificationProviders/idVerificationStartCheck.d.ts +1 -1
  232. package/dist/types/api/idVerificationProviders/useExtractDocumentInformation.d.ts +1 -1
  233. package/dist/types/api/idVerificationProviders/useIdVerificationToken.d.ts +1 -1
  234. package/dist/types/api/legalEntity/useConfirmReview.d.ts +1 -1
  235. package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +1 -1
  236. package/dist/types/api/onboardingStatus/useGenerateOnboardingLink.d.ts +1 -1
  237. package/dist/types/api/pci/useSignPci.d.ts +1 -2
  238. package/dist/types/api/taskStatus/useTaskStatus.d.ts +2 -2
  239. package/dist/types/api/termsOfService/useAcceptTermsOfService.d.ts +1 -1
  240. package/dist/types/api/types.d.ts +2 -1
  241. package/dist/types/api/uiAnalytics/useAnalyticsSession.d.ts +1 -1
  242. package/dist/types/api/uiAnalytics/usePushAnalyticEvent.d.ts +1 -1
  243. package/dist/types/api/validation/useValidateAccountIdentification.d.ts +1 -1
  244. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +0 -1
  245. package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +1 -0
  246. package/dist/types/components/BankAccount/forms/BankVerification/verification/overlay/BankVerificationOverlay.d.ts +1 -1
  247. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +0 -1
  248. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +439 -439
  249. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -1
  250. package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +1 -1
  251. package/dist/types/components/Business/forms/BusinessDetails/form-ids.d.ts +2 -0
  252. package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +1 -0
  253. package/dist/types/components/Business/forms/CompanyStructure/CompanyStructure.d.ts +0 -1
  254. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -1
  255. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -1
  256. package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +1 -1
  257. package/dist/types/components/BusinessLines/tasks/types.d.ts +2 -0
  258. package/dist/types/components/BusinessLines/tasks/utils.d.ts +4 -2
  259. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +475 -475
  260. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +1 -2
  261. package/dist/types/components/EFP/tasks/TaxReportingDropin/utils.d.ts +1 -2
  262. package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +1 -1
  263. package/dist/types/components/Individual/forms/Individual/Individual.d.ts +41 -3
  264. package/dist/types/components/Individual/forms/Individual/form-ids.d.ts +2 -0
  265. package/dist/types/components/Individual/forms/Individual/types.d.ts +1 -2
  266. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +1 -0
  267. package/dist/types/components/Individual/forms/IndividualOnfido/form-ids.d.ts +2 -0
  268. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/utils.d.ts +1 -1
  269. package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +1 -1
  270. package/dist/types/components/Shared/Introduction/copy.d.ts +1 -1
  271. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  272. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +1 -1
  273. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/formatRoleAndEntityTypeSummary.d.ts +1 -1
  274. package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +1 -1
  275. package/dist/types/core/user-events.d.ts +1 -0
  276. package/dist/types/language/types.d.ts +7 -2
  277. package/dist/types/language/utils.d.ts +1 -2
  278. package/dist/types/types/assert.d.ts +1 -0
  279. package/dist/types/utils/analytics/debouncedInputEvent.d.ts +1 -0
  280. package/dist/types/utils/analytics/getPrefilledDetails.d.ts +28 -0
  281. package/dist/types/utils/api/processCapabilitites.d.ts +13 -0
  282. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  283. package/dist/types/utils/formUtils.d.ts +1 -2
  284. package/dist/types/utils/getDisplayErrorMessage.d.ts +1 -2
  285. package/dist/types/utils/getName.d.ts +1 -1
  286. package/dist/types/utils/makeSelectItemForRole.d.ts +1 -1
  287. package/dist/types/utils/translation.d.ts +3 -2
  288. package/dist/{types-DDnAZYTj.js → types-C6ntGMCy.js} +3 -26
  289. package/dist/{types-DE1uuPfP.js → types-CpAtsPmJ.js} +1 -1
  290. package/dist/{types-hGeLq0SR.js → types-c9nG7Dev.js} +1 -1
  291. package/dist/unincorporated-partnership-MeN1dp53.js +97 -0
  292. package/dist/{upload-BF65P4KM.js → upload-BmUXjsaU.js} +2 -2
  293. package/dist/{us-check-CYY6Crhr.js → us-check-C1rTBsCY.js} +2 -2
  294. package/dist/{us-check-account-number-C7KE5YzX.js → us-check-account-number-9lI1dXNC.js} +2 -2
  295. package/dist/{us-check-routing-number-DUbhsYAR.js → us-check-routing-number-s_KaAGSM.js} +2 -2
  296. package/dist/{useAssociatedLegalEntity-D_Nk_obe.js → useAssociatedLegalEntity-ahBb64MW.js} +2 -2
  297. package/dist/useBusinessDetailsData-qQ2HRnKK.js +5161 -0
  298. package/dist/{useCreateLegalEntity-DT7ue23d.js → useCreateLegalEntity-Kc8_ZlAe.js} +2 -2
  299. package/dist/useDataset-DfKmlbQd.js +74 -0
  300. package/dist/useForm-9uKM-XKf.js +582 -0
  301. package/dist/{FormFlow-BrgeP70A.js → useFormContext-CvQfKDA3.js} +26 -31
  302. package/dist/{useGlobalData-C7tjZfC0.js → useGlobalData-BVQ2OrIi.js} +3 -3
  303. package/dist/useId-BZ0PA7jP.js +24 -0
  304. package/dist/{useMultiForm-DWozxGN4.js → useMultiForm-pAiPIh7X.js} +4 -4
  305. package/dist/{useOnboardingStatus-DBLS6PUq.js → useOnboardingStatus-BhDBSLB6.js} +1 -1
  306. package/dist/{useScenarios-DD06bWNN.js → useScenarios-DFW21Vhf.js} +2 -2
  307. package/dist/{useTermsOfServiceStatus-D2lYSqHn.js → useTermsOfServiceStatus-BnO0rXiL.js} +1 -1
  308. package/dist/{useToastContext-Cbw29cqc.js → useToastContext-D6Lbxqj9.js} +5 -17
  309. package/dist/{useUnincorporatedPartnershipMembers-Dbb2VjkF.js → useUnincorporatedPartnershipMembers-CIC7xPbD.js} +5 -5
  310. package/dist/useUpdateBusinessLines-WlwUOtSU.js +337 -0
  311. package/dist/{useUpdateLegalEntity-Aubxhgvv.js → useUpdateLegalEntity-CStkUt4I.js} +3 -3
  312. package/dist/utils-7_xBiPO_.js +58 -0
  313. package/dist/utils-BmxzrkCX.js +165 -0
  314. package/dist/{utils-D1-D6fui.js → utils-CB39nVjj.js} +6 -6
  315. package/dist/{utils-DenrGsUh.js → utils-CDAwsXQa.js} +4 -4
  316. package/dist/utils-DOiFhaKn.js +29 -0
  317. package/dist/{documentUtils-Be5wlCwo.js → validate-Bsx2oHT1.js} +170 -6
  318. package/dist/{validate-BxVes1el.js → validate-D-l23QLG.js} +2 -2
  319. package/dist/validate-D4iK6FUk.js +385 -0
  320. package/dist/{validationError-DPP91cM3.js → validationError-DYYlX-5X.js} +2 -2
  321. package/dist/{warning-circle-fill-CEN1WL7A.js → warning-circle-fill-DBvt921B.js} +2 -2
  322. package/dist/{warning-diamond-filled-BfXMlVrG.js → warning-diamond-filled-Lb2od2ry.js} +2 -2
  323. package/dist/{webinar-DqjqrNEv.js → webinar-m9nuFZBt.js} +2 -2
  324. package/dist/{yapily-logo-CZ4ywjwA.js → yapily-logo-BduxhNRA.js} +2 -2
  325. package/package.json +6 -6
  326. package/dist/ConstitutionalDocument-DM6M40MP.js +0 -143
  327. package/dist/CountryField-CsKJAI53.js +0 -843
  328. package/dist/IndividualOnfidoDropin-DZEn2Tf8.js +0 -2575
  329. package/dist/OnboardingDropinComponent-Cx-c_p0i.js +0 -7623
  330. package/dist/getFieldsWithExistingData-CfckMyJ1.js +0 -22
  331. package/dist/mapFinancialReportsToFinancialInformation-Bfvt2G87.js +0 -67
  332. package/dist/mapJpAddressSchemaToAddressLocalizations-CWY2lZGD.js +0 -63
  333. package/dist/types/components/Shared/forms/BusinessTypeSelection/EntityTypeRadioGroupCard.d.ts +0 -11
  334. package/dist/useBusinessDetailsData-DG9EJBH_.js +0 -2441
  335. package/dist/useDataset-DCCxYOjr.js +0 -220
  336. package/dist/useUpdateBusinessLines-8bDYsLav.js +0 -46
  337. package/dist/validate-BgMFLdKI.js +0 -41
@@ -0,0 +1,3134 @@
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] = "9434fd69-df2d-4086-8d65-3e5e7db70d53", e._sentryDebugIdIdentifier = "sentry-dbid-9434fd69-df2d-4086-8d65-3e5e7db70d53");
6
+ } catch (e) {
7
+ }
8
+ }
9
+ ;
10
+ import { bn as getNestedPropertyKeys, ad as objectsDeepEqual, u as useTranslation, c as useLegalEntity, R as ROOT_LE, C as CountryCodes, r as LegalEntityTypes, U as TaskTypes, b0 as keysOf, Z as useExperimentsContext, N as useAccountHolder } from "./StoreProvider-D9IR5HNN.js";
11
+ import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
12
+ import { memo } from "preact/compat";
13
+ import { useState, useRef, useEffect, useCallback, useMemo } from "preact/hooks";
14
+ import { F as Field } from "./Field-B3Vy1-QZ.js";
15
+ import { H as Header } from "./Header-YafgG5Nz.js";
16
+ import { S as Select } from "./Select-D1rFT3T8.js";
17
+ import { T as TextArea } from "./TextArea-D9eJloeE.js";
18
+ import { S as StateContextSetter } from "./validate-Bsx2oHT1.js";
19
+ import { u as useForm } from "./useForm-9uKM-XKf.js";
20
+ import { D as DocumentGuidance, u as uppercase } from "./mapExistingFile-DNBa6Ekj.js";
21
+ import { D as Dropzone } from "./Dropzone-CKT3THCY.js";
22
+ import { E as ErrorPanel } from "./ErrorPanel-CFN2G9Vz.js";
23
+ import { c as createFormUtils } from "./formUtils-BlVlgetw.js";
24
+ import { C as Checkbox } from "./Checkbox-D8rB6_HN.js";
25
+ import { C as CompanyTypesValues } from "./bafinUtils-Wct4TWLH.js";
26
+ import { m as makeMask, n as numericInputs, a as nonInputs, d as alphanumericInputs, c as customInputs, b as alphaInputs, s as spacer, M as MaskedInput } from "./MaskedInput-Cn0VAuEp.js";
27
+ import { S as SettingNames } from "./TaskVerificationStatus-BLCkXEn6.js";
28
+ import { C as COUNTRIES_WITH_STATES_DATASET } from "./utils-BmxzrkCX.js";
29
+ import { c as createFormRules } from "./form-rules-DhbF2mY4.js";
30
+ import { i as isCompatibleJapanVersion } from "./japanSupportUtils-iATUjnbf.js";
31
+ import { i as isDateOlderThanAYear } from "./Address-ki-bCjUJ.js";
32
+ import { v as validatePatternOnBlur, a as validateNotEmptyOnBlur } from "./patternValidators-BXduwLbz.js";
33
+ import { R as RadioGroup } from "./RadioGroup-DPc8nUuk.js";
34
+ const getFieldsWithExistingData = (legalEntity, keyMapping, documentMapping, knownProblematicFields = []) => {
35
+ const apiFieldsWithExistingData = getNestedPropertyKeys(legalEntity);
36
+ const nonDocumentFields = apiFieldsWithExistingData.map((field) => keyMapping[field]).filter(Boolean).filter((field) => !knownProblematicFields.includes(field));
37
+ if (documentMapping && legalEntity.documentDetails?.length) {
38
+ const documentFields = legalEntity.documentDetails.map((document) => documentMapping[document.type]).filter(Boolean);
39
+ return [...nonDocumentFields, ...documentFields];
40
+ }
41
+ return nonDocumentFields;
42
+ };
43
+ const descriptionField = "adyen-kyc-description-field";
44
+ const styles = {
45
+ descriptionField
46
+ };
47
+ const DESCRIPTION_CHARACTERS_LIMIT = 200;
48
+ function DocumentUpload({
49
+ documentType,
50
+ documentField,
51
+ guidanceHeader,
52
+ documentTypeSelect,
53
+ guidanceContent,
54
+ handleFieldChange,
55
+ requiredFields,
56
+ data: dataProp,
57
+ valid: validProp,
58
+ errors: errorProp,
59
+ fieldValidationErrors: propFieldValidationErrors,
60
+ supportsMultipleUploads,
61
+ maxNumberOfFiles = 1,
62
+ label,
63
+ extraDropzoneDescription,
64
+ hidePageCount,
65
+ ...props
66
+ }) {
67
+ const { t } = useTranslation("common");
68
+ const [document, setDocument] = useState();
69
+ const form = useForm({
70
+ ...props,
71
+ schema: ["description"],
72
+ defaultData: dataProp,
73
+ rules: props.validators,
74
+ fieldProblems: propFieldValidationErrors
75
+ });
76
+ const { handleChangeFor, triggerValidation, setData } = form;
77
+ let { data, errors, valid, fieldProblems } = form;
78
+ const formUtils = createFormUtils(props, t);
79
+ const stateRef = useRef({ setState: null });
80
+ const isOptional = !(props?.formVerificationErrors && Object.keys(props?.formVerificationErrors)?.length === 0);
81
+ useEffect(() => {
82
+ if (isOptional) {
83
+ triggerValidation();
84
+ }
85
+ }, [dataProp]);
86
+ useEffect(() => {
87
+ stateRef.current.setState?.({
88
+ type: "addToState",
89
+ value: {
90
+ data,
91
+ valid,
92
+ errors,
93
+ fieldProblems,
94
+ dataStoreId: props.id,
95
+ schema: requiredFields
96
+ }
97
+ });
98
+ }, [data, valid, errors, fieldProblems]);
99
+ useEffect(() => {
100
+ setDocument({
101
+ [documentField]: dataProp?.[documentField]
102
+ });
103
+ setData("description", dataProp?.description);
104
+ triggerValidation();
105
+ }, [dataProp]);
106
+ if (handleFieldChange && requiredFields && propFieldValidationErrors) {
107
+ data = dataProp ?? {};
108
+ errors = errorProp;
109
+ valid = validProp;
110
+ fieldProblems = propFieldValidationErrors;
111
+ }
112
+ const handleInput = (e) => {
113
+ handleChangeFor("description")(e);
114
+ if (handleFieldChange) {
115
+ handleFieldChange?.("description")(e);
116
+ }
117
+ };
118
+ return /* @__PURE__ */ jsxs(
119
+ "div",
120
+ {
121
+ className: `adyen-kyc-company-document-upload adyen-kyc-company-document-upload--${documentField}`,
122
+ children: [
123
+ /* @__PURE__ */ jsx(StateContextSetter, { owner: props.id, stateRef }),
124
+ props.heading && /* @__PURE__ */ jsx(Header, { title: props.heading, description: props.description }),
125
+ /* @__PURE__ */ jsx(
126
+ ErrorPanel,
127
+ {
128
+ verificationErrors: props?.formVerificationErrors,
129
+ validationErrors: propFieldValidationErrors,
130
+ formUtils,
131
+ id: "ariaErrorField"
132
+ }
133
+ ),
134
+ formUtils.isRequiredField(documentField) && /* @__PURE__ */ jsxs(Fragment, { children: [
135
+ guidanceHeader,
136
+ documentTypeSelect && /* @__PURE__ */ jsx(Field, { name: "documentType", label: t(($) => $["selectDocumentType"]), children: (childProps) => /* @__PURE__ */ jsx(
137
+ Select,
138
+ {
139
+ ...childProps,
140
+ onChange: (e) => documentTypeSelect.setSelectedType(e.target.value),
141
+ name: "documentType",
142
+ placeholder: t(($) => $["selectDocument"]),
143
+ selected: documentTypeSelect.selectedType,
144
+ items: documentTypeSelect.options.map(({ id, name }) => ({
145
+ id,
146
+ name: t(($) => $[name])
147
+ }))
148
+ }
149
+ ) }),
150
+ /* @__PURE__ */ jsx("div", { children: guidanceContent }),
151
+ /* @__PURE__ */ jsx(DocumentGuidance, { type: documentType, className: "adyen-kyc-u-margin-bottom-24" }),
152
+ /* @__PURE__ */ jsx(
153
+ Dropzone,
154
+ {
155
+ defaultData: document ?? data,
156
+ id: props.id,
157
+ isOptional: isOptional || formUtils.isOptionalField(documentField),
158
+ maxSize: documentType === "constitutionalDocument" ? 31457280 : void 0,
159
+ name: documentField,
160
+ shouldValidate: props.shouldValidate,
161
+ handleFieldChange,
162
+ errors,
163
+ fieldValidationErrors: fieldProblems,
164
+ valid,
165
+ multiple: supportsMultipleUploads,
166
+ maxNumberOfFiles: maxNumberOfFiles ?? 1,
167
+ label,
168
+ extraDropzoneDescription,
169
+ hidePageCount
170
+ }
171
+ )
172
+ ] }),
173
+ formUtils.isRequiredField("description") && /* @__PURE__ */ jsx("div", { className: styles.descriptionField, children: /* @__PURE__ */ jsx(
174
+ Field,
175
+ {
176
+ name: "description",
177
+ label: formUtils.getLabel("descriptionOptional"),
178
+ errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
179
+ isValid: valid.description,
180
+ children: (childProps) => /* @__PURE__ */ jsx(
181
+ TextArea,
182
+ {
183
+ ...childProps,
184
+ name: "description",
185
+ value: data.description,
186
+ maxLength: DESCRIPTION_CHARACTERS_LIMIT,
187
+ onInput: handleInput,
188
+ "aria-invalid": !valid.description,
189
+ handleFieldChange: handleInput,
190
+ errors,
191
+ fieldValidationErrors: fieldProblems,
192
+ valid
193
+ }
194
+ )
195
+ }
196
+ ) })
197
+ ]
198
+ }
199
+ );
200
+ }
201
+ const MemoizedDocumentUpload = memo(
202
+ DocumentUpload,
203
+ (prevProps, nextProps) => prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.errors, nextProps.errors) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && objectsDeepEqual(prevProps.documentTypeSelect, nextProps.documentTypeSelect) && prevProps.documentField === nextProps.documentField && prevProps.name === nextProps.name && prevProps.country === nextProps.country && prevProps.companyType === nextProps.companyType
204
+ );
205
+ const useCapabilities = () => {
206
+ const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
207
+ return rootLegalEntity?.capabilities;
208
+ };
209
+ const companyRegistrationNumberOptions = {
210
+ [CountryCodes.Australia]: [
211
+ {
212
+ id: "incorporatedAssociationRegistrationNumber",
213
+ name: "incorporatedAssociationRegistrationNumber",
214
+ applicableOnlyFor: [CompanyTypesValues.INCORPORATED_ASSOCIATION]
215
+ },
216
+ {
217
+ id: "australianBusinessNumberAcn",
218
+ name: "australianBusinessNumberAcn",
219
+ applicableOnlyFor: [
220
+ CompanyTypesValues.PRIVATE_COMPANY,
221
+ CompanyTypesValues.PUBLIC_COMPANY,
222
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY,
223
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
224
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
225
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
226
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
227
+ CompanyTypesValues.SOLE_PROPRIETORSHIP
228
+ ]
229
+ }
230
+ ],
231
+ [CountryCodes.Austria]: [
232
+ {
233
+ id: "firmenbuchnummer",
234
+ name: "firmenbuchnummer"
235
+ },
236
+ {
237
+ id: "ZVR",
238
+ name: "zentralesVereinsregisterId",
239
+ applicableOnlyFor: [
240
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
241
+ CompanyTypesValues.INCORPORATED_ASSOCIATION
242
+ ]
243
+ }
244
+ ],
245
+ [CountryCodes.Croatia]: [
246
+ { id: "MBO", name: "MBO", applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP] },
247
+ {
248
+ id: "MBS",
249
+ name: "MBS",
250
+ applicableOnlyFor: [
251
+ CompanyTypesValues.PRIVATE_COMPANY,
252
+ CompanyTypesValues.PUBLIC_COMPANY,
253
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY,
254
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
255
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
256
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
257
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE
258
+ ]
259
+ }
260
+ ],
261
+ [CountryCodes.France]: [
262
+ {
263
+ id: "SIRET",
264
+ name: "siret"
265
+ },
266
+ {
267
+ id: "RNA",
268
+ name: "rnaNumber",
269
+ applicableOnlyFor: [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]
270
+ }
271
+ ],
272
+ [CountryCodes.Hungary]: [
273
+ {
274
+ id: "nyilvantartasiSzam",
275
+ name: "huRegistrationNumberForSoleProp",
276
+ applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
277
+ }
278
+ ],
279
+ [CountryCodes.Italy]: [
280
+ {
281
+ id: "partitaIVA",
282
+ name: "codiceFiscalePartitaIVA"
283
+ },
284
+ {
285
+ id: "CCIAA",
286
+ name: "CCIAA"
287
+ }
288
+ ],
289
+ [CountryCodes.Monaco]: [
290
+ {
291
+ id: "mcRegistrationNumberSoleProp",
292
+ name: "mcRegistrationNumberSoleProp",
293
+ applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
294
+ },
295
+ {
296
+ id: "mcRegistrationNumber",
297
+ name: "mcRegistrationNumber",
298
+ applicableOnlyFor: [
299
+ CompanyTypesValues.PRIVATE_COMPANY,
300
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
301
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
302
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
303
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
304
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
305
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
306
+ ]
307
+ }
308
+ ],
309
+ [CountryCodes.NewZealand]: [
310
+ {
311
+ id: "NZBN",
312
+ name: "NZBN"
313
+ },
314
+ {
315
+ id: "companyNumberNZ",
316
+ name: "companyNumberNZ",
317
+ applicableOnlyFor: [
318
+ CompanyTypesValues.PRIVATE_COMPANY,
319
+ CompanyTypesValues.PUBLIC_COMPANY,
320
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
321
+ ]
322
+ }
323
+ ],
324
+ [CountryCodes.Romania]: [
325
+ {
326
+ id: "roRegNumberNewFormat",
327
+ name: "roRegNumberNewFormat_label"
328
+ },
329
+ {
330
+ id: "roRegNumberOldFormat",
331
+ name: "roRegNumberOldFormat_label"
332
+ }
333
+ ],
334
+ [CountryCodes.Poland]: [
335
+ {
336
+ id: "regon",
337
+ name: "regon"
338
+ },
339
+ {
340
+ id: "krsNumber",
341
+ name: "krsNumber"
342
+ }
343
+ ],
344
+ [CountryCodes.UnitedKingdom]: [
345
+ {
346
+ id: "charity",
347
+ name: "charityNumber",
348
+ applicableOnlyFor: [CompanyTypesValues.NON_PROFIT_OR_CHARITABLE]
349
+ },
350
+ {
351
+ id: "companyNumber",
352
+ name: "companyNumber",
353
+ applicableOnlyFor: [
354
+ CompanyTypesValues.PRIVATE_COMPANY,
355
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
356
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
357
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
358
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
359
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
360
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY,
361
+ CompanyTypesValues.PUBLIC_COMPANY
362
+ ]
363
+ }
364
+ ]
365
+ };
366
+ const getCompanyRegistrationNumberOptions = (country, companyType) => {
367
+ const optionsForCountry = companyRegistrationNumberOptions[country];
368
+ if (!companyType || !optionsForCountry) return optionsForCountry;
369
+ return optionsForCountry.filter(
370
+ (option) => option.applicableOnlyFor?.includes(companyType) ?? true
371
+ );
372
+ };
373
+ const individualIdNumberOptions = {
374
+ [CountryCodes.Spain]: [
375
+ {
376
+ id: "dni",
377
+ name: "dni"
378
+ },
379
+ {
380
+ id: "nie",
381
+ name: "nie"
382
+ }
383
+ ]
384
+ };
385
+ const additionallIdNumberOptions = {
386
+ [CountryCodes.NewZealand]: [
387
+ {
388
+ id: "driversLicense",
389
+ name: "driversLicense"
390
+ },
391
+ {
392
+ id: "passport",
393
+ name: "passportNumber"
394
+ }
395
+ ],
396
+ [CountryCodes.HongKong]: [
397
+ {
398
+ id: "proofOfIdentityCard",
399
+ name: "stateIssuedProofOfIdentityCard"
400
+ },
401
+ {
402
+ id: "driversLicense",
403
+ name: "driversLicense"
404
+ },
405
+ {
406
+ id: "passport",
407
+ name: "passportNumber"
408
+ }
409
+ ],
410
+ [CountryCodes.Australia]: [
411
+ {
412
+ id: "driversLicense",
413
+ name: "driversLicense"
414
+ },
415
+ {
416
+ id: "passport",
417
+ name: "passportNumber"
418
+ }
419
+ ]
420
+ };
421
+ const taxIdNumberOptions = {
422
+ [CountryCodes.Australia]: [
423
+ {
424
+ id: "ABN",
425
+ name: "australianBusinessNumberAbn"
426
+ }
427
+ ],
428
+ [CountryCodes.Belgium]: [
429
+ {
430
+ id: "BUSINESS_NUMMER",
431
+ name: "businessNumber",
432
+ applicableOnlyFor: [
433
+ CompanyTypesValues.SOLE_PROPRIETORSHIP,
434
+ CompanyTypesValues.PRIVATE_COMPANY,
435
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
436
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
437
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
438
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
439
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
440
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
441
+ ]
442
+ },
443
+ {
444
+ id: "NUMERO_NATIONAL",
445
+ name: "taxInformationNumber__BE_Individual",
446
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
447
+ }
448
+ ],
449
+ [CountryCodes.Brazil]: [{ id: "CNPJ", name: "CNPJ" }],
450
+ [CountryCodes.Canada]: [{ id: "BUSINESS_NUMBER", name: "businessNumber" }],
451
+ [CountryCodes.Germany]: [
452
+ {
453
+ id: "STEUERNUMMER",
454
+ name: "taxInformationNumber__DE",
455
+ applicableOnlyFor: [
456
+ CompanyTypesValues.SOLE_PROPRIETORSHIP,
457
+ CompanyTypesValues.PRIVATE_COMPANY,
458
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
459
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
460
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
461
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
462
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
463
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
464
+ ]
465
+ },
466
+ {
467
+ id: "IDNR",
468
+ name: "taxInformationNumber__DE_Individual",
469
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
470
+ }
471
+ ],
472
+ [CountryCodes.Gibraltar]: [
473
+ { id: "GI_TAXPAYER_REFERENCE_NUMBER", name: "taxpayerReferenceNumber" }
474
+ ],
475
+ [CountryCodes.Guernsey]: [
476
+ { id: "GG_REGISTRATION_NUMBER", name: "taxInformationNumber" },
477
+ {
478
+ id: "TIN_GG",
479
+ name: "nationalInsuranceNumber",
480
+ applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
481
+ }
482
+ ],
483
+ [CountryCodes.HongKong]: [
484
+ {
485
+ id: "BRN",
486
+ name: "taxInformationNumber__HK"
487
+ }
488
+ ],
489
+ [CountryCodes.Ireland]: [
490
+ {
491
+ id: "TRN",
492
+ name: "trnNumber",
493
+ applicableOnlyFor: [CompanyTypesValues.UNINCORPORATED_PARTNERSHIP]
494
+ }
495
+ ],
496
+ [CountryCodes.IsleOfMan]: [{ id: "IM_TAX_REFERENCE_NUMBER", name: "taxReferenceNumber" }],
497
+ [CountryCodes.Japan]: [{ id: "CORPORATE_NUMBER", name: "taxInformationNumber" }],
498
+ [CountryCodes.Jersey]: [
499
+ {
500
+ id: "TIN_JE",
501
+ name: "taxIdentificationNumber"
502
+ },
503
+ {
504
+ id: "SSN",
505
+ name: "socialSecurityNumber",
506
+ applicableOnlyFor: [CompanyTypesValues.SOLE_PROPRIETORSHIP]
507
+ }
508
+ ],
509
+ [CountryCodes.Netherlands]: [
510
+ {
511
+ id: "RSIN",
512
+ name: "rsinNumber",
513
+ applicableOnlyFor: [
514
+ CompanyTypesValues.PRIVATE_COMPANY,
515
+ CompanyTypesValues.GOVERNMENTAL_ORGANIZATION,
516
+ CompanyTypesValues.INCORPORATED_ASSOCIATION,
517
+ CompanyTypesValues.INCORPORATED_PARTNERSHIP,
518
+ CompanyTypesValues.NON_PROFIT_OR_CHARITABLE,
519
+ CompanyTypesValues.UNINCORPORATED_PARTNERSHIP,
520
+ CompanyTypesValues.UNLISTED_PUBLIC_COMPANY
521
+ ]
522
+ },
523
+ {
524
+ id: "BSN",
525
+ name: "bsnNumber",
526
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
527
+ }
528
+ ],
529
+ [CountryCodes.NewZealand]: [
530
+ {
531
+ id: "IRD",
532
+ name: "irdNumber"
533
+ }
534
+ ],
535
+ [CountryCodes.PuertoRico]: [
536
+ {
537
+ id: "EIN",
538
+ name: "ein"
539
+ }
540
+ ],
541
+ [CountryCodes.Singapore]: [
542
+ {
543
+ id: "GST",
544
+ name: "gst"
545
+ },
546
+ {
547
+ id: "UEN",
548
+ name: "uen"
549
+ }
550
+ ],
551
+ [CountryCodes.Spain]: [
552
+ {
553
+ id: "dni",
554
+ name: "dni",
555
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
556
+ },
557
+ {
558
+ id: "nie",
559
+ name: "nie",
560
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
561
+ }
562
+ ],
563
+ [CountryCodes.UnitedKingdom]: [
564
+ {
565
+ id: "UTR",
566
+ name: "utr"
567
+ },
568
+ {
569
+ id: "NINO",
570
+ name: "nationalInsuranceNumber",
571
+ applicableOnlyFor: [LegalEntityTypes.INDIVIDUAL]
572
+ }
573
+ ],
574
+ [CountryCodes.UnitedStates]: [
575
+ {
576
+ id: "EIN",
577
+ name: "ein"
578
+ }
579
+ ]
580
+ };
581
+ const vatNumberOptions = {
582
+ [CountryCodes.Austria]: [{ id: "UST-ID", name: "UST-ID" }],
583
+ [CountryCodes.Belgium]: [{ id: "euVatNumber", name: "euVatNumber" }],
584
+ [CountryCodes.Bulgaria]: [{ id: "identifikacionenNomerDDS", name: "identifikacionenNomerDDS" }],
585
+ [CountryCodes.Croatia]: [{ id: "PDVIdBrojOIB", name: "PDVIdBrojOIB" }],
586
+ [CountryCodes.Cyprus]: [{ id: "arithmosEngraphes", name: "arithmosEngraphes" }],
587
+ [CountryCodes.CzechRepublic]: [{ id: "DIC", name: "DIC" }],
588
+ [CountryCodes.Denmark]: [
589
+ {
590
+ id: "momsregistreringsnummerCVR",
591
+ name: "momsregistreringsnummerCVR"
592
+ },
593
+ {
594
+ id: "stamregister",
595
+ name: "stamregister"
596
+ }
597
+ ],
598
+ [CountryCodes.Estonia]: [
599
+ { id: "kaibemaksukohustuslaseNumber", name: "kaibemaksukohustuslaseNumber" }
600
+ ],
601
+ [CountryCodes.Finland]: [
602
+ {
603
+ id: "arvonlisaveronumeroMervardesskattenummer",
604
+ name: "arvonlisaveronumeroMervardesskattenummer"
605
+ }
606
+ ],
607
+ [CountryCodes.France]: [
608
+ {
609
+ id: "numeroDIdentificationALATaxe",
610
+ name: "numeroDIdentificationALATaxe"
611
+ },
612
+ {
613
+ id: "NumeroDeTVA",
614
+ name: "NumeroDeTVA"
615
+ }
616
+ ],
617
+ [CountryCodes.Germany]: [{ id: "USt-IdNr", name: "USt-IdNr" }],
618
+ [CountryCodes.Greece]: [{ id: "grTaxId", name: "grTaxId" }],
619
+ [CountryCodes.Hungary]: [{ id: "huTaxId", name: "huTaxId" }],
620
+ [CountryCodes.Ireland]: [{ id: "vatNumber", name: "vatNumber" }],
621
+ [CountryCodes.Italy]: [{ id: "partitaIVA", name: "partitaIVA" }],
622
+ [CountryCodes.Latvia]: [{ id: "lvTaxId", name: "lvTaxId" }],
623
+ [CountryCodes.Liechtenstein]: [{ id: "vatRegistrationNumber", name: "vatRegistrationNumber" }],
624
+ [CountryCodes.Lithuania]: [{ id: "PVMmoketojoKodas", name: "PVMmoketojoKodas" }],
625
+ [CountryCodes.Luxembourg]: [
626
+ { id: "numeroDIdentificationALATaxe", name: "numeroDIdentificationALATaxe" }
627
+ ],
628
+ [CountryCodes.Malaysia]: [{ id: "SST", name: "SST" }],
629
+ [CountryCodes.Malta]: [{ id: "vatNumber", name: "vatNumber" }],
630
+ [CountryCodes.Monaco]: [
631
+ { id: "numeroDIdentificationALATaxe", name: "numeroDIdentificationALATaxe" }
632
+ ],
633
+ [CountryCodes.Netherlands]: [{ id: "btwNummer", name: "btwNummer" }],
634
+ [CountryCodes.Norway]: [{ id: "mvanummer", name: "mvanummer" }],
635
+ [CountryCodes.Poland]: [{ id: "NIP", name: "NIP" }],
636
+ [CountryCodes.Portugal]: [{ id: "numerodeIVA", name: "numerodeIVA" }],
637
+ [CountryCodes.Romania]: [
638
+ { id: "codulDeIdentificareFiscala", name: "codulDeIdentificareFiscala" }
639
+ ],
640
+ [CountryCodes.Slovakia]: [{ id: "skTaxId", name: "skTaxId" }],
641
+ [CountryCodes.Slovenia]: [{ id: "siTaxId", name: "siTaxId" }],
642
+ [CountryCodes.Spain]: [{ id: "NIFdeIVA", name: "NIFdeIVA" }],
643
+ [CountryCodes.Sweden]: [
644
+ {
645
+ id: "vatNummerMomsregistreringsnummerOrMomsnummer",
646
+ name: "vatNummerMomsregistreringsnummerOrMomsnummer"
647
+ }
648
+ ],
649
+ [CountryCodes.Switzerland]: [{ id: "Mehrwertsteuernummer", name: "Mehrwertsteuernummer" }],
650
+ [CountryCodes.UnitedArabEmirates]: [
651
+ { id: "vatRegistrationNumber", name: "vatRegistrationNumber" }
652
+ ],
653
+ [CountryCodes.UnitedKingdom]: [{ id: "vatRegistrationNumber", name: "vatRegistrationNumber" }]
654
+ };
655
+ const getTaxIdNumberOptions = (country, companyType) => {
656
+ const optionsForCountry = taxIdNumberOptions[country];
657
+ if (!companyType || !optionsForCountry) return optionsForCountry;
658
+ return optionsForCountry.filter(
659
+ (option) => option.applicableOnlyFor?.includes(companyType) ?? true
660
+ );
661
+ };
662
+ const getVatNumberOptions = (country, companyType) => {
663
+ const optionsForCountry = vatNumberOptions[country];
664
+ if (!companyType || !optionsForCountry) return optionsForCountry;
665
+ return optionsForCountry.filter(
666
+ (option) => option.applicableOnlyFor?.includes(companyType) ?? true
667
+ );
668
+ };
669
+ const StateCodesUS = {
670
+ Alabama: "AL",
671
+ Alaska: "AK",
672
+ Arizona: "AZ",
673
+ Arkansas: "AR",
674
+ California: "CA",
675
+ Colorado: "CO",
676
+ Connecticut: "CT",
677
+ Delaware: "DE",
678
+ DistrictOfColumbia: "DC",
679
+ Florida: "FL",
680
+ Georgia: "GA",
681
+ Hawaii: "HI",
682
+ Idaho: "ID",
683
+ Illinois: "IL",
684
+ Indiana: "IN",
685
+ Iowa: "IA",
686
+ Kansas: "KS",
687
+ Kentucky: "KY",
688
+ Louisiana: "LA",
689
+ Maine: "ME",
690
+ Maryland: "MD",
691
+ Massachusetts: "MA",
692
+ Michigan: "MI",
693
+ Minnesota: "MN",
694
+ Mississippi: "MS",
695
+ Missouri: "MO",
696
+ Montana: "MT",
697
+ Nebraska: "NE",
698
+ Nevada: "NV",
699
+ NewHampshire: "NH",
700
+ NewJersey: "NJ",
701
+ NewMexico: "NM",
702
+ NewYork: "NY",
703
+ NorthCarolina: "NC",
704
+ NorthDakota: "ND",
705
+ Ohio: "OH",
706
+ Oklahoma: "OK",
707
+ Oregon: "OR",
708
+ Pennsylvania: "PA",
709
+ RhodeIsland: "RI",
710
+ SouthCarolina: "SC",
711
+ SouthDakota: "SD",
712
+ Tennessee: "TN",
713
+ Texas: "TX",
714
+ Utah: "UT",
715
+ Vermont: "VT",
716
+ Virginia: "VA",
717
+ Washington: "WA",
718
+ WestVirginia: "WV",
719
+ Wisconsin: "WI",
720
+ Wyoming: "WY"
721
+ };
722
+ const businessRegistrationNumberMasks = {
723
+ [CountryCodes.Austria]: {
724
+ firmenbuchnummer: {
725
+ mask: makeMask(
726
+ {
727
+ type: "input",
728
+ allow: /[TF]/
729
+ },
730
+ {
731
+ type: "input",
732
+ allow: /N/,
733
+ optional: true
734
+ },
735
+ ...numericInputs(3),
736
+ ...numericInputs(3, true),
737
+ { type: "input", allow: /[a-z]/ }
738
+ )
739
+ },
740
+ ZVR: {
741
+ mask: makeMask(
742
+ ...nonInputs("AT", { includeInValue: true }),
743
+ spacer,
744
+ ...nonInputs("-", { includeInValue: true }),
745
+ spacer,
746
+ ...nonInputs("ZVR", { includeInValue: true }),
747
+ spacer,
748
+ ...nonInputs("-", { includeInValue: true }),
749
+ spacer,
750
+ ...numericInputs(9),
751
+ ...numericInputs(1, true)
752
+ )
753
+ }
754
+ },
755
+ [CountryCodes.Australia]: {
756
+ default: {
757
+ mask: makeMask(...numericInputs(3), spacer, ...numericInputs(3), spacer, ...numericInputs(3))
758
+ },
759
+ associationIncorporated: {
760
+ mask: makeMask(...alphanumericInputs(3), ...alphanumericInputs(20, true)),
761
+ transformOnType: uppercase
762
+ }
763
+ },
764
+ [CountryCodes.Belgium]: { default: { mask: makeMask(...numericInputs(10)) } },
765
+ [CountryCodes.Brazil]: {
766
+ default: {
767
+ mask: makeMask(
768
+ ...numericInputs(2),
769
+ ...nonInputs(" . "),
770
+ ...numericInputs(3),
771
+ ...nonInputs(" . "),
772
+ ...numericInputs(3),
773
+ ...nonInputs(" / "),
774
+ ...numericInputs(4),
775
+ ...nonInputs(" - "),
776
+ ...numericInputs(2)
777
+ )
778
+ }
779
+ },
780
+ [CountryCodes.Bulgaria]: { default: { mask: makeMask(...numericInputs(9)) } },
781
+ [CountryCodes.Canada]: {
782
+ default: {
783
+ mask: makeMask(...alphanumericInputs(5), ...alphanumericInputs(5, true)),
784
+ transformOnType: uppercase
785
+ }
786
+ },
787
+ [CountryCodes.Croatia]: {
788
+ default: {
789
+ mask: makeMask(...numericInputs(9))
790
+ },
791
+ [CompanyTypesValues.SOLE_PROPRIETORSHIP]: {
792
+ mask: makeMask(...numericInputs(8))
793
+ }
794
+ },
795
+ [CountryCodes.Cyprus]: {
796
+ default: {
797
+ mask: makeMask(...customInputs(1, /^[COP]$/), ...numericInputs(1), ...numericInputs(7, true)),
798
+ transformOnType: uppercase
799
+ }
800
+ },
801
+ [CountryCodes.CzechRepublic]: {
802
+ default: { mask: makeMask(...numericInputs(8), ...numericInputs(2, true)) }
803
+ },
804
+ [CountryCodes.Denmark]: { default: { mask: makeMask(...numericInputs(8)) } },
805
+ [CountryCodes.Estonia]: { default: { mask: makeMask(...numericInputs(8)) } },
806
+ [CountryCodes.Finland]: {
807
+ default: {
808
+ mask: makeMask(
809
+ ...numericInputs(7),
810
+ spacer,
811
+ ...nonInputs("-", { includeInValue: true }),
812
+ spacer,
813
+ ...numericInputs(1)
814
+ )
815
+ }
816
+ },
817
+ [CountryCodes.France]: {
818
+ SIRET: { mask: makeMask(...numericInputs(9), ...nonInputs(" - "), ...numericInputs(5)) },
819
+ RNA: {
820
+ mask: makeMask(
821
+ ...nonInputs("W", { includeInValue: true }),
822
+ ...numericInputs(1),
823
+ ...alphanumericInputs(1),
824
+ ...numericInputs(7)
825
+ )
826
+ }
827
+ },
828
+ [CountryCodes.Germany]: {
829
+ default: {
830
+ mask: makeMask(...alphanumericInputs(3), ...customInputs(17, /[A-Z0-9-]/, true)),
831
+ transformOnType: uppercase
832
+ }
833
+ },
834
+ [CountryCodes.Gibraltar]: {
835
+ default: {
836
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(7, true)),
837
+ transformOnType: uppercase
838
+ }
839
+ },
840
+ [CountryCodes.Greece]: { default: { mask: makeMask(...numericInputs(12)) } },
841
+ [CountryCodes.Guernsey]: {
842
+ default: { mask: makeMask(...numericInputs(1), ...numericInputs(8, true)) }
843
+ },
844
+ [CountryCodes.HongKong]: { default: { mask: makeMask(...numericInputs(7)) } },
845
+ [CountryCodes.Hungary]: {
846
+ default: {
847
+ mask: makeMask(
848
+ ...numericInputs(2),
849
+ ...nonInputs(" - "),
850
+ ...numericInputs(2),
851
+ ...nonInputs(" - "),
852
+ ...numericInputs(6)
853
+ )
854
+ },
855
+ nyilvantartasiSzam: {
856
+ mask: makeMask(...numericInputs(10))
857
+ }
858
+ },
859
+ [CountryCodes.Ireland]: {
860
+ default: { mask: makeMask(...numericInputs(1), ...numericInputs(7, true)) }
861
+ },
862
+ [CountryCodes.IsleOfMan]: {
863
+ default: { mask: makeMask(...numericInputs(6), ...alphaInputs(1)), transformOnType: uppercase }
864
+ },
865
+ [CountryCodes.Italy]: {
866
+ partitaIVA: { mask: makeMask(...numericInputs(11)) },
867
+ CCIAA: {
868
+ mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...numericInputs(1, true)),
869
+ transformOnType: uppercase
870
+ }
871
+ },
872
+ [CountryCodes.Japan]: {
873
+ default: { mask: makeMask(...numericInputs(12)) }
874
+ },
875
+ [CountryCodes.Jersey]: {
876
+ default: {
877
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(8, true)),
878
+ transformOnType: uppercase
879
+ }
880
+ },
881
+ [CountryCodes.Latvia]: { default: { mask: makeMask(...numericInputs(11)) } },
882
+ [CountryCodes.Liechtenstein]: {
883
+ default: {
884
+ mask: makeMask(
885
+ ...nonInputs("FL", { includeInValue: true }),
886
+ spacer,
887
+ ...nonInputs("-", { includeInValue: true }),
888
+ spacer,
889
+ ...numericInputs(4),
890
+ spacer,
891
+ ...nonInputs(".", { includeInValue: true }),
892
+ spacer,
893
+ ...numericInputs(3),
894
+ spacer,
895
+ ...nonInputs(".", { includeInValue: true }),
896
+ spacer,
897
+ ...numericInputs(3),
898
+ spacer,
899
+ ...nonInputs("-", { includeInValue: true }),
900
+ spacer,
901
+ ...numericInputs(1)
902
+ )
903
+ }
904
+ },
905
+ [CountryCodes.Lithuania]: {
906
+ default: { mask: makeMask(...numericInputs(6), ...numericInputs(3, true)) }
907
+ },
908
+ [CountryCodes.Luxembourg]: {
909
+ default: {
910
+ mask: makeMask(...alphaInputs(1), ...numericInputs(9, true)),
911
+ transformOnType: uppercase
912
+ }
913
+ },
914
+ [CountryCodes.Malaysia]: {
915
+ default: { mask: makeMask(...numericInputs(7), ...numericInputs(5, true)) }
916
+ },
917
+ [CountryCodes.Malta]: {
918
+ default: {
919
+ mask: makeMask(
920
+ ...customInputs(1, /[CP]/),
921
+ spacer,
922
+ ...numericInputs(4),
923
+ ...numericInputs(2, true)
924
+ ),
925
+ transformOnType: uppercase
926
+ }
927
+ },
928
+ [CountryCodes.Mexico]: { default: { mask: makeMask(...alphanumericInputs(12)) } },
929
+ [CountryCodes.Monaco]: {
930
+ default: {
931
+ mask: makeMask(...alphanumericInputs(8), ...alphanumericInputs(3, true)),
932
+ transformOnType: uppercase
933
+ },
934
+ [CompanyTypesValues.SOLE_PROPRIETORSHIP]: {
935
+ mask: makeMask(...alphanumericInputs(8), ...alphanumericInputs(3, true)),
936
+ transformOnType: uppercase
937
+ }
938
+ },
939
+ [CountryCodes.Netherlands]: { default: { mask: makeMask(...numericInputs(8)) } },
940
+ [CountryCodes.NewZealand]: {
941
+ NZBN: { mask: makeMask(...numericInputs(13)) },
942
+ companyNumberNZ: { mask: makeMask(...numericInputs(7)) }
943
+ },
944
+ [CountryCodes.Norway]: { default: { mask: makeMask(...numericInputs(9)) } },
945
+ [CountryCodes.Poland]: {
946
+ krsNumber: { mask: makeMask(...numericInputs(10)) },
947
+ regon: { mask: makeMask(...numericInputs(9)) }
948
+ },
949
+ [CountryCodes.Portugal]: { default: { mask: makeMask(...numericInputs(9)) } },
950
+ [CountryCodes.Romania]: {
951
+ roRegNumberOldFormat: {
952
+ mask: makeMask(
953
+ ...alphaInputs(1),
954
+ ...numericInputs(1),
955
+ ...numericInputs(1, true),
956
+ ...customInputs(1, /[/]/),
957
+ ...numericInputs(1),
958
+ ...numericInputs(8, true),
959
+ ...customInputs(1, /[/]/),
960
+ ...numericInputs(4)
961
+ ),
962
+ transformOnType: uppercase
963
+ },
964
+ roRegNumberNewFormat: {
965
+ mask: makeMask(
966
+ {
967
+ type: "input",
968
+ allow: /[JFC]/
969
+ },
970
+ ...numericInputs(13)
971
+ ),
972
+ transformOnType: uppercase
973
+ }
974
+ },
975
+ [CountryCodes.Singapore]: {
976
+ default: {
977
+ mask: makeMask(...alphanumericInputs(9), ...alphanumericInputs(1, true)),
978
+ transformOnType: uppercase
979
+ }
980
+ },
981
+ [CountryCodes.Slovakia]: { default: { mask: makeMask(...numericInputs(8)) } },
982
+ [CountryCodes.Slovenia]: { default: { mask: makeMask(...numericInputs(10)) } },
983
+ [CountryCodes.Spain]: {
984
+ default: {
985
+ mask: makeMask(...alphaInputs(1), ...alphanumericInputs(8)),
986
+ transformOnType: uppercase
987
+ }
988
+ },
989
+ [CountryCodes.Sweden]: {
990
+ default: { mask: makeMask(...numericInputs(6), ...nonInputs(" - "), ...numericInputs(4)) }
991
+ },
992
+ [CountryCodes.Switzerland]: {
993
+ default: {
994
+ mask: makeMask(
995
+ ...nonInputs("CHE", { includeInValue: true }),
996
+ ...nonInputs(" - "),
997
+ ...numericInputs(3),
998
+ ...nonInputs(" . "),
999
+ ...numericInputs(3),
1000
+ ...nonInputs(" . "),
1001
+ ...numericInputs(3)
1002
+ )
1003
+ }
1004
+ },
1005
+ [CountryCodes.UnitedKingdom]: {
1006
+ default: { mask: makeMask(...alphanumericInputs(8)), transformOnType: uppercase },
1007
+ nonProfit: {
1008
+ mask: makeMask(
1009
+ ...alphanumericInputs(6),
1010
+ ...customInputs(1, /[a-zA-Z0-9-]/, true),
1011
+ ...alphanumericInputs(1, true)
1012
+ ),
1013
+ transformOnType: uppercase
1014
+ }
1015
+ },
1016
+ [CountryCodes.UnitedStates]: {
1017
+ [StateCodesUS.Alabama]: {
1018
+ mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Alabama)),
1019
+ transformOnType: uppercase
1020
+ },
1021
+ [StateCodesUS.Alaska]: {
1022
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Alaska)),
1023
+ transformOnType: uppercase
1024
+ },
1025
+ [StateCodesUS.Arizona]: {
1026
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Arizona)),
1027
+ transformOnType: uppercase
1028
+ },
1029
+ [StateCodesUS.Arkansas]: {
1030
+ mask: makeMask(
1031
+ {
1032
+ type: "input",
1033
+ allow: /[8]/
1034
+ },
1035
+ ...numericInputs(8),
1036
+ ...nonInputs(" "),
1037
+ ...nonInputs(StateCodesUS.Arkansas)
1038
+ ),
1039
+ transformOnType: uppercase
1040
+ },
1041
+ [StateCodesUS.California]: {
1042
+ mask: makeMask(
1043
+ ...numericInputs(7),
1044
+ ...numericInputs(5, true),
1045
+ ...nonInputs(" "),
1046
+ ...nonInputs(StateCodesUS.California)
1047
+ ),
1048
+ transformOnType: uppercase
1049
+ },
1050
+ [StateCodesUS.Colorado]: {
1051
+ mask: makeMask(...numericInputs(11), ...nonInputs(" "), ...nonInputs(StateCodesUS.Colorado)),
1052
+ transformOnType: uppercase
1053
+ },
1054
+ [StateCodesUS.Connecticut]: {
1055
+ mask: makeMask(
1056
+ ...numericInputs(7),
1057
+ ...nonInputs(" "),
1058
+ ...nonInputs(StateCodesUS.Connecticut)
1059
+ ),
1060
+ transformOnType: uppercase
1061
+ },
1062
+ [StateCodesUS.Delaware]: {
1063
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Delaware)),
1064
+ transformOnType: uppercase
1065
+ },
1066
+ [StateCodesUS.Florida]: {
1067
+ mask: makeMask(
1068
+ ...numericInputs(6),
1069
+ ...numericInputs(6, true),
1070
+ ...nonInputs(" "),
1071
+ ...nonInputs(StateCodesUS.Florida)
1072
+ ),
1073
+ transformOnType: uppercase
1074
+ },
1075
+ [StateCodesUS.Georgia]: {
1076
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Georgia)),
1077
+ transformOnType: uppercase
1078
+ },
1079
+ [StateCodesUS.Hawaii]: {
1080
+ mask: makeMask(
1081
+ ...numericInputs(5),
1082
+ ...numericInputs(3, true),
1083
+ {
1084
+ type: "input",
1085
+ allow: /[CDFLNPTZ]/
1086
+ },
1087
+ {
1088
+ type: "input",
1089
+ allow: /[1-8Z]/
1090
+ },
1091
+ ...nonInputs(" "),
1092
+ ...nonInputs(StateCodesUS.Hawaii)
1093
+ ),
1094
+ transformOnType: uppercase
1095
+ },
1096
+ [StateCodesUS.Idaho]: {
1097
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Idaho)),
1098
+ transformOnType: uppercase
1099
+ },
1100
+ [StateCodesUS.Illinois]: {
1101
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Illinois)),
1102
+ transformOnType: uppercase
1103
+ },
1104
+ [StateCodesUS.Indiana]: {
1105
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Indiana)),
1106
+ transformOnType: uppercase
1107
+ },
1108
+ [StateCodesUS.Iowa]: {
1109
+ mask: makeMask(
1110
+ ...numericInputs(6),
1111
+ ...numericInputs(2, true),
1112
+ ...nonInputs(" "),
1113
+ ...nonInputs(StateCodesUS.Iowa)
1114
+ ),
1115
+ transformOnType: uppercase
1116
+ },
1117
+ [StateCodesUS.Kansas]: {
1118
+ mask: makeMask(
1119
+ ...numericInputs(7),
1120
+ ...numericInputs(2, true),
1121
+ ...nonInputs(" "),
1122
+ ...nonInputs(StateCodesUS.Kansas)
1123
+ ),
1124
+ transformOnType: uppercase
1125
+ },
1126
+ [StateCodesUS.Kentucky]: {
1127
+ mask: makeMask(
1128
+ ...numericInputs(9),
1129
+ ...numericInputs(1, true),
1130
+ ...nonInputs(" "),
1131
+ ...nonInputs(StateCodesUS.Kentucky)
1132
+ ),
1133
+ transformOnType: uppercase
1134
+ },
1135
+ [StateCodesUS.Louisiana]: {
1136
+ mask: makeMask(
1137
+ ...numericInputs(9),
1138
+ ...numericInputs(1, true),
1139
+ ...nonInputs(" "),
1140
+ ...nonInputs(StateCodesUS.Louisiana)
1141
+ ),
1142
+ transformOnType: uppercase
1143
+ },
1144
+ [StateCodesUS.Maine]: {
1145
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Maine)),
1146
+ transformOnType: uppercase
1147
+ },
1148
+ [StateCodesUS.Maryland]: {
1149
+ mask: makeMask(...numericInputs(8), ...nonInputs(" "), ...nonInputs(StateCodesUS.Maryland)),
1150
+ transformOnType: uppercase
1151
+ },
1152
+ [StateCodesUS.Massachusetts]: {
1153
+ mask: makeMask(
1154
+ ...numericInputs(10),
1155
+ ...nonInputs(" "),
1156
+ ...nonInputs(StateCodesUS.Massachusetts)
1157
+ ),
1158
+ transformOnType: uppercase
1159
+ },
1160
+ [StateCodesUS.Michigan]: {
1161
+ mask: makeMask(
1162
+ ...numericInputs(6),
1163
+ ...numericInputs(3, true),
1164
+ ...nonInputs(" "),
1165
+ ...nonInputs(StateCodesUS.Michigan)
1166
+ ),
1167
+ transformOnType: uppercase
1168
+ },
1169
+ [StateCodesUS.Minnesota]: {
1170
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Minnesota)),
1171
+ transformOnType: uppercase
1172
+ },
1173
+ [StateCodesUS.Mississippi]: {
1174
+ mask: makeMask(
1175
+ ...numericInputs(7),
1176
+ ...numericInputs(3, true),
1177
+ ...nonInputs(" "),
1178
+ ...nonInputs(StateCodesUS.Mississippi)
1179
+ ),
1180
+ transformOnType: uppercase
1181
+ },
1182
+ [StateCodesUS.Missouri]: {
1183
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Missouri)),
1184
+ transformOnType: uppercase
1185
+ },
1186
+ [StateCodesUS.Montana]: {
1187
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Montana)),
1188
+ transformOnType: uppercase
1189
+ },
1190
+ [StateCodesUS.Nebraska]: {
1191
+ mask: makeMask(
1192
+ ...numericInputs(9),
1193
+ ...numericInputs(2, true),
1194
+ ...nonInputs(" "),
1195
+ ...nonInputs(StateCodesUS.Nebraska)
1196
+ ),
1197
+ transformOnType: uppercase
1198
+ },
1199
+ [StateCodesUS.Nevada]: {
1200
+ mask: makeMask(
1201
+ ...numericInputs(9),
1202
+ ...numericInputs(2, true),
1203
+ ...nonInputs(" "),
1204
+ ...nonInputs(StateCodesUS.Nevada)
1205
+ ),
1206
+ transformOnType: uppercase
1207
+ },
1208
+ [StateCodesUS.NewHampshire]: {
1209
+ mask: makeMask(
1210
+ ...numericInputs(9),
1211
+ ...nonInputs(" "),
1212
+ ...nonInputs(StateCodesUS.NewHampshire)
1213
+ ),
1214
+ transformOnType: uppercase
1215
+ },
1216
+ [StateCodesUS.NewJersey]: {
1217
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewJersey)),
1218
+ transformOnType: uppercase
1219
+ },
1220
+ [StateCodesUS.NewMexico]: {
1221
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewMexico)),
1222
+ transformOnType: uppercase
1223
+ },
1224
+ [StateCodesUS.NewYork]: {
1225
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.NewYork)),
1226
+ transformOnType: uppercase
1227
+ },
1228
+ [StateCodesUS.NorthCarolina]: {
1229
+ mask: makeMask(
1230
+ ...numericInputs(7),
1231
+ ...nonInputs(" "),
1232
+ ...nonInputs(StateCodesUS.NorthCarolina)
1233
+ ),
1234
+ transformOnType: uppercase
1235
+ },
1236
+ [StateCodesUS.NorthDakota]: {
1237
+ mask: makeMask(
1238
+ ...numericInputs(7),
1239
+ ...numericInputs(3, true),
1240
+ ...nonInputs(" "),
1241
+ ...nonInputs(StateCodesUS.NorthDakota)
1242
+ ),
1243
+ transformOnType: uppercase
1244
+ },
1245
+ [StateCodesUS.Ohio]: {
1246
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Ohio)),
1247
+ transformOnType: uppercase
1248
+ },
1249
+ [StateCodesUS.Oklahoma]: {
1250
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Oklahoma)),
1251
+ transformOnType: uppercase
1252
+ },
1253
+ [StateCodesUS.Oregon]: {
1254
+ mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Oregon)),
1255
+ transformOnType: uppercase
1256
+ },
1257
+ [StateCodesUS.Pennsylvania]: {
1258
+ mask: makeMask(
1259
+ ...numericInputs(7),
1260
+ ...nonInputs(" "),
1261
+ ...nonInputs(StateCodesUS.Pennsylvania)
1262
+ ),
1263
+ transformOnType: uppercase
1264
+ },
1265
+ [StateCodesUS.RhodeIsland]: {
1266
+ mask: makeMask(
1267
+ ...numericInputs(7),
1268
+ ...nonInputs(" "),
1269
+ ...nonInputs(StateCodesUS.RhodeIsland)
1270
+ ),
1271
+ transformOnType: uppercase
1272
+ },
1273
+ [StateCodesUS.SouthCarolina]: {
1274
+ mask: makeMask(
1275
+ ...numericInputs(7),
1276
+ ...nonInputs(" "),
1277
+ ...nonInputs(StateCodesUS.SouthCarolina)
1278
+ ),
1279
+ transformOnType: uppercase
1280
+ },
1281
+ [StateCodesUS.SouthDakota]: {
1282
+ mask: makeMask(
1283
+ ...numericInputs(7),
1284
+ ...nonInputs(" "),
1285
+ ...nonInputs(StateCodesUS.SouthDakota)
1286
+ ),
1287
+ transformOnType: uppercase
1288
+ },
1289
+ [StateCodesUS.Tennessee]: {
1290
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Tennessee)),
1291
+ transformOnType: uppercase
1292
+ },
1293
+ [StateCodesUS.Texas]: {
1294
+ mask: makeMask(...numericInputs(10), ...nonInputs(" "), ...nonInputs(StateCodesUS.Texas)),
1295
+ transformOnType: uppercase
1296
+ },
1297
+ [StateCodesUS.Utah]: {
1298
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Utah)),
1299
+ transformOnType: uppercase
1300
+ },
1301
+ [StateCodesUS.Vermont]: {
1302
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Vermont)),
1303
+ transformOnType: uppercase
1304
+ },
1305
+ [StateCodesUS.Virginia]: {
1306
+ mask: makeMask(...numericInputs(7), ...nonInputs(" "), ...nonInputs(StateCodesUS.Virginia)),
1307
+ transformOnType: uppercase
1308
+ },
1309
+ [StateCodesUS.Washington]: {
1310
+ mask: makeMask(...numericInputs(9), ...nonInputs(" "), ...nonInputs(StateCodesUS.Washington)),
1311
+ transformOnType: uppercase
1312
+ },
1313
+ [StateCodesUS.WestVirginia]: {
1314
+ mask: makeMask(
1315
+ ...numericInputs(6),
1316
+ ...nonInputs(" "),
1317
+ ...nonInputs(StateCodesUS.WestVirginia)
1318
+ ),
1319
+ transformOnType: uppercase
1320
+ },
1321
+ [StateCodesUS.Wisconsin]: {
1322
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Wisconsin)),
1323
+ transformOnType: uppercase
1324
+ },
1325
+ [StateCodesUS.Wyoming]: {
1326
+ mask: makeMask(...numericInputs(6), ...nonInputs(" "), ...nonInputs(StateCodesUS.Wyoming)),
1327
+ transformOnType: uppercase
1328
+ },
1329
+ [StateCodesUS.DistrictOfColumbia]: {
1330
+ mask: makeMask(...numericInputs(9)),
1331
+ transformOnType: uppercase
1332
+ },
1333
+ default: {
1334
+ mask: makeMask(...numericInputs(9)),
1335
+ transformOnType: uppercase
1336
+ }
1337
+ }
1338
+ };
1339
+ const stateFormatGuidanceText = {
1340
+ [StateCodesUS.Alabama]: {
1341
+ key: "enterNDigitsForExample",
1342
+ values: {
1343
+ numDigits: "9",
1344
+ example: "123456789 AL"
1345
+ }
1346
+ },
1347
+ [StateCodesUS.Alaska]: {
1348
+ key: "enterNDigitsForExample",
1349
+ values: {
1350
+ numDigits: "8",
1351
+ example: "12345678 AK"
1352
+ }
1353
+ },
1354
+ [StateCodesUS.Arizona]: {
1355
+ key: "enterNDigitsForExample",
1356
+ values: {
1357
+ numDigits: "8",
1358
+ example: "12345678 AZ"
1359
+ }
1360
+ },
1361
+ [StateCodesUS.Arkansas]: {
1362
+ key: "enterTheRemainingNDigitsForExample",
1363
+ values: {
1364
+ numDigits: "8",
1365
+ example: "800000001 AR"
1366
+ }
1367
+ },
1368
+ [StateCodesUS.California]: {
1369
+ key: "enterXOrYDigitsForExample",
1370
+ values: {
1371
+ xDigits: "8",
1372
+ yDigits: "12",
1373
+ example: "12345678 CA"
1374
+ }
1375
+ },
1376
+ [StateCodesUS.Colorado]: {
1377
+ key: "enterNDigitsForExample",
1378
+ values: {
1379
+ numDigits: "11",
1380
+ example: "12345678901 CO"
1381
+ }
1382
+ },
1383
+ [StateCodesUS.Connecticut]: {
1384
+ key: "enterNDigitsForExample",
1385
+ values: {
1386
+ numDigits: "7",
1387
+ example: "1234567 CT"
1388
+ }
1389
+ },
1390
+ [StateCodesUS.Delaware]: {
1391
+ key: "enterNDigitsForExample",
1392
+ values: {
1393
+ numDigits: "7",
1394
+ example: "1234567 DE"
1395
+ }
1396
+ },
1397
+ [StateCodesUS.Florida]: {
1398
+ key: "enterXOrYDigitsForExample",
1399
+ values: {
1400
+ xDigits: "6",
1401
+ yDigits: "12",
1402
+ example: "123456789012 FL"
1403
+ }
1404
+ },
1405
+ [StateCodesUS.Georgia]: {
1406
+ key: "enterNDigitsForExample",
1407
+ values: {
1408
+ numDigits: "8",
1409
+ example: "12345678 GA"
1410
+ }
1411
+ },
1412
+ [StateCodesUS.Hawaii]: {
1413
+ key: "validationPleaseEnterAValidBusinessRegistrationNumberWithFormat",
1414
+ values: {
1415
+ example: "12345678ZZ HI"
1416
+ }
1417
+ },
1418
+ [StateCodesUS.Idaho]: {
1419
+ key: "enterNDigitsForExample",
1420
+ values: {
1421
+ numDigits: "6",
1422
+ example: "123456 ID"
1423
+ }
1424
+ },
1425
+ [StateCodesUS.Illinois]: {
1426
+ key: "enterNDigitsForExample",
1427
+ values: {
1428
+ numDigits: "8",
1429
+ example: "12345678 IL"
1430
+ }
1431
+ },
1432
+ [StateCodesUS.Indiana]: {
1433
+ key: "enterNDigitsForExample",
1434
+ values: {
1435
+ numDigits: "10",
1436
+ example: "1234567890 IN"
1437
+ }
1438
+ },
1439
+ [StateCodesUS.Iowa]: {
1440
+ key: "enterXToYDigitsForExample",
1441
+ values: {
1442
+ minDigits: "6",
1443
+ maxDigits: "8",
1444
+ example: "12345678 IA"
1445
+ }
1446
+ },
1447
+ [StateCodesUS.Kansas]: {
1448
+ key: "enterXToYDigitsForExample",
1449
+ values: {
1450
+ minDigits: "7",
1451
+ maxDigits: "9",
1452
+ example: "1234567890 KS"
1453
+ }
1454
+ },
1455
+ [StateCodesUS.Kentucky]: {
1456
+ key: "enterXToYDigitsForExample",
1457
+ values: {
1458
+ minDigits: "9",
1459
+ maxDigits: "10",
1460
+ example: "1234567890 KY"
1461
+ }
1462
+ },
1463
+ [StateCodesUS.Louisiana]: {
1464
+ key: "enterXToYDigitsForExample",
1465
+ values: {
1466
+ minDigits: "9",
1467
+ maxDigits: "10",
1468
+ example: "1234567890 LA"
1469
+ }
1470
+ },
1471
+ [StateCodesUS.Maine]: {
1472
+ key: "enterNDigitsForExample",
1473
+ values: {
1474
+ numDigits: "8",
1475
+ example: "12345678 ME"
1476
+ }
1477
+ },
1478
+ [StateCodesUS.Maryland]: {
1479
+ key: "enterNDigitsForExample",
1480
+ values: {
1481
+ numDigits: "8",
1482
+ example: "12345678 MD"
1483
+ }
1484
+ },
1485
+ [StateCodesUS.Massachusetts]: {
1486
+ key: "enterNDigitsForExample",
1487
+ values: {
1488
+ numDigits: "10",
1489
+ example: "1234567890 MA"
1490
+ }
1491
+ },
1492
+ [StateCodesUS.Michigan]: {
1493
+ key: "enterXOrYDigitsForExample",
1494
+ values: {
1495
+ xDigits: "6",
1496
+ yDigits: "9",
1497
+ example: "123456 MI"
1498
+ }
1499
+ },
1500
+ [StateCodesUS.Minnesota]: {
1501
+ key: "enterNDigitsForExample",
1502
+ values: {
1503
+ numDigits: "7",
1504
+ example: "1234567 MN"
1505
+ }
1506
+ },
1507
+ [StateCodesUS.Mississippi]: {
1508
+ key: "enterXToYDigitsForExample",
1509
+ values: {
1510
+ minDigits: "7",
1511
+ maxDigits: "10",
1512
+ example: "1234567 MS"
1513
+ }
1514
+ },
1515
+ [StateCodesUS.Missouri]: {
1516
+ key: "enterNDigitsForExample",
1517
+ values: {
1518
+ numDigits: "10",
1519
+ example: "1234567890 MO"
1520
+ }
1521
+ },
1522
+ [StateCodesUS.Montana]: {
1523
+ key: "enterNDigitsForExample",
1524
+ values: {
1525
+ numDigits: "7",
1526
+ example: "1234567 MT"
1527
+ }
1528
+ },
1529
+ [StateCodesUS.Nebraska]: {
1530
+ key: "enterXToYDigitsForExample",
1531
+ values: {
1532
+ minDigits: "9",
1533
+ maxDigits: "11",
1534
+ example: "123456789 NE"
1535
+ }
1536
+ },
1537
+ [StateCodesUS.Nevada]: {
1538
+ key: "enterXToYDigitsForExample",
1539
+ values: {
1540
+ minDigits: "9",
1541
+ maxDigits: "11",
1542
+ example: "123456789 NV"
1543
+ }
1544
+ },
1545
+ [StateCodesUS.NewHampshire]: {
1546
+ key: "enterNDigitsForExample",
1547
+ values: {
1548
+ numDigits: "9",
1549
+ example: "123456789 NH"
1550
+ }
1551
+ },
1552
+ [StateCodesUS.NewJersey]: {
1553
+ key: "enterNDigitsForExample",
1554
+ values: {
1555
+ numDigits: "10",
1556
+ example: "1234567890 NJ"
1557
+ }
1558
+ },
1559
+ [StateCodesUS.NewMexico]: {
1560
+ key: "enterNDigitsForExample",
1561
+ values: {
1562
+ numDigits: "6",
1563
+ example: "123456 NM"
1564
+ }
1565
+ },
1566
+ [StateCodesUS.NewYork]: {
1567
+ key: "enterNDigitsForExample",
1568
+ values: {
1569
+ numDigits: "7",
1570
+ example: "1234567 NY"
1571
+ }
1572
+ },
1573
+ [StateCodesUS.NorthCarolina]: {
1574
+ key: "enterNDigitsForExample",
1575
+ values: {
1576
+ numDigits: "7",
1577
+ example: "1234567 NC"
1578
+ }
1579
+ },
1580
+ [StateCodesUS.NorthDakota]: {
1581
+ key: "enterXToYDigitsForExample",
1582
+ values: {
1583
+ minDigits: "7",
1584
+ maxDigits: "10",
1585
+ example: "1234567 ND"
1586
+ }
1587
+ },
1588
+ [StateCodesUS.Ohio]: {
1589
+ key: "enterNDigitsForExample",
1590
+ values: {
1591
+ numDigits: "10",
1592
+ example: "1234567890 OH"
1593
+ }
1594
+ },
1595
+ [StateCodesUS.Oklahoma]: {
1596
+ key: "enterNDigitsForExample",
1597
+ values: {
1598
+ numDigits: "10",
1599
+ example: "1234567890 OK"
1600
+ }
1601
+ },
1602
+ [StateCodesUS.Oregon]: {
1603
+ key: "enterNDigitsForExample",
1604
+ values: {
1605
+ numDigits: "9",
1606
+ example: "123456789 OR"
1607
+ }
1608
+ },
1609
+ [StateCodesUS.Pennsylvania]: {
1610
+ key: "enterNDigitsForExample",
1611
+ values: {
1612
+ numDigits: "7",
1613
+ example: "1234567 PA"
1614
+ }
1615
+ },
1616
+ [StateCodesUS.RhodeIsland]: {
1617
+ key: "enterNDigitsForExample",
1618
+ values: {
1619
+ numDigits: "7",
1620
+ example: "1234567 RI"
1621
+ }
1622
+ },
1623
+ [StateCodesUS.SouthCarolina]: {
1624
+ key: "enterNDigitsForExample",
1625
+ values: {
1626
+ numDigits: "7",
1627
+ example: "1234567 SC"
1628
+ }
1629
+ },
1630
+ [StateCodesUS.SouthDakota]: {
1631
+ key: "enterNDigitsForExample",
1632
+ values: {
1633
+ numDigits: "7",
1634
+ example: "1234567 SD"
1635
+ }
1636
+ },
1637
+ [StateCodesUS.Tennessee]: {
1638
+ key: "enterNDigitsForExample",
1639
+ values: {
1640
+ numDigits: "6",
1641
+ example: "123456 TN"
1642
+ }
1643
+ },
1644
+ [StateCodesUS.Texas]: {
1645
+ key: "enterNDigitsForExample",
1646
+ values: {
1647
+ numDigits: "10",
1648
+ example: "1234567890 TX"
1649
+ }
1650
+ },
1651
+ [StateCodesUS.Utah]: {
1652
+ key: "enterNDigitsForExample",
1653
+ values: {
1654
+ numDigits: "7",
1655
+ example: "1234567 UT"
1656
+ }
1657
+ },
1658
+ [StateCodesUS.Vermont]: {
1659
+ key: "enterNDigitsForExample",
1660
+ values: {
1661
+ numDigits: "6",
1662
+ example: "123456 VT"
1663
+ }
1664
+ },
1665
+ [StateCodesUS.Virginia]: {
1666
+ key: "enterNDigitsForExample",
1667
+ values: {
1668
+ numDigits: "7",
1669
+ example: "1234567 VA"
1670
+ }
1671
+ },
1672
+ [StateCodesUS.Washington]: {
1673
+ key: "enterNDigitsForExample",
1674
+ values: {
1675
+ numDigits: "9",
1676
+ example: "123456789 WA"
1677
+ }
1678
+ },
1679
+ [StateCodesUS.WestVirginia]: {
1680
+ key: "enterNDigitsForExample",
1681
+ values: {
1682
+ numDigits: "6",
1683
+ example: "123456 WV"
1684
+ }
1685
+ },
1686
+ [StateCodesUS.Wisconsin]: {
1687
+ key: "enterNDigitsForExample",
1688
+ values: {
1689
+ numDigits: "6",
1690
+ example: "123456 WI"
1691
+ }
1692
+ },
1693
+ [StateCodesUS.Wyoming]: {
1694
+ key: "enterNDigitsForExample",
1695
+ values: {
1696
+ numDigits: "6",
1697
+ example: "123456 WY"
1698
+ }
1699
+ },
1700
+ [StateCodesUS.DistrictOfColumbia]: {
1701
+ key: "enterNDigitsForExample",
1702
+ values: {
1703
+ numDigits: "9",
1704
+ example: "123456789"
1705
+ }
1706
+ },
1707
+ default: {
1708
+ key: "enterNDigitsForExample",
1709
+ values: {
1710
+ numDigits: "9",
1711
+ example: "123456789"
1712
+ }
1713
+ }
1714
+ };
1715
+ const businessRegistrationNumberPatterns = {
1716
+ [CountryCodes.Australia]: { default: /^\d{9}$/, associationIncorporated: /^[a-zA-Z0-9]{3,20}$/ },
1717
+ [CountryCodes.Austria]: {
1718
+ firmenbuchnummer: /^(FN|T)\d{3,6}[a-z]$/,
1719
+ ZVR: /^(AT-ZVR-)\d{9,10}$/
1720
+ },
1721
+ [CountryCodes.Belgium]: { default: /^\d{10}$/ },
1722
+ [CountryCodes.Brazil]: { default: /^\d{14}$/ },
1723
+ [CountryCodes.Bulgaria]: { default: /^\d{9}$/ },
1724
+ [CountryCodes.Canada]: { default: /^[a-zA-Z0-9]{5,10}$/ },
1725
+ [CountryCodes.Croatia]: { default: /^\d{9}$/, soleProprietorship: /^\d{8}$/ },
1726
+ [CountryCodes.Cyprus]: { default: /^[COP]{1}\d{1,8}$/ },
1727
+ [CountryCodes.CzechRepublic]: { default: /^\d{8,10}$/ },
1728
+ [CountryCodes.Denmark]: { default: /^\d{8}$/ },
1729
+ [CountryCodes.Estonia]: { default: /^\d{8}$/ },
1730
+ [CountryCodes.Finland]: { default: /^\d{7}-?\d$/ },
1731
+ [CountryCodes.France]: {
1732
+ SIRET: /^\d{9}-?\d{5}$/,
1733
+ RNA: /^W(\d{9}|\d[A-Za-z]\d{7})$/
1734
+ },
1735
+ [CountryCodes.Gibraltar]: { default: /^[a-zA-Z0-9]{1,8}$/ },
1736
+ [CountryCodes.Germany]: { default: /^[A-Z]{2,3}\d{1,6}[A-Z]{0,5}(?:-[A-Z]\d{4})?$/ },
1737
+ [CountryCodes.Greece]: { default: /^\d{12}$/ },
1738
+ [CountryCodes.Guernsey]: { default: /^\d{1,9}$/ },
1739
+ [CountryCodes.HongKong]: { default: /^\d{7}$/ },
1740
+ [CountryCodes.Hungary]: { default: /^\d{10}$/, nyilvantartasiSzam: /^\d{7,10}$/ },
1741
+ [CountryCodes.Iceland]: { default: /^\d{10}$/ },
1742
+ [CountryCodes.India]: { default: /^\d{21}$/ },
1743
+ [CountryCodes.Indonesia]: { default: /^\d{12}$/ },
1744
+ [CountryCodes.Ireland]: { default: /^[1-9]\d{1,7}$/ },
1745
+ [CountryCodes.IsleOfMan]: { default: /^\d{6}[A-Z]$/ },
1746
+ [CountryCodes.Italy]: { partitaIVA: /^\d{11}$/, CCIAA: /^[a-zA-Z]{2}\d{6,7}$/ },
1747
+ [CountryCodes.Japan]: { default: /^\d{12}$/ },
1748
+ [CountryCodes.Jersey]: { default: /^[a-zA-Z0-9]{1,9}$/ },
1749
+ [CountryCodes.Korea]: { default: /^\d{10}$/ },
1750
+ [CountryCodes.Latvia]: { default: /^\d{11}$/ },
1751
+ [CountryCodes.Liechtenstein]: { default: /FL-[0-9]{4}[.][0-9]{3}[.][0-9]{3}-[0-9]$/ },
1752
+ [CountryCodes.Lithuania]: { default: /^\d{6,9}$/ },
1753
+ [CountryCodes.Luxembourg]: { default: /^[a-zA-Z]\d{1,9}$/ },
1754
+ [CountryCodes.Malaysia]: { default: /^\d{7}$|^\d{12}$/ },
1755
+ [CountryCodes.Malta]: { default: /^[CP]\s?\d{4,6}$/ },
1756
+ [CountryCodes.Mexico]: { default: /^\D{3}\d{6}\w{3}$/ },
1757
+ [CountryCodes.Monaco]: {
1758
+ default: /^[0-9]{2}[A-Z]{1,3}[0-9]{5}$/,
1759
+ soleProprietorship: /^\d{2,4}[A-Z]\d{5}$/
1760
+ },
1761
+ [CountryCodes.Netherlands]: { default: /^\d{8}$/ },
1762
+ [CountryCodes.NewZealand]: { NZBN: /^\d{13}$/, companyNumberNZ: /^\d{7}$/ },
1763
+ [CountryCodes.Norway]: { default: /^\d{9}$/ },
1764
+ [CountryCodes.Poland]: { krsNumber: /^\d{10}$/, regon: /^\d{9}$/ },
1765
+ [CountryCodes.Portugal]: { default: /^\d{9}$/ },
1766
+ [CountryCodes.Romania]: {
1767
+ roRegNumberOldFormat: /^[A-Z]\d{1,2}\/\d{1,9}\/\d{4}$/,
1768
+ roRegNumberNewFormat: /^[JFC]\d{13}$/
1769
+ },
1770
+ [CountryCodes.Singapore]: { default: /^[a-zA-Z0-9]{9,10}$/ },
1771
+ [CountryCodes.Slovakia]: { default: /^\d{8}$/ },
1772
+ [CountryCodes.Slovenia]: { default: /^\d{10}$/ },
1773
+ [CountryCodes.Spain]: { default: /^[a-zA-Z][a-zA-Z0-9]{8}$/ },
1774
+ [CountryCodes.Sweden]: { default: /^\d{10}$/ },
1775
+ [CountryCodes.Switzerland]: { default: /^CHE\d{9}$|^CH\d{11}$/ },
1776
+ [CountryCodes.UnitedKingdom]: {
1777
+ default: /^[a-zA-Z0-9]{8}$/,
1778
+ nonProfit: /^(?:(?:[A-Z]{2})?\d{6}|\d{6,8}|\d{6}-\d)$/
1779
+ },
1780
+ [CountryCodes.UnitedStates]: {
1781
+ [StateCodesUS.Alabama]: /^\d{9}$/,
1782
+ [StateCodesUS.Alaska]: /^\d{8}$/,
1783
+ [StateCodesUS.Arizona]: /^\d{8}$/,
1784
+ [StateCodesUS.Arkansas]: /^8\d{8}$/,
1785
+ [StateCodesUS.California]: /^\d{7}$|^\d{12}$/,
1786
+ [StateCodesUS.Colorado]: /^\d{11}$/,
1787
+ [StateCodesUS.Connecticut]: /^\d{7}$/,
1788
+ [StateCodesUS.Delaware]: /^\d{7}$/,
1789
+ [StateCodesUS.Florida]: /^\d{6}$|^\d{12}$/,
1790
+ [StateCodesUS.Georgia]: /^\d{8}$/,
1791
+ [StateCodesUS.Hawaii]: /^\d{5,8}(C1|C2|C3|C4|C5|D1|D2|D3|D4|F1|F2|L1|L2|N1|N2|P1|P2|T1|T2|T3|T4|T5|T6|T7|T8|ZZ)$/,
1792
+ [StateCodesUS.Idaho]: /^\d{6}$/,
1793
+ [StateCodesUS.Illinois]: /^\d{8}$/,
1794
+ [StateCodesUS.Indiana]: /^\d{10}$/,
1795
+ [StateCodesUS.Iowa]: /^\d{6,8}$/,
1796
+ [StateCodesUS.Kansas]: /^\d{7,9}$/,
1797
+ [StateCodesUS.Kentucky]: /^\d{9,10}$/,
1798
+ [StateCodesUS.Louisiana]: /^\d{9,10}$/,
1799
+ [StateCodesUS.Maine]: /^\d{8}$/,
1800
+ [StateCodesUS.Maryland]: /^\d{8}$/,
1801
+ [StateCodesUS.Massachusetts]: /^\d{10}$/,
1802
+ [StateCodesUS.Michigan]: /^\d{6}$|^\d{9}$/,
1803
+ [StateCodesUS.Minnesota]: /^\d{7}$/,
1804
+ [StateCodesUS.Mississippi]: /^\d{7,10}$/,
1805
+ [StateCodesUS.Missouri]: /^\d{10}$/,
1806
+ [StateCodesUS.Montana]: /^\d{7}$/,
1807
+ [StateCodesUS.Nebraska]: /^\d{9,11}$/,
1808
+ [StateCodesUS.Nevada]: /^\d{9,11}$/,
1809
+ [StateCodesUS.NewHampshire]: /^\d{9}$/,
1810
+ [StateCodesUS.NewJersey]: /^\d{10}$/,
1811
+ [StateCodesUS.NewMexico]: /^\d{6}$/,
1812
+ [StateCodesUS.NewYork]: /^\d{7}$/,
1813
+ [StateCodesUS.NorthCarolina]: /^\d{7}$/,
1814
+ [StateCodesUS.NorthDakota]: /^\d{7,10}$/,
1815
+ [StateCodesUS.Ohio]: /^\d{10}$/,
1816
+ [StateCodesUS.Oklahoma]: /^\d{10}$/,
1817
+ [StateCodesUS.Oregon]: /^\d{9}$/,
1818
+ [StateCodesUS.Pennsylvania]: /^\d{7}$/,
1819
+ [StateCodesUS.RhodeIsland]: /^\d{7}$/,
1820
+ [StateCodesUS.SouthCarolina]: /^\d{7}$/,
1821
+ [StateCodesUS.SouthDakota]: /^\d{7}$/,
1822
+ [StateCodesUS.Tennessee]: /^\d{6}$/,
1823
+ [StateCodesUS.Texas]: /^\d{10}$/,
1824
+ [StateCodesUS.Utah]: /^\d{7}$/,
1825
+ [StateCodesUS.Vermont]: /^\d{6}$/,
1826
+ [StateCodesUS.Virginia]: /^\d{7}$/,
1827
+ [StateCodesUS.Washington]: /^\d{9}$/,
1828
+ [StateCodesUS.WestVirginia]: /^\d{6}$/,
1829
+ [StateCodesUS.Wisconsin]: /^\d{6}$/,
1830
+ [StateCodesUS.Wyoming]: /^\d{6}$/,
1831
+ [StateCodesUS.DistrictOfColumbia]: /^\d{9}$/,
1832
+ default: /^\d{9}$/
1833
+ }
1834
+ };
1835
+ const taxInformationDefaultFieldMetadata = {
1836
+ label: "taxId"
1837
+ };
1838
+ const exemptedFromTaxDefaultFieldMetadata = {
1839
+ label: "iDontHaveATaxId"
1840
+ };
1841
+ const mapValidators = (validators, country) => {
1842
+ return validators.map(
1843
+ (validator) => ({
1844
+ ...validator,
1845
+ validate: (taxInformation) => {
1846
+ const taxInfo = taxInformation?.find((taxId) => country === taxId.country);
1847
+ if (taxInfo?.numberAbsent) return true;
1848
+ return taxInfo?.number ? validator.validate(taxInfo.number) : false;
1849
+ }
1850
+ })
1851
+ );
1852
+ };
1853
+ const taxInformationDefaultFieldConfig = {
1854
+ [CountryCodes.Australia]: {
1855
+ label: "australianBusinessNumberAbn",
1856
+ validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Australia),
1857
+ mask: {
1858
+ mask: makeMask(
1859
+ ...numericInputs(2),
1860
+ spacer,
1861
+ ...numericInputs(3),
1862
+ spacer,
1863
+ ...numericInputs(3),
1864
+ spacer,
1865
+ ...numericInputs(3)
1866
+ )
1867
+ },
1868
+ guidanceText: {
1869
+ key: "enterNDigitsForExample",
1870
+ values: {
1871
+ numDigits: "11",
1872
+ example: "51 824 753 556"
1873
+ }
1874
+ }
1875
+ },
1876
+ [CountryCodes.Belgium]: ({ companyType }) => {
1877
+ switch (companyType) {
1878
+ case LegalEntityTypes.INDIVIDUAL:
1879
+ return {
1880
+ label: "taxInformationNumber__BE_Individual",
1881
+ placeholder: "taxInformationNumber__placeHolder__BE_Individual",
1882
+ validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Belgium),
1883
+ mask: { mask: makeMask(...numericInputs(11)) },
1884
+ guidanceText: {
1885
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1886
+ values: {
1887
+ example: "99999999999",
1888
+ idType: "Numeró National"
1889
+ }
1890
+ }
1891
+ };
1892
+ default:
1893
+ return {
1894
+ label: "taxInformationNumber__BE",
1895
+ placeholder: "taxInformationNumber__placeHolder__BE",
1896
+ validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.Belgium),
1897
+ mask: { mask: makeMask(...numericInputs(10)) },
1898
+ guidanceText: {
1899
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1900
+ values: {
1901
+ example: "0123321123",
1902
+ idType: "Business nummer"
1903
+ }
1904
+ }
1905
+ };
1906
+ }
1907
+ },
1908
+ [CountryCodes.Canada]: {
1909
+ label: "businessNumber",
1910
+ validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Canada),
1911
+ mask: { mask: makeMask(...numericInputs(9)) },
1912
+ guidanceText: {
1913
+ key: "enterNDigitsForExample",
1914
+ values: {
1915
+ numDigits: "9",
1916
+ example: "123456789"
1917
+ }
1918
+ }
1919
+ },
1920
+ [CountryCodes.France]: {
1921
+ label: "taxInformationNumber__FR",
1922
+ placeholder: "taxInformationNumber__placeHolder__FR",
1923
+ validators: mapValidators([validatePatternOnBlur(/^\s*(\d\s*){13}$/)], CountryCodes.France),
1924
+ mask: {
1925
+ mask: makeMask(
1926
+ ...numericInputs(2),
1927
+ spacer,
1928
+ ...numericInputs(2),
1929
+ spacer,
1930
+ ...numericInputs(3),
1931
+ spacer,
1932
+ ...numericInputs(3),
1933
+ spacer,
1934
+ ...numericInputs(3)
1935
+ )
1936
+ },
1937
+ guidanceText: {
1938
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1939
+ values: {
1940
+ example: "30 23 217 600 053",
1941
+ idType: "Numéro SPI"
1942
+ }
1943
+ }
1944
+ },
1945
+ [CountryCodes.Germany]: ({ companyType }) => {
1946
+ switch (companyType) {
1947
+ case LegalEntityTypes.INDIVIDUAL:
1948
+ return {
1949
+ label: "taxInformationNumber__DE_Individual",
1950
+ placeholder: "taxInformationNumber__placeHolder__DE_Individual",
1951
+ validators: mapValidators([validatePatternOnBlur(/^\d{11}$/)], CountryCodes.Germany),
1952
+ mask: { mask: makeMask(...numericInputs(11)) },
1953
+ guidanceText: {
1954
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1955
+ values: {
1956
+ example: "26954371827",
1957
+ idType: "IdNr"
1958
+ }
1959
+ }
1960
+ };
1961
+ default:
1962
+ return {
1963
+ label: "taxInformationNumber__DE",
1964
+ placeholder: "taxInformationNumber__placeHolder__DE",
1965
+ validators: mapValidators([validatePatternOnBlur(/^\d{10,11}$/)], CountryCodes.Germany),
1966
+ mask: { mask: makeMask(...numericInputs(11)) },
1967
+ guidanceText: {
1968
+ key: "validationPleaseEnterAValidIdNumberWithExample",
1969
+ values: {
1970
+ example: "14310260208",
1971
+ idType: "Steuernummer"
1972
+ }
1973
+ }
1974
+ };
1975
+ }
1976
+ },
1977
+ [CountryCodes.Gibraltar]: {
1978
+ label: "taxpayerReferenceNumber",
1979
+ validators: mapValidators([validatePatternOnBlur(/^\d{1,7}$/)], CountryCodes.Gibraltar),
1980
+ mask: {
1981
+ mask: makeMask(...numericInputs(1), ...numericInputs(6, true))
1982
+ },
1983
+ guidanceText: {
1984
+ key: "enterAMaximumOfNDigitsForExample",
1985
+ values: {
1986
+ maxDigits: "7",
1987
+ example: "123456"
1988
+ }
1989
+ }
1990
+ },
1991
+ [CountryCodes.Guernsey]: ({ companyType }) => {
1992
+ switch (companyType) {
1993
+ case CompanyTypesValues.SOLE_PROPRIETORSHIP:
1994
+ return {
1995
+ label: "nationalInsuranceNumber",
1996
+ validators: mapValidators(
1997
+ [validatePatternOnBlur(/^GY\d{6}[A-D]$/)],
1998
+ CountryCodes.Guernsey
1999
+ ),
2000
+ mask: {
2001
+ mask: makeMask(
2002
+ ...nonInputs("GY", { includeInValue: true }),
2003
+ spacer,
2004
+ ...numericInputs(2),
2005
+ spacer,
2006
+ ...numericInputs(2),
2007
+ spacer,
2008
+ ...numericInputs(2),
2009
+ spacer,
2010
+ {
2011
+ type: "input",
2012
+ allow: /[A-D]/
2013
+ }
2014
+ ),
2015
+ transformOnType: uppercase
2016
+ },
2017
+ guidanceText: {
2018
+ key: "enterTheRemainingNCharactersForExample",
2019
+ values: {
2020
+ numChars: "7",
2021
+ example: "GY 12 34 56 A"
2022
+ }
2023
+ }
2024
+ };
2025
+ default:
2026
+ return {
2027
+ label: "taxInformationNumber",
2028
+ mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
2029
+ validators: mapValidators(
2030
+ [
2031
+ validatePatternOnBlur(
2032
+ businessRegistrationNumberPatterns[CountryCodes.Guernsey].default
2033
+ )
2034
+ ],
2035
+ CountryCodes.Guernsey
2036
+ ),
2037
+ guidanceText: {
2038
+ key: "enterAMaximumOfNDigitsForExample",
2039
+ values: {
2040
+ maxDigits: "9",
2041
+ example: "123456"
2042
+ }
2043
+ }
2044
+ };
2045
+ }
2046
+ },
2047
+ [CountryCodes.HongKong]: {
2048
+ label: "taxInformationNumber__HK",
2049
+ validators: mapValidators([validatePatternOnBlur(/^\d{8}$/)], CountryCodes.HongKong),
2050
+ mask: { mask: makeMask(...numericInputs(8)) },
2051
+ guidanceText: {
2052
+ key: "enterNDigitsForExample",
2053
+ values: {
2054
+ numDigits: "8",
2055
+ example: "70569713"
2056
+ }
2057
+ }
2058
+ },
2059
+ [CountryCodes.Jersey]: ({ taxIdNumberType, companyType }) => {
2060
+ switch (taxIdNumberType) {
2061
+ case "SSN":
2062
+ return {
2063
+ label: "socialSecurityNumber",
2064
+ validators: mapValidators(
2065
+ [validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-Z]$/)],
2066
+ CountryCodes.Jersey
2067
+ ),
2068
+ mask: {
2069
+ mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...alphaInputs(1)),
2070
+ transformOnType: uppercase
2071
+ },
2072
+ guidanceText: {
2073
+ key: "enterNCharactersForExample",
2074
+ values: {
2075
+ numChars: "9",
2076
+ example: "JY000000A"
2077
+ }
2078
+ }
2079
+ };
2080
+ case "TIN_JE":
2081
+ default:
2082
+ switch (companyType) {
2083
+ case CompanyTypesValues.SOLE_PROPRIETORSHIP:
2084
+ return {
2085
+ label: "taxIdentificationNumber",
2086
+ validators: mapValidators([validatePatternOnBlur(/^\d{10}$/)], CountryCodes.Jersey),
2087
+ mask: {
2088
+ mask: makeMask(
2089
+ ...numericInputs(3),
2090
+ ...nonInputs(" - "),
2091
+ ...numericInputs(3),
2092
+ ...nonInputs(" - "),
2093
+ ...numericInputs(4)
2094
+ )
2095
+ },
2096
+ guidanceText: {
2097
+ key: "enterNDigitsForExample",
2098
+ values: {
2099
+ numDigits: "10",
2100
+ example: "100-100-1000"
2101
+ }
2102
+ }
2103
+ };
2104
+ default:
2105
+ return {
2106
+ label: "taxIdentificationNumber",
2107
+ validators: mapValidators(
2108
+ [validatePatternOnBlur(/^[A-Z]{2}\d{5}$/)],
2109
+ CountryCodes.Jersey
2110
+ ),
2111
+ mask: {
2112
+ mask: makeMask(...alphaInputs(2), ...numericInputs(5)),
2113
+ transformOnType: uppercase
2114
+ },
2115
+ guidanceText: {
2116
+ key: "enterNCharactersForExample",
2117
+ values: {
2118
+ numChars: "7",
2119
+ example: "CC17261"
2120
+ }
2121
+ }
2122
+ };
2123
+ }
2124
+ }
2125
+ },
2126
+ [CountryCodes.Ireland]: {
2127
+ label: "trnNumber",
2128
+ validators: mapValidators(
2129
+ [validatePatternOnBlur(/^(\d{7})([a-zA-Z])([a-zA-Z]?)$/)],
2130
+ CountryCodes.Ireland
2131
+ ),
2132
+ mask: {
2133
+ mask: makeMask(...numericInputs(7), ...alphaInputs(1), ...alphaInputs(1, true))
2134
+ },
2135
+ guidanceText: {
2136
+ key: "enterXDigitsThenXToYLettersForExample",
2137
+ values: {
2138
+ numDigits: "7",
2139
+ minLetters: "1",
2140
+ maxLetters: "2",
2141
+ example: "1497955KA"
2142
+ }
2143
+ }
2144
+ },
2145
+ [CountryCodes.IsleOfMan]: {
2146
+ label: "taxReferenceNumber",
2147
+ validators: mapValidators([validatePatternOnBlur(/^[HCX]\d{8}$/)], CountryCodes.IsleOfMan),
2148
+ mask: {
2149
+ mask: makeMask(
2150
+ {
2151
+ type: "input",
2152
+ allow: /[HCX]/
2153
+ },
2154
+ ...numericInputs(6),
2155
+ ...nonInputs(" - "),
2156
+ ...numericInputs(2)
2157
+ ),
2158
+ transformOnType: uppercase
2159
+ },
2160
+ guidanceText: {
2161
+ key: "enterNCharactersForExample",
2162
+ values: {
2163
+ numChars: "9",
2164
+ example: "C155673-79"
2165
+ }
2166
+ }
2167
+ },
2168
+ [CountryCodes.Netherlands]: ({ companyType }) => {
2169
+ switch (companyType) {
2170
+ case LegalEntityTypes.INDIVIDUAL:
2171
+ return {
2172
+ label: "bsnNumber",
2173
+ placeholder: "taxInformationNumber__placeHolder__NL",
2174
+ validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Netherlands),
2175
+ mask: { mask: makeMask(...numericInputs(9)) },
2176
+ guidanceText: {
2177
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2178
+ values: {
2179
+ example: "999999999",
2180
+ idType: "BSN"
2181
+ }
2182
+ }
2183
+ };
2184
+ default:
2185
+ return {
2186
+ label: "rsinNumber",
2187
+ placeholder: "taxInformationNumber__placeHolder__NL",
2188
+ validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.Netherlands),
2189
+ mask: { mask: makeMask(...numericInputs(9)) },
2190
+ guidanceText: {
2191
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2192
+ values: {
2193
+ example: "811786523",
2194
+ idType: "RSIN"
2195
+ }
2196
+ }
2197
+ };
2198
+ }
2199
+ },
2200
+ [CountryCodes.NewZealand]: {
2201
+ label: "irdNumber",
2202
+ validators: mapValidators([validatePatternOnBlur(/^\d{8,9}$/)], CountryCodes.NewZealand),
2203
+ mask: {
2204
+ mask: makeMask(...numericInputs(8), ...numericInputs(1, true))
2205
+ },
2206
+ guidanceText: {
2207
+ key: "enterXToYDigitsForExample",
2208
+ values: {
2209
+ minDigits: "8",
2210
+ maxDigits: "9",
2211
+ example: "12345678"
2212
+ }
2213
+ }
2214
+ },
2215
+ // Special case for SG in which we also save the registration number as the TaxID if that selection has been made
2216
+ [CountryCodes.Singapore]: {
2217
+ label: "gst",
2218
+ validators: mapValidators([validatePatternOnBlur(/^[A-Z0-9]{9,10}$/)], CountryCodes.Singapore),
2219
+ mask: {
2220
+ mask: makeMask(
2221
+ ...alphanumericInputs(2),
2222
+ ...nonInputs(" - "),
2223
+ ...alphanumericInputs(7),
2224
+ ...nonInputs(" - "),
2225
+ ...alphanumericInputs(1)
2226
+ ),
2227
+ transformOnType: uppercase
2228
+ },
2229
+ guidanceText: {
2230
+ key: "enterNCharactersForExample",
2231
+ values: {
2232
+ numChars: "10",
2233
+ example: "M212345678"
2234
+ }
2235
+ }
2236
+ },
2237
+ [CountryCodes.PuertoRico]: {
2238
+ // should exactly match CountryCodes.UnitedStates
2239
+ label: "taxInformationNumber__US",
2240
+ helperText: "taxInformationNumber__helperText__US",
2241
+ placeholder: "taxInformationNumber__placeHolder__US",
2242
+ validators: mapValidators([validatePatternOnBlur(/^\d{9}$/)], CountryCodes.PuertoRico),
2243
+ mask: {
2244
+ mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(7))
2245
+ },
2246
+ guidanceText: {
2247
+ key: "validationPleaseEnterAValidEINWithFormat",
2248
+ values: {
2249
+ format: "XX-XXXXXXX",
2250
+ example: "98-7654321"
2251
+ }
2252
+ }
2253
+ },
2254
+ [CountryCodes.UnitedKingdom]: ({ taxIdNumberType, companyType }) => {
2255
+ switch (companyType) {
2256
+ case LegalEntityTypes.INDIVIDUAL:
2257
+ switch (taxIdNumberType) {
2258
+ case "NINO":
2259
+ return {
2260
+ label: "nationalInsuranceNumber",
2261
+ placeholder: "taxInformationNumber__placeHolder__GB",
2262
+ validators: mapValidators(
2263
+ [validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-D]$/)],
2264
+ CountryCodes.UnitedKingdom
2265
+ ),
2266
+ guidanceText: {
2267
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2268
+ values: {
2269
+ example: "AA123456C",
2270
+ idType: "NINO"
2271
+ }
2272
+ }
2273
+ };
2274
+ default:
2275
+ return {
2276
+ label: "utr",
2277
+ placeholder: "taxInformationNumber__placeHolder__GB",
2278
+ validators: mapValidators(
2279
+ [validatePatternOnBlur(/^\d{10}$/)],
2280
+ CountryCodes.UnitedKingdom
2281
+ ),
2282
+ mask: { mask: makeMask(...numericInputs(10)) },
2283
+ guidanceText: {
2284
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2285
+ values: {
2286
+ example: "6669863459",
2287
+ idType: "UTR"
2288
+ }
2289
+ }
2290
+ };
2291
+ }
2292
+ default:
2293
+ return {
2294
+ label: "utr",
2295
+ placeholder: "taxInformationNumber__placeHolder__GB",
2296
+ validators: mapValidators(
2297
+ [validatePatternOnBlur(/^\d{10}$/)],
2298
+ CountryCodes.UnitedKingdom
2299
+ ),
2300
+ mask: { mask: makeMask(...numericInputs(10)) },
2301
+ guidanceText: {
2302
+ key: "validationPleaseEnterAValidIdNumberWithExample",
2303
+ values: {
2304
+ example: "6669863459",
2305
+ idType: "UTR"
2306
+ }
2307
+ }
2308
+ };
2309
+ }
2310
+ },
2311
+ [CountryCodes.UnitedStates]: {
2312
+ label: "taxInformationNumber__US",
2313
+ helperText: "taxInformationNumber__helperText__US",
2314
+ placeholder: "taxInformationNumber__placeHolder__US",
2315
+ validators: mapValidators(
2316
+ [validateNotEmptyOnBlur, validatePatternOnBlur(/^\d{9}$/)],
2317
+ CountryCodes.UnitedStates
2318
+ ),
2319
+ mask: {
2320
+ mask: makeMask(...numericInputs(2), ...nonInputs(" - "), ...numericInputs(7))
2321
+ },
2322
+ guidanceText: {
2323
+ key: "validationPleaseEnterAValidEINWithFormat",
2324
+ values: {
2325
+ format: "XX-XXXXXXX",
2326
+ example: "98-7654321"
2327
+ }
2328
+ }
2329
+ },
2330
+ /**
2331
+ * NOT YET SUPPORTED
2332
+ * These are brought over from the old pattern files. We have no idea if they are accurate or not.
2333
+ * See https://en.wikipedia.org/wiki/VAT_identification_number
2334
+ */
2335
+ [CountryCodes.India]: {
2336
+ validators: mapValidators([validatePatternOnBlur(/^[A-Z0-9]{15}$/)], CountryCodes.India)
2337
+ },
2338
+ [CountryCodes.Japan]: {
2339
+ label: "taxInformationNumber__JP",
2340
+ validators: mapValidators([validatePatternOnBlur(/^\d{13}$/)], CountryCodes.Japan)
2341
+ },
2342
+ [CountryCodes.Philippines]: {
2343
+ validators: mapValidators([validatePatternOnBlur(/^\d{12}$/)], CountryCodes.Philippines)
2344
+ }
2345
+ };
2346
+ const exemptedFromTaxDefaultFieldConfig = {
2347
+ [CountryCodes.Australia]: {
2348
+ label: "doNotHaveAbn"
2349
+ }
2350
+ };
2351
+ const countryToTaxInfoTypeMap = {
2352
+ US: "EIN",
2353
+ AU: "ABN",
2354
+ NZ: "IRD",
2355
+ HK: "BRN",
2356
+ SG: "GST"
2357
+ };
2358
+ const isFinancialInformationRequired = (isFinancialInformationExperimentEnabled, taskType, country, capabilities, legalEntityType) => {
2359
+ const isOrganization = legalEntityType === LegalEntityTypes.ORGANIZATION;
2360
+ if (!isFinancialInformationExperimentEnabled || !COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
2361
+ return void 0;
2362
+ }
2363
+ if (country === CountryCodes.UnitedKingdom && (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY || taskType === TaskTypes.BUSINESS_DETAILS)) {
2364
+ return "REQUIRED";
2365
+ }
2366
+ if (taskType === TaskTypes.BUSINESS_DETAILS && isOrganization) {
2367
+ if (keysOf(capabilities ?? {}).some((capability) => capability === "issueBankAccount")) {
2368
+ return "REQUIRED";
2369
+ }
2370
+ }
2371
+ return void 0;
2372
+ };
2373
+ function requestingIssuing(rootLegalEntity) {
2374
+ const capabilities = rootLegalEntity?.capabilities ?? {};
2375
+ return "issueCard" in capabilities && capabilities.issueCard?.requested === true || "issueCardConsumer" in capabilities && capabilities.issueCardConsumer?.requested === true || "issueCardCommercial" in capabilities && capabilities.issueCardCommercial?.requested === true || "useCard" in capabilities && capabilities.useCard?.requested === true || "useCardConsumer" in capabilities && capabilities.useCardConsumer?.requested === true || "useCardCommercial" in capabilities && capabilities.useCardCommercial?.requested === true;
2376
+ }
2377
+ function requestingBanking(rootLegalEntity) {
2378
+ const capabilities = rootLegalEntity?.capabilities ?? {};
2379
+ return "issueBankAccount" in capabilities && capabilities.issueBankAccount?.requested === true || "sendToThirdParty" in capabilities && capabilities.sendToThirdParty?.requested === true || "receiveFromThirdParty" in capabilities && capabilities.receiveFromThirdParty?.requested === true;
2380
+ }
2381
+ const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
2382
+ CountryCodes.Australia,
2383
+ CountryCodes.Gibraltar,
2384
+ CountryCodes.Guernsey,
2385
+ CountryCodes.HongKong,
2386
+ CountryCodes.Ireland,
2387
+ CountryCodes.IsleOfMan,
2388
+ CountryCodes.Jersey,
2389
+ CountryCodes.Malta,
2390
+ CountryCodes.PuertoRico,
2391
+ CountryCodes.Spain,
2392
+ CountryCodes.UnitedKingdom,
2393
+ CountryCodes.UnitedStates
2394
+ ];
2395
+ const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [
2396
+ CountryCodes.HongKong,
2397
+ CountryCodes.PuertoRico,
2398
+ CountryCodes.UnitedStates
2399
+ ];
2400
+ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS = [];
2401
+ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
2402
+ CountryCodes.Austria,
2403
+ CountryCodes.Canada,
2404
+ CountryCodes.Finland,
2405
+ CountryCodes.Germany,
2406
+ CountryCodes.Lithuania,
2407
+ CountryCodes.Luxembourg,
2408
+ CountryCodes.NewZealand,
2409
+ CountryCodes.Poland,
2410
+ CountryCodes.Sweden,
2411
+ CountryCodes.Switzerland
2412
+ ];
2413
+ const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [
2414
+ CountryCodes.Canada,
2415
+ CountryCodes.UnitedStates
2416
+ ];
2417
+ const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS = [
2418
+ CountryCodes.Germany
2419
+ ];
2420
+ const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
2421
+ CountryCodes.Australia,
2422
+ CountryCodes.Canada,
2423
+ CountryCodes.Gibraltar,
2424
+ CountryCodes.HongKong,
2425
+ CountryCodes.NewZealand,
2426
+ CountryCodes.PuertoRico,
2427
+ CountryCodes.Singapore,
2428
+ CountryCodes.UnitedStates,
2429
+ CountryCodes.Guernsey,
2430
+ CountryCodes.Jersey,
2431
+ CountryCodes.IsleOfMan,
2432
+ CountryCodes.Mexico,
2433
+ CountryCodes.Brazil,
2434
+ CountryCodes.Japan
2435
+ ];
2436
+ const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [
2437
+ CountryCodes.Singapore
2438
+ ];
2439
+ const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
2440
+ // strictly a subset of countries which use tax ID
2441
+ // right now in all countries companies must provide a tax ID - but maybe there will be exemptions in future?
2442
+ ];
2443
+ const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS = [
2444
+ // strictly a subset of countries which use tax ID
2445
+ CountryCodes.Canada,
2446
+ CountryCodes.PuertoRico,
2447
+ CountryCodes.UnitedStates
2448
+ ];
2449
+ const COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION = [
2450
+ CountryCodes.HongKong,
2451
+ CountryCodes.Singapore
2452
+ ];
2453
+ const COUNTRIES_THAT_USES_UEN_OR_GST = [CountryCodes.Singapore];
2454
+ const COUNTRIES_USING_COMPANY_SEARCH = [
2455
+ CountryCodes.UnitedStates
2456
+ ];
2457
+ const COUNTRY_OF_GOVERNING_LAW_POSSIBLE = [
2458
+ CountryCodes.UnitedKingdom
2459
+ ];
2460
+ const COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
2461
+ CountryCodes.UnitedKingdom,
2462
+ CountryCodes.Netherlands,
2463
+ CountryCodes.France,
2464
+ CountryCodes.Germany,
2465
+ CountryCodes.Spain,
2466
+ CountryCodes.Belgium
2467
+ ];
2468
+ const COUNTRIES_REQUIRING_E_INVOICING_CODE = [
2469
+ /**
2470
+ * @description These are the countries for which E-Invoicing code is a compliance requirement. There will be more in the future.
2471
+ */
2472
+ CountryCodes.Italy
2473
+ ];
2474
+ const COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4 = [
2475
+ CountryCodes.Australia
2476
+ ];
2477
+ const TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION = [
2478
+ CountryCodes.UnitedKingdom,
2479
+ CountryCodes.Netherlands,
2480
+ CountryCodes.Germany,
2481
+ CountryCodes.Belgium
2482
+ ];
2483
+ const isRegistrationNumberAbsentStateV4Scenario = (country, entityType) => {
2484
+ return country === CountryCodes.Australia && (entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || entityType === CompanyTypesValues.INCORPORATED_PARTNERSHIP) || country === CountryCodes.NewZealand;
2485
+ };
2486
+ const rules = ({
2487
+ data,
2488
+ country,
2489
+ taskType,
2490
+ isExperimentEnabled = () => false,
2491
+ isSettingEnabled = () => false,
2492
+ accountHolder,
2493
+ rootLegalEntity,
2494
+ tinMatched,
2495
+ version
2496
+ }) => {
2497
+ const countryRequiresDateOfIncorporationForCompanies = () => {
2498
+ if (COUNTRIES_THAT_REQUIRE_DATE_OF_INCORPORATION.includes(country)) {
2499
+ return "REQUIRED";
2500
+ }
2501
+ };
2502
+ const countryRequiresFinancialInformation = () => {
2503
+ if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
2504
+ const isFinancialInformationExperimentEnabled = isExperimentEnabled(
2505
+ "EnableFinancialInformationComponentV4"
2506
+ );
2507
+ const leType = rootLegalEntity?.type;
2508
+ return isFinancialInformationRequired(
2509
+ isFinancialInformationExperimentEnabled,
2510
+ taskType,
2511
+ country,
2512
+ rootLegalEntity?.capabilities,
2513
+ leType
2514
+ );
2515
+ }
2516
+ };
2517
+ return createFormRules({
2518
+ requireDoingBusinessAsName: () => {
2519
+ return data.additionalInformation?.hasDoingBusinessAs ? "REQUIRED" : void 0;
2520
+ },
2521
+ countryRequiresStateOrProvince: () => {
2522
+ if (COUNTRIES_WITH_STATES_DATASET.includes(country)) {
2523
+ return "REQUIRED";
2524
+ }
2525
+ },
2526
+ ifPubliclyTradedCompany: () => {
2527
+ if (data.companyStructure?.entityType === CompanyTypesValues.PUBLIC_COMPANY) {
2528
+ return "REQUIRED";
2529
+ }
2530
+ },
2531
+ countryUsesVat: () => {
2532
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2533
+ return Boolean(data.additionalInformation?.exemptedFromVat) === true ? "OPTIONAL" : "REQUIRED";
2534
+ }
2535
+ },
2536
+ vatNumberType: () => {
2537
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2538
+ return "OPTIONAL";
2539
+ }
2540
+ },
2541
+ isVatExempt: () => {
2542
+ if (!COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
2543
+ return Boolean(data.additionalInformation?.exemptedFromVat) === true ? "REQUIRED" : "OPTIONAL";
2544
+ }
2545
+ },
2546
+ countryUsesTaxId: () => {
2547
+ const isExemptFromTax = Boolean(
2548
+ data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax
2549
+ );
2550
+ if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && TAX_ID_REQUIRED_COUNTRIES_ORGANIZATION.includes(country) && rootLegalEntity?.type === "organization" && // SOE-5931 - TODO: investigate L scenario returned to show this on the backend
2551
+ keysOf(rootLegalEntity?.capabilities ?? {}).includes("issueBankAccount")) {
2552
+ return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
2553
+ }
2554
+ if (COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country) && !(taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY && COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP.includes(country))) {
2555
+ return isExemptFromTax ? "OPTIONAL" : "REQUIRED";
2556
+ }
2557
+ },
2558
+ companyRegistrationNumberExemptionAllowed: () => {
2559
+ const isExemptFromRegistrationNumber = Boolean(
2560
+ data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber
2561
+ );
2562
+ if (isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && isRegistrationNumberAbsentStateV4Scenario(country, data.companyStructure?.entityType)) {
2563
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2564
+ }
2565
+ switch (taskType) {
2566
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2567
+ if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS.includes(country))
2568
+ return;
2569
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2570
+ }
2571
+ default: {
2572
+ switch (country) {
2573
+ case CountryCodes.Germany: {
2574
+ if (data.companyStructure?.entityType === CompanyTypesValues.GOVERNMENTAL_ORGANIZATION || data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) {
2575
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2576
+ }
2577
+ return;
2578
+ }
2579
+ case CountryCodes.Denmark: {
2580
+ if (data.companyStructure?.entityType === CompanyTypesValues.NON_PROFIT_OR_CHARITABLE) {
2581
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2582
+ }
2583
+ return;
2584
+ }
2585
+ default: {
2586
+ if (!COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_ORGANIZATIONS.includes(country))
2587
+ return;
2588
+ return isExemptFromRegistrationNumber ? "REQUIRED" : "OPTIONAL";
2589
+ }
2590
+ }
2591
+ }
2592
+ }
2593
+ },
2594
+ countryOfGoverningLawRequired: () => {
2595
+ if (isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies") && COUNTRY_OF_GOVERNING_LAW_POSSIBLE.includes(data.basicInformation?.country)) {
2596
+ return "REQUIRED";
2597
+ }
2598
+ },
2599
+ countryRequiresRegistrationNumber: () => {
2600
+ const isExemptFromRegistrationNumber = Boolean(
2601
+ data.basicInformation?.exemptedFromRegistrationNumber ?? data.additionalInformation?.exemptedFromRegistrationNumber
2602
+ );
2603
+ switch (taskType) {
2604
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2605
+ if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2606
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER_SOLE_PROPS.includes(country)) {
2607
+ return "OPTIONAL";
2608
+ }
2609
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2610
+ }
2611
+ default: {
2612
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
2613
+ return "OPTIONAL";
2614
+ }
2615
+ if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) {
2616
+ return isExemptFromRegistrationNumber ? "OPTIONAL" : "REQUIRED";
2617
+ }
2618
+ }
2619
+ }
2620
+ },
2621
+ registrationNumberType: () => {
2622
+ switch (taskType) {
2623
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2624
+ if (COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country)) return;
2625
+ return "OPTIONAL";
2626
+ }
2627
+ default: {
2628
+ if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
2629
+ return "OPTIONAL";
2630
+ }
2631
+ if (COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) return;
2632
+ return "OPTIONAL";
2633
+ }
2634
+ }
2635
+ },
2636
+ countryUsesUenOrGst: () => {
2637
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2638
+ return;
2639
+ }
2640
+ if (COUNTRIES_THAT_USES_UEN_OR_GST.includes(country)) {
2641
+ return "REQUIRED";
2642
+ }
2643
+ },
2644
+ countryHasTaxExemptions: () => {
2645
+ const isExemptFromTax = Boolean(
2646
+ data.basicInformation?.exemptedFromTax ?? data.additionalInformation?.exemptedFromTax
2647
+ );
2648
+ switch (taskType) {
2649
+ case TaskTypes.SOLE_PROPRIETOR_COMPANY: {
2650
+ if (!COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_SOLE_PROPS.includes(country)) return;
2651
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2652
+ }
2653
+ default: {
2654
+ if (isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust") {
2655
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2656
+ }
2657
+ if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) {
2658
+ return isExemptFromTax ? "REQUIRED" : "OPTIONAL";
2659
+ }
2660
+ }
2661
+ }
2662
+ },
2663
+ // TODO: This should be renamed due to the additional conditionals
2664
+ countryUsingCompanySearch: () => {
2665
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY || taskType === TaskTypes.TRUST_MEMBER_COMPANY || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY) {
2666
+ return;
2667
+ }
2668
+ if (COUNTRIES_USING_COMPANY_SEARCH.includes(country)) {
2669
+ return "REQUIRED";
2670
+ }
2671
+ },
2672
+ countryRequiresFinancialInformation,
2673
+ isDateOfIncorporationRequired: () => {
2674
+ if (isExperimentEnabled("EnableIncorporationDateBasedFinancialValidationForHO")) {
2675
+ return countryRequiresDateOfIncorporationForCompanies() || countryRequiresFinancialInformation();
2676
+ }
2677
+ return countryRequiresDateOfIncorporationForCompanies();
2678
+ },
2679
+ isFinancialReportingFieldsRequired: () => {
2680
+ if (isExperimentEnabled("EnableIncorporationDateBasedFinancialValidationForHO")) {
2681
+ return countryRequiresFinancialInformation() === "REQUIRED" && isDateOlderThanAYear(data.additionalInformation?.dateOfIncorporation) ? "REQUIRED" : void 0;
2682
+ }
2683
+ return countryRequiresFinancialInformation();
2684
+ },
2685
+ isIndustryCodeRequired: () => {
2686
+ const needsBusinessLine = requestingIssuing(rootLegalEntity) || requestingBanking(rootLegalEntity);
2687
+ if (isSettingEnabled(SettingNames.AllowBusinessLines) && needsBusinessLine) {
2688
+ return "REQUIRED";
2689
+ }
2690
+ },
2691
+ annualTurnoverRequired: () => {
2692
+ if (data.companyFinancialInformation?.reportedValueOption === "annualTurnover") {
2693
+ return "REQUIRED";
2694
+ }
2695
+ },
2696
+ netAssetsRequired: () => {
2697
+ if (data.companyFinancialInformation?.reportedValueOption === "netAssets") {
2698
+ return "REQUIRED";
2699
+ }
2700
+ },
2701
+ balanceSheetTotalRequired: () => {
2702
+ if (data.companyFinancialInformation?.reportedValueOption === "balanceSheetTotal") {
2703
+ return "REQUIRED";
2704
+ }
2705
+ },
2706
+ isEInvoicingCodeEnabled: () => {
2707
+ if (isExperimentEnabled("EnableEInvoicingCodeField") && COUNTRIES_REQUIRING_E_INVOICING_CODE.includes(country)) {
2708
+ return "REQUIRED";
2709
+ }
2710
+ },
2711
+ ifCountryUsAndTinFailed: () => {
2712
+ if (taskType === TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2713
+ return;
2714
+ }
2715
+ if (tinMatched === false && country === CountryCodes.UnitedStates) {
2716
+ return "REQUIRED";
2717
+ }
2718
+ },
2719
+ businessRequiresCompanyType: () => {
2720
+ if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY) {
2721
+ return "REQUIRED";
2722
+ }
2723
+ },
2724
+ japaneseLegalCompanyName: () => {
2725
+ if (isCompatibleJapanVersion(country, version)) {
2726
+ return "REQUIRED";
2727
+ }
2728
+ },
2729
+ requireBusinessSelection: () => {
2730
+ if (taskType !== TaskTypes.SOLE_PROPRIETOR_COMPANY && taskType !== TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY && taskType !== TaskTypes.TRUST_MEMBER_COMPANY && COUNTRIES_USING_COMPANY_SEARCH.includes(country)) {
2731
+ return "REQUIRED";
2732
+ }
2733
+ }
2734
+ });
2735
+ };
2736
+ const inferTaxIdNumberType = (taxInformation, country, companyType) => {
2737
+ if (!taxInformation) return void 0;
2738
+ const optionsForCountry = getTaxIdNumberOptions(country, companyType);
2739
+ const metadataFn = taxInformationDefaultFieldConfig[country];
2740
+ if (!optionsForCountry || !metadataFn) return void 0;
2741
+ if (optionsForCountry.length === 1) return optionsForCountry[0].id;
2742
+ const allMetaData = optionsForCountry.reduce(
2743
+ (acc, option) => {
2744
+ const meta = typeof metadataFn === "function" ? metadataFn({
2745
+ taxIdNumberType: option.id,
2746
+ companyType
2747
+ }) : metadataFn;
2748
+ if (meta.label && !acc[meta.label]) {
2749
+ acc[meta.label] = meta;
2750
+ }
2751
+ return acc;
2752
+ },
2753
+ {}
2754
+ );
2755
+ for (const option of optionsForCountry) {
2756
+ const fieldMetadata = allMetaData[option.name];
2757
+ if (!fieldMetadata?.validators) continue;
2758
+ const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
2759
+ if (validators.every((validator) => validator.validate(taxInformation))) {
2760
+ return option.id;
2761
+ }
2762
+ }
2763
+ };
2764
+ function findExistingTaxInformation(taxInformation, country) {
2765
+ return taxInformation?.find((taxId) => taxId.country === country);
2766
+ }
2767
+ function getDefaultTaxIdNumberType(taxInformation, country, entityType) {
2768
+ const existingTaxInformation = findExistingTaxInformation(taxInformation, country);
2769
+ return (
2770
+ // First check if we already have a type set
2771
+ existingTaxInformation?.type ?? (existingTaxInformation?.number ? (
2772
+ // If we have a number but no type, try to infer it
2773
+ inferTaxIdNumberType(taxInformation, country, entityType)
2774
+ ) : (
2775
+ // Otherwise use the first available tax ID option for this country and entity type
2776
+ getTaxIdNumberOptions(country, entityType)?.[0]?.id
2777
+ ))
2778
+ );
2779
+ }
2780
+ function TaxIdNumberTypeSelector({
2781
+ country,
2782
+ companyType,
2783
+ selected,
2784
+ setSelected,
2785
+ exemptedOption,
2786
+ isUsSoleProp,
2787
+ errorMessage
2788
+ }) {
2789
+ const { t } = useTranslation("common");
2790
+ const handleSelect = useCallback(
2791
+ (selectedStr) => {
2792
+ const newSelected = selectedStr;
2793
+ if (newSelected === "exempted") {
2794
+ if (exemptedOption) {
2795
+ setSelected(newSelected);
2796
+ }
2797
+ return;
2798
+ }
2799
+ setSelected(newSelected);
2800
+ },
2801
+ [exemptedOption, setSelected]
2802
+ );
2803
+ const options = useMemo(() => {
2804
+ const availableOptions = getTaxIdNumberOptions(country, companyType) ?? [];
2805
+ if (availableOptions.length === 0 || !exemptedOption) return availableOptions;
2806
+ return [
2807
+ ...availableOptions,
2808
+ {
2809
+ id: "exempted",
2810
+ name: exemptedOption
2811
+ }
2812
+ ];
2813
+ }, [country, companyType, exemptedOption]);
2814
+ useEffect(() => {
2815
+ if (!isUsSoleProp && !selected && options.length > 0) {
2816
+ handleSelect(options[0].id);
2817
+ }
2818
+ }, [options, selected, handleSelect, isUsSoleProp]);
2819
+ if (options.length <= 1) return null;
2820
+ return /* @__PURE__ */ jsx(
2821
+ Field,
2822
+ {
2823
+ el: "fieldset",
2824
+ name: "taxIdNumberType",
2825
+ label: t(($) => $["whichTaxpayerIdentificationNumberDoYouUse"]),
2826
+ errorMessage: !!errorMessage,
2827
+ children: (childProps) => /* @__PURE__ */ jsx(
2828
+ RadioGroup,
2829
+ {
2830
+ ...childProps,
2831
+ name: "taxIdNumberType",
2832
+ items: options,
2833
+ value: selected,
2834
+ onChange: handleSelect
2835
+ }
2836
+ )
2837
+ }
2838
+ );
2839
+ }
2840
+ const TAX_INFORMATION_FIELD = [
2841
+ "taxInformation",
2842
+ "exemptedFromTax",
2843
+ "isUen"
2844
+ ];
2845
+ function TaxInformationField({
2846
+ data,
2847
+ valid,
2848
+ errors,
2849
+ labels,
2850
+ mask,
2851
+ guidanceText,
2852
+ placeholders,
2853
+ readonly,
2854
+ optional,
2855
+ shouldValidate,
2856
+ handleChangeFor,
2857
+ country,
2858
+ canExempt,
2859
+ registrationNumber,
2860
+ entityType,
2861
+ defaultData
2862
+ }) {
2863
+ const { isExperimentEnabled } = useExperimentsContext();
2864
+ const { t } = useTranslation("common");
2865
+ const { accountHolder } = useAccountHolder();
2866
+ const currentCountryTaxInformation = useMemo(
2867
+ () => data?.taxInformation?.find((taxInfo) => taxInfo.country === country) ?? (!data.exemptedFromTax ? defaultData?.find((taxInfo) => taxInfo.country === country) : void 0),
2868
+ [data?.taxInformation, data.exemptedFromTax, defaultData, country]
2869
+ );
2870
+ const isUsSoleProp = country === "US" && entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP;
2871
+ const exemptionLabel = isUsSoleProp ? t(($) => $["socialSecurityNumber"]) : labels.exemptedFromTax;
2872
+ const shouldRenderInput = isUsSoleProp ? currentCountryTaxInformation?.type === "EIN" : !data.isUen;
2873
+ const options = getTaxIdNumberOptions(country, entityType);
2874
+ const showTaxIdExemptedOptions = canExempt && (options?.length ?? 0) > 1 || isUsSoleProp;
2875
+ const canSaveAbsentState = isExperimentEnabled("EnableRegistrationAndTaxAbsentStatesV4") && COUNTRIES_WITH_POSSIBLE_TRUSTEE_TAXID_ABSENT_V4.includes(country) && accountHolder === "aTrust";
2876
+ const taxIdNumberType = useMemo(() => {
2877
+ if (isUsSoleProp) {
2878
+ return data.exemptedFromTax ? "exempted" : currentCountryTaxInformation?.type ? currentCountryTaxInformation?.type : void 0;
2879
+ }
2880
+ return data.exemptedFromTax ? "exempted" : currentCountryTaxInformation?.type ? currentCountryTaxInformation?.type : getDefaultTaxIdNumberType(data.taxInformation, country, entityType);
2881
+ }, [
2882
+ country,
2883
+ currentCountryTaxInformation?.type,
2884
+ data.exemptedFromTax,
2885
+ data.taxInformation,
2886
+ entityType,
2887
+ isUsSoleProp
2888
+ ]);
2889
+ const handleTaxInformationChange = (e, key, mode, resetToDefault) => {
2890
+ const value = e ? typeof e === "string" ? e : e.currentTarget.value : void 0;
2891
+ if (resetToDefault) {
2892
+ return handleChangeFor("taxInformation", mode)(defaultData);
2893
+ }
2894
+ switch (key) {
2895
+ case "number": {
2896
+ const newTaxInformation = canSaveAbsentState ? {
2897
+ country,
2898
+ number: value,
2899
+ type: currentCountryTaxInformation?.type ?? taxIdNumberType,
2900
+ numberAbsent: false
2901
+ } : {
2902
+ country,
2903
+ number: value,
2904
+ type: currentCountryTaxInformation?.type ?? taxIdNumberType
2905
+ };
2906
+ if (!data.taxInformation) {
2907
+ return handleChangeFor("taxInformation", mode)([newTaxInformation]);
2908
+ }
2909
+ const taxInformation = currentCountryTaxInformation ? data.taxInformation : [...data.taxInformation, newTaxInformation];
2910
+ const updatedTaxInformation = taxInformation.map((taxInfo) => {
2911
+ if (taxInfo.country !== country) return taxInfo;
2912
+ return newTaxInformation;
2913
+ });
2914
+ return handleChangeFor("taxInformation", mode)(updatedTaxInformation);
2915
+ }
2916
+ case "type": {
2917
+ const newTaxInformation = canSaveAbsentState ? {
2918
+ country,
2919
+ number: currentCountryTaxInformation?.number,
2920
+ type: value,
2921
+ numberAbsent: false
2922
+ } : {
2923
+ country,
2924
+ number: currentCountryTaxInformation?.number,
2925
+ type: value
2926
+ };
2927
+ if (!data.taxInformation) {
2928
+ return handleChangeFor("taxInformation", mode)([newTaxInformation]);
2929
+ }
2930
+ const taxInformation = currentCountryTaxInformation ? data.taxInformation : [...data.taxInformation, newTaxInformation];
2931
+ const updatedTaxInformation = taxInformation.map((taxInfo) => {
2932
+ if (taxInfo.country !== country) return taxInfo;
2933
+ return newTaxInformation;
2934
+ });
2935
+ return handleChangeFor("taxInformation", mode)(updatedTaxInformation);
2936
+ }
2937
+ }
2938
+ };
2939
+ useEffect(() => {
2940
+ if (!country) return;
2941
+ const hasSavedTaxId = defaultData?.find((taxId) => taxId.country === country);
2942
+ if (currentCountryTaxInformation?.country === country) return;
2943
+ if (currentCountryTaxInformation && !hasSavedTaxId) return;
2944
+ if (entityType === CompanyTypesValues.SOLE_PROPRIETORSHIP) return;
2945
+ handleChangeFor("taxInformation", "input")(defaultData);
2946
+ const newCountryOptions = getTaxIdNumberOptions(country, entityType);
2947
+ if (newCountryOptions && newCountryOptions.length > 0) {
2948
+ handleTaxInformationChange(newCountryOptions[0].id, "type", "input", true);
2949
+ } else {
2950
+ handleTaxInformationChange(void 0, "type", "input", true);
2951
+ }
2952
+ }, [country]);
2953
+ const removeCurrentCountryTaxInformation = () => {
2954
+ const filterdTaxInformation = data.taxInformation?.filter((taxId) => taxId.country !== country);
2955
+ handleChangeFor("taxInformation", "input")(filterdTaxInformation);
2956
+ };
2957
+ const setUenAsTaxId = (uen) => {
2958
+ if (!data.taxInformation) {
2959
+ return handleChangeFor(
2960
+ "taxInformation",
2961
+ "blur"
2962
+ )([
2963
+ {
2964
+ country,
2965
+ number: uen ?? "",
2966
+ type: "UEN"
2967
+ }
2968
+ ]);
2969
+ }
2970
+ const taxInformation = currentCountryTaxInformation ? data.taxInformation : [
2971
+ ...data.taxInformation,
2972
+ {
2973
+ country,
2974
+ number: uen ?? "",
2975
+ type: "UEN"
2976
+ }
2977
+ ];
2978
+ const updatedTaxInformation = taxInformation.map((taxInfo) => {
2979
+ if (taxInfo.country !== country) return taxInfo;
2980
+ return {
2981
+ country,
2982
+ number: uen ?? "",
2983
+ type: "UEN"
2984
+ };
2985
+ });
2986
+ return handleChangeFor("taxInformation", "blur")(updatedTaxInformation);
2987
+ };
2988
+ useEffect(() => {
2989
+ if (country === "SG" && data.isUen && registrationNumber && registrationNumber !== currentCountryTaxInformation?.number) {
2990
+ setUenAsTaxId(registrationNumber);
2991
+ }
2992
+ }, [
2993
+ registrationNumber,
2994
+ currentCountryTaxInformation?.number,
2995
+ data.isUen,
2996
+ country,
2997
+ setUenAsTaxId
2998
+ ]);
2999
+ const addTaxAbsentStatus = (exempted) => {
3000
+ if (!data.taxInformation) {
3001
+ const updatedTaxInformation2 = [
3002
+ {
3003
+ country,
3004
+ numberAbsent: exempted
3005
+ }
3006
+ ];
3007
+ return handleChangeFor("taxInformation", "input")(updatedTaxInformation2);
3008
+ }
3009
+ const taxInformation = currentCountryTaxInformation ? data.taxInformation : [
3010
+ ...data.taxInformation,
3011
+ {
3012
+ country,
3013
+ numberAbsent: exempted
3014
+ }
3015
+ ];
3016
+ const updatedTaxInformation = taxInformation.map((taxInfo) => {
3017
+ if (taxInfo.country !== country) return taxInfo;
3018
+ return {
3019
+ country,
3020
+ numberAbsent: exempted
3021
+ };
3022
+ });
3023
+ return handleChangeFor("taxInformation", "input")(updatedTaxInformation);
3024
+ };
3025
+ const handleTaxIdNumberTypeChange = (taxIdType) => {
3026
+ if (!canExempt && taxIdType === "exempted") {
3027
+ throw Error(`${country} does not allow tax exemptions`);
3028
+ }
3029
+ switch (taxIdType) {
3030
+ case "exempted":
3031
+ handleChangeFor("exemptedFromTax")(true);
3032
+ handleTaxInformationChange(void 0, "type", "input");
3033
+ return canSaveAbsentState ? addTaxAbsentStatus(true) : removeCurrentCountryTaxInformation();
3034
+ default:
3035
+ handleChangeFor("exemptedFromTax")(false);
3036
+ }
3037
+ if (country === "SG") {
3038
+ if (taxIdType === "UEN") {
3039
+ handleChangeFor("isUen")(true);
3040
+ setUenAsTaxId(registrationNumber);
3041
+ } else {
3042
+ handleChangeFor("isUen")(false);
3043
+ removeCurrentCountryTaxInformation();
3044
+ }
3045
+ }
3046
+ handleTaxInformationChange(taxIdType, "type", "input");
3047
+ };
3048
+ const handleExemptedFromTaxChange = (exempted) => {
3049
+ if (canSaveAbsentState) {
3050
+ addTaxAbsentStatus(exempted);
3051
+ handleChangeFor("exemptedFromTax")(exempted);
3052
+ } else {
3053
+ handleChangeFor("exemptedFromTax")(exempted);
3054
+ removeCurrentCountryTaxInformation();
3055
+ }
3056
+ };
3057
+ return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-field__tax-information", children: [
3058
+ /* @__PURE__ */ jsx(
3059
+ TaxIdNumberTypeSelector,
3060
+ {
3061
+ country,
3062
+ companyType: entityType,
3063
+ setSelected: handleTaxIdNumberTypeChange,
3064
+ selected: taxIdNumberType,
3065
+ exemptedOption: showTaxIdExemptedOptions ? exemptionLabel : false,
3066
+ isUsSoleProp,
3067
+ errorMessage: isUsSoleProp ? errors.taxInformation : false
3068
+ }
3069
+ ),
3070
+ shouldRenderInput && /* @__PURE__ */ jsx(
3071
+ MaskedInput,
3072
+ {
3073
+ type: "text",
3074
+ "aria-required": true,
3075
+ "aria-invalid": !valid.taxInformation,
3076
+ name: "taxInformation",
3077
+ label: labels.taxInformation ?? "",
3078
+ formatGuidance: guidanceText?.taxInformation ?? "",
3079
+ value: currentCountryTaxInformation?.number ?? "",
3080
+ errorMessage: errors.taxInformation,
3081
+ placeholder: placeholders?.taxInformation,
3082
+ isValid: Boolean(valid.taxInformation) && !!currentCountryTaxInformation,
3083
+ onInput: (e) => handleTaxInformationChange(e, "number", "input"),
3084
+ onBlur: (e) => handleTaxInformationChange(e, "number", "blur"),
3085
+ disabled: data.exemptedFromTax || data.isUen,
3086
+ readonly,
3087
+ optional,
3088
+ shouldValidate,
3089
+ ...mask
3090
+ }
3091
+ ),
3092
+ canExempt && !showTaxIdExemptedOptions && /* @__PURE__ */ jsx(Field, { name: "exemptedFromTax", children: (childProps) => /* @__PURE__ */ jsx(
3093
+ Checkbox,
3094
+ {
3095
+ ...childProps,
3096
+ "aria-required": false,
3097
+ "aria-invalid": false,
3098
+ name: "exemptedFromTax",
3099
+ label: labels.exemptedFromTax,
3100
+ value: "exemptedFromTax",
3101
+ checked: Boolean(data.exemptedFromTax),
3102
+ onChange: handleExemptedFromTaxChange
3103
+ }
3104
+ ) })
3105
+ ] });
3106
+ }
3107
+ export {
3108
+ COUNTRY_OF_GOVERNING_LAW_POSSIBLE as C,
3109
+ MemoizedDocumentUpload as M,
3110
+ StateCodesUS as S,
3111
+ TaxInformationField as T,
3112
+ additionallIdNumberOptions as a,
3113
+ taxInformationDefaultFieldConfig as b,
3114
+ TAX_INFORMATION_FIELD as c,
3115
+ requestingIssuing as d,
3116
+ COUNTRIES_USING_COMPANY_SEARCH as e,
3117
+ isRegistrationNumberAbsentStateV4Scenario as f,
3118
+ getFieldsWithExistingData as g,
3119
+ COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT as h,
3120
+ individualIdNumberOptions as i,
3121
+ getCompanyRegistrationNumberOptions as j,
3122
+ countryToTaxInfoTypeMap as k,
3123
+ rules as l,
3124
+ businessRegistrationNumberMasks as m,
3125
+ businessRegistrationNumberPatterns as n,
3126
+ getVatNumberOptions as o,
3127
+ exemptedFromTaxDefaultFieldMetadata as p,
3128
+ exemptedFromTaxDefaultFieldConfig as q,
3129
+ requestingBanking as r,
3130
+ stateFormatGuidanceText as s,
3131
+ taxInformationDefaultFieldMetadata as t,
3132
+ useCapabilities as u,
3133
+ vatNumberOptions as v
3134
+ };