@incodetech/core 0.0.0-dev-20260716-2b4f5edb → 0.0.0-dev-20260717-87fac45b

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 (53) hide show
  1. package/dist/BrowserLazyImportProvider-BhoA957O.esm.js +114 -0
  2. package/dist/IFeatureManagementCapability-ErPJywQ_.d.ts +1121 -0
  3. package/dist/authentication.esm.js +2 -2
  4. package/dist/{authenticationManager-BVMQTy2C.esm.js → authenticationManager-DK8fsUqL.esm.js} +2 -2
  5. package/dist/{authenticationStateMachine-DvFeGMIc.esm.js → authenticationStateMachine-BlT8fkR6.esm.js} +2 -2
  6. package/dist/consent.d.ts +1 -1
  7. package/dist/{consentManager-2h_w6wFc.d.ts → consentManager-CsyToF8t.d.ts} +5 -5
  8. package/dist/{deepsightLoader-BGu6zfoZ.esm.js → deepsightLoader-C7HOhX6C.esm.js} +1 -1
  9. package/dist/document-capture.d.ts +1 -1
  10. package/dist/document-upload.d.ts +4 -4
  11. package/dist/{documentCaptureManager-Biz_PFqs.d.ts → documentCaptureManager-DBqK5ner.d.ts} +65 -65
  12. package/dist/ekyb.esm.js +2 -2
  13. package/dist/{ekybManager--3WIEWS5.esm.js → ekybManager-BMjf8ZNw.esm.js} +1 -1
  14. package/dist/{ekybStateMachine-B870YzwX.esm.js → ekybStateMachine-DfpEPLzD.esm.js} +1 -1
  15. package/dist/extensibility.d.ts +4 -4
  16. package/dist/extensibility.esm.js +6 -6
  17. package/dist/{faceCaptureManagerFactory-CDpqsxiU.esm.js → faceCaptureManagerFactory-BFv1KlL_.esm.js} +1 -1
  18. package/dist/{faceCaptureSetup-BXueiZo8.esm.js → faceCaptureSetup-Bxo1VNVw.esm.js} +2 -2
  19. package/dist/feature-management-Dw96qEMs.esm.js +468 -0
  20. package/dist/feature-management.d.ts +80 -0
  21. package/dist/feature-management.esm.js +2 -0
  22. package/dist/flow.esm.js +1 -1
  23. package/dist/{flowServices-DL7qnTQR.esm.js → flowServices-ymcivfU0.esm.js} +5 -3
  24. package/dist/id.esm.js +2 -2
  25. package/dist/{idCaptureManager-BoLeZff7.esm.js → idCaptureManager-BBfWW9Y0.esm.js} +1 -1
  26. package/dist/{idCaptureStateMachine-D2H3vwwf.esm.js → idCaptureStateMachine-_1pROAbA.esm.js} +5 -5
  27. package/dist/identity-reuse.d.ts +1 -1
  28. package/dist/{identityReuseManager-aTyLyYrr.d.ts → identityReuseManager-D6pD4hcZ.d.ts} +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.esm.js +1 -1
  31. package/dist/mandatory-consent.d.ts +1 -1
  32. package/dist/{mandatoryConsentManager-B2gRcE_x.d.ts → mandatoryConsentManager-BR8SLvd1.d.ts} +5 -5
  33. package/dist/{onDeviceFaceResults-4ODIm8fO.esm.js → onDeviceFaceResults-B3oTx-NK.esm.js} +1 -1
  34. package/dist/personhood.esm.js +2 -2
  35. package/dist/{recordingService-CkLJ00Pw.esm.js → recordingService-Comyo6yK.esm.js} +1 -1
  36. package/dist/selfie.esm.js +4 -4
  37. package/dist/{selfieManager-C_ynxeGZ.esm.js → selfieManager-CCR6VpoQ.esm.js} +2 -2
  38. package/dist/{selfieStateMachine-CFqYKJFF.esm.js → selfieStateMachine-D30gwMGq.esm.js} +2 -2
  39. package/dist/session-B9KT6qnE.esm.js +1 -0
  40. package/dist/session.esm.js +2 -2
  41. package/dist/{sessionInitializer-B6n-FYf7.esm.js → sessionInitializer-CrzyJ4Y0.esm.js} +4 -2
  42. package/dist/{setup-CgBvqGWw.d.ts → setup-BBfVpTog.d.ts} +115 -0
  43. package/dist/{setup-CeQfb7bE.esm.js → setup-CBijDJ0d.esm.js} +20 -2
  44. package/dist/src-0Jurt29N.esm.js +4482 -0
  45. package/dist/{tri-N-xlKhZK.esm.js → tri-4RsGrIt6.esm.js} +1 -113
  46. package/dist/tri.esm.js +1 -1
  47. package/dist/video-selfie.esm.js +2 -2
  48. package/dist/wasm.d.ts +1 -1
  49. package/dist/wasm.esm.js +1 -1
  50. package/dist/workflow.d.ts +4 -4
  51. package/dist/workflow.esm.js +7 -5
  52. package/package.json +8 -3
  53. package/dist/session-CThOl8m5.esm.js +0 -1
