@vpdev2/metakyc 1.0.56 → 1.0.58
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/client/session.d.ts +16 -16
- package/dist/client/session.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +649 -637
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var xe = (e, t, a) => ki(e, typeof t != "symbol" ? t + "" : t, a);
|
|
|
4
4
|
import ti from "axios";
|
|
5
5
|
import { jsx as i, jsxs as s, Fragment as kt } from "react/jsx-runtime";
|
|
6
6
|
import * as Vt from "react";
|
|
7
|
-
import Re, { createContext as ii, useMemo as
|
|
7
|
+
import Re, { createContext as ii, useMemo as Ue, useState as w, useEffect as he, useContext as ri, useCallback as oe, useRef as ge, forwardRef as xt, createElement as Et } from "react";
|
|
8
8
|
import hi, { createPortal as Mt } from "react-dom";
|
|
9
9
|
import { useForm as vi, Controller as ut } from "react-hook-form";
|
|
10
10
|
import { z as rt } from "zod";
|
|
@@ -297,19 +297,31 @@ class Mi {
|
|
|
297
297
|
}
|
|
298
298
|
class Oa {
|
|
299
299
|
static async createToken(t) {
|
|
300
|
-
const { baseUrl: a, apiKey: r, secretKey: n, tenantId: o, clientId: l, externalRefId: d, workflowKey: u,
|
|
300
|
+
const { baseUrl: a, apiKey: r, secretKey: n, tenantId: o, clientId: l, externalRefId: d, workflowKey: u, email: m, isCompany: f, applicant: g } = t;
|
|
301
301
|
if (!o && !l)
|
|
302
302
|
throw new Error("Either tenantId or clientId must be provided.");
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
303
|
+
if (!d)
|
|
304
|
+
throw new Error("externalRefId is required. Pass your user's unique ID.");
|
|
305
|
+
if (!u)
|
|
306
|
+
throw new Error("workflowKey is required. Pass the workflow key for this KYC session.");
|
|
307
|
+
if (!m)
|
|
308
|
+
throw new Error("email is required. Pass the applicant's email address.");
|
|
309
|
+
const S = {
|
|
310
|
+
apiKey: r,
|
|
311
|
+
secretKey: n,
|
|
312
|
+
externalRefId: d,
|
|
313
|
+
workflowKey: u,
|
|
314
|
+
email: m
|
|
315
|
+
};
|
|
316
|
+
o != null && (S.tenantId = o), l && (S.clientId = l), f != null && (S.isCompany = f), g && (S.applicant = g);
|
|
317
|
+
const b = (await ti.post(
|
|
306
318
|
`${a.replace(/\/+$/, "")}/api/SdkSession/CreateToken`,
|
|
307
|
-
|
|
319
|
+
S,
|
|
308
320
|
{ headers: { "Content-Type": "application/json" } }
|
|
309
321
|
)).data;
|
|
310
|
-
if (!
|
|
311
|
-
throw new Error(
|
|
312
|
-
return
|
|
322
|
+
if (!b.success)
|
|
323
|
+
throw new Error(b.error || "Failed to create session token.");
|
|
324
|
+
return b.result;
|
|
313
325
|
}
|
|
314
326
|
}
|
|
315
327
|
class ji {
|
|
@@ -580,7 +592,7 @@ class qi {
|
|
|
580
592
|
)).result;
|
|
581
593
|
}
|
|
582
594
|
}
|
|
583
|
-
class
|
|
595
|
+
class Ki {
|
|
584
596
|
constructor(t) {
|
|
585
597
|
this.httpClient = t;
|
|
586
598
|
}
|
|
@@ -648,7 +660,7 @@ class Ui {
|
|
|
648
660
|
return console.log("[IdentityService] Sumsub token refresh result:", a), a.result.accessToken;
|
|
649
661
|
}
|
|
650
662
|
}
|
|
651
|
-
class
|
|
663
|
+
class Ui {
|
|
652
664
|
constructor(t) {
|
|
653
665
|
this.httpClient = t;
|
|
654
666
|
}
|
|
@@ -6788,7 +6800,7 @@ function Tr(e, t) {
|
|
|
6788
6800
|
return n != null ? String(n) : `{{${r}}}`;
|
|
6789
6801
|
}) : e;
|
|
6790
6802
|
}
|
|
6791
|
-
function
|
|
6803
|
+
function Kt(e, t) {
|
|
6792
6804
|
const a = { ...e };
|
|
6793
6805
|
for (const r of Object.keys(t)) {
|
|
6794
6806
|
const n = t[r];
|
|
@@ -6800,7 +6812,7 @@ function Dt(e) {
|
|
|
6800
6812
|
const t = e.toLowerCase().split(/[-_]/)[0];
|
|
6801
6813
|
return Pt[t] || Pt.en;
|
|
6802
6814
|
}
|
|
6803
|
-
function
|
|
6815
|
+
function Ut(e, t) {
|
|
6804
6816
|
for (const a of Object.keys(e)) {
|
|
6805
6817
|
const r = e[a];
|
|
6806
6818
|
if (r && typeof r == "object" && typeof r[t] == "string")
|
|
@@ -6810,7 +6822,7 @@ function Kt(e, t) {
|
|
|
6810
6822
|
function oi(e) {
|
|
6811
6823
|
const t = Pt.en;
|
|
6812
6824
|
return (a, r) => {
|
|
6813
|
-
const n = !a.includes("."), o = qt(e, a) ?? (n ?
|
|
6825
|
+
const n = !a.includes("."), o = qt(e, a) ?? (n ? Ut(e, a) : void 0) ?? qt(t, a) ?? (n ? Ut(t, a) : void 0) ?? a;
|
|
6814
6826
|
return Tr(o, r);
|
|
6815
6827
|
};
|
|
6816
6828
|
}
|
|
@@ -6823,17 +6835,17 @@ function Q(e, t) {
|
|
|
6823
6835
|
const r = Rr.exec(a);
|
|
6824
6836
|
return r ? t(r[1]) : e;
|
|
6825
6837
|
}
|
|
6826
|
-
const si = "1.0.
|
|
6838
|
+
const si = "1.0.58", li = ii(null), Yt = `metakyc-translations-${si}-`, Ir = ({
|
|
6827
6839
|
locale: e,
|
|
6828
6840
|
fetchTranslations: t,
|
|
6829
6841
|
children: a
|
|
6830
6842
|
}) => {
|
|
6831
|
-
const r = e.toLowerCase().split(/[-_]/)[0], n =
|
|
6843
|
+
const r = e.toLowerCase().split(/[-_]/)[0], n = Ue(() => {
|
|
6832
6844
|
const u = Dt(r);
|
|
6833
6845
|
if (typeof window > "u") return u;
|
|
6834
6846
|
try {
|
|
6835
6847
|
const m = localStorage.getItem(Yt + r);
|
|
6836
|
-
if (m) return
|
|
6848
|
+
if (m) return Kt(u, JSON.parse(m));
|
|
6837
6849
|
} catch {
|
|
6838
6850
|
}
|
|
6839
6851
|
return u;
|
|
@@ -6848,8 +6860,8 @@ const si = "1.0.56", li = ii(null), Yt = `metakyc-translations-${si}-`, Ir = ({
|
|
|
6848
6860
|
return;
|
|
6849
6861
|
}
|
|
6850
6862
|
console.debug("[MetaKYC i18n] Remote overrides loaded for locale:", r, m);
|
|
6851
|
-
const f = Dt(r),
|
|
6852
|
-
l(
|
|
6863
|
+
const f = Dt(r), g = Kt(f, m);
|
|
6864
|
+
l(g);
|
|
6853
6865
|
try {
|
|
6854
6866
|
localStorage.setItem(Yt + r, JSON.stringify(m));
|
|
6855
6867
|
} catch {
|
|
@@ -6860,7 +6872,7 @@ const si = "1.0.56", li = ii(null), Yt = `metakyc-translations-${si}-`, Ir = ({
|
|
|
6860
6872
|
u = !0;
|
|
6861
6873
|
};
|
|
6862
6874
|
}, [r, t]);
|
|
6863
|
-
const d =
|
|
6875
|
+
const d = Ue(() => ({
|
|
6864
6876
|
t: oi(o),
|
|
6865
6877
|
locale: r,
|
|
6866
6878
|
dictionary: o
|
|
@@ -6888,8 +6900,8 @@ function Ar() {
|
|
|
6888
6900
|
}
|
|
6889
6901
|
const $t = "metakyc-theme-cache", qa = ({ config: e, children: t }) => {
|
|
6890
6902
|
Ar();
|
|
6891
|
-
const [a, r] = w(null), n = Re.useRef(!1), o = Re.useRef(!1), l =
|
|
6892
|
-
const m = new Mi(e), f = new ji(m),
|
|
6903
|
+
const [a, r] = w(null), n = Re.useRef(!1), o = Re.useRef(!1), l = Ue(() => {
|
|
6904
|
+
const m = new Mi(e), f = new ji(m), g = new Fi(m), S = new Oi(m), R = new Vi(m), b = new Bi(m), O = new qi(m), N = new Ki(m), H = new Ui(m), B = new Wi(m), F = new Xi(m), L = new Zi(m), q = new lr();
|
|
6893
6905
|
if (typeof document < "u")
|
|
6894
6906
|
if (e.theme)
|
|
6895
6907
|
q.applyTheme(e.theme);
|
|
@@ -6903,19 +6915,19 @@ const $t = "metakyc-theme-cache", qa = ({ config: e, children: t }) => {
|
|
|
6903
6915
|
return {
|
|
6904
6916
|
httpClient: m,
|
|
6905
6917
|
applicantService: f,
|
|
6906
|
-
questionnaireService:
|
|
6907
|
-
uploadDocumentService:
|
|
6908
|
-
appropriatenessTestService:
|
|
6918
|
+
questionnaireService: g,
|
|
6919
|
+
uploadDocumentService: S,
|
|
6920
|
+
appropriatenessTestService: R,
|
|
6909
6921
|
overviewService: b,
|
|
6910
6922
|
riskScoringService: O,
|
|
6911
|
-
identityService:
|
|
6923
|
+
identityService: N,
|
|
6912
6924
|
baseInformationService: H,
|
|
6913
6925
|
investorCategorizationService: B,
|
|
6914
6926
|
themeService: F,
|
|
6915
6927
|
translationService: L,
|
|
6916
6928
|
themeManager: q
|
|
6917
6929
|
};
|
|
6918
|
-
}, [e]), d =
|
|
6930
|
+
}, [e]), d = Ue(() => ({
|
|
6919
6931
|
config: e,
|
|
6920
6932
|
...l,
|
|
6921
6933
|
currentTheme: a,
|
|
@@ -7007,10 +7019,10 @@ async function Lr(e) {
|
|
|
7007
7019
|
}, r.onerror = (n) => a(n);
|
|
7008
7020
|
});
|
|
7009
7021
|
}
|
|
7010
|
-
function
|
|
7022
|
+
function Ka(e, t) {
|
|
7011
7023
|
return e.size <= t;
|
|
7012
7024
|
}
|
|
7013
|
-
function
|
|
7025
|
+
function Ua(e, t) {
|
|
7014
7026
|
return t.split(",").map((r) => r.trim()).some((r) => {
|
|
7015
7027
|
if (r.endsWith("/*")) {
|
|
7016
7028
|
const n = r.slice(0, -2);
|
|
@@ -7027,7 +7039,7 @@ function It(e) {
|
|
|
7027
7039
|
function Wa(e) {
|
|
7028
7040
|
return e;
|
|
7029
7041
|
}
|
|
7030
|
-
function
|
|
7042
|
+
function Ke(...e) {
|
|
7031
7043
|
return e.filter(Boolean).join(" ");
|
|
7032
7044
|
}
|
|
7033
7045
|
const Tt = {
|
|
@@ -7085,40 +7097,40 @@ function Mr(e) {
|
|
|
7085
7097
|
nextWorkflowKey: r.nextWorkflowKey
|
|
7086
7098
|
});
|
|
7087
7099
|
}, [r, f]);
|
|
7088
|
-
const
|
|
7100
|
+
const g = ge(!1), S = ge(!1), R = oe(async () => {
|
|
7089
7101
|
if (!(!f || !m.current)) {
|
|
7090
|
-
if (
|
|
7102
|
+
if (g.current) {
|
|
7091
7103
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
7092
7104
|
return;
|
|
7093
7105
|
}
|
|
7094
|
-
|
|
7106
|
+
g.current = !0, l(!0), u(null);
|
|
7095
7107
|
try {
|
|
7096
7108
|
const L = await m.current.initialize(f);
|
|
7097
|
-
n(L),
|
|
7109
|
+
n(L), S.current = !0;
|
|
7098
7110
|
} catch (L) {
|
|
7099
7111
|
u(L);
|
|
7100
7112
|
} finally {
|
|
7101
|
-
l(!1),
|
|
7113
|
+
l(!1), g.current = !1;
|
|
7102
7114
|
}
|
|
7103
7115
|
}
|
|
7104
7116
|
}, [f]);
|
|
7105
7117
|
he(() => {
|
|
7106
|
-
f && !
|
|
7107
|
-
}, [f,
|
|
7118
|
+
f && !S.current && R();
|
|
7119
|
+
}, [f, R]);
|
|
7108
7120
|
const b = oe(async () => {
|
|
7109
7121
|
if (m.current) {
|
|
7110
|
-
if (
|
|
7122
|
+
if (g.current) {
|
|
7111
7123
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
7112
7124
|
return;
|
|
7113
7125
|
}
|
|
7114
|
-
|
|
7126
|
+
g.current = !0, l(!0), u(null);
|
|
7115
7127
|
try {
|
|
7116
7128
|
const L = await m.current.refreshProgress();
|
|
7117
7129
|
n(L);
|
|
7118
7130
|
} catch (L) {
|
|
7119
7131
|
u(L);
|
|
7120
7132
|
} finally {
|
|
7121
|
-
l(!1),
|
|
7133
|
+
l(!1), g.current = !1;
|
|
7122
7134
|
}
|
|
7123
7135
|
}
|
|
7124
7136
|
}, []), O = oe(async () => {
|
|
@@ -7133,7 +7145,7 @@ function Mr(e) {
|
|
|
7133
7145
|
l(!1);
|
|
7134
7146
|
}
|
|
7135
7147
|
}
|
|
7136
|
-
}, []),
|
|
7148
|
+
}, []), N = oe(async () => {
|
|
7137
7149
|
if (m.current) {
|
|
7138
7150
|
l(!0), u(null);
|
|
7139
7151
|
try {
|
|
@@ -7175,18 +7187,18 @@ function Mr(e) {
|
|
|
7175
7187
|
isOnHold: (r == null ? void 0 : r.status) === $e.OnHold,
|
|
7176
7188
|
refreshProgress: b,
|
|
7177
7189
|
moveToNext: O,
|
|
7178
|
-
moveBack:
|
|
7190
|
+
moveBack: N,
|
|
7179
7191
|
submitCurrentStep: H,
|
|
7180
7192
|
orchestrator: m.current
|
|
7181
7193
|
};
|
|
7182
7194
|
}
|
|
7183
7195
|
function jr(e) {
|
|
7184
7196
|
var L;
|
|
7185
|
-
const { applicantService: t, config: a } = Me(), [r, n] = w(null), [o, l] = w(!0), [d, u] = w(null), [m, f] = w(), [
|
|
7197
|
+
const { applicantService: t, config: a } = Me(), [r, n] = w(null), [o, l] = w(!0), [d, u] = w(null), [m, f] = w(), [g, S] = w(), R = ge(!1), b = oe(async () => {
|
|
7186
7198
|
try {
|
|
7187
7199
|
l(!0), u(null);
|
|
7188
7200
|
const q = await t.getSdkState();
|
|
7189
|
-
n(q),
|
|
7201
|
+
n(q), R.current = !0;
|
|
7190
7202
|
} catch (q) {
|
|
7191
7203
|
u(q instanceof Error ? q : new Error(String(q)));
|
|
7192
7204
|
} finally {
|
|
@@ -7194,13 +7206,13 @@ function jr(e) {
|
|
|
7194
7206
|
}
|
|
7195
7207
|
}, [t]);
|
|
7196
7208
|
he(() => {
|
|
7197
|
-
|
|
7209
|
+
R.current || b();
|
|
7198
7210
|
}, [b]);
|
|
7199
7211
|
const O = oe((q) => {
|
|
7200
|
-
f(q),
|
|
7201
|
-
}, []),
|
|
7212
|
+
f(q), S("workflow");
|
|
7213
|
+
}, []), N = g || (r == null ? void 0 : r.phase) || "loading", H = m || (r == null ? void 0 : r.applicantId), B = e ?? (r == null ? void 0 : r.isCompany) ?? !1, F = (r == null ? void 0 : r.workflowKey) || ((L = a.applicantForm) == null ? void 0 : L.workflowKey);
|
|
7202
7214
|
return {
|
|
7203
|
-
phase: d ? "error" : o ? "loading" :
|
|
7215
|
+
phase: d ? "error" : o ? "loading" : N,
|
|
7204
7216
|
applicantId: H,
|
|
7205
7217
|
isCompany: B,
|
|
7206
7218
|
workflowKey: F,
|
|
@@ -7211,14 +7223,14 @@ function jr(e) {
|
|
|
7211
7223
|
};
|
|
7212
7224
|
}
|
|
7213
7225
|
function Fr(e) {
|
|
7214
|
-
const { questionnaireService: t, applicantService: a } = Me(), [r, n] = w(null), [o, l] = w({}), [d, u] = w(!1), [m, f] = w(!1), [
|
|
7226
|
+
const { questionnaireService: t, applicantService: a } = Me(), [r, n] = w(null), [o, l] = w({}), [d, u] = w(!1), [m, f] = w(!1), [g, S] = w(null), R = ge(!1), b = ge(null), O = oe(async () => {
|
|
7215
7227
|
var H, B;
|
|
7216
7228
|
if (e) {
|
|
7217
|
-
if (
|
|
7229
|
+
if (R.current) {
|
|
7218
7230
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
7219
7231
|
return;
|
|
7220
7232
|
}
|
|
7221
|
-
|
|
7233
|
+
R.current = !0, u(!0), S(null);
|
|
7222
7234
|
try {
|
|
7223
7235
|
const [F, L] = await Promise.all([
|
|
7224
7236
|
t.getQuestionnaire(e),
|
|
@@ -7226,33 +7238,33 @@ function Fr(e) {
|
|
|
7226
7238
|
]);
|
|
7227
7239
|
if (n(F), (H = L == null ? void 0 : L.questionnaireResults) != null && H.length && F) {
|
|
7228
7240
|
const q = /* @__PURE__ */ new Map();
|
|
7229
|
-
for (const
|
|
7230
|
-
|
|
7231
|
-
const J = {}, ie = F.questionGroups.flatMap((
|
|
7232
|
-
for (const
|
|
7233
|
-
const z =
|
|
7234
|
-
q.has(z) && (J[
|
|
7241
|
+
for (const C of L.questionnaireResults)
|
|
7242
|
+
C.question && ((B = C.answers) != null && B.length) && q.set(C.question.trim().toLowerCase(), C.answers);
|
|
7243
|
+
const J = {}, ie = F.questionGroups.flatMap((C) => C.questions ?? []);
|
|
7244
|
+
for (const C of ie) {
|
|
7245
|
+
const z = C.text.trim().toLowerCase();
|
|
7246
|
+
q.has(z) && (J[C.id] = q.get(z));
|
|
7235
7247
|
}
|
|
7236
7248
|
l(J);
|
|
7237
7249
|
}
|
|
7238
7250
|
b.current = e;
|
|
7239
7251
|
} catch (F) {
|
|
7240
|
-
|
|
7252
|
+
S(F);
|
|
7241
7253
|
} finally {
|
|
7242
|
-
u(!1),
|
|
7254
|
+
u(!1), R.current = !1;
|
|
7243
7255
|
}
|
|
7244
7256
|
}
|
|
7245
7257
|
}, [e, t, a]);
|
|
7246
7258
|
he(() => {
|
|
7247
7259
|
e && b.current !== e && O();
|
|
7248
7260
|
}, [e]);
|
|
7249
|
-
const
|
|
7261
|
+
const N = oe(
|
|
7250
7262
|
async (H) => {
|
|
7251
|
-
f(!0),
|
|
7263
|
+
f(!0), S(null);
|
|
7252
7264
|
try {
|
|
7253
7265
|
return await t.fillQuestionnaire(H);
|
|
7254
7266
|
} catch (B) {
|
|
7255
|
-
throw
|
|
7267
|
+
throw S(B), B;
|
|
7256
7268
|
} finally {
|
|
7257
7269
|
f(!1);
|
|
7258
7270
|
}
|
|
@@ -7264,39 +7276,39 @@ function Fr(e) {
|
|
|
7264
7276
|
initialAnswers: o,
|
|
7265
7277
|
isLoading: d,
|
|
7266
7278
|
isSubmitting: m,
|
|
7267
|
-
error:
|
|
7279
|
+
error: g,
|
|
7268
7280
|
load: O,
|
|
7269
|
-
submit:
|
|
7281
|
+
submit: N
|
|
7270
7282
|
};
|
|
7271
7283
|
}
|
|
7272
7284
|
function Or(e) {
|
|
7273
|
-
const { uploadDocumentService: t } = Me(), [a, r] = w(null), [n, o] = w(!1), [l, d] = w(!1), [u, m] = w(0), [f,
|
|
7285
|
+
const { uploadDocumentService: t } = Me(), [a, r] = w(null), [n, o] = w(!1), [l, d] = w(!1), [u, m] = w(0), [f, g] = w(null), S = ge(!1), R = ge(null), b = oe(async () => {
|
|
7274
7286
|
if (e) {
|
|
7275
|
-
if (
|
|
7287
|
+
if (S.current) {
|
|
7276
7288
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
7277
7289
|
return;
|
|
7278
7290
|
}
|
|
7279
|
-
|
|
7291
|
+
S.current = !0, o(!0), g(null);
|
|
7280
7292
|
try {
|
|
7281
|
-
const
|
|
7282
|
-
r(
|
|
7283
|
-
} catch (
|
|
7284
|
-
|
|
7293
|
+
const N = await t.getUploadDocument(e);
|
|
7294
|
+
r(N), R.current = e;
|
|
7295
|
+
} catch (N) {
|
|
7296
|
+
g(N);
|
|
7285
7297
|
} finally {
|
|
7286
|
-
o(!1),
|
|
7298
|
+
o(!1), S.current = !1;
|
|
7287
7299
|
}
|
|
7288
7300
|
}
|
|
7289
7301
|
}, [e, t]);
|
|
7290
7302
|
he(() => {
|
|
7291
|
-
e &&
|
|
7303
|
+
e && R.current !== e && b();
|
|
7292
7304
|
}, [e]);
|
|
7293
7305
|
const O = oe(
|
|
7294
|
-
async (
|
|
7295
|
-
d(!0), m(0),
|
|
7306
|
+
async (N) => {
|
|
7307
|
+
d(!0), m(0), g(null);
|
|
7296
7308
|
try {
|
|
7297
|
-
await t.fillUploadDocument(
|
|
7309
|
+
await t.fillUploadDocument(N), m(100);
|
|
7298
7310
|
} catch (H) {
|
|
7299
|
-
throw
|
|
7311
|
+
throw g(H), H;
|
|
7300
7312
|
} finally {
|
|
7301
7313
|
d(!1);
|
|
7302
7314
|
}
|
|
@@ -7314,32 +7326,32 @@ function Or(e) {
|
|
|
7314
7326
|
};
|
|
7315
7327
|
}
|
|
7316
7328
|
function Ga(e) {
|
|
7317
|
-
const { appropriatenessTestService: t } = Me(), [a, r] = w(null), [n, o] = w(!1), [l, d] = w(!1), [u, m] = w(null), [f,
|
|
7329
|
+
const { appropriatenessTestService: t } = Me(), [a, r] = w(null), [n, o] = w(!1), [l, d] = w(!1), [u, m] = w(null), [f, g] = w(null), S = ge(!1), R = ge(null), b = oe(async () => {
|
|
7318
7330
|
if (e) {
|
|
7319
|
-
if (
|
|
7331
|
+
if (S.current) {
|
|
7320
7332
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
7321
7333
|
return;
|
|
7322
7334
|
}
|
|
7323
|
-
|
|
7335
|
+
S.current = !0, o(!0), m(null);
|
|
7324
7336
|
try {
|
|
7325
|
-
const
|
|
7326
|
-
r(
|
|
7327
|
-
} catch (
|
|
7328
|
-
m(
|
|
7337
|
+
const N = await t.getAppropriatenessTest(e);
|
|
7338
|
+
r(N), R.current = e;
|
|
7339
|
+
} catch (N) {
|
|
7340
|
+
m(N);
|
|
7329
7341
|
} finally {
|
|
7330
|
-
o(!1),
|
|
7342
|
+
o(!1), S.current = !1;
|
|
7331
7343
|
}
|
|
7332
7344
|
}
|
|
7333
7345
|
}, [e, t]);
|
|
7334
7346
|
he(() => {
|
|
7335
|
-
e &&
|
|
7347
|
+
e && R.current !== e && b();
|
|
7336
7348
|
}, [e]);
|
|
7337
7349
|
const O = oe(
|
|
7338
|
-
async (
|
|
7350
|
+
async (N) => {
|
|
7339
7351
|
d(!0), m(null);
|
|
7340
7352
|
try {
|
|
7341
|
-
const H = await t.fillAppropriatenessTest(
|
|
7342
|
-
return
|
|
7353
|
+
const H = await t.fillAppropriatenessTest(N);
|
|
7354
|
+
return g(H), H;
|
|
7343
7355
|
} catch (H) {
|
|
7344
7356
|
throw m(H), H;
|
|
7345
7357
|
} finally {
|
|
@@ -7359,7 +7371,7 @@ function Ga(e) {
|
|
|
7359
7371
|
};
|
|
7360
7372
|
}
|
|
7361
7373
|
function Vr(e) {
|
|
7362
|
-
const { overviewService: t } = Me(), [a, r] = w(null), [n, o] = w(!1), [l, d] = w(!1), [u, m] = w(null), f = ge(!1),
|
|
7374
|
+
const { overviewService: t } = Me(), [a, r] = w(null), [n, o] = w(!1), [l, d] = w(!1), [u, m] = w(null), f = ge(!1), g = ge(null), S = oe(async () => {
|
|
7363
7375
|
if (e) {
|
|
7364
7376
|
if (f.current) {
|
|
7365
7377
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -7368,7 +7380,7 @@ function Vr(e) {
|
|
|
7368
7380
|
f.current = !0, o(!0), m(null);
|
|
7369
7381
|
try {
|
|
7370
7382
|
const b = await t.getOverviewData(e);
|
|
7371
|
-
r(b),
|
|
7383
|
+
r(b), g.current = e;
|
|
7372
7384
|
} catch (b) {
|
|
7373
7385
|
m(b);
|
|
7374
7386
|
} finally {
|
|
@@ -7377,9 +7389,9 @@ function Vr(e) {
|
|
|
7377
7389
|
}
|
|
7378
7390
|
}, [e, t]);
|
|
7379
7391
|
he(() => {
|
|
7380
|
-
e &&
|
|
7392
|
+
e && g.current !== e && S();
|
|
7381
7393
|
}, [e]);
|
|
7382
|
-
const
|
|
7394
|
+
const R = oe(async () => {
|
|
7383
7395
|
if (e) {
|
|
7384
7396
|
d(!0), m(null);
|
|
7385
7397
|
try {
|
|
@@ -7396,15 +7408,15 @@ function Vr(e) {
|
|
|
7396
7408
|
isLoading: n,
|
|
7397
7409
|
isSubmitting: l,
|
|
7398
7410
|
error: u,
|
|
7399
|
-
load:
|
|
7400
|
-
passOverview:
|
|
7411
|
+
load: S,
|
|
7412
|
+
passOverview: R
|
|
7401
7413
|
};
|
|
7402
7414
|
}
|
|
7403
7415
|
function Br(e) {
|
|
7404
7416
|
const { identityService: t } = Me(), [a, r] = w(
|
|
7405
7417
|
null
|
|
7406
7418
|
), [n, o] = w(!1), [l, d] = w(null), u = ge(!1), m = oe(
|
|
7407
|
-
async (
|
|
7419
|
+
async (S, R) => {
|
|
7408
7420
|
if (e) {
|
|
7409
7421
|
if (u.current) {
|
|
7410
7422
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -7415,8 +7427,8 @@ function Br(e) {
|
|
|
7415
7427
|
const b = {
|
|
7416
7428
|
applicantId: e,
|
|
7417
7429
|
restart: !1,
|
|
7418
|
-
redirectUrl:
|
|
7419
|
-
ttl:
|
|
7430
|
+
redirectUrl: S || "",
|
|
7431
|
+
ttl: R || 604800
|
|
7420
7432
|
// Default: 7 days
|
|
7421
7433
|
};
|
|
7422
7434
|
console.log("Identity request input:", b);
|
|
@@ -7431,15 +7443,15 @@ function Br(e) {
|
|
|
7431
7443
|
},
|
|
7432
7444
|
[e, t]
|
|
7433
7445
|
), f = oe(
|
|
7434
|
-
async (
|
|
7446
|
+
async (S, R) => {
|
|
7435
7447
|
if (e) {
|
|
7436
7448
|
o(!0), d(null);
|
|
7437
7449
|
try {
|
|
7438
7450
|
const b = {
|
|
7439
7451
|
applicantId: e,
|
|
7440
7452
|
restart: !1,
|
|
7441
|
-
redirectUrl:
|
|
7442
|
-
ttl:
|
|
7453
|
+
redirectUrl: S,
|
|
7454
|
+
ttl: R
|
|
7443
7455
|
}, O = await t.identityCompanyRequest(b);
|
|
7444
7456
|
return r(O), O;
|
|
7445
7457
|
} catch (b) {
|
|
@@ -7450,7 +7462,7 @@ function Br(e) {
|
|
|
7450
7462
|
}
|
|
7451
7463
|
},
|
|
7452
7464
|
[e, t]
|
|
7453
|
-
),
|
|
7465
|
+
), g = oe(async () => {
|
|
7454
7466
|
if (e) {
|
|
7455
7467
|
if (u.current) {
|
|
7456
7468
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -7458,18 +7470,18 @@ function Br(e) {
|
|
|
7458
7470
|
}
|
|
7459
7471
|
u.current = !0, o(!0), d(null);
|
|
7460
7472
|
try {
|
|
7461
|
-
const
|
|
7473
|
+
const S = {
|
|
7462
7474
|
applicantId: e,
|
|
7463
7475
|
restart: !0,
|
|
7464
7476
|
redirectUrl: "",
|
|
7465
7477
|
ttl: 604800
|
|
7466
7478
|
// 7 days
|
|
7467
7479
|
};
|
|
7468
|
-
console.log("Restarting identity with input:",
|
|
7469
|
-
const
|
|
7470
|
-
return console.log("Restart identity result:",
|
|
7471
|
-
} catch (
|
|
7472
|
-
throw d(
|
|
7480
|
+
console.log("Restarting identity with input:", S);
|
|
7481
|
+
const R = await t.identityRequest(S);
|
|
7482
|
+
return console.log("Restart identity result:", R), r(R), R;
|
|
7483
|
+
} catch (S) {
|
|
7484
|
+
throw d(S), S;
|
|
7473
7485
|
} finally {
|
|
7474
7486
|
o(!1), u.current = !1;
|
|
7475
7487
|
}
|
|
@@ -7483,18 +7495,18 @@ function Br(e) {
|
|
|
7483
7495
|
error: l,
|
|
7484
7496
|
requestIdentity: m,
|
|
7485
7497
|
requestCompanyIdentity: f,
|
|
7486
|
-
restartIdentity:
|
|
7498
|
+
restartIdentity: g
|
|
7487
7499
|
};
|
|
7488
7500
|
}
|
|
7489
7501
|
function qr(e) {
|
|
7490
|
-
const { riskScoringService: t, applicantService: a } = Me(), [r, n] = w(null), [o, l] = w({}), [d, u] = w(!1), [m, f] = w(!1), [
|
|
7502
|
+
const { riskScoringService: t, applicantService: a } = Me(), [r, n] = w(null), [o, l] = w({}), [d, u] = w(!1), [m, f] = w(!1), [g, S] = w(null), [R, b] = w(null), O = ge(!1), N = ge(null), H = oe(async () => {
|
|
7491
7503
|
var F;
|
|
7492
7504
|
if (e) {
|
|
7493
7505
|
if (O.current) {
|
|
7494
7506
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
7495
7507
|
return;
|
|
7496
7508
|
}
|
|
7497
|
-
O.current = !0, u(!0),
|
|
7509
|
+
O.current = !0, u(!0), S(null);
|
|
7498
7510
|
try {
|
|
7499
7511
|
const [L, q] = await Promise.all([
|
|
7500
7512
|
t.getRiskCriterias(e),
|
|
@@ -7502,34 +7514,34 @@ function qr(e) {
|
|
|
7502
7514
|
]);
|
|
7503
7515
|
if (n(L), (F = q == null ? void 0 : q.riskScoringResults) != null && F.length) {
|
|
7504
7516
|
const J = q.riskScoringResults[0], ie = {};
|
|
7505
|
-
for (const
|
|
7506
|
-
if (
|
|
7517
|
+
for (const C of J.riskCriteriaResults ?? [])
|
|
7518
|
+
if (C.riskCriteriaId != null && C.answer != null && C.answer !== "") {
|
|
7507
7519
|
const z = [...new Set(
|
|
7508
|
-
|
|
7520
|
+
C.answer.split(",").map((K) => K.trim()).filter((K) => K !== "")
|
|
7509
7521
|
)];
|
|
7510
|
-
z.length > 0 && (ie[
|
|
7522
|
+
z.length > 0 && (ie[C.riskCriteriaId] = z);
|
|
7511
7523
|
}
|
|
7512
7524
|
l(ie);
|
|
7513
7525
|
}
|
|
7514
|
-
|
|
7526
|
+
N.current = e;
|
|
7515
7527
|
} catch (L) {
|
|
7516
|
-
|
|
7528
|
+
S(L);
|
|
7517
7529
|
} finally {
|
|
7518
7530
|
u(!1), O.current = !1;
|
|
7519
7531
|
}
|
|
7520
7532
|
}
|
|
7521
7533
|
}, [e, t, a]);
|
|
7522
7534
|
he(() => {
|
|
7523
|
-
e &&
|
|
7535
|
+
e && N.current !== e && H();
|
|
7524
7536
|
}, [e]);
|
|
7525
7537
|
const B = oe(
|
|
7526
7538
|
async (F) => {
|
|
7527
|
-
f(!0),
|
|
7539
|
+
f(!0), S(null);
|
|
7528
7540
|
try {
|
|
7529
7541
|
const L = await t.submitRiskScoring(F);
|
|
7530
7542
|
return b(L), L;
|
|
7531
7543
|
} catch (L) {
|
|
7532
|
-
throw
|
|
7544
|
+
throw S(L), L;
|
|
7533
7545
|
} finally {
|
|
7534
7546
|
f(!1);
|
|
7535
7547
|
}
|
|
@@ -7539,33 +7551,33 @@ function qr(e) {
|
|
|
7539
7551
|
return {
|
|
7540
7552
|
criteria: r,
|
|
7541
7553
|
initialAnswers: o,
|
|
7542
|
-
result:
|
|
7554
|
+
result: R,
|
|
7543
7555
|
isLoading: d,
|
|
7544
7556
|
isSubmitting: m,
|
|
7545
|
-
error:
|
|
7557
|
+
error: g,
|
|
7546
7558
|
load: H,
|
|
7547
7559
|
submit: B
|
|
7548
7560
|
};
|
|
7549
7561
|
}
|
|
7550
7562
|
function di() {
|
|
7551
|
-
const { applicantService: e, config: t } = Me(), [a, r] = w(!1), [n, o] = w(null), l = ge(!1), d = ge(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
|
7563
|
+
const { applicantService: e, config: t } = Me(), [a, r] = w(!1), [n, o] = w(null), l = ge(!1), d = ge(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(R) {
|
|
7552
7564
|
const b = Math.random() * 16 | 0;
|
|
7553
|
-
return (
|
|
7565
|
+
return (R === "x" ? b : b & 3 | 8).toString(16);
|
|
7554
7566
|
}), m = oe(
|
|
7555
|
-
async (
|
|
7567
|
+
async (R) => {
|
|
7556
7568
|
var b;
|
|
7557
7569
|
if (l.current)
|
|
7558
7570
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
7559
7571
|
l.current = !0, r(!0), o(null);
|
|
7560
7572
|
try {
|
|
7561
|
-
if (
|
|
7562
|
-
const
|
|
7563
|
-
console.log("[SardinAI] Generated session key:",
|
|
7573
|
+
if (R.applicantAdditionalDatas || (R.applicantAdditionalDatas = []), (b = t.identityProviders) != null && b.sardinai) {
|
|
7574
|
+
const N = u();
|
|
7575
|
+
console.log("[SardinAI] Generated session key:", N), R.applicantAdditionalDatas.push({
|
|
7564
7576
|
paramName: "sessionKey",
|
|
7565
|
-
value:
|
|
7577
|
+
value: N
|
|
7566
7578
|
});
|
|
7567
7579
|
}
|
|
7568
|
-
return await e.createApplicant(
|
|
7580
|
+
return await e.createApplicant(R);
|
|
7569
7581
|
} catch (O) {
|
|
7570
7582
|
throw o(O), O;
|
|
7571
7583
|
} finally {
|
|
@@ -7574,10 +7586,10 @@ function di() {
|
|
|
7574
7586
|
},
|
|
7575
7587
|
[e, t]
|
|
7576
7588
|
), f = oe(
|
|
7577
|
-
async (
|
|
7589
|
+
async (R) => {
|
|
7578
7590
|
r(!0), o(null);
|
|
7579
7591
|
try {
|
|
7580
|
-
return await e.createCompanyApplicant(
|
|
7592
|
+
return await e.createCompanyApplicant(R);
|
|
7581
7593
|
} catch (b) {
|
|
7582
7594
|
throw o(b), b;
|
|
7583
7595
|
} finally {
|
|
@@ -7585,11 +7597,11 @@ function di() {
|
|
|
7585
7597
|
}
|
|
7586
7598
|
},
|
|
7587
7599
|
[e]
|
|
7588
|
-
),
|
|
7589
|
-
async (
|
|
7600
|
+
), g = oe(
|
|
7601
|
+
async (R) => {
|
|
7590
7602
|
d.current = !0, r(!0), o(null);
|
|
7591
7603
|
try {
|
|
7592
|
-
return await e.getApplicantData(
|
|
7604
|
+
return await e.getApplicantData(R);
|
|
7593
7605
|
} catch (b) {
|
|
7594
7606
|
throw o(b), b;
|
|
7595
7607
|
} finally {
|
|
@@ -7597,11 +7609,11 @@ function di() {
|
|
|
7597
7609
|
}
|
|
7598
7610
|
},
|
|
7599
7611
|
[e]
|
|
7600
|
-
),
|
|
7601
|
-
async (
|
|
7612
|
+
), S = oe(
|
|
7613
|
+
async (R) => {
|
|
7602
7614
|
r(!0), o(null);
|
|
7603
7615
|
try {
|
|
7604
|
-
await e.stopProgress(
|
|
7616
|
+
await e.stopProgress(R);
|
|
7605
7617
|
} catch (b) {
|
|
7606
7618
|
throw o(b), b;
|
|
7607
7619
|
} finally {
|
|
@@ -7615,11 +7627,11 @@ function di() {
|
|
|
7615
7627
|
error: n,
|
|
7616
7628
|
createApplicant: m,
|
|
7617
7629
|
createCompanyApplicant: f,
|
|
7618
|
-
getApplicantData:
|
|
7619
|
-
stopProgress:
|
|
7630
|
+
getApplicantData: g,
|
|
7631
|
+
stopProgress: S
|
|
7620
7632
|
};
|
|
7621
7633
|
}
|
|
7622
|
-
const
|
|
7634
|
+
const Kr = {
|
|
7623
7635
|
primary: {
|
|
7624
7636
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
7625
7637
|
color: "#ffffff",
|
|
@@ -7667,7 +7679,7 @@ const Ur = {
|
|
|
7667
7679
|
return /* @__PURE__ */ s(
|
|
7668
7680
|
"button",
|
|
7669
7681
|
{
|
|
7670
|
-
className:
|
|
7682
|
+
className: Ke(u, m[a], o),
|
|
7671
7683
|
style: {
|
|
7672
7684
|
display: "inline-flex",
|
|
7673
7685
|
alignItems: "center",
|
|
@@ -7680,7 +7692,7 @@ const Ur = {
|
|
|
7680
7692
|
opacity: n || r ? 0.5 : 1,
|
|
7681
7693
|
lineHeight: "1.25rem",
|
|
7682
7694
|
...f[a],
|
|
7683
|
-
...
|
|
7695
|
+
...Kr[t],
|
|
7684
7696
|
...l
|
|
7685
7697
|
},
|
|
7686
7698
|
disabled: n || r,
|
|
@@ -7739,7 +7751,7 @@ const Ur = {
|
|
|
7739
7751
|
"input",
|
|
7740
7752
|
{
|
|
7741
7753
|
ref: u,
|
|
7742
|
-
className:
|
|
7754
|
+
className: Ke(
|
|
7743
7755
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
7744
7756
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
7745
7757
|
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
@@ -7768,7 +7780,7 @@ Ne.displayName = "Input";
|
|
|
7768
7780
|
const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
7769
7781
|
"div",
|
|
7770
7782
|
{
|
|
7771
|
-
className:
|
|
7783
|
+
className: Ke("metakyc-card rounded-xl shadow-sm border", t),
|
|
7772
7784
|
style: {
|
|
7773
7785
|
backgroundColor: "var(--metakyc-surface, #ffffff)",
|
|
7774
7786
|
borderColor: "var(--metakyc-border, #e5e7eb)",
|
|
@@ -7784,7 +7796,7 @@ const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
7784
7796
|
), Ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
7785
7797
|
"div",
|
|
7786
7798
|
{
|
|
7787
|
-
className:
|
|
7799
|
+
className: Ke("metakyc-card-header px-6 py-4 border-b", t),
|
|
7788
7800
|
style: {
|
|
7789
7801
|
padding: "1rem 1.5rem",
|
|
7790
7802
|
borderBottomWidth: "1px",
|
|
@@ -7798,7 +7810,7 @@ const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
7798
7810
|
), ne = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
7799
7811
|
"div",
|
|
7800
7812
|
{
|
|
7801
|
-
className:
|
|
7813
|
+
className: Ke("metakyc-card-content px-6 py-4", t),
|
|
7802
7814
|
style: { padding: "1rem 1.5rem", ...a },
|
|
7803
7815
|
...r,
|
|
7804
7816
|
children: e
|
|
@@ -7806,7 +7818,7 @@ const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
7806
7818
|
), Le = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
7807
7819
|
"div",
|
|
7808
7820
|
{
|
|
7809
|
-
className:
|
|
7821
|
+
className: Ke("metakyc-card-footer px-6 py-4 border-t", t),
|
|
7810
7822
|
style: {
|
|
7811
7823
|
padding: "1rem 1.5rem",
|
|
7812
7824
|
borderTopWidth: "1px",
|
|
@@ -7817,7 +7829,7 @@ const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
7817
7829
|
...r,
|
|
7818
7830
|
children: e
|
|
7819
7831
|
}
|
|
7820
|
-
),
|
|
7832
|
+
), Ur = {
|
|
7821
7833
|
display: "inline-flex",
|
|
7822
7834
|
alignItems: "center",
|
|
7823
7835
|
justifyContent: "center",
|
|
@@ -7853,7 +7865,7 @@ const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
7853
7865
|
(d.key === " " || d.key === "Enter") && (d.preventDefault(), a || t(!e));
|
|
7854
7866
|
},
|
|
7855
7867
|
style: {
|
|
7856
|
-
...
|
|
7868
|
+
...Ur,
|
|
7857
7869
|
backgroundColor: e ? l : o,
|
|
7858
7870
|
borderColor: e ? l : n,
|
|
7859
7871
|
opacity: a ? 0.5 : 1,
|
|
@@ -7909,7 +7921,7 @@ const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
7909
7921
|
}, mi = ({ children: e, variant: t = "default", className: a, style: r, ...n }) => /* @__PURE__ */ i(
|
|
7910
7922
|
"span",
|
|
7911
7923
|
{
|
|
7912
|
-
className:
|
|
7924
|
+
className: Ke(
|
|
7913
7925
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
7914
7926
|
a
|
|
7915
7927
|
),
|
|
@@ -7923,10 +7935,10 @@ const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
7923
7935
|
md: "h-8 w-8",
|
|
7924
7936
|
lg: "h-12 w-12"
|
|
7925
7937
|
};
|
|
7926
|
-
return /* @__PURE__ */ i("div", { className:
|
|
7938
|
+
return /* @__PURE__ */ i("div", { className: Ke("flex items-center justify-center", t), ...a, children: /* @__PURE__ */ s(
|
|
7927
7939
|
"svg",
|
|
7928
7940
|
{
|
|
7929
|
-
className:
|
|
7941
|
+
className: Ke("animate-spin text-primary-500", r[e]),
|
|
7930
7942
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7931
7943
|
fill: "none",
|
|
7932
7944
|
viewBox: "0 0 24 24",
|
|
@@ -7970,7 +7982,7 @@ const ae = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
7970
7982
|
"select",
|
|
7971
7983
|
{
|
|
7972
7984
|
ref: u,
|
|
7973
|
-
className:
|
|
7985
|
+
className: Ke(
|
|
7974
7986
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
7975
7987
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
7976
7988
|
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
@@ -8030,7 +8042,7 @@ const _t = 280, Yr = ({
|
|
|
8030
8042
|
readOnly: l = !1,
|
|
8031
8043
|
required: d = !1
|
|
8032
8044
|
}) => {
|
|
8033
|
-
const { t: u } = Ie(), m = n ?? u("common.select"), f = o || l, [
|
|
8045
|
+
const { t: u } = Ie(), m = n ?? u("common.select"), f = o || l, [g, S] = w(!1), [R, b] = w(""), [O, N] = w(null), [H, B] = w({
|
|
8034
8046
|
bg: "#ffffff",
|
|
8035
8047
|
borderColor: "#d1d5db",
|
|
8036
8048
|
textPrimary: "#111827",
|
|
@@ -8053,34 +8065,34 @@ const _t = 280, Yr = ({
|
|
|
8053
8065
|
primaryLight: E("--metakyc-primary-light", "#eff6ff"),
|
|
8054
8066
|
hoverBg: E("--metakyc-surface", V)
|
|
8055
8067
|
});
|
|
8056
|
-
}, []),
|
|
8068
|
+
}, []), C = oe(() => {
|
|
8057
8069
|
if (f) return;
|
|
8058
8070
|
ie();
|
|
8059
8071
|
const M = J();
|
|
8060
|
-
M &&
|
|
8072
|
+
M && N(M), S(!0);
|
|
8061
8073
|
}, [f, J, ie]), z = oe(() => {
|
|
8062
|
-
|
|
8074
|
+
S(!1), b("");
|
|
8063
8075
|
}, []);
|
|
8064
8076
|
he(() => {
|
|
8065
|
-
if (!
|
|
8077
|
+
if (!g) return;
|
|
8066
8078
|
const M = (E) => {
|
|
8067
8079
|
var fe, ue;
|
|
8068
8080
|
const V = E.target;
|
|
8069
8081
|
!((fe = F.current) != null && fe.contains(V)) && !((ue = q.current) != null && ue.contains(V)) && z();
|
|
8070
8082
|
};
|
|
8071
8083
|
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
8072
|
-
}, [
|
|
8073
|
-
if (!
|
|
8084
|
+
}, [g, z]), he(() => {
|
|
8085
|
+
if (!g) return;
|
|
8074
8086
|
const M = () => {
|
|
8075
8087
|
const E = J();
|
|
8076
|
-
E &&
|
|
8088
|
+
E && N(E);
|
|
8077
8089
|
};
|
|
8078
8090
|
return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), () => {
|
|
8079
8091
|
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
|
|
8080
8092
|
};
|
|
8081
|
-
}, [
|
|
8082
|
-
const
|
|
8083
|
-
(M) => M.label.toLowerCase().includes(
|
|
8093
|
+
}, [g, J]);
|
|
8094
|
+
const K = r.filter(
|
|
8095
|
+
(M) => M.label.toLowerCase().includes(R.toLowerCase())
|
|
8084
8096
|
), ee = (M) => {
|
|
8085
8097
|
f || a(t.includes(M) ? t.filter((E) => E !== M) : [...t, M]);
|
|
8086
8098
|
}, X = (M, E) => {
|
|
@@ -8088,7 +8100,7 @@ const _t = 280, Yr = ({
|
|
|
8088
8100
|
}, W = (M) => {
|
|
8089
8101
|
var E;
|
|
8090
8102
|
return ((E = r.find((V) => V.value === M)) == null ? void 0 : E.label) || M;
|
|
8091
|
-
}, { bg: te, borderColor: de, textPrimary: le, textSecondary: je, primaryColor: re, primaryLight: Ce, hoverBg: Se } = H, ye =
|
|
8103
|
+
}, { bg: te, borderColor: de, textPrimary: le, textSecondary: je, primaryColor: re, primaryLight: Ce, hoverBg: Se } = H, ye = g && O && /* @__PURE__ */ s(
|
|
8092
8104
|
"div",
|
|
8093
8105
|
{
|
|
8094
8106
|
ref: q,
|
|
@@ -8111,7 +8123,7 @@ const _t = 280, Yr = ({
|
|
|
8111
8123
|
"input",
|
|
8112
8124
|
{
|
|
8113
8125
|
type: "text",
|
|
8114
|
-
value:
|
|
8126
|
+
value: R,
|
|
8115
8127
|
onChange: (M) => b(M.target.value),
|
|
8116
8128
|
placeholder: u("common.search"),
|
|
8117
8129
|
autoFocus: !0,
|
|
@@ -8138,7 +8150,7 @@ const _t = 280, Yr = ({
|
|
|
8138
8150
|
}
|
|
8139
8151
|
}
|
|
8140
8152
|
) }),
|
|
8141
|
-
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children:
|
|
8153
|
+
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: K.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: je }, children: u("common.noResults") }) : K.map((M) => {
|
|
8142
8154
|
const E = t.includes(M.value);
|
|
8143
8155
|
return /* @__PURE__ */ s(
|
|
8144
8156
|
"li",
|
|
@@ -8212,8 +8224,8 @@ const _t = 280, Yr = ({
|
|
|
8212
8224
|
"div",
|
|
8213
8225
|
{
|
|
8214
8226
|
ref: L,
|
|
8215
|
-
onClick: () =>
|
|
8216
|
-
className:
|
|
8227
|
+
onClick: () => g ? z() : C(),
|
|
8228
|
+
className: Ke(
|
|
8217
8229
|
"metakyc-multiselect-trigger",
|
|
8218
8230
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
8219
8231
|
f ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
@@ -8221,8 +8233,8 @@ const _t = 280, Yr = ({
|
|
|
8221
8233
|
style: {
|
|
8222
8234
|
minHeight: "38px",
|
|
8223
8235
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
8224
|
-
borderColor:
|
|
8225
|
-
outline:
|
|
8236
|
+
borderColor: g ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
8237
|
+
outline: g ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
8226
8238
|
outlineOffset: "-1px"
|
|
8227
8239
|
},
|
|
8228
8240
|
children: [
|
|
@@ -8280,7 +8292,7 @@ const _t = 280, Yr = ({
|
|
|
8280
8292
|
{
|
|
8281
8293
|
className: "metakyc-multiselect-arrow absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-xs",
|
|
8282
8294
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
8283
|
-
children:
|
|
8295
|
+
children: g ? "▲" : "▼"
|
|
8284
8296
|
}
|
|
8285
8297
|
)
|
|
8286
8298
|
]
|
|
@@ -8302,7 +8314,7 @@ const _t = 280, Yr = ({
|
|
|
8302
8314
|
className: f
|
|
8303
8315
|
}) => {
|
|
8304
8316
|
var ue;
|
|
8305
|
-
const { t:
|
|
8317
|
+
const { t: g } = Ie(), S = n ?? g("common.select"), R = d || u, [b, O] = w(!1), [N, H] = w(""), [B, F] = w(null), [L, q] = w({
|
|
8306
8318
|
bg: "#ffffff",
|
|
8307
8319
|
border: "#d1d5db",
|
|
8308
8320
|
text: "#111827",
|
|
@@ -8321,9 +8333,9 @@ const _t = 280, Yr = ({
|
|
|
8321
8333
|
primaryLight: _("--metakyc-primary-light", "#eff6ff"),
|
|
8322
8334
|
hoverBg: _("--metakyc-surface", ve)
|
|
8323
8335
|
});
|
|
8324
|
-
}, []), ie = ge(null),
|
|
8325
|
-
if (!
|
|
8326
|
-
const j =
|
|
8336
|
+
}, []), ie = ge(null), C = ge(null), z = ge(null), K = ge(null), ee = oe(() => {
|
|
8337
|
+
if (!C.current) return null;
|
|
8338
|
+
const j = C.current.getBoundingClientRect(), ve = window.innerHeight - j.bottom < Gt && j.top > Gt;
|
|
8327
8339
|
return {
|
|
8328
8340
|
top: ve ? j.top : j.bottom + 4,
|
|
8329
8341
|
left: j.left,
|
|
@@ -8331,11 +8343,11 @@ const _t = 280, Yr = ({
|
|
|
8331
8343
|
openUp: ve
|
|
8332
8344
|
};
|
|
8333
8345
|
}, []), X = oe(() => {
|
|
8334
|
-
if (
|
|
8346
|
+
if (R) return;
|
|
8335
8347
|
J();
|
|
8336
8348
|
const j = ee();
|
|
8337
8349
|
j && F(j), O(!0);
|
|
8338
|
-
}, [
|
|
8350
|
+
}, [R, ee, J]), W = oe(() => {
|
|
8339
8351
|
O(!1), H("");
|
|
8340
8352
|
}, []), te = () => b ? W() : X();
|
|
8341
8353
|
he(() => {
|
|
@@ -8356,15 +8368,15 @@ const _t = 280, Yr = ({
|
|
|
8356
8368
|
window.removeEventListener("scroll", j, !0), window.removeEventListener("resize", j);
|
|
8357
8369
|
};
|
|
8358
8370
|
}, [b, ee]), he(() => {
|
|
8359
|
-
b &&
|
|
8371
|
+
b && K.current && setTimeout(() => {
|
|
8360
8372
|
var j;
|
|
8361
|
-
return (j =
|
|
8373
|
+
return (j = K.current) == null ? void 0 : j.focus();
|
|
8362
8374
|
}, 0);
|
|
8363
8375
|
}, [b]);
|
|
8364
8376
|
const de = r.filter(
|
|
8365
|
-
(j) => j.label.toLowerCase().includes(
|
|
8377
|
+
(j) => j.label.toLowerCase().includes(N.toLowerCase()) || j.value.toLowerCase().includes(N.toLowerCase())
|
|
8366
8378
|
), le = (ue = r.find((j) => j.value === o)) == null ? void 0 : ue.label, je = (j, _) => {
|
|
8367
|
-
|
|
8379
|
+
R || _ || (l(j), W());
|
|
8368
8380
|
}, { bg: re, border: Ce, text: Se, textSecondary: ye, primary: M, primaryLight: E, hoverBg: V } = L, fe = b && B && /* @__PURE__ */ s(
|
|
8369
8381
|
"div",
|
|
8370
8382
|
{
|
|
@@ -8387,11 +8399,11 @@ const _t = 280, Yr = ({
|
|
|
8387
8399
|
/* @__PURE__ */ i("div", { style: { padding: "8px", borderBottom: `1px solid ${Ce}` }, children: /* @__PURE__ */ i(
|
|
8388
8400
|
"input",
|
|
8389
8401
|
{
|
|
8390
|
-
ref:
|
|
8402
|
+
ref: K,
|
|
8391
8403
|
type: "text",
|
|
8392
|
-
value:
|
|
8404
|
+
value: N,
|
|
8393
8405
|
onChange: (j) => H(j.target.value),
|
|
8394
|
-
placeholder:
|
|
8406
|
+
placeholder: g("common.search"),
|
|
8395
8407
|
onClick: (j) => j.stopPropagation(),
|
|
8396
8408
|
className: "metakyc-searchable-select-search w-full",
|
|
8397
8409
|
style: {
|
|
@@ -8425,7 +8437,7 @@ const _t = 280, Yr = ({
|
|
|
8425
8437
|
maxHeight: "208px",
|
|
8426
8438
|
overflowY: "auto"
|
|
8427
8439
|
},
|
|
8428
|
-
children: de.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: ye }, children:
|
|
8440
|
+
children: de.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: ye }, children: g("common.noResults") }) : de.map((j) => {
|
|
8429
8441
|
const _ = j.value === o;
|
|
8430
8442
|
return /* @__PURE__ */ i(
|
|
8431
8443
|
"li",
|
|
@@ -8460,7 +8472,7 @@ const _t = 280, Yr = ({
|
|
|
8460
8472
|
return /* @__PURE__ */ s(
|
|
8461
8473
|
"div",
|
|
8462
8474
|
{
|
|
8463
|
-
className:
|
|
8475
|
+
className: Ke("w-full metakyc-searchable-select", f),
|
|
8464
8476
|
ref: ie,
|
|
8465
8477
|
children: [
|
|
8466
8478
|
e && /* @__PURE__ */ s(
|
|
@@ -8477,19 +8489,19 @@ const _t = 280, Yr = ({
|
|
|
8477
8489
|
/* @__PURE__ */ s(
|
|
8478
8490
|
"div",
|
|
8479
8491
|
{
|
|
8480
|
-
ref:
|
|
8492
|
+
ref: C,
|
|
8481
8493
|
role: "button",
|
|
8482
|
-
tabIndex:
|
|
8494
|
+
tabIndex: R ? -1 : 0,
|
|
8483
8495
|
onClick: te,
|
|
8484
8496
|
onKeyDown: (j) => {
|
|
8485
8497
|
(j.key === "Enter" || j.key === " ") && (j.preventDefault(), te()), j.key === "Escape" && W();
|
|
8486
8498
|
},
|
|
8487
|
-
className:
|
|
8499
|
+
className: Ke(
|
|
8488
8500
|
"metakyc-searchable-select-trigger",
|
|
8489
8501
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors text-left",
|
|
8490
8502
|
"flex items-center justify-between gap-2",
|
|
8491
8503
|
"focus:outline-none",
|
|
8492
|
-
|
|
8504
|
+
R ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
8493
8505
|
),
|
|
8494
8506
|
style: {
|
|
8495
8507
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
@@ -8500,7 +8512,7 @@ const _t = 280, Yr = ({
|
|
|
8500
8512
|
outlineOffset: "-1px"
|
|
8501
8513
|
},
|
|
8502
8514
|
children: [
|
|
8503
|
-
/* @__PURE__ */ i("span", { className: "truncate flex-1", children: le ||
|
|
8515
|
+
/* @__PURE__ */ i("span", { className: "truncate flex-1", children: le || S }),
|
|
8504
8516
|
/* @__PURE__ */ i(
|
|
8505
8517
|
"span",
|
|
8506
8518
|
{
|
|
@@ -8536,30 +8548,30 @@ const $r = ({
|
|
|
8536
8548
|
value: u = [],
|
|
8537
8549
|
className: m
|
|
8538
8550
|
}) => {
|
|
8539
|
-
const { t: f } = Ie(), [
|
|
8540
|
-
if (!
|
|
8551
|
+
const { t: f } = Ie(), [g, S] = w(!1), [R, b] = w(null), O = ge(null), N = oe((C) => {
|
|
8552
|
+
if (!C) return;
|
|
8541
8553
|
b(null);
|
|
8542
|
-
const z = Array.from(
|
|
8554
|
+
const z = Array.from(C);
|
|
8543
8555
|
if (o && z.filter((ee) => ee.size > o).length > 0) {
|
|
8544
8556
|
b(`File exceeds the maximum size of ${It(o)}`);
|
|
8545
8557
|
return;
|
|
8546
8558
|
}
|
|
8547
8559
|
d == null || d(n ? [...u, ...z] : [z[0]]);
|
|
8548
|
-
}, [o, n, d, u]), H = oe((
|
|
8549
|
-
|
|
8550
|
-
}, []), B = oe((
|
|
8551
|
-
|
|
8552
|
-
}, []), F = oe((
|
|
8553
|
-
|
|
8554
|
-
}, [
|
|
8555
|
-
var
|
|
8556
|
-
(
|
|
8557
|
-
}, q = (
|
|
8560
|
+
}, [o, n, d, u]), H = oe((C) => {
|
|
8561
|
+
C.preventDefault(), C.stopPropagation(), S(!0);
|
|
8562
|
+
}, []), B = oe((C) => {
|
|
8563
|
+
C.preventDefault(), C.stopPropagation(), S(!1);
|
|
8564
|
+
}, []), F = oe((C) => {
|
|
8565
|
+
C.preventDefault(), C.stopPropagation(), S(!1), N(C.dataTransfer.files);
|
|
8566
|
+
}, [N]), L = () => {
|
|
8567
|
+
var C;
|
|
8568
|
+
(C = O.current) == null || C.click();
|
|
8569
|
+
}, q = (C) => {
|
|
8558
8570
|
b(null);
|
|
8559
|
-
const z = u.filter((
|
|
8571
|
+
const z = u.filter((K, ee) => ee !== C);
|
|
8560
8572
|
d == null || d(z);
|
|
8561
|
-
}, J = a ||
|
|
8562
|
-
return /* @__PURE__ */ s("div", { className:
|
|
8573
|
+
}, J = a || R, ie = u.length > 0;
|
|
8574
|
+
return /* @__PURE__ */ s("div", { className: Ke("metakyc-file-upload", m), style: { width: "100%" }, children: [
|
|
8563
8575
|
e && /* @__PURE__ */ s("div", { style: { marginBottom: "8px" }, children: [
|
|
8564
8576
|
/* @__PURE__ */ s(
|
|
8565
8577
|
"label",
|
|
@@ -8587,13 +8599,13 @@ const $r = ({
|
|
|
8587
8599
|
onDragLeave: B,
|
|
8588
8600
|
onDrop: F,
|
|
8589
8601
|
style: {
|
|
8590
|
-
border: `2px dashed ${J ? "var(--metakyc-danger, #ef4444)" :
|
|
8602
|
+
border: `2px dashed ${J ? "var(--metakyc-danger, #ef4444)" : g ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
|
|
8591
8603
|
borderRadius: "12px",
|
|
8592
8604
|
padding: ie ? "20px" : "32px 20px",
|
|
8593
8605
|
textAlign: "center",
|
|
8594
8606
|
cursor: "pointer",
|
|
8595
8607
|
transition: "all 0.2s ease",
|
|
8596
|
-
backgroundColor:
|
|
8608
|
+
backgroundColor: g ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 5%, var(--metakyc-background, #ffffff))" : "var(--metakyc-background, #ffffff)"
|
|
8597
8609
|
},
|
|
8598
8610
|
children: [
|
|
8599
8611
|
/* @__PURE__ */ i(
|
|
@@ -8604,8 +8616,8 @@ const $r = ({
|
|
|
8604
8616
|
style: { display: "none" },
|
|
8605
8617
|
accept: r,
|
|
8606
8618
|
multiple: n,
|
|
8607
|
-
onChange: (
|
|
8608
|
-
|
|
8619
|
+
onChange: (C) => {
|
|
8620
|
+
N(C.target.files), C.target.value = "";
|
|
8609
8621
|
}
|
|
8610
8622
|
}
|
|
8611
8623
|
),
|
|
@@ -8620,7 +8632,7 @@ const $r = ({
|
|
|
8620
8632
|
display: "flex",
|
|
8621
8633
|
alignItems: "center",
|
|
8622
8634
|
justifyContent: "center",
|
|
8623
|
-
backgroundColor:
|
|
8635
|
+
backgroundColor: g ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "var(--metakyc-surface, #f9fafb)",
|
|
8624
8636
|
transition: "background-color 0.2s ease"
|
|
8625
8637
|
},
|
|
8626
8638
|
children: /* @__PURE__ */ s(
|
|
@@ -8630,7 +8642,7 @@ const $r = ({
|
|
|
8630
8642
|
height: "24",
|
|
8631
8643
|
viewBox: "0 0 24 24",
|
|
8632
8644
|
fill: "none",
|
|
8633
|
-
stroke:
|
|
8645
|
+
stroke: g ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
8634
8646
|
strokeWidth: "2",
|
|
8635
8647
|
strokeLinecap: "round",
|
|
8636
8648
|
strokeLinejoin: "round",
|
|
@@ -8660,8 +8672,8 @@ const $r = ({
|
|
|
8660
8672
|
]
|
|
8661
8673
|
}
|
|
8662
8674
|
),
|
|
8663
|
-
ie && /* @__PURE__ */ i("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: u.map((
|
|
8664
|
-
const
|
|
8675
|
+
ie && /* @__PURE__ */ i("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: u.map((C, z) => {
|
|
8676
|
+
const K = Hr(C), ee = K === "image", X = ee ? URL.createObjectURL(C) : null;
|
|
8665
8677
|
return /* @__PURE__ */ s(
|
|
8666
8678
|
"div",
|
|
8667
8679
|
{
|
|
@@ -8695,10 +8707,10 @@ const $r = ({
|
|
|
8695
8707
|
"img",
|
|
8696
8708
|
{
|
|
8697
8709
|
src: X,
|
|
8698
|
-
alt:
|
|
8710
|
+
alt: C.name,
|
|
8699
8711
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
8700
8712
|
}
|
|
8701
|
-
) :
|
|
8713
|
+
) : K === "pdf" ? /* @__PURE__ */ s("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
8702
8714
|
/* @__PURE__ */ i("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
8703
8715
|
/* @__PURE__ */ i("polyline", { points: "14 2 14 8 20 8" }),
|
|
8704
8716
|
/* @__PURE__ */ i("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
@@ -8719,8 +8731,8 @@ const $r = ({
|
|
|
8719
8731
|
overflow: "hidden",
|
|
8720
8732
|
textOverflow: "ellipsis",
|
|
8721
8733
|
whiteSpace: "nowrap"
|
|
8722
|
-
}, children:
|
|
8723
|
-
/* @__PURE__ */ i("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: It(
|
|
8734
|
+
}, children: C.name }),
|
|
8735
|
+
/* @__PURE__ */ i("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: It(C.size) })
|
|
8724
8736
|
] }),
|
|
8725
8737
|
/* @__PURE__ */ i(
|
|
8726
8738
|
"button",
|
|
@@ -8758,7 +8770,7 @@ const $r = ({
|
|
|
8758
8770
|
)
|
|
8759
8771
|
]
|
|
8760
8772
|
},
|
|
8761
|
-
`${
|
|
8773
|
+
`${C.name}-${z}`
|
|
8762
8774
|
);
|
|
8763
8775
|
}) }),
|
|
8764
8776
|
J && /* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: J })
|
|
@@ -8783,7 +8795,7 @@ const $r = ({
|
|
|
8783
8795
|
type: "text",
|
|
8784
8796
|
value: e,
|
|
8785
8797
|
onChange: (o) => t == null ? void 0 : t(o.target.value),
|
|
8786
|
-
className:
|
|
8798
|
+
className: Ke(
|
|
8787
8799
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
8788
8800
|
"focus:outline-none focus:ring-2 focus:ring-offset-0"
|
|
8789
8801
|
),
|
|
@@ -8801,7 +8813,7 @@ const $r = ({
|
|
|
8801
8813
|
{
|
|
8802
8814
|
ref: n,
|
|
8803
8815
|
type: "tel",
|
|
8804
|
-
className:
|
|
8816
|
+
className: Ke("flex-1", a),
|
|
8805
8817
|
...r,
|
|
8806
8818
|
label: ""
|
|
8807
8819
|
}
|
|
@@ -8988,45 +9000,45 @@ const aa = ({
|
|
|
8988
9000
|
onComplete: t,
|
|
8989
9001
|
onBack: a
|
|
8990
9002
|
}) => {
|
|
8991
|
-
const { t: r } = Ie(), { questionnaire: n, initialAnswers: o, isLoading: l, isSubmitting: d, error: u, submit: m } = Fr(e), [f,
|
|
9003
|
+
const { t: r } = Ie(), { questionnaire: n, initialAnswers: o, isLoading: l, isSubmitting: d, error: u, submit: m } = Fr(e), [f, g] = w({}), [S, R] = w({}), [b, O] = w(0);
|
|
8992
9004
|
Re.useEffect(() => {
|
|
8993
|
-
o && Object.keys(o).length > 0 && Object.keys(f).length === 0 &&
|
|
9005
|
+
o && Object.keys(o).length > 0 && Object.keys(f).length === 0 && g(o);
|
|
8994
9006
|
}, [o]);
|
|
8995
|
-
const
|
|
9007
|
+
const N = Ue(
|
|
8996
9008
|
() => n ? ra(n.questionGroups) : [],
|
|
8997
9009
|
[n]
|
|
8998
|
-
), H = b ===
|
|
8999
|
-
|
|
9000
|
-
const ee = { ...
|
|
9001
|
-
return delete ee[
|
|
9010
|
+
), H = b === N.length - 1, B = N[b] ?? [], F = oe((C, z) => {
|
|
9011
|
+
g((K) => ({ ...K, [C]: z })), R((K) => {
|
|
9012
|
+
const ee = { ...K };
|
|
9013
|
+
return delete ee[C], ee;
|
|
9002
9014
|
});
|
|
9003
9015
|
}, []), L = oe(() => {
|
|
9004
|
-
const
|
|
9016
|
+
const C = {};
|
|
9005
9017
|
for (const { question: z } of B) {
|
|
9006
|
-
const
|
|
9007
|
-
|
|
9018
|
+
const K = ia(z, f[z.id] ?? []);
|
|
9019
|
+
K && (C[z.id] = K);
|
|
9008
9020
|
}
|
|
9009
|
-
return
|
|
9021
|
+
return R((z) => ({ ...z, ...C })), Object.keys(C).length === 0;
|
|
9010
9022
|
}, [B, f]), q = () => {
|
|
9011
|
-
L() && O((
|
|
9023
|
+
L() && O((C) => C + 1);
|
|
9012
9024
|
}, J = () => {
|
|
9013
|
-
b > 0 ? O((
|
|
9025
|
+
b > 0 ? O((C) => C - 1) : a == null || a();
|
|
9014
9026
|
}, ie = async () => {
|
|
9015
9027
|
if (!(!L() || !n))
|
|
9016
9028
|
try {
|
|
9017
|
-
const
|
|
9018
|
-
(
|
|
9029
|
+
const C = n.questionGroups.flatMap(
|
|
9030
|
+
(K) => (K.questions ?? []).map((ee) => ({
|
|
9019
9031
|
questionId: ee.id,
|
|
9020
9032
|
values: f[ee.id] ?? []
|
|
9021
9033
|
}))
|
|
9022
9034
|
), z = {
|
|
9023
9035
|
applicantId: e,
|
|
9024
9036
|
questionnarieId: n.id,
|
|
9025
|
-
questionResults:
|
|
9037
|
+
questionResults: C
|
|
9026
9038
|
};
|
|
9027
9039
|
await m(z), t == null || t();
|
|
9028
|
-
} catch (
|
|
9029
|
-
console.error("Questionnaire submit error:",
|
|
9040
|
+
} catch (C) {
|
|
9041
|
+
console.error("Questionnaire submit error:", C);
|
|
9030
9042
|
}
|
|
9031
9043
|
};
|
|
9032
9044
|
return l ? /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(Ye, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
@@ -9037,9 +9049,9 @@ const aa = ({
|
|
|
9037
9049
|
/* @__PURE__ */ s(Ae, { children: [
|
|
9038
9050
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
9039
9051
|
n.subtitle && /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.subtitle }),
|
|
9040
|
-
|
|
9041
|
-
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: b + 1, total:
|
|
9042
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children:
|
|
9052
|
+
N.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
|
|
9053
|
+
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: b + 1, total: N.length }) }),
|
|
9054
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: N.map((C, z) => /* @__PURE__ */ i(
|
|
9043
9055
|
"div",
|
|
9044
9056
|
{
|
|
9045
9057
|
className: "rounded-full transition-all duration-200",
|
|
@@ -9053,15 +9065,15 @@ const aa = ({
|
|
|
9053
9065
|
)) })
|
|
9054
9066
|
] })
|
|
9055
9067
|
] }),
|
|
9056
|
-
/* @__PURE__ */ i(ne, { className: "space-y-6", children: B.map(({ question:
|
|
9068
|
+
/* @__PURE__ */ i(ne, { className: "space-y-6", children: B.map(({ question: C }) => /* @__PURE__ */ i(
|
|
9057
9069
|
na,
|
|
9058
9070
|
{
|
|
9059
|
-
question:
|
|
9060
|
-
value: f[
|
|
9061
|
-
error:
|
|
9062
|
-
onChange: (z) => F(
|
|
9071
|
+
question: C,
|
|
9072
|
+
value: f[C.id] ?? [],
|
|
9073
|
+
error: S[C.id],
|
|
9074
|
+
onChange: (z) => F(C.id, z)
|
|
9063
9075
|
},
|
|
9064
|
-
|
|
9076
|
+
C.id
|
|
9065
9077
|
)) }),
|
|
9066
9078
|
/* @__PURE__ */ s(Le, { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
9067
9079
|
/* @__PURE__ */ s(
|
|
@@ -9175,7 +9187,7 @@ const aa = ({
|
|
|
9175
9187
|
(l === "checkbox" || l === "multi-select") && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
9176
9188
|
(e.defaultAnswers ?? []).map((u) => {
|
|
9177
9189
|
const m = t.includes(u), f = () => {
|
|
9178
|
-
r(m ? t.filter((
|
|
9190
|
+
r(m ? t.filter((g) => g !== u) : [...t, u]);
|
|
9179
9191
|
};
|
|
9180
9192
|
return /* @__PURE__ */ s(
|
|
9181
9193
|
"div",
|
|
@@ -9209,21 +9221,21 @@ const sa = ({
|
|
|
9209
9221
|
onComplete: t,
|
|
9210
9222
|
onBack: a
|
|
9211
9223
|
}) => {
|
|
9212
|
-
const { t: r } = Ie(), { uploadDocument: n, isLoading: o, isSubmitting: l, error: d, submit: u } = Or(e), [m, f] = w({}), [
|
|
9224
|
+
const { t: r } = Ie(), { uploadDocument: n, isLoading: o, isSubmitting: l, error: d, submit: u } = Or(e), [m, f] = w({}), [g, S] = w(null), [R, b] = w(0), [O, N] = w({}), H = Ue(
|
|
9213
9225
|
() => n ? oa(n.uploadDocumentFiles) : [],
|
|
9214
9226
|
[n]
|
|
9215
|
-
), B = H[
|
|
9227
|
+
), B = H[R] ?? [], F = R === H.length - 1, L = H.length, q = oe(() => {
|
|
9216
9228
|
const z = {};
|
|
9217
|
-
for (const
|
|
9218
|
-
|
|
9219
|
-
return
|
|
9229
|
+
for (const K of B)
|
|
9230
|
+
K.isRequired && (m[K.id] || []).length === 0 && (z[K.id] = `${K.displayName} is required`);
|
|
9231
|
+
return N(z), Object.keys(z).length === 0;
|
|
9220
9232
|
}, [B, m]), J = () => {
|
|
9221
|
-
q() && (b((z) => z + 1),
|
|
9233
|
+
q() && (b((z) => z + 1), N({}));
|
|
9222
9234
|
}, ie = () => {
|
|
9223
|
-
|
|
9224
|
-
},
|
|
9235
|
+
R > 0 ? (b((z) => z - 1), N({})) : a == null || a();
|
|
9236
|
+
}, C = async () => {
|
|
9225
9237
|
if (!(!q() || !n)) {
|
|
9226
|
-
|
|
9238
|
+
S(null);
|
|
9227
9239
|
try {
|
|
9228
9240
|
const z = await Promise.all(
|
|
9229
9241
|
n.uploadDocumentFiles.map(async (ee) => {
|
|
@@ -9238,14 +9250,14 @@ const sa = ({
|
|
|
9238
9250
|
valueList: W
|
|
9239
9251
|
};
|
|
9240
9252
|
})
|
|
9241
|
-
),
|
|
9253
|
+
), K = {
|
|
9242
9254
|
applicantId: e,
|
|
9243
9255
|
uploadDocumentId: n.id,
|
|
9244
9256
|
uploadDocumentResults: z
|
|
9245
9257
|
};
|
|
9246
|
-
await u(
|
|
9258
|
+
await u(K), t == null || t();
|
|
9247
9259
|
} catch (z) {
|
|
9248
|
-
|
|
9260
|
+
S((z == null ? void 0 : z.message) || r("uploadDocument.failedToSubmit"));
|
|
9249
9261
|
}
|
|
9250
9262
|
}
|
|
9251
9263
|
};
|
|
@@ -9294,23 +9306,23 @@ const sa = ({
|
|
|
9294
9306
|
justifyContent: "space-between",
|
|
9295
9307
|
marginTop: "12px"
|
|
9296
9308
|
}, children: [
|
|
9297
|
-
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current:
|
|
9298
|
-
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: H.map((z,
|
|
9309
|
+
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: R + 1, total: L }) }),
|
|
9310
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: H.map((z, K) => /* @__PURE__ */ i(
|
|
9299
9311
|
"div",
|
|
9300
9312
|
{
|
|
9301
9313
|
style: {
|
|
9302
9314
|
height: "6px",
|
|
9303
|
-
width:
|
|
9315
|
+
width: K === R ? "20px" : "6px",
|
|
9304
9316
|
borderRadius: "999px",
|
|
9305
9317
|
transition: "all 0.2s ease",
|
|
9306
|
-
backgroundColor:
|
|
9318
|
+
backgroundColor: K <= R ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
9307
9319
|
}
|
|
9308
9320
|
},
|
|
9309
|
-
|
|
9321
|
+
K
|
|
9310
9322
|
)) })
|
|
9311
9323
|
] })
|
|
9312
9324
|
] }),
|
|
9313
|
-
n.description &&
|
|
9325
|
+
n.description && R === 0 && /* @__PURE__ */ s("div", { style: {
|
|
9314
9326
|
margin: "0 24px",
|
|
9315
9327
|
marginTop: "4px",
|
|
9316
9328
|
display: "flex",
|
|
@@ -9357,16 +9369,16 @@ const sa = ({
|
|
|
9357
9369
|
required: z.isRequired,
|
|
9358
9370
|
error: O[z.id],
|
|
9359
9371
|
value: m[z.id] || [],
|
|
9360
|
-
onChange: (
|
|
9361
|
-
|
|
9372
|
+
onChange: (K) => {
|
|
9373
|
+
S(null), N((ee) => {
|
|
9362
9374
|
const X = { ...ee };
|
|
9363
9375
|
return delete X[z.id], X;
|
|
9364
|
-
}), f((ee) => ({ ...ee, [z.id]:
|
|
9376
|
+
}), f((ee) => ({ ...ee, [z.id]: K }));
|
|
9365
9377
|
}
|
|
9366
9378
|
},
|
|
9367
9379
|
z.id
|
|
9368
9380
|
)) }) }),
|
|
9369
|
-
|
|
9381
|
+
g && /* @__PURE__ */ s("div", { style: {
|
|
9370
9382
|
margin: "0 24px",
|
|
9371
9383
|
padding: "10px 14px",
|
|
9372
9384
|
borderRadius: "8px",
|
|
@@ -9381,7 +9393,7 @@ const sa = ({
|
|
|
9381
9393
|
/* @__PURE__ */ i("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
9382
9394
|
/* @__PURE__ */ i("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
9383
9395
|
] }),
|
|
9384
|
-
/* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
9396
|
+
/* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: g })
|
|
9385
9397
|
] }),
|
|
9386
9398
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ s("div", { style: {
|
|
9387
9399
|
display: "flex",
|
|
@@ -9395,7 +9407,7 @@ const sa = ({
|
|
|
9395
9407
|
type: "button",
|
|
9396
9408
|
variant: "outline",
|
|
9397
9409
|
onClick: ie,
|
|
9398
|
-
children:
|
|
9410
|
+
children: R > 0 ? r("common.previous") : r("common.back")
|
|
9399
9411
|
}
|
|
9400
9412
|
),
|
|
9401
9413
|
F ? /* @__PURE__ */ i(
|
|
@@ -9403,7 +9415,7 @@ const sa = ({
|
|
|
9403
9415
|
{
|
|
9404
9416
|
type: "button",
|
|
9405
9417
|
isLoading: l,
|
|
9406
|
-
onClick:
|
|
9418
|
+
onClick: C,
|
|
9407
9419
|
children: r(l ? "uploadDocument.uploading" : "common.continue")
|
|
9408
9420
|
}
|
|
9409
9421
|
) : /* @__PURE__ */ i(
|
|
@@ -9429,7 +9441,7 @@ const sa = ({
|
|
|
9429
9441
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: n.title || r("overview.title") }),
|
|
9430
9442
|
n.description && /* @__PURE__ */ i("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.description })
|
|
9431
9443
|
] }),
|
|
9432
|
-
/* @__PURE__ */ i(ne, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((f,
|
|
9444
|
+
/* @__PURE__ */ i(ne, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((f, g) => f.order - g.order).map((f) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
9433
9445
|
/* @__PURE__ */ i("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ i(
|
|
9434
9446
|
"div",
|
|
9435
9447
|
{
|
|
@@ -9527,41 +9539,41 @@ const ya = ({
|
|
|
9527
9539
|
onComplete: t,
|
|
9528
9540
|
onBack: a
|
|
9529
9541
|
}) => {
|
|
9530
|
-
const { t: r } = Ie(), { config: n } = Me(), o = n.locale ?? "en", { criteria: l, initialAnswers: d, isLoading: u, isSubmitting: m, error: f, submit:
|
|
9542
|
+
const { t: r } = Ie(), { config: n } = Me(), o = n.locale ?? "en", { criteria: l, initialAnswers: d, isLoading: u, isSubmitting: m, error: f, submit: g } = qr(e), [S, R] = w({}), [b, O] = w({}), [N, H] = w(0), [B, F] = w(!1);
|
|
9531
9543
|
Re.useEffect(() => {
|
|
9532
|
-
d && Object.keys(d).length > 0 && Object.keys(
|
|
9544
|
+
d && Object.keys(d).length > 0 && Object.keys(S).length === 0 && R(d);
|
|
9533
9545
|
}, [d]);
|
|
9534
|
-
const L =
|
|
9546
|
+
const L = Ue(
|
|
9535
9547
|
() => l && l.length > 0 ? pa(l) : [],
|
|
9536
9548
|
[l]
|
|
9537
|
-
), q =
|
|
9549
|
+
), q = N === L.length - 1, J = L[N] ?? [];
|
|
9538
9550
|
Re.useEffect(() => {
|
|
9539
|
-
!u && l && l.length === 0 && !B && !m && (F(!0),
|
|
9540
|
-
}, [u, l, B, m,
|
|
9551
|
+
!u && l && l.length === 0 && !B && !m && (F(!0), g({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
9552
|
+
}, [u, l, B, m, g, e, t]);
|
|
9541
9553
|
const ie = oe((X, W) => {
|
|
9542
|
-
|
|
9554
|
+
R((te) => ({ ...te, [X]: W })), O((te) => {
|
|
9543
9555
|
const de = { ...te };
|
|
9544
9556
|
return delete de[X], de;
|
|
9545
9557
|
});
|
|
9546
|
-
}, []),
|
|
9558
|
+
}, []), C = oe(() => {
|
|
9547
9559
|
const X = {};
|
|
9548
9560
|
for (const { criterion: W } of J) {
|
|
9549
|
-
const te = ua(W,
|
|
9561
|
+
const te = ua(W, S[W.id] ?? []);
|
|
9550
9562
|
te && (X[W.id] = te);
|
|
9551
9563
|
}
|
|
9552
9564
|
return O((W) => ({ ...W, ...X })), Object.keys(X).length === 0;
|
|
9553
|
-
}, [J,
|
|
9554
|
-
|
|
9555
|
-
},
|
|
9556
|
-
|
|
9565
|
+
}, [J, S]), z = () => {
|
|
9566
|
+
C() && H((X) => X + 1);
|
|
9567
|
+
}, K = () => {
|
|
9568
|
+
N > 0 ? H((X) => X - 1) : a == null || a();
|
|
9557
9569
|
}, ee = async () => {
|
|
9558
|
-
if (!(!
|
|
9570
|
+
if (!(!C() || !l))
|
|
9559
9571
|
try {
|
|
9560
9572
|
const X = l.map((te) => {
|
|
9561
|
-
const de = (
|
|
9573
|
+
const de = (S[te.id] ?? []).filter((le) => le && le.trim());
|
|
9562
9574
|
return de.length > 0 ? { riskCriteriaId: te.id, values: de } : null;
|
|
9563
9575
|
}).filter((te) => te !== null);
|
|
9564
|
-
await
|
|
9576
|
+
await g({ applicantId: e, criteriaValueInputs: X }), t == null || t();
|
|
9565
9577
|
} catch (X) {
|
|
9566
9578
|
console.error("Risk scoring submit error:", X);
|
|
9567
9579
|
}
|
|
@@ -9581,15 +9593,15 @@ const ya = ({
|
|
|
9581
9593
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: r("riskScoring.title") }),
|
|
9582
9594
|
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.subtitle") }),
|
|
9583
9595
|
L.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
|
|
9584
|
-
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current:
|
|
9596
|
+
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: N + 1, total: L.length }) }),
|
|
9585
9597
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: L.map((X, W) => /* @__PURE__ */ i(
|
|
9586
9598
|
"div",
|
|
9587
9599
|
{
|
|
9588
9600
|
className: "rounded-full transition-all duration-200",
|
|
9589
9601
|
style: {
|
|
9590
9602
|
height: "6px",
|
|
9591
|
-
width: W ===
|
|
9592
|
-
backgroundColor: W <=
|
|
9603
|
+
width: W === N ? "20px" : "6px",
|
|
9604
|
+
backgroundColor: W <= N ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
9593
9605
|
}
|
|
9594
9606
|
},
|
|
9595
9607
|
W
|
|
@@ -9600,7 +9612,7 @@ const ya = ({
|
|
|
9600
9612
|
fa,
|
|
9601
9613
|
{
|
|
9602
9614
|
criterion: X,
|
|
9603
|
-
value:
|
|
9615
|
+
value: S[X.id] ?? [],
|
|
9604
9616
|
error: b[X.id],
|
|
9605
9617
|
locale: o,
|
|
9606
9618
|
onChange: (W) => ie(X.id, W)
|
|
@@ -9613,11 +9625,11 @@ const ya = ({
|
|
|
9613
9625
|
{
|
|
9614
9626
|
type: "button",
|
|
9615
9627
|
variant: "outline",
|
|
9616
|
-
onClick:
|
|
9628
|
+
onClick: K,
|
|
9617
9629
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
9618
9630
|
children: [
|
|
9619
9631
|
/* @__PURE__ */ i(gi, { size: 14 }),
|
|
9620
|
-
|
|
9632
|
+
N > 0 ? r("common.previous") : r("common.back")
|
|
9621
9633
|
]
|
|
9622
9634
|
}
|
|
9623
9635
|
),
|
|
@@ -9678,7 +9690,7 @@ const ya = ({
|
|
|
9678
9690
|
type: "radio",
|
|
9679
9691
|
checked: t[0] === f,
|
|
9680
9692
|
onChange: () => n([f]),
|
|
9681
|
-
onClick: (
|
|
9693
|
+
onClick: (g) => g.stopPropagation(),
|
|
9682
9694
|
className: "metakyc-option-input",
|
|
9683
9695
|
style: {
|
|
9684
9696
|
width: "16px",
|
|
@@ -9704,17 +9716,17 @@ const ya = ({
|
|
|
9704
9716
|
] }),
|
|
9705
9717
|
l === "checkbox" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
9706
9718
|
(e.defaultValues ?? []).map((f) => {
|
|
9707
|
-
const
|
|
9708
|
-
n(
|
|
9719
|
+
const g = t.includes(f), S = () => {
|
|
9720
|
+
n(g ? t.filter((R) => R !== f) : [...t, f]);
|
|
9709
9721
|
};
|
|
9710
9722
|
return /* @__PURE__ */ s(
|
|
9711
9723
|
"div",
|
|
9712
9724
|
{
|
|
9713
9725
|
className: "metakyc-option-label",
|
|
9714
|
-
onClick:
|
|
9726
|
+
onClick: S,
|
|
9715
9727
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
9716
9728
|
children: [
|
|
9717
|
-
/* @__PURE__ */ i(Ge, { checked:
|
|
9729
|
+
/* @__PURE__ */ i(Ge, { checked: g, onChange: () => S() }),
|
|
9718
9730
|
/* @__PURE__ */ i("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: m(f) })
|
|
9719
9731
|
]
|
|
9720
9732
|
},
|
|
@@ -9747,22 +9759,22 @@ const ya = ({
|
|
|
9747
9759
|
onBack: a
|
|
9748
9760
|
}) => {
|
|
9749
9761
|
const { t: r } = Ie(), { investorCategorizationService: n } = Me(), [o, l] = w(null), [d, u] = w(!1), [m, f] = w(null);
|
|
9750
|
-
return /* @__PURE__ */ i("form", { onSubmit: async (
|
|
9751
|
-
if (
|
|
9762
|
+
return /* @__PURE__ */ i("form", { onSubmit: async (S) => {
|
|
9763
|
+
if (S.preventDefault(), o === null) {
|
|
9752
9764
|
f(r("investorCategorization.pleaseSelect"));
|
|
9753
9765
|
return;
|
|
9754
9766
|
}
|
|
9755
9767
|
u(!0), f(null);
|
|
9756
9768
|
try {
|
|
9757
|
-
const
|
|
9769
|
+
const R = {
|
|
9758
9770
|
applicantId: e,
|
|
9759
9771
|
investorType: o
|
|
9760
9772
|
};
|
|
9761
|
-
console.log("Submitting investor categorization:",
|
|
9762
|
-
const b = await n.setInvestorCategorization(
|
|
9773
|
+
console.log("Submitting investor categorization:", R);
|
|
9774
|
+
const b = await n.setInvestorCategorization(R);
|
|
9763
9775
|
console.log("Investor categorization result:", b), t == null || t();
|
|
9764
|
-
} catch (
|
|
9765
|
-
console.error("Error submitting investor categorization:",
|
|
9776
|
+
} catch (R) {
|
|
9777
|
+
console.error("Error submitting investor categorization:", R), f(R.message || r("investorCategorization.failedToSubmit"));
|
|
9766
9778
|
} finally {
|
|
9767
9779
|
u(!1);
|
|
9768
9780
|
}
|
|
@@ -9887,18 +9899,18 @@ const ha = ({
|
|
|
9887
9899
|
onComplete: t,
|
|
9888
9900
|
onBack: a
|
|
9889
9901
|
}) => {
|
|
9890
|
-
const { t: r } = Ie(), { appropriatenessTestService: n } = Me(), [o, l] = w(null), [d, u] = w(!0), [m, f] = w(!1), [
|
|
9902
|
+
const { t: r } = Ie(), { appropriatenessTestService: n } = Me(), [o, l] = w(null), [d, u] = w(!0), [m, f] = w(!1), [g, S] = w(null), [R, b] = w({}), [O, N] = w(0), [H, B] = w(!1), [F, L] = w(!1), [q, J] = w(0), [ie, C] = w(0), [z, K] = w(null);
|
|
9891
9903
|
he(() => {
|
|
9892
9904
|
(async () => {
|
|
9893
9905
|
try {
|
|
9894
|
-
u(!0),
|
|
9906
|
+
u(!0), S(null);
|
|
9895
9907
|
const E = await n.getAppropriatenessTest(e);
|
|
9896
9908
|
if (l(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
9897
9909
|
const V = Xt(E.waitTimeSpanForNextTry);
|
|
9898
9910
|
V > 0 && J(V);
|
|
9899
9911
|
}
|
|
9900
9912
|
} catch (E) {
|
|
9901
|
-
|
|
9913
|
+
S(E.message || r("appropriatenessTest.failedToLoad"));
|
|
9902
9914
|
} finally {
|
|
9903
9915
|
u(!1);
|
|
9904
9916
|
}
|
|
@@ -9906,7 +9918,7 @@ const ha = ({
|
|
|
9906
9918
|
}, [e, n]), he(() => {
|
|
9907
9919
|
if (!H || O <= 0) return;
|
|
9908
9920
|
const E = setInterval(() => {
|
|
9909
|
-
|
|
9921
|
+
N((V) => V <= 1 ? (L(!0), 0) : V - 1);
|
|
9910
9922
|
}, 1e3);
|
|
9911
9923
|
return () => clearInterval(E);
|
|
9912
9924
|
}, [H, O]), he(() => {
|
|
@@ -9919,7 +9931,7 @@ const ha = ({
|
|
|
9919
9931
|
F && !m && te();
|
|
9920
9932
|
}, [F]);
|
|
9921
9933
|
const ee = () => {
|
|
9922
|
-
o && (B(!0),
|
|
9934
|
+
o && (B(!0), N(o.testDurationSec), C(0), b({}), S(null));
|
|
9923
9935
|
}, X = (E, V) => {
|
|
9924
9936
|
b((fe) => ({ ...fe, [E]: V }));
|
|
9925
9937
|
}, W = oe(async () => {
|
|
@@ -9934,16 +9946,16 @@ const ha = ({
|
|
|
9934
9946
|
}, [e, n]), te = async (E) => {
|
|
9935
9947
|
if (o) {
|
|
9936
9948
|
if (!F) {
|
|
9937
|
-
const V = o.appropriatenessQuestions.length - Object.keys(
|
|
9949
|
+
const V = o.appropriatenessQuestions.length - Object.keys(R).length;
|
|
9938
9950
|
if (V > 0) {
|
|
9939
|
-
|
|
9951
|
+
S(r("appropriatenessTest.answerAllQuestions", { remaining: V }));
|
|
9940
9952
|
return;
|
|
9941
9953
|
}
|
|
9942
9954
|
}
|
|
9943
|
-
f(!0),
|
|
9955
|
+
f(!0), S(null);
|
|
9944
9956
|
try {
|
|
9945
9957
|
const V = o.appropriatenessQuestions.map(
|
|
9946
|
-
(ue) => ({ appropriatenessQuestionId: ue.id, value:
|
|
9958
|
+
(ue) => ({ appropriatenessQuestionId: ue.id, value: R[ue.id] || "" })
|
|
9947
9959
|
), fe = {
|
|
9948
9960
|
applicantId: e,
|
|
9949
9961
|
appropriatenessTestId: o.id,
|
|
@@ -9951,21 +9963,21 @@ const ha = ({
|
|
|
9951
9963
|
};
|
|
9952
9964
|
try {
|
|
9953
9965
|
const ue = await n.fillAppropriatenessTest(fe);
|
|
9954
|
-
ue.isSuccess ?
|
|
9966
|
+
ue.isSuccess ? K({ success: !0, message: ue.message || r("appropriatenessTest.passedMessage") }) : (K({ success: !1, message: ue.message || r("appropriatenessTest.failedMessage") }), setTimeout(() => W(), 1e3));
|
|
9955
9967
|
} catch (ue) {
|
|
9956
9968
|
if (ue.code === 400 && ue.message)
|
|
9957
|
-
|
|
9969
|
+
K({ success: !1, message: ue.message }), setTimeout(() => W(), 1500);
|
|
9958
9970
|
else
|
|
9959
9971
|
throw ue;
|
|
9960
9972
|
}
|
|
9961
9973
|
} catch (V) {
|
|
9962
|
-
|
|
9974
|
+
S(V.message || r("appropriatenessTest.failedToSubmit")), de();
|
|
9963
9975
|
} finally {
|
|
9964
9976
|
f(!1);
|
|
9965
9977
|
}
|
|
9966
9978
|
}
|
|
9967
9979
|
}, de = () => {
|
|
9968
|
-
B(!1), L(!1), b({}),
|
|
9980
|
+
B(!1), L(!1), b({}), C(0);
|
|
9969
9981
|
};
|
|
9970
9982
|
if (d)
|
|
9971
9983
|
return /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
@@ -9975,9 +9987,9 @@ const ha = ({
|
|
|
9975
9987
|
if (!o)
|
|
9976
9988
|
return /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ s("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
|
|
9977
9989
|
/* @__PURE__ */ i("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: r("appropriatenessTest.noTestData") }),
|
|
9978
|
-
|
|
9990
|
+
g && /* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: g })
|
|
9979
9991
|
] }) }) });
|
|
9980
|
-
const le = o.testAllowedMaxTry - o.totalFailedTries, je = o.appropriatenessQuestions.length, re = Object.keys(
|
|
9992
|
+
const le = o.testAllowedMaxTry - o.totalFailedTries, je = o.appropriatenessQuestions.length, re = Object.keys(R).length;
|
|
9981
9993
|
if (q > 0)
|
|
9982
9994
|
return /* @__PURE__ */ s(ae, { children: [
|
|
9983
9995
|
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ i("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: o.displayName }) }),
|
|
@@ -9999,18 +10011,18 @@ const ha = ({
|
|
|
9999
10011
|
}, children: zt(q) }) }),
|
|
10000
10012
|
/* @__PURE__ */ i("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: r("appropriatenessTest.waitBeforeRetrying") }),
|
|
10001
10013
|
/* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: r("appropriatenessTest.waitTimerMessage") }),
|
|
10002
|
-
|
|
10014
|
+
g && /* @__PURE__ */ i("div", { style: {
|
|
10003
10015
|
marginTop: "20px",
|
|
10004
10016
|
padding: "12px 16px",
|
|
10005
10017
|
borderRadius: "10px",
|
|
10006
10018
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
10007
10019
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
10008
|
-
}, children: /* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
10020
|
+
}, children: /* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: g }) })
|
|
10009
10021
|
] }) })
|
|
10010
10022
|
] });
|
|
10011
10023
|
if (z) {
|
|
10012
10024
|
const E = () => {
|
|
10013
|
-
|
|
10025
|
+
K(null), de(), S(null);
|
|
10014
10026
|
};
|
|
10015
10027
|
return /* @__PURE__ */ s(ae, { children: [
|
|
10016
10028
|
/* @__PURE__ */ i(ne, { children: /* @__PURE__ */ s("div", { style: {
|
|
@@ -10118,7 +10130,7 @@ const ha = ({
|
|
|
10118
10130
|
}
|
|
10119
10131
|
)
|
|
10120
10132
|
] }),
|
|
10121
|
-
|
|
10133
|
+
g && /* @__PURE__ */ s("div", { style: {
|
|
10122
10134
|
marginBottom: "16px",
|
|
10123
10135
|
padding: "12px 14px",
|
|
10124
10136
|
borderRadius: "10px",
|
|
@@ -10135,7 +10147,7 @@ const ha = ({
|
|
|
10135
10147
|
/* @__PURE__ */ s("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0, lineHeight: 1.5 }, children: [
|
|
10136
10148
|
/* @__PURE__ */ i("strong", { children: r("appropriatenessTest.previousAttempt") }),
|
|
10137
10149
|
" ",
|
|
10138
|
-
|
|
10150
|
+
g
|
|
10139
10151
|
] })
|
|
10140
10152
|
] }),
|
|
10141
10153
|
le <= 0 && /* @__PURE__ */ i("div", { style: {
|
|
@@ -10230,7 +10242,7 @@ const ha = ({
|
|
|
10230
10242
|
{
|
|
10231
10243
|
question: Ce,
|
|
10232
10244
|
index: ie,
|
|
10233
|
-
selectedAnswer:
|
|
10245
|
+
selectedAnswer: R[Ce.id],
|
|
10234
10246
|
onSelect: (E) => X(Ce.id, E),
|
|
10235
10247
|
disabled: m
|
|
10236
10248
|
}
|
|
@@ -10245,14 +10257,14 @@ const ha = ({
|
|
|
10245
10257
|
"button",
|
|
10246
10258
|
{
|
|
10247
10259
|
type: "button",
|
|
10248
|
-
onClick: () =>
|
|
10260
|
+
onClick: () => C(V),
|
|
10249
10261
|
style: {
|
|
10250
10262
|
width: "28px",
|
|
10251
10263
|
height: "28px",
|
|
10252
10264
|
borderRadius: "8px",
|
|
10253
10265
|
border: V === ie ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
10254
|
-
backgroundColor:
|
|
10255
|
-
color:
|
|
10266
|
+
backgroundColor: R[E.id] ? V === ie ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : V === ie ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
10267
|
+
color: R[E.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
10256
10268
|
fontSize: "12px",
|
|
10257
10269
|
fontWeight: 600,
|
|
10258
10270
|
cursor: "pointer",
|
|
@@ -10282,13 +10294,13 @@ const ha = ({
|
|
|
10282
10294
|
] }),
|
|
10283
10295
|
/* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "#b45309", margin: 0, fontWeight: 500 }, children: r("appropriatenessTest.timesUp") })
|
|
10284
10296
|
] }),
|
|
10285
|
-
|
|
10297
|
+
g && !F && /* @__PURE__ */ i("div", { style: {
|
|
10286
10298
|
marginTop: "16px",
|
|
10287
10299
|
padding: "12px 14px",
|
|
10288
10300
|
borderRadius: "10px",
|
|
10289
10301
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
10290
10302
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
10291
|
-
}, children: /* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
10303
|
+
}, children: /* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: g }) })
|
|
10292
10304
|
] }),
|
|
10293
10305
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
10294
10306
|
/* @__PURE__ */ i(
|
|
@@ -10297,7 +10309,7 @@ const ha = ({
|
|
|
10297
10309
|
type: "button",
|
|
10298
10310
|
variant: "outline",
|
|
10299
10311
|
onClick: () => {
|
|
10300
|
-
ie > 0 ?
|
|
10312
|
+
ie > 0 ? C((E) => E - 1) : a == null || a();
|
|
10301
10313
|
},
|
|
10302
10314
|
disabled: m,
|
|
10303
10315
|
children: ie > 0 ? r("common.previous") : r("common.cancel")
|
|
@@ -10308,7 +10320,7 @@ const ha = ({
|
|
|
10308
10320
|
Z,
|
|
10309
10321
|
{
|
|
10310
10322
|
type: "button",
|
|
10311
|
-
onClick: () =>
|
|
10323
|
+
onClick: () => C((E) => E + 1),
|
|
10312
10324
|
children: r("common.next")
|
|
10313
10325
|
}
|
|
10314
10326
|
),
|
|
@@ -10458,7 +10470,7 @@ const ha = ({
|
|
|
10458
10470
|
onBack: a
|
|
10459
10471
|
}) => {
|
|
10460
10472
|
var at, Qe, dt, nt;
|
|
10461
|
-
const { t: r } = Ie(), { applicantService: n, baseInformationService: o, identityService: l, config: d, currentTheme: u } = Me(), { identityData: m, provider: f, token:
|
|
10473
|
+
const { t: r } = Ie(), { applicantService: n, baseInformationService: o, identityService: l, config: d, currentTheme: u } = Me(), { identityData: m, provider: f, token: g, isLoading: S, error: R, requestIdentity: b, restartIdentity: O } = Br(e), [N, H] = w(null), [B, F] = w(null), [L, q] = w([]), [J, ie] = w([]), [C, z] = w(!0), [K, ee] = w(!1), [X, W] = w(null), [te, de] = w(!1), le = Re.useRef(!1), [je, re] = w({}), [Ce, Se] = w({}), ye = u != null && u.reviewPageFields && u.reviewPageFields.length > 0 ? u.reviewPageFields[0] : null, M = !!(u != null && u.reviewPageDisabled), E = ge(!1);
|
|
10462
10474
|
E.current = M;
|
|
10463
10475
|
const V = vi({
|
|
10464
10476
|
defaultValues: {
|
|
@@ -10489,37 +10501,37 @@ const ha = ({
|
|
|
10489
10501
|
q(y);
|
|
10490
10502
|
const I = /* @__PURE__ */ new Set(), x = $.filter((Y) => Y.countryCode).map((Y) => ({ value: Y.countryCode, label: `${Y.countryCode} – ${Y.name}` })).filter((Y) => I.has(Y.value) ? !1 : (I.add(Y.value), !0));
|
|
10491
10503
|
ie(x);
|
|
10492
|
-
const
|
|
10504
|
+
const p = D.applicantRequestData;
|
|
10493
10505
|
if (re({
|
|
10494
|
-
firstName: (
|
|
10495
|
-
lastName: (
|
|
10496
|
-
email: (
|
|
10497
|
-
dateOfBirth: (
|
|
10498
|
-
title: (
|
|
10499
|
-
salutation: (
|
|
10500
|
-
phonenumber: (
|
|
10501
|
-
mobileCountryCode: (
|
|
10502
|
-
street: (
|
|
10503
|
-
streetNumber: (
|
|
10504
|
-
city: (
|
|
10505
|
-
zip: (
|
|
10506
|
-
country: (
|
|
10507
|
-
nationality: (
|
|
10508
|
-
taxCountry: (
|
|
10509
|
-
countryOfBirth: (
|
|
10510
|
-
placeOfBirth: (
|
|
10511
|
-
educationLevel: (
|
|
10512
|
-
occupation: (
|
|
10513
|
-
taxNumber: (
|
|
10514
|
-
defaultLanguage: (
|
|
10506
|
+
firstName: (p == null ? void 0 : p.firstName) || "",
|
|
10507
|
+
lastName: (p == null ? void 0 : p.lastName) || "",
|
|
10508
|
+
email: (p == null ? void 0 : p.email) || "",
|
|
10509
|
+
dateOfBirth: (p == null ? void 0 : p.dateOfBirth) || "",
|
|
10510
|
+
title: (p == null ? void 0 : p.title) || "",
|
|
10511
|
+
salutation: (p == null ? void 0 : p.salutation) || "",
|
|
10512
|
+
phonenumber: (p == null ? void 0 : p.phonenumber) || "",
|
|
10513
|
+
mobileCountryCode: (p == null ? void 0 : p.mobileCountryCode) || "",
|
|
10514
|
+
street: (p == null ? void 0 : p.street) || "",
|
|
10515
|
+
streetNumber: (p == null ? void 0 : p.streetNumber) || "",
|
|
10516
|
+
city: (p == null ? void 0 : p.city) || "",
|
|
10517
|
+
zip: (p == null ? void 0 : p.zip) || "",
|
|
10518
|
+
country: (p == null ? void 0 : p.country) || "",
|
|
10519
|
+
nationality: (p == null ? void 0 : p.nationality) || "",
|
|
10520
|
+
taxCountry: (p == null ? void 0 : p.taxCountry) || "",
|
|
10521
|
+
countryOfBirth: (p == null ? void 0 : p.countryOfBirth) || "",
|
|
10522
|
+
placeOfBirth: (p == null ? void 0 : p.placeOfBirth) || "",
|
|
10523
|
+
educationLevel: (p == null ? void 0 : p.educationLevel) || "",
|
|
10524
|
+
occupation: (p == null ? void 0 : p.occupation) || "",
|
|
10525
|
+
taxNumber: (p == null ? void 0 : p.taxNumber) || "",
|
|
10526
|
+
defaultLanguage: (p == null ? void 0 : p.defaultLanguage) || ""
|
|
10515
10527
|
}), V.reset({
|
|
10516
|
-
street: (
|
|
10517
|
-
streetNumber: (
|
|
10518
|
-
city: (
|
|
10519
|
-
zip: (
|
|
10520
|
-
country: (
|
|
10521
|
-
nationality: (
|
|
10522
|
-
phonenumber: (
|
|
10528
|
+
street: (p == null ? void 0 : p.street) || "",
|
|
10529
|
+
streetNumber: (p == null ? void 0 : p.streetNumber) || "",
|
|
10530
|
+
city: (p == null ? void 0 : p.city) || "",
|
|
10531
|
+
zip: (p == null ? void 0 : p.zip) || "",
|
|
10532
|
+
country: (p == null ? void 0 : p.country) || "",
|
|
10533
|
+
nationality: (p == null ? void 0 : p.nationality) || "",
|
|
10534
|
+
phonenumber: (p == null ? void 0 : p.phonenumber) || ""
|
|
10523
10535
|
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !le.current && E.current) {
|
|
10524
10536
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), le.current = !0;
|
|
10525
10537
|
try {
|
|
@@ -10535,19 +10547,19 @@ const ha = ({
|
|
|
10535
10547
|
}
|
|
10536
10548
|
})();
|
|
10537
10549
|
}, [e]), he(() => {
|
|
10538
|
-
m && !
|
|
10539
|
-
}, [m,
|
|
10540
|
-
if (
|
|
10541
|
-
if (
|
|
10542
|
-
const k = new Date(
|
|
10550
|
+
m && !K && E.current && (console.log("[Identity] Review page disabled — showing cached provider"), ee(!0));
|
|
10551
|
+
}, [m, K]), he(() => {
|
|
10552
|
+
if (g) {
|
|
10553
|
+
if (g.expiresAt) {
|
|
10554
|
+
const k = new Date(g.expiresAt).getTime();
|
|
10543
10555
|
if (Date.now() >= k) {
|
|
10544
10556
|
console.warn("[Identity] Token has expired (expiresAt)"), de(!0), W(r("identity.sessionExpired"));
|
|
10545
10557
|
return;
|
|
10546
10558
|
}
|
|
10547
10559
|
}
|
|
10548
|
-
if (
|
|
10560
|
+
if (g.url)
|
|
10549
10561
|
try {
|
|
10550
|
-
const D = new URL(
|
|
10562
|
+
const D = new URL(g.url).toString().toLowerCase();
|
|
10551
10563
|
if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
|
|
10552
10564
|
console.warn("[Identity] Token URL indicates expiration"), de(!0), W(r("identity.linkExpired"));
|
|
10553
10565
|
return;
|
|
@@ -10555,20 +10567,20 @@ const ha = ({
|
|
|
10555
10567
|
} catch {
|
|
10556
10568
|
console.error("[Identity] Invalid token URL");
|
|
10557
10569
|
}
|
|
10558
|
-
if (
|
|
10570
|
+
if (g.status === "expired" || g.error === "expired" || g.expired === !0) {
|
|
10559
10571
|
console.warn("[Identity] Token object indicates expiration"), de(!0), W(r("identity.sessionExpired"));
|
|
10560
10572
|
return;
|
|
10561
10573
|
}
|
|
10562
10574
|
}
|
|
10563
|
-
}, [
|
|
10575
|
+
}, [g]);
|
|
10564
10576
|
const fe = f !== null && f === He.Sumsub;
|
|
10565
10577
|
he(() => {
|
|
10566
|
-
if (f !== null &&
|
|
10578
|
+
if (f !== null && g && !N && K && !te) {
|
|
10567
10579
|
const k = f;
|
|
10568
10580
|
if (fe) {
|
|
10569
10581
|
console.log("[Sumsub] Fetching access token for Web SDK…"), W(null), (async () => {
|
|
10570
10582
|
try {
|
|
10571
|
-
const D = await l.refreshSumsubToken(e), G = st.parseProviderConfig(f,
|
|
10583
|
+
const D = await l.refreshSumsubToken(e), G = st.parseProviderConfig(f, g, d);
|
|
10572
10584
|
G.accessToken = D, G.onTokenRefresh = () => l.refreshSumsubToken(e);
|
|
10573
10585
|
const $ = st.createProvider(f, G);
|
|
10574
10586
|
$.onComplete((se) => {
|
|
@@ -10582,19 +10594,19 @@ const ha = ({
|
|
|
10582
10594
|
})();
|
|
10583
10595
|
return;
|
|
10584
10596
|
}
|
|
10585
|
-
if (
|
|
10586
|
-
console.log("[Identity] Loading provider URL for user verification:",
|
|
10597
|
+
if (g.url) {
|
|
10598
|
+
console.log("[Identity] Loading provider URL for user verification:", g.url), W(null);
|
|
10587
10599
|
try {
|
|
10588
|
-
if (new URL(
|
|
10600
|
+
if (new URL(g.url), k === He.SardinAI) {
|
|
10589
10601
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
10590
10602
|
try {
|
|
10591
|
-
const D = st.parseProviderConfig(f,
|
|
10603
|
+
const D = st.parseProviderConfig(f, g, d);
|
|
10592
10604
|
st.createProvider(f, D).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch(($) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", $));
|
|
10593
10605
|
} catch (D) {
|
|
10594
10606
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
|
|
10595
10607
|
}
|
|
10596
10608
|
}
|
|
10597
|
-
H({ type: "url", url:
|
|
10609
|
+
H({ type: "url", url: g.url });
|
|
10598
10610
|
} catch (D) {
|
|
10599
10611
|
console.error("[Identity] Invalid URL:", D), W(r("identity.invalidUrl")), de(!0);
|
|
10600
10612
|
}
|
|
@@ -10603,7 +10615,7 @@ const ha = ({
|
|
|
10603
10615
|
if (k === He.SardinAI) {
|
|
10604
10616
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), W(null);
|
|
10605
10617
|
try {
|
|
10606
|
-
const D = st.parseProviderConfig(f,
|
|
10618
|
+
const D = st.parseProviderConfig(f, g, d), G = st.createProvider(f, D);
|
|
10607
10619
|
G.initialize().then(() => {
|
|
10608
10620
|
console.log("[SardinAI] Risk SDK initialized successfully"), H(G), setTimeout(() => t == null ? void 0 : t(), 2e3);
|
|
10609
10621
|
}).catch(($) => {
|
|
@@ -10619,7 +10631,7 @@ const ha = ({
|
|
|
10619
10631
|
}
|
|
10620
10632
|
try {
|
|
10621
10633
|
W(null);
|
|
10622
|
-
const D = st.parseProviderConfig(f,
|
|
10634
|
+
const D = st.parseProviderConfig(f, g, d), G = st.createProvider(f, D);
|
|
10623
10635
|
k === He.Onfido && G.initialize("identity-container").catch(($) => {
|
|
10624
10636
|
console.error("[Onfido] Initialization error:", $), W(r("identity.failedToInitialize", { message: $.message }));
|
|
10625
10637
|
}), H(G);
|
|
@@ -10628,14 +10640,14 @@ const ha = ({
|
|
|
10628
10640
|
}
|
|
10629
10641
|
}
|
|
10630
10642
|
return () => {
|
|
10631
|
-
if (
|
|
10643
|
+
if (N && N.destroy)
|
|
10632
10644
|
try {
|
|
10633
|
-
|
|
10645
|
+
N.destroy();
|
|
10634
10646
|
} catch (k) {
|
|
10635
10647
|
console.error("[Identity] Error destroying provider:", k);
|
|
10636
10648
|
}
|
|
10637
10649
|
};
|
|
10638
|
-
}, [f,
|
|
10650
|
+
}, [f, g, N, K, t, te, fe, e, d, l]);
|
|
10639
10651
|
const ue = async () => {
|
|
10640
10652
|
try {
|
|
10641
10653
|
W(null), de(!1), await b(), ee(!0);
|
|
@@ -10649,18 +10661,18 @@ const ha = ({
|
|
|
10649
10661
|
console.error("Error restarting identity verification:", k), W(k.message || r("identity.failedToRestart"));
|
|
10650
10662
|
}
|
|
10651
10663
|
};
|
|
10652
|
-
if (
|
|
10664
|
+
if (C || S)
|
|
10653
10665
|
return /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ s(ne, { children: [
|
|
10654
10666
|
/* @__PURE__ */ i(Ye, { className: "my-8" }),
|
|
10655
10667
|
/* @__PURE__ */ i("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: r("identity.loadingIdentity") })
|
|
10656
10668
|
] }) });
|
|
10657
|
-
if (
|
|
10669
|
+
if (R)
|
|
10658
10670
|
return /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
10659
10671
|
"Error: ",
|
|
10660
|
-
|
|
10672
|
+
R.message
|
|
10661
10673
|
] }) }) });
|
|
10662
10674
|
const _ = M ? a : () => ee(!1);
|
|
10663
|
-
if (
|
|
10675
|
+
if (K && (X || te))
|
|
10664
10676
|
return /* @__PURE__ */ s(ae, { children: [
|
|
10665
10677
|
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ i("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: r("identity.sessionIssueTitle") }) }),
|
|
10666
10678
|
/* @__PURE__ */ s(ne, { children: [
|
|
@@ -10706,10 +10718,10 @@ const ha = ({
|
|
|
10706
10718
|
] }),
|
|
10707
10719
|
/* @__PURE__ */ s(Le, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
10708
10720
|
_ && /* @__PURE__ */ i(Z, { type: "button", variant: "outline", onClick: _, children: r("common.back") }),
|
|
10709
|
-
/* @__PURE__ */ i(Z, { type: "button", onClick: j, disabled:
|
|
10721
|
+
/* @__PURE__ */ i(Z, { type: "button", onClick: j, disabled: S, children: r(S ? "identity.restarting" : "identity.restartVerification") })
|
|
10710
10722
|
] })
|
|
10711
10723
|
] });
|
|
10712
|
-
if (
|
|
10724
|
+
if (K && m) {
|
|
10713
10725
|
const k = f;
|
|
10714
10726
|
return fe ? /* @__PURE__ */ s("div", { style: {
|
|
10715
10727
|
background: "var(--metakyc-background, #ffffff)",
|
|
@@ -10742,7 +10754,7 @@ const ha = ({
|
|
|
10742
10754
|
{
|
|
10743
10755
|
type: "button",
|
|
10744
10756
|
onClick: j,
|
|
10745
|
-
disabled:
|
|
10757
|
+
disabled: S,
|
|
10746
10758
|
style: {
|
|
10747
10759
|
padding: "6px 14px",
|
|
10748
10760
|
fontSize: "13px",
|
|
@@ -10751,10 +10763,10 @@ const ha = ({
|
|
|
10751
10763
|
border: "1px solid var(--metakyc-border, #d1d5db)",
|
|
10752
10764
|
background: "var(--metakyc-background, #ffffff)",
|
|
10753
10765
|
color: "var(--metakyc-text-primary, #111827)",
|
|
10754
|
-
cursor:
|
|
10755
|
-
opacity:
|
|
10766
|
+
cursor: S ? "not-allowed" : "pointer",
|
|
10767
|
+
opacity: S ? 0.5 : 1
|
|
10756
10768
|
},
|
|
10757
|
-
children: r(
|
|
10769
|
+
children: r(S ? "identity.restarting" : "identity.restart")
|
|
10758
10770
|
}
|
|
10759
10771
|
)
|
|
10760
10772
|
] }),
|
|
@@ -10774,7 +10786,7 @@ const ha = ({
|
|
|
10774
10786
|
padding: "16px 24px",
|
|
10775
10787
|
borderTop: "1px solid var(--metakyc-border, #e5e7eb)"
|
|
10776
10788
|
}, children: /* @__PURE__ */ i(Z, { variant: "outline", onClick: _, children: r("common.back") }) })
|
|
10777
|
-
] }) :
|
|
10789
|
+
] }) : g != null && g.url ? /* @__PURE__ */ s(ae, { children: [
|
|
10778
10790
|
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
10779
10791
|
/* @__PURE__ */ s("div", { children: [
|
|
10780
10792
|
/* @__PURE__ */ i("h2", { className: "text-2xl font-bold", children: r("identity.title") }),
|
|
@@ -10787,7 +10799,7 @@ const ha = ({
|
|
|
10787
10799
|
variant: "outline",
|
|
10788
10800
|
size: "sm",
|
|
10789
10801
|
onClick: j,
|
|
10790
|
-
disabled:
|
|
10802
|
+
disabled: S,
|
|
10791
10803
|
children: r("identity.restart")
|
|
10792
10804
|
}
|
|
10793
10805
|
)
|
|
@@ -10800,7 +10812,7 @@ const ha = ({
|
|
|
10800
10812
|
/* @__PURE__ */ i("div", { className: "w-full", style: { height: "600px", maxHeight: "70vh" }, children: /* @__PURE__ */ i(
|
|
10801
10813
|
"iframe",
|
|
10802
10814
|
{
|
|
10803
|
-
src:
|
|
10815
|
+
src: g.url,
|
|
10804
10816
|
className: "w-full h-full border-0 rounded-lg",
|
|
10805
10817
|
allow: "camera; microphone; geolocation",
|
|
10806
10818
|
title: "Identity Verification",
|
|
@@ -11006,9 +11018,9 @@ const ha = ({
|
|
|
11006
11018
|
}
|
|
11007
11019
|
if (k.customType === "group_checkbox") {
|
|
11008
11020
|
const y = Array.isArray(se) ? se : se ? [se] : [], I = (x) => {
|
|
11009
|
-
k.singleSelect ? Se((
|
|
11010
|
-
...
|
|
11011
|
-
[$]: y.includes(x) ? y.filter((
|
|
11021
|
+
k.singleSelect ? Se((p) => ({ ...p, [$]: y[0] === x ? [] : [x] })) : Se((p) => ({
|
|
11022
|
+
...p,
|
|
11023
|
+
[$]: y.includes(x) ? y.filter((U) => U !== x) : [...y, x]
|
|
11012
11024
|
}));
|
|
11013
11025
|
};
|
|
11014
11026
|
return /* @__PURE__ */ i("div", { style: ke(k.colSpan), children: Te(
|
|
@@ -11068,7 +11080,7 @@ const ha = ({
|
|
|
11068
11080
|
{
|
|
11069
11081
|
label: se,
|
|
11070
11082
|
value: String(y),
|
|
11071
|
-
onChange: (
|
|
11083
|
+
onChange: (p) => re((U) => ({ ...U, [G]: p })),
|
|
11072
11084
|
options: [{ value: "", label: r("placeholders.selectCountryCode") }, ...J]
|
|
11073
11085
|
}
|
|
11074
11086
|
),
|
|
@@ -11079,7 +11091,7 @@ const ha = ({
|
|
|
11079
11091
|
{
|
|
11080
11092
|
label: se,
|
|
11081
11093
|
value: String(y),
|
|
11082
|
-
onChange: (
|
|
11094
|
+
onChange: (p) => re((U) => ({ ...U, [G]: p })),
|
|
11083
11095
|
options: [{ value: "", label: r("common.select") }, ...L]
|
|
11084
11096
|
}
|
|
11085
11097
|
),
|
|
@@ -11091,7 +11103,7 @@ const ha = ({
|
|
|
11091
11103
|
label: se,
|
|
11092
11104
|
type: ($ == null ? void 0 : $.type) === "date" ? "date" : ($ == null ? void 0 : $.type) === "email" ? "email" : "text",
|
|
11093
11105
|
value: String(y),
|
|
11094
|
-
onChange: (
|
|
11106
|
+
onChange: (p) => re((U) => ({ ...U, [G]: p.target.value }))
|
|
11095
11107
|
}
|
|
11096
11108
|
),
|
|
11097
11109
|
k.helpText
|
|
@@ -11115,7 +11127,7 @@ const ha = ({
|
|
|
11115
11127
|
/* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: ye.fields.map((G, $) => _e(G, $)) }) }),
|
|
11116
11128
|
/* @__PURE__ */ s(Le, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
11117
11129
|
a && /* @__PURE__ */ i(Z, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
11118
|
-
/* @__PURE__ */ i(Z, { type: "submit", isLoading:
|
|
11130
|
+
/* @__PURE__ */ i(Z, { type: "submit", isLoading: S, children: r("identity.confirmAndStart") })
|
|
11119
11131
|
] })
|
|
11120
11132
|
] }) });
|
|
11121
11133
|
}
|
|
@@ -11182,7 +11194,7 @@ const ha = ({
|
|
|
11182
11194
|
] }),
|
|
11183
11195
|
/* @__PURE__ */ s(Le, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
11184
11196
|
a && /* @__PURE__ */ i(Z, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
11185
|
-
/* @__PURE__ */ i(Z, { type: "submit", isLoading:
|
|
11197
|
+
/* @__PURE__ */ i(Z, { type: "submit", isLoading: S, children: r("identity.confirmAndStart") })
|
|
11186
11198
|
] })
|
|
11187
11199
|
] }) });
|
|
11188
11200
|
}, Ft = {
|
|
@@ -11495,16 +11507,16 @@ const Ca = {
|
|
|
11495
11507
|
onSuccess: r,
|
|
11496
11508
|
onCancel: n
|
|
11497
11509
|
}) => {
|
|
11498
|
-
var I, x,
|
|
11499
|
-
const { config: o, baseInformationService: l, currentTheme: d } = Me(), { createApplicant: u, getApplicantData: m, isLoading: f } = di(), { t:
|
|
11500
|
-
if (!
|
|
11510
|
+
var I, x, p, U, Y, ce, Ee;
|
|
11511
|
+
const { config: o, baseInformationService: l, currentTheme: d } = Me(), { createApplicant: u, getApplicantData: m, isLoading: f } = di(), { t: g } = Ie(), S = e || ((I = o.applicantForm) == null ? void 0 : I.workflowKey);
|
|
11512
|
+
if (!S)
|
|
11501
11513
|
throw new Error(
|
|
11502
11514
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
11503
11515
|
);
|
|
11504
|
-
const
|
|
11516
|
+
const R = t || ((x = o.applicantForm) == null ? void 0 : x.externalRefId) || "", b = ((p = o.applicantForm) == null ? void 0 : p.email) || "", O = ((U = o.applicantForm) == null ? void 0 : U.hiddenValues) || {}, N = ((Y = o.applicantForm) == null ? void 0 : Y.initialValues) || {}, B = (((ce = o.applicantForm) == null ? void 0 : ce.fieldLabelMode) || (d == null ? void 0 : d.fieldLabelMode) || "label") !== "placeholder", F = Ue(
|
|
11505
11517
|
() => d != null && d.applicantFormPages && d.applicantFormPages.length > 0 ? d.applicantFormPages : null,
|
|
11506
11518
|
[d == null ? void 0 : d.applicantFormPages]
|
|
11507
|
-
), L =
|
|
11519
|
+
), L = Ue(() => {
|
|
11508
11520
|
const c = new Set(St), P = d == null ? void 0 : d.applicantFormRequiredFields;
|
|
11509
11521
|
if (P) for (const A of P) c.add(A);
|
|
11510
11522
|
if (F)
|
|
@@ -11512,11 +11524,11 @@ const Ca = {
|
|
|
11512
11524
|
for (const h of A.fields)
|
|
11513
11525
|
!h.isCustom && h.name && h.required && c.add(h.name);
|
|
11514
11526
|
return Array.from(c);
|
|
11515
|
-
}, [d == null ? void 0 : d.applicantFormRequiredFields, F]), q =
|
|
11527
|
+
}, [d == null ? void 0 : d.applicantFormRequiredFields, F]), q = Ue(() => {
|
|
11516
11528
|
var A;
|
|
11517
11529
|
if (F) {
|
|
11518
|
-
const h = F.flatMap((
|
|
11519
|
-
for (const
|
|
11530
|
+
const h = F.flatMap((T) => T.fields).filter((T) => !T.isCustom && T.name).map((T) => T.name), v = new Set(h);
|
|
11531
|
+
for (const T of St) v.add(T);
|
|
11520
11532
|
return Array.from(v);
|
|
11521
11533
|
}
|
|
11522
11534
|
let c;
|
|
@@ -11531,7 +11543,7 @@ const Ca = {
|
|
|
11531
11543
|
"countryOfBirth",
|
|
11532
11544
|
"mobileCountryCode",
|
|
11533
11545
|
"otherNationality"
|
|
11534
|
-
]), ie =
|
|
11546
|
+
]), ie = Ue(() => {
|
|
11535
11547
|
var P, A;
|
|
11536
11548
|
const c = /* @__PURE__ */ new Set();
|
|
11537
11549
|
if (F)
|
|
@@ -11542,7 +11554,7 @@ const Ca = {
|
|
|
11542
11554
|
for (const h of q)
|
|
11543
11555
|
J.has(h) && c.add((A = gt[h]) == null ? void 0 : A.countriesType);
|
|
11544
11556
|
return c.size === 0 && c.add(void 0), Array.from(c);
|
|
11545
|
-
}, [q, F]), [
|
|
11557
|
+
}, [q, F]), [C, z] = w({}), [K, ee] = w(!0), X = ge(/* @__PURE__ */ new Set()), W = ge(/* @__PURE__ */ new Set());
|
|
11546
11558
|
he(() => {
|
|
11547
11559
|
if (!d) return;
|
|
11548
11560
|
const c = ie.filter((h) => {
|
|
@@ -11551,8 +11563,8 @@ const Ca = {
|
|
|
11551
11563
|
});
|
|
11552
11564
|
if (c.length === 0) {
|
|
11553
11565
|
ie.every((v) => {
|
|
11554
|
-
const
|
|
11555
|
-
return W.current.has(
|
|
11566
|
+
const T = v != null ? String(v) : "all";
|
|
11567
|
+
return W.current.has(T);
|
|
11556
11568
|
}) && ee(!1);
|
|
11557
11569
|
return;
|
|
11558
11570
|
}
|
|
@@ -11562,11 +11574,11 @@ const Ca = {
|
|
|
11562
11574
|
try {
|
|
11563
11575
|
const h = await Promise.all(
|
|
11564
11576
|
c.map(async (v) => {
|
|
11565
|
-
const
|
|
11577
|
+
const T = v != null ? String(v) : "all", me = await l.getCountries("", o.locale || "en", v), we = v === 40, Pe = /* @__PURE__ */ new Set(), De = me.map((be) => we && be.countryCode ? {
|
|
11566
11578
|
value: be.countryCode,
|
|
11567
11579
|
label: `${be.countryCode} – ${be.name}`
|
|
11568
11580
|
} : { value: be.abbreviation3 || be.abbreviation, label: be.name }).filter((be) => !be.value || Pe.has(be.value) ? !1 : (Pe.add(be.value), !0));
|
|
11569
|
-
return W.current.add(
|
|
11581
|
+
return W.current.add(T), X.current.delete(T), [T, De];
|
|
11570
11582
|
})
|
|
11571
11583
|
);
|
|
11572
11584
|
z((v) => ({ ...v, ...Object.fromEntries(h) }));
|
|
@@ -11574,8 +11586,8 @@ const Ca = {
|
|
|
11574
11586
|
P.forEach((v) => X.current.delete(v)), console.error("Failed to load countries:", h);
|
|
11575
11587
|
} finally {
|
|
11576
11588
|
ie.every((v) => {
|
|
11577
|
-
const
|
|
11578
|
-
return W.current.has(
|
|
11589
|
+
const T = v != null ? String(v) : "all";
|
|
11590
|
+
return W.current.has(T);
|
|
11579
11591
|
}) && ee(!1);
|
|
11580
11592
|
}
|
|
11581
11593
|
})();
|
|
@@ -11583,7 +11595,7 @@ const Ca = {
|
|
|
11583
11595
|
const te = (c, P) => {
|
|
11584
11596
|
var v;
|
|
11585
11597
|
const A = P ?? ((v = gt[c]) == null ? void 0 : v.countriesType), h = A != null ? String(A) : "all";
|
|
11586
|
-
return
|
|
11598
|
+
return C[h] || [];
|
|
11587
11599
|
}, de = {
|
|
11588
11600
|
firstName: 1,
|
|
11589
11601
|
lastName: 1,
|
|
@@ -11610,16 +11622,16 @@ const Ca = {
|
|
|
11610
11622
|
}, le = Object.fromEntries(
|
|
11611
11623
|
Object.entries(O).filter(([c]) => c in de)
|
|
11612
11624
|
), je = Object.fromEntries(
|
|
11613
|
-
Object.entries(
|
|
11625
|
+
Object.entries(N).filter(([c]) => c in de)
|
|
11614
11626
|
), [re, Ce] = w({
|
|
11615
|
-
workflowKey:
|
|
11627
|
+
workflowKey: S,
|
|
11616
11628
|
firstName: "",
|
|
11617
11629
|
lastName: "",
|
|
11618
11630
|
title: "",
|
|
11619
11631
|
email: b,
|
|
11620
11632
|
dateOfBirth: "",
|
|
11621
11633
|
phonenumber: "",
|
|
11622
|
-
externalRefId:
|
|
11634
|
+
externalRefId: R,
|
|
11623
11635
|
mobileCountryCode: "",
|
|
11624
11636
|
street: "",
|
|
11625
11637
|
streetNumber: "",
|
|
@@ -11650,7 +11662,7 @@ const Ca = {
|
|
|
11650
11662
|
if (c) return;
|
|
11651
11663
|
const h = A.applicantRequestData;
|
|
11652
11664
|
h && Ce((v) => {
|
|
11653
|
-
var
|
|
11665
|
+
var T;
|
|
11654
11666
|
return {
|
|
11655
11667
|
...v,
|
|
11656
11668
|
firstName: h.firstName || v.firstName,
|
|
@@ -11674,7 +11686,7 @@ const Ca = {
|
|
|
11674
11686
|
occupation: h.occupation || v.occupation,
|
|
11675
11687
|
title: h.title || v.title,
|
|
11676
11688
|
salutation: h.salutation != null ? Number(h.salutation) : v.salutation,
|
|
11677
|
-
otherNationality: (
|
|
11689
|
+
otherNationality: (T = h.otherNationalities) != null && T.length ? h.otherNationalities : v.otherNationality
|
|
11678
11690
|
};
|
|
11679
11691
|
}), A.externalRefId && Ce((v) => ({ ...v, externalRefId: A.externalRefId }));
|
|
11680
11692
|
} catch (A) {
|
|
@@ -11692,7 +11704,7 @@ const Ca = {
|
|
|
11692
11704
|
if (!A.isCustom || !A.paramName || !((P = A.blockingValues) != null && P.length)) continue;
|
|
11693
11705
|
const h = ye[A.paramName] ?? "";
|
|
11694
11706
|
if (A.customType === "group_checkbox") {
|
|
11695
|
-
if (h.split(",").filter(Boolean).some((
|
|
11707
|
+
if (h.split(",").filter(Boolean).some((T) => A.blockingValues.includes(T))) return !0;
|
|
11696
11708
|
} else if (A.customType === "radio_group" && A.blockingValues.includes(h))
|
|
11697
11709
|
return !0;
|
|
11698
11710
|
}
|
|
@@ -11703,14 +11715,14 @@ const Ca = {
|
|
|
11703
11715
|
if (A.isCustom) {
|
|
11704
11716
|
if (A.customType === "paragraph" || A.customType === "html" || A.customType === "br" || A.customType === "link") continue;
|
|
11705
11717
|
if (A.required && A.paramName) {
|
|
11706
|
-
const h = ye[A.paramName], v = Q(A.displayText,
|
|
11707
|
-
A.customType === "checkbox" || A.customType === "link_checkbox" ? h !== "true" && (P[A.paramName] =
|
|
11718
|
+
const h = ye[A.paramName], v = Q(A.displayText, g) || Q(A.label, g) || A.paramName;
|
|
11719
|
+
A.customType === "checkbox" || A.customType === "link_checkbox" ? h !== "true" && (P[A.paramName] = g("validation.fieldRequired", { field: v })) : (!h || h.trim() === "") && (P[A.paramName] = g("validation.fieldRequired", { field: v }));
|
|
11708
11720
|
}
|
|
11709
11721
|
} else if (A.name) {
|
|
11710
11722
|
const h = A.name;
|
|
11711
11723
|
if (L.includes(h) && ft(re[h])) {
|
|
11712
|
-
const v = gt[h],
|
|
11713
|
-
P[h] =
|
|
11724
|
+
const v = gt[h], T = Q(A.displayText, g) || (v != null && v.translationKey ? g(`fields.${v.translationKey}`) : void 0) || (v == null ? void 0 : v.label) || h;
|
|
11725
|
+
P[h] = g("validation.fieldRequired", { field: T });
|
|
11714
11726
|
}
|
|
11715
11727
|
}
|
|
11716
11728
|
return P;
|
|
@@ -11741,7 +11753,7 @@ const Ca = {
|
|
|
11741
11753
|
ct(!0), ke(null);
|
|
11742
11754
|
try {
|
|
11743
11755
|
if (!re.externalRefId || re.externalRefId.trim() === "") {
|
|
11744
|
-
ke(
|
|
11756
|
+
ke(g("createApplicant.externalRefIdRequired"));
|
|
11745
11757
|
return;
|
|
11746
11758
|
}
|
|
11747
11759
|
const c = {
|
|
@@ -11752,47 +11764,47 @@ const Ca = {
|
|
|
11752
11764
|
if (F) {
|
|
11753
11765
|
for (const v of F)
|
|
11754
11766
|
if (_e(v)) {
|
|
11755
|
-
for (const
|
|
11756
|
-
if (!
|
|
11757
|
-
const me =
|
|
11767
|
+
for (const T of v.fields)
|
|
11768
|
+
if (!T.isCustom && T.name) {
|
|
11769
|
+
const me = T.name, we = re[me];
|
|
11758
11770
|
ft(we) || (c[me] = we);
|
|
11759
11771
|
}
|
|
11760
11772
|
}
|
|
11761
11773
|
for (const v of St)
|
|
11762
11774
|
if (c[v] === void 0) {
|
|
11763
|
-
const
|
|
11764
|
-
ft(
|
|
11775
|
+
const T = re[v];
|
|
11776
|
+
ft(T) || (c[v] = T);
|
|
11765
11777
|
}
|
|
11766
11778
|
} else
|
|
11767
11779
|
q.forEach((v) => {
|
|
11768
11780
|
if (v === "externalRefId") return;
|
|
11769
|
-
const
|
|
11770
|
-
ft(
|
|
11781
|
+
const T = re[v];
|
|
11782
|
+
ft(T) || (c[v] = T);
|
|
11771
11783
|
});
|
|
11772
11784
|
const P = [];
|
|
11773
11785
|
if (F) {
|
|
11774
11786
|
for (const v of F)
|
|
11775
11787
|
if (_e(v))
|
|
11776
|
-
for (const
|
|
11777
|
-
if (!
|
|
11778
|
-
const me = ye[
|
|
11788
|
+
for (const T of v.fields) {
|
|
11789
|
+
if (!T.isCustom || !T.paramName || T.customType === "paragraph" || T.customType === "html" || T.customType === "br" || T.customType === "link") continue;
|
|
11790
|
+
const me = ye[T.paramName] ?? "";
|
|
11779
11791
|
let we;
|
|
11780
|
-
if (
|
|
11792
|
+
if (T.customType === "checkbox" || T.customType === "link_checkbox")
|
|
11781
11793
|
we = me === "true" ? "yes" : "no";
|
|
11782
|
-
else if (we = me, !we && !
|
|
11783
|
-
P.push({ paramName:
|
|
11794
|
+
else if (we = me, !we && !T.required) continue;
|
|
11795
|
+
P.push({ paramName: T.paramName, value: we });
|
|
11784
11796
|
}
|
|
11785
11797
|
}
|
|
11786
|
-
for (const [v,
|
|
11787
|
-
c[v] === void 0 && !ft(
|
|
11798
|
+
for (const [v, T] of Object.entries(le))
|
|
11799
|
+
c[v] === void 0 && !ft(T) && (c[v] = T);
|
|
11788
11800
|
const A = new Set(P.map((v) => v.paramName));
|
|
11789
|
-
for (const [v,
|
|
11790
|
-
!A.has(v) &&
|
|
11801
|
+
for (const [v, T] of Object.entries(Se))
|
|
11802
|
+
!A.has(v) && T && P.push({ paramName: v, value: T });
|
|
11791
11803
|
P.length > 0 && (c.applicantAdditionalDatas = P);
|
|
11792
11804
|
const h = await u(c);
|
|
11793
11805
|
r(h.applicantId);
|
|
11794
11806
|
} catch (c) {
|
|
11795
|
-
console.error("Error creating applicant:", c), ke(c.message ||
|
|
11807
|
+
console.error("Error creating applicant:", c), ke(c.message || g("createApplicant.failedToCreate"));
|
|
11796
11808
|
} finally {
|
|
11797
11809
|
ct(!1);
|
|
11798
11810
|
}
|
|
@@ -11800,17 +11812,17 @@ const Ca = {
|
|
|
11800
11812
|
c.preventDefault();
|
|
11801
11813
|
for (const P of L)
|
|
11802
11814
|
if (ft(re[P])) {
|
|
11803
|
-
const A = gt[P], h = (A != null && A.translationKey ?
|
|
11804
|
-
ke(
|
|
11815
|
+
const A = gt[P], h = (A != null && A.translationKey ? g(`fields.${A.translationKey}`) : void 0) || (A == null ? void 0 : A.label) || P;
|
|
11816
|
+
ke(g("validation.fieldRequired", { field: h }));
|
|
11805
11817
|
return;
|
|
11806
11818
|
}
|
|
11807
11819
|
await D();
|
|
11808
11820
|
}, $ = (c, P, A, h, v) => {
|
|
11809
11821
|
var Ot;
|
|
11810
|
-
const
|
|
11811
|
-
if (!
|
|
11812
|
-
const me = L.includes(c), we = j[c], Pe = Q(A,
|
|
11813
|
-
switch (
|
|
11822
|
+
const T = gt[c];
|
|
11823
|
+
if (!T) return null;
|
|
11824
|
+
const me = L.includes(c), we = j[c], Pe = Q(A, g) || (T.translationKey ? g(`fields.${T.translationKey}`) : void 0) || T.label, De = c in je, be = P ?? c, We = { required: me }, Ze = v ? v !== "placeholder" : B, ot = Ze ? Pe : void 0;
|
|
11825
|
+
switch (T.type) {
|
|
11814
11826
|
case "select":
|
|
11815
11827
|
if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
|
|
11816
11828
|
const Oe = te(c, h);
|
|
@@ -11821,8 +11833,8 @@ const Ca = {
|
|
|
11821
11833
|
label: ot,
|
|
11822
11834
|
value: re[c] || "",
|
|
11823
11835
|
onChange: (mt) => Te(c, mt),
|
|
11824
|
-
options: [{ value: "", label: Ze ?
|
|
11825
|
-
disabled:
|
|
11836
|
+
options: [{ value: "", label: Ze ? g("placeholders.selectCountry") : Pe }, ...Oe],
|
|
11837
|
+
disabled: K,
|
|
11826
11838
|
readOnly: De,
|
|
11827
11839
|
error: we
|
|
11828
11840
|
},
|
|
@@ -11838,10 +11850,10 @@ const Ca = {
|
|
|
11838
11850
|
value: ((Ot = re[c]) == null ? void 0 : Ot.toString()) || "",
|
|
11839
11851
|
onChange: (Oe) => Te(c, Oe ? Number(Oe) : null),
|
|
11840
11852
|
options: [
|
|
11841
|
-
{ value: "", label: Ze ?
|
|
11842
|
-
{ value: Nt.Male.toString(), label:
|
|
11843
|
-
{ value: Nt.Female.toString(), label:
|
|
11844
|
-
{ value: Nt.Other.toString(), label:
|
|
11853
|
+
{ value: "", label: Ze ? g("placeholders.selectSalutation") : Pe },
|
|
11854
|
+
{ value: Nt.Male.toString(), label: g("gender.male") },
|
|
11855
|
+
{ value: Nt.Female.toString(), label: g("gender.female") },
|
|
11856
|
+
{ value: Nt.Other.toString(), label: g("gender.other") }
|
|
11845
11857
|
],
|
|
11846
11858
|
readOnly: De,
|
|
11847
11859
|
error: we
|
|
@@ -11857,7 +11869,7 @@ const Ca = {
|
|
|
11857
11869
|
label: ot,
|
|
11858
11870
|
value: re[c] || "",
|
|
11859
11871
|
onChange: (mt) => Te(c, mt),
|
|
11860
|
-
options: [{ value: "", label: Ze ?
|
|
11872
|
+
options: [{ value: "", label: Ze ? g("placeholders.selectLanguage") : Pe }, ...Oe],
|
|
11861
11873
|
readOnly: De,
|
|
11862
11874
|
error: we
|
|
11863
11875
|
},
|
|
@@ -11876,8 +11888,8 @@ const Ca = {
|
|
|
11876
11888
|
value: re[c] || [],
|
|
11877
11889
|
onChange: (mt) => Te(c, mt),
|
|
11878
11890
|
options: Oe,
|
|
11879
|
-
placeholder: Ze ?
|
|
11880
|
-
disabled:
|
|
11891
|
+
placeholder: Ze ? g("placeholders.selectOtherNationalities") : Pe,
|
|
11892
|
+
disabled: K,
|
|
11881
11893
|
readOnly: De
|
|
11882
11894
|
},
|
|
11883
11895
|
be
|
|
@@ -11948,7 +11960,7 @@ const Ca = {
|
|
|
11948
11960
|
}, se = (c, P) => {
|
|
11949
11961
|
const A = c.labelMode ? c.labelMode !== "placeholder" : B;
|
|
11950
11962
|
if (c.customType === "paragraph") {
|
|
11951
|
-
const
|
|
11963
|
+
const T = Q(c.displayText, g) || Q(c.label, g) || "";
|
|
11952
11964
|
return /* @__PURE__ */ i(
|
|
11953
11965
|
"p",
|
|
11954
11966
|
{
|
|
@@ -11959,7 +11971,7 @@ const Ca = {
|
|
|
11959
11971
|
margin: 0,
|
|
11960
11972
|
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
11961
11973
|
},
|
|
11962
|
-
dangerouslySetInnerHTML: { __html:
|
|
11974
|
+
dangerouslySetInnerHTML: { __html: T }
|
|
11963
11975
|
},
|
|
11964
11976
|
`custom-${P}`
|
|
11965
11977
|
);
|
|
@@ -11968,14 +11980,14 @@ const Ca = {
|
|
|
11968
11980
|
return /* @__PURE__ */ i(
|
|
11969
11981
|
"div",
|
|
11970
11982
|
{
|
|
11971
|
-
dangerouslySetInnerHTML: { __html: Q(c.label,
|
|
11983
|
+
dangerouslySetInnerHTML: { __html: Q(c.label, g) || "" }
|
|
11972
11984
|
},
|
|
11973
11985
|
`custom-${P}`
|
|
11974
11986
|
);
|
|
11975
11987
|
if (c.customType === "br")
|
|
11976
11988
|
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${P}`);
|
|
11977
11989
|
if (c.customType === "link") {
|
|
11978
|
-
const
|
|
11990
|
+
const T = Q(c.displayText, g) || Q(c.label, g) || c.linkText || c.linkUrl || "";
|
|
11979
11991
|
return /* @__PURE__ */ i("div", { className: "metakyc-link-field", children: /* @__PURE__ */ s(
|
|
11980
11992
|
"a",
|
|
11981
11993
|
{
|
|
@@ -11992,30 +12004,30 @@ const Ca = {
|
|
|
11992
12004
|
cursor: "pointer"
|
|
11993
12005
|
},
|
|
11994
12006
|
children: [
|
|
11995
|
-
|
|
12007
|
+
T,
|
|
11996
12008
|
/* @__PURE__ */ i("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
|
|
11997
12009
|
]
|
|
11998
12010
|
}
|
|
11999
12011
|
) }, `custom-${P}`);
|
|
12000
12012
|
}
|
|
12001
12013
|
if (!c.paramName) return null;
|
|
12002
|
-
const h = j[c.paramName], v = Q(c.displayText,
|
|
12014
|
+
const h = j[c.paramName], v = Q(c.displayText, g) || Q(c.label, g) || c.paramName;
|
|
12003
12015
|
if (c.customType === "checkbox") {
|
|
12004
|
-
const
|
|
12016
|
+
const T = ye[c.paramName] === "true";
|
|
12005
12017
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
12006
12018
|
/* @__PURE__ */ s(
|
|
12007
12019
|
"div",
|
|
12008
12020
|
{
|
|
12009
12021
|
className: "metakyc-option-label",
|
|
12010
12022
|
role: "checkbox",
|
|
12011
|
-
"aria-checked":
|
|
12012
|
-
onClick: () => ze(c.paramName,
|
|
12023
|
+
"aria-checked": T,
|
|
12024
|
+
onClick: () => ze(c.paramName, T ? "false" : "true"),
|
|
12013
12025
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
12014
12026
|
children: [
|
|
12015
12027
|
/* @__PURE__ */ i(
|
|
12016
12028
|
Ge,
|
|
12017
12029
|
{
|
|
12018
|
-
checked:
|
|
12030
|
+
checked: T,
|
|
12019
12031
|
onChange: (me) => ze(c.paramName, me ? "true" : "false")
|
|
12020
12032
|
}
|
|
12021
12033
|
),
|
|
@@ -12037,21 +12049,21 @@ const Ca = {
|
|
|
12037
12049
|
] }, `custom-${P}`);
|
|
12038
12050
|
}
|
|
12039
12051
|
if (c.customType === "link_checkbox") {
|
|
12040
|
-
const
|
|
12052
|
+
const T = ye[c.paramName] === "true";
|
|
12041
12053
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
12042
12054
|
/* @__PURE__ */ s(
|
|
12043
12055
|
"div",
|
|
12044
12056
|
{
|
|
12045
12057
|
className: "metakyc-option-label",
|
|
12046
12058
|
role: "checkbox",
|
|
12047
|
-
"aria-checked":
|
|
12048
|
-
onClick: () => ze(c.paramName,
|
|
12059
|
+
"aria-checked": T,
|
|
12060
|
+
onClick: () => ze(c.paramName, T ? "false" : "true"),
|
|
12049
12061
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
12050
12062
|
children: [
|
|
12051
12063
|
/* @__PURE__ */ i(
|
|
12052
12064
|
Ge,
|
|
12053
12065
|
{
|
|
12054
|
-
checked:
|
|
12066
|
+
checked: T,
|
|
12055
12067
|
onChange: (me) => ze(c.paramName, me ? "true" : "false")
|
|
12056
12068
|
}
|
|
12057
12069
|
),
|
|
@@ -12086,7 +12098,7 @@ const Ca = {
|
|
|
12086
12098
|
] }, `custom-${P}`);
|
|
12087
12099
|
}
|
|
12088
12100
|
if (c.customType === "group_checkbox") {
|
|
12089
|
-
const
|
|
12101
|
+
const T = (ye[c.paramName] || "").split(",").filter(Boolean);
|
|
12090
12102
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
|
|
12091
12103
|
A && /* @__PURE__ */ s(
|
|
12092
12104
|
"div",
|
|
@@ -12100,11 +12112,11 @@ const Ca = {
|
|
|
12100
12112
|
}
|
|
12101
12113
|
),
|
|
12102
12114
|
/* @__PURE__ */ i("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((me) => {
|
|
12103
|
-
const we = c.singleSelect ? ye[c.paramName] === me.value :
|
|
12115
|
+
const we = c.singleSelect ? ye[c.paramName] === me.value : T.includes(me.value), Pe = () => {
|
|
12104
12116
|
if (c.singleSelect)
|
|
12105
12117
|
ze(c.paramName, we ? "" : me.value);
|
|
12106
12118
|
else {
|
|
12107
|
-
const De = we ?
|
|
12119
|
+
const De = we ? T.filter((be) => be !== me.value) : [...T, me.value];
|
|
12108
12120
|
ze(c.paramName, De.join(","));
|
|
12109
12121
|
}
|
|
12110
12122
|
};
|
|
@@ -12144,19 +12156,19 @@ const Ca = {
|
|
|
12144
12156
|
]
|
|
12145
12157
|
}
|
|
12146
12158
|
),
|
|
12147
|
-
/* @__PURE__ */ i("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((
|
|
12159
|
+
/* @__PURE__ */ i("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((T) => /* @__PURE__ */ s(
|
|
12148
12160
|
"div",
|
|
12149
12161
|
{
|
|
12150
12162
|
className: "metakyc-option-label",
|
|
12151
|
-
onClick: () => ze(c.paramName,
|
|
12163
|
+
onClick: () => ze(c.paramName, T.value),
|
|
12152
12164
|
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0, userSelect: "none" },
|
|
12153
12165
|
children: [
|
|
12154
12166
|
/* @__PURE__ */ i(
|
|
12155
12167
|
"input",
|
|
12156
12168
|
{
|
|
12157
12169
|
type: "radio",
|
|
12158
|
-
checked: ye[c.paramName] ===
|
|
12159
|
-
onChange: () => ze(c.paramName,
|
|
12170
|
+
checked: ye[c.paramName] === T.value,
|
|
12171
|
+
onChange: () => ze(c.paramName, T.value),
|
|
12160
12172
|
name: `radio-group-${c.paramName}-${P}`,
|
|
12161
12173
|
className: "metakyc-option-input",
|
|
12162
12174
|
onClick: (me) => me.stopPropagation(),
|
|
@@ -12168,12 +12180,12 @@ const Ca = {
|
|
|
12168
12180
|
{
|
|
12169
12181
|
className: "metakyc-option-text",
|
|
12170
12182
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
12171
|
-
children:
|
|
12183
|
+
children: T.label
|
|
12172
12184
|
}
|
|
12173
12185
|
)
|
|
12174
12186
|
]
|
|
12175
12187
|
},
|
|
12176
|
-
|
|
12188
|
+
T.value
|
|
12177
12189
|
)) }),
|
|
12178
12190
|
h && /* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-danger, #ef4444)" }, children: h })
|
|
12179
12191
|
] }, `custom-${P}`) : /* @__PURE__ */ i(
|
|
@@ -12183,7 +12195,7 @@ const Ca = {
|
|
|
12183
12195
|
label: A ? `${v}${c.required ? " *" : ""}` : void 0,
|
|
12184
12196
|
placeholder: A ? void 0 : v,
|
|
12185
12197
|
value: ye[c.paramName] || "",
|
|
12186
|
-
onChange: (
|
|
12198
|
+
onChange: (T) => ze(c.paramName, T.target.value),
|
|
12187
12199
|
required: c.required,
|
|
12188
12200
|
error: h
|
|
12189
12201
|
},
|
|
@@ -12213,28 +12225,28 @@ const Ca = {
|
|
|
12213
12225
|
{
|
|
12214
12226
|
className: "metakyc-option-text",
|
|
12215
12227
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", fontWeight: 500 },
|
|
12216
|
-
children: Q(c.conditionalLabel,
|
|
12228
|
+
children: Q(c.conditionalLabel, g) || c.conditionalOn
|
|
12217
12229
|
}
|
|
12218
12230
|
)
|
|
12219
12231
|
]
|
|
12220
12232
|
}
|
|
12221
12233
|
) }),
|
|
12222
12234
|
A && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: c.fields.map((h, v) => {
|
|
12223
|
-
const
|
|
12224
|
-
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${
|
|
12235
|
+
const T = Math.min(4, Math.max(1, Number(h.colSpan) || 4)), me = h.isCustom ? `custom-${v}-${h.paramName}` : `builtin-${h.name}-${v}`;
|
|
12236
|
+
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${T} / span ${T}` }, children: /* @__PURE__ */ i(Jt, { helpText: h.helpText, children: h.isCustom ? se(h, v) : $(h.name, me, h.displayText, h.countriesType, h.labelMode) }) }, me);
|
|
12225
12237
|
}) })
|
|
12226
12238
|
] });
|
|
12227
12239
|
};
|
|
12228
|
-
if (!d ||
|
|
12240
|
+
if (!d || K || E)
|
|
12229
12241
|
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ s(ne, { children: [
|
|
12230
12242
|
/* @__PURE__ */ i(Ye, { className: "my-8" }),
|
|
12231
|
-
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children:
|
|
12243
|
+
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: g("common.loadingForm") })
|
|
12232
12244
|
] }) }) });
|
|
12233
12245
|
if (F) {
|
|
12234
|
-
const c = F[fe] ?? F[0], P = dt === -1, A = Qe === -1, h = F.length, v = _e(c),
|
|
12246
|
+
const c = F[fe] ?? F[0], P = dt === -1, A = Qe === -1, h = F.length, v = _e(c), T = at(c), me = Object.values(j), we = !v && !!c.conditionalOn && c.conditionalMode === "block", Pe = Fe || f || we || T;
|
|
12235
12247
|
let De;
|
|
12236
|
-
return we ||
|
|
12237
|
-
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ i(bt, { title: (d == null ? void 0 : d.title) ||
|
|
12248
|
+
return we || T ? De = g("common.blocked") : A ? De = c.conditionalOn && !v ? g("common.skipAndSubmit") : g("common.submit") : De = c.conditionalOn && !v ? g("common.skip") : g("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(ae, { children: [
|
|
12249
|
+
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ i(bt, { title: (d == null ? void 0 : d.title) || g("createApplicant.title") }) }),
|
|
12238
12250
|
/* @__PURE__ */ s(ne, { children: [
|
|
12239
12251
|
(c.title || c.subtitle || c.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
12240
12252
|
c.title && /* @__PURE__ */ i(
|
|
@@ -12242,7 +12254,7 @@ const Ca = {
|
|
|
12242
12254
|
{
|
|
12243
12255
|
className: "font-semibold text-base",
|
|
12244
12256
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
12245
|
-
children: Q(c.title,
|
|
12257
|
+
children: Q(c.title, g)
|
|
12246
12258
|
}
|
|
12247
12259
|
),
|
|
12248
12260
|
c.subtitle && /* @__PURE__ */ i(
|
|
@@ -12250,7 +12262,7 @@ const Ca = {
|
|
|
12250
12262
|
{
|
|
12251
12263
|
className: "text-sm mt-0.5",
|
|
12252
12264
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12253
|
-
children: Q(c.subtitle,
|
|
12265
|
+
children: Q(c.subtitle, g)
|
|
12254
12266
|
}
|
|
12255
12267
|
),
|
|
12256
12268
|
c.description && c.description !== c.subtitle && /* @__PURE__ */ i(
|
|
@@ -12258,7 +12270,7 @@ const Ca = {
|
|
|
12258
12270
|
{
|
|
12259
12271
|
className: "text-xs mt-1",
|
|
12260
12272
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12261
|
-
children: Q(c.description,
|
|
12273
|
+
children: Q(c.description, g)
|
|
12262
12274
|
}
|
|
12263
12275
|
)
|
|
12264
12276
|
] }),
|
|
@@ -12286,7 +12298,7 @@ const Ca = {
|
|
|
12286
12298
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
12287
12299
|
}, children: [
|
|
12288
12300
|
ve && /* @__PURE__ */ s("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: [
|
|
12289
|
-
/* @__PURE__ */ i("strong", { children:
|
|
12301
|
+
/* @__PURE__ */ i("strong", { children: g("common.errorPrefix") }),
|
|
12290
12302
|
" ",
|
|
12291
12303
|
ve
|
|
12292
12304
|
] }),
|
|
@@ -12305,7 +12317,7 @@ const Ca = {
|
|
|
12305
12317
|
ue(dt), _({});
|
|
12306
12318
|
},
|
|
12307
12319
|
disabled: Fe || f,
|
|
12308
|
-
children:
|
|
12320
|
+
children: g("common.previous")
|
|
12309
12321
|
}
|
|
12310
12322
|
),
|
|
12311
12323
|
P && n && /* @__PURE__ */ i(Z, { type: "button", variant: "outline", onClick: n, disabled: Fe || f, children: "Cancel" })
|
|
@@ -12324,13 +12336,13 @@ const Ca = {
|
|
|
12324
12336
|
] }) });
|
|
12325
12337
|
}
|
|
12326
12338
|
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i("form", { onSubmit: G, children: /* @__PURE__ */ s(ae, { children: [
|
|
12327
|
-
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ i(bt, { title: (d == null ? void 0 : d.title) ||
|
|
12339
|
+
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ i(bt, { title: (d == null ? void 0 : d.title) || g("createApplicant.title") }) }),
|
|
12328
12340
|
/* @__PURE__ */ s(ne, { children: [
|
|
12329
12341
|
ve && /* @__PURE__ */ i("div", { className: "mb-6 p-4 rounded-lg", style: {
|
|
12330
12342
|
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
12331
12343
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
12332
12344
|
}, children: /* @__PURE__ */ s("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: [
|
|
12333
|
-
/* @__PURE__ */ i("strong", { children:
|
|
12345
|
+
/* @__PURE__ */ i("strong", { children: g("common.errorPrefix") }),
|
|
12334
12346
|
" ",
|
|
12335
12347
|
ve
|
|
12336
12348
|
] }) }),
|
|
@@ -12338,7 +12350,7 @@ const Ca = {
|
|
|
12338
12350
|
] }),
|
|
12339
12351
|
/* @__PURE__ */ s(Le, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
12340
12352
|
n && /* @__PURE__ */ i(Z, { type: "button", variant: "outline", onClick: n, disabled: Fe || f, children: "Cancel" }),
|
|
12341
|
-
/* @__PURE__ */ i(Z, { type: "submit", isLoading: Fe || f, children:
|
|
12353
|
+
/* @__PURE__ */ i(Z, { type: "submit", isLoading: Fe || f, children: g("createApplicant.createApplicant") })
|
|
12342
12354
|
] })
|
|
12343
12355
|
] }) }) });
|
|
12344
12356
|
}, ei = ["companyName", "email"];
|
|
@@ -12357,69 +12369,69 @@ const Ta = ({
|
|
|
12357
12369
|
throw new Error(
|
|
12358
12370
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
12359
12371
|
);
|
|
12360
|
-
const
|
|
12372
|
+
const g = t || ((k = n.applicantForm) == null ? void 0 : k.externalRefId) || "", S = ((D = n.applicantForm) == null ? void 0 : D.email) || "", R = ((G = n.applicantForm) == null ? void 0 : G.initialValues) || {}, O = ((($ = n.applicantForm) == null ? void 0 : $.fieldLabelMode) || (l == null ? void 0 : l.fieldLabelMode) || "label") !== "placeholder", N = Ue(
|
|
12361
12373
|
() => l != null && l.companyFormPages && l.companyFormPages.length > 0 ? l.companyFormPages : null,
|
|
12362
12374
|
[l == null ? void 0 : l.companyFormPages]
|
|
12363
|
-
), H =
|
|
12375
|
+
), H = Ue(() => {
|
|
12364
12376
|
const y = new Set(ei), I = l == null ? void 0 : l.companyFormRequiredFields;
|
|
12365
12377
|
if (I) for (const x of I) y.add(x);
|
|
12366
|
-
if (
|
|
12367
|
-
for (const x of
|
|
12368
|
-
for (const
|
|
12369
|
-
!
|
|
12378
|
+
if (N)
|
|
12379
|
+
for (const x of N)
|
|
12380
|
+
for (const p of x.fields)
|
|
12381
|
+
!p.isCustom && p.name && p.required && y.add(p.name);
|
|
12370
12382
|
return Array.from(y);
|
|
12371
|
-
}, [l == null ? void 0 : l.companyFormRequiredFields,
|
|
12383
|
+
}, [l == null ? void 0 : l.companyFormRequiredFields, N]), B = Ue(() => {
|
|
12372
12384
|
var y;
|
|
12373
|
-
if (
|
|
12374
|
-
const I =
|
|
12375
|
-
for (const
|
|
12385
|
+
if (N) {
|
|
12386
|
+
const I = N.flatMap((p) => p.fields).filter((p) => !p.isCustom && p.name).map((p) => p.name), x = new Set(I);
|
|
12387
|
+
for (const p of ei) x.add(p);
|
|
12376
12388
|
return Array.from(x);
|
|
12377
12389
|
}
|
|
12378
12390
|
return (y = n.applicantForm) != null && y.visibleFields ? n.applicantForm.visibleFields : l != null && l.companyFormVisibleFields && l.companyFormVisibleFields.length > 0 ? l.companyFormVisibleFields : Li;
|
|
12379
|
-
}, [(se = n.applicantForm) == null ? void 0 : se.visibleFields, l == null ? void 0 : l.companyFormVisibleFields,
|
|
12391
|
+
}, [(se = n.applicantForm) == null ? void 0 : se.visibleFields, l == null ? void 0 : l.companyFormVisibleFields, N]), F = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), L = Ue(() => {
|
|
12380
12392
|
var I, x;
|
|
12381
12393
|
const y = /* @__PURE__ */ new Set();
|
|
12382
|
-
if (
|
|
12383
|
-
for (const
|
|
12384
|
-
for (const
|
|
12385
|
-
!
|
|
12394
|
+
if (N)
|
|
12395
|
+
for (const p of N)
|
|
12396
|
+
for (const U of p.fields)
|
|
12397
|
+
!U.isCustom && U.name && F.has(U.name) && y.add(U.countriesType ?? ((I = yt[U.name]) == null ? void 0 : I.countriesType));
|
|
12386
12398
|
else
|
|
12387
|
-
for (const
|
|
12388
|
-
F.has(
|
|
12399
|
+
for (const p of B)
|
|
12400
|
+
F.has(p) && y.add((x = yt[p]) == null ? void 0 : x.countriesType);
|
|
12389
12401
|
return y.size === 0 && y.add(void 0), Array.from(y);
|
|
12390
|
-
}, [B,
|
|
12402
|
+
}, [B, N]), [q, J] = w({}), [ie, C] = w(!0), z = ge(/* @__PURE__ */ new Set()), K = ge(/* @__PURE__ */ new Set());
|
|
12391
12403
|
he(() => {
|
|
12392
12404
|
if (!l) return;
|
|
12393
|
-
const y = L.filter((
|
|
12394
|
-
const
|
|
12395
|
-
return !
|
|
12405
|
+
const y = L.filter((p) => {
|
|
12406
|
+
const U = p != null ? String(p) : "all";
|
|
12407
|
+
return !K.current.has(U) && !z.current.has(U);
|
|
12396
12408
|
});
|
|
12397
12409
|
if (y.length === 0) {
|
|
12398
|
-
L.every((
|
|
12410
|
+
L.every((U) => K.current.has(U != null ? String(U) : "all")) && C(!1);
|
|
12399
12411
|
return;
|
|
12400
12412
|
}
|
|
12401
|
-
|
|
12402
|
-
const I = y.map((
|
|
12403
|
-
I.forEach((
|
|
12413
|
+
C(!0);
|
|
12414
|
+
const I = y.map((p) => p != null ? String(p) : "all");
|
|
12415
|
+
I.forEach((p) => z.current.add(p)), (async () => {
|
|
12404
12416
|
try {
|
|
12405
|
-
const
|
|
12406
|
-
y.map(async (
|
|
12407
|
-
const Y =
|
|
12408
|
-
return
|
|
12417
|
+
const p = await Promise.all(
|
|
12418
|
+
y.map(async (U) => {
|
|
12419
|
+
const Y = U != null ? String(U) : "all", ce = await o.getCountries("", n.locale || "en", U), Ee = /* @__PURE__ */ new Set(), c = ce.map((P) => ({ value: P.abbreviation3 || P.abbreviation, label: P.name })).filter((P) => !P.value || Ee.has(P.value) ? !1 : (Ee.add(P.value), !0));
|
|
12420
|
+
return K.current.add(Y), z.current.delete(Y), [Y, c];
|
|
12409
12421
|
})
|
|
12410
12422
|
);
|
|
12411
|
-
J((
|
|
12412
|
-
} catch (
|
|
12413
|
-
I.forEach((
|
|
12423
|
+
J((U) => ({ ...U, ...Object.fromEntries(p) }));
|
|
12424
|
+
} catch (p) {
|
|
12425
|
+
I.forEach((U) => z.current.delete(U)), console.error("Failed to load countries:", p);
|
|
12414
12426
|
} finally {
|
|
12415
|
-
L.every((
|
|
12427
|
+
L.every((U) => K.current.has(U != null ? String(U) : "all")) && C(!1);
|
|
12416
12428
|
}
|
|
12417
12429
|
})();
|
|
12418
12430
|
}, [L, l]);
|
|
12419
12431
|
const ee = (y, I) => {
|
|
12420
|
-
var
|
|
12421
|
-
const x = I ?? ((
|
|
12422
|
-
return q[
|
|
12432
|
+
var U;
|
|
12433
|
+
const x = I ?? ((U = yt[y]) == null ? void 0 : U.countriesType), p = x != null ? String(x) : "all";
|
|
12434
|
+
return q[p] || [];
|
|
12423
12435
|
}, X = {
|
|
12424
12436
|
companyName: 1,
|
|
12425
12437
|
registrationNumber: 1,
|
|
@@ -12441,11 +12453,11 @@ const Ta = ({
|
|
|
12441
12453
|
addressCountry: 1,
|
|
12442
12454
|
lei: 1
|
|
12443
12455
|
}, W = Object.fromEntries(
|
|
12444
|
-
Object.entries(
|
|
12456
|
+
Object.entries(R).filter(([y]) => y in X)
|
|
12445
12457
|
), [te, de] = w({
|
|
12446
12458
|
workflowKey: f,
|
|
12447
12459
|
companyName: "",
|
|
12448
|
-
email:
|
|
12460
|
+
email: S,
|
|
12449
12461
|
phone: "",
|
|
12450
12462
|
registrationNumber: "",
|
|
12451
12463
|
countryResidence: "",
|
|
@@ -12463,39 +12475,39 @@ const Ta = ({
|
|
|
12463
12475
|
postalCode: "",
|
|
12464
12476
|
addressCountry: "",
|
|
12465
12477
|
lei: "",
|
|
12466
|
-
externalRefId:
|
|
12478
|
+
externalRefId: g,
|
|
12467
12479
|
...W
|
|
12468
12480
|
}), [le, je] = w({}), [re, Ce] = w(0), [Se, ye] = w({}), [M, E] = w(null), [V, fe] = w(!1), ue = (y, I) => de((x) => ({ ...x, [y]: I })), j = (y, I) => je((x) => ({ ...x, [y]: I })), _ = (y) => !y.conditionalOn || le[y.conditionalOn] === "true", ve = (y) => {
|
|
12469
12481
|
var I;
|
|
12470
12482
|
for (const x of y.fields) {
|
|
12471
12483
|
if (!x.isCustom || !x.paramName || !((I = x.blockingValues) != null && I.length)) continue;
|
|
12472
|
-
const
|
|
12484
|
+
const p = le[x.paramName] ?? "";
|
|
12473
12485
|
if (x.customType === "group_checkbox") {
|
|
12474
|
-
if (
|
|
12475
|
-
} else if (x.customType === "radio_group" && x.blockingValues.includes(
|
|
12486
|
+
if (p.split(",").filter(Boolean).some((Y) => x.blockingValues.includes(Y))) return !0;
|
|
12487
|
+
} else if (x.customType === "radio_group" && x.blockingValues.includes(p))
|
|
12476
12488
|
return !0;
|
|
12477
12489
|
}
|
|
12478
12490
|
return !1;
|
|
12479
|
-
}, ke =
|
|
12491
|
+
}, ke = N && re < N.length - 1 ? re + 1 : -1, Fe = N && re > 0 ? re - 1 : -1, ct = (y) => {
|
|
12480
12492
|
const I = {};
|
|
12481
12493
|
for (const x of y.fields)
|
|
12482
12494
|
if (x.isCustom) {
|
|
12483
12495
|
if (x.customType === "paragraph" || x.customType === "html" || x.customType === "br" || x.customType === "link") continue;
|
|
12484
12496
|
if (x.required && x.paramName) {
|
|
12485
|
-
const
|
|
12486
|
-
x.customType === "checkbox" || x.customType === "link_checkbox" ?
|
|
12497
|
+
const p = le[x.paramName], U = Q(x.displayText, m) || Q(x.label, m) || x.paramName;
|
|
12498
|
+
x.customType === "checkbox" || x.customType === "link_checkbox" ? p !== "true" && (I[x.paramName] = m("validation.fieldRequired", { field: U })) : (!p || p.trim() === "") && (I[x.paramName] = m("validation.fieldRequired", { field: U }));
|
|
12487
12499
|
}
|
|
12488
12500
|
} else if (x.name) {
|
|
12489
|
-
const
|
|
12490
|
-
if (H.includes(
|
|
12491
|
-
const
|
|
12492
|
-
I[
|
|
12501
|
+
const p = x.name;
|
|
12502
|
+
if (H.includes(p) && Lt(te[p])) {
|
|
12503
|
+
const U = yt[p], Y = Q(x.displayText, m) || (U != null && U.translationKey ? m(`fields.${U.translationKey}`) : void 0) || (U == null ? void 0 : U.label) || p;
|
|
12504
|
+
I[p] = m("validation.fieldRequired", { field: Y });
|
|
12493
12505
|
}
|
|
12494
12506
|
}
|
|
12495
12507
|
return I;
|
|
12496
12508
|
}, Te = async () => {
|
|
12497
|
-
if (!
|
|
12498
|
-
const y =
|
|
12509
|
+
if (!N) return;
|
|
12510
|
+
const y = N[re];
|
|
12499
12511
|
if (ve(y) || y.conditionalOn && y.conditionalMode === "block" && !_(y)) return;
|
|
12500
12512
|
if (y.conditionalOn && !_(y)) {
|
|
12501
12513
|
ye({}), ke >= 0 ? Ce(ke) : await ze();
|
|
@@ -12509,9 +12521,9 @@ const Ta = ({
|
|
|
12509
12521
|
ye({}), ke >= 0 ? Ce(ke) : await ze();
|
|
12510
12522
|
}, ze = async () => {
|
|
12511
12523
|
var y;
|
|
12512
|
-
if (
|
|
12524
|
+
if (N) {
|
|
12513
12525
|
let I = {};
|
|
12514
|
-
for (const x of
|
|
12526
|
+
for (const x of N)
|
|
12515
12527
|
_(x) && (I = { ...I, ...ct(x) });
|
|
12516
12528
|
if (Object.keys(I).length > 0) {
|
|
12517
12529
|
ye(I);
|
|
@@ -12523,7 +12535,7 @@ const Ta = ({
|
|
|
12523
12535
|
const I = {
|
|
12524
12536
|
workflowKey: te.workflowKey,
|
|
12525
12537
|
externalRefId: ((y = te.externalRefId) == null ? void 0 : y.trim()) || void 0
|
|
12526
|
-
}, x =
|
|
12538
|
+
}, x = N ? N.filter((Y) => _(Y)).flatMap((Y) => Y.fields).filter((Y) => !Y.isCustom && Y.name).map((Y) => Y.name) : B;
|
|
12527
12539
|
for (const Y of x) {
|
|
12528
12540
|
const ce = te[Y];
|
|
12529
12541
|
if (!Lt(ce))
|
|
@@ -12557,9 +12569,9 @@ const Ta = ({
|
|
|
12557
12569
|
break;
|
|
12558
12570
|
}
|
|
12559
12571
|
}
|
|
12560
|
-
const
|
|
12561
|
-
if (
|
|
12562
|
-
for (const Y of
|
|
12572
|
+
const p = [];
|
|
12573
|
+
if (N) {
|
|
12574
|
+
for (const Y of N)
|
|
12563
12575
|
if (_(Y))
|
|
12564
12576
|
for (const ce of Y.fields) {
|
|
12565
12577
|
if (!ce.isCustom || !ce.paramName || ce.customType === "paragraph" || ce.customType === "html" || ce.customType === "br" || ce.customType === "link") continue;
|
|
@@ -12568,12 +12580,12 @@ const Ta = ({
|
|
|
12568
12580
|
if (ce.customType === "checkbox" || ce.customType === "link_checkbox")
|
|
12569
12581
|
c = Ee === "true" ? "yes" : "no";
|
|
12570
12582
|
else if (c = Ee, !c && !ce.required) continue;
|
|
12571
|
-
|
|
12583
|
+
p.push({ paramName: ce.paramName, value: c });
|
|
12572
12584
|
}
|
|
12573
12585
|
}
|
|
12574
|
-
|
|
12575
|
-
const
|
|
12576
|
-
a(
|
|
12586
|
+
p.length > 0 && (I.applicantAdditionalDatas = p);
|
|
12587
|
+
const U = await d(I);
|
|
12588
|
+
a(U.applicantId);
|
|
12577
12589
|
} catch (I) {
|
|
12578
12590
|
console.error("Error creating company applicant:", I), E(I.message || m("createCompany.failedToCreate"));
|
|
12579
12591
|
} finally {
|
|
@@ -12583,19 +12595,19 @@ const Ta = ({
|
|
|
12583
12595
|
y.preventDefault();
|
|
12584
12596
|
for (const I of H)
|
|
12585
12597
|
if (Lt(te[I])) {
|
|
12586
|
-
const x = yt[I],
|
|
12587
|
-
E(m("validation.fieldRequired", { field:
|
|
12598
|
+
const x = yt[I], p = (x != null && x.translationKey ? m(`fields.${x.translationKey}`) : void 0) || (x == null ? void 0 : x.label) || I;
|
|
12599
|
+
E(m("validation.fieldRequired", { field: p }));
|
|
12588
12600
|
return;
|
|
12589
12601
|
}
|
|
12590
12602
|
await ze();
|
|
12591
|
-
}, at = (y, I, x,
|
|
12603
|
+
}, at = (y, I, x, p, U) => {
|
|
12592
12604
|
const Y = yt[y];
|
|
12593
12605
|
if (!Y) return null;
|
|
12594
|
-
const ce = H.includes(y), Ee = Se[y], c = Q(x, m) || (Y.translationKey ? m(`fields.${Y.translationKey}`) : void 0) || Y.label, P = y in W, A = I ?? y, h =
|
|
12606
|
+
const ce = H.includes(y), Ee = Se[y], c = Q(x, m) || (Y.translationKey ? m(`fields.${Y.translationKey}`) : void 0) || Y.label, P = y in W, A = I ?? y, h = U ? U !== "placeholder" : O, v = h ? c : void 0;
|
|
12595
12607
|
switch (Y.type) {
|
|
12596
12608
|
case "select":
|
|
12597
12609
|
if (y === "countryResidence" || y === "addressCountry") {
|
|
12598
|
-
const
|
|
12610
|
+
const T = ee(y, p);
|
|
12599
12611
|
return /* @__PURE__ */ i(
|
|
12600
12612
|
it,
|
|
12601
12613
|
{
|
|
@@ -12603,7 +12615,7 @@ const Ta = ({
|
|
|
12603
12615
|
label: v,
|
|
12604
12616
|
value: te[y] || "",
|
|
12605
12617
|
onChange: (me) => ue(y, me),
|
|
12606
|
-
options: [{ value: "", label: h ? m("placeholders.selectCountry") : c }, ...
|
|
12618
|
+
options: [{ value: "", label: h ? m("placeholders.selectCountry") : c }, ...T],
|
|
12607
12619
|
disabled: ie,
|
|
12608
12620
|
readOnly: P,
|
|
12609
12621
|
error: Ee
|
|
@@ -12621,7 +12633,7 @@ const Ta = ({
|
|
|
12621
12633
|
label: v,
|
|
12622
12634
|
placeholder: h ? void 0 : c,
|
|
12623
12635
|
value: te[y] || "",
|
|
12624
|
-
onChange: (
|
|
12636
|
+
onChange: (T) => ue(y, T.target.value),
|
|
12625
12637
|
readOnly: P,
|
|
12626
12638
|
error: Ee
|
|
12627
12639
|
},
|
|
@@ -12636,7 +12648,7 @@ const Ta = ({
|
|
|
12636
12648
|
label: v,
|
|
12637
12649
|
placeholder: h ? void 0 : c,
|
|
12638
12650
|
value: te[y] || "",
|
|
12639
|
-
onChange: (
|
|
12651
|
+
onChange: (T) => ue(y, T.target.value),
|
|
12640
12652
|
readOnly: P,
|
|
12641
12653
|
error: Ee
|
|
12642
12654
|
},
|
|
@@ -12651,7 +12663,7 @@ const Ta = ({
|
|
|
12651
12663
|
label: v,
|
|
12652
12664
|
placeholder: h ? void 0 : c,
|
|
12653
12665
|
value: te[y] || "",
|
|
12654
|
-
onChange: (
|
|
12666
|
+
onChange: (T) => ue(y, T.target.value),
|
|
12655
12667
|
readOnly: P,
|
|
12656
12668
|
error: Ee
|
|
12657
12669
|
},
|
|
@@ -12666,7 +12678,7 @@ const Ta = ({
|
|
|
12666
12678
|
label: v,
|
|
12667
12679
|
placeholder: h ? void 0 : c,
|
|
12668
12680
|
value: te[y] || "",
|
|
12669
|
-
onChange: (
|
|
12681
|
+
onChange: (T) => ue(y, T.target.value),
|
|
12670
12682
|
readOnly: P,
|
|
12671
12683
|
error: Ee
|
|
12672
12684
|
},
|
|
@@ -12699,7 +12711,7 @@ const Ta = ({
|
|
|
12699
12711
|
}
|
|
12700
12712
|
) }, `custom-${I}`);
|
|
12701
12713
|
if (!y.paramName) return null;
|
|
12702
|
-
const x = Se[y.paramName],
|
|
12714
|
+
const x = Se[y.paramName], p = Q(y.displayText, m) || Q(y.label, m) || y.paramName, U = y.labelMode ? y.labelMode !== "placeholder" : O;
|
|
12703
12715
|
if (y.customType === "checkbox") {
|
|
12704
12716
|
const Y = le[y.paramName] === "true";
|
|
12705
12717
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -12719,7 +12731,7 @@ const Ta = ({
|
|
|
12719
12731
|
}
|
|
12720
12732
|
),
|
|
12721
12733
|
/* @__PURE__ */ s("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
12722
|
-
|
|
12734
|
+
p,
|
|
12723
12735
|
y.required && /* @__PURE__ */ i("span", { className: "ml-0.5", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "*" })
|
|
12724
12736
|
] })
|
|
12725
12737
|
]
|
|
@@ -12732,8 +12744,8 @@ const Ta = ({
|
|
|
12732
12744
|
Ne,
|
|
12733
12745
|
{
|
|
12734
12746
|
type: "text",
|
|
12735
|
-
label:
|
|
12736
|
-
placeholder:
|
|
12747
|
+
label: U ? `${p}${y.required ? " *" : ""}` : void 0,
|
|
12748
|
+
placeholder: U ? void 0 : p,
|
|
12737
12749
|
value: le[y.paramName] || "",
|
|
12738
12750
|
onChange: (Y) => j(y.paramName, Y.target.value),
|
|
12739
12751
|
required: y.required,
|
|
@@ -12763,9 +12775,9 @@ const Ta = ({
|
|
|
12763
12775
|
]
|
|
12764
12776
|
}
|
|
12765
12777
|
),
|
|
12766
|
-
I && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: y.fields.map((x,
|
|
12767
|
-
const
|
|
12768
|
-
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${
|
|
12778
|
+
I && /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: y.fields.map((x, p) => {
|
|
12779
|
+
const U = Math.min(4, Math.max(1, Number(x.colSpan) || 4)), Y = x.isCustom ? `custom-${p}-${x.paramName}` : `builtin-${x.name}-${p}`;
|
|
12780
|
+
return /* @__PURE__ */ i("div", { style: { gridColumn: `span ${U} / span ${U}` }, children: x.isCustom ? Qe(x, p) : at(x.name, Y, x.displayText, x.countriesType, x.labelMode) }, Y);
|
|
12769
12781
|
}) })
|
|
12770
12782
|
] });
|
|
12771
12783
|
};
|
|
@@ -12774,10 +12786,10 @@ const Ta = ({
|
|
|
12774
12786
|
/* @__PURE__ */ i(Ye, { className: "my-8" }),
|
|
12775
12787
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: m("common.loadingForm") })
|
|
12776
12788
|
] }) }) });
|
|
12777
|
-
if (
|
|
12778
|
-
const y =
|
|
12789
|
+
if (N) {
|
|
12790
|
+
const y = N[re] ?? N[0], I = Fe === -1, x = ke === -1, p = N.length, U = _(y), Y = ve(y), ce = Object.values(Se), Ee = !U && !!y.conditionalOn && y.conditionalMode === "block", c = V || u || Ee || Y;
|
|
12779
12791
|
let P;
|
|
12780
|
-
return Ee || Y ? P = m("common.blocked") : x ? P = y.conditionalOn && !
|
|
12792
|
+
return Ee || Y ? P = m("common.blocked") : x ? P = y.conditionalOn && !U ? m("common.skipAndSubmit") : m("common.submit") : P = y.conditionalOn && !U ? m("common.skip") : m("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(ae, { children: [
|
|
12781
12793
|
/* @__PURE__ */ i(Ae, { children: /* @__PURE__ */ i(bt, { title: (l == null ? void 0 : l.title) || m("createCompany.title") }) }),
|
|
12782
12794
|
/* @__PURE__ */ s(ne, { children: [
|
|
12783
12795
|
(y.title || y.subtitle) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
@@ -12795,8 +12807,8 @@ const Ta = ({
|
|
|
12795
12807
|
] }),
|
|
12796
12808
|
ce.map((A, h) => /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: A }, h))
|
|
12797
12809
|
] }),
|
|
12798
|
-
|
|
12799
|
-
|
|
12810
|
+
p > 1 && /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "1rem" }, children: [
|
|
12811
|
+
N.map((A, h) => /* @__PURE__ */ i(
|
|
12800
12812
|
"div",
|
|
12801
12813
|
{
|
|
12802
12814
|
style: {
|
|
@@ -12811,7 +12823,7 @@ const Ta = ({
|
|
|
12811
12823
|
/* @__PURE__ */ s("span", { style: { fontSize: "0.75rem", color: "var(--metakyc-text-muted, #9ca3af)", flexShrink: 0 }, children: [
|
|
12812
12824
|
re + 1,
|
|
12813
12825
|
" / ",
|
|
12814
|
-
|
|
12826
|
+
p
|
|
12815
12827
|
] })
|
|
12816
12828
|
] }),
|
|
12817
12829
|
dt(y)
|
|
@@ -12867,26 +12879,26 @@ const Ta = ({
|
|
|
12867
12879
|
workflowKey: u,
|
|
12868
12880
|
nextWorkflowKey: m,
|
|
12869
12881
|
hasWorkflowChanged: f,
|
|
12870
|
-
isLoading:
|
|
12871
|
-
error:
|
|
12872
|
-
moveBack:
|
|
12882
|
+
isLoading: g,
|
|
12883
|
+
error: S,
|
|
12884
|
+
moveBack: R,
|
|
12873
12885
|
refreshProgress: b
|
|
12874
|
-
} = Mr(e), [O,
|
|
12886
|
+
} = Mr(e), [O, N] = Re.useState(!1), H = Re.useRef(null);
|
|
12875
12887
|
if (Re.useEffect(() => {
|
|
12876
|
-
|
|
12877
|
-
}, [
|
|
12888
|
+
S && a && a(S);
|
|
12889
|
+
}, [S, a]), Re.useEffect(() => {
|
|
12878
12890
|
o != null && o.workflowResult && t && t(o.workflowResult);
|
|
12879
12891
|
}, [o == null ? void 0 : o.workflowResult, t]), Re.useEffect(() => {
|
|
12880
|
-
f &&
|
|
12881
|
-
}, [f]),
|
|
12892
|
+
f && N(!1);
|
|
12893
|
+
}, [f]), g || !o)
|
|
12882
12894
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${r || ""}`, children: /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ s(ne, { children: [
|
|
12883
12895
|
/* @__PURE__ */ i(Ye, { className: "my-8" }),
|
|
12884
12896
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n("workflow.loadingWorkflow") })
|
|
12885
12897
|
] }) }) });
|
|
12886
|
-
if (
|
|
12898
|
+
if (S)
|
|
12887
12899
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${r || ""}`, children: /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
|
|
12888
12900
|
/* @__PURE__ */ i("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: n("workflow.errorOccurred") }),
|
|
12889
|
-
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
12901
|
+
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: S.message })
|
|
12890
12902
|
] }) }) }) });
|
|
12891
12903
|
if (f && !O)
|
|
12892
12904
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${r || ""}`, children: /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
|
|
@@ -12910,7 +12922,7 @@ const Ta = ({
|
|
|
12910
12922
|
/* @__PURE__ */ i(
|
|
12911
12923
|
"button",
|
|
12912
12924
|
{
|
|
12913
|
-
onClick: () =>
|
|
12925
|
+
onClick: () => N(!0),
|
|
12914
12926
|
className: "px-6 py-3 font-medium rounded-lg transition-opacity hover:opacity-90",
|
|
12915
12927
|
style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
|
|
12916
12928
|
children: n("workflow.continueNewWorkflow")
|
|
@@ -12960,7 +12972,7 @@ const Ta = ({
|
|
|
12960
12972
|
return "";
|
|
12961
12973
|
}
|
|
12962
12974
|
}, F = () => {
|
|
12963
|
-
const q = d.filter((
|
|
12975
|
+
const q = d.filter((K) => K.visibility !== !1), J = q.findIndex((K) => K.order === l.order), ie = J >= 0 ? J + 1 : 1, C = q.length, z = C > 1 ? (J + 1) / C * 100 : 100;
|
|
12964
12976
|
return /* @__PURE__ */ s("div", { className: "metakyc-progress-wrapper", style: {
|
|
12965
12977
|
marginBottom: "24px",
|
|
12966
12978
|
backgroundColor: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
|
|
@@ -12971,7 +12983,7 @@ const Ta = ({
|
|
|
12971
12983
|
}, children: [
|
|
12972
12984
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px", gap: "8px", flexWrap: "wrap" }, children: [
|
|
12973
12985
|
/* @__PURE__ */ i(bt, {}),
|
|
12974
|
-
/* @__PURE__ */ i(mi, { variant: o.status === 1 ? "info" : "success", children: n("common.stepXofY", { current: ie, total:
|
|
12986
|
+
/* @__PURE__ */ i(mi, { variant: o.status === 1 ? "info" : "success", children: n("common.stepXofY", { current: ie, total: C }) })
|
|
12975
12987
|
] }),
|
|
12976
12988
|
/* @__PURE__ */ s("div", { style: { position: "relative", height: "4px", borderRadius: "999px", overflow: "hidden", marginBottom: "16px" }, children: [
|
|
12977
12989
|
/* @__PURE__ */ i("div", { style: { position: "absolute", inset: 0, backgroundColor: "var(--metakyc-border, #e5e7eb)", opacity: 0.3 } }),
|
|
@@ -12997,29 +13009,29 @@ const Ta = ({
|
|
|
12997
13009
|
)
|
|
12998
13010
|
] });
|
|
12999
13011
|
}, L = () => {
|
|
13000
|
-
const ie = d.filter((z) => z.visibility !== !1).findIndex((z) => z.order === l.order) <= 0,
|
|
13012
|
+
const ie = d.filter((z) => z.visibility !== !1).findIndex((z) => z.order === l.order) <= 0, C = {
|
|
13001
13013
|
applicantId: e,
|
|
13002
13014
|
onComplete: async () => {
|
|
13003
13015
|
await b();
|
|
13004
13016
|
},
|
|
13005
|
-
onBack: ie ? void 0 :
|
|
13017
|
+
onBack: ie ? void 0 : R
|
|
13006
13018
|
};
|
|
13007
13019
|
switch (l.action) {
|
|
13008
13020
|
case pe.Questionaries:
|
|
13009
|
-
return /* @__PURE__ */ i(aa, { ...
|
|
13021
|
+
return /* @__PURE__ */ i(aa, { ...C });
|
|
13010
13022
|
case pe.UploadDocument:
|
|
13011
|
-
return /* @__PURE__ */ i(sa, { ...
|
|
13023
|
+
return /* @__PURE__ */ i(sa, { ...C });
|
|
13012
13024
|
case pe.Overview:
|
|
13013
|
-
return /* @__PURE__ */ i(la, { ...
|
|
13025
|
+
return /* @__PURE__ */ i(la, { ...C });
|
|
13014
13026
|
case pe.IdentitySdk:
|
|
13015
|
-
return /* @__PURE__ */ i(xa, { ...
|
|
13027
|
+
return /* @__PURE__ */ i(xa, { ...C });
|
|
13016
13028
|
case pe.RiskScoring:
|
|
13017
|
-
return /* @__PURE__ */ i(ya, { ...
|
|
13029
|
+
return /* @__PURE__ */ i(ya, { ...C });
|
|
13018
13030
|
case pe.AdditionalData:
|
|
13019
13031
|
case pe.InvestorCategorization:
|
|
13020
|
-
return /* @__PURE__ */ i(ka, { ...
|
|
13032
|
+
return /* @__PURE__ */ i(ka, { ...C });
|
|
13021
13033
|
case pe.AppropriatenessTest:
|
|
13022
|
-
return /* @__PURE__ */ i(ha, { ...
|
|
13034
|
+
return /* @__PURE__ */ i(ha, { ...C });
|
|
13023
13035
|
case pe.ManualReview:
|
|
13024
13036
|
return /* @__PURE__ */ i(
|
|
13025
13037
|
Zt,
|
|
@@ -13076,7 +13088,7 @@ const Ta = ({
|
|
|
13076
13088
|
gap: "0"
|
|
13077
13089
|
},
|
|
13078
13090
|
children: e.map((l, d) => {
|
|
13079
|
-
const u = d < t, m = d === t, f = u || m,
|
|
13091
|
+
const u = d < t, m = d === t, f = u || m, g = l.displayName || l.name || a(l.action) || `Step ${d + 1}`;
|
|
13080
13092
|
return /* @__PURE__ */ s(Re.Fragment, { children: [
|
|
13081
13093
|
/* @__PURE__ */ s(
|
|
13082
13094
|
"div",
|
|
@@ -13116,7 +13128,7 @@ const Ta = ({
|
|
|
13116
13128
|
fontWeight: m ? 600 : 400,
|
|
13117
13129
|
color: m ? "var(--metakyc-text-primary, #111827)" : u ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
13118
13130
|
transition: "color 0.2s ease"
|
|
13119
|
-
}, children:
|
|
13131
|
+
}, children: g })
|
|
13120
13132
|
]
|
|
13121
13133
|
}
|
|
13122
13134
|
),
|
|
@@ -13142,23 +13154,23 @@ const Ta = ({
|
|
|
13142
13154
|
onApplicantCreated: r,
|
|
13143
13155
|
className: n
|
|
13144
13156
|
}) => {
|
|
13145
|
-
var O,
|
|
13157
|
+
var O, N;
|
|
13146
13158
|
const { t: o } = Ie(), { config: l } = Me(), {
|
|
13147
13159
|
phase: d,
|
|
13148
13160
|
applicantId: u,
|
|
13149
13161
|
isCompany: m,
|
|
13150
13162
|
workflowKey: f,
|
|
13151
|
-
error:
|
|
13152
|
-
isLoading:
|
|
13153
|
-
transitionToWorkflow:
|
|
13163
|
+
error: g,
|
|
13164
|
+
isLoading: S,
|
|
13165
|
+
transitionToWorkflow: R
|
|
13154
13166
|
} = jr(e);
|
|
13155
13167
|
Re.useEffect(() => {
|
|
13156
|
-
|
|
13157
|
-
}, [
|
|
13168
|
+
g && a && a(g);
|
|
13169
|
+
}, [g, a]);
|
|
13158
13170
|
const b = Re.useCallback((H) => {
|
|
13159
|
-
r == null || r(H),
|
|
13160
|
-
}, [r,
|
|
13161
|
-
if (d === "loading" ||
|
|
13171
|
+
r == null || r(H), R(H);
|
|
13172
|
+
}, [r, R]);
|
|
13173
|
+
if (d === "loading" || S)
|
|
13162
13174
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ s(ne, { children: [
|
|
13163
13175
|
/* @__PURE__ */ i(Ye, { className: "my-8" }),
|
|
13164
13176
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o("workflow.loadingWorkflow") })
|
|
@@ -13166,10 +13178,10 @@ const Ta = ({
|
|
|
13166
13178
|
if (d === "error")
|
|
13167
13179
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
|
|
13168
13180
|
/* @__PURE__ */ i("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: o("workflow.errorOccurred") }),
|
|
13169
|
-
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: (
|
|
13181
|
+
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: (g == null ? void 0 : g.message) || "An unexpected error occurred." })
|
|
13170
13182
|
] }) }) }) });
|
|
13171
13183
|
if (d === "create_applicant") {
|
|
13172
|
-
const H = f || ((O = l.applicantForm) == null ? void 0 : O.workflowKey), B = (
|
|
13184
|
+
const H = f || ((O = l.applicantForm) == null ? void 0 : O.workflowKey), B = (N = l.applicantForm) == null ? void 0 : N.externalRefId;
|
|
13173
13185
|
return m ? /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
13174
13186
|
Ta,
|
|
13175
13187
|
{
|
|
@@ -13255,7 +13267,7 @@ export {
|
|
|
13255
13267
|
Vi as AppropriatenessTestService,
|
|
13256
13268
|
ha as AppropriatenessTestStep,
|
|
13257
13269
|
mi as Badge,
|
|
13258
|
-
|
|
13270
|
+
Ui as BaseInformationService,
|
|
13259
13271
|
Z as Button,
|
|
13260
13272
|
yt as COMPANY_FIELD_METADATA,
|
|
13261
13273
|
ae as Card,
|
|
@@ -13280,7 +13292,7 @@ export {
|
|
|
13280
13292
|
bt as Header,
|
|
13281
13293
|
Mi as HttpClient,
|
|
13282
13294
|
st as IdentityProviderManager,
|
|
13283
|
-
|
|
13295
|
+
Ki as IdentityService,
|
|
13284
13296
|
He as IdentityVerificationProvider,
|
|
13285
13297
|
xa as IdentityVerificationStep,
|
|
13286
13298
|
Ne as Input,
|
|
@@ -13334,7 +13346,7 @@ export {
|
|
|
13334
13346
|
_a as clearAllStorage,
|
|
13335
13347
|
Er as clearApplicantId,
|
|
13336
13348
|
Dr as clearWorkflowState,
|
|
13337
|
-
|
|
13349
|
+
Ke as cn,
|
|
13338
13350
|
Yi as corporateTheme,
|
|
13339
13351
|
Pi as defaultConfig,
|
|
13340
13352
|
Be as defaultTheme,
|
|
@@ -13370,7 +13382,7 @@ export {
|
|
|
13370
13382
|
qr as useRiskScoring,
|
|
13371
13383
|
Ie as useTranslation,
|
|
13372
13384
|
Or as useUploadDocument,
|
|
13373
|
-
|
|
13374
|
-
|
|
13385
|
+
Ka as validateFileSize,
|
|
13386
|
+
Ua as validateFileType
|
|
13375
13387
|
};
|
|
13376
13388
|
//# sourceMappingURL=index.js.map
|