@incodetech/core 0.0.0-dev-20260909-14ef44cf → 0.0.0-dev-20260910-30fb659a

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 (66) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-BqvOagjI.esm.js → BrowserDiagnosticsCryptoProvider-BCbOmuXk.esm.js} +1 -1
  2. package/dist/ae-signature.esm.js +1 -1
  3. package/dist/{apiError-CE5YD5T0.esm.js → apiError-CaZfzHR5.esm.js} +1 -1
  4. package/dist/authentication.esm.js +2 -2
  5. package/dist/{authenticationManager-BMqAIjH1.esm.js → authenticationManager-DGbFYQEa.esm.js} +3 -3
  6. package/dist/{authenticationStateMachine-BKMxS3yH.esm.js → authenticationStateMachine-ChM9tVwT.esm.js} +2 -2
  7. package/dist/consent.d.ts +1 -1
  8. package/dist/{consentManager-DLOyIZzt.d.ts → consentManager-uhDPdU6i.d.ts} +1 -1
  9. package/dist/{deepsightLoader-nTArZgT2.esm.js → deepsightLoader-CgAY2Xik.esm.js} +2 -2
  10. package/dist/device.esm.js +5 -2
  11. package/dist/dynamic-forms.esm.js +2 -2
  12. package/dist/{dynamicFormsManager-HVbJKaF8.esm.js → dynamicFormsManager-DbJ2sx60.esm.js} +1 -1
  13. package/dist/{dynamicFormsStateMachine-BGYqEGcO.esm.js → dynamicFormsStateMachine-DdOXUivK.esm.js} +1 -1
  14. package/dist/ekyb.esm.js +3 -3
  15. package/dist/{ekybManager-D080qI3d.esm.js → ekybManager-DQb_i9cC.esm.js} +1 -1
  16. package/dist/{ekybStateMachine-4Ac_gP-0.esm.js → ekybStateMachine-CbK8tAgd.esm.js} +1 -1
  17. package/dist/electronic-signature.esm.js +1 -1
  18. package/dist/{electronicSignatureManager-CuZp9R8p.esm.js → electronicSignatureManager-BO07Vfiv.esm.js} +1 -1
  19. package/dist/extensibility.d.ts +4 -4
  20. package/dist/extensibility.esm.js +10 -10
  21. package/dist/{faceCaptureManagerFactory-waLeHRj_.esm.js → faceCaptureManagerFactory-DgAdH1KT.esm.js} +1 -1
  22. package/dist/{faceCaptureSetup-JxQbmDt_.esm.js → faceCaptureSetup-DdCkYn9V.esm.js} +1 -1
  23. package/dist/{feature-management-DkbzJPHi.esm.js → feature-management-B1auhoHt.esm.js} +30 -5
  24. package/dist/feature-management.esm.js +1 -1
  25. package/dist/flow.d.ts +19 -0
  26. package/dist/flow.esm.js +106 -23
  27. package/dist/{flowCompletionService-1HFgv9BU.esm.js → flowCompletionService-DJNQBnYX.esm.js} +1 -1
  28. package/dist/{flowServices-C2pUbFWe.esm.js → flowServices-B6Dn_OP0.esm.js} +58 -14
  29. package/dist/geolocation.esm.js +2 -2
  30. package/dist/{geolocationManager-CeDChUNS.esm.js → geolocationManager-B9Fpz7LU.esm.js} +1 -1
  31. package/dist/{geolocationStateMachine-C1fxKLJP.esm.js → geolocationStateMachine-iLoEsywE.esm.js} +1 -1
  32. package/dist/id-ocr.d.ts +1 -1
  33. package/dist/id-selfie-flow.esm.js +7 -7
  34. package/dist/id.esm.js +4 -4
  35. package/dist/{idCaptureDefaults-CbCpNaoY.esm.js → idCaptureDefaults-R53rpPfW.esm.js} +1 -1
  36. package/dist/{idCaptureManager-Cpd9uT8z.esm.js → idCaptureManager-CvDHZ2YE.esm.js} +3 -3
  37. package/dist/{idCaptureServices-X5poMwbu.esm.js → idCaptureServices-D_mcjCtz.esm.js} +3 -3
  38. package/dist/{idCaptureStateMachine-BZPAUJzI.esm.js → idCaptureStateMachine-CL_f4BrG.esm.js} +7 -7
  39. package/dist/{idOcrManager-CFlDwUvN.d.ts → idOcrManager-BF_cXZq8.d.ts} +1 -1
  40. package/dist/identity-reuse.d.ts +1 -1
  41. package/dist/{identityReuseManager-BXEBBI3N.d.ts → identityReuseManager-BFDI7iFK.d.ts} +1 -1
  42. package/dist/index.d.ts +1 -1
  43. package/dist/index.esm.js +1 -1
  44. package/dist/mandatory-consent.d.ts +1 -1
  45. package/dist/{mandatoryConsentManager-eFC-htLS.d.ts → mandatoryConsentManager-CSh8HjSF.d.ts} +1 -1
  46. package/dist/{onDeviceFaceResults-BgIPrRr2.esm.js → onDeviceFaceResults-BtD_Dij3.esm.js} +4 -4
  47. package/dist/personhood.esm.js +4 -4
  48. package/dist/qe-signature.esm.js +1 -1
  49. package/dist/{runChildModule-Bq791c2t.esm.js → runChildModule-DL_BwJt5.esm.js} +1 -1
  50. package/dist/{sdkVersion-Bc55H50S.esm.js → sdkVersion-CeUGP0Pv.esm.js} +1 -1
  51. package/dist/selfie.esm.js +5 -5
  52. package/dist/{selfieManager-I_h3YE2X.esm.js → selfieManager-CiVA7398.esm.js} +3 -3
  53. package/dist/{selfieStateMachine-DJwDxPAT.esm.js → selfieStateMachine-BCbLR8OJ.esm.js} +2 -2
  54. package/dist/{session-CoY3St8F.esm.js → session-B-b1IjuR.esm.js} +3 -3
  55. package/dist/session.d.ts +16 -1
  56. package/dist/session.esm.js +5 -5
  57. package/dist/{sessionInitializer-BEjB0UVH.esm.js → sessionInitializer-Gw37lpQ_.esm.js} +92 -33
  58. package/dist/{setup-DLn1eHU9.esm.js → setup-CxO2a0J_.esm.js} +6 -5
  59. package/dist/{setup-B9s2jaZK.d.ts → setup-D6yz9se2.d.ts} +14 -0
  60. package/dist/{trueSightService-VUN8WK4N.esm.js → trueSightService-BTf2KSpq.esm.js} +2 -2
  61. package/dist/video-selfie.esm.js +4 -4
  62. package/dist/{videoSelfieCameraWarmer-Dkey7P7h.esm.js → videoSelfieCameraWarmer-C0GHxpmK.esm.js} +3 -3
  63. package/dist/wasm.d.ts +1 -1
  64. package/dist/wasm.esm.js +1 -1
  65. package/dist/workflow.esm.js +14 -14
  66. package/package.json +3 -3
