@incodetech/web 0.0.0-dev-20260507-85da360 → 0.0.0-dev-20260507-a2cd155

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-av72n-l1.js";
7
7
  import { t as f } from "../incodeModule-D_r2n18O.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-DRDu9LBw.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-CPLC4c0j.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";
@@ -2,13 +2,13 @@ import { i as e, r as t } from "./i18n-BnVa5Y-_.js";
2
2
  import { _ as n, l as r, p as i, v as a } from "./vendor-preact-D6SntenC.js";
3
3
  import { t as o } from "./uiConfig-CwpQ-IM6.js";
4
4
  import { t as s } from "./button-DcCUEn2n.js";
5
- import { initializeWasmUtil as c, resolveWasmConfig as l, setWasmConfig as u, warmupWasm as d } from "@incodetech/core/wasm";
6
- import { setup as f } from "@incodetech/core";
7
- import { getDeviceClass as p } from "@incodetech/core/device";
8
- import { createOrchestratedFlowManager as m, getFlow as h, getRequiredWasmPipelines as g } from "@incodetech/core/flow";
9
- import { api as _ } from "@incodetech/core/http";
5
+ import { initializeWasmUtil as c, resolveWasmConfig as l, setWasmConfig as u, upgradeToWasmHttpClient as d, warmupWasm as f } from "@incodetech/core/wasm";
6
+ import { setup as p } from "@incodetech/core";
7
+ import { getDeviceClass as m } from "@incodetech/core/device";
8
+ import { createOrchestratedFlowManager as h, getFlow as g, getRequiredWasmPipelines as _ } from "@incodetech/core/flow";
9
+ import { api as v } from "@incodetech/core/http";
10
10
  //#region src/styles/generatePalette.ts
