@vpdev2/metakyc-sdk 1.0.9 → 1.0.10
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/components/steps/OverviewStep.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +86 -86
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1777,7 +1777,7 @@ class Ut {
|
|
|
1777
1777
|
}
|
|
1778
1778
|
const Ue = tt(null), Or = ({ config: t, children: e }) => {
|
|
1779
1779
|
const [r, s] = N(null), a = ie.useRef(!1), i = ie.useRef(!1), l = Re(() => {
|
|
1780
|
-
const d = new vt(t), u = new xt(d), y = new wt(d), x = new kt(d), g = new Nt(d), b = new St(d), m = new Ct(d), f = new At(d), k = new Et(d), h = new It(d),
|
|
1780
|
+
const d = new vt(t), u = new xt(d), y = new wt(d), x = new kt(d), g = new Nt(d), b = new St(d), m = new Ct(d), f = new At(d), k = new Et(d), h = new It(d), E = new Mt(d), v = new Ut();
|
|
1781
1781
|
return {
|
|
1782
1782
|
httpClient: d,
|
|
1783
1783
|
applicantService: u,
|
|
@@ -1789,7 +1789,7 @@ const Ue = tt(null), Or = ({ config: t, children: e }) => {
|
|
|
1789
1789
|
identityService: f,
|
|
1790
1790
|
baseInformationService: k,
|
|
1791
1791
|
investorCategorizationService: h,
|
|
1792
|
-
themeService:
|
|
1792
|
+
themeService: E,
|
|
1793
1793
|
themeManager: v
|
|
1794
1794
|
};
|
|
1795
1795
|
}, [t]), c = Re(() => ({
|
|
@@ -2007,7 +2007,7 @@ function Gt(t) {
|
|
|
2007
2007
|
i(!1);
|
|
2008
2008
|
}
|
|
2009
2009
|
}
|
|
2010
|
-
}, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((v, S) => v.order - S.order) : [], [r == null ? void 0 : r.stepInfoList]),
|
|
2010
|
+
}, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((v, S) => v.order - S.order) : [], [r == null ? void 0 : r.stepInfoList]), E = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2011
2011
|
return {
|
|
2012
2012
|
progress: r,
|
|
2013
2013
|
applicantId: u,
|
|
@@ -2017,7 +2017,7 @@ function Gt(t) {
|
|
|
2017
2017
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2018
2018
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
2019
2019
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2020
|
-
hasWorkflowChanged:
|
|
2020
|
+
hasWorkflowChanged: E,
|
|
2021
2021
|
isLoading: a,
|
|
2022
2022
|
error: l,
|
|
2023
2023
|
isComplete: (r == null ? void 0 : r.status) === le.Finished,
|
|
@@ -2638,13 +2638,13 @@ const nr = ({
|
|
|
2638
2638
|
}) => {
|
|
2639
2639
|
const [d, u] = N(!1), y = H(null), x = (h) => {
|
|
2640
2640
|
if (!h) return;
|
|
2641
|
-
const
|
|
2642
|
-
if (a &&
|
|
2641
|
+
const E = Array.from(h);
|
|
2642
|
+
if (a && E.filter((S) => S.size > a).length > 0) {
|
|
2643
2643
|
const S = Ie(a);
|
|
2644
2644
|
alert(`Some files exceed the maximum size of ${S}`);
|
|
2645
2645
|
return;
|
|
2646
2646
|
}
|
|
2647
|
-
i == null || i(s ? [...l, ...
|
|
2647
|
+
i == null || i(s ? [...l, ...E] : [E[0]]);
|
|
2648
2648
|
}, g = (h) => {
|
|
2649
2649
|
h.preventDefault(), u(!0);
|
|
2650
2650
|
}, b = () => {
|
|
@@ -2655,8 +2655,8 @@ const nr = ({
|
|
|
2655
2655
|
var h;
|
|
2656
2656
|
(h = y.current) == null || h.click();
|
|
2657
2657
|
}, k = (h) => {
|
|
2658
|
-
const
|
|
2659
|
-
i == null || i(
|
|
2658
|
+
const E = l.filter((v, S) => S !== h);
|
|
2659
|
+
i == null || i(E);
|
|
2660
2660
|
};
|
|
2661
2661
|
return /* @__PURE__ */ o("div", { className: te("w-full", c), children: [
|
|
2662
2662
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
@@ -2715,7 +2715,7 @@ const nr = ({
|
|
|
2715
2715
|
]
|
|
2716
2716
|
}
|
|
2717
2717
|
),
|
|
2718
|
-
l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h,
|
|
2718
|
+
l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h, E) => /* @__PURE__ */ o(
|
|
2719
2719
|
"div",
|
|
2720
2720
|
{
|
|
2721
2721
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2749,7 +2749,7 @@ const nr = ({
|
|
|
2749
2749
|
{
|
|
2750
2750
|
type: "button",
|
|
2751
2751
|
onClick: (v) => {
|
|
2752
|
-
v.stopPropagation(), k(
|
|
2752
|
+
v.stopPropagation(), k(E);
|
|
2753
2753
|
},
|
|
2754
2754
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2755
2755
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2764,7 +2764,7 @@ const nr = ({
|
|
|
2764
2764
|
)
|
|
2765
2765
|
]
|
|
2766
2766
|
},
|
|
2767
|
-
|
|
2767
|
+
E
|
|
2768
2768
|
)) }),
|
|
2769
2769
|
e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
|
|
2770
2770
|
] });
|
|
@@ -3077,11 +3077,11 @@ const Vr = ue.any(), xr = ({
|
|
|
3077
3077
|
try {
|
|
3078
3078
|
console.log("Form submitted with data:", m);
|
|
3079
3079
|
const f = s.questionGroups.flatMap(
|
|
3080
|
-
(h,
|
|
3080
|
+
(h, E) => h.questions.map((v, S) => {
|
|
3081
3081
|
var I, P, C;
|
|
3082
3082
|
return {
|
|
3083
3083
|
questionId: v.id,
|
|
3084
|
-
values: ((C = (P = (I = m.questionResults) == null ? void 0 : I[
|
|
3084
|
+
values: ((C = (P = (I = m.questionResults) == null ? void 0 : I[E]) == null ? void 0 : P[S]) == null ? void 0 : C.values) || []
|
|
3085
3085
|
};
|
|
3086
3086
|
})
|
|
3087
3087
|
);
|
|
@@ -3118,7 +3118,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3118
3118
|
control: y,
|
|
3119
3119
|
name: `questionResults.${f}.${h}.values.0`,
|
|
3120
3120
|
render: ({ field: S }) => {
|
|
3121
|
-
var I, P, C,
|
|
3121
|
+
var I, P, C, A;
|
|
3122
3122
|
return /* @__PURE__ */ n(
|
|
3123
3123
|
X,
|
|
3124
3124
|
{
|
|
@@ -3127,7 +3127,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3127
3127
|
onBlur: S.onBlur,
|
|
3128
3128
|
name: S.name,
|
|
3129
3129
|
placeholder: "Enter your answer...",
|
|
3130
|
-
error: (
|
|
3130
|
+
error: (A = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : A.message
|
|
3131
3131
|
}
|
|
3132
3132
|
);
|
|
3133
3133
|
}
|
|
@@ -3139,7 +3139,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3139
3139
|
control: y,
|
|
3140
3140
|
name: `questionResults.${f}.${h}.values.0`,
|
|
3141
3141
|
render: ({ field: S }) => {
|
|
3142
|
-
var I, P, C,
|
|
3142
|
+
var I, P, C, A;
|
|
3143
3143
|
return /* @__PURE__ */ n(
|
|
3144
3144
|
ye,
|
|
3145
3145
|
{
|
|
@@ -3152,7 +3152,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3152
3152
|
label: M
|
|
3153
3153
|
})),
|
|
3154
3154
|
placeholder: "Select an option...",
|
|
3155
|
-
error: (
|
|
3155
|
+
error: (A = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : A.message
|
|
3156
3156
|
}
|
|
3157
3157
|
);
|
|
3158
3158
|
}
|
|
@@ -3175,8 +3175,8 @@ const Vr = ue.any(), xr = ({
|
|
|
3175
3175
|
{
|
|
3176
3176
|
type: "checkbox",
|
|
3177
3177
|
checked: Array.isArray(S) && S.includes(P),
|
|
3178
|
-
onChange: (
|
|
3179
|
-
const M = Array.isArray(S) ? S : [], B =
|
|
3178
|
+
onChange: (A) => {
|
|
3179
|
+
const M = Array.isArray(S) ? S : [], B = A.target.checked ? [...M, P] : M.filter((Q) => Q !== P);
|
|
3180
3180
|
I(B);
|
|
3181
3181
|
},
|
|
3182
3182
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
@@ -3279,17 +3279,17 @@ const Vr = ue.any(), xr = ({
|
|
|
3279
3279
|
s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
|
|
3280
3280
|
] }),
|
|
3281
3281
|
/* @__PURE__ */ o(T, { className: "space-y-6", children: [
|
|
3282
|
-
s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-
|
|
3282
|
+
s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-3", children: s.steps.sort((u, y) => u.order - y.order).map((u) => /* @__PURE__ */ o(
|
|
3283
3283
|
"div",
|
|
3284
3284
|
{
|
|
3285
|
-
className: "
|
|
3286
|
-
children:
|
|
3287
|
-
/* @__PURE__ */ n("div", { className: "flex-shrink-0", children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-green-500 text-white flex items-center justify-center font-medium", children: "✓" }) }),
|
|
3285
|
+
className: "flex items-start p-4 rounded-lg bg-gray-50 dark:bg-gray-800",
|
|
3286
|
+
children: [
|
|
3287
|
+
/* @__PURE__ */ n("div", { className: "flex-shrink-0", children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-green-500 text-white flex items-center justify-center font-medium text-sm", children: "✓" }) }),
|
|
3288
3288
|
/* @__PURE__ */ o("div", { className: "ml-4 flex-1", children: [
|
|
3289
3289
|
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: u.title }),
|
|
3290
3290
|
u.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: u.description })
|
|
3291
3291
|
] })
|
|
3292
|
-
]
|
|
3292
|
+
]
|
|
3293
3293
|
},
|
|
3294
3294
|
u.order
|
|
3295
3295
|
)) }) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }),
|
|
@@ -3329,21 +3329,21 @@ const Vr = ue.any(), xr = ({
|
|
|
3329
3329
|
if (s)
|
|
3330
3330
|
try {
|
|
3331
3331
|
console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
|
|
3332
|
-
const
|
|
3333
|
-
const P = S.values || [], C = Array.isArray(P) ? P.filter((
|
|
3332
|
+
const E = h.criteriaValueInputs.map((S, I) => {
|
|
3333
|
+
const P = S.values || [], C = Array.isArray(P) ? P.filter((A) => A && A.trim()) : P && P.toString().trim() ? [P.toString()] : [];
|
|
3334
3334
|
return C.length === 0 ? null : {
|
|
3335
3335
|
riskCriteriaId: s[I].id,
|
|
3336
3336
|
values: C
|
|
3337
3337
|
};
|
|
3338
3338
|
}).filter((S) => S !== null);
|
|
3339
|
-
console.log("Risk scoring criteriaValueInputs to submit:",
|
|
3339
|
+
console.log("Risk scoring criteriaValueInputs to submit:", E);
|
|
3340
3340
|
const v = {
|
|
3341
3341
|
applicantId: t,
|
|
3342
|
-
criteriaValueInputs:
|
|
3342
|
+
criteriaValueInputs: E
|
|
3343
3343
|
};
|
|
3344
3344
|
console.log("Final risk scoring input:", v), await c(v), console.log("Risk scoring submitted successfully!"), e == null || e();
|
|
3345
|
-
} catch (
|
|
3346
|
-
throw console.error("Error submitting risk scoring:",
|
|
3345
|
+
} catch (E) {
|
|
3346
|
+
throw console.error("Error submitting risk scoring:", E), E;
|
|
3347
3347
|
}
|
|
3348
3348
|
}, k = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
|
|
3349
3349
|
return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
@@ -3360,7 +3360,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3360
3360
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
|
|
3361
3361
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3362
3362
|
] }),
|
|
3363
|
-
/* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h,
|
|
3363
|
+
/* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h, E) => {
|
|
3364
3364
|
var S, I, P;
|
|
3365
3365
|
const v = k(h);
|
|
3366
3366
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -3373,9 +3373,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3373
3373
|
J,
|
|
3374
3374
|
{
|
|
3375
3375
|
control: g,
|
|
3376
|
-
name: `criteriaValueInputs.${
|
|
3376
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3377
3377
|
render: ({ field: C }) => {
|
|
3378
|
-
var
|
|
3378
|
+
var A, M, B;
|
|
3379
3379
|
return /* @__PURE__ */ n(
|
|
3380
3380
|
X,
|
|
3381
3381
|
{
|
|
@@ -3383,7 +3383,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3383
3383
|
value: C.value || "",
|
|
3384
3384
|
type: h.valueDataType === Pe.DigitOnly ? "number" : "text",
|
|
3385
3385
|
placeholder: "Enter your answer...",
|
|
3386
|
-
error: (B = (M = (
|
|
3386
|
+
error: (B = (M = (A = m.criteriaValueInputs) == null ? void 0 : A[E]) == null ? void 0 : M.values) == null ? void 0 : B.message,
|
|
3387
3387
|
onKeyDown: (Q) => {
|
|
3388
3388
|
h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(Q.key) && Q.preventDefault();
|
|
3389
3389
|
}
|
|
@@ -3398,19 +3398,19 @@ const Vr = ue.any(), xr = ({
|
|
|
3398
3398
|
J,
|
|
3399
3399
|
{
|
|
3400
3400
|
control: g,
|
|
3401
|
-
name: `criteriaValueInputs.${
|
|
3402
|
-
render: ({ field: { value: C, onChange:
|
|
3401
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3402
|
+
render: ({ field: { value: C, onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3403
3403
|
/* @__PURE__ */ n(
|
|
3404
3404
|
"input",
|
|
3405
3405
|
{
|
|
3406
3406
|
type: "radio",
|
|
3407
3407
|
checked: C === M,
|
|
3408
|
-
onChange: () =>
|
|
3408
|
+
onChange: () => A(M),
|
|
3409
3409
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3410
3410
|
}
|
|
3411
3411
|
),
|
|
3412
3412
|
/* @__PURE__ */ n("span", { className: "text-sm", children: M })
|
|
3413
|
-
] }, `${
|
|
3413
|
+
] }, `${E}-${B}`)) })
|
|
3414
3414
|
}
|
|
3415
3415
|
)
|
|
3416
3416
|
] }),
|
|
@@ -3420,8 +3420,8 @@ const Vr = ue.any(), xr = ({
|
|
|
3420
3420
|
J,
|
|
3421
3421
|
{
|
|
3422
3422
|
control: g,
|
|
3423
|
-
name: `criteriaValueInputs.${
|
|
3424
|
-
render: ({ field: { value: C = [], onChange:
|
|
3423
|
+
name: `criteriaValueInputs.${E}.values`,
|
|
3424
|
+
render: ({ field: { value: C = [], onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3425
3425
|
/* @__PURE__ */ n(
|
|
3426
3426
|
"input",
|
|
3427
3427
|
{
|
|
@@ -3429,13 +3429,13 @@ const Vr = ue.any(), xr = ({
|
|
|
3429
3429
|
checked: Array.isArray(C) && C.includes(M),
|
|
3430
3430
|
onChange: (Q) => {
|
|
3431
3431
|
const _ = Array.isArray(C) ? C : [], p = Q.target.checked ? [..._, M] : _.filter((w) => w !== M);
|
|
3432
|
-
|
|
3432
|
+
A(p);
|
|
3433
3433
|
},
|
|
3434
3434
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3435
3435
|
}
|
|
3436
3436
|
),
|
|
3437
3437
|
/* @__PURE__ */ n("span", { className: "text-sm", children: M })
|
|
3438
|
-
] }, `${
|
|
3438
|
+
] }, `${E}-${B}`)) })
|
|
3439
3439
|
}
|
|
3440
3440
|
)
|
|
3441
3441
|
] }),
|
|
@@ -3443,9 +3443,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3443
3443
|
J,
|
|
3444
3444
|
{
|
|
3445
3445
|
control: g,
|
|
3446
|
-
name: `criteriaValueInputs.${
|
|
3446
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3447
3447
|
render: ({ field: C }) => {
|
|
3448
|
-
var
|
|
3448
|
+
var A, M, B;
|
|
3449
3449
|
return /* @__PURE__ */ n(
|
|
3450
3450
|
ye,
|
|
3451
3451
|
{
|
|
@@ -3457,13 +3457,13 @@ const Vr = ue.any(), xr = ({
|
|
|
3457
3457
|
// TODO: Load from base information service
|
|
3458
3458
|
],
|
|
3459
3459
|
placeholder: "Select a country...",
|
|
3460
|
-
error: (B = (M = (
|
|
3460
|
+
error: (B = (M = (A = m.criteriaValueInputs) == null ? void 0 : A[E]) == null ? void 0 : M.values) == null ? void 0 : B.message
|
|
3461
3461
|
}
|
|
3462
3462
|
);
|
|
3463
3463
|
}
|
|
3464
3464
|
}
|
|
3465
3465
|
),
|
|
3466
|
-
((P = (I = (S = m.criteriaValueInputs) == null ? void 0 : S[
|
|
3466
|
+
((P = (I = (S = m.criteriaValueInputs) == null ? void 0 : S[E]) == null ? void 0 : I.values) == null ? void 0 : P.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: m.criteriaValueInputs[E].values.message })
|
|
3467
3467
|
] }, h.id);
|
|
3468
3468
|
}) }),
|
|
3469
3469
|
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
@@ -3628,7 +3628,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3628
3628
|
onComplete: e,
|
|
3629
3629
|
onBack: r
|
|
3630
3630
|
}) => {
|
|
3631
|
-
const { appropriatenessTestService: s } = se(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [y, x] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [
|
|
3631
|
+
const { appropriatenessTestService: s } = se(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [y, x] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [E, v] = N(!1), [S, I] = N(0);
|
|
3632
3632
|
Y(() => {
|
|
3633
3633
|
(async () => {
|
|
3634
3634
|
try {
|
|
@@ -3669,9 +3669,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3669
3669
|
}, 1e3);
|
|
3670
3670
|
return () => clearInterval(p);
|
|
3671
3671
|
}, [S]), Y(() => {
|
|
3672
|
-
|
|
3673
|
-
}, [
|
|
3674
|
-
const
|
|
3672
|
+
E && !d && B();
|
|
3673
|
+
}, [E]);
|
|
3674
|
+
const A = () => {
|
|
3675
3675
|
a && (h(!0), f(a.testDurationSec));
|
|
3676
3676
|
}, M = (p, w) => {
|
|
3677
3677
|
b((O) => ({
|
|
@@ -3680,7 +3680,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3680
3680
|
}));
|
|
3681
3681
|
}, B = async (p) => {
|
|
3682
3682
|
if (p && p.preventDefault(), !!a) {
|
|
3683
|
-
if (!
|
|
3683
|
+
if (!E) {
|
|
3684
3684
|
const w = a.appropriatenessQuestions.length - Object.keys(g).length;
|
|
3685
3685
|
if (w > 0) {
|
|
3686
3686
|
x(`Please answer all questions. ${w} question(s) remaining.`);
|
|
@@ -3829,12 +3829,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3829
3829
|
},
|
|
3830
3830
|
p.id
|
|
3831
3831
|
)),
|
|
3832
|
-
y && !
|
|
3832
|
+
y && !E && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
3833
3833
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
3834
3834
|
" ",
|
|
3835
3835
|
y
|
|
3836
3836
|
] }) }),
|
|
3837
|
-
|
|
3837
|
+
E && /* @__PURE__ */ n("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
|
|
3838
3838
|
/* @__PURE__ */ n("strong", { children: "Time's up!" }),
|
|
3839
3839
|
" Your answers are being submitted automatically."
|
|
3840
3840
|
] }) })
|
|
@@ -3856,7 +3856,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3856
3856
|
type: "submit",
|
|
3857
3857
|
isLoading: d,
|
|
3858
3858
|
disabled: Object.keys(g).length < a.totalQuestionCount,
|
|
3859
|
-
children:
|
|
3859
|
+
children: E ? "Submitting..." : "Submit Test"
|
|
3860
3860
|
}
|
|
3861
3861
|
)
|
|
3862
3862
|
] })
|
|
@@ -3898,7 +3898,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3898
3898
|
j,
|
|
3899
3899
|
{
|
|
3900
3900
|
type: "button",
|
|
3901
|
-
onClick:
|
|
3901
|
+
onClick: A,
|
|
3902
3902
|
disabled: _ <= 0,
|
|
3903
3903
|
children: "Start Test"
|
|
3904
3904
|
}
|
|
@@ -3911,7 +3911,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3911
3911
|
onBack: r
|
|
3912
3912
|
}) => {
|
|
3913
3913
|
var O, z, R, we;
|
|
3914
|
-
const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: x, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h,
|
|
3914
|
+
const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: x, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h, E] = N([]), [v, S] = N(!0), [I, P] = N(!1), [C, A] = N(null), [M, B] = N(!1), Q = ie.useRef(!1), _ = Te({
|
|
3915
3915
|
defaultValues: {
|
|
3916
3916
|
street: "",
|
|
3917
3917
|
streetNumber: "",
|
|
@@ -3934,7 +3934,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3934
3934
|
const Ae = me.abbreviation3 || me.abbreviation;
|
|
3935
3935
|
return !Ae || V.has(Ae) ? !1 : (V.add(Ae), !0);
|
|
3936
3936
|
});
|
|
3937
|
-
|
|
3937
|
+
E(ae);
|
|
3938
3938
|
const $ = D.applicantRequestData;
|
|
3939
3939
|
if (_.reset({
|
|
3940
3940
|
street: ($ == null ? void 0 : $.street) || "",
|
|
@@ -3965,7 +3965,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3965
3965
|
if (d.expiresAt) {
|
|
3966
3966
|
const F = new Date(d.expiresAt).getTime();
|
|
3967
3967
|
if (Date.now() >= F) {
|
|
3968
|
-
console.warn("[Identity] Token has expired (expiresAt)"), B(!0),
|
|
3968
|
+
console.warn("[Identity] Token has expired (expiresAt)"), B(!0), A("Your verification session has expired. Please restart.");
|
|
3969
3969
|
return;
|
|
3970
3970
|
}
|
|
3971
3971
|
}
|
|
@@ -3973,14 +3973,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3973
3973
|
try {
|
|
3974
3974
|
const D = new URL(d.url).toString().toLowerCase();
|
|
3975
3975
|
if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
|
|
3976
|
-
console.warn("[Identity] Token URL indicates expiration"), B(!0),
|
|
3976
|
+
console.warn("[Identity] Token URL indicates expiration"), B(!0), A("Your verification link has expired. Please restart.");
|
|
3977
3977
|
return;
|
|
3978
3978
|
}
|
|
3979
3979
|
} catch {
|
|
3980
3980
|
console.error("[Identity] Invalid token URL");
|
|
3981
3981
|
}
|
|
3982
3982
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
3983
|
-
console.warn("[Identity] Token object indicates expiration"), B(!0),
|
|
3983
|
+
console.warn("[Identity] Token object indicates expiration"), B(!0), A("Your verification session has expired. Please restart.");
|
|
3984
3984
|
return;
|
|
3985
3985
|
}
|
|
3986
3986
|
}
|
|
@@ -3988,7 +3988,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3988
3988
|
if (c !== null && d && !b && I && !M) {
|
|
3989
3989
|
const F = c;
|
|
3990
3990
|
if (d.url) {
|
|
3991
|
-
console.log("[Identity] Loading provider URL for user verification:", d.url),
|
|
3991
|
+
console.log("[Identity] Loading provider URL for user verification:", d.url), A(null);
|
|
3992
3992
|
try {
|
|
3993
3993
|
if (new URL(d.url), F === oe.SardinAI) {
|
|
3994
3994
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
@@ -4005,12 +4005,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4005
4005
|
}
|
|
4006
4006
|
m({ type: "url", url: d.url });
|
|
4007
4007
|
} catch (D) {
|
|
4008
|
-
console.error("[Identity] Invalid URL:", D),
|
|
4008
|
+
console.error("[Identity] Invalid URL:", D), A("Invalid verification URL. Please restart."), B(!0);
|
|
4009
4009
|
}
|
|
4010
4010
|
return;
|
|
4011
4011
|
}
|
|
4012
4012
|
if (F === oe.SardinAI) {
|
|
4013
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4013
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), A(null);
|
|
4014
4014
|
try {
|
|
4015
4015
|
const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
|
|
4016
4016
|
G.initialize().then(() => {
|
|
@@ -4021,26 +4021,26 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4021
4021
|
var $;
|
|
4022
4022
|
console.error("[SardinAI] Failed to initialize:", V);
|
|
4023
4023
|
const ae = (($ = V.message) == null ? void 0 : $.toLowerCase()) || "";
|
|
4024
|
-
ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (B(!0),
|
|
4024
|
+
ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (B(!0), A("Session expired or invalid. Please restart verification.")) : A(`Failed to initialize: ${V.message}`);
|
|
4025
4025
|
});
|
|
4026
4026
|
} catch (D) {
|
|
4027
|
-
console.error("[SardinAI] Error creating provider:", D),
|
|
4027
|
+
console.error("[SardinAI] Error creating provider:", D), A(`Configuration error: ${D.message}`);
|
|
4028
4028
|
}
|
|
4029
4029
|
return;
|
|
4030
4030
|
}
|
|
4031
4031
|
try {
|
|
4032
|
-
|
|
4032
|
+
A(null);
|
|
4033
4033
|
const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
|
|
4034
4034
|
F === oe.Sumsub ? (G.initialize("identity-container").catch((V) => {
|
|
4035
4035
|
var ae;
|
|
4036
|
-
console.error("[Sumsub] Initialization error:", V),
|
|
4036
|
+
console.error("[Sumsub] Initialization error:", V), A(`Failed to initialize: ${V.message}`), (ae = V.message) != null && ae.toLowerCase().includes("expired") && B(!0);
|
|
4037
4037
|
}), G.onComplete && G.onComplete(() => {
|
|
4038
4038
|
e == null || e();
|
|
4039
4039
|
})) : F === oe.Onfido && G.initialize("identity-container").catch((V) => {
|
|
4040
|
-
console.error("[Onfido] Initialization error:", V),
|
|
4040
|
+
console.error("[Onfido] Initialization error:", V), A(`Failed to initialize: ${V.message}`);
|
|
4041
4041
|
}), m(G);
|
|
4042
4042
|
} catch (D) {
|
|
4043
|
-
console.error("[Identity] Provider setup error:", D),
|
|
4043
|
+
console.error("[Identity] Provider setup error:", D), A(`Setup error: ${D.message}`);
|
|
4044
4044
|
}
|
|
4045
4045
|
}
|
|
4046
4046
|
return () => {
|
|
@@ -4054,15 +4054,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4054
4054
|
}, [c, d, b, I, e, M]);
|
|
4055
4055
|
const p = async () => {
|
|
4056
4056
|
try {
|
|
4057
|
-
|
|
4057
|
+
A(null), B(!1), await x(), P(!0);
|
|
4058
4058
|
} catch (F) {
|
|
4059
4059
|
console.error("Error starting identity verification:", F);
|
|
4060
4060
|
}
|
|
4061
4061
|
}, w = async () => {
|
|
4062
4062
|
try {
|
|
4063
|
-
|
|
4063
|
+
A(null), B(!1), m(null), console.log("[Identity] Restarting verification..."), await g(), P(!0);
|
|
4064
4064
|
} catch (F) {
|
|
4065
|
-
console.error("Error restarting identity verification:", F),
|
|
4065
|
+
console.error("Error restarting identity verification:", F), A(F.message || "Failed to restart verification");
|
|
4066
4066
|
}
|
|
4067
4067
|
};
|
|
4068
4068
|
if (v || u)
|
|
@@ -4156,7 +4156,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4156
4156
|
const $ = D.target, Ce = $.contentDocument || ((G = $.contentWindow) == null ? void 0 : G.document);
|
|
4157
4157
|
if (Ce) {
|
|
4158
4158
|
const me = ((ae = (V = Ce.body) == null ? void 0 : V.textContent) == null ? void 0 : ae.toLowerCase()) || "";
|
|
4159
|
-
(me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), B(!0),
|
|
4159
|
+
(me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), B(!0), A("Your verification link has expired."));
|
|
4160
4160
|
}
|
|
4161
4161
|
} catch {
|
|
4162
4162
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4483,13 +4483,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4483
4483
|
onCancel: s
|
|
4484
4484
|
}) => {
|
|
4485
4485
|
var B, Q, _;
|
|
4486
|
-
const { config: a, baseInformationService: i } = se(), { createApplicant: l, isLoading: c } = rr(), [d, u] = N([]), [y, x] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1),
|
|
4487
|
-
if (!
|
|
4486
|
+
const { config: a, baseInformationService: i } = se(), { createApplicant: l, isLoading: c } = rr(), [d, u] = N([]), [y, x] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1), E = t || ((B = a.applicantForm) == null ? void 0 : B.workflowKey);
|
|
4487
|
+
if (!E)
|
|
4488
4488
|
throw new Error(
|
|
4489
4489
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4490
4490
|
);
|
|
4491
4491
|
const v = e || ((Q = a.applicantForm) == null ? void 0 : Q.externalRefId) || "", S = ((_ = a.applicantForm) == null ? void 0 : _.visibleFields) || gt, [I, P] = N({
|
|
4492
|
-
workflowKey:
|
|
4492
|
+
workflowKey: E,
|
|
4493
4493
|
firstName: "",
|
|
4494
4494
|
lastName: "",
|
|
4495
4495
|
title: "",
|
|
@@ -4537,7 +4537,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4537
4537
|
}, []);
|
|
4538
4538
|
const C = (p, w) => {
|
|
4539
4539
|
P((O) => ({ ...O, [p]: w }));
|
|
4540
|
-
},
|
|
4540
|
+
}, A = async (p) => {
|
|
4541
4541
|
p.preventDefault(), b(!0), f(null);
|
|
4542
4542
|
try {
|
|
4543
4543
|
if (!I.externalRefId || I.externalRefId.trim() === "") {
|
|
@@ -4664,7 +4664,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4664
4664
|
return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
4665
4665
|
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
4666
4666
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4667
|
-
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit:
|
|
4667
|
+
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: A, children: /* @__PURE__ */ o(L, { children: [
|
|
4668
4668
|
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
4669
4669
|
Ze,
|
|
4670
4670
|
{
|
|
@@ -4781,8 +4781,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4781
4781
|
P
|
|
4782
4782
|
] })
|
|
4783
4783
|
] }),
|
|
4784
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C,
|
|
4785
|
-
const M =
|
|
4784
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C, A) => {
|
|
4785
|
+
const M = A < S, B = C.order === l.order;
|
|
4786
4786
|
return /* @__PURE__ */ o(ie.Fragment, { children: [
|
|
4787
4787
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
4788
4788
|
/* @__PURE__ */ n(
|
|
@@ -4792,18 +4792,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4792
4792
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
4793
4793
|
${M || B ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
4794
4794
|
`,
|
|
4795
|
-
children:
|
|
4795
|
+
children: A + 1
|
|
4796
4796
|
}
|
|
4797
4797
|
),
|
|
4798
4798
|
/* @__PURE__ */ n(
|
|
4799
4799
|
"span",
|
|
4800
4800
|
{
|
|
4801
4801
|
className: `ml-2 text-sm ${B ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
4802
|
-
children: C.displayName
|
|
4802
|
+
children: C.displayName || C.name || `Step ${A + 1}`
|
|
4803
4803
|
}
|
|
4804
4804
|
)
|
|
4805
4805
|
] }),
|
|
4806
|
-
|
|
4806
|
+
A < v.length - 1 && /* @__PURE__ */ n(
|
|
4807
4807
|
"div",
|
|
4808
4808
|
{
|
|
4809
4809
|
className: `flex-1 h-0.5 mx-4 ${M ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
@@ -4812,7 +4812,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4812
4812
|
] }, C.order);
|
|
4813
4813
|
}) })
|
|
4814
4814
|
] });
|
|
4815
|
-
},
|
|
4815
|
+
}, E = () => {
|
|
4816
4816
|
const v = {
|
|
4817
4817
|
applicantId: t,
|
|
4818
4818
|
onComplete: async () => {
|
|
@@ -4862,7 +4862,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4862
4862
|
};
|
|
4863
4863
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
|
|
4864
4864
|
h(),
|
|
4865
|
-
|
|
4865
|
+
E()
|
|
4866
4866
|
] });
|
|
4867
4867
|
};
|
|
4868
4868
|
export {
|