@adyen/kyc-components 4.0.0-beta.0 → 4.0.0-beta.3

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 (749) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-Dh7RSJoE.js → AcceptTermsOfServiceComponent-i222mdxX.js} +54 -59
  2. package/dist/{AccountSetupRejected-PdYyKwbS.js → AccountSetupRejected-DHph9lFl.js} +6 -6
  3. package/dist/{Avatar-C8aZB2wq.js → Avatar-vCjWXfC7.js} +2 -2
  4. package/dist/{BusinessDetailsDropin-DC8FEWvP.js → BusinessDetailsDropin-DQcfiSR8.js} +408 -393
  5. package/dist/{BusinessFinancingComponent-B0vW7r62.js → BusinessFinancingComponent-DC3jzBrq.js} +3 -3
  6. package/dist/{BusinessFinancingDropin-D8HAwTSq.js → BusinessFinancingDropin-D2lMEbNh.js} +529 -701
  7. package/dist/{BusinessFinancingPage-L1APYvzn.js → BusinessFinancingPage-BPD2cSDR.js} +3 -3
  8. package/dist/{BusinessTypeSelectionPage-sfGqHnp6.js → BusinessTypeSelectionPage-Cdp8joPJ.js} +86 -91
  9. package/dist/{CZ-BhoS6sd6.js → CZ-BiPeoA9G.js} +11 -1
  10. package/dist/ContractViewer-B0bZ14Ts.js +947 -0
  11. package/dist/{CreateIndividualComponent-i-QNCzp0.js → CreateIndividualComponent-D9wnexv4.js} +7 -8
  12. package/dist/{CreateTransferInstrumentComponent-8n3tjBYK.js → CreateTransferInstrumentComponent-COzPdQjC.js} +4 -5
  13. package/dist/{CustomerSupport-BER6nSK2.js → CustomerSupport-NGBoBg3N.js} +27 -33
  14. package/dist/{DebugModal-DeSsKkh_.js → DebugModal-I2U6TjGT.js} +43 -69
  15. package/dist/{DecisionMakerDetailsPage-DgjlfKyP.js → DecisionMakerDetailsPage-BN-H1sJF.js} +3 -4
  16. package/dist/{DecisionMakers-D2TjKnOc.js → DecisionMakers-CZ5-IRtU.js} +128 -25
  17. package/dist/{ES-JRIf-4xI.js → ES-BlWV7xvh.js} +4 -6
  18. package/dist/{EmbeddedStatus-Bn5KNA0V.js → EmbeddedStatus-Blr0seRl.js} +13 -5
  19. package/dist/FormEndState-JB6QFSet.js +59 -0
  20. package/dist/{FormFlow-CZgc09E3.js → FormFlow-DjvdNEiV.js} +18 -22
  21. package/dist/{HU-v3vOxRm8.js → HU-D8vJYkDH.js} +10 -1
  22. package/dist/{IndividualOnfidoDropin-D6uwo7VI.js → IndividualOnfidoDropin-DHhyO2ai.js} +1364 -867
  23. package/dist/{Introduction-DW2IQ57R.js → Introduction-erRXgreE.js} +32 -35
  24. package/dist/LandingLayout-B45lEjOv.js +84 -0
  25. package/dist/{LegalRepresentativeDetailsPage-BfIDXqv1.js → LegalRepresentativeDetailsPage-rS5K4657.js} +3 -4
  26. package/dist/{ManageIndividualComponent-DJoEsE2m.js → ManageIndividualComponent-BEzE5lkX.js} +8 -12
  27. package/dist/{ManagePCIComponent-BGESFWL6.js → ManagePCIComponent-BgdGfAuT.js} +5 -5
  28. package/dist/{ManageTermsOfServiceComponent-_wTZrjqd.js → ManageTermsOfServiceComponent-BWkwy6YC.js} +7 -8
  29. package/dist/{ManageTransferInstrumentComponent-Cvc3kk94.js → ManageTransferInstrumentComponent-B8kRNftW.js} +21 -34
  30. package/dist/{OnboardingDropinComponent-CocnpjvA.js → OnboardingDropinComponent-DBW5N3Dr.js} +325 -364
  31. package/dist/{ProviderButton-vD5DUJaN.js → ProviderButton-B58n0cRC.js} +13 -24
  32. package/dist/{Review-BFgzcIDj.js → Review-O6Al47Cu.js} +11 -12
  33. package/dist/{RootBusinessDetailsPage-C6lHQShI.js → RootBusinessDetailsPage-q_6wAcer.js} +3 -4
  34. package/dist/{RootIndividualDetailsPage-DfpqHdAS.js → RootIndividualDetailsPage-CiXgSJsV.js} +3 -4
  35. package/dist/{SignPCIComponent-D35913wJ.js → SignPCIComponent-cqRNhGdl.js} +17 -23
  36. package/dist/{SingpassSelection-D2Xe1wGv.js → SingpassSelection-BWEJ3Yi-.js} +6 -9
  37. package/dist/{SoleProprietorshipPage-D2F8Ghmo.js → SoleProprietorshipPage-CRcJSpn9.js} +4 -5
  38. package/dist/{SourceOfFundsPage-RjAcZ3Bo.js → SourceOfFundsPage-BxLGXTHb.js} +533 -517
  39. package/dist/{StoreProvider-COHi02bX.js → StoreProvider-ClKLaHzy.js} +23640 -25317
  40. package/dist/{TaskItemStatus-Bi1L8gea.js → TaskItemStatus-DrTIwCTx.js} +14 -14
  41. package/dist/TaskStatusIndicator-CTtKjo0m.js +69 -0
  42. package/dist/{TaxReportingDropin-BLXgRbuR.js → TaxReportingDropin-DFZ2ehfk.js} +82 -102
  43. package/dist/{TileGroup-B1IymoWv.js → TileGroup-BtE472I1.js} +6 -8
  44. package/dist/{TrustDetailsPage-DVvGJ_Ta.js → TrustDetailsPage-CGiiTbfR.js} +93 -114
  45. package/dist/{TrustMemberCompanyPage-D0wTEhuh.js → TrustMemberCompanyPage-oLNhg0hg.js} +4 -5
  46. package/dist/{TrustMemberIndividualPage-BLuaBi3j.js → TrustMemberIndividualPage-Bgsis586.js} +3 -4
  47. package/dist/{UnincorporatedPartnershipIndividualPage-BhIihH2v.js → UnincorporatedPartnershipIndividualPage-DPE3grqL.js} +3 -4
  48. package/dist/{UnincorporatedPartnershipMemberCompanyPage-CgujXwfX.js → UnincorporatedPartnershipMemberCompanyPage-HUnc9g0g.js} +3 -4
  49. package/dist/{VerificationErrorAlert-BkImnGA-.js → VerificationErrorAlert-BBdJmGJu.js} +10 -8
  50. package/dist/{ViewVerificationStatusComponent-CRefu327.js → ViewVerificationStatusComponent-DDtXG_pM.js} +12 -13
  51. package/dist/adyen-business-financing.js +22 -29
  52. package/dist/adyen-individual.js +21 -22
  53. package/dist/adyen-kyc-components.js +137 -122
  54. package/dist/adyen-manage-individual.js +18 -21
  55. package/dist/adyen-manage-pci.js +18 -21
  56. package/dist/adyen-manage-terms-of-service.js +18 -21
  57. package/dist/adyen-manage-transfer-instruments.js +27 -30
  58. package/dist/adyen-onboarding.js +25 -22
  59. package/dist/adyen-sign-pci.js +22 -32
  60. package/dist/adyen-terms-of-service.js +32 -29
  61. package/dist/adyen-transfer-instrument.js +32 -31
  62. package/dist/{adyen-transfer-instrument.vue_vue_type_script_lang-BE-ro1iH.js → adyen-transfer-instrument.vue_vue_type_script_lang-DQBzahGy.js} +5 -1
  63. package/dist/adyen-verification-status.js +30 -33
  64. package/dist/bg-BG-BY3Wa361.js +54 -0
  65. package/dist/bg-BG-BvSUDgGF.js +13 -0
  66. package/dist/bg-BG-HpLj_LOM.js +16 -0
  67. package/dist/cs-CZ-BEFeaKsV.js +54 -0
  68. package/dist/cs-CZ-CQ_M3lEp.js +16 -0
  69. package/dist/cs-CZ-y4mvq4Lv.js +13 -0
  70. package/dist/{css-DZNXkIaY.js → css-BJGWcW8A.js} +2 -2
  71. package/dist/da-DK-D6UK8XT9.js +54 -0
  72. package/dist/da-DK-k4JW3iVF.js +16 -0
  73. package/dist/da-DK-qgQOVjDp.js +13 -0
  74. package/dist/de-DE-B3nctkG8.js +13 -0
  75. package/dist/de-DE-C7mjtS5w.js +16 -0
  76. package/dist/de-DE-DUl6gRKv.js +54 -0
  77. package/dist/de-DE-pSdsxBpQ.js +13 -0
  78. package/dist/decision-makers-group-CgddXgrx.js +1944 -0
  79. package/dist/el-GR-B5j7VZ3E.js +54 -0
  80. package/dist/el-GR-Bvjk5Sw8.js +13 -0
  81. package/dist/el-GR-CEQrkYHW.js +16 -0
  82. package/dist/el-GR-CdgLZhuO.js +13 -0
  83. package/dist/en-US-Bq2Twy6x.js +54 -0
  84. package/dist/en-US-DDagIr01.js +16 -0
  85. package/dist/en-US-DSoLr6rp.js +13 -0
  86. package/dist/es-ES-BRfK6tX7.js +13 -0
  87. package/dist/es-ES-Cavm0szq.js +54 -0
  88. package/dist/es-ES-DB1c74Kv.js +16 -0
  89. package/dist/es-ES-Dy1uR2H_.js +13 -0
  90. package/dist/et-EE-DUWZ2Vqm.js +54 -0
  91. package/dist/et-EE-d9V24rcf.js +13 -0
  92. package/dist/et-EE-xIegUSuv.js +16 -0
  93. package/dist/fi-FI-B0fnAFV2.js +13 -0
  94. package/dist/fi-FI-DVa-ccaW.js +54 -0
  95. package/dist/fi-FI-NCxneAqU.js +16 -0
  96. package/dist/fr-FR-BoKzVp2q.js +13 -0
  97. package/dist/fr-FR-CY9emHgF.js +54 -0
  98. package/dist/fr-FR-Dk6Lw2On.js +13 -0
  99. package/dist/fr-FR-daiUnUwo.js +16 -0
  100. package/dist/{getFieldsWithExistingData-UNUNInq5.js → getFieldsWithExistingData-BY--eXBQ.js} +3 -4
  101. package/dist/{hasDataChanged-CIg-bPSm.js → hasDataChanged-CwfuS4et.js} +4 -4
  102. package/dist/hr-HR-BAUywqDj.js +16 -0
  103. package/dist/hr-HR-CF0AHQzi.js +13 -0
  104. package/dist/hr-HR-CnP5sqih.js +54 -0
  105. package/dist/hu-HU-3GQojIHR.js +16 -0
  106. package/dist/hu-HU-BTlpbCpc.js +54 -0
  107. package/dist/hu-HU-CSPhOvLC.js +13 -0
  108. package/dist/it-IT-BH-eqIKH.js +13 -0
  109. package/dist/it-IT-D7G4BaP7.js +13 -0
  110. package/dist/it-IT-GgHc0cHR.js +54 -0
  111. package/dist/it-IT-pDWPFHEh.js +16 -0
  112. package/dist/ja-JP-B3yqM_FM.js +13 -0
  113. package/dist/ja-JP-BhS-_dIx.js +54 -0
  114. package/dist/ja-JP-DTW_hY1L.js +13 -0
  115. package/dist/ja-JP-scPXJ93L.js +16 -0
  116. package/dist/{json-DGARJCng.js → json-Dk6RRAV8.js} +2 -2
  117. package/dist/{localizeDateString-KlstHAcM.js → localizeDateString-CKCBXzSn.js} +6 -6
  118. package/dist/lt-LT-BcGNy8Ti.js +16 -0
  119. package/dist/lt-LT-DTQGR9M0.js +54 -0
  120. package/dist/lt-LT-Lzl_Cbw-.js +13 -0
  121. package/dist/lv-LV-BQ4F1GrV.js +54 -0
  122. package/dist/lv-LV-CBD07r1Y.js +16 -0
  123. package/dist/lv-LV-y00wN1pj.js +13 -0
  124. package/dist/{mapFinancialReportsToFinancialInformation-Cid31JpK.js → mapFinancialReportsToFinancialInformation-D_6u_bSS.js} +19 -12
  125. package/dist/minus-circle-filled-BGKeHaxJ.js +17 -0
  126. package/dist/nl-NL-BxJUDHMK.js +16 -0
  127. package/dist/nl-NL-CFzm75Jw.js +13 -0
  128. package/dist/nl-NL-CUcML482.js +54 -0
  129. package/dist/nl-NL-DmnFXAQC.js +13 -0
  130. package/dist/no-NO-BBCvsecq.js +54 -0
  131. package/dist/no-NO-DbvFfP96.js +13 -0
  132. package/dist/no-NO-Drup6Jyy.js +16 -0
  133. package/dist/pl-PL--mmxopYA.js +13 -0
  134. package/dist/pl-PL-BXv8Mmzb.js +16 -0
  135. package/dist/pl-PL-kGaeUP-w.js +54 -0
  136. package/dist/{plaintext-jF9fCLMp.js → plaintext-9WNCwUtz.js} +2 -2
  137. package/dist/plus-circle-filled-Cnf1oJTm.js +17 -0
  138. package/dist/preact/adyen-terms-of-service.js +1 -1
  139. package/dist/preact/adyen-transfer-instrument.js +2 -2
  140. package/dist/pt-PT-BVzXBFp7.js +13 -0
  141. package/dist/pt-PT-D8nU-UM2.js +16 -0
  142. package/dist/pt-PT-DpDxAynk.js +13 -0
  143. package/dist/pt-PT-JVqqgvPs.js +54 -0
  144. package/dist/resolveEnvironment-DQH1ab0S.js +84 -0
  145. package/dist/ro-RO-C83h2zHZ.js +54 -0
  146. package/dist/ro-RO-CG33OwqS.js +16 -0
  147. package/dist/ro-RO-Cdmevo9A.js +13 -0
  148. package/dist/ru-RU-FZb2upqh.js +13 -0
  149. package/dist/{rules-a4kJDPzY.js → rules-CCnLDGvk.js} +63 -64
  150. package/dist/sk-SK-CgLJIuJw.js +54 -0
  151. package/dist/sk-SK-DV_xkO69.js +16 -0
  152. package/dist/sk-SK-nfeuTcY5.js +13 -0
  153. package/dist/sl-SI-B5yeoadY.js +16 -0
  154. package/dist/sl-SI-BzeVaC1Z.js +54 -0
  155. package/dist/sl-SI-DUTZDqkP.js +13 -0
  156. package/dist/style.css +2124 -3093
  157. package/dist/styles-CLV89_hH.js +2125 -3094
  158. package/dist/sv-SE-BTx2XKAp.js +13 -0
  159. package/dist/sv-SE-CVmo11gI.js +54 -0
  160. package/dist/sv-SE-CfxyR53r.js +16 -0
  161. package/dist/sv-SE-rckxD-43.js +13 -0
  162. package/dist/types/api/address/address.types.d.ts +0 -1
  163. package/dist/types/api/address/useAddressCleanse.d.ts +1 -1
  164. package/dist/types/api/address/useSearchAddress.d.ts +0 -1
  165. package/dist/types/api/businessLines/useUpdateSourceOfFunds.d.ts +2 -2
  166. package/dist/types/api/companyDataSet/companyDataset.types.d.ts +2 -2
  167. package/dist/types/api/companyDataSet/constants.d.ts +1 -1
  168. package/dist/types/api/companyDataSet/handleCompanyDataset.d.ts +3 -0
  169. package/dist/types/api/companySearch/companySearch.types.d.ts +2 -2
  170. package/dist/types/api/companySelection/companySelection.types.d.ts +6 -0
  171. package/dist/types/api/companySelection/useCompanySelection.d.ts +21 -0
  172. package/dist/types/api/configurations/configurations.types.d.ts +9 -0
  173. package/dist/types/api/configurations/useScenarios.d.ts +33 -35
  174. package/dist/types/api/configurations/useSupportedCountries.d.ts +3 -3
  175. package/dist/types/api/configurations/useTaskTypes.d.ts +2 -2
  176. package/dist/types/api/configurations/useVersionConfiguration.d.ts +2 -2
  177. package/dist/types/api/createLegalEntity/useCreateLegalEntity.d.ts +11 -11
  178. package/dist/types/api/datasets/datasets.types.d.ts +6 -0
  179. package/dist/types/api/datasets/useLegalForms.d.ts +3 -8
  180. package/dist/types/api/datasets/useNaceCodes.d.ts +2 -2
  181. package/dist/types/api/datasets/useSourceOfFundsTypes.d.ts +2 -2
  182. package/dist/types/api/entityVerifications/entityVerifications.types.d.ts +15 -0
  183. package/dist/types/api/entityVerifications/useVerifyIdNumber.d.ts +2 -17
  184. package/dist/types/api/idNowProvider/idNowProvider.types.d.ts +7 -0
  185. package/dist/types/api/idNowProvider/useIdNowProvider.d.ts +14 -0
  186. package/dist/types/api/idVerificationProviders/idVerificationProviders.types.d.ts +6 -0
  187. package/dist/types/api/idVerificationProviders/idVerificationStartCheck.d.ts +3 -7
  188. package/dist/types/api/idVerificationProviders/useExtractDocumentInformation.d.ts +7 -7
  189. package/dist/types/api/legalEntity/useConfirmReview.d.ts +2 -2
  190. package/dist/types/api/legalEntity/useLegalEntity.d.ts +285 -223
  191. package/dist/types/api/legalEntity/useUpdateLegalEntity.d.ts +14 -14
  192. package/dist/types/api/onboardingStatus/onboardingStatus.types.d.ts +7 -0
  193. package/dist/types/api/onboardingStatus/useGenerateOnboardingLink.d.ts +2 -5
  194. package/dist/types/api/onboardingStatus/useOnboardingStatus.d.ts +1 -1
  195. package/dist/types/api/pciTemplate/pciTemplate.types.d.ts +9 -0
  196. package/dist/types/api/pciTemplate/usePciQuestionnaire.d.ts +2 -4
  197. package/dist/types/api/pciTemplate/usePciQuestionnaireList.d.ts +7 -9
  198. package/dist/types/api/pciTemplate/usePciStatus.d.ts +4 -9
  199. package/dist/types/api/pciTemplate/usePciTemplate.d.ts +2 -2
  200. package/dist/types/api/pciTemplate/useSignPci.d.ts +2 -2
  201. package/dist/types/api/providersConfiguration/providersConfiguration.types.d.ts +9 -0
  202. package/dist/types/api/providersConfiguration/useProviderStatus.d.ts +3 -13
  203. package/dist/types/api/queryKeys.d.ts +5 -3
  204. package/dist/types/api/taskStatus/taskStatus.types.d.ts +4 -0
  205. package/dist/types/api/taskStatus/useTaskStatus.d.ts +0 -3
  206. package/dist/types/api/taxClassification/taxClassification.types.d.ts +2 -0
  207. package/dist/types/api/taxClassification/useTaxClassification.d.ts +1 -2
  208. package/dist/types/api/termsOfService/termsOfService.types.d.ts +10 -0
  209. package/dist/types/api/termsOfService/useAcceptTermsOfService.d.ts +3 -10
  210. package/dist/types/api/termsOfService/useAcceptedTermsOfService.d.ts +9 -8
  211. package/dist/types/api/termsOfService/useTermsOfService.d.ts +12 -5
  212. package/dist/types/api/termsOfService/useTermsOfServiceAcceptanceInfos.d.ts +2 -2
  213. package/dist/types/api/termsOfService/useTermsOfServiceStatus.d.ts +2 -2
  214. package/dist/types/api/tinVerification/tinVerification.types.d.ts +4 -0
  215. package/dist/types/api/tinVerification/useVerifyTin.d.ts +2 -4
  216. package/dist/types/api/transferInstruments/transferInstruments.types.d.ts +25 -0
  217. package/dist/types/api/transferInstruments/useBankVerificationProviders.d.ts +1 -14
  218. package/dist/types/api/transferInstruments/useCreateTrustedTransferInstrument.d.ts +3 -6
  219. package/dist/types/api/transferInstruments/useHandleBankVerificationError.d.ts +4 -7
  220. package/dist/types/api/transferInstruments/useTransferInstruments.d.ts +1 -9
  221. package/dist/types/api/uiAnalytics/uiAnalytics.types.d.ts +7 -0
  222. package/dist/types/api/uiAnalytics/useAnalyticsSession.d.ts +2 -14
  223. package/dist/types/api/uiAnalytics/usePushAnalyticEvent.d.ts +2 -2
  224. package/dist/types/api/validation/useValidateAccountIdentification.d.ts +1 -6
  225. package/dist/types/api/validation/useValidatePhoneNumber.d.ts +4 -7
  226. package/dist/types/api/validation/validation.types.d.ts +8 -0
  227. package/dist/types/components/BankAccount/fields/BankAccountNumber/fieldConfig.d.ts +1 -1
  228. package/dist/types/components/BankAccount/fields/BankAccountNumber/types.d.ts +1 -1
  229. package/dist/types/components/BankAccount/fields/BankCode/fieldConfig.d.ts +1 -1
  230. package/dist/types/components/BankAccount/fields/BankCode/types.d.ts +1 -1
  231. package/dist/types/components/BankAccount/fields/BranchCode/fieldConfig.d.ts +1 -1
  232. package/dist/types/components/BankAccount/fields/BranchCode/types.d.ts +1 -1
  233. package/dist/types/components/BankAccount/fields/Iban/fieldConfig.d.ts +1 -1
  234. package/dist/types/components/BankAccount/fields/Iban/ibanValidator.d.ts +1 -1
  235. package/dist/types/components/BankAccount/fields/Iban/types.d.ts +1 -1
  236. package/dist/types/components/BankAccount/fields/SwiftCode/fieldConfig.d.ts +1 -1
  237. package/dist/types/components/BankAccount/forms/BankDocument/BankDocument.d.ts +0 -1
  238. package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirements.d.ts +1 -2
  239. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +3 -2
  240. package/dist/types/components/BankAccount/forms/BankVerification/BankVerification.d.ts +2 -2
  241. package/dist/types/components/BankAccount/forms/BankVerification/types.d.ts +3 -3
  242. package/dist/types/components/BankAccount/forms/BankVerification/verification/widget/types.d.ts +1 -2
  243. package/dist/types/components/BankAccount/forms/PayoutAccount/CheckGuidance/CheckGuidance.d.ts +0 -1
  244. package/dist/types/components/BankAccount/forms/PayoutAccount/types.d.ts +1 -1
  245. package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetails.d.ts +0 -1
  246. package/dist/types/components/BankAccount/forms/PayoutDetails/rules.d.ts +6 -6
  247. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +3 -9
  248. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/allowedBankCountriesPerCountry.d.ts +1 -1
  249. package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/types.d.ts +2 -2
  250. package/dist/types/components/BankAccount/hooks/useAsyncAccountDetailsValidationRules.d.ts +1 -1
  251. package/dist/types/components/BankAccount/mapping/mapPayoutAccountSchemaToApiBankAccount.d.ts +1 -1
  252. package/dist/types/components/BankAccount/mapping/mapPayoutDocumentsToApiDocuments.d.ts +1 -1
  253. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +1613 -1919
  254. package/dist/types/components/BankAccount/pages/PayoutDetailsPage.d.ts +1 -0
  255. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +1 -1
  256. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/payoutDetailsFormConfig.d.ts +3 -3
  257. package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +3 -0
  258. package/dist/types/components/BankAccount/utils/defaultPayoutAccountFormat.d.ts +1 -1
  259. package/dist/types/components/BankAccount/utils/payoutAccountUtil.d.ts +3 -3
  260. package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +3 -2
  261. package/dist/types/components/Business/forms/AdditionalInformation/utils.d.ts +1 -0
  262. package/dist/types/components/Business/forms/BasicInformation/types.d.ts +3 -2
  263. package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +2 -2
  264. package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +2 -2
  265. package/dist/types/components/Business/forms/BusinessSelection/{BusinessInformationCard.d.ts → BusinessInformationCard/BusinessInformationCard.d.ts} +4 -6
  266. package/dist/types/components/Business/forms/BusinessSelection/BusinessSelection.d.ts +1 -1
  267. package/dist/types/components/Business/forms/CompanyStructure/types.d.ts +1 -1
  268. package/dist/types/components/Business/forms/ProofOfDirectorDocument/types.d.ts +1 -1
  269. package/dist/types/components/Business/forms/ProofOfOwnershipDocument/types.d.ts +1 -1
  270. package/dist/types/components/Business/forms/ProofOfSignatoryDocument/types.d.ts +1 -1
  271. package/dist/types/components/Business/forms/RegistrationDocument/config.d.ts +1 -1
  272. package/dist/types/components/Business/forms/RegistrationDocument/types.d.ts +1 -1
  273. package/dist/types/components/Business/forms/TaxDocument/config.d.ts +1 -1
  274. package/dist/types/components/Business/forms/TaxDocument/types.d.ts +1 -1
  275. package/dist/types/components/Business/forms/rules.d.ts +23 -20
  276. package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +1 -1
  277. package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +1 -1
  278. package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsFormConfig.d.ts +1 -2
  279. package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +2 -2
  280. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +3 -3
  281. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +1 -4
  282. package/dist/types/components/Business/utils/companyUtil.d.ts +1 -1
  283. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/ServiceAgreementDropin.d.ts +0 -1
  284. package/dist/types/components/EFP/fields/LegalFormField/LegalFormField.d.ts +1 -1
  285. package/dist/types/components/EFP/fields/LegalFormField/types.d.ts +6 -3
  286. package/dist/types/components/EFP/fields/NaceCodeField/NaceCodeField.d.ts +1 -1
  287. package/dist/types/components/EFP/fields/NaceCodeField/types.d.ts +1 -0
  288. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +2053 -24
  289. package/dist/types/components/EFP/mapping/mapBusinessFinancingToLegalEntity.d.ts +2 -2
  290. package/dist/types/components/EFP/mapping/mapLegalEntityToBusinessFinancing.d.ts +1 -2
  291. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBasicCompanyInformation.d.ts +5 -1
  292. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingBusinessInformation.d.ts +10 -1
  293. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +11 -1
  294. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingLegalInformation.d.ts +6 -1
  295. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingOwnershipStructure.d.ts +7 -2
  296. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingRegisteredAddress.d.ts +7 -1
  297. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +27 -112
  298. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +17 -4
  299. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +22 -0
  300. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +1 -2
  301. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SourceOfFundsUploader/SOFUploadModal.d.ts +0 -1
  302. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/sofStore.d.ts +1 -1
  303. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +3 -3
  304. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +1 -1
  305. package/dist/types/components/EFP/tasks/TaxReportingDropin/taxClassificationStore.d.ts +1 -1
  306. package/dist/types/components/EFP/tasks/TaxReportingDropin/types.d.ts +3 -3
  307. package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +3 -3
  308. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverview/ManageTransferInstrumentOverview.d.ts +1 -1
  309. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItem/ManageTransferInstrumentOverviewItem.d.ts +1 -1
  310. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +1 -1
  311. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/DropinComposer.d.ts +1 -1
  312. package/dist/types/components/Individual/fields/DecisionMakerRole/NomineeDecisionMakerRole.d.ts +1 -1
  313. package/dist/types/components/Individual/fields/DecisionMakerRole/types.d.ts +1 -1
  314. package/dist/types/components/Individual/fields/DriversLicense/DriversLicense.types.d.ts +1 -1
  315. package/dist/types/components/Individual/fields/IdentityNumber/IdentityNumber.d.ts +1 -2
  316. package/dist/types/components/Individual/fields/IdentityNumber/fieldConfig.d.ts +3 -3
  317. package/dist/types/components/Individual/fields/IdentityNumber/type.d.ts +1 -1
  318. package/dist/types/components/Individual/fields/LocalizedNameFields/LocalizedNameFields.d.ts +2 -0
  319. package/dist/types/components/Individual/fields/LocalizedNameFields/types.d.ts +9 -0
  320. package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +13 -0
  321. package/dist/types/components/Individual/fields/NameFields/types.d.ts +23 -0
  322. package/dist/types/components/Individual/fields/NameFields/validate.d.ts +4 -0
  323. package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/IdDocumentManualUpload.d.ts +1 -1
  324. package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/types.d.ts +3 -3
  325. package/dist/types/components/Individual/forms/Individual/IdDocumentUpload/utils.d.ts +1 -1
  326. package/dist/types/components/Individual/forms/Individual/IdVerification/idVerificationProviderId.d.ts +1 -1
  327. package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/IdVerificationMethod.d.ts +1 -1
  328. package/dist/types/components/Individual/forms/Individual/IdVerificationMethod/types.d.ts +2 -2
  329. package/dist/types/components/Individual/forms/Individual/Individual.d.ts +1 -1
  330. package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityAu/IdentityAu.d.ts +1 -1
  331. package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityHK/IdentityHK.d.ts +1 -1
  332. package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/IdentityNZ/IdentityNZ.d.ts +1 -1
  333. package/dist/types/components/Individual/forms/Individual/PersonalDetails/Identity/identityUS/IdentityUS.d.ts +1 -1
  334. package/dist/types/components/Individual/forms/Individual/PersonalDetails/types.d.ts +7 -5
  335. package/dist/types/components/Individual/forms/Individual/PersonalDetails/validate.d.ts +2 -2
  336. package/dist/types/components/Individual/forms/Individual/rules.d.ts +34 -32
  337. package/dist/types/components/Individual/forms/Individual/types.d.ts +8 -8
  338. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.d.ts +1 -1
  339. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +1 -1
  340. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/Identity/Identity.d.ts +1 -1
  341. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/Identity/validate.d.ts +1 -1
  342. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/validate.d.ts +2 -2
  343. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.d.ts +1 -1
  344. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +3 -2
  345. package/dist/types/components/Individual/forms/IndividualOnfido/DataConflictsModal/ConflictRow.d.ts +1 -1
  346. package/dist/types/components/Individual/forms/IndividualOnfido/GuidanceQuestion/GuidanceQuestion.d.ts +7 -3
  347. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/IdVerificationMethod.types.d.ts +1 -0
  348. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/individualOnfidoConflictsSchema.d.ts +23 -9
  349. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/mapExtractionResultToSchema.d.ts +1 -1
  350. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.d.ts +0 -1
  351. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.rules.d.ts +37 -34
  352. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +4 -4
  353. package/dist/types/components/Individual/forms/IndividualOnfido/SignatoryQuestionnaire/SignatoryQuestionnaire.d.ts +1 -1
  354. package/dist/types/components/Individual/forms/IndividualOnfido/SignatoryQuestionnaire/SignatoryQuestionnaire.types.d.ts +1 -3
  355. package/dist/types/components/Individual/forms/IndividualOnfido/SignatoryQuestionnaire/SignatoryQuestionnaireModalContent.d.ts +1 -0
  356. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaire.d.ts +1 -1
  357. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaire.types.d.ts +3 -3
  358. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/UboQuestionnaireModalContent.d.ts +5 -0
  359. package/dist/types/components/Individual/helpers/isOnfidoAutofillFlowEnabled.d.ts +1 -1
  360. package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +2 -2
  361. package/dist/types/components/Individual/mapping/adjustOnfidoIdentificationData.d.ts +3 -0
  362. package/dist/types/components/Individual/mapping/getOnfidoIdentityTypeToApiIdentityTypeMap.d.ts +3 -0
  363. package/dist/types/components/Individual/mapping/individualOnfidoKeyMappings.d.ts +1 -0
  364. package/dist/types/components/Individual/mapping/mapIndividualOnfidoSchemaToLegalEntity.d.ts +3 -1
  365. package/dist/types/components/Individual/mapping/mapLocalization.d.ts +3 -0
  366. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersGettingStarted.d.ts +5 -0
  367. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersModalContent.d.ts +1 -0
  368. package/dist/types/components/Individual/tasks/IndividualDropin/individualFormConfig.d.ts +1 -1
  369. package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoStore.d.ts +6 -0
  370. package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/individualOnfidoFormConfig.d.ts +1 -1
  371. package/dist/types/components/Shared/EntityAssociation/types.d.ts +1 -1
  372. package/dist/types/components/Shared/EntityGuidanceStatus/types.d.ts +1 -1
  373. package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +1 -1
  374. package/dist/types/components/Shared/FormNavigation/FormNavigationItem.d.ts +1 -2
  375. package/dist/types/components/Shared/FormNavigation/types.d.ts +3 -3
  376. package/dist/types/components/Shared/FormWrapper/FormWrapper.d.ts +2 -2
  377. package/dist/types/components/Shared/Introduction/copy.d.ts +2 -2
  378. package/dist/types/components/Shared/SingpassSelection/types.d.ts +1 -1
  379. package/dist/types/components/Shared/Summary/Summary.d.ts +1 -2
  380. package/dist/types/components/Shared/Summary/summaryItem.d.ts +1 -1
  381. package/dist/types/components/Shared/Summary/types.d.ts +3 -3
  382. package/dist/types/components/Shared/devex/DebugListener/DebugModal.d.ts +0 -1
  383. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
  384. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/fieldConfig.d.ts +6 -4
  385. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +6 -8
  386. package/dist/types/components/Shared/fields/CountryField/CountryField.d.ts +1 -1
  387. package/dist/types/components/Shared/fields/CountryField/types.d.ts +3 -3
  388. package/dist/types/components/Shared/fields/CountryOfGoverningLawField/CountryOfGoverningLawField.d.ts +1 -1
  389. package/dist/types/components/Shared/fields/CountryOfGoverningLawField/types.d.ts +2 -2
  390. package/dist/types/components/Shared/fields/Currency/types.d.ts +3 -3
  391. package/dist/types/components/Shared/fields/DBANameField/fieldConfig.d.ts +1 -1
  392. package/dist/types/components/Shared/fields/DBANameField/types.d.ts +1 -3
  393. package/dist/types/components/Shared/fields/DateOfIncorporationField/fieldConfig.d.ts +1 -1
  394. package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +1 -1
  395. package/dist/types/components/Shared/fields/EInvoicingCodeField/fieldConfig.d.ts +1 -1
  396. package/dist/types/components/Shared/fields/EInvoicingCodeField/types.d.ts +1 -1
  397. package/dist/types/components/Shared/fields/FinancialReportingDate/types.d.ts +1 -1
  398. package/dist/types/components/Shared/fields/IdFieldTypeSelector/CompanyRegistrationNumberTypeSelector.d.ts +2 -2
  399. package/dist/types/components/Shared/fields/IdFieldTypeSelector/IndividualIdNumberTypeSelector.d.ts +2 -2
  400. package/dist/types/components/Shared/fields/IdFieldTypeSelector/TaxIdNumberTypeSelector.d.ts +4 -3
  401. package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +2 -2
  402. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +11 -2
  403. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultRegistrationNumberType.d.ts +16 -0
  404. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultTaxIdNumberType.d.ts +1 -1
  405. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultVatNumberType.d.ts +13 -0
  406. package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferCompanyRegistrationNumberType.d.ts +1 -1
  407. package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +1 -1
  408. package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferVatNumberType.d.ts +1 -1
  409. package/dist/types/components/Shared/fields/LegalCompanyNameField/LegalCompanyNameField.d.ts +1 -2
  410. package/dist/types/components/Shared/fields/LegalCompanyNameField/fieldConfig.d.ts +1 -1
  411. package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +1 -1
  412. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +12 -0
  413. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/types.d.ts +5 -0
  414. package/dist/types/components/Shared/fields/Name/Name.d.ts +1 -1
  415. package/dist/types/components/Shared/fields/NumberOfEmployees/types.d.ts +1 -1
  416. package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -2
  417. package/dist/types/components/Shared/fields/PhoneField/fieldConfig.d.ts +1 -1
  418. package/dist/types/components/Shared/fields/PhoneField/types.d.ts +2 -2
  419. package/dist/types/components/Shared/fields/StateField/StateField.d.ts +1 -1
  420. package/dist/types/components/Shared/fields/StateField/fieldConfig.d.ts +1 -1
  421. package/dist/types/components/Shared/fields/StateField/types.d.ts +4 -4
  422. package/dist/types/components/Shared/fields/StockExchangeMICField/fieldConfig.d.ts +1 -1
  423. package/dist/types/components/Shared/fields/StockExchangeMICField/types.d.ts +1 -1
  424. package/dist/types/components/Shared/fields/StockISINField/fieldConfig.d.ts +1 -1
  425. package/dist/types/components/Shared/fields/StockISINField/types.d.ts +1 -1
  426. package/dist/types/components/Shared/fields/StockTickerSymbol/fieldConfig.d.ts +1 -1
  427. package/dist/types/components/Shared/fields/StockTickerSymbol/types.d.ts +1 -1
  428. package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +1 -2
  429. package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +5 -3
  430. package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +2 -2
  431. package/dist/types/components/Shared/fields/VatNumberField/VatNumberField.d.ts +1 -1
  432. package/dist/types/components/Shared/fields/VatNumberField/fieldConfig.d.ts +1 -1
  433. package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +3 -5
  434. package/dist/types/components/Shared/forms/Address/AddressField.d.ts +1 -1
  435. package/dist/types/components/Shared/forms/Address/SearchAddress.d.ts +3 -3
  436. package/dist/types/components/Shared/forms/Address/constants.d.ts +1 -1
  437. package/dist/types/components/Shared/forms/Address/types.d.ts +1 -2
  438. package/dist/types/components/Shared/forms/Address/utils.d.ts +3 -3
  439. package/dist/types/components/Shared/forms/Address/validate.d.ts +1 -1
  440. package/dist/types/components/Shared/forms/BusinessTypeSelection/types.d.ts +1 -1
  441. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +7 -7
  442. package/dist/types/components/Shared/forms/CompanyNameAndCountry/types.d.ts +1 -1
  443. package/dist/types/components/Shared/forms/ConstitutionalDocument/types.d.ts +1 -1
  444. package/dist/types/components/Shared/forms/ContactDetails/ContactDetails.d.ts +1 -1
  445. package/dist/types/components/Shared/forms/ContactDetails/types.d.ts +1 -1
  446. package/dist/types/components/Shared/forms/DocumentUpload/types.d.ts +2 -2
  447. package/dist/types/components/Shared/forms/FinancialInformation/ReportedValue.d.ts +1 -1
  448. package/dist/types/components/Shared/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +2 -2
  449. package/dist/types/components/Shared/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
  450. package/dist/types/components/Shared/forms/FinancialInformation/types.d.ts +3 -3
  451. package/dist/types/components/Shared/forms/FinancialInformation/validate.d.ts +1 -0
  452. package/dist/types/components/Shared/forms/RegistrationAddress/types.d.ts +2 -2
  453. package/dist/types/components/Shared/tasks/CustomerSupport/types.d.ts +1 -1
  454. package/dist/types/components/Shared/tasks/TaskList/PayoutAccountTaskListItem.d.ts +1 -1
  455. package/dist/types/components/Shared/tasks/TaskList/TaskItemStatus.d.ts +1 -2
  456. package/dist/types/components/Shared/tasks/TaskList/TaskList.d.ts +1 -1
  457. package/dist/types/components/Shared/tasks/TaskList/types.d.ts +2 -2
  458. package/dist/types/components/Shared/tasks/TaskList/utils.d.ts +1 -1
  459. package/dist/types/components/Trust/forms/Trust/Trust.d.ts +19 -3
  460. package/dist/types/components/Trust/forms/Trust/rules.d.ts +6 -6
  461. package/dist/types/components/Trust/forms/Trust/types.d.ts +2 -2
  462. package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +1 -1
  463. package/dist/types/components/Trust/forms/TrustRoleAndEntityType/types.d.ts +1 -1
  464. package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +14 -14
  465. package/dist/types/components/Trust/mapping/mapTrustDocumentToApiDocument.d.ts +1 -1
  466. package/dist/types/components/Trust/tasks/RoleAndTypeDropin/types.d.ts +1 -1
  467. package/dist/types/components/Trust/tasks/TrustDropin/trustFormConfig.d.ts +1 -1
  468. package/dist/types/components/Trust/tasks/TrustMembers/types.d.ts +1 -1
  469. package/dist/types/components/Trust/utils/trustUtil.d.ts +4 -4
  470. package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +2 -2
  471. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRadioGroup.d.ts +2 -3
  472. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRoleAndType.d.ts +1 -2
  473. package/dist/types/components/UnincorporatedPartnership/types/types.d.ts +1 -1
  474. package/dist/types/components/UnincorporatedPartnership/utils/unincorporatedParnershipUtil.d.ts +3 -3
  475. package/dist/types/components/ui/atoms/Accordion/Accordion.d.ts +1 -2
  476. package/dist/types/components/ui/atoms/ActionsMenu/ActionsMenu.d.ts +1 -1
  477. package/dist/types/components/ui/atoms/Button/Button.d.ts +2 -3
  478. package/dist/types/components/ui/atoms/Button/Button.types.d.ts +3 -3
  479. package/dist/types/components/ui/atoms/Checkbox/Checkbox.d.ts +1 -2
  480. package/dist/types/components/ui/atoms/Field/Field.d.ts +3 -6
  481. package/dist/types/components/ui/atoms/Field/Field.types.d.ts +11 -12
  482. package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +4 -6
  483. package/dist/types/components/ui/atoms/InputBase/InputBase.d.ts +5 -5
  484. package/dist/types/components/ui/atoms/List/List.d.ts +12 -0
  485. package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
  486. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +3 -3
  487. package/dist/types/components/ui/atoms/Remove/Remove.d.ts +1 -2
  488. package/dist/types/components/ui/atoms/Select/Select.d.ts +1 -2
  489. package/dist/types/components/ui/atoms/Select/Select.types.d.ts +1 -0
  490. package/dist/types/components/ui/atoms/SelectButton/SelectButton.d.ts +1 -2
  491. package/dist/types/components/ui/atoms/SelectButton/SelectButton.types.d.ts +3 -4
  492. package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -2
  493. package/dist/types/components/ui/atoms/SelectList/SelectList.types.d.ts +2 -2
  494. package/dist/types/components/ui/atoms/SelectListItem/SelectListItem.types.d.ts +3 -3
  495. package/dist/types/components/ui/atoms/Svg/Svg.d.ts +1 -1
  496. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +6 -0
  497. package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +1 -1
  498. package/dist/types/components/ui/atoms/TextArea/TextArea.d.ts +1 -2
  499. package/dist/types/components/ui/atoms/Tile/Tile.d.ts +1 -2
  500. package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +10 -0
  501. package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +8 -0
  502. package/dist/types/components/ui/molecules/Alert/Alert.d.ts +1 -1
  503. package/dist/types/components/ui/molecules/Alert/types.d.ts +1 -1
  504. package/dist/types/components/ui/molecules/Card/Card.d.ts +1 -2
  505. package/dist/types/components/ui/molecules/Card/types.d.ts +3 -3
  506. package/dist/types/components/ui/molecules/Confirm/Confirm.d.ts +1 -1
  507. package/dist/types/components/ui/molecules/Confirm/Confirm.types.d.ts +1 -0
  508. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +2 -2
  509. package/dist/types/components/ui/molecules/Dropzone/FilePicker.d.ts +3 -5
  510. package/dist/types/components/ui/molecules/Dropzone/types.d.ts +1 -1
  511. package/dist/types/components/ui/molecules/Dropzone/validate.d.ts +1 -1
  512. package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +2 -2
  513. package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +2 -2
  514. package/dist/types/components/ui/molecules/ErrorPanel/ErrorPanel.d.ts +1 -1
  515. package/dist/types/components/ui/molecules/ErrorPanel/VerificationErrors.d.ts +2 -1
  516. package/dist/types/components/ui/molecules/ErrorPanel/types.d.ts +3 -3
  517. package/dist/types/components/ui/molecules/FormEndState/FormEndState.d.ts +0 -1
  518. package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +2 -3
  519. package/dist/types/components/ui/molecules/InputDate/InputDate.d.ts +3 -3
  520. package/dist/types/components/ui/molecules/InputEmail/InputEmail.d.ts +1 -1
  521. package/dist/types/components/ui/molecules/InputTelephone/InputTelephone.d.ts +1 -1
  522. package/dist/types/components/ui/molecules/InputText/InputText.d.ts +1 -1
  523. package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +3 -7
  524. package/dist/types/constants/countries.d.ts +1 -1
  525. package/dist/types/constants/keys.d.ts +2 -0
  526. package/dist/types/context/ExperimentContext/types.d.ts +18 -1
  527. package/dist/types/context/FormContext/FormContext.d.ts +1 -1
  528. package/dist/types/context/FormRouterContext/FormRouterContext.d.ts +1 -1
  529. package/dist/types/context/FormRouterContext/types.d.ts +1 -1
  530. package/dist/types/context/SettingsContext/SettingsContext.d.ts +1 -1
  531. package/dist/types/context/SettingsContext/types.d.ts +1 -1
  532. package/dist/types/context/StateContext/StateContext.d.ts +1 -1
  533. package/dist/types/context/StateContext/StateContextSetter.d.ts +1 -1
  534. package/dist/types/context/StateContext/StateReducer.d.ts +4 -10
  535. package/dist/types/context/StateContext/types.d.ts +19 -17
  536. package/dist/types/context/StateContext/useGlobalData.d.ts +2 -2
  537. package/dist/types/core/EmbedShell/EmbedShell.d.ts +2 -1
  538. package/dist/types/core/UIElement/UIElement.d.ts +2 -1
  539. package/dist/types/core/analytics.d.ts +12 -10
  540. package/dist/types/core/environment/resolveEnvironment.d.ts +1 -1
  541. package/dist/types/core/error.d.ts +1 -1
  542. package/dist/types/core/errorMapping.d.ts +3 -3
  543. package/dist/types/core/models/api/address.d.ts +1 -1
  544. package/dist/types/core/models/api/financialReport.d.ts +3 -3
  545. package/dist/types/core/models/api/get-scenarios.d.ts +2 -8
  546. package/dist/types/core/models/api/individual.d.ts +10 -0
  547. package/dist/types/core/models/api/legal-arrangement.d.ts +10 -2
  548. package/dist/types/core/models/api/legal-entity-association.d.ts +5 -0
  549. package/dist/types/core/models/api/organization.d.ts +9 -1
  550. package/dist/types/core/models/api/phone.d.ts +1 -1
  551. package/dist/types/core/models/api/remediating-action.d.ts +1 -1
  552. package/dist/types/core/models/api/source-of-funds.d.ts +1 -1
  553. package/dist/types/core/models/api/transfer-instrument.d.ts +1 -1
  554. package/dist/types/core/models/api/verification-error.d.ts +1 -1
  555. package/dist/types/core/models/api/view-verification-status.d.ts +0 -4
  556. package/dist/types/core/process-field-configurations.d.ts +9 -9
  557. package/dist/types/core/types.d.ts +1 -1
  558. package/dist/types/core/user-events.d.ts +14 -3
  559. package/dist/types/datasets/generators/getAccountFormatForCountry.d.ts +2 -2
  560. package/dist/types/datasets/generators/getBusinessTypeExamplesForCountry.d.ts +2 -2
  561. package/dist/types/datasets/generators/getCompanyTypeExamplesForCountry.d.ts +2 -2
  562. package/dist/types/datasets/generators/getLegalArrangementTypeExamplesForCountry.d.ts +3 -3
  563. package/dist/types/datasets/generators/loadCountries.d.ts +1 -1
  564. package/dist/types/datasets/generators/loadStatesDataset.d.ts +1 -1
  565. package/dist/types/embeds/EmbedBaseElement.d.ts +41 -0
  566. package/dist/types/embeds/EmbedCore.d.ts +22 -0
  567. package/dist/types/embeds/baseEmbedProps.d.ts +21 -0
  568. package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +13 -0
  569. package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +6 -1
  570. package/dist/types/embeds/individual/AdyenIndividual.d.ts +12 -0
  571. package/dist/types/embeds/individual/adyen-individual.types.d.ts +6 -1
  572. package/dist/types/embeds/manage-individual/AdyenManageIndividual.d.ts +12 -0
  573. package/dist/types/embeds/manage-pci/AdyenManagePci.d.ts +12 -0
  574. package/dist/types/embeds/manage-terms-of-service/AdyenManageTermsOfService.d.ts +12 -0
  575. package/dist/types/embeds/manage-transfer-instruments/AdyenManageTransferInstrument.d.ts +15 -0
  576. package/dist/types/embeds/onboarding/AdyenOnboarding.d.ts +12 -0
  577. package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +4 -1
  578. package/dist/types/embeds/sign-pci/AdyenSignPci.d.ts +14 -0
  579. package/dist/types/embeds/sign-pci/adyen-sign-pci.types.d.ts +5 -3
  580. package/dist/types/embeds/terms-of-service/AdyenTermsOfService.d.ts +12 -0
  581. package/dist/types/embeds/terms-of-service/adyen-terms-of-service.types.d.ts +7 -1
  582. package/dist/types/embeds/transfer-instrument/AdyenTransferInstrument.d.ts +16 -0
  583. package/dist/types/embeds/transfer-instrument/adyen-transfer-instrument.types.d.ts +7 -2
  584. package/dist/types/embeds/verification-status/AdyenVerificationStatus.d.ts +20 -0
  585. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +1 -1
  586. package/dist/types/hooks/singpass/useHasSeenSingpassSelection.d.ts +2 -1
  587. package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +2 -2
  588. package/dist/types/hooks/useAccountHolder.d.ts +1 -1
  589. package/dist/types/hooks/useAllowedCountries.d.ts +1 -1
  590. package/dist/types/hooks/useAsyncValidator.d.ts +2 -1
  591. package/dist/types/hooks/useBusinessSetup.d.ts +1 -1
  592. package/dist/types/hooks/useDataConflicts.d.ts +0 -6
  593. package/dist/types/hooks/useDataMissingRemediations.d.ts +1 -1
  594. package/dist/types/hooks/useForm/reducer.d.ts +2 -2
  595. package/dist/types/hooks/useForm/types.d.ts +14 -19
  596. package/dist/types/hooks/useFormComposer.d.ts +2 -2
  597. package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +28 -0
  598. package/dist/types/hooks/useMultiForm/reducer.d.ts +4 -3
  599. package/dist/types/hooks/useMultiForm/types.d.ts +36 -73
  600. package/dist/types/hooks/useMultiForm/useMultiForm.d.ts +1 -1
  601. package/dist/types/hooks/useMultiForm/useMultiFormAsyncValidator.d.ts +2 -2
  602. package/dist/types/hooks/useScenarioConfiguration.d.ts +5 -5
  603. package/dist/types/language/Language.d.ts +1 -7
  604. package/dist/types/language/i18n.d.ts +2 -0
  605. package/dist/types/language/types.d.ts +3 -0
  606. package/dist/types/language/utils.d.ts +12 -3
  607. package/dist/types/stores/globalStore/calculateTaskStatus.d.ts +2 -2
  608. package/dist/types/stores/globalStore/determineTaskIdentifiers.d.ts +2 -2
  609. package/dist/types/stores/globalStore/get-task-status.d.ts +1 -1
  610. package/dist/types/stores/globalStore/globalStore.d.ts +4 -4
  611. package/dist/types/stores/globalStore/taskStatus.d.ts +1 -1
  612. package/dist/types/types/datasets/country-code.d.ts +251 -0
  613. package/dist/types/{core/models → types}/errors/capability-problems.d.ts +1 -1
  614. package/dist/types/{core/models → types}/errors/entity-problems.d.ts +4 -4
  615. package/dist/types/{core/models → types}/errors/error-message.d.ts +1 -1
  616. package/dist/types/{core/models → types}/errors/maintenance-mode-error.d.ts +1 -1
  617. package/dist/types/{core/models → types}/errors/remediation.d.ts +1 -1
  618. package/dist/types/{core/models → types}/form-configuration.d.ts +4 -4
  619. package/dist/types/{core/models → types}/form-rules.d.ts +10 -8
  620. package/dist/types/{core/models → types}/form.d.ts +1 -1
  621. package/dist/types/utils/accountHolderUtils.d.ts +1 -1
  622. package/dist/types/utils/api/documentUtils.d.ts +1 -1
  623. package/dist/types/utils/api/getProblemsForEntity.d.ts +2 -2
  624. package/dist/types/utils/api/processCapabilitites.d.ts +5 -4
  625. package/dist/types/utils/api/processValidationErrors.d.ts +3 -3
  626. package/dist/types/utils/birthDateUtils.d.ts +53 -2
  627. package/dist/types/utils/country.d.ts +5 -2
  628. package/dist/types/utils/datasetUtil.d.ts +3 -3
  629. package/dist/types/{core/models/decision-maker.d.ts → utils/decisionMaker.d.ts} +2 -2
  630. package/dist/types/utils/dropinUtils.d.ts +2 -2
  631. package/dist/types/utils/entityAssociationUtil.d.ts +6 -7
  632. package/dist/types/utils/entityStatusUtil.d.ts +2 -2
  633. package/dist/types/utils/eventHandlers/handleKeys.d.ts +2 -2
  634. package/dist/types/{core/models/field-configurations.d.ts → utils/fieldConfigurations.d.ts} +4 -4
  635. package/dist/types/utils/formUtils.d.ts +1 -1
  636. package/dist/types/utils/formatCurrency.d.ts +1 -1
  637. package/dist/types/utils/getDisplayErrorMessage.d.ts +2 -2
  638. package/dist/types/utils/getLegalEntityCountry.d.ts +1 -1
  639. package/dist/types/utils/getName.d.ts +2 -2
  640. package/dist/types/utils/getSSNType.d.ts +1 -1
  641. package/dist/types/utils/makeSelectItemForRole.d.ts +2 -2
  642. package/dist/types/utils/mapping/mapExistingFile.d.ts +1 -1
  643. package/dist/types/utils/mapping/utils.d.ts +7 -10
  644. package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +1 -0
  645. package/dist/types/utils/omitObscuredFieldsIfUnchanged.d.ts +1 -1
  646. package/dist/types/utils/perCountry.d.ts +1 -1
  647. package/dist/types/utils/perState.d.ts +3 -2
  648. package/dist/types/utils/regex/patternValidators.d.ts +2 -0
  649. package/dist/types/utils/regex/postalCodePatterns.d.ts +1 -1
  650. package/dist/types/utils/simulateTextChangeFromKeyboardEvent.d.ts +2 -2
  651. package/dist/types/utils/trackNavigation.d.ts +1 -2
  652. package/dist/types/utils/urlUtils.d.ts +1 -0
  653. package/dist/types/utils/validation/types.d.ts +1 -1
  654. package/dist/types/utils/validation/validationResult.d.ts +1 -1
  655. package/dist/types/{core/models/errors/validation-error.d.ts → utils/validationError.d.ts} +1 -1
  656. package/dist/types/utils/validatorUtils.d.ts +7 -3
  657. package/dist/types/utils/verification/helpers/verifyIdNumber.d.ts +2 -2
  658. package/dist/{useMultiForm-Lh2i5tRJ.js → useMultiForm-KQwxav4F.js} +160 -136
  659. package/dist/{useOnboardingStatus-D1ym3MHp.js → useOnboardingStatus-BMyj9Pwn.js} +2 -2
  660. package/dist/{useSalesChannelsSettings-BGuBY0ls.js → useSalesChannelsSettings-43TfSoxc.js} +2 -2
  661. package/dist/{useTermsOfServiceStatus-DGZYHVsm.js → useTermsOfServiceStatus-CBHKWYSb.js} +4 -4
  662. package/dist/{useUpdateLegalEntity-By6uwPUg.js → useUpdateLegalEntity-D8dw9Oc3.js} +2 -2
  663. package/dist/{utils-BPrqY9DW.js → utils-CL9qlD-O.js} +18 -11
  664. package/dist/{validate-Dyb8B4Hi.js → validate-CeF0YKvL.js} +2 -2
  665. package/dist/validate-CuwYJGc9.js +94 -0
  666. package/dist/vue/adyen-individual.js +1 -1
  667. package/dist/vue/adyen-manage-individual.js +1 -1
  668. package/dist/vue/adyen-terms-of-service.js +1 -1
  669. package/dist/vue/adyen-transfer-instrument.js +5 -4
  670. package/dist/{yaml-Ba_Tz8d4.js → yaml-CBkrSAtc.js} +2 -2
  671. package/dist/zh-CN-wUb4MmTZ.js +13 -0
  672. package/dist/zh-TW-DNTXHLKa.js +13 -0
  673. package/package.json +53 -51
  674. package/dist/CXEL7IU7-B_FIdhoh.js +0 -55
  675. package/dist/Confirm-okTxq40p.js +0 -56
  676. package/dist/ContractViewer-BChszuWL.js +0 -980
  677. package/dist/FormEndState-BQOQ83vO.js +0 -32
  678. package/dist/FormNavigation-B6RspX9C.js +0 -145
  679. package/dist/FormWrapper-Dvm1o4tC.js +0 -149
  680. package/dist/HASRA6WW-C1SPXfmX.js +0 -12411
  681. package/dist/I3HPI4QX-A8JLvlId.js +0 -46
  682. package/dist/MaybeModal-Djz8fRfd.js +0 -18
  683. package/dist/Modal-CRNejb1x.js +0 -135
  684. package/dist/PayoutDetailsDropin-Bw29V8E7.js +0 -901
  685. package/dist/PayoutDetailsPage-BHNHaMbR.js +0 -57
  686. package/dist/ShadowStylesRoot-D4KvocCc.js +0 -103
  687. package/dist/SourceOfFunds.module-OqFTr4WQ.js +0 -128
  688. package/dist/Spacer-BK3jDget.js +0 -18
  689. package/dist/StepProgressIndicator-BuGfVdlr.js +0 -74
  690. package/dist/bg-BG-CGHVGS50.js +0 -1986
  691. package/dist/cs-CZ-5Os6MsQs.js +0 -1986
  692. package/dist/da-DK-Dk9852pS.js +0 -1986
  693. package/dist/de-DE-B3TpRjZX.js +0 -994
  694. package/dist/de-DE-dk9CMgxF.js +0 -1986
  695. package/dist/documentUtils-51iMbUyU.js +0 -226
  696. package/dist/dropinUtils-Bk0T79SK.js +0 -204
  697. package/dist/el-GR-CFEuLvxK.js +0 -994
  698. package/dist/el-GR-DgI6Cgl6.js +0 -1986
  699. package/dist/en-US-ghR-1_C2.js +0 -994
  700. package/dist/es-ES-BtWn2FOQ.js +0 -994
  701. package/dist/es-ES-BzoYprDP.js +0 -1986
  702. package/dist/et-EE-DlbiEFQu.js +0 -1986
  703. package/dist/fi-FI-GSyT4vm7.js +0 -1986
  704. package/dist/fr-FR-BEImhl_J.js +0 -1986
  705. package/dist/fr-FR-HvIkGqJf.js +0 -994
  706. package/dist/hr-HR-CNFI9uDD.js +0 -1986
  707. package/dist/hu-HU-D4xFA3R6.js +0 -1986
  708. package/dist/individualFormConfig-BrFLPTfr.js +0 -171
  709. package/dist/it-IT-B65JP9Qv.js +0 -1986
  710. package/dist/it-IT-CjbZahlB.js +0 -994
  711. package/dist/ja-JP-4jufT0xh.js +0 -994
  712. package/dist/ja-JP-CgGmwtzl.js +0 -1986
  713. package/dist/lt-LT-D_Q1Z3N4.js +0 -1986
  714. package/dist/lv-LV-aF5bMtic.js +0 -1986
  715. package/dist/mapExistingFile-BE74t9jV.js +0 -25
  716. package/dist/mapTransferInstrumentToPayoutAccount-DR8zv8gS.js +0 -30
  717. package/dist/nl-NL-B3xjfpMi.js +0 -994
  718. package/dist/nl-NL-GDXpht_y.js +0 -1986
  719. package/dist/no-NO-CEow5Bac.js +0 -1986
  720. package/dist/omitObscuredFieldsIfUnchanged-DhCrqm4T.js +0 -28
  721. package/dist/pl-PL-Bir_Ltlv.js +0 -1986
  722. package/dist/process-field-configurations-DugpEY9k.js +0 -185
  723. package/dist/processValidationErrors-RYlNmxB9.js +0 -203
  724. package/dist/pt-PT-BpYDD-PX.js +0 -994
  725. package/dist/pt-PT-lkmVY63I.js +0 -1986
  726. package/dist/ro-RO-CTQvP4R9.js +0 -1986
  727. package/dist/ru-RU-BlgIj-Q4.js +0 -994
  728. package/dist/sk-SK-Ct3OVI0e.js +0 -1986
  729. package/dist/sl-SI-CNjkFWB7.js +0 -1986
  730. package/dist/sv-SE-7lcf_fB9.js +0 -994
  731. package/dist/sv-SE-BwREUuQq.js +0 -1986
  732. package/dist/types/api/companyDataSet/useCompanyDataset.d.ts +0 -5
  733. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/formatId.d.ts +0 -3
  734. package/dist/types/core/models/country-code.d.ts +0 -250
  735. package/dist/types/embeds/ShadowStylesRoot.d.ts +0 -3
  736. package/dist/types/utils/sanitizeHtml.d.ts +0 -3
  737. package/dist/types/utils/useStateFromProp.d.ts +0 -9
  738. package/dist/useToastContext-CF2xonft.js +0 -21
  739. package/dist/utils-B1H_8b1P.js +0 -74
  740. package/dist/validate-wd48TLfx.js +0 -245
  741. package/dist/zh-CN-xYZH718R.js +0 -994
  742. package/dist/zh-TW-DqBBNurv.js +0 -994
  743. /package/dist/types/{core/types/AccountHolder.types.d.ts → types/accountHolder.d.ts} +0 -0
  744. /package/dist/types/{core/models → types/datasets}/currency.d.ts +0 -0
  745. /package/dist/types/{core/models → types/datasets}/province-code.d.ts +0 -0
  746. /package/dist/types/{core/models → types/datasets}/state-code.d.ts +0 -0
  747. /package/dist/types/{core/models → types}/errors/form-verification-errors.d.ts +0 -0
  748. /package/dist/types/{core/models → types}/errors/remediation-action-context.d.ts +0 -0
  749. /package/dist/types/{core/models → types}/file.d.ts +0 -0
