@incodetech/core 0.0.0-dev-20260923-1a4dbec8 → 0.0.0-dev-20260924-9e40faf4

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 (76) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-B5poAx1_.esm.js → BrowserDiagnosticsCryptoProvider-D0e-1PEZ.esm.js} +1 -1
  2. package/dist/{FaceDetectionProvider-Ydsahps4.esm.js → FaceDetectionProvider-DbssECIq.esm.js} +4 -4
  3. package/dist/{ekycStateMachine-BjNeL6ce.esm.js → PhoneValidationProvider-Dok_Det7.esm.js} +160 -779
  4. package/dist/ae-signature.esm.js +1 -1
  5. package/dist/{apiError-B5izenZ8.esm.js → apiError-BBsde_zZ.esm.js} +1 -1
  6. package/dist/authentication.esm.js +2 -2
  7. package/dist/{authenticationManager-xf4GoLxc.esm.js → authenticationManager-CfHmU40H.esm.js} +3 -3
  8. package/dist/{authenticationStateMachine-BkvMIijO.esm.js → authenticationStateMachine-DIijLkkt.esm.js} +2 -2
  9. package/dist/curp-validation.esm.js +2 -2
  10. package/dist/{curpValidationManager-BzS_Dlcq.esm.js → curpValidationManager-BHocstXa.esm.js} +13 -20
  11. package/dist/{curpValidationStateMachine-Bg_Lsk2V.esm.js → curpValidationStateMachine-CDcMdfvW.esm.js} +1 -1
  12. package/dist/{deepsightLoader-L0JGAPDe.esm.js → deepsightLoader-Cxt11Cx1.esm.js} +3 -3
  13. package/dist/document-capture.d.ts +1 -1
  14. package/dist/document-capture.esm.js +1 -1
  15. package/dist/{documentCaptureManager-CbAGkHWh.d.ts → documentCaptureManager-C8eO0hbv.d.ts} +1 -1
  16. package/dist/{documentCaptureManager-7aQhPQnb.esm.js → documentCaptureManager-CLtex74O.esm.js} +7 -14
  17. package/dist/dynamic-forms.esm.js +2 -2
  18. package/dist/{dynamicFormsManager-l_3MYzBs.esm.js → dynamicFormsManager-CXKgiYov.esm.js} +1 -1
  19. package/dist/{dynamicFormsStateMachine-DOF7ba6-.esm.js → dynamicFormsStateMachine-CJ8bA1oW.esm.js} +1 -1
  20. package/dist/ekyb.esm.js +3 -3
  21. package/dist/{ekybManager-lxNzE1kk.esm.js → ekybManager-BSIlNfRf.esm.js} +21 -25
  22. package/dist/{ekybStateMachine-DNBBT-S9.esm.js → ekybStateMachine-z0t8szV3.esm.js} +1 -1
  23. package/dist/ekyc.esm.js +2 -2
  24. package/dist/{ekycManager-DoGZkFZQ.esm.js → ekycManager-DEbkqrHx.esm.js} +27 -34
  25. package/dist/ekycStateMachine-UjaYNdNf.esm.js +688 -0
  26. package/dist/electronic-signature.esm.js +1 -1
  27. package/dist/{electronicSignatureManager-COJYfU0x.esm.js → electronicSignatureManager-B-IMLsp-.esm.js} +5 -5
  28. package/dist/email.esm.js +1 -1
  29. package/dist/{emailManager-CTNtCZJI.esm.js → emailManager-CeSfUjcz.esm.js} +17 -23
  30. package/dist/extensibility.d.ts +3 -3
  31. package/dist/extensibility.esm.js +17 -17
  32. package/dist/{faceCaptureManagerFactory-CIj0Cuh2.esm.js → faceCaptureManagerFactory-SDNPwwLR.esm.js} +2 -2
  33. package/dist/{faceCaptureSetup-LKIkhOFU.esm.js → faceCaptureSetup-bzpheUcb.esm.js} +3 -3
  34. package/dist/{feature-management-BdEYtp-i.esm.js → feature-management-B_C9uoMn.esm.js} +1 -1
  35. package/dist/feature-management.esm.js +1 -1
  36. package/dist/flow.esm.js +3 -3
  37. package/dist/{flowCompletionService-__FouXqN.esm.js → flowCompletionService-Cu5uEJuu.esm.js} +1 -1
  38. package/dist/{flowServices-Bzs_X1o4.esm.js → flowServices-BQtiexrG.esm.js} +4 -4
  39. package/dist/geolocation.esm.js +2 -2
  40. package/dist/{geolocationManager-B9ljrS0X.esm.js → geolocationManager-DSDFdGbn.esm.js} +4 -5
  41. package/dist/{geolocationStateMachine-DjxU3gOp.esm.js → geolocationStateMachine-BJR0ZbYj.esm.js} +1 -1
  42. package/dist/id-selfie-flow.esm.js +7 -7
  43. package/dist/id.esm.js +3 -3
  44. package/dist/{idCaptureDefaults-BJglMiCL.esm.js → idCaptureDefaults-BRdqVIve.esm.js} +1 -1
  45. package/dist/{idCaptureManager-C2DaehZ0.esm.js → idCaptureManager-xHV3aAVd.esm.js} +3 -3
  46. package/dist/{idCaptureServices-B3rNM_gb.esm.js → idCaptureServices-P9BCoM4V.esm.js} +3 -3
  47. package/dist/{idCaptureStateMachine-CnAu9UcE.esm.js → idCaptureStateMachine-BM3TBJhd.esm.js} +9 -9
  48. package/dist/identity-reuse.d.ts +1 -1
  49. package/dist/{identityReuseManager-BBE2R_S7.d.ts → identityReuseManager-x2QG6QAm.d.ts} +4 -4
  50. package/dist/index.esm.js +1 -1
  51. package/dist/personhood.esm.js +4 -4
  52. package/dist/phone.d.ts +1 -1
  53. package/dist/phone.esm.js +1 -1
  54. package/dist/{phoneManager-DNzWb7_d.d.ts → phoneManager-D4FVaENS.d.ts} +9 -1
  55. package/dist/{phoneManager-tPB-SJvp.esm.js → phoneManager-Do-HaC6Z.esm.js} +19 -17
  56. package/dist/qe-signature.esm.js +1 -1
  57. package/dist/{runChildModule-CNOpKnr8.esm.js → runChildModule-BpOMtasT.esm.js} +1 -1
  58. package/dist/{sdkVersion-DD5MTu4p.esm.js → sdkVersion-DQRoTd6P.esm.js} +1 -1
  59. package/dist/selfie.esm.js +5 -5
  60. package/dist/{selfieManager-BLCxM_Ci.esm.js → selfieManager-CNW7zH1i.esm.js} +3 -3
  61. package/dist/{selfieStateMachine-BYUhydKm.esm.js → selfieStateMachine-R9J8mADt.esm.js} +2 -2
  62. package/dist/{session-cbcxp2lM.esm.js → session-BEhlnolX.esm.js} +3 -3
  63. package/dist/session.esm.js +4 -4
  64. package/dist/{sessionInitializer-BQnUIKSb.esm.js → sessionInitializer-DV11I5N9.esm.js} +3 -3
  65. package/dist/{setup-CzOLxZwN.esm.js → setup--2aSSY35.esm.js} +4 -4
  66. package/dist/signature.esm.js +1 -1
  67. package/dist/{signatureManager-BEhnPTe8.esm.js → signatureManager-CS217sC0.esm.js} +4 -8
  68. package/dist/{trueSightService-BWs2WTYv.esm.js → trueSightService-BFrcoNz3.esm.js} +2 -2
  69. package/dist/video-selfie.esm.js +4 -4
  70. package/dist/{videoSelfieCameraWarmer-BnPBPjIw.esm.js → videoSelfieCameraWarmer-Cx0iEoav.esm.js} +3 -3
  71. package/dist/wasm.esm.js +2 -2
  72. package/dist/watchlist-for-business.esm.js +1 -1
  73. package/dist/{watchlistForBusinessManager-CwMC60YS.esm.js → watchlistForBusinessManager-BUWO4S6n.esm.js} +4 -2
  74. package/dist/workflow.d.ts +4 -4
  75. package/dist/workflow.esm.js +16 -16
  76. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-COJYfU0x.esm.js";
