@vpdev2/metakyc-sdk 1.0.55 → 1.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CreateApplicantForm.d.ts.map +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +209 -142
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,13 +2,13 @@ var bt = Object.defineProperty;
|
|
|
2
2
|
var vt = (e, t, n) => t in e ? bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var re = (e, t, n) => vt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import kt from "axios";
|
|
5
|
-
import * as
|
|
5
|
+
import * as nt from "react";
|
|
6
6
|
import ge, { createContext as wt, useState as b, useMemo as Ee, useEffect as ne, useContext as Nt, useRef as ee, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
|
|
7
|
-
import { jsx as r, jsxs as s, Fragment as
|
|
8
|
-
import { createPortal as
|
|
7
|
+
import { jsx as r, jsxs as s, Fragment as ct } from "react/jsx-runtime";
|
|
8
|
+
import { createPortal as Ve } from "react-dom";
|
|
9
9
|
import { useForm as St, Controller as Pe } from "react-hook-form";
|
|
10
10
|
import { z as Se } from "zod";
|
|
11
|
-
var G = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(G || {}),
|
|
11
|
+
var G = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(G || {}), qe = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(qe || {}), xe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(xe || {}), Ct = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(Ct || {}), At = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(At || {}), De = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(De || {}), Fe = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(Fe || {}), Et = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Et || {}), It = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(It || {}), fe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(fe || {}), Rt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Rt || {}), Ke = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ke || {}), Pt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(Pt || {}), Dt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Dt || {}), Ft = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Ft || {}), Ie = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ie || {}), Lt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(Lt || {}), Tt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Tt || {}), he = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(he || {}), Mt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Mt || {});
|
|
12
12
|
const Le = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -44,7 +44,7 @@ const Le = {
|
|
|
44
44
|
"email",
|
|
45
45
|
"phonenumber",
|
|
46
46
|
"dateOfBirth"
|
|
47
|
-
],
|
|
47
|
+
], at = [
|
|
48
48
|
{ value: "EN", label: "English" },
|
|
49
49
|
{ value: "DE", label: "German" },
|
|
50
50
|
{ value: "FR", label: "French" },
|
|
@@ -438,7 +438,7 @@ class Ut {
|
|
|
438
438
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", t);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
class
|
|
441
|
+
class jt {
|
|
442
442
|
constructor(t) {
|
|
443
443
|
this.httpClient = t;
|
|
444
444
|
}
|
|
@@ -464,7 +464,7 @@ class qt {
|
|
|
464
464
|
)).result;
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
class
|
|
467
|
+
class qt {
|
|
468
468
|
constructor(t) {
|
|
469
469
|
this.httpClient = t;
|
|
470
470
|
}
|
|
@@ -1788,7 +1788,7 @@ class cr {
|
|
|
1788
1788
|
}
|
|
1789
1789
|
const ut = wt(null), on = ({ config: e, children: t }) => {
|
|
1790
1790
|
const [n, a] = b(null), i = ge.useRef(!1), o = ge.useRef(!1), l = Ee(() => {
|
|
1791
|
-
const u = new Bt(e), p = new _t(u), x = new Ht(u), N = new Ut(u), m = new
|
|
1791
|
+
const u = new Bt(e), p = new _t(u), x = new Ht(u), N = new Ut(u), m = new jt(u), y = new qt(u), h = new Kt(u), C = new Wt(u), F = new Yt(u), k = new Qt(u), $ = new tr(u), A = new cr();
|
|
1792
1792
|
return {
|
|
1793
1793
|
httpClient: u,
|
|
1794
1794
|
applicantService: p,
|
|
@@ -2018,7 +2018,7 @@ function yr(e) {
|
|
|
2018
2018
|
o(!1);
|
|
2019
2019
|
}
|
|
2020
2020
|
}
|
|
2021
|
-
}, []), k =
|
|
2021
|
+
}, []), k = nt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((A, I) => A.order - I.order) : [], [n == null ? void 0 : n.stepInfoList]), $ = nt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2022
2022
|
return {
|
|
2023
2023
|
progress: n,
|
|
2024
2024
|
applicantId: p,
|
|
@@ -2055,13 +2055,13 @@ function fr(e) {
|
|
|
2055
2055
|
n.getApplicantData(e).catch(() => null)
|
|
2056
2056
|
]);
|
|
2057
2057
|
if (i(A), (k = I == null ? void 0 : I.questionnaireResults) != null && k.length && A) {
|
|
2058
|
-
const
|
|
2058
|
+
const j = /* @__PURE__ */ new Map();
|
|
2059
2059
|
for (const g of I.questionnaireResults)
|
|
2060
|
-
g.question && (($ = g.answers) != null && $.length) &&
|
|
2060
|
+
g.question && (($ = g.answers) != null && $.length) && j.set(g.question.trim().toLowerCase(), g.answers);
|
|
2061
2061
|
const J = {}, E = A.questionGroups.flatMap((g) => g.questions ?? []);
|
|
2062
2062
|
for (const g of E) {
|
|
2063
2063
|
const R = g.text.trim().toLowerCase();
|
|
2064
|
-
|
|
2064
|
+
j.has(R) && (J[g.id] = j.get(R));
|
|
2065
2065
|
}
|
|
2066
2066
|
l(J);
|
|
2067
2067
|
}
|
|
@@ -2326,12 +2326,12 @@ function kr(e) {
|
|
|
2326
2326
|
}
|
|
2327
2327
|
C.current = !0, u(!0), m(null);
|
|
2328
2328
|
try {
|
|
2329
|
-
const [I,
|
|
2329
|
+
const [I, j] = await Promise.all([
|
|
2330
2330
|
t.getRiskCriterias(e),
|
|
2331
2331
|
n.getApplicantData(e).catch(() => null)
|
|
2332
2332
|
]);
|
|
2333
|
-
if (i(I), (A =
|
|
2334
|
-
const J =
|
|
2333
|
+
if (i(I), (A = j == null ? void 0 : j.riskScoringResults) != null && A.length) {
|
|
2334
|
+
const J = j.riskScoringResults[0], E = {};
|
|
2335
2335
|
for (const g of J.riskCriteriaResults ?? [])
|
|
2336
2336
|
if (g.riskCriteriaId != null && g.answer != null && g.answer !== "") {
|
|
2337
2337
|
const R = [...new Set(
|
|
@@ -2698,7 +2698,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2698
2698
|
] })
|
|
2699
2699
|
);
|
|
2700
2700
|
He.displayName = "Select";
|
|
2701
|
-
const
|
|
2701
|
+
const it = 280, Nr = ({
|
|
2702
2702
|
label: e,
|
|
2703
2703
|
value: t,
|
|
2704
2704
|
onChange: n,
|
|
@@ -2709,7 +2709,7 @@ const at = 280, Nr = ({
|
|
|
2709
2709
|
}) => {
|
|
2710
2710
|
const [d, u] = b(!1), [p, x] = b(""), [N, m] = b(null), y = ee(null), h = ee(null), C = ee(null), F = Q(() => {
|
|
2711
2711
|
if (!h.current) return null;
|
|
2712
|
-
const w = h.current.getBoundingClientRect(), te = window.innerHeight - w.bottom <
|
|
2712
|
+
const w = h.current.getBoundingClientRect(), te = window.innerHeight - w.bottom < it && w.top > it;
|
|
2713
2713
|
return { top: te ? w.top : w.bottom + 4, left: w.left, width: w.width, openUp: te };
|
|
2714
2714
|
}, []), k = Q(() => {
|
|
2715
2715
|
if (o) return;
|
|
@@ -2740,7 +2740,7 @@ const at = 280, Nr = ({
|
|
|
2740
2740
|
(w) => w.label.toLowerCase().includes(p.toLowerCase())
|
|
2741
2741
|
), I = (w) => {
|
|
2742
2742
|
o || n(t.includes(w) ? t.filter((U) => U !== w) : [...t, w]);
|
|
2743
|
-
},
|
|
2743
|
+
}, j = (w, U) => {
|
|
2744
2744
|
U.stopPropagation(), o || n(t.filter((te) => te !== w));
|
|
2745
2745
|
}, J = (w) => {
|
|
2746
2746
|
var U;
|
|
@@ -2896,7 +2896,7 @@ const at = 280, Nr = ({
|
|
|
2896
2896
|
"button",
|
|
2897
2897
|
{
|
|
2898
2898
|
type: "button",
|
|
2899
|
-
onClick: (U) =>
|
|
2899
|
+
onClick: (U) => j(w, U),
|
|
2900
2900
|
className: "metakyc-multiselect-chip-remove",
|
|
2901
2901
|
style: {
|
|
2902
2902
|
background: "transparent",
|
|
@@ -2935,9 +2935,9 @@ const at = 280, Nr = ({
|
|
|
2935
2935
|
]
|
|
2936
2936
|
}
|
|
2937
2937
|
),
|
|
2938
|
-
typeof document < "u" && Z ?
|
|
2938
|
+
typeof document < "u" && Z ? Ve(Z, document.body) : null
|
|
2939
2939
|
] });
|
|
2940
|
-
},
|
|
2940
|
+
}, st = 260, We = ({
|
|
2941
2941
|
label: e,
|
|
2942
2942
|
error: t,
|
|
2943
2943
|
helperText: n,
|
|
@@ -2952,20 +2952,20 @@ const at = 280, Nr = ({
|
|
|
2952
2952
|
var D;
|
|
2953
2953
|
const [x, N] = b(!1), [m, y] = b(""), [h, C] = b(null), F = ee(null), k = ee(null), $ = ee(null), A = ee(null), I = Q(() => {
|
|
2954
2954
|
if (!k.current) return null;
|
|
2955
|
-
const S = k.current.getBoundingClientRect(), X = window.innerHeight - S.bottom <
|
|
2955
|
+
const S = k.current.getBoundingClientRect(), X = window.innerHeight - S.bottom < st && S.top > st;
|
|
2956
2956
|
return {
|
|
2957
2957
|
top: X ? S.top : S.bottom + 4,
|
|
2958
2958
|
left: S.left,
|
|
2959
2959
|
width: S.width,
|
|
2960
2960
|
openUp: X
|
|
2961
2961
|
};
|
|
2962
|
-
}, []),
|
|
2962
|
+
}, []), j = Q(() => {
|
|
2963
2963
|
if (d) return;
|
|
2964
2964
|
const S = I();
|
|
2965
2965
|
S && C(S), N(!0);
|
|
2966
2966
|
}, [d, I]), J = Q(() => {
|
|
2967
2967
|
N(!1), y("");
|
|
2968
|
-
}, []), E = () => x ? J() :
|
|
2968
|
+
}, []), E = () => x ? J() : j();
|
|
2969
2969
|
ne(() => {
|
|
2970
2970
|
if (!x) return;
|
|
2971
2971
|
const S = (H) => {
|
|
@@ -3133,7 +3133,7 @@ const at = 280, Nr = ({
|
|
|
3133
3133
|
]
|
|
3134
3134
|
}
|
|
3135
3135
|
),
|
|
3136
|
-
typeof document < "u" && B ?
|
|
3136
|
+
typeof document < "u" && B ? Ve(B, document.body) : null,
|
|
3137
3137
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3138
3138
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3139
3139
|
]
|
|
@@ -3349,7 +3349,7 @@ const Er = (e) => e.replace(
|
|
|
3349
3349
|
* This source code is licensed under the ISC license.
|
|
3350
3350
|
* See the LICENSE file in the root directory of this source tree.
|
|
3351
3351
|
*/
|
|
3352
|
-
const
|
|
3352
|
+
const ot = (e) => {
|
|
3353
3353
|
const t = Er(e);
|
|
3354
3354
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3355
3355
|
};
|
|
@@ -3429,14 +3429,14 @@ const pt = (e, t) => {
|
|
|
3429
3429
|
ref: o,
|
|
3430
3430
|
iconNode: t,
|
|
3431
3431
|
className: mt(
|
|
3432
|
-
`lucide-${Ar(
|
|
3432
|
+
`lucide-${Ar(ot(e))}`,
|
|
3433
3433
|
`lucide-${e}`,
|
|
3434
3434
|
a
|
|
3435
3435
|
),
|
|
3436
3436
|
...i
|
|
3437
3437
|
})
|
|
3438
3438
|
);
|
|
3439
|
-
return n.displayName =
|
|
3439
|
+
return n.displayName = ot(e), n;
|
|
3440
3440
|
};
|
|
3441
3441
|
/**
|
|
3442
3442
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3517,7 +3517,7 @@ const Mr = ({
|
|
|
3517
3517
|
return m((g) => ({ ...g, ...E })), Object.keys(E).length === 0;
|
|
3518
3518
|
}, [k, p]), I = () => {
|
|
3519
3519
|
A() && h((E) => E + 1);
|
|
3520
|
-
},
|
|
3520
|
+
}, j = () => {
|
|
3521
3521
|
y > 0 ? h((E) => E - 1) : n == null || n();
|
|
3522
3522
|
}, J = async () => {
|
|
3523
3523
|
if (!(!A() || !a))
|
|
@@ -3581,7 +3581,7 @@ const Mr = ({
|
|
|
3581
3581
|
{
|
|
3582
3582
|
type: "button",
|
|
3583
3583
|
variant: "outline",
|
|
3584
|
-
onClick:
|
|
3584
|
+
onClick: j,
|
|
3585
3585
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3586
3586
|
children: [
|
|
3587
3587
|
/* @__PURE__ */ r(ht, { size: 14 }),
|
|
@@ -3871,7 +3871,7 @@ const Ur = ({
|
|
|
3871
3871
|
const _ = { ...z };
|
|
3872
3872
|
return delete _[R], _;
|
|
3873
3873
|
});
|
|
3874
|
-
}, []),
|
|
3874
|
+
}, []), j = Q(() => {
|
|
3875
3875
|
const R = {};
|
|
3876
3876
|
for (const { criterion: P } of A) {
|
|
3877
3877
|
const z = Br(P, p[P.id] ?? []);
|
|
@@ -3879,11 +3879,11 @@ const Ur = ({
|
|
|
3879
3879
|
}
|
|
3880
3880
|
return m((P) => ({ ...P, ...R })), Object.keys(R).length === 0;
|
|
3881
3881
|
}, [A, p]), J = () => {
|
|
3882
|
-
|
|
3882
|
+
j() && h((R) => R + 1);
|
|
3883
3883
|
}, E = () => {
|
|
3884
3884
|
y > 0 ? h((R) => R - 1) : n == null || n();
|
|
3885
3885
|
}, g = async () => {
|
|
3886
|
-
if (!(!
|
|
3886
|
+
if (!(!j() || !a))
|
|
3887
3887
|
try {
|
|
3888
3888
|
const R = a.map((z) => {
|
|
3889
3889
|
const _ = (p[z.id] ?? []).filter((O) => O && O.trim());
|
|
@@ -3929,7 +3929,7 @@ const Ur = ({
|
|
|
3929
3929
|
] })
|
|
3930
3930
|
] }),
|
|
3931
3931
|
/* @__PURE__ */ r(W, { className: "space-y-6", children: A.map(({ criterion: R }) => /* @__PURE__ */ r(
|
|
3932
|
-
|
|
3932
|
+
jr,
|
|
3933
3933
|
{
|
|
3934
3934
|
criterion: R,
|
|
3935
3935
|
value: p[R.id] ?? [],
|
|
@@ -3967,7 +3967,7 @@ const Ur = ({
|
|
|
3967
3967
|
] }),
|
|
3968
3968
|
d && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: d.message }) })
|
|
3969
3969
|
] }) : null;
|
|
3970
|
-
},
|
|
3970
|
+
}, jr = ({ criterion: e, value: t, error: n, onChange: a }) => {
|
|
3971
3971
|
const i = Hr(e), o = e.valueDataType === Ie.Integer || e.valueDataType === Ie.Decimal || e.valueDataType === Ie.DigitOnly;
|
|
3972
3972
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
3973
3973
|
/* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
@@ -4084,7 +4084,7 @@ const Ur = ({
|
|
|
4084
4084
|
}
|
|
4085
4085
|
)
|
|
4086
4086
|
] });
|
|
4087
|
-
},
|
|
4087
|
+
}, qr = ({
|
|
4088
4088
|
applicantId: e,
|
|
4089
4089
|
onComplete: t,
|
|
4090
4090
|
onBack: n
|
|
@@ -4227,7 +4227,7 @@ const Ur = ({
|
|
|
4227
4227
|
onComplete: t,
|
|
4228
4228
|
onBack: n
|
|
4229
4229
|
}) => {
|
|
4230
|
-
const { appropriatenessTestService: a } = ye(), [i, o] = b(null), [l, d] = b(!0), [u, p] = b(!1), [x, N] = b(null), [m, y] = b({}), [h, C] = b(0), [F, k] = b(!1), [$, A] = b(!1), [I,
|
|
4230
|
+
const { appropriatenessTestService: a } = ye(), [i, o] = b(null), [l, d] = b(!0), [u, p] = b(!1), [x, N] = b(null), [m, y] = b({}), [h, C] = b(0), [F, k] = b(!1), [$, A] = b(!1), [I, j] = b(0);
|
|
4231
4231
|
ne(() => {
|
|
4232
4232
|
(async () => {
|
|
4233
4233
|
try {
|
|
@@ -4235,7 +4235,7 @@ const Ur = ({
|
|
|
4235
4235
|
const M = await a.getAppropriatenessTest(e);
|
|
4236
4236
|
if (console.log("Appropriateness test data:", M), o(M), M.waitTimeSpanForNextTry && M.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4237
4237
|
const Z = J(M.waitTimeSpanForNextTry);
|
|
4238
|
-
Z > 0 &&
|
|
4238
|
+
Z > 0 && j(Z);
|
|
4239
4239
|
}
|
|
4240
4240
|
} catch (M) {
|
|
4241
4241
|
console.error("Error loading appropriateness test:", M), N(M.message || "Failed to load appropriateness test");
|
|
@@ -4264,7 +4264,7 @@ const Ur = ({
|
|
|
4264
4264
|
}, [F, h]), ne(() => {
|
|
4265
4265
|
if (I <= 0) return;
|
|
4266
4266
|
const O = setInterval(() => {
|
|
4267
|
-
|
|
4267
|
+
j((M) => M <= 1 ? 0 : M - 1);
|
|
4268
4268
|
}, 1e3);
|
|
4269
4269
|
return () => clearInterval(O);
|
|
4270
4270
|
}, [I]), ne(() => {
|
|
@@ -4321,7 +4321,7 @@ const Ur = ({
|
|
|
4321
4321
|
const O = await a.getAppropriatenessTest(e);
|
|
4322
4322
|
if (console.log("Reloaded test data:", O), o(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4323
4323
|
const M = J(O.waitTimeSpanForNextTry);
|
|
4324
|
-
M > 0 &&
|
|
4324
|
+
M > 0 && j(M);
|
|
4325
4325
|
}
|
|
4326
4326
|
} catch (O) {
|
|
4327
4327
|
console.error("Error reloading test data:", O), N((M) => M + `
|
|
@@ -4510,7 +4510,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4510
4510
|
onBack: n
|
|
4511
4511
|
}) => {
|
|
4512
4512
|
var Z, w, U, te;
|
|
4513
|
-
const { applicantService: a, baseInformationService: i, config: o } = ye(), { identityData: l, provider: d, token: u, isLoading: p, error: x, requestIdentity: N, restartIdentity: m } = vr(e), [y, h] = b(null), [C, F] = b(null), [k, $] = b([]), [A, I] = b(!0), [
|
|
4513
|
+
const { applicantService: a, baseInformationService: i, config: o } = ye(), { identityData: l, provider: d, token: u, isLoading: p, error: x, requestIdentity: N, restartIdentity: m } = vr(e), [y, h] = b(null), [C, F] = b(null), [k, $] = b([]), [A, I] = b(!0), [j, J] = b(!1), [E, g] = b(null), [R, P] = b(!1), z = ge.useRef(!1), _ = St({
|
|
4514
4514
|
defaultValues: {
|
|
4515
4515
|
street: "",
|
|
4516
4516
|
streetNumber: "",
|
|
@@ -4558,8 +4558,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4558
4558
|
}
|
|
4559
4559
|
})();
|
|
4560
4560
|
}, [e]), ne(() => {
|
|
4561
|
-
l && !
|
|
4562
|
-
}, [l,
|
|
4561
|
+
l && !j && (console.log("[Identity] Identity data already loaded, showing provider"), J(!0));
|
|
4562
|
+
}, [l, j]), ne(() => {
|
|
4563
4563
|
if (u) {
|
|
4564
4564
|
if (u.expiresAt) {
|
|
4565
4565
|
const B = new Date(u.expiresAt).getTime();
|
|
@@ -4584,7 +4584,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4584
4584
|
}
|
|
4585
4585
|
}
|
|
4586
4586
|
}, [u]), ne(() => {
|
|
4587
|
-
if (d !== null && u && !y &&
|
|
4587
|
+
if (d !== null && u && !y && j && !R) {
|
|
4588
4588
|
const B = d;
|
|
4589
4589
|
if (u.url) {
|
|
4590
4590
|
console.log("[Identity] Loading provider URL for user verification:", u.url), g(null);
|
|
@@ -4650,7 +4650,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4650
4650
|
console.error("[Identity] Error destroying provider:", B);
|
|
4651
4651
|
}
|
|
4652
4652
|
};
|
|
4653
|
-
}, [d, u, y,
|
|
4653
|
+
}, [d, u, y, j, t, R]);
|
|
4654
4654
|
const O = async () => {
|
|
4655
4655
|
try {
|
|
4656
4656
|
g(null), P(!1), await N(), J(!0);
|
|
@@ -4674,7 +4674,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4674
4674
|
"Error: ",
|
|
4675
4675
|
x.message
|
|
4676
4676
|
] }) }) });
|
|
4677
|
-
if (
|
|
4677
|
+
if (j && (E || R))
|
|
4678
4678
|
return /* @__PURE__ */ s(K, { children: [
|
|
4679
4679
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4680
4680
|
/* @__PURE__ */ s(W, { children: [
|
|
@@ -4716,7 +4716,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4716
4716
|
/* @__PURE__ */ r(V, { type: "button", onClick: M, disabled: p, children: p ? "Restarting..." : "Restart Verification" })
|
|
4717
4717
|
] })
|
|
4718
4718
|
] });
|
|
4719
|
-
if (
|
|
4719
|
+
if (j && l) {
|
|
4720
4720
|
const B = d;
|
|
4721
4721
|
return u != null && u.url ? /* @__PURE__ */ s(K, { children: [
|
|
4722
4722
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4905,7 +4905,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4905
4905
|
/* @__PURE__ */ r(V, { type: "submit", isLoading: p, children: "Confirm and Start Verification" })
|
|
4906
4906
|
] })
|
|
4907
4907
|
] }) });
|
|
4908
|
-
},
|
|
4908
|
+
}, lt = ({
|
|
4909
4909
|
kycStatus: e,
|
|
4910
4910
|
reviewStatus: t,
|
|
4911
4911
|
workflowResult: n,
|
|
@@ -4955,21 +4955,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4955
4955
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4956
4956
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4957
4957
|
message: "Your application is currently under manual review."
|
|
4958
|
-
} : n ===
|
|
4958
|
+
} : n === qe.Success ? {
|
|
4959
4959
|
type: "success",
|
|
4960
4960
|
title: "Process Complete",
|
|
4961
4961
|
icon: "✓",
|
|
4962
4962
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4963
4963
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4964
4964
|
message: "Your verification process has been completed successfully."
|
|
4965
|
-
} : n ===
|
|
4965
|
+
} : n === qe.Failed ? {
|
|
4966
4966
|
type: "error",
|
|
4967
4967
|
title: "Process Failed",
|
|
4968
4968
|
icon: "✕",
|
|
4969
4969
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4970
4970
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4971
4971
|
message: "The verification process could not be completed."
|
|
4972
|
-
} : n ===
|
|
4972
|
+
} : n === qe.AdminReview ? {
|
|
4973
4973
|
type: "pending",
|
|
4974
4974
|
title: "Admin Review Required",
|
|
4975
4975
|
icon: "📋",
|
|
@@ -5040,7 +5040,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5040
5040
|
] }),
|
|
5041
5041
|
/* @__PURE__ */ s(pe, { className: "flex justify-center gap-4", children: [
|
|
5042
5042
|
d.type === "success" && i && /* @__PURE__ */ r(V, { onClick: i, size: "lg", children: "Continue" }),
|
|
5043
|
-
d.type === "error" && /* @__PURE__ */ s(
|
|
5043
|
+
d.type === "error" && /* @__PURE__ */ s(ct, { children: [
|
|
5044
5044
|
o && /* @__PURE__ */ r(V, { variant: "outline", onClick: o, children: "Contact Support" }),
|
|
5045
5045
|
i && /* @__PURE__ */ r(V, { onClick: i, children: "Try Again" })
|
|
5046
5046
|
] }),
|
|
@@ -5083,7 +5083,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5083
5083
|
] }),
|
|
5084
5084
|
t && /* @__PURE__ */ r("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
5085
5085
|
] });
|
|
5086
|
-
},
|
|
5086
|
+
}, je = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
5087
5087
|
function Be(e) {
|
|
5088
5088
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
5089
5089
|
}
|
|
@@ -5101,71 +5101,138 @@ const _e = {
|
|
|
5101
5101
|
verticalAlign: "middle"
|
|
5102
5102
|
}, Qr = ({ helpText: e, children: t }) => {
|
|
5103
5103
|
const [n, a] = ge.useState(!1);
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5104
|
+
if (!e) return /* @__PURE__ */ r(ct, { children: t });
|
|
5105
|
+
const i = n ? /* @__PURE__ */ r(
|
|
5106
|
+
"div",
|
|
5107
|
+
{
|
|
5108
|
+
role: "dialog",
|
|
5109
|
+
"aria-modal": "true",
|
|
5110
|
+
onClick: () => a(!1),
|
|
5111
|
+
style: {
|
|
5112
|
+
position: "fixed",
|
|
5113
|
+
inset: 0,
|
|
5114
|
+
zIndex: 999999,
|
|
5115
|
+
background: "rgba(0, 0, 0, 0.45)",
|
|
5116
|
+
display: "flex",
|
|
5117
|
+
alignItems: "center",
|
|
5118
|
+
justifyContent: "center",
|
|
5119
|
+
padding: "16px"
|
|
5120
|
+
},
|
|
5121
|
+
children: /* @__PURE__ */ s(
|
|
5122
|
+
"div",
|
|
5109
5123
|
{
|
|
5110
|
-
|
|
5111
|
-
onClick: () => a((i) => !i),
|
|
5112
|
-
"aria-label": "Help",
|
|
5124
|
+
onClick: (o) => o.stopPropagation(),
|
|
5113
5125
|
style: {
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
fontWeight: "bold",
|
|
5124
|
-
cursor: "pointer",
|
|
5125
|
-
display: "flex",
|
|
5126
|
-
alignItems: "center",
|
|
5127
|
-
justifyContent: "center",
|
|
5128
|
-
lineHeight: 1,
|
|
5129
|
-
transition: "all 0.15s"
|
|
5126
|
+
background: "var(--metakyc-card-bg, #ffffff)",
|
|
5127
|
+
borderRadius: "12px",
|
|
5128
|
+
padding: "28px 24px 24px",
|
|
5129
|
+
maxWidth: "480px",
|
|
5130
|
+
width: "100%",
|
|
5131
|
+
maxHeight: "80vh",
|
|
5132
|
+
overflowY: "auto",
|
|
5133
|
+
boxShadow: "0 24px 64px rgba(0,0,0,0.25)",
|
|
5134
|
+
position: "relative"
|
|
5130
5135
|
},
|
|
5131
|
-
children:
|
|
5136
|
+
children: [
|
|
5137
|
+
/* @__PURE__ */ r(
|
|
5138
|
+
"button",
|
|
5139
|
+
{
|
|
5140
|
+
type: "button",
|
|
5141
|
+
onClick: () => a(!1),
|
|
5142
|
+
"aria-label": "Close",
|
|
5143
|
+
style: {
|
|
5144
|
+
position: "absolute",
|
|
5145
|
+
top: "12px",
|
|
5146
|
+
right: "12px",
|
|
5147
|
+
width: "28px",
|
|
5148
|
+
height: "28px",
|
|
5149
|
+
borderRadius: "50%",
|
|
5150
|
+
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5151
|
+
background: "var(--metakyc-input-bg, #f3f4f6)",
|
|
5152
|
+
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
5153
|
+
fontSize: "16px",
|
|
5154
|
+
cursor: "pointer",
|
|
5155
|
+
display: "flex",
|
|
5156
|
+
alignItems: "center",
|
|
5157
|
+
justifyContent: "center",
|
|
5158
|
+
lineHeight: 1
|
|
5159
|
+
},
|
|
5160
|
+
children: "×"
|
|
5161
|
+
}
|
|
5162
|
+
),
|
|
5163
|
+
/* @__PURE__ */ r(
|
|
5164
|
+
"div",
|
|
5165
|
+
{
|
|
5166
|
+
style: {
|
|
5167
|
+
color: "var(--metakyc-text-primary, #111827)",
|
|
5168
|
+
fontSize: "14px",
|
|
5169
|
+
lineHeight: 1.75
|
|
5170
|
+
},
|
|
5171
|
+
dangerouslySetInnerHTML: { __html: e }
|
|
5172
|
+
}
|
|
5173
|
+
)
|
|
5174
|
+
]
|
|
5132
5175
|
}
|
|
5133
5176
|
)
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5177
|
+
}
|
|
5178
|
+
) : null;
|
|
5179
|
+
return /* @__PURE__ */ s("div", { style: { position: "relative", paddingRight: "26px" }, children: [
|
|
5180
|
+
t,
|
|
5181
|
+
/* @__PURE__ */ r(
|
|
5182
|
+
"button",
|
|
5137
5183
|
{
|
|
5184
|
+
type: "button",
|
|
5185
|
+
onClick: () => a(!0),
|
|
5186
|
+
"aria-label": "Help",
|
|
5138
5187
|
style: {
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5188
|
+
position: "absolute",
|
|
5189
|
+
right: 0,
|
|
5190
|
+
top: "50%",
|
|
5191
|
+
transform: "translateY(-50%)",
|
|
5192
|
+
width: "18px",
|
|
5193
|
+
height: "18px",
|
|
5194
|
+
borderRadius: "50%",
|
|
5195
|
+
border: "1.5px solid var(--metakyc-primary, #2563eb)",
|
|
5196
|
+
background: "transparent",
|
|
5197
|
+
color: "var(--metakyc-primary, #2563eb)",
|
|
5198
|
+
fontSize: "10px",
|
|
5199
|
+
fontWeight: "700",
|
|
5200
|
+
cursor: "pointer",
|
|
5201
|
+
display: "flex",
|
|
5202
|
+
alignItems: "center",
|
|
5203
|
+
justifyContent: "center",
|
|
5204
|
+
lineHeight: 1,
|
|
5205
|
+
padding: 0,
|
|
5206
|
+
transition: "background 0.15s, color 0.15s"
|
|
5207
|
+
},
|
|
5208
|
+
onMouseEnter: (o) => {
|
|
5209
|
+
o.currentTarget.style.background = "var(--metakyc-primary, #2563eb)", o.currentTarget.style.color = "#fff";
|
|
5147
5210
|
},
|
|
5148
|
-
|
|
5211
|
+
onMouseLeave: (o) => {
|
|
5212
|
+
o.currentTarget.style.background = "transparent", o.currentTarget.style.color = "var(--metakyc-primary, #2563eb)";
|
|
5213
|
+
},
|
|
5214
|
+
children: "?"
|
|
5149
5215
|
}
|
|
5150
|
-
)
|
|
5151
|
-
|
|
5216
|
+
),
|
|
5217
|
+
typeof document < "u" && i ? Ve(i, document.body) : null
|
|
5218
|
+
] });
|
|
5152
5219
|
}, hn = ({
|
|
5153
5220
|
workflowKey: e,
|
|
5154
5221
|
externalRefId: t,
|
|
5155
5222
|
onSuccess: n,
|
|
5156
5223
|
onCancel: a
|
|
5157
5224
|
}) => {
|
|
5158
|
-
var
|
|
5159
|
-
const { config: i, baseInformationService: o, currentTheme: l } = ye(), { createApplicant: d, isLoading: u } = wr(), p = e || ((
|
|
5225
|
+
var Je, Xe, et, tt;
|
|
5226
|
+
const { config: i, baseInformationService: o, currentTheme: l } = ye(), { createApplicant: d, isLoading: u } = wr(), p = e || ((Je = i.applicantForm) == null ? void 0 : Je.workflowKey);
|
|
5160
5227
|
if (!p)
|
|
5161
5228
|
throw new Error(
|
|
5162
5229
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
5163
5230
|
);
|
|
5164
|
-
const x = t || ((
|
|
5231
|
+
const x = t || ((Xe = i.applicantForm) == null ? void 0 : Xe.externalRefId) || "", N = ((et = i.applicantForm) == null ? void 0 : et.email) || "", m = Ee(
|
|
5165
5232
|
() => l != null && l.applicantFormPages && l.applicantFormPages.length > 0 ? l.applicantFormPages : null,
|
|
5166
5233
|
[l == null ? void 0 : l.applicantFormPages]
|
|
5167
5234
|
), y = Ee(() => {
|
|
5168
|
-
const c = new Set(
|
|
5235
|
+
const c = new Set(je), T = l == null ? void 0 : l.applicantFormRequiredFields;
|
|
5169
5236
|
if (T) for (const L of T) c.add(L);
|
|
5170
5237
|
if (m)
|
|
5171
5238
|
for (const L of m)
|
|
@@ -5175,16 +5242,16 @@ const _e = {
|
|
|
5175
5242
|
}, [l == null ? void 0 : l.applicantFormRequiredFields, m]), h = Ee(() => {
|
|
5176
5243
|
var L;
|
|
5177
5244
|
if (m) {
|
|
5178
|
-
const f = m.flatMap((
|
|
5179
|
-
for (const
|
|
5245
|
+
const f = m.flatMap((q) => q.fields).filter((q) => !q.isCustom && q.name).map((q) => q.name), v = new Set(f);
|
|
5246
|
+
for (const q of je) v.add(q);
|
|
5180
5247
|
return Array.from(v);
|
|
5181
5248
|
}
|
|
5182
5249
|
let c;
|
|
5183
5250
|
(L = i.applicantForm) != null && L.visibleFields ? c = i.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? c = l.applicantFormVisibleFields : c = Ot;
|
|
5184
5251
|
const T = new Set(c);
|
|
5185
|
-
for (const f of
|
|
5252
|
+
for (const f of je) T.add(f);
|
|
5186
5253
|
return Array.from(T);
|
|
5187
|
-
}, [(
|
|
5254
|
+
}, [(tt = i.applicantForm) == null ? void 0 : tt.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields, m]), C = /* @__PURE__ */ new Set([
|
|
5188
5255
|
"country",
|
|
5189
5256
|
"nationality",
|
|
5190
5257
|
"taxCountry",
|
|
@@ -5202,9 +5269,9 @@ const _e = {
|
|
|
5202
5269
|
for (const f of h)
|
|
5203
5270
|
C.has(f) && c.add((L = Te[f]) == null ? void 0 : L.countriesType);
|
|
5204
5271
|
return c.size === 0 && c.add(void 0), Array.from(c);
|
|
5205
|
-
}, [h, m]), [k, $] = b({}), [A, I] = b(!0),
|
|
5272
|
+
}, [h, m]), [k, $] = b({}), [A, I] = b(!0), j = ee(!1), J = ee(/* @__PURE__ */ new Set());
|
|
5206
5273
|
ne(() => {
|
|
5207
|
-
if (
|
|
5274
|
+
if (j.current || F.length === 0) return;
|
|
5208
5275
|
const c = F.filter((L) => {
|
|
5209
5276
|
const f = L != null ? String(L) : "all";
|
|
5210
5277
|
return !J.current.has(f);
|
|
@@ -5213,11 +5280,11 @@ const _e = {
|
|
|
5213
5280
|
I(!1);
|
|
5214
5281
|
return;
|
|
5215
5282
|
}
|
|
5216
|
-
|
|
5283
|
+
j.current = !0, I(!0), (async () => {
|
|
5217
5284
|
try {
|
|
5218
5285
|
const L = await Promise.all(
|
|
5219
5286
|
c.map(async (f) => {
|
|
5220
|
-
const v = f != null ? String(f) : "all",
|
|
5287
|
+
const v = f != null ? String(f) : "all", q = await o.getCountries("", i.locale || "en", f), ae = /* @__PURE__ */ new Set(), ie = q.map((se) => ({ value: se.abbreviation3 || se.abbreviation, label: se.name })).filter((se) => !se.value || ae.has(se.value) ? !1 : (ae.add(se.value), !0));
|
|
5221
5288
|
return J.current.add(v), [v, ie];
|
|
5222
5289
|
})
|
|
5223
5290
|
);
|
|
@@ -5225,7 +5292,7 @@ const _e = {
|
|
|
5225
5292
|
} catch (L) {
|
|
5226
5293
|
console.error("Failed to load countries:", L);
|
|
5227
5294
|
} finally {
|
|
5228
|
-
I(!1),
|
|
5295
|
+
I(!1), j.current = !1;
|
|
5229
5296
|
}
|
|
5230
5297
|
})();
|
|
5231
5298
|
}, [F]);
|
|
@@ -5265,14 +5332,14 @@ const _e = {
|
|
|
5265
5332
|
if (f.isCustom) {
|
|
5266
5333
|
if (f.customType === "paragraph" || f.customType === "br" || f.customType === "link") continue;
|
|
5267
5334
|
if (f.required && f.paramName) {
|
|
5268
|
-
const v = P[f.paramName],
|
|
5269
|
-
f.customType === "checkbox" || f.customType === "link_checkbox" ? v !== "true" && (T[f.paramName] = `${
|
|
5335
|
+
const v = P[f.paramName], q = f.displayText || f.label || f.paramName;
|
|
5336
|
+
f.customType === "checkbox" || f.customType === "link_checkbox" ? v !== "true" && (T[f.paramName] = `${q} is required.`) : (!v || v.trim() === "") && (T[f.paramName] = `${q} is required.`);
|
|
5270
5337
|
}
|
|
5271
5338
|
} else if (f.name) {
|
|
5272
5339
|
const v = f.name;
|
|
5273
5340
|
if (y.includes(v) && Be(g[v])) {
|
|
5274
|
-
const
|
|
5275
|
-
T[v] = `${
|
|
5341
|
+
const q = f.displayText || ((L = Te[v]) == null ? void 0 : L.label) || v;
|
|
5342
|
+
T[v] = `${q} is required.`;
|
|
5276
5343
|
}
|
|
5277
5344
|
}
|
|
5278
5345
|
return T;
|
|
@@ -5314,11 +5381,11 @@ const _e = {
|
|
|
5314
5381
|
if (H(f)) {
|
|
5315
5382
|
for (const v of f.fields)
|
|
5316
5383
|
if (!v.isCustom && v.name) {
|
|
5317
|
-
const
|
|
5318
|
-
Be(ae) || (c[
|
|
5384
|
+
const q = v.name, ae = g[q];
|
|
5385
|
+
Be(ae) || (c[q] = ae);
|
|
5319
5386
|
}
|
|
5320
5387
|
}
|
|
5321
|
-
for (const f of
|
|
5388
|
+
for (const f of je)
|
|
5322
5389
|
if (c[f] === void 0) {
|
|
5323
5390
|
const v = g[f];
|
|
5324
5391
|
Be(v) || (c[f] = v);
|
|
@@ -5335,8 +5402,8 @@ const _e = {
|
|
|
5335
5402
|
if (H(f)) {
|
|
5336
5403
|
for (const v of f.fields)
|
|
5337
5404
|
if (v.isCustom && v.paramName && v.customType !== "paragraph" && v.customType !== "br" && v.customType !== "link") {
|
|
5338
|
-
const
|
|
5339
|
-
T.push({ paramName: v.paramName, paramValue:
|
|
5405
|
+
const q = P[v.paramName] ?? "";
|
|
5406
|
+
T.push({ paramName: v.paramName, paramValue: q });
|
|
5340
5407
|
}
|
|
5341
5408
|
}
|
|
5342
5409
|
}
|
|
@@ -5358,11 +5425,11 @@ const _e = {
|
|
|
5358
5425
|
return;
|
|
5359
5426
|
}
|
|
5360
5427
|
await Ce();
|
|
5361
|
-
},
|
|
5362
|
-
var
|
|
5428
|
+
}, Ze = (c, T, L, f) => {
|
|
5429
|
+
var rt;
|
|
5363
5430
|
const v = Te[c];
|
|
5364
5431
|
if (!v) return null;
|
|
5365
|
-
const
|
|
5432
|
+
const q = y.includes(c), ae = M[c], ie = L || v.label, se = T ?? c, ke = { required: q };
|
|
5366
5433
|
switch (v.type) {
|
|
5367
5434
|
case "select":
|
|
5368
5435
|
if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
|
|
@@ -5387,7 +5454,7 @@ const _e = {
|
|
|
5387
5454
|
{
|
|
5388
5455
|
...ke,
|
|
5389
5456
|
label: ie,
|
|
5390
|
-
value: ((
|
|
5457
|
+
value: ((rt = g[c]) == null ? void 0 : rt.toString()) || "",
|
|
5391
5458
|
onChange: (le) => D(c, le ? Number(le) : null),
|
|
5392
5459
|
options: [
|
|
5393
5460
|
{ value: "", label: "Select salutation..." },
|
|
@@ -5400,7 +5467,7 @@ const _e = {
|
|
|
5400
5467
|
se
|
|
5401
5468
|
);
|
|
5402
5469
|
if (c === "defaultLanguage") {
|
|
5403
|
-
const le = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ?
|
|
5470
|
+
const le = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ? at.filter((Re) => l.allowedLanguages.includes(Re.value)) : at;
|
|
5404
5471
|
return /* @__PURE__ */ r(
|
|
5405
5472
|
We,
|
|
5406
5473
|
{
|
|
@@ -5627,8 +5694,8 @@ const _e = {
|
|
|
5627
5694
|
]
|
|
5628
5695
|
}
|
|
5629
5696
|
),
|
|
5630
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((
|
|
5631
|
-
const ae = c.singleSelect ? P[c.paramName] ===
|
|
5697
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((q) => {
|
|
5698
|
+
const ae = c.singleSelect ? P[c.paramName] === q.value : v.includes(q.value);
|
|
5632
5699
|
return /* @__PURE__ */ s(
|
|
5633
5700
|
"label",
|
|
5634
5701
|
{
|
|
@@ -5642,9 +5709,9 @@ const _e = {
|
|
|
5642
5709
|
checked: ae,
|
|
5643
5710
|
onChange: (ie) => {
|
|
5644
5711
|
if (c.singleSelect)
|
|
5645
|
-
S(c.paramName, ie.target.checked ?
|
|
5712
|
+
S(c.paramName, ie.target.checked ? q.value : "");
|
|
5646
5713
|
else {
|
|
5647
|
-
const se = ie.target.checked ? [...v,
|
|
5714
|
+
const se = ie.target.checked ? [...v, q.value] : v.filter((ke) => ke !== q.value);
|
|
5648
5715
|
S(c.paramName, se.join(","));
|
|
5649
5716
|
}
|
|
5650
5717
|
},
|
|
@@ -5657,12 +5724,12 @@ const _e = {
|
|
|
5657
5724
|
{
|
|
5658
5725
|
className: "metakyc-option-text",
|
|
5659
5726
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5660
|
-
children:
|
|
5727
|
+
children: q.label
|
|
5661
5728
|
}
|
|
5662
5729
|
)
|
|
5663
5730
|
]
|
|
5664
5731
|
},
|
|
5665
|
-
|
|
5732
|
+
q.value
|
|
5666
5733
|
);
|
|
5667
5734
|
}) }),
|
|
5668
5735
|
L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: L })
|
|
@@ -5753,8 +5820,8 @@ const _e = {
|
|
|
5753
5820
|
}
|
|
5754
5821
|
),
|
|
5755
5822
|
L && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: c.fields.map((f, v) => {
|
|
5756
|
-
const
|
|
5757
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5823
|
+
const q = f.colSpan === 1 ? "col-span-1" : f.colSpan === 2 ? "col-span-2" : f.colSpan === 3 ? "col-span-3" : "col-span-4", ae = f.isCustom ? `custom-${v}-${f.paramName}` : `builtin-${f.name}-${v}`;
|
|
5824
|
+
return /* @__PURE__ */ r("div", { className: q, children: /* @__PURE__ */ r(Qr, { helpText: f.helpText, children: f.isCustom ? ft(f, v) : Ze(f.name, ae, f.displayText, f.countriesType) }) }, ae);
|
|
5758
5825
|
}) })
|
|
5759
5826
|
] });
|
|
5760
5827
|
};
|
|
@@ -5764,7 +5831,7 @@ const _e = {
|
|
|
5764
5831
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
5765
5832
|
] }) }) });
|
|
5766
5833
|
if (m) {
|
|
5767
|
-
const c = m[_] ?? m[0], T = Y === -1, L = X === -1, f = m.length, v = H(c),
|
|
5834
|
+
const c = m[_] ?? m[0], T = Y === -1, L = X === -1, f = m.length, v = H(c), q = Object.values(M);
|
|
5768
5835
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(K, { children: [
|
|
5769
5836
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
|
|
5770
5837
|
/* @__PURE__ */ s(W, { children: [
|
|
@@ -5794,13 +5861,13 @@ const _e = {
|
|
|
5794
5861
|
}
|
|
5795
5862
|
)
|
|
5796
5863
|
] }),
|
|
5797
|
-
(w ||
|
|
5864
|
+
(w || q.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
5798
5865
|
w && /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
5799
5866
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
5800
5867
|
" ",
|
|
5801
5868
|
w
|
|
5802
5869
|
] }),
|
|
5803
|
-
|
|
5870
|
+
q.map((ae, ie) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ae }, ie))
|
|
5804
5871
|
] }),
|
|
5805
5872
|
f > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
5806
5873
|
m.map((ae, ie) => /* @__PURE__ */ r(
|
|
@@ -5855,7 +5922,7 @@ const _e = {
|
|
|
5855
5922
|
" ",
|
|
5856
5923
|
w
|
|
5857
5924
|
] }) }),
|
|
5858
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: h.map((c) => /* @__PURE__ */ r("div", { className: "col-span-4", children:
|
|
5925
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: h.map((c) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(c) }, c)) })
|
|
5859
5926
|
] }),
|
|
5860
5927
|
/* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
|
|
5861
5928
|
a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" }),
|
|
@@ -5929,7 +5996,7 @@ const _e = {
|
|
|
5929
5996
|
] }) }) }) });
|
|
5930
5997
|
if (o.status === xe.Finished || o.status === xe.OnHold)
|
|
5931
5998
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
|
|
5932
|
-
|
|
5999
|
+
lt,
|
|
5933
6000
|
{
|
|
5934
6001
|
kycStatus: o.kycStatus,
|
|
5935
6002
|
reviewStatus: o.reviewStatus,
|
|
@@ -5970,7 +6037,7 @@ const _e = {
|
|
|
5970
6037
|
return "";
|
|
5971
6038
|
}
|
|
5972
6039
|
}, $ = () => {
|
|
5973
|
-
const I = d.filter((g) => g.visibility !== !1),
|
|
6040
|
+
const I = d.filter((g) => g.visibility !== !1), j = I.findIndex((g) => g.order === l.order), J = j >= 0 ? j + 1 : 1, E = I.length;
|
|
5974
6041
|
return /* @__PURE__ */ s("div", { className: "mb-6", children: [
|
|
5975
6042
|
/* @__PURE__ */ s("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5976
6043
|
/* @__PURE__ */ r(Ge, {}),
|
|
@@ -5982,7 +6049,7 @@ const _e = {
|
|
|
5982
6049
|
] })
|
|
5983
6050
|
] }),
|
|
5984
6051
|
/* @__PURE__ */ r("div", { className: "flex items-center", children: I.map((g, R) => {
|
|
5985
|
-
const P = R <
|
|
6052
|
+
const P = R < j, z = g.order === l.order;
|
|
5986
6053
|
return /* @__PURE__ */ s(ge.Fragment, { children: [
|
|
5987
6054
|
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
5988
6055
|
/* @__PURE__ */ r(
|
|
@@ -6033,12 +6100,12 @@ const _e = {
|
|
|
6033
6100
|
return /* @__PURE__ */ r(Ur, { ...I });
|
|
6034
6101
|
case G.AdditionalData:
|
|
6035
6102
|
case G.InvestorCategorization:
|
|
6036
|
-
return /* @__PURE__ */ r(
|
|
6103
|
+
return /* @__PURE__ */ r(qr, { ...I });
|
|
6037
6104
|
case G.AppropriatenessTest:
|
|
6038
6105
|
return /* @__PURE__ */ r(Kr, { ...I });
|
|
6039
6106
|
case G.ManualReview:
|
|
6040
6107
|
return /* @__PURE__ */ r(
|
|
6041
|
-
|
|
6108
|
+
lt,
|
|
6042
6109
|
{
|
|
6043
6110
|
kycStatus: o.kycStatus,
|
|
6044
6111
|
reviewStatus: o.reviewStatus,
|
|
@@ -6114,13 +6181,13 @@ function bn(e) {
|
|
|
6114
6181
|
}
|
|
6115
6182
|
const vn = Se.any();
|
|
6116
6183
|
export {
|
|
6117
|
-
|
|
6184
|
+
at as ALLOWED_LANGUAGES,
|
|
6118
6185
|
Ct as ApplicantProgressOnHoldReason,
|
|
6119
6186
|
xe as ApplicantProgressStatus,
|
|
6120
6187
|
_t as ApplicantService,
|
|
6121
6188
|
Et as ApplicantStatus,
|
|
6122
6189
|
Ft as AppropriatenessQuestionType,
|
|
6123
|
-
|
|
6190
|
+
jt as AppropriatenessTestService,
|
|
6124
6191
|
Kr as AppropriatenessTestStep,
|
|
6125
6192
|
Ae as Badge,
|
|
6126
6193
|
Yt as BaseInformationService,
|
|
@@ -6149,12 +6216,12 @@ export {
|
|
|
6149
6216
|
Wr as IdentityVerificationStep,
|
|
6150
6217
|
me as Input,
|
|
6151
6218
|
Qt as InvestorCategorizationService,
|
|
6152
|
-
|
|
6219
|
+
qr as InvestorCategorizationStep,
|
|
6153
6220
|
he as InvestorCategorizationType,
|
|
6154
6221
|
Mt as InvestorCategoryType,
|
|
6155
6222
|
It as KycProcessStatus,
|
|
6156
6223
|
De as KycStatus,
|
|
6157
|
-
|
|
6224
|
+
lt as KycStatusDisplay,
|
|
6158
6225
|
gn as KycWorkflow,
|
|
6159
6226
|
Yr as Logo,
|
|
6160
6227
|
ut as MetaKYCContext,
|
|
@@ -6162,7 +6229,7 @@ export {
|
|
|
6162
6229
|
on as MetaKYCProvider,
|
|
6163
6230
|
Nr as MultiSelect,
|
|
6164
6231
|
or as OnfidoProvider,
|
|
6165
|
-
|
|
6232
|
+
qt as OverviewService,
|
|
6166
6233
|
$r as OverviewStep,
|
|
6167
6234
|
Cr as PhoneInput,
|
|
6168
6235
|
Ht as QuestionnaireService,
|
|
@@ -6186,7 +6253,7 @@ export {
|
|
|
6186
6253
|
Rt as UserType,
|
|
6187
6254
|
Ie as ValueDataType,
|
|
6188
6255
|
ir as WorkflowOrchestrator,
|
|
6189
|
-
|
|
6256
|
+
qe as WorkflowResultType,
|
|
6190
6257
|
nr as WorkflowState,
|
|
6191
6258
|
G as WorkflowStepAction,
|
|
6192
6259
|
vn as appropriatenessTestSchema,
|