@incodetech/web 0.0.0-dev-20260608-c8c427ca → 0.0.0-dev-20260609-11ba3e8a
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/ae-signature/ae-signature.es.js +15 -13
- package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
- package/dist/antifraud/antifraud.es.js +22 -19
- package/dist/authentication/authentication.es.js +42 -33
- package/dist/autoFocusTitle-DM6PvgcP.js +29 -0
- package/dist/{back-horizontal-hint-DsPhKbR4.js → back-horizontal-hint-BXYix0Wj.js} +26 -26
- package/dist/back-tutorial-vb1MxlrT.js +14597 -0
- package/dist/{back-vertical-hint-BFJbYQrX.js → back-vertical-hint-DNSh6JNH.js} +27 -27
- package/dist/backdevicelottie-HypPqBz7.js +16690 -0
- package/dist/base.css +5 -0
- package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
- package/dist/bottomSheet-BuzqNQtG.js +39 -0
- package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
- package/dist/button-B-qlr4iI.js +35 -0
- package/dist/checkbox-CTPETqo5.js +96 -0
- package/dist/consent/consent.es.js +75 -64
- package/dist/countrySelector-CzyuaDIs.js +60 -0
- package/dist/cpf-ocr/cpf-ocr.es.js +2 -2
- package/dist/cpfOcr-DQVs3r8N.js +92 -0
- package/dist/cpfOcr-WNklFuxT.js +2 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -17
- package/dist/curp-validation/curp-validation.es.js +246 -211
- package/dist/customFields-B4MqqDI6.js +140 -0
- package/dist/customWatchlist-Dfqw1DQP.js +36 -0
- package/dist/dateInputComposed-BsPQHG5o.js +1 -0
- package/dist/dateInputComposed-DY97tQVK.js +69 -0
- package/dist/defineProperty-mefzVtTv.js +39 -0
- package/dist/document-capture/document-capture.es.js +2 -2
- package/dist/documentCapture-BE78MIlR.js +876 -0
- package/dist/documentCapture-BVfNZL29.js +2 -0
- package/dist/dropdownComposed-BF4L-7mJ.js +380 -0
- package/dist/dropdownComposed-mvHuRFHn.js +1 -0
- package/dist/dynamicForms-BYGGAQoc.js +352 -0
- package/dist/ekyb/ekyb.es.js +2 -2
- package/dist/ekybModule-BUPX0QhW.js +2 -0
- package/dist/ekybModule-CkTXu-4u.js +279 -0
- package/dist/ekyc/ekyc.es.js +2 -2
- package/dist/ekycModule-BWsVX39d.js +257 -0
- package/dist/ekycModule-DNDPqvUc.js +2 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -2
- package/dist/electronic-signature-BJSyzex9.js +426 -0
- package/dist/email/email.es.js +198 -78
- package/dist/emailInput-BHp4Apt4.js +39 -0
- package/dist/errorIcon-B0rmz3rw.js +26 -0
- package/dist/expiredId-C105HVKv.js +85 -0
- package/dist/extensibility-DJwVxojG.js +3070 -0
- package/dist/extensibility.es.js +26 -26
- package/dist/face-match/face-match.es.js +2 -2
- package/dist/faceMatch-BOFGxzzx.js +343 -0
- package/dist/faceMatch-CDMcFQwR.js +2 -0
- package/dist/field-comparison/field-comparison.es.js +2 -2
- package/dist/fieldComparison-BMDmQ8eA.js +88 -0
- package/dist/fieldComparison-Z1NleSxD.js +2 -0
- package/dist/{flip-animation-CuQ57qTn.js → flip-animation-BGRvygw9.js} +4221 -4221
- package/dist/flow/flow.es.js +597 -493
- package/dist/flow/styles.css +0 -8
- package/dist/{front-horizontal-hint-CKm7PnmS.js → front-horizontal-hint-CLSU0iVo.js} +70 -70
- package/dist/{front-vertical-hint-CLHC2qoH.js → front-vertical-hint-BWq-yWQ8.js} +81 -81
- package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
- package/dist/geolocation/geolocation.es.js +485 -395
- package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
- package/dist/governmentValidation/governmentValidation.es.js +145 -64
- package/dist/governmentValidation/styles.css +0 -36
- package/dist/homeScreen-BsEYyiDB.js +264 -0
- package/dist/hooks-BtgmGvba.js +149 -0
- package/dist/i18n-gTHArCl9.js +2971 -0
- package/dist/icons-DKY3xDkf.js +360 -0
- package/dist/id/id.es.js +565 -413
- package/dist/id-laser-h-DX8UbVNH.js +467 -0
- package/dist/id-laser-v-DhnHdjlB.js +490 -0
- package/dist/id-tutorial-lj4iKtYT.js +13165 -0
- package/dist/id-verification/id-verification.es.js +21 -18
- package/dist/idOcr-BS77o1VC.js +123 -0
- package/dist/identity-reuse/identity-reuse.es.js +168 -130
- package/dist/incode-logo-57XFniXU.js +4 -0
- package/dist/incodeComponent-CDJxFZvS.js +63 -0
- package/dist/incodeModule-DkA_yd0X.js +13 -0
- package/dist/index.es.js +16 -14
- package/dist/inputComposed-5V2nLTqH.js +99 -0
- package/dist/inputComposed-BPOYwUBl.js +1 -0
- package/dist/loadingIcon-DN62ugKs.js +148 -0
- package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
- package/dist/mandatoryConsent-DP189TUn.js +107 -0
- package/dist/modal-B5QeulDu.js +153 -0
- package/dist/modal.hooks-C7K9k_pY.js +202 -0
- package/dist/numberedStep-DVAyTPv1.js +13 -0
- package/dist/optionAccessibleLabel-Czc2YC8z.js +202 -0
- package/dist/otpInput-2IQ-JCK8.js +195 -0
- package/dist/page-BZ-0eNWq.js +71 -0
- package/dist/{passport-horizontal-hint-C_le0HVU.js → passport-horizontal-hint-DfVsf4Cc.js} +55 -55
- package/dist/{passport-tutorial-BYN4T_TE.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
- package/dist/{passport-vertical-hint-H-pyICSv.js → passport-vertical-hint-DVxbTyQp.js} +49 -49
- package/dist/pdf-BZA70WbM.js +22398 -0
- package/dist/pdfViewer-Dr63sJ51.js +114 -0
- package/dist/phone/phone.es.js +214 -87
- package/dist/phoneInputComposed-D_IabWKJ.js +12142 -0
- package/dist/processing-B_u8wUB7.js +8 -0
- package/dist/qe-signature/qe-signature.es.js +15 -13
- package/dist/radioGroupComposed-DwYW-Ld-.js +215 -0
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2099 -859
- package/dist/registerIncodeElement-BJJGzVdq.js +11 -0
- package/dist/requiredLabelHint-DEadtiwx.js +17 -0
- package/dist/richText-C7GUm0WL.js +3153 -0
- package/dist/rolldown-runtime--E5BIlTp.js +33 -0
- package/dist/selfie/selfie.es.js +54 -42
- package/dist/selfieTutorial-CtruLyO2.js +2689 -0
- package/dist/signature/signature.es.js +765 -406
- package/dist/snackbar-Dz9crm39.js +16 -0
- package/dist/spinner-BfBIZkDQ.js +42 -0
- package/dist/spinner-DEDtE7Pz.js +1 -0
- package/dist/statusPage-CVCoieyd.js +28 -0
- package/dist/successIcon-rmzr-pxu.js +30 -0
- package/dist/tabs--UMd6eEB.js +103 -0
- package/dist/transitionSpinner-CWhGcr7c.js +26 -0
- package/dist/{tutorial-QzQ536BL.js → tutorial-Jv0noW4z.js} +832 -578
- package/dist/types/extensibility.d.ts +3 -1
- package/dist/types/index.d.ts +13 -4
- package/dist/typography-BK4AmfKX.js +45 -0
- package/dist/uiConfig-sgEkFuuA.js +25 -0
- package/dist/useModuleLoader-CuhHtmgr.js +670 -0
- package/dist/vendor-preact-BH7vOa2r.js +957 -0
- package/dist/verificationResult-CJ0JyV6A.js +64 -0
- package/dist/verifiedByIncode-8QBn-kgZ.js +103 -0
- package/dist/watchlist/watchlist.es.js +31 -26
- package/dist/watchlistForBusiness-RZcnjVDb.js +80 -0
- package/dist/workflow/styles.css +0 -8
- package/dist/workflow/workflow.es.js +251 -209
- package/package.json +4 -2
- package/dist/aligndevicelottie-D8KsO77t.js +0 -12757
- package/dist/autoFocusTitle-BpYdaSUM.js +0 -16
- package/dist/back-tutorial-DhSE2FJo.js +0 -14585
- package/dist/backdevicelottie-CJWGVMdw.js +0 -16678
- package/dist/blurdevicelottie-Dxt2deEB.js +0 -15939
- package/dist/bottomSheet-QrpyatOD.js +0 -31
- package/dist/browser-ponyfill-Crda_c5R.js +0 -299
- package/dist/button-DcCUEn2n.js +0 -24
- package/dist/checkbox-DCCzBAuF.js +0 -86
- package/dist/countrySelector-CJ8egQ4C.js +0 -58
- package/dist/cpfOcr-Db06i-Lm.js +0 -2
- package/dist/cpfOcr-FixhUeMQ.js +0 -79
- package/dist/customFields-C1G9xHNX.js +0 -125
- package/dist/customWatchlist-IKEblz7u.js +0 -31
- package/dist/dateInputComposed-Cg8BvYSK.js +0 -1
- package/dist/dateInputComposed-Ddd7HLyM.js +0 -58
- package/dist/defineProperty-xczUyn-m.js +0 -39
- package/dist/documentCapture-D9I7FjGe.js +0 -2
- package/dist/documentCapture-b61wlala.js +0 -765
- package/dist/dropdownComposed-B4U0AIak.js +0 -1
- package/dist/dropdownComposed-CS2pyn-g.js +0 -293
- package/dist/dynamicForms-tYQog0kw.js +0 -298
- package/dist/ekybModule-C33C4JES.js +0 -237
- package/dist/ekybModule-LON6G2Bz.js +0 -2
- package/dist/ekycModule-BJOgtTAh.js +0 -225
- package/dist/ekycModule-BSf_DIG7.js +0 -2
- package/dist/electronic-signature-OdgTyso4.js +0 -406
- package/dist/emailInput-CU7mLB21.js +0 -37
- package/dist/errorIcon-DpHzAoAo.js +0 -24
- package/dist/expiredId-nfVAZgTL.js +0 -70
- package/dist/extensibility-BbNy3mVG.js +0 -2602
- package/dist/faceMatch-BIila4kf.js +0 -2
- package/dist/faceMatch-DJ7Mqujx.js +0 -206
- package/dist/fieldComparison-D2RSFYl-.js +0 -84
- package/dist/fieldComparison-DbUyouFd.js +0 -2
- package/dist/frontdevicelottie-65Vyfpff.js +0 -17302
- package/dist/glaredevicelottie-BEyaqtc6.js +0 -14466
- package/dist/homeScreen-CyPddxWl.js +0 -227
- package/dist/hooks-MxHtZWTS.js +0 -112
- package/dist/i18n-Kzzvkz94.js +0 -2019
- package/dist/icons-9I5g9-_1.js +0 -292
- package/dist/id-laser-h-iCPbFixz.js +0 -467
- package/dist/id-laser-v-CNzwliP2.js +0 -483
- package/dist/id-tutorial-CF4nO4oX.js +0 -13153
- package/dist/idOcr-DlMLMDqa.js +0 -97
- package/dist/incode-logo-DX016usY.js +0 -4
- package/dist/incodeComponent-BoFhgK7G.js +0 -50
- package/dist/incodeModule-BiCoAJ5k.js +0 -13
- package/dist/inputComposed-DAEey9xm.js +0 -94
- package/dist/inputComposed-eS4B0Mkh.js +0 -1
- package/dist/loadingIcon-BN5YRQUb.js +0 -104
- package/dist/lottie_light-DLqSnziX.js +0 -4419
- package/dist/mandatoryConsent-DNz2jZ43.js +0 -98
- package/dist/modal-ZqAhwiRF.js +0 -135
- package/dist/modal.hooks-LdusROLW.js +0 -126
- package/dist/numberedStep-CdLWASwL.js +0 -11
- package/dist/optionAccessibleLabel-DcygPaME.js +0 -140
- package/dist/otpInput-C4pk4BJU.js +0 -157
- package/dist/page-DA3R7q0J.js +0 -69
- package/dist/pdf-51QeiFSx.js +0 -14967
- package/dist/pdfViewer-rKzTHket.js +0 -64
- package/dist/phoneInputComposed-CjAxk2Gj.js +0 -11230
- package/dist/processing-DPktVde2.js +0 -6
- package/dist/radioGroupComposed-DRRxVk9Z.js +0 -178
- package/dist/registerIncodeElement-BHWOwdSS.js +0 -7
- package/dist/requiredLabelHint-B6FN3v88.js +0 -13
- package/dist/richText-6pIbydcz.js +0 -1973
- package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
- package/dist/selfieTutorial-Yo9AlUoT.js +0 -2677
- package/dist/snackbar-CQiiWO4p.js +0 -14
- package/dist/spinner-B4dcie2T.js +0 -1
- package/dist/spinner-CKnjVHxw.js +0 -39
- package/dist/statusPage-B8b3Jg6N.js +0 -28
- package/dist/successIcon-SlKgTSty.js +0 -28
- package/dist/tabs-D7lGst3Q.js +0 -78
- package/dist/transitionSpinner-Di3bOyOu.js +0 -17
- package/dist/typography-CxjaknHN.js +0 -28
- package/dist/uiConfig-CwpQ-IM6.js +0 -20
- package/dist/useModuleLoader-Bqs7fglI.js +0 -517
- package/dist/vendor-preact-D6SntenC.js +0 -958
- package/dist/verificationResult-DhT3hH1b.js +0 -90
- package/dist/verifiedByIncode-DpbxzO0y.js +0 -101
- package/dist/watchlistForBusiness-CRXVbH4l.js +0 -75
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,683 +1,787 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { t as
|
|
4
|
-
import { c as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { getDeviceClass
|
|
10
|
-
import { getRequiredWasmPipelines
|
|
11
|
-
import { bootstrapSession
|
|
1
|
+
import { n as useTranslation, o as readStoredLanguage } from "../i18n-gTHArCl9.js";
|
|
2
|
+
import { _ as y, c as z, d as T, l as A, o as P, p as d, v as u } from "../vendor-preact-BH7vOa2r.js";
|
|
3
|
+
import { t as setUiConfig } from "../uiConfig-sgEkFuuA.js";
|
|
4
|
+
import { c as useManager } from "../hooks-BtgmGvba.js";
|
|
5
|
+
import { t as IncodeComponent } from "../incodeComponent-CDJxFZvS.js";
|
|
6
|
+
import { t as TransitionSpinner } from "../transitionSpinner-CWhGcr7c.js";
|
|
7
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-DkA_yd0X.js";
|
|
8
|
+
import { _ as warmupWasmIfNeeded, a as resolveApiKey, c as HEADLESS_FLOW_MODULE_KEYS, d as fetchTheme, f as initializeFlowManager, h as preloadRedirectToMobile, l as LAZY_UI_MODULES, m as preloadHomeScreen, n as useModulePreloader, o as extractIncodeStatus, p as preloadFirstModule, r as usePrefetchNextModule, s as UnsupportedModule, t as useModuleLoader, u as createFlowManager, y as TerminalErrorPage } from "../useModuleLoader-CuhHtmgr.js";
|
|
9
|
+
import { getDeviceClass } from "@incodetech/core/device";
|
|
10
|
+
import { getRequiredWasmPipelines } from "@incodetech/core/flow";
|
|
11
|
+
import { bootstrapSession, refreshQrUrlUuid } from "@incodetech/core/session";
|
|
12
12
|
//#region src/shared/processing/useDelayedFlag.ts
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Returns `true` only once `isTrue` has stayed `true` continuously for
|
|
15
|
+
* `delayMs`. Resets to `false` immediately when `isTrue` flips back.
|
|
16
|
+
*
|
|
17
|
+
* Useful to suppress transient loading indicators when an operation
|
|
18
|
+
* completes faster than the given threshold.
|
|
19
|
+
*/
|
|
20
|
+
function useDelayedFlag(isTrue, delayMs) {
|
|
21
|
+
const [delayed, setDelayed] = d(false);
|
|
22
|
+
y(() => {
|
|
23
|
+
if (isTrue === false) {
|
|
24
|
+
setDelayed(false);
|
|
18
25
|
return;
|
|
19
26
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
27
|
+
const timeoutId = window.setTimeout(() => {
|
|
28
|
+
setDelayed(true);
|
|
29
|
+
}, delayMs);
|
|
23
30
|
return () => {
|
|
24
|
-
window.clearTimeout(
|
|
31
|
+
window.clearTimeout(timeoutId);
|
|
25
32
|
};
|
|
26
|
-
}, [
|
|
33
|
+
}, [isTrue, delayMs]);
|
|
34
|
+
return delayed;
|
|
27
35
|
}
|
|
28
36
|
//#endregion
|
|
29
37
|
//#region src/modules/flow/createFlowSession.ts
|
|
30
|
-
async function
|
|
31
|
-
return
|
|
32
|
-
configurationId:
|
|
33
|
-
externalId:
|
|
34
|
-
externalCustomerId:
|
|
35
|
-
language:
|
|
36
|
-
customFields:
|
|
37
|
-
uuid:
|
|
38
|
-
urlUuid:
|
|
39
|
-
interviewId:
|
|
40
|
-
loginHint:
|
|
41
|
-
onUrlUuidRefreshed:
|
|
42
|
-
},
|
|
38
|
+
async function createFlowSession(config, signal) {
|
|
39
|
+
return bootstrapSession(await resolveApiKey(config), {
|
|
40
|
+
configurationId: config.configurationId,
|
|
41
|
+
externalId: config.externalId,
|
|
42
|
+
externalCustomerId: config.externalCustomerId,
|
|
43
|
+
language: config.lang,
|
|
44
|
+
customFields: config.customFields,
|
|
45
|
+
uuid: config.uuid,
|
|
46
|
+
urlUuid: config.urlUuid,
|
|
47
|
+
interviewId: config.interviewId,
|
|
48
|
+
loginHint: config.loginHint,
|
|
49
|
+
onUrlUuidRefreshed: config.onUrlUuidRefreshed
|
|
50
|
+
}, signal);
|
|
43
51
|
}
|
|
44
52
|
//#endregion
|
|
45
53
|
//#region src/modules/flow/flowConfig.ts
|
|
46
|
-
function
|
|
47
|
-
return typeof
|
|
54
|
+
function hasFlowToken(config) {
|
|
55
|
+
return typeof config.token === "string";
|
|
48
56
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
return typeof
|
|
57
|
+
function isSelfLoadingFlowConfig(config) {
|
|
58
|
+
const bootstrapConfig = config;
|
|
59
|
+
return typeof bootstrapConfig.configurationId === "string" && (typeof bootstrapConfig.apiKey === "string" || typeof bootstrapConfig.clientId === "string");
|
|
52
60
|
}
|
|
53
61
|
//#endregion
|
|
54
62
|
//#region src/modules/flow/preloadFlow.ts
|
|
55
|
-
var
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
if (!
|
|
63
|
+
var preloadCache = /* @__PURE__ */ new Map();
|
|
64
|
+
function createPreloadHandle(token) {
|
|
65
|
+
const state = preloadCache.get(token);
|
|
66
|
+
if (!state) throw new Error("Preload state not found");
|
|
59
67
|
return {
|
|
60
68
|
get isReady() {
|
|
61
|
-
return
|
|
69
|
+
return state.status === "ready";
|
|
62
70
|
},
|
|
63
71
|
get error() {
|
|
64
|
-
return
|
|
72
|
+
return state.status === "error" ? state.error ?? null : null;
|
|
65
73
|
},
|
|
66
74
|
async waitUntilReady() {
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
75
|
+
if (state.status === "ready") return;
|
|
76
|
+
if (state.status === "error") throw new Error(state.error ?? "Preload failed");
|
|
77
|
+
return state.readyPromise;
|
|
71
78
|
},
|
|
72
79
|
cancel() {
|
|
73
|
-
|
|
80
|
+
if (state.status === "loading") {
|
|
81
|
+
if (state.unsubscribe) state.unsubscribe();
|
|
82
|
+
state.flowManager.stop();
|
|
83
|
+
state.readyReject(/* @__PURE__ */ new Error("Preload cancelled"));
|
|
84
|
+
preloadCache.delete(token);
|
|
85
|
+
}
|
|
74
86
|
}
|
|
75
87
|
};
|
|
76
88
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
function preloadIncodeFlow(config) {
|
|
90
|
+
const { token } = config;
|
|
91
|
+
if (config.urlUuid) throw new Error("preloadIncodeFlow does not support urlUuid; pass it to <IncodeFlow> directly so the SDK can rotate it on mount.");
|
|
92
|
+
if (preloadCache.has(token)) return createPreloadHandle(token);
|
|
93
|
+
let readyResolve;
|
|
94
|
+
let readyReject;
|
|
95
|
+
const readyPromise = new Promise((resolve, reject) => {
|
|
96
|
+
readyResolve = resolve;
|
|
97
|
+
readyReject = reject;
|
|
98
|
+
});
|
|
99
|
+
const flowManager = createFlowManager(config);
|
|
100
|
+
if (flowManager.getState().presentation.shouldPrefetchHome) preloadHomeScreen();
|
|
101
|
+
const state = {
|
|
86
102
|
status: "loading",
|
|
87
|
-
flowManager
|
|
88
|
-
config
|
|
89
|
-
readyPromise
|
|
90
|
-
readyResolve
|
|
91
|
-
readyReject
|
|
103
|
+
flowManager,
|
|
104
|
+
config,
|
|
105
|
+
readyPromise,
|
|
106
|
+
readyResolve,
|
|
107
|
+
readyReject
|
|
92
108
|
};
|
|
93
|
-
|
|
109
|
+
preloadCache.set(token, state);
|
|
110
|
+
const preload = async () => {
|
|
94
111
|
try {
|
|
95
|
-
await
|
|
96
|
-
token:
|
|
97
|
-
lang:
|
|
98
|
-
flowManager
|
|
112
|
+
await initializeFlowManager({
|
|
113
|
+
token: config.token,
|
|
114
|
+
lang: config.lang,
|
|
115
|
+
flowManager
|
|
99
116
|
});
|
|
100
|
-
|
|
101
|
-
|
|
117
|
+
const themePromise = config.disableDashboardTheme ? Promise.resolve({}) : fetchTheme().then((result) => {
|
|
118
|
+
state.theme = result.theme;
|
|
119
|
+
state.uiConfig = result.uiConfig;
|
|
120
|
+
});
|
|
121
|
+
state.unsubscribe = flowManager.subscribe((managerState) => {
|
|
122
|
+
if (managerState.status === "ready") {
|
|
123
|
+
const readyState = managerState;
|
|
124
|
+
warmupWasmIfNeeded(readyState, config.wasmConfig);
|
|
125
|
+
preloadFirstModule(readyState);
|
|
126
|
+
state.unsubscribe?.();
|
|
127
|
+
state.unsubscribe = void 0;
|
|
128
|
+
state.status = "ready";
|
|
129
|
+
state.readyResolve();
|
|
130
|
+
} else if (managerState.status === "error") {
|
|
131
|
+
state.unsubscribe?.();
|
|
132
|
+
state.unsubscribe = void 0;
|
|
133
|
+
state.status = "error";
|
|
134
|
+
state.error = managerState.error;
|
|
135
|
+
state.readyReject(new Error(managerState.error));
|
|
136
|
+
}
|
|
102
137
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} catch (e) {
|
|
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);
|
|
138
|
+
await themePromise;
|
|
139
|
+
} catch (error) {
|
|
140
|
+
state.status = "error";
|
|
141
|
+
state.error = error instanceof Error ? error.message : "Failed to preload";
|
|
142
|
+
state.readyReject(error instanceof Error ? error : /* @__PURE__ */ new Error("Failed to preload"));
|
|
143
|
+
preloadCache.delete(token);
|
|
111
144
|
}
|
|
112
|
-
}
|
|
145
|
+
};
|
|
146
|
+
preload();
|
|
147
|
+
return createPreloadHandle(token);
|
|
113
148
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
149
|
+
function getPreloadedData(token) {
|
|
150
|
+
return preloadCache.get(token) ?? null;
|
|
116
151
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
152
|
+
function consumePreloadedData(token) {
|
|
153
|
+
const state = getPreloadedData(token);
|
|
154
|
+
if (state) preloadCache.delete(token);
|
|
155
|
+
return state;
|
|
120
156
|
}
|
|
121
157
|
//#endregion
|
|
122
158
|
//#region src/modules/flow/useFlowInitialization.ts
|
|
123
|
-
function
|
|
124
|
-
|
|
159
|
+
function maybePreloadHomeScreen(flowManager) {
|
|
160
|
+
if (flowManager.getState().presentation.shouldPrefetchHome) preloadHomeScreen();
|
|
125
161
|
}
|
|
126
|
-
function
|
|
127
|
-
|
|
162
|
+
function maybePreloadRedirectToMobile() {
|
|
163
|
+
if (getDeviceClass() === "desktop") preloadRedirectToMobile();
|
|
128
164
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
165
|
+
function useFlowInitialization(options) {
|
|
166
|
+
const { lang, disableDashboardTheme, enableHome, onError, useCPF } = options;
|
|
167
|
+
const token = hasFlowToken(options) ? options.token : void 0;
|
|
168
|
+
const flowManagerRef = A(null);
|
|
169
|
+
const [state, setState] = d(() => {
|
|
170
|
+
const preloaded = token ? getPreloadedData(token) : null;
|
|
171
|
+
if (token) {
|
|
172
|
+
if (preloaded?.status === "ready") {
|
|
173
|
+
const consumed = consumePreloadedData(token);
|
|
174
|
+
if (consumed) {
|
|
175
|
+
flowManagerRef.current = consumed.flowManager;
|
|
176
|
+
maybePreloadHomeScreen(consumed.flowManager);
|
|
177
|
+
maybePreloadRedirectToMobile();
|
|
178
|
+
if (consumed.uiConfig) setUiConfig(consumed.uiConfig);
|
|
179
|
+
return {
|
|
180
|
+
status: "ready",
|
|
181
|
+
flowManager: consumed.flowManager
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
138
185
|
}
|
|
139
|
-
|
|
140
|
-
authHint:
|
|
141
|
-
lang:
|
|
142
|
-
enableHome:
|
|
143
|
-
useCPF:
|
|
186
|
+
const flowManager = createFlowManager({
|
|
187
|
+
authHint: options.authHint,
|
|
188
|
+
lang: options.lang,
|
|
189
|
+
enableHome: options.enableHome,
|
|
190
|
+
useCPF: options.useCPF
|
|
144
191
|
});
|
|
145
|
-
|
|
192
|
+
flowManagerRef.current = flowManager;
|
|
193
|
+
maybePreloadHomeScreen(flowManager);
|
|
194
|
+
maybePreloadRedirectToMobile();
|
|
195
|
+
if (preloaded?.status === "error") return {
|
|
146
196
|
status: "error",
|
|
147
|
-
error:
|
|
148
|
-
flowManager
|
|
149
|
-
}
|
|
197
|
+
error: preloaded.error ?? "Preload failed",
|
|
198
|
+
flowManager
|
|
199
|
+
};
|
|
200
|
+
return {
|
|
150
201
|
status: "initializing",
|
|
151
|
-
flowManager
|
|
202
|
+
flowManager
|
|
152
203
|
};
|
|
153
|
-
})
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
204
|
+
});
|
|
205
|
+
const initStartedRef = A(false);
|
|
206
|
+
y(() => {
|
|
207
|
+
if (state.status !== "initializing") return;
|
|
208
|
+
const preloaded = token ? getPreloadedData(token) : null;
|
|
209
|
+
if (token && preloaded?.status === "loading") {
|
|
210
|
+
preloaded.readyPromise.then(() => {
|
|
211
|
+
const consumed = consumePreloadedData(token);
|
|
212
|
+
if (consumed) {
|
|
213
|
+
flowManagerRef.current = consumed.flowManager;
|
|
214
|
+
maybePreloadHomeScreen(consumed.flowManager);
|
|
215
|
+
maybePreloadRedirectToMobile();
|
|
216
|
+
if (consumed.uiConfig) setUiConfig(consumed.uiConfig);
|
|
217
|
+
setState({
|
|
218
|
+
status: "ready",
|
|
219
|
+
flowManager: consumed.flowManager
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}).catch((error) => {
|
|
223
|
+
const errorMessage = error instanceof Error ? error.message : "Preload failed";
|
|
224
|
+
const errorCode = extractIncodeStatus(error);
|
|
225
|
+
setState({
|
|
167
226
|
status: "error",
|
|
168
|
-
error:
|
|
169
|
-
errorCode
|
|
170
|
-
flowManager:
|
|
171
|
-
})
|
|
227
|
+
error: errorMessage,
|
|
228
|
+
errorCode,
|
|
229
|
+
flowManager: state.flowManager
|
|
230
|
+
});
|
|
231
|
+
onError?.(errorMessage, errorCode);
|
|
172
232
|
});
|
|
173
233
|
return;
|
|
174
234
|
}
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
235
|
+
if (initStartedRef.current) return;
|
|
236
|
+
initStartedRef.current = true;
|
|
237
|
+
const abortController = new AbortController();
|
|
238
|
+
const { signal } = abortController;
|
|
239
|
+
const initialize = async () => {
|
|
179
240
|
try {
|
|
180
|
-
let
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
241
|
+
let resolvedToken;
|
|
242
|
+
if (hasFlowToken(options)) {
|
|
243
|
+
resolvedToken = options.token;
|
|
244
|
+
if (options.urlUuid) await refreshQrUrlUuid({
|
|
245
|
+
urlUuid: options.urlUuid,
|
|
246
|
+
onboardingId: null,
|
|
247
|
+
onRefreshed: options.onUrlUuidRefreshed
|
|
248
|
+
}, signal);
|
|
249
|
+
} else if (isSelfLoadingFlowConfig(options)) {
|
|
250
|
+
const session = await createFlowSession(options, signal);
|
|
251
|
+
resolvedToken = session.token;
|
|
252
|
+
state.flowManager.setEndScreenTexts(session.endScreenTitle ?? null, session.endScreenText ?? null);
|
|
253
|
+
} else throw new Error("Flow requires token, or configurationId with apiKey or clientId");
|
|
254
|
+
await initializeFlowManager({
|
|
255
|
+
token: resolvedToken,
|
|
256
|
+
lang,
|
|
257
|
+
flowManager: state.flowManager
|
|
194
258
|
});
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
})
|
|
198
|
-
|
|
259
|
+
const themePromise = disableDashboardTheme ? Promise.resolve() : fetchTheme().then((result) => {
|
|
260
|
+
if (result.uiConfig) setUiConfig(result.uiConfig);
|
|
261
|
+
});
|
|
262
|
+
const flowReadyPromise = state.flowManager.waitForReady();
|
|
263
|
+
await Promise.all([flowReadyPromise, themePromise]);
|
|
264
|
+
setState({
|
|
199
265
|
status: "ready",
|
|
200
|
-
flowManager:
|
|
266
|
+
flowManager: state.flowManager
|
|
201
267
|
});
|
|
202
|
-
} catch (
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
|
|
268
|
+
} catch (error) {
|
|
269
|
+
if (signal.aborted) return;
|
|
270
|
+
const errorMessage = error instanceof Error ? error.message : "Failed to initialize SDK";
|
|
271
|
+
const errorCode = extractIncodeStatus(error);
|
|
272
|
+
setState({
|
|
206
273
|
status: "error",
|
|
207
|
-
error:
|
|
208
|
-
errorCode
|
|
209
|
-
flowManager:
|
|
210
|
-
})
|
|
274
|
+
error: errorMessage,
|
|
275
|
+
errorCode,
|
|
276
|
+
flowManager: state.flowManager
|
|
277
|
+
});
|
|
278
|
+
onError?.(errorMessage, errorCode);
|
|
211
279
|
}
|
|
212
|
-
}
|
|
280
|
+
};
|
|
281
|
+
initialize();
|
|
282
|
+
return () => abortController.abort();
|
|
213
283
|
}, [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
])
|
|
284
|
+
token,
|
|
285
|
+
lang,
|
|
286
|
+
disableDashboardTheme,
|
|
287
|
+
enableHome,
|
|
288
|
+
useCPF,
|
|
289
|
+
onError,
|
|
290
|
+
options,
|
|
291
|
+
state
|
|
292
|
+
]);
|
|
293
|
+
return state;
|
|
223
294
|
}
|
|
224
295
|
//#endregion
|
|
225
296
|
//#region src/modules/flow/flow.tsx
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
297
|
+
var LazyHomeScreen = z(() => import("../homeScreen-BsEYyiDB.js").then((module) => ({ default: module.HomeScreen })));
|
|
298
|
+
var IncodeFlowContent = ({ config, onFinish, onError }) => {
|
|
299
|
+
const { i18n } = useTranslation();
|
|
300
|
+
const initState = useFlowInitialization(T(() => ({
|
|
301
|
+
...config,
|
|
302
|
+
onError
|
|
303
|
+
}), [config, onError]));
|
|
304
|
+
const [flowState, flowManager] = useManager(() => initState.flowManager, { autoLoad: false });
|
|
305
|
+
const lazyModuleKey = flowState.presentation.lazyModuleKey;
|
|
306
|
+
const currentModuleKey = flowState.status === "ready" ? flowState.currentStep : void 0;
|
|
307
|
+
const moduleLoaderState = useModuleLoader({
|
|
308
|
+
moduleKey: lazyModuleKey,
|
|
309
|
+
modules: LAZY_UI_MODULES,
|
|
310
|
+
onModuleLoading: config.onModuleLoading,
|
|
311
|
+
onModuleLoaded: config.onModuleLoaded,
|
|
312
|
+
onError
|
|
236
313
|
});
|
|
237
|
-
|
|
238
|
-
moduleKey:
|
|
239
|
-
modules:
|
|
314
|
+
useModulePreloader({
|
|
315
|
+
moduleKey: flowState.status === "ready" && flowState.homeScreen.visible ? currentModuleKey : void 0,
|
|
316
|
+
modules: LAZY_UI_MODULES
|
|
240
317
|
});
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}, [
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
318
|
+
const currentModuleLoaded = moduleLoaderState.status === "loaded";
|
|
319
|
+
const showHomeLoadingScreen = config.enableHome === true && flowState.status === "ready" && flowState.flow.disableLaunchScreen !== true && flowState.currentStepIndex === 0 && flowState.homeScreen.visible === false && moduleLoaderState.status === "loading";
|
|
320
|
+
const isAwaitingReadyDelayed = useDelayedFlag(flowState.presentation.isAwaitingReady === true, 150);
|
|
321
|
+
const isModuleLoadingDelayed = useDelayedFlag(flowState.status === "ready" && (moduleLoaderState.status === "idle" || moduleLoaderState.status === "loading" || moduleLoaderState.status === "error"), 150);
|
|
322
|
+
usePrefetchNextModule(flowState?.status === "ready" ? flowState.steps : [], flowState?.status === "ready" ? flowState.currentStepIndex : -1, LAZY_UI_MODULES, currentModuleLoaded);
|
|
323
|
+
y(() => {
|
|
324
|
+
if (!config.onFlowEvent) return;
|
|
325
|
+
return flowManager.subscribeFlowEvent(config.onFlowEvent);
|
|
326
|
+
}, [flowManager, config.onFlowEvent]);
|
|
327
|
+
y(() => {
|
|
328
|
+
if (flowState.presentation.shouldPrefetchHome) preloadHomeScreen();
|
|
329
|
+
}, [flowState.presentation.shouldPrefetchHome]);
|
|
330
|
+
y(() => {
|
|
331
|
+
if (readStoredLanguage()) return;
|
|
332
|
+
if (config.lang && i18n.language !== config.lang) i18n.changeLanguage(config.lang);
|
|
333
|
+
}, [config.lang, i18n]);
|
|
334
|
+
y(() => {
|
|
335
|
+
if (flowState?.status !== "ready") return;
|
|
336
|
+
if (flowState.currentStep === "REDIRECT_TO_MOBILE") return;
|
|
337
|
+
const readyState = flowState;
|
|
338
|
+
const requiredPipelines = getRequiredWasmPipelines(readyState.flow);
|
|
339
|
+
if (requiredPipelines.length > 0) {
|
|
340
|
+
config.onWasmWarmup?.(requiredPipelines);
|
|
341
|
+
warmupWasmIfNeeded(readyState, config.wasmConfig);
|
|
342
|
+
}
|
|
343
|
+
}, [flowState, config]);
|
|
344
|
+
const terminalFiredRef = A(false);
|
|
345
|
+
y(() => {
|
|
346
|
+
if (terminalFiredRef.current) return;
|
|
347
|
+
if (flowState?.status === "finished") {
|
|
348
|
+
terminalFiredRef.current = true;
|
|
349
|
+
const finishStatus = flowState.finishStatus;
|
|
350
|
+
queueMicrotask(() => onFinish(finishStatus));
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
if (flowState?.status === "error" && onError) {
|
|
354
|
+
terminalFiredRef.current = true;
|
|
355
|
+
const { error, errorCode } = flowState;
|
|
356
|
+
queueMicrotask(() => onError(error, errorCode));
|
|
267
357
|
}
|
|
268
358
|
}, [
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
])
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
359
|
+
flowState?.status,
|
|
360
|
+
onFinish,
|
|
361
|
+
onError,
|
|
362
|
+
flowState
|
|
363
|
+
]);
|
|
364
|
+
y(() => {
|
|
365
|
+
if (flowState?.status === "ready" && flowState.currentStep === "ID" && flowState.steps.includes("TUTORIAL_ID")) flowManager.completeModule();
|
|
366
|
+
}, [flowState, flowManager]);
|
|
367
|
+
const hideSpinnerText = !(config.spinnerConfig?.title || config.spinnerConfig?.subtitle);
|
|
368
|
+
if (initState.status === "error") return /* @__PURE__ */ u("div", {
|
|
278
369
|
class: "IncodeFlow",
|
|
279
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ u(TerminalErrorPage, { message: initState.error })
|
|
280
371
|
});
|
|
281
|
-
if (
|
|
372
|
+
if (flowState.homeScreen.visible || showHomeLoadingScreen) return /* @__PURE__ */ u("div", {
|
|
282
373
|
class: "IncodeFlow",
|
|
283
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ u(P, {
|
|
284
375
|
fallback: null,
|
|
285
|
-
children: /* @__PURE__ */
|
|
286
|
-
isContinueLoading:
|
|
287
|
-
onContinue: () =>
|
|
376
|
+
children: /* @__PURE__ */ u(LazyHomeScreen, {
|
|
377
|
+
isContinueLoading: flowState.homeScreen.isContinueLoading || showHomeLoadingScreen,
|
|
378
|
+
onContinue: () => flowManager.continueFromHome()
|
|
288
379
|
})
|
|
289
380
|
})
|
|
290
381
|
});
|
|
291
|
-
if (
|
|
382
|
+
if (initState.status === "initializing") return /* @__PURE__ */ u("div", {
|
|
292
383
|
class: "IncodeFlow",
|
|
293
|
-
children: /* @__PURE__ */
|
|
294
|
-
spinnerConfig:
|
|
295
|
-
hideText:
|
|
384
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
385
|
+
spinnerConfig: config.spinnerConfig,
|
|
386
|
+
hideText: hideSpinnerText
|
|
296
387
|
})
|
|
297
388
|
});
|
|
298
|
-
if (
|
|
299
|
-
class: "IncodeFlow"
|
|
300
|
-
|
|
301
|
-
spinnerConfig: r.spinnerConfig,
|
|
302
|
-
hideText: F
|
|
303
|
-
})
|
|
304
|
-
}) : /* @__PURE__ */ c("div", { class: "IncodeFlow" });
|
|
305
|
-
if (h.status === "error") return /* @__PURE__ */ c("div", {
|
|
306
|
-
class: "IncodeFlow",
|
|
307
|
-
children: /* @__PURE__ */ c(k, { message: h.error })
|
|
308
|
-
});
|
|
309
|
-
if (h.status === "finished") return null;
|
|
310
|
-
if (h?.status === "ready") {
|
|
311
|
-
let { currentStep: e, config: t, flow: n } = h, { flowId: i } = n;
|
|
312
|
-
if (!e || !t) return /* @__PURE__ */ c("div", {
|
|
389
|
+
if (flowState.presentation.isAwaitingReady) {
|
|
390
|
+
if (!isAwaitingReadyDelayed) return /* @__PURE__ */ u("div", { class: "IncodeFlow" });
|
|
391
|
+
return /* @__PURE__ */ u("div", {
|
|
313
392
|
class: "IncodeFlow",
|
|
314
|
-
children: /* @__PURE__ */
|
|
315
|
-
spinnerConfig:
|
|
316
|
-
hideText:
|
|
393
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
394
|
+
spinnerConfig: config.spinnerConfig,
|
|
395
|
+
hideText: hideSpinnerText
|
|
317
396
|
})
|
|
318
397
|
});
|
|
319
|
-
|
|
320
|
-
|
|
398
|
+
}
|
|
399
|
+
if (flowState.status === "error") return /* @__PURE__ */ u("div", {
|
|
400
|
+
class: "IncodeFlow",
|
|
401
|
+
children: /* @__PURE__ */ u(TerminalErrorPage, { message: flowState.error })
|
|
402
|
+
});
|
|
403
|
+
if (flowState.status === "finished") return null;
|
|
404
|
+
if (flowState?.status === "ready") {
|
|
405
|
+
const { currentStep, config: flowConfig, flow } = flowState;
|
|
406
|
+
const { flowId } = flow;
|
|
407
|
+
if (!currentStep || !flowConfig) return /* @__PURE__ */ u("div", {
|
|
321
408
|
class: "IncodeFlow",
|
|
322
|
-
children: /* @__PURE__ */
|
|
323
|
-
|
|
324
|
-
|
|
409
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
410
|
+
spinnerConfig: config.spinnerConfig,
|
|
411
|
+
hideText: hideSpinnerText
|
|
325
412
|
})
|
|
326
413
|
});
|
|
327
|
-
if (
|
|
414
|
+
if (HEADLESS_FLOW_MODULE_KEYS.has(currentStep)) return /* @__PURE__ */ u("div", { class: "IncodeFlow" });
|
|
415
|
+
if (moduleLoaderState.status === "unsupported") return /* @__PURE__ */ u("div", {
|
|
328
416
|
class: "IncodeFlow",
|
|
329
|
-
children: /* @__PURE__ */
|
|
330
|
-
|
|
331
|
-
|
|
417
|
+
children: /* @__PURE__ */ u(UnsupportedModule, {
|
|
418
|
+
moduleKey: currentStep,
|
|
419
|
+
onNext: () => flowManager.completeModule()
|
|
332
420
|
})
|
|
333
|
-
})
|
|
334
|
-
|
|
335
|
-
|
|
421
|
+
});
|
|
422
|
+
if (moduleLoaderState.status === "idle" || moduleLoaderState.status === "loading" || moduleLoaderState.status === "error") {
|
|
423
|
+
if (!isModuleLoadingDelayed) return /* @__PURE__ */ u("div", { class: "IncodeFlow" });
|
|
424
|
+
return /* @__PURE__ */ u("div", {
|
|
425
|
+
class: "IncodeFlow",
|
|
426
|
+
children: /* @__PURE__ */ u(TransitionSpinner, {
|
|
427
|
+
spinnerConfig: config.spinnerConfig,
|
|
428
|
+
hideText: hideSpinnerText
|
|
429
|
+
})
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
const { Component } = moduleLoaderState;
|
|
433
|
+
if (currentStep === "REDIRECT_TO_MOBILE") return /* @__PURE__ */ u("div", {
|
|
336
434
|
class: "IncodeFlow",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
-
config:
|
|
339
|
-
onFinish: () =>
|
|
340
|
-
onContinue: () =>
|
|
341
|
-
onError
|
|
342
|
-
}, `redirect-to-mobile-${
|
|
435
|
+
children: /* @__PURE__ */ u(Component, {
|
|
436
|
+
config: flowConfig,
|
|
437
|
+
onFinish: () => flowManager.completeFlow(),
|
|
438
|
+
onContinue: () => flowManager.completeModule(),
|
|
439
|
+
onError
|
|
440
|
+
}, `redirect-to-mobile-${flowState.currentStepIndex}`)
|
|
343
441
|
});
|
|
344
|
-
if (
|
|
442
|
+
if (currentStep === "SELFIE") return /* @__PURE__ */ u("div", {
|
|
345
443
|
class: "IncodeFlow",
|
|
346
|
-
children: /* @__PURE__ */
|
|
347
|
-
config:
|
|
348
|
-
onFinish: () =>
|
|
349
|
-
onError: (
|
|
350
|
-
|
|
444
|
+
children: /* @__PURE__ */ u(Component, {
|
|
445
|
+
config: flowConfig,
|
|
446
|
+
onFinish: () => flowManager.completeModule(),
|
|
447
|
+
onError: (error) => {
|
|
448
|
+
onError?.(error ?? "Selfie verification error");
|
|
351
449
|
}
|
|
352
|
-
}, `selfie-${
|
|
450
|
+
}, `selfie-${flowState.currentStepIndex}`)
|
|
353
451
|
});
|
|
354
|
-
if (
|
|
452
|
+
if (currentStep === "AUTHENTICATION") return /* @__PURE__ */ u("div", {
|
|
355
453
|
class: "IncodeFlow",
|
|
356
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ u(Component, {
|
|
357
455
|
config: {
|
|
358
|
-
...
|
|
359
|
-
authHint:
|
|
456
|
+
...flowConfig,
|
|
457
|
+
authHint: config.authHint
|
|
360
458
|
},
|
|
361
|
-
onFinish: () =>
|
|
362
|
-
onError: (
|
|
363
|
-
}, `authentication-${
|
|
459
|
+
onFinish: () => flowManager.completeModule(),
|
|
460
|
+
onError: (error, _errorCode, moduleErrorCode) => flowManager.errorModule(error ?? "Authentication error", moduleErrorCode)
|
|
461
|
+
}, `authentication-${flowState.currentStepIndex}`)
|
|
364
462
|
});
|
|
365
|
-
if (
|
|
463
|
+
if (currentStep === "PHONE") return /* @__PURE__ */ u("div", {
|
|
366
464
|
class: "IncodeFlow",
|
|
367
|
-
children: /* @__PURE__ */
|
|
368
|
-
config:
|
|
369
|
-
onFinish: () =>
|
|
370
|
-
onError: (
|
|
371
|
-
|
|
465
|
+
children: /* @__PURE__ */ u(Component, {
|
|
466
|
+
config: flowConfig,
|
|
467
|
+
onFinish: () => flowManager.completeModule(),
|
|
468
|
+
onError: (error) => {
|
|
469
|
+
onError?.(error ?? "Phone verification error");
|
|
372
470
|
}
|
|
373
|
-
}, `phone-${
|
|
471
|
+
}, `phone-${flowState.currentStepIndex}`)
|
|
374
472
|
});
|
|
375
|
-
if (
|
|
376
|
-
|
|
377
|
-
|
|
473
|
+
if (currentStep === "EMAIL") {
|
|
474
|
+
const emailConfig = flowConfig;
|
|
475
|
+
if (!emailConfig || typeof emailConfig.otpVerification !== "boolean" || typeof emailConfig.otpExpirationInMinutes !== "number") return /* @__PURE__ */ u("div", {
|
|
378
476
|
class: "IncodeFlow",
|
|
379
|
-
children: /* @__PURE__ */
|
|
380
|
-
})
|
|
477
|
+
children: /* @__PURE__ */ u("div", { children: "Error: Invalid email configuration" })
|
|
478
|
+
});
|
|
479
|
+
return /* @__PURE__ */ u("div", {
|
|
381
480
|
class: "IncodeFlow",
|
|
382
|
-
children: /* @__PURE__ */
|
|
383
|
-
config:
|
|
384
|
-
onFinish: () =>
|
|
385
|
-
onError: (
|
|
386
|
-
|
|
481
|
+
children: /* @__PURE__ */ u(Component, {
|
|
482
|
+
config: emailConfig,
|
|
483
|
+
onFinish: () => flowManager.completeModule(),
|
|
484
|
+
onError: (error) => {
|
|
485
|
+
onError?.(error ?? "Email verification error");
|
|
387
486
|
}
|
|
388
|
-
}, `email-${
|
|
487
|
+
}, `email-${flowState.currentStepIndex}`)
|
|
389
488
|
});
|
|
390
489
|
}
|
|
391
|
-
if (
|
|
392
|
-
|
|
393
|
-
return /* @__PURE__ */
|
|
490
|
+
if (currentStep === "ID" || currentStep === "SECOND_ID") {
|
|
491
|
+
const idConfig = flowConfig;
|
|
492
|
+
return /* @__PURE__ */ u("div", {
|
|
394
493
|
class: "IncodeFlow",
|
|
395
|
-
children: /* @__PURE__ */
|
|
396
|
-
config:
|
|
397
|
-
...
|
|
398
|
-
isSecondId:
|
|
399
|
-
} :
|
|
400
|
-
onFinish: () =>
|
|
401
|
-
onError: (
|
|
402
|
-
|
|
494
|
+
children: /* @__PURE__ */ u(Component, {
|
|
495
|
+
config: currentStep === "SECOND_ID" ? {
|
|
496
|
+
...idConfig,
|
|
497
|
+
isSecondId: true
|
|
498
|
+
} : idConfig,
|
|
499
|
+
onFinish: () => flowManager.completeModule(),
|
|
500
|
+
onError: (error) => {
|
|
501
|
+
onError?.(error ?? "ID capture error");
|
|
403
502
|
}
|
|
404
|
-
}, `id-${
|
|
503
|
+
}, `id-${flowState.currentStepIndex}`)
|
|
405
504
|
});
|
|
406
505
|
}
|
|
407
|
-
if (
|
|
408
|
-
|
|
409
|
-
|
|
506
|
+
if (currentStep === "ID_OCR") {
|
|
507
|
+
const idOcrConfig = flowConfig;
|
|
508
|
+
const isSecondId = flowState.steps.includes("SECOND_ID");
|
|
509
|
+
return /* @__PURE__ */ u("div", {
|
|
410
510
|
class: "IncodeFlow",
|
|
411
|
-
children: /* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ u(Component, {
|
|
412
512
|
config: {
|
|
413
|
-
...
|
|
414
|
-
secondId:
|
|
415
|
-
flowId
|
|
513
|
+
...idOcrConfig,
|
|
514
|
+
secondId: idOcrConfig.secondId ?? isSecondId,
|
|
515
|
+
flowId
|
|
416
516
|
},
|
|
417
|
-
onFinish: () =>
|
|
418
|
-
onError: (
|
|
419
|
-
|
|
517
|
+
onFinish: () => flowManager.completeModule(),
|
|
518
|
+
onError: (error) => {
|
|
519
|
+
onError?.(error ?? "ID OCR error");
|
|
420
520
|
}
|
|
421
|
-
}, `id-ocr-${
|
|
521
|
+
}, `id-ocr-${flowState.currentStepIndex}`)
|
|
422
522
|
});
|
|
423
523
|
}
|
|
424
|
-
if (
|
|
524
|
+
if (currentStep === "CPF_OCR") return /* @__PURE__ */ u("div", {
|
|
425
525
|
class: "IncodeFlow",
|
|
426
|
-
children: /* @__PURE__ */
|
|
427
|
-
onFinish: () =>
|
|
428
|
-
onError: (
|
|
429
|
-
|
|
526
|
+
children: /* @__PURE__ */ u(Component, {
|
|
527
|
+
onFinish: () => flowManager.completeModule(),
|
|
528
|
+
onError: (error) => {
|
|
529
|
+
onError?.(error ?? "CPF OCR error");
|
|
430
530
|
}
|
|
431
|
-
}, `cpf-ocr-${
|
|
531
|
+
}, `cpf-ocr-${flowState.currentStepIndex}`)
|
|
432
532
|
});
|
|
433
|
-
if (
|
|
533
|
+
if (currentStep === "FACE_MATCH") return /* @__PURE__ */ u("div", {
|
|
434
534
|
class: "IncodeFlow",
|
|
435
|
-
children: /* @__PURE__ */
|
|
436
|
-
config:
|
|
437
|
-
onFinish: () =>
|
|
438
|
-
onError: (
|
|
439
|
-
|
|
535
|
+
children: /* @__PURE__ */ u(Component, {
|
|
536
|
+
config: flowConfig,
|
|
537
|
+
onFinish: () => flowManager.completeModule(),
|
|
538
|
+
onError: (error) => {
|
|
539
|
+
onError?.(error ?? "Face match error");
|
|
440
540
|
}
|
|
441
|
-
}, `face-match-${
|
|
541
|
+
}, `face-match-${flowState.currentStepIndex}`)
|
|
442
542
|
});
|
|
443
|
-
if (
|
|
543
|
+
if (currentStep === "CURP_VALIDATION") return /* @__PURE__ */ u("div", {
|
|
444
544
|
class: "IncodeFlow",
|
|
445
|
-
children: /* @__PURE__ */
|
|
446
|
-
config:
|
|
447
|
-
onFinish: () =>
|
|
448
|
-
onError: (
|
|
449
|
-
|
|
545
|
+
children: /* @__PURE__ */ u(Component, {
|
|
546
|
+
config: flowConfig,
|
|
547
|
+
onFinish: () => flowManager.completeModule(),
|
|
548
|
+
onError: (error) => {
|
|
549
|
+
onError?.(error ?? "CURP validation error");
|
|
450
550
|
}
|
|
451
|
-
}, `curp-validation-${
|
|
551
|
+
}, `curp-validation-${flowState.currentStepIndex}`)
|
|
452
552
|
});
|
|
453
|
-
if (
|
|
553
|
+
if (currentStep === "GOVT_VALIDATION_PROVISIONING") return /* @__PURE__ */ u("div", {
|
|
454
554
|
class: "IncodeFlow",
|
|
455
|
-
children: /* @__PURE__ */
|
|
456
|
-
config:
|
|
457
|
-
onFinish: () =>
|
|
458
|
-
onError: (
|
|
459
|
-
|
|
555
|
+
children: /* @__PURE__ */ u(Component, {
|
|
556
|
+
config: flowConfig,
|
|
557
|
+
onFinish: () => flowManager.completeModule(),
|
|
558
|
+
onError: (error) => {
|
|
559
|
+
onError?.(error ?? "Government validation error");
|
|
460
560
|
}
|
|
461
|
-
}, `govt-validation-${
|
|
561
|
+
}, `govt-validation-${flowState.currentStepIndex}`)
|
|
462
562
|
});
|
|
463
|
-
if (
|
|
563
|
+
if (currentStep === "INE_VALIDATION") return /* @__PURE__ */ u("div", {
|
|
464
564
|
class: "IncodeFlow",
|
|
465
|
-
children: /* @__PURE__ */
|
|
466
|
-
config:
|
|
467
|
-
onFinish: () =>
|
|
468
|
-
onError: (
|
|
469
|
-
|
|
565
|
+
children: /* @__PURE__ */ u(Component, {
|
|
566
|
+
config: flowConfig,
|
|
567
|
+
onFinish: () => flowManager.completeModule(),
|
|
568
|
+
onError: (error) => {
|
|
569
|
+
onError?.(error ?? "INE validation error");
|
|
470
570
|
}
|
|
471
|
-
}, `ine-validation-${
|
|
571
|
+
}, `ine-validation-${flowState.currentStepIndex}`)
|
|
472
572
|
});
|
|
473
|
-
if (
|
|
573
|
+
if (currentStep === "GEOLOCATION") return /* @__PURE__ */ u("div", {
|
|
474
574
|
class: "IncodeFlow",
|
|
475
|
-
children: /* @__PURE__ */
|
|
476
|
-
config:
|
|
477
|
-
onFinish: () =>
|
|
478
|
-
onError: (
|
|
479
|
-
|
|
575
|
+
children: /* @__PURE__ */ u(Component, {
|
|
576
|
+
config: flowConfig,
|
|
577
|
+
onFinish: () => flowManager.completeModule(),
|
|
578
|
+
onError: (error) => {
|
|
579
|
+
onError?.(error ?? "Geolocation error");
|
|
480
580
|
}
|
|
481
|
-
}, `geolocation-${
|
|
581
|
+
}, `geolocation-${flowState.currentStepIndex}`)
|
|
482
582
|
});
|
|
483
|
-
if (
|
|
583
|
+
if (currentStep === "EXTERNAL_VERIFICATION") return /* @__PURE__ */ u("div", {
|
|
484
584
|
class: "IncodeFlow",
|
|
485
|
-
children: /* @__PURE__ */
|
|
486
|
-
config: { flowId:
|
|
487
|
-
onFinish: () =>
|
|
488
|
-
onError: (
|
|
489
|
-
|
|
585
|
+
children: /* @__PURE__ */ u(Component, {
|
|
586
|
+
config: { flowId: flowState.flow.flowId },
|
|
587
|
+
onFinish: () => flowManager.completeModule(),
|
|
588
|
+
onError: (error) => {
|
|
589
|
+
onError?.(error ?? "External verification error");
|
|
490
590
|
}
|
|
491
|
-
}, `ekyc-${
|
|
591
|
+
}, `ekyc-${flowState.currentStepIndex}`)
|
|
492
592
|
});
|
|
493
|
-
if (
|
|
593
|
+
if (currentStep === "DOCUMENT_CAPTURE") return /* @__PURE__ */ u("div", {
|
|
494
594
|
class: "IncodeFlow",
|
|
495
|
-
children: /* @__PURE__ */
|
|
496
|
-
config:
|
|
497
|
-
onFinish: () =>
|
|
498
|
-
onError: (
|
|
499
|
-
|
|
595
|
+
children: /* @__PURE__ */ u(Component, {
|
|
596
|
+
config: flowConfig,
|
|
597
|
+
onFinish: () => flowManager.completeModule(),
|
|
598
|
+
onError: (error) => {
|
|
599
|
+
onError?.(error ?? "Document capture error");
|
|
500
600
|
}
|
|
501
|
-
}, `document-capture-${
|
|
601
|
+
}, `document-capture-${flowState.currentStepIndex}`)
|
|
502
602
|
});
|
|
503
|
-
if (
|
|
603
|
+
if (currentStep === "ADDRESS") return /* @__PURE__ */ u("div", {
|
|
504
604
|
class: "IncodeFlow",
|
|
505
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ u(Component, {
|
|
506
606
|
config: {
|
|
507
|
-
...
|
|
607
|
+
...flowConfig,
|
|
508
608
|
processingType: "addressStatement"
|
|
509
609
|
},
|
|
510
|
-
onFinish: () =>
|
|
511
|
-
onError: (
|
|
512
|
-
|
|
610
|
+
onFinish: () => flowManager.completeModule(),
|
|
611
|
+
onError: (error) => {
|
|
612
|
+
onError?.(error ?? "Address capture error");
|
|
513
613
|
}
|
|
514
|
-
}, `address-${
|
|
614
|
+
}, `address-${flowState.currentStepIndex}`)
|
|
515
615
|
});
|
|
516
|
-
if (
|
|
616
|
+
if (currentStep === "SIGNATURE") return /* @__PURE__ */ u("div", {
|
|
517
617
|
class: "IncodeFlow",
|
|
518
|
-
children: /* @__PURE__ */
|
|
519
|
-
config:
|
|
520
|
-
onFinish: () =>
|
|
521
|
-
onError: (
|
|
522
|
-
|
|
618
|
+
children: /* @__PURE__ */ u(Component, {
|
|
619
|
+
config: flowConfig,
|
|
620
|
+
onFinish: () => flowManager.completeModule(),
|
|
621
|
+
onError: (error) => {
|
|
622
|
+
onError?.(error ?? "Signature capture error");
|
|
523
623
|
}
|
|
524
|
-
}, `signature-${
|
|
624
|
+
}, `signature-${flowState.currentStepIndex}`)
|
|
525
625
|
});
|
|
526
|
-
if (
|
|
527
|
-
|
|
528
|
-
return /* @__PURE__ */
|
|
626
|
+
if (currentStep === "EKYB") {
|
|
627
|
+
const ekybFlowConfig = flowConfig;
|
|
628
|
+
return /* @__PURE__ */ u("div", {
|
|
529
629
|
class: "IncodeFlow",
|
|
530
|
-
children: /* @__PURE__ */
|
|
630
|
+
children: /* @__PURE__ */ u(Component, {
|
|
531
631
|
config: {
|
|
532
|
-
flowId
|
|
533
|
-
checkBusinessName:
|
|
534
|
-
checkAddress:
|
|
535
|
-
checkTaxId:
|
|
536
|
-
checkUniqueBeneficialOwner:
|
|
632
|
+
flowId,
|
|
633
|
+
checkBusinessName: ekybFlowConfig.checkBusinessName,
|
|
634
|
+
checkAddress: ekybFlowConfig.checkAddress,
|
|
635
|
+
checkTaxId: ekybFlowConfig.checkTaxId,
|
|
636
|
+
checkUniqueBeneficialOwner: ekybFlowConfig.checkUniqueBeneficialOwner
|
|
537
637
|
},
|
|
538
|
-
onFinish: () =>
|
|
539
|
-
onError: (
|
|
540
|
-
|
|
638
|
+
onFinish: () => flowManager.completeModule(),
|
|
639
|
+
onError: (error) => {
|
|
640
|
+
onError?.(error ?? "eKYB verification error");
|
|
541
641
|
}
|
|
542
|
-
}, `ekyb-${
|
|
642
|
+
}, `ekyb-${flowState.currentStepIndex}`)
|
|
543
643
|
});
|
|
544
644
|
}
|
|
545
|
-
if (
|
|
645
|
+
if (currentStep === "COMBINED_CONSENT") return /* @__PURE__ */ u("div", {
|
|
546
646
|
class: "IncodeFlow",
|
|
547
|
-
children: /* @__PURE__ */
|
|
548
|
-
config:
|
|
549
|
-
onFinish: () =>
|
|
550
|
-
onError: (
|
|
551
|
-
|
|
647
|
+
children: /* @__PURE__ */ u(Component, {
|
|
648
|
+
config: flowConfig,
|
|
649
|
+
onFinish: () => flowManager.completeModule(),
|
|
650
|
+
onError: (error) => {
|
|
651
|
+
onError?.(error ?? "Combined consent error");
|
|
552
652
|
}
|
|
553
|
-
}, `combined-consent-${
|
|
653
|
+
}, `combined-consent-${flowState.currentStepIndex}`)
|
|
554
654
|
});
|
|
555
|
-
if (
|
|
556
|
-
|
|
557
|
-
return /* @__PURE__ */
|
|
655
|
+
if (currentStep === "MANDATORY_CONSENT" || currentStep === "ML_CONSENT") {
|
|
656
|
+
const isMlConsent = currentStep === "ML_CONSENT";
|
|
657
|
+
return /* @__PURE__ */ u("div", {
|
|
558
658
|
class: "IncodeFlow",
|
|
559
|
-
children: /* @__PURE__ */
|
|
659
|
+
children: /* @__PURE__ */ u(Component, {
|
|
560
660
|
config: {
|
|
561
|
-
...
|
|
562
|
-
type:
|
|
661
|
+
...flowConfig,
|
|
662
|
+
type: isMlConsent ? "ML" : "MANDATORY"
|
|
563
663
|
},
|
|
564
|
-
onFinish: () =>
|
|
565
|
-
onError: (
|
|
566
|
-
|
|
664
|
+
onFinish: () => flowManager.completeModule(),
|
|
665
|
+
onError: (error) => {
|
|
666
|
+
onError?.(error ?? (isMlConsent ? "ML consent error" : "Mandatory consent error"));
|
|
567
667
|
}
|
|
568
|
-
}, `${
|
|
668
|
+
}, `${isMlConsent ? "ml" : "mandatory"}-consent-${flowState.currentStepIndex}`)
|
|
569
669
|
});
|
|
570
670
|
}
|
|
571
|
-
if (
|
|
572
|
-
|
|
573
|
-
|
|
671
|
+
if (currentStep === "AE_SIGNATURE" || currentStep === "QE_SIGNATURE") {
|
|
672
|
+
const sigConfig = flowConfig;
|
|
673
|
+
const label = currentStep === "QE_SIGNATURE" ? "qe" : "ae";
|
|
674
|
+
return /* @__PURE__ */ u("div", {
|
|
574
675
|
class: "IncodeFlow",
|
|
575
|
-
children: /* @__PURE__ */
|
|
676
|
+
children: /* @__PURE__ */ u(Component, {
|
|
576
677
|
config: {
|
|
577
|
-
uploadDocument:
|
|
578
|
-
downloadDocument:
|
|
678
|
+
uploadDocument: sigConfig.uploadDocument,
|
|
679
|
+
downloadDocument: sigConfig.downloadDocument
|
|
579
680
|
},
|
|
580
|
-
onFinish: () =>
|
|
581
|
-
onError: (
|
|
582
|
-
|
|
681
|
+
onFinish: () => flowManager.completeModule(),
|
|
682
|
+
onError: (error) => {
|
|
683
|
+
onError?.(error ?? `${label.toUpperCase()} Signature error`);
|
|
583
684
|
}
|
|
584
|
-
}, `${
|
|
685
|
+
}, `${label}-signature-${flowState.currentStepIndex}`)
|
|
585
686
|
});
|
|
586
687
|
}
|
|
587
|
-
if (
|
|
688
|
+
if (currentStep === "ANTIFRAUD") return /* @__PURE__ */ u("div", {
|
|
588
689
|
class: "IncodeFlow",
|
|
589
|
-
children: /* @__PURE__ */
|
|
590
|
-
onFinish: () =>
|
|
591
|
-
onError: (
|
|
592
|
-
|
|
690
|
+
children: /* @__PURE__ */ u(Component, {
|
|
691
|
+
onFinish: () => flowManager.completeModule(),
|
|
692
|
+
onError: (error) => {
|
|
693
|
+
onError?.(error ?? "Antifraud check error");
|
|
593
694
|
}
|
|
594
|
-
}, `antifraud-${
|
|
695
|
+
}, `antifraud-${flowState.currentStepIndex}`)
|
|
595
696
|
});
|
|
596
|
-
if (
|
|
697
|
+
if (currentStep === "CUSTOM_FIELDS") return /* @__PURE__ */ u("div", {
|
|
597
698
|
class: "IncodeFlow",
|
|
598
|
-
children: /* @__PURE__ */
|
|
599
|
-
config:
|
|
600
|
-
onFinish: () =>
|
|
601
|
-
onError: (
|
|
602
|
-
|
|
699
|
+
children: /* @__PURE__ */ u(Component, {
|
|
700
|
+
config: flowConfig,
|
|
701
|
+
onFinish: () => flowManager.completeModule(),
|
|
702
|
+
onError: (error) => {
|
|
703
|
+
onError?.(error ?? "Custom fields error");
|
|
603
704
|
}
|
|
604
|
-
}, `custom-fields-${
|
|
705
|
+
}, `custom-fields-${flowState.currentStepIndex}`)
|
|
605
706
|
});
|
|
606
|
-
if (
|
|
707
|
+
if (currentStep === "WATCHLIST") return /* @__PURE__ */ u("div", {
|
|
607
708
|
class: "IncodeFlow",
|
|
608
|
-
children: /* @__PURE__ */
|
|
609
|
-
onFinish: () =>
|
|
610
|
-
onError: (
|
|
611
|
-
|
|
709
|
+
children: /* @__PURE__ */ u(Component, {
|
|
710
|
+
onFinish: () => flowManager.completeModule(),
|
|
711
|
+
onError: (error) => {
|
|
712
|
+
onError?.(error ?? "Watchlist check error");
|
|
612
713
|
}
|
|
613
|
-
}, `watchlist-${
|
|
714
|
+
}, `watchlist-${flowState.currentStepIndex}`)
|
|
614
715
|
});
|
|
615
|
-
if (
|
|
716
|
+
if (currentStep === "WATCHLIST_BUSINESS") return /* @__PURE__ */ u("div", {
|
|
616
717
|
class: "IncodeFlow",
|
|
617
|
-
children: /* @__PURE__ */
|
|
618
|
-
onFinish: () =>
|
|
619
|
-
onError: (
|
|
620
|
-
|
|
718
|
+
children: /* @__PURE__ */ u(Component, {
|
|
719
|
+
onFinish: () => flowManager.completeModule(),
|
|
720
|
+
onError: (error) => {
|
|
721
|
+
onError?.(error ?? "Watchlist for business check error");
|
|
621
722
|
}
|
|
622
|
-
}, `watchlist-for-business-${
|
|
723
|
+
}, `watchlist-for-business-${flowState.currentStepIndex}`)
|
|
623
724
|
});
|
|
624
|
-
if (
|
|
725
|
+
if (currentStep === "INCODE_WATCHLIST") return /* @__PURE__ */ u("div", {
|
|
625
726
|
class: "IncodeFlow",
|
|
626
|
-
children: /* @__PURE__ */
|
|
627
|
-
config:
|
|
628
|
-
onFinish: () =>
|
|
629
|
-
onError: (
|
|
630
|
-
|
|
727
|
+
children: /* @__PURE__ */ u(Component, {
|
|
728
|
+
config: flowConfig,
|
|
729
|
+
onFinish: () => flowManager.completeModule(),
|
|
730
|
+
onError: (error) => {
|
|
731
|
+
onError?.(error ?? "Custom watchlist check error");
|
|
631
732
|
}
|
|
632
|
-
}, `incode-watchlist-${
|
|
733
|
+
}, `incode-watchlist-${flowState.currentStepIndex}`)
|
|
633
734
|
});
|
|
634
|
-
if (
|
|
735
|
+
if (currentStep === "CROSS_DOCUMENT_DATA_MATCH") return /* @__PURE__ */ u("div", {
|
|
635
736
|
class: "IncodeFlow",
|
|
636
|
-
children: /* @__PURE__ */
|
|
637
|
-
onFinish: () =>
|
|
638
|
-
onError: (
|
|
639
|
-
|
|
737
|
+
children: /* @__PURE__ */ u(Component, {
|
|
738
|
+
onFinish: () => flowManager.completeModule(),
|
|
739
|
+
onError: (error) => {
|
|
740
|
+
onError?.(error ?? "Cross document data match error");
|
|
640
741
|
}
|
|
641
|
-
}, `cross-document-data-match-${
|
|
742
|
+
}, `cross-document-data-match-${flowState.currentStepIndex}`)
|
|
642
743
|
});
|
|
643
|
-
if (
|
|
744
|
+
if (currentStep === "FIELD_COMPARISON") return /* @__PURE__ */ u("div", {
|
|
644
745
|
class: "IncodeFlow",
|
|
645
|
-
children: /* @__PURE__ */
|
|
646
|
-
onFinish: () =>
|
|
647
|
-
onError: (
|
|
648
|
-
|
|
746
|
+
children: /* @__PURE__ */ u(Component, {
|
|
747
|
+
onFinish: () => flowManager.completeModule(),
|
|
748
|
+
onError: (error) => {
|
|
749
|
+
onError?.(error ?? "Field comparison error");
|
|
649
750
|
}
|
|
650
|
-
}, `field-comparison-${
|
|
751
|
+
}, `field-comparison-${flowState.currentStepIndex}`)
|
|
651
752
|
});
|
|
652
|
-
if (
|
|
753
|
+
if (currentStep === "DYNAMIC_FORMS") return /* @__PURE__ */ u("div", {
|
|
653
754
|
class: "IncodeFlow",
|
|
654
|
-
children: /* @__PURE__ */
|
|
655
|
-
config: { screens:
|
|
656
|
-
title:
|
|
657
|
-
hideTitle:
|
|
658
|
-
questions:
|
|
659
|
-
questionId:
|
|
660
|
-
question:
|
|
661
|
-
inputType:
|
|
662
|
-
isOptional:
|
|
663
|
-
overrides:
|
|
664
|
-
isPredefined:
|
|
665
|
-
options:
|
|
755
|
+
children: /* @__PURE__ */ u(Component, {
|
|
756
|
+
config: { screens: flowConfig.screens.map((s) => ({
|
|
757
|
+
title: s.title,
|
|
758
|
+
hideTitle: s.hideTitle,
|
|
759
|
+
questions: s.questions.map((q) => ({
|
|
760
|
+
questionId: q.questionId,
|
|
761
|
+
question: q.question,
|
|
762
|
+
inputType: q.inputType,
|
|
763
|
+
isOptional: q.isOptional,
|
|
764
|
+
overrides: q.overrides ?? void 0,
|
|
765
|
+
isPredefined: q.isPredefined,
|
|
766
|
+
options: q.options
|
|
666
767
|
}))
|
|
667
768
|
})) },
|
|
668
|
-
onFinish: () =>
|
|
669
|
-
onError: (
|
|
670
|
-
|
|
769
|
+
onFinish: () => flowManager.completeModule(),
|
|
770
|
+
onError: (error) => {
|
|
771
|
+
onError?.(error ?? "Dynamic forms error");
|
|
671
772
|
}
|
|
672
|
-
}, `dynamic-forms-${
|
|
773
|
+
}, `dynamic-forms-${flowState.currentStepIndex}`)
|
|
673
774
|
});
|
|
674
775
|
}
|
|
675
776
|
return null;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
777
|
+
};
|
|
778
|
+
var IncodeFlow = ({ config, onFinish = () => {}, onError }) => {
|
|
779
|
+
return /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(IncodeFlowContent, {
|
|
780
|
+
config,
|
|
781
|
+
onFinish,
|
|
782
|
+
onError
|
|
783
|
+
}) : null });
|
|
784
|
+
};
|
|
785
|
+
registerIncodeModuleElement(IncodeFlow, "incode-flow");
|
|
682
786
|
//#endregion
|
|
683
|
-
export {
|
|
787
|
+
export { IncodeFlow, preloadIncodeFlow };
|