11
- function v(e) {
11
+ function y(e) {
12
12
  let t = e.replace("#", "");
13
13
  t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
14
14
  let n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
@@ -34,7 +34,7 @@ function v(e) {
34
34
  l: u * 100
35
35
  };
36
36
  }
37
- function y(e, t, n) {
37
+ function b(e, t, n) {
38
38
  let r = e / 360, i = t / 100, a = n / 100, o, s, c;
39
39
  if (i === 0) o = s = c = a;
40
40
  else {
@@ -47,24 +47,24 @@ function y(e, t, n) {
47
47
  };
48
48
  return `#${l(o)}${l(s)}${l(c)}`;
49
49
  }
50
- function b(e) {
51
- let t = v(e);
50
+ function ee(e) {
51
+ let t = y(e);
52
52
  if (!t) throw Error(`Invalid color format: ${e}`);
53
53
  return {
54
- 50: y(t.h, t.s, 95),
55
- 200: y(t.h, t.s, 80),
56
- 300: y(t.h, t.s, 65),
57
- 400: y(t.h, t.s, Math.min(100, t.l + 10)),
54
+ 50: b(t.h, t.s, 95),
55
+ 200: b(t.h, t.s, 80),
56
+ 300: b(t.h, t.s, 65),
57
+ 400: b(t.h, t.s, Math.min(100, t.l + 10)),
58
58
  500: e,
59
- 600: y(t.h, t.s, Math.max(0, t.l - 10)),
60
- 900: y(t.h, t.s, 20)
59
+ 600: b(t.h, t.s, Math.max(0, t.l - 10)),
60
+ 900: b(t.h, t.s, 20)
61
61
  };
62
62
  }
63
63
  //#endregion
64
64
  //#region src/styles/applyTheme.ts
65
- function x(e, t) {
65
+ function te(e, t) {
66
66
  if (typeof document > "u") return;
67
- let n = b(e), r = document.getElementById("incode-theme");
67
+ let n = ee(e), r = document.getElementById("incode-theme");
68
68
  r || (r = document.createElement("style"), r.id = "incode-theme", document.head.appendChild(r));
69
69
  let i = t || "#ffffff", a = `
70
70
  :root,
@@ -83,38 +83,38 @@ function x(e, t) {
83
83
  }
84
84
  //#endregion
85
85
  //#region src/styles/fetchTheme.ts
86
- async function S() {
87
- return (await _.get("/omni/asset/fetch-all")).data;
86
+ async function x() {
87
+ return (await v.get("/omni/asset/fetch-all")).data;
88
88
  }
89
- var C = /* @__PURE__ */ new Map();
90
- async function ee(e) {
89
+ var S = /* @__PURE__ */ new Map();
90
+ async function C(e) {
91
91
  if (e.startsWith("data:")) return e;
92
- let t = C.get(e);
92
+ let t = S.get(e);
93
93
  if (t) return t;
94
94
  let n = await (await fetch(e)).blob(), r = await new Promise((e, t) => {
95
95
  let r = new FileReader();
96
96
  r.onloadend = () => e(r.result), r.onerror = t, r.readAsDataURL(n);
97
97
  });
98
- return C.set(e, r), r;
98
+ return S.set(e, r), r;
99
99
  }
100
100
  async function w() {
101
- let e = await S();
101
+ let e = await x();
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;
104
104
  if (n) {
105
105
  let e = await fetch(t);
106
106
  if (!e.ok) throw Error(`Failed to fetch theme: ${e.statusText}`);
107
107
  r = await e.json();
108
- } else r = (await _.get(t)).data;
108
+ } else r = (await v.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 ee(i)), {
110
+ return i && (a = await C(i)), {
111
111
  ...r,
112
112
  logo: a
113
113
  };
114
114
  }
115
115
  async function T() {
116
116
  let e = await w();
117
- return e.main && x(e.main, e.buttonColor), e;
117
+ return e.main && te(e.main, e.buttonColor), e;
118
118
  }
119
119
  //#endregion
120
120
  //#region src/modules/flow/flowInit.ts
@@ -209,11 +209,11 @@ function F() {
209
209
  });
210
210
  }
211
211
  function I(e = {}) {
212
- let t = {}, n = e.isDesktop ?? p() === "desktop", { enableHome: r, ...i } = e;
213
- return m({
212
+ let t = {}, n = e.isDesktop ?? m() === "desktop", { enableHome: r, ...i } = e;
213
+ return h({
214
214
  enableHome: r,
215
215
  getFlow: async (e) => {
216
- let r = await h(e, {
216
+ let r = await g(e, {
217
217
  ...i,
218
218
  isDesktop: n
219
219
  }), a = A(r.flowModules ?? []);
@@ -224,7 +224,7 @@ function I(e = {}) {
224
224
  });
225
225
  }
226
226
  async function L(n) {
227
- await f({
227
+ await p({
228
228
  token: n.token,
229
229
  wasm: !1
230
230
  }), t(e(n.lang ? { lang: n.lang } : void 0));
@@ -253,7 +253,7 @@ async function z() {
253
253
  }
254
254
  function B(e, t) {
255
255
  if (e.currentStep === "REDIRECT_TO_MOBILE") return;
256
- let n = g(e.flow);
256
+ let n = _(e.flow);
257
257
  if (n.length > 0) {
258
258
  let e = l({
259
259
  ...t ?? {},
@@ -262,7 +262,7 @@ function B(e, t) {
262
262
  ...e,
263
263
  pipelines: e.pipelines ? [...e.pipelines] : void 0
264
264
  };
265
- u(r), d(e).then(() => c(r)).catch((e) => {
265
+ u(r), f(e).then(() => c(r)).then(() => d(r)).catch((e) => {
266
266
  console.error("WASM warmup failed:", e);
267
267
  });
268
268
  }
@@ -333,7 +333,7 @@ function Q(e) {
333
333
  Component: t
334
334
  } : { status: "loading" };
335
335
  }
336
- function te(e, t, n) {
336
+ function ne(e, t, n) {
337
337
  if (e) return t[e] ?? (n?.has(e) ? W : void 0);
338
338
  }
339
339
  function $(e) {
@@ -370,8 +370,8 @@ function $(e) {
370
370
  };
371
371
  }, [t]), c;
372
372
  }
373
- function ne(e) {
374
- 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
+ function re(e) {
374
+ let { moduleKey: t, modules: r, headlessModuleKeys: a, onModuleLoading: o, onModuleLoaded: s, onError: c } = e, [l, u] = i(void 0), d = ne(t, r, a), f = $({
375
375
  loader: d,
376
376
  onLoading: t ? () => o?.(t) : void 0,
377
377
  onLoaded: t ? () => s?.(t) : void 0,
@@ -399,16 +399,16 @@ function ne(e) {
399
399
  Component: f.Component
400
400
  } : { status: "idle" };
401
401
  }
402
- function re(e) {
402
+ function ie(e) {
403
403
  let { moduleKey: t, modules: n } = e, r = t ? n[t] : void 0, i = $({ loader: r });
404
404
  return r != null && i.status === "loaded";
405
405
  }
406
- function ie(e) {
406
+ function ae(e) {
407
407
  typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
408
408
  e();
409
409
  }) : setTimeout(e, 0);
410
410
  }
411
- function ae(e, t, i, a) {
411
+ function oe(e, t, i, a) {
412
412
  let o = r(/* @__PURE__ */ new Set());
413
413
  n(() => {
414
414
  if (a && t < e.length - 1) {
@@ -416,7 +416,7 @@ function ae(e, t, i, a) {
416
416
  if (n && !o.current.has(n)) {
417
417
  o.current.add(n);
418
418
  let e = i[n];
419
- e && ie(() => {
419
+ e && ae(() => {
420
420
  e().catch(() => {
421
421
  o.current.delete(n);
422
422
  });
@@ -431,4 +431,4 @@ function ae(e, t, i, a) {
431
431
  ]);
432
432
  }
433
433
  //#endregion
434
- 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 };
434
+ 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, ie as n, j as o, L as p, oe as r, I as s, re as t, V as u };
@@ -6,17 +6,17 @@ import { t as s } from "../incodeComponent-9ZUPvQgC.js";
6
6
  import "../spinner-B4dcie2T.js";
7
7
  import { t as c } from "../transitionSpinner-av72n-l1.js";
8
8
  import { t as l } from "../incodeModule-D_r2n18O.js";
9
- import { a as u, h as d, i as f, o as p, p as m, t as h } from "../useModuleLoader-DRDu9LBw.js";
10
- import { resolveWasmConfig as g, warmupWasm as _ } from "@incodetech/core/wasm";
11
- import { getDeviceClass as v } from "@incodetech/core/device";
12
- import { QrValidationError as y, refreshQrUrlUuid as b } from "@incodetech/core/session";
13
- import { createWorkflowManager as x } 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-CPLC4c0j.js";
10
+ import { resolveWasmConfig as g, upgradeToWasmHttpClient as _, warmupWasm as v } from "@incodetech/core/wasm";
11
+ import { getDeviceClass as y } from "@incodetech/core/device";
12
+ import { QrValidationError as b, refreshQrUrlUuid as x } from "@incodetech/core/session";
13
+ import { createWorkflowManager as S } from "@incodetech/core/workflow";
14
14
  //#region src/modules/workflow/workflowInit.ts
15
- var S = {
15
+ var C = {
16
16
  ...p,
17
17
  REDIRECT_TO_MOBILE: () => import("../redirectToMobile-Cg-BpzrT.js").then((e) => e.RedirectToMobile)
18
18
  };
19
- async function C() {
19
+ async function w() {
20
20
  try {
21
21
  let e = await d();
22
22
  return {
@@ -30,26 +30,31 @@ async function C() {
30
30
  return {};
31
31
  }
32
32
  }
33
- function w(e = {}) {
34
- return x({
33
+ function T(e = {}) {
34
+ return S({
35
35
  customModuleCallback: e.customModuleCallback,
36
36
  interviewId: e.interviewId,
37
- isDesktop: e.isDesktop ?? v() === "desktop"
37
+ isDesktop: e.isDesktop ?? y() === "desktop"
38
38
  });
39
39
  }
40
- function T(e) {
41
- e !== !1 && _(g({
40
+ function E(e) {
41
+ if (e === !1) return;
42
+ let t = g({
42
43
  ...e,
43
44
  pipelines: e?.pipelines ?? ["selfie", "idCapture"]
44
- })).catch((e) => {
45
+ }), n = {
46
+ ...t,
47
+ pipelines: t.pipelines ? [...t.pipelines] : void 0
48
+ };
49
+ v(t).then(() => _(n)).catch((e) => {
45
50
  console.error("Workflow WASM warmup failed:", e);
46
51
  });
47
52
  }
48
53
  //#endregion
49
54
  //#region src/modules/workflow/useWorkflowInitialization.ts
50
- function E(e) {
55
+ function D(e) {
51
56
  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), [_, v] = r(() => {
52
- let e = w({
57
+ let e = T({
53
58
  customModuleCallback: l,
54
59
  interviewId: u,
55
60
  isDesktop: d
@@ -58,31 +63,31 @@ function E(e) {
58
63
  status: "initializing",
59
64
  workflowManager: e
60
65
  };
61
- }), x = n(!1);
66
+ }), y = n(!1);
62
67
  return t(() => {
63
- if (_.status !== "initializing" || x.current) return;
64
- x.current = !0;
68
+ if (_.status !== "initializing" || y.current) return;
69
+ y.current = !0;
65
70
  let e = g.current, t = new AbortController(), { signal: n } = t;
66
71
  return (async () => {
67
72
  try {
68
73
  await m({
69
74
  token: i,
70
75
  lang: o
71
- }), f && await b({
76
+ }), f && await x({
72
77
  urlUuid: f,
73
78
  onboardingId: null,
74
79
  onRefreshed: h
75
80
  }, n);
76
- let t = s ? Promise.resolve() : C().then((e) => {
81
+ let t = s ? Promise.resolve() : w().then((e) => {
77
82
  e.uiConfig && a(e.uiConfig);
78
83
  });
79
- T(c), e.load(), await t, v({
84
+ E(c), e.load(), await t, v({
80
85
  status: "ready",
81
86
  workflowManager: e
82
87
  });
83
88
  } catch (t) {
84
89
  if (n.aborted) return;
85
- let r = t instanceof Error ? t.message : "Failed to initialize SDK", i = t instanceof y ? t.status : void 0;
90
+ let r = t instanceof Error ? t.message : "Failed to initialize SDK", i = t instanceof b ? t.status : void 0;
86
91
  v({
87
92
  status: "error",
88
93
  error: r,
@@ -105,7 +110,7 @@ function E(e) {
105
110
  }
106
111
  //#endregion
107
112
  //#region src/modules/workflow/workflow.tsx
108
- function D(e) {
113
+ function O(e) {
109
114
  let { moduleKey: t, config: n, workflowId: r, authHint: i, lang: a, mergeSessionRecordings: o, ageAssurance: s } = e;
110
115
  switch (t) {
111
116
  case "AUTHENTICATION": return {
@@ -145,8 +150,8 @@ function D(e) {
145
150
  default: return n;
146
151
  }
147
152
  }
148
- var O = ({ config: r, onFinish: a, onError: s }) => {
149
- let { i18n: l } = e(), d = E({
153
+ var k = ({ config: r, onFinish: a, onError: s }) => {
154
+ let { i18n: l } = e(), d = D({
150
155
  token: r.token,
151
156
  lang: r.lang,
152
157
  disableDashboardTheme: r.disableDashboardTheme,
@@ -159,7 +164,7 @@ var O = ({ config: r, onFinish: a, onError: s }) => {
159
164
  onUrlUuidRefreshed: r.onUrlUuidRefreshed
160
165
  }), [p, m] = o(() => d.workflowManager, { autoLoad: !1 }), g = h({
161
166
  moduleKey: p?.status === "ready" ? p.currentNode.moduleKey : void 0,
162
- modules: S,
167
+ modules: C,
163
168
  headlessModuleKeys: f,
164
169
  onModuleLoading: r.onModuleLoading,
165
170
  onModuleLoaded: r.onModuleLoaded,
@@ -206,7 +211,7 @@ var O = ({ config: r, onFinish: a, onError: s }) => {
206
211
  return /* @__PURE__ */ i("div", {
207
212
  class: "IncodeWorkflow",
208
213
  children: /* @__PURE__ */ i(x, {
209
- config: D({
214
+ config: O({
210
215
  moduleKey: p.currentNode.moduleKey,
211
216
  config: p.config,
212
217
  workflowId: p.workflowConfig.id,
@@ -220,11 +225,11 @@ var O = ({ config: r, onFinish: a, onError: s }) => {
220
225
  ...p.currentNode.moduleKey === "REDIRECT_TO_MOBILE" ? { onContinue: () => m.completeModule() } : {}
221
226
  }, p.currentNode.id)
222
227
  });
223
- }, k = ({ config: e, onFinish: t, onError: n }) => /* @__PURE__ */ i(s, { children: e ? /* @__PURE__ */ i(O, {
228
+ }, A = ({ config: e, onFinish: t, onError: n }) => /* @__PURE__ */ i(s, { children: e ? /* @__PURE__ */ i(k, {
224
229
  config: e,
225
230
  onFinish: t,
226
231
  onError: n
227
232
  }) : null });
228
- l(k, "incode-workflow");
233
+ l(A, "incode-workflow");
229
234
  //#endregion
230
- export { k as IncodeWorkflow };
235
+ export { A as IncodeWorkflow };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260507-85da360",
3
+ "version": "0.0.0-dev-20260507-a2cd155",
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-20260507-85da360"
242
+ "@incodetech/core": "0.0.0-dev-20260507-a2cd155"
243
243
  },
244
244
  "devDependencies": {
245
245
  "@microsoft/api-extractor": "^7.53.3",