@incodetech/web 0.0.0-dev-20260416-3692bda → 0.0.0-dev-20260417-78468b3
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/flow/flow.es.js
CHANGED
|
@@ -5,12 +5,12 @@ import { o as c, t as l } from "../incodeComponent-DIb7wDAq.js";
|
|
|
5
5
|
import { t as u } from "../spinner-l6dvYqCg.js";
|
|
6
6
|
import "../spinner-CFvndzMU.js";
|
|
7
7
|
import { t as d } from "../incodeModule-D_r2n18O.js";
|
|
8
|
-
import { a as f, c as p,
|
|
9
|
-
import { getRequiredWasmPipelines as
|
|
8
|
+
import { a as f, c as p, f as m, i as h, l as g, n as _, o as v, r as y, s as b, t as x, u as S } from "../useModuleLoader-B6JxxJWR.js";
|
|
9
|
+
import { getRequiredWasmPipelines as C } from "@incodetech/core/flow";
|
|
10
10
|
//#region src/modules/flow/preloadFlow.ts
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
let t =
|
|
11
|
+
var w = /* @__PURE__ */ new Map();
|
|
12
|
+
function T(e) {
|
|
13
|
+
let t = w.get(e);
|
|
14
14
|
if (!t) throw Error("Preload state not found");
|
|
15
15
|
return {
|
|
16
16
|
get isReady() {
|
|
@@ -26,17 +26,17 @@ function w(e) {
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
cancel() {
|
|
29
|
-
t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")),
|
|
29
|
+
t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")), w.delete(e));
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function E(e) {
|
|
34
34
|
let { token: t } = e;
|
|
35
|
-
if (
|
|
35
|
+
if (w.has(t)) return T(t);
|
|
36
36
|
let n, r, i = new Promise((e, t) => {
|
|
37
37
|
n = e, r = t;
|
|
38
|
-
}), a =
|
|
39
|
-
a.getState().presentation.shouldPrefetchHome &&
|
|
38
|
+
}), a = v(e);
|
|
39
|
+
a.getState().presentation.shouldPrefetchHome && S();
|
|
40
40
|
let o = {
|
|
41
41
|
status: "loading",
|
|
42
42
|
flowManager: a,
|
|
@@ -45,52 +45,52 @@ function T(e) {
|
|
|
45
45
|
readyResolve: n,
|
|
46
46
|
readyReject: r
|
|
47
47
|
};
|
|
48
|
-
return
|
|
48
|
+
return w.set(t, o), (async () => {
|
|
49
49
|
try {
|
|
50
|
-
await
|
|
50
|
+
await p({
|
|
51
51
|
apiURL: e.apiURL,
|
|
52
52
|
token: e.token,
|
|
53
53
|
lang: e.lang,
|
|
54
54
|
flowManager: a
|
|
55
55
|
});
|
|
56
|
-
let t = e.disableDashboardTheme ? Promise.resolve({}) :
|
|
56
|
+
let t = e.disableDashboardTheme ? Promise.resolve({}) : b().then((e) => {
|
|
57
57
|
o.theme = e.theme, o.uiConfig = e.uiConfig;
|
|
58
58
|
});
|
|
59
59
|
o.unsubscribe = a.subscribe((t) => {
|
|
60
60
|
if (t.status === "ready") {
|
|
61
61
|
let n = t;
|
|
62
|
-
m(n, e.wasmConfig),
|
|
62
|
+
m(n, e.wasmConfig), g(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
63
63
|
} else t.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = t.error, o.readyReject(Error(t.error)));
|
|
64
64
|
}), await t;
|
|
65
65
|
} catch (e) {
|
|
66
|
-
o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")),
|
|
66
|
+
o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")), w.delete(t);
|
|
67
67
|
}
|
|
68
|
-
})(),
|
|
69
|
-
}
|
|
70
|
-
function E(e) {
|
|
71
|
-
return C.get(e) ?? null;
|
|
68
|
+
})(), T(t);
|
|
72
69
|
}
|
|
73
70
|
function D(e) {
|
|
74
|
-
|
|
75
|
-
return t && C.delete(e), t;
|
|
71
|
+
return w.get(e) ?? null;
|
|
76
72
|
}
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region src/modules/flow/useFlowInitialization.ts
|
|
79
73
|
function O(e) {
|
|
80
|
-
|
|
74
|
+
let t = D(e);
|
|
75
|
+
return t && w.delete(e), t;
|
|
81
76
|
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/modules/flow/useFlowInitialization.ts
|
|
82
79
|
function k(e) {
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
e.getState().presentation.shouldPrefetchHome && S();
|
|
81
|
+
}
|
|
82
|
+
function A(e) {
|
|
83
|
+
let { apiURL: n, token: i, lang: o, disableDashboardTheme: c, enableHome: l, onError: u } = e, d = r(null), [f, m] = a(() => {
|
|
84
|
+
let t = D(i);
|
|
85
85
|
if (t?.status === "ready") {
|
|
86
|
-
let e =
|
|
87
|
-
if (e) return d.current = e.flowManager,
|
|
86
|
+
let e = O(i);
|
|
87
|
+
if (e) return d.current = e.flowManager, k(e.flowManager), e.uiConfig && s(e.uiConfig), {
|
|
88
88
|
status: "ready",
|
|
89
89
|
flowManager: e.flowManager
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
let n =
|
|
93
|
-
return d.current = n,
|
|
92
|
+
let n = v(e);
|
|
93
|
+
return d.current = n, k(n), t?.status === "error" ? {
|
|
94
94
|
status: "error",
|
|
95
95
|
error: t.error ?? "Preload failed",
|
|
96
96
|
flowManager: n
|
|
@@ -100,12 +100,12 @@ function k(e) {
|
|
|
100
100
|
};
|
|
101
101
|
}), h = r(!1);
|
|
102
102
|
return t(() => {
|
|
103
|
-
if (
|
|
104
|
-
let e =
|
|
103
|
+
if (f.status !== "initializing") return;
|
|
104
|
+
let e = D(i);
|
|
105
105
|
if (e?.status === "loading") {
|
|
106
106
|
e.readyPromise.then(() => {
|
|
107
|
-
let e =
|
|
108
|
-
e && (d.current = e.flowManager,
|
|
107
|
+
let e = O(i);
|
|
108
|
+
e && (d.current = e.flowManager, k(e.flowManager), e.uiConfig && s(e.uiConfig), m({
|
|
109
109
|
status: "ready",
|
|
110
110
|
flowManager: e.flowManager
|
|
111
111
|
}));
|
|
@@ -114,30 +114,30 @@ function k(e) {
|
|
|
114
114
|
m({
|
|
115
115
|
status: "error",
|
|
116
116
|
error: t,
|
|
117
|
-
flowManager:
|
|
117
|
+
flowManager: f.flowManager
|
|
118
118
|
}), u?.(t);
|
|
119
119
|
});
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
h.current || (h.current = !0, (async () => {
|
|
123
123
|
try {
|
|
124
|
-
await
|
|
124
|
+
await p({
|
|
125
125
|
apiURL: n,
|
|
126
126
|
token: i,
|
|
127
127
|
lang: o,
|
|
128
|
-
flowManager:
|
|
129
|
-
}), await (c ? Promise.resolve() :
|
|
128
|
+
flowManager: f.flowManager
|
|
129
|
+
}), await (c ? Promise.resolve() : b().then((e) => {
|
|
130
130
|
e.uiConfig && s(e.uiConfig);
|
|
131
131
|
})), m({
|
|
132
132
|
status: "ready",
|
|
133
|
-
flowManager:
|
|
133
|
+
flowManager: f.flowManager
|
|
134
134
|
});
|
|
135
135
|
} catch (e) {
|
|
136
136
|
let t = e instanceof Error ? e.message : "Failed to initialize SDK";
|
|
137
137
|
m({
|
|
138
138
|
status: "error",
|
|
139
139
|
error: t,
|
|
140
|
-
flowManager:
|
|
140
|
+
flowManager: f.flowManager
|
|
141
141
|
}), u?.(t);
|
|
142
142
|
}
|
|
143
143
|
})());
|
|
@@ -148,60 +148,65 @@ function k(e) {
|
|
|
148
148
|
c,
|
|
149
149
|
l,
|
|
150
150
|
u,
|
|
151
|
-
|
|
152
|
-
]),
|
|
151
|
+
f
|
|
152
|
+
]), f;
|
|
153
153
|
}
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/modules/flow/flow.tsx
|
|
156
|
-
var
|
|
157
|
-
let { t: s, i18n: l } = e(), d =
|
|
156
|
+
var j = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.HomeScreen }))), M = ({ config: n, onFinish: r, onError: a }) => {
|
|
157
|
+
let { t: s, i18n: l } = e(), d = A({
|
|
158
158
|
...n,
|
|
159
159
|
onError: a
|
|
160
|
-
}), [
|
|
160
|
+
}), [p, g] = c(() => d.flowManager, { autoLoad: !1 }), v = p.presentation.lazyModuleKey, b = p.status === "ready" ? p.currentStep : void 0, w = x({
|
|
161
161
|
moduleKey: v,
|
|
162
|
-
modules:
|
|
162
|
+
modules: f,
|
|
163
163
|
onModuleLoading: n.onModuleLoading,
|
|
164
164
|
onModuleLoaded: n.onModuleLoaded,
|
|
165
165
|
onError: a
|
|
166
|
-
}),
|
|
167
|
-
|
|
168
|
-
f
|
|
169
|
-
},
|
|
166
|
+
}), T = _({
|
|
167
|
+
moduleKey: p.status === "ready" && p.homeScreen.visible ? b : void 0,
|
|
168
|
+
modules: f
|
|
169
|
+
}), E = w.status === "loaded";
|
|
170
|
+
E === !1 && p.homeScreen.visible && (E = T);
|
|
171
|
+
let D = n.enableHome === !0 && p.status === "ready" && p.currentStepIndex === 0 && p.homeScreen.visible === !1 && w.status === "loading";
|
|
172
|
+
if (y(p?.status === "ready" ? p.steps : [], p?.status === "ready" ? p.currentStepIndex : -1, f, E), t(() => {
|
|
173
|
+
p.presentation.shouldPrefetchHome && S();
|
|
174
|
+
}, [p.presentation.shouldPrefetchHome]), t(() => {
|
|
170
175
|
n.lang && l.language !== n.lang && l.changeLanguage(n.lang);
|
|
171
176
|
}, [n.lang, l]), t(() => {
|
|
172
|
-
if (
|
|
173
|
-
let e =
|
|
177
|
+
if (p?.status === "ready") {
|
|
178
|
+
let e = p, t = C(e.flow);
|
|
174
179
|
t.length > 0 && (n.onWasmWarmup?.(t), m(e, n.wasmConfig));
|
|
175
180
|
}
|
|
176
|
-
}, [
|
|
177
|
-
|
|
181
|
+
}, [p, n]), t(() => {
|
|
182
|
+
p?.status === "finished" && r(p.finishStatus);
|
|
178
183
|
}, [
|
|
179
|
-
|
|
184
|
+
p?.status,
|
|
180
185
|
r,
|
|
181
|
-
|
|
186
|
+
p
|
|
182
187
|
]), t(() => {
|
|
183
|
-
|
|
188
|
+
p?.status === "error" && a && a(p.error);
|
|
184
189
|
}, [
|
|
185
|
-
|
|
190
|
+
p?.status,
|
|
186
191
|
a,
|
|
187
|
-
|
|
192
|
+
p
|
|
188
193
|
]), t(() => {
|
|
189
|
-
|
|
190
|
-
}, [
|
|
194
|
+
p?.status === "ready" && p.currentStep === "ID" && p.steps.includes("TUTORIAL_ID") && g.completeModule();
|
|
195
|
+
}, [p, g]), d.status === "error") return /* @__PURE__ */ o("div", {
|
|
191
196
|
class: "IncodeFlow",
|
|
192
197
|
children: /* @__PURE__ */ o("div", { children: ["Error: ", d.error] })
|
|
193
198
|
});
|
|
194
|
-
if (
|
|
199
|
+
if (p.homeScreen.visible || D) return /* @__PURE__ */ o("div", {
|
|
195
200
|
class: "IncodeFlow",
|
|
196
201
|
children: /* @__PURE__ */ o(i, {
|
|
197
202
|
fallback: null,
|
|
198
|
-
children: /* @__PURE__ */ o(
|
|
199
|
-
isContinueLoading:
|
|
200
|
-
onContinue: () =>
|
|
203
|
+
children: /* @__PURE__ */ o(j, {
|
|
204
|
+
isContinueLoading: p.homeScreen.isContinueLoading || D,
|
|
205
|
+
onContinue: () => g.continueFromHome()
|
|
201
206
|
})
|
|
202
207
|
})
|
|
203
208
|
});
|
|
204
|
-
if (d.status === "initializing" ||
|
|
209
|
+
if (d.status === "initializing" || p.presentation.isAwaitingReady) return /* @__PURE__ */ o("div", {
|
|
205
210
|
class: "IncodeFlow",
|
|
206
211
|
children: /* @__PURE__ */ o(u, {
|
|
207
212
|
title: n.spinnerConfig?.title,
|
|
@@ -210,13 +215,13 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
210
215
|
fullScreen: !0
|
|
211
216
|
})
|
|
212
217
|
});
|
|
213
|
-
if (
|
|
218
|
+
if (p.status === "error") return /* @__PURE__ */ o("div", {
|
|
214
219
|
class: "IncodeFlow",
|
|
215
|
-
children: /* @__PURE__ */ o("div", { children: ["Error: ",
|
|
220
|
+
children: /* @__PURE__ */ o("div", { children: ["Error: ", p.error] })
|
|
216
221
|
});
|
|
217
|
-
if (
|
|
218
|
-
if (
|
|
219
|
-
let { currentStep: e, config: t, flow: { flowId: r } } =
|
|
222
|
+
if (p.status === "finished") return null;
|
|
223
|
+
if (p?.status === "ready") {
|
|
224
|
+
let { currentStep: e, config: t, flow: { flowId: r } } = p;
|
|
220
225
|
if (!e || !t) return /* @__PURE__ */ o("div", {
|
|
221
226
|
class: "IncodeFlow",
|
|
222
227
|
children: /* @__PURE__ */ o(u, {
|
|
@@ -226,14 +231,14 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
226
231
|
fullScreen: !0
|
|
227
232
|
})
|
|
228
233
|
});
|
|
229
|
-
if (
|
|
234
|
+
if (w.status === "unsupported") return /* @__PURE__ */ o("div", {
|
|
230
235
|
class: "IncodeFlow",
|
|
231
|
-
children: /* @__PURE__ */ o(
|
|
236
|
+
children: /* @__PURE__ */ o(h, {
|
|
232
237
|
moduleKey: e,
|
|
233
|
-
onNext: () =>
|
|
238
|
+
onNext: () => g.completeModule()
|
|
234
239
|
})
|
|
235
240
|
});
|
|
236
|
-
if (
|
|
241
|
+
if (w.status === "idle" || w.status === "loading" || w.status === "error") return /* @__PURE__ */ o("div", {
|
|
237
242
|
class: "IncodeFlow",
|
|
238
243
|
children: /* @__PURE__ */ o(u, {
|
|
239
244
|
title: n.spinnerConfig?.title,
|
|
@@ -242,25 +247,25 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
242
247
|
fullScreen: !0
|
|
243
248
|
})
|
|
244
249
|
});
|
|
245
|
-
let { Component: i } =
|
|
250
|
+
let { Component: i } = w;
|
|
246
251
|
if (e === "REDIRECT_TO_MOBILE") return /* @__PURE__ */ o("div", {
|
|
247
252
|
class: "IncodeFlow",
|
|
248
253
|
children: /* @__PURE__ */ o(i, {
|
|
249
254
|
config: t,
|
|
250
|
-
onFinish: () =>
|
|
251
|
-
onContinue: () =>
|
|
255
|
+
onFinish: () => g.completeFlow(),
|
|
256
|
+
onContinue: () => g.completeModule(),
|
|
252
257
|
onError: a
|
|
253
|
-
}, `redirect-to-mobile-${
|
|
258
|
+
}, `redirect-to-mobile-${p.currentStepIndex}`)
|
|
254
259
|
});
|
|
255
260
|
if (e === "SELFIE") return /* @__PURE__ */ o("div", {
|
|
256
261
|
class: "IncodeFlow",
|
|
257
262
|
children: /* @__PURE__ */ o(i, {
|
|
258
263
|
config: t,
|
|
259
|
-
onFinish: () =>
|
|
264
|
+
onFinish: () => g.completeModule(),
|
|
260
265
|
onError: (e) => {
|
|
261
266
|
a?.(e ?? "Selfie verification error");
|
|
262
267
|
}
|
|
263
|
-
}, `selfie-${
|
|
268
|
+
}, `selfie-${p.currentStepIndex}`)
|
|
264
269
|
});
|
|
265
270
|
if (e === "AUTHENTICATION") return /* @__PURE__ */ o("div", {
|
|
266
271
|
class: "IncodeFlow",
|
|
@@ -269,21 +274,21 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
269
274
|
...t,
|
|
270
275
|
authHint: n.authHint
|
|
271
276
|
},
|
|
272
|
-
onFinish: () =>
|
|
277
|
+
onFinish: () => g.completeModule(),
|
|
273
278
|
onError: (e) => {
|
|
274
279
|
a?.(e ?? "Authentication error");
|
|
275
280
|
}
|
|
276
|
-
}, `authentication-${
|
|
281
|
+
}, `authentication-${p.currentStepIndex}`)
|
|
277
282
|
});
|
|
278
283
|
if (e === "PHONE") return /* @__PURE__ */ o("div", {
|
|
279
284
|
class: "IncodeFlow",
|
|
280
285
|
children: /* @__PURE__ */ o(i, {
|
|
281
286
|
config: t,
|
|
282
|
-
onFinish: () =>
|
|
287
|
+
onFinish: () => g.completeModule(),
|
|
283
288
|
onError: (e) => {
|
|
284
289
|
a?.(e ?? "Phone verification error");
|
|
285
290
|
}
|
|
286
|
-
}, `phone-${
|
|
291
|
+
}, `phone-${p.currentStepIndex}`)
|
|
287
292
|
});
|
|
288
293
|
if (e === "EMAIL") {
|
|
289
294
|
let e = t;
|
|
@@ -294,11 +299,11 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
294
299
|
class: "IncodeFlow",
|
|
295
300
|
children: /* @__PURE__ */ o(i, {
|
|
296
301
|
config: e,
|
|
297
|
-
onFinish: () =>
|
|
302
|
+
onFinish: () => g.completeModule(),
|
|
298
303
|
onError: (e) => {
|
|
299
304
|
a?.(e ?? "Email verification error");
|
|
300
305
|
}
|
|
301
|
-
}, `email-${
|
|
306
|
+
}, `email-${p.currentStepIndex}`)
|
|
302
307
|
});
|
|
303
308
|
}
|
|
304
309
|
if (e === "ID" || e === "SECOND_ID") {
|
|
@@ -310,72 +315,72 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
310
315
|
...n,
|
|
311
316
|
isSecondId: !0
|
|
312
317
|
} : n,
|
|
313
|
-
onFinish: () =>
|
|
318
|
+
onFinish: () => g.completeModule(),
|
|
314
319
|
onError: (e) => {
|
|
315
320
|
a?.(e ?? "ID capture error");
|
|
316
321
|
}
|
|
317
|
-
}, `id-${
|
|
322
|
+
}, `id-${p.currentStepIndex}`)
|
|
318
323
|
});
|
|
319
324
|
}
|
|
320
325
|
if (e === "FACE_MATCH") return /* @__PURE__ */ o("div", {
|
|
321
326
|
class: "IncodeFlow",
|
|
322
327
|
children: /* @__PURE__ */ o(i, {
|
|
323
328
|
config: t,
|
|
324
|
-
onFinish: () =>
|
|
329
|
+
onFinish: () => g.completeModule(),
|
|
325
330
|
onError: (e) => {
|
|
326
331
|
a?.(e ?? "Face match error");
|
|
327
332
|
}
|
|
328
|
-
}, `face-match-${
|
|
333
|
+
}, `face-match-${p.currentStepIndex}`)
|
|
329
334
|
});
|
|
330
335
|
if (e === "CURP_VALIDATION") return /* @__PURE__ */ o("div", {
|
|
331
336
|
class: "IncodeFlow",
|
|
332
337
|
children: /* @__PURE__ */ o(i, {
|
|
333
338
|
config: t,
|
|
334
|
-
onFinish: () =>
|
|
339
|
+
onFinish: () => g.completeModule(),
|
|
335
340
|
onError: (e) => {
|
|
336
341
|
a?.(e ?? "CURP validation error");
|
|
337
342
|
}
|
|
338
|
-
}, `curp-validation-${
|
|
343
|
+
}, `curp-validation-${p.currentStepIndex}`)
|
|
339
344
|
});
|
|
340
345
|
if (e === "GOVT_VALIDATION_PROVISIONING") return /* @__PURE__ */ o("div", {
|
|
341
346
|
class: "IncodeFlow",
|
|
342
347
|
children: /* @__PURE__ */ o(i, {
|
|
343
348
|
config: t,
|
|
344
|
-
onFinish: () =>
|
|
349
|
+
onFinish: () => g.completeModule(),
|
|
345
350
|
onError: (e) => {
|
|
346
351
|
a?.(e ?? "Government validation error");
|
|
347
352
|
}
|
|
348
|
-
}, `govt-validation-${
|
|
353
|
+
}, `govt-validation-${p.currentStepIndex}`)
|
|
349
354
|
});
|
|
350
355
|
if (e === "GEOLOCATION") return /* @__PURE__ */ o("div", {
|
|
351
356
|
class: "IncodeFlow",
|
|
352
357
|
children: /* @__PURE__ */ o(i, {
|
|
353
358
|
config: t,
|
|
354
|
-
onFinish: () =>
|
|
359
|
+
onFinish: () => g.completeModule(),
|
|
355
360
|
onError: (e) => {
|
|
356
361
|
a?.(e ?? "Geolocation error");
|
|
357
362
|
}
|
|
358
|
-
}, `geolocation-${
|
|
363
|
+
}, `geolocation-${p.currentStepIndex}`)
|
|
359
364
|
});
|
|
360
365
|
if (e === "EXTERNAL_VERIFICATION") return /* @__PURE__ */ o("div", {
|
|
361
366
|
class: "IncodeFlow",
|
|
362
367
|
children: /* @__PURE__ */ o(i, {
|
|
363
|
-
config: { flowId:
|
|
364
|
-
onFinish: () =>
|
|
368
|
+
config: { flowId: p.flow.flowId },
|
|
369
|
+
onFinish: () => g.completeModule(),
|
|
365
370
|
onError: (e) => {
|
|
366
371
|
a?.(e ?? "External verification error");
|
|
367
372
|
}
|
|
368
|
-
}, `ekyc-${
|
|
373
|
+
}, `ekyc-${p.currentStepIndex}`)
|
|
369
374
|
});
|
|
370
375
|
if (e === "DOCUMENT_CAPTURE") return /* @__PURE__ */ o("div", {
|
|
371
376
|
class: "IncodeFlow",
|
|
372
377
|
children: /* @__PURE__ */ o(i, {
|
|
373
378
|
config: t,
|
|
374
|
-
onFinish: () =>
|
|
379
|
+
onFinish: () => g.completeModule(),
|
|
375
380
|
onError: (e) => {
|
|
376
381
|
a?.(e ?? "Document capture error");
|
|
377
382
|
}
|
|
378
|
-
}, `document-capture-${
|
|
383
|
+
}, `document-capture-${p.currentStepIndex}`)
|
|
379
384
|
});
|
|
380
385
|
if (e === "ADDRESS") return /* @__PURE__ */ o("div", {
|
|
381
386
|
class: "IncodeFlow",
|
|
@@ -384,21 +389,21 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
384
389
|
...t,
|
|
385
390
|
processingType: "addressStatement"
|
|
386
391
|
},
|
|
387
|
-
onFinish: () =>
|
|
392
|
+
onFinish: () => g.completeModule(),
|
|
388
393
|
onError: (e) => {
|
|
389
394
|
a?.(e ?? "Address capture error");
|
|
390
395
|
}
|
|
391
|
-
}, `address-${
|
|
396
|
+
}, `address-${p.currentStepIndex}`)
|
|
392
397
|
});
|
|
393
398
|
if (e === "SIGNATURE") return /* @__PURE__ */ o("div", {
|
|
394
399
|
class: "IncodeFlow",
|
|
395
400
|
children: /* @__PURE__ */ o(i, {
|
|
396
401
|
config: t,
|
|
397
|
-
onFinish: () =>
|
|
402
|
+
onFinish: () => g.completeModule(),
|
|
398
403
|
onError: (e) => {
|
|
399
404
|
a?.(e ?? "Signature capture error");
|
|
400
405
|
}
|
|
401
|
-
}, `signature-${
|
|
406
|
+
}, `signature-${p.currentStepIndex}`)
|
|
402
407
|
});
|
|
403
408
|
if (e === "EKYB") {
|
|
404
409
|
let e = t;
|
|
@@ -412,32 +417,32 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
412
417
|
checkTaxId: e.checkTaxId,
|
|
413
418
|
checkUniqueBeneficialOwner: e.checkUniqueBeneficialOwner
|
|
414
419
|
},
|
|
415
|
-
onFinish: () =>
|
|
420
|
+
onFinish: () => g.completeModule(),
|
|
416
421
|
onError: (e) => {
|
|
417
422
|
a?.(e ?? "eKYB verification error");
|
|
418
423
|
}
|
|
419
|
-
}, `ekyb-${
|
|
424
|
+
}, `ekyb-${p.currentStepIndex}`)
|
|
420
425
|
});
|
|
421
426
|
}
|
|
422
427
|
if (e === "COMBINED_CONSENT") return /* @__PURE__ */ o("div", {
|
|
423
428
|
class: "IncodeFlow",
|
|
424
429
|
children: /* @__PURE__ */ o(i, {
|
|
425
430
|
config: t,
|
|
426
|
-
onFinish: () =>
|
|
431
|
+
onFinish: () => g.completeModule(),
|
|
427
432
|
onError: (e) => {
|
|
428
433
|
a?.(e ?? "Combined consent error");
|
|
429
434
|
}
|
|
430
|
-
}, `combined-consent-${
|
|
435
|
+
}, `combined-consent-${p.currentStepIndex}`)
|
|
431
436
|
});
|
|
432
437
|
if (e === "MANDATORY_CONSENT") return /* @__PURE__ */ o("div", {
|
|
433
438
|
class: "IncodeFlow",
|
|
434
439
|
children: /* @__PURE__ */ o(i, {
|
|
435
440
|
config: t,
|
|
436
|
-
onFinish: () =>
|
|
441
|
+
onFinish: () => g.completeModule(),
|
|
437
442
|
onError: (e) => {
|
|
438
443
|
a?.(e ?? "Mandatory consent error");
|
|
439
444
|
}
|
|
440
|
-
}, `mandatory-consent-${
|
|
445
|
+
}, `mandatory-consent-${p.currentStepIndex}`)
|
|
441
446
|
});
|
|
442
447
|
if (e === "AE_SIGNATURE" || e === "QE_SIGNATURE") {
|
|
443
448
|
let n = t, r = e === "QE_SIGNATURE" ? "qe" : "ae";
|
|
@@ -448,47 +453,47 @@ var A = n(() => import("../homeScreen-C0-81utl.js").then((e) => ({ default: e.Ho
|
|
|
448
453
|
uploadDocument: n.uploadDocument,
|
|
449
454
|
downloadDocument: n.downloadDocument
|
|
450
455
|
},
|
|
451
|
-
onFinish: () =>
|
|
456
|
+
onFinish: () => g.completeModule(),
|
|
452
457
|
onError: (e) => {
|
|
453
458
|
a?.(e ?? `${r.toUpperCase()} Signature error`);
|
|
454
459
|
}
|
|
455
|
-
}, `${r}-signature-${
|
|
460
|
+
}, `${r}-signature-${p.currentStepIndex}`)
|
|
456
461
|
});
|
|
457
462
|
}
|
|
458
463
|
if (e === "ANTIFRAUD") return /* @__PURE__ */ o("div", {
|
|
459
464
|
class: "IncodeFlow",
|
|
460
465
|
children: /* @__PURE__ */ o(i, {
|
|
461
|
-
onFinish: () =>
|
|
466
|
+
onFinish: () => g.completeModule(),
|
|
462
467
|
onError: (e) => {
|
|
463
468
|
a?.(e ?? "Antifraud check error");
|
|
464
469
|
}
|
|
465
|
-
}, `antifraud-${
|
|
470
|
+
}, `antifraud-${p.currentStepIndex}`)
|
|
466
471
|
});
|
|
467
472
|
if (e === "WATCHLIST") return /* @__PURE__ */ o("div", {
|
|
468
473
|
class: "IncodeFlow",
|
|
469
474
|
children: /* @__PURE__ */ o(i, {
|
|
470
|
-
onFinish: () =>
|
|
475
|
+
onFinish: () => g.completeModule(),
|
|
471
476
|
onError: (e) => {
|
|
472
477
|
a?.(e ?? "Watchlist check error");
|
|
473
478
|
}
|
|
474
|
-
}, `watchlist-${
|
|
479
|
+
}, `watchlist-${p.currentStepIndex}`)
|
|
475
480
|
});
|
|
476
481
|
if (e === "CROSS_DOCUMENT_DATA_MATCH") return /* @__PURE__ */ o("div", {
|
|
477
482
|
class: "IncodeFlow",
|
|
478
483
|
children: /* @__PURE__ */ o(i, {
|
|
479
|
-
onFinish: () =>
|
|
484
|
+
onFinish: () => g.completeModule(),
|
|
480
485
|
onError: (e) => {
|
|
481
486
|
a?.(e ?? "Cross document data match error");
|
|
482
487
|
}
|
|
483
|
-
}, `cross-document-data-match-${
|
|
488
|
+
}, `cross-document-data-match-${p.currentStepIndex}`)
|
|
484
489
|
});
|
|
485
490
|
}
|
|
486
491
|
return null;
|
|
487
|
-
},
|
|
492
|
+
}, N = ({ config: e, onFinish: t = () => {}, onError: n }) => /* @__PURE__ */ o(l, { children: e ? /* @__PURE__ */ o(M, {
|
|
488
493
|
config: e,
|
|
489
494
|
onFinish: t,
|
|
490
495
|
onError: n
|
|
491
496
|
}) : null });
|
|
492
|
-
d(
|
|
497
|
+
d(N, "incode-flow");
|
|
493
498
|
//#endregion
|
|
494
|
-
export {
|
|
499
|
+
export { N as IncodeFlow, E as preloadIncodeFlow };
|
|
@@ -350,11 +350,15 @@ function H(t) {
|
|
|
350
350
|
} : { status: "idle" };
|
|
351
351
|
}
|
|
352
352
|
function U(e) {
|
|
353
|
+
let { moduleKey: t, modules: n } = e, r = t ? n[t] : void 0, i = V({ loader: r });
|
|
354
|
+
return r != null && i.status === "loaded";
|
|
355
|
+
}
|
|
356
|
+
function W(e) {
|
|
353
357
|
typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
|
|
354
358
|
e();
|
|
355
359
|
}) : setTimeout(e, 0);
|
|
356
360
|
}
|
|
357
|
-
function
|
|
361
|
+
function G(n, r, i, a) {
|
|
358
362
|
let o = t(/* @__PURE__ */ new Set());
|
|
359
363
|
e(() => {
|
|
360
364
|
if (a && r < n.length - 1) {
|
|
@@ -362,7 +366,7 @@ function W(n, r, i, a) {
|
|
|
362
366
|
if (e && !o.current.has(e)) {
|
|
363
367
|
o.current.add(e);
|
|
364
368
|
let t = i[e];
|
|
365
|
-
t &&
|
|
369
|
+
t && W(() => {
|
|
366
370
|
t().catch(() => {
|
|
367
371
|
o.current.delete(e);
|
|
368
372
|
});
|
|
@@ -377,4 +381,4 @@ function W(n, r, i, a) {
|
|
|
377
381
|
]);
|
|
378
382
|
}
|
|
379
383
|
//#endregion
|
|
380
|
-
export {
|
|
384
|
+
export { A as a, F as c, P as d, L as f, z as i, R as l, U as n, N as o, w as p, G as r, I as s, H as t, M as u };
|
|
@@ -5,17 +5,17 @@ import { o, t as s } from "../incodeComponent-DIb7wDAq.js";
|
|
|
5
5
|
import { t as c } from "../spinner-l6dvYqCg.js";
|
|
6
6
|
import "../spinner-CFvndzMU.js";
|
|
7
7
|
import { t as l } from "../incodeModule-D_r2n18O.js";
|
|
8
|
-
import {
|
|
8
|
+
import { a as u, d, i as f, p, t as m } from "../useModuleLoader-B6JxxJWR.js";
|
|
9
9
|
import { resolveWasmConfig as h, warmupWasm as g } from "@incodetech/core/wasm";
|
|
10
10
|
import { createWorkflowManager as _ } from "@incodetech/core/workflow";
|
|
11
11
|
//#region src/modules/workflow/workflowInit.ts
|
|
12
12
|
var v = {
|
|
13
|
-
...
|
|
13
|
+
...u,
|
|
14
14
|
REDIRECT_TO_MOBILE: () => import("../redirectToMobile-1oLWg6QJ.js").then((e) => e.RedirectToMobile)
|
|
15
15
|
};
|
|
16
16
|
async function y() {
|
|
17
17
|
try {
|
|
18
|
-
let e = await
|
|
18
|
+
let e = await p();
|
|
19
19
|
return {
|
|
20
20
|
theme: e,
|
|
21
21
|
uiConfig: {
|
|
@@ -45,11 +45,11 @@ function x(e) {
|
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/modules/workflow/useWorkflowInitialization.ts
|
|
47
47
|
function S(e) {
|
|
48
|
-
let { apiURL: i, token: o, lang: s, disableDashboardTheme: c, wasmConfig: l, customModuleCallback: u, interviewId:
|
|
48
|
+
let { apiURL: i, token: o, lang: s, disableDashboardTheme: c, wasmConfig: l, customModuleCallback: u, interviewId: f, isDesktop: p, onError: m } = e, h = n(null), [g, _] = r(() => {
|
|
49
49
|
let e = b({
|
|
50
50
|
customModuleCallback: u,
|
|
51
|
-
interviewId:
|
|
52
|
-
isDesktop:
|
|
51
|
+
interviewId: f,
|
|
52
|
+
isDesktop: p
|
|
53
53
|
});
|
|
54
54
|
return h.current = e, {
|
|
55
55
|
status: "initializing",
|
|
@@ -62,7 +62,7 @@ function S(e) {
|
|
|
62
62
|
let e = h.current;
|
|
63
63
|
return (async () => {
|
|
64
64
|
try {
|
|
65
|
-
await
|
|
65
|
+
await d({
|
|
66
66
|
apiURL: i,
|
|
67
67
|
token: o,
|
|
68
68
|
lang: s
|
|
@@ -80,7 +80,7 @@ function S(e) {
|
|
|
80
80
|
status: "error",
|
|
81
81
|
error: n,
|
|
82
82
|
workflowManager: e
|
|
83
|
-
}),
|
|
83
|
+
}), m?.(n);
|
|
84
84
|
}
|
|
85
85
|
})(), () => e?.stop();
|
|
86
86
|
}, [
|
|
@@ -89,7 +89,7 @@ function S(e) {
|
|
|
89
89
|
s,
|
|
90
90
|
c,
|
|
91
91
|
l,
|
|
92
|
-
|
|
92
|
+
m
|
|
93
93
|
]), g;
|
|
94
94
|
}
|
|
95
95
|
//#endregion
|
|
@@ -145,7 +145,7 @@ var w = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
145
145
|
interviewId: r.interviewId,
|
|
146
146
|
isDesktop: r.isDesktop,
|
|
147
147
|
onError: s
|
|
148
|
-
}), [d,
|
|
148
|
+
}), [d, p] = o(() => u.workflowManager, { autoLoad: !1 }), h = m({
|
|
149
149
|
moduleKey: d?.status === "ready" ? d.currentNode.moduleKey : void 0,
|
|
150
150
|
modules: v,
|
|
151
151
|
onModuleLoading: r.onModuleLoading,
|
|
@@ -178,7 +178,7 @@ var w = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
178
178
|
fullScreen: !0
|
|
179
179
|
})
|
|
180
180
|
}), y = (e) => {
|
|
181
|
-
|
|
181
|
+
p.errorModule(e ?? "Module error"), s?.(e ?? "Module error");
|
|
182
182
|
};
|
|
183
183
|
if (u.status === "error") return null;
|
|
184
184
|
if (u.status === "initializing" || !d || d.status === "idle" || d.status === "loading") return _();
|
|
@@ -187,7 +187,7 @@ var w = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
187
187
|
class: "IncodeWorkflow",
|
|
188
188
|
children: /* @__PURE__ */ i(f, {
|
|
189
189
|
moduleKey: d.currentNode.moduleKey,
|
|
190
|
-
onNext: () =>
|
|
190
|
+
onNext: () => p.completeModule()
|
|
191
191
|
})
|
|
192
192
|
});
|
|
193
193
|
if (h.status === "idle" || h.status === "loading" || h.status === "error") return _();
|
|
@@ -204,9 +204,9 @@ var w = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
204
204
|
mergeSessionRecordings: d.workflowConfig.mergeSessionRecordings,
|
|
205
205
|
ageAssurance: d.workflowConfig.ageAssurance
|
|
206
206
|
}),
|
|
207
|
-
onFinish: () =>
|
|
207
|
+
onFinish: () => p.completeModule(),
|
|
208
208
|
onError: y,
|
|
209
|
-
...d.currentNode.moduleKey === "REDIRECT_TO_MOBILE" ? { onContinue: () =>
|
|
209
|
+
...d.currentNode.moduleKey === "REDIRECT_TO_MOBILE" ? { onContinue: () => p.completeModule() } : {}
|
|
210
210
|
}, d.currentNode.id)
|
|
211
211
|
});
|
|
212
212
|
}, T = ({ config: e, onFinish: t, onError: n }) => /* @__PURE__ */ i(s, { children: e ? /* @__PURE__ */ i(w, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260417-78468b3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"qrcode": "^1.5.4",
|
|
184
184
|
"signature_pad": "^5.1.3",
|
|
185
185
|
"tailwindcss": "^4.1.17",
|
|
186
|
-
"@incodetech/core": "0.0.0-dev-
|
|
186
|
+
"@incodetech/core": "0.0.0-dev-20260417-78468b3"
|
|
187
187
|
},
|
|
188
188
|
"devDependencies": {
|
|
189
189
|
"@microsoft/api-extractor": "^7.53.3",
|