@incodetech/core 2.4.1-agentic.1 → 2.4.1-agentic.11

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 (289) hide show
  1. package/dist/Actor-DqjOqDfU.d.ts +1 -0
  2. package/dist/{BaseWasmProvider-Bq3OHo7P.d.ts → BaseWasmProvider-bBNquvYn.d.ts} +2 -2
  3. package/dist/{CameraCompositor-DN7NkJzV.esm.js → CameraCompositor-ppyMYVoY.esm.js} +1 -1
  4. package/dist/DateFormattingProvider-DPq9zco-.esm.js +25 -0
  5. package/dist/{FaceDetectionProvider-CAY43vSI.esm.js → FaceDetectionProvider-2NzWDbV8.esm.js} +9 -9
  6. package/dist/{IIdCaptureCapability-CGcEt2Cw.d.ts → IIdCaptureCapability-C-5M8pP1.d.ts} +2 -2
  7. package/dist/{IWasmUtilCapability-Cqiaxydi.d.ts → IWasmUtilCapability-BRn0wz8v.d.ts} +2 -2
  8. package/dist/Manager-BvXAwDv9.esm.js +125 -0
  9. package/dist/{Manager-C9T5amUN.d.ts → Manager-DufwKlav.d.ts} +1 -7
  10. package/dist/{MultipartRecordingProvider-D9mauUdS.esm.js → MultipartRecordingProvider-CduV32Qa.esm.js} +6 -1
  11. package/dist/{StreamCanvasCapture-C3xNfOsv.d.ts → StreamCanvasCapture-ixfy84ys.d.ts} +2 -2
  12. package/dist/{WasmUtilProvider-Dp2V-Uct.esm.js → WasmUtilProvider-DdhAHHw4.esm.js} +42 -6
  13. package/dist/{WorkerEncoderRecordingProvider-B1ODYtgN.esm.js → WorkerEncoderRecordingProvider-CsDED9UU.esm.js} +1 -1
  14. package/dist/addressSearch-Rxm1K67A.esm.js +73 -0
  15. package/dist/{advanceableErrors-k-U-cL5m.esm.js → advanceableErrors-CxZyPRyh.esm.js} +3 -0
  16. package/dist/ae-signature.d.ts +2 -2
  17. package/dist/ae-signature.esm.js +1 -1
  18. package/dist/antifraud.d.ts +1 -1
  19. package/dist/antifraud.esm.js +2 -2
  20. package/dist/{antifraudManager-DbGCvlJs.d.ts → antifraudManager-BxfCsyA7.d.ts} +3 -3
  21. package/dist/{antifraudManager-BObuHBjn.esm.js → antifraudManager-DKNOi9-z.esm.js} +5 -3
  22. package/dist/{antifraudStateMachine-Dfrd2-26.esm.js → antifraudStateMachine-BJ6PmCsw.esm.js} +3 -3
  23. package/dist/{api-CpP4PS4S.esm.js → api-CZpuJuZl.esm.js} +3 -1
  24. package/dist/{apiError-DH-CH4Nz.esm.js → apiError-BamZ815u.esm.js} +1 -1
  25. package/dist/{attemptCarry-WOkfvFMw.esm.js → attemptCarry-BecGGZK8.esm.js} +1 -1
  26. package/dist/authentication.d.ts +3 -3
  27. package/dist/authentication.esm.js +2 -2
  28. package/dist/{authenticationManager-CWmh7aSY.d.ts → authenticationManager-DRaugLgH.d.ts} +2 -2
  29. package/dist/{authenticationManager-DjX0XDyH.esm.js → authenticationManager-yBVGiIf_.esm.js} +7 -6
  30. package/dist/{authenticationStateMachine-BMbZL8wm.esm.js → authenticationStateMachine-DPqTOJPp.esm.js} +50 -18
  31. package/dist/avatar.d.ts +1 -1
  32. package/dist/{browser-pQZA35G2-DtkAf6sn.esm.js → browser-pQZA35G2-DxIBykpe.esm.js} +1 -1
  33. package/dist/{callback-645_omgz.d.ts → callback-BmjJ1G-5.d.ts} +1 -1
  34. package/dist/camera.esm.js +1 -1
  35. package/dist/certificate-issuance.d.ts +1 -1
  36. package/dist/certificate-issuance.esm.js +2 -2
  37. package/dist/{certificateIssuanceManager-Dr8A4Lgr.d.ts → certificateIssuanceManager-BcYhxO63.d.ts} +4 -3
  38. package/dist/{certificateIssuanceManager-C1nETQos.esm.js → certificateIssuanceManager-Dxl9UwR0.esm.js} +5 -3
  39. package/dist/{certificateIssuanceStateMachine-DThXMDqr.esm.js → certificateIssuanceStateMachine-CM4q71h1.esm.js} +4 -4
  40. package/dist/{cnpj-Co1ottYN.esm.js → cnpj-Bl_olpdX.esm.js} +5 -3
  41. package/dist/consent.d.ts +1 -1
  42. package/dist/consent.esm.js +2 -2
  43. package/dist/{consentManager-bjfVXO7p.d.ts → consentManager-B2F_VeAo.d.ts} +12 -11
  44. package/dist/{consentManager-DMlSL6Ax.esm.js → consentManager-BPocwpm2.esm.js} +5 -3
  45. package/dist/{consentStateMachine-DIYSMxKQ.esm.js → consentStateMachine-DgiIcT9q.esm.js} +3 -3
  46. package/dist/cpf-DDXMTLYr.esm.js +37 -0
  47. package/dist/{createFaceAvatar-lYX0VTYs.d.ts → createFaceAvatar-BimBTONm.d.ts} +1 -1
  48. package/dist/cross-document-data-match.d.ts +1 -1
  49. package/dist/cross-document-data-match.esm.js +1 -1
  50. package/dist/{crossDocumentDataMatchManager-BFTdiEDB.esm.js → crossDocumentDataMatchManager-BfA29Aji.esm.js} +6 -4
  51. package/dist/{crossDocumentDataMatchManager-yCWCOzcU.d.ts → crossDocumentDataMatchManager-crZcIUSY.d.ts} +3 -3
  52. package/dist/curp-DZGvefg3.esm.js +14 -0
  53. package/dist/curp-validation.d.ts +1 -1
  54. package/dist/curp-validation.esm.js +2 -2
  55. package/dist/{curpValidationManager-DNpC3wyf.esm.js → curpValidationManager-CbvBDoE1.esm.js} +6 -4
  56. package/dist/{curpValidationManager-z8428oCM.d.ts → curpValidationManager-Ci2iVuog.d.ts} +4 -4
  57. package/dist/{curpValidationStateMachine-B3iVsDyt.esm.js → curpValidationStateMachine-BQ8XK2Y3.esm.js} +5 -5
  58. package/dist/custom-fields.d.ts +1 -1
  59. package/dist/custom-fields.esm.js +1 -1
  60. package/dist/custom-watchlist.d.ts +1 -1
  61. package/dist/custom-watchlist.esm.js +2 -2
  62. package/dist/{customFieldsManager-CvI-pDT3.esm.js → customFieldsManager-BRqSCR9R.esm.js} +6 -4
  63. package/dist/{customFieldsManager-CF-cO8ap.d.ts → customFieldsManager-CdWTbsew.d.ts} +3 -3
  64. package/dist/{customWatchlistManager-BuHtUb0y.esm.js → customWatchlistManager-Bd1ooIDB.esm.js} +5 -3
  65. package/dist/{customWatchlistManager-DolUswyR.d.ts → customWatchlistManager-lJrveDS4.d.ts} +3 -3
  66. package/dist/{customWatchlistStateMachine-CiVD9wyF.esm.js → customWatchlistStateMachine-r8nGhyo1.esm.js} +3 -3
  67. package/dist/{deepsightLoader-B7DEYoyY.esm.js → deepsightLoader-CEY2mSPM.esm.js} +5 -5
  68. package/dist/{addressSearch-DzbE9Ogt.esm.js → definitionSource-Nw0YCbpe.esm.js} +39 -72
  69. package/dist/{desktopCameraElection-BGMtYwk3.esm.js → desktopCameraElection-enVPfRsQ.esm.js} +5 -5
  70. package/dist/document-capture.d.ts +1 -1
  71. package/dist/document-capture.esm.js +2 -2
  72. package/dist/{documentCaptureManager-CD5iQiUI.d.ts → documentCaptureManager-BZBmcOKI.d.ts} +4 -3
  73. package/dist/{documentCaptureManager-DLPqruXJ.esm.js → documentCaptureManager-C11k5BO-.esm.js} +5 -3
  74. package/dist/{documentCaptureStateMachine-DCvWQhFG.esm.js → documentCaptureStateMachine-g0gfL0_1.esm.js} +6 -6
  75. package/dist/dynamic-forms.d.ts +1 -1
  76. package/dist/dynamic-forms.esm.js +2 -2
  77. package/dist/{dynamicFormsManager-DfqCEPg9.esm.js → dynamicFormsManager-BmfCZ2zV.esm.js} +5 -3
  78. package/dist/{dynamicFormsManager-9kwY8Bf5.d.ts → dynamicFormsManager-C45pTncO.d.ts} +3 -3
  79. package/dist/{dynamicFormsStateMachine-USQMB-uV.esm.js → dynamicFormsStateMachine-B-eYytau.esm.js} +4 -4
  80. package/dist/ekyb.d.ts +3 -3
  81. package/dist/ekyb.esm.js +2 -2
  82. package/dist/{ekybManager-CR8YSYux.esm.js → ekybManager-BPaMfbgw.esm.js} +5 -3
  83. package/dist/{ekybManager-BLOkwmWO.d.ts → ekybManager-BflWuTe4.d.ts} +3 -3
  84. package/dist/{ekybStateMachine-kHwdz6hm.esm.js → ekybStateMachine-C_lEw4I7.esm.js} +19 -19
  85. package/dist/ekyc-prefill.d.ts +17 -0
  86. package/dist/ekyc-prefill.esm.js +3 -0
  87. package/dist/ekyc.d.ts +3 -3
  88. package/dist/ekyc.esm.js +3 -3
  89. package/dist/{ekycManager-DlGIn9wA.d.ts → ekycManager-BKVQazAb.d.ts} +48 -7
  90. package/dist/{ekycManager-DymCvmVB.esm.js → ekycManager-nRT0rxei.esm.js} +39 -16
  91. package/dist/ekycPrefillManager-CCtbmrFd.esm.js +103 -0
  92. package/dist/ekycPrefillManager-DOTl3Y2w.d.ts +566 -0
  93. package/dist/ekycPrefillStateMachine-XpxgCAoC.esm.js +687 -0
  94. package/dist/ekycRules-DXP2hqVw.esm.js +479 -0
  95. package/dist/{ekycStateMachine-CoFCUJ2z.esm.js → ekycStateMachine-nwJRel2s.esm.js} +915 -596
  96. package/dist/{ekycUtils-GRuMELYr.esm.js → ekycUtils-FcqA6oU4.esm.js} +68 -49
  97. package/dist/electronic-signature.d.ts +1 -1
  98. package/dist/electronic-signature.esm.js +1 -1
  99. package/dist/{electronicSignatureManager-DTSLOvKR.d.ts → electronicSignatureManager-5tYz-a4o.d.ts} +4 -3
  100. package/dist/{electronicSignatureManager-BCE3uA3z.esm.js → electronicSignatureManager-M2O2VDks.esm.js} +8 -6
  101. package/dist/email.d.ts +1 -1
  102. package/dist/email.esm.js +2 -2
  103. package/dist/{emailManager-CGoE3CUe.esm.js → emailManager-Co4jarT1.esm.js} +5 -3
  104. package/dist/{emailManager-Dy6omJVp.d.ts → emailManager-pM7ZPuMa.d.ts} +3 -3
  105. package/dist/{emailStateMachine-KgHfDNvM.esm.js → emailStateMachine-CTEaYncs.esm.js} +4 -4
  106. package/dist/events-CP3yOzAl.esm.js +299 -0
  107. package/dist/events.d.ts +3 -1
  108. package/dist/events.esm.js +2 -1
  109. package/dist/extensibility.d.ts +43 -42
  110. package/dist/extensibility.esm.js +39 -38
  111. package/dist/{externalFetch-CQY41QT1.esm.js → externalFetch-cUjJYyXj.esm.js} +1 -1
  112. package/dist/face-match.d.ts +1 -1
  113. package/dist/face-match.esm.js +2 -2
  114. package/dist/{faceCaptureManagerFactory-Dp90bedH.esm.js → faceCaptureManagerFactory-3Or5qfbA.esm.js} +17 -6
  115. package/dist/{faceCaptureManagerFactory-DV2ULUYS.d.ts → faceCaptureManagerFactory-CRGajjZ4.d.ts} +18 -11
  116. package/dist/{faceCaptureSetup-ZfiWg0fo.esm.js → faceCaptureSetup-Cf87i0rT.esm.js} +46 -38
  117. package/dist/{faceMatchManager-Z4UDLwAv.d.ts → faceMatchManager-C5b5WtcY.d.ts} +12 -5
  118. package/dist/{faceMatchManager-D2xKPjjQ.esm.js → faceMatchManager-CGmNGbov.esm.js} +5 -3
  119. package/dist/{faceMatchStateMachine-CUvwiQi9.esm.js → faceMatchStateMachine-BuHt7kec.esm.js} +44 -18
  120. package/dist/{feature-management-BbCIA4og.esm.js → feature-management-DG016L6E.esm.js} +1 -1
  121. package/dist/feature-management.esm.js +1 -1
  122. package/dist/field-comparison.d.ts +1 -1
  123. package/dist/field-comparison.esm.js +1 -1
  124. package/dist/{fieldComparisonManager-DgDbEeFZ.esm.js → fieldComparisonManager-VgCU4X96.esm.js} +6 -4
  125. package/dist/{fieldComparisonManager-CUX4gza2.d.ts → fieldComparisonManager-mFOHRhVd.d.ts} +3 -3
  126. package/dist/fiscal-qr.d.ts +1 -1
  127. package/dist/fiscal-qr.esm.js +1 -1
  128. package/dist/{fiscalQrManager-D0Iy7EKR.d.ts → fiscalQrManager-DFnFVpP9.d.ts} +3 -3
  129. package/dist/{fiscalQrManager-BZeklojR.esm.js → fiscalQrManager-DOLq45ph.esm.js} +6 -4
  130. package/dist/flow-events.d.ts +1 -1
  131. package/dist/flow.d.ts +71 -20
  132. package/dist/flow.esm.js +285 -68
  133. package/dist/{flowCompletionService-CcCnPs_T.esm.js → flowCompletionService-BpeAbbXc.esm.js} +24 -3
  134. package/dist/{flowServices-Dmnc8Rye.esm.js → flowServices-rDg1bAMs.esm.js} +393 -13
  135. package/dist/geolocation.d.ts +1 -1
  136. package/dist/geolocation.esm.js +2 -2
  137. package/dist/{geolocationManager-6e1i9UIR.d.ts → geolocationManager-CENrvxpK.d.ts} +4 -3
  138. package/dist/{geolocationManager-BJJ3m_I8.esm.js → geolocationManager-T8m4lqvF.esm.js} +5 -3
  139. package/dist/{geolocationStateMachine-CTI3m4Ie.esm.js → geolocationStateMachine-NWmA1Dtn.esm.js} +5 -5
  140. package/dist/government-validation.d.ts +1 -1
  141. package/dist/government-validation.esm.js +2 -2
  142. package/dist/{governmentValidationManager-CjChjZ3C.esm.js → governmentValidationManager-6JQQkzha.esm.js} +5 -3
  143. package/dist/{governmentValidationManager-B82zOut8.d.ts → governmentValidationManager-De_vU7bm.d.ts} +4 -4
  144. package/dist/{governmentValidationStateMachine-AEbn3Afi.esm.js → governmentValidationStateMachine-wBunpfQ9.esm.js} +3 -3
  145. package/dist/home.d.ts +4 -3
  146. package/dist/home.esm.js +4 -2
  147. package/dist/http.esm.js +1 -1
  148. package/dist/id-ocr.d.ts +2 -2
  149. package/dist/id-ocr.esm.js +3 -19
  150. package/dist/id-selfie-flow.d.ts +6 -5
  151. package/dist/id-selfie-flow.esm.js +12 -11
  152. package/dist/id-verification.d.ts +1 -1
  153. package/dist/id-verification.esm.js +2 -2
  154. package/dist/id.d.ts +3 -3
  155. package/dist/id.esm.js +3 -3
  156. package/dist/{idCaptureDefaults-Dszuq9ng.esm.js → idCaptureDefaults-Cjesf5i9.esm.js} +3 -3
  157. package/dist/{idCaptureManager-B3oR4RnA.esm.js → idCaptureManager-5-ReVgbB.esm.js} +12 -10
  158. package/dist/{idCaptureManager-CCA2D1Ah.d.ts → idCaptureManager-Cqx2y_fC.d.ts} +12 -11
  159. package/dist/{idCaptureServices-DK0QboqT.esm.js → idCaptureServices-exB6I9lV.esm.js} +7 -7
  160. package/dist/{idCaptureStateMachine-zzar9MPy.esm.js → idCaptureStateMachine-DQ14d3GR.esm.js} +51 -21
  161. package/dist/idOcrCpfUtils-D5Gwskxu.esm.js +18 -0
  162. package/dist/{idOcrManager-BTdHlJ9D.d.ts → idOcrManager-C0C7lFGd.d.ts} +6 -5
  163. package/dist/{idOcrManager-xyEZNOBa.esm.js → idOcrManager-im7VfJQi.esm.js} +5 -3
  164. package/dist/{idOcrStateMachine-DNKXh4Rn.esm.js → idOcrStateMachine-B832arAl.esm.js} +10 -9
  165. package/dist/{idVerificationManager-BJapZfpy.d.ts → idVerificationManager-B6R8xNZq.d.ts} +4 -3
  166. package/dist/{idVerificationManager-DdnvYfgN.esm.js → idVerificationManager-PMGM4hXY.esm.js} +5 -3
  167. package/dist/{idVerificationStateMachine-DtIBCa32.esm.js → idVerificationStateMachine-DeeugC00.esm.js} +3 -3
  168. package/dist/identity-reuse.d.ts +2 -2
  169. package/dist/identity-reuse.esm.js +2 -2
  170. package/dist/identity-search.d.ts +97 -0
  171. package/dist/identity-search.esm.js +97 -0
  172. package/dist/{identityReuseManager-ooAbp6Kc.d.ts → identityReuseManager-CZ-qJ_Aa.d.ts} +82 -15
  173. package/dist/{identityReuseManager-CcpovlfD.esm.js → identityReuseManager-CjFZ7WRa.esm.js} +9 -4
  174. package/dist/{identityReuseStateMachine-DxZFWy47.esm.js → identityReuseStateMachine-CLFjPp13.esm.js} +22 -25
  175. package/dist/index-DHuAkTe0.d.ts +1 -0
  176. package/dist/{index-DEfwds5y.d.ts → index-DM43R87x.d.ts} +43 -19
  177. package/dist/{index-DC0P2Vzw.d.ts → index-DxYNO94y.d.ts} +2 -2
  178. package/dist/index.d.ts +1 -1
  179. package/dist/index.esm.js +1 -1
  180. package/dist/{invokeOnCaptureCallback-BJ0GVHGr.esm.js → invokeOnCaptureCallback-lXP41N7b.esm.js} +1 -1
  181. package/dist/kyb-checks.d.ts +1 -1
  182. package/dist/kyb-checks.esm.js +2 -2
  183. package/dist/{kybChecksManager-CblEL97E.d.ts → kybChecksManager-B7Di9auB.d.ts} +3 -3
  184. package/dist/{kybChecksManager-DpGOp4Su.esm.js → kybChecksManager-CZfdCkLC.esm.js} +3 -2
  185. package/dist/{kybChecksStateMachine-B43NAnv7.esm.js → kybChecksStateMachine-DkWxSU4L.esm.js} +9 -7
  186. package/dist/mandatory-consent.d.ts +2 -2
  187. package/dist/mandatory-consent.esm.js +2 -2
  188. package/dist/{mandatoryConsentManager-B88Sm5nd.d.ts → mandatoryConsentManager-Bh1asNJh.d.ts} +24 -14
  189. package/dist/{mandatoryConsentManager-B4vCYslr.esm.js → mandatoryConsentManager-Dh3pBhOe.esm.js} +5 -3
  190. package/dist/{mandatoryConsentStateMachine-DWslYPA3.esm.js → mandatoryConsentStateMachine-BjuI72HZ.esm.js} +13 -7
  191. package/dist/{mediaRecorderOptions-B9-IEVtV.esm.js → mediaRecorderOptions-g1TwTlhd.esm.js} +20 -3
  192. package/dist/{multipartRecordingService-BTqkHGG9.esm.js → multipartRecordingService-WgK8ieRI.esm.js} +2 -2
  193. package/dist/{permissionGuards-DFV-Ws0a.esm.js → permissionGuards-D-4_VU7-.esm.js} +1 -1
  194. package/dist/{permissionServices-D190ATGD.esm.js → permissionServices-DpccEnzE.esm.js} +1 -1
  195. package/dist/phone.d.ts +1 -1
  196. package/dist/phone.esm.js +2 -2
  197. package/dist/phoneFormat-C3q0Ukh4.esm.js +27 -0
  198. package/dist/{phoneManager-6nrJkvkG.d.ts → phoneManager-VO1HEoUZ.d.ts} +3 -3
  199. package/dist/{phoneManager-Dy5tODCU.esm.js → phoneManager-rA7updqF.esm.js} +5 -3
  200. package/dist/{phoneServices-DJgyOzU2.esm.js → phoneServices-CFXcwCFr.esm.js} +1 -1
  201. package/dist/{phoneStateMachine-DnlPhnw7.esm.js → phoneStateMachine-DKdY2Scx.esm.js} +4 -4
  202. package/dist/{processFaceMatch-Bst83HaS.esm.js → processFaceMatch-B_DkDTE5.esm.js} +1 -1
  203. package/dist/qe-signature.d.ts +2 -2
  204. package/dist/qe-signature.esm.js +1 -1
  205. package/dist/{recordingService-CTko6Cjn.esm.js → recordingService-DxiwS8TV.esm.js} +5 -5
  206. package/dist/redirect-to-mobile.d.ts +1 -1
  207. package/dist/redirect-to-mobile.esm.js +2 -2
  208. package/dist/{redirectToMobileManager-CgGaT2NP.esm.js → redirectToMobileManager-DTB_pWuS.esm.js} +6 -4
  209. package/dist/{redirectToMobileManager-Dm9ctRCC.d.ts → redirectToMobileManager-pT6FiPE7.d.ts} +3 -3
  210. package/dist/{redirectToMobileStateMachine-CbhN8uVN.esm.js → redirectToMobileStateMachine-nP9DM01_.esm.js} +4 -4
  211. package/dist/{resolveForm-O7-r79VA.esm.js → resolveForm-DaaQSVWp.esm.js} +8 -213
  212. package/dist/{runChildModule-BffFArwl.esm.js → runChildModule-CXLcOcXN.esm.js} +8 -6
  213. package/dist/{sdkVersion-CDd_gaR7.esm.js → sdkVersion-fqxsdqFZ.esm.js} +1 -1
  214. package/dist/selfie.d.ts +4 -4
  215. package/dist/selfie.esm.js +13 -12
  216. package/dist/{selfieErrorUtils-f4MgAG2A.esm.js → selfieErrorUtils-MOfYdGPz.esm.js} +1 -1
  217. package/dist/{selfieManager-DmZFzs1-.d.ts → selfieManager-DihwheJ6.d.ts} +2 -2
  218. package/dist/{selfieManager-hopelYEk.esm.js → selfieManager-Dq8tIqGd.esm.js} +7 -6
  219. package/dist/{selfieStateMachine-DaZIVv3Q.esm.js → selfieStateMachine-BZVDQB8R.esm.js} +5 -5
  220. package/dist/{session-CdSX4wsZ.esm.js → session-C7x_iJ-p.esm.js} +4 -4
  221. package/dist/session.d.ts +2 -2
  222. package/dist/session.esm.js +5 -5
  223. package/dist/{sessionInitializer-DsL7X2j9.esm.js → sessionInitializer-k-hKIBg8.esm.js} +21 -9
  224. package/dist/{setup-DDahygZs.esm.js → setup-BRbhjHiU.esm.js} +13 -15
  225. package/dist/{setup-D9qt8YVU.d.ts → setup-CpXbdA1X.d.ts} +2 -2
  226. package/dist/signature.d.ts +1 -1
  227. package/dist/signature.esm.js +2 -2
  228. package/dist/{signatureManager-CwqjcxPg.esm.js → signatureManager-BgAja97K.esm.js} +5 -3
  229. package/dist/{signatureManager-BpVt_Jv7.d.ts → signatureManager-daT_8fj_.d.ts} +3 -3
  230. package/dist/{signatureStateMachine-DBVDd1Eu.esm.js → signatureStateMachine-CVPmvU2p.esm.js} +3 -3
  231. package/dist/{spawn-D9jgw9pW.d.ts → spawn-COZKetCS.d.ts} +1 -1
  232. package/dist/{stats-CatA2dea.esm.js → stats-DoByUnTa.esm.js} +1 -1
  233. package/dist/stats.esm.js +1 -1
  234. package/dist/step-up.d.ts +379 -0
  235. package/dist/step-up.esm.js +640 -0
  236. package/dist/{tri-DG6priFa.esm.js → tri-CI2exudk.esm.js} +29 -34
  237. package/dist/tri.d.ts +2 -2
  238. package/dist/tri.esm-CxLWmTZk.esm.js +2287 -0
  239. package/dist/tri.esm.js +2 -2
  240. package/dist/{trueSightService-GuLthUVK.esm.js → trueSightService-DhW2O8mB.esm.js} +7 -4
  241. package/dist/trust-graph.d.ts +4 -3
  242. package/dist/trust-graph.esm.js +5 -3
  243. package/dist/{types-BEVHQbbC.d.ts → types-9wlf1-GE.d.ts} +3 -3
  244. package/dist/types-B-PIc0en.d.ts +115 -0
  245. package/dist/{types-CJ7Yl9K-.d.ts → types-Bpo97EOh.d.ts} +4 -2
  246. package/dist/{types-BQA7lRDV.d.ts → types-C3rfDzgE.d.ts} +4 -2
  247. package/dist/types-CE1jkHw3.d.ts +6 -0
  248. package/dist/{types-BPm1JSu7.d.ts → types-Cpdum4vi.d.ts} +5 -5
  249. package/dist/{types-CuMJ2M7D.d.ts → types-DEa3taWc.d.ts} +8 -1
  250. package/dist/{types-Csh8vzPo.d.ts → types-DFP7eSle.d.ts} +1 -1
  251. package/dist/{types-Cd0J0F9D.d.ts → types-DJPU3W2M.d.ts} +3 -2
  252. package/dist/{events-ggpBBaZ8.esm.js → types-DYYMdAGv.esm.js} +3 -298
  253. package/dist/{types-CRaFu6wS.d.ts → types-Ddc4Tr_f.d.ts} +37 -4
  254. package/dist/{urlUtils-eYiyWjh0.esm.js → urlUtils-B2wagB5v.esm.js} +14 -1
  255. package/dist/usStates-CwOQ2kAx.esm.js +209 -0
  256. package/dist/video-selfie.d.ts +9 -7
  257. package/dist/video-selfie.esm.js +14 -13
  258. package/dist/{videoSelfieCameraWarmer-e3irGfcO.esm.js → videoSelfieCameraWarmer-YwO_uP-b.esm.js} +14 -12
  259. package/dist/{videoSelfieFlowModuleMachine-BCFVHBQ1.esm.js → videoSelfieFlowModuleMachine-IWdxw1TW.esm.js} +1 -1
  260. package/dist/{videoSelfieStepDetector-Dv3Mgws-.d.ts → videoSelfieStepDetector-DRrh4P0A.d.ts} +4 -4
  261. package/dist/{warmup-DtB0DJpl.esm.js → warmup-9iKKNNuW.esm.js} +46 -4
  262. package/dist/{warmup-BO57syF6.d.ts → warmup-BNhIuURi.d.ts} +18 -2
  263. package/dist/wasm.d.ts +9 -3
  264. package/dist/wasm.esm.js +3 -3
  265. package/dist/{wasmDsFlagSync-BtiR5pig.esm.js → wasmDsFlagSync-D_6e8W62.esm.js} +1 -1
  266. package/dist/{wasmWebClient-BDrax6Eu.esm.js → wasmWebClient-C3v3s_4H.esm.js} +22 -10
  267. package/dist/watchlist-for-business.d.ts +1 -1
  268. package/dist/watchlist-for-business.esm.js +2 -2
  269. package/dist/watchlist.d.ts +1 -1
  270. package/dist/watchlist.esm.js +2 -2
  271. package/dist/{watchlistForBusinessManager-DqUpAEj_.esm.js → watchlistForBusinessManager-BH6M4kqA.esm.js} +5 -3
  272. package/dist/{watchlistForBusinessManager-DX2AyM4Y.d.ts → watchlistForBusinessManager-l7ZERQcV.d.ts} +3 -3
  273. package/dist/{watchlistForBusinessStateMachine-DdaPl2PS.esm.js → watchlistForBusinessStateMachine-BMWm5mcP.esm.js} +4 -4
  274. package/dist/{watchlistManager-CdpXzT4B.esm.js → watchlistManager-BDaVjzLW.esm.js} +5 -3
  275. package/dist/{watchlistManager-DJQOd8Pw.d.ts → watchlistManager-DQq4GxBO.d.ts} +3 -3
  276. package/dist/{watchlistStateMachine-ofHW_lPk.esm.js → watchlistStateMachine-Cx-6QAvu.esm.js} +3 -3
  277. package/dist/workflow.d.ts +230 -44
  278. package/dist/workflow.esm.js +171 -67
  279. package/dist/{xstate-actors.esm-8Gzepa_A.esm.js → xstate-actors.esm-BCcwgosu.esm.js} +1 -1
  280. package/dist/xstate.cjs-D6Ur0X1F.d.ts +7 -0
  281. package/dist/{xstate.esm-DSajW7CJ.esm.js → xstate.esm-CIqUf_i6.esm.js} +1 -125
  282. package/package.json +16 -1
  283. package/dist/Actor-DpTj5PFb.d.ts +0 -1
  284. package/dist/cpf-uAZTPUBy.esm.js +0 -61
  285. package/dist/index-DpTj5PFb.d.ts +0 -1
  286. package/dist/nationalIds-B91f_RuB.esm.js +0 -99
  287. package/dist/phoneFormat-JJNaWthV.esm.js +0 -75
  288. package/dist/tri.esm-CzTNi5Q_.esm.js +0 -3826
  289. package/dist/types-J6g6iKe_.d.ts +0 -6