@@ -18,7 +18,7 @@ function decodeTruesightKey(s0Base64, s1Base64) {
18
18
  */
19
19
  function getTruesightKey() {
20
20
  try {
21
- const key = decodeTruesightKey("p2/1FNzsw8rhxgL1g9Jry2bWPdoH5RlOCcqOYqexYjw=", "Cs9r9rYBAgI0pfO1ZhWmm/NPFH4UzIAXxtdeBEQbsZQ=");
21
+ const key = decodeTruesightKey("+yJGThsIc8Eg//mwMd+YkUgt75cWhWXhO9zX8crkdRs=", "HJb4m+MWJV55FqlygqWtWsq0UcwZP9o5PQUTFSRnHqY=");
22
22
  return key.length === KEY_LENGTH_BYTES ? key : null;
23
23
  } catch {
24
24
  return null;
@@ -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-CuZp9R8p.esm.js";
1
+ import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-BO07Vfiv.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-VUN8WK4N.esm.js";
1
+ import { l as trueSightLog, u as categoryForEndpoint } from "./trueSightService-BTf2KSpq.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-BKMxS3yH.esm.js";
2
- import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-BMqAIjH1.esm.js";
1
+ import { t as authenticationMachine } from "./authenticationStateMachine-ChM9tVwT.esm.js";
2
+ import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-DGbFYQEa.esm.js";
3
3
  export { authenticationMachine, createAuthenticationActor, createAuthenticationManager };
@@ -1,9 +1,9 @@
1
- import { l as BrowserStorageProvider } from "./setup-DLn1eHU9.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-CxO2a0J_.esm.js";
2
2
  import { r as WasmUtilProvider } from "./safeStorage-0bZuUtSP.esm.js";
3
3
  import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
4
4
  import { s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
5
- import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-waLeHRj_.esm.js";
6
- import { t as authenticationMachine } from "./authenticationStateMachine-BKMxS3yH.esm.js";
5
+ import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-DgAdH1KT.esm.js";
6
+ import { t as authenticationMachine } from "./authenticationStateMachine-ChM9tVwT.esm.js";
7
7
  //#region src/modules/authentication/authenticationActor.ts
8
8
  function createAuthenticationActor(options) {
9
9
  const dependencies = options.dependencies ?? {
@@ -3,8 +3,8 @@ import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
3
3
  import { t as addDeviceStats } from "./stats-DkK-f8JT.esm.js";
4
4
  import { i as assign } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
6
- import { t as faceCaptureMachine } from "./faceCaptureSetup-JxQbmDt_.esm.js";
7
- import { i as prepareOnDeviceFaceUpload, n as isOnDeviceMode, r as postOnDeviceFaceResults, t as defaultPrepareFaceUpload } from "./onDeviceFaceResults-BgIPrRr2.esm.js";
6
+ import { t as faceCaptureMachine } from "./faceCaptureSetup-DdCkYn9V.esm.js";
7
+ import { i as prepareOnDeviceFaceUpload, n as isOnDeviceMode, r as postOnDeviceFaceResults, t as defaultPrepareFaceUpload } from "./onDeviceFaceResults-BtD_Dij3.esm.js";
8
8
  import { t as getDeviceClass } from "./getDeviceClass-5NYZg9s6.esm.js";
9
9
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
10
10
  //#region src/modules/authentication/authenticationErrorUtils.ts
package/dist/consent.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as ConsentActor, c as ConsentConfig, i as createConsentManagerFromActor, n as ConsentState, o as consentMachine, r as createConsentManager, s as ConsentCheckbox, t as ConsentManager } from "./consentManager-DLOyIZzt.js";
1
+ import { a as ConsentActor, c as ConsentConfig, i as createConsentManagerFromActor, n as ConsentState, o as consentMachine, r as createConsentManager, s as ConsentCheckbox, t as ConsentManager } from "./consentManager-uhDPdU6i.js";
2
2
  export { type ConsentActor, type ConsentCheckbox, type ConsentConfig, type ConsentManager, type ConsentState, consentMachine, createConsentManager, createConsentManagerFromActor };
@@ -97,7 +97,7 @@ declare const consentMachine: StateMachine<ConsentContext, {
97
97
  }>, {
98
98
  type: "canSubmit";
99
99
  params: unknown;
100
- }, never, "error" | "idle" | "finished" | "loading" | "submitting" | "display", string, ConsentInput, NonReducibleUnknown, EventObject, MetaObject, {
100
+ }, never, "error" | "idle" | "finished" | "submitting" | "loading" | "display", string, ConsentInput, NonReducibleUnknown, EventObject, MetaObject, {
101
101
  readonly id: "consent";
102
102
  readonly initial: "idle";
103
103
  readonly context: ({ input }: {
@@ -1,7 +1,7 @@
1
1
  import { r as WasmUtilProvider } from "./safeStorage-0bZuUtSP.esm.js";
2
2
  import { t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { l as trueSightLog } from "./trueSightService-VUN8WK4N.esm.js";
4
- import { g as getThumbmarkId, h as IpifyProvider, n as getFingerprintEnabled, p as isBrowserSimulation, t as getDisableIpify, v as BrowserEnvironmentProvider } from "./sessionInitializer-BEjB0UVH.esm.js";
3
+ import { l as trueSightLog } from "./trueSightService-BTf2KSpq.esm.js";
4
+ import { _ as getThumbmarkId, g as IpifyProvider, m as isBrowserSimulation, n as getFingerprintEnabled, t as getDisableIpify, y as BrowserEnvironmentProvider } from "./sessionInitializer-Gw37lpQ_.esm.js";
5
5
  import { t as addDeviceStats } from "./stats-DkK-f8JT.esm.js";
6
6
  import { t as getParsedUserAgent } from "./getParsedUserAgent-B2iFDql1.esm.js";
7
7
  import { t as getUserAgent } from "./getBrowser-CBiibsL-.esm.js";
@@ -99,10 +99,13 @@ function createScreenOrientationObserver(provider, deviceClass) {
99
99
  function isPortrait() {
100
100
  if (typeof window === "undefined" || typeof screen === "undefined") return true;
101
101
  if (screen.orientation?.type?.includes("portrait")) return true;
102
- if (screen.orientation?.type?.includes("landscape")) return false;
102
+ if (screen.orientation?.type?.includes("landscape")) return isViewportPortrait();
103
103
  const orientation = window.orientation;
104
- if (typeof orientation === "number") return Math.abs(orientation) === 0;
104
+ if (typeof orientation === "number") return Math.abs(orientation) === 0 || isViewportPortrait();
105
105
  if (typeof window.matchMedia === "function") return !window.matchMedia("(orientation: landscape)").matches;
106
+ return isViewportPortrait();
107
+ }
108
+ function isViewportPortrait() {
106
109
  return window.innerHeight >= window.innerWidth;
107
110
  }
108
111
  function toState(portrait) {
@@ -1,3 +1,3 @@
1
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-BGYqEGcO.esm.js";
2
- import { t as createDynamicFormsManager } from "./dynamicFormsManager-HVbJKaF8.esm.js";
1
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DdOXUivK.esm.js";
2
+ import { t as createDynamicFormsManager } from "./dynamicFormsManager-DbJ2sx60.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-BuFLFuzz.esm.js";
4
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-BGYqEGcO.esm.js";
4
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DdOXUivK.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-D3B9mUHh.esm.js";
3
- import { i as toIncodeApiError, r as isServerError, t as IncodeApiError } from "./apiError-CE5YD5T0.esm.js";
3
+ import { i as toIncodeApiError, r as isServerError, t as IncodeApiError } from "./apiError-CaZfzHR5.esm.js";
4
4
  import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.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 { E as SUPPORTED_COUNTRIES, O as isSupportedCountry, S as DEV_ONLY_COUNTRIES, g as toEkybConfig, v as ALL_COUNTRIES } from "./flowServices-C2pUbFWe.esm.js";
2
- import { t as ekybMachine } from "./ekybStateMachine-4Ac_gP-0.esm.js";
3
- import { t as createEkybManager } from "./ekybManager-D080qI3d.esm.js";
1
+ import { C as DEV_ONLY_COUNTRIES, D as SUPPORTED_COUNTRIES, _ as toEkybConfig, k as isSupportedCountry, y as ALL_COUNTRIES } from "./flowServices-B6Dn_OP0.esm.js";
2
+ import { t as ekybMachine } from "./ekybStateMachine-CbK8tAgd.esm.js";
3
+ import { t as createEkybManager } from "./ekybManager-DQb_i9cC.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-BuFLFuzz.esm.js";
4
- import { t as ekybMachine } from "./ekybStateMachine-4Ac_gP-0.esm.js";
4
+ import { t as ekybMachine } from "./ekybStateMachine-CbK8tAgd.esm.js";
5
5
  //#region src/modules/ekyb/ekybActor.ts
6
6
  /**
7
7
  * Creates and starts an eKYB actor.
@@ -1,6 +1,6 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
3
- import { C as FIELD_NAME_MAPPING, D as UBO_FIELD_LABELS, O as isSupportedCountry, T as INVALID_CNPJ_PATTERNS, _ as ADDRESS_FIELDS, b as CNPJ_SECOND_DIGIT_FACTORS, f as hasAtLeastOneAddressField, g as toEkybConfig, h as sortModulesByOrder, m as requiresAddressValidation, p as isFieldOptional, t as getFlow, v as ALL_COUNTRIES, w as FIELD_ORDER, x as COUNTRIES_WITH_CNPJ_VALIDATION, y as CNPJ_FIRST_DIGIT_FACTORS } from "./flowServices-C2pUbFWe.esm.js";
3
+ import { E as INVALID_CNPJ_PATTERNS, O as UBO_FIELD_LABELS, S as COUNTRIES_WITH_CNPJ_VALIDATION, T as FIELD_ORDER, _ as toEkybConfig, b as CNPJ_FIRST_DIGIT_FACTORS, g as sortModulesByOrder, h as requiresAddressValidation, k as isSupportedCountry, m as isFieldOptional, n as getFlow, p as hasAtLeastOneAddressField, v as ADDRESS_FIELDS, w as FIELD_NAME_MAPPING, x as CNPJ_SECOND_DIGIT_FACTORS, y as ALL_COUNTRIES } from "./flowServices-B6Dn_OP0.esm.js";
4
4
  import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.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-BRSu_aGA.esm.js";
@@ -1,2 +1,2 @@
1
- import { a as NAMIRIAL_QES_CONSENT_KEYS, c as areAllConsented, i as AE_CONSENT_KEYS, l as getConsentKeys, n as createElectronicSignatureManagerFromActor, o as NAMIRIAL_QES_PROVIDER_CODE, r as electronicSignatureMachine, s as QE_CONSENT_KEYS, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-CuZp9R8p.esm.js";
1
+ import { a as NAMIRIAL_QES_CONSENT_KEYS, c as areAllConsented, i as AE_CONSENT_KEYS, l as getConsentKeys, n as createElectronicSignatureManagerFromActor, o as NAMIRIAL_QES_PROVIDER_CODE, r as electronicSignatureMachine, s as QE_CONSENT_KEYS, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-BO07Vfiv.esm.js";
2
2
  export { AE_CONSENT_KEYS, NAMIRIAL_QES_CONSENT_KEYS, NAMIRIAL_QES_PROVIDER_CODE, QE_CONSENT_KEYS, areAllConsented, createElectronicSignatureManager, createElectronicSignatureManagerFromActor, electronicSignatureMachine, getConsentKeys, getDefaultConsentChecks };
@@ -2,7 +2,7 @@ import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
3
3
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
4
4
  import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
5
- import { i as toIncodeApiError, n as isConnectivityError, t as IncodeApiError } from "./apiError-CE5YD5T0.esm.js";
5
+ import { i as toIncodeApiError, n as isConnectivityError, t as IncodeApiError } from "./apiError-CaZfzHR5.esm.js";
6
6
  import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
7
7
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
8
8
  import { t as externalFetch } from "./externalFetch-BKBThAUC.esm.js";
@@ -12,7 +12,7 @@ import { n as BaseWasmProvider } from "./FaceDetectionProvider-Cn1wS-sA.js";
12
12
  import "./deepsightService-MZOpj7Vp.js";
13
13
  import { i as createAuthenticationManagerFromActor, n as AuthenticationState, t as AuthenticationManager } from "./authenticationManager-BCkV6CSG.js";
14
14
  import { a as CertificateIssuanceActor, i as createCertificateIssuanceManagerFromActor, n as CertificateIssuanceState, t as CertificateIssuanceManager } from "./certificateIssuanceManager-DCgEidHz.js";
15
- import { a as ConsentActor, i as createConsentManagerFromActor, n as ConsentState, t as ConsentManager } from "./consentManager-DLOyIZzt.js";
15
+ import { a as ConsentActor, i as createConsentManagerFromActor, n as ConsentState, t as ConsentManager } from "./consentManager-uhDPdU6i.js";
16
16
  import { a as CrossDocumentDataMatchActor, i as createCrossDocumentDataMatchManagerFromActor, n as CrossDocumentDataMatchState, t as CrossDocumentDataMatchManager } from "./crossDocumentDataMatchManager-Dq8Z3SOg.js";
17
17
  import { a as CurpValidationActor, i as createCurpValidationManagerFromActor, n as CurpValidationState, t as CurpValidationManager } from "./curpValidationManager-cSd2MrOQ.js";
18
18
  import { a as createCustomFieldsManagerFromActor, n as CustomFieldsState, o as CustomFieldsActor, t as CustomFieldsManager } from "./customFieldsManager-8-W2KY4n.js";
@@ -28,10 +28,10 @@ import { i as createIdCaptureManagerFromActor, j as IdCaptureActor, n as IdCaptu
28
28
  import { a as PhoneActor, i as createPhoneManagerFromActor, n as PhoneState, t as PhoneManager } from "./phoneManager-BBU8Lq0O.js";
29
29
  import { a as WatchlistActor, i as createWatchlistManagerFromActor, n as WatchlistState, t as WatchlistManager } from "./watchlistManager-DLXef90v.js";
30
30
  import { i as WatchlistForBusinessState, l as WatchlistForBusinessActor, o as createWatchlistForBusinessManagerFromActor, r as WatchlistForBusinessManager } from "./watchlistForBusinessManager-CsnJnG-C.js";
31
- import { a as IdentityReuseActor, i as createIdentityReuseManagerFromActor, n as IdentityReuseState, t as IdentityReuseManager } from "./identityReuseManager-BXEBBI3N.js";
31
+ import { a as IdentityReuseActor, i as createIdentityReuseManagerFromActor, n as IdentityReuseState, t as IdentityReuseManager } from "./identityReuseManager-BFDI7iFK.js";
32
32
  import { a as FieldComparisonActor, i as createFieldComparisonManagerFromActor, n as FieldComparisonState, t as FieldComparisonManager } from "./fieldComparisonManager-CBvEGxFx.js";
33
- import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, t as MandatoryConsentManager } from "./mandatoryConsentManager-eFC-htLS.js";
34
- import { a as IdOcrActor, i as createIdOcrManagerFromActor, n as IdOcrState, t as IdOcrManager } from "./idOcrManager-CFlDwUvN.js";
33
+ import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, t as MandatoryConsentManager } from "./mandatoryConsentManager-CSh8HjSF.js";
34
+ import { a as IdOcrActor, i as createIdOcrManagerFromActor, n as IdOcrState, t as IdOcrManager } from "./idOcrManager-BF_cXZq8.js";
35
35
  import { a as RedirectToMobileActor, i as createRedirectToMobileManagerFromActor, n as RedirectToMobileState, t as RedirectToMobileManager } from "./redirectToMobileManager-BD2PvT5B.js";
36
36
  import { a as createSignatureManagerFromActor, n as SignatureManager, o as SignatureActor, r as SignatureState } from "./signatureManager-DGBSWz2_.js";
37
37
  import { a as GeolocationActor, i as createGeolocationManagerFromActor, n as GeolocationState, t as GeolocationManager } from "./geolocationManager-Cz744E5S.js";
@@ -1,12 +1,12 @@
1
- import { l as BrowserStorageProvider } from "./setup-DLn1eHU9.esm.js";
1
+ import { l as BrowserStorageProvider } from "./setup-CxO2a0J_.esm.js";
2
2
  import { r as WasmUtilProvider } from "./safeStorage-0bZuUtSP.esm.js";
3
- import { _ as getDeviceFingerprintInfo, m as getFingerprint } from "./sessionInitializer-BEjB0UVH.esm.js";
3
+ import { h as getFingerprint, v as getDeviceFingerprintInfo } from "./sessionInitializer-Gw37lpQ_.esm.js";
4
4
  import { s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
5
5
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
6
- import { n as createElectronicSignatureManagerFromActor } from "./electronicSignatureManager-CuZp9R8p.esm.js";
6
+ import { n as createElectronicSignatureManagerFromActor } from "./electronicSignatureManager-BO07Vfiv.esm.js";
7
7
  import { n as createAntifraudManagerFromActor } from "./antifraudManager-Bg9ynGum.esm.js";
8
- import { t as faceCaptureMachine } from "./faceCaptureSetup-JxQbmDt_.esm.js";
9
- import { n as createAuthenticationManagerFromActor } from "./authenticationManager-BMqAIjH1.esm.js";
8
+ import { t as faceCaptureMachine } from "./faceCaptureSetup-DdCkYn9V.esm.js";
9
+ import { n as createAuthenticationManagerFromActor } from "./authenticationManager-DGbFYQEa.esm.js";
10
10
  import { n as createCertificateIssuanceManagerFromActor } from "./certificateIssuanceManager-Bfvkq7Cy.esm.js";
11
11
  import { n as createConsentManagerFromActor } from "./consentManager-B5Vqdez-.esm.js";
12
12
  import { n as createCrossDocumentDataMatchManagerFromActor } from "./crossDocumentDataMatchManager-QMOGwHXR.esm.js";
@@ -14,12 +14,12 @@ import { n as createCurpValidationManagerFromActor } from "./curpValidationManag
14
14
  import { n as createCustomFieldsManagerFromActor } from "./customFieldsManager-2j_PBq4U.esm.js";
15
15
  import { n as createCustomWatchlistManagerFromActor } from "./customWatchlistManager-DUVrEdw9.esm.js";
16
16
  import { n as createDocumentCaptureManagerFromActor } from "./documentCaptureManager-BqY_B0Ii.esm.js";
17
- import { n as createDynamicFormsManagerFromActor } from "./dynamicFormsManager-HVbJKaF8.esm.js";
18
- import { n as createEkybManagerFromActor } from "./ekybManager-D080qI3d.esm.js";
17
+ import { n as createDynamicFormsManagerFromActor } from "./dynamicFormsManager-DbJ2sx60.esm.js";
18
+ import { n as createEkybManagerFromActor } from "./ekybManager-DQb_i9cC.esm.js";
19
19
  import { n as createEkycManagerFromActor } from "./ekycManager-CmQBpeiI.esm.js";
20
20
  import { n as createEmailManagerFromActor } from "./emailManager-B5ek_UfM.esm.js";
21
- import { n as createSelfieManagerFromActor } from "./selfieManager-I_h3YE2X.esm.js";
22
- import { r as createIdCaptureManagerFromActor } from "./idCaptureManager-Cpd9uT8z.esm.js";
21
+ import { n as createSelfieManagerFromActor } from "./selfieManager-CiVA7398.esm.js";
22
+ import { r as createIdCaptureManagerFromActor } from "./idCaptureManager-CvDHZ2YE.esm.js";
23
23
  import { n as createPhoneManagerFromActor } from "./phoneManager-N1-sbrY4.esm.js";
24
24
  import { n as createWatchlistManagerFromActor } from "./watchlistManager-CI8BHFob.esm.js";
25
25
  import { n as createWatchlistForBusinessManagerFromActor } from "./watchlistForBusinessManager-CpuuB1J2.esm.js";
@@ -29,7 +29,7 @@ import { n as createMandatoryConsentManagerFromActor } from "./mandatoryConsentM
29
29
  import { n as createIdOcrManagerFromActor } from "./idOcrManager-DHU22hVn.esm.js";
30
30
  import { n as createRedirectToMobileManagerFromActor } from "./redirectToMobileManager-DsFzdTwA.esm.js";
31
31
  import { n as createSignatureManagerFromActor } from "./signatureManager-ChsB-nMD.esm.js";
32
- import { n as createGeolocationManagerFromActor } from "./geolocationManager-CeDChUNS.esm.js";
32
+ import { n as createGeolocationManagerFromActor } from "./geolocationManager-B9Fpz7LU.esm.js";
33
33
  import { n as createGovernmentValidationManagerFromActor } from "./governmentValidationManager-TjC9iVjH.esm.js";
34
34
  import { n as createIdVerificationManagerFromActor } from "./idVerificationManager-CyaixD0D.esm.js";
35
35
  import { n as createFaceMatchManagerFromActor } from "./faceMatchManager-Caal2zyV.esm.js";
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames } from "./events-ijlbX_Wx.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
4
- import { r as concealmentToAvatar } from "./faceCaptureSetup-JxQbmDt_.esm.js";
4
+ import { r as concealmentToAvatar } from "./faceCaptureSetup-DdCkYn9V.esm.js";
5
5
  import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-CyCdsfox.esm.js";
6
6
  import { t as BrowserVisibilityObserverProvider } from "./BrowserVisibilityObserverProvider-BrJN1B8A.esm.js";
7
7
  import { r as primeMotionFromUserGestureIfNeeded } from "./permissionServices-J5S1dEIf.esm.js";
@@ -3,7 +3,7 @@ import { t as isAndroid } from "./platform-DkcRc9JV.esm.js";
3
3
  import { i as assign, r as sendTo, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
4
4
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
5
5
  import { n as invokeRequestPermissionActor, t as checkPermission } from "./permissionServices-J5S1dEIf.esm.js";
6
- import { c as sendLabelInspectionEvent, d as stopRecording, f as stopStream, l as startDetection, o as initializeCamera, s as initializeDeepsightSession, u as startRecordingSession } from "./onDeviceFaceResults-BgIPrRr2.esm.js";
6
+ import { c as sendLabelInspectionEvent, d as stopRecording, f as stopStream, l as startDetection, o as initializeCamera, s as initializeDeepsightSession, u as startRecordingSession } from "./onDeviceFaceResults-BtD_Dij3.esm.js";
7
7
  import { i as uploadDeepsightVideo } from "./recordingsRepository-CCWy13M-.esm.js";
8
8
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
9
9
  import { n as releaseFaceAvatarWarmup, r as warmFaceAvatar, t as createFaceAvatar } from "./createFaceAvatar-DQKaRise.esm.js";
@@ -1,5 +1,5 @@
1
1
  import { n as __toESM } from "./rolldown-runtime-FDOR9p9I.esm.js";
2
- import { t as SDK_VERSION } from "./sdkVersion-Bc55H50S.esm.js";
2
+ import { t as SDK_VERSION } from "./sdkVersion-CeUGP0Pv.esm.js";
3
3
  import { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
4
4
  let currentEnvironment;
5
5
  /** Effective tier: the explicitly-set value, else the default (see note above). */
@@ -312,6 +312,9 @@ function notifyFeatureManagementChanged() {
312
312
  for (const listener of listeners) listener();
313
313
  }
314
314
  let isFeatureManagementLocked = false;
315
+ /** Custom IDs already sent through `updateFeatureManagementUser` this lifecycle. */
316
+ let appliedCustomIDs = {};
317
+ let inFlightUserUpdate;
315
318
  /**
316
319
  * Initializes feature management for the current (anonymous) user.
317
320
  *
@@ -393,10 +396,30 @@ async function updateFeatureManagementUser(update) {
393
396
  hasAdaptedCustomIDs = true;
394
397
  }
395
398
  if (!hasAdaptedCustomIDs && !custom) return;
396
- await getProvider().updateUser({
397
- customIDs: adaptedCustomIDs,
398
- custom
399
- });
399
+ if (!Object.keys(adaptedCustomIDs).some((key) => appliedCustomIDs[key] !== adaptedCustomIDs[key]) && !custom) {
400
+ await inFlightUserUpdate;
401
+ return;
402
+ }
403
+ const previousCustomIDs = {};
404
+ for (const key of Object.keys(adaptedCustomIDs)) previousCustomIDs[key] = appliedCustomIDs[key];
405
+ Object.assign(appliedCustomIDs, adaptedCustomIDs);
406
+ const providerUpdate = (async () => {
407
+ if (isFeatureManagementLocked) await readyPromise;
408
+ await getProvider().updateUser({
409
+ customIDs: adaptedCustomIDs,
410
+ custom
411
+ });
412
+ })();
413
+ inFlightUserUpdate = providerUpdate;
414
+ try {
415
+ await providerUpdate;
416
+ } catch (error) {
417
+ for (const [key, value] of Object.entries(previousCustomIDs)) if (value === void 0) delete appliedCustomIDs[key];
418
+ else appliedCustomIDs[key] = value;
419
+ throw error;
420
+ } finally {
421
+ if (inFlightUserUpdate === providerUpdate) inFlightUserUpdate = void 0;
422
+ }
400
423
  notifyFeatureManagementChanged();
401
424
  }
402
425
  /** Evaluates a feature gate. Returns a fallback-only result before initialization. */
@@ -440,6 +463,8 @@ function logEvent(name, value, options) {
440
463
  */
441
464
  function resetFeatureManagement() {
442
465
  isFeatureManagementLocked = false;
466
+ appliedCustomIDs = {};
467
+ inFlightUserUpdate = void 0;
443
468
  readyPromise = freshReady();
444
469
  getProvider().reset();
445
470
  notifyFeatureManagementChanged();
@@ -1,2 +1,2 @@
1
- import { E as updateFeatureManagementUser, T as subscribeFeatureManagement, _ as getIsFeatureManagementInitialized, a as stringParam, d as ONBOARDING_WEB_SDK_PARAMETER_STORE, f as getExperiment, g as getFeatureParameterStore, h as getFeatureManagementVersion, i as numberParam, l as resolveExperiment, m as getFeatureGate, n as defineExperimentParams, o as EXPERIMENT_UNAVAILABLE_SENTINEL, p as getFeatureDynamicConfig, r as enumParam, s as exposeExperimentOnce, t as booleanParam, u as resolveExperimentOnce, x as logEvent, y as getLayer } from "./feature-management-DkbzJPHi.esm.js";
1
+ import { E as updateFeatureManagementUser, T as subscribeFeatureManagement, _ as getIsFeatureManagementInitialized, a as stringParam, d as ONBOARDING_WEB_SDK_PARAMETER_STORE, f as getExperiment, g as getFeatureParameterStore, h as getFeatureManagementVersion, i as numberParam, l as resolveExperiment, m as getFeatureGate, n as defineExperimentParams, o as EXPERIMENT_UNAVAILABLE_SENTINEL, p as getFeatureDynamicConfig, r as enumParam, s as exposeExperimentOnce, t as booleanParam, u as resolveExperimentOnce, x as logEvent, y as getLayer } from "./feature-management-B1auhoHt.esm.js";
2
2
  export { EXPERIMENT_UNAVAILABLE_SENTINEL, ONBOARDING_WEB_SDK_PARAMETER_STORE, booleanParam, defineExperimentParams, enumParam, exposeExperimentOnce, getExperiment, getFeatureDynamicConfig, getFeatureGate, getFeatureManagementVersion, getFeatureParameterStore, getIsFeatureManagementInitialized, getLayer, logEvent, numberParam, resolveExperiment, resolveExperimentOnce, stringParam, subscribeFeatureManagement, updateFeatureManagementUser };
package/dist/flow.d.ts CHANGED
@@ -68,6 +68,15 @@ type GetFlowOptions = {
68
68
  authHint?: string;
69
69
  lang?: string;
70
70
  useCPF?: boolean;
71
+ /**
72
+ * Return the flow as soon as it is fetched and normalized, without waiting
73
+ * for session activation: the Statsig `flow_id` update and the
74
+ * mandatory-consent injection (which rides on the device fingerprint) are
75
+ * left to `completeDeferredActivation`, which the caller must run before the
76
+ * first module starts — the orchestrated flow machine does this on the Start
77
+ * tap when there is a home screen, right after loading otherwise.
78
+ */
79
+ deferActivation?: boolean;
71
80
  };
72
81
  type GetFlow = (signal: AbortSignal, options?: GetFlowOptions) => Promise<Flow>;
73
82
  type DashboardResolvedModuleConfigMap = {
@@ -258,6 +267,15 @@ type OrchestratedFlowInput = {
258
267
  lazyModules?: LazyModuleRegistry;
259
268
  getFinishStatus?: GetFinishStatusFn;
260
269
  enableHome?: boolean;
270
+ /**
271
+ * The flow was fetched with `getFlow(..., { deferActivation: true })`: the
272
+ * machine completes activation itself (feature-management flow id, then
273
+ * MANDATORY_CONSENT from the device fingerprint) right before the first
274
+ * module runs — on the Start tap when there is a home screen — so neither
275
+ * the flow fetch nor the home screen waits for feature-config, Statsig or
276
+ * the fingerprint.
277
+ */
278
+ deferActivation?: boolean;
261
279
  };
262
280
  type OrchestratedFlowEvent = {
263
281
  type: 'LOAD';
@@ -346,6 +364,7 @@ type CreateOrchestratedFlowActorOptions = {
346
364
  lazyModules?: LazyModuleRegistry;
347
365
  getFinishStatus?: OrchestratedFlowInput['getFinishStatus'];
348
366
  enableHome?: boolean;
367
+ deferActivation?: OrchestratedFlowInput['deferActivation'];
349
368
  };
350
369
  declare function createOrchestratedFlowManager(options: CreateOrchestratedFlowActorOptions): Manager<OrchestratedFlowState> & {
351
370
  /**
package/dist/flow.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { v as addEvent } from "./events-ijlbX_Wx.esm.js";
2
- import { a as enrichFlowModuleConfig, c as resolveFlowModuleConfig, i as resolveDashboardModuleConfig, k as mergeDashboardConfig, n as preloadDashboardFlow, o as getRequiredWasmPipelines, s as normalizeFlowModules, t as getFlow } from "./flowServices-C2pUbFWe.esm.js";
2
+ import { A as mergeDashboardConfig, a as resolveDashboardModuleConfig, c as normalizeFlowModules, l as resolveFlowModuleConfig, n as getFlow, o as enrichFlowModuleConfig, r as preloadDashboardFlow, s as getRequiredWasmPipelines, t as completeDeferredActivation } from "./flowServices-B6Dn_OP0.esm.js";
3
3
  import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
4
4
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
5
- import { n as getFinishStatus, r as getTotalScoreStatus, t as classifyScoreStatus } from "./flowCompletionService-1HFgv9BU.esm.js";
6
- import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-Bq791c2t.esm.js";
5
+ import { n as getFinishStatus, r as getTotalScoreStatus, t as classifyScoreStatus } from "./flowCompletionService-DJNQBnYX.esm.js";
6
+ import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-DL_BwJt5.esm.js";
7
7
  import { n as isAdvanceableError } from "./advanceableErrors-CpF2cBy6.esm.js";
8
8
  //#region src/modules/flow/noOpFlowModuleMachine.ts
9
9
  const noOpFlowModuleMachine = setup({}).createMachine({
@@ -363,6 +363,8 @@ function createBaseContext(context, isHomeContinueLoading) {
363
363
  enableHome: context.enableHome,
364
364
  finishStatus: void 0,
365
365
  isHomeContinueLoading,
366
+ deferActivation: context.deferActivation,
367
+ activationResolved: false,
366
368
  skipFaceMatch: false
367
369
  };
368
370
  }
@@ -372,13 +374,21 @@ function createInitialContext(input) {
372
374
  registeredModules: input.modules ?? {},
373
375
  lazyRegisteredModules: input.lazyModules ?? {},
374
376
  getFinishStatus: input.getFinishStatus ?? getFinishStatus,
375
- enableHome: input.enableHome === true
377
+ enableHome: input.enableHome === true,
378
+ deferActivation: input.deferActivation === true
376
379
  }, false);
377
380
  }
381
+ /**
382
+ * Whether this flow shows a home screen at all. Shared by `shouldEnterHome`
383
+ * (step-position aware) and the `activatesBeforeFirstModule` guard (which runs
384
+ * before `setFlowData`, so it reads the freshly fetched flow instead of
385
+ * `context.flow`) — keep the home-screen conditions in this one place.
386
+ */
387
+ function homeScreenEnabled(context, flow) {
388
+ return context.enableHome === true && flow?.disableLaunchScreen !== true && context.isHomeContinueLoading !== true;
389
+ }
378
390
  function shouldEnterHome(context) {
379
- if (context.enableHome !== true) return false;
380
- if (context.flow?.disableLaunchScreen === true) return false;
381
- if (context.isHomeContinueLoading === true) return false;
391
+ if (!homeScreenEnabled(context, context.flow)) return false;
382
392
  const firstRealIndex = context.steps[0] === "REDIRECT_TO_MOBILE" ? 1 : 0;
383
393
  return context.currentStepIndex === firstRealIndex;
384
394
  }
@@ -408,6 +418,10 @@ const orchestratedFlowMachine = setup({
408
418
  return await input.getFinishStatus(input.flowId, signal);
409
419
  }),
410
420
  runChildModule,
421
+ resolveActivation: fromPromise(async ({ input, signal }) => {
422
+ if (!input.flow) throw new Error("No flow loaded");
423
+ return completeDeferredActivation(input.flow, signal);
424
+ }),
411
425
  resolveCurrentModuleMachine: fromPromise(async ({ input }) => {
412
426
  if (!input.moduleKey) return;
413
427
  const eagerMachine = input.modules[input.moduleKey];
@@ -438,6 +452,25 @@ const orchestratedFlowMachine = setup({
438
452
  currentModuleMachine: void 0
439
453
  };
440
454
  }),
455
+ setActivatedFlow: assign(({ context, event }) => {
456
+ const flow = event.output;
457
+ const flowModules = flow.flowModules ?? [];
458
+ const steps = flowModules.map((m) => m.key);
459
+ let insertedAt = steps.findIndex((key, i) => key !== context.steps[i]);
460
+ if (insertedAt === -1) insertedAt = steps.length;
461
+ const currentStepIndex = steps.length === context.steps.length ? context.currentStepIndex : Math.min(context.currentStepIndex, insertedAt);
462
+ const module = flowModules[currentStepIndex];
463
+ return {
464
+ flow,
465
+ steps,
466
+ currentStepIndex,
467
+ currentStep: module?.key,
468
+ config: getModuleConfig(module, flow),
469
+ currentModuleMachine: void 0,
470
+ activationResolved: true
471
+ };
472
+ }),
473
+ markActivationResolved: assign({ activationResolved: true }),
441
474
  setError: assign(({ event }) => {
442
475
  const err = event.error;
443
476
  return {
@@ -492,6 +525,16 @@ const orchestratedFlowMachine = setup({
492
525
  canGoNext: ({ context }) => context.currentStepIndex >= 0 && context.currentStepIndex < context.steps.length - 1,
493
526
  isOnboardingFinishedSignal: ({ event }) => event.output?.action === "onboardingFinished",
494
527
  shouldEnterHome: ({ context }) => shouldEnterHome(context),
528
+ needsActivation: ({ context }) => context.deferActivation && !context.activationResolved && context.currentStep !== "REDIRECT_TO_MOBILE",
529
+ activatesBeforeFirstModule: ({ context, event }) => {
530
+ if (!("output" in event)) return false;
531
+ if (!context.deferActivation || context.activationResolved) return false;
532
+ const flow = event.output;
533
+ const firstModuleKey = flow.flowModules?.[0]?.key;
534
+ if (!firstModuleKey || firstModuleKey === "REDIRECT_TO_MOBILE") return false;
535
+ if (!(context.registeredModules[firstModuleKey] != null || context.lazyRegisteredModules[firstModuleKey] != null)) return false;
536
+ return !homeScreenEnabled(context, flow);
537
+ },
495
538
  hasModule: ({ context, event }) => {
496
539
  if (!("output" in event)) return false;
497
540
  const firstModuleKey = event.output.flowModules?.[0]?.key;
@@ -520,17 +563,25 @@ const orchestratedFlowMachine = setup({
520
563
  id: "fetchFlow",
521
564
  src: "fetchFlow",
522
565
  input: ({ context }) => ({ getFlow: context.getFlow }),
523
- onDone: [{
524
- target: "resolvingModule",
525
- guard: "hasModule",
526
- actions: "setFlowData"
527
- }, {
528
- target: "error",
529
- actions: assign({ error: ({ event }) => {
530
- const firstModuleKey = event.output.flowModules?.[0]?.key;
531
- return firstModuleKey ? `No registered module found for: ${firstModuleKey}` : "No registered module found: flow has no modules";
532
- } })
533
- }],
566
+ onDone: [
567
+ {
568
+ target: "resolvingActivation",
569
+ guard: "activatesBeforeFirstModule",
570
+ actions: "setFlowData"
571
+ },
572
+ {
573
+ target: "resolvingModule",
574
+ guard: "hasModule",
575
+ actions: "setFlowData"
576
+ },
577
+ {
578
+ target: "error",
579
+ actions: assign({ error: ({ event }) => {
580
+ const firstModuleKey = event.output.flowModules?.[0]?.key;
581
+ return firstModuleKey ? `No registered module found for: ${firstModuleKey}` : "No registered module found: flow has no modules";
582
+ } })
583
+ }
584
+ ],
534
585
  onError: {
535
586
  target: "error",
536
587
  actions: "setError"
@@ -559,6 +610,11 @@ const orchestratedFlowMachine = setup({
559
610
  guard: "shouldEnterHome",
560
611
  actions: ["setCurrentModuleMachine"]
561
612
  },
613
+ {
614
+ target: "resolvingActivation",
615
+ guard: "needsActivation",
616
+ actions: ["setCurrentModuleMachine"]
617
+ },
562
618
  {
563
619
  target: "runningModule",
564
620
  guard: "hasCurrentModuleMachine",
@@ -583,15 +639,41 @@ const orchestratedFlowMachine = setup({
583
639
  }
584
640
  },
585
641
  home: { on: {
586
- HOME_CONTINUE: {
642
+ HOME_CONTINUE: [{
643
+ target: "resolvingActivation",
644
+ guard: "needsActivation",
645
+ actions: "setHomeContinueLoading"
646
+ }, {
587
647
  target: "runningModule",
588
648
  actions: ["clearHomeContinueLoading", "prefetchNextModule"]
589
- },
649
+ }],
590
650
  RESET: {
591
651
  target: "idle",
592
652
  actions: "resetContext"
593
653
  }
594
654
  } },
655
+ resolvingActivation: {
656
+ invoke: {
657
+ id: "resolveActivation",
658
+ src: "resolveActivation",
659
+ input: ({ context }) => ({ flow: context.flow }),
660
+ onDone: {
661
+ target: "resolvingModule",
662
+ actions: "setActivatedFlow"
663
+ },
664
+ onError: {
665
+ target: "resolvingModule",
666
+ actions: "markActivationResolved"
667
+ }
668
+ },
669
+ on: {
670
+ RESET: {
671
+ target: "idle",
672
+ actions: "resetContext"
673
+ },
674
+ ...homeContinueOn
675
+ }
676
+ },
595
677
  runningModule: {
596
678
  entry: "clearHomeContinueLoading",
597
679
  invoke: {
@@ -705,7 +787,7 @@ function deriveUiModel(snapshot, mappedStatus, isHomePhase, options) {
705
787
  const isCompletingPhase = snapshot.value === "completing";
706
788
  const firstRealIndex = snapshot.context.steps[0] === "REDIRECT_TO_MOBILE" ? 1 : 0;
707
789
  const isAtFirstRealModule = snapshot.context.currentStepIndex === firstRealIndex;
708
- const isResolvingHomeAnchor = snapshot.value === "resolvingModule" && effectiveEnableHome && isAtFirstRealModule;
790
+ const isResolvingHomeAnchor = (snapshot.value === "resolvingModule" || snapshot.value === "resolvingActivation") && effectiveEnableHome && isAtFirstRealModule;
709
791
  const isHomeBoundPhase = isHomePhase || isResolvingHomeAnchor;
710
792
  const canShowHome = isTerminal === false && effectiveEnableHome && isCompletingPhase === false;
711
793
  const visible = canShowHome ? isHomeBoundPhase : false;
@@ -727,7 +809,7 @@ function getMappedStatus(snapshot) {
727
809
  const { value } = snapshot;
728
810
  if (value === "idle") return "idle";
729
811
  if (value === "completing") return "completing";
730
- if (value === "loading" || value === "resolvingModule" || typeof value === "object") return "loading";
812
+ if (value === "loading" || value === "resolvingModule" || value === "resolvingActivation" || typeof value === "object") return "loading";
731
813
  if (value === "finished") return "finished";
732
814
  if (value === "error") return "error";
733
815
  return "ready";
@@ -969,7 +1051,8 @@ function createOrchestratedFlowActor(options) {
969
1051
  modules: options.modules,
970
1052
  lazyModules: options.lazyModules,
971
1053
  getFinishStatus: options.getFinishStatus,
972
- enableHome: options.enableHome
1054
+ enableHome: options.enableHome,
1055
+ deferActivation: options.deferActivation
973
1056
  } }).start();
974
1057
  }
975
1058
  function createOrchestratedFlowManager(options) {
@@ -1,6 +1,6 @@
1
1
  import { t as api } from "./api-Bx3gKW_y.esm.js";
2
2
  import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
3
- import { i as toIncodeApiError } from "./apiError-CE5YD5T0.esm.js";
3
+ import { i as toIncodeApiError } from "./apiError-CaZfzHR5.esm.js";
4
4
  //#region src/modules/flow/flowCompletionService.ts
5
5
  const getFinishStatus = async (flowId, signal) => {
6
6
  const url = `${endpoints.finishStatus}${flowId ? `?flowId=${flowId}` : ""}`;