@vpdev2/metakyc-sdk 1.0.6 → 1.0.7
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/identity/IdentityVerificationStep.d.ts.map +1 -1
- package/dist/context/MetaKYCProvider.d.ts.map +1 -1
- package/dist/hooks/useIdentityVerification.d.ts.map +1 -1
- package/dist/hooks/useKycWorkflow.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +442 -419
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@ var Je = Object.defineProperty;
|
|
|
2
2
|
var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import et from "axios";
|
|
5
|
-
import * as
|
|
6
|
-
import le, { createContext as tt, useState as x, useMemo as
|
|
5
|
+
import * as Te from "react";
|
|
6
|
+
import le, { createContext as tt, useState as x, useMemo as je, useEffect as V, useContext as rt, useRef as ve, useCallback as q, forwardRef as Pe } from "react";
|
|
7
7
|
import { jsx as n, jsxs as o, Fragment as nt } from "react/jsx-runtime";
|
|
8
|
-
import { get as
|
|
8
|
+
import { get as Ie, set as Ae, appendErrors as _e, useForm as Fe, Controller as G } from "react-hook-form";
|
|
9
9
|
import { z as de } from "zod";
|
|
10
|
-
var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}),
|
|
10
|
+
var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}), ke = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(ke || {}), ae = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(ae || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), he = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(he || {}), pe = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(pe || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), se = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(se || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), Ne = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Ne || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), Re = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Re || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), ee = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(ee || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
|
|
11
11
|
const gt = [
|
|
12
12
|
"firstName",
|
|
13
13
|
"lastName",
|
|
@@ -1776,50 +1776,57 @@ class Ut {
|
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
1778
|
const Ue = tt(null), Or = ({ config: t, children: e }) => {
|
|
1779
|
-
const [r, s] = x(null), a =
|
|
1780
|
-
const
|
|
1779
|
+
const [r, s] = x(null), a = le.useRef(!1), i = je(() => {
|
|
1780
|
+
const c = new xt(t), l = new vt(c), d = new wt(c), u = new kt(c), g = new Nt(c), p = new St(c), m = new Ct(c), v = new At(c), b = new Et(c), y = new It(c), P = new Mt(c), f = new Ut();
|
|
1781
1781
|
return {
|
|
1782
1782
|
config: t,
|
|
1783
|
-
httpClient:
|
|
1784
|
-
applicantService:
|
|
1785
|
-
questionnaireService:
|
|
1786
|
-
uploadDocumentService:
|
|
1787
|
-
appropriatenessTestService:
|
|
1788
|
-
overviewService:
|
|
1789
|
-
riskScoringService:
|
|
1790
|
-
identityService:
|
|
1783
|
+
httpClient: c,
|
|
1784
|
+
applicantService: l,
|
|
1785
|
+
questionnaireService: d,
|
|
1786
|
+
uploadDocumentService: u,
|
|
1787
|
+
appropriatenessTestService: g,
|
|
1788
|
+
overviewService: p,
|
|
1789
|
+
riskScoringService: m,
|
|
1790
|
+
identityService: v,
|
|
1791
1791
|
baseInformationService: b,
|
|
1792
1792
|
investorCategorizationService: y,
|
|
1793
|
-
themeService:
|
|
1794
|
-
themeManager:
|
|
1793
|
+
themeService: P,
|
|
1794
|
+
themeManager: f,
|
|
1795
1795
|
currentTheme: r,
|
|
1796
1796
|
createOrchestrator: () => new $t(
|
|
1797
|
-
c,
|
|
1798
1797
|
l,
|
|
1799
1798
|
d,
|
|
1800
1799
|
u,
|
|
1801
1800
|
g,
|
|
1802
1801
|
p,
|
|
1803
1802
|
m,
|
|
1803
|
+
v,
|
|
1804
1804
|
y
|
|
1805
1805
|
)
|
|
1806
1806
|
};
|
|
1807
1807
|
}, [t, r]);
|
|
1808
1808
|
return V(() => ((async () => {
|
|
1809
|
+
if (a.current) {
|
|
1810
|
+
console.log("[MetaKYC] Theme load already in progress, skipping...");
|
|
1811
|
+
return;
|
|
1812
|
+
}
|
|
1813
|
+
a.current = !0;
|
|
1809
1814
|
try {
|
|
1810
1815
|
if (t.theme) {
|
|
1811
|
-
console.log("[MetaKYC] Applying static theme from config"),
|
|
1816
|
+
console.log("[MetaKYC] Applying static theme from config"), i.themeManager.applyTheme(t.theme), s(i.themeManager.getCurrentTheme());
|
|
1812
1817
|
return;
|
|
1813
1818
|
}
|
|
1814
1819
|
console.log("[MetaKYC] Fetching theme from backend...");
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1817
|
-
} catch (
|
|
1818
|
-
console.warn("[MetaKYC] Failed to load theme, using default:",
|
|
1820
|
+
const l = await i.themeService.getThemeConfiguration();
|
|
1821
|
+
i.themeManager.applyTheme(l), s(i.themeManager.getCurrentTheme()), console.log("[MetaKYC] Theme loaded and applied", l);
|
|
1822
|
+
} catch (l) {
|
|
1823
|
+
console.warn("[MetaKYC] Failed to load theme, using default:", l), s(i.themeManager.getCurrentTheme());
|
|
1824
|
+
} finally {
|
|
1825
|
+
a.current = !1;
|
|
1819
1826
|
}
|
|
1820
1827
|
})(), () => {
|
|
1821
|
-
|
|
1822
|
-
}), [t.theme,
|
|
1828
|
+
i.themeManager.cleanup();
|
|
1829
|
+
}), [t.theme, i.themeService, i.themeManager]), /* @__PURE__ */ n(Ue.Provider, { value: i, children: e });
|
|
1823
1830
|
};
|
|
1824
1831
|
function re() {
|
|
1825
1832
|
const t = rt(Ue);
|
|
@@ -1848,7 +1855,7 @@ function $r(t, e) {
|
|
|
1848
1855
|
return t.type === s;
|
|
1849
1856
|
});
|
|
1850
1857
|
}
|
|
1851
|
-
function
|
|
1858
|
+
function Ee(t) {
|
|
1852
1859
|
if (t === 0) return "0 Bytes";
|
|
1853
1860
|
const e = 1024, r = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(t) / Math.log(e));
|
|
1854
1861
|
return Math.round(t / Math.pow(e, s) * 100) / 100 + " " + r[s];
|
|
@@ -1911,7 +1918,7 @@ function Kr() {
|
|
|
1911
1918
|
Yt(), Qt();
|
|
1912
1919
|
}
|
|
1913
1920
|
function Gt(t) {
|
|
1914
|
-
const { createOrchestrator: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(null), d =
|
|
1921
|
+
const { createOrchestrator: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(null), d = ve(null), u = t || Vt();
|
|
1915
1922
|
V(() => {
|
|
1916
1923
|
d.current || (d.current = e());
|
|
1917
1924
|
}, [e]), V(() => {
|
|
@@ -1925,35 +1932,43 @@ function Gt(t) {
|
|
|
1925
1932
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1926
1933
|
}));
|
|
1927
1934
|
}, [r, u]);
|
|
1928
|
-
const g = q(async () => {
|
|
1935
|
+
const g = ve(!1), p = ve(!1), m = q(async () => {
|
|
1929
1936
|
if (!(!u || !d.current)) {
|
|
1930
|
-
|
|
1937
|
+
if (g.current) {
|
|
1938
|
+
console.log("[Workflow] Load already in progress, skipping...");
|
|
1939
|
+
return;
|
|
1940
|
+
}
|
|
1941
|
+
g.current = !0, i(!0), l(null);
|
|
1931
1942
|
try {
|
|
1932
1943
|
const h = await d.current.initialize(u);
|
|
1933
|
-
s(h);
|
|
1944
|
+
s(h), p.current = !0;
|
|
1934
1945
|
} catch (h) {
|
|
1935
1946
|
l(h);
|
|
1936
1947
|
} finally {
|
|
1937
|
-
i(!1);
|
|
1948
|
+
i(!1), g.current = !1;
|
|
1938
1949
|
}
|
|
1939
1950
|
}
|
|
1940
1951
|
}, [u]);
|
|
1941
1952
|
V(() => {
|
|
1942
|
-
u &&
|
|
1943
|
-
}, [u,
|
|
1944
|
-
const
|
|
1953
|
+
u && !p.current && m();
|
|
1954
|
+
}, [u, m]);
|
|
1955
|
+
const v = q(async () => {
|
|
1945
1956
|
if (d.current) {
|
|
1946
|
-
|
|
1957
|
+
if (g.current) {
|
|
1958
|
+
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
1959
|
+
return;
|
|
1960
|
+
}
|
|
1961
|
+
g.current = !0, i(!0), l(null);
|
|
1947
1962
|
try {
|
|
1948
1963
|
const h = await d.current.refreshProgress();
|
|
1949
1964
|
s(h);
|
|
1950
1965
|
} catch (h) {
|
|
1951
1966
|
l(h);
|
|
1952
1967
|
} finally {
|
|
1953
|
-
i(!1);
|
|
1968
|
+
i(!1), g.current = !1;
|
|
1954
1969
|
}
|
|
1955
1970
|
}
|
|
1956
|
-
}, []),
|
|
1971
|
+
}, []), b = q(async () => {
|
|
1957
1972
|
if (d.current) {
|
|
1958
1973
|
i(!0), l(null);
|
|
1959
1974
|
try {
|
|
@@ -1965,7 +1980,7 @@ function Gt(t) {
|
|
|
1965
1980
|
i(!1);
|
|
1966
1981
|
}
|
|
1967
1982
|
}
|
|
1968
|
-
}, []),
|
|
1983
|
+
}, []), y = q(async () => {
|
|
1969
1984
|
if (d.current) {
|
|
1970
1985
|
i(!0), l(null);
|
|
1971
1986
|
try {
|
|
@@ -1977,7 +1992,7 @@ function Gt(t) {
|
|
|
1977
1992
|
i(!1);
|
|
1978
1993
|
}
|
|
1979
1994
|
}
|
|
1980
|
-
}, []),
|
|
1995
|
+
}, []), P = q(async (h) => {
|
|
1981
1996
|
if (d.current) {
|
|
1982
1997
|
i(!0), l(null);
|
|
1983
1998
|
try {
|
|
@@ -1990,7 +2005,7 @@ function Gt(t) {
|
|
|
1990
2005
|
i(!1);
|
|
1991
2006
|
}
|
|
1992
2007
|
}
|
|
1993
|
-
}, []), f =
|
|
2008
|
+
}, []), f = Te.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((h, N) => h.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), E = Te.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
1994
2009
|
return {
|
|
1995
2010
|
progress: r,
|
|
1996
2011
|
applicantId: u,
|
|
@@ -2000,15 +2015,15 @@ function Gt(t) {
|
|
|
2000
2015
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2001
2016
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
2002
2017
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2003
|
-
hasWorkflowChanged:
|
|
2018
|
+
hasWorkflowChanged: E,
|
|
2004
2019
|
isLoading: a,
|
|
2005
2020
|
error: c,
|
|
2006
2021
|
isComplete: (r == null ? void 0 : r.status) === ae.Finished,
|
|
2007
2022
|
isOnHold: (r == null ? void 0 : r.status) === ae.OnHold,
|
|
2008
|
-
refreshProgress:
|
|
2009
|
-
moveToNext:
|
|
2010
|
-
moveBack:
|
|
2011
|
-
submitCurrentStep:
|
|
2023
|
+
refreshProgress: v,
|
|
2024
|
+
moveToNext: b,
|
|
2025
|
+
moveBack: y,
|
|
2026
|
+
submitCurrentStep: P,
|
|
2012
2027
|
orchestrator: d.current
|
|
2013
2028
|
};
|
|
2014
2029
|
}
|
|
@@ -2034,8 +2049,8 @@ function Zt(t) {
|
|
|
2034
2049
|
l(!0), u(null);
|
|
2035
2050
|
try {
|
|
2036
2051
|
return await e.fillQuestionnaire(m);
|
|
2037
|
-
} catch (
|
|
2038
|
-
throw u(
|
|
2052
|
+
} catch (v) {
|
|
2053
|
+
throw u(v), v;
|
|
2039
2054
|
} finally {
|
|
2040
2055
|
l(!1);
|
|
2041
2056
|
}
|
|
@@ -2056,10 +2071,10 @@ function Jt(t) {
|
|
|
2056
2071
|
if (t) {
|
|
2057
2072
|
i(!0), p(null);
|
|
2058
2073
|
try {
|
|
2059
|
-
const
|
|
2060
|
-
s(
|
|
2061
|
-
} catch (
|
|
2062
|
-
p(
|
|
2074
|
+
const b = await e.getUploadDocument(t);
|
|
2075
|
+
s(b);
|
|
2076
|
+
} catch (b) {
|
|
2077
|
+
p(b);
|
|
2063
2078
|
} finally {
|
|
2064
2079
|
i(!1);
|
|
2065
2080
|
}
|
|
@@ -2068,13 +2083,13 @@ function Jt(t) {
|
|
|
2068
2083
|
V(() => {
|
|
2069
2084
|
t && m();
|
|
2070
2085
|
}, [t, m]);
|
|
2071
|
-
const
|
|
2072
|
-
async (
|
|
2086
|
+
const v = q(
|
|
2087
|
+
async (b) => {
|
|
2073
2088
|
l(!0), u(0), p(null);
|
|
2074
2089
|
try {
|
|
2075
|
-
await e.fillUploadDocument(
|
|
2076
|
-
} catch (
|
|
2077
|
-
throw p(
|
|
2090
|
+
await e.fillUploadDocument(b), u(100);
|
|
2091
|
+
} catch (y) {
|
|
2092
|
+
throw p(y), y;
|
|
2078
2093
|
} finally {
|
|
2079
2094
|
l(!1);
|
|
2080
2095
|
}
|
|
@@ -2088,7 +2103,7 @@ function Jt(t) {
|
|
|
2088
2103
|
uploadProgress: d,
|
|
2089
2104
|
error: g,
|
|
2090
2105
|
load: m,
|
|
2091
|
-
submit:
|
|
2106
|
+
submit: v
|
|
2092
2107
|
};
|
|
2093
2108
|
}
|
|
2094
2109
|
function Ur(t) {
|
|
@@ -2096,10 +2111,10 @@ function Ur(t) {
|
|
|
2096
2111
|
if (t) {
|
|
2097
2112
|
i(!0), u(null);
|
|
2098
2113
|
try {
|
|
2099
|
-
const
|
|
2100
|
-
s(
|
|
2101
|
-
} catch (
|
|
2102
|
-
u(
|
|
2114
|
+
const b = await e.getAppropriatenessTest(t);
|
|
2115
|
+
s(b);
|
|
2116
|
+
} catch (b) {
|
|
2117
|
+
u(b);
|
|
2103
2118
|
} finally {
|
|
2104
2119
|
i(!1);
|
|
2105
2120
|
}
|
|
@@ -2108,14 +2123,14 @@ function Ur(t) {
|
|
|
2108
2123
|
V(() => {
|
|
2109
2124
|
t && m();
|
|
2110
2125
|
}, [t, m]);
|
|
2111
|
-
const
|
|
2112
|
-
async (
|
|
2126
|
+
const v = q(
|
|
2127
|
+
async (b) => {
|
|
2113
2128
|
l(!0), u(null);
|
|
2114
2129
|
try {
|
|
2115
|
-
const
|
|
2116
|
-
return p(
|
|
2117
|
-
} catch (
|
|
2118
|
-
throw u(
|
|
2130
|
+
const y = await e.fillAppropriatenessTest(b);
|
|
2131
|
+
return p(y), y;
|
|
2132
|
+
} catch (y) {
|
|
2133
|
+
throw u(y), y;
|
|
2119
2134
|
} finally {
|
|
2120
2135
|
l(!1);
|
|
2121
2136
|
}
|
|
@@ -2129,7 +2144,7 @@ function Ur(t) {
|
|
|
2129
2144
|
isSubmitting: c,
|
|
2130
2145
|
error: d,
|
|
2131
2146
|
load: m,
|
|
2132
|
-
submit:
|
|
2147
|
+
submit: v
|
|
2133
2148
|
};
|
|
2134
2149
|
}
|
|
2135
2150
|
function Xt(t) {
|
|
@@ -2173,16 +2188,20 @@ function Xt(t) {
|
|
|
2173
2188
|
function er(t) {
|
|
2174
2189
|
const { identityService: e } = re(), [r, s] = x(
|
|
2175
2190
|
null
|
|
2176
|
-
), [a, i] = x(!1), [c, l] = x(null), d = q(
|
|
2177
|
-
async (
|
|
2191
|
+
), [a, i] = x(!1), [c, l] = x(null), d = ve(!1), u = q(
|
|
2192
|
+
async (m, v) => {
|
|
2178
2193
|
if (t) {
|
|
2179
|
-
|
|
2194
|
+
if (d.current) {
|
|
2195
|
+
console.log("[Identity] Request already in progress, skipping...");
|
|
2196
|
+
return;
|
|
2197
|
+
}
|
|
2198
|
+
d.current = !0, i(!0), l(null);
|
|
2180
2199
|
try {
|
|
2181
2200
|
const b = {
|
|
2182
2201
|
applicantId: t,
|
|
2183
2202
|
restart: !1,
|
|
2184
|
-
redirectUrl:
|
|
2185
|
-
ttl:
|
|
2203
|
+
redirectUrl: m || "",
|
|
2204
|
+
ttl: v || 604800
|
|
2186
2205
|
// Default: 7 days
|
|
2187
2206
|
};
|
|
2188
2207
|
console.log("Identity request input:", b);
|
|
@@ -2191,21 +2210,21 @@ function er(t) {
|
|
|
2191
2210
|
} catch (b) {
|
|
2192
2211
|
throw l(b), b;
|
|
2193
2212
|
} finally {
|
|
2194
|
-
i(!1);
|
|
2213
|
+
i(!1), d.current = !1;
|
|
2195
2214
|
}
|
|
2196
2215
|
}
|
|
2197
2216
|
},
|
|
2198
2217
|
[t, e]
|
|
2199
|
-
),
|
|
2200
|
-
async (
|
|
2218
|
+
), g = q(
|
|
2219
|
+
async (m, v) => {
|
|
2201
2220
|
if (t) {
|
|
2202
2221
|
i(!0), l(null);
|
|
2203
2222
|
try {
|
|
2204
2223
|
const b = {
|
|
2205
2224
|
applicantId: t,
|
|
2206
2225
|
restart: !1,
|
|
2207
|
-
redirectUrl:
|
|
2208
|
-
ttl:
|
|
2226
|
+
redirectUrl: m,
|
|
2227
|
+
ttl: v
|
|
2209
2228
|
}, y = await e.identityCompanyRequest(b);
|
|
2210
2229
|
return s(y), y;
|
|
2211
2230
|
} catch (b) {
|
|
@@ -2216,24 +2235,28 @@ function er(t) {
|
|
|
2216
2235
|
}
|
|
2217
2236
|
},
|
|
2218
2237
|
[t, e]
|
|
2219
|
-
),
|
|
2238
|
+
), p = q(async () => {
|
|
2220
2239
|
if (t) {
|
|
2221
|
-
|
|
2240
|
+
if (d.current) {
|
|
2241
|
+
console.log("[Identity] Restart already in progress, skipping...");
|
|
2242
|
+
return;
|
|
2243
|
+
}
|
|
2244
|
+
d.current = !0, i(!0), l(null);
|
|
2222
2245
|
try {
|
|
2223
|
-
const
|
|
2246
|
+
const m = {
|
|
2224
2247
|
applicantId: t,
|
|
2225
2248
|
restart: !0,
|
|
2226
2249
|
redirectUrl: "",
|
|
2227
2250
|
ttl: 604800
|
|
2228
2251
|
// 7 days
|
|
2229
2252
|
};
|
|
2230
|
-
console.log("Restarting identity with input:",
|
|
2231
|
-
const
|
|
2232
|
-
return console.log("Restart identity result:",
|
|
2233
|
-
} catch (
|
|
2234
|
-
throw l(
|
|
2253
|
+
console.log("Restarting identity with input:", m);
|
|
2254
|
+
const v = await e.identityRequest(m);
|
|
2255
|
+
return console.log("Restart identity result:", v), s(v), v;
|
|
2256
|
+
} catch (m) {
|
|
2257
|
+
throw l(m), m;
|
|
2235
2258
|
} finally {
|
|
2236
|
-
i(!1);
|
|
2259
|
+
i(!1), d.current = !1;
|
|
2237
2260
|
}
|
|
2238
2261
|
}
|
|
2239
2262
|
}, [t, e]);
|
|
@@ -2243,9 +2266,9 @@ function er(t) {
|
|
|
2243
2266
|
token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
|
|
2244
2267
|
isLoading: a,
|
|
2245
2268
|
error: c,
|
|
2246
|
-
requestIdentity:
|
|
2247
|
-
requestCompanyIdentity:
|
|
2248
|
-
restartIdentity:
|
|
2269
|
+
requestIdentity: u,
|
|
2270
|
+
requestCompanyIdentity: g,
|
|
2271
|
+
restartIdentity: p
|
|
2249
2272
|
};
|
|
2250
2273
|
}
|
|
2251
2274
|
function tr(t) {
|
|
@@ -2253,10 +2276,10 @@ function tr(t) {
|
|
|
2253
2276
|
if (t) {
|
|
2254
2277
|
i(!0), u(null);
|
|
2255
2278
|
try {
|
|
2256
|
-
const
|
|
2257
|
-
s(
|
|
2258
|
-
} catch (
|
|
2259
|
-
u(
|
|
2279
|
+
const b = await e.getRiskCriterias(t);
|
|
2280
|
+
s(b);
|
|
2281
|
+
} catch (b) {
|
|
2282
|
+
u(b);
|
|
2260
2283
|
} finally {
|
|
2261
2284
|
i(!1);
|
|
2262
2285
|
}
|
|
@@ -2265,14 +2288,14 @@ function tr(t) {
|
|
|
2265
2288
|
V(() => {
|
|
2266
2289
|
t && m();
|
|
2267
2290
|
}, [t, m]);
|
|
2268
|
-
const
|
|
2269
|
-
async (
|
|
2291
|
+
const v = q(
|
|
2292
|
+
async (b) => {
|
|
2270
2293
|
l(!0), u(null);
|
|
2271
2294
|
try {
|
|
2272
|
-
const
|
|
2273
|
-
return p(
|
|
2274
|
-
} catch (
|
|
2275
|
-
throw u(
|
|
2295
|
+
const y = await e.submitRiskScoring(b);
|
|
2296
|
+
return p(y), y;
|
|
2297
|
+
} catch (y) {
|
|
2298
|
+
throw u(y), y;
|
|
2276
2299
|
} finally {
|
|
2277
2300
|
l(!1);
|
|
2278
2301
|
}
|
|
@@ -2286,7 +2309,7 @@ function tr(t) {
|
|
|
2286
2309
|
isSubmitting: c,
|
|
2287
2310
|
error: d,
|
|
2288
2311
|
load: m,
|
|
2289
|
-
submit:
|
|
2312
|
+
submit: v
|
|
2290
2313
|
};
|
|
2291
2314
|
}
|
|
2292
2315
|
function rr() {
|
|
@@ -2299,15 +2322,15 @@ function rr() {
|
|
|
2299
2322
|
s(!0), i(null);
|
|
2300
2323
|
try {
|
|
2301
2324
|
if (p.applicantAdditionalDatas || (p.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
|
|
2302
|
-
const
|
|
2303
|
-
console.log("[SardinAI] Generated session key:",
|
|
2325
|
+
const b = c();
|
|
2326
|
+
console.log("[SardinAI] Generated session key:", b), p.applicantAdditionalDatas.push({
|
|
2304
2327
|
paramName: "sessionKey",
|
|
2305
|
-
value:
|
|
2328
|
+
value: b
|
|
2306
2329
|
});
|
|
2307
2330
|
}
|
|
2308
2331
|
return await t.createApplicant(p);
|
|
2309
|
-
} catch (
|
|
2310
|
-
throw i(
|
|
2332
|
+
} catch (v) {
|
|
2333
|
+
throw i(v), v;
|
|
2311
2334
|
} finally {
|
|
2312
2335
|
s(!1);
|
|
2313
2336
|
}
|
|
@@ -2420,7 +2443,7 @@ const j = ({
|
|
|
2420
2443
|
]
|
|
2421
2444
|
}
|
|
2422
2445
|
);
|
|
2423
|
-
}, Z =
|
|
2446
|
+
}, Z = Pe(
|
|
2424
2447
|
({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2425
2448
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2426
2449
|
t,
|
|
@@ -2539,7 +2562,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2539
2562
|
]
|
|
2540
2563
|
}
|
|
2541
2564
|
) });
|
|
2542
|
-
}, ge =
|
|
2565
|
+
}, ge = Pe(
|
|
2543
2566
|
({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2544
2567
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2545
2568
|
t,
|
|
@@ -2587,27 +2610,27 @@ const nr = ({
|
|
|
2587
2610
|
value: c = [],
|
|
2588
2611
|
className: l
|
|
2589
2612
|
}) => {
|
|
2590
|
-
const [d, u] = x(!1), g =
|
|
2591
|
-
if (!
|
|
2592
|
-
const
|
|
2593
|
-
if (a &&
|
|
2594
|
-
const
|
|
2595
|
-
alert(`Some files exceed the maximum size of ${
|
|
2613
|
+
const [d, u] = x(!1), g = ve(null), p = (f) => {
|
|
2614
|
+
if (!f) return;
|
|
2615
|
+
const E = Array.from(f);
|
|
2616
|
+
if (a && E.filter((N) => N.size > a).length > 0) {
|
|
2617
|
+
const N = Ee(a);
|
|
2618
|
+
alert(`Some files exceed the maximum size of ${N}`);
|
|
2596
2619
|
return;
|
|
2597
2620
|
}
|
|
2598
|
-
i == null || i(s ? [...c, ...
|
|
2599
|
-
}, m = (
|
|
2600
|
-
|
|
2601
|
-
},
|
|
2621
|
+
i == null || i(s ? [...c, ...E] : [E[0]]);
|
|
2622
|
+
}, m = (f) => {
|
|
2623
|
+
f.preventDefault(), u(!0);
|
|
2624
|
+
}, v = () => {
|
|
2602
2625
|
u(!1);
|
|
2603
|
-
},
|
|
2604
|
-
|
|
2605
|
-
},
|
|
2606
|
-
var
|
|
2607
|
-
(
|
|
2608
|
-
}, P = (
|
|
2609
|
-
const
|
|
2610
|
-
i == null || i(
|
|
2626
|
+
}, b = (f) => {
|
|
2627
|
+
f.preventDefault(), u(!1), p(f.dataTransfer.files);
|
|
2628
|
+
}, y = () => {
|
|
2629
|
+
var f;
|
|
2630
|
+
(f = g.current) == null || f.click();
|
|
2631
|
+
}, P = (f) => {
|
|
2632
|
+
const E = c.filter((h, N) => N !== f);
|
|
2633
|
+
i == null || i(E);
|
|
2611
2634
|
};
|
|
2612
2635
|
return /* @__PURE__ */ o("div", { className: X("w-full", l), children: [
|
|
2613
2636
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
@@ -2620,9 +2643,9 @@ const nr = ({
|
|
|
2620
2643
|
e && "border-danger-500"
|
|
2621
2644
|
),
|
|
2622
2645
|
onDragOver: m,
|
|
2623
|
-
onDragLeave:
|
|
2624
|
-
onDrop:
|
|
2625
|
-
onClick:
|
|
2646
|
+
onDragLeave: v,
|
|
2647
|
+
onDrop: b,
|
|
2648
|
+
onClick: y,
|
|
2626
2649
|
children: [
|
|
2627
2650
|
/* @__PURE__ */ n(
|
|
2628
2651
|
"input",
|
|
@@ -2632,7 +2655,7 @@ const nr = ({
|
|
|
2632
2655
|
className: "hidden",
|
|
2633
2656
|
accept: r,
|
|
2634
2657
|
multiple: s,
|
|
2635
|
-
onChange: (
|
|
2658
|
+
onChange: (f) => p(f.target.files)
|
|
2636
2659
|
}
|
|
2637
2660
|
),
|
|
2638
2661
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -2660,13 +2683,13 @@ const nr = ({
|
|
|
2660
2683
|
] }),
|
|
2661
2684
|
a && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
|
|
2662
2685
|
"Maximum file size: ",
|
|
2663
|
-
|
|
2686
|
+
Ee(a)
|
|
2664
2687
|
] })
|
|
2665
2688
|
] })
|
|
2666
2689
|
]
|
|
2667
2690
|
}
|
|
2668
2691
|
),
|
|
2669
|
-
c.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: c.map((
|
|
2692
|
+
c.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: c.map((f, E) => /* @__PURE__ */ o(
|
|
2670
2693
|
"div",
|
|
2671
2694
|
{
|
|
2672
2695
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2688,10 +2711,10 @@ const nr = ({
|
|
|
2688
2711
|
)
|
|
2689
2712
|
}
|
|
2690
2713
|
),
|
|
2691
|
-
/* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
2714
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: f.name }),
|
|
2692
2715
|
/* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
|
|
2693
2716
|
"(",
|
|
2694
|
-
|
|
2717
|
+
Ee(f.size),
|
|
2695
2718
|
")"
|
|
2696
2719
|
] })
|
|
2697
2720
|
] }),
|
|
@@ -2699,8 +2722,8 @@ const nr = ({
|
|
|
2699
2722
|
"button",
|
|
2700
2723
|
{
|
|
2701
2724
|
type: "button",
|
|
2702
|
-
onClick: (
|
|
2703
|
-
|
|
2725
|
+
onClick: (h) => {
|
|
2726
|
+
h.stopPropagation(), P(E);
|
|
2704
2727
|
},
|
|
2705
2728
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2706
2729
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2715,11 +2738,11 @@ const nr = ({
|
|
|
2715
2738
|
)
|
|
2716
2739
|
]
|
|
2717
2740
|
},
|
|
2718
|
-
|
|
2741
|
+
E
|
|
2719
2742
|
)) }),
|
|
2720
2743
|
e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
|
|
2721
2744
|
] });
|
|
2722
|
-
}, sr =
|
|
2745
|
+
}, sr = Pe(
|
|
2723
2746
|
({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...s }, a) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2724
2747
|
s.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2725
2748
|
s.label,
|
|
@@ -2755,32 +2778,32 @@ const nr = ({
|
|
|
2755
2778
|
] })
|
|
2756
2779
|
);
|
|
2757
2780
|
sr.displayName = "PhoneInput";
|
|
2758
|
-
const
|
|
2781
|
+
const Me = (t, e, r) => {
|
|
2759
2782
|
if (t && "reportValidity" in t) {
|
|
2760
|
-
const s =
|
|
2783
|
+
const s = Ie(r, e);
|
|
2761
2784
|
t.setCustomValidity(s && s.message || ""), t.reportValidity();
|
|
2762
2785
|
}
|
|
2763
|
-
},
|
|
2786
|
+
}, De = (t, e) => {
|
|
2764
2787
|
for (const r in e.fields) {
|
|
2765
2788
|
const s = e.fields[r];
|
|
2766
|
-
s && s.ref && "reportValidity" in s.ref ?
|
|
2789
|
+
s && s.ref && "reportValidity" in s.ref ? Me(s.ref, r, t) : s && s.refs && s.refs.forEach((a) => Me(a, r, t));
|
|
2767
2790
|
}
|
|
2768
|
-
},
|
|
2769
|
-
e.shouldUseNativeValidation &&
|
|
2791
|
+
}, Be = (t, e) => {
|
|
2792
|
+
e.shouldUseNativeValidation && De(t, e);
|
|
2770
2793
|
const r = {};
|
|
2771
2794
|
for (const s in t) {
|
|
2772
|
-
const a =
|
|
2795
|
+
const a = Ie(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
|
|
2773
2796
|
if (ar(e.names || Object.keys(t), s)) {
|
|
2774
|
-
const c = Object.assign({},
|
|
2775
|
-
|
|
2776
|
-
} else
|
|
2797
|
+
const c = Object.assign({}, Ie(r, s));
|
|
2798
|
+
Ae(c, "root", i), Ae(r, s, c);
|
|
2799
|
+
} else Ae(r, s, i);
|
|
2777
2800
|
}
|
|
2778
2801
|
return r;
|
|
2779
2802
|
}, ar = (t, e) => {
|
|
2780
|
-
const r =
|
|
2781
|
-
return t.some((s) =>
|
|
2803
|
+
const r = Oe(e);
|
|
2804
|
+
return t.some((s) => Oe(s).match(`^${r}\\.\\d+`));
|
|
2782
2805
|
};
|
|
2783
|
-
function
|
|
2806
|
+
function Oe(t) {
|
|
2784
2807
|
return t.replace(/\]|\[/g, "");
|
|
2785
2808
|
}
|
|
2786
2809
|
function qe(t, e, r) {
|
|
@@ -2827,14 +2850,14 @@ function lr(t, e) {
|
|
|
2827
2850
|
}
|
|
2828
2851
|
const Ve = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
|
|
2829
2852
|
};
|
|
2830
|
-
function
|
|
2853
|
+
function we(t) {
|
|
2831
2854
|
return typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
2832
2855
|
}
|
|
2833
2856
|
function Ye(t, e, r) {
|
|
2834
2857
|
var a, i, c, l, d, u;
|
|
2835
2858
|
const s = { ...t, path: t.path ?? [] };
|
|
2836
2859
|
if (!t.message) {
|
|
2837
|
-
const g =
|
|
2860
|
+
const g = we((c = (i = (a = t.inst) == null ? void 0 : a._zod.def) == null ? void 0 : i.error) == null ? void 0 : c.call(i, t)) ?? we((l = e == null ? void 0 : e.error) == null ? void 0 : l.call(e, t)) ?? we((d = r.customError) == null ? void 0 : d.call(r, t)) ?? we((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
|
|
2838
2861
|
s.message = g;
|
|
2839
2862
|
}
|
|
2840
2863
|
return delete s.inst, delete s.continue, e != null && e.reportInput || delete s.input, s;
|
|
@@ -2874,7 +2897,7 @@ const We = (t, e) => {
|
|
|
2874
2897
|
}
|
|
2875
2898
|
return c.value;
|
|
2876
2899
|
}, hr = /* @__PURE__ */ mr(Qe);
|
|
2877
|
-
function
|
|
2900
|
+
function ze(t, e) {
|
|
2878
2901
|
try {
|
|
2879
2902
|
var r = t();
|
|
2880
2903
|
} catch (s) {
|
|
@@ -2925,14 +2948,14 @@ function Ge(t, e, r) {
|
|
|
2925
2948
|
return "_def" in s && typeof s._def == "object" && "typeName" in s._def;
|
|
2926
2949
|
}(t)) return function(s, a, i) {
|
|
2927
2950
|
try {
|
|
2928
|
-
return Promise.resolve(
|
|
2951
|
+
return Promise.resolve(ze(function() {
|
|
2929
2952
|
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](s, e)).then(function(c) {
|
|
2930
|
-
return i.shouldUseNativeValidation &&
|
|
2953
|
+
return i.shouldUseNativeValidation && De({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
|
|
2931
2954
|
});
|
|
2932
2955
|
}, function(c) {
|
|
2933
2956
|
if (function(l) {
|
|
2934
2957
|
return Array.isArray(l == null ? void 0 : l.issues);
|
|
2935
|
-
}(c)) return { values: {}, errors:
|
|
2958
|
+
}(c)) return { values: {}, errors: Be(pr(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
2936
2959
|
throw c;
|
|
2937
2960
|
}));
|
|
2938
2961
|
} catch (c) {
|
|
@@ -2943,14 +2966,14 @@ function Ge(t, e, r) {
|
|
|
2943
2966
|
return "_zod" in s && typeof s._zod == "object";
|
|
2944
2967
|
}(t)) return function(s, a, i) {
|
|
2945
2968
|
try {
|
|
2946
|
-
return Promise.resolve(
|
|
2969
|
+
return Promise.resolve(ze(function() {
|
|
2947
2970
|
return Promise.resolve((r.mode === "sync" ? ur : hr)(t, s, e)).then(function(c) {
|
|
2948
|
-
return i.shouldUseNativeValidation &&
|
|
2971
|
+
return i.shouldUseNativeValidation && De({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
|
|
2949
2972
|
});
|
|
2950
2973
|
}, function(c) {
|
|
2951
2974
|
if (function(l) {
|
|
2952
2975
|
return l instanceof cr;
|
|
2953
|
-
}(c)) return { values: {}, errors:
|
|
2976
|
+
}(c)) return { values: {}, errors: Be(gr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
2954
2977
|
throw c;
|
|
2955
2978
|
}));
|
|
2956
2979
|
} catch (c) {
|
|
@@ -3011,8 +3034,8 @@ const Vr = de.any(), vr = ({
|
|
|
3011
3034
|
onComplete: e,
|
|
3012
3035
|
onBack: r
|
|
3013
3036
|
}) => {
|
|
3014
|
-
const { questionnaire: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Zt(t), d =
|
|
3015
|
-
(
|
|
3037
|
+
const { questionnaire: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Zt(t), d = je(() => s ? { questionResults: s.questionGroups.map(
|
|
3038
|
+
(y) => y.questions.map((P) => ({
|
|
3016
3039
|
questionId: P.id,
|
|
3017
3040
|
values: []
|
|
3018
3041
|
}))
|
|
@@ -3020,103 +3043,103 @@ const Vr = de.any(), vr = ({
|
|
|
3020
3043
|
control: g,
|
|
3021
3044
|
handleSubmit: p,
|
|
3022
3045
|
formState: { errors: m }
|
|
3023
|
-
} =
|
|
3046
|
+
} = Fe({
|
|
3024
3047
|
resolver: u ? Ge(u) : void 0,
|
|
3025
3048
|
defaultValues: d
|
|
3026
|
-
}),
|
|
3049
|
+
}), v = async (b) => {
|
|
3027
3050
|
if (s)
|
|
3028
3051
|
try {
|
|
3029
|
-
console.log("Form submitted with data:",
|
|
3030
|
-
const
|
|
3031
|
-
(
|
|
3052
|
+
console.log("Form submitted with data:", b);
|
|
3053
|
+
const y = s.questionGroups.flatMap(
|
|
3054
|
+
(f, E) => f.questions.map((h, N) => {
|
|
3032
3055
|
var F, L, R;
|
|
3033
3056
|
return {
|
|
3034
|
-
questionId:
|
|
3035
|
-
values: ((R = (L = (F =
|
|
3057
|
+
questionId: h.id,
|
|
3058
|
+
values: ((R = (L = (F = b.questionResults) == null ? void 0 : F[E]) == null ? void 0 : L[N]) == null ? void 0 : R.values) || []
|
|
3036
3059
|
};
|
|
3037
3060
|
})
|
|
3038
3061
|
);
|
|
3039
|
-
console.log("Question results to submit:",
|
|
3062
|
+
console.log("Question results to submit:", y);
|
|
3040
3063
|
const P = {
|
|
3041
3064
|
applicantId: t,
|
|
3042
3065
|
questionnarieId: s.id,
|
|
3043
|
-
questionResults:
|
|
3066
|
+
questionResults: y
|
|
3044
3067
|
};
|
|
3045
3068
|
console.log("Final input:", P), await l(P), e == null || e();
|
|
3046
|
-
} catch (
|
|
3047
|
-
console.error("Error submitting questionnaire:",
|
|
3069
|
+
} catch (y) {
|
|
3070
|
+
console.error("Error submitting questionnaire:", y);
|
|
3048
3071
|
}
|
|
3049
3072
|
};
|
|
3050
3073
|
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3051
3074
|
"Error loading questionnaire: ",
|
|
3052
3075
|
c.message
|
|
3053
|
-
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: p(
|
|
3076
|
+
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: p(v), children: /* @__PURE__ */ o(T, { children: [
|
|
3054
3077
|
/* @__PURE__ */ o(J, { children: [
|
|
3055
3078
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
|
|
3056
3079
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
3057
3080
|
] }),
|
|
3058
3081
|
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.questionGroups.flatMap(
|
|
3059
|
-
(
|
|
3060
|
-
const
|
|
3082
|
+
(b, y) => b.questions.map((P, f) => {
|
|
3083
|
+
const h = P.defaultAnswers && P.defaultAnswers.length > 0 ? P.showAsDropdown ? P.canMultipleAnswer ? "multi-select" : "single-select" : P.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3061
3084
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3062
3085
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3063
3086
|
P.text,
|
|
3064
3087
|
P.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3065
3088
|
] }),
|
|
3066
|
-
|
|
3089
|
+
h === "text" && /* @__PURE__ */ n(
|
|
3067
3090
|
G,
|
|
3068
3091
|
{
|
|
3069
3092
|
control: g,
|
|
3070
|
-
name: `questionResults.${
|
|
3071
|
-
render: ({ field:
|
|
3093
|
+
name: `questionResults.${y}.${f}.values.0`,
|
|
3094
|
+
render: ({ field: N }) => {
|
|
3072
3095
|
var F, L, R, C;
|
|
3073
3096
|
return /* @__PURE__ */ n(
|
|
3074
3097
|
Z,
|
|
3075
3098
|
{
|
|
3076
|
-
value:
|
|
3077
|
-
onChange:
|
|
3078
|
-
onBlur:
|
|
3079
|
-
name:
|
|
3099
|
+
value: N.value || "",
|
|
3100
|
+
onChange: N.onChange,
|
|
3101
|
+
onBlur: N.onBlur,
|
|
3102
|
+
name: N.name,
|
|
3080
3103
|
placeholder: "Enter your answer...",
|
|
3081
|
-
error: (C = (R = (L = (F = m.questionResults) == null ? void 0 : F[
|
|
3104
|
+
error: (C = (R = (L = (F = m.questionResults) == null ? void 0 : F[y]) == null ? void 0 : L[f]) == null ? void 0 : R.values) == null ? void 0 : C.message
|
|
3082
3105
|
}
|
|
3083
3106
|
);
|
|
3084
3107
|
}
|
|
3085
3108
|
}
|
|
3086
3109
|
),
|
|
3087
|
-
(
|
|
3110
|
+
(h === "single-select" || h === "radio") && /* @__PURE__ */ n(
|
|
3088
3111
|
G,
|
|
3089
3112
|
{
|
|
3090
3113
|
control: g,
|
|
3091
|
-
name: `questionResults.${
|
|
3092
|
-
render: ({ field:
|
|
3114
|
+
name: `questionResults.${y}.${f}.values.0`,
|
|
3115
|
+
render: ({ field: N }) => {
|
|
3093
3116
|
var F, L, R, C;
|
|
3094
3117
|
return /* @__PURE__ */ n(
|
|
3095
3118
|
ge,
|
|
3096
3119
|
{
|
|
3097
|
-
value:
|
|
3098
|
-
onChange:
|
|
3099
|
-
onBlur:
|
|
3100
|
-
name:
|
|
3120
|
+
value: N.value || "",
|
|
3121
|
+
onChange: N.onChange,
|
|
3122
|
+
onBlur: N.onBlur,
|
|
3123
|
+
name: N.name,
|
|
3101
3124
|
options: P.defaultAnswers.map((B) => ({
|
|
3102
3125
|
value: B,
|
|
3103
3126
|
label: B
|
|
3104
3127
|
})),
|
|
3105
3128
|
placeholder: "Select an option...",
|
|
3106
|
-
error: (C = (R = (L = (F = m.questionResults) == null ? void 0 : F[
|
|
3129
|
+
error: (C = (R = (L = (F = m.questionResults) == null ? void 0 : F[y]) == null ? void 0 : L[f]) == null ? void 0 : R.values) == null ? void 0 : C.message
|
|
3107
3130
|
}
|
|
3108
3131
|
);
|
|
3109
3132
|
}
|
|
3110
3133
|
}
|
|
3111
3134
|
),
|
|
3112
|
-
(
|
|
3135
|
+
(h === "checkbox" || h === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3113
3136
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
|
|
3114
3137
|
/* @__PURE__ */ n(
|
|
3115
3138
|
G,
|
|
3116
3139
|
{
|
|
3117
3140
|
control: g,
|
|
3118
|
-
name: `questionResults.${
|
|
3119
|
-
render: ({ field: { value:
|
|
3141
|
+
name: `questionResults.${y}.${f}.values`,
|
|
3142
|
+
render: ({ field: { value: N = [], onChange: F } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: P.defaultAnswers.map((L, R) => /* @__PURE__ */ o(
|
|
3120
3143
|
"label",
|
|
3121
3144
|
{
|
|
3122
3145
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
@@ -3125,9 +3148,9 @@ const Vr = de.any(), vr = ({
|
|
|
3125
3148
|
"input",
|
|
3126
3149
|
{
|
|
3127
3150
|
type: "checkbox",
|
|
3128
|
-
checked: Array.isArray(
|
|
3151
|
+
checked: Array.isArray(N) && N.includes(L),
|
|
3129
3152
|
onChange: (C) => {
|
|
3130
|
-
const B = Array.isArray(
|
|
3153
|
+
const B = Array.isArray(N) ? N : [], z = C.target.checked ? [...B, L] : B.filter((w) => w !== L);
|
|
3131
3154
|
F(z);
|
|
3132
3155
|
},
|
|
3133
3156
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
@@ -3136,7 +3159,7 @@ const Vr = de.any(), vr = ({
|
|
|
3136
3159
|
/* @__PURE__ */ n("span", { className: "text-sm", children: L })
|
|
3137
3160
|
]
|
|
3138
3161
|
},
|
|
3139
|
-
`answer-${
|
|
3162
|
+
`answer-${y}-${f}-${R}`
|
|
3140
3163
|
)) })
|
|
3141
3164
|
}
|
|
3142
3165
|
)
|
|
@@ -3171,24 +3194,24 @@ const Vr = de.any(), vr = ({
|
|
|
3171
3194
|
const { uploadDocument: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Jt(t), [d, u] = x({}), g = async (p) => {
|
|
3172
3195
|
if (p.preventDefault(), !s) return;
|
|
3173
3196
|
const m = await Promise.all(
|
|
3174
|
-
s.uploadDocumentFiles.map(async (
|
|
3175
|
-
const
|
|
3176
|
-
|
|
3177
|
-
fileName:
|
|
3178
|
-
fileData: await qt(
|
|
3197
|
+
s.uploadDocumentFiles.map(async (b) => {
|
|
3198
|
+
const y = d[b.id] || [], P = await Promise.all(
|
|
3199
|
+
y.map(async (f) => ({
|
|
3200
|
+
fileName: f.name,
|
|
3201
|
+
fileData: await qt(f)
|
|
3179
3202
|
}))
|
|
3180
3203
|
);
|
|
3181
3204
|
return {
|
|
3182
|
-
uploadDocumentFileId:
|
|
3205
|
+
uploadDocumentFileId: b.id,
|
|
3183
3206
|
valueList: P
|
|
3184
3207
|
};
|
|
3185
3208
|
})
|
|
3186
|
-
),
|
|
3209
|
+
), v = {
|
|
3187
3210
|
applicantId: t,
|
|
3188
3211
|
uploadDocumentId: s.id,
|
|
3189
3212
|
uploadDocumentResults: m
|
|
3190
3213
|
};
|
|
3191
|
-
await l(
|
|
3214
|
+
await l(v), e == null || e();
|
|
3192
3215
|
};
|
|
3193
3216
|
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3194
3217
|
"Error loading document requirements: ",
|
|
@@ -3207,7 +3230,7 @@ const Vr = de.any(), vr = ({
|
|
|
3207
3230
|
maxSize: p.maxEachFileSizeByte,
|
|
3208
3231
|
value: d[p.id] || [],
|
|
3209
3232
|
onChange: (m) => {
|
|
3210
|
-
u((
|
|
3233
|
+
u((v) => ({ ...v, [p.id]: m }));
|
|
3211
3234
|
}
|
|
3212
3235
|
},
|
|
3213
3236
|
p.id
|
|
@@ -3260,43 +3283,43 @@ const Vr = de.any(), vr = ({
|
|
|
3260
3283
|
onBack: r
|
|
3261
3284
|
}) => {
|
|
3262
3285
|
const { criteria: s, isLoading: a, isSubmitting: i, error: c, submit: l } = tr(t), [d, u] = le.useState(!1), g = le.useMemo(() => !s || s.length === 0 ? { criteriaValueInputs: [] } : {
|
|
3263
|
-
criteriaValueInputs: s.map((
|
|
3264
|
-
riskCriteriaId:
|
|
3286
|
+
criteriaValueInputs: s.map((f) => ({
|
|
3287
|
+
riskCriteriaId: f.id,
|
|
3265
3288
|
values: [""]
|
|
3266
3289
|
// Initialize with empty string to prevent uncontrolled input warning
|
|
3267
3290
|
}))
|
|
3268
3291
|
}, [s]), p = s && s.length > 0 ? br() : null, {
|
|
3269
3292
|
control: m,
|
|
3270
|
-
handleSubmit:
|
|
3271
|
-
formState: { errors:
|
|
3272
|
-
} =
|
|
3293
|
+
handleSubmit: v,
|
|
3294
|
+
formState: { errors: b }
|
|
3295
|
+
} = Fe({
|
|
3273
3296
|
resolver: p ? Ge(p) : void 0,
|
|
3274
3297
|
defaultValues: g
|
|
3275
3298
|
});
|
|
3276
3299
|
le.useEffect(() => {
|
|
3277
3300
|
!a && s && s.length === 0 && !d && !i && (u(!0), l({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
|
|
3278
3301
|
}, [a, s, d, i, l, t, e]);
|
|
3279
|
-
const
|
|
3302
|
+
const y = async (f) => {
|
|
3280
3303
|
if (s)
|
|
3281
3304
|
try {
|
|
3282
|
-
console.log("Risk scoring form submitted:",
|
|
3283
|
-
const
|
|
3284
|
-
const L =
|
|
3305
|
+
console.log("Risk scoring form submitted:", f), console.log("Criteria metadata:", s);
|
|
3306
|
+
const E = f.criteriaValueInputs.map((N, F) => {
|
|
3307
|
+
const L = N.values || [], R = Array.isArray(L) ? L.filter((C) => C && C.trim()) : L && L.toString().trim() ? [L.toString()] : [];
|
|
3285
3308
|
return R.length === 0 ? null : {
|
|
3286
3309
|
riskCriteriaId: s[F].id,
|
|
3287
3310
|
values: R
|
|
3288
3311
|
};
|
|
3289
|
-
}).filter((
|
|
3290
|
-
console.log("Risk scoring criteriaValueInputs to submit:",
|
|
3291
|
-
const
|
|
3312
|
+
}).filter((N) => N !== null);
|
|
3313
|
+
console.log("Risk scoring criteriaValueInputs to submit:", E);
|
|
3314
|
+
const h = {
|
|
3292
3315
|
applicantId: t,
|
|
3293
|
-
criteriaValueInputs:
|
|
3316
|
+
criteriaValueInputs: E
|
|
3294
3317
|
};
|
|
3295
|
-
console.log("Final risk scoring input:",
|
|
3296
|
-
} catch (
|
|
3297
|
-
throw console.error("Error submitting risk scoring:",
|
|
3318
|
+
console.log("Final risk scoring input:", h), await l(h), console.log("Risk scoring submitted successfully!"), e == null || e();
|
|
3319
|
+
} catch (E) {
|
|
3320
|
+
throw console.error("Error submitting risk scoring:", E), E;
|
|
3298
3321
|
}
|
|
3299
|
-
}, P = (
|
|
3322
|
+
}, P = (f) => f.builtInType === 1 ? "country" : !f.defaultValues || f.defaultValues.length === 0 ? "text" : f.multipleValue ? "checkbox" : "radio";
|
|
3300
3323
|
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
3301
3324
|
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
3302
3325
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
|
|
@@ -3306,25 +3329,25 @@ const Vr = de.any(), vr = ({
|
|
|
3306
3329
|
] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
3307
3330
|
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
3308
3331
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
|
|
3309
|
-
] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3332
|
+
] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: v(y), children: /* @__PURE__ */ o(T, { children: [
|
|
3310
3333
|
/* @__PURE__ */ o(J, { children: [
|
|
3311
3334
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
|
|
3312
3335
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3313
3336
|
] }),
|
|
3314
|
-
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((
|
|
3315
|
-
var
|
|
3316
|
-
const
|
|
3337
|
+
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((f, E) => {
|
|
3338
|
+
var N, F, L;
|
|
3339
|
+
const h = P(f);
|
|
3317
3340
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3318
3341
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3319
|
-
|
|
3320
|
-
|
|
3342
|
+
f.displayName,
|
|
3343
|
+
f.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3321
3344
|
] }),
|
|
3322
|
-
|
|
3323
|
-
|
|
3345
|
+
f.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: f.description }),
|
|
3346
|
+
h === "text" && /* @__PURE__ */ n(
|
|
3324
3347
|
G,
|
|
3325
3348
|
{
|
|
3326
3349
|
control: m,
|
|
3327
|
-
name: `criteriaValueInputs.${
|
|
3350
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3328
3351
|
render: ({ field: R }) => {
|
|
3329
3352
|
var C, B, z;
|
|
3330
3353
|
return /* @__PURE__ */ n(
|
|
@@ -3332,25 +3355,25 @@ const Vr = de.any(), vr = ({
|
|
|
3332
3355
|
{
|
|
3333
3356
|
...R,
|
|
3334
3357
|
value: R.value || "",
|
|
3335
|
-
type:
|
|
3358
|
+
type: f.valueDataType === Re.DigitOnly ? "number" : "text",
|
|
3336
3359
|
placeholder: "Enter your answer...",
|
|
3337
|
-
error: (z = (B = (C =
|
|
3338
|
-
onKeyDown: (
|
|
3339
|
-
|
|
3360
|
+
error: (z = (B = (C = b.criteriaValueInputs) == null ? void 0 : C[E]) == null ? void 0 : B.values) == null ? void 0 : z.message,
|
|
3361
|
+
onKeyDown: (w) => {
|
|
3362
|
+
f.valueDataType === Re.DigitOnly && ["e", "E", "+", "-", "."].includes(w.key) && w.preventDefault();
|
|
3340
3363
|
}
|
|
3341
3364
|
}
|
|
3342
3365
|
);
|
|
3343
3366
|
}
|
|
3344
3367
|
}
|
|
3345
3368
|
),
|
|
3346
|
-
|
|
3369
|
+
h === "radio" && f.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3347
3370
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
|
|
3348
3371
|
/* @__PURE__ */ n(
|
|
3349
3372
|
G,
|
|
3350
3373
|
{
|
|
3351
3374
|
control: m,
|
|
3352
|
-
name: `criteriaValueInputs.${
|
|
3353
|
-
render: ({ field: { value: R, onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children:
|
|
3375
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3376
|
+
render: ({ field: { value: R, onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: f.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3354
3377
|
/* @__PURE__ */ n(
|
|
3355
3378
|
"input",
|
|
3356
3379
|
{
|
|
@@ -3361,40 +3384,40 @@ const Vr = de.any(), vr = ({
|
|
|
3361
3384
|
}
|
|
3362
3385
|
),
|
|
3363
3386
|
/* @__PURE__ */ n("span", { className: "text-sm", children: B })
|
|
3364
|
-
] }, `${
|
|
3387
|
+
] }, `${E}-${z}`)) })
|
|
3365
3388
|
}
|
|
3366
3389
|
)
|
|
3367
3390
|
] }),
|
|
3368
|
-
|
|
3391
|
+
h === "checkbox" && f.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3369
3392
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
|
|
3370
3393
|
/* @__PURE__ */ n(
|
|
3371
3394
|
G,
|
|
3372
3395
|
{
|
|
3373
3396
|
control: m,
|
|
3374
|
-
name: `criteriaValueInputs.${
|
|
3375
|
-
render: ({ field: { value: R = [], onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children:
|
|
3397
|
+
name: `criteriaValueInputs.${E}.values`,
|
|
3398
|
+
render: ({ field: { value: R = [], onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: f.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3376
3399
|
/* @__PURE__ */ n(
|
|
3377
3400
|
"input",
|
|
3378
3401
|
{
|
|
3379
3402
|
type: "checkbox",
|
|
3380
3403
|
checked: Array.isArray(R) && R.includes(B),
|
|
3381
|
-
onChange: (
|
|
3382
|
-
const
|
|
3404
|
+
onChange: (w) => {
|
|
3405
|
+
const I = Array.isArray(R) ? R : [], A = w.target.checked ? [...I, B] : I.filter((k) => k !== B);
|
|
3383
3406
|
C(A);
|
|
3384
3407
|
},
|
|
3385
3408
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3386
3409
|
}
|
|
3387
3410
|
),
|
|
3388
3411
|
/* @__PURE__ */ n("span", { className: "text-sm", children: B })
|
|
3389
|
-
] }, `${
|
|
3412
|
+
] }, `${E}-${z}`)) })
|
|
3390
3413
|
}
|
|
3391
3414
|
)
|
|
3392
3415
|
] }),
|
|
3393
|
-
|
|
3416
|
+
h === "country" && /* @__PURE__ */ n(
|
|
3394
3417
|
G,
|
|
3395
3418
|
{
|
|
3396
3419
|
control: m,
|
|
3397
|
-
name: `criteriaValueInputs.${
|
|
3420
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3398
3421
|
render: ({ field: R }) => {
|
|
3399
3422
|
var C, B, z;
|
|
3400
3423
|
return /* @__PURE__ */ n(
|
|
@@ -3408,14 +3431,14 @@ const Vr = de.any(), vr = ({
|
|
|
3408
3431
|
// TODO: Load from base information service
|
|
3409
3432
|
],
|
|
3410
3433
|
placeholder: "Select a country...",
|
|
3411
|
-
error: (z = (B = (C =
|
|
3434
|
+
error: (z = (B = (C = b.criteriaValueInputs) == null ? void 0 : C[E]) == null ? void 0 : B.values) == null ? void 0 : z.message
|
|
3412
3435
|
}
|
|
3413
3436
|
);
|
|
3414
3437
|
}
|
|
3415
3438
|
}
|
|
3416
3439
|
),
|
|
3417
|
-
((L = (F = (
|
|
3418
|
-
] },
|
|
3440
|
+
((L = (F = (N = b.criteriaValueInputs) == null ? void 0 : N[E]) == null ? void 0 : F.values) == null ? void 0 : L.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: b.criteriaValueInputs[E].values.message })
|
|
3441
|
+
] }, f.id);
|
|
3419
3442
|
}) }),
|
|
3420
3443
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3421
3444
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
@@ -3425,7 +3448,7 @@ const Vr = de.any(), vr = ({
|
|
|
3425
3448
|
type: "submit",
|
|
3426
3449
|
isLoading: i,
|
|
3427
3450
|
onClick: () => {
|
|
3428
|
-
console.log("Risk scoring submit button clicked"), console.log("Form errors:",
|
|
3451
|
+
console.log("Risk scoring submit button clicked"), console.log("Form errors:", b);
|
|
3429
3452
|
},
|
|
3430
3453
|
children: "Continue"
|
|
3431
3454
|
}
|
|
@@ -3454,8 +3477,8 @@ const Vr = de.any(), vr = ({
|
|
|
3454
3477
|
investorType: a
|
|
3455
3478
|
};
|
|
3456
3479
|
console.log("Submitting investor categorization:", m);
|
|
3457
|
-
const
|
|
3458
|
-
console.log("Investor categorization result:",
|
|
3480
|
+
const v = await s.setInvestorCategorization(m);
|
|
3481
|
+
console.log("Investor categorization result:", v), e == null || e();
|
|
3459
3482
|
} catch (m) {
|
|
3460
3483
|
console.error("Error submitting investor categorization:", m), u(m.message || "Failed to submit investor categorization");
|
|
3461
3484
|
} finally {
|
|
@@ -3579,7 +3602,7 @@ const Vr = de.any(), vr = ({
|
|
|
3579
3602
|
onComplete: e,
|
|
3580
3603
|
onBack: r
|
|
3581
3604
|
}) => {
|
|
3582
|
-
const { appropriatenessTestService: s } = re(), [a, i] = x(null), [c, l] = x(!0), [d, u] = x(!1), [g, p] = x(null), [m,
|
|
3605
|
+
const { appropriatenessTestService: s } = re(), [a, i] = x(null), [c, l] = x(!0), [d, u] = x(!1), [g, p] = x(null), [m, v] = x({}), [b, y] = x(0), [P, f] = x(!1), [E, h] = x(!1), [N, F] = x(0);
|
|
3583
3606
|
V(() => {
|
|
3584
3607
|
(async () => {
|
|
3585
3608
|
try {
|
|
@@ -3608,30 +3631,30 @@ const Vr = de.any(), vr = ({
|
|
|
3608
3631
|
return `${k.toString().padStart(2, "0")}:${S.toString().padStart(2, "0")}`;
|
|
3609
3632
|
};
|
|
3610
3633
|
V(() => {
|
|
3611
|
-
if (!P ||
|
|
3634
|
+
if (!P || b <= 0) return;
|
|
3612
3635
|
const A = setInterval(() => {
|
|
3613
|
-
|
|
3636
|
+
y((k) => k <= 1 ? (h(!0), 0) : k - 1);
|
|
3614
3637
|
}, 1e3);
|
|
3615
3638
|
return () => clearInterval(A);
|
|
3616
|
-
}, [P,
|
|
3617
|
-
if (
|
|
3639
|
+
}, [P, b]), V(() => {
|
|
3640
|
+
if (N <= 0) return;
|
|
3618
3641
|
const A = setInterval(() => {
|
|
3619
3642
|
F((k) => k <= 1 ? 0 : k - 1);
|
|
3620
3643
|
}, 1e3);
|
|
3621
3644
|
return () => clearInterval(A);
|
|
3622
|
-
}, [
|
|
3623
|
-
|
|
3624
|
-
}, [
|
|
3645
|
+
}, [N]), V(() => {
|
|
3646
|
+
E && !d && z();
|
|
3647
|
+
}, [E]);
|
|
3625
3648
|
const C = () => {
|
|
3626
|
-
a && (
|
|
3649
|
+
a && (f(!0), y(a.testDurationSec));
|
|
3627
3650
|
}, B = (A, k) => {
|
|
3628
|
-
|
|
3651
|
+
v((S) => ({
|
|
3629
3652
|
...S,
|
|
3630
3653
|
[A]: k
|
|
3631
3654
|
}));
|
|
3632
3655
|
}, z = async (A) => {
|
|
3633
3656
|
if (A && A.preventDefault(), !!a) {
|
|
3634
|
-
if (!
|
|
3657
|
+
if (!E) {
|
|
3635
3658
|
const k = a.appropriatenessQuestions.length - Object.keys(m).length;
|
|
3636
3659
|
if (k > 0) {
|
|
3637
3660
|
p(`Please answer all questions. ${k} question(s) remaining.`);
|
|
@@ -3654,21 +3677,21 @@ const Vr = de.any(), vr = ({
|
|
|
3654
3677
|
console.log("Submitting appropriateness test:", S);
|
|
3655
3678
|
try {
|
|
3656
3679
|
const _ = await s.fillAppropriatenessTest(S);
|
|
3657
|
-
console.log("Appropriateness test result:", _), _.message && (_.message.toLowerCase().includes("pass") || _.message.toLowerCase().includes("success") || _.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p(_.message || "Test completed. Please check the result."),
|
|
3680
|
+
console.log("Appropriateness test result:", _), _.message && (_.message.toLowerCase().includes("pass") || _.message.toLowerCase().includes("success") || _.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p(_.message || "Test completed. Please check the result."), f(!1), h(!1), v({}), setTimeout(() => w(), 1e3));
|
|
3658
3681
|
} catch (_) {
|
|
3659
3682
|
if (_.code === 400 && _.message) {
|
|
3660
3683
|
const oe = _.message;
|
|
3661
|
-
console.log("Test failed:", oe), p(oe),
|
|
3684
|
+
console.log("Test failed:", oe), p(oe), f(!1), h(!1), v({}), setTimeout(() => w(), 1500);
|
|
3662
3685
|
} else
|
|
3663
3686
|
throw _;
|
|
3664
3687
|
}
|
|
3665
3688
|
} catch (k) {
|
|
3666
|
-
console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."),
|
|
3689
|
+
console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), f(!1), h(!1), v({});
|
|
3667
3690
|
} finally {
|
|
3668
3691
|
u(!1);
|
|
3669
3692
|
}
|
|
3670
3693
|
}
|
|
3671
|
-
},
|
|
3694
|
+
}, w = async () => {
|
|
3672
3695
|
try {
|
|
3673
3696
|
const A = await s.getAppropriatenessTest(t);
|
|
3674
3697
|
if (console.log("Reloaded test data:", A), i(A), A.waitTimeSpanForNextTry && A.waitTimeSpanForNextTry !== "00:00:00") {
|
|
@@ -3691,7 +3714,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3691
3714
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
3692
3715
|
g && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g })
|
|
3693
3716
|
] }) });
|
|
3694
|
-
if (
|
|
3717
|
+
if (N > 0)
|
|
3695
3718
|
return /* @__PURE__ */ o(T, { children: [
|
|
3696
3719
|
/* @__PURE__ */ o(J, { children: [
|
|
3697
3720
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
|
|
@@ -3699,13 +3722,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3699
3722
|
] }),
|
|
3700
3723
|
/* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
|
|
3701
3724
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3702
|
-
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: R(
|
|
3725
|
+
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: R(N) }),
|
|
3703
3726
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
3704
3727
|
] }),
|
|
3705
3728
|
g && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: g }) })
|
|
3706
3729
|
] })
|
|
3707
3730
|
] });
|
|
3708
|
-
const
|
|
3731
|
+
const I = a.testAllowedMaxTry - a.totalFailedTries;
|
|
3709
3732
|
return P ? /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(T, { children: [
|
|
3710
3733
|
/* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
3711
3734
|
/* @__PURE__ */ o("div", { children: [
|
|
@@ -3716,8 +3739,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3716
3739
|
/* @__PURE__ */ n(
|
|
3717
3740
|
"div",
|
|
3718
3741
|
{
|
|
3719
|
-
className: `text-3xl font-bold ${
|
|
3720
|
-
children: R(
|
|
3742
|
+
className: `text-3xl font-bold ${b <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
3743
|
+
children: R(b)
|
|
3721
3744
|
}
|
|
3722
3745
|
),
|
|
3723
3746
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -3731,10 +3754,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3731
3754
|
" of ",
|
|
3732
3755
|
a.totalQuestionCount
|
|
3733
3756
|
] }),
|
|
3734
|
-
/* @__PURE__ */ o(me, { variant:
|
|
3735
|
-
|
|
3757
|
+
/* @__PURE__ */ o(me, { variant: I > 1 ? "success" : "warning", children: [
|
|
3758
|
+
I,
|
|
3736
3759
|
" attempt",
|
|
3737
|
-
|
|
3760
|
+
I !== 1 ? "s" : "",
|
|
3738
3761
|
" remaining"
|
|
3739
3762
|
] })
|
|
3740
3763
|
] }),
|
|
@@ -3780,12 +3803,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3780
3803
|
},
|
|
3781
3804
|
A.id
|
|
3782
3805
|
)),
|
|
3783
|
-
g && !
|
|
3806
|
+
g && !E && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
3784
3807
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
3785
3808
|
" ",
|
|
3786
3809
|
g
|
|
3787
3810
|
] }) }),
|
|
3788
|
-
|
|
3811
|
+
E && /* @__PURE__ */ n("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
|
|
3789
3812
|
/* @__PURE__ */ n("strong", { children: "Time's up!" }),
|
|
3790
3813
|
" Your answers are being submitted automatically."
|
|
3791
3814
|
] }) })
|
|
@@ -3807,7 +3830,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3807
3830
|
type: "submit",
|
|
3808
3831
|
isLoading: d,
|
|
3809
3832
|
disabled: Object.keys(m).length < a.totalQuestionCount,
|
|
3810
|
-
children:
|
|
3833
|
+
children: E ? "Submitting..." : "Submit Test"
|
|
3811
3834
|
}
|
|
3812
3835
|
)
|
|
3813
3836
|
] })
|
|
@@ -3833,7 +3856,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3833
3856
|
] }),
|
|
3834
3857
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3835
3858
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
3836
|
-
/* @__PURE__ */ n(me, { variant:
|
|
3859
|
+
/* @__PURE__ */ n(me, { variant: I > 1 ? "success" : "warning", children: I })
|
|
3837
3860
|
] })
|
|
3838
3861
|
] }),
|
|
3839
3862
|
g && /* @__PURE__ */ n("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -3841,7 +3864,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3841
3864
|
" ",
|
|
3842
3865
|
g
|
|
3843
3866
|
] }) }),
|
|
3844
|
-
|
|
3867
|
+
I <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
3845
3868
|
] }),
|
|
3846
3869
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3847
3870
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
@@ -3850,7 +3873,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3850
3873
|
{
|
|
3851
3874
|
type: "button",
|
|
3852
3875
|
onClick: C,
|
|
3853
|
-
disabled:
|
|
3876
|
+
disabled: I <= 0,
|
|
3854
3877
|
children: "Start Test"
|
|
3855
3878
|
}
|
|
3856
3879
|
)
|
|
@@ -3861,8 +3884,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3861
3884
|
onComplete: e,
|
|
3862
3885
|
onBack: r
|
|
3863
3886
|
}) => {
|
|
3864
|
-
var S, _, oe,
|
|
3865
|
-
const { applicantService: s, baseInformationService: a, config: i } = re(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = er(t), [
|
|
3887
|
+
var S, _, oe, Le;
|
|
3888
|
+
const { applicantService: s, baseInformationService: a, config: i } = re(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = er(t), [v, b] = x(null), [y, P] = x(null), [f, E] = x([]), [h, N] = x(!0), [F, L] = x(!1), [R, C] = x(null), [B, z] = x(!1), w = le.useRef(!1), I = Fe({
|
|
3866
3889
|
defaultValues: {
|
|
3867
3890
|
street: "",
|
|
3868
3891
|
streetNumber: "",
|
|
@@ -3882,12 +3905,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3882
3905
|
]);
|
|
3883
3906
|
P(D);
|
|
3884
3907
|
const H = /* @__PURE__ */ new Set(), ne = W.filter((ue) => {
|
|
3885
|
-
const
|
|
3886
|
-
return !
|
|
3908
|
+
const Ce = ue.abbreviation3 || ue.abbreviation;
|
|
3909
|
+
return !Ce || H.has(Ce) ? !1 : (H.add(Ce), !0);
|
|
3887
3910
|
});
|
|
3888
|
-
|
|
3911
|
+
E(ne);
|
|
3889
3912
|
const $ = D.applicantRequestData;
|
|
3890
|
-
if (
|
|
3913
|
+
if (I.reset({
|
|
3891
3914
|
street: ($ == null ? void 0 : $.street) || "",
|
|
3892
3915
|
streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
|
|
3893
3916
|
city: ($ == null ? void 0 : $.city) || "",
|
|
@@ -3895,8 +3918,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3895
3918
|
country: ($ == null ? void 0 : $.country) || "",
|
|
3896
3919
|
nationality: ($ == null ? void 0 : $.nationality) || "",
|
|
3897
3920
|
phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
|
|
3898
|
-
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !
|
|
3899
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
3921
|
+
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !w.current) {
|
|
3922
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), w.current = !0;
|
|
3900
3923
|
try {
|
|
3901
3924
|
await p(), L(!0);
|
|
3902
3925
|
} catch (ue) {
|
|
@@ -3906,10 +3929,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3906
3929
|
} catch (D) {
|
|
3907
3930
|
console.error("Error loading applicant data:", D);
|
|
3908
3931
|
} finally {
|
|
3909
|
-
|
|
3932
|
+
N(!1);
|
|
3910
3933
|
}
|
|
3911
3934
|
})();
|
|
3912
|
-
}, [t
|
|
3935
|
+
}, [t]), V(() => {
|
|
3913
3936
|
c && !F && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
|
|
3914
3937
|
}, [c, F]), V(() => {
|
|
3915
3938
|
if (d) {
|
|
@@ -3936,7 +3959,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3936
3959
|
}
|
|
3937
3960
|
}
|
|
3938
3961
|
}, [d]), V(() => {
|
|
3939
|
-
if (l !== null && d && !
|
|
3962
|
+
if (l !== null && d && !v && F && !B) {
|
|
3940
3963
|
const O = l;
|
|
3941
3964
|
if (d.url) {
|
|
3942
3965
|
console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
|
|
@@ -3954,7 +3977,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3954
3977
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
|
|
3955
3978
|
}
|
|
3956
3979
|
}
|
|
3957
|
-
|
|
3980
|
+
b({ type: "url", url: d.url });
|
|
3958
3981
|
} catch (D) {
|
|
3959
3982
|
console.error("[Identity] Invalid URL:", D), C("Invalid verification URL. Please restart."), z(!0);
|
|
3960
3983
|
}
|
|
@@ -3965,7 +3988,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3965
3988
|
try {
|
|
3966
3989
|
const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
|
|
3967
3990
|
W.initialize().then(() => {
|
|
3968
|
-
console.log("[SardinAI] Risk SDK initialized successfully"),
|
|
3991
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), b(W), setTimeout(() => {
|
|
3969
3992
|
e == null || e();
|
|
3970
3993
|
}, 2e3);
|
|
3971
3994
|
}).catch((H) => {
|
|
@@ -3989,20 +4012,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3989
4012
|
e == null || e();
|
|
3990
4013
|
})) : O === se.Onfido && W.initialize("identity-container").catch((H) => {
|
|
3991
4014
|
console.error("[Onfido] Initialization error:", H), C(`Failed to initialize: ${H.message}`);
|
|
3992
|
-
}),
|
|
4015
|
+
}), b(W);
|
|
3993
4016
|
} catch (D) {
|
|
3994
4017
|
console.error("[Identity] Provider setup error:", D), C(`Setup error: ${D.message}`);
|
|
3995
4018
|
}
|
|
3996
4019
|
}
|
|
3997
4020
|
return () => {
|
|
3998
|
-
if (
|
|
4021
|
+
if (v && v.destroy)
|
|
3999
4022
|
try {
|
|
4000
|
-
|
|
4023
|
+
v.destroy();
|
|
4001
4024
|
} catch (O) {
|
|
4002
4025
|
console.error("[Identity] Error destroying provider:", O);
|
|
4003
4026
|
}
|
|
4004
4027
|
};
|
|
4005
|
-
}, [l, d,
|
|
4028
|
+
}, [l, d, v, F, e, B]);
|
|
4006
4029
|
const A = async () => {
|
|
4007
4030
|
try {
|
|
4008
4031
|
C(null), z(!1), await p(), L(!0);
|
|
@@ -4011,12 +4034,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4011
4034
|
}
|
|
4012
4035
|
}, k = async () => {
|
|
4013
4036
|
try {
|
|
4014
|
-
C(null), z(!1),
|
|
4037
|
+
C(null), z(!1), b(null), console.log("[Identity] Restarting verification..."), await m(), L(!0);
|
|
4015
4038
|
} catch (O) {
|
|
4016
4039
|
console.error("Error restarting identity verification:", O), C(O.message || "Failed to restart verification");
|
|
4017
4040
|
}
|
|
4018
4041
|
};
|
|
4019
|
-
if (
|
|
4042
|
+
if (h || u)
|
|
4020
4043
|
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4021
4044
|
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
4022
4045
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
@@ -4104,9 +4127,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4104
4127
|
var W, H, ne;
|
|
4105
4128
|
console.log("[Identity] Iframe loaded");
|
|
4106
4129
|
try {
|
|
4107
|
-
const $ = D.target,
|
|
4108
|
-
if (
|
|
4109
|
-
const ue = ((ne = (H =
|
|
4130
|
+
const $ = D.target, Se = $.contentDocument || ((W = $.contentWindow) == null ? void 0 : W.document);
|
|
4131
|
+
if (Se) {
|
|
4132
|
+
const ue = ((ne = (H = Se.body) == null ? void 0 : H.textContent) == null ? void 0 : ne.toLowerCase()) || "";
|
|
4110
4133
|
(ue.includes("expired") || ue.includes("invalid") || ue.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), C("Your verification link has expired."));
|
|
4111
4134
|
}
|
|
4112
4135
|
} catch {
|
|
@@ -4136,7 +4159,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4136
4159
|
r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4137
4160
|
] });
|
|
4138
4161
|
}
|
|
4139
|
-
return /* @__PURE__ */ n("form", { onSubmit:
|
|
4162
|
+
return /* @__PURE__ */ n("form", { onSubmit: I.handleSubmit(A), children: /* @__PURE__ */ o(T, { children: [
|
|
4140
4163
|
/* @__PURE__ */ o(J, { children: [
|
|
4141
4164
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
|
|
4142
4165
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
@@ -4146,18 +4169,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4146
4169
|
/* @__PURE__ */ o("div", { children: [
|
|
4147
4170
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4148
4171
|
/* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
|
|
4149
|
-
(S =
|
|
4172
|
+
(S = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : S.firstName,
|
|
4150
4173
|
" ",
|
|
4151
|
-
(_ =
|
|
4174
|
+
(_ = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : _.lastName
|
|
4152
4175
|
] })
|
|
4153
4176
|
] }),
|
|
4154
4177
|
/* @__PURE__ */ o("div", { children: [
|
|
4155
4178
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4156
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (oe =
|
|
4179
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (oe = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : oe.email })
|
|
4157
4180
|
] }),
|
|
4158
4181
|
/* @__PURE__ */ o("div", { children: [
|
|
4159
4182
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4160
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((
|
|
4183
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((Le = y == null ? void 0 : y.applicantRequestData) == null ? void 0 : Le.dateOfBirth) || "Not provided" })
|
|
4161
4184
|
] })
|
|
4162
4185
|
] }),
|
|
4163
4186
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
@@ -4166,7 +4189,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4166
4189
|
/* @__PURE__ */ n(
|
|
4167
4190
|
G,
|
|
4168
4191
|
{
|
|
4169
|
-
control:
|
|
4192
|
+
control: I.control,
|
|
4170
4193
|
name: "country",
|
|
4171
4194
|
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4172
4195
|
ge,
|
|
@@ -4175,7 +4198,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4175
4198
|
label: "Country",
|
|
4176
4199
|
options: [
|
|
4177
4200
|
{ value: "", label: "Select country..." },
|
|
4178
|
-
...
|
|
4201
|
+
...f.map((D) => ({
|
|
4179
4202
|
value: D.abbreviation3 || D.abbreviation,
|
|
4180
4203
|
label: D.name
|
|
4181
4204
|
}))
|
|
@@ -4187,7 +4210,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4187
4210
|
/* @__PURE__ */ n(
|
|
4188
4211
|
G,
|
|
4189
4212
|
{
|
|
4190
|
-
control:
|
|
4213
|
+
control: I.control,
|
|
4191
4214
|
name: "nationality",
|
|
4192
4215
|
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4193
4216
|
ge,
|
|
@@ -4196,7 +4219,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4196
4219
|
label: "Nationality",
|
|
4197
4220
|
options: [
|
|
4198
4221
|
{ value: "", label: "Select nationality..." },
|
|
4199
|
-
...
|
|
4222
|
+
...f.map((D) => ({
|
|
4200
4223
|
value: D.abbreviation3 || D.abbreviation,
|
|
4201
4224
|
label: D.name
|
|
4202
4225
|
}))
|
|
@@ -4210,7 +4233,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4210
4233
|
/* @__PURE__ */ n(
|
|
4211
4234
|
G,
|
|
4212
4235
|
{
|
|
4213
|
-
control:
|
|
4236
|
+
control: I.control,
|
|
4214
4237
|
name: "street",
|
|
4215
4238
|
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street" })
|
|
4216
4239
|
}
|
|
@@ -4218,7 +4241,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4218
4241
|
/* @__PURE__ */ n(
|
|
4219
4242
|
G,
|
|
4220
4243
|
{
|
|
4221
|
-
control:
|
|
4244
|
+
control: I.control,
|
|
4222
4245
|
name: "streetNumber",
|
|
4223
4246
|
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street Number" })
|
|
4224
4247
|
}
|
|
@@ -4228,7 +4251,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4228
4251
|
/* @__PURE__ */ n(
|
|
4229
4252
|
G,
|
|
4230
4253
|
{
|
|
4231
|
-
control:
|
|
4254
|
+
control: I.control,
|
|
4232
4255
|
name: "city",
|
|
4233
4256
|
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "City" })
|
|
4234
4257
|
}
|
|
@@ -4236,7 +4259,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4236
4259
|
/* @__PURE__ */ n(
|
|
4237
4260
|
G,
|
|
4238
4261
|
{
|
|
4239
|
-
control:
|
|
4262
|
+
control: I.control,
|
|
4240
4263
|
name: "zip",
|
|
4241
4264
|
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "ZIP/Postal Code" })
|
|
4242
4265
|
}
|
|
@@ -4245,7 +4268,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4245
4268
|
/* @__PURE__ */ n(
|
|
4246
4269
|
G,
|
|
4247
4270
|
{
|
|
4248
|
-
control:
|
|
4271
|
+
control: I.control,
|
|
4249
4272
|
name: "phonenumber",
|
|
4250
4273
|
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Phone Number", type: "tel" })
|
|
4251
4274
|
}
|
|
@@ -4257,7 +4280,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4257
4280
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4258
4281
|
] })
|
|
4259
4282
|
] }) });
|
|
4260
|
-
},
|
|
4283
|
+
}, $e = ({
|
|
4261
4284
|
kycStatus: t,
|
|
4262
4285
|
reviewStatus: e,
|
|
4263
4286
|
workflowResult: r,
|
|
@@ -4307,21 +4330,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4307
4330
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4308
4331
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4309
4332
|
message: "Your application is currently under manual review."
|
|
4310
|
-
} : r ===
|
|
4333
|
+
} : r === ke.Success ? {
|
|
4311
4334
|
type: "success",
|
|
4312
4335
|
title: "Process Complete",
|
|
4313
4336
|
icon: "✓",
|
|
4314
4337
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4315
4338
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4316
4339
|
message: "Your verification process has been completed successfully."
|
|
4317
|
-
} : r ===
|
|
4340
|
+
} : r === ke.Failed ? {
|
|
4318
4341
|
type: "error",
|
|
4319
4342
|
title: "Process Failed",
|
|
4320
4343
|
icon: "✕",
|
|
4321
4344
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4322
4345
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4323
4346
|
message: "The verification process could not be completed."
|
|
4324
|
-
} : r ===
|
|
4347
|
+
} : r === ke.AdminReview ? {
|
|
4325
4348
|
type: "pending",
|
|
4326
4349
|
title: "Admin Review Required",
|
|
4327
4350
|
icon: "📋",
|
|
@@ -4434,12 +4457,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4434
4457
|
onCancel: s
|
|
4435
4458
|
}) => {
|
|
4436
4459
|
var C, B, z;
|
|
4437
|
-
const { config: a, baseInformationService: i } = re(), { createApplicant: c, isLoading: l } = rr(), [d, u] = x([]), [g, p] = x(!0), [m,
|
|
4460
|
+
const { config: a, baseInformationService: i } = re(), { createApplicant: c, isLoading: l } = rr(), [d, u] = x([]), [g, p] = x(!0), [m, v] = x(!1), [b, y] = x(null), P = t || ((C = a.applicantForm) == null ? void 0 : C.workflowKey);
|
|
4438
4461
|
if (!P)
|
|
4439
4462
|
throw new Error(
|
|
4440
4463
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4441
4464
|
);
|
|
4442
|
-
const
|
|
4465
|
+
const f = e || ((B = a.applicantForm) == null ? void 0 : B.externalRefId) || "", E = ((z = a.applicantForm) == null ? void 0 : z.visibleFields) || gt, [h, N] = x({
|
|
4443
4466
|
workflowKey: P,
|
|
4444
4467
|
firstName: "",
|
|
4445
4468
|
lastName: "",
|
|
@@ -4447,7 +4470,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4447
4470
|
email: "",
|
|
4448
4471
|
dateOfBirth: "",
|
|
4449
4472
|
phonenumber: "",
|
|
4450
|
-
externalRefId:
|
|
4473
|
+
externalRefId: f,
|
|
4451
4474
|
// Set from config or prop
|
|
4452
4475
|
mobileCountryCode: "",
|
|
4453
4476
|
street: "",
|
|
@@ -4470,128 +4493,128 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4470
4493
|
(async () => {
|
|
4471
4494
|
try {
|
|
4472
4495
|
p(!0);
|
|
4473
|
-
const
|
|
4496
|
+
const I = await i.getCountries("", a.locale || "en"), A = /* @__PURE__ */ new Set(), k = I.map((S) => ({
|
|
4474
4497
|
value: S.abbreviation3 || S.abbreviation,
|
|
4475
4498
|
label: S.name
|
|
4476
4499
|
})).filter((S) => !S.value || A.has(S.value) ? !1 : (A.add(S.value), !0));
|
|
4477
4500
|
u(k);
|
|
4478
|
-
} catch (
|
|
4479
|
-
console.error("Failed to load countries:",
|
|
4501
|
+
} catch (I) {
|
|
4502
|
+
console.error("Failed to load countries:", I);
|
|
4480
4503
|
} finally {
|
|
4481
4504
|
p(!1);
|
|
4482
4505
|
}
|
|
4483
4506
|
})();
|
|
4484
4507
|
}, [i, a.locale]);
|
|
4485
|
-
const F = (
|
|
4486
|
-
|
|
4487
|
-
}, L = async (
|
|
4488
|
-
|
|
4508
|
+
const F = (w, I) => {
|
|
4509
|
+
N((A) => ({ ...A, [w]: I }));
|
|
4510
|
+
}, L = async (w) => {
|
|
4511
|
+
w.preventDefault(), v(!0), y(null);
|
|
4489
4512
|
try {
|
|
4490
|
-
if (!
|
|
4491
|
-
|
|
4513
|
+
if (!h.externalRefId || h.externalRefId.trim() === "") {
|
|
4514
|
+
y("External Reference ID is required and cannot be empty"), v(!1);
|
|
4492
4515
|
return;
|
|
4493
4516
|
}
|
|
4494
|
-
const
|
|
4495
|
-
workflowKey:
|
|
4496
|
-
externalRefId:
|
|
4517
|
+
const I = {
|
|
4518
|
+
workflowKey: h.workflowKey,
|
|
4519
|
+
externalRefId: h.externalRefId.trim()
|
|
4497
4520
|
// Always include, never empty
|
|
4498
4521
|
};
|
|
4499
|
-
|
|
4522
|
+
E.forEach((k) => {
|
|
4500
4523
|
if (k === "externalRefId") return;
|
|
4501
|
-
const S =
|
|
4502
|
-
S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (
|
|
4503
|
-
}), console.log("Creating applicant with data:",
|
|
4524
|
+
const S = h[k];
|
|
4525
|
+
S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (I[k] = S);
|
|
4526
|
+
}), console.log("Creating applicant with data:", I);
|
|
4504
4527
|
const A = await c(
|
|
4505
|
-
|
|
4528
|
+
I
|
|
4506
4529
|
);
|
|
4507
4530
|
console.log("Applicant created:", A), r(A.applicantId);
|
|
4508
|
-
} catch (
|
|
4509
|
-
console.error("Error creating applicant:",
|
|
4531
|
+
} catch (I) {
|
|
4532
|
+
console.error("Error creating applicant:", I), y(I.message || "Failed to create applicant");
|
|
4510
4533
|
} finally {
|
|
4511
|
-
|
|
4534
|
+
v(!1);
|
|
4512
4535
|
}
|
|
4513
|
-
}, R = (
|
|
4536
|
+
}, R = (w) => {
|
|
4514
4537
|
var A, k;
|
|
4515
|
-
const
|
|
4516
|
-
switch (
|
|
4538
|
+
const I = yt[w];
|
|
4539
|
+
switch (I.type) {
|
|
4517
4540
|
case "select":
|
|
4518
|
-
return
|
|
4541
|
+
return w === "country" || w === "nationality" || w === "taxCountry" || w === "countryOfBirth" ? /* @__PURE__ */ n(
|
|
4519
4542
|
ge,
|
|
4520
4543
|
{
|
|
4521
|
-
label:
|
|
4522
|
-
value: w
|
|
4523
|
-
onChange: (S) => F(
|
|
4544
|
+
label: I.label,
|
|
4545
|
+
value: h[w] || "",
|
|
4546
|
+
onChange: (S) => F(w, S.target.value),
|
|
4524
4547
|
options: [
|
|
4525
|
-
{ value: "", label: `Select ${
|
|
4548
|
+
{ value: "", label: `Select ${I.label.toLowerCase()}...` },
|
|
4526
4549
|
...d
|
|
4527
4550
|
],
|
|
4528
4551
|
disabled: g
|
|
4529
4552
|
},
|
|
4530
|
-
|
|
4531
|
-
) :
|
|
4553
|
+
w
|
|
4554
|
+
) : w === "salutation" ? /* @__PURE__ */ n(
|
|
4532
4555
|
ge,
|
|
4533
4556
|
{
|
|
4534
|
-
label:
|
|
4535
|
-
value: ((A = w
|
|
4536
|
-
onChange: (S) => F(
|
|
4557
|
+
label: I.label,
|
|
4558
|
+
value: ((A = h[w]) == null ? void 0 : A.toString()) || "",
|
|
4559
|
+
onChange: (S) => F(w, S.target.value ? Number(S.target.value) : null),
|
|
4537
4560
|
options: [
|
|
4538
4561
|
{ value: "", label: "Select salutation..." },
|
|
4539
|
-
{ value:
|
|
4540
|
-
{ value:
|
|
4541
|
-
{ value:
|
|
4562
|
+
{ value: Ne.Male.toString(), label: "Male" },
|
|
4563
|
+
{ value: Ne.Female.toString(), label: "Female" },
|
|
4564
|
+
{ value: Ne.Other.toString(), label: "Other" }
|
|
4542
4565
|
]
|
|
4543
4566
|
},
|
|
4544
|
-
|
|
4567
|
+
w
|
|
4545
4568
|
) : null;
|
|
4546
4569
|
case "multiselect":
|
|
4547
|
-
return
|
|
4570
|
+
return w === "otherNationality" ? /* @__PURE__ */ n(
|
|
4548
4571
|
Z,
|
|
4549
4572
|
{
|
|
4550
4573
|
type: "text",
|
|
4551
|
-
label:
|
|
4552
|
-
value: ((k = w
|
|
4574
|
+
label: I.label,
|
|
4575
|
+
value: ((k = h[w]) == null ? void 0 : k.join(", ")) || "",
|
|
4553
4576
|
onChange: (S) => {
|
|
4554
4577
|
const _ = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
|
|
4555
|
-
F(
|
|
4578
|
+
F(w, _);
|
|
4556
4579
|
},
|
|
4557
4580
|
placeholder: "Enter countries separated by commas"
|
|
4558
4581
|
},
|
|
4559
|
-
|
|
4582
|
+
w
|
|
4560
4583
|
) : null;
|
|
4561
4584
|
case "date":
|
|
4562
4585
|
return /* @__PURE__ */ n(
|
|
4563
4586
|
Z,
|
|
4564
4587
|
{
|
|
4565
4588
|
type: "date",
|
|
4566
|
-
label:
|
|
4567
|
-
value: w
|
|
4568
|
-
onChange: (S) => F(
|
|
4589
|
+
label: I.label,
|
|
4590
|
+
value: h[w] || "",
|
|
4591
|
+
onChange: (S) => F(w, S.target.value)
|
|
4569
4592
|
},
|
|
4570
|
-
|
|
4593
|
+
w
|
|
4571
4594
|
);
|
|
4572
4595
|
case "email":
|
|
4573
4596
|
return /* @__PURE__ */ n(
|
|
4574
4597
|
Z,
|
|
4575
4598
|
{
|
|
4576
4599
|
type: "email",
|
|
4577
|
-
label:
|
|
4578
|
-
value: w
|
|
4579
|
-
onChange: (S) => F(
|
|
4580
|
-
required:
|
|
4600
|
+
label: I.label,
|
|
4601
|
+
value: h[w] || "",
|
|
4602
|
+
onChange: (S) => F(w, S.target.value),
|
|
4603
|
+
required: w === "email"
|
|
4581
4604
|
},
|
|
4582
|
-
|
|
4605
|
+
w
|
|
4583
4606
|
);
|
|
4584
4607
|
case "tel":
|
|
4585
4608
|
return /* @__PURE__ */ n(
|
|
4586
4609
|
Z,
|
|
4587
4610
|
{
|
|
4588
4611
|
type: "tel",
|
|
4589
|
-
label:
|
|
4590
|
-
value: w
|
|
4591
|
-
onChange: (S) => F(
|
|
4592
|
-
required:
|
|
4612
|
+
label: I.label,
|
|
4613
|
+
value: h[w] || "",
|
|
4614
|
+
onChange: (S) => F(w, S.target.value),
|
|
4615
|
+
required: w === "phonenumber"
|
|
4593
4616
|
},
|
|
4594
|
-
|
|
4617
|
+
w
|
|
4595
4618
|
);
|
|
4596
4619
|
case "text":
|
|
4597
4620
|
default:
|
|
@@ -4599,12 +4622,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4599
4622
|
Z,
|
|
4600
4623
|
{
|
|
4601
4624
|
type: "text",
|
|
4602
|
-
label:
|
|
4603
|
-
value: w
|
|
4604
|
-
onChange: (S) => F(
|
|
4605
|
-
required:
|
|
4625
|
+
label: I.label,
|
|
4626
|
+
value: h[w] || "",
|
|
4627
|
+
onChange: (S) => F(w, S.target.value),
|
|
4628
|
+
required: w === "firstName" || w === "lastName" || w === "externalRefId"
|
|
4606
4629
|
},
|
|
4607
|
-
|
|
4630
|
+
w
|
|
4608
4631
|
);
|
|
4609
4632
|
}
|
|
4610
4633
|
};
|
|
@@ -4620,12 +4643,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4620
4643
|
}
|
|
4621
4644
|
) }),
|
|
4622
4645
|
/* @__PURE__ */ o(M, { children: [
|
|
4623
|
-
|
|
4646
|
+
b && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4624
4647
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
4625
4648
|
" ",
|
|
4626
|
-
|
|
4649
|
+
b
|
|
4627
4650
|
] }) }),
|
|
4628
|
-
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
4651
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: E.map((w) => R(w)) })
|
|
4629
4652
|
] }),
|
|
4630
4653
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
4631
4654
|
s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: m || l, children: "Cancel" }),
|
|
@@ -4648,9 +4671,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4648
4671
|
hasWorkflowChanged: g,
|
|
4649
4672
|
isLoading: p,
|
|
4650
4673
|
error: m,
|
|
4651
|
-
moveBack:
|
|
4652
|
-
refreshProgress:
|
|
4653
|
-
} = Gt(t), [
|
|
4674
|
+
moveBack: v,
|
|
4675
|
+
refreshProgress: b
|
|
4676
|
+
} = Gt(t), [y, P] = le.useState(!1);
|
|
4654
4677
|
if (le.useEffect(() => {
|
|
4655
4678
|
m && r && r(m);
|
|
4656
4679
|
}, [m, r]), le.useEffect(() => {
|
|
@@ -4669,7 +4692,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4669
4692
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
4670
4693
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
|
|
4671
4694
|
] }) }) }) });
|
|
4672
|
-
if (g && !
|
|
4695
|
+
if (g && !y)
|
|
4673
4696
|
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4674
4697
|
/* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
|
|
4675
4698
|
/* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
@@ -4699,7 +4722,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4699
4722
|
] }) }) }) });
|
|
4700
4723
|
if (i.status === ae.Finished || i.status === ae.OnHold)
|
|
4701
4724
|
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
|
|
4702
|
-
|
|
4725
|
+
$e,
|
|
4703
4726
|
{
|
|
4704
4727
|
kycStatus: i.kycStatus,
|
|
4705
4728
|
reviewStatus: i.reviewStatus,
|
|
@@ -4716,8 +4739,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4716
4739
|
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
4717
4740
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === ae.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
4718
4741
|
] }) }) });
|
|
4719
|
-
const
|
|
4720
|
-
const
|
|
4742
|
+
const f = () => {
|
|
4743
|
+
const h = l.filter((R) => R.visibility !== !1), N = h.findIndex((R) => R.order === c.order), F = N >= 0 ? N + 1 : 1, L = h.length;
|
|
4721
4744
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
4722
4745
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
4723
4746
|
/* @__PURE__ */ n(Ze, {}),
|
|
@@ -4728,8 +4751,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4728
4751
|
L
|
|
4729
4752
|
] })
|
|
4730
4753
|
] }),
|
|
4731
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children:
|
|
4732
|
-
const B = C <
|
|
4754
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: h.map((R, C) => {
|
|
4755
|
+
const B = C < N, z = R.order === c.order;
|
|
4733
4756
|
return /* @__PURE__ */ o(le.Fragment, { children: [
|
|
4734
4757
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
4735
4758
|
/* @__PURE__ */ n(
|
|
@@ -4750,7 +4773,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4750
4773
|
}
|
|
4751
4774
|
)
|
|
4752
4775
|
] }),
|
|
4753
|
-
C <
|
|
4776
|
+
C < h.length - 1 && /* @__PURE__ */ n(
|
|
4754
4777
|
"div",
|
|
4755
4778
|
{
|
|
4756
4779
|
className: `flex-1 h-0.5 mx-4 ${B ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
@@ -4759,33 +4782,33 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4759
4782
|
] }, R.order);
|
|
4760
4783
|
}) })
|
|
4761
4784
|
] });
|
|
4762
|
-
},
|
|
4763
|
-
const
|
|
4785
|
+
}, E = () => {
|
|
4786
|
+
const h = {
|
|
4764
4787
|
applicantId: t,
|
|
4765
4788
|
onComplete: async () => {
|
|
4766
|
-
await
|
|
4789
|
+
await b();
|
|
4767
4790
|
},
|
|
4768
|
-
onBack: c.order > 0 ?
|
|
4791
|
+
onBack: c.order > 0 ? v : void 0
|
|
4769
4792
|
};
|
|
4770
4793
|
switch (c.action) {
|
|
4771
4794
|
case U.Questionaries:
|
|
4772
|
-
return /* @__PURE__ */ n(vr, { ...
|
|
4795
|
+
return /* @__PURE__ */ n(vr, { ...h });
|
|
4773
4796
|
case U.UploadDocument:
|
|
4774
|
-
return /* @__PURE__ */ n(wr, { ...
|
|
4797
|
+
return /* @__PURE__ */ n(wr, { ...h });
|
|
4775
4798
|
case U.Overview:
|
|
4776
|
-
return /* @__PURE__ */ n(kr, { ...
|
|
4799
|
+
return /* @__PURE__ */ n(kr, { ...h });
|
|
4777
4800
|
case U.IdentitySdk:
|
|
4778
|
-
return /* @__PURE__ */ n(Ar, { ...
|
|
4801
|
+
return /* @__PURE__ */ n(Ar, { ...h });
|
|
4779
4802
|
case U.RiskScoring:
|
|
4780
|
-
return /* @__PURE__ */ n(Nr, { ...
|
|
4803
|
+
return /* @__PURE__ */ n(Nr, { ...h });
|
|
4781
4804
|
case U.AdditionalData:
|
|
4782
4805
|
case U.InvestorCategorization:
|
|
4783
|
-
return /* @__PURE__ */ n(Sr, { ...
|
|
4806
|
+
return /* @__PURE__ */ n(Sr, { ...h });
|
|
4784
4807
|
case U.AppropriatenessTest:
|
|
4785
|
-
return /* @__PURE__ */ n(Cr, { ...
|
|
4808
|
+
return /* @__PURE__ */ n(Cr, { ...h });
|
|
4786
4809
|
case U.ManualReview:
|
|
4787
4810
|
return /* @__PURE__ */ n(
|
|
4788
|
-
|
|
4811
|
+
$e,
|
|
4789
4812
|
{
|
|
4790
4813
|
kycStatus: i.kycStatus,
|
|
4791
4814
|
reviewStatus: i.reviewStatus,
|
|
@@ -4808,8 +4831,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4808
4831
|
}
|
|
4809
4832
|
};
|
|
4810
4833
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
|
|
4811
|
-
|
|
4812
|
-
|
|
4834
|
+
f(),
|
|
4835
|
+
E()
|
|
4813
4836
|
] });
|
|
4814
4837
|
};
|
|
4815
4838
|
export {
|
|
@@ -4838,7 +4861,7 @@ export {
|
|
|
4838
4861
|
yt as FIELD_METADATA,
|
|
4839
4862
|
ct as FileType,
|
|
4840
4863
|
nr as FileUpload,
|
|
4841
|
-
|
|
4864
|
+
Ne as GenderType,
|
|
4842
4865
|
Ze as Header,
|
|
4843
4866
|
xt as HttpClient,
|
|
4844
4867
|
ye as IdentityProviderManager,
|
|
@@ -4852,7 +4875,7 @@ export {
|
|
|
4852
4875
|
pt as InvestorCategoryType,
|
|
4853
4876
|
ot as KycProcessStatus,
|
|
4854
4877
|
he as KycStatus,
|
|
4855
|
-
|
|
4878
|
+
$e as KycStatusDisplay,
|
|
4856
4879
|
Wr as KycWorkflow,
|
|
4857
4880
|
Er as Logo,
|
|
4858
4881
|
Ue as MetaKYCContext,
|
|
@@ -4880,9 +4903,9 @@ export {
|
|
|
4880
4903
|
kt as UploadDocumentService,
|
|
4881
4904
|
wr as UploadDocumentStep,
|
|
4882
4905
|
lt as UserType,
|
|
4883
|
-
|
|
4906
|
+
Re as ValueDataType,
|
|
4884
4907
|
$t as WorkflowOrchestrator,
|
|
4885
|
-
|
|
4908
|
+
ke as WorkflowResultType,
|
|
4886
4909
|
Ot as WorkflowState,
|
|
4887
4910
|
U as WorkflowStepAction,
|
|
4888
4911
|
Vr as appropriatenessTestSchema,
|
|
@@ -4895,7 +4918,7 @@ export {
|
|
|
4895
4918
|
Q as defaultTheme,
|
|
4896
4919
|
qt as fileToBase64,
|
|
4897
4920
|
Dt as fintechTheme,
|
|
4898
|
-
|
|
4921
|
+
Ee as formatFileSize,
|
|
4899
4922
|
Hr as generateAppropriatenessSchema,
|
|
4900
4923
|
yr as generateQuestionnaireSchema,
|
|
4901
4924
|
br as generateRiskScoringSchema,
|