@adyen/kyc-components 4.0.0-beta.1 → 4.0.0-beta.4

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 (628) hide show
  1. package/dist/{AcceptTermsOfServiceComponent-BQ4Yct7L.js → AcceptTermsOfServiceComponent-ilX6szf9.js} +85 -82
  2. package/dist/{AccountSetupRejected-UVhxMcAe.js → AccountSetupRejected-CQjHA557.js} +6 -6
  3. package/dist/{Avatar-NEiNEcRx.js → Avatar-BfRRf9_a.js} +2 -2
  4. package/dist/{BusinessDetailsDropin-l0xfPekL.js → BusinessDetailsDropin-Dr580mIQ.js} +429 -405
  5. package/dist/{BusinessFinancingComponent-Bs-poF2d.js → BusinessFinancingComponent-CEIG-4wN.js} +3 -3
  6. package/dist/{BusinessFinancingDropin-DoRzdS4n.js → BusinessFinancingDropin-sC3QpkDx.js} +537 -489
  7. package/dist/{BusinessFinancingPage-DSlmJmOK.js → BusinessFinancingPage-BIEuNfKE.js} +3 -3
  8. package/dist/{BusinessTypeSelectionPage-Bmi_8K2g.js → BusinessTypeSelectionPage-6sF2ce3o.js} +111 -145
  9. package/dist/{CZ-BhoS6sd6.js → CZ-BiPeoA9G.js} +11 -1
  10. package/dist/{ContractViewer-R4-gfVmp.js → ContractViewer-BOxsPeO1.js} +306 -297
  11. package/dist/{CreateIndividualComponent-D3aXuYRk.js → CreateIndividualComponent-t9eDVjpb.js} +8 -8
  12. package/dist/{CreateTransferInstrumentComponent-C-ncZ-A8.js → CreateTransferInstrumentComponent-D65FAcQz.js} +7 -7
  13. package/dist/{CustomerSupport-CMFRgQNa.js → CustomerSupport-CoLWcgoS.js} +27 -32
  14. package/dist/{DebugModal-BEmhG3UP.js → DebugModal-DkICAsiu.js} +33 -239
  15. package/dist/{DecisionMakerDetailsPage-DI2Ubmef.js → DecisionMakerDetailsPage-CvmwdHqV.js} +4 -4
  16. package/dist/DecisionMakers-DthVv8_t.js +478 -0
  17. package/dist/{EmbeddedStatus-BsZsXbKc.js → EmbeddedStatus-DdGnEZzS.js} +16 -16
  18. package/dist/FormEndState-CUYkLBgX.js +59 -0
  19. package/dist/{FormFlow-Bt-mu4Wm.js → FormFlow-CNXkXUwa.js} +19 -20
  20. package/dist/{HU-v3vOxRm8.js → HU-D8vJYkDH.js} +10 -1
  21. package/dist/{IndividualOnfidoDropin-DGMCOm9M.js → IndividualOnfidoDropin-DV2fJG5W.js} +919 -895
  22. package/dist/{Introduction-DJ6qIUPC.js → Introduction-B1WXHc-7.js} +53 -57
  23. package/dist/{ProviderButton-DAsW5EVa.js → LandingLayout-BC3pp_IY.js} +93 -86
  24. package/dist/{LegalRepresentativeDetailsPage-CyHwQR_W.js → LegalRepresentativeDetailsPage-9xm-XCto.js} +4 -4
  25. package/dist/{ManageIndividualComponent-BIMCvcr2.js → ManageIndividualComponent-zCo6mUQx.js} +9 -13
  26. package/dist/{ManageTermsOfServiceComponent-CsM23jq3.js → ManageTermsOfServiceComponent-DpQXgPYk.js} +7 -8
  27. package/dist/{ManageTransferInstrumentComponent-Vut9_bRn.js → ManageTransferInstrumentComponent-BKERoin1.js} +23 -31
  28. package/dist/{OnboardingDropinComponent-BW6er2HU.js → OnboardingDropinComponent-DYdts9Sh.js} +521 -398
  29. package/dist/{Review-DWDbL9-9.js → Review-jBq7cFVv.js} +11 -11
  30. package/dist/RootBusinessDetailsPage-BfO0Xb7n.js +1848 -0
  31. package/dist/{RootIndividualDetailsPage-DCxJ3ycQ.js → RootIndividualDetailsPage-DzmHoceW.js} +4 -4
  32. package/dist/{SignPCIComponent-kHaxhkWa.js → SignPCIComponent-By4PazmA.js} +32 -38
  33. package/dist/{SingpassSelection-Dmlbiq4Z.js → SingpassSelection-BeUj9Kdy.js} +12 -15
  34. package/dist/{SoleProprietorshipPage-Bdhs90-q.js → SoleProprietorshipPage-CZPeKEEl.js} +4 -4
  35. package/dist/{SourceOfFundsPage-Bj22DAFv.js → SourceOfFundsPage-CI1qdFId.js} +508 -488
  36. package/dist/{StoreProvider-BmzY19Td.js → StoreProvider-O9jwxfG8.js} +20832 -21372
  37. package/dist/{TaskItemStatus-CB6FEOnk.js → TaskItemStatus-s7Z3DOGa.js} +24 -24
  38. package/dist/TaskStatusIndicator-BanufME0.js +69 -0
  39. package/dist/{TaxReportingDropin-jofokkei.js → TaxReportingDropin-BQqDUn9I.js} +82 -101
  40. package/dist/{TileGroup-i5Jc08ns.js → TileGroup-tu04B8GK.js} +6 -8
  41. package/dist/{TrustDetailsPage-B6HmvYUf.js → TrustDetailsPage-BQKZ_ZyU.js} +91 -80
  42. package/dist/{TrustMemberCompanyPage-D3VJOq6a.js → TrustMemberCompanyPage-C9aFr4Bm.js} +5 -5
  43. package/dist/{TrustMemberIndividualPage-1aeOYsnG.js → TrustMemberIndividualPage-Ci7hwMA_.js} +4 -4
  44. package/dist/{UnincorporatedPartnershipIndividualPage-Bt7e6ncF.js → UnincorporatedPartnershipIndividualPage-XQsgF3ou.js} +4 -4
  45. package/dist/{UnincorporatedPartnershipMemberCompanyPage-Ck5C_SEU.js → UnincorporatedPartnershipMemberCompanyPage-DFe_N3gH.js} +4 -4
  46. package/dist/{VerificationErrorAlert-DhtKOmjt.js → VerificationErrorAlert-Ci0cObw1.js} +20 -9
  47. package/dist/{ViewVerificationStatusComponent-DtKLcCGI.js → ViewVerificationStatusComponent-_qQmZFDY.js} +22 -21
  48. package/dist/adyen-business-financing.js +8 -12
  49. package/dist/adyen-individual.js +6 -4
  50. package/dist/adyen-kyc-components.js +144 -118
  51. package/dist/adyen-manage-individual.js +2 -2
  52. package/dist/adyen-manage-terms-of-service.js +3 -3
  53. package/dist/adyen-manage-transfer-instruments.js +3 -3
  54. package/dist/adyen-onboarding.js +14 -6
  55. package/dist/adyen-terms-of-service.js +18 -6
  56. package/dist/adyen-transfer-instrument.js +10 -6
  57. package/dist/adyen-verification-status.js +2 -2
  58. package/dist/bag-DpxmyXfR.js +14 -0
  59. package/dist/bg-BG-9uVrFuHv.js +23 -0
  60. package/dist/bg-BG-BY3Wa361.js +54 -0
  61. package/dist/bg-BG-BiYtb1Tz.js +55 -0
  62. package/dist/bg-BG-BvSUDgGF.js +13 -0
  63. package/dist/bg-BG-CMomhopf.js +35 -0
  64. package/dist/bg-BG-Dy6-IwuZ.js +28 -0
  65. package/dist/bg-BG-NMIts2sa.js +35 -0
  66. package/dist/{plaintext-B39yQnOr.js → bg-BG-hFblesn-.js} +4 -6
  67. package/dist/business-lines-DboUCbXw.js +135 -0
  68. package/dist/{_plugin-vue_export-helper-CgYpM5kA.js → cs-CZ-B8IPRc47.js} +4 -8
  69. package/dist/cs-CZ-BEFeaKsV.js +54 -0
  70. package/dist/cs-CZ-Csr_35T-.js +35 -0
  71. package/dist/cs-CZ-DMzortvO.js +35 -0
  72. package/dist/cs-CZ-Dbow28-o.js +28 -0
  73. package/dist/cs-CZ-Wzc382q6.js +23 -0
  74. package/dist/cs-CZ-wdftovLe.js +55 -0
  75. package/dist/cs-CZ-y4mvq4Lv.js +13 -0
  76. package/dist/da-DK-4QAKic_C.js +55 -0
  77. package/dist/da-DK-Adj8R5Qn.js +28 -0
  78. package/dist/da-DK-BTpZzEgA.js +15 -0
  79. package/dist/da-DK-CeNMXUfE.js +23 -0
  80. package/dist/da-DK-D6UK8XT9.js +54 -0
  81. package/dist/da-DK-Dm8o1giq.js +35 -0
  82. package/dist/da-DK-q2b_1elr.js +35 -0
  83. package/dist/da-DK-qgQOVjDp.js +13 -0
  84. package/dist/de-DE-B3nctkG8.js +13 -0
  85. package/dist/de-DE-BG0tKqvi.js +28 -0
  86. package/dist/de-DE-BzumFI3T.js +55 -0
  87. package/dist/de-DE-D2ByeIZs.js +35 -0
  88. package/dist/de-DE-DMFaycio.js +35 -0
  89. package/dist/de-DE-DUl6gRKv.js +54 -0
  90. package/dist/de-DE-DjOUNvp6.js +15 -0
  91. package/dist/de-DE-JI-7mvxy.js +23 -0
  92. package/dist/de-DE-pSdsxBpQ.js +13 -0
  93. package/dist/decision-makers-group-CgddXgrx.js +1944 -0
  94. package/dist/el-GR-B5j7VZ3E.js +54 -0
  95. package/dist/el-GR-Bvjk5Sw8.js +13 -0
  96. package/dist/el-GR-CGeBAkDN.js +35 -0
  97. package/dist/el-GR-CXmTklMq.js +55 -0
  98. package/dist/el-GR-CdgLZhuO.js +13 -0
  99. package/dist/el-GR-Cu9HwD-f.js +15 -0
  100. package/dist/el-GR-DGW388LZ.js +35 -0
  101. package/dist/el-GR-DerT143K.js +28 -0
  102. package/dist/el-GR-DfNOPkLq.js +23 -0
  103. package/dist/en-US-BQpgt41j.js +37 -0
  104. package/dist/en-US-BTYdAWXp.js +15 -0
  105. package/dist/en-US-Bq2Twy6x.js +54 -0
  106. package/dist/en-US-CQ3angjM.js +22 -0
  107. package/dist/en-US-CkZcSKGh.js +35 -0
  108. package/dist/en-US-DHq7VYFs.js +23 -0
  109. package/dist/en-US-DLm6gy6T.js +58 -0
  110. package/dist/en-US-DSoLr6rp.js +13 -0
  111. package/dist/en-US-SbE0c1gn.js +36 -0
  112. package/dist/es-ES-BM4U0hT3.js +28 -0
  113. package/dist/es-ES-BRfK6tX7.js +13 -0
  114. package/dist/es-ES-BhQOdKge.js +55 -0
  115. package/dist/es-ES-Cavm0szq.js +54 -0
  116. package/dist/es-ES-Cj7q7fWO.js +15 -0
  117. package/dist/es-ES-DOVPTeyf.js +23 -0
  118. package/dist/es-ES-Dy1uR2H_.js +13 -0
  119. package/dist/es-ES-WWftn3JX.js +35 -0
  120. package/dist/es-ES-pXHx3ODy.js +35 -0
  121. package/dist/et-EE-BJIsPOnh.js +23 -0
  122. package/dist/et-EE-CFlzRBEx.js +55 -0
  123. package/dist/et-EE-D5lRJbMZ.js +35 -0
  124. package/dist/et-EE-DUWZ2Vqm.js +54 -0
  125. package/dist/et-EE-Dor3enPS.js +15 -0
  126. package/dist/et-EE-OJg_PSHf.js +28 -0
  127. package/dist/et-EE-QLVnr6Vl.js +35 -0
  128. package/dist/et-EE-d9V24rcf.js +13 -0
  129. package/dist/fi-FI-B0fnAFV2.js +13 -0
  130. package/dist/fi-FI-BJ2l42Pj.js +28 -0
  131. package/dist/fi-FI-BNcnKrJ9.js +15 -0
  132. package/dist/fi-FI-D522KHGk.js +23 -0
  133. package/dist/fi-FI-D9E_KaJi.js +35 -0
  134. package/dist/fi-FI-DT351N-G.js +35 -0
  135. package/dist/fi-FI-DVa-ccaW.js +54 -0
  136. package/dist/fi-FI-Djollt2G.js +55 -0
  137. package/dist/fr-FR-BNXXNUX_.js +35 -0
  138. package/dist/fr-FR-Bn3D6mmY.js +15 -0
  139. package/dist/fr-FR-BoKzVp2q.js +13 -0
  140. package/dist/fr-FR-CY9emHgF.js +54 -0
  141. package/dist/fr-FR-Cv0k-3Xc.js +35 -0
  142. package/dist/fr-FR-DInQKkTd.js +23 -0
  143. package/dist/fr-FR-Dk6Lw2On.js +13 -0
  144. package/dist/fr-FR-g7lmxEsI.js +28 -0
  145. package/dist/fr-FR-l36qBV3a.js +55 -0
  146. package/dist/{getFieldsWithExistingData-BW8_TEQl.js → getFieldsWithExistingData-7pZnHro-.js} +3 -4
  147. package/dist/{hasDataChanged-Mu0HyZ3E.js → hasDataChanged-v0hD-nEq.js} +4 -4
  148. package/dist/hr-HR-B8AZ4eHJ.js +35 -0
  149. package/dist/hr-HR-CDUE36Dg.js +28 -0
  150. package/dist/hr-HR-CF0AHQzi.js +13 -0
  151. package/dist/hr-HR-CNzbyo9r.js +15 -0
  152. package/dist/hr-HR-CnP5sqih.js +54 -0
  153. package/dist/hr-HR-CzSrqEFA.js +35 -0
  154. package/dist/hr-HR-DTCY4iL8.js +55 -0
  155. package/dist/hr-HR-DzS44Gpv.js +23 -0
  156. package/dist/hu-HU-BSOiZA7a.js +15 -0
  157. package/dist/hu-HU-BTlpbCpc.js +54 -0
  158. package/dist/hu-HU-Bmf13NMf.js +28 -0
  159. package/dist/hu-HU-BznXPoc2.js +55 -0
  160. package/dist/hu-HU-CSPhOvLC.js +13 -0
  161. package/dist/hu-HU-DRi6Dz9U.js +35 -0
  162. package/dist/hu-HU-xCvNM5TU.js +23 -0
  163. package/dist/hu-HU-zK6nUqWr.js +35 -0
  164. package/dist/it-IT-BEWyAQUU.js +55 -0
  165. package/dist/it-IT-BH-eqIKH.js +13 -0
  166. package/dist/it-IT-BeYbInCQ.js +35 -0
  167. package/dist/it-IT-C_fNHhjE.js +35 -0
  168. package/dist/it-IT-CjEYONJg.js +23 -0
  169. package/dist/it-IT-D7G4BaP7.js +13 -0
  170. package/dist/it-IT-DYIx7myn.js +28 -0
  171. package/dist/it-IT-DvM-9LpM.js +15 -0
  172. package/dist/it-IT-GgHc0cHR.js +54 -0
  173. package/dist/ja-JP-B3yqM_FM.js +13 -0
  174. package/dist/ja-JP-BUz3qN-V.js +23 -0
  175. package/dist/ja-JP-BhS-_dIx.js +54 -0
  176. package/dist/ja-JP-C1OQ16fo.js +35 -0
  177. package/dist/ja-JP-D7oL6xGY.js +55 -0
  178. package/dist/ja-JP-DTW_hY1L.js +13 -0
  179. package/dist/ja-JP-GXkLvnQ4.js +15 -0
  180. package/dist/ja-JP-tx1DbZYD.js +28 -0
  181. package/dist/ja-JP-weDU8GLW.js +35 -0
  182. package/dist/{localizeDateString-QtCjf8Fg.js → localizeDateString-BlZ_CtJI.js} +6 -6
  183. package/dist/lt-LT-B6CJ4ULI.js +23 -0
  184. package/dist/lt-LT-BUYY0LaT.js +35 -0
  185. package/dist/lt-LT-BxScCodJ.js +28 -0
  186. package/dist/lt-LT-DNjXmQPv.js +15 -0
  187. package/dist/lt-LT-DTQGR9M0.js +54 -0
  188. package/dist/lt-LT-De7dLXxI.js +55 -0
  189. package/dist/lt-LT-Lzl_Cbw-.js +13 -0
  190. package/dist/lt-LT-_MzAcXJo.js +35 -0
  191. package/dist/lv-LV-B9js9VoA.js +35 -0
  192. package/dist/lv-LV-BQ4F1GrV.js +54 -0
  193. package/dist/lv-LV-CRhXAjn6.js +35 -0
  194. package/dist/lv-LV-ChOoZuhc.js +15 -0
  195. package/dist/lv-LV-DTtuyfHS.js +23 -0
  196. package/dist/lv-LV-De9rdme0.js +55 -0
  197. package/dist/lv-LV-F9_Fiu3w.js +28 -0
  198. package/dist/lv-LV-y00wN1pj.js +13 -0
  199. package/dist/mail-Z_IE_hkw.js +14 -0
  200. package/dist/{mapFinancialReportsToFinancialInformation-C-2jp0wg.js → mapFinancialReportsToFinancialInformation-DrS0xN6i.js} +19 -12
  201. package/dist/minus-circle-filled-BGKeHaxJ.js +17 -0
  202. package/dist/nl-NL-BHqiO21q.js +15 -0
  203. package/dist/nl-NL-CFzm75Jw.js +13 -0
  204. package/dist/nl-NL-CUcML482.js +54 -0
  205. package/dist/nl-NL-Cht7cSwD.js +28 -0
  206. package/dist/nl-NL-DLedC3mO.js +35 -0
  207. package/dist/nl-NL-Dbx0ZmI7.js +35 -0
  208. package/dist/nl-NL-DmnFXAQC.js +13 -0
  209. package/dist/nl-NL-Zcq0bXd-.js +23 -0
  210. package/dist/nl-NL-lZcJhRsP.js +55 -0
  211. package/dist/no-NO-BBCvsecq.js +54 -0
  212. package/dist/no-NO-BEIyAMmZ.js +55 -0
  213. package/dist/no-NO-BQAqVzF4.js +28 -0
  214. package/dist/no-NO-BxReX6oF.js +23 -0
  215. package/dist/no-NO-C0sfkp82.js +35 -0
  216. package/dist/no-NO-CKT9kLAH.js +15 -0
  217. package/dist/no-NO-CpVal4cV.js +35 -0
  218. package/dist/no-NO-DbvFfP96.js +13 -0
  219. package/dist/pay-by-link-plane-Pv7Babgn.js +22 -0
  220. package/dist/pl-PL--mmxopYA.js +13 -0
  221. package/dist/pl-PL-1ylK-_FE.js +35 -0
  222. package/dist/pl-PL-CqxMKpBm.js +28 -0
  223. package/dist/pl-PL-D6heiKsH.js +15 -0
  224. package/dist/pl-PL-DAPGaxWi.js +35 -0
  225. package/dist/pl-PL-DD3wVcKc.js +55 -0
  226. package/dist/pl-PL-T6uD5--R.js +23 -0
  227. package/dist/pl-PL-kGaeUP-w.js +54 -0
  228. package/dist/plus-circle-filled-Cnf1oJTm.js +17 -0
  229. package/dist/pt-PT-BVzXBFp7.js +13 -0
  230. package/dist/pt-PT-BY9rcwcF.js +35 -0
  231. package/dist/pt-PT-BkvMsoK4.js +35 -0
  232. package/dist/pt-PT-BsDCHbWN.js +55 -0
  233. package/dist/pt-PT-CBbmkr_J.js +28 -0
  234. package/dist/pt-PT-D2elvnDU.js +15 -0
  235. package/dist/pt-PT-DpDxAynk.js +13 -0
  236. package/dist/pt-PT-JVqqgvPs.js +54 -0
  237. package/dist/pt-PT-N0njcfLO.js +23 -0
  238. package/dist/{resolveEnvironment-Dx0BPNMa.js → resolveEnvironment-DvSgDDo8.js} +3 -3
  239. package/dist/ro-RO-C83h2zHZ.js +54 -0
  240. package/dist/ro-RO-CUg8-CQ8.js +55 -0
  241. package/dist/ro-RO-Cdmevo9A.js +13 -0
  242. package/dist/ro-RO-DJLWmWZ4.js +35 -0
  243. package/dist/ro-RO-DL9V1CMj.js +15 -0
  244. package/dist/ro-RO-Dfx0g3bU.js +35 -0
  245. package/dist/ro-RO-IY3AMhwm.js +28 -0
  246. package/dist/ro-RO-Ic1SzBgx.js +23 -0
  247. package/dist/ru-RU-FZb2upqh.js +13 -0
  248. package/dist/{rules-CUANHpja.js → rules-Meybz2dk.js} +45 -72
  249. package/dist/sk-SK-B7o3L57C.js +35 -0
  250. package/dist/sk-SK-BDKRZ2mM.js +28 -0
  251. package/dist/sk-SK-BSioQTMW.js +15 -0
  252. package/dist/sk-SK-CgLJIuJw.js +54 -0
  253. package/dist/sk-SK-CiD0FeLN.js +23 -0
  254. package/dist/sk-SK-Cjrkrb85.js +55 -0
  255. package/dist/sk-SK-iO863_t2.js +35 -0
  256. package/dist/sk-SK-nfeuTcY5.js +13 -0
  257. package/dist/sl-SI-BB0suyr1.js +28 -0
  258. package/dist/sl-SI-BE_ndzZ2.js +55 -0
  259. package/dist/sl-SI-BylvpF-X.js +15 -0
  260. package/dist/sl-SI-BzeVaC1Z.js +54 -0
  261. package/dist/sl-SI-C8CMAkD0.js +35 -0
  262. package/dist/sl-SI-Cth2Qa5T.js +35 -0
  263. package/dist/sl-SI-DUTZDqkP.js +13 -0
  264. package/dist/sl-SI-MZoDApq9.js +23 -0
  265. package/dist/solution-payments-DTAuLSWF.js +14 -0
  266. package/dist/style.css +1018 -1144
  267. package/dist/styles-CLV89_hH.js +1018 -1144
  268. package/dist/sv-SE-BTx2XKAp.js +13 -0
  269. package/dist/sv-SE-BryiIPVv.js +55 -0
  270. package/dist/sv-SE-Bwh0wKFk.js +35 -0
  271. package/dist/sv-SE-CVmo11gI.js +54 -0
  272. package/dist/sv-SE-DCFSf4Oj.js +23 -0
  273. package/dist/sv-SE-DYruQSzt.js +28 -0
  274. package/dist/sv-SE-Dwz1yTrB.js +15 -0
  275. package/dist/sv-SE-OPOHtqtP.js +35 -0
  276. package/dist/sv-SE-rckxD-43.js +13 -0
  277. package/dist/terminal-1-ewywjFJI.js +18 -0
  278. package/dist/types/api/companySelection/useCompanySelection.d.ts +18 -1
  279. package/dist/types/api/configurations/useScenarios.d.ts +6 -6
  280. package/dist/types/api/idNowProvider/idNowProvider.types.d.ts +1 -2
  281. package/dist/types/api/idNowProvider/useIdNowProvider.d.ts +4 -8
  282. package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirements.d.ts +2 -3
  283. package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +26 -24
  284. package/dist/types/components/BankAccount/forms/BankVerification/verification/widget/types.d.ts +10 -10
  285. package/dist/types/components/BankAccount/forms/PayoutDetails/types.d.ts +2 -2
  286. package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +0 -306
  287. package/dist/types/components/BankAccount/pages/PayoutDetailsPage.d.ts +1 -1
  288. package/dist/types/components/Business/forms/AdditionalInformation/AdditionalInformationMultiform.d.ts +9 -0
  289. package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +2 -1
  290. package/dist/types/components/Business/forms/BasicInformation/BasicInformationMultiform.d.ts +10 -0
  291. package/dist/types/components/Business/forms/BasicInformation/types.d.ts +4 -3
  292. package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +15 -3
  293. package/dist/types/components/Business/forms/BusinessDetails/types.d.ts +5 -3
  294. package/dist/types/components/Business/forms/BusinessSelection/BusinessInformationCard/BusinessInformationCard.d.ts +3 -2
  295. package/dist/types/components/Business/forms/BusinessSelection/BusinessSelectionMultiform.d.ts +14 -0
  296. package/dist/types/components/Business/forms/BusinessSelection/types.d.ts +3 -0
  297. package/dist/types/components/Business/forms/CompanyStructure/CompanyStructureMultiform.d.ts +4 -0
  298. package/dist/types/components/Business/forms/forms.types.d.ts +14 -0
  299. package/dist/types/components/Business/forms/rules.d.ts +27 -8
  300. package/dist/types/components/Business/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +2 -1
  301. package/dist/types/components/Business/mapping/businessDetails/mapOrganizationTypeToCompanyType.d.ts +1 -1
  302. package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsFormConfig.d.ts +1 -2
  303. package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +5 -3
  304. package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +4 -3
  305. package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +0 -3
  306. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiform.d.ts +18 -0
  307. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/BusinessDetailsMultiformDropin.d.ts +5 -0
  308. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/types.d.ts +2 -0
  309. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/utils.d.ts +21 -0
  310. package/dist/types/components/Business/tasks/BusinessDetailsMultiformDropin/validate.d.ts +22 -0
  311. package/dist/types/components/Business/utils/companyTypeMetadata.d.ts +1 -1
  312. package/dist/types/components/Business/utils/companyUtil.d.ts +3 -3
  313. package/dist/types/components/BusinessLines/pages/RootBusinessLinesPage.d.ts +5 -0
  314. package/dist/types/components/BusinessLines/tasks/BusinessLinesDropin.d.ts +5 -0
  315. package/dist/types/components/BusinessLines/tasks/BusinessLinesGettingStarted/BusinessLinesGettingStarted.d.ts +6 -0
  316. package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +2 -2
  317. package/dist/types/components/EFP/fields/LegalFormField/types.d.ts +4 -2
  318. package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +36 -336
  319. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingFinancialInformation.d.ts +0 -1
  320. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/BusinessFinancingRegisteredAddress.d.ts +1 -0
  321. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/types.d.ts +28 -19
  322. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +5 -4
  323. package/dist/types/components/EFP/tasks/BusinessFinancingDropin/validate.d.ts +1 -0
  324. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +1 -2
  325. package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +2 -2
  326. package/dist/types/components/EmbeddedDropins/BusinessFinancingComponent/utils.d.ts +2 -1
  327. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/types.d.ts +3 -3
  328. package/dist/types/components/EmbeddedDropins/OnboardingDropinComponent/DropinComposer/useNavigation.d.ts +5 -5
  329. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/ViewVerificationStatusComponent.d.ts +1 -1
  330. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/content.d.ts +1 -1
  331. package/dist/types/components/Individual/fields/DecisionMakerRole/NomineeDecisionMakerRole.d.ts +6 -0
  332. package/dist/types/components/Individual/fields/DecisionMakerRole/types.d.ts +2 -2
  333. package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +0 -2
  334. package/dist/types/components/Individual/forms/Individual/PersonalDetails/types.d.ts +2 -2
  335. package/dist/types/components/Individual/forms/Individual/PersonalDetails/validate.d.ts +2 -2
  336. package/dist/types/components/Individual/forms/Individual/ProofOfRelationship/types.d.ts +8 -8
  337. package/dist/types/components/Individual/forms/Individual/ProofOfResidency/types.d.ts +18 -18
  338. package/dist/types/components/Individual/forms/Individual/rules.d.ts +1 -1
  339. package/dist/types/components/Individual/forms/Individual/types.d.ts +2 -2
  340. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.d.ts +1 -2
  341. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.types.d.ts +3 -2
  342. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/validate.d.ts +2 -2
  343. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/BasicDetails.types.d.ts +2 -2
  344. package/dist/types/components/Individual/forms/IndividualOnfido/GuidanceQuestion/GuidanceQuestion.d.ts +7 -3
  345. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.d.ts +0 -1
  346. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.rules.d.ts +3 -1
  347. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +2 -2
  348. package/dist/types/components/Individual/helpers/isOnfidoAutofillFlowEnabled.d.ts +2 -2
  349. package/dist/types/components/Individual/helpers/roleUtils.d.ts +1 -1
  350. package/dist/types/components/Individual/helpers/shouldShowMotionCapture.d.ts +3 -3
  351. package/dist/types/components/Individual/mapping/adjustOnfidoIdentificationData.d.ts +3 -0
  352. package/dist/types/components/Individual/mapping/getOnfidoIdentityTypeToApiIdentityTypeMap.d.ts +3 -0
  353. package/dist/types/components/Individual/pages/DecisionMakerDetailsPage.d.ts +1 -1
  354. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.d.ts +2 -0
  355. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +7 -0
  356. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersGettingStarted.d.ts +5 -0
  357. package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersModalContent.d.ts +1 -0
  358. package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoStore.d.ts +6 -0
  359. package/dist/types/components/Shared/EntityGuidanceStatus/types.d.ts +4 -4
  360. package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +1 -1
  361. package/dist/types/components/Shared/FormNavigation/FormNavigationItem.d.ts +1 -2
  362. package/dist/types/components/Shared/Introduction/Introduction.d.ts +2 -2
  363. package/dist/types/components/Shared/Introduction/IntroductionScreen.d.ts +2 -2
  364. package/dist/types/components/Shared/Introduction/constants.d.ts +3 -3
  365. package/dist/types/components/Shared/Introduction/copy.d.ts +8 -7
  366. package/dist/types/components/Shared/Introduction/types.d.ts +11 -11
  367. package/dist/types/components/Shared/SingpassBanner/SingpassBanner.d.ts +1 -1
  368. package/dist/types/components/Shared/Summary/Summary.d.ts +0 -1
  369. package/dist/types/components/Shared/devex/DebugListener/DebugModal.d.ts +0 -1
  370. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
  371. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/fieldConfig.d.ts +1 -1
  372. package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +5 -7
  373. package/dist/types/components/Shared/fields/CountryField/types.d.ts +1 -1
  374. package/dist/types/components/Shared/fields/CountryOfGoverningLawField/types.d.ts +1 -1
  375. package/dist/types/components/Shared/fields/Currency/types.d.ts +1 -1
  376. package/dist/types/components/Shared/fields/DBANameField/types.d.ts +1 -3
  377. package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +1 -1
  378. package/dist/types/components/Shared/fields/EInvoicingCodeField/types.d.ts +1 -1
  379. package/dist/types/components/Shared/fields/FinancialReportingDate/types.d.ts +1 -1
  380. package/dist/types/components/Shared/fields/IdFieldTypeSelector/TaxIdNumberTypeSelector.d.ts +2 -2
  381. package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +2 -2
  382. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +27 -27
  383. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultRegistrationNumberType.d.ts +16 -0
  384. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultTaxIdNumberType.d.ts +2 -2
  385. package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultVatNumberType.d.ts +13 -0
  386. package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +2 -2
  387. package/dist/types/components/Shared/fields/LegalCompanyNameField/LegalCompanyNameField.d.ts +1 -2
  388. package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +1 -1
  389. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +12 -0
  390. package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/types.d.ts +5 -0
  391. package/dist/types/components/Shared/fields/NumberOfEmployees/types.d.ts +1 -1
  392. package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -2
  393. package/dist/types/components/Shared/fields/PhoneField/types.d.ts +1 -1
  394. package/dist/types/components/Shared/fields/StateField/types.d.ts +1 -1
  395. package/dist/types/components/Shared/fields/StockExchangeMICField/types.d.ts +1 -1
  396. package/dist/types/components/Shared/fields/StockISINField/types.d.ts +1 -1
  397. package/dist/types/components/Shared/fields/StockTickerSymbol/types.d.ts +1 -1
  398. package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +1 -2
  399. package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +8 -6
  400. package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +3 -7
  401. package/dist/types/components/Shared/fields/VatNumberField/VatNumberField.d.ts +1 -1
  402. package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +2 -4
  403. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  404. package/dist/types/components/Shared/forms/BusinessTypeSelection/utils.d.ts +2 -2
  405. package/dist/types/components/Shared/forms/ConstitutionalDocument/types.d.ts +11 -10
  406. package/dist/types/components/Shared/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +1 -1
  407. package/dist/types/components/Shared/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
  408. package/dist/types/components/Shared/forms/FinancialInformation/types.d.ts +4 -1
  409. package/dist/types/components/Shared/forms/RegistrationAddress/types.d.ts +7 -5
  410. package/dist/types/components/Shared/tasks/TaskList/TaskItemStatus.d.ts +1 -2
  411. package/dist/types/components/Shared/tasks/TaskList/TaskListItem.d.ts +1 -1
  412. package/dist/types/components/Shared/tasks/TaskList/types.d.ts +3 -4
  413. package/dist/types/components/Shared/tasks/TaskList/utils.d.ts +1 -2
  414. package/dist/types/components/Trust/forms/Trust/rules.d.ts +1 -0
  415. package/dist/types/components/Trust/forms/Trust/types.d.ts +1 -1
  416. package/dist/types/components/Trust/forms/TrustRegistrationDetails/types.d.ts +2 -2
  417. package/dist/types/components/Trust/forms/TrustRoleAndEntityType/types.d.ts +1 -2
  418. package/dist/types/components/Trust/hooks/useTrustMemberNavigation.hook.d.ts +3 -3
  419. package/dist/types/components/Trust/pages/TrustDetailsPage.d.ts +1 -1
  420. package/dist/types/components/Trust/tasks/TrustMembers/CompanyTrustMemberTaskItem.d.ts +1 -1
  421. package/dist/types/components/Trust/tasks/TrustMembers/ExemptSettlorTaskItem.d.ts +1 -1
  422. package/dist/types/components/Trust/tasks/TrustMembers/RegularTrustMemberTaskItem.d.ts +1 -1
  423. package/dist/types/components/Trust/tasks/TrustMembers/RootTrusteeTaskItem.d.ts +1 -1
  424. package/dist/types/components/Trust/tasks/TrustMembers/types.d.ts +6 -6
  425. package/dist/types/components/Trust/utils/trustMemberGuidance.d.ts +7 -6
  426. package/dist/types/components/Trust/utils/trustMemberRequirements.d.ts +1 -1
  427. package/dist/types/components/UnincorporatedPartnership/hooks/useUnincorporatedPartnershipNavigation.d.ts +6 -6
  428. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipMembers/types.d.ts +5 -5
  429. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRadioGroup.d.ts +4 -5
  430. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRoleAndType.d.ts +1 -2
  431. package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/types.d.ts +2 -2
  432. package/dist/types/components/ui/atoms/Accordion/Accordion.d.ts +1 -2
  433. package/dist/types/components/ui/atoms/Button/Button.d.ts +2 -3
  434. package/dist/types/components/ui/atoms/Button/Button.types.d.ts +3 -3
  435. package/dist/types/components/ui/atoms/Field/Field.d.ts +3 -6
  436. package/dist/types/components/ui/atoms/Field/Field.types.d.ts +9 -12
  437. package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +4 -6
  438. package/dist/types/components/ui/atoms/InputBase/InputBase.d.ts +4 -4
  439. package/dist/types/components/ui/atoms/List/List.d.ts +12 -0
  440. package/dist/types/components/ui/atoms/ListItem/ListItem.d.ts +16 -0
  441. package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
  442. package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +3 -3
  443. package/dist/types/components/ui/atoms/Remove/Remove.d.ts +1 -2
  444. package/dist/types/components/ui/atoms/Select/Select.d.ts +1 -2
  445. package/dist/types/components/ui/atoms/Select/Select.types.d.ts +1 -0
  446. package/dist/types/components/ui/atoms/SelectButton/SelectButton.d.ts +1 -2
  447. package/dist/types/components/ui/atoms/SelectButton/SelectButton.types.d.ts +3 -4
  448. package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -2
  449. package/dist/types/components/ui/atoms/SelectList/SelectList.types.d.ts +2 -2
  450. package/dist/types/components/ui/atoms/SelectListItem/SelectListItem.types.d.ts +3 -3
  451. package/dist/types/components/ui/atoms/Svg/svgs.d.ts +18 -0
  452. package/dist/types/components/ui/atoms/TaskStatusIndicator/TaskStatusIndicator.d.ts +1 -1
  453. package/dist/types/components/ui/atoms/TextArea/TextArea.d.ts +1 -2
  454. package/dist/types/components/ui/atoms/Tile/Tile.d.ts +1 -2
  455. package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +11 -0
  456. package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +8 -0
  457. package/dist/types/components/ui/molecules/Alert/VerificationErrorAlert.d.ts +1 -1
  458. package/dist/types/components/ui/molecules/Alert/types.d.ts +1 -0
  459. package/dist/types/components/ui/molecules/Card/Card.d.ts +1 -2
  460. package/dist/types/components/ui/molecules/Card/types.d.ts +3 -3
  461. package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +2 -2
  462. package/dist/types/components/ui/molecules/Dropzone/Dropzone.d.ts +1 -2
  463. package/dist/types/components/ui/molecules/Dropzone/FilePicker.d.ts +2 -4
  464. package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +3 -3
  465. package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +4 -4
  466. package/dist/types/components/ui/molecules/FormEndState/FormEndState.d.ts +0 -1
  467. package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +1 -2
  468. package/dist/types/components/ui/molecules/InputDate/InputDate.d.ts +3 -3
  469. package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +2 -2
  470. package/dist/types/constants/keys.d.ts +2 -0
  471. package/dist/types/context/ExperimentContext/types.d.ts +52 -36
  472. package/dist/types/context/SettingsContext/types.d.ts +24 -24
  473. package/dist/types/core/EmbedShell/EmbedShell.d.ts +1 -0
  474. package/dist/types/core/UIElement/UIElement.d.ts +1 -0
  475. package/dist/types/core/models/api/company-types-value.d.ts +12 -11
  476. package/dist/types/core/models/api/decision-maker-type.d.ts +7 -6
  477. package/dist/types/core/models/api/entity-type.d.ts +5 -4
  478. package/dist/types/core/models/api/financialReport.d.ts +2 -2
  479. package/dist/types/core/models/api/get-scenarios.d.ts +18 -18
  480. package/dist/types/core/models/api/individual.d.ts +1 -0
  481. package/dist/types/core/models/api/legal-arrangement.d.ts +10 -2
  482. package/dist/types/core/models/api/legal-entity-association.d.ts +2 -2
  483. package/dist/types/core/models/api/legal-entity-type.d.ts +8 -7
  484. package/dist/types/core/models/api/organization.d.ts +8 -0
  485. package/dist/types/core/models/api/trust-member-type.d.ts +8 -8
  486. package/dist/types/core/models/api/trusted-fields-provider.d.ts +5 -4
  487. package/dist/types/core/models/api/unincorporated-partnership.d.ts +6 -6
  488. package/dist/types/core/models/api/verification-error.d.ts +8 -7
  489. package/dist/types/core/models/api/verification-status.d.ts +7 -6
  490. package/dist/types/core/models/api/view-verification-status.d.ts +8 -7
  491. package/dist/types/core/user-events.d.ts +1 -1
  492. package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +1 -1
  493. package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +6 -1
  494. package/dist/types/embeds/individual/adyen-individual.types.d.ts +6 -1
  495. package/dist/types/embeds/onboarding/AdyenOnboarding.d.ts +1 -0
  496. package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +4 -1
  497. package/dist/types/embeds/terms-of-service/adyen-terms-of-service.types.d.ts +7 -1
  498. package/dist/types/embeds/transfer-instrument/AdyenTransferInstrument.d.ts +2 -1
  499. package/dist/types/embeds/transfer-instrument/adyen-transfer-instrument.types.d.ts +7 -2
  500. package/dist/types/hooks/introduction/useIntroductionScreens.d.ts +4 -4
  501. package/dist/types/hooks/singpass/useSingpassMyInfoLogin.d.ts +7 -6
  502. package/dist/types/hooks/useBusinessSetup.d.ts +11 -10
  503. package/dist/types/hooks/useDataMissingRemediations.d.ts +2 -2
  504. package/dist/types/hooks/useForm/types.d.ts +0 -2
  505. package/dist/types/hooks/useFormComposer.d.ts +1 -1
  506. package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +31 -0
  507. package/dist/types/hooks/useLegalEntityType.d.ts +1 -1
  508. package/dist/types/hooks/useMultiForm/types.d.ts +38 -36
  509. package/dist/types/hooks/useMultiForm/useMultiForm.d.ts +1 -1
  510. package/dist/types/hooks/useScenarioConfiguration.d.ts +2 -2
  511. package/dist/types/language/Language.d.ts +1 -7
  512. package/dist/types/language/i18n.d.ts +2 -0
  513. package/dist/types/language/types.d.ts +5 -0
  514. package/dist/types/language/utils.d.ts +11 -2
  515. package/dist/types/stores/globalStore/calculateTaskStatus.d.ts +2 -2
  516. package/dist/types/stores/globalStore/determineTaskIdentifiers.d.ts +2 -2
  517. package/dist/types/stores/globalStore/get-task-status.d.ts +2 -2
  518. package/dist/types/stores/globalStore/globalStore.d.ts +7 -7
  519. package/dist/types/stores/globalStore/taskStatus.d.ts +17 -16
  520. package/dist/types/stores/globalStore/taskTypes.d.ts +37 -35
  521. package/dist/types/types/datasets/country-code.d.ts +249 -249
  522. package/dist/types/types/datasets/currency.d.ts +25 -25
  523. package/dist/types/types/datasets/province-code.d.ts +46 -46
  524. package/dist/types/types/datasets/state-code.d.ts +84 -84
  525. package/dist/types/types/errors/entity-problems.d.ts +3 -4
  526. package/dist/types/types/form-rules.d.ts +2 -2
  527. package/dist/types/utils/api/processValidationErrors.d.ts +2 -2
  528. package/dist/types/utils/birthDateUtils.d.ts +3 -3
  529. package/dist/types/utils/decisionMaker.d.ts +4 -3
  530. package/dist/types/utils/decisionMakerRoles.d.ts +4 -3
  531. package/dist/types/utils/entityAssociationUtil.d.ts +4 -5
  532. package/dist/types/utils/entityStatusUtil.d.ts +3 -3
  533. package/dist/types/utils/eventHandlers/handleKeys.d.ts +2 -2
  534. package/dist/types/utils/formUtils.d.ts +2 -2
  535. package/dist/types/utils/getDisplayErrorMessage.d.ts +2 -2
  536. package/dist/types/utils/getName.d.ts +2 -2
  537. package/dist/types/utils/makeSelectItemForRole.d.ts +2 -2
  538. package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +1 -0
  539. package/dist/types/utils/regex/patternValidators.d.ts +3 -0
  540. package/dist/types/utils/roleMetadata.d.ts +3 -3
  541. package/dist/types/utils/simulateTextChangeFromKeyboardEvent.d.ts +2 -2
  542. package/dist/types/utils/translation.d.ts +40 -0
  543. package/dist/types/utils/urlUtils.d.ts +1 -0
  544. package/dist/types/utils/validatorUtils.d.ts +2 -0
  545. package/dist/{useMultiForm-Bwx2nVhh.js → useMultiForm-BQmE_nfY.js} +158 -135
  546. package/dist/{useOnboardingStatus-Cwba-HzS.js → useOnboardingStatus-DJdV6bAG.js} +2 -2
  547. package/dist/{useTermsOfServiceStatus-C-i9mF4m.js → useTermsOfServiceStatus-BX4GiDbz.js} +2 -2
  548. package/dist/{useUpdateLegalEntity-xQlAqIqy.js → useUpdateLegalEntity-BfnvHQJj.js} +2 -2
  549. package/dist/{utils-DXv7uAh6.js → utils-1zLleVnu.js} +30 -23
  550. package/dist/{validate-CuwYJGc9.js → validate-BweJRQFE.js} +9 -3
  551. package/dist/{validate-BN5p-GhK.js → validate-Cy6vBhF2.js} +2 -2
  552. package/dist/view-verification-status-VFcBydkR.js +21 -0
  553. package/dist/zh-CN-wUb4MmTZ.js +13 -0
  554. package/dist/zh-TW-DNTXHLKa.js +13 -0
  555. package/package.json +28 -52
  556. package/dist/DecisionMakers-BKhtcs_K.js +0 -222
  557. package/dist/FormEndState-C3HCmXcw.js +0 -32
  558. package/dist/ManagePCIComponent-Blj60xLa.js +0 -33
  559. package/dist/RootBusinessDetailsPage-BTYIldSf.js +0 -42
  560. package/dist/SourceOfFunds.module-xwHIboir.js +0 -128
  561. package/dist/adyen-manage-pci.js +0 -48
  562. package/dist/adyen-sign-pci.js +0 -62
  563. package/dist/adyen-terms-of-service.vue_vue_type_script_lang-BD4hndWg.js +0 -42
  564. package/dist/adyen-transfer-instrument.vue_vue_type_script_lang-BE-ro1iH.js +0 -53
  565. package/dist/bg-BG-COTwZXwN.js +0 -2040
  566. package/dist/cs-CZ-DUlgJKVq.js +0 -2040
  567. package/dist/css-CQUoQdd2.js +0 -24
  568. package/dist/da-DK-BDzDHhVR.js +0 -2040
  569. package/dist/de-DE-B3TpRjZX.js +0 -994
  570. package/dist/de-DE-DJdgXqS_.js +0 -2040
  571. package/dist/el-GR-CFEuLvxK.js +0 -994
  572. package/dist/el-GR-D5i9BNyh.js +0 -2040
  573. package/dist/en-US-ghR-1_C2.js +0 -994
  574. package/dist/es-ES-BtWn2FOQ.js +0 -994
  575. package/dist/es-ES-VOSWszW5.js +0 -2040
  576. package/dist/et-EE-Bp4Ngsn4.js +0 -2040
  577. package/dist/fi-FI-DaujOE-a.js +0 -2040
  578. package/dist/fr-FR-BdPZxk11.js +0 -2040
  579. package/dist/fr-FR-HvIkGqJf.js +0 -994
  580. package/dist/hr-HR-BY7C7NxY.js +0 -2040
  581. package/dist/hu-HU-DHCty-Tc.js +0 -2040
  582. package/dist/it-IT-BMsuhZEQ.js +0 -2040
  583. package/dist/it-IT-CjbZahlB.js +0 -994
  584. package/dist/ja-JP-4jufT0xh.js +0 -994
  585. package/dist/ja-JP-BYDz1z2G.js +0 -2040
  586. package/dist/json-DWikzB4g.js +0 -31
  587. package/dist/lt-LT-DNJ9V9xV.js +0 -2040
  588. package/dist/lv-LV-CFJwN5wq.js +0 -2040
  589. package/dist/nl-NL-B3xjfpMi.js +0 -994
  590. package/dist/nl-NL-DibAf790.js +0 -2040
  591. package/dist/no-NO-DHCy5rXx.js +0 -2040
  592. package/dist/pl-PL-eZBNH5HH.js +0 -2040
  593. package/dist/preact/adyen-individual.js +0 -15
  594. package/dist/preact/adyen-manage-individual.js +0 -15
  595. package/dist/preact/adyen-terms-of-service.js +0 -16
  596. package/dist/preact/adyen-transfer-instrument.js +0 -16
  597. package/dist/pt-PT-BpYDD-PX.js +0 -994
  598. package/dist/pt-PT-CiN_Wmfe.js +0 -2040
  599. package/dist/ro-RO-CgyMTvLc.js +0 -2040
  600. package/dist/ru-RU-BlgIj-Q4.js +0 -994
  601. package/dist/sk-SK-B5qlQB_U.js +0 -2040
  602. package/dist/sl-SI-8PPfrGzL.js +0 -2040
  603. package/dist/sv-SE-7lcf_fB9.js +0 -994
  604. package/dist/sv-SE-ZWLw6D3j.js +0 -2040
  605. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/IdVerificationDisclaimer/IdVerificationDisclaimer.d.ts +0 -1
  606. package/dist/types/components/Individual/forms/IndividualOnfido/IdVerificationMethod/IdVerificationHeader/IdVerificationHeader.d.ts +0 -1
  607. package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/RichText.d.ts +0 -5
  608. package/dist/types/embeds/individual/AdyenIndividualPreact.d.ts +0 -3
  609. package/dist/types/embeds/manage-individual/AdyenManageIndividualPreact.d.ts +0 -3
  610. package/dist/types/embeds/manage-pci/AdyenManagePci.d.ts +0 -12
  611. package/dist/types/embeds/manage-pci/adyen-manage-pci.d.ts +0 -1
  612. package/dist/types/embeds/manage-pci/adyen-manage-pci.types.d.ts +0 -39
  613. package/dist/types/embeds/sign-pci/AdyenSignPci.d.ts +0 -15
  614. package/dist/types/embeds/sign-pci/adyen-sign-pci.d.ts +0 -1
  615. package/dist/types/embeds/sign-pci/adyen-sign-pci.types.d.ts +0 -43
  616. package/dist/types/embeds/terms-of-service/AdyenTermsOfServicePreact.d.ts +0 -3
  617. package/dist/types/embeds/transfer-instrument/AdyenTransferInstrumentPreact.d.ts +0 -3
  618. package/dist/types/utils/sanitizeHtml.d.ts +0 -3
  619. package/dist/types/utils/useStateFromProp.d.ts +0 -9
  620. package/dist/useSalesChannelsSettings-BLzegVJh.js +0 -51
  621. package/dist/view-verification-status-DTkA8PtO.js +0 -20
  622. package/dist/vue/adyen-individual.js +0 -53
  623. package/dist/vue/adyen-manage-individual.js +0 -56
  624. package/dist/vue/adyen-terms-of-service.js +0 -28
  625. package/dist/vue/adyen-transfer-instrument.js +0 -30
  626. package/dist/yaml-jFdy-qnY.js +0 -22
  627. package/dist/zh-CN-xYZH718R.js +0 -994
  628. package/dist/zh-TW-DqBBNurv.js +0 -994
