@vpdev2/metakyc-sdk 1.0.36 → 1.0.37
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/steps/QuestionnaireStep.d.ts.map +1 -1
- package/dist/components/steps/RiskScoringStep.d.ts.map +1 -1
- package/dist/hooks/useQuestionnaire.d.ts +3 -0
- package/dist/hooks/useQuestionnaire.d.ts.map +1 -1
- package/dist/hooks/useRiskScoring.d.ts +3 -0
- package/dist/hooks/useRiskScoring.d.ts.map +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +903 -868
- package/dist/index.js.map +1 -1
- package/dist/types/applicant.d.ts +26 -2
- package/dist/types/applicant.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var je = (e, t, r) => t in e ?
|
|
3
|
-
var
|
|
4
|
-
import
|
|
1
|
+
var qe = Object.defineProperty;
|
|
2
|
+
var je = (e, t, r) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var j = (e, t, r) => je(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import He from "axios";
|
|
5
5
|
import * as Fe from "react";
|
|
6
|
-
import
|
|
6
|
+
import te, { createContext as Ye, useState as v, useMemo as Ae, useEffect as G, useContext as We, useRef as Q, useCallback as K, forwardRef as Ne, createElement as De } from "react";
|
|
7
7
|
import { jsx as a, jsxs as o, Fragment as Qe } from "react/jsx-runtime";
|
|
8
8
|
import { useForm as Ve, Controller as ye } from "react-hook-form";
|
|
9
9
|
import { z as ue } from "zod";
|
|
10
|
-
var
|
|
10
|
+
var z = /* @__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))(z || {}), Se = /* @__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))(Se || {}), le = /* @__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))(le || {}), Ge = /* @__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))(Ge || {}), Ze = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Ze || {}), fe = /* @__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))(fe || {}), be = /* @__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))(be || {}), Je = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Je || {}), Xe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Xe || {}), oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(oe || {}), et = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(et || {}), Ce = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ce || {}), tt = /* @__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))(tt || {}), rt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(rt || {}), at = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(at || {}), he = /* @__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))(he || {}), nt = /* @__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))(nt || {}), st = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(st || {}), ae = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(ae || {}), it = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(it || {});
|
|
11
11
|
const Le = [
|
|
12
12
|
{ value: "EN", label: "English" },
|
|
13
13
|
{ value: "DE", label: "German" },
|
|
@@ -141,7 +141,7 @@ class ct {
|
|
|
141
141
|
class de extends Error {
|
|
142
142
|
constructor(r, n, s, i, l) {
|
|
143
143
|
super(r);
|
|
144
|
-
|
|
144
|
+
j(this, "response");
|
|
145
145
|
this.code = n, this.details = s, this.validationErrors = i, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, de.prototype);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -197,10 +197,10 @@ class we {
|
|
|
197
197
|
}
|
|
198
198
|
class dt {
|
|
199
199
|
constructor(t) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
this.config = { ...lt, ...t }, this.endpointBuilder = new ct(this.config.endpoints), this.axiosInstance =
|
|
200
|
+
j(this, "axiosInstance");
|
|
201
|
+
j(this, "endpointBuilder");
|
|
202
|
+
j(this, "config");
|
|
203
|
+
this.config = { ...lt, ...t }, this.endpointBuilder = new ct(this.config.endpoints), this.axiosInstance = He.create({
|
|
204
204
|
baseURL: this.config.baseUrl,
|
|
205
205
|
timeout: this.config.timeout,
|
|
206
206
|
headers: {
|
|
@@ -971,7 +971,7 @@ class At {
|
|
|
971
971
|
}
|
|
972
972
|
class It {
|
|
973
973
|
constructor() {
|
|
974
|
-
|
|
974
|
+
j(this, "listeners", /* @__PURE__ */ new Map());
|
|
975
975
|
}
|
|
976
976
|
/**
|
|
977
977
|
* Subscribe to an event
|
|
@@ -1016,10 +1016,10 @@ class It {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
class Et {
|
|
1018
1018
|
constructor() {
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1019
|
+
j(this, "events", new It());
|
|
1020
|
+
j(this, "_applicantId", null);
|
|
1021
|
+
j(this, "_progress", null);
|
|
1022
|
+
j(this, "_error", null);
|
|
1023
1023
|
}
|
|
1024
1024
|
/**
|
|
1025
1025
|
* Get current applicant ID
|
|
@@ -1156,7 +1156,7 @@ class Et {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
class Rt {
|
|
1158
1158
|
constructor() {
|
|
1159
|
-
|
|
1159
|
+
j(this, "handlers", /* @__PURE__ */ new Map());
|
|
1160
1160
|
}
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Register a step handler
|
|
@@ -1182,7 +1182,7 @@ class Rt {
|
|
|
1182
1182
|
async loadStepData(t, r) {
|
|
1183
1183
|
const n = this.getHandler(t);
|
|
1184
1184
|
if (!n)
|
|
1185
|
-
throw new Error(`No handler registered for step action: ${
|
|
1185
|
+
throw new Error(`No handler registered for step action: ${z[t]}`);
|
|
1186
1186
|
return n.loadData(r);
|
|
1187
1187
|
}
|
|
1188
1188
|
/**
|
|
@@ -1191,61 +1191,61 @@ class Rt {
|
|
|
1191
1191
|
async submitStepData(t, r) {
|
|
1192
1192
|
const n = this.getHandler(t);
|
|
1193
1193
|
if (!n)
|
|
1194
|
-
throw new Error(`No handler registered for step action: ${
|
|
1194
|
+
throw new Error(`No handler registered for step action: ${z[t]}`);
|
|
1195
1195
|
return n.submitData(r);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
1198
|
class Dt {
|
|
1199
1199
|
constructor(t, r, n, s, i, l, c, d) {
|
|
1200
|
-
|
|
1201
|
-
|
|
1200
|
+
j(this, "state");
|
|
1201
|
+
j(this, "stepRouter");
|
|
1202
1202
|
this.applicantService = t, this.questionnaireService = r, this.uploadDocumentService = n, this.appropriatenessTestService = s, this.overviewService = i, this.riskScoringService = l, this.investorCategorizationService = d, this.state = new Et(), this.stepRouter = new Rt(), this.registerStepHandlers();
|
|
1203
1203
|
}
|
|
1204
1204
|
/**
|
|
1205
1205
|
* Register all step handlers
|
|
1206
1206
|
*/
|
|
1207
1207
|
registerStepHandlers() {
|
|
1208
|
-
this.stepRouter.registerHandler(
|
|
1208
|
+
this.stepRouter.registerHandler(z.Questionaries, {
|
|
1209
1209
|
loadData: (t) => this.questionnaireService.getQuestionnaire(t),
|
|
1210
1210
|
submitData: async (t) => {
|
|
1211
1211
|
await this.questionnaireService.fillQuestionnaire(t);
|
|
1212
1212
|
}
|
|
1213
|
-
}), this.stepRouter.registerHandler(
|
|
1213
|
+
}), this.stepRouter.registerHandler(z.UploadDocument, {
|
|
1214
1214
|
loadData: (t) => this.uploadDocumentService.getUploadDocument(t),
|
|
1215
1215
|
submitData: (t) => this.uploadDocumentService.fillUploadDocument(t)
|
|
1216
|
-
}), this.stepRouter.registerHandler(
|
|
1216
|
+
}), this.stepRouter.registerHandler(z.AppropriatenessTest, {
|
|
1217
1217
|
loadData: (t) => this.appropriatenessTestService.getAppropriatenessTest(t),
|
|
1218
1218
|
submitData: async (t) => {
|
|
1219
1219
|
await this.appropriatenessTestService.fillAppropriatenessTest(t);
|
|
1220
1220
|
}
|
|
1221
|
-
}), this.stepRouter.registerHandler(
|
|
1221
|
+
}), this.stepRouter.registerHandler(z.Overview, {
|
|
1222
1222
|
loadData: (t) => this.overviewService.getOverviewData(t),
|
|
1223
1223
|
submitData: (t) => this.overviewService.passOverview(t.applicantId)
|
|
1224
|
-
}), this.stepRouter.registerHandler(
|
|
1224
|
+
}), this.stepRouter.registerHandler(z.RiskScoring, {
|
|
1225
1225
|
loadData: (t) => this.riskScoringService.getRiskCriterias(t),
|
|
1226
1226
|
submitData: async (t) => {
|
|
1227
1227
|
await this.riskScoringService.submitRiskScoring(t);
|
|
1228
1228
|
}
|
|
1229
|
-
}), this.stepRouter.registerHandler(
|
|
1229
|
+
}), this.stepRouter.registerHandler(z.IdentitySdk, {
|
|
1230
1230
|
loadData: async (t) => ({
|
|
1231
1231
|
applicantId: t,
|
|
1232
1232
|
message: "Identity verification required"
|
|
1233
1233
|
}),
|
|
1234
1234
|
submitData: async () => {
|
|
1235
1235
|
}
|
|
1236
|
-
}), this.stepRouter.registerHandler(
|
|
1236
|
+
}), this.stepRouter.registerHandler(z.InvestorCategorization, {
|
|
1237
1237
|
loadData: (t) => this.investorCategorizationService.getInvestorCategorization(t),
|
|
1238
1238
|
submitData: async (t) => {
|
|
1239
1239
|
await this.investorCategorizationService.setInvestorCategorization(t);
|
|
1240
1240
|
}
|
|
1241
|
-
}), this.stepRouter.registerHandler(
|
|
1241
|
+
}), this.stepRouter.registerHandler(z.ManualReview, {
|
|
1242
1242
|
loadData: async (t) => ({
|
|
1243
1243
|
applicantId: t,
|
|
1244
1244
|
message: "Your application is under manual review"
|
|
1245
1245
|
}),
|
|
1246
1246
|
submitData: async () => {
|
|
1247
1247
|
}
|
|
1248
|
-
}), this.stepRouter.registerHandler(
|
|
1248
|
+
}), this.stepRouter.registerHandler(z.AdditionalData, {
|
|
1249
1249
|
loadData: async (t) => ({
|
|
1250
1250
|
applicantId: t,
|
|
1251
1251
|
message: "Additional data required"
|
|
@@ -1339,7 +1339,7 @@ class Dt {
|
|
|
1339
1339
|
return this.stepRouter;
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function Oe(e, t) {
|
|
1343
1343
|
return new Promise((r, n) => {
|
|
1344
1344
|
if (t && document.getElementById(t)) {
|
|
1345
1345
|
r();
|
|
@@ -1358,15 +1358,15 @@ function Rr(e) {
|
|
|
1358
1358
|
}
|
|
1359
1359
|
class Ft {
|
|
1360
1360
|
constructor(t) {
|
|
1361
|
-
|
|
1362
|
-
|
|
1361
|
+
j(this, "sdk", null);
|
|
1362
|
+
j(this, "config");
|
|
1363
1363
|
this.config = t;
|
|
1364
1364
|
}
|
|
1365
1365
|
/**
|
|
1366
1366
|
* Load Sumsub SDK
|
|
1367
1367
|
*/
|
|
1368
1368
|
async loadSDK() {
|
|
1369
|
-
await
|
|
1369
|
+
await Oe(
|
|
1370
1370
|
"https://cdn.sumsub.com/websdk/v2/production/websdk.js",
|
|
1371
1371
|
"sumsub-sdk"
|
|
1372
1372
|
);
|
|
@@ -1413,15 +1413,15 @@ class Ft {
|
|
|
1413
1413
|
}
|
|
1414
1414
|
class Lt {
|
|
1415
1415
|
constructor(t) {
|
|
1416
|
-
|
|
1417
|
-
|
|
1416
|
+
j(this, "sdk", null);
|
|
1417
|
+
j(this, "config");
|
|
1418
1418
|
this.config = t;
|
|
1419
1419
|
}
|
|
1420
1420
|
/**
|
|
1421
1421
|
* Load Onfido SDK
|
|
1422
1422
|
*/
|
|
1423
1423
|
async loadSDK() {
|
|
1424
|
-
await
|
|
1424
|
+
await Oe(
|
|
1425
1425
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1426
1426
|
"onfido-sdk"
|
|
1427
1427
|
);
|
|
@@ -1479,9 +1479,9 @@ class Lt {
|
|
|
1479
1479
|
}
|
|
1480
1480
|
class Pt {
|
|
1481
1481
|
constructor(t) {
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1482
|
+
j(this, "sardineContext", null);
|
|
1483
|
+
j(this, "config");
|
|
1484
|
+
j(this, "sessionKey");
|
|
1485
1485
|
this.config = t, this.sessionKey = t.sessionKey || this.generateSessionKey();
|
|
1486
1486
|
}
|
|
1487
1487
|
/**
|
|
@@ -1673,9 +1673,9 @@ class xe {
|
|
|
1673
1673
|
}
|
|
1674
1674
|
class Mt {
|
|
1675
1675
|
constructor(t) {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1676
|
+
j(this, "currentTheme", ee);
|
|
1677
|
+
j(this, "customStyleElement", null);
|
|
1678
|
+
j(this, "container");
|
|
1679
1679
|
this.container = t || document.documentElement;
|
|
1680
1680
|
}
|
|
1681
1681
|
/**
|
|
@@ -1796,20 +1796,20 @@ class Mt {
|
|
|
1796
1796
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
|
-
const
|
|
1800
|
-
const [r, n] = v(null), s =
|
|
1801
|
-
const d = new dt(e), u = new ut(d),
|
|
1799
|
+
const Be = Ye(null), Dr = ({ config: e, children: t }) => {
|
|
1800
|
+
const [r, n] = v(null), s = te.useRef(!1), i = te.useRef(!1), l = Ae(() => {
|
|
1801
|
+
const d = new dt(e), u = new ut(d), w = new mt(d), k = new pt(d), g = new ht(d), m = new gt(d), p = new yt(d), N = new ft(d), f = new bt(d), y = new xt(d), E = new At(d), S = new Mt();
|
|
1802
1802
|
return {
|
|
1803
1803
|
httpClient: d,
|
|
1804
1804
|
applicantService: u,
|
|
1805
|
-
questionnaireService:
|
|
1806
|
-
uploadDocumentService:
|
|
1807
|
-
appropriatenessTestService:
|
|
1808
|
-
overviewService:
|
|
1809
|
-
riskScoringService:
|
|
1805
|
+
questionnaireService: w,
|
|
1806
|
+
uploadDocumentService: k,
|
|
1807
|
+
appropriatenessTestService: g,
|
|
1808
|
+
overviewService: m,
|
|
1809
|
+
riskScoringService: p,
|
|
1810
1810
|
identityService: N,
|
|
1811
|
-
baseInformationService:
|
|
1812
|
-
investorCategorizationService:
|
|
1811
|
+
baseInformationService: f,
|
|
1812
|
+
investorCategorizationService: y,
|
|
1813
1813
|
themeService: E,
|
|
1814
1814
|
themeManager: S
|
|
1815
1815
|
};
|
|
@@ -1828,7 +1828,7 @@ const Oe = Ye(null), Dr = ({ config: e, children: t }) => {
|
|
|
1828
1828
|
l.investorCategorizationService
|
|
1829
1829
|
)
|
|
1830
1830
|
}), [e, l, r]);
|
|
1831
|
-
return
|
|
1831
|
+
return G(() => ((async () => {
|
|
1832
1832
|
if (s.current || i.current) {
|
|
1833
1833
|
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
1834
1834
|
return;
|
|
@@ -1849,10 +1849,10 @@ const Oe = Ye(null), Dr = ({ config: e, children: t }) => {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
})(), () => {
|
|
1851
1851
|
l.themeManager.cleanup();
|
|
1852
|
-
}), []), /* @__PURE__ */ a(
|
|
1852
|
+
}), []), /* @__PURE__ */ a(Be.Provider, { value: c, children: t });
|
|
1853
1853
|
};
|
|
1854
|
-
function
|
|
1855
|
-
const e = We(
|
|
1854
|
+
function ie() {
|
|
1855
|
+
const e = We(Be);
|
|
1856
1856
|
if (!e)
|
|
1857
1857
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
1858
1858
|
return e;
|
|
@@ -1893,14 +1893,14 @@ const ve = {
|
|
|
1893
1893
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1894
1894
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1895
1895
|
};
|
|
1896
|
-
function
|
|
1896
|
+
function Ot(e) {
|
|
1897
1897
|
try {
|
|
1898
1898
|
localStorage.setItem(ve.APPLICANT_ID, e.toString());
|
|
1899
1899
|
} catch (t) {
|
|
1900
1900
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
|
-
function
|
|
1903
|
+
function Bt() {
|
|
1904
1904
|
try {
|
|
1905
1905
|
const e = localStorage.getItem(ve.APPLICANT_ID);
|
|
1906
1906
|
return e ? parseInt(e, 10) : null;
|
|
@@ -1941,12 +1941,12 @@ function Tr() {
|
|
|
1941
1941
|
zt(), _t();
|
|
1942
1942
|
}
|
|
1943
1943
|
function Ut(e) {
|
|
1944
|
-
const { createOrchestrator: t } =
|
|
1945
|
-
|
|
1944
|
+
const { createOrchestrator: t } = ie(), [r, n] = v(null), [s, i] = v(!1), [l, c] = v(null), d = Q(null), u = e || Bt();
|
|
1945
|
+
G(() => {
|
|
1946
1946
|
d.current || (d.current = t());
|
|
1947
|
-
}, [t]),
|
|
1947
|
+
}, [t]), G(() => {
|
|
1948
1948
|
var S;
|
|
1949
|
-
r && u && (
|
|
1949
|
+
r && u && (Ot(u), $t({
|
|
1950
1950
|
applicantId: u,
|
|
1951
1951
|
currentStepOrder: (S = r.currentStep) == null ? void 0 : S.order,
|
|
1952
1952
|
status: r.status,
|
|
@@ -1955,43 +1955,43 @@ function Ut(e) {
|
|
|
1955
1955
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1956
1956
|
}));
|
|
1957
1957
|
}, [r, u]);
|
|
1958
|
-
const
|
|
1958
|
+
const w = Q(!1), k = Q(!1), g = K(async () => {
|
|
1959
1959
|
if (!(!u || !d.current)) {
|
|
1960
|
-
if (
|
|
1960
|
+
if (w.current) {
|
|
1961
1961
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
1962
1962
|
return;
|
|
1963
1963
|
}
|
|
1964
|
-
|
|
1964
|
+
w.current = !0, i(!0), c(null);
|
|
1965
1965
|
try {
|
|
1966
1966
|
const S = await d.current.initialize(u);
|
|
1967
|
-
n(S),
|
|
1967
|
+
n(S), k.current = !0;
|
|
1968
1968
|
} catch (S) {
|
|
1969
1969
|
c(S);
|
|
1970
1970
|
} finally {
|
|
1971
|
-
i(!1),
|
|
1971
|
+
i(!1), w.current = !1;
|
|
1972
1972
|
}
|
|
1973
1973
|
}
|
|
1974
1974
|
}, [u]);
|
|
1975
|
-
|
|
1976
|
-
u && !
|
|
1977
|
-
}, [u,
|
|
1978
|
-
const
|
|
1975
|
+
G(() => {
|
|
1976
|
+
u && !k.current && g();
|
|
1977
|
+
}, [u, g]);
|
|
1978
|
+
const m = K(async () => {
|
|
1979
1979
|
if (d.current) {
|
|
1980
|
-
if (
|
|
1980
|
+
if (w.current) {
|
|
1981
1981
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
1982
1982
|
return;
|
|
1983
1983
|
}
|
|
1984
|
-
|
|
1984
|
+
w.current = !0, i(!0), c(null);
|
|
1985
1985
|
try {
|
|
1986
1986
|
const S = await d.current.refreshProgress();
|
|
1987
1987
|
n(S);
|
|
1988
1988
|
} catch (S) {
|
|
1989
1989
|
c(S);
|
|
1990
1990
|
} finally {
|
|
1991
|
-
i(!1),
|
|
1991
|
+
i(!1), w.current = !1;
|
|
1992
1992
|
}
|
|
1993
1993
|
}
|
|
1994
|
-
}, []),
|
|
1994
|
+
}, []), p = K(async () => {
|
|
1995
1995
|
if (d.current) {
|
|
1996
1996
|
i(!0), c(null);
|
|
1997
1997
|
try {
|
|
@@ -2015,25 +2015,25 @@ function Ut(e) {
|
|
|
2015
2015
|
i(!1);
|
|
2016
2016
|
}
|
|
2017
2017
|
}
|
|
2018
|
-
}, []),
|
|
2018
|
+
}, []), f = K(async (S) => {
|
|
2019
2019
|
if (d.current) {
|
|
2020
2020
|
i(!0), c(null);
|
|
2021
2021
|
try {
|
|
2022
2022
|
await d.current.submitCurrentStep(S);
|
|
2023
|
-
const
|
|
2024
|
-
n(
|
|
2025
|
-
} catch (
|
|
2026
|
-
throw c(
|
|
2023
|
+
const C = await d.current.refreshProgress();
|
|
2024
|
+
n(C);
|
|
2025
|
+
} catch (C) {
|
|
2026
|
+
throw c(C), C;
|
|
2027
2027
|
} finally {
|
|
2028
2028
|
i(!1);
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
|
-
}, []),
|
|
2031
|
+
}, []), y = Fe.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((S, C) => S.order - C.order) : [], [r == null ? void 0 : r.stepInfoList]), E = Fe.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2032
2032
|
return {
|
|
2033
2033
|
progress: r,
|
|
2034
2034
|
applicantId: u,
|
|
2035
2035
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
2036
|
-
steps:
|
|
2036
|
+
steps: y,
|
|
2037
2037
|
status: (r == null ? void 0 : r.status) || le.None,
|
|
2038
2038
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2039
2039
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
@@ -2043,84 +2043,100 @@ function Ut(e) {
|
|
|
2043
2043
|
error: l,
|
|
2044
2044
|
isComplete: (r == null ? void 0 : r.status) === le.Finished,
|
|
2045
2045
|
isOnHold: (r == null ? void 0 : r.status) === le.OnHold,
|
|
2046
|
-
refreshProgress:
|
|
2047
|
-
moveToNext:
|
|
2046
|
+
refreshProgress: m,
|
|
2047
|
+
moveToNext: p,
|
|
2048
2048
|
moveBack: N,
|
|
2049
|
-
submitCurrentStep:
|
|
2049
|
+
submitCurrentStep: f,
|
|
2050
2050
|
orchestrator: d.current
|
|
2051
2051
|
};
|
|
2052
2052
|
}
|
|
2053
2053
|
function Kt(e) {
|
|
2054
|
-
const { questionnaireService: t } =
|
|
2054
|
+
const { questionnaireService: t, applicantService: r } = ie(), [n, s] = v(null), [i, l] = v({}), [c, d] = v(!1), [u, w] = v(!1), [k, g] = v(null), m = Q(!1), p = Q(null), N = K(async () => {
|
|
2055
|
+
var y, E;
|
|
2055
2056
|
if (e) {
|
|
2056
|
-
if (
|
|
2057
|
+
if (m.current) {
|
|
2057
2058
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
2058
2059
|
return;
|
|
2059
2060
|
}
|
|
2060
|
-
|
|
2061
|
+
m.current = !0, d(!0), g(null);
|
|
2061
2062
|
try {
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2063
|
+
const [S, C] = await Promise.all([
|
|
2064
|
+
t.getQuestionnaire(e),
|
|
2065
|
+
r.getApplicantData(e).catch(() => null)
|
|
2066
|
+
]);
|
|
2067
|
+
if (s(S), (y = C == null ? void 0 : C.questionnaireResults) != null && y.length && S) {
|
|
2068
|
+
const O = /* @__PURE__ */ new Map();
|
|
2069
|
+
for (const h of C.questionnaireResults)
|
|
2070
|
+
h.question && ((E = h.answers) != null && E.length) && O.set(h.question.trim().toLowerCase(), h.answers);
|
|
2071
|
+
const W = {}, F = S.questionGroups.flatMap((h) => h.questions ?? []);
|
|
2072
|
+
for (const h of F) {
|
|
2073
|
+
const A = h.text.trim().toLowerCase();
|
|
2074
|
+
O.has(A) && (W[h.id] = O.get(A));
|
|
2075
|
+
}
|
|
2076
|
+
l(W);
|
|
2077
|
+
}
|
|
2078
|
+
p.current = e;
|
|
2079
|
+
} catch (S) {
|
|
2080
|
+
g(S);
|
|
2066
2081
|
} finally {
|
|
2067
|
-
|
|
2082
|
+
d(!1), m.current = !1;
|
|
2068
2083
|
}
|
|
2069
2084
|
}
|
|
2070
|
-
}, [e, t]);
|
|
2071
|
-
|
|
2072
|
-
e &&
|
|
2085
|
+
}, [e, t, r]);
|
|
2086
|
+
G(() => {
|
|
2087
|
+
e && p.current !== e && N();
|
|
2073
2088
|
}, [e]);
|
|
2074
|
-
const
|
|
2075
|
-
async (
|
|
2076
|
-
|
|
2089
|
+
const f = K(
|
|
2090
|
+
async (y) => {
|
|
2091
|
+
w(!0), g(null);
|
|
2077
2092
|
try {
|
|
2078
|
-
return await t.fillQuestionnaire(
|
|
2079
|
-
} catch (
|
|
2080
|
-
throw
|
|
2093
|
+
return await t.fillQuestionnaire(y);
|
|
2094
|
+
} catch (E) {
|
|
2095
|
+
throw g(E), E;
|
|
2081
2096
|
} finally {
|
|
2082
|
-
|
|
2097
|
+
w(!1);
|
|
2083
2098
|
}
|
|
2084
2099
|
},
|
|
2085
2100
|
[t]
|
|
2086
2101
|
);
|
|
2087
2102
|
return {
|
|
2088
|
-
questionnaire:
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2103
|
+
questionnaire: n,
|
|
2104
|
+
initialAnswers: i,
|
|
2105
|
+
isLoading: c,
|
|
2106
|
+
isSubmitting: u,
|
|
2107
|
+
error: k,
|
|
2108
|
+
load: N,
|
|
2109
|
+
submit: f
|
|
2094
2110
|
};
|
|
2095
2111
|
}
|
|
2096
|
-
function
|
|
2097
|
-
const { uploadDocumentService: t } =
|
|
2112
|
+
function qt(e) {
|
|
2113
|
+
const { uploadDocumentService: t } = ie(), [r, n] = v(null), [s, i] = v(!1), [l, c] = v(!1), [d, u] = v(0), [w, k] = v(null), g = Q(!1), m = Q(null), p = K(async () => {
|
|
2098
2114
|
if (e) {
|
|
2099
|
-
if (
|
|
2115
|
+
if (g.current) {
|
|
2100
2116
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2101
2117
|
return;
|
|
2102
2118
|
}
|
|
2103
|
-
|
|
2119
|
+
g.current = !0, i(!0), k(null);
|
|
2104
2120
|
try {
|
|
2105
|
-
const
|
|
2106
|
-
n(
|
|
2107
|
-
} catch (
|
|
2108
|
-
|
|
2121
|
+
const f = await t.getUploadDocument(e);
|
|
2122
|
+
n(f), m.current = e;
|
|
2123
|
+
} catch (f) {
|
|
2124
|
+
k(f);
|
|
2109
2125
|
} finally {
|
|
2110
|
-
i(!1),
|
|
2126
|
+
i(!1), g.current = !1;
|
|
2111
2127
|
}
|
|
2112
2128
|
}
|
|
2113
2129
|
}, [e, t]);
|
|
2114
|
-
|
|
2115
|
-
e &&
|
|
2130
|
+
G(() => {
|
|
2131
|
+
e && m.current !== e && p();
|
|
2116
2132
|
}, [e]);
|
|
2117
2133
|
const N = K(
|
|
2118
|
-
async (
|
|
2119
|
-
c(!0), u(0),
|
|
2134
|
+
async (f) => {
|
|
2135
|
+
c(!0), u(0), k(null);
|
|
2120
2136
|
try {
|
|
2121
|
-
await t.fillUploadDocument(
|
|
2122
|
-
} catch (
|
|
2123
|
-
throw
|
|
2137
|
+
await t.fillUploadDocument(f), u(100);
|
|
2138
|
+
} catch (y) {
|
|
2139
|
+
throw k(y), y;
|
|
2124
2140
|
} finally {
|
|
2125
2141
|
c(!1);
|
|
2126
2142
|
}
|
|
@@ -2132,40 +2148,40 @@ function Ht(e) {
|
|
|
2132
2148
|
isLoading: s,
|
|
2133
2149
|
isSubmitting: l,
|
|
2134
2150
|
uploadProgress: d,
|
|
2135
|
-
error:
|
|
2136
|
-
load:
|
|
2151
|
+
error: w,
|
|
2152
|
+
load: p,
|
|
2137
2153
|
submit: N
|
|
2138
2154
|
};
|
|
2139
2155
|
}
|
|
2140
|
-
function
|
|
2141
|
-
const { appropriatenessTestService: t } =
|
|
2156
|
+
function Or(e) {
|
|
2157
|
+
const { appropriatenessTestService: t } = ie(), [r, n] = v(null), [s, i] = v(!1), [l, c] = v(!1), [d, u] = v(null), [w, k] = v(null), g = Q(!1), m = Q(null), p = K(async () => {
|
|
2142
2158
|
if (e) {
|
|
2143
|
-
if (
|
|
2159
|
+
if (g.current) {
|
|
2144
2160
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2145
2161
|
return;
|
|
2146
2162
|
}
|
|
2147
|
-
|
|
2163
|
+
g.current = !0, i(!0), u(null);
|
|
2148
2164
|
try {
|
|
2149
|
-
const
|
|
2150
|
-
n(
|
|
2151
|
-
} catch (
|
|
2152
|
-
u(
|
|
2165
|
+
const f = await t.getAppropriatenessTest(e);
|
|
2166
|
+
n(f), m.current = e;
|
|
2167
|
+
} catch (f) {
|
|
2168
|
+
u(f);
|
|
2153
2169
|
} finally {
|
|
2154
|
-
i(!1),
|
|
2170
|
+
i(!1), g.current = !1;
|
|
2155
2171
|
}
|
|
2156
2172
|
}
|
|
2157
2173
|
}, [e, t]);
|
|
2158
|
-
|
|
2159
|
-
e &&
|
|
2174
|
+
G(() => {
|
|
2175
|
+
e && m.current !== e && p();
|
|
2160
2176
|
}, [e]);
|
|
2161
2177
|
const N = K(
|
|
2162
|
-
async (
|
|
2178
|
+
async (f) => {
|
|
2163
2179
|
c(!0), u(null);
|
|
2164
2180
|
try {
|
|
2165
|
-
const
|
|
2166
|
-
return
|
|
2167
|
-
} catch (
|
|
2168
|
-
throw u(
|
|
2181
|
+
const y = await t.fillAppropriatenessTest(f);
|
|
2182
|
+
return k(y), y;
|
|
2183
|
+
} catch (y) {
|
|
2184
|
+
throw u(y), y;
|
|
2169
2185
|
} finally {
|
|
2170
2186
|
c(!1);
|
|
2171
2187
|
}
|
|
@@ -2174,42 +2190,42 @@ function Br(e) {
|
|
|
2174
2190
|
);
|
|
2175
2191
|
return {
|
|
2176
2192
|
test: r,
|
|
2177
|
-
result:
|
|
2193
|
+
result: w,
|
|
2178
2194
|
isLoading: s,
|
|
2179
2195
|
isSubmitting: l,
|
|
2180
2196
|
error: d,
|
|
2181
|
-
load:
|
|
2197
|
+
load: p,
|
|
2182
2198
|
submit: N
|
|
2183
2199
|
};
|
|
2184
2200
|
}
|
|
2185
2201
|
function jt(e) {
|
|
2186
|
-
const { overviewService: t } =
|
|
2202
|
+
const { overviewService: t } = ie(), [r, n] = v(null), [s, i] = v(!1), [l, c] = v(!1), [d, u] = v(null), w = Q(!1), k = Q(null), g = K(async () => {
|
|
2187
2203
|
if (e) {
|
|
2188
|
-
if (
|
|
2204
|
+
if (w.current) {
|
|
2189
2205
|
console.log("[Overview] Load already in progress, skipping...");
|
|
2190
2206
|
return;
|
|
2191
2207
|
}
|
|
2192
|
-
|
|
2208
|
+
w.current = !0, i(!0), u(null);
|
|
2193
2209
|
try {
|
|
2194
|
-
const
|
|
2195
|
-
n(
|
|
2196
|
-
} catch (
|
|
2197
|
-
u(
|
|
2210
|
+
const p = await t.getOverviewData(e);
|
|
2211
|
+
n(p), k.current = e;
|
|
2212
|
+
} catch (p) {
|
|
2213
|
+
u(p);
|
|
2198
2214
|
} finally {
|
|
2199
|
-
i(!1),
|
|
2215
|
+
i(!1), w.current = !1;
|
|
2200
2216
|
}
|
|
2201
2217
|
}
|
|
2202
2218
|
}, [e, t]);
|
|
2203
|
-
|
|
2204
|
-
e &&
|
|
2219
|
+
G(() => {
|
|
2220
|
+
e && k.current !== e && g();
|
|
2205
2221
|
}, [e]);
|
|
2206
|
-
const
|
|
2222
|
+
const m = K(async () => {
|
|
2207
2223
|
if (e) {
|
|
2208
2224
|
c(!0), u(null);
|
|
2209
2225
|
try {
|
|
2210
2226
|
await t.passOverview(e);
|
|
2211
|
-
} catch (
|
|
2212
|
-
throw u(
|
|
2227
|
+
} catch (p) {
|
|
2228
|
+
throw u(p), p;
|
|
2213
2229
|
} finally {
|
|
2214
2230
|
c(!1);
|
|
2215
2231
|
}
|
|
@@ -2220,15 +2236,15 @@ function jt(e) {
|
|
|
2220
2236
|
isLoading: s,
|
|
2221
2237
|
isSubmitting: l,
|
|
2222
2238
|
error: d,
|
|
2223
|
-
load:
|
|
2224
|
-
passOverview:
|
|
2239
|
+
load: g,
|
|
2240
|
+
passOverview: m
|
|
2225
2241
|
};
|
|
2226
2242
|
}
|
|
2227
|
-
function
|
|
2228
|
-
const { identityService: t } =
|
|
2243
|
+
function Ht(e) {
|
|
2244
|
+
const { identityService: t } = ie(), [r, n] = v(
|
|
2229
2245
|
null
|
|
2230
|
-
), [s, i] = v(!1), [l, c] = v(null), d =
|
|
2231
|
-
async (
|
|
2246
|
+
), [s, i] = v(!1), [l, c] = v(null), d = Q(!1), u = K(
|
|
2247
|
+
async (g, m) => {
|
|
2232
2248
|
if (e) {
|
|
2233
2249
|
if (d.current) {
|
|
2234
2250
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -2236,45 +2252,45 @@ function qt(e) {
|
|
|
2236
2252
|
}
|
|
2237
2253
|
d.current = !0, i(!0), c(null);
|
|
2238
2254
|
try {
|
|
2239
|
-
const
|
|
2255
|
+
const p = {
|
|
2240
2256
|
applicantId: e,
|
|
2241
2257
|
restart: !1,
|
|
2242
|
-
redirectUrl:
|
|
2243
|
-
ttl:
|
|
2258
|
+
redirectUrl: g || "",
|
|
2259
|
+
ttl: m || 604800
|
|
2244
2260
|
// Default: 7 days
|
|
2245
2261
|
};
|
|
2246
|
-
console.log("Identity request input:",
|
|
2247
|
-
const N = await t.identityRequest(
|
|
2262
|
+
console.log("Identity request input:", p);
|
|
2263
|
+
const N = await t.identityRequest(p);
|
|
2248
2264
|
return console.log("Identity request result:", N), n(N), N;
|
|
2249
|
-
} catch (
|
|
2250
|
-
throw c(
|
|
2265
|
+
} catch (p) {
|
|
2266
|
+
throw c(p), p;
|
|
2251
2267
|
} finally {
|
|
2252
2268
|
i(!1), d.current = !1;
|
|
2253
2269
|
}
|
|
2254
2270
|
}
|
|
2255
2271
|
},
|
|
2256
2272
|
[e, t]
|
|
2257
|
-
),
|
|
2258
|
-
async (
|
|
2273
|
+
), w = K(
|
|
2274
|
+
async (g, m) => {
|
|
2259
2275
|
if (e) {
|
|
2260
2276
|
i(!0), c(null);
|
|
2261
2277
|
try {
|
|
2262
|
-
const
|
|
2278
|
+
const p = {
|
|
2263
2279
|
applicantId: e,
|
|
2264
2280
|
restart: !1,
|
|
2265
|
-
redirectUrl:
|
|
2266
|
-
ttl:
|
|
2267
|
-
}, N = await t.identityCompanyRequest(
|
|
2281
|
+
redirectUrl: g,
|
|
2282
|
+
ttl: m
|
|
2283
|
+
}, N = await t.identityCompanyRequest(p);
|
|
2268
2284
|
return n(N), N;
|
|
2269
|
-
} catch (
|
|
2270
|
-
throw c(
|
|
2285
|
+
} catch (p) {
|
|
2286
|
+
throw c(p), p;
|
|
2271
2287
|
} finally {
|
|
2272
2288
|
i(!1);
|
|
2273
2289
|
}
|
|
2274
2290
|
}
|
|
2275
2291
|
},
|
|
2276
2292
|
[e, t]
|
|
2277
|
-
),
|
|
2293
|
+
), k = K(async () => {
|
|
2278
2294
|
if (e) {
|
|
2279
2295
|
if (d.current) {
|
|
2280
2296
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2282,18 +2298,18 @@ function qt(e) {
|
|
|
2282
2298
|
}
|
|
2283
2299
|
d.current = !0, i(!0), c(null);
|
|
2284
2300
|
try {
|
|
2285
|
-
const
|
|
2301
|
+
const g = {
|
|
2286
2302
|
applicantId: e,
|
|
2287
2303
|
restart: !0,
|
|
2288
2304
|
redirectUrl: "",
|
|
2289
2305
|
ttl: 604800
|
|
2290
2306
|
// 7 days
|
|
2291
2307
|
};
|
|
2292
|
-
console.log("Restarting identity with input:",
|
|
2293
|
-
const
|
|
2294
|
-
return console.log("Restart identity result:",
|
|
2295
|
-
} catch (
|
|
2296
|
-
throw c(
|
|
2308
|
+
console.log("Restarting identity with input:", g);
|
|
2309
|
+
const m = await t.identityRequest(g);
|
|
2310
|
+
return console.log("Restart identity result:", m), n(m), m;
|
|
2311
|
+
} catch (g) {
|
|
2312
|
+
throw c(g), g;
|
|
2297
2313
|
} finally {
|
|
2298
2314
|
i(!1), d.current = !1;
|
|
2299
2315
|
}
|
|
@@ -2306,74 +2322,85 @@ function qt(e) {
|
|
|
2306
2322
|
isLoading: s,
|
|
2307
2323
|
error: l,
|
|
2308
2324
|
requestIdentity: u,
|
|
2309
|
-
requestCompanyIdentity:
|
|
2310
|
-
restartIdentity:
|
|
2325
|
+
requestCompanyIdentity: w,
|
|
2326
|
+
restartIdentity: k
|
|
2311
2327
|
};
|
|
2312
2328
|
}
|
|
2313
2329
|
function Yt(e) {
|
|
2314
|
-
const { riskScoringService: t } =
|
|
2330
|
+
const { riskScoringService: t, applicantService: r } = ie(), [n, s] = v(null), [i, l] = v({}), [c, d] = v(!1), [u, w] = v(!1), [k, g] = v(null), [m, p] = v(null), N = Q(!1), f = Q(null), y = K(async () => {
|
|
2331
|
+
var S;
|
|
2315
2332
|
if (e) {
|
|
2316
|
-
if (
|
|
2333
|
+
if (N.current) {
|
|
2317
2334
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2318
2335
|
return;
|
|
2319
2336
|
}
|
|
2320
|
-
|
|
2337
|
+
N.current = !0, d(!0), g(null);
|
|
2321
2338
|
try {
|
|
2322
|
-
const
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2339
|
+
const [C, O] = await Promise.all([
|
|
2340
|
+
t.getRiskCriterias(e),
|
|
2341
|
+
r.getApplicantData(e).catch(() => null)
|
|
2342
|
+
]);
|
|
2343
|
+
if (s(C), (S = O == null ? void 0 : O.riskScoringResults) != null && S.length) {
|
|
2344
|
+
const W = O.riskScoringResults[0], F = {};
|
|
2345
|
+
for (const h of W.riskCriteriaResults ?? [])
|
|
2346
|
+
h.riskCriteriaId != null && h.answer != null && h.answer !== "" && (F[h.riskCriteriaId] = [h.answer]);
|
|
2347
|
+
l(F);
|
|
2348
|
+
}
|
|
2349
|
+
f.current = e;
|
|
2350
|
+
} catch (C) {
|
|
2351
|
+
g(C);
|
|
2326
2352
|
} finally {
|
|
2327
|
-
|
|
2353
|
+
d(!1), N.current = !1;
|
|
2328
2354
|
}
|
|
2329
2355
|
}
|
|
2330
|
-
}, [e, t]);
|
|
2331
|
-
|
|
2332
|
-
e &&
|
|
2356
|
+
}, [e, t, r]);
|
|
2357
|
+
G(() => {
|
|
2358
|
+
e && f.current !== e && y();
|
|
2333
2359
|
}, [e]);
|
|
2334
|
-
const
|
|
2335
|
-
async (
|
|
2336
|
-
|
|
2360
|
+
const E = K(
|
|
2361
|
+
async (S) => {
|
|
2362
|
+
w(!0), g(null);
|
|
2337
2363
|
try {
|
|
2338
|
-
const
|
|
2339
|
-
return
|
|
2340
|
-
} catch (
|
|
2341
|
-
throw
|
|
2364
|
+
const C = await t.submitRiskScoring(S);
|
|
2365
|
+
return p(C), C;
|
|
2366
|
+
} catch (C) {
|
|
2367
|
+
throw g(C), C;
|
|
2342
2368
|
} finally {
|
|
2343
|
-
|
|
2369
|
+
w(!1);
|
|
2344
2370
|
}
|
|
2345
2371
|
},
|
|
2346
2372
|
[t]
|
|
2347
2373
|
);
|
|
2348
2374
|
return {
|
|
2349
|
-
criteria:
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2375
|
+
criteria: n,
|
|
2376
|
+
initialAnswers: i,
|
|
2377
|
+
result: m,
|
|
2378
|
+
isLoading: c,
|
|
2379
|
+
isSubmitting: u,
|
|
2380
|
+
error: k,
|
|
2381
|
+
load: y,
|
|
2382
|
+
submit: E
|
|
2356
2383
|
};
|
|
2357
2384
|
}
|
|
2358
2385
|
function Wt() {
|
|
2359
|
-
const { applicantService: e, config: t } =
|
|
2360
|
-
const
|
|
2361
|
-
return (
|
|
2386
|
+
const { applicantService: e, config: t } = ie(), [r, n] = v(!1), [s, i] = v(null), l = Q(!1), c = Q(!1), d = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(m) {
|
|
2387
|
+
const p = Math.random() * 16 | 0;
|
|
2388
|
+
return (m === "x" ? p : p & 3 | 8).toString(16);
|
|
2362
2389
|
}), u = K(
|
|
2363
|
-
async (
|
|
2364
|
-
var
|
|
2390
|
+
async (m) => {
|
|
2391
|
+
var p;
|
|
2365
2392
|
if (l.current)
|
|
2366
2393
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2367
2394
|
l.current = !0, n(!0), i(null);
|
|
2368
2395
|
try {
|
|
2369
|
-
if (
|
|
2370
|
-
const
|
|
2371
|
-
console.log("[SardinAI] Generated session key:",
|
|
2396
|
+
if (m.applicantAdditionalDatas || (m.applicantAdditionalDatas = []), (p = t.identityProviders) != null && p.sardinai) {
|
|
2397
|
+
const f = d();
|
|
2398
|
+
console.log("[SardinAI] Generated session key:", f), m.applicantAdditionalDatas.push({
|
|
2372
2399
|
paramName: "sessionKey",
|
|
2373
|
-
value:
|
|
2400
|
+
value: f
|
|
2374
2401
|
});
|
|
2375
2402
|
}
|
|
2376
|
-
return await e.createApplicant(
|
|
2403
|
+
return await e.createApplicant(m);
|
|
2377
2404
|
} catch (N) {
|
|
2378
2405
|
throw i(N), N;
|
|
2379
2406
|
} finally {
|
|
@@ -2381,39 +2408,39 @@ function Wt() {
|
|
|
2381
2408
|
}
|
|
2382
2409
|
},
|
|
2383
2410
|
[e, t]
|
|
2384
|
-
),
|
|
2385
|
-
async (
|
|
2411
|
+
), w = K(
|
|
2412
|
+
async (m) => {
|
|
2386
2413
|
n(!0), i(null);
|
|
2387
2414
|
try {
|
|
2388
|
-
return await e.createCompanyApplicant(
|
|
2389
|
-
} catch (
|
|
2390
|
-
throw i(
|
|
2415
|
+
return await e.createCompanyApplicant(m);
|
|
2416
|
+
} catch (p) {
|
|
2417
|
+
throw i(p), p;
|
|
2391
2418
|
} finally {
|
|
2392
2419
|
n(!1);
|
|
2393
2420
|
}
|
|
2394
2421
|
},
|
|
2395
2422
|
[e]
|
|
2396
|
-
),
|
|
2397
|
-
async (
|
|
2423
|
+
), k = K(
|
|
2424
|
+
async (m) => {
|
|
2398
2425
|
if (c.current)
|
|
2399
2426
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2400
2427
|
c.current = !0, n(!0), i(null);
|
|
2401
2428
|
try {
|
|
2402
|
-
return await e.getApplicantData(
|
|
2403
|
-
} catch (
|
|
2404
|
-
throw i(
|
|
2429
|
+
return await e.getApplicantData(m);
|
|
2430
|
+
} catch (p) {
|
|
2431
|
+
throw i(p), p;
|
|
2405
2432
|
} finally {
|
|
2406
2433
|
n(!1), c.current = !1;
|
|
2407
2434
|
}
|
|
2408
2435
|
},
|
|
2409
2436
|
[e]
|
|
2410
|
-
),
|
|
2411
|
-
async (
|
|
2437
|
+
), g = K(
|
|
2438
|
+
async (m) => {
|
|
2412
2439
|
n(!0), i(null);
|
|
2413
2440
|
try {
|
|
2414
|
-
await e.stopProgress(
|
|
2415
|
-
} catch (
|
|
2416
|
-
throw i(
|
|
2441
|
+
await e.stopProgress(m);
|
|
2442
|
+
} catch (p) {
|
|
2443
|
+
throw i(p), p;
|
|
2417
2444
|
} finally {
|
|
2418
2445
|
n(!1);
|
|
2419
2446
|
}
|
|
@@ -2424,9 +2451,9 @@ function Wt() {
|
|
|
2424
2451
|
isLoading: r,
|
|
2425
2452
|
error: s,
|
|
2426
2453
|
createApplicant: u,
|
|
2427
|
-
createCompanyApplicant:
|
|
2428
|
-
getApplicantData:
|
|
2429
|
-
stopProgress:
|
|
2454
|
+
createCompanyApplicant: w,
|
|
2455
|
+
getApplicantData: k,
|
|
2456
|
+
stopProgress: g
|
|
2430
2457
|
};
|
|
2431
2458
|
}
|
|
2432
2459
|
const U = ({
|
|
@@ -2490,7 +2517,7 @@ const U = ({
|
|
|
2490
2517
|
]
|
|
2491
2518
|
}
|
|
2492
2519
|
);
|
|
2493
|
-
},
|
|
2520
|
+
}, ne = Ne(
|
|
2494
2521
|
({ label: e, error: t, helperText: r, leftIcon: n, rightIcon: s, className: i, ...l }, c) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2495
2522
|
e && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2496
2523
|
e,
|
|
@@ -2521,7 +2548,7 @@ const U = ({
|
|
|
2521
2548
|
!t && r && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2522
2549
|
] })
|
|
2523
2550
|
);
|
|
2524
|
-
|
|
2551
|
+
ne.displayName = "Input";
|
|
2525
2552
|
const M = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
2526
2553
|
"div",
|
|
2527
2554
|
{
|
|
@@ -2536,7 +2563,7 @@ const M = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2536
2563
|
...r,
|
|
2537
2564
|
children: e
|
|
2538
2565
|
}
|
|
2539
|
-
),
|
|
2566
|
+
), re = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
2540
2567
|
"div",
|
|
2541
2568
|
{
|
|
2542
2569
|
className: J("px-6 py-4 border-b", t),
|
|
@@ -2546,7 +2573,7 @@ const M = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2546
2573
|
...r,
|
|
2547
2574
|
children: e
|
|
2548
2575
|
}
|
|
2549
|
-
), T = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a("div", { className: J("px-6 py-4", t), ...r, children: e }),
|
|
2576
|
+
), T = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a("div", { className: J("px-6 py-4", t), ...r, children: e }), se = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
2550
2577
|
"div",
|
|
2551
2578
|
{
|
|
2552
2579
|
className: J("px-6 py-4 border-t", t),
|
|
@@ -2656,24 +2683,24 @@ const Qt = ({
|
|
|
2656
2683
|
disabled: i = !1,
|
|
2657
2684
|
required: l = !1
|
|
2658
2685
|
}) => {
|
|
2659
|
-
const [c, d] = v(!1), [u,
|
|
2660
|
-
|
|
2661
|
-
const
|
|
2662
|
-
|
|
2686
|
+
const [c, d] = v(!1), [u, w] = v(""), k = Q(null);
|
|
2687
|
+
G(() => {
|
|
2688
|
+
const f = (y) => {
|
|
2689
|
+
k.current && !k.current.contains(y.target) && (d(!1), w(""));
|
|
2663
2690
|
};
|
|
2664
|
-
return document.addEventListener("mousedown",
|
|
2691
|
+
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
2665
2692
|
}, []);
|
|
2666
|
-
const
|
|
2667
|
-
(
|
|
2668
|
-
),
|
|
2669
|
-
i || (t.includes(
|
|
2670
|
-
},
|
|
2671
|
-
|
|
2672
|
-
}, N = (
|
|
2673
|
-
var
|
|
2674
|
-
return ((
|
|
2693
|
+
const g = n.filter(
|
|
2694
|
+
(f) => f.label.toLowerCase().includes(u.toLowerCase())
|
|
2695
|
+
), m = (f) => {
|
|
2696
|
+
i || (t.includes(f) ? r(t.filter((y) => y !== f)) : r([...t, f]));
|
|
2697
|
+
}, p = (f, y) => {
|
|
2698
|
+
y.stopPropagation(), i || r(t.filter((E) => E !== f));
|
|
2699
|
+
}, N = (f) => {
|
|
2700
|
+
var y;
|
|
2701
|
+
return ((y = n.find((E) => E.value === f)) == null ? void 0 : y.label) || f;
|
|
2675
2702
|
};
|
|
2676
|
-
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref:
|
|
2703
|
+
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: k, children: [
|
|
2677
2704
|
e && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2678
2705
|
e,
|
|
2679
2706
|
l && /* @__PURE__ */ a("span", { className: "text-red-500 ml-1", children: "*" })
|
|
@@ -2692,17 +2719,17 @@ const Qt = ({
|
|
|
2692
2719
|
i ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
2693
2720
|
),
|
|
2694
2721
|
children: [
|
|
2695
|
-
t.length === 0 ? /* @__PURE__ */ a("span", { className: "metakyc-multiselect-placeholder text-gray-400 dark:text-gray-500 leading-6", children: s }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((
|
|
2722
|
+
t.length === 0 ? /* @__PURE__ */ a("span", { className: "metakyc-multiselect-placeholder text-gray-400 dark:text-gray-500 leading-6", children: s }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((f) => /* @__PURE__ */ o(
|
|
2696
2723
|
"span",
|
|
2697
2724
|
{
|
|
2698
2725
|
className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded bg-blue-100 dark:bg-blue-900/40 text-blue-800 dark:text-blue-300 text-xs font-medium",
|
|
2699
2726
|
children: [
|
|
2700
|
-
N(
|
|
2727
|
+
N(f),
|
|
2701
2728
|
!i && /* @__PURE__ */ a(
|
|
2702
2729
|
"button",
|
|
2703
2730
|
{
|
|
2704
2731
|
type: "button",
|
|
2705
|
-
onClick: (
|
|
2732
|
+
onClick: (y) => p(f, y),
|
|
2706
2733
|
className: "metakyc-multiselect-chip-remove",
|
|
2707
2734
|
style: {
|
|
2708
2735
|
background: "transparent",
|
|
@@ -2728,7 +2755,7 @@ const Qt = ({
|
|
|
2728
2755
|
)
|
|
2729
2756
|
]
|
|
2730
2757
|
},
|
|
2731
|
-
|
|
2758
|
+
f
|
|
2732
2759
|
)) }),
|
|
2733
2760
|
/* @__PURE__ */ a("span", { className: "metakyc-multiselect-arrow absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none text-xs", children: c ? "▲" : "▼" })
|
|
2734
2761
|
]
|
|
@@ -2745,45 +2772,45 @@ const Qt = ({
|
|
|
2745
2772
|
{
|
|
2746
2773
|
type: "text",
|
|
2747
2774
|
value: u,
|
|
2748
|
-
onChange: (
|
|
2775
|
+
onChange: (f) => w(f.target.value),
|
|
2749
2776
|
placeholder: "Search...",
|
|
2750
2777
|
autoFocus: !0,
|
|
2751
|
-
onClick: (
|
|
2778
|
+
onClick: (f) => f.stopPropagation(),
|
|
2752
2779
|
className: "metakyc-multiselect-search w-full px-2 py-1.5 text-sm rounded focus:outline-none focus:ring-1 focus:ring-blue-500",
|
|
2753
2780
|
style: { border: "1px solid #d1d5db" }
|
|
2754
2781
|
}
|
|
2755
2782
|
) }),
|
|
2756
|
-
/* @__PURE__ */ a("ul", { className: "max-h-48 overflow-y-auto py-1", children:
|
|
2783
|
+
/* @__PURE__ */ a("ul", { className: "max-h-48 overflow-y-auto py-1", children: g.length === 0 ? /* @__PURE__ */ a("li", { className: "px-3 py-2 text-sm text-gray-500 dark:text-gray-400", children: "No results" }) : g.map((f) => /* @__PURE__ */ o(
|
|
2757
2784
|
"li",
|
|
2758
2785
|
{
|
|
2759
|
-
onClick: () =>
|
|
2786
|
+
onClick: () => m(f.value),
|
|
2760
2787
|
className: J(
|
|
2761
2788
|
"metakyc-multiselect-option",
|
|
2762
2789
|
"flex items-center gap-2 px-3 py-2 text-sm cursor-pointer",
|
|
2763
2790
|
"hover:bg-gray-50 dark:hover:bg-gray-700",
|
|
2764
|
-
t.includes(
|
|
2791
|
+
t.includes(f.value) && "metakyc-multiselect-option-selected bg-blue-50 dark:bg-blue-900/20"
|
|
2765
2792
|
),
|
|
2766
2793
|
children: [
|
|
2767
2794
|
/* @__PURE__ */ a(
|
|
2768
2795
|
"input",
|
|
2769
2796
|
{
|
|
2770
2797
|
type: "checkbox",
|
|
2771
|
-
checked: t.includes(
|
|
2798
|
+
checked: t.includes(f.value),
|
|
2772
2799
|
readOnly: !0,
|
|
2773
2800
|
className: "rounded border-gray-300 text-blue-600 pointer-events-none"
|
|
2774
2801
|
}
|
|
2775
2802
|
),
|
|
2776
|
-
/* @__PURE__ */ a("span", { className: "text-gray-900 dark:text-gray-100", children:
|
|
2803
|
+
/* @__PURE__ */ a("span", { className: "text-gray-900 dark:text-gray-100", children: f.label })
|
|
2777
2804
|
]
|
|
2778
2805
|
},
|
|
2779
|
-
|
|
2806
|
+
f.value
|
|
2780
2807
|
)) }),
|
|
2781
2808
|
t.length > 0 && /* @__PURE__ */ a("div", { className: "metakyc-multiselect-clear p-2 border-t border-gray-100 dark:border-gray-700", children: /* @__PURE__ */ o(
|
|
2782
2809
|
"button",
|
|
2783
2810
|
{
|
|
2784
2811
|
type: "button",
|
|
2785
2812
|
onClick: () => {
|
|
2786
|
-
r([]),
|
|
2813
|
+
r([]), w("");
|
|
2787
2814
|
},
|
|
2788
2815
|
className: "text-xs text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",
|
|
2789
2816
|
children: [
|
|
@@ -2808,26 +2835,26 @@ const Qt = ({
|
|
|
2808
2835
|
value: l = [],
|
|
2809
2836
|
className: c
|
|
2810
2837
|
}) => {
|
|
2811
|
-
const [d, u] = v(!1),
|
|
2812
|
-
if (!
|
|
2813
|
-
const E = Array.from(
|
|
2814
|
-
if (s && E.filter((
|
|
2815
|
-
const
|
|
2816
|
-
alert(`Some files exceed the maximum size of ${
|
|
2838
|
+
const [d, u] = v(!1), w = Q(null), k = (y) => {
|
|
2839
|
+
if (!y) return;
|
|
2840
|
+
const E = Array.from(y);
|
|
2841
|
+
if (s && E.filter((C) => C.size > s).length > 0) {
|
|
2842
|
+
const C = Re(s);
|
|
2843
|
+
alert(`Some files exceed the maximum size of ${C}`);
|
|
2817
2844
|
return;
|
|
2818
2845
|
}
|
|
2819
2846
|
i == null || i(n ? [...l, ...E] : [E[0]]);
|
|
2820
|
-
},
|
|
2821
|
-
|
|
2822
|
-
},
|
|
2847
|
+
}, g = (y) => {
|
|
2848
|
+
y.preventDefault(), u(!0);
|
|
2849
|
+
}, m = () => {
|
|
2823
2850
|
u(!1);
|
|
2824
|
-
},
|
|
2825
|
-
|
|
2851
|
+
}, p = (y) => {
|
|
2852
|
+
y.preventDefault(), u(!1), k(y.dataTransfer.files);
|
|
2826
2853
|
}, N = () => {
|
|
2827
|
-
var
|
|
2828
|
-
(
|
|
2829
|
-
},
|
|
2830
|
-
const E = l.filter((S,
|
|
2854
|
+
var y;
|
|
2855
|
+
(y = w.current) == null || y.click();
|
|
2856
|
+
}, f = (y) => {
|
|
2857
|
+
const E = l.filter((S, C) => C !== y);
|
|
2831
2858
|
i == null || i(E);
|
|
2832
2859
|
};
|
|
2833
2860
|
return /* @__PURE__ */ o("div", { className: J("w-full", c), children: [
|
|
@@ -2840,20 +2867,20 @@ const Qt = ({
|
|
|
2840
2867
|
d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2841
2868
|
t && "border-danger-500"
|
|
2842
2869
|
),
|
|
2843
|
-
onDragOver:
|
|
2844
|
-
onDragLeave:
|
|
2845
|
-
onDrop:
|
|
2870
|
+
onDragOver: g,
|
|
2871
|
+
onDragLeave: m,
|
|
2872
|
+
onDrop: p,
|
|
2846
2873
|
onClick: N,
|
|
2847
2874
|
children: [
|
|
2848
2875
|
/* @__PURE__ */ a(
|
|
2849
2876
|
"input",
|
|
2850
2877
|
{
|
|
2851
|
-
ref:
|
|
2878
|
+
ref: w,
|
|
2852
2879
|
type: "file",
|
|
2853
2880
|
className: "hidden",
|
|
2854
2881
|
accept: r,
|
|
2855
2882
|
multiple: n,
|
|
2856
|
-
onChange: (
|
|
2883
|
+
onChange: (y) => k(y.target.files)
|
|
2857
2884
|
}
|
|
2858
2885
|
),
|
|
2859
2886
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -2887,7 +2914,7 @@ const Qt = ({
|
|
|
2887
2914
|
]
|
|
2888
2915
|
}
|
|
2889
2916
|
),
|
|
2890
|
-
l.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: l.map((
|
|
2917
|
+
l.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: l.map((y, E) => /* @__PURE__ */ o(
|
|
2891
2918
|
"div",
|
|
2892
2919
|
{
|
|
2893
2920
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2909,10 +2936,10 @@ const Qt = ({
|
|
|
2909
2936
|
)
|
|
2910
2937
|
}
|
|
2911
2938
|
),
|
|
2912
|
-
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
2939
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: y.name }),
|
|
2913
2940
|
/* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
|
|
2914
2941
|
"(",
|
|
2915
|
-
Re(
|
|
2942
|
+
Re(y.size),
|
|
2916
2943
|
")"
|
|
2917
2944
|
] })
|
|
2918
2945
|
] }),
|
|
@@ -2921,7 +2948,7 @@ const Qt = ({
|
|
|
2921
2948
|
{
|
|
2922
2949
|
type: "button",
|
|
2923
2950
|
onClick: (S) => {
|
|
2924
|
-
S.stopPropagation(),
|
|
2951
|
+
S.stopPropagation(), f(E);
|
|
2925
2952
|
},
|
|
2926
2953
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2927
2954
|
children: /* @__PURE__ */ a("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ a(
|
|
@@ -2962,7 +2989,7 @@ const Qt = ({
|
|
|
2962
2989
|
}
|
|
2963
2990
|
),
|
|
2964
2991
|
/* @__PURE__ */ a(
|
|
2965
|
-
|
|
2992
|
+
ne,
|
|
2966
2993
|
{
|
|
2967
2994
|
ref: s,
|
|
2968
2995
|
type: "tel",
|
|
@@ -3069,7 +3096,7 @@ const tr = Ne(
|
|
|
3069
3096
|
...c
|
|
3070
3097
|
},
|
|
3071
3098
|
[
|
|
3072
|
-
...l.map(([u,
|
|
3099
|
+
...l.map(([u, w]) => De(u, w)),
|
|
3073
3100
|
...Array.isArray(i) ? i : [i]
|
|
3074
3101
|
]
|
|
3075
3102
|
)
|
|
@@ -3143,7 +3170,7 @@ function sr(e) {
|
|
|
3143
3170
|
(n, s) => (n.questions ?? []).map((i, l) => ({ question: i, groupIndex: s, qIdx: l }))
|
|
3144
3171
|
), r = /* @__PURE__ */ new Map();
|
|
3145
3172
|
for (const n of t) {
|
|
3146
|
-
const s = n.question.pageNumber
|
|
3173
|
+
const s = n.question.pageNumber != null && n.question.pageNumber > 0 ? n.question.pageNumber : 1;
|
|
3147
3174
|
r.has(s) || r.set(s, []), r.get(s).push(n);
|
|
3148
3175
|
}
|
|
3149
3176
|
return Array.from(r.entries()).sort(([n], [s]) => n - s).map(([, n]) => n);
|
|
@@ -3153,108 +3180,112 @@ const ir = ({
|
|
|
3153
3180
|
onComplete: t,
|
|
3154
3181
|
onBack: r
|
|
3155
3182
|
}) => {
|
|
3156
|
-
const { questionnaire: n,
|
|
3183
|
+
const { questionnaire: n, initialAnswers: s, isLoading: i, isSubmitting: l, error: c, submit: d } = Kt(e), [u, w] = v({}), [k, g] = v({}), [m, p] = v(0);
|
|
3184
|
+
te.useEffect(() => {
|
|
3185
|
+
s && Object.keys(s).length > 0 && Object.keys(u).length === 0 && w(s);
|
|
3186
|
+
}, [s]);
|
|
3187
|
+
const N = Ae(
|
|
3157
3188
|
() => n ? sr(n.questionGroups) : [],
|
|
3158
3189
|
[n]
|
|
3159
|
-
),
|
|
3160
|
-
|
|
3161
|
-
const
|
|
3162
|
-
return delete
|
|
3190
|
+
), f = m === N.length - 1, y = N[m] ?? [], E = K((F, h) => {
|
|
3191
|
+
w((A) => ({ ...A, [F]: h })), g((A) => {
|
|
3192
|
+
const I = { ...A };
|
|
3193
|
+
return delete I[F], I;
|
|
3163
3194
|
});
|
|
3164
|
-
}, []),
|
|
3165
|
-
const
|
|
3166
|
-
for (const { question:
|
|
3167
|
-
const
|
|
3168
|
-
|
|
3195
|
+
}, []), S = K(() => {
|
|
3196
|
+
const F = {};
|
|
3197
|
+
for (const { question: h } of y) {
|
|
3198
|
+
const A = nr(h, u[h.id] ?? []);
|
|
3199
|
+
A && (F[h.id] = A);
|
|
3169
3200
|
}
|
|
3170
|
-
return
|
|
3171
|
-
}, [
|
|
3172
|
-
|
|
3173
|
-
},
|
|
3174
|
-
|
|
3175
|
-
},
|
|
3176
|
-
if (!(!
|
|
3201
|
+
return g((h) => ({ ...h, ...F })), Object.keys(F).length === 0;
|
|
3202
|
+
}, [y, u]), C = () => {
|
|
3203
|
+
S() && p((F) => F + 1);
|
|
3204
|
+
}, O = () => {
|
|
3205
|
+
m > 0 ? p((F) => F - 1) : r == null || r();
|
|
3206
|
+
}, W = async () => {
|
|
3207
|
+
if (!(!S() || !n))
|
|
3177
3208
|
try {
|
|
3178
|
-
const
|
|
3179
|
-
(
|
|
3180
|
-
questionId:
|
|
3181
|
-
values:
|
|
3209
|
+
const F = n.questionGroups.flatMap(
|
|
3210
|
+
(A) => (A.questions ?? []).map((I) => ({
|
|
3211
|
+
questionId: I.id,
|
|
3212
|
+
values: u[I.id] ?? []
|
|
3182
3213
|
}))
|
|
3183
|
-
),
|
|
3214
|
+
), h = {
|
|
3184
3215
|
applicantId: e,
|
|
3185
3216
|
questionnarieId: n.id,
|
|
3186
|
-
questionResults:
|
|
3217
|
+
questionResults: F
|
|
3187
3218
|
};
|
|
3188
|
-
await
|
|
3189
|
-
} catch (
|
|
3190
|
-
console.error("Questionnaire submit error:",
|
|
3219
|
+
await d(h), t == null || t();
|
|
3220
|
+
} catch (F) {
|
|
3221
|
+
console.error("Questionnaire submit error:", F);
|
|
3191
3222
|
}
|
|
3192
3223
|
};
|
|
3193
|
-
return
|
|
3224
|
+
return i ? /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ a(ce, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3194
3225
|
"Error loading questionnaire: ",
|
|
3195
|
-
|
|
3226
|
+
c.message
|
|
3196
3227
|
] }) }) }) : n ? /* @__PURE__ */ o(M, { children: [
|
|
3197
|
-
/* @__PURE__ */ o(
|
|
3228
|
+
/* @__PURE__ */ o(re, { children: [
|
|
3198
3229
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
3199
3230
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.subtitle }),
|
|
3200
|
-
|
|
3231
|
+
N.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3201
3232
|
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3202
3233
|
"Page ",
|
|
3203
|
-
|
|
3234
|
+
m + 1,
|
|
3204
3235
|
" of ",
|
|
3205
|
-
|
|
3236
|
+
N.length
|
|
3206
3237
|
] }),
|
|
3207
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children:
|
|
3238
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: N.map((F, h) => /* @__PURE__ */ a(
|
|
3208
3239
|
"div",
|
|
3209
3240
|
{
|
|
3210
3241
|
className: "rounded-full transition-all duration-200",
|
|
3211
3242
|
style: {
|
|
3212
3243
|
height: "6px",
|
|
3213
|
-
width:
|
|
3214
|
-
backgroundColor:
|
|
3244
|
+
width: h === m ? "20px" : "6px",
|
|
3245
|
+
backgroundColor: h <= m ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
3215
3246
|
}
|
|
3216
3247
|
},
|
|
3217
|
-
|
|
3248
|
+
h
|
|
3218
3249
|
)) })
|
|
3219
3250
|
] })
|
|
3220
3251
|
] }),
|
|
3221
|
-
/* @__PURE__ */ a(T, { className: "space-y-6", children:
|
|
3252
|
+
/* @__PURE__ */ a(T, { className: "space-y-6", children: y.map(({ question: F }) => /* @__PURE__ */ a(
|
|
3222
3253
|
or,
|
|
3223
3254
|
{
|
|
3224
|
-
question:
|
|
3225
|
-
value:
|
|
3226
|
-
error: k[
|
|
3227
|
-
onChange: (
|
|
3255
|
+
question: F,
|
|
3256
|
+
value: u[F.id] ?? [],
|
|
3257
|
+
error: k[F.id],
|
|
3258
|
+
onChange: (h) => E(F.id, h)
|
|
3228
3259
|
},
|
|
3229
|
-
|
|
3260
|
+
F.id
|
|
3230
3261
|
)) }),
|
|
3231
|
-
/* @__PURE__ */ o(
|
|
3262
|
+
/* @__PURE__ */ o(se, { className: "flex items-center justify-between", children: [
|
|
3232
3263
|
/* @__PURE__ */ o(
|
|
3233
3264
|
U,
|
|
3234
3265
|
{
|
|
3235
3266
|
type: "button",
|
|
3236
3267
|
variant: "outline",
|
|
3237
|
-
onClick:
|
|
3268
|
+
onClick: O,
|
|
3238
3269
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3239
3270
|
children: [
|
|
3240
3271
|
/* @__PURE__ */ a(_e, { size: 14 }),
|
|
3241
|
-
|
|
3272
|
+
m > 0 ? "Previous" : "Back"
|
|
3242
3273
|
]
|
|
3243
3274
|
}
|
|
3244
3275
|
),
|
|
3245
|
-
|
|
3276
|
+
f ? /* @__PURE__ */ a(
|
|
3246
3277
|
U,
|
|
3247
3278
|
{
|
|
3248
3279
|
type: "button",
|
|
3249
|
-
isLoading:
|
|
3250
|
-
onClick:
|
|
3280
|
+
isLoading: l,
|
|
3281
|
+
onClick: W,
|
|
3251
3282
|
children: "Continue"
|
|
3252
3283
|
}
|
|
3253
3284
|
) : /* @__PURE__ */ o(
|
|
3254
3285
|
U,
|
|
3255
3286
|
{
|
|
3256
3287
|
type: "button",
|
|
3257
|
-
onClick:
|
|
3288
|
+
onClick: C,
|
|
3258
3289
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3259
3290
|
children: [
|
|
3260
3291
|
"Next",
|
|
@@ -3263,7 +3294,7 @@ const ir = ({
|
|
|
3263
3294
|
}
|
|
3264
3295
|
)
|
|
3265
3296
|
] }),
|
|
3266
|
-
|
|
3297
|
+
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 }) })
|
|
3267
3298
|
] }) : null;
|
|
3268
3299
|
}, or = ({ question: e, value: t, error: r, onChange: n }) => {
|
|
3269
3300
|
var l;
|
|
@@ -3276,7 +3307,7 @@ const ir = ({
|
|
|
3276
3307
|
e.subtitle && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.subtitle }),
|
|
3277
3308
|
e.description && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.description }),
|
|
3278
3309
|
i === "text" && /* @__PURE__ */ a(
|
|
3279
|
-
|
|
3310
|
+
ne,
|
|
3280
3311
|
{
|
|
3281
3312
|
value: t[0] ?? "",
|
|
3282
3313
|
onChange: (c) => n([c.target.value]),
|
|
@@ -3377,51 +3408,51 @@ const ir = ({
|
|
|
3377
3408
|
onComplete: t,
|
|
3378
3409
|
onBack: r
|
|
3379
3410
|
}) => {
|
|
3380
|
-
const { uploadDocument: n, isLoading: s, isSubmitting: i, error: l, submit: c } =
|
|
3381
|
-
if (
|
|
3382
|
-
const
|
|
3383
|
-
n.uploadDocumentFiles.map(async (
|
|
3384
|
-
const N = d[
|
|
3385
|
-
N.map(async (
|
|
3386
|
-
fileName:
|
|
3387
|
-
fileData: await Tt(
|
|
3411
|
+
const { uploadDocument: n, isLoading: s, isSubmitting: i, error: l, submit: c } = qt(e), [d, u] = v({}), w = async (k) => {
|
|
3412
|
+
if (k.preventDefault(), !n) return;
|
|
3413
|
+
const g = await Promise.all(
|
|
3414
|
+
n.uploadDocumentFiles.map(async (p) => {
|
|
3415
|
+
const N = d[p.id] || [], f = await Promise.all(
|
|
3416
|
+
N.map(async (y) => ({
|
|
3417
|
+
fileName: y.name,
|
|
3418
|
+
fileData: await Tt(y)
|
|
3388
3419
|
}))
|
|
3389
3420
|
);
|
|
3390
3421
|
return {
|
|
3391
|
-
uploadDocumentFileId:
|
|
3392
|
-
valueList:
|
|
3422
|
+
uploadDocumentFileId: p.id,
|
|
3423
|
+
valueList: f
|
|
3393
3424
|
};
|
|
3394
3425
|
})
|
|
3395
|
-
),
|
|
3426
|
+
), m = {
|
|
3396
3427
|
applicantId: e,
|
|
3397
3428
|
uploadDocumentId: n.id,
|
|
3398
|
-
uploadDocumentResults:
|
|
3429
|
+
uploadDocumentResults: g
|
|
3399
3430
|
};
|
|
3400
|
-
await c(
|
|
3431
|
+
await c(m), t == null || t();
|
|
3401
3432
|
};
|
|
3402
3433
|
return s ? /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ a(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3403
3434
|
"Error loading document requirements: ",
|
|
3404
3435
|
l.message
|
|
3405
|
-
] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit:
|
|
3406
|
-
/* @__PURE__ */ o(
|
|
3436
|
+
] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit: w, children: /* @__PURE__ */ o(M, { children: [
|
|
3437
|
+
/* @__PURE__ */ o(re, { children: [
|
|
3407
3438
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
3408
3439
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.subtitle })
|
|
3409
3440
|
] }),
|
|
3410
|
-
/* @__PURE__ */ a(T, { className: "space-y-6", children: n.uploadDocumentFiles.map((
|
|
3441
|
+
/* @__PURE__ */ a(T, { className: "space-y-6", children: n.uploadDocumentFiles.map((k) => /* @__PURE__ */ a(
|
|
3411
3442
|
Vt,
|
|
3412
3443
|
{
|
|
3413
|
-
label:
|
|
3414
|
-
accept:
|
|
3415
|
-
multiple:
|
|
3416
|
-
maxSize:
|
|
3417
|
-
value: d[
|
|
3418
|
-
onChange: (
|
|
3419
|
-
u((
|
|
3444
|
+
label: k.displayName,
|
|
3445
|
+
accept: k.allowedTypes,
|
|
3446
|
+
multiple: k.multipleFile,
|
|
3447
|
+
maxSize: k.maxEachFileSizeByte,
|
|
3448
|
+
value: d[k.id] || [],
|
|
3449
|
+
onChange: (g) => {
|
|
3450
|
+
u((m) => ({ ...m, [k.id]: g }));
|
|
3420
3451
|
}
|
|
3421
3452
|
},
|
|
3422
|
-
|
|
3453
|
+
k.id
|
|
3423
3454
|
)) }),
|
|
3424
|
-
/* @__PURE__ */ o(
|
|
3455
|
+
/* @__PURE__ */ o(se, { className: "flex justify-between", children: [
|
|
3425
3456
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3426
3457
|
/* @__PURE__ */ a(U, { type: "submit", isLoading: i, children: "Continue" })
|
|
3427
3458
|
] })
|
|
@@ -3434,11 +3465,11 @@ const ir = ({
|
|
|
3434
3465
|
"Error loading overview: ",
|
|
3435
3466
|
l.message
|
|
3436
3467
|
] }) }) }) : n ? /* @__PURE__ */ o(M, { children: [
|
|
3437
|
-
/* @__PURE__ */ o(
|
|
3468
|
+
/* @__PURE__ */ o(re, { children: [
|
|
3438
3469
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.title || "Overview" }),
|
|
3439
3470
|
n.description && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.description })
|
|
3440
3471
|
] }),
|
|
3441
|
-
/* @__PURE__ */ a(T, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((u,
|
|
3472
|
+
/* @__PURE__ */ a(T, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((u, w) => u.order - w.order).map((u) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3442
3473
|
/* @__PURE__ */ a("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ a("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: u.order + 1 }) }),
|
|
3443
3474
|
/* @__PURE__ */ o(
|
|
3444
3475
|
"div",
|
|
@@ -3457,7 +3488,7 @@ const ir = ({
|
|
|
3457
3488
|
}
|
|
3458
3489
|
)
|
|
3459
3490
|
] }, u.order)) : /* @__PURE__ */ a("div", { className: "text-center py-8", children: /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3460
|
-
/* @__PURE__ */ o(
|
|
3491
|
+
/* @__PURE__ */ o(se, { className: "flex justify-between", children: [
|
|
3461
3492
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3462
3493
|
/* @__PURE__ */ a(U, { onClick: d, isLoading: i, children: "Continue" })
|
|
3463
3494
|
] })
|
|
@@ -3496,7 +3527,7 @@ function dr(e, t) {
|
|
|
3496
3527
|
function ur(e) {
|
|
3497
3528
|
const t = /* @__PURE__ */ new Map();
|
|
3498
3529
|
return e.forEach((r, n) => {
|
|
3499
|
-
const s = r.pageNumber
|
|
3530
|
+
const s = r.pageNumber != null && r.pageNumber > 0 ? r.pageNumber : 1;
|
|
3500
3531
|
t.has(s) || t.set(s, []), t.get(s).push({ criterion: r, idx: n });
|
|
3501
3532
|
}), Array.from(t.entries()).sort(([r], [n]) => r - n).map(([, r]) => r);
|
|
3502
3533
|
}
|
|
@@ -3508,104 +3539,108 @@ const pr = ({
|
|
|
3508
3539
|
onComplete: t,
|
|
3509
3540
|
onBack: r
|
|
3510
3541
|
}) => {
|
|
3511
|
-
const { criteria: n,
|
|
3542
|
+
const { criteria: n, initialAnswers: s, isLoading: i, isSubmitting: l, error: c, submit: d } = Yt(e), [u, w] = v({}), [k, g] = v({}), [m, p] = v(0), [N, f] = v(!1);
|
|
3543
|
+
te.useEffect(() => {
|
|
3544
|
+
s && Object.keys(s).length > 0 && Object.keys(u).length === 0 && w(s);
|
|
3545
|
+
}, [s]);
|
|
3546
|
+
const y = Ae(
|
|
3512
3547
|
() => n && n.length > 0 ? ur(n) : [],
|
|
3513
3548
|
[n]
|
|
3514
|
-
),
|
|
3515
|
-
|
|
3516
|
-
!
|
|
3517
|
-
}, [
|
|
3518
|
-
const
|
|
3519
|
-
|
|
3520
|
-
const
|
|
3521
|
-
return delete
|
|
3549
|
+
), E = m === y.length - 1, S = y[m] ?? [];
|
|
3550
|
+
te.useEffect(() => {
|
|
3551
|
+
!i && n && n.length === 0 && !N && !l && (f(!0), d({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3552
|
+
}, [i, n, N, l, d, e, t]);
|
|
3553
|
+
const C = K((A, I) => {
|
|
3554
|
+
w((H) => ({ ...H, [A]: I })), g((H) => {
|
|
3555
|
+
const q = { ...H };
|
|
3556
|
+
return delete q[A], q;
|
|
3522
3557
|
});
|
|
3523
|
-
}, []),
|
|
3524
|
-
const
|
|
3525
|
-
for (const { criterion:
|
|
3526
|
-
const
|
|
3527
|
-
|
|
3558
|
+
}, []), O = K(() => {
|
|
3559
|
+
const A = {};
|
|
3560
|
+
for (const { criterion: I } of S) {
|
|
3561
|
+
const H = dr(I, u[I.id] ?? []);
|
|
3562
|
+
H && (A[I.id] = H);
|
|
3528
3563
|
}
|
|
3529
|
-
return
|
|
3530
|
-
}, [
|
|
3531
|
-
|
|
3532
|
-
},
|
|
3533
|
-
|
|
3534
|
-
},
|
|
3535
|
-
if (!(!
|
|
3564
|
+
return g((I) => ({ ...I, ...A })), Object.keys(A).length === 0;
|
|
3565
|
+
}, [S, u]), W = () => {
|
|
3566
|
+
O() && p((A) => A + 1);
|
|
3567
|
+
}, F = () => {
|
|
3568
|
+
m > 0 ? p((A) => A - 1) : r == null || r();
|
|
3569
|
+
}, h = async () => {
|
|
3570
|
+
if (!(!O() || !n))
|
|
3536
3571
|
try {
|
|
3537
|
-
const
|
|
3538
|
-
const
|
|
3539
|
-
return
|
|
3540
|
-
}).filter((
|
|
3541
|
-
await
|
|
3542
|
-
} catch (
|
|
3543
|
-
console.error("Risk scoring submit error:",
|
|
3572
|
+
const A = n.map((H) => {
|
|
3573
|
+
const q = (u[H.id] ?? []).filter((L) => L && L.trim());
|
|
3574
|
+
return q.length > 0 ? { riskCriteriaId: H.id, values: q } : null;
|
|
3575
|
+
}).filter((H) => H !== null);
|
|
3576
|
+
await d({ applicantId: e, criteriaValueInputs: A }), t == null || t();
|
|
3577
|
+
} catch (A) {
|
|
3578
|
+
console.error("Risk scoring submit error:", A);
|
|
3544
3579
|
}
|
|
3545
3580
|
};
|
|
3546
|
-
return
|
|
3581
|
+
return i ? /* @__PURE__ */ a(M, { children: /* @__PURE__ */ o(T, { children: [
|
|
3547
3582
|
/* @__PURE__ */ a(ce, { className: "my-8" }),
|
|
3548
3583
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
3549
|
-
] }) }) : !
|
|
3584
|
+
] }) }) : !i && n && n.length === 0 ? /* @__PURE__ */ a(M, { children: /* @__PURE__ */ o(T, { children: [
|
|
3550
3585
|
/* @__PURE__ */ a(ce, { className: "my-8" }),
|
|
3551
3586
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
3552
|
-
] }) }) :
|
|
3587
|
+
] }) }) : c ? /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3553
3588
|
"Error loading criteria: ",
|
|
3554
|
-
|
|
3589
|
+
c.message
|
|
3555
3590
|
] }) }) }) : n ? /* @__PURE__ */ o(M, { children: [
|
|
3556
|
-
/* @__PURE__ */ o(
|
|
3591
|
+
/* @__PURE__ */ o(re, { children: [
|
|
3557
3592
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3558
3593
|
/* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3559
|
-
|
|
3594
|
+
y.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3560
3595
|
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3561
3596
|
"Page ",
|
|
3562
|
-
|
|
3597
|
+
m + 1,
|
|
3563
3598
|
" of ",
|
|
3564
|
-
|
|
3599
|
+
y.length
|
|
3565
3600
|
] }),
|
|
3566
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children:
|
|
3601
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: y.map((A, I) => /* @__PURE__ */ a(
|
|
3567
3602
|
"div",
|
|
3568
3603
|
{
|
|
3569
3604
|
className: "rounded-full transition-all duration-200",
|
|
3570
3605
|
style: {
|
|
3571
3606
|
height: "6px",
|
|
3572
|
-
width:
|
|
3573
|
-
backgroundColor:
|
|
3607
|
+
width: I === m ? "20px" : "6px",
|
|
3608
|
+
backgroundColor: I <= m ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
3574
3609
|
}
|
|
3575
3610
|
},
|
|
3576
|
-
|
|
3611
|
+
I
|
|
3577
3612
|
)) })
|
|
3578
3613
|
] })
|
|
3579
3614
|
] }),
|
|
3580
|
-
/* @__PURE__ */ a(T, { className: "space-y-6", children:
|
|
3615
|
+
/* @__PURE__ */ a(T, { className: "space-y-6", children: S.map(({ criterion: A }) => /* @__PURE__ */ a(
|
|
3581
3616
|
hr,
|
|
3582
3617
|
{
|
|
3583
|
-
criterion:
|
|
3584
|
-
value:
|
|
3585
|
-
error: k[
|
|
3586
|
-
onChange: (
|
|
3618
|
+
criterion: A,
|
|
3619
|
+
value: u[A.id] ?? [],
|
|
3620
|
+
error: k[A.id],
|
|
3621
|
+
onChange: (I) => C(A.id, I)
|
|
3587
3622
|
},
|
|
3588
|
-
|
|
3623
|
+
A.id
|
|
3589
3624
|
)) }),
|
|
3590
|
-
/* @__PURE__ */ o(
|
|
3625
|
+
/* @__PURE__ */ o(se, { className: "flex items-center justify-between", children: [
|
|
3591
3626
|
/* @__PURE__ */ o(
|
|
3592
3627
|
U,
|
|
3593
3628
|
{
|
|
3594
3629
|
type: "button",
|
|
3595
3630
|
variant: "outline",
|
|
3596
|
-
onClick:
|
|
3631
|
+
onClick: F,
|
|
3597
3632
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3598
3633
|
children: [
|
|
3599
3634
|
/* @__PURE__ */ a(_e, { size: 14 }),
|
|
3600
|
-
|
|
3635
|
+
m > 0 ? "Previous" : "Back"
|
|
3601
3636
|
]
|
|
3602
3637
|
}
|
|
3603
3638
|
),
|
|
3604
|
-
|
|
3639
|
+
E ? /* @__PURE__ */ a(U, { type: "button", isLoading: l, onClick: h, children: "Continue" }) : /* @__PURE__ */ o(
|
|
3605
3640
|
U,
|
|
3606
3641
|
{
|
|
3607
3642
|
type: "button",
|
|
3608
|
-
onClick:
|
|
3643
|
+
onClick: W,
|
|
3609
3644
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3610
3645
|
children: [
|
|
3611
3646
|
"Next",
|
|
@@ -3614,7 +3649,7 @@ const pr = ({
|
|
|
3614
3649
|
}
|
|
3615
3650
|
)
|
|
3616
3651
|
] }),
|
|
3617
|
-
|
|
3652
|
+
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 }) })
|
|
3618
3653
|
] }) : null;
|
|
3619
3654
|
}, hr = ({ criterion: e, value: t, error: r, onChange: n }) => {
|
|
3620
3655
|
const s = mr(e), i = e.valueDataType === he.Integer || e.valueDataType === he.Decimal || e.valueDataType === he.DigitOnly;
|
|
@@ -3626,7 +3661,7 @@ const pr = ({
|
|
|
3626
3661
|
e.description && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
|
|
3627
3662
|
i && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.min !== void 0 && e.max !== void 0 ? `Range: ${e.min} – ${e.max}` : e.min !== void 0 ? `Minimum: ${e.min}` : `Maximum: ${e.max}` }),
|
|
3628
3663
|
s === "text" && /* @__PURE__ */ a(
|
|
3629
|
-
|
|
3664
|
+
ne,
|
|
3630
3665
|
{
|
|
3631
3666
|
value: t[0] ?? "",
|
|
3632
3667
|
onChange: (l) => n([l.target.value]),
|
|
@@ -3738,28 +3773,28 @@ const pr = ({
|
|
|
3738
3773
|
onComplete: t,
|
|
3739
3774
|
onBack: r
|
|
3740
3775
|
}) => {
|
|
3741
|
-
const { investorCategorizationService: n } =
|
|
3742
|
-
return /* @__PURE__ */ a("form", { onSubmit: async (
|
|
3743
|
-
if (
|
|
3776
|
+
const { investorCategorizationService: n } = ie(), [s, i] = v(null), [l, c] = v(!1), [d, u] = v(null);
|
|
3777
|
+
return /* @__PURE__ */ a("form", { onSubmit: async (k) => {
|
|
3778
|
+
if (k.preventDefault(), s === null) {
|
|
3744
3779
|
u("Please select an investor type");
|
|
3745
3780
|
return;
|
|
3746
3781
|
}
|
|
3747
3782
|
c(!0), u(null);
|
|
3748
3783
|
try {
|
|
3749
|
-
const
|
|
3784
|
+
const g = {
|
|
3750
3785
|
applicantId: e,
|
|
3751
3786
|
investorType: s
|
|
3752
3787
|
};
|
|
3753
|
-
console.log("Submitting investor categorization:",
|
|
3754
|
-
const
|
|
3755
|
-
console.log("Investor categorization result:",
|
|
3756
|
-
} catch (
|
|
3757
|
-
console.error("Error submitting investor categorization:",
|
|
3788
|
+
console.log("Submitting investor categorization:", g);
|
|
3789
|
+
const m = await n.setInvestorCategorization(g);
|
|
3790
|
+
console.log("Investor categorization result:", m), t == null || t();
|
|
3791
|
+
} catch (g) {
|
|
3792
|
+
console.error("Error submitting investor categorization:", g), u(g.message || "Failed to submit investor categorization");
|
|
3758
3793
|
} finally {
|
|
3759
3794
|
c(!1);
|
|
3760
3795
|
}
|
|
3761
3796
|
}, children: /* @__PURE__ */ o(M, { children: [
|
|
3762
|
-
/* @__PURE__ */ o(
|
|
3797
|
+
/* @__PURE__ */ o(re, { children: [
|
|
3763
3798
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
3764
3799
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
|
|
3765
3800
|
] }),
|
|
@@ -3770,7 +3805,7 @@ const pr = ({
|
|
|
3770
3805
|
{
|
|
3771
3806
|
className: `
|
|
3772
3807
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3773
|
-
${s ===
|
|
3808
|
+
${s === ae.Individual ? "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"}
|
|
3774
3809
|
`,
|
|
3775
3810
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3776
3811
|
/* @__PURE__ */ a(
|
|
@@ -3778,9 +3813,9 @@ const pr = ({
|
|
|
3778
3813
|
{
|
|
3779
3814
|
type: "radio",
|
|
3780
3815
|
name: "investorType",
|
|
3781
|
-
value:
|
|
3782
|
-
checked: s ===
|
|
3783
|
-
onChange: () => i(
|
|
3816
|
+
value: ae.Individual,
|
|
3817
|
+
checked: s === ae.Individual,
|
|
3818
|
+
onChange: () => i(ae.Individual),
|
|
3784
3819
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3785
3820
|
}
|
|
3786
3821
|
),
|
|
@@ -3796,7 +3831,7 @@ const pr = ({
|
|
|
3796
3831
|
{
|
|
3797
3832
|
className: `
|
|
3798
3833
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3799
|
-
${s ===
|
|
3834
|
+
${s === ae.Sophisticated ? "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"}
|
|
3800
3835
|
`,
|
|
3801
3836
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3802
3837
|
/* @__PURE__ */ a(
|
|
@@ -3804,9 +3839,9 @@ const pr = ({
|
|
|
3804
3839
|
{
|
|
3805
3840
|
type: "radio",
|
|
3806
3841
|
name: "investorType",
|
|
3807
|
-
value:
|
|
3808
|
-
checked: s ===
|
|
3809
|
-
onChange: () => i(
|
|
3842
|
+
value: ae.Sophisticated,
|
|
3843
|
+
checked: s === ae.Sophisticated,
|
|
3844
|
+
onChange: () => i(ae.Sophisticated),
|
|
3810
3845
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3811
3846
|
}
|
|
3812
3847
|
),
|
|
@@ -3827,7 +3862,7 @@ const pr = ({
|
|
|
3827
3862
|
{
|
|
3828
3863
|
className: `
|
|
3829
3864
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3830
|
-
${s ===
|
|
3865
|
+
${s === ae.HighNetWorth ? "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"}
|
|
3831
3866
|
`,
|
|
3832
3867
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3833
3868
|
/* @__PURE__ */ a(
|
|
@@ -3835,9 +3870,9 @@ const pr = ({
|
|
|
3835
3870
|
{
|
|
3836
3871
|
type: "radio",
|
|
3837
3872
|
name: "investorType",
|
|
3838
|
-
value:
|
|
3839
|
-
checked: s ===
|
|
3840
|
-
onChange: () => i(
|
|
3873
|
+
value: ae.HighNetWorth,
|
|
3874
|
+
checked: s === ae.HighNetWorth,
|
|
3875
|
+
onChange: () => i(ae.HighNetWorth),
|
|
3841
3876
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3842
3877
|
}
|
|
3843
3878
|
),
|
|
@@ -3858,7 +3893,7 @@ const pr = ({
|
|
|
3858
3893
|
d
|
|
3859
3894
|
] }) })
|
|
3860
3895
|
] }),
|
|
3861
|
-
/* @__PURE__ */ o(
|
|
3896
|
+
/* @__PURE__ */ o(se, { className: "flex justify-between", children: [
|
|
3862
3897
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3863
3898
|
/* @__PURE__ */ a(
|
|
3864
3899
|
U,
|
|
@@ -3876,104 +3911,104 @@ const pr = ({
|
|
|
3876
3911
|
onComplete: t,
|
|
3877
3912
|
onBack: r
|
|
3878
3913
|
}) => {
|
|
3879
|
-
const { appropriatenessTestService: n } =
|
|
3880
|
-
|
|
3914
|
+
const { appropriatenessTestService: n } = ie(), [s, i] = v(null), [l, c] = v(!0), [d, u] = v(!1), [w, k] = v(null), [g, m] = v({}), [p, N] = v(0), [f, y] = v(!1), [E, S] = v(!1), [C, O] = v(0);
|
|
3915
|
+
G(() => {
|
|
3881
3916
|
(async () => {
|
|
3882
3917
|
try {
|
|
3883
|
-
c(!0),
|
|
3884
|
-
const
|
|
3885
|
-
if (console.log("Appropriateness test data:",
|
|
3886
|
-
const
|
|
3887
|
-
|
|
3918
|
+
c(!0), k(null), console.log("Loading appropriateness test for applicant:", e);
|
|
3919
|
+
const R = await n.getAppropriatenessTest(e);
|
|
3920
|
+
if (console.log("Appropriateness test data:", R), i(R), R.waitTimeSpanForNextTry && R.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3921
|
+
const Y = W(R.waitTimeSpanForNextTry);
|
|
3922
|
+
Y > 0 && O(Y);
|
|
3888
3923
|
}
|
|
3889
|
-
} catch (
|
|
3890
|
-
console.error("Error loading appropriateness test:",
|
|
3924
|
+
} catch (R) {
|
|
3925
|
+
console.error("Error loading appropriateness test:", R), k(R.message || "Failed to load appropriateness test");
|
|
3891
3926
|
} finally {
|
|
3892
3927
|
c(!1);
|
|
3893
3928
|
}
|
|
3894
3929
|
})();
|
|
3895
3930
|
}, [e, n]);
|
|
3896
|
-
const
|
|
3897
|
-
const
|
|
3898
|
-
if (
|
|
3899
|
-
const [
|
|
3900
|
-
return
|
|
3931
|
+
const W = (L) => {
|
|
3932
|
+
const R = L.split(":").map(Number);
|
|
3933
|
+
if (R.length === 3) {
|
|
3934
|
+
const [Y, x, P] = R;
|
|
3935
|
+
return Y * 3600 + x * 60 + P;
|
|
3901
3936
|
}
|
|
3902
3937
|
return 0;
|
|
3903
|
-
},
|
|
3904
|
-
const
|
|
3905
|
-
return `${
|
|
3938
|
+
}, F = (L) => {
|
|
3939
|
+
const R = Math.floor(L / 60), Y = L % 60;
|
|
3940
|
+
return `${R.toString().padStart(2, "0")}:${Y.toString().padStart(2, "0")}`;
|
|
3906
3941
|
};
|
|
3907
|
-
|
|
3908
|
-
if (!
|
|
3909
|
-
const
|
|
3910
|
-
N((
|
|
3942
|
+
G(() => {
|
|
3943
|
+
if (!f || p <= 0) return;
|
|
3944
|
+
const L = setInterval(() => {
|
|
3945
|
+
N((R) => R <= 1 ? (S(!0), 0) : R - 1);
|
|
3911
3946
|
}, 1e3);
|
|
3912
|
-
return () => clearInterval(
|
|
3913
|
-
}, [
|
|
3914
|
-
if (
|
|
3915
|
-
const
|
|
3916
|
-
|
|
3947
|
+
return () => clearInterval(L);
|
|
3948
|
+
}, [f, p]), G(() => {
|
|
3949
|
+
if (C <= 0) return;
|
|
3950
|
+
const L = setInterval(() => {
|
|
3951
|
+
O((R) => R <= 1 ? 0 : R - 1);
|
|
3917
3952
|
}, 1e3);
|
|
3918
|
-
return () => clearInterval(
|
|
3919
|
-
}, [
|
|
3920
|
-
E && !d &&
|
|
3953
|
+
return () => clearInterval(L);
|
|
3954
|
+
}, [C]), G(() => {
|
|
3955
|
+
E && !d && I();
|
|
3921
3956
|
}, [E]);
|
|
3922
|
-
const
|
|
3923
|
-
s && (
|
|
3924
|
-
},
|
|
3925
|
-
|
|
3926
|
-
...
|
|
3927
|
-
[
|
|
3957
|
+
const h = () => {
|
|
3958
|
+
s && (y(!0), N(s.testDurationSec));
|
|
3959
|
+
}, A = (L, R) => {
|
|
3960
|
+
m((Y) => ({
|
|
3961
|
+
...Y,
|
|
3962
|
+
[L]: R
|
|
3928
3963
|
}));
|
|
3929
|
-
},
|
|
3930
|
-
if (
|
|
3964
|
+
}, I = async (L) => {
|
|
3965
|
+
if (L && L.preventDefault(), !!s) {
|
|
3931
3966
|
if (!E) {
|
|
3932
|
-
const
|
|
3933
|
-
if (
|
|
3934
|
-
|
|
3967
|
+
const R = s.appropriatenessQuestions.length - Object.keys(g).length;
|
|
3968
|
+
if (R > 0) {
|
|
3969
|
+
k(`Please answer all questions. ${R} question(s) remaining.`);
|
|
3935
3970
|
return;
|
|
3936
3971
|
}
|
|
3937
3972
|
}
|
|
3938
|
-
u(!0),
|
|
3973
|
+
u(!0), k(null);
|
|
3939
3974
|
try {
|
|
3940
|
-
const
|
|
3941
|
-
(
|
|
3942
|
-
appropriatenessQuestionId:
|
|
3943
|
-
value:
|
|
3975
|
+
const R = s.appropriatenessQuestions.map(
|
|
3976
|
+
(x) => ({
|
|
3977
|
+
appropriatenessQuestionId: x.id,
|
|
3978
|
+
value: g[x.id] || ""
|
|
3944
3979
|
// Empty string if not answered
|
|
3945
3980
|
})
|
|
3946
|
-
),
|
|
3981
|
+
), Y = {
|
|
3947
3982
|
applicantId: e,
|
|
3948
3983
|
appropriatenessTestId: s.id,
|
|
3949
|
-
appropriatenessQuestionResults:
|
|
3984
|
+
appropriatenessQuestionResults: R
|
|
3950
3985
|
};
|
|
3951
|
-
console.log("Submitting appropriateness test:",
|
|
3986
|
+
console.log("Submitting appropriateness test:", Y);
|
|
3952
3987
|
try {
|
|
3953
|
-
const
|
|
3954
|
-
console.log("Appropriateness test result:",
|
|
3955
|
-
} catch (
|
|
3956
|
-
if (
|
|
3957
|
-
const
|
|
3958
|
-
console.log("Test failed:",
|
|
3988
|
+
const x = await n.fillAppropriatenessTest(Y);
|
|
3989
|
+
console.log("Appropriateness test result:", x), x.message && (x.message.toLowerCase().includes("pass") || x.message.toLowerCase().includes("success") || x.message.toLowerCase().includes("congratulations")) ? t == null || t() : (k(x.message || "Test completed. Please check the result."), y(!1), S(!1), m({}), setTimeout(() => H(), 1e3));
|
|
3990
|
+
} catch (x) {
|
|
3991
|
+
if (x.code === 400 && x.message) {
|
|
3992
|
+
const P = x.message;
|
|
3993
|
+
console.log("Test failed:", P), k(P), y(!1), S(!1), m({}), setTimeout(() => H(), 1500);
|
|
3959
3994
|
} else
|
|
3960
|
-
throw
|
|
3995
|
+
throw x;
|
|
3961
3996
|
}
|
|
3962
|
-
} catch (
|
|
3963
|
-
console.error("Error submitting appropriateness test:",
|
|
3997
|
+
} catch (R) {
|
|
3998
|
+
console.error("Error submitting appropriateness test:", R), k(R.message || "Failed to submit test. Please try again."), y(!1), S(!1), m({});
|
|
3964
3999
|
} finally {
|
|
3965
4000
|
u(!1);
|
|
3966
4001
|
}
|
|
3967
4002
|
}
|
|
3968
|
-
},
|
|
4003
|
+
}, H = async () => {
|
|
3969
4004
|
try {
|
|
3970
|
-
const
|
|
3971
|
-
if (console.log("Reloaded test data:",
|
|
3972
|
-
const
|
|
3973
|
-
|
|
4005
|
+
const L = await n.getAppropriatenessTest(e);
|
|
4006
|
+
if (console.log("Reloaded test data:", L), i(L), L.waitTimeSpanForNextTry && L.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4007
|
+
const R = W(L.waitTimeSpanForNextTry);
|
|
4008
|
+
R > 0 && O(R);
|
|
3974
4009
|
}
|
|
3975
|
-
} catch (
|
|
3976
|
-
console.error("Error reloading test data:",
|
|
4010
|
+
} catch (L) {
|
|
4011
|
+
console.error("Error reloading test data:", L), k((R) => R + `
|
|
3977
4012
|
|
|
3978
4013
|
Failed to reload test data. Please refresh the page.`);
|
|
3979
4014
|
}
|
|
@@ -3986,25 +4021,25 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3986
4021
|
if (!s)
|
|
3987
4022
|
return /* @__PURE__ */ a(M, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
|
|
3988
4023
|
/* @__PURE__ */ a("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
3989
|
-
|
|
4024
|
+
w && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: w })
|
|
3990
4025
|
] }) });
|
|
3991
|
-
if (
|
|
4026
|
+
if (C > 0)
|
|
3992
4027
|
return /* @__PURE__ */ o(M, { children: [
|
|
3993
|
-
/* @__PURE__ */ o(
|
|
4028
|
+
/* @__PURE__ */ o(re, { children: [
|
|
3994
4029
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
3995
4030
|
s.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
3996
4031
|
] }),
|
|
3997
4032
|
/* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
|
|
3998
4033
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3999
|
-
/* @__PURE__ */ a("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
4034
|
+
/* @__PURE__ */ a("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: F(C) }),
|
|
4000
4035
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4001
4036
|
] }),
|
|
4002
|
-
|
|
4037
|
+
w && /* @__PURE__ */ a("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-red-600 dark:text-red-400 text-sm", children: w }) })
|
|
4003
4038
|
] })
|
|
4004
4039
|
] });
|
|
4005
|
-
const
|
|
4006
|
-
return
|
|
4007
|
-
/* @__PURE__ */ a(
|
|
4040
|
+
const q = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4041
|
+
return f ? /* @__PURE__ */ a("form", { onSubmit: I, children: /* @__PURE__ */ o(M, { children: [
|
|
4042
|
+
/* @__PURE__ */ a(re, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4008
4043
|
/* @__PURE__ */ o("div", { children: [
|
|
4009
4044
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4010
4045
|
s.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
@@ -4013,8 +4048,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4013
4048
|
/* @__PURE__ */ a(
|
|
4014
4049
|
"div",
|
|
4015
4050
|
{
|
|
4016
|
-
className: `text-3xl font-bold ${
|
|
4017
|
-
children:
|
|
4051
|
+
className: `text-3xl font-bold ${p <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4052
|
+
children: F(p)
|
|
4018
4053
|
}
|
|
4019
4054
|
),
|
|
4020
4055
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -4024,18 +4059,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4024
4059
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4025
4060
|
/* @__PURE__ */ o(pe, { variant: "info", children: [
|
|
4026
4061
|
"Question ",
|
|
4027
|
-
Object.keys(
|
|
4062
|
+
Object.keys(g).length,
|
|
4028
4063
|
" of ",
|
|
4029
4064
|
s.totalQuestionCount
|
|
4030
4065
|
] }),
|
|
4031
|
-
/* @__PURE__ */ o(pe, { variant:
|
|
4032
|
-
|
|
4066
|
+
/* @__PURE__ */ o(pe, { variant: q > 1 ? "success" : "warning", children: [
|
|
4067
|
+
q,
|
|
4033
4068
|
" attempt",
|
|
4034
|
-
|
|
4069
|
+
q !== 1 ? "s" : "",
|
|
4035
4070
|
" remaining"
|
|
4036
4071
|
] })
|
|
4037
4072
|
] }),
|
|
4038
|
-
s.appropriatenessQuestions.map((
|
|
4073
|
+
s.appropriatenessQuestions.map((L, R) => /* @__PURE__ */ o(
|
|
4039
4074
|
"div",
|
|
4040
4075
|
{
|
|
4041
4076
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -4043,51 +4078,51 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4043
4078
|
/* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
4044
4079
|
/* @__PURE__ */ o("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
|
|
4045
4080
|
"Question ",
|
|
4046
|
-
|
|
4081
|
+
R + 1
|
|
4047
4082
|
] }),
|
|
4048
|
-
|
|
4049
|
-
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children:
|
|
4083
|
+
L.groupName && /* @__PURE__ */ a("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: L.groupName }),
|
|
4084
|
+
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: L.question })
|
|
4050
4085
|
] }),
|
|
4051
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children:
|
|
4086
|
+
/* @__PURE__ */ a("div", { className: "space-y-2", children: L.answers.map((Y, x) => /* @__PURE__ */ o(
|
|
4052
4087
|
"label",
|
|
4053
4088
|
{
|
|
4054
4089
|
className: `
|
|
4055
4090
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
4056
|
-
${
|
|
4091
|
+
${g[L.id] === Y ? "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"}
|
|
4057
4092
|
`,
|
|
4058
4093
|
children: [
|
|
4059
4094
|
/* @__PURE__ */ a(
|
|
4060
4095
|
"input",
|
|
4061
4096
|
{
|
|
4062
4097
|
type: "radio",
|
|
4063
|
-
name: `question-${
|
|
4064
|
-
value:
|
|
4065
|
-
checked:
|
|
4066
|
-
onChange: (
|
|
4098
|
+
name: `question-${L.id}`,
|
|
4099
|
+
value: Y,
|
|
4100
|
+
checked: g[L.id] === Y,
|
|
4101
|
+
onChange: (P) => A(L.id, P.target.value),
|
|
4067
4102
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4068
4103
|
disabled: d
|
|
4069
4104
|
}
|
|
4070
4105
|
),
|
|
4071
|
-
/* @__PURE__ */ a("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children:
|
|
4106
|
+
/* @__PURE__ */ a("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: Y })
|
|
4072
4107
|
]
|
|
4073
4108
|
},
|
|
4074
|
-
|
|
4109
|
+
x
|
|
4075
4110
|
)) })
|
|
4076
4111
|
]
|
|
4077
4112
|
},
|
|
4078
|
-
|
|
4113
|
+
L.id
|
|
4079
4114
|
)),
|
|
4080
|
-
|
|
4115
|
+
w && !E && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4081
4116
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
4082
4117
|
" ",
|
|
4083
|
-
|
|
4118
|
+
w
|
|
4084
4119
|
] }) }),
|
|
4085
4120
|
E && /* @__PURE__ */ a("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
|
|
4086
4121
|
/* @__PURE__ */ a("strong", { children: "Time's up!" }),
|
|
4087
4122
|
" Your answers are being submitted automatically."
|
|
4088
4123
|
] }) })
|
|
4089
4124
|
] }),
|
|
4090
|
-
/* @__PURE__ */ o(
|
|
4125
|
+
/* @__PURE__ */ o(se, { className: "flex justify-between", children: [
|
|
4091
4126
|
/* @__PURE__ */ a(
|
|
4092
4127
|
U,
|
|
4093
4128
|
{
|
|
@@ -4103,13 +4138,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4103
4138
|
{
|
|
4104
4139
|
type: "submit",
|
|
4105
4140
|
isLoading: d,
|
|
4106
|
-
disabled: Object.keys(
|
|
4141
|
+
disabled: Object.keys(g).length < s.totalQuestionCount,
|
|
4107
4142
|
children: E ? "Submitting..." : "Submit Test"
|
|
4108
4143
|
}
|
|
4109
4144
|
)
|
|
4110
4145
|
] })
|
|
4111
4146
|
] }) }) : /* @__PURE__ */ o(M, { children: [
|
|
4112
|
-
/* @__PURE__ */ o(
|
|
4147
|
+
/* @__PURE__ */ o(re, { children: [
|
|
4113
4148
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4114
4149
|
s.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4115
4150
|
] }),
|
|
@@ -4122,7 +4157,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4122
4157
|
] }),
|
|
4123
4158
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4124
4159
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4125
|
-
/* @__PURE__ */ a(pe, { variant: "info", children:
|
|
4160
|
+
/* @__PURE__ */ a(pe, { variant: "info", children: F(s.testDurationSec) })
|
|
4126
4161
|
] }),
|
|
4127
4162
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4128
4163
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
@@ -4130,24 +4165,24 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4130
4165
|
] }),
|
|
4131
4166
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4132
4167
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4133
|
-
/* @__PURE__ */ a(pe, { variant:
|
|
4168
|
+
/* @__PURE__ */ a(pe, { variant: q > 1 ? "success" : "warning", children: q })
|
|
4134
4169
|
] })
|
|
4135
4170
|
] }),
|
|
4136
|
-
|
|
4171
|
+
w && /* @__PURE__ */ a("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4137
4172
|
/* @__PURE__ */ a("strong", { children: "Previous Attempt:" }),
|
|
4138
4173
|
" ",
|
|
4139
|
-
|
|
4174
|
+
w
|
|
4140
4175
|
] }) }),
|
|
4141
|
-
|
|
4176
|
+
q <= 0 && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4142
4177
|
] }),
|
|
4143
|
-
/* @__PURE__ */ o(
|
|
4178
|
+
/* @__PURE__ */ o(se, { className: "flex justify-between", children: [
|
|
4144
4179
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4145
4180
|
/* @__PURE__ */ a(
|
|
4146
4181
|
U,
|
|
4147
4182
|
{
|
|
4148
4183
|
type: "button",
|
|
4149
|
-
onClick:
|
|
4150
|
-
disabled:
|
|
4184
|
+
onClick: h,
|
|
4185
|
+
disabled: q <= 0,
|
|
4151
4186
|
children: "Start Test"
|
|
4152
4187
|
}
|
|
4153
4188
|
)
|
|
@@ -4158,8 +4193,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4158
4193
|
onComplete: t,
|
|
4159
4194
|
onBack: r
|
|
4160
4195
|
}) => {
|
|
4161
|
-
var
|
|
4162
|
-
const { applicantService: n, baseInformationService: s, config: i } =
|
|
4196
|
+
var Y, x, P, $;
|
|
4197
|
+
const { applicantService: n, baseInformationService: s, config: i } = ie(), { identityData: l, provider: c, token: d, isLoading: u, error: w, requestIdentity: k, restartIdentity: g } = Ht(e), [m, p] = v(null), [N, f] = v(null), [y, E] = v([]), [S, C] = v(!0), [O, W] = v(!1), [F, h] = v(null), [A, I] = v(!1), H = te.useRef(!1), q = Ve({
|
|
4163
4198
|
defaultValues: {
|
|
4164
4199
|
street: "",
|
|
4165
4200
|
streetNumber: "",
|
|
@@ -4170,21 +4205,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4170
4205
|
phonenumber: ""
|
|
4171
4206
|
}
|
|
4172
4207
|
});
|
|
4173
|
-
|
|
4208
|
+
G(() => {
|
|
4174
4209
|
(async () => {
|
|
4175
4210
|
try {
|
|
4176
|
-
const [
|
|
4211
|
+
const [b, B] = await Promise.all([
|
|
4177
4212
|
n.getApplicantData(e),
|
|
4178
4213
|
s.getCountries("", "en")
|
|
4179
4214
|
]);
|
|
4180
|
-
|
|
4181
|
-
const
|
|
4215
|
+
f(b);
|
|
4216
|
+
const V = /* @__PURE__ */ new Set(), X = B.filter((me) => {
|
|
4182
4217
|
const Ee = me.abbreviation3 || me.abbreviation;
|
|
4183
|
-
return !Ee ||
|
|
4218
|
+
return !Ee || V.has(Ee) ? !1 : (V.add(Ee), !0);
|
|
4184
4219
|
});
|
|
4185
4220
|
E(X);
|
|
4186
|
-
const _ =
|
|
4187
|
-
if (
|
|
4221
|
+
const _ = b.applicantRequestData;
|
|
4222
|
+
if (q.reset({
|
|
4188
4223
|
street: (_ == null ? void 0 : _.street) || "",
|
|
4189
4224
|
streetNumber: (_ == null ? void 0 : _.streetNumber) || "",
|
|
4190
4225
|
city: (_ == null ? void 0 : _.city) || "",
|
|
@@ -4192,125 +4227,125 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4192
4227
|
country: (_ == null ? void 0 : _.country) || "",
|
|
4193
4228
|
nationality: (_ == null ? void 0 : _.nationality) || "",
|
|
4194
4229
|
phonenumber: (_ == null ? void 0 : _.phonenumber) || ""
|
|
4195
|
-
}),
|
|
4196
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
4230
|
+
}), b.kycRecords && b.kycRecords.length > 0 && b.kycRecords[0].providerTokenObject !== null && !H.current) {
|
|
4231
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), H.current = !0;
|
|
4197
4232
|
try {
|
|
4198
|
-
await
|
|
4233
|
+
await k(), W(!0);
|
|
4199
4234
|
} catch (me) {
|
|
4200
4235
|
console.error("[Identity] Auto-request failed:", me);
|
|
4201
4236
|
}
|
|
4202
4237
|
}
|
|
4203
|
-
} catch (
|
|
4204
|
-
console.error("Error loading applicant data:",
|
|
4238
|
+
} catch (b) {
|
|
4239
|
+
console.error("Error loading applicant data:", b);
|
|
4205
4240
|
} finally {
|
|
4206
|
-
|
|
4241
|
+
C(!1);
|
|
4207
4242
|
}
|
|
4208
4243
|
})();
|
|
4209
|
-
}, [e]),
|
|
4210
|
-
l && !
|
|
4211
|
-
}, [l,
|
|
4244
|
+
}, [e]), G(() => {
|
|
4245
|
+
l && !O && (console.log("[Identity] Identity data already loaded, showing provider"), W(!0));
|
|
4246
|
+
}, [l, O]), G(() => {
|
|
4212
4247
|
if (d) {
|
|
4213
4248
|
if (d.expiresAt) {
|
|
4214
|
-
const
|
|
4215
|
-
if (Date.now() >=
|
|
4216
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
4249
|
+
const D = new Date(d.expiresAt).getTime();
|
|
4250
|
+
if (Date.now() >= D) {
|
|
4251
|
+
console.warn("[Identity] Token has expired (expiresAt)"), I(!0), h("Your verification session has expired. Please restart.");
|
|
4217
4252
|
return;
|
|
4218
4253
|
}
|
|
4219
4254
|
}
|
|
4220
4255
|
if (d.url)
|
|
4221
4256
|
try {
|
|
4222
|
-
const
|
|
4223
|
-
if (
|
|
4224
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
4257
|
+
const b = new URL(d.url).toString().toLowerCase();
|
|
4258
|
+
if (b.includes("expired") || b.includes("invalid") || b.includes("error")) {
|
|
4259
|
+
console.warn("[Identity] Token URL indicates expiration"), I(!0), h("Your verification link has expired. Please restart.");
|
|
4225
4260
|
return;
|
|
4226
4261
|
}
|
|
4227
4262
|
} catch {
|
|
4228
4263
|
console.error("[Identity] Invalid token URL");
|
|
4229
4264
|
}
|
|
4230
4265
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
4231
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
4266
|
+
console.warn("[Identity] Token object indicates expiration"), I(!0), h("Your verification session has expired. Please restart.");
|
|
4232
4267
|
return;
|
|
4233
4268
|
}
|
|
4234
4269
|
}
|
|
4235
|
-
}, [d]),
|
|
4236
|
-
if (c !== null && d && !
|
|
4237
|
-
const
|
|
4270
|
+
}, [d]), G(() => {
|
|
4271
|
+
if (c !== null && d && !m && O && !A) {
|
|
4272
|
+
const D = c;
|
|
4238
4273
|
if (d.url) {
|
|
4239
|
-
console.log("[Identity] Loading provider URL for user verification:", d.url),
|
|
4274
|
+
console.log("[Identity] Loading provider URL for user verification:", d.url), h(null);
|
|
4240
4275
|
try {
|
|
4241
|
-
if (new URL(d.url),
|
|
4276
|
+
if (new URL(d.url), D === oe.SardinAI) {
|
|
4242
4277
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4243
4278
|
try {
|
|
4244
|
-
const
|
|
4245
|
-
xe.createProvider(c,
|
|
4279
|
+
const b = xe.parseProviderConfig(c, d, i);
|
|
4280
|
+
xe.createProvider(c, b).initialize().then(() => {
|
|
4246
4281
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4247
|
-
}).catch((
|
|
4248
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
4282
|
+
}).catch((V) => {
|
|
4283
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", V);
|
|
4249
4284
|
});
|
|
4250
|
-
} catch (
|
|
4251
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
4285
|
+
} catch (b) {
|
|
4286
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", b);
|
|
4252
4287
|
}
|
|
4253
4288
|
}
|
|
4254
|
-
|
|
4255
|
-
} catch (
|
|
4256
|
-
console.error("[Identity] Invalid URL:",
|
|
4289
|
+
p({ type: "url", url: d.url });
|
|
4290
|
+
} catch (b) {
|
|
4291
|
+
console.error("[Identity] Invalid URL:", b), h("Invalid verification URL. Please restart."), I(!0);
|
|
4257
4292
|
}
|
|
4258
4293
|
return;
|
|
4259
4294
|
}
|
|
4260
|
-
if (
|
|
4261
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4295
|
+
if (D === oe.SardinAI) {
|
|
4296
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), h(null);
|
|
4262
4297
|
try {
|
|
4263
|
-
const
|
|
4298
|
+
const b = xe.parseProviderConfig(c, d, i), B = xe.createProvider(c, b);
|
|
4264
4299
|
B.initialize().then(() => {
|
|
4265
|
-
console.log("[SardinAI] Risk SDK initialized successfully"),
|
|
4300
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), p(B), setTimeout(() => {
|
|
4266
4301
|
t == null || t();
|
|
4267
4302
|
}, 2e3);
|
|
4268
|
-
}).catch((
|
|
4303
|
+
}).catch((V) => {
|
|
4269
4304
|
var _;
|
|
4270
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4271
|
-
const X = ((_ =
|
|
4272
|
-
X.includes("expired") || X.includes("invalid") || X.includes("401") || X.includes("400") ? (
|
|
4305
|
+
console.error("[SardinAI] Failed to initialize:", V);
|
|
4306
|
+
const X = ((_ = V.message) == null ? void 0 : _.toLowerCase()) || "";
|
|
4307
|
+
X.includes("expired") || X.includes("invalid") || X.includes("401") || X.includes("400") ? (I(!0), h("Session expired or invalid. Please restart verification.")) : h(`Failed to initialize: ${V.message}`);
|
|
4273
4308
|
});
|
|
4274
|
-
} catch (
|
|
4275
|
-
console.error("[SardinAI] Error creating provider:",
|
|
4309
|
+
} catch (b) {
|
|
4310
|
+
console.error("[SardinAI] Error creating provider:", b), h(`Configuration error: ${b.message}`);
|
|
4276
4311
|
}
|
|
4277
4312
|
return;
|
|
4278
4313
|
}
|
|
4279
4314
|
try {
|
|
4280
|
-
|
|
4281
|
-
const
|
|
4282
|
-
|
|
4315
|
+
h(null);
|
|
4316
|
+
const b = xe.parseProviderConfig(c, d, i), B = xe.createProvider(c, b);
|
|
4317
|
+
D === oe.Sumsub ? (B.initialize("identity-container").catch((V) => {
|
|
4283
4318
|
var X;
|
|
4284
|
-
console.error("[Sumsub] Initialization error:",
|
|
4319
|
+
console.error("[Sumsub] Initialization error:", V), h(`Failed to initialize: ${V.message}`), (X = V.message) != null && X.toLowerCase().includes("expired") && I(!0);
|
|
4285
4320
|
}), B.onComplete && B.onComplete(() => {
|
|
4286
4321
|
t == null || t();
|
|
4287
|
-
})) :
|
|
4288
|
-
console.error("[Onfido] Initialization error:",
|
|
4289
|
-
}),
|
|
4290
|
-
} catch (
|
|
4291
|
-
console.error("[Identity] Provider setup error:",
|
|
4322
|
+
})) : D === oe.Onfido && B.initialize("identity-container").catch((V) => {
|
|
4323
|
+
console.error("[Onfido] Initialization error:", V), h(`Failed to initialize: ${V.message}`);
|
|
4324
|
+
}), p(B);
|
|
4325
|
+
} catch (b) {
|
|
4326
|
+
console.error("[Identity] Provider setup error:", b), h(`Setup error: ${b.message}`);
|
|
4292
4327
|
}
|
|
4293
4328
|
}
|
|
4294
4329
|
return () => {
|
|
4295
|
-
if (
|
|
4330
|
+
if (m && m.destroy)
|
|
4296
4331
|
try {
|
|
4297
|
-
|
|
4298
|
-
} catch (
|
|
4299
|
-
console.error("[Identity] Error destroying provider:",
|
|
4332
|
+
m.destroy();
|
|
4333
|
+
} catch (D) {
|
|
4334
|
+
console.error("[Identity] Error destroying provider:", D);
|
|
4300
4335
|
}
|
|
4301
4336
|
};
|
|
4302
|
-
}, [c, d,
|
|
4303
|
-
const
|
|
4337
|
+
}, [c, d, m, O, t, A]);
|
|
4338
|
+
const L = async () => {
|
|
4304
4339
|
try {
|
|
4305
|
-
|
|
4306
|
-
} catch (
|
|
4307
|
-
console.error("Error starting identity verification:",
|
|
4340
|
+
h(null), I(!1), await k(), W(!0);
|
|
4341
|
+
} catch (D) {
|
|
4342
|
+
console.error("Error starting identity verification:", D);
|
|
4308
4343
|
}
|
|
4309
|
-
},
|
|
4344
|
+
}, R = async () => {
|
|
4310
4345
|
try {
|
|
4311
|
-
|
|
4312
|
-
} catch (
|
|
4313
|
-
console.error("Error restarting identity verification:",
|
|
4346
|
+
h(null), I(!1), p(null), console.log("[Identity] Restarting verification..."), await g(), W(!0);
|
|
4347
|
+
} catch (D) {
|
|
4348
|
+
console.error("Error restarting identity verification:", D), h(D.message || "Failed to restart verification");
|
|
4314
4349
|
}
|
|
4315
4350
|
};
|
|
4316
4351
|
if (S || u)
|
|
@@ -4318,14 +4353,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4318
4353
|
/* @__PURE__ */ a(ce, { className: "my-8" }),
|
|
4319
4354
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4320
4355
|
] }) });
|
|
4321
|
-
if (
|
|
4356
|
+
if (w)
|
|
4322
4357
|
return /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4323
4358
|
"Error: ",
|
|
4324
|
-
|
|
4359
|
+
w.message
|
|
4325
4360
|
] }) }) });
|
|
4326
|
-
if (
|
|
4361
|
+
if (O && (F || A))
|
|
4327
4362
|
return /* @__PURE__ */ o(M, { children: [
|
|
4328
|
-
/* @__PURE__ */ a(
|
|
4363
|
+
/* @__PURE__ */ a(re, { children: /* @__PURE__ */ a("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4329
4364
|
/* @__PURE__ */ o(T, { children: [
|
|
4330
4365
|
/* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4331
4366
|
/* @__PURE__ */ a(
|
|
@@ -4347,8 +4382,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4347
4382
|
}
|
|
4348
4383
|
),
|
|
4349
4384
|
/* @__PURE__ */ o("div", { children: [
|
|
4350
|
-
/* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4351
|
-
/* @__PURE__ */ a("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4385
|
+
/* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: A ? "Session Expired" : "Verification Error" }),
|
|
4386
|
+
/* @__PURE__ */ a("p", { className: "text-red-800 dark:text-red-200 text-sm", children: F || "Your verification session has expired and needs to be restarted." })
|
|
4352
4387
|
] })
|
|
4353
4388
|
] }) }),
|
|
4354
4389
|
/* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -4360,15 +4395,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4360
4395
|
] })
|
|
4361
4396
|
] })
|
|
4362
4397
|
] }),
|
|
4363
|
-
/* @__PURE__ */ o(
|
|
4398
|
+
/* @__PURE__ */ o(se, { className: "flex justify-between", children: [
|
|
4364
4399
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4365
|
-
/* @__PURE__ */ a(U, { type: "button", onClick:
|
|
4400
|
+
/* @__PURE__ */ a(U, { type: "button", onClick: R, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
|
|
4366
4401
|
] })
|
|
4367
4402
|
] });
|
|
4368
|
-
if (
|
|
4369
|
-
const
|
|
4403
|
+
if (O && l) {
|
|
4404
|
+
const D = c;
|
|
4370
4405
|
return d != null && d.url ? /* @__PURE__ */ o(M, { children: [
|
|
4371
|
-
/* @__PURE__ */ a(
|
|
4406
|
+
/* @__PURE__ */ a(re, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4372
4407
|
/* @__PURE__ */ o("div", { children: [
|
|
4373
4408
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4374
4409
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
@@ -4379,7 +4414,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4379
4414
|
type: "button",
|
|
4380
4415
|
variant: "outline",
|
|
4381
4416
|
size: "sm",
|
|
4382
|
-
onClick:
|
|
4417
|
+
onClick: R,
|
|
4383
4418
|
disabled: u,
|
|
4384
4419
|
children: "Restart"
|
|
4385
4420
|
}
|
|
@@ -4397,14 +4432,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4397
4432
|
className: "w-full h-full border-0 rounded-lg",
|
|
4398
4433
|
allow: "camera; microphone; geolocation",
|
|
4399
4434
|
title: "Identity Verification",
|
|
4400
|
-
onLoad: (
|
|
4401
|
-
var B,
|
|
4435
|
+
onLoad: (b) => {
|
|
4436
|
+
var B, V, X;
|
|
4402
4437
|
console.log("[Identity] Iframe loaded");
|
|
4403
4438
|
try {
|
|
4404
|
-
const _ =
|
|
4439
|
+
const _ = b.target, Ie = _.contentDocument || ((B = _.contentWindow) == null ? void 0 : B.document);
|
|
4405
4440
|
if (Ie) {
|
|
4406
|
-
const me = ((X = (
|
|
4407
|
-
(me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"),
|
|
4441
|
+
const me = ((X = (V = Ie.body) == null ? void 0 : V.textContent) == null ? void 0 : X.toLowerCase()) || "";
|
|
4442
|
+
(me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), I(!0), h("Your verification link has expired."));
|
|
4408
4443
|
}
|
|
4409
4444
|
} catch {
|
|
4410
4445
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4413,9 +4448,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4413
4448
|
}
|
|
4414
4449
|
) })
|
|
4415
4450
|
] }),
|
|
4416
|
-
r && /* @__PURE__ */ a(
|
|
4417
|
-
] }) :
|
|
4418
|
-
/* @__PURE__ */ o(
|
|
4451
|
+
r && /* @__PURE__ */ a(se, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4452
|
+
] }) : D === oe.SardinAI ? /* @__PURE__ */ o(M, { children: [
|
|
4453
|
+
/* @__PURE__ */ o(re, { children: [
|
|
4419
4454
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4420
4455
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4421
4456
|
] }),
|
|
@@ -4425,16 +4460,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4425
4460
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
4426
4461
|
] }) })
|
|
4427
4462
|
] }) : /* @__PURE__ */ o(M, { children: [
|
|
4428
|
-
/* @__PURE__ */ o(
|
|
4463
|
+
/* @__PURE__ */ o(re, { children: [
|
|
4429
4464
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4430
4465
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4431
4466
|
] }),
|
|
4432
4467
|
/* @__PURE__ */ a(T, { children: /* @__PURE__ */ a("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4433
|
-
r && /* @__PURE__ */ a(
|
|
4468
|
+
r && /* @__PURE__ */ a(se, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4434
4469
|
] });
|
|
4435
4470
|
}
|
|
4436
|
-
return /* @__PURE__ */ a("form", { onSubmit:
|
|
4437
|
-
/* @__PURE__ */ o(
|
|
4471
|
+
return /* @__PURE__ */ a("form", { onSubmit: q.handleSubmit(L), children: /* @__PURE__ */ o(M, { children: [
|
|
4472
|
+
/* @__PURE__ */ o(re, { children: [
|
|
4438
4473
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
|
|
4439
4474
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
4440
4475
|
] }),
|
|
@@ -4443,14 +4478,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4443
4478
|
/* @__PURE__ */ o("div", { children: [
|
|
4444
4479
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4445
4480
|
/* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
|
|
4446
|
-
(
|
|
4481
|
+
(Y = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : Y.firstName,
|
|
4447
4482
|
" ",
|
|
4448
|
-
(
|
|
4483
|
+
(x = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : x.lastName
|
|
4449
4484
|
] })
|
|
4450
4485
|
] }),
|
|
4451
4486
|
/* @__PURE__ */ o("div", { children: [
|
|
4452
4487
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4453
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (
|
|
4488
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (P = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : P.email })
|
|
4454
4489
|
] }),
|
|
4455
4490
|
/* @__PURE__ */ o("div", { children: [
|
|
4456
4491
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
@@ -4463,18 +4498,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4463
4498
|
/* @__PURE__ */ a(
|
|
4464
4499
|
ye,
|
|
4465
4500
|
{
|
|
4466
|
-
control:
|
|
4501
|
+
control: q.control,
|
|
4467
4502
|
name: "country",
|
|
4468
|
-
render: ({ field:
|
|
4503
|
+
render: ({ field: D }) => /* @__PURE__ */ a(
|
|
4469
4504
|
ge,
|
|
4470
4505
|
{
|
|
4471
|
-
...
|
|
4506
|
+
...D,
|
|
4472
4507
|
label: "Country",
|
|
4473
4508
|
options: [
|
|
4474
4509
|
{ value: "", label: "Select country..." },
|
|
4475
|
-
...
|
|
4476
|
-
value:
|
|
4477
|
-
label:
|
|
4510
|
+
...y.map((b) => ({
|
|
4511
|
+
value: b.abbreviation3 || b.abbreviation,
|
|
4512
|
+
label: b.name
|
|
4478
4513
|
}))
|
|
4479
4514
|
]
|
|
4480
4515
|
}
|
|
@@ -4484,18 +4519,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4484
4519
|
/* @__PURE__ */ a(
|
|
4485
4520
|
ye,
|
|
4486
4521
|
{
|
|
4487
|
-
control:
|
|
4522
|
+
control: q.control,
|
|
4488
4523
|
name: "nationality",
|
|
4489
|
-
render: ({ field:
|
|
4524
|
+
render: ({ field: D }) => /* @__PURE__ */ a(
|
|
4490
4525
|
ge,
|
|
4491
4526
|
{
|
|
4492
|
-
...
|
|
4527
|
+
...D,
|
|
4493
4528
|
label: "Nationality",
|
|
4494
4529
|
options: [
|
|
4495
4530
|
{ value: "", label: "Select nationality..." },
|
|
4496
|
-
...
|
|
4497
|
-
value:
|
|
4498
|
-
label:
|
|
4531
|
+
...y.map((b) => ({
|
|
4532
|
+
value: b.abbreviation3 || b.abbreviation,
|
|
4533
|
+
label: b.name
|
|
4499
4534
|
}))
|
|
4500
4535
|
]
|
|
4501
4536
|
}
|
|
@@ -4507,17 +4542,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4507
4542
|
/* @__PURE__ */ a(
|
|
4508
4543
|
ye,
|
|
4509
4544
|
{
|
|
4510
|
-
control:
|
|
4545
|
+
control: q.control,
|
|
4511
4546
|
name: "street",
|
|
4512
|
-
render: ({ field:
|
|
4547
|
+
render: ({ field: D }) => /* @__PURE__ */ a(ne, { ...D, label: "Street" })
|
|
4513
4548
|
}
|
|
4514
4549
|
),
|
|
4515
4550
|
/* @__PURE__ */ a(
|
|
4516
4551
|
ye,
|
|
4517
4552
|
{
|
|
4518
|
-
control:
|
|
4553
|
+
control: q.control,
|
|
4519
4554
|
name: "streetNumber",
|
|
4520
|
-
render: ({ field:
|
|
4555
|
+
render: ({ field: D }) => /* @__PURE__ */ a(ne, { ...D, label: "Street Number" })
|
|
4521
4556
|
}
|
|
4522
4557
|
)
|
|
4523
4558
|
] }),
|
|
@@ -4525,31 +4560,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4525
4560
|
/* @__PURE__ */ a(
|
|
4526
4561
|
ye,
|
|
4527
4562
|
{
|
|
4528
|
-
control:
|
|
4563
|
+
control: q.control,
|
|
4529
4564
|
name: "city",
|
|
4530
|
-
render: ({ field:
|
|
4565
|
+
render: ({ field: D }) => /* @__PURE__ */ a(ne, { ...D, label: "City" })
|
|
4531
4566
|
}
|
|
4532
4567
|
),
|
|
4533
4568
|
/* @__PURE__ */ a(
|
|
4534
4569
|
ye,
|
|
4535
4570
|
{
|
|
4536
|
-
control:
|
|
4571
|
+
control: q.control,
|
|
4537
4572
|
name: "zip",
|
|
4538
|
-
render: ({ field:
|
|
4573
|
+
render: ({ field: D }) => /* @__PURE__ */ a(ne, { ...D, label: "ZIP/Postal Code" })
|
|
4539
4574
|
}
|
|
4540
4575
|
)
|
|
4541
4576
|
] }),
|
|
4542
4577
|
/* @__PURE__ */ a(
|
|
4543
4578
|
ye,
|
|
4544
4579
|
{
|
|
4545
|
-
control:
|
|
4580
|
+
control: q.control,
|
|
4546
4581
|
name: "phonenumber",
|
|
4547
|
-
render: ({ field:
|
|
4582
|
+
render: ({ field: D }) => /* @__PURE__ */ a(ne, { ...D, label: "Phone Number", type: "tel" })
|
|
4548
4583
|
}
|
|
4549
4584
|
)
|
|
4550
4585
|
] })
|
|
4551
4586
|
] }),
|
|
4552
|
-
/* @__PURE__ */ o(
|
|
4587
|
+
/* @__PURE__ */ o(se, { className: "flex justify-between", children: [
|
|
4553
4588
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4554
4589
|
/* @__PURE__ */ a(U, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4555
4590
|
] })
|
|
@@ -4687,7 +4722,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4687
4722
|
] })
|
|
4688
4723
|
] }) })
|
|
4689
4724
|
] }),
|
|
4690
|
-
/* @__PURE__ */ o(
|
|
4725
|
+
/* @__PURE__ */ o(se, { className: "flex justify-center gap-4", children: [
|
|
4691
4726
|
c.type === "success" && s && /* @__PURE__ */ a(U, { onClick: s, size: "lg", children: "Continue" }),
|
|
4692
4727
|
c.type === "error" && /* @__PURE__ */ o(Qe, { children: [
|
|
4693
4728
|
i && /* @__PURE__ */ a(U, { variant: "outline", onClick: i, children: "Contact Support" }),
|
|
@@ -4716,7 +4751,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4716
4751
|
subtitle: t,
|
|
4717
4752
|
className: r = ""
|
|
4718
4753
|
}) => {
|
|
4719
|
-
const { currentTheme: n } =
|
|
4754
|
+
const { currentTheme: n } = ie(), s = e || (n == null ? void 0 : n.title) || "", i = !!(n != null && n.logo && n.logo.visible && n.logo.url), l = !!s;
|
|
4720
4755
|
return !i && !l ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
|
|
4721
4756
|
/* @__PURE__ */ o("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4722
4757
|
i && /* @__PURE__ */ a(br, { config: n.logo }),
|
|
@@ -4732,33 +4767,33 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4732
4767
|
] }),
|
|
4733
4768
|
t && /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
4734
4769
|
] });
|
|
4735
|
-
},
|
|
4770
|
+
}, Br = ({
|
|
4736
4771
|
workflowKey: e,
|
|
4737
4772
|
externalRefId: t,
|
|
4738
4773
|
onSuccess: r,
|
|
4739
4774
|
onCancel: n
|
|
4740
4775
|
}) => {
|
|
4741
|
-
var
|
|
4742
|
-
const { config: s, baseInformationService: i, currentTheme: l } =
|
|
4776
|
+
var L, R, Y;
|
|
4777
|
+
const { config: s, baseInformationService: i, currentTheme: l } = ie(), { createApplicant: c, isLoading: d } = Wt(), [u, w] = v([]), [k, g] = v(!0), [m, p] = v(!1), [N, f] = v(null), y = Q(!1), E = Q(!1), S = e || ((L = s.applicantForm) == null ? void 0 : L.workflowKey);
|
|
4743
4778
|
if (!S)
|
|
4744
4779
|
throw new Error(
|
|
4745
4780
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4746
4781
|
);
|
|
4747
|
-
const
|
|
4748
|
-
const
|
|
4749
|
-
if (
|
|
4750
|
-
for (const $ of
|
|
4751
|
-
|
|
4752
|
-
return Array.from(
|
|
4753
|
-
}, [l == null ? void 0 : l.applicantFormRequiredFields]),
|
|
4782
|
+
const C = t || ((R = s.applicantForm) == null ? void 0 : R.externalRefId) || "", O = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"], W = te.useMemo(() => {
|
|
4783
|
+
const x = new Set(O), P = l == null ? void 0 : l.applicantFormRequiredFields;
|
|
4784
|
+
if (P && P.length > 0)
|
|
4785
|
+
for (const $ of P)
|
|
4786
|
+
x.add($);
|
|
4787
|
+
return Array.from(x);
|
|
4788
|
+
}, [l == null ? void 0 : l.applicantFormRequiredFields]), F = te.useMemo(() => {
|
|
4754
4789
|
var $;
|
|
4755
|
-
let
|
|
4756
|
-
($ = s.applicantForm) != null && $.visibleFields ?
|
|
4757
|
-
const
|
|
4758
|
-
for (const
|
|
4759
|
-
|
|
4760
|
-
return Array.from(
|
|
4761
|
-
}, [(
|
|
4790
|
+
let x;
|
|
4791
|
+
($ = s.applicantForm) != null && $.visibleFields ? x = s.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? x = l.applicantFormVisibleFields : x = ot;
|
|
4792
|
+
const P = new Set(x);
|
|
4793
|
+
for (const D of O)
|
|
4794
|
+
P.add(D);
|
|
4795
|
+
return Array.from(P);
|
|
4796
|
+
}, [(Y = s.applicantForm) == null ? void 0 : Y.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields]), [h, A] = v({
|
|
4762
4797
|
workflowKey: S,
|
|
4763
4798
|
firstName: "",
|
|
4764
4799
|
lastName: "",
|
|
@@ -4766,7 +4801,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4766
4801
|
email: "",
|
|
4767
4802
|
dateOfBirth: "",
|
|
4768
4803
|
phonenumber: "",
|
|
4769
|
-
externalRefId:
|
|
4804
|
+
externalRefId: C,
|
|
4770
4805
|
// Set from config or prop
|
|
4771
4806
|
mobileCountryCode: "",
|
|
4772
4807
|
street: "",
|
|
@@ -4785,91 +4820,91 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4785
4820
|
occupation: "",
|
|
4786
4821
|
taxNumber: ""
|
|
4787
4822
|
});
|
|
4788
|
-
|
|
4823
|
+
G(() => {
|
|
4789
4824
|
(async () => {
|
|
4790
|
-
if (
|
|
4825
|
+
if (y.current || E.current) {
|
|
4791
4826
|
console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
|
|
4792
4827
|
return;
|
|
4793
4828
|
}
|
|
4794
|
-
|
|
4829
|
+
y.current = !0, g(!0);
|
|
4795
4830
|
try {
|
|
4796
|
-
const
|
|
4797
|
-
value:
|
|
4798
|
-
label:
|
|
4799
|
-
})).filter((
|
|
4800
|
-
|
|
4801
|
-
} catch (
|
|
4802
|
-
console.error("Failed to load countries:",
|
|
4831
|
+
const P = await i.getCountries("", s.locale || "en"), $ = /* @__PURE__ */ new Set(), D = P.map((b) => ({
|
|
4832
|
+
value: b.abbreviation3 || b.abbreviation,
|
|
4833
|
+
label: b.name
|
|
4834
|
+
})).filter((b) => !b.value || $.has(b.value) ? !1 : ($.add(b.value), !0));
|
|
4835
|
+
w(D), E.current = !0;
|
|
4836
|
+
} catch (P) {
|
|
4837
|
+
console.error("Failed to load countries:", P);
|
|
4803
4838
|
} finally {
|
|
4804
|
-
|
|
4839
|
+
g(!1), y.current = !1;
|
|
4805
4840
|
}
|
|
4806
4841
|
})();
|
|
4807
4842
|
}, []);
|
|
4808
|
-
const
|
|
4809
|
-
|
|
4810
|
-
},
|
|
4811
|
-
var
|
|
4812
|
-
|
|
4843
|
+
const I = (x, P) => {
|
|
4844
|
+
A(($) => ({ ...$, [x]: P }));
|
|
4845
|
+
}, H = async (x) => {
|
|
4846
|
+
var P;
|
|
4847
|
+
x.preventDefault(), p(!0), f(null);
|
|
4813
4848
|
try {
|
|
4814
|
-
if (!
|
|
4815
|
-
|
|
4849
|
+
if (!h.externalRefId || h.externalRefId.trim() === "") {
|
|
4850
|
+
f("External Reference ID is required. Please pass it via config.applicantForm.externalRefId."), p(!1);
|
|
4816
4851
|
return;
|
|
4817
4852
|
}
|
|
4818
|
-
for (const
|
|
4819
|
-
const B =
|
|
4853
|
+
for (const b of W) {
|
|
4854
|
+
const B = h[b];
|
|
4820
4855
|
if (B == null || B === "" || Array.isArray(B) && B.length === 0) {
|
|
4821
|
-
const X = ((
|
|
4822
|
-
|
|
4856
|
+
const X = ((P = Pe[b]) == null ? void 0 : P.label) || b;
|
|
4857
|
+
f(`${X} is required.`), p(!1);
|
|
4823
4858
|
return;
|
|
4824
4859
|
}
|
|
4825
4860
|
}
|
|
4826
4861
|
const $ = {
|
|
4827
|
-
workflowKey:
|
|
4828
|
-
externalRefId:
|
|
4862
|
+
workflowKey: h.workflowKey,
|
|
4863
|
+
externalRefId: h.externalRefId.trim()
|
|
4829
4864
|
// Always include, never empty
|
|
4830
4865
|
};
|
|
4831
|
-
|
|
4832
|
-
if (
|
|
4833
|
-
const B =
|
|
4834
|
-
B != null && B !== "" && !(Array.isArray(B) && B.length === 0) && ($[
|
|
4866
|
+
F.forEach((b) => {
|
|
4867
|
+
if (b === "externalRefId") return;
|
|
4868
|
+
const B = h[b];
|
|
4869
|
+
B != null && B !== "" && !(Array.isArray(B) && B.length === 0) && ($[b] = B);
|
|
4835
4870
|
}), console.log("Creating applicant with data:", $);
|
|
4836
|
-
const
|
|
4871
|
+
const D = await c(
|
|
4837
4872
|
$
|
|
4838
4873
|
);
|
|
4839
|
-
console.log("Applicant created:",
|
|
4874
|
+
console.log("Applicant created:", D), r(D.applicantId);
|
|
4840
4875
|
} catch ($) {
|
|
4841
|
-
console.error("Error creating applicant:", $),
|
|
4876
|
+
console.error("Error creating applicant:", $), f($.message || "Failed to create applicant");
|
|
4842
4877
|
} finally {
|
|
4843
|
-
|
|
4878
|
+
p(!1);
|
|
4844
4879
|
}
|
|
4845
|
-
},
|
|
4846
|
-
var
|
|
4847
|
-
const
|
|
4848
|
-
switch (
|
|
4880
|
+
}, q = (x) => {
|
|
4881
|
+
var D;
|
|
4882
|
+
const P = Pe[x], $ = W.includes(x);
|
|
4883
|
+
switch (P.type) {
|
|
4849
4884
|
case "select":
|
|
4850
|
-
if (
|
|
4885
|
+
if (x === "country" || x === "nationality" || x === "taxCountry" || x === "countryOfBirth")
|
|
4851
4886
|
return /* @__PURE__ */ a(
|
|
4852
4887
|
ge,
|
|
4853
4888
|
{
|
|
4854
|
-
label:
|
|
4855
|
-
value:
|
|
4856
|
-
onChange: (
|
|
4889
|
+
label: P.label,
|
|
4890
|
+
value: h[x] || "",
|
|
4891
|
+
onChange: (b) => I(x, b.target.value),
|
|
4857
4892
|
options: [
|
|
4858
|
-
{ value: "", label: `Select ${
|
|
4893
|
+
{ value: "", label: `Select ${P.label.toLowerCase()}...` },
|
|
4859
4894
|
...u
|
|
4860
4895
|
],
|
|
4861
|
-
disabled:
|
|
4896
|
+
disabled: k,
|
|
4862
4897
|
required: $
|
|
4863
4898
|
},
|
|
4864
|
-
|
|
4899
|
+
x
|
|
4865
4900
|
);
|
|
4866
|
-
if (
|
|
4901
|
+
if (x === "salutation")
|
|
4867
4902
|
return /* @__PURE__ */ a(
|
|
4868
4903
|
ge,
|
|
4869
4904
|
{
|
|
4870
|
-
label:
|
|
4871
|
-
value: ((
|
|
4872
|
-
onChange: (
|
|
4905
|
+
label: P.label,
|
|
4906
|
+
value: ((D = h[x]) == null ? void 0 : D.toString()) || "",
|
|
4907
|
+
onChange: (b) => I(x, b.target.value ? Number(b.target.value) : null),
|
|
4873
4908
|
options: [
|
|
4874
4909
|
{ value: "", label: "Select salutation..." },
|
|
4875
4910
|
{ value: Ce.Male.toString(), label: "Male" },
|
|
@@ -4878,96 +4913,96 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4878
4913
|
],
|
|
4879
4914
|
required: $
|
|
4880
4915
|
},
|
|
4881
|
-
|
|
4916
|
+
x
|
|
4882
4917
|
);
|
|
4883
|
-
if (
|
|
4884
|
-
const
|
|
4918
|
+
if (x === "defaultLanguage") {
|
|
4919
|
+
const b = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ? Le.filter((B) => l.allowedLanguages.includes(B.value)) : Le;
|
|
4885
4920
|
return /* @__PURE__ */ a(
|
|
4886
4921
|
ge,
|
|
4887
4922
|
{
|
|
4888
|
-
label:
|
|
4889
|
-
value:
|
|
4890
|
-
onChange: (B) =>
|
|
4923
|
+
label: P.label,
|
|
4924
|
+
value: h[x] || "",
|
|
4925
|
+
onChange: (B) => I(x, B.target.value),
|
|
4891
4926
|
options: [
|
|
4892
4927
|
{ value: "", label: "Select language..." },
|
|
4893
|
-
...
|
|
4928
|
+
...b
|
|
4894
4929
|
],
|
|
4895
4930
|
required: $
|
|
4896
4931
|
},
|
|
4897
|
-
|
|
4932
|
+
x
|
|
4898
4933
|
);
|
|
4899
4934
|
}
|
|
4900
4935
|
return null;
|
|
4901
4936
|
case "multiselect":
|
|
4902
|
-
return
|
|
4937
|
+
return x === "otherNationality" ? /* @__PURE__ */ a(
|
|
4903
4938
|
Qt,
|
|
4904
4939
|
{
|
|
4905
|
-
label:
|
|
4906
|
-
value:
|
|
4907
|
-
onChange: (
|
|
4940
|
+
label: P.label,
|
|
4941
|
+
value: h[x] || [],
|
|
4942
|
+
onChange: (b) => I(x, b),
|
|
4908
4943
|
options: u,
|
|
4909
4944
|
placeholder: "Select other nationalities...",
|
|
4910
|
-
disabled:
|
|
4945
|
+
disabled: k,
|
|
4911
4946
|
required: $
|
|
4912
4947
|
},
|
|
4913
|
-
|
|
4948
|
+
x
|
|
4914
4949
|
) : null;
|
|
4915
4950
|
case "date":
|
|
4916
4951
|
return /* @__PURE__ */ a(
|
|
4917
|
-
|
|
4952
|
+
ne,
|
|
4918
4953
|
{
|
|
4919
4954
|
type: "date",
|
|
4920
|
-
label:
|
|
4921
|
-
value:
|
|
4922
|
-
onChange: (
|
|
4955
|
+
label: P.label,
|
|
4956
|
+
value: h[x] || "",
|
|
4957
|
+
onChange: (b) => I(x, b.target.value),
|
|
4923
4958
|
required: $
|
|
4924
4959
|
},
|
|
4925
|
-
|
|
4960
|
+
x
|
|
4926
4961
|
);
|
|
4927
4962
|
case "email":
|
|
4928
4963
|
return /* @__PURE__ */ a(
|
|
4929
|
-
|
|
4964
|
+
ne,
|
|
4930
4965
|
{
|
|
4931
4966
|
type: "email",
|
|
4932
|
-
label:
|
|
4933
|
-
value:
|
|
4934
|
-
onChange: (
|
|
4967
|
+
label: P.label,
|
|
4968
|
+
value: h[x] || "",
|
|
4969
|
+
onChange: (b) => I(x, b.target.value),
|
|
4935
4970
|
required: $
|
|
4936
4971
|
},
|
|
4937
|
-
|
|
4972
|
+
x
|
|
4938
4973
|
);
|
|
4939
4974
|
case "tel":
|
|
4940
4975
|
return /* @__PURE__ */ a(
|
|
4941
|
-
|
|
4976
|
+
ne,
|
|
4942
4977
|
{
|
|
4943
4978
|
type: "tel",
|
|
4944
|
-
label:
|
|
4945
|
-
value:
|
|
4946
|
-
onChange: (
|
|
4979
|
+
label: P.label,
|
|
4980
|
+
value: h[x] || "",
|
|
4981
|
+
onChange: (b) => I(x, b.target.value),
|
|
4947
4982
|
required: $
|
|
4948
4983
|
},
|
|
4949
|
-
|
|
4984
|
+
x
|
|
4950
4985
|
);
|
|
4951
4986
|
case "text":
|
|
4952
4987
|
default:
|
|
4953
4988
|
return /* @__PURE__ */ a(
|
|
4954
|
-
|
|
4989
|
+
ne,
|
|
4955
4990
|
{
|
|
4956
4991
|
type: "text",
|
|
4957
|
-
label:
|
|
4958
|
-
value:
|
|
4959
|
-
onChange: (
|
|
4992
|
+
label: P.label,
|
|
4993
|
+
value: h[x] || "",
|
|
4994
|
+
onChange: (b) => I(x, b.target.value),
|
|
4960
4995
|
required: $
|
|
4961
4996
|
},
|
|
4962
|
-
|
|
4997
|
+
x
|
|
4963
4998
|
);
|
|
4964
4999
|
}
|
|
4965
5000
|
};
|
|
4966
|
-
return
|
|
5001
|
+
return k ? /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a(M, { children: /* @__PURE__ */ o(T, { children: [
|
|
4967
5002
|
/* @__PURE__ */ a(ce, { className: "my-8" }),
|
|
4968
5003
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4969
|
-
] }) }) }) : /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit:
|
|
4970
|
-
/* @__PURE__ */ a(
|
|
5004
|
+
] }) }) }) : /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit: H, children: /* @__PURE__ */ o(M, { children: [
|
|
5005
|
+
/* @__PURE__ */ a(re, { children: /* @__PURE__ */ a(
|
|
4971
5006
|
Ke,
|
|
4972
5007
|
{
|
|
4973
5008
|
title: "Create Applicant",
|
|
@@ -4980,11 +5015,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4980
5015
|
" ",
|
|
4981
5016
|
N
|
|
4982
5017
|
] }) }),
|
|
4983
|
-
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
5018
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: F.map((x) => q(x)) })
|
|
4984
5019
|
] }),
|
|
4985
|
-
/* @__PURE__ */ o(
|
|
4986
|
-
n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled:
|
|
4987
|
-
/* @__PURE__ */ a(U, { type: "submit", isLoading:
|
|
5020
|
+
/* @__PURE__ */ o(se, { className: "flex justify-between", children: [
|
|
5021
|
+
n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: m || d, children: "Cancel" }),
|
|
5022
|
+
/* @__PURE__ */ a(U, { type: "submit", isLoading: m || d, children: "Create Applicant" })
|
|
4988
5023
|
] })
|
|
4989
5024
|
] }) }) });
|
|
4990
5025
|
}, zr = ({
|
|
@@ -5000,31 +5035,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5000
5035
|
steps: c,
|
|
5001
5036
|
workflowKey: d,
|
|
5002
5037
|
nextWorkflowKey: u,
|
|
5003
|
-
hasWorkflowChanged:
|
|
5004
|
-
isLoading:
|
|
5005
|
-
error:
|
|
5006
|
-
moveBack:
|
|
5007
|
-
refreshProgress:
|
|
5008
|
-
} = Ut(e), [N,
|
|
5009
|
-
if (
|
|
5010
|
-
|
|
5011
|
-
}, [
|
|
5038
|
+
hasWorkflowChanged: w,
|
|
5039
|
+
isLoading: k,
|
|
5040
|
+
error: g,
|
|
5041
|
+
moveBack: m,
|
|
5042
|
+
refreshProgress: p
|
|
5043
|
+
} = Ut(e), [N, f] = te.useState(!1);
|
|
5044
|
+
if (te.useEffect(() => {
|
|
5045
|
+
g && r && r(g);
|
|
5046
|
+
}, [g, r]), te.useEffect(() => {
|
|
5012
5047
|
i != null && i.workflowResult && t && t(i.workflowResult);
|
|
5013
|
-
}, [i == null ? void 0 : i.workflowResult, t]),
|
|
5048
|
+
}, [i == null ? void 0 : i.workflowResult, t]), te.useEffect(() => {
|
|
5014
5049
|
n === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
5015
|
-
}, [n]),
|
|
5016
|
-
|
|
5017
|
-
}, [
|
|
5050
|
+
}, [n]), te.useEffect(() => {
|
|
5051
|
+
w && f(!1);
|
|
5052
|
+
}, [w]), k || !i)
|
|
5018
5053
|
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a(M, { children: /* @__PURE__ */ o(T, { children: [
|
|
5019
5054
|
/* @__PURE__ */ a(ce, { className: "my-8" }),
|
|
5020
5055
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
5021
5056
|
] }) }) });
|
|
5022
|
-
if (
|
|
5057
|
+
if (g)
|
|
5023
5058
|
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
5024
5059
|
/* @__PURE__ */ a("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
5025
|
-
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children:
|
|
5060
|
+
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
|
|
5026
5061
|
] }) }) }) });
|
|
5027
|
-
if (
|
|
5062
|
+
if (w && !N)
|
|
5028
5063
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(M, { children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
5029
5064
|
/* @__PURE__ */ a("div", { className: "mb-6", children: /* @__PURE__ */ a("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ a("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
|
|
5030
5065
|
/* @__PURE__ */ a("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
@@ -5046,7 +5081,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5046
5081
|
/* @__PURE__ */ a(
|
|
5047
5082
|
"button",
|
|
5048
5083
|
{
|
|
5049
|
-
onClick: () =>
|
|
5084
|
+
onClick: () => f(!0),
|
|
5050
5085
|
className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
|
|
5051
5086
|
children: "Continue with New Workflow"
|
|
5052
5087
|
}
|
|
@@ -5071,97 +5106,97 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5071
5106
|
/* @__PURE__ */ a(ce, { className: "my-8" }),
|
|
5072
5107
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === le.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
5073
5108
|
] }) }) });
|
|
5074
|
-
const
|
|
5075
|
-
switch (
|
|
5076
|
-
case
|
|
5109
|
+
const y = (C) => {
|
|
5110
|
+
switch (C) {
|
|
5111
|
+
case z.Overview:
|
|
5077
5112
|
return "Overview";
|
|
5078
|
-
case
|
|
5113
|
+
case z.Questionaries:
|
|
5079
5114
|
return "Questionnaire";
|
|
5080
|
-
case
|
|
5115
|
+
case z.UploadDocument:
|
|
5081
5116
|
return "Documents";
|
|
5082
|
-
case
|
|
5117
|
+
case z.IdentitySdk:
|
|
5083
5118
|
return "Identity";
|
|
5084
|
-
case
|
|
5119
|
+
case z.RiskScoring:
|
|
5085
5120
|
return "Risk Assessment";
|
|
5086
|
-
case
|
|
5121
|
+
case z.InvestorCategorization:
|
|
5087
5122
|
return "Investor Categorization";
|
|
5088
|
-
case
|
|
5123
|
+
case z.AppropriatenessTest:
|
|
5089
5124
|
return "Appropriateness Test";
|
|
5090
|
-
case
|
|
5125
|
+
case z.AdditionalData:
|
|
5091
5126
|
return "Additional Data";
|
|
5092
|
-
case
|
|
5127
|
+
case z.ManualReview:
|
|
5093
5128
|
return "Review";
|
|
5094
5129
|
default:
|
|
5095
5130
|
return "";
|
|
5096
5131
|
}
|
|
5097
5132
|
}, E = () => {
|
|
5098
|
-
const
|
|
5133
|
+
const C = c.filter((h) => h.visibility !== !1), O = C.findIndex((h) => h.order === l.order), W = O >= 0 ? O + 1 : 1, F = C.length;
|
|
5099
5134
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
5100
5135
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5101
5136
|
/* @__PURE__ */ a(Ke, {}),
|
|
5102
5137
|
/* @__PURE__ */ o(pe, { variant: i.status === 1 ? "info" : "success", children: [
|
|
5103
5138
|
"Step ",
|
|
5104
|
-
|
|
5139
|
+
W,
|
|
5105
5140
|
" of ",
|
|
5106
|
-
|
|
5141
|
+
F
|
|
5107
5142
|
] })
|
|
5108
5143
|
] }),
|
|
5109
|
-
/* @__PURE__ */ a("div", { className: "flex items-center", children:
|
|
5110
|
-
const
|
|
5111
|
-
return /* @__PURE__ */ o(
|
|
5144
|
+
/* @__PURE__ */ a("div", { className: "flex items-center", children: C.map((h, A) => {
|
|
5145
|
+
const I = A < O, H = h.order === l.order;
|
|
5146
|
+
return /* @__PURE__ */ o(te.Fragment, { children: [
|
|
5112
5147
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
5113
5148
|
/* @__PURE__ */ a(
|
|
5114
5149
|
"div",
|
|
5115
5150
|
{
|
|
5116
5151
|
className: `
|
|
5117
5152
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5118
|
-
${
|
|
5153
|
+
${I || H ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5119
5154
|
`,
|
|
5120
|
-
children:
|
|
5155
|
+
children: A + 1
|
|
5121
5156
|
}
|
|
5122
5157
|
),
|
|
5123
5158
|
/* @__PURE__ */ a(
|
|
5124
5159
|
"span",
|
|
5125
5160
|
{
|
|
5126
|
-
className: `ml-2 text-sm ${
|
|
5127
|
-
children:
|
|
5161
|
+
className: `ml-2 text-sm ${H ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5162
|
+
children: h.displayName || h.name || y(h.action) || `Step ${A + 1}`
|
|
5128
5163
|
}
|
|
5129
5164
|
)
|
|
5130
5165
|
] }),
|
|
5131
|
-
|
|
5166
|
+
A < C.length - 1 && /* @__PURE__ */ a(
|
|
5132
5167
|
"div",
|
|
5133
5168
|
{
|
|
5134
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
5169
|
+
className: `flex-1 h-0.5 mx-4 ${I ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
5135
5170
|
}
|
|
5136
5171
|
)
|
|
5137
|
-
] },
|
|
5172
|
+
] }, h.order);
|
|
5138
5173
|
}) })
|
|
5139
5174
|
] });
|
|
5140
5175
|
}, S = () => {
|
|
5141
|
-
const
|
|
5176
|
+
const C = {
|
|
5142
5177
|
applicantId: e,
|
|
5143
5178
|
onComplete: async () => {
|
|
5144
|
-
await
|
|
5179
|
+
await p();
|
|
5145
5180
|
},
|
|
5146
|
-
onBack: l.order > 0 ?
|
|
5181
|
+
onBack: l.order > 0 ? m : void 0
|
|
5147
5182
|
};
|
|
5148
5183
|
switch (l.action) {
|
|
5149
|
-
case
|
|
5150
|
-
return /* @__PURE__ */ a(ir, { ...
|
|
5151
|
-
case
|
|
5152
|
-
return /* @__PURE__ */ a(lr, { ...
|
|
5153
|
-
case
|
|
5154
|
-
return /* @__PURE__ */ a(cr, { ...
|
|
5155
|
-
case
|
|
5156
|
-
return /* @__PURE__ */ a(fr, { ...
|
|
5157
|
-
case
|
|
5158
|
-
return /* @__PURE__ */ a(pr, { ...
|
|
5159
|
-
case
|
|
5160
|
-
case
|
|
5161
|
-
return /* @__PURE__ */ a(gr, { ...
|
|
5162
|
-
case
|
|
5163
|
-
return /* @__PURE__ */ a(yr, { ...
|
|
5164
|
-
case
|
|
5184
|
+
case z.Questionaries:
|
|
5185
|
+
return /* @__PURE__ */ a(ir, { ...C });
|
|
5186
|
+
case z.UploadDocument:
|
|
5187
|
+
return /* @__PURE__ */ a(lr, { ...C });
|
|
5188
|
+
case z.Overview:
|
|
5189
|
+
return /* @__PURE__ */ a(cr, { ...C });
|
|
5190
|
+
case z.IdentitySdk:
|
|
5191
|
+
return /* @__PURE__ */ a(fr, { ...C });
|
|
5192
|
+
case z.RiskScoring:
|
|
5193
|
+
return /* @__PURE__ */ a(pr, { ...C });
|
|
5194
|
+
case z.AdditionalData:
|
|
5195
|
+
case z.InvestorCategorization:
|
|
5196
|
+
return /* @__PURE__ */ a(gr, { ...C });
|
|
5197
|
+
case z.AppropriatenessTest:
|
|
5198
|
+
return /* @__PURE__ */ a(yr, { ...C });
|
|
5199
|
+
case z.ManualReview:
|
|
5165
5200
|
return /* @__PURE__ */ a(
|
|
5166
5201
|
Te,
|
|
5167
5202
|
{
|
|
@@ -5180,7 +5215,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5180
5215
|
] }),
|
|
5181
5216
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
5182
5217
|
"Action type: ",
|
|
5183
|
-
|
|
5218
|
+
z[l.action]
|
|
5184
5219
|
] })
|
|
5185
5220
|
] }) });
|
|
5186
5221
|
}
|
|
@@ -5237,7 +5272,7 @@ function Kr(e) {
|
|
|
5237
5272
|
t[n] = vr();
|
|
5238
5273
|
}), ue.object(t);
|
|
5239
5274
|
}
|
|
5240
|
-
const
|
|
5275
|
+
const qr = ue.any();
|
|
5241
5276
|
export {
|
|
5242
5277
|
Le as ALLOWED_LANGUAGES,
|
|
5243
5278
|
Ir as ALL_APPLICANT_FIELDS,
|
|
@@ -5253,9 +5288,9 @@ export {
|
|
|
5253
5288
|
U as Button,
|
|
5254
5289
|
M as Card,
|
|
5255
5290
|
T as CardContent,
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5291
|
+
se as CardFooter,
|
|
5292
|
+
re as CardHeader,
|
|
5293
|
+
Br as CreateApplicantForm,
|
|
5259
5294
|
st as CriteriaBuiltInType,
|
|
5260
5295
|
ot as DEFAULT_VISIBLE_FIELDS,
|
|
5261
5296
|
rt as DocumentReviewStatus,
|
|
@@ -5272,17 +5307,17 @@ export {
|
|
|
5272
5307
|
ft as IdentityService,
|
|
5273
5308
|
oe as IdentityVerificationProvider,
|
|
5274
5309
|
fr as IdentityVerificationStep,
|
|
5275
|
-
|
|
5310
|
+
ne as Input,
|
|
5276
5311
|
xt as InvestorCategorizationService,
|
|
5277
5312
|
gr as InvestorCategorizationStep,
|
|
5278
|
-
|
|
5313
|
+
ae as InvestorCategorizationType,
|
|
5279
5314
|
it as InvestorCategoryType,
|
|
5280
5315
|
Xe as KycProcessStatus,
|
|
5281
5316
|
fe as KycStatus,
|
|
5282
5317
|
Te as KycStatusDisplay,
|
|
5283
5318
|
zr as KycWorkflow,
|
|
5284
5319
|
br as Logo,
|
|
5285
|
-
|
|
5320
|
+
Be as MetaKYCContext,
|
|
5286
5321
|
de as MetaKYCError,
|
|
5287
5322
|
Dr as MetaKYCProvider,
|
|
5288
5323
|
Qt as MultiSelect,
|
|
@@ -5312,8 +5347,8 @@ export {
|
|
|
5312
5347
|
Dt as WorkflowOrchestrator,
|
|
5313
5348
|
Se as WorkflowResultType,
|
|
5314
5349
|
Et as WorkflowState,
|
|
5315
|
-
|
|
5316
|
-
|
|
5350
|
+
z as WorkflowStepAction,
|
|
5351
|
+
qr as appropriatenessTestSchema,
|
|
5317
5352
|
Tr as clearAllStorage,
|
|
5318
5353
|
zt as clearApplicantId,
|
|
5319
5354
|
_t as clearWorkflowState,
|
|
@@ -5329,27 +5364,27 @@ export {
|
|
|
5329
5364
|
Ur as generateRiskScoringSchema,
|
|
5330
5365
|
_r as generateUploadDocumentSchema,
|
|
5331
5366
|
Pr as getAcceptString,
|
|
5332
|
-
|
|
5367
|
+
Bt as getApplicantId,
|
|
5333
5368
|
ke as getThemePreset,
|
|
5334
5369
|
Mr as getWorkflowState,
|
|
5335
5370
|
kt as healthcareTheme,
|
|
5336
5371
|
Er as isScriptLoaded,
|
|
5337
|
-
|
|
5372
|
+
Oe as loadScript,
|
|
5338
5373
|
St as minimalTheme,
|
|
5339
5374
|
Nt as modernTheme,
|
|
5340
5375
|
Rr as removeScript,
|
|
5341
|
-
|
|
5376
|
+
Ot as saveApplicantId,
|
|
5342
5377
|
$t as saveWorkflowState,
|
|
5343
5378
|
Ct as themePresets,
|
|
5344
5379
|
Wt as useApplicant,
|
|
5345
|
-
|
|
5346
|
-
|
|
5380
|
+
Or as useAppropriatenessTest,
|
|
5381
|
+
Ht as useIdentityVerification,
|
|
5347
5382
|
Ut as useKycWorkflow,
|
|
5348
|
-
|
|
5383
|
+
ie as useMetaKYC,
|
|
5349
5384
|
jt as useOverview,
|
|
5350
5385
|
Kt as useQuestionnaire,
|
|
5351
5386
|
Yt as useRiskScoring,
|
|
5352
|
-
|
|
5387
|
+
qt as useUploadDocument,
|
|
5353
5388
|
Fr as validateFileSize,
|
|
5354
5389
|
Lr as validateFileType
|
|
5355
5390
|
};
|