@vpdev2/metakyc-sdk 1.0.106 → 1.0.108
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/client/config.d.ts +6 -1
- package/dist/client/config.d.ts.map +1 -1
- package/dist/identity/provider-manager.d.ts.map +1 -1
- package/dist/identity/providers/sumsub.d.ts +8 -1
- package/dist/identity/providers/sumsub.d.ts.map +1 -1
- package/dist/index.cjs +32 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +965 -1002
- package/dist/index.js.map +1 -1
- package/dist/types/identity.d.ts +5 -0
- package/dist/types/identity.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var he = (e, t, n) =>
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import we, { createContext as
|
|
7
|
-
import { jsx as r, jsxs as s, Fragment as
|
|
8
|
-
import
|
|
9
|
-
import { useForm as
|
|
10
|
-
import { z as
|
|
11
|
-
var ce = /* @__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))(ce || {}),
|
|
12
|
-
const
|
|
1
|
+
var Ut = Object.defineProperty;
|
|
2
|
+
var Kt = (e, t, n) => t in e ? Ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var he = (e, t, n) => Kt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import qt from "axios";
|
|
5
|
+
import * as Rt from "react";
|
|
6
|
+
import we, { createContext as Vt, useState as k, useMemo as De, useEffect as ge, useContext as Yt, useRef as de, useCallback as ae, forwardRef as yt, createElement as wt } from "react";
|
|
7
|
+
import { jsx as r, jsxs as s, Fragment as lt } from "react/jsx-runtime";
|
|
8
|
+
import Qt, { createPortal as St } from "react-dom";
|
|
9
|
+
import { useForm as Gt, Controller as et } from "react-hook-form";
|
|
10
|
+
import { z as Ve } from "zod";
|
|
11
|
+
var ce = /* @__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))(ce || {}), gt = /* @__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))(gt || {}), ze = /* @__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))(ze || {}), Jt = /* @__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))(Jt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Zt || {}), tt = /* @__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))(tt || {}), rt = /* @__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))(rt || {}), Xt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Xt || {}), er = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(er || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Oe || {}), tr = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(tr || {}), bt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(bt || {}), rr = /* @__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))(rr || {}), nr = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(nr || {}), ar = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(ar || {}), Ke = /* @__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))(Ke || {}), ir = /* @__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))(ir || {}), sr = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(sr || {}), Ee = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Ee || {}), or = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(or || {});
|
|
12
|
+
const Je = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
15
15
|
CountryOfBirth: 30,
|
|
16
16
|
PhoneNumber: 40,
|
|
17
17
|
UboAddress: 50
|
|
18
|
-
},
|
|
18
|
+
}, nt = {
|
|
19
19
|
firstName: { label: "First Name", type: "text" },
|
|
20
20
|
lastName: { label: "Last Name", type: "text" },
|
|
21
21
|
email: { label: "Email", type: "email" },
|
|
@@ -23,27 +23,27 @@ const Ge = {
|
|
|
23
23
|
dateOfBirth: { label: "Date of Birth", type: "date" },
|
|
24
24
|
salutation: { label: "Salutation", type: "select" },
|
|
25
25
|
title: { label: "Title", type: "text" },
|
|
26
|
-
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType:
|
|
26
|
+
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType: Je.PhoneNumber },
|
|
27
27
|
street: { label: "Street", type: "text" },
|
|
28
28
|
streetNumber: { label: "Street Number", type: "text" },
|
|
29
29
|
zip: { label: "ZIP / Postal Code", type: "text" },
|
|
30
30
|
city: { label: "City", type: "text" },
|
|
31
|
-
country: { label: "Country", type: "select", countriesType:
|
|
32
|
-
nationality: { label: "Nationality", type: "select", countriesType:
|
|
33
|
-
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType:
|
|
34
|
-
countryOfBirth: { label: "Country of Birth", type: "select", countriesType:
|
|
31
|
+
country: { label: "Country", type: "select", countriesType: Je.Address },
|
|
32
|
+
nationality: { label: "Nationality", type: "select", countriesType: Je.Nationality },
|
|
33
|
+
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType: Je.Nationality },
|
|
34
|
+
countryOfBirth: { label: "Country of Birth", type: "select", countriesType: Je.CountryOfBirth },
|
|
35
35
|
placeOfBirth: { label: "Place of Birth", type: "text" },
|
|
36
|
-
taxCountry: { label: "Tax Country", type: "select", countriesType:
|
|
36
|
+
taxCountry: { label: "Tax Country", type: "select", countriesType: Je.Address },
|
|
37
37
|
taxNumber: { label: "Tax Number", type: "text" },
|
|
38
38
|
defaultLanguage: { label: "Default Language", type: "select" },
|
|
39
39
|
educationLevel: { label: "Education Level", type: "text" },
|
|
40
40
|
occupation: { label: "Occupation", type: "text" }
|
|
41
|
-
},
|
|
41
|
+
}, st = {
|
|
42
42
|
companyName: { label: "Company Name", type: "text" },
|
|
43
43
|
email: { label: "Email", type: "email" },
|
|
44
44
|
phone: { label: "Phone", type: "tel" },
|
|
45
45
|
registrationNumber: { label: "Registration Number", type: "text" },
|
|
46
|
-
countryResidence: { label: "Country of Residence", type: "select", countriesType:
|
|
46
|
+
countryResidence: { label: "Country of Residence", type: "select", countriesType: Je.Address },
|
|
47
47
|
legalAddress: { label: "Legal Address", type: "text" },
|
|
48
48
|
incorporatedOn: { label: "Incorporation Date", type: "date" },
|
|
49
49
|
controlScheme: { label: "Control Scheme", type: "text" },
|
|
@@ -56,20 +56,20 @@ const Ge = {
|
|
|
56
56
|
city: { label: "City", type: "text" },
|
|
57
57
|
state: { label: "State / Province", type: "text" },
|
|
58
58
|
postalCode: { label: "Postal Code", type: "text" },
|
|
59
|
-
addressCountry: { label: "Address Country", type: "select", countriesType:
|
|
59
|
+
addressCountry: { label: "Address Country", type: "select", countriesType: Je.Address },
|
|
60
60
|
lei: { label: "LEI", type: "text" }
|
|
61
|
-
},
|
|
61
|
+
}, lr = [
|
|
62
62
|
"companyName",
|
|
63
63
|
"email",
|
|
64
64
|
"phone",
|
|
65
65
|
"registrationNumber"
|
|
66
|
-
],
|
|
66
|
+
], cr = [
|
|
67
67
|
"firstName",
|
|
68
68
|
"lastName",
|
|
69
69
|
"email",
|
|
70
70
|
"phonenumber",
|
|
71
71
|
"dateOfBirth"
|
|
72
|
-
],
|
|
72
|
+
], It = [
|
|
73
73
|
{ value: "EN", label: "English" },
|
|
74
74
|
{ value: "DE", label: "German" },
|
|
75
75
|
{ value: "FR", label: "French" },
|
|
@@ -89,7 +89,7 @@ const Ge = {
|
|
|
89
89
|
{ value: "NO", label: "Norwegian" }
|
|
90
90
|
];
|
|
91
91
|
var Fe = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(Fe || {});
|
|
92
|
-
const
|
|
92
|
+
const dr = {
|
|
93
93
|
timeout: 3e4,
|
|
94
94
|
retries: 3,
|
|
95
95
|
locale: "en",
|
|
@@ -97,7 +97,7 @@ const cr = {
|
|
|
97
97
|
pattern: "host-controller"
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
class
|
|
100
|
+
class ur {
|
|
101
101
|
constructor(t) {
|
|
102
102
|
this.config = t;
|
|
103
103
|
}
|
|
@@ -137,19 +137,19 @@ class dr {
|
|
|
137
137
|
}[t] || t;
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
class
|
|
140
|
+
class Ue extends Error {
|
|
141
141
|
constructor(n, a, i, o, c) {
|
|
142
142
|
super(n);
|
|
143
143
|
he(this, "response");
|
|
144
|
-
this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this,
|
|
144
|
+
this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, Ue.prototype);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
class
|
|
147
|
+
class dt {
|
|
148
148
|
/**
|
|
149
149
|
* Process an error from the API response
|
|
150
150
|
*/
|
|
151
151
|
static handleApiError(t) {
|
|
152
|
-
return new
|
|
152
|
+
return new Ue(
|
|
153
153
|
t.message || "An unknown error occurred",
|
|
154
154
|
t.code,
|
|
155
155
|
t.details || void 0,
|
|
@@ -162,44 +162,44 @@ class ct {
|
|
|
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 Ue(
|
|
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 Ue(
|
|
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 Ue(
|
|
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 Ue(
|
|
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 Ue(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 Ue;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
class
|
|
197
|
+
class pr {
|
|
198
198
|
constructor(t) {
|
|
199
199
|
he(this, "axiosInstance");
|
|
200
200
|
he(this, "endpointBuilder");
|
|
201
201
|
he(this, "config");
|
|
202
|
-
this.config = { ...
|
|
202
|
+
this.config = { ...dr, ...t }, this.endpointBuilder = new ur(this.config.endpoints), this.axiosInstance = qt.create({
|
|
203
203
|
baseURL: this.config.baseUrl,
|
|
204
204
|
timeout: this.config.timeout,
|
|
205
205
|
headers: {
|
|
@@ -235,7 +235,7 @@ class ur {
|
|
|
235
235
|
});
|
|
236
236
|
return this.handleResponse(o);
|
|
237
237
|
} catch (i) {
|
|
238
|
-
throw
|
|
238
|
+
throw dt.handleAxiosError(i);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
@@ -246,7 +246,7 @@ class ur {
|
|
|
246
246
|
const i = this.buildEndpoint(t, n), o = await this.axiosInstance.post(i, a);
|
|
247
247
|
return this.handleResponse(o);
|
|
248
248
|
} catch (i) {
|
|
249
|
-
throw
|
|
249
|
+
throw dt.handleAxiosError(i);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
/**
|
|
@@ -257,7 +257,7 @@ class ur {
|
|
|
257
257
|
const i = this.buildEndpoint(t, n), o = await this.axiosInstance.put(i, a);
|
|
258
258
|
return this.handleResponse(o);
|
|
259
259
|
} catch (i) {
|
|
260
|
-
throw
|
|
260
|
+
throw dt.handleAxiosError(i);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
@@ -270,7 +270,7 @@ class ur {
|
|
|
270
270
|
});
|
|
271
271
|
return this.handleResponse(o);
|
|
272
272
|
} catch (i) {
|
|
273
|
-
throw
|
|
273
|
+
throw dt.handleAxiosError(i);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
@@ -279,7 +279,7 @@ class ur {
|
|
|
279
279
|
handleResponse(t) {
|
|
280
280
|
const n = t.data;
|
|
281
281
|
if (!n.success && n.error)
|
|
282
|
-
throw
|
|
282
|
+
throw dt.handleApiError(n.error);
|
|
283
283
|
return n;
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
@@ -289,7 +289,7 @@ class ur {
|
|
|
289
289
|
return this.axiosInstance;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
class
|
|
292
|
+
class mr {
|
|
293
293
|
constructor(t) {
|
|
294
294
|
this.httpClient = t;
|
|
295
295
|
}
|
|
@@ -408,7 +408,7 @@ class pr {
|
|
|
408
408
|
)).result;
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
class
|
|
411
|
+
class yr {
|
|
412
412
|
constructor(t) {
|
|
413
413
|
this.httpClient = t;
|
|
414
414
|
}
|
|
@@ -435,7 +435,7 @@ class mr {
|
|
|
435
435
|
)).result;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
class
|
|
438
|
+
class hr {
|
|
439
439
|
constructor(t) {
|
|
440
440
|
this.httpClient = t;
|
|
441
441
|
}
|
|
@@ -463,7 +463,7 @@ class yr {
|
|
|
463
463
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", t);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
class
|
|
466
|
+
class fr {
|
|
467
467
|
constructor(t) {
|
|
468
468
|
this.httpClient = t;
|
|
469
469
|
}
|
|
@@ -489,7 +489,7 @@ class hr {
|
|
|
489
489
|
)).result;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
class
|
|
492
|
+
class gr {
|
|
493
493
|
constructor(t) {
|
|
494
494
|
this.httpClient = t;
|
|
495
495
|
}
|
|
@@ -511,7 +511,7 @@ class fr {
|
|
|
511
511
|
await this.httpClient.get("Applicant", "PassOverview", { applicantId: t });
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
class
|
|
514
|
+
class br {
|
|
515
515
|
constructor(t) {
|
|
516
516
|
this.httpClient = t;
|
|
517
517
|
}
|
|
@@ -546,7 +546,7 @@ class gr {
|
|
|
546
546
|
)).result;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
class
|
|
549
|
+
class xr {
|
|
550
550
|
constructor(t) {
|
|
551
551
|
this.httpClient = t;
|
|
552
552
|
}
|
|
@@ -614,7 +614,7 @@ class br {
|
|
|
614
614
|
return console.log("[IdentityService] Sumsub token refresh result:", n), n.result.accessToken;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
class
|
|
617
|
+
class vr {
|
|
618
618
|
constructor(t) {
|
|
619
619
|
this.httpClient = t;
|
|
620
620
|
}
|
|
@@ -650,7 +650,7 @@ class xr {
|
|
|
650
650
|
)).result;
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
class
|
|
653
|
+
class kr {
|
|
654
654
|
constructor(t) {
|
|
655
655
|
this.httpClient = t;
|
|
656
656
|
}
|
|
@@ -735,7 +735,7 @@ const Le = {
|
|
|
735
735
|
textMuted: "#9ca3af"
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
},
|
|
738
|
+
}, wr = {
|
|
739
739
|
name: "Corporate",
|
|
740
740
|
logo: {
|
|
741
741
|
url: "",
|
|
@@ -768,7 +768,7 @@ const Le = {
|
|
|
768
768
|
cardPadding: "1.5rem",
|
|
769
769
|
inputHeight: "2.5rem"
|
|
770
770
|
}
|
|
771
|
-
},
|
|
771
|
+
}, Sr = {
|
|
772
772
|
name: "Fintech",
|
|
773
773
|
logo: {
|
|
774
774
|
url: "",
|
|
@@ -801,7 +801,7 @@ const Le = {
|
|
|
801
801
|
cardPadding: "2rem",
|
|
802
802
|
inputHeight: "3rem"
|
|
803
803
|
}
|
|
804
|
-
},
|
|
804
|
+
}, Cr = {
|
|
805
805
|
name: "Healthcare",
|
|
806
806
|
logo: {
|
|
807
807
|
url: "",
|
|
@@ -843,7 +843,7 @@ const Le = {
|
|
|
843
843
|
textSecondary: "#CBD5E1"
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
},
|
|
846
|
+
}, Nr = {
|
|
847
847
|
name: "Modern",
|
|
848
848
|
logo: {
|
|
849
849
|
url: "",
|
|
@@ -876,7 +876,7 @@ const Le = {
|
|
|
876
876
|
cardPadding: "2rem",
|
|
877
877
|
inputHeight: "3rem"
|
|
878
878
|
}
|
|
879
|
-
},
|
|
879
|
+
}, Rr = {
|
|
880
880
|
name: "Minimal",
|
|
881
881
|
logo: {
|
|
882
882
|
url: "",
|
|
@@ -909,18 +909,18 @@ const Le = {
|
|
|
909
909
|
cardPadding: "1.25rem",
|
|
910
910
|
inputHeight: "2.25rem"
|
|
911
911
|
}
|
|
912
|
-
},
|
|
912
|
+
}, Ir = {
|
|
913
913
|
[Fe.Default]: Le,
|
|
914
|
-
[Fe.Corporate]:
|
|
915
|
-
[Fe.Fintech]:
|
|
916
|
-
[Fe.Healthcare]:
|
|
917
|
-
[Fe.Modern]:
|
|
918
|
-
[Fe.Minimal]:
|
|
914
|
+
[Fe.Corporate]: wr,
|
|
915
|
+
[Fe.Fintech]: Sr,
|
|
916
|
+
[Fe.Healthcare]: Cr,
|
|
917
|
+
[Fe.Modern]: Nr,
|
|
918
|
+
[Fe.Minimal]: Rr
|
|
919
919
|
};
|
|
920
|
-
function
|
|
921
|
-
return
|
|
920
|
+
function ut(e) {
|
|
921
|
+
return Ir[e] || Le;
|
|
922
922
|
}
|
|
923
|
-
class
|
|
923
|
+
class Er {
|
|
924
924
|
constructor(t) {
|
|
925
925
|
this.httpClient = t;
|
|
926
926
|
}
|
|
@@ -935,8 +935,8 @@ class Ir {
|
|
|
935
935
|
"GetThemeConfiguration"
|
|
936
936
|
);
|
|
937
937
|
if (!n.result.isEnabled)
|
|
938
|
-
return
|
|
939
|
-
let a = n.result.preset ?
|
|
938
|
+
return ut(Fe.Default);
|
|
939
|
+
let a = n.result.preset ? ut(n.result.preset) : ut(Fe.Default);
|
|
940
940
|
if (n.result.title && (a.title = n.result.title), n.result.logo && (a.logo = { ...a.logo, ...n.result.logo }), n.result.colors && (a.colors = { ...a.colors, ...n.result.colors }), n.result.typography && (a.typography = { ...a.typography, ...n.result.typography }), n.result.spacing && (a.spacing = { ...a.spacing, ...n.result.spacing }), n.result.customCSS && (a.customCSS = n.result.customCSS), n.result.darkMode && (a.darkMode = {
|
|
941
941
|
colors: {
|
|
942
942
|
...(t = a.darkMode) == null ? void 0 : t.colors,
|
|
@@ -949,9 +949,9 @@ class Ir {
|
|
|
949
949
|
const c = !o._v || o._v < 4;
|
|
950
950
|
return {
|
|
951
951
|
...o,
|
|
952
|
-
fields: (o.fields || []).map((
|
|
953
|
-
...
|
|
954
|
-
colSpan: c ?
|
|
952
|
+
fields: (o.fields || []).map((d) => ({
|
|
953
|
+
...d,
|
|
954
|
+
colSpan: c ? d.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, d.colSpan ?? 4))
|
|
955
955
|
}))
|
|
956
956
|
};
|
|
957
957
|
}));
|
|
@@ -970,9 +970,9 @@ class Ir {
|
|
|
970
970
|
const c = !o._v || o._v < 4;
|
|
971
971
|
return {
|
|
972
972
|
...o,
|
|
973
|
-
fields: (o.fields || []).map((
|
|
974
|
-
...
|
|
975
|
-
colSpan: c ?
|
|
973
|
+
fields: (o.fields || []).map((d) => ({
|
|
974
|
+
...d,
|
|
975
|
+
colSpan: c ? d.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, d.colSpan ?? 4))
|
|
976
976
|
}))
|
|
977
977
|
};
|
|
978
978
|
}));
|
|
@@ -986,7 +986,7 @@ class Ir {
|
|
|
986
986
|
}
|
|
987
987
|
return a;
|
|
988
988
|
} catch (n) {
|
|
989
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", n),
|
|
989
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), ut(Fe.Default);
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
/**
|
|
@@ -1012,7 +1012,7 @@ class Ir {
|
|
|
1012
1012
|
* Preview theme (doesn't save)
|
|
1013
1013
|
*/
|
|
1014
1014
|
getPreviewTheme(t, n) {
|
|
1015
|
-
const a =
|
|
1015
|
+
const a = ut(t);
|
|
1016
1016
|
return n ? {
|
|
1017
1017
|
...a,
|
|
1018
1018
|
...n,
|
|
@@ -1023,7 +1023,7 @@ class Ir {
|
|
|
1023
1023
|
} : a;
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
|
-
class
|
|
1026
|
+
class Fr {
|
|
1027
1027
|
constructor() {
|
|
1028
1028
|
he(this, "listeners", /* @__PURE__ */ new Map());
|
|
1029
1029
|
}
|
|
@@ -1068,9 +1068,9 @@ class Er {
|
|
|
1068
1068
|
this.listeners.delete(t);
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
class
|
|
1071
|
+
class Ar {
|
|
1072
1072
|
constructor() {
|
|
1073
|
-
he(this, "events", new
|
|
1073
|
+
he(this, "events", new Fr());
|
|
1074
1074
|
he(this, "_applicantId", null);
|
|
1075
1075
|
he(this, "_progress", null);
|
|
1076
1076
|
he(this, "_error", null);
|
|
@@ -1208,7 +1208,7 @@ class Fr {
|
|
|
1208
1208
|
this.events.clear();
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
|
1211
|
-
class
|
|
1211
|
+
class Pr {
|
|
1212
1212
|
constructor() {
|
|
1213
1213
|
he(this, "handlers", /* @__PURE__ */ new Map());
|
|
1214
1214
|
}
|
|
@@ -1250,10 +1250,10 @@ class Ar {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
1252
|
class Tr {
|
|
1253
|
-
constructor(t, n, a, i, o, c,
|
|
1253
|
+
constructor(t, n, a, i, o, c, d, y) {
|
|
1254
1254
|
he(this, "state");
|
|
1255
1255
|
he(this, "stepRouter");
|
|
1256
|
-
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = o, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new
|
|
1256
|
+
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = o, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new Ar(), this.stepRouter = new Pr(), this.registerStepHandlers();
|
|
1257
1257
|
}
|
|
1258
1258
|
/**
|
|
1259
1259
|
* Register all step handlers
|
|
@@ -1393,7 +1393,7 @@ class Tr {
|
|
|
1393
1393
|
return this.stepRouter;
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function Mt(e, t) {
|
|
1397
1397
|
return new Promise((n, a) => {
|
|
1398
1398
|
if (t && document.getElementById(t)) {
|
|
1399
1399
|
n();
|
|
@@ -1403,86 +1403,49 @@ function Dt(e, t) {
|
|
|
1403
1403
|
i.src = e, t && (i.id = t), i.async = !0, i.onload = () => n(), i.onerror = () => a(new Error(`Failed to load script: ${e}`)), document.head.appendChild(i);
|
|
1404
1404
|
});
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1406
|
+
function Wn(e) {
|
|
1407
1407
|
return !!document.getElementById(e);
|
|
1408
1408
|
}
|
|
1409
|
-
function
|
|
1409
|
+
function Un(e) {
|
|
1410
1410
|
const t = document.getElementById(e);
|
|
1411
1411
|
t && t.remove();
|
|
1412
1412
|
}
|
|
1413
|
-
const
|
|
1414
|
-
function
|
|
1413
|
+
const Lr = "https://static.sumsub.com/idensic/static/sns-websdk-builder.js";
|
|
1414
|
+
function We(e, t) {
|
|
1415
|
+
try {
|
|
1416
|
+
return getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
|
|
1417
|
+
} catch {
|
|
1418
|
+
return t;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
function Dr() {
|
|
1422
|
+
const e = We("--metakyc-primary", "#2563eb"), t = We("--metakyc-primary-hover", "#1d4ed8"), n = We("--metakyc-background", "#ffffff"), a = We("--metakyc-surface", "#f9fafb"), i = We("--metakyc-text-primary", "#111827"), o = We("--metakyc-text-secondary", "#6b7280"), c = We("--metakyc-text-muted", "#9ca3af"), d = We("--metakyc-border", "#e5e7eb");
|
|
1415
1423
|
return `
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
input {
|
|
1440
|
-
color: var(--metakyc-text-primary, #111827);
|
|
1441
|
-
font-weight: 500;
|
|
1442
|
-
outline: none;
|
|
1443
|
-
}
|
|
1444
|
-
button.submit, button.back {
|
|
1445
|
-
border-radius: 8px;
|
|
1446
|
-
height: 44px;
|
|
1447
|
-
padding: 0 24px;
|
|
1448
|
-
font-size: 14px;
|
|
1449
|
-
font-weight: 600;
|
|
1450
|
-
background-image: none !important;
|
|
1451
|
-
transform: none !important;
|
|
1452
|
-
box-shadow: none !important;
|
|
1453
|
-
transition: all 0.15s ease;
|
|
1454
|
-
}
|
|
1455
|
-
button.submit {
|
|
1456
|
-
min-width: 120px;
|
|
1457
|
-
background: none;
|
|
1458
|
-
background-color: var(--metakyc-primary, #2563eb);
|
|
1459
|
-
color: #ffffff;
|
|
1460
|
-
}
|
|
1461
|
-
button.submit:hover {
|
|
1462
|
-
background-color: var(--metakyc-primary-hover, #1d4ed8);
|
|
1463
|
-
}
|
|
1464
|
-
button.back {
|
|
1465
|
-
background: none;
|
|
1466
|
-
background-color: var(--metakyc-background, #ffffff);
|
|
1467
|
-
border: 1px solid var(--metakyc-border, #d1d5db);
|
|
1468
|
-
color: var(--metakyc-text-primary, #111827);
|
|
1469
|
-
}
|
|
1470
|
-
button.back:hover {
|
|
1471
|
-
background-color: var(--metakyc-surface, #f3f4f6);
|
|
1472
|
-
}
|
|
1473
|
-
.round-icon {
|
|
1474
|
-
background-color: var(--metakyc-primary, #2563eb) !important;
|
|
1475
|
-
background-image: none !important;
|
|
1476
|
-
}
|
|
1477
|
-
.upload-item, .document-status {
|
|
1478
|
-
border-color: var(--metakyc-border, #e5e7eb) !important;
|
|
1479
|
-
}
|
|
1480
|
-
.step-desc {
|
|
1481
|
-
color: var(--metakyc-text-secondary, #6b7280);
|
|
1482
|
-
}
|
|
1483
|
-
`.replace(/\n\s+/g, " ").trim();
|
|
1424
|
+
body, html { font-family: ${We(
|
|
1425
|
+
"--metakyc-font-family",
|
|
1426
|
+
"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
|
|
1427
|
+
)} !important; background-color: ${n} !important; }
|
|
1428
|
+
p, span, label, div { color: ${i}; }
|
|
1429
|
+
h1, h2, h3, h4 { color: ${i}; }
|
|
1430
|
+
.step-desc { color: ${o}; }
|
|
1431
|
+
section.content { background-color: ${a}; color: ${i}; padding: 32px 32px 16px; box-shadow: none; border-radius: 10px; border: 1px solid ${d}; }
|
|
1432
|
+
input { color: ${i}; font-weight: 500; outline: none; background-color: ${n}; border: 1px solid ${d}; border-radius: 6px; }
|
|
1433
|
+
input:focus { border-color: ${e}; box-shadow: 0 0 0 2px ${e}33; }
|
|
1434
|
+
button.submit, button.back { border-radius: 8px; height: 44px; padding: 0 24px; font-size: 14px; font-weight: 600; background-image: none !important; transform: none !important; box-shadow: none !important; transition: all 0.15s ease; cursor: pointer; }
|
|
1435
|
+
button.submit { min-width: 120px; background: none; background-color: ${e}; color: #ffffff; border: none; }
|
|
1436
|
+
button.submit:hover { background-color: ${t}; }
|
|
1437
|
+
button.back { background: none; background-color: ${n}; border: 1px solid ${d}; color: ${i}; }
|
|
1438
|
+
button.back:hover { background-color: ${a}; }
|
|
1439
|
+
.round-icon { background-color: ${e} !important; background-image: none !important; }
|
|
1440
|
+
.upload-item, .document-status { border-color: ${d} !important; }
|
|
1441
|
+
select { background-color: ${n}; color: ${i}; border: 1px solid ${d}; border-radius: 6px; }
|
|
1442
|
+
.description { color: ${o}; }
|
|
1443
|
+
.subtitle { color: ${c}; }
|
|
1444
|
+
a { color: ${e}; }
|
|
1445
|
+
a:hover { color: ${t}; }
|
|
1446
|
+
`.trim();
|
|
1484
1447
|
}
|
|
1485
|
-
class
|
|
1448
|
+
class Mr {
|
|
1486
1449
|
constructor(t) {
|
|
1487
1450
|
he(this, "sdk", null);
|
|
1488
1451
|
he(this, "config");
|
|
@@ -1491,23 +1454,22 @@ class Dr {
|
|
|
1491
1454
|
this.config = t;
|
|
1492
1455
|
}
|
|
1493
1456
|
async loadSDK() {
|
|
1494
|
-
if (!window.snsWebSdk && (await
|
|
1457
|
+
if (!window.snsWebSdk && (await Mt(Lr, "sumsub-websdk"), !window.snsWebSdk))
|
|
1495
1458
|
throw new Error("Sumsub Web SDK failed to load from CDN");
|
|
1496
1459
|
}
|
|
1497
1460
|
async initialize(t) {
|
|
1498
1461
|
await this.loadSDK();
|
|
1499
|
-
const n = {
|
|
1500
|
-
|
|
1462
|
+
const n = {
|
|
1463
|
+
lang: this.config.lang || "en"
|
|
1464
|
+
};
|
|
1465
|
+
if (this.config.applicantEmail && (n.email = this.config.applicantEmail), this.config.applicantPhone && (n.phone = this.config.applicantPhone), this.config.theme && (n.theme = this.config.theme), this.config.customizationName && (n.customizationName = this.config.customizationName), !this.config.customizationName) {
|
|
1466
|
+
const i = {};
|
|
1467
|
+
this.config.customCss && (i.customCss = this.config.customCss), this.config.customCssStr && (i.customCssStr = this.config.customCssStr), i.customCssStr || (i.customCssStr = Dr()), n.uiConf = i;
|
|
1468
|
+
}
|
|
1501
1469
|
const a = window.snsWebSdk.init(
|
|
1502
1470
|
this.config.accessToken,
|
|
1503
1471
|
() => this.config.onTokenRefresh()
|
|
1504
|
-
).withConf({
|
|
1505
|
-
lang: this.config.lang || "en",
|
|
1506
|
-
...this.config.applicantEmail ? { email: this.config.applicantEmail } : {},
|
|
1507
|
-
...this.config.applicantPhone ? { phone: this.config.applicantPhone } : {},
|
|
1508
|
-
...this.config.theme ? { theme: this.config.theme } : {},
|
|
1509
|
-
uiConf: n
|
|
1510
|
-
}).withOptions({
|
|
1472
|
+
).withConf(n).withOptions({
|
|
1511
1473
|
addViewportTag: !1,
|
|
1512
1474
|
adaptIframeHeight: this.config.adaptIframeHeight !== !1
|
|
1513
1475
|
}).on("idCheck.onStepCompleted", (i) => {
|
|
@@ -1540,7 +1502,7 @@ class Dr {
|
|
|
1540
1502
|
this.errorCallback = t;
|
|
1541
1503
|
}
|
|
1542
1504
|
}
|
|
1543
|
-
class
|
|
1505
|
+
class Or {
|
|
1544
1506
|
constructor(t) {
|
|
1545
1507
|
he(this, "sdk", null);
|
|
1546
1508
|
he(this, "config");
|
|
@@ -1550,7 +1512,7 @@ class Mr {
|
|
|
1550
1512
|
* Load Onfido SDK
|
|
1551
1513
|
*/
|
|
1552
1514
|
async loadSDK() {
|
|
1553
|
-
await
|
|
1515
|
+
await Mt(
|
|
1554
1516
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1555
1517
|
"onfido-sdk"
|
|
1556
1518
|
);
|
|
@@ -1606,7 +1568,7 @@ class Mr {
|
|
|
1606
1568
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1607
1569
|
}
|
|
1608
1570
|
}
|
|
1609
|
-
class
|
|
1571
|
+
class zr {
|
|
1610
1572
|
constructor(t) {
|
|
1611
1573
|
he(this, "sardineContext", null);
|
|
1612
1574
|
he(this, "config");
|
|
@@ -1681,12 +1643,12 @@ class Or {
|
|
|
1681
1643
|
// Default false
|
|
1682
1644
|
region: this.config.region,
|
|
1683
1645
|
// Callback for device response (deprecated but kept for compatibility)
|
|
1684
|
-
onDeviceResponse: (
|
|
1685
|
-
console.log(`[SardinAI] Device ID: ${
|
|
1646
|
+
onDeviceResponse: (d) => {
|
|
1647
|
+
console.log(`[SardinAI] Device ID: ${d.deviceId}`);
|
|
1686
1648
|
},
|
|
1687
1649
|
// New callback for session updates
|
|
1688
|
-
onConfigUpdate: (
|
|
1689
|
-
switch (
|
|
1650
|
+
onConfigUpdate: (d, y, p) => {
|
|
1651
|
+
switch (d) {
|
|
1690
1652
|
case "SESSION_UPDATE_FAILED":
|
|
1691
1653
|
console.error("[SardinAI] Session update failed:", p);
|
|
1692
1654
|
break;
|
|
@@ -1697,7 +1659,7 @@ class Or {
|
|
|
1697
1659
|
console.log("[SardinAI] No session update");
|
|
1698
1660
|
break;
|
|
1699
1661
|
default:
|
|
1700
|
-
console.warn("[SardinAI] Unknown event:",
|
|
1662
|
+
console.warn("[SardinAI] Unknown event:", d);
|
|
1701
1663
|
}
|
|
1702
1664
|
}
|
|
1703
1665
|
}), this.addNoScriptFallback(t), console.log("[SardinAI] SDK initialized with sessionKey:", this.sessionKey);
|
|
@@ -1750,18 +1712,18 @@ class Or {
|
|
|
1750
1712
|
this.sardineContext && (this.sardineContext = null);
|
|
1751
1713
|
}
|
|
1752
1714
|
}
|
|
1753
|
-
class
|
|
1715
|
+
class Ge {
|
|
1754
1716
|
/**
|
|
1755
1717
|
* Create a provider instance
|
|
1756
1718
|
*/
|
|
1757
1719
|
static createProvider(t, n) {
|
|
1758
1720
|
switch (t) {
|
|
1759
1721
|
case Oe.Sumsub:
|
|
1760
|
-
return new Dr(n);
|
|
1761
|
-
case Oe.Onfido:
|
|
1762
1722
|
return new Mr(n);
|
|
1763
|
-
case Oe.
|
|
1723
|
+
case Oe.Onfido:
|
|
1764
1724
|
return new Or(n);
|
|
1725
|
+
case Oe.SardinAI:
|
|
1726
|
+
return new zr(n);
|
|
1765
1727
|
default:
|
|
1766
1728
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
1767
1729
|
}
|
|
@@ -1781,6 +1743,7 @@ class Qe {
|
|
|
1781
1743
|
externalUserId: n.externalUserId,
|
|
1782
1744
|
lang: c.lang || n.lang || "en",
|
|
1783
1745
|
theme: c.theme,
|
|
1746
|
+
customizationName: c.customizationName,
|
|
1784
1747
|
customCss: c.customCss,
|
|
1785
1748
|
adaptIframeHeight: c.adaptIframeHeight
|
|
1786
1749
|
};
|
|
@@ -1789,22 +1752,22 @@ class Qe {
|
|
|
1789
1752
|
token: n.token || n.sdkToken
|
|
1790
1753
|
};
|
|
1791
1754
|
case Oe.SardinAI:
|
|
1792
|
-
const
|
|
1755
|
+
const d = ((o = a == null ? void 0 : a.identityProviders) == null ? void 0 : o.sardinai) || {};
|
|
1793
1756
|
return {
|
|
1794
|
-
clientId:
|
|
1795
|
-
sessionKey:
|
|
1796
|
-
environment:
|
|
1797
|
-
flow:
|
|
1798
|
-
region:
|
|
1799
|
-
enableBiometrics:
|
|
1800
|
-
enablePortScanning:
|
|
1757
|
+
clientId: d.clientId || n.clientId,
|
|
1758
|
+
sessionKey: d.sessionKey || n.sessionKey,
|
|
1759
|
+
environment: d.environment || n.environment || "production",
|
|
1760
|
+
flow: d.flow || n.flow,
|
|
1761
|
+
region: d.region,
|
|
1762
|
+
enableBiometrics: d.enableBiometrics,
|
|
1763
|
+
enablePortScanning: d.enablePortScanning
|
|
1801
1764
|
};
|
|
1802
1765
|
default:
|
|
1803
1766
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
1804
1767
|
}
|
|
1805
1768
|
}
|
|
1806
1769
|
}
|
|
1807
|
-
function
|
|
1770
|
+
function $r() {
|
|
1808
1771
|
return `
|
|
1809
1772
|
/* ── metakyc-input-colors (ThemeManager failsafe — same rules as globals.css) ── */
|
|
1810
1773
|
.metakyc-sdk input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
|
|
@@ -1921,7 +1884,7 @@ class Br {
|
|
|
1921
1884
|
* These rules are placed BEFORE any custom CSS so that custom CSS can still override them.
|
|
1922
1885
|
*/
|
|
1923
1886
|
injectInputColors() {
|
|
1924
|
-
this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent =
|
|
1887
|
+
this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent = $r(), this.customStyleElement && this.customStyleElement.parentNode ? document.head.insertBefore(this.inputStyleElement, this.customStyleElement) : document.head.appendChild(this.inputStyleElement);
|
|
1925
1888
|
}
|
|
1926
1889
|
/**
|
|
1927
1890
|
* Inject custom CSS into document
|
|
@@ -1986,24 +1949,24 @@ class Br {
|
|
|
1986
1949
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1987
1950
|
}
|
|
1988
1951
|
}
|
|
1989
|
-
const
|
|
1952
|
+
const Ot = Vt(null), Kn = ({ config: e, children: t }) => {
|
|
1990
1953
|
const [n, a] = k(null), i = we.useRef(!1), o = we.useRef(!1), c = De(() => {
|
|
1991
|
-
const y = new
|
|
1954
|
+
const y = new pr(e), p = new mr(y), x = new yr(y), T = new hr(y), v = new fr(y), A = new gr(y), P = new br(y), w = new xr(y), N = new vr(y), z = new kr(y), Q = new Er(y), M = new Br();
|
|
1992
1955
|
return {
|
|
1993
1956
|
httpClient: y,
|
|
1994
1957
|
applicantService: p,
|
|
1995
1958
|
questionnaireService: x,
|
|
1996
|
-
uploadDocumentService:
|
|
1959
|
+
uploadDocumentService: T,
|
|
1997
1960
|
appropriatenessTestService: v,
|
|
1998
1961
|
overviewService: A,
|
|
1999
|
-
riskScoringService:
|
|
1962
|
+
riskScoringService: P,
|
|
2000
1963
|
identityService: w,
|
|
2001
1964
|
baseInformationService: N,
|
|
2002
1965
|
investorCategorizationService: z,
|
|
2003
1966
|
themeService: Q,
|
|
2004
1967
|
themeManager: M
|
|
2005
1968
|
};
|
|
2006
|
-
}, [e]),
|
|
1969
|
+
}, [e]), d = De(() => ({
|
|
2007
1970
|
config: e,
|
|
2008
1971
|
...c,
|
|
2009
1972
|
currentTheme: n,
|
|
@@ -2039,15 +2002,15 @@ const Mt = qt(null), Un = ({ config: e, children: t }) => {
|
|
|
2039
2002
|
}
|
|
2040
2003
|
})(), () => {
|
|
2041
2004
|
c.themeManager.cleanup();
|
|
2042
|
-
}), []), /* @__PURE__ */ r(
|
|
2005
|
+
}), []), /* @__PURE__ */ r(Ot.Provider, { value: d, children: t });
|
|
2043
2006
|
};
|
|
2044
|
-
function
|
|
2045
|
-
const e =
|
|
2007
|
+
function Pe() {
|
|
2008
|
+
const e = Yt(Ot);
|
|
2046
2009
|
if (!e)
|
|
2047
2010
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
2048
2011
|
return e;
|
|
2049
2012
|
}
|
|
2050
|
-
async function
|
|
2013
|
+
async function _r(e) {
|
|
2051
2014
|
return new Promise((t, n) => {
|
|
2052
2015
|
const a = new FileReader();
|
|
2053
2016
|
a.readAsDataURL(e), a.onload = () => {
|
|
@@ -2056,10 +2019,10 @@ async function $r(e) {
|
|
|
2056
2019
|
}, a.onerror = (i) => n(i);
|
|
2057
2020
|
});
|
|
2058
2021
|
}
|
|
2059
|
-
function
|
|
2022
|
+
function qn(e, t) {
|
|
2060
2023
|
return e.size <= t;
|
|
2061
2024
|
}
|
|
2062
|
-
function
|
|
2025
|
+
function Vn(e, t) {
|
|
2063
2026
|
return t.split(",").map((a) => a.trim()).some((a) => {
|
|
2064
2027
|
if (a.endsWith("/*")) {
|
|
2065
2028
|
const i = a.slice(0, -2);
|
|
@@ -2068,75 +2031,75 @@ function qn(e, t) {
|
|
|
2068
2031
|
return e.type === a;
|
|
2069
2032
|
});
|
|
2070
2033
|
}
|
|
2071
|
-
function
|
|
2034
|
+
function xt(e) {
|
|
2072
2035
|
if (e === 0) return "0 Bytes";
|
|
2073
2036
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
2074
2037
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
2075
2038
|
}
|
|
2076
|
-
function
|
|
2039
|
+
function Yn(e) {
|
|
2077
2040
|
return e;
|
|
2078
2041
|
}
|
|
2079
2042
|
function Ae(...e) {
|
|
2080
2043
|
return e.filter(Boolean).join(" ");
|
|
2081
2044
|
}
|
|
2082
|
-
const
|
|
2045
|
+
const ct = {
|
|
2083
2046
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
2084
2047
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
2085
2048
|
};
|
|
2086
|
-
function
|
|
2049
|
+
function jr(e) {
|
|
2087
2050
|
try {
|
|
2088
|
-
localStorage.setItem(
|
|
2051
|
+
localStorage.setItem(ct.APPLICANT_ID, e.toString());
|
|
2089
2052
|
} catch (t) {
|
|
2090
2053
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
2091
2054
|
}
|
|
2092
2055
|
}
|
|
2093
|
-
function
|
|
2056
|
+
function Hr() {
|
|
2094
2057
|
try {
|
|
2095
|
-
const e = localStorage.getItem(
|
|
2058
|
+
const e = localStorage.getItem(ct.APPLICANT_ID);
|
|
2096
2059
|
return e ? parseInt(e, 10) : null;
|
|
2097
2060
|
} catch (e) {
|
|
2098
2061
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
2099
2062
|
}
|
|
2100
2063
|
}
|
|
2101
|
-
function
|
|
2064
|
+
function Wr() {
|
|
2102
2065
|
try {
|
|
2103
|
-
localStorage.removeItem(
|
|
2066
|
+
localStorage.removeItem(ct.APPLICANT_ID);
|
|
2104
2067
|
} catch (e) {
|
|
2105
2068
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
2106
2069
|
}
|
|
2107
2070
|
}
|
|
2108
|
-
function
|
|
2071
|
+
function Ur(e) {
|
|
2109
2072
|
try {
|
|
2110
|
-
localStorage.setItem(
|
|
2073
|
+
localStorage.setItem(ct.WORKFLOW_STATE, JSON.stringify(e));
|
|
2111
2074
|
} catch (t) {
|
|
2112
2075
|
console.warn("Failed to save workflow state to storage:", t);
|
|
2113
2076
|
}
|
|
2114
2077
|
}
|
|
2115
|
-
function
|
|
2078
|
+
function Qn() {
|
|
2116
2079
|
try {
|
|
2117
|
-
const e = localStorage.getItem(
|
|
2080
|
+
const e = localStorage.getItem(ct.WORKFLOW_STATE);
|
|
2118
2081
|
return e ? JSON.parse(e) : null;
|
|
2119
2082
|
} catch (e) {
|
|
2120
2083
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
2121
2084
|
}
|
|
2122
2085
|
}
|
|
2123
|
-
function
|
|
2086
|
+
function Kr() {
|
|
2124
2087
|
try {
|
|
2125
|
-
localStorage.removeItem(
|
|
2088
|
+
localStorage.removeItem(ct.WORKFLOW_STATE);
|
|
2126
2089
|
} catch (e) {
|
|
2127
2090
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
2128
2091
|
}
|
|
2129
2092
|
}
|
|
2130
|
-
function
|
|
2131
|
-
|
|
2093
|
+
function Gn() {
|
|
2094
|
+
Wr(), Kr();
|
|
2132
2095
|
}
|
|
2133
|
-
function
|
|
2134
|
-
const { createOrchestrator: t } =
|
|
2096
|
+
function qr(e) {
|
|
2097
|
+
const { createOrchestrator: t } = Pe(), [n, a] = k(null), [i, o] = k(!1), [c, d] = k(null), y = de(null), p = e || Hr();
|
|
2135
2098
|
ge(() => {
|
|
2136
2099
|
y.current || (y.current = t());
|
|
2137
2100
|
}, [t]), ge(() => {
|
|
2138
2101
|
var M;
|
|
2139
|
-
n && p && (
|
|
2102
|
+
n && p && (jr(p), Ur({
|
|
2140
2103
|
applicantId: p,
|
|
2141
2104
|
currentStepOrder: (M = n.currentStep) == null ? void 0 : M.order,
|
|
2142
2105
|
status: n.status,
|
|
@@ -2145,25 +2108,25 @@ function Kr(e) {
|
|
|
2145
2108
|
nextWorkflowKey: n.nextWorkflowKey
|
|
2146
2109
|
}));
|
|
2147
2110
|
}, [n, p]);
|
|
2148
|
-
const x = de(!1),
|
|
2111
|
+
const x = de(!1), T = de(!1), v = ae(async () => {
|
|
2149
2112
|
if (!(!p || !y.current)) {
|
|
2150
2113
|
if (x.current) {
|
|
2151
2114
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
2152
2115
|
return;
|
|
2153
2116
|
}
|
|
2154
|
-
x.current = !0, o(!0),
|
|
2117
|
+
x.current = !0, o(!0), d(null);
|
|
2155
2118
|
try {
|
|
2156
2119
|
const M = await y.current.initialize(p);
|
|
2157
|
-
a(M),
|
|
2120
|
+
a(M), T.current = !0;
|
|
2158
2121
|
} catch (M) {
|
|
2159
|
-
|
|
2122
|
+
d(M);
|
|
2160
2123
|
} finally {
|
|
2161
2124
|
o(!1), x.current = !1;
|
|
2162
2125
|
}
|
|
2163
2126
|
}
|
|
2164
2127
|
}, [p]);
|
|
2165
2128
|
ge(() => {
|
|
2166
|
-
p && !
|
|
2129
|
+
p && !T.current && v();
|
|
2167
2130
|
}, [p, v]);
|
|
2168
2131
|
const A = ae(async () => {
|
|
2169
2132
|
if (y.current) {
|
|
@@ -2171,54 +2134,54 @@ function Kr(e) {
|
|
|
2171
2134
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
2172
2135
|
return;
|
|
2173
2136
|
}
|
|
2174
|
-
x.current = !0, o(!0),
|
|
2137
|
+
x.current = !0, o(!0), d(null);
|
|
2175
2138
|
try {
|
|
2176
2139
|
const M = await y.current.refreshProgress();
|
|
2177
2140
|
a(M);
|
|
2178
2141
|
} catch (M) {
|
|
2179
|
-
|
|
2142
|
+
d(M);
|
|
2180
2143
|
} finally {
|
|
2181
2144
|
o(!1), x.current = !1;
|
|
2182
2145
|
}
|
|
2183
2146
|
}
|
|
2184
|
-
}, []),
|
|
2147
|
+
}, []), P = ae(async () => {
|
|
2185
2148
|
if (y.current) {
|
|
2186
|
-
o(!0),
|
|
2149
|
+
o(!0), d(null);
|
|
2187
2150
|
try {
|
|
2188
2151
|
const M = await y.current.moveToNextStep();
|
|
2189
2152
|
a(M);
|
|
2190
2153
|
} catch (M) {
|
|
2191
|
-
|
|
2154
|
+
d(M);
|
|
2192
2155
|
} finally {
|
|
2193
2156
|
o(!1);
|
|
2194
2157
|
}
|
|
2195
2158
|
}
|
|
2196
2159
|
}, []), w = ae(async () => {
|
|
2197
2160
|
if (y.current) {
|
|
2198
|
-
o(!0),
|
|
2161
|
+
o(!0), d(null);
|
|
2199
2162
|
try {
|
|
2200
2163
|
const M = await y.current.moveToPreviousStep();
|
|
2201
2164
|
a(M);
|
|
2202
2165
|
} catch (M) {
|
|
2203
|
-
|
|
2166
|
+
d(M);
|
|
2204
2167
|
} finally {
|
|
2205
2168
|
o(!1);
|
|
2206
2169
|
}
|
|
2207
2170
|
}
|
|
2208
2171
|
}, []), N = ae(async (M) => {
|
|
2209
2172
|
if (y.current) {
|
|
2210
|
-
o(!0),
|
|
2173
|
+
o(!0), d(null);
|
|
2211
2174
|
try {
|
|
2212
2175
|
await y.current.submitCurrentStep(M);
|
|
2213
2176
|
const j = await y.current.refreshProgress();
|
|
2214
2177
|
a(j);
|
|
2215
2178
|
} catch (j) {
|
|
2216
|
-
throw
|
|
2179
|
+
throw d(j), j;
|
|
2217
2180
|
} finally {
|
|
2218
2181
|
o(!1);
|
|
2219
2182
|
}
|
|
2220
2183
|
}
|
|
2221
|
-
}, []), z =
|
|
2184
|
+
}, []), z = Rt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, j) => M.order - j.order) : [], [n == null ? void 0 : n.stepInfoList]), Q = Rt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2222
2185
|
return {
|
|
2223
2186
|
progress: n,
|
|
2224
2187
|
applicantId: p,
|
|
@@ -2234,14 +2197,14 @@ function Kr(e) {
|
|
|
2234
2197
|
isComplete: (n == null ? void 0 : n.status) === ze.Finished,
|
|
2235
2198
|
isOnHold: (n == null ? void 0 : n.status) === ze.OnHold,
|
|
2236
2199
|
refreshProgress: A,
|
|
2237
|
-
moveToNext:
|
|
2200
|
+
moveToNext: P,
|
|
2238
2201
|
moveBack: w,
|
|
2239
2202
|
submitCurrentStep: N,
|
|
2240
2203
|
orchestrator: y.current
|
|
2241
2204
|
};
|
|
2242
2205
|
}
|
|
2243
|
-
function
|
|
2244
|
-
const { questionnaireService: t, applicantService: n } =
|
|
2206
|
+
function Vr(e) {
|
|
2207
|
+
const { questionnaireService: t, applicantService: n } = Pe(), [a, i] = k(null), [o, c] = k({}), [d, y] = k(!1), [p, x] = k(!1), [T, v] = k(null), A = de(!1), P = de(null), w = ae(async () => {
|
|
2245
2208
|
var z, Q;
|
|
2246
2209
|
if (e) {
|
|
2247
2210
|
if (A.current) {
|
|
@@ -2260,12 +2223,12 @@ function qr(e) {
|
|
|
2260
2223
|
b.question && ((Q = b.answers) != null && Q.length) && K.set(b.question.trim().toLowerCase(), b.answers);
|
|
2261
2224
|
const ee = {}, E = M.questionGroups.flatMap((b) => b.questions ?? []);
|
|
2262
2225
|
for (const b of E) {
|
|
2263
|
-
const
|
|
2264
|
-
K.has(
|
|
2226
|
+
const $ = b.text.trim().toLowerCase();
|
|
2227
|
+
K.has($) && (ee[b.id] = K.get($));
|
|
2265
2228
|
}
|
|
2266
2229
|
c(ee);
|
|
2267
2230
|
}
|
|
2268
|
-
|
|
2231
|
+
P.current = e;
|
|
2269
2232
|
} catch (M) {
|
|
2270
2233
|
v(M);
|
|
2271
2234
|
} finally {
|
|
@@ -2274,7 +2237,7 @@ function qr(e) {
|
|
|
2274
2237
|
}
|
|
2275
2238
|
}, [e, t, n]);
|
|
2276
2239
|
ge(() => {
|
|
2277
|
-
e &&
|
|
2240
|
+
e && P.current !== e && w();
|
|
2278
2241
|
}, [e]);
|
|
2279
2242
|
const N = ae(
|
|
2280
2243
|
async (z) => {
|
|
@@ -2292,43 +2255,43 @@ function qr(e) {
|
|
|
2292
2255
|
return {
|
|
2293
2256
|
questionnaire: a,
|
|
2294
2257
|
initialAnswers: o,
|
|
2295
|
-
isLoading:
|
|
2258
|
+
isLoading: d,
|
|
2296
2259
|
isSubmitting: p,
|
|
2297
|
-
error:
|
|
2260
|
+
error: T,
|
|
2298
2261
|
load: w,
|
|
2299
2262
|
submit: N
|
|
2300
2263
|
};
|
|
2301
2264
|
}
|
|
2302
|
-
function
|
|
2303
|
-
const { uploadDocumentService: t } =
|
|
2265
|
+
function Yr(e) {
|
|
2266
|
+
const { uploadDocumentService: t } = Pe(), [n, a] = k(null), [i, o] = k(!1), [c, d] = k(!1), [y, p] = k(0), [x, T] = k(null), v = de(!1), A = de(null), P = ae(async () => {
|
|
2304
2267
|
if (e) {
|
|
2305
2268
|
if (v.current) {
|
|
2306
2269
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2307
2270
|
return;
|
|
2308
2271
|
}
|
|
2309
|
-
v.current = !0, o(!0),
|
|
2272
|
+
v.current = !0, o(!0), T(null);
|
|
2310
2273
|
try {
|
|
2311
2274
|
const N = await t.getUploadDocument(e);
|
|
2312
2275
|
a(N), A.current = e;
|
|
2313
2276
|
} catch (N) {
|
|
2314
|
-
|
|
2277
|
+
T(N);
|
|
2315
2278
|
} finally {
|
|
2316
2279
|
o(!1), v.current = !1;
|
|
2317
2280
|
}
|
|
2318
2281
|
}
|
|
2319
2282
|
}, [e, t]);
|
|
2320
2283
|
ge(() => {
|
|
2321
|
-
e && A.current !== e &&
|
|
2284
|
+
e && A.current !== e && P();
|
|
2322
2285
|
}, [e]);
|
|
2323
2286
|
const w = ae(
|
|
2324
2287
|
async (N) => {
|
|
2325
|
-
|
|
2288
|
+
d(!0), p(0), T(null);
|
|
2326
2289
|
try {
|
|
2327
2290
|
await t.fillUploadDocument(N), p(100);
|
|
2328
2291
|
} catch (z) {
|
|
2329
|
-
throw
|
|
2292
|
+
throw T(z), z;
|
|
2330
2293
|
} finally {
|
|
2331
|
-
|
|
2294
|
+
d(!1);
|
|
2332
2295
|
}
|
|
2333
2296
|
},
|
|
2334
2297
|
[t]
|
|
@@ -2339,12 +2302,12 @@ function Vr(e) {
|
|
|
2339
2302
|
isSubmitting: c,
|
|
2340
2303
|
uploadProgress: y,
|
|
2341
2304
|
error: x,
|
|
2342
|
-
load:
|
|
2305
|
+
load: P,
|
|
2343
2306
|
submit: w
|
|
2344
2307
|
};
|
|
2345
2308
|
}
|
|
2346
|
-
function
|
|
2347
|
-
const { appropriatenessTestService: t } =
|
|
2309
|
+
function Jn(e) {
|
|
2310
|
+
const { appropriatenessTestService: t } = Pe(), [n, a] = k(null), [i, o] = k(!1), [c, d] = k(!1), [y, p] = k(null), [x, T] = k(null), v = de(!1), A = de(null), P = ae(async () => {
|
|
2348
2311
|
if (e) {
|
|
2349
2312
|
if (v.current) {
|
|
2350
2313
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2362,18 +2325,18 @@ function Gn(e) {
|
|
|
2362
2325
|
}
|
|
2363
2326
|
}, [e, t]);
|
|
2364
2327
|
ge(() => {
|
|
2365
|
-
e && A.current !== e &&
|
|
2328
|
+
e && A.current !== e && P();
|
|
2366
2329
|
}, [e]);
|
|
2367
2330
|
const w = ae(
|
|
2368
2331
|
async (N) => {
|
|
2369
|
-
|
|
2332
|
+
d(!0), p(null);
|
|
2370
2333
|
try {
|
|
2371
2334
|
const z = await t.fillAppropriatenessTest(N);
|
|
2372
|
-
return
|
|
2335
|
+
return T(z), z;
|
|
2373
2336
|
} catch (z) {
|
|
2374
2337
|
throw p(z), z;
|
|
2375
2338
|
} finally {
|
|
2376
|
-
|
|
2339
|
+
d(!1);
|
|
2377
2340
|
}
|
|
2378
2341
|
},
|
|
2379
2342
|
[t]
|
|
@@ -2384,12 +2347,12 @@ function Gn(e) {
|
|
|
2384
2347
|
isLoading: i,
|
|
2385
2348
|
isSubmitting: c,
|
|
2386
2349
|
error: y,
|
|
2387
|
-
load:
|
|
2350
|
+
load: P,
|
|
2388
2351
|
submit: w
|
|
2389
2352
|
};
|
|
2390
2353
|
}
|
|
2391
|
-
function
|
|
2392
|
-
const { overviewService: t } =
|
|
2354
|
+
function Qr(e) {
|
|
2355
|
+
const { overviewService: t } = Pe(), [n, a] = k(null), [i, o] = k(!1), [c, d] = k(!1), [y, p] = k(null), x = de(!1), T = de(null), v = ae(async () => {
|
|
2393
2356
|
if (e) {
|
|
2394
2357
|
if (x.current) {
|
|
2395
2358
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2397,27 +2360,27 @@ function Yr(e) {
|
|
|
2397
2360
|
}
|
|
2398
2361
|
x.current = !0, o(!0), p(null);
|
|
2399
2362
|
try {
|
|
2400
|
-
const
|
|
2401
|
-
a(
|
|
2402
|
-
} catch (
|
|
2403
|
-
p(
|
|
2363
|
+
const P = await t.getOverviewData(e);
|
|
2364
|
+
a(P), T.current = e;
|
|
2365
|
+
} catch (P) {
|
|
2366
|
+
p(P);
|
|
2404
2367
|
} finally {
|
|
2405
2368
|
o(!1), x.current = !1;
|
|
2406
2369
|
}
|
|
2407
2370
|
}
|
|
2408
2371
|
}, [e, t]);
|
|
2409
2372
|
ge(() => {
|
|
2410
|
-
e &&
|
|
2373
|
+
e && T.current !== e && v();
|
|
2411
2374
|
}, [e]);
|
|
2412
2375
|
const A = ae(async () => {
|
|
2413
2376
|
if (e) {
|
|
2414
|
-
|
|
2377
|
+
d(!0), p(null);
|
|
2415
2378
|
try {
|
|
2416
2379
|
await t.passOverview(e);
|
|
2417
|
-
} catch (
|
|
2418
|
-
throw p(
|
|
2380
|
+
} catch (P) {
|
|
2381
|
+
throw p(P), P;
|
|
2419
2382
|
} finally {
|
|
2420
|
-
|
|
2383
|
+
d(!1);
|
|
2421
2384
|
}
|
|
2422
2385
|
}
|
|
2423
2386
|
}, [e, t]);
|
|
@@ -2430,30 +2393,30 @@ function Yr(e) {
|
|
|
2430
2393
|
passOverview: A
|
|
2431
2394
|
};
|
|
2432
2395
|
}
|
|
2433
|
-
function
|
|
2434
|
-
const { identityService: t } =
|
|
2396
|
+
function Gr(e) {
|
|
2397
|
+
const { identityService: t } = Pe(), [n, a] = k(
|
|
2435
2398
|
null
|
|
2436
|
-
), [i, o] = k(!1), [c,
|
|
2399
|
+
), [i, o] = k(!1), [c, d] = k(null), y = de(!1), p = ae(
|
|
2437
2400
|
async (v, A) => {
|
|
2438
2401
|
if (e) {
|
|
2439
2402
|
if (y.current) {
|
|
2440
2403
|
console.log("[Identity] Request already in progress, skipping...");
|
|
2441
2404
|
return;
|
|
2442
2405
|
}
|
|
2443
|
-
y.current = !0, o(!0),
|
|
2406
|
+
y.current = !0, o(!0), d(null);
|
|
2444
2407
|
try {
|
|
2445
|
-
const
|
|
2408
|
+
const P = {
|
|
2446
2409
|
applicantId: e,
|
|
2447
2410
|
restart: !1,
|
|
2448
2411
|
redirectUrl: v || "",
|
|
2449
2412
|
ttl: A || 604800
|
|
2450
2413
|
// Default: 7 days
|
|
2451
2414
|
};
|
|
2452
|
-
console.log("Identity request input:",
|
|
2453
|
-
const w = await t.identityRequest(
|
|
2415
|
+
console.log("Identity request input:", P);
|
|
2416
|
+
const w = await t.identityRequest(P);
|
|
2454
2417
|
return console.log("Identity request result:", w), a(w), w;
|
|
2455
|
-
} catch (
|
|
2456
|
-
throw
|
|
2418
|
+
} catch (P) {
|
|
2419
|
+
throw d(P), P;
|
|
2457
2420
|
} finally {
|
|
2458
2421
|
o(!1), y.current = !1;
|
|
2459
2422
|
}
|
|
@@ -2463,30 +2426,30 @@ function Qr(e) {
|
|
|
2463
2426
|
), x = ae(
|
|
2464
2427
|
async (v, A) => {
|
|
2465
2428
|
if (e) {
|
|
2466
|
-
o(!0),
|
|
2429
|
+
o(!0), d(null);
|
|
2467
2430
|
try {
|
|
2468
|
-
const
|
|
2431
|
+
const P = {
|
|
2469
2432
|
applicantId: e,
|
|
2470
2433
|
restart: !1,
|
|
2471
2434
|
redirectUrl: v,
|
|
2472
2435
|
ttl: A
|
|
2473
|
-
}, w = await t.identityCompanyRequest(
|
|
2436
|
+
}, w = await t.identityCompanyRequest(P);
|
|
2474
2437
|
return a(w), w;
|
|
2475
|
-
} catch (
|
|
2476
|
-
throw
|
|
2438
|
+
} catch (P) {
|
|
2439
|
+
throw d(P), P;
|
|
2477
2440
|
} finally {
|
|
2478
2441
|
o(!1);
|
|
2479
2442
|
}
|
|
2480
2443
|
}
|
|
2481
2444
|
},
|
|
2482
2445
|
[e, t]
|
|
2483
|
-
),
|
|
2446
|
+
), T = ae(async () => {
|
|
2484
2447
|
if (e) {
|
|
2485
2448
|
if (y.current) {
|
|
2486
2449
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
2487
2450
|
return;
|
|
2488
2451
|
}
|
|
2489
|
-
y.current = !0, o(!0),
|
|
2452
|
+
y.current = !0, o(!0), d(null);
|
|
2490
2453
|
try {
|
|
2491
2454
|
const v = {
|
|
2492
2455
|
applicantId: e,
|
|
@@ -2499,7 +2462,7 @@ function Qr(e) {
|
|
|
2499
2462
|
const A = await t.identityRequest(v);
|
|
2500
2463
|
return console.log("Restart identity result:", A), a(A), A;
|
|
2501
2464
|
} catch (v) {
|
|
2502
|
-
throw
|
|
2465
|
+
throw d(v), v;
|
|
2503
2466
|
} finally {
|
|
2504
2467
|
o(!1), y.current = !1;
|
|
2505
2468
|
}
|
|
@@ -2513,11 +2476,11 @@ function Qr(e) {
|
|
|
2513
2476
|
error: c,
|
|
2514
2477
|
requestIdentity: p,
|
|
2515
2478
|
requestCompanyIdentity: x,
|
|
2516
|
-
restartIdentity:
|
|
2479
|
+
restartIdentity: T
|
|
2517
2480
|
};
|
|
2518
2481
|
}
|
|
2519
|
-
function
|
|
2520
|
-
const { riskScoringService: t, applicantService: n } =
|
|
2482
|
+
function Jr(e) {
|
|
2483
|
+
const { riskScoringService: t, applicantService: n } = Pe(), [a, i] = k(null), [o, c] = k({}), [d, y] = k(!1), [p, x] = k(!1), [T, v] = k(null), [A, P] = k(null), w = de(!1), N = de(null), z = ae(async () => {
|
|
2521
2484
|
var M;
|
|
2522
2485
|
if (e) {
|
|
2523
2486
|
if (w.current) {
|
|
@@ -2534,10 +2497,10 @@ function Gr(e) {
|
|
|
2534
2497
|
const ee = K.riskScoringResults[0], E = {};
|
|
2535
2498
|
for (const b of ee.riskCriteriaResults ?? [])
|
|
2536
2499
|
if (b.riskCriteriaId != null && b.answer != null && b.answer !== "") {
|
|
2537
|
-
const
|
|
2500
|
+
const $ = [...new Set(
|
|
2538
2501
|
b.answer.split(",").map((V) => V.trim()).filter((V) => V !== "")
|
|
2539
2502
|
)];
|
|
2540
|
-
|
|
2503
|
+
$.length > 0 && (E[b.riskCriteriaId] = $);
|
|
2541
2504
|
}
|
|
2542
2505
|
c(E);
|
|
2543
2506
|
}
|
|
@@ -2557,7 +2520,7 @@ function Gr(e) {
|
|
|
2557
2520
|
x(!0), v(null);
|
|
2558
2521
|
try {
|
|
2559
2522
|
const j = await t.submitRiskScoring(M);
|
|
2560
|
-
return
|
|
2523
|
+
return P(j), j;
|
|
2561
2524
|
} catch (j) {
|
|
2562
2525
|
throw v(j), j;
|
|
2563
2526
|
} finally {
|
|
@@ -2570,25 +2533,25 @@ function Gr(e) {
|
|
|
2570
2533
|
criteria: a,
|
|
2571
2534
|
initialAnswers: o,
|
|
2572
2535
|
result: A,
|
|
2573
|
-
isLoading:
|
|
2536
|
+
isLoading: d,
|
|
2574
2537
|
isSubmitting: p,
|
|
2575
|
-
error:
|
|
2538
|
+
error: T,
|
|
2576
2539
|
load: z,
|
|
2577
2540
|
submit: Q
|
|
2578
2541
|
};
|
|
2579
2542
|
}
|
|
2580
|
-
function
|
|
2581
|
-
const { applicantService: e, config: t } =
|
|
2582
|
-
const
|
|
2583
|
-
return (A === "x" ?
|
|
2543
|
+
function zt() {
|
|
2544
|
+
const { applicantService: e, config: t } = Pe(), [n, a] = k(!1), [i, o] = k(null), c = de(!1), d = de(!1), y = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(A) {
|
|
2545
|
+
const P = Math.random() * 16 | 0;
|
|
2546
|
+
return (A === "x" ? P : P & 3 | 8).toString(16);
|
|
2584
2547
|
}), p = ae(
|
|
2585
2548
|
async (A) => {
|
|
2586
|
-
var
|
|
2549
|
+
var P;
|
|
2587
2550
|
if (c.current)
|
|
2588
2551
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2589
2552
|
c.current = !0, a(!0), o(null);
|
|
2590
2553
|
try {
|
|
2591
|
-
if (A.applicantAdditionalDatas || (A.applicantAdditionalDatas = []), (
|
|
2554
|
+
if (A.applicantAdditionalDatas || (A.applicantAdditionalDatas = []), (P = t.identityProviders) != null && P.sardinai) {
|
|
2592
2555
|
const N = y();
|
|
2593
2556
|
console.log("[SardinAI] Generated session key:", N), A.applicantAdditionalDatas.push({
|
|
2594
2557
|
paramName: "sessionKey",
|
|
@@ -2608,24 +2571,24 @@ function Ot() {
|
|
|
2608
2571
|
a(!0), o(null);
|
|
2609
2572
|
try {
|
|
2610
2573
|
return await e.createCompanyApplicant(A);
|
|
2611
|
-
} catch (
|
|
2612
|
-
throw o(
|
|
2574
|
+
} catch (P) {
|
|
2575
|
+
throw o(P), P;
|
|
2613
2576
|
} finally {
|
|
2614
2577
|
a(!1);
|
|
2615
2578
|
}
|
|
2616
2579
|
},
|
|
2617
2580
|
[e]
|
|
2618
|
-
),
|
|
2581
|
+
), T = ae(
|
|
2619
2582
|
async (A) => {
|
|
2620
|
-
if (
|
|
2583
|
+
if (d.current)
|
|
2621
2584
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2622
|
-
|
|
2585
|
+
d.current = !0, a(!0), o(null);
|
|
2623
2586
|
try {
|
|
2624
2587
|
return await e.getApplicantData(A);
|
|
2625
|
-
} catch (
|
|
2626
|
-
throw o(
|
|
2588
|
+
} catch (P) {
|
|
2589
|
+
throw o(P), P;
|
|
2627
2590
|
} finally {
|
|
2628
|
-
a(!1),
|
|
2591
|
+
a(!1), d.current = !1;
|
|
2629
2592
|
}
|
|
2630
2593
|
},
|
|
2631
2594
|
[e]
|
|
@@ -2634,8 +2597,8 @@ function Ot() {
|
|
|
2634
2597
|
a(!0), o(null);
|
|
2635
2598
|
try {
|
|
2636
2599
|
await e.stopProgress(A);
|
|
2637
|
-
} catch (
|
|
2638
|
-
throw o(
|
|
2600
|
+
} catch (P) {
|
|
2601
|
+
throw o(P), P;
|
|
2639
2602
|
} finally {
|
|
2640
2603
|
a(!1);
|
|
2641
2604
|
}
|
|
@@ -2647,11 +2610,11 @@ function Ot() {
|
|
|
2647
2610
|
error: i,
|
|
2648
2611
|
createApplicant: p,
|
|
2649
2612
|
createCompanyApplicant: x,
|
|
2650
|
-
getApplicantData:
|
|
2613
|
+
getApplicantData: T,
|
|
2651
2614
|
stopProgress: v
|
|
2652
2615
|
};
|
|
2653
2616
|
}
|
|
2654
|
-
const
|
|
2617
|
+
const Zr = {
|
|
2655
2618
|
primary: {
|
|
2656
2619
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
2657
2620
|
color: "#ffffff",
|
|
@@ -2685,7 +2648,7 @@ const Jr = {
|
|
|
2685
2648
|
disabled: i,
|
|
2686
2649
|
className: o,
|
|
2687
2650
|
style: c,
|
|
2688
|
-
...
|
|
2651
|
+
...d
|
|
2689
2652
|
}) => /* @__PURE__ */ s(
|
|
2690
2653
|
"button",
|
|
2691
2654
|
{
|
|
@@ -2694,9 +2657,9 @@ const Jr = {
|
|
|
2694
2657
|
md: "px-4 py-2 text-sm",
|
|
2695
2658
|
lg: "px-6 py-3 text-base"
|
|
2696
2659
|
}[n], o),
|
|
2697
|
-
style: { ...
|
|
2660
|
+
style: { ...Zr[t], ...c },
|
|
2698
2661
|
disabled: i || a,
|
|
2699
|
-
...
|
|
2662
|
+
...d,
|
|
2700
2663
|
children: [
|
|
2701
2664
|
a && /* @__PURE__ */ s(
|
|
2702
2665
|
"svg",
|
|
@@ -2731,8 +2694,8 @@ const Jr = {
|
|
|
2731
2694
|
e
|
|
2732
2695
|
]
|
|
2733
2696
|
}
|
|
2734
|
-
), xe =
|
|
2735
|
-
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: c, ...
|
|
2697
|
+
), xe = yt(
|
|
2698
|
+
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: c, ...d }, y) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2736
2699
|
e && /* @__PURE__ */ s(
|
|
2737
2700
|
"label",
|
|
2738
2701
|
{
|
|
@@ -2740,7 +2703,7 @@ const Jr = {
|
|
|
2740
2703
|
style: { color: "var(--metakyc-text-primary, #374151)" },
|
|
2741
2704
|
children: [
|
|
2742
2705
|
e,
|
|
2743
|
-
|
|
2706
|
+
d.required && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2744
2707
|
]
|
|
2745
2708
|
}
|
|
2746
2709
|
),
|
|
@@ -2759,13 +2722,13 @@ const Jr = {
|
|
|
2759
2722
|
o
|
|
2760
2723
|
),
|
|
2761
2724
|
style: {
|
|
2762
|
-
backgroundColor:
|
|
2725
|
+
backgroundColor: d.readOnly ? "var(--metakyc-surface, #f3f4f6)" : "var(--metakyc-input-bg, #ffffff)",
|
|
2763
2726
|
color: "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))",
|
|
2764
2727
|
borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
2765
|
-
cursor:
|
|
2728
|
+
cursor: d.readOnly ? "default" : void 0,
|
|
2766
2729
|
...c
|
|
2767
2730
|
},
|
|
2768
|
-
...
|
|
2731
|
+
...d
|
|
2769
2732
|
}
|
|
2770
2733
|
),
|
|
2771
2734
|
i && /* @__PURE__ */ r("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: i })
|
|
@@ -2809,7 +2772,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2809
2772
|
...n,
|
|
2810
2773
|
children: e
|
|
2811
2774
|
}
|
|
2812
|
-
),
|
|
2775
|
+
), Xr = {
|
|
2813
2776
|
// Theme-aware variants
|
|
2814
2777
|
default: {
|
|
2815
2778
|
backgroundColor: "var(--metakyc-surface, #f3f4f6)",
|
|
@@ -2832,14 +2795,14 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2832
2795
|
backgroundColor: "#fef3c7",
|
|
2833
2796
|
color: "#92400e"
|
|
2834
2797
|
}
|
|
2835
|
-
},
|
|
2798
|
+
}, $t = ({ children: e, variant: t = "default", className: n, style: a, ...i }) => /* @__PURE__ */ r(
|
|
2836
2799
|
"span",
|
|
2837
2800
|
{
|
|
2838
2801
|
className: Ae(
|
|
2839
2802
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2840
2803
|
n
|
|
2841
2804
|
),
|
|
2842
|
-
style: { ...
|
|
2805
|
+
style: { ...Xr[t], ...a },
|
|
2843
2806
|
...i,
|
|
2844
2807
|
children: e
|
|
2845
2808
|
}
|
|
@@ -2879,8 +2842,8 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2879
2842
|
]
|
|
2880
2843
|
}
|
|
2881
2844
|
) });
|
|
2882
|
-
},
|
|
2883
|
-
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: c, ...
|
|
2845
|
+
}, Ct = yt(
|
|
2846
|
+
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: c, ...d }, y) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2884
2847
|
e && /* @__PURE__ */ s(
|
|
2885
2848
|
"label",
|
|
2886
2849
|
{
|
|
@@ -2888,7 +2851,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2888
2851
|
style: { color: "var(--metakyc-text-primary, #374151)" },
|
|
2889
2852
|
children: [
|
|
2890
2853
|
e,
|
|
2891
|
-
|
|
2854
|
+
d.required && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2892
2855
|
]
|
|
2893
2856
|
}
|
|
2894
2857
|
),
|
|
@@ -2909,7 +2872,7 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2909
2872
|
borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
2910
2873
|
...c
|
|
2911
2874
|
},
|
|
2912
|
-
...
|
|
2875
|
+
...d,
|
|
2913
2876
|
children: [
|
|
2914
2877
|
i && /* @__PURE__ */ r(
|
|
2915
2878
|
"option",
|
|
@@ -2944,8 +2907,8 @@ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2944
2907
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
2945
2908
|
] })
|
|
2946
2909
|
);
|
|
2947
|
-
|
|
2948
|
-
const
|
|
2910
|
+
Ct.displayName = "Select";
|
|
2911
|
+
const Et = 280, en = ({
|
|
2949
2912
|
label: e,
|
|
2950
2913
|
value: t,
|
|
2951
2914
|
onChange: n,
|
|
@@ -2953,9 +2916,9 @@ const It = 280, Xr = ({
|
|
|
2953
2916
|
placeholder: i = "Select...",
|
|
2954
2917
|
disabled: o = !1,
|
|
2955
2918
|
readOnly: c = !1,
|
|
2956
|
-
required:
|
|
2919
|
+
required: d = !1
|
|
2957
2920
|
}) => {
|
|
2958
|
-
const y = o || c, [p, x] = k(!1), [
|
|
2921
|
+
const y = o || c, [p, x] = k(!1), [T, v] = k(""), [A, P] = k(null), [w, N] = k({
|
|
2959
2922
|
bg: "#ffffff",
|
|
2960
2923
|
borderColor: "#d1d5db",
|
|
2961
2924
|
textPrimary: "#111827",
|
|
@@ -2965,24 +2928,24 @@ const It = 280, Xr = ({
|
|
|
2965
2928
|
hoverBg: "#f9fafb"
|
|
2966
2929
|
}), z = de(null), Q = de(null), M = de(null), j = ae(() => {
|
|
2967
2930
|
if (!Q.current) return null;
|
|
2968
|
-
const F = Q.current.getBoundingClientRect(),
|
|
2969
|
-
return { top:
|
|
2931
|
+
const F = Q.current.getBoundingClientRect(), B = window.innerHeight - F.bottom < Et && F.top > Et;
|
|
2932
|
+
return { top: B ? F.top : F.bottom + 4, left: F.left, width: F.width, openUp: B };
|
|
2970
2933
|
}, []), K = ae(() => {
|
|
2971
|
-
const F = getComputedStyle(document.documentElement), U = (H, fe) => F.getPropertyValue(H).trim() || fe,
|
|
2934
|
+
const F = getComputedStyle(document.documentElement), U = (H, fe) => F.getPropertyValue(H).trim() || fe, B = U("--metakyc-input-bg", U("--metakyc-background", "#ffffff"));
|
|
2972
2935
|
N({
|
|
2973
|
-
bg:
|
|
2936
|
+
bg: B,
|
|
2974
2937
|
borderColor: U("--metakyc-input-border", U("--metakyc-border", "#d1d5db")),
|
|
2975
2938
|
textPrimary: U("--metakyc-input-text", U("--metakyc-text-primary", "#111827")),
|
|
2976
2939
|
textSecondary: U("--metakyc-text-secondary", "#6b7280"),
|
|
2977
2940
|
primaryColor: U("--metakyc-primary", "#2563eb"),
|
|
2978
2941
|
primaryLight: U("--metakyc-primary-light", "#eff6ff"),
|
|
2979
|
-
hoverBg: U("--metakyc-surface",
|
|
2942
|
+
hoverBg: U("--metakyc-surface", B)
|
|
2980
2943
|
});
|
|
2981
2944
|
}, []), ee = ae(() => {
|
|
2982
2945
|
if (y) return;
|
|
2983
2946
|
K();
|
|
2984
2947
|
const F = j();
|
|
2985
|
-
F &&
|
|
2948
|
+
F && P(F), x(!0);
|
|
2986
2949
|
}, [y, j, K]), E = ae(() => {
|
|
2987
2950
|
x(!1), v("");
|
|
2988
2951
|
}, []);
|
|
@@ -2990,29 +2953,29 @@ const It = 280, Xr = ({
|
|
|
2990
2953
|
if (!p) return;
|
|
2991
2954
|
const F = (U) => {
|
|
2992
2955
|
var H, fe;
|
|
2993
|
-
const
|
|
2994
|
-
!((H = z.current) != null && H.contains(
|
|
2956
|
+
const B = U.target;
|
|
2957
|
+
!((H = z.current) != null && H.contains(B)) && !((fe = M.current) != null && fe.contains(B)) && E();
|
|
2995
2958
|
};
|
|
2996
2959
|
return document.addEventListener("mousedown", F), () => document.removeEventListener("mousedown", F);
|
|
2997
2960
|
}, [p, E]), ge(() => {
|
|
2998
2961
|
if (!p) return;
|
|
2999
2962
|
const F = () => {
|
|
3000
2963
|
const U = j();
|
|
3001
|
-
U &&
|
|
2964
|
+
U && P(U);
|
|
3002
2965
|
};
|
|
3003
2966
|
return window.addEventListener("scroll", F, !0), window.addEventListener("resize", F), () => {
|
|
3004
2967
|
window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F);
|
|
3005
2968
|
};
|
|
3006
2969
|
}, [p, j]);
|
|
3007
2970
|
const b = a.filter(
|
|
3008
|
-
(F) => F.label.toLowerCase().includes(
|
|
3009
|
-
),
|
|
2971
|
+
(F) => F.label.toLowerCase().includes(T.toLowerCase())
|
|
2972
|
+
), $ = (F) => {
|
|
3010
2973
|
y || n(t.includes(F) ? t.filter((U) => U !== F) : [...t, F]);
|
|
3011
2974
|
}, V = (F, U) => {
|
|
3012
|
-
U.stopPropagation(), y || n(t.filter((
|
|
2975
|
+
U.stopPropagation(), y || n(t.filter((B) => B !== F));
|
|
3013
2976
|
}, G = (F) => {
|
|
3014
2977
|
var U;
|
|
3015
|
-
return ((U = a.find((
|
|
2978
|
+
return ((U = a.find((B) => B.value === F)) == null ? void 0 : U.label) || F;
|
|
3016
2979
|
}, { bg: _, borderColor: J, textPrimary: se, textSecondary: Y, primaryColor: ve, primaryLight: ue, hoverBg: me } = w, ke = p && A && /* @__PURE__ */ s(
|
|
3017
2980
|
"div",
|
|
3018
2981
|
{
|
|
@@ -3036,7 +2999,7 @@ const It = 280, Xr = ({
|
|
|
3036
2999
|
"input",
|
|
3037
3000
|
{
|
|
3038
3001
|
type: "text",
|
|
3039
|
-
value:
|
|
3002
|
+
value: T,
|
|
3040
3003
|
onChange: (F) => v(F.target.value),
|
|
3041
3004
|
placeholder: "Search...",
|
|
3042
3005
|
autoFocus: !0,
|
|
@@ -3055,8 +3018,8 @@ const It = 280, Xr = ({
|
|
|
3055
3018
|
boxSizing: "border-box"
|
|
3056
3019
|
},
|
|
3057
3020
|
onFocus: (F) => {
|
|
3058
|
-
const U = getComputedStyle(document.documentElement),
|
|
3059
|
-
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color = se, F.currentTarget.style.borderColor =
|
|
3021
|
+
const U = getComputedStyle(document.documentElement), B = U.getPropertyValue("--metakyc-input-border-focus").trim() || U.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3022
|
+
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color = se, F.currentTarget.style.borderColor = B, F.currentTarget.style.outline = "none", F.currentTarget.style.boxShadow = `0 0 0 2px ${B}33`;
|
|
3060
3023
|
},
|
|
3061
3024
|
onBlur: (F) => {
|
|
3062
3025
|
F.currentTarget.style.backgroundColor = _, F.currentTarget.style.color = se, F.currentTarget.style.borderColor = J, F.currentTarget.style.outline = "none", F.currentTarget.style.boxShadow = "none";
|
|
@@ -3068,7 +3031,7 @@ const It = 280, Xr = ({
|
|
|
3068
3031
|
return /* @__PURE__ */ s(
|
|
3069
3032
|
"li",
|
|
3070
3033
|
{
|
|
3071
|
-
onClick: () =>
|
|
3034
|
+
onClick: () => $(F.value),
|
|
3072
3035
|
className: "metakyc-multiselect-option",
|
|
3073
3036
|
style: {
|
|
3074
3037
|
display: "flex",
|
|
@@ -3081,11 +3044,11 @@ const It = 280, Xr = ({
|
|
|
3081
3044
|
color: U ? ve : se,
|
|
3082
3045
|
userSelect: "none"
|
|
3083
3046
|
},
|
|
3084
|
-
onMouseEnter: (
|
|
3085
|
-
U || (
|
|
3047
|
+
onMouseEnter: (B) => {
|
|
3048
|
+
U || (B.currentTarget.style.backgroundColor = me);
|
|
3086
3049
|
},
|
|
3087
|
-
onMouseLeave: (
|
|
3088
|
-
U || (
|
|
3050
|
+
onMouseLeave: (B) => {
|
|
3051
|
+
U || (B.currentTarget.style.backgroundColor = "transparent");
|
|
3089
3052
|
},
|
|
3090
3053
|
children: [
|
|
3091
3054
|
/* @__PURE__ */ r(
|
|
@@ -3129,7 +3092,7 @@ const It = 280, Xr = ({
|
|
|
3129
3092
|
style: { color: "var(--metakyc-text-primary, #374151)" },
|
|
3130
3093
|
children: [
|
|
3131
3094
|
e,
|
|
3132
|
-
|
|
3095
|
+
d && /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-error, #ef4444)", marginLeft: "4px" }, children: "*" })
|
|
3133
3096
|
]
|
|
3134
3097
|
}
|
|
3135
3098
|
),
|
|
@@ -3210,9 +3173,9 @@ const It = 280, Xr = ({
|
|
|
3210
3173
|
]
|
|
3211
3174
|
}
|
|
3212
3175
|
),
|
|
3213
|
-
typeof document < "u" && ke ?
|
|
3176
|
+
typeof document < "u" && ke ? St(ke, document.body) : null
|
|
3214
3177
|
] });
|
|
3215
|
-
},
|
|
3178
|
+
}, Ft = 260, qe = ({
|
|
3216
3179
|
label: e,
|
|
3217
3180
|
error: t,
|
|
3218
3181
|
helperText: n,
|
|
@@ -3220,13 +3183,13 @@ const It = 280, Xr = ({
|
|
|
3220
3183
|
placeholder: i = "Select...",
|
|
3221
3184
|
value: o,
|
|
3222
3185
|
onChange: c,
|
|
3223
|
-
disabled:
|
|
3186
|
+
disabled: d = !1,
|
|
3224
3187
|
readOnly: y = !1,
|
|
3225
3188
|
required: p = !1,
|
|
3226
3189
|
className: x
|
|
3227
3190
|
}) => {
|
|
3228
3191
|
var fe;
|
|
3229
|
-
const
|
|
3192
|
+
const T = d || y, [v, A] = k(!1), [P, w] = k(""), [N, z] = k(null), [Q, M] = k({
|
|
3230
3193
|
bg: "#ffffff",
|
|
3231
3194
|
border: "#d1d5db",
|
|
3232
3195
|
text: "#111827",
|
|
@@ -3245,9 +3208,9 @@ const It = 280, Xr = ({
|
|
|
3245
3208
|
primaryLight: te("--metakyc-primary-light", "#eff6ff"),
|
|
3246
3209
|
hoverBg: te("--metakyc-surface", ye)
|
|
3247
3210
|
});
|
|
3248
|
-
}, []), K = de(null), ee = de(null), E = de(null), b = de(null),
|
|
3211
|
+
}, []), K = de(null), ee = de(null), E = de(null), b = de(null), $ = ae(() => {
|
|
3249
3212
|
if (!ee.current) return null;
|
|
3250
|
-
const I = ee.current.getBoundingClientRect(), ye = window.innerHeight - I.bottom <
|
|
3213
|
+
const I = ee.current.getBoundingClientRect(), ye = window.innerHeight - I.bottom < Ft && I.top > Ft;
|
|
3251
3214
|
return {
|
|
3252
3215
|
top: ye ? I.top : I.bottom + 4,
|
|
3253
3216
|
left: I.left,
|
|
@@ -3255,11 +3218,11 @@ const It = 280, Xr = ({
|
|
|
3255
3218
|
openUp: ye
|
|
3256
3219
|
};
|
|
3257
3220
|
}, []), V = ae(() => {
|
|
3258
|
-
if (
|
|
3221
|
+
if (T) return;
|
|
3259
3222
|
j();
|
|
3260
|
-
const I =
|
|
3223
|
+
const I = $();
|
|
3261
3224
|
I && z(I), A(!0);
|
|
3262
|
-
}, [
|
|
3225
|
+
}, [T, $, j]), G = ae(() => {
|
|
3263
3226
|
A(!1), w("");
|
|
3264
3227
|
}, []), _ = () => v ? G() : V();
|
|
3265
3228
|
ge(() => {
|
|
@@ -3273,23 +3236,23 @@ const It = 280, Xr = ({
|
|
|
3273
3236
|
}, [v, G]), ge(() => {
|
|
3274
3237
|
if (!v) return;
|
|
3275
3238
|
const I = () => {
|
|
3276
|
-
const te =
|
|
3239
|
+
const te = $();
|
|
3277
3240
|
te && z(te);
|
|
3278
3241
|
};
|
|
3279
3242
|
return window.addEventListener("scroll", I, !0), window.addEventListener("resize", I), () => {
|
|
3280
3243
|
window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
|
|
3281
3244
|
};
|
|
3282
|
-
}, [v,
|
|
3245
|
+
}, [v, $]), ge(() => {
|
|
3283
3246
|
v && b.current && setTimeout(() => {
|
|
3284
3247
|
var I;
|
|
3285
3248
|
return (I = b.current) == null ? void 0 : I.focus();
|
|
3286
3249
|
}, 0);
|
|
3287
3250
|
}, [v]);
|
|
3288
3251
|
const J = a.filter(
|
|
3289
|
-
(I) => I.label.toLowerCase().includes(
|
|
3252
|
+
(I) => I.label.toLowerCase().includes(P.toLowerCase()) || I.value.toLowerCase().includes(P.toLowerCase())
|
|
3290
3253
|
), se = (fe = a.find((I) => I.value === o)) == null ? void 0 : fe.label, Y = (I, te) => {
|
|
3291
|
-
|
|
3292
|
-
}, { bg: ve, border: ue, text: me, textSecondary: ke, primary: F, primaryLight: U, hoverBg:
|
|
3254
|
+
T || te || (c(I), G());
|
|
3255
|
+
}, { bg: ve, border: ue, text: me, textSecondary: ke, primary: F, primaryLight: U, hoverBg: B } = Q, H = v && N && /* @__PURE__ */ s(
|
|
3293
3256
|
"div",
|
|
3294
3257
|
{
|
|
3295
3258
|
ref: E,
|
|
@@ -3313,7 +3276,7 @@ const It = 280, Xr = ({
|
|
|
3313
3276
|
{
|
|
3314
3277
|
ref: b,
|
|
3315
3278
|
type: "text",
|
|
3316
|
-
value:
|
|
3279
|
+
value: P,
|
|
3317
3280
|
onChange: (I) => w(I.target.value),
|
|
3318
3281
|
placeholder: "Search...",
|
|
3319
3282
|
onClick: (I) => I.stopPropagation(),
|
|
@@ -3366,7 +3329,7 @@ const It = 280, Xr = ({
|
|
|
3366
3329
|
userSelect: "none"
|
|
3367
3330
|
},
|
|
3368
3331
|
onMouseEnter: (ye) => {
|
|
3369
|
-
!te && !I.disabled && (ye.currentTarget.style.backgroundColor =
|
|
3332
|
+
!te && !I.disabled && (ye.currentTarget.style.backgroundColor = B);
|
|
3370
3333
|
},
|
|
3371
3334
|
onMouseLeave: (ye) => {
|
|
3372
3335
|
te || (ye.currentTarget.style.backgroundColor = "transparent");
|
|
@@ -3403,7 +3366,7 @@ const It = 280, Xr = ({
|
|
|
3403
3366
|
{
|
|
3404
3367
|
ref: ee,
|
|
3405
3368
|
role: "button",
|
|
3406
|
-
tabIndex:
|
|
3369
|
+
tabIndex: T ? -1 : 0,
|
|
3407
3370
|
onClick: _,
|
|
3408
3371
|
onKeyDown: (I) => {
|
|
3409
3372
|
(I.key === "Enter" || I.key === " ") && (I.preventDefault(), _()), I.key === "Escape" && G();
|
|
@@ -3413,7 +3376,7 @@ const It = 280, Xr = ({
|
|
|
3413
3376
|
"w-full px-3 py-2 rounded-lg border text-sm transition-colors text-left",
|
|
3414
3377
|
"flex items-center justify-between gap-2",
|
|
3415
3378
|
"focus:outline-none",
|
|
3416
|
-
|
|
3379
|
+
T ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
3417
3380
|
),
|
|
3418
3381
|
style: {
|
|
3419
3382
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
@@ -3436,19 +3399,19 @@ const It = 280, Xr = ({
|
|
|
3436
3399
|
]
|
|
3437
3400
|
}
|
|
3438
3401
|
),
|
|
3439
|
-
typeof document < "u" && H ?
|
|
3402
|
+
typeof document < "u" && H ? St(H, document.body) : null,
|
|
3440
3403
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3441
3404
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3442
3405
|
]
|
|
3443
3406
|
}
|
|
3444
3407
|
);
|
|
3445
3408
|
};
|
|
3446
|
-
|
|
3447
|
-
function
|
|
3409
|
+
qe.displayName = "SearchableSelect";
|
|
3410
|
+
function tn(e) {
|
|
3448
3411
|
const t = e.type;
|
|
3449
3412
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : "file";
|
|
3450
3413
|
}
|
|
3451
|
-
const
|
|
3414
|
+
const rn = ({
|
|
3452
3415
|
label: e,
|
|
3453
3416
|
subtitle: t,
|
|
3454
3417
|
error: n,
|
|
@@ -3456,32 +3419,32 @@ const tn = ({
|
|
|
3456
3419
|
multiple: i = !1,
|
|
3457
3420
|
maxSize: o,
|
|
3458
3421
|
required: c,
|
|
3459
|
-
onChange:
|
|
3422
|
+
onChange: d,
|
|
3460
3423
|
value: y = [],
|
|
3461
3424
|
className: p
|
|
3462
3425
|
}) => {
|
|
3463
|
-
const [x,
|
|
3426
|
+
const [x, T] = k(!1), [v, A] = k(null), P = de(null), w = ae((E) => {
|
|
3464
3427
|
if (!E) return;
|
|
3465
3428
|
A(null);
|
|
3466
3429
|
const b = Array.from(E);
|
|
3467
3430
|
if (o && b.filter((V) => V.size > o).length > 0) {
|
|
3468
|
-
A(`File exceeds the maximum size of ${
|
|
3431
|
+
A(`File exceeds the maximum size of ${xt(o)}`);
|
|
3469
3432
|
return;
|
|
3470
3433
|
}
|
|
3471
|
-
|
|
3472
|
-
}, [o, i,
|
|
3473
|
-
E.preventDefault(), E.stopPropagation(),
|
|
3434
|
+
d == null || d(i ? [...y, ...b] : [b[0]]);
|
|
3435
|
+
}, [o, i, d, y]), N = ae((E) => {
|
|
3436
|
+
E.preventDefault(), E.stopPropagation(), T(!0);
|
|
3474
3437
|
}, []), z = ae((E) => {
|
|
3475
|
-
E.preventDefault(), E.stopPropagation(),
|
|
3438
|
+
E.preventDefault(), E.stopPropagation(), T(!1);
|
|
3476
3439
|
}, []), Q = ae((E) => {
|
|
3477
|
-
E.preventDefault(), E.stopPropagation(),
|
|
3440
|
+
E.preventDefault(), E.stopPropagation(), T(!1), w(E.dataTransfer.files);
|
|
3478
3441
|
}, [w]), M = () => {
|
|
3479
3442
|
var E;
|
|
3480
|
-
(E =
|
|
3443
|
+
(E = P.current) == null || E.click();
|
|
3481
3444
|
}, j = (E) => {
|
|
3482
3445
|
A(null);
|
|
3483
|
-
const b = y.filter((
|
|
3484
|
-
|
|
3446
|
+
const b = y.filter(($, V) => V !== E);
|
|
3447
|
+
d == null || d(b);
|
|
3485
3448
|
}, K = n || v, ee = y.length > 0;
|
|
3486
3449
|
return /* @__PURE__ */ s("div", { className: Ae("metakyc-file-upload", p), style: { width: "100%" }, children: [
|
|
3487
3450
|
e && /* @__PURE__ */ s("div", { style: { marginBottom: "8px" }, children: [
|
|
@@ -3523,7 +3486,7 @@ const tn = ({
|
|
|
3523
3486
|
/* @__PURE__ */ r(
|
|
3524
3487
|
"input",
|
|
3525
3488
|
{
|
|
3526
|
-
ref:
|
|
3489
|
+
ref: P,
|
|
3527
3490
|
type: "file",
|
|
3528
3491
|
style: { display: "none" },
|
|
3529
3492
|
accept: a,
|
|
@@ -3579,7 +3542,7 @@ const tn = ({
|
|
|
3579
3542
|
a && o && /* @__PURE__ */ r("span", { children: " · " }),
|
|
3580
3543
|
o && /* @__PURE__ */ s("span", { children: [
|
|
3581
3544
|
"Max ",
|
|
3582
|
-
|
|
3545
|
+
xt(o)
|
|
3583
3546
|
] })
|
|
3584
3547
|
] })
|
|
3585
3548
|
] })
|
|
@@ -3588,7 +3551,7 @@ const tn = ({
|
|
|
3588
3551
|
}
|
|
3589
3552
|
),
|
|
3590
3553
|
ee && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, b) => {
|
|
3591
|
-
const
|
|
3554
|
+
const $ = tn(E), V = $ === "image", G = V ? URL.createObjectURL(E) : null;
|
|
3592
3555
|
return /* @__PURE__ */ s(
|
|
3593
3556
|
"div",
|
|
3594
3557
|
{
|
|
@@ -3625,7 +3588,7 @@ const tn = ({
|
|
|
3625
3588
|
alt: E.name,
|
|
3626
3589
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
3627
3590
|
}
|
|
3628
|
-
) :
|
|
3591
|
+
) : $ === "pdf" ? /* @__PURE__ */ s("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3629
3592
|
/* @__PURE__ */ r("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
3630
3593
|
/* @__PURE__ */ r("polyline", { points: "14 2 14 8 20 8" }),
|
|
3631
3594
|
/* @__PURE__ */ r("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
@@ -3647,7 +3610,7 @@ const tn = ({
|
|
|
3647
3610
|
textOverflow: "ellipsis",
|
|
3648
3611
|
whiteSpace: "nowrap"
|
|
3649
3612
|
}, children: E.name }),
|
|
3650
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children:
|
|
3613
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: xt(E.size) })
|
|
3651
3614
|
] }),
|
|
3652
3615
|
/* @__PURE__ */ r(
|
|
3653
3616
|
"button",
|
|
@@ -3690,7 +3653,7 @@ const tn = ({
|
|
|
3690
3653
|
}) }),
|
|
3691
3654
|
K && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: K })
|
|
3692
3655
|
] });
|
|
3693
|
-
},
|
|
3656
|
+
}, nn = yt(
|
|
3694
3657
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
3695
3658
|
a.label && /* @__PURE__ */ s(
|
|
3696
3659
|
"label",
|
|
@@ -3736,7 +3699,7 @@ const tn = ({
|
|
|
3736
3699
|
a.error && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: a.error })
|
|
3737
3700
|
] })
|
|
3738
3701
|
);
|
|
3739
|
-
|
|
3702
|
+
nn.displayName = "PhoneInput";
|
|
3740
3703
|
/**
|
|
3741
3704
|
* @license lucide-react v0.574.0 - ISC
|
|
3742
3705
|
*
|
|
@@ -3750,14 +3713,14 @@ const Bt = (...e) => e.filter((t, n, a) => !!t && t.trim() !== "" && a.indexOf(t
|
|
|
3750
3713
|
* This source code is licensed under the ISC license.
|
|
3751
3714
|
* See the LICENSE file in the root directory of this source tree.
|
|
3752
3715
|
*/
|
|
3753
|
-
const
|
|
3716
|
+
const an = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3754
3717
|
/**
|
|
3755
3718
|
* @license lucide-react v0.574.0 - ISC
|
|
3756
3719
|
*
|
|
3757
3720
|
* This source code is licensed under the ISC license.
|
|
3758
3721
|
* See the LICENSE file in the root directory of this source tree.
|
|
3759
3722
|
*/
|
|
3760
|
-
const
|
|
3723
|
+
const sn = (e) => e.replace(
|
|
3761
3724
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3762
3725
|
(t, n, a) => a ? a.toUpperCase() : n.toLowerCase()
|
|
3763
3726
|
);
|
|
@@ -3767,8 +3730,8 @@ const an = (e) => e.replace(
|
|
|
3767
3730
|
* This source code is licensed under the ISC license.
|
|
3768
3731
|
* See the LICENSE file in the root directory of this source tree.
|
|
3769
3732
|
*/
|
|
3770
|
-
const
|
|
3771
|
-
const t =
|
|
3733
|
+
const At = (e) => {
|
|
3734
|
+
const t = sn(e);
|
|
3772
3735
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3773
3736
|
};
|
|
3774
3737
|
/**
|
|
@@ -3777,7 +3740,7 @@ const Ft = (e) => {
|
|
|
3777
3740
|
* This source code is licensed under the ISC license.
|
|
3778
3741
|
* See the LICENSE file in the root directory of this source tree.
|
|
3779
3742
|
*/
|
|
3780
|
-
var
|
|
3743
|
+
var on = {
|
|
3781
3744
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3782
3745
|
width: 24,
|
|
3783
3746
|
height: 24,
|
|
@@ -3794,7 +3757,7 @@ var sn = {
|
|
|
3794
3757
|
* This source code is licensed under the ISC license.
|
|
3795
3758
|
* See the LICENSE file in the root directory of this source tree.
|
|
3796
3759
|
*/
|
|
3797
|
-
const
|
|
3760
|
+
const ln = (e) => {
|
|
3798
3761
|
for (const t in e)
|
|
3799
3762
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3800
3763
|
return !0;
|
|
@@ -3806,7 +3769,7 @@ const on = (e) => {
|
|
|
3806
3769
|
* This source code is licensed under the ISC license.
|
|
3807
3770
|
* See the LICENSE file in the root directory of this source tree.
|
|
3808
3771
|
*/
|
|
3809
|
-
const
|
|
3772
|
+
const cn = yt(
|
|
3810
3773
|
({
|
|
3811
3774
|
color: e = "currentColor",
|
|
3812
3775
|
size: t = 24,
|
|
@@ -3815,22 +3778,22 @@ const ln = mt(
|
|
|
3815
3778
|
className: i = "",
|
|
3816
3779
|
children: o,
|
|
3817
3780
|
iconNode: c,
|
|
3818
|
-
...
|
|
3819
|
-
}, y) =>
|
|
3781
|
+
...d
|
|
3782
|
+
}, y) => wt(
|
|
3820
3783
|
"svg",
|
|
3821
3784
|
{
|
|
3822
3785
|
ref: y,
|
|
3823
|
-
...
|
|
3786
|
+
...on,
|
|
3824
3787
|
width: t,
|
|
3825
3788
|
height: t,
|
|
3826
3789
|
stroke: e,
|
|
3827
3790
|
strokeWidth: a ? Number(n) * 24 / Number(t) : n,
|
|
3828
3791
|
className: Bt("lucide", i),
|
|
3829
|
-
...!o && !
|
|
3830
|
-
...
|
|
3792
|
+
...!o && !ln(d) && { "aria-hidden": "true" },
|
|
3793
|
+
...d
|
|
3831
3794
|
},
|
|
3832
3795
|
[
|
|
3833
|
-
...c.map(([p, x]) =>
|
|
3796
|
+
...c.map(([p, x]) => wt(p, x)),
|
|
3834
3797
|
...Array.isArray(o) ? o : [o]
|
|
3835
3798
|
]
|
|
3836
3799
|
)
|
|
@@ -3841,20 +3804,20 @@ const ln = mt(
|
|
|
3841
3804
|
* This source code is licensed under the ISC license.
|
|
3842
3805
|
* See the LICENSE file in the root directory of this source tree.
|
|
3843
3806
|
*/
|
|
3844
|
-
const
|
|
3845
|
-
const n =
|
|
3846
|
-
({ className: a, ...i }, o) =>
|
|
3807
|
+
const _t = (e, t) => {
|
|
3808
|
+
const n = yt(
|
|
3809
|
+
({ className: a, ...i }, o) => wt(cn, {
|
|
3847
3810
|
ref: o,
|
|
3848
3811
|
iconNode: t,
|
|
3849
3812
|
className: Bt(
|
|
3850
|
-
`lucide-${
|
|
3813
|
+
`lucide-${an(At(e))}`,
|
|
3851
3814
|
`lucide-${e}`,
|
|
3852
3815
|
a
|
|
3853
3816
|
),
|
|
3854
3817
|
...i
|
|
3855
3818
|
})
|
|
3856
3819
|
);
|
|
3857
|
-
return n.displayName =
|
|
3820
|
+
return n.displayName = At(e), n;
|
|
3858
3821
|
};
|
|
3859
3822
|
/**
|
|
3860
3823
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3862,15 +3825,15 @@ const $t = (e, t) => {
|
|
|
3862
3825
|
* This source code is licensed under the ISC license.
|
|
3863
3826
|
* See the LICENSE file in the root directory of this source tree.
|
|
3864
3827
|
*/
|
|
3865
|
-
const
|
|
3828
|
+
const dn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], jt = _t("chevron-left", dn);
|
|
3866
3829
|
/**
|
|
3867
3830
|
* @license lucide-react v0.574.0 - ISC
|
|
3868
3831
|
*
|
|
3869
3832
|
* This source code is licensed under the ISC license.
|
|
3870
3833
|
* See the LICENSE file in the root directory of this source tree.
|
|
3871
3834
|
*/
|
|
3872
|
-
const
|
|
3873
|
-
function
|
|
3835
|
+
const un = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ht = _t("chevron-right", un);
|
|
3836
|
+
function pn(e, t) {
|
|
3874
3837
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3875
3838
|
if (e.isRequired && n)
|
|
3876
3839
|
return e.errorMessage || "This field is required";
|
|
@@ -3899,7 +3862,7 @@ function un(e, t) {
|
|
|
3899
3862
|
}
|
|
3900
3863
|
return null;
|
|
3901
3864
|
}
|
|
3902
|
-
function
|
|
3865
|
+
function mn(e) {
|
|
3903
3866
|
const t = e.flatMap(
|
|
3904
3867
|
(a, i) => (a.questions ?? []).map((o, c) => ({ question: o, groupIndex: i, qIdx: c }))
|
|
3905
3868
|
), n = /* @__PURE__ */ new Map();
|
|
@@ -3909,39 +3872,39 @@ function pn(e) {
|
|
|
3909
3872
|
}
|
|
3910
3873
|
return Array.from(n.entries()).sort(([a], [i]) => a - i).map(([, a]) => a);
|
|
3911
3874
|
}
|
|
3912
|
-
const
|
|
3875
|
+
const yn = ({
|
|
3913
3876
|
applicantId: e,
|
|
3914
3877
|
onComplete: t,
|
|
3915
3878
|
onBack: n
|
|
3916
3879
|
}) => {
|
|
3917
|
-
const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: c, error:
|
|
3880
|
+
const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: c, error: d, submit: y } = Vr(e), [p, x] = k({}), [T, v] = k({}), [A, P] = k(0);
|
|
3918
3881
|
we.useEffect(() => {
|
|
3919
3882
|
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && x(i);
|
|
3920
3883
|
}, [i]);
|
|
3921
3884
|
const w = De(
|
|
3922
|
-
() => a ?
|
|
3885
|
+
() => a ? mn(a.questionGroups) : [],
|
|
3923
3886
|
[a]
|
|
3924
3887
|
), N = A === w.length - 1, z = w[A] ?? [], Q = ae((E, b) => {
|
|
3925
|
-
x((
|
|
3926
|
-
const V = {
|
|
3888
|
+
x(($) => ({ ...$, [E]: b })), v(($) => {
|
|
3889
|
+
const V = { ...$ };
|
|
3927
3890
|
return delete V[E], V;
|
|
3928
3891
|
});
|
|
3929
3892
|
}, []), M = ae(() => {
|
|
3930
3893
|
const E = {};
|
|
3931
3894
|
for (const { question: b } of z) {
|
|
3932
|
-
const
|
|
3933
|
-
|
|
3895
|
+
const $ = pn(b, p[b.id] ?? []);
|
|
3896
|
+
$ && (E[b.id] = $);
|
|
3934
3897
|
}
|
|
3935
3898
|
return v((b) => ({ ...b, ...E })), Object.keys(E).length === 0;
|
|
3936
3899
|
}, [z, p]), j = () => {
|
|
3937
|
-
M() &&
|
|
3900
|
+
M() && P((E) => E + 1);
|
|
3938
3901
|
}, K = () => {
|
|
3939
|
-
A > 0 ?
|
|
3902
|
+
A > 0 ? P((E) => E - 1) : n == null || n();
|
|
3940
3903
|
}, ee = async () => {
|
|
3941
3904
|
if (!(!M() || !a))
|
|
3942
3905
|
try {
|
|
3943
3906
|
const E = a.questionGroups.flatMap(
|
|
3944
|
-
(
|
|
3907
|
+
($) => ($.questions ?? []).map((V) => ({
|
|
3945
3908
|
questionId: V.id,
|
|
3946
3909
|
values: p[V.id] ?? []
|
|
3947
3910
|
}))
|
|
@@ -3955,9 +3918,9 @@ const mn = ({
|
|
|
3955
3918
|
console.error("Questionnaire submit error:", E);
|
|
3956
3919
|
}
|
|
3957
3920
|
};
|
|
3958
|
-
return o ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) :
|
|
3921
|
+
return o ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : d ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
3959
3922
|
"Error loading questionnaire: ",
|
|
3960
|
-
|
|
3923
|
+
d.message
|
|
3961
3924
|
] }) }) }) : a ? /* @__PURE__ */ s(re, { children: [
|
|
3962
3925
|
/* @__PURE__ */ s(Se, { children: [
|
|
3963
3926
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
@@ -3984,11 +3947,11 @@ const mn = ({
|
|
|
3984
3947
|
] })
|
|
3985
3948
|
] }),
|
|
3986
3949
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: z.map(({ question: E }) => /* @__PURE__ */ r(
|
|
3987
|
-
|
|
3950
|
+
hn,
|
|
3988
3951
|
{
|
|
3989
3952
|
question: E,
|
|
3990
3953
|
value: p[E.id] ?? [],
|
|
3991
|
-
error:
|
|
3954
|
+
error: T[E.id],
|
|
3992
3955
|
onChange: (b) => Q(E.id, b)
|
|
3993
3956
|
},
|
|
3994
3957
|
E.id
|
|
@@ -4002,7 +3965,7 @@ const mn = ({
|
|
|
4002
3965
|
onClick: K,
|
|
4003
3966
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4004
3967
|
children: [
|
|
4005
|
-
/* @__PURE__ */ r(
|
|
3968
|
+
/* @__PURE__ */ r(jt, { size: 14 }),
|
|
4006
3969
|
A > 0 ? "Previous" : "Back"
|
|
4007
3970
|
]
|
|
4008
3971
|
}
|
|
@@ -4023,14 +3986,14 @@ const mn = ({
|
|
|
4023
3986
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4024
3987
|
children: [
|
|
4025
3988
|
"Next",
|
|
4026
|
-
/* @__PURE__ */ r(
|
|
3989
|
+
/* @__PURE__ */ r(Ht, { size: 14 })
|
|
4027
3990
|
]
|
|
4028
3991
|
}
|
|
4029
3992
|
)
|
|
4030
3993
|
] }),
|
|
4031
|
-
|
|
3994
|
+
d && /* @__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: d.message }) })
|
|
4032
3995
|
] }) : null;
|
|
4033
|
-
},
|
|
3996
|
+
}, hn = ({ question: e, value: t, error: n, onChange: a }) => {
|
|
4034
3997
|
var c;
|
|
4035
3998
|
const o = (((c = e.defaultAnswers) == null ? void 0 : c.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
4036
3999
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
@@ -4044,25 +4007,25 @@ const mn = ({
|
|
|
4044
4007
|
xe,
|
|
4045
4008
|
{
|
|
4046
4009
|
value: t[0] ?? "",
|
|
4047
|
-
onChange: (
|
|
4010
|
+
onChange: (d) => a([d.target.value]),
|
|
4048
4011
|
placeholder: e.subtitle ? void 0 : "Enter your answer…",
|
|
4049
4012
|
error: n,
|
|
4050
4013
|
required: e.isRequired
|
|
4051
4014
|
}
|
|
4052
4015
|
),
|
|
4053
4016
|
o === "single-select" && /* @__PURE__ */ r(
|
|
4054
|
-
|
|
4017
|
+
Ct,
|
|
4055
4018
|
{
|
|
4056
4019
|
value: t[0] ?? "",
|
|
4057
|
-
onChange: (
|
|
4058
|
-
options: (e.defaultAnswers ?? []).map((
|
|
4020
|
+
onChange: (d) => a([d.target.value]),
|
|
4021
|
+
options: (e.defaultAnswers ?? []).map((d) => ({ value: d, label: d })),
|
|
4059
4022
|
placeholder: "Select an option…",
|
|
4060
4023
|
error: n,
|
|
4061
4024
|
required: e.isRequired
|
|
4062
4025
|
}
|
|
4063
4026
|
),
|
|
4064
4027
|
o === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4065
|
-
(e.defaultAnswers ?? []).map((
|
|
4028
|
+
(e.defaultAnswers ?? []).map((d) => /* @__PURE__ */ s(
|
|
4066
4029
|
"label",
|
|
4067
4030
|
{
|
|
4068
4031
|
className: "metakyc-option-label",
|
|
@@ -4072,8 +4035,8 @@ const mn = ({
|
|
|
4072
4035
|
"input",
|
|
4073
4036
|
{
|
|
4074
4037
|
type: "radio",
|
|
4075
|
-
checked: t[0] ===
|
|
4076
|
-
onChange: () => a([
|
|
4038
|
+
checked: t[0] === d,
|
|
4039
|
+
onChange: () => a([d]),
|
|
4077
4040
|
className: "metakyc-option-input",
|
|
4078
4041
|
style: {
|
|
4079
4042
|
width: "16px",
|
|
@@ -4090,15 +4053,15 @@ const mn = ({
|
|
|
4090
4053
|
}
|
|
4091
4054
|
}
|
|
4092
4055
|
),
|
|
4093
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
4056
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: d })
|
|
4094
4057
|
]
|
|
4095
4058
|
},
|
|
4096
|
-
|
|
4059
|
+
d
|
|
4097
4060
|
)),
|
|
4098
4061
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4099
4062
|
] }),
|
|
4100
4063
|
(o === "checkbox" || o === "multi-select") && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4101
|
-
(e.defaultAnswers ?? []).map((
|
|
4064
|
+
(e.defaultAnswers ?? []).map((d) => /* @__PURE__ */ s(
|
|
4102
4065
|
"label",
|
|
4103
4066
|
{
|
|
4104
4067
|
className: "metakyc-option-label",
|
|
@@ -4108,9 +4071,9 @@ const mn = ({
|
|
|
4108
4071
|
"input",
|
|
4109
4072
|
{
|
|
4110
4073
|
type: "checkbox",
|
|
4111
|
-
checked: t.includes(
|
|
4074
|
+
checked: t.includes(d),
|
|
4112
4075
|
onChange: (y) => {
|
|
4113
|
-
y.target.checked ? a([...t,
|
|
4076
|
+
y.target.checked ? a([...t, d]) : a(t.filter((p) => p !== d));
|
|
4114
4077
|
},
|
|
4115
4078
|
className: "metakyc-option-input",
|
|
4116
4079
|
style: {
|
|
@@ -4128,17 +4091,17 @@ const mn = ({
|
|
|
4128
4091
|
}
|
|
4129
4092
|
}
|
|
4130
4093
|
),
|
|
4131
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
4094
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: d })
|
|
4132
4095
|
]
|
|
4133
4096
|
},
|
|
4134
|
-
|
|
4097
|
+
d
|
|
4135
4098
|
)),
|
|
4136
4099
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4137
4100
|
] }),
|
|
4138
4101
|
n && o === "text" && null
|
|
4139
4102
|
] });
|
|
4140
4103
|
};
|
|
4141
|
-
function
|
|
4104
|
+
function fn(e) {
|
|
4142
4105
|
const t = /* @__PURE__ */ new Map();
|
|
4143
4106
|
for (const n of e) {
|
|
4144
4107
|
const a = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
@@ -4146,18 +4109,18 @@ function hn(e) {
|
|
|
4146
4109
|
}
|
|
4147
4110
|
return Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4148
4111
|
}
|
|
4149
|
-
const
|
|
4112
|
+
const gn = ({
|
|
4150
4113
|
applicantId: e,
|
|
4151
4114
|
onComplete: t,
|
|
4152
4115
|
onBack: n
|
|
4153
4116
|
}) => {
|
|
4154
|
-
const { uploadDocument: a, isLoading: i, isSubmitting: o, error: c, submit:
|
|
4155
|
-
() => a ?
|
|
4117
|
+
const { uploadDocument: a, isLoading: i, isSubmitting: o, error: c, submit: d } = Yr(e), [y, p] = k({}), [x, T] = k(null), [v, A] = k(0), [P, w] = k({}), N = De(
|
|
4118
|
+
() => a ? fn(a.uploadDocumentFiles) : [],
|
|
4156
4119
|
[a]
|
|
4157
4120
|
), z = N[v] ?? [], Q = v === N.length - 1, M = N.length, j = ae(() => {
|
|
4158
4121
|
const b = {};
|
|
4159
|
-
for (const
|
|
4160
|
-
|
|
4122
|
+
for (const $ of z)
|
|
4123
|
+
$.isRequired && (y[$.id] || []).length === 0 && (b[$.id] = `${$.displayName} is required`);
|
|
4161
4124
|
return w(b), Object.keys(b).length === 0;
|
|
4162
4125
|
}, [z, y]), K = () => {
|
|
4163
4126
|
j() && (A((b) => b + 1), w({}));
|
|
@@ -4165,14 +4128,14 @@ const fn = ({
|
|
|
4165
4128
|
v > 0 ? (A((b) => b - 1), w({})) : n == null || n();
|
|
4166
4129
|
}, E = async () => {
|
|
4167
4130
|
if (!(!j() || !a)) {
|
|
4168
|
-
|
|
4131
|
+
T(null);
|
|
4169
4132
|
try {
|
|
4170
4133
|
const b = await Promise.all(
|
|
4171
4134
|
a.uploadDocumentFiles.map(async (V) => {
|
|
4172
4135
|
const G = y[V.id] || [], _ = await Promise.all(
|
|
4173
4136
|
G.map(async (J) => ({
|
|
4174
4137
|
fileName: J.name,
|
|
4175
|
-
fileData: await
|
|
4138
|
+
fileData: await _r(J)
|
|
4176
4139
|
}))
|
|
4177
4140
|
);
|
|
4178
4141
|
return {
|
|
@@ -4180,14 +4143,14 @@ const fn = ({
|
|
|
4180
4143
|
valueList: _
|
|
4181
4144
|
};
|
|
4182
4145
|
})
|
|
4183
|
-
),
|
|
4146
|
+
), $ = {
|
|
4184
4147
|
applicantId: e,
|
|
4185
4148
|
uploadDocumentId: a.id,
|
|
4186
4149
|
uploadDocumentResults: b
|
|
4187
4150
|
};
|
|
4188
|
-
await
|
|
4151
|
+
await d($), t == null || t();
|
|
4189
4152
|
} catch (b) {
|
|
4190
|
-
|
|
4153
|
+
T((b == null ? void 0 : b.message) || "Failed to submit documents. Please try again.");
|
|
4191
4154
|
}
|
|
4192
4155
|
}
|
|
4193
4156
|
};
|
|
@@ -4242,18 +4205,18 @@ const fn = ({
|
|
|
4242
4205
|
" of ",
|
|
4243
4206
|
M
|
|
4244
4207
|
] }),
|
|
4245
|
-
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: N.map((b,
|
|
4208
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: N.map((b, $) => /* @__PURE__ */ r(
|
|
4246
4209
|
"div",
|
|
4247
4210
|
{
|
|
4248
4211
|
style: {
|
|
4249
4212
|
height: "6px",
|
|
4250
|
-
width:
|
|
4213
|
+
width: $ === v ? "20px" : "6px",
|
|
4251
4214
|
borderRadius: "999px",
|
|
4252
4215
|
transition: "all 0.2s ease",
|
|
4253
|
-
backgroundColor:
|
|
4216
|
+
backgroundColor: $ <= v ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
4254
4217
|
}
|
|
4255
4218
|
},
|
|
4256
|
-
|
|
4219
|
+
$
|
|
4257
4220
|
)) })
|
|
4258
4221
|
] })
|
|
4259
4222
|
] }),
|
|
@@ -4294,7 +4257,7 @@ const fn = ({
|
|
|
4294
4257
|
}, children: a.description })
|
|
4295
4258
|
] }),
|
|
4296
4259
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((b) => /* @__PURE__ */ r(
|
|
4297
|
-
|
|
4260
|
+
rn,
|
|
4298
4261
|
{
|
|
4299
4262
|
label: b.displayName,
|
|
4300
4263
|
subtitle: b.subtitle,
|
|
@@ -4302,13 +4265,13 @@ const fn = ({
|
|
|
4302
4265
|
multiple: b.multipleFile,
|
|
4303
4266
|
maxSize: b.maxEachFileSizeByte,
|
|
4304
4267
|
required: b.isRequired,
|
|
4305
|
-
error:
|
|
4268
|
+
error: P[b.id],
|
|
4306
4269
|
value: y[b.id] || [],
|
|
4307
|
-
onChange: (
|
|
4308
|
-
|
|
4270
|
+
onChange: ($) => {
|
|
4271
|
+
T(null), w((V) => {
|
|
4309
4272
|
const G = { ...V };
|
|
4310
4273
|
return delete G[b.id], G;
|
|
4311
|
-
}), p((V) => ({ ...V, [b.id]:
|
|
4274
|
+
}), p((V) => ({ ...V, [b.id]: $ }));
|
|
4312
4275
|
}
|
|
4313
4276
|
},
|
|
4314
4277
|
b.id
|
|
@@ -4363,9 +4326,9 @@ const fn = ({
|
|
|
4363
4326
|
)
|
|
4364
4327
|
] }) })
|
|
4365
4328
|
] }) : null;
|
|
4366
|
-
},
|
|
4367
|
-
const { overview: a, isLoading: i, isSubmitting: o, error: c, passOverview:
|
|
4368
|
-
await
|
|
4329
|
+
}, bn = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
4330
|
+
const { overview: a, isLoading: i, isSubmitting: o, error: c, passOverview: d } = Qr(e), y = async () => {
|
|
4331
|
+
await d(), t == null || t();
|
|
4369
4332
|
};
|
|
4370
4333
|
return i ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
4371
4334
|
"Error loading overview: ",
|
|
@@ -4407,7 +4370,7 @@ const fn = ({
|
|
|
4407
4370
|
] })
|
|
4408
4371
|
] }) : null;
|
|
4409
4372
|
};
|
|
4410
|
-
function
|
|
4373
|
+
function xn(e) {
|
|
4411
4374
|
const t = (e ?? "en").toLowerCase().replace("_", "-");
|
|
4412
4375
|
try {
|
|
4413
4376
|
return Intl.NumberFormat.supportedLocalesOf([t]), t;
|
|
@@ -4415,11 +4378,11 @@ function bn(e) {
|
|
|
4415
4378
|
return "en";
|
|
4416
4379
|
}
|
|
4417
4380
|
}
|
|
4418
|
-
function
|
|
4419
|
-
return e.valueDataType ===
|
|
4381
|
+
function vn(e) {
|
|
4382
|
+
return e.valueDataType === Ke.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
|
|
4420
4383
|
}
|
|
4421
|
-
function
|
|
4422
|
-
const n = new Intl.NumberFormat(
|
|
4384
|
+
function kn(e, t) {
|
|
4385
|
+
const n = new Intl.NumberFormat(xn(t), {
|
|
4423
4386
|
minimumFractionDigits: 0,
|
|
4424
4387
|
maximumFractionDigits: 2
|
|
4425
4388
|
});
|
|
@@ -4428,7 +4391,7 @@ function vn(e, t) {
|
|
|
4428
4391
|
return isNaN(i) ? a : n.format(i);
|
|
4429
4392
|
});
|
|
4430
4393
|
}
|
|
4431
|
-
function
|
|
4394
|
+
function wn(e, t) {
|
|
4432
4395
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
4433
4396
|
if (e.isRequired && n)
|
|
4434
4397
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -4440,7 +4403,7 @@ function kn(e, t) {
|
|
|
4440
4403
|
return e.errorMessage || "Invalid format";
|
|
4441
4404
|
} catch {
|
|
4442
4405
|
}
|
|
4443
|
-
const i = e.valueDataType ===
|
|
4406
|
+
const i = e.valueDataType === Ke.Integer || e.valueDataType === Ke.Money || e.valueDataType === Ke.DigitOnly;
|
|
4444
4407
|
if (i && a.trim() !== "") {
|
|
4445
4408
|
const o = Number(a);
|
|
4446
4409
|
if (!isNaN(o)) {
|
|
@@ -4458,53 +4421,53 @@ function kn(e, t) {
|
|
|
4458
4421
|
}
|
|
4459
4422
|
return null;
|
|
4460
4423
|
}
|
|
4461
|
-
function
|
|
4424
|
+
function Sn(e) {
|
|
4462
4425
|
const t = /* @__PURE__ */ new Map();
|
|
4463
4426
|
return e.forEach((n, a) => {
|
|
4464
4427
|
const i = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
4465
4428
|
t.has(i) || t.set(i, []), t.get(i).push({ criterion: n, idx: a });
|
|
4466
4429
|
}), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4467
4430
|
}
|
|
4468
|
-
function
|
|
4431
|
+
function Cn(e) {
|
|
4469
4432
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
4470
4433
|
}
|
|
4471
|
-
const
|
|
4434
|
+
const Nn = ({
|
|
4472
4435
|
applicantId: e,
|
|
4473
4436
|
onComplete: t,
|
|
4474
4437
|
onBack: n
|
|
4475
4438
|
}) => {
|
|
4476
|
-
const { config: a } =
|
|
4439
|
+
const { config: a } = Pe(), i = a.locale ?? "en", { criteria: o, initialAnswers: c, isLoading: d, isSubmitting: y, error: p, submit: x } = Jr(e), [T, v] = k({}), [A, P] = k({}), [w, N] = k(0), [z, Q] = k(!1);
|
|
4477
4440
|
we.useEffect(() => {
|
|
4478
|
-
c && Object.keys(c).length > 0 && Object.keys(
|
|
4441
|
+
c && Object.keys(c).length > 0 && Object.keys(T).length === 0 && v(c);
|
|
4479
4442
|
}, [c]);
|
|
4480
4443
|
const M = De(
|
|
4481
|
-
() => o && o.length > 0 ?
|
|
4444
|
+
() => o && o.length > 0 ? Sn(o) : [],
|
|
4482
4445
|
[o]
|
|
4483
4446
|
), j = w === M.length - 1, K = M[w] ?? [];
|
|
4484
4447
|
we.useEffect(() => {
|
|
4485
|
-
!
|
|
4486
|
-
}, [
|
|
4448
|
+
!d && o && o.length === 0 && !z && !y && (Q(!0), x({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4449
|
+
}, [d, o, z, y, x, e, t]);
|
|
4487
4450
|
const ee = ae((G, _) => {
|
|
4488
|
-
v((J) => ({ ...J, [G]: _ })),
|
|
4451
|
+
v((J) => ({ ...J, [G]: _ })), P((J) => {
|
|
4489
4452
|
const se = { ...J };
|
|
4490
4453
|
return delete se[G], se;
|
|
4491
4454
|
});
|
|
4492
4455
|
}, []), E = ae(() => {
|
|
4493
4456
|
const G = {};
|
|
4494
4457
|
for (const { criterion: _ } of K) {
|
|
4495
|
-
const J =
|
|
4458
|
+
const J = wn(_, T[_.id] ?? []);
|
|
4496
4459
|
J && (G[_.id] = J);
|
|
4497
4460
|
}
|
|
4498
|
-
return
|
|
4499
|
-
}, [K,
|
|
4461
|
+
return P((_) => ({ ..._, ...G })), Object.keys(G).length === 0;
|
|
4462
|
+
}, [K, T]), b = () => {
|
|
4500
4463
|
E() && N((G) => G + 1);
|
|
4501
|
-
},
|
|
4464
|
+
}, $ = () => {
|
|
4502
4465
|
w > 0 ? N((G) => G - 1) : n == null || n();
|
|
4503
4466
|
}, V = async () => {
|
|
4504
4467
|
if (!(!E() || !o))
|
|
4505
4468
|
try {
|
|
4506
4469
|
const G = o.map((J) => {
|
|
4507
|
-
const se = (
|
|
4470
|
+
const se = (T[J.id] ?? []).filter((Y) => Y && Y.trim());
|
|
4508
4471
|
return se.length > 0 ? { riskCriteriaId: J.id, values: se } : null;
|
|
4509
4472
|
}).filter((J) => J !== null);
|
|
4510
4473
|
await x({ applicantId: e, criteriaValueInputs: G }), t == null || t();
|
|
@@ -4512,10 +4475,10 @@ const Cn = ({
|
|
|
4512
4475
|
console.error("Risk scoring submit error:", G);
|
|
4513
4476
|
}
|
|
4514
4477
|
};
|
|
4515
|
-
return
|
|
4478
|
+
return d ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
|
|
4516
4479
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
4517
4480
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
4518
|
-
] }) }) : !
|
|
4481
|
+
] }) }) : !d && o && o.length === 0 ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
|
|
4519
4482
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
4520
4483
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
4521
4484
|
] }) }) : p ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
|
|
@@ -4547,10 +4510,10 @@ const Cn = ({
|
|
|
4547
4510
|
] })
|
|
4548
4511
|
] }),
|
|
4549
4512
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: K.map(({ criterion: G }) => /* @__PURE__ */ r(
|
|
4550
|
-
|
|
4513
|
+
Rn,
|
|
4551
4514
|
{
|
|
4552
4515
|
criterion: G,
|
|
4553
|
-
value:
|
|
4516
|
+
value: T[G.id] ?? [],
|
|
4554
4517
|
error: A[G.id],
|
|
4555
4518
|
locale: i,
|
|
4556
4519
|
onChange: (_) => ee(G.id, _)
|
|
@@ -4563,10 +4526,10 @@ const Cn = ({
|
|
|
4563
4526
|
{
|
|
4564
4527
|
type: "button",
|
|
4565
4528
|
variant: "outline",
|
|
4566
|
-
onClick:
|
|
4529
|
+
onClick: $,
|
|
4567
4530
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4568
4531
|
children: [
|
|
4569
|
-
/* @__PURE__ */ r(
|
|
4532
|
+
/* @__PURE__ */ r(jt, { size: 14 }),
|
|
4570
4533
|
w > 0 ? "Previous" : "Back"
|
|
4571
4534
|
]
|
|
4572
4535
|
}
|
|
@@ -4579,15 +4542,15 @@ const Cn = ({
|
|
|
4579
4542
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4580
4543
|
children: [
|
|
4581
4544
|
"Next",
|
|
4582
|
-
/* @__PURE__ */ r(
|
|
4545
|
+
/* @__PURE__ */ r(Ht, { size: 14 })
|
|
4583
4546
|
]
|
|
4584
4547
|
}
|
|
4585
4548
|
)
|
|
4586
4549
|
] }),
|
|
4587
4550
|
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 }) })
|
|
4588
4551
|
] }) : null;
|
|
4589
|
-
},
|
|
4590
|
-
const o =
|
|
4552
|
+
}, Rn = ({ criterion: e, value: t, error: n, locale: a, onChange: i }) => {
|
|
4553
|
+
const o = Cn(e), c = e.valueDataType === Ke.Integer || e.valueDataType === Ke.Money || e.valueDataType === Ke.DigitOnly, d = vn(e), y = (p) => d ? kn(p, a) : p;
|
|
4591
4554
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
4592
4555
|
/* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4593
4556
|
e.displayName,
|
|
@@ -4607,7 +4570,7 @@ const Cn = ({
|
|
|
4607
4570
|
min: e.min,
|
|
4608
4571
|
max: e.max,
|
|
4609
4572
|
onKeyDown: (p) => {
|
|
4610
|
-
e.valueDataType ===
|
|
4573
|
+
e.valueDataType === Ke.DigitOnly && ["e", "E", "+", "-", "."].includes(p.key) && p.preventDefault();
|
|
4611
4574
|
}
|
|
4612
4575
|
}
|
|
4613
4576
|
),
|
|
@@ -4660,7 +4623,7 @@ const Cn = ({
|
|
|
4660
4623
|
type: "checkbox",
|
|
4661
4624
|
checked: t.includes(p),
|
|
4662
4625
|
onChange: (x) => {
|
|
4663
|
-
x.target.checked ? i([...t, p]) : i(t.filter((
|
|
4626
|
+
x.target.checked ? i([...t, p]) : i(t.filter((T) => T !== p));
|
|
4664
4627
|
},
|
|
4665
4628
|
className: "metakyc-option-input",
|
|
4666
4629
|
style: {
|
|
@@ -4686,7 +4649,7 @@ const Cn = ({
|
|
|
4686
4649
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4687
4650
|
] }),
|
|
4688
4651
|
o === "country" && /* @__PURE__ */ r(
|
|
4689
|
-
|
|
4652
|
+
Ct,
|
|
4690
4653
|
{
|
|
4691
4654
|
value: t[0] ?? "",
|
|
4692
4655
|
onChange: (p) => i([p.target.value]),
|
|
@@ -4703,18 +4666,18 @@ const Cn = ({
|
|
|
4703
4666
|
}
|
|
4704
4667
|
)
|
|
4705
4668
|
] });
|
|
4706
|
-
},
|
|
4669
|
+
}, In = ({
|
|
4707
4670
|
applicantId: e,
|
|
4708
4671
|
onComplete: t,
|
|
4709
4672
|
onBack: n
|
|
4710
4673
|
}) => {
|
|
4711
|
-
const { investorCategorizationService: a } =
|
|
4712
|
-
return /* @__PURE__ */ r("form", { onSubmit: async (
|
|
4713
|
-
if (
|
|
4674
|
+
const { investorCategorizationService: a } = Pe(), [i, o] = k(null), [c, d] = k(!1), [y, p] = k(null);
|
|
4675
|
+
return /* @__PURE__ */ r("form", { onSubmit: async (T) => {
|
|
4676
|
+
if (T.preventDefault(), i === null) {
|
|
4714
4677
|
p("Please select an investor type");
|
|
4715
4678
|
return;
|
|
4716
4679
|
}
|
|
4717
|
-
|
|
4680
|
+
d(!0), p(null);
|
|
4718
4681
|
try {
|
|
4719
4682
|
const v = {
|
|
4720
4683
|
applicantId: e,
|
|
@@ -4726,7 +4689,7 @@ const Cn = ({
|
|
|
4726
4689
|
} catch (v) {
|
|
4727
4690
|
console.error("Error submitting investor categorization:", v), p(v.message || "Failed to submit investor categorization");
|
|
4728
4691
|
} finally {
|
|
4729
|
-
|
|
4692
|
+
d(!1);
|
|
4730
4693
|
}
|
|
4731
4694
|
}, children: /* @__PURE__ */ s(re, { children: [
|
|
4732
4695
|
/* @__PURE__ */ s(Se, { children: [
|
|
@@ -4845,73 +4808,73 @@ const Cn = ({
|
|
|
4845
4808
|
] })
|
|
4846
4809
|
] }) });
|
|
4847
4810
|
};
|
|
4848
|
-
function
|
|
4811
|
+
function Pt(e) {
|
|
4849
4812
|
const t = e.split(":").map(Number);
|
|
4850
4813
|
return t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : 0;
|
|
4851
4814
|
}
|
|
4852
|
-
function
|
|
4815
|
+
function vt(e) {
|
|
4853
4816
|
const t = Math.floor(e / 60), n = e % 60;
|
|
4854
4817
|
return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
|
|
4855
4818
|
}
|
|
4856
|
-
const
|
|
4819
|
+
const En = ({
|
|
4857
4820
|
applicantId: e,
|
|
4858
4821
|
onComplete: t,
|
|
4859
4822
|
onBack: n
|
|
4860
4823
|
}) => {
|
|
4861
|
-
const { appropriatenessTestService: a } =
|
|
4824
|
+
const { appropriatenessTestService: a } = Pe(), [i, o] = k(null), [c, d] = k(!0), [y, p] = k(!1), [x, T] = k(null), [v, A] = k({}), [P, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [ee, E] = k(0), [b, $] = k(null);
|
|
4862
4825
|
ge(() => {
|
|
4863
4826
|
(async () => {
|
|
4864
4827
|
try {
|
|
4865
|
-
|
|
4866
|
-
const
|
|
4867
|
-
if (o(
|
|
4868
|
-
const H =
|
|
4828
|
+
d(!0), T(null);
|
|
4829
|
+
const B = await a.getAppropriatenessTest(e);
|
|
4830
|
+
if (o(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4831
|
+
const H = Pt(B.waitTimeSpanForNextTry);
|
|
4869
4832
|
H > 0 && K(H);
|
|
4870
4833
|
}
|
|
4871
|
-
} catch (
|
|
4872
|
-
|
|
4834
|
+
} catch (B) {
|
|
4835
|
+
T(B.message || "Failed to load appropriateness test");
|
|
4873
4836
|
} finally {
|
|
4874
|
-
|
|
4837
|
+
d(!1);
|
|
4875
4838
|
}
|
|
4876
4839
|
})();
|
|
4877
4840
|
}, [e, a]), ge(() => {
|
|
4878
|
-
if (!N ||
|
|
4879
|
-
const
|
|
4841
|
+
if (!N || P <= 0) return;
|
|
4842
|
+
const B = setInterval(() => {
|
|
4880
4843
|
w((H) => H <= 1 ? (M(!0), 0) : H - 1);
|
|
4881
4844
|
}, 1e3);
|
|
4882
|
-
return () => clearInterval(
|
|
4883
|
-
}, [N,
|
|
4845
|
+
return () => clearInterval(B);
|
|
4846
|
+
}, [N, P]), ge(() => {
|
|
4884
4847
|
if (j <= 0) return;
|
|
4885
|
-
const
|
|
4848
|
+
const B = setInterval(() => {
|
|
4886
4849
|
K((H) => H <= 1 ? 0 : H - 1);
|
|
4887
4850
|
}, 1e3);
|
|
4888
|
-
return () => clearInterval(
|
|
4851
|
+
return () => clearInterval(B);
|
|
4889
4852
|
}, [j]), ge(() => {
|
|
4890
4853
|
Q && !y && J();
|
|
4891
4854
|
}, [Q]);
|
|
4892
4855
|
const V = () => {
|
|
4893
|
-
i && (z(!0), w(i.testDurationSec), E(0), A({}),
|
|
4894
|
-
}, G = (
|
|
4895
|
-
A((fe) => ({ ...fe, [
|
|
4856
|
+
i && (z(!0), w(i.testDurationSec), E(0), A({}), T(null));
|
|
4857
|
+
}, G = (B, H) => {
|
|
4858
|
+
A((fe) => ({ ...fe, [B]: H }));
|
|
4896
4859
|
}, _ = ae(async () => {
|
|
4897
4860
|
try {
|
|
4898
|
-
const
|
|
4899
|
-
if (o(
|
|
4900
|
-
const H =
|
|
4861
|
+
const B = await a.getAppropriatenessTest(e);
|
|
4862
|
+
if (o(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4863
|
+
const H = Pt(B.waitTimeSpanForNextTry);
|
|
4901
4864
|
H > 0 && K(H);
|
|
4902
4865
|
}
|
|
4903
4866
|
} catch {
|
|
4904
4867
|
}
|
|
4905
|
-
}, [e, a]), J = async (
|
|
4868
|
+
}, [e, a]), J = async (B) => {
|
|
4906
4869
|
if (i) {
|
|
4907
4870
|
if (!Q) {
|
|
4908
4871
|
const H = i.appropriatenessQuestions.length - Object.keys(v).length;
|
|
4909
4872
|
if (H > 0) {
|
|
4910
|
-
|
|
4873
|
+
T(`Please answer all questions. ${H} remaining.`);
|
|
4911
4874
|
return;
|
|
4912
4875
|
}
|
|
4913
4876
|
}
|
|
4914
|
-
p(!0),
|
|
4877
|
+
p(!0), T(null);
|
|
4915
4878
|
try {
|
|
4916
4879
|
const H = i.appropriatenessQuestions.map(
|
|
4917
4880
|
(I) => ({ appropriatenessQuestionId: I.id, value: v[I.id] || "" })
|
|
@@ -4922,15 +4885,15 @@ const In = ({
|
|
|
4922
4885
|
};
|
|
4923
4886
|
try {
|
|
4924
4887
|
const I = await a.fillAppropriatenessTest(fe);
|
|
4925
|
-
I.isSuccess ?
|
|
4888
|
+
I.isSuccess ? $({ success: !0, message: I.message || "Congratulations! You have passed the test." }) : ($({ success: !1, message: I.message || "You did not pass the test." }), setTimeout(() => _(), 1e3));
|
|
4926
4889
|
} catch (I) {
|
|
4927
4890
|
if (I.code === 400 && I.message)
|
|
4928
|
-
|
|
4891
|
+
$({ success: !1, message: I.message }), setTimeout(() => _(), 1500);
|
|
4929
4892
|
else
|
|
4930
4893
|
throw I;
|
|
4931
4894
|
}
|
|
4932
4895
|
} catch (H) {
|
|
4933
|
-
|
|
4896
|
+
T(H.message || "Failed to submit test. Please try again."), se();
|
|
4934
4897
|
} finally {
|
|
4935
4898
|
p(!1);
|
|
4936
4899
|
}
|
|
@@ -4967,7 +4930,7 @@ const In = ({
|
|
|
4967
4930
|
fontWeight: 700,
|
|
4968
4931
|
color: "var(--metakyc-primary, #2563eb)",
|
|
4969
4932
|
fontVariantNumeric: "tabular-nums"
|
|
4970
|
-
}, children:
|
|
4933
|
+
}, children: vt(j) }) }),
|
|
4971
4934
|
/* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: "Please wait before retrying" }),
|
|
4972
4935
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: "You can attempt the test again once the timer expires" }),
|
|
4973
4936
|
x && /* @__PURE__ */ r("div", { style: {
|
|
@@ -4980,8 +4943,8 @@ const In = ({
|
|
|
4980
4943
|
] }) })
|
|
4981
4944
|
] });
|
|
4982
4945
|
if (b) {
|
|
4983
|
-
const
|
|
4984
|
-
|
|
4946
|
+
const B = () => {
|
|
4947
|
+
$(null), se(), T(null);
|
|
4985
4948
|
};
|
|
4986
4949
|
return /* @__PURE__ */ s(re, { children: [
|
|
4987
4950
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { style: {
|
|
@@ -5051,9 +5014,9 @@ const In = ({
|
|
|
5051
5014
|
margin: 0
|
|
5052
5015
|
}, children: "No attempts remaining. Please contact support for assistance." }) })
|
|
5053
5016
|
] }) }),
|
|
5054
|
-
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: b.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ s(
|
|
5055
|
-
Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick:
|
|
5056
|
-
Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick:
|
|
5017
|
+
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: b.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ s(lt, { children: [
|
|
5018
|
+
Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "Retake Test" }),
|
|
5019
|
+
Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "OK" }),
|
|
5057
5020
|
Y <= 0 && n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" })
|
|
5058
5021
|
] }) }) })
|
|
5059
5022
|
] });
|
|
@@ -5082,11 +5045,11 @@ const In = ({
|
|
|
5082
5045
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-secondary, #374151)", margin: 0, lineHeight: 1.5 }, children: i.description })
|
|
5083
5046
|
] }),
|
|
5084
5047
|
/* @__PURE__ */ s("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "12px", marginBottom: "20px" }, children: [
|
|
5085
|
-
/* @__PURE__ */ r(
|
|
5086
|
-
/* @__PURE__ */ r(
|
|
5087
|
-
/* @__PURE__ */ r(
|
|
5048
|
+
/* @__PURE__ */ r(ht, { icon: "questions", label: "Questions", value: String(i.totalQuestionCount) }),
|
|
5049
|
+
/* @__PURE__ */ r(ht, { icon: "time", label: "Time Limit", value: vt(i.testDurationSec) }),
|
|
5050
|
+
/* @__PURE__ */ r(ht, { icon: "target", label: "Pass Requirement", value: `${i.testCorrectAnswerPassLimit} correct` }),
|
|
5088
5051
|
/* @__PURE__ */ r(
|
|
5089
|
-
|
|
5052
|
+
ht,
|
|
5090
5053
|
{
|
|
5091
5054
|
icon: "retry",
|
|
5092
5055
|
label: "Attempts Left",
|
|
@@ -5127,7 +5090,7 @@ const In = ({
|
|
|
5127
5090
|
/* @__PURE__ */ r(Z, { type: "button", onClick: V, disabled: Y <= 0, children: "Start Test" })
|
|
5128
5091
|
] }) })
|
|
5129
5092
|
] });
|
|
5130
|
-
const me = i.appropriatenessQuestions[ee], ke = ee === ve - 1, F = ue === ve, U =
|
|
5093
|
+
const me = i.appropriatenessQuestions[ee], ke = ee === ve - 1, F = ue === ve, U = P <= 60;
|
|
5131
5094
|
return /* @__PURE__ */ s(re, { children: [
|
|
5132
5095
|
/* @__PURE__ */ s(Se, { children: [
|
|
5133
5096
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
@@ -5172,7 +5135,7 @@ const In = ({
|
|
|
5172
5135
|
fontVariantNumeric: "tabular-nums",
|
|
5173
5136
|
color: U ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-primary, #111827)",
|
|
5174
5137
|
transition: "color 0.3s ease"
|
|
5175
|
-
}, children:
|
|
5138
|
+
}, children: vt(P) })
|
|
5176
5139
|
] })
|
|
5177
5140
|
] }),
|
|
5178
5141
|
/* @__PURE__ */ s("div", { style: { marginTop: "12px" }, children: [
|
|
@@ -5208,12 +5171,12 @@ const In = ({
|
|
|
5208
5171
|
] }),
|
|
5209
5172
|
/* @__PURE__ */ s(ne, { children: [
|
|
5210
5173
|
me && /* @__PURE__ */ r(
|
|
5211
|
-
|
|
5174
|
+
An,
|
|
5212
5175
|
{
|
|
5213
5176
|
question: me,
|
|
5214
5177
|
index: ee,
|
|
5215
5178
|
selectedAnswer: v[me.id],
|
|
5216
|
-
onSelect: (
|
|
5179
|
+
onSelect: (B) => G(me.id, B),
|
|
5217
5180
|
disabled: y
|
|
5218
5181
|
}
|
|
5219
5182
|
),
|
|
@@ -5223,7 +5186,7 @@ const In = ({
|
|
|
5223
5186
|
gap: "6px",
|
|
5224
5187
|
marginTop: "20px",
|
|
5225
5188
|
flexWrap: "wrap"
|
|
5226
|
-
}, children: i.appropriatenessQuestions.map((
|
|
5189
|
+
}, children: i.appropriatenessQuestions.map((B, H) => /* @__PURE__ */ r(
|
|
5227
5190
|
"button",
|
|
5228
5191
|
{
|
|
5229
5192
|
type: "button",
|
|
@@ -5233,8 +5196,8 @@ const In = ({
|
|
|
5233
5196
|
height: "28px",
|
|
5234
5197
|
borderRadius: "8px",
|
|
5235
5198
|
border: H === ee ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5236
|
-
backgroundColor: v[
|
|
5237
|
-
color: v[
|
|
5199
|
+
backgroundColor: v[B.id] ? H === ee ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : H === ee ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
5200
|
+
color: v[B.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
5238
5201
|
fontSize: "12px",
|
|
5239
5202
|
fontWeight: 600,
|
|
5240
5203
|
cursor: "pointer",
|
|
@@ -5246,7 +5209,7 @@ const In = ({
|
|
|
5246
5209
|
},
|
|
5247
5210
|
children: H + 1
|
|
5248
5211
|
},
|
|
5249
|
-
|
|
5212
|
+
B.id
|
|
5250
5213
|
)) }),
|
|
5251
5214
|
Q && /* @__PURE__ */ s("div", { style: {
|
|
5252
5215
|
marginTop: "16px",
|
|
@@ -5279,7 +5242,7 @@ const In = ({
|
|
|
5279
5242
|
type: "button",
|
|
5280
5243
|
variant: "outline",
|
|
5281
5244
|
onClick: () => {
|
|
5282
|
-
ee > 0 ? E((
|
|
5245
|
+
ee > 0 ? E((B) => B - 1) : n == null || n();
|
|
5283
5246
|
},
|
|
5284
5247
|
disabled: y,
|
|
5285
5248
|
children: ee > 0 ? "Previous" : "Cancel"
|
|
@@ -5290,7 +5253,7 @@ const In = ({
|
|
|
5290
5253
|
Z,
|
|
5291
5254
|
{
|
|
5292
5255
|
type: "button",
|
|
5293
|
-
onClick: () => E((
|
|
5256
|
+
onClick: () => E((B) => B + 1),
|
|
5294
5257
|
children: "Next"
|
|
5295
5258
|
}
|
|
5296
5259
|
),
|
|
@@ -5308,7 +5271,7 @@ const In = ({
|
|
|
5308
5271
|
] })
|
|
5309
5272
|
] }) })
|
|
5310
5273
|
] });
|
|
5311
|
-
},
|
|
5274
|
+
}, Fn = {
|
|
5312
5275
|
questions: /* @__PURE__ */ s("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5313
5276
|
/* @__PURE__ */ r("path", { d: "M9 11l3 3L22 4" }),
|
|
5314
5277
|
/* @__PURE__ */ r("path", { d: "M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" })
|
|
@@ -5326,7 +5289,7 @@ const In = ({
|
|
|
5326
5289
|
/* @__PURE__ */ r("polyline", { points: "23 4 23 10 17 10" }),
|
|
5327
5290
|
/* @__PURE__ */ r("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })
|
|
5328
5291
|
] })
|
|
5329
|
-
},
|
|
5292
|
+
}, ht = ({ icon: e, label: t, value: n, variant: a = "default" }) => {
|
|
5330
5293
|
const i = a === "warning";
|
|
5331
5294
|
return /* @__PURE__ */ s("div", { style: {
|
|
5332
5295
|
display: "flex",
|
|
@@ -5340,7 +5303,7 @@ const In = ({
|
|
|
5340
5303
|
/* @__PURE__ */ r("div", { style: {
|
|
5341
5304
|
color: i ? "#f59e0b" : "var(--metakyc-primary, #2563eb)",
|
|
5342
5305
|
flexShrink: 0
|
|
5343
|
-
}, children:
|
|
5306
|
+
}, children: Fn[e] }),
|
|
5344
5307
|
/* @__PURE__ */ s("div", { children: [
|
|
5345
5308
|
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0 }, children: t }),
|
|
5346
5309
|
/* @__PURE__ */ r("p", { style: {
|
|
@@ -5352,7 +5315,7 @@ const In = ({
|
|
|
5352
5315
|
}, children: n })
|
|
5353
5316
|
] })
|
|
5354
5317
|
] });
|
|
5355
|
-
},
|
|
5318
|
+
}, An = ({ question: e, selectedAnswer: t, onSelect: n, disabled: a }) => /* @__PURE__ */ s("div", { children: [
|
|
5356
5319
|
/* @__PURE__ */ s("div", { style: { marginBottom: "16px" }, children: [
|
|
5357
5320
|
e.groupName && /* @__PURE__ */ r("span", { style: {
|
|
5358
5321
|
display: "inline-block",
|
|
@@ -5388,11 +5351,11 @@ const In = ({
|
|
|
5388
5351
|
transition: "all 0.15s ease",
|
|
5389
5352
|
opacity: a ? 0.6 : 1
|
|
5390
5353
|
},
|
|
5391
|
-
onMouseEnter: (
|
|
5392
|
-
!a && !c && (
|
|
5354
|
+
onMouseEnter: (d) => {
|
|
5355
|
+
!a && !c && (d.currentTarget.style.borderColor = "color-mix(in srgb, var(--metakyc-primary, #2563eb) 50%, var(--metakyc-border, #e5e7eb))");
|
|
5393
5356
|
},
|
|
5394
|
-
onMouseLeave: (
|
|
5395
|
-
c || (
|
|
5357
|
+
onMouseLeave: (d) => {
|
|
5358
|
+
c || (d.currentTarget.style.borderColor = "var(--metakyc-border, #e5e7eb)");
|
|
5396
5359
|
},
|
|
5397
5360
|
children: [
|
|
5398
5361
|
/* @__PURE__ */ r("div", { style: {
|
|
@@ -5434,15 +5397,15 @@ const In = ({
|
|
|
5434
5397
|
o
|
|
5435
5398
|
);
|
|
5436
5399
|
}) })
|
|
5437
|
-
] }),
|
|
5400
|
+
] }), Pn = ({
|
|
5438
5401
|
applicantId: e,
|
|
5439
5402
|
onComplete: t,
|
|
5440
5403
|
onBack: n
|
|
5441
5404
|
}) => {
|
|
5442
|
-
var
|
|
5443
|
-
const { applicantService: a, baseInformationService: i, identityService: o, config: c, currentTheme:
|
|
5444
|
-
|
|
5445
|
-
const H =
|
|
5405
|
+
var Ze, je, it, Ye;
|
|
5406
|
+
const { applicantService: a, baseInformationService: i, identityService: o, config: c, currentTheme: d } = Pe(), { identityData: y, provider: p, token: x, isLoading: T, error: v, requestIdentity: A, restartIdentity: P } = Gr(e), [w, N] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, ee] = k([]), [E, b] = k(!0), [$, V] = k(!1), [G, _] = k(null), [J, se] = k(!1), Y = we.useRef(!1), [ve, ue] = k({}), [me, ke] = k({}), F = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, U = !!(d != null && d.reviewPageDisabled), B = de(!1);
|
|
5407
|
+
B.current = U;
|
|
5408
|
+
const H = Gt({
|
|
5446
5409
|
defaultValues: {
|
|
5447
5410
|
street: "",
|
|
5448
5411
|
streetNumber: "",
|
|
@@ -5471,38 +5434,38 @@ const In = ({
|
|
|
5471
5434
|
j(m);
|
|
5472
5435
|
const R = /* @__PURE__ */ new Set(), L = W.filter((f) => f.countryCode).map((f) => ({ value: f.countryCode, label: `${f.countryCode} – ${f.name}` })).filter((f) => R.has(f.value) ? !1 : (R.add(f.value), !0));
|
|
5473
5436
|
ee(L);
|
|
5474
|
-
const
|
|
5437
|
+
const u = O.applicantRequestData;
|
|
5475
5438
|
if (ue({
|
|
5476
|
-
firstName: (
|
|
5477
|
-
lastName: (
|
|
5478
|
-
email: (
|
|
5479
|
-
dateOfBirth: (
|
|
5480
|
-
title: (
|
|
5481
|
-
salutation: (
|
|
5482
|
-
phonenumber: (
|
|
5483
|
-
mobileCountryCode: (
|
|
5484
|
-
street: (
|
|
5485
|
-
streetNumber: (
|
|
5486
|
-
city: (
|
|
5487
|
-
zip: (
|
|
5488
|
-
country: (
|
|
5489
|
-
nationality: (
|
|
5490
|
-
taxCountry: (
|
|
5491
|
-
countryOfBirth: (
|
|
5492
|
-
placeOfBirth: (
|
|
5493
|
-
educationLevel: (
|
|
5494
|
-
occupation: (
|
|
5495
|
-
taxNumber: (
|
|
5496
|
-
defaultLanguage: (
|
|
5439
|
+
firstName: (u == null ? void 0 : u.firstName) || "",
|
|
5440
|
+
lastName: (u == null ? void 0 : u.lastName) || "",
|
|
5441
|
+
email: (u == null ? void 0 : u.email) || "",
|
|
5442
|
+
dateOfBirth: (u == null ? void 0 : u.dateOfBirth) || "",
|
|
5443
|
+
title: (u == null ? void 0 : u.title) || "",
|
|
5444
|
+
salutation: (u == null ? void 0 : u.salutation) || "",
|
|
5445
|
+
phonenumber: (u == null ? void 0 : u.phonenumber) || "",
|
|
5446
|
+
mobileCountryCode: (u == null ? void 0 : u.mobileCountryCode) || "",
|
|
5447
|
+
street: (u == null ? void 0 : u.street) || "",
|
|
5448
|
+
streetNumber: (u == null ? void 0 : u.streetNumber) || "",
|
|
5449
|
+
city: (u == null ? void 0 : u.city) || "",
|
|
5450
|
+
zip: (u == null ? void 0 : u.zip) || "",
|
|
5451
|
+
country: (u == null ? void 0 : u.country) || "",
|
|
5452
|
+
nationality: (u == null ? void 0 : u.nationality) || "",
|
|
5453
|
+
taxCountry: (u == null ? void 0 : u.taxCountry) || "",
|
|
5454
|
+
countryOfBirth: (u == null ? void 0 : u.countryOfBirth) || "",
|
|
5455
|
+
placeOfBirth: (u == null ? void 0 : u.placeOfBirth) || "",
|
|
5456
|
+
educationLevel: (u == null ? void 0 : u.educationLevel) || "",
|
|
5457
|
+
occupation: (u == null ? void 0 : u.occupation) || "",
|
|
5458
|
+
taxNumber: (u == null ? void 0 : u.taxNumber) || "",
|
|
5459
|
+
defaultLanguage: (u == null ? void 0 : u.defaultLanguage) || ""
|
|
5497
5460
|
}), H.reset({
|
|
5498
|
-
street: (
|
|
5499
|
-
streetNumber: (
|
|
5500
|
-
city: (
|
|
5501
|
-
zip: (
|
|
5502
|
-
country: (
|
|
5503
|
-
nationality: (
|
|
5504
|
-
phonenumber: (
|
|
5505
|
-
}), O.kycRecords && O.kycRecords.length > 0 && O.kycRecords[0].providerTokenObject !== null && !Y.current &&
|
|
5461
|
+
street: (u == null ? void 0 : u.street) || "",
|
|
5462
|
+
streetNumber: (u == null ? void 0 : u.streetNumber) || "",
|
|
5463
|
+
city: (u == null ? void 0 : u.city) || "",
|
|
5464
|
+
zip: (u == null ? void 0 : u.zip) || "",
|
|
5465
|
+
country: (u == null ? void 0 : u.country) || "",
|
|
5466
|
+
nationality: (u == null ? void 0 : u.nationality) || "",
|
|
5467
|
+
phonenumber: (u == null ? void 0 : u.phonenumber) || ""
|
|
5468
|
+
}), O.kycRecords && O.kycRecords.length > 0 && O.kycRecords[0].providerTokenObject !== null && !Y.current && B.current) {
|
|
5506
5469
|
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), Y.current = !0;
|
|
5507
5470
|
try {
|
|
5508
5471
|
await A(), V(!0);
|
|
@@ -5517,8 +5480,8 @@ const In = ({
|
|
|
5517
5480
|
}
|
|
5518
5481
|
})();
|
|
5519
5482
|
}, [e]), ge(() => {
|
|
5520
|
-
y &&
|
|
5521
|
-
}, [y,
|
|
5483
|
+
y && !$ && B.current && (console.log("[Identity] Review page disabled — showing cached provider"), V(!0));
|
|
5484
|
+
}, [y, $]), ge(() => {
|
|
5522
5485
|
if (x) {
|
|
5523
5486
|
if (x.expiresAt) {
|
|
5524
5487
|
const h = new Date(x.expiresAt).getTime();
|
|
@@ -5545,14 +5508,14 @@ const In = ({
|
|
|
5545
5508
|
}, [x]);
|
|
5546
5509
|
const fe = p !== null && p === Oe.Sumsub;
|
|
5547
5510
|
ge(() => {
|
|
5548
|
-
if (p !== null && x && !w &&
|
|
5511
|
+
if (p !== null && x && !w && $ && !J) {
|
|
5549
5512
|
const h = p;
|
|
5550
5513
|
if (fe) {
|
|
5551
5514
|
console.log("[Sumsub] Fetching access token for Web SDK…"), _(null), (async () => {
|
|
5552
5515
|
try {
|
|
5553
|
-
const O = await o.refreshSumsubToken(e), q =
|
|
5516
|
+
const O = await o.refreshSumsubToken(e), q = Ge.parseProviderConfig(p, x, c);
|
|
5554
5517
|
q.accessToken = O, q.onTokenRefresh = () => o.refreshSumsubToken(e);
|
|
5555
|
-
const W =
|
|
5518
|
+
const W = Ge.createProvider(p, q);
|
|
5556
5519
|
W.onComplete((X) => {
|
|
5557
5520
|
console.log("[Sumsub] Verification complete:", X), t == null || t();
|
|
5558
5521
|
}), W.onError((X) => {
|
|
@@ -5570,8 +5533,8 @@ const In = ({
|
|
|
5570
5533
|
if (new URL(x.url), h === Oe.SardinAI) {
|
|
5571
5534
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
5572
5535
|
try {
|
|
5573
|
-
const O =
|
|
5574
|
-
|
|
5536
|
+
const O = Ge.parseProviderConfig(p, x, c);
|
|
5537
|
+
Ge.createProvider(p, O).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((W) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", W));
|
|
5575
5538
|
} catch (O) {
|
|
5576
5539
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", O);
|
|
5577
5540
|
}
|
|
@@ -5585,7 +5548,7 @@ const In = ({
|
|
|
5585
5548
|
if (h === Oe.SardinAI) {
|
|
5586
5549
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), _(null);
|
|
5587
5550
|
try {
|
|
5588
|
-
const O =
|
|
5551
|
+
const O = Ge.parseProviderConfig(p, x, c), q = Ge.createProvider(p, O);
|
|
5589
5552
|
q.initialize().then(() => {
|
|
5590
5553
|
console.log("[SardinAI] Risk SDK initialized successfully"), N(q), setTimeout(() => t == null ? void 0 : t(), 2e3);
|
|
5591
5554
|
}).catch((W) => {
|
|
@@ -5601,7 +5564,7 @@ const In = ({
|
|
|
5601
5564
|
}
|
|
5602
5565
|
try {
|
|
5603
5566
|
_(null);
|
|
5604
|
-
const O =
|
|
5567
|
+
const O = Ge.parseProviderConfig(p, x, c), q = Ge.createProvider(p, O);
|
|
5605
5568
|
h === Oe.Onfido && q.initialize("identity-container").catch((W) => {
|
|
5606
5569
|
console.error("[Onfido] Initialization error:", W), _(`Failed to initialize: ${W.message}`);
|
|
5607
5570
|
}), N(q);
|
|
@@ -5617,7 +5580,7 @@ const In = ({
|
|
|
5617
5580
|
console.error("[Identity] Error destroying provider:", h);
|
|
5618
5581
|
}
|
|
5619
5582
|
};
|
|
5620
|
-
}, [p, x, w,
|
|
5583
|
+
}, [p, x, w, $, t, J, fe, e, c, o]);
|
|
5621
5584
|
const I = async () => {
|
|
5622
5585
|
try {
|
|
5623
5586
|
_(null), se(!1), await A(), V(!0);
|
|
@@ -5626,12 +5589,12 @@ const In = ({
|
|
|
5626
5589
|
}
|
|
5627
5590
|
}, te = async () => {
|
|
5628
5591
|
try {
|
|
5629
|
-
_(null), se(!1), N(null), console.log("[Identity] Restarting verification..."), await
|
|
5592
|
+
_(null), se(!1), N(null), console.log("[Identity] Restarting verification..."), await P(), V(!0);
|
|
5630
5593
|
} catch (h) {
|
|
5631
5594
|
console.error("Error restarting identity verification:", h), _(h.message || "Failed to restart verification");
|
|
5632
5595
|
}
|
|
5633
5596
|
};
|
|
5634
|
-
if (E ||
|
|
5597
|
+
if (E || T)
|
|
5635
5598
|
return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
|
|
5636
5599
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
5637
5600
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
@@ -5641,7 +5604,7 @@ const In = ({
|
|
|
5641
5604
|
"Error: ",
|
|
5642
5605
|
v.message
|
|
5643
5606
|
] }) }) });
|
|
5644
|
-
if (
|
|
5607
|
+
if ($ && (G || J))
|
|
5645
5608
|
return /* @__PURE__ */ s(re, { children: [
|
|
5646
5609
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
5647
5610
|
/* @__PURE__ */ s(ne, { children: [
|
|
@@ -5680,10 +5643,10 @@ const In = ({
|
|
|
5680
5643
|
] }),
|
|
5681
5644
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
5682
5645
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5683
|
-
/* @__PURE__ */ r(Z, { type: "button", onClick: te, disabled:
|
|
5646
|
+
/* @__PURE__ */ r(Z, { type: "button", onClick: te, disabled: T, children: T ? "Restarting..." : "Restart Verification" })
|
|
5684
5647
|
] })
|
|
5685
5648
|
] });
|
|
5686
|
-
if (
|
|
5649
|
+
if ($ && y) {
|
|
5687
5650
|
const h = p;
|
|
5688
5651
|
return fe ? /* @__PURE__ */ s("div", { style: {
|
|
5689
5652
|
background: "var(--metakyc-background, #ffffff)",
|
|
@@ -5716,7 +5679,7 @@ const In = ({
|
|
|
5716
5679
|
{
|
|
5717
5680
|
type: "button",
|
|
5718
5681
|
onClick: te,
|
|
5719
|
-
disabled:
|
|
5682
|
+
disabled: T,
|
|
5720
5683
|
style: {
|
|
5721
5684
|
padding: "6px 14px",
|
|
5722
5685
|
fontSize: "13px",
|
|
@@ -5725,10 +5688,10 @@ const In = ({
|
|
|
5725
5688
|
border: "1px solid var(--metakyc-border, #d1d5db)",
|
|
5726
5689
|
background: "var(--metakyc-background, #ffffff)",
|
|
5727
5690
|
color: "var(--metakyc-text-primary, #111827)",
|
|
5728
|
-
cursor:
|
|
5729
|
-
opacity:
|
|
5691
|
+
cursor: T ? "not-allowed" : "pointer",
|
|
5692
|
+
opacity: T ? 0.5 : 1
|
|
5730
5693
|
},
|
|
5731
|
-
children:
|
|
5694
|
+
children: T ? "Restarting…" : "Restart"
|
|
5732
5695
|
}
|
|
5733
5696
|
)
|
|
5734
5697
|
] }),
|
|
@@ -5761,7 +5724,7 @@ const In = ({
|
|
|
5761
5724
|
variant: "outline",
|
|
5762
5725
|
size: "sm",
|
|
5763
5726
|
onClick: te,
|
|
5764
|
-
disabled:
|
|
5727
|
+
disabled: T,
|
|
5765
5728
|
children: "Restart"
|
|
5766
5729
|
}
|
|
5767
5730
|
)
|
|
@@ -5821,9 +5784,9 @@ const In = ({
|
|
|
5821
5784
|
return q ? q.label : String(O);
|
|
5822
5785
|
}
|
|
5823
5786
|
return String(O);
|
|
5824
|
-
},
|
|
5787
|
+
}, $e = ({ helpText: h }) => {
|
|
5825
5788
|
const [O, q] = k(!1), W = de(null), [, X] = k({ top: 0, left: 0 });
|
|
5826
|
-
return /* @__PURE__ */ s(
|
|
5789
|
+
return /* @__PURE__ */ s(lt, { children: [
|
|
5827
5790
|
/* @__PURE__ */ r(
|
|
5828
5791
|
"button",
|
|
5829
5792
|
{
|
|
@@ -5858,7 +5821,7 @@ const In = ({
|
|
|
5858
5821
|
children: "?"
|
|
5859
5822
|
}
|
|
5860
5823
|
),
|
|
5861
|
-
O &&
|
|
5824
|
+
O && Qt.createPortal(
|
|
5862
5825
|
/* @__PURE__ */ r(
|
|
5863
5826
|
"div",
|
|
5864
5827
|
{
|
|
@@ -5917,7 +5880,7 @@ const In = ({
|
|
|
5917
5880
|
] });
|
|
5918
5881
|
}, Re = (h, O) => O ? /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
5919
5882
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: h }),
|
|
5920
|
-
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(
|
|
5883
|
+
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r($e, { helpText: O }) })
|
|
5921
5884
|
] }) : h, _e = (h, O) => {
|
|
5922
5885
|
const q = `cf-${O}`, W = h.paramName ?? "", X = me[W];
|
|
5923
5886
|
if (h.customType === "br")
|
|
@@ -5974,7 +5937,7 @@ const In = ({
|
|
|
5974
5937
|
}
|
|
5975
5938
|
}
|
|
5976
5939
|
),
|
|
5977
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.customType === "link_checkbox" && h.linkUrl ? /* @__PURE__ */ s(
|
|
5940
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.customType === "link_checkbox" && h.linkUrl ? /* @__PURE__ */ s(lt, { children: [
|
|
5978
5941
|
/* @__PURE__ */ r("a", { href: h.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: h.linkText || h.label }),
|
|
5979
5942
|
h.label && h.linkText ? ` ${h.label}` : ""
|
|
5980
5943
|
] }) : h.displayText || h.label })
|
|
@@ -5984,8 +5947,8 @@ const In = ({
|
|
|
5984
5947
|
}
|
|
5985
5948
|
if (h.customType === "group_checkbox") {
|
|
5986
5949
|
const m = Array.isArray(X) ? X : X ? [X] : [], R = (L) => {
|
|
5987
|
-
h.singleSelect ? ke((
|
|
5988
|
-
...
|
|
5950
|
+
h.singleSelect ? ke((u) => ({ ...u, [W]: m[0] === L ? [] : [L] })) : ke((u) => ({
|
|
5951
|
+
...u,
|
|
5989
5952
|
[W]: m.includes(L) ? m.filter((l) => l !== L) : [...m, L]
|
|
5990
5953
|
}));
|
|
5991
5954
|
};
|
|
@@ -6038,27 +6001,27 @@ const In = ({
|
|
|
6038
6001
|
),
|
|
6039
6002
|
h.helpText
|
|
6040
6003
|
) }, q);
|
|
6041
|
-
},
|
|
6004
|
+
}, at = (h, O) => {
|
|
6042
6005
|
if (h.isCustom) return _e(h, O);
|
|
6043
|
-
const q = h.name ?? "", W =
|
|
6006
|
+
const q = h.name ?? "", W = nt[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = ve[q] ?? "", R = q === "mobileCountryCode", L = !!(W != null && W.countriesType) && !R;
|
|
6044
6007
|
return h.editable ? R ? /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
|
|
6045
6008
|
/* @__PURE__ */ r(
|
|
6046
|
-
|
|
6009
|
+
qe,
|
|
6047
6010
|
{
|
|
6048
6011
|
label: X,
|
|
6049
6012
|
value: String(m),
|
|
6050
|
-
onChange: (
|
|
6013
|
+
onChange: (u) => ue((l) => ({ ...l, [q]: u })),
|
|
6051
6014
|
options: [{ value: "", label: "Select country code…" }, ...K]
|
|
6052
6015
|
}
|
|
6053
6016
|
),
|
|
6054
6017
|
h.helpText
|
|
6055
6018
|
) }, `epc-${O}`) : L ? /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
|
|
6056
6019
|
/* @__PURE__ */ r(
|
|
6057
|
-
|
|
6020
|
+
qe,
|
|
6058
6021
|
{
|
|
6059
6022
|
label: X,
|
|
6060
6023
|
value: String(m),
|
|
6061
|
-
onChange: (
|
|
6024
|
+
onChange: (u) => ue((l) => ({ ...l, [q]: u })),
|
|
6062
6025
|
options: [{ value: "", label: `Select ${X.toLowerCase()}…` }, ...M]
|
|
6063
6026
|
}
|
|
6064
6027
|
),
|
|
@@ -6070,12 +6033,12 @@ const In = ({
|
|
|
6070
6033
|
label: X,
|
|
6071
6034
|
type: (W == null ? void 0 : W.type) === "date" ? "date" : (W == null ? void 0 : W.type) === "email" ? "email" : "text",
|
|
6072
6035
|
value: String(m),
|
|
6073
|
-
onChange: (
|
|
6036
|
+
onChange: (u) => ue((l) => ({ ...l, [q]: u.target.value }))
|
|
6074
6037
|
}
|
|
6075
6038
|
),
|
|
6076
6039
|
h.helpText
|
|
6077
6040
|
) }, `ei-${O}`) : /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
|
|
6078
|
-
/* @__PURE__ */ s(
|
|
6041
|
+
/* @__PURE__ */ s(lt, { children: [
|
|
6079
6042
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: X }),
|
|
6080
6043
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Ne(q, m) })
|
|
6081
6044
|
] }),
|
|
@@ -6091,10 +6054,10 @@ const In = ({
|
|
|
6091
6054
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h }),
|
|
6092
6055
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: O })
|
|
6093
6056
|
] }),
|
|
6094
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: F.fields.map((q, W) =>
|
|
6057
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: F.fields.map((q, W) => at(q, W)) }) }),
|
|
6095
6058
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
6096
6059
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
6097
|
-
/* @__PURE__ */ r(Z, { type: "submit", isLoading:
|
|
6060
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: T, children: "Confirm and Start Verification" })
|
|
6098
6061
|
] })
|
|
6099
6062
|
] }) });
|
|
6100
6063
|
}
|
|
@@ -6105,9 +6068,9 @@ const In = ({
|
|
|
6105
6068
|
] }),
|
|
6106
6069
|
/* @__PURE__ */ s(ne, { className: "space-y-6", children: [
|
|
6107
6070
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
6108
|
-
{ label: "Name", value: `${((
|
|
6109
|
-
{ label: "Email", value: (
|
|
6110
|
-
{ label: "Date of Birth", value: ((
|
|
6071
|
+
{ label: "Name", value: `${((Ze = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Ze.firstName) || ""} ${((je = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : je.lastName) || ""}`.trim() },
|
|
6072
|
+
{ label: "Email", value: (it = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : it.email },
|
|
6073
|
+
{ label: "Date of Birth", value: ((Ye = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Ye.dateOfBirth) || "Not provided" }
|
|
6111
6074
|
].map(({ label: h, value: O }) => /* @__PURE__ */ s("div", { children: [
|
|
6112
6075
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: h }),
|
|
6113
6076
|
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: O })
|
|
@@ -6116,12 +6079,12 @@ const In = ({
|
|
|
6116
6079
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
6117
6080
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6118
6081
|
/* @__PURE__ */ r(
|
|
6119
|
-
|
|
6082
|
+
et,
|
|
6120
6083
|
{
|
|
6121
6084
|
control: H.control,
|
|
6122
6085
|
name: "country",
|
|
6123
6086
|
render: ({ field: h }) => /* @__PURE__ */ r(
|
|
6124
|
-
|
|
6087
|
+
qe,
|
|
6125
6088
|
{
|
|
6126
6089
|
label: "Country",
|
|
6127
6090
|
value: h.value,
|
|
@@ -6132,12 +6095,12 @@ const In = ({
|
|
|
6132
6095
|
}
|
|
6133
6096
|
),
|
|
6134
6097
|
/* @__PURE__ */ r(
|
|
6135
|
-
|
|
6098
|
+
et,
|
|
6136
6099
|
{
|
|
6137
6100
|
control: H.control,
|
|
6138
6101
|
name: "nationality",
|
|
6139
6102
|
render: ({ field: h }) => /* @__PURE__ */ r(
|
|
6140
|
-
|
|
6103
|
+
qe,
|
|
6141
6104
|
{
|
|
6142
6105
|
label: "Nationality",
|
|
6143
6106
|
value: h.value,
|
|
@@ -6149,19 +6112,19 @@ const In = ({
|
|
|
6149
6112
|
)
|
|
6150
6113
|
] }),
|
|
6151
6114
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6152
|
-
/* @__PURE__ */ r(
|
|
6153
|
-
/* @__PURE__ */ r(
|
|
6115
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "street", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street" }) }),
|
|
6116
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "streetNumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street Number" }) })
|
|
6154
6117
|
] }),
|
|
6155
6118
|
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6156
|
-
/* @__PURE__ */ r(
|
|
6157
|
-
/* @__PURE__ */ r(
|
|
6119
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "city", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "City" }) }),
|
|
6120
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "zip", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "ZIP / Postal Code" }) })
|
|
6158
6121
|
] }),
|
|
6159
|
-
/* @__PURE__ */ r(
|
|
6122
|
+
/* @__PURE__ */ r(et, { control: H.control, name: "phonenumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Phone Number", type: "tel" }) })
|
|
6160
6123
|
] })
|
|
6161
6124
|
] }),
|
|
6162
6125
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
6163
6126
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
6164
|
-
/* @__PURE__ */ r(Z, { type: "submit", isLoading:
|
|
6127
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: T, children: "Confirm and Start Verification" })
|
|
6165
6128
|
] })
|
|
6166
6129
|
] }) });
|
|
6167
6130
|
}, Tt = ({
|
|
@@ -6172,63 +6135,63 @@ const In = ({
|
|
|
6172
6135
|
onContinue: i,
|
|
6173
6136
|
onContactSupport: o
|
|
6174
6137
|
}) => {
|
|
6175
|
-
const
|
|
6138
|
+
const d = e === tt.Approved ? {
|
|
6176
6139
|
type: "success",
|
|
6177
6140
|
title: "Verification Approved",
|
|
6178
6141
|
icon: "✓",
|
|
6179
6142
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
6180
6143
|
iconColor: "text-green-600 dark:text-green-400",
|
|
6181
6144
|
message: "Your identity verification has been successfully approved."
|
|
6182
|
-
} : e ===
|
|
6145
|
+
} : e === tt.Rejected ? {
|
|
6183
6146
|
type: "error",
|
|
6184
6147
|
title: "Verification Rejected",
|
|
6185
6148
|
icon: "✕",
|
|
6186
6149
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
6187
6150
|
iconColor: "text-red-600 dark:text-red-400",
|
|
6188
6151
|
message: "Unfortunately, your identity verification was not approved."
|
|
6189
|
-
} : e ===
|
|
6152
|
+
} : e === tt.Pending || e === tt.InProgress ? {
|
|
6190
6153
|
type: "pending",
|
|
6191
6154
|
title: "Verification Pending",
|
|
6192
6155
|
icon: "⏱",
|
|
6193
6156
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
6194
6157
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
6195
6158
|
message: "Your identity verification is currently being processed."
|
|
6196
|
-
} : t ===
|
|
6159
|
+
} : t === rt.Approved ? {
|
|
6197
6160
|
type: "success",
|
|
6198
6161
|
title: "Application Approved",
|
|
6199
6162
|
icon: "✓",
|
|
6200
6163
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
6201
6164
|
iconColor: "text-green-600 dark:text-green-400",
|
|
6202
6165
|
message: "Your application has been approved."
|
|
6203
|
-
} : t ===
|
|
6166
|
+
} : t === rt.Reject ? {
|
|
6204
6167
|
type: "error",
|
|
6205
6168
|
title: "Application Rejected",
|
|
6206
6169
|
icon: "✕",
|
|
6207
6170
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
6208
6171
|
iconColor: "text-red-600 dark:text-red-400",
|
|
6209
6172
|
message: "Your application has been rejected."
|
|
6210
|
-
} : t ===
|
|
6173
|
+
} : t === rt.UnderReview || t === rt.AdminReview ? {
|
|
6211
6174
|
type: "pending",
|
|
6212
6175
|
title: "Under Review",
|
|
6213
6176
|
icon: "📋",
|
|
6214
6177
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
6215
6178
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
6216
6179
|
message: "Your application is currently under manual review."
|
|
6217
|
-
} : n ===
|
|
6180
|
+
} : n === gt.Success ? {
|
|
6218
6181
|
type: "success",
|
|
6219
6182
|
title: "Process Complete",
|
|
6220
6183
|
icon: "✓",
|
|
6221
6184
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
6222
6185
|
iconColor: "text-green-600 dark:text-green-400",
|
|
6223
6186
|
message: "Your verification process has been completed successfully."
|
|
6224
|
-
} : n ===
|
|
6187
|
+
} : n === gt.Failed ? {
|
|
6225
6188
|
type: "error",
|
|
6226
6189
|
title: "Process Failed",
|
|
6227
6190
|
icon: "✕",
|
|
6228
6191
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
6229
6192
|
iconColor: "text-red-600 dark:text-red-400",
|
|
6230
6193
|
message: "The verification process could not be completed."
|
|
6231
|
-
} : n ===
|
|
6194
|
+
} : n === gt.AdminReview ? {
|
|
6232
6195
|
type: "pending",
|
|
6233
6196
|
title: "Admin Review Required",
|
|
6234
6197
|
icon: "📋",
|
|
@@ -6248,20 +6211,20 @@ const In = ({
|
|
|
6248
6211
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
6249
6212
|
"div",
|
|
6250
6213
|
{
|
|
6251
|
-
className: `w-24 h-24 rounded-full flex items-center justify-center ${
|
|
6252
|
-
children: /* @__PURE__ */ r("span", { className: `text-5xl ${
|
|
6214
|
+
className: `w-24 h-24 rounded-full flex items-center justify-center ${d.iconBg}`,
|
|
6215
|
+
children: /* @__PURE__ */ r("span", { className: `text-5xl ${d.iconColor}`, children: d.icon })
|
|
6253
6216
|
}
|
|
6254
6217
|
) }),
|
|
6255
|
-
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
6218
|
+
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children: d.title }),
|
|
6256
6219
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
6257
|
-
|
|
6220
|
+
$t,
|
|
6258
6221
|
{
|
|
6259
|
-
variant:
|
|
6260
|
-
children: e != null ?
|
|
6222
|
+
variant: d.type === "success" ? "success" : d.type === "error" ? "danger" : d.type === "pending" ? "warning" : "info",
|
|
6223
|
+
children: e != null ? tt[e] : rt[t]
|
|
6261
6224
|
}
|
|
6262
6225
|
) }),
|
|
6263
|
-
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a ||
|
|
6264
|
-
|
|
6226
|
+
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a || d.message }),
|
|
6227
|
+
d.type === "success" && /* @__PURE__ */ s("div", { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6", children: [
|
|
6265
6228
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
|
|
6266
6229
|
/* @__PURE__ */ s("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
|
|
6267
6230
|
/* @__PURE__ */ r("li", { children: "✓ Your identity has been verified" }),
|
|
@@ -6269,7 +6232,7 @@ const In = ({
|
|
|
6269
6232
|
/* @__PURE__ */ r("li", { children: "✓ All features are now accessible" })
|
|
6270
6233
|
] })
|
|
6271
6234
|
] }),
|
|
6272
|
-
|
|
6235
|
+
d.type === "error" && /* @__PURE__ */ s("div", { className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mb-6", children: [
|
|
6273
6236
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-2", children: "What Can You Do?" }),
|
|
6274
6237
|
/* @__PURE__ */ s("ul", { className: "text-sm text-red-800 dark:text-red-200 space-y-2", children: [
|
|
6275
6238
|
/* @__PURE__ */ r("li", { children: "• Review the requirements and ensure all information is correct" }),
|
|
@@ -6277,7 +6240,7 @@ const In = ({
|
|
|
6277
6240
|
/* @__PURE__ */ r("li", { children: "• You may be able to resubmit your application" })
|
|
6278
6241
|
] })
|
|
6279
6242
|
] }),
|
|
6280
|
-
|
|
6243
|
+
d.type === "pending" && /* @__PURE__ */ s("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-6", children: [
|
|
6281
6244
|
/* @__PURE__ */ r("h3", { className: "font-semibold text-blue-900 dark:text-blue-100 mb-2", children: "What Happens Next?" }),
|
|
6282
6245
|
/* @__PURE__ */ s("ul", { className: "text-sm text-blue-800 dark:text-blue-200 space-y-2", children: [
|
|
6283
6246
|
/* @__PURE__ */ r("li", { children: "• Our team is reviewing your information" }),
|
|
@@ -6289,21 +6252,21 @@ const In = ({
|
|
|
6289
6252
|
/* @__PURE__ */ r("div", { className: "mt-6 pt-6", style: { borderTop: "1px solid var(--metakyc-border, #e5e7eb)" }, children: /* @__PURE__ */ s("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
6290
6253
|
/* @__PURE__ */ s("div", { children: [
|
|
6291
6254
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "KYC Status:" }),
|
|
6292
|
-
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ?
|
|
6255
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ? tt[e] : "Not Available" })
|
|
6293
6256
|
] }),
|
|
6294
6257
|
/* @__PURE__ */ s("div", { children: [
|
|
6295
6258
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Review Status:" }),
|
|
6296
|
-
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
6259
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: rt[t] })
|
|
6297
6260
|
] })
|
|
6298
6261
|
] }) })
|
|
6299
6262
|
] }),
|
|
6300
6263
|
/* @__PURE__ */ s(Ce, { className: "flex justify-center gap-4", children: [
|
|
6301
|
-
|
|
6302
|
-
|
|
6264
|
+
d.type === "success" && i && /* @__PURE__ */ r(Z, { onClick: i, size: "lg", children: "Continue" }),
|
|
6265
|
+
d.type === "error" && /* @__PURE__ */ s(lt, { children: [
|
|
6303
6266
|
o && /* @__PURE__ */ r(Z, { variant: "outline", onClick: o, children: "Contact Support" }),
|
|
6304
6267
|
i && /* @__PURE__ */ r(Z, { onClick: i, children: "Try Again" })
|
|
6305
6268
|
] }),
|
|
6306
|
-
|
|
6269
|
+
d.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
6307
6270
|
] })
|
|
6308
6271
|
] });
|
|
6309
6272
|
}, Tn = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
|
|
@@ -6321,12 +6284,12 @@ const In = ({
|
|
|
6321
6284
|
console.warn("[Logo] Failed to load logo:", e.url), n.target.style.display = "none";
|
|
6322
6285
|
}
|
|
6323
6286
|
}
|
|
6324
|
-
) }),
|
|
6287
|
+
) }), mt = ({
|
|
6325
6288
|
title: e,
|
|
6326
6289
|
subtitle: t,
|
|
6327
6290
|
className: n = ""
|
|
6328
6291
|
}) => {
|
|
6329
|
-
const { currentTheme: a } =
|
|
6292
|
+
const { currentTheme: a } = Pe(), i = e || (a == null ? void 0 : a.title) || "", o = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!i;
|
|
6330
6293
|
return !o && !c ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${n}`, children: [
|
|
6331
6294
|
/* @__PURE__ */ s(
|
|
6332
6295
|
"div",
|
|
@@ -6348,11 +6311,11 @@ const In = ({
|
|
|
6348
6311
|
),
|
|
6349
6312
|
t && /* @__PURE__ */ r("p", { className: "text-sm mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: t })
|
|
6350
6313
|
] });
|
|
6351
|
-
},
|
|
6352
|
-
function
|
|
6314
|
+
}, ft = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
6315
|
+
function ot(e) {
|
|
6353
6316
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
6354
6317
|
}
|
|
6355
|
-
const
|
|
6318
|
+
const pt = {
|
|
6356
6319
|
width: "16px",
|
|
6357
6320
|
height: "16px",
|
|
6358
6321
|
minWidth: "16px",
|
|
@@ -6364,9 +6327,9 @@ const ut = {
|
|
|
6364
6327
|
padding: 0,
|
|
6365
6328
|
display: "inline-block",
|
|
6366
6329
|
verticalAlign: "middle"
|
|
6367
|
-
},
|
|
6330
|
+
}, Lt = ({ helpText: e, children: t }) => {
|
|
6368
6331
|
const [n, a] = we.useState(!1);
|
|
6369
|
-
if (!e) return /* @__PURE__ */ r(
|
|
6332
|
+
if (!e) return /* @__PURE__ */ r(lt, { children: t });
|
|
6370
6333
|
const i = n ? /* @__PURE__ */ r(
|
|
6371
6334
|
"div",
|
|
6372
6335
|
{
|
|
@@ -6483,25 +6446,25 @@ const ut = {
|
|
|
6483
6446
|
children: "?"
|
|
6484
6447
|
}
|
|
6485
6448
|
),
|
|
6486
|
-
typeof document < "u" && i ?
|
|
6449
|
+
typeof document < "u" && i ? St(i, document.body) : null
|
|
6487
6450
|
] });
|
|
6488
|
-
},
|
|
6451
|
+
}, Zn = ({
|
|
6489
6452
|
workflowKey: e,
|
|
6490
6453
|
externalRefId: t,
|
|
6491
6454
|
onSuccess: n,
|
|
6492
6455
|
onCancel: a
|
|
6493
6456
|
}) => {
|
|
6494
|
-
var q, W, X, m, R, L,
|
|
6495
|
-
const { config: i, baseInformationService: o, currentTheme: c } =
|
|
6457
|
+
var q, W, X, m, R, L, u;
|
|
6458
|
+
const { config: i, baseInformationService: o, currentTheme: c } = Pe(), { createApplicant: d, isLoading: y } = zt(), p = e || ((q = i.applicantForm) == null ? void 0 : q.workflowKey);
|
|
6496
6459
|
if (!p)
|
|
6497
6460
|
throw new Error(
|
|
6498
6461
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
6499
6462
|
);
|
|
6500
|
-
const x = t || ((W = i.applicantForm) == null ? void 0 : W.externalRefId) || "",
|
|
6463
|
+
const x = t || ((W = i.applicantForm) == null ? void 0 : W.externalRefId) || "", T = ((X = i.applicantForm) == null ? void 0 : X.email) || "", v = ((m = i.applicantForm) == null ? void 0 : m.hiddenValues) || {}, A = ((R = i.applicantForm) == null ? void 0 : R.initialValues) || {}, w = (((L = i.applicantForm) == null ? void 0 : L.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", N = De(
|
|
6501
6464
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
6502
6465
|
[c == null ? void 0 : c.applicantFormPages]
|
|
6503
6466
|
), z = De(() => {
|
|
6504
|
-
const l = new Set(
|
|
6467
|
+
const l = new Set(ft), f = c == null ? void 0 : c.applicantFormRequiredFields;
|
|
6505
6468
|
if (f) for (const D of f) l.add(D);
|
|
6506
6469
|
if (N)
|
|
6507
6470
|
for (const D of N)
|
|
@@ -6512,15 +6475,15 @@ const ut = {
|
|
|
6512
6475
|
var D;
|
|
6513
6476
|
if (N) {
|
|
6514
6477
|
const g = N.flatMap((S) => S.fields).filter((S) => !S.isCustom && S.name).map((S) => S.name), C = new Set(g);
|
|
6515
|
-
for (const S of
|
|
6478
|
+
for (const S of ft) C.add(S);
|
|
6516
6479
|
return Array.from(C);
|
|
6517
6480
|
}
|
|
6518
6481
|
let l;
|
|
6519
|
-
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l =
|
|
6482
|
+
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = cr;
|
|
6520
6483
|
const f = new Set(l);
|
|
6521
|
-
for (const g of
|
|
6484
|
+
for (const g of ft) f.add(g);
|
|
6522
6485
|
return Array.from(f);
|
|
6523
|
-
}, [(
|
|
6486
|
+
}, [(u = i.applicantForm) == null ? void 0 : u.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, N]), M = /* @__PURE__ */ new Set([
|
|
6524
6487
|
"country",
|
|
6525
6488
|
"nationality",
|
|
6526
6489
|
"taxCountry",
|
|
@@ -6533,17 +6496,17 @@ const ut = {
|
|
|
6533
6496
|
if (N)
|
|
6534
6497
|
for (const g of N)
|
|
6535
6498
|
for (const C of g.fields)
|
|
6536
|
-
!C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f =
|
|
6499
|
+
!C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f = nt[C.name]) == null ? void 0 : f.countriesType));
|
|
6537
6500
|
else
|
|
6538
6501
|
for (const g of Q)
|
|
6539
|
-
M.has(g) && l.add((D =
|
|
6502
|
+
M.has(g) && l.add((D = nt[g]) == null ? void 0 : D.countriesType);
|
|
6540
6503
|
return l.size === 0 && l.add(void 0), Array.from(l);
|
|
6541
|
-
}, [Q, N]), [K, ee] = k({}), [E, b] = k(!0),
|
|
6504
|
+
}, [Q, N]), [K, ee] = k({}), [E, b] = k(!0), $ = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
|
|
6542
6505
|
ge(() => {
|
|
6543
6506
|
if (!c) return;
|
|
6544
6507
|
const l = j.filter((g) => {
|
|
6545
6508
|
const C = g != null ? String(g) : "all";
|
|
6546
|
-
return !V.current.has(C) &&
|
|
6509
|
+
return !V.current.has(C) && !$.current.has(C);
|
|
6547
6510
|
});
|
|
6548
6511
|
if (l.length === 0) {
|
|
6549
6512
|
j.every((C) => {
|
|
@@ -6554,20 +6517,20 @@ const ut = {
|
|
|
6554
6517
|
}
|
|
6555
6518
|
b(!0);
|
|
6556
6519
|
const f = l.map((g) => g != null ? String(g) : "all");
|
|
6557
|
-
f.forEach((g) =>
|
|
6520
|
+
f.forEach((g) => $.current.add(g)), (async () => {
|
|
6558
6521
|
try {
|
|
6559
6522
|
const g = await Promise.all(
|
|
6560
6523
|
l.map(async (C) => {
|
|
6561
|
-
const S = C != null ? String(C) : "all", pe = await o.getCountries("", i.locale || "en", C), ie = C === 40, be = /* @__PURE__ */ new Set(),
|
|
6524
|
+
const S = C != null ? String(C) : "all", pe = await o.getCountries("", i.locale || "en", C), ie = C === 40, be = /* @__PURE__ */ new Set(), Te = pe.map((le) => ie && le.countryCode ? {
|
|
6562
6525
|
value: le.countryCode,
|
|
6563
6526
|
label: `${le.countryCode} – ${le.name}`
|
|
6564
6527
|
} : { value: le.abbreviation3 || le.abbreviation, label: le.name }).filter((le) => !le.value || be.has(le.value) ? !1 : (be.add(le.value), !0));
|
|
6565
|
-
return V.current.add(S),
|
|
6528
|
+
return V.current.add(S), $.current.delete(S), [S, Te];
|
|
6566
6529
|
})
|
|
6567
6530
|
);
|
|
6568
6531
|
ee((C) => ({ ...C, ...Object.fromEntries(g) }));
|
|
6569
6532
|
} catch (g) {
|
|
6570
|
-
f.forEach((C) =>
|
|
6533
|
+
f.forEach((C) => $.current.delete(C)), console.error("Failed to load countries:", g);
|
|
6571
6534
|
} finally {
|
|
6572
6535
|
j.every((C) => {
|
|
6573
6536
|
const S = C != null ? String(C) : "all";
|
|
@@ -6578,7 +6541,7 @@ const ut = {
|
|
|
6578
6541
|
}, [j, c]);
|
|
6579
6542
|
const G = (l, f) => {
|
|
6580
6543
|
var C;
|
|
6581
|
-
const D = f ?? ((C =
|
|
6544
|
+
const D = f ?? ((C = nt[l]) == null ? void 0 : C.countriesType), g = D != null ? String(D) : "all";
|
|
6582
6545
|
return K[g] || [];
|
|
6583
6546
|
}, _ = {
|
|
6584
6547
|
firstName: 1,
|
|
@@ -6612,7 +6575,7 @@ const ut = {
|
|
|
6612
6575
|
firstName: "",
|
|
6613
6576
|
lastName: "",
|
|
6614
6577
|
title: "",
|
|
6615
|
-
email:
|
|
6578
|
+
email: T,
|
|
6616
6579
|
dateOfBirth: "",
|
|
6617
6580
|
phonenumber: "",
|
|
6618
6581
|
externalRefId: x,
|
|
@@ -6636,7 +6599,7 @@ const ut = {
|
|
|
6636
6599
|
...se
|
|
6637
6600
|
}), ue = Object.fromEntries(
|
|
6638
6601
|
Object.entries(v).filter(([l]) => !(l in J) && l !== "externalRefId" && l !== "workflowKey")
|
|
6639
|
-
), [me, ke] = k({ ...ue }), [F, U] = k(0), [
|
|
6602
|
+
), [me, ke] = k({ ...ue }), [F, U] = k(0), [B, H] = k({}), [fe, I] = k(null), [te, ye] = k(!1), oe = (l, f) => ve((D) => ({ ...D, [l]: f })), Ne = (l, f) => ke((D) => ({ ...D, [l]: f })), $e = (l) => !l.conditionalOn || me[l.conditionalOn] === "true", Re = N && F < N.length - 1 ? F + 1 : -1, _e = N && F > 0 ? F - 1 : -1, at = (l) => {
|
|
6640
6603
|
var D;
|
|
6641
6604
|
const f = {};
|
|
6642
6605
|
for (const g of l.fields)
|
|
@@ -6648,20 +6611,20 @@ const ut = {
|
|
|
6648
6611
|
}
|
|
6649
6612
|
} else if (g.name) {
|
|
6650
6613
|
const C = g.name;
|
|
6651
|
-
if (z.includes(C) &&
|
|
6652
|
-
const S = g.displayText || ((D =
|
|
6614
|
+
if (z.includes(C) && ot(Y[C])) {
|
|
6615
|
+
const S = g.displayText || ((D = nt[C]) == null ? void 0 : D.label) || C;
|
|
6653
6616
|
f[C] = `${S} is required.`;
|
|
6654
6617
|
}
|
|
6655
6618
|
}
|
|
6656
6619
|
return f;
|
|
6657
|
-
},
|
|
6620
|
+
}, Ze = async () => {
|
|
6658
6621
|
if (!N) return;
|
|
6659
6622
|
const l = N[F];
|
|
6660
|
-
if (l.conditionalOn &&
|
|
6623
|
+
if (l.conditionalOn && !$e(l)) {
|
|
6661
6624
|
H({}), Re >= 0 ? U(Re) : await je();
|
|
6662
6625
|
return;
|
|
6663
6626
|
}
|
|
6664
|
-
const f =
|
|
6627
|
+
const f = at(l);
|
|
6665
6628
|
if (Object.keys(f).length > 0) {
|
|
6666
6629
|
H(f);
|
|
6667
6630
|
return;
|
|
@@ -6671,7 +6634,7 @@ const ut = {
|
|
|
6671
6634
|
if (N) {
|
|
6672
6635
|
let l = {};
|
|
6673
6636
|
for (const f of N)
|
|
6674
|
-
|
|
6637
|
+
$e(f) && (l = { ...l, ...at(f) });
|
|
6675
6638
|
if (Object.keys(l).length > 0) {
|
|
6676
6639
|
H(l);
|
|
6677
6640
|
return;
|
|
@@ -6689,28 +6652,28 @@ const ut = {
|
|
|
6689
6652
|
};
|
|
6690
6653
|
if (N) {
|
|
6691
6654
|
for (const C of N)
|
|
6692
|
-
if (
|
|
6655
|
+
if ($e(C)) {
|
|
6693
6656
|
for (const S of C.fields)
|
|
6694
6657
|
if (!S.isCustom && S.name) {
|
|
6695
6658
|
const pe = S.name, ie = Y[pe];
|
|
6696
|
-
|
|
6659
|
+
ot(ie) || (l[pe] = ie);
|
|
6697
6660
|
}
|
|
6698
6661
|
}
|
|
6699
|
-
for (const C of
|
|
6662
|
+
for (const C of ft)
|
|
6700
6663
|
if (l[C] === void 0) {
|
|
6701
6664
|
const S = Y[C];
|
|
6702
|
-
|
|
6665
|
+
ot(S) || (l[C] = S);
|
|
6703
6666
|
}
|
|
6704
6667
|
} else
|
|
6705
6668
|
Q.forEach((C) => {
|
|
6706
6669
|
if (C === "externalRefId") return;
|
|
6707
6670
|
const S = Y[C];
|
|
6708
|
-
|
|
6671
|
+
ot(S) || (l[C] = S);
|
|
6709
6672
|
});
|
|
6710
6673
|
const f = [];
|
|
6711
6674
|
if (N) {
|
|
6712
6675
|
for (const C of N)
|
|
6713
|
-
if (
|
|
6676
|
+
if ($e(C))
|
|
6714
6677
|
for (const S of C.fields) {
|
|
6715
6678
|
if (!S.isCustom || !S.paramName || S.customType === "paragraph" || S.customType === "html" || S.customType === "br" || S.customType === "link") continue;
|
|
6716
6679
|
const pe = me[S.paramName] ?? "";
|
|
@@ -6722,47 +6685,47 @@ const ut = {
|
|
|
6722
6685
|
}
|
|
6723
6686
|
}
|
|
6724
6687
|
for (const [C, S] of Object.entries(J))
|
|
6725
|
-
l[C] === void 0 && !
|
|
6688
|
+
l[C] === void 0 && !ot(S) && (l[C] = S);
|
|
6726
6689
|
const D = new Set(f.map((C) => C.paramName));
|
|
6727
6690
|
for (const [C, S] of Object.entries(ue))
|
|
6728
6691
|
!D.has(C) && S && f.push({ paramName: C, value: S });
|
|
6729
6692
|
f.length > 0 && (l.applicantAdditionalDatas = f);
|
|
6730
|
-
const g = await
|
|
6693
|
+
const g = await d(l);
|
|
6731
6694
|
n(g.applicantId);
|
|
6732
6695
|
} catch (l) {
|
|
6733
6696
|
console.error("Error creating applicant:", l), I(l.message || "Failed to create applicant");
|
|
6734
6697
|
} finally {
|
|
6735
6698
|
ye(!1);
|
|
6736
6699
|
}
|
|
6737
|
-
},
|
|
6700
|
+
}, it = async (l) => {
|
|
6738
6701
|
var f;
|
|
6739
6702
|
l.preventDefault();
|
|
6740
6703
|
for (const D of z)
|
|
6741
|
-
if (
|
|
6742
|
-
const g = ((f =
|
|
6704
|
+
if (ot(Y[D])) {
|
|
6705
|
+
const g = ((f = nt[D]) == null ? void 0 : f.label) || D;
|
|
6743
6706
|
I(`${g} is required.`);
|
|
6744
6707
|
return;
|
|
6745
6708
|
}
|
|
6746
6709
|
await je();
|
|
6747
|
-
},
|
|
6748
|
-
var
|
|
6749
|
-
const S =
|
|
6710
|
+
}, Ye = (l, f, D, g, C) => {
|
|
6711
|
+
var Nt;
|
|
6712
|
+
const S = nt[l];
|
|
6750
6713
|
if (!S) return null;
|
|
6751
|
-
const pe = z.includes(l), ie =
|
|
6714
|
+
const pe = z.includes(l), ie = B[l], be = D || S.label, Te = l in se, le = f ?? l, Be = { required: pe }, He = C ? C !== "placeholder" : w, Qe = He ? be : void 0, Wt = He ? "..." : be;
|
|
6752
6715
|
switch (S.type) {
|
|
6753
6716
|
case "select":
|
|
6754
6717
|
if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
|
|
6755
6718
|
const Ie = G(l, g);
|
|
6756
6719
|
return /* @__PURE__ */ r(
|
|
6757
|
-
|
|
6720
|
+
qe,
|
|
6758
6721
|
{
|
|
6759
|
-
|
|
6760
|
-
label:
|
|
6722
|
+
...Be,
|
|
6723
|
+
label: Qe,
|
|
6761
6724
|
value: Y[l] || "",
|
|
6762
|
-
onChange: (
|
|
6763
|
-
options: [{ value: "", label: `Select ${
|
|
6725
|
+
onChange: (Xe) => oe(l, Xe),
|
|
6726
|
+
options: [{ value: "", label: `Select ${Wt.toLowerCase()}` }, ...Ie],
|
|
6764
6727
|
disabled: E,
|
|
6765
|
-
readOnly:
|
|
6728
|
+
readOnly: Te,
|
|
6766
6729
|
error: ie
|
|
6767
6730
|
},
|
|
6768
6731
|
le
|
|
@@ -6770,34 +6733,34 @@ const ut = {
|
|
|
6770
6733
|
}
|
|
6771
6734
|
if (l === "salutation")
|
|
6772
6735
|
return /* @__PURE__ */ r(
|
|
6773
|
-
|
|
6736
|
+
qe,
|
|
6774
6737
|
{
|
|
6775
|
-
|
|
6776
|
-
label:
|
|
6777
|
-
value: ((
|
|
6738
|
+
...Be,
|
|
6739
|
+
label: Qe,
|
|
6740
|
+
value: ((Nt = Y[l]) == null ? void 0 : Nt.toString()) || "",
|
|
6778
6741
|
onChange: (Ie) => oe(l, Ie ? Number(Ie) : null),
|
|
6779
6742
|
options: [
|
|
6780
6743
|
{ value: "", label: He ? "Select salutation..." : be },
|
|
6781
|
-
{ value:
|
|
6782
|
-
{ value:
|
|
6783
|
-
{ value:
|
|
6744
|
+
{ value: bt.Male.toString(), label: "Male" },
|
|
6745
|
+
{ value: bt.Female.toString(), label: "Female" },
|
|
6746
|
+
{ value: bt.Other.toString(), label: "Other" }
|
|
6784
6747
|
],
|
|
6785
|
-
readOnly:
|
|
6748
|
+
readOnly: Te,
|
|
6786
6749
|
error: ie
|
|
6787
6750
|
},
|
|
6788
6751
|
le
|
|
6789
6752
|
);
|
|
6790
6753
|
if (l === "defaultLanguage") {
|
|
6791
|
-
const Ie = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ?
|
|
6754
|
+
const Ie = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? It.filter((Xe) => c.allowedLanguages.includes(Xe.value)) : It;
|
|
6792
6755
|
return /* @__PURE__ */ r(
|
|
6793
|
-
|
|
6756
|
+
qe,
|
|
6794
6757
|
{
|
|
6795
|
-
|
|
6796
|
-
label:
|
|
6758
|
+
...Be,
|
|
6759
|
+
label: Qe,
|
|
6797
6760
|
value: Y[l] || "",
|
|
6798
|
-
onChange: (
|
|
6761
|
+
onChange: (Xe) => oe(l, Xe),
|
|
6799
6762
|
options: [{ value: "", label: He ? "Select language..." : be }, ...Ie],
|
|
6800
|
-
readOnly:
|
|
6763
|
+
readOnly: Te,
|
|
6801
6764
|
error: ie
|
|
6802
6765
|
},
|
|
6803
6766
|
le
|
|
@@ -6808,16 +6771,16 @@ const ut = {
|
|
|
6808
6771
|
if (l === "otherNationality") {
|
|
6809
6772
|
const Ie = G(l, g);
|
|
6810
6773
|
return /* @__PURE__ */ r(
|
|
6811
|
-
|
|
6774
|
+
en,
|
|
6812
6775
|
{
|
|
6813
|
-
|
|
6814
|
-
label:
|
|
6776
|
+
...Be,
|
|
6777
|
+
label: Qe,
|
|
6815
6778
|
value: Y[l] || [],
|
|
6816
|
-
onChange: (
|
|
6779
|
+
onChange: (Xe) => oe(l, Xe),
|
|
6817
6780
|
options: Ie,
|
|
6818
6781
|
placeholder: He ? "Select other nationalities..." : be,
|
|
6819
6782
|
disabled: E,
|
|
6820
|
-
readOnly:
|
|
6783
|
+
readOnly: Te
|
|
6821
6784
|
},
|
|
6822
6785
|
le
|
|
6823
6786
|
);
|
|
@@ -6827,13 +6790,13 @@ const ut = {
|
|
|
6827
6790
|
return /* @__PURE__ */ r(
|
|
6828
6791
|
xe,
|
|
6829
6792
|
{
|
|
6830
|
-
|
|
6793
|
+
...Be,
|
|
6831
6794
|
type: "date",
|
|
6832
|
-
label:
|
|
6795
|
+
label: Qe,
|
|
6833
6796
|
placeholder: He ? void 0 : be,
|
|
6834
6797
|
value: Y[l] || "",
|
|
6835
6798
|
onChange: (Ie) => oe(l, Ie.target.value),
|
|
6836
|
-
readOnly:
|
|
6799
|
+
readOnly: Te,
|
|
6837
6800
|
error: ie
|
|
6838
6801
|
},
|
|
6839
6802
|
le
|
|
@@ -6842,13 +6805,13 @@ const ut = {
|
|
|
6842
6805
|
return /* @__PURE__ */ r(
|
|
6843
6806
|
xe,
|
|
6844
6807
|
{
|
|
6845
|
-
|
|
6808
|
+
...Be,
|
|
6846
6809
|
type: "email",
|
|
6847
|
-
label:
|
|
6810
|
+
label: Qe,
|
|
6848
6811
|
placeholder: He ? void 0 : be,
|
|
6849
6812
|
value: Y[l] || "",
|
|
6850
6813
|
onChange: (Ie) => oe(l, Ie.target.value),
|
|
6851
|
-
readOnly:
|
|
6814
|
+
readOnly: Te,
|
|
6852
6815
|
error: ie
|
|
6853
6816
|
},
|
|
6854
6817
|
le
|
|
@@ -6857,13 +6820,13 @@ const ut = {
|
|
|
6857
6820
|
return /* @__PURE__ */ r(
|
|
6858
6821
|
xe,
|
|
6859
6822
|
{
|
|
6860
|
-
|
|
6823
|
+
...Be,
|
|
6861
6824
|
type: "tel",
|
|
6862
|
-
label:
|
|
6825
|
+
label: Qe,
|
|
6863
6826
|
placeholder: He ? void 0 : be,
|
|
6864
6827
|
value: Y[l] || "",
|
|
6865
6828
|
onChange: (Ie) => oe(l, Ie.target.value),
|
|
6866
|
-
readOnly:
|
|
6829
|
+
readOnly: Te,
|
|
6867
6830
|
error: ie
|
|
6868
6831
|
},
|
|
6869
6832
|
le
|
|
@@ -6872,13 +6835,13 @@ const ut = {
|
|
|
6872
6835
|
return /* @__PURE__ */ r(
|
|
6873
6836
|
xe,
|
|
6874
6837
|
{
|
|
6875
|
-
|
|
6838
|
+
...Be,
|
|
6876
6839
|
type: "text",
|
|
6877
|
-
label:
|
|
6840
|
+
label: Qe,
|
|
6878
6841
|
placeholder: He ? void 0 : be,
|
|
6879
6842
|
value: Y[l] || "",
|
|
6880
6843
|
onChange: (Ie) => oe(l, Ie.target.value),
|
|
6881
|
-
readOnly:
|
|
6844
|
+
readOnly: Te,
|
|
6882
6845
|
error: ie
|
|
6883
6846
|
},
|
|
6884
6847
|
le
|
|
@@ -6938,7 +6901,7 @@ const ut = {
|
|
|
6938
6901
|
) }, `custom-${f}`);
|
|
6939
6902
|
}
|
|
6940
6903
|
if (!l.paramName) return null;
|
|
6941
|
-
const g =
|
|
6904
|
+
const g = B[l.paramName], C = l.displayText || l.label || l.paramName;
|
|
6942
6905
|
if (l.customType === "checkbox")
|
|
6943
6906
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
6944
6907
|
/* @__PURE__ */ s(
|
|
@@ -6954,7 +6917,7 @@ const ut = {
|
|
|
6954
6917
|
checked: me[l.paramName] === "true",
|
|
6955
6918
|
onChange: (S) => Ne(l.paramName, S.target.checked ? "true" : "false"),
|
|
6956
6919
|
className: "metakyc-option-input",
|
|
6957
|
-
style:
|
|
6920
|
+
style: pt
|
|
6958
6921
|
}
|
|
6959
6922
|
),
|
|
6960
6923
|
/* @__PURE__ */ s(
|
|
@@ -6988,7 +6951,7 @@ const ut = {
|
|
|
6988
6951
|
checked: me[l.paramName] === "true",
|
|
6989
6952
|
onChange: (S) => Ne(l.paramName, S.target.checked ? "true" : "false"),
|
|
6990
6953
|
className: "metakyc-option-input",
|
|
6991
|
-
style: { ...
|
|
6954
|
+
style: { ...pt, alignSelf: "flex-start", marginTop: "2px" }
|
|
6992
6955
|
}
|
|
6993
6956
|
),
|
|
6994
6957
|
/* @__PURE__ */ s(
|
|
@@ -7051,12 +7014,12 @@ const ut = {
|
|
|
7051
7014
|
if (l.singleSelect)
|
|
7052
7015
|
Ne(l.paramName, be.target.checked ? pe.value : "");
|
|
7053
7016
|
else {
|
|
7054
|
-
const
|
|
7055
|
-
Ne(l.paramName,
|
|
7017
|
+
const Te = be.target.checked ? [...S, pe.value] : S.filter((le) => le !== pe.value);
|
|
7018
|
+
Ne(l.paramName, Te.join(","));
|
|
7056
7019
|
}
|
|
7057
7020
|
},
|
|
7058
7021
|
className: "metakyc-option-input",
|
|
7059
|
-
style:
|
|
7022
|
+
style: pt
|
|
7060
7023
|
}
|
|
7061
7024
|
),
|
|
7062
7025
|
/* @__PURE__ */ r(
|
|
@@ -7101,7 +7064,7 @@ const ut = {
|
|
|
7101
7064
|
onChange: () => Ne(l.paramName, S.value),
|
|
7102
7065
|
name: `radio-group-${l.paramName}-${f}`,
|
|
7103
7066
|
className: "metakyc-option-input",
|
|
7104
|
-
style:
|
|
7067
|
+
style: pt
|
|
7105
7068
|
}
|
|
7106
7069
|
),
|
|
7107
7070
|
/* @__PURE__ */ r(
|
|
@@ -7131,9 +7094,9 @@ const ut = {
|
|
|
7131
7094
|
`custom-${f}`
|
|
7132
7095
|
);
|
|
7133
7096
|
}, O = (l, f) => {
|
|
7134
|
-
const D =
|
|
7097
|
+
const D = $e(l);
|
|
7135
7098
|
return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
7136
|
-
l.conditionalOn && /* @__PURE__ */ r(
|
|
7099
|
+
l.conditionalOn && /* @__PURE__ */ r(Lt, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ s(
|
|
7137
7100
|
"label",
|
|
7138
7101
|
{
|
|
7139
7102
|
className: "metakyc-option-label",
|
|
@@ -7146,7 +7109,7 @@ const ut = {
|
|
|
7146
7109
|
checked: D,
|
|
7147
7110
|
onChange: (g) => Ne(l.conditionalOn, g.target.checked ? "true" : "false"),
|
|
7148
7111
|
className: "metakyc-option-input",
|
|
7149
|
-
style:
|
|
7112
|
+
style: pt
|
|
7150
7113
|
}
|
|
7151
7114
|
),
|
|
7152
7115
|
/* @__PURE__ */ r(
|
|
@@ -7162,7 +7125,7 @@ const ut = {
|
|
|
7162
7125
|
) }),
|
|
7163
7126
|
D && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: l.fields.map((g, C) => {
|
|
7164
7127
|
const S = g.colSpan === 1 ? "col-span-1" : g.colSpan === 2 ? "col-span-2" : g.colSpan === 3 ? "col-span-3" : "col-span-4", pe = g.isCustom ? `custom-${C}-${g.paramName}` : `builtin-${g.name}-${C}`;
|
|
7165
|
-
return /* @__PURE__ */ r("div", { className: S, children: /* @__PURE__ */ r(
|
|
7128
|
+
return /* @__PURE__ */ r("div", { className: S, children: /* @__PURE__ */ r(Lt, { helpText: g.helpText, children: g.isCustom ? h(g, C) : Ye(g.name, pe, g.displayText, g.countriesType, g.labelMode) }) }, pe);
|
|
7166
7129
|
}) })
|
|
7167
7130
|
] });
|
|
7168
7131
|
};
|
|
@@ -7172,9 +7135,9 @@ const ut = {
|
|
|
7172
7135
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7173
7136
|
] }) }) });
|
|
7174
7137
|
if (N) {
|
|
7175
|
-
const l = N[F] ?? N[0], f = _e === -1, D = Re === -1, g = N.length, C =
|
|
7138
|
+
const l = N[F] ?? N[0], f = _e === -1, D = Re === -1, g = N.length, C = $e(l), S = Object.values(B);
|
|
7176
7139
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(re, { children: [
|
|
7177
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(
|
|
7140
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7178
7141
|
/* @__PURE__ */ s(ne, { children: [
|
|
7179
7142
|
(l.title || l.subtitle || l.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
7180
7143
|
l.title && /* @__PURE__ */ r(
|
|
@@ -7248,107 +7211,107 @@ const ut = {
|
|
|
7248
7211
|
{
|
|
7249
7212
|
type: "button",
|
|
7250
7213
|
isLoading: te || y,
|
|
7251
|
-
onClick: D ? je :
|
|
7214
|
+
onClick: D ? je : Ze,
|
|
7252
7215
|
children: D ? l.conditionalOn && !C ? "Skip & Submit" : "Submit" : l.conditionalOn && !C ? "Skip" : "Next"
|
|
7253
7216
|
}
|
|
7254
7217
|
)
|
|
7255
7218
|
] })
|
|
7256
7219
|
] }) });
|
|
7257
7220
|
}
|
|
7258
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit:
|
|
7259
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(
|
|
7221
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: it, children: /* @__PURE__ */ s(re, { children: [
|
|
7222
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7260
7223
|
/* @__PURE__ */ s(ne, { children: [
|
|
7261
7224
|
fe && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
7262
7225
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7263
7226
|
" ",
|
|
7264
7227
|
fe
|
|
7265
7228
|
] }) }),
|
|
7266
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: Q.map((l) => /* @__PURE__ */ r("div", { className: "col-span-4", children:
|
|
7229
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: Q.map((l) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ye(l) }, l)) })
|
|
7267
7230
|
] }),
|
|
7268
7231
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
7269
7232
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || y, children: "Cancel" }),
|
|
7270
7233
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: te || y, children: "Create Applicant" })
|
|
7271
7234
|
] })
|
|
7272
7235
|
] }) }) });
|
|
7273
|
-
},
|
|
7274
|
-
function
|
|
7236
|
+
}, Dt = ["companyName", "email"];
|
|
7237
|
+
function kt(e) {
|
|
7275
7238
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
7276
7239
|
}
|
|
7277
|
-
const
|
|
7240
|
+
const Xn = ({
|
|
7278
7241
|
workflowKey: e,
|
|
7279
7242
|
externalRefId: t,
|
|
7280
7243
|
onSuccess: n,
|
|
7281
7244
|
onCancel: a
|
|
7282
7245
|
}) => {
|
|
7283
|
-
var
|
|
7284
|
-
const { config: i, baseInformationService: o, currentTheme: c } =
|
|
7246
|
+
var Ye, h, O, q, W, X;
|
|
7247
|
+
const { config: i, baseInformationService: o, currentTheme: c } = Pe(), { createCompanyApplicant: d, isLoading: y } = zt(), p = e || ((Ye = i.applicantForm) == null ? void 0 : Ye.workflowKey);
|
|
7285
7248
|
if (!p)
|
|
7286
7249
|
throw new Error(
|
|
7287
7250
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
7288
7251
|
);
|
|
7289
|
-
const x = t || ((h = i.applicantForm) == null ? void 0 : h.externalRefId) || "",
|
|
7252
|
+
const x = t || ((h = i.applicantForm) == null ? void 0 : h.externalRefId) || "", T = ((O = i.applicantForm) == null ? void 0 : O.email) || "", v = ((q = i.applicantForm) == null ? void 0 : q.initialValues) || {}, P = (((W = i.applicantForm) == null ? void 0 : W.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", w = De(
|
|
7290
7253
|
() => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
|
|
7291
7254
|
[c == null ? void 0 : c.companyFormPages]
|
|
7292
7255
|
), N = De(() => {
|
|
7293
|
-
const m = new Set(
|
|
7256
|
+
const m = new Set(Dt), R = c == null ? void 0 : c.companyFormRequiredFields;
|
|
7294
7257
|
if (R) for (const L of R) m.add(L);
|
|
7295
7258
|
if (w)
|
|
7296
7259
|
for (const L of w)
|
|
7297
|
-
for (const
|
|
7298
|
-
!
|
|
7260
|
+
for (const u of L.fields)
|
|
7261
|
+
!u.isCustom && u.name && u.required && m.add(u.name);
|
|
7299
7262
|
return Array.from(m);
|
|
7300
7263
|
}, [c == null ? void 0 : c.companyFormRequiredFields, w]), z = De(() => {
|
|
7301
7264
|
var m;
|
|
7302
7265
|
if (w) {
|
|
7303
|
-
const R = w.flatMap((
|
|
7304
|
-
for (const
|
|
7266
|
+
const R = w.flatMap((u) => u.fields).filter((u) => !u.isCustom && u.name).map((u) => u.name), L = new Set(R);
|
|
7267
|
+
for (const u of Dt) L.add(u);
|
|
7305
7268
|
return Array.from(L);
|
|
7306
7269
|
}
|
|
7307
|
-
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields :
|
|
7270
|
+
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : lr;
|
|
7308
7271
|
}, [(X = i.applicantForm) == null ? void 0 : X.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, w]), Q = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = De(() => {
|
|
7309
7272
|
var R, L;
|
|
7310
7273
|
const m = /* @__PURE__ */ new Set();
|
|
7311
7274
|
if (w)
|
|
7312
|
-
for (const
|
|
7313
|
-
for (const l of
|
|
7314
|
-
!l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((R =
|
|
7275
|
+
for (const u of w)
|
|
7276
|
+
for (const l of u.fields)
|
|
7277
|
+
!l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((R = st[l.name]) == null ? void 0 : R.countriesType));
|
|
7315
7278
|
else
|
|
7316
|
-
for (const
|
|
7317
|
-
Q.has(
|
|
7279
|
+
for (const u of z)
|
|
7280
|
+
Q.has(u) && m.add((L = st[u]) == null ? void 0 : L.countriesType);
|
|
7318
7281
|
return m.size === 0 && m.add(void 0), Array.from(m);
|
|
7319
|
-
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0), b = de(/* @__PURE__ */ new Set()),
|
|
7282
|
+
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0), b = de(/* @__PURE__ */ new Set()), $ = de(/* @__PURE__ */ new Set());
|
|
7320
7283
|
ge(() => {
|
|
7321
7284
|
if (!c) return;
|
|
7322
|
-
const m = M.filter((
|
|
7323
|
-
const l =
|
|
7324
|
-
return
|
|
7285
|
+
const m = M.filter((u) => {
|
|
7286
|
+
const l = u != null ? String(u) : "all";
|
|
7287
|
+
return !$.current.has(l) && !b.current.has(l);
|
|
7325
7288
|
});
|
|
7326
7289
|
if (m.length === 0) {
|
|
7327
|
-
M.every((l) =>
|
|
7290
|
+
M.every((l) => $.current.has(l != null ? String(l) : "all")) && E(!1);
|
|
7328
7291
|
return;
|
|
7329
7292
|
}
|
|
7330
7293
|
E(!0);
|
|
7331
|
-
const R = m.map((
|
|
7332
|
-
R.forEach((
|
|
7294
|
+
const R = m.map((u) => u != null ? String(u) : "all");
|
|
7295
|
+
R.forEach((u) => b.current.add(u)), (async () => {
|
|
7333
7296
|
try {
|
|
7334
|
-
const
|
|
7297
|
+
const u = await Promise.all(
|
|
7335
7298
|
m.map(async (l) => {
|
|
7336
7299
|
const f = l != null ? String(l) : "all", D = await o.getCountries("", i.locale || "en", l), g = /* @__PURE__ */ new Set(), C = D.map((S) => ({ value: S.abbreviation3 || S.abbreviation, label: S.name })).filter((S) => !S.value || g.has(S.value) ? !1 : (g.add(S.value), !0));
|
|
7337
|
-
return
|
|
7300
|
+
return $.current.add(f), b.current.delete(f), [f, C];
|
|
7338
7301
|
})
|
|
7339
7302
|
);
|
|
7340
|
-
K((l) => ({ ...l, ...Object.fromEntries(
|
|
7341
|
-
} catch (
|
|
7342
|
-
R.forEach((l) => b.current.delete(l)), console.error("Failed to load countries:",
|
|
7303
|
+
K((l) => ({ ...l, ...Object.fromEntries(u) }));
|
|
7304
|
+
} catch (u) {
|
|
7305
|
+
R.forEach((l) => b.current.delete(l)), console.error("Failed to load countries:", u);
|
|
7343
7306
|
} finally {
|
|
7344
|
-
M.every((l) =>
|
|
7307
|
+
M.every((l) => $.current.has(l != null ? String(l) : "all")) && E(!1);
|
|
7345
7308
|
}
|
|
7346
7309
|
})();
|
|
7347
7310
|
}, [M, c]);
|
|
7348
7311
|
const V = (m, R) => {
|
|
7349
7312
|
var l;
|
|
7350
|
-
const L = R ?? ((l =
|
|
7351
|
-
return j[
|
|
7313
|
+
const L = R ?? ((l = st[m]) == null ? void 0 : l.countriesType), u = L != null ? String(L) : "all";
|
|
7314
|
+
return j[u] || [];
|
|
7352
7315
|
}, G = {
|
|
7353
7316
|
companyName: 1,
|
|
7354
7317
|
registrationNumber: 1,
|
|
@@ -7374,7 +7337,7 @@ const Zn = ({
|
|
|
7374
7337
|
), [J, se] = k({
|
|
7375
7338
|
workflowKey: p,
|
|
7376
7339
|
companyName: "",
|
|
7377
|
-
email:
|
|
7340
|
+
email: T,
|
|
7378
7341
|
phone: "",
|
|
7379
7342
|
registrationNumber: "",
|
|
7380
7343
|
countryResidence: "",
|
|
@@ -7394,20 +7357,20 @@ const Zn = ({
|
|
|
7394
7357
|
lei: "",
|
|
7395
7358
|
externalRefId: x,
|
|
7396
7359
|
..._
|
|
7397
|
-
}), [Y, ve] = k({}), [ue, me] = k(0), [ke, F] = k({}), [U,
|
|
7360
|
+
}), [Y, ve] = k({}), [ue, me] = k(0), [ke, F] = k({}), [U, B] = k(null), [H, fe] = k(!1), I = (m, R) => se((L) => ({ ...L, [m]: R })), te = (m, R) => ve((L) => ({ ...L, [m]: R })), ye = (m) => !m.conditionalOn || Y[m.conditionalOn] === "true", oe = w && ue < w.length - 1 ? ue + 1 : -1, Ne = w && ue > 0 ? ue - 1 : -1, $e = (m) => {
|
|
7398
7361
|
var L;
|
|
7399
7362
|
const R = {};
|
|
7400
|
-
for (const
|
|
7401
|
-
if (
|
|
7402
|
-
if (
|
|
7403
|
-
if (
|
|
7404
|
-
const l = Y[
|
|
7405
|
-
|
|
7363
|
+
for (const u of m.fields)
|
|
7364
|
+
if (u.isCustom) {
|
|
7365
|
+
if (u.customType === "paragraph" || u.customType === "html" || u.customType === "br" || u.customType === "link") continue;
|
|
7366
|
+
if (u.required && u.paramName) {
|
|
7367
|
+
const l = Y[u.paramName], f = u.displayText || u.label || u.paramName;
|
|
7368
|
+
u.customType === "checkbox" || u.customType === "link_checkbox" ? l !== "true" && (R[u.paramName] = `${f} is required.`) : (!l || l.trim() === "") && (R[u.paramName] = `${f} is required.`);
|
|
7406
7369
|
}
|
|
7407
|
-
} else if (
|
|
7408
|
-
const l =
|
|
7409
|
-
if (N.includes(l) &&
|
|
7410
|
-
const f =
|
|
7370
|
+
} else if (u.name) {
|
|
7371
|
+
const l = u.name;
|
|
7372
|
+
if (N.includes(l) && kt(J[l])) {
|
|
7373
|
+
const f = u.displayText || ((L = st[l]) == null ? void 0 : L.label) || l;
|
|
7411
7374
|
R[l] = `${f} is required.`;
|
|
7412
7375
|
}
|
|
7413
7376
|
}
|
|
@@ -7419,7 +7382,7 @@ const Zn = ({
|
|
|
7419
7382
|
F({}), oe >= 0 ? me(oe) : await _e();
|
|
7420
7383
|
return;
|
|
7421
7384
|
}
|
|
7422
|
-
const R =
|
|
7385
|
+
const R = $e(m);
|
|
7423
7386
|
if (Object.keys(R).length > 0) {
|
|
7424
7387
|
F(R);
|
|
7425
7388
|
return;
|
|
@@ -7430,13 +7393,13 @@ const Zn = ({
|
|
|
7430
7393
|
if (w) {
|
|
7431
7394
|
let R = {};
|
|
7432
7395
|
for (const L of w)
|
|
7433
|
-
ye(L) && (R = { ...R,
|
|
7396
|
+
ye(L) && (R = { ...R, ...$e(L) });
|
|
7434
7397
|
if (Object.keys(R).length > 0) {
|
|
7435
7398
|
F(R);
|
|
7436
7399
|
return;
|
|
7437
7400
|
}
|
|
7438
7401
|
}
|
|
7439
|
-
fe(!0),
|
|
7402
|
+
fe(!0), B(null);
|
|
7440
7403
|
try {
|
|
7441
7404
|
const R = {
|
|
7442
7405
|
workflowKey: J.workflowKey,
|
|
@@ -7444,7 +7407,7 @@ const Zn = ({
|
|
|
7444
7407
|
}, L = w ? w.filter((f) => ye(f)).flatMap((f) => f.fields).filter((f) => !f.isCustom && f.name).map((f) => f.name) : z;
|
|
7445
7408
|
for (const f of L) {
|
|
7446
7409
|
const D = J[f];
|
|
7447
|
-
if (!
|
|
7410
|
+
if (!kt(D))
|
|
7448
7411
|
switch (f) {
|
|
7449
7412
|
case "companyName":
|
|
7450
7413
|
R.companyName = D;
|
|
@@ -7475,7 +7438,7 @@ const Zn = ({
|
|
|
7475
7438
|
break;
|
|
7476
7439
|
}
|
|
7477
7440
|
}
|
|
7478
|
-
const
|
|
7441
|
+
const u = [];
|
|
7479
7442
|
if (w) {
|
|
7480
7443
|
for (const f of w)
|
|
7481
7444
|
if (ye(f))
|
|
@@ -7486,43 +7449,43 @@ const Zn = ({
|
|
|
7486
7449
|
if (D.customType === "checkbox" || D.customType === "link_checkbox")
|
|
7487
7450
|
C = g === "true" ? "yes" : "no";
|
|
7488
7451
|
else if (C = g, !C && !D.required) continue;
|
|
7489
|
-
|
|
7452
|
+
u.push({ paramName: D.paramName, value: C });
|
|
7490
7453
|
}
|
|
7491
7454
|
}
|
|
7492
|
-
|
|
7493
|
-
const l = await
|
|
7455
|
+
u.length > 0 && (R.applicantAdditionalDatas = u);
|
|
7456
|
+
const l = await d(R);
|
|
7494
7457
|
n(l.applicantId);
|
|
7495
7458
|
} catch (R) {
|
|
7496
|
-
console.error("Error creating company applicant:", R),
|
|
7459
|
+
console.error("Error creating company applicant:", R), B(R.message || "Failed to create company applicant");
|
|
7497
7460
|
} finally {
|
|
7498
7461
|
fe(!1);
|
|
7499
7462
|
}
|
|
7500
|
-
},
|
|
7463
|
+
}, at = async (m) => {
|
|
7501
7464
|
var R;
|
|
7502
7465
|
m.preventDefault();
|
|
7503
7466
|
for (const L of N)
|
|
7504
|
-
if (
|
|
7505
|
-
const
|
|
7506
|
-
|
|
7467
|
+
if (kt(J[L])) {
|
|
7468
|
+
const u = ((R = st[L]) == null ? void 0 : R.label) || L;
|
|
7469
|
+
B(`${u} is required.`);
|
|
7507
7470
|
return;
|
|
7508
7471
|
}
|
|
7509
7472
|
await _e();
|
|
7510
|
-
},
|
|
7511
|
-
const f =
|
|
7473
|
+
}, Ze = (m, R, L, u, l) => {
|
|
7474
|
+
const f = st[m];
|
|
7512
7475
|
if (!f) return null;
|
|
7513
|
-
const D = N.includes(m), g = ke[m], C = L || f.label, S = m in _, pe = R ?? m, ie = l ? l !== "placeholder" :
|
|
7476
|
+
const D = N.includes(m), g = ke[m], C = L || f.label, S = m in _, pe = R ?? m, ie = l ? l !== "placeholder" : P, be = ie ? C : void 0, Te = ie ? "..." : C;
|
|
7514
7477
|
switch (f.type) {
|
|
7515
7478
|
case "select":
|
|
7516
7479
|
if (m === "countryResidence" || m === "addressCountry") {
|
|
7517
|
-
const le = V(m,
|
|
7480
|
+
const le = V(m, u);
|
|
7518
7481
|
return /* @__PURE__ */ r(
|
|
7519
|
-
|
|
7482
|
+
qe,
|
|
7520
7483
|
{
|
|
7521
7484
|
required: D,
|
|
7522
7485
|
label: be,
|
|
7523
7486
|
value: J[m] || "",
|
|
7524
|
-
onChange: (
|
|
7525
|
-
options: [{ value: "", label: `Select ${
|
|
7487
|
+
onChange: (Be) => I(m, Be),
|
|
7488
|
+
options: [{ value: "", label: `Select ${Te.toLowerCase()}` }, ...le],
|
|
7526
7489
|
disabled: ee,
|
|
7527
7490
|
readOnly: S,
|
|
7528
7491
|
error: g
|
|
@@ -7618,7 +7581,7 @@ const Zn = ({
|
|
|
7618
7581
|
}
|
|
7619
7582
|
) }, `custom-${R}`);
|
|
7620
7583
|
if (!m.paramName) return null;
|
|
7621
|
-
const L = ke[m.paramName],
|
|
7584
|
+
const L = ke[m.paramName], u = m.displayText || m.label || m.paramName, l = m.labelMode ? m.labelMode !== "placeholder" : P;
|
|
7622
7585
|
return m.customType === "checkbox" ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
7623
7586
|
/* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7624
7587
|
/* @__PURE__ */ r(
|
|
@@ -7631,7 +7594,7 @@ const Zn = ({
|
|
|
7631
7594
|
}
|
|
7632
7595
|
),
|
|
7633
7596
|
/* @__PURE__ */ s("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
7634
|
-
|
|
7597
|
+
u,
|
|
7635
7598
|
m.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
7636
7599
|
] })
|
|
7637
7600
|
] }),
|
|
@@ -7640,8 +7603,8 @@ const Zn = ({
|
|
|
7640
7603
|
xe,
|
|
7641
7604
|
{
|
|
7642
7605
|
type: "text",
|
|
7643
|
-
label: l ? `${
|
|
7644
|
-
placeholder: l ? void 0 :
|
|
7606
|
+
label: l ? `${u}${m.required ? " *" : ""}` : void 0,
|
|
7607
|
+
placeholder: l ? void 0 : u,
|
|
7645
7608
|
value: Y[m.paramName] || "",
|
|
7646
7609
|
onChange: (f) => te(m.paramName, f.target.value),
|
|
7647
7610
|
required: m.required,
|
|
@@ -7649,7 +7612,7 @@ const Zn = ({
|
|
|
7649
7612
|
},
|
|
7650
7613
|
`custom-${R}`
|
|
7651
7614
|
);
|
|
7652
|
-
},
|
|
7615
|
+
}, it = (m) => {
|
|
7653
7616
|
const R = ye(m);
|
|
7654
7617
|
return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
7655
7618
|
m.conditionalOn && /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
@@ -7664,9 +7627,9 @@ const Zn = ({
|
|
|
7664
7627
|
),
|
|
7665
7628
|
/* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: m.conditionalOn })
|
|
7666
7629
|
] }),
|
|
7667
|
-
R && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: m.fields.map((L,
|
|
7668
|
-
const l = L.colSpan === 1 ? "col-span-1" : L.colSpan === 2 ? "col-span-2" : L.colSpan === 3 ? "col-span-3" : "col-span-4", f = L.isCustom ? `custom-${
|
|
7669
|
-
return /* @__PURE__ */ r("div", { className: l, children: L.isCustom ? je(L,
|
|
7630
|
+
R && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: m.fields.map((L, u) => {
|
|
7631
|
+
const l = L.colSpan === 1 ? "col-span-1" : L.colSpan === 2 ? "col-span-2" : L.colSpan === 3 ? "col-span-3" : "col-span-4", f = L.isCustom ? `custom-${u}-${L.paramName}` : `builtin-${L.name}-${u}`;
|
|
7632
|
+
return /* @__PURE__ */ r("div", { className: l, children: L.isCustom ? je(L, u) : Ze(L.name, f, L.displayText, L.countriesType, L.labelMode) }, f);
|
|
7670
7633
|
}) })
|
|
7671
7634
|
] });
|
|
7672
7635
|
};
|
|
@@ -7676,9 +7639,9 @@ const Zn = ({
|
|
|
7676
7639
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7677
7640
|
] }) }) });
|
|
7678
7641
|
if (w) {
|
|
7679
|
-
const m = w[ue] ?? w[0], R = Ne === -1, L = oe === -1,
|
|
7642
|
+
const m = w[ue] ?? w[0], R = Ne === -1, L = oe === -1, u = w.length, l = ye(m), f = Object.values(ke);
|
|
7680
7643
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(re, { children: [
|
|
7681
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(
|
|
7644
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7682
7645
|
/* @__PURE__ */ s(ne, { children: [
|
|
7683
7646
|
(m.title || m.subtitle) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
|
|
7684
7647
|
m.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: m.title }),
|
|
@@ -7692,7 +7655,7 @@ const Zn = ({
|
|
|
7692
7655
|
] }),
|
|
7693
7656
|
f.map((D, g) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: D }, g))
|
|
7694
7657
|
] }),
|
|
7695
|
-
|
|
7658
|
+
u > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
7696
7659
|
w.map((D, g) => /* @__PURE__ */ r(
|
|
7697
7660
|
"div",
|
|
7698
7661
|
{
|
|
@@ -7704,10 +7667,10 @@ const Zn = ({
|
|
|
7704
7667
|
/* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
7705
7668
|
ue + 1,
|
|
7706
7669
|
" / ",
|
|
7707
|
-
|
|
7670
|
+
u
|
|
7708
7671
|
] })
|
|
7709
7672
|
] }),
|
|
7710
|
-
|
|
7673
|
+
it(m)
|
|
7711
7674
|
] }),
|
|
7712
7675
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
7713
7676
|
/* @__PURE__ */ s("div", { children: [
|
|
@@ -7729,22 +7692,22 @@ const Zn = ({
|
|
|
7729
7692
|
] })
|
|
7730
7693
|
] }) });
|
|
7731
7694
|
}
|
|
7732
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit:
|
|
7733
|
-
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(
|
|
7695
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: at, children: /* @__PURE__ */ s(re, { children: [
|
|
7696
|
+
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7734
7697
|
/* @__PURE__ */ s(ne, { children: [
|
|
7735
7698
|
U && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
7736
7699
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7737
7700
|
" ",
|
|
7738
7701
|
U
|
|
7739
7702
|
] }) }),
|
|
7740
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: z.map((m) => /* @__PURE__ */ r("div", { className: "col-span-4", children:
|
|
7703
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: z.map((m) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(m) }, m)) })
|
|
7741
7704
|
] }),
|
|
7742
7705
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
7743
7706
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" }),
|
|
7744
7707
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: H || y, children: "Register Company" })
|
|
7745
7708
|
] })
|
|
7746
7709
|
] }) }) });
|
|
7747
|
-
},
|
|
7710
|
+
}, ea = ({
|
|
7748
7711
|
applicantId: e,
|
|
7749
7712
|
onComplete: t,
|
|
7750
7713
|
onError: n,
|
|
@@ -7754,15 +7717,15 @@ const Zn = ({
|
|
|
7754
7717
|
const {
|
|
7755
7718
|
progress: o,
|
|
7756
7719
|
currentStep: c,
|
|
7757
|
-
steps:
|
|
7720
|
+
steps: d,
|
|
7758
7721
|
workflowKey: y,
|
|
7759
7722
|
nextWorkflowKey: p,
|
|
7760
7723
|
hasWorkflowChanged: x,
|
|
7761
|
-
isLoading:
|
|
7724
|
+
isLoading: T,
|
|
7762
7725
|
error: v,
|
|
7763
7726
|
moveBack: A,
|
|
7764
|
-
refreshProgress:
|
|
7765
|
-
} =
|
|
7727
|
+
refreshProgress: P
|
|
7728
|
+
} = qr(e), [w, N] = we.useState(!1), z = we.useRef(null);
|
|
7766
7729
|
if (we.useEffect(() => {
|
|
7767
7730
|
v && n && n(v);
|
|
7768
7731
|
}, [v, n]), we.useEffect(() => {
|
|
@@ -7771,7 +7734,7 @@ const Zn = ({
|
|
|
7771
7734
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
7772
7735
|
}, [a]), we.useEffect(() => {
|
|
7773
7736
|
x && N(!1);
|
|
7774
|
-
}, [x]),
|
|
7737
|
+
}, [x]), T || !o)
|
|
7775
7738
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
|
|
7776
7739
|
/* @__PURE__ */ r(Me, { className: "my-8" }),
|
|
7777
7740
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
|
|
@@ -7853,11 +7816,11 @@ const Zn = ({
|
|
|
7853
7816
|
return "";
|
|
7854
7817
|
}
|
|
7855
7818
|
}, M = () => {
|
|
7856
|
-
const K =
|
|
7819
|
+
const K = d.filter((V) => V.visibility !== !1), ee = K.findIndex((V) => V.order === c.order), E = ee >= 0 ? ee + 1 : 1, b = K.length, $ = b > 1 ? ee / (b - 1) * 100 : 100;
|
|
7857
7820
|
return /* @__PURE__ */ s("div", { style: { marginBottom: "24px" }, children: [
|
|
7858
7821
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
7859
|
-
/* @__PURE__ */ r(
|
|
7860
|
-
/* @__PURE__ */ s(
|
|
7822
|
+
/* @__PURE__ */ r(mt, {}),
|
|
7823
|
+
/* @__PURE__ */ s($t, { variant: o.status === 1 ? "info" : "success", children: [
|
|
7861
7824
|
"Step ",
|
|
7862
7825
|
E,
|
|
7863
7826
|
" of ",
|
|
@@ -7873,11 +7836,11 @@ const Zn = ({
|
|
|
7873
7836
|
height: "100%",
|
|
7874
7837
|
borderRadius: "999px",
|
|
7875
7838
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
7876
|
-
width: `${
|
|
7839
|
+
width: `${$}%`,
|
|
7877
7840
|
transition: "width 0.4s ease"
|
|
7878
7841
|
} }) }) }),
|
|
7879
7842
|
/* @__PURE__ */ r(
|
|
7880
|
-
|
|
7843
|
+
Ln,
|
|
7881
7844
|
{
|
|
7882
7845
|
ref: z,
|
|
7883
7846
|
visibleSteps: K,
|
|
@@ -7890,26 +7853,26 @@ const Zn = ({
|
|
|
7890
7853
|
const K = {
|
|
7891
7854
|
applicantId: e,
|
|
7892
7855
|
onComplete: async () => {
|
|
7893
|
-
await
|
|
7856
|
+
await P();
|
|
7894
7857
|
},
|
|
7895
7858
|
onBack: c.order > 0 ? A : void 0
|
|
7896
7859
|
};
|
|
7897
7860
|
switch (c.action) {
|
|
7898
7861
|
case ce.Questionaries:
|
|
7899
|
-
return /* @__PURE__ */ r(
|
|
7862
|
+
return /* @__PURE__ */ r(yn, { ...K });
|
|
7900
7863
|
case ce.UploadDocument:
|
|
7901
|
-
return /* @__PURE__ */ r(fn, { ...K });
|
|
7902
|
-
case ce.Overview:
|
|
7903
7864
|
return /* @__PURE__ */ r(gn, { ...K });
|
|
7865
|
+
case ce.Overview:
|
|
7866
|
+
return /* @__PURE__ */ r(bn, { ...K });
|
|
7904
7867
|
case ce.IdentitySdk:
|
|
7905
|
-
return /* @__PURE__ */ r(
|
|
7868
|
+
return /* @__PURE__ */ r(Pn, { ...K });
|
|
7906
7869
|
case ce.RiskScoring:
|
|
7907
|
-
return /* @__PURE__ */ r(
|
|
7870
|
+
return /* @__PURE__ */ r(Nn, { ...K });
|
|
7908
7871
|
case ce.AdditionalData:
|
|
7909
7872
|
case ce.InvestorCategorization:
|
|
7910
|
-
return /* @__PURE__ */ r(Rn, { ...K });
|
|
7911
|
-
case ce.AppropriatenessTest:
|
|
7912
7873
|
return /* @__PURE__ */ r(In, { ...K });
|
|
7874
|
+
case ce.AppropriatenessTest:
|
|
7875
|
+
return /* @__PURE__ */ r(En, { ...K });
|
|
7913
7876
|
case ce.ManualReview:
|
|
7914
7877
|
return /* @__PURE__ */ r(
|
|
7915
7878
|
Tt,
|
|
@@ -7938,12 +7901,12 @@ const Zn = ({
|
|
|
7938
7901
|
M(),
|
|
7939
7902
|
j()
|
|
7940
7903
|
] });
|
|
7941
|
-
},
|
|
7904
|
+
}, Ln = we.forwardRef(
|
|
7942
7905
|
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: n }, a) => {
|
|
7943
7906
|
const i = we.useRef(null), o = we.useRef(null);
|
|
7944
7907
|
return we.useImperativeHandle(a, () => i.current), we.useEffect(() => {
|
|
7945
7908
|
if (o.current && i.current) {
|
|
7946
|
-
const c = i.current,
|
|
7909
|
+
const c = i.current, d = o.current, y = d.offsetLeft - c.offsetWidth / 2 + d.offsetWidth / 2;
|
|
7947
7910
|
c.scrollTo({ left: Math.max(0, y), behavior: "smooth" });
|
|
7948
7911
|
}
|
|
7949
7912
|
}, [t]), /* @__PURE__ */ r(
|
|
@@ -7962,8 +7925,8 @@ const Zn = ({
|
|
|
7962
7925
|
padding: "4px 0",
|
|
7963
7926
|
gap: "0"
|
|
7964
7927
|
},
|
|
7965
|
-
children: e.map((c,
|
|
7966
|
-
const y =
|
|
7928
|
+
children: e.map((c, d) => {
|
|
7929
|
+
const y = d < t, p = d === t, x = y || p, T = c.displayName || c.name || n(c.action) || `Step ${d + 1}`;
|
|
7967
7930
|
return /* @__PURE__ */ s(we.Fragment, { children: [
|
|
7968
7931
|
/* @__PURE__ */ s(
|
|
7969
7932
|
"div",
|
|
@@ -7995,7 +7958,7 @@ const Zn = ({
|
|
|
7995
7958
|
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
7996
7959
|
border: "2px solid var(--metakyc-border, #e5e7eb)"
|
|
7997
7960
|
}
|
|
7998
|
-
}, children: y ? /* @__PURE__ */ r("svg", { width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) :
|
|
7961
|
+
}, children: y ? /* @__PURE__ */ r("svg", { width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : d + 1 }),
|
|
7999
7962
|
/* @__PURE__ */ r("span", { style: {
|
|
8000
7963
|
marginLeft: "6px",
|
|
8001
7964
|
fontSize: "13px",
|
|
@@ -8003,11 +7966,11 @@ const Zn = ({
|
|
|
8003
7966
|
fontWeight: p ? 600 : 400,
|
|
8004
7967
|
color: p ? "var(--metakyc-text-primary, #111827)" : y ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
8005
7968
|
transition: "color 0.2s ease"
|
|
8006
|
-
}, children:
|
|
7969
|
+
}, children: T })
|
|
8007
7970
|
]
|
|
8008
7971
|
}
|
|
8009
7972
|
),
|
|
8010
|
-
|
|
7973
|
+
d < e.length - 1 && /* @__PURE__ */ r("div", { style: {
|
|
8011
7974
|
width: "32px",
|
|
8012
7975
|
minWidth: "16px",
|
|
8013
7976
|
height: "2px",
|
|
@@ -8023,13 +7986,13 @@ const Zn = ({
|
|
|
8023
7986
|
);
|
|
8024
7987
|
}
|
|
8025
7988
|
);
|
|
8026
|
-
function
|
|
8027
|
-
return
|
|
8028
|
-
questionResults:
|
|
7989
|
+
function ta(e) {
|
|
7990
|
+
return Ve.object({
|
|
7991
|
+
questionResults: Ve.any()
|
|
8029
7992
|
}).passthrough();
|
|
8030
7993
|
}
|
|
8031
|
-
function
|
|
8032
|
-
let t =
|
|
7994
|
+
function Dn(e) {
|
|
7995
|
+
let t = Ve.array(Ve.instanceof(File));
|
|
8033
7996
|
if (e.isRequired ? t = t.min(
|
|
8034
7997
|
1,
|
|
8035
7998
|
`${e.displayName} is required`
|
|
@@ -8050,144 +8013,144 @@ function Ln(e) {
|
|
|
8050
8013
|
}
|
|
8051
8014
|
return t;
|
|
8052
8015
|
}
|
|
8053
|
-
function
|
|
8016
|
+
function ra(e) {
|
|
8054
8017
|
const t = {};
|
|
8055
8018
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
8056
8019
|
const a = `file_${n.id}`;
|
|
8057
|
-
t[a] =
|
|
8058
|
-
}),
|
|
8020
|
+
t[a] = Dn(n);
|
|
8021
|
+
}), Ve.object(t);
|
|
8059
8022
|
}
|
|
8060
|
-
function
|
|
8061
|
-
return
|
|
8023
|
+
function na(e) {
|
|
8024
|
+
return Ve.any();
|
|
8062
8025
|
}
|
|
8063
|
-
function
|
|
8064
|
-
return
|
|
8026
|
+
function Mn(e) {
|
|
8027
|
+
return Ve.string().min(1, "This question is required");
|
|
8065
8028
|
}
|
|
8066
|
-
function
|
|
8029
|
+
function aa(e) {
|
|
8067
8030
|
const t = {};
|
|
8068
8031
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
8069
8032
|
const a = `question_${n.id}`;
|
|
8070
|
-
t[a] =
|
|
8071
|
-
}),
|
|
8033
|
+
t[a] = Mn();
|
|
8034
|
+
}), Ve.object(t);
|
|
8072
8035
|
}
|
|
8073
|
-
const
|
|
8036
|
+
const ia = Ve.any();
|
|
8074
8037
|
export {
|
|
8075
|
-
|
|
8076
|
-
|
|
8038
|
+
It as ALLOWED_LANGUAGES,
|
|
8039
|
+
Jt as ApplicantProgressOnHoldReason,
|
|
8077
8040
|
ze as ApplicantProgressStatus,
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8041
|
+
mr as ApplicantService,
|
|
8042
|
+
Xt as ApplicantStatus,
|
|
8043
|
+
ar as AppropriatenessQuestionType,
|
|
8044
|
+
fr as AppropriatenessTestService,
|
|
8045
|
+
En as AppropriatenessTestStep,
|
|
8046
|
+
$t as Badge,
|
|
8047
|
+
vr as BaseInformationService,
|
|
8085
8048
|
Z as Button,
|
|
8086
|
-
|
|
8049
|
+
st as COMPANY_FIELD_METADATA,
|
|
8087
8050
|
re as Card,
|
|
8088
8051
|
ne as CardContent,
|
|
8089
8052
|
Ce as CardFooter,
|
|
8090
8053
|
Se as CardHeader,
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8054
|
+
Je as CountriesType,
|
|
8055
|
+
Zn as CreateApplicantForm,
|
|
8056
|
+
Xn as CreateCompanyApplicantForm,
|
|
8057
|
+
sr as CriteriaBuiltInType,
|
|
8058
|
+
lr as DEFAULT_COMPANY_VISIBLE_FIELDS,
|
|
8059
|
+
cr as DEFAULT_VISIBLE_FIELDS,
|
|
8060
|
+
nr as DocumentReviewStatus,
|
|
8061
|
+
ur as EndpointBuilder,
|
|
8062
|
+
dt as ErrorHandler,
|
|
8063
|
+
Fr as EventEmitter,
|
|
8064
|
+
nt as FIELD_METADATA,
|
|
8065
|
+
rr as FileType,
|
|
8066
|
+
rn as FileUpload,
|
|
8067
|
+
bt as GenderType,
|
|
8068
|
+
mt as Header,
|
|
8069
|
+
pr as HttpClient,
|
|
8070
|
+
Ge as IdentityProviderManager,
|
|
8071
|
+
xr as IdentityService,
|
|
8109
8072
|
Oe as IdentityVerificationProvider,
|
|
8110
|
-
|
|
8073
|
+
Pn as IdentityVerificationStep,
|
|
8111
8074
|
xe as Input,
|
|
8112
|
-
|
|
8113
|
-
|
|
8075
|
+
kr as InvestorCategorizationService,
|
|
8076
|
+
In as InvestorCategorizationStep,
|
|
8114
8077
|
Ee as InvestorCategorizationType,
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8078
|
+
or as InvestorCategoryType,
|
|
8079
|
+
er as KycProcessStatus,
|
|
8080
|
+
tt as KycStatus,
|
|
8118
8081
|
Tt as KycStatusDisplay,
|
|
8119
|
-
|
|
8082
|
+
ea as KycWorkflow,
|
|
8120
8083
|
Tn as Logo,
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8084
|
+
Ot as MetaKYCContext,
|
|
8085
|
+
Ue as MetaKYCError,
|
|
8086
|
+
Kn as MetaKYCProvider,
|
|
8087
|
+
en as MultiSelect,
|
|
8088
|
+
Or as OnfidoProvider,
|
|
8089
|
+
gr as OverviewService,
|
|
8090
|
+
bn as OverviewStep,
|
|
8091
|
+
nn as PhoneInput,
|
|
8092
|
+
yr as QuestionnaireService,
|
|
8093
|
+
yn as QuestionnaireStep,
|
|
8094
|
+
rt as ReviewStatus,
|
|
8095
|
+
ir as RiskCriteriaType,
|
|
8096
|
+
Zt as RiskLevel,
|
|
8097
|
+
br as RiskScoringService,
|
|
8098
|
+
Nn as RiskScoringStep,
|
|
8099
|
+
zr as SardinAIProvider,
|
|
8100
|
+
qe as SearchableSelect,
|
|
8101
|
+
Ct as Select,
|
|
8139
8102
|
Me as Spinner,
|
|
8140
|
-
|
|
8141
|
-
|
|
8103
|
+
Pr as StepRouter,
|
|
8104
|
+
Mr as SumsubProvider,
|
|
8142
8105
|
Br as ThemeManager,
|
|
8143
8106
|
Fe as ThemePreset,
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8107
|
+
Er as ThemeService,
|
|
8108
|
+
hr as UploadDocumentService,
|
|
8109
|
+
gn as UploadDocumentStep,
|
|
8110
|
+
tr as UserType,
|
|
8111
|
+
Ke as ValueDataType,
|
|
8149
8112
|
Tr as WorkflowOrchestrator,
|
|
8150
|
-
|
|
8151
|
-
|
|
8113
|
+
gt as WorkflowResultType,
|
|
8114
|
+
Ar as WorkflowState,
|
|
8152
8115
|
ce as WorkflowStepAction,
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8116
|
+
ia as appropriatenessTestSchema,
|
|
8117
|
+
Gn as clearAllStorage,
|
|
8118
|
+
Wr as clearApplicantId,
|
|
8119
|
+
Kr as clearWorkflowState,
|
|
8157
8120
|
Ae as cn,
|
|
8158
|
-
|
|
8159
|
-
|
|
8121
|
+
wr as corporateTheme,
|
|
8122
|
+
dr as defaultConfig,
|
|
8160
8123
|
Le as defaultTheme,
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8124
|
+
_r as fileToBase64,
|
|
8125
|
+
Sr as fintechTheme,
|
|
8126
|
+
xt as formatFileSize,
|
|
8127
|
+
aa as generateAppropriatenessSchema,
|
|
8128
|
+
ta as generateQuestionnaireSchema,
|
|
8129
|
+
na as generateRiskScoringSchema,
|
|
8130
|
+
ra as generateUploadDocumentSchema,
|
|
8131
|
+
Yn as getAcceptString,
|
|
8132
|
+
Hr as getApplicantId,
|
|
8133
|
+
ut as getThemePreset,
|
|
8134
|
+
Qn as getWorkflowState,
|
|
8135
|
+
Cr as healthcareTheme,
|
|
8136
|
+
Wn as isScriptLoaded,
|
|
8137
|
+
Mt as loadScript,
|
|
8138
|
+
Rr as minimalTheme,
|
|
8139
|
+
Nr as modernTheme,
|
|
8140
|
+
Un as removeScript,
|
|
8141
|
+
jr as saveApplicantId,
|
|
8142
|
+
Ur as saveWorkflowState,
|
|
8143
|
+
Ir as themePresets,
|
|
8144
|
+
zt as useApplicant,
|
|
8145
|
+
Jn as useAppropriatenessTest,
|
|
8146
|
+
Gr as useIdentityVerification,
|
|
8147
|
+
qr as useKycWorkflow,
|
|
8148
|
+
Pe as useMetaKYC,
|
|
8149
|
+
Qr as useOverview,
|
|
8150
|
+
Vr as useQuestionnaire,
|
|
8151
|
+
Jr as useRiskScoring,
|
|
8152
|
+
Yr as useUploadDocument,
|
|
8153
|
+
qn as validateFileSize,
|
|
8154
|
+
Vn as validateFileType
|
|
8192
8155
|
};
|
|
8193
8156
|
//# sourceMappingURL=index.js.map
|