@@ -2,58 +2,24 @@
2
2
  {
3
3
  try {
4
4
  let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4b8b06b2-0644-4e9e-a906-e14e5e300a8a", e._sentryDebugIdIdentifier = "sentry-dbid-4b8b06b2-0644-4e9e-a906-e14e5e300a8a");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c2c20178-52ca-46e1-9e49-d0ae59916244", e._sentryDebugIdIdentifier = "sentry-dbid-c2c20178-52ca-46e1-9e49-d0ae59916244");
6
6
  } catch (e) {
7
7
  }
8
8
  }
9
9
  ;
10
- import { am as CountryCodes, X as TaskTypes, q as useApiContext, b5 as useMutation, b7 as httpPost, bX as matchesRegex, bY as trimValWithOneSpace, bZ as NO_ALPHABET_REGEX, b_ as EMOJI_REGEX, b$ as hasRepeatedCharacters, c0 as isInvalidName, c1 as INDIVIDUAL_VALID_CHAR_REGEX, c2 as getFormattingRegEx, c3 as SPECIAL_CHARS, ap as resolveFieldMetadata, c4 as getSSNType, an as isEmpty, c5 as defaultFieldMetadata, c6 as defaultFieldConfig, br as defaultFieldMetadata$1, bs as fieldConfig, c7 as defaultFieldMetadata$2, z as LegalEntityType, c8 as defaultFieldConfig$1, c9 as getAgeToday, ca as euCountries, cb as getLocalizedIdDocumentTypeOptions, cc as individualApiKeyMapping, b8 as individualComponentsKeyMapping, bJ as reverseMapping, cd as getNomineeFromAssociation, aJ as createLogger, U as useAccountHolder, b as useI18nContext, $ as useAnalyticsContext, a5 as useExperimentsContext, K as useSettingsContext, ce as useProviderStatus, g as getLegalEntityCountry, bW as getAssociatedLeAnalyticsPayload, cf as addressValidators, cg as getAsyncIdNumberValidationRule, bt as getAsyncPhoneValidationRules, ch as addressFormatters, ci as setHasMotionCaptureScenario, cj as individualForms, ck as showIndividualMotionCapture, bp as getAllowedDecisionMakerRoles, a_ as datasetUtilities, cl as Individual, cm as filterOutUnwantedAssociationsIfRootLE, b1 as cloneObject, cn as mapAddressLabels, co as individualDocumentForms, cp as individualDocumentMapping, cq as individualObscuredFields, cr as drop, ak as getOwnEntityAssociations, cs as hasNomineesChanged, ct as attachNomineeToRole, cu as idVerificationProviderId, cv as doArraysMatch, bq as DecisionMakerType, bC as createFormRules, bo as getAvailableDecisionMakerRoleTypes, cw as allowedCountriesForNominee, bS as getAddressSchemaForCountry, bT as COUNTRIES_WITH_STATES_DATASET, cx as Scenarios, ax as Field, bw as Select, cy as isTruthyValidator, cz as licenseCardNumberDefaultMetadata, cA as licenseCardNumberDefaultConfig, ao as mergeFieldMetadataIntoProps, aw as createFormUtils, bx as useFormContext, at as getFieldProps, cB as idNumberFields, cC as IdentityNumber, cD as additionallIdNumberOptions, cE as MaskedInput, bM as InputDate, cF as formatDateObj, cG as DriversLicense, cH as addressFields, u as useAllowedCountries, cI as getDefaultTaxIdNumberType, F as FormHeader, av as ErrorPanel, G as Typography, aD as CountryField, bU as Address, bV as getAddressSchemaLabelsByCountry, bK as Link, cJ as IndividualIdNumberTypeSelector, cK as TaxInformationField, cL as PatriotActDisclosure, au as nameFields, cM as decisionMakerRoleFields, cN as nomineeFields, cO as contactDetailFields, C as Alert, aS as ContextGuidance, aZ as TrustedFieldsProvider, cP as DecisionMakerRole, cQ as NomineeDecisionMakerRole, aC as Name, bg as InputText, bu as ContactDetails, bB as keysOf, aY as objectsDeepEqual, bz as isEmpty$1, cR as RadioWithLabel, bi as listToRecord, Z as Button, ba as Svg, cS as pick, cT as IdVerification, _ as IconButton, c as useDataset, d as datasetIdentifier, L as Loader, cU as IdDocumentManualUpload, cV as idDocumentUploadFields, cW as useFormRouterContext, by as getFormProps, bA as useCapabilities, cX as setShowIndividualMotionCapture, cY as shouldShowMotionCapture, cZ as hasMotionCaptureScenario, c_ as MemoizedProofOfRelationship, c$ as MemoizedDocumentUpload, d0 as MemoizedProofOfResidencyUpload, bb as useQueryClient } from "./StoreProvider-COHi02bX.js";
11
10
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
12
11
  import { useMemo, useState, useEffect, useCallback } from "preact/hooks";
