@vpdev2/metakyc-sdk 1.0.40 → 1.0.41
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 +17 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +463 -455
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import pe, { createContext as
|
|
7
|
-
import { jsx as a, jsxs as i, Fragment as
|
|
8
|
-
import { useForm as
|
|
1
|
+
var Xe = Object.defineProperty;
|
|
2
|
+
var et = (e, t, r) => t in e ? Xe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var G = (e, t, r) => et(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import tt from "axios";
|
|
5
|
+
import * as Ke from "react";
|
|
6
|
+
import pe, { createContext as rt, useState as b, useMemo as Ce, useEffect as ee, useContext as at, useRef as X, useCallback as W, forwardRef as Pe, createElement as _e } from "react";
|
|
7
|
+
import { jsx as a, jsxs as i, Fragment as nt } from "react/jsx-runtime";
|
|
8
|
+
import { useForm as st, Controller as ke } from "react-hook-form";
|
|
9
9
|
import { z as be } from "zod";
|
|
10
|
-
var _ = /* @__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))(_ || {}),
|
|
11
|
-
const
|
|
10
|
+
var _ = /* @__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))(_ || {}), Me = /* @__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))(Me || {}), ge = /* @__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))(ge || {}), it = /* @__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))(it || {}), lt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(lt || {}), Ne = /* @__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))(Ne || {}), Se = /* @__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))(Se || {}), ot = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(ot || {}), ct = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(ct || {}), he = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(he || {}), dt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(dt || {}), Te = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Te || {}), ut = /* @__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))(ut || {}), mt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(mt || {}), pt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(pt || {}), ve = /* @__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))(ve || {}), ht = /* @__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))(ht || {}), gt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(gt || {}), ue = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(ue || {}), yt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(yt || {});
|
|
11
|
+
const $e = {
|
|
12
12
|
firstName: { label: "First Name", type: "text" },
|
|
13
13
|
lastName: { label: "Last Name", type: "text" },
|
|
14
14
|
email: { label: "Email", type: "email" },
|
|
@@ -31,13 +31,13 @@ const Oe = {
|
|
|
31
31
|
defaultLanguage: { label: "Default Language", type: "select" },
|
|
32
32
|
educationLevel: { label: "Education Level", type: "text" },
|
|
33
33
|
occupation: { label: "Occupation", type: "text" }
|
|
34
|
-
},
|
|
34
|
+
}, ft = [
|
|
35
35
|
"firstName",
|
|
36
36
|
"lastName",
|
|
37
37
|
"email",
|
|
38
38
|
"phonenumber",
|
|
39
39
|
"dateOfBirth"
|
|
40
|
-
],
|
|
40
|
+
], je = [
|
|
41
41
|
{ value: "EN", label: "English" },
|
|
42
42
|
{ value: "DE", label: "German" },
|
|
43
43
|
{ value: "FR", label: "French" },
|
|
@@ -57,7 +57,7 @@ const Oe = {
|
|
|
57
57
|
{ value: "NO", label: "Norwegian" }
|
|
58
58
|
];
|
|
59
59
|
var ae = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(ae || {});
|
|
60
|
-
const
|
|
60
|
+
const bt = {
|
|
61
61
|
timeout: 3e4,
|
|
62
62
|
retries: 3,
|
|
63
63
|
locale: "en",
|
|
@@ -65,7 +65,7 @@ const ft = {
|
|
|
65
65
|
pattern: "host-controller"
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
class
|
|
68
|
+
class xt {
|
|
69
69
|
constructor(t) {
|
|
70
70
|
this.config = t;
|
|
71
71
|
}
|
|
@@ -108,7 +108,7 @@ class bt {
|
|
|
108
108
|
class fe extends Error {
|
|
109
109
|
constructor(r, n, s, l, o) {
|
|
110
110
|
super(r);
|
|
111
|
-
|
|
111
|
+
G(this, "response");
|
|
112
112
|
this.code = n, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = o, Object.setPrototypeOf(this, fe.prototype);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -162,12 +162,12 @@ class Fe {
|
|
|
162
162
|
return t instanceof fe;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
class
|
|
165
|
+
class vt {
|
|
166
166
|
constructor(t) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
this.config = { ...
|
|
167
|
+
G(this, "axiosInstance");
|
|
168
|
+
G(this, "endpointBuilder");
|
|
169
|
+
G(this, "config");
|
|
170
|
+
this.config = { ...bt, ...t }, this.endpointBuilder = new xt(this.config.endpoints), this.axiosInstance = tt.create({
|
|
171
171
|
baseURL: this.config.baseUrl,
|
|
172
172
|
timeout: this.config.timeout,
|
|
173
173
|
headers: {
|
|
@@ -257,7 +257,7 @@ class xt {
|
|
|
257
257
|
return this.axiosInstance;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
class
|
|
260
|
+
class wt {
|
|
261
261
|
constructor(t) {
|
|
262
262
|
this.httpClient = t;
|
|
263
263
|
}
|
|
@@ -376,7 +376,7 @@ class vt {
|
|
|
376
376
|
)).result;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
class
|
|
379
|
+
class kt {
|
|
380
380
|
constructor(t) {
|
|
381
381
|
this.httpClient = t;
|
|
382
382
|
}
|
|
@@ -403,7 +403,7 @@ class wt {
|
|
|
403
403
|
)).result;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
class
|
|
406
|
+
class Nt {
|
|
407
407
|
constructor(t) {
|
|
408
408
|
this.httpClient = t;
|
|
409
409
|
}
|
|
@@ -431,7 +431,7 @@ class kt {
|
|
|
431
431
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", t);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
class
|
|
434
|
+
class St {
|
|
435
435
|
constructor(t) {
|
|
436
436
|
this.httpClient = t;
|
|
437
437
|
}
|
|
@@ -457,7 +457,7 @@ class Nt {
|
|
|
457
457
|
)).result;
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
class
|
|
460
|
+
class Ct {
|
|
461
461
|
constructor(t) {
|
|
462
462
|
this.httpClient = t;
|
|
463
463
|
}
|
|
@@ -479,7 +479,7 @@ class St {
|
|
|
479
479
|
await this.httpClient.get("Applicant", "PassOverview", { applicantId: t });
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
class
|
|
482
|
+
class At {
|
|
483
483
|
constructor(t) {
|
|
484
484
|
this.httpClient = t;
|
|
485
485
|
}
|
|
@@ -514,7 +514,7 @@ class Ct {
|
|
|
514
514
|
)).result;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
class
|
|
517
|
+
class Et {
|
|
518
518
|
constructor(t) {
|
|
519
519
|
this.httpClient = t;
|
|
520
520
|
}
|
|
@@ -569,7 +569,7 @@ class At {
|
|
|
569
569
|
return this.identityCompanyRequest(r);
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
class
|
|
572
|
+
class It {
|
|
573
573
|
constructor(t) {
|
|
574
574
|
this.httpClient = t;
|
|
575
575
|
}
|
|
@@ -605,7 +605,7 @@ class Et {
|
|
|
605
605
|
)).result;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
class
|
|
608
|
+
class Rt {
|
|
609
609
|
constructor(t) {
|
|
610
610
|
this.httpClient = t;
|
|
611
611
|
}
|
|
@@ -690,7 +690,7 @@ const le = {
|
|
|
690
690
|
textMuted: "#9ca3af"
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
},
|
|
693
|
+
}, Ft = {
|
|
694
694
|
name: "Corporate",
|
|
695
695
|
logo: {
|
|
696
696
|
url: "",
|
|
@@ -723,7 +723,7 @@ const le = {
|
|
|
723
723
|
cardPadding: "1.5rem",
|
|
724
724
|
inputHeight: "2.5rem"
|
|
725
725
|
}
|
|
726
|
-
},
|
|
726
|
+
}, Dt = {
|
|
727
727
|
name: "Fintech",
|
|
728
728
|
logo: {
|
|
729
729
|
url: "",
|
|
@@ -756,7 +756,7 @@ const le = {
|
|
|
756
756
|
cardPadding: "2rem",
|
|
757
757
|
inputHeight: "3rem"
|
|
758
758
|
}
|
|
759
|
-
},
|
|
759
|
+
}, Pt = {
|
|
760
760
|
name: "Healthcare",
|
|
761
761
|
logo: {
|
|
762
762
|
url: "",
|
|
@@ -798,7 +798,7 @@ const le = {
|
|
|
798
798
|
textSecondary: "#CBD5E1"
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
|
-
},
|
|
801
|
+
}, Lt = {
|
|
802
802
|
name: "Modern",
|
|
803
803
|
logo: {
|
|
804
804
|
url: "",
|
|
@@ -831,7 +831,7 @@ const le = {
|
|
|
831
831
|
cardPadding: "2rem",
|
|
832
832
|
inputHeight: "3rem"
|
|
833
833
|
}
|
|
834
|
-
},
|
|
834
|
+
}, Mt = {
|
|
835
835
|
name: "Minimal",
|
|
836
836
|
logo: {
|
|
837
837
|
url: "",
|
|
@@ -864,18 +864,18 @@ const le = {
|
|
|
864
864
|
cardPadding: "1.25rem",
|
|
865
865
|
inputHeight: "2.25rem"
|
|
866
866
|
}
|
|
867
|
-
},
|
|
867
|
+
}, Tt = {
|
|
868
868
|
[ae.Default]: le,
|
|
869
|
-
[ae.Corporate]:
|
|
870
|
-
[ae.Fintech]:
|
|
871
|
-
[ae.Healthcare]:
|
|
872
|
-
[ae.Modern]:
|
|
873
|
-
[ae.Minimal]:
|
|
869
|
+
[ae.Corporate]: Ft,
|
|
870
|
+
[ae.Fintech]: Dt,
|
|
871
|
+
[ae.Healthcare]: Pt,
|
|
872
|
+
[ae.Modern]: Lt,
|
|
873
|
+
[ae.Minimal]: Mt
|
|
874
874
|
};
|
|
875
875
|
function De(e) {
|
|
876
|
-
return
|
|
876
|
+
return Tt[e] || le;
|
|
877
877
|
}
|
|
878
|
-
class
|
|
878
|
+
class Ot {
|
|
879
879
|
constructor(t) {
|
|
880
880
|
this.httpClient = t;
|
|
881
881
|
}
|
|
@@ -942,9 +942,9 @@ class Tt {
|
|
|
942
942
|
} : n;
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
class
|
|
945
|
+
class $t {
|
|
946
946
|
constructor() {
|
|
947
|
-
|
|
947
|
+
G(this, "listeners", /* @__PURE__ */ new Map());
|
|
948
948
|
}
|
|
949
949
|
/**
|
|
950
950
|
* Subscribe to an event
|
|
@@ -987,12 +987,12 @@ class Ot {
|
|
|
987
987
|
this.listeners.delete(t);
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
|
-
class
|
|
990
|
+
class Bt {
|
|
991
991
|
constructor() {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
992
|
+
G(this, "events", new $t());
|
|
993
|
+
G(this, "_applicantId", null);
|
|
994
|
+
G(this, "_progress", null);
|
|
995
|
+
G(this, "_error", null);
|
|
996
996
|
}
|
|
997
997
|
/**
|
|
998
998
|
* Get current applicant ID
|
|
@@ -1127,9 +1127,9 @@ class $t {
|
|
|
1127
1127
|
this.events.clear();
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
class
|
|
1130
|
+
class zt {
|
|
1131
1131
|
constructor() {
|
|
1132
|
-
|
|
1132
|
+
G(this, "handlers", /* @__PURE__ */ new Map());
|
|
1133
1133
|
}
|
|
1134
1134
|
/**
|
|
1135
1135
|
* Register a step handler
|
|
@@ -1168,11 +1168,11 @@ class Bt {
|
|
|
1168
1168
|
return n.submitData(r);
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
class
|
|
1171
|
+
class Ut {
|
|
1172
1172
|
constructor(t, r, n, s, l, o, c, d) {
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
this.applicantService = t, this.questionnaireService = r, this.uploadDocumentService = n, this.appropriatenessTestService = s, this.overviewService = l, this.riskScoringService = o, this.investorCategorizationService = d, this.state = new
|
|
1173
|
+
G(this, "state");
|
|
1174
|
+
G(this, "stepRouter");
|
|
1175
|
+
this.applicantService = t, this.questionnaireService = r, this.uploadDocumentService = n, this.appropriatenessTestService = s, this.overviewService = l, this.riskScoringService = o, this.investorCategorizationService = d, this.state = new Bt(), this.stepRouter = new zt(), this.registerStepHandlers();
|
|
1176
1176
|
}
|
|
1177
1177
|
/**
|
|
1178
1178
|
* Register all step handlers
|
|
@@ -1312,7 +1312,7 @@ class zt {
|
|
|
1312
1312
|
return this.stepRouter;
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function We(e, t) {
|
|
1316
1316
|
return new Promise((r, n) => {
|
|
1317
1317
|
if (t && document.getElementById(t)) {
|
|
1318
1318
|
r();
|
|
@@ -1322,24 +1322,24 @@ function Ye(e, t) {
|
|
|
1322
1322
|
s.src = e, t && (s.id = t), s.async = !0, s.onload = () => r(), s.onerror = () => n(new Error(`Failed to load script: ${e}`)), document.head.appendChild(s);
|
|
1323
1323
|
});
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function $r(e) {
|
|
1326
1326
|
return !!document.getElementById(e);
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function Br(e) {
|
|
1329
1329
|
const t = document.getElementById(e);
|
|
1330
1330
|
t && t.remove();
|
|
1331
1331
|
}
|
|
1332
|
-
class
|
|
1332
|
+
class _t {
|
|
1333
1333
|
constructor(t) {
|
|
1334
|
-
|
|
1335
|
-
|
|
1334
|
+
G(this, "sdk", null);
|
|
1335
|
+
G(this, "config");
|
|
1336
1336
|
this.config = t;
|
|
1337
1337
|
}
|
|
1338
1338
|
/**
|
|
1339
1339
|
* Load Sumsub SDK
|
|
1340
1340
|
*/
|
|
1341
1341
|
async loadSDK() {
|
|
1342
|
-
await
|
|
1342
|
+
await We(
|
|
1343
1343
|
"https://cdn.sumsub.com/websdk/v2/production/websdk.js",
|
|
1344
1344
|
"sumsub-sdk"
|
|
1345
1345
|
);
|
|
@@ -1384,17 +1384,17 @@ class Ut {
|
|
|
1384
1384
|
this.sdk && this.sdk.on("idCheck.onError", t);
|
|
1385
1385
|
}
|
|
1386
1386
|
}
|
|
1387
|
-
class
|
|
1387
|
+
class qt {
|
|
1388
1388
|
constructor(t) {
|
|
1389
|
-
|
|
1390
|
-
|
|
1389
|
+
G(this, "sdk", null);
|
|
1390
|
+
G(this, "config");
|
|
1391
1391
|
this.config = t;
|
|
1392
1392
|
}
|
|
1393
1393
|
/**
|
|
1394
1394
|
* Load Onfido SDK
|
|
1395
1395
|
*/
|
|
1396
1396
|
async loadSDK() {
|
|
1397
|
-
await
|
|
1397
|
+
await We(
|
|
1398
1398
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1399
1399
|
"onfido-sdk"
|
|
1400
1400
|
);
|
|
@@ -1450,11 +1450,11 @@ class _t {
|
|
|
1450
1450
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
|
-
class
|
|
1453
|
+
class Kt {
|
|
1454
1454
|
constructor(t) {
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1455
|
+
G(this, "sardineContext", null);
|
|
1456
|
+
G(this, "config");
|
|
1457
|
+
G(this, "sessionKey");
|
|
1458
1458
|
this.config = t, this.sessionKey = t.sessionKey || this.generateSessionKey();
|
|
1459
1459
|
}
|
|
1460
1460
|
/**
|
|
@@ -1601,11 +1601,11 @@ class Ee {
|
|
|
1601
1601
|
static createProvider(t, r) {
|
|
1602
1602
|
switch (t) {
|
|
1603
1603
|
case he.Sumsub:
|
|
1604
|
-
return new Ut(r);
|
|
1605
|
-
case he.Onfido:
|
|
1606
1604
|
return new _t(r);
|
|
1607
|
-
case he.
|
|
1605
|
+
case he.Onfido:
|
|
1608
1606
|
return new qt(r);
|
|
1607
|
+
case he.SardinAI:
|
|
1608
|
+
return new Kt(r);
|
|
1609
1609
|
default:
|
|
1610
1610
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
1611
1611
|
}
|
|
@@ -1644,11 +1644,11 @@ class Ee {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
|
-
class
|
|
1647
|
+
class jt {
|
|
1648
1648
|
constructor(t) {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1649
|
+
G(this, "currentTheme", le);
|
|
1650
|
+
G(this, "customStyleElement", null);
|
|
1651
|
+
G(this, "container");
|
|
1652
1652
|
this.container = t || document.documentElement;
|
|
1653
1653
|
}
|
|
1654
1654
|
/**
|
|
@@ -1770,9 +1770,9 @@ class Kt {
|
|
|
1770
1770
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
|
-
const
|
|
1773
|
+
const Qe = rt(null), zr = ({ config: e, children: t }) => {
|
|
1774
1774
|
const [r, n] = b(null), s = pe.useRef(!1), l = pe.useRef(!1), o = Ce(() => {
|
|
1775
|
-
const d = new
|
|
1775
|
+
const d = new vt(e), u = new wt(d), w = new kt(d), N = new Nt(d), y = new St(d), h = new Ct(d), g = new At(d), k = new Et(d), x = new It(d), m = new Rt(d), R = new Ot(d), S = new jt();
|
|
1776
1776
|
return {
|
|
1777
1777
|
httpClient: d,
|
|
1778
1778
|
applicantService: u,
|
|
@@ -1791,7 +1791,7 @@ const We = tt(null), Br = ({ config: e, children: t }) => {
|
|
|
1791
1791
|
config: e,
|
|
1792
1792
|
...o,
|
|
1793
1793
|
currentTheme: r,
|
|
1794
|
-
createOrchestrator: () => new
|
|
1794
|
+
createOrchestrator: () => new Ut(
|
|
1795
1795
|
o.applicantService,
|
|
1796
1796
|
o.questionnaireService,
|
|
1797
1797
|
o.uploadDocumentService,
|
|
@@ -1823,15 +1823,15 @@ const We = tt(null), Br = ({ config: e, children: t }) => {
|
|
|
1823
1823
|
}
|
|
1824
1824
|
})(), () => {
|
|
1825
1825
|
o.themeManager.cleanup();
|
|
1826
|
-
}), []), /* @__PURE__ */ a(
|
|
1826
|
+
}), []), /* @__PURE__ */ a(Qe.Provider, { value: c, children: t });
|
|
1827
1827
|
};
|
|
1828
1828
|
function me() {
|
|
1829
|
-
const e =
|
|
1829
|
+
const e = at(Qe);
|
|
1830
1830
|
if (!e)
|
|
1831
1831
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
1832
1832
|
return e;
|
|
1833
1833
|
}
|
|
1834
|
-
async function
|
|
1834
|
+
async function Ht(e) {
|
|
1835
1835
|
return new Promise((t, r) => {
|
|
1836
1836
|
const n = new FileReader();
|
|
1837
1837
|
n.readAsDataURL(e), n.onload = () => {
|
|
@@ -1840,10 +1840,10 @@ async function jt(e) {
|
|
|
1840
1840
|
}, n.onerror = (s) => r(s);
|
|
1841
1841
|
});
|
|
1842
1842
|
}
|
|
1843
|
-
function
|
|
1843
|
+
function Ur(e, t) {
|
|
1844
1844
|
return e.size <= t;
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function _r(e, t) {
|
|
1847
1847
|
return t.split(",").map((n) => n.trim()).some((n) => {
|
|
1848
1848
|
if (n.endsWith("/*")) {
|
|
1849
1849
|
const s = n.slice(0, -2);
|
|
@@ -1852,12 +1852,12 @@ function Ur(e, t) {
|
|
|
1852
1852
|
return e.type === n;
|
|
1853
1853
|
});
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1855
|
+
function Be(e) {
|
|
1856
1856
|
if (e === 0) return "0 Bytes";
|
|
1857
1857
|
const t = 1024, r = ["Bytes", "KB", "MB", "GB"], n = Math.floor(Math.log(e) / Math.log(t));
|
|
1858
1858
|
return Math.round(e / Math.pow(t, n) * 100) / 100 + " " + r[n];
|
|
1859
1859
|
}
|
|
1860
|
-
function
|
|
1860
|
+
function qr(e) {
|
|
1861
1861
|
return e;
|
|
1862
1862
|
}
|
|
1863
1863
|
function ne(...e) {
|
|
@@ -1867,14 +1867,14 @@ const Ie = {
|
|
|
1867
1867
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1868
1868
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1869
1869
|
};
|
|
1870
|
-
function
|
|
1870
|
+
function Yt(e) {
|
|
1871
1871
|
try {
|
|
1872
1872
|
localStorage.setItem(Ie.APPLICANT_ID, e.toString());
|
|
1873
1873
|
} catch (t) {
|
|
1874
1874
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1877
|
+
function Wt() {
|
|
1878
1878
|
try {
|
|
1879
1879
|
const e = localStorage.getItem(Ie.APPLICANT_ID);
|
|
1880
1880
|
return e ? parseInt(e, 10) : null;
|
|
@@ -1882,21 +1882,21 @@ function Yt() {
|
|
|
1882
1882
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
1883
1883
|
}
|
|
1884
1884
|
}
|
|
1885
|
-
function
|
|
1885
|
+
function Qt() {
|
|
1886
1886
|
try {
|
|
1887
1887
|
localStorage.removeItem(Ie.APPLICANT_ID);
|
|
1888
1888
|
} catch (e) {
|
|
1889
1889
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
|
-
function
|
|
1892
|
+
function Vt(e) {
|
|
1893
1893
|
try {
|
|
1894
1894
|
localStorage.setItem(Ie.WORKFLOW_STATE, JSON.stringify(e));
|
|
1895
1895
|
} catch (t) {
|
|
1896
1896
|
console.warn("Failed to save workflow state to storage:", t);
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
1899
|
-
function
|
|
1899
|
+
function Kr() {
|
|
1900
1900
|
try {
|
|
1901
1901
|
const e = localStorage.getItem(Ie.WORKFLOW_STATE);
|
|
1902
1902
|
return e ? JSON.parse(e) : null;
|
|
@@ -1904,23 +1904,23 @@ function qr() {
|
|
|
1904
1904
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
1905
1905
|
}
|
|
1906
1906
|
}
|
|
1907
|
-
function
|
|
1907
|
+
function Gt() {
|
|
1908
1908
|
try {
|
|
1909
1909
|
localStorage.removeItem(Ie.WORKFLOW_STATE);
|
|
1910
1910
|
} catch (e) {
|
|
1911
1911
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
1912
1912
|
}
|
|
1913
1913
|
}
|
|
1914
|
-
function
|
|
1915
|
-
|
|
1914
|
+
function jr() {
|
|
1915
|
+
Qt(), Gt();
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1918
|
-
const { createOrchestrator: t } = me(), [r, n] = b(null), [s, l] = b(!1), [o, c] = b(null), d = X(null), u = e ||
|
|
1917
|
+
function Zt(e) {
|
|
1918
|
+
const { createOrchestrator: t } = me(), [r, n] = b(null), [s, l] = b(!1), [o, c] = b(null), d = X(null), u = e || Wt();
|
|
1919
1919
|
ee(() => {
|
|
1920
1920
|
d.current || (d.current = t());
|
|
1921
1921
|
}, [t]), ee(() => {
|
|
1922
1922
|
var S;
|
|
1923
|
-
r && u && (
|
|
1923
|
+
r && u && (Yt(u), Vt({
|
|
1924
1924
|
applicantId: u,
|
|
1925
1925
|
currentStepOrder: (S = r.currentStep) == null ? void 0 : S.order,
|
|
1926
1926
|
status: r.status,
|
|
@@ -1929,7 +1929,7 @@ function Gt(e) {
|
|
|
1929
1929
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1930
1930
|
}));
|
|
1931
1931
|
}, [r, u]);
|
|
1932
|
-
const w = X(!1), N = X(!1), y =
|
|
1932
|
+
const w = X(!1), N = X(!1), y = W(async () => {
|
|
1933
1933
|
if (!(!u || !d.current)) {
|
|
1934
1934
|
if (w.current) {
|
|
1935
1935
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
@@ -1949,7 +1949,7 @@ function Gt(e) {
|
|
|
1949
1949
|
ee(() => {
|
|
1950
1950
|
u && !N.current && y();
|
|
1951
1951
|
}, [u, y]);
|
|
1952
|
-
const h =
|
|
1952
|
+
const h = W(async () => {
|
|
1953
1953
|
if (d.current) {
|
|
1954
1954
|
if (w.current) {
|
|
1955
1955
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
@@ -1965,7 +1965,7 @@ function Gt(e) {
|
|
|
1965
1965
|
l(!1), w.current = !1;
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
}, []), g =
|
|
1968
|
+
}, []), g = W(async () => {
|
|
1969
1969
|
if (d.current) {
|
|
1970
1970
|
l(!0), c(null);
|
|
1971
1971
|
try {
|
|
@@ -1977,7 +1977,7 @@ function Gt(e) {
|
|
|
1977
1977
|
l(!1);
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
|
-
}, []), k =
|
|
1980
|
+
}, []), k = W(async () => {
|
|
1981
1981
|
if (d.current) {
|
|
1982
1982
|
l(!0), c(null);
|
|
1983
1983
|
try {
|
|
@@ -1989,7 +1989,7 @@ function Gt(e) {
|
|
|
1989
1989
|
l(!1);
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
}, []), x =
|
|
1992
|
+
}, []), x = W(async (S) => {
|
|
1993
1993
|
if (d.current) {
|
|
1994
1994
|
l(!0), c(null);
|
|
1995
1995
|
try {
|
|
@@ -2002,7 +2002,7 @@ function Gt(e) {
|
|
|
2002
2002
|
l(!1);
|
|
2003
2003
|
}
|
|
2004
2004
|
}
|
|
2005
|
-
}, []), m =
|
|
2005
|
+
}, []), m = Ke.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((S, v) => S.order - v.order) : [], [r == null ? void 0 : r.stepInfoList]), R = Ke.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2006
2006
|
return {
|
|
2007
2007
|
progress: r,
|
|
2008
2008
|
applicantId: u,
|
|
@@ -2024,8 +2024,8 @@ function Gt(e) {
|
|
|
2024
2024
|
orchestrator: d.current
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
|
-
function
|
|
2028
|
-
const { questionnaireService: t, applicantService: r } = me(), [n, s] = b(null), [l, o] = b({}), [c, d] = b(!1), [u, w] = b(!1), [N, y] = b(null), h = X(!1), g = X(null), k =
|
|
2027
|
+
function Jt(e) {
|
|
2028
|
+
const { questionnaireService: t, applicantService: r } = me(), [n, s] = b(null), [l, o] = b({}), [c, d] = b(!1), [u, w] = b(!1), [N, y] = b(null), h = X(!1), g = X(null), k = W(async () => {
|
|
2029
2029
|
var m, R;
|
|
2030
2030
|
if (e) {
|
|
2031
2031
|
if (h.current) {
|
|
@@ -2042,12 +2042,12 @@ function Zt(e) {
|
|
|
2042
2042
|
const K = /* @__PURE__ */ new Map();
|
|
2043
2043
|
for (const f of v.questionnaireResults)
|
|
2044
2044
|
f.question && ((R = f.answers) != null && R.length) && K.set(f.question.trim().toLowerCase(), f.answers);
|
|
2045
|
-
const
|
|
2045
|
+
const V = {}, M = S.questionGroups.flatMap((f) => f.questions ?? []);
|
|
2046
2046
|
for (const f of M) {
|
|
2047
2047
|
const A = f.text.trim().toLowerCase();
|
|
2048
|
-
K.has(A) && (
|
|
2048
|
+
K.has(A) && (V[f.id] = K.get(A));
|
|
2049
2049
|
}
|
|
2050
|
-
o(
|
|
2050
|
+
o(V);
|
|
2051
2051
|
}
|
|
2052
2052
|
g.current = e;
|
|
2053
2053
|
} catch (S) {
|
|
@@ -2060,7 +2060,7 @@ function Zt(e) {
|
|
|
2060
2060
|
ee(() => {
|
|
2061
2061
|
e && g.current !== e && k();
|
|
2062
2062
|
}, [e]);
|
|
2063
|
-
const x =
|
|
2063
|
+
const x = W(
|
|
2064
2064
|
async (m) => {
|
|
2065
2065
|
w(!0), y(null);
|
|
2066
2066
|
try {
|
|
@@ -2083,8 +2083,8 @@ function Zt(e) {
|
|
|
2083
2083
|
submit: x
|
|
2084
2084
|
};
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2087
|
-
const { uploadDocumentService: t } = me(), [r, n] = b(null), [s, l] = b(!1), [o, c] = b(!1), [d, u] = b(0), [w, N] = b(null), y = X(!1), h = X(null), g =
|
|
2086
|
+
function Xt(e) {
|
|
2087
|
+
const { uploadDocumentService: t } = me(), [r, n] = b(null), [s, l] = b(!1), [o, c] = b(!1), [d, u] = b(0), [w, N] = b(null), y = X(!1), h = X(null), g = W(async () => {
|
|
2088
2088
|
if (e) {
|
|
2089
2089
|
if (y.current) {
|
|
2090
2090
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
@@ -2104,7 +2104,7 @@ function Jt(e) {
|
|
|
2104
2104
|
ee(() => {
|
|
2105
2105
|
e && h.current !== e && g();
|
|
2106
2106
|
}, [e]);
|
|
2107
|
-
const k =
|
|
2107
|
+
const k = W(
|
|
2108
2108
|
async (x) => {
|
|
2109
2109
|
c(!0), u(0), N(null);
|
|
2110
2110
|
try {
|
|
@@ -2127,8 +2127,8 @@ function Jt(e) {
|
|
|
2127
2127
|
submit: k
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2131
|
-
const { appropriatenessTestService: t } = me(), [r, n] = b(null), [s, l] = b(!1), [o, c] = b(!1), [d, u] = b(null), [w, N] = b(null), y = X(!1), h = X(null), g =
|
|
2130
|
+
function Hr(e) {
|
|
2131
|
+
const { appropriatenessTestService: t } = me(), [r, n] = b(null), [s, l] = b(!1), [o, c] = b(!1), [d, u] = b(null), [w, N] = b(null), y = X(!1), h = X(null), g = W(async () => {
|
|
2132
2132
|
if (e) {
|
|
2133
2133
|
if (y.current) {
|
|
2134
2134
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2148,7 +2148,7 @@ function jr(e) {
|
|
|
2148
2148
|
ee(() => {
|
|
2149
2149
|
e && h.current !== e && g();
|
|
2150
2150
|
}, [e]);
|
|
2151
|
-
const k =
|
|
2151
|
+
const k = W(
|
|
2152
2152
|
async (x) => {
|
|
2153
2153
|
c(!0), u(null);
|
|
2154
2154
|
try {
|
|
@@ -2172,8 +2172,8 @@ function jr(e) {
|
|
|
2172
2172
|
submit: k
|
|
2173
2173
|
};
|
|
2174
2174
|
}
|
|
2175
|
-
function
|
|
2176
|
-
const { overviewService: t } = me(), [r, n] = b(null), [s, l] = b(!1), [o, c] = b(!1), [d, u] = b(null), w = X(!1), N = X(null), y =
|
|
2175
|
+
function er(e) {
|
|
2176
|
+
const { overviewService: t } = me(), [r, n] = b(null), [s, l] = b(!1), [o, c] = b(!1), [d, u] = b(null), w = X(!1), N = X(null), y = W(async () => {
|
|
2177
2177
|
if (e) {
|
|
2178
2178
|
if (w.current) {
|
|
2179
2179
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2193,7 +2193,7 @@ function Xt(e) {
|
|
|
2193
2193
|
ee(() => {
|
|
2194
2194
|
e && N.current !== e && y();
|
|
2195
2195
|
}, [e]);
|
|
2196
|
-
const h =
|
|
2196
|
+
const h = W(async () => {
|
|
2197
2197
|
if (e) {
|
|
2198
2198
|
c(!0), u(null);
|
|
2199
2199
|
try {
|
|
@@ -2214,10 +2214,10 @@ function Xt(e) {
|
|
|
2214
2214
|
passOverview: h
|
|
2215
2215
|
};
|
|
2216
2216
|
}
|
|
2217
|
-
function
|
|
2217
|
+
function tr(e) {
|
|
2218
2218
|
const { identityService: t } = me(), [r, n] = b(
|
|
2219
2219
|
null
|
|
2220
|
-
), [s, l] = b(!1), [o, c] = b(null), d = X(!1), u =
|
|
2220
|
+
), [s, l] = b(!1), [o, c] = b(null), d = X(!1), u = W(
|
|
2221
2221
|
async (y, h) => {
|
|
2222
2222
|
if (e) {
|
|
2223
2223
|
if (d.current) {
|
|
@@ -2244,7 +2244,7 @@ function er(e) {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
},
|
|
2246
2246
|
[e, t]
|
|
2247
|
-
), w =
|
|
2247
|
+
), w = W(
|
|
2248
2248
|
async (y, h) => {
|
|
2249
2249
|
if (e) {
|
|
2250
2250
|
l(!0), c(null);
|
|
@@ -2264,7 +2264,7 @@ function er(e) {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
},
|
|
2266
2266
|
[e, t]
|
|
2267
|
-
), N =
|
|
2267
|
+
), N = W(async () => {
|
|
2268
2268
|
if (e) {
|
|
2269
2269
|
if (d.current) {
|
|
2270
2270
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2300,8 +2300,8 @@ function er(e) {
|
|
|
2300
2300
|
restartIdentity: N
|
|
2301
2301
|
};
|
|
2302
2302
|
}
|
|
2303
|
-
function
|
|
2304
|
-
const { riskScoringService: t, applicantService: r } = me(), [n, s] = b(null), [l, o] = b({}), [c, d] = b(!1), [u, w] = b(!1), [N, y] = b(null), [h, g] = b(null), k = X(!1), x = X(null), m =
|
|
2303
|
+
function rr(e) {
|
|
2304
|
+
const { riskScoringService: t, applicantService: r } = me(), [n, s] = b(null), [l, o] = b({}), [c, d] = b(!1), [u, w] = b(!1), [N, y] = b(null), [h, g] = b(null), k = X(!1), x = X(null), m = W(async () => {
|
|
2305
2305
|
var S;
|
|
2306
2306
|
if (e) {
|
|
2307
2307
|
if (k.current) {
|
|
@@ -2315,8 +2315,8 @@ function tr(e) {
|
|
|
2315
2315
|
r.getApplicantData(e).catch(() => null)
|
|
2316
2316
|
]);
|
|
2317
2317
|
if (s(v), (S = K == null ? void 0 : K.riskScoringResults) != null && S.length) {
|
|
2318
|
-
const
|
|
2319
|
-
for (const f of
|
|
2318
|
+
const V = K.riskScoringResults[0], M = {};
|
|
2319
|
+
for (const f of V.riskCriteriaResults ?? [])
|
|
2320
2320
|
if (f.riskCriteriaId != null && f.answer != null && f.answer !== "") {
|
|
2321
2321
|
const A = [...new Set(
|
|
2322
2322
|
f.answer.split(",").map((F) => F.trim()).filter((F) => F !== "")
|
|
@@ -2336,7 +2336,7 @@ function tr(e) {
|
|
|
2336
2336
|
ee(() => {
|
|
2337
2337
|
e && x.current !== e && m();
|
|
2338
2338
|
}, [e]);
|
|
2339
|
-
const R =
|
|
2339
|
+
const R = W(
|
|
2340
2340
|
async (S) => {
|
|
2341
2341
|
w(!0), y(null);
|
|
2342
2342
|
try {
|
|
@@ -2361,11 +2361,11 @@ function tr(e) {
|
|
|
2361
2361
|
submit: R
|
|
2362
2362
|
};
|
|
2363
2363
|
}
|
|
2364
|
-
function
|
|
2364
|
+
function ar() {
|
|
2365
2365
|
const { applicantService: e, config: t } = me(), [r, n] = b(!1), [s, l] = b(null), o = X(!1), c = X(!1), d = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(h) {
|
|
2366
2366
|
const g = Math.random() * 16 | 0;
|
|
2367
2367
|
return (h === "x" ? g : g & 3 | 8).toString(16);
|
|
2368
|
-
}), u =
|
|
2368
|
+
}), u = W(
|
|
2369
2369
|
async (h) => {
|
|
2370
2370
|
var g;
|
|
2371
2371
|
if (o.current)
|
|
@@ -2387,7 +2387,7 @@ function rr() {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
},
|
|
2389
2389
|
[e, t]
|
|
2390
|
-
), w =
|
|
2390
|
+
), w = W(
|
|
2391
2391
|
async (h) => {
|
|
2392
2392
|
n(!0), l(null);
|
|
2393
2393
|
try {
|
|
@@ -2399,7 +2399,7 @@ function rr() {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
},
|
|
2401
2401
|
[e]
|
|
2402
|
-
), N =
|
|
2402
|
+
), N = W(
|
|
2403
2403
|
async (h) => {
|
|
2404
2404
|
if (c.current)
|
|
2405
2405
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
@@ -2413,7 +2413,7 @@ function rr() {
|
|
|
2413
2413
|
}
|
|
2414
2414
|
},
|
|
2415
2415
|
[e]
|
|
2416
|
-
), y =
|
|
2416
|
+
), y = W(
|
|
2417
2417
|
async (h) => {
|
|
2418
2418
|
n(!0), l(null);
|
|
2419
2419
|
try {
|
|
@@ -2653,7 +2653,7 @@ const O = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2653
2653
|
] })
|
|
2654
2654
|
);
|
|
2655
2655
|
we.displayName = "Select";
|
|
2656
|
-
const
|
|
2656
|
+
const nr = ({
|
|
2657
2657
|
label: e,
|
|
2658
2658
|
value: t,
|
|
2659
2659
|
onChange: r,
|
|
@@ -2804,7 +2804,7 @@ const ar = ({
|
|
|
2804
2804
|
)
|
|
2805
2805
|
] })
|
|
2806
2806
|
] });
|
|
2807
|
-
},
|
|
2807
|
+
}, sr = ({
|
|
2808
2808
|
label: e,
|
|
2809
2809
|
error: t,
|
|
2810
2810
|
accept: r,
|
|
@@ -2818,7 +2818,7 @@ const ar = ({
|
|
|
2818
2818
|
if (!m) return;
|
|
2819
2819
|
const R = Array.from(m);
|
|
2820
2820
|
if (s && R.filter((v) => v.size > s).length > 0) {
|
|
2821
|
-
const v =
|
|
2821
|
+
const v = Be(s);
|
|
2822
2822
|
alert(`Some files exceed the maximum size of ${v}`);
|
|
2823
2823
|
return;
|
|
2824
2824
|
}
|
|
@@ -2887,7 +2887,7 @@ const ar = ({
|
|
|
2887
2887
|
] }),
|
|
2888
2888
|
s && /* @__PURE__ */ i("p", { className: "text-xs text-gray-500", children: [
|
|
2889
2889
|
"Maximum file size: ",
|
|
2890
|
-
|
|
2890
|
+
Be(s)
|
|
2891
2891
|
] })
|
|
2892
2892
|
] })
|
|
2893
2893
|
]
|
|
@@ -2918,7 +2918,7 @@ const ar = ({
|
|
|
2918
2918
|
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: m.name }),
|
|
2919
2919
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500", children: [
|
|
2920
2920
|
"(",
|
|
2921
|
-
|
|
2921
|
+
Be(m.size),
|
|
2922
2922
|
")"
|
|
2923
2923
|
] })
|
|
2924
2924
|
] }),
|
|
@@ -2946,7 +2946,7 @@ const ar = ({
|
|
|
2946
2946
|
)) }),
|
|
2947
2947
|
t && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
2948
2948
|
] });
|
|
2949
|
-
},
|
|
2949
|
+
}, ir = Pe(
|
|
2950
2950
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: r, ...n }, s) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2951
2951
|
n.label && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2952
2952
|
n.label,
|
|
@@ -2981,28 +2981,28 @@ const ar = ({
|
|
|
2981
2981
|
n.error && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: n.error })
|
|
2982
2982
|
] })
|
|
2983
2983
|
);
|
|
2984
|
-
|
|
2984
|
+
ir.displayName = "PhoneInput";
|
|
2985
2985
|
/**
|
|
2986
2986
|
* @license lucide-react v0.574.0 - ISC
|
|
2987
2987
|
*
|
|
2988
2988
|
* This source code is licensed under the ISC license.
|
|
2989
2989
|
* See the LICENSE file in the root directory of this source tree.
|
|
2990
2990
|
*/
|
|
2991
|
-
const
|
|
2991
|
+
const Ve = (...e) => e.filter((t, r, n) => !!t && t.trim() !== "" && n.indexOf(t) === r).join(" ").trim();
|
|
2992
2992
|
/**
|
|
2993
2993
|
* @license lucide-react v0.574.0 - ISC
|
|
2994
2994
|
*
|
|
2995
2995
|
* This source code is licensed under the ISC license.
|
|
2996
2996
|
* See the LICENSE file in the root directory of this source tree.
|
|
2997
2997
|
*/
|
|
2998
|
-
const
|
|
2998
|
+
const lr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2999
2999
|
/**
|
|
3000
3000
|
* @license lucide-react v0.574.0 - ISC
|
|
3001
3001
|
*
|
|
3002
3002
|
* This source code is licensed under the ISC license.
|
|
3003
3003
|
* See the LICENSE file in the root directory of this source tree.
|
|
3004
3004
|
*/
|
|
3005
|
-
const
|
|
3005
|
+
const or = (e) => e.replace(
|
|
3006
3006
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3007
3007
|
(t, r, n) => n ? n.toUpperCase() : r.toLowerCase()
|
|
3008
3008
|
);
|
|
@@ -3012,8 +3012,8 @@ const lr = (e) => e.replace(
|
|
|
3012
3012
|
* This source code is licensed under the ISC license.
|
|
3013
3013
|
* See the LICENSE file in the root directory of this source tree.
|
|
3014
3014
|
*/
|
|
3015
|
-
const
|
|
3016
|
-
const t =
|
|
3015
|
+
const He = (e) => {
|
|
3016
|
+
const t = or(e);
|
|
3017
3017
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3018
3018
|
};
|
|
3019
3019
|
/**
|
|
@@ -3022,7 +3022,7 @@ const je = (e) => {
|
|
|
3022
3022
|
* This source code is licensed under the ISC license.
|
|
3023
3023
|
* See the LICENSE file in the root directory of this source tree.
|
|
3024
3024
|
*/
|
|
3025
|
-
var
|
|
3025
|
+
var cr = {
|
|
3026
3026
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3027
3027
|
width: 24,
|
|
3028
3028
|
height: 24,
|
|
@@ -3039,7 +3039,7 @@ var or = {
|
|
|
3039
3039
|
* This source code is licensed under the ISC license.
|
|
3040
3040
|
* See the LICENSE file in the root directory of this source tree.
|
|
3041
3041
|
*/
|
|
3042
|
-
const
|
|
3042
|
+
const dr = (e) => {
|
|
3043
3043
|
for (const t in e)
|
|
3044
3044
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3045
3045
|
return !0;
|
|
@@ -3051,7 +3051,7 @@ const cr = (e) => {
|
|
|
3051
3051
|
* This source code is licensed under the ISC license.
|
|
3052
3052
|
* See the LICENSE file in the root directory of this source tree.
|
|
3053
3053
|
*/
|
|
3054
|
-
const
|
|
3054
|
+
const ur = Pe(
|
|
3055
3055
|
({
|
|
3056
3056
|
color: e = "currentColor",
|
|
3057
3057
|
size: t = 24,
|
|
@@ -3061,21 +3061,21 @@ const dr = Pe(
|
|
|
3061
3061
|
children: l,
|
|
3062
3062
|
iconNode: o,
|
|
3063
3063
|
...c
|
|
3064
|
-
}, d) =>
|
|
3064
|
+
}, d) => _e(
|
|
3065
3065
|
"svg",
|
|
3066
3066
|
{
|
|
3067
3067
|
ref: d,
|
|
3068
|
-
...
|
|
3068
|
+
...cr,
|
|
3069
3069
|
width: t,
|
|
3070
3070
|
height: t,
|
|
3071
3071
|
stroke: e,
|
|
3072
3072
|
strokeWidth: n ? Number(r) * 24 / Number(t) : r,
|
|
3073
|
-
className:
|
|
3074
|
-
...!l && !
|
|
3073
|
+
className: Ve("lucide", s),
|
|
3074
|
+
...!l && !dr(c) && { "aria-hidden": "true" },
|
|
3075
3075
|
...c
|
|
3076
3076
|
},
|
|
3077
3077
|
[
|
|
3078
|
-
...o.map(([u, w]) =>
|
|
3078
|
+
...o.map(([u, w]) => _e(u, w)),
|
|
3079
3079
|
...Array.isArray(l) ? l : [l]
|
|
3080
3080
|
]
|
|
3081
3081
|
)
|
|
@@ -3086,20 +3086,20 @@ const dr = Pe(
|
|
|
3086
3086
|
* This source code is licensed under the ISC license.
|
|
3087
3087
|
* See the LICENSE file in the root directory of this source tree.
|
|
3088
3088
|
*/
|
|
3089
|
-
const
|
|
3089
|
+
const Ge = (e, t) => {
|
|
3090
3090
|
const r = Pe(
|
|
3091
|
-
({ className: n, ...s }, l) =>
|
|
3091
|
+
({ className: n, ...s }, l) => _e(ur, {
|
|
3092
3092
|
ref: l,
|
|
3093
3093
|
iconNode: t,
|
|
3094
|
-
className:
|
|
3095
|
-
`lucide-${
|
|
3094
|
+
className: Ve(
|
|
3095
|
+
`lucide-${lr(He(e))}`,
|
|
3096
3096
|
`lucide-${e}`,
|
|
3097
3097
|
n
|
|
3098
3098
|
),
|
|
3099
3099
|
...s
|
|
3100
3100
|
})
|
|
3101
3101
|
);
|
|
3102
|
-
return r.displayName =
|
|
3102
|
+
return r.displayName = He(e), r;
|
|
3103
3103
|
};
|
|
3104
3104
|
/**
|
|
3105
3105
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3107,15 +3107,15 @@ const Ve = (e, t) => {
|
|
|
3107
3107
|
* This source code is licensed under the ISC license.
|
|
3108
3108
|
* See the LICENSE file in the root directory of this source tree.
|
|
3109
3109
|
*/
|
|
3110
|
-
const
|
|
3110
|
+
const mr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Ze = Ge("chevron-left", mr);
|
|
3111
3111
|
/**
|
|
3112
3112
|
* @license lucide-react v0.574.0 - ISC
|
|
3113
3113
|
*
|
|
3114
3114
|
* This source code is licensed under the ISC license.
|
|
3115
3115
|
* See the LICENSE file in the root directory of this source tree.
|
|
3116
3116
|
*/
|
|
3117
|
-
const
|
|
3118
|
-
function
|
|
3117
|
+
const pr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Je = Ge("chevron-right", pr);
|
|
3118
|
+
function hr(e, t) {
|
|
3119
3119
|
const r = !t || t.length === 0 || t.every((n) => !n || !n.trim());
|
|
3120
3120
|
if (e.isRequired && r)
|
|
3121
3121
|
return e.errorMessage || "This field is required";
|
|
@@ -3144,7 +3144,7 @@ function pr(e, t) {
|
|
|
3144
3144
|
}
|
|
3145
3145
|
return null;
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3147
|
+
function gr(e) {
|
|
3148
3148
|
const t = e.flatMap(
|
|
3149
3149
|
(n, s) => (n.questions ?? []).map((l, o) => ({ question: l, groupIndex: s, qIdx: o }))
|
|
3150
3150
|
), r = /* @__PURE__ */ new Map();
|
|
@@ -3154,27 +3154,27 @@ function hr(e) {
|
|
|
3154
3154
|
}
|
|
3155
3155
|
return Array.from(r.entries()).sort(([n], [s]) => n - s).map(([, n]) => n);
|
|
3156
3156
|
}
|
|
3157
|
-
const
|
|
3157
|
+
const yr = ({
|
|
3158
3158
|
applicantId: e,
|
|
3159
3159
|
onComplete: t,
|
|
3160
3160
|
onBack: r
|
|
3161
3161
|
}) => {
|
|
3162
|
-
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: d } =
|
|
3162
|
+
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: d } = Jt(e), [u, w] = b({}), [N, y] = b({}), [h, g] = b(0);
|
|
3163
3163
|
pe.useEffect(() => {
|
|
3164
3164
|
s && Object.keys(s).length > 0 && Object.keys(u).length === 0 && w(s);
|
|
3165
3165
|
}, [s]);
|
|
3166
3166
|
const k = Ce(
|
|
3167
|
-
() => n ?
|
|
3167
|
+
() => n ? gr(n.questionGroups) : [],
|
|
3168
3168
|
[n]
|
|
3169
|
-
), x = h === k.length - 1, m = k[h] ?? [], R =
|
|
3169
|
+
), x = h === k.length - 1, m = k[h] ?? [], R = W((M, f) => {
|
|
3170
3170
|
w((A) => ({ ...A, [M]: f })), y((A) => {
|
|
3171
3171
|
const F = { ...A };
|
|
3172
3172
|
return delete F[M], F;
|
|
3173
3173
|
});
|
|
3174
|
-
}, []), S =
|
|
3174
|
+
}, []), S = W(() => {
|
|
3175
3175
|
const M = {};
|
|
3176
3176
|
for (const { question: f } of m) {
|
|
3177
|
-
const A =
|
|
3177
|
+
const A = hr(f, u[f.id] ?? []);
|
|
3178
3178
|
A && (M[f.id] = A);
|
|
3179
3179
|
}
|
|
3180
3180
|
return y((f) => ({ ...f, ...M })), Object.keys(M).length === 0;
|
|
@@ -3182,7 +3182,7 @@ const gr = ({
|
|
|
3182
3182
|
S() && g((M) => M + 1);
|
|
3183
3183
|
}, K = () => {
|
|
3184
3184
|
h > 0 ? g((M) => M - 1) : r == null || r();
|
|
3185
|
-
},
|
|
3185
|
+
}, V = async () => {
|
|
3186
3186
|
if (!(!S() || !n))
|
|
3187
3187
|
try {
|
|
3188
3188
|
const M = n.questionGroups.flatMap(
|
|
@@ -3229,7 +3229,7 @@ const gr = ({
|
|
|
3229
3229
|
] })
|
|
3230
3230
|
] }),
|
|
3231
3231
|
/* @__PURE__ */ a($, { className: "space-y-6", children: m.map(({ question: M }) => /* @__PURE__ */ a(
|
|
3232
|
-
|
|
3232
|
+
fr,
|
|
3233
3233
|
{
|
|
3234
3234
|
question: M,
|
|
3235
3235
|
value: u[M.id] ?? [],
|
|
@@ -3247,7 +3247,7 @@ const gr = ({
|
|
|
3247
3247
|
onClick: K,
|
|
3248
3248
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3249
3249
|
children: [
|
|
3250
|
-
/* @__PURE__ */ a(
|
|
3250
|
+
/* @__PURE__ */ a(Ze, { size: 14 }),
|
|
3251
3251
|
h > 0 ? "Previous" : "Back"
|
|
3252
3252
|
]
|
|
3253
3253
|
}
|
|
@@ -3257,7 +3257,7 @@ const gr = ({
|
|
|
3257
3257
|
{
|
|
3258
3258
|
type: "button",
|
|
3259
3259
|
isLoading: o,
|
|
3260
|
-
onClick:
|
|
3260
|
+
onClick: V,
|
|
3261
3261
|
children: "Continue"
|
|
3262
3262
|
}
|
|
3263
3263
|
) : /* @__PURE__ */ i(
|
|
@@ -3268,14 +3268,14 @@ const gr = ({
|
|
|
3268
3268
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3269
3269
|
children: [
|
|
3270
3270
|
"Next",
|
|
3271
|
-
/* @__PURE__ */ a(
|
|
3271
|
+
/* @__PURE__ */ a(Je, { size: 14 })
|
|
3272
3272
|
]
|
|
3273
3273
|
}
|
|
3274
3274
|
)
|
|
3275
3275
|
] }),
|
|
3276
3276
|
c && /* @__PURE__ */ a("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: c.message }) })
|
|
3277
3277
|
] }) : null;
|
|
3278
|
-
},
|
|
3278
|
+
}, fr = ({ question: e, value: t, error: r, onChange: n }) => {
|
|
3279
3279
|
var o;
|
|
3280
3280
|
const l = (((o = e.defaultAnswers) == null ? void 0 : o.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3281
3281
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
@@ -3382,19 +3382,19 @@ const gr = ({
|
|
|
3382
3382
|
] }),
|
|
3383
3383
|
r && l === "text" && null
|
|
3384
3384
|
] });
|
|
3385
|
-
},
|
|
3385
|
+
}, br = ({
|
|
3386
3386
|
applicantId: e,
|
|
3387
3387
|
onComplete: t,
|
|
3388
3388
|
onBack: r
|
|
3389
3389
|
}) => {
|
|
3390
|
-
const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } =
|
|
3390
|
+
const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } = Xt(e), [d, u] = b({}), w = async (N) => {
|
|
3391
3391
|
if (N.preventDefault(), !n) return;
|
|
3392
3392
|
const y = await Promise.all(
|
|
3393
3393
|
n.uploadDocumentFiles.map(async (g) => {
|
|
3394
3394
|
const k = d[g.id] || [], x = await Promise.all(
|
|
3395
3395
|
k.map(async (m) => ({
|
|
3396
3396
|
fileName: m.name,
|
|
3397
|
-
fileData: await
|
|
3397
|
+
fileData: await Ht(m)
|
|
3398
3398
|
}))
|
|
3399
3399
|
);
|
|
3400
3400
|
return {
|
|
@@ -3418,7 +3418,7 @@ const gr = ({
|
|
|
3418
3418
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.subtitle })
|
|
3419
3419
|
] }),
|
|
3420
3420
|
/* @__PURE__ */ a($, { className: "space-y-6", children: n.uploadDocumentFiles.map((N) => /* @__PURE__ */ a(
|
|
3421
|
-
|
|
3421
|
+
sr,
|
|
3422
3422
|
{
|
|
3423
3423
|
label: N.displayName,
|
|
3424
3424
|
accept: N.allowedTypes,
|
|
@@ -3436,8 +3436,8 @@ const gr = ({
|
|
|
3436
3436
|
/* @__PURE__ */ a(q, { type: "submit", isLoading: l, children: "Continue" })
|
|
3437
3437
|
] })
|
|
3438
3438
|
] }) }) : null;
|
|
3439
|
-
},
|
|
3440
|
-
const { overview: n, isLoading: s, isSubmitting: l, error: o, passOverview: c } =
|
|
3439
|
+
}, xr = ({ applicantId: e, onComplete: t, onBack: r }) => {
|
|
3440
|
+
const { overview: n, isLoading: s, isSubmitting: l, error: o, passOverview: c } = er(e), d = async () => {
|
|
3441
3441
|
await c(), t == null || t();
|
|
3442
3442
|
};
|
|
3443
3443
|
return s ? /* @__PURE__ */ a(O, { children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(ye, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a(O, { children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
@@ -3473,7 +3473,7 @@ const gr = ({
|
|
|
3473
3473
|
] })
|
|
3474
3474
|
] }) : null;
|
|
3475
3475
|
};
|
|
3476
|
-
function
|
|
3476
|
+
function vr(e, t) {
|
|
3477
3477
|
const r = !t || t.length === 0 || t.every((n) => !n || !n.trim());
|
|
3478
3478
|
if (e.isRequired && r)
|
|
3479
3479
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -3503,55 +3503,55 @@ function xr(e, t) {
|
|
|
3503
3503
|
}
|
|
3504
3504
|
return null;
|
|
3505
3505
|
}
|
|
3506
|
-
function
|
|
3506
|
+
function wr(e) {
|
|
3507
3507
|
const t = /* @__PURE__ */ new Map();
|
|
3508
3508
|
return e.forEach((r, n) => {
|
|
3509
3509
|
const s = r.pageNumber != null && r.pageNumber > 0 ? r.pageNumber : 1;
|
|
3510
3510
|
t.has(s) || t.set(s, []), t.get(s).push({ criterion: r, idx: n });
|
|
3511
3511
|
}), Array.from(t.entries()).sort(([r], [n]) => r - n).map(([, r]) => r);
|
|
3512
3512
|
}
|
|
3513
|
-
function
|
|
3513
|
+
function kr(e) {
|
|
3514
3514
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
3515
3515
|
}
|
|
3516
|
-
const
|
|
3516
|
+
const Nr = ({
|
|
3517
3517
|
applicantId: e,
|
|
3518
3518
|
onComplete: t,
|
|
3519
3519
|
onBack: r
|
|
3520
3520
|
}) => {
|
|
3521
|
-
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: d } =
|
|
3521
|
+
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: d } = rr(e), [u, w] = b({}), [N, y] = b({}), [h, g] = b(0), [k, x] = b(!1);
|
|
3522
3522
|
pe.useEffect(() => {
|
|
3523
3523
|
s && Object.keys(s).length > 0 && Object.keys(u).length === 0 && w(s);
|
|
3524
3524
|
}, [s]);
|
|
3525
3525
|
const m = Ce(
|
|
3526
|
-
() => n && n.length > 0 ?
|
|
3526
|
+
() => n && n.length > 0 ? wr(n) : [],
|
|
3527
3527
|
[n]
|
|
3528
3528
|
), R = h === m.length - 1, S = m[h] ?? [];
|
|
3529
3529
|
pe.useEffect(() => {
|
|
3530
3530
|
!l && n && n.length === 0 && !k && !o && (x(!0), d({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3531
3531
|
}, [l, n, k, o, d, e, t]);
|
|
3532
|
-
const v =
|
|
3533
|
-
w((
|
|
3534
|
-
const H = { ...
|
|
3532
|
+
const v = W((A, F) => {
|
|
3533
|
+
w((Q) => ({ ...Q, [A]: F })), y((Q) => {
|
|
3534
|
+
const H = { ...Q };
|
|
3535
3535
|
return delete H[A], H;
|
|
3536
3536
|
});
|
|
3537
|
-
}, []), K =
|
|
3537
|
+
}, []), K = W(() => {
|
|
3538
3538
|
const A = {};
|
|
3539
3539
|
for (const { criterion: F } of S) {
|
|
3540
|
-
const
|
|
3541
|
-
|
|
3540
|
+
const Q = vr(F, u[F.id] ?? []);
|
|
3541
|
+
Q && (A[F.id] = Q);
|
|
3542
3542
|
}
|
|
3543
3543
|
return y((F) => ({ ...F, ...A })), Object.keys(A).length === 0;
|
|
3544
|
-
}, [S, u]),
|
|
3544
|
+
}, [S, u]), V = () => {
|
|
3545
3545
|
K() && g((A) => A + 1);
|
|
3546
3546
|
}, M = () => {
|
|
3547
3547
|
h > 0 ? g((A) => A - 1) : r == null || r();
|
|
3548
3548
|
}, f = async () => {
|
|
3549
3549
|
if (!(!K() || !n))
|
|
3550
3550
|
try {
|
|
3551
|
-
const A = n.map((
|
|
3552
|
-
const H = (u[
|
|
3553
|
-
return H.length > 0 ? { riskCriteriaId:
|
|
3554
|
-
}).filter((
|
|
3551
|
+
const A = n.map((Q) => {
|
|
3552
|
+
const H = (u[Q.id] ?? []).filter((D) => D && D.trim());
|
|
3553
|
+
return H.length > 0 ? { riskCriteriaId: Q.id, values: H } : null;
|
|
3554
|
+
}).filter((Q) => Q !== null);
|
|
3555
3555
|
await d({ applicantId: e, criteriaValueInputs: A }), t == null || t();
|
|
3556
3556
|
} catch (A) {
|
|
3557
3557
|
console.error("Risk scoring submit error:", A);
|
|
@@ -3592,7 +3592,7 @@ const kr = ({
|
|
|
3592
3592
|
] })
|
|
3593
3593
|
] }),
|
|
3594
3594
|
/* @__PURE__ */ a($, { className: "space-y-6", children: S.map(({ criterion: A }) => /* @__PURE__ */ a(
|
|
3595
|
-
|
|
3595
|
+
Sr,
|
|
3596
3596
|
{
|
|
3597
3597
|
criterion: A,
|
|
3598
3598
|
value: u[A.id] ?? [],
|
|
@@ -3610,7 +3610,7 @@ const kr = ({
|
|
|
3610
3610
|
onClick: M,
|
|
3611
3611
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3612
3612
|
children: [
|
|
3613
|
-
/* @__PURE__ */ a(
|
|
3613
|
+
/* @__PURE__ */ a(Ze, { size: 14 }),
|
|
3614
3614
|
h > 0 ? "Previous" : "Back"
|
|
3615
3615
|
]
|
|
3616
3616
|
}
|
|
@@ -3619,19 +3619,19 @@ const kr = ({
|
|
|
3619
3619
|
q,
|
|
3620
3620
|
{
|
|
3621
3621
|
type: "button",
|
|
3622
|
-
onClick:
|
|
3622
|
+
onClick: V,
|
|
3623
3623
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3624
3624
|
children: [
|
|
3625
3625
|
"Next",
|
|
3626
|
-
/* @__PURE__ */ a(
|
|
3626
|
+
/* @__PURE__ */ a(Je, { size: 14 })
|
|
3627
3627
|
]
|
|
3628
3628
|
}
|
|
3629
3629
|
)
|
|
3630
3630
|
] }),
|
|
3631
3631
|
c && /* @__PURE__ */ a("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: c.message }) })
|
|
3632
3632
|
] }) : null;
|
|
3633
|
-
},
|
|
3634
|
-
const s =
|
|
3633
|
+
}, Sr = ({ criterion: e, value: t, error: r, onChange: n }) => {
|
|
3634
|
+
const s = kr(e), l = e.valueDataType === ve.Integer || e.valueDataType === ve.Decimal || e.valueDataType === ve.DigitOnly;
|
|
3635
3635
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
3636
3636
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
3637
3637
|
e.displayName,
|
|
@@ -3747,7 +3747,7 @@ const kr = ({
|
|
|
3747
3747
|
}
|
|
3748
3748
|
)
|
|
3749
3749
|
] });
|
|
3750
|
-
},
|
|
3750
|
+
}, Cr = ({
|
|
3751
3751
|
applicantId: e,
|
|
3752
3752
|
onComplete: t,
|
|
3753
3753
|
onBack: r
|
|
@@ -3885,7 +3885,7 @@ const kr = ({
|
|
|
3885
3885
|
)
|
|
3886
3886
|
] })
|
|
3887
3887
|
] }) });
|
|
3888
|
-
},
|
|
3888
|
+
}, Ar = ({
|
|
3889
3889
|
applicantId: e,
|
|
3890
3890
|
onComplete: t,
|
|
3891
3891
|
onBack: r
|
|
@@ -3897,8 +3897,8 @@ const kr = ({
|
|
|
3897
3897
|
c(!0), N(null), console.log("Loading appropriateness test for applicant:", e);
|
|
3898
3898
|
const I = await n.getAppropriatenessTest(e);
|
|
3899
3899
|
if (console.log("Appropriateness test data:", I), l(I), I.waitTimeSpanForNextTry && I.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3900
|
-
const
|
|
3901
|
-
|
|
3900
|
+
const Z = V(I.waitTimeSpanForNextTry);
|
|
3901
|
+
Z > 0 && K(Z);
|
|
3902
3902
|
}
|
|
3903
3903
|
} catch (I) {
|
|
3904
3904
|
console.error("Error loading appropriateness test:", I), N(I.message || "Failed to load appropriateness test");
|
|
@@ -3907,16 +3907,16 @@ const kr = ({
|
|
|
3907
3907
|
}
|
|
3908
3908
|
})();
|
|
3909
3909
|
}, [e, n]);
|
|
3910
|
-
const
|
|
3910
|
+
const V = (D) => {
|
|
3911
3911
|
const I = D.split(":").map(Number);
|
|
3912
3912
|
if (I.length === 3) {
|
|
3913
|
-
const [
|
|
3914
|
-
return
|
|
3913
|
+
const [Z, j, de] = I;
|
|
3914
|
+
return Z * 3600 + j * 60 + de;
|
|
3915
3915
|
}
|
|
3916
3916
|
return 0;
|
|
3917
3917
|
}, M = (D) => {
|
|
3918
|
-
const I = Math.floor(D / 60),
|
|
3919
|
-
return `${I.toString().padStart(2, "0")}:${
|
|
3918
|
+
const I = Math.floor(D / 60), Z = D % 60;
|
|
3919
|
+
return `${I.toString().padStart(2, "0")}:${Z.toString().padStart(2, "0")}`;
|
|
3920
3920
|
};
|
|
3921
3921
|
ee(() => {
|
|
3922
3922
|
if (!x || g <= 0) return;
|
|
@@ -3936,8 +3936,8 @@ const kr = ({
|
|
|
3936
3936
|
const f = () => {
|
|
3937
3937
|
s && (m(!0), k(s.testDurationSec));
|
|
3938
3938
|
}, A = (D, I) => {
|
|
3939
|
-
h((
|
|
3940
|
-
...
|
|
3939
|
+
h((Z) => ({
|
|
3940
|
+
...Z,
|
|
3941
3941
|
[D]: I
|
|
3942
3942
|
}));
|
|
3943
3943
|
}, F = async (D) => {
|
|
@@ -3957,19 +3957,19 @@ const kr = ({
|
|
|
3957
3957
|
value: y[j.id] || ""
|
|
3958
3958
|
// Empty string if not answered
|
|
3959
3959
|
})
|
|
3960
|
-
),
|
|
3960
|
+
), Z = {
|
|
3961
3961
|
applicantId: e,
|
|
3962
3962
|
appropriatenessTestId: s.id,
|
|
3963
3963
|
appropriatenessQuestionResults: I
|
|
3964
3964
|
};
|
|
3965
|
-
console.log("Submitting appropriateness test:",
|
|
3965
|
+
console.log("Submitting appropriateness test:", Z);
|
|
3966
3966
|
try {
|
|
3967
|
-
const j = await n.fillAppropriatenessTest(
|
|
3968
|
-
console.log("Appropriateness test result:", j), j.message && (j.message.toLowerCase().includes("pass") || j.message.toLowerCase().includes("success") || j.message.toLowerCase().includes("congratulations")) ? t == null || t() : (N(j.message || "Test completed. Please check the result."), m(!1), S(!1), h({}), setTimeout(() =>
|
|
3967
|
+
const j = await n.fillAppropriatenessTest(Z);
|
|
3968
|
+
console.log("Appropriateness test result:", j), j.message && (j.message.toLowerCase().includes("pass") || j.message.toLowerCase().includes("success") || j.message.toLowerCase().includes("congratulations")) ? t == null || t() : (N(j.message || "Test completed. Please check the result."), m(!1), S(!1), h({}), setTimeout(() => Q(), 1e3));
|
|
3969
3969
|
} catch (j) {
|
|
3970
3970
|
if (j.code === 400 && j.message) {
|
|
3971
3971
|
const de = j.message;
|
|
3972
|
-
console.log("Test failed:", de), N(de), m(!1), S(!1), h({}), setTimeout(() =>
|
|
3972
|
+
console.log("Test failed:", de), N(de), m(!1), S(!1), h({}), setTimeout(() => Q(), 1500);
|
|
3973
3973
|
} else
|
|
3974
3974
|
throw j;
|
|
3975
3975
|
}
|
|
@@ -3979,11 +3979,11 @@ const kr = ({
|
|
|
3979
3979
|
u(!1);
|
|
3980
3980
|
}
|
|
3981
3981
|
}
|
|
3982
|
-
},
|
|
3982
|
+
}, Q = async () => {
|
|
3983
3983
|
try {
|
|
3984
3984
|
const D = await n.getAppropriatenessTest(e);
|
|
3985
3985
|
if (console.log("Reloaded test data:", D), l(D), D.waitTimeSpanForNextTry && D.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3986
|
-
const I =
|
|
3986
|
+
const I = V(D.waitTimeSpanForNextTry);
|
|
3987
3987
|
I > 0 && K(I);
|
|
3988
3988
|
}
|
|
3989
3989
|
} catch (D) {
|
|
@@ -4062,12 +4062,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4062
4062
|
D.groupName && /* @__PURE__ */ a("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: D.groupName }),
|
|
4063
4063
|
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: D.question })
|
|
4064
4064
|
] }),
|
|
4065
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: D.answers.map((
|
|
4065
|
+
/* @__PURE__ */ a("div", { className: "space-y-2", children: D.answers.map((Z, j) => /* @__PURE__ */ i(
|
|
4066
4066
|
"label",
|
|
4067
4067
|
{
|
|
4068
4068
|
className: `
|
|
4069
4069
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
4070
|
-
${y[D.id] ===
|
|
4070
|
+
${y[D.id] === Z ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
4071
4071
|
`,
|
|
4072
4072
|
children: [
|
|
4073
4073
|
/* @__PURE__ */ a(
|
|
@@ -4075,14 +4075,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4075
4075
|
{
|
|
4076
4076
|
type: "radio",
|
|
4077
4077
|
name: `question-${D.id}`,
|
|
4078
|
-
value:
|
|
4079
|
-
checked: y[D.id] ===
|
|
4078
|
+
value: Z,
|
|
4079
|
+
checked: y[D.id] === Z,
|
|
4080
4080
|
onChange: (de) => A(D.id, de.target.value),
|
|
4081
4081
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4082
4082
|
disabled: d
|
|
4083
4083
|
}
|
|
4084
4084
|
),
|
|
4085
|
-
/* @__PURE__ */ a("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children:
|
|
4085
|
+
/* @__PURE__ */ a("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: Z })
|
|
4086
4086
|
]
|
|
4087
4087
|
},
|
|
4088
4088
|
j
|
|
@@ -4167,13 +4167,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4167
4167
|
)
|
|
4168
4168
|
] })
|
|
4169
4169
|
] });
|
|
4170
|
-
},
|
|
4170
|
+
}, Er = ({
|
|
4171
4171
|
applicantId: e,
|
|
4172
4172
|
onComplete: t,
|
|
4173
4173
|
onBack: r
|
|
4174
4174
|
}) => {
|
|
4175
|
-
var
|
|
4176
|
-
const { applicantService: n, baseInformationService: s, config: l } = me(), { identityData: o, provider: c, token: d, isLoading: u, error: w, requestIdentity: N, restartIdentity: y } =
|
|
4175
|
+
var Z, j, de, Re;
|
|
4176
|
+
const { applicantService: n, baseInformationService: s, config: l } = me(), { identityData: o, provider: c, token: d, isLoading: u, error: w, requestIdentity: N, restartIdentity: y } = tr(e), [h, g] = b(null), [k, x] = b(null), [m, R] = b([]), [S, v] = b(!0), [K, V] = b(!1), [M, f] = b(null), [A, F] = b(!1), Q = pe.useRef(!1), H = st({
|
|
4177
4177
|
defaultValues: {
|
|
4178
4178
|
street: "",
|
|
4179
4179
|
streetNumber: "",
|
|
@@ -4187,14 +4187,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4187
4187
|
ee(() => {
|
|
4188
4188
|
(async () => {
|
|
4189
4189
|
try {
|
|
4190
|
-
const [P,
|
|
4190
|
+
const [P, te] = await Promise.all([
|
|
4191
4191
|
n.getApplicantData(e),
|
|
4192
4192
|
s.getCountries("", "en")
|
|
4193
4193
|
]);
|
|
4194
4194
|
x(P);
|
|
4195
|
-
const
|
|
4195
|
+
const J = /* @__PURE__ */ new Set(), se = te.filter((p) => {
|
|
4196
4196
|
const L = p.abbreviation3 || p.abbreviation;
|
|
4197
|
-
return !L ||
|
|
4197
|
+
return !L || J.has(L) ? !1 : (J.add(L), !0);
|
|
4198
4198
|
});
|
|
4199
4199
|
R(se);
|
|
4200
4200
|
const U = P.applicantRequestData;
|
|
@@ -4206,10 +4206,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4206
4206
|
country: (U == null ? void 0 : U.country) || "",
|
|
4207
4207
|
nationality: (U == null ? void 0 : U.nationality) || "",
|
|
4208
4208
|
phonenumber: (U == null ? void 0 : U.phonenumber) || ""
|
|
4209
|
-
}), P.kycRecords && P.kycRecords.length > 0 && P.kycRecords[0].providerTokenObject !== null && !
|
|
4210
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
4209
|
+
}), P.kycRecords && P.kycRecords.length > 0 && P.kycRecords[0].providerTokenObject !== null && !Q.current) {
|
|
4210
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), Q.current = !0;
|
|
4211
4211
|
try {
|
|
4212
|
-
await N(),
|
|
4212
|
+
await N(), V(!0);
|
|
4213
4213
|
} catch (p) {
|
|
4214
4214
|
console.error("[Identity] Auto-request failed:", p);
|
|
4215
4215
|
}
|
|
@@ -4221,7 +4221,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4221
4221
|
}
|
|
4222
4222
|
})();
|
|
4223
4223
|
}, [e]), ee(() => {
|
|
4224
|
-
o && !K && (console.log("[Identity] Identity data already loaded, showing provider"),
|
|
4224
|
+
o && !K && (console.log("[Identity] Identity data already loaded, showing provider"), V(!0));
|
|
4225
4225
|
}, [o, K]), ee(() => {
|
|
4226
4226
|
if (d) {
|
|
4227
4227
|
if (d.expiresAt) {
|
|
@@ -4258,8 +4258,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4258
4258
|
const P = Ee.parseProviderConfig(c, d, l);
|
|
4259
4259
|
Ee.createProvider(c, P).initialize().then(() => {
|
|
4260
4260
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4261
|
-
}).catch((
|
|
4262
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
4261
|
+
}).catch((J) => {
|
|
4262
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", J);
|
|
4263
4263
|
});
|
|
4264
4264
|
} catch (P) {
|
|
4265
4265
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", P);
|
|
@@ -4274,16 +4274,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4274
4274
|
if (T === he.SardinAI) {
|
|
4275
4275
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
|
|
4276
4276
|
try {
|
|
4277
|
-
const P = Ee.parseProviderConfig(c, d, l),
|
|
4278
|
-
|
|
4279
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), g(
|
|
4277
|
+
const P = Ee.parseProviderConfig(c, d, l), te = Ee.createProvider(c, P);
|
|
4278
|
+
te.initialize().then(() => {
|
|
4279
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), g(te), setTimeout(() => {
|
|
4280
4280
|
t == null || t();
|
|
4281
4281
|
}, 2e3);
|
|
4282
|
-
}).catch((
|
|
4282
|
+
}).catch((J) => {
|
|
4283
4283
|
var U;
|
|
4284
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4285
|
-
const se = ((U =
|
|
4286
|
-
se.includes("expired") || se.includes("invalid") || se.includes("401") || se.includes("400") ? (F(!0), f("Session expired or invalid. Please restart verification.")) : f(`Failed to initialize: ${
|
|
4284
|
+
console.error("[SardinAI] Failed to initialize:", J);
|
|
4285
|
+
const se = ((U = J.message) == null ? void 0 : U.toLowerCase()) || "";
|
|
4286
|
+
se.includes("expired") || se.includes("invalid") || se.includes("401") || se.includes("400") ? (F(!0), f("Session expired or invalid. Please restart verification.")) : f(`Failed to initialize: ${J.message}`);
|
|
4287
4287
|
});
|
|
4288
4288
|
} catch (P) {
|
|
4289
4289
|
console.error("[SardinAI] Error creating provider:", P), f(`Configuration error: ${P.message}`);
|
|
@@ -4292,15 +4292,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4292
4292
|
}
|
|
4293
4293
|
try {
|
|
4294
4294
|
f(null);
|
|
4295
|
-
const P = Ee.parseProviderConfig(c, d, l),
|
|
4296
|
-
T === he.Sumsub ? (
|
|
4295
|
+
const P = Ee.parseProviderConfig(c, d, l), te = Ee.createProvider(c, P);
|
|
4296
|
+
T === he.Sumsub ? (te.initialize("identity-container").catch((J) => {
|
|
4297
4297
|
var se;
|
|
4298
|
-
console.error("[Sumsub] Initialization error:",
|
|
4299
|
-
}),
|
|
4298
|
+
console.error("[Sumsub] Initialization error:", J), f(`Failed to initialize: ${J.message}`), (se = J.message) != null && se.toLowerCase().includes("expired") && F(!0);
|
|
4299
|
+
}), te.onComplete && te.onComplete(() => {
|
|
4300
4300
|
t == null || t();
|
|
4301
|
-
})) : T === he.Onfido &&
|
|
4302
|
-
console.error("[Onfido] Initialization error:",
|
|
4303
|
-
}), g(
|
|
4301
|
+
})) : T === he.Onfido && te.initialize("identity-container").catch((J) => {
|
|
4302
|
+
console.error("[Onfido] Initialization error:", J), f(`Failed to initialize: ${J.message}`);
|
|
4303
|
+
}), g(te);
|
|
4304
4304
|
} catch (P) {
|
|
4305
4305
|
console.error("[Identity] Provider setup error:", P), f(`Setup error: ${P.message}`);
|
|
4306
4306
|
}
|
|
@@ -4316,13 +4316,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4316
4316
|
}, [c, d, h, K, t, A]);
|
|
4317
4317
|
const D = async () => {
|
|
4318
4318
|
try {
|
|
4319
|
-
f(null), F(!1), await N(),
|
|
4319
|
+
f(null), F(!1), await N(), V(!0);
|
|
4320
4320
|
} catch (T) {
|
|
4321
4321
|
console.error("Error starting identity verification:", T);
|
|
4322
4322
|
}
|
|
4323
4323
|
}, I = async () => {
|
|
4324
4324
|
try {
|
|
4325
|
-
f(null), F(!1), g(null), console.log("[Identity] Restarting verification..."), await y(),
|
|
4325
|
+
f(null), F(!1), g(null), console.log("[Identity] Restarting verification..."), await y(), V(!0);
|
|
4326
4326
|
} catch (T) {
|
|
4327
4327
|
console.error("Error restarting identity verification:", T), f(T.message || "Failed to restart verification");
|
|
4328
4328
|
}
|
|
@@ -4412,12 +4412,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4412
4412
|
allow: "camera; microphone; geolocation",
|
|
4413
4413
|
title: "Identity Verification",
|
|
4414
4414
|
onLoad: (P) => {
|
|
4415
|
-
var
|
|
4415
|
+
var te, J, se;
|
|
4416
4416
|
console.log("[Identity] Iframe loaded");
|
|
4417
4417
|
try {
|
|
4418
|
-
const U = P.target, Ae = U.contentDocument || ((
|
|
4418
|
+
const U = P.target, Ae = U.contentDocument || ((te = U.contentWindow) == null ? void 0 : te.document);
|
|
4419
4419
|
if (Ae) {
|
|
4420
|
-
const p = ((se = (
|
|
4420
|
+
const p = ((se = (J = Ae.body) == null ? void 0 : J.textContent) == null ? void 0 : se.toLowerCase()) || "";
|
|
4421
4421
|
(p.includes("expired") || p.includes("invalid") || p.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), F(!0), f("Your verification link has expired."));
|
|
4422
4422
|
}
|
|
4423
4423
|
} catch {
|
|
@@ -4457,7 +4457,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4457
4457
|
/* @__PURE__ */ i("div", { children: [
|
|
4458
4458
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4459
4459
|
/* @__PURE__ */ i("p", { className: "mt-1 text-base", children: [
|
|
4460
|
-
(
|
|
4460
|
+
(Z = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : Z.firstName,
|
|
4461
4461
|
" ",
|
|
4462
4462
|
(j = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : j.lastName
|
|
4463
4463
|
] })
|
|
@@ -4568,7 +4568,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4568
4568
|
/* @__PURE__ */ a(q, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4569
4569
|
] })
|
|
4570
4570
|
] }) });
|
|
4571
|
-
},
|
|
4571
|
+
}, Ye = ({
|
|
4572
4572
|
kycStatus: e,
|
|
4573
4573
|
reviewStatus: t,
|
|
4574
4574
|
workflowResult: r,
|
|
@@ -4618,21 +4618,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4618
4618
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4619
4619
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4620
4620
|
message: "Your application is currently under manual review."
|
|
4621
|
-
} : r ===
|
|
4621
|
+
} : r === Me.Success ? {
|
|
4622
4622
|
type: "success",
|
|
4623
4623
|
title: "Process Complete",
|
|
4624
4624
|
icon: "✓",
|
|
4625
4625
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4626
4626
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4627
4627
|
message: "Your verification process has been completed successfully."
|
|
4628
|
-
} : r ===
|
|
4628
|
+
} : r === Me.Failed ? {
|
|
4629
4629
|
type: "error",
|
|
4630
4630
|
title: "Process Failed",
|
|
4631
4631
|
icon: "✕",
|
|
4632
4632
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4633
4633
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4634
4634
|
message: "The verification process could not be completed."
|
|
4635
|
-
} : r ===
|
|
4635
|
+
} : r === Me.AdminReview ? {
|
|
4636
4636
|
type: "pending",
|
|
4637
4637
|
title: "Admin Review Required",
|
|
4638
4638
|
icon: "📋",
|
|
@@ -4703,14 +4703,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4703
4703
|
] }),
|
|
4704
4704
|
/* @__PURE__ */ i(ce, { className: "flex justify-center gap-4", children: [
|
|
4705
4705
|
c.type === "success" && s && /* @__PURE__ */ a(q, { onClick: s, size: "lg", children: "Continue" }),
|
|
4706
|
-
c.type === "error" && /* @__PURE__ */ i(
|
|
4706
|
+
c.type === "error" && /* @__PURE__ */ i(nt, { children: [
|
|
4707
4707
|
l && /* @__PURE__ */ a(q, { variant: "outline", onClick: l, children: "Contact Support" }),
|
|
4708
4708
|
s && /* @__PURE__ */ a(q, { onClick: s, children: "Try Again" })
|
|
4709
4709
|
] }),
|
|
4710
4710
|
c.type === "pending" && /* @__PURE__ */ a("div", { className: "text-center", children: /* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
4711
4711
|
] })
|
|
4712
4712
|
] });
|
|
4713
|
-
},
|
|
4713
|
+
}, Ir = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ a("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ a(
|
|
4714
4714
|
"img",
|
|
4715
4715
|
{
|
|
4716
4716
|
src: e.url,
|
|
@@ -4725,7 +4725,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4725
4725
|
console.warn("[Logo] Failed to load logo:", e.url), r.target.style.display = "none";
|
|
4726
4726
|
}
|
|
4727
4727
|
}
|
|
4728
|
-
) }),
|
|
4728
|
+
) }), qe = ({
|
|
4729
4729
|
title: e,
|
|
4730
4730
|
subtitle: t,
|
|
4731
4731
|
className: r = ""
|
|
@@ -4733,7 +4733,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4733
4733
|
const { currentTheme: n } = me(), s = e || (n == null ? void 0 : n.title) || "", l = !!(n != null && n.logo && n.logo.visible && n.logo.url), o = !!s;
|
|
4734
4734
|
return !l && !o ? null : /* @__PURE__ */ i("div", { className: `metakyc-header ${r}`, children: [
|
|
4735
4735
|
/* @__PURE__ */ i("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4736
|
-
l && /* @__PURE__ */ a(
|
|
4736
|
+
l && /* @__PURE__ */ a(Ir, { config: n.logo }),
|
|
4737
4737
|
l && o && /* @__PURE__ */ a(
|
|
4738
4738
|
"span",
|
|
4739
4739
|
{
|
|
@@ -4746,18 +4746,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4746
4746
|
] }),
|
|
4747
4747
|
t && /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
4748
4748
|
] });
|
|
4749
|
-
},
|
|
4750
|
-
function
|
|
4749
|
+
}, ze = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
4750
|
+
function Ue(e) {
|
|
4751
4751
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4752
4752
|
}
|
|
4753
|
-
const
|
|
4753
|
+
const Yr = ({
|
|
4754
4754
|
workflowKey: e,
|
|
4755
4755
|
externalRefId: t,
|
|
4756
4756
|
onSuccess: r,
|
|
4757
4757
|
onCancel: n
|
|
4758
4758
|
}) => {
|
|
4759
4759
|
var se, U, Ae;
|
|
4760
|
-
const { config: s, baseInformationService: l, currentTheme: o } = me(), { createApplicant: c, isLoading: d } =
|
|
4760
|
+
const { config: s, baseInformationService: l, currentTheme: o } = me(), { createApplicant: c, isLoading: d } = ar(), u = e || ((se = s.applicantForm) == null ? void 0 : se.workflowKey);
|
|
4761
4761
|
if (!u)
|
|
4762
4762
|
throw new Error(
|
|
4763
4763
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
@@ -4784,7 +4784,7 @@ const Hr = ({
|
|
|
4784
4784
|
() => o != null && o.applicantFormPages && o.applicantFormPages.length > 0 ? o.applicantFormPages : null,
|
|
4785
4785
|
[o == null ? void 0 : o.applicantFormPages]
|
|
4786
4786
|
), R = Ce(() => {
|
|
4787
|
-
const p = new Set(
|
|
4787
|
+
const p = new Set(ze), L = o == null ? void 0 : o.applicantFormRequiredFields;
|
|
4788
4788
|
if (L) for (const C of L) p.add(C);
|
|
4789
4789
|
if (m)
|
|
4790
4790
|
for (const C of m)
|
|
@@ -4795,13 +4795,13 @@ const Hr = ({
|
|
|
4795
4795
|
var C;
|
|
4796
4796
|
if (m) {
|
|
4797
4797
|
const E = m.flatMap((B) => B.fields).filter((B) => !B.isCustom && B.name).map((B) => B.name), z = new Set(E);
|
|
4798
|
-
for (const B of
|
|
4798
|
+
for (const B of ze) z.add(B);
|
|
4799
4799
|
return Array.from(z);
|
|
4800
4800
|
}
|
|
4801
4801
|
let p;
|
|
4802
|
-
(C = s.applicantForm) != null && C.visibleFields ? p = s.applicantForm.visibleFields : o != null && o.applicantFormVisibleFields && o.applicantFormVisibleFields.length > 0 ? p = o.applicantFormVisibleFields : p =
|
|
4802
|
+
(C = s.applicantForm) != null && C.visibleFields ? p = s.applicantForm.visibleFields : o != null && o.applicantFormVisibleFields && o.applicantFormVisibleFields.length > 0 ? p = o.applicantFormVisibleFields : p = ft;
|
|
4803
4803
|
const L = new Set(p);
|
|
4804
|
-
for (const E of
|
|
4804
|
+
for (const E of ze) L.add(E);
|
|
4805
4805
|
return Array.from(L);
|
|
4806
4806
|
}, [(Ae = s.applicantForm) == null ? void 0 : Ae.visibleFields, o == null ? void 0 : o.applicantFormVisibleFields, m]), [v, K] = b({
|
|
4807
4807
|
workflowKey: u,
|
|
@@ -4828,19 +4828,19 @@ const Hr = ({
|
|
|
4828
4828
|
educationLevel: "",
|
|
4829
4829
|
occupation: "",
|
|
4830
4830
|
taxNumber: ""
|
|
4831
|
-
}), [
|
|
4831
|
+
}), [V, M] = b({}), [f, A] = b(0), [F, Q] = b({}), [H, D] = b(null), [I, Z] = b(!1), j = (p, L) => K((C) => ({ ...C, [p]: L })), de = (p, L) => M((C) => ({ ...C, [p]: L })), Re = (p) => {
|
|
4832
4832
|
var C;
|
|
4833
4833
|
const L = {};
|
|
4834
4834
|
for (const E of p.fields)
|
|
4835
4835
|
if (E.isCustom) {
|
|
4836
4836
|
if (E.required && E.paramName) {
|
|
4837
|
-
const z =
|
|
4837
|
+
const z = V[E.paramName];
|
|
4838
4838
|
E.customType === "checkbox" || E.customType === "link_checkbox" ? z !== "true" && (L[E.paramName] = `${E.label || E.paramName} is required.`) : (!z || z.trim() === "") && (L[E.paramName] = `${E.label || E.paramName} is required.`);
|
|
4839
4839
|
}
|
|
4840
4840
|
} else if (E.name) {
|
|
4841
4841
|
const z = E.name;
|
|
4842
|
-
if (R.includes(z) &&
|
|
4843
|
-
const B = ((C =
|
|
4842
|
+
if (R.includes(z) && Ue(v[z])) {
|
|
4843
|
+
const B = ((C = $e[z]) == null ? void 0 : C.label) || z;
|
|
4844
4844
|
L[z] = `${B} is required.`;
|
|
4845
4845
|
}
|
|
4846
4846
|
}
|
|
@@ -4850,10 +4850,10 @@ const Hr = ({
|
|
|
4850
4850
|
if (m && !p) {
|
|
4851
4851
|
const C = Re(m[f]);
|
|
4852
4852
|
if (Object.keys(C).length > 0) {
|
|
4853
|
-
|
|
4853
|
+
Q(C);
|
|
4854
4854
|
return;
|
|
4855
4855
|
}
|
|
4856
|
-
|
|
4856
|
+
Q({}), A((E) => E + 1);
|
|
4857
4857
|
return;
|
|
4858
4858
|
}
|
|
4859
4859
|
if (m) {
|
|
@@ -4861,20 +4861,20 @@ const Hr = ({
|
|
|
4861
4861
|
for (const E of m)
|
|
4862
4862
|
C = { ...C, ...Re(E) };
|
|
4863
4863
|
if (Object.keys(C).length > 0) {
|
|
4864
|
-
|
|
4864
|
+
Q(C);
|
|
4865
4865
|
return;
|
|
4866
4866
|
}
|
|
4867
4867
|
}
|
|
4868
|
-
|
|
4868
|
+
Z(!0), D(null);
|
|
4869
4869
|
try {
|
|
4870
4870
|
if (!v.externalRefId || v.externalRefId.trim() === "") {
|
|
4871
4871
|
D("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
4872
4872
|
return;
|
|
4873
4873
|
}
|
|
4874
4874
|
for (const B of R)
|
|
4875
|
-
if (
|
|
4876
|
-
const
|
|
4877
|
-
D(`${
|
|
4875
|
+
if (Ue(v[B])) {
|
|
4876
|
+
const Y = ((L = $e[B]) == null ? void 0 : L.label) || B;
|
|
4877
|
+
D(`${Y} is required.`);
|
|
4878
4878
|
return;
|
|
4879
4879
|
}
|
|
4880
4880
|
const C = {
|
|
@@ -4883,16 +4883,16 @@ const Hr = ({
|
|
|
4883
4883
|
};
|
|
4884
4884
|
S.forEach((B) => {
|
|
4885
4885
|
if (B === "externalRefId") return;
|
|
4886
|
-
const
|
|
4887
|
-
|
|
4886
|
+
const Y = v[B];
|
|
4887
|
+
Ue(Y) || (C[B] = Y);
|
|
4888
4888
|
});
|
|
4889
4889
|
const E = [];
|
|
4890
4890
|
if (m) {
|
|
4891
4891
|
for (const B of m)
|
|
4892
|
-
for (const
|
|
4893
|
-
if (
|
|
4894
|
-
const
|
|
4895
|
-
E.push({ paramName:
|
|
4892
|
+
for (const Y of B.fields)
|
|
4893
|
+
if (Y.isCustom && Y.paramName) {
|
|
4894
|
+
const Le = V[Y.paramName] ?? "";
|
|
4895
|
+
E.push({ paramName: Y.paramName, paramValue: Le });
|
|
4896
4896
|
}
|
|
4897
4897
|
}
|
|
4898
4898
|
E.length > 0 && (C.applicantAdditionalDatas = E);
|
|
@@ -4901,120 +4901,128 @@ const Hr = ({
|
|
|
4901
4901
|
} catch (C) {
|
|
4902
4902
|
console.error("Error creating applicant:", C), D(C.message || "Failed to create applicant");
|
|
4903
4903
|
} finally {
|
|
4904
|
-
|
|
4904
|
+
Z(!1);
|
|
4905
4905
|
}
|
|
4906
4906
|
}, P = (p, L) => {
|
|
4907
|
-
var
|
|
4908
|
-
const C =
|
|
4907
|
+
var Le;
|
|
4908
|
+
const C = $e[p];
|
|
4909
4909
|
if (!C) return null;
|
|
4910
|
-
const E = R.includes(p), z = F[p], B =
|
|
4910
|
+
const E = R.includes(p), z = F[p], B = p, Y = { required: E };
|
|
4911
4911
|
switch (C.type) {
|
|
4912
4912
|
case "select":
|
|
4913
4913
|
if (p === "country" || p === "nationality" || p === "taxCountry" || p === "countryOfBirth")
|
|
4914
4914
|
return /* @__PURE__ */ a(
|
|
4915
4915
|
we,
|
|
4916
4916
|
{
|
|
4917
|
-
...
|
|
4917
|
+
...Y,
|
|
4918
4918
|
label: C.label,
|
|
4919
4919
|
value: v[p] || "",
|
|
4920
|
-
onChange: (
|
|
4920
|
+
onChange: (re) => j(p, re.target.value),
|
|
4921
4921
|
options: [{ value: "", label: `Select ${C.label.toLowerCase()}...` }, ...N],
|
|
4922
4922
|
disabled: h
|
|
4923
|
-
}
|
|
4923
|
+
},
|
|
4924
|
+
B
|
|
4924
4925
|
);
|
|
4925
4926
|
if (p === "salutation")
|
|
4926
4927
|
return /* @__PURE__ */ a(
|
|
4927
4928
|
we,
|
|
4928
4929
|
{
|
|
4929
|
-
...
|
|
4930
|
+
...Y,
|
|
4930
4931
|
label: C.label,
|
|
4931
|
-
value: ((
|
|
4932
|
-
onChange: (
|
|
4932
|
+
value: ((Le = v[p]) == null ? void 0 : Le.toString()) || "",
|
|
4933
|
+
onChange: (re) => j(p, re.target.value ? Number(re.target.value) : null),
|
|
4933
4934
|
options: [
|
|
4934
4935
|
{ value: "", label: "Select salutation..." },
|
|
4935
|
-
{ value:
|
|
4936
|
-
{ value:
|
|
4937
|
-
{ value:
|
|
4936
|
+
{ value: Te.Male.toString(), label: "Male" },
|
|
4937
|
+
{ value: Te.Female.toString(), label: "Female" },
|
|
4938
|
+
{ value: Te.Other.toString(), label: "Other" }
|
|
4938
4939
|
]
|
|
4939
|
-
}
|
|
4940
|
+
},
|
|
4941
|
+
B
|
|
4940
4942
|
);
|
|
4941
4943
|
if (p === "defaultLanguage") {
|
|
4942
|
-
const
|
|
4944
|
+
const re = o != null && o.allowedLanguages && o.allowedLanguages.length > 0 ? je.filter((Oe) => o.allowedLanguages.includes(Oe.value)) : je;
|
|
4943
4945
|
return /* @__PURE__ */ a(
|
|
4944
4946
|
we,
|
|
4945
4947
|
{
|
|
4946
|
-
...
|
|
4948
|
+
...Y,
|
|
4947
4949
|
label: C.label,
|
|
4948
4950
|
value: v[p] || "",
|
|
4949
|
-
onChange: (
|
|
4950
|
-
options: [{ value: "", label: "Select language..." }, ...
|
|
4951
|
-
}
|
|
4951
|
+
onChange: (Oe) => j(p, Oe.target.value),
|
|
4952
|
+
options: [{ value: "", label: "Select language..." }, ...re]
|
|
4953
|
+
},
|
|
4954
|
+
B
|
|
4952
4955
|
);
|
|
4953
4956
|
}
|
|
4954
4957
|
return null;
|
|
4955
4958
|
case "multiselect":
|
|
4956
4959
|
return p === "otherNationality" ? /* @__PURE__ */ a(
|
|
4957
|
-
|
|
4960
|
+
nr,
|
|
4958
4961
|
{
|
|
4959
|
-
...
|
|
4962
|
+
...Y,
|
|
4960
4963
|
label: C.label,
|
|
4961
4964
|
value: v[p] || [],
|
|
4962
|
-
onChange: (
|
|
4965
|
+
onChange: (re) => j(p, re),
|
|
4963
4966
|
options: N,
|
|
4964
4967
|
placeholder: "Select other nationalities...",
|
|
4965
4968
|
disabled: h
|
|
4966
|
-
}
|
|
4969
|
+
},
|
|
4970
|
+
B
|
|
4967
4971
|
) : null;
|
|
4968
4972
|
case "date":
|
|
4969
4973
|
return /* @__PURE__ */ a(
|
|
4970
4974
|
oe,
|
|
4971
4975
|
{
|
|
4972
|
-
...
|
|
4976
|
+
...Y,
|
|
4973
4977
|
type: "date",
|
|
4974
4978
|
label: C.label,
|
|
4975
4979
|
value: v[p] || "",
|
|
4976
|
-
onChange: (
|
|
4980
|
+
onChange: (re) => j(p, re.target.value),
|
|
4977
4981
|
error: z
|
|
4978
|
-
}
|
|
4982
|
+
},
|
|
4983
|
+
B
|
|
4979
4984
|
);
|
|
4980
4985
|
case "email":
|
|
4981
4986
|
return /* @__PURE__ */ a(
|
|
4982
4987
|
oe,
|
|
4983
4988
|
{
|
|
4984
|
-
...
|
|
4989
|
+
...Y,
|
|
4985
4990
|
type: "email",
|
|
4986
4991
|
label: C.label,
|
|
4987
4992
|
value: v[p] || "",
|
|
4988
|
-
onChange: (
|
|
4993
|
+
onChange: (re) => j(p, re.target.value),
|
|
4989
4994
|
error: z
|
|
4990
|
-
}
|
|
4995
|
+
},
|
|
4996
|
+
B
|
|
4991
4997
|
);
|
|
4992
4998
|
case "tel":
|
|
4993
4999
|
return /* @__PURE__ */ a(
|
|
4994
5000
|
oe,
|
|
4995
5001
|
{
|
|
4996
|
-
...
|
|
5002
|
+
...Y,
|
|
4997
5003
|
type: "tel",
|
|
4998
5004
|
label: C.label,
|
|
4999
5005
|
value: v[p] || "",
|
|
5000
|
-
onChange: (
|
|
5006
|
+
onChange: (re) => j(p, re.target.value),
|
|
5001
5007
|
error: z
|
|
5002
|
-
}
|
|
5008
|
+
},
|
|
5009
|
+
B
|
|
5003
5010
|
);
|
|
5004
5011
|
default:
|
|
5005
5012
|
return /* @__PURE__ */ a(
|
|
5006
5013
|
oe,
|
|
5007
5014
|
{
|
|
5008
|
-
...
|
|
5015
|
+
...Y,
|
|
5009
5016
|
type: "text",
|
|
5010
5017
|
label: C.label,
|
|
5011
5018
|
value: v[p] || "",
|
|
5012
|
-
onChange: (
|
|
5019
|
+
onChange: (re) => j(p, re.target.value),
|
|
5013
5020
|
error: z
|
|
5014
|
-
}
|
|
5021
|
+
},
|
|
5022
|
+
B
|
|
5015
5023
|
);
|
|
5016
5024
|
}
|
|
5017
|
-
},
|
|
5025
|
+
}, te = (p, L) => {
|
|
5018
5026
|
if (!p.paramName) return null;
|
|
5019
5027
|
const C = F[p.paramName], E = p.label || p.paramName;
|
|
5020
5028
|
return p.customType === "checkbox" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -5028,7 +5036,7 @@ const Hr = ({
|
|
|
5028
5036
|
"input",
|
|
5029
5037
|
{
|
|
5030
5038
|
type: "checkbox",
|
|
5031
|
-
checked:
|
|
5039
|
+
checked: V[p.paramName] === "true",
|
|
5032
5040
|
onChange: (z) => de(p.paramName, z.target.checked ? "true" : "false"),
|
|
5033
5041
|
className: "h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
5034
5042
|
}
|
|
@@ -5052,7 +5060,7 @@ const Hr = ({
|
|
|
5052
5060
|
"input",
|
|
5053
5061
|
{
|
|
5054
5062
|
type: "checkbox",
|
|
5055
|
-
checked:
|
|
5063
|
+
checked: V[p.paramName] === "true",
|
|
5056
5064
|
onChange: (z) => de(p.paramName, z.target.checked ? "true" : "false"),
|
|
5057
5065
|
className: "h-4 w-4 mt-0.5 rounded border-gray-300 text-blue-600 focus:ring-blue-500 flex-shrink-0"
|
|
5058
5066
|
}
|
|
@@ -5083,16 +5091,16 @@ const Hr = ({
|
|
|
5083
5091
|
{
|
|
5084
5092
|
type: "text",
|
|
5085
5093
|
label: `${E}${p.required ? " *" : ""}`,
|
|
5086
|
-
value:
|
|
5094
|
+
value: V[p.paramName] || "",
|
|
5087
5095
|
onChange: (z) => de(p.paramName, z.target.value),
|
|
5088
5096
|
required: p.required,
|
|
5089
5097
|
error: C
|
|
5090
5098
|
},
|
|
5091
5099
|
`custom-${L}`
|
|
5092
5100
|
);
|
|
5093
|
-
},
|
|
5101
|
+
}, J = (p) => /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-4", children: p.fields.map((L, C) => {
|
|
5094
5102
|
const E = L.colSpan === 1 ? "col-span-1" : "col-span-2", z = L.isCustom ? `custom-${C}-${L.paramName}` : `builtin-${L.name}-${C}`;
|
|
5095
|
-
return /* @__PURE__ */ a("div", { className: E, children: L.isCustom ?
|
|
5103
|
+
return /* @__PURE__ */ a("div", { className: E, children: L.isCustom ? te(L, C) : P(L.name) }, z);
|
|
5096
5104
|
}) });
|
|
5097
5105
|
if (h)
|
|
5098
5106
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a(O, { children: /* @__PURE__ */ i($, { children: [
|
|
@@ -5103,7 +5111,7 @@ const Hr = ({
|
|
|
5103
5111
|
const p = m[f], L = f === 0, C = f === m.length - 1, E = m.length, z = Object.values(F);
|
|
5104
5112
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(O, { children: [
|
|
5105
5113
|
/* @__PURE__ */ a(ie, { children: /* @__PURE__ */ a(
|
|
5106
|
-
|
|
5114
|
+
qe,
|
|
5107
5115
|
{
|
|
5108
5116
|
title: p.title || "Create Applicant",
|
|
5109
5117
|
subtitle: p.subtitle || p.description || void 0
|
|
@@ -5117,16 +5125,16 @@ const Hr = ({
|
|
|
5117
5125
|
" ",
|
|
5118
5126
|
H
|
|
5119
5127
|
] }),
|
|
5120
|
-
z.map((B,
|
|
5128
|
+
z.map((B, Y) => /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: B }, Y))
|
|
5121
5129
|
] }),
|
|
5122
5130
|
E > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
5123
|
-
m.map((B,
|
|
5131
|
+
m.map((B, Y) => /* @__PURE__ */ a(
|
|
5124
5132
|
"div",
|
|
5125
5133
|
{
|
|
5126
|
-
className: `h-1.5 rounded-full transition-all ${
|
|
5127
|
-
style:
|
|
5134
|
+
className: `h-1.5 rounded-full transition-all ${Y === f ? "bg-blue-600 flex-1" : Y < f ? "bg-blue-300 w-8" : "bg-gray-200 w-8"}`,
|
|
5135
|
+
style: Y === f ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : Y < f ? { backgroundColor: "var(--metakyc-primary-light, #dbeafe)", opacity: 0.7 } : void 0
|
|
5128
5136
|
},
|
|
5129
|
-
|
|
5137
|
+
Y
|
|
5130
5138
|
)),
|
|
5131
5139
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
5132
5140
|
f + 1,
|
|
@@ -5134,7 +5142,7 @@ const Hr = ({
|
|
|
5134
5142
|
E
|
|
5135
5143
|
] })
|
|
5136
5144
|
] }),
|
|
5137
|
-
|
|
5145
|
+
J(p)
|
|
5138
5146
|
] }),
|
|
5139
5147
|
/* @__PURE__ */ i(ce, { className: "flex justify-between", children: [
|
|
5140
5148
|
/* @__PURE__ */ i("div", { children: [
|
|
@@ -5144,7 +5152,7 @@ const Hr = ({
|
|
|
5144
5152
|
type: "button",
|
|
5145
5153
|
variant: "outline",
|
|
5146
5154
|
onClick: () => {
|
|
5147
|
-
A((B) => B - 1),
|
|
5155
|
+
A((B) => B - 1), Q({});
|
|
5148
5156
|
},
|
|
5149
5157
|
disabled: I || d,
|
|
5150
5158
|
children: "Previous"
|
|
@@ -5168,7 +5176,7 @@ const Hr = ({
|
|
|
5168
5176
|
p.preventDefault(), await T(!0);
|
|
5169
5177
|
}, children: /* @__PURE__ */ i(O, { children: [
|
|
5170
5178
|
/* @__PURE__ */ a(ie, { children: /* @__PURE__ */ a(
|
|
5171
|
-
|
|
5179
|
+
qe,
|
|
5172
5180
|
{
|
|
5173
5181
|
title: "Create Applicant",
|
|
5174
5182
|
subtitle: "Please fill in the required information to begin the KYC verification process."
|
|
@@ -5187,7 +5195,7 @@ const Hr = ({
|
|
|
5187
5195
|
/* @__PURE__ */ a(q, { type: "submit", isLoading: I || d, children: "Create Applicant" })
|
|
5188
5196
|
] })
|
|
5189
5197
|
] }) }) });
|
|
5190
|
-
},
|
|
5198
|
+
}, Wr = ({
|
|
5191
5199
|
applicantId: e,
|
|
5192
5200
|
onComplete: t,
|
|
5193
5201
|
onError: r,
|
|
@@ -5205,7 +5213,7 @@ const Hr = ({
|
|
|
5205
5213
|
error: y,
|
|
5206
5214
|
moveBack: h,
|
|
5207
5215
|
refreshProgress: g
|
|
5208
|
-
} =
|
|
5216
|
+
} = Zt(e), [k, x] = pe.useState(!1);
|
|
5209
5217
|
if (pe.useEffect(() => {
|
|
5210
5218
|
y && r && r(y);
|
|
5211
5219
|
}, [y, r]), pe.useEffect(() => {
|
|
@@ -5254,7 +5262,7 @@ const Hr = ({
|
|
|
5254
5262
|
] }) }) }) });
|
|
5255
5263
|
if (l.status === ge.Finished || l.status === ge.OnHold)
|
|
5256
5264
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(
|
|
5257
|
-
|
|
5265
|
+
Ye,
|
|
5258
5266
|
{
|
|
5259
5267
|
kycStatus: l.kycStatus,
|
|
5260
5268
|
reviewStatus: l.reviewStatus,
|
|
@@ -5295,19 +5303,19 @@ const Hr = ({
|
|
|
5295
5303
|
return "";
|
|
5296
5304
|
}
|
|
5297
5305
|
}, R = () => {
|
|
5298
|
-
const v = c.filter((f) => f.visibility !== !1), K = v.findIndex((f) => f.order === o.order),
|
|
5306
|
+
const v = c.filter((f) => f.visibility !== !1), K = v.findIndex((f) => f.order === o.order), V = K >= 0 ? K + 1 : 1, M = v.length;
|
|
5299
5307
|
return /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
5300
5308
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5301
|
-
/* @__PURE__ */ a(
|
|
5309
|
+
/* @__PURE__ */ a(qe, {}),
|
|
5302
5310
|
/* @__PURE__ */ i(xe, { variant: l.status === 1 ? "info" : "success", children: [
|
|
5303
5311
|
"Step ",
|
|
5304
|
-
|
|
5312
|
+
V,
|
|
5305
5313
|
" of ",
|
|
5306
5314
|
M
|
|
5307
5315
|
] })
|
|
5308
5316
|
] }),
|
|
5309
5317
|
/* @__PURE__ */ a("div", { className: "flex items-center", children: v.map((f, A) => {
|
|
5310
|
-
const F = A < K,
|
|
5318
|
+
const F = A < K, Q = f.order === o.order;
|
|
5311
5319
|
return /* @__PURE__ */ i(pe.Fragment, { children: [
|
|
5312
5320
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
5313
5321
|
/* @__PURE__ */ a(
|
|
@@ -5315,7 +5323,7 @@ const Hr = ({
|
|
|
5315
5323
|
{
|
|
5316
5324
|
className: `
|
|
5317
5325
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5318
|
-
${F ||
|
|
5326
|
+
${F || Q ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5319
5327
|
`,
|
|
5320
5328
|
children: A + 1
|
|
5321
5329
|
}
|
|
@@ -5323,7 +5331,7 @@ const Hr = ({
|
|
|
5323
5331
|
/* @__PURE__ */ a(
|
|
5324
5332
|
"span",
|
|
5325
5333
|
{
|
|
5326
|
-
className: `ml-2 text-sm ${
|
|
5334
|
+
className: `ml-2 text-sm ${Q ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5327
5335
|
children: f.displayName || f.name || m(f.action) || `Step ${A + 1}`
|
|
5328
5336
|
}
|
|
5329
5337
|
)
|
|
@@ -5347,23 +5355,23 @@ const Hr = ({
|
|
|
5347
5355
|
};
|
|
5348
5356
|
switch (o.action) {
|
|
5349
5357
|
case _.Questionaries:
|
|
5350
|
-
return /* @__PURE__ */ a(
|
|
5358
|
+
return /* @__PURE__ */ a(yr, { ...v });
|
|
5351
5359
|
case _.UploadDocument:
|
|
5352
|
-
return /* @__PURE__ */ a(fr, { ...v });
|
|
5353
|
-
case _.Overview:
|
|
5354
5360
|
return /* @__PURE__ */ a(br, { ...v });
|
|
5361
|
+
case _.Overview:
|
|
5362
|
+
return /* @__PURE__ */ a(xr, { ...v });
|
|
5355
5363
|
case _.IdentitySdk:
|
|
5356
|
-
return /* @__PURE__ */ a(
|
|
5364
|
+
return /* @__PURE__ */ a(Er, { ...v });
|
|
5357
5365
|
case _.RiskScoring:
|
|
5358
|
-
return /* @__PURE__ */ a(
|
|
5366
|
+
return /* @__PURE__ */ a(Nr, { ...v });
|
|
5359
5367
|
case _.AdditionalData:
|
|
5360
5368
|
case _.InvestorCategorization:
|
|
5361
|
-
return /* @__PURE__ */ a(Sr, { ...v });
|
|
5362
|
-
case _.AppropriatenessTest:
|
|
5363
5369
|
return /* @__PURE__ */ a(Cr, { ...v });
|
|
5370
|
+
case _.AppropriatenessTest:
|
|
5371
|
+
return /* @__PURE__ */ a(Ar, { ...v });
|
|
5364
5372
|
case _.ManualReview:
|
|
5365
5373
|
return /* @__PURE__ */ a(
|
|
5366
|
-
|
|
5374
|
+
Ye,
|
|
5367
5375
|
{
|
|
5368
5376
|
kycStatus: l.kycStatus,
|
|
5369
5377
|
reviewStatus: l.reviewStatus,
|
|
@@ -5390,12 +5398,12 @@ const Hr = ({
|
|
|
5390
5398
|
S()
|
|
5391
5399
|
] });
|
|
5392
5400
|
};
|
|
5393
|
-
function
|
|
5401
|
+
function Qr(e) {
|
|
5394
5402
|
return be.object({
|
|
5395
5403
|
questionResults: be.any()
|
|
5396
5404
|
}).passthrough();
|
|
5397
5405
|
}
|
|
5398
|
-
function
|
|
5406
|
+
function Rr(e) {
|
|
5399
5407
|
let t = be.array(be.instanceof(File));
|
|
5400
5408
|
if (e.isRequired ? t = t.min(
|
|
5401
5409
|
1,
|
|
@@ -5417,139 +5425,139 @@ function Ir(e) {
|
|
|
5417
5425
|
}
|
|
5418
5426
|
return t;
|
|
5419
5427
|
}
|
|
5420
|
-
function
|
|
5428
|
+
function Vr(e) {
|
|
5421
5429
|
const t = {};
|
|
5422
5430
|
return e.uploadDocumentFiles.forEach((r) => {
|
|
5423
5431
|
const n = `file_${r.id}`;
|
|
5424
|
-
t[n] =
|
|
5432
|
+
t[n] = Rr(r);
|
|
5425
5433
|
}), be.object(t);
|
|
5426
5434
|
}
|
|
5427
|
-
function
|
|
5435
|
+
function Gr(e) {
|
|
5428
5436
|
return be.any();
|
|
5429
5437
|
}
|
|
5430
|
-
function
|
|
5438
|
+
function Fr(e) {
|
|
5431
5439
|
return be.string().min(1, "This question is required");
|
|
5432
5440
|
}
|
|
5433
|
-
function
|
|
5441
|
+
function Zr(e) {
|
|
5434
5442
|
const t = {};
|
|
5435
5443
|
return e.appropriatenessQuestions.forEach((r) => {
|
|
5436
5444
|
const n = `question_${r.id}`;
|
|
5437
|
-
t[n] =
|
|
5445
|
+
t[n] = Fr();
|
|
5438
5446
|
}), be.object(t);
|
|
5439
5447
|
}
|
|
5440
|
-
const
|
|
5448
|
+
const Jr = be.any();
|
|
5441
5449
|
export {
|
|
5442
|
-
|
|
5443
|
-
|
|
5450
|
+
je as ALLOWED_LANGUAGES,
|
|
5451
|
+
it as ApplicantProgressOnHoldReason,
|
|
5444
5452
|
ge as ApplicantProgressStatus,
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5453
|
+
wt as ApplicantService,
|
|
5454
|
+
ot as ApplicantStatus,
|
|
5455
|
+
pt as AppropriatenessQuestionType,
|
|
5456
|
+
St as AppropriatenessTestService,
|
|
5457
|
+
Ar as AppropriatenessTestStep,
|
|
5450
5458
|
xe as Badge,
|
|
5451
|
-
|
|
5459
|
+
It as BaseInformationService,
|
|
5452
5460
|
q as Button,
|
|
5453
5461
|
O as Card,
|
|
5454
5462
|
$ as CardContent,
|
|
5455
5463
|
ce as CardFooter,
|
|
5456
5464
|
ie as CardHeader,
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5465
|
+
Yr as CreateApplicantForm,
|
|
5466
|
+
gt as CriteriaBuiltInType,
|
|
5467
|
+
ft as DEFAULT_VISIBLE_FIELDS,
|
|
5468
|
+
mt as DocumentReviewStatus,
|
|
5469
|
+
xt as EndpointBuilder,
|
|
5462
5470
|
Fe as ErrorHandler,
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5471
|
+
$t as EventEmitter,
|
|
5472
|
+
$e as FIELD_METADATA,
|
|
5473
|
+
ut as FileType,
|
|
5474
|
+
sr as FileUpload,
|
|
5475
|
+
Te as GenderType,
|
|
5476
|
+
qe as Header,
|
|
5477
|
+
vt as HttpClient,
|
|
5470
5478
|
Ee as IdentityProviderManager,
|
|
5471
|
-
|
|
5479
|
+
Et as IdentityService,
|
|
5472
5480
|
he as IdentityVerificationProvider,
|
|
5473
|
-
|
|
5481
|
+
Er as IdentityVerificationStep,
|
|
5474
5482
|
oe as Input,
|
|
5475
|
-
|
|
5476
|
-
|
|
5483
|
+
Rt as InvestorCategorizationService,
|
|
5484
|
+
Cr as InvestorCategorizationStep,
|
|
5477
5485
|
ue as InvestorCategorizationType,
|
|
5478
|
-
|
|
5479
|
-
|
|
5486
|
+
yt as InvestorCategoryType,
|
|
5487
|
+
ct as KycProcessStatus,
|
|
5480
5488
|
Ne as KycStatus,
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5489
|
+
Ye as KycStatusDisplay,
|
|
5490
|
+
Wr as KycWorkflow,
|
|
5491
|
+
Ir as Logo,
|
|
5492
|
+
Qe as MetaKYCContext,
|
|
5485
5493
|
fe as MetaKYCError,
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
+
zr as MetaKYCProvider,
|
|
5495
|
+
nr as MultiSelect,
|
|
5496
|
+
qt as OnfidoProvider,
|
|
5497
|
+
Ct as OverviewService,
|
|
5498
|
+
xr as OverviewStep,
|
|
5499
|
+
ir as PhoneInput,
|
|
5500
|
+
kt as QuestionnaireService,
|
|
5501
|
+
yr as QuestionnaireStep,
|
|
5494
5502
|
Se as ReviewStatus,
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5503
|
+
ht as RiskCriteriaType,
|
|
5504
|
+
lt as RiskLevel,
|
|
5505
|
+
At as RiskScoringService,
|
|
5506
|
+
Nr as RiskScoringStep,
|
|
5507
|
+
Kt as SardinAIProvider,
|
|
5500
5508
|
we as Select,
|
|
5501
5509
|
ye as Spinner,
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5510
|
+
zt as StepRouter,
|
|
5511
|
+
_t as SumsubProvider,
|
|
5512
|
+
jt as ThemeManager,
|
|
5505
5513
|
ae as ThemePreset,
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5514
|
+
Ot as ThemeService,
|
|
5515
|
+
Nt as UploadDocumentService,
|
|
5516
|
+
br as UploadDocumentStep,
|
|
5517
|
+
dt as UserType,
|
|
5510
5518
|
ve as ValueDataType,
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5519
|
+
Ut as WorkflowOrchestrator,
|
|
5520
|
+
Me as WorkflowResultType,
|
|
5521
|
+
Bt as WorkflowState,
|
|
5514
5522
|
_ as WorkflowStepAction,
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5523
|
+
Jr as appropriatenessTestSchema,
|
|
5524
|
+
jr as clearAllStorage,
|
|
5525
|
+
Qt as clearApplicantId,
|
|
5526
|
+
Gt as clearWorkflowState,
|
|
5519
5527
|
ne as cn,
|
|
5520
|
-
|
|
5521
|
-
|
|
5528
|
+
Ft as corporateTheme,
|
|
5529
|
+
bt as defaultConfig,
|
|
5522
5530
|
le as defaultTheme,
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5531
|
+
Ht as fileToBase64,
|
|
5532
|
+
Dt as fintechTheme,
|
|
5533
|
+
Be as formatFileSize,
|
|
5534
|
+
Zr as generateAppropriatenessSchema,
|
|
5535
|
+
Qr as generateQuestionnaireSchema,
|
|
5536
|
+
Gr as generateRiskScoringSchema,
|
|
5537
|
+
Vr as generateUploadDocumentSchema,
|
|
5538
|
+
qr as getAcceptString,
|
|
5539
|
+
Wt as getApplicantId,
|
|
5532
5540
|
De as getThemePreset,
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5541
|
+
Kr as getWorkflowState,
|
|
5542
|
+
Pt as healthcareTheme,
|
|
5543
|
+
$r as isScriptLoaded,
|
|
5544
|
+
We as loadScript,
|
|
5545
|
+
Mt as minimalTheme,
|
|
5546
|
+
Lt as modernTheme,
|
|
5547
|
+
Br as removeScript,
|
|
5548
|
+
Yt as saveApplicantId,
|
|
5549
|
+
Vt as saveWorkflowState,
|
|
5550
|
+
Tt as themePresets,
|
|
5551
|
+
ar as useApplicant,
|
|
5552
|
+
Hr as useAppropriatenessTest,
|
|
5553
|
+
tr as useIdentityVerification,
|
|
5554
|
+
Zt as useKycWorkflow,
|
|
5547
5555
|
me as useMetaKYC,
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5556
|
+
er as useOverview,
|
|
5557
|
+
Jt as useQuestionnaire,
|
|
5558
|
+
rr as useRiskScoring,
|
|
5559
|
+
Xt as useUploadDocument,
|
|
5560
|
+
Ur as validateFileSize,
|
|
5561
|
+
_r as validateFileType
|
|
5554
5562
|
};
|
|
5555
5563
|
//# sourceMappingURL=index.js.map
|