@vpdev2/metakyc-sdk 1.0.95 → 1.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/steps/UploadDocumentStep.d.ts.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +510 -480
- package/dist/index.js.map +1 -1
- package/dist/types/upload-document.d.ts +1 -0
- package/dist/types/upload-document.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var Mt = Object.defineProperty;
|
|
2
2
|
var Ot = (e, t, n) => t in e ? Mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var pe = (e, t, n) => Ot(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import
|
|
4
|
+
import zt from "axios";
|
|
5
5
|
import * as xt from "react";
|
|
6
|
-
import Ae, { createContext as
|
|
6
|
+
import Ae, { createContext as $t, useState as w, useMemo as Re, useEffect as ye, useContext as Bt, useRef as ce, useCallback as ee, forwardRef as ct, createElement as ht } from "react";
|
|
7
7
|
import { jsx as r, jsxs as i, Fragment as ot } from "react/jsx-runtime";
|
|
8
8
|
import _t, { createPortal as gt } from "react-dom";
|
|
9
9
|
import { useForm as jt, Controller as Ye } 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 || {}), Ht = /* @__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))(Ht || {}), Ut = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Ut || {}), Ve = /* @__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))(Ve || {}), Qe = /* @__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))(Qe || {}), Kt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Kt || {}), Wt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Wt || {}), 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 || {}), mt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(mt || {}), Yt = /* @__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))(Yt || {}), Vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Vt || {}), Qt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Qt || {}),
|
|
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 || {}), Ht = /* @__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))(Ht || {}), Ut = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Ut || {}), Ve = /* @__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))(Ve || {}), Qe = /* @__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))(Qe || {}), Kt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Kt || {}), Wt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Wt || {}), 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 || {}), mt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(mt || {}), Yt = /* @__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))(Yt || {}), Vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Vt || {}), Qt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Qt || {}), $e = /* @__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))($e || {}), Gt = /* @__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))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Jt || {}), Se = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Se || {}), Zt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Zt || {});
|
|
12
12
|
const Ue = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -137,11 +137,11 @@ class rr {
|
|
|
137
137
|
}[t] || t;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
class
|
|
140
|
+
class ze extends Error {
|
|
141
141
|
constructor(n, a, s, l, d) {
|
|
142
142
|
super(n);
|
|
143
143
|
pe(this, "response");
|
|
144
|
-
this.code = a, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = d, Object.setPrototypeOf(this,
|
|
144
|
+
this.code = a, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = d, Object.setPrototypeOf(this, ze.prototype);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
class at {
|
|
@@ -149,7 +149,7 @@ class at {
|
|
|
149
149
|
* Process an error from the API response
|
|
150
150
|
*/
|
|
151
151
|
static handleApiError(t) {
|
|
152
|
-
return new
|
|
152
|
+
return new ze(
|
|
153
153
|
t.message || "An unknown error occurred",
|
|
154
154
|
t.code,
|
|
155
155
|
t.details || void 0,
|
|
@@ -162,36 +162,36 @@ class at {
|
|
|
162
162
|
static handleAxiosError(t) {
|
|
163
163
|
if (t.response) {
|
|
164
164
|
const n = t.response.data;
|
|
165
|
-
return n && n.error ? new
|
|
165
|
+
return n && n.error ? new ze(
|
|
166
166
|
n.error.message || "An unknown error occurred",
|
|
167
167
|
n.error.code,
|
|
168
168
|
n.error.details || void 0,
|
|
169
169
|
n.error.validationErrors || void 0,
|
|
170
170
|
t.response
|
|
171
|
-
) : n && n.result && n.result.message ? new
|
|
171
|
+
) : n && n.result && n.result.message ? new ze(
|
|
172
172
|
n.result.message,
|
|
173
173
|
t.response.status,
|
|
174
174
|
`HTTP ${t.response.status}: ${t.response.statusText}`,
|
|
175
175
|
void 0,
|
|
176
176
|
t.response
|
|
177
|
-
) : new
|
|
177
|
+
) : new ze(
|
|
178
178
|
(n == null ? void 0 : n.message) || t.message || "Request failed",
|
|
179
179
|
t.response.status,
|
|
180
180
|
`HTTP ${t.response.status}: ${t.response.statusText}`,
|
|
181
181
|
void 0,
|
|
182
182
|
t.response
|
|
183
183
|
);
|
|
184
|
-
} else return t.request ? new
|
|
184
|
+
} else return t.request ? new ze(
|
|
185
185
|
"No response from server",
|
|
186
186
|
0,
|
|
187
187
|
"The request was made but no response was received. Please check your network connection."
|
|
188
|
-
) : new
|
|
188
|
+
) : new ze(t.message || "An unexpected error occurred", 0, t.toString());
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
191
191
|
* Check if an error is a MetaKYCError
|
|
192
192
|
*/
|
|
193
193
|
static isMetaKYCError(t) {
|
|
194
|
-
return t instanceof
|
|
194
|
+
return t instanceof ze;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
class nr {
|
|
@@ -199,7 +199,7 @@ class nr {
|
|
|
199
199
|
pe(this, "axiosInstance");
|
|
200
200
|
pe(this, "endpointBuilder");
|
|
201
201
|
pe(this, "config");
|
|
202
|
-
this.config = { ...tr, ...t }, this.endpointBuilder = new rr(this.config.endpoints), this.axiosInstance =
|
|
202
|
+
this.config = { ...tr, ...t }, this.endpointBuilder = new rr(this.config.endpoints), this.axiosInstance = zt.create({
|
|
203
203
|
baseURL: this.config.baseUrl,
|
|
204
204
|
timeout: this.config.timeout,
|
|
205
205
|
headers: {
|
|
@@ -1894,22 +1894,22 @@ class Er {
|
|
|
1894
1894
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1895
1895
|
}
|
|
1896
1896
|
}
|
|
1897
|
-
const Et =
|
|
1897
|
+
const Et = $t(null), An = ({ config: e, children: t }) => {
|
|
1898
1898
|
const [n, a] = w(null), s = Ae.useRef(!1), l = Ae.useRef(!1), d = Re(() => {
|
|
1899
|
-
const y = new nr(e), p = new ar(y), S = new ir(y), T = new sr(y),
|
|
1899
|
+
const y = new nr(e), p = new ar(y), S = new ir(y), T = new sr(y), F = new or(y), P = new lr(y), f = new cr(y), v = new dr(y), C = new ur(y), U = new mr(y), H = new xr(y), D = new Er();
|
|
1900
1900
|
return {
|
|
1901
1901
|
httpClient: y,
|
|
1902
1902
|
applicantService: p,
|
|
1903
1903
|
questionnaireService: S,
|
|
1904
1904
|
uploadDocumentService: T,
|
|
1905
|
-
appropriatenessTestService:
|
|
1905
|
+
appropriatenessTestService: F,
|
|
1906
1906
|
overviewService: P,
|
|
1907
1907
|
riskScoringService: f,
|
|
1908
1908
|
identityService: v,
|
|
1909
|
-
baseInformationService:
|
|
1909
|
+
baseInformationService: C,
|
|
1910
1910
|
investorCategorizationService: U,
|
|
1911
1911
|
themeService: H,
|
|
1912
|
-
themeManager:
|
|
1912
|
+
themeManager: D
|
|
1913
1913
|
};
|
|
1914
1914
|
}, [e]), m = Re(() => ({
|
|
1915
1915
|
config: e,
|
|
@@ -2043,17 +2043,17 @@ function Mr(e) {
|
|
|
2043
2043
|
ye(() => {
|
|
2044
2044
|
y.current || (y.current = t());
|
|
2045
2045
|
}, [t]), ye(() => {
|
|
2046
|
-
var
|
|
2046
|
+
var D;
|
|
2047
2047
|
n && p && (Ar(p), Tr({
|
|
2048
2048
|
applicantId: p,
|
|
2049
|
-
currentStepOrder: (
|
|
2049
|
+
currentStepOrder: (D = n.currentStep) == null ? void 0 : D.order,
|
|
2050
2050
|
status: n.status,
|
|
2051
2051
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2052
2052
|
workflowKey: n.workFlowKey,
|
|
2053
2053
|
nextWorkflowKey: n.nextWorkflowKey
|
|
2054
2054
|
}));
|
|
2055
2055
|
}, [n, p]);
|
|
2056
|
-
const S = ce(!1), T = ce(!1),
|
|
2056
|
+
const S = ce(!1), T = ce(!1), F = ee(async () => {
|
|
2057
2057
|
if (!(!p || !y.current)) {
|
|
2058
2058
|
if (S.current) {
|
|
2059
2059
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
@@ -2061,18 +2061,18 @@ function Mr(e) {
|
|
|
2061
2061
|
}
|
|
2062
2062
|
S.current = !0, l(!0), m(null);
|
|
2063
2063
|
try {
|
|
2064
|
-
const
|
|
2065
|
-
a(
|
|
2066
|
-
} catch (
|
|
2067
|
-
m(
|
|
2064
|
+
const D = await y.current.initialize(p);
|
|
2065
|
+
a(D), T.current = !0;
|
|
2066
|
+
} catch (D) {
|
|
2067
|
+
m(D);
|
|
2068
2068
|
} finally {
|
|
2069
2069
|
l(!1), S.current = !1;
|
|
2070
2070
|
}
|
|
2071
2071
|
}
|
|
2072
2072
|
}, [p]);
|
|
2073
2073
|
ye(() => {
|
|
2074
|
-
p && !T.current &&
|
|
2075
|
-
}, [p,
|
|
2074
|
+
p && !T.current && F();
|
|
2075
|
+
}, [p, F]);
|
|
2076
2076
|
const P = ee(async () => {
|
|
2077
2077
|
if (y.current) {
|
|
2078
2078
|
if (S.current) {
|
|
@@ -2081,10 +2081,10 @@ function Mr(e) {
|
|
|
2081
2081
|
}
|
|
2082
2082
|
S.current = !0, l(!0), m(null);
|
|
2083
2083
|
try {
|
|
2084
|
-
const
|
|
2085
|
-
a(
|
|
2086
|
-
} catch (
|
|
2087
|
-
m(
|
|
2084
|
+
const D = await y.current.refreshProgress();
|
|
2085
|
+
a(D);
|
|
2086
|
+
} catch (D) {
|
|
2087
|
+
m(D);
|
|
2088
2088
|
} finally {
|
|
2089
2089
|
l(!1), S.current = !1;
|
|
2090
2090
|
}
|
|
@@ -2093,10 +2093,10 @@ function Mr(e) {
|
|
|
2093
2093
|
if (y.current) {
|
|
2094
2094
|
l(!0), m(null);
|
|
2095
2095
|
try {
|
|
2096
|
-
const
|
|
2097
|
-
a(
|
|
2098
|
-
} catch (
|
|
2099
|
-
m(
|
|
2096
|
+
const D = await y.current.moveToNextStep();
|
|
2097
|
+
a(D);
|
|
2098
|
+
} catch (D) {
|
|
2099
|
+
m(D);
|
|
2100
2100
|
} finally {
|
|
2101
2101
|
l(!1);
|
|
2102
2102
|
}
|
|
@@ -2105,19 +2105,19 @@ function Mr(e) {
|
|
|
2105
2105
|
if (y.current) {
|
|
2106
2106
|
l(!0), m(null);
|
|
2107
2107
|
try {
|
|
2108
|
-
const
|
|
2109
|
-
a(
|
|
2110
|
-
} catch (
|
|
2111
|
-
m(
|
|
2108
|
+
const D = await y.current.moveToPreviousStep();
|
|
2109
|
+
a(D);
|
|
2110
|
+
} catch (D) {
|
|
2111
|
+
m(D);
|
|
2112
2112
|
} finally {
|
|
2113
2113
|
l(!1);
|
|
2114
2114
|
}
|
|
2115
2115
|
}
|
|
2116
|
-
}, []),
|
|
2116
|
+
}, []), C = ee(async (D) => {
|
|
2117
2117
|
if (y.current) {
|
|
2118
2118
|
l(!0), m(null);
|
|
2119
2119
|
try {
|
|
2120
|
-
await y.current.submitCurrentStep(
|
|
2120
|
+
await y.current.submitCurrentStep(D);
|
|
2121
2121
|
const B = await y.current.refreshProgress();
|
|
2122
2122
|
a(B);
|
|
2123
2123
|
} catch (B) {
|
|
@@ -2126,7 +2126,7 @@ function Mr(e) {
|
|
|
2126
2126
|
l(!1);
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
|
-
}, []), U = xt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((
|
|
2129
|
+
}, []), U = xt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((D, B) => D.order - B.order) : [], [n == null ? void 0 : n.stepInfoList]), H = xt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2130
2130
|
return {
|
|
2131
2131
|
progress: n,
|
|
2132
2132
|
applicantId: p,
|
|
@@ -2144,38 +2144,38 @@ function Mr(e) {
|
|
|
2144
2144
|
refreshProgress: P,
|
|
2145
2145
|
moveToNext: f,
|
|
2146
2146
|
moveBack: v,
|
|
2147
|
-
submitCurrentStep:
|
|
2147
|
+
submitCurrentStep: C,
|
|
2148
2148
|
orchestrator: y.current
|
|
2149
2149
|
};
|
|
2150
2150
|
}
|
|
2151
2151
|
function Or(e) {
|
|
2152
|
-
const { questionnaireService: t, applicantService: n } = Fe(), [a, s] = w(null), [l, d] = w({}), [m, y] = w(!1), [p, S] = w(!1), [T,
|
|
2152
|
+
const { questionnaireService: t, applicantService: n } = Fe(), [a, s] = w(null), [l, d] = w({}), [m, y] = w(!1), [p, S] = w(!1), [T, F] = w(null), P = ce(!1), f = ce(null), v = ee(async () => {
|
|
2153
2153
|
var U, H;
|
|
2154
2154
|
if (e) {
|
|
2155
2155
|
if (P.current) {
|
|
2156
2156
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
2157
2157
|
return;
|
|
2158
2158
|
}
|
|
2159
|
-
P.current = !0, y(!0),
|
|
2159
|
+
P.current = !0, y(!0), F(null);
|
|
2160
2160
|
try {
|
|
2161
|
-
const [
|
|
2161
|
+
const [D, B] = await Promise.all([
|
|
2162
2162
|
t.getQuestionnaire(e),
|
|
2163
2163
|
n.getApplicantData(e).catch(() => null)
|
|
2164
2164
|
]);
|
|
2165
|
-
if (s(
|
|
2165
|
+
if (s(D), (U = B == null ? void 0 : B.questionnaireResults) != null && U.length && D) {
|
|
2166
2166
|
const V = /* @__PURE__ */ new Map();
|
|
2167
2167
|
for (const A of B.questionnaireResults)
|
|
2168
2168
|
A.question && ((H = A.answers) != null && H.length) && V.set(A.question.trim().toLowerCase(), A.answers);
|
|
2169
|
-
const ne = {},
|
|
2170
|
-
for (const A of
|
|
2169
|
+
const ne = {}, E = D.questionGroups.flatMap((A) => A.questions ?? []);
|
|
2170
|
+
for (const A of E) {
|
|
2171
2171
|
const W = A.text.trim().toLowerCase();
|
|
2172
2172
|
V.has(W) && (ne[A.id] = V.get(W));
|
|
2173
2173
|
}
|
|
2174
2174
|
d(ne);
|
|
2175
2175
|
}
|
|
2176
2176
|
f.current = e;
|
|
2177
|
-
} catch (
|
|
2178
|
-
|
|
2177
|
+
} catch (D) {
|
|
2178
|
+
F(D);
|
|
2179
2179
|
} finally {
|
|
2180
2180
|
y(!1), P.current = !1;
|
|
2181
2181
|
}
|
|
@@ -2184,13 +2184,13 @@ function Or(e) {
|
|
|
2184
2184
|
ye(() => {
|
|
2185
2185
|
e && f.current !== e && v();
|
|
2186
2186
|
}, [e]);
|
|
2187
|
-
const
|
|
2187
|
+
const C = ee(
|
|
2188
2188
|
async (U) => {
|
|
2189
|
-
S(!0),
|
|
2189
|
+
S(!0), F(null);
|
|
2190
2190
|
try {
|
|
2191
2191
|
return await t.fillQuestionnaire(U);
|
|
2192
2192
|
} catch (H) {
|
|
2193
|
-
throw
|
|
2193
|
+
throw F(H), H;
|
|
2194
2194
|
} finally {
|
|
2195
2195
|
S(!1);
|
|
2196
2196
|
}
|
|
@@ -2204,24 +2204,24 @@ function Or(e) {
|
|
|
2204
2204
|
isSubmitting: p,
|
|
2205
2205
|
error: T,
|
|
2206
2206
|
load: v,
|
|
2207
|
-
submit:
|
|
2207
|
+
submit: C
|
|
2208
2208
|
};
|
|
2209
2209
|
}
|
|
2210
|
-
function
|
|
2211
|
-
const { uploadDocumentService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(0), [S, T] = w(null),
|
|
2210
|
+
function zr(e) {
|
|
2211
|
+
const { uploadDocumentService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(0), [S, T] = w(null), F = ce(!1), P = ce(null), f = ee(async () => {
|
|
2212
2212
|
if (e) {
|
|
2213
|
-
if (
|
|
2213
|
+
if (F.current) {
|
|
2214
2214
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2215
2215
|
return;
|
|
2216
2216
|
}
|
|
2217
|
-
|
|
2217
|
+
F.current = !0, l(!0), T(null);
|
|
2218
2218
|
try {
|
|
2219
|
-
const
|
|
2220
|
-
a(
|
|
2221
|
-
} catch (
|
|
2222
|
-
T(
|
|
2219
|
+
const C = await t.getUploadDocument(e);
|
|
2220
|
+
a(C), P.current = e;
|
|
2221
|
+
} catch (C) {
|
|
2222
|
+
T(C);
|
|
2223
2223
|
} finally {
|
|
2224
|
-
l(!1),
|
|
2224
|
+
l(!1), F.current = !1;
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
2227
|
}, [e, t]);
|
|
@@ -2229,10 +2229,10 @@ function $r(e) {
|
|
|
2229
2229
|
e && P.current !== e && f();
|
|
2230
2230
|
}, [e]);
|
|
2231
2231
|
const v = ee(
|
|
2232
|
-
async (
|
|
2232
|
+
async (C) => {
|
|
2233
2233
|
m(!0), p(0), T(null);
|
|
2234
2234
|
try {
|
|
2235
|
-
await t.fillUploadDocument(
|
|
2235
|
+
await t.fillUploadDocument(C), p(100);
|
|
2236
2236
|
} catch (U) {
|
|
2237
2237
|
throw T(U), U;
|
|
2238
2238
|
} finally {
|
|
@@ -2252,20 +2252,20 @@ function $r(e) {
|
|
|
2252
2252
|
};
|
|
2253
2253
|
}
|
|
2254
2254
|
function On(e) {
|
|
2255
|
-
const { appropriatenessTestService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(null), [S, T] = w(null),
|
|
2255
|
+
const { appropriatenessTestService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(null), [S, T] = w(null), F = ce(!1), P = ce(null), f = ee(async () => {
|
|
2256
2256
|
if (e) {
|
|
2257
|
-
if (
|
|
2257
|
+
if (F.current) {
|
|
2258
2258
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2259
2259
|
return;
|
|
2260
2260
|
}
|
|
2261
|
-
|
|
2261
|
+
F.current = !0, l(!0), p(null);
|
|
2262
2262
|
try {
|
|
2263
|
-
const
|
|
2264
|
-
a(
|
|
2265
|
-
} catch (
|
|
2266
|
-
p(
|
|
2263
|
+
const C = await t.getAppropriatenessTest(e);
|
|
2264
|
+
a(C), P.current = e;
|
|
2265
|
+
} catch (C) {
|
|
2266
|
+
p(C);
|
|
2267
2267
|
} finally {
|
|
2268
|
-
l(!1),
|
|
2268
|
+
l(!1), F.current = !1;
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
2271
|
}, [e, t]);
|
|
@@ -2273,10 +2273,10 @@ function On(e) {
|
|
|
2273
2273
|
e && P.current !== e && f();
|
|
2274
2274
|
}, [e]);
|
|
2275
2275
|
const v = ee(
|
|
2276
|
-
async (
|
|
2276
|
+
async (C) => {
|
|
2277
2277
|
m(!0), p(null);
|
|
2278
2278
|
try {
|
|
2279
|
-
const U = await t.fillAppropriatenessTest(
|
|
2279
|
+
const U = await t.fillAppropriatenessTest(C);
|
|
2280
2280
|
return T(U), U;
|
|
2281
2281
|
} catch (U) {
|
|
2282
2282
|
throw p(U), U;
|
|
@@ -2296,8 +2296,8 @@ function On(e) {
|
|
|
2296
2296
|
submit: v
|
|
2297
2297
|
};
|
|
2298
2298
|
}
|
|
2299
|
-
function
|
|
2300
|
-
const { overviewService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(null), S = ce(!1), T = ce(null),
|
|
2299
|
+
function $r(e) {
|
|
2300
|
+
const { overviewService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(null), S = ce(!1), T = ce(null), F = ee(async () => {
|
|
2301
2301
|
if (e) {
|
|
2302
2302
|
if (S.current) {
|
|
2303
2303
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2315,7 +2315,7 @@ function zr(e) {
|
|
|
2315
2315
|
}
|
|
2316
2316
|
}, [e, t]);
|
|
2317
2317
|
ye(() => {
|
|
2318
|
-
e && T.current !== e &&
|
|
2318
|
+
e && T.current !== e && F();
|
|
2319
2319
|
}, [e]);
|
|
2320
2320
|
const P = ee(async () => {
|
|
2321
2321
|
if (e) {
|
|
@@ -2334,7 +2334,7 @@ function zr(e) {
|
|
|
2334
2334
|
isLoading: s,
|
|
2335
2335
|
isSubmitting: d,
|
|
2336
2336
|
error: y,
|
|
2337
|
-
load:
|
|
2337
|
+
load: F,
|
|
2338
2338
|
passOverview: P
|
|
2339
2339
|
};
|
|
2340
2340
|
}
|
|
@@ -2342,7 +2342,7 @@ function Br(e) {
|
|
|
2342
2342
|
const { identityService: t } = Fe(), [n, a] = w(
|
|
2343
2343
|
null
|
|
2344
2344
|
), [s, l] = w(!1), [d, m] = w(null), y = ce(!1), p = ee(
|
|
2345
|
-
async (
|
|
2345
|
+
async (F, P) => {
|
|
2346
2346
|
if (e) {
|
|
2347
2347
|
if (y.current) {
|
|
2348
2348
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -2353,7 +2353,7 @@ function Br(e) {
|
|
|
2353
2353
|
const f = {
|
|
2354
2354
|
applicantId: e,
|
|
2355
2355
|
restart: !1,
|
|
2356
|
-
redirectUrl:
|
|
2356
|
+
redirectUrl: F || "",
|
|
2357
2357
|
ttl: P || 604800
|
|
2358
2358
|
// Default: 7 days
|
|
2359
2359
|
};
|
|
@@ -2369,14 +2369,14 @@ function Br(e) {
|
|
|
2369
2369
|
},
|
|
2370
2370
|
[e, t]
|
|
2371
2371
|
), S = ee(
|
|
2372
|
-
async (
|
|
2372
|
+
async (F, P) => {
|
|
2373
2373
|
if (e) {
|
|
2374
2374
|
l(!0), m(null);
|
|
2375
2375
|
try {
|
|
2376
2376
|
const f = {
|
|
2377
2377
|
applicantId: e,
|
|
2378
2378
|
restart: !1,
|
|
2379
|
-
redirectUrl:
|
|
2379
|
+
redirectUrl: F,
|
|
2380
2380
|
ttl: P
|
|
2381
2381
|
}, v = await t.identityCompanyRequest(f);
|
|
2382
2382
|
return a(v), v;
|
|
@@ -2396,18 +2396,18 @@ function Br(e) {
|
|
|
2396
2396
|
}
|
|
2397
2397
|
y.current = !0, l(!0), m(null);
|
|
2398
2398
|
try {
|
|
2399
|
-
const
|
|
2399
|
+
const F = {
|
|
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 P = await t.identityRequest(
|
|
2406
|
+
console.log("Restarting identity with input:", F);
|
|
2407
|
+
const P = await t.identityRequest(F);
|
|
2408
2408
|
return console.log("Restart identity result:", P), a(P), P;
|
|
2409
|
-
} catch (
|
|
2410
|
-
throw m(
|
|
2409
|
+
} catch (F) {
|
|
2410
|
+
throw m(F), F;
|
|
2411
2411
|
} finally {
|
|
2412
2412
|
l(!1), y.current = !1;
|
|
2413
2413
|
}
|
|
@@ -2425,49 +2425,49 @@ function Br(e) {
|
|
|
2425
2425
|
};
|
|
2426
2426
|
}
|
|
2427
2427
|
function _r(e) {
|
|
2428
|
-
const { riskScoringService: t, applicantService: n } = Fe(), [a, s] = w(null), [l, d] = w({}), [m, y] = w(!1), [p, S] = w(!1), [T,
|
|
2429
|
-
var
|
|
2428
|
+
const { riskScoringService: t, applicantService: n } = Fe(), [a, s] = w(null), [l, d] = w({}), [m, y] = w(!1), [p, S] = w(!1), [T, F] = w(null), [P, f] = w(null), v = ce(!1), C = ce(null), U = ee(async () => {
|
|
2429
|
+
var D;
|
|
2430
2430
|
if (e) {
|
|
2431
2431
|
if (v.current) {
|
|
2432
2432
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2433
2433
|
return;
|
|
2434
2434
|
}
|
|
2435
|
-
v.current = !0, y(!0),
|
|
2435
|
+
v.current = !0, y(!0), F(null);
|
|
2436
2436
|
try {
|
|
2437
2437
|
const [B, V] = await Promise.all([
|
|
2438
2438
|
t.getRiskCriterias(e),
|
|
2439
2439
|
n.getApplicantData(e).catch(() => null)
|
|
2440
2440
|
]);
|
|
2441
|
-
if (s(B), (
|
|
2442
|
-
const ne = V.riskScoringResults[0],
|
|
2441
|
+
if (s(B), (D = V == null ? void 0 : V.riskScoringResults) != null && D.length) {
|
|
2442
|
+
const ne = V.riskScoringResults[0], E = {};
|
|
2443
2443
|
for (const A of ne.riskCriteriaResults ?? [])
|
|
2444
2444
|
if (A.riskCriteriaId != null && A.answer != null && A.answer !== "") {
|
|
2445
2445
|
const W = [...new Set(
|
|
2446
2446
|
A.answer.split(",").map((K) => K.trim()).filter((K) => K !== "")
|
|
2447
2447
|
)];
|
|
2448
|
-
W.length > 0 && (
|
|
2448
|
+
W.length > 0 && (E[A.riskCriteriaId] = W);
|
|
2449
2449
|
}
|
|
2450
|
-
d(
|
|
2450
|
+
d(E);
|
|
2451
2451
|
}
|
|
2452
|
-
|
|
2452
|
+
C.current = e;
|
|
2453
2453
|
} catch (B) {
|
|
2454
|
-
|
|
2454
|
+
F(B);
|
|
2455
2455
|
} finally {
|
|
2456
2456
|
y(!1), v.current = !1;
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
2459
|
}, [e, t, n]);
|
|
2460
2460
|
ye(() => {
|
|
2461
|
-
e &&
|
|
2461
|
+
e && C.current !== e && U();
|
|
2462
2462
|
}, [e]);
|
|
2463
2463
|
const H = ee(
|
|
2464
|
-
async (
|
|
2465
|
-
S(!0),
|
|
2464
|
+
async (D) => {
|
|
2465
|
+
S(!0), F(null);
|
|
2466
2466
|
try {
|
|
2467
|
-
const B = await t.submitRiskScoring(
|
|
2467
|
+
const B = await t.submitRiskScoring(D);
|
|
2468
2468
|
return f(B), B;
|
|
2469
2469
|
} catch (B) {
|
|
2470
|
-
throw
|
|
2470
|
+
throw F(B), B;
|
|
2471
2471
|
} finally {
|
|
2472
2472
|
S(!1);
|
|
2473
2473
|
}
|
|
@@ -2497,10 +2497,10 @@ function Rt() {
|
|
|
2497
2497
|
d.current = !0, a(!0), l(null);
|
|
2498
2498
|
try {
|
|
2499
2499
|
if (P.applicantAdditionalDatas || (P.applicantAdditionalDatas = []), (f = t.identityProviders) != null && f.sardinai) {
|
|
2500
|
-
const
|
|
2501
|
-
console.log("[SardinAI] Generated session key:",
|
|
2500
|
+
const C = y();
|
|
2501
|
+
console.log("[SardinAI] Generated session key:", C), P.applicantAdditionalDatas.push({
|
|
2502
2502
|
paramName: "sessionKey",
|
|
2503
|
-
value:
|
|
2503
|
+
value: C
|
|
2504
2504
|
});
|
|
2505
2505
|
}
|
|
2506
2506
|
return await e.createApplicant(P);
|
|
@@ -2537,7 +2537,7 @@ function Rt() {
|
|
|
2537
2537
|
}
|
|
2538
2538
|
},
|
|
2539
2539
|
[e]
|
|
2540
|
-
),
|
|
2540
|
+
), F = ee(
|
|
2541
2541
|
async (P) => {
|
|
2542
2542
|
a(!0), l(null);
|
|
2543
2543
|
try {
|
|
@@ -2556,7 +2556,7 @@ function Rt() {
|
|
|
2556
2556
|
createApplicant: p,
|
|
2557
2557
|
createCompanyApplicant: S,
|
|
2558
2558
|
getApplicantData: T,
|
|
2559
|
-
stopProgress:
|
|
2559
|
+
stopProgress: F
|
|
2560
2560
|
};
|
|
2561
2561
|
}
|
|
2562
2562
|
const jr = {
|
|
@@ -2862,7 +2862,7 @@ const kt = 280, Ur = ({
|
|
|
2862
2862
|
disabled: l = !1,
|
|
2863
2863
|
required: d = !1
|
|
2864
2864
|
}) => {
|
|
2865
|
-
const [m, y] = w(!1), [p, S] = w(""), [T,
|
|
2865
|
+
const [m, y] = w(!1), [p, S] = w(""), [T, F] = w(null), [P, f] = w({
|
|
2866
2866
|
bg: "#ffffff",
|
|
2867
2867
|
borderColor: "#d1d5db",
|
|
2868
2868
|
textPrimary: "#111827",
|
|
@@ -2870,11 +2870,11 @@ const kt = 280, Ur = ({
|
|
|
2870
2870
|
primaryColor: "#2563eb",
|
|
2871
2871
|
primaryLight: "#eff6ff",
|
|
2872
2872
|
hoverBg: "#f9fafb"
|
|
2873
|
-
}), v = ce(null),
|
|
2874
|
-
if (!
|
|
2875
|
-
const L =
|
|
2873
|
+
}), v = ce(null), C = ce(null), U = ce(null), H = ee(() => {
|
|
2874
|
+
if (!C.current) return null;
|
|
2875
|
+
const L = C.current.getBoundingClientRect(), re = window.innerHeight - L.bottom < kt && L.top > kt;
|
|
2876
2876
|
return { top: re ? L.top : L.bottom + 4, left: L.left, width: L.width, openUp: re };
|
|
2877
|
-
}, []),
|
|
2877
|
+
}, []), D = ee(() => {
|
|
2878
2878
|
const L = getComputedStyle(document.documentElement), q = (fe, de) => L.getPropertyValue(fe).trim() || de, re = q("--metakyc-input-bg", q("--metakyc-background", "#ffffff"));
|
|
2879
2879
|
f({
|
|
2880
2880
|
bg: re,
|
|
@@ -2887,10 +2887,10 @@ const kt = 280, Ur = ({
|
|
|
2887
2887
|
});
|
|
2888
2888
|
}, []), B = ee(() => {
|
|
2889
2889
|
if (l) return;
|
|
2890
|
-
|
|
2890
|
+
D();
|
|
2891
2891
|
const L = H();
|
|
2892
|
-
L &&
|
|
2893
|
-
}, [l, H,
|
|
2892
|
+
L && F(L), y(!0);
|
|
2893
|
+
}, [l, H, D]), V = ee(() => {
|
|
2894
2894
|
y(!1), S("");
|
|
2895
2895
|
}, []);
|
|
2896
2896
|
ye(() => {
|
|
@@ -2905,7 +2905,7 @@ const kt = 280, Ur = ({
|
|
|
2905
2905
|
if (!m) return;
|
|
2906
2906
|
const L = () => {
|
|
2907
2907
|
const q = H();
|
|
2908
|
-
q &&
|
|
2908
|
+
q && F(q);
|
|
2909
2909
|
};
|
|
2910
2910
|
return window.addEventListener("scroll", L, !0), window.addEventListener("resize", L), () => {
|
|
2911
2911
|
window.removeEventListener("scroll", L, !0), window.removeEventListener("resize", L);
|
|
@@ -2913,14 +2913,14 @@ const kt = 280, Ur = ({
|
|
|
2913
2913
|
}, [m, H]);
|
|
2914
2914
|
const ne = a.filter(
|
|
2915
2915
|
(L) => L.label.toLowerCase().includes(p.toLowerCase())
|
|
2916
|
-
),
|
|
2916
|
+
), E = (L) => {
|
|
2917
2917
|
l || n(t.includes(L) ? t.filter((q) => q !== L) : [...t, L]);
|
|
2918
2918
|
}, A = (L, q) => {
|
|
2919
2919
|
q.stopPropagation(), l || n(t.filter((re) => re !== L));
|
|
2920
2920
|
}, W = (L) => {
|
|
2921
2921
|
var q;
|
|
2922
2922
|
return ((q = a.find((re) => re.value === L)) == null ? void 0 : q.label) || L;
|
|
2923
|
-
}, { bg: K, borderColor:
|
|
2923
|
+
}, { bg: K, borderColor: $, textPrimary: O, textSecondary: _, primaryColor: z, primaryLight: Q, hoverBg: te } = P, oe = m && T && /* @__PURE__ */ i(
|
|
2924
2924
|
"div",
|
|
2925
2925
|
{
|
|
2926
2926
|
ref: U,
|
|
@@ -2934,12 +2934,12 @@ const kt = 280, Ur = ({
|
|
|
2934
2934
|
zIndex: 99999,
|
|
2935
2935
|
borderRadius: "8px",
|
|
2936
2936
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
2937
|
-
border: `1px solid ${
|
|
2937
|
+
border: `1px solid ${$}`,
|
|
2938
2938
|
backgroundColor: K,
|
|
2939
2939
|
overflow: "hidden"
|
|
2940
2940
|
},
|
|
2941
2941
|
children: [
|
|
2942
|
-
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
2942
|
+
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${$}` }, children: /* @__PURE__ */ r(
|
|
2943
2943
|
"input",
|
|
2944
2944
|
{
|
|
2945
2945
|
type: "text",
|
|
@@ -2955,7 +2955,7 @@ const kt = 280, Ur = ({
|
|
|
2955
2955
|
padding: "6px 8px",
|
|
2956
2956
|
fontSize: "13px",
|
|
2957
2957
|
borderRadius: "6px",
|
|
2958
|
-
border: `1px solid ${
|
|
2958
|
+
border: `1px solid ${$}`,
|
|
2959
2959
|
backgroundColor: K,
|
|
2960
2960
|
color: O,
|
|
2961
2961
|
outline: "none",
|
|
@@ -2966,7 +2966,7 @@ const kt = 280, Ur = ({
|
|
|
2966
2966
|
L.currentTarget.style.backgroundColor = K, L.currentTarget.style.color = O, L.currentTarget.style.borderColor = re, L.currentTarget.style.outline = "none", L.currentTarget.style.boxShadow = `0 0 0 2px ${re}33`;
|
|
2967
2967
|
},
|
|
2968
2968
|
onBlur: (L) => {
|
|
2969
|
-
L.currentTarget.style.backgroundColor = K, L.currentTarget.style.color = O, L.currentTarget.style.borderColor =
|
|
2969
|
+
L.currentTarget.style.backgroundColor = K, L.currentTarget.style.color = O, L.currentTarget.style.borderColor = $, L.currentTarget.style.outline = "none", L.currentTarget.style.boxShadow = "none";
|
|
2970
2970
|
}
|
|
2971
2971
|
}
|
|
2972
2972
|
) }),
|
|
@@ -2975,7 +2975,7 @@ const kt = 280, Ur = ({
|
|
|
2975
2975
|
return /* @__PURE__ */ i(
|
|
2976
2976
|
"li",
|
|
2977
2977
|
{
|
|
2978
|
-
onClick: () =>
|
|
2978
|
+
onClick: () => E(L.value),
|
|
2979
2979
|
className: "metakyc-multiselect-option",
|
|
2980
2980
|
style: {
|
|
2981
2981
|
display: "flex",
|
|
@@ -2985,7 +2985,7 @@ const kt = 280, Ur = ({
|
|
|
2985
2985
|
fontSize: "13px",
|
|
2986
2986
|
cursor: "pointer",
|
|
2987
2987
|
backgroundColor: q ? Q : "transparent",
|
|
2988
|
-
color: q ?
|
|
2988
|
+
color: q ? z : O,
|
|
2989
2989
|
userSelect: "none"
|
|
2990
2990
|
},
|
|
2991
2991
|
onMouseEnter: (re) => {
|
|
@@ -3001,7 +3001,7 @@ const kt = 280, Ur = ({
|
|
|
3001
3001
|
type: "checkbox",
|
|
3002
3002
|
checked: q,
|
|
3003
3003
|
readOnly: !0,
|
|
3004
|
-
style: { accentColor:
|
|
3004
|
+
style: { accentColor: z, pointerEvents: "none", flexShrink: 0 }
|
|
3005
3005
|
}
|
|
3006
3006
|
),
|
|
3007
3007
|
/* @__PURE__ */ r("span", { children: L.label })
|
|
@@ -3010,7 +3010,7 @@ const kt = 280, Ur = ({
|
|
|
3010
3010
|
L.value
|
|
3011
3011
|
);
|
|
3012
3012
|
}) }),
|
|
3013
|
-
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${
|
|
3013
|
+
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${$}` }, children: /* @__PURE__ */ i(
|
|
3014
3014
|
"button",
|
|
3015
3015
|
{
|
|
3016
3016
|
type: "button",
|
|
@@ -3043,7 +3043,7 @@ const kt = 280, Ur = ({
|
|
|
3043
3043
|
/* @__PURE__ */ i(
|
|
3044
3044
|
"div",
|
|
3045
3045
|
{
|
|
3046
|
-
ref:
|
|
3046
|
+
ref: C,
|
|
3047
3047
|
onClick: () => m ? V() : B(),
|
|
3048
3048
|
className: Ie(
|
|
3049
3049
|
"metakyc-multiselect-trigger",
|
|
@@ -3132,7 +3132,7 @@ const kt = 280, Ur = ({
|
|
|
3132
3132
|
className: p
|
|
3133
3133
|
}) => {
|
|
3134
3134
|
var de;
|
|
3135
|
-
const [S, T] = w(!1), [
|
|
3135
|
+
const [S, T] = w(!1), [F, P] = w(""), [f, v] = w(null), [C, U] = w({
|
|
3136
3136
|
bg: "#ffffff",
|
|
3137
3137
|
border: "#d1d5db",
|
|
3138
3138
|
text: "#111827",
|
|
@@ -3141,7 +3141,7 @@ const kt = 280, Ur = ({
|
|
|
3141
3141
|
primaryLight: "#eff6ff",
|
|
3142
3142
|
hoverBg: "#f9fafb"
|
|
3143
3143
|
}), H = ee(() => {
|
|
3144
|
-
const
|
|
3144
|
+
const M = getComputedStyle(document.documentElement), G = (ue, we) => M.getPropertyValue(ue).trim() || we, ae = G("--metakyc-input-bg", G("--metakyc-background", "#ffffff"));
|
|
3145
3145
|
U({
|
|
3146
3146
|
bg: ae,
|
|
3147
3147
|
border: G("--metakyc-input-border", G("--metakyc-border", "#d1d5db")),
|
|
@@ -3151,51 +3151,51 @@ const kt = 280, Ur = ({
|
|
|
3151
3151
|
primaryLight: G("--metakyc-primary-light", "#eff6ff"),
|
|
3152
3152
|
hoverBg: G("--metakyc-surface", ae)
|
|
3153
3153
|
});
|
|
3154
|
-
}, []),
|
|
3154
|
+
}, []), D = ce(null), B = ce(null), V = ce(null), ne = ce(null), E = ee(() => {
|
|
3155
3155
|
if (!B.current) return null;
|
|
3156
|
-
const
|
|
3156
|
+
const M = B.current.getBoundingClientRect(), ae = window.innerHeight - M.bottom < wt && M.top > wt;
|
|
3157
3157
|
return {
|
|
3158
|
-
top: ae ?
|
|
3159
|
-
left:
|
|
3160
|
-
width:
|
|
3158
|
+
top: ae ? M.top : M.bottom + 4,
|
|
3159
|
+
left: M.left,
|
|
3160
|
+
width: M.width,
|
|
3161
3161
|
openUp: ae
|
|
3162
3162
|
};
|
|
3163
3163
|
}, []), A = ee(() => {
|
|
3164
3164
|
if (m) return;
|
|
3165
3165
|
H();
|
|
3166
|
-
const
|
|
3167
|
-
|
|
3168
|
-
}, [m,
|
|
3166
|
+
const M = E();
|
|
3167
|
+
M && v(M), T(!0);
|
|
3168
|
+
}, [m, E, H]), W = ee(() => {
|
|
3169
3169
|
T(!1), P("");
|
|
3170
3170
|
}, []), K = () => S ? W() : A();
|
|
3171
3171
|
ye(() => {
|
|
3172
3172
|
if (!S) return;
|
|
3173
|
-
const
|
|
3173
|
+
const M = (G) => {
|
|
3174
3174
|
var ue, we;
|
|
3175
3175
|
const ae = G.target;
|
|
3176
|
-
!((ue =
|
|
3176
|
+
!((ue = D.current) != null && ue.contains(ae)) && !((we = V.current) != null && we.contains(ae)) && W();
|
|
3177
3177
|
};
|
|
3178
|
-
return document.addEventListener("mousedown",
|
|
3178
|
+
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
3179
3179
|
}, [S, W]), ye(() => {
|
|
3180
3180
|
if (!S) return;
|
|
3181
|
-
const
|
|
3182
|
-
const G =
|
|
3181
|
+
const M = () => {
|
|
3182
|
+
const G = E();
|
|
3183
3183
|
G && v(G);
|
|
3184
3184
|
};
|
|
3185
|
-
return window.addEventListener("scroll",
|
|
3186
|
-
window.removeEventListener("scroll",
|
|
3185
|
+
return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), () => {
|
|
3186
|
+
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
|
|
3187
3187
|
};
|
|
3188
|
-
}, [S,
|
|
3188
|
+
}, [S, E]), ye(() => {
|
|
3189
3189
|
S && ne.current && setTimeout(() => {
|
|
3190
|
-
var
|
|
3191
|
-
return (
|
|
3190
|
+
var M;
|
|
3191
|
+
return (M = ne.current) == null ? void 0 : M.focus();
|
|
3192
3192
|
}, 0);
|
|
3193
3193
|
}, [S]);
|
|
3194
|
-
const
|
|
3195
|
-
(
|
|
3196
|
-
), O = (de = a.find((
|
|
3197
|
-
m || G || (d(
|
|
3198
|
-
}, { bg:
|
|
3194
|
+
const $ = a.filter(
|
|
3195
|
+
(M) => M.label.toLowerCase().includes(F.toLowerCase()) || M.value.toLowerCase().includes(F.toLowerCase())
|
|
3196
|
+
), O = (de = a.find((M) => M.value === l)) == null ? void 0 : de.label, _ = (M, G) => {
|
|
3197
|
+
m || G || (d(M), W());
|
|
3198
|
+
}, { bg: z, border: Q, text: te, textSecondary: oe, primary: L, primaryLight: q, hoverBg: re } = C, fe = S && f && /* @__PURE__ */ i(
|
|
3199
3199
|
"div",
|
|
3200
3200
|
{
|
|
3201
3201
|
ref: V,
|
|
@@ -3210,7 +3210,7 @@ const kt = 280, Ur = ({
|
|
|
3210
3210
|
borderRadius: "8px",
|
|
3211
3211
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
3212
3212
|
border: `1px solid ${Q}`,
|
|
3213
|
-
backgroundColor:
|
|
3213
|
+
backgroundColor: z,
|
|
3214
3214
|
overflow: "hidden"
|
|
3215
3215
|
},
|
|
3216
3216
|
children: [
|
|
@@ -3219,10 +3219,10 @@ const kt = 280, Ur = ({
|
|
|
3219
3219
|
{
|
|
3220
3220
|
ref: ne,
|
|
3221
3221
|
type: "text",
|
|
3222
|
-
value:
|
|
3223
|
-
onChange: (
|
|
3222
|
+
value: F,
|
|
3223
|
+
onChange: (M) => P(M.target.value),
|
|
3224
3224
|
placeholder: "Search...",
|
|
3225
|
-
onClick: (
|
|
3225
|
+
onClick: (M) => M.stopPropagation(),
|
|
3226
3226
|
className: "metakyc-searchable-select-search w-full",
|
|
3227
3227
|
style: {
|
|
3228
3228
|
display: "block",
|
|
@@ -3231,17 +3231,17 @@ const kt = 280, Ur = ({
|
|
|
3231
3231
|
fontSize: "13px",
|
|
3232
3232
|
borderRadius: "6px",
|
|
3233
3233
|
border: `1px solid ${Q}`,
|
|
3234
|
-
backgroundColor:
|
|
3234
|
+
backgroundColor: z,
|
|
3235
3235
|
color: te,
|
|
3236
3236
|
outline: "none",
|
|
3237
3237
|
boxSizing: "border-box"
|
|
3238
3238
|
},
|
|
3239
|
-
onFocus: (
|
|
3239
|
+
onFocus: (M) => {
|
|
3240
3240
|
const G = getComputedStyle(document.documentElement), ae = G.getPropertyValue("--metakyc-input-border-focus").trim() || G.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3241
|
-
|
|
3241
|
+
M.currentTarget.style.backgroundColor = z, M.currentTarget.style.color = te, M.currentTarget.style.borderColor = ae, M.currentTarget.style.outline = "none", M.currentTarget.style.boxShadow = `0 0 0 2px ${ae}33`;
|
|
3242
3242
|
},
|
|
3243
|
-
onBlur: (
|
|
3244
|
-
|
|
3243
|
+
onBlur: (M) => {
|
|
3244
|
+
M.currentTarget.style.backgroundColor = z, M.currentTarget.style.color = te, M.currentTarget.style.borderColor = Q, M.currentTarget.style.outline = "none", M.currentTarget.style.boxShadow = "none";
|
|
3245
3245
|
}
|
|
3246
3246
|
}
|
|
3247
3247
|
) }),
|
|
@@ -3255,31 +3255,31 @@ const kt = 280, Ur = ({
|
|
|
3255
3255
|
maxHeight: "208px",
|
|
3256
3256
|
overflowY: "auto"
|
|
3257
3257
|
},
|
|
3258
|
-
children:
|
|
3259
|
-
const G =
|
|
3258
|
+
children: $.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: oe }, children: "No results" }) : $.map((M) => {
|
|
3259
|
+
const G = M.value === l;
|
|
3260
3260
|
return /* @__PURE__ */ r(
|
|
3261
3261
|
"li",
|
|
3262
3262
|
{
|
|
3263
3263
|
className: "metakyc-searchable-select-option",
|
|
3264
|
-
onClick: () => _(
|
|
3264
|
+
onClick: () => _(M.value, M.disabled),
|
|
3265
3265
|
style: {
|
|
3266
3266
|
padding: "8px 12px",
|
|
3267
3267
|
fontSize: "13px",
|
|
3268
|
-
cursor:
|
|
3269
|
-
opacity:
|
|
3268
|
+
cursor: M.disabled ? "not-allowed" : "pointer",
|
|
3269
|
+
opacity: M.disabled ? 0.4 : 1,
|
|
3270
3270
|
backgroundColor: G ? q : "transparent",
|
|
3271
3271
|
color: G ? L : te,
|
|
3272
3272
|
userSelect: "none"
|
|
3273
3273
|
},
|
|
3274
3274
|
onMouseEnter: (ae) => {
|
|
3275
|
-
!G && !
|
|
3275
|
+
!G && !M.disabled && (ae.currentTarget.style.backgroundColor = re);
|
|
3276
3276
|
},
|
|
3277
3277
|
onMouseLeave: (ae) => {
|
|
3278
3278
|
G || (ae.currentTarget.style.backgroundColor = "transparent");
|
|
3279
3279
|
},
|
|
3280
|
-
children:
|
|
3280
|
+
children: M.label
|
|
3281
3281
|
},
|
|
3282
|
-
|
|
3282
|
+
M.value
|
|
3283
3283
|
);
|
|
3284
3284
|
})
|
|
3285
3285
|
}
|
|
@@ -3291,7 +3291,7 @@ const kt = 280, Ur = ({
|
|
|
3291
3291
|
"div",
|
|
3292
3292
|
{
|
|
3293
3293
|
className: Ie("w-full metakyc-searchable-select", p),
|
|
3294
|
-
ref:
|
|
3294
|
+
ref: D,
|
|
3295
3295
|
children: [
|
|
3296
3296
|
e && /* @__PURE__ */ i(
|
|
3297
3297
|
"label",
|
|
@@ -3311,8 +3311,8 @@ const kt = 280, Ur = ({
|
|
|
3311
3311
|
role: "button",
|
|
3312
3312
|
tabIndex: m ? -1 : 0,
|
|
3313
3313
|
onClick: K,
|
|
3314
|
-
onKeyDown: (
|
|
3315
|
-
(
|
|
3314
|
+
onKeyDown: (M) => {
|
|
3315
|
+
(M.key === "Enter" || M.key === " ") && (M.preventDefault(), K()), M.key === "Escape" && W();
|
|
3316
3316
|
},
|
|
3317
3317
|
className: Ie(
|
|
3318
3318
|
"metakyc-searchable-select-trigger",
|
|
@@ -3366,29 +3366,29 @@ const Wr = ({
|
|
|
3366
3366
|
value: y = [],
|
|
3367
3367
|
className: p
|
|
3368
3368
|
}) => {
|
|
3369
|
-
const [S, T] = w(!1), [
|
|
3370
|
-
if (!
|
|
3369
|
+
const [S, T] = w(!1), [F, P] = w(null), f = ce(null), v = ee((E) => {
|
|
3370
|
+
if (!E) return;
|
|
3371
3371
|
P(null);
|
|
3372
|
-
const A = Array.from(
|
|
3372
|
+
const A = Array.from(E);
|
|
3373
3373
|
if (l && A.filter((K) => K.size > l).length > 0) {
|
|
3374
3374
|
P(`File exceeds the maximum size of ${pt(l)}`);
|
|
3375
3375
|
return;
|
|
3376
3376
|
}
|
|
3377
3377
|
m == null || m(s ? [...y, ...A] : [A[0]]);
|
|
3378
|
-
}, [l, s, m, y]),
|
|
3379
|
-
|
|
3380
|
-
}, []), U = ee((
|
|
3381
|
-
|
|
3382
|
-
}, []), H = ee((
|
|
3383
|
-
|
|
3384
|
-
}, [v]),
|
|
3385
|
-
var
|
|
3386
|
-
(
|
|
3387
|
-
}, B = (
|
|
3378
|
+
}, [l, s, m, y]), C = ee((E) => {
|
|
3379
|
+
E.preventDefault(), E.stopPropagation(), T(!0);
|
|
3380
|
+
}, []), U = ee((E) => {
|
|
3381
|
+
E.preventDefault(), E.stopPropagation(), T(!1);
|
|
3382
|
+
}, []), H = ee((E) => {
|
|
3383
|
+
E.preventDefault(), E.stopPropagation(), T(!1), v(E.dataTransfer.files);
|
|
3384
|
+
}, [v]), D = () => {
|
|
3385
|
+
var E;
|
|
3386
|
+
(E = f.current) == null || E.click();
|
|
3387
|
+
}, B = (E) => {
|
|
3388
3388
|
P(null);
|
|
3389
|
-
const A = y.filter((W, K) => K !==
|
|
3389
|
+
const A = y.filter((W, K) => K !== E);
|
|
3390
3390
|
m == null || m(A);
|
|
3391
|
-
}, V = n ||
|
|
3391
|
+
}, V = n || F, ne = y.length > 0;
|
|
3392
3392
|
return /* @__PURE__ */ i("div", { className: Ie("metakyc-file-upload", p), style: { width: "100%" }, children: [
|
|
3393
3393
|
e && /* @__PURE__ */ i("div", { style: { marginBottom: "8px" }, children: [
|
|
3394
3394
|
/* @__PURE__ */ i(
|
|
@@ -3412,8 +3412,8 @@ const Wr = ({
|
|
|
3412
3412
|
"div",
|
|
3413
3413
|
{
|
|
3414
3414
|
className: "metakyc-file-dropzone",
|
|
3415
|
-
onClick:
|
|
3416
|
-
onDragOver:
|
|
3415
|
+
onClick: D,
|
|
3416
|
+
onDragOver: C,
|
|
3417
3417
|
onDragLeave: U,
|
|
3418
3418
|
onDrop: H,
|
|
3419
3419
|
style: {
|
|
@@ -3434,8 +3434,8 @@ const Wr = ({
|
|
|
3434
3434
|
style: { display: "none" },
|
|
3435
3435
|
accept: a,
|
|
3436
3436
|
multiple: s,
|
|
3437
|
-
onChange: (
|
|
3438
|
-
v(
|
|
3437
|
+
onChange: (E) => {
|
|
3438
|
+
v(E.target.files), E.target.value = "";
|
|
3439
3439
|
}
|
|
3440
3440
|
}
|
|
3441
3441
|
),
|
|
@@ -3493,8 +3493,8 @@ const Wr = ({
|
|
|
3493
3493
|
]
|
|
3494
3494
|
}
|
|
3495
3495
|
),
|
|
3496
|
-
ne && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((
|
|
3497
|
-
const W = Kr(
|
|
3496
|
+
ne && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, A) => {
|
|
3497
|
+
const W = Kr(E), K = W === "image", $ = K ? URL.createObjectURL(E) : null;
|
|
3498
3498
|
return /* @__PURE__ */ i(
|
|
3499
3499
|
"div",
|
|
3500
3500
|
{
|
|
@@ -3524,11 +3524,11 @@ const Wr = ({
|
|
|
3524
3524
|
overflow: "hidden",
|
|
3525
3525
|
backgroundColor: K ? "transparent" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 10%, transparent)"
|
|
3526
3526
|
},
|
|
3527
|
-
children: K &&
|
|
3527
|
+
children: K && $ ? /* @__PURE__ */ r(
|
|
3528
3528
|
"img",
|
|
3529
3529
|
{
|
|
3530
|
-
src:
|
|
3531
|
-
alt:
|
|
3530
|
+
src: $,
|
|
3531
|
+
alt: E.name,
|
|
3532
3532
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
3533
3533
|
}
|
|
3534
3534
|
) : W === "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: [
|
|
@@ -3552,8 +3552,8 @@ const Wr = ({
|
|
|
3552
3552
|
overflow: "hidden",
|
|
3553
3553
|
textOverflow: "ellipsis",
|
|
3554
3554
|
whiteSpace: "nowrap"
|
|
3555
|
-
}, children:
|
|
3556
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: pt(
|
|
3555
|
+
}, children: E.name }),
|
|
3556
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: pt(E.size) })
|
|
3557
3557
|
] }),
|
|
3558
3558
|
/* @__PURE__ */ r(
|
|
3559
3559
|
"button",
|
|
@@ -3591,7 +3591,7 @@ const Wr = ({
|
|
|
3591
3591
|
)
|
|
3592
3592
|
]
|
|
3593
3593
|
},
|
|
3594
|
-
`${
|
|
3594
|
+
`${E.name}-${A}`
|
|
3595
3595
|
);
|
|
3596
3596
|
}) }),
|
|
3597
3597
|
V && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: V })
|
|
@@ -3820,33 +3820,33 @@ const rn = ({
|
|
|
3820
3820
|
onComplete: t,
|
|
3821
3821
|
onBack: n
|
|
3822
3822
|
}) => {
|
|
3823
|
-
const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: d, error: m, submit: y } = Or(e), [p, S] = w({}), [T,
|
|
3823
|
+
const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: d, error: m, submit: y } = Or(e), [p, S] = w({}), [T, F] = w({}), [P, f] = w(0);
|
|
3824
3824
|
Ae.useEffect(() => {
|
|
3825
3825
|
s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && S(s);
|
|
3826
3826
|
}, [s]);
|
|
3827
3827
|
const v = Re(
|
|
3828
3828
|
() => a ? tn(a.questionGroups) : [],
|
|
3829
3829
|
[a]
|
|
3830
|
-
),
|
|
3831
|
-
S((W) => ({ ...W, [
|
|
3830
|
+
), C = P === v.length - 1, U = v[P] ?? [], H = ee((E, A) => {
|
|
3831
|
+
S((W) => ({ ...W, [E]: A })), F((W) => {
|
|
3832
3832
|
const K = { ...W };
|
|
3833
|
-
return delete K[
|
|
3833
|
+
return delete K[E], K;
|
|
3834
3834
|
});
|
|
3835
|
-
}, []),
|
|
3836
|
-
const
|
|
3835
|
+
}, []), D = ee(() => {
|
|
3836
|
+
const E = {};
|
|
3837
3837
|
for (const { question: A } of U) {
|
|
3838
3838
|
const W = en(A, p[A.id] ?? []);
|
|
3839
|
-
W && (
|
|
3839
|
+
W && (E[A.id] = W);
|
|
3840
3840
|
}
|
|
3841
|
-
return
|
|
3841
|
+
return F((A) => ({ ...A, ...E })), Object.keys(E).length === 0;
|
|
3842
3842
|
}, [U, p]), B = () => {
|
|
3843
|
-
|
|
3843
|
+
D() && f((E) => E + 1);
|
|
3844
3844
|
}, V = () => {
|
|
3845
|
-
P > 0 ? f((
|
|
3845
|
+
P > 0 ? f((E) => E - 1) : n == null || n();
|
|
3846
3846
|
}, ne = async () => {
|
|
3847
|
-
if (!(!
|
|
3847
|
+
if (!(!D() || !a))
|
|
3848
3848
|
try {
|
|
3849
|
-
const
|
|
3849
|
+
const E = a.questionGroups.flatMap(
|
|
3850
3850
|
(W) => (W.questions ?? []).map((K) => ({
|
|
3851
3851
|
questionId: K.id,
|
|
3852
3852
|
values: p[K.id] ?? []
|
|
@@ -3854,11 +3854,11 @@ const rn = ({
|
|
|
3854
3854
|
), A = {
|
|
3855
3855
|
applicantId: e,
|
|
3856
3856
|
questionnarieId: a.id,
|
|
3857
|
-
questionResults:
|
|
3857
|
+
questionResults: E
|
|
3858
3858
|
};
|
|
3859
3859
|
await y(A), t == null || t();
|
|
3860
|
-
} catch (
|
|
3861
|
-
console.error("Questionnaire submit error:",
|
|
3860
|
+
} catch (E) {
|
|
3861
|
+
console.error("Questionnaire submit error:", E);
|
|
3862
3862
|
}
|
|
3863
3863
|
};
|
|
3864
3864
|
return l ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ r(Pe, { className: "my-8" }) }) }) : m ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
@@ -3875,7 +3875,7 @@ const rn = ({
|
|
|
3875
3875
|
" of ",
|
|
3876
3876
|
v.length
|
|
3877
3877
|
] }),
|
|
3878
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: v.map((
|
|
3878
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: v.map((E, A) => /* @__PURE__ */ r(
|
|
3879
3879
|
"div",
|
|
3880
3880
|
{
|
|
3881
3881
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3889,15 +3889,15 @@ const rn = ({
|
|
|
3889
3889
|
)) })
|
|
3890
3890
|
] })
|
|
3891
3891
|
] }),
|
|
3892
|
-
/* @__PURE__ */ r(Z, { className: "space-y-6", children: U.map(({ question:
|
|
3892
|
+
/* @__PURE__ */ r(Z, { className: "space-y-6", children: U.map(({ question: E }) => /* @__PURE__ */ r(
|
|
3893
3893
|
nn,
|
|
3894
3894
|
{
|
|
3895
|
-
question:
|
|
3896
|
-
value: p[
|
|
3897
|
-
error: T[
|
|
3898
|
-
onChange: (A) => H(
|
|
3895
|
+
question: E,
|
|
3896
|
+
value: p[E.id] ?? [],
|
|
3897
|
+
error: T[E.id],
|
|
3898
|
+
onChange: (A) => H(E.id, A)
|
|
3899
3899
|
},
|
|
3900
|
-
|
|
3900
|
+
E.id
|
|
3901
3901
|
)) }),
|
|
3902
3902
|
/* @__PURE__ */ i(ke, { className: "flex items-center justify-between", children: [
|
|
3903
3903
|
/* @__PURE__ */ i(
|
|
@@ -3913,7 +3913,7 @@ const rn = ({
|
|
|
3913
3913
|
]
|
|
3914
3914
|
}
|
|
3915
3915
|
),
|
|
3916
|
-
|
|
3916
|
+
C ? /* @__PURE__ */ r(
|
|
3917
3917
|
X,
|
|
3918
3918
|
{
|
|
3919
3919
|
type: "button",
|
|
@@ -4048,8 +4048,8 @@ const rn = ({
|
|
|
4048
4048
|
onComplete: t,
|
|
4049
4049
|
onBack: n
|
|
4050
4050
|
}) => {
|
|
4051
|
-
const { uploadDocument: a, isLoading: s, isSubmitting: l, error: d, submit: m } =
|
|
4052
|
-
if (
|
|
4051
|
+
const { uploadDocument: a, isLoading: s, isSubmitting: l, error: d, submit: m } = zr(e), [y, p] = w({}), [S, T] = w(null), F = Re(() => a ? a.uploadDocumentFiles.filter((C) => C.isRequired).every((C) => (y[C.id] || []).length > 0) : !1, [a, y]), P = Re(() => a ? a.uploadDocumentFiles.filter((C) => (y[C.id] || []).length > 0).length : 0, [a, y]), f = async (C) => {
|
|
4052
|
+
if (C.preventDefault(), T(null), !a) return;
|
|
4053
4053
|
const U = a.uploadDocumentFiles.filter(
|
|
4054
4054
|
(H) => H.isRequired && (y[H.id] || []).length === 0
|
|
4055
4055
|
);
|
|
@@ -4061,9 +4061,9 @@ const rn = ({
|
|
|
4061
4061
|
const H = await Promise.all(
|
|
4062
4062
|
a.uploadDocumentFiles.map(async (B) => {
|
|
4063
4063
|
const V = y[B.id] || [], ne = await Promise.all(
|
|
4064
|
-
V.map(async (
|
|
4065
|
-
fileName:
|
|
4066
|
-
fileData: await Rr(
|
|
4064
|
+
V.map(async (E) => ({
|
|
4065
|
+
fileName: E.name,
|
|
4066
|
+
fileData: await Rr(E)
|
|
4067
4067
|
}))
|
|
4068
4068
|
);
|
|
4069
4069
|
return {
|
|
@@ -4071,12 +4071,12 @@ const rn = ({
|
|
|
4071
4071
|
valueList: ne
|
|
4072
4072
|
};
|
|
4073
4073
|
})
|
|
4074
|
-
),
|
|
4074
|
+
), D = {
|
|
4075
4075
|
applicantId: e,
|
|
4076
4076
|
uploadDocumentId: a.id,
|
|
4077
4077
|
uploadDocumentResults: H
|
|
4078
4078
|
};
|
|
4079
|
-
await m(
|
|
4079
|
+
await m(D), t == null || t();
|
|
4080
4080
|
} catch (H) {
|
|
4081
4081
|
T((H == null ? void 0 : H.message) || "Failed to submit documents. Please try again.");
|
|
4082
4082
|
}
|
|
@@ -4143,11 +4143,11 @@ const rn = ({
|
|
|
4143
4143
|
fontSize: "13px",
|
|
4144
4144
|
fontWeight: 500,
|
|
4145
4145
|
flexShrink: 0,
|
|
4146
|
-
backgroundColor:
|
|
4147
|
-
color:
|
|
4146
|
+
backgroundColor: F ? "color-mix(in srgb, var(--metakyc-success, #10b981) 10%, transparent)" : "var(--metakyc-surface, #f3f4f6)",
|
|
4147
|
+
color: F ? "var(--metakyc-success, #10b981)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
4148
4148
|
transition: "all 0.2s ease"
|
|
4149
4149
|
}, children: [
|
|
4150
|
-
|
|
4150
|
+
F ? /* @__PURE__ */ r("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r("polyline", { points: "20 6 9 17 4 12" }) }) : null,
|
|
4151
4151
|
P,
|
|
4152
4152
|
"/",
|
|
4153
4153
|
v
|
|
@@ -4188,22 +4188,52 @@ const rn = ({
|
|
|
4188
4188
|
}, children: a.description })
|
|
4189
4189
|
] })
|
|
4190
4190
|
] }),
|
|
4191
|
-
/* @__PURE__ */ r(Z, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: a.uploadDocumentFiles.map((
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4191
|
+
/* @__PURE__ */ r(Z, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: a.uploadDocumentFiles.map((C, U) => /* @__PURE__ */ i("div", { children: [
|
|
4192
|
+
/* @__PURE__ */ i("div", { style: {
|
|
4193
|
+
display: "flex",
|
|
4194
|
+
alignItems: "center",
|
|
4195
|
+
gap: "8px",
|
|
4196
|
+
marginBottom: "10px"
|
|
4197
|
+
}, children: [
|
|
4198
|
+
/* @__PURE__ */ r("span", { style: {
|
|
4199
|
+
display: "inline-flex",
|
|
4200
|
+
alignItems: "center",
|
|
4201
|
+
justifyContent: "center",
|
|
4202
|
+
width: "24px",
|
|
4203
|
+
height: "24px",
|
|
4204
|
+
borderRadius: "6px",
|
|
4205
|
+
fontSize: "12px",
|
|
4206
|
+
fontWeight: 600,
|
|
4207
|
+
backgroundColor: (y[C.id] || []).length > 0 ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-surface, #f3f4f6)",
|
|
4208
|
+
color: (y[C.id] || []).length > 0 ? "#ffffff" : "var(--metakyc-text-muted, #9ca3af)",
|
|
4209
|
+
transition: "all 0.2s ease",
|
|
4210
|
+
flexShrink: 0
|
|
4211
|
+
}, children: C.pageNumber ?? U + 1 }),
|
|
4212
|
+
/* @__PURE__ */ i("span", { style: {
|
|
4213
|
+
fontSize: "13px",
|
|
4214
|
+
fontWeight: 500,
|
|
4215
|
+
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
4216
|
+
}, children: [
|
|
4217
|
+
"Page ",
|
|
4218
|
+
C.pageNumber ?? U + 1
|
|
4219
|
+
] })
|
|
4220
|
+
] }),
|
|
4221
|
+
/* @__PURE__ */ r(
|
|
4222
|
+
Wr,
|
|
4223
|
+
{
|
|
4224
|
+
label: C.displayName,
|
|
4225
|
+
subtitle: C.subtitle,
|
|
4226
|
+
accept: C.allowedTypes,
|
|
4227
|
+
multiple: C.multipleFile,
|
|
4228
|
+
maxSize: C.maxEachFileSizeByte,
|
|
4229
|
+
required: C.isRequired,
|
|
4230
|
+
value: y[C.id] || [],
|
|
4231
|
+
onChange: (H) => {
|
|
4232
|
+
T(null), p((D) => ({ ...D, [C.id]: H }));
|
|
4233
|
+
}
|
|
4203
4234
|
}
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
)) }) }),
|
|
4235
|
+
)
|
|
4236
|
+
] }, C.id)) }) }),
|
|
4207
4237
|
S && /* @__PURE__ */ i("div", { style: {
|
|
4208
4238
|
margin: "0 24px",
|
|
4209
4239
|
padding: "10px 14px",
|
|
@@ -4233,9 +4263,9 @@ const rn = ({
|
|
|
4233
4263
|
{
|
|
4234
4264
|
type: "submit",
|
|
4235
4265
|
isLoading: l,
|
|
4236
|
-
disabled: !
|
|
4266
|
+
disabled: !F,
|
|
4237
4267
|
style: {
|
|
4238
|
-
opacity:
|
|
4268
|
+
opacity: F ? 1 : 0.5
|
|
4239
4269
|
},
|
|
4240
4270
|
children: l ? "Uploading..." : "Continue"
|
|
4241
4271
|
}
|
|
@@ -4243,7 +4273,7 @@ const rn = ({
|
|
|
4243
4273
|
] }) })
|
|
4244
4274
|
] }) });
|
|
4245
4275
|
}, sn = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
4246
|
-
const { overview: a, isLoading: s, isSubmitting: l, error: d, passOverview: m } =
|
|
4276
|
+
const { overview: a, isLoading: s, isSubmitting: l, error: d, passOverview: m } = $r(e), y = async () => {
|
|
4247
4277
|
await m(), t == null || t();
|
|
4248
4278
|
};
|
|
4249
4279
|
return s ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ r(Pe, { className: "my-8" }) }) }) : d ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
@@ -4295,7 +4325,7 @@ function on(e) {
|
|
|
4295
4325
|
}
|
|
4296
4326
|
}
|
|
4297
4327
|
function ln(e) {
|
|
4298
|
-
return e.valueDataType ===
|
|
4328
|
+
return e.valueDataType === $e.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
|
|
4299
4329
|
}
|
|
4300
4330
|
function cn(e, t) {
|
|
4301
4331
|
const n = new Intl.NumberFormat(on(t), {
|
|
@@ -4319,7 +4349,7 @@ function dn(e, t) {
|
|
|
4319
4349
|
return e.errorMessage || "Invalid format";
|
|
4320
4350
|
} catch {
|
|
4321
4351
|
}
|
|
4322
|
-
const s = e.valueDataType ===
|
|
4352
|
+
const s = e.valueDataType === $e.Integer || e.valueDataType === $e.Money || e.valueDataType === $e.DigitOnly;
|
|
4323
4353
|
if (s && a.trim() !== "") {
|
|
4324
4354
|
const l = Number(a);
|
|
4325
4355
|
if (!isNaN(l)) {
|
|
@@ -4352,43 +4382,43 @@ const pn = ({
|
|
|
4352
4382
|
onComplete: t,
|
|
4353
4383
|
onBack: n
|
|
4354
4384
|
}) => {
|
|
4355
|
-
const { config: a } = Fe(), s = a.locale ?? "en", { criteria: l, initialAnswers: d, isLoading: m, isSubmitting: y, error: p, submit: S } = _r(e), [T,
|
|
4385
|
+
const { config: a } = Fe(), s = a.locale ?? "en", { criteria: l, initialAnswers: d, isLoading: m, isSubmitting: y, error: p, submit: S } = _r(e), [T, F] = w({}), [P, f] = w({}), [v, C] = w(0), [U, H] = w(!1);
|
|
4356
4386
|
Ae.useEffect(() => {
|
|
4357
|
-
d && Object.keys(d).length > 0 && Object.keys(T).length === 0 &&
|
|
4387
|
+
d && Object.keys(d).length > 0 && Object.keys(T).length === 0 && F(d);
|
|
4358
4388
|
}, [d]);
|
|
4359
|
-
const
|
|
4389
|
+
const D = Re(
|
|
4360
4390
|
() => l && l.length > 0 ? un(l) : [],
|
|
4361
4391
|
[l]
|
|
4362
|
-
), B = v ===
|
|
4392
|
+
), B = v === D.length - 1, V = D[v] ?? [];
|
|
4363
4393
|
Ae.useEffect(() => {
|
|
4364
4394
|
!m && l && l.length === 0 && !U && !y && (H(!0), S({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4365
4395
|
}, [m, l, U, y, S, e, t]);
|
|
4366
|
-
const ne = ee((
|
|
4367
|
-
|
|
4368
|
-
const
|
|
4369
|
-
return delete $
|
|
4396
|
+
const ne = ee(($, O) => {
|
|
4397
|
+
F((_) => ({ ..._, [$]: O })), f((_) => {
|
|
4398
|
+
const z = { ..._ };
|
|
4399
|
+
return delete z[$], z;
|
|
4370
4400
|
});
|
|
4371
|
-
}, []),
|
|
4372
|
-
const
|
|
4401
|
+
}, []), E = ee(() => {
|
|
4402
|
+
const $ = {};
|
|
4373
4403
|
for (const { criterion: O } of V) {
|
|
4374
4404
|
const _ = dn(O, T[O.id] ?? []);
|
|
4375
|
-
_ && (
|
|
4405
|
+
_ && ($[O.id] = _);
|
|
4376
4406
|
}
|
|
4377
|
-
return f((O) => ({ ...O,
|
|
4407
|
+
return f((O) => ({ ...O, ...$ })), Object.keys($).length === 0;
|
|
4378
4408
|
}, [V, T]), A = () => {
|
|
4379
|
-
|
|
4409
|
+
E() && C(($) => $ + 1);
|
|
4380
4410
|
}, W = () => {
|
|
4381
|
-
v > 0 ?
|
|
4411
|
+
v > 0 ? C(($) => $ - 1) : n == null || n();
|
|
4382
4412
|
}, K = async () => {
|
|
4383
|
-
if (!(!
|
|
4413
|
+
if (!(!E() || !l))
|
|
4384
4414
|
try {
|
|
4385
|
-
const
|
|
4386
|
-
const
|
|
4387
|
-
return
|
|
4415
|
+
const $ = l.map((_) => {
|
|
4416
|
+
const z = (T[_.id] ?? []).filter((Q) => Q && Q.trim());
|
|
4417
|
+
return z.length > 0 ? { riskCriteriaId: _.id, values: z } : null;
|
|
4388
4418
|
}).filter((_) => _ !== null);
|
|
4389
|
-
await S({ applicantId: e, criteriaValueInputs:
|
|
4390
|
-
} catch (
|
|
4391
|
-
console.error("Risk scoring submit error:",
|
|
4419
|
+
await S({ applicantId: e, criteriaValueInputs: $ }), t == null || t();
|
|
4420
|
+
} catch ($) {
|
|
4421
|
+
console.error("Risk scoring submit error:", $);
|
|
4392
4422
|
}
|
|
4393
4423
|
};
|
|
4394
4424
|
return m ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ i(Z, { children: [
|
|
@@ -4404,14 +4434,14 @@ const pn = ({
|
|
|
4404
4434
|
/* @__PURE__ */ i(ve, { children: [
|
|
4405
4435
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
4406
4436
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
4407
|
-
|
|
4437
|
+
D.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
4408
4438
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
4409
4439
|
"Page ",
|
|
4410
4440
|
v + 1,
|
|
4411
4441
|
" of ",
|
|
4412
|
-
|
|
4442
|
+
D.length
|
|
4413
4443
|
] }),
|
|
4414
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children:
|
|
4444
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: D.map(($, O) => /* @__PURE__ */ r(
|
|
4415
4445
|
"div",
|
|
4416
4446
|
{
|
|
4417
4447
|
className: "rounded-full transition-all duration-200",
|
|
@@ -4425,16 +4455,16 @@ const pn = ({
|
|
|
4425
4455
|
)) })
|
|
4426
4456
|
] })
|
|
4427
4457
|
] }),
|
|
4428
|
-
/* @__PURE__ */ r(Z, { className: "space-y-6", children: V.map(({ criterion:
|
|
4458
|
+
/* @__PURE__ */ r(Z, { className: "space-y-6", children: V.map(({ criterion: $ }) => /* @__PURE__ */ r(
|
|
4429
4459
|
yn,
|
|
4430
4460
|
{
|
|
4431
|
-
criterion:
|
|
4432
|
-
value: T[
|
|
4433
|
-
error: P[
|
|
4461
|
+
criterion: $,
|
|
4462
|
+
value: T[$.id] ?? [],
|
|
4463
|
+
error: P[$.id],
|
|
4434
4464
|
locale: s,
|
|
4435
|
-
onChange: (O) => ne(
|
|
4465
|
+
onChange: (O) => ne($.id, O)
|
|
4436
4466
|
},
|
|
4437
|
-
|
|
4467
|
+
$.id
|
|
4438
4468
|
)) }),
|
|
4439
4469
|
/* @__PURE__ */ i(ke, { className: "flex items-center justify-between", children: [
|
|
4440
4470
|
/* @__PURE__ */ i(
|
|
@@ -4466,7 +4496,7 @@ const pn = ({
|
|
|
4466
4496
|
p && /* @__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: p.message }) })
|
|
4467
4497
|
] }) : null;
|
|
4468
4498
|
}, yn = ({ criterion: e, value: t, error: n, locale: a, onChange: s }) => {
|
|
4469
|
-
const l = mn(e), d = e.valueDataType ===
|
|
4499
|
+
const l = mn(e), d = e.valueDataType === $e.Integer || e.valueDataType === $e.Money || e.valueDataType === $e.DigitOnly, m = ln(e), y = (p) => m ? cn(p, a) : p;
|
|
4470
4500
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
4471
4501
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4472
4502
|
e.displayName,
|
|
@@ -4486,7 +4516,7 @@ const pn = ({
|
|
|
4486
4516
|
min: e.min,
|
|
4487
4517
|
max: e.max,
|
|
4488
4518
|
onKeyDown: (p) => {
|
|
4489
|
-
e.valueDataType ===
|
|
4519
|
+
e.valueDataType === $e.DigitOnly && ["e", "E", "+", "-", "."].includes(p.key) && p.preventDefault();
|
|
4490
4520
|
}
|
|
4491
4521
|
}
|
|
4492
4522
|
),
|
|
@@ -4595,15 +4625,15 @@ const pn = ({
|
|
|
4595
4625
|
}
|
|
4596
4626
|
m(!0), p(null);
|
|
4597
4627
|
try {
|
|
4598
|
-
const
|
|
4628
|
+
const F = {
|
|
4599
4629
|
applicantId: e,
|
|
4600
4630
|
investorType: s
|
|
4601
4631
|
};
|
|
4602
|
-
console.log("Submitting investor categorization:",
|
|
4603
|
-
const P = await a.setInvestorCategorization(
|
|
4632
|
+
console.log("Submitting investor categorization:", F);
|
|
4633
|
+
const P = await a.setInvestorCategorization(F);
|
|
4604
4634
|
console.log("Investor categorization result:", P), t == null || t();
|
|
4605
|
-
} catch (
|
|
4606
|
-
console.error("Error submitting investor categorization:",
|
|
4635
|
+
} catch (F) {
|
|
4636
|
+
console.error("Error submitting investor categorization:", F), p(F.message || "Failed to submit investor categorization");
|
|
4607
4637
|
} finally {
|
|
4608
4638
|
m(!1);
|
|
4609
4639
|
}
|
|
@@ -4728,44 +4758,44 @@ const pn = ({
|
|
|
4728
4758
|
onComplete: t,
|
|
4729
4759
|
onBack: n
|
|
4730
4760
|
}) => {
|
|
4731
|
-
const { appropriatenessTestService: a } = Fe(), [s, l] = w(null), [d, m] = w(!0), [y, p] = w(!1), [S, T] = w(null), [
|
|
4761
|
+
const { appropriatenessTestService: a } = Fe(), [s, l] = w(null), [d, m] = w(!0), [y, p] = w(!1), [S, T] = w(null), [F, P] = w({}), [f, v] = w(0), [C, U] = w(!1), [H, D] = w(!1), [B, V] = w(0);
|
|
4732
4762
|
ye(() => {
|
|
4733
4763
|
(async () => {
|
|
4734
4764
|
try {
|
|
4735
4765
|
m(!0), T(null), console.log("Loading appropriateness test for applicant:", e);
|
|
4736
|
-
const
|
|
4737
|
-
if (console.log("Appropriateness test data:",
|
|
4738
|
-
const Q = ne(
|
|
4766
|
+
const z = await a.getAppropriatenessTest(e);
|
|
4767
|
+
if (console.log("Appropriateness test data:", z), l(z), z.waitTimeSpanForNextTry && z.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4768
|
+
const Q = ne(z.waitTimeSpanForNextTry);
|
|
4739
4769
|
Q > 0 && V(Q);
|
|
4740
4770
|
}
|
|
4741
|
-
} catch (
|
|
4742
|
-
console.error("Error loading appropriateness test:",
|
|
4771
|
+
} catch (z) {
|
|
4772
|
+
console.error("Error loading appropriateness test:", z), T(z.message || "Failed to load appropriateness test");
|
|
4743
4773
|
} finally {
|
|
4744
4774
|
m(!1);
|
|
4745
4775
|
}
|
|
4746
4776
|
})();
|
|
4747
4777
|
}, [e, a]);
|
|
4748
4778
|
const ne = (_) => {
|
|
4749
|
-
const
|
|
4750
|
-
if (
|
|
4751
|
-
const [Q, te, oe] =
|
|
4779
|
+
const z = _.split(":").map(Number);
|
|
4780
|
+
if (z.length === 3) {
|
|
4781
|
+
const [Q, te, oe] = z;
|
|
4752
4782
|
return Q * 3600 + te * 60 + oe;
|
|
4753
4783
|
}
|
|
4754
4784
|
return 0;
|
|
4755
|
-
},
|
|
4756
|
-
const
|
|
4757
|
-
return `${
|
|
4785
|
+
}, E = (_) => {
|
|
4786
|
+
const z = Math.floor(_ / 60), Q = _ % 60;
|
|
4787
|
+
return `${z.toString().padStart(2, "0")}:${Q.toString().padStart(2, "0")}`;
|
|
4758
4788
|
};
|
|
4759
4789
|
ye(() => {
|
|
4760
|
-
if (!
|
|
4790
|
+
if (!C || f <= 0) return;
|
|
4761
4791
|
const _ = setInterval(() => {
|
|
4762
|
-
v((
|
|
4792
|
+
v((z) => z <= 1 ? (D(!0), 0) : z - 1);
|
|
4763
4793
|
}, 1e3);
|
|
4764
4794
|
return () => clearInterval(_);
|
|
4765
|
-
}, [
|
|
4795
|
+
}, [C, f]), ye(() => {
|
|
4766
4796
|
if (B <= 0) return;
|
|
4767
4797
|
const _ = setInterval(() => {
|
|
4768
|
-
V((
|
|
4798
|
+
V((z) => z <= 1 ? 0 : z - 1);
|
|
4769
4799
|
}, 1e3);
|
|
4770
4800
|
return () => clearInterval(_);
|
|
4771
4801
|
}, [B]), ye(() => {
|
|
@@ -4773,59 +4803,59 @@ const pn = ({
|
|
|
4773
4803
|
}, [H]);
|
|
4774
4804
|
const A = () => {
|
|
4775
4805
|
s && (U(!0), v(s.testDurationSec));
|
|
4776
|
-
}, W = (_,
|
|
4806
|
+
}, W = (_, z) => {
|
|
4777
4807
|
P((Q) => ({
|
|
4778
4808
|
...Q,
|
|
4779
|
-
[_]:
|
|
4809
|
+
[_]: z
|
|
4780
4810
|
}));
|
|
4781
4811
|
}, K = async (_) => {
|
|
4782
4812
|
if (_ && _.preventDefault(), !!s) {
|
|
4783
4813
|
if (!H) {
|
|
4784
|
-
const
|
|
4785
|
-
if (
|
|
4786
|
-
T(`Please answer all questions. ${
|
|
4814
|
+
const z = s.appropriatenessQuestions.length - Object.keys(F).length;
|
|
4815
|
+
if (z > 0) {
|
|
4816
|
+
T(`Please answer all questions. ${z} question(s) remaining.`);
|
|
4787
4817
|
return;
|
|
4788
4818
|
}
|
|
4789
4819
|
}
|
|
4790
4820
|
p(!0), T(null);
|
|
4791
4821
|
try {
|
|
4792
|
-
const
|
|
4822
|
+
const z = s.appropriatenessQuestions.map(
|
|
4793
4823
|
(te) => ({
|
|
4794
4824
|
appropriatenessQuestionId: te.id,
|
|
4795
|
-
value:
|
|
4825
|
+
value: F[te.id] || ""
|
|
4796
4826
|
// Empty string if not answered
|
|
4797
4827
|
})
|
|
4798
4828
|
), Q = {
|
|
4799
4829
|
applicantId: e,
|
|
4800
4830
|
appropriatenessTestId: s.id,
|
|
4801
|
-
appropriatenessQuestionResults:
|
|
4831
|
+
appropriatenessQuestionResults: z
|
|
4802
4832
|
};
|
|
4803
4833
|
console.log("Submitting appropriateness test:", Q);
|
|
4804
4834
|
try {
|
|
4805
4835
|
const te = await a.fillAppropriatenessTest(Q);
|
|
4806
|
-
console.log("Appropriateness test result:", te), te.message && (te.message.toLowerCase().includes("pass") || te.message.toLowerCase().includes("success") || te.message.toLowerCase().includes("congratulations")) ? t == null || t() : (T(te.message || "Test completed. Please check the result."), U(!1),
|
|
4836
|
+
console.log("Appropriateness test result:", te), te.message && (te.message.toLowerCase().includes("pass") || te.message.toLowerCase().includes("success") || te.message.toLowerCase().includes("congratulations")) ? t == null || t() : (T(te.message || "Test completed. Please check the result."), U(!1), D(!1), P({}), setTimeout(() => $(), 1e3));
|
|
4807
4837
|
} catch (te) {
|
|
4808
4838
|
if (te.code === 400 && te.message) {
|
|
4809
4839
|
const oe = te.message;
|
|
4810
|
-
console.log("Test failed:", oe), T(oe), U(!1),
|
|
4840
|
+
console.log("Test failed:", oe), T(oe), U(!1), D(!1), P({}), setTimeout(() => $(), 1500);
|
|
4811
4841
|
} else
|
|
4812
4842
|
throw te;
|
|
4813
4843
|
}
|
|
4814
|
-
} catch (
|
|
4815
|
-
console.error("Error submitting appropriateness test:",
|
|
4844
|
+
} catch (z) {
|
|
4845
|
+
console.error("Error submitting appropriateness test:", z), T(z.message || "Failed to submit test. Please try again."), U(!1), D(!1), P({});
|
|
4816
4846
|
} finally {
|
|
4817
4847
|
p(!1);
|
|
4818
4848
|
}
|
|
4819
4849
|
}
|
|
4820
|
-
},
|
|
4850
|
+
}, $ = async () => {
|
|
4821
4851
|
try {
|
|
4822
4852
|
const _ = await a.getAppropriatenessTest(e);
|
|
4823
4853
|
if (console.log("Reloaded test data:", _), l(_), _.waitTimeSpanForNextTry && _.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4824
|
-
const
|
|
4825
|
-
|
|
4854
|
+
const z = ne(_.waitTimeSpanForNextTry);
|
|
4855
|
+
z > 0 && V(z);
|
|
4826
4856
|
}
|
|
4827
4857
|
} catch (_) {
|
|
4828
|
-
console.error("Error reloading test data:", _), T((
|
|
4858
|
+
console.error("Error reloading test data:", _), T((z) => z + `
|
|
4829
4859
|
|
|
4830
4860
|
Failed to reload test data. Please refresh the page.`);
|
|
4831
4861
|
}
|
|
@@ -4848,14 +4878,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4848
4878
|
] }),
|
|
4849
4879
|
/* @__PURE__ */ i(Z, { className: "py-12 text-center", children: [
|
|
4850
4880
|
/* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
4851
|
-
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
4881
|
+
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: E(B) }),
|
|
4852
4882
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4853
4883
|
] }),
|
|
4854
4884
|
S && /* @__PURE__ */ r("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400 text-sm", children: S }) })
|
|
4855
4885
|
] })
|
|
4856
4886
|
] });
|
|
4857
4887
|
const O = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4858
|
-
return
|
|
4888
|
+
return C ? /* @__PURE__ */ r("form", { onSubmit: K, children: /* @__PURE__ */ i(J, { children: [
|
|
4859
4889
|
/* @__PURE__ */ r(ve, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4860
4890
|
/* @__PURE__ */ i("div", { children: [
|
|
4861
4891
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
@@ -4866,7 +4896,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4866
4896
|
"div",
|
|
4867
4897
|
{
|
|
4868
4898
|
className: `text-3xl font-bold ${f <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4869
|
-
children:
|
|
4899
|
+
children: E(f)
|
|
4870
4900
|
}
|
|
4871
4901
|
),
|
|
4872
4902
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -4876,7 +4906,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4876
4906
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4877
4907
|
/* @__PURE__ */ i(Ke, { variant: "info", children: [
|
|
4878
4908
|
"Question ",
|
|
4879
|
-
Object.keys(
|
|
4909
|
+
Object.keys(F).length,
|
|
4880
4910
|
" of ",
|
|
4881
4911
|
s.totalQuestionCount
|
|
4882
4912
|
] }),
|
|
@@ -4887,7 +4917,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4887
4917
|
" remaining"
|
|
4888
4918
|
] })
|
|
4889
4919
|
] }),
|
|
4890
|
-
s.appropriatenessQuestions.map((_,
|
|
4920
|
+
s.appropriatenessQuestions.map((_, z) => /* @__PURE__ */ i(
|
|
4891
4921
|
"div",
|
|
4892
4922
|
{
|
|
4893
4923
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -4895,7 +4925,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4895
4925
|
/* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
4896
4926
|
/* @__PURE__ */ i("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
|
|
4897
4927
|
"Question ",
|
|
4898
|
-
|
|
4928
|
+
z + 1
|
|
4899
4929
|
] }),
|
|
4900
4930
|
_.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: _.groupName }),
|
|
4901
4931
|
/* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: _.question })
|
|
@@ -4905,7 +4935,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4905
4935
|
{
|
|
4906
4936
|
className: `
|
|
4907
4937
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
4908
|
-
${
|
|
4938
|
+
${F[_.id] === Q ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
4909
4939
|
`,
|
|
4910
4940
|
children: [
|
|
4911
4941
|
/* @__PURE__ */ r(
|
|
@@ -4914,7 +4944,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4914
4944
|
type: "radio",
|
|
4915
4945
|
name: `question-${_.id}`,
|
|
4916
4946
|
value: Q,
|
|
4917
|
-
checked:
|
|
4947
|
+
checked: F[_.id] === Q,
|
|
4918
4948
|
onChange: (oe) => W(_.id, oe.target.value),
|
|
4919
4949
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4920
4950
|
disabled: y
|
|
@@ -4955,7 +4985,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4955
4985
|
{
|
|
4956
4986
|
type: "submit",
|
|
4957
4987
|
isLoading: y,
|
|
4958
|
-
disabled: Object.keys(
|
|
4988
|
+
disabled: Object.keys(F).length < s.totalQuestionCount,
|
|
4959
4989
|
children: H ? "Submitting..." : "Submit Test"
|
|
4960
4990
|
}
|
|
4961
4991
|
)
|
|
@@ -4974,7 +5004,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4974
5004
|
] }),
|
|
4975
5005
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4976
5006
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4977
|
-
/* @__PURE__ */ r(Ke, { variant: "info", children:
|
|
5007
|
+
/* @__PURE__ */ r(Ke, { variant: "info", children: E(s.testDurationSec) })
|
|
4978
5008
|
] }),
|
|
4979
5009
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4980
5010
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
@@ -5011,7 +5041,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5011
5041
|
onBack: n
|
|
5012
5042
|
}) => {
|
|
5013
5043
|
var Me, Xe, je, We;
|
|
5014
|
-
const { applicantService: a, baseInformationService: s, config: l, currentTheme: d } = Fe(), { identityData: m, provider: y, token: p, isLoading: S, error: T, requestIdentity:
|
|
5044
|
+
const { applicantService: a, baseInformationService: s, config: l, currentTheme: d } = Fe(), { identityData: m, provider: y, token: p, isLoading: S, error: T, requestIdentity: F, restartIdentity: P } = Br(e), [f, v] = w(null), [C, U] = w(null), [H, D] = w([]), [B, V] = w([]), [ne, E] = w(!0), [A, W] = w(!1), [K, $] = w(null), [O, _] = w(!1), z = Ae.useRef(!1), [Q, te] = w({}), [oe, L] = w({}), q = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, re = !!(d != null && d.reviewPageDisabled), fe = ce(!1);
|
|
5015
5045
|
fe.current = re;
|
|
5016
5046
|
const de = jt({
|
|
5017
5047
|
defaultValues: {
|
|
@@ -5026,7 +5056,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5026
5056
|
});
|
|
5027
5057
|
ye(() => {
|
|
5028
5058
|
if (re) {
|
|
5029
|
-
|
|
5059
|
+
z.current || (z.current = !0, F().then(() => W(!0)).catch((j) => console.error("[Identity] Auto-request failed:", j)).finally(() => E(!1)));
|
|
5030
5060
|
return;
|
|
5031
5061
|
}
|
|
5032
5062
|
(async () => {
|
|
@@ -5038,8 +5068,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5038
5068
|
// CountriesType.PhoneNumber
|
|
5039
5069
|
]);
|
|
5040
5070
|
U(j);
|
|
5041
|
-
const x = /* @__PURE__ */ new Set(),
|
|
5042
|
-
|
|
5071
|
+
const x = /* @__PURE__ */ new Set(), I = Y.map((h) => ({ value: h.abbreviation3 || h.abbreviation, label: h.name })).filter((h) => !h.value || x.has(h.value) ? !1 : (x.add(h.value), !0));
|
|
5072
|
+
D(I);
|
|
5043
5073
|
const b = /* @__PURE__ */ new Set(), o = u.filter((h) => h.countryCode).map((h) => ({ value: h.countryCode, label: `${h.countryCode} – ${h.name}` })).filter((h) => b.has(h.value) ? !1 : (b.add(h.value), !0));
|
|
5044
5074
|
V(o);
|
|
5045
5075
|
const c = j.applicantRequestData;
|
|
@@ -5073,10 +5103,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5073
5103
|
country: (c == null ? void 0 : c.country) || "",
|
|
5074
5104
|
nationality: (c == null ? void 0 : c.nationality) || "",
|
|
5075
5105
|
phonenumber: (c == null ? void 0 : c.phonenumber) || ""
|
|
5076
|
-
}), j.kycRecords && j.kycRecords.length > 0 && j.kycRecords[0].providerTokenObject !== null &&
|
|
5077
|
-
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."),
|
|
5106
|
+
}), j.kycRecords && j.kycRecords.length > 0 && j.kycRecords[0].providerTokenObject !== null && !z.current && fe.current) {
|
|
5107
|
+
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), z.current = !0;
|
|
5078
5108
|
try {
|
|
5079
|
-
await
|
|
5109
|
+
await F(), W(!0);
|
|
5080
5110
|
} catch (h) {
|
|
5081
5111
|
console.error("[Identity] Auto-request failed:", h);
|
|
5082
5112
|
}
|
|
@@ -5084,7 +5114,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5084
5114
|
} catch (j) {
|
|
5085
5115
|
console.error("Error loading applicant data:", j);
|
|
5086
5116
|
} finally {
|
|
5087
|
-
|
|
5117
|
+
E(!1);
|
|
5088
5118
|
}
|
|
5089
5119
|
})();
|
|
5090
5120
|
}, [e]), ye(() => {
|
|
@@ -5094,7 +5124,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5094
5124
|
if (p.expiresAt) {
|
|
5095
5125
|
const g = new Date(p.expiresAt).getTime();
|
|
5096
5126
|
if (Date.now() >= g) {
|
|
5097
|
-
console.warn("[Identity] Token has expired (expiresAt)"), _(!0),
|
|
5127
|
+
console.warn("[Identity] Token has expired (expiresAt)"), _(!0), $("Your verification session has expired. Please restart.");
|
|
5098
5128
|
return;
|
|
5099
5129
|
}
|
|
5100
5130
|
}
|
|
@@ -5102,14 +5132,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5102
5132
|
try {
|
|
5103
5133
|
const j = new URL(p.url).toString().toLowerCase();
|
|
5104
5134
|
if (j.includes("expired") || j.includes("invalid") || j.includes("error")) {
|
|
5105
|
-
console.warn("[Identity] Token URL indicates expiration"), _(!0),
|
|
5135
|
+
console.warn("[Identity] Token URL indicates expiration"), _(!0), $("Your verification link has expired. Please restart.");
|
|
5106
5136
|
return;
|
|
5107
5137
|
}
|
|
5108
5138
|
} catch {
|
|
5109
5139
|
console.error("[Identity] Invalid token URL");
|
|
5110
5140
|
}
|
|
5111
5141
|
if (p.status === "expired" || p.error === "expired" || p.expired === !0) {
|
|
5112
|
-
console.warn("[Identity] Token object indicates expiration"), _(!0),
|
|
5142
|
+
console.warn("[Identity] Token object indicates expiration"), _(!0), $("Your verification session has expired. Please restart.");
|
|
5113
5143
|
return;
|
|
5114
5144
|
}
|
|
5115
5145
|
}
|
|
@@ -5117,7 +5147,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5117
5147
|
if (y !== null && p && !f && A && !O) {
|
|
5118
5148
|
const g = y;
|
|
5119
5149
|
if (p.url) {
|
|
5120
|
-
console.log("[Identity] Loading provider URL for user verification:", p.url),
|
|
5150
|
+
console.log("[Identity] Loading provider URL for user verification:", p.url), $(null);
|
|
5121
5151
|
try {
|
|
5122
5152
|
if (new URL(p.url), g === Le.SardinAI) {
|
|
5123
5153
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
@@ -5134,12 +5164,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5134
5164
|
}
|
|
5135
5165
|
v({ type: "url", url: p.url });
|
|
5136
5166
|
} catch (j) {
|
|
5137
|
-
console.error("[Identity] Invalid URL:", j),
|
|
5167
|
+
console.error("[Identity] Invalid URL:", j), $("Invalid verification URL. Please restart."), _(!0);
|
|
5138
5168
|
}
|
|
5139
5169
|
return;
|
|
5140
5170
|
}
|
|
5141
5171
|
if (g === Le.SardinAI) {
|
|
5142
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
5172
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), $(null);
|
|
5143
5173
|
try {
|
|
5144
5174
|
const j = tt.parseProviderConfig(y, p, l), Y = tt.createProvider(y, j);
|
|
5145
5175
|
Y.initialize().then(() => {
|
|
@@ -5147,29 +5177,29 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5147
5177
|
t == null || t();
|
|
5148
5178
|
}, 2e3);
|
|
5149
5179
|
}).catch((u) => {
|
|
5150
|
-
var
|
|
5180
|
+
var I;
|
|
5151
5181
|
console.error("[SardinAI] Failed to initialize:", u);
|
|
5152
|
-
const x = ((
|
|
5153
|
-
x.includes("expired") || x.includes("invalid") || x.includes("401") || x.includes("400") ? (_(!0),
|
|
5182
|
+
const x = ((I = u.message) == null ? void 0 : I.toLowerCase()) || "";
|
|
5183
|
+
x.includes("expired") || x.includes("invalid") || x.includes("401") || x.includes("400") ? (_(!0), $("Session expired or invalid. Please restart verification.")) : $(`Failed to initialize: ${u.message}`);
|
|
5154
5184
|
});
|
|
5155
5185
|
} catch (j) {
|
|
5156
|
-
console.error("[SardinAI] Error creating provider:", j),
|
|
5186
|
+
console.error("[SardinAI] Error creating provider:", j), $(`Configuration error: ${j.message}`);
|
|
5157
5187
|
}
|
|
5158
5188
|
return;
|
|
5159
5189
|
}
|
|
5160
5190
|
try {
|
|
5161
|
-
|
|
5191
|
+
$(null);
|
|
5162
5192
|
const j = tt.parseProviderConfig(y, p, l), Y = tt.createProvider(y, j);
|
|
5163
5193
|
g === Le.Sumsub ? (Y.initialize("identity-container").catch((u) => {
|
|
5164
5194
|
var x;
|
|
5165
|
-
console.error("[Sumsub] Initialization error:", u),
|
|
5195
|
+
console.error("[Sumsub] Initialization error:", u), $(`Failed to initialize: ${u.message}`), (x = u.message) != null && x.toLowerCase().includes("expired") && _(!0);
|
|
5166
5196
|
}), Y.onComplete && Y.onComplete(() => {
|
|
5167
5197
|
t == null || t();
|
|
5168
5198
|
})) : g === Le.Onfido && Y.initialize("identity-container").catch((u) => {
|
|
5169
|
-
console.error("[Onfido] Initialization error:", u),
|
|
5199
|
+
console.error("[Onfido] Initialization error:", u), $(`Failed to initialize: ${u.message}`);
|
|
5170
5200
|
}), v(Y);
|
|
5171
5201
|
} catch (j) {
|
|
5172
|
-
console.error("[Identity] Provider setup error:", j),
|
|
5202
|
+
console.error("[Identity] Provider setup error:", j), $(`Setup error: ${j.message}`);
|
|
5173
5203
|
}
|
|
5174
5204
|
}
|
|
5175
5205
|
return () => {
|
|
@@ -5181,17 +5211,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5181
5211
|
}
|
|
5182
5212
|
};
|
|
5183
5213
|
}, [y, p, f, A, t, O]);
|
|
5184
|
-
const
|
|
5214
|
+
const M = async () => {
|
|
5185
5215
|
try {
|
|
5186
|
-
|
|
5216
|
+
$(null), _(!1), await F(), W(!0);
|
|
5187
5217
|
} catch (g) {
|
|
5188
5218
|
console.error("Error starting identity verification:", g);
|
|
5189
5219
|
}
|
|
5190
5220
|
}, G = async () => {
|
|
5191
5221
|
try {
|
|
5192
|
-
|
|
5222
|
+
$(null), _(!1), v(null), console.log("[Identity] Restarting verification..."), await P(), W(!0);
|
|
5193
5223
|
} catch (g) {
|
|
5194
|
-
console.error("Error restarting identity verification:", g),
|
|
5224
|
+
console.error("Error restarting identity verification:", g), $(g.message || "Failed to restart verification");
|
|
5195
5225
|
}
|
|
5196
5226
|
};
|
|
5197
5227
|
if (ne || S)
|
|
@@ -5282,10 +5312,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5282
5312
|
var Y, u, x;
|
|
5283
5313
|
console.log("[Identity] Iframe loaded");
|
|
5284
5314
|
try {
|
|
5285
|
-
const
|
|
5315
|
+
const I = j.target, b = I.contentDocument || ((Y = I.contentWindow) == null ? void 0 : Y.document);
|
|
5286
5316
|
if (b) {
|
|
5287
5317
|
const o = ((x = (u = b.body) == null ? void 0 : u.textContent) == null ? void 0 : x.toLowerCase()) || "";
|
|
5288
|
-
(o.includes("expired") || o.includes("invalid") || o.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), _(!0),
|
|
5318
|
+
(o.includes("expired") || o.includes("invalid") || o.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), _(!0), $("Your verification link has expired."));
|
|
5289
5319
|
}
|
|
5290
5320
|
} catch {
|
|
5291
5321
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -5456,14 +5486,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5456
5486
|
g.helpText
|
|
5457
5487
|
) }, Y);
|
|
5458
5488
|
if (g.customType === "checkbox" || g.customType === "link_checkbox") {
|
|
5459
|
-
const
|
|
5489
|
+
const I = x === "true" || x === !0;
|
|
5460
5490
|
return /* @__PURE__ */ r("div", { className: ue(g.colSpan), children: be(
|
|
5461
5491
|
/* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5462
5492
|
/* @__PURE__ */ r(
|
|
5463
5493
|
"input",
|
|
5464
5494
|
{
|
|
5465
5495
|
type: "checkbox",
|
|
5466
|
-
checked: !!
|
|
5496
|
+
checked: !!I,
|
|
5467
5497
|
onChange: (b) => L((o) => ({ ...o, [u]: String(b.target.checked) })),
|
|
5468
5498
|
style: {
|
|
5469
5499
|
width: 16,
|
|
@@ -5483,10 +5513,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5483
5513
|
) }, Y);
|
|
5484
5514
|
}
|
|
5485
5515
|
if (g.customType === "group_checkbox") {
|
|
5486
|
-
const
|
|
5487
|
-
g.singleSelect ? L((c) => ({ ...c, [u]:
|
|
5516
|
+
const I = Array.isArray(x) ? x : x ? [x] : [], b = (o) => {
|
|
5517
|
+
g.singleSelect ? L((c) => ({ ...c, [u]: I[0] === o ? [] : [o] })) : L((c) => ({
|
|
5488
5518
|
...c,
|
|
5489
|
-
[u]:
|
|
5519
|
+
[u]: I.includes(o) ? I.filter((R) => R !== o) : [...I, o]
|
|
5490
5520
|
}));
|
|
5491
5521
|
};
|
|
5492
5522
|
return /* @__PURE__ */ r("div", { className: ue(g.colSpan), children: be(
|
|
@@ -5497,7 +5527,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5497
5527
|
"input",
|
|
5498
5528
|
{
|
|
5499
5529
|
type: "checkbox",
|
|
5500
|
-
checked:
|
|
5530
|
+
checked: I.includes(o.value),
|
|
5501
5531
|
onChange: () => b(o.value),
|
|
5502
5532
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5503
5533
|
}
|
|
@@ -5511,20 +5541,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5511
5541
|
return g.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: ue(g.colSpan), children: be(
|
|
5512
5542
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
5513
5543
|
g.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.displayText || g.label }),
|
|
5514
|
-
(g.options || []).map((
|
|
5544
|
+
(g.options || []).map((I) => /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5515
5545
|
/* @__PURE__ */ r(
|
|
5516
5546
|
"input",
|
|
5517
5547
|
{
|
|
5518
5548
|
type: "radio",
|
|
5519
5549
|
name: `rg-${u}`,
|
|
5520
|
-
value:
|
|
5521
|
-
checked: x ===
|
|
5522
|
-
onChange: () => L((b) => ({ ...b, [u]:
|
|
5550
|
+
value: I.value,
|
|
5551
|
+
checked: x === I.value,
|
|
5552
|
+
onChange: () => L((b) => ({ ...b, [u]: I.value })),
|
|
5523
5553
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5524
5554
|
}
|
|
5525
5555
|
),
|
|
5526
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5527
|
-
] },
|
|
5556
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: I.label })
|
|
5557
|
+
] }, I.value))
|
|
5528
5558
|
] }),
|
|
5529
5559
|
g.helpText
|
|
5530
5560
|
) }, Y) : /* @__PURE__ */ r("div", { className: ue(g.colSpan), children: be(
|
|
@@ -5533,20 +5563,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5533
5563
|
{
|
|
5534
5564
|
label: g.displayText || g.label || u,
|
|
5535
5565
|
value: String(x ?? ""),
|
|
5536
|
-
onChange: (
|
|
5566
|
+
onChange: (I) => L((b) => ({ ...b, [u]: I.target.value }))
|
|
5537
5567
|
}
|
|
5538
5568
|
),
|
|
5539
5569
|
g.helpText
|
|
5540
5570
|
) }, Y);
|
|
5541
5571
|
}, Ze = (g, j) => {
|
|
5542
5572
|
if (g.isCustom) return Je(g, j);
|
|
5543
|
-
const Y = g.name ?? "", u = Ge[Y], x = g.displayText || (u == null ? void 0 : u.label) || Y,
|
|
5573
|
+
const Y = g.name ?? "", u = Ge[Y], x = g.displayText || (u == null ? void 0 : u.label) || Y, I = Q[Y] ?? "", b = Y === "mobileCountryCode", o = !!(u != null && u.countriesType) && !b;
|
|
5544
5574
|
return g.editable ? b ? /* @__PURE__ */ r("div", { className: ue(g.colSpan ?? 2), children: be(
|
|
5545
5575
|
/* @__PURE__ */ r(
|
|
5546
5576
|
Be,
|
|
5547
5577
|
{
|
|
5548
5578
|
label: x,
|
|
5549
|
-
value: String(
|
|
5579
|
+
value: String(I),
|
|
5550
5580
|
onChange: (c) => te((R) => ({ ...R, [Y]: c })),
|
|
5551
5581
|
options: [{ value: "", label: "Select country code…" }, ...B]
|
|
5552
5582
|
}
|
|
@@ -5557,7 +5587,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5557
5587
|
Be,
|
|
5558
5588
|
{
|
|
5559
5589
|
label: x,
|
|
5560
|
-
value: String(
|
|
5590
|
+
value: String(I),
|
|
5561
5591
|
onChange: (c) => te((R) => ({ ...R, [Y]: c })),
|
|
5562
5592
|
options: [{ value: "", label: `Select ${x.toLowerCase()}…` }, ...H]
|
|
5563
5593
|
}
|
|
@@ -5569,7 +5599,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5569
5599
|
{
|
|
5570
5600
|
label: x,
|
|
5571
5601
|
type: (u == null ? void 0 : u.type) === "date" ? "date" : (u == null ? void 0 : u.type) === "email" ? "email" : "text",
|
|
5572
|
-
value: String(
|
|
5602
|
+
value: String(I),
|
|
5573
5603
|
onChange: (c) => te((R) => ({ ...R, [Y]: c.target.value }))
|
|
5574
5604
|
}
|
|
5575
5605
|
),
|
|
@@ -5577,7 +5607,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5577
5607
|
) }, `ei-${j}`) : /* @__PURE__ */ r("div", { className: ue(g.colSpan ?? 2), children: be(
|
|
5578
5608
|
/* @__PURE__ */ i(ot, { children: [
|
|
5579
5609
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: x }),
|
|
5580
|
-
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: we(Y,
|
|
5610
|
+
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: we(Y, I) })
|
|
5581
5611
|
] }),
|
|
5582
5612
|
g.helpText
|
|
5583
5613
|
) }, `ro-${j}`);
|
|
@@ -5585,7 +5615,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5585
5615
|
if (q) {
|
|
5586
5616
|
const g = q.title || "Review Your Information", j = q.subtitle || "Please review and confirm your information before starting identity verification";
|
|
5587
5617
|
return /* @__PURE__ */ r("form", { onSubmit: (Y) => {
|
|
5588
|
-
Y.preventDefault(),
|
|
5618
|
+
Y.preventDefault(), M();
|
|
5589
5619
|
}, children: /* @__PURE__ */ i(J, { children: [
|
|
5590
5620
|
/* @__PURE__ */ i(ve, { children: [
|
|
5591
5621
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g }),
|
|
@@ -5598,16 +5628,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5598
5628
|
] })
|
|
5599
5629
|
] }) });
|
|
5600
5630
|
}
|
|
5601
|
-
return /* @__PURE__ */ r("form", { onSubmit: de.handleSubmit(
|
|
5631
|
+
return /* @__PURE__ */ r("form", { onSubmit: de.handleSubmit(M), children: /* @__PURE__ */ i(J, { children: [
|
|
5602
5632
|
/* @__PURE__ */ i(ve, { children: [
|
|
5603
5633
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
|
|
5604
5634
|
/* @__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" })
|
|
5605
5635
|
] }),
|
|
5606
5636
|
/* @__PURE__ */ i(Z, { className: "space-y-6", children: [
|
|
5607
5637
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
5608
|
-
{ label: "Name", value: `${((Me =
|
|
5609
|
-
{ label: "Email", value: (je =
|
|
5610
|
-
{ label: "Date of Birth", value: ((We =
|
|
5638
|
+
{ label: "Name", value: `${((Me = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : Me.firstName) || ""} ${((Xe = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : Xe.lastName) || ""}`.trim() },
|
|
5639
|
+
{ label: "Email", value: (je = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : je.email },
|
|
5640
|
+
{ label: "Date of Birth", value: ((We = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : We.dateOfBirth) || "Not provided" }
|
|
5611
5641
|
].map(({ label: g, value: j }) => /* @__PURE__ */ i("div", { children: [
|
|
5612
5642
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g }),
|
|
5613
5643
|
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: j })
|
|
@@ -5985,22 +6015,22 @@ const st = {
|
|
|
5985
6015
|
),
|
|
5986
6016
|
typeof document < "u" && s ? gt(s, document.body) : null
|
|
5987
6017
|
] });
|
|
5988
|
-
},
|
|
6018
|
+
}, zn = ({
|
|
5989
6019
|
workflowKey: e,
|
|
5990
6020
|
externalRefId: t,
|
|
5991
6021
|
onSuccess: n,
|
|
5992
6022
|
onCancel: a
|
|
5993
6023
|
}) => {
|
|
5994
|
-
var j, Y, u, x,
|
|
6024
|
+
var j, Y, u, x, I, b;
|
|
5995
6025
|
const { config: s, baseInformationService: l, currentTheme: d } = Fe(), { createApplicant: m, isLoading: y } = Rt(), p = e || ((j = s.applicantForm) == null ? void 0 : j.workflowKey);
|
|
5996
6026
|
if (!p)
|
|
5997
6027
|
throw new Error(
|
|
5998
6028
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
5999
6029
|
);
|
|
6000
|
-
const S = t || ((Y = s.applicantForm) == null ? void 0 : Y.externalRefId) || "", T = ((u = s.applicantForm) == null ? void 0 : u.email) || "",
|
|
6030
|
+
const S = t || ((Y = s.applicantForm) == null ? void 0 : Y.externalRefId) || "", T = ((u = s.applicantForm) == null ? void 0 : u.email) || "", F = ((x = s.applicantForm) == null ? void 0 : x.hiddenValues) || {}, f = (((I = s.applicantForm) == null ? void 0 : I.fieldLabelMode) || (d == null ? void 0 : d.fieldLabelMode) || "label") !== "placeholder", v = Re(
|
|
6001
6031
|
() => d != null && d.applicantFormPages && d.applicantFormPages.length > 0 ? d.applicantFormPages : null,
|
|
6002
6032
|
[d == null ? void 0 : d.applicantFormPages]
|
|
6003
|
-
),
|
|
6033
|
+
), C = Re(() => {
|
|
6004
6034
|
const o = new Set(dt), c = d == null ? void 0 : d.applicantFormRequiredFields;
|
|
6005
6035
|
if (c) for (const R of c) o.add(R);
|
|
6006
6036
|
if (v)
|
|
@@ -6027,7 +6057,7 @@ const st = {
|
|
|
6027
6057
|
"countryOfBirth",
|
|
6028
6058
|
"mobileCountryCode",
|
|
6029
6059
|
"otherNationality"
|
|
6030
|
-
]),
|
|
6060
|
+
]), D = Re(() => {
|
|
6031
6061
|
var c, R;
|
|
6032
6062
|
const o = /* @__PURE__ */ new Set();
|
|
6033
6063
|
if (v)
|
|
@@ -6038,21 +6068,21 @@ const st = {
|
|
|
6038
6068
|
for (const h of U)
|
|
6039
6069
|
H.has(h) && o.add((R = Ge[h]) == null ? void 0 : R.countriesType);
|
|
6040
6070
|
return o.size === 0 && o.add(void 0), Array.from(o);
|
|
6041
|
-
}, [U, v]), [B, V] = w({}), [ne,
|
|
6071
|
+
}, [U, v]), [B, V] = w({}), [ne, E] = w(!0), A = ce(/* @__PURE__ */ new Set()), W = ce(/* @__PURE__ */ new Set());
|
|
6042
6072
|
ye(() => {
|
|
6043
6073
|
if (!d) return;
|
|
6044
|
-
const o =
|
|
6074
|
+
const o = D.filter((h) => {
|
|
6045
6075
|
const N = h != null ? String(h) : "all";
|
|
6046
6076
|
return !W.current.has(N) && !A.current.has(N);
|
|
6047
6077
|
});
|
|
6048
6078
|
if (o.length === 0) {
|
|
6049
|
-
|
|
6079
|
+
D.every((N) => {
|
|
6050
6080
|
const k = N != null ? String(N) : "all";
|
|
6051
6081
|
return W.current.has(k);
|
|
6052
|
-
}) &&
|
|
6082
|
+
}) && E(!1);
|
|
6053
6083
|
return;
|
|
6054
6084
|
}
|
|
6055
|
-
|
|
6085
|
+
E(!0);
|
|
6056
6086
|
const c = o.map((h) => h != null ? String(h) : "all");
|
|
6057
6087
|
c.forEach((h) => A.current.add(h)), (async () => {
|
|
6058
6088
|
try {
|
|
@@ -6069,19 +6099,19 @@ const st = {
|
|
|
6069
6099
|
} catch (h) {
|
|
6070
6100
|
c.forEach((N) => A.current.delete(N)), console.error("Failed to load countries:", h);
|
|
6071
6101
|
} finally {
|
|
6072
|
-
|
|
6102
|
+
D.every((N) => {
|
|
6073
6103
|
const k = N != null ? String(N) : "all";
|
|
6074
6104
|
return W.current.has(k);
|
|
6075
|
-
}) &&
|
|
6105
|
+
}) && E(!1);
|
|
6076
6106
|
}
|
|
6077
6107
|
})();
|
|
6078
|
-
}, [
|
|
6108
|
+
}, [D, d]);
|
|
6079
6109
|
const K = (o, c) => {
|
|
6080
6110
|
var N;
|
|
6081
6111
|
const R = c ?? ((N = Ge[o]) == null ? void 0 : N.countriesType), h = R != null ? String(R) : "all";
|
|
6082
6112
|
return B[h] || [];
|
|
6083
|
-
},
|
|
6084
|
-
Object.entries(
|
|
6113
|
+
}, $ = Object.fromEntries(
|
|
6114
|
+
Object.entries(F).filter(([o]) => o in {
|
|
6085
6115
|
firstName: 1,
|
|
6086
6116
|
lastName: 1,
|
|
6087
6117
|
title: 1,
|
|
@@ -6130,10 +6160,10 @@ const st = {
|
|
|
6130
6160
|
educationLevel: "",
|
|
6131
6161
|
occupation: "",
|
|
6132
6162
|
taxNumber: "",
|
|
6133
|
-
|
|
6134
|
-
}),
|
|
6135
|
-
Object.entries(
|
|
6136
|
-
), [Q, te] = w({
|
|
6163
|
+
...$
|
|
6164
|
+
}), z = Object.fromEntries(
|
|
6165
|
+
Object.entries(F).filter(([o]) => !(o in $) && o !== "externalRefId" && o !== "workflowKey")
|
|
6166
|
+
), [Q, te] = w({ ...z }), [oe, L] = w(0), [q, re] = w({}), [fe, de] = w(null), [M, G] = w(!1), ae = (o, c) => _((R) => ({ ...R, [o]: c })), ue = (o, c) => te((R) => ({ ...R, [o]: c })), we = (o) => !o.conditionalOn || Q[o.conditionalOn] === "true", De = v && oe < v.length - 1 ? oe + 1 : -1, be = v && oe > 0 ? oe - 1 : -1, Je = (o) => {
|
|
6137
6167
|
var R;
|
|
6138
6168
|
const c = {};
|
|
6139
6169
|
for (const h of o.fields)
|
|
@@ -6145,7 +6175,7 @@ const st = {
|
|
|
6145
6175
|
}
|
|
6146
6176
|
} else if (h.name) {
|
|
6147
6177
|
const N = h.name;
|
|
6148
|
-
if (
|
|
6178
|
+
if (C.includes(N) && rt(O[N])) {
|
|
6149
6179
|
const k = h.displayText || ((R = Ge[N]) == null ? void 0 : R.label) || N;
|
|
6150
6180
|
c[N] = `${k} is required.`;
|
|
6151
6181
|
}
|
|
@@ -6218,10 +6248,10 @@ const st = {
|
|
|
6218
6248
|
c.push({ paramName: k.paramName, value: ie });
|
|
6219
6249
|
}
|
|
6220
6250
|
}
|
|
6221
|
-
for (const [N, k] of Object.entries(
|
|
6251
|
+
for (const [N, k] of Object.entries($))
|
|
6222
6252
|
o[N] === void 0 && !rt(k) && (o[N] = k);
|
|
6223
6253
|
const R = new Set(c.map((N) => N.paramName));
|
|
6224
|
-
for (const [N, k] of Object.entries(
|
|
6254
|
+
for (const [N, k] of Object.entries(z))
|
|
6225
6255
|
!R.has(N) && k && c.push({ paramName: N, value: k });
|
|
6226
6256
|
c.length > 0 && (o.applicantAdditionalDatas = c);
|
|
6227
6257
|
const h = await m(o);
|
|
@@ -6234,7 +6264,7 @@ const st = {
|
|
|
6234
6264
|
}, Xe = async (o) => {
|
|
6235
6265
|
var c;
|
|
6236
6266
|
o.preventDefault();
|
|
6237
|
-
for (const R of
|
|
6267
|
+
for (const R of C)
|
|
6238
6268
|
if (rt(O[R])) {
|
|
6239
6269
|
const h = ((c = Ge[R]) == null ? void 0 : c.label) || R;
|
|
6240
6270
|
de(`${h} is required.`);
|
|
@@ -6245,7 +6275,7 @@ const st = {
|
|
|
6245
6275
|
var bt;
|
|
6246
6276
|
const k = Ge[o];
|
|
6247
6277
|
if (!k) return null;
|
|
6248
|
-
const le =
|
|
6278
|
+
const le = C.includes(o), ie = q[o], xe = R || k.label, he = c ?? o, me = { required: le }, Oe = N ? N !== "placeholder" : f, He = Oe ? xe : void 0, Dt = Oe ? "..." : xe;
|
|
6249
6279
|
switch (k.type) {
|
|
6250
6280
|
case "select":
|
|
6251
6281
|
if (o === "country" || o === "nationality" || o === "taxCountry" || o === "countryOfBirth" || o === "mobileCountryCode") {
|
|
@@ -6726,17 +6756,17 @@ const st = {
|
|
|
6726
6756
|
onClick: () => {
|
|
6727
6757
|
L(be), re({});
|
|
6728
6758
|
},
|
|
6729
|
-
disabled:
|
|
6759
|
+
disabled: M || y,
|
|
6730
6760
|
children: "Previous"
|
|
6731
6761
|
}
|
|
6732
6762
|
),
|
|
6733
|
-
c && a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled:
|
|
6763
|
+
c && a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: M || y, children: "Cancel" })
|
|
6734
6764
|
] }),
|
|
6735
6765
|
/* @__PURE__ */ r(
|
|
6736
6766
|
X,
|
|
6737
6767
|
{
|
|
6738
6768
|
type: "button",
|
|
6739
|
-
isLoading:
|
|
6769
|
+
isLoading: M || y,
|
|
6740
6770
|
onClick: R ? Me : Ze,
|
|
6741
6771
|
children: R ? o.conditionalOn && !N ? "Skip & Submit" : "Submit" : o.conditionalOn && !N ? "Skip" : "Next"
|
|
6742
6772
|
}
|
|
@@ -6755,15 +6785,15 @@ const st = {
|
|
|
6755
6785
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: U.map((o) => /* @__PURE__ */ r("div", { className: "col-span-4", children: je(o) }, o)) })
|
|
6756
6786
|
] }),
|
|
6757
6787
|
/* @__PURE__ */ i(ke, { className: "flex justify-between", children: [
|
|
6758
|
-
a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled:
|
|
6759
|
-
/* @__PURE__ */ r(X, { type: "submit", isLoading:
|
|
6788
|
+
a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: M || y, children: "Cancel" }),
|
|
6789
|
+
/* @__PURE__ */ r(X, { type: "submit", isLoading: M || y, children: "Create Applicant" })
|
|
6760
6790
|
] })
|
|
6761
6791
|
] }) }) });
|
|
6762
6792
|
}, It = ["companyName", "email"];
|
|
6763
6793
|
function yt(e) {
|
|
6764
6794
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
6765
6795
|
}
|
|
6766
|
-
const
|
|
6796
|
+
const $n = ({
|
|
6767
6797
|
workflowKey: e,
|
|
6768
6798
|
externalRefId: t,
|
|
6769
6799
|
onSuccess: n,
|
|
@@ -6780,37 +6810,37 @@ const zn = ({
|
|
|
6780
6810
|
[d == null ? void 0 : d.companyFormPages]
|
|
6781
6811
|
), v = Re(() => {
|
|
6782
6812
|
const u = new Set(It), x = d == null ? void 0 : d.companyFormRequiredFields;
|
|
6783
|
-
if (x) for (const
|
|
6813
|
+
if (x) for (const I of x) u.add(I);
|
|
6784
6814
|
if (f)
|
|
6785
|
-
for (const
|
|
6786
|
-
for (const b of
|
|
6815
|
+
for (const I of f)
|
|
6816
|
+
for (const b of I.fields)
|
|
6787
6817
|
!b.isCustom && b.name && b.required && u.add(b.name);
|
|
6788
6818
|
return Array.from(u);
|
|
6789
|
-
}, [d == null ? void 0 : d.companyFormRequiredFields, f]),
|
|
6819
|
+
}, [d == null ? void 0 : d.companyFormRequiredFields, f]), C = Re(() => {
|
|
6790
6820
|
var u;
|
|
6791
6821
|
if (f) {
|
|
6792
|
-
const x = f.flatMap((b) => b.fields).filter((b) => !b.isCustom && b.name).map((b) => b.name),
|
|
6793
|
-
for (const b of It)
|
|
6794
|
-
return Array.from(
|
|
6822
|
+
const x = f.flatMap((b) => b.fields).filter((b) => !b.isCustom && b.name).map((b) => b.name), I = new Set(x);
|
|
6823
|
+
for (const b of It) I.add(b);
|
|
6824
|
+
return Array.from(I);
|
|
6795
6825
|
}
|
|
6796
6826
|
return (u = s.applicantForm) != null && u.visibleFields ? s.applicantForm.visibleFields : d != null && d.companyFormVisibleFields && d.companyFormVisibleFields.length > 0 ? d.companyFormVisibleFields : Xt;
|
|
6797
6827
|
}, [(Y = s.applicantForm) == null ? void 0 : Y.visibleFields, d == null ? void 0 : d.companyFormVisibleFields, f]), U = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), H = Re(() => {
|
|
6798
|
-
var x,
|
|
6828
|
+
var x, I;
|
|
6799
6829
|
const u = /* @__PURE__ */ new Set();
|
|
6800
6830
|
if (f)
|
|
6801
6831
|
for (const b of f)
|
|
6802
6832
|
for (const o of b.fields)
|
|
6803
6833
|
!o.isCustom && o.name && U.has(o.name) && u.add(o.countriesType ?? ((x = et[o.name]) == null ? void 0 : x.countriesType));
|
|
6804
6834
|
else
|
|
6805
|
-
for (const b of
|
|
6806
|
-
U.has(b) && u.add((
|
|
6835
|
+
for (const b of C)
|
|
6836
|
+
U.has(b) && u.add((I = et[b]) == null ? void 0 : I.countriesType);
|
|
6807
6837
|
return u.size === 0 && u.add(void 0), Array.from(u);
|
|
6808
|
-
}, [
|
|
6838
|
+
}, [C, f]), [D, B] = w({}), [V, ne] = w(!0), E = ce(/* @__PURE__ */ new Set()), A = ce(/* @__PURE__ */ new Set());
|
|
6809
6839
|
ye(() => {
|
|
6810
6840
|
if (!d) return;
|
|
6811
6841
|
const u = H.filter((b) => {
|
|
6812
6842
|
const o = b != null ? String(b) : "all";
|
|
6813
|
-
return !A.current.has(o) && !
|
|
6843
|
+
return !A.current.has(o) && !E.current.has(o);
|
|
6814
6844
|
});
|
|
6815
6845
|
if (u.length === 0) {
|
|
6816
6846
|
H.every((o) => A.current.has(o != null ? String(o) : "all")) && ne(!1);
|
|
@@ -6818,17 +6848,17 @@ const zn = ({
|
|
|
6818
6848
|
}
|
|
6819
6849
|
ne(!0);
|
|
6820
6850
|
const x = u.map((b) => b != null ? String(b) : "all");
|
|
6821
|
-
x.forEach((b) =>
|
|
6851
|
+
x.forEach((b) => E.current.add(b)), (async () => {
|
|
6822
6852
|
try {
|
|
6823
6853
|
const b = await Promise.all(
|
|
6824
6854
|
u.map(async (o) => {
|
|
6825
6855
|
const c = o != null ? String(o) : "all", R = await l.getCountries("", s.locale || "en", o), h = /* @__PURE__ */ new Set(), N = R.map((k) => ({ value: k.abbreviation3 || k.abbreviation, label: k.name })).filter((k) => !k.value || h.has(k.value) ? !1 : (h.add(k.value), !0));
|
|
6826
|
-
return A.current.add(c),
|
|
6856
|
+
return A.current.add(c), E.current.delete(c), [c, N];
|
|
6827
6857
|
})
|
|
6828
6858
|
);
|
|
6829
6859
|
B((o) => ({ ...o, ...Object.fromEntries(b) }));
|
|
6830
6860
|
} catch (b) {
|
|
6831
|
-
x.forEach((o) =>
|
|
6861
|
+
x.forEach((o) => E.current.delete(o)), console.error("Failed to load countries:", b);
|
|
6832
6862
|
} finally {
|
|
6833
6863
|
H.every((o) => A.current.has(o != null ? String(o) : "all")) && ne(!1);
|
|
6834
6864
|
}
|
|
@@ -6836,9 +6866,9 @@ const zn = ({
|
|
|
6836
6866
|
}, [H, d]);
|
|
6837
6867
|
const W = (u, x) => {
|
|
6838
6868
|
var o;
|
|
6839
|
-
const
|
|
6840
|
-
return
|
|
6841
|
-
}, [K,
|
|
6869
|
+
const I = x ?? ((o = et[u]) == null ? void 0 : o.countriesType), b = I != null ? String(I) : "all";
|
|
6870
|
+
return D[b] || [];
|
|
6871
|
+
}, [K, $] = w({
|
|
6842
6872
|
workflowKey: p,
|
|
6843
6873
|
companyName: "",
|
|
6844
6874
|
email: T,
|
|
@@ -6860,8 +6890,8 @@ const zn = ({
|
|
|
6860
6890
|
addressCountry: "",
|
|
6861
6891
|
lei: "",
|
|
6862
6892
|
externalRefId: S
|
|
6863
|
-
}), [O, _] = w({}), [
|
|
6864
|
-
var
|
|
6893
|
+
}), [O, _] = w({}), [z, Q] = w(0), [te, oe] = w({}), [L, q] = w(null), [re, fe] = w(!1), de = (u, x) => $((I) => ({ ...I, [u]: x })), M = (u, x) => _((I) => ({ ...I, [u]: x })), G = (u) => !u.conditionalOn || O[u.conditionalOn] === "true", ae = f && z < f.length - 1 ? z + 1 : -1, ue = f && z > 0 ? z - 1 : -1, we = (u) => {
|
|
6894
|
+
var I;
|
|
6865
6895
|
const x = {};
|
|
6866
6896
|
for (const b of u.fields)
|
|
6867
6897
|
if (b.isCustom) {
|
|
@@ -6873,14 +6903,14 @@ const zn = ({
|
|
|
6873
6903
|
} else if (b.name) {
|
|
6874
6904
|
const o = b.name;
|
|
6875
6905
|
if (v.includes(o) && yt(K[o])) {
|
|
6876
|
-
const c = b.displayText || ((
|
|
6906
|
+
const c = b.displayText || ((I = et[o]) == null ? void 0 : I.label) || o;
|
|
6877
6907
|
x[o] = `${c} is required.`;
|
|
6878
6908
|
}
|
|
6879
6909
|
}
|
|
6880
6910
|
return x;
|
|
6881
6911
|
}, De = async () => {
|
|
6882
6912
|
if (!f) return;
|
|
6883
|
-
const u = f[
|
|
6913
|
+
const u = f[z];
|
|
6884
6914
|
if (u.conditionalOn && !G(u)) {
|
|
6885
6915
|
oe({}), ae >= 0 ? Q(ae) : await be();
|
|
6886
6916
|
return;
|
|
@@ -6895,8 +6925,8 @@ const zn = ({
|
|
|
6895
6925
|
var u;
|
|
6896
6926
|
if (f) {
|
|
6897
6927
|
let x = {};
|
|
6898
|
-
for (const
|
|
6899
|
-
G(
|
|
6928
|
+
for (const I of f)
|
|
6929
|
+
G(I) && (x = { ...x, ...we(I) });
|
|
6900
6930
|
if (Object.keys(x).length > 0) {
|
|
6901
6931
|
oe(x);
|
|
6902
6932
|
return;
|
|
@@ -6907,8 +6937,8 @@ const zn = ({
|
|
|
6907
6937
|
const x = {
|
|
6908
6938
|
workflowKey: K.workflowKey,
|
|
6909
6939
|
externalRefId: ((u = K.externalRefId) == null ? void 0 : u.trim()) || void 0
|
|
6910
|
-
},
|
|
6911
|
-
for (const c of
|
|
6940
|
+
}, I = f ? f.filter((c) => G(c)).flatMap((c) => c.fields).filter((c) => !c.isCustom && c.name).map((c) => c.name) : C;
|
|
6941
|
+
for (const c of I) {
|
|
6912
6942
|
const R = K[c];
|
|
6913
6943
|
if (!yt(R))
|
|
6914
6944
|
switch (c) {
|
|
@@ -6966,17 +6996,17 @@ const zn = ({
|
|
|
6966
6996
|
}, Je = async (u) => {
|
|
6967
6997
|
var x;
|
|
6968
6998
|
u.preventDefault();
|
|
6969
|
-
for (const
|
|
6970
|
-
if (yt(K[
|
|
6971
|
-
const b = ((x = et[
|
|
6999
|
+
for (const I of v)
|
|
7000
|
+
if (yt(K[I])) {
|
|
7001
|
+
const b = ((x = et[I]) == null ? void 0 : x.label) || I;
|
|
6972
7002
|
q(`${b} is required.`);
|
|
6973
7003
|
return;
|
|
6974
7004
|
}
|
|
6975
7005
|
await be();
|
|
6976
|
-
}, Ze = (u, x,
|
|
7006
|
+
}, Ze = (u, x, I, b, o) => {
|
|
6977
7007
|
const c = et[u];
|
|
6978
7008
|
if (!c) return null;
|
|
6979
|
-
const R = v.includes(u), h = te[u], N =
|
|
7009
|
+
const R = v.includes(u), h = te[u], N = I || c.label, k = x ?? u, le = o ? o !== "placeholder" : P, ie = le ? N : void 0, xe = le ? "..." : N;
|
|
6980
7010
|
switch (c.type) {
|
|
6981
7011
|
case "select":
|
|
6982
7012
|
if (u === "countryResidence" || u === "addressCountry") {
|
|
@@ -7079,7 +7109,7 @@ const zn = ({
|
|
|
7079
7109
|
}
|
|
7080
7110
|
) }, `custom-${x}`);
|
|
7081
7111
|
if (!u.paramName) return null;
|
|
7082
|
-
const
|
|
7112
|
+
const I = te[u.paramName], b = u.displayText || u.label || u.paramName, o = u.labelMode ? u.labelMode !== "placeholder" : P;
|
|
7083
7113
|
return u.customType === "checkbox" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
7084
7114
|
/* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7085
7115
|
/* @__PURE__ */ r(
|
|
@@ -7087,7 +7117,7 @@ const zn = ({
|
|
|
7087
7117
|
{
|
|
7088
7118
|
type: "checkbox",
|
|
7089
7119
|
checked: O[u.paramName] === "true",
|
|
7090
|
-
onChange: (c) =>
|
|
7120
|
+
onChange: (c) => M(u.paramName, c.target.checked ? "true" : "false"),
|
|
7091
7121
|
style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
|
|
7092
7122
|
}
|
|
7093
7123
|
),
|
|
@@ -7096,7 +7126,7 @@ const zn = ({
|
|
|
7096
7126
|
u.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
7097
7127
|
] })
|
|
7098
7128
|
] }),
|
|
7099
|
-
|
|
7129
|
+
I && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: I })
|
|
7100
7130
|
] }, `custom-${x}`) : /* @__PURE__ */ r(
|
|
7101
7131
|
ge,
|
|
7102
7132
|
{
|
|
@@ -7104,9 +7134,9 @@ const zn = ({
|
|
|
7104
7134
|
label: o ? `${b}${u.required ? " *" : ""}` : void 0,
|
|
7105
7135
|
placeholder: o ? void 0 : b,
|
|
7106
7136
|
value: O[u.paramName] || "",
|
|
7107
|
-
onChange: (c) =>
|
|
7137
|
+
onChange: (c) => M(u.paramName, c.target.value),
|
|
7108
7138
|
required: u.required,
|
|
7109
|
-
error:
|
|
7139
|
+
error: I
|
|
7110
7140
|
},
|
|
7111
7141
|
`custom-${x}`
|
|
7112
7142
|
);
|
|
@@ -7119,15 +7149,15 @@ const zn = ({
|
|
|
7119
7149
|
{
|
|
7120
7150
|
type: "checkbox",
|
|
7121
7151
|
checked: x,
|
|
7122
|
-
onChange: (
|
|
7152
|
+
onChange: (I) => M(u.conditionalOn, I.target.checked ? "true" : "false"),
|
|
7123
7153
|
style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
|
|
7124
7154
|
}
|
|
7125
7155
|
),
|
|
7126
7156
|
/* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: u.conditionalOn })
|
|
7127
7157
|
] }),
|
|
7128
|
-
x && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: u.fields.map((
|
|
7129
|
-
const o =
|
|
7130
|
-
return /* @__PURE__ */ r("div", { className: o, children:
|
|
7158
|
+
x && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: u.fields.map((I, b) => {
|
|
7159
|
+
const o = I.colSpan === 1 ? "col-span-1" : I.colSpan === 2 ? "col-span-2" : I.colSpan === 3 ? "col-span-3" : "col-span-4", c = I.isCustom ? `custom-${b}-${I.paramName}` : `builtin-${I.name}-${b}`;
|
|
7160
|
+
return /* @__PURE__ */ r("div", { className: o, children: I.isCustom ? Me(I, b) : Ze(I.name, c, I.displayText, I.countriesType, I.labelMode) }, c);
|
|
7131
7161
|
}) })
|
|
7132
7162
|
] });
|
|
7133
7163
|
};
|
|
@@ -7137,7 +7167,7 @@ const zn = ({
|
|
|
7137
7167
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7138
7168
|
] }) }) });
|
|
7139
7169
|
if (f) {
|
|
7140
|
-
const u = f[
|
|
7170
|
+
const u = f[z] ?? f[0], x = ue === -1, I = ae === -1, b = f.length, o = G(u), c = Object.values(te);
|
|
7141
7171
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(J, { children: [
|
|
7142
7172
|
/* @__PURE__ */ r(ve, { children: /* @__PURE__ */ r(lt, { title: (d == null ? void 0 : d.title) || "Company Registration" }) }),
|
|
7143
7173
|
/* @__PURE__ */ i(Z, { children: [
|
|
@@ -7157,13 +7187,13 @@ const zn = ({
|
|
|
7157
7187
|
f.map((R, h) => /* @__PURE__ */ r(
|
|
7158
7188
|
"div",
|
|
7159
7189
|
{
|
|
7160
|
-
className: `h-1.5 rounded-full transition-all ${h ===
|
|
7161
|
-
style: h ===
|
|
7190
|
+
className: `h-1.5 rounded-full transition-all ${h === z ? "flex-1" : "w-8"}`,
|
|
7191
|
+
style: h === z ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : h < z ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
7162
7192
|
},
|
|
7163
7193
|
h
|
|
7164
7194
|
)),
|
|
7165
7195
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
7166
|
-
|
|
7196
|
+
z + 1,
|
|
7167
7197
|
" / ",
|
|
7168
7198
|
b
|
|
7169
7199
|
] })
|
|
@@ -7186,7 +7216,7 @@ const zn = ({
|
|
|
7186
7216
|
),
|
|
7187
7217
|
x && a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: re || y, children: "Cancel" })
|
|
7188
7218
|
] }),
|
|
7189
|
-
/* @__PURE__ */ r(X, { type: "button", isLoading: re || y, onClick:
|
|
7219
|
+
/* @__PURE__ */ r(X, { type: "button", isLoading: re || y, onClick: I ? be : De, children: I ? u.conditionalOn && !o ? "Skip & Submit" : "Submit" : u.conditionalOn && !o ? "Skip" : "Next" })
|
|
7190
7220
|
] })
|
|
7191
7221
|
] }) });
|
|
7192
7222
|
}
|
|
@@ -7198,7 +7228,7 @@ const zn = ({
|
|
|
7198
7228
|
" ",
|
|
7199
7229
|
L
|
|
7200
7230
|
] }) }),
|
|
7201
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children:
|
|
7231
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: C.map((u) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(u) }, u)) })
|
|
7202
7232
|
] }),
|
|
7203
7233
|
/* @__PURE__ */ i(ke, { className: "flex justify-between", children: [
|
|
7204
7234
|
a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: re || y, children: "Cancel" }),
|
|
@@ -7220,27 +7250,27 @@ const zn = ({
|
|
|
7220
7250
|
nextWorkflowKey: p,
|
|
7221
7251
|
hasWorkflowChanged: S,
|
|
7222
7252
|
isLoading: T,
|
|
7223
|
-
error:
|
|
7253
|
+
error: F,
|
|
7224
7254
|
moveBack: P,
|
|
7225
7255
|
refreshProgress: f
|
|
7226
|
-
} = Mr(e), [v,
|
|
7256
|
+
} = Mr(e), [v, C] = Ae.useState(!1);
|
|
7227
7257
|
if (Ae.useEffect(() => {
|
|
7228
|
-
|
|
7229
|
-
}, [
|
|
7258
|
+
F && n && n(F);
|
|
7259
|
+
}, [F, n]), Ae.useEffect(() => {
|
|
7230
7260
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
7231
7261
|
}, [l == null ? void 0 : l.workflowResult, t]), Ae.useEffect(() => {
|
|
7232
7262
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
7233
7263
|
}, [a]), Ae.useEffect(() => {
|
|
7234
|
-
S &&
|
|
7264
|
+
S && C(!1);
|
|
7235
7265
|
}, [S]), T || !l)
|
|
7236
7266
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(J, { children: /* @__PURE__ */ i(Z, { children: [
|
|
7237
7267
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
7238
7268
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
|
|
7239
7269
|
] }) }) });
|
|
7240
|
-
if (
|
|
7270
|
+
if (F)
|
|
7241
7271
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
7242
7272
|
/* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "An error occurred" }),
|
|
7243
|
-
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
7273
|
+
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: F.message })
|
|
7244
7274
|
] }) }) }) });
|
|
7245
7275
|
if (S && !v)
|
|
7246
7276
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
@@ -7264,7 +7294,7 @@ const zn = ({
|
|
|
7264
7294
|
/* @__PURE__ */ r(
|
|
7265
7295
|
"button",
|
|
7266
7296
|
{
|
|
7267
|
-
onClick: () =>
|
|
7297
|
+
onClick: () => C(!0),
|
|
7268
7298
|
className: "px-6 py-3 font-medium rounded-lg transition-opacity hover:opacity-90",
|
|
7269
7299
|
style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
|
|
7270
7300
|
children: "Continue with New Workflow"
|
|
@@ -7314,7 +7344,7 @@ const zn = ({
|
|
|
7314
7344
|
return "";
|
|
7315
7345
|
}
|
|
7316
7346
|
}, H = () => {
|
|
7317
|
-
const B = m.filter((A) => A.visibility !== !1), V = B.findIndex((A) => A.order === d.order), ne = V >= 0 ? V + 1 : 1,
|
|
7347
|
+
const B = m.filter((A) => A.visibility !== !1), V = B.findIndex((A) => A.order === d.order), ne = V >= 0 ? V + 1 : 1, E = B.length;
|
|
7318
7348
|
return /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
7319
7349
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
|
|
7320
7350
|
/* @__PURE__ */ r(lt, {}),
|
|
@@ -7322,11 +7352,11 @@ const zn = ({
|
|
|
7322
7352
|
"Step ",
|
|
7323
7353
|
ne,
|
|
7324
7354
|
" of ",
|
|
7325
|
-
|
|
7355
|
+
E
|
|
7326
7356
|
] })
|
|
7327
7357
|
] }),
|
|
7328
7358
|
/* @__PURE__ */ r("div", { className: "flex items-center", children: B.map((A, W) => {
|
|
7329
|
-
const K = W < V,
|
|
7359
|
+
const K = W < V, $ = A.order === d.order, O = K || $;
|
|
7330
7360
|
return /* @__PURE__ */ i(Ae.Fragment, { children: [
|
|
7331
7361
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
7332
7362
|
/* @__PURE__ */ r(
|
|
@@ -7350,8 +7380,8 @@ const zn = ({
|
|
|
7350
7380
|
{
|
|
7351
7381
|
className: "ml-2 text-sm whitespace-nowrap",
|
|
7352
7382
|
style: {
|
|
7353
|
-
fontWeight:
|
|
7354
|
-
color:
|
|
7383
|
+
fontWeight: $ ? 600 : 400,
|
|
7384
|
+
color: $ ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-muted, #9ca3af)"
|
|
7355
7385
|
},
|
|
7356
7386
|
children: A.displayName || A.name || U(A.action) || `Step ${W + 1}`
|
|
7357
7387
|
}
|
|
@@ -7369,7 +7399,7 @@ const zn = ({
|
|
|
7369
7399
|
] }, A.order);
|
|
7370
7400
|
}) })
|
|
7371
7401
|
] });
|
|
7372
|
-
},
|
|
7402
|
+
}, D = () => {
|
|
7373
7403
|
const B = {
|
|
7374
7404
|
applicantId: e,
|
|
7375
7405
|
onComplete: async () => {
|
|
@@ -7419,7 +7449,7 @@ const zn = ({
|
|
|
7419
7449
|
};
|
|
7420
7450
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
7421
7451
|
H(),
|
|
7422
|
-
|
|
7452
|
+
D()
|
|
7423
7453
|
] });
|
|
7424
7454
|
};
|
|
7425
7455
|
function _n(e) {
|
|
@@ -7488,8 +7518,8 @@ export {
|
|
|
7488
7518
|
ke as CardFooter,
|
|
7489
7519
|
ve as CardHeader,
|
|
7490
7520
|
Ue as CountriesType,
|
|
7491
|
-
|
|
7492
|
-
|
|
7521
|
+
zn as CreateApplicantForm,
|
|
7522
|
+
$n as CreateCompanyApplicantForm,
|
|
7493
7523
|
Jt as CriteriaBuiltInType,
|
|
7494
7524
|
Xt as DEFAULT_COMPANY_VISIBLE_FIELDS,
|
|
7495
7525
|
er as DEFAULT_VISIBLE_FIELDS,
|
|
@@ -7518,7 +7548,7 @@ export {
|
|
|
7518
7548
|
Bn as KycWorkflow,
|
|
7519
7549
|
bn as Logo,
|
|
7520
7550
|
Et as MetaKYCContext,
|
|
7521
|
-
|
|
7551
|
+
ze as MetaKYCError,
|
|
7522
7552
|
An as MetaKYCProvider,
|
|
7523
7553
|
Ur as MultiSelect,
|
|
7524
7554
|
Cr as OnfidoProvider,
|
|
@@ -7544,7 +7574,7 @@ export {
|
|
|
7544
7574
|
sr as UploadDocumentService,
|
|
7545
7575
|
an as UploadDocumentStep,
|
|
7546
7576
|
qt as UserType,
|
|
7547
|
-
|
|
7577
|
+
$e as ValueDataType,
|
|
7548
7578
|
Nr as WorkflowOrchestrator,
|
|
7549
7579
|
ut as WorkflowResultType,
|
|
7550
7580
|
kr as WorkflowState,
|
|
@@ -7582,10 +7612,10 @@ export {
|
|
|
7582
7612
|
Br as useIdentityVerification,
|
|
7583
7613
|
Mr as useKycWorkflow,
|
|
7584
7614
|
Fe as useMetaKYC,
|
|
7585
|
-
|
|
7615
|
+
$r as useOverview,
|
|
7586
7616
|
Or as useQuestionnaire,
|
|
7587
7617
|
_r as useRiskScoring,
|
|
7588
|
-
|
|
7618
|
+
zr as useUploadDocument,
|
|
7589
7619
|
Pn as validateFileSize,
|
|
7590
7620
|
Ln as validateFileType
|
|
7591
7621
|
};
|