@vpdev2/metakyc-sdk 1.0.99 → 1.0.100
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/KycWorkflow.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1057 -995
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var me = (e, t, n) =>
|
|
1
|
+
var Bt = Object.defineProperty;
|
|
2
|
+
var $t = (e, t, n) => t in e ? Bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var me = (e, t, n) => $t(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import _t from "axios";
|
|
5
5
|
import * as vt from "react";
|
|
6
|
-
import
|
|
6
|
+
import be, { createContext as jt, useState as k, useMemo as Ae, useEffect as ye, useContext as Ht, useRef as le, useCallback as te, forwardRef as lt, createElement as gt } from "react";
|
|
7
7
|
import { jsx as r, jsxs as i, Fragment as rt } from "react/jsx-runtime";
|
|
8
|
-
import
|
|
9
|
-
import { useForm as
|
|
8
|
+
import Wt, { createPortal as ft } from "react-dom";
|
|
9
|
+
import { useForm as Ut, Controller as qe } from "react-hook-form";
|
|
10
10
|
import { z as _e } from "zod";
|
|
11
|
-
var se = /* @__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))(se || {}), ut = /* @__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))(ut || {}), Te = /* @__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))(Te || {}), Kt = /* @__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))(Kt || {}), qt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(qt || {}), Ye = /* @__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))(Ye || {}), Ve = /* @__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))(Ve || {}), Yt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Yt || {}), Vt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Vt || {}), Le = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Le || {}), Qt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Qt || {}), pt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(pt || {}), Gt = /* @__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))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Jt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Zt || {}),
|
|
12
|
-
const
|
|
11
|
+
var se = /* @__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))(se || {}), ut = /* @__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))(ut || {}), Te = /* @__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))(Te || {}), Kt = /* @__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))(Kt || {}), qt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(qt || {}), Ye = /* @__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))(Ye || {}), Ve = /* @__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))(Ve || {}), Yt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Yt || {}), Vt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Vt || {}), Le = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Le || {}), Qt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Qt || {}), pt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(pt || {}), Gt = /* @__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))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Jt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Zt || {}), Be = /* @__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))(Be || {}), Xt = /* @__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))(Xt || {}), er = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(er || {}), Ne = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Ne || {}), tr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(tr || {});
|
|
12
|
+
const We = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
15
15
|
CountryOfBirth: 30,
|
|
@@ -23,17 +23,17 @@ const Ue = {
|
|
|
23
23
|
dateOfBirth: { label: "Date of Birth", type: "date" },
|
|
24
24
|
salutation: { label: "Salutation", type: "select" },
|
|
25
25
|
title: { label: "Title", type: "text" },
|
|
26
|
-
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType:
|
|
26
|
+
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType: We.PhoneNumber },
|
|
27
27
|
street: { label: "Street", type: "text" },
|
|
28
28
|
streetNumber: { label: "Street Number", type: "text" },
|
|
29
29
|
zip: { label: "ZIP / Postal Code", type: "text" },
|
|
30
30
|
city: { label: "City", type: "text" },
|
|
31
|
-
country: { label: "Country", type: "select", countriesType:
|
|
32
|
-
nationality: { label: "Nationality", type: "select", countriesType:
|
|
33
|
-
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType:
|
|
34
|
-
countryOfBirth: { label: "Country of Birth", type: "select", countriesType:
|
|
31
|
+
country: { label: "Country", type: "select", countriesType: We.Address },
|
|
32
|
+
nationality: { label: "Nationality", type: "select", countriesType: We.Nationality },
|
|
33
|
+
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType: We.Nationality },
|
|
34
|
+
countryOfBirth: { label: "Country of Birth", type: "select", countriesType: We.CountryOfBirth },
|
|
35
35
|
placeOfBirth: { label: "Place of Birth", type: "text" },
|
|
36
|
-
taxCountry: { label: "Tax Country", type: "select", countriesType:
|
|
36
|
+
taxCountry: { label: "Tax Country", type: "select", countriesType: We.Address },
|
|
37
37
|
taxNumber: { label: "Tax Number", type: "text" },
|
|
38
38
|
defaultLanguage: { label: "Default Language", type: "select" },
|
|
39
39
|
educationLevel: { label: "Education Level", type: "text" },
|
|
@@ -43,7 +43,7 @@ const Ue = {
|
|
|
43
43
|
email: { label: "Email", type: "email" },
|
|
44
44
|
phone: { label: "Phone", type: "tel" },
|
|
45
45
|
registrationNumber: { label: "Registration Number", type: "text" },
|
|
46
|
-
countryResidence: { label: "Country of Residence", type: "select", countriesType:
|
|
46
|
+
countryResidence: { label: "Country of Residence", type: "select", countriesType: We.Address },
|
|
47
47
|
legalAddress: { label: "Legal Address", type: "text" },
|
|
48
48
|
incorporatedOn: { label: "Incorporation Date", type: "date" },
|
|
49
49
|
controlScheme: { label: "Control Scheme", type: "text" },
|
|
@@ -56,7 +56,7 @@ const Ue = {
|
|
|
56
56
|
city: { label: "City", type: "text" },
|
|
57
57
|
state: { label: "State / Province", type: "text" },
|
|
58
58
|
postalCode: { label: "Postal Code", type: "text" },
|
|
59
|
-
addressCountry: { label: "Address Country", type: "select", countriesType:
|
|
59
|
+
addressCountry: { label: "Address Country", type: "select", countriesType: We.Address },
|
|
60
60
|
lei: { label: "LEI", type: "text" }
|
|
61
61
|
}, rr = [
|
|
62
62
|
"companyName",
|
|
@@ -88,7 +88,7 @@ const Ue = {
|
|
|
88
88
|
{ value: "FI", label: "Finnish" },
|
|
89
89
|
{ value: "NO", label: "Norwegian" }
|
|
90
90
|
];
|
|
91
|
-
var
|
|
91
|
+
var Re = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(Re || {});
|
|
92
92
|
const ar = {
|
|
93
93
|
timeout: 3e4,
|
|
94
94
|
retries: 3,
|
|
@@ -663,7 +663,7 @@ class hr {
|
|
|
663
663
|
)).result;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
const
|
|
666
|
+
const Fe = {
|
|
667
667
|
name: "Default",
|
|
668
668
|
title: "KYC Verification",
|
|
669
669
|
logo: {
|
|
@@ -897,15 +897,15 @@ const Ee = {
|
|
|
897
897
|
inputHeight: "2.25rem"
|
|
898
898
|
}
|
|
899
899
|
}, kr = {
|
|
900
|
-
[
|
|
901
|
-
[
|
|
902
|
-
[
|
|
903
|
-
[
|
|
904
|
-
[
|
|
905
|
-
[
|
|
900
|
+
[Re.Default]: Fe,
|
|
901
|
+
[Re.Corporate]: gr,
|
|
902
|
+
[Re.Fintech]: fr,
|
|
903
|
+
[Re.Healthcare]: br,
|
|
904
|
+
[Re.Modern]: xr,
|
|
905
|
+
[Re.Minimal]: vr
|
|
906
906
|
};
|
|
907
907
|
function it(e) {
|
|
908
|
-
return kr[e] ||
|
|
908
|
+
return kr[e] || Fe;
|
|
909
909
|
}
|
|
910
910
|
class wr {
|
|
911
911
|
constructor(t) {
|
|
@@ -922,8 +922,8 @@ class wr {
|
|
|
922
922
|
"GetThemeConfiguration"
|
|
923
923
|
);
|
|
924
924
|
if (!n.result.isEnabled)
|
|
925
|
-
return it(
|
|
926
|
-
let a = n.result.preset ? it(n.result.preset) : it(
|
|
925
|
+
return it(Re.Default);
|
|
926
|
+
let a = n.result.preset ? it(n.result.preset) : it(Re.Default);
|
|
927
927
|
if (n.result.title && (a.title = n.result.title), n.result.logo && (a.logo = { ...a.logo, ...n.result.logo }), n.result.colors && (a.colors = { ...a.colors, ...n.result.colors }), n.result.typography && (a.typography = { ...a.typography, ...n.result.typography }), n.result.spacing && (a.spacing = { ...a.spacing, ...n.result.spacing }), n.result.customCSS && (a.customCSS = n.result.customCSS), n.result.darkMode && (a.darkMode = {
|
|
928
928
|
colors: {
|
|
929
929
|
...(t = a.darkMode) == null ? void 0 : t.colors,
|
|
@@ -973,7 +973,7 @@ class wr {
|
|
|
973
973
|
}
|
|
974
974
|
return a;
|
|
975
975
|
} catch (n) {
|
|
976
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), it(
|
|
976
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), it(Re.Default);
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
979
|
/**
|
|
@@ -987,12 +987,12 @@ class wr {
|
|
|
987
987
|
*/
|
|
988
988
|
getAvailablePresets() {
|
|
989
989
|
return [
|
|
990
|
-
{ id:
|
|
991
|
-
{ id:
|
|
992
|
-
{ id:
|
|
993
|
-
{ id:
|
|
994
|
-
{ id:
|
|
995
|
-
{ id:
|
|
990
|
+
{ id: Re.Default, name: "Default" },
|
|
991
|
+
{ id: Re.Corporate, name: "Corporate" },
|
|
992
|
+
{ id: Re.Fintech, name: "Fintech" },
|
|
993
|
+
{ id: Re.Healthcare, name: "Healthcare" },
|
|
994
|
+
{ id: Re.Modern, name: "Modern" },
|
|
995
|
+
{ id: Re.Minimal, name: "Minimal" }
|
|
996
996
|
];
|
|
997
997
|
}
|
|
998
998
|
/**
|
|
@@ -1236,11 +1236,11 @@ class Nr {
|
|
|
1236
1236
|
return a.submitData(n);
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
|
-
class
|
|
1240
|
-
constructor(t, n, a, s, l, c, u,
|
|
1239
|
+
class Rr {
|
|
1240
|
+
constructor(t, n, a, s, l, c, u, y) {
|
|
1241
1241
|
me(this, "state");
|
|
1242
1242
|
me(this, "stepRouter");
|
|
1243
|
-
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = s, this.overviewService = l, this.riskScoringService = c, this.investorCategorizationService =
|
|
1243
|
+
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = s, this.overviewService = l, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new Cr(), this.stepRouter = new Nr(), this.registerStepHandlers();
|
|
1244
1244
|
}
|
|
1245
1245
|
/**
|
|
1246
1246
|
* Register all step handlers
|
|
@@ -1390,14 +1390,14 @@ function Ft(e, t) {
|
|
|
1390
1390
|
s.src = e, t && (s.id = t), s.async = !0, s.onload = () => n(), s.onerror = () => a(new Error(`Failed to load script: ${e}`)), document.head.appendChild(s);
|
|
1391
1391
|
});
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1393
|
+
function Mn(e) {
|
|
1394
1394
|
return !!document.getElementById(e);
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function zn(e) {
|
|
1397
1397
|
const t = document.getElementById(e);
|
|
1398
1398
|
t && t.remove();
|
|
1399
1399
|
}
|
|
1400
|
-
class
|
|
1400
|
+
class Ir {
|
|
1401
1401
|
constructor(t) {
|
|
1402
1402
|
me(this, "sdk", null);
|
|
1403
1403
|
me(this, "config");
|
|
@@ -1597,13 +1597,13 @@ class Fr {
|
|
|
1597
1597
|
console.log(`[SardinAI] Device ID: ${u.deviceId}`);
|
|
1598
1598
|
},
|
|
1599
1599
|
// New callback for session updates
|
|
1600
|
-
onConfigUpdate: (u,
|
|
1600
|
+
onConfigUpdate: (u, y, m) => {
|
|
1601
1601
|
switch (u) {
|
|
1602
1602
|
case "SESSION_UPDATE_FAILED":
|
|
1603
1603
|
console.error("[SardinAI] Session update failed:", m);
|
|
1604
1604
|
break;
|
|
1605
1605
|
case "SESSION_UPDATED":
|
|
1606
|
-
console.log("[SardinAI] Session updated:",
|
|
1606
|
+
console.log("[SardinAI] Session updated:", y);
|
|
1607
1607
|
break;
|
|
1608
1608
|
case "SESSION_NO_UPDATE":
|
|
1609
1609
|
console.log("[SardinAI] No session update");
|
|
@@ -1669,7 +1669,7 @@ class et {
|
|
|
1669
1669
|
static createProvider(t, n) {
|
|
1670
1670
|
switch (t) {
|
|
1671
1671
|
case Le.Sumsub:
|
|
1672
|
-
return new
|
|
1672
|
+
return new Ir(n);
|
|
1673
1673
|
case Le.Onfido:
|
|
1674
1674
|
return new Er(n);
|
|
1675
1675
|
case Le.SardinAI:
|
|
@@ -1748,7 +1748,7 @@ function Ar() {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
class Pr {
|
|
1750
1750
|
constructor(t) {
|
|
1751
|
-
me(this, "currentTheme",
|
|
1751
|
+
me(this, "currentTheme", Fe);
|
|
1752
1752
|
me(this, "customStyleElement", null);
|
|
1753
1753
|
me(this, "inputStyleElement", null);
|
|
1754
1754
|
me(this, "container");
|
|
@@ -1843,19 +1843,19 @@ class Pr {
|
|
|
1843
1843
|
mergeWithDefault(t) {
|
|
1844
1844
|
var n;
|
|
1845
1845
|
return {
|
|
1846
|
-
name: t.name ||
|
|
1847
|
-
title: t.title ||
|
|
1848
|
-
logo: { ...
|
|
1849
|
-
colors: { ...
|
|
1850
|
-
typography: t.typography ? { ...
|
|
1851
|
-
spacing: t.spacing ? { ...
|
|
1846
|
+
name: t.name || Fe.name,
|
|
1847
|
+
title: t.title || Fe.title,
|
|
1848
|
+
logo: { ...Fe.logo, ...t.logo },
|
|
1849
|
+
colors: { ...Fe.colors, ...t.colors },
|
|
1850
|
+
typography: t.typography ? { ...Fe.typography, ...t.typography } : Fe.typography,
|
|
1851
|
+
spacing: t.spacing ? { ...Fe.spacing, ...t.spacing } : Fe.spacing,
|
|
1852
1852
|
customCSS: t.customCSS,
|
|
1853
1853
|
darkMode: t.darkMode ? {
|
|
1854
1854
|
colors: {
|
|
1855
|
-
...(n =
|
|
1855
|
+
...(n = Fe.darkMode) == null ? void 0 : n.colors,
|
|
1856
1856
|
...t.darkMode.colors
|
|
1857
1857
|
}
|
|
1858
|
-
} :
|
|
1858
|
+
} : Fe.darkMode,
|
|
1859
1859
|
applicantFormVisibleFields: t.applicantFormVisibleFields,
|
|
1860
1860
|
applicantFormRequiredFields: t.applicantFormRequiredFields,
|
|
1861
1861
|
allowedLanguages: t.allowedLanguages,
|
|
@@ -1879,7 +1879,7 @@ class Pr {
|
|
|
1879
1879
|
* Reset to default theme
|
|
1880
1880
|
*/
|
|
1881
1881
|
resetTheme() {
|
|
1882
|
-
this.applyTheme(
|
|
1882
|
+
this.applyTheme(Fe);
|
|
1883
1883
|
}
|
|
1884
1884
|
/**
|
|
1885
1885
|
* Remove all custom styles
|
|
@@ -1894,20 +1894,20 @@ class Pr {
|
|
|
1894
1894
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1895
1895
|
}
|
|
1896
1896
|
}
|
|
1897
|
-
const At = jt(null),
|
|
1898
|
-
const [n, a] = k(null), s =
|
|
1899
|
-
const
|
|
1897
|
+
const At = jt(null), On = ({ config: e, children: t }) => {
|
|
1898
|
+
const [n, a] = k(null), s = be.useRef(!1), l = be.useRef(!1), c = Ae(() => {
|
|
1899
|
+
const y = new sr(e), m = new or(y), N = new lr(y), T = new cr(y), I = new dr(y), L = new ur(y), f = new pr(y), S = new mr(y), D = new yr(y), H = new hr(y), W = new wr(y), M = new Pr();
|
|
1900
1900
|
return {
|
|
1901
|
-
httpClient:
|
|
1901
|
+
httpClient: y,
|
|
1902
1902
|
applicantService: m,
|
|
1903
|
-
questionnaireService:
|
|
1903
|
+
questionnaireService: N,
|
|
1904
1904
|
uploadDocumentService: T,
|
|
1905
|
-
appropriatenessTestService:
|
|
1905
|
+
appropriatenessTestService: I,
|
|
1906
1906
|
overviewService: L,
|
|
1907
1907
|
riskScoringService: f,
|
|
1908
1908
|
identityService: S,
|
|
1909
1909
|
baseInformationService: D,
|
|
1910
|
-
investorCategorizationService:
|
|
1910
|
+
investorCategorizationService: H,
|
|
1911
1911
|
themeService: W,
|
|
1912
1912
|
themeManager: M
|
|
1913
1913
|
};
|
|
@@ -1915,7 +1915,7 @@ const At = jt(null), zn = ({ config: e, children: t }) => {
|
|
|
1915
1915
|
config: e,
|
|
1916
1916
|
...c,
|
|
1917
1917
|
currentTheme: n,
|
|
1918
|
-
createOrchestrator: () => new
|
|
1918
|
+
createOrchestrator: () => new Rr(
|
|
1919
1919
|
c.applicantService,
|
|
1920
1920
|
c.questionnaireService,
|
|
1921
1921
|
c.uploadDocumentService,
|
|
@@ -1949,7 +1949,7 @@ const At = jt(null), zn = ({ config: e, children: t }) => {
|
|
|
1949
1949
|
c.themeManager.cleanup();
|
|
1950
1950
|
}), []), /* @__PURE__ */ r(At.Provider, { value: u, children: t });
|
|
1951
1951
|
};
|
|
1952
|
-
function
|
|
1952
|
+
function Ee() {
|
|
1953
1953
|
const e = Ht(At);
|
|
1954
1954
|
if (!e)
|
|
1955
1955
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -1964,7 +1964,7 @@ async function Lr(e) {
|
|
|
1964
1964
|
}, a.onerror = (s) => n(s);
|
|
1965
1965
|
});
|
|
1966
1966
|
}
|
|
1967
|
-
function
|
|
1967
|
+
function Bn(e, t) {
|
|
1968
1968
|
return e.size <= t;
|
|
1969
1969
|
}
|
|
1970
1970
|
function $n(e, t) {
|
|
@@ -1981,7 +1981,7 @@ function mt(e) {
|
|
|
1981
1981
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
1982
1982
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
1983
1983
|
}
|
|
1984
|
-
function
|
|
1984
|
+
function _n(e) {
|
|
1985
1985
|
return e;
|
|
1986
1986
|
}
|
|
1987
1987
|
function Ie(...e) {
|
|
@@ -2020,7 +2020,7 @@ function zr(e) {
|
|
|
2020
2020
|
console.warn("Failed to save workflow state to storage:", t);
|
|
2021
2021
|
}
|
|
2022
2022
|
}
|
|
2023
|
-
function
|
|
2023
|
+
function jn() {
|
|
2024
2024
|
try {
|
|
2025
2025
|
const e = localStorage.getItem(nt.WORKFLOW_STATE);
|
|
2026
2026
|
return e ? JSON.parse(e) : null;
|
|
@@ -2035,13 +2035,13 @@ function Or() {
|
|
|
2035
2035
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
2036
2036
|
}
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function Hn() {
|
|
2039
2039
|
Mr(), Or();
|
|
2040
2040
|
}
|
|
2041
|
-
function
|
|
2042
|
-
const { createOrchestrator: t } =
|
|
2041
|
+
function Br(e) {
|
|
2042
|
+
const { createOrchestrator: t } = Ee(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(null), y = le(null), m = e || Dr();
|
|
2043
2043
|
ye(() => {
|
|
2044
|
-
|
|
2044
|
+
y.current || (y.current = t());
|
|
2045
2045
|
}, [t]), ye(() => {
|
|
2046
2046
|
var M;
|
|
2047
2047
|
n && m && (Tr(m), zr({
|
|
@@ -2053,47 +2053,47 @@ function $r(e) {
|
|
|
2053
2053
|
nextWorkflowKey: n.nextWorkflowKey
|
|
2054
2054
|
}));
|
|
2055
2055
|
}, [n, m]);
|
|
2056
|
-
const
|
|
2057
|
-
if (!(!m || !
|
|
2058
|
-
if (
|
|
2056
|
+
const N = le(!1), T = le(!1), I = te(async () => {
|
|
2057
|
+
if (!(!m || !y.current)) {
|
|
2058
|
+
if (N.current) {
|
|
2059
2059
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
2060
2060
|
return;
|
|
2061
2061
|
}
|
|
2062
|
-
|
|
2062
|
+
N.current = !0, l(!0), u(null);
|
|
2063
2063
|
try {
|
|
2064
|
-
const M = await
|
|
2064
|
+
const M = await y.current.initialize(m);
|
|
2065
2065
|
a(M), T.current = !0;
|
|
2066
2066
|
} catch (M) {
|
|
2067
2067
|
u(M);
|
|
2068
2068
|
} finally {
|
|
2069
|
-
l(!1),
|
|
2069
|
+
l(!1), N.current = !1;
|
|
2070
2070
|
}
|
|
2071
2071
|
}
|
|
2072
2072
|
}, [m]);
|
|
2073
2073
|
ye(() => {
|
|
2074
|
-
m && !T.current &&
|
|
2075
|
-
}, [m,
|
|
2074
|
+
m && !T.current && I();
|
|
2075
|
+
}, [m, I]);
|
|
2076
2076
|
const L = te(async () => {
|
|
2077
|
-
if (
|
|
2078
|
-
if (
|
|
2077
|
+
if (y.current) {
|
|
2078
|
+
if (N.current) {
|
|
2079
2079
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
2080
2080
|
return;
|
|
2081
2081
|
}
|
|
2082
|
-
|
|
2082
|
+
N.current = !0, l(!0), u(null);
|
|
2083
2083
|
try {
|
|
2084
|
-
const M = await
|
|
2084
|
+
const M = await y.current.refreshProgress();
|
|
2085
2085
|
a(M);
|
|
2086
2086
|
} catch (M) {
|
|
2087
2087
|
u(M);
|
|
2088
2088
|
} finally {
|
|
2089
|
-
l(!1),
|
|
2089
|
+
l(!1), N.current = !1;
|
|
2090
2090
|
}
|
|
2091
2091
|
}
|
|
2092
2092
|
}, []), f = te(async () => {
|
|
2093
|
-
if (
|
|
2093
|
+
if (y.current) {
|
|
2094
2094
|
l(!0), u(null);
|
|
2095
2095
|
try {
|
|
2096
|
-
const M = await
|
|
2096
|
+
const M = await y.current.moveToNextStep();
|
|
2097
2097
|
a(M);
|
|
2098
2098
|
} catch (M) {
|
|
2099
2099
|
u(M);
|
|
@@ -2102,10 +2102,10 @@ function $r(e) {
|
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
2104
2104
|
}, []), S = te(async () => {
|
|
2105
|
-
if (
|
|
2105
|
+
if (y.current) {
|
|
2106
2106
|
l(!0), u(null);
|
|
2107
2107
|
try {
|
|
2108
|
-
const M = await
|
|
2108
|
+
const M = await y.current.moveToPreviousStep();
|
|
2109
2109
|
a(M);
|
|
2110
2110
|
} catch (M) {
|
|
2111
2111
|
u(M);
|
|
@@ -2114,24 +2114,24 @@ function $r(e) {
|
|
|
2114
2114
|
}
|
|
2115
2115
|
}
|
|
2116
2116
|
}, []), D = te(async (M) => {
|
|
2117
|
-
if (
|
|
2117
|
+
if (y.current) {
|
|
2118
2118
|
l(!0), u(null);
|
|
2119
2119
|
try {
|
|
2120
|
-
await
|
|
2121
|
-
const
|
|
2122
|
-
a(
|
|
2123
|
-
} catch (
|
|
2124
|
-
throw u(
|
|
2120
|
+
await y.current.submitCurrentStep(M);
|
|
2121
|
+
const q = await y.current.refreshProgress();
|
|
2122
|
+
a(q);
|
|
2123
|
+
} catch (q) {
|
|
2124
|
+
throw u(q), q;
|
|
2125
2125
|
} finally {
|
|
2126
2126
|
l(!1);
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
|
-
}, []),
|
|
2129
|
+
}, []), H = vt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, q) => M.order - q.order) : [], [n == null ? void 0 : n.stepInfoList]), W = vt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2130
2130
|
return {
|
|
2131
2131
|
progress: n,
|
|
2132
2132
|
applicantId: m,
|
|
2133
2133
|
currentStep: (n == null ? void 0 : n.currentStep) || null,
|
|
2134
|
-
steps:
|
|
2134
|
+
steps: H,
|
|
2135
2135
|
status: (n == null ? void 0 : n.status) || Te.None,
|
|
2136
2136
|
workflowResult: (n == null ? void 0 : n.workflowResult) || null,
|
|
2137
2137
|
workflowKey: n == null ? void 0 : n.workFlowKey,
|
|
@@ -2145,39 +2145,39 @@ function $r(e) {
|
|
|
2145
2145
|
moveToNext: f,
|
|
2146
2146
|
moveBack: S,
|
|
2147
2147
|
submitCurrentStep: D,
|
|
2148
|
-
orchestrator:
|
|
2148
|
+
orchestrator: y.current
|
|
2149
2149
|
};
|
|
2150
2150
|
}
|
|
2151
|
-
function
|
|
2152
|
-
const { questionnaireService: t, applicantService: n } =
|
|
2153
|
-
var
|
|
2151
|
+
function $r(e) {
|
|
2152
|
+
const { questionnaireService: t, applicantService: n } = Ee(), [a, s] = k(null), [l, c] = k({}), [u, y] = k(!1), [m, N] = k(!1), [T, I] = k(null), L = le(!1), f = le(null), S = te(async () => {
|
|
2153
|
+
var H, W;
|
|
2154
2154
|
if (e) {
|
|
2155
2155
|
if (L.current) {
|
|
2156
2156
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
2157
2157
|
return;
|
|
2158
2158
|
}
|
|
2159
|
-
L.current = !0,
|
|
2159
|
+
L.current = !0, y(!0), I(null);
|
|
2160
2160
|
try {
|
|
2161
|
-
const [M,
|
|
2161
|
+
const [M, q] = await Promise.all([
|
|
2162
2162
|
t.getQuestionnaire(e),
|
|
2163
2163
|
n.getApplicantData(e).catch(() => null)
|
|
2164
2164
|
]);
|
|
2165
|
-
if (s(M), (
|
|
2166
|
-
const
|
|
2167
|
-
for (const b of
|
|
2168
|
-
b.question && ((W = b.answers) != null && W.length) &&
|
|
2169
|
-
const
|
|
2165
|
+
if (s(M), (H = q == null ? void 0 : q.questionnaireResults) != null && H.length && M) {
|
|
2166
|
+
const U = /* @__PURE__ */ new Map();
|
|
2167
|
+
for (const b of q.questionnaireResults)
|
|
2168
|
+
b.question && ((W = b.answers) != null && W.length) && U.set(b.question.trim().toLowerCase(), b.answers);
|
|
2169
|
+
const V = {}, F = M.questionGroups.flatMap((b) => b.questions ?? []);
|
|
2170
2170
|
for (const b of F) {
|
|
2171
|
-
const
|
|
2172
|
-
|
|
2171
|
+
const B = b.text.trim().toLowerCase();
|
|
2172
|
+
U.has(B) && (V[b.id] = U.get(B));
|
|
2173
2173
|
}
|
|
2174
|
-
c(
|
|
2174
|
+
c(V);
|
|
2175
2175
|
}
|
|
2176
2176
|
f.current = e;
|
|
2177
2177
|
} catch (M) {
|
|
2178
|
-
|
|
2178
|
+
I(M);
|
|
2179
2179
|
} finally {
|
|
2180
|
-
|
|
2180
|
+
y(!1), L.current = !1;
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
2183
|
}, [e, t, n]);
|
|
@@ -2185,14 +2185,14 @@ function Br(e) {
|
|
|
2185
2185
|
e && f.current !== e && S();
|
|
2186
2186
|
}, [e]);
|
|
2187
2187
|
const D = te(
|
|
2188
|
-
async (
|
|
2189
|
-
|
|
2188
|
+
async (H) => {
|
|
2189
|
+
N(!0), I(null);
|
|
2190
2190
|
try {
|
|
2191
|
-
return await t.fillQuestionnaire(
|
|
2191
|
+
return await t.fillQuestionnaire(H);
|
|
2192
2192
|
} catch (W) {
|
|
2193
|
-
throw
|
|
2193
|
+
throw I(W), W;
|
|
2194
2194
|
} finally {
|
|
2195
|
-
|
|
2195
|
+
N(!1);
|
|
2196
2196
|
}
|
|
2197
2197
|
},
|
|
2198
2198
|
[t]
|
|
@@ -2208,20 +2208,20 @@ function Br(e) {
|
|
|
2208
2208
|
};
|
|
2209
2209
|
}
|
|
2210
2210
|
function _r(e) {
|
|
2211
|
-
const { uploadDocumentService: t } =
|
|
2211
|
+
const { uploadDocumentService: t } = Ee(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [y, m] = k(0), [N, T] = k(null), I = le(!1), L = le(null), f = te(async () => {
|
|
2212
2212
|
if (e) {
|
|
2213
|
-
if (
|
|
2213
|
+
if (I.current) {
|
|
2214
2214
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2215
2215
|
return;
|
|
2216
2216
|
}
|
|
2217
|
-
|
|
2217
|
+
I.current = !0, l(!0), T(null);
|
|
2218
2218
|
try {
|
|
2219
2219
|
const D = await t.getUploadDocument(e);
|
|
2220
2220
|
a(D), L.current = e;
|
|
2221
2221
|
} catch (D) {
|
|
2222
2222
|
T(D);
|
|
2223
2223
|
} finally {
|
|
2224
|
-
l(!1),
|
|
2224
|
+
l(!1), I.current = !1;
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
2227
|
}, [e, t]);
|
|
@@ -2233,8 +2233,8 @@ function _r(e) {
|
|
|
2233
2233
|
u(!0), m(0), T(null);
|
|
2234
2234
|
try {
|
|
2235
2235
|
await t.fillUploadDocument(D), m(100);
|
|
2236
|
-
} catch (
|
|
2237
|
-
throw T(
|
|
2236
|
+
} catch (H) {
|
|
2237
|
+
throw T(H), H;
|
|
2238
2238
|
} finally {
|
|
2239
2239
|
u(!1);
|
|
2240
2240
|
}
|
|
@@ -2245,27 +2245,27 @@ function _r(e) {
|
|
|
2245
2245
|
uploadDocument: n,
|
|
2246
2246
|
isLoading: s,
|
|
2247
2247
|
isSubmitting: c,
|
|
2248
|
-
uploadProgress:
|
|
2249
|
-
error:
|
|
2248
|
+
uploadProgress: y,
|
|
2249
|
+
error: N,
|
|
2250
2250
|
load: f,
|
|
2251
2251
|
submit: S
|
|
2252
2252
|
};
|
|
2253
2253
|
}
|
|
2254
|
-
function
|
|
2255
|
-
const { appropriatenessTestService: t } =
|
|
2254
|
+
function Wn(e) {
|
|
2255
|
+
const { appropriatenessTestService: t } = Ee(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [y, m] = k(null), [N, T] = k(null), I = le(!1), L = le(null), f = te(async () => {
|
|
2256
2256
|
if (e) {
|
|
2257
|
-
if (
|
|
2257
|
+
if (I.current) {
|
|
2258
2258
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2259
2259
|
return;
|
|
2260
2260
|
}
|
|
2261
|
-
|
|
2261
|
+
I.current = !0, l(!0), m(null);
|
|
2262
2262
|
try {
|
|
2263
2263
|
const D = await t.getAppropriatenessTest(e);
|
|
2264
2264
|
a(D), L.current = e;
|
|
2265
2265
|
} catch (D) {
|
|
2266
2266
|
m(D);
|
|
2267
2267
|
} finally {
|
|
2268
|
-
l(!1),
|
|
2268
|
+
l(!1), I.current = !1;
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
2271
|
}, [e, t]);
|
|
@@ -2276,10 +2276,10 @@ function Hn(e) {
|
|
|
2276
2276
|
async (D) => {
|
|
2277
2277
|
u(!0), m(null);
|
|
2278
2278
|
try {
|
|
2279
|
-
const
|
|
2280
|
-
return T(
|
|
2281
|
-
} catch (
|
|
2282
|
-
throw m(
|
|
2279
|
+
const H = await t.fillAppropriatenessTest(D);
|
|
2280
|
+
return T(H), H;
|
|
2281
|
+
} catch (H) {
|
|
2282
|
+
throw m(H), H;
|
|
2283
2283
|
} finally {
|
|
2284
2284
|
u(!1);
|
|
2285
2285
|
}
|
|
@@ -2288,34 +2288,34 @@ function Hn(e) {
|
|
|
2288
2288
|
);
|
|
2289
2289
|
return {
|
|
2290
2290
|
test: n,
|
|
2291
|
-
result:
|
|
2291
|
+
result: N,
|
|
2292
2292
|
isLoading: s,
|
|
2293
2293
|
isSubmitting: c,
|
|
2294
|
-
error:
|
|
2294
|
+
error: y,
|
|
2295
2295
|
load: f,
|
|
2296
2296
|
submit: S
|
|
2297
2297
|
};
|
|
2298
2298
|
}
|
|
2299
2299
|
function jr(e) {
|
|
2300
|
-
const { overviewService: t } =
|
|
2300
|
+
const { overviewService: t } = Ee(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [y, m] = k(null), N = le(!1), T = le(null), I = te(async () => {
|
|
2301
2301
|
if (e) {
|
|
2302
|
-
if (
|
|
2302
|
+
if (N.current) {
|
|
2303
2303
|
console.log("[Overview] Load already in progress, skipping...");
|
|
2304
2304
|
return;
|
|
2305
2305
|
}
|
|
2306
|
-
|
|
2306
|
+
N.current = !0, l(!0), m(null);
|
|
2307
2307
|
try {
|
|
2308
2308
|
const f = await t.getOverviewData(e);
|
|
2309
2309
|
a(f), T.current = e;
|
|
2310
2310
|
} catch (f) {
|
|
2311
2311
|
m(f);
|
|
2312
2312
|
} finally {
|
|
2313
|
-
l(!1),
|
|
2313
|
+
l(!1), N.current = !1;
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
2316
|
}, [e, t]);
|
|
2317
2317
|
ye(() => {
|
|
2318
|
-
e && T.current !== e &&
|
|
2318
|
+
e && T.current !== e && I();
|
|
2319
2319
|
}, [e]);
|
|
2320
2320
|
const L = te(async () => {
|
|
2321
2321
|
if (e) {
|
|
@@ -2333,27 +2333,27 @@ function jr(e) {
|
|
|
2333
2333
|
overview: n,
|
|
2334
2334
|
isLoading: s,
|
|
2335
2335
|
isSubmitting: c,
|
|
2336
|
-
error:
|
|
2337
|
-
load:
|
|
2336
|
+
error: y,
|
|
2337
|
+
load: I,
|
|
2338
2338
|
passOverview: L
|
|
2339
2339
|
};
|
|
2340
2340
|
}
|
|
2341
2341
|
function Hr(e) {
|
|
2342
|
-
const { identityService: t } =
|
|
2342
|
+
const { identityService: t } = Ee(), [n, a] = k(
|
|
2343
2343
|
null
|
|
2344
|
-
), [s, l] = k(!1), [c, u] = k(null),
|
|
2345
|
-
async (
|
|
2344
|
+
), [s, l] = k(!1), [c, u] = k(null), y = le(!1), m = te(
|
|
2345
|
+
async (I, L) => {
|
|
2346
2346
|
if (e) {
|
|
2347
|
-
if (
|
|
2347
|
+
if (y.current) {
|
|
2348
2348
|
console.log("[Identity] Request already in progress, skipping...");
|
|
2349
2349
|
return;
|
|
2350
2350
|
}
|
|
2351
|
-
|
|
2351
|
+
y.current = !0, l(!0), u(null);
|
|
2352
2352
|
try {
|
|
2353
2353
|
const f = {
|
|
2354
2354
|
applicantId: e,
|
|
2355
2355
|
restart: !1,
|
|
2356
|
-
redirectUrl:
|
|
2356
|
+
redirectUrl: I || "",
|
|
2357
2357
|
ttl: L || 604800
|
|
2358
2358
|
// Default: 7 days
|
|
2359
2359
|
};
|
|
@@ -2363,20 +2363,20 @@ function Hr(e) {
|
|
|
2363
2363
|
} catch (f) {
|
|
2364
2364
|
throw u(f), f;
|
|
2365
2365
|
} finally {
|
|
2366
|
-
l(!1),
|
|
2366
|
+
l(!1), y.current = !1;
|
|
2367
2367
|
}
|
|
2368
2368
|
}
|
|
2369
2369
|
},
|
|
2370
2370
|
[e, t]
|
|
2371
|
-
),
|
|
2372
|
-
async (
|
|
2371
|
+
), N = te(
|
|
2372
|
+
async (I, L) => {
|
|
2373
2373
|
if (e) {
|
|
2374
2374
|
l(!0), u(null);
|
|
2375
2375
|
try {
|
|
2376
2376
|
const f = {
|
|
2377
2377
|
applicantId: e,
|
|
2378
2378
|
restart: !1,
|
|
2379
|
-
redirectUrl:
|
|
2379
|
+
redirectUrl: I,
|
|
2380
2380
|
ttl: L
|
|
2381
2381
|
}, S = await t.identityCompanyRequest(f);
|
|
2382
2382
|
return a(S), S;
|
|
@@ -2390,26 +2390,26 @@ function Hr(e) {
|
|
|
2390
2390
|
[e, t]
|
|
2391
2391
|
), T = te(async () => {
|
|
2392
2392
|
if (e) {
|
|
2393
|
-
if (
|
|
2393
|
+
if (y.current) {
|
|
2394
2394
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
2395
2395
|
return;
|
|
2396
2396
|
}
|
|
2397
|
-
|
|
2397
|
+
y.current = !0, l(!0), u(null);
|
|
2398
2398
|
try {
|
|
2399
|
-
const
|
|
2399
|
+
const I = {
|
|
2400
2400
|
applicantId: e,
|
|
2401
2401
|
restart: !0,
|
|
2402
2402
|
redirectUrl: "",
|
|
2403
2403
|
ttl: 604800
|
|
2404
2404
|
// 7 days
|
|
2405
2405
|
};
|
|
2406
|
-
console.log("Restarting identity with input:",
|
|
2407
|
-
const L = await t.identityRequest(
|
|
2406
|
+
console.log("Restarting identity with input:", I);
|
|
2407
|
+
const L = await t.identityRequest(I);
|
|
2408
2408
|
return console.log("Restart identity result:", L), a(L), L;
|
|
2409
|
-
} catch (
|
|
2410
|
-
throw u(
|
|
2409
|
+
} catch (I) {
|
|
2410
|
+
throw u(I), I;
|
|
2411
2411
|
} finally {
|
|
2412
|
-
l(!1),
|
|
2412
|
+
l(!1), y.current = !1;
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
2415
2415
|
}, [e, t]);
|
|
@@ -2420,56 +2420,56 @@ function Hr(e) {
|
|
|
2420
2420
|
isLoading: s,
|
|
2421
2421
|
error: c,
|
|
2422
2422
|
requestIdentity: m,
|
|
2423
|
-
requestCompanyIdentity:
|
|
2423
|
+
requestCompanyIdentity: N,
|
|
2424
2424
|
restartIdentity: T
|
|
2425
2425
|
};
|
|
2426
2426
|
}
|
|
2427
|
-
function
|
|
2428
|
-
const { riskScoringService: t, applicantService: n } =
|
|
2427
|
+
function Wr(e) {
|
|
2428
|
+
const { riskScoringService: t, applicantService: n } = Ee(), [a, s] = k(null), [l, c] = k({}), [u, y] = k(!1), [m, N] = k(!1), [T, I] = k(null), [L, f] = k(null), S = le(!1), D = le(null), H = te(async () => {
|
|
2429
2429
|
var M;
|
|
2430
2430
|
if (e) {
|
|
2431
2431
|
if (S.current) {
|
|
2432
2432
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2433
2433
|
return;
|
|
2434
2434
|
}
|
|
2435
|
-
S.current = !0,
|
|
2435
|
+
S.current = !0, y(!0), I(null);
|
|
2436
2436
|
try {
|
|
2437
|
-
const [
|
|
2437
|
+
const [q, U] = await Promise.all([
|
|
2438
2438
|
t.getRiskCriterias(e),
|
|
2439
2439
|
n.getApplicantData(e).catch(() => null)
|
|
2440
2440
|
]);
|
|
2441
|
-
if (s(
|
|
2442
|
-
const
|
|
2443
|
-
for (const b of
|
|
2441
|
+
if (s(q), (M = U == null ? void 0 : U.riskScoringResults) != null && M.length) {
|
|
2442
|
+
const V = U.riskScoringResults[0], F = {};
|
|
2443
|
+
for (const b of V.riskCriteriaResults ?? [])
|
|
2444
2444
|
if (b.riskCriteriaId != null && b.answer != null && b.answer !== "") {
|
|
2445
|
-
const
|
|
2446
|
-
b.answer.split(",").map((
|
|
2445
|
+
const B = [...new Set(
|
|
2446
|
+
b.answer.split(",").map((j) => j.trim()).filter((j) => j !== "")
|
|
2447
2447
|
)];
|
|
2448
|
-
|
|
2448
|
+
B.length > 0 && (F[b.riskCriteriaId] = B);
|
|
2449
2449
|
}
|
|
2450
2450
|
c(F);
|
|
2451
2451
|
}
|
|
2452
2452
|
D.current = e;
|
|
2453
|
-
} catch (
|
|
2454
|
-
|
|
2453
|
+
} catch (q) {
|
|
2454
|
+
I(q);
|
|
2455
2455
|
} finally {
|
|
2456
|
-
|
|
2456
|
+
y(!1), S.current = !1;
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
2459
|
}, [e, t, n]);
|
|
2460
2460
|
ye(() => {
|
|
2461
|
-
e && D.current !== e &&
|
|
2461
|
+
e && D.current !== e && H();
|
|
2462
2462
|
}, [e]);
|
|
2463
2463
|
const W = te(
|
|
2464
2464
|
async (M) => {
|
|
2465
|
-
|
|
2465
|
+
N(!0), I(null);
|
|
2466
2466
|
try {
|
|
2467
|
-
const
|
|
2468
|
-
return f(
|
|
2469
|
-
} catch (
|
|
2470
|
-
throw
|
|
2467
|
+
const q = await t.submitRiskScoring(M);
|
|
2468
|
+
return f(q), q;
|
|
2469
|
+
} catch (q) {
|
|
2470
|
+
throw I(q), q;
|
|
2471
2471
|
} finally {
|
|
2472
|
-
|
|
2472
|
+
N(!1);
|
|
2473
2473
|
}
|
|
2474
2474
|
},
|
|
2475
2475
|
[t]
|
|
@@ -2481,12 +2481,12 @@ function Ur(e) {
|
|
|
2481
2481
|
isLoading: u,
|
|
2482
2482
|
isSubmitting: m,
|
|
2483
2483
|
error: T,
|
|
2484
|
-
load:
|
|
2484
|
+
load: H,
|
|
2485
2485
|
submit: W
|
|
2486
2486
|
};
|
|
2487
2487
|
}
|
|
2488
2488
|
function Pt() {
|
|
2489
|
-
const { applicantService: e, config: t } =
|
|
2489
|
+
const { applicantService: e, config: t } = Ee(), [n, a] = k(!1), [s, l] = k(null), c = le(!1), u = le(!1), y = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(L) {
|
|
2490
2490
|
const f = Math.random() * 16 | 0;
|
|
2491
2491
|
return (L === "x" ? f : f & 3 | 8).toString(16);
|
|
2492
2492
|
}), m = te(
|
|
@@ -2497,7 +2497,7 @@ function Pt() {
|
|
|
2497
2497
|
c.current = !0, a(!0), l(null);
|
|
2498
2498
|
try {
|
|
2499
2499
|
if (L.applicantAdditionalDatas || (L.applicantAdditionalDatas = []), (f = t.identityProviders) != null && f.sardinai) {
|
|
2500
|
-
const D =
|
|
2500
|
+
const D = y();
|
|
2501
2501
|
console.log("[SardinAI] Generated session key:", D), L.applicantAdditionalDatas.push({
|
|
2502
2502
|
paramName: "sessionKey",
|
|
2503
2503
|
value: D
|
|
@@ -2511,7 +2511,7 @@ function Pt() {
|
|
|
2511
2511
|
}
|
|
2512
2512
|
},
|
|
2513
2513
|
[e, t]
|
|
2514
|
-
),
|
|
2514
|
+
), N = te(
|
|
2515
2515
|
async (L) => {
|
|
2516
2516
|
a(!0), l(null);
|
|
2517
2517
|
try {
|
|
@@ -2537,7 +2537,7 @@ function Pt() {
|
|
|
2537
2537
|
}
|
|
2538
2538
|
},
|
|
2539
2539
|
[e]
|
|
2540
|
-
),
|
|
2540
|
+
), I = te(
|
|
2541
2541
|
async (L) => {
|
|
2542
2542
|
a(!0), l(null);
|
|
2543
2543
|
try {
|
|
@@ -2554,12 +2554,12 @@ function Pt() {
|
|
|
2554
2554
|
isLoading: n,
|
|
2555
2555
|
error: s,
|
|
2556
2556
|
createApplicant: m,
|
|
2557
|
-
createCompanyApplicant:
|
|
2557
|
+
createCompanyApplicant: N,
|
|
2558
2558
|
getApplicantData: T,
|
|
2559
|
-
stopProgress:
|
|
2559
|
+
stopProgress: I
|
|
2560
2560
|
};
|
|
2561
2561
|
}
|
|
2562
|
-
const
|
|
2562
|
+
const Ur = {
|
|
2563
2563
|
primary: {
|
|
2564
2564
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
2565
2565
|
color: "#ffffff",
|
|
@@ -2585,7 +2585,7 @@ const Wr = {
|
|
|
2585
2585
|
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
2586
2586
|
borderColor: "transparent"
|
|
2587
2587
|
}
|
|
2588
|
-
},
|
|
2588
|
+
}, G = ({
|
|
2589
2589
|
children: e,
|
|
2590
2590
|
variant: t = "primary",
|
|
2591
2591
|
size: n = "md",
|
|
@@ -2602,7 +2602,7 @@ const Wr = {
|
|
|
2602
2602
|
md: "px-4 py-2 text-sm",
|
|
2603
2603
|
lg: "px-6 py-3 text-base"
|
|
2604
2604
|
}[n], l),
|
|
2605
|
-
style: { ...
|
|
2605
|
+
style: { ...Ur[t], ...c },
|
|
2606
2606
|
disabled: s || a,
|
|
2607
2607
|
...u,
|
|
2608
2608
|
children: [
|
|
@@ -2640,7 +2640,7 @@ const Wr = {
|
|
|
2640
2640
|
]
|
|
2641
2641
|
}
|
|
2642
2642
|
), fe = lt(
|
|
2643
|
-
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: s, className: l, style: c, ...u },
|
|
2643
|
+
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: s, className: l, style: c, ...u }, y) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2644
2644
|
e && /* @__PURE__ */ i(
|
|
2645
2645
|
"label",
|
|
2646
2646
|
{
|
|
@@ -2657,7 +2657,7 @@ const Wr = {
|
|
|
2657
2657
|
/* @__PURE__ */ r(
|
|
2658
2658
|
"input",
|
|
2659
2659
|
{
|
|
2660
|
-
ref:
|
|
2660
|
+
ref: y,
|
|
2661
2661
|
className: Ie(
|
|
2662
2662
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2663
2663
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
@@ -2697,7 +2697,7 @@ const X = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2697
2697
|
...n,
|
|
2698
2698
|
children: e
|
|
2699
2699
|
}
|
|
2700
|
-
),
|
|
2700
|
+
), xe = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2701
2701
|
"div",
|
|
2702
2702
|
{
|
|
2703
2703
|
className: Ie("px-6 py-4 border-b", t),
|
|
@@ -2707,7 +2707,7 @@ const X = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2707
2707
|
...n,
|
|
2708
2708
|
children: e
|
|
2709
2709
|
}
|
|
2710
|
-
), ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: Ie("px-6 py-4", t), ...n, children: e }),
|
|
2710
|
+
), ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: Ie("px-6 py-4", t), ...n, children: e }), ve = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2711
2711
|
"div",
|
|
2712
2712
|
{
|
|
2713
2713
|
className: Ie("px-6 py-4 border-t", t),
|
|
@@ -2788,7 +2788,7 @@ const X = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2788
2788
|
}
|
|
2789
2789
|
) });
|
|
2790
2790
|
}, bt = lt(
|
|
2791
|
-
({ label: e, error: t, helperText: n, options: a, placeholder: s, className: l, style: c, ...u },
|
|
2791
|
+
({ label: e, error: t, helperText: n, options: a, placeholder: s, className: l, style: c, ...u }, y) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2792
2792
|
e && /* @__PURE__ */ i(
|
|
2793
2793
|
"label",
|
|
2794
2794
|
{
|
|
@@ -2803,7 +2803,7 @@ const X = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2803
2803
|
/* @__PURE__ */ i(
|
|
2804
2804
|
"select",
|
|
2805
2805
|
{
|
|
2806
|
-
ref:
|
|
2806
|
+
ref: y,
|
|
2807
2807
|
className: Ie(
|
|
2808
2808
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2809
2809
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
@@ -2832,7 +2832,7 @@ const X = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2832
2832
|
},
|
|
2833
2833
|
"__placeholder__"
|
|
2834
2834
|
),
|
|
2835
|
-
a.map((m,
|
|
2835
|
+
a.map((m, N) => /* @__PURE__ */ r(
|
|
2836
2836
|
"option",
|
|
2837
2837
|
{
|
|
2838
2838
|
value: m.value,
|
|
@@ -2843,7 +2843,7 @@ const X = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2843
2843
|
},
|
|
2844
2844
|
children: m.label
|
|
2845
2845
|
},
|
|
2846
|
-
m.value || `option-${
|
|
2846
|
+
m.value || `option-${N}`
|
|
2847
2847
|
))
|
|
2848
2848
|
]
|
|
2849
2849
|
}
|
|
@@ -2862,7 +2862,7 @@ const wt = 280, qr = ({
|
|
|
2862
2862
|
disabled: l = !1,
|
|
2863
2863
|
required: c = !1
|
|
2864
2864
|
}) => {
|
|
2865
|
-
const [u,
|
|
2865
|
+
const [u, y] = k(!1), [m, N] = k(""), [T, I] = k(null), [L, f] = k({
|
|
2866
2866
|
bg: "#ffffff",
|
|
2867
2867
|
borderColor: "#d1d5db",
|
|
2868
2868
|
textPrimary: "#111827",
|
|
@@ -2870,12 +2870,12 @@ const wt = 280, qr = ({
|
|
|
2870
2870
|
primaryColor: "#2563eb",
|
|
2871
2871
|
primaryLight: "#eff6ff",
|
|
2872
2872
|
hoverBg: "#f9fafb"
|
|
2873
|
-
}), S = le(null), D = le(null),
|
|
2873
|
+
}), S = le(null), D = le(null), H = le(null), W = te(() => {
|
|
2874
2874
|
if (!D.current) return null;
|
|
2875
2875
|
const P = D.current.getBoundingClientRect(), Z = window.innerHeight - P.bottom < wt && P.top > wt;
|
|
2876
2876
|
return { top: Z ? P.top : P.bottom + 4, left: P.left, width: P.width, openUp: Z };
|
|
2877
2877
|
}, []), M = te(() => {
|
|
2878
|
-
const P = getComputedStyle(document.documentElement), K = (ue,
|
|
2878
|
+
const P = getComputedStyle(document.documentElement), K = (ue, _) => P.getPropertyValue(ue).trim() || _, Z = K("--metakyc-input-bg", K("--metakyc-background", "#ffffff"));
|
|
2879
2879
|
f({
|
|
2880
2880
|
bg: Z,
|
|
2881
2881
|
borderColor: K("--metakyc-input-border", K("--metakyc-border", "#d1d5db")),
|
|
@@ -2885,45 +2885,45 @@ const wt = 280, qr = ({
|
|
|
2885
2885
|
primaryLight: K("--metakyc-primary-light", "#eff6ff"),
|
|
2886
2886
|
hoverBg: K("--metakyc-surface", Z)
|
|
2887
2887
|
});
|
|
2888
|
-
}, []),
|
|
2888
|
+
}, []), q = te(() => {
|
|
2889
2889
|
if (l) return;
|
|
2890
2890
|
M();
|
|
2891
2891
|
const P = W();
|
|
2892
|
-
P &&
|
|
2893
|
-
}, [l, W, M]),
|
|
2894
|
-
|
|
2892
|
+
P && I(P), y(!0);
|
|
2893
|
+
}, [l, W, M]), U = te(() => {
|
|
2894
|
+
y(!1), N("");
|
|
2895
2895
|
}, []);
|
|
2896
2896
|
ye(() => {
|
|
2897
2897
|
if (!u) return;
|
|
2898
2898
|
const P = (K) => {
|
|
2899
|
-
var ue,
|
|
2899
|
+
var ue, _;
|
|
2900
2900
|
const Z = K.target;
|
|
2901
|
-
!((ue = S.current) != null && ue.contains(Z)) && !((
|
|
2901
|
+
!((ue = S.current) != null && ue.contains(Z)) && !((_ = H.current) != null && _.contains(Z)) && U();
|
|
2902
2902
|
};
|
|
2903
2903
|
return document.addEventListener("mousedown", P), () => document.removeEventListener("mousedown", P);
|
|
2904
|
-
}, [u,
|
|
2904
|
+
}, [u, U]), ye(() => {
|
|
2905
2905
|
if (!u) return;
|
|
2906
2906
|
const P = () => {
|
|
2907
2907
|
const K = W();
|
|
2908
|
-
K &&
|
|
2908
|
+
K && I(K);
|
|
2909
2909
|
};
|
|
2910
2910
|
return window.addEventListener("scroll", P, !0), window.addEventListener("resize", P), () => {
|
|
2911
2911
|
window.removeEventListener("scroll", P, !0), window.removeEventListener("resize", P);
|
|
2912
2912
|
};
|
|
2913
2913
|
}, [u, W]);
|
|
2914
|
-
const
|
|
2914
|
+
const V = a.filter(
|
|
2915
2915
|
(P) => P.label.toLowerCase().includes(m.toLowerCase())
|
|
2916
2916
|
), F = (P) => {
|
|
2917
2917
|
l || n(t.includes(P) ? t.filter((K) => K !== P) : [...t, P]);
|
|
2918
2918
|
}, b = (P, K) => {
|
|
2919
2919
|
K.stopPropagation(), l || n(t.filter((Z) => Z !== P));
|
|
2920
|
-
},
|
|
2920
|
+
}, B = (P) => {
|
|
2921
2921
|
var K;
|
|
2922
2922
|
return ((K = a.find((Z) => Z.value === P)) == null ? void 0 : K.label) || P;
|
|
2923
|
-
}, { bg:
|
|
2923
|
+
}, { bg: j, borderColor: z, textPrimary: O, textSecondary: ne, primaryColor: ae, primaryLight: re, hoverBg: he } = L, de = u && T && /* @__PURE__ */ i(
|
|
2924
2924
|
"div",
|
|
2925
2925
|
{
|
|
2926
|
-
ref:
|
|
2926
|
+
ref: H,
|
|
2927
2927
|
className: "metakyc-multiselect-dropdown",
|
|
2928
2928
|
style: {
|
|
2929
2929
|
position: "fixed",
|
|
@@ -2935,7 +2935,7 @@ const wt = 280, qr = ({
|
|
|
2935
2935
|
borderRadius: "8px",
|
|
2936
2936
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
2937
2937
|
border: `1px solid ${z}`,
|
|
2938
|
-
backgroundColor:
|
|
2938
|
+
backgroundColor: j,
|
|
2939
2939
|
overflow: "hidden"
|
|
2940
2940
|
},
|
|
2941
2941
|
children: [
|
|
@@ -2944,7 +2944,7 @@ const wt = 280, qr = ({
|
|
|
2944
2944
|
{
|
|
2945
2945
|
type: "text",
|
|
2946
2946
|
value: m,
|
|
2947
|
-
onChange: (P) =>
|
|
2947
|
+
onChange: (P) => N(P.target.value),
|
|
2948
2948
|
placeholder: "Search...",
|
|
2949
2949
|
autoFocus: !0,
|
|
2950
2950
|
onClick: (P) => P.stopPropagation(),
|
|
@@ -2956,21 +2956,21 @@ const wt = 280, qr = ({
|
|
|
2956
2956
|
fontSize: "13px",
|
|
2957
2957
|
borderRadius: "6px",
|
|
2958
2958
|
border: `1px solid ${z}`,
|
|
2959
|
-
backgroundColor:
|
|
2959
|
+
backgroundColor: j,
|
|
2960
2960
|
color: O,
|
|
2961
2961
|
outline: "none",
|
|
2962
2962
|
boxSizing: "border-box"
|
|
2963
2963
|
},
|
|
2964
2964
|
onFocus: (P) => {
|
|
2965
2965
|
const K = getComputedStyle(document.documentElement), Z = K.getPropertyValue("--metakyc-input-border-focus").trim() || K.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
2966
|
-
P.currentTarget.style.backgroundColor =
|
|
2966
|
+
P.currentTarget.style.backgroundColor = j, P.currentTarget.style.color = O, P.currentTarget.style.borderColor = Z, P.currentTarget.style.outline = "none", P.currentTarget.style.boxShadow = `0 0 0 2px ${Z}33`;
|
|
2967
2967
|
},
|
|
2968
2968
|
onBlur: (P) => {
|
|
2969
|
-
P.currentTarget.style.backgroundColor =
|
|
2969
|
+
P.currentTarget.style.backgroundColor = j, P.currentTarget.style.color = O, P.currentTarget.style.borderColor = z, P.currentTarget.style.outline = "none", P.currentTarget.style.boxShadow = "none";
|
|
2970
2970
|
}
|
|
2971
2971
|
}
|
|
2972
2972
|
) }),
|
|
2973
|
-
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children:
|
|
2973
|
+
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: V.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: ne }, children: "No results" }) : V.map((P) => {
|
|
2974
2974
|
const K = t.includes(P.value);
|
|
2975
2975
|
return /* @__PURE__ */ i(
|
|
2976
2976
|
"li",
|
|
@@ -3015,7 +3015,7 @@ const wt = 280, qr = ({
|
|
|
3015
3015
|
{
|
|
3016
3016
|
type: "button",
|
|
3017
3017
|
onClick: () => {
|
|
3018
|
-
n([]),
|
|
3018
|
+
n([]), N("");
|
|
3019
3019
|
},
|
|
3020
3020
|
style: { fontSize: "12px", color: "#ef4444", background: "none", border: "none", cursor: "pointer", padding: 0 },
|
|
3021
3021
|
children: [
|
|
@@ -3044,7 +3044,7 @@ const wt = 280, qr = ({
|
|
|
3044
3044
|
"div",
|
|
3045
3045
|
{
|
|
3046
3046
|
ref: D,
|
|
3047
|
-
onClick: () => u ?
|
|
3047
|
+
onClick: () => u ? U() : q(),
|
|
3048
3048
|
className: Ie(
|
|
3049
3049
|
"metakyc-multiselect-trigger",
|
|
3050
3050
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
@@ -3073,7 +3073,7 @@ const wt = 280, qr = ({
|
|
|
3073
3073
|
color: "var(--metakyc-primary, #2563eb)"
|
|
3074
3074
|
},
|
|
3075
3075
|
children: [
|
|
3076
|
-
|
|
3076
|
+
B(P),
|
|
3077
3077
|
!l && /* @__PURE__ */ r(
|
|
3078
3078
|
"button",
|
|
3079
3079
|
{
|
|
@@ -3119,7 +3119,7 @@ const wt = 280, qr = ({
|
|
|
3119
3119
|
),
|
|
3120
3120
|
typeof document < "u" && de ? ft(de, document.body) : null
|
|
3121
3121
|
] });
|
|
3122
|
-
}, St = 260,
|
|
3122
|
+
}, St = 260, $e = ({
|
|
3123
3123
|
label: e,
|
|
3124
3124
|
error: t,
|
|
3125
3125
|
helperText: n,
|
|
@@ -3128,11 +3128,11 @@ const wt = 280, qr = ({
|
|
|
3128
3128
|
value: l,
|
|
3129
3129
|
onChange: c,
|
|
3130
3130
|
disabled: u = !1,
|
|
3131
|
-
required:
|
|
3131
|
+
required: y = !1,
|
|
3132
3132
|
className: m
|
|
3133
3133
|
}) => {
|
|
3134
|
-
var
|
|
3135
|
-
const [
|
|
3134
|
+
var _;
|
|
3135
|
+
const [N, T] = k(!1), [I, L] = k(""), [f, S] = k(null), [D, H] = k({
|
|
3136
3136
|
bg: "#ffffff",
|
|
3137
3137
|
border: "#d1d5db",
|
|
3138
3138
|
text: "#111827",
|
|
@@ -3141,64 +3141,64 @@ const wt = 280, qr = ({
|
|
|
3141
3141
|
primaryLight: "#eff6ff",
|
|
3142
3142
|
hoverBg: "#f9fafb"
|
|
3143
3143
|
}), W = te(() => {
|
|
3144
|
-
const x = getComputedStyle(document.documentElement),
|
|
3145
|
-
|
|
3146
|
-
bg:
|
|
3147
|
-
border:
|
|
3148
|
-
text:
|
|
3149
|
-
textSecondary:
|
|
3150
|
-
primary:
|
|
3151
|
-
primaryLight:
|
|
3152
|
-
hoverBg:
|
|
3144
|
+
const x = getComputedStyle(document.documentElement), J = (ce, Se) => x.getPropertyValue(ce).trim() || Se, Q = J("--metakyc-input-bg", J("--metakyc-background", "#ffffff"));
|
|
3145
|
+
H({
|
|
3146
|
+
bg: Q,
|
|
3147
|
+
border: J("--metakyc-input-border", J("--metakyc-border", "#d1d5db")),
|
|
3148
|
+
text: J("--metakyc-input-text", J("--metakyc-text-primary", "#111827")),
|
|
3149
|
+
textSecondary: J("--metakyc-text-secondary", "#6b7280"),
|
|
3150
|
+
primary: J("--metakyc-primary", "#2563eb"),
|
|
3151
|
+
primaryLight: J("--metakyc-primary-light", "#eff6ff"),
|
|
3152
|
+
hoverBg: J("--metakyc-surface", Q)
|
|
3153
3153
|
});
|
|
3154
|
-
}, []), M = le(null),
|
|
3155
|
-
if (!
|
|
3156
|
-
const x =
|
|
3154
|
+
}, []), M = le(null), q = le(null), U = le(null), V = le(null), F = te(() => {
|
|
3155
|
+
if (!q.current) return null;
|
|
3156
|
+
const x = q.current.getBoundingClientRect(), Q = window.innerHeight - x.bottom < St && x.top > St;
|
|
3157
3157
|
return {
|
|
3158
|
-
top:
|
|
3158
|
+
top: Q ? x.top : x.bottom + 4,
|
|
3159
3159
|
left: x.left,
|
|
3160
3160
|
width: x.width,
|
|
3161
|
-
openUp:
|
|
3161
|
+
openUp: Q
|
|
3162
3162
|
};
|
|
3163
3163
|
}, []), b = te(() => {
|
|
3164
3164
|
if (u) return;
|
|
3165
3165
|
W();
|
|
3166
3166
|
const x = F();
|
|
3167
3167
|
x && S(x), T(!0);
|
|
3168
|
-
}, [u, F, W]),
|
|
3168
|
+
}, [u, F, W]), B = te(() => {
|
|
3169
3169
|
T(!1), L("");
|
|
3170
|
-
}, []),
|
|
3170
|
+
}, []), j = () => N ? B() : b();
|
|
3171
3171
|
ye(() => {
|
|
3172
|
-
if (!
|
|
3173
|
-
const x = (
|
|
3174
|
-
var ce,
|
|
3175
|
-
const
|
|
3176
|
-
!((ce = M.current) != null && ce.contains(
|
|
3172
|
+
if (!N) return;
|
|
3173
|
+
const x = (J) => {
|
|
3174
|
+
var ce, Se;
|
|
3175
|
+
const Q = J.target;
|
|
3176
|
+
!((ce = M.current) != null && ce.contains(Q)) && !((Se = U.current) != null && Se.contains(Q)) && B();
|
|
3177
3177
|
};
|
|
3178
3178
|
return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
|
|
3179
|
-
}, [
|
|
3180
|
-
if (!
|
|
3179
|
+
}, [N, B]), ye(() => {
|
|
3180
|
+
if (!N) return;
|
|
3181
3181
|
const x = () => {
|
|
3182
|
-
const
|
|
3183
|
-
|
|
3182
|
+
const J = F();
|
|
3183
|
+
J && S(J);
|
|
3184
3184
|
};
|
|
3185
3185
|
return window.addEventListener("scroll", x, !0), window.addEventListener("resize", x), () => {
|
|
3186
3186
|
window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x);
|
|
3187
3187
|
};
|
|
3188
|
-
}, [
|
|
3189
|
-
|
|
3188
|
+
}, [N, F]), ye(() => {
|
|
3189
|
+
N && V.current && setTimeout(() => {
|
|
3190
3190
|
var x;
|
|
3191
|
-
return (x =
|
|
3191
|
+
return (x = V.current) == null ? void 0 : x.focus();
|
|
3192
3192
|
}, 0);
|
|
3193
|
-
}, [
|
|
3193
|
+
}, [N]);
|
|
3194
3194
|
const z = a.filter(
|
|
3195
|
-
(x) => x.label.toLowerCase().includes(
|
|
3196
|
-
), O = (
|
|
3197
|
-
u ||
|
|
3198
|
-
}, { bg: ae, border: re, text: he, textSecondary: de, primary: P, primaryLight: K, hoverBg: Z } = D, ue =
|
|
3195
|
+
(x) => x.label.toLowerCase().includes(I.toLowerCase()) || x.value.toLowerCase().includes(I.toLowerCase())
|
|
3196
|
+
), O = (_ = a.find((x) => x.value === l)) == null ? void 0 : _.label, ne = (x, J) => {
|
|
3197
|
+
u || J || (c(x), B());
|
|
3198
|
+
}, { bg: ae, border: re, text: he, textSecondary: de, primary: P, primaryLight: K, hoverBg: Z } = D, ue = N && f && /* @__PURE__ */ i(
|
|
3199
3199
|
"div",
|
|
3200
3200
|
{
|
|
3201
|
-
ref:
|
|
3201
|
+
ref: U,
|
|
3202
3202
|
className: "metakyc-searchable-select-dropdown",
|
|
3203
3203
|
style: {
|
|
3204
3204
|
position: "fixed",
|
|
@@ -3217,9 +3217,9 @@ const wt = 280, qr = ({
|
|
|
3217
3217
|
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${re}` }, children: /* @__PURE__ */ r(
|
|
3218
3218
|
"input",
|
|
3219
3219
|
{
|
|
3220
|
-
ref:
|
|
3220
|
+
ref: V,
|
|
3221
3221
|
type: "text",
|
|
3222
|
-
value:
|
|
3222
|
+
value: I,
|
|
3223
3223
|
onChange: (x) => L(x.target.value),
|
|
3224
3224
|
placeholder: "Search...",
|
|
3225
3225
|
onClick: (x) => x.stopPropagation(),
|
|
@@ -3237,8 +3237,8 @@ const wt = 280, qr = ({
|
|
|
3237
3237
|
boxSizing: "border-box"
|
|
3238
3238
|
},
|
|
3239
3239
|
onFocus: (x) => {
|
|
3240
|
-
const
|
|
3241
|
-
x.currentTarget.style.backgroundColor = ae, x.currentTarget.style.color = he, x.currentTarget.style.borderColor =
|
|
3240
|
+
const J = getComputedStyle(document.documentElement), Q = J.getPropertyValue("--metakyc-input-border-focus").trim() || J.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3241
|
+
x.currentTarget.style.backgroundColor = ae, x.currentTarget.style.color = he, x.currentTarget.style.borderColor = Q, x.currentTarget.style.outline = "none", x.currentTarget.style.boxShadow = `0 0 0 2px ${Q}33`;
|
|
3242
3242
|
},
|
|
3243
3243
|
onBlur: (x) => {
|
|
3244
3244
|
x.currentTarget.style.backgroundColor = ae, x.currentTarget.style.color = he, x.currentTarget.style.borderColor = re, x.currentTarget.style.outline = "none", x.currentTarget.style.boxShadow = "none";
|
|
@@ -3256,7 +3256,7 @@ const wt = 280, qr = ({
|
|
|
3256
3256
|
overflowY: "auto"
|
|
3257
3257
|
},
|
|
3258
3258
|
children: z.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: de }, children: "No results" }) : z.map((x) => {
|
|
3259
|
-
const
|
|
3259
|
+
const J = x.value === l;
|
|
3260
3260
|
return /* @__PURE__ */ r(
|
|
3261
3261
|
"li",
|
|
3262
3262
|
{
|
|
@@ -3267,15 +3267,15 @@ const wt = 280, qr = ({
|
|
|
3267
3267
|
fontSize: "13px",
|
|
3268
3268
|
cursor: x.disabled ? "not-allowed" : "pointer",
|
|
3269
3269
|
opacity: x.disabled ? 0.4 : 1,
|
|
3270
|
-
backgroundColor:
|
|
3271
|
-
color:
|
|
3270
|
+
backgroundColor: J ? K : "transparent",
|
|
3271
|
+
color: J ? P : he,
|
|
3272
3272
|
userSelect: "none"
|
|
3273
3273
|
},
|
|
3274
|
-
onMouseEnter: (
|
|
3275
|
-
!
|
|
3274
|
+
onMouseEnter: (Q) => {
|
|
3275
|
+
!J && !x.disabled && (Q.currentTarget.style.backgroundColor = Z);
|
|
3276
3276
|
},
|
|
3277
|
-
onMouseLeave: (
|
|
3278
|
-
|
|
3277
|
+
onMouseLeave: (Q) => {
|
|
3278
|
+
J || (Q.currentTarget.style.backgroundColor = "transparent");
|
|
3279
3279
|
},
|
|
3280
3280
|
children: x.label
|
|
3281
3281
|
},
|
|
@@ -3300,19 +3300,19 @@ const wt = 280, qr = ({
|
|
|
3300
3300
|
style: { color: "var(--metakyc-text-primary, #374151)" },
|
|
3301
3301
|
children: [
|
|
3302
3302
|
e,
|
|
3303
|
-
|
|
3303
|
+
y && /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-error, #ef4444)", marginLeft: "4px" }, children: "*" })
|
|
3304
3304
|
]
|
|
3305
3305
|
}
|
|
3306
3306
|
),
|
|
3307
3307
|
/* @__PURE__ */ i(
|
|
3308
3308
|
"div",
|
|
3309
3309
|
{
|
|
3310
|
-
ref:
|
|
3310
|
+
ref: q,
|
|
3311
3311
|
role: "button",
|
|
3312
3312
|
tabIndex: u ? -1 : 0,
|
|
3313
|
-
onClick:
|
|
3313
|
+
onClick: j,
|
|
3314
3314
|
onKeyDown: (x) => {
|
|
3315
|
-
(x.key === "Enter" || x.key === " ") && (x.preventDefault(),
|
|
3315
|
+
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), j()), x.key === "Escape" && B();
|
|
3316
3316
|
},
|
|
3317
3317
|
className: Ie(
|
|
3318
3318
|
"metakyc-searchable-select-trigger",
|
|
@@ -3324,9 +3324,9 @@ const wt = 280, qr = ({
|
|
|
3324
3324
|
style: {
|
|
3325
3325
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
3326
3326
|
color: O ? "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))" : "var(--metakyc-input-placeholder, var(--metakyc-text-muted, #9ca3af))",
|
|
3327
|
-
borderColor: t ? "var(--metakyc-danger, #ef4444)" :
|
|
3327
|
+
borderColor: t ? "var(--metakyc-danger, #ef4444)" : N ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
3328
3328
|
minHeight: "42px",
|
|
3329
|
-
outline:
|
|
3329
|
+
outline: N ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
3330
3330
|
outlineOffset: "-1px"
|
|
3331
3331
|
},
|
|
3332
3332
|
children: [
|
|
@@ -3336,7 +3336,7 @@ const wt = 280, qr = ({
|
|
|
3336
3336
|
{
|
|
3337
3337
|
className: "flex-shrink-0 text-xs pointer-events-none",
|
|
3338
3338
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
3339
|
-
children:
|
|
3339
|
+
children: N ? "▲" : "▼"
|
|
3340
3340
|
}
|
|
3341
3341
|
)
|
|
3342
3342
|
]
|
|
@@ -3349,7 +3349,7 @@ const wt = 280, qr = ({
|
|
|
3349
3349
|
}
|
|
3350
3350
|
);
|
|
3351
3351
|
};
|
|
3352
|
-
|
|
3352
|
+
$e.displayName = "SearchableSelect";
|
|
3353
3353
|
function Yr(e) {
|
|
3354
3354
|
const t = e.type;
|
|
3355
3355
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : "file";
|
|
@@ -3363,32 +3363,32 @@ const Vr = ({
|
|
|
3363
3363
|
maxSize: l,
|
|
3364
3364
|
required: c,
|
|
3365
3365
|
onChange: u,
|
|
3366
|
-
value:
|
|
3366
|
+
value: y = [],
|
|
3367
3367
|
className: m
|
|
3368
3368
|
}) => {
|
|
3369
|
-
const [
|
|
3369
|
+
const [N, T] = k(!1), [I, L] = k(null), f = le(null), S = te((F) => {
|
|
3370
3370
|
if (!F) return;
|
|
3371
3371
|
L(null);
|
|
3372
3372
|
const b = Array.from(F);
|
|
3373
|
-
if (l && b.filter((
|
|
3373
|
+
if (l && b.filter((j) => j.size > l).length > 0) {
|
|
3374
3374
|
L(`File exceeds the maximum size of ${mt(l)}`);
|
|
3375
3375
|
return;
|
|
3376
3376
|
}
|
|
3377
|
-
u == null || u(s ? [...
|
|
3378
|
-
}, [l, s, u,
|
|
3377
|
+
u == null || u(s ? [...y, ...b] : [b[0]]);
|
|
3378
|
+
}, [l, s, u, y]), D = te((F) => {
|
|
3379
3379
|
F.preventDefault(), F.stopPropagation(), T(!0);
|
|
3380
|
-
}, []),
|
|
3380
|
+
}, []), H = te((F) => {
|
|
3381
3381
|
F.preventDefault(), F.stopPropagation(), T(!1);
|
|
3382
3382
|
}, []), W = te((F) => {
|
|
3383
3383
|
F.preventDefault(), F.stopPropagation(), T(!1), S(F.dataTransfer.files);
|
|
3384
3384
|
}, [S]), M = () => {
|
|
3385
3385
|
var F;
|
|
3386
3386
|
(F = f.current) == null || F.click();
|
|
3387
|
-
},
|
|
3387
|
+
}, q = (F) => {
|
|
3388
3388
|
L(null);
|
|
3389
|
-
const b =
|
|
3389
|
+
const b = y.filter((B, j) => j !== F);
|
|
3390
3390
|
u == null || u(b);
|
|
3391
|
-
},
|
|
3391
|
+
}, U = n || I, V = y.length > 0;
|
|
3392
3392
|
return /* @__PURE__ */ i("div", { className: Ie("metakyc-file-upload", m), style: { width: "100%" }, children: [
|
|
3393
3393
|
e && /* @__PURE__ */ i("div", { style: { marginBottom: "8px" }, children: [
|
|
3394
3394
|
/* @__PURE__ */ i(
|
|
@@ -3414,16 +3414,16 @@ const Vr = ({
|
|
|
3414
3414
|
className: "metakyc-file-dropzone",
|
|
3415
3415
|
onClick: M,
|
|
3416
3416
|
onDragOver: D,
|
|
3417
|
-
onDragLeave:
|
|
3417
|
+
onDragLeave: H,
|
|
3418
3418
|
onDrop: W,
|
|
3419
3419
|
style: {
|
|
3420
|
-
border: `2px dashed ${
|
|
3420
|
+
border: `2px dashed ${U ? "var(--metakyc-danger, #ef4444)" : N ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
|
|
3421
3421
|
borderRadius: "12px",
|
|
3422
|
-
padding:
|
|
3422
|
+
padding: V ? "20px" : "32px 20px",
|
|
3423
3423
|
textAlign: "center",
|
|
3424
3424
|
cursor: "pointer",
|
|
3425
3425
|
transition: "all 0.2s ease",
|
|
3426
|
-
backgroundColor:
|
|
3426
|
+
backgroundColor: N ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 5%, var(--metakyc-background, #ffffff))" : "var(--metakyc-background, #ffffff)"
|
|
3427
3427
|
},
|
|
3428
3428
|
children: [
|
|
3429
3429
|
/* @__PURE__ */ r(
|
|
@@ -3450,7 +3450,7 @@ const Vr = ({
|
|
|
3450
3450
|
display: "flex",
|
|
3451
3451
|
alignItems: "center",
|
|
3452
3452
|
justifyContent: "center",
|
|
3453
|
-
backgroundColor:
|
|
3453
|
+
backgroundColor: N ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "var(--metakyc-surface, #f9fafb)",
|
|
3454
3454
|
transition: "background-color 0.2s ease"
|
|
3455
3455
|
},
|
|
3456
3456
|
children: /* @__PURE__ */ i(
|
|
@@ -3460,7 +3460,7 @@ const Vr = ({
|
|
|
3460
3460
|
height: "24",
|
|
3461
3461
|
viewBox: "0 0 24 24",
|
|
3462
3462
|
fill: "none",
|
|
3463
|
-
stroke:
|
|
3463
|
+
stroke: N ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
3464
3464
|
strokeWidth: "2",
|
|
3465
3465
|
strokeLinecap: "round",
|
|
3466
3466
|
strokeLinejoin: "round",
|
|
@@ -3493,8 +3493,8 @@ const Vr = ({
|
|
|
3493
3493
|
]
|
|
3494
3494
|
}
|
|
3495
3495
|
),
|
|
3496
|
-
|
|
3497
|
-
const
|
|
3496
|
+
V && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((F, b) => {
|
|
3497
|
+
const B = Yr(F), j = B === "image", z = j ? URL.createObjectURL(F) : null;
|
|
3498
3498
|
return /* @__PURE__ */ i(
|
|
3499
3499
|
"div",
|
|
3500
3500
|
{
|
|
@@ -3522,16 +3522,16 @@ const Vr = ({
|
|
|
3522
3522
|
alignItems: "center",
|
|
3523
3523
|
justifyContent: "center",
|
|
3524
3524
|
overflow: "hidden",
|
|
3525
|
-
backgroundColor:
|
|
3525
|
+
backgroundColor: j ? "transparent" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 10%, transparent)"
|
|
3526
3526
|
},
|
|
3527
|
-
children:
|
|
3527
|
+
children: j && z ? /* @__PURE__ */ r(
|
|
3528
3528
|
"img",
|
|
3529
3529
|
{
|
|
3530
3530
|
src: z,
|
|
3531
3531
|
alt: F.name,
|
|
3532
3532
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
3533
3533
|
}
|
|
3534
|
-
) :
|
|
3534
|
+
) : B === "pdf" ? /* @__PURE__ */ i("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3535
3535
|
/* @__PURE__ */ r("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
3536
3536
|
/* @__PURE__ */ r("polyline", { points: "14 2 14 8 20 8" }),
|
|
3537
3537
|
/* @__PURE__ */ r("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
@@ -3560,7 +3560,7 @@ const Vr = ({
|
|
|
3560
3560
|
{
|
|
3561
3561
|
type: "button",
|
|
3562
3562
|
onClick: (O) => {
|
|
3563
|
-
O.stopPropagation(),
|
|
3563
|
+
O.stopPropagation(), q(b);
|
|
3564
3564
|
},
|
|
3565
3565
|
style: {
|
|
3566
3566
|
display: "flex",
|
|
@@ -3594,7 +3594,7 @@ const Vr = ({
|
|
|
3594
3594
|
`${F.name}-${b}`
|
|
3595
3595
|
);
|
|
3596
3596
|
}) }),
|
|
3597
|
-
|
|
3597
|
+
U && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: U })
|
|
3598
3598
|
] });
|
|
3599
3599
|
}, Qr = lt(
|
|
3600
3600
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, s) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
@@ -3722,10 +3722,10 @@ const en = lt(
|
|
|
3722
3722
|
children: l,
|
|
3723
3723
|
iconNode: c,
|
|
3724
3724
|
...u
|
|
3725
|
-
},
|
|
3725
|
+
}, y) => gt(
|
|
3726
3726
|
"svg",
|
|
3727
3727
|
{
|
|
3728
|
-
ref:
|
|
3728
|
+
ref: y,
|
|
3729
3729
|
...Zr,
|
|
3730
3730
|
width: t,
|
|
3731
3731
|
height: t,
|
|
@@ -3736,7 +3736,7 @@ const en = lt(
|
|
|
3736
3736
|
...u
|
|
3737
3737
|
},
|
|
3738
3738
|
[
|
|
3739
|
-
...c.map(([m,
|
|
3739
|
+
...c.map(([m, N]) => gt(m, N)),
|
|
3740
3740
|
...Array.isArray(l) ? l : [l]
|
|
3741
3741
|
]
|
|
3742
3742
|
)
|
|
@@ -3820,43 +3820,43 @@ const sn = ({
|
|
|
3820
3820
|
onComplete: t,
|
|
3821
3821
|
onBack: n
|
|
3822
3822
|
}) => {
|
|
3823
|
-
const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit:
|
|
3824
|
-
|
|
3825
|
-
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 &&
|
|
3823
|
+
const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: y } = $r(e), [m, N] = k({}), [T, I] = k({}), [L, f] = k(0);
|
|
3824
|
+
be.useEffect(() => {
|
|
3825
|
+
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && N(s);
|
|
3826
3826
|
}, [s]);
|
|
3827
3827
|
const S = Ae(
|
|
3828
3828
|
() => a ? an(a.questionGroups) : [],
|
|
3829
3829
|
[a]
|
|
3830
|
-
), D = L === S.length - 1,
|
|
3831
|
-
|
|
3832
|
-
const
|
|
3833
|
-
return delete
|
|
3830
|
+
), D = L === S.length - 1, H = S[L] ?? [], W = te((F, b) => {
|
|
3831
|
+
N((B) => ({ ...B, [F]: b })), I((B) => {
|
|
3832
|
+
const j = { ...B };
|
|
3833
|
+
return delete j[F], j;
|
|
3834
3834
|
});
|
|
3835
3835
|
}, []), M = te(() => {
|
|
3836
3836
|
const F = {};
|
|
3837
|
-
for (const { question: b } of
|
|
3838
|
-
const
|
|
3839
|
-
|
|
3837
|
+
for (const { question: b } of H) {
|
|
3838
|
+
const B = nn(b, m[b.id] ?? []);
|
|
3839
|
+
B && (F[b.id] = B);
|
|
3840
3840
|
}
|
|
3841
|
-
return
|
|
3842
|
-
}, [
|
|
3841
|
+
return I((b) => ({ ...b, ...F })), Object.keys(F).length === 0;
|
|
3842
|
+
}, [H, m]), q = () => {
|
|
3843
3843
|
M() && f((F) => F + 1);
|
|
3844
|
-
},
|
|
3844
|
+
}, U = () => {
|
|
3845
3845
|
L > 0 ? f((F) => F - 1) : n == null || n();
|
|
3846
|
-
},
|
|
3846
|
+
}, V = async () => {
|
|
3847
3847
|
if (!(!M() || !a))
|
|
3848
3848
|
try {
|
|
3849
3849
|
const F = a.questionGroups.flatMap(
|
|
3850
|
-
(
|
|
3851
|
-
questionId:
|
|
3852
|
-
values: m[
|
|
3850
|
+
(B) => (B.questions ?? []).map((j) => ({
|
|
3851
|
+
questionId: j.id,
|
|
3852
|
+
values: m[j.id] ?? []
|
|
3853
3853
|
}))
|
|
3854
3854
|
), b = {
|
|
3855
3855
|
applicantId: e,
|
|
3856
3856
|
questionnarieId: a.id,
|
|
3857
3857
|
questionResults: F
|
|
3858
3858
|
};
|
|
3859
|
-
await
|
|
3859
|
+
await y(b), t == null || t();
|
|
3860
3860
|
} catch (F) {
|
|
3861
3861
|
console.error("Questionnaire submit error:", F);
|
|
3862
3862
|
}
|
|
@@ -3865,7 +3865,7 @@ const sn = ({
|
|
|
3865
3865
|
"Error loading questionnaire: ",
|
|
3866
3866
|
u.message
|
|
3867
3867
|
] }) }) }) : a ? /* @__PURE__ */ i(X, { children: [
|
|
3868
|
-
/* @__PURE__ */ i(
|
|
3868
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
3869
3869
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3870
3870
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
|
|
3871
3871
|
S.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
@@ -3889,7 +3889,7 @@ const sn = ({
|
|
|
3889
3889
|
)) })
|
|
3890
3890
|
] })
|
|
3891
3891
|
] }),
|
|
3892
|
-
/* @__PURE__ */ r(ee, { className: "space-y-6", children:
|
|
3892
|
+
/* @__PURE__ */ r(ee, { className: "space-y-6", children: H.map(({ question: F }) => /* @__PURE__ */ r(
|
|
3893
3893
|
on,
|
|
3894
3894
|
{
|
|
3895
3895
|
question: F,
|
|
@@ -3899,13 +3899,13 @@ const sn = ({
|
|
|
3899
3899
|
},
|
|
3900
3900
|
F.id
|
|
3901
3901
|
)) }),
|
|
3902
|
-
/* @__PURE__ */ i(
|
|
3902
|
+
/* @__PURE__ */ i(ve, { className: "flex items-center justify-between", children: [
|
|
3903
3903
|
/* @__PURE__ */ i(
|
|
3904
|
-
|
|
3904
|
+
G,
|
|
3905
3905
|
{
|
|
3906
3906
|
type: "button",
|
|
3907
3907
|
variant: "outline",
|
|
3908
|
-
onClick:
|
|
3908
|
+
onClick: U,
|
|
3909
3909
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3910
3910
|
children: [
|
|
3911
3911
|
/* @__PURE__ */ r(Mt, { size: 14 }),
|
|
@@ -3914,18 +3914,18 @@ const sn = ({
|
|
|
3914
3914
|
}
|
|
3915
3915
|
),
|
|
3916
3916
|
D ? /* @__PURE__ */ r(
|
|
3917
|
-
|
|
3917
|
+
G,
|
|
3918
3918
|
{
|
|
3919
3919
|
type: "button",
|
|
3920
3920
|
isLoading: c,
|
|
3921
|
-
onClick:
|
|
3921
|
+
onClick: V,
|
|
3922
3922
|
children: "Continue"
|
|
3923
3923
|
}
|
|
3924
3924
|
) : /* @__PURE__ */ i(
|
|
3925
|
-
|
|
3925
|
+
G,
|
|
3926
3926
|
{
|
|
3927
3927
|
type: "button",
|
|
3928
|
-
onClick:
|
|
3928
|
+
onClick: q,
|
|
3929
3929
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3930
3930
|
children: [
|
|
3931
3931
|
"Next",
|
|
@@ -4015,8 +4015,8 @@ const sn = ({
|
|
|
4015
4015
|
{
|
|
4016
4016
|
type: "checkbox",
|
|
4017
4017
|
checked: t.includes(u),
|
|
4018
|
-
onChange: (
|
|
4019
|
-
|
|
4018
|
+
onChange: (y) => {
|
|
4019
|
+
y.target.checked ? a([...t, u]) : a(t.filter((m) => m !== u));
|
|
4020
4020
|
},
|
|
4021
4021
|
className: "metakyc-option-input",
|
|
4022
4022
|
style: {
|
|
@@ -4057,41 +4057,41 @@ const cn = ({
|
|
|
4057
4057
|
onComplete: t,
|
|
4058
4058
|
onBack: n
|
|
4059
4059
|
}) => {
|
|
4060
|
-
const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = _r(e), [
|
|
4060
|
+
const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = _r(e), [y, m] = k({}), [N, T] = k(null), [I, L] = k(0), [f, S] = k({}), D = Ae(
|
|
4061
4061
|
() => a ? ln(a.uploadDocumentFiles) : [],
|
|
4062
4062
|
[a]
|
|
4063
|
-
),
|
|
4063
|
+
), H = D[I] ?? [], W = I === D.length - 1, M = D.length, q = te(() => {
|
|
4064
4064
|
const b = {};
|
|
4065
|
-
for (const
|
|
4066
|
-
|
|
4065
|
+
for (const B of H)
|
|
4066
|
+
B.isRequired && (y[B.id] || []).length === 0 && (b[B.id] = `${B.displayName} is required`);
|
|
4067
4067
|
return S(b), Object.keys(b).length === 0;
|
|
4068
|
-
}, [
|
|
4069
|
-
|
|
4070
|
-
},
|
|
4071
|
-
|
|
4068
|
+
}, [H, y]), U = () => {
|
|
4069
|
+
q() && (L((b) => b + 1), S({}));
|
|
4070
|
+
}, V = () => {
|
|
4071
|
+
I > 0 ? (L((b) => b - 1), S({})) : n == null || n();
|
|
4072
4072
|
}, F = async () => {
|
|
4073
|
-
if (!(!
|
|
4073
|
+
if (!(!q() || !a)) {
|
|
4074
4074
|
T(null);
|
|
4075
4075
|
try {
|
|
4076
4076
|
const b = await Promise.all(
|
|
4077
|
-
a.uploadDocumentFiles.map(async (
|
|
4078
|
-
const z =
|
|
4077
|
+
a.uploadDocumentFiles.map(async (j) => {
|
|
4078
|
+
const z = y[j.id] || [], O = await Promise.all(
|
|
4079
4079
|
z.map(async (ne) => ({
|
|
4080
4080
|
fileName: ne.name,
|
|
4081
4081
|
fileData: await Lr(ne)
|
|
4082
4082
|
}))
|
|
4083
4083
|
);
|
|
4084
4084
|
return {
|
|
4085
|
-
uploadDocumentFileId:
|
|
4085
|
+
uploadDocumentFileId: j.id,
|
|
4086
4086
|
valueList: O
|
|
4087
4087
|
};
|
|
4088
4088
|
})
|
|
4089
|
-
),
|
|
4089
|
+
), B = {
|
|
4090
4090
|
applicantId: e,
|
|
4091
4091
|
uploadDocumentId: a.id,
|
|
4092
4092
|
uploadDocumentResults: b
|
|
4093
4093
|
};
|
|
4094
|
-
await u(
|
|
4094
|
+
await u(B), t == null || t();
|
|
4095
4095
|
} catch (b) {
|
|
4096
4096
|
T((b == null ? void 0 : b.message) || "Failed to submit documents. Please try again.");
|
|
4097
4097
|
}
|
|
@@ -4124,7 +4124,7 @@ const cn = ({
|
|
|
4124
4124
|
/* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-danger, #ef4444)", fontWeight: 500 }, children: "Error loading document requirements" }),
|
|
4125
4125
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: c.message })
|
|
4126
4126
|
] }) }) }) : a ? /* @__PURE__ */ i(X, { children: [
|
|
4127
|
-
/* @__PURE__ */ i(
|
|
4127
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
4128
4128
|
/* @__PURE__ */ r("h2", { style: {
|
|
4129
4129
|
fontSize: "18px",
|
|
4130
4130
|
fontWeight: 700,
|
|
@@ -4144,26 +4144,26 @@ const cn = ({
|
|
|
4144
4144
|
}, children: [
|
|
4145
4145
|
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
4146
4146
|
"Page ",
|
|
4147
|
-
|
|
4147
|
+
I + 1,
|
|
4148
4148
|
" of ",
|
|
4149
4149
|
M
|
|
4150
4150
|
] }),
|
|
4151
|
-
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: D.map((b,
|
|
4151
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: D.map((b, B) => /* @__PURE__ */ r(
|
|
4152
4152
|
"div",
|
|
4153
4153
|
{
|
|
4154
4154
|
style: {
|
|
4155
4155
|
height: "6px",
|
|
4156
|
-
width:
|
|
4156
|
+
width: B === I ? "20px" : "6px",
|
|
4157
4157
|
borderRadius: "999px",
|
|
4158
4158
|
transition: "all 0.2s ease",
|
|
4159
|
-
backgroundColor:
|
|
4159
|
+
backgroundColor: B <= I ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
4160
4160
|
}
|
|
4161
4161
|
},
|
|
4162
|
-
|
|
4162
|
+
B
|
|
4163
4163
|
)) })
|
|
4164
4164
|
] })
|
|
4165
4165
|
] }),
|
|
4166
|
-
a.description &&
|
|
4166
|
+
a.description && I === 0 && /* @__PURE__ */ i("div", { style: {
|
|
4167
4167
|
margin: "0 24px",
|
|
4168
4168
|
marginTop: "4px",
|
|
4169
4169
|
display: "flex",
|
|
@@ -4199,7 +4199,7 @@ const cn = ({
|
|
|
4199
4199
|
lineHeight: 1.5
|
|
4200
4200
|
}, children: a.description })
|
|
4201
4201
|
] }),
|
|
4202
|
-
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children:
|
|
4202
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: H.map((b) => /* @__PURE__ */ r(
|
|
4203
4203
|
Vr,
|
|
4204
4204
|
{
|
|
4205
4205
|
label: b.displayName,
|
|
@@ -4209,17 +4209,17 @@ const cn = ({
|
|
|
4209
4209
|
maxSize: b.maxEachFileSizeByte,
|
|
4210
4210
|
required: b.isRequired,
|
|
4211
4211
|
error: f[b.id],
|
|
4212
|
-
value:
|
|
4213
|
-
onChange: (
|
|
4214
|
-
T(null), S((
|
|
4215
|
-
const z = { ...
|
|
4212
|
+
value: y[b.id] || [],
|
|
4213
|
+
onChange: (B) => {
|
|
4214
|
+
T(null), S((j) => {
|
|
4215
|
+
const z = { ...j };
|
|
4216
4216
|
return delete z[b.id], z;
|
|
4217
|
-
}), m((
|
|
4217
|
+
}), m((j) => ({ ...j, [b.id]: B }));
|
|
4218
4218
|
}
|
|
4219
4219
|
},
|
|
4220
4220
|
b.id
|
|
4221
4221
|
)) }) }),
|
|
4222
|
-
|
|
4222
|
+
N && /* @__PURE__ */ i("div", { style: {
|
|
4223
4223
|
margin: "0 24px",
|
|
4224
4224
|
padding: "10px 14px",
|
|
4225
4225
|
borderRadius: "8px",
|
|
@@ -4234,25 +4234,25 @@ const cn = ({
|
|
|
4234
4234
|
/* @__PURE__ */ r("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
4235
4235
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
4236
4236
|
] }),
|
|
4237
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
4237
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: N })
|
|
4238
4238
|
] }),
|
|
4239
|
-
/* @__PURE__ */ r(
|
|
4239
|
+
/* @__PURE__ */ r(ve, { children: /* @__PURE__ */ i("div", { style: {
|
|
4240
4240
|
display: "flex",
|
|
4241
4241
|
alignItems: "center",
|
|
4242
4242
|
justifyContent: "space-between",
|
|
4243
4243
|
width: "100%"
|
|
4244
4244
|
}, children: [
|
|
4245
4245
|
/* @__PURE__ */ r(
|
|
4246
|
-
|
|
4246
|
+
G,
|
|
4247
4247
|
{
|
|
4248
4248
|
type: "button",
|
|
4249
4249
|
variant: "outline",
|
|
4250
|
-
onClick:
|
|
4251
|
-
children:
|
|
4250
|
+
onClick: V,
|
|
4251
|
+
children: I > 0 ? "Previous" : "Back"
|
|
4252
4252
|
}
|
|
4253
4253
|
),
|
|
4254
4254
|
W ? /* @__PURE__ */ r(
|
|
4255
|
-
|
|
4255
|
+
G,
|
|
4256
4256
|
{
|
|
4257
4257
|
type: "button",
|
|
4258
4258
|
isLoading: l,
|
|
@@ -4260,28 +4260,28 @@ const cn = ({
|
|
|
4260
4260
|
children: l ? "Uploading..." : "Continue"
|
|
4261
4261
|
}
|
|
4262
4262
|
) : /* @__PURE__ */ r(
|
|
4263
|
-
|
|
4263
|
+
G,
|
|
4264
4264
|
{
|
|
4265
4265
|
type: "button",
|
|
4266
|
-
onClick:
|
|
4266
|
+
onClick: U,
|
|
4267
4267
|
children: "Next"
|
|
4268
4268
|
}
|
|
4269
4269
|
)
|
|
4270
4270
|
] }) })
|
|
4271
4271
|
] }) : null;
|
|
4272
4272
|
}, dn = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
4273
|
-
const { overview: a, isLoading: s, isSubmitting: l, error: c, passOverview: u } = jr(e),
|
|
4273
|
+
const { overview: a, isLoading: s, isSubmitting: l, error: c, passOverview: u } = jr(e), y = async () => {
|
|
4274
4274
|
await u(), t == null || t();
|
|
4275
4275
|
};
|
|
4276
4276
|
return s ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(Pe, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
4277
4277
|
"Error loading overview: ",
|
|
4278
4278
|
c.message
|
|
4279
4279
|
] }) }) }) : a ? /* @__PURE__ */ i(X, { children: [
|
|
4280
|
-
/* @__PURE__ */ i(
|
|
4280
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
4281
4281
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
4282
4282
|
a.description && /* @__PURE__ */ r("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.description })
|
|
4283
4283
|
] }),
|
|
4284
|
-
/* @__PURE__ */ r(ee, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((m,
|
|
4284
|
+
/* @__PURE__ */ r(ee, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((m, N) => m.order - N.order).map((m) => /* @__PURE__ */ i("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
4285
4285
|
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r(
|
|
4286
4286
|
"div",
|
|
4287
4287
|
{
|
|
@@ -4307,9 +4307,9 @@ const cn = ({
|
|
|
4307
4307
|
}
|
|
4308
4308
|
)
|
|
4309
4309
|
] }, m.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading overview data..." }) }) }),
|
|
4310
|
-
/* @__PURE__ */ i(
|
|
4311
|
-
n && /* @__PURE__ */ r(
|
|
4312
|
-
/* @__PURE__ */ r(
|
|
4310
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
4311
|
+
n && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4312
|
+
/* @__PURE__ */ r(G, { onClick: y, isLoading: l, children: "Continue" })
|
|
4313
4313
|
] })
|
|
4314
4314
|
] }) : null;
|
|
4315
4315
|
};
|
|
@@ -4322,7 +4322,7 @@ function un(e) {
|
|
|
4322
4322
|
}
|
|
4323
4323
|
}
|
|
4324
4324
|
function pn(e) {
|
|
4325
|
-
return e.valueDataType ===
|
|
4325
|
+
return e.valueDataType === Be.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
|
|
4326
4326
|
}
|
|
4327
4327
|
function mn(e, t) {
|
|
4328
4328
|
const n = new Intl.NumberFormat(un(t), {
|
|
@@ -4346,7 +4346,7 @@ function yn(e, t) {
|
|
|
4346
4346
|
return e.errorMessage || "Invalid format";
|
|
4347
4347
|
} catch {
|
|
4348
4348
|
}
|
|
4349
|
-
const s = e.valueDataType ===
|
|
4349
|
+
const s = e.valueDataType === Be.Integer || e.valueDataType === Be.Money || e.valueDataType === Be.DigitOnly;
|
|
4350
4350
|
if (s && a.trim() !== "") {
|
|
4351
4351
|
const l = Number(a);
|
|
4352
4352
|
if (!isNaN(l)) {
|
|
@@ -4379,41 +4379,41 @@ const fn = ({
|
|
|
4379
4379
|
onComplete: t,
|
|
4380
4380
|
onBack: n
|
|
4381
4381
|
}) => {
|
|
4382
|
-
const { config: a } =
|
|
4383
|
-
|
|
4384
|
-
c && Object.keys(c).length > 0 && Object.keys(T).length === 0 &&
|
|
4382
|
+
const { config: a } = Ee(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: y, error: m, submit: N } = Wr(e), [T, I] = k({}), [L, f] = k({}), [S, D] = k(0), [H, W] = k(!1);
|
|
4383
|
+
be.useEffect(() => {
|
|
4384
|
+
c && Object.keys(c).length > 0 && Object.keys(T).length === 0 && I(c);
|
|
4385
4385
|
}, [c]);
|
|
4386
4386
|
const M = Ae(
|
|
4387
4387
|
() => l && l.length > 0 ? hn(l) : [],
|
|
4388
4388
|
[l]
|
|
4389
|
-
),
|
|
4390
|
-
|
|
4391
|
-
!u && l && l.length === 0 && !
|
|
4392
|
-
}, [u, l,
|
|
4393
|
-
const
|
|
4394
|
-
|
|
4389
|
+
), q = S === M.length - 1, U = M[S] ?? [];
|
|
4390
|
+
be.useEffect(() => {
|
|
4391
|
+
!u && l && l.length === 0 && !H && !y && (W(!0), N({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4392
|
+
}, [u, l, H, y, N, e, t]);
|
|
4393
|
+
const V = te((z, O) => {
|
|
4394
|
+
I((ne) => ({ ...ne, [z]: O })), f((ne) => {
|
|
4395
4395
|
const ae = { ...ne };
|
|
4396
4396
|
return delete ae[z], ae;
|
|
4397
4397
|
});
|
|
4398
4398
|
}, []), F = te(() => {
|
|
4399
4399
|
const z = {};
|
|
4400
|
-
for (const { criterion: O } of
|
|
4400
|
+
for (const { criterion: O } of U) {
|
|
4401
4401
|
const ne = yn(O, T[O.id] ?? []);
|
|
4402
4402
|
ne && (z[O.id] = ne);
|
|
4403
4403
|
}
|
|
4404
4404
|
return f((O) => ({ ...O, ...z })), Object.keys(z).length === 0;
|
|
4405
|
-
}, [
|
|
4405
|
+
}, [U, T]), b = () => {
|
|
4406
4406
|
F() && D((z) => z + 1);
|
|
4407
|
-
},
|
|
4407
|
+
}, B = () => {
|
|
4408
4408
|
S > 0 ? D((z) => z - 1) : n == null || n();
|
|
4409
|
-
},
|
|
4409
|
+
}, j = async () => {
|
|
4410
4410
|
if (!(!F() || !l))
|
|
4411
4411
|
try {
|
|
4412
4412
|
const z = l.map((ne) => {
|
|
4413
4413
|
const ae = (T[ne.id] ?? []).filter((re) => re && re.trim());
|
|
4414
4414
|
return ae.length > 0 ? { riskCriteriaId: ne.id, values: ae } : null;
|
|
4415
4415
|
}).filter((ne) => ne !== null);
|
|
4416
|
-
await
|
|
4416
|
+
await N({ applicantId: e, criteriaValueInputs: z }), t == null || t();
|
|
4417
4417
|
} catch (z) {
|
|
4418
4418
|
console.error("Risk scoring submit error:", z);
|
|
4419
4419
|
}
|
|
@@ -4428,7 +4428,7 @@ const fn = ({
|
|
|
4428
4428
|
"Error loading criteria: ",
|
|
4429
4429
|
m.message
|
|
4430
4430
|
] }) }) }) : l ? /* @__PURE__ */ i(X, { children: [
|
|
4431
|
-
/* @__PURE__ */ i(
|
|
4431
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
4432
4432
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
4433
4433
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
4434
4434
|
M.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
@@ -4452,24 +4452,24 @@ const fn = ({
|
|
|
4452
4452
|
)) })
|
|
4453
4453
|
] })
|
|
4454
4454
|
] }),
|
|
4455
|
-
/* @__PURE__ */ r(ee, { className: "space-y-6", children:
|
|
4455
|
+
/* @__PURE__ */ r(ee, { className: "space-y-6", children: U.map(({ criterion: z }) => /* @__PURE__ */ r(
|
|
4456
4456
|
bn,
|
|
4457
4457
|
{
|
|
4458
4458
|
criterion: z,
|
|
4459
4459
|
value: T[z.id] ?? [],
|
|
4460
4460
|
error: L[z.id],
|
|
4461
4461
|
locale: s,
|
|
4462
|
-
onChange: (O) =>
|
|
4462
|
+
onChange: (O) => V(z.id, O)
|
|
4463
4463
|
},
|
|
4464
4464
|
z.id
|
|
4465
4465
|
)) }),
|
|
4466
|
-
/* @__PURE__ */ i(
|
|
4466
|
+
/* @__PURE__ */ i(ve, { className: "flex items-center justify-between", children: [
|
|
4467
4467
|
/* @__PURE__ */ i(
|
|
4468
|
-
|
|
4468
|
+
G,
|
|
4469
4469
|
{
|
|
4470
4470
|
type: "button",
|
|
4471
4471
|
variant: "outline",
|
|
4472
|
-
onClick:
|
|
4472
|
+
onClick: B,
|
|
4473
4473
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4474
4474
|
children: [
|
|
4475
4475
|
/* @__PURE__ */ r(Mt, { size: 14 }),
|
|
@@ -4477,8 +4477,8 @@ const fn = ({
|
|
|
4477
4477
|
]
|
|
4478
4478
|
}
|
|
4479
4479
|
),
|
|
4480
|
-
|
|
4481
|
-
|
|
4480
|
+
q ? /* @__PURE__ */ r(G, { type: "button", isLoading: y, onClick: j, children: "Continue" }) : /* @__PURE__ */ i(
|
|
4481
|
+
G,
|
|
4482
4482
|
{
|
|
4483
4483
|
type: "button",
|
|
4484
4484
|
onClick: b,
|
|
@@ -4493,7 +4493,7 @@ const fn = ({
|
|
|
4493
4493
|
m && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: m.message }) })
|
|
4494
4494
|
] }) : null;
|
|
4495
4495
|
}, bn = ({ criterion: e, value: t, error: n, locale: a, onChange: s }) => {
|
|
4496
|
-
const l = gn(e), c = e.valueDataType ===
|
|
4496
|
+
const l = gn(e), c = e.valueDataType === Be.Integer || e.valueDataType === Be.Money || e.valueDataType === Be.DigitOnly, u = pn(e), y = (m) => u ? mn(m, a) : m;
|
|
4497
4497
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
4498
4498
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4499
4499
|
e.displayName,
|
|
@@ -4513,7 +4513,7 @@ const fn = ({
|
|
|
4513
4513
|
min: e.min,
|
|
4514
4514
|
max: e.max,
|
|
4515
4515
|
onKeyDown: (m) => {
|
|
4516
|
-
e.valueDataType ===
|
|
4516
|
+
e.valueDataType === Be.DigitOnly && ["e", "E", "+", "-", "."].includes(m.key) && m.preventDefault();
|
|
4517
4517
|
}
|
|
4518
4518
|
}
|
|
4519
4519
|
),
|
|
@@ -4546,7 +4546,7 @@ const fn = ({
|
|
|
4546
4546
|
}
|
|
4547
4547
|
}
|
|
4548
4548
|
),
|
|
4549
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
4549
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: y(m) })
|
|
4550
4550
|
]
|
|
4551
4551
|
},
|
|
4552
4552
|
m
|
|
@@ -4565,8 +4565,8 @@ const fn = ({
|
|
|
4565
4565
|
{
|
|
4566
4566
|
type: "checkbox",
|
|
4567
4567
|
checked: t.includes(m),
|
|
4568
|
-
onChange: (
|
|
4569
|
-
|
|
4568
|
+
onChange: (N) => {
|
|
4569
|
+
N.target.checked ? s([...t, m]) : s(t.filter((T) => T !== m));
|
|
4570
4570
|
},
|
|
4571
4571
|
className: "metakyc-option-input",
|
|
4572
4572
|
style: {
|
|
@@ -4584,7 +4584,7 @@ const fn = ({
|
|
|
4584
4584
|
}
|
|
4585
4585
|
}
|
|
4586
4586
|
),
|
|
4587
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
4587
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: y(m) })
|
|
4588
4588
|
]
|
|
4589
4589
|
},
|
|
4590
4590
|
m
|
|
@@ -4614,7 +4614,7 @@ const fn = ({
|
|
|
4614
4614
|
onComplete: t,
|
|
4615
4615
|
onBack: n
|
|
4616
4616
|
}) => {
|
|
4617
|
-
const { investorCategorizationService: a } =
|
|
4617
|
+
const { investorCategorizationService: a } = Ee(), [s, l] = k(null), [c, u] = k(!1), [y, m] = k(null);
|
|
4618
4618
|
return /* @__PURE__ */ r("form", { onSubmit: async (T) => {
|
|
4619
4619
|
if (T.preventDefault(), s === null) {
|
|
4620
4620
|
m("Please select an investor type");
|
|
@@ -4622,20 +4622,20 @@ const fn = ({
|
|
|
4622
4622
|
}
|
|
4623
4623
|
u(!0), m(null);
|
|
4624
4624
|
try {
|
|
4625
|
-
const
|
|
4625
|
+
const I = {
|
|
4626
4626
|
applicantId: e,
|
|
4627
4627
|
investorType: s
|
|
4628
4628
|
};
|
|
4629
|
-
console.log("Submitting investor categorization:",
|
|
4630
|
-
const L = await a.setInvestorCategorization(
|
|
4629
|
+
console.log("Submitting investor categorization:", I);
|
|
4630
|
+
const L = await a.setInvestorCategorization(I);
|
|
4631
4631
|
console.log("Investor categorization result:", L), t == null || t();
|
|
4632
|
-
} catch (
|
|
4633
|
-
console.error("Error submitting investor categorization:",
|
|
4632
|
+
} catch (I) {
|
|
4633
|
+
console.error("Error submitting investor categorization:", I), m(I.message || "Failed to submit investor categorization");
|
|
4634
4634
|
} finally {
|
|
4635
4635
|
u(!1);
|
|
4636
4636
|
}
|
|
4637
4637
|
}, children: /* @__PURE__ */ i(X, { children: [
|
|
4638
|
-
/* @__PURE__ */ i(
|
|
4638
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
4639
4639
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Which statement best describes you?" }),
|
|
4640
4640
|
/* @__PURE__ */ r("p", { className: "mt-2", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
|
|
4641
4641
|
] }),
|
|
@@ -4646,8 +4646,8 @@ const fn = ({
|
|
|
4646
4646
|
{
|
|
4647
4647
|
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
4648
4648
|
style: {
|
|
4649
|
-
borderColor: s ===
|
|
4650
|
-
backgroundColor: s ===
|
|
4649
|
+
borderColor: s === Ne.Individual ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4650
|
+
backgroundColor: s === Ne.Individual ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4651
4651
|
},
|
|
4652
4652
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
4653
4653
|
/* @__PURE__ */ r(
|
|
@@ -4655,9 +4655,9 @@ const fn = ({
|
|
|
4655
4655
|
{
|
|
4656
4656
|
type: "radio",
|
|
4657
4657
|
name: "investorType",
|
|
4658
|
-
value:
|
|
4659
|
-
checked: s ===
|
|
4660
|
-
onChange: () => l(
|
|
4658
|
+
value: Ne.Individual,
|
|
4659
|
+
checked: s === Ne.Individual,
|
|
4660
|
+
onChange: () => l(Ne.Individual),
|
|
4661
4661
|
className: "mt-1"
|
|
4662
4662
|
}
|
|
4663
4663
|
),
|
|
@@ -4673,8 +4673,8 @@ const fn = ({
|
|
|
4673
4673
|
{
|
|
4674
4674
|
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
4675
4675
|
style: {
|
|
4676
|
-
borderColor: s ===
|
|
4677
|
-
backgroundColor: s ===
|
|
4676
|
+
borderColor: s === Ne.Sophisticated ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4677
|
+
backgroundColor: s === Ne.Sophisticated ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4678
4678
|
},
|
|
4679
4679
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
4680
4680
|
/* @__PURE__ */ r(
|
|
@@ -4682,9 +4682,9 @@ const fn = ({
|
|
|
4682
4682
|
{
|
|
4683
4683
|
type: "radio",
|
|
4684
4684
|
name: "investorType",
|
|
4685
|
-
value:
|
|
4686
|
-
checked: s ===
|
|
4687
|
-
onChange: () => l(
|
|
4685
|
+
value: Ne.Sophisticated,
|
|
4686
|
+
checked: s === Ne.Sophisticated,
|
|
4687
|
+
onChange: () => l(Ne.Sophisticated),
|
|
4688
4688
|
className: "mt-1"
|
|
4689
4689
|
}
|
|
4690
4690
|
),
|
|
@@ -4705,8 +4705,8 @@ const fn = ({
|
|
|
4705
4705
|
{
|
|
4706
4706
|
className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
|
|
4707
4707
|
style: {
|
|
4708
|
-
borderColor: s ===
|
|
4709
|
-
backgroundColor: s ===
|
|
4708
|
+
borderColor: s === Ne.HighNetWorth ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
4709
|
+
backgroundColor: s === Ne.HighNetWorth ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
|
|
4710
4710
|
},
|
|
4711
4711
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
4712
4712
|
/* @__PURE__ */ r(
|
|
@@ -4714,9 +4714,9 @@ const fn = ({
|
|
|
4714
4714
|
{
|
|
4715
4715
|
type: "radio",
|
|
4716
4716
|
name: "investorType",
|
|
4717
|
-
value:
|
|
4718
|
-
checked: s ===
|
|
4719
|
-
onChange: () => l(
|
|
4717
|
+
value: Ne.HighNetWorth,
|
|
4718
|
+
checked: s === Ne.HighNetWorth,
|
|
4719
|
+
onChange: () => l(Ne.HighNetWorth),
|
|
4720
4720
|
className: "mt-1"
|
|
4721
4721
|
}
|
|
4722
4722
|
),
|
|
@@ -4731,16 +4731,16 @@ const fn = ({
|
|
|
4731
4731
|
] })
|
|
4732
4732
|
}
|
|
4733
4733
|
),
|
|
4734
|
-
|
|
4734
|
+
y && /* @__PURE__ */ r("div", { className: "p-4 rounded-lg", style: { backgroundColor: "#fee2e2", border: "1px solid #fca5a5" }, children: /* @__PURE__ */ i("p", { className: "text-sm", style: { color: "#991b1b" }, children: [
|
|
4735
4735
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
4736
4736
|
" ",
|
|
4737
|
-
|
|
4737
|
+
y
|
|
4738
4738
|
] }) })
|
|
4739
4739
|
] }),
|
|
4740
|
-
/* @__PURE__ */ i(
|
|
4741
|
-
n && /* @__PURE__ */ r(
|
|
4740
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
4741
|
+
n && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4742
4742
|
/* @__PURE__ */ r(
|
|
4743
|
-
|
|
4743
|
+
G,
|
|
4744
4744
|
{
|
|
4745
4745
|
type: "submit",
|
|
4746
4746
|
isLoading: c,
|
|
@@ -4764,54 +4764,54 @@ const vn = ({
|
|
|
4764
4764
|
onComplete: t,
|
|
4765
4765
|
onBack: n
|
|
4766
4766
|
}) => {
|
|
4767
|
-
const { appropriatenessTestService: a } =
|
|
4767
|
+
const { appropriatenessTestService: a } = Ee(), [s, l] = k(null), [c, u] = k(!0), [y, m] = k(!1), [N, T] = k(null), [I, L] = k({}), [f, S] = k(0), [D, H] = k(!1), [W, M] = k(!1), [q, U] = k(0), [V, F] = k(0), [b, B] = k(null);
|
|
4768
4768
|
ye(() => {
|
|
4769
4769
|
(async () => {
|
|
4770
4770
|
try {
|
|
4771
4771
|
u(!0), T(null);
|
|
4772
|
-
const
|
|
4773
|
-
if (l(
|
|
4774
|
-
const x = Nt(
|
|
4775
|
-
x > 0 &&
|
|
4772
|
+
const _ = await a.getAppropriatenessTest(e);
|
|
4773
|
+
if (l(_), _.waitTimeSpanForNextTry && _.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4774
|
+
const x = Nt(_.waitTimeSpanForNextTry);
|
|
4775
|
+
x > 0 && U(x);
|
|
4776
4776
|
}
|
|
4777
|
-
} catch (
|
|
4778
|
-
T(
|
|
4777
|
+
} catch (_) {
|
|
4778
|
+
T(_.message || "Failed to load appropriateness test");
|
|
4779
4779
|
} finally {
|
|
4780
4780
|
u(!1);
|
|
4781
4781
|
}
|
|
4782
4782
|
})();
|
|
4783
4783
|
}, [e, a]), ye(() => {
|
|
4784
4784
|
if (!D || f <= 0) return;
|
|
4785
|
-
const
|
|
4785
|
+
const _ = setInterval(() => {
|
|
4786
4786
|
S((x) => x <= 1 ? (M(!0), 0) : x - 1);
|
|
4787
4787
|
}, 1e3);
|
|
4788
|
-
return () => clearInterval(
|
|
4788
|
+
return () => clearInterval(_);
|
|
4789
4789
|
}, [D, f]), ye(() => {
|
|
4790
|
-
if (
|
|
4791
|
-
const
|
|
4792
|
-
|
|
4790
|
+
if (q <= 0) return;
|
|
4791
|
+
const _ = setInterval(() => {
|
|
4792
|
+
U((x) => x <= 1 ? 0 : x - 1);
|
|
4793
4793
|
}, 1e3);
|
|
4794
|
-
return () => clearInterval(
|
|
4795
|
-
}, [
|
|
4796
|
-
W && !
|
|
4794
|
+
return () => clearInterval(_);
|
|
4795
|
+
}, [q]), ye(() => {
|
|
4796
|
+
W && !y && ne();
|
|
4797
4797
|
}, [W]);
|
|
4798
|
-
const
|
|
4799
|
-
s && (
|
|
4800
|
-
}, z = (
|
|
4801
|
-
L((
|
|
4798
|
+
const j = () => {
|
|
4799
|
+
s && (H(!0), S(s.testDurationSec), F(0), L({}), T(null));
|
|
4800
|
+
}, z = (_, x) => {
|
|
4801
|
+
L((J) => ({ ...J, [_]: x }));
|
|
4802
4802
|
}, O = te(async () => {
|
|
4803
4803
|
try {
|
|
4804
|
-
const
|
|
4805
|
-
if (l(
|
|
4806
|
-
const x = Nt(
|
|
4807
|
-
x > 0 &&
|
|
4804
|
+
const _ = await a.getAppropriatenessTest(e);
|
|
4805
|
+
if (l(_), _.waitTimeSpanForNextTry && _.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4806
|
+
const x = Nt(_.waitTimeSpanForNextTry);
|
|
4807
|
+
x > 0 && U(x);
|
|
4808
4808
|
}
|
|
4809
4809
|
} catch {
|
|
4810
4810
|
}
|
|
4811
|
-
}, [e, a]), ne = async (
|
|
4811
|
+
}, [e, a]), ne = async (_) => {
|
|
4812
4812
|
if (s) {
|
|
4813
4813
|
if (!W) {
|
|
4814
|
-
const x = s.appropriatenessQuestions.length - Object.keys(
|
|
4814
|
+
const x = s.appropriatenessQuestions.length - Object.keys(I).length;
|
|
4815
4815
|
if (x > 0) {
|
|
4816
4816
|
T(`Please answer all questions. ${x} remaining.`);
|
|
4817
4817
|
return;
|
|
@@ -4820,20 +4820,20 @@ const vn = ({
|
|
|
4820
4820
|
m(!0), T(null);
|
|
4821
4821
|
try {
|
|
4822
4822
|
const x = s.appropriatenessQuestions.map(
|
|
4823
|
-
(
|
|
4824
|
-
),
|
|
4823
|
+
(Q) => ({ appropriatenessQuestionId: Q.id, value: I[Q.id] || "" })
|
|
4824
|
+
), J = {
|
|
4825
4825
|
applicantId: e,
|
|
4826
4826
|
appropriatenessTestId: s.id,
|
|
4827
4827
|
appropriatenessQuestionResults: x
|
|
4828
4828
|
};
|
|
4829
4829
|
try {
|
|
4830
|
-
const
|
|
4831
|
-
|
|
4832
|
-
} catch (
|
|
4833
|
-
if (
|
|
4834
|
-
|
|
4830
|
+
const Q = await a.fillAppropriatenessTest(J);
|
|
4831
|
+
Q.isSuccess ? B({ success: !0, message: Q.message || "Congratulations! You have passed the test." }) : (B({ success: !1, message: Q.message || "You did not pass the test." }), setTimeout(() => O(), 1e3));
|
|
4832
|
+
} catch (Q) {
|
|
4833
|
+
if (Q.code === 400 && Q.message)
|
|
4834
|
+
B({ success: !1, message: Q.message }), setTimeout(() => O(), 1500);
|
|
4835
4835
|
else
|
|
4836
|
-
throw
|
|
4836
|
+
throw Q;
|
|
4837
4837
|
}
|
|
4838
4838
|
} catch (x) {
|
|
4839
4839
|
T(x.message || "Failed to submit test. Please try again."), ae();
|
|
@@ -4842,7 +4842,7 @@ const vn = ({
|
|
|
4842
4842
|
}
|
|
4843
4843
|
}
|
|
4844
4844
|
}, ae = () => {
|
|
4845
|
-
|
|
4845
|
+
H(!1), M(!1), L({}), F(0);
|
|
4846
4846
|
};
|
|
4847
4847
|
if (c)
|
|
4848
4848
|
return /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
@@ -4852,12 +4852,12 @@ const vn = ({
|
|
|
4852
4852
|
if (!s)
|
|
4853
4853
|
return /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
|
|
4854
4854
|
/* @__PURE__ */ r("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: "No test data available" }),
|
|
4855
|
-
|
|
4855
|
+
N && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: N })
|
|
4856
4856
|
] }) }) });
|
|
4857
|
-
const re = s.testAllowedMaxTry - s.totalFailedTries, he = s.appropriatenessQuestions.length, de = Object.keys(
|
|
4858
|
-
if (
|
|
4857
|
+
const re = s.testAllowedMaxTry - s.totalFailedTries, he = s.appropriatenessQuestions.length, de = Object.keys(I).length;
|
|
4858
|
+
if (q > 0)
|
|
4859
4859
|
return /* @__PURE__ */ i(X, { children: [
|
|
4860
|
-
/* @__PURE__ */ r(
|
|
4860
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }) }),
|
|
4861
4861
|
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
|
|
4862
4862
|
/* @__PURE__ */ r("div", { style: {
|
|
4863
4863
|
width: "100px",
|
|
@@ -4873,21 +4873,21 @@ const vn = ({
|
|
|
4873
4873
|
fontWeight: 700,
|
|
4874
4874
|
color: "var(--metakyc-primary, #2563eb)",
|
|
4875
4875
|
fontVariantNumeric: "tabular-nums"
|
|
4876
|
-
}, children: yt(
|
|
4876
|
+
}, children: yt(q) }) }),
|
|
4877
4877
|
/* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: "Please wait before retrying" }),
|
|
4878
4878
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: "You can attempt the test again once the timer expires" }),
|
|
4879
|
-
|
|
4879
|
+
N && /* @__PURE__ */ r("div", { style: {
|
|
4880
4880
|
marginTop: "20px",
|
|
4881
4881
|
padding: "12px 16px",
|
|
4882
4882
|
borderRadius: "10px",
|
|
4883
4883
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
4884
4884
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
4885
|
-
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
4885
|
+
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: N }) })
|
|
4886
4886
|
] }) })
|
|
4887
4887
|
] });
|
|
4888
4888
|
if (b) {
|
|
4889
|
-
const
|
|
4890
|
-
|
|
4889
|
+
const _ = () => {
|
|
4890
|
+
B(null), ae(), T(null);
|
|
4891
4891
|
};
|
|
4892
4892
|
return /* @__PURE__ */ i(X, { children: [
|
|
4893
4893
|
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: {
|
|
@@ -4957,16 +4957,16 @@ const vn = ({
|
|
|
4957
4957
|
margin: 0
|
|
4958
4958
|
}, children: "No attempts remaining. Please contact support for assistance." }) })
|
|
4959
4959
|
] }) }),
|
|
4960
|
-
/* @__PURE__ */ r(
|
|
4961
|
-
re > 0 &&
|
|
4962
|
-
re > 0 &&
|
|
4963
|
-
re <= 0 && n && /* @__PURE__ */ r(
|
|
4960
|
+
/* @__PURE__ */ r(ve, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: b.success ? /* @__PURE__ */ r(G, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ i(rt, { children: [
|
|
4961
|
+
re > 0 && q <= 0 && /* @__PURE__ */ r(G, { type: "button", onClick: _, children: "Retake Test" }),
|
|
4962
|
+
re > 0 && q > 0 && /* @__PURE__ */ r(G, { type: "button", onClick: _, children: "OK" }),
|
|
4963
|
+
re <= 0 && n && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: n, children: "Back" })
|
|
4964
4964
|
] }) }) })
|
|
4965
4965
|
] });
|
|
4966
4966
|
}
|
|
4967
4967
|
if (!D)
|
|
4968
4968
|
return /* @__PURE__ */ i(X, { children: [
|
|
4969
|
-
/* @__PURE__ */ i(
|
|
4969
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
4970
4970
|
/* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }),
|
|
4971
4971
|
s.subtitle && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", marginTop: "4px" }, children: s.subtitle })
|
|
4972
4972
|
] }),
|
|
@@ -5001,7 +5001,7 @@ const vn = ({
|
|
|
5001
5001
|
}
|
|
5002
5002
|
)
|
|
5003
5003
|
] }),
|
|
5004
|
-
|
|
5004
|
+
N && /* @__PURE__ */ i("div", { style: {
|
|
5005
5005
|
marginBottom: "16px",
|
|
5006
5006
|
padding: "12px 14px",
|
|
5007
5007
|
borderRadius: "10px",
|
|
@@ -5018,7 +5018,7 @@ const vn = ({
|
|
|
5018
5018
|
/* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0, lineHeight: 1.5 }, children: [
|
|
5019
5019
|
/* @__PURE__ */ r("strong", { children: "Previous attempt:" }),
|
|
5020
5020
|
" ",
|
|
5021
|
-
|
|
5021
|
+
N
|
|
5022
5022
|
] })
|
|
5023
5023
|
] }),
|
|
5024
5024
|
re <= 0 && /* @__PURE__ */ r("div", { style: {
|
|
@@ -5028,20 +5028,20 @@ const vn = ({
|
|
|
5028
5028
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
5029
5029
|
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
5030
5030
|
] }),
|
|
5031
|
-
/* @__PURE__ */ r(
|
|
5032
|
-
n && /* @__PURE__ */ r(
|
|
5033
|
-
/* @__PURE__ */ r(
|
|
5031
|
+
/* @__PURE__ */ r(ve, { children: /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: n ? "space-between" : "flex-end", width: "100%" }, children: [
|
|
5032
|
+
n && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5033
|
+
/* @__PURE__ */ r(G, { type: "button", onClick: j, disabled: re <= 0, children: "Start Test" })
|
|
5034
5034
|
] }) })
|
|
5035
5035
|
] });
|
|
5036
|
-
const P = s.appropriatenessQuestions[
|
|
5036
|
+
const P = s.appropriatenessQuestions[V], K = V === he - 1, Z = de === he, ue = f <= 60;
|
|
5037
5037
|
return /* @__PURE__ */ i(X, { children: [
|
|
5038
|
-
/* @__PURE__ */ i(
|
|
5038
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
5039
5039
|
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
5040
5040
|
/* @__PURE__ */ i("div", { children: [
|
|
5041
5041
|
/* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }),
|
|
5042
5042
|
/* @__PURE__ */ i("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "2px" }, children: [
|
|
5043
5043
|
"Question ",
|
|
5044
|
-
|
|
5044
|
+
V + 1,
|
|
5045
5045
|
" of ",
|
|
5046
5046
|
he
|
|
5047
5047
|
] })
|
|
@@ -5117,10 +5117,10 @@ const vn = ({
|
|
|
5117
5117
|
wn,
|
|
5118
5118
|
{
|
|
5119
5119
|
question: P,
|
|
5120
|
-
index:
|
|
5121
|
-
selectedAnswer:
|
|
5122
|
-
onSelect: (
|
|
5123
|
-
disabled:
|
|
5120
|
+
index: V,
|
|
5121
|
+
selectedAnswer: I[P.id],
|
|
5122
|
+
onSelect: (_) => z(P.id, _),
|
|
5123
|
+
disabled: y
|
|
5124
5124
|
}
|
|
5125
5125
|
),
|
|
5126
5126
|
he > 1 && /* @__PURE__ */ r("div", { style: {
|
|
@@ -5129,7 +5129,7 @@ const vn = ({
|
|
|
5129
5129
|
gap: "6px",
|
|
5130
5130
|
marginTop: "20px",
|
|
5131
5131
|
flexWrap: "wrap"
|
|
5132
|
-
}, children: s.appropriatenessQuestions.map((
|
|
5132
|
+
}, children: s.appropriatenessQuestions.map((_, x) => /* @__PURE__ */ r(
|
|
5133
5133
|
"button",
|
|
5134
5134
|
{
|
|
5135
5135
|
type: "button",
|
|
@@ -5138,9 +5138,9 @@ const vn = ({
|
|
|
5138
5138
|
width: "28px",
|
|
5139
5139
|
height: "28px",
|
|
5140
5140
|
borderRadius: "8px",
|
|
5141
|
-
border: x ===
|
|
5142
|
-
backgroundColor:
|
|
5143
|
-
color:
|
|
5141
|
+
border: x === V ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5142
|
+
backgroundColor: I[_.id] ? x === V ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : x === V ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
5143
|
+
color: I[_.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
5144
5144
|
fontSize: "12px",
|
|
5145
5145
|
fontWeight: 600,
|
|
5146
5146
|
cursor: "pointer",
|
|
@@ -5152,7 +5152,7 @@ const vn = ({
|
|
|
5152
5152
|
},
|
|
5153
5153
|
children: x + 1
|
|
5154
5154
|
},
|
|
5155
|
-
|
|
5155
|
+
_.id
|
|
5156
5156
|
)) }),
|
|
5157
5157
|
W && /* @__PURE__ */ i("div", { style: {
|
|
5158
5158
|
marginTop: "16px",
|
|
@@ -5170,41 +5170,41 @@ const vn = ({
|
|
|
5170
5170
|
] }),
|
|
5171
5171
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "#b45309", margin: 0, fontWeight: 500 }, children: "Time's up! Your answers are being submitted." })
|
|
5172
5172
|
] }),
|
|
5173
|
-
|
|
5173
|
+
N && !W && /* @__PURE__ */ r("div", { style: {
|
|
5174
5174
|
marginTop: "16px",
|
|
5175
5175
|
padding: "12px 14px",
|
|
5176
5176
|
borderRadius: "10px",
|
|
5177
5177
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
5178
5178
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
5179
|
-
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
5179
|
+
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: N }) })
|
|
5180
5180
|
] }),
|
|
5181
|
-
/* @__PURE__ */ r(
|
|
5181
|
+
/* @__PURE__ */ r(ve, { children: /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
5182
5182
|
/* @__PURE__ */ r(
|
|
5183
|
-
|
|
5183
|
+
G,
|
|
5184
5184
|
{
|
|
5185
5185
|
type: "button",
|
|
5186
5186
|
variant: "outline",
|
|
5187
5187
|
onClick: () => {
|
|
5188
|
-
|
|
5188
|
+
V > 0 ? F((_) => _ - 1) : n == null || n();
|
|
5189
5189
|
},
|
|
5190
|
-
disabled:
|
|
5191
|
-
children:
|
|
5190
|
+
disabled: y,
|
|
5191
|
+
children: V > 0 ? "Previous" : "Cancel"
|
|
5192
5192
|
}
|
|
5193
5193
|
),
|
|
5194
5194
|
/* @__PURE__ */ i("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
5195
5195
|
!K && /* @__PURE__ */ r(
|
|
5196
|
-
|
|
5196
|
+
G,
|
|
5197
5197
|
{
|
|
5198
5198
|
type: "button",
|
|
5199
|
-
onClick: () => F((
|
|
5199
|
+
onClick: () => F((_) => _ + 1),
|
|
5200
5200
|
children: "Next"
|
|
5201
5201
|
}
|
|
5202
5202
|
),
|
|
5203
5203
|
(K || Z) && /* @__PURE__ */ r(
|
|
5204
|
-
|
|
5204
|
+
G,
|
|
5205
5205
|
{
|
|
5206
5206
|
type: "button",
|
|
5207
|
-
isLoading:
|
|
5207
|
+
isLoading: y,
|
|
5208
5208
|
onClick: () => ne(),
|
|
5209
5209
|
disabled: !Z && !W,
|
|
5210
5210
|
style: { opacity: Z || W ? 1 : 0.5 },
|
|
@@ -5345,10 +5345,10 @@ const vn = ({
|
|
|
5345
5345
|
onComplete: t,
|
|
5346
5346
|
onBack: n
|
|
5347
5347
|
}) => {
|
|
5348
|
-
var Me, Ze, je,
|
|
5349
|
-
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } =
|
|
5348
|
+
var Me, Ze, je, Ue;
|
|
5349
|
+
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = Ee(), { identityData: u, provider: y, token: m, isLoading: N, error: T, requestIdentity: I, restartIdentity: L } = Hr(e), [f, S] = k(null), [D, H] = k(null), [W, M] = k([]), [q, U] = k([]), [V, F] = k(!0), [b, B] = k(!1), [j, z] = k(null), [O, ne] = k(!1), ae = be.useRef(!1), [re, he] = k({}), [de, P] = k({}), K = c != null && c.reviewPageFields && c.reviewPageFields.length > 0 ? c.reviewPageFields[0] : null, Z = !!(c != null && c.reviewPageDisabled), ue = le(!1);
|
|
5350
5350
|
ue.current = Z;
|
|
5351
|
-
const
|
|
5351
|
+
const _ = Ut({
|
|
5352
5352
|
defaultValues: {
|
|
5353
5353
|
street: "",
|
|
5354
5354
|
streetNumber: "",
|
|
@@ -5361,23 +5361,23 @@ const vn = ({
|
|
|
5361
5361
|
});
|
|
5362
5362
|
ye(() => {
|
|
5363
5363
|
if (Z) {
|
|
5364
|
-
ae.current || (ae.current = !0,
|
|
5364
|
+
ae.current || (ae.current = !0, I().then(() => B(!0)).catch(($) => console.error("[Identity] Auto-request failed:", $)).finally(() => F(!1)));
|
|
5365
5365
|
return;
|
|
5366
5366
|
}
|
|
5367
5367
|
(async () => {
|
|
5368
5368
|
try {
|
|
5369
|
-
const [
|
|
5369
|
+
const [$, Y, p] = await Promise.all([
|
|
5370
5370
|
a.getApplicantData(e),
|
|
5371
5371
|
s.getCountries("", "en"),
|
|
5372
5372
|
s.getCountries("", "en", 40)
|
|
5373
5373
|
// CountriesType.PhoneNumber
|
|
5374
5374
|
]);
|
|
5375
|
-
|
|
5376
|
-
const w = /* @__PURE__ */ new Set(), E =
|
|
5375
|
+
H($);
|
|
5376
|
+
const w = /* @__PURE__ */ new Set(), E = Y.map((h) => ({ value: h.abbreviation3 || h.abbreviation, label: h.name })).filter((h) => !h.value || w.has(h.value) ? !1 : (w.add(h.value), !0));
|
|
5377
5377
|
M(E);
|
|
5378
|
-
const v = /* @__PURE__ */ new Set(), o = p.filter((
|
|
5379
|
-
|
|
5380
|
-
const d =
|
|
5378
|
+
const v = /* @__PURE__ */ new Set(), o = p.filter((h) => h.countryCode).map((h) => ({ value: h.countryCode, label: `${h.countryCode} – ${h.name}` })).filter((h) => v.has(h.value) ? !1 : (v.add(h.value), !0));
|
|
5379
|
+
U(o);
|
|
5380
|
+
const d = $.applicantRequestData;
|
|
5381
5381
|
if (he({
|
|
5382
5382
|
firstName: (d == null ? void 0 : d.firstName) || "",
|
|
5383
5383
|
lastName: (d == null ? void 0 : d.lastName) || "",
|
|
@@ -5400,7 +5400,7 @@ const vn = ({
|
|
|
5400
5400
|
occupation: (d == null ? void 0 : d.occupation) || "",
|
|
5401
5401
|
taxNumber: (d == null ? void 0 : d.taxNumber) || "",
|
|
5402
5402
|
defaultLanguage: (d == null ? void 0 : d.defaultLanguage) || ""
|
|
5403
|
-
}),
|
|
5403
|
+
}), _.reset({
|
|
5404
5404
|
street: (d == null ? void 0 : d.street) || "",
|
|
5405
5405
|
streetNumber: (d == null ? void 0 : d.streetNumber) || "",
|
|
5406
5406
|
city: (d == null ? void 0 : d.city) || "",
|
|
@@ -5408,22 +5408,22 @@ const vn = ({
|
|
|
5408
5408
|
country: (d == null ? void 0 : d.country) || "",
|
|
5409
5409
|
nationality: (d == null ? void 0 : d.nationality) || "",
|
|
5410
5410
|
phonenumber: (d == null ? void 0 : d.phonenumber) || ""
|
|
5411
|
-
}),
|
|
5411
|
+
}), $.kycRecords && $.kycRecords.length > 0 && $.kycRecords[0].providerTokenObject !== null && !ae.current && ue.current) {
|
|
5412
5412
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), ae.current = !0;
|
|
5413
5413
|
try {
|
|
5414
|
-
await
|
|
5415
|
-
} catch (
|
|
5416
|
-
console.error("[Identity] Auto-request failed:",
|
|
5414
|
+
await I(), B(!0);
|
|
5415
|
+
} catch (h) {
|
|
5416
|
+
console.error("[Identity] Auto-request failed:", h);
|
|
5417
5417
|
}
|
|
5418
5418
|
}
|
|
5419
|
-
} catch (
|
|
5420
|
-
console.error("Error loading applicant data:",
|
|
5419
|
+
} catch ($) {
|
|
5420
|
+
console.error("Error loading applicant data:", $);
|
|
5421
5421
|
} finally {
|
|
5422
5422
|
F(!1);
|
|
5423
5423
|
}
|
|
5424
5424
|
})();
|
|
5425
5425
|
}, [e]), ye(() => {
|
|
5426
|
-
u && !b && ue.current && (console.log("[Identity] Review page disabled — showing cached provider"),
|
|
5426
|
+
u && !b && ue.current && (console.log("[Identity] Review page disabled — showing cached provider"), B(!0));
|
|
5427
5427
|
}, [u, b]), ye(() => {
|
|
5428
5428
|
if (m) {
|
|
5429
5429
|
if (m.expiresAt) {
|
|
@@ -5435,8 +5435,8 @@ const vn = ({
|
|
|
5435
5435
|
}
|
|
5436
5436
|
if (m.url)
|
|
5437
5437
|
try {
|
|
5438
|
-
const
|
|
5439
|
-
if (
|
|
5438
|
+
const $ = new URL(m.url).toString().toLowerCase();
|
|
5439
|
+
if ($.includes("expired") || $.includes("invalid") || $.includes("error")) {
|
|
5440
5440
|
console.warn("[Identity] Token URL indicates expiration"), ne(!0), z("Your verification link has expired. Please restart.");
|
|
5441
5441
|
return;
|
|
5442
5442
|
}
|
|
@@ -5449,36 +5449,36 @@ const vn = ({
|
|
|
5449
5449
|
}
|
|
5450
5450
|
}
|
|
5451
5451
|
}, [m]), ye(() => {
|
|
5452
|
-
if (
|
|
5453
|
-
const g =
|
|
5452
|
+
if (y !== null && m && !f && b && !O) {
|
|
5453
|
+
const g = y;
|
|
5454
5454
|
if (m.url) {
|
|
5455
5455
|
console.log("[Identity] Loading provider URL for user verification:", m.url), z(null);
|
|
5456
5456
|
try {
|
|
5457
5457
|
if (new URL(m.url), g === Le.SardinAI) {
|
|
5458
5458
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
5459
5459
|
try {
|
|
5460
|
-
const
|
|
5461
|
-
et.createProvider(
|
|
5460
|
+
const $ = et.parseProviderConfig(y, m, l);
|
|
5461
|
+
et.createProvider(y, $).initialize().then(() => {
|
|
5462
5462
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
5463
5463
|
}).catch((p) => {
|
|
5464
5464
|
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", p);
|
|
5465
5465
|
});
|
|
5466
|
-
} catch (
|
|
5467
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
5466
|
+
} catch ($) {
|
|
5467
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", $);
|
|
5468
5468
|
}
|
|
5469
5469
|
}
|
|
5470
5470
|
S({ type: "url", url: m.url });
|
|
5471
|
-
} catch (
|
|
5472
|
-
console.error("[Identity] Invalid URL:",
|
|
5471
|
+
} catch ($) {
|
|
5472
|
+
console.error("[Identity] Invalid URL:", $), z("Invalid verification URL. Please restart."), ne(!0);
|
|
5473
5473
|
}
|
|
5474
5474
|
return;
|
|
5475
5475
|
}
|
|
5476
5476
|
if (g === Le.SardinAI) {
|
|
5477
5477
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), z(null);
|
|
5478
5478
|
try {
|
|
5479
|
-
const
|
|
5480
|
-
|
|
5481
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), S(
|
|
5479
|
+
const $ = et.parseProviderConfig(y, m, l), Y = et.createProvider(y, $);
|
|
5480
|
+
Y.initialize().then(() => {
|
|
5481
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), S(Y), setTimeout(() => {
|
|
5482
5482
|
t == null || t();
|
|
5483
5483
|
}, 2e3);
|
|
5484
5484
|
}).catch((p) => {
|
|
@@ -5487,24 +5487,24 @@ const vn = ({
|
|
|
5487
5487
|
const w = ((E = p.message) == null ? void 0 : E.toLowerCase()) || "";
|
|
5488
5488
|
w.includes("expired") || w.includes("invalid") || w.includes("401") || w.includes("400") ? (ne(!0), z("Session expired or invalid. Please restart verification.")) : z(`Failed to initialize: ${p.message}`);
|
|
5489
5489
|
});
|
|
5490
|
-
} catch (
|
|
5491
|
-
console.error("[SardinAI] Error creating provider:",
|
|
5490
|
+
} catch ($) {
|
|
5491
|
+
console.error("[SardinAI] Error creating provider:", $), z(`Configuration error: ${$.message}`);
|
|
5492
5492
|
}
|
|
5493
5493
|
return;
|
|
5494
5494
|
}
|
|
5495
5495
|
try {
|
|
5496
5496
|
z(null);
|
|
5497
|
-
const
|
|
5498
|
-
g === Le.Sumsub ? (
|
|
5497
|
+
const $ = et.parseProviderConfig(y, m, l), Y = et.createProvider(y, $);
|
|
5498
|
+
g === Le.Sumsub ? (Y.initialize("identity-container").catch((p) => {
|
|
5499
5499
|
var w;
|
|
5500
5500
|
console.error("[Sumsub] Initialization error:", p), z(`Failed to initialize: ${p.message}`), (w = p.message) != null && w.toLowerCase().includes("expired") && ne(!0);
|
|
5501
|
-
}),
|
|
5501
|
+
}), Y.onComplete && Y.onComplete(() => {
|
|
5502
5502
|
t == null || t();
|
|
5503
|
-
})) : g === Le.Onfido &&
|
|
5503
|
+
})) : g === Le.Onfido && Y.initialize("identity-container").catch((p) => {
|
|
5504
5504
|
console.error("[Onfido] Initialization error:", p), z(`Failed to initialize: ${p.message}`);
|
|
5505
|
-
}), S(
|
|
5506
|
-
} catch (
|
|
5507
|
-
console.error("[Identity] Provider setup error:",
|
|
5505
|
+
}), S(Y);
|
|
5506
|
+
} catch ($) {
|
|
5507
|
+
console.error("[Identity] Provider setup error:", $), z(`Setup error: ${$.message}`);
|
|
5508
5508
|
}
|
|
5509
5509
|
}
|
|
5510
5510
|
return () => {
|
|
@@ -5515,21 +5515,21 @@ const vn = ({
|
|
|
5515
5515
|
console.error("[Identity] Error destroying provider:", g);
|
|
5516
5516
|
}
|
|
5517
5517
|
};
|
|
5518
|
-
}, [
|
|
5518
|
+
}, [y, m, f, b, t, O]);
|
|
5519
5519
|
const x = async () => {
|
|
5520
5520
|
try {
|
|
5521
|
-
z(null), ne(!1), await
|
|
5521
|
+
z(null), ne(!1), await I(), B(!0);
|
|
5522
5522
|
} catch (g) {
|
|
5523
5523
|
console.error("Error starting identity verification:", g);
|
|
5524
5524
|
}
|
|
5525
|
-
},
|
|
5525
|
+
}, J = async () => {
|
|
5526
5526
|
try {
|
|
5527
|
-
z(null), ne(!1), S(null), console.log("[Identity] Restarting verification..."), await L(),
|
|
5527
|
+
z(null), ne(!1), S(null), console.log("[Identity] Restarting verification..."), await L(), B(!0);
|
|
5528
5528
|
} catch (g) {
|
|
5529
5529
|
console.error("Error restarting identity verification:", g), z(g.message || "Failed to restart verification");
|
|
5530
5530
|
}
|
|
5531
5531
|
};
|
|
5532
|
-
if (
|
|
5532
|
+
if (V || N)
|
|
5533
5533
|
return /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
5534
5534
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
5535
5535
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
@@ -5539,9 +5539,9 @@ const vn = ({
|
|
|
5539
5539
|
"Error: ",
|
|
5540
5540
|
T.message
|
|
5541
5541
|
] }) }) });
|
|
5542
|
-
if (b && (
|
|
5542
|
+
if (b && (j || O))
|
|
5543
5543
|
return /* @__PURE__ */ i(X, { children: [
|
|
5544
|
-
/* @__PURE__ */ r(
|
|
5544
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
5545
5545
|
/* @__PURE__ */ i(ee, { children: [
|
|
5546
5546
|
/* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
5547
5547
|
/* @__PURE__ */ r(
|
|
@@ -5564,7 +5564,7 @@ const vn = ({
|
|
|
5564
5564
|
),
|
|
5565
5565
|
/* @__PURE__ */ i("div", { children: [
|
|
5566
5566
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: O ? "Session Expired" : "Verification Error" }),
|
|
5567
|
-
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
5567
|
+
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children: j || "Your verification session has expired and needs to be restarted." })
|
|
5568
5568
|
] })
|
|
5569
5569
|
] }) }),
|
|
5570
5570
|
/* @__PURE__ */ i("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -5576,27 +5576,27 @@ const vn = ({
|
|
|
5576
5576
|
] })
|
|
5577
5577
|
] })
|
|
5578
5578
|
] }),
|
|
5579
|
-
/* @__PURE__ */ i(
|
|
5580
|
-
n && /* @__PURE__ */ r(
|
|
5581
|
-
/* @__PURE__ */ r(
|
|
5579
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
5580
|
+
n && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5581
|
+
/* @__PURE__ */ r(G, { type: "button", onClick: J, disabled: N, children: N ? "Restarting..." : "Restart Verification" })
|
|
5582
5582
|
] })
|
|
5583
5583
|
] });
|
|
5584
5584
|
if (b && u) {
|
|
5585
|
-
const g =
|
|
5585
|
+
const g = y;
|
|
5586
5586
|
return m != null && m.url ? /* @__PURE__ */ i(X, { children: [
|
|
5587
|
-
/* @__PURE__ */ r(
|
|
5587
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
5588
5588
|
/* @__PURE__ */ i("div", { children: [
|
|
5589
5589
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
5590
5590
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
5591
5591
|
] }),
|
|
5592
5592
|
/* @__PURE__ */ r(
|
|
5593
|
-
|
|
5593
|
+
G,
|
|
5594
5594
|
{
|
|
5595
5595
|
type: "button",
|
|
5596
5596
|
variant: "outline",
|
|
5597
5597
|
size: "sm",
|
|
5598
|
-
onClick:
|
|
5599
|
-
disabled:
|
|
5598
|
+
onClick: J,
|
|
5599
|
+
disabled: N,
|
|
5600
5600
|
children: "Restart"
|
|
5601
5601
|
}
|
|
5602
5602
|
)
|
|
@@ -5613,11 +5613,11 @@ const vn = ({
|
|
|
5613
5613
|
className: "w-full h-full border-0 rounded-lg",
|
|
5614
5614
|
allow: "camera; microphone; geolocation",
|
|
5615
5615
|
title: "Identity Verification",
|
|
5616
|
-
onLoad: (
|
|
5617
|
-
var
|
|
5616
|
+
onLoad: ($) => {
|
|
5617
|
+
var Y, p, w;
|
|
5618
5618
|
console.log("[Identity] Iframe loaded");
|
|
5619
5619
|
try {
|
|
5620
|
-
const E =
|
|
5620
|
+
const E = $.target, v = E.contentDocument || ((Y = E.contentWindow) == null ? void 0 : Y.document);
|
|
5621
5621
|
if (v) {
|
|
5622
5622
|
const o = ((w = (p = v.body) == null ? void 0 : p.textContent) == null ? void 0 : w.toLowerCase()) || "";
|
|
5623
5623
|
(o.includes("expired") || o.includes("invalid") || o.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), ne(!0), z("Your verification link has expired."));
|
|
@@ -5629,9 +5629,9 @@ const vn = ({
|
|
|
5629
5629
|
}
|
|
5630
5630
|
) })
|
|
5631
5631
|
] }),
|
|
5632
|
-
n && /* @__PURE__ */ r(
|
|
5632
|
+
n && /* @__PURE__ */ r(ve, { children: /* @__PURE__ */ r(G, { variant: "outline", onClick: n, children: "Back" }) })
|
|
5633
5633
|
] }) : g === Le.SardinAI ? /* @__PURE__ */ i(X, { children: [
|
|
5634
|
-
/* @__PURE__ */ i(
|
|
5634
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
5635
5635
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
5636
5636
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
5637
5637
|
] }),
|
|
@@ -5641,23 +5641,23 @@ const vn = ({
|
|
|
5641
5641
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
5642
5642
|
] }) })
|
|
5643
5643
|
] }) : /* @__PURE__ */ i(X, { children: [
|
|
5644
|
-
/* @__PURE__ */ i(
|
|
5644
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
5645
5645
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
5646
5646
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
5647
5647
|
] }),
|
|
5648
5648
|
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
5649
|
-
n && /* @__PURE__ */ r(
|
|
5649
|
+
n && /* @__PURE__ */ r(ve, { children: /* @__PURE__ */ r(G, { variant: "outline", onClick: n, children: "Back" }) })
|
|
5650
5650
|
] });
|
|
5651
5651
|
}
|
|
5652
|
-
const
|
|
5653
|
-
if (
|
|
5654
|
-
if (
|
|
5655
|
-
const
|
|
5656
|
-
return
|
|
5652
|
+
const Q = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), ce = (g = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[g] || "col-span-4", Se = (g, $) => {
|
|
5653
|
+
if (!$ && $ !== 0) return "—";
|
|
5654
|
+
if (Q.has(g) && g !== "mobileCountryCode") {
|
|
5655
|
+
const Y = W.find((p) => p.value === $);
|
|
5656
|
+
return Y ? Y.label : String($);
|
|
5657
5657
|
}
|
|
5658
|
-
return String(
|
|
5658
|
+
return String($);
|
|
5659
5659
|
}, De = ({ helpText: g }) => {
|
|
5660
|
-
const [
|
|
5660
|
+
const [$, Y] = k(!1), p = le(null), [, w] = k({ top: 0, left: 0 });
|
|
5661
5661
|
return /* @__PURE__ */ i(rt, { children: [
|
|
5662
5662
|
/* @__PURE__ */ r(
|
|
5663
5663
|
"button",
|
|
@@ -5670,7 +5670,7 @@ const vn = ({
|
|
|
5670
5670
|
const v = p.current.getBoundingClientRect();
|
|
5671
5671
|
w({ top: v.bottom + window.scrollY + 6, left: v.left + window.scrollX });
|
|
5672
5672
|
}
|
|
5673
|
-
|
|
5673
|
+
Y(!0);
|
|
5674
5674
|
},
|
|
5675
5675
|
style: {
|
|
5676
5676
|
width: 18,
|
|
@@ -5693,7 +5693,7 @@ const vn = ({
|
|
|
5693
5693
|
children: "?"
|
|
5694
5694
|
}
|
|
5695
5695
|
),
|
|
5696
|
-
|
|
5696
|
+
$ && Wt.createPortal(
|
|
5697
5697
|
/* @__PURE__ */ r(
|
|
5698
5698
|
"div",
|
|
5699
5699
|
{
|
|
@@ -5708,7 +5708,7 @@ const vn = ({
|
|
|
5708
5708
|
alignItems: "center",
|
|
5709
5709
|
justifyContent: "center"
|
|
5710
5710
|
},
|
|
5711
|
-
onClick: () =>
|
|
5711
|
+
onClick: () => Y(!1),
|
|
5712
5712
|
children: /* @__PURE__ */ i(
|
|
5713
5713
|
"div",
|
|
5714
5714
|
{
|
|
@@ -5728,7 +5728,7 @@ const vn = ({
|
|
|
5728
5728
|
"button",
|
|
5729
5729
|
{
|
|
5730
5730
|
type: "button",
|
|
5731
|
-
onClick: () =>
|
|
5731
|
+
onClick: () => Y(!1),
|
|
5732
5732
|
style: {
|
|
5733
5733
|
marginTop: 12,
|
|
5734
5734
|
padding: "4px 12px",
|
|
@@ -5750,13 +5750,13 @@ const vn = ({
|
|
|
5750
5750
|
document.body
|
|
5751
5751
|
)
|
|
5752
5752
|
] });
|
|
5753
|
-
},
|
|
5753
|
+
}, ke = (g, $) => $ ? /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
5754
5754
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: g }),
|
|
5755
|
-
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(De, { helpText:
|
|
5756
|
-
] }) : g, Ge = (g,
|
|
5757
|
-
const
|
|
5755
|
+
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(De, { helpText: $ }) })
|
|
5756
|
+
] }) : g, Ge = (g, $) => {
|
|
5757
|
+
const Y = `cf-${$}`, p = g.paramName ?? "", w = de[p];
|
|
5758
5758
|
if (g.customType === "br")
|
|
5759
|
-
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), style: { minHeight: "0.5rem" } },
|
|
5759
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), style: { minHeight: "0.5rem" } }, Y);
|
|
5760
5760
|
if (g.customType === "paragraph")
|
|
5761
5761
|
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: /* @__PURE__ */ r(
|
|
5762
5762
|
"div",
|
|
@@ -5765,7 +5765,7 @@ const vn = ({
|
|
|
5765
5765
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
5766
5766
|
dangerouslySetInnerHTML: { __html: g.label || "" }
|
|
5767
5767
|
}
|
|
5768
|
-
) },
|
|
5768
|
+
) }, Y);
|
|
5769
5769
|
if (g.customType === "html")
|
|
5770
5770
|
return /* @__PURE__ */ r(
|
|
5771
5771
|
"div",
|
|
@@ -5773,10 +5773,10 @@ const vn = ({
|
|
|
5773
5773
|
className: ce(g.colSpan),
|
|
5774
5774
|
dangerouslySetInnerHTML: { __html: g.label || "" }
|
|
5775
5775
|
},
|
|
5776
|
-
|
|
5776
|
+
Y
|
|
5777
5777
|
);
|
|
5778
5778
|
if (g.customType === "link")
|
|
5779
|
-
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children:
|
|
5779
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ke(
|
|
5780
5780
|
/* @__PURE__ */ r(
|
|
5781
5781
|
"a",
|
|
5782
5782
|
{
|
|
@@ -5789,10 +5789,10 @@ const vn = ({
|
|
|
5789
5789
|
}
|
|
5790
5790
|
),
|
|
5791
5791
|
g.helpText
|
|
5792
|
-
) },
|
|
5792
|
+
) }, Y);
|
|
5793
5793
|
if (g.customType === "checkbox" || g.customType === "link_checkbox") {
|
|
5794
5794
|
const E = w === "true" || w === !0;
|
|
5795
|
-
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children:
|
|
5795
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ke(
|
|
5796
5796
|
/* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5797
5797
|
/* @__PURE__ */ r(
|
|
5798
5798
|
"input",
|
|
@@ -5815,7 +5815,7 @@ const vn = ({
|
|
|
5815
5815
|
] }) : g.displayText || g.label })
|
|
5816
5816
|
] }),
|
|
5817
5817
|
g.helpText
|
|
5818
|
-
) },
|
|
5818
|
+
) }, Y);
|
|
5819
5819
|
}
|
|
5820
5820
|
if (g.customType === "group_checkbox") {
|
|
5821
5821
|
const E = Array.isArray(w) ? w : w ? [w] : [], v = (o) => {
|
|
@@ -5824,7 +5824,7 @@ const vn = ({
|
|
|
5824
5824
|
[p]: E.includes(o) ? E.filter((A) => A !== o) : [...E, o]
|
|
5825
5825
|
}));
|
|
5826
5826
|
};
|
|
5827
|
-
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children:
|
|
5827
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ke(
|
|
5828
5828
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
5829
5829
|
g.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.displayText || g.label }),
|
|
5830
5830
|
(g.options || []).map((o) => /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
@@ -5841,9 +5841,9 @@ const vn = ({
|
|
|
5841
5841
|
] }, o.value))
|
|
5842
5842
|
] }),
|
|
5843
5843
|
g.helpText
|
|
5844
|
-
) },
|
|
5844
|
+
) }, Y);
|
|
5845
5845
|
}
|
|
5846
|
-
return g.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: ce(g.colSpan), children:
|
|
5846
|
+
return g.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ke(
|
|
5847
5847
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
5848
5848
|
g.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.displayText || g.label }),
|
|
5849
5849
|
(g.options || []).map((E) => /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
@@ -5862,7 +5862,7 @@ const vn = ({
|
|
|
5862
5862
|
] }, E.value))
|
|
5863
5863
|
] }),
|
|
5864
5864
|
g.helpText
|
|
5865
|
-
) },
|
|
5865
|
+
) }, Y) : /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ke(
|
|
5866
5866
|
/* @__PURE__ */ r(
|
|
5867
5867
|
fe,
|
|
5868
5868
|
{
|
|
@@ -5872,69 +5872,69 @@ const vn = ({
|
|
|
5872
5872
|
}
|
|
5873
5873
|
),
|
|
5874
5874
|
g.helpText
|
|
5875
|
-
) },
|
|
5876
|
-
}, Je = (g,
|
|
5877
|
-
if (g.isCustom) return Ge(g,
|
|
5878
|
-
const
|
|
5879
|
-
return g.editable ? v ? /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children:
|
|
5875
|
+
) }, Y);
|
|
5876
|
+
}, Je = (g, $) => {
|
|
5877
|
+
if (g.isCustom) return Ge(g, $);
|
|
5878
|
+
const Y = g.name ?? "", p = Qe[Y], w = g.displayText || (p == null ? void 0 : p.label) || Y, E = re[Y] ?? "", v = Y === "mobileCountryCode", o = !!(p != null && p.countriesType) && !v;
|
|
5879
|
+
return g.editable ? v ? /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children: ke(
|
|
5880
5880
|
/* @__PURE__ */ r(
|
|
5881
|
-
|
|
5881
|
+
$e,
|
|
5882
5882
|
{
|
|
5883
5883
|
label: w,
|
|
5884
5884
|
value: String(E),
|
|
5885
|
-
onChange: (d) => he((A) => ({ ...A, [
|
|
5886
|
-
options: [{ value: "", label: "Select country code…" }, ...
|
|
5885
|
+
onChange: (d) => he((A) => ({ ...A, [Y]: d })),
|
|
5886
|
+
options: [{ value: "", label: "Select country code…" }, ...q]
|
|
5887
5887
|
}
|
|
5888
5888
|
),
|
|
5889
5889
|
g.helpText
|
|
5890
|
-
) }, `epc-${
|
|
5890
|
+
) }, `epc-${$}`) : o ? /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children: ke(
|
|
5891
5891
|
/* @__PURE__ */ r(
|
|
5892
|
-
|
|
5892
|
+
$e,
|
|
5893
5893
|
{
|
|
5894
5894
|
label: w,
|
|
5895
5895
|
value: String(E),
|
|
5896
|
-
onChange: (d) => he((A) => ({ ...A, [
|
|
5896
|
+
onChange: (d) => he((A) => ({ ...A, [Y]: d })),
|
|
5897
5897
|
options: [{ value: "", label: `Select ${w.toLowerCase()}…` }, ...W]
|
|
5898
5898
|
}
|
|
5899
5899
|
),
|
|
5900
5900
|
g.helpText
|
|
5901
|
-
) }, `ec-${
|
|
5901
|
+
) }, `ec-${$}`) : /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children: ke(
|
|
5902
5902
|
/* @__PURE__ */ r(
|
|
5903
5903
|
fe,
|
|
5904
5904
|
{
|
|
5905
5905
|
label: w,
|
|
5906
5906
|
type: (p == null ? void 0 : p.type) === "date" ? "date" : (p == null ? void 0 : p.type) === "email" ? "email" : "text",
|
|
5907
5907
|
value: String(E),
|
|
5908
|
-
onChange: (d) => he((A) => ({ ...A, [
|
|
5908
|
+
onChange: (d) => he((A) => ({ ...A, [Y]: d.target.value }))
|
|
5909
5909
|
}
|
|
5910
5910
|
),
|
|
5911
5911
|
g.helpText
|
|
5912
|
-
) }, `ei-${
|
|
5912
|
+
) }, `ei-${$}`) : /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children: ke(
|
|
5913
5913
|
/* @__PURE__ */ i(rt, { children: [
|
|
5914
5914
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: w }),
|
|
5915
|
-
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children:
|
|
5915
|
+
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Se(Y, E) })
|
|
5916
5916
|
] }),
|
|
5917
5917
|
g.helpText
|
|
5918
|
-
) }, `ro-${
|
|
5918
|
+
) }, `ro-${$}`);
|
|
5919
5919
|
};
|
|
5920
5920
|
if (K) {
|
|
5921
|
-
const g = K.title || "Review Your Information",
|
|
5922
|
-
return /* @__PURE__ */ r("form", { onSubmit: (
|
|
5923
|
-
|
|
5921
|
+
const g = K.title || "Review Your Information", $ = K.subtitle || "Please review and confirm your information before starting identity verification";
|
|
5922
|
+
return /* @__PURE__ */ r("form", { onSubmit: (Y) => {
|
|
5923
|
+
Y.preventDefault(), x();
|
|
5924
5924
|
}, children: /* @__PURE__ */ i(X, { children: [
|
|
5925
|
-
/* @__PURE__ */ i(
|
|
5925
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
5926
5926
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g }),
|
|
5927
|
-
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
5927
|
+
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: $ })
|
|
5928
5928
|
] }),
|
|
5929
|
-
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: K.fields.map((
|
|
5930
|
-
/* @__PURE__ */ i(
|
|
5931
|
-
n && /* @__PURE__ */ r(
|
|
5932
|
-
/* @__PURE__ */ r(
|
|
5929
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: K.fields.map((Y, p) => Je(Y, p)) }) }),
|
|
5930
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
5931
|
+
n && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5932
|
+
/* @__PURE__ */ r(G, { type: "submit", isLoading: N, children: "Confirm and Start Verification" })
|
|
5933
5933
|
] })
|
|
5934
5934
|
] }) });
|
|
5935
5935
|
}
|
|
5936
|
-
return /* @__PURE__ */ r("form", { onSubmit:
|
|
5937
|
-
/* @__PURE__ */ i(
|
|
5936
|
+
return /* @__PURE__ */ r("form", { onSubmit: _.handleSubmit(x), children: /* @__PURE__ */ i(X, { children: [
|
|
5937
|
+
/* @__PURE__ */ i(xe, { children: [
|
|
5938
5938
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
|
|
5939
5939
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please review and confirm your information before starting identity verification" })
|
|
5940
5940
|
] }),
|
|
@@ -5942,10 +5942,10 @@ const vn = ({
|
|
|
5942
5942
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
5943
5943
|
{ label: "Name", value: `${((Me = D == null ? void 0 : D.applicantRequestData) == null ? void 0 : Me.firstName) || ""} ${((Ze = D == null ? void 0 : D.applicantRequestData) == null ? void 0 : Ze.lastName) || ""}`.trim() },
|
|
5944
5944
|
{ label: "Email", value: (je = D == null ? void 0 : D.applicantRequestData) == null ? void 0 : je.email },
|
|
5945
|
-
{ label: "Date of Birth", value: ((
|
|
5946
|
-
].map(({ label: g, value:
|
|
5945
|
+
{ label: "Date of Birth", value: ((Ue = D == null ? void 0 : D.applicantRequestData) == null ? void 0 : Ue.dateOfBirth) || "Not provided" }
|
|
5946
|
+
].map(({ label: g, value: $ }) => /* @__PURE__ */ i("div", { children: [
|
|
5947
5947
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g }),
|
|
5948
|
-
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5948
|
+
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: $ })
|
|
5949
5949
|
] }, g)) }),
|
|
5950
5950
|
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
5951
5951
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
@@ -5953,10 +5953,10 @@ const vn = ({
|
|
|
5953
5953
|
/* @__PURE__ */ r(
|
|
5954
5954
|
qe,
|
|
5955
5955
|
{
|
|
5956
|
-
control:
|
|
5956
|
+
control: _.control,
|
|
5957
5957
|
name: "country",
|
|
5958
5958
|
render: ({ field: g }) => /* @__PURE__ */ r(
|
|
5959
|
-
|
|
5959
|
+
$e,
|
|
5960
5960
|
{
|
|
5961
5961
|
label: "Country",
|
|
5962
5962
|
value: g.value,
|
|
@@ -5969,10 +5969,10 @@ const vn = ({
|
|
|
5969
5969
|
/* @__PURE__ */ r(
|
|
5970
5970
|
qe,
|
|
5971
5971
|
{
|
|
5972
|
-
control:
|
|
5972
|
+
control: _.control,
|
|
5973
5973
|
name: "nationality",
|
|
5974
5974
|
render: ({ field: g }) => /* @__PURE__ */ r(
|
|
5975
|
-
|
|
5975
|
+
$e,
|
|
5976
5976
|
{
|
|
5977
5977
|
label: "Nationality",
|
|
5978
5978
|
value: g.value,
|
|
@@ -5984,22 +5984,22 @@ const vn = ({
|
|
|
5984
5984
|
)
|
|
5985
5985
|
] }),
|
|
5986
5986
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5987
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5988
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5987
|
+
/* @__PURE__ */ r(qe, { control: _.control, name: "street", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "Street" }) }),
|
|
5988
|
+
/* @__PURE__ */ r(qe, { control: _.control, name: "streetNumber", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "Street Number" }) })
|
|
5989
5989
|
] }),
|
|
5990
5990
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5991
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5992
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5991
|
+
/* @__PURE__ */ r(qe, { control: _.control, name: "city", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "City" }) }),
|
|
5992
|
+
/* @__PURE__ */ r(qe, { control: _.control, name: "zip", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "ZIP / Postal Code" }) })
|
|
5993
5993
|
] }),
|
|
5994
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5994
|
+
/* @__PURE__ */ r(qe, { control: _.control, name: "phonenumber", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "Phone Number", type: "tel" }) })
|
|
5995
5995
|
] })
|
|
5996
5996
|
] }),
|
|
5997
|
-
/* @__PURE__ */ i(
|
|
5998
|
-
n && /* @__PURE__ */ r(
|
|
5999
|
-
/* @__PURE__ */ r(
|
|
5997
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
5998
|
+
n && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5999
|
+
/* @__PURE__ */ r(G, { type: "submit", isLoading: N, children: "Confirm and Start Verification" })
|
|
6000
6000
|
] })
|
|
6001
6001
|
] }) });
|
|
6002
|
-
},
|
|
6002
|
+
}, Rt = ({
|
|
6003
6003
|
kycStatus: e,
|
|
6004
6004
|
reviewStatus: t,
|
|
6005
6005
|
workflowResult: n,
|
|
@@ -6132,11 +6132,11 @@ const vn = ({
|
|
|
6132
6132
|
] })
|
|
6133
6133
|
] }) })
|
|
6134
6134
|
] }),
|
|
6135
|
-
/* @__PURE__ */ i(
|
|
6136
|
-
u.type === "success" && s && /* @__PURE__ */ r(
|
|
6135
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-center gap-4", children: [
|
|
6136
|
+
u.type === "success" && s && /* @__PURE__ */ r(G, { onClick: s, size: "lg", children: "Continue" }),
|
|
6137
6137
|
u.type === "error" && /* @__PURE__ */ i(rt, { children: [
|
|
6138
|
-
l && /* @__PURE__ */ r(
|
|
6139
|
-
s && /* @__PURE__ */ r(
|
|
6138
|
+
l && /* @__PURE__ */ r(G, { variant: "outline", onClick: l, children: "Contact Support" }),
|
|
6139
|
+
s && /* @__PURE__ */ r(G, { onClick: s, children: "Try Again" })
|
|
6140
6140
|
] }),
|
|
6141
6141
|
u.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
6142
6142
|
] })
|
|
@@ -6161,7 +6161,7 @@ const vn = ({
|
|
|
6161
6161
|
subtitle: t,
|
|
6162
6162
|
className: n = ""
|
|
6163
6163
|
}) => {
|
|
6164
|
-
const { currentTheme: a } =
|
|
6164
|
+
const { currentTheme: a } = Ee(), s = e || (a == null ? void 0 : a.title) || "", l = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!s;
|
|
6165
6165
|
return !l && !c ? null : /* @__PURE__ */ i("div", { className: `metakyc-header ${n}`, children: [
|
|
6166
6166
|
/* @__PURE__ */ i(
|
|
6167
6167
|
"div",
|
|
@@ -6199,8 +6199,8 @@ const st = {
|
|
|
6199
6199
|
padding: 0,
|
|
6200
6200
|
display: "inline-block",
|
|
6201
6201
|
verticalAlign: "middle"
|
|
6202
|
-
},
|
|
6203
|
-
const [n, a] =
|
|
6202
|
+
}, It = ({ helpText: e, children: t }) => {
|
|
6203
|
+
const [n, a] = be.useState(!1);
|
|
6204
6204
|
if (!e) return /* @__PURE__ */ r(rt, { children: t });
|
|
6205
6205
|
const s = n ? /* @__PURE__ */ r(
|
|
6206
6206
|
"div",
|
|
@@ -6326,13 +6326,13 @@ const st = {
|
|
|
6326
6326
|
onSuccess: n,
|
|
6327
6327
|
onCancel: a
|
|
6328
6328
|
}) => {
|
|
6329
|
-
var
|
|
6330
|
-
const { config: s, baseInformationService: l, currentTheme: c } =
|
|
6329
|
+
var $, Y, p, w, E, v;
|
|
6330
|
+
const { config: s, baseInformationService: l, currentTheme: c } = Ee(), { createApplicant: u, isLoading: y } = Pt(), m = e || (($ = s.applicantForm) == null ? void 0 : $.workflowKey);
|
|
6331
6331
|
if (!m)
|
|
6332
6332
|
throw new Error(
|
|
6333
6333
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
6334
6334
|
);
|
|
6335
|
-
const
|
|
6335
|
+
const N = t || ((Y = s.applicantForm) == null ? void 0 : Y.externalRefId) || "", T = ((p = s.applicantForm) == null ? void 0 : p.email) || "", I = ((w = s.applicantForm) == null ? void 0 : w.hiddenValues) || {}, f = (((E = s.applicantForm) == null ? void 0 : E.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", S = Ae(
|
|
6336
6336
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
6337
6337
|
[c == null ? void 0 : c.applicantFormPages]
|
|
6338
6338
|
), D = Ae(() => {
|
|
@@ -6340,20 +6340,20 @@ const st = {
|
|
|
6340
6340
|
if (d) for (const A of d) o.add(A);
|
|
6341
6341
|
if (S)
|
|
6342
6342
|
for (const A of S)
|
|
6343
|
-
for (const
|
|
6344
|
-
!
|
|
6343
|
+
for (const h of A.fields)
|
|
6344
|
+
!h.isCustom && h.name && h.required && o.add(h.name);
|
|
6345
6345
|
return Array.from(o);
|
|
6346
|
-
}, [c == null ? void 0 : c.applicantFormRequiredFields, S]),
|
|
6346
|
+
}, [c == null ? void 0 : c.applicantFormRequiredFields, S]), H = Ae(() => {
|
|
6347
6347
|
var A;
|
|
6348
6348
|
if (S) {
|
|
6349
|
-
const
|
|
6350
|
-
for (const C of dt)
|
|
6351
|
-
return Array.from(
|
|
6349
|
+
const h = S.flatMap((C) => C.fields).filter((C) => !C.isCustom && C.name).map((C) => C.name), R = new Set(h);
|
|
6350
|
+
for (const C of dt) R.add(C);
|
|
6351
|
+
return Array.from(R);
|
|
6352
6352
|
}
|
|
6353
6353
|
let o;
|
|
6354
6354
|
(A = s.applicantForm) != null && A.visibleFields ? o = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? o = c.applicantFormVisibleFields : o = nr;
|
|
6355
6355
|
const d = new Set(o);
|
|
6356
|
-
for (const
|
|
6356
|
+
for (const h of dt) d.add(h);
|
|
6357
6357
|
return Array.from(d);
|
|
6358
6358
|
}, [(v = s.applicantForm) == null ? void 0 : v.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, S]), W = /* @__PURE__ */ new Set([
|
|
6359
6359
|
"country",
|
|
@@ -6366,57 +6366,57 @@ const st = {
|
|
|
6366
6366
|
var d, A;
|
|
6367
6367
|
const o = /* @__PURE__ */ new Set();
|
|
6368
6368
|
if (S)
|
|
6369
|
-
for (const
|
|
6370
|
-
for (const
|
|
6371
|
-
!
|
|
6369
|
+
for (const h of S)
|
|
6370
|
+
for (const R of h.fields)
|
|
6371
|
+
!R.isCustom && R.name && W.has(R.name) && o.add(R.countriesType ?? ((d = Qe[R.name]) == null ? void 0 : d.countriesType));
|
|
6372
6372
|
else
|
|
6373
|
-
for (const
|
|
6374
|
-
W.has(
|
|
6373
|
+
for (const h of H)
|
|
6374
|
+
W.has(h) && o.add((A = Qe[h]) == null ? void 0 : A.countriesType);
|
|
6375
6375
|
return o.size === 0 && o.add(void 0), Array.from(o);
|
|
6376
|
-
}, [
|
|
6376
|
+
}, [H, S]), [q, U] = k({}), [V, F] = k(!0), b = le(/* @__PURE__ */ new Set()), B = le(/* @__PURE__ */ new Set());
|
|
6377
6377
|
ye(() => {
|
|
6378
6378
|
if (!c) return;
|
|
6379
|
-
const o = M.filter((
|
|
6380
|
-
const
|
|
6381
|
-
return
|
|
6379
|
+
const o = M.filter((h) => {
|
|
6380
|
+
const R = h != null ? String(h) : "all";
|
|
6381
|
+
return !B.current.has(R) && !b.current.has(R);
|
|
6382
6382
|
});
|
|
6383
6383
|
if (o.length === 0) {
|
|
6384
|
-
M.every((
|
|
6385
|
-
const C =
|
|
6386
|
-
return
|
|
6384
|
+
M.every((R) => {
|
|
6385
|
+
const C = R != null ? String(R) : "all";
|
|
6386
|
+
return B.current.has(C);
|
|
6387
6387
|
}) && F(!1);
|
|
6388
6388
|
return;
|
|
6389
6389
|
}
|
|
6390
6390
|
F(!0);
|
|
6391
|
-
const d = o.map((
|
|
6392
|
-
d.forEach((
|
|
6391
|
+
const d = o.map((h) => h != null ? String(h) : "all");
|
|
6392
|
+
d.forEach((h) => b.current.add(h)), (async () => {
|
|
6393
6393
|
try {
|
|
6394
|
-
const
|
|
6395
|
-
o.map(async (
|
|
6396
|
-
const C =
|
|
6394
|
+
const h = await Promise.all(
|
|
6395
|
+
o.map(async (R) => {
|
|
6396
|
+
const C = R != null ? String(R) : "all", oe = await l.getCountries("", s.locale || "en", R), ie = R === 40, we = /* @__PURE__ */ new Set(), ge = oe.map((pe) => ie && pe.countryCode ? {
|
|
6397
6397
|
value: pe.countryCode,
|
|
6398
6398
|
label: `${pe.countryCode} – ${pe.name}`
|
|
6399
|
-
} : { value: pe.abbreviation3 || pe.abbreviation, label: pe.name }).filter((pe) => !pe.value ||
|
|
6400
|
-
return
|
|
6399
|
+
} : { value: pe.abbreviation3 || pe.abbreviation, label: pe.name }).filter((pe) => !pe.value || we.has(pe.value) ? !1 : (we.add(pe.value), !0));
|
|
6400
|
+
return B.current.add(C), b.current.delete(C), [C, ge];
|
|
6401
6401
|
})
|
|
6402
6402
|
);
|
|
6403
|
-
|
|
6404
|
-
} catch (
|
|
6405
|
-
d.forEach((
|
|
6403
|
+
U((R) => ({ ...R, ...Object.fromEntries(h) }));
|
|
6404
|
+
} catch (h) {
|
|
6405
|
+
d.forEach((R) => b.current.delete(R)), console.error("Failed to load countries:", h);
|
|
6406
6406
|
} finally {
|
|
6407
|
-
M.every((
|
|
6408
|
-
const C =
|
|
6409
|
-
return
|
|
6407
|
+
M.every((R) => {
|
|
6408
|
+
const C = R != null ? String(R) : "all";
|
|
6409
|
+
return B.current.has(C);
|
|
6410
6410
|
}) && F(!1);
|
|
6411
6411
|
}
|
|
6412
6412
|
})();
|
|
6413
6413
|
}, [M, c]);
|
|
6414
|
-
const
|
|
6415
|
-
var
|
|
6416
|
-
const A = d ?? ((
|
|
6417
|
-
return
|
|
6414
|
+
const j = (o, d) => {
|
|
6415
|
+
var R;
|
|
6416
|
+
const A = d ?? ((R = Qe[o]) == null ? void 0 : R.countriesType), h = A != null ? String(A) : "all";
|
|
6417
|
+
return q[h] || [];
|
|
6418
6418
|
}, z = Object.fromEntries(
|
|
6419
|
-
Object.entries(
|
|
6419
|
+
Object.entries(I).filter(([o]) => o in {
|
|
6420
6420
|
firstName: 1,
|
|
6421
6421
|
lastName: 1,
|
|
6422
6422
|
title: 1,
|
|
@@ -6448,7 +6448,7 @@ const st = {
|
|
|
6448
6448
|
email: T,
|
|
6449
6449
|
dateOfBirth: "",
|
|
6450
6450
|
phonenumber: "",
|
|
6451
|
-
externalRefId:
|
|
6451
|
+
externalRefId: N,
|
|
6452
6452
|
mobileCountryCode: "",
|
|
6453
6453
|
street: "",
|
|
6454
6454
|
streetNumber: "",
|
|
@@ -6467,29 +6467,29 @@ const st = {
|
|
|
6467
6467
|
taxNumber: "",
|
|
6468
6468
|
...z
|
|
6469
6469
|
}), ae = Object.fromEntries(
|
|
6470
|
-
Object.entries(
|
|
6471
|
-
), [re, he] = k({ ...ae }), [de, P] = k(0), [K, Z] = k({}), [ue,
|
|
6470
|
+
Object.entries(I).filter(([o]) => !(o in z) && o !== "externalRefId" && o !== "workflowKey")
|
|
6471
|
+
), [re, he] = k({ ...ae }), [de, P] = k(0), [K, Z] = k({}), [ue, _] = k(null), [x, J] = k(!1), Q = (o, d) => ne((A) => ({ ...A, [o]: d })), ce = (o, d) => he((A) => ({ ...A, [o]: d })), Se = (o) => !o.conditionalOn || re[o.conditionalOn] === "true", De = S && de < S.length - 1 ? de + 1 : -1, ke = S && de > 0 ? de - 1 : -1, Ge = (o) => {
|
|
6472
6472
|
var A;
|
|
6473
6473
|
const d = {};
|
|
6474
|
-
for (const
|
|
6475
|
-
if (
|
|
6476
|
-
if (
|
|
6477
|
-
if (
|
|
6478
|
-
const
|
|
6479
|
-
|
|
6474
|
+
for (const h of o.fields)
|
|
6475
|
+
if (h.isCustom) {
|
|
6476
|
+
if (h.customType === "paragraph" || h.customType === "html" || h.customType === "br" || h.customType === "link") continue;
|
|
6477
|
+
if (h.required && h.paramName) {
|
|
6478
|
+
const R = re[h.paramName], C = h.displayText || h.label || h.paramName;
|
|
6479
|
+
h.customType === "checkbox" || h.customType === "link_checkbox" ? R !== "true" && (d[h.paramName] = `${C} is required.`) : (!R || R.trim() === "") && (d[h.paramName] = `${C} is required.`);
|
|
6480
6480
|
}
|
|
6481
|
-
} else if (
|
|
6482
|
-
const
|
|
6483
|
-
if (D.includes(
|
|
6484
|
-
const C =
|
|
6485
|
-
d[
|
|
6481
|
+
} else if (h.name) {
|
|
6482
|
+
const R = h.name;
|
|
6483
|
+
if (D.includes(R) && tt(O[R])) {
|
|
6484
|
+
const C = h.displayText || ((A = Qe[R]) == null ? void 0 : A.label) || R;
|
|
6485
|
+
d[R] = `${C} is required.`;
|
|
6486
6486
|
}
|
|
6487
6487
|
}
|
|
6488
6488
|
return d;
|
|
6489
6489
|
}, Je = async () => {
|
|
6490
6490
|
if (!S) return;
|
|
6491
6491
|
const o = S[de];
|
|
6492
|
-
if (o.conditionalOn && !
|
|
6492
|
+
if (o.conditionalOn && !Se(o)) {
|
|
6493
6493
|
Z({}), De >= 0 ? P(De) : await Me();
|
|
6494
6494
|
return;
|
|
6495
6495
|
}
|
|
@@ -6503,16 +6503,16 @@ const st = {
|
|
|
6503
6503
|
if (S) {
|
|
6504
6504
|
let o = {};
|
|
6505
6505
|
for (const d of S)
|
|
6506
|
-
|
|
6506
|
+
Se(d) && (o = { ...o, ...Ge(d) });
|
|
6507
6507
|
if (Object.keys(o).length > 0) {
|
|
6508
6508
|
Z(o);
|
|
6509
6509
|
return;
|
|
6510
6510
|
}
|
|
6511
6511
|
}
|
|
6512
|
-
|
|
6512
|
+
J(!0), _(null);
|
|
6513
6513
|
try {
|
|
6514
6514
|
if (!O.externalRefId || O.externalRefId.trim() === "") {
|
|
6515
|
-
|
|
6515
|
+
_("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
6516
6516
|
return;
|
|
6517
6517
|
}
|
|
6518
6518
|
const o = {
|
|
@@ -6520,30 +6520,30 @@ const st = {
|
|
|
6520
6520
|
externalRefId: O.externalRefId.trim()
|
|
6521
6521
|
};
|
|
6522
6522
|
if (S) {
|
|
6523
|
-
for (const
|
|
6524
|
-
if (
|
|
6525
|
-
for (const C of
|
|
6523
|
+
for (const R of S)
|
|
6524
|
+
if (Se(R)) {
|
|
6525
|
+
for (const C of R.fields)
|
|
6526
6526
|
if (!C.isCustom && C.name) {
|
|
6527
6527
|
const oe = C.name, ie = O[oe];
|
|
6528
6528
|
tt(ie) || (o[oe] = ie);
|
|
6529
6529
|
}
|
|
6530
6530
|
}
|
|
6531
|
-
for (const
|
|
6532
|
-
if (o[
|
|
6533
|
-
const C = O[
|
|
6534
|
-
tt(C) || (o[
|
|
6531
|
+
for (const R of dt)
|
|
6532
|
+
if (o[R] === void 0) {
|
|
6533
|
+
const C = O[R];
|
|
6534
|
+
tt(C) || (o[R] = C);
|
|
6535
6535
|
}
|
|
6536
6536
|
} else
|
|
6537
|
-
|
|
6538
|
-
if (
|
|
6539
|
-
const C = O[
|
|
6540
|
-
tt(C) || (o[
|
|
6537
|
+
H.forEach((R) => {
|
|
6538
|
+
if (R === "externalRefId") return;
|
|
6539
|
+
const C = O[R];
|
|
6540
|
+
tt(C) || (o[R] = C);
|
|
6541
6541
|
});
|
|
6542
6542
|
const d = [];
|
|
6543
6543
|
if (S) {
|
|
6544
|
-
for (const
|
|
6545
|
-
if (
|
|
6546
|
-
for (const C of
|
|
6544
|
+
for (const R of S)
|
|
6545
|
+
if (Se(R))
|
|
6546
|
+
for (const C of R.fields) {
|
|
6547
6547
|
if (!C.isCustom || !C.paramName || C.customType === "paragraph" || C.customType === "html" || C.customType === "br" || C.customType === "link") continue;
|
|
6548
6548
|
const oe = re[C.paramName] ?? "";
|
|
6549
6549
|
let ie;
|
|
@@ -6553,47 +6553,47 @@ const st = {
|
|
|
6553
6553
|
d.push({ paramName: C.paramName, value: ie });
|
|
6554
6554
|
}
|
|
6555
6555
|
}
|
|
6556
|
-
for (const [
|
|
6557
|
-
o[
|
|
6558
|
-
const A = new Set(d.map((
|
|
6559
|
-
for (const [
|
|
6560
|
-
!A.has(
|
|
6556
|
+
for (const [R, C] of Object.entries(z))
|
|
6557
|
+
o[R] === void 0 && !tt(C) && (o[R] = C);
|
|
6558
|
+
const A = new Set(d.map((R) => R.paramName));
|
|
6559
|
+
for (const [R, C] of Object.entries(ae))
|
|
6560
|
+
!A.has(R) && C && d.push({ paramName: R, value: C });
|
|
6561
6561
|
d.length > 0 && (o.applicantAdditionalDatas = d);
|
|
6562
|
-
const
|
|
6563
|
-
n(
|
|
6562
|
+
const h = await u(o);
|
|
6563
|
+
n(h.applicantId);
|
|
6564
6564
|
} catch (o) {
|
|
6565
|
-
console.error("Error creating applicant:", o),
|
|
6565
|
+
console.error("Error creating applicant:", o), _(o.message || "Failed to create applicant");
|
|
6566
6566
|
} finally {
|
|
6567
|
-
|
|
6567
|
+
J(!1);
|
|
6568
6568
|
}
|
|
6569
6569
|
}, Ze = async (o) => {
|
|
6570
6570
|
var d;
|
|
6571
6571
|
o.preventDefault();
|
|
6572
6572
|
for (const A of D)
|
|
6573
6573
|
if (tt(O[A])) {
|
|
6574
|
-
const
|
|
6575
|
-
|
|
6574
|
+
const h = ((d = Qe[A]) == null ? void 0 : d.label) || A;
|
|
6575
|
+
_(`${h} is required.`);
|
|
6576
6576
|
return;
|
|
6577
6577
|
}
|
|
6578
6578
|
await Me();
|
|
6579
|
-
}, je = (o, d, A,
|
|
6579
|
+
}, je = (o, d, A, h, R) => {
|
|
6580
6580
|
var xt;
|
|
6581
6581
|
const C = Qe[o];
|
|
6582
6582
|
if (!C) return null;
|
|
6583
|
-
const oe = D.includes(o), ie = K[o],
|
|
6583
|
+
const oe = D.includes(o), ie = K[o], we = A || C.label, ge = d ?? o, pe = { required: oe }, ze = R ? R !== "placeholder" : f, He = ze ? we : void 0, Ot = ze ? "..." : we;
|
|
6584
6584
|
switch (C.type) {
|
|
6585
6585
|
case "select":
|
|
6586
6586
|
if (o === "country" || o === "nationality" || o === "taxCountry" || o === "countryOfBirth" || o === "mobileCountryCode") {
|
|
6587
|
-
const
|
|
6587
|
+
const Ce = j(o, h);
|
|
6588
6588
|
return /* @__PURE__ */ r(
|
|
6589
|
-
|
|
6589
|
+
$e,
|
|
6590
6590
|
{
|
|
6591
6591
|
...pe,
|
|
6592
6592
|
label: He,
|
|
6593
6593
|
value: O[o] || "",
|
|
6594
|
-
onChange: (Ke) =>
|
|
6595
|
-
options: [{ value: "", label: `Select ${Ot.toLowerCase()}` }, ...
|
|
6596
|
-
disabled:
|
|
6594
|
+
onChange: (Ke) => Q(o, Ke),
|
|
6595
|
+
options: [{ value: "", label: `Select ${Ot.toLowerCase()}` }, ...Ce],
|
|
6596
|
+
disabled: V,
|
|
6597
6597
|
error: ie
|
|
6598
6598
|
},
|
|
6599
6599
|
ge
|
|
@@ -6601,14 +6601,14 @@ const st = {
|
|
|
6601
6601
|
}
|
|
6602
6602
|
if (o === "salutation")
|
|
6603
6603
|
return /* @__PURE__ */ r(
|
|
6604
|
-
|
|
6604
|
+
$e,
|
|
6605
6605
|
{
|
|
6606
6606
|
...pe,
|
|
6607
6607
|
label: He,
|
|
6608
6608
|
value: ((xt = O[o]) == null ? void 0 : xt.toString()) || "",
|
|
6609
|
-
onChange: (
|
|
6609
|
+
onChange: (Ce) => Q(o, Ce ? Number(Ce) : null),
|
|
6610
6610
|
options: [
|
|
6611
|
-
{ value: "", label: ze ? "Select salutation..." :
|
|
6611
|
+
{ value: "", label: ze ? "Select salutation..." : we },
|
|
6612
6612
|
{ value: pt.Male.toString(), label: "Male" },
|
|
6613
6613
|
{ value: pt.Female.toString(), label: "Female" },
|
|
6614
6614
|
{ value: pt.Other.toString(), label: "Other" }
|
|
@@ -6618,15 +6618,15 @@ const st = {
|
|
|
6618
6618
|
ge
|
|
6619
6619
|
);
|
|
6620
6620
|
if (o === "defaultLanguage") {
|
|
6621
|
-
const
|
|
6621
|
+
const Ce = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? kt.filter((Ke) => c.allowedLanguages.includes(Ke.value)) : kt;
|
|
6622
6622
|
return /* @__PURE__ */ r(
|
|
6623
|
-
|
|
6623
|
+
$e,
|
|
6624
6624
|
{
|
|
6625
6625
|
...pe,
|
|
6626
6626
|
label: He,
|
|
6627
6627
|
value: O[o] || "",
|
|
6628
|
-
onChange: (Ke) =>
|
|
6629
|
-
options: [{ value: "", label: ze ? "Select language..." :
|
|
6628
|
+
onChange: (Ke) => Q(o, Ke),
|
|
6629
|
+
options: [{ value: "", label: ze ? "Select language..." : we }, ...Ce],
|
|
6630
6630
|
error: ie
|
|
6631
6631
|
},
|
|
6632
6632
|
ge
|
|
@@ -6635,17 +6635,17 @@ const st = {
|
|
|
6635
6635
|
return null;
|
|
6636
6636
|
case "multiselect":
|
|
6637
6637
|
if (o === "otherNationality") {
|
|
6638
|
-
const
|
|
6638
|
+
const Ce = j(o, h);
|
|
6639
6639
|
return /* @__PURE__ */ r(
|
|
6640
6640
|
qr,
|
|
6641
6641
|
{
|
|
6642
6642
|
...pe,
|
|
6643
6643
|
label: He,
|
|
6644
6644
|
value: O[o] || [],
|
|
6645
|
-
onChange: (Ke) =>
|
|
6646
|
-
options:
|
|
6647
|
-
placeholder: ze ? "Select other nationalities..." :
|
|
6648
|
-
disabled:
|
|
6645
|
+
onChange: (Ke) => Q(o, Ke),
|
|
6646
|
+
options: Ce,
|
|
6647
|
+
placeholder: ze ? "Select other nationalities..." : we,
|
|
6648
|
+
disabled: V
|
|
6649
6649
|
},
|
|
6650
6650
|
ge
|
|
6651
6651
|
);
|
|
@@ -6658,9 +6658,9 @@ const st = {
|
|
|
6658
6658
|
...pe,
|
|
6659
6659
|
type: "date",
|
|
6660
6660
|
label: He,
|
|
6661
|
-
placeholder: ze ? void 0 :
|
|
6661
|
+
placeholder: ze ? void 0 : we,
|
|
6662
6662
|
value: O[o] || "",
|
|
6663
|
-
onChange: (
|
|
6663
|
+
onChange: (Ce) => Q(o, Ce.target.value),
|
|
6664
6664
|
error: ie
|
|
6665
6665
|
},
|
|
6666
6666
|
ge
|
|
@@ -6672,9 +6672,9 @@ const st = {
|
|
|
6672
6672
|
...pe,
|
|
6673
6673
|
type: "email",
|
|
6674
6674
|
label: He,
|
|
6675
|
-
placeholder: ze ? void 0 :
|
|
6675
|
+
placeholder: ze ? void 0 : we,
|
|
6676
6676
|
value: O[o] || "",
|
|
6677
|
-
onChange: (
|
|
6677
|
+
onChange: (Ce) => Q(o, Ce.target.value),
|
|
6678
6678
|
error: ie
|
|
6679
6679
|
},
|
|
6680
6680
|
ge
|
|
@@ -6686,9 +6686,9 @@ const st = {
|
|
|
6686
6686
|
...pe,
|
|
6687
6687
|
type: "tel",
|
|
6688
6688
|
label: He,
|
|
6689
|
-
placeholder: ze ? void 0 :
|
|
6689
|
+
placeholder: ze ? void 0 : we,
|
|
6690
6690
|
value: O[o] || "",
|
|
6691
|
-
onChange: (
|
|
6691
|
+
onChange: (Ce) => Q(o, Ce.target.value),
|
|
6692
6692
|
error: ie
|
|
6693
6693
|
},
|
|
6694
6694
|
ge
|
|
@@ -6700,15 +6700,15 @@ const st = {
|
|
|
6700
6700
|
...pe,
|
|
6701
6701
|
type: "text",
|
|
6702
6702
|
label: He,
|
|
6703
|
-
placeholder: ze ? void 0 :
|
|
6703
|
+
placeholder: ze ? void 0 : we,
|
|
6704
6704
|
value: O[o] || "",
|
|
6705
|
-
onChange: (
|
|
6705
|
+
onChange: (Ce) => Q(o, Ce.target.value),
|
|
6706
6706
|
error: ie
|
|
6707
6707
|
},
|
|
6708
6708
|
ge
|
|
6709
6709
|
);
|
|
6710
6710
|
}
|
|
6711
|
-
},
|
|
6711
|
+
}, Ue = (o, d) => {
|
|
6712
6712
|
const A = o.labelMode ? o.labelMode !== "placeholder" : f;
|
|
6713
6713
|
if (o.customType === "paragraph") {
|
|
6714
6714
|
const C = o.displayText || o.label || "";
|
|
@@ -6762,7 +6762,7 @@ const st = {
|
|
|
6762
6762
|
) }, `custom-${d}`);
|
|
6763
6763
|
}
|
|
6764
6764
|
if (!o.paramName) return null;
|
|
6765
|
-
const
|
|
6765
|
+
const h = K[o.paramName], R = o.displayText || o.label || o.paramName;
|
|
6766
6766
|
if (o.customType === "checkbox")
|
|
6767
6767
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
6768
6768
|
/* @__PURE__ */ i(
|
|
@@ -6787,7 +6787,7 @@ const st = {
|
|
|
6787
6787
|
className: "metakyc-option-text",
|
|
6788
6788
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
6789
6789
|
children: [
|
|
6790
|
-
|
|
6790
|
+
R,
|
|
6791
6791
|
o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
6792
6792
|
]
|
|
6793
6793
|
}
|
|
@@ -6795,7 +6795,7 @@ const st = {
|
|
|
6795
6795
|
]
|
|
6796
6796
|
}
|
|
6797
6797
|
),
|
|
6798
|
-
|
|
6798
|
+
h && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: h })
|
|
6799
6799
|
] }, `custom-${d}`);
|
|
6800
6800
|
if (o.customType === "link_checkbox")
|
|
6801
6801
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -6821,7 +6821,7 @@ const st = {
|
|
|
6821
6821
|
className: "metakyc-option-text",
|
|
6822
6822
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
6823
6823
|
children: [
|
|
6824
|
-
|
|
6824
|
+
R,
|
|
6825
6825
|
" ",
|
|
6826
6826
|
o.linkUrl && /* @__PURE__ */ r(
|
|
6827
6827
|
"a",
|
|
@@ -6842,7 +6842,7 @@ const st = {
|
|
|
6842
6842
|
]
|
|
6843
6843
|
}
|
|
6844
6844
|
),
|
|
6845
|
-
|
|
6845
|
+
h && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: h })
|
|
6846
6846
|
] }, `custom-${d}`);
|
|
6847
6847
|
if (o.customType === "group_checkbox") {
|
|
6848
6848
|
const C = (re[o.paramName] || "").split(",").filter(Boolean);
|
|
@@ -6853,7 +6853,7 @@ const st = {
|
|
|
6853
6853
|
className: "text-sm font-medium",
|
|
6854
6854
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
6855
6855
|
children: [
|
|
6856
|
-
|
|
6856
|
+
R,
|
|
6857
6857
|
o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
6858
6858
|
]
|
|
6859
6859
|
}
|
|
@@ -6871,11 +6871,11 @@ const st = {
|
|
|
6871
6871
|
{
|
|
6872
6872
|
type: "checkbox",
|
|
6873
6873
|
checked: ie,
|
|
6874
|
-
onChange: (
|
|
6874
|
+
onChange: (we) => {
|
|
6875
6875
|
if (o.singleSelect)
|
|
6876
|
-
ce(o.paramName,
|
|
6876
|
+
ce(o.paramName, we.target.checked ? oe.value : "");
|
|
6877
6877
|
else {
|
|
6878
|
-
const ge =
|
|
6878
|
+
const ge = we.target.checked ? [...C, oe.value] : C.filter((pe) => pe !== oe.value);
|
|
6879
6879
|
ce(o.paramName, ge.join(","));
|
|
6880
6880
|
}
|
|
6881
6881
|
},
|
|
@@ -6896,7 +6896,7 @@ const st = {
|
|
|
6896
6896
|
oe.value
|
|
6897
6897
|
);
|
|
6898
6898
|
}) }),
|
|
6899
|
-
|
|
6899
|
+
h && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: h })
|
|
6900
6900
|
] }, `custom-${d}`);
|
|
6901
6901
|
}
|
|
6902
6902
|
return o.customType === "radio_group" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
@@ -6906,7 +6906,7 @@ const st = {
|
|
|
6906
6906
|
className: "text-sm font-medium",
|
|
6907
6907
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
6908
6908
|
children: [
|
|
6909
|
-
|
|
6909
|
+
R,
|
|
6910
6910
|
o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
6911
6911
|
]
|
|
6912
6912
|
}
|
|
@@ -6940,24 +6940,24 @@ const st = {
|
|
|
6940
6940
|
},
|
|
6941
6941
|
C.value
|
|
6942
6942
|
)) }),
|
|
6943
|
-
|
|
6943
|
+
h && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: h })
|
|
6944
6944
|
] }, `custom-${d}`) : /* @__PURE__ */ r(
|
|
6945
6945
|
fe,
|
|
6946
6946
|
{
|
|
6947
6947
|
type: "text",
|
|
6948
|
-
label: A ? `${
|
|
6949
|
-
placeholder: A ? void 0 :
|
|
6948
|
+
label: A ? `${R}${o.required ? " *" : ""}` : void 0,
|
|
6949
|
+
placeholder: A ? void 0 : R,
|
|
6950
6950
|
value: re[o.paramName] || "",
|
|
6951
6951
|
onChange: (C) => ce(o.paramName, C.target.value),
|
|
6952
6952
|
required: o.required,
|
|
6953
|
-
error:
|
|
6953
|
+
error: h
|
|
6954
6954
|
},
|
|
6955
6955
|
`custom-${d}`
|
|
6956
6956
|
);
|
|
6957
6957
|
}, g = (o, d) => {
|
|
6958
|
-
const A =
|
|
6958
|
+
const A = Se(o);
|
|
6959
6959
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
6960
|
-
o.conditionalOn && /* @__PURE__ */ r(
|
|
6960
|
+
o.conditionalOn && /* @__PURE__ */ r(It, { helpText: o.conditionalHelpText, children: /* @__PURE__ */ i(
|
|
6961
6961
|
"label",
|
|
6962
6962
|
{
|
|
6963
6963
|
className: "metakyc-option-label",
|
|
@@ -6968,7 +6968,7 @@ const st = {
|
|
|
6968
6968
|
{
|
|
6969
6969
|
type: "checkbox",
|
|
6970
6970
|
checked: A,
|
|
6971
|
-
onChange: (
|
|
6971
|
+
onChange: (h) => ce(o.conditionalOn, h.target.checked ? "true" : "false"),
|
|
6972
6972
|
className: "metakyc-option-input",
|
|
6973
6973
|
style: st
|
|
6974
6974
|
}
|
|
@@ -6984,21 +6984,21 @@ const st = {
|
|
|
6984
6984
|
]
|
|
6985
6985
|
}
|
|
6986
6986
|
) }),
|
|
6987
|
-
A && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: o.fields.map((
|
|
6988
|
-
const C =
|
|
6989
|
-
return /* @__PURE__ */ r("div", { className: C, children: /* @__PURE__ */ r(
|
|
6987
|
+
A && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: o.fields.map((h, R) => {
|
|
6988
|
+
const C = h.colSpan === 1 ? "col-span-1" : h.colSpan === 2 ? "col-span-2" : h.colSpan === 3 ? "col-span-3" : "col-span-4", oe = h.isCustom ? `custom-${R}-${h.paramName}` : `builtin-${h.name}-${R}`;
|
|
6989
|
+
return /* @__PURE__ */ r("div", { className: C, children: /* @__PURE__ */ r(It, { helpText: h.helpText, children: h.isCustom ? Ue(h, R) : je(h.name, oe, h.displayText, h.countriesType, h.labelMode) }) }, oe);
|
|
6990
6990
|
}) })
|
|
6991
6991
|
] });
|
|
6992
6992
|
};
|
|
6993
|
-
if (!c ||
|
|
6993
|
+
if (!c || V)
|
|
6994
6994
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
6995
6995
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
6996
6996
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
6997
6997
|
] }) }) });
|
|
6998
6998
|
if (S) {
|
|
6999
|
-
const o = S[de] ?? S[0], d =
|
|
6999
|
+
const o = S[de] ?? S[0], d = ke === -1, A = De === -1, h = S.length, R = Se(o), C = Object.values(K);
|
|
7000
7000
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(X, { children: [
|
|
7001
|
-
/* @__PURE__ */ r(
|
|
7001
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r(ot, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7002
7002
|
/* @__PURE__ */ i(ee, { children: [
|
|
7003
7003
|
(o.title || o.subtitle || o.description) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
7004
7004
|
o.title && /* @__PURE__ */ r(
|
|
@@ -7034,7 +7034,7 @@ const st = {
|
|
|
7034
7034
|
] }),
|
|
7035
7035
|
C.map((oe, ie) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: oe }, ie))
|
|
7036
7036
|
] }),
|
|
7037
|
-
|
|
7037
|
+
h > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
7038
7038
|
S.map((oe, ie) => /* @__PURE__ */ r(
|
|
7039
7039
|
"div",
|
|
7040
7040
|
{
|
|
@@ -7046,71 +7046,71 @@ const st = {
|
|
|
7046
7046
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
7047
7047
|
de + 1,
|
|
7048
7048
|
" / ",
|
|
7049
|
-
|
|
7049
|
+
h
|
|
7050
7050
|
] })
|
|
7051
7051
|
] }),
|
|
7052
7052
|
g(o)
|
|
7053
7053
|
] }),
|
|
7054
|
-
/* @__PURE__ */ i(
|
|
7054
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
7055
7055
|
/* @__PURE__ */ i("div", { children: [
|
|
7056
7056
|
!d && /* @__PURE__ */ r(
|
|
7057
|
-
|
|
7057
|
+
G,
|
|
7058
7058
|
{
|
|
7059
7059
|
type: "button",
|
|
7060
7060
|
variant: "outline",
|
|
7061
7061
|
onClick: () => {
|
|
7062
|
-
P(
|
|
7062
|
+
P(ke), Z({});
|
|
7063
7063
|
},
|
|
7064
|
-
disabled: x ||
|
|
7064
|
+
disabled: x || y,
|
|
7065
7065
|
children: "Previous"
|
|
7066
7066
|
}
|
|
7067
7067
|
),
|
|
7068
|
-
d && a && /* @__PURE__ */ r(
|
|
7068
|
+
d && a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: x || y, children: "Cancel" })
|
|
7069
7069
|
] }),
|
|
7070
7070
|
/* @__PURE__ */ r(
|
|
7071
|
-
|
|
7071
|
+
G,
|
|
7072
7072
|
{
|
|
7073
7073
|
type: "button",
|
|
7074
|
-
isLoading: x ||
|
|
7074
|
+
isLoading: x || y,
|
|
7075
7075
|
onClick: A ? Me : Je,
|
|
7076
|
-
children: A ? o.conditionalOn && !
|
|
7076
|
+
children: A ? o.conditionalOn && !R ? "Skip & Submit" : "Submit" : o.conditionalOn && !R ? "Skip" : "Next"
|
|
7077
7077
|
}
|
|
7078
7078
|
)
|
|
7079
7079
|
] })
|
|
7080
7080
|
] }) });
|
|
7081
7081
|
}
|
|
7082
7082
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Ze, children: /* @__PURE__ */ i(X, { children: [
|
|
7083
|
-
/* @__PURE__ */ r(
|
|
7083
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r(ot, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7084
7084
|
/* @__PURE__ */ i(ee, { children: [
|
|
7085
7085
|
ue && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
7086
7086
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7087
7087
|
" ",
|
|
7088
7088
|
ue
|
|
7089
7089
|
] }) }),
|
|
7090
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children:
|
|
7090
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: H.map((o) => /* @__PURE__ */ r("div", { className: "col-span-4", children: je(o) }, o)) })
|
|
7091
7091
|
] }),
|
|
7092
|
-
/* @__PURE__ */ i(
|
|
7093
|
-
a && /* @__PURE__ */ r(
|
|
7094
|
-
/* @__PURE__ */ r(
|
|
7092
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
7093
|
+
a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: x || y, children: "Cancel" }),
|
|
7094
|
+
/* @__PURE__ */ r(G, { type: "submit", isLoading: x || y, children: "Create Applicant" })
|
|
7095
7095
|
] })
|
|
7096
7096
|
] }) }) });
|
|
7097
7097
|
}, Et = ["companyName", "email"];
|
|
7098
7098
|
function ht(e) {
|
|
7099
7099
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
7100
7100
|
}
|
|
7101
|
-
const
|
|
7101
|
+
const Kn = ({
|
|
7102
7102
|
workflowKey: e,
|
|
7103
7103
|
externalRefId: t,
|
|
7104
7104
|
onSuccess: n,
|
|
7105
7105
|
onCancel: a
|
|
7106
7106
|
}) => {
|
|
7107
|
-
var je,
|
|
7108
|
-
const { config: s, baseInformationService: l, currentTheme: c } =
|
|
7107
|
+
var je, Ue, g, $, Y;
|
|
7108
|
+
const { config: s, baseInformationService: l, currentTheme: c } = Ee(), { createCompanyApplicant: u, isLoading: y } = Pt(), m = e || ((je = s.applicantForm) == null ? void 0 : je.workflowKey);
|
|
7109
7109
|
if (!m)
|
|
7110
7110
|
throw new Error(
|
|
7111
7111
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
7112
7112
|
);
|
|
7113
|
-
const
|
|
7113
|
+
const N = t || ((Ue = s.applicantForm) == null ? void 0 : Ue.externalRefId) || "", T = ((g = s.applicantForm) == null ? void 0 : g.email) || "", L = ((($ = s.applicantForm) == null ? void 0 : $.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", f = Ae(
|
|
7114
7114
|
() => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
|
|
7115
7115
|
[c == null ? void 0 : c.companyFormPages]
|
|
7116
7116
|
), S = Ae(() => {
|
|
@@ -7129,18 +7129,18 @@ const Wn = ({
|
|
|
7129
7129
|
return Array.from(E);
|
|
7130
7130
|
}
|
|
7131
7131
|
return (p = s.applicantForm) != null && p.visibleFields ? s.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : rr;
|
|
7132
|
-
}, [(
|
|
7132
|
+
}, [(Y = s.applicantForm) == null ? void 0 : Y.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, f]), H = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), W = Ae(() => {
|
|
7133
7133
|
var w, E;
|
|
7134
7134
|
const p = /* @__PURE__ */ new Set();
|
|
7135
7135
|
if (f)
|
|
7136
7136
|
for (const v of f)
|
|
7137
7137
|
for (const o of v.fields)
|
|
7138
|
-
!o.isCustom && o.name &&
|
|
7138
|
+
!o.isCustom && o.name && H.has(o.name) && p.add(o.countriesType ?? ((w = Xe[o.name]) == null ? void 0 : w.countriesType));
|
|
7139
7139
|
else
|
|
7140
7140
|
for (const v of D)
|
|
7141
|
-
|
|
7141
|
+
H.has(v) && p.add((E = Xe[v]) == null ? void 0 : E.countriesType);
|
|
7142
7142
|
return p.size === 0 && p.add(void 0), Array.from(p);
|
|
7143
|
-
}, [D, f]), [M,
|
|
7143
|
+
}, [D, f]), [M, q] = k({}), [U, V] = k(!0), F = le(/* @__PURE__ */ new Set()), b = le(/* @__PURE__ */ new Set());
|
|
7144
7144
|
ye(() => {
|
|
7145
7145
|
if (!c) return;
|
|
7146
7146
|
const p = W.filter((v) => {
|
|
@@ -7148,32 +7148,32 @@ const Wn = ({
|
|
|
7148
7148
|
return !b.current.has(o) && !F.current.has(o);
|
|
7149
7149
|
});
|
|
7150
7150
|
if (p.length === 0) {
|
|
7151
|
-
W.every((o) => b.current.has(o != null ? String(o) : "all")) &&
|
|
7151
|
+
W.every((o) => b.current.has(o != null ? String(o) : "all")) && V(!1);
|
|
7152
7152
|
return;
|
|
7153
7153
|
}
|
|
7154
|
-
|
|
7154
|
+
V(!0);
|
|
7155
7155
|
const w = p.map((v) => v != null ? String(v) : "all");
|
|
7156
7156
|
w.forEach((v) => F.current.add(v)), (async () => {
|
|
7157
7157
|
try {
|
|
7158
7158
|
const v = await Promise.all(
|
|
7159
7159
|
p.map(async (o) => {
|
|
7160
|
-
const d = o != null ? String(o) : "all", A = await l.getCountries("", s.locale || "en", o),
|
|
7161
|
-
return b.current.add(d), F.current.delete(d), [d,
|
|
7160
|
+
const d = o != null ? String(o) : "all", A = await l.getCountries("", s.locale || "en", o), h = /* @__PURE__ */ new Set(), R = A.map((C) => ({ value: C.abbreviation3 || C.abbreviation, label: C.name })).filter((C) => !C.value || h.has(C.value) ? !1 : (h.add(C.value), !0));
|
|
7161
|
+
return b.current.add(d), F.current.delete(d), [d, R];
|
|
7162
7162
|
})
|
|
7163
7163
|
);
|
|
7164
|
-
|
|
7164
|
+
q((o) => ({ ...o, ...Object.fromEntries(v) }));
|
|
7165
7165
|
} catch (v) {
|
|
7166
7166
|
w.forEach((o) => F.current.delete(o)), console.error("Failed to load countries:", v);
|
|
7167
7167
|
} finally {
|
|
7168
|
-
W.every((o) => b.current.has(o != null ? String(o) : "all")) &&
|
|
7168
|
+
W.every((o) => b.current.has(o != null ? String(o) : "all")) && V(!1);
|
|
7169
7169
|
}
|
|
7170
7170
|
})();
|
|
7171
7171
|
}, [W, c]);
|
|
7172
|
-
const
|
|
7172
|
+
const B = (p, w) => {
|
|
7173
7173
|
var o;
|
|
7174
7174
|
const E = w ?? ((o = Xe[p]) == null ? void 0 : o.countriesType), v = E != null ? String(E) : "all";
|
|
7175
7175
|
return M[v] || [];
|
|
7176
|
-
}, [
|
|
7176
|
+
}, [j, z] = k({
|
|
7177
7177
|
workflowKey: m,
|
|
7178
7178
|
companyName: "",
|
|
7179
7179
|
email: T,
|
|
@@ -7194,8 +7194,8 @@ const Wn = ({
|
|
|
7194
7194
|
postalCode: "",
|
|
7195
7195
|
addressCountry: "",
|
|
7196
7196
|
lei: "",
|
|
7197
|
-
externalRefId:
|
|
7198
|
-
}), [O, ne] = k({}), [ae, re] = k(0), [he, de] = k({}), [P, K] = k(null), [Z, ue] = k(!1),
|
|
7197
|
+
externalRefId: N
|
|
7198
|
+
}), [O, ne] = k({}), [ae, re] = k(0), [he, de] = k({}), [P, K] = k(null), [Z, ue] = k(!1), _ = (p, w) => z((E) => ({ ...E, [p]: w })), x = (p, w) => ne((E) => ({ ...E, [p]: w })), J = (p) => !p.conditionalOn || O[p.conditionalOn] === "true", Q = f && ae < f.length - 1 ? ae + 1 : -1, ce = f && ae > 0 ? ae - 1 : -1, Se = (p) => {
|
|
7199
7199
|
var E;
|
|
7200
7200
|
const w = {};
|
|
7201
7201
|
for (const v of p.fields)
|
|
@@ -7207,7 +7207,7 @@ const Wn = ({
|
|
|
7207
7207
|
}
|
|
7208
7208
|
} else if (v.name) {
|
|
7209
7209
|
const o = v.name;
|
|
7210
|
-
if (S.includes(o) && ht(
|
|
7210
|
+
if (S.includes(o) && ht(j[o])) {
|
|
7211
7211
|
const d = v.displayText || ((E = Xe[o]) == null ? void 0 : E.label) || o;
|
|
7212
7212
|
w[o] = `${d} is required.`;
|
|
7213
7213
|
}
|
|
@@ -7216,22 +7216,22 @@ const Wn = ({
|
|
|
7216
7216
|
}, De = async () => {
|
|
7217
7217
|
if (!f) return;
|
|
7218
7218
|
const p = f[ae];
|
|
7219
|
-
if (p.conditionalOn && !
|
|
7220
|
-
de({}),
|
|
7219
|
+
if (p.conditionalOn && !J(p)) {
|
|
7220
|
+
de({}), Q >= 0 ? re(Q) : await ke();
|
|
7221
7221
|
return;
|
|
7222
7222
|
}
|
|
7223
|
-
const w =
|
|
7223
|
+
const w = Se(p);
|
|
7224
7224
|
if (Object.keys(w).length > 0) {
|
|
7225
7225
|
de(w);
|
|
7226
7226
|
return;
|
|
7227
7227
|
}
|
|
7228
|
-
de({}),
|
|
7229
|
-
},
|
|
7228
|
+
de({}), Q >= 0 ? re(Q) : await ke();
|
|
7229
|
+
}, ke = async () => {
|
|
7230
7230
|
var p;
|
|
7231
7231
|
if (f) {
|
|
7232
7232
|
let w = {};
|
|
7233
7233
|
for (const E of f)
|
|
7234
|
-
|
|
7234
|
+
J(E) && (w = { ...w, ...Se(E) });
|
|
7235
7235
|
if (Object.keys(w).length > 0) {
|
|
7236
7236
|
de(w);
|
|
7237
7237
|
return;
|
|
@@ -7240,11 +7240,11 @@ const Wn = ({
|
|
|
7240
7240
|
ue(!0), K(null);
|
|
7241
7241
|
try {
|
|
7242
7242
|
const w = {
|
|
7243
|
-
workflowKey:
|
|
7244
|
-
externalRefId: ((p =
|
|
7245
|
-
}, E = f ? f.filter((d) =>
|
|
7243
|
+
workflowKey: j.workflowKey,
|
|
7244
|
+
externalRefId: ((p = j.externalRefId) == null ? void 0 : p.trim()) || void 0
|
|
7245
|
+
}, E = f ? f.filter((d) => J(d)).flatMap((d) => d.fields).filter((d) => !d.isCustom && d.name).map((d) => d.name) : D;
|
|
7246
7246
|
for (const d of E) {
|
|
7247
|
-
const A =
|
|
7247
|
+
const A = j[d];
|
|
7248
7248
|
if (!ht(A))
|
|
7249
7249
|
switch (d) {
|
|
7250
7250
|
case "companyName":
|
|
@@ -7279,15 +7279,15 @@ const Wn = ({
|
|
|
7279
7279
|
const v = [];
|
|
7280
7280
|
if (f) {
|
|
7281
7281
|
for (const d of f)
|
|
7282
|
-
if (
|
|
7282
|
+
if (J(d))
|
|
7283
7283
|
for (const A of d.fields) {
|
|
7284
7284
|
if (!A.isCustom || !A.paramName || A.customType === "paragraph" || A.customType === "html" || A.customType === "br" || A.customType === "link") continue;
|
|
7285
|
-
const
|
|
7286
|
-
let
|
|
7285
|
+
const h = O[A.paramName] ?? "";
|
|
7286
|
+
let R;
|
|
7287
7287
|
if (A.customType === "checkbox" || A.customType === "link_checkbox")
|
|
7288
|
-
|
|
7289
|
-
else if (
|
|
7290
|
-
v.push({ paramName: A.paramName, value:
|
|
7288
|
+
R = h === "true" ? "yes" : "no";
|
|
7289
|
+
else if (R = h, !R && !A.required) continue;
|
|
7290
|
+
v.push({ paramName: A.paramName, value: R });
|
|
7291
7291
|
}
|
|
7292
7292
|
}
|
|
7293
7293
|
v.length > 0 && (w.applicantAdditionalDatas = v);
|
|
@@ -7302,30 +7302,30 @@ const Wn = ({
|
|
|
7302
7302
|
var w;
|
|
7303
7303
|
p.preventDefault();
|
|
7304
7304
|
for (const E of S)
|
|
7305
|
-
if (ht(
|
|
7305
|
+
if (ht(j[E])) {
|
|
7306
7306
|
const v = ((w = Xe[E]) == null ? void 0 : w.label) || E;
|
|
7307
7307
|
K(`${v} is required.`);
|
|
7308
7308
|
return;
|
|
7309
7309
|
}
|
|
7310
|
-
await
|
|
7310
|
+
await ke();
|
|
7311
7311
|
}, Je = (p, w, E, v, o) => {
|
|
7312
7312
|
const d = Xe[p];
|
|
7313
7313
|
if (!d) return null;
|
|
7314
|
-
const A = S.includes(p),
|
|
7314
|
+
const A = S.includes(p), h = he[p], R = E || d.label, C = w ?? p, oe = o ? o !== "placeholder" : L, ie = oe ? R : void 0, we = oe ? "..." : R;
|
|
7315
7315
|
switch (d.type) {
|
|
7316
7316
|
case "select":
|
|
7317
7317
|
if (p === "countryResidence" || p === "addressCountry") {
|
|
7318
|
-
const ge =
|
|
7318
|
+
const ge = B(p, v);
|
|
7319
7319
|
return /* @__PURE__ */ r(
|
|
7320
|
-
|
|
7320
|
+
$e,
|
|
7321
7321
|
{
|
|
7322
7322
|
required: A,
|
|
7323
7323
|
label: ie,
|
|
7324
|
-
value:
|
|
7325
|
-
onChange: (pe) =>
|
|
7326
|
-
options: [{ value: "", label: `Select ${
|
|
7327
|
-
disabled:
|
|
7328
|
-
error:
|
|
7324
|
+
value: j[p] || "",
|
|
7325
|
+
onChange: (pe) => _(p, pe),
|
|
7326
|
+
options: [{ value: "", label: `Select ${we.toLowerCase()}` }, ...ge],
|
|
7327
|
+
disabled: U,
|
|
7328
|
+
error: h
|
|
7329
7329
|
},
|
|
7330
7330
|
C
|
|
7331
7331
|
);
|
|
@@ -7338,10 +7338,10 @@ const Wn = ({
|
|
|
7338
7338
|
required: A,
|
|
7339
7339
|
type: "date",
|
|
7340
7340
|
label: ie,
|
|
7341
|
-
placeholder: oe ? void 0 :
|
|
7342
|
-
value:
|
|
7343
|
-
onChange: (ge) =>
|
|
7344
|
-
error:
|
|
7341
|
+
placeholder: oe ? void 0 : R,
|
|
7342
|
+
value: j[p] || "",
|
|
7343
|
+
onChange: (ge) => _(p, ge.target.value),
|
|
7344
|
+
error: h
|
|
7345
7345
|
},
|
|
7346
7346
|
C
|
|
7347
7347
|
);
|
|
@@ -7352,10 +7352,10 @@ const Wn = ({
|
|
|
7352
7352
|
required: A,
|
|
7353
7353
|
type: "email",
|
|
7354
7354
|
label: ie,
|
|
7355
|
-
placeholder: oe ? void 0 :
|
|
7356
|
-
value:
|
|
7357
|
-
onChange: (ge) =>
|
|
7358
|
-
error:
|
|
7355
|
+
placeholder: oe ? void 0 : R,
|
|
7356
|
+
value: j[p] || "",
|
|
7357
|
+
onChange: (ge) => _(p, ge.target.value),
|
|
7358
|
+
error: h
|
|
7359
7359
|
},
|
|
7360
7360
|
C
|
|
7361
7361
|
);
|
|
@@ -7366,10 +7366,10 @@ const Wn = ({
|
|
|
7366
7366
|
required: A,
|
|
7367
7367
|
type: "tel",
|
|
7368
7368
|
label: ie,
|
|
7369
|
-
placeholder: oe ? void 0 :
|
|
7370
|
-
value:
|
|
7371
|
-
onChange: (ge) =>
|
|
7372
|
-
error:
|
|
7369
|
+
placeholder: oe ? void 0 : R,
|
|
7370
|
+
value: j[p] || "",
|
|
7371
|
+
onChange: (ge) => _(p, ge.target.value),
|
|
7372
|
+
error: h
|
|
7373
7373
|
},
|
|
7374
7374
|
C
|
|
7375
7375
|
);
|
|
@@ -7380,10 +7380,10 @@ const Wn = ({
|
|
|
7380
7380
|
required: A,
|
|
7381
7381
|
type: "text",
|
|
7382
7382
|
label: ie,
|
|
7383
|
-
placeholder: oe ? void 0 :
|
|
7384
|
-
value:
|
|
7385
|
-
onChange: (ge) =>
|
|
7386
|
-
error:
|
|
7383
|
+
placeholder: oe ? void 0 : R,
|
|
7384
|
+
value: j[p] || "",
|
|
7385
|
+
onChange: (ge) => _(p, ge.target.value),
|
|
7386
|
+
error: h
|
|
7387
7387
|
},
|
|
7388
7388
|
C
|
|
7389
7389
|
);
|
|
@@ -7446,7 +7446,7 @@ const Wn = ({
|
|
|
7446
7446
|
`custom-${w}`
|
|
7447
7447
|
);
|
|
7448
7448
|
}, Ze = (p) => {
|
|
7449
|
-
const w =
|
|
7449
|
+
const w = J(p);
|
|
7450
7450
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
7451
7451
|
p.conditionalOn && /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7452
7452
|
/* @__PURE__ */ r(
|
|
@@ -7466,15 +7466,15 @@ const Wn = ({
|
|
|
7466
7466
|
}) })
|
|
7467
7467
|
] });
|
|
7468
7468
|
};
|
|
7469
|
-
if (!c ||
|
|
7469
|
+
if (!c || U)
|
|
7470
7470
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
7471
7471
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
7472
7472
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7473
7473
|
] }) }) });
|
|
7474
7474
|
if (f) {
|
|
7475
|
-
const p = f[ae] ?? f[0], w = ce === -1, E =
|
|
7475
|
+
const p = f[ae] ?? f[0], w = ce === -1, E = Q === -1, v = f.length, o = J(p), d = Object.values(he);
|
|
7476
7476
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(X, { children: [
|
|
7477
|
-
/* @__PURE__ */ r(
|
|
7477
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r(ot, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7478
7478
|
/* @__PURE__ */ i(ee, { children: [
|
|
7479
7479
|
(p.title || p.subtitle) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
7480
7480
|
p.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: p.title }),
|
|
@@ -7486,16 +7486,16 @@ const Wn = ({
|
|
|
7486
7486
|
" ",
|
|
7487
7487
|
P
|
|
7488
7488
|
] }),
|
|
7489
|
-
d.map((A,
|
|
7489
|
+
d.map((A, h) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: A }, h))
|
|
7490
7490
|
] }),
|
|
7491
7491
|
v > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
7492
|
-
f.map((A,
|
|
7492
|
+
f.map((A, h) => /* @__PURE__ */ r(
|
|
7493
7493
|
"div",
|
|
7494
7494
|
{
|
|
7495
|
-
className: `h-1.5 rounded-full transition-all ${
|
|
7496
|
-
style:
|
|
7495
|
+
className: `h-1.5 rounded-full transition-all ${h === ae ? "flex-1" : "w-8"}`,
|
|
7496
|
+
style: h === ae ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : h < ae ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
7497
7497
|
},
|
|
7498
|
-
|
|
7498
|
+
h
|
|
7499
7499
|
)),
|
|
7500
7500
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
7501
7501
|
ae + 1,
|
|
@@ -7505,28 +7505,28 @@ const Wn = ({
|
|
|
7505
7505
|
] }),
|
|
7506
7506
|
Ze(p)
|
|
7507
7507
|
] }),
|
|
7508
|
-
/* @__PURE__ */ i(
|
|
7508
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
7509
7509
|
/* @__PURE__ */ i("div", { children: [
|
|
7510
7510
|
!w && /* @__PURE__ */ r(
|
|
7511
|
-
|
|
7511
|
+
G,
|
|
7512
7512
|
{
|
|
7513
7513
|
type: "button",
|
|
7514
7514
|
variant: "outline",
|
|
7515
7515
|
onClick: () => {
|
|
7516
7516
|
re(ce), de({});
|
|
7517
7517
|
},
|
|
7518
|
-
disabled: Z ||
|
|
7518
|
+
disabled: Z || y,
|
|
7519
7519
|
children: "Previous"
|
|
7520
7520
|
}
|
|
7521
7521
|
),
|
|
7522
|
-
w && a && /* @__PURE__ */ r(
|
|
7522
|
+
w && a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: Z || y, children: "Cancel" })
|
|
7523
7523
|
] }),
|
|
7524
|
-
/* @__PURE__ */ r(
|
|
7524
|
+
/* @__PURE__ */ r(G, { type: "button", isLoading: Z || y, onClick: E ? ke : De, children: E ? p.conditionalOn && !o ? "Skip & Submit" : "Submit" : p.conditionalOn && !o ? "Skip" : "Next" })
|
|
7525
7525
|
] })
|
|
7526
7526
|
] }) });
|
|
7527
7527
|
}
|
|
7528
7528
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Ge, children: /* @__PURE__ */ i(X, { children: [
|
|
7529
|
-
/* @__PURE__ */ r(
|
|
7529
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r(ot, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7530
7530
|
/* @__PURE__ */ i(ee, { children: [
|
|
7531
7531
|
P && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
7532
7532
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
@@ -7535,12 +7535,12 @@ const Wn = ({
|
|
|
7535
7535
|
] }) }),
|
|
7536
7536
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: D.map((p) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Je(p) }, p)) })
|
|
7537
7537
|
] }),
|
|
7538
|
-
/* @__PURE__ */ i(
|
|
7539
|
-
a && /* @__PURE__ */ r(
|
|
7540
|
-
/* @__PURE__ */ r(
|
|
7538
|
+
/* @__PURE__ */ i(ve, { className: "flex justify-between", children: [
|
|
7539
|
+
a && /* @__PURE__ */ r(G, { type: "button", variant: "outline", onClick: a, disabled: Z || y, children: "Cancel" }),
|
|
7540
|
+
/* @__PURE__ */ r(G, { type: "submit", isLoading: Z || y, children: "Register Company" })
|
|
7541
7541
|
] })
|
|
7542
7542
|
] }) }) });
|
|
7543
|
-
},
|
|
7543
|
+
}, qn = ({
|
|
7544
7544
|
applicantId: e,
|
|
7545
7545
|
onComplete: t,
|
|
7546
7546
|
onError: n,
|
|
@@ -7551,33 +7551,33 @@ const Wn = ({
|
|
|
7551
7551
|
progress: l,
|
|
7552
7552
|
currentStep: c,
|
|
7553
7553
|
steps: u,
|
|
7554
|
-
workflowKey:
|
|
7554
|
+
workflowKey: y,
|
|
7555
7555
|
nextWorkflowKey: m,
|
|
7556
|
-
hasWorkflowChanged:
|
|
7556
|
+
hasWorkflowChanged: N,
|
|
7557
7557
|
isLoading: T,
|
|
7558
|
-
error:
|
|
7558
|
+
error: I,
|
|
7559
7559
|
moveBack: L,
|
|
7560
7560
|
refreshProgress: f
|
|
7561
|
-
} =
|
|
7562
|
-
if (
|
|
7563
|
-
|
|
7564
|
-
}, [
|
|
7561
|
+
} = Br(e), [S, D] = be.useState(!1);
|
|
7562
|
+
if (be.useEffect(() => {
|
|
7563
|
+
I && n && n(I);
|
|
7564
|
+
}, [I, n]), be.useEffect(() => {
|
|
7565
7565
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
7566
|
-
}, [l == null ? void 0 : l.workflowResult, t]),
|
|
7566
|
+
}, [l == null ? void 0 : l.workflowResult, t]), be.useEffect(() => {
|
|
7567
7567
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
7568
|
-
}, [a]),
|
|
7569
|
-
|
|
7570
|
-
}, [
|
|
7568
|
+
}, [a]), be.useEffect(() => {
|
|
7569
|
+
N && D(!1);
|
|
7570
|
+
}, [N]), T || !l)
|
|
7571
7571
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
7572
7572
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
7573
7573
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
|
|
7574
7574
|
] }) }) });
|
|
7575
|
-
if (
|
|
7575
|
+
if (I)
|
|
7576
7576
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
7577
7577
|
/* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "An error occurred" }),
|
|
7578
|
-
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
7578
|
+
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: I.message })
|
|
7579
7579
|
] }) }) }) });
|
|
7580
|
-
if (
|
|
7580
|
+
if (N && !S)
|
|
7581
7581
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
7582
7582
|
/* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full mb-4", style: { backgroundColor: "var(--metakyc-primary-light, #dbeafe)" }, children: /* @__PURE__ */ r("svg", { className: "w-8 h-8", style: { color: "var(--metakyc-primary, #2563eb)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
|
|
7583
7583
|
/* @__PURE__ */ r("h3", { className: "text-xl font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Workflow Transition" }),
|
|
@@ -7586,7 +7586,7 @@ const Wn = ({
|
|
|
7586
7586
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between text-sm", children: [
|
|
7587
7587
|
/* @__PURE__ */ i("div", { className: "text-left", children: [
|
|
7588
7588
|
/* @__PURE__ */ r("p", { className: "mb-1", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Previous Workflow" }),
|
|
7589
|
-
/* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
7589
|
+
/* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: y })
|
|
7590
7590
|
] }),
|
|
7591
7591
|
/* @__PURE__ */ r("svg", { className: "w-6 h-6 mx-4", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
|
|
7592
7592
|
/* @__PURE__ */ i("div", { className: "text-right", children: [
|
|
@@ -7608,7 +7608,7 @@ const Wn = ({
|
|
|
7608
7608
|
] }) }) }) });
|
|
7609
7609
|
if (l.status === Te.Finished || l.status === Te.OnHold)
|
|
7610
7610
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
7611
|
-
|
|
7611
|
+
Rt,
|
|
7612
7612
|
{
|
|
7613
7613
|
kycStatus: l.kycStatus,
|
|
7614
7614
|
reviewStatus: l.reviewStatus,
|
|
@@ -7625,8 +7625,8 @@ const Wn = ({
|
|
|
7625
7625
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
7626
7626
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: l.status === Te.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
7627
7627
|
] }) }) });
|
|
7628
|
-
const
|
|
7629
|
-
switch (
|
|
7628
|
+
const H = (U) => {
|
|
7629
|
+
switch (U) {
|
|
7630
7630
|
case se.Overview:
|
|
7631
7631
|
return "Overview";
|
|
7632
7632
|
case se.Questionaries:
|
|
@@ -7648,64 +7648,42 @@ const Wn = ({
|
|
|
7648
7648
|
default:
|
|
7649
7649
|
return "";
|
|
7650
7650
|
}
|
|
7651
|
-
}, W = () => {
|
|
7652
|
-
const
|
|
7653
|
-
return /* @__PURE__ */ i("div", {
|
|
7654
|
-
/* @__PURE__ */ i("div", {
|
|
7651
|
+
}, W = be.useRef(null), M = () => {
|
|
7652
|
+
const U = u.filter((j) => j.visibility !== !1), V = U.findIndex((j) => j.order === c.order), F = V >= 0 ? V + 1 : 1, b = U.length, B = b > 1 ? V / (b - 1) * 100 : 100;
|
|
7653
|
+
return /* @__PURE__ */ i("div", { style: { marginBottom: "24px" }, children: [
|
|
7654
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
7655
7655
|
/* @__PURE__ */ r(ot, {}),
|
|
7656
7656
|
/* @__PURE__ */ i(Lt, { variant: l.status === 1 ? "info" : "success", children: [
|
|
7657
7657
|
"Step ",
|
|
7658
|
-
|
|
7658
|
+
F,
|
|
7659
7659
|
" of ",
|
|
7660
|
-
|
|
7660
|
+
b
|
|
7661
7661
|
] })
|
|
7662
7662
|
] }),
|
|
7663
|
-
/* @__PURE__ */ r("div", {
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
"span",
|
|
7685
|
-
{
|
|
7686
|
-
className: "ml-2 text-sm whitespace-nowrap",
|
|
7687
|
-
style: {
|
|
7688
|
-
fontWeight: z ? 600 : 400,
|
|
7689
|
-
color: z ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-muted, #9ca3af)"
|
|
7690
|
-
},
|
|
7691
|
-
children: b.displayName || b.name || U(b.action) || `Step ${$ + 1}`
|
|
7692
|
-
}
|
|
7693
|
-
)
|
|
7694
|
-
] }),
|
|
7695
|
-
$ < B.length - 1 && /* @__PURE__ */ r(
|
|
7696
|
-
"div",
|
|
7697
|
-
{
|
|
7698
|
-
className: "flex-1 h-0.5 mx-3",
|
|
7699
|
-
style: {
|
|
7700
|
-
backgroundColor: H ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
7701
|
-
}
|
|
7702
|
-
}
|
|
7703
|
-
)
|
|
7704
|
-
] }, b.order);
|
|
7705
|
-
}) })
|
|
7663
|
+
/* @__PURE__ */ r("div", { style: { marginBottom: "16px" }, children: /* @__PURE__ */ r("div", { style: {
|
|
7664
|
+
height: "4px",
|
|
7665
|
+
borderRadius: "999px",
|
|
7666
|
+
backgroundColor: "var(--metakyc-border, #e5e7eb)",
|
|
7667
|
+
overflow: "hidden"
|
|
7668
|
+
}, children: /* @__PURE__ */ r("div", { style: {
|
|
7669
|
+
height: "100%",
|
|
7670
|
+
borderRadius: "999px",
|
|
7671
|
+
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
7672
|
+
width: `${B}%`,
|
|
7673
|
+
transition: "width 0.4s ease"
|
|
7674
|
+
} }) }) }),
|
|
7675
|
+
/* @__PURE__ */ r(
|
|
7676
|
+
Nn,
|
|
7677
|
+
{
|
|
7678
|
+
ref: W,
|
|
7679
|
+
visibleSteps: U,
|
|
7680
|
+
currentVisibleStepIndex: V,
|
|
7681
|
+
getStepFallbackName: H
|
|
7682
|
+
}
|
|
7683
|
+
)
|
|
7706
7684
|
] });
|
|
7707
|
-
},
|
|
7708
|
-
const
|
|
7685
|
+
}, q = () => {
|
|
7686
|
+
const U = {
|
|
7709
7687
|
applicantId: e,
|
|
7710
7688
|
onComplete: async () => {
|
|
7711
7689
|
await f();
|
|
@@ -7714,23 +7692,23 @@ const Wn = ({
|
|
|
7714
7692
|
};
|
|
7715
7693
|
switch (c.action) {
|
|
7716
7694
|
case se.Questionaries:
|
|
7717
|
-
return /* @__PURE__ */ r(sn, { ...
|
|
7695
|
+
return /* @__PURE__ */ r(sn, { ...U });
|
|
7718
7696
|
case se.UploadDocument:
|
|
7719
|
-
return /* @__PURE__ */ r(cn, { ...
|
|
7697
|
+
return /* @__PURE__ */ r(cn, { ...U });
|
|
7720
7698
|
case se.Overview:
|
|
7721
|
-
return /* @__PURE__ */ r(dn, { ...
|
|
7699
|
+
return /* @__PURE__ */ r(dn, { ...U });
|
|
7722
7700
|
case se.IdentitySdk:
|
|
7723
|
-
return /* @__PURE__ */ r(Sn, { ...
|
|
7701
|
+
return /* @__PURE__ */ r(Sn, { ...U });
|
|
7724
7702
|
case se.RiskScoring:
|
|
7725
|
-
return /* @__PURE__ */ r(fn, { ...
|
|
7703
|
+
return /* @__PURE__ */ r(fn, { ...U });
|
|
7726
7704
|
case se.AdditionalData:
|
|
7727
7705
|
case se.InvestorCategorization:
|
|
7728
|
-
return /* @__PURE__ */ r(xn, { ...
|
|
7706
|
+
return /* @__PURE__ */ r(xn, { ...U });
|
|
7729
7707
|
case se.AppropriatenessTest:
|
|
7730
|
-
return /* @__PURE__ */ r(vn, { ...
|
|
7708
|
+
return /* @__PURE__ */ r(vn, { ...U });
|
|
7731
7709
|
case se.ManualReview:
|
|
7732
7710
|
return /* @__PURE__ */ r(
|
|
7733
|
-
|
|
7711
|
+
Rt,
|
|
7734
7712
|
{
|
|
7735
7713
|
kycStatus: l.kycStatus,
|
|
7736
7714
|
reviewStatus: l.reviewStatus,
|
|
@@ -7753,16 +7731,100 @@ const Wn = ({
|
|
|
7753
7731
|
}
|
|
7754
7732
|
};
|
|
7755
7733
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
7756
|
-
|
|
7757
|
-
|
|
7734
|
+
M(),
|
|
7735
|
+
q()
|
|
7758
7736
|
] });
|
|
7759
|
-
}
|
|
7760
|
-
|
|
7737
|
+
}, Nn = be.forwardRef(
|
|
7738
|
+
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: n }, a) => {
|
|
7739
|
+
const s = be.useRef(null), l = be.useRef(null);
|
|
7740
|
+
return be.useImperativeHandle(a, () => s.current), be.useEffect(() => {
|
|
7741
|
+
if (l.current && s.current) {
|
|
7742
|
+
const c = s.current, u = l.current, y = u.offsetLeft - c.offsetWidth / 2 + u.offsetWidth / 2;
|
|
7743
|
+
c.scrollTo({ left: Math.max(0, y), behavior: "smooth" });
|
|
7744
|
+
}
|
|
7745
|
+
}, [t]), /* @__PURE__ */ r(
|
|
7746
|
+
"div",
|
|
7747
|
+
{
|
|
7748
|
+
ref: s,
|
|
7749
|
+
className: "metakyc-stepper-scroll",
|
|
7750
|
+
style: {
|
|
7751
|
+
display: "flex",
|
|
7752
|
+
alignItems: "center",
|
|
7753
|
+
overflowX: "auto",
|
|
7754
|
+
overflowY: "hidden",
|
|
7755
|
+
scrollbarWidth: "none",
|
|
7756
|
+
msOverflowStyle: "none",
|
|
7757
|
+
WebkitOverflowScrolling: "touch",
|
|
7758
|
+
padding: "4px 0",
|
|
7759
|
+
gap: "0"
|
|
7760
|
+
},
|
|
7761
|
+
children: e.map((c, u) => {
|
|
7762
|
+
const y = u < t, m = u === t, N = y || m, T = c.displayName || c.name || n(c.action) || `Step ${u + 1}`;
|
|
7763
|
+
return /* @__PURE__ */ i(be.Fragment, { children: [
|
|
7764
|
+
/* @__PURE__ */ i(
|
|
7765
|
+
"div",
|
|
7766
|
+
{
|
|
7767
|
+
ref: m ? l : void 0,
|
|
7768
|
+
style: {
|
|
7769
|
+
display: "flex",
|
|
7770
|
+
alignItems: "center",
|
|
7771
|
+
flexShrink: 0
|
|
7772
|
+
},
|
|
7773
|
+
children: [
|
|
7774
|
+
/* @__PURE__ */ r("div", { style: {
|
|
7775
|
+
width: "28px",
|
|
7776
|
+
height: "28px",
|
|
7777
|
+
borderRadius: "50%",
|
|
7778
|
+
display: "flex",
|
|
7779
|
+
alignItems: "center",
|
|
7780
|
+
justifyContent: "center",
|
|
7781
|
+
fontSize: "12px",
|
|
7782
|
+
fontWeight: 600,
|
|
7783
|
+
flexShrink: 0,
|
|
7784
|
+
transition: "all 0.2s ease",
|
|
7785
|
+
...N ? {
|
|
7786
|
+
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
7787
|
+
color: "#ffffff",
|
|
7788
|
+
border: "none"
|
|
7789
|
+
} : {
|
|
7790
|
+
backgroundColor: "transparent",
|
|
7791
|
+
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
7792
|
+
border: "2px solid var(--metakyc-border, #e5e7eb)"
|
|
7793
|
+
}
|
|
7794
|
+
}, children: y ? /* @__PURE__ */ r("svg", { width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : u + 1 }),
|
|
7795
|
+
/* @__PURE__ */ r("span", { style: {
|
|
7796
|
+
marginLeft: "6px",
|
|
7797
|
+
fontSize: "13px",
|
|
7798
|
+
whiteSpace: "nowrap",
|
|
7799
|
+
fontWeight: m ? 600 : 400,
|
|
7800
|
+
color: m ? "var(--metakyc-text-primary, #111827)" : y ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
7801
|
+
transition: "color 0.2s ease"
|
|
7802
|
+
}, children: T })
|
|
7803
|
+
]
|
|
7804
|
+
}
|
|
7805
|
+
),
|
|
7806
|
+
u < e.length - 1 && /* @__PURE__ */ r("div", { style: {
|
|
7807
|
+
width: "32px",
|
|
7808
|
+
minWidth: "16px",
|
|
7809
|
+
height: "2px",
|
|
7810
|
+
margin: "0 8px",
|
|
7811
|
+
flexShrink: 0,
|
|
7812
|
+
borderRadius: "999px",
|
|
7813
|
+
backgroundColor: y ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
|
|
7814
|
+
transition: "background-color 0.2s ease"
|
|
7815
|
+
} })
|
|
7816
|
+
] }, c.order);
|
|
7817
|
+
})
|
|
7818
|
+
}
|
|
7819
|
+
);
|
|
7820
|
+
}
|
|
7821
|
+
);
|
|
7822
|
+
function Yn(e) {
|
|
7761
7823
|
return _e.object({
|
|
7762
7824
|
questionResults: _e.any()
|
|
7763
7825
|
}).passthrough();
|
|
7764
7826
|
}
|
|
7765
|
-
function
|
|
7827
|
+
function Rn(e) {
|
|
7766
7828
|
let t = _e.array(_e.instanceof(File));
|
|
7767
7829
|
if (e.isRequired ? t = t.min(
|
|
7768
7830
|
1,
|
|
@@ -7784,27 +7846,27 @@ function Nn(e) {
|
|
|
7784
7846
|
}
|
|
7785
7847
|
return t;
|
|
7786
7848
|
}
|
|
7787
|
-
function
|
|
7849
|
+
function Vn(e) {
|
|
7788
7850
|
const t = {};
|
|
7789
7851
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
7790
7852
|
const a = `file_${n.id}`;
|
|
7791
|
-
t[a] =
|
|
7853
|
+
t[a] = Rn(n);
|
|
7792
7854
|
}), _e.object(t);
|
|
7793
7855
|
}
|
|
7794
|
-
function
|
|
7856
|
+
function Qn(e) {
|
|
7795
7857
|
return _e.any();
|
|
7796
7858
|
}
|
|
7797
7859
|
function In(e) {
|
|
7798
7860
|
return _e.string().min(1, "This question is required");
|
|
7799
7861
|
}
|
|
7800
|
-
function
|
|
7862
|
+
function Gn(e) {
|
|
7801
7863
|
const t = {};
|
|
7802
7864
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
7803
7865
|
const a = `question_${n.id}`;
|
|
7804
7866
|
t[a] = In();
|
|
7805
7867
|
}), _e.object(t);
|
|
7806
7868
|
}
|
|
7807
|
-
const
|
|
7869
|
+
const Jn = _e.any();
|
|
7808
7870
|
export {
|
|
7809
7871
|
kt as ALLOWED_LANGUAGES,
|
|
7810
7872
|
Kt as ApplicantProgressOnHoldReason,
|
|
@@ -7816,15 +7878,15 @@ export {
|
|
|
7816
7878
|
vn as AppropriatenessTestStep,
|
|
7817
7879
|
Lt as Badge,
|
|
7818
7880
|
yr as BaseInformationService,
|
|
7819
|
-
|
|
7881
|
+
G as Button,
|
|
7820
7882
|
Xe as COMPANY_FIELD_METADATA,
|
|
7821
7883
|
X as Card,
|
|
7822
7884
|
ee as CardContent,
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7885
|
+
ve as CardFooter,
|
|
7886
|
+
xe as CardHeader,
|
|
7887
|
+
We as CountriesType,
|
|
7826
7888
|
Un as CreateApplicantForm,
|
|
7827
|
-
|
|
7889
|
+
Kn as CreateCompanyApplicantForm,
|
|
7828
7890
|
er as CriteriaBuiltInType,
|
|
7829
7891
|
rr as DEFAULT_COMPANY_VISIBLE_FIELDS,
|
|
7830
7892
|
nr as DEFAULT_VISIBLE_FIELDS,
|
|
@@ -7845,16 +7907,16 @@ export {
|
|
|
7845
7907
|
fe as Input,
|
|
7846
7908
|
hr as InvestorCategorizationService,
|
|
7847
7909
|
xn as InvestorCategorizationStep,
|
|
7848
|
-
|
|
7910
|
+
Ne as InvestorCategorizationType,
|
|
7849
7911
|
tr as InvestorCategoryType,
|
|
7850
7912
|
Vt as KycProcessStatus,
|
|
7851
7913
|
Ye as KycStatus,
|
|
7852
|
-
|
|
7853
|
-
|
|
7914
|
+
Rt as KycStatusDisplay,
|
|
7915
|
+
qn as KycWorkflow,
|
|
7854
7916
|
Cn as Logo,
|
|
7855
7917
|
At as MetaKYCContext,
|
|
7856
7918
|
Oe as MetaKYCError,
|
|
7857
|
-
|
|
7919
|
+
On as MetaKYCProvider,
|
|
7858
7920
|
qr as MultiSelect,
|
|
7859
7921
|
Er as OnfidoProvider,
|
|
7860
7922
|
ur as OverviewService,
|
|
@@ -7868,60 +7930,60 @@ export {
|
|
|
7868
7930
|
pr as RiskScoringService,
|
|
7869
7931
|
fn as RiskScoringStep,
|
|
7870
7932
|
Fr as SardinAIProvider,
|
|
7871
|
-
|
|
7933
|
+
$e as SearchableSelect,
|
|
7872
7934
|
bt as Select,
|
|
7873
7935
|
Pe as Spinner,
|
|
7874
7936
|
Nr as StepRouter,
|
|
7875
|
-
|
|
7937
|
+
Ir as SumsubProvider,
|
|
7876
7938
|
Pr as ThemeManager,
|
|
7877
|
-
|
|
7939
|
+
Re as ThemePreset,
|
|
7878
7940
|
wr as ThemeService,
|
|
7879
7941
|
cr as UploadDocumentService,
|
|
7880
7942
|
cn as UploadDocumentStep,
|
|
7881
7943
|
Qt as UserType,
|
|
7882
|
-
|
|
7883
|
-
|
|
7944
|
+
Be as ValueDataType,
|
|
7945
|
+
Rr as WorkflowOrchestrator,
|
|
7884
7946
|
ut as WorkflowResultType,
|
|
7885
7947
|
Cr as WorkflowState,
|
|
7886
7948
|
se as WorkflowStepAction,
|
|
7887
|
-
|
|
7888
|
-
|
|
7949
|
+
Jn as appropriatenessTestSchema,
|
|
7950
|
+
Hn as clearAllStorage,
|
|
7889
7951
|
Mr as clearApplicantId,
|
|
7890
7952
|
Or as clearWorkflowState,
|
|
7891
7953
|
Ie as cn,
|
|
7892
7954
|
gr as corporateTheme,
|
|
7893
7955
|
ar as defaultConfig,
|
|
7894
|
-
|
|
7956
|
+
Fe as defaultTheme,
|
|
7895
7957
|
Lr as fileToBase64,
|
|
7896
7958
|
fr as fintechTheme,
|
|
7897
7959
|
mt as formatFileSize,
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7960
|
+
Gn as generateAppropriatenessSchema,
|
|
7961
|
+
Yn as generateQuestionnaireSchema,
|
|
7962
|
+
Qn as generateRiskScoringSchema,
|
|
7963
|
+
Vn as generateUploadDocumentSchema,
|
|
7964
|
+
_n as getAcceptString,
|
|
7903
7965
|
Dr as getApplicantId,
|
|
7904
7966
|
it as getThemePreset,
|
|
7905
|
-
|
|
7967
|
+
jn as getWorkflowState,
|
|
7906
7968
|
br as healthcareTheme,
|
|
7907
|
-
|
|
7969
|
+
Mn as isScriptLoaded,
|
|
7908
7970
|
Ft as loadScript,
|
|
7909
7971
|
vr as minimalTheme,
|
|
7910
7972
|
xr as modernTheme,
|
|
7911
|
-
|
|
7973
|
+
zn as removeScript,
|
|
7912
7974
|
Tr as saveApplicantId,
|
|
7913
7975
|
zr as saveWorkflowState,
|
|
7914
7976
|
kr as themePresets,
|
|
7915
7977
|
Pt as useApplicant,
|
|
7916
|
-
|
|
7978
|
+
Wn as useAppropriatenessTest,
|
|
7917
7979
|
Hr as useIdentityVerification,
|
|
7918
|
-
|
|
7919
|
-
|
|
7980
|
+
Br as useKycWorkflow,
|
|
7981
|
+
Ee as useMetaKYC,
|
|
7920
7982
|
jr as useOverview,
|
|
7921
|
-
|
|
7922
|
-
|
|
7983
|
+
$r as useQuestionnaire,
|
|
7984
|
+
Wr as useRiskScoring,
|
|
7923
7985
|
_r as useUploadDocument,
|
|
7924
|
-
|
|
7986
|
+
Bn as validateFileSize,
|
|
7925
7987
|
$n as validateFileType
|
|
7926
7988
|
};
|
|
7927
7989
|
//# sourceMappingURL=index.js.map
|