@incodetech/web 0.0.0-dev-20260527-d2899d7c → 0.0.0-dev-20260527-67542989
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 { c as u } from "../hooks-CLjlsC2g.js";
|
|
|
5
5
|
import { t as d } from "../incodeComponent-MZEyrb1V.js";
|
|
6
6
|
import { t as f } from "../transitionSpinner-BWCiDYAb.js";
|
|
7
7
|
import { t as p } from "../incodeModule-CHzKl22Y.js";
|
|
8
|
-
import {
|
|
9
|
-
import { getDeviceClass as
|
|
10
|
-
import { getRequiredWasmPipelines as
|
|
11
|
-
import { bootstrapSession as
|
|
8
|
+
import { _ as m, a as h, c as g, d as _, f as v, h as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, y as k } from "../useModuleLoader-CXzqdNSv.js";
|
|
9
|
+
import { getDeviceClass as A } from "@incodetech/core/device";
|
|
10
|
+
import { getRequiredWasmPipelines as j } from "@incodetech/core/flow";
|
|
11
|
+
import { bootstrapSession as M, refreshQrUrlUuid as N } from "@incodetech/core/session";
|
|
12
12
|
//#region src/shared/processing/useDelayedFlag.ts
|
|
13
|
-
function
|
|
13
|
+
function P(e, t) {
|
|
14
14
|
let [r, i] = s(!1);
|
|
15
15
|
return n(() => {
|
|
16
16
|
if (e === !1) {
|
|
@@ -27,21 +27,8 @@ function N(e, t) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/modules/flow/createFlowSession.ts
|
|
30
|
-
function
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
async function F(e) {
|
|
34
|
-
let t = globalThis.crypto?.subtle;
|
|
35
|
-
if (!t) throw Error("SHA-1 is not available in this environment");
|
|
36
|
-
return P(await t.digest("SHA-1", new TextEncoder().encode(e)));
|
|
37
|
-
}
|
|
38
|
-
async function I(e) {
|
|
39
|
-
if (typeof e.apiKey == "string") return e.apiKey;
|
|
40
|
-
if (typeof e.clientId == "string") return F(e.clientId);
|
|
41
|
-
throw Error("Flow self-loading mode requires apiKey or clientId");
|
|
42
|
-
}
|
|
43
|
-
async function L(e, t) {
|
|
44
|
-
return j(await I(e), {
|
|
30
|
+
async function F(e, t) {
|
|
31
|
+
return M(await h(e), {
|
|
45
32
|
configurationId: e.configurationId,
|
|
46
33
|
externalId: e.externalId,
|
|
47
34
|
externalCustomerId: e.externalCustomerId,
|
|
@@ -50,23 +37,24 @@ async function L(e, t) {
|
|
|
50
37
|
uuid: e.uuid,
|
|
51
38
|
urlUuid: e.urlUuid,
|
|
52
39
|
interviewId: e.interviewId,
|
|
40
|
+
loginHint: e.loginHint,
|
|
53
41
|
onUrlUuidRefreshed: e.onUrlUuidRefreshed
|
|
54
42
|
}, t);
|
|
55
43
|
}
|
|
56
44
|
//#endregion
|
|
57
45
|
//#region src/modules/flow/flowConfig.ts
|
|
58
|
-
function
|
|
46
|
+
function I(e) {
|
|
59
47
|
return typeof e.token == "string";
|
|
60
48
|
}
|
|
61
|
-
function
|
|
49
|
+
function L(e) {
|
|
62
50
|
let t = e;
|
|
63
51
|
return typeof t.configurationId == "string" && (typeof t.apiKey == "string" || typeof t.clientId == "string");
|
|
64
52
|
}
|
|
65
53
|
//#endregion
|
|
66
54
|
//#region src/modules/flow/preloadFlow.ts
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
-
let t =
|
|
55
|
+
var R = /* @__PURE__ */ new Map();
|
|
56
|
+
function z(e) {
|
|
57
|
+
let t = R.get(e);
|
|
70
58
|
if (!t) throw Error("Preload state not found");
|
|
71
59
|
return {
|
|
72
60
|
get isReady() {
|
|
@@ -82,18 +70,18 @@ function V(e) {
|
|
|
82
70
|
}
|
|
83
71
|
},
|
|
84
72
|
cancel() {
|
|
85
|
-
t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")),
|
|
73
|
+
t.status === "loading" && (t.unsubscribe && t.unsubscribe(), t.flowManager.stop(), t.readyReject(/* @__PURE__ */ Error("Preload cancelled")), R.delete(e));
|
|
86
74
|
}
|
|
87
75
|
};
|
|
88
76
|
}
|
|
89
|
-
function
|
|
77
|
+
function B(e) {
|
|
90
78
|
let { token: t } = e;
|
|
91
79
|
if (e.urlUuid) throw Error("preloadIncodeFlow does not support urlUuid; pass it to <IncodeFlow> directly so the SDK can rotate it on mount.");
|
|
92
|
-
if (
|
|
80
|
+
if (R.has(t)) return z(t);
|
|
93
81
|
let n, r, i = new Promise((e, t) => {
|
|
94
82
|
n = e, r = t;
|
|
95
|
-
}), a =
|
|
96
|
-
a.getState().presentation.shouldPrefetchHome &&
|
|
83
|
+
}), a = O(e);
|
|
84
|
+
a.getState().presentation.shouldPrefetchHome && x();
|
|
97
85
|
let o = {
|
|
98
86
|
status: "loading",
|
|
99
87
|
flowManager: a,
|
|
@@ -102,59 +90,59 @@ function H(e) {
|
|
|
102
90
|
readyResolve: n,
|
|
103
91
|
readyReject: r
|
|
104
92
|
};
|
|
105
|
-
return
|
|
93
|
+
return R.set(t, o), (async () => {
|
|
106
94
|
try {
|
|
107
|
-
await
|
|
95
|
+
await v({
|
|
108
96
|
token: e.token,
|
|
109
97
|
lang: e.lang,
|
|
110
98
|
flowManager: a
|
|
111
99
|
});
|
|
112
|
-
let t = e.disableDashboardTheme ? Promise.resolve({}) :
|
|
100
|
+
let t = e.disableDashboardTheme ? Promise.resolve({}) : _().then((e) => {
|
|
113
101
|
o.theme = e.theme, o.uiConfig = e.uiConfig;
|
|
114
102
|
});
|
|
115
103
|
o.unsubscribe = a.subscribe((t) => {
|
|
116
104
|
if (t.status === "ready") {
|
|
117
105
|
let n = t;
|
|
118
|
-
|
|
106
|
+
m(n, e.wasmConfig), w(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
119
107
|
} else t.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = t.error, o.readyReject(Error(t.error)));
|
|
120
108
|
}), await t;
|
|
121
109
|
} catch (e) {
|
|
122
|
-
o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")),
|
|
110
|
+
o.status = "error", o.error = e instanceof Error ? e.message : "Failed to preload", o.readyReject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to preload")), R.delete(t);
|
|
123
111
|
}
|
|
124
|
-
})(),
|
|
112
|
+
})(), z(t);
|
|
125
113
|
}
|
|
126
|
-
function
|
|
127
|
-
return
|
|
114
|
+
function V(e) {
|
|
115
|
+
return R.get(e) ?? null;
|
|
128
116
|
}
|
|
129
|
-
function
|
|
130
|
-
let t =
|
|
131
|
-
return t &&
|
|
117
|
+
function H(e) {
|
|
118
|
+
let t = V(e);
|
|
119
|
+
return t && R.delete(e), t;
|
|
132
120
|
}
|
|
133
121
|
//#endregion
|
|
134
122
|
//#region src/modules/flow/useFlowInitialization.ts
|
|
135
|
-
function
|
|
136
|
-
e.getState().presentation.shouldPrefetchHome &&
|
|
123
|
+
function U(e) {
|
|
124
|
+
e.getState().presentation.shouldPrefetchHome && x();
|
|
137
125
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
126
|
+
function W() {
|
|
127
|
+
A() === "desktop" && y();
|
|
140
128
|
}
|
|
141
|
-
function
|
|
142
|
-
let { lang: t, disableDashboardTheme: r, enableHome: i, onError: o, useCPF: c } = e, u =
|
|
143
|
-
let t = u ?
|
|
129
|
+
function G(e) {
|
|
130
|
+
let { lang: t, disableDashboardTheme: r, enableHome: i, onError: o, useCPF: c } = e, u = I(e) ? e.token : void 0, d = a(null), [f, p] = s(() => {
|
|
131
|
+
let t = u ? V(u) : null;
|
|
144
132
|
if (u && t?.status === "ready") {
|
|
145
|
-
let e =
|
|
146
|
-
if (e) return d.current = e.flowManager,
|
|
133
|
+
let e = H(u);
|
|
134
|
+
if (e) return d.current = e.flowManager, U(e.flowManager), W(), e.uiConfig && l(e.uiConfig), {
|
|
147
135
|
status: "ready",
|
|
148
136
|
flowManager: e.flowManager
|
|
149
137
|
};
|
|
150
138
|
}
|
|
151
|
-
let n =
|
|
139
|
+
let n = O({
|
|
152
140
|
authHint: e.authHint,
|
|
153
141
|
lang: e.lang,
|
|
154
142
|
enableHome: e.enableHome,
|
|
155
143
|
useCPF: e.useCPF
|
|
156
144
|
});
|
|
157
|
-
return d.current = n,
|
|
145
|
+
return d.current = n, U(n), W(), t?.status === "error" ? {
|
|
158
146
|
status: "error",
|
|
159
147
|
error: t.error ?? "Preload failed",
|
|
160
148
|
flowManager: n
|
|
@@ -162,19 +150,19 @@ function q(e) {
|
|
|
162
150
|
status: "initializing",
|
|
163
151
|
flowManager: n
|
|
164
152
|
};
|
|
165
|
-
}),
|
|
153
|
+
}), m = a(!1);
|
|
166
154
|
return n(() => {
|
|
167
155
|
if (f.status !== "initializing") return;
|
|
168
|
-
let n = u ?
|
|
156
|
+
let n = u ? V(u) : null;
|
|
169
157
|
if (u && n?.status === "loading") {
|
|
170
158
|
n.readyPromise.then(() => {
|
|
171
|
-
let e =
|
|
172
|
-
e && (d.current = e.flowManager,
|
|
159
|
+
let e = H(u);
|
|
160
|
+
e && (d.current = e.flowManager, U(e.flowManager), W(), e.uiConfig && l(e.uiConfig), p({
|
|
173
161
|
status: "ready",
|
|
174
162
|
flowManager: e.flowManager
|
|
175
163
|
}));
|
|
176
164
|
}).catch((e) => {
|
|
177
|
-
let t = e instanceof Error ? e.message : "Preload failed", n =
|
|
165
|
+
let t = e instanceof Error ? e.message : "Preload failed", n = C(e);
|
|
178
166
|
p({
|
|
179
167
|
status: "error",
|
|
180
168
|
error: t,
|
|
@@ -184,25 +172,25 @@ function q(e) {
|
|
|
184
172
|
});
|
|
185
173
|
return;
|
|
186
174
|
}
|
|
187
|
-
if (
|
|
188
|
-
|
|
175
|
+
if (m.current) return;
|
|
176
|
+
m.current = !0;
|
|
189
177
|
let i = new AbortController(), { signal: a } = i;
|
|
190
178
|
return (async () => {
|
|
191
179
|
try {
|
|
192
180
|
let n;
|
|
193
|
-
if (
|
|
181
|
+
if (I(e)) n = e.token, e.urlUuid && await N({
|
|
194
182
|
urlUuid: e.urlUuid,
|
|
195
183
|
onboardingId: null,
|
|
196
184
|
onRefreshed: e.onUrlUuidRefreshed
|
|
197
185
|
}, a);
|
|
198
|
-
else if (
|
|
186
|
+
else if (L(e)) n = (await F(e, a)).token;
|
|
199
187
|
else throw Error("Flow requires token, or configurationId with apiKey or clientId");
|
|
200
|
-
await
|
|
188
|
+
await v({
|
|
201
189
|
token: n,
|
|
202
190
|
lang: t,
|
|
203
191
|
flowManager: f.flowManager
|
|
204
192
|
});
|
|
205
|
-
let i = r ? Promise.resolve() :
|
|
193
|
+
let i = r ? Promise.resolve() : _().then((e) => {
|
|
206
194
|
e.uiConfig && l(e.uiConfig);
|
|
207
195
|
}), o = f.flowManager.waitForReady();
|
|
208
196
|
await Promise.all([o, i]), p({
|
|
@@ -211,7 +199,7 @@ function q(e) {
|
|
|
211
199
|
});
|
|
212
200
|
} catch (e) {
|
|
213
201
|
if (a.aborted) return;
|
|
214
|
-
let t = e instanceof Error ? e.message : "Failed to initialize SDK", n =
|
|
202
|
+
let t = e instanceof Error ? e.message : "Failed to initialize SDK", n = C(e);
|
|
215
203
|
p({
|
|
216
204
|
status: "error",
|
|
217
205
|
error: t,
|
|
@@ -233,68 +221,68 @@ function q(e) {
|
|
|
233
221
|
}
|
|
234
222
|
//#endregion
|
|
235
223
|
//#region src/modules/flow/flow.tsx
|
|
236
|
-
var
|
|
237
|
-
let { i18n: d } = e(), p =
|
|
224
|
+
var K = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.HomeScreen }))), q = ({ config: r, onFinish: s, onError: l }) => {
|
|
225
|
+
let { i18n: d } = e(), p = G(i(() => ({
|
|
238
226
|
...r,
|
|
239
227
|
onError: l
|
|
240
|
-
}), [r, l])), [
|
|
241
|
-
moduleKey:
|
|
242
|
-
modules:
|
|
228
|
+
}), [r, l])), [h, _] = u(() => p.flowManager, { autoLoad: !1 }), v = h.presentation.lazyModuleKey, y = h.status === "ready" ? h.currentStep : void 0, C = D({
|
|
229
|
+
moduleKey: v,
|
|
230
|
+
modules: b,
|
|
243
231
|
onModuleLoading: r.onModuleLoading,
|
|
244
232
|
onModuleLoaded: r.onModuleLoaded,
|
|
245
233
|
onError: l
|
|
246
234
|
});
|
|
247
|
-
|
|
248
|
-
moduleKey:
|
|
249
|
-
modules:
|
|
235
|
+
S({
|
|
236
|
+
moduleKey: h.status === "ready" && h.homeScreen.visible ? y : void 0,
|
|
237
|
+
modules: b
|
|
250
238
|
});
|
|
251
|
-
let
|
|
252
|
-
|
|
253
|
-
if (r.onFlowEvent) return
|
|
254
|
-
}, [
|
|
255
|
-
|
|
256
|
-
}, [
|
|
239
|
+
let w = C.status === "loaded", O = r.enableHome === !0 && h.status === "ready" && h.flow.disableLaunchScreen !== !0 && h.currentStepIndex === 0 && h.homeScreen.visible === !1 && C.status === "loading", A = P(h.presentation.isAwaitingReady === !0, 150), M = P(h.status === "ready" && (C.status === "idle" || C.status === "loading" || C.status === "error"), 150);
|
|
240
|
+
T(h?.status === "ready" ? h.steps : [], h?.status === "ready" ? h.currentStepIndex : -1, b, w), n(() => {
|
|
241
|
+
if (r.onFlowEvent) return _.subscribeFlowEvent(r.onFlowEvent);
|
|
242
|
+
}, [_, r.onFlowEvent]), n(() => {
|
|
243
|
+
h.presentation.shouldPrefetchHome && x();
|
|
244
|
+
}, [h.presentation.shouldPrefetchHome]), n(() => {
|
|
257
245
|
t() || r.lang && d.language !== r.lang && d.changeLanguage(r.lang);
|
|
258
246
|
}, [r.lang, d]), n(() => {
|
|
259
|
-
if (
|
|
260
|
-
let e =
|
|
261
|
-
t.length > 0 && (r.onWasmWarmup?.(t),
|
|
262
|
-
}, [
|
|
263
|
-
let
|
|
247
|
+
if (h?.status !== "ready" || h.currentStep === "REDIRECT_TO_MOBILE") return;
|
|
248
|
+
let e = h, t = j(e.flow);
|
|
249
|
+
t.length > 0 && (r.onWasmWarmup?.(t), m(e, r.wasmConfig));
|
|
250
|
+
}, [h, r]);
|
|
251
|
+
let N = a(!1);
|
|
264
252
|
n(() => {
|
|
265
|
-
if (!
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
let e =
|
|
253
|
+
if (!N.current) {
|
|
254
|
+
if (h?.status === "finished") {
|
|
255
|
+
N.current = !0;
|
|
256
|
+
let e = h.finishStatus;
|
|
269
257
|
queueMicrotask(() => s(e));
|
|
270
258
|
return;
|
|
271
259
|
}
|
|
272
|
-
if (
|
|
273
|
-
|
|
274
|
-
let { error: e, errorCode: t } =
|
|
260
|
+
if (h?.status === "error" && l) {
|
|
261
|
+
N.current = !0;
|
|
262
|
+
let { error: e, errorCode: t } = h;
|
|
275
263
|
queueMicrotask(() => l(e, t));
|
|
276
264
|
}
|
|
277
265
|
}
|
|
278
266
|
}, [
|
|
279
|
-
|
|
267
|
+
h?.status,
|
|
280
268
|
s,
|
|
281
269
|
l,
|
|
282
|
-
|
|
270
|
+
h
|
|
283
271
|
]), n(() => {
|
|
284
|
-
|
|
285
|
-
}, [
|
|
272
|
+
h?.status === "ready" && h.currentStep === "ID" && h.steps.includes("TUTORIAL_ID") && _.completeModule();
|
|
273
|
+
}, [h, _]);
|
|
286
274
|
let F = !(r.spinnerConfig?.title || r.spinnerConfig?.subtitle);
|
|
287
275
|
if (p.status === "error") return /* @__PURE__ */ c("div", {
|
|
288
276
|
class: "IncodeFlow",
|
|
289
|
-
children: /* @__PURE__ */ c(
|
|
277
|
+
children: /* @__PURE__ */ c(k, { message: p.error })
|
|
290
278
|
});
|
|
291
|
-
if (
|
|
279
|
+
if (h.homeScreen.visible || O) return /* @__PURE__ */ c("div", {
|
|
292
280
|
class: "IncodeFlow",
|
|
293
281
|
children: /* @__PURE__ */ c(o, {
|
|
294
282
|
fallback: null,
|
|
295
|
-
children: /* @__PURE__ */ c(
|
|
296
|
-
isContinueLoading:
|
|
297
|
-
onContinue: () =>
|
|
283
|
+
children: /* @__PURE__ */ c(K, {
|
|
284
|
+
isContinueLoading: h.homeScreen.isContinueLoading || O,
|
|
285
|
+
onContinue: () => _.continueFromHome()
|
|
298
286
|
})
|
|
299
287
|
})
|
|
300
288
|
});
|
|
@@ -305,20 +293,20 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
305
293
|
hideText: F
|
|
306
294
|
})
|
|
307
295
|
});
|
|
308
|
-
if (
|
|
296
|
+
if (h.presentation.isAwaitingReady) return A ? /* @__PURE__ */ c("div", {
|
|
309
297
|
class: "IncodeFlow",
|
|
310
298
|
children: /* @__PURE__ */ c(f, {
|
|
311
299
|
spinnerConfig: r.spinnerConfig,
|
|
312
300
|
hideText: F
|
|
313
301
|
})
|
|
314
302
|
}) : /* @__PURE__ */ c("div", { class: "IncodeFlow" });
|
|
315
|
-
if (
|
|
303
|
+
if (h.status === "error") return /* @__PURE__ */ c("div", {
|
|
316
304
|
class: "IncodeFlow",
|
|
317
|
-
children: /* @__PURE__ */ c(
|
|
305
|
+
children: /* @__PURE__ */ c(k, { message: h.error })
|
|
318
306
|
});
|
|
319
|
-
if (
|
|
320
|
-
if (
|
|
321
|
-
let { currentStep: e, config: t, flow: n } =
|
|
307
|
+
if (h.status === "finished") return null;
|
|
308
|
+
if (h?.status === "ready") {
|
|
309
|
+
let { currentStep: e, config: t, flow: n } = h, { flowId: i } = n;
|
|
322
310
|
if (!e || !t) return /* @__PURE__ */ c("div", {
|
|
323
311
|
class: "IncodeFlow",
|
|
324
312
|
children: /* @__PURE__ */ c(f, {
|
|
@@ -326,40 +314,40 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
326
314
|
hideText: F
|
|
327
315
|
})
|
|
328
316
|
});
|
|
329
|
-
if (
|
|
330
|
-
if (
|
|
317
|
+
if (g.has(e)) return /* @__PURE__ */ c("div", { class: "IncodeFlow" });
|
|
318
|
+
if (C.status === "unsupported") return /* @__PURE__ */ c("div", {
|
|
331
319
|
class: "IncodeFlow",
|
|
332
|
-
children: /* @__PURE__ */ c(
|
|
320
|
+
children: /* @__PURE__ */ c(E, {
|
|
333
321
|
moduleKey: e,
|
|
334
|
-
onNext: () =>
|
|
322
|
+
onNext: () => _.completeModule()
|
|
335
323
|
})
|
|
336
324
|
});
|
|
337
|
-
if (
|
|
325
|
+
if (C.status === "idle" || C.status === "loading" || C.status === "error") return M ? /* @__PURE__ */ c("div", {
|
|
338
326
|
class: "IncodeFlow",
|
|
339
327
|
children: /* @__PURE__ */ c(f, {
|
|
340
328
|
spinnerConfig: r.spinnerConfig,
|
|
341
329
|
hideText: F
|
|
342
330
|
})
|
|
343
331
|
}) : /* @__PURE__ */ c("div", { class: "IncodeFlow" });
|
|
344
|
-
let { Component: a } =
|
|
332
|
+
let { Component: a } = C;
|
|
345
333
|
if (e === "REDIRECT_TO_MOBILE") return /* @__PURE__ */ c("div", {
|
|
346
334
|
class: "IncodeFlow",
|
|
347
335
|
children: /* @__PURE__ */ c(a, {
|
|
348
336
|
config: t,
|
|
349
|
-
onFinish: () =>
|
|
350
|
-
onContinue: () =>
|
|
337
|
+
onFinish: () => _.completeFlow(),
|
|
338
|
+
onContinue: () => _.completeModule(),
|
|
351
339
|
onError: l
|
|
352
|
-
}, `redirect-to-mobile-${
|
|
340
|
+
}, `redirect-to-mobile-${h.currentStepIndex}`)
|
|
353
341
|
});
|
|
354
342
|
if (e === "SELFIE") return /* @__PURE__ */ c("div", {
|
|
355
343
|
class: "IncodeFlow",
|
|
356
344
|
children: /* @__PURE__ */ c(a, {
|
|
357
345
|
config: t,
|
|
358
|
-
onFinish: () =>
|
|
346
|
+
onFinish: () => _.completeModule(),
|
|
359
347
|
onError: (e) => {
|
|
360
348
|
l?.(e ?? "Selfie verification error");
|
|
361
349
|
}
|
|
362
|
-
}, `selfie-${
|
|
350
|
+
}, `selfie-${h.currentStepIndex}`)
|
|
363
351
|
});
|
|
364
352
|
if (e === "AUTHENTICATION") return /* @__PURE__ */ c("div", {
|
|
365
353
|
class: "IncodeFlow",
|
|
@@ -368,21 +356,21 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
368
356
|
...t,
|
|
369
357
|
authHint: r.authHint
|
|
370
358
|
},
|
|
371
|
-
onFinish: () =>
|
|
359
|
+
onFinish: () => _.completeModule(),
|
|
372
360
|
onError: (e) => {
|
|
373
361
|
l?.(e ?? "Authentication error");
|
|
374
362
|
}
|
|
375
|
-
}, `authentication-${
|
|
363
|
+
}, `authentication-${h.currentStepIndex}`)
|
|
376
364
|
});
|
|
377
365
|
if (e === "PHONE") return /* @__PURE__ */ c("div", {
|
|
378
366
|
class: "IncodeFlow",
|
|
379
367
|
children: /* @__PURE__ */ c(a, {
|
|
380
368
|
config: t,
|
|
381
|
-
onFinish: () =>
|
|
369
|
+
onFinish: () => _.completeModule(),
|
|
382
370
|
onError: (e) => {
|
|
383
371
|
l?.(e ?? "Phone verification error");
|
|
384
372
|
}
|
|
385
|
-
}, `phone-${
|
|
373
|
+
}, `phone-${h.currentStepIndex}`)
|
|
386
374
|
});
|
|
387
375
|
if (e === "EMAIL") {
|
|
388
376
|
let e = t;
|
|
@@ -393,11 +381,11 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
393
381
|
class: "IncodeFlow",
|
|
394
382
|
children: /* @__PURE__ */ c(a, {
|
|
395
383
|
config: e,
|
|
396
|
-
onFinish: () =>
|
|
384
|
+
onFinish: () => _.completeModule(),
|
|
397
385
|
onError: (e) => {
|
|
398
386
|
l?.(e ?? "Email verification error");
|
|
399
387
|
}
|
|
400
|
-
}, `email-${
|
|
388
|
+
}, `email-${h.currentStepIndex}`)
|
|
401
389
|
});
|
|
402
390
|
}
|
|
403
391
|
if (e === "ID" || e === "SECOND_ID") {
|
|
@@ -409,15 +397,15 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
409
397
|
...n,
|
|
410
398
|
isSecondId: !0
|
|
411
399
|
} : n,
|
|
412
|
-
onFinish: () =>
|
|
400
|
+
onFinish: () => _.completeModule(),
|
|
413
401
|
onError: (e) => {
|
|
414
402
|
l?.(e ?? "ID capture error");
|
|
415
403
|
}
|
|
416
|
-
}, `id-${
|
|
404
|
+
}, `id-${h.currentStepIndex}`)
|
|
417
405
|
});
|
|
418
406
|
}
|
|
419
407
|
if (e === "ID_OCR") {
|
|
420
|
-
let e = t, n =
|
|
408
|
+
let e = t, n = h.steps.includes("SECOND_ID");
|
|
421
409
|
return /* @__PURE__ */ c("div", {
|
|
422
410
|
class: "IncodeFlow",
|
|
423
411
|
children: /* @__PURE__ */ c(a, {
|
|
@@ -426,81 +414,81 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
426
414
|
secondId: e.secondId ?? n,
|
|
427
415
|
flowId: i
|
|
428
416
|
},
|
|
429
|
-
onFinish: () =>
|
|
417
|
+
onFinish: () => _.completeModule(),
|
|
430
418
|
onError: (e) => {
|
|
431
419
|
l?.(e ?? "ID OCR error");
|
|
432
420
|
}
|
|
433
|
-
}, `id-ocr-${
|
|
421
|
+
}, `id-ocr-${h.currentStepIndex}`)
|
|
434
422
|
});
|
|
435
423
|
}
|
|
436
424
|
if (e === "CPF_OCR") return /* @__PURE__ */ c("div", {
|
|
437
425
|
class: "IncodeFlow",
|
|
438
426
|
children: /* @__PURE__ */ c(a, {
|
|
439
|
-
onFinish: () =>
|
|
427
|
+
onFinish: () => _.completeModule(),
|
|
440
428
|
onError: (e) => {
|
|
441
429
|
l?.(e ?? "CPF OCR error");
|
|
442
430
|
}
|
|
443
|
-
}, `cpf-ocr-${
|
|
431
|
+
}, `cpf-ocr-${h.currentStepIndex}`)
|
|
444
432
|
});
|
|
445
433
|
if (e === "FACE_MATCH") return /* @__PURE__ */ c("div", {
|
|
446
434
|
class: "IncodeFlow",
|
|
447
435
|
children: /* @__PURE__ */ c(a, {
|
|
448
436
|
config: t,
|
|
449
|
-
onFinish: () =>
|
|
437
|
+
onFinish: () => _.completeModule(),
|
|
450
438
|
onError: (e) => {
|
|
451
439
|
l?.(e ?? "Face match error");
|
|
452
440
|
}
|
|
453
|
-
}, `face-match-${
|
|
441
|
+
}, `face-match-${h.currentStepIndex}`)
|
|
454
442
|
});
|
|
455
443
|
if (e === "CURP_VALIDATION") return /* @__PURE__ */ c("div", {
|
|
456
444
|
class: "IncodeFlow",
|
|
457
445
|
children: /* @__PURE__ */ c(a, {
|
|
458
446
|
config: t,
|
|
459
|
-
onFinish: () =>
|
|
447
|
+
onFinish: () => _.completeModule(),
|
|
460
448
|
onError: (e) => {
|
|
461
449
|
l?.(e ?? "CURP validation error");
|
|
462
450
|
}
|
|
463
|
-
}, `curp-validation-${
|
|
451
|
+
}, `curp-validation-${h.currentStepIndex}`)
|
|
464
452
|
});
|
|
465
453
|
if (e === "GOVT_VALIDATION_PROVISIONING") return /* @__PURE__ */ c("div", {
|
|
466
454
|
class: "IncodeFlow",
|
|
467
455
|
children: /* @__PURE__ */ c(a, {
|
|
468
456
|
config: t,
|
|
469
|
-
onFinish: () =>
|
|
457
|
+
onFinish: () => _.completeModule(),
|
|
470
458
|
onError: (e) => {
|
|
471
459
|
l?.(e ?? "Government validation error");
|
|
472
460
|
}
|
|
473
|
-
}, `govt-validation-${
|
|
461
|
+
}, `govt-validation-${h.currentStepIndex}`)
|
|
474
462
|
});
|
|
475
463
|
if (e === "GEOLOCATION") return /* @__PURE__ */ c("div", {
|
|
476
464
|
class: "IncodeFlow",
|
|
477
465
|
children: /* @__PURE__ */ c(a, {
|
|
478
466
|
config: t,
|
|
479
|
-
onFinish: () =>
|
|
467
|
+
onFinish: () => _.completeModule(),
|
|
480
468
|
onError: (e) => {
|
|
481
469
|
l?.(e ?? "Geolocation error");
|
|
482
470
|
}
|
|
483
|
-
}, `geolocation-${
|
|
471
|
+
}, `geolocation-${h.currentStepIndex}`)
|
|
484
472
|
});
|
|
485
473
|
if (e === "EXTERNAL_VERIFICATION") return /* @__PURE__ */ c("div", {
|
|
486
474
|
class: "IncodeFlow",
|
|
487
475
|
children: /* @__PURE__ */ c(a, {
|
|
488
|
-
config: { flowId:
|
|
489
|
-
onFinish: () =>
|
|
476
|
+
config: { flowId: h.flow.flowId },
|
|
477
|
+
onFinish: () => _.completeModule(),
|
|
490
478
|
onError: (e) => {
|
|
491
479
|
l?.(e ?? "External verification error");
|
|
492
480
|
}
|
|
493
|
-
}, `ekyc-${
|
|
481
|
+
}, `ekyc-${h.currentStepIndex}`)
|
|
494
482
|
});
|
|
495
483
|
if (e === "DOCUMENT_CAPTURE") return /* @__PURE__ */ c("div", {
|
|
496
484
|
class: "IncodeFlow",
|
|
497
485
|
children: /* @__PURE__ */ c(a, {
|
|
498
486
|
config: t,
|
|
499
|
-
onFinish: () =>
|
|
487
|
+
onFinish: () => _.completeModule(),
|
|
500
488
|
onError: (e) => {
|
|
501
489
|
l?.(e ?? "Document capture error");
|
|
502
490
|
}
|
|
503
|
-
}, `document-capture-${
|
|
491
|
+
}, `document-capture-${h.currentStepIndex}`)
|
|
504
492
|
});
|
|
505
493
|
if (e === "ADDRESS") return /* @__PURE__ */ c("div", {
|
|
506
494
|
class: "IncodeFlow",
|
|
@@ -509,21 +497,21 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
509
497
|
...t,
|
|
510
498
|
processingType: "addressStatement"
|
|
511
499
|
},
|
|
512
|
-
onFinish: () =>
|
|
500
|
+
onFinish: () => _.completeModule(),
|
|
513
501
|
onError: (e) => {
|
|
514
502
|
l?.(e ?? "Address capture error");
|
|
515
503
|
}
|
|
516
|
-
}, `address-${
|
|
504
|
+
}, `address-${h.currentStepIndex}`)
|
|
517
505
|
});
|
|
518
506
|
if (e === "SIGNATURE") return /* @__PURE__ */ c("div", {
|
|
519
507
|
class: "IncodeFlow",
|
|
520
508
|
children: /* @__PURE__ */ c(a, {
|
|
521
509
|
config: t,
|
|
522
|
-
onFinish: () =>
|
|
510
|
+
onFinish: () => _.completeModule(),
|
|
523
511
|
onError: (e) => {
|
|
524
512
|
l?.(e ?? "Signature capture error");
|
|
525
513
|
}
|
|
526
|
-
}, `signature-${
|
|
514
|
+
}, `signature-${h.currentStepIndex}`)
|
|
527
515
|
});
|
|
528
516
|
if (e === "EKYB") {
|
|
529
517
|
let e = t;
|
|
@@ -537,32 +525,32 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
537
525
|
checkTaxId: e.checkTaxId,
|
|
538
526
|
checkUniqueBeneficialOwner: e.checkUniqueBeneficialOwner
|
|
539
527
|
},
|
|
540
|
-
onFinish: () =>
|
|
528
|
+
onFinish: () => _.completeModule(),
|
|
541
529
|
onError: (e) => {
|
|
542
530
|
l?.(e ?? "eKYB verification error");
|
|
543
531
|
}
|
|
544
|
-
}, `ekyb-${
|
|
532
|
+
}, `ekyb-${h.currentStepIndex}`)
|
|
545
533
|
});
|
|
546
534
|
}
|
|
547
535
|
if (e === "COMBINED_CONSENT") return /* @__PURE__ */ c("div", {
|
|
548
536
|
class: "IncodeFlow",
|
|
549
537
|
children: /* @__PURE__ */ c(a, {
|
|
550
538
|
config: t,
|
|
551
|
-
onFinish: () =>
|
|
539
|
+
onFinish: () => _.completeModule(),
|
|
552
540
|
onError: (e) => {
|
|
553
541
|
l?.(e ?? "Combined consent error");
|
|
554
542
|
}
|
|
555
|
-
}, `combined-consent-${
|
|
543
|
+
}, `combined-consent-${h.currentStepIndex}`)
|
|
556
544
|
});
|
|
557
545
|
if (e === "MANDATORY_CONSENT") return /* @__PURE__ */ c("div", {
|
|
558
546
|
class: "IncodeFlow",
|
|
559
547
|
children: /* @__PURE__ */ c(a, {
|
|
560
548
|
config: t,
|
|
561
|
-
onFinish: () =>
|
|
549
|
+
onFinish: () => _.completeModule(),
|
|
562
550
|
onError: (e) => {
|
|
563
551
|
l?.(e ?? "Mandatory consent error");
|
|
564
552
|
}
|
|
565
|
-
}, `mandatory-consent-${
|
|
553
|
+
}, `mandatory-consent-${h.currentStepIndex}`)
|
|
566
554
|
});
|
|
567
555
|
if (e === "AE_SIGNATURE" || e === "QE_SIGNATURE") {
|
|
568
556
|
let n = t, r = e === "QE_SIGNATURE" ? "qe" : "ae";
|
|
@@ -573,68 +561,68 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
573
561
|
uploadDocument: n.uploadDocument,
|
|
574
562
|
downloadDocument: n.downloadDocument
|
|
575
563
|
},
|
|
576
|
-
onFinish: () =>
|
|
564
|
+
onFinish: () => _.completeModule(),
|
|
577
565
|
onError: (e) => {
|
|
578
566
|
l?.(e ?? `${r.toUpperCase()} Signature error`);
|
|
579
567
|
}
|
|
580
|
-
}, `${r}-signature-${
|
|
568
|
+
}, `${r}-signature-${h.currentStepIndex}`)
|
|
581
569
|
});
|
|
582
570
|
}
|
|
583
571
|
if (e === "ANTIFRAUD") return /* @__PURE__ */ c("div", {
|
|
584
572
|
class: "IncodeFlow",
|
|
585
573
|
children: /* @__PURE__ */ c(a, {
|
|
586
|
-
onFinish: () =>
|
|
574
|
+
onFinish: () => _.completeModule(),
|
|
587
575
|
onError: (e) => {
|
|
588
576
|
l?.(e ?? "Antifraud check error");
|
|
589
577
|
}
|
|
590
|
-
}, `antifraud-${
|
|
578
|
+
}, `antifraud-${h.currentStepIndex}`)
|
|
591
579
|
});
|
|
592
580
|
if (e === "CUSTOM_FIELDS") return /* @__PURE__ */ c("div", {
|
|
593
581
|
class: "IncodeFlow",
|
|
594
582
|
children: /* @__PURE__ */ c(a, {
|
|
595
583
|
config: t,
|
|
596
|
-
onFinish: () =>
|
|
584
|
+
onFinish: () => _.completeModule(),
|
|
597
585
|
onError: (e) => {
|
|
598
586
|
l?.(e ?? "Custom fields error");
|
|
599
587
|
}
|
|
600
|
-
}, `custom-fields-${
|
|
588
|
+
}, `custom-fields-${h.currentStepIndex}`)
|
|
601
589
|
});
|
|
602
590
|
if (e === "WATCHLIST") return /* @__PURE__ */ c("div", {
|
|
603
591
|
class: "IncodeFlow",
|
|
604
592
|
children: /* @__PURE__ */ c(a, {
|
|
605
|
-
onFinish: () =>
|
|
593
|
+
onFinish: () => _.completeModule(),
|
|
606
594
|
onError: (e) => {
|
|
607
595
|
l?.(e ?? "Watchlist check error");
|
|
608
596
|
}
|
|
609
|
-
}, `watchlist-${
|
|
597
|
+
}, `watchlist-${h.currentStepIndex}`)
|
|
610
598
|
});
|
|
611
599
|
if (e === "WATCHLIST_BUSINESS") return /* @__PURE__ */ c("div", {
|
|
612
600
|
class: "IncodeFlow",
|
|
613
601
|
children: /* @__PURE__ */ c(a, {
|
|
614
|
-
onFinish: () =>
|
|
602
|
+
onFinish: () => _.completeModule(),
|
|
615
603
|
onError: (e) => {
|
|
616
604
|
l?.(e ?? "Watchlist for business check error");
|
|
617
605
|
}
|
|
618
|
-
}, `watchlist-for-business-${
|
|
606
|
+
}, `watchlist-for-business-${h.currentStepIndex}`)
|
|
619
607
|
});
|
|
620
608
|
if (e === "INCODE_WATCHLIST") return /* @__PURE__ */ c("div", {
|
|
621
609
|
class: "IncodeFlow",
|
|
622
610
|
children: /* @__PURE__ */ c(a, {
|
|
623
611
|
config: t,
|
|
624
|
-
onFinish: () =>
|
|
612
|
+
onFinish: () => _.completeModule(),
|
|
625
613
|
onError: (e) => {
|
|
626
614
|
l?.(e ?? "Custom watchlist check error");
|
|
627
615
|
}
|
|
628
|
-
}, `incode-watchlist-${
|
|
616
|
+
}, `incode-watchlist-${h.currentStepIndex}`)
|
|
629
617
|
});
|
|
630
618
|
if (e === "CROSS_DOCUMENT_DATA_MATCH") return /* @__PURE__ */ c("div", {
|
|
631
619
|
class: "IncodeFlow",
|
|
632
620
|
children: /* @__PURE__ */ c(a, {
|
|
633
|
-
onFinish: () =>
|
|
621
|
+
onFinish: () => _.completeModule(),
|
|
634
622
|
onError: (e) => {
|
|
635
623
|
l?.(e ?? "Cross document data match error");
|
|
636
624
|
}
|
|
637
|
-
}, `cross-document-data-match-${
|
|
625
|
+
}, `cross-document-data-match-${h.currentStepIndex}`)
|
|
638
626
|
});
|
|
639
627
|
if (e === "DYNAMIC_FORMS") return /* @__PURE__ */ c("div", {
|
|
640
628
|
class: "IncodeFlow",
|
|
@@ -652,19 +640,19 @@ var J = r(() => import("../homeScreen-CqWZqT00.js").then((e) => ({ default: e.Ho
|
|
|
652
640
|
options: e.options
|
|
653
641
|
}))
|
|
654
642
|
})) },
|
|
655
|
-
onFinish: () =>
|
|
643
|
+
onFinish: () => _.completeModule(),
|
|
656
644
|
onError: (e) => {
|
|
657
645
|
l?.(e ?? "Dynamic forms error");
|
|
658
646
|
}
|
|
659
|
-
}, `dynamic-forms-${
|
|
647
|
+
}, `dynamic-forms-${h.currentStepIndex}`)
|
|
660
648
|
});
|
|
661
649
|
}
|
|
662
650
|
return null;
|
|
663
|
-
},
|
|
651
|
+
}, J = ({ config: e, onFinish: t = () => {}, onError: n }) => /* @__PURE__ */ c(d, { children: e ? /* @__PURE__ */ c(q, {
|
|
664
652
|
config: e,
|
|
665
653
|
onFinish: t,
|
|
666
654
|
onError: n
|
|
667
655
|
}) : null });
|
|
668
|
-
p(
|
|
656
|
+
p(J, "incode-flow");
|
|
669
657
|
//#endregion
|
|
670
|
-
export {
|
|
658
|
+
export { J as IncodeFlow, B as preloadIncodeFlow };
|