@@ -2,23 +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] = "52d3345a-d07d-4d8c-b6d3-766fa62cc152", e._sentryDebugIdIdentifier = "sentry-dbid-52d3345a-d07d-4d8c-b6d3-766fa62cc152");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "cfe534b6-6e6d-48d8-b10f-96ac912068e6", e._sentryDebugIdIdentifier = "sentry-dbid-cfe534b6-6e6d-48d8-b10f-96ac912068e6");
6
6
  } catch (e) {
7
7
  }
8
8
  }
9
9
  ;
10
10
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
11
11
  import { useMemo, useState, useEffect, useCallback } from "preact/hooks";
12
- import { p as useApiContext, bf as useMutation, bh as httpPost, c7 as matchesRegex, c8 as trimValWithOneSpace, c9 as NO_ALPHABET_REGEX, ca as EMOJI_REGEX, cb as hasRepeatedCharacters, cc as isInvalidName, cd as INDIVIDUAL_VALID_CHAR_REGEX, ce as getFormattingRegEx, cf as SPECIAL_CHARS, cg as standardKatakanaValidator, ch as standardKanjiValidator, ar as resolveFieldMetadata, ao as CountryCodes, ci as getSSNType, ap as isEmpty, cj as defaultFieldMetadata, ck as defaultFieldConfig, bE as defaultFieldMetadata$1, bF as fieldConfig, W as TaskTypes, cl as defaultFieldMetadata$2, y as LegalEntityType, cm as defaultFieldConfig$1, cn as getAgeToday, co as euCountries, cp as getIdDocument, cq as getDocument, cr as mapExistingFile, cs as getPageName, ct as getLocalizedIdDocumentTypeOptions, cu as getPage, cv as createDocumentRequest, bS as formatObject, cw as individualApiKeyMapping, bk as individualComponentsKeyMapping, bR as reverseMapping, cx as getNomineeFromAssociation, cy as drop, X as createLogger, P as useAccountHolder, b as useI18nContext, $ as useAnalyticsContext, a5 as useToastContext, a6 as useExperimentsContext, J as useSettingsContext, cz as documentApiUtils, cA as useProviderStatus, g as getLegalEntityCountry, c2 as getAssociatedLeAnalyticsPayload, cB as addressValidators, cC as getAsyncIdNumberValidationRule, bG as getAsyncPhoneValidationRules, cD as addressFormatters, cE as useScenarios, cF as setHasMotionCaptureScenario, cG as useScenarioConfiguration, cH as getPropsFromConfigurations, cI as individualForms, cJ as showIndividualMotionCapture, bO as getRequiredForms, bP as addValidityToForms, bC as getAllowedDecisionMakerRoles, b0 as datasetUtilities, bQ as useFormComposer, c3 as trackNavigation, cK as Individual, cL as composePerScenarioFormConfigurations, cM as omitObscuredFieldsIfUnchanged, cN as filterOutUnwantedAssociationsIfRootLE, c4 as isValidationError, c5 as processValidationErrors, c6 as isMaintenanceModeError, ba as cloneObject, cO as mapAddressLabels, cP as individualDocumentForms, cQ as individualDocumentMapping, cR as individualObscuredFields, cS as mergeAttachments, cT as getFileExtention, ak as getOwnEntityAssociations, cU as hasNomineesChanged, cV as attachNomineeToRole, cW as idVerificationProviderId, cX as doArraysMatch, bD as DecisionMakerType, cY as createFormRules, bB as getAvailableDecisionMakerRoleTypes, cZ as allowedCountriesForNominee, b_ as getAddressSchemaForCountry, b$ as COUNTRIES_WITH_STATES_DATASET, c_ as Scenarios, c$ as isLowRiskCountry, az as Field, bK as Select, d0 as isTruthyValidator, d1 as licenseCardNumberDefaultMetadata, d2 as licenseCardNumberDefaultConfig, aq as mergeFieldMetadataIntoProps, ay as createFormUtils, bL as useFormContext, av as getFieldProps, d3 as idNumberFields, d4 as IdentityNumber, d5 as additionallIdNumberOptions, d6 as MaskedInput, bW as InputDate, d7 as formatDateObj, d8 as DriversLicense, d9 as addressFields, u as useAllowedCountries, K as SettingNames, da as getDefaultTaxIdNumberType, F as FormHeader, ax as ErrorPanel, C as Typography, aF as CountryField, c0 as Address, c1 as getAddressSchemaLabelsByCountry, bU as Link, b8 as Confirm, db as getAgeRangeForLegalRepresentative, dc as IndividualIdNumberTypeSelector, dd as TaxInformationField, de as PatriotActDisclosure, df as isLegalRepresentativeNeeded, aw as nameFields, dg as decisionMakerRoleFields, dh as nomineeFields, di as contactDetailFields, B as Alert, aU as ContextGuidance, a$ as TrustedFieldsProvider, dj as DecisionMakerRole, dk as NomineeDecisionMakerRole, dl as LocalizedNameFields, bq as InputText, bH as ContactDetails, dm as keysOf, a_ as objectsDeepEqual, bN as isEmpty$1, dn as RadioWithLabel, bs as listToRecord, b2 as Modal, Z as Button, bm as Svg, dp as pick, dq as IdVerification, b7 as Spacer, _ as IconButton, c as useDataset, d as datasetIdentifier, L as Loader, dr as isPersonUnderAge, ds as IdDocumentManualUpload, dt as idDocumentUploadFields, du as useFormRouterContext, bM as getFormProps, dv as useCapabilities, dw as hasMotionCaptureScenario, dx as setShowIndividualMotionCapture, dy as shouldShowMotionCapture, dz as MemoizedProofOfRelationship, dA as MemoizedDocumentUpload, dB as MemoizedProofOfResidencyUpload, dC as individualOnfidoApiKeyMapping, dD as individualOnfidoBaseMapping, bn as useQueryClient, dE as individualOnfidoDocumentMapping, dF as individualOnfidoObscuredFields } from "./StoreProvider-BmzY19Td.js";
13
- import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-xQlAqIqy.js";
14
- import { c as contactDetailsValidationRules, u as useValidatePhoneNumberImperatively } from "./validate-BN5p-GhK.js";
15
- import { F as FormContextProvider, a as FormFlow } from "./FormFlow-Bt-mu4Wm.js";
16
- import { u as useSingpassMyInfoLogin, P as ProviderButton } from "./ProviderButton-DAsW5EVa.js";
17
- import { u as useMultiForm } from "./useMultiForm-Bwx2nVhh.js";
18
- import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-BW8_TEQl.js";
19
- import { l as localizeDateString } from "./localizeDateString-QtCjf8Fg.js";
20
- import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-CUANHpja.js";
21
- import { T as TileGroup } from "./TileGroup-i5Jc08ns.js";
12
+ import { a as useApiContext, bp as useMutation, t 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, av as resolveFieldMetadata, as as CountryCodes, c6 as getSSNType, at as isEmpty, c7 as defaultFieldMetadata, c8 as defaultFieldConfig, c9 as defaultFieldMetadata$1, ca as fieldConfig, $ as TaskTypes, cb as taxInformationDefaultFieldMetadata, O as LegalEntityTypes, 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, b7 as individualComponentsKeyMapping, bz as reverseMapping, cn as getNomineeFromAssociation, co as drop, a0 as createLogger, X as useAccountHolder, u as useI18nContext, a3 as useAnalyticsContext, a9 as useToastContext, aa as useExperimentsContext, v 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, ba 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, bk as cloneObject, cG as mapAddressLabels, cH as individualDocumentForms, cI as individualDocumentMapping, cJ as individualObscuredFields, cK as mergeAttachments, cL as getFileExtention, ao as getOwnEntityAssociations, cM as hasNomineesChanged, cN as attachNomineeToRole, cO as idVerificationProviderId, cP as doArraysMatch, N as Typography, G as Button, aD as Field, cQ as DecisionMakerTypes, 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, au as mergeFieldMetadataIntoProps, c as useTranslation, aC as createFormUtils, bK as useFormContext, az as getFieldProps, cZ as idNumberFields, c_ as IdentityNumber, c$ as additionallIdNumberOptions, d0 as MaskedInput, bJ as InputDate, d1 as formatDateObj, d2 as DriversLicense, d3 as addressFields, b as useAllowedCountries, w as SettingNames, F as FormHeader, aB as ErrorPanel, aJ as CountryField, bN as Address, bO as getAddressSchemaLabelsByCountry, bD as Link, bi as Confirm, d4 as getAgeRangeForLegalRepresentative, d5 as IndividualIdNumberTypeSelector, d6 as TaxInformationField, bE as InputText, d7 as PatriotActDisclosure, d8 as isLegalRepresentativeNeeded, aA as nameFields, d9 as decisionMakerRoleFields, da as nomineeFields, db as contactDetailFields, K as Alert, aZ as ContextGuidance, b4 as TrustedFieldsProviders, dc as DecisionMakerRole, dd as NomineeDecisionMakerRole, de as LocalizedNameFields, df as ContactDetails, dg as keysOf, b3 as objectsDeepEqual, dh as isEmpty$1, di as RadioWithLabel, dj as listToRecord, bc as Modal, dk as pick, dl as IdVerification, bh as Spacer, a2 as IconButton, e as useDataset, f as datasetIdentifier, L as Loader, H as Svg, dm as IdDocumentManualUpload, M as translateStringOrObject, aX as Trans, dn as idDocumentUploadFields, dp as useFormRouterContext, dq as getFormProps, dr as useCapabilities, ds as hasMotionCaptureScenario, dt as setShowIndividualMotionCapture, du as shouldShowMotionCapture, dv as MemoizedProofOfRelationship, dw as MemoizedDocumentUpload, dx as MemoizedProofOfResidencyUpload, dy as individualOnfidoApiKeyMapping, dz as individualOnfidoBaseMapping, br as useQueryClient, dA as individualOnfidoDocumentMapping, dB as individualOnfidoObscuredFields } from "./StoreProvider-O9jwxfG8.js";
13
+ import { u as useCreateLegalEntity, a as useUpdateLegalEntity } from "./useUpdateLegalEntity-BfnvHQJj.js";
14
+ import { c as contactDetailsValidationRules, u as useValidatePhoneNumberImperatively } from "./validate-Cy6vBhF2.js";
15
+ import { F as FormContextProvider, a as FormFlow } from "./FormFlow-CNXkXUwa.js";
16
+ import { u as useSingpassMyInfoLogin, L as LandingLayout } from "./LandingLayout-BC3pp_IY.js";
17
+ import { u as useMultiForm } from "./useMultiForm-BQmE_nfY.js";
18
+ import { g as getFieldsWithExistingData } from "./getFieldsWithExistingData-7pZnHro-.js";
19
+ import { l as localizeDateString } from "./localizeDateString-BlZ_CtJI.js";
20
+ import { r as rules, D as DECISION_MAKER_TYPES_WITH_JOBTITLE$1 } from "./rules-Meybz2dk.js";
21
+ import { signal, computed } from "@preact/signals";
22
+ import { T as TileGroup } from "./TileGroup-tu04B8GK.js";
22
23
  const verifyIdNumber = async (legalEntityId, baseUrl, data) => {
23
24
  return await httpPost(
24
25
  {
@@ -178,55 +179,51 @@ const personalDetailsValidators = ({
178
179
  existingIdNumber,
179
180
  formVerificationErrors,
180
181
  taxIdNumberType
181
- }) => {
182
- var _a, _b;
183
- return {
184
- taxInformation: (_a = resolveFieldMetadata(
185
- defaultFieldConfig$1[country],
186
- {
187
- taxIdNumberType,
188
- companyType: LegalEntityType.INDIVIDUAL
189
- },
190
- defaultFieldMetadata$2
191
- )) == null ? void 0 : _a.validators,
192
- birthDate: (() => {
193
- const baseValidators = [isNotOutOfRangeBirthDateValidatorRule$1];
194
- if (isSettingEnabled("enforceLegalAge")) {
182
+ }) => ({
183
+ taxInformation: resolveFieldMetadata(
184
+ taxInformationDefaultFieldConfig[country],
185
+ {
186
+ taxIdNumberType,
187
+ companyType: LegalEntityTypes.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) {
195
198
  return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
196
199
  }
197
- if (isExperimentEnabled("EnableAgeVerification")) {
198
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
199
- return [...baseValidators, buildMinimumAgeValidationRule$1(18)];
200
- }
201
- return [...baseValidators, getCountrySpecificMinimumAgeValidationRule$1(country)];
202
- }
203
- return baseValidators;
204
- })(),
205
- ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
206
- ...contactDetailsValidationRules,
207
- phoneNumber: (_b = resolveFieldMetadata(
208
- fieldConfig[phonePrefix ?? country],
209
- {},
210
- defaultFieldMetadata$1
211
- )) == null ? void 0 : _b.validators,
212
- idNumber: (() => {
213
- var _a2;
214
- const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
215
- return idNumberExempt ? {
216
- validate: () => {
217
- return idNumberExempt || !isEmpty(idNumber);
218
- },
219
- modes: ["blur"]
220
- } : (_a2 = resolveFieldMetadata(
221
- defaultFieldConfig[country],
222
- { idNumberType: derivedIdNumberType },
223
- defaultFieldMetadata
224
- )) == null ? void 0 : _a2.validators;
225
- })(),
226
- ...jaHaniNameValidationRules,
227
- ...jaKanaNameValidationRules
228
- };
229
- };
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
+ });
230
227
  const mandateIdVerificationForMotionCapture = (showMotionCapture, derivedProps) => {
231
228
  if (!derivedProps) {
232
229
  return void 0;
@@ -259,7 +256,7 @@ const mapApiIdDocumentToSchema = (idDocument2) => {
259
256
  const { hasBackPage } = getLocalizedIdDocumentTypeOptions().find(({ id }) => id === type);
260
257
  let frontPage;
261
258
  let backPage;
262
- if ((attachments == null ? void 0 : attachments.length) === 1) {
259
+ if (attachments?.length === 1) {
263
260
  frontPage = getPage(idDocument2);
264
261
  } else {
265
262
  frontPage = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
@@ -273,32 +270,31 @@ const mapApiIdDocumentToSchema = (idDocument2) => {
273
270
  };
274
271
  };
275
272
  const mapIndividualDocumentToApiDocument = async (data, entityId) => {
276
- var _a, _b;
277
273
  if (!data) return void 0;
278
274
  const { proofOfNationalId, proofOfResidency, proofOfRelationship } = data;
279
275
  const idDocument2 = "idDocument" in data ? data.idDocument : data.manualIdUpload;
280
276
  const entityType = "legalEntity";
281
277
  const documents = await Promise.all([
282
- (idDocument2 == null ? void 0 : idDocument2.idFrontPage) ? createDocumentRequest({
278
+ idDocument2?.idFrontPage ? createDocumentRequest({
283
279
  entityId,
284
280
  entityType,
285
281
  documentType: idDocument2.idDocumentType,
286
- page1: (_a = idDocument2.idFrontPage) == null ? void 0 : _a[0],
287
- page2: (_b = idDocument2.idBackPage) == null ? void 0 : _b[0]
282
+ page1: idDocument2.idFrontPage?.[0],
283
+ page2: idDocument2.idBackPage?.[0]
288
284
  }) : void 0,
289
- (proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) ? createDocumentRequest({
285
+ proofOfNationalId?.proofOfNationalId ? createDocumentRequest({
290
286
  entityId,
291
287
  entityType,
292
288
  documentType: "proofOfNationalIdNumber",
293
289
  page1: proofOfNationalId.proofOfNationalId[0]
294
290
  }) : void 0,
295
- (proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) ? createDocumentRequest({
291
+ proofOfResidency?.proofOfResidency ? createDocumentRequest({
296
292
  entityId,
297
293
  entityType,
298
294
  documentType: "proofOfResidency",
299
295
  page1: proofOfResidency.proofOfResidency[0]
300
296
  }) : void 0,
301
- (proofOfRelationship == null ? void 0 : proofOfRelationship.proofOfRelationship) ? createDocumentRequest({
297
+ proofOfRelationship?.proofOfRelationship ? createDocumentRequest({
302
298
  entityId,
303
299
  entityType,
304
300
  documentType: "proofOfRelationship",
@@ -348,7 +344,7 @@ const adjustIdentificationData = (data, apiData) => {
348
344
  ...identificationData,
349
345
  expiryDate: "",
350
346
  cardNumber: "",
351
- nationalIdExempt: (apiData == null ? void 0 : apiData.nationalIdExempt) ?? !idNumber
347
+ nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
352
348
  };
353
349
  }
354
350
  };
@@ -375,11 +371,10 @@ const mapNameLocalization = (data) => {
375
371
  return localization;
376
372
  };
377
373
  const mapIndividualToLegalEntity = (data) => {
378
- var _a;
379
374
  const requestObj = {
380
375
  ...formatObject(data, individualApiKeyMapping)
381
376
  };
382
- requestObj.type = LegalEntityType.INDIVIDUAL;
377
+ requestObj.type = LegalEntityTypes.INDIVIDUAL;
383
378
  const { personalDetails } = data;
384
379
  if (!personalDetails) return requestObj;
385
380
  requestObj.individual.identificationData = adjustIdentificationData(
@@ -390,7 +385,7 @@ const mapIndividualToLegalEntity = (data) => {
390
385
  if (localization.length) {
391
386
  requestObj.individual.name.localization = localization;
392
387
  }
393
- if ((_a = personalDetails.phoneNumber) == null ? void 0 : _a.number) {
388
+ if (personalDetails.phoneNumber?.number) {
394
389
  requestObj.individual.phone = {
395
390
  number: personalDetails.phoneNumber.number,
396
391
  type: "mobile"
@@ -401,7 +396,6 @@ const mapIndividualToLegalEntity = (data) => {
401
396
  return requestObj;
402
397
  };
403
398
  const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity, isLegalRepresentative) => {
404
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
405
399
  let individualData = formatObject(
406
400
  legalEntity,
407
401
  individualComponentsKeyMapping
@@ -409,54 +403,47 @@ const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeed
409
403
  individualData = {
410
404
  ...individualData,
411
405
  personalDetails: {
412
- ...individualData == null ? void 0 : individualData.personalDetails,
406
+ ...individualData?.personalDetails,
413
407
  ...isChangingType && {
414
408
  firstName: "",
415
409
  lastName: ""
416
410
  }
417
411
  }
418
412
  };
419
- if (!((_a = individualData.personalDetails) == null ? void 0 : _a.idNumberExempt)) {
413
+ if (!individualData.personalDetails?.idNumberExempt) {
420
414
  individualData.personalDetails.idNumberExempt = false;
421
415
  }
422
416
  const apiIdentityTypeToIdentityTypeMap = reverseMapping(
423
417
  getIdentityTypeToApiIdentityTypeMap(individualData.personalDetails)
424
418
  );
425
- 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) {
426
420
  individualData.personalDetails.typeOfIdentity = apiIdentityTypeToIdentityTypeMap[legalEntity.individual.identificationData.type];
427
421
  }
428
- if ((_d = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _d.length) {
422
+ if (legalEntity?.documentDetails?.length) {
429
423
  individualData = {
430
424
  ...individualData,
431
- ...mapApiDocumentToIndividualDocuments(legalEntity == null ? void 0 : legalEntity.id)
425
+ ...mapApiDocumentToIndividualDocuments(legalEntity?.id)
432
426
  };
433
427
  }
434
- if (((_e = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _e.residentialAddress.country) === "JP" && ((_g = (_f = legalEntity.individual) == null ? void 0 : _f.name) == null ? void 0 : _g.localization)) {
428
+ if (legalEntity?.individual?.residentialAddress.country === "JP" && legalEntity.individual?.name?.localization) {
435
429
  const configs = [
436
430
  {
437
431
  script: "ja-Hani",
438
- mappingFunction: (l) => {
439
- var _a2, _b2;
440
- return {
441
- jaHaniFirstName: (_a2 = l.fields) == null ? void 0 : _a2.firstName,
442
- jaHaniLastName: (_b2 = l.fields) == null ? void 0 : _b2.lastName
443
- };
444
- }
432
+ mappingFunction: (l) => ({
433
+ jaHaniFirstName: l.fields?.firstName,
434
+ jaHaniLastName: l.fields?.lastName
435
+ })
445
436
  },
446
437
  {
447
438
  script: "ja-Kana",
448
- mappingFunction: (l) => {
449
- var _a2, _b2;
450
- return {
451
- jaKanaFirstName: (_a2 = l.fields) == null ? void 0 : _a2.firstName,
452
- jaKanaLastName: (_b2 = l.fields) == null ? void 0 : _b2.lastName
453
- };
454
- }
439
+ mappingFunction: (l) => ({
440
+ jaKanaFirstName: l.fields?.firstName,
441
+ jaKanaLastName: l.fields?.lastName
442
+ })
455
443
  }
456
444
  ];
457
445
  configs.forEach((config) => {
458
- var _a2, _b2;
459
- const localizationToMap = (_b2 = (_a2 = legalEntity.individual) == null ? void 0 : _a2.name.localization) == null ? void 0 : _b2.find(
446
+ const localizationToMap = legalEntity.individual?.name.localization?.find(
460
447
  (l) => l.script === config.script
461
448
  );
462
449
  if (localizationToMap) {
@@ -467,24 +454,24 @@ const mapLegalEntityToIndividual = (legalEntity, isChangingType, isRoleFieldNeed
467
454
  }
468
455
  });
469
456
  }
470
- if (!(parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations)) {
457
+ if (!parentLegalEntity?.entityAssociations) {
471
458
  return individualData;
472
459
  }
473
- const associations = ((_h = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _h.filter((ea) => ea.legalEntityId === (legalEntity == null ? void 0 : legalEntity.id))) ?? [];
460
+ const associations = parentLegalEntity?.entityAssociations?.filter((ea) => ea.legalEntityId === legalEntity?.id) ?? [];
474
461
  if (isRoleFieldNeeded) {
475
462
  individualData.personalDetails.role = associations.map((ea) => ea.type);
476
- individualData.personalDetails.jobTitle = (_i = associations.find(
463
+ individualData.personalDetails.jobTitle = associations.find(
477
464
  ({ jobTitle }) => Boolean(jobTitle)
478
- )) == null ? void 0 : _i.jobTitle;
465
+ )?.jobTitle;
479
466
  }
480
467
  individualData.personalDetails = getNomineeFromAssociation(
481
468
  associations,
482
469
  individualData.personalDetails
483
470
  );
484
471
  if (isLegalRepresentative) {
485
- individualData.personalDetails.relationship = (_j = associations.find(
472
+ individualData.personalDetails.relationship = associations.find(
486
473
  ({ relationship }) => Boolean(relationship)
487
- )) == null ? void 0 : _j.relationship;
474
+ )?.relationship;
488
475
  }
489
476
  return individualData;
490
477
  };
@@ -677,7 +664,6 @@ function IndividualDropin({
677
664
  trustedFieldsProvider,
678
665
  trustedRoles
679
666
  }) {
680
- var _a, _b, _c, _d, _e, _f;
681
667
  const { baseUrl, rootLegalEntityId } = useApiContext();
682
668
  const { accountHolder, setAccountHolder } = useAccountHolder();
683
669
  const { i18n } = useI18nContext();
@@ -725,7 +711,7 @@ function IndividualDropin({
725
711
  const [documents, setDocuments] = useState();
726
712
  const [existingAttachments, setExistingAttachments] = useState();
727
713
  const [country, setCountry] = useState(
728
- ((_a = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _a.residencyCountry) ?? parentCountry
714
+ dataFromResponse?.personalDetails?.residencyCountry ?? parentCountry
729
715
  );
730
716
  const [hideFooter, setHideFooter] = useState(false);
731
717
  const [derivedProps, setDerivedProps] = useState();
@@ -756,29 +742,26 @@ function IndividualDropin({
756
742
  });
757
743
  }, []);
758
744
  const individualFieldValidations = useCallback(
759
- (data2) => {
760
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m;
761
- return {
762
- personalDetails: personalDetailsValidators({
763
- country: ((_a2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? country,
764
- isExperimentEnabled,
765
- isSettingEnabled,
766
- taskType,
767
- idNumberType: (_b2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _b2.typeOfIdentity,
768
- phonePrefix: (_d2 = (_c2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _c2.phoneNumber) == null ? void 0 : _d2.phoneCountryCode,
769
- idNumberExempt: (_e2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _e2.idNumberExempt,
770
- idNumber: (_f2 = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _f2.idNumber,
771
- existingIdNumber: (_g = dataFromResponse.personalDetails) == null ? void 0 : _g.idNumber,
772
- formVerificationErrors: (_h = propProblems == null ? void 0 : propProblems.verificationErrors) == null ? void 0 : _h.personalDetails,
773
- 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
774
- }),
775
- address: addressValidators({
776
- isExperimentEnabled,
777
- country: ((_m = data2 == null ? void 0 : data2.personalDetails) == null ? void 0 : _m.residencyCountry) ?? country,
778
- i18n
779
- })
780
- };
781
- },
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
+ }),
782
765
  [isExperimentEnabled, isSettingEnabled, taskType]
783
766
  );
784
767
  const validatePhoneNumber = useValidatePhoneNumberImperatively();
@@ -787,7 +770,7 @@ function IndividualDropin({
787
770
  (data2) => ({
788
771
  personalDetails: {
789
772
  phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber,
790
- idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2 == null ? void 0 : data2.personalDetails).idNumber
773
+ idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2?.personalDetails).idNumber
791
774
  }
792
775
  }),
793
776
  [getAsyncPhoneValidationRules, getAsyncIdNumberValidationRule]
@@ -812,19 +795,18 @@ function IndividualDropin({
812
795
  []
813
796
  );
814
797
  const form = useMultiForm({
815
- requiredFields: derivedProps == null ? void 0 : derivedProps.requiredFields,
798
+ requiredFields: derivedProps?.requiredFields,
816
799
  defaultData,
817
800
  rules: individualFieldValidations,
818
801
  asyncRules: individualFieldAsyncValidations,
819
- optionalFields: derivedProps == null ? void 0 : derivedProps.optionalFields,
802
+ optionalFields: derivedProps?.optionalFields,
820
803
  formatters
821
804
  });
822
805
  const { data = dataFromResponse } = form;
823
806
  useEffect(() => {
824
- var _a2;
825
- setCountry(((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? parentCountry);
826
- }, [(_b = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b.residencyCountry, parentCountry]);
827
- const { data: scenarios } = useScenarios(country, LegalEntityType.INDIVIDUAL);
807
+ setCountry(data?.personalDetails?.residencyCountry ?? parentCountry);
808
+ }, [data?.personalDetails?.residencyCountry, parentCountry]);
809
+ const { data: scenarios } = useScenarios(country, LegalEntityTypes.INDIVIDUAL);
828
810
  useEffect(() => {
829
811
  if (!scenarios) return;
830
812
  setHasMotionCaptureScenario(scenarios);
@@ -832,32 +814,28 @@ function IndividualDropin({
832
814
  }, [scenarios]);
833
815
  const { fieldConfigurations } = useScenarioConfiguration({
834
816
  parseConfiguration: parseConfiguration$1,
835
- legalEntityType: LegalEntityType.INDIVIDUAL,
817
+ legalEntityType: LegalEntityTypes.INDIVIDUAL,
836
818
  setLoadingStatus,
837
819
  country
838
820
  });
839
821
  const fieldsFromCustomRules = useMemo(
840
- () => {
841
- var _a2;
842
- return rules({
843
- matchingScenario,
844
- data,
845
- country: ((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) ?? country,
846
- taskType,
847
- isExperimentEnabled,
848
- rootLegalEntity: parentLegalEntity,
849
- problems
850
- });
851
- },
822
+ () => rules({
823
+ matchingScenario,
824
+ data,
825
+ country: data?.personalDetails?.residencyCountry ?? country,
826
+ taskType,
827
+ isExperimentEnabled,
828
+ rootLegalEntity: parentLegalEntity,
829
+ problems
830
+ }),
852
831
  [country, matchingScenario, data, taskType, problems]
853
832
  );
854
833
  useEffect(() => {
855
- var _a2;
856
834
  const derivedProps2 = getPropsFromConfigurations(
857
835
  fieldConfigurations,
858
836
  individualForms,
859
- (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
860
- (problems == null ? void 0 : problems.missingData) ?? [],
837
+ problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
838
+ problems?.missingData ?? [],
861
839
  legalEntityResponse ? getFieldsWithExistingData(
862
840
  legalEntityResponse,
863
841
  individualApiKeyMapping,
@@ -873,12 +851,12 @@ function IndividualDropin({
873
851
  fieldsFromCustomRules,
874
852
  {},
875
853
  {},
876
- legalEntityResponse == null ? void 0 : legalEntityResponse.type,
854
+ legalEntityResponse?.type,
877
855
  [],
878
856
  true
879
857
  );
880
858
  const updatedDerivedProps = mandateIdVerificationForMotionCapture(
881
- (_a2 = showIndividualMotionCapture) == null ? void 0 : _a2.value,
859
+ showIndividualMotionCapture?.value,
882
860
  derivedProps2
883
861
  );
884
862
  setDerivedProps(updatedDerivedProps);
@@ -886,50 +864,45 @@ function IndividualDropin({
886
864
  fieldConfigurations,
887
865
  legalEntityResponse,
888
866
  fieldsFromCustomRules,
889
- problems == null ? void 0 : problems.remediationActions,
890
- problems == null ? void 0 : problems.missingData
867
+ problems?.remediationActions,
868
+ problems?.missingData
891
869
  ]);
892
870
  const forms = useMemo(() => {
893
- var _a2;
894
871
  const formsWithUpdatedName = {
895
872
  ...individualForms,
896
873
  idDocument: {
897
874
  ...individualForms.idDocument,
898
- formName: ((_a2 = data.idVerificationMethod) == null ? void 0 : _a2.idVerificationMethod) === "instantVerification" ? "instantVerification" : "idDocument"
875
+ formName: data.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "instantVerification" : "idDocument"
899
876
  }
900
877
  };
901
878
  const requiredForms = getRequiredForms(
902
879
  formsWithUpdatedName,
903
- derivedProps == null ? void 0 : derivedProps.requiredFields,
904
- derivedProps == null ? void 0 : derivedProps.optionalFields
880
+ derivedProps?.requiredFields,
881
+ derivedProps?.optionalFields
905
882
  ).filter(
906
883
  // Prevent showing the ID verification method step when onfido is not enabled
907
- (form2) => {
908
- var _a3, _b2;
909
- return form2.formId !== "idVerificationMethod" || ((_b2 = (_a3 = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _a3.idDocument) == null ? void 0 : _b2.enabled);
910
- }
884
+ (form2) => form2.formId !== "idVerificationMethod" || providerStatus?.statuses?.idDocument?.enabled
911
885
  );
912
886
  return addValidityToForms(requiredForms, form.isValid, problems);
913
887
  }, [
914
888
  derivedProps,
915
889
  form.isValid,
916
890
  problems,
917
- (_d = (_c = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _c.idDocument) == null ? void 0 : _d.enabled,
918
- (_e = data.idVerificationMethod) == null ? void 0 : _e.idVerificationMethod
891
+ providerStatus?.statuses?.idDocument?.enabled,
892
+ data.idVerificationMethod?.idVerificationMethod
919
893
  ]);
920
894
  if (isRoleFieldNeeded && parentLegalEntity) {
921
895
  roleTypes = getAllowedDecisionMakerRoles(parentLegalEntity, taskType);
922
896
  }
923
897
  useEffect(() => {
924
- var _a2;
925
- if (!((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.length)) return;
926
- 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) => {
927
900
  setExistingAttachments(res[0].attachments);
928
- setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse == null ? void 0 : legalEntityResponse.id));
901
+ setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
929
902
  }).catch(() => {
930
903
  showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
931
904
  });
932
- }, []);
905
+ }, [legalEntityResponse]);
933
906
  const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
934
907
  const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
935
908
  const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
@@ -938,9 +911,8 @@ function IndividualDropin({
938
911
  legalEntity,
939
912
  idDocumentType
940
913
  }) => {
941
- var _a2, _b2, _c2;
942
914
  let updatedLegalEntity;
943
- const leId = (legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newDecisionMaker == null ? void 0 : newDecisionMaker.id);
915
+ const leId = legalEntityResponse?.id || newDecisionMaker?.id;
944
916
  if (!leId) {
945
917
  updatedLegalEntity = await createLegalEntity(legalEntity);
946
918
  userEvents.addTaskEvent("Success", {
@@ -948,8 +920,8 @@ function IndividualDropin({
948
920
  actionType: "submit",
949
921
  legalEntityId: updatedLegalEntity.id,
950
922
  entityType: updatedLegalEntity.type,
951
- countryOfRegistration: ((_a2 = dataSubmitted.personalDetails) == null ? void 0 : _a2.residencyCountry) || null,
952
- roles: ((_b2 = dataSubmitted.personalDetails) == null ? void 0 : _b2.role) || null
923
+ countryOfRegistration: dataSubmitted.personalDetails?.residencyCountry || null,
924
+ roles: dataSubmitted.personalDetails?.role || null
953
925
  });
954
926
  } else {
955
927
  const patchLegalEntity = { ...drop("type").from(legalEntity), id: leId };
@@ -959,7 +931,7 @@ function IndividualDropin({
959
931
  actionType: "submit",
960
932
  legalEntityId: updatedLegalEntity.id,
961
933
  entityType: updatedLegalEntity.type,
962
- countryOfRegistration: ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.residencyCountry) || null,
934
+ countryOfRegistration: dataSubmitted.personalDetails?.residencyCountry || null,
963
935
  documentType: idDocumentType || null
964
936
  });
965
937
  }
@@ -981,10 +953,9 @@ function IndividualDropin({
981
953
  legalEntity,
982
954
  dataSubmitted
983
955
  }) => {
984
- var _a2, _b2, _c2, _d2;
985
956
  if (!isDocumentsRequired(forms2)) return;
986
- if ((_a2 = dataSubmitted.idDocument) == null ? void 0 : _a2.instantIdVerificationData) {
987
- 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) {
988
959
  throw new Error("Provider unexpectedly disabled instant verification flow");
989
960
  }
990
961
  await handleInstantIdVerificationStartCheck(
@@ -997,7 +968,7 @@ function IndividualDropin({
997
968
  legalEntity.id
998
969
  );
999
970
  if (!formattedDocuments || formattedDocuments.length === 0) {
1000
- if (existingAttachments == null ? void 0 : existingAttachments.length)
971
+ if (existingAttachments?.length)
1001
972
  logger$4.log(
1002
973
  "User has already uploaded documents and is not changing them, nothing needs to be done"
1003
974
  );
@@ -1009,26 +980,24 @@ function IndividualDropin({
1009
980
  }
1010
981
  formattedDocuments[0].attachments = mergeAttachments(
1011
982
  existingAttachments ?? [],
1012
- ((_d2 = formattedDocuments[0]) == null ? void 0 : _d2.attachments) ?? []
983
+ formattedDocuments[0]?.attachments ?? []
1013
984
  ).filter((attachment) => attachment.content);
1014
985
  const uploadedDocuments = await documentUtils.uploadDocuments(
1015
986
  formattedDocuments,
1016
987
  legalEntity.id
1017
988
  );
1018
- uploadedDocuments == null ? void 0 : uploadedDocuments.forEach((doc) => {
1019
- var _a3;
989
+ uploadedDocuments?.forEach((doc) => {
1020
990
  userEvents.addTaskEvent("Success", {
1021
991
  ...associatedLeTrackingParams,
1022
992
  actionType: "upload",
1023
993
  documentType: doc.type,
1024
- fileExtention: ((_a3 = doc == null ? void 0 : doc.attachments) == null ? void 0 : _a3.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0)) ?? null
994
+ fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? null
1025
995
  });
1026
996
  });
1027
997
  }
1028
998
  };
1029
999
  const hasRolesChanged = (legalEntity, existingEntityAssociations, newRoles) => {
1030
- var _a2;
1031
- 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);
1032
1001
  return !doArraysMatch(existingRoles, newRoles);
1033
1002
  };
1034
1003
  const attachAssociationToParentLegalEntity = async ({
@@ -1036,22 +1005,18 @@ function IndividualDropin({
1036
1005
  parentLE,
1037
1006
  dataSubmitted
1038
1007
  }) => {
1039
- var _a2, _b2, _c2, _d2, _e2, _f2;
1040
- 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;
1041
1009
  const existingEntityAssociations = getOwnEntityAssociations(parentLE);
1042
- 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))) {
1043
1011
  const updatedParentLegalEntity = {
1044
1012
  entityAssociations: [
1045
- ...newRoles.map((role) => {
1046
- var _a3;
1047
- return {
1048
- type: role,
1049
- legalEntityId: legalEntity.id,
1050
- ...DECISION_MAKER_TYPES_WITH_JOBTITLE$1.some((type) => type === role) && {
1051
- jobTitle: (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _a3.jobTitle
1052
- }
1053
- };
1054
- }) || [],
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
+ })) || [],
1055
1020
  ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
1056
1021
  ]
1057
1022
  };
@@ -1062,11 +1027,11 @@ function IndividualDropin({
1062
1027
  }
1063
1028
  await updateLegalEntity({ ...updatedParentLegalEntity, id: parentLE.id });
1064
1029
  }
1065
- 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)) {
1066
1031
  const newEntityAssociation = {
1067
1032
  type: "legalRepresentative",
1068
1033
  legalEntityId: legalEntity.id,
1069
- relationship: (_f2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _f2.relationship
1034
+ relationship: dataSubmitted?.personalDetails?.relationship
1070
1035
  };
1071
1036
  const updatedParentLegalEntity = {
1072
1037
  entityAssociations: [newEntityAssociation, ...existingEntityAssociations]
@@ -1075,7 +1040,6 @@ function IndividualDropin({
1075
1040
  }
1076
1041
  };
1077
1042
  const onSubmit = async () => {
1078
- var _a2;
1079
1043
  setLoadingStatus("loading");
1080
1044
  const dataSubmitted = omitObscuredFieldsIfUnchanged(
1081
1045
  individualObscuredFields,
@@ -1087,12 +1051,9 @@ function IndividualDropin({
1087
1051
  }
1088
1052
  try {
1089
1053
  const legalEntity = mapIndividualToLegalEntity(dataSubmitted);
1090
- const idDocumentType = (_a2 = idDocumentTypeOptions.find(
1091
- ({ id }) => {
1092
- var _a3;
1093
- return ((_a3 = dataSubmitted == null ? void 0 : dataSubmitted.idDocument) == null ? void 0 : _a3.idDocumentType) === id;
1094
- }
1095
- )) == null ? void 0 : _a2.id;
1054
+ const idDocumentType = idDocumentTypeOptions.find(
1055
+ ({ id }) => dataSubmitted?.idDocument?.idDocumentType === id
1056
+ )?.id;
1096
1057
  legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
1097
1058
  taskType,
1098
1059
  legalEntityResponse,
@@ -1114,7 +1075,7 @@ function IndividualDropin({
1114
1075
  }
1115
1076
  setLoadingStatus("success");
1116
1077
  clearToasts();
1117
- externalOnSubmit == null ? void 0 : externalOnSubmit(dataSubmitted);
1078
+ externalOnSubmit?.(dataSubmitted);
1118
1079
  } catch (e) {
1119
1080
  logger$4.error("Failed to update individual", e);
1120
1081
  if (isValidationError(e)) {
@@ -1140,17 +1101,13 @@ function IndividualDropin({
1140
1101
  const isDocumentsRequired = (forms2) => forms2.some((form2) => individualDocumentForms.includes(form2.formId));
1141
1102
  const datasetUtils = datasetUtilities(i18n.locale);
1142
1103
  const formatIdDocument = (idDocument2) => {
1143
- var _a2, _b2;
1144
1104
  if (!idDocument2) return void 0;
1145
- const documentType = (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) ? onfidoDocumentTypeMapping.find(
1146
- (document) => {
1147
- var _a3;
1148
- return ((_a3 = idDocument2.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document.id;
1149
- }
1105
+ const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
1106
+ (document) => idDocument2.instantIdVerificationData?.document_front.type === document.id
1150
1107
  ) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
1151
1108
  if (!documentType) return void 0;
1152
- const frontPage = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
1153
- const backPage = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
1109
+ const frontPage = idDocument2.idFrontPage?.[0];
1110
+ const backPage = idDocument2.idBackPage?.[0];
1154
1111
  if (!frontPage) return void 0;
1155
1112
  return {
1156
1113
  documentType: i18n.get(documentType.name),
@@ -1168,12 +1125,11 @@ function IndividualDropin({
1168
1125
  proofOfResidency,
1169
1126
  proofOfRelationship
1170
1127
  }) => {
1171
- var _a2, _b2, _c2;
1172
- const proofOfNationalIdFile = (_a2 = proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) == null ? void 0 : _a2[0];
1173
- const proofOfResidencyFile = (_b2 = proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) == null ? void 0 : _b2[0];
1174
- 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];
1175
1131
  return {
1176
- ...((idDocument2 == null ? void 0 : idDocument2.idDocumentType) || (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData)) && {
1132
+ ...(idDocument2?.idDocumentType || idDocument2?.instantIdVerificationData) && {
1177
1133
  idDocument: formatIdDocument(idDocument2)
1178
1134
  },
1179
1135
  ...proofOfNationalIdFile && {
@@ -1194,14 +1150,13 @@ function IndividualDropin({
1194
1150
  };
1195
1151
  };
1196
1152
  const formatDataForSummary = () => {
1197
- var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h;
1198
1153
  let summaryData = cloneObject(data);
1199
- if ((_a2 = summaryData.personalDetails) == null ? void 0 : _a2.residencyCountry) {
1154
+ if (summaryData.personalDetails?.residencyCountry) {
1200
1155
  summaryData.personalDetails.residencyCountry = datasetUtils.getCountryName(
1201
1156
  summaryData.personalDetails.residencyCountry
1202
1157
  );
1203
1158
  }
1204
- if ((_b2 = summaryData.personalDetails) == null ? void 0 : _b2.nationality) {
1159
+ if (summaryData.personalDetails?.nationality) {
1205
1160
  summaryData.personalDetails.nationality = datasetUtils.getCountryName(
1206
1161
  summaryData.personalDetails.nationality
1207
1162
  );
@@ -1213,27 +1168,24 @@ function IndividualDropin({
1213
1168
  individualDocumentForms.forEach((formId) => delete summaryData[formId]);
1214
1169
  summaryData = { ...summaryData, ...formatFileSummaryData(data) };
1215
1170
  }
1216
- if ((_c2 = summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
1171
+ if (summaryData.personalDetails?.accountHolder) {
1217
1172
  summaryData.personalDetails.accountHolder = i18n.get(
1218
1173
  summaryData.personalDetails.accountHolder
1219
1174
  );
1220
1175
  }
1221
- if ((_d2 = summaryData.personalDetails) == null ? void 0 : _d2.birthDate) {
1176
+ if (summaryData.personalDetails?.birthDate) {
1222
1177
  summaryData.personalDetails.birthDate = localizeDateString(
1223
1178
  summaryData.personalDetails.birthDate,
1224
1179
  i18n.locale
1225
1180
  );
1226
1181
  }
1227
- if ((_e2 = summaryData.personalDetails) == null ? void 0 : _e2.phoneNumber) {
1182
+ if (summaryData.personalDetails?.phoneNumber) {
1228
1183
  delete summaryData.personalDetails.phoneNumber;
1229
- 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;
1230
1185
  }
1231
- if ((_h = summaryData.personalDetails) == null ? void 0 : _h.taxInformation) {
1186
+ if (summaryData.personalDetails?.taxInformation) {
1232
1187
  const taxInformation = summaryData.personalDetails.taxInformation.find(
1233
- (taxId) => {
1234
- var _a3;
1235
- return taxId.country === ((_a3 = data.personalDetails) == null ? void 0 : _a3.nationality);
1236
- }
1188
+ (taxId) => taxId.country === data.personalDetails?.nationality
1237
1189
  );
1238
1190
  if (taxInformation) {
1239
1191
  delete summaryData.personalDetails.taxInformation;
@@ -1244,7 +1196,7 @@ function IndividualDropin({
1244
1196
  };
1245
1197
  const summaryOmittedKeys = [
1246
1198
  ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
1247
- ...((_f = data == null ? void 0 : data.personalDetails) == null ? void 0 : _f.idNumberExempt) ? ["idNumber"] : []
1199
+ ...data?.personalDetails?.idNumberExempt ? ["idNumber"] : []
1248
1200
  ];
1249
1201
  const {
1250
1202
  handleNextClick,
@@ -1305,7 +1257,7 @@ function IndividualDropin({
1305
1257
  onNext: handleNextClick,
1306
1258
  onBack: handleBackClick,
1307
1259
  setHideFooter,
1308
- legalEntityId: legalEntityResponse == null ? void 0 : legalEntityResponse.id,
1260
+ legalEntityId: legalEntityResponse?.id,
1309
1261
  allowedRoles: roleTypes,
1310
1262
  shouldValidate,
1311
1263
  accountHolder,
@@ -1360,59 +1312,111 @@ const additionalPersonalDetailsValidators = ({
1360
1312
  formVerificationErrors,
1361
1313
  i18n,
1362
1314
  taxIdNumberType
1363
- }) => {
1364
- var _a;
1365
- return {
1366
- taxInformation: (_a = resolveFieldMetadata(
1367
- defaultFieldConfig$1[country],
1368
- {
1369
- taxIdNumberType,
1370
- companyType: LegalEntityType.INDIVIDUAL
1371
- },
1372
- defaultFieldMetadata$2
1373
- )) == null ? void 0 : _a.validators,
1374
- birthDate: (() => {
1375
- const baseValidators = [isNotOutOfRangeBirthDateValidatorRule];
1376
- if (isSettingEnabled("enforceLegalAge")) {
1315
+ }) => ({
1316
+ taxInformation: resolveFieldMetadata(
1317
+ taxInformationDefaultFieldConfig[country],
1318
+ {
1319
+ taxIdNumberType,
1320
+ companyType: LegalEntityTypes.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) {
1377
1331
  return [...baseValidators, buildMinimumAgeValidationRule(18)];
1378
1332
  }
1379
- if (isExperimentEnabled("EnableAgeVerification")) {
1380
- if (taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS) {
1381
- return [...baseValidators, buildMinimumAgeValidationRule(18)];
1382
- }
1383
- return [...baseValidators, getCountrySpecificMinimumAgeValidationRule(country)];
1384
- }
1385
- return baseValidators;
1386
- })(),
1387
- ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0,
1388
- ...contactDetailsValidationRules,
1389
- idNumber: (() => {
1390
- var _a2;
1391
- const derivedIdNumberType = country === CountryCodes.UnitedStates ? getSSNType(formVerificationErrors, existingIdNumber) : idNumberType;
1392
- return idNumberExempt ? {
1393
- validate: () => {
1394
- return idNumberExempt || !isEmpty(idNumber);
1395
- },
1396
- modes: ["blur"]
1397
- } : (_a2 = resolveFieldMetadata(
1398
- defaultFieldConfig[country],
1399
- { idNumberType: derivedIdNumberType },
1400
- defaultFieldMetadata
1401
- )) == null ? void 0 : _a2.validators;
1402
- })(),
1403
- ...addressValidators({
1404
- isExperimentEnabled,
1405
- country,
1406
- i18n
1407
- })
1408
- };
1409
- };
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
+ });
1410
1358
  const basicDetailsValidators = ({
1411
1359
  isExperimentEnabled = () => false
1412
1360
  }) => ({
1413
1361
  ...contactDetailsValidationRules,
1414
1362
  ...isExperimentEnabled("StrictNameAndAddressValidationV4") ? nameValidationRulesV4 : void 0
1415
1363
  });
1364
+ const guidanceQuestion = "adyen-kyc-guidance-question";
1365
+ const options = "adyen-kyc-options";
1366
+ const styles$4 = {
1367
+ guidanceQuestion,
1368
+ options
1369
+ };
1370
+ const GuidanceQuestionValues = {
1371
+ YES: "Yes",
1372
+ NO: "No"
1373
+ };
1374
+ const GuidanceQuestion = (props) => {
1375
+ const {
1376
+ descriptionLinkText,
1377
+ errorMessage,
1378
+ name,
1379
+ noLabel,
1380
+ onChange,
1381
+ onDescriptionLinkClick,
1382
+ question,
1383
+ value,
1384
+ yesLabel
1385
+ } = props;
1386
+ const { i18n } = useI18nContext();
1387
+ const userEvents = useAnalyticsContext();
1388
+ const handleChange = (selectedValue) => {
1389
+ userEvents.addFieldEvent("Interacted with form field", {
1390
+ actionType: "select",
1391
+ field: name,
1392
+ returnValue: selectedValue
1393
+ });
1394
+ const newValue = selectedValue || null;
1395
+ onChange(newValue);
1396
+ };
1397
+ const yesTileLabel = yesLabel ?? i18n.get("yes");
1398
+ const noTileLabel = noLabel ?? i18n.get("no");
1399
+ return /* @__PURE__ */ jsxs("div", { className: styles$4.guidanceQuestion, children: [
1400
+ /* @__PURE__ */ jsx(Typography, { variant: "body", el: "p", children: question }),
1401
+ descriptionLinkText && onDescriptionLinkClick && /* @__PURE__ */ jsx(Button, { variant: "link", onClick: onDescriptionLinkClick, children: descriptionLinkText }),
1402
+ /* @__PURE__ */ jsx(Field, { name, className: styles$4.options, children: () => /* @__PURE__ */ jsx(
1403
+ TileGroup,
1404
+ {
1405
+ allowMultiple: false,
1406
+ errorMessage,
1407
+ isHorizontal: true,
1408
+ maxSelected: 1,
1409
+ name,
1410
+ onChange: handleChange,
1411
+ selected: value || "",
1412
+ tiles: [
1413
+ { label: yesTileLabel, value: GuidanceQuestionValues.YES },
1414
+ { label: noTileLabel, value: GuidanceQuestionValues.NO }
1415
+ ]
1416
+ }
1417
+ ) })
1418
+ ] });
1419
+ };
1416
1420
  const areArraysDifferent = (a = [], b = []) => {
1417
1421
  if (a.length !== b.length) {
1418
1422
  return true;
@@ -1422,23 +1426,22 @@ const areArraysDifferent = (a = [], b = []) => {
1422
1426
  return sortedA.some((item, index) => item !== sortedB[index]);
1423
1427
  };
1424
1428
  const calculateRoles = (data) => {
1425
- var _a, _b, _c, _d;
1426
1429
  const roleMappings = [
1427
1430
  {
1428
- isApplicable: ((_a = data == null ? void 0 : data.signatoryQuestionnaire) == null ? void 0 : _a.isSignatory) === "yes",
1429
- role: DecisionMakerType.SIGNATORY
1431
+ isApplicable: data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES,
1432
+ role: DecisionMakerTypes.SIGNATORY
1430
1433
  },
1431
1434
  {
1432
- isApplicable: ((_b = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _b.isOwner) === "yes",
1433
- role: DecisionMakerType.OWNER
1435
+ isApplicable: data?.uboQuestionnaire?.isOwner === GuidanceQuestionValues.YES,
1436
+ role: DecisionMakerTypes.OWNER
1434
1437
  },
1435
1438
  {
1436
- isApplicable: ((_c = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _c.isControllingPerson) === "yes",
1437
- role: DecisionMakerType.CONTROLLING_PERSON
1439
+ isApplicable: data?.uboQuestionnaire?.isControllingPerson === GuidanceQuestionValues.YES,
1440
+ role: DecisionMakerTypes.CONTROLLING_PERSON
1438
1441
  },
1439
1442
  {
1440
- isApplicable: ((_d = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _d.isDirector) === "yes",
1441
- role: DecisionMakerType.DIRECTOR
1443
+ isApplicable: data?.uboQuestionnaire?.isDirector === GuidanceQuestionValues.YES,
1444
+ role: DecisionMakerTypes.DIRECTOR
1442
1445
  }
1443
1446
  ];
1444
1447
  return roleMappings.filter(({ isApplicable }) => isApplicable).map(({ role }) => role);
@@ -1478,8 +1481,8 @@ const TAX_ID_REQUIRED_COUNTRIES = [
1478
1481
  CountryCodes.France
1479
1482
  ];
1480
1483
  const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
1481
- DecisionMakerType.SIGNATORY,
1482
- DecisionMakerType.CONTROLLING_PERSON
1484
+ DecisionMakerTypes.SIGNATORY,
1485
+ DecisionMakerTypes.CONTROLLING_PERSON
1483
1486
  ];
1484
1487
  const ID_MISSING_DATA_ERROR_CODE = "2_8071";
1485
1488
  const individualOnfidoRules = ({
@@ -1498,32 +1501,30 @@ const individualOnfidoRules = ({
1498
1501
  return void 0;
1499
1502
  },
1500
1503
  isDirectorIdNumberRequiredForCountry: () => {
1501
- var _a, _b, _c, _d, _e;
1502
- if (!((_a = data.basicDetails) == null ? void 0 : _a.role)) {
1504
+ if (!data.basicDetails?.role) {
1503
1505
  return REQUIRED;
1504
1506
  }
1505
- if ((_c = (_b = data.basicDetails) == null ? void 0 : _b.role) == null ? void 0 : _c.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1507
+ if (data.basicDetails?.role?.some((role) => role !== DecisionMakerTypes.DIRECTOR)) {
1506
1508
  return REQUIRED;
1507
1509
  }
1508
- 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))) {
1510
+ if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && data.basicDetails?.role?.some((role) => role === DecisionMakerTypes.DIRECTOR)) {
1509
1511
  return REQUIRED;
1510
1512
  }
1511
1513
  },
1512
1514
  idNumberRules: () => {
1513
- var _a, _b, _c, _d, _e, _f, _g, _h;
1514
- if ((_a = data.additionalPersonalDetails) == null ? void 0 : _a.idNumberExempt) {
1515
+ if (data.additionalPersonalDetails?.idNumberExempt) {
1515
1516
  return OPTIONAL;
1516
1517
  }
1517
- if (!((_b = data.basicDetails) == null ? void 0 : _b.role)) {
1518
+ if (!data.basicDetails?.role) {
1518
1519
  return REQUIRED;
1519
1520
  }
1520
- if (country === CountryCodes.UnitedStates && ((_d = (_c = data.basicDetails) == null ? void 0 : _c.role) == null ? void 0 : _d.every((role) => role === DecisionMakerType.SIGNATORY))) {
1521
+ if (country === CountryCodes.UnitedStates && data.basicDetails?.role?.every((role) => role === DecisionMakerTypes.SIGNATORY)) {
1521
1522
  return void 0;
1522
1523
  }
1523
- if ((_f = (_e = data.basicDetails) == null ? void 0 : _e.role) == null ? void 0 : _f.some((role) => role !== DecisionMakerType.DIRECTOR)) {
1524
+ if (data.basicDetails?.role?.some((role) => role !== DecisionMakerTypes.DIRECTOR)) {
1524
1525
  return REQUIRED;
1525
1526
  }
1526
- if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && ((_h = (_g = data.basicDetails) == null ? void 0 : _g.role) == null ? void 0 : _h.some((role) => role === DecisionMakerType.DIRECTOR))) {
1527
+ if (ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES.includes(country) && data.basicDetails?.role?.some((role) => role === DecisionMakerTypes.DIRECTOR)) {
1527
1528
  return REQUIRED;
1528
1529
  }
1529
1530
  },
@@ -1533,11 +1534,10 @@ const individualOnfidoRules = ({
1533
1534
  }
1534
1535
  },
1535
1536
  idNumberExemptIfApplicableCountry: () => {
1536
- var _a, _b;
1537
- if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && (matchingScenario == null ? void 0 : matchingScenario.includes(Scenarios.L_TAXINFO))) {
1537
+ if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && matchingScenario?.includes(Scenarios.L_TAXINFO)) {
1538
1538
  return void 0;
1539
1539
  }
1540
- if (country === CountryCodes.UnitedStates && ((_b = (_a = data.basicDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.every((role) => role === DecisionMakerType.SIGNATORY))) {
1540
+ if (country === CountryCodes.UnitedStates && data.basicDetails?.role?.every((role) => role === DecisionMakerTypes.SIGNATORY)) {
1541
1541
  return void 0;
1542
1542
  }
1543
1543
  if (ID_NUMBER_EXEMPT_COUNTRIES.includes(country)) {
@@ -1545,30 +1545,28 @@ const individualOnfidoRules = ({
1545
1545
  }
1546
1546
  },
1547
1547
  hasChosenIdType: () => {
1548
- var _a;
1549
- return ((_a = data == null ? void 0 : data.manualIdUpload) == null ? void 0 : _a.idDocumentType) ? REQUIRED : void 0;
1548
+ return data?.manualIdUpload?.idDocumentType ? REQUIRED : void 0;
1550
1549
  },
1551
1550
  backPageIfRequiredForIdType: () => {
1552
1551
  const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
1553
1552
  const idDocumentOption = idDocumentTypeOptions.find(
1554
- ({ id }) => {
1555
- var _a;
1556
- return id === ((_a = data.manualIdUpload) == null ? void 0 : _a.idDocumentType);
1557
- }
1553
+ ({ id }) => id === data.manualIdUpload?.idDocumentType
1558
1554
  );
1559
- return (idDocumentOption == null ? void 0 : idDocumentOption.hasBackPage) ? REQUIRED : void 0;
1555
+ return idDocumentOption?.hasBackPage ? REQUIRED : void 0;
1560
1556
  },
1561
1557
  isProofOfResidencyRequired: () => {
1562
- var _a, _b, _c, _d, _e, _f;
1563
- if ((_b = (_a = data.proofOfResidency) == null ? void 0 : _a.proofOfResidency) == null ? void 0 : _b.length) {
1558
+ if (data.proofOfResidency?.proofOfResidency?.length) {
1564
1559
  return REQUIRED;
1565
1560
  }
1566
- const isInstantFlow = ((_c = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _c.idVerificationMethod) === "instantVerification";
1561
+ if (taskType === TaskTypes.DECISION_MAKER && data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN)) {
1562
+ return void 0;
1563
+ }
1564
+ const isInstantFlow = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
1567
1565
  if (!isInstantFlow) {
1568
1566
  return void 0;
1569
1567
  }
1570
- const documentCountry = (_e = (_d = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _d.idDocument) == null ? void 0 : _e.documentCountry;
1571
- const residenceCountry = ((_f = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _f.country) ?? country;
1568
+ const documentCountry = data?.idVerificationMethod?.idDocument?.documentCountry;
1569
+ const residenceCountry = data?.additionalPersonalDetails?.country ?? country;
1572
1570
  if (!documentCountry || !residenceCountry) {
1573
1571
  return void 0;
1574
1572
  }
@@ -1579,15 +1577,19 @@ const individualOnfidoRules = ({
1579
1577
  }
1580
1578
  },
1581
1579
  isProofOfNationalIdRequired: () => {
1582
- var _a, _b;
1583
- if ((_b = (_a = data.proofOfNationalId) == null ? void 0 : _a.proofOfNationalId) == null ? void 0 : _b.length) {
1580
+ if (data.proofOfNationalId?.proofOfNationalId?.length) {
1584
1581
  return REQUIRED;
1585
1582
  }
1586
1583
  },
1584
+ isIdVerificationMethodRequired: () => {
1585
+ if (taskType === TaskTypes.DECISION_MAKER && data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN)) {
1586
+ return void 0;
1587
+ }
1588
+ return REQUIRED;
1589
+ },
1587
1590
  contactsIfRequiredForRole: () => {
1588
- var _a, _b;
1589
1591
  if (taskType === TaskTypes.DECISION_MAKER) {
1590
- if ((_b = (_a = data.basicDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.includes(DecisionMakerType.SIGNATORY)) {
1592
+ if (data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY)) {
1591
1593
  return REQUIRED;
1592
1594
  }
1593
1595
  return;
@@ -1596,22 +1598,28 @@ const individualOnfidoRules = ({
1596
1598
  },
1597
1599
  requiredIfPhoneScenarioDisabled: () => !isExperimentEnabled("EnablePhoneFieldScenario") ? REQUIRED : void 0,
1598
1600
  jobTitleIfRequiredForRole: () => {
1599
- var _a, _b;
1600
1601
  if (taskType !== TaskTypes.DECISION_MAKER) return;
1601
- if (((_b = (_a = data.basicDetails) == null ? void 0 : _a.role) == null ? void 0 : _b.some(
1602
+ if (data.basicDetails?.role?.some(
1602
1603
  (role) => DECISION_MAKER_TYPES_WITH_JOBTITLE.includes(role)
1603
- )) || JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1604
+ ) || JOB_TITLE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1605
+ return REQUIRED;
1606
+ }
1607
+ },
1608
+ isPlaceOfBirthRequired: () => {
1609
+ if (taskType === TaskTypes.DECISION_MAKER && data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN)) {
1604
1610
  return REQUIRED;
1605
1611
  }
1606
1612
  },
1607
1613
  nationalityIfRequiredForRole: () => {
1608
- var _a, _b;
1614
+ if (taskType === TaskTypes.DECISION_MAKER && data.basicDetails?.role?.includes(DecisionMakerTypes.SIGNATORY) && matchingScenario?.includes(Scenarios.L_BAFIN)) {
1615
+ return REQUIRED;
1616
+ }
1609
1617
  const enableNationalitySGHK = isExperimentEnabled("EnableNationalitySGHK");
1610
- const rootLegalEntityCountry = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _a.registeredAddress.country;
1618
+ const rootLegalEntityCountry = rootLegalEntity?.organization?.registeredAddress.country;
1611
1619
  if (enableNationalitySGHK && rootLegalEntityCountry && NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(rootLegalEntityCountry)) {
1612
1620
  return REQUIRED;
1613
1621
  }
1614
- if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || ((_b = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _b.nationality)) {
1622
+ if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || data?.additionalPersonalDetails?.nationality) {
1615
1623
  return REQUIRED;
1616
1624
  }
1617
1625
  },
@@ -1621,20 +1629,17 @@ const individualOnfidoRules = ({
1621
1629
  }
1622
1630
  },
1623
1631
  licenseCardNumberRules: () => {
1624
- var _a;
1625
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense" && LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1632
+ if (data.additionalPersonalDetails?.typeOfIdentity === "driversLicense" && LICENSE_CARD_NUMBER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1626
1633
  return REQUIRED;
1627
1634
  }
1628
1635
  },
1629
1636
  issuerStateRequired: () => {
1630
- var _a;
1631
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1637
+ if (data.additionalPersonalDetails?.typeOfIdentity === "driversLicense" && ISSUER_REQUIRED_FOR_COUNTRIES.includes(country)) {
1632
1638
  return REQUIRED;
1633
1639
  }
1634
1640
  },
1635
1641
  expiryDateRequired: () => {
1636
- var _a;
1637
- if (((_a = data.additionalPersonalDetails) == null ? void 0 : _a.typeOfIdentity) === "passport" && EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1642
+ if (data.additionalPersonalDetails?.typeOfIdentity === "passport" && EXPIRY_DATE_REQUIRED_FOR_COUNTRIES.includes(country)) {
1638
1643
  return REQUIRED;
1639
1644
  }
1640
1645
  },
@@ -1642,87 +1647,76 @@ const individualOnfidoRules = ({
1642
1647
  isProofOfRelationshipRequired: () => void 0,
1643
1648
  // not required until more clarity from product
1644
1649
  addressIfRequiredForCountry: () => {
1645
- var _a;
1646
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1650
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1647
1651
  return addressSchema.includes("address") ? "REQUIRED" : void 0;
1648
1652
  },
1649
1653
  otherAddressInfoIfRequiredForCountry: () => {
1650
- var _a;
1651
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1654
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1652
1655
  return addressSchema.includes("otherAddressInformation") ? "OPTIONAL" : void 0;
1653
1656
  },
1654
1657
  postalCodeIfRequiredForCountry: () => {
1655
- var _a;
1656
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1658
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1657
1659
  return addressSchema.includes("postalCode") ? "REQUIRED" : void 0;
1658
1660
  },
1659
1661
  cityIfRequiredForCountry: () => {
1660
- var _a;
1661
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1662
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1662
1663
  return addressSchema.includes("city") ? "REQUIRED" : void 0;
1663
1664
  },
1664
1665
  stateOrProvinceIfRequiredForCountry: () => {
1665
- var _a, _b;
1666
- const addressSchema = getAddressSchemaForCountry((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country);
1667
- 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;
1666
+ const addressSchema = getAddressSchemaForCountry(data?.additionalPersonalDetails?.country);
1667
+ return addressSchema.includes("stateOrProvince") && COUNTRIES_WITH_STATES_DATASET.includes(data?.additionalPersonalDetails?.country ?? country) ? "REQUIRED" : void 0;
1668
1668
  },
1669
1669
  nomineeDirectorRequiredForCountry: () => {
1670
- var _a, _b, _c;
1671
- 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))) {
1670
+ if (allowedCountriesForNominee.includes(data?.additionalPersonalDetails?.country ?? country) && data?.basicDetails?.role?.includes(DecisionMakerTypes.DIRECTOR)) {
1672
1671
  return "REQUIRED";
1673
1672
  }
1674
1673
  },
1675
1674
  nomineeShareHolderRequiredForCountry: () => {
1676
- var _a, _b, _c;
1677
- 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))) {
1675
+ if (allowedCountriesForNominee.includes(data?.additionalPersonalDetails?.country ?? country) && data?.basicDetails?.role?.includes(DecisionMakerTypes.OWNER)) {
1678
1676
  return "REQUIRED";
1679
1677
  }
1680
1678
  },
1681
1679
  isUsingInstantVerificationOrHasExistingDocument: () => {
1682
- var _a, _b;
1683
- const isUsingInstantVerification = ((_a = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _a.idVerificationMethod) === "instantVerification";
1684
- const existingDocument = (_b = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _b.idDocument;
1680
+ const isUsingInstantVerification = data?.idVerificationMethod?.idVerificationMethod === "instantVerification";
1681
+ const existingDocument = data?.idVerificationMethod?.idDocument;
1685
1682
  return isUsingInstantVerification || existingDocument ? REQUIRED : void 0;
1686
1683
  },
1687
1684
  isManualIdFlow: () => {
1688
- var _a;
1689
- const isManualFlow = ((_a = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _a.idVerificationMethod) === "manualVerification";
1685
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1690
1686
  return isManualFlow ? "REQUIRED" : void 0;
1691
1687
  },
1692
1688
  isManualIdFlowAndNotProvidingIdNumber: () => {
1693
- var _a, _b, _c;
1694
- const hasMissingId = (_a = problems == null ? void 0 : problems.missingData) == null ? void 0 : _a.some(
1689
+ const hasMissingId = problems?.missingData?.some(
1695
1690
  (error) => error.code === ID_MISSING_DATA_ERROR_CODE
1696
1691
  );
1697
- const isManualFlow = ((_b = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _b.idVerificationMethod) === "manualVerification";
1698
- const idNumberExempt = (_c = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _c.idNumberExempt;
1692
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1693
+ const idNumberExempt = data?.additionalPersonalDetails?.idNumberExempt;
1699
1694
  return isManualFlow && (idNumberExempt || hasMissingId) ? "REQUIRED" : void 0;
1700
1695
  },
1701
1696
  isManualIdFlowAndHasMissingData: () => {
1702
- var _a, _b;
1703
- const hasMissingId = (_a = problems == null ? void 0 : problems.missingData) == null ? void 0 : _a.some(
1697
+ const hasMissingId = problems?.missingData?.some(
1704
1698
  (error) => error.code === ID_MISSING_DATA_ERROR_CODE
1705
1699
  );
1706
- const isManualFlow = ((_b = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _b.idVerificationMethod) === "manualVerification";
1700
+ const isManualFlow = data?.idVerificationMethod?.idVerificationMethod === "manualVerification";
1707
1701
  return isManualFlow && hasMissingId ? "REQUIRED" : void 0;
1708
1702
  },
1709
1703
  idVerificationRequired: () => {
1710
1704
  return REQUIRED;
1711
1705
  },
1712
1706
  isGuidedDecisionMakersFlowEnabled: () => {
1713
- if (isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow")) {
1707
+ if (!isExperimentEnabled("DisableGuidedDecisionMakersFlow") && (isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow"))) {
1714
1708
  return "REQUIRED";
1715
1709
  }
1716
1710
  },
1717
1711
  isGuidedDecisionMakersFlowDisabled: () => {
1718
- if (!isExperimentEnabled("EnableGuidedDecisionMakersFlow") && !isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow")) {
1712
+ if (isExperimentEnabled("DisableGuidedDecisionMakersFlow") || !isExperimentEnabled("EnableGuidedDecisionMakersFlow") && !isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow")) {
1719
1713
  return "REQUIRED";
1720
1714
  }
1721
1715
  },
1722
1716
  isDirectorRequiredForCountry: () => {
1723
- const availableDecisionMakers = getAvailableDecisionMakerRoleTypes(country);
1717
+ const availableDecisionMakers = getAvailableDecisionMakerRoleTypes(country, matchingScenario);
1724
1718
  const isDirectorRequired = availableDecisionMakers.some(
1725
- (maker) => maker.roleType === DecisionMakerType.DIRECTOR
1719
+ (maker) => maker.roleType === DecisionMakerTypes.DIRECTOR
1726
1720
  );
1727
1721
  if (isDirectorRequired) {
1728
1722
  return "REQUIRED";
@@ -1786,7 +1780,6 @@ const identityValidationRules = (country) => {
1786
1780
  }
1787
1781
  };
1788
1782
  function Identity(props) {
1789
- var _a, _b, _c;
1790
1783
  const { additionalPersonalDetails, country, idNumberType, handleFieldChange } = props;
1791
1784
  const {
1792
1785
  data,
@@ -1838,7 +1831,7 @@ function Identity(props) {
1838
1831
  const mergedProps = useMemo(() => {
1839
1832
  const idNumberMetadata = resolveFieldMetadata(
1840
1833
  defaultFieldConfig[country],
1841
- { idNumberType: data == null ? void 0 : data.typeOfIdentity },
1834
+ { idNumberType: data?.typeOfIdentity },
1842
1835
  defaultFieldMetadata
1843
1836
  );
1844
1837
  return mergeFieldMetadataIntoProps(
@@ -1850,21 +1843,21 @@ function Identity(props) {
1850
1843
  initialFormUtilProps
1851
1844
  )
1852
1845
  );
1853
- }, [country, data == null ? void 0 : data.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData]);
1854
- const { i18n } = useI18nContext();
1855
- const formUtils = useMemo(() => createFormUtils(mergedProps, i18n), [mergedProps, i18n]);
1846
+ }, [country, data?.typeOfIdentity, initialFormUtilProps, licenseCardNumberMetaData]);
1847
+ const { t } = useTranslation();
1848
+ const formUtils = useMemo(() => createFormUtils(mergedProps, t), [mergedProps, t]);
1856
1849
  const { form } = useFormContext();
1857
- const defaultIdNumber = (_b = (_a = form == null ? void 0 : form.defaultData) == null ? void 0 : _a.additionalPersonalDetails) == null ? void 0 : _b.idNumber;
1850
+ const defaultIdNumber = form?.defaultData?.additionalPersonalDetails?.idNumber;
1858
1851
  const ssnType = getSSNType(formVerificationErrors, defaultIdNumber);
1859
1852
  const today = /* @__PURE__ */ new Date();
1860
1853
  const maxExpiryDateSelection = new Date((/* @__PURE__ */ new Date()).setFullYear(today.getFullYear() + 10));
1861
1854
  const isCountryAustralia = country === CountryCodes.Australia;
1862
1855
  const isCountryNewZealand = country === CountryCodes.NewZealand;
1863
1856
  useEffect(() => {
1864
- if ((data == null ? void 0 : data.typeOfIdentity) === "nationalIdNumber") {
1857
+ if (data?.typeOfIdentity === "nationalIdNumber") {
1865
1858
  handleFieldChange("typeOfIdentity")(void 0);
1866
1859
  }
1867
- }, [data == null ? void 0 : data.typeOfIdentity, handleFieldChange]);
1860
+ }, [data?.typeOfIdentity, handleFieldChange]);
1868
1861
  if (!handleFieldChange) {
1869
1862
  return;
1870
1863
  }
@@ -1887,15 +1880,15 @@ function Identity(props) {
1887
1880
  /* @__PURE__ */ jsx(
1888
1881
  TypeOfIdentity,
1889
1882
  {
1890
- availableIdentityTypesOptions: (_c = additionallIdNumberOptions) == null ? void 0 : _c[country],
1891
- selectedIdentityType: data == null ? void 0 : data.typeOfIdentity,
1883
+ availableIdentityTypesOptions: additionallIdNumberOptions?.[country],
1884
+ selectedIdentityType: data?.typeOfIdentity,
1892
1885
  setSelectedIdentityType: handleFieldChange("typeOfIdentity"),
1893
1886
  label: formUtils.getLabel("typeOfIdentity"),
1894
- isValid: Boolean(valid == null ? void 0 : valid.typeOfIdentity),
1887
+ isValid: Boolean(valid?.typeOfIdentity),
1895
1888
  errorMessage: formUtils.getErrorMessage("typeOfIdentity", errors, fieldValidationErrors)
1896
1889
  }
1897
1890
  ),
1898
- (isCountryAustralia || isCountryNewZealand) && (data == null ? void 0 : data.typeOfIdentity) === "passport" && /* @__PURE__ */ jsx(
1891
+ (isCountryAustralia || isCountryNewZealand) && data?.typeOfIdentity === "passport" && /* @__PURE__ */ jsx(
1899
1892
  MaskedInput,
1900
1893
  {
1901
1894
  name: "idNumber",
@@ -1904,43 +1897,43 @@ function Identity(props) {
1904
1897
  formatGuidance: formUtils.getGuidanceText("idNumber"),
1905
1898
  errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1906
1899
  shouldValidate,
1907
- isValid: Boolean(valid == null ? void 0 : valid.idNumber),
1900
+ isValid: Boolean(valid?.idNumber),
1908
1901
  "aria-required": formUtils.isRequiredField("idNumber"),
1909
- "aria-invalid": !(valid == null ? void 0 : valid.idNumber),
1902
+ "aria-invalid": !valid?.idNumber,
1910
1903
  onBlur: handleFieldChange("idNumber", "blur"),
1911
1904
  readonly: formUtils.isReadOnly("idNumber"),
1912
- value: (data == null ? void 0 : data.idNumber) ?? "",
1905
+ value: data?.idNumber ?? "",
1913
1906
  onInput: handleFieldChange("idNumber", "input"),
1914
- acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
1907
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1915
1908
  ...formUtils.getMask("idNumber")
1916
1909
  }
1917
1910
  ),
1918
- isCountryNewZealand && (data == null ? void 0 : data.typeOfIdentity) === "passport" && /* @__PURE__ */ jsx(
1911
+ isCountryNewZealand && data?.typeOfIdentity === "passport" && /* @__PURE__ */ jsx(
1919
1912
  Field,
1920
1913
  {
1921
1914
  name: "expiryDate",
1922
1915
  label: formUtils.getLabel("passportExpiryDate"),
1923
1916
  errorMessage: formUtils.getErrorMessage("expiryDate", errors, fieldValidationErrors),
1924
- isValid: valid == null ? void 0 : valid.expiryDate,
1917
+ isValid: valid?.expiryDate,
1925
1918
  children: (childProps) => /* @__PURE__ */ jsx(
1926
1919
  InputDate,
1927
1920
  {
1928
1921
  ...childProps,
1929
1922
  name: "expiryDate",
1930
- value: data == null ? void 0 : data.expiryDate,
1931
- placeholder: i18n.get("datePlaceholder"),
1923
+ value: data?.expiryDate,
1924
+ placeholder: t(($) => $["datePlaceholder"]),
1932
1925
  readonly: formUtils.isReadOnly("expiryDate"),
1933
1926
  onInput: handleFieldChange("expiryDate", "input"),
1934
1927
  onBlur: handleFieldChange("expiryDate", "blur"),
1935
1928
  "aria-required": true,
1936
- "aria-invalid": !(valid == null ? void 0 : valid.expiryDate),
1929
+ "aria-invalid": !valid?.expiryDate,
1937
1930
  min: formatDateObj(today),
1938
1931
  max: formatDateObj(maxExpiryDateSelection)
1939
1932
  }
1940
1933
  )
1941
1934
  }
1942
1935
  ),
1943
- (isCountryAustralia || isCountryNewZealand) && (data == null ? void 0 : data.typeOfIdentity) === "driversLicense" && /* @__PURE__ */ jsx(
1936
+ (isCountryAustralia || isCountryNewZealand) && data?.typeOfIdentity === "driversLicense" && /* @__PURE__ */ jsx(
1944
1937
  DriversLicense,
1945
1938
  {
1946
1939
  country,
@@ -1952,9 +1945,9 @@ function Identity(props) {
1952
1945
  onCardNumberBlur: handleFieldChange("licenseCardNumber", "blur"),
1953
1946
  formUtils,
1954
1947
  isValid: {
1955
- idNumber: Boolean(valid == null ? void 0 : valid.idNumber),
1956
- licenseCardNumber: Boolean(valid == null ? void 0 : valid.licenseCardNumber),
1957
- issuerState: Boolean(valid == null ? void 0 : valid.issuerState)
1948
+ idNumber: Boolean(valid?.idNumber),
1949
+ licenseCardNumber: Boolean(valid?.licenseCardNumber),
1950
+ issuerState: Boolean(valid?.issuerState)
1958
1951
  },
1959
1952
  errorMessages: {
1960
1953
  idNumber: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
@@ -1977,14 +1970,14 @@ function Identity(props) {
1977
1970
  formatGuidance: formUtils.getGuidanceText("idNumber"),
1978
1971
  errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldValidationErrors),
1979
1972
  shouldValidate,
1980
- isValid: Boolean(valid == null ? void 0 : valid.idNumber),
1973
+ isValid: Boolean(valid?.idNumber),
1981
1974
  "aria-required": formUtils.isRequiredField("idNumber"),
1982
- "aria-invalid": Boolean(!(valid == null ? void 0 : valid.idNumber)),
1975
+ "aria-invalid": Boolean(!valid?.idNumber),
1983
1976
  onBlur: handleFieldChange("idNumber", "blur"),
1984
1977
  readonly: formUtils.isReadOnly("idNumber"),
1985
- value: (data == null ? void 0 : data.idNumber) ?? "",
1978
+ value: data?.idNumber ?? "",
1986
1979
  onInput: handleFieldChange("idNumber", "input"),
1987
- acceptObscuredValue: formUtils == null ? void 0 : formUtils.isObscured("idNumber"),
1980
+ acceptObscuredValue: formUtils?.isObscured("idNumber"),
1988
1981
  ...formUtils.getMask("idNumber")
1989
1982
  }
1990
1983
  )
@@ -2012,16 +2005,17 @@ const additionalPersonalDetailsFields = [
2012
2005
  ...additionalIdentityInfoFields,
2013
2006
  "country",
2014
2007
  "nationality",
2008
+ "placeOfBirth",
2015
2009
  ...addressFields,
2016
2010
  "taxInformation"
2017
2011
  ];
2018
2012
  function AdditionalPersonalDetails(props) {
2019
- var _a, _b;
2020
- const { i18n } = useI18nContext();
2013
+ const { t } = useTranslation(["common", "individual"]);
2021
2014
  const allowedCountries = useAllowedCountries();
2022
2015
  const [showLegalRepresentativePrompt, setShowLegalRepresentativePrompt] = useState(false);
2023
2016
  const { isSettingEnabled } = useSettingsContext();
2024
2017
  const { isExperimentEnabled } = useExperimentsContext();
2018
+ const { form } = useFormContext();
2025
2019
  const isExperimentAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
2026
2020
  const isSettingsEnforceLegalAgeEnabled = isSettingEnabled(SettingNames.EnforceLegalAge);
2027
2021
  const {
@@ -2036,25 +2030,24 @@ function AdditionalPersonalDetails(props) {
2036
2030
  taskType,
2037
2031
  handleFieldChange
2038
2032
  } = props;
2039
- const country = (data == null ? void 0 : data.country) ?? defaultCountry;
2033
+ const country = data?.country ?? defaultCountry;
2040
2034
  const isIndividual = taskType === TaskTypes.INDIVIDUAL;
2041
2035
  const showField = (fieldKeys) => fieldKeys.some((field) => formUtils.isRequiredField(field) || formUtils.isOptionalField(field));
2042
- const [taxIdNumberType, setTaxIdNumberType] = useState(
2043
- getDefaultTaxIdNumberType(data == null ? void 0 : data.taxInformation, country, LegalEntityType.INDIVIDUAL)
2044
- );
2045
2036
  const mergedProps = mergeFieldMetadataIntoProps(
2046
2037
  "taxInformation",
2047
2038
  resolveFieldMetadata(
2048
- defaultFieldConfig$1[country],
2039
+ taxInformationDefaultFieldConfig[country],
2049
2040
  {
2050
- taxIdNumberType,
2051
- companyType: LegalEntityType.INDIVIDUAL
2041
+ taxIdNumberType: form.data?.additionalPersonalDetails?.taxInformation?.find(
2042
+ (taxId) => taxId.country === country
2043
+ )?.type,
2044
+ companyType: LegalEntityTypes.INDIVIDUAL
2052
2045
  },
2053
- defaultFieldMetadata$2
2046
+ taxInformationDefaultFieldMetadata
2054
2047
  ),
2055
2048
  props
2056
2049
  );
2057
- const formUtils = createFormUtils(mergedProps, i18n);
2050
+ const formUtils = createFormUtils(mergedProps, t);
2058
2051
  const birthDateErrorMessage = formUtils.getErrorMessage(
2059
2052
  "birthDate",
2060
2053
  errors,
@@ -2083,14 +2076,14 @@ function AdditionalPersonalDetails(props) {
2083
2076
  }
2084
2077
  ),
2085
2078
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__section-heading", children: [
2086
- /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get("residentialAddress") }),
2087
- /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("residentialAddressDescription") })
2079
+ /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["residentialAddress"]) }),
2080
+ /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: t(($) => $["thisPersonsPrimaryAddress"], { ns: "individual" }) })
2088
2081
  ] }),
2089
2082
  formUtils.isRequiredField("country") && /* @__PURE__ */ jsx(
2090
2083
  CountryField,
2091
2084
  {
2092
2085
  data: { country },
2093
- valid: { country: valid == null ? void 0 : valid.country },
2086
+ valid: { country: valid?.country },
2094
2087
  errors: {
2095
2088
  country: formUtils.getErrorMessage("country", errors, fieldValidationErrors)
2096
2089
  },
@@ -2116,11 +2109,11 @@ function AdditionalPersonalDetails(props) {
2116
2109
  }
2117
2110
  ),
2118
2111
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-additional-information__section-heading", children: [
2119
- /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: i18n.get("personalIdentityDetails") }),
2112
+ /* @__PURE__ */ jsx(Typography, { el: "h3", variant: "title", children: t(($) => $["personalIdentityDetails"], { ns: "individual" }) }),
2120
2113
  /* @__PURE__ */ jsxs(Typography, { el: "p", variant: "body", children: [
2121
- i18n.get("personalIdentityDetailsDescription"),
2114
+ t(($) => $["weOnlyUseTheseDetailsForIdentityVerification"], { ns: "individual" }),
2122
2115
  " ",
2123
- /* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/privacy-policy", external: true, children: i18n.get("personalIdentityDetailsDescriptionLink") })
2116
+ /* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/privacy-policy", external: true, children: t(($) => $["privacyStatement"]) })
2124
2117
  ] })
2125
2118
  ] }),
2126
2119
  formUtils.isRequiredField("birthDate") && /* @__PURE__ */ jsx(
@@ -2129,19 +2122,19 @@ function AdditionalPersonalDetails(props) {
2129
2122
  name: "birthDate",
2130
2123
  label: formUtils.getLabel("birthDate"),
2131
2124
  errorMessage: birthDateErrorMessage,
2132
- isValid: valid == null ? void 0 : valid.birthDate,
2125
+ isValid: valid?.birthDate,
2133
2126
  children: (childProps) => /* @__PURE__ */ jsx(
2134
2127
  InputDate,
2135
2128
  {
2136
2129
  ...childProps,
2137
2130
  name: "birthDate",
2138
- value: data == null ? void 0 : data.birthDate,
2139
- placeholder: i18n.get("datePlaceholder"),
2131
+ value: data?.birthDate,
2132
+ placeholder: t(($) => $["datePlaceholder"]),
2140
2133
  readonly: formUtils.isReadOnly("birthDate"),
2141
2134
  onInput: handleFieldChange("birthDate", "input"),
2142
2135
  onBlur: handleBirthDateChange,
2143
2136
  "aria-required": true,
2144
- "aria-invalid": !(valid == null ? void 0 : valid.birthDate),
2137
+ "aria-invalid": !valid?.birthDate,
2145
2138
  max: formatDateObj(/* @__PURE__ */ new Date())
2146
2139
  }
2147
2140
  )
@@ -2150,15 +2143,16 @@ function AdditionalPersonalDetails(props) {
2150
2143
  showLegalRepresentativePrompt && /* @__PURE__ */ jsx(
2151
2144
  Confirm,
2152
2145
  {
2153
- title: i18n.get("legalRepresentativeForMinorIsRequired"),
2154
- description: i18n.get("becauseThisPersonIsUnderXYearsOld", {
2155
- values: { age: ((_b = (_a = getAgeRangeForLegalRepresentative(country)) == null ? void 0 : _a.max) == null ? void 0 : _b.toString()) ?? "" }
2146
+ title: t(($) => $["legalRepresentativeForMinorIsRequired"], { ns: "individual" }),
2147
+ description: t(($) => $["becauseThisPersonIsUnderXYearsOld"], {
2148
+ ns: "individual",
2149
+ age: getAgeRangeForLegalRepresentative(country)?.max?.toString() ?? ""
2156
2150
  }),
2157
2151
  onCancel: () => {
2158
2152
  setShowLegalRepresentativePrompt(false);
2159
2153
  },
2160
- confirmText: i18n.get("ok"),
2161
- cancelText: i18n.get("editDetails"),
2154
+ confirmText: t(($) => $["ok"]),
2155
+ cancelText: t(($) => $["editDetails"]),
2162
2156
  onConfirm: () => {
2163
2157
  setShowLegalRepresentativePrompt(false);
2164
2158
  }
@@ -2169,7 +2163,7 @@ function AdditionalPersonalDetails(props) {
2169
2163
  {
2170
2164
  country,
2171
2165
  handleFieldChange: handleFieldChange("typeOfIdentity", "input"),
2172
- selected: data == null ? void 0 : data.typeOfIdentity
2166
+ selected: data?.typeOfIdentity
2173
2167
  }
2174
2168
  ),
2175
2169
  /* @__PURE__ */ jsx(
@@ -2178,15 +2172,15 @@ function AdditionalPersonalDetails(props) {
2178
2172
  additionalPersonalDetails: props,
2179
2173
  country,
2180
2174
  errors,
2181
- idNumberType: data == null ? void 0 : data.typeOfIdentity,
2175
+ idNumberType: data?.typeOfIdentity,
2182
2176
  handleFieldChange
2183
2177
  }
2184
2178
  ),
2185
2179
  showField(["taxInformation"]) && /* @__PURE__ */ jsx(
2186
2180
  TaxInformationField,
2187
2181
  {
2188
- data: { taxInformation: data == null ? void 0 : data.taxInformation },
2189
- valid: { taxInformation: valid == null ? void 0 : valid.taxInformation },
2182
+ data: { taxInformation: data?.taxInformation },
2183
+ valid: { taxInformation: valid?.taxInformation },
2190
2184
  errors: {
2191
2185
  taxInformation: formUtils.getErrorMessage(
2192
2186
  "taxInformation",
@@ -2196,24 +2190,21 @@ function AdditionalPersonalDetails(props) {
2196
2190
  },
2197
2191
  labels: formUtils.getFieldLabels(["taxInformation"]),
2198
2192
  mask: formUtils.getMask("taxInformation"),
2199
- helperText: formUtils.getFieldHelperText(["taxInformation"]),
2200
2193
  guidanceText: formUtils.getFieldGuidanceText(["taxInformation"]),
2201
2194
  readonly: formUtils.isReadOnly("taxInformation"),
2202
2195
  shouldValidate,
2203
2196
  handleChangeFor: handleFieldChange,
2204
2197
  canExempt: false,
2205
2198
  country,
2206
- companyType: LegalEntityType.INDIVIDUAL,
2207
- taxIdNumberType,
2208
- setTaxIdNumberType,
2209
- defaultData: data == null ? void 0 : data.taxInformation
2199
+ entityType: LegalEntityTypes.INDIVIDUAL,
2200
+ defaultData: data?.taxInformation
2210
2201
  }
2211
2202
  ),
2212
2203
  formUtils.isRequiredField("nationality") && /* @__PURE__ */ jsx(
2213
2204
  CountryField,
2214
2205
  {
2215
- data: { country: data == null ? void 0 : data.nationality },
2216
- valid: { country: valid == null ? void 0 : valid.nationality },
2206
+ data: { country: data?.nationality },
2207
+ valid: { country: valid?.nationality },
2217
2208
  name: "nationality",
2218
2209
  errors: {
2219
2210
  country: formUtils.getErrorMessage("nationality", errors, fieldValidationErrors)
@@ -2223,6 +2214,28 @@ function AdditionalPersonalDetails(props) {
2223
2214
  handleChangeFor: () => handleFieldChange("nationality", "input")
2224
2215
  }
2225
2216
  ),
2217
+ formUtils.isRequiredField("placeOfBirth") && /* @__PURE__ */ jsx(
2218
+ Field,
2219
+ {
2220
+ name: "placeOfBirth",
2221
+ label: formUtils.getLabel("placeOfBirth"),
2222
+ errorMessage: formUtils.getErrorMessage("placeOfBirth", errors, fieldValidationErrors),
2223
+ isValid: valid?.placeOfBirth,
2224
+ children: (childProps) => /* @__PURE__ */ jsx(
2225
+ InputText,
2226
+ {
2227
+ ...childProps,
2228
+ name: "placeOfBirth",
2229
+ value: data?.placeOfBirth,
2230
+ readonly: formUtils.isReadOnly("placeOfBirth"),
2231
+ onInput: handleFieldChange("placeOfBirth", "input"),
2232
+ onBlur: handleFieldChange("placeOfBirth", "blur"),
2233
+ "aria-required": true,
2234
+ "aria-invalid": !valid?.placeOfBirth
2235
+ }
2236
+ )
2237
+ }
2238
+ ),
2226
2239
  country === "US" && isIndividual ? /* @__PURE__ */ jsx(PatriotActDisclosure, {}) : void 0
2227
2240
  ] });
2228
2241
  }
@@ -2239,13 +2252,14 @@ const basicDetailsFields = [
2239
2252
  "jaKanaLastName"
2240
2253
  ];
2241
2254
  function BasicDetails(props) {
2242
- var _a, _b, _c;
2255
+ const { t } = useTranslation();
2243
2256
  const { i18n } = useI18nContext();
2244
2257
  const {
2245
2258
  form: { triggerValidation }
2246
2259
  } = useFormContext();
2247
2260
  const { isExperimentEnabled } = useExperimentsContext();
2248
2261
  const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
2262
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
2249
2263
  const {
2250
2264
  country,
2251
2265
  data,
@@ -2264,7 +2278,7 @@ function BasicDetails(props) {
2264
2278
  } = props;
2265
2279
  const isDecisionMakerTask = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
2266
2280
  const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
2267
- const formUtils = createFormUtils(props, i18n);
2281
+ const formUtils = createFormUtils(props, t);
2268
2282
  const decisionMakerRoleProps = getFieldProps(props, decisionMakerRoleFields);
2269
2283
  const nomineeProps = getFieldProps(props, nomineeFields);
2270
2284
  const localizedNameProps = getFieldProps(props, [
@@ -2296,8 +2310,8 @@ function BasicDetails(props) {
2296
2310
  title: i18n.get({
2297
2311
  key: "legalRepresentativeFor",
2298
2312
  values: {
2299
- firstName: ((_a = parentLegalEntity == null ? void 0 : parentLegalEntity.individual) == null ? void 0 : _a.name.firstName) || "",
2300
- lastName: ((_b = parentLegalEntity == null ? void 0 : parentLegalEntity.individual) == null ? void 0 : _b.name.lastName) || ""
2313
+ firstName: parentLegalEntity?.individual?.name.firstName || "",
2314
+ lastName: parentLegalEntity?.individual?.name.lastName || ""
2301
2315
  }
2302
2316
  })
2303
2317
  }
@@ -2311,10 +2325,10 @@ function BasicDetails(props) {
2311
2325
  contentId: "reasonForFillingIndividualPersonalDetails"
2312
2326
  }
2313
2327
  ),
2314
- isDecisionMakerTask && trustedFieldsProvider === TrustedFieldsProvider.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, { color: "secondary", variant: "caption", children: i18n.get(
2328
+ isDecisionMakerTask && trustedFieldsProvider === TrustedFieldsProviders.SINGPASS && readOnlyFields && /* @__PURE__ */ jsx(Typography, { color: "secondary", variant: "caption", children: i18n.get(
2315
2329
  "weSelectedSomeRolesBasedOnMyinfoBusinessDataAboutYourCompanysAppointmentHoldersAndShareholders"
2316
2330
  ) }),
2317
- isDecisionMakerTask && !isGuidedDecisionMakersFlowEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [
2331
+ isDecisionMakerTask && (isGuidedDecisionMakersFlowDisabled || !isGuidedDecisionMakersFlowEnabled) && /* @__PURE__ */ jsxs(Fragment, { children: [
2318
2332
  /* @__PURE__ */ jsx(
2319
2333
  DecisionMakerRole,
2320
2334
  {
@@ -2331,7 +2345,7 @@ function BasicDetails(props) {
2331
2345
  NomineeDecisionMakerRole,
2332
2346
  {
2333
2347
  ...nomineeProps,
2334
- roles: data == null ? void 0 : data.role,
2348
+ roles: data?.role,
2335
2349
  country,
2336
2350
  handleFieldChange
2337
2351
  }
@@ -2356,7 +2370,7 @@ function BasicDetails(props) {
2356
2370
  {
2357
2371
  ...childProps,
2358
2372
  name: "jobTitle",
2359
- value: data == null ? void 0 : data.jobTitle,
2373
+ value: data?.jobTitle,
2360
2374
  placeholder: formUtils.getPlaceholder("jobTitle"),
2361
2375
  readonly: formUtils.isReadOnly("jobTitle"),
2362
2376
  onInput: handleFieldChange("jobTitle", "input"),
@@ -2366,7 +2380,7 @@ function BasicDetails(props) {
2366
2380
  )
2367
2381
  }
2368
2382
  ),
2369
- !!((_c = contactDetailsFormProps == null ? void 0 : contactDetailsFormProps.requiredFields) == null ? void 0 : _c.length) && /* @__PURE__ */ jsx(
2383
+ !!contactDetailsFormProps?.requiredFields?.length && /* @__PURE__ */ jsx(
2370
2384
  ContactDetails,
2371
2385
  {
2372
2386
  ...contactDetailsFormProps,
@@ -2475,16 +2489,17 @@ const useDataConflicts = (providedData, detectedData, rules2 = {}, onAutoResolve
2475
2489
  const wasAutoResolved2 = autoResolvedPatches.size > 0;
2476
2490
  const resolvedData2 = wasAutoResolved2 ? { ...providedData ?? {}, ...Object.fromEntries(autoResolvedPatches) } : void 0;
2477
2491
  if (wasAutoResolved2 && !hasConflicts2 && resolvedData2) {
2478
- onAutoResolve == null ? void 0 : onAutoResolve(resolvedData2);
2492
+ onAutoResolve?.(resolvedData2);
2479
2493
  }
2480
2494
  return { hasConflicts: hasConflicts2, conflictingProperties: conflictingProperties2, wasAutoResolved: wasAutoResolved2, resolvedData: resolvedData2 };
2481
2495
  }, [providedData, detectedData, rules2, onAutoResolve]);
2482
2496
  return { hasConflicts, conflictingProperties, wasAutoResolved, resolvedData };
2483
2497
  };
2498
+ const isNextStepDisabled = signal(false);
2484
2499
  const conflictRowTable = "adyen-kyc-conflict-row-table";
2485
2500
  const conflictRowList = "adyen-kyc-conflict-row-list";
2486
2501
  const conflictRowListOptionLabel = "adyen-kyc-conflict-row-list-option-label";
2487
- const styles$6 = {
2502
+ const styles$3 = {
2488
2503
  conflictRowTable,
2489
2504
  conflictRowList,
2490
2505
  conflictRowListOptionLabel
@@ -2510,7 +2525,7 @@ const ConflictRow = ({
2510
2525
  }
2511
2526
  }, [hasOnlyProvided, hasOnlyDetected, onSelect, selected]);
2512
2527
  if (hasOnlyProvided || hasOnlyDetected) return;
2513
- return showAs === "listItem" ? /* @__PURE__ */ jsxs("div", { className: styles$6.conflictRowList, children: [
2528
+ return showAs === "listItem" ? /* @__PURE__ */ jsxs("div", { className: styles$3.conflictRowList, children: [
2514
2529
  /* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: i18n.get(label) }) }),
2515
2530
  /* @__PURE__ */ jsxs("dd", { children: [
2516
2531
  /* @__PURE__ */ jsxs("div", { children: [
@@ -2519,7 +2534,7 @@ const ConflictRow = ({
2519
2534
  {
2520
2535
  variant: "caption",
2521
2536
  color: "tertiary",
2522
- className: styles$6.conflictRowListOptionLabel,
2537
+ className: styles$3.conflictRowListOptionLabel,
2523
2538
  children: i18n.get("youEntered")
2524
2539
  }
2525
2540
  ),
@@ -2539,7 +2554,7 @@ const ConflictRow = ({
2539
2554
  {
2540
2555
  variant: "caption",
2541
2556
  color: "tertiary",
2542
- className: styles$6.conflictRowListOptionLabel,
2557
+ className: styles$3.conflictRowListOptionLabel,
2543
2558
  children: i18n.get("weDetected")
2544
2559
  }
2545
2560
  ),
@@ -2554,7 +2569,7 @@ const ConflictRow = ({
2554
2569
  )
2555
2570
  ] })
2556
2571
  ] })
2557
- ] }) : /* @__PURE__ */ jsxs("tr", { className: styles$6.conflictRowTable, children: [
2572
+ ] }) : /* @__PURE__ */ jsxs("tr", { className: styles$3.conflictRowTable, children: [
2558
2573
  /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: i18n.get(label) }) }),
2559
2574
  /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(
2560
2575
  RadioWithLabel,
@@ -2580,7 +2595,7 @@ const dataConflictsWrapper = "adyen-kyc-data-conflicts-wrapper";
2580
2595
  const dataConflictsHeader = "adyen-kyc-data-conflicts-header";
2581
2596
  const dataConflictsTable = "adyen-kyc-data-conflicts-table";
2582
2597
  const dataConflictsList = "adyen-kyc-data-conflicts-list";
2583
- const styles$5 = {
2598
+ const styles$2 = {
2584
2599
  dataConflictsWrapper,
2585
2600
  dataConflictsHeader,
2586
2601
  dataConflictsTable,
@@ -2621,13 +2636,13 @@ const DataConflictsModal = ({
2621
2636
  // No dependencies, as setShowError and setResolutions are stable.
2622
2637
  );
2623
2638
  return /* @__PURE__ */ jsxs(Modal, { ariaLabel: i18n.get(title), onClose: () => setShowCancelModal(true), inset: true, children: [
2624
- /* @__PURE__ */ jsxs("div", { className: styles$5.dataConflictsWrapper, children: [
2625
- /* @__PURE__ */ jsxs("div", { className: styles$5.dataConflictsHeader, children: [
2639
+ /* @__PURE__ */ jsxs("div", { className: styles$2.dataConflictsWrapper, children: [
2640
+ /* @__PURE__ */ jsxs("div", { className: styles$2.dataConflictsHeader, children: [
2626
2641
  /* @__PURE__ */ jsx(Typography, { variant: "title-l", el: "h1", children: i18n.get(title) }),
2627
2642
  /* @__PURE__ */ jsx(Typography, { variant: "body", children: i18n.get(explanation) })
2628
2643
  ] }),
2629
2644
  showError ? /* @__PURE__ */ jsx(Alert, { variant: "error", title: i18n.get("chooseTheCorrectDetailsBeforeProceeding") }) : void 0,
2630
- /* @__PURE__ */ jsx("dl", { className: styles$5.dataConflictsList, children: keysOf(conflictItems).map((property) => /* @__PURE__ */ jsx(
2645
+ /* @__PURE__ */ jsx("dl", { className: styles$2.dataConflictsList, children: keysOf(conflictItems).map((property) => /* @__PURE__ */ jsx(
2631
2646
  ConflictRow,
2632
2647
  {
2633
2648
  showAs: "listItem",
@@ -2640,7 +2655,7 @@ const DataConflictsModal = ({
2640
2655
  },
2641
2656
  property
2642
2657
  )) }),
2643
- /* @__PURE__ */ jsxs("table", { className: styles$5.dataConflictsTable, children: [
2658
+ /* @__PURE__ */ jsxs("table", { className: styles$2.dataConflictsTable, children: [
2644
2659
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
2645
2660
  /* @__PURE__ */ jsx("th", {}),
2646
2661
  /* @__PURE__ */ jsx("th", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "tertiary", children: i18n.get("youEntered") }) }),
@@ -2697,57 +2712,11 @@ const DataConflictsModal = ({
2697
2712
  )
2698
2713
  ] });
2699
2714
  };
2700
- const verificationDisclaimer = "adyen-kyc-verification-disclaimer";
2701
- const styles$4 = {
2702
- verificationDisclaimer
2703
- };
2704
- const IdVerificationDisclaimer = () => {
2705
- const { i18n } = useI18nContext();
2706
- return /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "tertiary", className: styles$4.verificationDisclaimer, children: [
2707
- i18n.get("ifYouChooseToUseOnfido"),
2708
- " ",
2709
- /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: i18n.get("onfidoPrivacyPolicy") }),
2710
- " ",
2711
- i18n.get("and"),
2712
- " ",
2713
- /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true, children: i18n.get("onfidoTermsOfService") })
2714
- ] });
2715
- };
2716
- const verificationHeader = "adyen-kyc-verification-header";
2717
2715
  const verificationHeaderImage = "adyen-kyc-verification-header-image";
2718
- const verificationHeaderContent = "adyen-kyc-verification-header-content";
2719
- const styles$3 = {
2720
- verificationHeader,
2721
- verificationHeaderImage,
2722
- verificationHeaderContent
2723
- };
2724
- const IdVerificationHeader = () => {
2725
- const { i18n } = useI18nContext();
2726
- return /* @__PURE__ */ jsxs("div", { className: styles$3.verificationHeader, children: [
2727
- /* @__PURE__ */ jsx(
2728
- Svg,
2729
- {
2730
- className: styles$3.verificationHeaderImage,
2731
- type: "image",
2732
- name: "passport-front-green",
2733
- title: i18n.get("instantIDVerificationDescription")
2734
- }
2735
- ),
2736
- /* @__PURE__ */ jsx(Typography, { variant: "title-l", children: i18n.get("capturePersonalDetails") }),
2737
- /* @__PURE__ */ jsxs(Typography, { variant: "body", color: "primary", className: styles$3.verificationHeaderContent, children: [
2738
- i18n.get("takeOrUploadAPhoto"),
2739
- " ",
2740
- /* @__PURE__ */ jsx(Link, { href: "https://onfido.com", external: true, inline: true, children: i18n.get("onfido") })
2741
- ] })
2742
- ] });
2743
- };
2744
- const verifyOnfidoContainer = "adyen-kyc-verify-onfido-container";
2745
2716
  const verifyOnfidoError = "adyen-kyc-verify-onfido-error";
2746
- const verifyOnfidoContent = "adyen-kyc-verify-onfido-content";
2747
- const styles$2 = {
2748
- verifyOnfidoContainer,
2749
- verifyOnfidoError,
2750
- verifyOnfidoContent
2717
+ const styles$1 = {
2718
+ verificationHeaderImage,
2719
+ verifyOnfidoError
2751
2720
  };
2752
2721
  const toIndividualOnfidoConflictSchema = ({
2753
2722
  basicDetails,
@@ -2755,13 +2724,13 @@ const toIndividualOnfidoConflictSchema = ({
2755
2724
  }) => {
2756
2725
  return {
2757
2726
  // from basicDetails
2758
- firstName: basicDetails == null ? void 0 : basicDetails.firstName,
2759
- lastName: basicDetails == null ? void 0 : basicDetails.lastName,
2760
- email: basicDetails == null ? void 0 : basicDetails.email,
2761
- phoneNumber: basicDetails == null ? void 0 : basicDetails.phoneNumber,
2727
+ firstName: basicDetails?.firstName,
2728
+ lastName: basicDetails?.lastName,
2729
+ email: basicDetails?.email,
2730
+ phoneNumber: basicDetails?.phoneNumber,
2762
2731
  // from additionalPersonalDetails
2763
- birthDate: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.birthDate,
2764
- nationality: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.nationality,
2732
+ birthDate: additionalPersonalDetails?.birthDate,
2733
+ nationality: additionalPersonalDetails?.nationality,
2765
2734
  address: pick(
2766
2735
  "address",
2767
2736
  "otherAddressInformation",
@@ -2771,11 +2740,11 @@ const toIndividualOnfidoConflictSchema = ({
2771
2740
  "country"
2772
2741
  ).from(additionalPersonalDetails),
2773
2742
  // from additionalPersonalDetails (flattened so that `id` fields can be compared at granular level)
2774
- idNumber: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.idNumber,
2775
- typeOfIdentity: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.typeOfIdentity,
2776
- issuerState: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.issuerState,
2777
- licenseCardNumber: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.licenseCardNumber,
2778
- expiryDate: additionalPersonalDetails == null ? void 0 : additionalPersonalDetails.expiryDate
2743
+ idNumber: additionalPersonalDetails?.idNumber,
2744
+ typeOfIdentity: additionalPersonalDetails?.typeOfIdentity,
2745
+ issuerState: additionalPersonalDetails?.issuerState,
2746
+ licenseCardNumber: additionalPersonalDetails?.licenseCardNumber,
2747
+ expiryDate: additionalPersonalDetails?.expiryDate
2779
2748
  };
2780
2749
  };
2781
2750
  const fromIndividualOnfidoConflictSchema = ({
@@ -2890,12 +2859,12 @@ const OnfidoVerificationModal = ({
2890
2859
  ) });
2891
2860
  };
2892
2861
  const uploadedDocument = "adyen-kyc-uploaded-document";
2893
- const styles$1 = {
2862
+ const styles = {
2894
2863
  uploadedDocument
2895
2864
  };
2896
2865
  const UploadedDocument = ({ document, onDelete, onUpdate }) => {
2897
2866
  const { i18n } = useI18nContext();
2898
- return /* @__PURE__ */ jsxs("article", { className: styles$1.uploadedDocument, children: [
2867
+ return /* @__PURE__ */ jsxs("article", { className: styles.uploadedDocument, children: [
2899
2868
  /* @__PURE__ */ jsxs("div", { children: [
2900
2869
  /* @__PURE__ */ jsx(Typography, { el: "h4", variant: "title", children: i18n.get(document.idDocumentType) }),
2901
2870
  /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body", children: i18n.get("uploadedOn", {
@@ -2925,7 +2894,6 @@ const idVerificationMethodFields = [
2925
2894
  "idDocument"
2926
2895
  ];
2927
2896
  function IdVerificationMethod(props) {
2928
- var _a, _b, _c, _d, _e, _f;
2929
2897
  const {
2930
2898
  legalEntityId,
2931
2899
  handlers,
@@ -2933,14 +2901,14 @@ function IdVerificationMethod(props) {
2933
2901
  fieldValidationErrors,
2934
2902
  hasLiveSelfieErrorCode
2935
2903
  } = props;
2936
- const { i18n } = useI18nContext();
2904
+ const { t, i18n } = useTranslation(["individual", "common"]);
2937
2905
  const userEvents = useAnalyticsContext();
2938
2906
  const extractDocumentInformation2 = useExtractDocumentInformation();
2939
2907
  const {
2940
2908
  form: { data, handleChangeFor, setFormData }
2941
2909
  } = useFormContext();
2942
- const datasetUtils = datasetUtilities(i18n.locale);
2943
- const existingDocument = (_a = data.idVerificationMethod) == null ? void 0 : _a.idDocument;
2910
+ const datasetUtils = datasetUtilities(i18n.language);
2911
+ const existingDocument = data.idVerificationMethod?.idDocument;
2944
2912
  const hasExistingDocument = !isEmpty$1(existingDocument);
2945
2913
  const handleFieldChange = useCallback(
2946
2914
  (fieldName, mode = "input") => handleChangeFor(fieldName, "idVerificationMethod", mode),
@@ -2977,19 +2945,18 @@ function IdVerificationMethod(props) {
2977
2945
  handlers.handleContinueToAdditionalDetails();
2978
2946
  };
2979
2947
  const validateExtractionResult = (extractionResult) => {
2980
- var _a2;
2981
- const { isExpired, isValidDocumentType, dateOfBirth, issuingCountry } = extractionResult;
2948
+ const { isExpired, isValidDocumentType, isUnderage, minimumOnboardingAge } = extractionResult;
2982
2949
  if (isExpired) {
2983
2950
  return { key: "theDocumentYouUploadedIsExpired" };
2984
2951
  }
2985
- if (isValidDocumentType === false) {
2952
+ if (!isValidDocumentType) {
2986
2953
  return { key: "theDocumentTypeYouUploadedIsNotSupported" };
2987
2954
  }
2988
- if (isPersonUnderAge(dateOfBirth, issuingCountry)) {
2955
+ if (isUnderage) {
2989
2956
  return {
2990
2957
  key: "weDontAcceptDocumentsOrInformationAboutAnyoneYoungerThan_",
2991
2958
  options: {
2992
- values: { minimumOnboardingAge: ((_a2 = extractionResult.minimumOnboardingAge) == null ? void 0 : _a2.toString()) ?? "" }
2959
+ values: { minimumOnboardingAge: minimumOnboardingAge?.toString() ?? "" }
2993
2960
  }
2994
2961
  };
2995
2962
  }
@@ -3002,9 +2969,9 @@ function IdVerificationMethod(props) {
3002
2969
  onAutoResolve
3003
2970
  );
3004
2971
  const minimumApplicantDetails = {
3005
- firstName: (_b = data.basicDetails) == null ? void 0 : _b.firstName,
3006
- lastName: (_c = data.basicDetails) == null ? void 0 : _c.lastName,
3007
- residencyCountry: (_d = data.additionalPersonalDetails) == null ? void 0 : _d.country
2972
+ firstName: data.basicDetails?.firstName,
2973
+ lastName: data.basicDetails?.lastName,
2974
+ residencyCountry: data.additionalPersonalDetails?.country
3008
2975
  };
3009
2976
  const launchOnfido = () => {
3010
2977
  clearError();
@@ -3041,11 +3008,25 @@ function IdVerificationMethod(props) {
3041
3008
  });
3042
3009
  setStatus("ready");
3043
3010
  } catch (err) {
3044
- handleOnfidoError(err);
3011
+ handleOnfidoExtractionError(err);
3012
+ handleFieldChange("idDocument")({
3013
+ instantIdVerificationData: onfidoResult,
3014
+ idDocumentType: onfidoResult.document_front.type,
3015
+ modificationDate: (/* @__PURE__ */ new Date()).toISOString()
3016
+ });
3045
3017
  } finally {
3046
3018
  setShowLoadingSpinner(false);
3047
3019
  }
3048
3020
  };
3021
+ const handleOnfidoExtractionError = (error2) => {
3022
+ logger$2.error("Onfido extraction error", error2);
3023
+ userEvents.addPageEvent("Encountered error", {
3024
+ actionType: "submit",
3025
+ returnType: "onfido",
3026
+ returnValue: "weCouldNotExtractDocumentInformation"
3027
+ });
3028
+ setStatus("ready");
3029
+ };
3049
3030
  const handleOnfidoError = (error2) => {
3050
3031
  logger$2.error("Onfido error", error2);
3051
3032
  setError({ key: "weCouldNotReachOnfido" });
@@ -3088,7 +3069,7 @@ function IdVerificationMethod(props) {
3088
3069
  handleFieldChange("idDocument")(void 0);
3089
3070
  }
3090
3071
  };
3091
- if (hasLiveSelfieErrorCode && ((_e = data.idVerificationMethod) == null ? void 0 : _e.idVerificationMethod) === "existingDocument") {
3072
+ if (hasLiveSelfieErrorCode && data.idVerificationMethod?.idVerificationMethod === "existingDocument") {
3092
3073
  handleDeleteDocument();
3093
3074
  }
3094
3075
  const handleCancelDeleteDocument = () => {
@@ -3114,8 +3095,9 @@ function IdVerificationMethod(props) {
3114
3095
  handlers.handleUpdateDocument();
3115
3096
  };
3116
3097
  const modalProvidedData = resolvedData || comparableExistingData;
3117
- const formUtils = createFormUtils(props, i18n);
3118
- return /* @__PURE__ */ jsxs("div", { className: styles$2.verifyOnfidoContainer, children: [
3098
+ const formUtils = createFormUtils(props, i18n.t);
3099
+ isNextStepDisabled.value = showLoadingSpinner;
3100
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3119
3101
  /* @__PURE__ */ jsx(
3120
3102
  ErrorPanel,
3121
3103
  {
@@ -3125,44 +3107,78 @@ function IdVerificationMethod(props) {
3125
3107
  id: "ariaErrorField"
3126
3108
  }
3127
3109
  ),
3128
- /* @__PURE__ */ jsx(IdVerificationHeader, {}),
3129
- error ? /* @__PURE__ */ jsx(
3130
- Alert,
3131
- {
3132
- variant: "error",
3133
- title: i18n.get(error.key, error.options),
3134
- className: styles$2.verifyOnfidoError
3135
- }
3136
- ) : void 0,
3137
- /* @__PURE__ */ jsx("div", { className: styles$2.verifyOnfidoContent, children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : /* @__PURE__ */ jsx(Fragment, { children: hasExistingDocument ? /* @__PURE__ */ jsx(
3138
- UploadedDocument,
3110
+ /* @__PURE__ */ jsx(
3111
+ LandingLayout,
3139
3112
  {
3140
- document: existingDocument,
3141
- onDelete: () => setStatus("confirmDeleteDocumentModal"),
3142
- onUpdate: handleUpdateExistingDocument
3113
+ media: /* @__PURE__ */ jsx(
3114
+ Svg,
3115
+ {
3116
+ type: "image",
3117
+ className: styles$1.verificationHeaderImage,
3118
+ name: "passport-front-green",
3119
+ title: t(($) => $["instantIDVerificationDescription"], { ns: "common" })
3120
+ }
3121
+ ),
3122
+ title: t(($) => $["identityVerification"], { ns: "common" }),
3123
+ description: showIndividualMotionCapture?.value ? t(($) => $["toHelpProtectAgainstFraudAndKeepOurServices"]) : /* @__PURE__ */ jsxs(Fragment, { children: [
3124
+ t(($) => $["takeOrUploadAPhoto"], { ns: "common" }),
3125
+ " ",
3126
+ /* @__PURE__ */ jsx(Link, { href: "https://onfido.com", external: true, inline: true, children: t(($) => $["onfido"], { ns: "common" }) })
3127
+ ] }),
3128
+ helpAction: error ? /* @__PURE__ */ jsx(
3129
+ Alert,
3130
+ {
3131
+ variant: "error",
3132
+ title: t(($) => $[error.key], { ...error.options?.values, ns: "common" }),
3133
+ className: styles$1.verifyOnfidoError
3134
+ }
3135
+ ) : void 0,
3136
+ actions: /* @__PURE__ */ jsx(Fragment, { children: showLoadingSpinner ? /* @__PURE__ */ jsx(Loader, { size: "large" }) : !hasExistingDocument && /* @__PURE__ */ jsxs(Fragment, { children: [
3137
+ /* @__PURE__ */ jsx(
3138
+ Button,
3139
+ {
3140
+ fullWidth: true,
3141
+ onClick: launchOnfido,
3142
+ disabled: status === "extractionLoading",
3143
+ loading: status === "extractionLoading",
3144
+ children: t(($) => $["startVerification"], { ns: "common" })
3145
+ }
3146
+ ),
3147
+ !showIndividualMotionCapture?.value && /* @__PURE__ */ jsx(
3148
+ Button,
3149
+ {
3150
+ onClick: () => setStatus("confirmManualFlowModal"),
3151
+ variant: "secondary",
3152
+ fullWidth: true,
3153
+ children: t(($) => $["addDetailsManually"], { ns: "common" })
3154
+ }
3155
+ )
3156
+ ] }) }),
3157
+ content: !showLoadingSpinner && hasExistingDocument && /* @__PURE__ */ jsx(
3158
+ UploadedDocument,
3159
+ {
3160
+ document: existingDocument,
3161
+ onDelete: () => setStatus("confirmDeleteDocumentModal"),
3162
+ onUpdate: handleUpdateExistingDocument
3163
+ }
3164
+ ),
3165
+ disclaimer: (
3166
+ // TODO - replace with Trans component
3167
+ !hasExistingDocument && /* @__PURE__ */ jsxs(Fragment, { children: [
3168
+ t(($) => $["byContinuingToUseThisService"]),
3169
+ " ",
3170
+ /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/facial-scan-policy-and-release/", external: true, inline: true, children: t(($) => $["onfidoFacialScanPolicy"]) }),
3171
+ " ",
3172
+ /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/privacy/", external: true, inline: true, children: t(($) => $["privacyPolicy"], { ns: "common" }) }),
3173
+ " ",
3174
+ t(($) => $["and"], { ns: "common" }),
3175
+ " ",
3176
+ /* @__PURE__ */ jsx(Link, { href: "https://onfido.com/terms-of-service/", external: true, inline: true, children: t(($) => $["termsOfService"], { ns: "common" }) }),
3177
+ "."
3178
+ ] })
3179
+ )
3143
3180
  }
3144
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
3145
- /* @__PURE__ */ jsx(
3146
- ProviderButton,
3147
- {
3148
- provider: "onfido",
3149
- fullWidth: true,
3150
- disabled: status === "extractionLoading",
3151
- loading: status === "extractionLoading",
3152
- onClick: launchOnfido
3153
- }
3154
- ),
3155
- !((_f = showIndividualMotionCapture) == null ? void 0 : _f.value) && /* @__PURE__ */ jsx(
3156
- Button,
3157
- {
3158
- onClick: () => setStatus("confirmManualFlowModal"),
3159
- variant: "secondary",
3160
- fullWidth: true,
3161
- children: i18n.get("addDetailsManually")
3162
- }
3163
- ),
3164
- /* @__PURE__ */ jsx(IdVerificationDisclaimer, {})
3165
- ] }) }) }),
3181
+ ),
3166
3182
  status === "onfidoModal" && /* @__PURE__ */ jsx(
3167
3183
  OnfidoVerificationModal,
3168
3184
  {
@@ -3176,19 +3192,19 @@ function IdVerificationMethod(props) {
3176
3192
  status === "confirmManualFlowModal" && /* @__PURE__ */ jsx(
3177
3193
  Confirm,
3178
3194
  {
3179
- title: i18n.get("addDetailsManuallyQuestion"),
3180
- description: i18n.get("itCanTakeUpTo"),
3195
+ title: t(($) => $["addDetailsManuallyQuestion"]),
3196
+ description: t(($) => $["itCanTakeUpTo"]),
3181
3197
  onCancel: handleCancelAddDetailsManually,
3182
- confirmText: i18n.get("yesAddManually"),
3198
+ confirmText: t(($) => $["yesAddManually"]),
3183
3199
  onConfirm: handleContinueViaManualEntryFlow
3184
3200
  }
3185
3201
  ),
3186
3202
  status === "confirmDeleteDocumentModal" && /* @__PURE__ */ jsx(
3187
3203
  Confirm,
3188
3204
  {
3189
- title: i18n.get("deleteIdDocument"),
3190
- description: i18n.get("youMayBeAskedToReUpload"),
3191
- confirmText: i18n.get("deleteDocument"),
3205
+ title: t(($) => $["deleteIdDocument"]),
3206
+ description: t(($) => $["youMayBeAskedToReUpload"]),
3207
+ confirmText: t(($) => $["deleteDocument"], { ns: "common" }),
3192
3208
  onCancel: handleCancelDeleteDocument,
3193
3209
  onConfirm: handleDeleteDocument,
3194
3210
  critical: true
@@ -3216,13 +3232,12 @@ function IdVerificationMethod(props) {
3216
3232
  ] });
3217
3233
  }
3218
3234
  const ManualIdUpload = () => {
3219
- var _a, _b;
3220
3235
  const { form } = useFormContext();
3221
3236
  const { handleChangeFor } = form;
3222
3237
  const data = form.data.manualIdUpload;
3223
3238
  const valid = form.valid.manualIdUpload;
3224
3239
  const errors = form.errors.manualIdUpload;
3225
- const name = `${(_a = form.data.basicDetails) == null ? void 0 : _a.firstName} ${(_b = form.data.basicDetails) == null ? void 0 : _b.lastName}`;
3240
+ const name = `${form.data.basicDetails?.firstName} ${form.data.basicDetails?.lastName}`;
3226
3241
  const handleFieldChange = (fieldName, mode) => handleChangeFor(fieldName, "manualIdUpload", mode);
3227
3242
  return /* @__PURE__ */ jsx(
3228
3243
  IdDocumentManualUpload,
@@ -3235,54 +3250,8 @@ const ManualIdUpload = () => {
3235
3250
  }
3236
3251
  );
3237
3252
  };
3238
- const getDisplayErrorMessage = (errorMessage, i18n) => {
3239
- return typeof errorMessage !== "boolean" ? i18n.get(errorMessage) : errorMessage;
3240
- };
3241
- const guidanceQuestion = "adyen-kyc-guidance-question";
3242
- const options = "adyen-kyc-options";
3243
- const styles = {
3244
- guidanceQuestion,
3245
- options
3246
- };
3247
- const GuidanceQuestion = (props) => {
3248
- const {
3249
- descriptionLinkText,
3250
- errorMessage,
3251
- name,
3252
- noLabel,
3253
- onChange,
3254
- onDescriptionLinkClick,
3255
- question,
3256
- value,
3257
- yesLabel
3258
- } = props;
3259
- const { i18n } = useI18nContext();
3260
- const handleChange = (selectedValue) => {
3261
- const newValue = selectedValue || null;
3262
- onChange(newValue);
3263
- };
3264
- const yesTileLabel = yesLabel ?? i18n.get("yes");
3265
- const noTileLabel = noLabel ?? i18n.get("no");
3266
- return /* @__PURE__ */ jsxs("div", { className: styles.guidanceQuestion, children: [
3267
- /* @__PURE__ */ jsx(Typography, { variant: "body", el: "p", children: question }),
3268
- descriptionLinkText && onDescriptionLinkClick && /* @__PURE__ */ jsx(Button, { variant: "link", onClick: onDescriptionLinkClick, children: descriptionLinkText }),
3269
- /* @__PURE__ */ jsx(Field, { name, className: styles.options, children: () => /* @__PURE__ */ jsx(
3270
- TileGroup,
3271
- {
3272
- allowMultiple: false,
3273
- errorMessage,
3274
- isHorizontal: true,
3275
- maxSelected: 1,
3276
- name,
3277
- onChange: handleChange,
3278
- selected: value || "",
3279
- tiles: [
3280
- { label: yesTileLabel, value: "yes" },
3281
- { label: noTileLabel, value: "no" }
3282
- ]
3283
- }
3284
- ) })
3285
- ] });
3253
+ const getDisplayErrorMessage = (errorMessage, t) => {
3254
+ return typeof errorMessage !== "boolean" ? translateStringOrObject(t, errorMessage) : errorMessage;
3286
3255
  };
3287
3256
  const SignatoryQuestionnaireModalContent = () => {
3288
3257
  const { i18n } = useI18nContext();
@@ -3295,7 +3264,8 @@ const SignatoryQuestionnaireModalContent = () => {
3295
3264
  ] });
3296
3265
  };
3297
3266
  function SignatoryQuestionnaire(props) {
3298
- const { i18n } = useI18nContext();
3267
+ const { t } = useTranslation(["common", "individual"]);
3268
+ const userEvents = useAnalyticsContext();
3299
3269
  const [isModalOpen, setIsModalOpen] = useState(false);
3300
3270
  const {
3301
3271
  data,
@@ -3305,12 +3275,23 @@ function SignatoryQuestionnaire(props) {
3305
3275
  fieldValidationErrors,
3306
3276
  handleFieldChange
3307
3277
  } = props;
3308
- const formUtils = createFormUtils(props, i18n);
3278
+ const formUtils = createFormUtils(props, t);
3309
3279
  if (!handleFieldChange) {
3310
3280
  return;
3311
3281
  }
3312
- const toggleModal = () => {
3313
- setIsModalOpen(!isModalOpen);
3282
+ const openModal = () => {
3283
+ userEvents.addPageEvent("Opened modal", {
3284
+ actionType: "open",
3285
+ label: "isSignatoryModal"
3286
+ });
3287
+ setIsModalOpen(true);
3288
+ };
3289
+ const closeModal = () => {
3290
+ userEvents.addPageEvent("Closed modal", {
3291
+ actionType: "close",
3292
+ label: "isSignatoryModal"
3293
+ });
3294
+ setIsModalOpen(false);
3314
3295
  };
3315
3296
  const errorMessage = formUtils.getErrorMessage("isSignatory", errors, fieldValidationErrors);
3316
3297
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__personal-details", "aria-describedby": "ariaErrorField", children: [
@@ -3328,25 +3309,19 @@ function SignatoryQuestionnaire(props) {
3328
3309
  GuidanceQuestion,
3329
3310
  {
3330
3311
  name: "isSignatory",
3331
- value: data == null ? void 0 : data.isSignatory,
3312
+ value: data?.isSignatory,
3332
3313
  onChange: handleFieldChange("isSignatory"),
3333
- onDescriptionLinkClick: toggleModal,
3334
- question: i18n.get("signatoryQuestion"),
3335
- descriptionLinkText: i18n.get("whatDoesThisMean"),
3336
- errorMessage: getDisplayErrorMessage(errorMessage, i18n)
3314
+ onDescriptionLinkClick: openModal,
3315
+ question: t(($) => $["doesThisPersonHaveTheAuthority"], { ns: "individual" }),
3316
+ descriptionLinkText: t(($) => $["whatDoesThisMean"]),
3317
+ errorMessage: getDisplayErrorMessage(errorMessage, t)
3337
3318
  }
3338
3319
  ),
3339
- isModalOpen && /* @__PURE__ */ jsx(Modal, { onClose: toggleModal, ariaLabel: i18n.get("moreAboutAuthorizedSignatories"), inset: true, children: /* @__PURE__ */ jsx(SignatoryQuestionnaireModalContent, {}) })
3320
+ isModalOpen && /* @__PURE__ */ jsx(Modal, { onClose: closeModal, ariaLabel: t(($) => $["moreAboutAuthorizedSignatories"]), inset: true, children: /* @__PURE__ */ jsx(SignatoryQuestionnaireModalContent, {}) })
3340
3321
  ] });
3341
3322
  }
3342
- const RichText = ({ content }) => {
3343
- if (!content) {
3344
- return null;
3345
- }
3346
- const parts = content.split(/<strong>|<\/strong>/);
3347
- return /* @__PURE__ */ jsx(Fragment, { children: parts.map((part, index) => index % 2 === 1 ? /* @__PURE__ */ jsx("strong", { children: part }, index) : part) });
3348
- };
3349
3323
  const UboQuestionnaireModalContent = ({ modalType }) => {
3324
+ const { t } = useTranslation();
3350
3325
  const { i18n } = useI18nContext();
3351
3326
  switch (modalType) {
3352
3327
  case "isOwner":
@@ -3378,10 +3353,10 @@ const UboQuestionnaireModalContent = ({ modalType }) => {
3378
3353
  /* @__PURE__ */ jsx(Typography, { variant: "body-strongest", el: "h4", className: "adyen-kyc-u-margin-bottom-12", children: i18n.get("controllingPersonDescriptionQ1") }),
3379
3354
  /* @__PURE__ */ jsx(Typography, { el: "p", className: "adyen-kyc-u-margin-bottom-32", children: i18n.get("controllingPersonDescriptionA1P1") }),
3380
3355
  /* @__PURE__ */ jsxs("ul", { children: [
3381
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RichText, { content: i18n.get("controllingPersonDescriptionA1L1") }) }),
3382
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RichText, { content: i18n.get("controllingPersonDescriptionA1L2") }) }),
3383
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RichText, { content: i18n.get("controllingPersonDescriptionA1L3") }) }),
3384
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(RichText, { content: i18n.get("controllingPersonDescriptionA1L4") }) })
3356
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L1"] }) }),
3357
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L2"] }) }),
3358
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L3"] }) }),
3359
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: ($) => $["controllingPersonDescriptionA1L4"] }) })
3385
3360
  ] }),
3386
3361
  /* @__PURE__ */ jsx(
3387
3362
  Alert,
@@ -3417,7 +3392,8 @@ const uboQuestionnaireFields = [
3417
3392
  "isNomineeShareholder"
3418
3393
  ];
3419
3394
  function UboQuestionnaire(props) {
3420
- const { i18n } = useI18nContext();
3395
+ const { t } = useTranslation(["common", "individual"]);
3396
+ const userEvents = useAnalyticsContext();
3421
3397
  const {
3422
3398
  data,
3423
3399
  description,
@@ -3427,21 +3403,31 @@ function UboQuestionnaire(props) {
3427
3403
  fieldValidationErrors,
3428
3404
  handleFieldChange
3429
3405
  } = props;
3430
- const formUtils = createFormUtils(props, i18n);
3406
+ const formUtils = createFormUtils(props, t);
3431
3407
  const [activeModal, setActiveModal] = useState(null);
3432
3408
  if (!handleFieldChange) {
3433
3409
  return;
3434
3410
  }
3435
3411
  const openModal = (modalType) => () => {
3412
+ userEvents.addPageEvent("Opened modal", {
3413
+ actionType: "open",
3414
+ label: `${modalType}Modal`
3415
+ });
3436
3416
  setActiveModal(modalType);
3437
3417
  };
3438
3418
  const closeModal = () => {
3419
+ if (activeModal) {
3420
+ userEvents.addPageEvent("Closed modal", {
3421
+ actionType: "close",
3422
+ label: `${activeModal}Modal`
3423
+ });
3424
+ }
3439
3425
  setActiveModal(null);
3440
3426
  };
3441
3427
  const modalAriaLabelMap = {
3442
- isOwner: i18n.get("moreAboutOwners"),
3443
- isControllingPerson: i18n.get("moreAboutOwnershipThroughControl"),
3444
- isDirector: i18n.get("moreAboutDirectors")
3428
+ isOwner: t(($) => $["moreAboutOwners"]),
3429
+ isControllingPerson: t(($) => $["moreAboutOwnershipThroughControl"]),
3430
+ isDirector: t(($) => $["moreAboutDirectors"])
3445
3431
  };
3446
3432
  const isDirectorErrorMessage = formUtils.getErrorMessage(
3447
3433
  "isDirector",
@@ -3479,56 +3465,60 @@ function UboQuestionnaire(props) {
3479
3465
  GuidanceQuestion,
3480
3466
  {
3481
3467
  name: "isDirector",
3482
- value: data == null ? void 0 : data.isDirector,
3468
+ value: data?.isDirector,
3483
3469
  onChange: handleFieldChange("isDirector"),
3484
3470
  onDescriptionLinkClick: openModal("isDirector"),
3485
- question: i18n.get("directorQuestion"),
3486
- descriptionLinkText: i18n.get("whatDoesThisMean"),
3487
- errorMessage: getDisplayErrorMessage(isDirectorErrorMessage, i18n)
3471
+ question: t(($) => $["isThisPersonListedAsADirector"], { ns: "individual" }),
3472
+ descriptionLinkText: t(($) => $["whatDoesThisMean"]),
3473
+ errorMessage: getDisplayErrorMessage(isDirectorErrorMessage, t)
3488
3474
  }
3489
3475
  ),
3490
- formUtils.isRequiredField("isNomineeDirector") && (data == null ? void 0 : data.isDirector) === "yes" && /* @__PURE__ */ jsx(
3476
+ formUtils.isRequiredField("isNomineeDirector") && data?.isDirector === GuidanceQuestionValues.YES && /* @__PURE__ */ jsx(
3491
3477
  GuidanceQuestion,
3492
3478
  {
3493
3479
  name: "isNomineeDirector",
3494
- value: data == null ? void 0 : data.isNomineeDirector,
3480
+ value: data?.isNomineeDirector,
3495
3481
  onChange: handleFieldChange("isNomineeDirector"),
3496
- question: i18n.get("nomineeDirectorQuestion"),
3497
- errorMessage: getDisplayErrorMessage(isNomineeDirectorErrorMessage, i18n)
3482
+ question: t(($) => $["isThisPersonANomineeDirectorAppointed"], { ns: "individual" }),
3483
+ errorMessage: getDisplayErrorMessage(isNomineeDirectorErrorMessage, t)
3498
3484
  }
3499
3485
  ),
3500
3486
  formUtils.isRequiredField("isOwner") && /* @__PURE__ */ jsx(
3501
3487
  GuidanceQuestion,
3502
3488
  {
3503
3489
  name: "isOwner",
3504
- value: data == null ? void 0 : data.isOwner,
3490
+ value: data?.isOwner,
3505
3491
  onChange: handleFieldChange("isOwner"),
3506
3492
  onDescriptionLinkClick: openModal("isOwner"),
3507
- question: i18n.get("ownerQuestion"),
3508
- descriptionLinkText: i18n.get("whatDoesThisMean"),
3509
- errorMessage: getDisplayErrorMessage(isOwnerErrorMessage, i18n)
3493
+ question: t(($) => $["doesThisPersonOwn25PercentOrMoreOfBusiness"], { ns: "individual" }),
3494
+ descriptionLinkText: t(($) => $["whatDoesThisMean"]),
3495
+ errorMessage: getDisplayErrorMessage(isOwnerErrorMessage, t)
3510
3496
  }
3511
3497
  ),
3512
- formUtils.isRequiredField("isNomineeShareholder") && (data == null ? void 0 : data.isOwner) === "yes" && /* @__PURE__ */ jsx(
3498
+ formUtils.isRequiredField("isNomineeShareholder") && data?.isOwner === GuidanceQuestionValues.YES && /* @__PURE__ */ jsx(
3513
3499
  GuidanceQuestion,
3514
3500
  {
3515
3501
  name: "isNomineeShareholder",
3516
- value: data == null ? void 0 : data.isNomineeShareholder,
3502
+ value: data?.isNomineeShareholder,
3517
3503
  onChange: handleFieldChange("isNomineeShareholder"),
3518
- question: i18n.get("nomineeShareHolderQuestion"),
3519
- errorMessage: getDisplayErrorMessage(isNomineeShareholderErrorMessage, i18n)
3504
+ question: t(($) => $["isThisPersonANomineeShareholderAppointedToHold"], {
3505
+ ns: "individual"
3506
+ }),
3507
+ errorMessage: getDisplayErrorMessage(isNomineeShareholderErrorMessage, t)
3520
3508
  }
3521
3509
  ),
3522
3510
  formUtils.isRequiredField("isControllingPerson") && /* @__PURE__ */ jsx(
3523
3511
  GuidanceQuestion,
3524
3512
  {
3525
3513
  name: "isControllingPerson",
3526
- value: data == null ? void 0 : data.isControllingPerson,
3514
+ value: data?.isControllingPerson,
3527
3515
  onChange: handleFieldChange("isControllingPerson"),
3528
3516
  onDescriptionLinkClick: openModal("isControllingPerson"),
3529
- question: i18n.get("controllingPersonQuestion"),
3530
- descriptionLinkText: i18n.get("whatDoesThisMean"),
3531
- errorMessage: getDisplayErrorMessage(isControllingPersonErrorMessage, i18n)
3517
+ question: t(($) => $["doesThisPersonHaveSignificantResponsibility"], {
3518
+ ns: "individual"
3519
+ }),
3520
+ descriptionLinkText: t(($) => $["whatDoesThisMean"]),
3521
+ errorMessage: getDisplayErrorMessage(isControllingPersonErrorMessage, t)
3532
3522
  }
3533
3523
  ),
3534
3524
  activeModal && /* @__PURE__ */ jsx(Modal, { onClose: closeModal, ariaLabel: modalAriaLabelMap[activeModal], inset: true, children: /* @__PURE__ */ jsx(UboQuestionnaireModalContent, { modalType: activeModal }) })
@@ -3593,14 +3583,15 @@ const proofOfNationalIdFormID = individualOnfidoForms.proofOfNationalId.formId;
3593
3583
  const proofOfRelationshipFormID = individualOnfidoForms.proofOfRelationship.formId;
3594
3584
  const LIVE_SELFIE_ERROR_CODE = "2_8210";
3595
3585
  function IndividualOnfido(props) {
3596
- var _a, _b, _c, _d, _e, _f;
3597
3586
  const { i18n } = useI18nContext();
3587
+ const userEvents = useAnalyticsContext();
3598
3588
  const {
3599
3589
  form: { errors, valid, fieldProblems: fieldValidationErrors, handleChangeFor, setFormData }
3600
3590
  } = useFormContext();
3601
3591
  const { setFormIndex } = useFormRouterContext();
3602
3592
  const { isExperimentEnabled } = useExperimentsContext();
3603
3593
  const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
3594
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
3604
3595
  const [isDecisionMakerNotRequiredModalOpen, setIsDecisionMakerNotRequiredModalOpen] = useState(false);
3605
3596
  const {
3606
3597
  activeForm: propActiveForm,
@@ -3625,31 +3616,42 @@ function IndividualOnfido(props) {
3625
3616
  const proofOfResidencyFormProps = getFormProps(props, proofOfResidencyFormID);
3626
3617
  const proofOfNationalIdFormProps = getFormProps(props, proofOfNationalIdFormID);
3627
3618
  const proofOfRelationshipFormProps = getFormProps(props, proofOfRelationshipFormID);
3628
- const countryOfResidence = ((_a = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a.country) ?? defaultCountry;
3619
+ const countryOfResidence = data?.additionalPersonalDetails?.country ?? defaultCountry;
3629
3620
  const handleNextForPersonNotRequired = () => {
3630
- var _a2;
3631
- if (!(data == null ? void 0 : data.signatoryQuestionnaire) && !(data == null ? void 0 : data.uboQuestionnaire)) return;
3621
+ if (!data?.signatoryQuestionnaire && !data?.uboQuestionnaire) return;
3632
3622
  const { signatoryQuestionnaire, uboQuestionnaire } = data;
3633
- const isDirectorApplicable = (_a2 = uboQuestionnaireFormProps == null ? void 0 : uboQuestionnaireFormProps.requiredFields) == null ? void 0 : _a2.includes("isDirector");
3634
- 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");
3623
+ const isDirectorApplicable = uboQuestionnaireFormProps?.requiredFields?.includes("isDirector");
3624
+ const isNotRequired = signatoryQuestionnaire && uboQuestionnaire && signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.NO && uboQuestionnaire?.isOwner === GuidanceQuestionValues.NO && uboQuestionnaire?.isControllingPerson === GuidanceQuestionValues.NO && (!isDirectorApplicable || uboQuestionnaire?.isDirector === GuidanceQuestionValues.NO);
3635
3625
  if (isNotRequired) {
3626
+ userEvents.addPageEvent("Opened modal", {
3627
+ actionType: "open",
3628
+ label: "personalInfoNotNeeded"
3629
+ });
3636
3630
  setIsDecisionMakerNotRequiredModalOpen(true);
3637
3631
  } else {
3638
- onNext == null ? void 0 : onNext();
3632
+ onNext?.();
3639
3633
  }
3640
3634
  };
3641
3635
  useEffect(() => {
3642
3636
  if (propActiveForm.formId === uboQuestionnaireFormID) {
3643
- setNextHandler == null ? void 0 : setNextHandler(() => handleNextForPersonNotRequired);
3637
+ setNextHandler?.(() => handleNextForPersonNotRequired);
3644
3638
  } else {
3645
- setNextHandler == null ? void 0 : setNextHandler(void 0);
3639
+ setNextHandler?.(void 0);
3646
3640
  }
3647
3641
  }, [propActiveForm, setNextHandler, data]);
3648
3642
  const handleCloseModalAndGoBack = () => {
3643
+ userEvents.addPageEvent("Closed modal", {
3644
+ actionType: "close",
3645
+ label: "personalInfoNotNeeded"
3646
+ });
3649
3647
  setIsDecisionMakerNotRequiredModalOpen(false);
3650
- handleHomeClick == null ? void 0 : handleHomeClick();
3648
+ handleHomeClick?.();
3651
3649
  };
3652
3650
  const handleCloseModalAndChangeAnswers = () => {
3651
+ userEvents.addPageEvent("Clicked button", {
3652
+ actionType: "cancel",
3653
+ label: `personalInfoNotNeeded`
3654
+ });
3653
3655
  setIsDecisionMakerNotRequiredModalOpen(false);
3654
3656
  };
3655
3657
  const gotoFormByFormId = (formId) => {
@@ -3669,34 +3671,37 @@ function IndividualOnfido(props) {
3669
3671
  const capabilities = useCapabilities();
3670
3672
  const newRoles = useMemo(() => calculateRoles(data), [data]);
3671
3673
  useEffect(() => {
3672
- var _a2;
3673
- if (isGuidedDecisionMakersFlowEnabled) {
3674
- const currentRoles = ((_a2 = data == null ? void 0 : data.basicDetails) == null ? void 0 : _a2.role) ?? [];
3674
+ if (!isGuidedDecisionMakersFlowDisabled && isGuidedDecisionMakersFlowEnabled) {
3675
+ const currentRoles = data?.basicDetails?.role ?? [];
3675
3676
  if (areArraysDifferent(newRoles, currentRoles)) {
3676
- const basicDetailsData = (data == null ? void 0 : data.basicDetails) ?? {};
3677
+ const basicDetailsData = data?.basicDetails ?? {};
3677
3678
  setFormData("basicDetails", { ...basicDetailsData, role: newRoles });
3678
3679
  }
3679
3680
  }
3680
- }, [newRoles, data == null ? void 0 : data.basicDetails, setFormData, isGuidedDecisionMakersFlowEnabled]);
3681
- const hasMotionCaptureScenarioValue = (_b = hasMotionCaptureScenario) == null ? void 0 : _b.value;
3681
+ }, [
3682
+ newRoles,
3683
+ data?.basicDetails,
3684
+ setFormData,
3685
+ isGuidedDecisionMakersFlowDisabled,
3686
+ isGuidedDecisionMakersFlowEnabled
3687
+ ]);
3688
+ const hasMotionCaptureScenarioValue = hasMotionCaptureScenario?.value;
3682
3689
  useEffect(() => {
3683
- var _a2;
3684
3690
  setShowIndividualMotionCapture(
3685
3691
  shouldShowMotionCapture({
3686
3692
  capabilities,
3687
- userRoles: (_a2 = data == null ? void 0 : data.basicDetails) == null ? void 0 : _a2.role,
3693
+ userRoles: data?.basicDetails?.role,
3688
3694
  taskType,
3689
3695
  hasMotionScenario: hasMotionCaptureScenarioValue
3690
3696
  })
3691
3697
  );
3692
- }, [(_c = data == null ? void 0 : data.basicDetails) == null ? void 0 : _c.role, taskType, capabilities, hasMotionCaptureScenarioValue]);
3693
- 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}`;
3698
+ }, [data?.basicDetails?.role, taskType, capabilities, hasMotionCaptureScenarioValue]);
3699
+ const fullName = `${data?.basicDetails?.firstName} ${data?.basicDetails?.lastName}`;
3694
3700
  const handleFieldChange = (formName) => (fieldName, mode) => handleChangeFor(fieldName, formName, mode);
3695
- const hasLiveSelfieErrorCode = (_f = problems == null ? void 0 : problems.missingData) == null ? void 0 : _f.some(
3701
+ const hasLiveSelfieErrorCode = problems?.missingData?.some(
3696
3702
  (problem) => problem.code === LIVE_SELFIE_ERROR_CODE && problem.type === "dataMissing"
3697
3703
  );
3698
3704
  const renderActiveForm = (activeForm) => {
3699
- var _a2, _b2;
3700
3705
  switch (activeForm.formId) {
3701
3706
  case signatoryQuestionnaireFormID:
3702
3707
  return /* @__PURE__ */ jsx(
@@ -3706,8 +3711,8 @@ function IndividualOnfido(props) {
3706
3711
  heading: i18n.get("signatoryQuestionnaireHeader"),
3707
3712
  id: signatoryQuestionnaireFormID,
3708
3713
  handleFieldChange: handleFieldChange("signatoryQuestionnaire"),
3709
- errors: errors == null ? void 0 : errors.signatoryQuestionnaire,
3710
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.signatoryQuestionnaire
3714
+ errors: errors?.signatoryQuestionnaire,
3715
+ fieldValidationErrors: fieldValidationErrors?.signatoryQuestionnaire
3711
3716
  }
3712
3717
  );
3713
3718
  case uboQuestionnaireFormID:
@@ -3719,8 +3724,8 @@ function IndividualOnfido(props) {
3719
3724
  description: i18n.get("uboQuestionnaireDescription"),
3720
3725
  id: uboQuestionnaireFormID,
3721
3726
  handleFieldChange: handleFieldChange("uboQuestionnaire"),
3722
- errors: errors == null ? void 0 : errors.uboQuestionnaire,
3723
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.uboQuestionnaire
3727
+ errors: errors?.uboQuestionnaire,
3728
+ fieldValidationErrors: fieldValidationErrors?.uboQuestionnaire
3724
3729
  }
3725
3730
  );
3726
3731
  case basicDetailsFormID:
@@ -3728,7 +3733,7 @@ function IndividualOnfido(props) {
3728
3733
  BasicDetails,
3729
3734
  {
3730
3735
  ...basicDetailsFormProps,
3731
- data: (data == null ? void 0 : data.basicDetails) ?? {},
3736
+ data: data?.basicDetails ?? {},
3732
3737
  heading: i18n.get("basicInformationFormName"),
3733
3738
  taskType,
3734
3739
  id: basicDetailsFormID,
@@ -3737,9 +3742,9 @@ function IndividualOnfido(props) {
3737
3742
  parentLegalEntity,
3738
3743
  trustedFieldsProvider,
3739
3744
  trustedRoles,
3740
- errors: errors == null ? void 0 : errors.basicDetails,
3741
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.basicDetails,
3742
- valid: valid == null ? void 0 : valid.basicDetails,
3745
+ errors: errors?.basicDetails,
3746
+ fieldValidationErrors: fieldValidationErrors?.basicDetails,
3747
+ valid: valid?.basicDetails,
3743
3748
  handleFieldChange: handleFieldChange("basicDetails")
3744
3749
  }
3745
3750
  );
@@ -3753,8 +3758,8 @@ function IndividualOnfido(props) {
3753
3758
  handleDeleteDocument,
3754
3759
  handleUpdateDocument
3755
3760
  },
3756
- formVerificationErrors: (_a2 = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _a2.idVerificationMethod,
3757
- fieldValidationErrors: (_b2 = problems == null ? void 0 : problems.validationErrors) == null ? void 0 : _b2.idVerificationMethod,
3761
+ formVerificationErrors: problems?.verificationErrors?.idVerificationMethod,
3762
+ fieldValidationErrors: problems?.validationErrors?.idVerificationMethod,
3758
3763
  hasLiveSelfieErrorCode
3759
3764
  }
3760
3765
  );
@@ -3764,12 +3769,12 @@ function IndividualOnfido(props) {
3764
3769
  {
3765
3770
  ...additionalPersonalDetailsFormProps,
3766
3771
  country: countryOfResidence,
3767
- data: (data == null ? void 0 : data.additionalPersonalDetails) ?? {},
3772
+ data: data?.additionalPersonalDetails ?? {},
3768
3773
  heading: i18n.get("additionalPersonalDetails"),
3769
3774
  id: additionalPersonalDetailsFormID,
3770
- errors: errors == null ? void 0 : errors.additionalPersonalDetails,
3771
- fieldValidationErrors: fieldValidationErrors == null ? void 0 : fieldValidationErrors.additionalPersonalDetails,
3772
- valid: valid == null ? void 0 : valid.additionalPersonalDetails,
3775
+ errors: errors?.additionalPersonalDetails,
3776
+ fieldValidationErrors: fieldValidationErrors?.additionalPersonalDetails,
3777
+ valid: valid?.additionalPersonalDetails,
3773
3778
  taskType,
3774
3779
  handleFieldChange: handleFieldChange("additionalPersonalDetails")
3775
3780
  }
@@ -3781,7 +3786,7 @@ function IndividualOnfido(props) {
3781
3786
  MemoizedProofOfResidencyUpload,
3782
3787
  {
3783
3788
  ...proofOfResidencyFormProps,
3784
- data: data == null ? void 0 : data.proofOfResidency,
3789
+ data: data?.proofOfResidency,
3785
3790
  id: proofOfResidencyFormID,
3786
3791
  name: fullName,
3787
3792
  errors: errors.proofOfResidency,
@@ -3795,7 +3800,7 @@ function IndividualOnfido(props) {
3795
3800
  MemoizedDocumentUpload,
3796
3801
  {
3797
3802
  ...proofOfNationalIdFormProps,
3798
- data: data == null ? void 0 : data.proofOfNationalId,
3803
+ data: data?.proofOfNationalId,
3799
3804
  documentField: "proofOfNationalId",
3800
3805
  documentType: "registrationDocument",
3801
3806
  heading: i18n.get("proofOfNationalId"),
@@ -3811,7 +3816,7 @@ function IndividualOnfido(props) {
3811
3816
  MemoizedProofOfRelationship,
3812
3817
  {
3813
3818
  ...proofOfRelationshipFormProps,
3814
- data: data == null ? void 0 : data.proofOfRelationship,
3819
+ data: data?.proofOfRelationship,
3815
3820
  id: proofOfRelationshipFormID,
3816
3821
  name: fullName,
3817
3822
  errors: errors.proofOfRelationship,
@@ -3839,23 +3844,67 @@ function IndividualOnfido(props) {
3839
3844
  )
3840
3845
  ] });
3841
3846
  }
3847
+ const getOnfidoIdentityTypeToApiIdentityTypeMap = (data) => {
3848
+ const { country } = data;
3849
+ switch (country) {
3850
+ case CountryCodes.HongKong:
3851
+ return {
3852
+ passport: "passport",
3853
+ driversLicense: "driversLicense",
3854
+ proofOfIdentityCard: "nationalIdNumber"
3855
+ };
3856
+ default:
3857
+ return {
3858
+ nationalIdNumber: "nationalIdNumber",
3859
+ passport: "passport",
3860
+ driversLicense: "driversLicense",
3861
+ proofOfIdentityCard: "identityCard"
3862
+ };
3863
+ }
3864
+ };
3865
+ const adjustOnfidoIdentificationData = (data, apiData) => {
3866
+ const { typeOfIdentity, idNumber, idNumberExempt } = data;
3867
+ const identificationData = {
3868
+ ...apiData,
3869
+ number: idNumber,
3870
+ type: getOnfidoIdentityTypeToApiIdentityTypeMap(data)[typeOfIdentity] ?? "nationalIdNumber"
3871
+ };
3872
+ switch (typeOfIdentity) {
3873
+ case "passport":
3874
+ return {
3875
+ ...identificationData,
3876
+ cardNumber: ""
3877
+ };
3878
+ case "driversLicense":
3879
+ return {
3880
+ ...identificationData,
3881
+ expiryDate: ""
3882
+ };
3883
+ default:
3884
+ return idNumber === void 0 && idNumberExempt === void 0 ? void 0 : {
3885
+ ...identificationData,
3886
+ expiryDate: "",
3887
+ cardNumber: "",
3888
+ nationalIdExempt: apiData?.nationalIdExempt ?? !idNumber
3889
+ };
3890
+ }
3891
+ };
3842
3892
  const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEnabled, matchingScenario) => {
3843
- var _a, _b, _c, _d, _e;
3844
3893
  const legalEntity = {
3845
3894
  ...formatObject(individualOnfido, individualOnfidoApiKeyMapping),
3846
- type: LegalEntityType.INDIVIDUAL
3895
+ type: LegalEntityTypes.INDIVIDUAL
3847
3896
  };
3848
3897
  if (individualOnfido.additionalPersonalDetails) {
3849
- if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && (matchingScenario == null ? void 0 : matchingScenario.includes(Scenarios.L_TAXINFO)) && ((_a = individualOnfido.additionalPersonalDetails) == null ? void 0 : _a.idNumber) && ((_b = individualOnfido.additionalPersonalDetails) == null ? void 0 : _b.typeOfIdentity) && ((_c = individualOnfido.additionalPersonalDetails) == null ? void 0 : _c.country) === CountryCodes.Spain) {
3898
+ if (isExperimentEnabled("EnableTaxIdRequiredForBusinessAccountsScenarios") && matchingScenario?.includes(Scenarios.L_TAXINFO) && individualOnfido.additionalPersonalDetails?.idNumber && individualOnfido.additionalPersonalDetails?.typeOfIdentity && individualOnfido.additionalPersonalDetails?.country === CountryCodes.Spain) {
3850
3899
  legalEntity.individual.taxInformation = [
3851
3900
  {
3852
3901
  country: individualOnfido.additionalPersonalDetails.country,
3853
3902
  number: individualOnfido.additionalPersonalDetails.idNumber,
3854
- type: individualOnfido.additionalPersonalDetails.typeOfIdentity
3903
+ type: individualOnfido.additionalPersonalDetails.typeOfIdentity.toUpperCase()
3855
3904
  }
3856
3905
  ];
3857
3906
  }
3858
- legalEntity.individual.identificationData = adjustIdentificationData(
3907
+ legalEntity.individual.identificationData = adjustOnfidoIdentificationData(
3859
3908
  individualOnfido.additionalPersonalDetails,
3860
3909
  legalEntity.individual.identificationData
3861
3910
  );
@@ -3864,7 +3913,7 @@ const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEn
3864
3913
  if (localization.length) {
3865
3914
  legalEntity.individual.name.localization = localization;
3866
3915
  }
3867
- if ((_d = individualOnfido.basicDetails) == null ? void 0 : _d.phoneNumber) {
3916
+ if (individualOnfido.basicDetails?.phoneNumber) {
3868
3917
  const phone = {
3869
3918
  number: individualOnfido.basicDetails.phoneNumber.number,
3870
3919
  type: "mobile"
@@ -3872,7 +3921,7 @@ const mapIndividualOnfidoSchemaToLegalEntity = (individualOnfido, isExperimentEn
3872
3921
  if (phone.number && legalEntity.individual) {
3873
3922
  legalEntity.individual.phone = phone;
3874
3923
  } else {
3875
- (_e = legalEntity == null ? void 0 : legalEntity.individual) == null ? true : delete _e.phone;
3924
+ delete legalEntity?.individual?.phone;
3876
3925
  }
3877
3926
  }
3878
3927
  return legalEntity;
@@ -3881,14 +3930,13 @@ const getIndividualSchemaFromAPI = {
3881
3930
  ...individualOnfidoBaseMapping
3882
3931
  };
3883
3932
  const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isRoleFieldNeeded, parentLegalEntity) => {
3884
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3885
3933
  let individualOnfido = {
3886
3934
  ...formatObject(legalEntity, getIndividualSchemaFromAPI)
3887
3935
  };
3888
3936
  individualOnfido = {
3889
3937
  ...individualOnfido,
3890
3938
  basicDetails: {
3891
- ...individualOnfido == null ? void 0 : individualOnfido.basicDetails,
3939
+ ...individualOnfido?.basicDetails,
3892
3940
  ...isChangingType && {
3893
3941
  firstName: "",
3894
3942
  lastName: "",
@@ -3896,7 +3944,7 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3896
3944
  }
3897
3945
  },
3898
3946
  signatoryQuestionnaire: {
3899
- isSignatory: isChangingType ? null : ((_a = individualOnfido.signatoryQuestionnaire) == null ? void 0 : _a.isSignatory) ?? null
3947
+ isSignatory: isChangingType ? null : individualOnfido.signatoryQuestionnaire?.isSignatory ?? null
3900
3948
  },
3901
3949
  uboQuestionnaire: isChangingType ? {
3902
3950
  isOwner: null,
@@ -3905,14 +3953,14 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3905
3953
  isNomineeShareholder: null,
3906
3954
  isNomineeDirector: null
3907
3955
  } : {
3908
- isOwner: ((_b = individualOnfido.uboQuestionnaire) == null ? void 0 : _b.isOwner) ?? null,
3909
- isControllingPerson: ((_c = individualOnfido.uboQuestionnaire) == null ? void 0 : _c.isControllingPerson) ?? null,
3910
- isDirector: ((_d = individualOnfido.uboQuestionnaire) == null ? void 0 : _d.isDirector) ?? null,
3911
- isNomineeDirector: ((_e = individualOnfido.uboQuestionnaire) == null ? void 0 : _e.isNomineeDirector) ?? null,
3912
- isNomineeShareholder: ((_f = individualOnfido.uboQuestionnaire) == null ? void 0 : _f.isNomineeShareholder) ?? null
3956
+ isOwner: individualOnfido.uboQuestionnaire?.isOwner ?? null,
3957
+ isControllingPerson: individualOnfido.uboQuestionnaire?.isControllingPerson ?? null,
3958
+ isDirector: individualOnfido.uboQuestionnaire?.isDirector ?? null,
3959
+ isNomineeDirector: individualOnfido.uboQuestionnaire?.isNomineeDirector ?? null,
3960
+ isNomineeShareholder: individualOnfido.uboQuestionnaire?.isNomineeShareholder ?? null
3913
3961
  }
3914
3962
  };
3915
- if ((_g = legalEntity == null ? void 0 : legalEntity.documentDetails) == null ? void 0 : _g.length) {
3963
+ if (legalEntity?.documentDetails?.length) {
3916
3964
  individualOnfido = {
3917
3965
  ...individualOnfido,
3918
3966
  idVerificationMethod: {
@@ -3922,32 +3970,31 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3922
3970
  }
3923
3971
  };
3924
3972
  }
3925
- if ((_i = (_h = legalEntity.individual) == null ? void 0 : _h.name) == null ? void 0 : _i.localization) {
3973
+ if (legalEntity.individual?.identificationData?.type && individualOnfido.additionalPersonalDetails) {
3974
+ const apiIdentityTypeToIdentityTypeMap = reverseMapping(
3975
+ getOnfidoIdentityTypeToApiIdentityTypeMap(individualOnfido.additionalPersonalDetails)
3976
+ );
3977
+ individualOnfido.additionalPersonalDetails.typeOfIdentity = apiIdentityTypeToIdentityTypeMap[legalEntity.individual.identificationData.type];
3978
+ }
3979
+ if (legalEntity.individual?.name?.localization) {
3926
3980
  const configs = [
3927
3981
  {
3928
3982
  script: "ja-Hani",
3929
- mappingFunction: (l) => {
3930
- var _a2, _b2;
3931
- return {
3932
- jaHaniFirstName: (_a2 = l.fields) == null ? void 0 : _a2.firstName,
3933
- jaHaniLastName: (_b2 = l.fields) == null ? void 0 : _b2.lastName
3934
- };
3935
- }
3983
+ mappingFunction: (l) => ({
3984
+ jaHaniFirstName: l.fields?.firstName,
3985
+ jaHaniLastName: l.fields?.lastName
3986
+ })
3936
3987
  },
3937
3988
  {
3938
3989
  script: "ja-Kana",
3939
- mappingFunction: (l) => {
3940
- var _a2, _b2;
3941
- return {
3942
- jaKanaFirstName: (_a2 = l.fields) == null ? void 0 : _a2.firstName,
3943
- jaKanaLastName: (_b2 = l.fields) == null ? void 0 : _b2.lastName
3944
- };
3945
- }
3990
+ mappingFunction: (l) => ({
3991
+ jaKanaFirstName: l.fields?.firstName,
3992
+ jaKanaLastName: l.fields?.lastName
3993
+ })
3946
3994
  }
3947
3995
  ];
3948
3996
  configs.forEach((config) => {
3949
- var _a2, _b2;
3950
- const localizationToMap = (_b2 = (_a2 = legalEntity.individual) == null ? void 0 : _a2.name.localization) == null ? void 0 : _b2.find(
3997
+ const localizationToMap = legalEntity.individual?.name.localization?.find(
3951
3998
  (l) => l.script === config.script
3952
3999
  );
3953
4000
  if (localizationToMap) {
@@ -3958,33 +4005,33 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3958
4005
  }
3959
4006
  });
3960
4007
  }
3961
- if (!(parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations)) {
4008
+ if (!parentLegalEntity?.entityAssociations) {
3962
4009
  return individualOnfido;
3963
4010
  }
3964
- const associations = ((_j = parentLegalEntity == null ? void 0 : parentLegalEntity.entityAssociations) == null ? void 0 : _j.filter((ea) => ea.legalEntityId === (legalEntity == null ? void 0 : legalEntity.id))) ?? [];
4011
+ const associations = parentLegalEntity?.entityAssociations?.filter((ea) => ea.legalEntityId === legalEntity?.id) ?? [];
3965
4012
  if (isRoleFieldNeeded && individualOnfido.basicDetails) {
3966
4013
  individualOnfido.basicDetails.role = associations.map((ea) => ea.type);
3967
- individualOnfido.basicDetails.jobTitle = (_k = associations.find(
4014
+ individualOnfido.basicDetails.jobTitle = associations.find(
3968
4015
  ({ jobTitle }) => Boolean(jobTitle)
3969
- )) == null ? void 0 : _k.jobTitle;
4016
+ )?.jobTitle;
3970
4017
  }
3971
4018
  if (isRoleFieldNeeded && individualOnfido.signatoryQuestionnaire && individualOnfido.uboQuestionnaire) {
3972
4019
  const associationTypes = new Set(associations.map((ea) => ea.type));
3973
- const hasAssociation = (type) => associationTypes.has(type) ? "yes" : "no";
4020
+ const hasAssociation = (type) => associationTypes.has(type) ? GuidanceQuestionValues.YES : GuidanceQuestionValues.NO;
3974
4021
  individualOnfido.signatoryQuestionnaire.isSignatory = hasAssociation(
3975
- DecisionMakerType.SIGNATORY
4022
+ DecisionMakerTypes.SIGNATORY
3976
4023
  );
3977
- individualOnfido.uboQuestionnaire.isOwner = hasAssociation(DecisionMakerType.OWNER);
4024
+ individualOnfido.uboQuestionnaire.isOwner = hasAssociation(DecisionMakerTypes.OWNER);
3978
4025
  individualOnfido.uboQuestionnaire.isControllingPerson = hasAssociation(
3979
- DecisionMakerType.CONTROLLING_PERSON
4026
+ DecisionMakerTypes.CONTROLLING_PERSON
3980
4027
  );
3981
- individualOnfido.uboQuestionnaire.isDirector = hasAssociation(DecisionMakerType.DIRECTOR);
3982
- const hasNomineeAssociation = (type) => associations.some((ea) => ea.type === type && ea.nominee) ? "yes" : "no";
4028
+ individualOnfido.uboQuestionnaire.isDirector = hasAssociation(DecisionMakerTypes.DIRECTOR);
4029
+ const hasNomineeAssociation = (type) => associations.some((ea) => ea.type === type && ea.nominee) ? GuidanceQuestionValues.YES : GuidanceQuestionValues.NO;
3983
4030
  individualOnfido.uboQuestionnaire.isNomineeDirector = hasNomineeAssociation(
3984
- DecisionMakerType.DIRECTOR
4031
+ DecisionMakerTypes.DIRECTOR
3985
4032
  );
3986
4033
  individualOnfido.uboQuestionnaire.isNomineeShareholder = hasNomineeAssociation(
3987
- DecisionMakerType.OWNER
4034
+ DecisionMakerTypes.OWNER
3988
4035
  );
3989
4036
  }
3990
4037
  individualOnfido.basicDetails = getNomineeFromAssociation(
@@ -3994,8 +4041,7 @@ const mapLegalEntityToIndividualOnfidoSchema = (legalEntity, isChangingType, isR
3994
4041
  return individualOnfido;
3995
4042
  };
3996
4043
  const mapDocumentDetailToIdDocument = (documents) => {
3997
- var _a;
3998
- const activeDocument = (_a = documents.filter((document) => document.active)) == null ? void 0 : _a[0];
4044
+ const activeDocument = documents.find((document) => document.active);
3999
4045
  return activeDocument ? {
4000
4046
  idDocumentType: activeDocument.type,
4001
4047
  modificationDate: activeDocument.modificationDate
@@ -4023,6 +4069,9 @@ const identityOnfidoBase = {
4023
4069
  jobTitle: {
4024
4070
  rule: "jobTitleIfRequiredForRole"
4025
4071
  },
4072
+ placeOfBirth: {
4073
+ rule: "isPlaceOfBirthRequired"
4074
+ },
4026
4075
  nationality: {
4027
4076
  rule: "nationalityIfRequiredForRole"
4028
4077
  },
@@ -4062,10 +4111,8 @@ const identityOnfidoBase = {
4062
4111
  nomineeShareholder: {
4063
4112
  rules: ["isGuidedDecisionMakersFlowDisabled", "nomineeShareHolderRequiredForCountry"]
4064
4113
  },
4065
- // Regardless of scenario, we want the user to go through the "verification method" step
4066
- // and hopefully get Onfido-verified. Otherwise, they must go through the manual flow.
4067
4114
  idVerificationMethod: {
4068
- rule: "REQUIRED"
4115
+ rule: "isIdVerificationMethodRequired"
4069
4116
  },
4070
4117
  idDocument: {
4071
4118
  // (either from Onfido or previously-uploaded document)
@@ -4219,7 +4266,6 @@ function IndividualOnfidoDropin({
4219
4266
  trustedFieldsProvider,
4220
4267
  trustedRoles
4221
4268
  }) {
4222
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4223
4269
  const { baseUrl, rootLegalEntityId } = useApiContext();
4224
4270
  const { accountHolder, setAccountHolder } = useAccountHolder();
4225
4271
  const { i18n } = useI18nContext();
@@ -4229,12 +4275,13 @@ function IndividualOnfidoDropin({
4229
4275
  const { isSettingEnabled } = useSettingsContext();
4230
4276
  const queryClient = useQueryClient();
4231
4277
  const isGuidedDecisionMakersFlowEnabled = isExperimentEnabled("EnableGuidedDecisionMakersFlow") || isExperimentEnabled("DecisionMakersFlowOptimization_GuidedDecisionMakersFlow");
4278
+ const isGuidedDecisionMakersFlowDisabled = isExperimentEnabled("DisableGuidedDecisionMakersFlow");
4232
4279
  const defaultCountry = "NL";
4233
4280
  const { data: providerStatus } = useProviderStatus({
4234
4281
  providers: ["idDocument"],
4235
4282
  country: legalEntityResponse ? getLegalEntityCountry(legalEntityResponse) : defaultCountry
4236
4283
  });
4237
- const isInstantVerificationEnabled = ((_b = (_a = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _a.idDocument) == null ? void 0 : _b.enabled) ?? true;
4284
+ const isInstantVerificationEnabled = providerStatus?.statuses?.idDocument?.enabled ?? true;
4238
4285
  const { mutateAsync: updateLegalEntity } = useUpdateLegalEntity();
4239
4286
  const isRoleFieldNeeded = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER;
4240
4287
  const dataFromResponse = useMemo(() => {
@@ -4265,7 +4312,7 @@ function IndividualOnfidoDropin({
4265
4312
  const [existingAttachments, setExistingAttachments] = useState();
4266
4313
  const [documents, setDocuments] = useState();
4267
4314
  const [country, setCountry] = useState(
4268
- ((_c = dataFromResponse == null ? void 0 : dataFromResponse.additionalPersonalDetails) == null ? void 0 : _c.country) ?? parentCountry
4315
+ dataFromResponse?.additionalPersonalDetails?.country ?? parentCountry
4269
4316
  );
4270
4317
  const [derivedProps, setDerivedProps] = useState();
4271
4318
  const [nextHandler, setNextHandler] = useState();
@@ -4276,6 +4323,7 @@ function IndividualOnfidoDropin({
4276
4323
  }),
4277
4324
  [propProblems, validationErrors]
4278
4325
  );
4326
+ const hasVerificationErrors = propProblems?.verificationErrors && Object.keys(propProblems.verificationErrors).length > 0;
4279
4327
  const associatedLeTrackingParams = useMemo(() => {
4280
4328
  return taskType === TaskTypes.INDIVIDUAL ? {} : getAssociatedLeAnalyticsPayload({
4281
4329
  associatedLegalEntity: legalEntityResponse,
@@ -4290,34 +4338,31 @@ function IndividualOnfidoDropin({
4290
4338
  });
4291
4339
  }, []);
4292
4340
  const individualFieldValidations = useCallback(
4293
- (data2) => {
4294
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
4295
- return {
4296
- basicDetails: basicDetailsValidators({
4297
- isExperimentEnabled
4298
- }),
4299
- additionalPersonalDetails: additionalPersonalDetailsValidators({
4300
- country: ((_a2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? country,
4301
- isExperimentEnabled,
4302
- isSettingEnabled,
4303
- taskType,
4304
- idNumberType: (_b2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _b2.typeOfIdentity,
4305
- idNumberExempt: (_c2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _c2.idNumberExempt,
4306
- idNumber: (_d2 = data2 == null ? void 0 : data2.additionalPersonalDetails) == null ? void 0 : _d2.idNumber,
4307
- existingIdNumber: (_e2 = dataFromResponse.additionalPersonalDetails) == null ? void 0 : _e2.idNumber,
4308
- formVerificationErrors: (_f2 = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _f2.additionalPersonalDetails,
4309
- i18n,
4310
- 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
4311
- })
4312
- };
4313
- },
4341
+ (data2) => ({
4342
+ basicDetails: basicDetailsValidators({
4343
+ isExperimentEnabled
4344
+ }),
4345
+ additionalPersonalDetails: additionalPersonalDetailsValidators({
4346
+ country: data2?.additionalPersonalDetails?.country ?? country,
4347
+ isExperimentEnabled,
4348
+ isSettingEnabled,
4349
+ taskType,
4350
+ idNumberType: data2?.additionalPersonalDetails?.typeOfIdentity,
4351
+ idNumberExempt: data2?.additionalPersonalDetails?.idNumberExempt,
4352
+ idNumber: data2?.additionalPersonalDetails?.idNumber,
4353
+ existingIdNumber: dataFromResponse.additionalPersonalDetails?.idNumber,
4354
+ formVerificationErrors: problems?.verificationErrors?.additionalPersonalDetails,
4355
+ i18n,
4356
+ taxIdNumberType: data2?.additionalPersonalDetails?.taxInformation?.length ? data2?.additionalPersonalDetails?.taxInformation[0]?.type : void 0
4357
+ })
4358
+ }),
4314
4359
  [
4315
4360
  country,
4316
- (_d = dataFromResponse.additionalPersonalDetails) == null ? void 0 : _d.idNumber,
4361
+ dataFromResponse.additionalPersonalDetails?.idNumber,
4317
4362
  i18n,
4318
4363
  isExperimentEnabled,
4319
4364
  isSettingEnabled,
4320
- (_e = problems == null ? void 0 : problems.verificationErrors) == null ? void 0 : _e.additionalPersonalDetails,
4365
+ problems?.verificationErrors?.additionalPersonalDetails,
4321
4366
  taskType
4322
4367
  ]
4323
4368
  );
@@ -4329,7 +4374,7 @@ function IndividualOnfidoDropin({
4329
4374
  phoneNumber: getAsyncPhoneValidationRules(validatePhoneNumber).phoneNumber
4330
4375
  },
4331
4376
  additionalPersonalDetails: {
4332
- idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2 == null ? void 0 : data2.additionalPersonalDetails).idNumber
4377
+ idNumber: getAsyncIdNumberValidationRule(verifyIdNumber2, data2?.additionalPersonalDetails).idNumber
4333
4378
  }
4334
4379
  }),
4335
4380
  [verifyIdNumber2, validatePhoneNumber]
@@ -4346,11 +4391,11 @@ function IndividualOnfidoDropin({
4346
4391
  };
4347
4392
  }, [documents, dataFromResponse]);
4348
4393
  const form = useMultiForm({
4349
- requiredFields: derivedProps == null ? void 0 : derivedProps.requiredFields,
4394
+ requiredFields: derivedProps?.requiredFields,
4350
4395
  defaultData,
4351
4396
  rules: individualFieldValidations,
4352
4397
  asyncRules: individualFieldAsyncValidations,
4353
- optionalFields: derivedProps == null ? void 0 : derivedProps.optionalFields
4398
+ optionalFields: derivedProps?.optionalFields
4354
4399
  });
4355
4400
  const documentUtils = documentApiUtils({
4356
4401
  baseUrl: baseUrl.value,
@@ -4358,10 +4403,9 @@ function IndividualOnfidoDropin({
4358
4403
  });
4359
4404
  const { data, requiredFields } = form;
4360
4405
  useEffect(() => {
4361
- var _a2;
4362
- setCountry(((_a2 = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? parentCountry);
4363
- }, [(_f = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _f.country, parentCountry]);
4364
- const { data: scenarios } = useScenarios(country, LegalEntityType.INDIVIDUAL);
4406
+ setCountry(data?.additionalPersonalDetails?.country ?? parentCountry);
4407
+ }, [data?.additionalPersonalDetails?.country, parentCountry]);
4408
+ const { data: scenarios } = useScenarios(country, LegalEntityTypes.INDIVIDUAL);
4365
4409
  useEffect(() => {
4366
4410
  if (!scenarios) return;
4367
4411
  setHasMotionCaptureScenario(scenarios);
@@ -4369,32 +4413,28 @@ function IndividualOnfidoDropin({
4369
4413
  }, [scenarios]);
4370
4414
  const { fieldConfigurations } = useScenarioConfiguration({
4371
4415
  parseConfiguration,
4372
- legalEntityType: LegalEntityType.INDIVIDUAL,
4416
+ legalEntityType: LegalEntityTypes.INDIVIDUAL,
4373
4417
  setLoadingStatus,
4374
4418
  country
4375
4419
  });
4376
4420
  const fieldsFromCustomRules = useMemo(
4377
- () => {
4378
- var _a2;
4379
- return individualOnfidoRules({
4380
- matchingScenario,
4381
- data,
4382
- country: ((_a2 = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _a2.country) ?? country,
4383
- taskType,
4384
- isExperimentEnabled,
4385
- rootLegalEntity: parentLegalEntity,
4386
- problems
4387
- });
4388
- },
4421
+ () => individualOnfidoRules({
4422
+ matchingScenario,
4423
+ data,
4424
+ country: data?.additionalPersonalDetails?.country ?? country,
4425
+ taskType,
4426
+ isExperimentEnabled,
4427
+ rootLegalEntity: parentLegalEntity,
4428
+ problems
4429
+ }),
4389
4430
  [country, matchingScenario, data, isExperimentEnabled, parentLegalEntity, taskType, problems]
4390
4431
  );
4391
4432
  useEffect(() => {
4392
- var _a2;
4393
4433
  const derivedProps2 = getPropsFromConfigurations(
4394
4434
  fieldConfigurations,
4395
4435
  individualOnfidoForms,
4396
- (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [],
4397
- (problems == null ? void 0 : problems.missingData) ?? [],
4436
+ problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
4437
+ problems?.missingData ?? [],
4398
4438
  legalEntityResponse ? getFieldsWithExistingData(
4399
4439
  legalEntityResponse,
4400
4440
  individualOnfidoApiKeyMapping,
@@ -4409,12 +4449,12 @@ function IndividualOnfidoDropin({
4409
4449
  fieldsFromCustomRules,
4410
4450
  {},
4411
4451
  {},
4412
- legalEntityResponse == null ? void 0 : legalEntityResponse.type,
4452
+ legalEntityResponse?.type,
4413
4453
  [],
4414
4454
  true
4415
4455
  );
4416
4456
  const updatedDerivedProps = mandateIdVerificationForMotionCapture(
4417
- (_a2 = showIndividualMotionCapture) == null ? void 0 : _a2.value,
4457
+ showIndividualMotionCapture?.value,
4418
4458
  derivedProps2
4419
4459
  );
4420
4460
  if (updatedDerivedProps) {
@@ -4424,15 +4464,14 @@ function IndividualOnfidoDropin({
4424
4464
  fieldConfigurations,
4425
4465
  legalEntityResponse,
4426
4466
  fieldsFromCustomRules,
4427
- problems == null ? void 0 : problems.remediationActions,
4428
- problems == null ? void 0 : problems.missingData
4467
+ problems?.remediationActions,
4468
+ problems?.missingData
4429
4469
  ]);
4430
4470
  useEffect(() => {
4431
- var _a2;
4432
- if (!((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.length)) return;
4433
- documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse == null ? void 0 : legalEntityResponse.id).then((res) => {
4471
+ if (!legalEntityResponse?.documentDetails?.length) return;
4472
+ documentUtils.fetchDocuments(legalEntityResponse.documentDetails, legalEntityResponse?.id).then((res) => {
4434
4473
  setExistingAttachments(res[0].attachments);
4435
- setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse == null ? void 0 : legalEntityResponse.id));
4474
+ setDocuments(mapApiDocumentToIndividualDocuments(legalEntityResponse?.id));
4436
4475
  }).catch(() => {
4437
4476
  showToast({ label: i18n.get("failedToFetchRelevantDocuments"), variant: "error" });
4438
4477
  });
@@ -4440,8 +4479,8 @@ function IndividualOnfidoDropin({
4440
4479
  const forms = useMemo(() => {
4441
4480
  const requiredForms = getRequiredForms(
4442
4481
  individualOnfidoForms,
4443
- derivedProps == null ? void 0 : derivedProps.requiredFields,
4444
- derivedProps == null ? void 0 : derivedProps.optionalFields
4482
+ derivedProps?.requiredFields,
4483
+ derivedProps?.optionalFields
4445
4484
  );
4446
4485
  const filteredForms = !isInstantVerificationEnabled ? requiredForms.filter((f) => f.formId !== "idVerificationMethod") : requiredForms;
4447
4486
  return addValidityToForms(filteredForms, form.isValid, problems);
@@ -4457,7 +4496,7 @@ function IndividualOnfidoDropin({
4457
4496
  };
4458
4497
  await getIdVerificationStartCheck(data2);
4459
4498
  };
4460
- const roleTypes = isRoleFieldNeeded && parentLegalEntity ? getAllowedDecisionMakerRoles(parentLegalEntity, taskType) : [];
4499
+ const roleTypes = isRoleFieldNeeded && parentLegalEntity ? getAllowedDecisionMakerRoles(parentLegalEntity, taskType, matchingScenario) : [];
4461
4500
  const { mutateAsync: createLegalEntity } = useCreateLegalEntity();
4462
4501
  const idDocumentTypeOptions = getLocalizedIdDocumentTypeOptions(country);
4463
4502
  const submitLegalEntity = async ({
@@ -4465,9 +4504,8 @@ function IndividualOnfidoDropin({
4465
4504
  legalEntity,
4466
4505
  idDocumentType
4467
4506
  }) => {
4468
- var _a2, _b2, _c2;
4469
4507
  let updatedLegalEntity;
4470
- const leId = (legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newDecisionMaker == null ? void 0 : newDecisionMaker.id);
4508
+ const leId = legalEntityResponse?.id || newDecisionMaker?.id;
4471
4509
  if (!leId) {
4472
4510
  updatedLegalEntity = await createLegalEntity(legalEntity);
4473
4511
  userEvents.addTaskEvent("Success", {
@@ -4475,8 +4513,8 @@ function IndividualOnfidoDropin({
4475
4513
  actionType: "submit",
4476
4514
  legalEntityId: updatedLegalEntity.id,
4477
4515
  entityType: updatedLegalEntity.type,
4478
- countryOfRegistration: ((_a2 = dataSubmitted.additionalPersonalDetails) == null ? void 0 : _a2.country) || null,
4479
- roles: ((_b2 = dataSubmitted.basicDetails) == null ? void 0 : _b2.role) || null
4516
+ countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country || null,
4517
+ roles: dataSubmitted.basicDetails?.role || null
4480
4518
  });
4481
4519
  } else {
4482
4520
  updatedLegalEntity = await updateLegalEntity({ ...drop("type").from(legalEntity), id: leId });
@@ -4485,7 +4523,7 @@ function IndividualOnfidoDropin({
4485
4523
  actionType: "submit",
4486
4524
  legalEntityId: updatedLegalEntity.id,
4487
4525
  entityType: updatedLegalEntity.type,
4488
- countryOfRegistration: ((_c2 = dataSubmitted.additionalPersonalDetails) == null ? void 0 : _c2.country) || null,
4526
+ countryOfRegistration: dataSubmitted.additionalPersonalDetails?.country || null,
4489
4527
  documentType: idDocumentType || null
4490
4528
  });
4491
4529
  }
@@ -4495,10 +4533,9 @@ function IndividualOnfidoDropin({
4495
4533
  legalEntity,
4496
4534
  dataSubmitted
4497
4535
  }) => {
4498
- var _a2, _b2, _c2, _d2;
4499
- const idDocument2 = (_a2 = dataSubmitted.idVerificationMethod) == null ? void 0 : _a2.idDocument;
4500
- if (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) {
4501
- if (((_c2 = (_b2 = providerStatus == null ? void 0 : providerStatus.statuses) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.enabled) === false) {
4536
+ const idDocument2 = dataSubmitted.idVerificationMethod?.idDocument;
4537
+ if (idDocument2?.instantIdVerificationData) {
4538
+ if (providerStatus?.statuses?.idDocument?.enabled === false) {
4502
4539
  throw new Error("Provider unexpectedly disabled instant verification flow");
4503
4540
  }
4504
4541
  await handleInstantIdVerificationStartCheck(
@@ -4511,7 +4548,7 @@ function IndividualOnfidoDropin({
4511
4548
  legalEntity.id
4512
4549
  );
4513
4550
  if (!formattedDocuments || formattedDocuments.length === 0) {
4514
- if (existingAttachments == null ? void 0 : existingAttachments.length)
4551
+ if (existingAttachments?.length)
4515
4552
  logger.log(
4516
4553
  "User has already uploaded documents and is not changing them, nothing needs to be done"
4517
4554
  );
@@ -4523,25 +4560,24 @@ function IndividualOnfidoDropin({
4523
4560
  }
4524
4561
  formattedDocuments[0].attachments = mergeAttachments(
4525
4562
  existingAttachments ?? [],
4526
- ((_d2 = formattedDocuments[0]) == null ? void 0 : _d2.attachments) ?? []
4563
+ formattedDocuments[0]?.attachments ?? []
4527
4564
  ).filter((attachment) => attachment.content);
4528
4565
  const uploadedDocuments = await documentUtils.uploadDocuments(
4529
4566
  formattedDocuments,
4530
4567
  legalEntity.id
4531
4568
  );
4532
- uploadedDocuments == null ? void 0 : uploadedDocuments.forEach((doc) => {
4533
- var _a3;
4569
+ uploadedDocuments?.forEach((doc) => {
4534
4570
  userEvents.addTaskEvent("Success", {
4535
4571
  ...associatedLeTrackingParams,
4536
4572
  actionType: "upload",
4537
4573
  documentType: doc.type,
4538
- fileExtention: ((_a3 = doc == null ? void 0 : doc.attachments) == null ? void 0 : _a3.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0)) ?? null
4574
+ fileExtention: doc?.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? null
4539
4575
  });
4540
4576
  });
4541
4577
  }
4542
4578
  };
4543
4579
  const hasRolesChanged = (legalEntityId, existingEntityAssociations, newRoles) => {
4544
- const existingRoles = existingEntityAssociations == null ? void 0 : existingEntityAssociations.filter((association) => association.legalEntityId === legalEntityId).map(({ type }) => type);
4580
+ const existingRoles = existingEntityAssociations?.filter((association) => association.legalEntityId === legalEntityId).map(({ type }) => type);
4545
4581
  return !doArraysMatch(existingRoles, newRoles);
4546
4582
  };
4547
4583
  const attachAssociationToParentLegalEntity = async ({
@@ -4549,26 +4585,22 @@ function IndividualOnfidoDropin({
4549
4585
  parentLE,
4550
4586
  dataSubmitted
4551
4587
  }) => {
4552
- var _a2, _b2, _c2;
4553
- 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;
4588
+ const newRoles = taskType === TaskTypes.DECISION_MAKER || taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER || taskType === TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY_OWNER ? dataSubmitted?.basicDetails?.role : null;
4554
4589
  const existingEntityAssociations = getOwnEntityAssociations(parentLE);
4555
- 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))) {
4590
+ if (newRoles && (hasRolesChanged(legalEntity?.id, existingEntityAssociations, newRoles) || dataFromResponse.basicDetails?.jobTitle !== dataSubmitted?.basicDetails?.jobTitle || hasNomineesChanged(dataFromResponse.basicDetails, dataSubmitted.basicDetails))) {
4556
4591
  const updatedParentLegalEntity = {
4557
4592
  entityAssociations: [
4558
- ...newRoles.map((role) => {
4559
- var _a3;
4560
- return {
4561
- type: role,
4562
- legalEntityId: legalEntity.id,
4563
- ...DECISION_MAKER_TYPES_WITH_JOBTITLE.some((type) => type === role) && {
4564
- jobTitle: (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.basicDetails) == null ? void 0 : _a3.jobTitle
4565
- }
4566
- };
4567
- }) || [],
4593
+ ...newRoles.map((role) => ({
4594
+ type: role,
4595
+ legalEntityId: legalEntity.id,
4596
+ ...DECISION_MAKER_TYPES_WITH_JOBTITLE.some((type) => type === role) && {
4597
+ jobTitle: dataSubmitted?.basicDetails?.jobTitle
4598
+ }
4599
+ })) || [],
4568
4600
  ...existingEntityAssociations.filter((ea) => ea.legalEntityId !== legalEntity.id) || []
4569
4601
  ]
4570
4602
  };
4571
- const nomineeDataSource = isGuidedDecisionMakersFlowEnabled ? dataSubmitted == null ? void 0 : dataSubmitted.uboQuestionnaire : dataSubmitted.basicDetails;
4603
+ const nomineeDataSource = !isGuidedDecisionMakersFlowDisabled && isGuidedDecisionMakersFlowEnabled ? dataSubmitted?.uboQuestionnaire : dataSubmitted.basicDetails;
4572
4604
  if (nomineeDataSource && updatedParentLegalEntity.entityAssociations) {
4573
4605
  updatedParentLegalEntity.entityAssociations = updatedParentLegalEntity.entityAssociations.map(
4574
4606
  (ea) => attachNomineeToRole(ea, country, nomineeDataSource)
@@ -4578,7 +4610,6 @@ function IndividualOnfidoDropin({
4578
4610
  }
4579
4611
  };
4580
4612
  const onSubmit = async () => {
4581
- var _a2, _b2;
4582
4613
  setLoadingStatus("loading");
4583
4614
  const dataSubmitted = omitObscuredFieldsIfUnchanged(
4584
4615
  individualOnfidoObscuredFields,
@@ -4594,12 +4625,9 @@ function IndividualOnfidoDropin({
4594
4625
  isExperimentEnabled,
4595
4626
  matchingScenario
4596
4627
  );
4597
- const idDocumentType = (_a2 = idDocumentTypeOptions.find(
4598
- ({ id }) => {
4599
- var _a3, _b3;
4600
- return ((_b3 = (_a3 = dataSubmitted == null ? void 0 : dataSubmitted.idVerificationMethod) == null ? void 0 : _a3.idDocument) == null ? void 0 : _b3.idDocumentType) === id;
4601
- }
4602
- )) == null ? void 0 : _a2.id;
4628
+ const idDocumentType = idDocumentTypeOptions.find(
4629
+ ({ id }) => dataSubmitted?.idVerificationMethod?.idDocument?.idDocumentType === id
4630
+ )?.id;
4603
4631
  legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
4604
4632
  taskType,
4605
4633
  legalEntityResponse,
@@ -4611,7 +4639,7 @@ function IndividualOnfidoDropin({
4611
4639
  idDocumentType
4612
4640
  });
4613
4641
  setAccountHolder(accountHolder);
4614
- if (((_b2 = dataSubmitted.idVerificationMethod) == null ? void 0 : _b2.idVerificationMethod) !== "existingDocument") {
4642
+ if (dataSubmitted.idVerificationMethod && dataSubmitted.idVerificationMethod?.idVerificationMethod !== "existingDocument" || hasVerificationErrors) {
4615
4643
  await submitDocuments({ legalEntity: createdLegalEntity, dataSubmitted });
4616
4644
  }
4617
4645
  if (parentLegalEntity) {
@@ -4627,11 +4655,18 @@ function IndividualOnfidoDropin({
4627
4655
  }
4628
4656
  setLoadingStatus("success");
4629
4657
  clearToasts();
4630
- externalOnSubmit == null ? void 0 : externalOnSubmit(dataSubmitted);
4658
+ externalOnSubmit?.(dataSubmitted);
4631
4659
  } catch (e) {
4660
+ const eventsAdditionalData = {};
4632
4661
  logger.error("Failed to update individual", e);
4633
4662
  if (isValidationError(e)) {
4634
- setValidationErrors(processValidationErrors(e, TaskTypes.INDIVIDUAL));
4663
+ const getErrors = processValidationErrors(e, TaskTypes.INDIVIDUAL);
4664
+ if (getErrors && !Object.keys(getErrors).length) {
4665
+ showToast({ label: i18n.get("failedToUpdateDetails"), variant: "error" });
4666
+ eventsAdditionalData.unmappedErrorNames = e.invalidFields?.map((field) => field.name).filter(Boolean);
4667
+ } else {
4668
+ setValidationErrors(getErrors);
4669
+ }
4635
4670
  } else if (isMaintenanceModeError(e)) {
4636
4671
  showToast({
4637
4672
  label: i18n.get("maintenanceModeMessage"),
@@ -4644,24 +4679,21 @@ function IndividualOnfidoDropin({
4644
4679
  setLoadingStatus("success");
4645
4680
  userEvents.addTaskEvent("Encountered error", {
4646
4681
  actionType: "submit",
4647
- returnType: e.errorCode,
4648
- returnValue: e.title
4682
+ additionalData: eventsAdditionalData,
4683
+ returnType: e?.errorCode,
4684
+ returnValue: e?.title || "backend"
4649
4685
  });
4650
4686
  }
4651
4687
  };
4652
4688
  const datasetUtils = datasetUtilities(i18n.locale);
4653
4689
  const formatIdDocument = (idDocument2) => {
4654
- var _a2, _b2;
4655
4690
  if (!idDocument2) return void 0;
4656
- const documentType = (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData) ? onfidoDocumentTypeMapping.find(
4657
- (document) => {
4658
- var _a3;
4659
- return ((_a3 = idDocument2.instantIdVerificationData) == null ? void 0 : _a3.document_front.type) === document.id;
4660
- }
4691
+ const documentType = idDocument2?.instantIdVerificationData ? onfidoDocumentTypeMapping.find(
4692
+ (document) => idDocument2.instantIdVerificationData?.document_front.type === document.id
4661
4693
  ) : idDocumentTypeOptions.find(({ id }) => idDocument2.idDocumentType === id);
4662
4694
  if (!documentType) return void 0;
4663
- const frontPage = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
4664
- const backPage = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
4695
+ const frontPage = idDocument2.idFrontPage?.[0];
4696
+ const backPage = idDocument2.idBackPage?.[0];
4665
4697
  if (!frontPage) return void 0;
4666
4698
  return {
4667
4699
  documentType: i18n.get(documentType.name),
@@ -4680,13 +4712,12 @@ function IndividualOnfidoDropin({
4680
4712
  proofOfResidency,
4681
4713
  proofOfRelationship
4682
4714
  }) => {
4683
- var _a2, _b2, _c2;
4684
- const proofOfNationalIdFile = (_a2 = proofOfNationalId == null ? void 0 : proofOfNationalId.proofOfNationalId) == null ? void 0 : _a2[0];
4685
- const proofOfResidencyFile = (_b2 = proofOfResidency == null ? void 0 : proofOfResidency.proofOfResidency) == null ? void 0 : _b2[0];
4686
- const proofOfRelationshipFile = (_c2 = proofOfRelationship == null ? void 0 : proofOfRelationship.proofOfRelationship) == null ? void 0 : _c2[0];
4687
- const idDocument2 = (idVerificationMethod == null ? void 0 : idVerificationMethod.idVerificationMethod) === "manualVerification" ? manualIdUpload : idVerificationMethod == null ? void 0 : idVerificationMethod.idDocument;
4715
+ const proofOfNationalIdFile = proofOfNationalId?.proofOfNationalId?.[0];
4716
+ const proofOfResidencyFile = proofOfResidency?.proofOfResidency?.[0];
4717
+ const proofOfRelationshipFile = proofOfRelationship?.proofOfRelationship?.[0];
4718
+ const idDocument2 = idVerificationMethod?.idVerificationMethod === "manualVerification" ? manualIdUpload : idVerificationMethod?.idDocument;
4688
4719
  return {
4689
- ...((idDocument2 == null ? void 0 : idDocument2.idDocumentType) || (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData)) && {
4720
+ ...(idDocument2?.idDocumentType || idDocument2?.instantIdVerificationData) && {
4690
4721
  idDocument: formatIdDocument(idDocument2)
4691
4722
  },
4692
4723
  ...proofOfNationalIdFile && {
@@ -4708,17 +4739,16 @@ function IndividualOnfidoDropin({
4708
4739
  };
4709
4740
  const isManualVerificationOrExistingDoc = (idVerificationMethod) => idVerificationMethod === "manualVerification" || idVerificationMethod === "existingDocument";
4710
4741
  const formatDataForSummary = () => {
4711
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
4712
4742
  let summaryData = cloneObject(data);
4713
- if ((_a2 = summaryData == null ? void 0 : summaryData.basicDetails) == null ? void 0 : _a2.phoneNumber) {
4743
+ if (summaryData?.basicDetails?.phoneNumber) {
4714
4744
  summaryData.basicDetails.phoneNumber = summaryData.basicDetails.phoneNumber.number;
4715
4745
  }
4716
- if ((_b2 = summaryData.additionalPersonalDetails) == null ? void 0 : _b2.country) {
4746
+ if (summaryData.additionalPersonalDetails?.country) {
4717
4747
  summaryData.additionalPersonalDetails.country = datasetUtils.getCountryName(
4718
4748
  summaryData.additionalPersonalDetails.country
4719
4749
  );
4720
4750
  }
4721
- if ((_c2 = summaryData.additionalPersonalDetails) == null ? void 0 : _c2.nationality) {
4751
+ if (summaryData.additionalPersonalDetails?.nationality) {
4722
4752
  summaryData.additionalPersonalDetails.nationality = datasetUtils.getCountryName(
4723
4753
  summaryData.additionalPersonalDetails.nationality
4724
4754
  );
@@ -4726,62 +4756,56 @@ function IndividualOnfidoDropin({
4726
4756
  if (summaryData.additionalPersonalDetails) {
4727
4757
  summaryData.address = mapAddressLabels(summaryData.additionalPersonalDetails, datasetUtils);
4728
4758
  }
4729
- if ((_d2 = summaryData.basicDetails) == null ? void 0 : _d2.accountHolder) {
4759
+ if (summaryData.basicDetails?.accountHolder) {
4730
4760
  summaryData.basicDetails.accountHolder = i18n.get(summaryData.basicDetails.accountHolder);
4731
4761
  }
4732
- if ((_e2 = summaryData.additionalPersonalDetails) == null ? void 0 : _e2.birthDate) {
4762
+ if (summaryData.additionalPersonalDetails?.birthDate) {
4733
4763
  summaryData.additionalPersonalDetails.birthDate = localizeDateString(
4734
4764
  summaryData.additionalPersonalDetails.birthDate,
4735
4765
  i18n.locale
4736
4766
  );
4737
4767
  }
4738
- if (isManualVerificationOrExistingDoc((_f2 = summaryData.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod) || summaryData.proofOfResidency) {
4768
+ if (isManualVerificationOrExistingDoc(summaryData.idVerificationMethod?.idVerificationMethod) || summaryData.proofOfResidency) {
4739
4769
  const fileSummaryData = formatFileSummaryData(data);
4740
4770
  summaryData = { ...summaryData, ...fileSummaryData };
4741
4771
  summaryData.manualIdUpload = { ...summaryData.idDocument };
4742
4772
  summaryData.idVerificationMethod.idDocument = { ...summaryData.idDocument };
4743
4773
  }
4744
- if ((_g2 = summaryData.additionalPersonalDetails) == null ? void 0 : _g2.taxInformation) {
4774
+ if (summaryData.additionalPersonalDetails?.taxInformation) {
4745
4775
  const taxInformation = summaryData.additionalPersonalDetails.taxInformation.find(
4746
- (taxId) => {
4747
- var _a3;
4748
- return taxId.country === ((_a3 = data.additionalPersonalDetails) == null ? void 0 : _a3.nationality);
4749
- }
4776
+ (taxId) => taxId.country === data.additionalPersonalDetails?.nationality
4750
4777
  );
4751
4778
  if (taxInformation) {
4752
4779
  delete summaryData.additionalPersonalDetails.taxInformation;
4753
4780
  summaryData.additionalPersonalDetails[taxInformation.type] = taxInformation.number;
4754
4781
  }
4755
4782
  }
4756
- if (summaryData == null ? void 0 : summaryData.signatoryQuestionnaire) {
4757
- summaryData.signatoryQuestionnaire = ((_h2 = data == null ? void 0 : data.signatoryQuestionnaire) == null ? void 0 : _h2.isSignatory) === "yes" ? [i18n.get("signatorySummaryLabel")] : [];
4783
+ if (summaryData?.signatoryQuestionnaire) {
4784
+ summaryData.signatoryQuestionnaire = data?.signatoryQuestionnaire?.isSignatory === GuidanceQuestionValues.YES ? [i18n.get("signatorySummaryLabel")] : [];
4758
4785
  }
4759
- if (summaryData == null ? void 0 : summaryData.uboQuestionnaire) {
4786
+ if (summaryData?.uboQuestionnaire) {
4760
4787
  const roleFieldToLabelMap = {
4761
4788
  isOwner: "ownerSummaryLabel",
4762
4789
  isControllingPerson: "controllingPersonSummaryLabel",
4763
4790
  isDirector: "directorSummaryLabel"
4764
4791
  };
4765
4792
  summaryData.uboQuestionnaire = Object.keys(roleFieldToLabelMap).flatMap(
4766
- (field) => {
4767
- var _a3;
4768
- return ((_a3 = data == null ? void 0 : data.uboQuestionnaire) == null ? void 0 : _a3[field]) === "yes" ? [i18n.get(roleFieldToLabelMap[field])] : [];
4769
- }
4793
+ (field) => data?.uboQuestionnaire?.[field] === GuidanceQuestionValues.YES ? [i18n.get(roleFieldToLabelMap[field])] : []
4770
4794
  );
4771
4795
  }
4772
4796
  return summaryData;
4773
4797
  };
4774
4798
  const omittedKeysForSummary = [
4775
4799
  ...taskType === TaskTypes.DECISION_MAKER ? ["role"] : [],
4776
- ...((_g = data == null ? void 0 : data.additionalPersonalDetails) == null ? void 0 : _g.idNumberExempt) ? ["idNumber"] : [],
4777
- ...isManualVerificationOrExistingDoc((_h = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _h.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
4800
+ ...data?.additionalPersonalDetails?.idNumberExempt ? ["idNumber"] : [],
4801
+ ...isManualVerificationOrExistingDoc(data?.idVerificationMethod?.idVerificationMethod) ? ["idVerificationMethod", "modificationDate"] : []
4778
4802
  ];
4779
4803
  const omittedFormsForSummary = [
4780
- ...((_i = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _i.idVerificationMethod) === "instantVerification" ? ["idDocument"] : [],
4781
- ...((_j = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _j.idVerificationMethod) === "manualVerification" ? ["idVerificationMethod"] : []
4804
+ ...data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? ["idDocument"] : [],
4805
+ ...data?.idVerificationMethod?.idVerificationMethod === "manualVerification" ? ["idVerificationMethod"] : []
4782
4806
  ];
4783
4807
  const customLabelsForSummary = {
4784
- idVerificationMethod: ((_k = data == null ? void 0 : data.idVerificationMethod) == null ? void 0 : _k.idVerificationMethod) === "instantVerification" ? "idVerificationMethod" : "idDocument"
4808
+ idVerificationMethod: data?.idVerificationMethod?.idVerificationMethod === "instantVerification" ? "idVerificationMethod" : "idDocument"
4785
4809
  };
4786
4810
  const {
4787
4811
  handleNextClick,
@@ -4798,10 +4822,10 @@ function IndividualOnfidoDropin({
4798
4822
  triggerValidation: form.triggerValidation
4799
4823
  // TODO: figure out type of nested keys
4800
4824
  });
4801
- const disableNextButton = useMemo(() => {
4802
- const isVerificationMethod = (activeForm == null ? void 0 : activeForm.formId) === "idVerificationMethod";
4803
- return isVerificationMethod && !(activeForm == null ? void 0 : activeForm.isValid);
4804
- }, [activeForm]);
4825
+ const disableNextButton = computed(() => {
4826
+ const isVerificationMethod = activeForm?.formId === "idVerificationMethod";
4827
+ return isVerificationMethod && !activeForm?.isValid || isNextStepDisabled.value;
4828
+ });
4805
4829
  const handleTrackNavigation = useCallback(
4806
4830
  (props) => {
4807
4831
  trackNavigation({
@@ -4826,7 +4850,7 @@ function IndividualOnfidoDropin({
4826
4850
  },
4827
4851
  asModal,
4828
4852
  currentStep: steps.current,
4829
- disableNextButton,
4853
+ disableNextButton: disableNextButton.value,
4830
4854
  forms,
4831
4855
  gotoFormByFormIndex,
4832
4856
  handleBackClick,
@@ -4847,7 +4871,7 @@ function IndividualOnfidoDropin({
4847
4871
  problems,
4848
4872
  onNext: handleNextClick,
4849
4873
  onBack: handleBackClick,
4850
- legalEntityId: legalEntityResponse == null ? void 0 : legalEntityResponse.id,
4874
+ legalEntityId: legalEntityResponse?.id,
4851
4875
  allowedRoles: roleTypes,
4852
4876
  shouldValidate,
4853
4877
  accountHolder,