@incodetech/web 0.0.0-dev-20260506-d1f463c → 0.0.0-dev-20260506-02369cc

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.
@@ -5,7 +5,7 @@ import { o as l } from "../hooks-BVnGysT7.js";
5
5
  import { t as u } from "../incodeComponent-9ZUPvQgC.js";
6
6
  import { t as d } from "../transitionSpinner-Dmj-tzXU.js";
7
7
  import { t as f } from "../incodeModule-BH9gV7jI.js";
8
- import { a as p, c as m, d as h, i as g, l as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w } from "../useModuleLoader-DMiKw0PI.js";
8
+ import { a as p, c as m, d as h, f as g, l as _, m as v, n as y, o as b, r as x, s as S, t as C, u as w } from "../useModuleLoader-CRXhrZ1v.js";
9
9
  import { getDeviceClass as T } from "@incodetech/core/device";
10
10
  import { getRequiredWasmPipelines as E } from "@incodetech/core/flow";
11
11
  import { QrValidationError as D, bootstrapSession as O, refreshQrUrlUuid as k } from "@incodetech/core/session";
@@ -92,8 +92,8 @@ function z(e) {
92
92
  if (L.has(t)) return R(t);
93
93
  let n, r, i = new Promise((e, t) => {
94
94
  n = e, r = t;
95
- }), a = y(e);
96
- a.getState().presentation.shouldPrefetchHome && w();
95
+ }), a = S(e);
96
+ a.getState().presentation.shouldPrefetchHome && h();
97
97
  let o = {
98
98
  status: "loading",
99
99
  flowManager: a,
@@ -104,18 +104,18 @@ function z(e) {
104
104
  };
105
105
  return L.set(t, o), (async () => {
106
106
  try {
107
- await m({
107
+ await _({
108
108
  token: e.token,
109
109
  lang: e.lang,
110
110
  flowManager: a
111
111
  });
112
- let t = e.disableDashboardTheme ? Promise.resolve({}) : S().then((e) => {
112
+ let t = e.disableDashboardTheme ? Promise.resolve({}) : m().then((e) => {
113
113
  o.theme = e.theme, o.uiConfig = e.uiConfig;
114
114
  });
115
115
  o.unsubscribe = a.subscribe((t) => {
116
116
  if (t.status === "ready") {
117
117
  let n = t;
118
- b(n, e.wasmConfig), _(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
118
+ v(n, e.wasmConfig), w(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
119
119
  } else t.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = t.error, o.readyReject(Error(t.error)));
120
120
  }), await t;
121
121
  } catch (e) {
@@ -133,10 +133,10 @@ function V(e) {
133
133
  //#endregion
134
134
  //#region src/modules/flow/useFlowInitialization.ts
135
135
  function H(e) {
136
- e.getState().presentation.shouldPrefetchHome && w();
136
+ e.getState().presentation.shouldPrefetchHome && h();
137
137
  }
138
138
  function U() {
139
- T() === "desktop" && h();
139
+ T() === "desktop" && g();
140
140
  }
141
141
  function W(e) {
142
142
  let { lang: n, disableDashboardTheme: r, enableHome: a, onError: s, useCPF: l } = e, u = F(e) ? e.token : void 0, d = i(null), [f, p] = o(() => {
@@ -148,7 +148,7 @@ function W(e) {
148
148
  flowManager: e.flowManager
149
149
  };
150
150
  }
151
- let n = y({
151
+ let n = S({
152
152
  authHint: e.authHint,
153
153
  lang: e.lang,
154
154
  enableHome: e.enableHome,
@@ -197,12 +197,12 @@ function W(e) {
197
197
  }, a);
198
198
  else if (I(e)) t = (await P(e, a)).token;
199
199
  else throw Error("Flow requires token, or configurationId with apiKey or clientId");
200
- await m({
200
+ await _({
201
201
  token: t,
202
202
  lang: n,
203
203
  flowManager: f.flowManager
204
204
  });
205
- let i = r ? Promise.resolve() : S().then((e) => {
205
+ let i = r ? Promise.resolve() : m().then((e) => {
206
206
  e.uiConfig && c(e.uiConfig);
207
207
  }), o = f.flowManager.waitForReady();
208
208
  await Promise.all([o, i]), p({
@@ -237,28 +237,28 @@ var G = n(() => import("../homeScreen-BsnPnOwW.js").then((e) => ({ default: e.Ho
237
237
  let { i18n: c } = e(), u = W(r(() => ({
238
238
  ...n,
239
239
  onError: o
240
- }), [n, o])), [f, m] = l(() => u.flowManager, { autoLoad: !1 }), h = f.presentation.lazyModuleKey, _ = f.status === "ready" ? f.currentStep : void 0, y = C({
241
- moduleKey: h,
242
- modules: p,
240
+ }), [n, o])), [f, m] = l(() => u.flowManager, { autoLoad: !1 }), g = f.presentation.lazyModuleKey, _ = f.status === "ready" ? f.currentStep : void 0, S = C({
241
+ moduleKey: g,
242
+ modules: b,
243
243
  onModuleLoading: n.onModuleLoading,
244
244
  onModuleLoaded: n.onModuleLoaded,
245
245
  onError: o
246
246
  });
247
- v({
247
+ y({
248
248
  moduleKey: f.status === "ready" && f.homeScreen.visible ? _ : void 0,
249
- modules: p
249
+ modules: b
250
250
  });
251
- let S = y.status === "loaded", T = n.enableHome === !0 && f.status === "ready" && f.flow.disableLaunchScreen !== !0 && f.currentStepIndex === 0 && f.homeScreen.visible === !1 && y.status === "loading", D = A(f.presentation.isAwaitingReady === !0, 150), O = A(f.status === "ready" && (y.status === "idle" || y.status === "loading" || y.status === "error"), 150);
252
- x(f?.status === "ready" ? f.steps : [], f?.status === "ready" ? f.currentStepIndex : -1, p, S), t(() => {
251
+ let w = S.status === "loaded", T = n.enableHome === !0 && f.status === "ready" && f.flow.disableLaunchScreen !== !0 && f.currentStepIndex === 0 && f.homeScreen.visible === !1 && S.status === "loading", D = A(f.presentation.isAwaitingReady === !0, 150), O = A(f.status === "ready" && (S.status === "idle" || S.status === "loading" || S.status === "error"), 150);
252
+ x(f?.status === "ready" ? f.steps : [], f?.status === "ready" ? f.currentStepIndex : -1, b, w), t(() => {
253
253
  if (n.onFlowEvent) return m.subscribeFlowEvent(n.onFlowEvent);
254
254
  }, [m, n.onFlowEvent]), t(() => {
255
- f.presentation.shouldPrefetchHome && w();
255
+ f.presentation.shouldPrefetchHome && h();
256
256
  }, [f.presentation.shouldPrefetchHome]), t(() => {
257
257
  n.lang && c.language !== n.lang && c.changeLanguage(n.lang);
258
258
  }, [n.lang, c]), t(() => {
259
259
  if (f?.status !== "ready" || f.currentStep === "REDIRECT_TO_MOBILE") return;
260
260
  let e = f, t = E(e.flow);
261
- t.length > 0 && (n.onWasmWarmup?.(t), b(e, n.wasmConfig));
261
+ t.length > 0 && (n.onWasmWarmup?.(t), v(e, n.wasmConfig));
262
262
  }, [f, n]), t(() => {
263
263
  f?.status === "finished" && i(f.finishStatus);
264
264
  }, [
@@ -318,21 +318,21 @@ var G = n(() => import("../homeScreen-BsnPnOwW.js").then((e) => ({ default: e.Ho
318
318
  })
319
319
  });
320
320
  if (e === "IP_ADDRESS") return /* @__PURE__ */ s("div", { class: "IncodeFlow" });
321
- if (y.status === "unsupported") return /* @__PURE__ */ s("div", {
321
+ if (S.status === "unsupported") return /* @__PURE__ */ s("div", {
322
322
  class: "IncodeFlow",
323
- children: /* @__PURE__ */ s(g, {
323
+ children: /* @__PURE__ */ s(p, {
324
324
  moduleKey: e,
325
325
  onNext: () => m.completeModule()
326
326
  })
327
327
  });
328
- if (y.status === "idle" || y.status === "loading" || y.status === "error") return O ? /* @__PURE__ */ s("div", {
328
+ if (S.status === "idle" || S.status === "loading" || S.status === "error") return O ? /* @__PURE__ */ s("div", {
329
329
  class: "IncodeFlow",
330
330
  children: /* @__PURE__ */ s(d, {
331
331
  spinnerConfig: n.spinnerConfig,
332
332
  hideText: k
333
333
  })
334
334
  }) : /* @__PURE__ */ s("div", { class: "IncodeFlow" });
335
- let { Component: a } = y;
335
+ let { Component: a } = S;
336
336
  if (e === "REDIRECT_TO_MOBILE") return /* @__PURE__ */ s("div", {
337
337
  class: "IncodeFlow",
338
338
  children: /* @__PURE__ */ s(a, {
@@ -87,7 +87,7 @@ async function S() {
87
87
  return (await _.get("/omni/asset/fetch-all")).data;
88
88
  }
89
89
  var C = /* @__PURE__ */ new Map();
90
- async function w(e) {
90
+ async function ee(e) {
91
91
  if (e.startsWith("data:")) return e;
92
92
  let t = C.get(e);
93
93
  if (t) return t;
@@ -97,7 +97,7 @@ async function w(e) {
97
97
  });
98
98
  return C.set(e, r), r;
99
99
  }
100
- async function T() {
100
+ async function w() {
101
101
  let e = await S();
102
102
  if (!e.theme) throw Error("Theme URL not found in assets response");
103
103
  let t = e.theme, n = t.startsWith("http://") || t.startsWith("https://"), r;
@@ -107,19 +107,19 @@ async function T() {
107
107
  r = await e.json();
108
108
  } else r = (await _.get(t)).data;
109
109
  let i = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || r.logo, a = i;
110
- return i && (a = await w(i)), {
110
+ return i && (a = await ee(i)), {
111
111
  ...r,
112
112
  logo: a
113
113
  };
114
114
  }
115
- async function E() {
116
- let e = await T();
115
+ async function T() {
116
+ let e = await w();
117
117
  return e.main && x(e.main, e.buttonColor), e;
118
118
  }
119
119
  //#endregion
120
120
  //#region src/modules/flow/flowInit.ts
121
- var D = () => import("./id/id.es.js").then((e) => e.Id), O = () => import("./homeScreen-BsnPnOwW.js").then((e) => e.HomeScreen), k;
122
- function A(e) {
121
+ var E = () => import("./id/id.es.js").then((e) => e.Id), D = () => import("./homeScreen-BsnPnOwW.js").then((e) => e.HomeScreen), O;
122
+ function k(e) {
123
123
  if (e === "IP_ADDRESS") return () => import("@incodetech/core/flow").then((e) => e.noOpFlowModuleMachine);
124
124
  if (e === "REDIRECT_TO_MOBILE") return () => import("@incodetech/core/redirect-to-mobile").then((e) => e.redirectToMobileMachine);
125
125
  if (e === "PHONE") return () => import("@incodetech/core/phone").then((e) => e.phoneMachine);
@@ -148,26 +148,26 @@ function A(e) {
148
148
  if (e === "QE_SIGNATURE") return () => import("@incodetech/core/qe-signature").then((e) => e.qeSignatureMachine);
149
149
  if (e === "CROSS_DOCUMENT_DATA_MATCH") return () => import("@incodetech/core/cross-document-data-match").then((e) => e.crossDocumentDataMatchMachine);
150
150
  }
151
- function j(e) {
151
+ function A(e) {
152
152
  let t = {};
153
153
  for (let n of e) {
154
154
  let e = n.key;
155
155
  if (t[e]) continue;
156
- let r = A(e);
156
+ let r = k(e);
157
157
  r && (t[e] = r);
158
158
  }
159
159
  return t;
160
160
  }
161
- var M = {
161
+ var j = {
162
162
  REDIRECT_TO_MOBILE: () => import("./redirectToMobile---pcfaJC.js").then((e) => e.RedirectToMobile),
163
163
  PHONE: () => import("./phone/phone.es.js").then((e) => e.Phone),
164
164
  EMAIL: () => import("./email/email.es.js").then((e) => e.Email),
165
165
  SELFIE: () => import("./selfie/selfie.es.js").then((e) => e.Selfie),
166
166
  AUTHENTICATION: () => import("./authentication/authentication.es.js").then((e) => e.Authentication),
167
- ID: D,
168
- ID_CAPTURE: D,
169
- TUTORIAL_ID: D,
170
- SECOND_ID: D,
167
+ ID: E,
168
+ ID_CAPTURE: E,
169
+ TUTORIAL_ID: E,
170
+ SECOND_ID: E,
171
171
  FACE_MATCH: () => import("./faceMatch-B9l5cU4z.js").then((e) => e.FaceMatch),
172
172
  CURP_VALIDATION: () => import("./curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
173
173
  GOVT_VALIDATION_PROVISIONING: () => import("./governmentValidation/governmentValidation.es.js").then((e) => e.GovernmentValidation),
@@ -190,23 +190,23 @@ var M = {
190
190
  QE_SIGNATURE: () => import("./qe-signature/qe-signature.es.js").then((e) => e.QeSignature),
191
191
  CROSS_DOCUMENT_DATA_MATCH: () => import("./cross-document-data-match/cross-document-data-match.es.js").then((e) => e.CrossDocumentDataMatch)
192
192
  };
193
- function N() {
194
- return O();
193
+ function M() {
194
+ return D();
195
195
  }
196
- function P() {
197
- k || (k = N(), k.catch(() => {
198
- k = void 0;
196
+ function N() {
197
+ O || (O = M(), O.catch(() => {
198
+ O = void 0;
199
199
  }));
200
200
  }
201
- var F;
202
- function I() {
203
- if (F) return;
204
- let e = M.REDIRECT_TO_MOBILE, t = A("REDIRECT_TO_MOBILE"), n = [];
205
- e && n.push(e()), t && n.push(t()), F = Promise.all(n), F.catch(() => {
206
- F = void 0;
201
+ var P;
202
+ function F() {
203
+ if (P) return;
204
+ let e = j.REDIRECT_TO_MOBILE, t = k("REDIRECT_TO_MOBILE"), n = [];
205
+ e && n.push(e()), t && n.push(t()), P = Promise.all(n), P.catch(() => {
206
+ P = void 0;
207
207
  });
208
208
  }
209
- function L(e = {}) {
209
+ function I(e = {}) {
210
210
  let t = {}, n = e.isDesktop ?? p() === "desktop", { enableHome: r, ...i } = e;
211
211
  return m({
212
212
  enableHome: r,
@@ -214,29 +214,29 @@ function L(e = {}) {
214
214
  let r = await h(e, {
215
215
  ...i,
216
216
  isDesktop: n
217
- }), a = j(r.flowModules ?? []);
217
+ }), a = A(r.flowModules ?? []);
218
218
  for (let e of Object.keys(t)) delete t[e];
219
219
  return Object.assign(t, a), r;
220
220
  },
221
221
  lazyModules: t
222
222
  });
223
223
  }
224
- async function R(n) {
224
+ async function L(n) {
225
225
  await f({
226
226
  token: n.token,
227
227
  wasm: !1
228
228
  }), t(e(n.lang ? { lang: n.lang } : void 0));
229
229
  }
230
- async function z(e) {
230
+ async function R(e) {
231
231
  let { token: t, lang: n, flowManager: r } = e;
232
- await R({
232
+ await L({
233
233
  token: t,
234
234
  lang: n
235
235
  }), r.load();
236
236
  }
237
- async function B() {
237
+ async function z() {
238
238
  try {
239
- let e = await E(), t = {
239
+ let e = await T(), t = {
240
240
  logoSrc: e.logo,
241
241
  subtitle: e.subtitle,
242
242
  hideFooterBranding: e.hideFooterBranding
@@ -249,7 +249,7 @@ async function B() {
249
249
  return {};
250
250
  }
251
251
  }
252
- function V(e, t) {
252
+ function B(e, t) {
253
253
  if (e.currentStep === "REDIRECT_TO_MOBILE") return;
254
254
  let n = g(e.flow);
255
255
  if (n.length > 0) {
@@ -265,16 +265,16 @@ function V(e, t) {
265
265
  });
266
266
  }
267
267
  }
268
- function H(e) {
268
+ function V(e) {
269
269
  let t = e.currentStep;
270
270
  if (t) {
271
- let e = M[t];
271
+ let e = j[t];
272
272
  e && e().catch(() => {});
273
273
  }
274
274
  }
275
275
  //#endregion
276
276
  //#region src/modules/flow/unsupportedModule.tsx
277
- var U = ({ moduleKey: e, onNext: t }) => /* @__PURE__ */ a("section", {
277
+ var H = ({ moduleKey: e, onNext: t }) => /* @__PURE__ */ a("section", {
278
278
  class: "IncodeUnsupportedModule",
279
279
  "aria-live": "polite",
280
280
  children: /* @__PURE__ */ a("div", {
@@ -300,61 +300,64 @@ var U = ({ moduleKey: e, onNext: t }) => /* @__PURE__ */ a("section", {
300
300
  })
301
301
  ]
302
302
  })
303
- });
303
+ }), U = () => null, W = () => Promise.resolve(U), G = new Set(["IDENTITY_SEARCH"]);
304
304
  //#endregion
305
305
  //#region src/modules/flow/useModuleLoader.ts
306
- function W(e, t) {
306
+ function K(e, t) {
307
307
  return e instanceof Error ? e.message : t;
308
308
  }
309
- var G = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap();
310
- function q(e) {
309
+ var q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap();
310
+ function Y(e) {
311
311
  return e;
312
312
  }
313
- function J(e) {
314
- if (e) return G.get(q(e));
313
+ function X(e) {
314
+ if (e) return q.get(Y(e));
315
315
  }
316
- function Y(e) {
317
- let t = q(e), n = G.get(t);
316
+ function Z(e) {
317
+ let t = Y(e), n = q.get(t);
318
318
  if (n) return Promise.resolve(n);
319
- let r = K.get(t);
319
+ let r = J.get(t);
320
320
  if (r) return r;
321
- let i = e().then((e) => (G.set(t, e), K.delete(t), e)).catch((e) => {
322
- throw K.delete(t), e;
321
+ let i = e().then((e) => (q.set(t, e), J.delete(t), e)).catch((e) => {
322
+ throw J.delete(t), e;
323
323
  });
324
- return K.set(t, i), i;
324
+ return J.set(t, i), i;
325
325
  }
326
- function X(e) {
326
+ function Q(e) {
327
327
  if (!e) return { status: "idle" };
328
- let t = J(e);
328
+ let t = X(e);
329
329
  return t ? {
330
330
  status: "loaded",
331
331
  Component: t
332
332
  } : { status: "loading" };
333
333
  }
334
- function Z(e) {
335
- let { loader: t, onLoading: a, onLoaded: o, onError: s } = e, [c, l] = i(() => X(t)), u = r(t), d = r(a), f = r(o), p = r(s);
334
+ function te(e, t, n) {
335
+ if (e) return t[e] ?? (n?.has(e) ? W : void 0);
336
+ }
337
+ function $(e) {
338
+ let { loader: t, onLoading: a, onLoaded: o, onError: s } = e, [c, l] = i(() => Q(t)), u = r(t), d = r(a), f = r(o), p = r(s);
336
339
  return n(() => {
337
340
  d.current = a, f.current = o, p.current = s;
338
341
  }, [
339
342
  a,
340
343
  o,
341
344
  s
342
- ]), u.current !== t && (u.current = t, l(X(t))), n(() => {
345
+ ]), u.current !== t && (u.current = t, l(Q(t))), n(() => {
343
346
  if (!t) return;
344
- if (J(t)) {
347
+ if (X(t)) {
345
348
  f.current?.();
346
349
  return;
347
350
  }
348
351
  d.current?.();
349
352
  let e = !1;
350
- return Y(t).then((t) => {
353
+ return Z(t).then((t) => {
351
354
  e || (l({
352
355
  status: "loaded",
353
356
  Component: t
354
357
  }), f.current?.());
355
358
  }).catch((t) => {
356
359
  if (!e) {
357
- let e = W(t, "Failed to load component");
360
+ let e = K(t, "Failed to load component");
358
361
  l({
359
362
  status: "error",
360
363
  error: e
@@ -365,45 +368,45 @@ function Z(e) {
365
368
  };
366
369
  }, [t]), c;
367
370
  }
368
- function Q(e) {
369
- let { moduleKey: t, modules: r, onModuleLoading: a, onModuleLoaded: o, onError: s } = e, [c, l] = i(void 0), u = t ? r[t] : void 0, d = Z({
370
- loader: u,
371
- onLoading: t ? () => a?.(t) : void 0,
372
- onLoaded: t ? () => o?.(t) : void 0,
373
- onError: t ? (e) => s?.(`Failed to load ${t}: ${e}`) : void 0
371
+ function ne(e) {
372
+ let { moduleKey: t, modules: r, headlessModuleKeys: a, onModuleLoading: o, onModuleLoaded: s, onError: c } = e, [l, u] = i(void 0), d = te(t, r, a), f = $({
373
+ loader: d,
374
+ onLoading: t ? () => o?.(t) : void 0,
375
+ onLoaded: t ? () => s?.(t) : void 0,
376
+ onError: t ? (e) => c?.(`Failed to load ${t}: ${e}`) : void 0
374
377
  });
375
378
  return n(() => {
376
379
  if (!t) {
377
- l(void 0);
380
+ u(void 0);
378
381
  return;
379
382
  }
380
- l(u ? void 0 : t);
381
- }, [u, t]), t ? c ? {
383
+ u(d ? void 0 : t);
384
+ }, [d, t]), t ? l ? {
382
385
  status: "unsupported",
383
- moduleKey: c
384
- } : d.status === "idle" || d.status === "loading" ? {
386
+ moduleKey: l
387
+ } : f.status === "idle" || f.status === "loading" ? {
385
388
  status: "loading",
386
389
  moduleKey: t
387
- } : d.status === "error" ? {
390
+ } : f.status === "error" ? {
388
391
  status: "error",
389
392
  moduleKey: t,
390
- error: d.error
393
+ error: f.error
391
394
  } : {
392
395
  status: "loaded",
393
396
  moduleKey: t,
394
- Component: d.Component
397
+ Component: f.Component
395
398
  } : { status: "idle" };
396
399
  }
397
- function $(e) {
398
- let { moduleKey: t, modules: n } = e, r = t ? n[t] : void 0, i = Z({ loader: r });
400
+ function re(e) {
401
+ let { moduleKey: t, modules: n } = e, r = t ? n[t] : void 0, i = $({ loader: r });
399
402
  return r != null && i.status === "loaded";
400
403
  }
401
- function ee(e) {
404
+ function ie(e) {
402
405
  typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
403
406
  e();
404
407
  }) : setTimeout(e, 0);
405
408
  }
406
- function te(e, t, i, a) {
409
+ function ae(e, t, i, a) {
407
410
  let o = r(/* @__PURE__ */ new Set());
408
411
  n(() => {
409
412
  if (a && t < e.length - 1) {
@@ -411,7 +414,7 @@ function te(e, t, i, a) {
411
414
  if (n && !o.current.has(n)) {
412
415
  o.current.add(n);
413
416
  let e = i[n];
414
- e && ee(() => {
417
+ e && ie(() => {
415
418
  e().catch(() => {
416
419
  o.current.delete(n);
417
420
  });
@@ -426,4 +429,4 @@ function te(e, t, i, a) {
426
429
  ]);
427
430
  }
428
431
  //#endregion
429
- export { M as a, z as c, I as d, R as f, U as i, H as l, E as m, $ as n, L as o, V as p, te as r, B as s, Q as t, P as u };
432
+ export { H as a, z as c, N as d, F as f, T as h, G as i, R as l, B as m, re as n, j as o, L as p, ae as r, I as s, ne as t, V as u };
@@ -6,18 +6,18 @@ import { t as s } from "../incodeComponent-9ZUPvQgC.js";
6
6
  import "../spinner-BiPJCr9Q.js";
7
7
  import { t as c } from "../transitionSpinner-Dmj-tzXU.js";
8
8
  import { t as l } from "../incodeModule-BH9gV7jI.js";
9
- import { a as u, f as d, i as f, m as p, t as m } from "../useModuleLoader-DMiKw0PI.js";
10
- import { resolveWasmConfig as h, warmupWasm as g } from "@incodetech/core/wasm";
11
- import { QrValidationError as _, refreshQrUrlUuid as v } from "@incodetech/core/session";
12
- import { createWorkflowManager as y } from "@incodetech/core/workflow";
9
+ import { a as u, h as d, i as f, o as p, p as m, t as h } from "../useModuleLoader-CRXhrZ1v.js";
10
+ import { resolveWasmConfig as g, warmupWasm as _ } from "@incodetech/core/wasm";
11
+ import { QrValidationError as v, refreshQrUrlUuid as y } from "@incodetech/core/session";
12
+ import { createWorkflowManager as b } from "@incodetech/core/workflow";
13
13
  //#region src/modules/workflow/workflowInit.ts
14
- var b = {
15
- ...u,
14
+ var x = {
15
+ ...p,
16
16
  REDIRECT_TO_MOBILE: () => import("../redirectToMobile---pcfaJC.js").then((e) => e.RedirectToMobile)
17
17
  };
18
- async function x() {
18
+ async function S() {
19
19
  try {
20
- let e = await p();
20
+ let e = await d();
21
21
  return {
22
22
  theme: e,
23
23
  uiConfig: {
@@ -29,15 +29,15 @@ async function x() {
29
29
  return {};
30
30
  }
31
31
  }
32
- function S(e = {}) {
33
- return y({
32
+ function C(e = {}) {
33
+ return b({
34
34
  customModuleCallback: e.customModuleCallback,
35
35
  interviewId: e.interviewId,
36
36
  isDesktop: e.isDesktop
37
37
  });
38
38
  }
39
- function C(e) {
40
- e !== !1 && g(h({
39
+ function w(e) {
40
+ e !== !1 && _(g({
41
41
  ...e,
42
42
  pipelines: e?.pipelines ?? ["selfie", "idCapture"]
43
43
  })).catch((e) => {
@@ -46,48 +46,48 @@ function C(e) {
46
46
  }
47
47
  //#endregion
48
48
  //#region src/modules/workflow/useWorkflowInitialization.ts
49
- function w(e) {
50
- let { token: i, lang: o, disableDashboardTheme: s, wasmConfig: c, customModuleCallback: l, interviewId: u, isDesktop: f, urlUuid: p, onError: m, onUrlUuidRefreshed: h } = e, g = n(null), [y, b] = r(() => {
51
- let e = S({
49
+ function T(e) {
50
+ let { token: i, lang: o, disableDashboardTheme: s, wasmConfig: c, customModuleCallback: l, interviewId: u, isDesktop: d, urlUuid: f, onError: p, onUrlUuidRefreshed: h } = e, g = n(null), [_, b] = r(() => {
51
+ let e = C({
52
52
  customModuleCallback: l,
53
53
  interviewId: u,
54
- isDesktop: f
54
+ isDesktop: d
55
55
  });
56
56
  return g.current = e, {
57
57
  status: "initializing",
58
58
  workflowManager: e
59
59
  };
60
- }), w = n(!1);
60
+ }), x = n(!1);
61
61
  return t(() => {
62
- if (y.status !== "initializing" || w.current) return;
63
- w.current = !0;
62
+ if (_.status !== "initializing" || x.current) return;
63
+ x.current = !0;
64
64
  let e = g.current, t = new AbortController(), { signal: n } = t;
65
65
  return (async () => {
66
66
  try {
67
- await d({
67
+ await m({
68
68
  token: i,
69
69
  lang: o
70
- }), p && await v({
71
- urlUuid: p,
70
+ }), f && await y({
71
+ urlUuid: f,
72
72
  onboardingId: null,
73
73
  onRefreshed: h
74
74
  }, n);
75
- let t = s ? Promise.resolve() : x().then((e) => {
75
+ let t = s ? Promise.resolve() : S().then((e) => {
76
76
  e.uiConfig && a(e.uiConfig);
77
77
  });
78
- C(c), e.load(), await t, b({
78
+ w(c), e.load(), await t, b({
79
79
  status: "ready",
80
80
  workflowManager: e
81
81
  });
82
82
  } catch (t) {
83
83
  if (n.aborted) return;
84
- let r = t instanceof Error ? t.message : "Failed to initialize SDK", i = t instanceof _ ? t.status : void 0;
84
+ let r = t instanceof Error ? t.message : "Failed to initialize SDK", i = t instanceof v ? t.status : void 0;
85
85
  b({
86
86
  status: "error",
87
87
  error: r,
88
88
  errorCode: i,
89
89
  workflowManager: e
90
- }), m?.(r, i);
90
+ }), p?.(r, i);
91
91
  }
92
92
  })(), () => {
93
93
  t.abort(), e?.stop();
@@ -97,14 +97,14 @@ function w(e) {
97
97
  o,
98
98
  s,
99
99
  c,
100
+ f,
100
101
  p,
101
- m,
102
102
  h
103
- ]), y;
103
+ ]), _;
104
104
  }
105
105
  //#endregion
106
106
  //#region src/modules/workflow/workflow.tsx
107
- function T(e) {
107
+ function E(e) {
108
108
  let { moduleKey: t, config: n, workflowId: r, authHint: i, lang: a, mergeSessionRecordings: o, ageAssurance: s } = e;
109
109
  switch (t) {
110
110
  case "AUTHENTICATION": return {
@@ -144,8 +144,8 @@ function T(e) {
144
144
  default: return n;
145
145
  }
146
146
  }
147
- var E = ({ config: r, onFinish: a, onError: s }) => {
148
- let { i18n: l } = e(), u = w({
147
+ var D = ({ config: r, onFinish: a, onError: s }) => {
148
+ let { i18n: l } = e(), d = T({
149
149
  token: r.token,
150
150
  lang: r.lang,
151
151
  disableDashboardTheme: r.disableDashboardTheme,
@@ -156,9 +156,10 @@ var E = ({ config: r, onFinish: a, onError: s }) => {
156
156
  urlUuid: r.urlUuid,
157
157
  onError: s,
158
158
  onUrlUuidRefreshed: r.onUrlUuidRefreshed
159
- }), [d, p] = o(() => u.workflowManager, { autoLoad: !1 }), h = m({
160
- moduleKey: d?.status === "ready" ? d.currentNode.moduleKey : void 0,
161
- modules: b,
159
+ }), [p, m] = o(() => d.workflowManager, { autoLoad: !1 }), g = h({
160
+ moduleKey: p?.status === "ready" ? p.currentNode.moduleKey : void 0,
161
+ modules: x,
162
+ headlessModuleKeys: f,
162
163
  onModuleLoading: r.onModuleLoading,
163
164
  onModuleLoaded: r.onModuleLoaded,
164
165
  onError: s
@@ -166,60 +167,60 @@ var E = ({ config: r, onFinish: a, onError: s }) => {
166
167
  t(() => {
167
168
  r.lang && l.language !== r.lang && l.changeLanguage(r.lang);
168
169
  }, [r.lang, l]);
169
- let g = n(!1);
170
+ let _ = n(!1);
170
171
  t(() => {
171
- g.current || (d?.status === "finished" ? (g.current = !0, a?.(d.finishStatus)) : d?.status === "asyncResolution" && (g.current = !0, a?.()));
172
+ _.current || (p?.status === "finished" ? (_.current = !0, a?.(p.finishStatus)) : p?.status === "asyncResolution" && (_.current = !0, a?.()));
172
173
  }, [
173
- d?.status,
174
+ p?.status,
174
175
  a,
175
- d
176
+ p
176
177
  ]), t(() => {
177
- d?.status === "error" && s && s(d.error, d.errorCode);
178
+ p?.status === "error" && s && s(p.error, p.errorCode);
178
179
  }, [
179
- d?.status,
180
+ p?.status,
180
181
  s,
181
- d
182
+ p
182
183
  ]);
183
- let _ = () => /* @__PURE__ */ i("div", {
184
+ let v = () => /* @__PURE__ */ i("div", {
184
185
  class: "IncodeWorkflow",
185
186
  children: /* @__PURE__ */ i(c, { spinnerConfig: r.spinnerConfig })
186
- }), v = (e) => {
187
- p.errorModule(e ?? "Module error"), s?.(e ?? "Module error");
187
+ }), y = (e) => {
188
+ m.errorModule(e ?? "Module error"), s?.(e ?? "Module error");
188
189
  };
189
- if (u.status === "error") return null;
190
- if (u.status === "initializing" || !d || d.status === "idle" || d.status === "loading") return _();
191
- if (d.status === "finished" || d.status === "error" || d.status === "asyncResolution" || d.status === "closed") return null;
192
- if (h.status === "unsupported") return /* @__PURE__ */ i("div", {
190
+ if (d.status === "error") return null;
191
+ if (d.status === "initializing" || !p || p.status === "idle" || p.status === "loading") return v();
192
+ if (p.status === "finished" || p.status === "error" || p.status === "asyncResolution" || p.status === "closed") return null;
193
+ if (g.status === "unsupported") return /* @__PURE__ */ i("div", {
193
194
  class: "IncodeWorkflow",
194
- children: /* @__PURE__ */ i(f, {
195
- moduleKey: d.currentNode.moduleKey,
196
- onNext: () => p.completeModule()
195
+ children: /* @__PURE__ */ i(u, {
196
+ moduleKey: p.currentNode.moduleKey,
197
+ onNext: () => m.completeModule()
197
198
  })
198
199
  });
199
- if (h.status === "idle" || h.status === "loading" || h.status === "error") return _();
200
- let { Component: y } = h;
200
+ if (g.status === "idle" || g.status === "loading" || g.status === "error") return v();
201
+ let { Component: b } = g;
201
202
  return /* @__PURE__ */ i("div", {
202
203
  class: "IncodeWorkflow",
203
- children: /* @__PURE__ */ i(y, {
204
- config: T({
205
- moduleKey: d.currentNode.moduleKey,
206
- config: d.config,
207
- workflowId: d.workflowConfig.id,
204
+ children: /* @__PURE__ */ i(b, {
205
+ config: E({
206
+ moduleKey: p.currentNode.moduleKey,
207
+ config: p.config,
208
+ workflowId: p.workflowConfig.id,
208
209
  authHint: r.authHint,
209
210
  lang: r.lang,
210
- mergeSessionRecordings: d.workflowConfig.mergeSessionRecordings,
211
- ageAssurance: d.workflowConfig.ageAssurance
211
+ mergeSessionRecordings: p.workflowConfig.mergeSessionRecordings,
212
+ ageAssurance: p.workflowConfig.ageAssurance
212
213
  }),
213
- onFinish: () => p.completeModule(),
214
- onError: v,
215
- ...d.currentNode.moduleKey === "REDIRECT_TO_MOBILE" ? { onContinue: () => p.completeModule() } : {}
216
- }, d.currentNode.id)
214
+ onFinish: () => m.completeModule(),
215
+ onError: y,
216
+ ...p.currentNode.moduleKey === "REDIRECT_TO_MOBILE" ? { onContinue: () => m.completeModule() } : {}
217
+ }, p.currentNode.id)
217
218
  });
218
- }, D = ({ config: e, onFinish: t, onError: n }) => /* @__PURE__ */ i(s, { children: e ? /* @__PURE__ */ i(E, {
219
+ }, O = ({ config: e, onFinish: t, onError: n }) => /* @__PURE__ */ i(s, { children: e ? /* @__PURE__ */ i(D, {
219
220
  config: e,
220
221
  onFinish: t,
221
222
  onError: n
222
223
  }) : null });
223
- l(D, "incode-workflow");
224
+ l(O, "incode-workflow");
224
225
  //#endregion
225
- export { D as IncodeWorkflow };
226
+ export { O as IncodeWorkflow };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260506-d1f463c",
3
+ "version": "0.0.0-dev-20260506-02369cc",
4
4
  "type": "module",
5
5
  "main": "./dist/index.es.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -239,7 +239,7 @@
239
239
  "qrcode": "^1.5.4",
240
240
  "signature_pad": "^5.1.3",
241
241
  "tailwindcss": "^4.1.17",
242
- "@incodetech/core": "0.0.0-dev-20260506-d1f463c"
242
+ "@incodetech/core": "0.0.0-dev-20260506-02369cc"
243
243
  },
244
244
  "devDependencies": {
245
245
  "@microsoft/api-extractor": "^7.53.3",