@vpdev2/metakyc 1.0.75 → 1.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/identity/IdentityVerificationStep.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +584 -610
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ var be = (e, t, a) => Fi(e, typeof t != "symbol" ? t + "" : t, a);
|
|
|
4
4
|
import wi from "axios";
|
|
5
5
|
import { jsx as i, jsxs as l, Fragment as bt } from "react/jsx-runtime";
|
|
6
6
|
import * as Jt from "react";
|
|
7
|
-
import he, { createContext as _t, useMemo as
|
|
7
|
+
import he, { createContext as _t, useMemo as Ue, useState as N, useEffect as ve, useContext as Gt, useCallback as Z, useRef as ge, forwardRef as Rt, createElement as Ut } from "react";
|
|
8
8
|
import Oi, { createPortal as Mt } from "react-dom";
|
|
9
9
|
import { useForm as Vi, Controller as yt } from "react-hook-form";
|
|
10
10
|
import { z as ot } from "zod";
|
|
11
|
-
var
|
|
11
|
+
var ae = /* @__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))(ae || {}), Lt = /* @__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))(Lt || {}), qe = /* @__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))(qe || {}), Bi = /* @__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))(Bi || {}), qi = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(qi || {}), xi = /* @__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))(xi || {}), Je = /* @__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))(Je || {}), Ui = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Ui || {}), Ki = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Ki || {}), Ge = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Ge || {}), Wi = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Wi || {}), Et = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Et || {}), Hi = /* @__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))(Hi || {}), $i = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))($i || {}), Yi = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Yi || {}), at = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(at || {}), _i = /* @__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))(_i || {}), Gi = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Gi || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Oe || {}), Qi = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Qi || {});
|
|
12
12
|
const ut = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -88,7 +88,7 @@ const ut = {
|
|
|
88
88
|
{ value: "FI", label: "Finnish" },
|
|
89
89
|
{ value: "NO", label: "Norwegian" }
|
|
90
90
|
];
|
|
91
|
-
var
|
|
91
|
+
var Be = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(Be || {});
|
|
92
92
|
const Ji = {
|
|
93
93
|
timeout: 3e4,
|
|
94
94
|
retries: 3,
|
|
@@ -200,7 +200,7 @@ const ti = {
|
|
|
200
200
|
warn: 2,
|
|
201
201
|
info: 3,
|
|
202
202
|
debug: 4
|
|
203
|
-
},
|
|
203
|
+
}, xe = {
|
|
204
204
|
prefix: "color:#6366f1;font-weight:bold",
|
|
205
205
|
arrow: "color:#9ca3af",
|
|
206
206
|
method: "color:#22d3ee;font-weight:bold",
|
|
@@ -229,43 +229,43 @@ class tr {
|
|
|
229
229
|
if (!this.shouldLog("debug")) return n;
|
|
230
230
|
const o = [
|
|
231
231
|
`%c[MetaKYC]%c →%c ${t}%c ${a}`,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
xe.prefix,
|
|
233
|
+
xe.arrow,
|
|
234
|
+
xe.method,
|
|
235
|
+
xe.url
|
|
236
236
|
];
|
|
237
|
-
return r && Object.keys(r).length > 0 ? (console.groupCollapsed(...o), console.log("%cPayload:",
|
|
237
|
+
return r && Object.keys(r).length > 0 ? (console.groupCollapsed(...o), console.log("%cPayload:", xe.dim, r), console.groupEnd()) : console.log(...o), n;
|
|
238
238
|
}
|
|
239
239
|
response(t, a, r, n, o) {
|
|
240
240
|
if (!this.shouldLog("debug")) return;
|
|
241
241
|
const s = r >= 200 && r < 300, c = [
|
|
242
242
|
`%c[MetaKYC]%c ←%c ${r}%c ${t} ${a.split("/").pop()} %c(${n}ms)`,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
s ?
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
xe.prefix,
|
|
244
|
+
xe.arrow,
|
|
245
|
+
s ? xe.status : xe.statusErr,
|
|
246
|
+
xe.dim,
|
|
247
|
+
xe.timing
|
|
248
248
|
];
|
|
249
|
-
o && this.shouldLog("debug") ? (console.groupCollapsed(...c), console.log("%cResponse:",
|
|
249
|
+
o && this.shouldLog("debug") ? (console.groupCollapsed(...c), console.log("%cResponse:", xe.dim, o), console.groupEnd()) : console.log(...c);
|
|
250
250
|
}
|
|
251
251
|
error(t, a, r, n) {
|
|
252
252
|
this.shouldLog("error") && (console.log(
|
|
253
253
|
`%c[MetaKYC]%c ✗%c ${t} ${a.split("/").pop()} %cfailed %c(${n}ms)`,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
xe.prefix,
|
|
255
|
+
xe.statusErr,
|
|
256
|
+
xe.dim,
|
|
257
|
+
xe.statusErr,
|
|
258
|
+
xe.timing
|
|
259
259
|
), this.shouldLog("debug") && console.error(r));
|
|
260
260
|
}
|
|
261
261
|
info(t, ...a) {
|
|
262
|
-
this.shouldLog("info") && console.log(`%c[MetaKYC]%c ${t}`,
|
|
262
|
+
this.shouldLog("info") && console.log(`%c[MetaKYC]%c ${t}`, xe.prefix, xe.dim, ...a);
|
|
263
263
|
}
|
|
264
264
|
warn(t, ...a) {
|
|
265
|
-
this.shouldLog("warn") && console.warn(`%c[MetaKYC]%c ${t}`,
|
|
265
|
+
this.shouldLog("warn") && console.warn(`%c[MetaKYC]%c ${t}`, xe.prefix, xe.dim, ...a);
|
|
266
266
|
}
|
|
267
267
|
debug(t, ...a) {
|
|
268
|
-
this.shouldLog("debug") && console.log(`%c[MetaKYC]%c ${t}`,
|
|
268
|
+
this.shouldLog("debug") && console.log(`%c[MetaKYC]%c ${t}`, xe.prefix, xe.dim, ...a);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
const _ = new tr(), ir = 16, ii = 32;
|
|
@@ -872,7 +872,7 @@ class gr {
|
|
|
872
872
|
)).result;
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
|
-
const
|
|
875
|
+
const Ve = {
|
|
876
876
|
name: "Default",
|
|
877
877
|
title: "KYC Verification",
|
|
878
878
|
logo: {
|
|
@@ -1106,15 +1106,15 @@ const Be = {
|
|
|
1106
1106
|
inputHeight: "2.25rem"
|
|
1107
1107
|
}
|
|
1108
1108
|
}, br = {
|
|
1109
|
-
[
|
|
1110
|
-
[
|
|
1111
|
-
[
|
|
1112
|
-
[
|
|
1113
|
-
[
|
|
1114
|
-
[
|
|
1109
|
+
[Be.Default]: Ve,
|
|
1110
|
+
[Be.Corporate]: fr,
|
|
1111
|
+
[Be.Fintech]: yr,
|
|
1112
|
+
[Be.Healthcare]: hr,
|
|
1113
|
+
[Be.Modern]: vr,
|
|
1114
|
+
[Be.Minimal]: kr
|
|
1115
1115
|
};
|
|
1116
1116
|
function Nt(e) {
|
|
1117
|
-
return br[e] ||
|
|
1117
|
+
return br[e] || Ve;
|
|
1118
1118
|
}
|
|
1119
1119
|
class wr {
|
|
1120
1120
|
constructor(t) {
|
|
@@ -1132,8 +1132,8 @@ class wr {
|
|
|
1132
1132
|
r
|
|
1133
1133
|
);
|
|
1134
1134
|
if (!n.result.isEnabled)
|
|
1135
|
-
return Nt(
|
|
1136
|
-
let o = n.result.preset ? Nt(n.result.preset) : Nt(
|
|
1135
|
+
return Nt(Be.Default);
|
|
1136
|
+
let o = n.result.preset ? Nt(n.result.preset) : Nt(Be.Default);
|
|
1137
1137
|
if (n.result.title && (o.title = n.result.title), n.result.logo && (o.logo = { ...o.logo, ...n.result.logo }), n.result.colors && (o.colors = { ...o.colors, ...n.result.colors }), n.result.typography && (o.typography = { ...o.typography, ...n.result.typography }), n.result.spacing && (o.spacing = { ...o.spacing, ...n.result.spacing }), n.result.customCSS && (o.customCSS = n.result.customCSS), n.result.darkMode && (o.darkMode = {
|
|
1138
1138
|
colors: {
|
|
1139
1139
|
...(a = o.darkMode) == null ? void 0 : a.colors,
|
|
@@ -1183,7 +1183,7 @@ class wr {
|
|
|
1183
1183
|
}
|
|
1184
1184
|
return o;
|
|
1185
1185
|
} catch {
|
|
1186
|
-
return Nt(
|
|
1186
|
+
return Nt(Be.Default);
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
1189
|
/**
|
|
@@ -1197,12 +1197,12 @@ class wr {
|
|
|
1197
1197
|
*/
|
|
1198
1198
|
getAvailablePresets() {
|
|
1199
1199
|
return [
|
|
1200
|
-
{ id:
|
|
1201
|
-
{ id:
|
|
1202
|
-
{ id:
|
|
1203
|
-
{ id:
|
|
1204
|
-
{ id:
|
|
1205
|
-
{ id:
|
|
1200
|
+
{ id: Be.Default, name: "Default" },
|
|
1201
|
+
{ id: Be.Corporate, name: "Corporate" },
|
|
1202
|
+
{ id: Be.Fintech, name: "Fintech" },
|
|
1203
|
+
{ id: Be.Healthcare, name: "Healthcare" },
|
|
1204
|
+
{ id: Be.Modern, name: "Modern" },
|
|
1205
|
+
{ id: Be.Minimal, name: "Minimal" }
|
|
1206
1206
|
];
|
|
1207
1207
|
}
|
|
1208
1208
|
/**
|
|
@@ -1320,7 +1320,7 @@ class Cr {
|
|
|
1320
1320
|
*/
|
|
1321
1321
|
get status() {
|
|
1322
1322
|
var t;
|
|
1323
|
-
return ((t = this._progress) == null ? void 0 : t.status) ||
|
|
1323
|
+
return ((t = this._progress) == null ? void 0 : t.status) || qe.None;
|
|
1324
1324
|
}
|
|
1325
1325
|
/**
|
|
1326
1326
|
* Get workflow result
|
|
@@ -1339,19 +1339,19 @@ class Cr {
|
|
|
1339
1339
|
* Check if workflow is complete
|
|
1340
1340
|
*/
|
|
1341
1341
|
get isComplete() {
|
|
1342
|
-
return this.status ===
|
|
1342
|
+
return this.status === qe.Finished;
|
|
1343
1343
|
}
|
|
1344
1344
|
/**
|
|
1345
1345
|
* Check if workflow is on hold
|
|
1346
1346
|
*/
|
|
1347
1347
|
get isOnHold() {
|
|
1348
|
-
return this.status ===
|
|
1348
|
+
return this.status === qe.OnHold;
|
|
1349
1349
|
}
|
|
1350
1350
|
/**
|
|
1351
1351
|
* Check if workflow is in progress
|
|
1352
1352
|
*/
|
|
1353
1353
|
get isInProgress() {
|
|
1354
|
-
return this.status ===
|
|
1354
|
+
return this.status === qe.InProgress;
|
|
1355
1355
|
}
|
|
1356
1356
|
/**
|
|
1357
1357
|
* Set applicant ID
|
|
@@ -1365,7 +1365,7 @@ class Cr {
|
|
|
1365
1365
|
updateProgress(t) {
|
|
1366
1366
|
var r, n;
|
|
1367
1367
|
const a = (r = this._progress) == null ? void 0 : r.currentStep;
|
|
1368
|
-
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (a == null ? void 0 : a.order) !== ((n = t.currentStep) == null ? void 0 : n.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status ===
|
|
1368
|
+
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (a == null ? void 0 : a.order) !== ((n = t.currentStep) == null ? void 0 : n.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status === qe.Finished && t.workflowResult && this.events.emit("completed", t.workflowResult);
|
|
1369
1369
|
}
|
|
1370
1370
|
/**
|
|
1371
1371
|
* Set error
|
|
@@ -1450,7 +1450,7 @@ class Nr {
|
|
|
1450
1450
|
async loadStepData(t, a) {
|
|
1451
1451
|
const r = this.getHandler(t);
|
|
1452
1452
|
if (!r)
|
|
1453
|
-
throw new Error(`No handler registered for step action: ${
|
|
1453
|
+
throw new Error(`No handler registered for step action: ${ae[t]}`);
|
|
1454
1454
|
return r.loadData(a);
|
|
1455
1455
|
}
|
|
1456
1456
|
/**
|
|
@@ -1459,7 +1459,7 @@ class Nr {
|
|
|
1459
1459
|
async submitStepData(t, a) {
|
|
1460
1460
|
const r = this.getHandler(t);
|
|
1461
1461
|
if (!r)
|
|
1462
|
-
throw new Error(`No handler registered for step action: ${
|
|
1462
|
+
throw new Error(`No handler registered for step action: ${ae[t]}`);
|
|
1463
1463
|
return r.submitData(a);
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
@@ -1473,47 +1473,47 @@ class Tr {
|
|
|
1473
1473
|
* Register all step handlers
|
|
1474
1474
|
*/
|
|
1475
1475
|
registerStepHandlers() {
|
|
1476
|
-
this.stepRouter.registerHandler(
|
|
1476
|
+
this.stepRouter.registerHandler(ae.Questionaries, {
|
|
1477
1477
|
loadData: (t) => this.questionnaireService.getQuestionnaire(t),
|
|
1478
1478
|
submitData: async (t) => {
|
|
1479
1479
|
await this.questionnaireService.fillQuestionnaire(t);
|
|
1480
1480
|
}
|
|
1481
|
-
}), this.stepRouter.registerHandler(
|
|
1481
|
+
}), this.stepRouter.registerHandler(ae.UploadDocument, {
|
|
1482
1482
|
loadData: (t) => this.uploadDocumentService.getUploadDocument(t),
|
|
1483
1483
|
submitData: (t) => this.uploadDocumentService.fillUploadDocument(t)
|
|
1484
|
-
}), this.stepRouter.registerHandler(
|
|
1484
|
+
}), this.stepRouter.registerHandler(ae.AppropriatenessTest, {
|
|
1485
1485
|
loadData: (t) => this.appropriatenessTestService.getAppropriatenessTest(t),
|
|
1486
1486
|
submitData: async (t) => {
|
|
1487
1487
|
await this.appropriatenessTestService.fillAppropriatenessTest(t);
|
|
1488
1488
|
}
|
|
1489
|
-
}), this.stepRouter.registerHandler(
|
|
1489
|
+
}), this.stepRouter.registerHandler(ae.Overview, {
|
|
1490
1490
|
loadData: (t) => this.overviewService.getOverviewData(t),
|
|
1491
1491
|
submitData: (t) => this.overviewService.passOverview(t.applicantId)
|
|
1492
|
-
}), this.stepRouter.registerHandler(
|
|
1492
|
+
}), this.stepRouter.registerHandler(ae.RiskScoring, {
|
|
1493
1493
|
loadData: (t) => this.riskScoringService.getRiskCriterias(t),
|
|
1494
1494
|
submitData: async (t) => {
|
|
1495
1495
|
await this.riskScoringService.submitRiskScoring(t);
|
|
1496
1496
|
}
|
|
1497
|
-
}), this.stepRouter.registerHandler(
|
|
1497
|
+
}), this.stepRouter.registerHandler(ae.IdentitySdk, {
|
|
1498
1498
|
loadData: async (t) => ({
|
|
1499
1499
|
applicantId: t,
|
|
1500
1500
|
message: "Identity verification required"
|
|
1501
1501
|
}),
|
|
1502
1502
|
submitData: async () => {
|
|
1503
1503
|
}
|
|
1504
|
-
}), this.stepRouter.registerHandler(
|
|
1504
|
+
}), this.stepRouter.registerHandler(ae.InvestorCategorization, {
|
|
1505
1505
|
loadData: (t) => this.investorCategorizationService.getInvestorCategorization(t),
|
|
1506
1506
|
submitData: async (t) => {
|
|
1507
1507
|
await this.investorCategorizationService.setInvestorCategorization(t);
|
|
1508
1508
|
}
|
|
1509
|
-
}), this.stepRouter.registerHandler(
|
|
1509
|
+
}), this.stepRouter.registerHandler(ae.ManualReview, {
|
|
1510
1510
|
loadData: async (t) => ({
|
|
1511
1511
|
applicantId: t,
|
|
1512
1512
|
message: "Your application is under manual review"
|
|
1513
1513
|
}),
|
|
1514
1514
|
submitData: async () => {
|
|
1515
1515
|
}
|
|
1516
|
-
}), this.stepRouter.registerHandler(
|
|
1516
|
+
}), this.stepRouter.registerHandler(ae.AdditionalData, {
|
|
1517
1517
|
loadData: async (t) => ({
|
|
1518
1518
|
applicantId: t,
|
|
1519
1519
|
message: "Additional data required"
|
|
@@ -1984,7 +1984,7 @@ class ct {
|
|
|
1984
1984
|
}
|
|
1985
1985
|
class Er {
|
|
1986
1986
|
constructor() {
|
|
1987
|
-
be(this, "currentTheme",
|
|
1987
|
+
be(this, "currentTheme", Ve);
|
|
1988
1988
|
be(this, "customStyleElement", null);
|
|
1989
1989
|
be(this, "themeStyleElement", null);
|
|
1990
1990
|
}
|
|
@@ -2105,19 +2105,19 @@ ${Object.entries(n).filter(([, u]) => !!u).map(([u, g]) => ` --metakyc-${u}: ${
|
|
|
2105
2105
|
mergeWithDefault(t) {
|
|
2106
2106
|
var a;
|
|
2107
2107
|
return {
|
|
2108
|
-
name: t.name ||
|
|
2109
|
-
title: t.title ||
|
|
2110
|
-
logo: { ...
|
|
2111
|
-
colors: { ...
|
|
2112
|
-
typography: t.typography ? { ...
|
|
2113
|
-
spacing: t.spacing ? { ...
|
|
2108
|
+
name: t.name || Ve.name,
|
|
2109
|
+
title: t.title || Ve.title,
|
|
2110
|
+
logo: { ...Ve.logo, ...t.logo },
|
|
2111
|
+
colors: { ...Ve.colors, ...t.colors },
|
|
2112
|
+
typography: t.typography ? { ...Ve.typography, ...t.typography } : Ve.typography,
|
|
2113
|
+
spacing: t.spacing ? { ...Ve.spacing, ...t.spacing } : Ve.spacing,
|
|
2114
2114
|
customCSS: t.customCSS,
|
|
2115
2115
|
darkMode: t.darkMode ? {
|
|
2116
2116
|
colors: {
|
|
2117
|
-
...(a =
|
|
2117
|
+
...(a = Ve.darkMode) == null ? void 0 : a.colors,
|
|
2118
2118
|
...t.darkMode.colors
|
|
2119
2119
|
}
|
|
2120
|
-
} :
|
|
2120
|
+
} : Ve.darkMode,
|
|
2121
2121
|
applicantFormVisibleFields: t.applicantFormVisibleFields,
|
|
2122
2122
|
applicantFormRequiredFields: t.applicantFormRequiredFields,
|
|
2123
2123
|
allowedLanguages: t.allowedLanguages,
|
|
@@ -2141,7 +2141,7 @@ ${Object.entries(n).filter(([, u]) => !!u).map(([u, g]) => ` --metakyc-${u}: ${
|
|
|
2141
2141
|
* Reset to default theme
|
|
2142
2142
|
*/
|
|
2143
2143
|
resetTheme() {
|
|
2144
|
-
this.applyTheme(
|
|
2144
|
+
this.applyTheme(Ve);
|
|
2145
2145
|
}
|
|
2146
2146
|
/**
|
|
2147
2147
|
* Remove all custom styles
|
|
@@ -7147,7 +7147,7 @@ function Ci(e) {
|
|
|
7147
7147
|
};
|
|
7148
7148
|
}
|
|
7149
7149
|
const Xr = /^t\(['"](.+?)['"]\)$/, li = "$t:";
|
|
7150
|
-
function
|
|
7150
|
+
function ie(e, t) {
|
|
7151
7151
|
if (!e) return "";
|
|
7152
7152
|
const a = e.trim();
|
|
7153
7153
|
if (a.startsWith(li))
|
|
@@ -7155,12 +7155,12 @@ function ne(e, t) {
|
|
|
7155
7155
|
const r = Xr.exec(a);
|
|
7156
7156
|
return r ? t(r[1]) : e;
|
|
7157
7157
|
}
|
|
7158
|
-
const $t = "1.0.
|
|
7158
|
+
const $t = "1.0.76", Ni = _t(null), ci = `metakyc-translations-${$t}-`, Zr = ({
|
|
7159
7159
|
locale: e,
|
|
7160
7160
|
fetchTranslations: t,
|
|
7161
7161
|
children: a
|
|
7162
7162
|
}) => {
|
|
7163
|
-
const r = e.toLowerCase().split(/[-_]/)[0], n =
|
|
7163
|
+
const r = e.toLowerCase().split(/[-_]/)[0], n = Ue(() => {
|
|
7164
7164
|
const u = Ht(r);
|
|
7165
7165
|
if (typeof window > "u") return u;
|
|
7166
7166
|
try {
|
|
@@ -7192,7 +7192,7 @@ const $t = "1.0.75", Ni = _t(null), ci = `metakyc-translations-${$t}-`, Zr = ({
|
|
|
7192
7192
|
u = !0;
|
|
7193
7193
|
};
|
|
7194
7194
|
}, [r, t]);
|
|
7195
|
-
const c =
|
|
7195
|
+
const c = Ue(() => ({
|
|
7196
7196
|
t: Ci(o),
|
|
7197
7197
|
locale: r,
|
|
7198
7198
|
dictionary: o
|
|
@@ -7220,7 +7220,7 @@ function ea() {
|
|
|
7220
7220
|
}
|
|
7221
7221
|
const ui = "metakyc-theme-cache", xn = ({ config: e, children: t }) => {
|
|
7222
7222
|
ea();
|
|
7223
|
-
const [a, r] = N(null), n = he.useRef(!1), o = he.useRef(!1), s =
|
|
7223
|
+
const [a, r] = N(null), n = he.useRef(!1), o = he.useRef(!1), s = Ue(() => {
|
|
7224
7224
|
_.setLevel(e.debug ?? e.logLevel ?? "none"), _.info(`SDK v${$t} initializing — baseUrl=${e.baseUrl}`);
|
|
7225
7225
|
const g = new nr(e), y = new or(g), f = new sr(g), D = new lr(g), T = new cr(g), S = new dr(g), O = new ur(g), C = new mr(g), K = new pr(g), W = new gr(g), F = new wr(g), M = new xr(g), q = new Er();
|
|
7226
7226
|
if (typeof document < "u")
|
|
@@ -7229,9 +7229,9 @@ const ui = "metakyc-theme-cache", xn = ({ config: e, children: t }) => {
|
|
|
7229
7229
|
else
|
|
7230
7230
|
try {
|
|
7231
7231
|
const G = localStorage.getItem(ui);
|
|
7232
|
-
q.applyTheme(G ? JSON.parse(G) :
|
|
7232
|
+
q.applyTheme(G ? JSON.parse(G) : Ve);
|
|
7233
7233
|
} catch {
|
|
7234
|
-
q.applyTheme(
|
|
7234
|
+
q.applyTheme(Ve);
|
|
7235
7235
|
}
|
|
7236
7236
|
return {
|
|
7237
7237
|
httpClient: g,
|
|
@@ -7248,7 +7248,7 @@ const ui = "metakyc-theme-cache", xn = ({ config: e, children: t }) => {
|
|
|
7248
7248
|
translationService: M,
|
|
7249
7249
|
themeManager: q
|
|
7250
7250
|
};
|
|
7251
|
-
}, [e]), c =
|
|
7251
|
+
}, [e]), c = Ue(() => ({
|
|
7252
7252
|
config: e,
|
|
7253
7253
|
...s,
|
|
7254
7254
|
currentTheme: a,
|
|
@@ -7325,7 +7325,7 @@ const ui = "metakyc-theme-cache", xn = ({ config: e, children: t }) => {
|
|
|
7325
7325
|
}
|
|
7326
7326
|
) });
|
|
7327
7327
|
};
|
|
7328
|
-
function
|
|
7328
|
+
function Te() {
|
|
7329
7329
|
const e = Gt(Ti);
|
|
7330
7330
|
if (!e)
|
|
7331
7331
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -7404,7 +7404,7 @@ function In() {
|
|
|
7404
7404
|
ia(), aa();
|
|
7405
7405
|
}
|
|
7406
7406
|
function na(e) {
|
|
7407
|
-
const { createOrchestrator: t, config: a } =
|
|
7407
|
+
const { createOrchestrator: t, config: a } = Te(), [r, n] = N(null), [o, s] = N(!1), [c, u] = N(null), g = ge(null), y = e || a.applicantId || void 0;
|
|
7408
7408
|
ve(() => {
|
|
7409
7409
|
g.current || (g.current = t());
|
|
7410
7410
|
}, [t]), ve(() => {
|
|
@@ -7497,15 +7497,15 @@ function na(e) {
|
|
|
7497
7497
|
applicantId: y,
|
|
7498
7498
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
7499
7499
|
steps: W,
|
|
7500
|
-
status: (r == null ? void 0 : r.status) ||
|
|
7500
|
+
status: (r == null ? void 0 : r.status) || qe.None,
|
|
7501
7501
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
7502
7502
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
7503
7503
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
7504
7504
|
hasWorkflowChanged: F,
|
|
7505
7505
|
isLoading: o,
|
|
7506
7506
|
error: c,
|
|
7507
|
-
isComplete: (r == null ? void 0 : r.status) ===
|
|
7508
|
-
isOnHold: (r == null ? void 0 : r.status) ===
|
|
7507
|
+
isComplete: (r == null ? void 0 : r.status) === qe.Finished,
|
|
7508
|
+
isOnHold: (r == null ? void 0 : r.status) === qe.OnHold,
|
|
7509
7509
|
refreshProgress: S,
|
|
7510
7510
|
moveToNext: O,
|
|
7511
7511
|
moveBack: C,
|
|
@@ -7515,7 +7515,7 @@ function na(e) {
|
|
|
7515
7515
|
}
|
|
7516
7516
|
function oa(e) {
|
|
7517
7517
|
var q;
|
|
7518
|
-
const { applicantService: t, config: a } =
|
|
7518
|
+
const { applicantService: t, config: a } = Te(), [r, n] = N(null), [o, s] = N(!0), [c, u] = N(null), [g, y] = N(), [f, D] = N(), T = ge(!1), S = Z(async () => {
|
|
7519
7519
|
try {
|
|
7520
7520
|
s(!0), u(null);
|
|
7521
7521
|
const G = await t.getSdkState();
|
|
@@ -7547,7 +7547,7 @@ function oa(e) {
|
|
|
7547
7547
|
};
|
|
7548
7548
|
}
|
|
7549
7549
|
function sa(e) {
|
|
7550
|
-
const { questionnaireService: t, applicantService: a } =
|
|
7550
|
+
const { questionnaireService: t, applicantService: a } = Te(), [r, n] = N(null), [o, s] = N({}), [c, u] = N(!1), [g, y] = N(!1), [f, D] = N(null), T = ge(!1), S = ge(null), O = Z(async () => {
|
|
7551
7551
|
var K, W;
|
|
7552
7552
|
if (e) {
|
|
7553
7553
|
if (T.current) {
|
|
@@ -7564,8 +7564,8 @@ function sa(e) {
|
|
|
7564
7564
|
const q = /* @__PURE__ */ new Map();
|
|
7565
7565
|
for (const k of M.questionnaireResults)
|
|
7566
7566
|
k.question && ((W = k.answers) != null && W.length) && q.set(k.question.trim().toLowerCase(), k.answers);
|
|
7567
|
-
const G = {},
|
|
7568
|
-
for (const k of
|
|
7567
|
+
const G = {}, se = F.questionGroups.flatMap((k) => k.questions ?? []);
|
|
7568
|
+
for (const k of se) {
|
|
7569
7569
|
const L = k.text.trim().toLowerCase();
|
|
7570
7570
|
q.has(L) && (G[k.id] = q.get(L));
|
|
7571
7571
|
}
|
|
@@ -7606,7 +7606,7 @@ function sa(e) {
|
|
|
7606
7606
|
};
|
|
7607
7607
|
}
|
|
7608
7608
|
function la(e) {
|
|
7609
|
-
const { uploadDocumentService: t } =
|
|
7609
|
+
const { uploadDocumentService: t } = Te(), [a, r] = N(null), [n, o] = N(!1), [s, c] = N(!1), [u, g] = N(0), [y, f] = N(null), D = ge(!1), T = ge(null), S = Z(async () => {
|
|
7610
7610
|
if (e) {
|
|
7611
7611
|
if (D.current) {
|
|
7612
7612
|
_.debug("UploadDocument load already in progress, skipping");
|
|
@@ -7650,7 +7650,7 @@ function la(e) {
|
|
|
7650
7650
|
};
|
|
7651
7651
|
}
|
|
7652
7652
|
function zn(e) {
|
|
7653
|
-
const { appropriatenessTestService: t } =
|
|
7653
|
+
const { appropriatenessTestService: t } = Te(), [a, r] = N(null), [n, o] = N(!1), [s, c] = N(!1), [u, g] = N(null), [y, f] = N(null), D = ge(!1), T = ge(null), S = Z(async () => {
|
|
7654
7654
|
if (e) {
|
|
7655
7655
|
if (D.current) {
|
|
7656
7656
|
_.debug("AppropriatenessTest load already in progress, skipping");
|
|
@@ -7695,7 +7695,7 @@ function zn(e) {
|
|
|
7695
7695
|
};
|
|
7696
7696
|
}
|
|
7697
7697
|
function ca(e) {
|
|
7698
|
-
const { overviewService: t } =
|
|
7698
|
+
const { overviewService: t } = Te(), [a, r] = N(null), [n, o] = N(!1), [s, c] = N(!1), [u, g] = N(null), y = ge(!1), f = ge(null), D = Z(async () => {
|
|
7699
7699
|
if (e) {
|
|
7700
7700
|
if (y.current) {
|
|
7701
7701
|
_.debug("Overview load already in progress, skipping");
|
|
@@ -7737,7 +7737,7 @@ function ca(e) {
|
|
|
7737
7737
|
};
|
|
7738
7738
|
}
|
|
7739
7739
|
function da(e) {
|
|
7740
|
-
const { identityService: t } =
|
|
7740
|
+
const { identityService: t } = Te(), [a, r] = N(
|
|
7741
7741
|
null
|
|
7742
7742
|
), [n, o] = N(!1), [s, c] = N(null), u = ge(!1), g = Z(
|
|
7743
7743
|
async (D, T) => {
|
|
@@ -7821,7 +7821,7 @@ function da(e) {
|
|
|
7821
7821
|
};
|
|
7822
7822
|
}
|
|
7823
7823
|
function ua(e) {
|
|
7824
|
-
const { riskScoringService: t, applicantService: a } =
|
|
7824
|
+
const { riskScoringService: t, applicantService: a } = Te(), [r, n] = N(null), [o, s] = N({}), [c, u] = N(!1), [g, y] = N(!1), [f, D] = N(null), [T, S] = N(null), O = ge(!1), C = ge(null), K = Z(async () => {
|
|
7825
7825
|
var F;
|
|
7826
7826
|
if (e) {
|
|
7827
7827
|
if (O.current) {
|
|
@@ -7835,15 +7835,15 @@ function ua(e) {
|
|
|
7835
7835
|
a.getApplicantData(e).catch(() => null)
|
|
7836
7836
|
]);
|
|
7837
7837
|
if (n(M), (F = q == null ? void 0 : q.riskScoringResults) != null && F.length) {
|
|
7838
|
-
const G = q.riskScoringResults[0],
|
|
7838
|
+
const G = q.riskScoringResults[0], se = {};
|
|
7839
7839
|
for (const k of G.riskCriteriaResults ?? [])
|
|
7840
7840
|
if (k.riskCriteriaId != null && k.answer != null && k.answer !== "") {
|
|
7841
7841
|
const L = [...new Set(
|
|
7842
7842
|
k.answer.split(",").map((j) => j.trim()).filter((j) => j !== "")
|
|
7843
7843
|
)];
|
|
7844
|
-
L.length > 0 && (
|
|
7844
|
+
L.length > 0 && (se[k.riskCriteriaId] = L);
|
|
7845
7845
|
}
|
|
7846
|
-
s(
|
|
7846
|
+
s(se);
|
|
7847
7847
|
}
|
|
7848
7848
|
C.current = e;
|
|
7849
7849
|
} catch (M) {
|
|
@@ -7882,7 +7882,7 @@ function ua(e) {
|
|
|
7882
7882
|
};
|
|
7883
7883
|
}
|
|
7884
7884
|
function Ri() {
|
|
7885
|
-
const { applicantService: e, config: t } =
|
|
7885
|
+
const { applicantService: e, config: t } = Te(), [a, r] = N(!1), [n, o] = N(null), s = ge(!1), c = ge(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(T) {
|
|
7886
7886
|
const S = Math.random() * 16 | 0;
|
|
7887
7887
|
return (T === "x" ? S : S & 3 | 8).toString(16);
|
|
7888
7888
|
}), g = Z(
|
|
@@ -7979,7 +7979,7 @@ const ma = {
|
|
|
7979
7979
|
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
7980
7980
|
borderColor: "transparent"
|
|
7981
7981
|
}
|
|
7982
|
-
},
|
|
7982
|
+
}, le = ({
|
|
7983
7983
|
children: e,
|
|
7984
7984
|
variant: t = "primary",
|
|
7985
7985
|
size: a = "md",
|
|
@@ -8054,7 +8054,7 @@ const ma = {
|
|
|
8054
8054
|
]
|
|
8055
8055
|
}
|
|
8056
8056
|
);
|
|
8057
|
-
},
|
|
8057
|
+
}, Ce = Rt(
|
|
8058
8058
|
({ label: e, error: t, helperText: a, leftIcon: r, rightIcon: n, className: o, style: s, ...c }, u) => /* @__PURE__ */ l("div", { className: "w-full", children: [
|
|
8059
8059
|
e && /* @__PURE__ */ l(
|
|
8060
8060
|
"label",
|
|
@@ -8098,8 +8098,8 @@ const ma = {
|
|
|
8098
8098
|
!t && a && /* @__PURE__ */ i("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a })
|
|
8099
8099
|
] })
|
|
8100
8100
|
);
|
|
8101
|
-
|
|
8102
|
-
const
|
|
8101
|
+
Ce.displayName = "Input";
|
|
8102
|
+
const ne = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
8103
8103
|
"div",
|
|
8104
8104
|
{
|
|
8105
8105
|
className: We("metakyc-card rounded-xl shadow-sm border", t),
|
|
@@ -8129,7 +8129,7 @@ const ee = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
8129
8129
|
...r,
|
|
8130
8130
|
children: e
|
|
8131
8131
|
}
|
|
8132
|
-
),
|
|
8132
|
+
), oe = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
8133
8133
|
"div",
|
|
8134
8134
|
{
|
|
8135
8135
|
className: We("metakyc-card-content px-6 py-4", t),
|
|
@@ -8251,7 +8251,7 @@ const ee = ({ children: e, className: t, style: a, ...r }) => /* @__PURE__ */ i(
|
|
|
8251
8251
|
...n,
|
|
8252
8252
|
children: e
|
|
8253
8253
|
}
|
|
8254
|
-
),
|
|
8254
|
+
), Ke = ({ size: e = "md", className: t, ...a }) => {
|
|
8255
8255
|
const r = {
|
|
8256
8256
|
sm: "h-4 w-4",
|
|
8257
8257
|
md: "h-8 w-8",
|
|
@@ -8376,7 +8376,7 @@ const mi = 280, fa = ({
|
|
|
8376
8376
|
if (!M.current) return null;
|
|
8377
8377
|
const A = M.current.getBoundingClientRect(), H = window.innerHeight - A.bottom < mi && A.top > mi;
|
|
8378
8378
|
return { top: H ? A.top : A.bottom + 4, left: A.left, width: A.width, openUp: H };
|
|
8379
|
-
}, []),
|
|
8379
|
+
}, []), se = Z(() => {
|
|
8380
8380
|
const A = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), E = (ye, fe) => A.getPropertyValue(ye).trim() || fe, H = E("--metakyc-input-bg", E("--metakyc-background", "#ffffff"));
|
|
8381
8381
|
W({
|
|
8382
8382
|
bg: H,
|
|
@@ -8389,10 +8389,10 @@ const mi = 280, fa = ({
|
|
|
8389
8389
|
});
|
|
8390
8390
|
}, []), k = Z(() => {
|
|
8391
8391
|
if (y) return;
|
|
8392
|
-
|
|
8392
|
+
se();
|
|
8393
8393
|
const A = G();
|
|
8394
8394
|
A && C(A), D(!0);
|
|
8395
|
-
}, [y, G,
|
|
8395
|
+
}, [y, G, se]), L = Z(() => {
|
|
8396
8396
|
D(!1), S("");
|
|
8397
8397
|
}, []);
|
|
8398
8398
|
ve(() => {
|
|
@@ -8417,12 +8417,12 @@ const mi = 280, fa = ({
|
|
|
8417
8417
|
(A) => A.label.toLowerCase().includes(T.toLowerCase())
|
|
8418
8418
|
), X = (A) => {
|
|
8419
8419
|
y || a(t.includes(A) ? t.filter((E) => E !== A) : [...t, A]);
|
|
8420
|
-
},
|
|
8420
|
+
}, te = (A, E) => {
|
|
8421
8421
|
E.stopPropagation(), y || a(t.filter((H) => H !== A));
|
|
8422
8422
|
}, $ = (A) => {
|
|
8423
8423
|
var E;
|
|
8424
8424
|
return ((E = r.find((H) => H.value === A)) == null ? void 0 : E.label) || A;
|
|
8425
|
-
}, { bg:
|
|
8425
|
+
}, { bg: ee, borderColor: pe, textPrimary: me, textSecondary: Re, primaryColor: ce, primaryLight: Y, hoverBg: Q } = K, re = f && O && /* @__PURE__ */ l(
|
|
8426
8426
|
"div",
|
|
8427
8427
|
{
|
|
8428
8428
|
ref: q,
|
|
@@ -8437,7 +8437,7 @@ const mi = 280, fa = ({
|
|
|
8437
8437
|
borderRadius: "8px",
|
|
8438
8438
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
8439
8439
|
border: `1px solid ${pe}`,
|
|
8440
|
-
backgroundColor:
|
|
8440
|
+
backgroundColor: ee,
|
|
8441
8441
|
overflow: "hidden"
|
|
8442
8442
|
},
|
|
8443
8443
|
children: [
|
|
@@ -8458,21 +8458,21 @@ const mi = 280, fa = ({
|
|
|
8458
8458
|
fontSize: "13px",
|
|
8459
8459
|
borderRadius: "6px",
|
|
8460
8460
|
border: `1px solid ${pe}`,
|
|
8461
|
-
backgroundColor:
|
|
8461
|
+
backgroundColor: ee,
|
|
8462
8462
|
color: me,
|
|
8463
8463
|
outline: "none",
|
|
8464
8464
|
boxSizing: "border-box"
|
|
8465
8465
|
},
|
|
8466
8466
|
onFocus: (A) => {
|
|
8467
8467
|
const E = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), H = E.getPropertyValue("--metakyc-input-border-focus").trim() || E.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8468
|
-
A.currentTarget.style.backgroundColor =
|
|
8468
|
+
A.currentTarget.style.backgroundColor = ee, A.currentTarget.style.color = me, A.currentTarget.style.borderColor = H, A.currentTarget.style.outline = "none", A.currentTarget.style.boxShadow = `0 0 0 2px ${H}33`;
|
|
8469
8469
|
},
|
|
8470
8470
|
onBlur: (A) => {
|
|
8471
|
-
A.currentTarget.style.backgroundColor =
|
|
8471
|
+
A.currentTarget.style.backgroundColor = ee, A.currentTarget.style.color = me, A.currentTarget.style.borderColor = pe, A.currentTarget.style.outline = "none", A.currentTarget.style.boxShadow = "none";
|
|
8472
8472
|
}
|
|
8473
8473
|
}
|
|
8474
8474
|
) }),
|
|
8475
|
-
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: j.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color:
|
|
8475
|
+
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: j.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: Re }, children: u("common.noResults") }) : j.map((A) => {
|
|
8476
8476
|
const E = t.includes(A.value);
|
|
8477
8477
|
return /* @__PURE__ */ l(
|
|
8478
8478
|
"li",
|
|
@@ -8487,7 +8487,7 @@ const mi = 280, fa = ({
|
|
|
8487
8487
|
fontSize: "13px",
|
|
8488
8488
|
cursor: "pointer",
|
|
8489
8489
|
backgroundColor: E ? Y : "transparent",
|
|
8490
|
-
color: E ?
|
|
8490
|
+
color: E ? ce : me,
|
|
8491
8491
|
userSelect: "none"
|
|
8492
8492
|
},
|
|
8493
8493
|
onMouseEnter: (H) => {
|
|
@@ -8581,7 +8581,7 @@ const mi = 280, fa = ({
|
|
|
8581
8581
|
"button",
|
|
8582
8582
|
{
|
|
8583
8583
|
type: "button",
|
|
8584
|
-
onClick: (E) =>
|
|
8584
|
+
onClick: (E) => te(A, E),
|
|
8585
8585
|
className: "metakyc-multiselect-chip-remove",
|
|
8586
8586
|
style: {
|
|
8587
8587
|
background: "transparent",
|
|
@@ -8620,7 +8620,7 @@ const mi = 280, fa = ({
|
|
|
8620
8620
|
]
|
|
8621
8621
|
}
|
|
8622
8622
|
),
|
|
8623
|
-
typeof document < "u" &&
|
|
8623
|
+
typeof document < "u" && re ? Mt(re, document.body) : null
|
|
8624
8624
|
] });
|
|
8625
8625
|
}, pi = 260, nt = ({
|
|
8626
8626
|
label: e,
|
|
@@ -8645,7 +8645,7 @@ const mi = 280, fa = ({
|
|
|
8645
8645
|
primaryLight: "#eff6ff",
|
|
8646
8646
|
hoverBg: "#f9fafb"
|
|
8647
8647
|
}), G = Z(() => {
|
|
8648
|
-
const U = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), J = (
|
|
8648
|
+
const U = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), J = (Ne, Se) => U.getPropertyValue(Ne).trim() || Se, ke = J("--metakyc-input-bg", J("--metakyc-background", "#ffffff"));
|
|
8649
8649
|
q({
|
|
8650
8650
|
bg: ke,
|
|
8651
8651
|
border: J("--metakyc-input-border", J("--metakyc-border", "#d1d5db")),
|
|
@@ -8655,7 +8655,7 @@ const mi = 280, fa = ({
|
|
|
8655
8655
|
primaryLight: J("--metakyc-primary-light", "#eff6ff"),
|
|
8656
8656
|
hoverBg: J("--metakyc-surface", ke)
|
|
8657
8657
|
});
|
|
8658
|
-
}, []),
|
|
8658
|
+
}, []), se = ge(null), k = ge(null), L = ge(null), j = ge(null), X = Z(() => {
|
|
8659
8659
|
if (!k.current) return null;
|
|
8660
8660
|
const U = k.current.getBoundingClientRect(), ke = window.innerHeight - U.bottom < pi && U.top > pi;
|
|
8661
8661
|
return {
|
|
@@ -8664,20 +8664,20 @@ const mi = 280, fa = ({
|
|
|
8664
8664
|
width: U.width,
|
|
8665
8665
|
openUp: ke
|
|
8666
8666
|
};
|
|
8667
|
-
}, []),
|
|
8667
|
+
}, []), te = Z(() => {
|
|
8668
8668
|
if (T) return;
|
|
8669
8669
|
G();
|
|
8670
8670
|
const U = X();
|
|
8671
8671
|
U && F(U), O(!0);
|
|
8672
8672
|
}, [T, X, G]), $ = Z(() => {
|
|
8673
8673
|
O(!1), K("");
|
|
8674
|
-
}, []),
|
|
8674
|
+
}, []), ee = () => S ? $() : te();
|
|
8675
8675
|
ve(() => {
|
|
8676
8676
|
if (!S) return;
|
|
8677
8677
|
const U = (J) => {
|
|
8678
|
-
var
|
|
8678
|
+
var Ne, Se;
|
|
8679
8679
|
const ke = J.target;
|
|
8680
|
-
!((
|
|
8680
|
+
!((Ne = se.current) != null && Ne.contains(ke)) && !((Se = L.current) != null && Se.contains(ke)) && $();
|
|
8681
8681
|
};
|
|
8682
8682
|
return document.addEventListener("mousedown", U), () => document.removeEventListener("mousedown", U);
|
|
8683
8683
|
}, [S, $]), ve(() => {
|
|
@@ -8697,9 +8697,9 @@ const mi = 280, fa = ({
|
|
|
8697
8697
|
}, [S]);
|
|
8698
8698
|
const pe = r.filter(
|
|
8699
8699
|
(U) => U.label.toLowerCase().includes(C.toLowerCase()) || U.value.toLowerCase().includes(C.toLowerCase())
|
|
8700
|
-
), me = (fe = r.find((U) => U.value === o)) == null ? void 0 : fe.label,
|
|
8700
|
+
), me = (fe = r.find((U) => U.value === o)) == null ? void 0 : fe.label, Re = (U, J) => {
|
|
8701
8701
|
T || J || (s(U), $());
|
|
8702
|
-
}, { bg:
|
|
8702
|
+
}, { bg: ce, border: Y, text: Q, textSecondary: re, primary: A, primaryLight: E, hoverBg: H } = M, ye = S && W && /* @__PURE__ */ l(
|
|
8703
8703
|
"div",
|
|
8704
8704
|
{
|
|
8705
8705
|
ref: L,
|
|
@@ -8714,7 +8714,7 @@ const mi = 280, fa = ({
|
|
|
8714
8714
|
borderRadius: "8px",
|
|
8715
8715
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
8716
8716
|
border: `1px solid ${Y}`,
|
|
8717
|
-
backgroundColor:
|
|
8717
|
+
backgroundColor: ce,
|
|
8718
8718
|
overflow: "hidden"
|
|
8719
8719
|
},
|
|
8720
8720
|
children: [
|
|
@@ -8735,17 +8735,17 @@ const mi = 280, fa = ({
|
|
|
8735
8735
|
fontSize: "13px",
|
|
8736
8736
|
borderRadius: "6px",
|
|
8737
8737
|
border: `1px solid ${Y}`,
|
|
8738
|
-
backgroundColor:
|
|
8738
|
+
backgroundColor: ce,
|
|
8739
8739
|
color: Q,
|
|
8740
8740
|
outline: "none",
|
|
8741
8741
|
boxSizing: "border-box"
|
|
8742
8742
|
},
|
|
8743
8743
|
onFocus: (U) => {
|
|
8744
8744
|
const J = getComputedStyle(document.querySelector(".metakyc-sdk") || document.documentElement), ke = J.getPropertyValue("--metakyc-input-border-focus").trim() || J.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
8745
|
-
U.currentTarget.style.backgroundColor =
|
|
8745
|
+
U.currentTarget.style.backgroundColor = ce, U.currentTarget.style.color = Q, U.currentTarget.style.borderColor = ke, U.currentTarget.style.outline = "none", U.currentTarget.style.boxShadow = `0 0 0 2px ${ke}33`;
|
|
8746
8746
|
},
|
|
8747
8747
|
onBlur: (U) => {
|
|
8748
|
-
U.currentTarget.style.backgroundColor =
|
|
8748
|
+
U.currentTarget.style.backgroundColor = ce, U.currentTarget.style.color = Q, U.currentTarget.style.borderColor = Y, U.currentTarget.style.outline = "none", U.currentTarget.style.boxShadow = "none";
|
|
8749
8749
|
}
|
|
8750
8750
|
}
|
|
8751
8751
|
) }),
|
|
@@ -8759,13 +8759,13 @@ const mi = 280, fa = ({
|
|
|
8759
8759
|
maxHeight: "208px",
|
|
8760
8760
|
overflowY: "auto"
|
|
8761
8761
|
},
|
|
8762
|
-
children: pe.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color:
|
|
8762
|
+
children: pe.length === 0 ? /* @__PURE__ */ i("li", { style: { padding: "8px 12px", fontSize: "13px", color: re }, children: f("common.noResults") }) : pe.map((U) => {
|
|
8763
8763
|
const J = U.value === o;
|
|
8764
8764
|
return /* @__PURE__ */ i(
|
|
8765
8765
|
"li",
|
|
8766
8766
|
{
|
|
8767
8767
|
className: "metakyc-searchable-select-option",
|
|
8768
|
-
onClick: () =>
|
|
8768
|
+
onClick: () => Re(U.value, U.disabled),
|
|
8769
8769
|
style: {
|
|
8770
8770
|
padding: "8px 12px",
|
|
8771
8771
|
fontSize: "13px",
|
|
@@ -8795,7 +8795,7 @@ const mi = 280, fa = ({
|
|
|
8795
8795
|
"div",
|
|
8796
8796
|
{
|
|
8797
8797
|
className: We("w-full metakyc-searchable-select", y),
|
|
8798
|
-
ref:
|
|
8798
|
+
ref: se,
|
|
8799
8799
|
children: [
|
|
8800
8800
|
e && /* @__PURE__ */ l(
|
|
8801
8801
|
"label",
|
|
@@ -8814,9 +8814,9 @@ const mi = 280, fa = ({
|
|
|
8814
8814
|
ref: k,
|
|
8815
8815
|
role: "button",
|
|
8816
8816
|
tabIndex: T ? -1 : 0,
|
|
8817
|
-
onClick:
|
|
8817
|
+
onClick: ee,
|
|
8818
8818
|
onKeyDown: (U) => {
|
|
8819
|
-
(U.key === "Enter" || U.key === " ") && (U.preventDefault(),
|
|
8819
|
+
(U.key === "Enter" || U.key === " ") && (U.preventDefault(), ee()), U.key === "Escape" && $();
|
|
8820
8820
|
},
|
|
8821
8821
|
className: We(
|
|
8822
8822
|
"metakyc-searchable-select-trigger",
|
|
@@ -8892,7 +8892,7 @@ const ha = ({
|
|
|
8892
8892
|
S(null);
|
|
8893
8893
|
const L = u.filter((j, X) => X !== k);
|
|
8894
8894
|
c == null || c(L);
|
|
8895
|
-
}, G = a || T,
|
|
8895
|
+
}, G = a || T, se = u.length > 0;
|
|
8896
8896
|
return /* @__PURE__ */ l("div", { className: We("metakyc-file-upload", g), style: { width: "100%" }, children: [
|
|
8897
8897
|
e && /* @__PURE__ */ l("div", { style: { marginBottom: "8px" }, children: [
|
|
8898
8898
|
/* @__PURE__ */ l(
|
|
@@ -8923,7 +8923,7 @@ const ha = ({
|
|
|
8923
8923
|
style: {
|
|
8924
8924
|
border: `2px dashed ${G ? "var(--metakyc-danger, #ef4444)" : f ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
|
|
8925
8925
|
borderRadius: "12px",
|
|
8926
|
-
padding:
|
|
8926
|
+
padding: se ? "20px" : "32px 20px",
|
|
8927
8927
|
textAlign: "center",
|
|
8928
8928
|
cursor: "pointer",
|
|
8929
8929
|
transition: "all 0.2s ease",
|
|
@@ -8994,8 +8994,8 @@ const ha = ({
|
|
|
8994
8994
|
]
|
|
8995
8995
|
}
|
|
8996
8996
|
),
|
|
8997
|
-
|
|
8998
|
-
const j = ya(k), X = j === "image",
|
|
8997
|
+
se && /* @__PURE__ */ i("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: u.map((k, L) => {
|
|
8998
|
+
const j = ya(k), X = j === "image", te = X ? URL.createObjectURL(k) : null;
|
|
8999
8999
|
return /* @__PURE__ */ l(
|
|
9000
9000
|
"div",
|
|
9001
9001
|
{
|
|
@@ -9025,10 +9025,10 @@ const ha = ({
|
|
|
9025
9025
|
overflow: "hidden",
|
|
9026
9026
|
backgroundColor: X ? "transparent" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 10%, transparent)"
|
|
9027
9027
|
},
|
|
9028
|
-
children: X &&
|
|
9028
|
+
children: X && te ? /* @__PURE__ */ i(
|
|
9029
9029
|
"img",
|
|
9030
9030
|
{
|
|
9031
|
-
src:
|
|
9031
|
+
src: te,
|
|
9032
9032
|
alt: k.name,
|
|
9033
9033
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
9034
9034
|
}
|
|
@@ -9131,7 +9131,7 @@ const ha = ({
|
|
|
9131
9131
|
}
|
|
9132
9132
|
),
|
|
9133
9133
|
/* @__PURE__ */ i(
|
|
9134
|
-
|
|
9134
|
+
Ce,
|
|
9135
9135
|
{
|
|
9136
9136
|
ref: n,
|
|
9137
9137
|
type: "tel",
|
|
@@ -9326,7 +9326,7 @@ const Aa = ({
|
|
|
9326
9326
|
he.useEffect(() => {
|
|
9327
9327
|
o && Object.keys(o).length > 0 && Object.keys(y).length === 0 && f(o);
|
|
9328
9328
|
}, [o]);
|
|
9329
|
-
const C =
|
|
9329
|
+
const C = Ue(
|
|
9330
9330
|
() => n ? Ra(n.questionGroups) : [],
|
|
9331
9331
|
[n]
|
|
9332
9332
|
), K = S === C.length - 1, W = C[S] ?? [], F = Z((k, L) => {
|
|
@@ -9345,7 +9345,7 @@ const Aa = ({
|
|
|
9345
9345
|
M() && O((k) => k + 1);
|
|
9346
9346
|
}, G = () => {
|
|
9347
9347
|
S > 0 ? O((k) => k - 1) : a == null || a();
|
|
9348
|
-
},
|
|
9348
|
+
}, se = async () => {
|
|
9349
9349
|
if (!(!M() || !n))
|
|
9350
9350
|
try {
|
|
9351
9351
|
const k = n.questionGroups.flatMap(
|
|
@@ -9363,11 +9363,11 @@ const Aa = ({
|
|
|
9363
9363
|
console.error("Questionnaire submit error:", k);
|
|
9364
9364
|
}
|
|
9365
9365
|
};
|
|
9366
|
-
return s ? /* @__PURE__ */ i(
|
|
9366
|
+
return s ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i(Ke, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("p", { className: "text-danger-500", children: [
|
|
9367
9367
|
r("questionnaire.errorLoading"),
|
|
9368
9368
|
" ",
|
|
9369
9369
|
u.message
|
|
9370
|
-
] }) }) }) : n ? /* @__PURE__ */ l(
|
|
9370
|
+
] }) }) }) : n ? /* @__PURE__ */ l(ne, { children: [
|
|
9371
9371
|
/* @__PURE__ */ l(Le, { children: [
|
|
9372
9372
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
9373
9373
|
n.subtitle && /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.subtitle }),
|
|
@@ -9387,7 +9387,7 @@ const Aa = ({
|
|
|
9387
9387
|
)) })
|
|
9388
9388
|
] })
|
|
9389
9389
|
] }),
|
|
9390
|
-
/* @__PURE__ */ i(
|
|
9390
|
+
/* @__PURE__ */ i(oe, { className: "space-y-6", children: W.map(({ question: k }) => /* @__PURE__ */ i(
|
|
9391
9391
|
Ia,
|
|
9392
9392
|
{
|
|
9393
9393
|
question: k,
|
|
@@ -9399,7 +9399,7 @@ const Aa = ({
|
|
|
9399
9399
|
)) }),
|
|
9400
9400
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
9401
9401
|
/* @__PURE__ */ l(
|
|
9402
|
-
|
|
9402
|
+
le,
|
|
9403
9403
|
{
|
|
9404
9404
|
type: "button",
|
|
9405
9405
|
variant: "outline",
|
|
@@ -9412,15 +9412,15 @@ const Aa = ({
|
|
|
9412
9412
|
}
|
|
9413
9413
|
),
|
|
9414
9414
|
K ? /* @__PURE__ */ i(
|
|
9415
|
-
|
|
9415
|
+
le,
|
|
9416
9416
|
{
|
|
9417
9417
|
type: "button",
|
|
9418
9418
|
isLoading: c,
|
|
9419
|
-
onClick:
|
|
9419
|
+
onClick: se,
|
|
9420
9420
|
children: r("common.continue")
|
|
9421
9421
|
}
|
|
9422
9422
|
) : /* @__PURE__ */ l(
|
|
9423
|
-
|
|
9423
|
+
le,
|
|
9424
9424
|
{
|
|
9425
9425
|
type: "button",
|
|
9426
9426
|
onClick: q,
|
|
@@ -9448,7 +9448,7 @@ const Aa = ({
|
|
|
9448
9448
|
e.subtitle && /* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.subtitle }),
|
|
9449
9449
|
e.description && /* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.description }),
|
|
9450
9450
|
s === "text" && /* @__PURE__ */ i(
|
|
9451
|
-
|
|
9451
|
+
Ce,
|
|
9452
9452
|
{
|
|
9453
9453
|
value: t[0] ?? "",
|
|
9454
9454
|
onChange: (u) => r([u.target.value]),
|
|
@@ -9543,7 +9543,7 @@ const La = ({
|
|
|
9543
9543
|
onComplete: t,
|
|
9544
9544
|
onBack: a
|
|
9545
9545
|
}) => {
|
|
9546
|
-
const { t: r } = Ie(), { uploadDocument: n, isLoading: o, isSubmitting: s, error: c, submit: u } = la(e), [g, y] = N({}), [f, D] = N(null), [T, S] = N(0), [O, C] = N({}), K =
|
|
9546
|
+
const { t: r } = Ie(), { uploadDocument: n, isLoading: o, isSubmitting: s, error: c, submit: u } = la(e), [g, y] = N({}), [f, D] = N(null), [T, S] = N(0), [O, C] = N({}), K = Ue(
|
|
9547
9547
|
() => n ? za(n.uploadDocumentFiles) : [],
|
|
9548
9548
|
[n]
|
|
9549
9549
|
), W = K[T] ?? [], F = T === K.length - 1, M = K.length, q = Z(() => {
|
|
@@ -9553,7 +9553,7 @@ const La = ({
|
|
|
9553
9553
|
return C(L), Object.keys(L).length === 0;
|
|
9554
9554
|
}, [W, g]), G = () => {
|
|
9555
9555
|
q() && (S((L) => L + 1), C({}));
|
|
9556
|
-
},
|
|
9556
|
+
}, se = () => {
|
|
9557
9557
|
T > 0 ? (S((L) => L - 1), C({})) : a == null || a();
|
|
9558
9558
|
}, k = async () => {
|
|
9559
9559
|
if (!(!q() || !n)) {
|
|
@@ -9561,10 +9561,10 @@ const La = ({
|
|
|
9561
9561
|
try {
|
|
9562
9562
|
const L = await Promise.all(
|
|
9563
9563
|
n.uploadDocumentFiles.map(async (X) => {
|
|
9564
|
-
const
|
|
9565
|
-
|
|
9566
|
-
fileName:
|
|
9567
|
-
fileData: await ta(
|
|
9564
|
+
const te = g[X.id] || [], $ = await Promise.all(
|
|
9565
|
+
te.map(async (ee) => ({
|
|
9566
|
+
fileName: ee.name,
|
|
9567
|
+
fileData: await ta(ee)
|
|
9568
9568
|
}))
|
|
9569
9569
|
);
|
|
9570
9570
|
return {
|
|
@@ -9583,10 +9583,10 @@ const La = ({
|
|
|
9583
9583
|
}
|
|
9584
9584
|
}
|
|
9585
9585
|
};
|
|
9586
|
-
return o ? /* @__PURE__ */ i(
|
|
9587
|
-
/* @__PURE__ */ i(
|
|
9586
|
+
return o ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
9587
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
9588
9588
|
/* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("uploadDocument.loading") })
|
|
9589
|
-
] }) }) }) : c ? /* @__PURE__ */ i(
|
|
9589
|
+
] }) }) }) : c ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { style: {
|
|
9590
9590
|
display: "flex",
|
|
9591
9591
|
flexDirection: "column",
|
|
9592
9592
|
alignItems: "center",
|
|
@@ -9609,7 +9609,7 @@ const La = ({
|
|
|
9609
9609
|
] }) }),
|
|
9610
9610
|
/* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-danger, #ef4444)", fontWeight: 500 }, children: r("uploadDocument.errorLoading") }),
|
|
9611
9611
|
/* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: c.message })
|
|
9612
|
-
] }) }) }) : n ? /* @__PURE__ */ l(
|
|
9612
|
+
] }) }) }) : n ? /* @__PURE__ */ l(ne, { children: [
|
|
9613
9613
|
/* @__PURE__ */ l(Le, { children: [
|
|
9614
9614
|
/* @__PURE__ */ i("h2", { style: {
|
|
9615
9615
|
fontSize: "18px",
|
|
@@ -9680,7 +9680,7 @@ const La = ({
|
|
|
9680
9680
|
lineHeight: 1.5
|
|
9681
9681
|
}, children: n.description })
|
|
9682
9682
|
] }),
|
|
9683
|
-
/* @__PURE__ */ i(
|
|
9683
|
+
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: W.map((L) => /* @__PURE__ */ i(
|
|
9684
9684
|
ha,
|
|
9685
9685
|
{
|
|
9686
9686
|
label: L.displayName,
|
|
@@ -9693,8 +9693,8 @@ const La = ({
|
|
|
9693
9693
|
value: g[L.id] || [],
|
|
9694
9694
|
onChange: (j) => {
|
|
9695
9695
|
D(null), C((X) => {
|
|
9696
|
-
const
|
|
9697
|
-
return delete
|
|
9696
|
+
const te = { ...X };
|
|
9697
|
+
return delete te[L.id], te;
|
|
9698
9698
|
}), y((X) => ({ ...X, [L.id]: j }));
|
|
9699
9699
|
}
|
|
9700
9700
|
},
|
|
@@ -9724,16 +9724,16 @@ const La = ({
|
|
|
9724
9724
|
width: "100%"
|
|
9725
9725
|
}, children: [
|
|
9726
9726
|
/* @__PURE__ */ i(
|
|
9727
|
-
|
|
9727
|
+
le,
|
|
9728
9728
|
{
|
|
9729
9729
|
type: "button",
|
|
9730
9730
|
variant: "outline",
|
|
9731
|
-
onClick:
|
|
9731
|
+
onClick: se,
|
|
9732
9732
|
children: T > 0 ? r("common.previous") : r("common.back")
|
|
9733
9733
|
}
|
|
9734
9734
|
),
|
|
9735
9735
|
F ? /* @__PURE__ */ i(
|
|
9736
|
-
|
|
9736
|
+
le,
|
|
9737
9737
|
{
|
|
9738
9738
|
type: "button",
|
|
9739
9739
|
isLoading: s,
|
|
@@ -9741,7 +9741,7 @@ const La = ({
|
|
|
9741
9741
|
children: r(s ? "uploadDocument.uploading" : "common.continue")
|
|
9742
9742
|
}
|
|
9743
9743
|
) : /* @__PURE__ */ i(
|
|
9744
|
-
|
|
9744
|
+
le,
|
|
9745
9745
|
{
|
|
9746
9746
|
type: "button",
|
|
9747
9747
|
onClick: G,
|
|
@@ -9754,16 +9754,16 @@ const La = ({
|
|
|
9754
9754
|
const { t: r } = Ie(), { overview: n, isLoading: o, isSubmitting: s, error: c, passOverview: u } = ca(e), g = async () => {
|
|
9755
9755
|
await u(), t == null || t();
|
|
9756
9756
|
};
|
|
9757
|
-
return o ? /* @__PURE__ */ i(
|
|
9757
|
+
return o ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i(Ke, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("p", { className: "text-danger-500", children: [
|
|
9758
9758
|
r("overview.errorLoading"),
|
|
9759
9759
|
" ",
|
|
9760
9760
|
c.message
|
|
9761
|
-
] }) }) }) : n ? /* @__PURE__ */ l(
|
|
9761
|
+
] }) }) }) : n ? /* @__PURE__ */ l(ne, { children: [
|
|
9762
9762
|
/* @__PURE__ */ l(Le, { children: [
|
|
9763
9763
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: n.title || r("overview.title") }),
|
|
9764
9764
|
n.description && /* @__PURE__ */ i("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.description })
|
|
9765
9765
|
] }),
|
|
9766
|
-
/* @__PURE__ */ i(
|
|
9766
|
+
/* @__PURE__ */ i(oe, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((y, f) => y.order - f.order).map((y) => /* @__PURE__ */ l("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
9767
9767
|
/* @__PURE__ */ i("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ i(
|
|
9768
9768
|
"div",
|
|
9769
9769
|
{
|
|
@@ -9790,8 +9790,8 @@ const La = ({
|
|
|
9790
9790
|
)
|
|
9791
9791
|
] }, y.order)) : /* @__PURE__ */ i("div", { className: "text-center py-8", children: /* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("overview.loadingOverview") }) }) }),
|
|
9792
9792
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
9793
|
-
a && /* @__PURE__ */ i(
|
|
9794
|
-
/* @__PURE__ */ i(
|
|
9793
|
+
a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
9794
|
+
/* @__PURE__ */ i(le, { onClick: g, isLoading: s, children: r("common.continue") })
|
|
9795
9795
|
] })
|
|
9796
9796
|
] }) : null;
|
|
9797
9797
|
};
|
|
@@ -9861,62 +9861,62 @@ const Va = ({
|
|
|
9861
9861
|
onComplete: t,
|
|
9862
9862
|
onBack: a
|
|
9863
9863
|
}) => {
|
|
9864
|
-
const { t: r } = Ie(), { config: n } =
|
|
9864
|
+
const { t: r } = Ie(), { config: n } = Te(), o = n.locale ?? "en", { criteria: s, initialAnswers: c, isLoading: u, isSubmitting: g, error: y, submit: f } = ua(e), [D, T] = N({}), [S, O] = N({}), [C, K] = N(0), [W, F] = N(!1);
|
|
9865
9865
|
he.useEffect(() => {
|
|
9866
9866
|
c && Object.keys(c).length > 0 && Object.keys(D).length === 0 && T(c);
|
|
9867
9867
|
}, [c]);
|
|
9868
|
-
const M =
|
|
9868
|
+
const M = Ue(
|
|
9869
9869
|
() => s && s.length > 0 ? Fa(s) : [],
|
|
9870
9870
|
[s]
|
|
9871
9871
|
), q = C === M.length - 1, G = M[C] ?? [];
|
|
9872
9872
|
he.useEffect(() => {
|
|
9873
9873
|
!u && s && s.length === 0 && !W && !g && (F(!0), f({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
9874
9874
|
}, [u, s, W, g, f, e, t]);
|
|
9875
|
-
const
|
|
9876
|
-
T((
|
|
9877
|
-
const pe = { ...
|
|
9878
|
-
return delete pe[
|
|
9875
|
+
const se = Z((te, $) => {
|
|
9876
|
+
T((ee) => ({ ...ee, [te]: $ })), O((ee) => {
|
|
9877
|
+
const pe = { ...ee };
|
|
9878
|
+
return delete pe[te], pe;
|
|
9879
9879
|
});
|
|
9880
9880
|
}, []), k = Z(() => {
|
|
9881
|
-
const
|
|
9881
|
+
const te = {};
|
|
9882
9882
|
for (const { criterion: $ } of G) {
|
|
9883
|
-
const
|
|
9884
|
-
|
|
9883
|
+
const ee = ja($, D[$.id] ?? []);
|
|
9884
|
+
ee && (te[$.id] = ee);
|
|
9885
9885
|
}
|
|
9886
|
-
return O(($) => ({ ...$, ...
|
|
9886
|
+
return O(($) => ({ ...$, ...te })), Object.keys(te).length === 0;
|
|
9887
9887
|
}, [G, D]), L = () => {
|
|
9888
|
-
k() && K((
|
|
9888
|
+
k() && K((te) => te + 1);
|
|
9889
9889
|
}, j = () => {
|
|
9890
|
-
C > 0 ? K((
|
|
9890
|
+
C > 0 ? K((te) => te - 1) : a == null || a();
|
|
9891
9891
|
}, X = async () => {
|
|
9892
9892
|
if (!(!k() || !s))
|
|
9893
9893
|
try {
|
|
9894
|
-
const
|
|
9895
|
-
const pe = (D[
|
|
9896
|
-
return pe.length > 0 ? { riskCriteriaId:
|
|
9897
|
-
}).filter((
|
|
9898
|
-
await f({ applicantId: e, criteriaValueInputs:
|
|
9899
|
-
} catch (
|
|
9900
|
-
console.error("Risk scoring submit error:",
|
|
9894
|
+
const te = s.map((ee) => {
|
|
9895
|
+
const pe = (D[ee.id] ?? []).filter((me) => me && me.trim());
|
|
9896
|
+
return pe.length > 0 ? { riskCriteriaId: ee.id, values: pe } : null;
|
|
9897
|
+
}).filter((ee) => ee !== null);
|
|
9898
|
+
await f({ applicantId: e, criteriaValueInputs: te }), t == null || t();
|
|
9899
|
+
} catch (te) {
|
|
9900
|
+
console.error("Risk scoring submit error:", te);
|
|
9901
9901
|
}
|
|
9902
9902
|
};
|
|
9903
|
-
return u ? /* @__PURE__ */ i(
|
|
9904
|
-
/* @__PURE__ */ i(
|
|
9903
|
+
return u ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
9904
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
9905
9905
|
/* @__PURE__ */ i("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.loadingCriteria") })
|
|
9906
|
-
] }) }) : !u && s && s.length === 0 ? /* @__PURE__ */ i(
|
|
9907
|
-
/* @__PURE__ */ i(
|
|
9906
|
+
] }) }) : !u && s && s.length === 0 ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
9907
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
9908
9908
|
/* @__PURE__ */ i("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.noCriteria") })
|
|
9909
|
-
] }) }) : y ? /* @__PURE__ */ i(
|
|
9909
|
+
] }) }) : y ? /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("p", { className: "text-danger-500", children: [
|
|
9910
9910
|
r("riskScoring.errorLoading"),
|
|
9911
9911
|
" ",
|
|
9912
9912
|
y.message
|
|
9913
|
-
] }) }) }) : s ? /* @__PURE__ */ l(
|
|
9913
|
+
] }) }) }) : s ? /* @__PURE__ */ l(ne, { children: [
|
|
9914
9914
|
/* @__PURE__ */ l(Le, { children: [
|
|
9915
9915
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", children: r("riskScoring.title") }),
|
|
9916
9916
|
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("riskScoring.subtitle") }),
|
|
9917
9917
|
M.length > 1 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between mt-3", children: [
|
|
9918
9918
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("common.pageXofY", { current: C + 1, total: M.length }) }),
|
|
9919
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: M.map((
|
|
9919
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: M.map((te, $) => /* @__PURE__ */ i(
|
|
9920
9920
|
"div",
|
|
9921
9921
|
{
|
|
9922
9922
|
className: "rounded-full transition-all duration-200",
|
|
@@ -9930,20 +9930,20 @@ const Va = ({
|
|
|
9930
9930
|
)) })
|
|
9931
9931
|
] })
|
|
9932
9932
|
] }),
|
|
9933
|
-
/* @__PURE__ */ i(
|
|
9933
|
+
/* @__PURE__ */ i(oe, { className: "space-y-6", children: G.map(({ criterion: te }) => /* @__PURE__ */ i(
|
|
9934
9934
|
Ba,
|
|
9935
9935
|
{
|
|
9936
|
-
criterion:
|
|
9937
|
-
value: D[
|
|
9938
|
-
error: S[
|
|
9936
|
+
criterion: te,
|
|
9937
|
+
value: D[te.id] ?? [],
|
|
9938
|
+
error: S[te.id],
|
|
9939
9939
|
locale: o,
|
|
9940
|
-
onChange: ($) =>
|
|
9940
|
+
onChange: ($) => se(te.id, $)
|
|
9941
9941
|
},
|
|
9942
|
-
|
|
9942
|
+
te.id
|
|
9943
9943
|
)) }),
|
|
9944
9944
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
9945
9945
|
/* @__PURE__ */ l(
|
|
9946
|
-
|
|
9946
|
+
le,
|
|
9947
9947
|
{
|
|
9948
9948
|
type: "button",
|
|
9949
9949
|
variant: "outline",
|
|
@@ -9955,8 +9955,8 @@ const Va = ({
|
|
|
9955
9955
|
]
|
|
9956
9956
|
}
|
|
9957
9957
|
),
|
|
9958
|
-
q ? /* @__PURE__ */ i(
|
|
9959
|
-
|
|
9958
|
+
q ? /* @__PURE__ */ i(le, { type: "button", isLoading: g, onClick: X, children: r("common.continue") }) : /* @__PURE__ */ l(
|
|
9959
|
+
le,
|
|
9960
9960
|
{
|
|
9961
9961
|
type: "button",
|
|
9962
9962
|
onClick: L,
|
|
@@ -9983,7 +9983,7 @@ const Va = ({
|
|
|
9983
9983
|
e.description && /* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
|
|
9984
9984
|
c && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.min !== void 0 && e.max !== void 0 ? o("riskScoring.range", { min: e.min, max: e.max }) : e.min !== void 0 ? o("riskScoring.minimum", { min: e.min }) : o("riskScoring.maximum", { max: e.max }) }),
|
|
9985
9985
|
s === "text" && /* @__PURE__ */ i(
|
|
9986
|
-
|
|
9986
|
+
Ce,
|
|
9987
9987
|
{
|
|
9988
9988
|
value: t[0] ?? "",
|
|
9989
9989
|
onChange: (y) => n([y.target.value]),
|
|
@@ -10080,7 +10080,7 @@ const Va = ({
|
|
|
10080
10080
|
onComplete: t,
|
|
10081
10081
|
onBack: a
|
|
10082
10082
|
}) => {
|
|
10083
|
-
const { t: r } = Ie(), { investorCategorizationService: n } =
|
|
10083
|
+
const { t: r } = Ie(), { investorCategorizationService: n } = Te(), [o, s] = N(null), [c, u] = N(!1), [g, y] = N(null);
|
|
10084
10084
|
return /* @__PURE__ */ i("form", { onSubmit: async (D) => {
|
|
10085
10085
|
if (D.preventDefault(), o === null) {
|
|
10086
10086
|
y(r("investorCategorization.pleaseSelect"));
|
|
@@ -10100,20 +10100,20 @@ const Va = ({
|
|
|
10100
10100
|
} finally {
|
|
10101
10101
|
u(!1);
|
|
10102
10102
|
}
|
|
10103
|
-
}, children: /* @__PURE__ */ l(
|
|
10103
|
+
}, children: /* @__PURE__ */ l(ne, { children: [
|
|
10104
10104
|
/* @__PURE__ */ l(Le, { children: [
|
|
10105
10105
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: r("investorCategorization.whichStatement") }),
|
|
10106
10106
|
/* @__PURE__ */ i("p", { className: "mt-2", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("investorCategorization.retailInvestorInfo") })
|
|
10107
10107
|
] }),
|
|
10108
|
-
/* @__PURE__ */ l(
|
|
10108
|
+
/* @__PURE__ */ l(oe, { className: "space-y-4", children: [
|
|
10109
10109
|
/* @__PURE__ */ i("p", { className: "text-sm font-medium mb-3", style: { color: "var(--metakyc-text-secondary, #374151)" }, children: r("investorCategorization.chooseOne") }),
|
|
10110
10110
|
/* @__PURE__ */ i(
|
|
10111
10111
|
"label",
|
|
10112
10112
|
{
|
|
10113
10113
|
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
10114
10114
|
style: {
|
|
10115
|
-
borderColor: o ===
|
|
10116
|
-
backgroundColor: o ===
|
|
10115
|
+
borderColor: o === Oe.Individual ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
10116
|
+
backgroundColor: o === Oe.Individual ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
10117
10117
|
},
|
|
10118
10118
|
children: /* @__PURE__ */ l("div", { className: "flex items-start", children: [
|
|
10119
10119
|
/* @__PURE__ */ i(
|
|
@@ -10121,9 +10121,9 @@ const Va = ({
|
|
|
10121
10121
|
{
|
|
10122
10122
|
type: "radio",
|
|
10123
10123
|
name: "investorType",
|
|
10124
|
-
value:
|
|
10125
|
-
checked: o ===
|
|
10126
|
-
onChange: () => s(
|
|
10124
|
+
value: Oe.Individual,
|
|
10125
|
+
checked: o === Oe.Individual,
|
|
10126
|
+
onChange: () => s(Oe.Individual),
|
|
10127
10127
|
className: "mt-1"
|
|
10128
10128
|
}
|
|
10129
10129
|
),
|
|
@@ -10139,8 +10139,8 @@ const Va = ({
|
|
|
10139
10139
|
{
|
|
10140
10140
|
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
10141
10141
|
style: {
|
|
10142
|
-
borderColor: o ===
|
|
10143
|
-
backgroundColor: o ===
|
|
10142
|
+
borderColor: o === Oe.Sophisticated ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
10143
|
+
backgroundColor: o === Oe.Sophisticated ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
10144
10144
|
},
|
|
10145
10145
|
children: /* @__PURE__ */ l("div", { className: "flex items-start", children: [
|
|
10146
10146
|
/* @__PURE__ */ i(
|
|
@@ -10148,9 +10148,9 @@ const Va = ({
|
|
|
10148
10148
|
{
|
|
10149
10149
|
type: "radio",
|
|
10150
10150
|
name: "investorType",
|
|
10151
|
-
value:
|
|
10152
|
-
checked: o ===
|
|
10153
|
-
onChange: () => s(
|
|
10151
|
+
value: Oe.Sophisticated,
|
|
10152
|
+
checked: o === Oe.Sophisticated,
|
|
10153
|
+
onChange: () => s(Oe.Sophisticated),
|
|
10154
10154
|
className: "mt-1"
|
|
10155
10155
|
}
|
|
10156
10156
|
),
|
|
@@ -10166,8 +10166,8 @@ const Va = ({
|
|
|
10166
10166
|
{
|
|
10167
10167
|
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
10168
10168
|
style: {
|
|
10169
|
-
borderColor: o ===
|
|
10170
|
-
backgroundColor: o ===
|
|
10169
|
+
borderColor: o === Oe.HighNetWorth ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
10170
|
+
backgroundColor: o === Oe.HighNetWorth ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
10171
10171
|
},
|
|
10172
10172
|
children: /* @__PURE__ */ l("div", { className: "flex items-start", children: [
|
|
10173
10173
|
/* @__PURE__ */ i(
|
|
@@ -10175,9 +10175,9 @@ const Va = ({
|
|
|
10175
10175
|
{
|
|
10176
10176
|
type: "radio",
|
|
10177
10177
|
name: "investorType",
|
|
10178
|
-
value:
|
|
10179
|
-
checked: o ===
|
|
10180
|
-
onChange: () => s(
|
|
10178
|
+
value: Oe.HighNetWorth,
|
|
10179
|
+
checked: o === Oe.HighNetWorth,
|
|
10180
|
+
onChange: () => s(Oe.HighNetWorth),
|
|
10181
10181
|
className: "mt-1"
|
|
10182
10182
|
}
|
|
10183
10183
|
),
|
|
@@ -10195,9 +10195,9 @@ const Va = ({
|
|
|
10195
10195
|
] }) })
|
|
10196
10196
|
] }),
|
|
10197
10197
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
10198
|
-
a && /* @__PURE__ */ i(
|
|
10198
|
+
a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
10199
10199
|
/* @__PURE__ */ i(
|
|
10200
|
-
|
|
10200
|
+
le,
|
|
10201
10201
|
{
|
|
10202
10202
|
type: "submit",
|
|
10203
10203
|
isLoading: c,
|
|
@@ -10221,7 +10221,7 @@ const Ua = ({
|
|
|
10221
10221
|
onComplete: t,
|
|
10222
10222
|
onBack: a
|
|
10223
10223
|
}) => {
|
|
10224
|
-
const { t: r } = Ie(), { appropriatenessTestService: n } =
|
|
10224
|
+
const { t: r } = Ie(), { appropriatenessTestService: n } = Te(), [o, s] = N(null), [c, u] = N(!0), [g, y] = N(!1), [f, D] = N(null), [T, S] = N({}), [O, C] = N(0), [K, W] = N(!1), [F, M] = N(!1), [q, G] = N(0), [se, k] = N(0), [L, j] = N(null);
|
|
10225
10225
|
ve(() => {
|
|
10226
10226
|
(async () => {
|
|
10227
10227
|
try {
|
|
@@ -10250,11 +10250,11 @@ const Ua = ({
|
|
|
10250
10250
|
}, 1e3);
|
|
10251
10251
|
return () => clearInterval(E);
|
|
10252
10252
|
}, [q]), ve(() => {
|
|
10253
|
-
F && !g &&
|
|
10253
|
+
F && !g && ee();
|
|
10254
10254
|
}, [F]);
|
|
10255
10255
|
const X = () => {
|
|
10256
10256
|
o && (W(!0), C(o.testDurationSec), k(0), S({}), D(null));
|
|
10257
|
-
},
|
|
10257
|
+
}, te = (E, H) => {
|
|
10258
10258
|
S((ye) => ({ ...ye, [E]: H }));
|
|
10259
10259
|
}, $ = Z(async () => {
|
|
10260
10260
|
try {
|
|
@@ -10265,7 +10265,7 @@ const Ua = ({
|
|
|
10265
10265
|
}
|
|
10266
10266
|
} catch {
|
|
10267
10267
|
}
|
|
10268
|
-
}, [e, n]),
|
|
10268
|
+
}, [e, n]), ee = async (E) => {
|
|
10269
10269
|
if (o) {
|
|
10270
10270
|
if (!F) {
|
|
10271
10271
|
const H = o.appropriatenessQuestions.length - Object.keys(T).length;
|
|
@@ -10302,20 +10302,20 @@ const Ua = ({
|
|
|
10302
10302
|
W(!1), M(!1), S({}), k(0);
|
|
10303
10303
|
};
|
|
10304
10304
|
if (c)
|
|
10305
|
-
return /* @__PURE__ */ i(
|
|
10306
|
-
/* @__PURE__ */ i(
|
|
10305
|
+
return /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
10306
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
10307
10307
|
/* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: r("appropriatenessTest.loadingTest") })
|
|
10308
10308
|
] }) }) });
|
|
10309
10309
|
if (!o)
|
|
10310
|
-
return /* @__PURE__ */ i(
|
|
10310
|
+
return /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
|
|
10311
10311
|
/* @__PURE__ */ i("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: r("appropriatenessTest.noTestData") }),
|
|
10312
10312
|
f && /* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: f })
|
|
10313
10313
|
] }) }) });
|
|
10314
|
-
const me = o.testAllowedMaxTry - o.totalFailedTries,
|
|
10314
|
+
const me = o.testAllowedMaxTry - o.totalFailedTries, Re = o.appropriatenessQuestions.length, ce = Object.keys(T).length;
|
|
10315
10315
|
if (q > 0)
|
|
10316
|
-
return /* @__PURE__ */ l(
|
|
10316
|
+
return /* @__PURE__ */ l(ne, { children: [
|
|
10317
10317
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: o.displayName }) }),
|
|
10318
|
-
/* @__PURE__ */ i(
|
|
10318
|
+
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
|
|
10319
10319
|
/* @__PURE__ */ i("div", { style: {
|
|
10320
10320
|
width: "100px",
|
|
10321
10321
|
height: "100px",
|
|
@@ -10346,8 +10346,8 @@ const Ua = ({
|
|
|
10346
10346
|
const E = () => {
|
|
10347
10347
|
j(null), pe(), D(null);
|
|
10348
10348
|
};
|
|
10349
|
-
return /* @__PURE__ */ l(
|
|
10350
|
-
/* @__PURE__ */ i(
|
|
10349
|
+
return /* @__PURE__ */ l(ne, { children: [
|
|
10350
|
+
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { style: {
|
|
10351
10351
|
display: "flex",
|
|
10352
10352
|
flexDirection: "column",
|
|
10353
10353
|
alignItems: "center",
|
|
@@ -10408,20 +10408,20 @@ const Ua = ({
|
|
|
10408
10408
|
margin: 0
|
|
10409
10409
|
}, children: r("appropriatenessTest.noAttemptsRemaining") }) })
|
|
10410
10410
|
] }) }),
|
|
10411
|
-
/* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: L.success ? /* @__PURE__ */ i(
|
|
10412
|
-
me > 0 && q <= 0 && /* @__PURE__ */ i(
|
|
10413
|
-
me > 0 && q > 0 && /* @__PURE__ */ i(
|
|
10414
|
-
me <= 0 && a && /* @__PURE__ */ i(
|
|
10411
|
+
/* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ i("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: L.success ? /* @__PURE__ */ i(le, { type: "button", onClick: () => t == null ? void 0 : t(), children: r("common.continue") }) : /* @__PURE__ */ l(bt, { children: [
|
|
10412
|
+
me > 0 && q <= 0 && /* @__PURE__ */ i(le, { type: "button", onClick: E, children: r("appropriatenessTest.retakeTest") }),
|
|
10413
|
+
me > 0 && q > 0 && /* @__PURE__ */ i(le, { type: "button", onClick: E, children: r("appropriatenessTest.ok") }),
|
|
10414
|
+
me <= 0 && a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") })
|
|
10415
10415
|
] }) }) })
|
|
10416
10416
|
] });
|
|
10417
10417
|
}
|
|
10418
10418
|
if (!K)
|
|
10419
|
-
return /* @__PURE__ */ l(
|
|
10419
|
+
return /* @__PURE__ */ l(ne, { children: [
|
|
10420
10420
|
/* @__PURE__ */ l(Le, { children: [
|
|
10421
10421
|
/* @__PURE__ */ i("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: o.displayName }),
|
|
10422
10422
|
o.subtitle && /* @__PURE__ */ i("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", marginTop: "4px" }, children: o.subtitle })
|
|
10423
10423
|
] }),
|
|
10424
|
-
/* @__PURE__ */ l(
|
|
10424
|
+
/* @__PURE__ */ l(oe, { children: [
|
|
10425
10425
|
o.description && /* @__PURE__ */ l("div", { style: {
|
|
10426
10426
|
marginBottom: "20px",
|
|
10427
10427
|
padding: "12px 14px",
|
|
@@ -10480,17 +10480,17 @@ const Ua = ({
|
|
|
10480
10480
|
}, children: /* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: r("appropriatenessTest.allAttemptsUsed") }) })
|
|
10481
10481
|
] }),
|
|
10482
10482
|
/* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", justifyContent: a ? "space-between" : "flex-end", width: "100%" }, children: [
|
|
10483
|
-
a && /* @__PURE__ */ i(
|
|
10484
|
-
/* @__PURE__ */ i(
|
|
10483
|
+
a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
10484
|
+
/* @__PURE__ */ i(le, { type: "button", onClick: X, disabled: me <= 0, children: r("appropriatenessTest.startTest") })
|
|
10485
10485
|
] }) })
|
|
10486
10486
|
] });
|
|
10487
|
-
const Y = o.appropriatenessQuestions[
|
|
10488
|
-
return /* @__PURE__ */ l(
|
|
10487
|
+
const Y = o.appropriatenessQuestions[se], Q = se === Re - 1, re = ce === Re, A = O <= 60;
|
|
10488
|
+
return /* @__PURE__ */ l(ne, { children: [
|
|
10489
10489
|
/* @__PURE__ */ l(Le, { children: [
|
|
10490
10490
|
/* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
10491
10491
|
/* @__PURE__ */ l("div", { children: [
|
|
10492
10492
|
/* @__PURE__ */ i("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: o.displayName }),
|
|
10493
|
-
/* @__PURE__ */ i("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "2px" }, children: r("appropriatenessTest.questionXofY", { current:
|
|
10493
|
+
/* @__PURE__ */ i("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "2px" }, children: r("appropriatenessTest.questionXofY", { current: se + 1, total: Re }) })
|
|
10494
10494
|
] }),
|
|
10495
10495
|
/* @__PURE__ */ l("div", { style: {
|
|
10496
10496
|
display: "flex",
|
|
@@ -10537,7 +10537,7 @@ const Ua = ({
|
|
|
10537
10537
|
height: "100%",
|
|
10538
10538
|
borderRadius: "999px",
|
|
10539
10539
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
10540
|
-
width: `${
|
|
10540
|
+
width: `${ce / Re * 100}%`,
|
|
10541
10541
|
transition: "width 0.3s ease"
|
|
10542
10542
|
} }) }),
|
|
10543
10543
|
/* @__PURE__ */ l("div", { style: {
|
|
@@ -10546,7 +10546,7 @@ const Ua = ({
|
|
|
10546
10546
|
marginTop: "4px"
|
|
10547
10547
|
}, children: [
|
|
10548
10548
|
/* @__PURE__ */ l("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
10549
|
-
|
|
10549
|
+
ce,
|
|
10550
10550
|
" ",
|
|
10551
10551
|
r("appropriatenessTest.answered")
|
|
10552
10552
|
] }),
|
|
@@ -10558,18 +10558,18 @@ const Ua = ({
|
|
|
10558
10558
|
] })
|
|
10559
10559
|
] })
|
|
10560
10560
|
] }),
|
|
10561
|
-
/* @__PURE__ */ l(
|
|
10561
|
+
/* @__PURE__ */ l(oe, { children: [
|
|
10562
10562
|
Y && /* @__PURE__ */ i(
|
|
10563
10563
|
Wa,
|
|
10564
10564
|
{
|
|
10565
10565
|
question: Y,
|
|
10566
|
-
index:
|
|
10566
|
+
index: se,
|
|
10567
10567
|
selectedAnswer: T[Y.id],
|
|
10568
|
-
onSelect: (E) =>
|
|
10568
|
+
onSelect: (E) => te(Y.id, E),
|
|
10569
10569
|
disabled: g
|
|
10570
10570
|
}
|
|
10571
10571
|
),
|
|
10572
|
-
|
|
10572
|
+
Re > 1 && /* @__PURE__ */ i("div", { style: {
|
|
10573
10573
|
display: "flex",
|
|
10574
10574
|
justifyContent: "center",
|
|
10575
10575
|
gap: "6px",
|
|
@@ -10584,8 +10584,8 @@ const Ua = ({
|
|
|
10584
10584
|
width: "28px",
|
|
10585
10585
|
height: "28px",
|
|
10586
10586
|
borderRadius: "8px",
|
|
10587
|
-
border: H ===
|
|
10588
|
-
backgroundColor: T[E.id] ? H ===
|
|
10587
|
+
border: H === se ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
10588
|
+
backgroundColor: T[E.id] ? H === se ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : H === se ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
10589
10589
|
color: T[E.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
10590
10590
|
fontSize: "12px",
|
|
10591
10591
|
fontWeight: 600,
|
|
@@ -10626,34 +10626,34 @@ const Ua = ({
|
|
|
10626
10626
|
] }),
|
|
10627
10627
|
/* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
10628
10628
|
/* @__PURE__ */ i(
|
|
10629
|
-
|
|
10629
|
+
le,
|
|
10630
10630
|
{
|
|
10631
10631
|
type: "button",
|
|
10632
10632
|
variant: "outline",
|
|
10633
10633
|
onClick: () => {
|
|
10634
|
-
|
|
10634
|
+
se > 0 ? k((E) => E - 1) : a == null || a();
|
|
10635
10635
|
},
|
|
10636
10636
|
disabled: g,
|
|
10637
|
-
children:
|
|
10637
|
+
children: se > 0 ? r("common.previous") : r("common.cancel")
|
|
10638
10638
|
}
|
|
10639
10639
|
),
|
|
10640
10640
|
/* @__PURE__ */ l("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
10641
10641
|
!Q && /* @__PURE__ */ i(
|
|
10642
|
-
|
|
10642
|
+
le,
|
|
10643
10643
|
{
|
|
10644
10644
|
type: "button",
|
|
10645
10645
|
onClick: () => k((E) => E + 1),
|
|
10646
10646
|
children: r("common.next")
|
|
10647
10647
|
}
|
|
10648
10648
|
),
|
|
10649
|
-
(Q ||
|
|
10650
|
-
|
|
10649
|
+
(Q || re) && /* @__PURE__ */ i(
|
|
10650
|
+
le,
|
|
10651
10651
|
{
|
|
10652
10652
|
type: "button",
|
|
10653
10653
|
isLoading: g,
|
|
10654
|
-
onClick: () =>
|
|
10655
|
-
disabled: !
|
|
10656
|
-
style: { opacity:
|
|
10654
|
+
onClick: () => ee(),
|
|
10655
|
+
disabled: !re && !F,
|
|
10656
|
+
style: { opacity: re || F ? 1 : 0.5 },
|
|
10657
10657
|
children: r(F ? "appropriatenessTest.submitting" : "appropriatenessTest.submitTest")
|
|
10658
10658
|
}
|
|
10659
10659
|
)
|
|
@@ -10792,7 +10792,7 @@ const Ua = ({
|
|
|
10792
10792
|
onBack: a
|
|
10793
10793
|
}) => {
|
|
10794
10794
|
var gt, b, V, P;
|
|
10795
|
-
const { t: r } = Ie(), { applicantService: n, baseInformationService: o, identityService: s, config: c, currentTheme: u } =
|
|
10795
|
+
const { t: r } = Ie(), { applicantService: n, baseInformationService: o, identityService: s, config: c, currentTheme: u } = Te(), { identityData: g, provider: y, token: f, isLoading: D, error: T, requestIdentity: S, restartIdentity: O } = da(e), [C, K] = N(null), [W, F] = N(null), [M, q] = N([]), [G, se] = N([]), [k, L] = N(!0), [j, X] = N(!1), [te, $] = N(null), [ee, pe] = N(!1), me = he.useRef(!1), [Re, ce] = N("idle"), Y = ge(!1), Q = ge(null), [re, A] = N({}), [E, H] = N({}), ye = u != null && u.reviewPageFields && u.reviewPageFields.length > 0 ? u.reviewPageFields[0] : null, fe = !!(u != null && u.reviewPageDisabled), U = ge(!1);
|
|
10796
10796
|
U.current = fe;
|
|
10797
10797
|
const J = Vi({
|
|
10798
10798
|
defaultValues: {
|
|
@@ -10822,7 +10822,7 @@ const Ua = ({
|
|
|
10822
10822
|
const B = /* @__PURE__ */ new Set(), d = z.map((w) => ({ value: w.abbreviation3 || w.abbreviation, label: w.name })).filter((w) => !w.value || B.has(w.value) ? !1 : (B.add(w.value), !0));
|
|
10823
10823
|
q(d);
|
|
10824
10824
|
const I = /* @__PURE__ */ new Set(), x = R.filter((w) => w.countryCode).map((w) => ({ value: w.countryCode, label: `${w.countryCode} – ${w.name}` })).filter((w) => I.has(w.value) ? !1 : (I.add(w.value), !0));
|
|
10825
|
-
|
|
10825
|
+
se(x);
|
|
10826
10826
|
const m = h.applicantRequestData;
|
|
10827
10827
|
if (A({
|
|
10828
10828
|
firstName: (m == null ? void 0 : m.firstName) || "",
|
|
@@ -10895,7 +10895,7 @@ const Ua = ({
|
|
|
10895
10895
|
}
|
|
10896
10896
|
}
|
|
10897
10897
|
}, [f]);
|
|
10898
|
-
const ke = 5e3,
|
|
10898
|
+
const ke = 5e3, Ne = 600 * 1e3, Se = Z(() => {
|
|
10899
10899
|
Y.current || (Y.current = !0, Q.current && (clearInterval(Q.current), Q.current = null), t == null || t());
|
|
10900
10900
|
}, [t]);
|
|
10901
10901
|
ve(() => {
|
|
@@ -10907,23 +10907,21 @@ const Ua = ({
|
|
|
10907
10907
|
const R = await n.getProgress(e);
|
|
10908
10908
|
if (Y.current) return;
|
|
10909
10909
|
const B = (z = R.currentStep) == null ? void 0 : z.action, d = R.status;
|
|
10910
|
-
if (B !== void 0 && B !==
|
|
10911
|
-
console.log("[Identity Polling] Step changed — advancing"),
|
|
10910
|
+
if (B !== void 0 && B !== ae.IdentitySdk) {
|
|
10911
|
+
console.log("[Identity Polling] Step changed — advancing"), Se();
|
|
10912
10912
|
return;
|
|
10913
10913
|
}
|
|
10914
|
-
if (d ===
|
|
10915
|
-
console.log("[Identity Polling] Status finished — advancing"),
|
|
10914
|
+
if (d === qe.Finished) {
|
|
10915
|
+
console.log("[Identity Polling] Status finished — advancing"), Se();
|
|
10916
10916
|
return;
|
|
10917
10917
|
}
|
|
10918
|
-
if (d ===
|
|
10919
|
-
console.log("[Identity Polling] Identity pending — showing processing UI"), ae("pending");
|
|
10918
|
+
if (d === qe.IdentityPending)
|
|
10920
10919
|
return;
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
console.log("[Identity Polling] On hold — showing review UI"), ae("onhold");
|
|
10920
|
+
if (d === qe.OnHold) {
|
|
10921
|
+
console.log("[Identity Polling] On hold — keep polling");
|
|
10924
10922
|
return;
|
|
10925
10923
|
}
|
|
10926
|
-
Date.now() - p >
|
|
10924
|
+
Date.now() - p > Ne && (console.log("[Identity Polling] Max poll duration reached — stopping"), Q.current && (clearInterval(Q.current), Q.current = null));
|
|
10927
10925
|
} catch (R) {
|
|
10928
10926
|
console.warn("[Identity Polling] Error:", R);
|
|
10929
10927
|
}
|
|
@@ -10931,10 +10929,10 @@ const Ua = ({
|
|
|
10931
10929
|
return Q.current = setInterval(h, ke), () => {
|
|
10932
10930
|
Q.current && (clearInterval(Q.current), Q.current = null);
|
|
10933
10931
|
};
|
|
10934
|
-
}, [j, e, n,
|
|
10932
|
+
}, [j, e, n, Se]);
|
|
10935
10933
|
const _e = y !== null && y === Ge.Sumsub;
|
|
10936
10934
|
ve(() => {
|
|
10937
|
-
if (y !== null && f && !C && j && !
|
|
10935
|
+
if (y !== null && f && !C && j && !ee) {
|
|
10938
10936
|
const p = y;
|
|
10939
10937
|
if (_e) {
|
|
10940
10938
|
console.log("[Sumsub] Fetching access token for Web SDK…"), $(null), (async () => {
|
|
@@ -10943,7 +10941,7 @@ const Ua = ({
|
|
|
10943
10941
|
z.accessToken = h, z.onTokenRefresh = () => s.refreshSumsubToken(e);
|
|
10944
10942
|
const R = ct.createProvider(y, z);
|
|
10945
10943
|
R.onComplete((B) => {
|
|
10946
|
-
console.log("[Sumsub] Verification complete:", B),
|
|
10944
|
+
console.log("[Sumsub] Verification complete:", B), ce("processing"), setTimeout(() => Se(), 3e3);
|
|
10947
10945
|
}), R.onError((B) => {
|
|
10948
10946
|
console.error("[Sumsub] SDK error:", B), (typeof B == "string" ? B : (B == null ? void 0 : B.message) || "Unknown error").toLowerCase().includes("expired") && (pe(!0), $(r("identity.sessionExpiredRestart")));
|
|
10949
10947
|
}), await R.initialize("sumsub-websdk-container"), console.log("[Sumsub] Web SDK launched"), K(R);
|
|
@@ -10976,7 +10974,7 @@ const Ua = ({
|
|
|
10976
10974
|
try {
|
|
10977
10975
|
const h = ct.parseProviderConfig(y, f, c), z = ct.createProvider(y, h);
|
|
10978
10976
|
z.initialize().then(() => {
|
|
10979
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), K(z),
|
|
10977
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), K(z), ce("processing"), setTimeout(() => Se(), 3e3);
|
|
10980
10978
|
}).catch((R) => {
|
|
10981
10979
|
var d;
|
|
10982
10980
|
console.error("[SardinAI] Failed to initialize:", R);
|
|
@@ -11006,7 +11004,7 @@ const Ua = ({
|
|
|
11006
11004
|
console.error("[Identity] Error destroying provider:", p);
|
|
11007
11005
|
}
|
|
11008
11006
|
};
|
|
11009
|
-
}, [y, f, C, j, t,
|
|
11007
|
+
}, [y, f, C, j, t, ee, _e, e, c, s, Se]);
|
|
11010
11008
|
const st = async () => {
|
|
11011
11009
|
try {
|
|
11012
11010
|
$(null), pe(!1), await S(), X(!0);
|
|
@@ -11034,20 +11032,20 @@ const Ua = ({
|
|
|
11034
11032
|
}
|
|
11035
11033
|
};
|
|
11036
11034
|
if (k || D)
|
|
11037
|
-
return /* @__PURE__ */ i(
|
|
11038
|
-
/* @__PURE__ */ i(
|
|
11035
|
+
return /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
11036
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
11039
11037
|
/* @__PURE__ */ i("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: r("identity.loadingIdentity") })
|
|
11040
11038
|
] }) });
|
|
11041
11039
|
if (T)
|
|
11042
|
-
return /* @__PURE__ */ i(
|
|
11040
|
+
return /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("p", { className: "text-danger-500", children: [
|
|
11043
11041
|
"Error: ",
|
|
11044
11042
|
T.message
|
|
11045
11043
|
] }) }) });
|
|
11046
11044
|
const He = fe ? a : () => X(!1);
|
|
11047
|
-
if (j && (
|
|
11048
|
-
return /* @__PURE__ */ l(
|
|
11045
|
+
if (j && (te || ee))
|
|
11046
|
+
return /* @__PURE__ */ l(ne, { children: [
|
|
11049
11047
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: r("identity.sessionIssueTitle") }) }),
|
|
11050
|
-
/* @__PURE__ */ l(
|
|
11048
|
+
/* @__PURE__ */ l(oe, { children: [
|
|
11051
11049
|
/* @__PURE__ */ i("div", { className: "p-4 rounded-lg mb-6", style: {
|
|
11052
11050
|
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
11053
11051
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
@@ -11072,8 +11070,8 @@ const Ua = ({
|
|
|
11072
11070
|
}
|
|
11073
11071
|
),
|
|
11074
11072
|
/* @__PURE__ */ l("div", { children: [
|
|
11075
|
-
/* @__PURE__ */ i("h3", { className: "font-semibold mb-1", style: { color: "var(--metakyc-danger, #ef4444)" }, children: r(
|
|
11076
|
-
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children:
|
|
11073
|
+
/* @__PURE__ */ i("h3", { className: "font-semibold mb-1", style: { color: "var(--metakyc-danger, #ef4444)" }, children: r(ee ? "identity.sessionExpiredTitle" : "identity.verificationError") }),
|
|
11074
|
+
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: te || r("identity.sessionExpiredMessage") })
|
|
11077
11075
|
] })
|
|
11078
11076
|
] }) }),
|
|
11079
11077
|
/* @__PURE__ */ l("div", { className: "rounded-lg p-4", style: {
|
|
@@ -11089,40 +11087,16 @@ const Ua = ({
|
|
|
11089
11087
|
] })
|
|
11090
11088
|
] }),
|
|
11091
11089
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
11092
|
-
He && /* @__PURE__ */ i(
|
|
11093
|
-
/* @__PURE__ */ i(
|
|
11090
|
+
He && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: He, children: r("common.back") }),
|
|
11091
|
+
/* @__PURE__ */ i(le, { type: "button", onClick: Qe, disabled: D, children: r(D ? "identity.restarting" : "identity.restartVerification") })
|
|
11094
11092
|
] })
|
|
11095
11093
|
] });
|
|
11096
|
-
if (j &&
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
] }) }) });
|
|
11103
|
-
if (xe === "pending")
|
|
11104
|
-
return /* @__PURE__ */ i(ee, { children: /* @__PURE__ */ i(te, { children: /* @__PURE__ */ l("div", { className: "text-center py-12", children: [
|
|
11105
|
-
/* @__PURE__ */ i("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ i("svg", { className: "h-12 w-12", style: { color: "var(--metakyc-warning, #f59e0b)" }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ i("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }),
|
|
11106
|
-
/* @__PURE__ */ i("h3", { className: "text-lg font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: r("identity.verificationPending") }),
|
|
11107
|
-
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("identity.pendingSubtitle") }),
|
|
11108
|
-
/* @__PURE__ */ l("div", { className: "mt-6", children: [
|
|
11109
|
-
/* @__PURE__ */ i(Fe, { className: "mb-2" }),
|
|
11110
|
-
/* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("identity.autoAdvance") })
|
|
11111
|
-
] })
|
|
11112
|
-
] }) }) });
|
|
11113
|
-
if (xe === "onhold")
|
|
11114
|
-
return /* @__PURE__ */ i(ee, { children: /* @__PURE__ */ i(te, { children: /* @__PURE__ */ l("div", { className: "text-center py-12", children: [
|
|
11115
|
-
/* @__PURE__ */ i("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ i("svg", { className: "h-12 w-12", style: { color: "var(--metakyc-primary, #2563eb)" }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ i("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" }) }) }),
|
|
11116
|
-
/* @__PURE__ */ i("h3", { className: "text-lg font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: r("identity.verificationOnHold") }),
|
|
11117
|
-
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("identity.onHoldSubtitle") })
|
|
11118
|
-
] }) }) });
|
|
11119
|
-
if (xe === "timeout")
|
|
11120
|
-
return /* @__PURE__ */ i(ee, { children: /* @__PURE__ */ i(te, { children: /* @__PURE__ */ l("div", { className: "text-center py-12", children: [
|
|
11121
|
-
/* @__PURE__ */ i("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ i("svg", { className: "h-12 w-12", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ i("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }),
|
|
11122
|
-
/* @__PURE__ */ i("h3", { className: "text-lg font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: r("identity.verificationTimeout") }),
|
|
11123
|
-
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("identity.timeoutSubtitle") })
|
|
11124
|
-
] }) }) });
|
|
11125
|
-
}
|
|
11094
|
+
if (j && Re === "processing")
|
|
11095
|
+
return /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { className: "text-center py-12", children: [
|
|
11096
|
+
/* @__PURE__ */ i(Ke, { className: "mb-4" }),
|
|
11097
|
+
/* @__PURE__ */ i("h3", { className: "text-lg font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: r("identity.verificationProcessing") }),
|
|
11098
|
+
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("identity.processingSubtitle") })
|
|
11099
|
+
] }) }) });
|
|
11126
11100
|
if (j && g) {
|
|
11127
11101
|
const p = y;
|
|
11128
11102
|
return _e ? /* @__PURE__ */ l("div", { style: {
|
|
@@ -11187,13 +11161,13 @@ const Ua = ({
|
|
|
11187
11161
|
He && /* @__PURE__ */ i("div", { style: {
|
|
11188
11162
|
padding: "16px 24px",
|
|
11189
11163
|
borderTop: "1px solid var(--metakyc-border, #e5e7eb)"
|
|
11190
|
-
}, children: /* @__PURE__ */ i(
|
|
11191
|
-
] }) : f != null && f.url ? /* @__PURE__ */ l(
|
|
11164
|
+
}, children: /* @__PURE__ */ i(le, { variant: "outline", onClick: He, children: r("common.back") }) })
|
|
11165
|
+
] }) : f != null && f.url ? /* @__PURE__ */ l(ne, { children: [
|
|
11192
11166
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ l("div", { children: [
|
|
11193
11167
|
/* @__PURE__ */ i("h2", { className: "text-2xl font-bold", children: r("identity.title") }),
|
|
11194
11168
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: r("identity.subtitle") })
|
|
11195
11169
|
] }) }) }),
|
|
11196
|
-
/* @__PURE__ */ l(
|
|
11170
|
+
/* @__PURE__ */ l(oe, { children: [
|
|
11197
11171
|
/* @__PURE__ */ i("div", { className: "mb-4 p-3 rounded-lg", style: {
|
|
11198
11172
|
backgroundColor: "var(--metakyc-warning-bg, color-mix(in srgb, var(--metakyc-warning, #f59e0b) 10%, transparent))",
|
|
11199
11173
|
border: "1px solid color-mix(in srgb, var(--metakyc-warning, #f59e0b) 30%, transparent)"
|
|
@@ -11221,24 +11195,24 @@ const Ua = ({
|
|
|
11221
11195
|
}
|
|
11222
11196
|
) })
|
|
11223
11197
|
] }),
|
|
11224
|
-
He && /* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ i(
|
|
11225
|
-
] }) : p === Ge.SardinAI ? /* @__PURE__ */ l(
|
|
11198
|
+
He && /* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ i(le, { variant: "outline", onClick: He, children: r("common.back") }) })
|
|
11199
|
+
] }) : p === Ge.SardinAI ? /* @__PURE__ */ l(ne, { children: [
|
|
11226
11200
|
/* @__PURE__ */ l(Le, { children: [
|
|
11227
11201
|
/* @__PURE__ */ i("h2", { className: "text-2xl font-bold", children: r("identity.deviceRiskAssessment") }),
|
|
11228
11202
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: r("identity.analyzingDevice") })
|
|
11229
11203
|
] }),
|
|
11230
|
-
/* @__PURE__ */ i(
|
|
11231
|
-
/* @__PURE__ */ i(
|
|
11204
|
+
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { className: "text-center py-12", children: [
|
|
11205
|
+
/* @__PURE__ */ i(Ke, { className: "mb-4" }),
|
|
11232
11206
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400", children: r("identity.pleaseWaitDevice") }),
|
|
11233
11207
|
/* @__PURE__ */ i("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: r("identity.automaticProcess") })
|
|
11234
11208
|
] }) })
|
|
11235
|
-
] }) : /* @__PURE__ */ l(
|
|
11209
|
+
] }) : /* @__PURE__ */ l(ne, { children: [
|
|
11236
11210
|
/* @__PURE__ */ l(Le, { children: [
|
|
11237
11211
|
/* @__PURE__ */ i("h2", { className: "text-2xl font-bold", children: r("identity.title") }),
|
|
11238
11212
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: r("identity.subtitle") })
|
|
11239
11213
|
] }),
|
|
11240
|
-
/* @__PURE__ */ i(
|
|
11241
|
-
He && /* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ i(
|
|
11214
|
+
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
11215
|
+
He && /* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ i(le, { variant: "outline", onClick: He, children: r("common.back") }) })
|
|
11242
11216
|
] });
|
|
11243
11217
|
}
|
|
11244
11218
|
const et = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), De = (p = 4) => {
|
|
@@ -11380,7 +11354,7 @@ const Ua = ({
|
|
|
11380
11354
|
rel: "noopener noreferrer",
|
|
11381
11355
|
className: "text-sm underline",
|
|
11382
11356
|
style: { color: "var(--metakyc-primary, #6366f1)" },
|
|
11383
|
-
children:
|
|
11357
|
+
children: ie(p.displayText, r) || ie(p.label, r) || p.linkText || p.linkUrl
|
|
11384
11358
|
}
|
|
11385
11359
|
),
|
|
11386
11360
|
p.helpText
|
|
@@ -11398,9 +11372,9 @@ const Ua = ({
|
|
|
11398
11372
|
}
|
|
11399
11373
|
),
|
|
11400
11374
|
/* @__PURE__ */ i("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: p.customType === "link_checkbox" && p.linkUrl ? /* @__PURE__ */ l(bt, { children: [
|
|
11401
|
-
/* @__PURE__ */ i("a", { href: p.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: p.linkText ||
|
|
11402
|
-
p.label && p.linkText ? ` ${
|
|
11403
|
-
] }) :
|
|
11375
|
+
/* @__PURE__ */ i("a", { href: p.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: p.linkText || ie(p.label, r) }),
|
|
11376
|
+
p.label && p.linkText ? ` ${ie(p.label, r)}` : ""
|
|
11377
|
+
] }) : ie(p.displayText, r) || ie(p.label, r) })
|
|
11404
11378
|
] }),
|
|
11405
11379
|
p.helpText
|
|
11406
11380
|
) }, z);
|
|
@@ -11414,7 +11388,7 @@ const Ua = ({
|
|
|
11414
11388
|
};
|
|
11415
11389
|
return /* @__PURE__ */ i("div", { style: De(p.colSpan), children: Pe(
|
|
11416
11390
|
/* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
11417
|
-
p.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
11391
|
+
p.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: ie(p.displayText, r) || ie(p.label, r) }),
|
|
11418
11392
|
(p.options || []).map((x) => /* @__PURE__ */ l("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
11419
11393
|
/* @__PURE__ */ i(
|
|
11420
11394
|
Xe,
|
|
@@ -11432,7 +11406,7 @@ const Ua = ({
|
|
|
11432
11406
|
}
|
|
11433
11407
|
return p.customType === "radio_group" ? /* @__PURE__ */ i("div", { style: De(p.colSpan), children: Pe(
|
|
11434
11408
|
/* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
11435
|
-
p.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
11409
|
+
p.label && /* @__PURE__ */ i("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: ie(p.displayText, r) || ie(p.label, r) }),
|
|
11436
11410
|
(p.options || []).map((d) => /* @__PURE__ */ l("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
11437
11411
|
/* @__PURE__ */ i(
|
|
11438
11412
|
"input",
|
|
@@ -11451,9 +11425,9 @@ const Ua = ({
|
|
|
11451
11425
|
p.helpText
|
|
11452
11426
|
) }, z) : /* @__PURE__ */ i("div", { style: De(p.colSpan), children: Pe(
|
|
11453
11427
|
/* @__PURE__ */ i(
|
|
11454
|
-
|
|
11428
|
+
Ce,
|
|
11455
11429
|
{
|
|
11456
|
-
label:
|
|
11430
|
+
label: ie(p.displayText, r) || ie(p.label, r) || R,
|
|
11457
11431
|
value: String(B ?? ""),
|
|
11458
11432
|
onChange: (d) => H((I) => ({ ...I, [R]: d.target.value }))
|
|
11459
11433
|
}
|
|
@@ -11462,7 +11436,7 @@ const Ua = ({
|
|
|
11462
11436
|
) }, z);
|
|
11463
11437
|
}, pt = (p, h) => {
|
|
11464
11438
|
if (p.isCustom) return xt(p, h);
|
|
11465
|
-
const z = p.name ?? "", R = dt[z], B =
|
|
11439
|
+
const z = p.name ?? "", R = dt[z], B = ie(p.displayText, r) || (R != null && R.translationKey ? r(`fields.${R.translationKey}`) : void 0) || (R == null ? void 0 : R.label) || z, d = re[z] ?? "", I = z === "mobileCountryCode", x = !!(R != null && R.countriesType) && !I;
|
|
11466
11440
|
return p.editable ? I ? /* @__PURE__ */ i("div", { style: De(p.colSpan ?? 2), children: Pe(
|
|
11467
11441
|
/* @__PURE__ */ i(
|
|
11468
11442
|
nt,
|
|
@@ -11487,7 +11461,7 @@ const Ua = ({
|
|
|
11487
11461
|
p.helpText
|
|
11488
11462
|
) }, `ec-${h}`) : /* @__PURE__ */ i("div", { style: De(p.colSpan ?? 2), children: Pe(
|
|
11489
11463
|
/* @__PURE__ */ i(
|
|
11490
|
-
|
|
11464
|
+
Ce,
|
|
11491
11465
|
{
|
|
11492
11466
|
label: B,
|
|
11493
11467
|
type: (R == null ? void 0 : R.type) === "date" ? "date" : (R == null ? void 0 : R.type) === "email" ? "email" : "text",
|
|
@@ -11505,27 +11479,27 @@ const Ua = ({
|
|
|
11505
11479
|
) }, `ro-${h}`);
|
|
11506
11480
|
};
|
|
11507
11481
|
if (ye) {
|
|
11508
|
-
const p =
|
|
11482
|
+
const p = ie(ye.title, r) || r("identity.reviewYourInformation"), h = ie(ye.subtitle, r) || r("identity.reviewSubtitle");
|
|
11509
11483
|
return /* @__PURE__ */ i("form", { onSubmit: (z) => {
|
|
11510
11484
|
z.preventDefault(), st();
|
|
11511
|
-
}, children: /* @__PURE__ */ l(
|
|
11485
|
+
}, children: /* @__PURE__ */ l(ne, { children: [
|
|
11512
11486
|
/* @__PURE__ */ l(Le, { children: [
|
|
11513
11487
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: p }),
|
|
11514
11488
|
h && /* @__PURE__ */ i("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: h })
|
|
11515
11489
|
] }),
|
|
11516
|
-
/* @__PURE__ */ i(
|
|
11490
|
+
/* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: ye.fields.map((z, R) => pt(z, R)) }) }),
|
|
11517
11491
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
11518
|
-
a && /* @__PURE__ */ i(
|
|
11519
|
-
/* @__PURE__ */ i(
|
|
11492
|
+
a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
11493
|
+
/* @__PURE__ */ i(le, { type: "submit", isLoading: D, children: r("identity.confirmAndStart") })
|
|
11520
11494
|
] })
|
|
11521
11495
|
] }) });
|
|
11522
11496
|
}
|
|
11523
|
-
return /* @__PURE__ */ i("form", { onSubmit: J.handleSubmit(st), children: /* @__PURE__ */ l(
|
|
11497
|
+
return /* @__PURE__ */ i("form", { onSubmit: J.handleSubmit(st), children: /* @__PURE__ */ l(ne, { children: [
|
|
11524
11498
|
/* @__PURE__ */ l(Le, { children: [
|
|
11525
11499
|
/* @__PURE__ */ i("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: r("identity.reviewYourInformation") }),
|
|
11526
11500
|
/* @__PURE__ */ i("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r("identity.reviewSubtitle") })
|
|
11527
11501
|
] }),
|
|
11528
|
-
/* @__PURE__ */ l(
|
|
11502
|
+
/* @__PURE__ */ l(oe, { className: "space-y-6", children: [
|
|
11529
11503
|
/* @__PURE__ */ i("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
11530
11504
|
{ label: r("fields.name"), value: `${((gt = W == null ? void 0 : W.applicantRequestData) == null ? void 0 : gt.firstName) || ""} ${((b = W == null ? void 0 : W.applicantRequestData) == null ? void 0 : b.lastName) || ""}`.trim() },
|
|
11531
11505
|
{ label: r("fields.email"), value: (V = W == null ? void 0 : W.applicantRequestData) == null ? void 0 : V.email },
|
|
@@ -11571,19 +11545,19 @@ const Ua = ({
|
|
|
11571
11545
|
)
|
|
11572
11546
|
] }),
|
|
11573
11547
|
/* @__PURE__ */ l("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
11574
|
-
/* @__PURE__ */ i(yt, { control: J.control, name: "street", render: ({ field: p }) => /* @__PURE__ */ i(
|
|
11575
|
-
/* @__PURE__ */ i(yt, { control: J.control, name: "streetNumber", render: ({ field: p }) => /* @__PURE__ */ i(
|
|
11548
|
+
/* @__PURE__ */ i(yt, { control: J.control, name: "street", render: ({ field: p }) => /* @__PURE__ */ i(Ce, { ...p, label: r("fields.street") }) }),
|
|
11549
|
+
/* @__PURE__ */ i(yt, { control: J.control, name: "streetNumber", render: ({ field: p }) => /* @__PURE__ */ i(Ce, { ...p, label: r("fields.streetNumber") }) })
|
|
11576
11550
|
] }),
|
|
11577
11551
|
/* @__PURE__ */ l("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
11578
|
-
/* @__PURE__ */ i(yt, { control: J.control, name: "city", render: ({ field: p }) => /* @__PURE__ */ i(
|
|
11579
|
-
/* @__PURE__ */ i(yt, { control: J.control, name: "zip", render: ({ field: p }) => /* @__PURE__ */ i(
|
|
11552
|
+
/* @__PURE__ */ i(yt, { control: J.control, name: "city", render: ({ field: p }) => /* @__PURE__ */ i(Ce, { ...p, label: r("fields.city") }) }),
|
|
11553
|
+
/* @__PURE__ */ i(yt, { control: J.control, name: "zip", render: ({ field: p }) => /* @__PURE__ */ i(Ce, { ...p, label: r("fields.zip") }) })
|
|
11580
11554
|
] }),
|
|
11581
|
-
/* @__PURE__ */ i(yt, { control: J.control, name: "phonenumber", render: ({ field: p }) => /* @__PURE__ */ i(
|
|
11555
|
+
/* @__PURE__ */ i(yt, { control: J.control, name: "phonenumber", render: ({ field: p }) => /* @__PURE__ */ i(Ce, { ...p, label: r("fields.phoneNumber"), type: "tel" }) })
|
|
11582
11556
|
] })
|
|
11583
11557
|
] }),
|
|
11584
11558
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
11585
|
-
a && /* @__PURE__ */ i(
|
|
11586
|
-
/* @__PURE__ */ i(
|
|
11559
|
+
a && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: a, children: r("common.back") }),
|
|
11560
|
+
/* @__PURE__ */ i(le, { type: "submit", isLoading: D, children: r("identity.confirmAndStart") })
|
|
11587
11561
|
] })
|
|
11588
11562
|
] }) });
|
|
11589
11563
|
}, Xt = {
|
|
@@ -11617,8 +11591,8 @@ const yi = ({
|
|
|
11617
11591
|
onContactSupport: o
|
|
11618
11592
|
}) => {
|
|
11619
11593
|
const { t: s } = Ie(), u = t === Je.Approved ? { type: "success", title: s("status.applicationApproved"), icon: "✓", message: s("status.applicationApprovedMsg") } : t === Je.Reject ? { type: "error", title: s("status.applicationRejected"), icon: "✕", message: s("status.applicationRejectedMsg") } : t === Je.UnderReview ? { type: "pending", title: s("status.underReview"), icon: "📋", message: s("status.underReviewMsg") } : t === Je.AdminReview ? { type: "pending", title: s("status.adminReviewRequired"), icon: "📋", message: s("status.adminReviewRequiredMsg") } : t === Je.Closed ? { type: "error", title: s("status.applicationRejected"), icon: "✕", message: s("status.applicationRejectedMsg") } : t === Je.InProgress ? { type: "pending", title: s("status.verificationPending"), icon: "⏱", message: s("status.verificationPendingMsg") } : t === Je.New ? { type: "pending", title: s("status.processing"), icon: "⏱", message: s("status.processingMsg") } : a === Lt.Success ? { type: "success", title: s("status.processComplete"), icon: "✓", message: s("status.processCompleteMsg") } : a === Lt.Failed ? { type: "error", title: s("status.processFailed"), icon: "✕", message: s("status.processFailedMsg") } : a === Lt.AdminReview ? { type: "pending", title: s("status.adminReviewRequired"), icon: "📋", message: s("status.adminReviewRequiredMsg") } : { type: "pending", title: s("status.processing"), icon: "⏱", message: s("status.processingMsg") };
|
|
11620
|
-
return /* @__PURE__ */ l(
|
|
11621
|
-
/* @__PURE__ */ l(
|
|
11594
|
+
return /* @__PURE__ */ l(ne, { children: [
|
|
11595
|
+
/* @__PURE__ */ l(oe, { className: "py-12", children: [
|
|
11622
11596
|
/* @__PURE__ */ i("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ i(
|
|
11623
11597
|
"div",
|
|
11624
11598
|
{
|
|
@@ -11699,10 +11673,10 @@ const yi = ({
|
|
|
11699
11673
|
] }) })
|
|
11700
11674
|
] }),
|
|
11701
11675
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "center", gap: "1rem" }, children: [
|
|
11702
|
-
u.type === "success" && n && /* @__PURE__ */ i(
|
|
11676
|
+
u.type === "success" && n && /* @__PURE__ */ i(le, { onClick: n, size: "lg", children: s("common.continue") }),
|
|
11703
11677
|
u.type === "error" && /* @__PURE__ */ l(bt, { children: [
|
|
11704
|
-
o && /* @__PURE__ */ i(
|
|
11705
|
-
n && /* @__PURE__ */ i(
|
|
11678
|
+
o && /* @__PURE__ */ i(le, { variant: "outline", onClick: o, children: s("status.contactSupport") }),
|
|
11679
|
+
n && /* @__PURE__ */ i(le, { onClick: n, children: s("status.tryAgain") })
|
|
11706
11680
|
] }),
|
|
11707
11681
|
u.type === "pending" && /* @__PURE__ */ i("div", { className: "text-center", children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: s("status.checkBackLater") }) })
|
|
11708
11682
|
] })
|
|
@@ -11730,7 +11704,7 @@ const yi = ({
|
|
|
11730
11704
|
subtitle: t,
|
|
11731
11705
|
className: a = ""
|
|
11732
11706
|
}) => {
|
|
11733
|
-
const { currentTheme: r } =
|
|
11707
|
+
const { currentTheme: r } = Te(), { t: n } = Ie(), o = e || (r == null ? void 0 : r.title) || "", s = ie(o, n), c = ie(t, n), u = !!(r != null && r.logo && r.logo.visible && r.logo.url), g = !!s;
|
|
11734
11708
|
return !u && !g ? null : /* @__PURE__ */ l("div", { className: `metakyc-header ${a}`, children: [
|
|
11735
11709
|
/* @__PURE__ */ l(
|
|
11736
11710
|
"div",
|
|
@@ -11767,7 +11741,7 @@ const _a = ({ children: e }) => {
|
|
|
11767
11741
|
const D = { ...f, ...y };
|
|
11768
11742
|
return Object.keys(y).some((S) => f[S] !== y[S]) ? D : f;
|
|
11769
11743
|
});
|
|
11770
|
-
}, []), g =
|
|
11744
|
+
}, []), g = Ue(
|
|
11771
11745
|
() => ({ actions: t, registerAction: s, unregisterAction: c, sdkState: r, updateSdkState: u }),
|
|
11772
11746
|
[t, s, c, r, u]
|
|
11773
11747
|
);
|
|
@@ -11897,7 +11871,7 @@ const _a = ({ children: e }) => {
|
|
|
11897
11871
|
/* @__PURE__ */ i("span", { style: { color: "#89b4fa", flexShrink: 0 }, children: L }),
|
|
11898
11872
|
/* @__PURE__ */ i("span", { style: { color: "#a6adc8", textAlign: "right", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: j == null ? /* @__PURE__ */ i("span", { style: { color: "#6c7086", fontStyle: "italic" }, children: "null" }) : typeof j == "object" ? JSON.stringify(j) : String(j) })
|
|
11899
11873
|
] }, L)) });
|
|
11900
|
-
},
|
|
11874
|
+
}, se = /* @__PURE__ */ l(bt, { children: [
|
|
11901
11875
|
t && /* @__PURE__ */ l("div", { ref: c, style: O, children: [
|
|
11902
11876
|
/* @__PURE__ */ l("div", { style: { padding: "12px 14px 8px", display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
11903
11877
|
/* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
@@ -11965,7 +11939,7 @@ const _a = ({ children: e }) => {
|
|
|
11965
11939
|
}
|
|
11966
11940
|
)
|
|
11967
11941
|
] });
|
|
11968
|
-
return typeof document > "u" ? null : Mt(
|
|
11942
|
+
return typeof document > "u" ? null : Mt(se, document.body);
|
|
11969
11943
|
}, Qa = ["James", "Emma", "Alexander", "Sophia", "Michael", "Olivia", "Daniel", "Isabella", "Lukas", "Anna"], Xa = ["Anderson", "Mueller", "Johnson", "Williams", "Brown", "Schmidt", "Garcia", "Chen", "Huber", "Wagner"], Za = ["Acme Corp", "Global Holdings Ltd", "TechVentures AG", "Alpine Solutions GmbH", "Meridian Capital LLC", "Nordic Innovations AS"], Dt = ["Vienna", "Zurich", "Munich", "Berlin", "London", "Amsterdam", "Paris", "Milan"], Pt = ["AUT", "CHE", "DEU", "GBR", "NLD", "FRA", "ITA"], Yt = ["Main Street", "Oak Avenue", "Elm Road", "Park Lane", "Lake Boulevard", "Ringstrasse", "Bahnhofstrasse"], Ja = ["Software Engineer", "Financial Analyst", "Doctor", "Teacher", "Lawyer", "Architect", "Accountant"];
|
|
11970
11944
|
function Ae(e) {
|
|
11971
11945
|
return e[Math.floor(Math.random() * e.length)];
|
|
@@ -12168,15 +12142,15 @@ const rn = {
|
|
|
12168
12142
|
onCancel: n
|
|
12169
12143
|
}) => {
|
|
12170
12144
|
var V, P, p, h, z, R, B;
|
|
12171
|
-
const { config: o, baseInformationService: s, currentTheme: c } =
|
|
12145
|
+
const { config: o, baseInformationService: s, currentTheme: c } = Te(), { createApplicant: u, getApplicantData: g, isLoading: y } = Ri(), { t: f } = Ie(), D = e || ((V = o.applicantForm) == null ? void 0 : V.workflowKey);
|
|
12172
12146
|
if (!D)
|
|
12173
12147
|
throw new Error(
|
|
12174
12148
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
12175
12149
|
);
|
|
12176
|
-
const T = t || ((P = o.applicantForm) == null ? void 0 : P.externalRefId) || "", S = ((p = o.applicantForm) == null ? void 0 : p.email) || "", O = ((h = o.applicantForm) == null ? void 0 : h.hiddenValues) || {}, C = ((z = o.applicantForm) == null ? void 0 : z.initialValues) || {}, W = (((R = o.applicantForm) == null ? void 0 : R.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", F =
|
|
12150
|
+
const T = t || ((P = o.applicantForm) == null ? void 0 : P.externalRefId) || "", S = ((p = o.applicantForm) == null ? void 0 : p.email) || "", O = ((h = o.applicantForm) == null ? void 0 : h.hiddenValues) || {}, C = ((z = o.applicantForm) == null ? void 0 : z.initialValues) || {}, W = (((R = o.applicantForm) == null ? void 0 : R.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", F = Ue(
|
|
12177
12151
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
12178
12152
|
[c == null ? void 0 : c.applicantFormPages]
|
|
12179
|
-
), M =
|
|
12153
|
+
), M = Ue(() => {
|
|
12180
12154
|
const d = new Set(zt), I = c == null ? void 0 : c.applicantFormRequiredFields;
|
|
12181
12155
|
if (I) for (const x of I) d.add(x);
|
|
12182
12156
|
if (F)
|
|
@@ -12184,7 +12158,7 @@ const rn = {
|
|
|
12184
12158
|
for (const m of x.fields)
|
|
12185
12159
|
!m.isCustom && m.name && m.required && d.add(m.name);
|
|
12186
12160
|
return Array.from(d);
|
|
12187
|
-
}, [c == null ? void 0 : c.applicantFormRequiredFields, F]), q =
|
|
12161
|
+
}, [c == null ? void 0 : c.applicantFormRequiredFields, F]), q = Ue(() => {
|
|
12188
12162
|
var x;
|
|
12189
12163
|
if (F) {
|
|
12190
12164
|
const m = F.flatMap((w) => w.fields).filter((w) => !w.isCustom && w.name).map((w) => w.name), v = new Set(m);
|
|
@@ -12203,7 +12177,7 @@ const rn = {
|
|
|
12203
12177
|
"countryOfBirth",
|
|
12204
12178
|
"mobileCountryCode",
|
|
12205
12179
|
"otherNationality"
|
|
12206
|
-
]),
|
|
12180
|
+
]), se = Ue(() => {
|
|
12207
12181
|
var I, x;
|
|
12208
12182
|
const d = /* @__PURE__ */ new Set();
|
|
12209
12183
|
if (F)
|
|
@@ -12214,15 +12188,15 @@ const rn = {
|
|
|
12214
12188
|
for (const m of q)
|
|
12215
12189
|
G.has(m) && d.add((x = dt[m]) == null ? void 0 : x.countriesType);
|
|
12216
12190
|
return d.size === 0 && d.add(void 0), Array.from(d);
|
|
12217
|
-
}, [q, F]), [k, L] = N({}), [j, X] = N(!0),
|
|
12191
|
+
}, [q, F]), [k, L] = N({}), [j, X] = N(!0), te = ge(/* @__PURE__ */ new Set()), $ = ge(/* @__PURE__ */ new Set());
|
|
12218
12192
|
ve(() => {
|
|
12219
12193
|
if (!c) return;
|
|
12220
|
-
const d =
|
|
12194
|
+
const d = se.filter((m) => {
|
|
12221
12195
|
const v = m != null ? String(m) : "all";
|
|
12222
|
-
return !$.current.has(v) && !
|
|
12196
|
+
return !$.current.has(v) && !te.current.has(v);
|
|
12223
12197
|
});
|
|
12224
12198
|
if (d.length === 0) {
|
|
12225
|
-
|
|
12199
|
+
se.every((v) => {
|
|
12226
12200
|
const w = v != null ? String(v) : "all";
|
|
12227
12201
|
return $.current.has(w);
|
|
12228
12202
|
}) && X(!1);
|
|
@@ -12230,7 +12204,7 @@ const rn = {
|
|
|
12230
12204
|
}
|
|
12231
12205
|
X(!0);
|
|
12232
12206
|
const I = d.map((m) => m != null ? String(m) : "all");
|
|
12233
|
-
I.forEach((m) =>
|
|
12207
|
+
I.forEach((m) => te.current.add(m)), (async () => {
|
|
12234
12208
|
try {
|
|
12235
12209
|
const m = await Promise.all(
|
|
12236
12210
|
d.map(async (v) => {
|
|
@@ -12238,21 +12212,21 @@ const rn = {
|
|
|
12238
12212
|
value: we.countryCode,
|
|
12239
12213
|
label: `${we.countryCode} – ${we.name}`
|
|
12240
12214
|
} : { value: we.abbreviation3 || we.abbreviation, label: we.name }).filter((we) => !we.value || Me.has(we.value) ? !1 : (Me.add(we.value), !0));
|
|
12241
|
-
return $.current.add(w),
|
|
12215
|
+
return $.current.add(w), te.current.delete(w), [w, je];
|
|
12242
12216
|
})
|
|
12243
12217
|
);
|
|
12244
12218
|
L((v) => ({ ...v, ...Object.fromEntries(m) }));
|
|
12245
12219
|
} catch (m) {
|
|
12246
|
-
I.forEach((v) =>
|
|
12220
|
+
I.forEach((v) => te.current.delete(v)), console.error("Failed to load countries:", m);
|
|
12247
12221
|
} finally {
|
|
12248
|
-
|
|
12222
|
+
se.every((v) => {
|
|
12249
12223
|
const w = v != null ? String(v) : "all";
|
|
12250
12224
|
return $.current.has(w);
|
|
12251
12225
|
}) && X(!1);
|
|
12252
12226
|
}
|
|
12253
12227
|
})();
|
|
12254
|
-
}, [
|
|
12255
|
-
const
|
|
12228
|
+
}, [se, c]);
|
|
12229
|
+
const ee = (d, I) => {
|
|
12256
12230
|
var v;
|
|
12257
12231
|
const x = I ?? ((v = dt[d]) == null ? void 0 : v.countriesType), m = x != null ? String(x) : "all";
|
|
12258
12232
|
return k[m] || [];
|
|
@@ -12281,9 +12255,9 @@ const rn = {
|
|
|
12281
12255
|
taxNumber: 1
|
|
12282
12256
|
}, me = Object.fromEntries(
|
|
12283
12257
|
Object.entries(O).filter(([d]) => d in pe)
|
|
12284
|
-
),
|
|
12258
|
+
), Re = Object.fromEntries(
|
|
12285
12259
|
Object.entries(C).filter(([d]) => d in pe)
|
|
12286
|
-
), [
|
|
12260
|
+
), [ce, Y] = N({
|
|
12287
12261
|
workflowKey: D,
|
|
12288
12262
|
firstName: "",
|
|
12289
12263
|
lastName: "",
|
|
@@ -12309,10 +12283,10 @@ const rn = {
|
|
|
12309
12283
|
occupation: "",
|
|
12310
12284
|
taxNumber: "",
|
|
12311
12285
|
...me,
|
|
12312
|
-
...
|
|
12286
|
+
...Re
|
|
12313
12287
|
}), Q = Object.fromEntries(
|
|
12314
12288
|
Object.entries(O).filter(([d]) => !(d in me) && d !== "externalRefId" && d !== "workflowKey")
|
|
12315
|
-
), [
|
|
12289
|
+
), [re, A] = N({ ...Q }), [E, H] = N(!!a);
|
|
12316
12290
|
ve(() => {
|
|
12317
12291
|
if (!a) return;
|
|
12318
12292
|
let d = !1;
|
|
@@ -12358,7 +12332,7 @@ const rn = {
|
|
|
12358
12332
|
d = !0;
|
|
12359
12333
|
};
|
|
12360
12334
|
}, [a]);
|
|
12361
|
-
const [ye, fe] = N(0), [U, J] = N({}), [ke,
|
|
12335
|
+
const [ye, fe] = N(0), [U, J] = N({}), [ke, Ne] = N(null), [Se, _e] = N(!1), st = At(), Ze = Z(() => {
|
|
12362
12336
|
const d = en(), I = (x) => {
|
|
12363
12337
|
var ue;
|
|
12364
12338
|
const m = (ue = dt[x]) == null ? void 0 : ue.countriesType, v = m != null ? String(m) : "all", w = (k[v] || []).filter((de) => de.value);
|
|
@@ -12382,7 +12356,7 @@ const rn = {
|
|
|
12382
12356
|
for (const de of ue.fields)
|
|
12383
12357
|
!de.isCustom || !de.paramName || m[de.paramName] || (de.customType === "checkbox" || de.customType === "link_checkbox" ? m[de.paramName] = "true" : de.customType === "radio_group" && ((v = de.options) != null && v.length) || de.customType === "group_checkbox" && ((w = de.options) != null && w.length) ? m[de.paramName] = de.options[0].value : de.customType === "text" && (m[de.paramName] = "Sample value"));
|
|
12384
12358
|
return m;
|
|
12385
|
-
}), J({}),
|
|
12359
|
+
}), J({}), Ne(null);
|
|
12386
12360
|
}, [F, k]);
|
|
12387
12361
|
ve(() => {
|
|
12388
12362
|
const d = st.current;
|
|
@@ -12395,11 +12369,11 @@ const rn = {
|
|
|
12395
12369
|
handler: Ze
|
|
12396
12370
|
}), () => d.unregisterAction("fill-individual-form");
|
|
12397
12371
|
}, [st, Ze]);
|
|
12398
|
-
const Ye = (d, I) => Y((x) => ({ ...x, [d]: I })), ze = (d, I) => A((x) => ({ ...x, [d]: I })), Qe = (d) => !d.conditionalOn ||
|
|
12372
|
+
const Ye = (d, I) => Y((x) => ({ ...x, [d]: I })), ze = (d, I) => A((x) => ({ ...x, [d]: I })), Qe = (d) => !d.conditionalOn || re[d.conditionalOn] === "true", He = (d) => {
|
|
12399
12373
|
var I;
|
|
12400
12374
|
for (const x of d.fields) {
|
|
12401
12375
|
if (!x.isCustom || !x.paramName || !((I = x.blockingValues) != null && I.length)) continue;
|
|
12402
|
-
const m =
|
|
12376
|
+
const m = re[x.paramName] ?? "";
|
|
12403
12377
|
if (x.customType === "group_checkbox") {
|
|
12404
12378
|
if (m.split(",").filter(Boolean).some((w) => x.blockingValues.includes(w))) return !0;
|
|
12405
12379
|
} else if (x.customType === "radio_group" && x.blockingValues.includes(m))
|
|
@@ -12412,13 +12386,13 @@ const rn = {
|
|
|
12412
12386
|
if (x.isCustom) {
|
|
12413
12387
|
if (x.customType === "paragraph" || x.customType === "html" || x.customType === "br" || x.customType === "link") continue;
|
|
12414
12388
|
if (x.required && x.paramName) {
|
|
12415
|
-
const m =
|
|
12389
|
+
const m = re[x.paramName], v = ie(x.displayText, f) || ie(x.label, f) || x.paramName;
|
|
12416
12390
|
x.customType === "checkbox" || x.customType === "link_checkbox" ? m !== "true" && (I[x.paramName] = f("validation.fieldRequired", { field: v })) : (!m || m.trim() === "") && (I[x.paramName] = f("validation.fieldRequired", { field: v }));
|
|
12417
12391
|
}
|
|
12418
12392
|
} else if (x.name) {
|
|
12419
12393
|
const m = x.name;
|
|
12420
|
-
if (M.includes(m) && St(
|
|
12421
|
-
const v = dt[m], w =
|
|
12394
|
+
if (M.includes(m) && St(ce[m])) {
|
|
12395
|
+
const v = dt[m], w = ie(x.displayText, f) || (v != null && v.translationKey ? f(`fields.${v.translationKey}`) : void 0) || (v == null ? void 0 : v.label) || m;
|
|
12422
12396
|
I[m] = f("validation.fieldRequired", { field: w });
|
|
12423
12397
|
}
|
|
12424
12398
|
}
|
|
@@ -12447,35 +12421,35 @@ const rn = {
|
|
|
12447
12421
|
return;
|
|
12448
12422
|
}
|
|
12449
12423
|
}
|
|
12450
|
-
_e(!0),
|
|
12424
|
+
_e(!0), Ne(null);
|
|
12451
12425
|
try {
|
|
12452
|
-
if (!
|
|
12453
|
-
|
|
12426
|
+
if (!ce.externalRefId || ce.externalRefId.trim() === "") {
|
|
12427
|
+
Ne(f("createApplicant.externalRefIdRequired"));
|
|
12454
12428
|
return;
|
|
12455
12429
|
}
|
|
12456
12430
|
const d = {
|
|
12457
12431
|
...a ? { applicantId: a } : {},
|
|
12458
|
-
workflowKey:
|
|
12459
|
-
externalRefId:
|
|
12432
|
+
workflowKey: ce.workflowKey,
|
|
12433
|
+
externalRefId: ce.externalRefId.trim()
|
|
12460
12434
|
};
|
|
12461
12435
|
if (F) {
|
|
12462
12436
|
for (const v of F)
|
|
12463
12437
|
if (Qe(v)) {
|
|
12464
12438
|
for (const w of v.fields)
|
|
12465
12439
|
if (!w.isCustom && w.name) {
|
|
12466
|
-
const ue = w.name, de =
|
|
12440
|
+
const ue = w.name, de = ce[ue];
|
|
12467
12441
|
St(de) || (d[ue] = de);
|
|
12468
12442
|
}
|
|
12469
12443
|
}
|
|
12470
12444
|
for (const v of zt)
|
|
12471
12445
|
if (d[v] === void 0) {
|
|
12472
|
-
const w =
|
|
12446
|
+
const w = ce[v];
|
|
12473
12447
|
St(w) || (d[v] = w);
|
|
12474
12448
|
}
|
|
12475
12449
|
} else
|
|
12476
12450
|
q.forEach((v) => {
|
|
12477
12451
|
if (v === "externalRefId") return;
|
|
12478
|
-
const w =
|
|
12452
|
+
const w = ce[v];
|
|
12479
12453
|
St(w) || (d[v] = w);
|
|
12480
12454
|
});
|
|
12481
12455
|
const I = [];
|
|
@@ -12484,7 +12458,7 @@ const rn = {
|
|
|
12484
12458
|
if (Qe(v))
|
|
12485
12459
|
for (const w of v.fields) {
|
|
12486
12460
|
if (!w.isCustom || !w.paramName || w.customType === "paragraph" || w.customType === "html" || w.customType === "br" || w.customType === "link") continue;
|
|
12487
|
-
const ue =
|
|
12461
|
+
const ue = re[w.paramName] ?? "";
|
|
12488
12462
|
let de;
|
|
12489
12463
|
if (w.customType === "checkbox" || w.customType === "link_checkbox")
|
|
12490
12464
|
de = ue === "true" ? "yes" : "no";
|
|
@@ -12501,16 +12475,16 @@ const rn = {
|
|
|
12501
12475
|
const m = await u(d);
|
|
12502
12476
|
r(m.applicantId);
|
|
12503
12477
|
} catch (d) {
|
|
12504
|
-
console.error("Error creating applicant:", d),
|
|
12478
|
+
console.error("Error creating applicant:", d), Ne(d.message || f("createApplicant.failedToCreate"));
|
|
12505
12479
|
} finally {
|
|
12506
12480
|
_e(!1);
|
|
12507
12481
|
}
|
|
12508
12482
|
}, xt = async (d) => {
|
|
12509
12483
|
d.preventDefault();
|
|
12510
12484
|
for (const I of M)
|
|
12511
|
-
if (St(
|
|
12485
|
+
if (St(ce[I])) {
|
|
12512
12486
|
const x = dt[I], m = (x != null && x.translationKey ? f(`fields.${x.translationKey}`) : void 0) || (x == null ? void 0 : x.label) || I;
|
|
12513
|
-
|
|
12487
|
+
Ne(f("validation.fieldRequired", { field: m }));
|
|
12514
12488
|
return;
|
|
12515
12489
|
}
|
|
12516
12490
|
await Pe();
|
|
@@ -12518,19 +12492,19 @@ const rn = {
|
|
|
12518
12492
|
var Zt;
|
|
12519
12493
|
const w = dt[d];
|
|
12520
12494
|
if (!w) return null;
|
|
12521
|
-
const ue = M.includes(d), de = U[d], Me =
|
|
12495
|
+
const ue = M.includes(d), de = U[d], Me = ie(x, f) || (w.translationKey ? f(`fields.${w.translationKey}`) : void 0) || w.label, je = d in Re, we = I ?? d, $e = { required: ue }, tt = v ? v !== "placeholder" : W, lt = tt ? Me : void 0;
|
|
12522
12496
|
switch (w.type) {
|
|
12523
12497
|
case "select":
|
|
12524
12498
|
if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth" || d === "mobileCountryCode") {
|
|
12525
|
-
const
|
|
12499
|
+
const Fe = ee(d, m);
|
|
12526
12500
|
return /* @__PURE__ */ i(
|
|
12527
12501
|
nt,
|
|
12528
12502
|
{
|
|
12529
12503
|
...$e,
|
|
12530
12504
|
label: lt,
|
|
12531
|
-
value:
|
|
12505
|
+
value: ce[d] || "",
|
|
12532
12506
|
onChange: (ft) => Ye(d, ft),
|
|
12533
|
-
options: [{ value: "", label: tt ? f("placeholders.selectCountry") : Me }, ...
|
|
12507
|
+
options: [{ value: "", label: tt ? f("placeholders.selectCountry") : Me }, ...Fe],
|
|
12534
12508
|
disabled: j,
|
|
12535
12509
|
readOnly: je,
|
|
12536
12510
|
error: de
|
|
@@ -12544,8 +12518,8 @@ const rn = {
|
|
|
12544
12518
|
{
|
|
12545
12519
|
...$e,
|
|
12546
12520
|
label: lt,
|
|
12547
|
-
value: ((Zt =
|
|
12548
|
-
onChange: (
|
|
12521
|
+
value: ((Zt = ce[d]) == null ? void 0 : Zt.toString()) || "",
|
|
12522
|
+
onChange: (Fe) => Ye(d, Fe ? Number(Fe) : null),
|
|
12549
12523
|
options: [
|
|
12550
12524
|
{ value: "", label: tt ? f("placeholders.selectSalutation") : Me },
|
|
12551
12525
|
{ value: Et.Male.toString(), label: f("gender.male") },
|
|
@@ -12558,15 +12532,15 @@ const rn = {
|
|
|
12558
12532
|
we
|
|
12559
12533
|
);
|
|
12560
12534
|
if (d === "defaultLanguage") {
|
|
12561
|
-
const
|
|
12535
|
+
const Fe = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? ei.filter((ft) => c.allowedLanguages.includes(ft.value)) : ei;
|
|
12562
12536
|
return /* @__PURE__ */ i(
|
|
12563
12537
|
nt,
|
|
12564
12538
|
{
|
|
12565
12539
|
...$e,
|
|
12566
12540
|
label: lt,
|
|
12567
|
-
value:
|
|
12541
|
+
value: ce[d] || "",
|
|
12568
12542
|
onChange: (ft) => Ye(d, ft),
|
|
12569
|
-
options: [{ value: "", label: tt ? f("placeholders.selectLanguage") : Me }, ...
|
|
12543
|
+
options: [{ value: "", label: tt ? f("placeholders.selectLanguage") : Me }, ...Fe],
|
|
12570
12544
|
readOnly: je,
|
|
12571
12545
|
error: de
|
|
12572
12546
|
},
|
|
@@ -12576,15 +12550,15 @@ const rn = {
|
|
|
12576
12550
|
return null;
|
|
12577
12551
|
case "multiselect":
|
|
12578
12552
|
if (d === "otherNationality") {
|
|
12579
|
-
const
|
|
12553
|
+
const Fe = ee(d, m);
|
|
12580
12554
|
return /* @__PURE__ */ i(
|
|
12581
12555
|
fa,
|
|
12582
12556
|
{
|
|
12583
12557
|
...$e,
|
|
12584
12558
|
label: lt,
|
|
12585
|
-
value:
|
|
12559
|
+
value: ce[d] || [],
|
|
12586
12560
|
onChange: (ft) => Ye(d, ft),
|
|
12587
|
-
options:
|
|
12561
|
+
options: Fe,
|
|
12588
12562
|
placeholder: tt ? f("placeholders.selectOtherNationalities") : Me,
|
|
12589
12563
|
disabled: j,
|
|
12590
12564
|
readOnly: je
|
|
@@ -12595,14 +12569,14 @@ const rn = {
|
|
|
12595
12569
|
return null;
|
|
12596
12570
|
case "date":
|
|
12597
12571
|
return /* @__PURE__ */ i(
|
|
12598
|
-
|
|
12572
|
+
Ce,
|
|
12599
12573
|
{
|
|
12600
12574
|
...$e,
|
|
12601
12575
|
type: "date",
|
|
12602
12576
|
label: lt,
|
|
12603
12577
|
placeholder: tt ? void 0 : Me,
|
|
12604
|
-
value:
|
|
12605
|
-
onChange: (
|
|
12578
|
+
value: ce[d] || "",
|
|
12579
|
+
onChange: (Fe) => Ye(d, Fe.target.value),
|
|
12606
12580
|
readOnly: je,
|
|
12607
12581
|
error: de
|
|
12608
12582
|
},
|
|
@@ -12610,14 +12584,14 @@ const rn = {
|
|
|
12610
12584
|
);
|
|
12611
12585
|
case "email":
|
|
12612
12586
|
return /* @__PURE__ */ i(
|
|
12613
|
-
|
|
12587
|
+
Ce,
|
|
12614
12588
|
{
|
|
12615
12589
|
...$e,
|
|
12616
12590
|
type: "email",
|
|
12617
12591
|
label: lt,
|
|
12618
12592
|
placeholder: tt ? void 0 : Me,
|
|
12619
|
-
value:
|
|
12620
|
-
onChange: (
|
|
12593
|
+
value: ce[d] || "",
|
|
12594
|
+
onChange: (Fe) => Ye(d, Fe.target.value),
|
|
12621
12595
|
readOnly: je,
|
|
12622
12596
|
error: de
|
|
12623
12597
|
},
|
|
@@ -12625,14 +12599,14 @@ const rn = {
|
|
|
12625
12599
|
);
|
|
12626
12600
|
case "tel":
|
|
12627
12601
|
return /* @__PURE__ */ i(
|
|
12628
|
-
|
|
12602
|
+
Ce,
|
|
12629
12603
|
{
|
|
12630
12604
|
...$e,
|
|
12631
12605
|
type: "tel",
|
|
12632
12606
|
label: lt,
|
|
12633
12607
|
placeholder: tt ? void 0 : Me,
|
|
12634
|
-
value:
|
|
12635
|
-
onChange: (
|
|
12608
|
+
value: ce[d] || "",
|
|
12609
|
+
onChange: (Fe) => Ye(d, Fe.target.value),
|
|
12636
12610
|
readOnly: je,
|
|
12637
12611
|
error: de
|
|
12638
12612
|
},
|
|
@@ -12640,14 +12614,14 @@ const rn = {
|
|
|
12640
12614
|
);
|
|
12641
12615
|
default:
|
|
12642
12616
|
return /* @__PURE__ */ i(
|
|
12643
|
-
|
|
12617
|
+
Ce,
|
|
12644
12618
|
{
|
|
12645
12619
|
...$e,
|
|
12646
12620
|
type: "text",
|
|
12647
12621
|
label: lt,
|
|
12648
12622
|
placeholder: tt ? void 0 : Me,
|
|
12649
|
-
value:
|
|
12650
|
-
onChange: (
|
|
12623
|
+
value: ce[d] || "",
|
|
12624
|
+
onChange: (Fe) => Ye(d, Fe.target.value),
|
|
12651
12625
|
readOnly: je,
|
|
12652
12626
|
error: de
|
|
12653
12627
|
},
|
|
@@ -12657,7 +12631,7 @@ const rn = {
|
|
|
12657
12631
|
}, gt = (d, I) => {
|
|
12658
12632
|
const x = d.labelMode ? d.labelMode !== "placeholder" : W;
|
|
12659
12633
|
if (d.customType === "paragraph") {
|
|
12660
|
-
const w =
|
|
12634
|
+
const w = ie(d.displayText, f) || ie(d.label, f) || "";
|
|
12661
12635
|
return /* @__PURE__ */ i(
|
|
12662
12636
|
"p",
|
|
12663
12637
|
{
|
|
@@ -12677,14 +12651,14 @@ const rn = {
|
|
|
12677
12651
|
return /* @__PURE__ */ i(
|
|
12678
12652
|
"div",
|
|
12679
12653
|
{
|
|
12680
|
-
dangerouslySetInnerHTML: { __html:
|
|
12654
|
+
dangerouslySetInnerHTML: { __html: ie(d.label, f) || "" }
|
|
12681
12655
|
},
|
|
12682
12656
|
`custom-${I}`
|
|
12683
12657
|
);
|
|
12684
12658
|
if (d.customType === "br")
|
|
12685
12659
|
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${I}`);
|
|
12686
12660
|
if (d.customType === "link") {
|
|
12687
|
-
const w =
|
|
12661
|
+
const w = ie(d.displayText, f) || ie(d.label, f) || d.linkText || d.linkUrl || "";
|
|
12688
12662
|
return /* @__PURE__ */ i("div", { className: "metakyc-link-field", children: /* @__PURE__ */ l(
|
|
12689
12663
|
"a",
|
|
12690
12664
|
{
|
|
@@ -12708,9 +12682,9 @@ const rn = {
|
|
|
12708
12682
|
) }, `custom-${I}`);
|
|
12709
12683
|
}
|
|
12710
12684
|
if (!d.paramName) return null;
|
|
12711
|
-
const m = U[d.paramName], v =
|
|
12685
|
+
const m = U[d.paramName], v = ie(d.displayText, f) || ie(d.label, f) || d.paramName;
|
|
12712
12686
|
if (d.customType === "checkbox") {
|
|
12713
|
-
const w =
|
|
12687
|
+
const w = re[d.paramName] === "true";
|
|
12714
12688
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
|
|
12715
12689
|
/* @__PURE__ */ l(
|
|
12716
12690
|
"div",
|
|
@@ -12746,7 +12720,7 @@ const rn = {
|
|
|
12746
12720
|
] }, `custom-${I}`);
|
|
12747
12721
|
}
|
|
12748
12722
|
if (d.customType === "link_checkbox") {
|
|
12749
|
-
const w =
|
|
12723
|
+
const w = re[d.paramName] === "true";
|
|
12750
12724
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
|
|
12751
12725
|
/* @__PURE__ */ l(
|
|
12752
12726
|
"div",
|
|
@@ -12795,7 +12769,7 @@ const rn = {
|
|
|
12795
12769
|
] }, `custom-${I}`);
|
|
12796
12770
|
}
|
|
12797
12771
|
if (d.customType === "group_checkbox") {
|
|
12798
|
-
const w = (
|
|
12772
|
+
const w = (re[d.paramName] || "").split(",").filter(Boolean);
|
|
12799
12773
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
|
|
12800
12774
|
x && /* @__PURE__ */ l(
|
|
12801
12775
|
"div",
|
|
@@ -12809,7 +12783,7 @@ const rn = {
|
|
|
12809
12783
|
}
|
|
12810
12784
|
),
|
|
12811
12785
|
/* @__PURE__ */ i("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((ue) => {
|
|
12812
|
-
const de = d.singleSelect ?
|
|
12786
|
+
const de = d.singleSelect ? re[d.paramName] === ue.value : w.includes(ue.value), Me = () => {
|
|
12813
12787
|
if (d.singleSelect)
|
|
12814
12788
|
ze(d.paramName, de ? "" : ue.value);
|
|
12815
12789
|
else {
|
|
@@ -12864,7 +12838,7 @@ const rn = {
|
|
|
12864
12838
|
"input",
|
|
12865
12839
|
{
|
|
12866
12840
|
type: "radio",
|
|
12867
|
-
checked:
|
|
12841
|
+
checked: re[d.paramName] === w.value,
|
|
12868
12842
|
onChange: () => ze(d.paramName, w.value),
|
|
12869
12843
|
name: `radio-group-${d.paramName}-${I}`,
|
|
12870
12844
|
className: "metakyc-option-input",
|
|
@@ -12886,12 +12860,12 @@ const rn = {
|
|
|
12886
12860
|
)) }),
|
|
12887
12861
|
m && /* @__PURE__ */ i("p", { className: "text-xs", style: { color: "var(--metakyc-danger, #ef4444)" }, children: m })
|
|
12888
12862
|
] }, `custom-${I}`) : /* @__PURE__ */ i(
|
|
12889
|
-
|
|
12863
|
+
Ce,
|
|
12890
12864
|
{
|
|
12891
12865
|
type: "text",
|
|
12892
12866
|
label: x ? `${v}${d.required ? " *" : ""}` : void 0,
|
|
12893
12867
|
placeholder: x ? void 0 : v,
|
|
12894
|
-
value:
|
|
12868
|
+
value: re[d.paramName] || "",
|
|
12895
12869
|
onChange: (w) => ze(d.paramName, w.target.value),
|
|
12896
12870
|
required: d.required,
|
|
12897
12871
|
error: m
|
|
@@ -12922,7 +12896,7 @@ const rn = {
|
|
|
12922
12896
|
{
|
|
12923
12897
|
className: "metakyc-option-text",
|
|
12924
12898
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", fontWeight: 500 },
|
|
12925
|
-
children:
|
|
12899
|
+
children: ie(d.conditionalLabel, f) || d.conditionalOn
|
|
12926
12900
|
}
|
|
12927
12901
|
)
|
|
12928
12902
|
]
|
|
@@ -12935,23 +12909,23 @@ const rn = {
|
|
|
12935
12909
|
] });
|
|
12936
12910
|
};
|
|
12937
12911
|
if (!c || j || E)
|
|
12938
|
-
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(
|
|
12939
|
-
/* @__PURE__ */ i(
|
|
12912
|
+
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
12913
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
12940
12914
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: f("common.loadingForm") })
|
|
12941
12915
|
] }) }) });
|
|
12942
12916
|
if (F) {
|
|
12943
|
-
const d = F[ye] ?? F[0], I = De === -1, x = et === -1, m = F.length, v = Qe(d), w = He(d), ue = Object.values(U), de = !v && !!d.conditionalOn && d.conditionalMode === "block", Me =
|
|
12917
|
+
const d = F[ye] ?? F[0], I = De === -1, x = et === -1, m = F.length, v = Qe(d), w = He(d), ue = Object.values(U), de = !v && !!d.conditionalOn && d.conditionalMode === "block", Me = Se || y || de || w;
|
|
12944
12918
|
let je;
|
|
12945
|
-
return de || w ? je = f("common.blocked") : x ? je = d.conditionalOn && !v ? f("common.skipAndSubmit") : f("common.submit") : je = d.conditionalOn && !v ? f("common.skip") : f("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ l(
|
|
12919
|
+
return de || w ? je = f("common.blocked") : x ? je = d.conditionalOn && !v ? f("common.skipAndSubmit") : f("common.submit") : je = d.conditionalOn && !v ? f("common.skip") : f("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ l(ne, { children: [
|
|
12946
12920
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i(Tt, { title: (c == null ? void 0 : c.title) || f("createApplicant.title") }) }),
|
|
12947
|
-
/* @__PURE__ */ l(
|
|
12921
|
+
/* @__PURE__ */ l(oe, { children: [
|
|
12948
12922
|
(d.title || d.subtitle || d.description) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
12949
12923
|
d.title && /* @__PURE__ */ i(
|
|
12950
12924
|
"h3",
|
|
12951
12925
|
{
|
|
12952
12926
|
className: "font-semibold text-base",
|
|
12953
12927
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
12954
|
-
children:
|
|
12928
|
+
children: ie(d.title, f)
|
|
12955
12929
|
}
|
|
12956
12930
|
),
|
|
12957
12931
|
d.subtitle && /* @__PURE__ */ i(
|
|
@@ -12959,7 +12933,7 @@ const rn = {
|
|
|
12959
12933
|
{
|
|
12960
12934
|
className: "text-sm mt-0.5",
|
|
12961
12935
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12962
|
-
children:
|
|
12936
|
+
children: ie(d.subtitle, f)
|
|
12963
12937
|
}
|
|
12964
12938
|
),
|
|
12965
12939
|
d.description && d.description !== d.subtitle && /* @__PURE__ */ i(
|
|
@@ -12967,7 +12941,7 @@ const rn = {
|
|
|
12967
12941
|
{
|
|
12968
12942
|
className: "text-xs mt-1",
|
|
12969
12943
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
12970
|
-
children:
|
|
12944
|
+
children: ie(d.description, f)
|
|
12971
12945
|
}
|
|
12972
12946
|
)
|
|
12973
12947
|
] }),
|
|
@@ -13006,24 +12980,24 @@ const rn = {
|
|
|
13006
12980
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
13007
12981
|
/* @__PURE__ */ l("div", { children: [
|
|
13008
12982
|
!I && /* @__PURE__ */ i(
|
|
13009
|
-
|
|
12983
|
+
le,
|
|
13010
12984
|
{
|
|
13011
12985
|
type: "button",
|
|
13012
12986
|
variant: "outline",
|
|
13013
12987
|
onClick: () => {
|
|
13014
12988
|
fe(De), J({});
|
|
13015
12989
|
},
|
|
13016
|
-
disabled:
|
|
12990
|
+
disabled: Se || y,
|
|
13017
12991
|
children: f("common.previous")
|
|
13018
12992
|
}
|
|
13019
12993
|
),
|
|
13020
|
-
I && n && /* @__PURE__ */ i(
|
|
12994
|
+
I && n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: Se || y, children: "Cancel" })
|
|
13021
12995
|
] }),
|
|
13022
12996
|
/* @__PURE__ */ i(
|
|
13023
|
-
|
|
12997
|
+
le,
|
|
13024
12998
|
{
|
|
13025
12999
|
type: "button",
|
|
13026
|
-
isLoading:
|
|
13000
|
+
isLoading: Se || y,
|
|
13027
13001
|
disabled: Me,
|
|
13028
13002
|
onClick: x ? Pe : wt,
|
|
13029
13003
|
children: je
|
|
@@ -13032,9 +13006,9 @@ const rn = {
|
|
|
13032
13006
|
] })
|
|
13033
13007
|
] }) });
|
|
13034
13008
|
}
|
|
13035
|
-
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i("form", { onSubmit: xt, children: /* @__PURE__ */ l(
|
|
13009
|
+
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i("form", { onSubmit: xt, children: /* @__PURE__ */ l(ne, { children: [
|
|
13036
13010
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i(Tt, { title: (c == null ? void 0 : c.title) || f("createApplicant.title") }) }),
|
|
13037
|
-
/* @__PURE__ */ l(
|
|
13011
|
+
/* @__PURE__ */ l(oe, { children: [
|
|
13038
13012
|
ke && /* @__PURE__ */ i("div", { className: "mb-6 p-4 rounded-lg", style: {
|
|
13039
13013
|
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
13040
13014
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
@@ -13046,8 +13020,8 @@ const rn = {
|
|
|
13046
13020
|
/* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: q.map((d) => /* @__PURE__ */ i("div", { style: { gridColumn: "span 4 / span 4" }, children: pt(d) }, d)) })
|
|
13047
13021
|
] }),
|
|
13048
13022
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
13049
|
-
n && /* @__PURE__ */ i(
|
|
13050
|
-
/* @__PURE__ */ i(
|
|
13023
|
+
n && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: n, disabled: Se || y, children: "Cancel" }),
|
|
13024
|
+
/* @__PURE__ */ i(le, { type: "submit", isLoading: Se || y, children: f("createApplicant.createApplicant") })
|
|
13051
13025
|
] })
|
|
13052
13026
|
] }) }) });
|
|
13053
13027
|
}, ki = ["companyName", "email"];
|
|
@@ -13061,15 +13035,15 @@ const nn = ({
|
|
|
13061
13035
|
onCancel: r
|
|
13062
13036
|
}) => {
|
|
13063
13037
|
var mt, wt, Pe, xt, pt, gt;
|
|
13064
|
-
const { config: n, baseInformationService: o, currentTheme: s } =
|
|
13038
|
+
const { config: n, baseInformationService: o, currentTheme: s } = Te(), { createCompanyApplicant: c, isLoading: u } = Ri(), { t: g } = Ie(), y = e || ((mt = n.applicantForm) == null ? void 0 : mt.workflowKey);
|
|
13065
13039
|
if (!y)
|
|
13066
13040
|
throw new Error(
|
|
13067
13041
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
13068
13042
|
);
|
|
13069
|
-
const f = t || ((wt = n.applicantForm) == null ? void 0 : wt.externalRefId) || "", D = ((Pe = n.applicantForm) == null ? void 0 : Pe.email) || "", T = ((xt = n.applicantForm) == null ? void 0 : xt.initialValues) || {}, O = (((pt = n.applicantForm) == null ? void 0 : pt.fieldLabelMode) || (s == null ? void 0 : s.fieldLabelMode) || "label") !== "placeholder", C =
|
|
13043
|
+
const f = t || ((wt = n.applicantForm) == null ? void 0 : wt.externalRefId) || "", D = ((Pe = n.applicantForm) == null ? void 0 : Pe.email) || "", T = ((xt = n.applicantForm) == null ? void 0 : xt.initialValues) || {}, O = (((pt = n.applicantForm) == null ? void 0 : pt.fieldLabelMode) || (s == null ? void 0 : s.fieldLabelMode) || "label") !== "placeholder", C = Ue(
|
|
13070
13044
|
() => s != null && s.companyFormPages && s.companyFormPages.length > 0 ? s.companyFormPages : null,
|
|
13071
13045
|
[s == null ? void 0 : s.companyFormPages]
|
|
13072
|
-
), K =
|
|
13046
|
+
), K = Ue(() => {
|
|
13073
13047
|
const b = new Set(ki), V = s == null ? void 0 : s.companyFormRequiredFields;
|
|
13074
13048
|
if (V) for (const P of V) b.add(P);
|
|
13075
13049
|
if (C)
|
|
@@ -13077,7 +13051,7 @@ const nn = ({
|
|
|
13077
13051
|
for (const p of P.fields)
|
|
13078
13052
|
!p.isCustom && p.name && p.required && b.add(p.name);
|
|
13079
13053
|
return Array.from(b);
|
|
13080
|
-
}, [s == null ? void 0 : s.companyFormRequiredFields, C]), W =
|
|
13054
|
+
}, [s == null ? void 0 : s.companyFormRequiredFields, C]), W = Ue(() => {
|
|
13081
13055
|
var b;
|
|
13082
13056
|
if (C) {
|
|
13083
13057
|
const V = C.flatMap((p) => p.fields).filter((p) => !p.isCustom && p.name).map((p) => p.name), P = new Set(V);
|
|
@@ -13085,7 +13059,7 @@ const nn = ({
|
|
|
13085
13059
|
return Array.from(P);
|
|
13086
13060
|
}
|
|
13087
13061
|
return (b = n.applicantForm) != null && b.visibleFields ? n.applicantForm.visibleFields : s != null && s.companyFormVisibleFields && s.companyFormVisibleFields.length > 0 ? s.companyFormVisibleFields : Xi;
|
|
13088
|
-
}, [(gt = n.applicantForm) == null ? void 0 : gt.visibleFields, s == null ? void 0 : s.companyFormVisibleFields, C]), F = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M =
|
|
13062
|
+
}, [(gt = n.applicantForm) == null ? void 0 : gt.visibleFields, s == null ? void 0 : s.companyFormVisibleFields, C]), F = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = Ue(() => {
|
|
13089
13063
|
var V, P;
|
|
13090
13064
|
const b = /* @__PURE__ */ new Set();
|
|
13091
13065
|
if (C)
|
|
@@ -13096,7 +13070,7 @@ const nn = ({
|
|
|
13096
13070
|
for (const p of W)
|
|
13097
13071
|
F.has(p) && b.add((P = ht[p]) == null ? void 0 : P.countriesType);
|
|
13098
13072
|
return b.size === 0 && b.add(void 0), Array.from(b);
|
|
13099
|
-
}, [W, C]), [q, G] = N({}), [
|
|
13073
|
+
}, [W, C]), [q, G] = N({}), [se, k] = N(!0), L = ge(/* @__PURE__ */ new Set()), j = ge(/* @__PURE__ */ new Set());
|
|
13100
13074
|
ve(() => {
|
|
13101
13075
|
if (!s) return;
|
|
13102
13076
|
const b = M.filter((p) => {
|
|
@@ -13129,7 +13103,7 @@ const nn = ({
|
|
|
13129
13103
|
var h;
|
|
13130
13104
|
const P = V ?? ((h = ht[b]) == null ? void 0 : h.countriesType), p = P != null ? String(P) : "all";
|
|
13131
13105
|
return q[p] || [];
|
|
13132
|
-
},
|
|
13106
|
+
}, te = {
|
|
13133
13107
|
companyName: 1,
|
|
13134
13108
|
registrationNumber: 1,
|
|
13135
13109
|
email: 1,
|
|
@@ -13150,8 +13124,8 @@ const nn = ({
|
|
|
13150
13124
|
addressCountry: 1,
|
|
13151
13125
|
lei: 1
|
|
13152
13126
|
}, $ = Object.fromEntries(
|
|
13153
|
-
Object.entries(T).filter(([b]) => b in
|
|
13154
|
-
), [
|
|
13127
|
+
Object.entries(T).filter(([b]) => b in te)
|
|
13128
|
+
), [ee, pe] = N({
|
|
13155
13129
|
workflowKey: y,
|
|
13156
13130
|
companyName: "",
|
|
13157
13131
|
email: D,
|
|
@@ -13174,7 +13148,7 @@ const nn = ({
|
|
|
13174
13148
|
lei: "",
|
|
13175
13149
|
externalRefId: f,
|
|
13176
13150
|
...$
|
|
13177
|
-
}), [me,
|
|
13151
|
+
}), [me, Re] = N({}), [ce, Y] = N(0), [Q, re] = N({}), [A, E] = N(null), [H, ye] = N(!1), fe = At(), U = Z(() => {
|
|
13178
13152
|
const b = tn(), V = (P) => {
|
|
13179
13153
|
var R;
|
|
13180
13154
|
const p = (R = ht[P]) == null ? void 0 : R.countriesType, h = p != null ? String(p) : "all", z = (q[h] || []).filter((B) => B.value);
|
|
@@ -13191,14 +13165,14 @@ const nn = ({
|
|
|
13191
13165
|
} else
|
|
13192
13166
|
p[h] = z;
|
|
13193
13167
|
return p;
|
|
13194
|
-
}), C &&
|
|
13168
|
+
}), C && Re((P) => {
|
|
13195
13169
|
var h, z;
|
|
13196
13170
|
const p = { ...P };
|
|
13197
13171
|
for (const R of C)
|
|
13198
13172
|
for (const B of R.fields)
|
|
13199
13173
|
!B.isCustom || !B.paramName || p[B.paramName] || (B.customType === "checkbox" || B.customType === "link_checkbox" ? p[B.paramName] = "true" : B.customType === "radio_group" && ((h = B.options) != null && h.length) || B.customType === "group_checkbox" && ((z = B.options) != null && z.length) ? p[B.paramName] = B.options[0].value : B.customType === "text" && (p[B.paramName] = "Sample value"));
|
|
13200
13174
|
return p;
|
|
13201
|
-
}),
|
|
13175
|
+
}), re({}), E(null);
|
|
13202
13176
|
}, [C, q]);
|
|
13203
13177
|
ve(() => {
|
|
13204
13178
|
const b = fe.current;
|
|
@@ -13211,7 +13185,7 @@ const nn = ({
|
|
|
13211
13185
|
handler: U
|
|
13212
13186
|
}), () => b.unregisterAction("fill-company-form");
|
|
13213
13187
|
}, [fe, U]);
|
|
13214
|
-
const J = (b, V) => pe((P) => ({ ...P, [b]: V })), ke = (b, V) =>
|
|
13188
|
+
const J = (b, V) => pe((P) => ({ ...P, [b]: V })), ke = (b, V) => Re((P) => ({ ...P, [b]: V })), Ne = (b) => !b.conditionalOn || me[b.conditionalOn] === "true", Se = (b) => {
|
|
13215
13189
|
var V;
|
|
13216
13190
|
for (const P of b.fields) {
|
|
13217
13191
|
if (!P.isCustom || !P.paramName || !((V = P.blockingValues) != null && V.length)) continue;
|
|
@@ -13222,56 +13196,56 @@ const nn = ({
|
|
|
13222
13196
|
return !0;
|
|
13223
13197
|
}
|
|
13224
13198
|
return !1;
|
|
13225
|
-
}, _e = C &&
|
|
13199
|
+
}, _e = C && ce < C.length - 1 ? ce + 1 : -1, st = C && ce > 0 ? ce - 1 : -1, Ze = (b) => {
|
|
13226
13200
|
const V = {};
|
|
13227
13201
|
for (const P of b.fields)
|
|
13228
13202
|
if (P.isCustom) {
|
|
13229
13203
|
if (P.customType === "paragraph" || P.customType === "html" || P.customType === "br" || P.customType === "link") continue;
|
|
13230
13204
|
if (P.required && P.paramName) {
|
|
13231
|
-
const p = me[P.paramName], h =
|
|
13205
|
+
const p = me[P.paramName], h = ie(P.displayText, g) || ie(P.label, g) || P.paramName;
|
|
13232
13206
|
P.customType === "checkbox" || P.customType === "link_checkbox" ? p !== "true" && (V[P.paramName] = g("validation.fieldRequired", { field: h })) : (!p || p.trim() === "") && (V[P.paramName] = g("validation.fieldRequired", { field: h }));
|
|
13233
13207
|
}
|
|
13234
13208
|
} else if (P.name) {
|
|
13235
13209
|
const p = P.name;
|
|
13236
|
-
if (K.includes(p) && qt(
|
|
13237
|
-
const h = ht[p], z =
|
|
13210
|
+
if (K.includes(p) && qt(ee[p])) {
|
|
13211
|
+
const h = ht[p], z = ie(P.displayText, g) || (h != null && h.translationKey ? g(`fields.${h.translationKey}`) : void 0) || (h == null ? void 0 : h.label) || p;
|
|
13238
13212
|
V[p] = g("validation.fieldRequired", { field: z });
|
|
13239
13213
|
}
|
|
13240
13214
|
}
|
|
13241
13215
|
return V;
|
|
13242
13216
|
}, Ye = async () => {
|
|
13243
13217
|
if (!C) return;
|
|
13244
|
-
const b = C[
|
|
13245
|
-
if (
|
|
13246
|
-
if (b.conditionalOn && !
|
|
13247
|
-
|
|
13218
|
+
const b = C[ce];
|
|
13219
|
+
if (Se(b) || b.conditionalOn && b.conditionalMode === "block" && !Ne(b)) return;
|
|
13220
|
+
if (b.conditionalOn && !Ne(b)) {
|
|
13221
|
+
re({}), _e >= 0 ? Y(_e) : await ze();
|
|
13248
13222
|
return;
|
|
13249
13223
|
}
|
|
13250
13224
|
const V = Ze(b);
|
|
13251
13225
|
if (Object.keys(V).length > 0) {
|
|
13252
|
-
|
|
13226
|
+
re(V);
|
|
13253
13227
|
return;
|
|
13254
13228
|
}
|
|
13255
|
-
|
|
13229
|
+
re({}), _e >= 0 ? Y(_e) : await ze();
|
|
13256
13230
|
}, ze = async () => {
|
|
13257
13231
|
var b;
|
|
13258
13232
|
if (C) {
|
|
13259
13233
|
let V = {};
|
|
13260
13234
|
for (const P of C)
|
|
13261
|
-
|
|
13235
|
+
Ne(P) && (V = { ...V, ...Ze(P) });
|
|
13262
13236
|
if (Object.keys(V).length > 0) {
|
|
13263
|
-
|
|
13237
|
+
re(V);
|
|
13264
13238
|
return;
|
|
13265
13239
|
}
|
|
13266
13240
|
}
|
|
13267
13241
|
ye(!0), E(null);
|
|
13268
13242
|
try {
|
|
13269
13243
|
const V = {
|
|
13270
|
-
workflowKey:
|
|
13271
|
-
externalRefId: ((b =
|
|
13272
|
-
}, P = C ? C.filter((z) =>
|
|
13244
|
+
workflowKey: ee.workflowKey,
|
|
13245
|
+
externalRefId: ((b = ee.externalRefId) == null ? void 0 : b.trim()) || void 0
|
|
13246
|
+
}, P = C ? C.filter((z) => Ne(z)).flatMap((z) => z.fields).filter((z) => !z.isCustom && z.name).map((z) => z.name) : W;
|
|
13273
13247
|
for (const z of P) {
|
|
13274
|
-
const R =
|
|
13248
|
+
const R = ee[z];
|
|
13275
13249
|
if (!qt(R))
|
|
13276
13250
|
switch (z) {
|
|
13277
13251
|
case "companyName":
|
|
@@ -13306,7 +13280,7 @@ const nn = ({
|
|
|
13306
13280
|
const p = [];
|
|
13307
13281
|
if (C) {
|
|
13308
13282
|
for (const z of C)
|
|
13309
|
-
if (
|
|
13283
|
+
if (Ne(z))
|
|
13310
13284
|
for (const R of z.fields) {
|
|
13311
13285
|
if (!R.isCustom || !R.paramName || R.customType === "paragraph" || R.customType === "html" || R.customType === "br" || R.customType === "link") continue;
|
|
13312
13286
|
const B = me[R.paramName] ?? "";
|
|
@@ -13328,7 +13302,7 @@ const nn = ({
|
|
|
13328
13302
|
}, Qe = async (b) => {
|
|
13329
13303
|
b.preventDefault();
|
|
13330
13304
|
for (const V of K)
|
|
13331
|
-
if (qt(
|
|
13305
|
+
if (qt(ee[V])) {
|
|
13332
13306
|
const P = ht[V], p = (P != null && P.translationKey ? g(`fields.${P.translationKey}`) : void 0) || (P == null ? void 0 : P.label) || V;
|
|
13333
13307
|
E(g("validation.fieldRequired", { field: p }));
|
|
13334
13308
|
return;
|
|
@@ -13337,7 +13311,7 @@ const nn = ({
|
|
|
13337
13311
|
}, He = (b, V, P, p, h) => {
|
|
13338
13312
|
const z = ht[b];
|
|
13339
13313
|
if (!z) return null;
|
|
13340
|
-
const R = K.includes(b), B = Q[b], d =
|
|
13314
|
+
const R = K.includes(b), B = Q[b], d = ie(P, g) || (z.translationKey ? g(`fields.${z.translationKey}`) : void 0) || z.label, I = b in $, x = V ?? b, m = h ? h !== "placeholder" : O, v = m ? d : void 0;
|
|
13341
13315
|
switch (z.type) {
|
|
13342
13316
|
case "select":
|
|
13343
13317
|
if (b === "countryResidence" || b === "addressCountry") {
|
|
@@ -13347,10 +13321,10 @@ const nn = ({
|
|
|
13347
13321
|
{
|
|
13348
13322
|
required: R,
|
|
13349
13323
|
label: v,
|
|
13350
|
-
value:
|
|
13324
|
+
value: ee[b] || "",
|
|
13351
13325
|
onChange: (ue) => J(b, ue),
|
|
13352
13326
|
options: [{ value: "", label: m ? g("placeholders.selectCountry") : d }, ...w],
|
|
13353
|
-
disabled:
|
|
13327
|
+
disabled: se,
|
|
13354
13328
|
readOnly: I,
|
|
13355
13329
|
error: B
|
|
13356
13330
|
},
|
|
@@ -13360,13 +13334,13 @@ const nn = ({
|
|
|
13360
13334
|
return null;
|
|
13361
13335
|
case "date":
|
|
13362
13336
|
return /* @__PURE__ */ i(
|
|
13363
|
-
|
|
13337
|
+
Ce,
|
|
13364
13338
|
{
|
|
13365
13339
|
required: R,
|
|
13366
13340
|
type: "date",
|
|
13367
13341
|
label: v,
|
|
13368
13342
|
placeholder: m ? void 0 : d,
|
|
13369
|
-
value:
|
|
13343
|
+
value: ee[b] || "",
|
|
13370
13344
|
onChange: (w) => J(b, w.target.value),
|
|
13371
13345
|
readOnly: I,
|
|
13372
13346
|
error: B
|
|
@@ -13375,13 +13349,13 @@ const nn = ({
|
|
|
13375
13349
|
);
|
|
13376
13350
|
case "email":
|
|
13377
13351
|
return /* @__PURE__ */ i(
|
|
13378
|
-
|
|
13352
|
+
Ce,
|
|
13379
13353
|
{
|
|
13380
13354
|
required: R,
|
|
13381
13355
|
type: "email",
|
|
13382
13356
|
label: v,
|
|
13383
13357
|
placeholder: m ? void 0 : d,
|
|
13384
|
-
value:
|
|
13358
|
+
value: ee[b] || "",
|
|
13385
13359
|
onChange: (w) => J(b, w.target.value),
|
|
13386
13360
|
readOnly: I,
|
|
13387
13361
|
error: B
|
|
@@ -13390,13 +13364,13 @@ const nn = ({
|
|
|
13390
13364
|
);
|
|
13391
13365
|
case "tel":
|
|
13392
13366
|
return /* @__PURE__ */ i(
|
|
13393
|
-
|
|
13367
|
+
Ce,
|
|
13394
13368
|
{
|
|
13395
13369
|
required: R,
|
|
13396
13370
|
type: "tel",
|
|
13397
13371
|
label: v,
|
|
13398
13372
|
placeholder: m ? void 0 : d,
|
|
13399
|
-
value:
|
|
13373
|
+
value: ee[b] || "",
|
|
13400
13374
|
onChange: (w) => J(b, w.target.value),
|
|
13401
13375
|
readOnly: I,
|
|
13402
13376
|
error: B
|
|
@@ -13405,13 +13379,13 @@ const nn = ({
|
|
|
13405
13379
|
);
|
|
13406
13380
|
default:
|
|
13407
13381
|
return /* @__PURE__ */ i(
|
|
13408
|
-
|
|
13382
|
+
Ce,
|
|
13409
13383
|
{
|
|
13410
13384
|
required: R,
|
|
13411
13385
|
type: "text",
|
|
13412
13386
|
label: v,
|
|
13413
13387
|
placeholder: m ? void 0 : d,
|
|
13414
|
-
value:
|
|
13388
|
+
value: ee[b] || "",
|
|
13415
13389
|
onChange: (w) => J(b, w.target.value),
|
|
13416
13390
|
readOnly: I,
|
|
13417
13391
|
error: B
|
|
@@ -13425,12 +13399,12 @@ const nn = ({
|
|
|
13425
13399
|
"p",
|
|
13426
13400
|
{
|
|
13427
13401
|
style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
13428
|
-
dangerouslySetInnerHTML: { __html:
|
|
13402
|
+
dangerouslySetInnerHTML: { __html: ie(b.displayText, g) || ie(b.label, g) || "" }
|
|
13429
13403
|
},
|
|
13430
13404
|
`custom-${V}`
|
|
13431
13405
|
);
|
|
13432
13406
|
if (b.customType === "html")
|
|
13433
|
-
return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html:
|
|
13407
|
+
return /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: ie(b.label, g) || "" } }, `custom-${V}`);
|
|
13434
13408
|
if (b.customType === "br")
|
|
13435
13409
|
return /* @__PURE__ */ i("div", { style: { height: "12px" } }, `custom-${V}`);
|
|
13436
13410
|
if (b.customType === "link")
|
|
@@ -13441,11 +13415,11 @@ const nn = ({
|
|
|
13441
13415
|
target: "_blank",
|
|
13442
13416
|
rel: "noopener noreferrer",
|
|
13443
13417
|
style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
|
|
13444
|
-
children:
|
|
13418
|
+
children: ie(b.displayText, g) || ie(b.label, g) || b.linkText || b.linkUrl || ""
|
|
13445
13419
|
}
|
|
13446
13420
|
) }, `custom-${V}`);
|
|
13447
13421
|
if (!b.paramName) return null;
|
|
13448
|
-
const P = Q[b.paramName], p =
|
|
13422
|
+
const P = Q[b.paramName], p = ie(b.displayText, g) || ie(b.label, g) || b.paramName, h = b.labelMode ? b.labelMode !== "placeholder" : O;
|
|
13449
13423
|
if (b.customType === "checkbox") {
|
|
13450
13424
|
const z = me[b.paramName] === "true";
|
|
13451
13425
|
return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -13475,7 +13449,7 @@ const nn = ({
|
|
|
13475
13449
|
] }, `custom-${V}`);
|
|
13476
13450
|
}
|
|
13477
13451
|
return /* @__PURE__ */ i(
|
|
13478
|
-
|
|
13452
|
+
Ce,
|
|
13479
13453
|
{
|
|
13480
13454
|
type: "text",
|
|
13481
13455
|
label: h ? `${p}${b.required ? " *" : ""}` : void 0,
|
|
@@ -13488,7 +13462,7 @@ const nn = ({
|
|
|
13488
13462
|
`custom-${V}`
|
|
13489
13463
|
);
|
|
13490
13464
|
}, De = (b) => {
|
|
13491
|
-
const V =
|
|
13465
|
+
const V = Ne(b);
|
|
13492
13466
|
return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
|
|
13493
13467
|
b.conditionalOn && /* @__PURE__ */ l(
|
|
13494
13468
|
"div",
|
|
@@ -13505,7 +13479,7 @@ const nn = ({
|
|
|
13505
13479
|
onChange: (P) => ke(b.conditionalOn, P ? "true" : "false")
|
|
13506
13480
|
}
|
|
13507
13481
|
),
|
|
13508
|
-
/* @__PURE__ */ i("span", { style: { fontSize: "14px", fontWeight: 500 }, children:
|
|
13482
|
+
/* @__PURE__ */ i("span", { style: { fontSize: "14px", fontWeight: 500 }, children: ie(b.conditionalLabel, g) || b.conditionalOn })
|
|
13509
13483
|
]
|
|
13510
13484
|
}
|
|
13511
13485
|
),
|
|
@@ -13515,20 +13489,20 @@ const nn = ({
|
|
|
13515
13489
|
}) })
|
|
13516
13490
|
] });
|
|
13517
13491
|
};
|
|
13518
|
-
if (!s ||
|
|
13519
|
-
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(
|
|
13520
|
-
/* @__PURE__ */ i(
|
|
13492
|
+
if (!s || se)
|
|
13493
|
+
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
13494
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
13521
13495
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: g("common.loadingForm") })
|
|
13522
13496
|
] }) }) });
|
|
13523
13497
|
if (C) {
|
|
13524
|
-
const b = C[
|
|
13498
|
+
const b = C[ce] ?? C[0], V = st === -1, P = _e === -1, p = C.length, h = Ne(b), z = Se(b), R = Object.values(Q), B = !h && !!b.conditionalOn && b.conditionalMode === "block", d = H || u || B || z;
|
|
13525
13499
|
let I;
|
|
13526
|
-
return B || z ? I = g("common.blocked") : P ? I = b.conditionalOn && !h ? g("common.skipAndSubmit") : g("common.submit") : I = b.conditionalOn && !h ? g("common.skip") : g("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ l(
|
|
13500
|
+
return B || z ? I = g("common.blocked") : P ? I = b.conditionalOn && !h ? g("common.skipAndSubmit") : g("common.submit") : I = b.conditionalOn && !h ? g("common.skip") : g("common.next"), /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ l(ne, { children: [
|
|
13527
13501
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i(Tt, { title: (s == null ? void 0 : s.title) || g("createCompany.title") }) }),
|
|
13528
|
-
/* @__PURE__ */ l(
|
|
13502
|
+
/* @__PURE__ */ l(oe, { children: [
|
|
13529
13503
|
(b.title || b.subtitle) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
13530
|
-
b.title && /* @__PURE__ */ i("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
13531
|
-
b.subtitle && /* @__PURE__ */ i("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
13504
|
+
b.title && /* @__PURE__ */ i("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: ie(b.title, g) }),
|
|
13505
|
+
b.subtitle && /* @__PURE__ */ i("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: ie(b.subtitle, g) })
|
|
13532
13506
|
] }),
|
|
13533
13507
|
(A || R.length > 0) && /* @__PURE__ */ l("div", { className: "mb-4 p-3 rounded-lg", style: {
|
|
13534
13508
|
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
@@ -13549,13 +13523,13 @@ const nn = ({
|
|
|
13549
13523
|
height: "0.375rem",
|
|
13550
13524
|
borderRadius: "9999px",
|
|
13551
13525
|
transition: "all 150ms",
|
|
13552
|
-
...m ===
|
|
13526
|
+
...m === ce ? { flex: "1 1 0%", backgroundColor: "var(--metakyc-primary, #2563eb)", opacity: 0.3 } : m < ce ? { width: "2rem", backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { width: "2rem", backgroundColor: "#e5e7eb", opacity: 0.3 }
|
|
13553
13527
|
}
|
|
13554
13528
|
},
|
|
13555
13529
|
m
|
|
13556
13530
|
)),
|
|
13557
13531
|
/* @__PURE__ */ l("span", { style: { fontSize: "0.75rem", color: "var(--metakyc-text-muted, #9ca3af)", flexShrink: 0 }, children: [
|
|
13558
|
-
|
|
13532
|
+
ce + 1,
|
|
13559
13533
|
" / ",
|
|
13560
13534
|
p
|
|
13561
13535
|
] })
|
|
@@ -13565,26 +13539,26 @@ const nn = ({
|
|
|
13565
13539
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
13566
13540
|
/* @__PURE__ */ l("div", { children: [
|
|
13567
13541
|
!V && /* @__PURE__ */ i(
|
|
13568
|
-
|
|
13542
|
+
le,
|
|
13569
13543
|
{
|
|
13570
13544
|
type: "button",
|
|
13571
13545
|
variant: "outline",
|
|
13572
13546
|
onClick: () => {
|
|
13573
|
-
Y(st),
|
|
13547
|
+
Y(st), re({});
|
|
13574
13548
|
},
|
|
13575
13549
|
disabled: H || u,
|
|
13576
13550
|
children: g("common.previous")
|
|
13577
13551
|
}
|
|
13578
13552
|
),
|
|
13579
|
-
V && r && /* @__PURE__ */ i(
|
|
13553
|
+
V && r && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: r, disabled: H || u, children: "Cancel" })
|
|
13580
13554
|
] }),
|
|
13581
|
-
/* @__PURE__ */ i(
|
|
13555
|
+
/* @__PURE__ */ i(le, { type: "button", isLoading: H || u, disabled: d, onClick: P ? ze : Ye, children: I })
|
|
13582
13556
|
] })
|
|
13583
13557
|
] }) });
|
|
13584
13558
|
}
|
|
13585
|
-
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i("form", { onSubmit: Qe, children: /* @__PURE__ */ l(
|
|
13559
|
+
return /* @__PURE__ */ i("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i("form", { onSubmit: Qe, children: /* @__PURE__ */ l(ne, { children: [
|
|
13586
13560
|
/* @__PURE__ */ i(Le, { children: /* @__PURE__ */ i(Tt, { title: (s == null ? void 0 : s.title) || g("createCompany.title") }) }),
|
|
13587
|
-
/* @__PURE__ */ l(
|
|
13561
|
+
/* @__PURE__ */ l(oe, { children: [
|
|
13588
13562
|
A && /* @__PURE__ */ i("div", { className: "mb-6 p-4 rounded-lg", style: {
|
|
13589
13563
|
backgroundColor: "var(--metakyc-danger-bg, color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent))",
|
|
13590
13564
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 30%, transparent)"
|
|
@@ -13596,8 +13570,8 @@ const nn = ({
|
|
|
13596
13570
|
/* @__PURE__ */ i("div", { className: "metakyc-form-grid", children: W.map((b) => /* @__PURE__ */ i("div", { style: { gridColumn: "span 4 / span 4" }, children: He(b) }, b)) })
|
|
13597
13571
|
] }),
|
|
13598
13572
|
/* @__PURE__ */ l(Ee, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
13599
|
-
r && /* @__PURE__ */ i(
|
|
13600
|
-
/* @__PURE__ */ i(
|
|
13573
|
+
r && /* @__PURE__ */ i(le, { type: "button", variant: "outline", onClick: r, disabled: H || u, children: "Cancel" }),
|
|
13574
|
+
/* @__PURE__ */ i(le, { type: "submit", isLoading: H || u, children: g("createCompany.registerCompany") })
|
|
13601
13575
|
] })
|
|
13602
13576
|
] }) }) });
|
|
13603
13577
|
}, on = "JVBERi0xLjAKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA2MTIgNzkyXSA+PgplbmRvYmoKeHJlZgowIDQKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDA5IDAwMDAwIG4gCjAwMDAwMDAwNTggMDAwMDAgbiAKMDAwMDAwMDExNSAwMMDAwIG4gCnRyYWlsZXIKPDwgL1NpemUgNCAvUm9vdCAxIDAgUiA+PgpzdGFydHhyZWYKMjA2CiUlRU9G", sn = ({
|
|
@@ -13607,7 +13581,7 @@ const nn = ({
|
|
|
13607
13581
|
onWorkflowChange: r,
|
|
13608
13582
|
className: n
|
|
13609
13583
|
}) => {
|
|
13610
|
-
const { t: o } = Ie(), { applicantService: s } =
|
|
13584
|
+
const { t: o } = Ie(), { applicantService: s } = Te(), {
|
|
13611
13585
|
progress: c,
|
|
13612
13586
|
currentStep: u,
|
|
13613
13587
|
steps: g,
|
|
@@ -13619,20 +13593,20 @@ const nn = ({
|
|
|
13619
13593
|
refreshProgress: O
|
|
13620
13594
|
} = na(e), [C, K] = he.useState(!1), [W, F] = he.useState(null), M = he.useRef(null), q = At(), {
|
|
13621
13595
|
questionnaireService: G,
|
|
13622
|
-
overviewService:
|
|
13596
|
+
overviewService: se,
|
|
13623
13597
|
riskScoringService: k,
|
|
13624
13598
|
appropriatenessTestService: L,
|
|
13625
13599
|
uploadDocumentService: j
|
|
13626
|
-
} =
|
|
13600
|
+
} = Te();
|
|
13627
13601
|
he.useEffect(() => {
|
|
13628
13602
|
const Y = q.current;
|
|
13629
13603
|
if (!Y) return;
|
|
13630
|
-
const Q = u ? u.title || u.name ||
|
|
13604
|
+
const Q = u ? u.title || u.name || ae[u.action] : null;
|
|
13631
13605
|
Y.updateSdkState({
|
|
13632
13606
|
currentStep: Q,
|
|
13633
13607
|
stepOrder: (u == null ? void 0 : u.order) ?? null,
|
|
13634
|
-
stepAction: u ?
|
|
13635
|
-
workflowStatus: (c == null ? void 0 : c.status) != null ?
|
|
13608
|
+
stepAction: u ? ae[u.action] : null,
|
|
13609
|
+
workflowStatus: (c == null ? void 0 : c.status) != null ? qe[c.status] : null,
|
|
13636
13610
|
totalSteps: g.length
|
|
13637
13611
|
});
|
|
13638
13612
|
}, [q, u, c == null ? void 0 : c.status, g.length]), he.useEffect(() => {
|
|
@@ -13666,16 +13640,16 @@ const nn = ({
|
|
|
13666
13640
|
}), () => Y.unregisterAction("workflow-back");
|
|
13667
13641
|
}
|
|
13668
13642
|
}, [q, S, $]);
|
|
13669
|
-
const
|
|
13643
|
+
const ee = he.useCallback(async () => {
|
|
13670
13644
|
if (!u || !e) return;
|
|
13671
13645
|
const Y = u.action;
|
|
13672
13646
|
try {
|
|
13673
13647
|
switch (Y) {
|
|
13674
|
-
case
|
|
13675
|
-
_.info("[DevTools] Skipping Overview step"), await
|
|
13648
|
+
case ae.Overview: {
|
|
13649
|
+
_.info("[DevTools] Skipping Overview step"), await se.passOverview(e);
|
|
13676
13650
|
break;
|
|
13677
13651
|
}
|
|
13678
|
-
case
|
|
13652
|
+
case ae.Questionaries: {
|
|
13679
13653
|
_.info("[DevTools] Skipping Questionnaire step");
|
|
13680
13654
|
const Q = await G.getQuestionnaire(e), A = Q.questionGroups.flatMap((E) => E.questions ?? []).map((E) => {
|
|
13681
13655
|
var ye, fe;
|
|
@@ -13689,9 +13663,9 @@ const nn = ({
|
|
|
13689
13663
|
});
|
|
13690
13664
|
break;
|
|
13691
13665
|
}
|
|
13692
|
-
case
|
|
13666
|
+
case ae.RiskScoring: {
|
|
13693
13667
|
_.info("[DevTools] Skipping Risk Scoring step");
|
|
13694
|
-
const
|
|
13668
|
+
const re = (await k.getRiskCriterias(e)).map((A) => {
|
|
13695
13669
|
var E;
|
|
13696
13670
|
return {
|
|
13697
13671
|
riskCriteriaId: A.id,
|
|
@@ -13700,13 +13674,13 @@ const nn = ({
|
|
|
13700
13674
|
});
|
|
13701
13675
|
await k.submitRiskScoring({
|
|
13702
13676
|
applicantId: e,
|
|
13703
|
-
criteriaValueInputs:
|
|
13677
|
+
criteriaValueInputs: re
|
|
13704
13678
|
});
|
|
13705
13679
|
break;
|
|
13706
13680
|
}
|
|
13707
|
-
case
|
|
13681
|
+
case ae.AppropriatenessTest: {
|
|
13708
13682
|
_.info("[DevTools] Skipping Appropriateness Test step");
|
|
13709
|
-
const Q = await L.getAppropriatenessTest(e),
|
|
13683
|
+
const Q = await L.getAppropriatenessTest(e), re = Q.appropriatenessQuestions.map((A) => {
|
|
13710
13684
|
var E;
|
|
13711
13685
|
return {
|
|
13712
13686
|
appropriatenessQuestionId: A.id,
|
|
@@ -13716,13 +13690,13 @@ const nn = ({
|
|
|
13716
13690
|
await L.fillAppropriatenessTest({
|
|
13717
13691
|
applicantId: e,
|
|
13718
13692
|
appropriatenessTestId: Q.id,
|
|
13719
|
-
appropriatenessQuestionResults:
|
|
13693
|
+
appropriatenessQuestionResults: re
|
|
13720
13694
|
});
|
|
13721
13695
|
break;
|
|
13722
13696
|
}
|
|
13723
|
-
case
|
|
13697
|
+
case ae.UploadDocument: {
|
|
13724
13698
|
_.info("[DevTools] Skipping Upload Document step");
|
|
13725
|
-
const Q = await j.getUploadDocument(e),
|
|
13699
|
+
const Q = await j.getUploadDocument(e), re = Q.uploadDocumentFiles.map((A) => ({
|
|
13726
13700
|
uploadDocumentFileId: A.id,
|
|
13727
13701
|
valueList: [{
|
|
13728
13702
|
fileName: "dev-placeholder.pdf",
|
|
@@ -13732,14 +13706,14 @@ const nn = ({
|
|
|
13732
13706
|
await j.fillUploadDocument({
|
|
13733
13707
|
applicantId: e,
|
|
13734
13708
|
uploadDocumentId: Q.id,
|
|
13735
|
-
uploadDocumentResults:
|
|
13709
|
+
uploadDocumentResults: re
|
|
13736
13710
|
});
|
|
13737
13711
|
break;
|
|
13738
13712
|
}
|
|
13739
|
-
case
|
|
13740
|
-
case
|
|
13713
|
+
case ae.InvestorCategorization:
|
|
13714
|
+
case ae.AdditionalData: {
|
|
13741
13715
|
_.info("[DevTools] Skipping Investor Categorization step");
|
|
13742
|
-
const
|
|
13716
|
+
const re = (await k.getRiskCriterias(e)).map((A) => {
|
|
13743
13717
|
var E;
|
|
13744
13718
|
return {
|
|
13745
13719
|
riskCriteriaId: A.id,
|
|
@@ -13748,12 +13722,12 @@ const nn = ({
|
|
|
13748
13722
|
});
|
|
13749
13723
|
await k.submitRiskScoring({
|
|
13750
13724
|
applicantId: e,
|
|
13751
|
-
criteriaValueInputs:
|
|
13725
|
+
criteriaValueInputs: re
|
|
13752
13726
|
});
|
|
13753
13727
|
break;
|
|
13754
13728
|
}
|
|
13755
13729
|
default:
|
|
13756
|
-
_.warn(`[DevTools] Cannot skip step type: ${
|
|
13730
|
+
_.warn(`[DevTools] Cannot skip step type: ${ae[Y]}`);
|
|
13757
13731
|
return;
|
|
13758
13732
|
}
|
|
13759
13733
|
await O();
|
|
@@ -13765,7 +13739,7 @@ const nn = ({
|
|
|
13765
13739
|
e,
|
|
13766
13740
|
O,
|
|
13767
13741
|
G,
|
|
13768
|
-
|
|
13742
|
+
se,
|
|
13769
13743
|
k,
|
|
13770
13744
|
L,
|
|
13771
13745
|
j
|
|
@@ -13774,18 +13748,18 @@ const nn = ({
|
|
|
13774
13748
|
const Y = q.current;
|
|
13775
13749
|
if (!Y || !u) return;
|
|
13776
13750
|
const Q = u.action;
|
|
13777
|
-
if (!(Q !==
|
|
13751
|
+
if (!(Q !== ae.IdentitySdk && Q !== ae.ManualReview)) {
|
|
13778
13752
|
Y.unregisterAction("workflow-skip");
|
|
13779
13753
|
return;
|
|
13780
13754
|
}
|
|
13781
13755
|
return Y.registerAction({
|
|
13782
13756
|
id: "workflow-skip",
|
|
13783
|
-
label: `Skip: ${u.title || u.name ||
|
|
13757
|
+
label: `Skip: ${u.title || u.name || ae[Q]}`,
|
|
13784
13758
|
icon: "⏭️",
|
|
13785
13759
|
group: "workflow",
|
|
13786
|
-
handler:
|
|
13760
|
+
handler: ee
|
|
13787
13761
|
}), () => Y.unregisterAction("workflow-skip");
|
|
13788
|
-
}, [q, u,
|
|
13762
|
+
}, [q, u, ee]), he.useEffect(() => {
|
|
13789
13763
|
T && a && a(T);
|
|
13790
13764
|
}, [T, a]), he.useEffect(() => {
|
|
13791
13765
|
c != null && c.workflowResult && t && t(c.workflowResult);
|
|
@@ -13806,8 +13780,8 @@ const nn = ({
|
|
|
13806
13780
|
_.info(`[SDK] Duplicated → new applicantId=${Q.applicantId}`), r && r(Q.applicantId);
|
|
13807
13781
|
} catch (Q) {
|
|
13808
13782
|
if (Y) return;
|
|
13809
|
-
const
|
|
13810
|
-
_.warn(`[SDK] Duplicate applicant failed: ${
|
|
13783
|
+
const re = (Q == null ? void 0 : Q.message) || "Failed to continue with new workflow";
|
|
13784
|
+
_.warn(`[SDK] Duplicate applicant failed: ${re}`), F(re);
|
|
13811
13785
|
} finally {
|
|
13812
13786
|
Y || K(!1);
|
|
13813
13787
|
}
|
|
@@ -13815,24 +13789,24 @@ const nn = ({
|
|
|
13815
13789
|
Y = !0;
|
|
13816
13790
|
};
|
|
13817
13791
|
}, [f, y, e, s, r]), D || C || !c)
|
|
13818
|
-
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
13819
|
-
/* @__PURE__ */ i(
|
|
13792
|
+
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
13793
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
13820
13794
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o("workflow.loadingWorkflow") })
|
|
13821
13795
|
] }) }) });
|
|
13822
13796
|
if (T)
|
|
13823
|
-
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
13797
|
+
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { className: "text-center py-8", children: [
|
|
13824
13798
|
/* @__PURE__ */ i("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: o("workflow.errorOccurred") }),
|
|
13825
13799
|
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: T.message })
|
|
13826
13800
|
] }) }) }) });
|
|
13827
13801
|
if (f)
|
|
13828
|
-
return W ? /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
13802
|
+
return W ? /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { className: "text-center py-8", children: [
|
|
13829
13803
|
/* @__PURE__ */ i("p", { className: "text-lg mb-2", style: { color: "var(--metakyc-danger, #ef4444)" }, children: o("workflow.errorOccurred") }),
|
|
13830
13804
|
/* @__PURE__ */ i("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: W })
|
|
13831
|
-
] }) }) }) }) : /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
13832
|
-
/* @__PURE__ */ i(
|
|
13805
|
+
] }) }) }) }) : /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
13806
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
13833
13807
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o("workflow.loadingWorkflow") })
|
|
13834
13808
|
] }) }) });
|
|
13835
|
-
if (c.status ===
|
|
13809
|
+
if (c.status === qe.Finished || c.status === qe.OnHold)
|
|
13836
13810
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
13837
13811
|
yi,
|
|
13838
13812
|
{
|
|
@@ -13847,35 +13821,35 @@ const nn = ({
|
|
|
13847
13821
|
}
|
|
13848
13822
|
) });
|
|
13849
13823
|
if (!u)
|
|
13850
|
-
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
13851
|
-
/* @__PURE__ */ i(
|
|
13852
|
-
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: c.status ===
|
|
13824
|
+
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
13825
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
13826
|
+
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: c.status === qe.IdentityPending ? o("workflow.loadingIdentityVerification") : o("workflow.loadingCurrentStep") })
|
|
13853
13827
|
] }) }) });
|
|
13854
13828
|
const me = (Y) => {
|
|
13855
13829
|
switch (Y) {
|
|
13856
|
-
case
|
|
13830
|
+
case ae.Overview:
|
|
13857
13831
|
return o("stepNames.overview");
|
|
13858
|
-
case
|
|
13832
|
+
case ae.Questionaries:
|
|
13859
13833
|
return o("stepNames.questionnaire");
|
|
13860
|
-
case
|
|
13834
|
+
case ae.UploadDocument:
|
|
13861
13835
|
return o("stepNames.documents");
|
|
13862
|
-
case
|
|
13836
|
+
case ae.IdentitySdk:
|
|
13863
13837
|
return o("stepNames.identity");
|
|
13864
|
-
case
|
|
13838
|
+
case ae.RiskScoring:
|
|
13865
13839
|
return o("stepNames.riskAssessment");
|
|
13866
|
-
case
|
|
13840
|
+
case ae.InvestorCategorization:
|
|
13867
13841
|
return o("stepNames.investorCategorization");
|
|
13868
|
-
case
|
|
13842
|
+
case ae.AppropriatenessTest:
|
|
13869
13843
|
return o("stepNames.appropriatenessTest");
|
|
13870
|
-
case
|
|
13844
|
+
case ae.AdditionalData:
|
|
13871
13845
|
return o("stepNames.additionalData");
|
|
13872
|
-
case
|
|
13846
|
+
case ae.ManualReview:
|
|
13873
13847
|
return o("stepNames.review");
|
|
13874
13848
|
default:
|
|
13875
13849
|
return "";
|
|
13876
13850
|
}
|
|
13877
|
-
},
|
|
13878
|
-
const Y = g.filter((H) => H.visibility !== !1), Q = Y.findIndex((H) => H.order === u.order),
|
|
13851
|
+
}, Re = () => {
|
|
13852
|
+
const Y = g.filter((H) => H.visibility !== !1), Q = Y.findIndex((H) => H.order === u.order), re = Q >= 0 ? Q + 1 : 1, A = Y.length, E = A > 1 ? (Q + 1) / A * 100 : 100;
|
|
13879
13853
|
return /* @__PURE__ */ l("div", { className: "metakyc-progress-wrapper", style: {
|
|
13880
13854
|
marginBottom: "24px",
|
|
13881
13855
|
backgroundColor: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
|
|
@@ -13886,7 +13860,7 @@ const nn = ({
|
|
|
13886
13860
|
}, children: [
|
|
13887
13861
|
/* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px", gap: "8px", flexWrap: "wrap" }, children: [
|
|
13888
13862
|
/* @__PURE__ */ i(Tt, {}),
|
|
13889
|
-
/* @__PURE__ */ i(Ai, { variant: c.status === 1 ? "info" : "success", children: o("common.stepXofY", { current:
|
|
13863
|
+
/* @__PURE__ */ i(Ai, { variant: c.status === 1 ? "info" : "success", children: o("common.stepXofY", { current: re, total: A }) })
|
|
13890
13864
|
] }),
|
|
13891
13865
|
/* @__PURE__ */ l("div", { style: { position: "relative", height: "4px", borderRadius: "999px", overflow: "hidden", marginBottom: "16px" }, children: [
|
|
13892
13866
|
/* @__PURE__ */ i("div", { style: { position: "absolute", inset: 0, backgroundColor: "var(--metakyc-border, #e5e7eb)", opacity: 0.3 } }),
|
|
@@ -13911,31 +13885,31 @@ const nn = ({
|
|
|
13911
13885
|
}
|
|
13912
13886
|
)
|
|
13913
13887
|
] });
|
|
13914
|
-
},
|
|
13915
|
-
const
|
|
13888
|
+
}, ce = () => {
|
|
13889
|
+
const re = g.filter((E) => E.visibility !== !1).findIndex((E) => E.order === u.order) <= 0, A = {
|
|
13916
13890
|
applicantId: e,
|
|
13917
13891
|
onComplete: async () => {
|
|
13918
13892
|
await O();
|
|
13919
13893
|
},
|
|
13920
|
-
onBack:
|
|
13894
|
+
onBack: re ? void 0 : S
|
|
13921
13895
|
};
|
|
13922
13896
|
switch (u.action) {
|
|
13923
|
-
case
|
|
13897
|
+
case ae.Questionaries:
|
|
13924
13898
|
return /* @__PURE__ */ i(Aa, { ...A });
|
|
13925
|
-
case
|
|
13899
|
+
case ae.UploadDocument:
|
|
13926
13900
|
return /* @__PURE__ */ i(La, { ...A });
|
|
13927
|
-
case
|
|
13901
|
+
case ae.Overview:
|
|
13928
13902
|
return /* @__PURE__ */ i(Ea, { ...A });
|
|
13929
|
-
case
|
|
13903
|
+
case ae.IdentitySdk:
|
|
13930
13904
|
return /* @__PURE__ */ i(Ha, { ...A });
|
|
13931
|
-
case
|
|
13905
|
+
case ae.RiskScoring:
|
|
13932
13906
|
return /* @__PURE__ */ i(Va, { ...A });
|
|
13933
|
-
case
|
|
13934
|
-
case
|
|
13907
|
+
case ae.AdditionalData:
|
|
13908
|
+
case ae.InvestorCategorization:
|
|
13935
13909
|
return /* @__PURE__ */ i(qa, { ...A });
|
|
13936
|
-
case
|
|
13910
|
+
case ae.AppropriatenessTest:
|
|
13937
13911
|
return /* @__PURE__ */ i(Ua, { ...A });
|
|
13938
|
-
case
|
|
13912
|
+
case ae.ManualReview:
|
|
13939
13913
|
return /* @__PURE__ */ i(
|
|
13940
13914
|
yi,
|
|
13941
13915
|
{
|
|
@@ -13946,8 +13920,8 @@ const nn = ({
|
|
|
13946
13920
|
}
|
|
13947
13921
|
);
|
|
13948
13922
|
default:
|
|
13949
|
-
return /* @__PURE__ */ i(
|
|
13950
|
-
/* @__PURE__ */ i("div", { className: "mb-4", children: /* @__PURE__ */ i(
|
|
13923
|
+
return /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { className: "py-12 text-center", children: [
|
|
13924
|
+
/* @__PURE__ */ i("div", { className: "mb-4", children: /* @__PURE__ */ i(Ke, {}) }),
|
|
13951
13925
|
/* @__PURE__ */ l("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
13952
13926
|
o("workflow.processingStep"),
|
|
13953
13927
|
" ",
|
|
@@ -13956,14 +13930,14 @@ const nn = ({
|
|
|
13956
13930
|
/* @__PURE__ */ l("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
13957
13931
|
o("workflow.actionType"),
|
|
13958
13932
|
" ",
|
|
13959
|
-
|
|
13933
|
+
ae[u.action]
|
|
13960
13934
|
] })
|
|
13961
13935
|
] }) });
|
|
13962
13936
|
}
|
|
13963
13937
|
};
|
|
13964
13938
|
return /* @__PURE__ */ l("div", { className: `metakyc-sdk ${n || ""}`, children: [
|
|
13965
|
-
|
|
13966
|
-
|
|
13939
|
+
Re(),
|
|
13940
|
+
ce()
|
|
13967
13941
|
] });
|
|
13968
13942
|
}, ln = he.forwardRef(
|
|
13969
13943
|
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: a }, r) => {
|
|
@@ -14051,7 +14025,7 @@ const nn = ({
|
|
|
14051
14025
|
);
|
|
14052
14026
|
}
|
|
14053
14027
|
), Ln = (e) => {
|
|
14054
|
-
const { config: t } =
|
|
14028
|
+
const { config: t } = Te();
|
|
14055
14029
|
return t.debug || t.logLevel && t.logLevel !== "none" ? /* @__PURE__ */ l(_a, { children: [
|
|
14056
14030
|
/* @__PURE__ */ i(bi, { ...e }),
|
|
14057
14031
|
/* @__PURE__ */ i(Ga, {})
|
|
@@ -14072,7 +14046,7 @@ const bi = ({
|
|
|
14072
14046
|
className: n
|
|
14073
14047
|
}) => {
|
|
14074
14048
|
var W, F;
|
|
14075
|
-
const { t: o } = Ie(), { config: s } =
|
|
14049
|
+
const { t: o } = Ie(), { config: s } = Te(), {
|
|
14076
14050
|
phase: c,
|
|
14077
14051
|
applicantId: u,
|
|
14078
14052
|
isCompany: g,
|
|
@@ -14102,12 +14076,12 @@ const bi = ({
|
|
|
14102
14076
|
r == null || r(M), T(M);
|
|
14103
14077
|
}, [r, T]);
|
|
14104
14078
|
if (c === "loading" || D)
|
|
14105
|
-
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
14106
|
-
/* @__PURE__ */ i(
|
|
14079
|
+
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ l(oe, { children: [
|
|
14080
|
+
/* @__PURE__ */ i(Ke, { className: "my-8" }),
|
|
14107
14081
|
/* @__PURE__ */ i("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o("workflow.loadingWorkflow") })
|
|
14108
14082
|
] }) }) });
|
|
14109
14083
|
if (c === "error")
|
|
14110
|
-
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
14084
|
+
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ l("div", { className: "text-center py-8", children: [
|
|
14111
14085
|
/* @__PURE__ */ i("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: o("workflow.errorOccurred") }),
|
|
14112
14086
|
/* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: (f == null ? void 0 : f.message) || "An unexpected error occurred." })
|
|
14113
14087
|
] }) }) }) });
|
|
@@ -14139,7 +14113,7 @@ const bi = ({
|
|
|
14139
14113
|
onWorkflowChange: S,
|
|
14140
14114
|
className: ""
|
|
14141
14115
|
}
|
|
14142
|
-
) }) : /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(
|
|
14116
|
+
) }) : /* @__PURE__ */ i("div", { className: `metakyc-sdk ${n || ""}`, children: /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(oe, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: /* @__PURE__ */ i("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Unable to determine SDK state. Ensure the session token contains a valid ExternalRefId." }) }) }) }) });
|
|
14143
14117
|
};
|
|
14144
14118
|
function En(e) {
|
|
14145
14119
|
return ot.object({
|
|
@@ -14192,7 +14166,7 @@ const jn = ot.any();
|
|
|
14192
14166
|
export {
|
|
14193
14167
|
ei as ALLOWED_LANGUAGES,
|
|
14194
14168
|
Bi as ApplicantProgressOnHoldReason,
|
|
14195
|
-
|
|
14169
|
+
qe as ApplicantProgressStatus,
|
|
14196
14170
|
or as ApplicantService,
|
|
14197
14171
|
Ui as ApplicantStatus,
|
|
14198
14172
|
Yi as AppropriatenessQuestionType,
|
|
@@ -14200,10 +14174,10 @@ export {
|
|
|
14200
14174
|
Ua as AppropriatenessTestStep,
|
|
14201
14175
|
Ai as Badge,
|
|
14202
14176
|
pr as BaseInformationService,
|
|
14203
|
-
|
|
14177
|
+
le as Button,
|
|
14204
14178
|
ht as COMPANY_FIELD_METADATA,
|
|
14205
|
-
|
|
14206
|
-
|
|
14179
|
+
ne as Card,
|
|
14180
|
+
oe as CardContent,
|
|
14207
14181
|
Ee as CardFooter,
|
|
14208
14182
|
Le as CardHeader,
|
|
14209
14183
|
Xe as Checkbox,
|
|
@@ -14227,10 +14201,10 @@ export {
|
|
|
14227
14201
|
mr as IdentityService,
|
|
14228
14202
|
Ge as IdentityVerificationProvider,
|
|
14229
14203
|
Ha as IdentityVerificationStep,
|
|
14230
|
-
|
|
14204
|
+
Ce as Input,
|
|
14231
14205
|
gr as InvestorCategorizationService,
|
|
14232
14206
|
qa as InvestorCategorizationStep,
|
|
14233
|
-
|
|
14207
|
+
Oe as InvestorCategorizationType,
|
|
14234
14208
|
Qi as InvestorCategoryType,
|
|
14235
14209
|
Ki as KycProcessStatus,
|
|
14236
14210
|
xi as KycStatus,
|
|
@@ -14258,11 +14232,11 @@ export {
|
|
|
14258
14232
|
Lr as SardinAIProvider,
|
|
14259
14233
|
nt as SearchableSelect,
|
|
14260
14234
|
Qt as Select,
|
|
14261
|
-
|
|
14235
|
+
Ke as Spinner,
|
|
14262
14236
|
Nr as StepRouter,
|
|
14263
14237
|
Ir as SumsubProvider,
|
|
14264
14238
|
Er as ThemeManager,
|
|
14265
|
-
|
|
14239
|
+
Be as ThemePreset,
|
|
14266
14240
|
wr as ThemeService,
|
|
14267
14241
|
Zr as TranslationProvider,
|
|
14268
14242
|
xr as TranslationService,
|
|
@@ -14273,7 +14247,7 @@ export {
|
|
|
14273
14247
|
Tr as WorkflowOrchestrator,
|
|
14274
14248
|
Lt as WorkflowResultType,
|
|
14275
14249
|
Cr as WorkflowState,
|
|
14276
|
-
|
|
14250
|
+
ae as WorkflowStepAction,
|
|
14277
14251
|
jn as appropriatenessTestSchema,
|
|
14278
14252
|
In as clearAllStorage,
|
|
14279
14253
|
ia as clearApplicantId,
|
|
@@ -14281,7 +14255,7 @@ export {
|
|
|
14281
14255
|
We as cn,
|
|
14282
14256
|
fr as corporateTheme,
|
|
14283
14257
|
Ji as defaultConfig,
|
|
14284
|
-
|
|
14258
|
+
Ve as defaultTheme,
|
|
14285
14259
|
ta as fileToBase64,
|
|
14286
14260
|
yr as fintechTheme,
|
|
14287
14261
|
Ot as formatFileSize,
|
|
@@ -14300,7 +14274,7 @@ export {
|
|
|
14300
14274
|
kr as minimalTheme,
|
|
14301
14275
|
vr as modernTheme,
|
|
14302
14276
|
wn as removeScript,
|
|
14303
|
-
|
|
14277
|
+
ie as resolveDisplayText,
|
|
14304
14278
|
Tn as saveApplicantId,
|
|
14305
14279
|
ra as saveWorkflowState,
|
|
14306
14280
|
br as themePresets,
|
|
@@ -14308,7 +14282,7 @@ export {
|
|
|
14308
14282
|
zn as useAppropriatenessTest,
|
|
14309
14283
|
da as useIdentityVerification,
|
|
14310
14284
|
na as useKycWorkflow,
|
|
14311
|
-
|
|
14285
|
+
Te as useMetaKYC,
|
|
14312
14286
|
oa as useMetaKYCFlow,
|
|
14313
14287
|
ca as useOverview,
|
|
14314
14288
|
sa as useQuestionnaire,
|