@vpdev2/metakyc 1.0.31 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CreateApplicantForm.d.ts.map +1 -1
- package/dist/components/CreateCompanyApplicantForm.d.ts.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1019 -1023
- package/dist/index.js.map +1 -1
- package/dist/types/form-config.d.ts +2 -0
- package/dist/types/form-config.d.ts.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 ye = (e, t, i) => lr(e, typeof t != "symbol" ? t + "" : t, i);
|
|
|
4
4
|
import cr from "axios";
|
|
5
5
|
import { jsx as r, jsxs as o, Fragment as ut } from "react/jsx-runtime";
|
|
6
6
|
import * as Et from "react";
|
|
7
|
-
import Ce, { createContext as _t, useMemo as Fe, useState as
|
|
7
|
+
import Ce, { createContext as _t, useMemo as Fe, useState as v, useEffect as fe, useContext as Gt, useCallback as te, useRef as de, forwardRef as kt, createElement as Tt } from "react";
|
|
8
8
|
import dr, { createPortal as zt } from "react-dom";
|
|
9
9
|
import { useForm as mr, Controller as at } from "react-hook-form";
|
|
10
10
|
import { z as Qe } from "zod";
|
|
@@ -16,48 +16,48 @@ const tt = {
|
|
|
16
16
|
PhoneNumber: 40,
|
|
17
17
|
UboAddress: 50
|
|
18
18
|
}, st = {
|
|
19
|
-
firstName: { label: "First Name", type: "text" },
|
|
20
|
-
lastName: { label: "Last Name", type: "text" },
|
|
21
|
-
email: { label: "Email", type: "email" },
|
|
22
|
-
phonenumber: { label: "Phone Number", type: "tel" },
|
|
23
|
-
dateOfBirth: { label: "Date of Birth", type: "date" },
|
|
24
|
-
salutation: { label: "Salutation", type: "select" },
|
|
25
|
-
title: { label: "Title", type: "text" },
|
|
26
|
-
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType: tt.PhoneNumber },
|
|
27
|
-
street: { label: "Street", type: "text" },
|
|
28
|
-
streetNumber: { label: "Street Number", type: "text" },
|
|
29
|
-
zip: { label: "ZIP / Postal Code", type: "text" },
|
|
30
|
-
city: { label: "City", type: "text" },
|
|
31
|
-
country: { label: "Country", type: "select", countriesType: tt.Address },
|
|
32
|
-
nationality: { label: "Nationality", type: "select", countriesType: tt.Nationality },
|
|
33
|
-
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType: tt.Nationality },
|
|
34
|
-
countryOfBirth: { label: "Country of Birth", type: "select", countriesType: tt.CountryOfBirth },
|
|
35
|
-
placeOfBirth: { label: "Place of Birth", type: "text" },
|
|
36
|
-
taxCountry: { label: "Tax Country", type: "select", countriesType: tt.Address },
|
|
37
|
-
taxNumber: { label: "Tax Number", type: "text" },
|
|
38
|
-
defaultLanguage: { label: "Default Language", type: "select" },
|
|
39
|
-
educationLevel: { label: "Education Level", type: "text" },
|
|
40
|
-
occupation: { label: "Occupation", type: "text" }
|
|
19
|
+
firstName: { label: "First Name", translationKey: "firstName", type: "text" },
|
|
20
|
+
lastName: { label: "Last Name", translationKey: "lastName", type: "text" },
|
|
21
|
+
email: { label: "Email", translationKey: "email", type: "email" },
|
|
22
|
+
phonenumber: { label: "Phone Number", translationKey: "phoneNumber", type: "tel" },
|
|
23
|
+
dateOfBirth: { label: "Date of Birth", translationKey: "dateOfBirth", type: "date" },
|
|
24
|
+
salutation: { label: "Salutation", translationKey: "salutation", type: "select" },
|
|
25
|
+
title: { label: "Title", translationKey: "title", type: "text" },
|
|
26
|
+
mobileCountryCode: { label: "Mobile Country Code", translationKey: "mobileCountryCode", type: "select", countriesType: tt.PhoneNumber },
|
|
27
|
+
street: { label: "Street", translationKey: "street", type: "text" },
|
|
28
|
+
streetNumber: { label: "Street Number", translationKey: "streetNumber", type: "text" },
|
|
29
|
+
zip: { label: "ZIP / Postal Code", translationKey: "zip", type: "text" },
|
|
30
|
+
city: { label: "City", translationKey: "city", type: "text" },
|
|
31
|
+
country: { label: "Country", translationKey: "country", type: "select", countriesType: tt.Address },
|
|
32
|
+
nationality: { label: "Nationality", translationKey: "nationality", type: "select", countriesType: tt.Nationality },
|
|
33
|
+
otherNationality: { label: "Other Nationalities", translationKey: "otherNationalities", type: "multiselect", countriesType: tt.Nationality },
|
|
34
|
+
countryOfBirth: { label: "Country of Birth", translationKey: "countryOfBirth", type: "select", countriesType: tt.CountryOfBirth },
|
|
35
|
+
placeOfBirth: { label: "Place of Birth", translationKey: "placeOfBirth", type: "text" },
|
|
36
|
+
taxCountry: { label: "Tax Country", translationKey: "taxCountry", type: "select", countriesType: tt.Address },
|
|
37
|
+
taxNumber: { label: "Tax Number", translationKey: "taxNumber", type: "text" },
|
|
38
|
+
defaultLanguage: { label: "Default Language", translationKey: "defaultLanguage", type: "select" },
|
|
39
|
+
educationLevel: { label: "Education Level", translationKey: "educationLevel", type: "text" },
|
|
40
|
+
occupation: { label: "Occupation", translationKey: "occupation", type: "text" }
|
|
41
41
|
}, dt = {
|
|
42
|
-
companyName: { label: "Company Name", type: "text" },
|
|
43
|
-
email: { label: "Email", type: "email" },
|
|
44
|
-
phone: { label: "Phone", type: "tel" },
|
|
45
|
-
registrationNumber: { label: "Registration Number", type: "text" },
|
|
46
|
-
countryResidence: { label: "Country of Residence", type: "select", countriesType: tt.Address },
|
|
47
|
-
legalAddress: { label: "Legal Address", type: "text" },
|
|
48
|
-
incorporatedOn: { label: "Incorporation Date", type: "date" },
|
|
49
|
-
controlScheme: { label: "Control Scheme", type: "text" },
|
|
50
|
-
taxId: { label: "Tax ID", type: "text" },
|
|
51
|
-
registrationLocation: { label: "Registration Location", type: "text" },
|
|
52
|
-
website: { label: "Website", type: "text" },
|
|
53
|
-
postalAddress: { label: "Postal Address", type: "text" },
|
|
54
|
-
street: { label: "Street", type: "text" },
|
|
55
|
-
streetNumber: { label: "Street Number", type: "text" },
|
|
56
|
-
city: { label: "City", type: "text" },
|
|
57
|
-
state: { label: "State / Province", type: "text" },
|
|
58
|
-
postalCode: { label: "Postal Code", type: "text" },
|
|
59
|
-
addressCountry: { label: "Address Country", type: "select", countriesType: tt.Address },
|
|
60
|
-
lei: { label: "LEI", type: "text" }
|
|
42
|
+
companyName: { label: "Company Name", translationKey: "companyName", type: "text" },
|
|
43
|
+
email: { label: "Email", translationKey: "companyEmail", type: "email" },
|
|
44
|
+
phone: { label: "Phone", translationKey: "companyPhone", type: "tel" },
|
|
45
|
+
registrationNumber: { label: "Registration Number", translationKey: "registrationNumber", type: "text" },
|
|
46
|
+
countryResidence: { label: "Country of Residence", translationKey: "countryOfResidence", type: "select", countriesType: tt.Address },
|
|
47
|
+
legalAddress: { label: "Legal Address", translationKey: "legalAddress", type: "text" },
|
|
48
|
+
incorporatedOn: { label: "Incorporation Date", translationKey: "incorporationDate", type: "date" },
|
|
49
|
+
controlScheme: { label: "Control Scheme", translationKey: "controlScheme", type: "text" },
|
|
50
|
+
taxId: { label: "Tax ID", translationKey: "taxNumber", type: "text" },
|
|
51
|
+
registrationLocation: { label: "Registration Location", translationKey: "street", type: "text" },
|
|
52
|
+
website: { label: "Website", translationKey: "website", type: "text" },
|
|
53
|
+
postalAddress: { label: "Postal Address", translationKey: "legalAddress", type: "text" },
|
|
54
|
+
street: { label: "Street", translationKey: "street", type: "text" },
|
|
55
|
+
streetNumber: { label: "Street Number", translationKey: "streetNumber", type: "text" },
|
|
56
|
+
city: { label: "City", translationKey: "city", type: "text" },
|
|
57
|
+
state: { label: "State / Province", translationKey: "state", type: "text" },
|
|
58
|
+
postalCode: { label: "Postal Code", translationKey: "zip", type: "text" },
|
|
59
|
+
addressCountry: { label: "Address Country", translationKey: "country", type: "select", countriesType: tt.Address },
|
|
60
|
+
lei: { label: "LEI", translationKey: "lei", type: "text" }
|
|
61
61
|
}, Sr = [
|
|
62
62
|
"companyName",
|
|
63
63
|
"email",
|
|
@@ -1273,10 +1273,10 @@ class $r {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
1275
|
class _r {
|
|
1276
|
-
constructor(t, i, a, n, l, s, p,
|
|
1276
|
+
constructor(t, i, a, n, l, s, p, m) {
|
|
1277
1277
|
ye(this, "state");
|
|
1278
1278
|
ye(this, "stepRouter");
|
|
1279
|
-
this.applicantService = t, this.questionnaireService = i, this.uploadDocumentService = a, this.appropriatenessTestService = n, this.overviewService = l, this.riskScoringService = s, this.investorCategorizationService =
|
|
1279
|
+
this.applicantService = t, this.questionnaireService = i, this.uploadDocumentService = a, this.appropriatenessTestService = n, this.overviewService = l, this.riskScoringService = s, this.investorCategorizationService = m, this.state = new Hr(), this.stepRouter = new $r(), this.registerStepHandlers();
|
|
1280
1280
|
}
|
|
1281
1281
|
/**
|
|
1282
1282
|
* Register all step handlers
|
|
@@ -1671,13 +1671,13 @@ class Jr {
|
|
|
1671
1671
|
console.log(`[SardinAI] Device ID: ${p.deviceId}`);
|
|
1672
1672
|
},
|
|
1673
1673
|
// New callback for session updates
|
|
1674
|
-
onConfigUpdate: (p,
|
|
1674
|
+
onConfigUpdate: (p, m, d) => {
|
|
1675
1675
|
switch (p) {
|
|
1676
1676
|
case "SESSION_UPDATE_FAILED":
|
|
1677
1677
|
console.error("[SardinAI] Session update failed:", d);
|
|
1678
1678
|
break;
|
|
1679
1679
|
case "SESSION_UPDATED":
|
|
1680
|
-
console.log("[SardinAI] Session updated:",
|
|
1680
|
+
console.log("[SardinAI] Session updated:", m);
|
|
1681
1681
|
break;
|
|
1682
1682
|
case "SESSION_NO_UPDATE":
|
|
1683
1683
|
console.log("[SardinAI] No session update");
|
|
@@ -1834,19 +1834,19 @@ class ei {
|
|
|
1834
1834
|
"input-border-focus": t.inputBorderFocus || t.primary,
|
|
1835
1835
|
"input-placeholder": t.inputPlaceholder || t.textMuted
|
|
1836
1836
|
};
|
|
1837
|
-
i != null && i.fontFamily && (n["font-family"] = i.fontFamily), i != null && i.headingFont && (n["heading-font"] = i.headingFont), i != null && i.fontSize && Object.entries(i.fontSize).forEach(([
|
|
1838
|
-
n[`font-size-${
|
|
1839
|
-
}), i != null && i.fontWeight && Object.entries(i.fontWeight).forEach(([
|
|
1840
|
-
n[`font-weight-${
|
|
1841
|
-
}), a && Object.entries(a).forEach(([
|
|
1842
|
-
n[this.kebabCase(
|
|
1837
|
+
i != null && i.fontFamily && (n["font-family"] = i.fontFamily), i != null && i.headingFont && (n["heading-font"] = i.headingFont), i != null && i.fontSize && Object.entries(i.fontSize).forEach(([m, d]) => {
|
|
1838
|
+
n[`font-size-${m}`] = d;
|
|
1839
|
+
}), i != null && i.fontWeight && Object.entries(i.fontWeight).forEach(([m, d]) => {
|
|
1840
|
+
n[`font-weight-${m}`] = String(d);
|
|
1841
|
+
}), a && Object.entries(a).forEach(([m, d]) => {
|
|
1842
|
+
n[this.kebabCase(m)] = d;
|
|
1843
1843
|
});
|
|
1844
1844
|
const s = `
|
|
1845
1845
|
/* ── metakyc-theme-vars: scoped CSS variables ──────────────────────────────── */
|
|
1846
1846
|
.metakyc-sdk,
|
|
1847
1847
|
.metakyc-searchable-select-dropdown,
|
|
1848
1848
|
.metakyc-multiselect-dropdown {
|
|
1849
|
-
${Object.entries(n).filter(([,
|
|
1849
|
+
${Object.entries(n).filter(([, m]) => !!m).map(([m, d]) => ` --metakyc-${m}: ${d} !important;`).join(`
|
|
1850
1850
|
`)}
|
|
1851
1851
|
}
|
|
1852
1852
|
|
|
@@ -6738,33 +6738,33 @@ function ve(e, t) {
|
|
|
6738
6738
|
const a = vi.exec(i);
|
|
6739
6739
|
return a ? t(a[1]) : e;
|
|
6740
6740
|
}
|
|
6741
|
-
const Zt = "1.0.
|
|
6741
|
+
const Zt = "1.0.32", Jt = _t(null), Ot = `metakyc-translations-${Zt}-`, bi = ({
|
|
6742
6742
|
locale: e,
|
|
6743
6743
|
fetchTranslations: t,
|
|
6744
6744
|
children: i
|
|
6745
6745
|
}) => {
|
|
6746
6746
|
const a = e.toLowerCase().split(/[-_]/)[0], n = Fe(() => {
|
|
6747
|
-
const
|
|
6748
|
-
if (typeof window > "u") return
|
|
6747
|
+
const m = It(a);
|
|
6748
|
+
if (typeof window > "u") return m;
|
|
6749
6749
|
try {
|
|
6750
6750
|
const d = localStorage.getItem(Ot + a);
|
|
6751
|
-
if (d) return jt(
|
|
6751
|
+
if (d) return jt(m, JSON.parse(d));
|
|
6752
6752
|
} catch {
|
|
6753
6753
|
}
|
|
6754
|
-
return
|
|
6755
|
-
}, [a]), [l, s] =
|
|
6754
|
+
return m;
|
|
6755
|
+
}, [a]), [l, s] = v(n);
|
|
6756
6756
|
fe(() => {
|
|
6757
6757
|
if (!t) return;
|
|
6758
|
-
let
|
|
6758
|
+
let m = !1;
|
|
6759
6759
|
return t(a).then((d) => {
|
|
6760
|
-
if (
|
|
6760
|
+
if (m) return;
|
|
6761
6761
|
if (!d || Object.keys(d).length === 0) {
|
|
6762
6762
|
console.debug("[MetaKYC i18n] No remote overrides for locale:", a);
|
|
6763
6763
|
return;
|
|
6764
6764
|
}
|
|
6765
6765
|
console.debug("[MetaKYC i18n] Remote overrides loaded for locale:", a, d);
|
|
6766
|
-
const y = It(a),
|
|
6767
|
-
s(
|
|
6766
|
+
const y = It(a), h = jt(y, d);
|
|
6767
|
+
s(h);
|
|
6768
6768
|
try {
|
|
6769
6769
|
localStorage.setItem(Ot + a, JSON.stringify(d));
|
|
6770
6770
|
} catch {
|
|
@@ -6772,7 +6772,7 @@ const Zt = "1.0.31", Jt = _t(null), Ot = `metakyc-translations-${Zt}-`, bi = ({
|
|
|
6772
6772
|
}).catch((d) => {
|
|
6773
6773
|
console.warn("[MetaKYC i18n] Failed to fetch remote translations:", d);
|
|
6774
6774
|
}), () => {
|
|
6775
|
-
|
|
6775
|
+
m = !0;
|
|
6776
6776
|
};
|
|
6777
6777
|
}, [a, t]);
|
|
6778
6778
|
const p = Fe(() => ({
|
|
@@ -6803,8 +6803,8 @@ function wi() {
|
|
|
6803
6803
|
}
|
|
6804
6804
|
const Bt = "metakyc-theme-cache", za = ({ config: e, children: t }) => {
|
|
6805
6805
|
wi();
|
|
6806
|
-
const [i, a] =
|
|
6807
|
-
const d = new Rr(e), y = new Ir(d),
|
|
6806
|
+
const [i, a] = v(null), n = Ce.useRef(!1), l = Ce.useRef(!1), s = Fe(() => {
|
|
6807
|
+
const d = new Rr(e), y = new Ir(d), h = new zr(d), R = new Ar(d), L = new Lr(d), b = new Er(d), q = new Pr(d), S = new Dr(d), P = new jr(d), B = new Mr(d), F = new Wr(d), U = new Kr(d), K = new ei();
|
|
6808
6808
|
if (typeof document < "u")
|
|
6809
6809
|
if (e.theme)
|
|
6810
6810
|
K.applyTheme(e.theme);
|
|
@@ -6818,13 +6818,13 @@ const Bt = "metakyc-theme-cache", za = ({ config: e, children: t }) => {
|
|
|
6818
6818
|
return {
|
|
6819
6819
|
httpClient: d,
|
|
6820
6820
|
applicantService: y,
|
|
6821
|
-
questionnaireService:
|
|
6822
|
-
uploadDocumentService:
|
|
6823
|
-
appropriatenessTestService:
|
|
6824
|
-
overviewService:
|
|
6821
|
+
questionnaireService: h,
|
|
6822
|
+
uploadDocumentService: R,
|
|
6823
|
+
appropriatenessTestService: L,
|
|
6824
|
+
overviewService: b,
|
|
6825
6825
|
riskScoringService: q,
|
|
6826
6826
|
identityService: S,
|
|
6827
|
-
baseInformationService:
|
|
6827
|
+
baseInformationService: P,
|
|
6828
6828
|
investorCategorizationService: B,
|
|
6829
6829
|
themeService: F,
|
|
6830
6830
|
translationService: U,
|
|
@@ -6872,7 +6872,7 @@ const Bt = "metakyc-theme-cache", za = ({ config: e, children: t }) => {
|
|
|
6872
6872
|
})(), () => {
|
|
6873
6873
|
s.themeManager.cleanup();
|
|
6874
6874
|
}), []);
|
|
6875
|
-
const
|
|
6875
|
+
const m = te(
|
|
6876
6876
|
(d) => s.translationService.getTranslations(d),
|
|
6877
6877
|
[s.translationService]
|
|
6878
6878
|
);
|
|
@@ -6880,7 +6880,7 @@ const Bt = "metakyc-theme-cache", za = ({ config: e, children: t }) => {
|
|
|
6880
6880
|
bi,
|
|
6881
6881
|
{
|
|
6882
6882
|
locale: e.locale || "en",
|
|
6883
|
-
fetchTranslations:
|
|
6883
|
+
fetchTranslations: m,
|
|
6884
6884
|
children: [
|
|
6885
6885
|
e.showVersion && /* @__PURE__ */ o(
|
|
6886
6886
|
"div",
|
|
@@ -6997,9 +6997,9 @@ function Da() {
|
|
|
6997
6997
|
Ti(), Ii();
|
|
6998
6998
|
}
|
|
6999
6999
|
function zi(e) {
|
|
7000
|
-
const { createOrchestrator: t } = Oe(), [i, a] =
|
|
7000
|
+
const { createOrchestrator: t } = Oe(), [i, a] = v(null), [n, l] = v(!1), [s, p] = v(null), m = de(null), d = e || Ni();
|
|
7001
7001
|
fe(() => {
|
|
7002
|
-
|
|
7002
|
+
m.current || (m.current = t());
|
|
7003
7003
|
}, [t]), fe(() => {
|
|
7004
7004
|
var F;
|
|
7005
7005
|
i && d && (Ci(d), Ri({
|
|
@@ -7011,16 +7011,16 @@ function zi(e) {
|
|
|
7011
7011
|
nextWorkflowKey: i.nextWorkflowKey
|
|
7012
7012
|
}));
|
|
7013
7013
|
}, [i, d]);
|
|
7014
|
-
const y = de(!1),
|
|
7015
|
-
if (!(!d || !
|
|
7014
|
+
const y = de(!1), h = de(!1), R = te(async () => {
|
|
7015
|
+
if (!(!d || !m.current)) {
|
|
7016
7016
|
if (y.current) {
|
|
7017
7017
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
7018
7018
|
return;
|
|
7019
7019
|
}
|
|
7020
7020
|
y.current = !0, l(!0), p(null);
|
|
7021
7021
|
try {
|
|
7022
|
-
const F = await
|
|
7023
|
-
a(F),
|
|
7022
|
+
const F = await m.current.initialize(d);
|
|
7023
|
+
a(F), h.current = !0;
|
|
7024
7024
|
} catch (F) {
|
|
7025
7025
|
p(F);
|
|
7026
7026
|
} finally {
|
|
@@ -7029,17 +7029,17 @@ function zi(e) {
|
|
|
7029
7029
|
}
|
|
7030
7030
|
}, [d]);
|
|
7031
7031
|
fe(() => {
|
|
7032
|
-
d && !
|
|
7033
|
-
}, [d,
|
|
7034
|
-
const
|
|
7035
|
-
if (
|
|
7032
|
+
d && !h.current && R();
|
|
7033
|
+
}, [d, R]);
|
|
7034
|
+
const L = te(async () => {
|
|
7035
|
+
if (m.current) {
|
|
7036
7036
|
if (y.current) {
|
|
7037
7037
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
7038
7038
|
return;
|
|
7039
7039
|
}
|
|
7040
7040
|
y.current = !0, l(!0), p(null);
|
|
7041
7041
|
try {
|
|
7042
|
-
const F = await
|
|
7042
|
+
const F = await m.current.refreshProgress();
|
|
7043
7043
|
a(F);
|
|
7044
7044
|
} catch (F) {
|
|
7045
7045
|
p(F);
|
|
@@ -7047,11 +7047,11 @@ function zi(e) {
|
|
|
7047
7047
|
l(!1), y.current = !1;
|
|
7048
7048
|
}
|
|
7049
7049
|
}
|
|
7050
|
-
}, []),
|
|
7051
|
-
if (
|
|
7050
|
+
}, []), b = te(async () => {
|
|
7051
|
+
if (m.current) {
|
|
7052
7052
|
l(!0), p(null);
|
|
7053
7053
|
try {
|
|
7054
|
-
const F = await
|
|
7054
|
+
const F = await m.current.moveToNextStep();
|
|
7055
7055
|
a(F);
|
|
7056
7056
|
} catch (F) {
|
|
7057
7057
|
p(F);
|
|
@@ -7060,10 +7060,10 @@ function zi(e) {
|
|
|
7060
7060
|
}
|
|
7061
7061
|
}
|
|
7062
7062
|
}, []), q = te(async () => {
|
|
7063
|
-
if (
|
|
7063
|
+
if (m.current) {
|
|
7064
7064
|
l(!0), p(null);
|
|
7065
7065
|
try {
|
|
7066
|
-
const F = await
|
|
7066
|
+
const F = await m.current.moveToPreviousStep();
|
|
7067
7067
|
a(F);
|
|
7068
7068
|
} catch (F) {
|
|
7069
7069
|
p(F);
|
|
@@ -7072,11 +7072,11 @@ function zi(e) {
|
|
|
7072
7072
|
}
|
|
7073
7073
|
}
|
|
7074
7074
|
}, []), S = te(async (F) => {
|
|
7075
|
-
if (
|
|
7075
|
+
if (m.current) {
|
|
7076
7076
|
l(!0), p(null);
|
|
7077
7077
|
try {
|
|
7078
|
-
await
|
|
7079
|
-
const U = await
|
|
7078
|
+
await m.current.submitCurrentStep(F);
|
|
7079
|
+
const U = await m.current.refreshProgress();
|
|
7080
7080
|
a(U);
|
|
7081
7081
|
} catch (U) {
|
|
7082
7082
|
throw p(U), U;
|
|
@@ -7084,12 +7084,12 @@ function zi(e) {
|
|
|
7084
7084
|
l(!1);
|
|
7085
7085
|
}
|
|
7086
7086
|
}
|
|
7087
|
-
}, []),
|
|
7087
|
+
}, []), P = Et.useMemo(() => i != null && i.stepInfoList ? [...i.stepInfoList].sort((F, U) => F.order - U.order) : [], [i == null ? void 0 : i.stepInfoList]), B = Et.useMemo(() => i ? i.nextWorkflowKey && i.nextWorkflowKey !== i.workFlowKey : !1, [i]);
|
|
7088
7088
|
return {
|
|
7089
7089
|
progress: i,
|
|
7090
7090
|
applicantId: d,
|
|
7091
7091
|
currentStep: (i == null ? void 0 : i.currentStep) || null,
|
|
7092
|
-
steps:
|
|
7092
|
+
steps: P,
|
|
7093
7093
|
status: (i == null ? void 0 : i.status) || qe.None,
|
|
7094
7094
|
workflowResult: (i == null ? void 0 : i.workflowResult) || null,
|
|
7095
7095
|
workflowKey: i == null ? void 0 : i.workFlowKey,
|
|
@@ -7099,56 +7099,56 @@ function zi(e) {
|
|
|
7099
7099
|
error: s,
|
|
7100
7100
|
isComplete: (i == null ? void 0 : i.status) === qe.Finished,
|
|
7101
7101
|
isOnHold: (i == null ? void 0 : i.status) === qe.OnHold,
|
|
7102
|
-
refreshProgress:
|
|
7103
|
-
moveToNext:
|
|
7102
|
+
refreshProgress: L,
|
|
7103
|
+
moveToNext: b,
|
|
7104
7104
|
moveBack: q,
|
|
7105
7105
|
submitCurrentStep: S,
|
|
7106
|
-
orchestrator:
|
|
7106
|
+
orchestrator: m.current
|
|
7107
7107
|
};
|
|
7108
7108
|
}
|
|
7109
7109
|
function Ai(e) {
|
|
7110
|
-
const { questionnaireService: t, applicantService: i } = Oe(), [a, n] =
|
|
7111
|
-
var
|
|
7110
|
+
const { questionnaireService: t, applicantService: i } = Oe(), [a, n] = v(null), [l, s] = v({}), [p, m] = v(!1), [d, y] = v(!1), [h, R] = v(null), L = de(!1), b = de(null), q = te(async () => {
|
|
7111
|
+
var P, B;
|
|
7112
7112
|
if (e) {
|
|
7113
|
-
if (
|
|
7113
|
+
if (L.current) {
|
|
7114
7114
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
7115
7115
|
return;
|
|
7116
7116
|
}
|
|
7117
|
-
|
|
7117
|
+
L.current = !0, m(!0), R(null);
|
|
7118
7118
|
try {
|
|
7119
7119
|
const [F, U] = await Promise.all([
|
|
7120
7120
|
t.getQuestionnaire(e),
|
|
7121
7121
|
i.getApplicantData(e).catch(() => null)
|
|
7122
7122
|
]);
|
|
7123
|
-
if (n(F), (
|
|
7123
|
+
if (n(F), (P = U == null ? void 0 : U.questionnaireResults) != null && P.length && F) {
|
|
7124
7124
|
const K = /* @__PURE__ */ new Map();
|
|
7125
|
-
for (const
|
|
7126
|
-
|
|
7127
|
-
const J = {}, ae = F.questionGroups.flatMap((
|
|
7128
|
-
for (const
|
|
7129
|
-
const
|
|
7130
|
-
K.has(
|
|
7125
|
+
for (const x of U.questionnaireResults)
|
|
7126
|
+
x.question && ((B = x.answers) != null && B.length) && K.set(x.question.trim().toLowerCase(), x.answers);
|
|
7127
|
+
const J = {}, ae = F.questionGroups.flatMap((x) => x.questions ?? []);
|
|
7128
|
+
for (const x of ae) {
|
|
7129
|
+
const z = x.text.trim().toLowerCase();
|
|
7130
|
+
K.has(z) && (J[x.id] = K.get(z));
|
|
7131
7131
|
}
|
|
7132
7132
|
s(J);
|
|
7133
7133
|
}
|
|
7134
|
-
|
|
7134
|
+
b.current = e;
|
|
7135
7135
|
} catch (F) {
|
|
7136
|
-
|
|
7136
|
+
R(F);
|
|
7137
7137
|
} finally {
|
|
7138
|
-
|
|
7138
|
+
m(!1), L.current = !1;
|
|
7139
7139
|
}
|
|
7140
7140
|
}
|
|
7141
7141
|
}, [e, t, i]);
|
|
7142
7142
|
fe(() => {
|
|
7143
|
-
e &&
|
|
7143
|
+
e && b.current !== e && q();
|
|
7144
7144
|
}, [e]);
|
|
7145
7145
|
const S = te(
|
|
7146
|
-
async (
|
|
7147
|
-
y(!0),
|
|
7146
|
+
async (P) => {
|
|
7147
|
+
y(!0), R(null);
|
|
7148
7148
|
try {
|
|
7149
|
-
return await t.fillQuestionnaire(
|
|
7149
|
+
return await t.fillQuestionnaire(P);
|
|
7150
7150
|
} catch (B) {
|
|
7151
|
-
throw
|
|
7151
|
+
throw R(B), B;
|
|
7152
7152
|
} finally {
|
|
7153
7153
|
y(!1);
|
|
7154
7154
|
}
|
|
@@ -7160,39 +7160,39 @@ function Ai(e) {
|
|
|
7160
7160
|
initialAnswers: l,
|
|
7161
7161
|
isLoading: p,
|
|
7162
7162
|
isSubmitting: d,
|
|
7163
|
-
error:
|
|
7163
|
+
error: h,
|
|
7164
7164
|
load: q,
|
|
7165
7165
|
submit: S
|
|
7166
7166
|
};
|
|
7167
7167
|
}
|
|
7168
7168
|
function Li(e) {
|
|
7169
|
-
const { uploadDocumentService: t } = Oe(), [i, a] =
|
|
7169
|
+
const { uploadDocumentService: t } = Oe(), [i, a] = v(null), [n, l] = v(!1), [s, p] = v(!1), [m, d] = v(0), [y, h] = v(null), R = de(!1), L = de(null), b = te(async () => {
|
|
7170
7170
|
if (e) {
|
|
7171
|
-
if (
|
|
7171
|
+
if (R.current) {
|
|
7172
7172
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
7173
7173
|
return;
|
|
7174
7174
|
}
|
|
7175
|
-
|
|
7175
|
+
R.current = !0, l(!0), h(null);
|
|
7176
7176
|
try {
|
|
7177
7177
|
const S = await t.getUploadDocument(e);
|
|
7178
|
-
a(S),
|
|
7178
|
+
a(S), L.current = e;
|
|
7179
7179
|
} catch (S) {
|
|
7180
|
-
|
|
7180
|
+
h(S);
|
|
7181
7181
|
} finally {
|
|
7182
|
-
l(!1),
|
|
7182
|
+
l(!1), R.current = !1;
|
|
7183
7183
|
}
|
|
7184
7184
|
}
|
|
7185
7185
|
}, [e, t]);
|
|
7186
7186
|
fe(() => {
|
|
7187
|
-
e &&
|
|
7187
|
+
e && L.current !== e && b();
|
|
7188
7188
|
}, [e]);
|
|
7189
7189
|
const q = te(
|
|
7190
7190
|
async (S) => {
|
|
7191
|
-
p(!0), d(0),
|
|
7191
|
+
p(!0), d(0), h(null);
|
|
7192
7192
|
try {
|
|
7193
7193
|
await t.fillUploadDocument(S), d(100);
|
|
7194
|
-
} catch (
|
|
7195
|
-
throw
|
|
7194
|
+
} catch (P) {
|
|
7195
|
+
throw h(P), P;
|
|
7196
7196
|
} finally {
|
|
7197
7197
|
p(!1);
|
|
7198
7198
|
}
|
|
@@ -7203,41 +7203,41 @@ function Li(e) {
|
|
|
7203
7203
|
uploadDocument: i,
|
|
7204
7204
|
isLoading: n,
|
|
7205
7205
|
isSubmitting: s,
|
|
7206
|
-
uploadProgress:
|
|
7206
|
+
uploadProgress: m,
|
|
7207
7207
|
error: y,
|
|
7208
|
-
load:
|
|
7208
|
+
load: b,
|
|
7209
7209
|
submit: q
|
|
7210
7210
|
};
|
|
7211
7211
|
}
|
|
7212
7212
|
function ja(e) {
|
|
7213
|
-
const { appropriatenessTestService: t } = Oe(), [i, a] =
|
|
7213
|
+
const { appropriatenessTestService: t } = Oe(), [i, a] = v(null), [n, l] = v(!1), [s, p] = v(!1), [m, d] = v(null), [y, h] = v(null), R = de(!1), L = de(null), b = te(async () => {
|
|
7214
7214
|
if (e) {
|
|
7215
|
-
if (
|
|
7215
|
+
if (R.current) {
|
|
7216
7216
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
7217
7217
|
return;
|
|
7218
7218
|
}
|
|
7219
|
-
|
|
7219
|
+
R.current = !0, l(!0), d(null);
|
|
7220
7220
|
try {
|
|
7221
7221
|
const S = await t.getAppropriatenessTest(e);
|
|
7222
|
-
a(S),
|
|
7222
|
+
a(S), L.current = e;
|
|
7223
7223
|
} catch (S) {
|
|
7224
7224
|
d(S);
|
|
7225
7225
|
} finally {
|
|
7226
|
-
l(!1),
|
|
7226
|
+
l(!1), R.current = !1;
|
|
7227
7227
|
}
|
|
7228
7228
|
}
|
|
7229
7229
|
}, [e, t]);
|
|
7230
7230
|
fe(() => {
|
|
7231
|
-
e &&
|
|
7231
|
+
e && L.current !== e && b();
|
|
7232
7232
|
}, [e]);
|
|
7233
7233
|
const q = te(
|
|
7234
7234
|
async (S) => {
|
|
7235
7235
|
p(!0), d(null);
|
|
7236
7236
|
try {
|
|
7237
|
-
const
|
|
7238
|
-
return
|
|
7239
|
-
} catch (
|
|
7240
|
-
throw d(
|
|
7237
|
+
const P = await t.fillAppropriatenessTest(S);
|
|
7238
|
+
return h(P), P;
|
|
7239
|
+
} catch (P) {
|
|
7240
|
+
throw d(P), P;
|
|
7241
7241
|
} finally {
|
|
7242
7242
|
p(!1);
|
|
7243
7243
|
}
|
|
@@ -7249,13 +7249,13 @@ function ja(e) {
|
|
|
7249
7249
|
result: y,
|
|
7250
7250
|
isLoading: n,
|
|
7251
7251
|
isSubmitting: s,
|
|
7252
|
-
error:
|
|
7253
|
-
load:
|
|
7252
|
+
error: m,
|
|
7253
|
+
load: b,
|
|
7254
7254
|
submit: q
|
|
7255
7255
|
};
|
|
7256
7256
|
}
|
|
7257
7257
|
function Ei(e) {
|
|
7258
|
-
const { overviewService: t } = Oe(), [i, a] =
|
|
7258
|
+
const { overviewService: t } = Oe(), [i, a] = v(null), [n, l] = v(!1), [s, p] = v(!1), [m, d] = v(null), y = de(!1), h = de(null), R = te(async () => {
|
|
7259
7259
|
if (e) {
|
|
7260
7260
|
if (y.current) {
|
|
7261
7261
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -7263,25 +7263,25 @@ function Ei(e) {
|
|
|
7263
7263
|
}
|
|
7264
7264
|
y.current = !0, l(!0), d(null);
|
|
7265
7265
|
try {
|
|
7266
|
-
const
|
|
7267
|
-
a(
|
|
7268
|
-
} catch (
|
|
7269
|
-
d(
|
|
7266
|
+
const b = await t.getOverviewData(e);
|
|
7267
|
+
a(b), h.current = e;
|
|
7268
|
+
} catch (b) {
|
|
7269
|
+
d(b);
|
|
7270
7270
|
} finally {
|
|
7271
7271
|
l(!1), y.current = !1;
|
|
7272
7272
|
}
|
|
7273
7273
|
}
|
|
7274
7274
|
}, [e, t]);
|
|
7275
7275
|
fe(() => {
|
|
7276
|
-
e &&
|
|
7276
|
+
e && h.current !== e && R();
|
|
7277
7277
|
}, [e]);
|
|
7278
|
-
const
|
|
7278
|
+
const L = te(async () => {
|
|
7279
7279
|
if (e) {
|
|
7280
7280
|
p(!0), d(null);
|
|
7281
7281
|
try {
|
|
7282
7282
|
await t.passOverview(e);
|
|
7283
|
-
} catch (
|
|
7284
|
-
throw d(
|
|
7283
|
+
} catch (b) {
|
|
7284
|
+
throw d(b), b;
|
|
7285
7285
|
} finally {
|
|
7286
7286
|
p(!1);
|
|
7287
7287
|
}
|
|
@@ -7291,83 +7291,83 @@ function Ei(e) {
|
|
|
7291
7291
|
overview: i,
|
|
7292
7292
|
isLoading: n,
|
|
7293
7293
|
isSubmitting: s,
|
|
7294
|
-
error:
|
|
7295
|
-
load:
|
|
7296
|
-
passOverview:
|
|
7294
|
+
error: m,
|
|
7295
|
+
load: R,
|
|
7296
|
+
passOverview: L
|
|
7297
7297
|
};
|
|
7298
7298
|
}
|
|
7299
7299
|
function Pi(e) {
|
|
7300
|
-
const { identityService: t } = Oe(), [i, a] =
|
|
7300
|
+
const { identityService: t } = Oe(), [i, a] = v(
|
|
7301
7301
|
null
|
|
7302
|
-
), [n, l] =
|
|
7303
|
-
async (
|
|
7302
|
+
), [n, l] = v(!1), [s, p] = v(null), m = de(!1), d = te(
|
|
7303
|
+
async (R, L) => {
|
|
7304
7304
|
if (e) {
|
|
7305
|
-
if (
|
|
7305
|
+
if (m.current) {
|
|
7306
7306
|
console.log("[Identity] Request already in progress, skipping...");
|
|
7307
7307
|
return;
|
|
7308
7308
|
}
|
|
7309
|
-
|
|
7309
|
+
m.current = !0, l(!0), p(null);
|
|
7310
7310
|
try {
|
|
7311
|
-
const
|
|
7311
|
+
const b = {
|
|
7312
7312
|
applicantId: e,
|
|
7313
7313
|
restart: !1,
|
|
7314
|
-
redirectUrl:
|
|
7315
|
-
ttl:
|
|
7314
|
+
redirectUrl: R || "",
|
|
7315
|
+
ttl: L || 604800
|
|
7316
7316
|
// Default: 7 days
|
|
7317
7317
|
};
|
|
7318
|
-
console.log("Identity request input:",
|
|
7319
|
-
const q = await t.identityRequest(
|
|
7318
|
+
console.log("Identity request input:", b);
|
|
7319
|
+
const q = await t.identityRequest(b);
|
|
7320
7320
|
return console.log("Identity request result:", q), a(q), q;
|
|
7321
|
-
} catch (
|
|
7322
|
-
throw p(
|
|
7321
|
+
} catch (b) {
|
|
7322
|
+
throw p(b), b;
|
|
7323
7323
|
} finally {
|
|
7324
|
-
l(!1),
|
|
7324
|
+
l(!1), m.current = !1;
|
|
7325
7325
|
}
|
|
7326
7326
|
}
|
|
7327
7327
|
},
|
|
7328
7328
|
[e, t]
|
|
7329
7329
|
), y = te(
|
|
7330
|
-
async (
|
|
7330
|
+
async (R, L) => {
|
|
7331
7331
|
if (e) {
|
|
7332
7332
|
l(!0), p(null);
|
|
7333
7333
|
try {
|
|
7334
|
-
const
|
|
7334
|
+
const b = {
|
|
7335
7335
|
applicantId: e,
|
|
7336
7336
|
restart: !1,
|
|
7337
|
-
redirectUrl:
|
|
7338
|
-
ttl:
|
|
7339
|
-
}, q = await t.identityCompanyRequest(
|
|
7337
|
+
redirectUrl: R,
|
|
7338
|
+
ttl: L
|
|
7339
|
+
}, q = await t.identityCompanyRequest(b);
|
|
7340
7340
|
return a(q), q;
|
|
7341
|
-
} catch (
|
|
7342
|
-
throw p(
|
|
7341
|
+
} catch (b) {
|
|
7342
|
+
throw p(b), b;
|
|
7343
7343
|
} finally {
|
|
7344
7344
|
l(!1);
|
|
7345
7345
|
}
|
|
7346
7346
|
}
|
|
7347
7347
|
},
|
|
7348
7348
|
[e, t]
|
|
7349
|
-
),
|
|
7349
|
+
), h = te(async () => {
|
|
7350
7350
|
if (e) {
|
|
7351
|
-
if (
|
|
7351
|
+
if (m.current) {
|
|
7352
7352
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
7353
7353
|
return;
|
|
7354
7354
|
}
|
|
7355
|
-
|
|
7355
|
+
m.current = !0, l(!0), p(null);
|
|
7356
7356
|
try {
|
|
7357
|
-
const
|
|
7357
|
+
const R = {
|
|
7358
7358
|
applicantId: e,
|
|
7359
7359
|
restart: !0,
|
|
7360
7360
|
redirectUrl: "",
|
|
7361
7361
|
ttl: 604800
|
|
7362
7362
|
// 7 days
|
|
7363
7363
|
};
|
|
7364
|
-
console.log("Restarting identity with input:",
|
|
7365
|
-
const
|
|
7366
|
-
return console.log("Restart identity result:",
|
|
7367
|
-
} catch (
|
|
7368
|
-
throw p(
|
|
7364
|
+
console.log("Restarting identity with input:", R);
|
|
7365
|
+
const L = await t.identityRequest(R);
|
|
7366
|
+
return console.log("Restart identity result:", L), a(L), L;
|
|
7367
|
+
} catch (R) {
|
|
7368
|
+
throw p(R), R;
|
|
7369
7369
|
} finally {
|
|
7370
|
-
l(!1),
|
|
7370
|
+
l(!1), m.current = !1;
|
|
7371
7371
|
}
|
|
7372
7372
|
}
|
|
7373
7373
|
}, [e, t]);
|
|
@@ -7379,18 +7379,18 @@ function Pi(e) {
|
|
|
7379
7379
|
error: s,
|
|
7380
7380
|
requestIdentity: d,
|
|
7381
7381
|
requestCompanyIdentity: y,
|
|
7382
|
-
restartIdentity:
|
|
7382
|
+
restartIdentity: h
|
|
7383
7383
|
};
|
|
7384
7384
|
}
|
|
7385
7385
|
function Di(e) {
|
|
7386
|
-
const { riskScoringService: t, applicantService: i } = Oe(), [a, n] =
|
|
7386
|
+
const { riskScoringService: t, applicantService: i } = Oe(), [a, n] = v(null), [l, s] = v({}), [p, m] = v(!1), [d, y] = v(!1), [h, R] = v(null), [L, b] = v(null), q = de(!1), S = de(null), P = te(async () => {
|
|
7387
7387
|
var F;
|
|
7388
7388
|
if (e) {
|
|
7389
7389
|
if (q.current) {
|
|
7390
7390
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
7391
7391
|
return;
|
|
7392
7392
|
}
|
|
7393
|
-
q.current = !0,
|
|
7393
|
+
q.current = !0, m(!0), R(null);
|
|
7394
7394
|
try {
|
|
7395
7395
|
const [U, K] = await Promise.all([
|
|
7396
7396
|
t.getRiskCriterias(e),
|
|
@@ -7398,34 +7398,34 @@ function Di(e) {
|
|
|
7398
7398
|
]);
|
|
7399
7399
|
if (n(U), (F = K == null ? void 0 : K.riskScoringResults) != null && F.length) {
|
|
7400
7400
|
const J = K.riskScoringResults[0], ae = {};
|
|
7401
|
-
for (const
|
|
7402
|
-
if (
|
|
7403
|
-
const
|
|
7404
|
-
|
|
7401
|
+
for (const x of J.riskCriteriaResults ?? [])
|
|
7402
|
+
if (x.riskCriteriaId != null && x.answer != null && x.answer !== "") {
|
|
7403
|
+
const z = [...new Set(
|
|
7404
|
+
x.answer.split(",").map((V) => V.trim()).filter((V) => V !== "")
|
|
7405
7405
|
)];
|
|
7406
|
-
|
|
7406
|
+
z.length > 0 && (ae[x.riskCriteriaId] = z);
|
|
7407
7407
|
}
|
|
7408
7408
|
s(ae);
|
|
7409
7409
|
}
|
|
7410
7410
|
S.current = e;
|
|
7411
7411
|
} catch (U) {
|
|
7412
|
-
|
|
7412
|
+
R(U);
|
|
7413
7413
|
} finally {
|
|
7414
|
-
|
|
7414
|
+
m(!1), q.current = !1;
|
|
7415
7415
|
}
|
|
7416
7416
|
}
|
|
7417
7417
|
}, [e, t, i]);
|
|
7418
7418
|
fe(() => {
|
|
7419
|
-
e && S.current !== e &&
|
|
7419
|
+
e && S.current !== e && P();
|
|
7420
7420
|
}, [e]);
|
|
7421
7421
|
const B = te(
|
|
7422
7422
|
async (F) => {
|
|
7423
|
-
y(!0),
|
|
7423
|
+
y(!0), R(null);
|
|
7424
7424
|
try {
|
|
7425
7425
|
const U = await t.submitRiskScoring(F);
|
|
7426
|
-
return
|
|
7426
|
+
return b(U), U;
|
|
7427
7427
|
} catch (U) {
|
|
7428
|
-
throw
|
|
7428
|
+
throw R(U), U;
|
|
7429
7429
|
} finally {
|
|
7430
7430
|
y(!1);
|
|
7431
7431
|
}
|
|
@@ -7435,33 +7435,33 @@ function Di(e) {
|
|
|
7435
7435
|
return {
|
|
7436
7436
|
criteria: a,
|
|
7437
7437
|
initialAnswers: l,
|
|
7438
|
-
result:
|
|
7438
|
+
result: L,
|
|
7439
7439
|
isLoading: p,
|
|
7440
7440
|
isSubmitting: d,
|
|
7441
|
-
error:
|
|
7442
|
-
load:
|
|
7441
|
+
error: h,
|
|
7442
|
+
load: P,
|
|
7443
7443
|
submit: B
|
|
7444
7444
|
};
|
|
7445
7445
|
}
|
|
7446
7446
|
function tr() {
|
|
7447
|
-
const { applicantService: e, config: t } = Oe(), [i, a] =
|
|
7448
|
-
const
|
|
7449
|
-
return (
|
|
7447
|
+
const { applicantService: e, config: t } = Oe(), [i, a] = v(!1), [n, l] = v(null), s = de(!1), p = de(!1), m = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(L) {
|
|
7448
|
+
const b = Math.random() * 16 | 0;
|
|
7449
|
+
return (L === "x" ? b : b & 3 | 8).toString(16);
|
|
7450
7450
|
}), d = te(
|
|
7451
|
-
async (
|
|
7452
|
-
var
|
|
7451
|
+
async (L) => {
|
|
7452
|
+
var b;
|
|
7453
7453
|
if (s.current)
|
|
7454
7454
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
7455
7455
|
s.current = !0, a(!0), l(null);
|
|
7456
7456
|
try {
|
|
7457
|
-
if (
|
|
7458
|
-
const S =
|
|
7459
|
-
console.log("[SardinAI] Generated session key:", S),
|
|
7457
|
+
if (L.applicantAdditionalDatas || (L.applicantAdditionalDatas = []), (b = t.identityProviders) != null && b.sardinai) {
|
|
7458
|
+
const S = m();
|
|
7459
|
+
console.log("[SardinAI] Generated session key:", S), L.applicantAdditionalDatas.push({
|
|
7460
7460
|
paramName: "sessionKey",
|
|
7461
7461
|
value: S
|
|
7462
7462
|
});
|
|
7463
7463
|
}
|
|
7464
|
-
return await e.createApplicant(
|
|
7464
|
+
return await e.createApplicant(L);
|
|
7465
7465
|
} catch (q) {
|
|
7466
7466
|
throw l(q), q;
|
|
7467
7467
|
} finally {
|
|
@@ -7470,38 +7470,38 @@ function tr() {
|
|
|
7470
7470
|
},
|
|
7471
7471
|
[e, t]
|
|
7472
7472
|
), y = te(
|
|
7473
|
-
async (
|
|
7473
|
+
async (L) => {
|
|
7474
7474
|
a(!0), l(null);
|
|
7475
7475
|
try {
|
|
7476
|
-
return await e.createCompanyApplicant(
|
|
7477
|
-
} catch (
|
|
7478
|
-
throw l(
|
|
7476
|
+
return await e.createCompanyApplicant(L);
|
|
7477
|
+
} catch (b) {
|
|
7478
|
+
throw l(b), b;
|
|
7479
7479
|
} finally {
|
|
7480
7480
|
a(!1);
|
|
7481
7481
|
}
|
|
7482
7482
|
},
|
|
7483
7483
|
[e]
|
|
7484
|
-
),
|
|
7485
|
-
async (
|
|
7484
|
+
), h = te(
|
|
7485
|
+
async (L) => {
|
|
7486
7486
|
if (p.current)
|
|
7487
7487
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
7488
7488
|
p.current = !0, a(!0), l(null);
|
|
7489
7489
|
try {
|
|
7490
|
-
return await e.getApplicantData(
|
|
7491
|
-
} catch (
|
|
7492
|
-
throw l(
|
|
7490
|
+
return await e.getApplicantData(L);
|
|
7491
|
+
} catch (b) {
|
|
7492
|
+
throw l(b), b;
|
|
7493
7493
|
} finally {
|
|
7494
7494
|
a(!1), p.current = !1;
|
|
7495
7495
|
}
|
|
7496
7496
|
},
|
|
7497
7497
|
[e]
|
|
7498
|
-
),
|
|
7499
|
-
async (
|
|
7498
|
+
), R = te(
|
|
7499
|
+
async (L) => {
|
|
7500
7500
|
a(!0), l(null);
|
|
7501
7501
|
try {
|
|
7502
|
-
await e.stopProgress(
|
|
7503
|
-
} catch (
|
|
7504
|
-
throw l(
|
|
7502
|
+
await e.stopProgress(L);
|
|
7503
|
+
} catch (b) {
|
|
7504
|
+
throw l(b), b;
|
|
7505
7505
|
} finally {
|
|
7506
7506
|
a(!1);
|
|
7507
7507
|
}
|
|
@@ -7513,8 +7513,8 @@ function tr() {
|
|
|
7513
7513
|
error: n,
|
|
7514
7514
|
createApplicant: d,
|
|
7515
7515
|
createCompanyApplicant: y,
|
|
7516
|
-
getApplicantData:
|
|
7517
|
-
stopProgress:
|
|
7516
|
+
getApplicantData: h,
|
|
7517
|
+
stopProgress: R
|
|
7518
7518
|
};
|
|
7519
7519
|
}
|
|
7520
7520
|
const ji = {
|
|
@@ -7553,7 +7553,7 @@ const ji = {
|
|
|
7553
7553
|
style: s,
|
|
7554
7554
|
...p
|
|
7555
7555
|
}) => {
|
|
7556
|
-
const
|
|
7556
|
+
const m = "inline-flex items-center justify-center rounded-lg font-medium transition-opacity border focus:outline-none focus:ring-2 focus:ring-offset-1 disabled:opacity-50 disabled:cursor-not-allowed", d = {
|
|
7557
7557
|
sm: "px-3 py-1.5 text-sm",
|
|
7558
7558
|
md: "px-4 py-2 text-sm",
|
|
7559
7559
|
lg: "px-6 py-3 text-base"
|
|
@@ -7565,7 +7565,7 @@ const ji = {
|
|
|
7565
7565
|
return /* @__PURE__ */ o(
|
|
7566
7566
|
"button",
|
|
7567
7567
|
{
|
|
7568
|
-
className: je(
|
|
7568
|
+
className: je(m, d[i], l),
|
|
7569
7569
|
style: {
|
|
7570
7570
|
display: "inline-flex",
|
|
7571
7571
|
alignItems: "center",
|
|
@@ -7619,7 +7619,7 @@ const ji = {
|
|
|
7619
7619
|
}
|
|
7620
7620
|
);
|
|
7621
7621
|
}, Se = kt(
|
|
7622
|
-
({ label: e, error: t, helperText: i, leftIcon: a, rightIcon: n, className: l, style: s, ...p },
|
|
7622
|
+
({ label: e, error: t, helperText: i, leftIcon: a, rightIcon: n, className: l, style: s, ...p }, m) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
7623
7623
|
e && /* @__PURE__ */ o(
|
|
7624
7624
|
"label",
|
|
7625
7625
|
{
|
|
@@ -7636,7 +7636,7 @@ const ji = {
|
|
|
7636
7636
|
/* @__PURE__ */ r(
|
|
7637
7637
|
"input",
|
|
7638
7638
|
{
|
|
7639
|
-
ref:
|
|
7639
|
+
ref: m,
|
|
7640
7640
|
className: je(
|
|
7641
7641
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
7642
7642
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
@@ -7850,7 +7850,7 @@ const re = ({ children: e, className: t, style: i, ...a }) => /* @__PURE__ */ r(
|
|
|
7850
7850
|
}
|
|
7851
7851
|
) });
|
|
7852
7852
|
}, At = kt(
|
|
7853
|
-
({ label: e, error: t, helperText: i, options: a, placeholder: n, className: l, style: s, ...p },
|
|
7853
|
+
({ label: e, error: t, helperText: i, options: a, placeholder: n, className: l, style: s, ...p }, m) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
7854
7854
|
e && /* @__PURE__ */ o(
|
|
7855
7855
|
"label",
|
|
7856
7856
|
{
|
|
@@ -7865,7 +7865,7 @@ const re = ({ children: e, className: t, style: i, ...a }) => /* @__PURE__ */ r(
|
|
|
7865
7865
|
/* @__PURE__ */ o(
|
|
7866
7866
|
"select",
|
|
7867
7867
|
{
|
|
7868
|
-
ref:
|
|
7868
|
+
ref: m,
|
|
7869
7869
|
className: je(
|
|
7870
7870
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
7871
7871
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
@@ -7926,7 +7926,7 @@ const qt = 280, Oi = ({
|
|
|
7926
7926
|
readOnly: s = !1,
|
|
7927
7927
|
required: p = !1
|
|
7928
7928
|
}) => {
|
|
7929
|
-
const { t:
|
|
7929
|
+
const { t: m } = Re(), d = n ?? m("common.select"), y = l || s, [h, R] = v(!1), [L, b] = v(""), [q, S] = v(null), [P, B] = v({
|
|
7930
7930
|
bg: "#ffffff",
|
|
7931
7931
|
borderColor: "#d1d5db",
|
|
7932
7932
|
textPrimary: "#111827",
|
|
@@ -7936,55 +7936,55 @@ const qt = 280, Oi = ({
|
|
|
7936
7936
|
hoverBg: "#f9fafb"
|
|
7937
7937
|
}), F = de(null), U = de(null), K = de(null), J = te(() => {
|
|
7938
7938
|
if (!U.current) return null;
|
|
7939
|
-
const
|
|
7940
|
-
return { top: O ?
|
|
7939
|
+
const D = U.current.getBoundingClientRect(), O = window.innerHeight - D.bottom < qt && D.top > qt;
|
|
7940
|
+
return { top: O ? D.top : D.bottom + 4, left: D.left, width: D.width, openUp: O };
|
|
7941
7941
|
}, []), ae = te(() => {
|
|
7942
|
-
const
|
|
7942
|
+
const D = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), E = (ke, se) => D.getPropertyValue(ke).trim() || se, O = E("--metakyc-input-bg", E("--metakyc-background", "#ffffff"));
|
|
7943
7943
|
B({
|
|
7944
7944
|
bg: O,
|
|
7945
|
-
borderColor:
|
|
7946
|
-
textPrimary:
|
|
7947
|
-
textSecondary:
|
|
7948
|
-
primaryColor:
|
|
7949
|
-
primaryLight:
|
|
7950
|
-
hoverBg:
|
|
7945
|
+
borderColor: E("--metakyc-input-border", E("--metakyc-border", "#d1d5db")),
|
|
7946
|
+
textPrimary: E("--metakyc-input-text", E("--metakyc-text-primary", "#111827")),
|
|
7947
|
+
textSecondary: E("--metakyc-text-secondary", "#6b7280"),
|
|
7948
|
+
primaryColor: E("--metakyc-primary", "#2563eb"),
|
|
7949
|
+
primaryLight: E("--metakyc-primary-light", "#eff6ff"),
|
|
7950
|
+
hoverBg: E("--metakyc-surface", O)
|
|
7951
7951
|
});
|
|
7952
|
-
}, []),
|
|
7952
|
+
}, []), x = te(() => {
|
|
7953
7953
|
if (y) return;
|
|
7954
7954
|
ae();
|
|
7955
|
-
const
|
|
7956
|
-
|
|
7957
|
-
}, [y, J, ae]),
|
|
7958
|
-
|
|
7955
|
+
const D = J();
|
|
7956
|
+
D && S(D), R(!0);
|
|
7957
|
+
}, [y, J, ae]), z = te(() => {
|
|
7958
|
+
R(!1), b("");
|
|
7959
7959
|
}, []);
|
|
7960
7960
|
fe(() => {
|
|
7961
|
-
if (!
|
|
7962
|
-
const
|
|
7961
|
+
if (!h) return;
|
|
7962
|
+
const D = (E) => {
|
|
7963
7963
|
var ke, se;
|
|
7964
|
-
const O =
|
|
7965
|
-
!((ke = F.current) != null && ke.contains(O)) && !((se = K.current) != null && se.contains(O)) &&
|
|
7964
|
+
const O = E.target;
|
|
7965
|
+
!((ke = F.current) != null && ke.contains(O)) && !((se = K.current) != null && se.contains(O)) && z();
|
|
7966
7966
|
};
|
|
7967
|
-
return document.addEventListener("mousedown",
|
|
7968
|
-
}, [
|
|
7969
|
-
if (!
|
|
7970
|
-
const
|
|
7971
|
-
const
|
|
7972
|
-
|
|
7967
|
+
return document.addEventListener("mousedown", D), () => document.removeEventListener("mousedown", D);
|
|
7968
|
+
}, [h, z]), fe(() => {
|
|
7969
|
+
if (!h) return;
|
|
7970
|
+
const D = () => {
|
|
7971
|
+
const E = J();
|
|
7972
|
+
E && S(E);
|
|
7973
7973
|
};
|
|
7974
|
-
return window.addEventListener("scroll",
|
|
7975
|
-
window.removeEventListener("scroll",
|
|
7974
|
+
return window.addEventListener("scroll", D, !0), window.addEventListener("resize", D), () => {
|
|
7975
|
+
window.removeEventListener("scroll", D, !0), window.removeEventListener("resize", D);
|
|
7976
7976
|
};
|
|
7977
|
-
}, [
|
|
7977
|
+
}, [h, J]);
|
|
7978
7978
|
const V = a.filter(
|
|
7979
|
-
(
|
|
7980
|
-
), Q = (
|
|
7981
|
-
y || i(t.includes(
|
|
7982
|
-
}, X = (
|
|
7983
|
-
|
|
7984
|
-
}, W = (
|
|
7985
|
-
var
|
|
7986
|
-
return ((
|
|
7987
|
-
}, { bg: _, borderColor: oe, textPrimary: H, textSecondary: Me, primaryColor: pe, primaryLight: ge, hoverBg: xe } =
|
|
7979
|
+
(D) => D.label.toLowerCase().includes(L.toLowerCase())
|
|
7980
|
+
), Q = (D) => {
|
|
7981
|
+
y || i(t.includes(D) ? t.filter((E) => E !== D) : [...t, D]);
|
|
7982
|
+
}, X = (D, E) => {
|
|
7983
|
+
E.stopPropagation(), y || i(t.filter((O) => O !== D));
|
|
7984
|
+
}, W = (D) => {
|
|
7985
|
+
var E;
|
|
7986
|
+
return ((E = a.find((O) => O.value === D)) == null ? void 0 : E.label) || D;
|
|
7987
|
+
}, { bg: _, borderColor: oe, textPrimary: H, textSecondary: Me, primaryColor: pe, primaryLight: ge, hoverBg: xe } = P, me = h && q && /* @__PURE__ */ o(
|
|
7988
7988
|
"div",
|
|
7989
7989
|
{
|
|
7990
7990
|
ref: K,
|
|
@@ -8007,11 +8007,11 @@ const qt = 280, Oi = ({
|
|
|
8007
8007
|
"input",
|
|
8008
8008
|
{
|
|
8009
8009
|
type: "text",
|
|
8010
|
-
value:
|
|
8011
|
-
onChange: (
|
|
8012
|
-
placeholder:
|
|
8010
|
+
value: L,
|
|
8011
|
+
onChange: (D) => b(D.target.value),
|
|
8012
|
+
placeholder: m("common.search"),
|
|
8013
8013
|
autoFocus: !0,
|
|
8014
|
-
onClick: (
|
|
8014
|
+
onClick: (D) => D.stopPropagation(),
|
|
8015
8015
|
className: "metakyc-multiselect-search w-full",
|
|
8016
8016
|
style: {
|
|
8017
8017
|
display: "block",
|
|
@@ -8025,21 +8025,21 @@ const qt = 280, Oi = ({
|
|
|
8025
8025
|
outline: "none",
|
|
8026
8026
|
boxSizing: "border-box"
|
|
8027
8027
|
},
|
|
8028
|
-
onFocus: (
|
|
8029
|
-
const
|
|
8030
|
-
|
|
8028
|
+
onFocus: (D) => {
|
|
8029
|
+
const E = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), O = E.getPropertyValue("--metakyc-input-border-focus").trim() || E.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8030
|
+
D.currentTarget.style.backgroundColor = _, D.currentTarget.style.color = H, D.currentTarget.style.borderColor = O, D.currentTarget.style.outline = "none", D.currentTarget.style.boxShadow = `0 0 0 2px ${O}33`;
|
|
8031
8031
|
},
|
|
8032
|
-
onBlur: (
|
|
8033
|
-
|
|
8032
|
+
onBlur: (D) => {
|
|
8033
|
+
D.currentTarget.style.backgroundColor = _, D.currentTarget.style.color = H, D.currentTarget.style.borderColor = oe, D.currentTarget.style.outline = "none", D.currentTarget.style.boxShadow = "none";
|
|
8034
8034
|
}
|
|
8035
8035
|
}
|
|
8036
8036
|
) }),
|
|
8037
|
-
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: V.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Me }, children:
|
|
8038
|
-
const
|
|
8037
|
+
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: V.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Me }, children: m("common.noResults") }) : V.map((D) => {
|
|
8038
|
+
const E = t.includes(D.value);
|
|
8039
8039
|
return /* @__PURE__ */ o(
|
|
8040
8040
|
"li",
|
|
8041
8041
|
{
|
|
8042
|
-
onClick: () => Q(
|
|
8042
|
+
onClick: () => Q(D.value),
|
|
8043
8043
|
className: "metakyc-multiselect-option",
|
|
8044
8044
|
style: {
|
|
8045
8045
|
display: "flex",
|
|
@@ -8048,29 +8048,29 @@ const qt = 280, Oi = ({
|
|
|
8048
8048
|
padding: "8px 12px",
|
|
8049
8049
|
fontSize: "13px",
|
|
8050
8050
|
cursor: "pointer",
|
|
8051
|
-
backgroundColor:
|
|
8052
|
-
color:
|
|
8051
|
+
backgroundColor: E ? ge : "transparent",
|
|
8052
|
+
color: E ? pe : H,
|
|
8053
8053
|
userSelect: "none"
|
|
8054
8054
|
},
|
|
8055
8055
|
onMouseEnter: (O) => {
|
|
8056
|
-
|
|
8056
|
+
E || (O.currentTarget.style.backgroundColor = xe);
|
|
8057
8057
|
},
|
|
8058
8058
|
onMouseLeave: (O) => {
|
|
8059
|
-
|
|
8059
|
+
E || (O.currentTarget.style.backgroundColor = "transparent");
|
|
8060
8060
|
},
|
|
8061
8061
|
children: [
|
|
8062
8062
|
/* @__PURE__ */ r(
|
|
8063
8063
|
Ue,
|
|
8064
8064
|
{
|
|
8065
|
-
checked:
|
|
8065
|
+
checked: E,
|
|
8066
8066
|
onChange: () => {
|
|
8067
8067
|
}
|
|
8068
8068
|
}
|
|
8069
8069
|
),
|
|
8070
|
-
/* @__PURE__ */ r("span", { children:
|
|
8070
|
+
/* @__PURE__ */ r("span", { children: D.label })
|
|
8071
8071
|
]
|
|
8072
8072
|
},
|
|
8073
|
-
|
|
8073
|
+
D.value
|
|
8074
8074
|
);
|
|
8075
8075
|
}) }),
|
|
8076
8076
|
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${oe}` }, children: /* @__PURE__ */ o(
|
|
@@ -8078,11 +8078,11 @@ const qt = 280, Oi = ({
|
|
|
8078
8078
|
{
|
|
8079
8079
|
type: "button",
|
|
8080
8080
|
onClick: () => {
|
|
8081
|
-
i([]),
|
|
8081
|
+
i([]), b("");
|
|
8082
8082
|
},
|
|
8083
8083
|
style: { fontSize: "12px", color: "#ef4444", background: "none", border: "none", cursor: "pointer", padding: 0 },
|
|
8084
8084
|
children: [
|
|
8085
|
-
|
|
8085
|
+
m("common.clearAll"),
|
|
8086
8086
|
" (",
|
|
8087
8087
|
t.length,
|
|
8088
8088
|
")"
|
|
@@ -8108,7 +8108,7 @@ const qt = 280, Oi = ({
|
|
|
8108
8108
|
"div",
|
|
8109
8109
|
{
|
|
8110
8110
|
ref: U,
|
|
8111
|
-
onClick: () =>
|
|
8111
|
+
onClick: () => h ? z() : x(),
|
|
8112
8112
|
className: je(
|
|
8113
8113
|
"metakyc-multiselect-trigger",
|
|
8114
8114
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
@@ -8117,8 +8117,8 @@ const qt = 280, Oi = ({
|
|
|
8117
8117
|
style: {
|
|
8118
8118
|
minHeight: "38px",
|
|
8119
8119
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
8120
|
-
borderColor:
|
|
8121
|
-
outline:
|
|
8120
|
+
borderColor: h ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
8121
|
+
outline: h ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
8122
8122
|
outlineOffset: "-1px"
|
|
8123
8123
|
},
|
|
8124
8124
|
children: [
|
|
@@ -8129,7 +8129,7 @@ const qt = 280, Oi = ({
|
|
|
8129
8129
|
style: { color: "var(--metakyc-text-secondary, #9ca3af)" },
|
|
8130
8130
|
children: d
|
|
8131
8131
|
}
|
|
8132
|
-
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((
|
|
8132
|
+
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((D) => /* @__PURE__ */ o(
|
|
8133
8133
|
"span",
|
|
8134
8134
|
{
|
|
8135
8135
|
className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium",
|
|
@@ -8138,12 +8138,12 @@ const qt = 280, Oi = ({
|
|
|
8138
8138
|
color: "var(--metakyc-primary, #2563eb)"
|
|
8139
8139
|
},
|
|
8140
8140
|
children: [
|
|
8141
|
-
W(
|
|
8141
|
+
W(D),
|
|
8142
8142
|
!y && /* @__PURE__ */ r(
|
|
8143
8143
|
"button",
|
|
8144
8144
|
{
|
|
8145
8145
|
type: "button",
|
|
8146
|
-
onClick: (
|
|
8146
|
+
onClick: (E) => X(D, E),
|
|
8147
8147
|
className: "metakyc-multiselect-chip-remove",
|
|
8148
8148
|
style: {
|
|
8149
8149
|
background: "transparent",
|
|
@@ -8169,14 +8169,14 @@ const qt = 280, Oi = ({
|
|
|
8169
8169
|
)
|
|
8170
8170
|
]
|
|
8171
8171
|
},
|
|
8172
|
-
|
|
8172
|
+
D
|
|
8173
8173
|
)) }),
|
|
8174
8174
|
/* @__PURE__ */ r(
|
|
8175
8175
|
"span",
|
|
8176
8176
|
{
|
|
8177
8177
|
className: "metakyc-multiselect-arrow absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-xs",
|
|
8178
8178
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
8179
|
-
children:
|
|
8179
|
+
children: h ? "▲" : "▼"
|
|
8180
8180
|
}
|
|
8181
8181
|
)
|
|
8182
8182
|
]
|
|
@@ -8193,12 +8193,12 @@ const qt = 280, Oi = ({
|
|
|
8193
8193
|
value: l,
|
|
8194
8194
|
onChange: s,
|
|
8195
8195
|
disabled: p = !1,
|
|
8196
|
-
readOnly:
|
|
8196
|
+
readOnly: m = !1,
|
|
8197
8197
|
required: d = !1,
|
|
8198
8198
|
className: y
|
|
8199
8199
|
}) => {
|
|
8200
8200
|
var se;
|
|
8201
|
-
const { t:
|
|
8201
|
+
const { t: h } = Re(), R = n ?? h("common.select"), L = p || m, [b, q] = v(!1), [S, P] = v(""), [B, F] = v(null), [U, K] = v({
|
|
8202
8202
|
bg: "#ffffff",
|
|
8203
8203
|
border: "#d1d5db",
|
|
8204
8204
|
text: "#111827",
|
|
@@ -8207,7 +8207,7 @@ const qt = 280, Oi = ({
|
|
|
8207
8207
|
primaryLight: "#eff6ff",
|
|
8208
8208
|
hoverBg: "#f9fafb"
|
|
8209
8209
|
}), J = te(() => {
|
|
8210
|
-
const
|
|
8210
|
+
const j = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), ne = (Ie, Ae) => j.getPropertyValue(Ie).trim() || Ae, Z = ne("--metakyc-input-bg", ne("--metakyc-background", "#ffffff"));
|
|
8211
8211
|
K({
|
|
8212
8212
|
bg: Z,
|
|
8213
8213
|
border: ne("--metakyc-input-border", ne("--metakyc-border", "#d1d5db")),
|
|
@@ -8217,54 +8217,54 @@ const qt = 280, Oi = ({
|
|
|
8217
8217
|
primaryLight: ne("--metakyc-primary-light", "#eff6ff"),
|
|
8218
8218
|
hoverBg: ne("--metakyc-surface", Z)
|
|
8219
8219
|
});
|
|
8220
|
-
}, []), ae = de(null),
|
|
8221
|
-
if (!
|
|
8222
|
-
const
|
|
8220
|
+
}, []), ae = de(null), x = de(null), z = de(null), V = de(null), Q = te(() => {
|
|
8221
|
+
if (!x.current) return null;
|
|
8222
|
+
const j = x.current.getBoundingClientRect(), Z = window.innerHeight - j.bottom < Ut && j.top > Ut;
|
|
8223
8223
|
return {
|
|
8224
|
-
top: Z ?
|
|
8225
|
-
left:
|
|
8226
|
-
width:
|
|
8224
|
+
top: Z ? j.top : j.bottom + 4,
|
|
8225
|
+
left: j.left,
|
|
8226
|
+
width: j.width,
|
|
8227
8227
|
openUp: Z
|
|
8228
8228
|
};
|
|
8229
8229
|
}, []), X = te(() => {
|
|
8230
|
-
if (
|
|
8230
|
+
if (L) return;
|
|
8231
8231
|
J();
|
|
8232
|
-
const
|
|
8233
|
-
|
|
8234
|
-
}, [
|
|
8235
|
-
q(!1),
|
|
8236
|
-
}, []), _ = () =>
|
|
8232
|
+
const j = Q();
|
|
8233
|
+
j && F(j), q(!0);
|
|
8234
|
+
}, [L, Q, J]), W = te(() => {
|
|
8235
|
+
q(!1), P("");
|
|
8236
|
+
}, []), _ = () => b ? W() : X();
|
|
8237
8237
|
fe(() => {
|
|
8238
|
-
if (!
|
|
8239
|
-
const
|
|
8238
|
+
if (!b) return;
|
|
8239
|
+
const j = (ne) => {
|
|
8240
8240
|
var Ie, Ae;
|
|
8241
8241
|
const Z = ne.target;
|
|
8242
|
-
!((Ie = ae.current) != null && Ie.contains(Z)) && !((Ae =
|
|
8242
|
+
!((Ie = ae.current) != null && Ie.contains(Z)) && !((Ae = z.current) != null && Ae.contains(Z)) && W();
|
|
8243
8243
|
};
|
|
8244
|
-
return document.addEventListener("mousedown",
|
|
8245
|
-
}, [
|
|
8246
|
-
if (!
|
|
8247
|
-
const
|
|
8244
|
+
return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
|
|
8245
|
+
}, [b, W]), fe(() => {
|
|
8246
|
+
if (!b) return;
|
|
8247
|
+
const j = () => {
|
|
8248
8248
|
const ne = Q();
|
|
8249
8249
|
ne && F(ne);
|
|
8250
8250
|
};
|
|
8251
|
-
return window.addEventListener("scroll",
|
|
8252
|
-
window.removeEventListener("scroll",
|
|
8251
|
+
return window.addEventListener("scroll", j, !0), window.addEventListener("resize", j), () => {
|
|
8252
|
+
window.removeEventListener("scroll", j, !0), window.removeEventListener("resize", j);
|
|
8253
8253
|
};
|
|
8254
|
-
}, [
|
|
8255
|
-
|
|
8256
|
-
var
|
|
8257
|
-
return (
|
|
8254
|
+
}, [b, Q]), fe(() => {
|
|
8255
|
+
b && V.current && setTimeout(() => {
|
|
8256
|
+
var j;
|
|
8257
|
+
return (j = V.current) == null ? void 0 : j.focus();
|
|
8258
8258
|
}, 0);
|
|
8259
|
-
}, [
|
|
8259
|
+
}, [b]);
|
|
8260
8260
|
const oe = a.filter(
|
|
8261
|
-
(
|
|
8262
|
-
), H = (se = a.find((
|
|
8263
|
-
|
|
8264
|
-
}, { bg: pe, border: ge, text: xe, textSecondary: me, primary:
|
|
8261
|
+
(j) => j.label.toLowerCase().includes(S.toLowerCase()) || j.value.toLowerCase().includes(S.toLowerCase())
|
|
8262
|
+
), H = (se = a.find((j) => j.value === l)) == null ? void 0 : se.label, Me = (j, ne) => {
|
|
8263
|
+
L || ne || (s(j), W());
|
|
8264
|
+
}, { bg: pe, border: ge, text: xe, textSecondary: me, primary: D, primaryLight: E, hoverBg: O } = U, ke = b && B && /* @__PURE__ */ o(
|
|
8265
8265
|
"div",
|
|
8266
8266
|
{
|
|
8267
|
-
ref:
|
|
8267
|
+
ref: z,
|
|
8268
8268
|
className: "metakyc-searchable-select-dropdown",
|
|
8269
8269
|
style: {
|
|
8270
8270
|
position: "fixed",
|
|
@@ -8286,9 +8286,9 @@ const qt = 280, Oi = ({
|
|
|
8286
8286
|
ref: V,
|
|
8287
8287
|
type: "text",
|
|
8288
8288
|
value: S,
|
|
8289
|
-
onChange: (
|
|
8290
|
-
placeholder:
|
|
8291
|
-
onClick: (
|
|
8289
|
+
onChange: (j) => P(j.target.value),
|
|
8290
|
+
placeholder: h("common.search"),
|
|
8291
|
+
onClick: (j) => j.stopPropagation(),
|
|
8292
8292
|
className: "metakyc-searchable-select-search w-full",
|
|
8293
8293
|
style: {
|
|
8294
8294
|
display: "block",
|
|
@@ -8302,12 +8302,12 @@ const qt = 280, Oi = ({
|
|
|
8302
8302
|
outline: "none",
|
|
8303
8303
|
boxSizing: "border-box"
|
|
8304
8304
|
},
|
|
8305
|
-
onFocus: (
|
|
8305
|
+
onFocus: (j) => {
|
|
8306
8306
|
const ne = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), Z = ne.getPropertyValue("--metakyc-input-border-focus").trim() || ne.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8307
|
-
|
|
8307
|
+
j.currentTarget.style.backgroundColor = pe, j.currentTarget.style.color = xe, j.currentTarget.style.borderColor = Z, j.currentTarget.style.outline = "none", j.currentTarget.style.boxShadow = `0 0 0 2px ${Z}33`;
|
|
8308
8308
|
},
|
|
8309
|
-
onBlur: (
|
|
8310
|
-
|
|
8309
|
+
onBlur: (j) => {
|
|
8310
|
+
j.currentTarget.style.backgroundColor = pe, j.currentTarget.style.color = xe, j.currentTarget.style.borderColor = ge, j.currentTarget.style.outline = "none", j.currentTarget.style.boxShadow = "none";
|
|
8311
8311
|
}
|
|
8312
8312
|
}
|
|
8313
8313
|
) }),
|
|
@@ -8321,31 +8321,31 @@ const qt = 280, Oi = ({
|
|
|
8321
8321
|
maxHeight: "208px",
|
|
8322
8322
|
overflowY: "auto"
|
|
8323
8323
|
},
|
|
8324
|
-
children: oe.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: me }, children:
|
|
8325
|
-
const ne =
|
|
8324
|
+
children: oe.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: me }, children: h("common.noResults") }) : oe.map((j) => {
|
|
8325
|
+
const ne = j.value === l;
|
|
8326
8326
|
return /* @__PURE__ */ r(
|
|
8327
8327
|
"li",
|
|
8328
8328
|
{
|
|
8329
8329
|
className: "metakyc-searchable-select-option",
|
|
8330
|
-
onClick: () => Me(
|
|
8330
|
+
onClick: () => Me(j.value, j.disabled),
|
|
8331
8331
|
style: {
|
|
8332
8332
|
padding: "8px 12px",
|
|
8333
8333
|
fontSize: "13px",
|
|
8334
|
-
cursor:
|
|
8335
|
-
opacity:
|
|
8336
|
-
backgroundColor: ne ?
|
|
8337
|
-
color: ne ?
|
|
8334
|
+
cursor: j.disabled ? "not-allowed" : "pointer",
|
|
8335
|
+
opacity: j.disabled ? 0.4 : 1,
|
|
8336
|
+
backgroundColor: ne ? E : "transparent",
|
|
8337
|
+
color: ne ? D : xe,
|
|
8338
8338
|
userSelect: "none"
|
|
8339
8339
|
},
|
|
8340
8340
|
onMouseEnter: (Z) => {
|
|
8341
|
-
!ne && !
|
|
8341
|
+
!ne && !j.disabled && (Z.currentTarget.style.backgroundColor = O);
|
|
8342
8342
|
},
|
|
8343
8343
|
onMouseLeave: (Z) => {
|
|
8344
8344
|
ne || (Z.currentTarget.style.backgroundColor = "transparent");
|
|
8345
8345
|
},
|
|
8346
|
-
children:
|
|
8346
|
+
children: j.label
|
|
8347
8347
|
},
|
|
8348
|
-
|
|
8348
|
+
j.value
|
|
8349
8349
|
);
|
|
8350
8350
|
})
|
|
8351
8351
|
}
|
|
@@ -8373,36 +8373,36 @@ const qt = 280, Oi = ({
|
|
|
8373
8373
|
/* @__PURE__ */ o(
|
|
8374
8374
|
"div",
|
|
8375
8375
|
{
|
|
8376
|
-
ref:
|
|
8376
|
+
ref: x,
|
|
8377
8377
|
role: "button",
|
|
8378
|
-
tabIndex:
|
|
8378
|
+
tabIndex: L ? -1 : 0,
|
|
8379
8379
|
onClick: _,
|
|
8380
|
-
onKeyDown: (
|
|
8381
|
-
(
|
|
8380
|
+
onKeyDown: (j) => {
|
|
8381
|
+
(j.key === "Enter" || j.key === " ") && (j.preventDefault(), _()), j.key === "Escape" && W();
|
|
8382
8382
|
},
|
|
8383
8383
|
className: je(
|
|
8384
8384
|
"metakyc-searchable-select-trigger",
|
|
8385
8385
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors text-left",
|
|
8386
8386
|
"flex items-center justify-between gap-2",
|
|
8387
8387
|
"focus:outline-none",
|
|
8388
|
-
|
|
8388
|
+
L ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
8389
8389
|
),
|
|
8390
8390
|
style: {
|
|
8391
8391
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
8392
8392
|
color: H ? "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))" : "var(--metakyc-input-placeholder, var(--metakyc-text-muted, #9ca3af))",
|
|
8393
|
-
borderColor: t ? "var(--metakyc-danger, #ef4444)" :
|
|
8393
|
+
borderColor: t ? "var(--metakyc-danger, #ef4444)" : b ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
8394
8394
|
minHeight: "38px",
|
|
8395
|
-
outline:
|
|
8395
|
+
outline: b ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
8396
8396
|
outlineOffset: "-1px"
|
|
8397
8397
|
},
|
|
8398
8398
|
children: [
|
|
8399
|
-
/* @__PURE__ */ r("span", { className: "truncate flex-1", children: H ||
|
|
8399
|
+
/* @__PURE__ */ r("span", { className: "truncate flex-1", children: H || R }),
|
|
8400
8400
|
/* @__PURE__ */ r(
|
|
8401
8401
|
"span",
|
|
8402
8402
|
{
|
|
8403
8403
|
className: "flex-shrink-0 text-xs pointer-events-none",
|
|
8404
8404
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
8405
|
-
children:
|
|
8405
|
+
children: b ? "▲" : "▼"
|
|
8406
8406
|
}
|
|
8407
8407
|
)
|
|
8408
8408
|
]
|
|
@@ -8429,32 +8429,32 @@ const Bi = ({
|
|
|
8429
8429
|
maxSize: l,
|
|
8430
8430
|
required: s,
|
|
8431
8431
|
onChange: p,
|
|
8432
|
-
value:
|
|
8432
|
+
value: m = [],
|
|
8433
8433
|
className: d
|
|
8434
8434
|
}) => {
|
|
8435
|
-
const { t: y } = Re(), [
|
|
8436
|
-
if (!
|
|
8437
|
-
|
|
8438
|
-
const
|
|
8439
|
-
if (l &&
|
|
8440
|
-
|
|
8435
|
+
const { t: y } = Re(), [h, R] = v(!1), [L, b] = v(null), q = de(null), S = te((x) => {
|
|
8436
|
+
if (!x) return;
|
|
8437
|
+
b(null);
|
|
8438
|
+
const z = Array.from(x);
|
|
8439
|
+
if (l && z.filter((Q) => Q.size > l).length > 0) {
|
|
8440
|
+
b(`File exceeds the maximum size of ${St(l)}`);
|
|
8441
8441
|
return;
|
|
8442
8442
|
}
|
|
8443
|
-
p == null || p(n ? [...
|
|
8444
|
-
}, [l, n, p,
|
|
8445
|
-
|
|
8446
|
-
}, []), B = te((
|
|
8447
|
-
|
|
8448
|
-
}, []), F = te((
|
|
8449
|
-
|
|
8443
|
+
p == null || p(n ? [...m, ...z] : [z[0]]);
|
|
8444
|
+
}, [l, n, p, m]), P = te((x) => {
|
|
8445
|
+
x.preventDefault(), x.stopPropagation(), R(!0);
|
|
8446
|
+
}, []), B = te((x) => {
|
|
8447
|
+
x.preventDefault(), x.stopPropagation(), R(!1);
|
|
8448
|
+
}, []), F = te((x) => {
|
|
8449
|
+
x.preventDefault(), x.stopPropagation(), R(!1), S(x.dataTransfer.files);
|
|
8450
8450
|
}, [S]), U = () => {
|
|
8451
|
-
var
|
|
8452
|
-
(
|
|
8453
|
-
}, K = (
|
|
8454
|
-
|
|
8455
|
-
const
|
|
8456
|
-
p == null || p(
|
|
8457
|
-
}, J = i ||
|
|
8451
|
+
var x;
|
|
8452
|
+
(x = q.current) == null || x.click();
|
|
8453
|
+
}, K = (x) => {
|
|
8454
|
+
b(null);
|
|
8455
|
+
const z = m.filter((V, Q) => Q !== x);
|
|
8456
|
+
p == null || p(z);
|
|
8457
|
+
}, J = i || L, ae = m.length > 0;
|
|
8458
8458
|
return /* @__PURE__ */ o("div", { className: je("metakyc-file-upload", d), style: { width: "100%" }, children: [
|
|
8459
8459
|
e && /* @__PURE__ */ o("div", { style: { marginBottom: "8px" }, children: [
|
|
8460
8460
|
/* @__PURE__ */ o(
|
|
@@ -8479,17 +8479,17 @@ const Bi = ({
|
|
|
8479
8479
|
{
|
|
8480
8480
|
className: "metakyc-file-dropzone",
|
|
8481
8481
|
onClick: U,
|
|
8482
|
-
onDragOver:
|
|
8482
|
+
onDragOver: P,
|
|
8483
8483
|
onDragLeave: B,
|
|
8484
8484
|
onDrop: F,
|
|
8485
8485
|
style: {
|
|
8486
|
-
border: `2px dashed ${J ? "var(--metakyc-danger, #ef4444)" :
|
|
8486
|
+
border: `2px dashed ${J ? "var(--metakyc-danger, #ef4444)" : h ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
|
|
8487
8487
|
borderRadius: "12px",
|
|
8488
8488
|
padding: ae ? "20px" : "32px 20px",
|
|
8489
8489
|
textAlign: "center",
|
|
8490
8490
|
cursor: "pointer",
|
|
8491
8491
|
transition: "all 0.2s ease",
|
|
8492
|
-
backgroundColor:
|
|
8492
|
+
backgroundColor: h ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 5%, var(--metakyc-background, #ffffff))" : "var(--metakyc-background, #ffffff)"
|
|
8493
8493
|
},
|
|
8494
8494
|
children: [
|
|
8495
8495
|
/* @__PURE__ */ r(
|
|
@@ -8500,8 +8500,8 @@ const Bi = ({
|
|
|
8500
8500
|
style: { display: "none" },
|
|
8501
8501
|
accept: a,
|
|
8502
8502
|
multiple: n,
|
|
8503
|
-
onChange: (
|
|
8504
|
-
S(
|
|
8503
|
+
onChange: (x) => {
|
|
8504
|
+
S(x.target.files), x.target.value = "";
|
|
8505
8505
|
}
|
|
8506
8506
|
}
|
|
8507
8507
|
),
|
|
@@ -8516,7 +8516,7 @@ const Bi = ({
|
|
|
8516
8516
|
display: "flex",
|
|
8517
8517
|
alignItems: "center",
|
|
8518
8518
|
justifyContent: "center",
|
|
8519
|
-
backgroundColor:
|
|
8519
|
+
backgroundColor: h ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "var(--metakyc-surface, #f9fafb)",
|
|
8520
8520
|
transition: "background-color 0.2s ease"
|
|
8521
8521
|
},
|
|
8522
8522
|
children: /* @__PURE__ */ o(
|
|
@@ -8526,7 +8526,7 @@ const Bi = ({
|
|
|
8526
8526
|
height: "24",
|
|
8527
8527
|
viewBox: "0 0 24 24",
|
|
8528
8528
|
fill: "none",
|
|
8529
|
-
stroke:
|
|
8529
|
+
stroke: h ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
8530
8530
|
strokeWidth: "2",
|
|
8531
8531
|
strokeLinecap: "round",
|
|
8532
8532
|
strokeLinejoin: "round",
|
|
@@ -8556,8 +8556,8 @@ const Bi = ({
|
|
|
8556
8556
|
]
|
|
8557
8557
|
}
|
|
8558
8558
|
),
|
|
8559
|
-
ae && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children:
|
|
8560
|
-
const V = Vi(
|
|
8559
|
+
ae && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: m.map((x, z) => {
|
|
8560
|
+
const V = Vi(x), Q = V === "image", X = Q ? URL.createObjectURL(x) : null;
|
|
8561
8561
|
return /* @__PURE__ */ o(
|
|
8562
8562
|
"div",
|
|
8563
8563
|
{
|
|
@@ -8591,7 +8591,7 @@ const Bi = ({
|
|
|
8591
8591
|
"img",
|
|
8592
8592
|
{
|
|
8593
8593
|
src: X,
|
|
8594
|
-
alt:
|
|
8594
|
+
alt: x.name,
|
|
8595
8595
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
8596
8596
|
}
|
|
8597
8597
|
) : V === "pdf" ? /* @__PURE__ */ o("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -8615,15 +8615,15 @@ const Bi = ({
|
|
|
8615
8615
|
overflow: "hidden",
|
|
8616
8616
|
textOverflow: "ellipsis",
|
|
8617
8617
|
whiteSpace: "nowrap"
|
|
8618
|
-
}, children:
|
|
8619
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: St(
|
|
8618
|
+
}, children: x.name }),
|
|
8619
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: St(x.size) })
|
|
8620
8620
|
] }),
|
|
8621
8621
|
/* @__PURE__ */ r(
|
|
8622
8622
|
"button",
|
|
8623
8623
|
{
|
|
8624
8624
|
type: "button",
|
|
8625
8625
|
onClick: (W) => {
|
|
8626
|
-
W.stopPropagation(), K(
|
|
8626
|
+
W.stopPropagation(), K(z);
|
|
8627
8627
|
},
|
|
8628
8628
|
style: {
|
|
8629
8629
|
display: "flex",
|
|
@@ -8654,7 +8654,7 @@ const Bi = ({
|
|
|
8654
8654
|
)
|
|
8655
8655
|
]
|
|
8656
8656
|
},
|
|
8657
|
-
`${
|
|
8657
|
+
`${x.name}-${z}`
|
|
8658
8658
|
);
|
|
8659
8659
|
}) }),
|
|
8660
8660
|
J && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: J })
|
|
@@ -8786,10 +8786,10 @@ const Hi = kt(
|
|
|
8786
8786
|
children: l,
|
|
8787
8787
|
iconNode: s,
|
|
8788
8788
|
...p
|
|
8789
|
-
},
|
|
8789
|
+
}, m) => Tt(
|
|
8790
8790
|
"svg",
|
|
8791
8791
|
{
|
|
8792
|
-
ref:
|
|
8792
|
+
ref: m,
|
|
8793
8793
|
...Ki,
|
|
8794
8794
|
width: t,
|
|
8795
8795
|
height: t,
|
|
@@ -8884,80 +8884,80 @@ const Xi = ({
|
|
|
8884
8884
|
onComplete: t,
|
|
8885
8885
|
onBack: i
|
|
8886
8886
|
}) => {
|
|
8887
|
-
const { t: a } = Re(), { questionnaire: n, initialAnswers: l, isLoading: s, isSubmitting: p, error:
|
|
8887
|
+
const { t: a } = Re(), { questionnaire: n, initialAnswers: l, isLoading: s, isSubmitting: p, error: m, submit: d } = Ai(e), [y, h] = v({}), [R, L] = v({}), [b, q] = v(0);
|
|
8888
8888
|
Ce.useEffect(() => {
|
|
8889
|
-
l && Object.keys(l).length > 0 && Object.keys(y).length === 0 &&
|
|
8889
|
+
l && Object.keys(l).length > 0 && Object.keys(y).length === 0 && h(l);
|
|
8890
8890
|
}, [l]);
|
|
8891
8891
|
const S = Fe(
|
|
8892
8892
|
() => n ? Qi(n.questionGroups) : [],
|
|
8893
8893
|
[n]
|
|
8894
|
-
),
|
|
8895
|
-
|
|
8894
|
+
), P = b === S.length - 1, B = S[b] ?? [], F = te((x, z) => {
|
|
8895
|
+
h((V) => ({ ...V, [x]: z })), L((V) => {
|
|
8896
8896
|
const Q = { ...V };
|
|
8897
|
-
return delete Q[
|
|
8897
|
+
return delete Q[x], Q;
|
|
8898
8898
|
});
|
|
8899
8899
|
}, []), U = te(() => {
|
|
8900
|
-
const
|
|
8901
|
-
for (const { question:
|
|
8902
|
-
const V = Gi(
|
|
8903
|
-
V && (
|
|
8900
|
+
const x = {};
|
|
8901
|
+
for (const { question: z } of B) {
|
|
8902
|
+
const V = Gi(z, y[z.id] ?? []);
|
|
8903
|
+
V && (x[z.id] = V);
|
|
8904
8904
|
}
|
|
8905
|
-
return
|
|
8905
|
+
return L((z) => ({ ...z, ...x })), Object.keys(x).length === 0;
|
|
8906
8906
|
}, [B, y]), K = () => {
|
|
8907
|
-
U() && q((
|
|
8907
|
+
U() && q((x) => x + 1);
|
|
8908
8908
|
}, J = () => {
|
|
8909
|
-
|
|
8909
|
+
b > 0 ? q((x) => x - 1) : i == null || i();
|
|
8910
8910
|
}, ae = async () => {
|
|
8911
8911
|
if (!(!U() || !n))
|
|
8912
8912
|
try {
|
|
8913
|
-
const
|
|
8913
|
+
const x = n.questionGroups.flatMap(
|
|
8914
8914
|
(V) => (V.questions ?? []).map((Q) => ({
|
|
8915
8915
|
questionId: Q.id,
|
|
8916
8916
|
values: y[Q.id] ?? []
|
|
8917
8917
|
}))
|
|
8918
|
-
),
|
|
8918
|
+
), z = {
|
|
8919
8919
|
applicantId: e,
|
|
8920
8920
|
questionnarieId: n.id,
|
|
8921
|
-
questionResults:
|
|
8921
|
+
questionResults: x
|
|
8922
8922
|
};
|
|
8923
|
-
await d(
|
|
8924
|
-
} catch (
|
|
8925
|
-
console.error("Questionnaire submit error:",
|
|
8923
|
+
await d(z), t == null || t();
|
|
8924
|
+
} catch (x) {
|
|
8925
|
+
console.error("Questionnaire submit error:", x);
|
|
8926
8926
|
}
|
|
8927
8927
|
};
|
|
8928
|
-
return s ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ r(Ve, { className: "my-8" }) }) }) :
|
|
8928
|
+
return s ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ r(Ve, { className: "my-8" }) }) }) : m ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
8929
8929
|
a("questionnaire.errorLoading"),
|
|
8930
8930
|
" ",
|
|
8931
|
-
|
|
8931
|
+
m.message
|
|
8932
8932
|
] }) }) }) : n ? /* @__PURE__ */ o(re, { children: [
|
|
8933
8933
|
/* @__PURE__ */ o(Ne, { children: [
|
|
8934
8934
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
8935
8935
|
n.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.subtitle }),
|
|
8936
8936
|
S.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
8937
|
-
/* @__PURE__ */ r("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: a("common.pageXofY", { current:
|
|
8938
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: S.map((
|
|
8937
|
+
/* @__PURE__ */ r("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: a("common.pageXofY", { current: b + 1, total: S.length }) }),
|
|
8938
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: S.map((x, z) => /* @__PURE__ */ r(
|
|
8939
8939
|
"div",
|
|
8940
8940
|
{
|
|
8941
8941
|
className: "rounded-full transition-all duration-200",
|
|
8942
8942
|
style: {
|
|
8943
8943
|
height: "6px",
|
|
8944
|
-
width:
|
|
8945
|
-
backgroundColor:
|
|
8944
|
+
width: z === b ? "20px" : "6px",
|
|
8945
|
+
backgroundColor: z <= b ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
8946
8946
|
}
|
|
8947
8947
|
},
|
|
8948
|
-
|
|
8948
|
+
z
|
|
8949
8949
|
)) })
|
|
8950
8950
|
] })
|
|
8951
8951
|
] }),
|
|
8952
|
-
/* @__PURE__ */ r(ie, { className: "space-y-6", children: B.map(({ question:
|
|
8952
|
+
/* @__PURE__ */ r(ie, { className: "space-y-6", children: B.map(({ question: x }) => /* @__PURE__ */ r(
|
|
8953
8953
|
Zi,
|
|
8954
8954
|
{
|
|
8955
|
-
question:
|
|
8956
|
-
value: y[
|
|
8957
|
-
error:
|
|
8958
|
-
onChange: (
|
|
8955
|
+
question: x,
|
|
8956
|
+
value: y[x.id] ?? [],
|
|
8957
|
+
error: R[x.id],
|
|
8958
|
+
onChange: (z) => F(x.id, z)
|
|
8959
8959
|
},
|
|
8960
|
-
|
|
8960
|
+
x.id
|
|
8961
8961
|
)) }),
|
|
8962
8962
|
/* @__PURE__ */ o(Te, { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
8963
8963
|
/* @__PURE__ */ o(
|
|
@@ -8969,11 +8969,11 @@ const Xi = ({
|
|
|
8969
8969
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
8970
8970
|
children: [
|
|
8971
8971
|
/* @__PURE__ */ r(nr, { size: 14 }),
|
|
8972
|
-
|
|
8972
|
+
b > 0 ? a("common.previous") : a("common.back")
|
|
8973
8973
|
]
|
|
8974
8974
|
}
|
|
8975
8975
|
),
|
|
8976
|
-
|
|
8976
|
+
P ? /* @__PURE__ */ r(
|
|
8977
8977
|
G,
|
|
8978
8978
|
{
|
|
8979
8979
|
type: "button",
|
|
@@ -8994,7 +8994,7 @@ const Xi = ({
|
|
|
8994
8994
|
}
|
|
8995
8995
|
)
|
|
8996
8996
|
] }),
|
|
8997
|
-
|
|
8997
|
+
m && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: m.message }) })
|
|
8998
8998
|
] }) : null;
|
|
8999
8999
|
}, Zi = ({ question: e, value: t, error: i, onChange: a }) => {
|
|
9000
9000
|
var p;
|
|
@@ -9010,7 +9010,7 @@ const Xi = ({
|
|
|
9010
9010
|
Se,
|
|
9011
9011
|
{
|
|
9012
9012
|
value: t[0] ?? "",
|
|
9013
|
-
onChange: (
|
|
9013
|
+
onChange: (m) => a([m.target.value]),
|
|
9014
9014
|
placeholder: e.subtitle ? void 0 : n("placeholders.enterAnswer"),
|
|
9015
9015
|
error: i,
|
|
9016
9016
|
required: e.isRequired
|
|
@@ -9020,15 +9020,15 @@ const Xi = ({
|
|
|
9020
9020
|
At,
|
|
9021
9021
|
{
|
|
9022
9022
|
value: t[0] ?? "",
|
|
9023
|
-
onChange: (
|
|
9024
|
-
options: (e.defaultAnswers ?? []).map((
|
|
9023
|
+
onChange: (m) => a([m.target.value]),
|
|
9024
|
+
options: (e.defaultAnswers ?? []).map((m) => ({ value: m, label: m })),
|
|
9025
9025
|
placeholder: n("placeholders.selectOption"),
|
|
9026
9026
|
error: i,
|
|
9027
9027
|
required: e.isRequired
|
|
9028
9028
|
}
|
|
9029
9029
|
),
|
|
9030
9030
|
s === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
9031
|
-
(e.defaultAnswers ?? []).map((
|
|
9031
|
+
(e.defaultAnswers ?? []).map((m) => /* @__PURE__ */ o(
|
|
9032
9032
|
"label",
|
|
9033
9033
|
{
|
|
9034
9034
|
className: "metakyc-option-label",
|
|
@@ -9038,8 +9038,8 @@ const Xi = ({
|
|
|
9038
9038
|
"input",
|
|
9039
9039
|
{
|
|
9040
9040
|
type: "radio",
|
|
9041
|
-
checked: t[0] ===
|
|
9042
|
-
onChange: () => a([
|
|
9041
|
+
checked: t[0] === m,
|
|
9042
|
+
onChange: () => a([m]),
|
|
9043
9043
|
className: "metakyc-option-input",
|
|
9044
9044
|
style: {
|
|
9045
9045
|
width: "16px",
|
|
@@ -9056,15 +9056,15 @@ const Xi = ({
|
|
|
9056
9056
|
}
|
|
9057
9057
|
}
|
|
9058
9058
|
),
|
|
9059
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
9059
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: m })
|
|
9060
9060
|
]
|
|
9061
9061
|
},
|
|
9062
|
-
|
|
9062
|
+
m
|
|
9063
9063
|
)),
|
|
9064
9064
|
i && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: i })
|
|
9065
9065
|
] }),
|
|
9066
9066
|
(s === "checkbox" || s === "multi-select") && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
9067
|
-
(e.defaultAnswers ?? []).map((
|
|
9067
|
+
(e.defaultAnswers ?? []).map((m) => /* @__PURE__ */ o(
|
|
9068
9068
|
"label",
|
|
9069
9069
|
{
|
|
9070
9070
|
className: "metakyc-option-label",
|
|
@@ -9073,16 +9073,16 @@ const Xi = ({
|
|
|
9073
9073
|
/* @__PURE__ */ r(
|
|
9074
9074
|
Ue,
|
|
9075
9075
|
{
|
|
9076
|
-
checked: t.includes(
|
|
9076
|
+
checked: t.includes(m),
|
|
9077
9077
|
onChange: (d) => {
|
|
9078
|
-
a(d ? [...t,
|
|
9078
|
+
a(d ? [...t, m] : t.filter((y) => y !== m));
|
|
9079
9079
|
}
|
|
9080
9080
|
}
|
|
9081
9081
|
),
|
|
9082
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
9082
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: m })
|
|
9083
9083
|
]
|
|
9084
9084
|
},
|
|
9085
|
-
|
|
9085
|
+
m
|
|
9086
9086
|
)),
|
|
9087
9087
|
i && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: i })
|
|
9088
9088
|
] }),
|
|
@@ -9102,23 +9102,23 @@ const ea = ({
|
|
|
9102
9102
|
onComplete: t,
|
|
9103
9103
|
onBack: i
|
|
9104
9104
|
}) => {
|
|
9105
|
-
const { t: a } = Re(), { uploadDocument: n, isLoading: l, isSubmitting: s, error: p, submit:
|
|
9105
|
+
const { t: a } = Re(), { uploadDocument: n, isLoading: l, isSubmitting: s, error: p, submit: m } = Li(e), [d, y] = v({}), [h, R] = v(null), [L, b] = v(0), [q, S] = v({}), P = Fe(
|
|
9106
9106
|
() => n ? Ji(n.uploadDocumentFiles) : [],
|
|
9107
9107
|
[n]
|
|
9108
|
-
), B = L
|
|
9109
|
-
const
|
|
9108
|
+
), B = P[L] ?? [], F = L === P.length - 1, U = P.length, K = te(() => {
|
|
9109
|
+
const z = {};
|
|
9110
9110
|
for (const V of B)
|
|
9111
|
-
V.isRequired && (d[V.id] || []).length === 0 && (
|
|
9112
|
-
return S(
|
|
9111
|
+
V.isRequired && (d[V.id] || []).length === 0 && (z[V.id] = `${V.displayName} is required`);
|
|
9112
|
+
return S(z), Object.keys(z).length === 0;
|
|
9113
9113
|
}, [B, d]), J = () => {
|
|
9114
|
-
K() && (
|
|
9114
|
+
K() && (b((z) => z + 1), S({}));
|
|
9115
9115
|
}, ae = () => {
|
|
9116
|
-
|
|
9117
|
-
},
|
|
9116
|
+
L > 0 ? (b((z) => z - 1), S({})) : i == null || i();
|
|
9117
|
+
}, x = async () => {
|
|
9118
9118
|
if (!(!K() || !n)) {
|
|
9119
|
-
|
|
9119
|
+
R(null);
|
|
9120
9120
|
try {
|
|
9121
|
-
const
|
|
9121
|
+
const z = await Promise.all(
|
|
9122
9122
|
n.uploadDocumentFiles.map(async (Q) => {
|
|
9123
9123
|
const X = d[Q.id] || [], W = await Promise.all(
|
|
9124
9124
|
X.map(async (_) => ({
|
|
@@ -9134,11 +9134,11 @@ const ea = ({
|
|
|
9134
9134
|
), V = {
|
|
9135
9135
|
applicantId: e,
|
|
9136
9136
|
uploadDocumentId: n.id,
|
|
9137
|
-
uploadDocumentResults:
|
|
9137
|
+
uploadDocumentResults: z
|
|
9138
9138
|
};
|
|
9139
|
-
await
|
|
9140
|
-
} catch (
|
|
9141
|
-
|
|
9139
|
+
await m(V), t == null || t();
|
|
9140
|
+
} catch (z) {
|
|
9141
|
+
R((z == null ? void 0 : z.message) || a("uploadDocument.failedToSubmit"));
|
|
9142
9142
|
}
|
|
9143
9143
|
}
|
|
9144
9144
|
};
|
|
@@ -9187,23 +9187,23 @@ const ea = ({
|
|
|
9187
9187
|
justifyContent: "space-between",
|
|
9188
9188
|
marginTop: "12px"
|
|
9189
9189
|
}, children: [
|
|
9190
|
-
/* @__PURE__ */ r("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: a("common.pageXofY", { current:
|
|
9191
|
-
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children:
|
|
9190
|
+
/* @__PURE__ */ r("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: a("common.pageXofY", { current: L + 1, total: U }) }),
|
|
9191
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: P.map((z, V) => /* @__PURE__ */ r(
|
|
9192
9192
|
"div",
|
|
9193
9193
|
{
|
|
9194
9194
|
style: {
|
|
9195
9195
|
height: "6px",
|
|
9196
|
-
width: V ===
|
|
9196
|
+
width: V === L ? "20px" : "6px",
|
|
9197
9197
|
borderRadius: "999px",
|
|
9198
9198
|
transition: "all 0.2s ease",
|
|
9199
|
-
backgroundColor: V <=
|
|
9199
|
+
backgroundColor: V <= L ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
9200
9200
|
}
|
|
9201
9201
|
},
|
|
9202
9202
|
V
|
|
9203
9203
|
)) })
|
|
9204
9204
|
] })
|
|
9205
9205
|
] }),
|
|
9206
|
-
n.description &&
|
|
9206
|
+
n.description && L === 0 && /* @__PURE__ */ o("div", { style: {
|
|
9207
9207
|
margin: "0 24px",
|
|
9208
9208
|
marginTop: "4px",
|
|
9209
9209
|
display: "flex",
|
|
@@ -9239,27 +9239,27 @@ const ea = ({
|
|
|
9239
9239
|
lineHeight: 1.5
|
|
9240
9240
|
}, children: n.description })
|
|
9241
9241
|
] }),
|
|
9242
|
-
/* @__PURE__ */ r(ie, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: B.map((
|
|
9242
|
+
/* @__PURE__ */ r(ie, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: B.map((z) => /* @__PURE__ */ r(
|
|
9243
9243
|
Bi,
|
|
9244
9244
|
{
|
|
9245
|
-
label:
|
|
9246
|
-
subtitle:
|
|
9247
|
-
accept:
|
|
9248
|
-
multiple:
|
|
9249
|
-
maxSize:
|
|
9250
|
-
required:
|
|
9251
|
-
error: q[
|
|
9252
|
-
value: d[
|
|
9245
|
+
label: z.displayName,
|
|
9246
|
+
subtitle: z.subtitle,
|
|
9247
|
+
accept: z.allowedTypes,
|
|
9248
|
+
multiple: z.multipleFile,
|
|
9249
|
+
maxSize: z.maxEachFileSizeByte,
|
|
9250
|
+
required: z.isRequired,
|
|
9251
|
+
error: q[z.id],
|
|
9252
|
+
value: d[z.id] || [],
|
|
9253
9253
|
onChange: (V) => {
|
|
9254
|
-
|
|
9254
|
+
R(null), S((Q) => {
|
|
9255
9255
|
const X = { ...Q };
|
|
9256
|
-
return delete X[
|
|
9257
|
-
}), y((Q) => ({ ...Q, [
|
|
9256
|
+
return delete X[z.id], X;
|
|
9257
|
+
}), y((Q) => ({ ...Q, [z.id]: V }));
|
|
9258
9258
|
}
|
|
9259
9259
|
},
|
|
9260
|
-
|
|
9260
|
+
z.id
|
|
9261
9261
|
)) }) }),
|
|
9262
|
-
|
|
9262
|
+
h && /* @__PURE__ */ o("div", { style: {
|
|
9263
9263
|
margin: "0 24px",
|
|
9264
9264
|
padding: "10px 14px",
|
|
9265
9265
|
borderRadius: "8px",
|
|
@@ -9274,7 +9274,7 @@ const ea = ({
|
|
|
9274
9274
|
/* @__PURE__ */ r("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
9275
9275
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
9276
9276
|
] }),
|
|
9277
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
9277
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: h })
|
|
9278
9278
|
] }),
|
|
9279
9279
|
/* @__PURE__ */ r(Te, { children: /* @__PURE__ */ o("div", { style: {
|
|
9280
9280
|
display: "flex",
|
|
@@ -9288,7 +9288,7 @@ const ea = ({
|
|
|
9288
9288
|
type: "button",
|
|
9289
9289
|
variant: "outline",
|
|
9290
9290
|
onClick: ae,
|
|
9291
|
-
children:
|
|
9291
|
+
children: L > 0 ? a("common.previous") : a("common.back")
|
|
9292
9292
|
}
|
|
9293
9293
|
),
|
|
9294
9294
|
F ? /* @__PURE__ */ r(
|
|
@@ -9296,7 +9296,7 @@ const ea = ({
|
|
|
9296
9296
|
{
|
|
9297
9297
|
type: "button",
|
|
9298
9298
|
isLoading: s,
|
|
9299
|
-
onClick:
|
|
9299
|
+
onClick: x,
|
|
9300
9300
|
children: a(s ? "uploadDocument.uploading" : "common.continue")
|
|
9301
9301
|
}
|
|
9302
9302
|
) : /* @__PURE__ */ r(
|
|
@@ -9310,8 +9310,8 @@ const ea = ({
|
|
|
9310
9310
|
] }) })
|
|
9311
9311
|
] }) : null;
|
|
9312
9312
|
}, ta = ({ applicantId: e, onComplete: t, onBack: i }) => {
|
|
9313
|
-
const { t: a } = Re(), { overview: n, isLoading: l, isSubmitting: s, error: p, passOverview:
|
|
9314
|
-
await
|
|
9313
|
+
const { t: a } = Re(), { overview: n, isLoading: l, isSubmitting: s, error: p, passOverview: m } = Ei(e), d = async () => {
|
|
9314
|
+
await m(), t == null || t();
|
|
9315
9315
|
};
|
|
9316
9316
|
return l ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ r(Ve, { className: "my-8" }) }) }) : p ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
9317
9317
|
a("overview.errorLoading"),
|
|
@@ -9322,7 +9322,7 @@ const ea = ({
|
|
|
9322
9322
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: n.title || a("overview.title") }),
|
|
9323
9323
|
n.description && /* @__PURE__ */ r("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.description })
|
|
9324
9324
|
] }),
|
|
9325
|
-
/* @__PURE__ */ r(ie, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((y,
|
|
9325
|
+
/* @__PURE__ */ r(ie, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((y, h) => y.order - h.order).map((y) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
9326
9326
|
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r(
|
|
9327
9327
|
"div",
|
|
9328
9328
|
{
|
|
@@ -9420,49 +9420,49 @@ const la = ({
|
|
|
9420
9420
|
onComplete: t,
|
|
9421
9421
|
onBack: i
|
|
9422
9422
|
}) => {
|
|
9423
|
-
const { t: a } = Re(), { config: n } = Oe(), l = n.locale ?? "en", { criteria: s, initialAnswers: p, isLoading:
|
|
9423
|
+
const { t: a } = Re(), { config: n } = Oe(), l = n.locale ?? "en", { criteria: s, initialAnswers: p, isLoading: m, isSubmitting: d, error: y, submit: h } = Di(e), [R, L] = v({}), [b, q] = v({}), [S, P] = v(0), [B, F] = v(!1);
|
|
9424
9424
|
Ce.useEffect(() => {
|
|
9425
|
-
p && Object.keys(p).length > 0 && Object.keys(
|
|
9425
|
+
p && Object.keys(p).length > 0 && Object.keys(R).length === 0 && L(p);
|
|
9426
9426
|
}, [p]);
|
|
9427
9427
|
const U = Fe(
|
|
9428
9428
|
() => s && s.length > 0 ? oa(s) : [],
|
|
9429
9429
|
[s]
|
|
9430
9430
|
), K = S === U.length - 1, J = U[S] ?? [];
|
|
9431
9431
|
Ce.useEffect(() => {
|
|
9432
|
-
!
|
|
9433
|
-
}, [
|
|
9432
|
+
!m && s && s.length === 0 && !B && !d && (F(!0), h({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
9433
|
+
}, [m, s, B, d, h, e, t]);
|
|
9434
9434
|
const ae = te((X, W) => {
|
|
9435
|
-
|
|
9435
|
+
L((_) => ({ ..._, [X]: W })), q((_) => {
|
|
9436
9436
|
const oe = { ..._ };
|
|
9437
9437
|
return delete oe[X], oe;
|
|
9438
9438
|
});
|
|
9439
|
-
}, []),
|
|
9439
|
+
}, []), x = te(() => {
|
|
9440
9440
|
const X = {};
|
|
9441
9441
|
for (const { criterion: W } of J) {
|
|
9442
|
-
const _ = na(W,
|
|
9442
|
+
const _ = na(W, R[W.id] ?? []);
|
|
9443
9443
|
_ && (X[W.id] = _);
|
|
9444
9444
|
}
|
|
9445
9445
|
return q((W) => ({ ...W, ...X })), Object.keys(X).length === 0;
|
|
9446
|
-
}, [J,
|
|
9447
|
-
|
|
9446
|
+
}, [J, R]), z = () => {
|
|
9447
|
+
x() && P((X) => X + 1);
|
|
9448
9448
|
}, V = () => {
|
|
9449
|
-
S > 0 ?
|
|
9449
|
+
S > 0 ? P((X) => X - 1) : i == null || i();
|
|
9450
9450
|
}, Q = async () => {
|
|
9451
|
-
if (!(!
|
|
9451
|
+
if (!(!x() || !s))
|
|
9452
9452
|
try {
|
|
9453
9453
|
const X = s.map((_) => {
|
|
9454
|
-
const oe = (
|
|
9454
|
+
const oe = (R[_.id] ?? []).filter((H) => H && H.trim());
|
|
9455
9455
|
return oe.length > 0 ? { riskCriteriaId: _.id, values: oe } : null;
|
|
9456
9456
|
}).filter((_) => _ !== null);
|
|
9457
|
-
await
|
|
9457
|
+
await h({ applicantId: e, criteriaValueInputs: X }), t == null || t();
|
|
9458
9458
|
} catch (X) {
|
|
9459
9459
|
console.error("Risk scoring submit error:", X);
|
|
9460
9460
|
}
|
|
9461
9461
|
};
|
|
9462
|
-
return
|
|
9462
|
+
return m ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ie, { children: [
|
|
9463
9463
|
/* @__PURE__ */ r(Ve, { className: "my-8" }),
|
|
9464
9464
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a("riskScoring.loadingCriteria") })
|
|
9465
|
-
] }) }) : !
|
|
9465
|
+
] }) }) : !m && s && s.length === 0 ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ie, { children: [
|
|
9466
9466
|
/* @__PURE__ */ r(Ve, { className: "my-8" }),
|
|
9467
9467
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a("riskScoring.noCriteria") })
|
|
9468
9468
|
] }) }) : y ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
@@ -9493,8 +9493,8 @@ const la = ({
|
|
|
9493
9493
|
ca,
|
|
9494
9494
|
{
|
|
9495
9495
|
criterion: X,
|
|
9496
|
-
value:
|
|
9497
|
-
error:
|
|
9496
|
+
value: R[X.id] ?? [],
|
|
9497
|
+
error: b[X.id],
|
|
9498
9498
|
locale: l,
|
|
9499
9499
|
onChange: (W) => ae(X.id, W)
|
|
9500
9500
|
},
|
|
@@ -9518,7 +9518,7 @@ const la = ({
|
|
|
9518
9518
|
G,
|
|
9519
9519
|
{
|
|
9520
9520
|
type: "button",
|
|
9521
|
-
onClick:
|
|
9521
|
+
onClick: z,
|
|
9522
9522
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
9523
9523
|
children: [
|
|
9524
9524
|
a("common.next"),
|
|
@@ -9530,7 +9530,7 @@ const la = ({
|
|
|
9530
9530
|
y && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: y.message }) })
|
|
9531
9531
|
] }) : null;
|
|
9532
9532
|
}, ca = ({ criterion: e, value: t, error: i, locale: a, onChange: n }) => {
|
|
9533
|
-
const { t: l } = Re(), s = sa(e), p = e.valueDataType === _e.Integer || e.valueDataType === _e.Money || e.valueDataType === _e.DigitOnly,
|
|
9533
|
+
const { t: l } = Re(), s = sa(e), p = e.valueDataType === _e.Integer || e.valueDataType === _e.Money || e.valueDataType === _e.DigitOnly, m = ia(e), d = (y) => m ? aa(y, a) : y;
|
|
9534
9534
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
9535
9535
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
9536
9536
|
e.displayName,
|
|
@@ -9601,8 +9601,8 @@ const la = ({
|
|
|
9601
9601
|
Ue,
|
|
9602
9602
|
{
|
|
9603
9603
|
checked: t.includes(y),
|
|
9604
|
-
onChange: (
|
|
9605
|
-
n(
|
|
9604
|
+
onChange: (h) => {
|
|
9605
|
+
n(h ? [...t, y] : t.filter((R) => R !== y));
|
|
9606
9606
|
}
|
|
9607
9607
|
}
|
|
9608
9608
|
),
|
|
@@ -9636,25 +9636,25 @@ const la = ({
|
|
|
9636
9636
|
onComplete: t,
|
|
9637
9637
|
onBack: i
|
|
9638
9638
|
}) => {
|
|
9639
|
-
const { t: a } = Re(), { investorCategorizationService: n } = Oe(), [l, s] =
|
|
9640
|
-
return /* @__PURE__ */ r("form", { onSubmit: async (
|
|
9641
|
-
if (
|
|
9639
|
+
const { t: a } = Re(), { investorCategorizationService: n } = Oe(), [l, s] = v(null), [p, m] = v(!1), [d, y] = v(null);
|
|
9640
|
+
return /* @__PURE__ */ r("form", { onSubmit: async (R) => {
|
|
9641
|
+
if (R.preventDefault(), l === null) {
|
|
9642
9642
|
y(a("investorCategorization.pleaseSelect"));
|
|
9643
9643
|
return;
|
|
9644
9644
|
}
|
|
9645
|
-
|
|
9645
|
+
m(!0), y(null);
|
|
9646
9646
|
try {
|
|
9647
|
-
const
|
|
9647
|
+
const L = {
|
|
9648
9648
|
applicantId: e,
|
|
9649
9649
|
investorType: l
|
|
9650
9650
|
};
|
|
9651
|
-
console.log("Submitting investor categorization:",
|
|
9652
|
-
const
|
|
9653
|
-
console.log("Investor categorization result:",
|
|
9654
|
-
} catch (
|
|
9655
|
-
console.error("Error submitting investor categorization:",
|
|
9651
|
+
console.log("Submitting investor categorization:", L);
|
|
9652
|
+
const b = await n.setInvestorCategorization(L);
|
|
9653
|
+
console.log("Investor categorization result:", b), t == null || t();
|
|
9654
|
+
} catch (L) {
|
|
9655
|
+
console.error("Error submitting investor categorization:", L), y(L.message || a("investorCategorization.failedToSubmit"));
|
|
9656
9656
|
} finally {
|
|
9657
|
-
|
|
9657
|
+
m(!1);
|
|
9658
9658
|
}
|
|
9659
9659
|
}, children: /* @__PURE__ */ o(re, { children: [
|
|
9660
9660
|
/* @__PURE__ */ o(Ne, { children: [
|
|
@@ -9777,63 +9777,63 @@ const ma = ({
|
|
|
9777
9777
|
onComplete: t,
|
|
9778
9778
|
onBack: i
|
|
9779
9779
|
}) => {
|
|
9780
|
-
const { t: a } = Re(), { appropriatenessTestService: n } = Oe(), [l, s] =
|
|
9780
|
+
const { t: a } = Re(), { appropriatenessTestService: n } = Oe(), [l, s] = v(null), [p, m] = v(!0), [d, y] = v(!1), [h, R] = v(null), [L, b] = v({}), [q, S] = v(0), [P, B] = v(!1), [F, U] = v(!1), [K, J] = v(0), [ae, x] = v(0), [z, V] = v(null);
|
|
9781
9781
|
fe(() => {
|
|
9782
9782
|
(async () => {
|
|
9783
9783
|
try {
|
|
9784
|
-
|
|
9785
|
-
const
|
|
9786
|
-
if (s(
|
|
9787
|
-
const O = Kt(
|
|
9784
|
+
m(!0), R(null);
|
|
9785
|
+
const E = await n.getAppropriatenessTest(e);
|
|
9786
|
+
if (s(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
9787
|
+
const O = Kt(E.waitTimeSpanForNextTry);
|
|
9788
9788
|
O > 0 && J(O);
|
|
9789
9789
|
}
|
|
9790
|
-
} catch (
|
|
9791
|
-
|
|
9790
|
+
} catch (E) {
|
|
9791
|
+
R(E.message || a("appropriatenessTest.failedToLoad"));
|
|
9792
9792
|
} finally {
|
|
9793
|
-
|
|
9793
|
+
m(!1);
|
|
9794
9794
|
}
|
|
9795
9795
|
})();
|
|
9796
9796
|
}, [e, n]), fe(() => {
|
|
9797
|
-
if (!
|
|
9798
|
-
const
|
|
9797
|
+
if (!P || q <= 0) return;
|
|
9798
|
+
const E = setInterval(() => {
|
|
9799
9799
|
S((O) => O <= 1 ? (U(!0), 0) : O - 1);
|
|
9800
9800
|
}, 1e3);
|
|
9801
|
-
return () => clearInterval(
|
|
9802
|
-
}, [
|
|
9801
|
+
return () => clearInterval(E);
|
|
9802
|
+
}, [P, q]), fe(() => {
|
|
9803
9803
|
if (K <= 0) return;
|
|
9804
|
-
const
|
|
9804
|
+
const E = setInterval(() => {
|
|
9805
9805
|
J((O) => O <= 1 ? 0 : O - 1);
|
|
9806
9806
|
}, 1e3);
|
|
9807
|
-
return () => clearInterval(
|
|
9807
|
+
return () => clearInterval(E);
|
|
9808
9808
|
}, [K]), fe(() => {
|
|
9809
9809
|
F && !d && _();
|
|
9810
9810
|
}, [F]);
|
|
9811
9811
|
const Q = () => {
|
|
9812
|
-
l && (B(!0), S(l.testDurationSec),
|
|
9813
|
-
}, X = (
|
|
9814
|
-
|
|
9812
|
+
l && (B(!0), S(l.testDurationSec), x(0), b({}), R(null));
|
|
9813
|
+
}, X = (E, O) => {
|
|
9814
|
+
b((ke) => ({ ...ke, [E]: O }));
|
|
9815
9815
|
}, W = te(async () => {
|
|
9816
9816
|
try {
|
|
9817
|
-
const
|
|
9818
|
-
if (s(
|
|
9819
|
-
const O = Kt(
|
|
9817
|
+
const E = await n.getAppropriatenessTest(e);
|
|
9818
|
+
if (s(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
9819
|
+
const O = Kt(E.waitTimeSpanForNextTry);
|
|
9820
9820
|
O > 0 && J(O);
|
|
9821
9821
|
}
|
|
9822
9822
|
} catch {
|
|
9823
9823
|
}
|
|
9824
|
-
}, [e, n]), _ = async (
|
|
9824
|
+
}, [e, n]), _ = async (E) => {
|
|
9825
9825
|
if (l) {
|
|
9826
9826
|
if (!F) {
|
|
9827
|
-
const O = l.appropriatenessQuestions.length - Object.keys(
|
|
9827
|
+
const O = l.appropriatenessQuestions.length - Object.keys(L).length;
|
|
9828
9828
|
if (O > 0) {
|
|
9829
|
-
|
|
9829
|
+
R(a("appropriatenessTest.answerAllQuestions", { remaining: O }));
|
|
9830
9830
|
return;
|
|
9831
9831
|
}
|
|
9832
9832
|
}
|
|
9833
|
-
y(!0),
|
|
9833
|
+
y(!0), R(null);
|
|
9834
9834
|
try {
|
|
9835
9835
|
const O = l.appropriatenessQuestions.map(
|
|
9836
|
-
(se) => ({ appropriatenessQuestionId: se.id, value:
|
|
9836
|
+
(se) => ({ appropriatenessQuestionId: se.id, value: L[se.id] || "" })
|
|
9837
9837
|
), ke = {
|
|
9838
9838
|
applicantId: e,
|
|
9839
9839
|
appropriatenessTestId: l.id,
|
|
@@ -9849,13 +9849,13 @@ const ma = ({
|
|
|
9849
9849
|
throw se;
|
|
9850
9850
|
}
|
|
9851
9851
|
} catch (O) {
|
|
9852
|
-
|
|
9852
|
+
R(O.message || a("appropriatenessTest.failedToSubmit")), oe();
|
|
9853
9853
|
} finally {
|
|
9854
9854
|
y(!1);
|
|
9855
9855
|
}
|
|
9856
9856
|
}
|
|
9857
9857
|
}, oe = () => {
|
|
9858
|
-
B(!1), U(!1),
|
|
9858
|
+
B(!1), U(!1), b({}), x(0);
|
|
9859
9859
|
};
|
|
9860
9860
|
if (p)
|
|
9861
9861
|
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
@@ -9865,9 +9865,9 @@ const ma = ({
|
|
|
9865
9865
|
if (!l)
|
|
9866
9866
|
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
|
|
9867
9867
|
/* @__PURE__ */ r("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: a("appropriatenessTest.noTestData") }),
|
|
9868
|
-
|
|
9868
|
+
h && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: h })
|
|
9869
9869
|
] }) }) });
|
|
9870
|
-
const H = l.testAllowedMaxTry - l.totalFailedTries, Me = l.appropriatenessQuestions.length, pe = Object.keys(
|
|
9870
|
+
const H = l.testAllowedMaxTry - l.totalFailedTries, Me = l.appropriatenessQuestions.length, pe = Object.keys(L).length;
|
|
9871
9871
|
if (K > 0)
|
|
9872
9872
|
return /* @__PURE__ */ o(re, { children: [
|
|
9873
9873
|
/* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: l.displayName }) }),
|
|
@@ -9889,18 +9889,18 @@ const ma = ({
|
|
|
9889
9889
|
}, children: Ct(K) }) }),
|
|
9890
9890
|
/* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: a("appropriatenessTest.waitBeforeRetrying") }),
|
|
9891
9891
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: a("appropriatenessTest.waitTimerMessage") }),
|
|
9892
|
-
|
|
9892
|
+
h && /* @__PURE__ */ r("div", { style: {
|
|
9893
9893
|
marginTop: "20px",
|
|
9894
9894
|
padding: "12px 16px",
|
|
9895
9895
|
borderRadius: "10px",
|
|
9896
9896
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
9897
9897
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
9898
|
-
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
9898
|
+
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: h }) })
|
|
9899
9899
|
] }) })
|
|
9900
9900
|
] });
|
|
9901
|
-
if (
|
|
9902
|
-
const
|
|
9903
|
-
V(null), oe(),
|
|
9901
|
+
if (z) {
|
|
9902
|
+
const E = () => {
|
|
9903
|
+
V(null), oe(), R(null);
|
|
9904
9904
|
};
|
|
9905
9905
|
return /* @__PURE__ */ o(re, { children: [
|
|
9906
9906
|
/* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("div", { style: {
|
|
@@ -9918,8 +9918,8 @@ const ma = ({
|
|
|
9918
9918
|
display: "flex",
|
|
9919
9919
|
alignItems: "center",
|
|
9920
9920
|
justifyContent: "center",
|
|
9921
|
-
backgroundColor:
|
|
9922
|
-
}, children:
|
|
9921
|
+
backgroundColor: z.success ? "color-mix(in srgb, var(--metakyc-success, #10b981) 12%, transparent)" : "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)"
|
|
9922
|
+
}, children: z.success ? /* @__PURE__ */ o("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-success, #10b981)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
9923
9923
|
/* @__PURE__ */ r("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
9924
9924
|
/* @__PURE__ */ r("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
9925
9925
|
] }) : /* @__PURE__ */ o("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -9930,9 +9930,9 @@ const ma = ({
|
|
|
9930
9930
|
/* @__PURE__ */ r("h2", { style: {
|
|
9931
9931
|
fontSize: "20px",
|
|
9932
9932
|
fontWeight: 700,
|
|
9933
|
-
color:
|
|
9933
|
+
color: z.success ? "var(--metakyc-success, #10b981)" : "var(--metakyc-danger, #ef4444)",
|
|
9934
9934
|
margin: 0
|
|
9935
|
-
}, children:
|
|
9935
|
+
}, children: z.success ? a("appropriatenessTest.testPassed") : a("appropriatenessTest.testFailed") }),
|
|
9936
9936
|
/* @__PURE__ */ r("p", { style: {
|
|
9937
9937
|
fontSize: "14px",
|
|
9938
9938
|
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
@@ -9940,8 +9940,8 @@ const ma = ({
|
|
|
9940
9940
|
lineHeight: 1.6,
|
|
9941
9941
|
maxWidth: "400px",
|
|
9942
9942
|
whiteSpace: "pre-line"
|
|
9943
|
-
}, children:
|
|
9944
|
-
!
|
|
9943
|
+
}, children: z.message }),
|
|
9944
|
+
!z.success && H > 0 && /* @__PURE__ */ r("div", { style: {
|
|
9945
9945
|
marginTop: "4px",
|
|
9946
9946
|
padding: "10px 20px",
|
|
9947
9947
|
borderRadius: "10px",
|
|
@@ -9952,7 +9952,7 @@ const ma = ({
|
|
|
9952
9952
|
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
9953
9953
|
margin: 0
|
|
9954
9954
|
}, children: a("appropriatenessTest.attemptsRemaining", { count: H }) }) }),
|
|
9955
|
-
!
|
|
9955
|
+
!z.success && H <= 0 && /* @__PURE__ */ r("div", { style: {
|
|
9956
9956
|
marginTop: "4px",
|
|
9957
9957
|
padding: "10px 20px",
|
|
9958
9958
|
borderRadius: "10px",
|
|
@@ -9964,14 +9964,14 @@ const ma = ({
|
|
|
9964
9964
|
margin: 0
|
|
9965
9965
|
}, children: a("appropriatenessTest.noAttemptsRemaining") }) })
|
|
9966
9966
|
] }) }),
|
|
9967
|
-
/* @__PURE__ */ r(Te, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children:
|
|
9968
|
-
H > 0 && K <= 0 && /* @__PURE__ */ r(G, { type: "button", onClick:
|
|
9969
|
-
H > 0 && K > 0 && /* @__PURE__ */ r(G, { type: "button", onClick:
|
|
9967
|
+
/* @__PURE__ */ r(Te, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: z.success ? /* @__PURE__ */ r(G, { type: "button", onClick: () => t == null ? void 0 : t(), children: a("common.continue") }) : /* @__PURE__ */ o(ut, { children: [
|
|
9968
|
+
H > 0 && K <= 0 && /* @__PURE__ */ r(G, { type: "button", onClick: E, children: a("appropriatenessTest.retakeTest") }),
|
|
9969
|
+
H > 0 && K > 0 && /* @__PURE__ */ r(G, { type: "button", onClick: E, children: a("appropriatenessTest.ok") }),
|
|
9970
9970
|
H <= 0 && i && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: i, children: a("common.back") })
|
|
9971
9971
|
] }) }) })
|
|
9972
9972
|
] });
|
|
9973
9973
|
}
|
|
9974
|
-
if (!
|
|
9974
|
+
if (!P)
|
|
9975
9975
|
return /* @__PURE__ */ o(re, { children: [
|
|
9976
9976
|
/* @__PURE__ */ o(Ne, { children: [
|
|
9977
9977
|
/* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: l.displayName }),
|
|
@@ -10008,7 +10008,7 @@ const ma = ({
|
|
|
10008
10008
|
}
|
|
10009
10009
|
)
|
|
10010
10010
|
] }),
|
|
10011
|
-
|
|
10011
|
+
h && /* @__PURE__ */ o("div", { style: {
|
|
10012
10012
|
marginBottom: "16px",
|
|
10013
10013
|
padding: "12px 14px",
|
|
10014
10014
|
borderRadius: "10px",
|
|
@@ -10025,7 +10025,7 @@ const ma = ({
|
|
|
10025
10025
|
/* @__PURE__ */ o("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0, lineHeight: 1.5 }, children: [
|
|
10026
10026
|
/* @__PURE__ */ r("strong", { children: a("appropriatenessTest.previousAttempt") }),
|
|
10027
10027
|
" ",
|
|
10028
|
-
|
|
10028
|
+
h
|
|
10029
10029
|
] })
|
|
10030
10030
|
] }),
|
|
10031
10031
|
H <= 0 && /* @__PURE__ */ r("div", { style: {
|
|
@@ -10040,7 +10040,7 @@ const ma = ({
|
|
|
10040
10040
|
/* @__PURE__ */ r(G, { type: "button", onClick: Q, disabled: H <= 0, children: a("appropriatenessTest.startTest") })
|
|
10041
10041
|
] }) })
|
|
10042
10042
|
] });
|
|
10043
|
-
const ge = l.appropriatenessQuestions[ae], xe = ae === Me - 1, me = pe === Me,
|
|
10043
|
+
const ge = l.appropriatenessQuestions[ae], xe = ae === Me - 1, me = pe === Me, D = q <= 60;
|
|
10044
10044
|
return /* @__PURE__ */ o(re, { children: [
|
|
10045
10045
|
/* @__PURE__ */ o(Ne, { children: [
|
|
10046
10046
|
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
@@ -10054,7 +10054,7 @@ const ma = ({
|
|
|
10054
10054
|
gap: "8px",
|
|
10055
10055
|
padding: "6px 14px",
|
|
10056
10056
|
borderRadius: "999px",
|
|
10057
|
-
backgroundColor:
|
|
10057
|
+
backgroundColor: D ? "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)" : "var(--metakyc-surface, #f3f4f6)",
|
|
10058
10058
|
transition: "all 0.3s ease"
|
|
10059
10059
|
}, children: [
|
|
10060
10060
|
/* @__PURE__ */ o(
|
|
@@ -10064,7 +10064,7 @@ const ma = ({
|
|
|
10064
10064
|
height: "16",
|
|
10065
10065
|
viewBox: "0 0 24 24",
|
|
10066
10066
|
fill: "none",
|
|
10067
|
-
stroke:
|
|
10067
|
+
stroke: D ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
10068
10068
|
strokeWidth: "2",
|
|
10069
10069
|
strokeLinecap: "round",
|
|
10070
10070
|
strokeLinejoin: "round",
|
|
@@ -10078,7 +10078,7 @@ const ma = ({
|
|
|
10078
10078
|
fontSize: "16px",
|
|
10079
10079
|
fontWeight: 700,
|
|
10080
10080
|
fontVariantNumeric: "tabular-nums",
|
|
10081
|
-
color:
|
|
10081
|
+
color: D ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-primary, #111827)",
|
|
10082
10082
|
transition: "color 0.3s ease"
|
|
10083
10083
|
}, children: Ct(q) })
|
|
10084
10084
|
] })
|
|
@@ -10120,8 +10120,8 @@ const ma = ({
|
|
|
10120
10120
|
{
|
|
10121
10121
|
question: ge,
|
|
10122
10122
|
index: ae,
|
|
10123
|
-
selectedAnswer:
|
|
10124
|
-
onSelect: (
|
|
10123
|
+
selectedAnswer: L[ge.id],
|
|
10124
|
+
onSelect: (E) => X(ge.id, E),
|
|
10125
10125
|
disabled: d
|
|
10126
10126
|
}
|
|
10127
10127
|
),
|
|
@@ -10131,18 +10131,18 @@ const ma = ({
|
|
|
10131
10131
|
gap: "6px",
|
|
10132
10132
|
marginTop: "20px",
|
|
10133
10133
|
flexWrap: "wrap"
|
|
10134
|
-
}, children: l.appropriatenessQuestions.map((
|
|
10134
|
+
}, children: l.appropriatenessQuestions.map((E, O) => /* @__PURE__ */ r(
|
|
10135
10135
|
"button",
|
|
10136
10136
|
{
|
|
10137
10137
|
type: "button",
|
|
10138
|
-
onClick: () =>
|
|
10138
|
+
onClick: () => x(O),
|
|
10139
10139
|
style: {
|
|
10140
10140
|
width: "28px",
|
|
10141
10141
|
height: "28px",
|
|
10142
10142
|
borderRadius: "8px",
|
|
10143
10143
|
border: O === ae ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
10144
|
-
backgroundColor:
|
|
10145
|
-
color:
|
|
10144
|
+
backgroundColor: L[E.id] ? O === ae ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : O === ae ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
10145
|
+
color: L[E.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
10146
10146
|
fontSize: "12px",
|
|
10147
10147
|
fontWeight: 600,
|
|
10148
10148
|
cursor: "pointer",
|
|
@@ -10154,7 +10154,7 @@ const ma = ({
|
|
|
10154
10154
|
},
|
|
10155
10155
|
children: O + 1
|
|
10156
10156
|
},
|
|
10157
|
-
|
|
10157
|
+
E.id
|
|
10158
10158
|
)) }),
|
|
10159
10159
|
F && /* @__PURE__ */ o("div", { style: {
|
|
10160
10160
|
marginTop: "16px",
|
|
@@ -10172,13 +10172,13 @@ const ma = ({
|
|
|
10172
10172
|
] }),
|
|
10173
10173
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "#b45309", margin: 0, fontWeight: 500 }, children: a("appropriatenessTest.timesUp") })
|
|
10174
10174
|
] }),
|
|
10175
|
-
|
|
10175
|
+
h && !F && /* @__PURE__ */ r("div", { style: {
|
|
10176
10176
|
marginTop: "16px",
|
|
10177
10177
|
padding: "12px 14px",
|
|
10178
10178
|
borderRadius: "10px",
|
|
10179
10179
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
10180
10180
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
10181
|
-
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
10181
|
+
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: h }) })
|
|
10182
10182
|
] }),
|
|
10183
10183
|
/* @__PURE__ */ r(Te, { children: /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
10184
10184
|
/* @__PURE__ */ r(
|
|
@@ -10187,7 +10187,7 @@ const ma = ({
|
|
|
10187
10187
|
type: "button",
|
|
10188
10188
|
variant: "outline",
|
|
10189
10189
|
onClick: () => {
|
|
10190
|
-
ae > 0 ?
|
|
10190
|
+
ae > 0 ? x((E) => E - 1) : i == null || i();
|
|
10191
10191
|
},
|
|
10192
10192
|
disabled: d,
|
|
10193
10193
|
children: ae > 0 ? a("common.previous") : a("common.cancel")
|
|
@@ -10198,7 +10198,7 @@ const ma = ({
|
|
|
10198
10198
|
G,
|
|
10199
10199
|
{
|
|
10200
10200
|
type: "button",
|
|
10201
|
-
onClick: () =>
|
|
10201
|
+
onClick: () => x((E) => E + 1),
|
|
10202
10202
|
children: a("common.next")
|
|
10203
10203
|
}
|
|
10204
10204
|
),
|
|
@@ -10348,8 +10348,8 @@ const ma = ({
|
|
|
10348
10348
|
onBack: i
|
|
10349
10349
|
}) => {
|
|
10350
10350
|
var rt, Ke, ct, Xe;
|
|
10351
|
-
const { t: a } = Re(), { applicantService: n, baseInformationService: l, identityService: s, config: p, currentTheme:
|
|
10352
|
-
|
|
10351
|
+
const { t: a } = Re(), { applicantService: n, baseInformationService: l, identityService: s, config: p, currentTheme: m } = Oe(), { identityData: d, provider: y, token: h, isLoading: R, error: L, requestIdentity: b, restartIdentity: q } = Pi(e), [S, P] = v(null), [B, F] = v(null), [U, K] = v([]), [J, ae] = v([]), [x, z] = v(!0), [V, Q] = v(!1), [X, W] = v(null), [_, oe] = v(!1), H = Ce.useRef(!1), [Me, pe] = v({}), [ge, xe] = v({}), me = m != null && m.reviewPageFields && m.reviewPageFields.length > 0 ? m.reviewPageFields[0] : null, D = !!(m != null && m.reviewPageDisabled), E = de(!1);
|
|
10352
|
+
E.current = D;
|
|
10353
10353
|
const O = mr({
|
|
10354
10354
|
defaultValues: {
|
|
10355
10355
|
street: "",
|
|
@@ -10362,8 +10362,8 @@ const ma = ({
|
|
|
10362
10362
|
}
|
|
10363
10363
|
});
|
|
10364
10364
|
fe(() => {
|
|
10365
|
-
if (
|
|
10366
|
-
H.current || (H.current = !0,
|
|
10365
|
+
if (D) {
|
|
10366
|
+
H.current || (H.current = !0, b().then(() => Q(!0)).catch((M) => console.error("[Identity] Auto-request failed:", M)).finally(() => z(!1)));
|
|
10367
10367
|
return;
|
|
10368
10368
|
}
|
|
10369
10369
|
(async () => {
|
|
@@ -10377,43 +10377,43 @@ const ma = ({
|
|
|
10377
10377
|
F(M);
|
|
10378
10378
|
const ee = /* @__PURE__ */ new Set(), g = $.map((k) => ({ value: k.abbreviation3 || k.abbreviation, label: k.name })).filter((k) => !k.value || ee.has(k.value) ? !1 : (ee.add(k.value), !0));
|
|
10379
10379
|
K(g);
|
|
10380
|
-
const
|
|
10381
|
-
ae(
|
|
10382
|
-
const
|
|
10380
|
+
const A = /* @__PURE__ */ new Set(), w = Y.filter((k) => k.countryCode).map((k) => ({ value: k.countryCode, label: `${k.countryCode} – ${k.name}` })).filter((k) => A.has(k.value) ? !1 : (A.add(k.value), !0));
|
|
10381
|
+
ae(w);
|
|
10382
|
+
const u = M.applicantRequestData;
|
|
10383
10383
|
if (pe({
|
|
10384
|
-
firstName: (
|
|
10385
|
-
lastName: (
|
|
10386
|
-
email: (
|
|
10387
|
-
dateOfBirth: (
|
|
10388
|
-
title: (
|
|
10389
|
-
salutation: (
|
|
10390
|
-
phonenumber: (
|
|
10391
|
-
mobileCountryCode: (
|
|
10392
|
-
street: (
|
|
10393
|
-
streetNumber: (
|
|
10394
|
-
city: (
|
|
10395
|
-
zip: (
|
|
10396
|
-
country: (
|
|
10397
|
-
nationality: (
|
|
10398
|
-
taxCountry: (
|
|
10399
|
-
countryOfBirth: (
|
|
10400
|
-
placeOfBirth: (
|
|
10401
|
-
educationLevel: (
|
|
10402
|
-
occupation: (
|
|
10403
|
-
taxNumber: (
|
|
10404
|
-
defaultLanguage: (
|
|
10384
|
+
firstName: (u == null ? void 0 : u.firstName) || "",
|
|
10385
|
+
lastName: (u == null ? void 0 : u.lastName) || "",
|
|
10386
|
+
email: (u == null ? void 0 : u.email) || "",
|
|
10387
|
+
dateOfBirth: (u == null ? void 0 : u.dateOfBirth) || "",
|
|
10388
|
+
title: (u == null ? void 0 : u.title) || "",
|
|
10389
|
+
salutation: (u == null ? void 0 : u.salutation) || "",
|
|
10390
|
+
phonenumber: (u == null ? void 0 : u.phonenumber) || "",
|
|
10391
|
+
mobileCountryCode: (u == null ? void 0 : u.mobileCountryCode) || "",
|
|
10392
|
+
street: (u == null ? void 0 : u.street) || "",
|
|
10393
|
+
streetNumber: (u == null ? void 0 : u.streetNumber) || "",
|
|
10394
|
+
city: (u == null ? void 0 : u.city) || "",
|
|
10395
|
+
zip: (u == null ? void 0 : u.zip) || "",
|
|
10396
|
+
country: (u == null ? void 0 : u.country) || "",
|
|
10397
|
+
nationality: (u == null ? void 0 : u.nationality) || "",
|
|
10398
|
+
taxCountry: (u == null ? void 0 : u.taxCountry) || "",
|
|
10399
|
+
countryOfBirth: (u == null ? void 0 : u.countryOfBirth) || "",
|
|
10400
|
+
placeOfBirth: (u == null ? void 0 : u.placeOfBirth) || "",
|
|
10401
|
+
educationLevel: (u == null ? void 0 : u.educationLevel) || "",
|
|
10402
|
+
occupation: (u == null ? void 0 : u.occupation) || "",
|
|
10403
|
+
taxNumber: (u == null ? void 0 : u.taxNumber) || "",
|
|
10404
|
+
defaultLanguage: (u == null ? void 0 : u.defaultLanguage) || ""
|
|
10405
10405
|
}), O.reset({
|
|
10406
|
-
street: (
|
|
10407
|
-
streetNumber: (
|
|
10408
|
-
city: (
|
|
10409
|
-
zip: (
|
|
10410
|
-
country: (
|
|
10411
|
-
nationality: (
|
|
10412
|
-
phonenumber: (
|
|
10413
|
-
}), M.kycRecords && M.kycRecords.length > 0 && M.kycRecords[0].providerTokenObject !== null && !H.current &&
|
|
10406
|
+
street: (u == null ? void 0 : u.street) || "",
|
|
10407
|
+
streetNumber: (u == null ? void 0 : u.streetNumber) || "",
|
|
10408
|
+
city: (u == null ? void 0 : u.city) || "",
|
|
10409
|
+
zip: (u == null ? void 0 : u.zip) || "",
|
|
10410
|
+
country: (u == null ? void 0 : u.country) || "",
|
|
10411
|
+
nationality: (u == null ? void 0 : u.nationality) || "",
|
|
10412
|
+
phonenumber: (u == null ? void 0 : u.phonenumber) || ""
|
|
10413
|
+
}), M.kycRecords && M.kycRecords.length > 0 && M.kycRecords[0].providerTokenObject !== null && !H.current && E.current) {
|
|
10414
10414
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), H.current = !0;
|
|
10415
10415
|
try {
|
|
10416
|
-
await
|
|
10416
|
+
await b(), Q(!0);
|
|
10417
10417
|
} catch (k) {
|
|
10418
10418
|
console.error("[Identity] Auto-request failed:", k);
|
|
10419
10419
|
}
|
|
@@ -10421,23 +10421,23 @@ const ma = ({
|
|
|
10421
10421
|
} catch (M) {
|
|
10422
10422
|
console.error("Error loading applicant data:", M);
|
|
10423
10423
|
} finally {
|
|
10424
|
-
|
|
10424
|
+
z(!1);
|
|
10425
10425
|
}
|
|
10426
10426
|
})();
|
|
10427
10427
|
}, [e]), fe(() => {
|
|
10428
|
-
d && !V &&
|
|
10428
|
+
d && !V && E.current && (console.log("[Identity] Review page disabled — showing cached provider"), Q(!0));
|
|
10429
10429
|
}, [d, V]), fe(() => {
|
|
10430
|
-
if (
|
|
10431
|
-
if (
|
|
10432
|
-
const f = new Date(
|
|
10430
|
+
if (h) {
|
|
10431
|
+
if (h.expiresAt) {
|
|
10432
|
+
const f = new Date(h.expiresAt).getTime();
|
|
10433
10433
|
if (Date.now() >= f) {
|
|
10434
10434
|
console.warn("[Identity] Token has expired (expiresAt)"), oe(!0), W(a("identity.sessionExpired"));
|
|
10435
10435
|
return;
|
|
10436
10436
|
}
|
|
10437
10437
|
}
|
|
10438
|
-
if (
|
|
10438
|
+
if (h.url)
|
|
10439
10439
|
try {
|
|
10440
|
-
const M = new URL(
|
|
10440
|
+
const M = new URL(h.url).toString().toLowerCase();
|
|
10441
10441
|
if (M.includes("expired") || M.includes("invalid") || M.includes("error")) {
|
|
10442
10442
|
console.warn("[Identity] Token URL indicates expiration"), oe(!0), W(a("identity.linkExpired"));
|
|
10443
10443
|
return;
|
|
@@ -10445,46 +10445,46 @@ const ma = ({
|
|
|
10445
10445
|
} catch {
|
|
10446
10446
|
console.error("[Identity] Invalid token URL");
|
|
10447
10447
|
}
|
|
10448
|
-
if (
|
|
10448
|
+
if (h.status === "expired" || h.error === "expired" || h.expired === !0) {
|
|
10449
10449
|
console.warn("[Identity] Token object indicates expiration"), oe(!0), W(a("identity.sessionExpired"));
|
|
10450
10450
|
return;
|
|
10451
10451
|
}
|
|
10452
10452
|
}
|
|
10453
|
-
}, [
|
|
10453
|
+
}, [h]);
|
|
10454
10454
|
const ke = y !== null && y === Be.Sumsub;
|
|
10455
10455
|
fe(() => {
|
|
10456
|
-
if (y !== null &&
|
|
10456
|
+
if (y !== null && h && !S && V && !_) {
|
|
10457
10457
|
const f = y;
|
|
10458
10458
|
if (ke) {
|
|
10459
10459
|
console.log("[Sumsub] Fetching access token for Web SDK…"), W(null), (async () => {
|
|
10460
10460
|
try {
|
|
10461
|
-
const M = await s.refreshSumsubToken(e), $ = et.parseProviderConfig(y,
|
|
10461
|
+
const M = await s.refreshSumsubToken(e), $ = et.parseProviderConfig(y, h, p);
|
|
10462
10462
|
$.accessToken = M, $.onTokenRefresh = () => s.refreshSumsubToken(e);
|
|
10463
10463
|
const Y = et.createProvider(y, $);
|
|
10464
10464
|
Y.onComplete((ee) => {
|
|
10465
10465
|
console.log("[Sumsub] Verification complete:", ee), t == null || t();
|
|
10466
10466
|
}), Y.onError((ee) => {
|
|
10467
10467
|
console.error("[Sumsub] SDK error:", ee), (typeof ee == "string" ? ee : (ee == null ? void 0 : ee.message) || "Unknown error").toLowerCase().includes("expired") && (oe(!0), W(a("identity.sessionExpiredRestart")));
|
|
10468
|
-
}), await Y.initialize("sumsub-websdk-container"), console.log("[Sumsub] Web SDK launched"),
|
|
10468
|
+
}), await Y.initialize("sumsub-websdk-container"), console.log("[Sumsub] Web SDK launched"), P(Y);
|
|
10469
10469
|
} catch (M) {
|
|
10470
10470
|
console.error("[Sumsub] Initialization error:", M), W(a("identity.failedToInitialize", { message: M.message || M })), String(M.message || M).toLowerCase().includes("expired") && oe(!0);
|
|
10471
10471
|
}
|
|
10472
10472
|
})();
|
|
10473
10473
|
return;
|
|
10474
10474
|
}
|
|
10475
|
-
if (
|
|
10476
|
-
console.log("[Identity] Loading provider URL for user verification:",
|
|
10475
|
+
if (h.url) {
|
|
10476
|
+
console.log("[Identity] Loading provider URL for user verification:", h.url), W(null);
|
|
10477
10477
|
try {
|
|
10478
|
-
if (new URL(
|
|
10478
|
+
if (new URL(h.url), f === Be.SardinAI) {
|
|
10479
10479
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
10480
10480
|
try {
|
|
10481
|
-
const M = et.parseProviderConfig(y,
|
|
10481
|
+
const M = et.parseProviderConfig(y, h, p);
|
|
10482
10482
|
et.createProvider(y, M).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((Y) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", Y));
|
|
10483
10483
|
} catch (M) {
|
|
10484
10484
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", M);
|
|
10485
10485
|
}
|
|
10486
10486
|
}
|
|
10487
|
-
|
|
10487
|
+
P({ type: "url", url: h.url });
|
|
10488
10488
|
} catch (M) {
|
|
10489
10489
|
console.error("[Identity] Invalid URL:", M), W(a("identity.invalidUrl")), oe(!0);
|
|
10490
10490
|
}
|
|
@@ -10493,9 +10493,9 @@ const ma = ({
|
|
|
10493
10493
|
if (f === Be.SardinAI) {
|
|
10494
10494
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), W(null);
|
|
10495
10495
|
try {
|
|
10496
|
-
const M = et.parseProviderConfig(y,
|
|
10496
|
+
const M = et.parseProviderConfig(y, h, p), $ = et.createProvider(y, M);
|
|
10497
10497
|
$.initialize().then(() => {
|
|
10498
|
-
console.log("[SardinAI] Risk SDK initialized successfully"),
|
|
10498
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), P($), setTimeout(() => t == null ? void 0 : t(), 2e3);
|
|
10499
10499
|
}).catch((Y) => {
|
|
10500
10500
|
var g;
|
|
10501
10501
|
console.error("[SardinAI] Failed to initialize:", Y);
|
|
@@ -10509,10 +10509,10 @@ const ma = ({
|
|
|
10509
10509
|
}
|
|
10510
10510
|
try {
|
|
10511
10511
|
W(null);
|
|
10512
|
-
const M = et.parseProviderConfig(y,
|
|
10512
|
+
const M = et.parseProviderConfig(y, h, p), $ = et.createProvider(y, M);
|
|
10513
10513
|
f === Be.Onfido && $.initialize("identity-container").catch((Y) => {
|
|
10514
10514
|
console.error("[Onfido] Initialization error:", Y), W(a("identity.failedToInitialize", { message: Y.message }));
|
|
10515
|
-
}),
|
|
10515
|
+
}), P($);
|
|
10516
10516
|
} catch (M) {
|
|
10517
10517
|
console.error("[Identity] Provider setup error:", M), W(a("identity.setupError", { message: M.message }));
|
|
10518
10518
|
}
|
|
@@ -10525,29 +10525,29 @@ const ma = ({
|
|
|
10525
10525
|
console.error("[Identity] Error destroying provider:", f);
|
|
10526
10526
|
}
|
|
10527
10527
|
};
|
|
10528
|
-
}, [y,
|
|
10528
|
+
}, [y, h, S, V, t, _, ke, e, p, s]);
|
|
10529
10529
|
const se = async () => {
|
|
10530
10530
|
try {
|
|
10531
|
-
W(null), oe(!1), await
|
|
10531
|
+
W(null), oe(!1), await b(), Q(!0);
|
|
10532
10532
|
} catch (f) {
|
|
10533
10533
|
console.error("Error starting identity verification:", f);
|
|
10534
10534
|
}
|
|
10535
|
-
},
|
|
10535
|
+
}, j = async () => {
|
|
10536
10536
|
try {
|
|
10537
|
-
W(null), oe(!1),
|
|
10537
|
+
W(null), oe(!1), P(null), console.log("[Identity] Restarting verification..."), await q(), Q(!0);
|
|
10538
10538
|
} catch (f) {
|
|
10539
10539
|
console.error("Error restarting identity verification:", f), W(f.message || a("identity.failedToRestart"));
|
|
10540
10540
|
}
|
|
10541
10541
|
};
|
|
10542
|
-
if (
|
|
10542
|
+
if (x || R)
|
|
10543
10543
|
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ie, { children: [
|
|
10544
10544
|
/* @__PURE__ */ r(Ve, { className: "my-8" }),
|
|
10545
10545
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: a("identity.loadingIdentity") })
|
|
10546
10546
|
] }) });
|
|
10547
|
-
if (
|
|
10547
|
+
if (L)
|
|
10548
10548
|
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
10549
10549
|
"Error: ",
|
|
10550
|
-
|
|
10550
|
+
L.message
|
|
10551
10551
|
] }) }) });
|
|
10552
10552
|
if (V && (X || _))
|
|
10553
10553
|
return /* @__PURE__ */ o(re, { children: [
|
|
@@ -10588,7 +10588,7 @@ const ma = ({
|
|
|
10588
10588
|
] }),
|
|
10589
10589
|
/* @__PURE__ */ o(Te, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
10590
10590
|
i && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: i, children: a("common.back") }),
|
|
10591
|
-
/* @__PURE__ */ r(G, { type: "button", onClick:
|
|
10591
|
+
/* @__PURE__ */ r(G, { type: "button", onClick: j, disabled: R, children: a(R ? "identity.restarting" : "identity.restartVerification") })
|
|
10592
10592
|
] })
|
|
10593
10593
|
] });
|
|
10594
10594
|
if (V && d) {
|
|
@@ -10623,8 +10623,8 @@ const ma = ({
|
|
|
10623
10623
|
"button",
|
|
10624
10624
|
{
|
|
10625
10625
|
type: "button",
|
|
10626
|
-
onClick:
|
|
10627
|
-
disabled:
|
|
10626
|
+
onClick: j,
|
|
10627
|
+
disabled: R,
|
|
10628
10628
|
style: {
|
|
10629
10629
|
padding: "6px 14px",
|
|
10630
10630
|
fontSize: "13px",
|
|
@@ -10633,10 +10633,10 @@ const ma = ({
|
|
|
10633
10633
|
border: "1px solid var(--metakyc-border, #d1d5db)",
|
|
10634
10634
|
background: "var(--metakyc-background, #ffffff)",
|
|
10635
10635
|
color: "var(--metakyc-text-primary, #111827)",
|
|
10636
|
-
cursor:
|
|
10637
|
-
opacity:
|
|
10636
|
+
cursor: R ? "not-allowed" : "pointer",
|
|
10637
|
+
opacity: R ? 0.5 : 1
|
|
10638
10638
|
},
|
|
10639
|
-
children: a(
|
|
10639
|
+
children: a(R ? "identity.restarting" : "identity.restart")
|
|
10640
10640
|
}
|
|
10641
10641
|
)
|
|
10642
10642
|
] }),
|
|
@@ -10656,7 +10656,7 @@ const ma = ({
|
|
|
10656
10656
|
padding: "16px 24px",
|
|
10657
10657
|
borderTop: "1px solid var(--metakyc-border, #e5e7eb)"
|
|
10658
10658
|
}, children: /* @__PURE__ */ r(G, { variant: "outline", onClick: i, children: a("common.back") }) })
|
|
10659
|
-
] }) :
|
|
10659
|
+
] }) : h != null && h.url ? /* @__PURE__ */ o(re, { children: [
|
|
10660
10660
|
/* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
10661
10661
|
/* @__PURE__ */ o("div", { children: [
|
|
10662
10662
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: a("identity.title") }),
|
|
@@ -10668,8 +10668,8 @@ const ma = ({
|
|
|
10668
10668
|
type: "button",
|
|
10669
10669
|
variant: "outline",
|
|
10670
10670
|
size: "sm",
|
|
10671
|
-
onClick:
|
|
10672
|
-
disabled:
|
|
10671
|
+
onClick: j,
|
|
10672
|
+
disabled: R,
|
|
10673
10673
|
children: a("identity.restart")
|
|
10674
10674
|
}
|
|
10675
10675
|
)
|
|
@@ -10679,7 +10679,7 @@ const ma = ({
|
|
|
10679
10679
|
/* @__PURE__ */ r("div", { className: "w-full", style: { height: "600px" }, children: /* @__PURE__ */ r(
|
|
10680
10680
|
"iframe",
|
|
10681
10681
|
{
|
|
10682
|
-
src:
|
|
10682
|
+
src: h.url,
|
|
10683
10683
|
className: "w-full h-full border-0 rounded-lg",
|
|
10684
10684
|
allow: "camera; microphone; geolocation",
|
|
10685
10685
|
title: "Identity Verification",
|
|
@@ -10687,10 +10687,10 @@ const ma = ({
|
|
|
10687
10687
|
var $, Y, ee;
|
|
10688
10688
|
console.log("[Identity] Iframe loaded");
|
|
10689
10689
|
try {
|
|
10690
|
-
const g = M.target,
|
|
10691
|
-
if (
|
|
10692
|
-
const
|
|
10693
|
-
(
|
|
10690
|
+
const g = M.target, A = g.contentDocument || (($ = g.contentWindow) == null ? void 0 : $.document);
|
|
10691
|
+
if (A) {
|
|
10692
|
+
const w = ((ee = (Y = A.body) == null ? void 0 : Y.textContent) == null ? void 0 : ee.toLowerCase()) || "";
|
|
10693
|
+
(w.includes("expired") || w.includes("invalid") || w.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), oe(!0), W(a("identity.linkExpired")));
|
|
10694
10694
|
}
|
|
10695
10695
|
} catch {
|
|
10696
10696
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -10730,7 +10730,7 @@ const ma = ({
|
|
|
10730
10730
|
}
|
|
10731
10731
|
return String(M);
|
|
10732
10732
|
}, Ae = ({ helpText: f }) => {
|
|
10733
|
-
const [M, $] =
|
|
10733
|
+
const [M, $] = v(!1), Y = de(null), [, ee] = v({ top: 0, left: 0 });
|
|
10734
10734
|
return /* @__PURE__ */ o(ut, { children: [
|
|
10735
10735
|
/* @__PURE__ */ r(
|
|
10736
10736
|
"button",
|
|
@@ -10740,8 +10740,8 @@ const ma = ({
|
|
|
10740
10740
|
ref: Y,
|
|
10741
10741
|
onClick: () => {
|
|
10742
10742
|
if (Y.current) {
|
|
10743
|
-
const
|
|
10744
|
-
ee({ top:
|
|
10743
|
+
const A = Y.current.getBoundingClientRect();
|
|
10744
|
+
ee({ top: A.bottom + window.scrollY + 6, left: A.left + window.scrollX });
|
|
10745
10745
|
}
|
|
10746
10746
|
$(!0);
|
|
10747
10747
|
},
|
|
@@ -10785,7 +10785,7 @@ const ma = ({
|
|
|
10785
10785
|
children: /* @__PURE__ */ o(
|
|
10786
10786
|
"div",
|
|
10787
10787
|
{
|
|
10788
|
-
onClick: (
|
|
10788
|
+
onClick: (A) => A.stopPropagation(),
|
|
10789
10789
|
style: {
|
|
10790
10790
|
background: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
|
|
10791
10791
|
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
@@ -10871,7 +10871,7 @@ const ma = ({
|
|
|
10871
10871
|
Ue,
|
|
10872
10872
|
{
|
|
10873
10873
|
checked: !!g,
|
|
10874
|
-
onChange: (
|
|
10874
|
+
onChange: (A) => xe((w) => ({ ...w, [Y]: String(A) })),
|
|
10875
10875
|
style: { marginTop: 2 }
|
|
10876
10876
|
}
|
|
10877
10877
|
),
|
|
@@ -10884,26 +10884,26 @@ const ma = ({
|
|
|
10884
10884
|
) }, $);
|
|
10885
10885
|
}
|
|
10886
10886
|
if (f.customType === "group_checkbox") {
|
|
10887
|
-
const g = Array.isArray(ee) ? ee : ee ? [ee] : [],
|
|
10888
|
-
f.singleSelect ? xe((
|
|
10889
|
-
...
|
|
10890
|
-
[Y]: g.includes(
|
|
10887
|
+
const g = Array.isArray(ee) ? ee : ee ? [ee] : [], A = (w) => {
|
|
10888
|
+
f.singleSelect ? xe((u) => ({ ...u, [Y]: g[0] === w ? [] : [w] })) : xe((u) => ({
|
|
10889
|
+
...u,
|
|
10890
|
+
[Y]: g.includes(w) ? g.filter((c) => c !== w) : [...g, w]
|
|
10891
10891
|
}));
|
|
10892
10892
|
};
|
|
10893
10893
|
return /* @__PURE__ */ r("div", { style: Z(f.colSpan), children: ze(
|
|
10894
10894
|
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
10895
10895
|
f.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: f.displayText || f.label }),
|
|
10896
|
-
(f.options || []).map((
|
|
10896
|
+
(f.options || []).map((w) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
10897
10897
|
/* @__PURE__ */ r(
|
|
10898
10898
|
Ue,
|
|
10899
10899
|
{
|
|
10900
|
-
checked: g.includes(
|
|
10901
|
-
onChange: () =>
|
|
10900
|
+
checked: g.includes(w.value),
|
|
10901
|
+
onChange: () => A(w.value),
|
|
10902
10902
|
style: { marginTop: 2 }
|
|
10903
10903
|
}
|
|
10904
10904
|
),
|
|
10905
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
10906
|
-
] },
|
|
10905
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: w.label })
|
|
10906
|
+
] }, w.value))
|
|
10907
10907
|
] }),
|
|
10908
10908
|
f.helpText
|
|
10909
10909
|
) }, $);
|
|
@@ -10919,7 +10919,7 @@ const ma = ({
|
|
|
10919
10919
|
name: `rg-${Y}`,
|
|
10920
10920
|
value: g.value,
|
|
10921
10921
|
checked: ee === g.value,
|
|
10922
|
-
onChange: () => xe((
|
|
10922
|
+
onChange: () => xe((A) => ({ ...A, [Y]: g.value })),
|
|
10923
10923
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
10924
10924
|
}
|
|
10925
10925
|
),
|
|
@@ -10933,32 +10933,32 @@ const ma = ({
|
|
|
10933
10933
|
{
|
|
10934
10934
|
label: f.displayText || f.label || Y,
|
|
10935
10935
|
value: String(ee ?? ""),
|
|
10936
|
-
onChange: (g) => xe((
|
|
10936
|
+
onChange: (g) => xe((A) => ({ ...A, [Y]: g.target.value }))
|
|
10937
10937
|
}
|
|
10938
10938
|
),
|
|
10939
10939
|
f.helpText
|
|
10940
10940
|
) }, $);
|
|
10941
10941
|
}, lt = (f, M) => {
|
|
10942
10942
|
if (f.isCustom) return We(f, M);
|
|
10943
|
-
const $ = f.name ?? "", Y = st[$], ee = f.displayText || (Y == null ? void 0 : Y.label) || $, g = Me[$] ?? "",
|
|
10944
|
-
return f.editable ?
|
|
10943
|
+
const $ = f.name ?? "", Y = st[$], ee = f.displayText || (Y == null ? void 0 : Y.label) || $, g = Me[$] ?? "", A = $ === "mobileCountryCode", w = !!(Y != null && Y.countriesType) && !A;
|
|
10944
|
+
return f.editable ? A ? /* @__PURE__ */ r("div", { style: Z(f.colSpan ?? 2), children: ze(
|
|
10945
10945
|
/* @__PURE__ */ r(
|
|
10946
10946
|
Ge,
|
|
10947
10947
|
{
|
|
10948
10948
|
label: ee,
|
|
10949
10949
|
value: String(g),
|
|
10950
|
-
onChange: (
|
|
10950
|
+
onChange: (u) => pe((c) => ({ ...c, [$]: u })),
|
|
10951
10951
|
options: [{ value: "", label: a("placeholders.selectCountryCode") }, ...J]
|
|
10952
10952
|
}
|
|
10953
10953
|
),
|
|
10954
10954
|
f.helpText
|
|
10955
|
-
) }, `epc-${M}`) :
|
|
10955
|
+
) }, `epc-${M}`) : w ? /* @__PURE__ */ r("div", { style: Z(f.colSpan ?? 2), children: ze(
|
|
10956
10956
|
/* @__PURE__ */ r(
|
|
10957
10957
|
Ge,
|
|
10958
10958
|
{
|
|
10959
10959
|
label: ee,
|
|
10960
10960
|
value: String(g),
|
|
10961
|
-
onChange: (
|
|
10961
|
+
onChange: (u) => pe((c) => ({ ...c, [$]: u })),
|
|
10962
10962
|
options: [{ value: "", label: a("common.select") }, ...U]
|
|
10963
10963
|
}
|
|
10964
10964
|
),
|
|
@@ -10970,7 +10970,7 @@ const ma = ({
|
|
|
10970
10970
|
label: ee,
|
|
10971
10971
|
type: (Y == null ? void 0 : Y.type) === "date" ? "date" : (Y == null ? void 0 : Y.type) === "email" ? "email" : "text",
|
|
10972
10972
|
value: String(g),
|
|
10973
|
-
onChange: (
|
|
10973
|
+
onChange: (u) => pe((c) => ({ ...c, [$]: u.target.value }))
|
|
10974
10974
|
}
|
|
10975
10975
|
),
|
|
10976
10976
|
f.helpText
|
|
@@ -10994,7 +10994,7 @@ const ma = ({
|
|
|
10994
10994
|
/* @__PURE__ */ r(ie, { children: /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: me.fields.map(($, Y) => lt($, Y)) }) }),
|
|
10995
10995
|
/* @__PURE__ */ o(Te, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
10996
10996
|
i && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: i, children: a("common.back") }),
|
|
10997
|
-
/* @__PURE__ */ r(G, { type: "submit", isLoading:
|
|
10997
|
+
/* @__PURE__ */ r(G, { type: "submit", isLoading: R, children: a("identity.confirmAndStart") })
|
|
10998
10998
|
] })
|
|
10999
10999
|
] }) });
|
|
11000
11000
|
}
|
|
@@ -11061,7 +11061,7 @@ const ma = ({
|
|
|
11061
11061
|
] }),
|
|
11062
11062
|
/* @__PURE__ */ o(Te, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
11063
11063
|
i && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: i, children: a("common.back") }),
|
|
11064
|
-
/* @__PURE__ */ r(G, { type: "submit", isLoading:
|
|
11064
|
+
/* @__PURE__ */ r(G, { type: "submit", isLoading: R, children: a("identity.confirmAndStart") })
|
|
11065
11065
|
] })
|
|
11066
11066
|
] }) });
|
|
11067
11067
|
}, Yt = ({
|
|
@@ -11072,7 +11072,7 @@ const ma = ({
|
|
|
11072
11072
|
onContinue: n,
|
|
11073
11073
|
onContactSupport: l
|
|
11074
11074
|
}) => {
|
|
11075
|
-
const { t: s } = Re(),
|
|
11075
|
+
const { t: s } = Re(), m = e === nt.Approved ? {
|
|
11076
11076
|
type: "success",
|
|
11077
11077
|
title: s("status.verificationApproved"),
|
|
11078
11078
|
icon: "✓",
|
|
@@ -11148,20 +11148,20 @@ const ma = ({
|
|
|
11148
11148
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
11149
11149
|
"div",
|
|
11150
11150
|
{
|
|
11151
|
-
className: `w-24 h-24 rounded-full flex items-center justify-center ${
|
|
11152
|
-
children: /* @__PURE__ */ r("span", { className: `text-5xl ${
|
|
11151
|
+
className: `w-24 h-24 rounded-full flex items-center justify-center ${m.iconBg}`,
|
|
11152
|
+
children: /* @__PURE__ */ r("span", { className: `text-5xl ${m.iconColor}`, children: m.icon })
|
|
11153
11153
|
}
|
|
11154
11154
|
) }),
|
|
11155
|
-
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
11155
|
+
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children: m.title }),
|
|
11156
11156
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
11157
11157
|
rr,
|
|
11158
11158
|
{
|
|
11159
|
-
variant:
|
|
11159
|
+
variant: m.type === "success" ? "success" : m.type === "error" ? "danger" : m.type === "pending" ? "warning" : "info",
|
|
11160
11160
|
children: e != null ? nt[e] : ot[t]
|
|
11161
11161
|
}
|
|
11162
11162
|
) }),
|
|
11163
|
-
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a ||
|
|
11164
|
-
|
|
11163
|
+
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a || m.message }),
|
|
11164
|
+
m.type === "success" && /* @__PURE__ */ o("div", { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6", children: [
|
|
11165
11165
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: s("status.whatsNext") }),
|
|
11166
11166
|
/* @__PURE__ */ o("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
|
|
11167
11167
|
/* @__PURE__ */ o("li", { children: [
|
|
@@ -11178,7 +11178,7 @@ const ma = ({
|
|
|
11178
11178
|
] })
|
|
11179
11179
|
] })
|
|
11180
11180
|
] }),
|
|
11181
|
-
|
|
11181
|
+
m.type === "error" && /* @__PURE__ */ o("div", { className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mb-6", children: [
|
|
11182
11182
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-2", children: s("status.whatCanYouDo") }),
|
|
11183
11183
|
/* @__PURE__ */ o("ul", { className: "text-sm text-red-800 dark:text-red-200 space-y-2", children: [
|
|
11184
11184
|
/* @__PURE__ */ o("li", { children: [
|
|
@@ -11195,7 +11195,7 @@ const ma = ({
|
|
|
11195
11195
|
] })
|
|
11196
11196
|
] })
|
|
11197
11197
|
] }),
|
|
11198
|
-
|
|
11198
|
+
m.type === "pending" && /* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-6", children: [
|
|
11199
11199
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-blue-900 dark:text-blue-100 mb-2", children: s("status.whatHappensNext") }),
|
|
11200
11200
|
/* @__PURE__ */ o("ul", { className: "text-sm text-blue-800 dark:text-blue-200 space-y-2", children: [
|
|
11201
11201
|
/* @__PURE__ */ o("li", { children: [
|
|
@@ -11224,12 +11224,12 @@ const ma = ({
|
|
|
11224
11224
|
] }) })
|
|
11225
11225
|
] }),
|
|
11226
11226
|
/* @__PURE__ */ o(Te, { style: { display: "flex", justifyContent: "center", gap: "1rem" }, children: [
|
|
11227
|
-
|
|
11228
|
-
|
|
11227
|
+
m.type === "success" && n && /* @__PURE__ */ r(G, { onClick: n, size: "lg", children: s("common.continue") }),
|
|
11228
|
+
m.type === "error" && /* @__PURE__ */ o(ut, { children: [
|
|
11229
11229
|
l && /* @__PURE__ */ r(G, { variant: "outline", onClick: l, children: s("status.contactSupport") }),
|
|
11230
11230
|
n && /* @__PURE__ */ r(G, { onClick: n, children: s("status.tryAgain") })
|
|
11231
11231
|
] }),
|
|
11232
|
-
|
|
11232
|
+
m.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: s("status.checkBackLater") }) })
|
|
11233
11233
|
] })
|
|
11234
11234
|
] });
|
|
11235
11235
|
}, ya = ({ config: e, className: t = "" }) => {
|
|
@@ -11255,16 +11255,16 @@ const ma = ({
|
|
|
11255
11255
|
subtitle: t,
|
|
11256
11256
|
className: i = ""
|
|
11257
11257
|
}) => {
|
|
11258
|
-
const { currentTheme: a } = Oe(), { t: n } = Re(), l = e || (a == null ? void 0 : a.title) || "", s = ve(l, n), p = ve(t, n),
|
|
11259
|
-
return !
|
|
11258
|
+
const { currentTheme: a } = Oe(), { t: n } = Re(), l = e || (a == null ? void 0 : a.title) || "", s = ve(l, n), p = ve(t, n), m = !!(a != null && a.logo && a.logo.visible && a.logo.url), d = !!s;
|
|
11259
|
+
return !m && !d ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${i}`, children: [
|
|
11260
11260
|
/* @__PURE__ */ o(
|
|
11261
11261
|
"div",
|
|
11262
11262
|
{
|
|
11263
11263
|
className: "metakyc-header-title flex items-center text-xl font-bold",
|
|
11264
11264
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
11265
11265
|
children: [
|
|
11266
|
-
|
|
11267
|
-
|
|
11266
|
+
m && /* @__PURE__ */ r(ya, { config: a.logo }),
|
|
11267
|
+
m && d && /* @__PURE__ */ r(
|
|
11268
11268
|
"span",
|
|
11269
11269
|
{
|
|
11270
11270
|
style: { fontSize: "1.5rem", fontWeight: 300, color: "var(--metakyc-text-muted, #9ca3af)", margin: "0 12px" },
|
|
@@ -11420,36 +11420,36 @@ const fa = {
|
|
|
11420
11420
|
onSuccess: i,
|
|
11421
11421
|
onCancel: a
|
|
11422
11422
|
}) => {
|
|
11423
|
-
var $, Y, ee, g,
|
|
11424
|
-
const { config: n, baseInformationService: l, currentTheme: s } = Oe(), { createApplicant: p, isLoading:
|
|
11423
|
+
var $, Y, ee, g, A, w, u;
|
|
11424
|
+
const { config: n, baseInformationService: l, currentTheme: s } = Oe(), { createApplicant: p, isLoading: m } = tr(), { t: d } = Re(), y = e || (($ = n.applicantForm) == null ? void 0 : $.workflowKey);
|
|
11425
11425
|
if (!y)
|
|
11426
11426
|
throw new Error(
|
|
11427
11427
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
11428
11428
|
);
|
|
11429
|
-
const
|
|
11429
|
+
const h = t || ((Y = n.applicantForm) == null ? void 0 : Y.externalRefId) || "", R = ((ee = n.applicantForm) == null ? void 0 : ee.email) || "", L = ((g = n.applicantForm) == null ? void 0 : g.hiddenValues) || {}, b = ((A = n.applicantForm) == null ? void 0 : A.initialValues) || {}, S = (((w = n.applicantForm) == null ? void 0 : w.fieldLabelMode) || (s == null ? void 0 : s.fieldLabelMode) || "label") !== "placeholder", P = Fe(
|
|
11430
11430
|
() => s != null && s.applicantFormPages && s.applicantFormPages.length > 0 ? s.applicantFormPages : null,
|
|
11431
11431
|
[s == null ? void 0 : s.applicantFormPages]
|
|
11432
11432
|
), B = Fe(() => {
|
|
11433
11433
|
const c = new Set(vt), k = s == null ? void 0 : s.applicantFormRequiredFields;
|
|
11434
|
-
if (k) for (const
|
|
11435
|
-
if (
|
|
11436
|
-
for (const
|
|
11437
|
-
for (const
|
|
11438
|
-
!
|
|
11434
|
+
if (k) for (const C of k) c.add(C);
|
|
11435
|
+
if (P)
|
|
11436
|
+
for (const C of P)
|
|
11437
|
+
for (const I of C.fields)
|
|
11438
|
+
!I.isCustom && I.name && I.required && c.add(I.name);
|
|
11439
11439
|
return Array.from(c);
|
|
11440
|
-
}, [s == null ? void 0 : s.applicantFormRequiredFields,
|
|
11441
|
-
var
|
|
11442
|
-
if (
|
|
11443
|
-
const
|
|
11444
|
-
for (const
|
|
11440
|
+
}, [s == null ? void 0 : s.applicantFormRequiredFields, P]), F = Fe(() => {
|
|
11441
|
+
var C;
|
|
11442
|
+
if (P) {
|
|
11443
|
+
const I = P.flatMap((T) => T.fields).filter((T) => !T.isCustom && T.name).map((T) => T.name), N = new Set(I);
|
|
11444
|
+
for (const T of vt) N.add(T);
|
|
11445
11445
|
return Array.from(N);
|
|
11446
11446
|
}
|
|
11447
11447
|
let c;
|
|
11448
|
-
(
|
|
11448
|
+
(C = n.applicantForm) != null && C.visibleFields ? c = n.applicantForm.visibleFields : s != null && s.applicantFormVisibleFields && s.applicantFormVisibleFields.length > 0 ? c = s.applicantFormVisibleFields : c = Cr;
|
|
11449
11449
|
const k = new Set(c);
|
|
11450
|
-
for (const
|
|
11450
|
+
for (const I of vt) k.add(I);
|
|
11451
11451
|
return Array.from(k);
|
|
11452
|
-
}, [(
|
|
11452
|
+
}, [(u = n.applicantForm) == null ? void 0 : u.visibleFields, s == null ? void 0 : s.applicantFormVisibleFields, P]), U = /* @__PURE__ */ new Set([
|
|
11453
11453
|
"country",
|
|
11454
11454
|
"nationality",
|
|
11455
11455
|
"taxCountry",
|
|
@@ -11457,58 +11457,58 @@ const fa = {
|
|
|
11457
11457
|
"mobileCountryCode",
|
|
11458
11458
|
"otherNationality"
|
|
11459
11459
|
]), K = Fe(() => {
|
|
11460
|
-
var k,
|
|
11460
|
+
var k, C;
|
|
11461
11461
|
const c = /* @__PURE__ */ new Set();
|
|
11462
|
-
if (
|
|
11463
|
-
for (const
|
|
11464
|
-
for (const N of
|
|
11462
|
+
if (P)
|
|
11463
|
+
for (const I of P)
|
|
11464
|
+
for (const N of I.fields)
|
|
11465
11465
|
!N.isCustom && N.name && U.has(N.name) && c.add(N.countriesType ?? ((k = st[N.name]) == null ? void 0 : k.countriesType));
|
|
11466
11466
|
else
|
|
11467
|
-
for (const
|
|
11468
|
-
U.has(
|
|
11467
|
+
for (const I of F)
|
|
11468
|
+
U.has(I) && c.add((C = st[I]) == null ? void 0 : C.countriesType);
|
|
11469
11469
|
return c.size === 0 && c.add(void 0), Array.from(c);
|
|
11470
|
-
}, [F,
|
|
11470
|
+
}, [F, P]), [J, ae] = v({}), [x, z] = v(!0), V = de(/* @__PURE__ */ new Set()), Q = de(/* @__PURE__ */ new Set());
|
|
11471
11471
|
fe(() => {
|
|
11472
11472
|
if (!s) return;
|
|
11473
|
-
const c = K.filter((
|
|
11474
|
-
const N =
|
|
11473
|
+
const c = K.filter((I) => {
|
|
11474
|
+
const N = I != null ? String(I) : "all";
|
|
11475
11475
|
return !Q.current.has(N) && !V.current.has(N);
|
|
11476
11476
|
});
|
|
11477
11477
|
if (c.length === 0) {
|
|
11478
11478
|
K.every((N) => {
|
|
11479
|
-
const
|
|
11480
|
-
return Q.current.has(
|
|
11481
|
-
}) &&
|
|
11479
|
+
const T = N != null ? String(N) : "all";
|
|
11480
|
+
return Q.current.has(T);
|
|
11481
|
+
}) && z(!1);
|
|
11482
11482
|
return;
|
|
11483
11483
|
}
|
|
11484
|
-
|
|
11485
|
-
const k = c.map((
|
|
11486
|
-
k.forEach((
|
|
11484
|
+
z(!0);
|
|
11485
|
+
const k = c.map((I) => I != null ? String(I) : "all");
|
|
11486
|
+
k.forEach((I) => V.current.add(I)), (async () => {
|
|
11487
11487
|
try {
|
|
11488
|
-
const
|
|
11488
|
+
const I = await Promise.all(
|
|
11489
11489
|
c.map(async (N) => {
|
|
11490
|
-
const
|
|
11490
|
+
const T = N != null ? String(N) : "all", ue = await l.getCountries("", n.locale || "en", N), le = N === 40, we = /* @__PURE__ */ new Set(), be = ue.map((he) => le && he.countryCode ? {
|
|
11491
11491
|
value: he.countryCode,
|
|
11492
11492
|
label: `${he.countryCode} – ${he.name}`
|
|
11493
11493
|
} : { value: he.abbreviation3 || he.abbreviation, label: he.name }).filter((he) => !he.value || we.has(he.value) ? !1 : (we.add(he.value), !0));
|
|
11494
|
-
return Q.current.add(
|
|
11494
|
+
return Q.current.add(T), V.current.delete(T), [T, be];
|
|
11495
11495
|
})
|
|
11496
11496
|
);
|
|
11497
|
-
ae((N) => ({ ...N, ...Object.fromEntries(
|
|
11498
|
-
} catch (
|
|
11499
|
-
k.forEach((N) => V.current.delete(N)), console.error("Failed to load countries:",
|
|
11497
|
+
ae((N) => ({ ...N, ...Object.fromEntries(I) }));
|
|
11498
|
+
} catch (I) {
|
|
11499
|
+
k.forEach((N) => V.current.delete(N)), console.error("Failed to load countries:", I);
|
|
11500
11500
|
} finally {
|
|
11501
11501
|
K.every((N) => {
|
|
11502
|
-
const
|
|
11503
|
-
return Q.current.has(
|
|
11504
|
-
}) &&
|
|
11502
|
+
const T = N != null ? String(N) : "all";
|
|
11503
|
+
return Q.current.has(T);
|
|
11504
|
+
}) && z(!1);
|
|
11505
11505
|
}
|
|
11506
11506
|
})();
|
|
11507
11507
|
}, [K, s]);
|
|
11508
11508
|
const X = (c, k) => {
|
|
11509
11509
|
var N;
|
|
11510
|
-
const
|
|
11511
|
-
return J[
|
|
11510
|
+
const C = k ?? ((N = st[c]) == null ? void 0 : N.countriesType), I = C != null ? String(C) : "all";
|
|
11511
|
+
return J[I] || [];
|
|
11512
11512
|
}, W = {
|
|
11513
11513
|
firstName: 1,
|
|
11514
11514
|
lastName: 1,
|
|
@@ -11533,18 +11533,18 @@ const fa = {
|
|
|
11533
11533
|
occupation: 1,
|
|
11534
11534
|
taxNumber: 1
|
|
11535
11535
|
}, _ = Object.fromEntries(
|
|
11536
|
-
Object.entries(
|
|
11536
|
+
Object.entries(L).filter(([c]) => c in W)
|
|
11537
11537
|
), oe = Object.fromEntries(
|
|
11538
|
-
Object.entries(
|
|
11539
|
-
), [H, Me] =
|
|
11538
|
+
Object.entries(b).filter(([c]) => c in W)
|
|
11539
|
+
), [H, Me] = v({
|
|
11540
11540
|
workflowKey: y,
|
|
11541
11541
|
firstName: "",
|
|
11542
11542
|
lastName: "",
|
|
11543
11543
|
title: "",
|
|
11544
|
-
email:
|
|
11544
|
+
email: R,
|
|
11545
11545
|
dateOfBirth: "",
|
|
11546
11546
|
phonenumber: "",
|
|
11547
|
-
externalRefId:
|
|
11547
|
+
externalRefId: h,
|
|
11548
11548
|
mobileCountryCode: "",
|
|
11549
11549
|
street: "",
|
|
11550
11550
|
streetNumber: "",
|
|
@@ -11564,30 +11564,29 @@ const fa = {
|
|
|
11564
11564
|
..._,
|
|
11565
11565
|
...oe
|
|
11566
11566
|
}), pe = Object.fromEntries(
|
|
11567
|
-
Object.entries(
|
|
11568
|
-
), [ge, xe] =
|
|
11569
|
-
var j;
|
|
11567
|
+
Object.entries(L).filter(([c]) => !(c in _) && c !== "externalRefId" && c !== "workflowKey")
|
|
11568
|
+
), [ge, xe] = v({ ...pe }), [me, D] = v(0), [E, O] = v({}), [ke, se] = v(null), [j, ne] = v(!1), Z = (c, k) => Me((C) => ({ ...C, [c]: k })), Ie = (c, k) => xe((C) => ({ ...C, [c]: k })), Ae = (c) => !c.conditionalOn || ge[c.conditionalOn] === "true", ze = P && me < P.length - 1 ? me + 1 : -1, We = P && me > 0 ? me - 1 : -1, lt = (c) => {
|
|
11570
11569
|
const k = {};
|
|
11571
|
-
for (const
|
|
11572
|
-
if (
|
|
11573
|
-
if (
|
|
11574
|
-
if (
|
|
11575
|
-
const
|
|
11576
|
-
|
|
11570
|
+
for (const C of c.fields)
|
|
11571
|
+
if (C.isCustom) {
|
|
11572
|
+
if (C.customType === "paragraph" || C.customType === "html" || C.customType === "br" || C.customType === "link") continue;
|
|
11573
|
+
if (C.required && C.paramName) {
|
|
11574
|
+
const I = ge[C.paramName], N = ve(C.displayText, d) || ve(C.label, d) || C.paramName;
|
|
11575
|
+
C.customType === "checkbox" || C.customType === "link_checkbox" ? I !== "true" && (k[C.paramName] = d("validation.fieldRequired", { field: N })) : (!I || I.trim() === "") && (k[C.paramName] = d("validation.fieldRequired", { field: N }));
|
|
11577
11576
|
}
|
|
11578
|
-
} else if (
|
|
11579
|
-
const
|
|
11580
|
-
if (B.includes(
|
|
11581
|
-
const
|
|
11582
|
-
k[
|
|
11577
|
+
} else if (C.name) {
|
|
11578
|
+
const I = C.name;
|
|
11579
|
+
if (B.includes(I) && mt(H[I])) {
|
|
11580
|
+
const N = st[I], T = ve(C.displayText, d) || (N != null && N.translationKey ? d(`fields.${N.translationKey}`) : void 0) || (N == null ? void 0 : N.label) || I;
|
|
11581
|
+
k[I] = d("validation.fieldRequired", { field: T });
|
|
11583
11582
|
}
|
|
11584
11583
|
}
|
|
11585
11584
|
return k;
|
|
11586
11585
|
}, rt = async () => {
|
|
11587
|
-
if (!
|
|
11588
|
-
const c =
|
|
11586
|
+
if (!P) return;
|
|
11587
|
+
const c = P[me];
|
|
11589
11588
|
if (c.conditionalOn && !Ae(c)) {
|
|
11590
|
-
O({}), ze >= 0 ?
|
|
11589
|
+
O({}), ze >= 0 ? D(ze) : await Ke();
|
|
11591
11590
|
return;
|
|
11592
11591
|
}
|
|
11593
11592
|
const k = lt(c);
|
|
@@ -11595,11 +11594,11 @@ const fa = {
|
|
|
11595
11594
|
O(k);
|
|
11596
11595
|
return;
|
|
11597
11596
|
}
|
|
11598
|
-
O({}), ze >= 0 ?
|
|
11597
|
+
O({}), ze >= 0 ? D(ze) : await Ke();
|
|
11599
11598
|
}, Ke = async () => {
|
|
11600
|
-
if (
|
|
11599
|
+
if (P) {
|
|
11601
11600
|
let c = {};
|
|
11602
|
-
for (const k of
|
|
11601
|
+
for (const k of P)
|
|
11603
11602
|
Ae(k) && (c = { ...c, ...lt(k) });
|
|
11604
11603
|
if (Object.keys(c).length > 0) {
|
|
11605
11604
|
O(c);
|
|
@@ -11616,72 +11615,71 @@ const fa = {
|
|
|
11616
11615
|
workflowKey: H.workflowKey,
|
|
11617
11616
|
externalRefId: H.externalRefId.trim()
|
|
11618
11617
|
};
|
|
11619
|
-
if (
|
|
11620
|
-
for (const N of
|
|
11618
|
+
if (P) {
|
|
11619
|
+
for (const N of P)
|
|
11621
11620
|
if (Ae(N)) {
|
|
11622
|
-
for (const
|
|
11623
|
-
if (!
|
|
11624
|
-
const ue =
|
|
11621
|
+
for (const T of N.fields)
|
|
11622
|
+
if (!T.isCustom && T.name) {
|
|
11623
|
+
const ue = T.name, le = H[ue];
|
|
11625
11624
|
mt(le) || (c[ue] = le);
|
|
11626
11625
|
}
|
|
11627
11626
|
}
|
|
11628
11627
|
for (const N of vt)
|
|
11629
11628
|
if (c[N] === void 0) {
|
|
11630
|
-
const
|
|
11631
|
-
mt(
|
|
11629
|
+
const T = H[N];
|
|
11630
|
+
mt(T) || (c[N] = T);
|
|
11632
11631
|
}
|
|
11633
11632
|
} else
|
|
11634
11633
|
F.forEach((N) => {
|
|
11635
11634
|
if (N === "externalRefId") return;
|
|
11636
|
-
const
|
|
11637
|
-
mt(
|
|
11635
|
+
const T = H[N];
|
|
11636
|
+
mt(T) || (c[N] = T);
|
|
11638
11637
|
});
|
|
11639
11638
|
const k = [];
|
|
11640
|
-
if (
|
|
11641
|
-
for (const N of
|
|
11639
|
+
if (P) {
|
|
11640
|
+
for (const N of P)
|
|
11642
11641
|
if (Ae(N))
|
|
11643
|
-
for (const
|
|
11644
|
-
if (!
|
|
11645
|
-
const ue = ge[
|
|
11642
|
+
for (const T of N.fields) {
|
|
11643
|
+
if (!T.isCustom || !T.paramName || T.customType === "paragraph" || T.customType === "html" || T.customType === "br" || T.customType === "link") continue;
|
|
11644
|
+
const ue = ge[T.paramName] ?? "";
|
|
11646
11645
|
let le;
|
|
11647
|
-
if (
|
|
11646
|
+
if (T.customType === "checkbox" || T.customType === "link_checkbox")
|
|
11648
11647
|
le = ue === "true" ? "yes" : "no";
|
|
11649
|
-
else if (le = ue, !le && !
|
|
11650
|
-
k.push({ paramName:
|
|
11648
|
+
else if (le = ue, !le && !T.required) continue;
|
|
11649
|
+
k.push({ paramName: T.paramName, value: le });
|
|
11651
11650
|
}
|
|
11652
11651
|
}
|
|
11653
|
-
for (const [N,
|
|
11654
|
-
c[N] === void 0 && !mt(
|
|
11655
|
-
const
|
|
11656
|
-
for (const [N,
|
|
11657
|
-
!
|
|
11652
|
+
for (const [N, T] of Object.entries(_))
|
|
11653
|
+
c[N] === void 0 && !mt(T) && (c[N] = T);
|
|
11654
|
+
const C = new Set(k.map((N) => N.paramName));
|
|
11655
|
+
for (const [N, T] of Object.entries(pe))
|
|
11656
|
+
!C.has(N) && T && k.push({ paramName: N, value: T });
|
|
11658
11657
|
k.length > 0 && (c.applicantAdditionalDatas = k);
|
|
11659
|
-
const
|
|
11660
|
-
i(
|
|
11658
|
+
const I = await p(c);
|
|
11659
|
+
i(I.applicantId);
|
|
11661
11660
|
} catch (c) {
|
|
11662
11661
|
console.error("Error creating applicant:", c), se(c.message || d("createApplicant.failedToCreate"));
|
|
11663
11662
|
} finally {
|
|
11664
11663
|
ne(!1);
|
|
11665
11664
|
}
|
|
11666
11665
|
}, ct = async (c) => {
|
|
11667
|
-
var k;
|
|
11668
11666
|
c.preventDefault();
|
|
11669
|
-
for (const
|
|
11670
|
-
if (mt(H[
|
|
11671
|
-
const
|
|
11672
|
-
se(d("validation.fieldRequired", { field:
|
|
11667
|
+
for (const k of B)
|
|
11668
|
+
if (mt(H[k])) {
|
|
11669
|
+
const C = st[k], I = (C != null && C.translationKey ? d(`fields.${C.translationKey}`) : void 0) || (C == null ? void 0 : C.label) || k;
|
|
11670
|
+
se(d("validation.fieldRequired", { field: I }));
|
|
11673
11671
|
return;
|
|
11674
11672
|
}
|
|
11675
11673
|
await Ke();
|
|
11676
|
-
}, Xe = (c, k,
|
|
11674
|
+
}, Xe = (c, k, C, I, N) => {
|
|
11677
11675
|
var Lt;
|
|
11678
|
-
const
|
|
11679
|
-
if (!
|
|
11680
|
-
const ue = B.includes(c), le =
|
|
11681
|
-
switch (
|
|
11676
|
+
const T = st[c];
|
|
11677
|
+
if (!T) return null;
|
|
11678
|
+
const ue = B.includes(c), le = E[c], we = ve(C, d) || (T.translationKey ? d(`fields.${T.translationKey}`) : void 0) || T.label, be = c in oe, he = k ?? c, Ze = { required: ue }, Ye = N ? N !== "placeholder" : S, Je = Ye ? we : void 0;
|
|
11679
|
+
switch (T.type) {
|
|
11682
11680
|
case "select":
|
|
11683
11681
|
if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
|
|
11684
|
-
const Le = X(c,
|
|
11682
|
+
const Le = X(c, I);
|
|
11685
11683
|
return /* @__PURE__ */ r(
|
|
11686
11684
|
Ge,
|
|
11687
11685
|
{
|
|
@@ -11690,7 +11688,7 @@ const fa = {
|
|
|
11690
11688
|
value: H[c] || "",
|
|
11691
11689
|
onChange: (it) => Z(c, it),
|
|
11692
11690
|
options: [{ value: "", label: Ye ? d("placeholders.selectCountry") : we }, ...Le],
|
|
11693
|
-
disabled:
|
|
11691
|
+
disabled: x,
|
|
11694
11692
|
readOnly: be,
|
|
11695
11693
|
error: le
|
|
11696
11694
|
},
|
|
@@ -11735,7 +11733,7 @@ const fa = {
|
|
|
11735
11733
|
return null;
|
|
11736
11734
|
case "multiselect":
|
|
11737
11735
|
if (c === "otherNationality") {
|
|
11738
|
-
const Le = X(c,
|
|
11736
|
+
const Le = X(c, I);
|
|
11739
11737
|
return /* @__PURE__ */ r(
|
|
11740
11738
|
Oi,
|
|
11741
11739
|
{
|
|
@@ -11745,7 +11743,7 @@ const fa = {
|
|
|
11745
11743
|
onChange: (it) => Z(c, it),
|
|
11746
11744
|
options: Le,
|
|
11747
11745
|
placeholder: Ye ? d("placeholders.selectOtherNationalities") : we,
|
|
11748
|
-
disabled:
|
|
11746
|
+
disabled: x,
|
|
11749
11747
|
readOnly: be
|
|
11750
11748
|
},
|
|
11751
11749
|
he
|
|
@@ -11814,9 +11812,9 @@ const fa = {
|
|
|
11814
11812
|
);
|
|
11815
11813
|
}
|
|
11816
11814
|
}, f = (c, k) => {
|
|
11817
|
-
const
|
|
11815
|
+
const C = c.labelMode ? c.labelMode !== "placeholder" : S;
|
|
11818
11816
|
if (c.customType === "paragraph") {
|
|
11819
|
-
const
|
|
11817
|
+
const T = ve(c.displayText, d) || ve(c.label, d) || "";
|
|
11820
11818
|
return /* @__PURE__ */ r(
|
|
11821
11819
|
"p",
|
|
11822
11820
|
{
|
|
@@ -11827,7 +11825,7 @@ const fa = {
|
|
|
11827
11825
|
margin: 0,
|
|
11828
11826
|
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
11829
11827
|
},
|
|
11830
|
-
dangerouslySetInnerHTML: { __html:
|
|
11828
|
+
dangerouslySetInnerHTML: { __html: T }
|
|
11831
11829
|
},
|
|
11832
11830
|
`custom-${k}`
|
|
11833
11831
|
);
|
|
@@ -11843,7 +11841,7 @@ const fa = {
|
|
|
11843
11841
|
if (c.customType === "br")
|
|
11844
11842
|
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${k}`);
|
|
11845
11843
|
if (c.customType === "link") {
|
|
11846
|
-
const
|
|
11844
|
+
const T = ve(c.displayText, d) || ve(c.label, d) || c.linkText || c.linkUrl || "";
|
|
11847
11845
|
return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ o(
|
|
11848
11846
|
"a",
|
|
11849
11847
|
{
|
|
@@ -11860,14 +11858,14 @@ const fa = {
|
|
|
11860
11858
|
cursor: "pointer"
|
|
11861
11859
|
},
|
|
11862
11860
|
children: [
|
|
11863
|
-
|
|
11861
|
+
T,
|
|
11864
11862
|
/* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
|
|
11865
11863
|
]
|
|
11866
11864
|
}
|
|
11867
11865
|
) }, `custom-${k}`);
|
|
11868
11866
|
}
|
|
11869
11867
|
if (!c.paramName) return null;
|
|
11870
|
-
const
|
|
11868
|
+
const I = E[c.paramName], N = ve(c.displayText, d) || ve(c.label, d) || c.paramName;
|
|
11871
11869
|
if (c.customType === "checkbox")
|
|
11872
11870
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
11873
11871
|
/* @__PURE__ */ o(
|
|
@@ -11880,7 +11878,7 @@ const fa = {
|
|
|
11880
11878
|
Ue,
|
|
11881
11879
|
{
|
|
11882
11880
|
checked: ge[c.paramName] === "true",
|
|
11883
|
-
onChange: (
|
|
11881
|
+
onChange: (T) => Ie(c.paramName, T ? "true" : "false")
|
|
11884
11882
|
}
|
|
11885
11883
|
),
|
|
11886
11884
|
/* @__PURE__ */ o(
|
|
@@ -11897,7 +11895,7 @@ const fa = {
|
|
|
11897
11895
|
]
|
|
11898
11896
|
}
|
|
11899
11897
|
),
|
|
11900
|
-
|
|
11898
|
+
I && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: I })
|
|
11901
11899
|
] }, `custom-${k}`);
|
|
11902
11900
|
if (c.customType === "link_checkbox")
|
|
11903
11901
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -11911,7 +11909,7 @@ const fa = {
|
|
|
11911
11909
|
Ue,
|
|
11912
11910
|
{
|
|
11913
11911
|
checked: ge[c.paramName] === "true",
|
|
11914
|
-
onChange: (
|
|
11912
|
+
onChange: (T) => Ie(c.paramName, T ? "true" : "false")
|
|
11915
11913
|
}
|
|
11916
11914
|
),
|
|
11917
11915
|
/* @__PURE__ */ o(
|
|
@@ -11930,7 +11928,7 @@ const fa = {
|
|
|
11930
11928
|
rel: "noopener noreferrer",
|
|
11931
11929
|
className: "underline",
|
|
11932
11930
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
11933
|
-
onClick: (
|
|
11931
|
+
onClick: (T) => T.stopPropagation(),
|
|
11934
11932
|
children: c.linkText || c.linkUrl
|
|
11935
11933
|
}
|
|
11936
11934
|
),
|
|
@@ -11941,12 +11939,12 @@ const fa = {
|
|
|
11941
11939
|
]
|
|
11942
11940
|
}
|
|
11943
11941
|
),
|
|
11944
|
-
|
|
11942
|
+
I && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: I })
|
|
11945
11943
|
] }, `custom-${k}`);
|
|
11946
11944
|
if (c.customType === "group_checkbox") {
|
|
11947
|
-
const
|
|
11945
|
+
const T = (ge[c.paramName] || "").split(",").filter(Boolean);
|
|
11948
11946
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
11949
|
-
|
|
11947
|
+
C && /* @__PURE__ */ o(
|
|
11950
11948
|
"div",
|
|
11951
11949
|
{
|
|
11952
11950
|
className: "text-sm font-medium",
|
|
@@ -11958,7 +11956,7 @@ const fa = {
|
|
|
11958
11956
|
}
|
|
11959
11957
|
),
|
|
11960
11958
|
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((ue) => {
|
|
11961
|
-
const le = c.singleSelect ? ge[c.paramName] === ue.value :
|
|
11959
|
+
const le = c.singleSelect ? ge[c.paramName] === ue.value : T.includes(ue.value);
|
|
11962
11960
|
return /* @__PURE__ */ o(
|
|
11963
11961
|
"label",
|
|
11964
11962
|
{
|
|
@@ -11973,7 +11971,7 @@ const fa = {
|
|
|
11973
11971
|
if (c.singleSelect)
|
|
11974
11972
|
Ie(c.paramName, we ? ue.value : "");
|
|
11975
11973
|
else {
|
|
11976
|
-
const be = we ? [...
|
|
11974
|
+
const be = we ? [...T, ue.value] : T.filter((he) => he !== ue.value);
|
|
11977
11975
|
Ie(c.paramName, be.join(","));
|
|
11978
11976
|
}
|
|
11979
11977
|
}
|
|
@@ -11992,11 +11990,11 @@ const fa = {
|
|
|
11992
11990
|
ue.value
|
|
11993
11991
|
);
|
|
11994
11992
|
}) }),
|
|
11995
|
-
|
|
11993
|
+
I && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: I })
|
|
11996
11994
|
] }, `custom-${k}`);
|
|
11997
11995
|
}
|
|
11998
11996
|
return c.customType === "radio_group" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
11999
|
-
|
|
11997
|
+
C && /* @__PURE__ */ o(
|
|
12000
11998
|
"div",
|
|
12001
11999
|
{
|
|
12002
12000
|
className: "text-sm font-medium",
|
|
@@ -12007,7 +12005,7 @@ const fa = {
|
|
|
12007
12005
|
]
|
|
12008
12006
|
}
|
|
12009
12007
|
),
|
|
12010
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((
|
|
12008
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((T) => /* @__PURE__ */ o(
|
|
12011
12009
|
"label",
|
|
12012
12010
|
{
|
|
12013
12011
|
className: "metakyc-option-label",
|
|
@@ -12017,8 +12015,8 @@ const fa = {
|
|
|
12017
12015
|
"input",
|
|
12018
12016
|
{
|
|
12019
12017
|
type: "radio",
|
|
12020
|
-
checked: ge[c.paramName] ===
|
|
12021
|
-
onChange: () => Ie(c.paramName,
|
|
12018
|
+
checked: ge[c.paramName] === T.value,
|
|
12019
|
+
onChange: () => Ie(c.paramName, T.value),
|
|
12022
12020
|
name: `radio-group-${c.paramName}-${k}`,
|
|
12023
12021
|
className: "metakyc-option-input",
|
|
12024
12022
|
style: fa
|
|
@@ -12029,29 +12027,29 @@ const fa = {
|
|
|
12029
12027
|
{
|
|
12030
12028
|
className: "metakyc-option-text",
|
|
12031
12029
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
12032
|
-
children:
|
|
12030
|
+
children: T.label
|
|
12033
12031
|
}
|
|
12034
12032
|
)
|
|
12035
12033
|
]
|
|
12036
12034
|
},
|
|
12037
|
-
|
|
12035
|
+
T.value
|
|
12038
12036
|
)) }),
|
|
12039
|
-
|
|
12037
|
+
I && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: I })
|
|
12040
12038
|
] }, `custom-${k}`) : /* @__PURE__ */ r(
|
|
12041
12039
|
Se,
|
|
12042
12040
|
{
|
|
12043
12041
|
type: "text",
|
|
12044
|
-
label:
|
|
12045
|
-
placeholder:
|
|
12042
|
+
label: C ? `${N}${c.required ? " *" : ""}` : void 0,
|
|
12043
|
+
placeholder: C ? void 0 : N,
|
|
12046
12044
|
value: ge[c.paramName] || "",
|
|
12047
|
-
onChange: (
|
|
12045
|
+
onChange: (T) => Ie(c.paramName, T.target.value),
|
|
12048
12046
|
required: c.required,
|
|
12049
|
-
error:
|
|
12047
|
+
error: I
|
|
12050
12048
|
},
|
|
12051
12049
|
`custom-${k}`
|
|
12052
12050
|
);
|
|
12053
12051
|
}, M = (c, k) => {
|
|
12054
|
-
const
|
|
12052
|
+
const C = Ae(c);
|
|
12055
12053
|
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
12056
12054
|
c.conditionalOn && /* @__PURE__ */ r(Ht, { helpText: c.conditionalHelpText, children: /* @__PURE__ */ o(
|
|
12057
12055
|
"label",
|
|
@@ -12062,8 +12060,8 @@ const fa = {
|
|
|
12062
12060
|
/* @__PURE__ */ r(
|
|
12063
12061
|
Ue,
|
|
12064
12062
|
{
|
|
12065
|
-
checked:
|
|
12066
|
-
onChange: (
|
|
12063
|
+
checked: C,
|
|
12064
|
+
onChange: (I) => Ie(c.conditionalOn, I ? "true" : "false")
|
|
12067
12065
|
}
|
|
12068
12066
|
),
|
|
12069
12067
|
/* @__PURE__ */ r(
|
|
@@ -12077,19 +12075,19 @@ const fa = {
|
|
|
12077
12075
|
]
|
|
12078
12076
|
}
|
|
12079
12077
|
) }),
|
|
12080
|
-
|
|
12081
|
-
const
|
|
12082
|
-
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${
|
|
12078
|
+
C && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: c.fields.map((I, N) => {
|
|
12079
|
+
const T = Math.min(4, Math.max(1, Number(I.colSpan) || 4)), ue = I.isCustom ? `custom-${N}-${I.paramName}` : `builtin-${I.name}-${N}`;
|
|
12080
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${T} / span ${T}` }, children: /* @__PURE__ */ r(Ht, { helpText: I.helpText, children: I.isCustom ? f(I, N) : Xe(I.name, ue, I.displayText, I.countriesType, I.labelMode) }) }, ue);
|
|
12083
12081
|
}) })
|
|
12084
12082
|
] });
|
|
12085
12083
|
};
|
|
12086
|
-
if (!s ||
|
|
12084
|
+
if (!s || x)
|
|
12087
12085
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ie, { children: [
|
|
12088
12086
|
/* @__PURE__ */ r(Ve, { className: "my-8" }),
|
|
12089
12087
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: d("common.loadingForm") })
|
|
12090
12088
|
] }) }) });
|
|
12091
|
-
if (
|
|
12092
|
-
const c =
|
|
12089
|
+
if (P) {
|
|
12090
|
+
const c = P[me] ?? P[0], k = We === -1, C = ze === -1, I = P.length, N = Ae(c), T = Object.values(E);
|
|
12093
12091
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(re, { children: [
|
|
12094
12092
|
/* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(ft, { title: (s == null ? void 0 : s.title) || d("createApplicant.title") }) }),
|
|
12095
12093
|
/* @__PURE__ */ o(ie, { children: [
|
|
@@ -12119,8 +12117,8 @@ const fa = {
|
|
|
12119
12117
|
}
|
|
12120
12118
|
)
|
|
12121
12119
|
] }),
|
|
12122
|
-
|
|
12123
|
-
|
|
12120
|
+
I > 1 && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "1rem" }, children: [
|
|
12121
|
+
P.map((ue, le) => /* @__PURE__ */ r(
|
|
12124
12122
|
"div",
|
|
12125
12123
|
{
|
|
12126
12124
|
style: {
|
|
@@ -12135,16 +12133,16 @@ const fa = {
|
|
|
12135
12133
|
/* @__PURE__ */ o("span", { style: { fontSize: "0.75rem", color: "var(--metakyc-text-muted, #9ca3af)", flexShrink: 0 }, children: [
|
|
12136
12134
|
me + 1,
|
|
12137
12135
|
" / ",
|
|
12138
|
-
|
|
12136
|
+
I
|
|
12139
12137
|
] })
|
|
12140
12138
|
] }),
|
|
12141
|
-
(ke ||
|
|
12139
|
+
(ke || T.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
12142
12140
|
ke && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
12143
12141
|
/* @__PURE__ */ r("strong", { children: d("common.errorPrefix") }),
|
|
12144
12142
|
" ",
|
|
12145
12143
|
ke
|
|
12146
12144
|
] }),
|
|
12147
|
-
|
|
12145
|
+
T.map((ue, le) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ue }, le))
|
|
12148
12146
|
] }),
|
|
12149
12147
|
M(c)
|
|
12150
12148
|
] }),
|
|
@@ -12156,21 +12154,21 @@ const fa = {
|
|
|
12156
12154
|
type: "button",
|
|
12157
12155
|
variant: "outline",
|
|
12158
12156
|
onClick: () => {
|
|
12159
|
-
|
|
12157
|
+
D(We), O({});
|
|
12160
12158
|
},
|
|
12161
|
-
disabled:
|
|
12159
|
+
disabled: j || m,
|
|
12162
12160
|
children: d("common.previous")
|
|
12163
12161
|
}
|
|
12164
12162
|
),
|
|
12165
|
-
k && a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled:
|
|
12163
|
+
k && a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: j || m, children: "Cancel" })
|
|
12166
12164
|
] }),
|
|
12167
12165
|
/* @__PURE__ */ r(
|
|
12168
12166
|
G,
|
|
12169
12167
|
{
|
|
12170
12168
|
type: "button",
|
|
12171
|
-
isLoading:
|
|
12172
|
-
onClick:
|
|
12173
|
-
children:
|
|
12169
|
+
isLoading: j || m,
|
|
12170
|
+
onClick: C ? Ke : rt,
|
|
12171
|
+
children: C ? c.conditionalOn && !N ? d("common.skipAndSubmit") : d("common.submit") : c.conditionalOn && !N ? d("common.skip") : d("common.next")
|
|
12174
12172
|
}
|
|
12175
12173
|
)
|
|
12176
12174
|
] })
|
|
@@ -12187,8 +12185,8 @@ const fa = {
|
|
|
12187
12185
|
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: F.map((c) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children: Xe(c) }, c)) })
|
|
12188
12186
|
] }),
|
|
12189
12187
|
/* @__PURE__ */ o(Te, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
12190
|
-
a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled:
|
|
12191
|
-
/* @__PURE__ */ r(G, { type: "submit", isLoading:
|
|
12188
|
+
a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: j || m, children: "Cancel" }),
|
|
12189
|
+
/* @__PURE__ */ r(G, { type: "submit", isLoading: j || m, children: d("createApplicant.createApplicant") })
|
|
12192
12190
|
] })
|
|
12193
12191
|
] }) }) });
|
|
12194
12192
|
}, $t = ["companyName", "email"];
|
|
@@ -12202,74 +12200,74 @@ const Fa = ({
|
|
|
12202
12200
|
onCancel: a
|
|
12203
12201
|
}) => {
|
|
12204
12202
|
var Xe, f, M, $, Y, ee;
|
|
12205
|
-
const { config: n, baseInformationService: l, currentTheme: s } = Oe(), { createCompanyApplicant: p, isLoading:
|
|
12203
|
+
const { config: n, baseInformationService: l, currentTheme: s } = Oe(), { createCompanyApplicant: p, isLoading: m } = tr(), { t: d } = Re(), y = e || ((Xe = n.applicantForm) == null ? void 0 : Xe.workflowKey);
|
|
12206
12204
|
if (!y)
|
|
12207
12205
|
throw new Error(
|
|
12208
12206
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
12209
12207
|
);
|
|
12210
|
-
const
|
|
12208
|
+
const h = t || ((f = n.applicantForm) == null ? void 0 : f.externalRefId) || "", R = ((M = n.applicantForm) == null ? void 0 : M.email) || "", L = (($ = n.applicantForm) == null ? void 0 : $.initialValues) || {}, q = (((Y = n.applicantForm) == null ? void 0 : Y.fieldLabelMode) || (s == null ? void 0 : s.fieldLabelMode) || "label") !== "placeholder", S = Fe(
|
|
12211
12209
|
() => s != null && s.companyFormPages && s.companyFormPages.length > 0 ? s.companyFormPages : null,
|
|
12212
12210
|
[s == null ? void 0 : s.companyFormPages]
|
|
12213
|
-
),
|
|
12214
|
-
const g = new Set($t),
|
|
12215
|
-
if (
|
|
12211
|
+
), P = Fe(() => {
|
|
12212
|
+
const g = new Set($t), A = s == null ? void 0 : s.companyFormRequiredFields;
|
|
12213
|
+
if (A) for (const w of A) g.add(w);
|
|
12216
12214
|
if (S)
|
|
12217
|
-
for (const
|
|
12218
|
-
for (const
|
|
12219
|
-
!
|
|
12215
|
+
for (const w of S)
|
|
12216
|
+
for (const u of w.fields)
|
|
12217
|
+
!u.isCustom && u.name && u.required && g.add(u.name);
|
|
12220
12218
|
return Array.from(g);
|
|
12221
12219
|
}, [s == null ? void 0 : s.companyFormRequiredFields, S]), B = Fe(() => {
|
|
12222
12220
|
var g;
|
|
12223
12221
|
if (S) {
|
|
12224
|
-
const
|
|
12225
|
-
for (const
|
|
12226
|
-
return Array.from(
|
|
12222
|
+
const A = S.flatMap((u) => u.fields).filter((u) => !u.isCustom && u.name).map((u) => u.name), w = new Set(A);
|
|
12223
|
+
for (const u of $t) w.add(u);
|
|
12224
|
+
return Array.from(w);
|
|
12227
12225
|
}
|
|
12228
12226
|
return (g = n.applicantForm) != null && g.visibleFields ? n.applicantForm.visibleFields : s != null && s.companyFormVisibleFields && s.companyFormVisibleFields.length > 0 ? s.companyFormVisibleFields : Sr;
|
|
12229
12227
|
}, [(ee = n.applicantForm) == null ? void 0 : ee.visibleFields, s == null ? void 0 : s.companyFormVisibleFields, S]), F = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), U = Fe(() => {
|
|
12230
|
-
var
|
|
12228
|
+
var A, w;
|
|
12231
12229
|
const g = /* @__PURE__ */ new Set();
|
|
12232
12230
|
if (S)
|
|
12233
|
-
for (const
|
|
12234
|
-
for (const c of
|
|
12235
|
-
!c.isCustom && c.name && F.has(c.name) && g.add(c.countriesType ?? ((
|
|
12231
|
+
for (const u of S)
|
|
12232
|
+
for (const c of u.fields)
|
|
12233
|
+
!c.isCustom && c.name && F.has(c.name) && g.add(c.countriesType ?? ((A = dt[c.name]) == null ? void 0 : A.countriesType));
|
|
12236
12234
|
else
|
|
12237
|
-
for (const
|
|
12238
|
-
F.has(
|
|
12235
|
+
for (const u of B)
|
|
12236
|
+
F.has(u) && g.add((w = dt[u]) == null ? void 0 : w.countriesType);
|
|
12239
12237
|
return g.size === 0 && g.add(void 0), Array.from(g);
|
|
12240
|
-
}, [B, S]), [K, J] =
|
|
12238
|
+
}, [B, S]), [K, J] = v({}), [ae, x] = v(!0), z = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
|
|
12241
12239
|
fe(() => {
|
|
12242
12240
|
if (!s) return;
|
|
12243
|
-
const g = U.filter((
|
|
12244
|
-
const c =
|
|
12245
|
-
return !V.current.has(c) && !
|
|
12241
|
+
const g = U.filter((u) => {
|
|
12242
|
+
const c = u != null ? String(u) : "all";
|
|
12243
|
+
return !V.current.has(c) && !z.current.has(c);
|
|
12246
12244
|
});
|
|
12247
12245
|
if (g.length === 0) {
|
|
12248
|
-
U.every((c) => V.current.has(c != null ? String(c) : "all")) &&
|
|
12246
|
+
U.every((c) => V.current.has(c != null ? String(c) : "all")) && x(!1);
|
|
12249
12247
|
return;
|
|
12250
12248
|
}
|
|
12251
|
-
|
|
12252
|
-
const
|
|
12253
|
-
|
|
12249
|
+
x(!0);
|
|
12250
|
+
const A = g.map((u) => u != null ? String(u) : "all");
|
|
12251
|
+
A.forEach((u) => z.current.add(u)), (async () => {
|
|
12254
12252
|
try {
|
|
12255
|
-
const
|
|
12253
|
+
const u = await Promise.all(
|
|
12256
12254
|
g.map(async (c) => {
|
|
12257
|
-
const k = c != null ? String(c) : "all",
|
|
12258
|
-
return V.current.add(k),
|
|
12255
|
+
const k = c != null ? String(c) : "all", C = await l.getCountries("", n.locale || "en", c), I = /* @__PURE__ */ new Set(), N = C.map((T) => ({ value: T.abbreviation3 || T.abbreviation, label: T.name })).filter((T) => !T.value || I.has(T.value) ? !1 : (I.add(T.value), !0));
|
|
12256
|
+
return V.current.add(k), z.current.delete(k), [k, N];
|
|
12259
12257
|
})
|
|
12260
12258
|
);
|
|
12261
|
-
J((c) => ({ ...c, ...Object.fromEntries(
|
|
12262
|
-
} catch (
|
|
12263
|
-
|
|
12259
|
+
J((c) => ({ ...c, ...Object.fromEntries(u) }));
|
|
12260
|
+
} catch (u) {
|
|
12261
|
+
A.forEach((c) => z.current.delete(c)), console.error("Failed to load countries:", u);
|
|
12264
12262
|
} finally {
|
|
12265
|
-
U.every((c) => V.current.has(c != null ? String(c) : "all")) &&
|
|
12263
|
+
U.every((c) => V.current.has(c != null ? String(c) : "all")) && x(!1);
|
|
12266
12264
|
}
|
|
12267
12265
|
})();
|
|
12268
12266
|
}, [U, s]);
|
|
12269
|
-
const Q = (g,
|
|
12267
|
+
const Q = (g, A) => {
|
|
12270
12268
|
var c;
|
|
12271
|
-
const
|
|
12272
|
-
return K[
|
|
12269
|
+
const w = A ?? ((c = dt[g]) == null ? void 0 : c.countriesType), u = w != null ? String(w) : "all";
|
|
12270
|
+
return K[u] || [];
|
|
12273
12271
|
}, X = {
|
|
12274
12272
|
companyName: 1,
|
|
12275
12273
|
registrationNumber: 1,
|
|
@@ -12291,11 +12289,11 @@ const Fa = ({
|
|
|
12291
12289
|
addressCountry: 1,
|
|
12292
12290
|
lei: 1
|
|
12293
12291
|
}, W = Object.fromEntries(
|
|
12294
|
-
Object.entries(
|
|
12295
|
-
), [_, oe] =
|
|
12292
|
+
Object.entries(L).filter(([g]) => g in X)
|
|
12293
|
+
), [_, oe] = v({
|
|
12296
12294
|
workflowKey: y,
|
|
12297
12295
|
companyName: "",
|
|
12298
|
-
email:
|
|
12296
|
+
email: R,
|
|
12299
12297
|
phone: "",
|
|
12300
12298
|
registrationNumber: "",
|
|
12301
12299
|
countryResidence: "",
|
|
@@ -12313,26 +12311,25 @@ const Fa = ({
|
|
|
12313
12311
|
postalCode: "",
|
|
12314
12312
|
addressCountry: "",
|
|
12315
12313
|
lei: "",
|
|
12316
|
-
externalRefId:
|
|
12314
|
+
externalRefId: h,
|
|
12317
12315
|
...W
|
|
12318
|
-
}), [H, Me] =
|
|
12319
|
-
|
|
12320
|
-
const
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
if (
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
m.customType === "checkbox" || m.customType === "link_checkbox" ? c !== "true" && (z[m.paramName] = d("validation.fieldRequired", { field: k })) : (!c || c.trim() === "") && (z[m.paramName] = d("validation.fieldRequired", { field: k }));
|
|
12316
|
+
}), [H, Me] = v({}), [pe, ge] = v(0), [xe, me] = v({}), [D, E] = v(null), [O, ke] = v(!1), se = (g, A) => oe((w) => ({ ...w, [g]: A })), j = (g, A) => Me((w) => ({ ...w, [g]: A })), ne = (g) => !g.conditionalOn || H[g.conditionalOn] === "true", Z = S && pe < S.length - 1 ? pe + 1 : -1, Ie = S && pe > 0 ? pe - 1 : -1, Ae = (g) => {
|
|
12317
|
+
const A = {};
|
|
12318
|
+
for (const w of g.fields)
|
|
12319
|
+
if (w.isCustom) {
|
|
12320
|
+
if (w.customType === "paragraph" || w.customType === "html" || w.customType === "br" || w.customType === "link") continue;
|
|
12321
|
+
if (w.required && w.paramName) {
|
|
12322
|
+
const u = H[w.paramName], c = ve(w.displayText, d) || ve(w.label, d) || w.paramName;
|
|
12323
|
+
w.customType === "checkbox" || w.customType === "link_checkbox" ? u !== "true" && (A[w.paramName] = d("validation.fieldRequired", { field: c })) : (!u || u.trim() === "") && (A[w.paramName] = d("validation.fieldRequired", { field: c }));
|
|
12327
12324
|
}
|
|
12328
|
-
} else if (
|
|
12329
|
-
const
|
|
12330
|
-
if (
|
|
12331
|
-
const k = ve(
|
|
12332
|
-
|
|
12325
|
+
} else if (w.name) {
|
|
12326
|
+
const u = w.name;
|
|
12327
|
+
if (P.includes(u) && Nt(_[u])) {
|
|
12328
|
+
const c = dt[u], k = ve(w.displayText, d) || (c != null && c.translationKey ? d(`fields.${c.translationKey}`) : void 0) || (c == null ? void 0 : c.label) || u;
|
|
12329
|
+
A[u] = d("validation.fieldRequired", { field: k });
|
|
12333
12330
|
}
|
|
12334
12331
|
}
|
|
12335
|
-
return
|
|
12332
|
+
return A;
|
|
12336
12333
|
}, ze = async () => {
|
|
12337
12334
|
if (!S) return;
|
|
12338
12335
|
const g = S[pe];
|
|
@@ -12340,113 +12337,112 @@ const Fa = ({
|
|
|
12340
12337
|
me({}), Z >= 0 ? ge(Z) : await We();
|
|
12341
12338
|
return;
|
|
12342
12339
|
}
|
|
12343
|
-
const
|
|
12344
|
-
if (Object.keys(
|
|
12345
|
-
me(
|
|
12340
|
+
const A = Ae(g);
|
|
12341
|
+
if (Object.keys(A).length > 0) {
|
|
12342
|
+
me(A);
|
|
12346
12343
|
return;
|
|
12347
12344
|
}
|
|
12348
12345
|
me({}), Z >= 0 ? ge(Z) : await We();
|
|
12349
12346
|
}, We = async () => {
|
|
12350
12347
|
var g;
|
|
12351
12348
|
if (S) {
|
|
12352
|
-
let
|
|
12353
|
-
for (const
|
|
12354
|
-
ne(
|
|
12355
|
-
if (Object.keys(
|
|
12356
|
-
me(
|
|
12349
|
+
let A = {};
|
|
12350
|
+
for (const w of S)
|
|
12351
|
+
ne(w) && (A = { ...A, ...Ae(w) });
|
|
12352
|
+
if (Object.keys(A).length > 0) {
|
|
12353
|
+
me(A);
|
|
12357
12354
|
return;
|
|
12358
12355
|
}
|
|
12359
12356
|
}
|
|
12360
|
-
ke(!0),
|
|
12357
|
+
ke(!0), E(null);
|
|
12361
12358
|
try {
|
|
12362
|
-
const
|
|
12359
|
+
const A = {
|
|
12363
12360
|
workflowKey: _.workflowKey,
|
|
12364
12361
|
externalRefId: ((g = _.externalRefId) == null ? void 0 : g.trim()) || void 0
|
|
12365
|
-
},
|
|
12366
|
-
for (const k of
|
|
12367
|
-
const
|
|
12368
|
-
if (!Nt(
|
|
12362
|
+
}, w = S ? S.filter((k) => ne(k)).flatMap((k) => k.fields).filter((k) => !k.isCustom && k.name).map((k) => k.name) : B;
|
|
12363
|
+
for (const k of w) {
|
|
12364
|
+
const C = _[k];
|
|
12365
|
+
if (!Nt(C))
|
|
12369
12366
|
switch (k) {
|
|
12370
12367
|
case "companyName":
|
|
12371
|
-
|
|
12368
|
+
A.companyName = C;
|
|
12372
12369
|
break;
|
|
12373
12370
|
case "email":
|
|
12374
|
-
|
|
12371
|
+
A.companyEmail = C;
|
|
12375
12372
|
break;
|
|
12376
12373
|
case "phone":
|
|
12377
|
-
|
|
12374
|
+
A.companyPhone = C;
|
|
12378
12375
|
break;
|
|
12379
12376
|
case "registrationNumber":
|
|
12380
|
-
|
|
12377
|
+
A.companyRegistrationNumber = C;
|
|
12381
12378
|
break;
|
|
12382
12379
|
case "countryResidence":
|
|
12383
|
-
|
|
12380
|
+
A.companyCountry = C;
|
|
12384
12381
|
break;
|
|
12385
12382
|
case "city":
|
|
12386
|
-
|
|
12383
|
+
A.companyCity = C;
|
|
12387
12384
|
break;
|
|
12388
12385
|
case "street":
|
|
12389
|
-
|
|
12386
|
+
A.companyStreet = C;
|
|
12390
12387
|
break;
|
|
12391
12388
|
case "postalCode":
|
|
12392
|
-
|
|
12389
|
+
A.companyZip = C;
|
|
12393
12390
|
break;
|
|
12394
12391
|
default:
|
|
12395
|
-
|
|
12392
|
+
A[k] = C;
|
|
12396
12393
|
break;
|
|
12397
12394
|
}
|
|
12398
12395
|
}
|
|
12399
|
-
const
|
|
12396
|
+
const u = [];
|
|
12400
12397
|
if (S) {
|
|
12401
12398
|
for (const k of S)
|
|
12402
12399
|
if (ne(k))
|
|
12403
|
-
for (const
|
|
12404
|
-
if (!
|
|
12405
|
-
const
|
|
12400
|
+
for (const C of k.fields) {
|
|
12401
|
+
if (!C.isCustom || !C.paramName || C.customType === "paragraph" || C.customType === "html" || C.customType === "br" || C.customType === "link") continue;
|
|
12402
|
+
const I = H[C.paramName] ?? "";
|
|
12406
12403
|
let N;
|
|
12407
|
-
if (
|
|
12408
|
-
N =
|
|
12409
|
-
else if (N =
|
|
12410
|
-
|
|
12404
|
+
if (C.customType === "checkbox" || C.customType === "link_checkbox")
|
|
12405
|
+
N = I === "true" ? "yes" : "no";
|
|
12406
|
+
else if (N = I, !N && !C.required) continue;
|
|
12407
|
+
u.push({ paramName: C.paramName, value: N });
|
|
12411
12408
|
}
|
|
12412
12409
|
}
|
|
12413
|
-
|
|
12414
|
-
const c = await p(
|
|
12410
|
+
u.length > 0 && (A.applicantAdditionalDatas = u);
|
|
12411
|
+
const c = await p(A);
|
|
12415
12412
|
i(c.applicantId);
|
|
12416
|
-
} catch (
|
|
12417
|
-
console.error("Error creating company applicant:",
|
|
12413
|
+
} catch (A) {
|
|
12414
|
+
console.error("Error creating company applicant:", A), E(A.message || d("createCompany.failedToCreate"));
|
|
12418
12415
|
} finally {
|
|
12419
12416
|
ke(!1);
|
|
12420
12417
|
}
|
|
12421
12418
|
}, lt = async (g) => {
|
|
12422
|
-
var z;
|
|
12423
12419
|
g.preventDefault();
|
|
12424
|
-
for (const
|
|
12425
|
-
if (Nt(_[
|
|
12426
|
-
const
|
|
12427
|
-
|
|
12420
|
+
for (const A of P)
|
|
12421
|
+
if (Nt(_[A])) {
|
|
12422
|
+
const w = dt[A], u = (w != null && w.translationKey ? d(`fields.${w.translationKey}`) : void 0) || (w == null ? void 0 : w.label) || A;
|
|
12423
|
+
E(d("validation.fieldRequired", { field: u }));
|
|
12428
12424
|
return;
|
|
12429
12425
|
}
|
|
12430
12426
|
await We();
|
|
12431
|
-
}, rt = (g,
|
|
12427
|
+
}, rt = (g, A, w, u, c) => {
|
|
12432
12428
|
const k = dt[g];
|
|
12433
12429
|
if (!k) return null;
|
|
12434
|
-
const
|
|
12430
|
+
const C = P.includes(g), I = xe[g], N = ve(w, d) || (k.translationKey ? d(`fields.${k.translationKey}`) : void 0) || k.label, T = g in W, ue = A ?? g, le = c ? c !== "placeholder" : q, we = le ? N : void 0;
|
|
12435
12431
|
switch (k.type) {
|
|
12436
12432
|
case "select":
|
|
12437
12433
|
if (g === "countryResidence" || g === "addressCountry") {
|
|
12438
|
-
const be = Q(g,
|
|
12434
|
+
const be = Q(g, u);
|
|
12439
12435
|
return /* @__PURE__ */ r(
|
|
12440
12436
|
Ge,
|
|
12441
12437
|
{
|
|
12442
|
-
required:
|
|
12438
|
+
required: C,
|
|
12443
12439
|
label: we,
|
|
12444
12440
|
value: _[g] || "",
|
|
12445
12441
|
onChange: (he) => se(g, he),
|
|
12446
12442
|
options: [{ value: "", label: le ? d("placeholders.selectCountry") : N }, ...be],
|
|
12447
12443
|
disabled: ae,
|
|
12448
|
-
readOnly:
|
|
12449
|
-
error:
|
|
12444
|
+
readOnly: T,
|
|
12445
|
+
error: I
|
|
12450
12446
|
},
|
|
12451
12447
|
ue
|
|
12452
12448
|
);
|
|
@@ -12456,14 +12452,14 @@ const Fa = ({
|
|
|
12456
12452
|
return /* @__PURE__ */ r(
|
|
12457
12453
|
Se,
|
|
12458
12454
|
{
|
|
12459
|
-
required:
|
|
12455
|
+
required: C,
|
|
12460
12456
|
type: "date",
|
|
12461
12457
|
label: we,
|
|
12462
12458
|
placeholder: le ? void 0 : N,
|
|
12463
12459
|
value: _[g] || "",
|
|
12464
12460
|
onChange: (be) => se(g, be.target.value),
|
|
12465
|
-
readOnly:
|
|
12466
|
-
error:
|
|
12461
|
+
readOnly: T,
|
|
12462
|
+
error: I
|
|
12467
12463
|
},
|
|
12468
12464
|
ue
|
|
12469
12465
|
);
|
|
@@ -12471,14 +12467,14 @@ const Fa = ({
|
|
|
12471
12467
|
return /* @__PURE__ */ r(
|
|
12472
12468
|
Se,
|
|
12473
12469
|
{
|
|
12474
|
-
required:
|
|
12470
|
+
required: C,
|
|
12475
12471
|
type: "email",
|
|
12476
12472
|
label: we,
|
|
12477
12473
|
placeholder: le ? void 0 : N,
|
|
12478
12474
|
value: _[g] || "",
|
|
12479
12475
|
onChange: (be) => se(g, be.target.value),
|
|
12480
|
-
readOnly:
|
|
12481
|
-
error:
|
|
12476
|
+
readOnly: T,
|
|
12477
|
+
error: I
|
|
12482
12478
|
},
|
|
12483
12479
|
ue
|
|
12484
12480
|
);
|
|
@@ -12486,14 +12482,14 @@ const Fa = ({
|
|
|
12486
12482
|
return /* @__PURE__ */ r(
|
|
12487
12483
|
Se,
|
|
12488
12484
|
{
|
|
12489
|
-
required:
|
|
12485
|
+
required: C,
|
|
12490
12486
|
type: "tel",
|
|
12491
12487
|
label: we,
|
|
12492
12488
|
placeholder: le ? void 0 : N,
|
|
12493
12489
|
value: _[g] || "",
|
|
12494
12490
|
onChange: (be) => se(g, be.target.value),
|
|
12495
|
-
readOnly:
|
|
12496
|
-
error:
|
|
12491
|
+
readOnly: T,
|
|
12492
|
+
error: I
|
|
12497
12493
|
},
|
|
12498
12494
|
ue
|
|
12499
12495
|
);
|
|
@@ -12501,19 +12497,19 @@ const Fa = ({
|
|
|
12501
12497
|
return /* @__PURE__ */ r(
|
|
12502
12498
|
Se,
|
|
12503
12499
|
{
|
|
12504
|
-
required:
|
|
12500
|
+
required: C,
|
|
12505
12501
|
type: "text",
|
|
12506
12502
|
label: we,
|
|
12507
12503
|
placeholder: le ? void 0 : N,
|
|
12508
12504
|
value: _[g] || "",
|
|
12509
12505
|
onChange: (be) => se(g, be.target.value),
|
|
12510
|
-
readOnly:
|
|
12511
|
-
error:
|
|
12506
|
+
readOnly: T,
|
|
12507
|
+
error: I
|
|
12512
12508
|
},
|
|
12513
12509
|
ue
|
|
12514
12510
|
);
|
|
12515
12511
|
}
|
|
12516
|
-
}, Ke = (g,
|
|
12512
|
+
}, Ke = (g, A) => {
|
|
12517
12513
|
if (g.customType === "paragraph")
|
|
12518
12514
|
return /* @__PURE__ */ r(
|
|
12519
12515
|
"p",
|
|
@@ -12521,12 +12517,12 @@ const Fa = ({
|
|
|
12521
12517
|
style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12522
12518
|
dangerouslySetInnerHTML: { __html: ve(g.displayText, d) || ve(g.label, d) || "" }
|
|
12523
12519
|
},
|
|
12524
|
-
`custom-${
|
|
12520
|
+
`custom-${A}`
|
|
12525
12521
|
);
|
|
12526
12522
|
if (g.customType === "html")
|
|
12527
|
-
return /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: ve(g.label, d) || "" } }, `custom-${
|
|
12523
|
+
return /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: ve(g.label, d) || "" } }, `custom-${A}`);
|
|
12528
12524
|
if (g.customType === "br")
|
|
12529
|
-
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${
|
|
12525
|
+
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${A}`);
|
|
12530
12526
|
if (g.customType === "link")
|
|
12531
12527
|
return /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
12532
12528
|
"a",
|
|
@@ -12537,53 +12533,53 @@ const Fa = ({
|
|
|
12537
12533
|
style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
|
|
12538
12534
|
children: ve(g.displayText, d) || ve(g.label, d) || g.linkText || g.linkUrl || ""
|
|
12539
12535
|
}
|
|
12540
|
-
) }, `custom-${
|
|
12536
|
+
) }, `custom-${A}`);
|
|
12541
12537
|
if (!g.paramName) return null;
|
|
12542
|
-
const
|
|
12538
|
+
const w = xe[g.paramName], u = ve(g.displayText, d) || ve(g.label, d) || g.paramName, c = g.labelMode ? g.labelMode !== "placeholder" : q;
|
|
12543
12539
|
return g.customType === "checkbox" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
12544
12540
|
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
12545
12541
|
/* @__PURE__ */ r(
|
|
12546
12542
|
Ue,
|
|
12547
12543
|
{
|
|
12548
12544
|
checked: H[g.paramName] === "true",
|
|
12549
|
-
onChange: (k) =>
|
|
12545
|
+
onChange: (k) => j(g.paramName, k ? "true" : "false")
|
|
12550
12546
|
}
|
|
12551
12547
|
),
|
|
12552
12548
|
/* @__PURE__ */ o("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
12553
|
-
|
|
12549
|
+
u,
|
|
12554
12550
|
g.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
12555
12551
|
] })
|
|
12556
12552
|
] }),
|
|
12557
|
-
|
|
12558
|
-
] }, `custom-${
|
|
12553
|
+
w && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: w })
|
|
12554
|
+
] }, `custom-${A}`) : /* @__PURE__ */ r(
|
|
12559
12555
|
Se,
|
|
12560
12556
|
{
|
|
12561
12557
|
type: "text",
|
|
12562
|
-
label: c ? `${
|
|
12563
|
-
placeholder: c ? void 0 :
|
|
12558
|
+
label: c ? `${u}${g.required ? " *" : ""}` : void 0,
|
|
12559
|
+
placeholder: c ? void 0 : u,
|
|
12564
12560
|
value: H[g.paramName] || "",
|
|
12565
|
-
onChange: (k) =>
|
|
12561
|
+
onChange: (k) => j(g.paramName, k.target.value),
|
|
12566
12562
|
required: g.required,
|
|
12567
|
-
error:
|
|
12563
|
+
error: w
|
|
12568
12564
|
},
|
|
12569
|
-
`custom-${
|
|
12565
|
+
`custom-${A}`
|
|
12570
12566
|
);
|
|
12571
12567
|
}, ct = (g) => {
|
|
12572
|
-
const
|
|
12568
|
+
const A = ne(g);
|
|
12573
12569
|
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
12574
12570
|
g.conditionalOn && /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
12575
12571
|
/* @__PURE__ */ r(
|
|
12576
12572
|
Ue,
|
|
12577
12573
|
{
|
|
12578
|
-
checked:
|
|
12579
|
-
onChange: (
|
|
12574
|
+
checked: A,
|
|
12575
|
+
onChange: (w) => j(g.conditionalOn, w ? "true" : "false")
|
|
12580
12576
|
}
|
|
12581
12577
|
),
|
|
12582
12578
|
/* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: g.conditionalOn })
|
|
12583
12579
|
] }),
|
|
12584
|
-
|
|
12585
|
-
const c = Math.min(4, Math.max(1, Number(
|
|
12586
|
-
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${c} / span ${c}` }, children:
|
|
12580
|
+
A && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: g.fields.map((w, u) => {
|
|
12581
|
+
const c = Math.min(4, Math.max(1, Number(w.colSpan) || 4)), k = w.isCustom ? `custom-${u}-${w.paramName}` : `builtin-${w.name}-${u}`;
|
|
12582
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${c} / span ${c}` }, children: w.isCustom ? Ke(w, u) : rt(w.name, k, w.displayText, w.countriesType, w.labelMode) }, k);
|
|
12587
12583
|
}) })
|
|
12588
12584
|
] });
|
|
12589
12585
|
};
|
|
@@ -12593,7 +12589,7 @@ const Fa = ({
|
|
|
12593
12589
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: d("common.loadingForm") })
|
|
12594
12590
|
] }) }) });
|
|
12595
12591
|
if (S) {
|
|
12596
|
-
const g = S[pe] ?? S[0],
|
|
12592
|
+
const g = S[pe] ?? S[0], A = Ie === -1, w = Z === -1, u = S.length, c = ne(g), k = Object.values(xe);
|
|
12597
12593
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(re, { children: [
|
|
12598
12594
|
/* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(ft, { title: (s == null ? void 0 : s.title) || d("createCompany.title") }) }),
|
|
12599
12595
|
/* @__PURE__ */ o(ie, { children: [
|
|
@@ -12601,38 +12597,38 @@ const Fa = ({
|
|
|
12601
12597
|
g.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.title }),
|
|
12602
12598
|
g.subtitle && /* @__PURE__ */ r("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g.subtitle })
|
|
12603
12599
|
] }),
|
|
12604
|
-
(
|
|
12605
|
-
|
|
12600
|
+
(D || k.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
12601
|
+
D && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
12606
12602
|
/* @__PURE__ */ r("strong", { children: d("common.errorPrefix") }),
|
|
12607
12603
|
" ",
|
|
12608
|
-
|
|
12604
|
+
D
|
|
12609
12605
|
] }),
|
|
12610
|
-
k.map((
|
|
12606
|
+
k.map((C, I) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: C }, I))
|
|
12611
12607
|
] }),
|
|
12612
|
-
|
|
12613
|
-
S.map((
|
|
12608
|
+
u > 1 && /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "1rem" }, children: [
|
|
12609
|
+
S.map((C, I) => /* @__PURE__ */ r(
|
|
12614
12610
|
"div",
|
|
12615
12611
|
{
|
|
12616
12612
|
style: {
|
|
12617
12613
|
height: "0.375rem",
|
|
12618
12614
|
borderRadius: "9999px",
|
|
12619
12615
|
transition: "all 150ms",
|
|
12620
|
-
...
|
|
12616
|
+
...I === pe ? { flex: "1 1 0%", backgroundColor: "var(--metakyc-primary, #2563eb)", opacity: 0.3 } : I < pe ? { width: "2rem", backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { width: "2rem", backgroundColor: "#e5e7eb", opacity: 0.3 }
|
|
12621
12617
|
}
|
|
12622
12618
|
},
|
|
12623
|
-
|
|
12619
|
+
I
|
|
12624
12620
|
)),
|
|
12625
12621
|
/* @__PURE__ */ o("span", { style: { fontSize: "0.75rem", color: "var(--metakyc-text-muted, #9ca3af)", flexShrink: 0 }, children: [
|
|
12626
12622
|
pe + 1,
|
|
12627
12623
|
" / ",
|
|
12628
|
-
|
|
12624
|
+
u
|
|
12629
12625
|
] })
|
|
12630
12626
|
] }),
|
|
12631
12627
|
ct(g)
|
|
12632
12628
|
] }),
|
|
12633
12629
|
/* @__PURE__ */ o(Te, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
12634
12630
|
/* @__PURE__ */ o("div", { children: [
|
|
12635
|
-
!
|
|
12631
|
+
!A && /* @__PURE__ */ r(
|
|
12636
12632
|
G,
|
|
12637
12633
|
{
|
|
12638
12634
|
type: "button",
|
|
@@ -12640,29 +12636,29 @@ const Fa = ({
|
|
|
12640
12636
|
onClick: () => {
|
|
12641
12637
|
ge(Ie), me({});
|
|
12642
12638
|
},
|
|
12643
|
-
disabled: O ||
|
|
12639
|
+
disabled: O || m,
|
|
12644
12640
|
children: d("common.previous")
|
|
12645
12641
|
}
|
|
12646
12642
|
),
|
|
12647
|
-
|
|
12643
|
+
A && a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: O || m, children: "Cancel" })
|
|
12648
12644
|
] }),
|
|
12649
|
-
/* @__PURE__ */ r(G, { type: "button", isLoading: O ||
|
|
12645
|
+
/* @__PURE__ */ r(G, { type: "button", isLoading: O || m, onClick: w ? We : ze, children: w ? g.conditionalOn && !c ? d("common.skipAndSubmit") : d("common.submit") : g.conditionalOn && !c ? d("common.skip") : d("common.next") })
|
|
12650
12646
|
] })
|
|
12651
12647
|
] }) });
|
|
12652
12648
|
}
|
|
12653
12649
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: lt, children: /* @__PURE__ */ o(re, { children: [
|
|
12654
12650
|
/* @__PURE__ */ r(Ne, { children: /* @__PURE__ */ r(ft, { title: (s == null ? void 0 : s.title) || d("createCompany.title") }) }),
|
|
12655
12651
|
/* @__PURE__ */ o(ie, { children: [
|
|
12656
|
-
|
|
12652
|
+
D && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
12657
12653
|
/* @__PURE__ */ r("strong", { children: d("common.errorPrefix") }),
|
|
12658
12654
|
" ",
|
|
12659
|
-
|
|
12655
|
+
D
|
|
12660
12656
|
] }) }),
|
|
12661
12657
|
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: B.map((g) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children: rt(g) }, g)) })
|
|
12662
12658
|
] }),
|
|
12663
12659
|
/* @__PURE__ */ o(Te, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
12664
|
-
a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: O ||
|
|
12665
|
-
/* @__PURE__ */ r(G, { type: "submit", isLoading: O ||
|
|
12660
|
+
a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: O || m, children: "Cancel" }),
|
|
12661
|
+
/* @__PURE__ */ r(G, { type: "submit", isLoading: O || m, children: d("createCompany.registerCompany") })
|
|
12666
12662
|
] })
|
|
12667
12663
|
] }) }) });
|
|
12668
12664
|
}, Oa = ({
|
|
@@ -12675,29 +12671,29 @@ const Fa = ({
|
|
|
12675
12671
|
progress: l,
|
|
12676
12672
|
currentStep: s,
|
|
12677
12673
|
steps: p,
|
|
12678
|
-
workflowKey:
|
|
12674
|
+
workflowKey: m,
|
|
12679
12675
|
nextWorkflowKey: d,
|
|
12680
12676
|
hasWorkflowChanged: y,
|
|
12681
|
-
isLoading:
|
|
12682
|
-
error:
|
|
12683
|
-
moveBack:
|
|
12684
|
-
refreshProgress:
|
|
12685
|
-
} = zi(e), [q, S] = Ce.useState(!1),
|
|
12677
|
+
isLoading: h,
|
|
12678
|
+
error: R,
|
|
12679
|
+
moveBack: L,
|
|
12680
|
+
refreshProgress: b
|
|
12681
|
+
} = zi(e), [q, S] = Ce.useState(!1), P = Ce.useRef(null);
|
|
12686
12682
|
if (Ce.useEffect(() => {
|
|
12687
|
-
|
|
12688
|
-
}, [
|
|
12683
|
+
R && i && i(R);
|
|
12684
|
+
}, [R, i]), Ce.useEffect(() => {
|
|
12689
12685
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
12690
12686
|
}, [l == null ? void 0 : l.workflowResult, t]), Ce.useEffect(() => {
|
|
12691
12687
|
y && S(!1);
|
|
12692
|
-
}, [y]),
|
|
12688
|
+
}, [y]), h || !l)
|
|
12693
12689
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ o(ie, { children: [
|
|
12694
12690
|
/* @__PURE__ */ r(Ve, { className: "my-8" }),
|
|
12695
12691
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n("workflow.loadingWorkflow") })
|
|
12696
12692
|
] }) }) });
|
|
12697
|
-
if (
|
|
12693
|
+
if (R)
|
|
12698
12694
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
12699
12695
|
/* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: n("workflow.errorOccurred") }),
|
|
12700
|
-
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
12696
|
+
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: R.message })
|
|
12701
12697
|
] }) }) }) });
|
|
12702
12698
|
if (y && !q)
|
|
12703
12699
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ie, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
@@ -12708,7 +12704,7 @@ const Fa = ({
|
|
|
12708
12704
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between text-sm", children: [
|
|
12709
12705
|
/* @__PURE__ */ o("div", { className: "text-left", children: [
|
|
12710
12706
|
/* @__PURE__ */ r("p", { className: "mb-1", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: n("workflow.previousWorkflow") }),
|
|
12711
|
-
/* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
12707
|
+
/* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: m })
|
|
12712
12708
|
] }),
|
|
12713
12709
|
/* @__PURE__ */ r("svg", { className: "w-6 h-6 mx-4", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
|
|
12714
12710
|
/* @__PURE__ */ o("div", { className: "text-right", children: [
|
|
@@ -12771,7 +12767,7 @@ const Fa = ({
|
|
|
12771
12767
|
return "";
|
|
12772
12768
|
}
|
|
12773
12769
|
}, F = () => {
|
|
12774
|
-
const K = p.filter((V) => V.visibility !== !1), J = K.findIndex((V) => V.order === s.order), ae = J >= 0 ? J + 1 : 1,
|
|
12770
|
+
const K = p.filter((V) => V.visibility !== !1), J = K.findIndex((V) => V.order === s.order), ae = J >= 0 ? J + 1 : 1, x = K.length, z = x > 1 ? (J + 1) / x * 100 : 100;
|
|
12775
12771
|
return /* @__PURE__ */ o("div", { style: {
|
|
12776
12772
|
marginBottom: "24px",
|
|
12777
12773
|
backgroundColor: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
|
|
@@ -12782,7 +12778,7 @@ const Fa = ({
|
|
|
12782
12778
|
}, children: [
|
|
12783
12779
|
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
12784
12780
|
/* @__PURE__ */ r(ft, {}),
|
|
12785
|
-
/* @__PURE__ */ r(rr, { variant: l.status === 1 ? "info" : "success", children: n("common.stepXofY", { current: ae, total:
|
|
12781
|
+
/* @__PURE__ */ r(rr, { variant: l.status === 1 ? "info" : "success", children: n("common.stepXofY", { current: ae, total: x }) })
|
|
12786
12782
|
] }),
|
|
12787
12783
|
/* @__PURE__ */ o("div", { style: { position: "relative", height: "4px", borderRadius: "999px", overflow: "hidden", marginBottom: "16px" }, children: [
|
|
12788
12784
|
/* @__PURE__ */ r("div", { style: { position: "absolute", inset: 0, backgroundColor: "var(--metakyc-border, #e5e7eb)", opacity: 0.3 } }),
|
|
@@ -12793,14 +12789,14 @@ const Fa = ({
|
|
|
12793
12789
|
bottom: 0,
|
|
12794
12790
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
12795
12791
|
opacity: 0.3,
|
|
12796
|
-
width: `${
|
|
12792
|
+
width: `${z}%`,
|
|
12797
12793
|
transition: "width 0.4s ease"
|
|
12798
12794
|
} })
|
|
12799
12795
|
] }),
|
|
12800
12796
|
/* @__PURE__ */ r(
|
|
12801
12797
|
ka,
|
|
12802
12798
|
{
|
|
12803
|
-
ref:
|
|
12799
|
+
ref: P,
|
|
12804
12800
|
visibleSteps: K,
|
|
12805
12801
|
currentVisibleStepIndex: J,
|
|
12806
12802
|
getStepFallbackName: B
|
|
@@ -12811,9 +12807,9 @@ const Fa = ({
|
|
|
12811
12807
|
const K = {
|
|
12812
12808
|
applicantId: e,
|
|
12813
12809
|
onComplete: async () => {
|
|
12814
|
-
await
|
|
12810
|
+
await b();
|
|
12815
12811
|
},
|
|
12816
|
-
onBack: s.order > 0 ?
|
|
12812
|
+
onBack: s.order > 0 ? L : void 0
|
|
12817
12813
|
};
|
|
12818
12814
|
switch (s.action) {
|
|
12819
12815
|
case ce.Questionaries:
|
|
@@ -12866,8 +12862,8 @@ const Fa = ({
|
|
|
12866
12862
|
const n = Ce.useRef(null), l = Ce.useRef(null);
|
|
12867
12863
|
return Ce.useImperativeHandle(a, () => n.current), Ce.useEffect(() => {
|
|
12868
12864
|
if (l.current && n.current) {
|
|
12869
|
-
const s = n.current, p = l.current,
|
|
12870
|
-
s.scrollTo({ left: Math.max(0,
|
|
12865
|
+
const s = n.current, p = l.current, m = p.offsetLeft - s.offsetWidth / 2 + p.offsetWidth / 2;
|
|
12866
|
+
s.scrollTo({ left: Math.max(0, m), behavior: "smooth" });
|
|
12871
12867
|
}
|
|
12872
12868
|
}, [t]), /* @__PURE__ */ r(
|
|
12873
12869
|
"div",
|
|
@@ -12887,7 +12883,7 @@ const Fa = ({
|
|
|
12887
12883
|
gap: "0"
|
|
12888
12884
|
},
|
|
12889
12885
|
children: e.map((s, p) => {
|
|
12890
|
-
const
|
|
12886
|
+
const m = p < t, d = p === t, y = m || d, h = s.displayName || s.name || i(s.action) || `Step ${p + 1}`;
|
|
12891
12887
|
return /* @__PURE__ */ o(Ce.Fragment, { children: [
|
|
12892
12888
|
/* @__PURE__ */ o(
|
|
12893
12889
|
"div",
|
|
@@ -12919,15 +12915,15 @@ const Fa = ({
|
|
|
12919
12915
|
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
12920
12916
|
border: "2px solid var(--metakyc-border, #e5e7eb)"
|
|
12921
12917
|
}
|
|
12922
|
-
}, children:
|
|
12918
|
+
}, children: m ? /* @__PURE__ */ r("svg", { width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : p + 1 }),
|
|
12923
12919
|
/* @__PURE__ */ r("span", { style: {
|
|
12924
12920
|
marginLeft: "6px",
|
|
12925
12921
|
fontSize: "13px",
|
|
12926
12922
|
whiteSpace: "nowrap",
|
|
12927
12923
|
fontWeight: d ? 600 : 400,
|
|
12928
|
-
color: d ? "var(--metakyc-text-primary, #111827)" :
|
|
12924
|
+
color: d ? "var(--metakyc-text-primary, #111827)" : m ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
12929
12925
|
transition: "color 0.2s ease"
|
|
12930
|
-
}, children:
|
|
12926
|
+
}, children: h })
|
|
12931
12927
|
]
|
|
12932
12928
|
}
|
|
12933
12929
|
),
|
|
@@ -12938,7 +12934,7 @@ const Fa = ({
|
|
|
12938
12934
|
margin: "0 8px",
|
|
12939
12935
|
borderRadius: "999px",
|
|
12940
12936
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
12941
|
-
opacity:
|
|
12937
|
+
opacity: m ? 1 : 0.25,
|
|
12942
12938
|
transition: "opacity 0.2s ease"
|
|
12943
12939
|
} })
|
|
12944
12940
|
] }, s.order);
|