@@ -1,14 +1,15 @@
1
- import { t as getLocalIsoDate } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.js";
2
- import { t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
3
- import { n as loadPhoneValidation, t as getPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
4
- import { i as assign, t as setup } from "./xstate.esm-DSajW7CJ.esm.js";
5
- import { n as fromPromise } from "./xstate-actors.esm-8Gzepa_A.esm.js";
6
- import { a as isValidRut, i as isValidInDrivingLicenseNumber, n as isValidEsDni, r as isValidFiPersonalIdentityCode, t as isValidCurp } from "./nationalIds-B91f_RuB.esm.js";
7
- import { a as usStates, i as usStateOptions, n as checkSupport, r as DYNAMIC_REQUIRED_KEY, t as resolveForm } from "./resolveForm-O7-r79VA.esm.js";
8
- import { a as FIXED_DIGIT_POSTAL_CODE_LENGTH, c as getPostalCodeMaxLength, d as fillFromSuggestion, f as getStreetLevelErrorForSuggestion, i as createBundledDefinitionSource, l as validatePostalCode, n as searchAddress, o as formatPostalCode, r as isFormDefinitionsEnabled, s as getPostalCodeErrorKey, t as debounceSearchActor, u as STREET_LEVEL_REQUIRED_ERROR } from "./addressSearch-DzbE9Ogt.esm.js";
9
- import { C as TAX_ID_SOURCES, S as STREET_SOURCES, _ as MIDDLE_NAME_SOURCES, a as getEKYCFields, b as POSTAL_CODE_SOURCES, c as resolveEkycSource, d as APARTMENT_SOURCES, f as CITY_SOURCES, g as HOUSE_NO_SOURCES, h as EMAIL_SOURCES, i as getEKYCDisplayModes, l as toEkycConfig, m as COUNTRY_SELECTOR_DISABLED_SOURCES, o as isFieldOptional, p as COUNTRY_CODE_OMITTED_SOURCES, r as getEKYCCountry, s as mapToEKYCvalue, t as EKYC_GROUP_KEYS, u as ADDRESS_STATE_SOURCES, v as NAME_SOURCES, w as VOCABULARY, x as STATE_CODE_HINTS, y as ONE_OF_REQUIRED_GROUPS } from "./ekycUtils-GRuMELYr.esm.js";
10
- import { n as DateFormattingProvider, t as validateCPF } from "./cpf-uAZTPUBy.esm.js";
11
- import { a as hasNameCharacters, c as matchesCharTemplate, i as hasDigitCount, n as CHARACTER_CLASSES, o as isInNumericRange, r as hasAllowedCharacters, s as isNotFuture, t as formatPhoneE164 } from "./phoneFormat-JJNaWthV.esm.js";
1
+ import { t as api, u as endpoints } from "./api-CZpuJuZl.esm.js";
2
+ import { t as getPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
3
+ import { i as assign, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
4
+ import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
5
+ import { a as formatPhoneNational, c as oneOfRequiredErrorKey, i as cleanName, l as validateEkycField, n as projectRules, o as formatSSN, s as loadPhoneValidator, t as RULES, u as validateEkycForm } from "./ekycRules-DXP2hqVw.esm.js";
6
+ import { n as usStates, t as usStateOptions } from "./usStates-CwOQ2kAx.esm.js";
7
+ import { a as getPostalCodeMaxLength, c as fillFromSuggestion, l as getStreetLevelErrorForSuggestion, n as formatPostalCode, t as createBundledDefinitionSource, u as keepSuggestedStateInOptions } from "./definitionSource-Nw0YCbpe.esm.js";
8
+ import { n as checkSupport, t as resolveForm } from "./resolveForm-DaaQSVWp.esm.js";
9
+ import { n as searchAddress, r as isFormDefinitionsEnabled, t as debounceSearchActor } from "./addressSearch-Rxm1K67A.esm.js";
10
+ import { C as TAX_ID_SOURCES, S as STREET_SOURCES, _ as MIDDLE_NAME_SOURCES, a as getEKYCFields, b as POSTAL_CODE_SOURCES, c as resolveEkycSource, d as APARTMENT_SOURCES, f as CITY_SOURCES, g as HOUSE_NO_SOURCES, h as EMAIL_SOURCES, i as getEKYCDisplayModes, l as toEkycConfig, m as COUNTRY_SELECTOR_DISABLED_SOURCES, o as isFieldOptional, p as COUNTRY_CODE_OMITTED_SOURCES, r as getEKYCCountry, s as mapToEKYCvalue, t as EKYC_GROUP_KEYS, u as ADDRESS_STATE_SOURCES, v as NAME_SOURCES, w as VOCABULARY, x as STATE_CODE_HINTS, y as ONE_OF_REQUIRED_GROUPS } from "./ekycUtils-FcqA6oU4.esm.js";
11
+ import { t as DateFormattingProvider } from "./DateFormattingProvider-DPq9zco-.esm.js";
12
+ import { t as formatPhoneE164 } from "./phoneFormat-C3q0Ukh4.esm.js";
12
13
  //#region src/internal/forms/resolvePrefill.ts
13
14
  const DISPLAY_MODES = /* @__PURE__ */ new Set([
14
15
  "editable",
@@ -90,238 +91,132 @@ function resolvePrefill(form, context, data, checks) {
90
91
  values
91
92
  };
92
93
  }
93
- //#endregion
94
- //#region src/modules/ekyc/ekycValidators.ts
95
- async function loadPhoneValidator() {
96
- if (!await loadPhoneValidation()) throw new Error("Failed to load the phone validation rules");
97
- }
98
- /** Progressively formats an SSN as XXX-XX-XXXX */
99
- function formatSSN(value) {
100
- const ssn = value?.replace(/\D/g, "") ?? "";
101
- if (ssn.length < 4) return ssn;
102
- if (ssn.length < 6) return `${ssn.slice(0, 3)}-${ssn.slice(3)}`;
103
- return `${ssn.slice(0, 3)}-${ssn.slice(3, 5)}-${ssn.slice(5, 9)}`;
104
- }
105
- /**
106
- * Strips characters a name can't contain, as the user types. Keeps everything
107
- * `nameCharacters` allows (letters from any script with their combining marks,
108
- * spaces, hyphens, and straight or typographic apostrophes), plus the commas
109
- * and acute accents (´) SDKv1 kept, so it never strips a valid name.
110
- */
111
- function cleanName(name) {
112
- return (name ?? "").replace(/[^\p{L}\p{M}\s,'’´-]/gu, "").slice(0, 100);
113
- }
114
- const PO_BOX_REGEX = /POBox|P\.O\.Box|pobox|postofficebox|postbox|po\.box|p\.o\.box/i;
115
- /** Returns true if the address looks like a P.O. Box */
116
- function isPoBox(address) {
117
- return PO_BOX_REGEX.test(address.replace(/\s/g, ""));
118
- }
119
- function validatePhone(phone, country) {
120
- return getPhoneValidation()?.isValid(phone, country) ?? false;
121
- }
122
- /** The phone's national significant number, or the value as typed. */
123
- function formatPhoneNational(phone, country) {
124
- return getPhoneValidation()?.nationalNumber(phone, country) ?? phone;
125
- }
126
- /** The error key a `oneOfRequired` group shows: its own message, or DOB-or-SSN. */
127
- const oneOfRequiredErrorKey = (rule) => rule.message ?? "verification.errors.dobOrSsnRequired";
128
- const PHONE_INVALID_KEY = "verification.errors.phoneInvalid";
129
- const INVALID_ID_NUMBER_KEY = "verification.errors.invalidIdNumber";
130
- /** The digitCount message: one length, a list of lengths, or a range. */
131
- const digitCountError = (rule) => {
132
- if (rule.lengths?.length === 1) return {
133
- key: "verification.errors.exactDigits",
134
- params: { length: rule.lengths[0] }
135
- };
136
- if (rule.lengths) return {
137
- key: "verification.errors.digitsOneOf",
138
- params: { lengths: rule.lengths }
139
- };
140
- return {
141
- key: "verification.errors.digitsBetween",
142
- params: {
143
- min: rule.min ?? 0,
144
- max: rule.max ?? 0
145
- }
146
- };
147
- };
148
- /**
149
- * A national ID check: blank passes, anything else must satisfy `isValid`.
150
- * The error is the vocabulary's message for these rules; a definition names
151
- * its own with the rule's `message`.
152
- */
153
- const idNumberValidator = (isValid) => (value) => {
154
- if (value.trim().length === 0) return void 0;
155
- if (isValid(value)) return void 0;
156
- return { key: INVALID_ID_NUMBER_KEY };
157
- };
158
- const normalizeFieldValue = (value) => typeof value === "string" ? value : String(value ?? "");
159
- const SSN_FORMAT_REGEX = /^\d{3}-\d{2}-\d{4}$/;
160
- const EMAIL_FORMAT_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
161
- const buildPostalCodeParams = (country) => {
162
- const fixedLen = FIXED_DIGIT_POSTAL_CODE_LENGTH[country];
163
- if (fixedLen !== void 0) return { length: fixedLen };
164
- let maxLen = getPostalCodeMaxLength(country);
165
- if (country === "US" || country === "BR") maxLen = maxLen - 1;
166
- return { maxLength: maxLen };
167
- };
168
- const requiredError = (field) => {
169
- const fieldName = field.displayLabel ?? field.label;
170
- return fieldName ? {
171
- key: DYNAMIC_REQUIRED_KEY,
172
- params: { fieldName }
173
- } : { key: DYNAMIC_REQUIRED_KEY };
174
- };
175
- const isFilled = (values, name) => normalizeFieldValue(values[name]).trim().length > 0;
176
- const createValidators = () => {
177
- const validators = {
178
- required: (value, _rule, field) => {
179
- if (value.trim().length > 0) return void 0;
180
- return requiredError(field);
181
- },
182
- requiredIfFilled: (value, rule, field, values) => {
183
- if (rule.type !== "requiredIfFilled") return void 0;
184
- if (value.trim().length > 0) return void 0;
185
- return rule.fields.some((name) => isFilled(values, name)) ? requiredError(field) : void 0;
186
- },
187
- rulesByOption: (value, rule, field, values) => {
188
- if (rule.type !== "rulesByOption") return void 0;
189
- if (value.trim().length === 0) return void 0;
190
- const option = normalizeFieldValue(values[rule.selector]).trim();
191
- const rules = Object.prototype.hasOwnProperty.call(rule.cases, option) ? rule.cases[option] : void 0;
192
- return evaluateRules(value, rules, field, values, validators);
193
- },
194
- streetLevelRequired: (value) => {
195
- if (value.trim().length > 0) return void 0;
196
- return STREET_LEVEL_REQUIRED_ERROR;
197
- },
198
- cpf: (value) => {
199
- if (value.trim().length === 0) return void 0;
200
- return validateCPF(value) ? void 0 : { key: "verification.errors.invalidTaxId" };
201
- },
202
- ssnFormat: (value) => {
203
- if (value.trim().length === 0) return void 0;
204
- return SSN_FORMAT_REGEX.test(value) ? void 0 : { key: "verification.errors.ssnFormat" };
205
- },
206
- noPoBox: (value) => {
207
- if (value.trim().length === 0) return void 0;
208
- return isPoBox(value) ? { key: "verification.errors.poBox" } : void 0;
209
- },
210
- postalCodeFormat: (value, rule) => {
211
- if (rule.type !== "postalCodeFormat") return void 0;
212
- if (value.trim().length === 0) return void 0;
213
- if (validatePostalCode(value, rule.country)) return void 0;
214
- return {
215
- key: getPostalCodeErrorKey(rule.country),
216
- params: buildPostalCodeParams(rule.country)
217
- };
218
- },
219
- phoneFormat: (value, rule) => {
220
- if (rule.type !== "phoneFormat") return void 0;
221
- const trimmed = value.trim();
222
- if (rule.optional && trimmed.length === 0) return void 0;
223
- return validatePhone(trimmed, rule.country) ? void 0 : { key: "verification.errors.phoneInvalid" };
224
- },
225
- emailFormat: (value) => {
226
- if (value.trim().length === 0) return void 0;
227
- return EMAIL_FORMAT_REGEX.test(value) ? void 0 : { key: "verification.errors.emailInvalid" };
228
- },
229
- exactLength: (value, rule) => {
230
- if (rule.type !== "exactLength") return void 0;
231
- if (value.trim().length === 0) return void 0;
232
- return value.length === rule.length ? void 0 : { key: "verification.errors.exactly10Characters" };
233
- },
234
- nameCharacters: (value) => {
235
- if (value.trim().length === 0) return void 0;
236
- return hasNameCharacters(value.trim()) ? void 0 : { key: "verification.errors.nameCharacters" };
237
- },
238
- notFuture: (value) => {
239
- if (value.trim().length === 0) return void 0;
240
- return isNotFuture(value.trim(), getLocalIsoDate()) ? void 0 : { key: "verification.errors.futureDate" };
241
- },
242
- phoneDigits: (value, rule) => {
243
- if (rule.type !== "phoneDigits") return void 0;
244
- const trimmed = value.trim();
245
- if (trimmed.length === 0) return void 0;
246
- const national = getPhoneValidation()?.nationalNumber(trimmed, rule.country);
247
- if (!national) return { key: PHONE_INVALID_KEY };
248
- return national.length >= rule.min && national.length <= rule.max ? void 0 : { key: PHONE_INVALID_KEY };
249
- },
250
- digitCount: (value, rule) => {
251
- if (rule.type !== "digitCount") return void 0;
252
- if (value.trim().length === 0) return void 0;
253
- return hasDigitCount(value.trim(), rule) ? void 0 : digitCountError(rule);
254
- },
255
- allowedCharacters: (value, rule) => {
256
- if (rule.type !== "allowedCharacters") return void 0;
257
- if (value.trim().length === 0) return void 0;
258
- return hasAllowedCharacters(value.trim(), rule.classes, rule.extra) ? void 0 : { key: "verification.errors.invalidCharacters" };
259
- },
260
- charTemplate: (value, rule) => {
261
- if (rule.type !== "charTemplate") return void 0;
262
- if (value.trim().length === 0) return void 0;
263
- return matchesCharTemplate(value.trim(), rule.templates, rule.ignoreCase) ? void 0 : { key: "verification.errors.invalidFormat" };
264
- },
265
- numericRange: (value, rule) => {
266
- if (rule.type !== "numericRange") return void 0;
267
- if (value.trim().length === 0) return void 0;
268
- return isInNumericRange(value.trim(), rule.min, rule.max) ? void 0 : {
269
- key: "verification.errors.numberBetween",
270
- params: {
271
- min: rule.min,
272
- max: rule.max
273
- }
274
- };
275
- },
276
- rut: idNumberValidator(isValidRut),
277
- esDni: idNumberValidator(isValidEsDni),
278
- fiPersonalIdentityCode: idNumberValidator(isValidFiPersonalIdentityCode),
279
- inDrivingLicenseNumber: idNumberValidator(isValidInDrivingLicenseNumber),
280
- curp: idNumberValidator((value) => isValidCurp(value.trim())),
281
- oneOfRequired: (_value, rule, _field, values) => {
282
- if (rule.type !== "oneOfRequired") return void 0;
283
- return rule.fields.some((name) => isFilled(values, name)) ? void 0 : { key: oneOfRequiredErrorKey(rule) };
284
- }
285
- };
286
- return validators;
287
- };
288
- /**
289
- * A rule's own message key shows instead of the validator's, keeping its
290
- * params. `oneOfRequired` already shows its message.
291
- */
292
- const withRuleMessage = (error, rule) => !rule.message || error.key === rule.message ? error : {
293
- ...error,
294
- key: rule.message
295
- };
296
- const evaluateRules = (value, rules, field, values, validators) => {
297
- if (!rules) return void 0;
298
- for (const rule of rules) {
299
- const error = validators[rule.type](value, rule, field, values);
300
- if (error) return withRuleMessage(error, rule);
94
+ const brStateOptions = Object.values({
95
+ AC: {
96
+ code: "AC",
97
+ name: "Acre"
98
+ },
99
+ AL: {
100
+ code: "AL",
101
+ name: "Alagoas"
102
+ },
103
+ AP: {
104
+ code: "AP",
105
+ name: "Amapá"
106
+ },
107
+ AM: {
108
+ code: "AM",
109
+ name: "Amazonas"
110
+ },
111
+ BA: {
112
+ code: "BA",
113
+ name: "Bahia"
114
+ },
115
+ CE: {
116
+ code: "CE",
117
+ name: "Ceará"
118
+ },
119
+ DF: {
120
+ code: "DF",
121
+ name: "Distrito Federal"
122
+ },
123
+ ES: {
124
+ code: "ES",
125
+ name: "Espírito Santo"
126
+ },
127
+ GO: {
128
+ code: "GO",
129
+ name: "Goiás"
130
+ },
131
+ MA: {
132
+ code: "MA",
133
+ name: "Maranhão"
134
+ },
135
+ MT: {
136
+ code: "MT",
137
+ name: "Mato Grosso"
138
+ },
139
+ MS: {
140
+ code: "MS",
141
+ name: "Mato Grosso do Sul"
142
+ },
143
+ MG: {
144
+ code: "MG",
145
+ name: "Minas Gerais"
146
+ },
147
+ PA: {
148
+ code: "PA",
149
+ name: "Pará"
150
+ },
151
+ PB: {
152
+ code: "PB",
153
+ name: "Paraíba"
154
+ },
155
+ PR: {
156
+ code: "PR",
157
+ name: "Paraná"
158
+ },
159
+ PE: {
160
+ code: "PE",
161
+ name: "Pernambuco"
162
+ },
163
+ PI: {
164
+ code: "PI",
165
+ name: "Piauí"
166
+ },
167
+ RJ: {
168
+ code: "RJ",
169
+ name: "Rio de Janeiro"
170
+ },
171
+ RN: {
172
+ code: "RN",
173
+ name: "Rio Grande do Norte"
174
+ },
175
+ RS: {
176
+ code: "RS",
177
+ name: "Rio Grande do Sul"
178
+ },
179
+ RO: {
180
+ code: "RO",
181
+ name: "Rondônia"
182
+ },
183
+ RR: {
184
+ code: "RR",
185
+ name: "Roraima"
186
+ },
187
+ SC: {
188
+ code: "SC",
189
+ name: "Santa Catarina"
190
+ },
191
+ SP: {
192
+ code: "SP",
193
+ name: "São Paulo"
194
+ },
195
+ SE: {
196
+ code: "SE",
197
+ name: "Sergipe"
198
+ },
199
+ TO: {
200
+ code: "TO",
201
+ name: "Tocantins"
301
202
  }
302
- };
303
- function validateEkycForm(values, fields) {
304
- const validators = createValidators();
305
- return fields.reduce((errors, field) => {
306
- const value = normalizeFieldValue(values[field.name]);
307
- const error = evaluateRules(value, field.validation, field, values, validators);
308
- if (error) errors[field.name] = error;
309
- return errors;
310
- }, {});
311
- }
312
- function validateEkycField(values, fieldName, fields) {
313
- const field = fields.find((f) => f.name === fieldName);
314
- if (!field) return void 0;
315
- const validators = createValidators();
316
- const value = normalizeFieldValue(values[field.name]);
317
- return evaluateRules(value, field.validation, field, values, validators);
318
- }
203
+ }).map((state) => ({
204
+ value: state.code,
205
+ label: state.name
206
+ }));
207
+ //#endregion
208
+ //#region src/shared/validators/textRules.ts
209
+ const CHARACTER_CLASSES = [
210
+ "letter",
211
+ "digit",
212
+ "space"
213
+ ];
319
214
  //#endregion
320
215
  //#region ../form-definitions/generated/ekyc.ts
321
216
  const EKYC_DEFINITIONS = {
322
217
  "ekyc/AR/AR_CREDIT_BUR_1": {
323
218
  schemaVersion: 1,
324
- vocabulary: "1.2",
219
+ vocabulary: "1.3",
325
220
  id: "ekyc/AR/AR_CREDIT_BUR_1",
326
221
  module: "ekyc",
327
222
  country: "AR",
@@ -376,7 +271,10 @@ const EKYC_DEFINITIONS = {
376
271
  required: true,
377
272
  label: { key: "verification.labels.dateOfBirth" },
378
273
  input: { autofill: "birthday" },
379
- rules: [{ id: "notFuture" }],
274
+ rules: [{
275
+ id: "maxAge",
276
+ params: { years: 120 }
277
+ }, { id: "notFuture" }],
380
278
  prefill: ["document.birthDate"]
381
279
  },
382
280
  {
@@ -423,6 +321,7 @@ const EKYC_DEFINITIONS = {
423
321
  id: "digitCount",
424
322
  params: { lengths: [8] }
425
323
  }],
324
+ payload: { key: "idNumber" },
426
325
  prefill: ["document.documentNumber"]
427
326
  },
428
327
  {
@@ -438,6 +337,7 @@ const EKYC_DEFINITIONS = {
438
337
  id: "digitCount",
439
338
  params: { lengths: [11] }
440
339
  }],
340
+ payload: { key: "idNumber1" },
441
341
  prefill: ["document.personalNumber"]
442
342
  },
443
343
  {
@@ -524,7 +424,7 @@ const EKYC_DEFINITIONS = {
524
424
  },
525
425
  "ekyc/AR/AR_RES_REGISTER": {
526
426
  schemaVersion: 1,
527
- vocabulary: "1.2",
427
+ vocabulary: "1.3",
528
428
  id: "ekyc/AR/AR_RES_REGISTER",
529
429
  module: "ekyc",
530
430
  country: "AR",
@@ -578,7 +478,10 @@ const EKYC_DEFINITIONS = {
578
478
  group: "dateOfBirth",
579
479
  label: { key: "verification.labels.dateOfBirth" },
580
480
  input: { autofill: "birthday" },
581
- rules: [{ id: "notFuture" }],
481
+ rules: [{
482
+ id: "maxAge",
483
+ params: { years: 120 }
484
+ }, { id: "notFuture" }],
582
485
  prefill: ["document.birthDate"]
583
486
  },
584
487
  {
@@ -692,7 +595,7 @@ const EKYC_DEFINITIONS = {
692
595
  },
693
596
  "ekyc/BE/BE_CREDIT_TELCO": {
694
597
  schemaVersion: 1,
695
- vocabulary: "1.2",
598
+ vocabulary: "1.3",
696
599
  id: "ekyc/BE/BE_CREDIT_TELCO",
697
600
  module: "ekyc",
698
601
  country: "BE",
@@ -733,7 +636,10 @@ const EKYC_DEFINITIONS = {
733
636
  group: "dateOfBirth",
734
637
  label: { key: "verification.labels.dateOfBirth" },
735
638
  input: { autofill: "birthday" },
736
- rules: [{ id: "notFuture" }],
639
+ rules: [{
640
+ id: "maxAge",
641
+ params: { years: 120 }
642
+ }, { id: "notFuture" }],
737
643
  prefill: ["document.birthDate"]
738
644
  },
739
645
  {
@@ -852,7 +758,7 @@ const EKYC_DEFINITIONS = {
852
758
  },
853
759
  "ekyc/BR/BR_GOVT_1": {
854
760
  schemaVersion: 1,
855
- vocabulary: "1.2",
761
+ vocabulary: "1.3",
856
762
  id: "ekyc/BR/BR_GOVT_1",
857
763
  module: "ekyc",
858
764
  country: "BR",
@@ -894,7 +800,10 @@ const EKYC_DEFINITIONS = {
894
800
  required: true,
895
801
  label: { key: "verification.labels.dateOfBirth" },
896
802
  input: { autofill: "birthday" },
897
- rules: [{ id: "notFuture" }],
803
+ rules: [{
804
+ id: "maxAge",
805
+ params: { years: 120 }
806
+ }, { id: "notFuture" }],
898
807
  prefill: ["document.birthDate"]
899
808
  },
900
809
  {
@@ -947,7 +856,7 @@ const EKYC_DEFINITIONS = {
947
856
  label: { key: "verification.labels.brazilian" }
948
857
  },
949
858
  {
950
- value: "naturalizedBrazilian",
859
+ value: "naturalized_brazilian",
951
860
  label: { key: "verification.labels.naturalizedBrazilian" }
952
861
  },
953
862
  {
@@ -955,7 +864,7 @@ const EKYC_DEFINITIONS = {
955
864
  label: { key: "verification.labels.foreigner" }
956
865
  },
957
866
  {
958
- value: "brazilianBornAbroad",
867
+ value: "brazilian_born_abroad",
959
868
  label: { key: "verification.labels.brazilianBornAbroad" }
960
869
  }
961
870
  ],
@@ -991,15 +900,14 @@ const EKYC_DEFINITIONS = {
991
900
  },
992
901
  {
993
902
  name: "state",
994
- kind: "text",
903
+ kind: "choice",
995
904
  group: "address",
996
905
  section: "address",
997
- label: { key: "verification.labels.state" },
998
- placeholder: {
999
- key: "verification.placeholder.stateCode",
1000
- params: { states: "RJ, SP" }
1001
- },
906
+ widget: "select",
907
+ label: { key: "verification.labels.chooseState" },
908
+ placeholder: { key: "verification.placeholder.state" },
1002
909
  input: { autofill: "addressLevel1" },
910
+ optionsRef: "BR_STATES",
1003
911
  payload: { transforms: [{ id: "uppercase" }] },
1004
912
  prefill: ["document.state", "poa.state"]
1005
913
  },
@@ -1031,7 +939,7 @@ const EKYC_DEFINITIONS = {
1031
939
  },
1032
940
  "ekyc/BR/BR_TAX_PHONE_REGISTER": {
1033
941
  schemaVersion: 1,
1034
- vocabulary: "1.2",
942
+ vocabulary: "1.3",
1035
943
  id: "ekyc/BR/BR_TAX_PHONE_REGISTER",
1036
944
  module: "ekyc",
1037
945
  country: "BR",
@@ -1085,7 +993,10 @@ const EKYC_DEFINITIONS = {
1085
993
  group: "dateOfBirth",
1086
994
  label: { key: "verification.labels.dateOfBirth" },
1087
995
  input: { autofill: "birthday" },
1088
- rules: [{ id: "notFuture" }],
996
+ rules: [{
997
+ id: "maxAge",
998
+ params: { years: 120 }
999
+ }, { id: "notFuture" }],
1089
1000
  prefill: ["document.birthDate"]
1090
1001
  },
1091
1002
  {
@@ -1174,15 +1085,14 @@ const EKYC_DEFINITIONS = {
1174
1085
  },
1175
1086
  {
1176
1087
  name: "state",
1177
- kind: "text",
1088
+ kind: "choice",
1178
1089
  group: "address",
1179
1090
  section: "address",
1180
- label: { key: "verification.labels.state" },
1181
- placeholder: {
1182
- key: "verification.placeholder.stateCode",
1183
- params: { states: "RJ, SP" }
1184
- },
1091
+ widget: "select",
1092
+ label: { key: "verification.labels.chooseState" },
1093
+ placeholder: { key: "verification.placeholder.state" },
1185
1094
  input: { autofill: "addressLevel1" },
1095
+ optionsRef: "BR_STATES",
1186
1096
  payload: { transforms: [{ id: "uppercase" }] },
1187
1097
  prefill: ["document.state", "poa.state"]
1188
1098
  },
@@ -1214,7 +1124,7 @@ const EKYC_DEFINITIONS = {
1214
1124
  },
1215
1125
  "ekyc/CA/CA_CREDIT_FINTRAC": {
1216
1126
  schemaVersion: 1,
1217
- vocabulary: "1.2",
1127
+ vocabulary: "1.3",
1218
1128
  id: "ekyc/CA/CA_CREDIT_FINTRAC",
1219
1129
  module: "ekyc",
1220
1130
  country: "CA",
@@ -1269,7 +1179,10 @@ const EKYC_DEFINITIONS = {
1269
1179
  required: true,
1270
1180
  label: { key: "verification.labels.dateOfBirth" },
1271
1181
  input: { autofill: "birthday" },
1272
- rules: [{ id: "notFuture" }],
1182
+ rules: [{
1183
+ id: "maxAge",
1184
+ params: { years: 120 }
1185
+ }, { id: "notFuture" }],
1273
1186
  prefill: ["document.birthDate"]
1274
1187
  },
1275
1188
  {
@@ -1373,7 +1286,7 @@ const EKYC_DEFINITIONS = {
1373
1286
  },
1374
1287
  "ekyc/CA/CA_RES_CREDIT": {
1375
1288
  schemaVersion: 1,
1376
- vocabulary: "1.2",
1289
+ vocabulary: "1.3",
1377
1290
  id: "ekyc/CA/CA_RES_CREDIT",
1378
1291
  module: "ekyc",
1379
1292
  country: "CA",
@@ -1428,7 +1341,10 @@ const EKYC_DEFINITIONS = {
1428
1341
  required: true,
1429
1342
  label: { key: "verification.labels.dateOfBirth" },
1430
1343
  input: { autofill: "birthday" },
1431
- rules: [{ id: "notFuture" }],
1344
+ rules: [{
1345
+ id: "maxAge",
1346
+ params: { years: 120 }
1347
+ }, { id: "notFuture" }],
1432
1348
  prefill: ["document.birthDate"]
1433
1349
  },
1434
1350
  {
@@ -1551,7 +1467,7 @@ const EKYC_DEFINITIONS = {
1551
1467
  },
1552
1468
  "ekyc/CA/CA_TELCO": {
1553
1469
  schemaVersion: 1,
1554
- vocabulary: "1.2",
1470
+ vocabulary: "1.3",
1555
1471
  id: "ekyc/CA/CA_TELCO",
1556
1472
  module: "ekyc",
1557
1473
  country: "CA",
@@ -1593,7 +1509,10 @@ const EKYC_DEFINITIONS = {
1593
1509
  required: true,
1594
1510
  label: { key: "verification.labels.dateOfBirth" },
1595
1511
  input: { autofill: "birthday" },
1596
- rules: [{ id: "notFuture" }],
1512
+ rules: [{
1513
+ id: "maxAge",
1514
+ params: { years: 120 }
1515
+ }, { id: "notFuture" }],
1597
1516
  prefill: ["document.birthDate"]
1598
1517
  },
1599
1518
  {
@@ -1639,14 +1558,6 @@ const EKYC_DEFINITIONS = {
1639
1558
  rules: [{ id: "noPoBox" }],
1640
1559
  prefill: ["document.street", "poa.street"]
1641
1560
  },
1642
- {
1643
- name: "houseNo",
1644
- kind: "text",
1645
- group: "address",
1646
- section: "address",
1647
- label: { key: "verification.labels.houseNo" },
1648
- prefill: ["document.houseNumber", "poa.houseNumber"]
1649
- },
1650
1561
  {
1651
1562
  name: "city",
1652
1563
  kind: "text",
@@ -1768,6 +1679,7 @@ const EKYC_DEFINITIONS = {
1768
1679
  format: [{ id: "stripSeparators" }, { id: "uppercase" }]
1769
1680
  },
1770
1681
  rules: [{ id: "rut" }],
1682
+ payload: { key: "idNumber" },
1771
1683
  prefill: ["document.documentNumber"]
1772
1684
  }
1773
1685
  ],
@@ -1781,7 +1693,7 @@ const EKYC_DEFINITIONS = {
1781
1693
  },
1782
1694
  "ekyc/CO/CO_CIVIL_REGISTER_1": {
1783
1695
  schemaVersion: 1,
1784
- vocabulary: "1.2",
1696
+ vocabulary: "1.3",
1785
1697
  id: "ekyc/CO/CO_CIVIL_REGISTER_1",
1786
1698
  module: "ekyc",
1787
1699
  country: "CO",
@@ -1838,7 +1750,10 @@ const EKYC_DEFINITIONS = {
1838
1750
  group: "dateOfBirth",
1839
1751
  label: { key: "verification.labels.dateOfBirth" },
1840
1752
  input: { autofill: "birthday" },
1841
- rules: [{ id: "notFuture" }],
1753
+ rules: [{
1754
+ id: "maxAge",
1755
+ params: { years: 120 }
1756
+ }, { id: "notFuture" }],
1842
1757
  prefill: ["document.birthDate"]
1843
1758
  },
1844
1759
  {
@@ -1881,6 +1796,7 @@ const EKYC_DEFINITIONS = {
1881
1796
  id: "digitCount",
1882
1797
  params: { lengths: [8, 10] }
1883
1798
  }],
1799
+ payload: { key: "idNumber" },
1884
1800
  prefill: ["document.documentNumber"]
1885
1801
  },
1886
1802
  {
@@ -1917,7 +1833,7 @@ const EKYC_DEFINITIONS = {
1917
1833
  },
1918
1834
  "ekyc/DE/DE_PHONE_MOBILE_REGISTER": {
1919
1835
  schemaVersion: 1,
1920
- vocabulary: "1.2",
1836
+ vocabulary: "1.3",
1921
1837
  id: "ekyc/DE/DE_PHONE_MOBILE_REGISTER",
1922
1838
  module: "ekyc",
1923
1839
  country: "DE",
@@ -1971,7 +1887,10 @@ const EKYC_DEFINITIONS = {
1971
1887
  group: "dateOfBirth",
1972
1888
  label: { key: "verification.labels.dateOfBirth" },
1973
1889
  input: { autofill: "birthday" },
1974
- rules: [{ id: "notFuture" }],
1890
+ rules: [{
1891
+ id: "maxAge",
1892
+ params: { years: 120 }
1893
+ }, { id: "notFuture" }],
1975
1894
  prefill: ["document.birthDate"]
1976
1895
  },
1977
1896
  {
@@ -2061,7 +1980,7 @@ const EKYC_DEFINITIONS = {
2061
1980
  },
2062
1981
  "ekyc/DK/DK_CIVIL_REG_CREDIT_TELCO": {
2063
1982
  schemaVersion: 1,
2064
- vocabulary: "1.2",
1983
+ vocabulary: "1.3",
2065
1984
  id: "ekyc/DK/DK_CIVIL_REG_CREDIT_TELCO",
2066
1985
  module: "ekyc",
2067
1986
  country: "DK",
@@ -2102,7 +2021,10 @@ const EKYC_DEFINITIONS = {
2102
2021
  group: "dateOfBirth",
2103
2022
  label: { key: "verification.labels.dateOfBirth" },
2104
2023
  input: { autofill: "birthday" },
2105
- rules: [{ id: "notFuture" }],
2024
+ rules: [{
2025
+ id: "maxAge",
2026
+ params: { years: 120 }
2027
+ }, { id: "notFuture" }],
2106
2028
  prefill: ["document.birthDate"]
2107
2029
  },
2108
2030
  {
@@ -2185,7 +2107,7 @@ const EKYC_DEFINITIONS = {
2185
2107
  },
2186
2108
  "ekyc/ES/ES_PHONE_REGISTER_2": {
2187
2109
  schemaVersion: 1,
2188
- vocabulary: "1.2",
2110
+ vocabulary: "1.3",
2189
2111
  id: "ekyc/ES/ES_PHONE_REGISTER_2",
2190
2112
  module: "ekyc",
2191
2113
  country: "ES",
@@ -2239,7 +2161,10 @@ const EKYC_DEFINITIONS = {
2239
2161
  group: "dateOfBirth",
2240
2162
  label: { key: "verification.labels.dateOfBirth" },
2241
2163
  input: { autofill: "birthday" },
2242
- rules: [{ id: "notFuture" }],
2164
+ rules: [{
2165
+ id: "maxAge",
2166
+ params: { years: 120 }
2167
+ }, { id: "notFuture" }],
2243
2168
  prefill: ["document.birthDate"]
2244
2169
  },
2245
2170
  {
@@ -2284,6 +2209,7 @@ const EKYC_DEFINITIONS = {
2284
2209
  format: [{ id: "stripSeparators" }, { id: "uppercase" }]
2285
2210
  },
2286
2211
  rules: [{ id: "esDni" }],
2212
+ payload: { key: "idNumber" },
2287
2213
  prefill: ["document.documentNumber"]
2288
2214
  },
2289
2215
  {
@@ -2360,7 +2286,7 @@ const EKYC_DEFINITIONS = {
2360
2286
  },
2361
2287
  "ekyc/FI/FI_CONSUMER_POP_REG_TELCO": {
2362
2288
  schemaVersion: 1,
2363
- vocabulary: "1.2",
2289
+ vocabulary: "1.3",
2364
2290
  id: "ekyc/FI/FI_CONSUMER_POP_REG_TELCO",
2365
2291
  module: "ekyc",
2366
2292
  country: "FI",
@@ -2401,7 +2327,10 @@ const EKYC_DEFINITIONS = {
2401
2327
  group: "dateOfBirth",
2402
2328
  label: { key: "verification.labels.dateOfBirth" },
2403
2329
  input: { autofill: "birthday" },
2404
- rules: [{ id: "notFuture" }],
2330
+ rules: [{
2331
+ id: "maxAge",
2332
+ params: { years: 120 }
2333
+ }, { id: "notFuture" }],
2405
2334
  prefill: ["document.birthDate"]
2406
2335
  },
2407
2336
  {
@@ -2509,7 +2438,7 @@ const EKYC_DEFINITIONS = {
2509
2438
  },
2510
2439
  "ekyc/FI/FI_NATIONAL_ID": {
2511
2440
  schemaVersion: 1,
2512
- vocabulary: "1.2",
2441
+ vocabulary: "1.3",
2513
2442
  id: "ekyc/FI/FI_NATIONAL_ID",
2514
2443
  module: "ekyc",
2515
2444
  country: "FI",
@@ -2551,7 +2480,10 @@ const EKYC_DEFINITIONS = {
2551
2480
  required: true,
2552
2481
  label: { key: "verification.labels.dateOfBirth" },
2553
2482
  input: { autofill: "birthday" },
2554
- rules: [{ id: "notFuture" }],
2483
+ rules: [{
2484
+ id: "maxAge",
2485
+ params: { years: 120 }
2486
+ }, { id: "notFuture" }],
2555
2487
  prefill: ["document.birthDate"]
2556
2488
  },
2557
2489
  {
@@ -2588,6 +2520,7 @@ const EKYC_DEFINITIONS = {
2588
2520
  label: { key: "verification.labels.idNum" },
2589
2521
  input: { maxLength: 11 },
2590
2522
  rules: [{ id: "fiPersonalIdentityCode" }],
2523
+ payload: { key: "idNumber" },
2591
2524
  prefill: ["document.documentNumber"]
2592
2525
  },
2593
2526
  {
@@ -2656,7 +2589,7 @@ const EKYC_DEFINITIONS = {
2656
2589
  },
2657
2590
  "ekyc/GB/GB_2X2": {
2658
2591
  schemaVersion: 1,
2659
- vocabulary: "1.2",
2592
+ vocabulary: "1.3",
2660
2593
  id: "ekyc/GB/GB_2X2",
2661
2594
  module: "ekyc",
2662
2595
  country: "GB",
@@ -2698,7 +2631,10 @@ const EKYC_DEFINITIONS = {
2698
2631
  required: true,
2699
2632
  label: { key: "verification.labels.dateOfBirth" },
2700
2633
  input: { autofill: "birthday" },
2701
- rules: [{ id: "notFuture" }],
2634
+ rules: [{
2635
+ id: "maxAge",
2636
+ params: { years: 120 }
2637
+ }, { id: "notFuture" }],
2702
2638
  prefill: ["document.birthDate"]
2703
2639
  },
2704
2640
  {
@@ -2808,7 +2744,7 @@ const EKYC_DEFINITIONS = {
2808
2744
  },
2809
2745
  "ekyc/GB/UK_VOTER_REGISTER": {
2810
2746
  schemaVersion: 1,
2811
- vocabulary: "1.2",
2747
+ vocabulary: "1.3",
2812
2748
  id: "ekyc/GB/UK_VOTER_REGISTER",
2813
2749
  module: "ekyc",
2814
2750
  country: "GB",
@@ -2862,7 +2798,10 @@ const EKYC_DEFINITIONS = {
2862
2798
  group: "dateOfBirth",
2863
2799
  label: { key: "verification.labels.dateOfBirth" },
2864
2800
  input: { autofill: "birthday" },
2865
- rules: [{ id: "notFuture" }],
2801
+ rules: [{
2802
+ id: "maxAge",
2803
+ params: { years: 120 }
2804
+ }, { id: "notFuture" }],
2866
2805
  prefill: ["document.birthDate"]
2867
2806
  },
2868
2807
  {
@@ -2966,7 +2905,7 @@ const EKYC_DEFINITIONS = {
2966
2905
  },
2967
2906
  "ekyc/GR/GR_1": {
2968
2907
  schemaVersion: 1,
2969
- vocabulary: "1.2",
2908
+ vocabulary: "1.3",
2970
2909
  id: "ekyc/GR/GR_1",
2971
2910
  module: "ekyc",
2972
2911
  country: "GR",
@@ -3020,7 +2959,10 @@ const EKYC_DEFINITIONS = {
3020
2959
  group: "dateOfBirth",
3021
2960
  label: { key: "verification.labels.dateOfBirth" },
3022
2961
  input: { autofill: "birthday" },
3023
- rules: [{ id: "notFuture" }],
2962
+ rules: [{
2963
+ id: "maxAge",
2964
+ params: { years: 120 }
2965
+ }, { id: "notFuture" }],
3024
2966
  prefill: ["document.birthDate"]
3025
2967
  },
3026
2968
  {
@@ -3068,6 +3010,7 @@ const EKYC_DEFINITIONS = {
3068
3010
  id: "digitCount",
3069
3011
  params: { lengths: [9] }
3070
3012
  }],
3013
+ payload: { key: "idNumber" },
3071
3014
  prefill: ["document.documentNumber"]
3072
3015
  },
3073
3016
  {
@@ -3159,7 +3102,7 @@ const EKYC_DEFINITIONS = {
3159
3102
  },
3160
3103
  "ekyc/GT/GT_1": {
3161
3104
  schemaVersion: 1,
3162
- vocabulary: "1.2",
3105
+ vocabulary: "1.3",
3163
3106
  id: "ekyc/GT/GT_1",
3164
3107
  module: "ekyc",
3165
3108
  country: "GT",
@@ -3198,7 +3141,10 @@ const EKYC_DEFINITIONS = {
3198
3141
  required: true,
3199
3142
  label: { key: "verification.labels.dateOfBirth" },
3200
3143
  input: { autofill: "birthday" },
3201
- rules: [{ id: "notFuture" }],
3144
+ rules: [{
3145
+ id: "maxAge",
3146
+ params: { years: 120 }
3147
+ }, { id: "notFuture" }],
3202
3148
  prefill: ["document.birthDate"]
3203
3149
  },
3204
3150
  {
@@ -3241,6 +3187,7 @@ const EKYC_DEFINITIONS = {
3241
3187
  id: "digitCount",
3242
3188
  params: { lengths: [13] }
3243
3189
  }],
3190
+ payload: { key: "idNumber" },
3244
3191
  prefill: ["document.documentNumber"]
3245
3192
  }
3246
3193
  ],
@@ -3252,12 +3199,181 @@ const EKYC_DEFINITIONS = {
3252
3199
  }
3253
3200
  }
3254
3201
  },
3255
- "ekyc/IN/IN_DMV": {
3202
+ "ekyc/HK/HK_RESIDENT_REGISTER": {
3256
3203
  schemaVersion: 1,
3257
- vocabulary: "1.2",
3258
- id: "ekyc/IN/IN_DMV",
3204
+ vocabulary: "1.3",
3205
+ id: "ekyc/HK/HK_RESIDENT_REGISTER",
3259
3206
  module: "ekyc",
3260
- country: "IN",
3207
+ country: "HK",
3208
+ source: "HK_RESIDENT_REGISTER",
3209
+ sections: [{ id: "address" }],
3210
+ fields: [
3211
+ {
3212
+ name: "firstName",
3213
+ kind: "text",
3214
+ group: "name",
3215
+ required: true,
3216
+ label: { key: "verification.labels.firstName" },
3217
+ placeholder: { key: "verification.placeholder.firstName" },
3218
+ input: {
3219
+ maxLength: 100,
3220
+ autofill: "givenName"
3221
+ },
3222
+ rules: [{ id: "nameCharacters" }],
3223
+ prefill: ["document.firstName", "poa.firstName"]
3224
+ },
3225
+ {
3226
+ name: "surName",
3227
+ kind: "text",
3228
+ group: "name",
3229
+ required: true,
3230
+ label: { key: "verification.labels.surName" },
3231
+ placeholder: { key: "verification.placeholder.surname" },
3232
+ input: {
3233
+ maxLength: 100,
3234
+ autofill: "familyName"
3235
+ },
3236
+ rules: [{ id: "nameCharacters" }],
3237
+ prefill: ["document.paternalLastName", "poa.lastName"]
3238
+ },
3239
+ {
3240
+ name: "dateOfBirth",
3241
+ kind: "date",
3242
+ group: "dateOfBirth",
3243
+ label: { key: "verification.labels.dateOfBirth" },
3244
+ input: { autofill: "birthday" },
3245
+ rules: [{
3246
+ id: "maxAge",
3247
+ params: { years: 120 }
3248
+ }, { id: "notFuture" }],
3249
+ prefill: ["document.birthDate"]
3250
+ },
3251
+ {
3252
+ name: "gender",
3253
+ kind: "choice",
3254
+ group: "gender",
3255
+ widget: "radio",
3256
+ label: { key: "verification.labels.gender" },
3257
+ options: [{
3258
+ value: "F",
3259
+ label: { key: "common.female" }
3260
+ }, {
3261
+ value: "M",
3262
+ label: { key: "common.male" }
3263
+ }]
3264
+ },
3265
+ {
3266
+ name: "email",
3267
+ kind: "text",
3268
+ group: "email",
3269
+ required: true,
3270
+ label: { key: "verification.labels.email" },
3271
+ placeholder: { key: "verification.placeholder.email" },
3272
+ input: {
3273
+ keyboard: "email",
3274
+ autofill: "email"
3275
+ },
3276
+ rules: [{ id: "emailFormat" }],
3277
+ prefill: ["emailModule.email"]
3278
+ },
3279
+ {
3280
+ name: "phone",
3281
+ kind: "phone",
3282
+ group: "phone",
3283
+ required: true,
3284
+ label: { key: "verification.labels.phone" },
3285
+ input: { autofill: "phone" },
3286
+ phone: { lockCountry: "whenPhoneRisk" },
3287
+ rules: [{ id: "phoneFormat" }],
3288
+ payload: { transforms: [{ id: "e164" }] },
3289
+ prefill: ["phoneModule.phone"]
3290
+ },
3291
+ {
3292
+ name: "apartment",
3293
+ kind: "text",
3294
+ group: "address",
3295
+ section: "address",
3296
+ label: { key: "verification.labels.apartment" },
3297
+ placeholder: { key: "verification.placeholder.apartment" },
3298
+ input: { autofill: "addressLine2" }
3299
+ },
3300
+ {
3301
+ name: "buildingName",
3302
+ kind: "text",
3303
+ group: "address",
3304
+ section: "address",
3305
+ label: { key: "verification.labels.buildingName" }
3306
+ },
3307
+ {
3308
+ name: "houseNo",
3309
+ kind: "text",
3310
+ group: "address",
3311
+ section: "address",
3312
+ label: { key: "verification.labels.houseNo" },
3313
+ prefill: ["document.houseNumber", "poa.houseNumber"]
3314
+ },
3315
+ {
3316
+ name: "street",
3317
+ kind: "text",
3318
+ group: "address",
3319
+ section: "address",
3320
+ widget: "addressSearch",
3321
+ label: { key: "verification.labels.street" },
3322
+ input: { autofill: "addressLine1" },
3323
+ rules: [{ id: "noPoBox" }],
3324
+ prefill: ["document.street", "poa.street"]
3325
+ },
3326
+ {
3327
+ name: "city",
3328
+ kind: "text",
3329
+ group: "address",
3330
+ section: "address",
3331
+ label: { key: "verification.labels.area" },
3332
+ input: { autofill: "addressLevel2" },
3333
+ prefill: ["document.city", "poa.city"]
3334
+ },
3335
+ {
3336
+ name: "state",
3337
+ kind: "choice",
3338
+ group: "address",
3339
+ section: "address",
3340
+ required: true,
3341
+ widget: "select",
3342
+ label: { key: "verification.labels.chooseState" },
3343
+ placeholder: { key: "verification.placeholder.state" },
3344
+ input: { autofill: "addressLevel1" },
3345
+ options: [
3346
+ {
3347
+ value: "Hong Kong",
3348
+ label: { key: "Hong Kong" }
3349
+ },
3350
+ {
3351
+ value: "Kowloon",
3352
+ label: { key: "Kowloon" }
3353
+ },
3354
+ {
3355
+ value: "New Territories",
3356
+ label: { key: "New Territories" }
3357
+ }
3358
+ ],
3359
+ payload: { transforms: [{ id: "uppercase" }] },
3360
+ prefill: ["document.state", "poa.state"]
3361
+ }
3362
+ ],
3363
+ submit: {
3364
+ static: { plugins: ["kyc"] },
3365
+ context: {
3366
+ source: "source",
3367
+ countryCode: "country"
3368
+ }
3369
+ }
3370
+ },
3371
+ "ekyc/IN/IN_DMV": {
3372
+ schemaVersion: 1,
3373
+ vocabulary: "1.3",
3374
+ id: "ekyc/IN/IN_DMV",
3375
+ module: "ekyc",
3376
+ country: "IN",
3261
3377
  source: "IN_DMV",
3262
3378
  sections: [{ id: "address" }],
3263
3379
  fields: [
@@ -3309,7 +3425,10 @@ const EKYC_DEFINITIONS = {
3309
3425
  required: true,
3310
3426
  label: { key: "verification.labels.dateOfBirth" },
3311
3427
  input: { autofill: "birthday" },
3312
- rules: [{ id: "notFuture" }],
3428
+ rules: [{
3429
+ id: "maxAge",
3430
+ params: { years: 120 }
3431
+ }, { id: "notFuture" }],
3313
3432
  prefill: ["document.birthDate"]
3314
3433
  },
3315
3434
  {
@@ -3346,6 +3465,7 @@ const EKYC_DEFINITIONS = {
3346
3465
  label: { key: "verification.labels.idNum" },
3347
3466
  input: { maxLength: 20 },
3348
3467
  rules: [{ id: "inDrivingLicenseNumber" }],
3468
+ payload: { key: "idNumber" },
3349
3469
  prefill: ["document.documentNumber"]
3350
3470
  },
3351
3471
  {
@@ -3432,7 +3552,7 @@ const EKYC_DEFINITIONS = {
3432
3552
  },
3433
3553
  "ekyc/IN/INDIA_PAN_1": {
3434
3554
  schemaVersion: 1,
3435
- vocabulary: "1.2",
3555
+ vocabulary: "1.3",
3436
3556
  id: "ekyc/IN/INDIA_PAN_1",
3437
3557
  module: "ekyc",
3438
3558
  country: "IN",
@@ -3473,7 +3593,10 @@ const EKYC_DEFINITIONS = {
3473
3593
  required: true,
3474
3594
  label: { key: "verification.labels.dateOfBirth" },
3475
3595
  input: { autofill: "birthday" },
3476
- rules: [{ id: "notFuture" }],
3596
+ rules: [{
3597
+ id: "maxAge",
3598
+ params: { years: 120 }
3599
+ }, { id: "notFuture" }],
3477
3600
  prefill: ["document.birthDate"]
3478
3601
  },
3479
3602
  {
@@ -3505,7 +3628,7 @@ const EKYC_DEFINITIONS = {
3505
3628
  },
3506
3629
  "ekyc/IN/INDIA_PASSPORT_1": {
3507
3630
  schemaVersion: 1,
3508
- vocabulary: "1.2",
3631
+ vocabulary: "1.3",
3509
3632
  id: "ekyc/IN/INDIA_PASSPORT_1",
3510
3633
  module: "ekyc",
3511
3634
  country: "IN",
@@ -3553,7 +3676,10 @@ const EKYC_DEFINITIONS = {
3553
3676
  required: true,
3554
3677
  label: { key: "verification.labels.dateOfBirth" },
3555
3678
  input: { autofill: "birthday" },
3556
- rules: [{ id: "notFuture" }],
3679
+ rules: [{
3680
+ id: "maxAge",
3681
+ params: { years: 120 }
3682
+ }, { id: "notFuture" }],
3557
3683
  prefill: ["document.birthDate"]
3558
3684
  },
3559
3685
  {
@@ -3574,6 +3700,7 @@ const EKYC_DEFINITIONS = {
3574
3700
  },
3575
3701
  message: { key: "verification.errors.passportNumberFormat" }
3576
3702
  }],
3703
+ payload: { key: "idNumber" },
3577
3704
  prefill: ["document.documentNumber"]
3578
3705
  },
3579
3706
  {
@@ -3615,7 +3742,7 @@ const EKYC_DEFINITIONS = {
3615
3742
  },
3616
3743
  "ekyc/IT/IT_CIVIL_REG_CREDIT_TELCO": {
3617
3744
  schemaVersion: 1,
3618
- vocabulary: "1.2",
3745
+ vocabulary: "1.3",
3619
3746
  id: "ekyc/IT/IT_CIVIL_REG_CREDIT_TELCO",
3620
3747
  module: "ekyc",
3621
3748
  country: "IT",
@@ -3656,7 +3783,10 @@ const EKYC_DEFINITIONS = {
3656
3783
  group: "dateOfBirth",
3657
3784
  label: { key: "verification.labels.dateOfBirth" },
3658
3785
  input: { autofill: "birthday" },
3659
- rules: [{ id: "notFuture" }],
3786
+ rules: [{
3787
+ id: "maxAge",
3788
+ params: { years: 120 }
3789
+ }, { id: "notFuture" }],
3660
3790
  prefill: ["document.birthDate"]
3661
3791
  },
3662
3792
  {
@@ -3830,6 +3960,7 @@ const EKYC_DEFINITIONS = {
3830
3960
  id: "digitCount",
3831
3961
  params: { lengths: [14] }
3832
3962
  }],
3963
+ payload: { key: "idNumber" },
3833
3964
  prefill: ["document.documentNumber"]
3834
3965
  },
3835
3966
  {
@@ -3878,7 +4009,7 @@ const EKYC_DEFINITIONS = {
3878
4009
  },
3879
4010
  "ekyc/MX/MX_CIVIL_REGISTER_2": {
3880
4011
  schemaVersion: 1,
3881
- vocabulary: "1.2",
4012
+ vocabulary: "1.3",
3882
4013
  id: "ekyc/MX/MX_CIVIL_REGISTER_2",
3883
4014
  module: "ekyc",
3884
4015
  country: "MX",
@@ -3931,7 +4062,10 @@ const EKYC_DEFINITIONS = {
3931
4062
  group: "dateOfBirth",
3932
4063
  label: { key: "verification.labels.dateOfBirth" },
3933
4064
  input: { autofill: "birthday" },
3934
- rules: [{ id: "notFuture" }],
4065
+ rules: [{
4066
+ id: "maxAge",
4067
+ params: { years: 120 }
4068
+ }, { id: "notFuture" }],
3935
4069
  prefill: ["document.birthDate"]
3936
4070
  },
3937
4071
  {
@@ -3978,6 +4112,7 @@ const EKYC_DEFINITIONS = {
3978
4112
  id: "curp",
3979
4113
  message: { key: "verification.errors.curp" }
3980
4114
  }],
4115
+ payload: { key: "idNumber" },
3981
4116
  prefill: ["document.documentNumber"]
3982
4117
  },
3983
4118
  {
@@ -4005,7 +4140,7 @@ const EKYC_DEFINITIONS = {
4005
4140
  },
4006
4141
  "ekyc/NL/NL_CIVIL_REG_CREDIT_TELCO": {
4007
4142
  schemaVersion: 1,
4008
- vocabulary: "1.2",
4143
+ vocabulary: "1.3",
4009
4144
  id: "ekyc/NL/NL_CIVIL_REG_CREDIT_TELCO",
4010
4145
  module: "ekyc",
4011
4146
  country: "NL",
@@ -4046,7 +4181,10 @@ const EKYC_DEFINITIONS = {
4046
4181
  group: "dateOfBirth",
4047
4182
  label: { key: "verification.labels.dateOfBirth" },
4048
4183
  input: { autofill: "birthday" },
4049
- rules: [{ id: "notFuture" }],
4184
+ rules: [{
4185
+ id: "maxAge",
4186
+ params: { years: 120 }
4187
+ }, { id: "notFuture" }],
4050
4188
  prefill: ["document.birthDate"]
4051
4189
  },
4052
4190
  {
@@ -4129,7 +4267,7 @@ const EKYC_DEFINITIONS = {
4129
4267
  },
4130
4268
  "ekyc/NL/NL_CONSUMER_POP_REG_TELCO": {
4131
4269
  schemaVersion: 1,
4132
- vocabulary: "1.2",
4270
+ vocabulary: "1.3",
4133
4271
  id: "ekyc/NL/NL_CONSUMER_POP_REG_TELCO",
4134
4272
  module: "ekyc",
4135
4273
  country: "NL",
@@ -4170,7 +4308,10 @@ const EKYC_DEFINITIONS = {
4170
4308
  group: "dateOfBirth",
4171
4309
  label: { key: "verification.labels.dateOfBirth" },
4172
4310
  input: { autofill: "birthday" },
4173
- rules: [{ id: "notFuture" }],
4311
+ rules: [{
4312
+ id: "maxAge",
4313
+ params: { years: 120 }
4314
+ }, { id: "notFuture" }],
4174
4315
  prefill: ["document.birthDate"]
4175
4316
  },
4176
4317
  {
@@ -4274,7 +4415,7 @@ const EKYC_DEFINITIONS = {
4274
4415
  },
4275
4416
  "ekyc/NO/NO_CONS_POP_REG": {
4276
4417
  schemaVersion: 1,
4277
- vocabulary: "1.2",
4418
+ vocabulary: "1.3",
4278
4419
  id: "ekyc/NO/NO_CONS_POP_REG",
4279
4420
  module: "ekyc",
4280
4421
  country: "NO",
@@ -4316,7 +4457,10 @@ const EKYC_DEFINITIONS = {
4316
4457
  required: true,
4317
4458
  label: { key: "verification.labels.dateOfBirth" },
4318
4459
  input: { autofill: "birthday" },
4319
- rules: [{ id: "notFuture" }],
4460
+ rules: [{
4461
+ id: "maxAge",
4462
+ params: { years: 120 }
4463
+ }, { id: "notFuture" }],
4320
4464
  prefill: ["document.birthDate"]
4321
4465
  },
4322
4466
  {
@@ -4419,7 +4563,7 @@ const EKYC_DEFINITIONS = {
4419
4563
  },
4420
4564
  "ekyc/PE/PE_CIVIL_REGISTER_2": {
4421
4565
  schemaVersion: 1,
4422
- vocabulary: "1.2",
4566
+ vocabulary: "1.3",
4423
4567
  id: "ekyc/PE/PE_CIVIL_REGISTER_2",
4424
4568
  module: "ekyc",
4425
4569
  country: "PE",
@@ -4473,7 +4617,10 @@ const EKYC_DEFINITIONS = {
4473
4617
  group: "dateOfBirth",
4474
4618
  label: { key: "verification.labels.dateOfBirth" },
4475
4619
  input: { autofill: "birthday" },
4476
- rules: [{ id: "notFuture" }],
4620
+ rules: [{
4621
+ id: "maxAge",
4622
+ params: { years: 120 }
4623
+ }, { id: "notFuture" }],
4477
4624
  prefill: ["document.birthDate"]
4478
4625
  },
4479
4626
  {
@@ -4516,6 +4663,7 @@ const EKYC_DEFINITIONS = {
4516
4663
  id: "digitCount",
4517
4664
  params: { lengths: [8] }
4518
4665
  }],
4666
+ payload: { key: "idNumber" },
4519
4667
  prefill: ["document.documentNumber"]
4520
4668
  },
4521
4669
  {
@@ -4554,7 +4702,7 @@ const EKYC_DEFINITIONS = {
4554
4702
  },
4555
4703
  "ekyc/PH/PH_RES_CREDIT": {
4556
4704
  schemaVersion: 1,
4557
- vocabulary: "1.2",
4705
+ vocabulary: "1.3",
4558
4706
  id: "ekyc/PH/PH_RES_CREDIT",
4559
4707
  module: "ekyc",
4560
4708
  country: "PH",
@@ -4613,7 +4761,10 @@ const EKYC_DEFINITIONS = {
4613
4761
  required: true,
4614
4762
  label: { key: "verification.labels.dateOfBirth" },
4615
4763
  input: { autofill: "birthday" },
4616
- rules: [{ id: "notFuture" }],
4764
+ rules: [{
4765
+ id: "maxAge",
4766
+ params: { years: 120 }
4767
+ }, { id: "notFuture" }],
4617
4768
  prefill: ["document.birthDate"]
4618
4769
  },
4619
4770
  {
@@ -4665,6 +4816,7 @@ const EKYC_DEFINITIONS = {
4665
4816
  extra: "-"
4666
4817
  }
4667
4818
  }],
4819
+ payload: { key: "idNumber" },
4668
4820
  prefill: ["document.documentNumber"]
4669
4821
  },
4670
4822
  {
@@ -4767,7 +4919,7 @@ const EKYC_DEFINITIONS = {
4767
4919
  },
4768
4920
  "ekyc/PT/PT_CIVIL_REG_CREDIT_TELCO": {
4769
4921
  schemaVersion: 1,
4770
- vocabulary: "1.2",
4922
+ vocabulary: "1.3",
4771
4923
  id: "ekyc/PT/PT_CIVIL_REG_CREDIT_TELCO",
4772
4924
  module: "ekyc",
4773
4925
  country: "PT",
@@ -4808,7 +4960,10 @@ const EKYC_DEFINITIONS = {
4808
4960
  group: "dateOfBirth",
4809
4961
  label: { key: "verification.labels.dateOfBirth" },
4810
4962
  input: { autofill: "birthday" },
4811
- rules: [{ id: "notFuture" }],
4963
+ rules: [{
4964
+ id: "maxAge",
4965
+ params: { years: 120 }
4966
+ }, { id: "notFuture" }],
4812
4967
  prefill: ["document.birthDate"]
4813
4968
  },
4814
4969
  {
@@ -4870,11 +5025,163 @@ const EKYC_DEFINITIONS = {
4870
5025
  section: "address",
4871
5026
  label: { key: "verification.labels.postalCode" },
4872
5027
  input: {
4873
- maxLength: 8,
5028
+ maxLength: 8,
5029
+ autofill: "postalCode",
5030
+ keyboard: "numeric"
5031
+ },
5032
+ rules: [{ id: "postalCodeFormat" }],
5033
+ payload: { transforms: [{
5034
+ id: "stripSeparators",
5035
+ params: { chars: "- " }
5036
+ }] },
5037
+ prefill: ["document.postalCode", "poa.postalCode"]
5038
+ }
5039
+ ],
5040
+ submit: {
5041
+ static: { plugins: ["kyc"] },
5042
+ context: {
5043
+ source: "source",
5044
+ countryCode: "country"
5045
+ }
5046
+ }
5047
+ },
5048
+ "ekyc/RO/RO_VOTER_REGISTER": {
5049
+ schemaVersion: 1,
5050
+ vocabulary: "1.3",
5051
+ id: "ekyc/RO/RO_VOTER_REGISTER",
5052
+ module: "ekyc",
5053
+ country: "RO",
5054
+ source: "RO_VOTER_REGISTER",
5055
+ sections: [{ id: "address" }],
5056
+ fields: [
5057
+ {
5058
+ name: "firstName",
5059
+ kind: "text",
5060
+ group: "name",
5061
+ required: true,
5062
+ label: { key: "verification.labels.firstName" },
5063
+ placeholder: { key: "verification.placeholder.firstName" },
5064
+ input: {
5065
+ maxLength: 100,
5066
+ autofill: "givenName"
5067
+ },
5068
+ rules: [{ id: "nameCharacters" }],
5069
+ prefill: ["document.firstName", "poa.firstName"]
5070
+ },
5071
+ {
5072
+ name: "middleName",
5073
+ kind: "text",
5074
+ group: "name",
5075
+ label: { key: "verification.labels.middleName" },
5076
+ placeholder: { key: "verification.placeholder.middleName" },
5077
+ input: {
5078
+ maxLength: 100,
5079
+ autofill: "middleName"
5080
+ },
5081
+ rules: [{ id: "nameCharacters" }],
5082
+ prefill: ["document.middleName"]
5083
+ },
5084
+ {
5085
+ name: "surName",
5086
+ kind: "text",
5087
+ group: "name",
5088
+ required: true,
5089
+ label: { key: "verification.labels.surName" },
5090
+ placeholder: { key: "verification.placeholder.surname" },
5091
+ input: {
5092
+ maxLength: 100,
5093
+ autofill: "familyName"
5094
+ },
5095
+ rules: [{ id: "nameCharacters" }],
5096
+ prefill: ["document.paternalLastName", "poa.lastName"]
5097
+ },
5098
+ {
5099
+ name: "dateOfBirth",
5100
+ kind: "date",
5101
+ group: "dateOfBirth",
5102
+ label: { key: "verification.labels.dateOfBirth" },
5103
+ input: { autofill: "birthday" },
5104
+ rules: [{
5105
+ id: "maxAge",
5106
+ params: { years: 120 }
5107
+ }, { id: "notFuture" }],
5108
+ prefill: ["document.birthDate"]
5109
+ },
5110
+ {
5111
+ name: "email",
5112
+ kind: "text",
5113
+ group: "email",
5114
+ required: true,
5115
+ label: { key: "verification.labels.email" },
5116
+ placeholder: { key: "verification.placeholder.email" },
5117
+ input: {
5118
+ keyboard: "email",
5119
+ autofill: "email"
5120
+ },
5121
+ rules: [{ id: "emailFormat" }],
5122
+ prefill: ["emailModule.email"]
5123
+ },
5124
+ {
5125
+ name: "phone",
5126
+ kind: "phone",
5127
+ group: "phone",
5128
+ required: true,
5129
+ label: { key: "verification.labels.phone" },
5130
+ input: { autofill: "phone" },
5131
+ phone: { lockCountry: "whenPhoneRisk" },
5132
+ rules: [{ id: "phoneFormat" }],
5133
+ payload: { transforms: [{ id: "e164" }] },
5134
+ prefill: ["phoneModule.phone"]
5135
+ },
5136
+ {
5137
+ name: "gender",
5138
+ kind: "choice",
5139
+ group: "gender",
5140
+ widget: "radio",
5141
+ label: { key: "verification.labels.gender" },
5142
+ options: [{
5143
+ value: "F",
5144
+ label: { key: "common.female" }
5145
+ }, {
5146
+ value: "M",
5147
+ label: { key: "common.male" }
5148
+ }]
5149
+ },
5150
+ {
5151
+ name: "street",
5152
+ kind: "text",
5153
+ group: "address",
5154
+ section: "address",
5155
+ widget: "addressSearch",
5156
+ label: { key: "verification.labels.streetAndHouseNumber" },
5157
+ input: { autofill: "addressLine1" },
5158
+ rules: [{ id: "noPoBox" }],
5159
+ prefill: ["document.street", "poa.street"]
5160
+ },
5161
+ {
5162
+ name: "city",
5163
+ kind: "text",
5164
+ group: "address",
5165
+ section: "address",
5166
+ label: { key: "verification.labels.city" },
5167
+ input: { autofill: "addressLevel2" },
5168
+ prefill: ["document.city", "poa.city"]
5169
+ },
5170
+ {
5171
+ name: "postalCode",
5172
+ kind: "text",
5173
+ group: "address",
5174
+ section: "address",
5175
+ label: { key: "verification.labels.postalCode" },
5176
+ input: {
5177
+ maxLength: 6,
4874
5178
  autofill: "postalCode",
4875
5179
  keyboard: "numeric"
4876
5180
  },
4877
- rules: [{ id: "postalCodeFormat" }],
5181
+ rules: [{ id: "postalCodeFormat" }, {
5182
+ id: "digitCount",
5183
+ params: { lengths: [6] }
5184
+ }],
4878
5185
  payload: { transforms: [{
4879
5186
  id: "stripSeparators",
4880
5187
  params: { chars: "- " }
@@ -4892,7 +5199,7 @@ const EKYC_DEFINITIONS = {
4892
5199
  },
4893
5200
  "ekyc/SG/SG_PHONE_REGISTER": {
4894
5201
  schemaVersion: 1,
4895
- vocabulary: "1.2",
5202
+ vocabulary: "1.3",
4896
5203
  id: "ekyc/SG/SG_PHONE_REGISTER",
4897
5204
  module: "ekyc",
4898
5205
  country: "SG",
@@ -4946,7 +5253,10 @@ const EKYC_DEFINITIONS = {
4946
5253
  group: "dateOfBirth",
4947
5254
  label: { key: "verification.labels.dateOfBirth" },
4948
5255
  input: { autofill: "birthday" },
4949
- rules: [{ id: "notFuture" }],
5256
+ rules: [{
5257
+ id: "maxAge",
5258
+ params: { years: 120 }
5259
+ }, { id: "notFuture" }],
4950
5260
  prefill: ["document.birthDate"]
4951
5261
  },
4952
5262
  {
@@ -5050,7 +5360,7 @@ const EKYC_DEFINITIONS = {
5050
5360
  },
5051
5361
  "ekyc/US/US_CREDIT_BUREAU_1": {
5052
5362
  schemaVersion: 1,
5053
- vocabulary: "1.2",
5363
+ vocabulary: "1.3",
5054
5364
  id: "ekyc/US/US_CREDIT_BUREAU_1",
5055
5365
  module: "ekyc",
5056
5366
  country: "US",
@@ -5104,7 +5414,10 @@ const EKYC_DEFINITIONS = {
5104
5414
  group: "dateOfBirth",
5105
5415
  label: { key: "verification.labels.dateOfBirth" },
5106
5416
  input: { autofill: "birthday" },
5107
- rules: [{ id: "notFuture" }],
5417
+ rules: [{
5418
+ id: "maxAge",
5419
+ params: { years: 120 }
5420
+ }, { id: "notFuture" }],
5108
5421
  prefill: ["document.birthDate"]
5109
5422
  },
5110
5423
  {
@@ -5219,7 +5532,7 @@ const EKYC_DEFINITIONS = {
5219
5532
  },
5220
5533
  "ekyc/US/US_CREDIT_BUREAU_3": {
5221
5534
  schemaVersion: 1,
5222
- vocabulary: "1.2",
5535
+ vocabulary: "1.3",
5223
5536
  id: "ekyc/US/US_CREDIT_BUREAU_3",
5224
5537
  module: "ekyc",
5225
5538
  country: "US",
@@ -5273,7 +5586,10 @@ const EKYC_DEFINITIONS = {
5273
5586
  group: "dateOfBirth",
5274
5587
  label: { key: "verification.labels.dateOfBirth" },
5275
5588
  input: { autofill: "birthday" },
5276
- rules: [{ id: "notFuture" }],
5589
+ rules: [{
5590
+ id: "maxAge",
5591
+ params: { years: 120 }
5592
+ }, { id: "notFuture" }],
5277
5593
  prefill: ["document.birthDate"]
5278
5594
  },
5279
5595
  {
@@ -5399,7 +5715,7 @@ const EKYC_DEFINITIONS = {
5399
5715
  },
5400
5716
  "ekyc/US/US_CREDIT_TELCO": {
5401
5717
  schemaVersion: 1,
5402
- vocabulary: "1.2",
5718
+ vocabulary: "1.3",
5403
5719
  id: "ekyc/US/US_CREDIT_TELCO",
5404
5720
  module: "ekyc",
5405
5721
  country: "US",
@@ -5444,7 +5760,10 @@ const EKYC_DEFINITIONS = {
5444
5760
  group: "dateOfBirth",
5445
5761
  label: { key: "verification.labels.dateOfBirth" },
5446
5762
  input: { autofill: "birthday" },
5447
- rules: [{ id: "notFuture" }],
5763
+ rules: [{
5764
+ id: "maxAge",
5765
+ params: { years: 120 }
5766
+ }, { id: "notFuture" }],
5448
5767
  prefill: ["document.birthDate"]
5449
5768
  },
5450
5769
  {
@@ -5569,12 +5888,12 @@ const EKYC_DEFINITIONS = {
5569
5888
  },
5570
5889
  "ekyc/US/US_TELCO_1": {
5571
5890
  schemaVersion: 1,
5572
- vocabulary: "1.2",
5891
+ vocabulary: "1.3",
5573
5892
  id: "ekyc/US/US_TELCO_1",
5574
5893
  module: "ekyc",
5575
5894
  country: "US",
5576
5895
  source: "US_TELCO_1",
5577
- sections: [{ id: "address" }, { id: "driverLicense" }],
5896
+ sections: [{ id: "driverLicense" }, { id: "address" }],
5578
5897
  fields: [
5579
5898
  {
5580
5899
  name: "firstName",
@@ -5610,7 +5929,10 @@ const EKYC_DEFINITIONS = {
5610
5929
  group: "dateOfBirth",
5611
5930
  label: { key: "verification.labels.dateOfBirth" },
5612
5931
  input: { autofill: "birthday" },
5613
- rules: [{ id: "notFuture" }],
5932
+ rules: [{
5933
+ id: "maxAge",
5934
+ params: { years: 120 }
5935
+ }, { id: "notFuture" }],
5614
5936
  prefill: ["document.birthDate"]
5615
5937
  },
5616
5938
  {
@@ -5658,6 +5980,25 @@ const EKYC_DEFINITIONS = {
5658
5980
  params: { lengths: [4] }
5659
5981
  }]
5660
5982
  },
5983
+ {
5984
+ name: "dlNumber",
5985
+ kind: "text",
5986
+ group: "dlNumber",
5987
+ section: "driverLicense",
5988
+ label: { key: "verification.labels.dlNumber" },
5989
+ prefill: ["document.driversLicenseNumber"]
5990
+ },
5991
+ {
5992
+ name: "dlState",
5993
+ kind: "choice",
5994
+ group: "dlState",
5995
+ section: "driverLicense",
5996
+ widget: "select",
5997
+ label: { key: "verification.labels.dlState" },
5998
+ placeholder: { key: "verification.placeholder.state" },
5999
+ optionsRef: "US_STATES",
6000
+ prefill: ["document.driversLicenseState"]
6001
+ },
5661
6002
  {
5662
6003
  name: "street",
5663
6004
  kind: "text",
@@ -5707,25 +6048,6 @@ const EKYC_DEFINITIONS = {
5707
6048
  params: { chars: "- " }
5708
6049
  }] },
5709
6050
  prefill: ["document.postalCode", "poa.postalCode"]
5710
- },
5711
- {
5712
- name: "dlNumber",
5713
- kind: "text",
5714
- group: "dlNumber",
5715
- section: "driverLicense",
5716
- label: { key: "verification.labels.dlNumber" },
5717
- prefill: ["document.driversLicenseNumber"]
5718
- },
5719
- {
5720
- name: "dlState",
5721
- kind: "choice",
5722
- group: "dlState",
5723
- section: "driverLicense",
5724
- widget: "select",
5725
- label: { key: "verification.labels.dlState" },
5726
- placeholder: { key: "verification.placeholder.state" },
5727
- optionsRef: "US_STATES",
5728
- prefill: ["document.driversLicenseState"]
5729
6051
  }
5730
6052
  ],
5731
6053
  submit: {
@@ -5738,7 +6060,7 @@ const EKYC_DEFINITIONS = {
5738
6060
  },
5739
6061
  "ekyc/US/US_TELCO_2": {
5740
6062
  schemaVersion: 1,
5741
- vocabulary: "1.2",
6063
+ vocabulary: "1.3",
5742
6064
  id: "ekyc/US/US_TELCO_2",
5743
6065
  module: "ekyc",
5744
6066
  country: "US",
@@ -5777,7 +6099,10 @@ const EKYC_DEFINITIONS = {
5777
6099
  group: "dateOfBirth",
5778
6100
  label: { key: "verification.labels.dateOfBirth" },
5779
6101
  input: { autofill: "birthday" },
5780
- rules: [{ id: "notFuture" }],
6102
+ rules: [{
6103
+ id: "maxAge",
6104
+ params: { years: 120 }
6105
+ }, { id: "notFuture" }],
5781
6106
  prefill: ["document.birthDate"]
5782
6107
  },
5783
6108
  {
@@ -5873,7 +6198,7 @@ const EKYC_DEFINITIONS = {
5873
6198
  },
5874
6199
  "ekyc/VE/VE_CIVIL_REGISTER": {
5875
6200
  schemaVersion: 1,
5876
- vocabulary: "1.2",
6201
+ vocabulary: "1.3",
5877
6202
  id: "ekyc/VE/VE_CIVIL_REGISTER",
5878
6203
  module: "ekyc",
5879
6204
  country: "VE",
@@ -5926,7 +6251,10 @@ const EKYC_DEFINITIONS = {
5926
6251
  group: "dateOfBirth",
5927
6252
  label: { key: "verification.labels.dateOfBirth" },
5928
6253
  input: { autofill: "birthday" },
5929
- rules: [{ id: "notFuture" }],
6254
+ rules: [{
6255
+ id: "maxAge",
6256
+ params: { years: 120 }
6257
+ }, { id: "notFuture" }],
5930
6258
  prefill: ["document.birthDate"]
5931
6259
  },
5932
6260
  {
@@ -5972,6 +6300,7 @@ const EKYC_DEFINITIONS = {
5972
6300
  max: 9
5973
6301
  }
5974
6302
  }],
6303
+ payload: { key: "idNumber" },
5975
6304
  prefill: ["document.documentNumber"]
5976
6305
  }
5977
6306
  ],
@@ -5984,119 +6313,6 @@ const EKYC_DEFINITIONS = {
5984
6313
  }
5985
6314
  }
5986
6315
  };
5987
- const brStateOptions = Object.values({
5988
- AC: {
5989
- code: "AC",
5990
- name: "Acre"
5991
- },
5992
- AL: {
5993
- code: "AL",
5994
- name: "Alagoas"
5995
- },
5996
- AP: {
5997
- code: "AP",
5998
- name: "Amapá"
5999
- },
6000
- AM: {
6001
- code: "AM",
6002
- name: "Amazonas"
6003
- },
6004
- BA: {
6005
- code: "BA",
6006
- name: "Bahia"
6007
- },
6008
- CE: {
6009
- code: "CE",
6010
- name: "Ceará"
6011
- },
6012
- DF: {
6013
- code: "DF",
6014
- name: "Distrito Federal"
6015
- },
6016
- ES: {
6017
- code: "ES",
6018
- name: "Espírito Santo"
6019
- },
6020
- GO: {
6021
- code: "GO",
6022
- name: "Goiás"
6023
- },
6024
- MA: {
6025
- code: "MA",
6026
- name: "Maranhão"
6027
- },
6028
- MT: {
6029
- code: "MT",
6030
- name: "Mato Grosso"
6031
- },
6032
- MS: {
6033
- code: "MS",
6034
- name: "Mato Grosso do Sul"
6035
- },
6036
- MG: {
6037
- code: "MG",
6038
- name: "Minas Gerais"
6039
- },
6040
- PA: {
6041
- code: "PA",
6042
- name: "Pará"
6043
- },
6044
- PB: {
6045
- code: "PB",
6046
- name: "Paraíba"
6047
- },
6048
- PR: {
6049
- code: "PR",
6050
- name: "Paraná"
6051
- },
6052
- PE: {
6053
- code: "PE",
6054
- name: "Pernambuco"
6055
- },
6056
- PI: {
6057
- code: "PI",
6058
- name: "Piauí"
6059
- },
6060
- RJ: {
6061
- code: "RJ",
6062
- name: "Rio de Janeiro"
6063
- },
6064
- RN: {
6065
- code: "RN",
6066
- name: "Rio Grande do Norte"
6067
- },
6068
- RS: {
6069
- code: "RS",
6070
- name: "Rio Grande do Sul"
6071
- },
6072
- RO: {
6073
- code: "RO",
6074
- name: "Rondônia"
6075
- },
6076
- RR: {
6077
- code: "RR",
6078
- name: "Roraima"
6079
- },
6080
- SC: {
6081
- code: "SC",
6082
- name: "Santa Catarina"
6083
- },
6084
- SP: {
6085
- code: "SP",
6086
- name: "São Paulo"
6087
- },
6088
- SE: {
6089
- code: "SE",
6090
- name: "Sergipe"
6091
- },
6092
- TO: {
6093
- code: "TO",
6094
- name: "Tocantins"
6095
- }
6096
- }).map((state) => ({
6097
- value: state.code,
6098
- label: state.name
6099
- }));
6100
6316
  const caProvinceOptions = Object.values({
6101
6317
  AB: {
6102
6318
  code: "AB",
@@ -6435,60 +6651,6 @@ const OPTION_LISTS = {
6435
6651
  }
6436
6652
  ]
6437
6653
  };
6438
- /** Vocabulary rules expressed as today's `EkycValidationRule` objects. */
6439
- const RULES = {
6440
- cpf: () => ({ type: "cpf" }),
6441
- ssnFormat: () => ({ type: "ssnFormat" }),
6442
- noPoBox: () => ({ type: "noPoBox" }),
6443
- emailFormat: () => ({ type: "emailFormat" }),
6444
- postalCodeFormat: ({ country }) => ({
6445
- type: "postalCodeFormat",
6446
- country
6447
- }),
6448
- phoneFormat: ({ country, required }) => ({
6449
- type: "phoneFormat",
6450
- country,
6451
- optional: !required
6452
- }),
6453
- exactLength: ({ params }) => ({
6454
- type: "exactLength",
6455
- length: params.length
6456
- }),
6457
- nameCharacters: () => ({ type: "nameCharacters" }),
6458
- notFuture: () => ({ type: "notFuture" }),
6459
- phoneDigits: ({ country, params }) => ({
6460
- type: "phoneDigits",
6461
- country,
6462
- min: params.min,
6463
- max: params.max
6464
- }),
6465
- digitCount: ({ params }) => ({
6466
- type: "digitCount",
6467
- ...params.lengths !== void 0 && { lengths: [...params.lengths] },
6468
- ...params.min !== void 0 && { min: params.min },
6469
- ...params.max !== void 0 && { max: params.max }
6470
- }),
6471
- allowedCharacters: ({ params }) => ({
6472
- type: "allowedCharacters",
6473
- classes: [...params.classes],
6474
- ...params.extra !== void 0 && { extra: params.extra }
6475
- }),
6476
- charTemplate: ({ params }) => ({
6477
- type: "charTemplate",
6478
- templates: [...params.templates],
6479
- ...params.ignoreCase !== void 0 && { ignoreCase: params.ignoreCase }
6480
- }),
6481
- numericRange: ({ params }) => ({
6482
- type: "numericRange",
6483
- min: params.min,
6484
- max: params.max
6485
- }),
6486
- rut: () => ({ type: "rut" }),
6487
- esDni: () => ({ type: "esDni" }),
6488
- fiPersonalIdentityCode: () => ({ type: "fiPersonalIdentityCode" }),
6489
- inDrivingLicenseNumber: () => ({ type: "inDrivingLicenseNumber" }),
6490
- curp: () => ({ type: "curp" })
6491
- };
6492
6654
  const isCount = (value) => typeof value === "number" && Number.isInteger(value) && value > 0;
6493
6655
  const isInteger = (value) => typeof value === "number" && Number.isInteger(value);
6494
6656
  const isNonEmptyArrayOf = (value, item) => Array.isArray(value) && value.length > 0 && value.every(item);
@@ -6505,7 +6667,8 @@ const RULE_PARAMS = {
6505
6667
  digitCount: ({ lengths, min, max }) => lengths !== void 0 ? isNonEmptyArrayOf(lengths, isCount) && min === void 0 && max === void 0 : isCount(min) && isCount(max) && min <= max,
6506
6668
  allowedCharacters: ({ classes, extra }) => isNonEmptyArrayOf(classes, isCharacterClass) && (extra === void 0 || isString(extra)),
6507
6669
  charTemplate: ({ templates, ignoreCase }) => isNonEmptyArrayOf(templates, (t) => isString(t) && t !== "") && (ignoreCase === void 0 || typeof ignoreCase === "boolean"),
6508
- numericRange: ({ min, max }) => isInteger(min) && isInteger(max) && min <= max
6670
+ numericRange: ({ min, max }) => isInteger(min) && isInteger(max) && min <= max,
6671
+ maxAge: ({ years }) => isCount(years)
6509
6672
  };
6510
6673
  /**
6511
6674
  * What the projection can express today. Request-body transforms are listed
@@ -6515,7 +6678,7 @@ const RULE_PARAMS = {
6515
6678
  */
6516
6679
  const EKYC_SUPPORTED_IDS = {
6517
6680
  schemaVersions: [1],
6518
- vocabulary: "1.2",
6681
+ vocabulary: "1.3",
6519
6682
  kinds: /* @__PURE__ */ new Set([
6520
6683
  "text",
6521
6684
  "date",
@@ -6534,7 +6697,8 @@ const EKYC_SUPPORTED_IDS = {
6534
6697
  groupRules: /* @__PURE__ */ new Set(["oneOfRequired", "rulesByOption"]),
6535
6698
  optionLists: new Set(Object.keys(OPTION_LISTS)),
6536
6699
  conditions: /* @__PURE__ */ new Set(["fieldFilled"]),
6537
- prefillSources: new Set(EKYC_PREFILL_SOURCES)
6700
+ prefillSources: new Set(EKYC_PREFILL_SOURCES),
6701
+ flags: /* @__PURE__ */ new Set()
6538
6702
  };
6539
6703
  /** Today's field shape only flags `middleName` as optional. */
6540
6704
  const LEGACY_OPTIONAL_FLAG = /* @__PURE__ */ new Set(["middleName"]);
@@ -6674,9 +6838,10 @@ const MIGRATED_EKYC_SOURCES = /* @__PURE__ */ new Set([
6674
6838
  ]);
6675
6839
  /**
6676
6840
  * The bundled definition for exactly this source and country, if it is
6677
- * projectable and the rollout lets this source use it.
6841
+ * projectable and the rollout lets this source use it. `useDefinitions` is
6842
+ * the rollout answer the machine read once, when it was created.
6678
6843
  */
6679
- function selectEkycDefinition(source, country, useDefinitions = isFormDefinitionsEnabled()) {
6844
+ function selectEkycDefinition(source, country, useDefinitions) {
6680
6845
  if (!useDefinitions && MIGRATED_EKYC_SOURCES.has(source)) return void 0;
6681
6846
  const definition = bundled.select({
6682
6847
  module: "ekyc",
@@ -6778,21 +6943,6 @@ function projectField(resolved, verificationFields, country) {
6778
6943
  if (validation.length > 0) def.validation = validation;
6779
6944
  return def;
6780
6945
  }
6781
- function projectRules(rules, country, required) {
6782
- return rules.flatMap((rule) => {
6783
- const project = RULES[rule.id];
6784
- if (!project) return [];
6785
- const projected = project({
6786
- country,
6787
- required,
6788
- params: rule.params ?? {}
6789
- });
6790
- return [rule.message ? {
6791
- ...projected,
6792
- message: rule.message.key
6793
- } : projected];
6794
- });
6795
- }
6796
6946
  /**
6797
6947
  * Projects a resolved definition to today's `EkycFieldDef[]`, identical to
6798
6948
  * what `legacyBuildFieldDefs` returns for the same source and country.
@@ -6825,6 +6975,11 @@ function projectEkycFields(form, verificationFields, country) {
6825
6975
  //#endregion
6826
6976
  //#region src/modules/ekyc/ekycActions.ts
6827
6977
  const dateFormattingInstance = new DateFormattingProvider();
6978
+ /** Countries whose state is picked from a list, sent as the two-letter code. */
6979
+ const STATE_OPTIONS_BY_COUNTRY = {
6980
+ US: usStateOptions,
6981
+ BR: brStateOptions
6982
+ };
6828
6983
  function buildValidationRules(field, country, configSource) {
6829
6984
  const rules = [];
6830
6985
  if (field.required) rules.push({ type: "required" });
@@ -6845,6 +7000,10 @@ function buildValidationRules(field, country, configSource) {
6845
7000
  type: "exactLength",
6846
7001
  length: 10
6847
7002
  });
7003
+ if (field.name === "dateOfBirth") rules.push({
7004
+ type: "maxAge",
7005
+ years: 120
7006
+ });
6848
7007
  return rules;
6849
7008
  }
6850
7009
  function applyOneOfRequiredGroups(defs, configSource) {
@@ -6862,9 +7021,10 @@ function applyOneOfRequiredGroups(defs, configSource) {
6862
7021
  * this country reads it (`packages/form-definitions/catalog/ekyc`) when the
6863
7022
  * rollout allows (`selectEkycDefinition`); any other pair keeps the current
6864
7023
  * builder. `useDefinitions` is the rollout answer the machine read once, when
6865
- * it was created, so it can't change mid-session.
7024
+ * it was created, so it can't change mid-session. The options are named so a
7025
+ * caller can't swap the two booleans.
6866
7026
  */
6867
- function buildFieldDefs(fields, configSource, country, enablePhoneRisk = false, useDefinitions) {
7027
+ function buildFieldDefs(fields, configSource, country, { useDefinitions, enablePhoneRisk = false }) {
6868
7028
  const definition = selectEkycDefinition(configSource, country, useDefinitions);
6869
7029
  if (definition) return projectEkycFields(resolveForm(definition, toEkycResolveContext(fields, enablePhoneRisk)), fields, country);
6870
7030
  return legacyBuildFieldDefs(fields, configSource, country, enablePhoneRisk);
@@ -6922,7 +7082,7 @@ function legacyBuildFieldDefs(fields, configSource, country, enablePhoneRisk = f
6922
7082
  label: "verification.labels.brazilian"
6923
7083
  },
6924
7084
  {
6925
- value: "naturalizedBrazilian",
7085
+ value: "naturalized_brazilian",
6926
7086
  label: "verification.labels.naturalizedBrazilian"
6927
7087
  },
6928
7088
  {
@@ -6930,14 +7090,17 @@ function legacyBuildFieldDefs(fields, configSource, country, enablePhoneRisk = f
6930
7090
  label: "verification.labels.foreigner"
6931
7091
  },
6932
7092
  {
6933
- value: "brazilianBornAbroad",
7093
+ value: "brazilian_born_abroad",
6934
7094
  label: "verification.labels.brazilianBornAbroad"
6935
7095
  }
6936
7096
  ] });
6937
7097
  else add("nationality", "text", "verification.labels.nationality", fields.nationality);
6938
7098
  if (fields.last4SSN) add("last4SSN", "text", "verification.labels.last4SSN", fields.last4SSN, { maxLength: 4 });
6939
- if (fields.idNum) add("idNum", "text", "verification.labels.idNum", fields.idNum, { maxLength: 13 });
6940
- if (fields.idNum1) add("idNum1", "text", "verification.labels.idNum1", fields.idNum1);
7099
+ if (fields.idNum) add("idNum", "text", "verification.labels.idNum", fields.idNum, {
7100
+ maxLength: 13,
7101
+ payloadKey: "idNumber"
7102
+ });
7103
+ if (fields.idNum1) add("idNum1", "text", "verification.labels.idNum1", fields.idNum1, { payloadKey: "idNumber1" });
6941
7104
  if (fields.gender) add("gender", "radio", "verification.labels.gender", fields.gender, { options: [{
6942
7105
  value: "F",
6943
7106
  label: "common.female"
@@ -6949,23 +7112,26 @@ function legacyBuildFieldDefs(fields, configSource, country, enablePhoneRisk = f
6949
7112
  const addAddressFields = () => {
6950
7113
  const addrSource = fields.address;
6951
7114
  if (!addrSource) return;
6952
- if (HOUSE_NO_SOURCES.includes(configSource)) add("houseNo", "text", "verification.labels.houseNo", addrSource, { section: "address" });
6953
7115
  if (STREET_SOURCES.includes(configSource)) add("street", "text", "verification.labels.street", addrSource, { section: "address" });
7116
+ if (HOUSE_NO_SOURCES.includes(configSource)) add("houseNo", "text", "verification.labels.houseNo", addrSource, { section: "address" });
6954
7117
  if (APARTMENT_SOURCES.includes(configSource)) add("apartment", "text", "verification.labels.apartment", addrSource, {
6955
7118
  section: "address",
6956
7119
  placeholder: "verification.placeholder.apartment"
6957
7120
  });
6958
7121
  if (CITY_SOURCES.includes(configSource)) add("city", "text", "verification.labels.city", addrSource, { section: "address" });
6959
- if (ADDRESS_STATE_SOURCES.includes(configSource)) add("state", country === "US" ? "dropdown" : "text", country === "US" ? "verification.labels.chooseState" : "verification.labels.state", addrSource, {
6960
- section: "address",
6961
- ...country === "US" ? {
6962
- options: usStateOptions,
6963
- placeholder: "verification.placeholder.state"
6964
- } : {
6965
- placeholder: "verification.placeholder.stateCode",
6966
- placeholderParams: { states: STATE_CODE_HINTS[country] ?? "" }
6967
- }
6968
- });
7122
+ if (ADDRESS_STATE_SOURCES.includes(configSource)) {
7123
+ const stateOptions = STATE_OPTIONS_BY_COUNTRY[country];
7124
+ add("state", stateOptions ? "dropdown" : "text", stateOptions ? "verification.labels.chooseState" : "verification.labels.state", addrSource, {
7125
+ section: "address",
7126
+ ...stateOptions ? {
7127
+ options: stateOptions,
7128
+ placeholder: "verification.placeholder.state"
7129
+ } : {
7130
+ placeholder: "verification.placeholder.stateCode",
7131
+ placeholderParams: { states: STATE_CODE_HINTS[country] ?? "" }
7132
+ }
7133
+ });
7134
+ }
6969
7135
  if (POSTAL_CODE_SOURCES.includes(configSource)) add("postalCode", "text", country === "US" ? "verification.labels.zipCode" : "verification.labels.postalCode", addrSource, {
6970
7136
  section: "address",
6971
7137
  maxLength: getPostalCodeMaxLength(country)
@@ -7168,6 +7334,38 @@ function processFieldValueByName(name, value, fieldsCountry) {
7168
7334
  if (name === "panNumber") return value.replace(/[^a-zA-Z0-9]/g, "").toUpperCase();
7169
7335
  return value;
7170
7336
  }
7337
+ /** Whether the form shows a field: not hidden, and not an email shown elsewhere. */
7338
+ const isVisibleEkycField = (field, hideEmail) => field.displayMode !== "hidden" && !(hideEmail && field.name === "email");
7339
+ /**
7340
+ * Splits the form into steps, one per run of visible fields with the same
7341
+ * section, in field order. A section with no visible field has no step.
7342
+ */
7343
+ function buildEkycSteps(fields, hideEmail) {
7344
+ const steps = [];
7345
+ for (const field of fields) {
7346
+ if (!isVisibleEkycField(field, hideEmail)) continue;
7347
+ const id = field.section ?? "personal";
7348
+ const last = steps[steps.length - 1];
7349
+ if (last?.id === id) last.fieldNames.push(field.name);
7350
+ else steps.push({
7351
+ id,
7352
+ fieldNames: [field.name]
7353
+ });
7354
+ }
7355
+ return steps;
7356
+ }
7357
+ /**
7358
+ * The step index kept within the steps the form has now. A missing index, as
7359
+ * in a snapshot taken before steps existed, is the first step.
7360
+ */
7361
+ const clampStepIndex = (index, steps) => Number.isFinite(index) ? Math.max(0, Math.min(index, steps.length - 1)) : 0;
7362
+ /** Whether a step's fields have no validation errors. */
7363
+ const isStepValid = (step, errors) => !step || step.fieldNames.every((name) => !errors?.[name]);
7364
+ /** The first step with a validation error, or `undefined` when none has one. */
7365
+ function firstStepWithError(steps, errors) {
7366
+ const index = steps.findIndex((step) => !isStepValid(step, errors));
7367
+ return index === -1 ? void 0 : index;
7368
+ }
7171
7369
  //#endregion
7172
7370
  //#region src/modules/ekyc/ekycServices.ts
7173
7371
  /** Fetches module configuration for EXTERNAL_VERIFICATION */
@@ -7215,6 +7413,14 @@ async function submitEkyc(data, signal) {
7215
7413
  //#region src/modules/ekyc/ekycGuards.ts
7216
7414
  const hasNoValidationErrorsGuard = ({ context }) => Object.keys(context.validationErrors ?? {}).length === 0;
7217
7415
  const hasFlowIdGuard = ({ context }) => !!context.config.flowId;
7416
+ /** The backend runs the checks itself, so the step finishes without a form. */
7417
+ const isAutoExecutionGuard = ({ context }) => context.config.autoExecution === true;
7418
+ /** The fetched module config turns on auto execution. */
7419
+ const isModuleConfigAutoExecutionGuard = ({ event }) => event.output?.autoExecution === true;
7420
+ /** A `flowId` config whose module config never arrived (its load failed). */
7421
+ const needsModuleConfigGuard = ({ context }) => !!context.config.flowId && context.moduleConfig === void 0;
7422
+ /** A form with a phone field whose phone rules haven't loaded. */
7423
+ const needsPhoneRulesGuard = ({ context }) => context.fields.some((field) => field.type === "phone") && getPhoneValidation() === void 0;
7218
7424
  const hasVerificationFieldsGuard = ({ context }) => !!context.config.verificationFields;
7219
7425
  const COUNTRY_NOT_SUPPORTED_MSG = "Request unsuccessful. Country not supported for EKYC.";
7220
7426
  const isCountryNotSupportedGuard = ({ event }) => {
@@ -7227,9 +7433,17 @@ const fetchModuleConfigActor = fromPromise(async ({ input, signal }) => {
7227
7433
  const phoneRules = loadPhoneValidator();
7228
7434
  phoneRules.catch(() => void 0);
7229
7435
  const config = await fetchModuleConfig(input.flowId, signal);
7230
- if (getEKYCFields(config).phone !== false) await phoneRules;
7436
+ if (config.autoExecution !== true && getEKYCFields(config).phone !== false) await phoneRules;
7231
7437
  return config;
7232
7438
  });
7439
+ /**
7440
+ * Loads the phone validation rules for a config that arrived already resolved
7441
+ * (a workflow node, or `verificationFields`), which skips
7442
+ * `fetchModuleConfigActor`. Only a form with a phone field waits for them.
7443
+ */
7444
+ const loadPhoneRulesActor = fromPromise(async ({ input }) => {
7445
+ if (input.hasPhone) await loadPhoneValidator();
7446
+ });
7233
7447
  /** The first address suggestion for the first query that has one. */
7234
7448
  async function firstSuggestion(queries, signal) {
7235
7449
  for (const query of queries) try {
@@ -7278,6 +7492,12 @@ const prefillConfig = (context) => ({
7278
7492
  riskAddons: context.moduleConfig?.riskAddons,
7279
7493
  useDefinitions: context._formDefinitions
7280
7494
  });
7495
+ const stepsOf = (context) => buildEkycSteps(context.fields, context.hideEmail);
7496
+ /** The step the user is on, kept within the steps the form has now. */
7497
+ const currentStep = (context) => {
7498
+ const steps = stepsOf(context);
7499
+ return steps[clampStepIndex(context.currentStepIndex, steps)];
7500
+ };
7281
7501
  const omitKeys = (errors, keys) => {
7282
7502
  if (!errors) return void 0;
7283
7503
  const next = { ...errors };
@@ -7292,6 +7512,7 @@ const ekycMachine = setup({
7292
7512
  },
7293
7513
  actors: {
7294
7514
  fetchModuleConfig: fetchModuleConfigActor,
7515
+ loadPhoneRules: loadPhoneRulesActor,
7295
7516
  fetchPrefillData: fetchPrefillDataActor,
7296
7517
  submitEkyc: submitEkycActor,
7297
7518
  debounceSearch: debounceSearchActor
@@ -7307,7 +7528,10 @@ const ekycMachine = setup({
7307
7528
  verificationFields: vFields,
7308
7529
  configSource: source,
7309
7530
  fieldsCountry: country,
7310
- fields: buildFieldDefs(vFields, source, country, config.enablePhoneRisk, context._formDefinitions),
7531
+ fields: buildFieldDefs(vFields, source, country, {
7532
+ useDefinitions: context._formDefinitions,
7533
+ enablePhoneRisk: config.enablePhoneRisk
7534
+ }),
7311
7535
  displayModes: getEKYCDisplayModes(config)
7312
7536
  };
7313
7537
  }),
@@ -7379,10 +7603,35 @@ const ekycMachine = setup({
7379
7603
  const errors = validateEkycForm(context.values, context.fields);
7380
7604
  return { validationErrors: Object.keys(errors).length > 0 ? errors : void 0 };
7381
7605
  }),
7606
+ validateCurrentStep: assign(({ context }) => {
7607
+ const step = currentStep(context);
7608
+ if (!step) return {};
7609
+ const next = { ...context.validationErrors ?? {} };
7610
+ for (const name of step.fieldNames) {
7611
+ const message = validateEkycField(context.values, name, context.fields);
7612
+ if (message) next[name] = message;
7613
+ else delete next[name];
7614
+ }
7615
+ return { validationErrors: Object.keys(next).length > 0 ? next : void 0 };
7616
+ }),
7617
+ advanceStep: assign(({ context }) => {
7618
+ const steps = stepsOf(context);
7619
+ return { currentStepIndex: clampStepIndex(clampStepIndex(context.currentStepIndex, steps) + 1, steps) };
7620
+ }),
7621
+ previousStep: assign(({ context }) => {
7622
+ const steps = stepsOf(context);
7623
+ return { currentStepIndex: clampStepIndex(clampStepIndex(context.currentStepIndex, steps) - 1, steps) };
7624
+ }),
7625
+ goToFirstStepWithError: assign(({ context }) => {
7626
+ const index = firstStepWithError(stepsOf(context), context.validationErrors);
7627
+ return index === void 0 ? {} : { currentStepIndex: index };
7628
+ }),
7629
+ resetStep: assign({ currentStepIndex: () => 0 }),
7382
7630
  fillAddressFields: assign(({ context, event }) => {
7383
7631
  const { suggestion } = event;
7384
7632
  const activeFields = new Set(context.fields.filter((f) => !isLocked(f)).map((f) => f.name));
7385
- const { values: newValues } = fillFromSuggestion(context.values, {}, suggestion, activeFields);
7633
+ const { values: filled } = fillFromSuggestion(context.values, {}, suggestion, activeFields);
7634
+ const newValues = keepSuggestedStateInOptions(context.fields, context.values, filled);
7386
7635
  const clearedErrors = omitKeys(context.validationErrors, ADDRESS_AUTOCOMPLETE_KEYS);
7387
7636
  const streetError = getStreetLevelErrorForSuggestion(suggestion, activeFields);
7388
7637
  const validationErrors = {
@@ -7406,10 +7655,19 @@ const ekycMachine = setup({
7406
7655
  guards: {
7407
7656
  hasNoValidationErrors: hasNoValidationErrorsGuard,
7408
7657
  hasFlowId: hasFlowIdGuard,
7658
+ isAutoExecution: isAutoExecutionGuard,
7659
+ isModuleConfigAutoExecution: isModuleConfigAutoExecutionGuard,
7409
7660
  hasVerificationFields: hasVerificationFieldsGuard,
7661
+ needsModuleConfig: needsModuleConfigGuard,
7662
+ needsPhoneRules: needsPhoneRulesGuard,
7410
7663
  isCountryNotSupported: isCountryNotSupportedGuard,
7411
7664
  shouldAutoSubmit: ({ context }) => !context.autoSubmitted && showsNoFields(context),
7412
- showsNoFields: ({ context }) => showsNoFields(context)
7665
+ showsNoFields: ({ context }) => showsNoFields(context),
7666
+ isLastStep: ({ context }) => {
7667
+ const steps = stepsOf(context);
7668
+ return clampStepIndex(context.currentStepIndex, steps) >= steps.length - 1;
7669
+ },
7670
+ currentStepHasNoErrors: ({ context }) => isStepValid(currentStep(context), context.validationErrors)
7413
7671
  }
7414
7672
  }).createMachine({
7415
7673
  id: "ekyc",
@@ -7431,6 +7689,7 @@ const ekycMachine = setup({
7431
7689
  autoSubmitted: false,
7432
7690
  errorMessage: "",
7433
7691
  submitError: "",
7692
+ currentStepIndex: 0,
7434
7693
  _formDefinitions: isFormDefinitionsEnabled(),
7435
7694
  _searchQuery: ""
7436
7695
  };
@@ -7438,11 +7697,15 @@ const ekycMachine = setup({
7438
7697
  states: {
7439
7698
  idle: { on: { LOAD: [
7440
7699
  {
7441
- target: "loading",
7700
+ target: "finished",
7701
+ guard: "isAutoExecution"
7702
+ },
7703
+ {
7704
+ target: "loading.moduleConfig",
7442
7705
  guard: "hasFlowId"
7443
7706
  },
7444
7707
  {
7445
- target: "prefilling",
7708
+ target: "loading.phoneRules",
7446
7709
  guard: "hasVerificationFields",
7447
7710
  actions: assign(({ context }) => {
7448
7711
  const vFields = context.config.verificationFields;
@@ -7452,38 +7715,62 @@ const ekycMachine = setup({
7452
7715
  verificationFields: vFields,
7453
7716
  configSource: source,
7454
7717
  fieldsCountry: country,
7455
- fields: buildFieldDefs(vFields, source, country, context.config.enablePhoneRisk, context._formDefinitions)
7718
+ fields: buildFieldDefs(vFields, source, country, {
7719
+ useDefinitions: context._formDefinitions,
7720
+ enablePhoneRisk: context.config.enablePhoneRisk
7721
+ })
7456
7722
  };
7457
7723
  })
7458
7724
  },
7459
7725
  { target: "misconfigured" }
7460
7726
  ] } },
7461
- loading: { invoke: {
7462
- id: "fetchModuleConfig",
7463
- src: "fetchModuleConfig",
7464
- input: ({ context }) => ({ flowId: context.config.flowId }),
7465
- onDone: {
7466
- target: "prefilling",
7467
- actions: "setModuleConfig"
7468
- },
7469
- onError: {
7470
- target: "error",
7471
- actions: "setErrorMessage"
7727
+ loading: {
7728
+ initial: "moduleConfig",
7729
+ states: {
7730
+ moduleConfig: { invoke: {
7731
+ id: "fetchModuleConfig",
7732
+ src: "fetchModuleConfig",
7733
+ input: ({ context }) => ({ flowId: context.config.flowId }),
7734
+ onDone: [{
7735
+ target: "#ekyc.finished",
7736
+ guard: "isModuleConfigAutoExecution"
7737
+ }, {
7738
+ target: "#ekyc.prefilling",
7739
+ actions: "setModuleConfig"
7740
+ }],
7741
+ onError: {
7742
+ target: "#ekyc.error",
7743
+ actions: "setErrorMessage"
7744
+ }
7745
+ } },
7746
+ phoneRules: { invoke: {
7747
+ id: "loadPhoneRules",
7748
+ src: "loadPhoneRules",
7749
+ input: ({ context }) => ({ hasPhone: context.fields.some((field) => field.type === "phone") }),
7750
+ onDone: { target: "#ekyc.prefilling" },
7751
+ onError: {
7752
+ target: "#ekyc.error",
7753
+ actions: "setErrorMessage"
7754
+ }
7755
+ } }
7472
7756
  }
7473
- } },
7474
- prefilling: { invoke: {
7475
- id: "fetchPrefillData",
7476
- src: "fetchPrefillData",
7477
- input: ({ context }) => ({ addressOrigin: prefillAddressOrigin(prefillConfig(context)) }),
7478
- onDone: {
7479
- target: "form",
7480
- actions: "applyPrefillData"
7481
- },
7482
- onError: {
7483
- target: "form",
7484
- actions: "applyEmptyPrefill"
7757
+ },
7758
+ prefilling: {
7759
+ entry: "resetStep",
7760
+ invoke: {
7761
+ id: "fetchPrefillData",
7762
+ src: "fetchPrefillData",
7763
+ input: ({ context }) => ({ addressOrigin: prefillAddressOrigin(prefillConfig(context)) }),
7764
+ onDone: {
7765
+ target: "form",
7766
+ actions: "applyPrefillData"
7767
+ },
7768
+ onError: {
7769
+ target: "form",
7770
+ actions: "applyEmptyPrefill"
7771
+ }
7485
7772
  }
7486
- } },
7773
+ },
7487
7774
  form: {
7488
7775
  initial: "inputting",
7489
7776
  states: {
@@ -7511,7 +7798,8 @@ const ekycMachine = setup({
7511
7798
  RESULTS: {
7512
7799
  target: "inputting",
7513
7800
  actions: "setAddressSuggestions"
7514
- }
7801
+ },
7802
+ SUBMIT: { target: "validatingSubmit" }
7515
7803
  }
7516
7804
  },
7517
7805
  validatingSubmit: {
@@ -7519,10 +7807,29 @@ const ekycMachine = setup({
7519
7807
  always: [{
7520
7808
  guard: "hasNoValidationErrors",
7521
7809
  target: "#ekyc.submitting"
7810
+ }, {
7811
+ target: "inputting",
7812
+ actions: "goToFirstStepWithError"
7813
+ }]
7814
+ },
7815
+ validatingStep: {
7816
+ entry: "validateCurrentStep",
7817
+ always: [{
7818
+ guard: "currentStepHasNoErrors",
7819
+ target: "inputting",
7820
+ actions: "advanceStep"
7522
7821
  }, { target: "inputting" }]
7523
7822
  }
7524
7823
  },
7525
7824
  on: {
7825
+ NEXT_STEP: [{
7826
+ guard: "isLastStep",
7827
+ target: ".validatingSubmit"
7828
+ }, { target: ".validatingStep" }],
7829
+ PREVIOUS_STEP: {
7830
+ target: ".inputting",
7831
+ actions: "previousStep"
7832
+ },
7526
7833
  SEARCH_ADDRESS: {
7527
7834
  target: ".searching",
7528
7835
  actions: assign(({ event }) => ({
@@ -7562,10 +7869,22 @@ const ekycMachine = setup({
7562
7869
  } },
7563
7870
  success: { after: { 3e3: "finished" } },
7564
7871
  error: { on: {
7565
- RETRY: {
7566
- target: "form",
7567
- actions: ["clearErrorMessage", assign({ autoSubmitted: () => false })]
7568
- },
7872
+ RETRY: [
7873
+ {
7874
+ target: "loading.moduleConfig",
7875
+ guard: "needsModuleConfig",
7876
+ actions: "clearErrorMessage"
7877
+ },
7878
+ {
7879
+ target: "loading.phoneRules",
7880
+ guard: "needsPhoneRules",
7881
+ actions: "clearErrorMessage"
7882
+ },
7883
+ {
7884
+ target: "form",
7885
+ actions: ["clearErrorMessage", assign({ autoSubmitted: () => false })]
7886
+ }
7887
+ ],
7569
7888
  SKIP: { target: "finished" },
7570
7889
  CLOSE: { target: "closed" }
7571
7890
  } },
@@ -7575,4 +7894,4 @@ const ekycMachine = setup({
7575
7894
  }
7576
7895
  });
7577
7896
  //#endregion
7578
- export { ekycMachine as t };
7897
+ export { isStepValid as i, buildEkycSteps as n, clampStepIndex as r, ekycMachine as t };