13
- import { e as useScenarios, u as useScenarioConfiguration, i as isValidationError, p as processValidationErrors, d as isMaintenanceModeError } from "./processValidationErrors-RYlNmxB9.js";
14
- import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-By6uwPUg.js";
15
- import { c as contactDetailsValidationRules, u as useValidatePhoneNumberImperatively } from "./validate-Dyb8B4Hi.js";
16
- import { F as FormContextProvider, a as FormFlow } from "./FormFlow-CZgc09E3.js";
17
- import { u as useToastContext } from "./useToastContext-CF2xonft.js";
18
- import { g as getPropsFromConfigurations, c as composePerScenarioFormConfigurations } from "./process-field-configurations-DugpEY9k.js";
19
- import { a as useSingpassMyInfoLogin, P as ProviderButton } from "./ProviderButton-vD5DUJaN.js";
20
- import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer, t as trackNavigation } from "./dropinUtils-Bk0T79SK.js";
21
- import { u as useMultiForm } from "./useMultiForm-Lh2i5tRJ.js";
22
- import { b as getIdDocument, g as getDocument, c as createDocumentRequest, d as documentApiUtils, m as mergeAttachments, a as getFileExtention } from "./documentUtils-51iMbUyU.js";
23
- import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-UNUNInq5.js";
24
- import { l as localizeDateString } from "./localizeDateString-KlstHAcM.js";
25
- import { o as omitObscuredFieldsIfUnchanged } from "./omitObscuredFieldsIfUnchanged-DhCrqm4T.js";
26
- import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-a4kJDPzY.js";
27
- import { f as formatObject } from "./utils-B1H_8b1P.js";
28
- import { f as fieldsPerScenario, a as isLowRiskCountry } from "./individualFormConfig-BrFLPTfr.js";
29
- import { C as Confirm } from "./Confirm-okTxq40p.js";
30
- import { M as Modal } from "./Modal-CRNejb1x.js";
31
- import { S as Spacer } from "./Spacer-BK3jDget.js";
32
- import { T as TileGroup } from "./TileGroup-B1IymoWv.js";
33
- import { m as mapExistingFile, g as getPageName, a as getPage } from "./mapExistingFile-BE74t9jV.js";
34
- const KEY_MARKETS = [
35
- CountryCodes.UnitedStates,
36
- CountryCodes.UnitedKingdom,
37
- CountryCodes.Germany,
38
- CountryCodes.France,
39
- CountryCodes.Canada,
40
- CountryCodes.Australia
41
- ];
42
- function isOnfidoAutofillFlowEnabled(country, taskType, isExperimentEnabled) {
43
- const market = KEY_MARKETS.includes(country) ? "KeyMarkets" : "AdditionalMarkets";
44
- let type;
45
- switch (taskType) {
46
- case TaskTypes.INDIVIDUAL:
47
- type = "PureIndividuals";
48
- break;
49
- case TaskTypes.DECISION_MAKER:
50
- type = "DecisionMakers";
51
- break;
52
- default:
53
- return false;
54
- }
55
- return isExperimentEnabled(`EnableAutofillFlowFor${type}In${market}`);
56
- }
12
+ import { p as useApiContext, bi as useMutation, bk as httpPost, bX as matchesRegex, bY as trimValWithOneSpace, bZ as NO_ALPHABET_REGEX, b_ as EMOJI_REGEX, b$ as hasRepeatedCharacters, c0 as isInvalidName, c1 as INDIVIDUAL_VALID_CHAR_REGEX, c2 as getFormattingRegEx, c3 as SPECIAL_CHARS, c4 as standardKatakanaValidator, c5 as standardKanjiValidator, at as resolveFieldMetadata, aq as CountryCodes, c6 as getSSNType, ar as isEmpty, c7 as defaultFieldMetadata, c8 as defaultFieldConfig, c9 as defaultFieldMetadata$1, ca as fieldConfig, X as TaskTypes, cb as taxInformationDefaultFieldMetadata, y as LegalEntityType, cc as taxInformationDefaultFieldConfig, cd as getAgeToday, ce as euCountries, cf as getIdDocument, cg as getDocument, ch as mapExistingFile, ci as getPageName, cj as getLocalizedIdDocumentTypeOptions, ck as getPage, cl as createDocumentRequest, bA as formatObject, cm as individualApiKeyMapping, bn as individualComponentsKeyMapping, bz as reverseMapping, cn as getNomineeFromAssociation, co as drop, Y as createLogger, U as useAccountHolder, ap as useI18nContext, a0 as useAnalyticsContext, a6 as useToastContext, a7 as useExperimentsContext, K as useSettingsContext, cp as documentApiUtils, cq as useProviderStatus, g as getLegalEntityCountry, bP as getAssociatedLeAnalyticsPayload, cr as addressValidators, cs as getAsyncIdNumberValidationRule, ct as getAsyncPhoneValidationRules, cu as addressFormatters, cv as useScenarios, cw as setHasMotionCaptureScenario, cx as useScenarioConfiguration, cy as getPropsFromConfigurations, cz as individualForms, cA as showIndividualMotionCapture, bQ as getRequiredForms, bR as addValidityToForms, cB as getAllowedDecisionMakerRoles, b3 as datasetUtilities, bS as useFormComposer, bT as trackNavigation, cC as Individual, cD as composePerScenarioFormConfigurations, cE as omitObscuredFieldsIfUnchanged, cF as filterOutUnwantedAssociationsIfRootLE, bU as isValidationError, bV as processValidationErrors, bW as isMaintenanceModeError, bd as cloneObject, cG as mapAddressLabels, cH as individualDocumentForms, cI as individualDocumentMapping, cJ as individualObscuredFields, cK as mergeAttachments, cL as getFileExtention, al as getOwnEntityAssociations, cM as hasNomineesChanged, cN as attachNomineeToRole, cO as idVerificationProviderId, cP as doArraysMatch, G as Typography, _ as Button, aB as Field, cQ as DecisionMakerType, cR as createFormRules, cS as getAvailableDecisionMakerRoleTypes, cT as allowedCountriesForNominee, bL as getAddressSchemaForCountry, bM as COUNTRIES_WITH_STATES_DATASET, cU as Scenarios, cV as isLowRiskCountry, bu as Select, cW as isTruthyValidator, cX as licenseCardNumberDefaultMetadata, cY as licenseCardNumberDefaultConfig, as as mergeFieldMetadataIntoProps, aA as createFormUtils, bK as useFormContext, ax as getFieldProps, cZ as idNumberFields, c_ as IdentityNumber, c$ as additionallIdNumberOptions, d0 as MaskedInput, bG as InputDate, d1 as formatDateObj, d2 as DriversLicense, d3 as addressFields, u as useAllowedCountries, M as SettingNames, d4 as getDefaultTaxIdNumberType, F as FormHeader, az as ErrorPanel, aH as CountryField, bN as Address, bO as getAddressSchemaLabelsByCountry, bD as Link, bb as Confirm, d5 as getAgeRangeForLegalRepresentative, d6 as IndividualIdNumberTypeSelector, d7 as TaxInformationField, d8 as PatriotActDisclosure, d9 as isLegalRepresentativeNeeded, ay as nameFields, da as decisionMakerRoleFields, db as nomineeFields, dc as contactDetailFields, B as Alert, aX as ContextGuidance, b2 as TrustedFieldsProvider, dd as DecisionMakerRole, de as NomineeDecisionMakerRole, df as LocalizedNameFields, bE as InputText, dg as ContactDetails, dh as keysOf, b1 as objectsDeepEqual, di as isEmpty$1, dj as RadioWithLabel, dk as listToRecord, b5 as Modal, bp as Svg, dl as pick, dm as IdVerification, ba as Spacer, $ as IconButton, c as useDataset, d as datasetIdentifier, L as Loader, dn as isPersonUnderAge, dp as IdDocumentManualUpload, C as translateStringOrObject, a as useTranslation, aV as Trans, dq as idDocumentUploadFields, dr as useFormRouterContext, ds as getFormProps, dt as useCapabilities, du as hasMotionCaptureScenario, dv as setShowIndividualMotionCapture, dw as shouldShowMotionCapture, dx as MemoizedProofOfRelationship, dy as MemoizedDocumentUpload, dz as MemoizedProofOfResidencyUpload, dA as individualOnfidoApiKeyMapping, dB as individualOnfidoBaseMapping, bq as useQueryClient, dC as individualOnfidoDocumentMapping, dD as individualOnfidoObscuredFields } from "./StoreProvider-ClKLaHzy.js";
13
+ import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-D8dw9Oc3.js";
14
+ import { c as contactDetailsValidationRules, u as useValidatePhoneNumberImperatively } from "./validate-CeF0YKvL.js";
15
+ import { F as FormContextProvider, a as FormFlow } from "./FormFlow-DjvdNEiV.js";
16
+ import { u as useSingpassMyInfoLogin, P as ProviderButton } from "./ProviderButton-B58n0cRC.js";
17
+ import { u as useMultiForm } from "./useMultiForm-KQwxav4F.js";
18
+ import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-BY--eXBQ.js";
19
+ import { l as localizeDateString } from "./localizeDateString-CKCBXzSn.js";
20
+ import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-CCnLDGvk.js";
21
+ import { signal, computed } from "@preact/signals";
22
+ import { T as TileGroup } from "./TileGroup-BtE472I1.js";
57
23
  const verifyIdNumber = async (legalEntityId, baseUrl, data) => {
58
24
  return await httpPost(
59
25
  {
@@ -139,6 +105,38 @@ const onfidoDocumentTypeMapping = [
139
105
  { id: "identityCard", name: "identityCard", hasBackPage: true },
140
106
  { id: "passport", name: "passport", hasBackPage: false }
141
107
  ];
108
+ const jaHaniNameValidationRules = {
109
+ jaHaniFirstName: [
110
+ {
111
+ modes: ["blur"],
112
+ validate: (input) => standardKanjiValidator(input),
113
+ errorMessage: "nameMustContainLetters"
114
+ }
115
+ ],
116
+ jaHaniLastName: [
117
+ {
118
+ modes: ["blur"],
119
+ validate: (input) => standardKanjiValidator(input),
120
+ errorMessage: "nameMustContainLetters"
121
+ }
122
+ ]
123
+ };
124
+ const jaKanaNameValidationRules = {
125
+ jaKanaFirstName: [
126
+ {
127
+ modes: ["blur"],
128
+ validate: (input) => standardKatakanaValidator(input),
129
+ errorMessage: "nameMustContainLetters"
130
+ }
131
+ ],
132
+ jaKanaLastName: [
133
+ {
134
+ modes: ["blur"],
135
+ validate: (input) => standardKatakanaValidator(input),
136
+ errorMessage: "nameMustContainLetters"
137
+ }
138
+ ]
139
+ };
142
140
  const isNotOutOfRangeBirthDateValidatorRule$1 = {
143
141
  modes: ["blur"],
144
142
  validate: (birthDate) => !isEmpty(birthDate) && new Date(birthDate) < /* @__PURE__ */ new Date(),
@@ -181,53 +179,51 @@ const personalDetailsValidators = ({
181
179
  existingIdNumber,
182
180
  formVerificationErrors,
183
181
  taxIdNumberType
184
- }) => {
185
- var _a, _b;
186
- return {
187
- taxInformation: (_a = resolveFieldMetadata(
188
- defaultFieldConfig$1[country],
189
- {
190
- taxIdNumberType,
191
- companyType: LegalEntityType.INDIVIDUAL
192
- },
193
- defaultFieldMetadata$2
194
- )) == null ? void 0 : _a.validators,
195
- birthDate: (() => {
196
- const baseValidators = [isNotOutOfRangeBirthDateValidatorRule$1];
197
- if (isSettingEnabled("enforceLegalAge")) {
182
+ }) => ({
183
+ taxInformation: resolveFieldMetadata(
184
+ taxInformationDefaultFieldConfig[country],
185
+ {
186
+ taxIdNumberType,
187
+ companyType: LegalEntityType.INDIVIDUAL
188
+ },
189
+ taxInformationDefaultFieldMetadata
190
+ )?.validators,
191
+ birthDate: (() => {
192
+ const baseValidators = [isNotOutOfRangeBirthDateValidatorRule$1];
193
+ if (isSettingEnabled("enforceLegalAge")) {
194
+ return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
195
+ }
196
+ if (isExperimentEnabled("EnableAgeVerification")) {
197
+ if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
198
198
  return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
199
199
  }
200
- if (isExperimentEnabled("EnableAgeVerification")) {
201
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
202
- return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
203
- }
204
- return [...baseValidators, getCountrySpecificMinimumAgeValidationRule$1(country)];
205
- }
206
- return baseValidators;
207
- })(),
208
- ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
209
- ...contactDetailsValidationRules,
210
- phoneNumber: (_b = resolveFieldMetadata(
211
- fieldConfig[phonePrefix ?? country],
212
- {},
213
- defaultFieldMetadata$1
214
- )) == null ? void 0 : _b.validators,
215
- idNumber: (() => {
216
- var _a2;
217
- const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
218
- return idNumberExempt ? {
219
- validate: () => {
220
- return idNumberExempt || !isEmpty(idNumber);
221
- },
222
- modes: ["blur"]
223
- } : (_a2 = resolveFieldMetadata(
224
- defaultFieldConfig[country],
225
- { idNumberType: derivedIdNumberType },
226
- defaultFieldMetadata
227
- )) == null ? void 0 : _a2.validators;
228
- })()
229
- };
230
- };
200
+ return [...baseValidators, getCountrySpecificMinimumAgeValidationRule$1(country)];
201
+ }
202
+ return baseValidators;
203
+ })(),
204
+ ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
205
+ ...contactDetailsValidationRules,
206
+ phoneNumber: resolveFieldMetadata(
207
+ fieldConfig[phonePrefix ?? country],
208
+ {},
209
+ defaultFieldMetadata$1
210
+ )?.validators,
211
+ idNumber: (() => {
212
+ const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
213
+ return idNumberExempt ? {
214
+ validate: () => {
215
+ return idNumberExempt || !isEmpty(idNumber);
216
+ },
217
+ modes: ["blur"]
218
+ } : resolveFieldMetadata(
219
+ defaultFieldConfig[country],
220
+ { idNumberType: derivedIdNumberType },
221
+ defaultFieldMetadata
222
+ )?.validators;
223
+ })(),
224
+ ...jaHaniNameValidationRules,
225
+ ...jaKanaNameValidationRules
226
+ });
231
227
  const mandateIdVerificationForMotionCapture = (showMotionCapture, derivedProps) => {
232
228
  if (!derivedProps) {
233
229
  return void 0;
@@ -244,27 +240,27 @@ const mandateIdVerificationForMotionCapture = (showMotionCapture, derivedProps)
244
240
  return copiedDerivedProps;
245
241
  };
246
242
  const mapApiDocumentToIndividualDocuments = (entityId) => {
247
- const idDocument = getIdDocument(entityId);
243
+ const idDocument2 = getIdDocument(entityId);
248
244
  const proofOfResidency = getDocument(entityId, "proofOfResidency");
249
245
  const proofOfNationalId = getDocument(entityId, "proofOfNationalIdNumber");
250
246
  const proofOfRelationship = getDocument(entityId, "proofOfRelationship");
251
247
  return {
252
- idDocument: idDocument ? mapApiIdDocumentToSchema(idDocument) : void 0,
248
+ idDocument: idDocument2 ? mapApiIdDocumentToSchema(idDocument2) : void 0,
253
249
  proofOfResidency: proofOfResidency ? { proofOfResidency: [mapExistingFile(getPageName(proofOfResidency))] } : void 0,
254
250
  proofOfNationalId: proofOfNationalId ? { proofOfNationalId: [mapExistingFile(getPageName(proofOfNationalId))] } : void 0,
255
251
  proofOfRelationship: proofOfRelationship ? { proofOfRelationship: [mapExistingFile(getPageName(proofOfRelationship))] } : void 0
256
252
  };
257
253
  };
258
- const mapApiIdDocumentToSchema = (idDocument) => {
259
- const { type, attachments, modificationDate } = idDocument;
254
+ const mapApiIdDocumentToSchema = (idDocument2) => {
255
+ const { type, attachments, modificationDate } = idDocument2;
260
256
  const { hasBackPage } = getLocalizedIdDocumentTypeOptions().find(({ id }) => id === type);
261
257
  let frontPage;
262
258
  let backPage;
263
- if ((attachments == null ? void 0 : attachments.length) === 1) {
264
- frontPage = getPage(idDocument);
259
+ if (attachments?.length === 1) {
260
+ frontPage = getPage(idDocument2);
265
261
  } else {
266
- frontPage = hasBackPage ? getPage(idDocument, "front") : getPage(idDocument);
267
- backPage = hasBackPage ? getPage(idDocument, "back") : void 0;
262
+ frontPage = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
263
+ backPage = hasBackPage ? getPage(idDocument2, "back") : void 0;
268
264
  }
269
265
  return {
270
266
  ...frontPage ? { idFrontPage: [mapExistingFile(frontPage.pageName ?? "")] } : {},
@@ -274,32 +270,31 @@ const mapApiIdDocumentToSchema = (idDocument) => {
274
270
  };
275
271
  };
276
272
  const mapIndividualDocumentToApiDocument = async (data, entityId) => {
277
- var _a, _b;
278
273
  if (!data) return void 0;
279
274
  const { proofOfNationalId, proofOfResidency, proofOfRelationship } = data;
280
- const idDocument = "idDocument" in data ? data.idDocument : data.manualIdUpload;
275
+ const idDocument2 = "idDocument" in data ? data.idDocument : data.manualIdUpload;
281
276
  const entityType = "legalEntity";
282
277
  const documents = await Promise.all([
283
- (idDocument == null ? void 0 : idDocument.idFrontPage) ? createDocumentRequest({
278
+ idDocument2?.idFrontPage ? createDocumentRequest({
284
279
  entityId,
285
280
  entityType,
286
- documentType: idDocument.idDocumentType,
287
- page1: (_a = idDocument.idFrontPage) == null ? void 0 : _a[0],
288
- page2: (_b = idDocument.idBackPage) == null ? void 0 : _b[0]
281
+ documentType: idDocument2.idDocumentType,
282
+ page1: idDocument2.idFrontPage?.[0],
283
+ page2: idDocument2.idBackPage?.[0]
289
284
  }) : void 0,
290
- (proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) ? createDocumentRequest({
285
+ proofOfNationalId?.proofOfNationalId ? createDocumentRequest({
291
286
  entityId,
292
287
  entityType,
293
288
  documentType: "proofOfNationalIdNumber",
294
289
  page1: proofOfNationalId.proofOfNationalId[0]
295
290
  }) : void 0,
296
- (proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) ? createDocumentRequest({
291
+ proofOfResidency?.proofOfResidency ? createDocumentRequest({
297
292
  entityId,
298
293
  entityType,
299
294
  documentType: "proofOfResidency",
300
295
  page1: proofOfResidency.proofOfResidency[0]
301
296
  }) : void 0,
302
- (proofOfRelationship == null ? void 0 : proofOfRelationship.proofOfRelationship) ? createDocumentRequest({
297
+ proofOfRelationship?.proofOfRelationship ? createDocumentRequest({
303
298
  entityId,
304
299
  entityType,
305
300
  documentType: "proofOfRelationship",
@@ -349,12 +344,33 @@ const adjustIdentificationData = (data, apiData) => {
349
344
  ...identificationData,
350
345
  expiryDate: "",
351
346
  cardNumber: "",
352
- nationalIdExempt: (apiData == null ? void 0 : apiData.nationalIdExempt) ?? !idNumber
347
+ nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
353
348
  };
354
349
  }
355
350
  };
351
+ const mapNameLocalization = (data) => {
352
+ const localization = [];
353
+ if (data.jaHaniFirstName || data.jaHaniLastName) {
354
+ localization.push({
355
+ script: "ja-Hani",
356
+ fields: {
357
+ firstName: data.jaHaniFirstName,
358
+ lastName: data.jaHaniLastName
359
+ }
360
+ });
361
+ }
362
+ if (data.jaKanaFirstName || data.jaKanaLastName) {
363
+ localization.push({
364
+ script: "ja-Kana",
365
+ fields: {
366
+ firstName: data.jaKanaFirstName,
367
+ lastName: data.jaKanaLastName
368
+ }
369
+ });
370
+ }
371
+ return localization;
372
+ };
356
373
  const mapIndividualToLegalEntity = (data) => {
357
- var _a;
358
374
  const requestObj = {
359
375
  ...formatObject(data, individualApiKeyMapping)
360
376
  };
@@ -365,7 +381,11 @@ const mapIndividualToLegalEntity = (data) => {
365
381
  personalDetails,
366
382
  requestObj.individual.identificationData
367
383
  );
368
- if ((_a = personalDetails.phoneNumber) == null ? void 0 : _a.number) {
384
+ const localization = mapNameLocalization(personalDetails);
385
+ if (localization.length) {
386
+ requestObj.individual.name.localization = localization;
387
+ }
388
+ if (personalDetails.phoneNumber?.number) {
369
389
  requestObj.individual.phone = {
370
390
  number: personalDetails.phoneNumber.number,
371
391
  type: "mobile"
@@ -376,7 +396,6 @@ const mapIndividualToLegalEntity = (data) => {
376
396
  return requestObj;
377
397
  };
378
398
  const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity, isLegalRepresentative) => {
379
- var _a, _b, _c, _d, _e, _f, _g;
380
399
  let individualData = formatObject(
381
400
  legalEntity,
382
401
  individualComponentsKeyMapping
@@ -384,49 +403,248 @@ const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeed
384
403
  individualData = {
385
404
  ...individualData,
386
405
  personalDetails: {
387
- ...individualData == null ? void 0 : individualData.personalDetails,
406
+ ...individualData?.personalDetails,
388
407
  ...isChangingType && {
389
408
  firstName: "",
390
409
  lastName: ""
391
410
  }
392
411
  }
393
412
  };
394
- if (!((_a = individualData.personalDetails) == null ? void 0 : _a.idNumberExempt)) {
413
+ if (!individualData.personalDetails?.idNumberExempt) {
395
414
  individualData.personalDetails.idNumberExempt = false;
396
415
  }
397
416
  const apiIdentityTypeToIdentityTypeMap = reverseMapping(
398
417
  getIdentityTypeToApiIdentityTypeMap(individualData.personalDetails)
399
418
  );
400
- if ((_c = (_b = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _b.identificationData) == null ? void 0 : _c.type) {
419
+ if (legalEntity?.individual?.identificationData?.type) {
401
420
  individualData.personalDetails.typeOfIdentity = apiIdentityTypeToIdentityTypeMap[legalEntity.individual.identificationData.type];
402
421
  }
403
- if ((_d = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _d.length) {
422
+ if (legalEntity?.documentDetails?.length) {
404
423
  individualData = {
405
424
  ...individualData,
406
- ...mapApiDocumentToIndividualDocuments(legalEntity == null ? void 0 : legalEntity.id)
425
+ ...mapApiDocumentToIndividualDocuments(legalEntity?.id)
407
426
  };
408
427
  }
409
- if (!(parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations)) {
428
+ if (legalEntity?.individual?.residentialAddress.country === "JP" && legalEntity.individual?.name?.localization) {
429
+ const configs = [
430
+ {
431
+ script: "ja-Hani",
432
+ mappingFunction: (l) => ({
433
+ jaHaniFirstName: l.fields?.firstName,
434
+ jaHaniLastName: l.fields?.lastName
435
+ })
436
+ },
437
+ {
438
+ script: "ja-Kana",
439
+ mappingFunction: (l) => ({
440
+ jaKanaFirstName: l.fields?.firstName,
441
+ jaKanaLastName: l.fields?.lastName
442
+ })
443
+ }
444
+ ];
445
+ configs.forEach((config) => {
446
+ const localizationToMap = legalEntity.individual?.name.localization?.find(
447
+ (l) => l.script === config.script
448
+ );
449
+ if (localizationToMap) {
450
+ individualData.personalDetails = {
451
+ ...individualData.personalDetails,
452
+ ...config.mappingFunction(localizationToMap)
453
+ };
454
+ }
455
+ });
456
+ }
457
+ if (!parentLegalEntity?.entityAssociations) {
410
458
  return individualData;
411
459
  }
412
- const associations = ((_e = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _e.filter((ea) => ea.legalEntityId === (legalEntity == null ? void 0 : legalEntity.id))) ?? [];
460
+ const associations = parentLegalEntity?.entityAssociations?.filter((ea) => ea.legalEntityId === legalEntity?.id) ?? [];
413
461
  if (isRoleFieldNeeded) {
414
462
  individualData.personalDetails.role = associations.map((ea) => ea.type);
415
- individualData.personalDetails.jobTitle = (_f = associations.find(
463
+ individualData.personalDetails.jobTitle = associations.find(
416
464
  ({ jobTitle }) => Boolean(jobTitle)
417
- )) == null ? void 0 : _f.jobTitle;
465
+ )?.jobTitle;
418
466
  }
419
467
  individualData.personalDetails = getNomineeFromAssociation(
420
468
  associations,
421
469
  individualData.personalDetails
422
470
  );
423
471
  if (isLegalRepresentative) {
424
- individualData.personalDetails.relationship = (_g = associations.find(
472
+ individualData.personalDetails.relationship = associations.find(
425
473
  ({ relationship }) => Boolean(relationship)
426
- )) == null ? void 0 : _g.relationship;
474
+ )?.relationship;
427
475
  }
428
476
  return individualData;
429
477
  };
478
+ const identityBase = {
479
+ role: {
480
+ rule: "requiredIfDecisionMakerTask"
481
+ },
482
+ firstName: {
483
+ rule: "REQUIRED"
484
+ },
485
+ lastName: {
486
+ rule: "REQUIRED"
487
+ },
488
+ birthDate: {
489
+ rule: "REQUIRED"
490
+ },
491
+ phoneNumber: {
492
+ rules: ["requiredIfPhoneScenarioDisabled", "contactsIfRequiredForRole"]
493
+ },
494
+ email: {
495
+ rule: "contactsIfRequiredForRole"
496
+ },
497
+ jobTitle: {
498
+ rule: "jobTitleIfRequiredForRole"
499
+ },
500
+ nationality: {
501
+ rule: "nationalityIfRequiredForRole"
502
+ },
503
+ address: {
504
+ rule: "addressIfRequiredForCountry"
505
+ },
506
+ otherAddressInformation: {
507
+ rule: "otherAddressInfoIfRequiredForCountry"
508
+ },
509
+ country: {
510
+ rule: "REQUIRED"
511
+ },
512
+ postalCode: {
513
+ rule: "postalCodeIfRequiredForCountry"
514
+ },
515
+ city: {
516
+ rule: "cityIfRequiredForCountry"
517
+ },
518
+ stateOrProvince: {
519
+ rule: "stateOrProvinceIfRequiredForCountry"
520
+ },
521
+ residencyCountry: {
522
+ rule: "REQUIRED"
523
+ },
524
+ proofOfResidency: {
525
+ rule: "isProofOfResidencyRequired"
526
+ },
527
+ proofOfNationalId: {
528
+ rule: "isProofOfNationalIdRequired"
529
+ },
530
+ relationship: {
531
+ rule: "legalRepresentativeRelationshipRequired"
532
+ },
533
+ proofOfRelationship: {
534
+ rule: "isProofOfRelationshipRequired"
535
+ },
536
+ nomineeDirector: {
537
+ rule: "nomineeDirectorRequiredForCountry"
538
+ },
539
+ nomineeShareholder: {
540
+ rule: "nomineeShareHolderRequiredForCountry"
541
+ },
542
+ jaHaniFirstName: {
543
+ rule: "japaneseFirstAndLastNames"
544
+ },
545
+ jaHaniLastName: {
546
+ rule: "japaneseFirstAndLastNames"
547
+ },
548
+ jaKanaFirstName: {
549
+ rule: "japaneseFirstAndLastNames"
550
+ },
551
+ jaKanaLastName: {
552
+ rule: "japaneseFirstAndLastNames"
553
+ },
554
+ idDocumentType: {
555
+ // If the user has a missing ID error and chooses manual flow
556
+ rule: "isManualIdFlowAndHasMissingData"
557
+ }
558
+ };
559
+ const identityNumber$1 = {
560
+ idNumber: {
561
+ rule: "idNumberRules",
562
+ obscured: true
563
+ },
564
+ idNumberExempt: {
565
+ rules: ["idNumberExemptIfApplicableCountry", "isDirectorIdNumberRequiredForCountry"]
566
+ },
567
+ idDocumentType: {
568
+ rule: "manualIdDocumentRequired"
569
+ },
570
+ idFrontPage: {
571
+ rule: "idFrontPageIfManualUpload"
572
+ },
573
+ idBackPage: {
574
+ rule: "backPageIfRequiredForDocumentType"
575
+ },
576
+ idVerificationMethod: {
577
+ rule: "idVerificationRequired"
578
+ },
579
+ instantIdVerificationData: {
580
+ rule: "instantVerificationDataRule"
581
+ }
582
+ };
583
+ const additionalIdentityInfo$1 = {
584
+ typeOfIdentity: {
585
+ rules: ["requiredIfCountryUsesMultipleTypesOfIdentity", "isDirectorIdNumberRequiredForCountry"]
586
+ },
587
+ issuerState: {
588
+ rule: "issuerStateRequired"
589
+ },
590
+ licenseCardNumber: {
591
+ rule: "licenseCardNumberRules"
592
+ },
593
+ expiryDate: {
594
+ rule: "expiryDateRequired"
595
+ }
596
+ };
597
+ const idDocument = {
598
+ idVerificationMethod: {
599
+ rule: "REQUIRED"
600
+ },
601
+ idDocumentType: {
602
+ rule: "REQUIRED"
603
+ },
604
+ idFrontPage: {
605
+ rule: "idFrontPageIfManualUpload"
606
+ },
607
+ idBackPage: {
608
+ rule: "backPageIfRequiredForDocumentType"
609
+ }
610
+ };
611
+ const nationality$1 = {
612
+ nationality: {
613
+ rule: "REQUIRED"
614
+ }
615
+ };
616
+ const phoneNumberBase$1 = {
617
+ phoneNumber: {
618
+ rule: "contactsIfRequiredForRole"
619
+ }
620
+ };
621
+ const taxInformationBase$1 = {
622
+ taxInformation: { rule: "countryUsesTaxId" }
623
+ };
624
+ const fieldsPerScenario = {
625
+ L0: drop("address", "birthDate").from(identityBase),
626
+ L1: identityBase,
627
+ L_TAXINFO: { ...identityBase, ...taxInformationBase$1 },
628
+ L1_ID: {
629
+ ...identityBase,
630
+ ...identityNumber$1,
631
+ ...additionalIdentityInfo$1
632
+ },
633
+ L1_IDO: {
634
+ // TODO: change idNumber rule to optional once optional fields are implemented
635
+ ...identityBase,
636
+ ...identityNumber$1,
637
+ ...additionalIdentityInfo$1
638
+ },
639
+ L1_NAT: {
640
+ ...identityBase,
641
+ ...identityNumber$1,
642
+ ...additionalIdentityInfo$1,
643
+ ...nationality$1
644
+ },
645
+ L1_IDDOC: idDocument,
646
+ L_PH: phoneNumberBase$1
647
+ };
430
648
  const parseIndividualScenarios = (scenarios) => composePerScenarioFormConfigurations(scenarios, fieldsPerScenario);
431
649
  const parseConfiguration$1 = ({ scenarios }) => parseIndividualScenarios(scenarios);
432
650
  const logger$4 = createLogger();
@@ -446,7 +664,6 @@ function IndividualDropin({
446
664
  trustedFieldsProvider,
447
665
  trustedRoles
448
666
  }) {
449
- var _a, _b, _c, _d, _e, _f;
450
667
  const { baseUrl, rootLegalEntityId } = useApiContext();
451
668
  const { accountHolder, setAccountHolder } = useAccountHolder();
452
669
  const { i18n } = useI18nContext();
@@ -494,7 +711,7 @@ function IndividualDropin({
494
711
  const [documents, setDocuments] = useState();
495
712
  const [existingAttachments, setExistingAttachments] = useState();
496
713
  const [country, setCountry] = useState(
497
- ((_a = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _a.residencyCountry) ?? parentCountry
714
+ dataFromResponse?.personalDetails?.residencyCountry ?? parentCountry
498
715
  );
499
716
  const [hideFooter, setHideFooter] = useState(false);
500
717
  const [derivedProps, setDerivedProps] = useState();
@@ -525,29 +742,26 @@ function IndividualDropin({
525
742
  });
526
743
  }, []);
527
744
  const individualFieldValidations = useCallback(
528
- (data2) => {
529
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m;
530
- return {
531
- personalDetails: personalDetailsValidators({
532
- country: ((_a2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? country,
533
- isExperimentEnabled,
534
- isSettingEnabled,
535
- taskType,
536
- idNumberType: (_b2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _b2.typeOfIdentity,
537
- phonePrefix: (_d2 = (_c2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _c2.phoneNumber) == null ? void 0 : _d2.phoneCountryCode,
538
- idNumberExempt: (_e2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _e2.idNumberExempt,
539
- idNumber: (_f2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _f2.idNumber,
540
- existingIdNumber: (_g = dataFromResponse.personalDetails) == null ? void 0 : _g.idNumber,
541
- formVerificationErrors: (_h = propProblems == null ? void 0 : propProblems.verificationErrors) == null ? void 0 : _h.personalDetails,
542
- taxIdNumberType: ((_j = (_i = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _i.taxInformation) == null ? void 0 : _j.length) ? (_l = (_k = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _k.taxInformation[0]) == null ? void 0 : _l.type : void 0
543
- }),
544
- address: addressValidators({
545
- isExperimentEnabled,
546
- country: ((_m = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _m.residencyCountry) ?? country,
547
- i18n
548
- })
549
- };
550
- },
745
+ (data2) => ({
746
+ personalDetails: personalDetailsValidators({
747
+ country: data2?.personalDetails?.residencyCountry ?? country,
748
+ isExperimentEnabled,
749
+ isSettingEnabled,
750
+ taskType,
751
+ idNumberType: data2?.personalDetails?.typeOfIdentity,
752
+ phonePrefix: data2?.personalDetails?.phoneNumber?.phoneCountryCode,
753
+ idNumberExempt: data2?.personalDetails?.idNumberExempt,
754
+ idNumber: data2?.personalDetails?.idNumber,
755
+ existingIdNumber: dataFromResponse.personalDetails?.idNumber,
756
+ formVerificationErrors: propProblems?.verificationErrors?.personalDetails,
757
+ taxIdNumberType: data2?.personalDetails?.taxInformation?.length ? data2?.personalDetails?.taxInformation[0]?.type : void 0
758
+ }),
759
+ address: addressValidators({
760
+ isExperimentEnabled,
761
+ country: data2?.personalDetails?.residencyCountry ?? country,
762
+ i18n
763
+ })
764
+ }),
551
765
  [isExperimentEnabled, isSettingEnabled, taskType]
552
766
  );
553
767
  const validatePhoneNumber = useValidatePhoneNumberImperatively();
@@ -556,7 +770,7 @@ function IndividualDropin({
556
770
  (data2) => ({
557
771
  personalDetails: {
558
772
  phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber,
559
- idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2 == null ? void 0 : data2.personalDetails).idNumber
773
+ idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2?.personalDetails).idNumber
560
774
  }
561
775
  }),
562
776
  [getAsyncPhoneValidationRules, getAsyncIdNumberValidationRule]
@@ -581,18 +795,17 @@ function IndividualDropin({
581
795
  []
582
796
  );
583
797
  const form = useMultiForm({
584
- requiredFields: derivedProps == null ? void 0 : derivedProps.requiredFields,
798
+ requiredFields: derivedProps?.requiredFields,
585
799
  defaultData,
586
800
  rules: individualFieldValidations,
587
801
  asyncRules: individualFieldAsyncValidations,
588
- optionalFields: derivedProps == null ? void 0 : derivedProps.optionalFields,
802
+ optionalFields: derivedProps?.optionalFields,
589
803
  formatters
590
804
  });
591
805
  const { data = dataFromResponse } = form;
592
806
  useEffect(() => {
593
- var _a2;
594
- setCountry(((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? parentCountry);
595
- }, [(_b = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b.residencyCountry, parentCountry]);
807
+ setCountry(data?.personalDetails?.residencyCountry ?? parentCountry);
808
+ }, [data?.personalDetails?.residencyCountry, parentCountry]);
596
809
  const { data: scenarios } = useScenarios(country, LegalEntityType.INDIVIDUAL);
597
810
  useEffect(() => {
598
811
  if (!scenarios) return;
@@ -606,26 +819,23 @@ function IndividualDropin({
606
819
  country
607
820
  });
608
821
  const fieldsFromCustomRules = useMemo(
609
- () => {
610
- var _a2;
611
- return rules({
612
- matchingScenario,
613
- data,
614
- country: ((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? country,
615
- taskType,
616
- isExperimentEnabled,
617
- rootLegalEntity: parentLegalEntity
618
- });
619
- },
620
- [country, matchingScenario, data, taskType]
822
+ () => rules({
823
+ matchingScenario,
824
+ data,
825
+ country: data?.personalDetails?.residencyCountry ?? country,
826
+ taskType,
827
+ isExperimentEnabled,
828
+ rootLegalEntity: parentLegalEntity,
829
+ problems
830
+ }),
831
+ [country, matchingScenario, data, taskType, problems]
621
832
  );
622
833
  useEffect(() => {
623
- var _a2;
624
834
  const derivedProps2 = getPropsFromConfigurations(
625
835
  fieldConfigurations,
626
836
  individualForms,
627
- (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
628
- (problems == null ? void 0 : problems.missingData) ?? [],
837
+ problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
838
+ problems?.missingData ?? [],
629
839
  legalEntityResponse ? getFieldsWithExistingData(
630
840
  legalEntityResponse,
631
841
  individualApiKeyMapping,
@@ -641,12 +851,12 @@ function IndividualDropin({
641
851
  fieldsFromCustomRules,
642
852
  {},
643
853
  {},
644
- legalEntityResponse == null ? void 0 : legalEntityResponse.type,
854
+ legalEntityResponse?.type,
645
855
  [],
646
856
  true
647
857
  );
648
858
  const updatedDerivedProps = mandateIdVerificationForMotionCapture(
649
- (_a2 = showIndividualMotionCapture) == null ? void 0 : _a2.value,
859
+ showIndividualMotionCapture?.value,
650
860
  derivedProps2
651
861
  );
652
862
  setDerivedProps(updatedDerivedProps);
@@ -654,46 +864,41 @@ function IndividualDropin({
654
864
  fieldConfigurations,
655
865
  legalEntityResponse,
656
866
  fieldsFromCustomRules,
657
- problems == null ? void 0 : problems.remediationActions,
658
- problems == null ? void 0 : problems.missingData
867
+ problems?.remediationActions,
868
+ problems?.missingData
659
869
  ]);
660
870
  const forms = useMemo(() => {
661
- var _a2;
662
871
  const formsWithUpdatedName = {
663
872
  ...individualForms,
664
873
  idDocument: {
665
874
  ...individualForms.idDocument,
666
- formName: ((_a2 = data.idVerificationMethod) == null ? void 0 : _a2.idVerificationMethod) === "instantVerification" ? "instantVerification" : "idDocument"
875
+ formName: data.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "instantVerification" : "idDocument"
667
876
  }
668
877
  };
669
878
  const requiredForms = getRequiredForms(
670
879
  formsWithUpdatedName,
671
- derivedProps == null ? void 0 : derivedProps.requiredFields,
672
- derivedProps == null ? void 0 : derivedProps.optionalFields
880
+ derivedProps?.requiredFields,
881
+ derivedProps?.optionalFields
673
882
  ).filter(
674
883
  // Prevent showing the ID verification method step when onfido is not enabled
675
- (form2) => {
676
- var _a3, _b2;
677
- return form2.formId !== "idVerificationMethod" || ((_b2 = (_a3 = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _a3.idDocument) == null ? void 0 : _b2.enabled);
678
- }
884
+ (form2) => form2.formId !== "idVerificationMethod" || providerStatus?.statuses?.idDocument?.enabled
679
885
  );
680
886
  return addValidityToForms(requiredForms, form.isValid, problems);
681
887
  }, [
682
888
  derivedProps,
683
889
  form.isValid,
684
890
  problems,
685
- (_d = (_c = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _c.idDocument) == null ? void 0 : _d.enabled,
686
- (_e = data.idVerificationMethod) == null ? void 0 : _e.idVerificationMethod
891
+ providerStatus?.statuses?.idDocument?.enabled,
892
+ data.idVerificationMethod?.idVerificationMethod
687
893
  ]);
688
894
  if (isRoleFieldNeeded && parentLegalEntity) {
689
895
  roleTypes = getAllowedDecisionMakerRoles(parentLegalEntity, taskType);
690
896
  }
691
897
  useEffect(() => {
692
- var _a2;
693
- if (!((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.length)) return;
694
- documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse == null ? void 0 : legalEntityResponse.id).then((res) => {
898
+ if (!legalEntityResponse?.documentDetails?.length) return;
899
+ documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then((res) => {
695
900
  setExistingAttachments(res[0].attachments);
696
- setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse == null ? void 0 : legalEntityResponse.id));
901
+ setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
697
902
  }).catch(() => {
698
903
  showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
699
904
  });
@@ -706,9 +911,8 @@ function IndividualDropin({
706
911
  legalEntity,
707
912
  idDocumentType
708
913
  }) => {
709
- var _a2, _b2, _c2;
710
914
  let updatedLegalEntity;
711
- const leId = (legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newDecisionMaker == null ? void 0 : newDecisionMaker.id);
915
+ const leId = legalEntityResponse?.id || newDecisionMaker?.id;
712
916
  if (!leId) {
713
917
  updatedLegalEntity = await createLegalEntity(legalEntity);
714
918
  userEvents.addTaskEvent("Success", {
@@ -716,8 +920,8 @@ function IndividualDropin({
716
920
  actionType: "submit",
717
921
  legalEntityId: updatedLegalEntity.id,
718
922
  entityType: updatedLegalEntity.type,
719
- countryOfRegistration: ((_a2 = dataSubmitted.personalDetails) == null ? void 0 : _a2.residencyCountry) || null,
720
- roles: ((_b2 = dataSubmitted.personalDetails) == null ? void 0 : _b2.role) || null
923
+ countryOfRegistration: dataSubmitted.personalDetails?.residencyCountry || null,
924
+ roles: dataSubmitted.personalDetails?.role || null
721
925
  });
722
926
  } else {
723
927
  const patchLegalEntity = { ...drop("type").from(legalEntity), id: leId };
@@ -727,7 +931,7 @@ function IndividualDropin({
727
931
  actionType: "submit",
728
932
  legalEntityId: updatedLegalEntity.id,
729
933
  entityType: updatedLegalEntity.type,
730
- countryOfRegistration: ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.residencyCountry) || null,
934
+ countryOfRegistration: dataSubmitted.personalDetails?.residencyCountry || null,
731
935
  documentType: idDocumentType || null
732
936
  });
733
937
  }
@@ -749,10 +953,9 @@ function IndividualDropin({
749
953
  legalEntity,
750
954
  dataSubmitted
751
955
  }) => {
752
- var _a2, _b2, _c2, _d2;
753
956
  if (!isDocumentsRequired(forms2)) return;
754
- if ((_a2 = dataSubmitted.idDocument) == null ? void 0 : _a2.instantIdVerificationData) {
755
- if (((_c2 = (_b2 = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.enabled) === false) {
957
+ if (dataSubmitted.idDocument?.instantIdVerificationData) {
958
+ if (providerStatus?.statuses?.idDocument?.enabled === false) {
756
959
  throw new Error("Provider unexpectedly disabled instant verification flow");
757
960
  }
758
961
  await handleInstantIdVerificationStartCheck(
@@ -765,7 +968,7 @@ function IndividualDropin({
765
968
  legalEntity.id
766
969
  );
767
970
  if (!formattedDocuments || formattedDocuments.length === 0) {
768
- if (existingAttachments == null ? void 0 : existingAttachments.length)
971
+ if (existingAttachments?.length)
769
972
  logger$4.log(
770
973
  "User has already uploaded documents and is not changing them, nothing needs to be done"
771
974
  );
@@ -777,26 +980,24 @@ function IndividualDropin({
777
980
  }
778
981
  formattedDocuments[0].attachments = mergeAttachments(
779
982
  existingAttachments ?? [],
780
- ((_d2 = formattedDocuments[0]) == null ? void 0 : _d2.attachments) ?? []
983
+ formattedDocuments[0]?.attachments ?? []
781
984
  ).filter((attachment) => attachment.content);
782
985
  const uploadedDocuments = await documentUtils.uploadDocuments(
783
986
  formattedDocuments,
784
987
  legalEntity.id
785
988
  );
786
- uploadedDocuments == null ? void 0 : uploadedDocuments.forEach((doc) => {
787
- var _a3;
989
+ uploadedDocuments?.forEach((doc) => {
788
990
  userEvents.addTaskEvent("Success", {
789
991
  ...associatedLeTrackingParams,
790
992
  actionType: "upload",
791
993
  documentType: doc.type,
792
- fileExtention: ((_a3 = doc == null ? void 0 : doc.attachments) == null ? void 0 : _a3.map((item) => getFileExtention(item.pageName ?? ""))) ?? null
994
+ fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? null
793
995
  });
794
996
  });
795
997
  }
796
998
  };
797
999
  const hasRolesChanged = (legalEntity, existingEntityAssociations, newRoles) => {
798
- var _a2;
799
- const existingRoles = (_a2 = existingEntityAssociations == null ? void 0 : existingEntityAssociations.filter((ea) => ea.legalEntityId === legalEntity.id)) == null ? void 0 : _a2.map(({ type }) => type);
1000
+ const existingRoles = existingEntityAssociations?.filter((ea) => ea.legalEntityId === legalEntity.id)?.map(({ type }) => type);
800
1001
  return !doArraysMatch(existingRoles, newRoles);
801
1002
  };
802
1003
  const attachAssociationToParentLegalEntity = async ({
@@ -804,22 +1005,18 @@ function IndividualDropin({
804
1005
  parentLE,
805
1006
  dataSubmitted
806
1007
  }) => {
807
- var _a2, _b2, _c2, _d2, _e2, _f2;
808
- const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? (_a2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _a2.role : taskType === TaskTypes.TRUST_MEMBER_INDIVIDUAL || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL ? trustMember == null ? void 0 : trustMember.roles : null;
1008
+ const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? dataSubmitted?.personalDetails?.role : taskType === TaskTypes.TRUST_MEMBER_INDIVIDUAL || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_INDIVIDUAL ? trustMember?.roles : null;
809
1009
  const existingEntityAssociations = getOwnEntityAssociations(parentLE);
810
- if (newRoles && (hasRolesChanged(legalEntity, existingEntityAssociations, newRoles) || ((_b2 = dataFromResponse.personalDetails) == null ? void 0 : _b2.jobTitle) !== ((_c2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _c2.jobTitle) || hasNomineesChanged(dataFromResponse.personalDetails, dataSubmitted.personalDetails))) {
1010
+ if (newRoles && (hasRolesChanged(legalEntity, existingEntityAssociations, newRoles) || dataFromResponse.personalDetails?.jobTitle !== dataSubmitted?.personalDetails?.jobTitle || hasNomineesChanged(dataFromResponse.personalDetails, dataSubmitted.personalDetails))) {
811
1011
  const updatedParentLegalEntity = {
812
1012
  entityAssociations: [
813
- ...newRoles.map((role) => {
814
- var _a3;
815
- return {
816
- type: role,
817
- legalEntityId: legalEntity.id,
818
- ...DECISION_MAKER_TYPES_WITH_JOBTITLE$1.some((type) => type === role) && {
819
- jobTitle: (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _a3.jobTitle
820
- }
821
- };
822
- }) || [],
1013
+ ...newRoles.map((role) => ({
1014
+ type: role,
1015
+ legalEntityId: legalEntity.id,
1016
+ ...DECISION_MAKER_TYPES_WITH_JOBTITLE$1.some((type) => type === role) && {
1017
+ jobTitle: dataSubmitted?.personalDetails?.jobTitle
1018
+ }
1019
+ })) || [],
823
1020
  ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
824
1021
  ]
825
1022
  };
@@ -830,11 +1027,11 @@ function IndividualDropin({
830
1027
  }
831
1028
  await updateLegalEntity({ ...updatedParentLegalEntity, id: parentLE.id });
832
1029
  }
833
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity.id) || ((_d2 = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _d2.relationship) !== ((_e2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _e2.relationship))) {
1030
+ if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS && (existingEntityAssociations.every((ea) => ea.legalEntityId !== legalEntity.id) || dataFromResponse?.personalDetails?.relationship !== dataSubmitted?.personalDetails?.relationship)) {
834
1031
  const newEntityAssociation = {
835
1032
  type: "legalRepresentative",
836
1033
  legalEntityId: legalEntity.id,
837
- relationship: (_f2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _f2.relationship
1034
+ relationship: dataSubmitted?.personalDetails?.relationship
838
1035
  };
839
1036
  const updatedParentLegalEntity = {
840
1037
  entityAssociations: [newEntityAssociation, ...existingEntityAssociations]
@@ -843,7 +1040,6 @@ function IndividualDropin({
843
1040
  }
844
1041
  };
845
1042
  const onSubmit = async () => {
846
- var _a2;
847
1043
  setLoadingStatus("loading");
848
1044
  const dataSubmitted = omitObscuredFieldsIfUnchanged(
849
1045
  individualObscuredFields,
@@ -855,12 +1051,9 @@ function IndividualDropin({
855
1051
  }
856
1052
  try {
857
1053
  const legalEntity = mapIndividualToLegalEntity(dataSubmitted);
858
- const idDocumentType = (_a2 = idDocumentTypeOptions.find(
859
- ({ id }) => {
860
- var _a3;
861
- return ((_a3 = dataSubmitted == null ? void 0 : dataSubmitted.idDocument) == null ? void 0 : _a3.idDocumentType) === id;
862
- }
863
- )) == null ? void 0 : _a2.id;
1054
+ const idDocumentType = idDocumentTypeOptions.find(
1055
+ ({ id }) => dataSubmitted?.idDocument?.idDocumentType === id
1056
+ )?.id;
864
1057
  legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
865
1058
  taskType,
866
1059
  legalEntityResponse,
@@ -882,7 +1075,7 @@ function IndividualDropin({
882
1075
  }
883
1076
  setLoadingStatus("success");
884
1077
  clearToasts();
885
- externalOnSubmit == null ? void 0 : externalOnSubmit(dataSubmitted);
1078
+ externalOnSubmit?.(dataSubmitted);
886
1079
  } catch (e) {
887
1080
  logger$4.error("Failed to update individual", e);
888
1081
  if (isValidationError(e)) {
@@ -907,18 +1100,14 @@ function IndividualDropin({
907
1100
  };
908
1101
  const isDocumentsRequired = (forms2) => forms2.some((form2) => individualDocumentForms.includes(form2.formId));
909
1102
  const datasetUtils = datasetUtilities(i18n.locale);
910
- const formatIdDocument = (idDocument) => {
911
- var _a2, _b2;
912
- if (!idDocument) return void 0;
913
- const documentType = (idDocument == null ? void 0 : idDocument.instantIdVerificationData) ? onfidoDocumentTypeMapping.find(
914
- (document) => {
915
- var _a3;
916
- return ((_a3 = idDocument.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document.id;
917
- }
918
- ) : idDocumentTypeOptions.find(({ id }) => idDocument.idDocumentType === id);
1103
+ const formatIdDocument = (idDocument2) => {
1104
+ if (!idDocument2) return void 0;
1105
+ const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
1106
+ (document) => idDocument2.instantIdVerificationData?.document_front.type === document.id
1107
+ ) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
919
1108
  if (!documentType) return void 0;
920
- const frontPage = (_a2 = idDocument.idFrontPage) == null ? void 0 : _a2[0];
921
- const backPage = (_b2 = idDocument.idBackPage) == null ? void 0 : _b2[0];
1109
+ const frontPage = idDocument2.idFrontPage?.[0];
1110
+ const backPage = idDocument2.idBackPage?.[0];
922
1111
  if (!frontPage) return void 0;
923
1112
  return {
924
1113
  documentType: i18n.get(documentType.name),
@@ -931,18 +1120,17 @@ function IndividualDropin({
931
1120
  };
932
1121
  };
933
1122
  const formatFileSummaryData = ({
934
- idDocument,
1123
+ idDocument: idDocument2,
935
1124
  proofOfNationalId,
936
1125
  proofOfResidency,
937
1126
  proofOfRelationship
938
1127
  }) => {
939
- var _a2, _b2, _c2;
940
- const proofOfNationalIdFile = (_a2 = proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) == null ? void 0 : _a2[0];
941
- const proofOfResidencyFile = (_b2 = proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) == null ? void 0 : _b2[0];
942
- const proofOfRelationshipFile = (_c2 = proofOfRelationship == null ? void 0 : proofOfRelationship.proofOfRelationship) == null ? void 0 : _c2[0];
1128
+ const proofOfNationalIdFile = proofOfNationalId?.proofOfNationalId?.[0];
1129
+ const proofOfResidencyFile = proofOfResidency?.proofOfResidency?.[0];
1130
+ const proofOfRelationshipFile = proofOfRelationship?.proofOfRelationship?.[0];
943
1131
  return {
944
- ...((idDocument == null ? void 0 : idDocument.idDocumentType) || (idDocument == null ? void 0 : idDocument.instantIdVerificationData)) && {
945
- idDocument: formatIdDocument(idDocument)
1132
+ ...(idDocument2?.idDocumentType || idDocument2?.instantIdVerificationData) && {
1133
+ idDocument: formatIdDocument(idDocument2)
946
1134
  },
947
1135
  ...proofOfNationalIdFile && {
948
1136
  proofOfNationalId: {
@@ -962,14 +1150,13 @@ function IndividualDropin({
962
1150
  };
963
1151
  };
964
1152
  const formatDataForSummary = () => {
965
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h;
966
1153
  let summaryData = cloneObject(data);
967
- if ((_a2 = summaryData.personalDetails) == null ? void 0 : _a2.residencyCountry) {
1154
+ if (summaryData.personalDetails?.residencyCountry) {
968
1155
  summaryData.personalDetails.residencyCountry = datasetUtils.getCountryName(
969
1156
  summaryData.personalDetails.residencyCountry
970
1157
  );
971
1158
  }
972
- if ((_b2 = summaryData.personalDetails) == null ? void 0 : _b2.nationality) {
1159
+ if (summaryData.personalDetails?.nationality) {
973
1160
  summaryData.personalDetails.nationality = datasetUtils.getCountryName(
974
1161
  summaryData.personalDetails.nationality
975
1162
  );
@@ -981,27 +1168,24 @@ function IndividualDropin({
981
1168
  individualDocumentForms.forEach((formId) => delete summaryData[formId]);
982
1169
  summaryData = { ...summaryData, ...formatFileSummaryData(data) };
983
1170
  }
984
- if ((_c2 = summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
1171
+ if (summaryData.personalDetails?.accountHolder) {
985
1172
  summaryData.personalDetails.accountHolder = i18n.get(
986
1173
  summaryData.personalDetails.accountHolder
987
1174
  );
988
1175
  }
989
- if ((_d2 = summaryData.personalDetails) == null ? void 0 : _d2.birthDate) {
1176
+ if (summaryData.personalDetails?.birthDate) {
990
1177
  summaryData.personalDetails.birthDate = localizeDateString(
991
1178
  summaryData.personalDetails.birthDate,
992
1179
  i18n.locale
993
1180
  );
994
1181
  }
995
- if ((_e2 = summaryData.personalDetails) == null ? void 0 : _e2.phoneNumber) {
1182
+ if (summaryData.personalDetails?.phoneNumber) {
996
1183
  delete summaryData.personalDetails.phoneNumber;
997
- summaryData.personalDetails.phoneNumber = (_g = (_f2 = data.personalDetails) == null ? void 0 : _f2.phoneNumber) == null ? void 0 : _g.number;
1184
+ summaryData.personalDetails.phoneNumber = data.personalDetails?.phoneNumber?.number;
998
1185
  }
999
- if ((_h = summaryData.personalDetails) == null ? void 0 : _h.taxInformation) {
1186
+ if (summaryData.personalDetails?.taxInformation) {
1000
1187
  const taxInformation = summaryData.personalDetails.taxInformation.find(
1001
- (taxId) => {
1002
- var _a3;
1003
- return taxId.country === ((_a3 = data.personalDetails) == null ? void 0 : _a3.nationality);
1004
- }
1188
+ (taxId) => taxId.country === data.personalDetails?.nationality
1005
1189
  );
1006
1190
  if (taxInformation) {
1007
1191
  delete summaryData.personalDetails.taxInformation;
@@ -1012,7 +1196,7 @@ function IndividualDropin({
1012
1196
  };
1013
1197
  const summaryOmittedKeys = [
1014
1198
  ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
1015
- ...((_f = data == null ? void 0 : data.personalDetails) == null ? void 0 : _f.idNumberExempt) ? ["idNumber"] : []
1199
+ ...data?.personalDetails?.idNumberExempt ? ["idNumber"] : []
1016
1200
  ];
1017
1201
  const {
1018
1202
  handleNextClick,
@@ -1073,7 +1257,7 @@ function IndividualDropin({
1073
1257
  onNext: handleNextClick,
1074
1258
  onBack: handleBackClick,
1075
1259
  setHideFooter,
1076
- legalEntityId: legalEntityResponse == null ? void 0 : legalEntityResponse.id,
1260
+ legalEntityId: legalEntityResponse?.id,
1077
1261
  allowedRoles: roleTypes,
1078
1262
  shouldValidate,
1079
1263
  accountHolder,
@@ -1128,59 +1312,120 @@ const additionalPersonalDetailsValidators = ({
1128
1312
  formVerificationErrors,
1129
1313
  i18n,
1130
1314
  taxIdNumberType
1131
- }) => {
1132
- var _a;
1133
- return {
1134
- taxInformation: (_a = resolveFieldMetadata(
1135
- defaultFieldConfig$1[country],
1136
- {
1137
- taxIdNumberType,
1138
- companyType: LegalEntityType.INDIVIDUAL
1139
- },
1140
- defaultFieldMetadata$2
1141
- )) == null ? void 0 : _a.validators,
1142
- birthDate: (() => {
1143
- const baseValidators = [isNotOutOfRangeBirthDateValidatorRule];
1144
- if (isSettingEnabled("enforceLegalAge")) {
1315
+ }) => ({
1316
+ taxInformation: resolveFieldMetadata(
1317
+ taxInformationDefaultFieldConfig[country],
1318
+ {
1319
+ taxIdNumberType,
1320
+ companyType: LegalEntityType.INDIVIDUAL
1321
+ },
1322
+ taxInformationDefaultFieldMetadata
1323
+ )?.validators,
1324
+ birthDate: (() => {
1325
+ const baseValidators = [isNotOutOfRangeBirthDateValidatorRule];
1326
+ if (isSettingEnabled("enforceLegalAge")) {
1327
+ return [...baseValidators, buildMinimumAgeValidationRule(18)];
1328
+ }
1329
+ if (isExperimentEnabled("EnableAgeVerification")) {
1330
+ if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
1145
1331
  return [...baseValidators, buildMinimumAgeValidationRule(18)];
1146
1332
  }
1147
- if (isExperimentEnabled("EnableAgeVerification")) {
1148
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
1149
- return [...baseValidators, buildMinimumAgeValidationRule(18)];
1150
- }
1151
- return [...baseValidators, getCountrySpecificMinimumAgeValidationRule(country)];
1152
- }
1153
- return baseValidators;
1154
- })(),
1155
- ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
1156
- ...contactDetailsValidationRules,
1157
- idNumber: (() => {
1158
- var _a2;
1159
- const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
1160
- return idNumberExempt ? {
1161
- validate: () => {
1162
- return idNumberExempt || !isEmpty(idNumber);
1163
- },
1164
- modes: ["blur"]
1165
- } : (_a2 = resolveFieldMetadata(
1166
- defaultFieldConfig[country],
1167
- { idNumberType: derivedIdNumberType },
1168
- defaultFieldMetadata
1169
- )) == null ? void 0 : _a2.validators;
1170
- })(),
1171
- ...addressValidators({
1172
- isExperimentEnabled,
1173
- country,
1174
- i18n
1175
- })
1176
- };
1177
- };
1333
+ return [...baseValidators, getCountrySpecificMinimumAgeValidationRule(country)];
1334
+ }
1335
+ return baseValidators;
1336
+ })(),
1337
+ ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
1338
+ ...contactDetailsValidationRules,
1339
+ idNumber: (() => {
1340
+ const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
1341
+ return idNumberExempt ? {
1342
+ validate: () => {
1343
+ return idNumberExempt || !isEmpty(idNumber);
1344
+ },
1345
+ modes: ["blur"]
1346
+ } : resolveFieldMetadata(
1347
+ defaultFieldConfig[country],
1348
+ { idNumberType: derivedIdNumberType },
1349
+ defaultFieldMetadata
1350
+ )?.validators;
1351
+ })(),
1352
+ ...addressValidators({
1353
+ isExperimentEnabled,
1354
+ country,
1355
+ i18n
1356
+ })
1357
+ });
1178
1358
  const basicDetailsValidators = ({
1179
1359
  isExperimentEnabled = () => false
1180
1360
  }) => ({
1181
1361
  ...contactDetailsValidationRules,
1182
1362
  ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0
1183
1363
  });
1364
+ const guidanceQuestion = "adyen-kyc-guidance-question";
1365
+ const options = "adyen-kyc-options";
1366
+ const styles$6 = {
1367
+ guidanceQuestion,
1368
+ options
1369
+ };
1370
+ var GuidanceQuestionValues = /* @__PURE__ */ ((GuidanceQuestionValues2) => {
1371
+ GuidanceQuestionValues2["YES"] = "Yes";
1372
+ GuidanceQuestionValues2["NO"] = "No";
1373
+ return GuidanceQuestionValues2;
1374
+ })(GuidanceQuestionValues || {});
1375
+ const GuidanceQuestion = (props) => {
1376
+ const {
1377
+ descriptionLinkText,
1378
+ errorMessage,
1379
+ name,
1380
+ noLabel,
1381
+ onChange,
1382
+ onDescriptionLinkClick,
1383
+ question,
1384
+ value,
1385
+ yesLabel
1386
+ } = props;
1387
+ const { i18n } = useI18nContext();
1388
+ const userEvents = useAnalyticsContext();
1389
+ const handleChange = (selectedValue) => {
1390
+ userEvents.addFieldEvent("Interacted with form field", {
1391
+ actionType: "select",
1392
+ field: name,
1393
+ returnValue: selectedValue
1394
+ });
1395
+ const newValue = selectedValue || null;
1396
+ onChange(newValue);
1397
+ };
1398
+ const yesTileLabel = yesLabel ?? i18n.get("yes");
1399
+ const noTileLabel = noLabel ?? i18n.get("no");
1400
+ return /* @__PURE__ */ jsxs("div", { className: styles$6.guidanceQuestion, children: [
1401
+ /* @__PURE__ */ jsx(Typography, { variant: "body", el: "p", children: question }),
1402
+ descriptionLinkText && onDescriptionLinkClick && /* @__PURE__ */ jsx(Button, { variant: "link", onClick: onDescriptionLinkClick, children: descriptionLinkText }),
1403
+ /* @__PURE__ */ jsx(Field, { name, className: styles$6.options, children: () => /* @__PURE__ */ jsx(
1404
+ TileGroup,
1405
+ {
1406
+ allowMultiple: false,
1407
+ errorMessage,
1408
+ isHorizontal: true,
1409
+ maxSelected: 1,
1410
+ name,
1411
+ onChange: handleChange,
1412
+ selected: value || "",
1413
+ tiles: [
1414
+ {
1415
+ label: yesTileLabel,
1416
+ value: "Yes"
1417
+ /* YES */
1418
+ },
1419
+ {
1420
+ label: noTileLabel,
1421
+ value: "No"
1422
+ /* NO */
1423
+ }
1424
+ ]
1425
+ }
1426
+ ) })
1427
+ ] });
1428
+ };
1184
1429
  const areArraysDifferent = (a = [], b = []) => {
1185
1430
  if (a.length !== b.length) {
1186
1431
  return true;
@@ -1190,22 +1435,21 @@ const areArraysDifferent = (a = [], b = []) => {
1190
1435
  return sortedA.some((item, index) => item !== sortedB[index]);
1191
1436
  };
1192
1437
  const calculateRoles = (data) => {
1193
- var _a, _b, _c, _d;
1194
1438
  const roleMappings = [
1195
1439
  {
1196
- isApplicable: ((_a = data == null ? void 0 : data.signatoryQuestionnaire) == null ? void 0 : _a.isSignatory) === "yes",
1440
+ isApplicable: data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES,
1197
1441
  role: DecisionMakerType.SIGNATORY
1198
1442
  },
1199
1443
  {
1200
- isApplicable: ((_b = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _b.isOwner) === "yes",
1444
+ isApplicable: data?.uboQuestionnaire?.isOwner === GuidanceQuestionValues.YES,
1201
1445
  role: DecisionMakerType.OWNER
1202
1446
  },
1203
1447
  {
1204
- isApplicable: ((_c = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _c.isControllingPerson) === "yes",
1448
+ isApplicable: data?.uboQuestionnaire?.isControllingPerson === GuidanceQuestionValues.YES,
1205
1449
  role: DecisionMakerType.CONTROLLING_PERSON
1206
1450
  },
1207
1451
  {
1208
- isApplicable: ((_d = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _d.isDirector) === "yes",
1452
+ isApplicable: data?.uboQuestionnaire?.isDirector === GuidanceQuestionValues.YES,
1209
1453
  role: DecisionMakerType.DIRECTOR
1210
1454
  }
1211
1455
  ];
@@ -1249,13 +1493,15 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
1249
1493
  DecisionMakerType.SIGNATORY,
1250
1494
  DecisionMakerType.CONTROLLING_PERSON
1251
1495
  ];
1496
+ const ID_MISSING_DATA_ERROR_CODE = "2_8071";
1252
1497
  const individualOnfidoRules = ({
1253
1498
  matchingScenario,
1254
1499
  data,
1255
1500
  country,
1256
1501
  taskType,
1257
1502
  isExperimentEnabled = () => false,
1258
- rootLegalEntity
1503
+ rootLegalEntity,
1504
+ problems
1259
1505
  }) => createFormRules({
1260
1506
  countryUsesTaxId: () => {
1261
1507
  if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && TAX_ID_REQUIRED_COUNTRIES.includes(country)) {
@@ -1264,29 +1510,30 @@ const individualOnfidoRules = ({
1264
1510
  return void 0;
1265
1511
  },
1266
1512
  isDirectorIdNumberRequiredForCountry: () => {
1267
- var _a, _b, _c, _d, _e;
1268
- if (!((_a = data.basicDetails) == null ? void 0 : _a.role)) {
1513
+ if (!data.basicDetails?.role) {
1269
1514
  return REQUIRED;
1270
1515
  }
1271
- if ((_c = (_b = data.basicDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1516
+ if (data.basicDetails?.role?.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1272
1517
  return REQUIRED;
1273
1518
  }
1274
- if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && ((_e = (_d = data.basicDetails) == null ? void 0 : _d.role) == null ? void 0 : _e.some((role) => role === DecisionMakerType.DIRECTOR))) {
1519
+ if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && data.basicDetails?.role?.some((role) => role === DecisionMakerType.DIRECTOR)) {
1275
1520
  return REQUIRED;
1276
1521
  }
1277
1522
  },
1278
1523
  idNumberRules: () => {
1279
- var _a, _b, _c, _d, _e, _f;
1280
- if ((_a = data.additionalPersonalDetails) == null ? void 0 : _a.idNumberExempt) {
1524
+ if (data.additionalPersonalDetails?.idNumberExempt) {
1281
1525
  return OPTIONAL;
1282
1526
  }
1283
- if (!((_b = data.basicDetails) == null ? void 0 : _b.role)) {
1527
+ if (!data.basicDetails?.role) {
1284
1528
  return REQUIRED;
1285
1529
  }
1286
- if ((_d = (_c = data.basicDetails) == null ? void 0 : _c.role) == null ? void 0 : _d.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1530
+ if (country === CountryCodes.UnitedStates && data.basicDetails?.role?.every((role) => role === DecisionMakerType.SIGNATORY)) {
1531
+ return void 0;
1532
+ }
1533
+ if (data.basicDetails?.role?.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1287
1534
  return REQUIRED;
1288
1535
  }
1289
- if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && ((_f = (_e = data.basicDetails) == null ? void 0 : _e.role) == null ? void 0 : _f.some((role) => role === DecisionMakerType.DIRECTOR))) {
1536
+ if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && data.basicDetails?.role?.some((role) => role === DecisionMakerType.DIRECTOR)) {
1290
1537
  return REQUIRED;
1291
1538
  }
1292
1539
  },
@@ -1296,7 +1543,10 @@ const individualOnfidoRules = ({
1296
1543
  }
1297
1544
  },
1298
1545
  idNumberExemptIfApplicableCountry: () => {
1299
- if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && (matchingScenario == null ? void 0 : matchingScenario.includes(Scenarios.L_TAXINFO))) {
1546
+ if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && matchingScenario?.includes(Scenarios.L_TAXINFO)) {
1547
+ return void 0;
1548
+ }
1549
+ if (country === CountryCodes.UnitedStates && data.basicDetails?.role?.every((role) => role === DecisionMakerType.SIGNATORY)) {
1300
1550
  return void 0;
1301
1551
  }
1302
1552
  if (ID_NUMBER_EXEMPT_COUNTRIES.includes(country)) {
@@ -1304,30 +1554,25 @@ const individualOnfidoRules = ({
1304
1554
  }
1305
1555
  },
1306
1556
  hasChosenIdType: () => {
1307
- var _a;
1308
- return ((_a = data == null ? void 0 : data.manualIdUpload) == null ? void 0 : _a.idDocumentType) ? REQUIRED : void 0;
1557
+ return data?.manualIdUpload?.idDocumentType ? REQUIRED : void 0;
1309
1558
  },
1310
1559
  backPageIfRequiredForIdType: () => {
1311
1560
  const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
1312
1561
  const idDocumentOption = idDocumentTypeOptions.find(
1313
- ({ id }) => {
1314
- var _a;
1315
- return id === ((_a = data.manualIdUpload) == null ? void 0 : _a.idDocumentType);
1316
- }
1562
+ ({ id }) => id === data.manualIdUpload?.idDocumentType
1317
1563
  );
1318
- return (idDocumentOption == null ? void 0 : idDocumentOption.hasBackPage) ? REQUIRED : void 0;
1564
+ return idDocumentOption?.hasBackPage ? REQUIRED : void 0;
1319
1565
  },
1320
1566
  isProofOfResidencyRequired: () => {
1321
- var _a, _b, _c, _d, _e, _f;
1322
- if ((_b = (_a = data.proofOfResidency) == null ? void 0 : _a.proofOfResidency) == null ? void 0 : _b.length) {
1567
+ if (data.proofOfResidency?.proofOfResidency?.length) {
1323
1568
  return REQUIRED;
1324
1569
  }
1325
- const isInstantFlow = ((_c = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _c.idVerificationMethod) === "instantVerification";
1570
+ const isInstantFlow = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
1326
1571
  if (!isInstantFlow) {
1327
1572
  return void 0;
1328
1573
  }
1329
- const documentCountry = (_e = (_d = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _d.idDocument) == null ? void 0 : _e.documentCountry;
1330
- const residenceCountry = ((_f = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _f.country) ?? country;
1574
+ const documentCountry = data?.idVerificationMethod?.idDocument?.documentCountry;
1575
+ const residenceCountry = data?.additionalPersonalDetails?.country ?? country;
1331
1576
  if (!documentCountry || !residenceCountry) {
1332
1577
  return void 0;
1333
1578
  }
@@ -1338,15 +1583,13 @@ const individualOnfidoRules = ({
1338
1583
  }
1339
1584
  },
1340
1585
  isProofOfNationalIdRequired: () => {
1341
- var _a, _b;
1342
- if ((_b = (_a = data.proofOfNationalId) == null ? void 0 : _a.proofOfNationalId) == null ? void 0 : _b.length) {
1586
+ if (data.proofOfNationalId?.proofOfNationalId?.length) {
1343
1587
  return REQUIRED;
1344
1588
  }
1345
1589
  },
1346
1590
  contactsIfRequiredForRole: () => {
1347
- var _a, _b;
1348
1591
  if (taskType === TaskTypes.DECISION_MAKER) {
1349
- if ((_b = (_a = data.basicDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.includes(DecisionMakerType.SIGNATORY)) {
1592
+ if (data.basicDetails?.role?.includes(DecisionMakerType.SIGNATORY)) {
1350
1593
  return REQUIRED;
1351
1594
  }
1352
1595
  return;
@@ -1355,22 +1598,20 @@ const individualOnfidoRules = ({
1355
1598
  },
1356
1599
  requiredIfPhoneScenarioDisabled: () => !isExperimentEnabled("EnablePhoneFieldScenario") ? REQUIRED : void 0,
1357
1600
  jobTitleIfRequiredForRole: () => {
1358
- var _a, _b;
1359
1601
  if (taskType !== TaskTypes.DECISION_MAKER) return;
1360
- if (((_b = (_a = data.basicDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.some(
1602
+ if (data.basicDetails?.role?.some(
1361
1603
  (role) => DECISION_MAKER_TYPES_WITH_JOBTITLE.includes(role)
1362
- )) || JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1604
+ ) || JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1363
1605
  return REQUIRED;
1364
1606
  }
1365
1607
  },
1366
1608
  nationalityIfRequiredForRole: () => {
1367
- var _a;
1368
1609
  const enableNationalitySGHK = isExperimentEnabled("EnableNationalitySGHK");
1369
- const rootLegalEntityCountry = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _a.registeredAddress.country;
1610
+ const rootLegalEntityCountry = rootLegalEntity?.organization?.registeredAddress.country;
1370
1611
  if (enableNationalitySGHK && rootLegalEntityCountry && NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(rootLegalEntityCountry)) {
1371
1612
  return REQUIRED;
1372
1613
  }
1373
- if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country)) {
1614
+ if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || data?.additionalPersonalDetails?.nationality) {
1374
1615
  return REQUIRED;
1375
1616
  }
1376
1617
  },
@@ -1380,20 +1621,17 @@ const individualOnfidoRules = ({
1380
1621
  }
1381
1622
  },
1382
1623
  licenseCardNumberRules: () => {
1383
- var _a;
1384
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense" && LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1624
+ if (data.additionalPersonalDetails?.typeOfIdentity === "driversLicense" && LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1385
1625
  return REQUIRED;
1386
1626
  }
1387
1627
  },
1388
1628
  issuerStateRequired: () => {
1389
- var _a;
1390
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1629
+ if (data.additionalPersonalDetails?.typeOfIdentity === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1391
1630
  return REQUIRED;
1392
1631
  }
1393
1632
  },
1394
1633
  expiryDateRequired: () => {
1395
- var _a;
1396
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "passport" && EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1634
+ if (data.additionalPersonalDetails?.typeOfIdentity === "passport" && EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1397
1635
  return REQUIRED;
1398
1636
  }
1399
1637
  },
@@ -1401,64 +1639,69 @@ const individualOnfidoRules = ({
1401
1639
  isProofOfRelationshipRequired: () => void 0,
1402
1640
  // not required until more clarity from product
1403
1641
  addressIfRequiredForCountry: () => {
1404
- var _a;
1405
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1642
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1406
1643
  return addressSchema.includes("address") ? "REQUIRED" : void 0;
1407
1644
  },
1408
1645
  otherAddressInfoIfRequiredForCountry: () => {
1409
- var _a;
1410
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1646
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1411
1647
  return addressSchema.includes("otherAddressInformation") ? "OPTIONAL" : void 0;
1412
1648
  },
1413
1649
  postalCodeIfRequiredForCountry: () => {
1414
- var _a;
1415
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1650
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1416
1651
  return addressSchema.includes("postalCode") ? "REQUIRED" : void 0;
1417
1652
  },
1418
1653
  cityIfRequiredForCountry: () => {
1419
- var _a;
1420
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1654
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1421
1655
  return addressSchema.includes("city") ? "REQUIRED" : void 0;
1422
1656
  },
1423
1657
  stateOrProvinceIfRequiredForCountry: () => {
1424
- var _a, _b;
1425
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1426
- return addressSchema.includes("stateOrProvince") && COUNTRIES_WITH_STATES_DATASET.includes(((_b = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _b.country) ?? country) ? "REQUIRED" : void 0;
1658
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1659
+ return addressSchema.includes("stateOrProvince") && COUNTRIES_WITH_STATES_DATASET.includes(data?.additionalPersonalDetails?.country ?? country) ? "REQUIRED" : void 0;
1427
1660
  },
1428
1661
  nomineeDirectorRequiredForCountry: () => {
1429
- var _a, _b, _c;
1430
- if (allowedCountriesForNominee.includes(((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country) ?? country) && ((_c = (_b = data == null ? void 0 : data.basicDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.includes(DecisionMakerType.DIRECTOR))) {
1662
+ if (allowedCountriesForNominee.includes(data?.additionalPersonalDetails?.country ?? country) && data?.basicDetails?.role?.includes(DecisionMakerType.DIRECTOR)) {
1431
1663
  return "REQUIRED";
1432
1664
  }
1433
1665
  },
1434
1666
  nomineeShareHolderRequiredForCountry: () => {
1435
- var _a, _b, _c;
1436
- if (allowedCountriesForNominee.includes(((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country) ?? country) && ((_c = (_b = data == null ? void 0 : data.basicDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.includes(DecisionMakerType.OWNER))) {
1667
+ if (allowedCountriesForNominee.includes(data?.additionalPersonalDetails?.country ?? country) && data?.basicDetails?.role?.includes(DecisionMakerType.OWNER)) {
1437
1668
  return "REQUIRED";
1438
1669
  }
1439
1670
  },
1440
1671
  isUsingInstantVerificationOrHasExistingDocument: () => {
1441
- var _a, _b;
1442
- const isUsingInstantVerification = ((_a = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _a.idVerificationMethod) === "instantVerification";
1443
- const existingDocument = (_b = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _b.idDocument;
1672
+ const isUsingInstantVerification = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
1673
+ const existingDocument = data?.idVerificationMethod?.idDocument;
1444
1674
  return isUsingInstantVerification || existingDocument ? REQUIRED : void 0;
1445
1675
  },
1446
1676
  isManualIdFlow: () => {
1447
- var _a;
1448
- const isManualFlow = ((_a = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _a.idVerificationMethod) === "manualVerification";
1677
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1449
1678
  return isManualFlow ? "REQUIRED" : void 0;
1450
1679
  },
1451
1680
  isManualIdFlowAndNotProvidingIdNumber: () => {
1452
- var _a, _b;
1453
- const isManualFlow = ((_a = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _a.idVerificationMethod) === "manualVerification";
1454
- const idNumberExempt = (_b = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _b.idNumberExempt;
1455
- return isManualFlow && idNumberExempt ? "REQUIRED" : void 0;
1681
+ const hasMissingId = problems?.missingData?.some(
1682
+ (error) => error.code === ID_MISSING_DATA_ERROR_CODE
1683
+ );
1684
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1685
+ const idNumberExempt = data?.additionalPersonalDetails?.idNumberExempt;
1686
+ return isManualFlow && (idNumberExempt || hasMissingId) ? "REQUIRED" : void 0;
1687
+ },
1688
+ isManualIdFlowAndHasMissingData: () => {
1689
+ const hasMissingId = problems?.missingData?.some(
1690
+ (error) => error.code === ID_MISSING_DATA_ERROR_CODE
1691
+ );
1692
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1693
+ return isManualFlow && hasMissingId ? "REQUIRED" : void 0;
1456
1694
  },
1457
1695
  idVerificationRequired: () => {
1458
1696
  return REQUIRED;
1459
1697
  },
1460
1698
  isGuidedDecisionMakersFlowEnabled: () => {
1461
- if (isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow")) {
1699
+ if (!isExperimentEnabled("DisableGuidedDecisionMakersFlow") && (isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow"))) {
1700
+ return "REQUIRED";
1701
+ }
1702
+ },
1703
+ isGuidedDecisionMakersFlowDisabled: () => {
1704
+ if (isExperimentEnabled("DisableGuidedDecisionMakersFlow") || !isExperimentEnabled("EnableGuidedDecisionMakersFlow") && !isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow")) {
1462
1705
  return "REQUIRED";
1463
1706
  }
1464
1707
  },
@@ -1470,6 +1713,11 @@ const individualOnfidoRules = ({
1470
1713
  if (isDirectorRequired) {
1471
1714
  return "REQUIRED";
1472
1715
  }
1716
+ },
1717
+ japaneseFirstAndLastNames: () => {
1718
+ if (country === CountryCodes.Japan) {
1719
+ return "REQUIRED";
1720
+ }
1473
1721
  }
1474
1722
  });
1475
1723
  const TypeOfIdentity = ({
@@ -1524,7 +1772,6 @@ const identityValidationRules = (country) => {
1524
1772
  }
1525
1773
  };
1526
1774
  function Identity(props) {
1527
- var _a, _b, _c;
1528
1775
  const { additionalPersonalDetails, country, idNumberType, handleFieldChange } = props;
1529
1776
  const {
1530
1777
  data,
@@ -1576,7 +1823,7 @@ function Identity(props) {
1576
1823
  const mergedProps = useMemo(() => {
1577
1824
  const idNumberMetadata = resolveFieldMetadata(
1578
1825
  defaultFieldConfig[country],
1579
- { idNumberType: data == null ? void 0 : data.typeOfIdentity },
1826
+ { idNumberType: data?.typeOfIdentity },
1580
1827
  defaultFieldMetadata
1581
1828
  );
1582
1829
  return mergeFieldMetadataIntoProps(
@@ -1588,21 +1835,21 @@ function Identity(props) {
1588
1835
  initialFormUtilProps
1589
1836
  )
1590
1837
  );
1591
- }, [country, data == null ? void 0 : data.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData]);
1838
+ }, [country, data?.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData]);
1592
1839
  const { i18n } = useI18nContext();
1593
1840
  const formUtils = useMemo(() => createFormUtils(mergedProps, i18n), [mergedProps, i18n]);
1594
1841
  const { form } = useFormContext();
1595
- const defaultIdNumber = (_b = (_a = form == null ? void 0 : form.defaultData) == null ? void 0 : _a.additionalPersonalDetails) == null ? void 0 : _b.idNumber;
1842
+ const defaultIdNumber = form?.defaultData?.additionalPersonalDetails?.idNumber;
1596
1843
  const ssnType = getSSNType(formVerificationErrors, defaultIdNumber);
1597
1844
  const today = /* @__PURE__ */ new Date();
1598
1845
  const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
1599
1846
  const isCountryAustralia = country === CountryCodes.Australia;
1600
1847
  const isCountryNewZealand = country === CountryCodes.NewZealand;
1601
1848
  useEffect(() => {
1602
- if ((data == null ? void 0 : data.typeOfIdentity) === "nationalIdNumber") {
1849
+ if (data?.typeOfIdentity === "nationalIdNumber") {
1603
1850
  handleFieldChange("typeOfIdentity")(void 0);
1604
1851
  }
1605
- }, [data == null ? void 0 : data.typeOfIdentity, handleFieldChange]);
1852
+ }, [data?.typeOfIdentity, handleFieldChange]);
1606
1853
  if (!handleFieldChange) {
1607
1854
  return;
1608
1855
  }
@@ -1625,62 +1872,60 @@ function Identity(props) {
1625
1872
  /* @__PURE__ */ jsx(
1626
1873
  TypeOfIdentity,
1627
1874
  {
1628
- availableIdentityTypesOptions: (_c = additionallIdNumberOptions) == null ? void 0 : _c[country],
1629
- selectedIdentityType: data == null ? void 0 : data.typeOfIdentity,
1875
+ availableIdentityTypesOptions: additionallIdNumberOptions?.[country],
1876
+ selectedIdentityType: data?.typeOfIdentity,
1630
1877
  setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
1631
1878
  label: formUtils.getLabel("typeOfIdentity"),
1632
- isValid: Boolean(valid == null ? void 0 : valid.typeOfIdentity),
1879
+ isValid: Boolean(valid?.typeOfIdentity),
1633
1880
  errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
1634
1881
  }
1635
1882
  ),
1636
- (isCountryAustralia || isCountryNewZealand) && (data == null ? void 0 : data.typeOfIdentity) === "passport" && /* @__PURE__ */ jsx(
1883
+ (isCountryAustralia || isCountryNewZealand) && data?.typeOfIdentity === "passport" && /* @__PURE__ */ jsx(
1637
1884
  MaskedInput,
1638
1885
  {
1639
1886
  name: "idNumber",
1640
1887
  type: "text",
1641
1888
  label: formUtils.getLabel("idNumber", "idNumber"),
1642
1889
  formatGuidance: formUtils.getGuidanceText("idNumber"),
1643
- classNameModifiers: { field: ["idNumber"], input: ["idNumber"] },
1644
1890
  errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1645
1891
  shouldValidate,
1646
- isValid: Boolean(valid == null ? void 0 : valid.idNumber),
1892
+ isValid: Boolean(valid?.idNumber),
1647
1893
  "aria-required": formUtils.isRequiredField("idNumber"),
1648
- "aria-invalid": !(valid == null ? void 0 : valid.idNumber),
1894
+ "aria-invalid": !valid?.idNumber,
1649
1895
  onBlur: handleFieldChange("idNumber", "blur"),
1650
1896
  readonly: formUtils.isReadOnly("idNumber"),
1651
- value: (data == null ? void 0 : data.idNumber) ?? "",
1897
+ value: data?.idNumber ?? "",
1652
1898
  onInput: handleFieldChange("idNumber", "input"),
1653
- acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
1899
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1654
1900
  ...formUtils.getMask("idNumber")
1655
1901
  }
1656
1902
  ),
1657
- isCountryNewZealand && (data == null ? void 0 : data.typeOfIdentity) === "passport" && /* @__PURE__ */ jsx(
1903
+ isCountryNewZealand && data?.typeOfIdentity === "passport" && /* @__PURE__ */ jsx(
1658
1904
  Field,
1659
1905
  {
1660
1906
  name: "expiryDate",
1661
1907
  label: formUtils.getLabel("passportExpiryDate"),
1662
- classNameModifiers: ["expiryDate"],
1663
1908
  errorMessage: formUtils.getErrorMessage("expiryDate", errors, fieldValidationErrors),
1664
- isValid: valid == null ? void 0 : valid.expiryDate,
1909
+ isValid: valid?.expiryDate,
1665
1910
  children: (childProps) => /* @__PURE__ */ jsx(
1666
1911
  InputDate,
1667
1912
  {
1668
1913
  ...childProps,
1669
1914
  name: "expiryDate",
1670
- value: data == null ? void 0 : data.expiryDate,
1915
+ value: data?.expiryDate,
1671
1916
  placeholder: i18n.get("datePlaceholder"),
1672
1917
  readonly: formUtils.isReadOnly("expiryDate"),
1673
1918
  onInput: handleFieldChange("expiryDate", "input"),
1674
1919
  onBlur: handleFieldChange("expiryDate", "blur"),
1675
1920
  "aria-required": true,
1676
- "aria-invalid": !(valid == null ? void 0 : valid.expiryDate),
1921
+ "aria-invalid": !valid?.expiryDate,
1677
1922
  min: formatDateObj(today),
1678
1923
  max: formatDateObj(maxExpiryDateSelection)
1679
1924
  }
1680
1925
  )
1681
1926
  }
1682
1927
  ),
1683
- (isCountryAustralia || isCountryNewZealand) && (data == null ? void 0 : data.typeOfIdentity) === "driversLicense" && /* @__PURE__ */ jsx(
1928
+ (isCountryAustralia || isCountryNewZealand) && data?.typeOfIdentity === "driversLicense" && /* @__PURE__ */ jsx(
1684
1929
  DriversLicense,
1685
1930
  {
1686
1931
  country,
@@ -1692,9 +1937,9 @@ function Identity(props) {
1692
1937
  onCardNumberBlur: handleFieldChange("licenseCardNumber", "blur"),
1693
1938
  formUtils,
1694
1939
  isValid: {
1695
- idNumber: Boolean(valid == null ? void 0 : valid.idNumber),
1696
- licenseCardNumber: Boolean(valid == null ? void 0 : valid.licenseCardNumber),
1697
- issuerState: Boolean(valid == null ? void 0 : valid.issuerState)
1940
+ idNumber: Boolean(valid?.idNumber),
1941
+ licenseCardNumber: Boolean(valid?.licenseCardNumber),
1942
+ issuerState: Boolean(valid?.issuerState)
1698
1943
  },
1699
1944
  errorMessages: {
1700
1945
  idNumber: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
@@ -1715,17 +1960,16 @@ function Identity(props) {
1715
1960
  type: "text",
1716
1961
  label: formUtils.getLabel("idNumber", "idNumber"),
1717
1962
  formatGuidance: formUtils.getGuidanceText("idNumber"),
1718
- classNameModifiers: { field: ["idNumber"], input: ["idNumber"] },
1719
1963
  errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1720
1964
  shouldValidate,
1721
- isValid: Boolean(valid == null ? void 0 : valid.idNumber),
1965
+ isValid: Boolean(valid?.idNumber),
1722
1966
  "aria-required": formUtils.isRequiredField("idNumber"),
1723
- "aria-invalid": Boolean(!(valid == null ? void 0 : valid.idNumber)),
1967
+ "aria-invalid": Boolean(!valid?.idNumber),
1724
1968
  onBlur: handleFieldChange("idNumber", "blur"),
1725
1969
  readonly: formUtils.isReadOnly("idNumber"),
1726
- value: (data == null ? void 0 : data.idNumber) ?? "",
1970
+ value: data?.idNumber ?? "",
1727
1971
  onInput: handleFieldChange("idNumber", "input"),
1728
- acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
1972
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1729
1973
  ...formUtils.getMask("idNumber")
1730
1974
  }
1731
1975
  )
@@ -1756,13 +2000,14 @@ const additionalPersonalDetailsFields = [
1756
2000
  ...addressFields,
1757
2001
  "taxInformation"
1758
2002
  ];
1759
- const countriesRequiringNationality = [
1760
- CountryCodes.HongKong,
1761
- CountryCodes.Singapore
1762
- ];
1763
2003
  function AdditionalPersonalDetails(props) {
1764
2004
  const { i18n } = useI18nContext();
1765
2005
  const allowedCountries = useAllowedCountries();
2006
+ const [showLegalRepresentativePrompt, setShowLegalRepresentativePrompt] = useState(false);
2007
+ const { isSettingEnabled } = useSettingsContext();
2008
+ const { isExperimentEnabled } = useExperimentsContext();
2009
+ const isExperimentAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
2010
+ const isSettingsEnforceLegalAgeEnabled = isSettingEnabled(SettingNames.EnforceLegalAge);
1766
2011
  const {
1767
2012
  country: defaultCountry,
1768
2013
  data,
@@ -1775,21 +2020,21 @@ function AdditionalPersonalDetails(props) {
1775
2020
  taskType,
1776
2021
  handleFieldChange
1777
2022
  } = props;
1778
- const country = (data == null ? void 0 : data.country) ?? defaultCountry;
2023
+ const country = data?.country ?? defaultCountry;
1779
2024
  const isIndividual = taskType === TaskTypes.INDIVIDUAL;
1780
2025
  const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
1781
2026
  const [taxIdNumberType, setTaxIdNumberType] = useState(
1782
- getDefaultTaxIdNumberType(data == null ? void 0 : data.taxInformation, country, LegalEntityType.INDIVIDUAL)
2027
+ getDefaultTaxIdNumberType(data?.taxInformation, country, LegalEntityType.INDIVIDUAL)
1783
2028
  );
1784
2029
  const mergedProps = mergeFieldMetadataIntoProps(
1785
2030
  "taxInformation",
1786
2031
  resolveFieldMetadata(
1787
- defaultFieldConfig$1[country],
2032
+ taxInformationDefaultFieldConfig[country],
1788
2033
  {
1789
2034
  taxIdNumberType,
1790
2035
  companyType: LegalEntityType.INDIVIDUAL
1791
2036
  },
1792
- defaultFieldMetadata$2
2037
+ taxInformationDefaultFieldMetadata
1793
2038
  ),
1794
2039
  props
1795
2040
  );
@@ -1803,6 +2048,13 @@ function AdditionalPersonalDetails(props) {
1803
2048
  if (!handleFieldChange) {
1804
2049
  return;
1805
2050
  }
2051
+ const handleBirthDateChange = (event) => {
2052
+ handleFieldChange("birthDate", "blur")(event);
2053
+ if (isExperimentAgeVerificationEnabled && !isSettingsEnforceLegalAgeEnabled && isLegalRepresentativeNeeded(event.currentTarget.value, country, taskType)) {
2054
+ setShowLegalRepresentativePrompt(true);
2055
+ }
2056
+ };
2057
+ const isRootIndividual = taskType === TaskTypes.INDIVIDUAL;
1806
2058
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__personal-details", "aria-describedby": "ariaErrorField", children: [
1807
2059
  /* @__PURE__ */ jsx(FormHeader, { heading }),
1808
2060
  /* @__PURE__ */ jsx(
@@ -1822,14 +2074,13 @@ function AdditionalPersonalDetails(props) {
1822
2074
  CountryField,
1823
2075
  {
1824
2076
  data: { country },
1825
- valid: { country: valid == null ? void 0 : valid.country },
2077
+ valid: { country: valid?.country },
1826
2078
  errors: {
1827
2079
  country: formUtils.getErrorMessage("country", errors, fieldValidationErrors)
1828
2080
  },
1829
2081
  labels: { country: formUtils.getLabel("country") },
1830
2082
  readonly: formUtils.isReadOnly("country"),
1831
- allowedCountries,
1832
- classNameModifiers: ["country"],
2083
+ allowedCountries: isRootIndividual ? allowedCountries : void 0,
1833
2084
  handleChangeFor: handleFieldChange
1834
2085
  }
1835
2086
  ),
@@ -1861,32 +2112,48 @@ function AdditionalPersonalDetails(props) {
1861
2112
  {
1862
2113
  name: "birthDate",
1863
2114
  label: formUtils.getLabel("birthDate"),
1864
- classNameModifiers: ["birthDate"],
1865
2115
  errorMessage: birthDateErrorMessage,
1866
- isValid: valid == null ? void 0 : valid.birthDate,
2116
+ isValid: valid?.birthDate,
1867
2117
  children: (childProps) => /* @__PURE__ */ jsx(
1868
2118
  InputDate,
1869
2119
  {
1870
2120
  ...childProps,
1871
2121
  name: "birthDate",
1872
- value: data == null ? void 0 : data.birthDate,
2122
+ value: data?.birthDate,
1873
2123
  placeholder: i18n.get("datePlaceholder"),
1874
2124
  readonly: formUtils.isReadOnly("birthDate"),
1875
2125
  onInput: handleFieldChange("birthDate", "input"),
1876
- onBlur: handleFieldChange("birthDate", "blur"),
2126
+ onBlur: handleBirthDateChange,
1877
2127
  "aria-required": true,
1878
- "aria-invalid": !(valid == null ? void 0 : valid.birthDate),
2128
+ "aria-invalid": !valid?.birthDate,
1879
2129
  max: formatDateObj(/* @__PURE__ */ new Date())
1880
2130
  }
1881
2131
  )
1882
2132
  }
1883
2133
  ),
2134
+ showLegalRepresentativePrompt && /* @__PURE__ */ jsx(
2135
+ Confirm,
2136
+ {
2137
+ title: i18n.get("legalRepresentativeForMinorIsRequired"),
2138
+ description: i18n.get("becauseThisPersonIsUnderXYearsOld", {
2139
+ values: { age: getAgeRangeForLegalRepresentative(country)?.max?.toString() ?? "" }
2140
+ }),
2141
+ onCancel: () => {
2142
+ setShowLegalRepresentativePrompt(false);
2143
+ },
2144
+ confirmText: i18n.get("ok"),
2145
+ cancelText: i18n.get("editDetails"),
2146
+ onConfirm: () => {
2147
+ setShowLegalRepresentativePrompt(false);
2148
+ }
2149
+ }
2150
+ ),
1884
2151
  /* @__PURE__ */ jsx(
1885
2152
  IndividualIdNumberTypeSelector,
1886
2153
  {
1887
2154
  country,
1888
2155
  handleFieldChange: handleFieldChange("typeOfIdentity", "input"),
1889
- selected: data == null ? void 0 : data.typeOfIdentity
2156
+ selected: data?.typeOfIdentity
1890
2157
  }
1891
2158
  ),
1892
2159
  /* @__PURE__ */ jsx(
@@ -1895,15 +2162,15 @@ function AdditionalPersonalDetails(props) {
1895
2162
  additionalPersonalDetails: props,
1896
2163
  country,
1897
2164
  errors,
1898
- idNumberType: data == null ? void 0 : data.typeOfIdentity,
2165
+ idNumberType: data?.typeOfIdentity,
1899
2166
  handleFieldChange
1900
2167
  }
1901
2168
  ),
1902
2169
  showField(["taxInformation"]) && /* @__PURE__ */ jsx(
1903
2170
  TaxInformationField,
1904
2171
  {
1905
- data: { taxInformation: data == null ? void 0 : data.taxInformation },
1906
- valid: { taxInformation: valid == null ? void 0 : valid.taxInformation },
2172
+ data: { taxInformation: data?.taxInformation },
2173
+ valid: { taxInformation: valid?.taxInformation },
1907
2174
  errors: {
1908
2175
  taxInformation: formUtils.getErrorMessage(
1909
2176
  "taxInformation",
@@ -1913,7 +2180,6 @@ function AdditionalPersonalDetails(props) {
1913
2180
  },
1914
2181
  labels: formUtils.getFieldLabels(["taxInformation"]),
1915
2182
  mask: formUtils.getMask("taxInformation"),
1916
- helperText: formUtils.getFieldHelperText(["taxInformation"]),
1917
2183
  guidanceText: formUtils.getFieldGuidanceText(["taxInformation"]),
1918
2184
  readonly: formUtils.isReadOnly("taxInformation"),
1919
2185
  shouldValidate,
@@ -1923,21 +2189,21 @@ function AdditionalPersonalDetails(props) {
1923
2189
  companyType: LegalEntityType.INDIVIDUAL,
1924
2190
  taxIdNumberType,
1925
2191
  setTaxIdNumberType,
1926
- defaultData: data == null ? void 0 : data.taxInformation
2192
+ defaultData: data?.taxInformation
1927
2193
  }
1928
2194
  ),
1929
- countriesRequiringNationality.includes(country) && formUtils.isRequiredField("nationality") && /* @__PURE__ */ jsx(
2195
+ formUtils.isRequiredField("nationality") && /* @__PURE__ */ jsx(
1930
2196
  CountryField,
1931
2197
  {
1932
- data: { country: data == null ? void 0 : data.nationality },
1933
- valid: { country: valid == null ? void 0 : valid.nationality },
2198
+ data: { country: data?.nationality },
2199
+ valid: { country: valid?.nationality },
2200
+ name: "nationality",
1934
2201
  errors: {
1935
2202
  country: formUtils.getErrorMessage("nationality", errors, fieldValidationErrors)
1936
2203
  },
1937
2204
  labels: { country: formUtils.getLabel("nationality") },
1938
2205
  readonly: formUtils.isReadOnly("nationality"),
1939
- classNameModifiers: ["nationality"],
1940
- handleChangeFor: handleFieldChange
2206
+ handleChangeFor: () => handleFieldChange("nationality", "input")
1941
2207
  }
1942
2208
  ),
1943
2209
  country === "US" && isIndividual ? /* @__PURE__ */ jsx(PatriotActDisclosure, {}) : void 0
@@ -1949,16 +2215,20 @@ const basicDetailsFields = [
1949
2215
  ...decisionMakerRoleFields,
1950
2216
  ...nomineeFields,
1951
2217
  ...contactDetailFields,
1952
- "relationship"
2218
+ "relationship",
2219
+ "jaHaniFirstName",
2220
+ "jaHaniLastName",
2221
+ "jaKanaFirstName",
2222
+ "jaKanaLastName"
1953
2223
  ];
1954
2224
  function BasicDetails(props) {
1955
- var _a, _b, _c, _d;
1956
2225
  const { i18n } = useI18nContext();
1957
2226
  const {
1958
2227
  form: { triggerValidation }
1959
2228
  } = useFormContext();
1960
2229
  const { isExperimentEnabled } = useExperimentsContext();
1961
2230
  const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
2231
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
1962
2232
  const {
1963
2233
  country,
1964
2234
  data,
@@ -1980,10 +2250,13 @@ function BasicDetails(props) {
1980
2250
  const formUtils = createFormUtils(props, i18n);
1981
2251
  const decisionMakerRoleProps = getFieldProps(props, decisionMakerRoleFields);
1982
2252
  const nomineeProps = getFieldProps(props, nomineeFields);
1983
- const nameProps = getFieldProps(
1984
- props,
1985
- nameFields
1986
- );
2253
+ const localizedNameProps = getFieldProps(props, [
2254
+ "jaHaniFirstName",
2255
+ "jaHaniLastName",
2256
+ "jaKanaFirstName",
2257
+ "jaKanaLastName",
2258
+ ...nameFields
2259
+ ]);
1987
2260
  const contactDetailsFormProps = getFieldProps(props, contactDetailFields);
1988
2261
  if (!handleFieldChange) {
1989
2262
  return;
@@ -2006,8 +2279,8 @@ function BasicDetails(props) {
2006
2279
  title: i18n.get({
2007
2280
  key: "legalRepresentativeFor",
2008
2281
  values: {
2009
- firstName: ((_a = parentLegalEntity == null ? void 0 : parentLegalEntity.individual) == null ? void 0 : _a.name.firstName) || "",
2010
- lastName: ((_b = parentLegalEntity == null ? void 0 : parentLegalEntity.individual) == null ? void 0 : _b.name.lastName) || ""
2282
+ firstName: parentLegalEntity?.individual?.name.firstName || "",
2283
+ lastName: parentLegalEntity?.individual?.name.lastName || ""
2011
2284
  }
2012
2285
  })
2013
2286
  }
@@ -2024,33 +2297,34 @@ function BasicDetails(props) {
2024
2297
  isDecisionMakerTask && trustedFieldsProvider === TrustedFieldsProvider.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, { color: "secondary", variant: "caption", children: i18n.get(
2025
2298
  "weSelectedSomeRolesBasedOnMyinfoBusinessDataAboutYourCompanysAppointmentHoldersAndShareholders"
2026
2299
  ) }),
2027
- isDecisionMakerTask && !isGuidedDecisionMakersFlowEnabled && /* @__PURE__ */ jsx(
2028
- DecisionMakerRole,
2029
- {
2030
- ...decisionMakerRoleProps,
2031
- taskType,
2032
- dataStoreId: basicDetailsId,
2033
- allowedRoles,
2034
- trustedRoles,
2035
- country,
2036
- handleFieldChange
2037
- }
2038
- ),
2039
- isDecisionMakerTask && /* @__PURE__ */ jsx(
2040
- NomineeDecisionMakerRole,
2041
- {
2042
- ...nomineeProps,
2043
- roles: data == null ? void 0 : data.role,
2044
- country,
2045
- handleFieldChange
2046
- }
2047
- ),
2048
- !!((_c = nameProps == null ? void 0 : nameProps.requiredFields) == null ? void 0 : _c.length) && /* @__PURE__ */ jsx(
2049
- Name,
2050
- {
2051
- ...nameProps,
2052
- dataStoreId: basicDetailsId,
2053
- errors,
2300
+ isDecisionMakerTask && (isGuidedDecisionMakersFlowDisabled || !isGuidedDecisionMakersFlowEnabled) && /* @__PURE__ */ jsxs(Fragment, { children: [
2301
+ /* @__PURE__ */ jsx(
2302
+ DecisionMakerRole,
2303
+ {
2304
+ ...decisionMakerRoleProps,
2305
+ taskType,
2306
+ dataStoreId: basicDetailsId,
2307
+ allowedRoles,
2308
+ trustedRoles,
2309
+ country,
2310
+ handleFieldChange
2311
+ }
2312
+ ),
2313
+ /* @__PURE__ */ jsx(
2314
+ NomineeDecisionMakerRole,
2315
+ {
2316
+ ...nomineeProps,
2317
+ roles: data?.role,
2318
+ country,
2319
+ handleFieldChange
2320
+ }
2321
+ )
2322
+ ] }),
2323
+ /* @__PURE__ */ jsx(
2324
+ LocalizedNameFields,
2325
+ {
2326
+ ...localizedNameProps,
2327
+ country,
2054
2328
  handleFieldChange
2055
2329
  }
2056
2330
  ),
@@ -2059,14 +2333,13 @@ function BasicDetails(props) {
2059
2333
  {
2060
2334
  name: "jobTitle",
2061
2335
  label: formUtils.getLabel("jobTitle"),
2062
- classNameModifiers: ["jobTitle"],
2063
2336
  errorMessage: formUtils.getErrorMessage("jobTitle", errors, fieldValidationErrors),
2064
2337
  children: (childProps) => /* @__PURE__ */ jsx(
2065
2338
  InputText,
2066
2339
  {
2067
2340
  ...childProps,
2068
2341
  name: "jobTitle",
2069
- value: data == null ? void 0 : data.jobTitle,
2342
+ value: data?.jobTitle,
2070
2343
  placeholder: formUtils.getPlaceholder("jobTitle"),
2071
2344
  readonly: formUtils.isReadOnly("jobTitle"),
2072
2345
  onInput: handleFieldChange("jobTitle", "input"),
@@ -2076,7 +2349,7 @@ function BasicDetails(props) {
2076
2349
  )
2077
2350
  }
2078
2351
  ),
2079
- !!((_d = contactDetailsFormProps == null ? void 0 : contactDetailsFormProps.requiredFields) == null ? void 0 : _d.length) && /* @__PURE__ */ jsx(
2352
+ !!contactDetailsFormProps?.requiredFields?.length && /* @__PURE__ */ jsx(
2080
2353
  ContactDetails,
2081
2354
  {
2082
2355
  ...contactDetailsFormProps,
@@ -2159,9 +2432,6 @@ const createAddressConflictRule = (datasetUtils) => (provided, detected) => {
2159
2432
  const detectedString = addressToString(mapApiAddressToSchema(detected), datasetUtils);
2160
2433
  return { hasConflict: providedString !== detectedString };
2161
2434
  };
2162
- const createIdConflictRule = () => () => {
2163
- return { hasConflict: false };
2164
- };
2165
2435
  const useDataConflicts = (providedData, detectedData, rules2 = {}, onAutoResolve) => {
2166
2436
  const { conflictingProperties, wasAutoResolved, resolvedData, hasConflicts } = useMemo(() => {
2167
2437
  if (!providedData || !detectedData) {
@@ -2188,16 +2458,17 @@ const useDataConflicts = (providedData, detectedData, rules2 = {}, onAutoResolve
2188
2458
  const wasAutoResolved2 = autoResolvedPatches.size > 0;
2189
2459
  const resolvedData2 = wasAutoResolved2 ? { ...providedData ?? {}, ...Object.fromEntries(autoResolvedPatches) } : void 0;
2190
2460
  if (wasAutoResolved2 && !hasConflicts2 && resolvedData2) {
2191
- onAutoResolve == null ? void 0 : onAutoResolve(resolvedData2);
2461
+ onAutoResolve?.(resolvedData2);
2192
2462
  }
2193
2463
  return { hasConflicts: hasConflicts2, conflictingProperties: conflictingProperties2, wasAutoResolved: wasAutoResolved2, resolvedData: resolvedData2 };
2194
2464
  }, [providedData, detectedData, rules2, onAutoResolve]);
2195
2465
  return { hasConflicts, conflictingProperties, wasAutoResolved, resolvedData };
2196
2466
  };
2467
+ const isNextStepDisabled = signal(false);
2197
2468
  const conflictRowTable = "adyen-kyc-conflict-row-table";
2198
2469
  const conflictRowList = "adyen-kyc-conflict-row-list";
2199
2470
  const conflictRowListOptionLabel = "adyen-kyc-conflict-row-list-option-label";
2200
- const styles$6 = {
2471
+ const styles$5 = {
2201
2472
  conflictRowTable,
2202
2473
  conflictRowList,
2203
2474
  conflictRowListOptionLabel
@@ -2223,7 +2494,7 @@ const ConflictRow = ({
2223
2494
  }
2224
2495
  }, [hasOnlyProvided, hasOnlyDetected, onSelect, selected]);
2225
2496
  if (hasOnlyProvided || hasOnlyDetected) return;
2226
- return showAs === "listItem" ? /* @__PURE__ */ jsxs("div", { className: styles$6.conflictRowList, children: [
2497
+ return showAs === "listItem" ? /* @__PURE__ */ jsxs("div", { className: styles$5.conflictRowList, children: [
2227
2498
  /* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: i18n.get(label) }) }),
2228
2499
  /* @__PURE__ */ jsxs("dd", { children: [
2229
2500
  /* @__PURE__ */ jsxs("div", { children: [
@@ -2232,7 +2503,7 @@ const ConflictRow = ({
2232
2503
  {
2233
2504
  variant: "caption",
2234
2505
  color: "tertiary",
2235
- className: styles$6.conflictRowListOptionLabel,
2506
+ className: styles$5.conflictRowListOptionLabel,
2236
2507
  children: i18n.get("youEntered")
2237
2508
  }
2238
2509
  ),
@@ -2252,7 +2523,7 @@ const ConflictRow = ({
2252
2523
  {
2253
2524
  variant: "caption",
2254
2525
  color: "tertiary",
2255
- className: styles$6.conflictRowListOptionLabel,
2526
+ className: styles$5.conflictRowListOptionLabel,
2256
2527
  children: i18n.get("weDetected")
2257
2528
  }
2258
2529
  ),
@@ -2267,7 +2538,7 @@ const ConflictRow = ({
2267
2538
  )
2268
2539
  ] })
2269
2540
  ] })
2270
- ] }) : /* @__PURE__ */ jsxs("tr", { className: styles$6.conflictRowTable, children: [
2541
+ ] }) : /* @__PURE__ */ jsxs("tr", { className: styles$5.conflictRowTable, children: [
2271
2542
  /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: i18n.get(label) }) }),
2272
2543
  /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(
2273
2544
  RadioWithLabel,
@@ -2293,7 +2564,7 @@ const dataConflictsWrapper = "adyen-kyc-data-conflicts-wrapper";
2293
2564
  const dataConflictsHeader = "adyen-kyc-data-conflicts-header";
2294
2565
  const dataConflictsTable = "adyen-kyc-data-conflicts-table";
2295
2566
  const dataConflictsList = "adyen-kyc-data-conflicts-list";
2296
- const styles$5 = {
2567
+ const styles$4 = {
2297
2568
  dataConflictsWrapper,
2298
2569
  dataConflictsHeader,
2299
2570
  dataConflictsTable,
@@ -2334,13 +2605,13 @@ const DataConflictsModal = ({
2334
2605
  // No dependencies, as setShowError and setResolutions are stable.
2335
2606
  );
2336
2607
  return /* @__PURE__ */ jsxs(Modal, { ariaLabel: i18n.get(title), onClose: () => setShowCancelModal(true), inset: true, children: [
2337
- /* @__PURE__ */ jsxs("div", { className: styles$5.dataConflictsWrapper, children: [
2338
- /* @__PURE__ */ jsxs("div", { className: styles$5.dataConflictsHeader, children: [
2608
+ /* @__PURE__ */ jsxs("div", { className: styles$4.dataConflictsWrapper, children: [
2609
+ /* @__PURE__ */ jsxs("div", { className: styles$4.dataConflictsHeader, children: [
2339
2610
  /* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h1", children: i18n.get(title) }),
2340
2611
  /* @__PURE__ */ jsx(Typography, { variant: "body", children: i18n.get(explanation) })
2341
2612
  ] }),
2342
2613
  showError ? /* @__PURE__ */ jsx(Alert, { variant: "error", title: i18n.get("chooseTheCorrectDetailsBeforeProceeding") }) : void 0,
2343
- /* @__PURE__ */ jsx("dl", { className: styles$5.dataConflictsList, children: keysOf(conflictItems).map((property) => /* @__PURE__ */ jsx(
2614
+ /* @__PURE__ */ jsx("dl", { className: styles$4.dataConflictsList, children: keysOf(conflictItems).map((property) => /* @__PURE__ */ jsx(
2344
2615
  ConflictRow,
2345
2616
  {
2346
2617
  showAs: "listItem",
@@ -2353,7 +2624,7 @@ const DataConflictsModal = ({
2353
2624
  },
2354
2625
  property
2355
2626
  )) }),
2356
- /* @__PURE__ */ jsxs("table", { className: styles$5.dataConflictsTable, children: [
2627
+ /* @__PURE__ */ jsxs("table", { className: styles$4.dataConflictsTable, children: [
2357
2628
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
2358
2629
  /* @__PURE__ */ jsx("th", {}),
2359
2630
  /* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "tertiary", children: i18n.get("youEntered") }) }),
@@ -2410,30 +2681,13 @@ const DataConflictsModal = ({
2410
2681
  )
2411
2682
  ] });
2412
2683
  };
2413
- const formatId = (id, i18n) => {
2414
- switch (id.typeOfIdentity) {
2415
- case "passport":
2416
- return `${i18n.get("passport")} (${id.idNumber})`;
2417
- case "driversLicense":
2418
- return `${i18n.get("driversLicense")} (${id.licenseCardNumber})`;
2419
- case "proofOfIdentityCard":
2420
- return `${i18n.get("proofOfIdentityCard")} (${id.idNumber})`;
2421
- case "nationalIdNumber":
2422
- return `${i18n.get("nationalIdNumber")} (${id.idNumber})`;
2423
- default:
2424
- if (id.idNumber) {
2425
- return `${id.typeOfIdentity || i18n.get("idNumber")} (${id.idNumber})`;
2426
- }
2427
- return `${id.typeOfIdentity}`;
2428
- }
2429
- };
2430
2684
  const verificationDisclaimer = "adyen-kyc-verification-disclaimer";
2431
- const styles$4 = {
2685
+ const styles$3 = {
2432
2686
  verificationDisclaimer
2433
2687
  };
2434
2688
  const IdVerificationDisclaimer = () => {
2435
2689
  const { i18n } = useI18nContext();
2436
- return /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "tertiary", className: styles$4.verificationDisclaimer, children: [
2690
+ return /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "tertiary", className: styles$3.verificationDisclaimer, children: [
2437
2691
  i18n.get("ifYouChooseToUseOnfido"),
2438
2692
  " ",
2439
2693
  /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: i18n.get("onfidoPrivacyPolicy") }),
@@ -2446,25 +2700,25 @@ const IdVerificationDisclaimer = () => {
2446
2700
  const verificationHeader = "adyen-kyc-verification-header";
2447
2701
  const verificationHeaderImage = "adyen-kyc-verification-header-image";
2448
2702
  const verificationHeaderContent = "adyen-kyc-verification-header-content";
2449
- const styles$3 = {
2703
+ const styles$2 = {
2450
2704
  verificationHeader,
2451
2705
  verificationHeaderImage,
2452
2706
  verificationHeaderContent
2453
2707
  };
2454
2708
  const IdVerificationHeader = () => {
2455
2709
  const { i18n } = useI18nContext();
2456
- return /* @__PURE__ */ jsxs("div", { className: styles$3.verificationHeader, children: [
2710
+ return /* @__PURE__ */ jsxs("div", { className: styles$2.verificationHeader, children: [
2457
2711
  /* @__PURE__ */ jsx(
2458
2712
  Svg,
2459
2713
  {
2460
- className: styles$3.verificationHeaderImage,
2714
+ className: styles$2.verificationHeaderImage,
2461
2715
  type: "image",
2462
2716
  name: "passport-front-green",
2463
2717
  title: i18n.get("instantIDVerificationDescription")
2464
2718
  }
2465
2719
  ),
2466
2720
  /* @__PURE__ */ jsx(Typography, { variant: "title-l", children: i18n.get("capturePersonalDetails") }),
2467
- /* @__PURE__ */ jsxs(Typography, { variant: "body", color: "primary", className: styles$3.verificationHeaderContent, children: [
2721
+ /* @__PURE__ */ jsxs(Typography, { variant: "body", color: "primary", className: styles$2.verificationHeaderContent, children: [
2468
2722
  i18n.get("takeOrUploadAPhoto"),
2469
2723
  " ",
2470
2724
  /* @__PURE__ */ jsx(Link, { href: "https://onfido.com", external: true, inline: true, children: i18n.get("onfido") })
@@ -2472,46 +2726,52 @@ const IdVerificationHeader = () => {
2472
2726
  ] });
2473
2727
  };
2474
2728
  const verifyOnfidoContainer = "adyen-kyc-verify-onfido-container";
2729
+ const verifyOnfidoError = "adyen-kyc-verify-onfido-error";
2475
2730
  const verifyOnfidoContent = "adyen-kyc-verify-onfido-content";
2476
- const styles$2 = {
2731
+ const styles$1 = {
2477
2732
  verifyOnfidoContainer,
2733
+ verifyOnfidoError,
2478
2734
  verifyOnfidoContent
2479
2735
  };
2480
2736
  const toIndividualOnfidoConflictSchema = ({
2481
2737
  basicDetails,
2482
2738
  additionalPersonalDetails
2483
- }) => ({
2484
- firstName: basicDetails == null ? void 0 : basicDetails.firstName,
2485
- lastName: basicDetails == null ? void 0 : basicDetails.lastName,
2486
- email: basicDetails == null ? void 0 : basicDetails.email,
2487
- phoneNumber: basicDetails == null ? void 0 : basicDetails.phoneNumber,
2488
- id: {
2489
- idNumber: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.idNumber,
2490
- typeOfIdentity: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.typeOfIdentity,
2491
- issuerState: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.issuerState,
2492
- licenseCardNumber: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.licenseCardNumber,
2493
- expiryDate: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.expiryDate
2494
- },
2495
- birthDate: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.birthDate,
2496
- nationality: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.nationality,
2497
- address: pick(
2498
- "address",
2499
- "otherAddressInformation",
2500
- "postalCode",
2501
- "city",
2502
- "stateOrProvince",
2503
- "country"
2504
- ).from(additionalPersonalDetails)
2505
- });
2739
+ }) => {
2740
+ return {
2741
+ // from basicDetails
2742
+ firstName: basicDetails?.firstName,
2743
+ lastName: basicDetails?.lastName,
2744
+ email: basicDetails?.email,
2745
+ phoneNumber: basicDetails?.phoneNumber,
2746
+ // from additionalPersonalDetails
2747
+ birthDate: additionalPersonalDetails?.birthDate,
2748
+ nationality: additionalPersonalDetails?.nationality,
2749
+ address: pick(
2750
+ "address",
2751
+ "otherAddressInformation",
2752
+ "postalCode",
2753
+ "city",
2754
+ "stateOrProvince",
2755
+ "country"
2756
+ ).from(additionalPersonalDetails),
2757
+ // from additionalPersonalDetails (flattened so that `id` fields can be compared at granular level)
2758
+ idNumber: additionalPersonalDetails?.idNumber,
2759
+ typeOfIdentity: additionalPersonalDetails?.typeOfIdentity,
2760
+ issuerState: additionalPersonalDetails?.issuerState,
2761
+ licenseCardNumber: additionalPersonalDetails?.licenseCardNumber,
2762
+ expiryDate: additionalPersonalDetails?.expiryDate
2763
+ };
2764
+ };
2506
2765
  const fromIndividualOnfidoConflictSchema = ({
2507
2766
  firstName,
2508
2767
  lastName,
2509
2768
  email,
2510
2769
  phoneNumber,
2511
- id,
2512
2770
  birthDate,
2513
2771
  nationality: nationality2,
2514
- address
2772
+ address,
2773
+ ...idFields
2774
+ // The rest of the properties are the flattened ID Fields
2515
2775
  }) => ({
2516
2776
  basicDetails: {
2517
2777
  firstName,
@@ -2522,11 +2782,8 @@ const fromIndividualOnfidoConflictSchema = ({
2522
2782
  additionalPersonalDetails: {
2523
2783
  birthDate,
2524
2784
  nationality: nationality2,
2525
- idNumber: id == null ? void 0 : id.idNumber,
2526
- typeOfIdentity: id == null ? void 0 : id.typeOfIdentity,
2527
- issuerState: id == null ? void 0 : id.issuerState,
2528
- licenseCardNumber: id == null ? void 0 : id.licenseCardNumber,
2529
- expiryDate: id == null ? void 0 : id.expiryDate,
2785
+ // Reconstruct the `id` object from the flattened top-level properties
2786
+ ...idFields,
2530
2787
  ...address
2531
2788
  }
2532
2789
  });
@@ -2617,12 +2874,12 @@ const OnfidoVerificationModal = ({
2617
2874
  ) });
2618
2875
  };
2619
2876
  const uploadedDocument = "adyen-kyc-uploaded-document";
2620
- const styles$1 = {
2877
+ const styles = {
2621
2878
  uploadedDocument
2622
2879
  };
2623
2880
  const UploadedDocument = ({ document, onDelete, onUpdate }) => {
2624
2881
  const { i18n } = useI18nContext();
2625
- return /* @__PURE__ */ jsxs("article", { className: styles$1.uploadedDocument, children: [
2882
+ return /* @__PURE__ */ jsxs("article", { className: styles.uploadedDocument, children: [
2626
2883
  /* @__PURE__ */ jsxs("div", { children: [
2627
2884
  /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "title", children: i18n.get(document.idDocumentType) }),
2628
2885
  /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("uploadedOn", {
@@ -2652,8 +2909,13 @@ const idVerificationMethodFields = [
2652
2909
  "idDocument"
2653
2910
  ];
2654
2911
  function IdVerificationMethod(props) {
2655
- var _a, _b, _c, _d, _e;
2656
- const { legalEntityId, handlers, formVerificationErrors, fieldValidationErrors } = props;
2912
+ const {
2913
+ legalEntityId,
2914
+ handlers,
2915
+ formVerificationErrors,
2916
+ fieldValidationErrors,
2917
+ hasLiveSelfieErrorCode
2918
+ } = props;
2657
2919
  const { i18n } = useI18nContext();
2658
2920
  const userEvents = useAnalyticsContext();
2659
2921
  const extractDocumentInformation2 = useExtractDocumentInformation();
@@ -2661,7 +2923,7 @@ function IdVerificationMethod(props) {
2661
2923
  form: { data, handleChangeFor, setFormData }
2662
2924
  } = useFormContext();
2663
2925
  const datasetUtils = datasetUtilities(i18n.locale);
2664
- const existingDocument = (_a = data.idVerificationMethod) == null ? void 0 : _a.idDocument;
2926
+ const existingDocument = data.idVerificationMethod?.idDocument;
2665
2927
  const hasExistingDocument = !isEmpty$1(existingDocument);
2666
2928
  const handleFieldChange = useCallback(
2667
2929
  (fieldName, mode = "input") => handleChangeFor(fieldName, "idVerificationMethod", mode),
@@ -2686,9 +2948,7 @@ function IdVerificationMethod(props) {
2686
2948
  );
2687
2949
  const conflictRules = useMemo(
2688
2950
  () => ({
2689
- address: createAddressConflictRule(datasetUtils),
2690
- id: createIdConflictRule()
2691
- // ignore id related conflicts
2951
+ address: createAddressConflictRule(datasetUtils)
2692
2952
  }),
2693
2953
  [datasetUtils]
2694
2954
  );
@@ -2699,6 +2959,24 @@ function IdVerificationMethod(props) {
2699
2959
  setOcrExtractedData(void 0);
2700
2960
  handlers.handleContinueToAdditionalDetails();
2701
2961
  };
2962
+ const validateExtractionResult = (extractionResult) => {
2963
+ const { isExpired, isValidDocumentType, dateOfBirth, issuingCountry } = extractionResult;
2964
+ if (isExpired) {
2965
+ return { key: "theDocumentYouUploadedIsExpired" };
2966
+ }
2967
+ if (isValidDocumentType === false) {
2968
+ return { key: "theDocumentTypeYouUploadedIsNotSupported" };
2969
+ }
2970
+ if (isPersonUnderAge(dateOfBirth, issuingCountry)) {
2971
+ return {
2972
+ key: "weDontAcceptDocumentsOrInformationAboutAnyoneYoungerThan_",
2973
+ options: {
2974
+ values: { minimumOnboardingAge: extractionResult.minimumOnboardingAge?.toString() ?? "" }
2975
+ }
2976
+ };
2977
+ }
2978
+ return null;
2979
+ };
2702
2980
  const { hasConflicts, conflictingProperties, resolvedData } = useDataConflicts(
2703
2981
  comparableExistingData,
2704
2982
  comparableExtractedData,
@@ -2706,9 +2984,9 @@ function IdVerificationMethod(props) {
2706
2984
  onAutoResolve
2707
2985
  );
2708
2986
  const minimumApplicantDetails = {
2709
- firstName: (_b = data.basicDetails) == null ? void 0 : _b.firstName,
2710
- lastName: (_c = data.basicDetails) == null ? void 0 : _c.lastName,
2711
- residencyCountry: (_d = data.additionalPersonalDetails) == null ? void 0 : _d.country
2987
+ firstName: data.basicDetails?.firstName,
2988
+ lastName: data.basicDetails?.lastName,
2989
+ residencyCountry: data.additionalPersonalDetails?.country
2712
2990
  };
2713
2991
  const launchOnfido = () => {
2714
2992
  clearError();
@@ -2724,13 +3002,18 @@ function IdVerificationMethod(props) {
2724
3002
  clearError();
2725
3003
  setShowLoadingSpinner(true);
2726
3004
  setStatus("extractionLoading");
2727
- const { document_front, document_back } = onfidoResult;
2728
- const documentIds = [document_front.id];
2729
- if (document_back) documentIds.push(document_back.id);
3005
+ const documentIds = [onfidoResult.document_front.id];
3006
+ if (onfidoResult.document_back) documentIds.push(onfidoResult.document_back.id);
2730
3007
  try {
2731
3008
  const extractionResult = await extractDocumentInformation2.mutateAsync({
2732
3009
  documents: documentIds.map((documentId) => ({ documentId }))
2733
3010
  });
3011
+ const validationError = validateExtractionResult(extractionResult);
3012
+ if (validationError) {
3013
+ setError(validationError);
3014
+ setStatus("ready");
3015
+ return;
3016
+ }
2734
3017
  setOcrExtractedData(extractionResult);
2735
3018
  handleFieldChange("idDocument")({
2736
3019
  instantIdVerificationData: onfidoResult,
@@ -2740,14 +3023,28 @@ function IdVerificationMethod(props) {
2740
3023
  });
2741
3024
  setStatus("ready");
2742
3025
  } catch (err) {
2743
- handleOnfidoError(err);
3026
+ handleOnfidoExtractionError(err);
3027
+ handleFieldChange("idDocument")({
3028
+ instantIdVerificationData: onfidoResult,
3029
+ idDocumentType: onfidoResult.document_front.type,
3030
+ modificationDate: (/* @__PURE__ */ new Date()).toISOString()
3031
+ });
2744
3032
  } finally {
2745
3033
  setShowLoadingSpinner(false);
2746
3034
  }
2747
3035
  };
3036
+ const handleOnfidoExtractionError = (error2) => {
3037
+ logger$2.error("Onfido extraction error", error2);
3038
+ userEvents.addPageEvent("Encountered error", {
3039
+ actionType: "submit",
3040
+ returnType: "onfido",
3041
+ returnValue: "weCouldNotExtractDocumentInformation"
3042
+ });
3043
+ setStatus("ready");
3044
+ };
2748
3045
  const handleOnfidoError = (error2) => {
2749
3046
  logger$2.error("Onfido error", error2);
2750
- setError("weCouldNotReachOnfido");
3047
+ setError({ key: "weCouldNotReachOnfido" });
2751
3048
  userEvents.addPageEvent("Encountered error", {
2752
3049
  actionType: "submit",
2753
3050
  returnType: "onfido",
@@ -2787,6 +3084,9 @@ function IdVerificationMethod(props) {
2787
3084
  handleFieldChange("idDocument")(void 0);
2788
3085
  }
2789
3086
  };
3087
+ if (hasLiveSelfieErrorCode && data.idVerificationMethod?.idVerificationMethod === "existingDocument") {
3088
+ handleDeleteDocument();
3089
+ }
2790
3090
  const handleCancelDeleteDocument = () => {
2791
3091
  setStatus("ready");
2792
3092
  userEvents.addPageEvent("Clicked button", {
@@ -2811,7 +3111,8 @@ function IdVerificationMethod(props) {
2811
3111
  };
2812
3112
  const modalProvidedData = resolvedData || comparableExistingData;
2813
3113
  const formUtils = createFormUtils(props, i18n);
2814
- return /* @__PURE__ */ jsxs("div", { className: styles$2.verifyOnfidoContainer, children: [
3114
+ isNextStepDisabled.value = showLoadingSpinner;
3115
+ return /* @__PURE__ */ jsxs("div", { className: styles$1.verifyOnfidoContainer, children: [
2815
3116
  /* @__PURE__ */ jsx(
2816
3117
  ErrorPanel,
2817
3118
  {
@@ -2822,8 +3123,15 @@ function IdVerificationMethod(props) {
2822
3123
  }
2823
3124
  ),
2824
3125
  /* @__PURE__ */ jsx(IdVerificationHeader, {}),
2825
- error ? /* @__PURE__ */ jsx(Alert, { variant: "error", title: i18n.get(error) }) : void 0,
2826
- /* @__PURE__ */ jsx("div", { className: styles$2.verifyOnfidoContent, children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : /* @__PURE__ */ jsx(Fragment, { children: hasExistingDocument ? /* @__PURE__ */ jsx(
3126
+ error ? /* @__PURE__ */ jsx(
3127
+ Alert,
3128
+ {
3129
+ variant: "error",
3130
+ title: i18n.get(error.key, error.options),
3131
+ className: styles$1.verifyOnfidoError
3132
+ }
3133
+ ) : void 0,
3134
+ /* @__PURE__ */ jsx("div", { className: styles$1.verifyOnfidoContent, children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : /* @__PURE__ */ jsx(Fragment, { children: hasExistingDocument ? /* @__PURE__ */ jsx(
2827
3135
  UploadedDocument,
2828
3136
  {
2829
3137
  document: existingDocument,
@@ -2841,7 +3149,7 @@ function IdVerificationMethod(props) {
2841
3149
  onClick: launchOnfido
2842
3150
  }
2843
3151
  ),
2844
- !((_e = showIndividualMotionCapture) == null ? void 0 : _e.value) && /* @__PURE__ */ jsx(
3152
+ !showIndividualMotionCapture?.value && /* @__PURE__ */ jsx(
2845
3153
  Button,
2846
3154
  {
2847
3155
  onClick: () => setStatus("confirmManualFlowModal"),
@@ -2890,8 +3198,7 @@ function IdVerificationMethod(props) {
2890
3198
  detectedData: comparableExtractedData,
2891
3199
  conflictingProperties,
2892
3200
  formatters: {
2893
- address: (val) => addressToString(val, datasetUtils),
2894
- id: (val) => formatId(val, i18n)
3201
+ address: (val) => addressToString(val, datasetUtils)
2895
3202
  },
2896
3203
  title: "confirmPersonalDetails",
2897
3204
  explanation: "theDetailsYouEnteredDontMatch",
@@ -2906,13 +3213,12 @@ function IdVerificationMethod(props) {
2906
3213
  ] });
2907
3214
  }
2908
3215
  const ManualIdUpload = () => {
2909
- var _a, _b;
2910
3216
  const { form } = useFormContext();
2911
3217
  const { handleChangeFor } = form;
2912
3218
  const data = form.data.manualIdUpload;
2913
3219
  const valid = form.valid.manualIdUpload;
2914
3220
  const errors = form.errors.manualIdUpload;
2915
- const name = `${(_a = form.data.basicDetails) == null ? void 0 : _a.firstName} ${(_b = form.data.basicDetails) == null ? void 0 : _b.lastName}`;
3221
+ const name = `${form.data.basicDetails?.firstName} ${form.data.basicDetails?.lastName}`;
2916
3222
  const handleFieldChange = (fieldName, mode) => handleChangeFor(fieldName, "manualIdUpload", mode);
2917
3223
  return /* @__PURE__ */ jsx(
2918
3224
  IdDocumentManualUpload,
@@ -2925,70 +3231,50 @@ const ManualIdUpload = () => {
2925
3231
  }
2926
3232
  );
2927
3233
  };
2928
- const getDisplayErrorMessage = (errorMessage, i18n) => {
2929
- return typeof errorMessage !== "boolean" ? i18n.get(errorMessage) : errorMessage;
3234
+ const getDisplayErrorMessage = (errorMessage, t) => {
3235
+ return typeof errorMessage !== "boolean" ? translateStringOrObject(t, errorMessage) : errorMessage;
2930
3236
  };
2931
- const guidanceQuestion = "adyen-kyc-guidance-question";
2932
- const options = "adyen-kyc-options";
2933
- const styles = {
2934
- guidanceQuestion,
2935
- options
2936
- };
2937
- const GuidanceQuestion = (props) => {
2938
- const {
2939
- descriptionLinkText,
2940
- errorMessage,
2941
- name,
2942
- noLabel,
2943
- onChange,
2944
- onDescriptionLinkClick,
2945
- question,
2946
- value,
2947
- yesLabel
2948
- } = props;
3237
+ const SignatoryQuestionnaireModalContent = () => {
2949
3238
  const { i18n } = useI18nContext();
2950
- const handleChange = (selectedValue) => {
2951
- const newValue = selectedValue || null;
2952
- onChange(newValue);
2953
- };
2954
- const yesTileLabel = yesLabel ?? i18n.get("yes");
2955
- const noTileLabel = noLabel ?? i18n.get("no");
2956
- return /* @__PURE__ */ jsxs("div", { className: styles.guidanceQuestion, children: [
2957
- /* @__PURE__ */ jsx(Typography, { variant: "body", el: "p", children: question }),
2958
- descriptionLinkText && onDescriptionLinkClick && /* @__PURE__ */ jsx(Button, { variant: "link", onClick: onDescriptionLinkClick, children: descriptionLinkText }),
2959
- /* @__PURE__ */ jsx(Field, { name, className: styles.options, children: () => /* @__PURE__ */ jsx(
2960
- TileGroup,
2961
- {
2962
- allowMultiple: false,
2963
- errorMessage,
2964
- isHorizontal: true,
2965
- maxSelected: 1,
2966
- name,
2967
- onChange: handleChange,
2968
- selected: value || "",
2969
- tiles: [
2970
- { label: yesTileLabel, value: "yes" },
2971
- { label: noTileLabel, value: "no" }
2972
- ]
2973
- }
2974
- ) })
3239
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3240
+ /* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h3", className: "adyen-kyc-u-margin-bottom-40", children: i18n.get("moreAboutAuthorizedSignatories") }),
3241
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("signatoryDescriptionQ1") }),
3242
+ /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("signatoryDescriptionA1") }),
3243
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("signatoryDescriptionQ2") }),
3244
+ /* @__PURE__ */ jsx(Typography, { el: "p", children: i18n.get("signatoryDescriptionA2") })
2975
3245
  ] });
2976
3246
  };
2977
3247
  function SignatoryQuestionnaire(props) {
3248
+ const { t } = useTranslation();
2978
3249
  const { i18n } = useI18nContext();
3250
+ const userEvents = useAnalyticsContext();
3251
+ const [isModalOpen, setIsModalOpen] = useState(false);
2979
3252
  const {
2980
3253
  data,
2981
3254
  errors,
2982
3255
  formVerificationErrors,
2983
3256
  heading,
2984
3257
  fieldValidationErrors,
2985
- handleDescriptionLinkClick,
2986
3258
  handleFieldChange
2987
3259
  } = props;
2988
3260
  const formUtils = createFormUtils(props, i18n);
2989
3261
  if (!handleFieldChange) {
2990
3262
  return;
2991
3263
  }
3264
+ const openModal = () => {
3265
+ userEvents.addPageEvent("Opened modal", {
3266
+ actionType: "open",
3267
+ label: "isSignatoryModal"
3268
+ });
3269
+ setIsModalOpen(true);
3270
+ };
3271
+ const closeModal = () => {
3272
+ userEvents.addPageEvent("Closed modal", {
3273
+ actionType: "close",
3274
+ label: "isSignatoryModal"
3275
+ });
3276
+ setIsModalOpen(false);
3277
+ };
2992
3278
  const errorMessage = formUtils.getErrorMessage("isSignatory", errors, fieldValidationErrors);
2993
3279
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__personal-details", "aria-describedby": "ariaErrorField", children: [
2994
3280
  /* @__PURE__ */ jsx(FormHeader, { heading }),
@@ -3005,23 +3291,92 @@ function SignatoryQuestionnaire(props) {
3005
3291
  GuidanceQuestion,
3006
3292
  {
3007
3293
  name: "isSignatory",
3008
- value: data == null ? void 0 : data.isSignatory,
3294
+ value: data?.isSignatory,
3009
3295
  onChange: handleFieldChange("isSignatory"),
3010
- onDescriptionLinkClick: handleDescriptionLinkClick,
3296
+ onDescriptionLinkClick: openModal,
3011
3297
  question: i18n.get("signatoryQuestion"),
3012
3298
  descriptionLinkText: i18n.get("whatDoesThisMean"),
3013
- errorMessage: getDisplayErrorMessage(errorMessage, i18n)
3299
+ errorMessage: getDisplayErrorMessage(errorMessage, t)
3014
3300
  }
3015
- )
3301
+ ),
3302
+ isModalOpen && /* @__PURE__ */ jsx(Modal, { onClose: closeModal, ariaLabel: i18n.get("moreAboutAuthorizedSignatories"), inset: true, children: /* @__PURE__ */ jsx(SignatoryQuestionnaireModalContent, {}) })
3016
3303
  ] });
3017
3304
  }
3305
+ const UboQuestionnaireModalContent = ({ modalType }) => {
3306
+ const { t } = useTranslation();
3307
+ const { i18n } = useI18nContext();
3308
+ switch (modalType) {
3309
+ case "isOwner":
3310
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3311
+ /* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h3", className: "adyen-kyc-u-margin-bottom-40", children: i18n.get("moreAboutOwners") }),
3312
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("ownersDescriptionQ1") }),
3313
+ /* @__PURE__ */ jsx(Typography, { el: "p", children: i18n.get("ownersDescriptionA1P1") }),
3314
+ /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("ownersDescriptionA1P2") }),
3315
+ /* @__PURE__ */ jsx(
3316
+ Alert,
3317
+ {
3318
+ title: i18n.get("ownersDescriptionAlertTitle"),
3319
+ icon: false,
3320
+ className: "adyen-kyc-u-margin-bottom-32",
3321
+ children: i18n.get("ownersDescriptionAlertContent")
3322
+ }
3323
+ ),
3324
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("ownersDescriptionQ2") }),
3325
+ /* @__PURE__ */ jsx(Typography, { el: "p", children: i18n.get("ownersDescriptionA2P1") }),
3326
+ /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("ownersDescriptionA2P2") }),
3327
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("ownersDescriptionQ3") }),
3328
+ /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("ownersDescriptionA3") }),
3329
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("ownersDescriptionQ4") }),
3330
+ /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("ownersDescriptionA4") })
3331
+ ] });
3332
+ case "isControllingPerson":
3333
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3334
+ /* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h3", className: "adyen-kyc-u-margin-bottom-40", children: i18n.get("moreAboutOwnershipThroughControl") }),
3335
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("controllingPersonDescriptionQ1") }),
3336
+ /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("controllingPersonDescriptionA1P1") }),
3337
+ /* @__PURE__ */ jsxs("ul", { children: [
3338
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L1"] }) }),
3339
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L2"] }) }),
3340
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L3"] }) }),
3341
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L4"] }) })
3342
+ ] }),
3343
+ /* @__PURE__ */ jsx(
3344
+ Alert,
3345
+ {
3346
+ title: i18n.get("ownersDescriptionAlertTitle"),
3347
+ icon: false,
3348
+ className: "adyen-kyc-u-margin-bottom-32",
3349
+ children: i18n.get("controllingPersonDescriptionAlertContent")
3350
+ }
3351
+ ),
3352
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("ownersDescriptionQ4") }),
3353
+ /* @__PURE__ */ jsx(Typography, { el: "p", children: i18n.get("ownersDescriptionA4") }),
3354
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("controllingPersonDescriptionQ2") }),
3355
+ /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("controllingPersonDescriptionA2") })
3356
+ ] });
3357
+ case "isDirector":
3358
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3359
+ /* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h3", className: "adyen-kyc-u-margin-bottom-40", children: i18n.get("moreAboutDirectors") }),
3360
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("directorDescriptionQ1") }),
3361
+ /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("directorDescriptionA1") }),
3362
+ /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("directorDescriptionQ2") }),
3363
+ /* @__PURE__ */ jsx(Typography, { el: "p", children: i18n.get("directorDescriptionA2") })
3364
+ ] });
3365
+ default:
3366
+ return null;
3367
+ }
3368
+ };
3018
3369
  const uboQuestionnaireFields = [
3019
3370
  "isOwner",
3020
3371
  "isControllingPerson",
3021
- "isDirector"
3372
+ "isDirector",
3373
+ "isNomineeDirector",
3374
+ "isNomineeShareholder"
3022
3375
  ];
3023
3376
  function UboQuestionnaire(props) {
3377
+ const { t } = useTranslation();
3024
3378
  const { i18n } = useI18nContext();
3379
+ const userEvents = useAnalyticsContext();
3025
3380
  const {
3026
3381
  data,
3027
3382
  description,
@@ -3029,19 +3384,50 @@ function UboQuestionnaire(props) {
3029
3384
  formVerificationErrors,
3030
3385
  heading,
3031
3386
  fieldValidationErrors,
3032
- handleDescriptionLinkClick,
3033
3387
  handleFieldChange
3034
3388
  } = props;
3035
3389
  const formUtils = createFormUtils(props, i18n);
3390
+ const [activeModal, setActiveModal] = useState(null);
3036
3391
  if (!handleFieldChange) {
3037
3392
  return;
3038
3393
  }
3394
+ const openModal = (modalType) => () => {
3395
+ userEvents.addPageEvent("Opened modal", {
3396
+ actionType: "open",
3397
+ label: `${modalType}Modal`
3398
+ });
3399
+ setActiveModal(modalType);
3400
+ };
3401
+ const closeModal = () => {
3402
+ if (activeModal) {
3403
+ userEvents.addPageEvent("Closed modal", {
3404
+ actionType: "close",
3405
+ label: `${activeModal}Modal`
3406
+ });
3407
+ }
3408
+ setActiveModal(null);
3409
+ };
3410
+ const modalAriaLabelMap = {
3411
+ isOwner: i18n.get("moreAboutOwners"),
3412
+ isControllingPerson: i18n.get("moreAboutOwnershipThroughControl"),
3413
+ isDirector: i18n.get("moreAboutDirectors")
3414
+ };
3039
3415
  const isDirectorErrorMessage = formUtils.getErrorMessage(
3040
3416
  "isDirector",
3041
3417
  errors,
3042
3418
  fieldValidationErrors
3043
3419
  );
3420
+ const isNomineeDirectorErrorMessage = formUtils.getErrorMessage(
3421
+ "isNomineeDirector",
3422
+ errors,
3423
+ fieldValidationErrors
3424
+ );
3044
3425
  const isOwnerErrorMessage = formUtils.getErrorMessage("isOwner", errors, fieldValidationErrors);
3426
+ const isNomineeShareholderErrorMessage = formUtils.getErrorMessage(
3427
+ "isNomineeShareholder",
3428
+ errors,
3429
+ fieldValidationErrors
3430
+ );
3045
3431
  const isControllingPersonErrorMessage = formUtils.getErrorMessage(
3046
3432
  "isControllingPerson",
3047
3433
  errors,
@@ -3062,38 +3448,59 @@ function UboQuestionnaire(props) {
3062
3448
  GuidanceQuestion,
3063
3449
  {
3064
3450
  name: "isDirector",
3065
- value: data == null ? void 0 : data.isDirector,
3451
+ value: data?.isDirector,
3066
3452
  onChange: handleFieldChange("isDirector"),
3067
- onDescriptionLinkClick: handleDescriptionLinkClick,
3453
+ onDescriptionLinkClick: openModal("isDirector"),
3068
3454
  question: i18n.get("directorQuestion"),
3069
3455
  descriptionLinkText: i18n.get("whatDoesThisMean"),
3070
- errorMessage: getDisplayErrorMessage(isDirectorErrorMessage, i18n)
3456
+ errorMessage: getDisplayErrorMessage(isDirectorErrorMessage, t)
3457
+ }
3458
+ ),
3459
+ formUtils.isRequiredField("isNomineeDirector") && data?.isDirector === GuidanceQuestionValues.YES && /* @__PURE__ */ jsx(
3460
+ GuidanceQuestion,
3461
+ {
3462
+ name: "isNomineeDirector",
3463
+ value: data?.isNomineeDirector,
3464
+ onChange: handleFieldChange("isNomineeDirector"),
3465
+ question: i18n.get("nomineeDirectorQuestion"),
3466
+ errorMessage: getDisplayErrorMessage(isNomineeDirectorErrorMessage, t)
3071
3467
  }
3072
3468
  ),
3073
3469
  formUtils.isRequiredField("isOwner") && /* @__PURE__ */ jsx(
3074
3470
  GuidanceQuestion,
3075
3471
  {
3076
3472
  name: "isOwner",
3077
- value: data == null ? void 0 : data.isOwner,
3473
+ value: data?.isOwner,
3078
3474
  onChange: handleFieldChange("isOwner"),
3079
- onDescriptionLinkClick: handleDescriptionLinkClick,
3475
+ onDescriptionLinkClick: openModal("isOwner"),
3080
3476
  question: i18n.get("ownerQuestion"),
3081
3477
  descriptionLinkText: i18n.get("whatDoesThisMean"),
3082
- errorMessage: getDisplayErrorMessage(isOwnerErrorMessage, i18n)
3478
+ errorMessage: getDisplayErrorMessage(isOwnerErrorMessage, t)
3479
+ }
3480
+ ),
3481
+ formUtils.isRequiredField("isNomineeShareholder") && data?.isOwner === GuidanceQuestionValues.YES && /* @__PURE__ */ jsx(
3482
+ GuidanceQuestion,
3483
+ {
3484
+ name: "isNomineeShareholder",
3485
+ value: data?.isNomineeShareholder,
3486
+ onChange: handleFieldChange("isNomineeShareholder"),
3487
+ question: i18n.get("nomineeShareHolderQuestion"),
3488
+ errorMessage: getDisplayErrorMessage(isNomineeShareholderErrorMessage, t)
3083
3489
  }
3084
3490
  ),
3085
3491
  formUtils.isRequiredField("isControllingPerson") && /* @__PURE__ */ jsx(
3086
3492
  GuidanceQuestion,
3087
3493
  {
3088
3494
  name: "isControllingPerson",
3089
- value: data == null ? void 0 : data.isControllingPerson,
3495
+ value: data?.isControllingPerson,
3090
3496
  onChange: handleFieldChange("isControllingPerson"),
3091
- onDescriptionLinkClick: handleDescriptionLinkClick,
3497
+ onDescriptionLinkClick: openModal("isControllingPerson"),
3092
3498
  question: i18n.get("controllingPersonQuestion"),
3093
3499
  descriptionLinkText: i18n.get("whatDoesThisMean"),
3094
- errorMessage: getDisplayErrorMessage(isControllingPersonErrorMessage, i18n)
3500
+ errorMessage: getDisplayErrorMessage(isControllingPersonErrorMessage, t)
3095
3501
  }
3096
- )
3502
+ ),
3503
+ activeModal && /* @__PURE__ */ jsx(Modal, { onClose: closeModal, ariaLabel: modalAriaLabelMap[activeModal], inset: true, children: /* @__PURE__ */ jsx(UboQuestionnaireModalContent, { modalType: activeModal }) })
3097
3504
  ] });
3098
3505
  }
3099
3506
  const logger$1 = createLogger();
@@ -3153,15 +3560,17 @@ const manualIdUploadFormID = individualOnfidoForms.manualIdUpload.formId;
3153
3560
  const proofOfResidencyFormID = individualOnfidoForms.proofOfResidency.formId;
3154
3561
  const proofOfNationalIdFormID = individualOnfidoForms.proofOfNationalId.formId;
3155
3562
  const proofOfRelationshipFormID = individualOnfidoForms.proofOfRelationship.formId;
3563
+ const LIVE_SELFIE_ERROR_CODE = "2_8210";
3156
3564
  function IndividualOnfido(props) {
3157
- var _a, _b, _c, _d, _e;
3158
3565
  const { i18n } = useI18nContext();
3566
+ const userEvents = useAnalyticsContext();
3159
3567
  const {
3160
3568
  form: { errors, valid, fieldProblems: fieldValidationErrors, handleChangeFor, setFormData }
3161
3569
  } = useFormContext();
3162
3570
  const { setFormIndex } = useFormRouterContext();
3163
3571
  const { isExperimentEnabled } = useExperimentsContext();
3164
3572
  const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
3573
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
3165
3574
  const [isDecisionMakerNotRequiredModalOpen, setIsDecisionMakerNotRequiredModalOpen] = useState(false);
3166
3575
  const {
3167
3576
  activeForm: propActiveForm,
@@ -3186,31 +3595,42 @@ function IndividualOnfido(props) {
3186
3595
  const proofOfResidencyFormProps = getFormProps(props, proofOfResidencyFormID);
3187
3596
  const proofOfNationalIdFormProps = getFormProps(props, proofOfNationalIdFormID);
3188
3597
  const proofOfRelationshipFormProps = getFormProps(props, proofOfRelationshipFormID);
3189
- const countryOfResidence = ((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country) ?? defaultCountry;
3598
+ const countryOfResidence = data?.additionalPersonalDetails?.country ?? defaultCountry;
3190
3599
  const handleNextForPersonNotRequired = () => {
3191
- var _a2;
3192
- if (!(data == null ? void 0 : data.signatoryQuestionnaire) && !(data == null ? void 0 : data.uboQuestionnaire)) return;
3600
+ if (!data?.signatoryQuestionnaire && !data?.uboQuestionnaire) return;
3193
3601
  const { signatoryQuestionnaire, uboQuestionnaire } = data;
3194
- const isDirectorApplicable = (_a2 = uboQuestionnaireFormProps == null ? void 0 : uboQuestionnaireFormProps.requiredFields) == null ? void 0 : _a2.includes("isDirector");
3195
- const isNotRequired = signatoryQuestionnaire && uboQuestionnaire && (signatoryQuestionnaire == null ? void 0 : signatoryQuestionnaire.isSignatory) === "no" && (uboQuestionnaire == null ? void 0 : uboQuestionnaire.isOwner) === "no" && (uboQuestionnaire == null ? void 0 : uboQuestionnaire.isControllingPerson) === "no" && (!isDirectorApplicable || (uboQuestionnaire == null ? void 0 : uboQuestionnaire.isDirector) === "no");
3602
+ const isDirectorApplicable = uboQuestionnaireFormProps?.requiredFields?.includes("isDirector");
3603
+ const isNotRequired = signatoryQuestionnaire && uboQuestionnaire && signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.NO && uboQuestionnaire?.isOwner === GuidanceQuestionValues.NO && uboQuestionnaire?.isControllingPerson === GuidanceQuestionValues.NO && (!isDirectorApplicable || uboQuestionnaire?.isDirector === GuidanceQuestionValues.NO);
3196
3604
  if (isNotRequired) {
3605
+ userEvents.addPageEvent("Opened modal", {
3606
+ actionType: "open",
3607
+ label: "personalInfoNotNeeded"
3608
+ });
3197
3609
  setIsDecisionMakerNotRequiredModalOpen(true);
3198
3610
  } else {
3199
- onNext == null ? void 0 : onNext();
3611
+ onNext?.();
3200
3612
  }
3201
3613
  };
3202
3614
  useEffect(() => {
3203
3615
  if (propActiveForm.formId === uboQuestionnaireFormID) {
3204
- setNextHandler == null ? void 0 : setNextHandler(() => handleNextForPersonNotRequired);
3616
+ setNextHandler?.(() => handleNextForPersonNotRequired);
3205
3617
  } else {
3206
- setNextHandler == null ? void 0 : setNextHandler(void 0);
3618
+ setNextHandler?.(void 0);
3207
3619
  }
3208
3620
  }, [propActiveForm, setNextHandler, data]);
3209
3621
  const handleCloseModalAndGoBack = () => {
3622
+ userEvents.addPageEvent("Closed modal", {
3623
+ actionType: "close",
3624
+ label: "personalInfoNotNeeded"
3625
+ });
3210
3626
  setIsDecisionMakerNotRequiredModalOpen(false);
3211
- handleHomeClick == null ? void 0 : handleHomeClick();
3627
+ handleHomeClick?.();
3212
3628
  };
3213
3629
  const handleCloseModalAndChangeAnswers = () => {
3630
+ userEvents.addPageEvent("Clicked button", {
3631
+ actionType: "cancel",
3632
+ label: `personalInfoNotNeeded`
3633
+ });
3214
3634
  setIsDecisionMakerNotRequiredModalOpen(false);
3215
3635
  };
3216
3636
  const gotoFormByFormId = (formId) => {
@@ -3230,32 +3650,37 @@ function IndividualOnfido(props) {
3230
3650
  const capabilities = useCapabilities();
3231
3651
  const newRoles = useMemo(() => calculateRoles(data), [data]);
3232
3652
  useEffect(() => {
3233
- var _a2;
3234
- if (isGuidedDecisionMakersFlowEnabled) {
3235
- const currentRoles = ((_a2 = data == null ? void 0 : data.basicDetails) == null ? void 0 : _a2.role) ?? [];
3653
+ if (!isGuidedDecisionMakersFlowDisabled && isGuidedDecisionMakersFlowEnabled) {
3654
+ const currentRoles = data?.basicDetails?.role ?? [];
3236
3655
  if (areArraysDifferent(newRoles, currentRoles)) {
3237
- const basicDetailsData = (data == null ? void 0 : data.basicDetails) ?? {};
3656
+ const basicDetailsData = data?.basicDetails ?? {};
3238
3657
  setFormData("basicDetails", { ...basicDetailsData, role: newRoles });
3239
3658
  }
3240
3659
  }
3241
- }, [newRoles, data == null ? void 0 : data.basicDetails, setFormData, isGuidedDecisionMakersFlowEnabled]);
3660
+ }, [
3661
+ newRoles,
3662
+ data?.basicDetails,
3663
+ setFormData,
3664
+ isGuidedDecisionMakersFlowDisabled,
3665
+ isGuidedDecisionMakersFlowEnabled
3666
+ ]);
3667
+ const hasMotionCaptureScenarioValue = hasMotionCaptureScenario?.value;
3242
3668
  useEffect(() => {
3243
- var _a2, _b2;
3244
3669
  setShowIndividualMotionCapture(
3245
3670
  shouldShowMotionCapture({
3246
3671
  capabilities,
3247
- userRoles: (_a2 = data == null ? void 0 : data.basicDetails) == null ? void 0 : _a2.role,
3672
+ userRoles: data?.basicDetails?.role,
3248
3673
  taskType,
3249
- hasMotionScenario: (_b2 = hasMotionCaptureScenario) == null ? void 0 : _b2.value
3674
+ hasMotionScenario: hasMotionCaptureScenarioValue
3250
3675
  })
3251
3676
  );
3252
- }, [(_b = data == null ? void 0 : data.basicDetails) == null ? void 0 : _b.role, taskType, capabilities, (_c = hasMotionCaptureScenario) == null ? void 0 : _c.value]);
3253
- const fullName = `${(_d = data == null ? void 0 : data.basicDetails) == null ? void 0 : _d.firstName} ${(_e = data == null ? void 0 : data.basicDetails) == null ? void 0 : _e.lastName}`;
3677
+ }, [data?.basicDetails?.role, taskType, capabilities, hasMotionCaptureScenarioValue]);
3678
+ const fullName = `${data?.basicDetails?.firstName} ${data?.basicDetails?.lastName}`;
3254
3679
  const handleFieldChange = (formName) => (fieldName, mode) => handleChangeFor(fieldName, formName, mode);
3255
- const handleDescriptionLinkClick = () => {
3256
- };
3680
+ const hasLiveSelfieErrorCode = problems?.missingData?.some(
3681
+ (problem) => problem.code === LIVE_SELFIE_ERROR_CODE && problem.type === "dataMissing"
3682
+ );
3257
3683
  const renderActiveForm = (activeForm) => {
3258
- var _a2, _b2;
3259
3684
  switch (activeForm.formId) {
3260
3685
  case signatoryQuestionnaireFormID:
3261
3686
  return /* @__PURE__ */ jsx(
@@ -3265,9 +3690,8 @@ function IndividualOnfido(props) {
3265
3690
  heading: i18n.get("signatoryQuestionnaireHeader"),
3266
3691
  id: signatoryQuestionnaireFormID,
3267
3692
  handleFieldChange: handleFieldChange("signatoryQuestionnaire"),
3268
- handleDescriptionLinkClick,
3269
- errors: errors == null ? void 0 : errors.signatoryQuestionnaire,
3270
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.signatoryQuestionnaire
3693
+ errors: errors?.signatoryQuestionnaire,
3694
+ fieldValidationErrors: fieldValidationErrors?.signatoryQuestionnaire
3271
3695
  }
3272
3696
  );
3273
3697
  case uboQuestionnaireFormID:
@@ -3279,9 +3703,8 @@ function IndividualOnfido(props) {
3279
3703
  description: i18n.get("uboQuestionnaireDescription"),
3280
3704
  id: uboQuestionnaireFormID,
3281
3705
  handleFieldChange: handleFieldChange("uboQuestionnaire"),
3282
- handleDescriptionLinkClick,
3283
- errors: errors == null ? void 0 : errors.uboQuestionnaire,
3284
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.uboQuestionnaire
3706
+ errors: errors?.uboQuestionnaire,
3707
+ fieldValidationErrors: fieldValidationErrors?.uboQuestionnaire
3285
3708
  }
3286
3709
  );
3287
3710
  case basicDetailsFormID:
@@ -3289,7 +3712,7 @@ function IndividualOnfido(props) {
3289
3712
  BasicDetails,
3290
3713
  {
3291
3714
  ...basicDetailsFormProps,
3292
- data: (data == null ? void 0 : data.basicDetails) ?? {},
3715
+ data: data?.basicDetails ?? {},
3293
3716
  heading: i18n.get("basicInformationFormName"),
3294
3717
  taskType,
3295
3718
  id: basicDetailsFormID,
@@ -3298,9 +3721,9 @@ function IndividualOnfido(props) {
3298
3721
  parentLegalEntity,
3299
3722
  trustedFieldsProvider,
3300
3723
  trustedRoles,
3301
- errors: errors == null ? void 0 : errors.basicDetails,
3302
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.basicDetails,
3303
- valid: valid == null ? void 0 : valid.basicDetails,
3724
+ errors: errors?.basicDetails,
3725
+ fieldValidationErrors: fieldValidationErrors?.basicDetails,
3726
+ valid: valid?.basicDetails,
3304
3727
  handleFieldChange: handleFieldChange("basicDetails")
3305
3728
  }
3306
3729
  );
@@ -3314,8 +3737,9 @@ function IndividualOnfido(props) {
3314
3737
  handleDeleteDocument,
3315
3738
  handleUpdateDocument
3316
3739
  },
3317
- formVerificationErrors: (_a2 = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _a2.idVerificationMethod,
3318
- fieldValidationErrors: (_b2 = problems == null ? void 0 : problems.validationErrors) == null ? void 0 : _b2.idVerificationMethod
3740
+ formVerificationErrors: problems?.verificationErrors?.idVerificationMethod,
3741
+ fieldValidationErrors: problems?.validationErrors?.idVerificationMethod,
3742
+ hasLiveSelfieErrorCode
3319
3743
  }
3320
3744
  );
3321
3745
  case additionalPersonalDetailsFormID:
@@ -3324,12 +3748,12 @@ function IndividualOnfido(props) {
3324
3748
  {
3325
3749
  ...additionalPersonalDetailsFormProps,
3326
3750
  country: countryOfResidence,
3327
- data: (data == null ? void 0 : data.additionalPersonalDetails) ?? {},
3751
+ data: data?.additionalPersonalDetails ?? {},
3328
3752
  heading: i18n.get("additionalPersonalDetails"),
3329
3753
  id: additionalPersonalDetailsFormID,
3330
- errors: errors == null ? void 0 : errors.additionalPersonalDetails,
3331
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.additionalPersonalDetails,
3332
- valid: valid == null ? void 0 : valid.additionalPersonalDetails,
3754
+ errors: errors?.additionalPersonalDetails,
3755
+ fieldValidationErrors: fieldValidationErrors?.additionalPersonalDetails,
3756
+ valid: valid?.additionalPersonalDetails,
3333
3757
  taskType,
3334
3758
  handleFieldChange: handleFieldChange("additionalPersonalDetails")
3335
3759
  }
@@ -3341,7 +3765,7 @@ function IndividualOnfido(props) {
3341
3765
  MemoizedProofOfResidencyUpload,
3342
3766
  {
3343
3767
  ...proofOfResidencyFormProps,
3344
- data: data == null ? void 0 : data.proofOfResidency,
3768
+ data: data?.proofOfResidency,
3345
3769
  id: proofOfResidencyFormID,
3346
3770
  name: fullName,
3347
3771
  errors: errors.proofOfResidency,
@@ -3355,7 +3779,7 @@ function IndividualOnfido(props) {
3355
3779
  MemoizedDocumentUpload,
3356
3780
  {
3357
3781
  ...proofOfNationalIdFormProps,
3358
- data: data == null ? void 0 : data.proofOfNationalId,
3782
+ data: data?.proofOfNationalId,
3359
3783
  documentField: "proofOfNationalId",
3360
3784
  documentType: "registrationDocument",
3361
3785
  heading: i18n.get("proofOfNationalId"),
@@ -3371,7 +3795,7 @@ function IndividualOnfido(props) {
3371
3795
  MemoizedProofOfRelationship,
3372
3796
  {
3373
3797
  ...proofOfRelationshipFormProps,
3374
- data: data == null ? void 0 : data.proofOfRelationship,
3798
+ data: data?.proofOfRelationship,
3375
3799
  id: proofOfRelationshipFormID,
3376
3800
  name: fullName,
3377
3801
  errors: errors.proofOfRelationship,
@@ -3399,56 +3823,76 @@ function IndividualOnfido(props) {
3399
3823
  )
3400
3824
  ] });
3401
3825
  }
3402
- const individualOnfidoObscuredFields = [
3403
- "additionalPersonalDetails.idNumber",
3404
- "additionalPersonalDetails.idNumberExempt"
3405
- ];
3406
- const individualOnfidoBaseMapping = {
3407
- "basicDetails.firstName": "individual.name.firstName",
3408
- "basicDetails.lastName": "individual.name.lastName",
3409
- "basicDetails.phoneNumber.number": "individual.phone.number",
3410
- "basicDetails.phoneNumber.phoneCountryCode": "individual.phone.phoneCountryCode",
3411
- "basicDetails.phoneNumber.type": "individual.phone.type",
3412
- "basicDetails.email": "individual.email",
3413
- "additionalPersonalDetails.birthDate": "individual.birthData.dateOfBirth",
3414
- "additionalPersonalDetails.idNumber": "individual.identificationData.number",
3415
- "additionalPersonalDetails.idNumberExempt": "individual.identificationData.nationalIdExempt",
3416
- "additionalPersonalDetails.typeOfIdentity": "individual.identificationData.type",
3417
- "additionalPersonalDetails.issuerState": "individual.identificationData.issuerState",
3418
- "additionalPersonalDetails.licenseCardNumber": "individual.identificationData.cardNumber",
3419
- "additionalPersonalDetails.expiryDate": "individual.identificationData.expiryDate",
3420
- "additionalPersonalDetails.nationality": "individual.nationality",
3421
- "additionalPersonalDetails.taxInformation": "individual.taxInformation",
3422
- // Address fields
3423
- "additionalPersonalDetails.city": "individual.residentialAddress.city",
3424
- "additionalPersonalDetails.country": "individual.residentialAddress.country",
3425
- "additionalPersonalDetails.postalCode": "individual.residentialAddress.postalCode",
3426
- "additionalPersonalDetails.stateOrProvince": "individual.residentialAddress.stateOrProvince",
3427
- "additionalPersonalDetails.address": "individual.residentialAddress.street",
3428
- "additionalPersonalDetails.otherAddressInformation": "individual.residentialAddress.street2"
3429
- };
3430
- const individualOnfidoApiKeyMapping = {
3431
- ...reverseMapping(individualOnfidoBaseMapping)
3826
+ const getOnfidoIdentityTypeToApiIdentityTypeMap = (data) => {
3827
+ const { country } = data;
3828
+ switch (country) {
3829
+ case CountryCodes.HongKong:
3830
+ return {
3831
+ passport: "passport",
3832
+ driversLicense: "driversLicense",
3833
+ proofOfIdentityCard: "nationalIdNumber"
3834
+ };
3835
+ default:
3836
+ return {
3837
+ nationalIdNumber: "nationalIdNumber",
3838
+ passport: "passport",
3839
+ driversLicense: "driversLicense",
3840
+ proofOfIdentityCard: "identityCard"
3841
+ };
3842
+ }
3432
3843
  };
3433
- const individualOnfidoDocumentMapping = {
3434
- ["passport"]: "idVerificationMethod.idDocument",
3435
- ["proofOfResidency"]: "proofOfResidency.proofOfResidency",
3436
- ["proofOfNationalIdNumber"]: "proofOfNationalId.proofOfNationalId",
3437
- ["proofOfRelationship"]: "proofOfRelationship.proofOfRelationship"
3844
+ const adjustOnfidoIdentificationData = (data, apiData) => {
3845
+ const { typeOfIdentity, idNumber, idNumberExempt } = data;
3846
+ const identificationData = {
3847
+ ...apiData,
3848
+ number: idNumber,
3849
+ type: getOnfidoIdentityTypeToApiIdentityTypeMap(data)[typeOfIdentity] ?? "nationalIdNumber"
3850
+ };
3851
+ switch (typeOfIdentity) {
3852
+ case "passport":
3853
+ return {
3854
+ ...identificationData,
3855
+ cardNumber: ""
3856
+ };
3857
+ case "driversLicense":
3858
+ return {
3859
+ ...identificationData,
3860
+ expiryDate: ""
3861
+ };
3862
+ default:
3863
+ return idNumber === void 0 && idNumberExempt === void 0 ? void 0 : {
3864
+ ...identificationData,
3865
+ expiryDate: "",
3866
+ cardNumber: "",
3867
+ nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
3868
+ };
3869
+ }
3438
3870
  };
3439
- const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido) => {
3440
- var _a, _b;
3871
+ const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEnabled, matchingScenario) => {
3441
3872
  const legalEntity = {
3442
3873
  ...formatObject(individualOnfido, individualOnfidoApiKeyMapping),
3443
3874
  type: LegalEntityType.INDIVIDUAL
3444
3875
  };
3445
3876
  if (individualOnfido.additionalPersonalDetails) {
3446
- legalEntity.individual.identificationData = adjustIdentificationData(
3877
+ if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && matchingScenario?.includes(Scenarios.L_TAXINFO) && individualOnfido.additionalPersonalDetails?.idNumber && individualOnfido.additionalPersonalDetails?.typeOfIdentity && individualOnfido.additionalPersonalDetails?.country === CountryCodes.Spain) {
3878
+ legalEntity.individual.taxInformation = [
3879
+ {
3880
+ country: individualOnfido.additionalPersonalDetails.country,
3881
+ number: individualOnfido.additionalPersonalDetails.idNumber,
3882
+ type: individualOnfido.additionalPersonalDetails.typeOfIdentity.toUpperCase()
3883
+ }
3884
+ ];
3885
+ }
3886
+ legalEntity.individual.identificationData = adjustOnfidoIdentificationData(
3447
3887
  individualOnfido.additionalPersonalDetails,
3448
3888
  legalEntity.individual.identificationData
3449
3889
  );
3450
3890
  }
3451
- if ((_a = individualOnfido.basicDetails) == null ? void 0 : _a.phoneNumber) {
3891
+ const localization = mapNameLocalization(individualOnfido.basicDetails ?? {});
3892
+ if (localization.length) {
3893
+ legalEntity.individual.name.localization = localization;
3894
+ }
3895
+ if (individualOnfido.basicDetails?.phoneNumber) {
3452
3896
  const phone = {
3453
3897
  number: individualOnfido.basicDetails.phoneNumber.number,
3454
3898
  type: "mobile"
@@ -3456,7 +3900,7 @@ const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido) => {
3456
3900
  if (phone.number && legalEntity.individual) {
3457
3901
  legalEntity.individual.phone = phone;
3458
3902
  } else {
3459
- (_b = legalEntity == null ? void 0 : legalEntity.individual) == null ? true : delete _b.phone;
3903
+ delete legalEntity?.individual?.phone;
3460
3904
  }
3461
3905
  }
3462
3906
  return legalEntity;
@@ -3465,29 +3909,37 @@ const getIndividualSchemaFromAPI = {
3465
3909
  ...individualOnfidoBaseMapping
3466
3910
  };
3467
3911
  const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity) => {
3468
- var _a, _b, _c, _d, _e, _f, _g;
3469
3912
  let individualOnfido = {
3470
3913
  ...formatObject(legalEntity, getIndividualSchemaFromAPI)
3471
3914
  };
3472
3915
  individualOnfido = {
3473
3916
  ...individualOnfido,
3474
3917
  basicDetails: {
3475
- ...individualOnfido == null ? void 0 : individualOnfido.basicDetails,
3918
+ ...individualOnfido?.basicDetails,
3476
3919
  ...isChangingType && {
3477
3920
  firstName: "",
3478
- lastName: ""
3921
+ lastName: "",
3922
+ localization: {}
3479
3923
  }
3480
3924
  },
3481
3925
  signatoryQuestionnaire: {
3482
- isSignatory: isChangingType ? null : ((_a = individualOnfido.signatoryQuestionnaire) == null ? void 0 : _a.isSignatory) ?? null
3926
+ isSignatory: isChangingType ? null : individualOnfido.signatoryQuestionnaire?.isSignatory ?? null
3483
3927
  },
3484
- uboQuestionnaire: {
3485
- isOwner: isChangingType ? null : ((_b = individualOnfido.uboQuestionnaire) == null ? void 0 : _b.isOwner) ?? null,
3486
- isControllingPerson: isChangingType ? null : ((_c = individualOnfido.uboQuestionnaire) == null ? void 0 : _c.isControllingPerson) ?? null,
3487
- isDirector: isChangingType ? null : ((_d = individualOnfido.uboQuestionnaire) == null ? void 0 : _d.isDirector) ?? null
3928
+ uboQuestionnaire: isChangingType ? {
3929
+ isOwner: null,
3930
+ isControllingPerson: null,
3931
+ isDirector: null,
3932
+ isNomineeShareholder: null,
3933
+ isNomineeDirector: null
3934
+ } : {
3935
+ isOwner: individualOnfido.uboQuestionnaire?.isOwner ?? null,
3936
+ isControllingPerson: individualOnfido.uboQuestionnaire?.isControllingPerson ?? null,
3937
+ isDirector: individualOnfido.uboQuestionnaire?.isDirector ?? null,
3938
+ isNomineeDirector: individualOnfido.uboQuestionnaire?.isNomineeDirector ?? null,
3939
+ isNomineeShareholder: individualOnfido.uboQuestionnaire?.isNomineeShareholder ?? null
3488
3940
  }
3489
3941
  };
3490
- if ((_e = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _e.length) {
3942
+ if (legalEntity?.documentDetails?.length) {
3491
3943
  individualOnfido = {
3492
3944
  ...individualOnfido,
3493
3945
  idVerificationMethod: {
@@ -3497,19 +3949,54 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3497
3949
  }
3498
3950
  };
3499
3951
  }
3500
- if (!(parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations)) {
3952
+ if (legalEntity.individual?.identificationData?.type && individualOnfido.additionalPersonalDetails) {
3953
+ const apiIdentityTypeToIdentityTypeMap = reverseMapping(
3954
+ getOnfidoIdentityTypeToApiIdentityTypeMap(individualOnfido.additionalPersonalDetails)
3955
+ );
3956
+ individualOnfido.additionalPersonalDetails.typeOfIdentity = apiIdentityTypeToIdentityTypeMap[legalEntity.individual.identificationData.type];
3957
+ }
3958
+ if (legalEntity.individual?.name?.localization) {
3959
+ const configs = [
3960
+ {
3961
+ script: "ja-Hani",
3962
+ mappingFunction: (l) => ({
3963
+ jaHaniFirstName: l.fields?.firstName,
3964
+ jaHaniLastName: l.fields?.lastName
3965
+ })
3966
+ },
3967
+ {
3968
+ script: "ja-Kana",
3969
+ mappingFunction: (l) => ({
3970
+ jaKanaFirstName: l.fields?.firstName,
3971
+ jaKanaLastName: l.fields?.lastName
3972
+ })
3973
+ }
3974
+ ];
3975
+ configs.forEach((config) => {
3976
+ const localizationToMap = legalEntity.individual?.name.localization?.find(
3977
+ (l) => l.script === config.script
3978
+ );
3979
+ if (localizationToMap) {
3980
+ individualOnfido.basicDetails = {
3981
+ ...individualOnfido.basicDetails,
3982
+ ...config.mappingFunction(localizationToMap)
3983
+ };
3984
+ }
3985
+ });
3986
+ }
3987
+ if (!parentLegalEntity?.entityAssociations) {
3501
3988
  return individualOnfido;
3502
3989
  }
3503
- const associations = ((_f = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _f.filter((ea) => ea.legalEntityId === (legalEntity == null ? void 0 : legalEntity.id))) ?? [];
3990
+ const associations = parentLegalEntity?.entityAssociations?.filter((ea) => ea.legalEntityId === legalEntity?.id) ?? [];
3504
3991
  if (isRoleFieldNeeded && individualOnfido.basicDetails) {
3505
3992
  individualOnfido.basicDetails.role = associations.map((ea) => ea.type);
3506
- individualOnfido.basicDetails.jobTitle = (_g = associations.find(
3993
+ individualOnfido.basicDetails.jobTitle = associations.find(
3507
3994
  ({ jobTitle }) => Boolean(jobTitle)
3508
- )) == null ? void 0 : _g.jobTitle;
3995
+ )?.jobTitle;
3509
3996
  }
3510
3997
  if (isRoleFieldNeeded && individualOnfido.signatoryQuestionnaire && individualOnfido.uboQuestionnaire) {
3511
3998
  const associationTypes = new Set(associations.map((ea) => ea.type));
3512
- const hasAssociation = (type) => associationTypes.has(type) ? "yes" : "no";
3999
+ const hasAssociation = (type) => associationTypes.has(type) ? GuidanceQuestionValues.YES : GuidanceQuestionValues.NO;
3513
4000
  individualOnfido.signatoryQuestionnaire.isSignatory = hasAssociation(
3514
4001
  DecisionMakerType.SIGNATORY
3515
4002
  );
@@ -3518,6 +4005,13 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3518
4005
  DecisionMakerType.CONTROLLING_PERSON
3519
4006
  );
3520
4007
  individualOnfido.uboQuestionnaire.isDirector = hasAssociation(DecisionMakerType.DIRECTOR);
4008
+ const hasNomineeAssociation = (type) => associations.some((ea) => ea.type === type && ea.nominee) ? GuidanceQuestionValues.YES : GuidanceQuestionValues.NO;
4009
+ individualOnfido.uboQuestionnaire.isNomineeDirector = hasNomineeAssociation(
4010
+ DecisionMakerType.DIRECTOR
4011
+ );
4012
+ individualOnfido.uboQuestionnaire.isNomineeShareholder = hasNomineeAssociation(
4013
+ DecisionMakerType.OWNER
4014
+ );
3521
4015
  }
3522
4016
  individualOnfido.basicDetails = getNomineeFromAssociation(
3523
4017
  associations,
@@ -3526,8 +4020,7 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3526
4020
  return individualOnfido;
3527
4021
  };
3528
4022
  const mapDocumentDetailToIdDocument = (documents) => {
3529
- var _a;
3530
- const activeDocument = (_a = documents.filter((document) => document.active)) == null ? void 0 : _a[0];
4023
+ const activeDocument = documents.find((document) => document.active);
3531
4024
  return activeDocument ? {
3532
4025
  idDocumentType: activeDocument.type,
3533
4026
  modificationDate: activeDocument.modificationDate
@@ -3589,10 +4082,10 @@ const identityOnfidoBase = {
3589
4082
  rule: "isProofOfRelationshipRequired"
3590
4083
  },
3591
4084
  nomineeDirector: {
3592
- rule: "nomineeDirectorRequiredForCountry"
4085
+ rules: ["isGuidedDecisionMakersFlowDisabled", "nomineeDirectorRequiredForCountry"]
3593
4086
  },
3594
4087
  nomineeShareholder: {
3595
- rule: "nomineeShareHolderRequiredForCountry"
4088
+ rules: ["isGuidedDecisionMakersFlowDisabled", "nomineeShareHolderRequiredForCountry"]
3596
4089
  },
3597
4090
  // Regardless of scenario, we want the user to go through the "verification method" step
3598
4091
  // and hopefully get Onfido-verified. Otherwise, they must go through the manual flow.
@@ -3603,6 +4096,10 @@ const identityOnfidoBase = {
3603
4096
  // (either from Onfido or previously-uploaded document)
3604
4097
  rule: "isUsingInstantVerificationOrHasExistingDocument"
3605
4098
  },
4099
+ idDocumentType: {
4100
+ // If the user has a missing ID error and chooses manual flow
4101
+ rule: "isManualIdFlowAndHasMissingData"
4102
+ },
3606
4103
  /**
3607
4104
  * Below fields only relevant if manual ID is needed
3608
4105
  * @see identityNumber
@@ -3630,6 +4127,32 @@ const identityOnfidoBase = {
3630
4127
  "requiredIfDecisionMakerTask",
3631
4128
  "isDirectorRequiredForCountry"
3632
4129
  ]
4130
+ },
4131
+ isNomineeDirector: {
4132
+ rules: [
4133
+ "isGuidedDecisionMakersFlowEnabled",
4134
+ "requiredIfDecisionMakerTask",
4135
+ "nomineeDirectorRequiredForCountry"
4136
+ ]
4137
+ },
4138
+ isNomineeShareholder: {
4139
+ rules: [
4140
+ "isGuidedDecisionMakersFlowEnabled",
4141
+ "requiredIfDecisionMakerTask",
4142
+ "nomineeShareHolderRequiredForCountry"
4143
+ ]
4144
+ },
4145
+ jaHaniFirstName: {
4146
+ rule: "japaneseFirstAndLastNames"
4147
+ },
4148
+ jaHaniLastName: {
4149
+ rule: "japaneseFirstAndLastNames"
4150
+ },
4151
+ jaKanaFirstName: {
4152
+ rule: "japaneseFirstAndLastNames"
4153
+ },
4154
+ jaKanaLastName: {
4155
+ rule: "japaneseFirstAndLastNames"
3633
4156
  }
3634
4157
  };
3635
4158
  const identityNumber = {
@@ -3721,7 +4244,6 @@ function IndividualOnfidoDropin({
3721
4244
  trustedFieldsProvider,
3722
4245
  trustedRoles
3723
4246
  }) {
3724
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3725
4247
  const { baseUrl, rootLegalEntityId } = useApiContext();
3726
4248
  const { accountHolder, setAccountHolder } = useAccountHolder();
3727
4249
  const { i18n } = useI18nContext();
@@ -3730,12 +4252,14 @@ function IndividualOnfidoDropin({
3730
4252
  const { isExperimentEnabled } = useExperimentsContext();
3731
4253
  const { isSettingEnabled } = useSettingsContext();
3732
4254
  const queryClient = useQueryClient();
4255
+ const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
4256
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
3733
4257
  const defaultCountry = "NL";
3734
4258
  const { data: providerStatus } = useProviderStatus({
3735
4259
  providers: ["idDocument"],
3736
4260
  country: legalEntityResponse ? getLegalEntityCountry(legalEntityResponse) : defaultCountry
3737
4261
  });
3738
- const isInstantVerificationEnabled = ((_b = (_a = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _a.idDocument) == null ? void 0 : _b.enabled) ?? true;
4262
+ const isInstantVerificationEnabled = providerStatus?.statuses?.idDocument?.enabled ?? true;
3739
4263
  const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
3740
4264
  const isRoleFieldNeeded = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
3741
4265
  const dataFromResponse = useMemo(() => {
@@ -3766,7 +4290,7 @@ function IndividualOnfidoDropin({
3766
4290
  const [existingAttachments, setExistingAttachments] = useState();
3767
4291
  const [documents, setDocuments] = useState();
3768
4292
  const [country, setCountry] = useState(
3769
- ((_c = dataFromResponse == null ? void 0 : dataFromResponse.additionalPersonalDetails) == null ? void 0 : _c.country) ?? parentCountry
4293
+ dataFromResponse?.additionalPersonalDetails?.country ?? parentCountry
3770
4294
  );
3771
4295
  const [derivedProps, setDerivedProps] = useState();
3772
4296
  const [nextHandler, setNextHandler] = useState();
@@ -3791,34 +4315,31 @@ function IndividualOnfidoDropin({
3791
4315
  });
3792
4316
  }, []);
3793
4317
  const individualFieldValidations = useCallback(
3794
- (data2) => {
3795
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
3796
- return {
3797
- basicDetails: basicDetailsValidators({
3798
- isExperimentEnabled
3799
- }),
3800
- additionalPersonalDetails: additionalPersonalDetailsValidators({
3801
- country: ((_a2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? country,
3802
- isExperimentEnabled,
3803
- isSettingEnabled,
3804
- taskType,
3805
- idNumberType: (_b2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _b2.typeOfIdentity,
3806
- idNumberExempt: (_c2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _c2.idNumberExempt,
3807
- idNumber: (_d2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _d2.idNumber,
3808
- existingIdNumber: (_e2 = dataFromResponse.additionalPersonalDetails) == null ? void 0 : _e2.idNumber,
3809
- formVerificationErrors: (_f2 = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _f2.additionalPersonalDetails,
3810
- i18n,
3811
- taxIdNumberType: ((_h2 = (_g2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _g2.taxInformation) == null ? void 0 : _h2.length) ? (_j2 = (_i2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _i2.taxInformation[0]) == null ? void 0 : _j2.type : void 0
3812
- })
3813
- };
3814
- },
4318
+ (data2) => ({
4319
+ basicDetails: basicDetailsValidators({
4320
+ isExperimentEnabled
4321
+ }),
4322
+ additionalPersonalDetails: additionalPersonalDetailsValidators({
4323
+ country: data2?.additionalPersonalDetails?.country ?? country,
4324
+ isExperimentEnabled,
4325
+ isSettingEnabled,
4326
+ taskType,
4327
+ idNumberType: data2?.additionalPersonalDetails?.typeOfIdentity,
4328
+ idNumberExempt: data2?.additionalPersonalDetails?.idNumberExempt,
4329
+ idNumber: data2?.additionalPersonalDetails?.idNumber,
4330
+ existingIdNumber: dataFromResponse.additionalPersonalDetails?.idNumber,
4331
+ formVerificationErrors: problems?.verificationErrors?.additionalPersonalDetails,
4332
+ i18n,
4333
+ taxIdNumberType: data2?.additionalPersonalDetails?.taxInformation?.length ? data2?.additionalPersonalDetails?.taxInformation[0]?.type : void 0
4334
+ })
4335
+ }),
3815
4336
  [
3816
4337
  country,
3817
- (_d = dataFromResponse.additionalPersonalDetails) == null ? void 0 : _d.idNumber,
4338
+ dataFromResponse.additionalPersonalDetails?.idNumber,
3818
4339
  i18n,
3819
4340
  isExperimentEnabled,
3820
4341
  isSettingEnabled,
3821
- (_e = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _e.additionalPersonalDetails,
4342
+ problems?.verificationErrors?.additionalPersonalDetails,
3822
4343
  taskType
3823
4344
  ]
3824
4345
  );
@@ -3830,7 +4351,7 @@ function IndividualOnfidoDropin({
3830
4351
  phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber
3831
4352
  },
3832
4353
  additionalPersonalDetails: {
3833
- idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2 == null ? void 0 : data2.additionalPersonalDetails).idNumber
4354
+ idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2?.additionalPersonalDetails).idNumber
3834
4355
  }
3835
4356
  }),
3836
4357
  [verifyIdNumber2, validatePhoneNumber]
@@ -3847,11 +4368,11 @@ function IndividualOnfidoDropin({
3847
4368
  };
3848
4369
  }, [documents, dataFromResponse]);
3849
4370
  const form = useMultiForm({
3850
- requiredFields: derivedProps == null ? void 0 : derivedProps.requiredFields,
4371
+ requiredFields: derivedProps?.requiredFields,
3851
4372
  defaultData,
3852
4373
  rules: individualFieldValidations,
3853
4374
  asyncRules: individualFieldAsyncValidations,
3854
- optionalFields: derivedProps == null ? void 0 : derivedProps.optionalFields
4375
+ optionalFields: derivedProps?.optionalFields
3855
4376
  });
3856
4377
  const documentUtils = documentApiUtils({
3857
4378
  baseUrl: baseUrl.value,
@@ -3859,9 +4380,8 @@ function IndividualOnfidoDropin({
3859
4380
  });
3860
4381
  const { data, requiredFields } = form;
3861
4382
  useEffect(() => {
3862
- var _a2;
3863
- setCountry(((_a2 = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? parentCountry);
3864
- }, [(_f = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _f.country, parentCountry]);
4383
+ setCountry(data?.additionalPersonalDetails?.country ?? parentCountry);
4384
+ }, [data?.additionalPersonalDetails?.country, parentCountry]);
3865
4385
  const { data: scenarios } = useScenarios(country, LegalEntityType.INDIVIDUAL);
3866
4386
  useEffect(() => {
3867
4387
  if (!scenarios) return;
@@ -3875,26 +4395,23 @@ function IndividualOnfidoDropin({
3875
4395
  country
3876
4396
  });
3877
4397
  const fieldsFromCustomRules = useMemo(
3878
- () => {
3879
- var _a2;
3880
- return individualOnfidoRules({
3881
- matchingScenario,
3882
- data,
3883
- country: ((_a2 = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? country,
3884
- taskType,
3885
- isExperimentEnabled,
3886
- rootLegalEntity: parentLegalEntity
3887
- });
3888
- },
3889
- [country, matchingScenario, data, isExperimentEnabled, parentLegalEntity, taskType]
4398
+ () => individualOnfidoRules({
4399
+ matchingScenario,
4400
+ data,
4401
+ country: data?.additionalPersonalDetails?.country ?? country,
4402
+ taskType,
4403
+ isExperimentEnabled,
4404
+ rootLegalEntity: parentLegalEntity,
4405
+ problems
4406
+ }),
4407
+ [country, matchingScenario, data, isExperimentEnabled, parentLegalEntity, taskType, problems]
3890
4408
  );
3891
4409
  useEffect(() => {
3892
- var _a2;
3893
4410
  const derivedProps2 = getPropsFromConfigurations(
3894
4411
  fieldConfigurations,
3895
4412
  individualOnfidoForms,
3896
- (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
3897
- (problems == null ? void 0 : problems.missingData) ?? [],
4413
+ problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
4414
+ problems?.missingData ?? [],
3898
4415
  legalEntityResponse ? getFieldsWithExistingData(
3899
4416
  legalEntityResponse,
3900
4417
  individualOnfidoApiKeyMapping,
@@ -3909,12 +4426,12 @@ function IndividualOnfidoDropin({
3909
4426
  fieldsFromCustomRules,
3910
4427
  {},
3911
4428
  {},
3912
- legalEntityResponse == null ? void 0 : legalEntityResponse.type,
4429
+ legalEntityResponse?.type,
3913
4430
  [],
3914
4431
  true
3915
4432
  );
3916
4433
  const updatedDerivedProps = mandateIdVerificationForMotionCapture(
3917
- (_a2 = showIndividualMotionCapture) == null ? void 0 : _a2.value,
4434
+ showIndividualMotionCapture?.value,
3918
4435
  derivedProps2
3919
4436
  );
3920
4437
  if (updatedDerivedProps) {
@@ -3924,15 +4441,14 @@ function IndividualOnfidoDropin({
3924
4441
  fieldConfigurations,
3925
4442
  legalEntityResponse,
3926
4443
  fieldsFromCustomRules,
3927
- problems == null ? void 0 : problems.remediationActions,
3928
- problems == null ? void 0 : problems.missingData
4444
+ problems?.remediationActions,
4445
+ problems?.missingData
3929
4446
  ]);
3930
4447
  useEffect(() => {
3931
- var _a2;
3932
- if (!((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.length)) return;
3933
- documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse == null ? void 0 : legalEntityResponse.id).then((res) => {
4448
+ if (!legalEntityResponse?.documentDetails?.length) return;
4449
+ documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then((res) => {
3934
4450
  setExistingAttachments(res[0].attachments);
3935
- setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse == null ? void 0 : legalEntityResponse.id));
4451
+ setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
3936
4452
  }).catch(() => {
3937
4453
  showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
3938
4454
  });
@@ -3940,8 +4456,8 @@ function IndividualOnfidoDropin({
3940
4456
  const forms = useMemo(() => {
3941
4457
  const requiredForms = getRequiredForms(
3942
4458
  individualOnfidoForms,
3943
- derivedProps == null ? void 0 : derivedProps.requiredFields,
3944
- derivedProps == null ? void 0 : derivedProps.optionalFields
4459
+ derivedProps?.requiredFields,
4460
+ derivedProps?.optionalFields
3945
4461
  );
3946
4462
  const filteredForms = !isInstantVerificationEnabled ? requiredForms.filter((f) => f.formId !== "idVerificationMethod") : requiredForms;
3947
4463
  return addValidityToForms(filteredForms, form.isValid, problems);
@@ -3965,9 +4481,8 @@ function IndividualOnfidoDropin({
3965
4481
  legalEntity,
3966
4482
  idDocumentType
3967
4483
  }) => {
3968
- var _a2, _b2, _c2;
3969
4484
  let updatedLegalEntity;
3970
- const leId = (legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newDecisionMaker == null ? void 0 : newDecisionMaker.id);
4485
+ const leId = legalEntityResponse?.id || newDecisionMaker?.id;
3971
4486
  if (!leId) {
3972
4487
  updatedLegalEntity = await createLegalEntity(legalEntity);
3973
4488
  userEvents.addTaskEvent("Success", {
@@ -3975,8 +4490,8 @@ function IndividualOnfidoDropin({
3975
4490
  actionType: "submit",
3976
4491
  legalEntityId: updatedLegalEntity.id,
3977
4492
  entityType: updatedLegalEntity.type,
3978
- countryOfRegistration: ((_a2 = dataSubmitted.additionalPersonalDetails) == null ? void 0 : _a2.country) || null,
3979
- roles: ((_b2 = dataSubmitted.basicDetails) == null ? void 0 : _b2.role) || null
4493
+ countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country || null,
4494
+ roles: dataSubmitted.basicDetails?.role || null
3980
4495
  });
3981
4496
  } else {
3982
4497
  updatedLegalEntity = await updateLegalEntity({ ...drop("type").from(legalEntity), id: leId });
@@ -3985,7 +4500,7 @@ function IndividualOnfidoDropin({
3985
4500
  actionType: "submit",
3986
4501
  legalEntityId: updatedLegalEntity.id,
3987
4502
  entityType: updatedLegalEntity.type,
3988
- countryOfRegistration: ((_c2 = dataSubmitted.additionalPersonalDetails) == null ? void 0 : _c2.country) || null,
4503
+ countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country || null,
3989
4504
  documentType: idDocumentType || null
3990
4505
  });
3991
4506
  }
@@ -3995,14 +4510,13 @@ function IndividualOnfidoDropin({
3995
4510
  legalEntity,
3996
4511
  dataSubmitted
3997
4512
  }) => {
3998
- var _a2, _b2, _c2, _d2;
3999
- const idDocument = (_a2 = dataSubmitted.idVerificationMethod) == null ? void 0 : _a2.idDocument;
4000
- if (idDocument == null ? void 0 : idDocument.instantIdVerificationData) {
4001
- if (((_c2 = (_b2 = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.enabled) === false) {
4513
+ const idDocument2 = dataSubmitted.idVerificationMethod?.idDocument;
4514
+ if (idDocument2?.instantIdVerificationData) {
4515
+ if (providerStatus?.statuses?.idDocument?.enabled === false) {
4002
4516
  throw new Error("Provider unexpectedly disabled instant verification flow");
4003
4517
  }
4004
4518
  await handleInstantIdVerificationStartCheck(
4005
- idDocument.instantIdVerificationData,
4519
+ idDocument2.instantIdVerificationData,
4006
4520
  legalEntity.id
4007
4521
  );
4008
4522
  } else {
@@ -4011,7 +4525,7 @@ function IndividualOnfidoDropin({
4011
4525
  legalEntity.id
4012
4526
  );
4013
4527
  if (!formattedDocuments || formattedDocuments.length === 0) {
4014
- if (existingAttachments == null ? void 0 : existingAttachments.length)
4528
+ if (existingAttachments?.length)
4015
4529
  logger.log(
4016
4530
  "User has already uploaded documents and is not changing them, nothing needs to be done"
4017
4531
  );
@@ -4023,25 +4537,24 @@ function IndividualOnfidoDropin({
4023
4537
  }
4024
4538
  formattedDocuments[0].attachments = mergeAttachments(
4025
4539
  existingAttachments ?? [],
4026
- ((_d2 = formattedDocuments[0]) == null ? void 0 : _d2.attachments) ?? []
4540
+ formattedDocuments[0]?.attachments ?? []
4027
4541
  ).filter((attachment) => attachment.content);
4028
4542
  const uploadedDocuments = await documentUtils.uploadDocuments(
4029
4543
  formattedDocuments,
4030
4544
  legalEntity.id
4031
4545
  );
4032
- uploadedDocuments == null ? void 0 : uploadedDocuments.forEach((doc) => {
4033
- var _a3;
4546
+ uploadedDocuments?.forEach((doc) => {
4034
4547
  userEvents.addTaskEvent("Success", {
4035
4548
  ...associatedLeTrackingParams,
4036
4549
  actionType: "upload",
4037
4550
  documentType: doc.type,
4038
- fileExtention: ((_a3 = doc == null ? void 0 : doc.attachments) == null ? void 0 : _a3.map((item) => getFileExtention(item.pageName ?? ""))) ?? null
4551
+ fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? null
4039
4552
  });
4040
4553
  });
4041
4554
  }
4042
4555
  };
4043
4556
  const hasRolesChanged = (legalEntityId, existingEntityAssociations, newRoles) => {
4044
- const existingRoles = existingEntityAssociations == null ? void 0 : existingEntityAssociations.filter((association) => association.legalEntityId === legalEntityId).map(({ type }) => type);
4557
+ const existingRoles = existingEntityAssociations?.filter((association) => association.legalEntityId === legalEntityId).map(({ type }) => type);
4045
4558
  return !doArraysMatch(existingRoles, newRoles);
4046
4559
  };
4047
4560
  const attachAssociationToParentLegalEntity = async ({
@@ -4049,35 +4562,31 @@ function IndividualOnfidoDropin({
4049
4562
  parentLE,
4050
4563
  dataSubmitted
4051
4564
  }) => {
4052
- var _a2, _b2, _c2;
4053
- const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? (_a2 = dataSubmitted == null ? void 0 : dataSubmitted.basicDetails) == null ? void 0 : _a2.role : null;
4565
+ const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? dataSubmitted?.basicDetails?.role : null;
4054
4566
  const existingEntityAssociations = getOwnEntityAssociations(parentLE);
4055
- if (newRoles && (hasRolesChanged(legalEntity == null ? void 0 : legalEntity.id, existingEntityAssociations, newRoles) || ((_b2 = dataFromResponse.basicDetails) == null ? void 0 : _b2.jobTitle) !== ((_c2 = dataSubmitted == null ? void 0 : dataSubmitted.basicDetails) == null ? void 0 : _c2.jobTitle) || hasNomineesChanged(dataFromResponse.basicDetails, dataSubmitted.basicDetails))) {
4567
+ if (newRoles && (hasRolesChanged(legalEntity?.id, existingEntityAssociations, newRoles) || dataFromResponse.basicDetails?.jobTitle !== dataSubmitted?.basicDetails?.jobTitle || hasNomineesChanged(dataFromResponse.basicDetails, dataSubmitted.basicDetails))) {
4056
4568
  const updatedParentLegalEntity = {
4057
4569
  entityAssociations: [
4058
- ...newRoles.map((role) => {
4059
- var _a3;
4060
- return {
4061
- type: role,
4062
- legalEntityId: legalEntity.id,
4063
- ...DECISION_MAKER_TYPES_WITH_JOBTITLE.some((type) => type === role) && {
4064
- jobTitle: (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.basicDetails) == null ? void 0 : _a3.jobTitle
4065
- }
4066
- };
4067
- }) || [],
4570
+ ...newRoles.map((role) => ({
4571
+ type: role,
4572
+ legalEntityId: legalEntity.id,
4573
+ ...DECISION_MAKER_TYPES_WITH_JOBTITLE.some((type) => type === role) && {
4574
+ jobTitle: dataSubmitted?.basicDetails?.jobTitle
4575
+ }
4576
+ })) || [],
4068
4577
  ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
4069
4578
  ]
4070
4579
  };
4071
- if (updatedParentLegalEntity.entityAssociations) {
4580
+ const nomineeDataSource = !isGuidedDecisionMakersFlowDisabled && isGuidedDecisionMakersFlowEnabled ? dataSubmitted?.uboQuestionnaire : dataSubmitted.basicDetails;
4581
+ if (nomineeDataSource && updatedParentLegalEntity.entityAssociations) {
4072
4582
  updatedParentLegalEntity.entityAssociations = updatedParentLegalEntity.entityAssociations.map(
4073
- (ea) => attachNomineeToRole(ea, country, dataSubmitted.basicDetails)
4583
+ (ea) => attachNomineeToRole(ea, country, nomineeDataSource)
4074
4584
  );
4075
4585
  }
4076
4586
  await updateLegalEntity({ ...updatedParentLegalEntity, id: parentLE.id });
4077
4587
  }
4078
4588
  };
4079
4589
  const onSubmit = async () => {
4080
- var _a2, _b2;
4081
4590
  setLoadingStatus("loading");
4082
4591
  const dataSubmitted = omitObscuredFieldsIfUnchanged(
4083
4592
  individualOnfidoObscuredFields,
@@ -4088,13 +4597,14 @@ function IndividualOnfidoDropin({
4088
4597
  return;
4089
4598
  }
4090
4599
  try {
4091
- const legalEntity = mapIndividualOnfidoSchemaToLegalEntity(dataSubmitted);
4092
- const idDocumentType = (_a2 = idDocumentTypeOptions.find(
4093
- ({ id }) => {
4094
- var _a3, _b3;
4095
- return ((_b3 = (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.idVerificationMethod) == null ? void 0 : _a3.idDocument) == null ? void 0 : _b3.idDocumentType) === id;
4096
- }
4097
- )) == null ? void 0 : _a2.id;
4600
+ const legalEntity = mapIndividualOnfidoSchemaToLegalEntity(
4601
+ dataSubmitted,
4602
+ isExperimentEnabled,
4603
+ matchingScenario
4604
+ );
4605
+ const idDocumentType = idDocumentTypeOptions.find(
4606
+ ({ id }) => dataSubmitted?.idVerificationMethod?.idDocument?.idDocumentType === id
4607
+ )?.id;
4098
4608
  legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
4099
4609
  taskType,
4100
4610
  legalEntityResponse,
@@ -4106,7 +4616,7 @@ function IndividualOnfidoDropin({
4106
4616
  idDocumentType
4107
4617
  });
4108
4618
  setAccountHolder(accountHolder);
4109
- if (((_b2 = dataSubmitted.idVerificationMethod) == null ? void 0 : _b2.idVerificationMethod) !== "existingDocument") {
4619
+ if (dataSubmitted.idVerificationMethod?.idVerificationMethod !== "existingDocument") {
4110
4620
  await submitDocuments({ legalEntity: createdLegalEntity, dataSubmitted });
4111
4621
  }
4112
4622
  if (parentLegalEntity) {
@@ -4122,7 +4632,7 @@ function IndividualOnfidoDropin({
4122
4632
  }
4123
4633
  setLoadingStatus("success");
4124
4634
  clearToasts();
4125
- externalOnSubmit == null ? void 0 : externalOnSubmit(dataSubmitted);
4635
+ externalOnSubmit?.(dataSubmitted);
4126
4636
  } catch (e) {
4127
4637
  logger.error("Failed to update individual", e);
4128
4638
  if (isValidationError(e)) {
@@ -4145,18 +4655,14 @@ function IndividualOnfidoDropin({
4145
4655
  }
4146
4656
  };
4147
4657
  const datasetUtils = datasetUtilities(i18n.locale);
4148
- const formatIdDocument = (idDocument) => {
4149
- var _a2, _b2;
4150
- if (!idDocument) return void 0;
4151
- const documentType = (idDocument == null ? void 0 : idDocument.instantIdVerificationData) ? onfidoDocumentTypeMapping.find(
4152
- (document) => {
4153
- var _a3;
4154
- return ((_a3 = idDocument.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document.id;
4155
- }
4156
- ) : idDocumentTypeOptions.find(({ id }) => idDocument.idDocumentType === id);
4658
+ const formatIdDocument = (idDocument2) => {
4659
+ if (!idDocument2) return void 0;
4660
+ const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
4661
+ (document) => idDocument2.instantIdVerificationData?.document_front.type === document.id
4662
+ ) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
4157
4663
  if (!documentType) return void 0;
4158
- const frontPage = (_a2 = idDocument.idFrontPage) == null ? void 0 : _a2[0];
4159
- const backPage = (_b2 = idDocument.idBackPage) == null ? void 0 : _b2[0];
4664
+ const frontPage = idDocument2.idFrontPage?.[0];
4665
+ const backPage = idDocument2.idBackPage?.[0];
4160
4666
  if (!frontPage) return void 0;
4161
4667
  return {
4162
4668
  documentType: i18n.get(documentType.name),
@@ -4175,14 +4681,13 @@ function IndividualOnfidoDropin({
4175
4681
  proofOfResidency,
4176
4682
  proofOfRelationship
4177
4683
  }) => {
4178
- var _a2, _b2, _c2;
4179
- const proofOfNationalIdFile = (_a2 = proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) == null ? void 0 : _a2[0];
4180
- const proofOfResidencyFile = (_b2 = proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) == null ? void 0 : _b2[0];
4181
- const proofOfRelationshipFile = (_c2 = proofOfRelationship == null ? void 0 : proofOfRelationship.proofOfRelationship) == null ? void 0 : _c2[0];
4182
- const idDocument = (idVerificationMethod == null ? void 0 : idVerificationMethod.idVerificationMethod) === "manualVerification" ? manualIdUpload : idVerificationMethod == null ? void 0 : idVerificationMethod.idDocument;
4684
+ const proofOfNationalIdFile = proofOfNationalId?.proofOfNationalId?.[0];
4685
+ const proofOfResidencyFile = proofOfResidency?.proofOfResidency?.[0];
4686
+ const proofOfRelationshipFile = proofOfRelationship?.proofOfRelationship?.[0];
4687
+ const idDocument2 = idVerificationMethod?.idVerificationMethod === "manualVerification" ? manualIdUpload : idVerificationMethod?.idDocument;
4183
4688
  return {
4184
- ...((idDocument == null ? void 0 : idDocument.idDocumentType) || (idDocument == null ? void 0 : idDocument.instantIdVerificationData)) && {
4185
- idDocument: formatIdDocument(idDocument)
4689
+ ...(idDocument2?.idDocumentType || idDocument2?.instantIdVerificationData) && {
4690
+ idDocument: formatIdDocument(idDocument2)
4186
4691
  },
4187
4692
  ...proofOfNationalIdFile && {
4188
4693
  proofOfNationalId: {
@@ -4203,17 +4708,16 @@ function IndividualOnfidoDropin({
4203
4708
  };
4204
4709
  const isManualVerificationOrExistingDoc = (idVerificationMethod) => idVerificationMethod === "manualVerification" || idVerificationMethod === "existingDocument";
4205
4710
  const formatDataForSummary = () => {
4206
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
4207
4711
  let summaryData = cloneObject(data);
4208
- if ((_a2 = summaryData == null ? void 0 : summaryData.basicDetails) == null ? void 0 : _a2.phoneNumber) {
4712
+ if (summaryData?.basicDetails?.phoneNumber) {
4209
4713
  summaryData.basicDetails.phoneNumber = summaryData.basicDetails.phoneNumber.number;
4210
4714
  }
4211
- if ((_b2 = summaryData.additionalPersonalDetails) == null ? void 0 : _b2.country) {
4715
+ if (summaryData.additionalPersonalDetails?.country) {
4212
4716
  summaryData.additionalPersonalDetails.country = datasetUtils.getCountryName(
4213
4717
  summaryData.additionalPersonalDetails.country
4214
4718
  );
4215
4719
  }
4216
- if ((_c2 = summaryData.additionalPersonalDetails) == null ? void 0 : _c2.nationality) {
4720
+ if (summaryData.additionalPersonalDetails?.nationality) {
4217
4721
  summaryData.additionalPersonalDetails.nationality = datasetUtils.getCountryName(
4218
4722
  summaryData.additionalPersonalDetails.nationality
4219
4723
  );
@@ -4221,62 +4725,56 @@ function IndividualOnfidoDropin({
4221
4725
  if (summaryData.additionalPersonalDetails) {
4222
4726
  summaryData.address = mapAddressLabels(summaryData.additionalPersonalDetails, datasetUtils);
4223
4727
  }
4224
- if ((_d2 = summaryData.basicDetails) == null ? void 0 : _d2.accountHolder) {
4728
+ if (summaryData.basicDetails?.accountHolder) {
4225
4729
  summaryData.basicDetails.accountHolder = i18n.get(summaryData.basicDetails.accountHolder);
4226
4730
  }
4227
- if ((_e2 = summaryData.additionalPersonalDetails) == null ? void 0 : _e2.birthDate) {
4731
+ if (summaryData.additionalPersonalDetails?.birthDate) {
4228
4732
  summaryData.additionalPersonalDetails.birthDate = localizeDateString(
4229
4733
  summaryData.additionalPersonalDetails.birthDate,
4230
4734
  i18n.locale
4231
4735
  );
4232
4736
  }
4233
- if (isManualVerificationOrExistingDoc((_f2 = summaryData.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod) || summaryData.proofOfResidency) {
4737
+ if (isManualVerificationOrExistingDoc(summaryData.idVerificationMethod?.idVerificationMethod) || summaryData.proofOfResidency) {
4234
4738
  const fileSummaryData = formatFileSummaryData(data);
4235
4739
  summaryData = { ...summaryData, ...fileSummaryData };
4236
4740
  summaryData.manualIdUpload = { ...summaryData.idDocument };
4237
4741
  summaryData.idVerificationMethod.idDocument = { ...summaryData.idDocument };
4238
4742
  }
4239
- if ((_g2 = summaryData.additionalPersonalDetails) == null ? void 0 : _g2.taxInformation) {
4743
+ if (summaryData.additionalPersonalDetails?.taxInformation) {
4240
4744
  const taxInformation = summaryData.additionalPersonalDetails.taxInformation.find(
4241
- (taxId) => {
4242
- var _a3;
4243
- return taxId.country === ((_a3 = data.additionalPersonalDetails) == null ? void 0 : _a3.nationality);
4244
- }
4745
+ (taxId) => taxId.country === data.additionalPersonalDetails?.nationality
4245
4746
  );
4246
4747
  if (taxInformation) {
4247
4748
  delete summaryData.additionalPersonalDetails.taxInformation;
4248
4749
  summaryData.additionalPersonalDetails[taxInformation.type] = taxInformation.number;
4249
4750
  }
4250
4751
  }
4251
- if (summaryData == null ? void 0 : summaryData.signatoryQuestionnaire) {
4252
- summaryData.signatoryQuestionnaire = ((_h2 = data == null ? void 0 : data.signatoryQuestionnaire) == null ? void 0 : _h2.isSignatory) === "yes" ? [i18n.get("signatorySummaryLabel")] : [];
4752
+ if (summaryData?.signatoryQuestionnaire) {
4753
+ summaryData.signatoryQuestionnaire = data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES ? [i18n.get("signatorySummaryLabel")] : [];
4253
4754
  }
4254
- if (summaryData == null ? void 0 : summaryData.uboQuestionnaire) {
4755
+ if (summaryData?.uboQuestionnaire) {
4255
4756
  const roleFieldToLabelMap = {
4256
4757
  isOwner: "ownerSummaryLabel",
4257
4758
  isControllingPerson: "controllingPersonSummaryLabel",
4258
4759
  isDirector: "directorSummaryLabel"
4259
4760
  };
4260
4761
  summaryData.uboQuestionnaire = Object.keys(roleFieldToLabelMap).flatMap(
4261
- (field) => {
4262
- var _a3;
4263
- return ((_a3 = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _a3[field]) === "yes" ? [i18n.get(roleFieldToLabelMap[field])] : [];
4264
- }
4762
+ (field) => data?.uboQuestionnaire?.[field] === GuidanceQuestionValues.YES ? [i18n.get(roleFieldToLabelMap[field])] : []
4265
4763
  );
4266
4764
  }
4267
4765
  return summaryData;
4268
4766
  };
4269
4767
  const omittedKeysForSummary = [
4270
4768
  ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
4271
- ...((_g = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _g.idNumberExempt) ? ["idNumber"] : [],
4272
- ...isManualVerificationOrExistingDoc((_h = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _h.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
4769
+ ...data?.additionalPersonalDetails?.idNumberExempt ? ["idNumber"] : [],
4770
+ ...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
4273
4771
  ];
4274
4772
  const omittedFormsForSummary = [
4275
- ...((_i = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _i.idVerificationMethod) === "instantVerification" ? ["idDocument"] : [],
4276
- ...((_j = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _j.idVerificationMethod) === "manualVerification" ? ["idVerificationMethod"] : []
4773
+ ...data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? ["idDocument"] : [],
4774
+ ...data?.idVerificationMethod?.idVerificationMethod === "manualVerification" ? ["idVerificationMethod"] : []
4277
4775
  ];
4278
4776
  const customLabelsForSummary = {
4279
- idVerificationMethod: ((_k = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _k.idVerificationMethod) === "instantVerification" ? "idVerificationMethod" : "idDocument"
4777
+ idVerificationMethod: data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "idVerificationMethod" : "idDocument"
4280
4778
  };
4281
4779
  const {
4282
4780
  handleNextClick,
@@ -4293,10 +4791,10 @@ function IndividualOnfidoDropin({
4293
4791
  triggerValidation: form.triggerValidation
4294
4792
  // TODO: figure out type of nested keys
4295
4793
  });
4296
- const disableNextButton = useMemo(() => {
4297
- const isVerificationMethod = (activeForm == null ? void 0 : activeForm.formId) === "idVerificationMethod";
4298
- return isVerificationMethod && !(activeForm == null ? void 0 : activeForm.isValid);
4299
- }, [activeForm]);
4794
+ const disableNextButton = computed(() => {
4795
+ const isVerificationMethod = activeForm?.formId === "idVerificationMethod";
4796
+ return isVerificationMethod && !activeForm?.isValid || isNextStepDisabled.value;
4797
+ });
4300
4798
  const handleTrackNavigation = useCallback(
4301
4799
  (props) => {
4302
4800
  trackNavigation({
@@ -4321,7 +4819,7 @@ function IndividualOnfidoDropin({
4321
4819
  },
4322
4820
  asModal,
4323
4821
  currentStep: steps.current,
4324
- disableNextButton,
4822
+ disableNextButton: disableNextButton.value,
4325
4823
  forms,
4326
4824
  gotoFormByFormIndex,
4327
4825
  handleBackClick,
@@ -4342,7 +4840,7 @@ function IndividualOnfidoDropin({
4342
4840
  problems,
4343
4841
  onNext: handleNextClick,
4344
4842
  onBack: handleBackClick,
4345
- legalEntityId: legalEntityResponse == null ? void 0 : legalEntityResponse.id,
4843
+ legalEntityId: legalEntityResponse?.id,
4346
4844
  allowedRoles: roleTypes,
4347
4845
  shouldValidate,
4348
4846
  accountHolder,
@@ -4359,6 +4857,5 @@ function IndividualOnfidoDropin({
4359
4857
  }
4360
4858
  export {
4361
4859
  IndividualOnfidoDropin as I,
4362
- IndividualDropin as a,
4363
- isOnfidoAutofillFlowEnabled as i
4860
+ IndividualDropin as a
4364
4861
  };