@@ -1,2 +1,2 @@
1
- import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, s as MandatoryConsentConfig, t as MandatoryConsentManager } from "./mandatoryConsentManager-B2gRcE_x.js";
1
+ import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, s as MandatoryConsentConfig, t as MandatoryConsentManager } from "./mandatoryConsentManager-BR8SLvd1.js";
2
2
  export { type MandatoryConsentActor, type MandatoryConsentConfig, type MandatoryConsentManager, type MandatoryConsentState, createMandatoryConsentManager, createMandatoryConsentManagerFromActor, mandatoryConsentMachine };
@@ -80,18 +80,18 @@ declare const mandatoryConsentMachine: StateMachine<MandatoryConsentContext, {
80
80
  type: "clearError";
81
81
  params: NonReducibleUnknown;
82
82
  };
83
- resetContext: {
84
- type: "resetContext";
85
- params: NonReducibleUnknown;
86
- };
87
83
  toggleSigned: {
88
84
  type: "toggleSigned";
89
85
  params: NonReducibleUnknown;
90
86
  };
87
+ resetContext: {
88
+ type: "resetContext";
89
+ params: NonReducibleUnknown;
90
+ };
91
91
  }>, {
92
92
  type: "canSubmit";
93
93
  params: unknown;
94
- }, never, "error" | "idle" | "closed" | "finished" | "loading" | "submitting" | "display", string, MandatoryConsentInput, NonReducibleUnknown, EventObject, MetaObject, {
94
+ }, never, "error" | "idle" | "closed" | "finished" | "loading" | "display" | "submitting", string, MandatoryConsentInput, NonReducibleUnknown, EventObject, MetaObject, {
95
95
  readonly id: "mandatoryConsent";
96
96
  readonly initial: "idle";
97
97
  readonly context: ({ input }: {
@@ -516,7 +516,7 @@ async function stopRecording(session) {
516
516
  }
517
517
  }
518
518
  async function initializeDeepsightSession(options) {
519
- const { loadDeepsightSession } = await import("./deepsightLoader-BGu6zfoZ.esm.js");
519
+ const { loadDeepsightSession } = await import("./deepsightLoader-C7HOhX6C.esm.js");
520
520
  return loadDeepsightSession({
521
521
  ds: options.ds,
522
522
  storage: options.storage
@@ -4,13 +4,13 @@ import { t as api } from "./api-BDTZNnca.esm.js";
4
4
  import { a as createApi$1, t as getStoredHttpConfig } from "./clientLifecycle-DzT65Fvf.esm.js";
5
5
  import { n as eventModuleNames } from "./events-Dy8PyVO5.esm.js";
6
6
  import { t as endpoints } from "./endpoints-DLQ0g4-R.esm.js";
7
- import { c as isBrowserSimulation, d as getThumbmarkId, f as getDeviceFingerprintInfo, n as getFingerprintEnabled, p as BrowserEnvironmentProvider } from "./sessionInitializer-B6n-FYf7.esm.js";
7
+ import { c as isBrowserSimulation, d as getThumbmarkId, f as getDeviceFingerprintInfo, n as getFingerprintEnabled, p as BrowserEnvironmentProvider } from "./sessionInitializer-CrzyJ4Y0.esm.js";
8
8
  import { c as createManager, o as createActor, r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
9
9
  import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-CtI5S0f4.esm.js";
10
10
  import { i as requestPermission, t as checkPermission } from "./permissionServices-DwNCUB2I.esm.js";
11
11
  import { a as stopCameraStream, r as requestCameraAccess } from "./camera-BmFEyPP_.esm.js";
12
12
  import { t as BrowserStorageProvider } from "./BrowserStorageProvider-P6aUarE9.esm.js";
13
- import { f as stopStream, l as startDetection, s as initializeDeepsightSession, v as FaceDetectionProvider } from "./onDeviceFaceResults-4ODIm8fO.esm.js";
13
+ import { f as stopStream, l as startDetection, s as initializeDeepsightSession, v as FaceDetectionProvider } from "./onDeviceFaceResults-B3oTx-NK.esm.js";
14
14
  import { t as sleep } from "./ITimerCapability-DgdDzp8G.esm.js";
15
15
  import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
16
16
  //#region ../infra/src/crypto/randomUUID.ts
@@ -1,7 +1,7 @@
1
1
  import { t as api } from "./api-BDTZNnca.esm.js";
2
2
  import { t as endpoints } from "./endpoints-DLQ0g4-R.esm.js";
3
3
  import { t as isAndroid } from "./platform-wmV7oTAJ.esm.js";
4
- import { d as stopRecording, g as uploadDeepsightVideo, u as startRecordingSession } from "./onDeviceFaceResults-4ODIm8fO.esm.js";
4
+ import { d as stopRecording, g as uploadDeepsightVideo, u as startRecordingSession } from "./onDeviceFaceResults-B3oTx-NK.esm.js";
5
5
  import { t as getAdaptiveMediaRecorderOptions } from "./mediaRecorderOptions-BhSZDDNb.esm.js";
6
6
  //#region src/internal/manualReview/manualReviewService.ts
7
7
  async function flagFaceManualReview() {
@@ -2,12 +2,12 @@ import { t as WasmUtilProvider } from "./WasmUtilProvider-DAshwHhX.esm.js";
2
2
  import { n as eventModuleNames } from "./events-Dy8PyVO5.esm.js";
3
3
  import { o as createActor, r as assign } from "./xstate.esm-Cf4e0Cfd.esm.js";
4
4
  import { n as fromPromise } from "./xstate-actors.esm-CtI5S0f4.esm.js";
5
- import { t as faceCaptureMachine } from "./faceCaptureSetup-BXueiZo8.esm.js";
6
- import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-CDpqsxiU.esm.js";
5
+ import { t as faceCaptureMachine } from "./faceCaptureSetup-Bxo1VNVw.esm.js";
6
+ import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-BFv1KlL_.esm.js";
7
7
  import { t as BrowserStorageProvider } from "./BrowserStorageProvider-P6aUarE9.esm.js";
8
8
  import { t as processFace } from "./selfieUploadService-B4LnSIf6.esm.js";
9
- import { t as selfieMachine } from "./selfieStateMachine-CFqYKJFF.esm.js";
10
- import { n as createSelfieManagerFromActor, t as createSelfieManager } from "./selfieManager-C_ynxeGZ.esm.js";
9
+ import { t as selfieMachine } from "./selfieStateMachine-D30gwMGq.esm.js";
10
+ import { n as createSelfieManagerFromActor, t as createSelfieManager } from "./selfieManager-CCR6VpoQ.esm.js";
11
11
  import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-B-QfsCQY.esm.js";
12
12
  //#region src/modules/selfie/selfieCaptureOnlyStateMachine.ts
13
13
  /**
@@ -1,9 +1,9 @@
1
1
  import { t as WasmUtilProvider } from "./WasmUtilProvider-DAshwHhX.esm.js";
2
2
  import { n as eventModuleNames } from "./events-Dy8PyVO5.esm.js";
3
3
  import { o as createActor } from "./xstate.esm-Cf4e0Cfd.esm.js";
4
- import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-CDpqsxiU.esm.js";
4
+ import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-BFv1KlL_.esm.js";
5
5
  import { t as BrowserStorageProvider } from "./BrowserStorageProvider-P6aUarE9.esm.js";
6
- import { t as selfieMachine } from "./selfieStateMachine-CFqYKJFF.esm.js";
6
+ import { t as selfieMachine } from "./selfieStateMachine-D30gwMGq.esm.js";
7
7
  //#region src/modules/selfie/selfieActor.ts
8
8
  function createSelfieActor(options) {
9
9
  const dependencies = options.dependencies ?? {
@@ -1,7 +1,7 @@
1
1
  import { r as assign } from "./xstate.esm-Cf4e0Cfd.esm.js";
2
2
  import { n as fromPromise } from "./xstate-actors.esm-CtI5S0f4.esm.js";
3
- import { t as faceCaptureMachine } from "./faceCaptureSetup-BXueiZo8.esm.js";
4
- import { i as prepareOnDeviceFaceUpload, n as isOnDeviceMode, r as postOnDeviceFaceResults, t as defaultPrepareFaceUpload } from "./onDeviceFaceResults-4ODIm8fO.esm.js";
3
+ import { t as faceCaptureMachine } from "./faceCaptureSetup-Bxo1VNVw.esm.js";
4
+ import { i as prepareOnDeviceFaceUpload, n as isOnDeviceMode, r as postOnDeviceFaceResults, t as defaultPrepareFaceUpload } from "./onDeviceFaceResults-B3oTx-NK.esm.js";
5
5
  import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
6
6
  import { n as uploadSelfie, t as processFace } from "./selfieUploadService-B4LnSIf6.esm.js";
7
7
  Object.values(FACE_ERROR_CODES);
@@ -0,0 +1 @@
1
+ import "./sessionInitializer-CrzyJ4Y0.esm.js";
@@ -1,8 +1,8 @@
1
1
  import { n as getApi } from "./api-BDTZNnca.esm.js";
2
2
  import { t as endpoints } from "./endpoints-DLQ0g4-R.esm.js";
3
- import { i as initializeSession } from "./sessionInitializer-B6n-FYf7.esm.js";
3
+ import { i as initializeSession } from "./sessionInitializer-CrzyJ4Y0.esm.js";
4
4
  import { n as toIncodeApiError, t as IncodeApiError } from "./apiError-COvIGYWe.esm.js";
5
- import "./session-CThOl8m5.esm.js";
5
+ import "./session-B9KT6qnE.esm.js";
6
6
  import { n as getFinishStatus } from "./flowCompletionService-DQSC7Kso.esm.js";
7
7
  //#region src/internal/session/sessionService.ts
8
8
  /**
@@ -1,3 +1,4 @@
1
+ import { g as updateFeatureManagementUser } from "./feature-management-Dw96qEMs.esm.js";
1
2
  import { r as getToken, s as setToken, t as api } from "./api-BDTZNnca.esm.js";
2
3
  import { h as getAnalyticsBatcher, m as addEvent } from "./events-Dy8PyVO5.esm.js";
3
4
  import { t as endpoints } from "./endpoints-DLQ0g4-R.esm.js";
@@ -5,7 +6,7 @@ import { n as flushDeviceStatsQueue, r as resetDeviceStatsQueue } from "./stats-
5
6
  import { n as UAParser, t as getParsedUserAgent } from "./getParsedUserAgent-pJjATANs.esm.js";
6
7
  import { r as isIOS } from "./platform-wmV7oTAJ.esm.js";
7
8
  import { t as getUserAgent } from "./getBrowser-Cb8Zgrgp.esm.js";
8
- import { i as linkSessionWithTRI, r as isTRIStarted } from "./tri-N-xlKhZK.esm.js";
9
+ import { i as linkSessionWithTRI, r as isTRIStarted } from "./tri-4RsGrIt6.esm.js";
9
10
  //#region ../infra/src/providers/browser/BrowserEnvironmentProvider.ts
10
11
  var BrowserEnvironmentProvider = class {
11
12
  getScreenDimensions() {
@@ -1608,7 +1609,7 @@ function isBrowserSimulation(browserEnv) {
1608
1609
  }
1609
1610
  //#endregion
1610
1611
  //#region src/internal/version/sdkVersion.ts
1611
- const SDK_VERSION = "0.0.0-dev-20260716-2b4f5edb";
1612
+ const SDK_VERSION = "0.0.0-dev-20260717-87fac45b";
1612
1613
  //#endregion
1613
1614
  //#region src/internal/fingerprint/fingerprintService.ts
1614
1615
  function formatOsVersion(os) {
@@ -1710,6 +1711,7 @@ async function initializeSession(options = {}) {
1710
1711
  features = { sessionIdentifier: "" };
1711
1712
  }
1712
1713
  const disableIpify = resolveDisableIpify(serverDisableIpify);
1714
+ await updateFeatureManagementUser({ customIDs: { hashed_onboarding_id: features.sessionIdentifier || void 0 } });
1713
1715
  let fingerprintSuccess = false;
1714
1716
  let fingerprintResult;
1715
1717
  if (clientFingerprintEnabled) try {
@@ -1,5 +1,14 @@
1
1
  import { n as WasmPipeline } from "./warmup-Dv2alr2-.js";
2
2
  import { s as TransactionalRiskIntelligenceSetupConfig } from "./index-BKOWUhxG.js";
3
+ import { s as FeatureManagementRedactedUserInfo } from "./IFeatureManagementCapability-ErPJywQ_.js";
4
+ //#region src/internal/environment/environment.d.ts
5
+ /**
6
+ * Coarse deployment tier for feature-management targeting.
7
+ * See `SetupOptions.environment` in `../../setup.ts` for the public-facing contract
8
+ * (locked by the first `setup()` call that supplies it).
9
+ */
10
+ type EnvironmentTier = 'development' | 'staging' | 'production';
11
+ //#endregion
3
12
  //#region src/setup.d.ts
4
13
  /**
5
14
  * WASM warmup configuration. Path fields are optional; omitted values resolve to the Incode CDN defaults.
@@ -216,6 +225,112 @@ type SetupOptions = {
216
225
  * collection should begin.
217
226
  */
218
227
  tri?: TransactionalRiskIntelligenceSetupConfig;
228
+ /**
229
+ * Enables feature management. Loaded during `setup()` as a separate dynamic chunk,
230
+ * never part of the main `@incodetech/core` bundle.
231
+ *
232
+ * Uses no customer API key: identity starts with the client SDK's
233
+ * auto-generated StableID plus the deployment tier from `environment`
234
+ * below (plus `clientExperimentId`, when supplied), and is enriched over
235
+ * the session lifecycle with `hashed_onboarding_id` (once the session
236
+ * initializes), `flow_id` (from the flow response), or `workflow_id` (from
237
+ * the workflow configuration). The applicable enrichments are awaited
238
+ * before the first module renders. Read gates/experiments via
239
+ * `@incodetech/core/feature-management`.
240
+ *
241
+ * Boot is awaited as part of `setup()` and never throws. Session, flow, and
242
+ * workflow loaders then await their identity enrichments before the first
243
+ * module renders, so evaluations never use a stale identity.
244
+ *
245
+ * Accepts:
246
+ * - `true` (default) or omitted — enabled, no `clientExperimentId` or
247
+ * privacy flags.
248
+ * - `false` — full opt-out: no chunk is fetched and no
249
+ * feature-management network traffic occurs. Reads from
250
+ * `@incodetech/core/feature-management` still work when disabled; they
251
+ * simply resolve to their documented defaults (gates `false`,
252
+ * experiments fall back, dynamic configs `null`).
253
+ * - `{ clientExperimentId?, disableStableId?, disablePersistence? }` —
254
+ * enabled with the given identity/privacy configuration.
255
+ *
256
+ * **Only the first `setup()` call that enables feature management may
257
+ * initialize it.** Every later enabled `setup()` call logs a `console.error`
258
+ * and is ignored, regardless of whether its values match. For multi-step
259
+ * boot, call `setup()` once and activate the token later with
260
+ * `initializeSession({ token })`. Call `reset()` before starting a new SDK
261
+ * lifecycle.
262
+ *
263
+ * Default: `true`.
264
+ */
265
+ featureManagement?: boolean | FeatureManagementSetupOptions;
266
+ /**
267
+ * Coarse deployment tier for feature-management (Statsig) targeting: one of
268
+ * `'development'`, `'staging'`, or `'production'`. No finer granularity.
269
+ * Default: `'production'`.
270
+ *
271
+ * Used by the first enabled feature-management initialization only — see
272
+ * `featureManagement` above.
273
+ *
274
+ * No effect when `featureManagement` is `false`.
275
+ *
276
+ * @example
277
+ * ```ts
278
+ * await setup({ apiURL, environment: 'staging' });
279
+ * ```
280
+ */
281
+ environment?: EnvironmentTier;
282
+ };
283
+ /**
284
+ * Object form of the `featureManagement` option for {@link SetupOptions}.
285
+ * The boolean shorthand (`featureManagement: true`) is equivalent to `{}`.
286
+ */
287
+ type FeatureManagementSetupOptions = {
288
+ /**
289
+ * Integrator-scoped randomization/targeting unit, registered as
290
+ * the `client_experiment_id` custom ID during initialization.
291
+ * Agreed with your Incode representative — use it to
292
+ * target or bucket gates/experiments for a specific integrator (e.g. a
293
+ * pilot rollout), independent of the per-user/per-session identity built
294
+ * up from StableID, `hashed_onboarding_id`, `flow_id`, and `workflow_id`.
295
+ */
296
+ clientExperimentId?: string;
297
+ /**
298
+ * Prevents the feature-management from generating a StableID for this
299
+ * user at all. The strongest privacy control: with no StableID and
300
+ * no other randomization-unit ID yet known, evaluations
301
+ * resolve to control/default until `hashed_onboarding_id`, `flow_id`, or
302
+ * `workflow_id` arrives later in the session. Default: `false` (StableID
303
+ * enabled).
304
+ */
305
+ disableStableId?: boolean;
306
+ /**
307
+ * Prevents the feature-management from persisting any state
308
+ * (including the StableID) to local storage (`disableStorage`) — identity
309
+ * is in-memory only for the lifetime of the page and is never linkable
310
+ * across page loads. Trades away feature-management's local bootstrap cache, so
311
+ * every session re-fetches on boot. Default: `false` (persistence
312
+ * enabled).
313
+ */
314
+ disablePersistence?: boolean;
315
+ /**
316
+ * Arbitrary attributes attached to the feature-management user for
317
+ * targeting rules and analytics. Unlike `clientExperimentId`, these are not randomization units
318
+ * — they don't bucket experiments, but gate/experiment targeting conditions can read
319
+ * them, and they annotate exposure/event logs.
320
+ *
321
+ * Set once at boot; enriching later is not currently supported here.
322
+ * Avoid putting PII or secrets in these values — they reach the
323
+ * feature-management backend's logs as-is.
324
+ */
325
+ custom?: Record<string, unknown>;
326
+ /**
327
+ * Which auto-collected feature-management user fields to blank out before
328
+ * sending them to the provider. Covers every field the underlying SDK
329
+ * collects except `custom`/`customIDs` (already caller-controlled above).
330
+ * `ip` and `country` are redacted by default; pass `false` for either to
331
+ * send it, or `true` for any other field to redact it too.
332
+ */
333
+ redactedUserInfo?: FeatureManagementRedactedUserInfo;
219
334
  };
220
335
  /**
221
336
  * Initializes the SDK with the provided configuration.
@@ -1,12 +1,13 @@
1
1
  import { d as deriveSiblingJsPath, i as warmupWasm, r as setWasmOnDeviceMode, t as WasmUtilProvider } from "./WasmUtilProvider-DAshwHhX.esm.js";
2
2
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
3
+ import { _ as applyEnvironment, c as getIsFeatureManagementLocked, f as optOutFeatureManagement, m as resetFeatureManagementProviderInstance, p as resetFeatureManagement, u as initializeFeatureManagement, v as getEnvironment, y as resetEnvironment } from "./feature-management-Dw96qEMs.esm.js";
3
4
  import { a as resetApi, i as isApiConfigured, n as getApi, r as getToken, t as api } from "./api-BDTZNnca.esm.js";
4
5
  import { i as upgradeToWasmHttpClient$1, n as installFreshHttpClient, r as resetHttpClientState, t as getStoredHttpConfig } from "./clientLifecycle-DzT65Fvf.esm.js";
5
6
  import { _ as setAnalyticsBatcher, g as resetAnalyticsBatcher, h as getAnalyticsBatcher } from "./events-Dy8PyVO5.esm.js";
6
7
  import { t as endpoints } from "./endpoints-DLQ0g4-R.esm.js";
7
8
  import { r as resetDeviceStatsQueue, t as addDeviceStats } from "./stats-Bu6bL_CX.esm.js";
8
- import { a as resetSessionInit, i as initializeSession, o as setClientFingerprintEnabled, s as setClientIpLookupEnabled } from "./sessionInitializer-B6n-FYf7.esm.js";
9
- import { a as resetTRI, n as initializeTRI, o as resetTRIProviderInstance } from "./tri-N-xlKhZK.esm.js";
9
+ import { a as resetSessionInit, i as initializeSession, o as setClientFingerprintEnabled, s as setClientIpLookupEnabled } from "./sessionInitializer-CrzyJ4Y0.esm.js";
10
+ import { a as resetTRI, n as initializeTRI, o as resetTRIProviderInstance } from "./tri-4RsGrIt6.esm.js";
10
11
  //#region ../infra/src/wasm/wasmDefaults.ts
11
12
  const WASM_CDN_BASE_URL = "https://cdn.incodesmile.com/ml-wasm-kit-release";
12
13
  /** The WASM version bundled and tested with this SDK release. */
@@ -564,6 +565,7 @@ async function setup(options) {
564
565
  console.warn("Session initialization failed:", error);
565
566
  });
566
567
  configured = true;
568
+ applyEnvironment(options.environment);
567
569
  if (effectiveWasm) {
568
570
  wasmConfig = {
569
571
  ...effectiveWasm,
@@ -579,6 +581,19 @@ async function setup(options) {
579
581
  await provider.setProductionMode(!showWasmLogs);
580
582
  if (!options.devMode) startDevtoolsDetector();
581
583
  }
584
+ if (!getIsFeatureManagementLocked()) if (options.featureManagement === false) optOutFeatureManagement();
585
+ else {
586
+ const featureManagementSetupOptions = typeof options.featureManagement === "object" ? options.featureManagement : {};
587
+ await initializeFeatureManagement({
588
+ environment: getEnvironment(),
589
+ clientExperimentId: featureManagementSetupOptions.clientExperimentId,
590
+ disableStableId: featureManagementSetupOptions.disableStableId,
591
+ disablePersistence: featureManagementSetupOptions.disablePersistence,
592
+ custom: featureManagementSetupOptions.custom,
593
+ redactedUserInfo: featureManagementSetupOptions.redactedUserInfo
594
+ });
595
+ }
596
+ else if (options.featureManagement !== void 0) console.error("[FeatureManagement] Feature management is locked after the first setup() call and cannot be changed (re-enabled, disabled, or reconfigured). Ignoring this change. Call reset() before changing it.");
582
597
  if (options.tri) await initializeTRI(options.tri, { sessionToken: options.token });
583
598
  }
584
599
  /**
@@ -671,6 +686,9 @@ function reset() {
671
686
  wasmConfig = void 0;
672
687
  WasmUtilProvider.resetInstance();
673
688
  resetTRIProviderInstance();
689
+ resetFeatureManagement();
690
+ resetFeatureManagementProviderInstance();
691
+ resetEnvironment();
674
692
  }
675
693
  //#endregion
676
694
  export { setWasmConfig as a, DEFAULT_WASM_VERSION as c, resolveWasmConfig as d, reset as i, buildDefaultWasmConfig as l, initializeWasmUtil as n, setup as o, isConfigured as r, upgradeToWasmHttpClient as s, ensureWasmPipelines as t, buildWasmConfigFromBasePath as u };