@incodetech/web 0.0.0-dev-20260219-dfbf2ff → 0.0.0-dev-20260220-bec1051
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.
- package/dist/Trans-CkYswaqC.js +33 -0
- package/dist/authentication/authentication.es.js +2 -2
- package/dist/base.css +50 -11
- package/dist/{baseTutorial-B9sBivde.js → baseTutorial-BdLJBzYE.js} +36 -58
- package/dist/curp-validation/curp-validation.es.js +5 -4
- package/dist/{faceMatch-IT9RDlHh.js → faceMatch-iEplxPox.js} +1 -1
- package/dist/flow/flow.es.js +213 -197
- package/dist/flow/styles.css +143 -0
- package/dist/geolocation/geolocation.es.js +692 -0
- package/dist/geolocation/styles.css +126 -0
- package/dist/governmentValidation/governmentValidation.es.js +9 -8
- package/dist/id/id.es.js +4 -3
- package/dist/processing-Dnu3slQ9.js +18 -0
- package/dist/selfie/selfie.es.js +3 -3
- package/dist/spinner-C-EwvA9l.js +46 -0
- package/dist/{tutorial-DOCCLz7v.js → tutorial-BXPpH_2c.js} +11 -10
- package/dist/types/geolocation.d.ts +32 -0
- package/dist/useTranslation-CD9ZxEvP.js +22 -0
- package/package.json +9 -2
- package/dist/processing-us1m6bZt.js +0 -17
- package/dist/spinner-BERSXem_.js +0 -65
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,60 +1,62 @@
|
|
|
1
1
|
import { u as l, B as _, r as $, a as H } from "../incodeModule-DPTWfWvu.js";
|
|
2
|
-
import { createOrchestratedFlowManager as V, getRequiredWasmPipelines as
|
|
3
|
-
import { A as
|
|
4
|
-
import { api as
|
|
2
|
+
import { createOrchestratedFlowManager as V, getRequiredWasmPipelines as D } from "@incodetech/core/flow";
|
|
3
|
+
import { A as y, d as L, y as g } from "../vendor-preact-CjD4WiuC.js";
|
|
4
|
+
import { api as R, warmupWasm as z } from "@incodetech/core";
|
|
5
5
|
import "../instance-B-q0ZREN.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { u as G } from "../useTranslation-CD9ZxEvP.js";
|
|
7
|
+
import { S as C } from "../spinner-C-EwvA9l.js";
|
|
8
|
+
import { emailMachine as k } from "@incodetech/core/email";
|
|
9
|
+
import { faceMatchMachine as W } from "@incodetech/core/face-match";
|
|
10
|
+
import { geolocationMachine as j } from "@incodetech/core/geolocation";
|
|
9
11
|
import { idCaptureMachine as b } from "@incodetech/core/id";
|
|
10
|
-
import { phoneMachine as
|
|
11
|
-
import { selfieMachine as
|
|
12
|
-
import { authenticationMachine as
|
|
13
|
-
import { curpValidationMachine as
|
|
14
|
-
import { governmentValidationMachine as
|
|
15
|
-
import { s as
|
|
16
|
-
import { s as
|
|
17
|
-
function
|
|
12
|
+
import { phoneMachine as B } from "@incodetech/core/phone";
|
|
13
|
+
import { selfieMachine as K } from "@incodetech/core/selfie";
|
|
14
|
+
import { authenticationMachine as q } from "@incodetech/core/authentication";
|
|
15
|
+
import { curpValidationMachine as Y } from "@incodetech/core/curp-validation";
|
|
16
|
+
import { governmentValidationMachine as Z } from "@incodetech/core/government-validation";
|
|
17
|
+
import { s as J } from "../setup-BhetRn4n.js";
|
|
18
|
+
import { s as T } from "../uiConfig-DEqynrWx.js";
|
|
19
|
+
function Q(e) {
|
|
18
20
|
let t = e.replace("#", "");
|
|
19
21
|
t.length === 3 && (t = t.split("").map((s) => s + s).join(""));
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
22
|
-
const a = Number.parseInt(
|
|
22
|
+
const r = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
23
|
+
if (!r) return null;
|
|
24
|
+
const a = Number.parseInt(r[1], 16) / 255, u = Number.parseInt(r[2], 16) / 255, n = Number.parseInt(r[3], 16) / 255, o = Math.max(a, u, n), f = Math.min(a, u, n);
|
|
23
25
|
let i = 0, h = 0;
|
|
24
|
-
const
|
|
26
|
+
const d = (o + f) / 2;
|
|
25
27
|
if (o !== f) {
|
|
26
28
|
const s = o - f;
|
|
27
|
-
switch (h =
|
|
29
|
+
switch (h = d > 0.5 ? s / (2 - o - f) : s / (o + f), o) {
|
|
28
30
|
case a:
|
|
29
|
-
i = ((
|
|
31
|
+
i = ((u - n) / s + (u < n ? 6 : 0)) / 6;
|
|
30
32
|
break;
|
|
31
|
-
case
|
|
32
|
-
i = ((
|
|
33
|
+
case u:
|
|
34
|
+
i = ((n - a) / s + 2) / 6;
|
|
33
35
|
break;
|
|
34
|
-
case
|
|
35
|
-
i = ((a -
|
|
36
|
+
case n:
|
|
37
|
+
i = ((a - u) / s + 4) / 6;
|
|
36
38
|
break;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
return { h: i * 360, s: h * 100, l:
|
|
41
|
+
return { h: i * 360, s: h * 100, l: d * 100 };
|
|
40
42
|
}
|
|
41
|
-
function w(e, t,
|
|
42
|
-
const a = e / 360,
|
|
43
|
+
function w(e, t, r) {
|
|
44
|
+
const a = e / 360, u = t / 100, n = r / 100;
|
|
43
45
|
let o, f, i;
|
|
44
|
-
if (
|
|
45
|
-
o = f = i =
|
|
46
|
+
if (u === 0)
|
|
47
|
+
o = f = i = n;
|
|
46
48
|
else {
|
|
47
|
-
const
|
|
48
|
-
o =
|
|
49
|
+
const d = (p, M, m) => (m < 0 && (m += 1), m > 1 && (m -= 1), m < 0.16666666666666666 ? p + (M - p) * 6 * m : m < 0.5 ? M : m < 0.6666666666666666 ? p + (M - p) * (0.6666666666666666 - m) * 6 : p), s = n < 0.5 ? n * (1 + u) : n + u - n * u, c = 2 * n - s;
|
|
50
|
+
o = d(c, s, a + 1 / 3), f = d(c, s, a), i = d(c, s, a - 1 / 3);
|
|
49
51
|
}
|
|
50
|
-
const h = (
|
|
51
|
-
const s = Math.round(
|
|
52
|
+
const h = (d) => {
|
|
53
|
+
const s = Math.round(d * 255).toString(16);
|
|
52
54
|
return s.length === 1 ? `0${s}` : s;
|
|
53
55
|
};
|
|
54
56
|
return `#${h(o)}${h(f)}${h(i)}`;
|
|
55
57
|
}
|
|
56
|
-
function
|
|
57
|
-
const t =
|
|
58
|
+
function X(e) {
|
|
59
|
+
const t = Q(e);
|
|
58
60
|
if (!t)
|
|
59
61
|
throw new Error(`Invalid color format: ${e}`);
|
|
60
62
|
return {
|
|
@@ -67,68 +69,68 @@ function Q(e) {
|
|
|
67
69
|
900: w(t.h, t.s, 20)
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
|
-
function
|
|
72
|
+
function ee(e, t) {
|
|
71
73
|
if (typeof document > "u")
|
|
72
74
|
return;
|
|
73
|
-
const
|
|
75
|
+
const r = X(e);
|
|
74
76
|
let a = document.getElementById(
|
|
75
77
|
"incode-theme"
|
|
76
78
|
);
|
|
77
79
|
a || (a = document.createElement("style"), a.id = "incode-theme", document.head.appendChild(a));
|
|
78
|
-
const
|
|
80
|
+
const u = t || "#ffffff", n = `
|
|
79
81
|
:root,
|
|
80
82
|
:host {
|
|
81
|
-
--primitive-color-brand-50: ${
|
|
82
|
-
--primitive-color-brand-200: ${
|
|
83
|
-
--primitive-color-brand-300: ${
|
|
84
|
-
--primitive-color-brand-400: ${
|
|
85
|
-
--primitive-color-brand-500: ${
|
|
86
|
-
--primitive-color-brand-600: ${
|
|
87
|
-
--primitive-color-brand-900: ${
|
|
88
|
-
--button-primary-text-default: ${
|
|
83
|
+
--primitive-color-brand-50: ${r[50]};
|
|
84
|
+
--primitive-color-brand-200: ${r[200]};
|
|
85
|
+
--primitive-color-brand-300: ${r[300]};
|
|
86
|
+
--primitive-color-brand-400: ${r[400]};
|
|
87
|
+
--primitive-color-brand-500: ${r[500]};
|
|
88
|
+
--primitive-color-brand-600: ${r[600]};
|
|
89
|
+
--primitive-color-brand-900: ${r[900]};
|
|
90
|
+
--button-primary-text-default: ${u};
|
|
89
91
|
}
|
|
90
92
|
`;
|
|
91
|
-
a.textContent =
|
|
93
|
+
a.textContent = n;
|
|
92
94
|
}
|
|
93
|
-
async function
|
|
94
|
-
return (await
|
|
95
|
+
async function te() {
|
|
96
|
+
return (await R.get("/omni/asset/fetch-all")).data;
|
|
95
97
|
}
|
|
96
98
|
const A = /* @__PURE__ */ new Map();
|
|
97
|
-
async function
|
|
99
|
+
async function ne(e) {
|
|
98
100
|
if (e.startsWith("data:"))
|
|
99
101
|
return e;
|
|
100
102
|
const t = A.get(e);
|
|
101
103
|
if (t)
|
|
102
104
|
return t;
|
|
103
|
-
const a = await (await fetch(e)).blob(),
|
|
105
|
+
const a = await (await fetch(e)).blob(), u = await new Promise((n, o) => {
|
|
104
106
|
const f = new FileReader();
|
|
105
|
-
f.onloadend = () =>
|
|
107
|
+
f.onloadend = () => n(f.result), f.onerror = o, f.readAsDataURL(a);
|
|
106
108
|
});
|
|
107
|
-
return A.set(e,
|
|
109
|
+
return A.set(e, u), u;
|
|
108
110
|
}
|
|
109
111
|
async function re() {
|
|
110
|
-
const e = await
|
|
112
|
+
const e = await te();
|
|
111
113
|
if (!e.theme)
|
|
112
114
|
throw new Error("Theme URL not found in assets response");
|
|
113
|
-
const t = e.theme,
|
|
115
|
+
const t = e.theme, r = t.startsWith("http://") || t.startsWith("https://");
|
|
114
116
|
let a;
|
|
115
|
-
if (
|
|
117
|
+
if (r) {
|
|
116
118
|
const o = await fetch(t);
|
|
117
119
|
if (!o.ok)
|
|
118
120
|
throw new Error(`Failed to fetch theme: ${o.statusText}`);
|
|
119
121
|
a = await o.json();
|
|
120
122
|
} else
|
|
121
|
-
a = (await
|
|
122
|
-
const
|
|
123
|
-
let
|
|
124
|
-
return
|
|
123
|
+
a = (await R.get(t)).data;
|
|
124
|
+
const u = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || a.logo;
|
|
125
|
+
let n = u;
|
|
126
|
+
return u && (n = await ne(u)), {
|
|
125
127
|
...a,
|
|
126
|
-
logo:
|
|
128
|
+
logo: n
|
|
127
129
|
};
|
|
128
130
|
}
|
|
129
|
-
async function
|
|
131
|
+
async function oe() {
|
|
130
132
|
const e = await re();
|
|
131
|
-
return e.main &&
|
|
133
|
+
return e.main && ee(e.main, e.buttonColor), e;
|
|
132
134
|
}
|
|
133
135
|
const v = () => import("../id/id.es.js").then((e) => e.Id), S = {
|
|
134
136
|
PHONE: () => import("../phone/phone.es.js").then((e) => e.Phone),
|
|
@@ -139,31 +141,33 @@ const v = () => import("../id/id.es.js").then((e) => e.Id), S = {
|
|
|
139
141
|
TUTORIAL_ID: v,
|
|
140
142
|
SECOND_ID: v,
|
|
141
143
|
THIRD_ID: v,
|
|
142
|
-
FACE_MATCH: () => import("../faceMatch-
|
|
144
|
+
FACE_MATCH: () => import("../faceMatch-iEplxPox.js").then((e) => e.FaceMatch),
|
|
143
145
|
CURP_VALIDATION: () => import("../curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
|
|
144
146
|
GOVT_VALIDATION_PROVISIONING: () => import("../governmentValidation/governmentValidation.es.js").then(
|
|
145
147
|
(e) => e.GovernmentValidation
|
|
146
|
-
)
|
|
148
|
+
),
|
|
149
|
+
GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation)
|
|
147
150
|
};
|
|
148
|
-
function
|
|
151
|
+
function U() {
|
|
149
152
|
return V({
|
|
150
153
|
modules: {
|
|
151
|
-
PHONE:
|
|
152
|
-
EMAIL:
|
|
153
|
-
SELFIE:
|
|
154
|
-
AUTHENTICATION:
|
|
154
|
+
PHONE: B,
|
|
155
|
+
EMAIL: k,
|
|
156
|
+
SELFIE: K,
|
|
157
|
+
AUTHENTICATION: q,
|
|
155
158
|
ID: b,
|
|
156
159
|
TUTORIAL_ID: b,
|
|
157
160
|
SECOND_ID: b,
|
|
158
161
|
THIRD_ID: b,
|
|
159
|
-
FACE_MATCH:
|
|
160
|
-
CURP_VALIDATION:
|
|
161
|
-
GOVT_VALIDATION_PROVISIONING:
|
|
162
|
+
FACE_MATCH: W,
|
|
163
|
+
CURP_VALIDATION: Y,
|
|
164
|
+
GOVT_VALIDATION_PROVISIONING: Z,
|
|
165
|
+
GEOLOCATION: j
|
|
162
166
|
}
|
|
163
167
|
});
|
|
164
168
|
}
|
|
165
169
|
async function N(e) {
|
|
166
|
-
await
|
|
170
|
+
await J({
|
|
167
171
|
apiURL: e.apiURL,
|
|
168
172
|
token: e.token,
|
|
169
173
|
i18n: { lang: e.lang ?? "en" }
|
|
@@ -171,33 +175,33 @@ async function N(e) {
|
|
|
171
175
|
}
|
|
172
176
|
async function P() {
|
|
173
177
|
try {
|
|
174
|
-
const e = await
|
|
178
|
+
const e = await oe(), t = {
|
|
175
179
|
logoSrc: e.logo,
|
|
176
180
|
hideFooterBranding: e.hideFooterBranding
|
|
177
181
|
};
|
|
178
|
-
return
|
|
182
|
+
return T(t), { theme: e, uiConfig: t };
|
|
179
183
|
} catch (e) {
|
|
180
184
|
return console.warn("Failed to fetch dashboard theme:", e), {};
|
|
181
185
|
}
|
|
182
186
|
}
|
|
183
187
|
function x(e, t) {
|
|
184
|
-
const
|
|
185
|
-
|
|
188
|
+
const r = D(e.flow);
|
|
189
|
+
r.length > 0 && z({
|
|
186
190
|
...t,
|
|
187
|
-
pipelines:
|
|
191
|
+
pipelines: r
|
|
188
192
|
}).catch((a) => {
|
|
189
193
|
console.error("WASM warmup failed:", a);
|
|
190
194
|
});
|
|
191
195
|
}
|
|
192
|
-
function
|
|
196
|
+
function ie(e) {
|
|
193
197
|
const t = e.currentStep;
|
|
194
198
|
if (t) {
|
|
195
|
-
const
|
|
196
|
-
|
|
199
|
+
const r = S[t];
|
|
200
|
+
r && r().catch(() => {
|
|
197
201
|
});
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
|
-
const
|
|
204
|
+
const ae = ({
|
|
201
205
|
moduleKey: e,
|
|
202
206
|
onNext: t
|
|
203
207
|
}) => /* @__PURE__ */ l("section", { class: "IncodeUnsupportedModule", "aria-live": "polite", children: /* @__PURE__ */ l("div", { class: "IncodeUnsupportedModuleContent", children: [
|
|
@@ -240,19 +244,19 @@ function E(e) {
|
|
|
240
244
|
}
|
|
241
245
|
};
|
|
242
246
|
}
|
|
243
|
-
function
|
|
247
|
+
function De(e) {
|
|
244
248
|
const { token: t } = e;
|
|
245
249
|
if (I.has(t))
|
|
246
250
|
return E(t);
|
|
247
|
-
let
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
}),
|
|
251
|
+
let r, a;
|
|
252
|
+
const u = new Promise((i, h) => {
|
|
253
|
+
r = i, a = h;
|
|
254
|
+
}), n = U(), o = {
|
|
251
255
|
status: "loading",
|
|
252
|
-
flowManager:
|
|
256
|
+
flowManager: n,
|
|
253
257
|
config: e,
|
|
254
|
-
readyPromise:
|
|
255
|
-
readyResolve:
|
|
258
|
+
readyPromise: u,
|
|
259
|
+
readyResolve: r,
|
|
256
260
|
readyReject: a
|
|
257
261
|
};
|
|
258
262
|
return I.set(t, o), (async () => {
|
|
@@ -262,15 +266,15 @@ function Ae(e) {
|
|
|
262
266
|
token: e.token,
|
|
263
267
|
lang: e.lang
|
|
264
268
|
});
|
|
265
|
-
const i = e.disableDashboardTheme ? Promise.resolve({}) : P().then((
|
|
266
|
-
o.theme =
|
|
267
|
-
}), h =
|
|
268
|
-
if (
|
|
269
|
-
const s =
|
|
270
|
-
e.wasmConfig && x(s, e.wasmConfig),
|
|
271
|
-
} else
|
|
269
|
+
const i = e.disableDashboardTheme ? Promise.resolve({}) : P().then((d) => {
|
|
270
|
+
o.theme = d.theme, o.uiConfig = d.uiConfig;
|
|
271
|
+
}), h = n.subscribe((d) => {
|
|
272
|
+
if (d.status === "ready") {
|
|
273
|
+
const s = d;
|
|
274
|
+
e.wasmConfig && x(s, e.wasmConfig), ie(s), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
275
|
+
} else d.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = d.error, o.readyReject(new Error(d.error)));
|
|
272
276
|
});
|
|
273
|
-
o.unsubscribe = h,
|
|
277
|
+
o.unsubscribe = h, n.load(), await i;
|
|
274
278
|
} catch (i) {
|
|
275
279
|
o.status = "error", o.error = i instanceof Error ? i.message : "Failed to preload", o.readyReject(
|
|
276
280
|
i instanceof Error ? i : new Error("Failed to preload")
|
|
@@ -281,40 +285,40 @@ function Ae(e) {
|
|
|
281
285
|
function F(e) {
|
|
282
286
|
return I.get(e) ?? null;
|
|
283
287
|
}
|
|
284
|
-
function
|
|
288
|
+
function O(e) {
|
|
285
289
|
const t = F(e);
|
|
286
290
|
return t && I.delete(e), t;
|
|
287
291
|
}
|
|
288
|
-
function
|
|
289
|
-
const { apiURL: t, token:
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
const c =
|
|
292
|
+
function se(e) {
|
|
293
|
+
const { apiURL: t, token: r, lang: a, disableDashboardTheme: u, onError: n } = e, o = y(null), [f, i] = L(() => {
|
|
294
|
+
const d = F(r);
|
|
295
|
+
if (d?.status === "ready") {
|
|
296
|
+
const c = O(r);
|
|
293
297
|
if (c)
|
|
294
|
-
return o.current = c.flowManager, c.uiConfig &&
|
|
298
|
+
return o.current = c.flowManager, c.uiConfig && T(c.uiConfig), { status: "ready", flowManager: c.flowManager };
|
|
295
299
|
}
|
|
296
|
-
const s =
|
|
297
|
-
return o.current = s,
|
|
300
|
+
const s = U();
|
|
301
|
+
return o.current = s, d?.status === "error" ? {
|
|
298
302
|
status: "error",
|
|
299
|
-
error:
|
|
303
|
+
error: d.error ?? "Preload failed",
|
|
300
304
|
flowManager: s
|
|
301
305
|
} : { status: "initializing", flowManager: s };
|
|
302
|
-
}), h =
|
|
306
|
+
}), h = y(!1);
|
|
303
307
|
return g(() => {
|
|
304
308
|
if (f.status !== "initializing")
|
|
305
309
|
return;
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
|
|
309
|
-
const c =
|
|
310
|
-
c && (o.current = c.flowManager, c.uiConfig &&
|
|
310
|
+
const d = F(r);
|
|
311
|
+
if (d?.status === "loading") {
|
|
312
|
+
d.readyPromise.then(() => {
|
|
313
|
+
const c = O(r);
|
|
314
|
+
c && (o.current = c.flowManager, c.uiConfig && T(c.uiConfig), i({ status: "ready", flowManager: c.flowManager }));
|
|
311
315
|
}).catch((c) => {
|
|
312
316
|
const p = c instanceof Error ? c.message : "Preload failed";
|
|
313
317
|
i({
|
|
314
318
|
status: "error",
|
|
315
319
|
error: p,
|
|
316
320
|
flowManager: f.flowManager
|
|
317
|
-
}),
|
|
321
|
+
}), n?.(p);
|
|
318
322
|
});
|
|
319
323
|
return;
|
|
320
324
|
}
|
|
@@ -322,9 +326,9 @@ function ae(e) {
|
|
|
322
326
|
return;
|
|
323
327
|
h.current = !0, (async () => {
|
|
324
328
|
try {
|
|
325
|
-
await N({ apiURL: t, token:
|
|
326
|
-
const c =
|
|
327
|
-
p.uiConfig &&
|
|
329
|
+
await N({ apiURL: t, token: r, lang: a });
|
|
330
|
+
const c = u ? Promise.resolve() : P().then((p) => {
|
|
331
|
+
p.uiConfig && T(p.uiConfig);
|
|
328
332
|
});
|
|
329
333
|
f.flowManager.load(), await c, i({ status: "ready", flowManager: f.flowManager });
|
|
330
334
|
} catch (c) {
|
|
@@ -333,13 +337,13 @@ function ae(e) {
|
|
|
333
337
|
status: "error",
|
|
334
338
|
error: p,
|
|
335
339
|
flowManager: f.flowManager
|
|
336
|
-
}),
|
|
340
|
+
}), n?.(p);
|
|
337
341
|
}
|
|
338
342
|
})();
|
|
339
|
-
}, [t,
|
|
343
|
+
}, [t, r, a, u, n, f]), f;
|
|
340
344
|
}
|
|
341
|
-
function
|
|
342
|
-
const { moduleKey: t, onModuleLoading:
|
|
345
|
+
function le(e) {
|
|
346
|
+
const { moduleKey: t, onModuleLoading: r, onModuleLoaded: a, onError: u } = e, [n, o] = L({ status: "idle" });
|
|
343
347
|
return g(() => {
|
|
344
348
|
if (!t) {
|
|
345
349
|
o({ status: "idle" });
|
|
@@ -350,74 +354,74 @@ function se(e) {
|
|
|
350
354
|
o({ status: "unsupported", moduleKey: t });
|
|
351
355
|
return;
|
|
352
356
|
}
|
|
353
|
-
o({ status: "loading", moduleKey: t }),
|
|
357
|
+
o({ status: "loading", moduleKey: t }), r?.(t);
|
|
354
358
|
let i = !1;
|
|
355
359
|
return f().then((h) => {
|
|
356
360
|
i || (o({ status: "loaded", moduleKey: t, Component: h }), a?.(t));
|
|
357
361
|
}).catch((h) => {
|
|
358
362
|
if (!i) {
|
|
359
|
-
const
|
|
360
|
-
o({ status: "error", moduleKey: t, error:
|
|
363
|
+
const d = h instanceof Error ? h.message : "Failed to load module";
|
|
364
|
+
o({ status: "error", moduleKey: t, error: d }), u?.(`Failed to load ${t}: ${d}`);
|
|
361
365
|
}
|
|
362
366
|
}), () => {
|
|
363
367
|
i = !0;
|
|
364
368
|
};
|
|
365
|
-
}, [t,
|
|
369
|
+
}, [t, r, a, u]), n;
|
|
366
370
|
}
|
|
367
|
-
function
|
|
368
|
-
const
|
|
371
|
+
function ce(e, t) {
|
|
372
|
+
const r = y(/* @__PURE__ */ new Set());
|
|
369
373
|
g(() => {
|
|
370
374
|
if (t < e.length - 1) {
|
|
371
375
|
const a = e[t + 1];
|
|
372
|
-
if (a && !
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
376
|
+
if (a && !r.current.has(a)) {
|
|
377
|
+
r.current.add(a);
|
|
378
|
+
const u = S[a];
|
|
379
|
+
u && u().catch(() => {
|
|
380
|
+
r.current.delete(a);
|
|
377
381
|
});
|
|
378
382
|
}
|
|
379
383
|
}
|
|
380
384
|
}, [e, t]);
|
|
381
385
|
}
|
|
382
|
-
const
|
|
386
|
+
const de = ({
|
|
383
387
|
config: e,
|
|
384
388
|
onFinish: t,
|
|
385
|
-
onError:
|
|
389
|
+
onError: r
|
|
386
390
|
}) => {
|
|
387
|
-
const { t: a } =
|
|
391
|
+
const { t: a } = G(), u = se({
|
|
388
392
|
apiURL: e.apiURL,
|
|
389
393
|
token: e.token,
|
|
390
394
|
lang: e.lang,
|
|
391
395
|
disableDashboardTheme: e.disableDashboardTheme,
|
|
392
|
-
onError:
|
|
393
|
-
}), [
|
|
396
|
+
onError: r
|
|
397
|
+
}), [n, o] = H(() => u.flowManager, {
|
|
394
398
|
autoLoad: !1
|
|
395
|
-
}), f =
|
|
396
|
-
moduleKey:
|
|
399
|
+
}), f = le({
|
|
400
|
+
moduleKey: n?.status === "ready" ? n.currentStep : void 0,
|
|
397
401
|
onModuleLoading: e.onModuleLoading,
|
|
398
402
|
onModuleLoaded: e.onModuleLoaded,
|
|
399
|
-
onError:
|
|
403
|
+
onError: r
|
|
400
404
|
});
|
|
401
|
-
if (
|
|
402
|
-
|
|
403
|
-
|
|
405
|
+
if (ce(
|
|
406
|
+
n?.status === "ready" ? n.steps : [],
|
|
407
|
+
n?.status === "ready" ? n.currentStepIndex : -1
|
|
404
408
|
), g(() => {
|
|
405
|
-
if (
|
|
406
|
-
const i =
|
|
409
|
+
if (n?.status === "ready" && e.wasmConfig) {
|
|
410
|
+
const i = n, h = D(i.flow);
|
|
407
411
|
h.length > 0 && (e.onWasmWarmup?.(h), x(i, e.wasmConfig));
|
|
408
412
|
}
|
|
409
|
-
}, [
|
|
410
|
-
|
|
411
|
-
}, [
|
|
412
|
-
|
|
413
|
-
}, [
|
|
414
|
-
|
|
415
|
-
}, [
|
|
413
|
+
}, [n, e]), g(() => {
|
|
414
|
+
n?.status === "finished" && t(n.finishStatus);
|
|
415
|
+
}, [n?.status, t, n]), g(() => {
|
|
416
|
+
n?.status === "error" && r && r(n.error);
|
|
417
|
+
}, [n?.status, r, n]), g(() => {
|
|
418
|
+
n?.status === "ready" && n.currentStep === "ID" && n.steps.includes("TUTORIAL_ID") && o.completeModule();
|
|
419
|
+
}, [n, o]), u.status === "error")
|
|
416
420
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: [
|
|
417
421
|
"Error: ",
|
|
418
|
-
|
|
422
|
+
u.error
|
|
419
423
|
] }) });
|
|
420
|
-
if (
|
|
424
|
+
if (u.status === "initializing")
|
|
421
425
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
422
426
|
C,
|
|
423
427
|
{
|
|
@@ -427,7 +431,7 @@ const ce = ({
|
|
|
427
431
|
fullScreen: !0
|
|
428
432
|
}
|
|
429
433
|
) });
|
|
430
|
-
if (!
|
|
434
|
+
if (!n || n.status === "idle" || n.status === "loading")
|
|
431
435
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
432
436
|
C,
|
|
433
437
|
{
|
|
@@ -437,15 +441,15 @@ const ce = ({
|
|
|
437
441
|
fullScreen: !0
|
|
438
442
|
}
|
|
439
443
|
) });
|
|
440
|
-
if (
|
|
444
|
+
if (n.status === "error")
|
|
441
445
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: [
|
|
442
446
|
"Error: ",
|
|
443
|
-
|
|
447
|
+
n.error
|
|
444
448
|
] }) });
|
|
445
|
-
if (
|
|
449
|
+
if (n.status === "finished")
|
|
446
450
|
return null;
|
|
447
|
-
if (
|
|
448
|
-
const { currentStep: i, config: h } =
|
|
451
|
+
if (n.status === "ready") {
|
|
452
|
+
const { currentStep: i, config: h } = n;
|
|
449
453
|
if (!i || !h)
|
|
450
454
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
451
455
|
C,
|
|
@@ -458,7 +462,7 @@ const ce = ({
|
|
|
458
462
|
) });
|
|
459
463
|
if (f.status === "unsupported")
|
|
460
464
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
461
|
-
|
|
465
|
+
ae,
|
|
462
466
|
{
|
|
463
467
|
moduleKey: i,
|
|
464
468
|
onNext: () => o.completeModule()
|
|
@@ -474,49 +478,49 @@ const ce = ({
|
|
|
474
478
|
fullScreen: !0
|
|
475
479
|
}
|
|
476
480
|
) });
|
|
477
|
-
const { Component:
|
|
481
|
+
const { Component: d } = f;
|
|
478
482
|
if (i === "SELFIE")
|
|
479
483
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
480
|
-
|
|
484
|
+
d,
|
|
481
485
|
{
|
|
482
486
|
config: h,
|
|
483
487
|
onFinish: () => o.completeModule(),
|
|
484
488
|
onError: (c) => {
|
|
485
|
-
|
|
489
|
+
r?.(c ?? "Selfie verification error");
|
|
486
490
|
}
|
|
487
491
|
},
|
|
488
|
-
`selfie-${
|
|
492
|
+
`selfie-${n.currentStepIndex}`
|
|
489
493
|
) });
|
|
490
494
|
if (i === "AUTHENTICATION") {
|
|
491
495
|
const s = h;
|
|
492
496
|
return e.authHint ? /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
493
|
-
|
|
497
|
+
d,
|
|
494
498
|
{
|
|
495
499
|
config: { ...s, authHint: e.authHint },
|
|
496
500
|
onFinish: () => o.completeModule(),
|
|
497
501
|
onError: (c) => {
|
|
498
|
-
|
|
502
|
+
r?.(c ?? "Authentication error");
|
|
499
503
|
}
|
|
500
504
|
},
|
|
501
|
-
`authentication-${
|
|
502
|
-
) }) : (
|
|
505
|
+
`authentication-${n.currentStepIndex}`
|
|
506
|
+
) }) : (r?.("Authentication requires authHint to be provided"), /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: "Error: authHint is required for authentication" }) }));
|
|
503
507
|
}
|
|
504
508
|
if (i === "PHONE")
|
|
505
509
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
506
|
-
|
|
510
|
+
d,
|
|
507
511
|
{
|
|
508
512
|
config: h,
|
|
509
513
|
onFinish: () => o.completeModule(),
|
|
510
514
|
onError: (c) => {
|
|
511
|
-
|
|
515
|
+
r?.(c ?? "Phone verification error");
|
|
512
516
|
}
|
|
513
517
|
},
|
|
514
|
-
`phone-${
|
|
518
|
+
`phone-${n.currentStepIndex}`
|
|
515
519
|
) });
|
|
516
520
|
if (i === "EMAIL") {
|
|
517
521
|
const s = h;
|
|
518
522
|
return !s || typeof s.otpVerification != "boolean" || typeof s.otpExpirationInMinutes != "number" ? /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l("div", { children: "Error: Invalid email configuration" }) }) : /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
519
|
-
|
|
523
|
+
d,
|
|
520
524
|
{
|
|
521
525
|
config: {
|
|
522
526
|
...s,
|
|
@@ -524,25 +528,25 @@ const ce = ({
|
|
|
524
528
|
},
|
|
525
529
|
onFinish: () => o.completeModule(),
|
|
526
530
|
onError: (c) => {
|
|
527
|
-
|
|
531
|
+
r?.(c ?? "Email verification error");
|
|
528
532
|
}
|
|
529
533
|
},
|
|
530
|
-
`email-${
|
|
534
|
+
`email-${n.currentStepIndex}`
|
|
531
535
|
) });
|
|
532
536
|
}
|
|
533
537
|
if (i === "TUTORIAL_ID" || i === "SECOND_ID" || i === "THIRD_ID" || // Only render ID if TUTORIAL_ID doesn't exist (otherwise useEffect will skip it)
|
|
534
|
-
i === "ID" && !
|
|
538
|
+
i === "ID" && !n.steps.includes("TUTORIAL_ID")) {
|
|
535
539
|
const s = h, p = i === "SECOND_ID" || i === "THIRD_ID" ? { ...s, isSecondId: !0 } : s;
|
|
536
540
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
537
|
-
|
|
541
|
+
d,
|
|
538
542
|
{
|
|
539
543
|
config: p,
|
|
540
544
|
onFinish: () => o.completeModule(),
|
|
541
545
|
onError: (M) => {
|
|
542
|
-
|
|
546
|
+
r?.(M ?? "ID capture error");
|
|
543
547
|
}
|
|
544
548
|
},
|
|
545
|
-
`id-${
|
|
549
|
+
`id-${n.currentStepIndex}`
|
|
546
550
|
) });
|
|
547
551
|
}
|
|
548
552
|
if (i === "FACE_MATCH") {
|
|
@@ -551,58 +555,70 @@ const ce = ({
|
|
|
551
555
|
disableFaceMatchAnimation: s.disableFaceMatchAnimation ?? !1
|
|
552
556
|
};
|
|
553
557
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
554
|
-
|
|
558
|
+
d,
|
|
555
559
|
{
|
|
556
560
|
config: c,
|
|
557
561
|
onFinish: () => o.completeModule(),
|
|
558
562
|
onError: (p) => {
|
|
559
|
-
|
|
563
|
+
r?.(p ?? "Face match error");
|
|
560
564
|
}
|
|
561
565
|
},
|
|
562
|
-
`face-match-${
|
|
566
|
+
`face-match-${n.currentStepIndex}`
|
|
563
567
|
) });
|
|
564
568
|
}
|
|
565
569
|
if (i === "CURP_VALIDATION")
|
|
566
570
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
567
|
-
|
|
571
|
+
d,
|
|
568
572
|
{
|
|
569
573
|
config: h,
|
|
570
574
|
onFinish: () => o.completeModule(),
|
|
571
575
|
onError: (c) => {
|
|
572
|
-
|
|
576
|
+
r?.(c ?? "CURP validation error");
|
|
573
577
|
}
|
|
574
578
|
},
|
|
575
|
-
`curp-validation-${
|
|
579
|
+
`curp-validation-${n.currentStepIndex}`
|
|
576
580
|
) });
|
|
577
581
|
if (i === "GOVT_VALIDATION_PROVISIONING")
|
|
578
582
|
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
579
|
-
|
|
583
|
+
d,
|
|
580
584
|
{
|
|
581
585
|
config: h,
|
|
582
586
|
onFinish: () => o.completeModule(),
|
|
583
587
|
onError: (c) => {
|
|
584
|
-
|
|
588
|
+
r?.(c ?? "Government validation error");
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
`govt-validation-${n.currentStepIndex}`
|
|
592
|
+
) });
|
|
593
|
+
if (i === "GEOLOCATION")
|
|
594
|
+
return /* @__PURE__ */ l("div", { class: "IncodeFlow", children: /* @__PURE__ */ l(
|
|
595
|
+
d,
|
|
596
|
+
{
|
|
597
|
+
config: { allowSkip: h.allowUserToSkipGeolocation },
|
|
598
|
+
onFinish: () => o.completeModule(),
|
|
599
|
+
onError: (c) => {
|
|
600
|
+
r?.(c ?? "Geolocation error");
|
|
585
601
|
}
|
|
586
602
|
},
|
|
587
|
-
`
|
|
603
|
+
`geolocation-${n.currentStepIndex}`
|
|
588
604
|
) });
|
|
589
605
|
}
|
|
590
606
|
return null;
|
|
591
|
-
},
|
|
607
|
+
}, ue = ({
|
|
592
608
|
config: e,
|
|
593
609
|
onFinish: t = () => {
|
|
594
610
|
},
|
|
595
|
-
onError:
|
|
611
|
+
onError: r
|
|
596
612
|
}) => /* @__PURE__ */ l("div", { class: "IncodeComponent", children: e ? /* @__PURE__ */ l(
|
|
597
|
-
|
|
613
|
+
de,
|
|
598
614
|
{
|
|
599
615
|
config: e,
|
|
600
616
|
onFinish: t,
|
|
601
|
-
onError:
|
|
617
|
+
onError: r
|
|
602
618
|
}
|
|
603
619
|
) : null });
|
|
604
|
-
$(
|
|
620
|
+
$(ue, "incode-flow");
|
|
605
621
|
export {
|
|
606
|
-
|
|
607
|
-
|
|
622
|
+
ue as IncodeFlow,
|
|
623
|
+
De as preloadIncodeFlow
|
|
608
624
|
};
|