1
+ import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-B-IMLsp-.esm.js";
2
2
  //#region src/modules/ae-signature/index.ts
3
3
  function createAeSignatureManager(options) {
4
4
  return createElectronicSignatureManager({ config: {
@@ -1,4 +1,4 @@
1
- import { l as trueSightLog, u as categoryForEndpoint } from "./trueSightService-BWs2WTYv.esm.js";
1
+ import { l as trueSightLog, u as categoryForEndpoint } from "./trueSightService-BFrcoNz3.esm.js";
2
2
  //#region src/internal/http/apiError.ts
3
3
  /**
4
4
  * Incode API error.
@@ -1,3 +1,3 @@
1
- import { t as authenticationMachine } from "./authenticationStateMachine-BkvMIijO.esm.js";
2
- import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-xf4GoLxc.esm.js";
1
+ import { t as authenticationMachine } from "./authenticationStateMachine-DIijLkkt.esm.js";
2
+ import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-CfHmU40H.esm.js";
3
3
  export { authenticationMachine, createAuthenticationActor, createAuthenticationManager };
@@ -1,9 +1,9 @@
1
1
  import { r as WasmUtilProvider } from "./safeStorage-C511Hltw.esm.js";
2
- import { l as BrowserStorageProvider } from "./setup-CzOLxZwN.esm.js";
2
+ import { l as BrowserStorageProvider } from "./setup--2aSSY35.esm.js";
3
3
  import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
4
4
  import { s as createActor } from "./xstate.esm-Bg3FuvIs.esm.js";
5
- import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-CIj0Cuh2.esm.js";
6
- import { t as authenticationMachine } from "./authenticationStateMachine-BkvMIijO.esm.js";
5
+ import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-SDNPwwLR.esm.js";
6
+ import { t as authenticationMachine } from "./authenticationStateMachine-DIijLkkt.esm.js";
7
7
  //#region src/modules/authentication/authenticationActor.ts
8
8
  function createAuthenticationActor(options) {
9
9
  const dependencies = options.dependencies ?? {
@@ -1,7 +1,7 @@
1
1
  import { i as assign } from "./xstate.esm-Bg3FuvIs.esm.js";
2
2
  import { n as fromPromise } from "./xstate-actors.esm-Ccyzgxj1.esm.js";
3
- import { n as createDefaultProtectedFaceControllerActor, t as faceCaptureMachine } from "./faceCaptureSetup-LKIkhOFU.esm.js";
4
- import { c as isOnDeviceMode } from "./FaceDetectionProvider-Ydsahps4.esm.js";
3
+ import { n as createDefaultProtectedFaceControllerActor, t as faceCaptureMachine } from "./faceCaptureSetup-bzpheUcb.esm.js";
4
+ import { c as isOnDeviceMode } from "./FaceDetectionProvider-DbssECIq.esm.js";
5
5
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
6
6
  import { o as PROTECTED_CAPTURE_TARGET } from "./createCameraCycleOwnership-BjoMVvya.esm.js";
7
7
  //#region src/modules/authentication/authenticationErrorUtils.ts
@@ -1,3 +1,3 @@
1
- import { i as mexicanStates, n as ENTER_CURP_FIELD, r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-Bg_Lsk2V.esm.js";
2
- import { n as createCurpValidationManagerFromActor, t as createCurpValidationManager } from "./curpValidationManager-BzS_Dlcq.esm.js";
1
+ import { a as mexicanStates, n as ENTER_CURP_FIELD, r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-CDcMdfvW.esm.js";
2
+ import { n as createCurpValidationManagerFromActor, t as createCurpValidationManager } from "./curpValidationManager-BHocstXa.esm.js";
3
3
  export { ENTER_CURP_FIELD, GENERATE_CURP_FIELDS, createCurpValidationManager, createCurpValidationManagerFromActor, curpValidationMachine, mexicanStates };
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { s as createActor, u as createManager } from "./xstate.esm-Bg3FuvIs.esm.js";
4
- import { t as curpValidationMachine } from "./curpValidationStateMachine-Bg_Lsk2V.esm.js";
4
+ import { i as isValidCurp, r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-CDcMdfvW.esm.js";
5
5
  //#region src/modules/curp-validation/curpValidationActor.ts
6
6
  function createCurpValidationActor(options) {
7
7
  return createActor(curpValidationMachine, { input: { config: options.config } }).start();
@@ -21,34 +21,27 @@ const hasNoErrors = (errors) => Object.keys(errors ?? {}).length === 0;
21
21
  * The Figma sections name the analytics family as `CURP.EnterCURP.*` (verify
22
22
  * path) and `CURP.Gene.*` (generate path), with `CURP` as the module token.
23
23
  *
24
- * Figma screens that have no dedicated state-machine counterpart yet
25
- * (intentionally not mapped here — they collapse into the section's primary
26
- * screen until the SM surfaces them):
24
+ * Input completeness and visible validation errors are derived from context.
25
+ * `CURP.Gene.dropdwon` remains UI-only; the manager has no picker-open state.
27
26
  *
28
- * - `CURP.EnterCURP.filled` — UI sub-state of `enterCurp.inputting` (input
29
- * has a valid value but submit hasn't been pressed yet).
30
- * - `CURP.EnterCURP.error` — UI inline validation error on `enterCurp`.
31
- * - `CURP.Gene.dropdwon` (sic — Figma typo for "dropdown") and
32
- * `CURP.Gene.filled` — UI sub-states of `generateCurp.inputting`.
33
- *
34
- * `finished` is mapped to `CURP.EnterCURP.Verified` to keep the user on the
35
- * last visible Figma success screen (the happy-path destination), preventing
36
- * the adapter from falling back to the generic `<module>.finished` default.
37
- * `closed` is intentionally left unmapped (terminal user-dismissed state —
38
- * handled by `moduleClosed`).
27
+ * `finished` has no visible screen: verification failures, exhausted
28
+ * generation attempts and deferred results can all finish the module. Only
29
+ * the `success` state reports verified.
39
30
  */
40
31
  function getCurpValidationScreenName(snapshot) {
41
32
  const stateName = topLevelStateName(snapshot.value);
42
33
  if (stateName === void 0) return void 0;
43
34
  switch (stateName) {
44
- case "idle":
45
- case "enterCurp": return "CURP.EnterCURP.default";
35
+ case "idle": return "CURP.EnterCURP.default";
36
+ case "enterCurp":
37
+ if (!hasNoErrors(snapshot.context.enterCurpValidationErrors)) return "CURP.EnterCURP.error";
38
+ return isValidCurp(snapshot.context.curp) ? "CURP.EnterCURP.filled" : "CURP.EnterCURP.default";
46
39
  case "loading": return "CURP.EnterCURP.processing";
47
40
  case "verifying": return "CURP.EnterCURP.verifying";
48
- case "success":
49
- case "finished": return "CURP.EnterCURP.Verified";
41
+ case "success": return "CURP.EnterCURP.Verified";
42
+ case "finished": return "";
50
43
  case "failure": return "CURP.EnterCURP.notVerify";
51
- case "generateCurp": return "CURP.Gene.default";
44
+ case "generateCurp": return GENERATE_CURP_FIELDS.filter((field) => field.required).every((field) => snapshot.context.generateForm[field.key].trim().length > 0) ? "CURP.Gene.filled" : "CURP.Gene.default";
52
45
  case "generating": return "CURP.Gene.generating";
53
46
  case "confirmCurp": return "CURP.Gene.confirm";
54
47
  case "generateError": return "CURP.Gene.error";
@@ -607,4 +607,4 @@ const curpValidationMachine = setup({
607
607
  }
608
608
  });
609
609
  //#endregion
610
- export { mexicanStates as i, ENTER_CURP_FIELD as n, GENERATE_CURP_FIELDS as r, curpValidationMachine as t };
610
+ export { mexicanStates as a, isValidCurp as i, ENTER_CURP_FIELD as n, GENERATE_CURP_FIELDS as r, curpValidationMachine as t };
@@ -1,7 +1,7 @@
1
- import { l as trueSightLog } from "./trueSightService-BWs2WTYv.esm.js";
1
+ import { l as trueSightLog } from "./trueSightService-BFrcoNz3.esm.js";
2
2
  import { r as WasmUtilProvider } from "./safeStorage-C511Hltw.esm.js";
3
- import { _ as IpifyProvider, b as BrowserEnvironmentProvider, h as isBrowserSimulation, n as getFingerprintEnabled, t as getDisableIpify, v as getThumbmarkId } from "./sessionInitializer-BQnUIKSb.esm.js";
4
- import { t as SDK_VERSION } from "./sdkVersion-DD5MTu4p.esm.js";
3
+ import { _ as IpifyProvider, b as BrowserEnvironmentProvider, h as isBrowserSimulation, n as getFingerprintEnabled, t as getDisableIpify, v as getThumbmarkId } from "./sessionInitializer-DV11I5N9.esm.js";
4
+ import { t as SDK_VERSION } from "./sdkVersion-DQRoTd6P.esm.js";
5
5
  import { t as getParsedUserAgent } from "./getParsedUserAgent-B2iFDql1.esm.js";
6
6
  import { t as getUserAgent } from "./getBrowser-CBiibsL-.esm.js";
7
7
  import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-Czjlp68o.esm.js";
@@ -1,3 +1,3 @@
1
1
  import { a as DocumentCaptureErrorCode, c as DocumentType, n as DOCUMENT_CAPTURE_ERROR_CODES, r as DocumentCaptureConfig, s as DocumentCaptureNextPageType } from "./types-BjSly8cp.js";
2
- import { a as DocumentCaptureActor, i as createDocumentCaptureManagerFromActor, n as DocumentCaptureState, o as documentCaptureMachine, r as createDocumentCaptureManager, t as DocumentCaptureManager } from "./documentCaptureManager-CbAGkHWh.js";
2
+ import { a as DocumentCaptureActor, i as createDocumentCaptureManagerFromActor, n as DocumentCaptureState, o as documentCaptureMachine, r as createDocumentCaptureManager, t as DocumentCaptureManager } from "./documentCaptureManager-C8eO0hbv.js";
3
3
  export { DOCUMENT_CAPTURE_ERROR_CODES, type DocumentCaptureActor, type DocumentCaptureConfig, type DocumentCaptureErrorCode, type DocumentCaptureManager, type DocumentCaptureNextPageType, type DocumentCaptureState, type DocumentType, createDocumentCaptureManager, createDocumentCaptureManagerFromActor, documentCaptureMachine };
@@ -1,3 +1,3 @@
1
1
  import { n as DOCUMENT_CAPTURE_ERROR_CODES, t as documentCaptureMachine } from "./documentCaptureStateMachine-C8p2vZQU.esm.js";
2
- import { n as createDocumentCaptureManagerFromActor, t as createDocumentCaptureManager } from "./documentCaptureManager-7aQhPQnb.esm.js";
2
+ import { n as createDocumentCaptureManagerFromActor, t as createDocumentCaptureManager } from "./documentCaptureManager-CLtex74O.esm.js";
3
3
  export { DOCUMENT_CAPTURE_ERROR_CODES, createDocumentCaptureManager, createDocumentCaptureManagerFromActor, documentCaptureMachine };
@@ -252,7 +252,7 @@ declare const documentCaptureMachine: StateMachine<DocumentCaptureContext, {
252
252
  type: "fileSizeOkForNonGallery";
253
253
  params: unknown;
254
254
  };
255
- }>, never, "uploading" | "closed" | "success" | "finished" | "capturing" | "failure" | "initCamera" | "tutorial" | "preview" | "nextPage" | "finalizing" | {
255
+ }>, never, "uploading" | "closed" | "success" | "finished" | "initCamera" | "tutorial" | "capturing" | "preview" | "failure" | "nextPage" | "finalizing" | {
256
256
  permissions: "idle" | "denied" | "waitingForUser" | "requesting" | "learnMore";
257
257
  }, string, DocumentCaptureInput, NonReducibleUnknown, EventObject, MetaObject, {
258
258
  readonly id: "documentCapture";
@@ -71,8 +71,8 @@ function getDocumentCaptureScreenName(snapshot) {
71
71
  return "documentCapture.capture.default";
72
72
  case "preview": return isFileMethod ? "documentCapture.confirmUpload.reviewFile" : "documentCapture.confirmImage.reviewPhoto";
73
73
  case "uploading": return isFileMethod ? "documentCapture.confirmUpload.analyzing" : "documentCapture.confirmImage.analyzing";
74
- case "success":
75
- case "finished": return isFileMethod ? "documentCapture.confirmUpload.success" : "documentCapture.confirmImage.success";
74
+ case "success": return isFileMethod ? "documentCapture.confirmUpload.success" : "documentCapture.confirmImage.success";
75
+ case "finished": return "";
76
76
  case "failure": return (context.attemptsRemaining ?? 0) > 0 ? "documentCapture.errors.genericError" : "documentCapture.errors.genericErrorExhausted";
77
77
  case "nextPage": {
78
78
  const nextPageType = context.nextPageType;
@@ -269,17 +269,7 @@ function getDocumentCaptureErrorPayload(snapshot) {
269
269
  return { errorCode };
270
270
  }
271
271
  function createDocumentCaptureManager(options) {
272
- const actor = createDocumentCaptureActor(options);
273
- return createManager({
274
- actor,
275
- mapState,
276
- createApi,
277
- beforeStop: () => actor.send({ type: "CLOSE" }),
278
- instrumentation: createManagerInstrumentation(eventModuleNames.document, {
279
- getEventScreenName: getDocumentCaptureScreenName,
280
- getErrorPayload: getDocumentCaptureErrorPayload
281
- })
282
- });
272
+ return createDocumentCaptureManagerFromActor(createDocumentCaptureActor(options));
283
273
  }
284
274
  /**
285
275
  * Creates a document-capture manager from a pre-built actor.
@@ -292,7 +282,10 @@ function createDocumentCaptureManagerFromActor(actor) {
292
282
  mapState,
293
283
  createApi,
294
284
  beforeStop: () => actor.send({ type: "CLOSE" }),
295
- instrumentation: createManagerInstrumentation(eventModuleNames.document, { getErrorPayload: getDocumentCaptureErrorPayload })
285
+ instrumentation: createManagerInstrumentation(eventModuleNames.document, {
286
+ getEventScreenName: getDocumentCaptureScreenName,
287
+ getErrorPayload: getDocumentCaptureErrorPayload
288
+ })
296
289
  });
297
290
  }
298
291
  //#endregion
@@ -1,3 +1,3 @@
1
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DOF7ba6-.esm.js";
2
- import { t as createDynamicFormsManager } from "./dynamicFormsManager-l_3MYzBs.esm.js";
1
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-CJ8bA1oW.esm.js";
2
+ import { t as createDynamicFormsManager } from "./dynamicFormsManager-CXKgiYov.esm.js";
3
3
  export { createDynamicFormsManager, dynamicFormsMachine };
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { s as createActor, u as createManager } from "./xstate.esm-Bg3FuvIs.esm.js";
4
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DOF7ba6-.esm.js";
4
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-CJ8bA1oW.esm.js";
5
5
  //#region src/modules/dynamic-forms/dynamicFormsActor.ts
6
6
  function createDynamicFormsActor(options) {
7
7
  return createActor(dynamicFormsMachine, { input: { config: options.config } }).start();
@@ -1,6 +1,6 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
3
- import { i as toIncodeApiError, r as isServerError, t as IncodeApiError } from "./apiError-B5izenZ8.esm.js";
3
+ import { i as toIncodeApiError, r as isServerError, t as IncodeApiError } from "./apiError-BBsde_zZ.esm.js";
4
4
  import { i as assign, t as setup } from "./xstate.esm-Bg3FuvIs.esm.js";
5
5
  import { n as fromPromise } from "./xstate-actors.esm-Ccyzgxj1.esm.js";
6
6
  import { t as isoDateToMs } from "./dateUtils-CvG0FvK8.esm.js";
package/dist/ekyb.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as isSupportedCountry, O as SUPPORTED_COUNTRIES, b as ALL_COUNTRIES, v as toEkybConfig, w as DEV_ONLY_COUNTRIES } from "./flowServices-Bzs_X1o4.esm.js";
2
- import { t as ekybMachine } from "./ekybStateMachine-DNBBT-S9.esm.js";
3
- import { t as createEkybManager } from "./ekybManager-lxNzE1kk.esm.js";
1
+ import { A as isSupportedCountry, O as SUPPORTED_COUNTRIES, b as ALL_COUNTRIES, v as toEkybConfig, w as DEV_ONLY_COUNTRIES } from "./flowServices-BQtiexrG.esm.js";
2
+ import { t as ekybMachine } from "./ekybStateMachine-z0t8szV3.esm.js";
3
+ import { t as createEkybManager } from "./ekybManager-BSIlNfRf.esm.js";
4
4
  export { ALL_COUNTRIES, DEV_ONLY_COUNTRIES, SUPPORTED_COUNTRIES, createEkybManager, ekybMachine, isSupportedCountry, toEkybConfig };
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { s as createActor, u as createManager } from "./xstate.esm-Bg3FuvIs.esm.js";
4
- import { t as ekybMachine } from "./ekybStateMachine-DNBBT-S9.esm.js";
4
+ import { t as ekybMachine } from "./ekybStateMachine-z0t8szV3.esm.js";
5
5
  //#region src/modules/ekyb/ekybActor.ts
6
6
  /**
7
7
  * Creates and starts an eKYB actor.
@@ -13,31 +13,17 @@ function createEkybActor(options) {
13
13
  //#endregion
14
14
  //#region src/modules/ekyb/ekybManager.ts
15
15
  /**
16
- * Maps an eKYB state-machine snapshot to the exact Figma "Tracked
17
- * Events" screen name. Source: eKYC / eKYB Figma file → Tracked Events
18
- * canvas
19
- * (`https://www.figma.com/design/TWgYZVhurQCizfC4tfLEut/eKYC---eKYB---Ready-for-Dev?node-id=2977-10474`).
20
- * Family is `eKYB.*` and section names are returned verbatim, emitted as-is
21
- * on `event.screen` by `createManagerInstrumentation` (e.g. `eKYB.default`,
22
- * `eKYB.processing`). See `docs/patterns/INSTRUMENTATION.md`.
16
+ * Maps the existing combined eKYB form and its outcome screens.
17
+ * https://www.figma.com/design/TWgYZVhurQCizfC4tfLEut?node-id=2977-10474
23
18
  *
24
- * Figma sub-states not currently surfaced by the state machine (the form
25
- * state machine collapses country selection, business details, and UBO
26
- * entry into a single `form` compound state):
19
+ * ENG-45716 F3 remains a baseline/UX decision: Figma defines country.empty,
20
+ * country.filled, bdetails.empty, bdetails.filled, director.empty,
21
+ * director.filled and directorloading, while this runtime has one form.
22
+ * Keep its existing eKYB.default until a combined-form taxonomy is approved
23
+ * or the actual steps are implemented. Do not emit fictional step visits.
24
+ * processing/success/error already match the baseline.
27
25
  *
28
- * - `eKYB.bdetails` (business details, empty) — UI step after country
29
- * selection.
30
- * - `eKYB.filled` (business details filled) — UI sub-state when required
31
- * fields have values.
32
- * - `eKYB.UBO` (empty / filled — the Figma canvas duplicates the section
33
- * name for both variants) — UBO entry step.
34
- *
35
- * All three collapse onto `eKYB.default` (the country selection / form
36
- * entry surface). Promoting them requires the state machine to surface
37
- * step-based sub-states; tracked for a follow-up.
38
- *
39
- * `closed` is intentionally unmapped (terminal user-dismissed state —
40
- * handled by `moduleClosed`).
26
+ * `closed` is a terminal dismissal handled by module lifecycle instrumentation.
41
27
  */
42
28
  function getEkybScreenName(snapshot) {
43
29
  const stateName = topLevelStateName(snapshot.value);
@@ -160,12 +146,22 @@ function createApi({ actor, trackElementClicked }) {
160
146
  }
161
147
  };
162
148
  }
149
+ function hasFormValidationErrors(snapshot) {
150
+ return topLevelStateName(snapshot.value) === "form" && Object.keys(snapshot.context.validationErrors ?? {}).length > 0;
151
+ }
163
152
  function createEkybManagerFromActor(actor) {
164
153
  return createManager({
165
154
  actor,
166
155
  mapState,
167
156
  createApi,
168
- instrumentation: createManagerInstrumentation(eventModuleNames.ekyb, { getEventScreenName: getEkybScreenName })
157
+ instrumentation: createManagerInstrumentation(eventModuleNames.ekyb, {
158
+ getEventScreenName: getEkybScreenName,
159
+ getErrorName: (snapshot) => hasFormValidationErrors(snapshot) ? "error.validation" : void 0,
160
+ getErrorPayload: (snapshot) => hasFormValidationErrors(snapshot) ? {
161
+ reason: "validation",
162
+ errorCode: "VALIDATION_FAILED"
163
+ } : void 0
164
+ })
169
165
  });
170
166
  }
171
167
  /**
@@ -1,6 +1,6 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-B-3Q-LUw.esm.js";
3
- import { A as isSupportedCountry, C as COUNTRIES_WITH_CNPJ_VALIDATION, D as INVALID_CNPJ_PATTERNS, E as FIELD_ORDER, S as CNPJ_SECOND_DIGIT_FACTORS, T as FIELD_NAME_MAPPING, _ as sortModulesByOrder, b as ALL_COUNTRIES, g as requiresAddressValidation, h as isFieldOptional, k as UBO_FIELD_LABELS, m as hasAtLeastOneAddressField, n as getFlow, v as toEkybConfig, x as CNPJ_FIRST_DIGIT_FACTORS, y as ADDRESS_FIELDS } from "./flowServices-Bzs_X1o4.esm.js";
3
+ import { A as isSupportedCountry, C as COUNTRIES_WITH_CNPJ_VALIDATION, D as INVALID_CNPJ_PATTERNS, E as FIELD_ORDER, S as CNPJ_SECOND_DIGIT_FACTORS, T as FIELD_NAME_MAPPING, _ as sortModulesByOrder, b as ALL_COUNTRIES, g as requiresAddressValidation, h as isFieldOptional, k as UBO_FIELD_LABELS, m as hasAtLeastOneAddressField, n as getFlow, v as toEkybConfig, x as CNPJ_FIRST_DIGIT_FACTORS, y as ADDRESS_FIELDS } from "./flowServices-BQtiexrG.esm.js";
4
4
  import { i as assign, t as setup } from "./xstate.esm-Bg3FuvIs.esm.js";
5
5
  import { n as fromPromise } from "./xstate-actors.esm-Ccyzgxj1.esm.js";
6
6
  import { a as getPostalCodeMaxLength, c as STREET_LEVEL_REQUIRED_ERROR, d as usStateOptions, i as getPostalCodeErrorKey, l as fillFromSuggestion, n as FIXED_DIGIT_POSTAL_CODE_LENGTH, o as validatePostalCode, r as formatPostalCode, s as DYNAMIC_REQUIRED_KEY, t as debounceSearchActor, u as getStreetLevelErrorForSuggestion } from "./addressSearch-Dnwc7dMx.esm.js";
package/dist/ekyc.esm.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { i as toEkycConfig } from "./ekycUtils-Dew1rBG0.esm.js";
2
- import { t as ekycMachine } from "./ekycStateMachine-BjNeL6ce.esm.js";
3
- import { t as createEkycManager } from "./ekycManager-DoGZkFZQ.esm.js";
2
+ import { t as ekycMachine } from "./ekycStateMachine-UjaYNdNf.esm.js";
3
+ import { t as createEkycManager } from "./ekycManager-DEbkqrHx.esm.js";
4
4
  export { createEkycManager, ekycMachine, toEkycConfig };
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { s as createActor, u as createManager } from "./xstate.esm-Bg3FuvIs.esm.js";
4
- import { t as ekycMachine } from "./ekycStateMachine-BjNeL6ce.esm.js";
4
+ import { t as ekycMachine } from "./ekycStateMachine-UjaYNdNf.esm.js";
5
5
  //#region src/modules/ekyc/ekycActor.ts
6
6
  /**
7
7
  * Creates and starts an eKYC actor.
@@ -13,34 +13,12 @@ function createEkycActor(options) {
13
13
  //#endregion
14
14
  //#region src/modules/ekyc/ekycManager.ts
15
15
  /**
16
- * Maps an eKYC state-machine snapshot to the exact Figma "Tracked Events"
17
- * screen name. Source: eKYC Figma file → Tracked Events canvas
18
- * (`https://www.figma.com/design/TWgYZVhurQCizfC4tfLEut/eKYC---eKYB---Ready-for-Dev?node-id=2977-10474`).
19
- * Family is `eKYC.*` and section names are returned verbatim, emitted as-is
20
- * on `event.screen` by `createManagerInstrumentation` (e.g. `eKYC.filled`,
21
- * `eKYC.verify`). See `docs/patterns/INSTRUMENTATION.md`.
16
+ * Screen taxonomy: ENG-45716 v4 QA baseline and the eKYC Tracked Events canvas:
17
+ * https://www.figma.com/design/TWgYZVhurQCizfC4tfLEut?node-id=2977-10474
22
18
  *
23
- * Note the canvas uses `eKYC.filled` for the entry surface (not
24
- * `eKYC.default`) and `eKYC.verify` for the submit-in-flight surface (the
25
- * success instance lives inside the verify section).
26
- *
27
- * State → screen mapping rationale:
28
- *
29
- * - `idle` / `loading` / `prefilling` collapse onto `eKYC.filled` — the
30
- * prefill round-trip happens before the user sees the form, but Figma does
31
- * not define a dedicated loading/prefill surface (the per-country
32
- * `eKYC-empty *` instances in the `eKYC-States` section are visual
33
- * references, not analytics screens). Keeping the family on `eKYC.filled`
34
- * avoids falling back to a generic `eKYC.loading` default and mixing
35
- * taxonomies in dashboards.
36
- * - `submitting` → `eKYC.verify` (verifying surface).
37
- * - `success`/`finished` → `eKYC.success` so the terminal `finished` state
38
- * stays on the visible success canvas.
39
- * - `misconfigured` is intentionally unmapped — Figma does not define a
40
- * misconfiguration surface, and the misconfigured state is an SDK
41
- * configuration error rather than a user-visible journey screen.
42
- * - `closed` is intentionally unmapped (terminal user-dismissed state —
43
- * handled by `moduleClosed`).
19
+ * Form completeness follows configured required fields, independently of the
20
+ * optimistic Continue button and validation timing. Finalization can follow a
21
+ * skip, so only the success state reports success.
44
22
  */
45
23
  function getEkycScreenName(snapshot) {
46
24
  const stateName = topLevelStateName(snapshot.value);
@@ -48,11 +26,16 @@ function getEkycScreenName(snapshot) {
48
26
  switch (stateName) {
49
27
  case "idle":
50
28
  case "loading":
51
- case "prefilling":
52
- case "form": return "eKYC.filled";
53
- case "submitting": return "eKYC.verify";
54
- case "success":
55
- case "finished": return "eKYC.success";
29
+ case "prefilling": return "eKYC.loading";
30
+ case "form": {
31
+ const { fields, values } = snapshot.context;
32
+ const required = fields.filter((field) => field.required);
33
+ const hasValue = (field) => (values[field.name]?.trim().length ?? 0) > 0;
34
+ return (required.length > 0 ? required.every(hasValue) : fields.some(hasValue)) ? "eKYC.filled" : "eKYC.default";
35
+ }
36
+ case "submitting": return "eKYC.processing";
37
+ case "success": return "eKYC.success";
38
+ case "finished": return "";
56
39
  case "error": return "eKYC.error";
57
40
  default: return;
58
41
  }
@@ -141,12 +124,22 @@ function createApi({ actor, trackElementClicked }) {
141
124
  }
142
125
  };
143
126
  }
127
+ function hasFormValidationErrors(snapshot) {
128
+ return topLevelStateName(snapshot.value) === "form" && Object.keys(snapshot.context.validationErrors ?? {}).length > 0;
129
+ }
144
130
  function createEkycManagerFromActor(actor) {
145
131
  return createManager({
146
132
  actor,
147
133
  mapState,
148
134
  createApi,
149
- instrumentation: createManagerInstrumentation(eventModuleNames.ekyc, { getEventScreenName: getEkycScreenName })
135
+ instrumentation: createManagerInstrumentation(eventModuleNames.ekyc, {
136
+ getEventScreenName: getEkycScreenName,
137
+ getErrorName: (snapshot) => hasFormValidationErrors(snapshot) ? "error.validation" : void 0,
138
+ getErrorPayload: (snapshot) => hasFormValidationErrors(snapshot) ? {
139
+ reason: "validation",
140
+ errorCode: "VALIDATION_FAILED"
141
+ } : void 0
142
+ })
150
143
  });
151
144
  }
152
145
  function createEkycManager(options) {