@vpdev2/metakyc-sdk 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CreateApplicantForm.d.ts.map +1 -1
- package/dist/components/Header.d.ts +16 -0
- package/dist/components/Header.d.ts.map +1 -0
- package/dist/components/KycWorkflow.d.ts.map +1 -1
- package/dist/components/core/Card.d.ts.map +1 -1
- package/dist/components/identity/IdentityVerificationStep.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1220 -1175
- package/dist/index.js.map +1 -1
- package/dist/services/theme.service.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/presets.d.ts.map +1 -1
- package/dist/theme/theme-manager.d.ts.map +1 -1
- package/dist/types/theme.d.ts +3 -0
- package/dist/types/theme.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import { jsx as n, jsxs as o, Fragment as
|
|
8
|
-
import { get as
|
|
1
|
+
var Je = Object.defineProperty;
|
|
2
|
+
var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import et from "axios";
|
|
5
|
+
import * as Le from "react";
|
|
6
|
+
import le, { createContext as tt, useMemo as $e, useEffect as V, useContext as rt, useState as x, useRef as je, useCallback as q, forwardRef as De } from "react";
|
|
7
|
+
import { jsx as n, jsxs as o, Fragment as nt } from "react/jsx-runtime";
|
|
8
|
+
import { get as Ee, set as Ce, appendErrors as _e, useForm as Pe, Controller as G } from "react-hook-form";
|
|
9
9
|
import { z as de } from "zod";
|
|
10
|
-
var
|
|
11
|
-
const
|
|
10
|
+
var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}), we = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(we || {}), ae = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(ae || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), he = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(he || {}), pe = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(pe || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), se = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(se || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), ke = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(ke || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), Ie = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Ie || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), ee = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(ee || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
|
|
11
|
+
const gt = [
|
|
12
12
|
"firstName",
|
|
13
13
|
"lastName",
|
|
14
14
|
"email",
|
|
@@ -22,7 +22,7 @@ const mt = [
|
|
|
22
22
|
"nationality",
|
|
23
23
|
"taxCountry",
|
|
24
24
|
"taxNumber"
|
|
25
|
-
],
|
|
25
|
+
], Tr = [
|
|
26
26
|
"firstName",
|
|
27
27
|
"lastName",
|
|
28
28
|
"title",
|
|
@@ -46,7 +46,7 @@ const mt = [
|
|
|
46
46
|
"occupation",
|
|
47
47
|
"taxNumber",
|
|
48
48
|
"externalRefId"
|
|
49
|
-
],
|
|
49
|
+
], yt = {
|
|
50
50
|
firstName: { label: "First Name", type: "text" },
|
|
51
51
|
lastName: { label: "Last Name", type: "text" },
|
|
52
52
|
title: { label: "Title", type: "text" },
|
|
@@ -72,7 +72,7 @@ const mt = [
|
|
|
72
72
|
externalRefId: { label: "External Reference ID", type: "text" }
|
|
73
73
|
};
|
|
74
74
|
var Y = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(Y || {});
|
|
75
|
-
const
|
|
75
|
+
const ft = {
|
|
76
76
|
timeout: 3e4,
|
|
77
77
|
retries: 3,
|
|
78
78
|
locale: "en",
|
|
@@ -80,7 +80,7 @@ const pt = {
|
|
|
80
80
|
pattern: "host-controller"
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
class
|
|
83
|
+
class bt {
|
|
84
84
|
constructor(e) {
|
|
85
85
|
this.config = e;
|
|
86
86
|
}
|
|
@@ -91,9 +91,9 @@ class gt {
|
|
|
91
91
|
* @returns The full endpoint path
|
|
92
92
|
*/
|
|
93
93
|
build(e, r) {
|
|
94
|
-
const
|
|
95
|
-
if (this.config.customPaths && this.config.customPaths[
|
|
96
|
-
return this.config.customPaths[
|
|
94
|
+
const s = `${e}.${r}`;
|
|
95
|
+
if (this.config.customPaths && this.config.customPaths[s])
|
|
96
|
+
return this.config.customPaths[s];
|
|
97
97
|
switch (this.config.pattern) {
|
|
98
98
|
case "host-controller":
|
|
99
99
|
return `/api/${e}/${r}`;
|
|
@@ -101,7 +101,7 @@ class gt {
|
|
|
101
101
|
return `/services/app/${this.getServiceName(e)}/${r}`;
|
|
102
102
|
case "custom":
|
|
103
103
|
throw new Error(
|
|
104
|
-
`Custom endpoint path not found for ${
|
|
104
|
+
`Custom endpoint path not found for ${s}. Please provide it in customPaths.`
|
|
105
105
|
);
|
|
106
106
|
default:
|
|
107
107
|
throw new Error(`Unknown endpoint pattern: ${this.config.pattern}`);
|
|
@@ -120,19 +120,19 @@ class gt {
|
|
|
120
120
|
}[e] || e;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
class
|
|
124
|
-
constructor(r,
|
|
123
|
+
class ce extends Error {
|
|
124
|
+
constructor(r, s, a, i, c) {
|
|
125
125
|
super(r);
|
|
126
|
-
|
|
127
|
-
this.code =
|
|
126
|
+
K(this, "response");
|
|
127
|
+
this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, ce.prototype);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
class
|
|
130
|
+
class be {
|
|
131
131
|
/**
|
|
132
132
|
* Process an error from the API response
|
|
133
133
|
*/
|
|
134
134
|
static handleApiError(e) {
|
|
135
|
-
return new
|
|
135
|
+
return new ce(
|
|
136
136
|
e.message || "An unknown error occurred",
|
|
137
137
|
e.code,
|
|
138
138
|
e.details || void 0,
|
|
@@ -145,44 +145,44 @@ class xe {
|
|
|
145
145
|
static handleAxiosError(e) {
|
|
146
146
|
if (e.response) {
|
|
147
147
|
const r = e.response.data;
|
|
148
|
-
return r && r.error ? new
|
|
148
|
+
return r && r.error ? new ce(
|
|
149
149
|
r.error.message || "An unknown error occurred",
|
|
150
150
|
r.error.code,
|
|
151
151
|
r.error.details || void 0,
|
|
152
152
|
r.error.validationErrors || void 0,
|
|
153
153
|
e.response
|
|
154
|
-
) : r && r.result && r.result.message ? new
|
|
154
|
+
) : r && r.result && r.result.message ? new ce(
|
|
155
155
|
r.result.message,
|
|
156
156
|
e.response.status,
|
|
157
157
|
`HTTP ${e.response.status}: ${e.response.statusText}`,
|
|
158
158
|
void 0,
|
|
159
159
|
e.response
|
|
160
|
-
) : new
|
|
160
|
+
) : new ce(
|
|
161
161
|
(r == null ? void 0 : r.message) || e.message || "Request failed",
|
|
162
162
|
e.response.status,
|
|
163
163
|
`HTTP ${e.response.status}: ${e.response.statusText}`,
|
|
164
164
|
void 0,
|
|
165
165
|
e.response
|
|
166
166
|
);
|
|
167
|
-
} else return e.request ? new
|
|
167
|
+
} else return e.request ? new ce(
|
|
168
168
|
"No response from server",
|
|
169
169
|
0,
|
|
170
170
|
"The request was made but no response was received. Please check your network connection."
|
|
171
|
-
) : new
|
|
171
|
+
) : new ce(e.message || "An unexpected error occurred", 0, e.toString());
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
* Check if an error is a MetaKYCError
|
|
175
175
|
*/
|
|
176
176
|
static isMetaKYCError(e) {
|
|
177
|
-
return e instanceof
|
|
177
|
+
return e instanceof ce;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
class
|
|
180
|
+
class xt {
|
|
181
181
|
constructor(e) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
this.config = { ...
|
|
182
|
+
K(this, "axiosInstance");
|
|
183
|
+
K(this, "endpointBuilder");
|
|
184
|
+
K(this, "config");
|
|
185
|
+
this.config = { ...ft, ...e }, this.endpointBuilder = new bt(this.config.endpoints), this.axiosInstance = et.create({
|
|
186
186
|
baseURL: this.config.baseUrl,
|
|
187
187
|
timeout: this.config.timeout,
|
|
188
188
|
headers: {
|
|
@@ -194,11 +194,11 @@ class yt {
|
|
|
194
194
|
), this.axiosInstance.interceptors.response.use(
|
|
195
195
|
(r) => r,
|
|
196
196
|
async (r) => {
|
|
197
|
-
var
|
|
198
|
-
const
|
|
199
|
-
return ((
|
|
200
|
-
(i) => setTimeout(i, 1e3 *
|
|
201
|
-
), this.axiosInstance(
|
|
197
|
+
var a;
|
|
198
|
+
const s = r.config;
|
|
199
|
+
return ((a = r.response) == null ? void 0 : a.status) >= 500 && !s._retry && (s._retry = !0, s._retryCount = (s._retryCount || 0) + 1, s._retryCount < (this.config.retries || 3)) ? (await new Promise(
|
|
200
|
+
(i) => setTimeout(i, 1e3 * s._retryCount)
|
|
201
|
+
), this.axiosInstance(s)) : Promise.reject(r);
|
|
202
202
|
}
|
|
203
203
|
);
|
|
204
204
|
}
|
|
@@ -211,49 +211,49 @@ class yt {
|
|
|
211
211
|
/**
|
|
212
212
|
* Make a GET request
|
|
213
213
|
*/
|
|
214
|
-
async get(e, r,
|
|
214
|
+
async get(e, r, s) {
|
|
215
215
|
try {
|
|
216
|
-
const
|
|
217
|
-
params:
|
|
216
|
+
const a = this.buildEndpoint(e, r), i = await this.axiosInstance.get(a, {
|
|
217
|
+
params: s
|
|
218
218
|
});
|
|
219
219
|
return this.handleResponse(i);
|
|
220
|
-
} catch (
|
|
221
|
-
throw
|
|
220
|
+
} catch (a) {
|
|
221
|
+
throw be.handleAxiosError(a);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
225
|
* Make a POST request
|
|
226
226
|
*/
|
|
227
|
-
async post(e, r,
|
|
227
|
+
async post(e, r, s) {
|
|
228
228
|
try {
|
|
229
|
-
const
|
|
229
|
+
const a = this.buildEndpoint(e, r), i = await this.axiosInstance.post(a, s);
|
|
230
230
|
return this.handleResponse(i);
|
|
231
|
-
} catch (
|
|
232
|
-
throw
|
|
231
|
+
} catch (a) {
|
|
232
|
+
throw be.handleAxiosError(a);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
236
|
* Make a PUT request
|
|
237
237
|
*/
|
|
238
|
-
async put(e, r,
|
|
238
|
+
async put(e, r, s) {
|
|
239
239
|
try {
|
|
240
|
-
const
|
|
240
|
+
const a = this.buildEndpoint(e, r), i = await this.axiosInstance.put(a, s);
|
|
241
241
|
return this.handleResponse(i);
|
|
242
|
-
} catch (
|
|
243
|
-
throw
|
|
242
|
+
} catch (a) {
|
|
243
|
+
throw be.handleAxiosError(a);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
247
247
|
* Make a DELETE request
|
|
248
248
|
*/
|
|
249
|
-
async delete(e, r,
|
|
249
|
+
async delete(e, r, s) {
|
|
250
250
|
try {
|
|
251
|
-
const
|
|
252
|
-
params:
|
|
251
|
+
const a = this.buildEndpoint(e, r), i = await this.axiosInstance.delete(a, {
|
|
252
|
+
params: s
|
|
253
253
|
});
|
|
254
254
|
return this.handleResponse(i);
|
|
255
|
-
} catch (
|
|
256
|
-
throw
|
|
255
|
+
} catch (a) {
|
|
256
|
+
throw be.handleAxiosError(a);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
@@ -262,7 +262,7 @@ class yt {
|
|
|
262
262
|
handleResponse(e) {
|
|
263
263
|
const r = e.data;
|
|
264
264
|
if (!r.success && r.error)
|
|
265
|
-
throw
|
|
265
|
+
throw be.handleApiError(r.error);
|
|
266
266
|
return r;
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
@@ -272,7 +272,7 @@ class yt {
|
|
|
272
272
|
return this.axiosInstance;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
class
|
|
275
|
+
class vt {
|
|
276
276
|
constructor(e) {
|
|
277
277
|
this.httpClient = e;
|
|
278
278
|
}
|
|
@@ -391,7 +391,7 @@ class ft {
|
|
|
391
391
|
)).result;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
class
|
|
394
|
+
class wt {
|
|
395
395
|
constructor(e) {
|
|
396
396
|
this.httpClient = e;
|
|
397
397
|
}
|
|
@@ -418,7 +418,7 @@ class bt {
|
|
|
418
418
|
)).result;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
class
|
|
421
|
+
class kt {
|
|
422
422
|
constructor(e) {
|
|
423
423
|
this.httpClient = e;
|
|
424
424
|
}
|
|
@@ -446,7 +446,7 @@ class xt {
|
|
|
446
446
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", e);
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
class
|
|
449
|
+
class Nt {
|
|
450
450
|
constructor(e) {
|
|
451
451
|
this.httpClient = e;
|
|
452
452
|
}
|
|
@@ -472,7 +472,7 @@ class vt {
|
|
|
472
472
|
)).result;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
class
|
|
475
|
+
class St {
|
|
476
476
|
constructor(e) {
|
|
477
477
|
this.httpClient = e;
|
|
478
478
|
}
|
|
@@ -494,7 +494,7 @@ class wt {
|
|
|
494
494
|
await this.httpClient.get("Applicant", "PassOverview", { applicantId: e });
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
class
|
|
497
|
+
class Ct {
|
|
498
498
|
constructor(e) {
|
|
499
499
|
this.httpClient = e;
|
|
500
500
|
}
|
|
@@ -529,7 +529,7 @@ class kt {
|
|
|
529
529
|
)).result;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
class
|
|
532
|
+
class At {
|
|
533
533
|
constructor(e) {
|
|
534
534
|
this.httpClient = e;
|
|
535
535
|
}
|
|
@@ -584,7 +584,7 @@ class Nt {
|
|
|
584
584
|
return this.identityCompanyRequest(r);
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
class
|
|
587
|
+
class Et {
|
|
588
588
|
constructor(e) {
|
|
589
589
|
this.httpClient = e;
|
|
590
590
|
}
|
|
@@ -594,11 +594,11 @@ class St {
|
|
|
594
594
|
* @param lng - Language code (e.g., 'en', 'de')
|
|
595
595
|
* @param type - Optional country type filter
|
|
596
596
|
*/
|
|
597
|
-
async getCountries(e, r,
|
|
597
|
+
async getCountries(e, r, s) {
|
|
598
598
|
return (await this.httpClient.get(
|
|
599
599
|
"BaseInformation",
|
|
600
600
|
"GetAllCountries",
|
|
601
|
-
{ filter: e || "", lng: r || "en", type:
|
|
601
|
+
{ filter: e || "", lng: r || "en", type: s }
|
|
602
602
|
)).result;
|
|
603
603
|
}
|
|
604
604
|
/**
|
|
@@ -620,7 +620,7 @@ class St {
|
|
|
620
620
|
)).result;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
class
|
|
623
|
+
class It {
|
|
624
624
|
constructor(e) {
|
|
625
625
|
this.httpClient = e;
|
|
626
626
|
}
|
|
@@ -646,8 +646,9 @@ class Ct {
|
|
|
646
646
|
)).result;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
const
|
|
649
|
+
const Q = {
|
|
650
650
|
name: "Default",
|
|
651
|
+
title: "KYC Verification",
|
|
651
652
|
logo: {
|
|
652
653
|
url: "",
|
|
653
654
|
height: "40px",
|
|
@@ -704,7 +705,7 @@ const ee = {
|
|
|
704
705
|
textMuted: "#9ca3af"
|
|
705
706
|
}
|
|
706
707
|
}
|
|
707
|
-
},
|
|
708
|
+
}, Rt = {
|
|
708
709
|
name: "Corporate",
|
|
709
710
|
logo: {
|
|
710
711
|
url: "",
|
|
@@ -737,7 +738,7 @@ const ee = {
|
|
|
737
738
|
cardPadding: "1.5rem",
|
|
738
739
|
inputHeight: "2.5rem"
|
|
739
740
|
}
|
|
740
|
-
},
|
|
741
|
+
}, Dt = {
|
|
741
742
|
name: "Fintech",
|
|
742
743
|
logo: {
|
|
743
744
|
url: "",
|
|
@@ -770,7 +771,7 @@ const ee = {
|
|
|
770
771
|
cardPadding: "2rem",
|
|
771
772
|
inputHeight: "3rem"
|
|
772
773
|
}
|
|
773
|
-
},
|
|
774
|
+
}, Pt = {
|
|
774
775
|
name: "Healthcare",
|
|
775
776
|
logo: {
|
|
776
777
|
url: "",
|
|
@@ -812,7 +813,7 @@ const ee = {
|
|
|
812
813
|
textSecondary: "#CBD5E1"
|
|
813
814
|
}
|
|
814
815
|
}
|
|
815
|
-
},
|
|
816
|
+
}, Ft = {
|
|
816
817
|
name: "Modern",
|
|
817
818
|
logo: {
|
|
818
819
|
url: "",
|
|
@@ -845,7 +846,7 @@ const ee = {
|
|
|
845
846
|
cardPadding: "2rem",
|
|
846
847
|
inputHeight: "3rem"
|
|
847
848
|
}
|
|
848
|
-
},
|
|
849
|
+
}, Lt = {
|
|
849
850
|
name: "Minimal",
|
|
850
851
|
logo: {
|
|
851
852
|
url: "",
|
|
@@ -878,18 +879,18 @@ const ee = {
|
|
|
878
879
|
cardPadding: "1.25rem",
|
|
879
880
|
inputHeight: "2.25rem"
|
|
880
881
|
}
|
|
881
|
-
},
|
|
882
|
-
[Y.Default]:
|
|
883
|
-
[Y.Corporate]:
|
|
884
|
-
[Y.Fintech]:
|
|
885
|
-
[Y.Healthcare]:
|
|
886
|
-
[Y.Modern]:
|
|
887
|
-
[Y.Minimal]:
|
|
882
|
+
}, Tt = {
|
|
883
|
+
[Y.Default]: Q,
|
|
884
|
+
[Y.Corporate]: Rt,
|
|
885
|
+
[Y.Fintech]: Dt,
|
|
886
|
+
[Y.Healthcare]: Pt,
|
|
887
|
+
[Y.Modern]: Ft,
|
|
888
|
+
[Y.Minimal]: Lt
|
|
888
889
|
};
|
|
889
|
-
function
|
|
890
|
-
return
|
|
890
|
+
function xe(t) {
|
|
891
|
+
return Tt[t] || Q;
|
|
891
892
|
}
|
|
892
|
-
class
|
|
893
|
+
class Mt {
|
|
893
894
|
constructor(e) {
|
|
894
895
|
this.httpClient = e;
|
|
895
896
|
}
|
|
@@ -904,16 +905,16 @@ class Ft {
|
|
|
904
905
|
"GetThemeConfiguration"
|
|
905
906
|
);
|
|
906
907
|
if (!r.result.isEnabled)
|
|
907
|
-
return
|
|
908
|
-
let
|
|
909
|
-
return r.result.logo && (
|
|
908
|
+
return xe(Y.Default);
|
|
909
|
+
let s = r.result.preset ? xe(r.result.preset) : xe(Y.Default);
|
|
910
|
+
return r.result.title && (s.title = r.result.title), r.result.logo && (s.logo = { ...s.logo, ...r.result.logo }), r.result.colors && (s.colors = { ...s.colors, ...r.result.colors }), r.result.typography && (s.typography = { ...s.typography, ...r.result.typography }), r.result.spacing && (s.spacing = { ...s.spacing, ...r.result.spacing }), r.result.customCSS && (s.customCSS = r.result.customCSS), r.result.darkMode && (s.darkMode = {
|
|
910
911
|
colors: {
|
|
911
|
-
...(e =
|
|
912
|
+
...(e = s.darkMode) == null ? void 0 : e.colors,
|
|
912
913
|
...r.result.darkMode.colors
|
|
913
914
|
}
|
|
914
|
-
}),
|
|
915
|
+
}), s;
|
|
915
916
|
} catch (r) {
|
|
916
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", r),
|
|
917
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(Y.Default);
|
|
917
918
|
}
|
|
918
919
|
}
|
|
919
920
|
/**
|
|
@@ -939,20 +940,20 @@ class Ft {
|
|
|
939
940
|
* Preview theme (doesn't save)
|
|
940
941
|
*/
|
|
941
942
|
getPreviewTheme(e, r) {
|
|
942
|
-
const
|
|
943
|
+
const s = xe(e);
|
|
943
944
|
return r ? {
|
|
944
|
-
...
|
|
945
|
+
...s,
|
|
945
946
|
...r,
|
|
946
|
-
logo: { ...
|
|
947
|
-
colors: { ...
|
|
948
|
-
typography: r.typography ? { ...
|
|
949
|
-
spacing: r.spacing ? { ...
|
|
950
|
-
} :
|
|
947
|
+
logo: { ...s.logo, ...r.logo },
|
|
948
|
+
colors: { ...s.colors, ...r.colors },
|
|
949
|
+
typography: r.typography ? { ...s.typography, ...r.typography } : s.typography,
|
|
950
|
+
spacing: r.spacing ? { ...s.spacing, ...r.spacing } : s.spacing
|
|
951
|
+
} : s;
|
|
951
952
|
}
|
|
952
953
|
}
|
|
953
|
-
class
|
|
954
|
+
class Bt {
|
|
954
955
|
constructor() {
|
|
955
|
-
|
|
956
|
+
K(this, "listeners", /* @__PURE__ */ new Map());
|
|
956
957
|
}
|
|
957
958
|
/**
|
|
958
959
|
* Subscribe to an event
|
|
@@ -966,17 +967,17 @@ class Lt {
|
|
|
966
967
|
* Unsubscribe from an event
|
|
967
968
|
*/
|
|
968
969
|
off(e, r) {
|
|
969
|
-
const
|
|
970
|
-
|
|
970
|
+
const s = this.listeners.get(e);
|
|
971
|
+
s && s.delete(r);
|
|
971
972
|
}
|
|
972
973
|
/**
|
|
973
974
|
* Emit an event
|
|
974
975
|
*/
|
|
975
976
|
emit(e, r) {
|
|
976
|
-
const
|
|
977
|
-
|
|
977
|
+
const s = this.listeners.get(e);
|
|
978
|
+
s && s.forEach((a) => {
|
|
978
979
|
try {
|
|
979
|
-
|
|
980
|
+
a(r);
|
|
980
981
|
} catch (i) {
|
|
981
982
|
console.error(`Error in event listener for "${e}":`, i);
|
|
982
983
|
}
|
|
@@ -995,12 +996,12 @@ class Lt {
|
|
|
995
996
|
this.listeners.delete(e);
|
|
996
997
|
}
|
|
997
998
|
}
|
|
998
|
-
class
|
|
999
|
+
class Ot {
|
|
999
1000
|
constructor() {
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1001
|
+
K(this, "events", new Bt());
|
|
1002
|
+
K(this, "_applicantId", null);
|
|
1003
|
+
K(this, "_progress", null);
|
|
1004
|
+
K(this, "_error", null);
|
|
1004
1005
|
}
|
|
1005
1006
|
/**
|
|
1006
1007
|
* Get current applicant ID
|
|
@@ -1076,9 +1077,9 @@ class Tt {
|
|
|
1076
1077
|
* Update progress
|
|
1077
1078
|
*/
|
|
1078
1079
|
updateProgress(e) {
|
|
1079
|
-
var
|
|
1080
|
-
const r = (
|
|
1081
|
-
this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((
|
|
1080
|
+
var s, a;
|
|
1081
|
+
const r = (s = this._progress) == null ? void 0 : s.currentStep;
|
|
1082
|
+
this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((a = e.currentStep) == null ? void 0 : a.order) && this.events.emit("stepChanged", e.currentStep), this.events.emit("statusChanged", e.status), e.status === ae.Finished && e.workflowResult && this.events.emit("completed", e.workflowResult);
|
|
1082
1083
|
}
|
|
1083
1084
|
/**
|
|
1084
1085
|
* Set error
|
|
@@ -1135,9 +1136,9 @@ class Tt {
|
|
|
1135
1136
|
this.events.clear();
|
|
1136
1137
|
}
|
|
1137
1138
|
}
|
|
1138
|
-
class
|
|
1139
|
+
class zt {
|
|
1139
1140
|
constructor() {
|
|
1140
|
-
|
|
1141
|
+
K(this, "handlers", /* @__PURE__ */ new Map());
|
|
1141
1142
|
}
|
|
1142
1143
|
/**
|
|
1143
1144
|
* Register a step handler
|
|
@@ -1161,72 +1162,72 @@ class Mt {
|
|
|
1161
1162
|
* Load data for a step
|
|
1162
1163
|
*/
|
|
1163
1164
|
async loadStepData(e, r) {
|
|
1164
|
-
const
|
|
1165
|
-
if (!
|
|
1166
|
-
throw new Error(`No handler registered for step action: ${
|
|
1167
|
-
return
|
|
1165
|
+
const s = this.getHandler(e);
|
|
1166
|
+
if (!s)
|
|
1167
|
+
throw new Error(`No handler registered for step action: ${U[e]}`);
|
|
1168
|
+
return s.loadData(r);
|
|
1168
1169
|
}
|
|
1169
1170
|
/**
|
|
1170
1171
|
* Submit data for a step
|
|
1171
1172
|
*/
|
|
1172
1173
|
async submitStepData(e, r) {
|
|
1173
|
-
const
|
|
1174
|
-
if (!
|
|
1175
|
-
throw new Error(`No handler registered for step action: ${
|
|
1176
|
-
return
|
|
1174
|
+
const s = this.getHandler(e);
|
|
1175
|
+
if (!s)
|
|
1176
|
+
throw new Error(`No handler registered for step action: ${U[e]}`);
|
|
1177
|
+
return s.submitData(r);
|
|
1177
1178
|
}
|
|
1178
1179
|
}
|
|
1179
|
-
class
|
|
1180
|
-
constructor(e, r,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService =
|
|
1180
|
+
class $t {
|
|
1181
|
+
constructor(e, r, s, a, i, c, l, d) {
|
|
1182
|
+
K(this, "state");
|
|
1183
|
+
K(this, "stepRouter");
|
|
1184
|
+
this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = s, this.appropriatenessTestService = a, this.overviewService = i, this.riskScoringService = c, this.investorCategorizationService = d, this.state = new Ot(), this.stepRouter = new zt(), this.registerStepHandlers();
|
|
1184
1185
|
}
|
|
1185
1186
|
/**
|
|
1186
1187
|
* Register all step handlers
|
|
1187
1188
|
*/
|
|
1188
1189
|
registerStepHandlers() {
|
|
1189
|
-
this.stepRouter.registerHandler(
|
|
1190
|
+
this.stepRouter.registerHandler(U.Questionaries, {
|
|
1190
1191
|
loadData: (e) => this.questionnaireService.getQuestionnaire(e),
|
|
1191
1192
|
submitData: async (e) => {
|
|
1192
1193
|
await this.questionnaireService.fillQuestionnaire(e);
|
|
1193
1194
|
}
|
|
1194
|
-
}), this.stepRouter.registerHandler(
|
|
1195
|
+
}), this.stepRouter.registerHandler(U.UploadDocument, {
|
|
1195
1196
|
loadData: (e) => this.uploadDocumentService.getUploadDocument(e),
|
|
1196
1197
|
submitData: (e) => this.uploadDocumentService.fillUploadDocument(e)
|
|
1197
|
-
}), this.stepRouter.registerHandler(
|
|
1198
|
+
}), this.stepRouter.registerHandler(U.AppropriatenessTest, {
|
|
1198
1199
|
loadData: (e) => this.appropriatenessTestService.getAppropriatenessTest(e),
|
|
1199
1200
|
submitData: async (e) => {
|
|
1200
1201
|
await this.appropriatenessTestService.fillAppropriatenessTest(e);
|
|
1201
1202
|
}
|
|
1202
|
-
}), this.stepRouter.registerHandler(
|
|
1203
|
+
}), this.stepRouter.registerHandler(U.Overview, {
|
|
1203
1204
|
loadData: (e) => this.overviewService.getOverviewData(e),
|
|
1204
1205
|
submitData: (e) => this.overviewService.passOverview(e.applicantId)
|
|
1205
|
-
}), this.stepRouter.registerHandler(
|
|
1206
|
+
}), this.stepRouter.registerHandler(U.RiskScoring, {
|
|
1206
1207
|
loadData: (e) => this.riskScoringService.getRiskCriterias(e),
|
|
1207
1208
|
submitData: async (e) => {
|
|
1208
1209
|
await this.riskScoringService.submitRiskScoring(e);
|
|
1209
1210
|
}
|
|
1210
|
-
}), this.stepRouter.registerHandler(
|
|
1211
|
+
}), this.stepRouter.registerHandler(U.IdentitySdk, {
|
|
1211
1212
|
loadData: async (e) => ({
|
|
1212
1213
|
applicantId: e,
|
|
1213
1214
|
message: "Identity verification required"
|
|
1214
1215
|
}),
|
|
1215
1216
|
submitData: async () => {
|
|
1216
1217
|
}
|
|
1217
|
-
}), this.stepRouter.registerHandler(
|
|
1218
|
+
}), this.stepRouter.registerHandler(U.InvestorCategorization, {
|
|
1218
1219
|
loadData: (e) => this.investorCategorizationService.getInvestorCategorization(e),
|
|
1219
1220
|
submitData: async (e) => {
|
|
1220
1221
|
await this.investorCategorizationService.setInvestorCategorization(e);
|
|
1221
1222
|
}
|
|
1222
|
-
}), this.stepRouter.registerHandler(
|
|
1223
|
+
}), this.stepRouter.registerHandler(U.ManualReview, {
|
|
1223
1224
|
loadData: async (e) => ({
|
|
1224
1225
|
applicantId: e,
|
|
1225
1226
|
message: "Your application is under manual review"
|
|
1226
1227
|
}),
|
|
1227
1228
|
submitData: async () => {
|
|
1228
1229
|
}
|
|
1229
|
-
}), this.stepRouter.registerHandler(
|
|
1230
|
+
}), this.stepRouter.registerHandler(U.AdditionalData, {
|
|
1230
1231
|
loadData: async (e) => ({
|
|
1231
1232
|
applicantId: e,
|
|
1232
1233
|
message: "Additional data required"
|
|
@@ -1320,34 +1321,34 @@ class Bt {
|
|
|
1320
1321
|
return this.stepRouter;
|
|
1321
1322
|
}
|
|
1322
1323
|
}
|
|
1323
|
-
function
|
|
1324
|
-
return new Promise((r,
|
|
1324
|
+
function Ke(t, e) {
|
|
1325
|
+
return new Promise((r, s) => {
|
|
1325
1326
|
if (e && document.getElementById(e)) {
|
|
1326
1327
|
r();
|
|
1327
1328
|
return;
|
|
1328
1329
|
}
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1330
|
+
const a = document.createElement("script");
|
|
1331
|
+
a.src = t, e && (a.id = e), a.async = !0, a.onload = () => r(), a.onerror = () => s(new Error(`Failed to load script: ${t}`)), document.head.appendChild(a);
|
|
1331
1332
|
});
|
|
1332
1333
|
}
|
|
1333
|
-
function
|
|
1334
|
+
function Mr(t) {
|
|
1334
1335
|
return !!document.getElementById(t);
|
|
1335
1336
|
}
|
|
1336
|
-
function
|
|
1337
|
+
function Br(t) {
|
|
1337
1338
|
const e = document.getElementById(t);
|
|
1338
1339
|
e && e.remove();
|
|
1339
1340
|
}
|
|
1340
|
-
class
|
|
1341
|
+
class jt {
|
|
1341
1342
|
constructor(e) {
|
|
1342
|
-
|
|
1343
|
-
|
|
1343
|
+
K(this, "sdk", null);
|
|
1344
|
+
K(this, "config");
|
|
1344
1345
|
this.config = e;
|
|
1345
1346
|
}
|
|
1346
1347
|
/**
|
|
1347
1348
|
* Load Sumsub SDK
|
|
1348
1349
|
*/
|
|
1349
1350
|
async loadSDK() {
|
|
1350
|
-
await
|
|
1351
|
+
await Ke(
|
|
1351
1352
|
"https://cdn.sumsub.com/websdk/v2/production/websdk.js",
|
|
1352
1353
|
"sumsub-sdk"
|
|
1353
1354
|
);
|
|
@@ -1392,17 +1393,17 @@ class Ot {
|
|
|
1392
1393
|
this.sdk && this.sdk.on("idCheck.onError", e);
|
|
1393
1394
|
}
|
|
1394
1395
|
}
|
|
1395
|
-
class
|
|
1396
|
+
class _t {
|
|
1396
1397
|
constructor(e) {
|
|
1397
|
-
|
|
1398
|
-
|
|
1398
|
+
K(this, "sdk", null);
|
|
1399
|
+
K(this, "config");
|
|
1399
1400
|
this.config = e;
|
|
1400
1401
|
}
|
|
1401
1402
|
/**
|
|
1402
1403
|
* Load Onfido SDK
|
|
1403
1404
|
*/
|
|
1404
1405
|
async loadSDK() {
|
|
1405
|
-
await
|
|
1406
|
+
await Ke(
|
|
1406
1407
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1407
1408
|
"onfido-sdk"
|
|
1408
1409
|
);
|
|
@@ -1458,11 +1459,11 @@ class zt {
|
|
|
1458
1459
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1459
1460
|
}
|
|
1460
1461
|
}
|
|
1461
|
-
class
|
|
1462
|
+
class Kt {
|
|
1462
1463
|
constructor(e) {
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1464
|
+
K(this, "sardineContext", null);
|
|
1465
|
+
K(this, "config");
|
|
1466
|
+
K(this, "sessionKey");
|
|
1466
1467
|
this.config = e, this.sessionKey = e.sessionKey || this.generateSessionKey();
|
|
1467
1468
|
}
|
|
1468
1469
|
/**
|
|
@@ -1501,14 +1502,14 @@ class $t {
|
|
|
1501
1502
|
e();
|
|
1502
1503
|
return;
|
|
1503
1504
|
}
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1505
|
+
const s = this.getSardineHost(), a = document.createElement("script");
|
|
1506
|
+
a.type = "text/javascript", a.async = !0, a.src = `https://${s}/assets/loader.min.js`, a.onload = () => {
|
|
1506
1507
|
console.log("[SardinAI] SDK loaded successfully"), e();
|
|
1507
|
-
},
|
|
1508
|
+
}, a.onerror = () => {
|
|
1508
1509
|
r(new Error("Failed to load SardinAI SDK"));
|
|
1509
1510
|
};
|
|
1510
1511
|
const i = document.getElementsByTagName("script")[0];
|
|
1511
|
-
i && i.parentNode ? i.parentNode.insertBefore(
|
|
1512
|
+
i && i.parentNode ? i.parentNode.insertBefore(a, i) : document.head.appendChild(a);
|
|
1512
1513
|
});
|
|
1513
1514
|
}
|
|
1514
1515
|
/**
|
|
@@ -1518,14 +1519,14 @@ class $t {
|
|
|
1518
1519
|
try {
|
|
1519
1520
|
if (await this.loadSDK(), !window._Sardine)
|
|
1520
1521
|
throw new Error("SardinAI SDK not available after loading");
|
|
1521
|
-
const e = this.getSardineHost(), { clientId: r, environment:
|
|
1522
|
+
const e = this.getSardineHost(), { clientId: r, environment: s, flow: a, enableBiometrics: i, enablePortScanning: c } = this.config;
|
|
1522
1523
|
this.sardineContext = window._Sardine.createContext({
|
|
1523
1524
|
clientId: r,
|
|
1524
1525
|
sessionKey: this.sessionKey,
|
|
1525
1526
|
userIdHash: void 0,
|
|
1526
1527
|
// Will be set later via updateConfig
|
|
1527
|
-
flow:
|
|
1528
|
-
environment:
|
|
1528
|
+
flow: a || window.location.pathname,
|
|
1529
|
+
environment: s || "production",
|
|
1529
1530
|
parentElement: document.body,
|
|
1530
1531
|
enableBiometrics: i !== !1,
|
|
1531
1532
|
// Default true
|
|
@@ -1561,8 +1562,8 @@ class $t {
|
|
|
1561
1562
|
* Add noscript fallback for cases where JS is disabled
|
|
1562
1563
|
*/
|
|
1563
1564
|
addNoScriptFallback(e) {
|
|
1564
|
-
const r = document.createElement("noscript"),
|
|
1565
|
-
|
|
1565
|
+
const r = document.createElement("noscript"), s = document.createElement("img"), { clientId: a, flow: i } = this.config;
|
|
1566
|
+
s.src = `https://${e}/v1/a.png?clientId=${a}&sessionKey=${this.sessionKey}&flow=${i || "kyc"}&ns=1`, s.style.display = "none", r.appendChild(s), document.body.appendChild(r);
|
|
1566
1567
|
}
|
|
1567
1568
|
/**
|
|
1568
1569
|
* Update configuration (e.g., set userIdHash after login)
|
|
@@ -1574,13 +1575,13 @@ class $t {
|
|
|
1574
1575
|
}
|
|
1575
1576
|
e.sessionKey && (this.sessionKey = e.sessionKey), this.sardineContext.updateConfig({
|
|
1576
1577
|
...e,
|
|
1577
|
-
onConfigUpdate: (r,
|
|
1578
|
+
onConfigUpdate: (r, s, a) => {
|
|
1578
1579
|
switch (r) {
|
|
1579
1580
|
case "SESSION_UPDATE_FAILED":
|
|
1580
|
-
console.error("[SardinAI] Config update failed:",
|
|
1581
|
+
console.error("[SardinAI] Config update failed:", a);
|
|
1581
1582
|
break;
|
|
1582
1583
|
case "SESSION_UPDATED":
|
|
1583
|
-
console.log("[SardinAI] Config updated:",
|
|
1584
|
+
console.log("[SardinAI] Config updated:", s);
|
|
1584
1585
|
break;
|
|
1585
1586
|
case "SESSION_NO_UPDATE":
|
|
1586
1587
|
console.log("[SardinAI] No config update needed");
|
|
@@ -1602,18 +1603,18 @@ class $t {
|
|
|
1602
1603
|
this.sardineContext && (this.sardineContext = null);
|
|
1603
1604
|
}
|
|
1604
1605
|
}
|
|
1605
|
-
class
|
|
1606
|
+
class ye {
|
|
1606
1607
|
/**
|
|
1607
1608
|
* Create a provider instance
|
|
1608
1609
|
*/
|
|
1609
1610
|
static createProvider(e, r) {
|
|
1610
1611
|
switch (e) {
|
|
1611
|
-
case
|
|
1612
|
-
return new
|
|
1613
|
-
case
|
|
1614
|
-
return new
|
|
1615
|
-
case
|
|
1616
|
-
return new
|
|
1612
|
+
case se.Sumsub:
|
|
1613
|
+
return new jt(r);
|
|
1614
|
+
case se.Onfido:
|
|
1615
|
+
return new _t(r);
|
|
1616
|
+
case se.SardinAI:
|
|
1617
|
+
return new Kt(r);
|
|
1617
1618
|
default:
|
|
1618
1619
|
throw new Error(`Unsupported identity provider: ${e}`);
|
|
1619
1620
|
}
|
|
@@ -1621,10 +1622,10 @@ class fe {
|
|
|
1621
1622
|
/**
|
|
1622
1623
|
* Get provider configuration from API token object
|
|
1623
1624
|
*/
|
|
1624
|
-
static parseProviderConfig(e, r,
|
|
1625
|
-
var
|
|
1625
|
+
static parseProviderConfig(e, r, s) {
|
|
1626
|
+
var a;
|
|
1626
1627
|
switch (e) {
|
|
1627
|
-
case
|
|
1628
|
+
case se.Sumsub:
|
|
1628
1629
|
return {
|
|
1629
1630
|
accessToken: r.accessToken || r.token,
|
|
1630
1631
|
applicantEmail: r.email,
|
|
@@ -1632,12 +1633,12 @@ class fe {
|
|
|
1632
1633
|
externalUserId: r.externalUserId,
|
|
1633
1634
|
lang: r.lang || "en"
|
|
1634
1635
|
};
|
|
1635
|
-
case
|
|
1636
|
+
case se.Onfido:
|
|
1636
1637
|
return {
|
|
1637
1638
|
token: r.token || r.sdkToken
|
|
1638
1639
|
};
|
|
1639
|
-
case
|
|
1640
|
-
const i = ((
|
|
1640
|
+
case se.SardinAI:
|
|
1641
|
+
const i = ((a = s == null ? void 0 : s.identityProviders) == null ? void 0 : a.sardinai) || {};
|
|
1641
1642
|
return {
|
|
1642
1643
|
clientId: i.clientId || r.clientId,
|
|
1643
1644
|
sessionKey: i.sessionKey || r.sessionKey,
|
|
@@ -1652,11 +1653,11 @@ class fe {
|
|
|
1652
1653
|
}
|
|
1653
1654
|
}
|
|
1654
1655
|
}
|
|
1655
|
-
class
|
|
1656
|
+
class Ut {
|
|
1656
1657
|
constructor(e) {
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1658
|
+
K(this, "currentTheme", Q);
|
|
1659
|
+
K(this, "customStyleElement", null);
|
|
1660
|
+
K(this, "container");
|
|
1660
1661
|
this.container = e || document.documentElement;
|
|
1661
1662
|
}
|
|
1662
1663
|
/**
|
|
@@ -1669,7 +1670,7 @@ class _t {
|
|
|
1669
1670
|
* Apply color palette as CSS variables
|
|
1670
1671
|
*/
|
|
1671
1672
|
applyColors(e) {
|
|
1672
|
-
var
|
|
1673
|
+
var s;
|
|
1673
1674
|
const r = {
|
|
1674
1675
|
primary: e.primary,
|
|
1675
1676
|
"primary-hover": e.primaryHover,
|
|
@@ -1688,18 +1689,18 @@ class _t {
|
|
|
1688
1689
|
"text-secondary": e.textSecondary,
|
|
1689
1690
|
"text-muted": e.textMuted
|
|
1690
1691
|
};
|
|
1691
|
-
Object.entries(r).forEach(([
|
|
1692
|
-
this.container.style.setProperty(`--metakyc-${
|
|
1693
|
-
}), (
|
|
1692
|
+
Object.entries(r).forEach(([a, i]) => {
|
|
1693
|
+
this.container.style.setProperty(`--metakyc-${a}`, i);
|
|
1694
|
+
}), (s = this.currentTheme.darkMode) != null && s.colors && this.applyDarkModeColors(this.currentTheme.darkMode.colors);
|
|
1694
1695
|
}
|
|
1695
1696
|
/**
|
|
1696
1697
|
* Apply dark mode color overrides
|
|
1697
1698
|
*/
|
|
1698
1699
|
applyDarkModeColors(e) {
|
|
1699
|
-
Object.entries(e).forEach(([r,
|
|
1700
|
-
if (
|
|
1701
|
-
const
|
|
1702
|
-
this.container.style.setProperty(
|
|
1700
|
+
Object.entries(e).forEach(([r, s]) => {
|
|
1701
|
+
if (s) {
|
|
1702
|
+
const a = `--metakyc-dark-${this.kebabCase(r)}`;
|
|
1703
|
+
this.container.style.setProperty(a, s);
|
|
1703
1704
|
}
|
|
1704
1705
|
});
|
|
1705
1706
|
}
|
|
@@ -1707,19 +1708,19 @@ class _t {
|
|
|
1707
1708
|
* Apply typography settings
|
|
1708
1709
|
*/
|
|
1709
1710
|
applyTypography(e) {
|
|
1710
|
-
e && (e.fontFamily && this.container.style.setProperty("--metakyc-font-family", e.fontFamily), e.headingFont && this.container.style.setProperty("--metakyc-heading-font", e.headingFont), e.fontSize && Object.entries(e.fontSize).forEach(([r,
|
|
1711
|
-
this.container.style.setProperty(`--metakyc-font-size-${r}`,
|
|
1712
|
-
}), e.fontWeight && Object.entries(e.fontWeight).forEach(([r,
|
|
1713
|
-
this.container.style.setProperty(`--metakyc-font-weight-${r}`,
|
|
1711
|
+
e && (e.fontFamily && this.container.style.setProperty("--metakyc-font-family", e.fontFamily), e.headingFont && this.container.style.setProperty("--metakyc-heading-font", e.headingFont), e.fontSize && Object.entries(e.fontSize).forEach(([r, s]) => {
|
|
1712
|
+
this.container.style.setProperty(`--metakyc-font-size-${r}`, s);
|
|
1713
|
+
}), e.fontWeight && Object.entries(e.fontWeight).forEach(([r, s]) => {
|
|
1714
|
+
this.container.style.setProperty(`--metakyc-font-weight-${r}`, s.toString());
|
|
1714
1715
|
}));
|
|
1715
1716
|
}
|
|
1716
1717
|
/**
|
|
1717
1718
|
* Apply spacing settings
|
|
1718
1719
|
*/
|
|
1719
1720
|
applySpacing(e) {
|
|
1720
|
-
e && Object.entries(e).forEach(([r,
|
|
1721
|
-
const
|
|
1722
|
-
this.container.style.setProperty(
|
|
1721
|
+
e && Object.entries(e).forEach(([r, s]) => {
|
|
1722
|
+
const a = `--metakyc-${this.kebabCase(r)}`;
|
|
1723
|
+
this.container.style.setProperty(a, s);
|
|
1723
1724
|
});
|
|
1724
1725
|
}
|
|
1725
1726
|
/**
|
|
@@ -1734,18 +1735,19 @@ class _t {
|
|
|
1734
1735
|
mergeWithDefault(e) {
|
|
1735
1736
|
var r;
|
|
1736
1737
|
return {
|
|
1737
|
-
name: e.name ||
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1738
|
+
name: e.name || Q.name,
|
|
1739
|
+
title: e.title || Q.title,
|
|
1740
|
+
logo: { ...Q.logo, ...e.logo },
|
|
1741
|
+
colors: { ...Q.colors, ...e.colors },
|
|
1742
|
+
typography: e.typography ? { ...Q.typography, ...e.typography } : Q.typography,
|
|
1743
|
+
spacing: e.spacing ? { ...Q.spacing, ...e.spacing } : Q.spacing,
|
|
1742
1744
|
customCSS: e.customCSS,
|
|
1743
1745
|
darkMode: e.darkMode ? {
|
|
1744
1746
|
colors: {
|
|
1745
|
-
...(r =
|
|
1747
|
+
...(r = Q.darkMode) == null ? void 0 : r.colors,
|
|
1746
1748
|
...e.darkMode.colors
|
|
1747
1749
|
}
|
|
1748
|
-
} :
|
|
1750
|
+
} : Q.darkMode
|
|
1749
1751
|
};
|
|
1750
1752
|
}
|
|
1751
1753
|
/**
|
|
@@ -1758,7 +1760,7 @@ class _t {
|
|
|
1758
1760
|
* Reset to default theme
|
|
1759
1761
|
*/
|
|
1760
1762
|
resetTheme() {
|
|
1761
|
-
this.applyTheme(
|
|
1763
|
+
this.applyTheme(Q);
|
|
1762
1764
|
}
|
|
1763
1765
|
/**
|
|
1764
1766
|
* Remove all custom styles
|
|
@@ -1773,13 +1775,13 @@ class _t {
|
|
|
1773
1775
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1774
1776
|
}
|
|
1775
1777
|
}
|
|
1776
|
-
const
|
|
1777
|
-
const r =
|
|
1778
|
-
const
|
|
1778
|
+
const Ue = tt(null), Or = ({ config: t, children: e }) => {
|
|
1779
|
+
const r = $e(() => {
|
|
1780
|
+
const s = new xt(t), a = new vt(s), i = new wt(s), c = new kt(s), l = new Nt(s), d = new St(s), u = new Ct(s), g = new At(s), p = new Et(s), m = new It(s), f = new Mt(s), y = new Ut();
|
|
1779
1781
|
return {
|
|
1780
1782
|
config: t,
|
|
1781
|
-
httpClient:
|
|
1782
|
-
applicantService:
|
|
1783
|
+
httpClient: s,
|
|
1784
|
+
applicantService: a,
|
|
1783
1785
|
questionnaireService: i,
|
|
1784
1786
|
uploadDocumentService: c,
|
|
1785
1787
|
appropriatenessTestService: l,
|
|
@@ -1788,10 +1790,10 @@ const je = Je(null), Lr = ({ config: t, children: e }) => {
|
|
|
1788
1790
|
identityService: g,
|
|
1789
1791
|
baseInformationService: p,
|
|
1790
1792
|
investorCategorizationService: m,
|
|
1791
|
-
themeService:
|
|
1793
|
+
themeService: f,
|
|
1792
1794
|
themeManager: y,
|
|
1793
|
-
createOrchestrator: () => new
|
|
1794
|
-
|
|
1795
|
+
createOrchestrator: () => new $t(
|
|
1796
|
+
a,
|
|
1795
1797
|
i,
|
|
1796
1798
|
c,
|
|
1797
1799
|
l,
|
|
@@ -1809,111 +1811,111 @@ const je = Je(null), Lr = ({ config: t, children: e }) => {
|
|
|
1809
1811
|
return;
|
|
1810
1812
|
}
|
|
1811
1813
|
console.log("[MetaKYC] Fetching theme from backend...");
|
|
1812
|
-
const
|
|
1813
|
-
r.themeManager.applyTheme(
|
|
1814
|
-
} catch (
|
|
1815
|
-
console.warn("[MetaKYC] Failed to load theme, using default:",
|
|
1814
|
+
const a = await r.themeService.getThemeConfiguration();
|
|
1815
|
+
r.themeManager.applyTheme(a), console.log("[MetaKYC] Theme loaded and applied");
|
|
1816
|
+
} catch (a) {
|
|
1817
|
+
console.warn("[MetaKYC] Failed to load theme, using default:", a);
|
|
1816
1818
|
}
|
|
1817
1819
|
})(), () => {
|
|
1818
1820
|
r.themeManager.cleanup();
|
|
1819
|
-
}), [t.theme, r.themeService, r.themeManager]), /* @__PURE__ */ n(
|
|
1821
|
+
}), [t.theme, r.themeService, r.themeManager]), /* @__PURE__ */ n(Ue.Provider, { value: r, children: e });
|
|
1820
1822
|
};
|
|
1821
|
-
function
|
|
1822
|
-
const t =
|
|
1823
|
+
function re() {
|
|
1824
|
+
const t = rt(Ue);
|
|
1823
1825
|
if (!t)
|
|
1824
1826
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
1825
1827
|
return t;
|
|
1826
1828
|
}
|
|
1827
|
-
async function
|
|
1829
|
+
async function qt(t) {
|
|
1828
1830
|
return new Promise((e, r) => {
|
|
1829
|
-
const
|
|
1830
|
-
|
|
1831
|
-
const i =
|
|
1831
|
+
const s = new FileReader();
|
|
1832
|
+
s.readAsDataURL(t), s.onload = () => {
|
|
1833
|
+
const i = s.result.split(",")[1];
|
|
1832
1834
|
e(i);
|
|
1833
|
-
},
|
|
1835
|
+
}, s.onerror = (a) => r(a);
|
|
1834
1836
|
});
|
|
1835
1837
|
}
|
|
1836
|
-
function
|
|
1838
|
+
function zr(t, e) {
|
|
1837
1839
|
return t.size <= e;
|
|
1838
1840
|
}
|
|
1839
|
-
function
|
|
1840
|
-
return e.split(",").map((
|
|
1841
|
-
if (
|
|
1842
|
-
const
|
|
1843
|
-
return t.type.startsWith(
|
|
1841
|
+
function $r(t, e) {
|
|
1842
|
+
return e.split(",").map((s) => s.trim()).some((s) => {
|
|
1843
|
+
if (s.endsWith("/*")) {
|
|
1844
|
+
const a = s.slice(0, -2);
|
|
1845
|
+
return t.type.startsWith(a);
|
|
1844
1846
|
}
|
|
1845
|
-
return t.type ===
|
|
1847
|
+
return t.type === s;
|
|
1846
1848
|
});
|
|
1847
1849
|
}
|
|
1848
|
-
function
|
|
1850
|
+
function Ae(t) {
|
|
1849
1851
|
if (t === 0) return "0 Bytes";
|
|
1850
|
-
const e = 1024, r = ["Bytes", "KB", "MB", "GB"],
|
|
1851
|
-
return Math.round(t / Math.pow(e,
|
|
1852
|
+
const e = 1024, r = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(t) / Math.log(e));
|
|
1853
|
+
return Math.round(t / Math.pow(e, s) * 100) / 100 + " " + r[s];
|
|
1852
1854
|
}
|
|
1853
|
-
function
|
|
1855
|
+
function jr(t) {
|
|
1854
1856
|
return t;
|
|
1855
1857
|
}
|
|
1856
|
-
function
|
|
1858
|
+
function X(...t) {
|
|
1857
1859
|
return t.filter(Boolean).join(" ");
|
|
1858
1860
|
}
|
|
1859
|
-
const
|
|
1861
|
+
const fe = {
|
|
1860
1862
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1861
1863
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1862
1864
|
};
|
|
1863
|
-
function
|
|
1865
|
+
function Ht(t) {
|
|
1864
1866
|
try {
|
|
1865
|
-
localStorage.setItem(
|
|
1867
|
+
localStorage.setItem(fe.APPLICANT_ID, t.toString());
|
|
1866
1868
|
} catch (e) {
|
|
1867
1869
|
console.warn("Failed to save applicant ID to storage:", e);
|
|
1868
1870
|
}
|
|
1869
1871
|
}
|
|
1870
|
-
function
|
|
1872
|
+
function Vt() {
|
|
1871
1873
|
try {
|
|
1872
|
-
const t = localStorage.getItem(
|
|
1874
|
+
const t = localStorage.getItem(fe.APPLICANT_ID);
|
|
1873
1875
|
return t ? parseInt(t, 10) : null;
|
|
1874
1876
|
} catch (t) {
|
|
1875
1877
|
return console.warn("Failed to retrieve applicant ID from storage:", t), null;
|
|
1876
1878
|
}
|
|
1877
1879
|
}
|
|
1878
|
-
function
|
|
1880
|
+
function Yt() {
|
|
1879
1881
|
try {
|
|
1880
|
-
localStorage.removeItem(
|
|
1882
|
+
localStorage.removeItem(fe.APPLICANT_ID);
|
|
1881
1883
|
} catch (t) {
|
|
1882
1884
|
console.warn("Failed to clear applicant ID from storage:", t);
|
|
1883
1885
|
}
|
|
1884
1886
|
}
|
|
1885
|
-
function
|
|
1887
|
+
function Wt(t) {
|
|
1886
1888
|
try {
|
|
1887
|
-
localStorage.setItem(
|
|
1889
|
+
localStorage.setItem(fe.WORKFLOW_STATE, JSON.stringify(t));
|
|
1888
1890
|
} catch (e) {
|
|
1889
1891
|
console.warn("Failed to save workflow state to storage:", e);
|
|
1890
1892
|
}
|
|
1891
1893
|
}
|
|
1892
|
-
function
|
|
1894
|
+
function _r() {
|
|
1893
1895
|
try {
|
|
1894
|
-
const t = localStorage.getItem(
|
|
1896
|
+
const t = localStorage.getItem(fe.WORKFLOW_STATE);
|
|
1895
1897
|
return t ? JSON.parse(t) : null;
|
|
1896
1898
|
} catch (t) {
|
|
1897
1899
|
return console.warn("Failed to retrieve workflow state from storage:", t), null;
|
|
1898
1900
|
}
|
|
1899
1901
|
}
|
|
1900
|
-
function
|
|
1902
|
+
function Qt() {
|
|
1901
1903
|
try {
|
|
1902
|
-
localStorage.removeItem(
|
|
1904
|
+
localStorage.removeItem(fe.WORKFLOW_STATE);
|
|
1903
1905
|
} catch (t) {
|
|
1904
1906
|
console.warn("Failed to clear workflow state from storage:", t);
|
|
1905
1907
|
}
|
|
1906
1908
|
}
|
|
1907
|
-
function
|
|
1908
|
-
|
|
1909
|
+
function Kr() {
|
|
1910
|
+
Yt(), Qt();
|
|
1909
1911
|
}
|
|
1910
|
-
function
|
|
1911
|
-
const { createOrchestrator: e } =
|
|
1912
|
+
function Gt(t) {
|
|
1913
|
+
const { createOrchestrator: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(null), d = je(null), u = t || Vt();
|
|
1912
1914
|
V(() => {
|
|
1913
1915
|
d.current || (d.current = e());
|
|
1914
1916
|
}, [e]), V(() => {
|
|
1915
1917
|
var h;
|
|
1916
|
-
r && u && (
|
|
1918
|
+
r && u && (Ht(u), Wt({
|
|
1917
1919
|
applicantId: u,
|
|
1918
1920
|
currentStepOrder: (h = r.currentStep) == null ? void 0 : h.order,
|
|
1919
1921
|
status: r.status,
|
|
@@ -1927,7 +1929,7 @@ function Yt(t) {
|
|
|
1927
1929
|
i(!0), l(null);
|
|
1928
1930
|
try {
|
|
1929
1931
|
const h = await d.current.initialize(u);
|
|
1930
|
-
|
|
1932
|
+
s(h);
|
|
1931
1933
|
} catch (h) {
|
|
1932
1934
|
l(h);
|
|
1933
1935
|
} finally {
|
|
@@ -1943,7 +1945,7 @@ function Yt(t) {
|
|
|
1943
1945
|
i(!0), l(null);
|
|
1944
1946
|
try {
|
|
1945
1947
|
const h = await d.current.refreshProgress();
|
|
1946
|
-
|
|
1948
|
+
s(h);
|
|
1947
1949
|
} catch (h) {
|
|
1948
1950
|
l(h);
|
|
1949
1951
|
} finally {
|
|
@@ -1955,19 +1957,19 @@ function Yt(t) {
|
|
|
1955
1957
|
i(!0), l(null);
|
|
1956
1958
|
try {
|
|
1957
1959
|
const h = await d.current.moveToNextStep();
|
|
1958
|
-
|
|
1960
|
+
s(h);
|
|
1959
1961
|
} catch (h) {
|
|
1960
1962
|
l(h);
|
|
1961
1963
|
} finally {
|
|
1962
1964
|
i(!1);
|
|
1963
1965
|
}
|
|
1964
1966
|
}
|
|
1965
|
-
}, []),
|
|
1967
|
+
}, []), f = q(async () => {
|
|
1966
1968
|
if (d.current) {
|
|
1967
1969
|
i(!0), l(null);
|
|
1968
1970
|
try {
|
|
1969
1971
|
const h = await d.current.moveToPreviousStep();
|
|
1970
|
-
|
|
1972
|
+
s(h);
|
|
1971
1973
|
} catch (h) {
|
|
1972
1974
|
l(h);
|
|
1973
1975
|
} finally {
|
|
@@ -1980,42 +1982,42 @@ function Yt(t) {
|
|
|
1980
1982
|
try {
|
|
1981
1983
|
await d.current.submitCurrentStep(h);
|
|
1982
1984
|
const N = await d.current.refreshProgress();
|
|
1983
|
-
|
|
1985
|
+
s(N);
|
|
1984
1986
|
} catch (N) {
|
|
1985
1987
|
throw l(N), N;
|
|
1986
1988
|
} finally {
|
|
1987
1989
|
i(!1);
|
|
1988
1990
|
}
|
|
1989
1991
|
}
|
|
1990
|
-
}, []),
|
|
1992
|
+
}, []), b = Le.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((h, N) => h.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), F = Le.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
1991
1993
|
return {
|
|
1992
1994
|
progress: r,
|
|
1993
1995
|
applicantId: u,
|
|
1994
1996
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
1995
|
-
steps:
|
|
1997
|
+
steps: b,
|
|
1996
1998
|
status: (r == null ? void 0 : r.status) || ae.None,
|
|
1997
1999
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
1998
2000
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
1999
2001
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2000
|
-
hasWorkflowChanged:
|
|
2001
|
-
isLoading:
|
|
2002
|
+
hasWorkflowChanged: F,
|
|
2003
|
+
isLoading: a,
|
|
2002
2004
|
error: c,
|
|
2003
2005
|
isComplete: (r == null ? void 0 : r.status) === ae.Finished,
|
|
2004
2006
|
isOnHold: (r == null ? void 0 : r.status) === ae.OnHold,
|
|
2005
2007
|
refreshProgress: p,
|
|
2006
2008
|
moveToNext: m,
|
|
2007
|
-
moveBack:
|
|
2009
|
+
moveBack: f,
|
|
2008
2010
|
submitCurrentStep: y,
|
|
2009
2011
|
orchestrator: d.current
|
|
2010
2012
|
};
|
|
2011
2013
|
}
|
|
2012
|
-
function
|
|
2013
|
-
const { questionnaireService: e } =
|
|
2014
|
+
function Zt(t) {
|
|
2015
|
+
const { questionnaireService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), g = q(async () => {
|
|
2014
2016
|
if (t) {
|
|
2015
2017
|
i(!0), u(null);
|
|
2016
2018
|
try {
|
|
2017
2019
|
const m = await e.getQuestionnaire(t);
|
|
2018
|
-
|
|
2020
|
+
s(m);
|
|
2019
2021
|
} catch (m) {
|
|
2020
2022
|
u(m);
|
|
2021
2023
|
} finally {
|
|
@@ -2031,8 +2033,8 @@ function Wt(t) {
|
|
|
2031
2033
|
l(!0), u(null);
|
|
2032
2034
|
try {
|
|
2033
2035
|
return await e.fillQuestionnaire(m);
|
|
2034
|
-
} catch (
|
|
2035
|
-
throw u(
|
|
2036
|
+
} catch (f) {
|
|
2037
|
+
throw u(f), f;
|
|
2036
2038
|
} finally {
|
|
2037
2039
|
l(!1);
|
|
2038
2040
|
}
|
|
@@ -2041,20 +2043,20 @@ function Wt(t) {
|
|
|
2041
2043
|
);
|
|
2042
2044
|
return {
|
|
2043
2045
|
questionnaire: r,
|
|
2044
|
-
isLoading:
|
|
2046
|
+
isLoading: a,
|
|
2045
2047
|
isSubmitting: c,
|
|
2046
2048
|
error: d,
|
|
2047
2049
|
load: g,
|
|
2048
2050
|
submit: p
|
|
2049
2051
|
};
|
|
2050
2052
|
}
|
|
2051
|
-
function
|
|
2052
|
-
const { uploadDocumentService: e } =
|
|
2053
|
+
function Jt(t) {
|
|
2054
|
+
const { uploadDocumentService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(0), [g, p] = x(null), m = q(async () => {
|
|
2053
2055
|
if (t) {
|
|
2054
2056
|
i(!0), p(null);
|
|
2055
2057
|
try {
|
|
2056
2058
|
const y = await e.getUploadDocument(t);
|
|
2057
|
-
|
|
2059
|
+
s(y);
|
|
2058
2060
|
} catch (y) {
|
|
2059
2061
|
p(y);
|
|
2060
2062
|
} finally {
|
|
@@ -2065,13 +2067,13 @@ function Qt(t) {
|
|
|
2065
2067
|
V(() => {
|
|
2066
2068
|
t && m();
|
|
2067
2069
|
}, [t, m]);
|
|
2068
|
-
const
|
|
2070
|
+
const f = q(
|
|
2069
2071
|
async (y) => {
|
|
2070
2072
|
l(!0), u(0), p(null);
|
|
2071
2073
|
try {
|
|
2072
2074
|
await e.fillUploadDocument(y), u(100);
|
|
2073
|
-
} catch (
|
|
2074
|
-
throw p(
|
|
2075
|
+
} catch (b) {
|
|
2076
|
+
throw p(b), b;
|
|
2075
2077
|
} finally {
|
|
2076
2078
|
l(!1);
|
|
2077
2079
|
}
|
|
@@ -2080,21 +2082,21 @@ function Qt(t) {
|
|
|
2080
2082
|
);
|
|
2081
2083
|
return {
|
|
2082
2084
|
uploadDocument: r,
|
|
2083
|
-
isLoading:
|
|
2085
|
+
isLoading: a,
|
|
2084
2086
|
isSubmitting: c,
|
|
2085
2087
|
uploadProgress: d,
|
|
2086
2088
|
error: g,
|
|
2087
2089
|
load: m,
|
|
2088
|
-
submit:
|
|
2090
|
+
submit: f
|
|
2089
2091
|
};
|
|
2090
2092
|
}
|
|
2091
|
-
function
|
|
2092
|
-
const { appropriatenessTestService: e } =
|
|
2093
|
+
function Ur(t) {
|
|
2094
|
+
const { appropriatenessTestService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), [g, p] = x(null), m = q(async () => {
|
|
2093
2095
|
if (t) {
|
|
2094
2096
|
i(!0), u(null);
|
|
2095
2097
|
try {
|
|
2096
2098
|
const y = await e.getAppropriatenessTest(t);
|
|
2097
|
-
|
|
2099
|
+
s(y);
|
|
2098
2100
|
} catch (y) {
|
|
2099
2101
|
u(y);
|
|
2100
2102
|
} finally {
|
|
@@ -2105,14 +2107,14 @@ function $r(t) {
|
|
|
2105
2107
|
V(() => {
|
|
2106
2108
|
t && m();
|
|
2107
2109
|
}, [t, m]);
|
|
2108
|
-
const
|
|
2110
|
+
const f = q(
|
|
2109
2111
|
async (y) => {
|
|
2110
2112
|
l(!0), u(null);
|
|
2111
2113
|
try {
|
|
2112
|
-
const
|
|
2113
|
-
return p(
|
|
2114
|
-
} catch (
|
|
2115
|
-
throw u(
|
|
2114
|
+
const b = await e.fillAppropriatenessTest(y);
|
|
2115
|
+
return p(b), b;
|
|
2116
|
+
} catch (b) {
|
|
2117
|
+
throw u(b), b;
|
|
2116
2118
|
} finally {
|
|
2117
2119
|
l(!1);
|
|
2118
2120
|
}
|
|
@@ -2122,20 +2124,20 @@ function $r(t) {
|
|
|
2122
2124
|
return {
|
|
2123
2125
|
test: r,
|
|
2124
2126
|
result: g,
|
|
2125
|
-
isLoading:
|
|
2127
|
+
isLoading: a,
|
|
2126
2128
|
isSubmitting: c,
|
|
2127
2129
|
error: d,
|
|
2128
2130
|
load: m,
|
|
2129
|
-
submit:
|
|
2131
|
+
submit: f
|
|
2130
2132
|
};
|
|
2131
2133
|
}
|
|
2132
|
-
function
|
|
2133
|
-
const { overviewService: e } =
|
|
2134
|
+
function Xt(t) {
|
|
2135
|
+
const { overviewService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), g = q(async () => {
|
|
2134
2136
|
if (t) {
|
|
2135
2137
|
i(!0), u(null);
|
|
2136
2138
|
try {
|
|
2137
2139
|
const m = await e.getOverviewData(t);
|
|
2138
|
-
|
|
2140
|
+
s(m);
|
|
2139
2141
|
} catch (m) {
|
|
2140
2142
|
u(m);
|
|
2141
2143
|
} finally {
|
|
@@ -2160,33 +2162,33 @@ function Gt(t) {
|
|
|
2160
2162
|
}, [t, e]);
|
|
2161
2163
|
return {
|
|
2162
2164
|
overview: r,
|
|
2163
|
-
isLoading:
|
|
2165
|
+
isLoading: a,
|
|
2164
2166
|
isSubmitting: c,
|
|
2165
2167
|
error: d,
|
|
2166
2168
|
load: g,
|
|
2167
2169
|
passOverview: p
|
|
2168
2170
|
};
|
|
2169
2171
|
}
|
|
2170
|
-
function
|
|
2171
|
-
const { identityService: e } =
|
|
2172
|
+
function er(t) {
|
|
2173
|
+
const { identityService: e } = re(), [r, s] = x(
|
|
2172
2174
|
null
|
|
2173
|
-
), [
|
|
2175
|
+
), [a, i] = x(!1), [c, l] = x(null), d = q(
|
|
2174
2176
|
async (p, m) => {
|
|
2175
2177
|
if (t) {
|
|
2176
2178
|
i(!0), l(null);
|
|
2177
2179
|
try {
|
|
2178
|
-
const
|
|
2180
|
+
const f = {
|
|
2179
2181
|
applicantId: t,
|
|
2180
2182
|
restart: !1,
|
|
2181
2183
|
redirectUrl: p || "",
|
|
2182
2184
|
ttl: m || 604800
|
|
2183
2185
|
// Default: 7 days
|
|
2184
2186
|
};
|
|
2185
|
-
console.log("Identity request input:",
|
|
2186
|
-
const y = await e.identityRequest(
|
|
2187
|
-
return console.log("Identity request result:", y),
|
|
2188
|
-
} catch (
|
|
2189
|
-
throw l(
|
|
2187
|
+
console.log("Identity request input:", f);
|
|
2188
|
+
const y = await e.identityRequest(f);
|
|
2189
|
+
return console.log("Identity request result:", y), s(y), y;
|
|
2190
|
+
} catch (f) {
|
|
2191
|
+
throw l(f), f;
|
|
2190
2192
|
} finally {
|
|
2191
2193
|
i(!1);
|
|
2192
2194
|
}
|
|
@@ -2198,15 +2200,15 @@ function Zt(t) {
|
|
|
2198
2200
|
if (t) {
|
|
2199
2201
|
i(!0), l(null);
|
|
2200
2202
|
try {
|
|
2201
|
-
const
|
|
2203
|
+
const f = {
|
|
2202
2204
|
applicantId: t,
|
|
2203
2205
|
restart: !1,
|
|
2204
2206
|
redirectUrl: p,
|
|
2205
2207
|
ttl: m
|
|
2206
|
-
}, y = await e.identityCompanyRequest(
|
|
2207
|
-
return
|
|
2208
|
-
} catch (
|
|
2209
|
-
throw l(
|
|
2208
|
+
}, y = await e.identityCompanyRequest(f);
|
|
2209
|
+
return s(y), y;
|
|
2210
|
+
} catch (f) {
|
|
2211
|
+
throw l(f), f;
|
|
2210
2212
|
} finally {
|
|
2211
2213
|
i(!1);
|
|
2212
2214
|
}
|
|
@@ -2226,7 +2228,7 @@ function Zt(t) {
|
|
|
2226
2228
|
};
|
|
2227
2229
|
console.log("Restarting identity with input:", p);
|
|
2228
2230
|
const m = await e.identityRequest(p);
|
|
2229
|
-
return console.log("Restart identity result:", m),
|
|
2231
|
+
return console.log("Restart identity result:", m), s(m), m;
|
|
2230
2232
|
} catch (p) {
|
|
2231
2233
|
throw l(p), p;
|
|
2232
2234
|
} finally {
|
|
@@ -2238,20 +2240,20 @@ function Zt(t) {
|
|
|
2238
2240
|
identityData: r,
|
|
2239
2241
|
provider: (r == null ? void 0 : r.provider) || null,
|
|
2240
2242
|
token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
|
|
2241
|
-
isLoading:
|
|
2243
|
+
isLoading: a,
|
|
2242
2244
|
error: c,
|
|
2243
2245
|
requestIdentity: d,
|
|
2244
2246
|
requestCompanyIdentity: u,
|
|
2245
2247
|
restartIdentity: g
|
|
2246
2248
|
};
|
|
2247
2249
|
}
|
|
2248
|
-
function
|
|
2249
|
-
const { riskScoringService: e } =
|
|
2250
|
+
function tr(t) {
|
|
2251
|
+
const { riskScoringService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), [g, p] = x(null), m = q(async () => {
|
|
2250
2252
|
if (t) {
|
|
2251
2253
|
i(!0), u(null);
|
|
2252
2254
|
try {
|
|
2253
2255
|
const y = await e.getRiskCriterias(t);
|
|
2254
|
-
|
|
2256
|
+
s(y);
|
|
2255
2257
|
} catch (y) {
|
|
2256
2258
|
u(y);
|
|
2257
2259
|
} finally {
|
|
@@ -2262,14 +2264,14 @@ function Jt(t) {
|
|
|
2262
2264
|
V(() => {
|
|
2263
2265
|
t && m();
|
|
2264
2266
|
}, [t, m]);
|
|
2265
|
-
const
|
|
2267
|
+
const f = q(
|
|
2266
2268
|
async (y) => {
|
|
2267
2269
|
l(!0), u(null);
|
|
2268
2270
|
try {
|
|
2269
|
-
const
|
|
2270
|
-
return p(
|
|
2271
|
-
} catch (
|
|
2272
|
-
throw u(
|
|
2271
|
+
const b = await e.submitRiskScoring(y);
|
|
2272
|
+
return p(b), b;
|
|
2273
|
+
} catch (b) {
|
|
2274
|
+
throw u(b), b;
|
|
2273
2275
|
} finally {
|
|
2274
2276
|
l(!1);
|
|
2275
2277
|
}
|
|
@@ -2279,21 +2281,21 @@ function Jt(t) {
|
|
|
2279
2281
|
return {
|
|
2280
2282
|
criteria: r,
|
|
2281
2283
|
result: g,
|
|
2282
|
-
isLoading:
|
|
2284
|
+
isLoading: a,
|
|
2283
2285
|
isSubmitting: c,
|
|
2284
2286
|
error: d,
|
|
2285
2287
|
load: m,
|
|
2286
|
-
submit:
|
|
2288
|
+
submit: f
|
|
2287
2289
|
};
|
|
2288
2290
|
}
|
|
2289
|
-
function
|
|
2290
|
-
const { applicantService: t, config: e } =
|
|
2291
|
+
function rr() {
|
|
2292
|
+
const { applicantService: t, config: e } = re(), [r, s] = x(!1), [a, i] = x(null), c = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(p) {
|
|
2291
2293
|
const m = Math.random() * 16 | 0;
|
|
2292
2294
|
return (p === "x" ? m : m & 3 | 8).toString(16);
|
|
2293
2295
|
}), l = q(
|
|
2294
2296
|
async (p) => {
|
|
2295
2297
|
var m;
|
|
2296
|
-
|
|
2298
|
+
s(!0), i(null);
|
|
2297
2299
|
try {
|
|
2298
2300
|
if (p.applicantAdditionalDatas || (p.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
|
|
2299
2301
|
const y = c();
|
|
@@ -2303,65 +2305,65 @@ function Xt() {
|
|
|
2303
2305
|
});
|
|
2304
2306
|
}
|
|
2305
2307
|
return await t.createApplicant(p);
|
|
2306
|
-
} catch (
|
|
2307
|
-
throw i(
|
|
2308
|
+
} catch (f) {
|
|
2309
|
+
throw i(f), f;
|
|
2308
2310
|
} finally {
|
|
2309
|
-
|
|
2311
|
+
s(!1);
|
|
2310
2312
|
}
|
|
2311
2313
|
},
|
|
2312
2314
|
[t, e]
|
|
2313
2315
|
), d = q(
|
|
2314
2316
|
async (p) => {
|
|
2315
|
-
|
|
2317
|
+
s(!0), i(null);
|
|
2316
2318
|
try {
|
|
2317
2319
|
return await t.createCompanyApplicant(p);
|
|
2318
2320
|
} catch (m) {
|
|
2319
2321
|
throw i(m), m;
|
|
2320
2322
|
} finally {
|
|
2321
|
-
|
|
2323
|
+
s(!1);
|
|
2322
2324
|
}
|
|
2323
2325
|
},
|
|
2324
2326
|
[t]
|
|
2325
2327
|
), u = q(
|
|
2326
2328
|
async (p) => {
|
|
2327
|
-
|
|
2329
|
+
s(!0), i(null);
|
|
2328
2330
|
try {
|
|
2329
2331
|
return await t.getApplicantData(p);
|
|
2330
2332
|
} catch (m) {
|
|
2331
2333
|
throw i(m), m;
|
|
2332
2334
|
} finally {
|
|
2333
|
-
|
|
2335
|
+
s(!1);
|
|
2334
2336
|
}
|
|
2335
2337
|
},
|
|
2336
2338
|
[t]
|
|
2337
2339
|
), g = q(
|
|
2338
2340
|
async (p) => {
|
|
2339
|
-
|
|
2341
|
+
s(!0), i(null);
|
|
2340
2342
|
try {
|
|
2341
2343
|
await t.stopProgress(p);
|
|
2342
2344
|
} catch (m) {
|
|
2343
2345
|
throw i(m), m;
|
|
2344
2346
|
} finally {
|
|
2345
|
-
|
|
2347
|
+
s(!1);
|
|
2346
2348
|
}
|
|
2347
2349
|
},
|
|
2348
2350
|
[t]
|
|
2349
2351
|
);
|
|
2350
2352
|
return {
|
|
2351
2353
|
isLoading: r,
|
|
2352
|
-
error:
|
|
2354
|
+
error: a,
|
|
2353
2355
|
createApplicant: l,
|
|
2354
2356
|
createCompanyApplicant: d,
|
|
2355
2357
|
getApplicantData: u,
|
|
2356
2358
|
stopProgress: g
|
|
2357
2359
|
};
|
|
2358
2360
|
}
|
|
2359
|
-
const
|
|
2361
|
+
const j = ({
|
|
2360
2362
|
children: t,
|
|
2361
2363
|
variant: e = "primary",
|
|
2362
2364
|
size: r = "md",
|
|
2363
|
-
isLoading:
|
|
2364
|
-
disabled:
|
|
2365
|
+
isLoading: s = !1,
|
|
2366
|
+
disabled: a,
|
|
2365
2367
|
className: i,
|
|
2366
2368
|
...c
|
|
2367
2369
|
}) => {
|
|
@@ -2379,11 +2381,11 @@ const _ = ({
|
|
|
2379
2381
|
return /* @__PURE__ */ o(
|
|
2380
2382
|
"button",
|
|
2381
2383
|
{
|
|
2382
|
-
className:
|
|
2383
|
-
disabled:
|
|
2384
|
+
className: X(l, d[e], u[r], i),
|
|
2385
|
+
disabled: a || s,
|
|
2384
2386
|
...c,
|
|
2385
2387
|
children: [
|
|
2386
|
-
|
|
2388
|
+
s && /* @__PURE__ */ o(
|
|
2387
2389
|
"svg",
|
|
2388
2390
|
{
|
|
2389
2391
|
className: "animate-spin -ml-1 mr-2 h-4 w-4",
|
|
@@ -2417,52 +2419,76 @@ const _ = ({
|
|
|
2417
2419
|
]
|
|
2418
2420
|
}
|
|
2419
2421
|
);
|
|
2420
|
-
},
|
|
2421
|
-
({ label: t, error: e, helperText: r, leftIcon:
|
|
2422
|
+
}, Z = De(
|
|
2423
|
+
({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2422
2424
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2423
2425
|
t,
|
|
2424
2426
|
c.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2425
2427
|
] }),
|
|
2426
2428
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
2427
|
-
|
|
2429
|
+
s && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: s }),
|
|
2428
2430
|
/* @__PURE__ */ n(
|
|
2429
2431
|
"input",
|
|
2430
2432
|
{
|
|
2431
2433
|
ref: l,
|
|
2432
|
-
className:
|
|
2434
|
+
className: X(
|
|
2433
2435
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2434
2436
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2435
2437
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
2436
2438
|
e ? "border-danger-500 focus:ring-danger-500" : "border-gray-300 dark:border-gray-600",
|
|
2437
2439
|
"dark:bg-gray-800 dark:text-white",
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
+
s ? "pl-10" : "",
|
|
2441
|
+
a ? "pr-10" : "",
|
|
2440
2442
|
i
|
|
2441
2443
|
),
|
|
2442
2444
|
...c
|
|
2443
2445
|
}
|
|
2444
2446
|
),
|
|
2445
|
-
|
|
2447
|
+
a && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: a })
|
|
2446
2448
|
] }),
|
|
2447
2449
|
e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e }),
|
|
2448
2450
|
!e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2449
2451
|
] })
|
|
2450
2452
|
);
|
|
2451
|
-
|
|
2452
|
-
const
|
|
2453
|
+
Z.displayName = "Input";
|
|
2454
|
+
const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2453
2455
|
"div",
|
|
2454
2456
|
{
|
|
2455
|
-
className:
|
|
2456
|
-
"
|
|
2457
|
+
className: X(
|
|
2458
|
+
"rounded-xl shadow-sm border",
|
|
2457
2459
|
e
|
|
2458
2460
|
),
|
|
2461
|
+
style: {
|
|
2462
|
+
backgroundColor: "var(--metakyc-surface, #ffffff)",
|
|
2463
|
+
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2464
|
+
},
|
|
2465
|
+
...r,
|
|
2466
|
+
children: t
|
|
2467
|
+
}
|
|
2468
|
+
), J = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2469
|
+
"div",
|
|
2470
|
+
{
|
|
2471
|
+
className: X("px-6 py-4 border-b", e),
|
|
2472
|
+
style: {
|
|
2473
|
+
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2474
|
+
},
|
|
2475
|
+
...r,
|
|
2476
|
+
children: t
|
|
2477
|
+
}
|
|
2478
|
+
), M = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: X("px-6 py-4", e), ...r, children: t }), te = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2479
|
+
"div",
|
|
2480
|
+
{
|
|
2481
|
+
className: X("px-6 py-4 border-t", e),
|
|
2482
|
+
style: {
|
|
2483
|
+
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2484
|
+
},
|
|
2459
2485
|
...r,
|
|
2460
2486
|
children: t
|
|
2461
2487
|
}
|
|
2462
|
-
),
|
|
2488
|
+
), me = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
|
|
2463
2489
|
"span",
|
|
2464
2490
|
{
|
|
2465
|
-
className:
|
|
2491
|
+
className: X(
|
|
2466
2492
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2467
2493
|
{
|
|
2468
2494
|
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
|
|
@@ -2473,19 +2499,19 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2473
2499
|
}[e],
|
|
2474
2500
|
r
|
|
2475
2501
|
),
|
|
2476
|
-
...
|
|
2502
|
+
...s,
|
|
2477
2503
|
children: t
|
|
2478
2504
|
}
|
|
2479
|
-
),
|
|
2480
|
-
const
|
|
2505
|
+
), ie = ({ size: t = "md", className: e, ...r }) => {
|
|
2506
|
+
const s = {
|
|
2481
2507
|
sm: "h-4 w-4",
|
|
2482
2508
|
md: "h-8 w-8",
|
|
2483
2509
|
lg: "h-12 w-12"
|
|
2484
2510
|
};
|
|
2485
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2511
|
+
return /* @__PURE__ */ n("div", { className: X("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
|
|
2486
2512
|
"svg",
|
|
2487
2513
|
{
|
|
2488
|
-
className:
|
|
2514
|
+
className: X("animate-spin text-primary-500", s[t]),
|
|
2489
2515
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2490
2516
|
fill: "none",
|
|
2491
2517
|
viewBox: "0 0 24 24",
|
|
@@ -2512,8 +2538,8 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2512
2538
|
]
|
|
2513
2539
|
}
|
|
2514
2540
|
) });
|
|
2515
|
-
},
|
|
2516
|
-
({ label: t, error: e, helperText: r, options:
|
|
2541
|
+
}, ge = De(
|
|
2542
|
+
({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2517
2543
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2518
2544
|
t,
|
|
2519
2545
|
c.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
@@ -2522,7 +2548,7 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2522
2548
|
"select",
|
|
2523
2549
|
{
|
|
2524
2550
|
ref: l,
|
|
2525
|
-
className:
|
|
2551
|
+
className: X(
|
|
2526
2552
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2527
2553
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2528
2554
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
@@ -2532,8 +2558,8 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2532
2558
|
),
|
|
2533
2559
|
...c,
|
|
2534
2560
|
children: [
|
|
2535
|
-
|
|
2536
|
-
|
|
2561
|
+
a && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: a }, "__placeholder__"),
|
|
2562
|
+
s.map((d, u) => /* @__PURE__ */ n(
|
|
2537
2563
|
"option",
|
|
2538
2564
|
{
|
|
2539
2565
|
value: d.value,
|
|
@@ -2549,53 +2575,53 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2549
2575
|
!e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2550
2576
|
] })
|
|
2551
2577
|
);
|
|
2552
|
-
|
|
2553
|
-
const
|
|
2578
|
+
ge.displayName = "Select";
|
|
2579
|
+
const nr = ({
|
|
2554
2580
|
label: t,
|
|
2555
2581
|
error: e,
|
|
2556
2582
|
accept: r,
|
|
2557
|
-
multiple:
|
|
2558
|
-
maxSize:
|
|
2583
|
+
multiple: s = !1,
|
|
2584
|
+
maxSize: a,
|
|
2559
2585
|
onChange: i,
|
|
2560
2586
|
value: c = [],
|
|
2561
2587
|
className: l
|
|
2562
2588
|
}) => {
|
|
2563
|
-
const [d, u] =
|
|
2589
|
+
const [d, u] = x(!1), g = je(null), p = (h) => {
|
|
2564
2590
|
if (!h) return;
|
|
2565
2591
|
const N = Array.from(h);
|
|
2566
|
-
if (
|
|
2567
|
-
const
|
|
2568
|
-
alert(`Some files exceed the maximum size of ${
|
|
2592
|
+
if (a && N.filter((I) => I.size > a).length > 0) {
|
|
2593
|
+
const I = Ae(a);
|
|
2594
|
+
alert(`Some files exceed the maximum size of ${I}`);
|
|
2569
2595
|
return;
|
|
2570
2596
|
}
|
|
2571
|
-
i == null || i(
|
|
2597
|
+
i == null || i(s ? [...c, ...N] : [N[0]]);
|
|
2572
2598
|
}, m = (h) => {
|
|
2573
2599
|
h.preventDefault(), u(!0);
|
|
2574
|
-
},
|
|
2600
|
+
}, f = () => {
|
|
2575
2601
|
u(!1);
|
|
2576
2602
|
}, y = (h) => {
|
|
2577
2603
|
h.preventDefault(), u(!1), p(h.dataTransfer.files);
|
|
2578
|
-
},
|
|
2604
|
+
}, b = () => {
|
|
2579
2605
|
var h;
|
|
2580
2606
|
(h = g.current) == null || h.click();
|
|
2581
|
-
},
|
|
2582
|
-
const N = c.filter((w,
|
|
2607
|
+
}, F = (h) => {
|
|
2608
|
+
const N = c.filter((w, I) => I !== h);
|
|
2583
2609
|
i == null || i(N);
|
|
2584
2610
|
};
|
|
2585
|
-
return /* @__PURE__ */ o("div", { className:
|
|
2611
|
+
return /* @__PURE__ */ o("div", { className: X("w-full", l), children: [
|
|
2586
2612
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
2587
2613
|
/* @__PURE__ */ o(
|
|
2588
2614
|
"div",
|
|
2589
2615
|
{
|
|
2590
|
-
className:
|
|
2616
|
+
className: X(
|
|
2591
2617
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
2592
2618
|
d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2593
2619
|
e && "border-danger-500"
|
|
2594
2620
|
),
|
|
2595
2621
|
onDragOver: m,
|
|
2596
|
-
onDragLeave:
|
|
2622
|
+
onDragLeave: f,
|
|
2597
2623
|
onDrop: y,
|
|
2598
|
-
onClick:
|
|
2624
|
+
onClick: b,
|
|
2599
2625
|
children: [
|
|
2600
2626
|
/* @__PURE__ */ n(
|
|
2601
2627
|
"input",
|
|
@@ -2604,7 +2630,7 @@ const er = ({
|
|
|
2604
2630
|
type: "file",
|
|
2605
2631
|
className: "hidden",
|
|
2606
2632
|
accept: r,
|
|
2607
|
-
multiple:
|
|
2633
|
+
multiple: s,
|
|
2608
2634
|
onChange: (h) => p(h.target.files)
|
|
2609
2635
|
}
|
|
2610
2636
|
),
|
|
@@ -2631,9 +2657,9 @@ const er = ({
|
|
|
2631
2657
|
/* @__PURE__ */ n("span", { className: "font-medium text-primary-500", children: "Click to upload" }),
|
|
2632
2658
|
" or drag and drop"
|
|
2633
2659
|
] }),
|
|
2634
|
-
|
|
2660
|
+
a && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
|
|
2635
2661
|
"Maximum file size: ",
|
|
2636
|
-
|
|
2662
|
+
Ae(a)
|
|
2637
2663
|
] })
|
|
2638
2664
|
] })
|
|
2639
2665
|
]
|
|
@@ -2664,7 +2690,7 @@ const er = ({
|
|
|
2664
2690
|
/* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: h.name }),
|
|
2665
2691
|
/* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
|
|
2666
2692
|
"(",
|
|
2667
|
-
|
|
2693
|
+
Ae(h.size),
|
|
2668
2694
|
")"
|
|
2669
2695
|
] })
|
|
2670
2696
|
] }),
|
|
@@ -2673,7 +2699,7 @@ const er = ({
|
|
|
2673
2699
|
{
|
|
2674
2700
|
type: "button",
|
|
2675
2701
|
onClick: (w) => {
|
|
2676
|
-
w.stopPropagation(),
|
|
2702
|
+
w.stopPropagation(), F(N);
|
|
2677
2703
|
},
|
|
2678
2704
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2679
2705
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2692,11 +2718,11 @@ const er = ({
|
|
|
2692
2718
|
)) }),
|
|
2693
2719
|
e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
|
|
2694
2720
|
] });
|
|
2695
|
-
},
|
|
2696
|
-
({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2721
|
+
}, sr = De(
|
|
2722
|
+
({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...s }, a) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2723
|
+
s.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2724
|
+
s.label,
|
|
2725
|
+
s.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
2700
2726
|
] }),
|
|
2701
2727
|
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
2702
2728
|
/* @__PURE__ */ n(
|
|
@@ -2705,7 +2731,7 @@ const er = ({
|
|
|
2705
2731
|
type: "text",
|
|
2706
2732
|
value: t,
|
|
2707
2733
|
onChange: (i) => e == null ? void 0 : e(i.target.value),
|
|
2708
|
-
className:
|
|
2734
|
+
className: X(
|
|
2709
2735
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
2710
2736
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2711
2737
|
"border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
|
|
@@ -2714,50 +2740,50 @@ const er = ({
|
|
|
2714
2740
|
}
|
|
2715
2741
|
),
|
|
2716
2742
|
/* @__PURE__ */ n(
|
|
2717
|
-
|
|
2743
|
+
Z,
|
|
2718
2744
|
{
|
|
2719
|
-
ref:
|
|
2745
|
+
ref: a,
|
|
2720
2746
|
type: "tel",
|
|
2721
|
-
className:
|
|
2722
|
-
...
|
|
2747
|
+
className: X("flex-1", r),
|
|
2748
|
+
...s,
|
|
2723
2749
|
label: ""
|
|
2724
2750
|
}
|
|
2725
2751
|
)
|
|
2726
2752
|
] }),
|
|
2727
|
-
|
|
2753
|
+
s.error && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: s.error })
|
|
2728
2754
|
] })
|
|
2729
2755
|
);
|
|
2730
|
-
|
|
2731
|
-
const
|
|
2756
|
+
sr.displayName = "PhoneInput";
|
|
2757
|
+
const Te = (t, e, r) => {
|
|
2732
2758
|
if (t && "reportValidity" in t) {
|
|
2733
|
-
const
|
|
2734
|
-
t.setCustomValidity(
|
|
2759
|
+
const s = Ee(r, e);
|
|
2760
|
+
t.setCustomValidity(s && s.message || ""), t.reportValidity();
|
|
2735
2761
|
}
|
|
2736
|
-
},
|
|
2762
|
+
}, Re = (t, e) => {
|
|
2737
2763
|
for (const r in e.fields) {
|
|
2738
|
-
const
|
|
2739
|
-
|
|
2764
|
+
const s = e.fields[r];
|
|
2765
|
+
s && s.ref && "reportValidity" in s.ref ? Te(s.ref, r, t) : s && s.refs && s.refs.forEach((a) => Te(a, r, t));
|
|
2740
2766
|
}
|
|
2741
|
-
},
|
|
2742
|
-
e.shouldUseNativeValidation &&
|
|
2767
|
+
}, Me = (t, e) => {
|
|
2768
|
+
e.shouldUseNativeValidation && Re(t, e);
|
|
2743
2769
|
const r = {};
|
|
2744
|
-
for (const
|
|
2745
|
-
const
|
|
2746
|
-
if (
|
|
2747
|
-
const c = Object.assign({},
|
|
2748
|
-
|
|
2749
|
-
} else
|
|
2770
|
+
for (const s in t) {
|
|
2771
|
+
const a = Ee(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
|
|
2772
|
+
if (ar(e.names || Object.keys(t), s)) {
|
|
2773
|
+
const c = Object.assign({}, Ee(r, s));
|
|
2774
|
+
Ce(c, "root", i), Ce(r, s, c);
|
|
2775
|
+
} else Ce(r, s, i);
|
|
2750
2776
|
}
|
|
2751
2777
|
return r;
|
|
2752
|
-
},
|
|
2753
|
-
const r =
|
|
2754
|
-
return t.some((
|
|
2778
|
+
}, ar = (t, e) => {
|
|
2779
|
+
const r = Be(e);
|
|
2780
|
+
return t.some((s) => Be(s).match(`^${r}\\.\\d+`));
|
|
2755
2781
|
};
|
|
2756
|
-
function
|
|
2782
|
+
function Be(t) {
|
|
2757
2783
|
return t.replace(/\]|\[/g, "");
|
|
2758
2784
|
}
|
|
2759
|
-
function
|
|
2760
|
-
function
|
|
2785
|
+
function qe(t, e, r) {
|
|
2786
|
+
function s(l, d) {
|
|
2761
2787
|
var u;
|
|
2762
2788
|
Object.defineProperty(l, "_zod", {
|
|
2763
2789
|
value: l._zod ?? {},
|
|
@@ -2767,52 +2793,52 @@ function Ue(t, e, r) {
|
|
|
2767
2793
|
g in l || Object.defineProperty(l, g, { value: c.prototype[g].bind(l) });
|
|
2768
2794
|
l._zod.constr = c, l._zod.def = d;
|
|
2769
2795
|
}
|
|
2770
|
-
const
|
|
2771
|
-
class i extends
|
|
2796
|
+
const a = (r == null ? void 0 : r.Parent) ?? Object;
|
|
2797
|
+
class i extends a {
|
|
2772
2798
|
}
|
|
2773
2799
|
Object.defineProperty(i, "name", { value: t });
|
|
2774
2800
|
function c(l) {
|
|
2775
2801
|
var d;
|
|
2776
2802
|
const u = r != null && r.Parent ? new i() : this;
|
|
2777
|
-
|
|
2803
|
+
s(u, l), (d = u._zod).deferred ?? (d.deferred = []);
|
|
2778
2804
|
for (const g of u._zod.deferred)
|
|
2779
2805
|
g();
|
|
2780
2806
|
return u;
|
|
2781
2807
|
}
|
|
2782
|
-
return Object.defineProperty(c, "init", { value:
|
|
2808
|
+
return Object.defineProperty(c, "init", { value: s }), Object.defineProperty(c, Symbol.hasInstance, {
|
|
2783
2809
|
value: (l) => {
|
|
2784
2810
|
var d, u;
|
|
2785
2811
|
return r != null && r.Parent && l instanceof r.Parent ? !0 : (u = (d = l == null ? void 0 : l._zod) == null ? void 0 : d.traits) == null ? void 0 : u.has(t);
|
|
2786
2812
|
}
|
|
2787
2813
|
}), Object.defineProperty(c, "name", { value: t }), c;
|
|
2788
2814
|
}
|
|
2789
|
-
class
|
|
2815
|
+
class ir extends Error {
|
|
2790
2816
|
constructor() {
|
|
2791
2817
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
2792
2818
|
}
|
|
2793
2819
|
}
|
|
2794
|
-
const
|
|
2795
|
-
function
|
|
2796
|
-
return
|
|
2820
|
+
const or = {};
|
|
2821
|
+
function He(t) {
|
|
2822
|
+
return or;
|
|
2797
2823
|
}
|
|
2798
|
-
function
|
|
2824
|
+
function lr(t, e) {
|
|
2799
2825
|
return typeof e == "bigint" ? e.toString() : e;
|
|
2800
2826
|
}
|
|
2801
|
-
const
|
|
2827
|
+
const Ve = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
|
|
2802
2828
|
};
|
|
2803
|
-
function
|
|
2829
|
+
function ve(t) {
|
|
2804
2830
|
return typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
2805
2831
|
}
|
|
2806
|
-
function
|
|
2807
|
-
var
|
|
2808
|
-
const
|
|
2832
|
+
function Ye(t, e, r) {
|
|
2833
|
+
var a, i, c, l, d, u;
|
|
2834
|
+
const s = { ...t, path: t.path ?? [] };
|
|
2809
2835
|
if (!t.message) {
|
|
2810
|
-
const g =
|
|
2811
|
-
|
|
2836
|
+
const g = ve((c = (i = (a = t.inst) == null ? void 0 : a._zod.def) == null ? void 0 : i.error) == null ? void 0 : c.call(i, t)) ?? ve((l = e == null ? void 0 : e.error) == null ? void 0 : l.call(e, t)) ?? ve((d = r.customError) == null ? void 0 : d.call(r, t)) ?? ve((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
|
|
2837
|
+
s.message = g;
|
|
2812
2838
|
}
|
|
2813
|
-
return delete
|
|
2839
|
+
return delete s.inst, delete s.continue, e != null && e.reportInput || delete s.input, s;
|
|
2814
2840
|
}
|
|
2815
|
-
const
|
|
2841
|
+
const We = (t, e) => {
|
|
2816
2842
|
t.name = "$ZodError", Object.defineProperty(t, "_zod", {
|
|
2817
2843
|
value: t._zod,
|
|
2818
2844
|
enumerable: !1
|
|
@@ -2821,7 +2847,7 @@ const Ve = (t, e) => {
|
|
|
2821
2847
|
enumerable: !1
|
|
2822
2848
|
}), Object.defineProperty(t, "message", {
|
|
2823
2849
|
get() {
|
|
2824
|
-
return JSON.stringify(e,
|
|
2850
|
+
return JSON.stringify(e, lr, 2);
|
|
2825
2851
|
},
|
|
2826
2852
|
enumerable: !0
|
|
2827
2853
|
// configurable: false,
|
|
@@ -2829,101 +2855,101 @@ const Ve = (t, e) => {
|
|
|
2829
2855
|
value: () => t.message,
|
|
2830
2856
|
enumerable: !1
|
|
2831
2857
|
});
|
|
2832
|
-
},
|
|
2833
|
-
const i =
|
|
2858
|
+
}, cr = qe("$ZodError", We), Qe = qe("$ZodError", We, { Parent: Error }), dr = (t) => (e, r, s, a) => {
|
|
2859
|
+
const i = s ? Object.assign(s, { async: !1 }) : { async: !1 }, c = e._zod.run({ value: r, issues: [] }, i);
|
|
2834
2860
|
if (c instanceof Promise)
|
|
2835
|
-
throw new
|
|
2861
|
+
throw new ir();
|
|
2836
2862
|
if (c.issues.length) {
|
|
2837
|
-
const l = new ((
|
|
2838
|
-
throw
|
|
2863
|
+
const l = new ((a == null ? void 0 : a.Err) ?? t)(c.issues.map((d) => Ye(d, i, He())));
|
|
2864
|
+
throw Ve(l, a == null ? void 0 : a.callee), l;
|
|
2839
2865
|
}
|
|
2840
2866
|
return c.value;
|
|
2841
|
-
},
|
|
2842
|
-
const i =
|
|
2867
|
+
}, ur = /* @__PURE__ */ dr(Qe), mr = (t) => async (e, r, s, a) => {
|
|
2868
|
+
const i = s ? Object.assign(s, { async: !0 }) : { async: !0 };
|
|
2843
2869
|
let c = e._zod.run({ value: r, issues: [] }, i);
|
|
2844
2870
|
if (c instanceof Promise && (c = await c), c.issues.length) {
|
|
2845
|
-
const l = new ((
|
|
2846
|
-
throw
|
|
2871
|
+
const l = new ((a == null ? void 0 : a.Err) ?? t)(c.issues.map((d) => Ye(d, i, He())));
|
|
2872
|
+
throw Ve(l, a == null ? void 0 : a.callee), l;
|
|
2847
2873
|
}
|
|
2848
2874
|
return c.value;
|
|
2849
|
-
},
|
|
2850
|
-
function
|
|
2875
|
+
}, hr = /* @__PURE__ */ mr(Qe);
|
|
2876
|
+
function Oe(t, e) {
|
|
2851
2877
|
try {
|
|
2852
2878
|
var r = t();
|
|
2853
|
-
} catch (
|
|
2854
|
-
return e(
|
|
2879
|
+
} catch (s) {
|
|
2880
|
+
return e(s);
|
|
2855
2881
|
}
|
|
2856
2882
|
return r && r.then ? r.then(void 0, e) : r;
|
|
2857
2883
|
}
|
|
2858
|
-
function
|
|
2884
|
+
function pr(t, e) {
|
|
2859
2885
|
for (var r = {}; t.length; ) {
|
|
2860
|
-
var
|
|
2861
|
-
if (!r[c]) if ("unionErrors" in
|
|
2862
|
-
var l =
|
|
2886
|
+
var s = t[0], a = s.code, i = s.message, c = s.path.join(".");
|
|
2887
|
+
if (!r[c]) if ("unionErrors" in s) {
|
|
2888
|
+
var l = s.unionErrors[0].errors[0];
|
|
2863
2889
|
r[c] = { message: l.message, type: l.code };
|
|
2864
|
-
} else r[c] = { message: i, type:
|
|
2865
|
-
if ("unionErrors" in
|
|
2890
|
+
} else r[c] = { message: i, type: a };
|
|
2891
|
+
if ("unionErrors" in s && s.unionErrors.forEach(function(g) {
|
|
2866
2892
|
return g.errors.forEach(function(p) {
|
|
2867
2893
|
return t.push(p);
|
|
2868
2894
|
});
|
|
2869
2895
|
}), e) {
|
|
2870
|
-
var d = r[c].types, u = d && d[
|
|
2871
|
-
r[c] =
|
|
2896
|
+
var d = r[c].types, u = d && d[s.code];
|
|
2897
|
+
r[c] = _e(c, e, r, a, u ? [].concat(u, s.message) : s.message);
|
|
2872
2898
|
}
|
|
2873
2899
|
t.shift();
|
|
2874
2900
|
}
|
|
2875
2901
|
return r;
|
|
2876
2902
|
}
|
|
2877
|
-
function
|
|
2903
|
+
function gr(t, e) {
|
|
2878
2904
|
for (var r = {}; t.length; ) {
|
|
2879
|
-
var
|
|
2880
|
-
if (!r[c]) if (
|
|
2881
|
-
var l =
|
|
2905
|
+
var s = t[0], a = s.code, i = s.message, c = s.path.join(".");
|
|
2906
|
+
if (!r[c]) if (s.code === "invalid_union" && s.errors.length > 0) {
|
|
2907
|
+
var l = s.errors[0][0];
|
|
2882
2908
|
r[c] = { message: l.message, type: l.code };
|
|
2883
|
-
} else r[c] = { message: i, type:
|
|
2884
|
-
if (
|
|
2909
|
+
} else r[c] = { message: i, type: a };
|
|
2910
|
+
if (s.code === "invalid_union" && s.errors.forEach(function(g) {
|
|
2885
2911
|
return g.forEach(function(p) {
|
|
2886
2912
|
return t.push(p);
|
|
2887
2913
|
});
|
|
2888
2914
|
}), e) {
|
|
2889
|
-
var d = r[c].types, u = d && d[
|
|
2890
|
-
r[c] =
|
|
2915
|
+
var d = r[c].types, u = d && d[s.code];
|
|
2916
|
+
r[c] = _e(c, e, r, a, u ? [].concat(u, s.message) : s.message);
|
|
2891
2917
|
}
|
|
2892
2918
|
t.shift();
|
|
2893
2919
|
}
|
|
2894
2920
|
return r;
|
|
2895
2921
|
}
|
|
2896
|
-
function
|
|
2897
|
-
if (r === void 0 && (r = {}), function(
|
|
2898
|
-
return "_def" in
|
|
2899
|
-
}(t)) return function(
|
|
2922
|
+
function Ge(t, e, r) {
|
|
2923
|
+
if (r === void 0 && (r = {}), function(s) {
|
|
2924
|
+
return "_def" in s && typeof s._def == "object" && "typeName" in s._def;
|
|
2925
|
+
}(t)) return function(s, a, i) {
|
|
2900
2926
|
try {
|
|
2901
|
-
return Promise.resolve(
|
|
2902
|
-
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](
|
|
2903
|
-
return i.shouldUseNativeValidation &&
|
|
2927
|
+
return Promise.resolve(Oe(function() {
|
|
2928
|
+
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](s, e)).then(function(c) {
|
|
2929
|
+
return i.shouldUseNativeValidation && Re({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
|
|
2904
2930
|
});
|
|
2905
2931
|
}, function(c) {
|
|
2906
2932
|
if (function(l) {
|
|
2907
2933
|
return Array.isArray(l == null ? void 0 : l.issues);
|
|
2908
|
-
}(c)) return { values: {}, errors:
|
|
2934
|
+
}(c)) return { values: {}, errors: Me(pr(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
2909
2935
|
throw c;
|
|
2910
2936
|
}));
|
|
2911
2937
|
} catch (c) {
|
|
2912
2938
|
return Promise.reject(c);
|
|
2913
2939
|
}
|
|
2914
2940
|
};
|
|
2915
|
-
if (function(
|
|
2916
|
-
return "_zod" in
|
|
2917
|
-
}(t)) return function(
|
|
2941
|
+
if (function(s) {
|
|
2942
|
+
return "_zod" in s && typeof s._zod == "object";
|
|
2943
|
+
}(t)) return function(s, a, i) {
|
|
2918
2944
|
try {
|
|
2919
|
-
return Promise.resolve(
|
|
2920
|
-
return Promise.resolve((r.mode === "sync" ?
|
|
2921
|
-
return i.shouldUseNativeValidation &&
|
|
2945
|
+
return Promise.resolve(Oe(function() {
|
|
2946
|
+
return Promise.resolve((r.mode === "sync" ? ur : hr)(t, s, e)).then(function(c) {
|
|
2947
|
+
return i.shouldUseNativeValidation && Re({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
|
|
2922
2948
|
});
|
|
2923
2949
|
}, function(c) {
|
|
2924
2950
|
if (function(l) {
|
|
2925
|
-
return l instanceof
|
|
2926
|
-
}(c)) return { values: {}, errors:
|
|
2951
|
+
return l instanceof cr;
|
|
2952
|
+
}(c)) return { values: {}, errors: Me(gr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
2927
2953
|
throw c;
|
|
2928
2954
|
}));
|
|
2929
2955
|
} catch (c) {
|
|
@@ -2932,12 +2958,12 @@ function We(t, e, r) {
|
|
|
2932
2958
|
};
|
|
2933
2959
|
throw new Error("Invalid input: not a Zod schema");
|
|
2934
2960
|
}
|
|
2935
|
-
function
|
|
2961
|
+
function yr(t) {
|
|
2936
2962
|
return de.object({
|
|
2937
2963
|
questionResults: de.any()
|
|
2938
2964
|
}).passthrough();
|
|
2939
2965
|
}
|
|
2940
|
-
function
|
|
2966
|
+
function fr(t) {
|
|
2941
2967
|
let e = de.array(de.instanceof(File));
|
|
2942
2968
|
if (t.isRequired ? e = e.min(
|
|
2943
2969
|
1,
|
|
@@ -2946,137 +2972,137 @@ function pr(t) {
|
|
|
2946
2972
|
(r) => !r || r.length <= 1,
|
|
2947
2973
|
{ message: "Only one file is allowed" }
|
|
2948
2974
|
)), t.maxEachFileSizeByte > 0 && (e = e.refine(
|
|
2949
|
-
(r) => !r || r.every((
|
|
2975
|
+
(r) => !r || r.every((s) => s.size <= t.maxEachFileSizeByte),
|
|
2950
2976
|
{ message: `File size must not exceed ${Math.round(t.maxEachFileSizeByte / 1024 / 1024)}MB` }
|
|
2951
2977
|
)), t.allowedTypes) {
|
|
2952
|
-
const r = t.allowedTypes.split(",").map((
|
|
2978
|
+
const r = t.allowedTypes.split(",").map((s) => s.trim());
|
|
2953
2979
|
e = e.refine(
|
|
2954
|
-
(
|
|
2955
|
-
(
|
|
2980
|
+
(s) => s ? s.every(
|
|
2981
|
+
(a) => r.some((i) => i.endsWith("/*") ? a.type.startsWith(i.slice(0, -2)) : a.type === i)
|
|
2956
2982
|
) : !0,
|
|
2957
2983
|
{ message: "Invalid file type" }
|
|
2958
2984
|
);
|
|
2959
2985
|
}
|
|
2960
2986
|
return e;
|
|
2961
2987
|
}
|
|
2962
|
-
function
|
|
2988
|
+
function qr(t) {
|
|
2963
2989
|
const e = {};
|
|
2964
2990
|
return t.uploadDocumentFiles.forEach((r) => {
|
|
2965
|
-
const
|
|
2966
|
-
e[
|
|
2991
|
+
const s = `file_${r.id}`;
|
|
2992
|
+
e[s] = fr(r);
|
|
2967
2993
|
}), de.object(e);
|
|
2968
2994
|
}
|
|
2969
|
-
function
|
|
2995
|
+
function br(t) {
|
|
2970
2996
|
return de.any();
|
|
2971
2997
|
}
|
|
2972
|
-
function
|
|
2998
|
+
function xr(t) {
|
|
2973
2999
|
return de.string().min(1, "This question is required");
|
|
2974
3000
|
}
|
|
2975
|
-
function
|
|
3001
|
+
function Hr(t) {
|
|
2976
3002
|
const e = {};
|
|
2977
3003
|
return t.appropriatenessQuestions.forEach((r) => {
|
|
2978
|
-
const
|
|
2979
|
-
e[
|
|
3004
|
+
const s = `question_${r.id}`;
|
|
3005
|
+
e[s] = xr();
|
|
2980
3006
|
}), de.object(e);
|
|
2981
3007
|
}
|
|
2982
|
-
const
|
|
3008
|
+
const Vr = de.any(), vr = ({
|
|
2983
3009
|
applicantId: t,
|
|
2984
3010
|
onComplete: e,
|
|
2985
3011
|
onBack: r
|
|
2986
3012
|
}) => {
|
|
2987
|
-
const { questionnaire:
|
|
2988
|
-
(
|
|
2989
|
-
questionId:
|
|
3013
|
+
const { questionnaire: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Zt(t), d = $e(() => s ? { questionResults: s.questionGroups.map(
|
|
3014
|
+
(b) => b.questions.map((F) => ({
|
|
3015
|
+
questionId: F.id,
|
|
2990
3016
|
values: []
|
|
2991
3017
|
}))
|
|
2992
|
-
) } : { questionResults: [] }, [
|
|
3018
|
+
) } : { questionResults: [] }, [s]), u = s ? yr() : null, {
|
|
2993
3019
|
control: g,
|
|
2994
3020
|
handleSubmit: p,
|
|
2995
3021
|
formState: { errors: m }
|
|
2996
|
-
} =
|
|
2997
|
-
resolver: u ?
|
|
3022
|
+
} = Pe({
|
|
3023
|
+
resolver: u ? Ge(u) : void 0,
|
|
2998
3024
|
defaultValues: d
|
|
2999
|
-
}),
|
|
3000
|
-
if (
|
|
3025
|
+
}), f = async (y) => {
|
|
3026
|
+
if (s)
|
|
3001
3027
|
try {
|
|
3002
3028
|
console.log("Form submitted with data:", y);
|
|
3003
|
-
const
|
|
3004
|
-
(h, N) => h.questions.map((w,
|
|
3005
|
-
var
|
|
3029
|
+
const b = s.questionGroups.flatMap(
|
|
3030
|
+
(h, N) => h.questions.map((w, I) => {
|
|
3031
|
+
var P, L, R;
|
|
3006
3032
|
return {
|
|
3007
3033
|
questionId: w.id,
|
|
3008
|
-
values: ((
|
|
3034
|
+
values: ((R = (L = (P = y.questionResults) == null ? void 0 : P[N]) == null ? void 0 : L[I]) == null ? void 0 : R.values) || []
|
|
3009
3035
|
};
|
|
3010
3036
|
})
|
|
3011
3037
|
);
|
|
3012
|
-
console.log("Question results to submit:",
|
|
3013
|
-
const
|
|
3038
|
+
console.log("Question results to submit:", b);
|
|
3039
|
+
const F = {
|
|
3014
3040
|
applicantId: t,
|
|
3015
|
-
questionnarieId:
|
|
3016
|
-
questionResults:
|
|
3041
|
+
questionnarieId: s.id,
|
|
3042
|
+
questionResults: b
|
|
3017
3043
|
};
|
|
3018
|
-
console.log("Final input:",
|
|
3019
|
-
} catch (
|
|
3020
|
-
console.error("Error submitting questionnaire:",
|
|
3044
|
+
console.log("Final input:", F), await l(F), e == null || e();
|
|
3045
|
+
} catch (b) {
|
|
3046
|
+
console.error("Error submitting questionnaire:", b);
|
|
3021
3047
|
}
|
|
3022
3048
|
};
|
|
3023
|
-
return
|
|
3049
|
+
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3024
3050
|
"Error loading questionnaire: ",
|
|
3025
3051
|
c.message
|
|
3026
|
-
] }) }) }) :
|
|
3027
|
-
/* @__PURE__ */ o(
|
|
3028
|
-
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children:
|
|
3029
|
-
|
|
3052
|
+
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: p(f), children: /* @__PURE__ */ o(T, { children: [
|
|
3053
|
+
/* @__PURE__ */ o(J, { children: [
|
|
3054
|
+
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
|
|
3055
|
+
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
3030
3056
|
] }),
|
|
3031
|
-
/* @__PURE__ */ n(
|
|
3032
|
-
(y,
|
|
3033
|
-
const w =
|
|
3057
|
+
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.questionGroups.flatMap(
|
|
3058
|
+
(y, b) => y.questions.map((F, h) => {
|
|
3059
|
+
const w = F.defaultAnswers && F.defaultAnswers.length > 0 ? F.showAsDropdown ? F.canMultipleAnswer ? "multi-select" : "single-select" : F.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3034
3060
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3035
3061
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3036
|
-
|
|
3037
|
-
|
|
3062
|
+
F.text,
|
|
3063
|
+
F.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3038
3064
|
] }),
|
|
3039
3065
|
w === "text" && /* @__PURE__ */ n(
|
|
3040
|
-
|
|
3066
|
+
G,
|
|
3041
3067
|
{
|
|
3042
3068
|
control: g,
|
|
3043
|
-
name: `questionResults.${
|
|
3044
|
-
render: ({ field:
|
|
3045
|
-
var
|
|
3069
|
+
name: `questionResults.${b}.${h}.values.0`,
|
|
3070
|
+
render: ({ field: I }) => {
|
|
3071
|
+
var P, L, R, C;
|
|
3046
3072
|
return /* @__PURE__ */ n(
|
|
3047
|
-
|
|
3073
|
+
Z,
|
|
3048
3074
|
{
|
|
3049
|
-
value:
|
|
3050
|
-
onChange:
|
|
3051
|
-
onBlur:
|
|
3052
|
-
name:
|
|
3075
|
+
value: I.value || "",
|
|
3076
|
+
onChange: I.onChange,
|
|
3077
|
+
onBlur: I.onBlur,
|
|
3078
|
+
name: I.name,
|
|
3053
3079
|
placeholder: "Enter your answer...",
|
|
3054
|
-
error: (
|
|
3080
|
+
error: (C = (R = (L = (P = m.questionResults) == null ? void 0 : P[b]) == null ? void 0 : L[h]) == null ? void 0 : R.values) == null ? void 0 : C.message
|
|
3055
3081
|
}
|
|
3056
3082
|
);
|
|
3057
3083
|
}
|
|
3058
3084
|
}
|
|
3059
3085
|
),
|
|
3060
3086
|
(w === "single-select" || w === "radio") && /* @__PURE__ */ n(
|
|
3061
|
-
|
|
3087
|
+
G,
|
|
3062
3088
|
{
|
|
3063
3089
|
control: g,
|
|
3064
|
-
name: `questionResults.${
|
|
3065
|
-
render: ({ field:
|
|
3066
|
-
var
|
|
3090
|
+
name: `questionResults.${b}.${h}.values.0`,
|
|
3091
|
+
render: ({ field: I }) => {
|
|
3092
|
+
var P, L, R, C;
|
|
3067
3093
|
return /* @__PURE__ */ n(
|
|
3068
|
-
|
|
3094
|
+
ge,
|
|
3069
3095
|
{
|
|
3070
|
-
value:
|
|
3071
|
-
onChange:
|
|
3072
|
-
onBlur:
|
|
3073
|
-
name:
|
|
3074
|
-
options:
|
|
3096
|
+
value: I.value || "",
|
|
3097
|
+
onChange: I.onChange,
|
|
3098
|
+
onBlur: I.onBlur,
|
|
3099
|
+
name: I.name,
|
|
3100
|
+
options: F.defaultAnswers.map((B) => ({
|
|
3075
3101
|
value: B,
|
|
3076
3102
|
label: B
|
|
3077
3103
|
})),
|
|
3078
3104
|
placeholder: "Select an option...",
|
|
3079
|
-
error: (
|
|
3105
|
+
error: (C = (R = (L = (P = m.questionResults) == null ? void 0 : P[b]) == null ? void 0 : L[h]) == null ? void 0 : R.values) == null ? void 0 : C.message
|
|
3080
3106
|
}
|
|
3081
3107
|
);
|
|
3082
3108
|
}
|
|
@@ -3085,11 +3111,11 @@ const Ur = de.any(), fr = ({
|
|
|
3085
3111
|
(w === "checkbox" || w === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3086
3112
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
|
|
3087
3113
|
/* @__PURE__ */ n(
|
|
3088
|
-
|
|
3114
|
+
G,
|
|
3089
3115
|
{
|
|
3090
3116
|
control: g,
|
|
3091
|
-
name: `questionResults.${
|
|
3092
|
-
render: ({ field: { value:
|
|
3117
|
+
name: `questionResults.${b}.${h}.values`,
|
|
3118
|
+
render: ({ field: { value: I = [], onChange: P } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: F.defaultAnswers.map((L, R) => /* @__PURE__ */ o(
|
|
3093
3119
|
"label",
|
|
3094
3120
|
{
|
|
3095
3121
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
@@ -3098,29 +3124,29 @@ const Ur = de.any(), fr = ({
|
|
|
3098
3124
|
"input",
|
|
3099
3125
|
{
|
|
3100
3126
|
type: "checkbox",
|
|
3101
|
-
checked: Array.isArray(
|
|
3102
|
-
onChange: (
|
|
3103
|
-
const B = Array.isArray(
|
|
3104
|
-
|
|
3127
|
+
checked: Array.isArray(I) && I.includes(L),
|
|
3128
|
+
onChange: (C) => {
|
|
3129
|
+
const B = Array.isArray(I) ? I : [], z = C.target.checked ? [...B, L] : B.filter((v) => v !== L);
|
|
3130
|
+
P(z);
|
|
3105
3131
|
},
|
|
3106
3132
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3107
3133
|
}
|
|
3108
3134
|
),
|
|
3109
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3135
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: L })
|
|
3110
3136
|
]
|
|
3111
3137
|
},
|
|
3112
|
-
`answer-${
|
|
3138
|
+
`answer-${b}-${h}-${R}`
|
|
3113
3139
|
)) })
|
|
3114
3140
|
}
|
|
3115
3141
|
)
|
|
3116
3142
|
] })
|
|
3117
|
-
] },
|
|
3143
|
+
] }, F.id);
|
|
3118
3144
|
})
|
|
3119
3145
|
) }),
|
|
3120
3146
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3121
|
-
r && /* @__PURE__ */ n(
|
|
3147
|
+
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3122
3148
|
/* @__PURE__ */ n(
|
|
3123
|
-
|
|
3149
|
+
j,
|
|
3124
3150
|
{
|
|
3125
3151
|
type: "submit",
|
|
3126
3152
|
isLoading: i,
|
|
@@ -3136,43 +3162,43 @@ const Ur = de.any(), fr = ({
|
|
|
3136
3162
|
c.message
|
|
3137
3163
|
] }) })
|
|
3138
3164
|
] }) }) : null;
|
|
3139
|
-
},
|
|
3165
|
+
}, wr = ({
|
|
3140
3166
|
applicantId: t,
|
|
3141
3167
|
onComplete: e,
|
|
3142
3168
|
onBack: r
|
|
3143
3169
|
}) => {
|
|
3144
|
-
const { uploadDocument:
|
|
3145
|
-
if (p.preventDefault(), !
|
|
3170
|
+
const { uploadDocument: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Jt(t), [d, u] = x({}), g = async (p) => {
|
|
3171
|
+
if (p.preventDefault(), !s) return;
|
|
3146
3172
|
const m = await Promise.all(
|
|
3147
|
-
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3173
|
+
s.uploadDocumentFiles.map(async (y) => {
|
|
3174
|
+
const b = d[y.id] || [], F = await Promise.all(
|
|
3175
|
+
b.map(async (h) => ({
|
|
3150
3176
|
fileName: h.name,
|
|
3151
|
-
fileData: await
|
|
3177
|
+
fileData: await qt(h)
|
|
3152
3178
|
}))
|
|
3153
3179
|
);
|
|
3154
3180
|
return {
|
|
3155
3181
|
uploadDocumentFileId: y.id,
|
|
3156
|
-
valueList:
|
|
3182
|
+
valueList: F
|
|
3157
3183
|
};
|
|
3158
3184
|
})
|
|
3159
|
-
),
|
|
3185
|
+
), f = {
|
|
3160
3186
|
applicantId: t,
|
|
3161
|
-
uploadDocumentId:
|
|
3187
|
+
uploadDocumentId: s.id,
|
|
3162
3188
|
uploadDocumentResults: m
|
|
3163
3189
|
};
|
|
3164
|
-
await l(
|
|
3190
|
+
await l(f), e == null || e();
|
|
3165
3191
|
};
|
|
3166
|
-
return
|
|
3192
|
+
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3167
3193
|
"Error loading document requirements: ",
|
|
3168
3194
|
c.message
|
|
3169
|
-
] }) }) }) :
|
|
3170
|
-
/* @__PURE__ */ o(
|
|
3171
|
-
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children:
|
|
3172
|
-
|
|
3195
|
+
] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: g, children: /* @__PURE__ */ o(T, { children: [
|
|
3196
|
+
/* @__PURE__ */ o(J, { children: [
|
|
3197
|
+
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
|
|
3198
|
+
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
3173
3199
|
] }),
|
|
3174
|
-
/* @__PURE__ */ n(
|
|
3175
|
-
|
|
3200
|
+
/* @__PURE__ */ n(M, { className: "space-y-6", children: s.uploadDocumentFiles.map((p) => /* @__PURE__ */ n(
|
|
3201
|
+
nr,
|
|
3176
3202
|
{
|
|
3177
3203
|
label: p.displayName,
|
|
3178
3204
|
accept: p.allowedTypes,
|
|
@@ -3180,30 +3206,30 @@ const Ur = de.any(), fr = ({
|
|
|
3180
3206
|
maxSize: p.maxEachFileSizeByte,
|
|
3181
3207
|
value: d[p.id] || [],
|
|
3182
3208
|
onChange: (m) => {
|
|
3183
|
-
u((
|
|
3209
|
+
u((f) => ({ ...f, [p.id]: m }));
|
|
3184
3210
|
}
|
|
3185
3211
|
},
|
|
3186
3212
|
p.id
|
|
3187
3213
|
)) }),
|
|
3188
3214
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3189
|
-
r && /* @__PURE__ */ n(
|
|
3190
|
-
/* @__PURE__ */ n(
|
|
3215
|
+
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3216
|
+
/* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
|
|
3191
3217
|
] })
|
|
3192
3218
|
] }) }) : null;
|
|
3193
|
-
},
|
|
3194
|
-
const { overview:
|
|
3219
|
+
}, kr = ({ applicantId: t, onComplete: e, onBack: r }) => {
|
|
3220
|
+
const { overview: s, isLoading: a, isSubmitting: i, error: c, passOverview: l } = Xt(t), d = async () => {
|
|
3195
3221
|
await l(), e == null || e();
|
|
3196
3222
|
};
|
|
3197
|
-
return
|
|
3223
|
+
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3198
3224
|
"Error loading overview: ",
|
|
3199
3225
|
c.message
|
|
3200
|
-
] }) }) }) :
|
|
3201
|
-
/* @__PURE__ */ o(
|
|
3202
|
-
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children:
|
|
3203
|
-
|
|
3226
|
+
] }) }) }) : s ? /* @__PURE__ */ o(T, { children: [
|
|
3227
|
+
/* @__PURE__ */ o(J, { children: [
|
|
3228
|
+
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.title || "Overview" }),
|
|
3229
|
+
s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
|
|
3204
3230
|
] }),
|
|
3205
|
-
/* @__PURE__ */ o(
|
|
3206
|
-
|
|
3231
|
+
/* @__PURE__ */ o(M, { className: "space-y-6", children: [
|
|
3232
|
+
s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: s.steps.sort((u, g) => u.order - g.order).map((u) => /* @__PURE__ */ n(
|
|
3207
3233
|
"div",
|
|
3208
3234
|
{
|
|
3209
3235
|
className: "border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-gray-50 dark:bg-gray-800",
|
|
@@ -3217,49 +3243,49 @@ const Ur = de.any(), fr = ({
|
|
|
3217
3243
|
},
|
|
3218
3244
|
u.order
|
|
3219
3245
|
)) }) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }),
|
|
3220
|
-
|
|
3246
|
+
s.steps && s.steps.length > 0 && /* @__PURE__ */ n("div", { className: "mt-6 p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-green-800 dark:text-green-300 text-sm", children: [
|
|
3221
3247
|
/* @__PURE__ */ n("strong", { children: "✓ All steps completed!" }),
|
|
3222
3248
|
" Review the information above and confirm to proceed."
|
|
3223
3249
|
] }) })
|
|
3224
3250
|
] }),
|
|
3225
3251
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3226
|
-
r && /* @__PURE__ */ n(
|
|
3227
|
-
/* @__PURE__ */ n(
|
|
3252
|
+
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3253
|
+
/* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Confirm and Continue" })
|
|
3228
3254
|
] })
|
|
3229
3255
|
] }) : null;
|
|
3230
|
-
},
|
|
3256
|
+
}, Nr = ({
|
|
3231
3257
|
applicantId: t,
|
|
3232
3258
|
onComplete: e,
|
|
3233
3259
|
onBack: r
|
|
3234
3260
|
}) => {
|
|
3235
|
-
const { criteria:
|
|
3236
|
-
criteriaValueInputs:
|
|
3261
|
+
const { criteria: s, isLoading: a, isSubmitting: i, error: c, submit: l } = tr(t), [d, u] = le.useState(!1), g = le.useMemo(() => !s || s.length === 0 ? { criteriaValueInputs: [] } : {
|
|
3262
|
+
criteriaValueInputs: s.map((h) => ({
|
|
3237
3263
|
riskCriteriaId: h.id,
|
|
3238
3264
|
values: [""]
|
|
3239
3265
|
// Initialize with empty string to prevent uncontrolled input warning
|
|
3240
3266
|
}))
|
|
3241
|
-
}, [
|
|
3267
|
+
}, [s]), p = s && s.length > 0 ? br() : null, {
|
|
3242
3268
|
control: m,
|
|
3243
|
-
handleSubmit:
|
|
3269
|
+
handleSubmit: f,
|
|
3244
3270
|
formState: { errors: y }
|
|
3245
|
-
} =
|
|
3246
|
-
resolver: p ?
|
|
3271
|
+
} = Pe({
|
|
3272
|
+
resolver: p ? Ge(p) : void 0,
|
|
3247
3273
|
defaultValues: g
|
|
3248
3274
|
});
|
|
3249
|
-
|
|
3250
|
-
!
|
|
3251
|
-
}, [
|
|
3252
|
-
const
|
|
3253
|
-
if (
|
|
3275
|
+
le.useEffect(() => {
|
|
3276
|
+
!a && s && s.length === 0 && !d && !i && (u(!0), l({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
|
|
3277
|
+
}, [a, s, d, i, l, t, e]);
|
|
3278
|
+
const b = async (h) => {
|
|
3279
|
+
if (s)
|
|
3254
3280
|
try {
|
|
3255
|
-
console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:",
|
|
3256
|
-
const N = h.criteriaValueInputs.map((
|
|
3257
|
-
const
|
|
3258
|
-
return
|
|
3259
|
-
riskCriteriaId:
|
|
3260
|
-
values:
|
|
3281
|
+
console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
|
|
3282
|
+
const N = h.criteriaValueInputs.map((I, P) => {
|
|
3283
|
+
const L = I.values || [], R = Array.isArray(L) ? L.filter((C) => C && C.trim()) : L && L.toString().trim() ? [L.toString()] : [];
|
|
3284
|
+
return R.length === 0 ? null : {
|
|
3285
|
+
riskCriteriaId: s[P].id,
|
|
3286
|
+
values: R
|
|
3261
3287
|
};
|
|
3262
|
-
}).filter((
|
|
3288
|
+
}).filter((I) => I !== null);
|
|
3263
3289
|
console.log("Risk scoring criteriaValueInputs to submit:", N);
|
|
3264
3290
|
const w = {
|
|
3265
3291
|
applicantId: t,
|
|
@@ -3269,24 +3295,24 @@ const Ur = de.any(), fr = ({
|
|
|
3269
3295
|
} catch (N) {
|
|
3270
3296
|
throw console.error("Error submitting risk scoring:", N), N;
|
|
3271
3297
|
}
|
|
3272
|
-
},
|
|
3273
|
-
return
|
|
3274
|
-
/* @__PURE__ */ n(
|
|
3298
|
+
}, F = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
|
|
3299
|
+
return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
3300
|
+
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
3275
3301
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
|
|
3276
|
-
] }) }) : c ? /* @__PURE__ */ n(
|
|
3302
|
+
] }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3277
3303
|
"Error loading criteria: ",
|
|
3278
3304
|
c.message
|
|
3279
|
-
] }) }) }) : !
|
|
3280
|
-
/* @__PURE__ */ n(
|
|
3305
|
+
] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
3306
|
+
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
3281
3307
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
|
|
3282
|
-
] }) }) :
|
|
3283
|
-
/* @__PURE__ */ o(
|
|
3308
|
+
] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: f(b), children: /* @__PURE__ */ o(T, { children: [
|
|
3309
|
+
/* @__PURE__ */ o(J, { children: [
|
|
3284
3310
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
|
|
3285
3311
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3286
3312
|
] }),
|
|
3287
|
-
/* @__PURE__ */ n(
|
|
3288
|
-
var
|
|
3289
|
-
const w =
|
|
3313
|
+
/* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((h, N) => {
|
|
3314
|
+
var I, P, L;
|
|
3315
|
+
const w = F(h);
|
|
3290
3316
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3291
3317
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3292
3318
|
h.displayName,
|
|
@@ -3294,22 +3320,22 @@ const Ur = de.any(), fr = ({
|
|
|
3294
3320
|
] }),
|
|
3295
3321
|
h.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: h.description }),
|
|
3296
3322
|
w === "text" && /* @__PURE__ */ n(
|
|
3297
|
-
|
|
3323
|
+
G,
|
|
3298
3324
|
{
|
|
3299
3325
|
control: m,
|
|
3300
3326
|
name: `criteriaValueInputs.${N}.values.0`,
|
|
3301
|
-
render: ({ field:
|
|
3302
|
-
var
|
|
3327
|
+
render: ({ field: R }) => {
|
|
3328
|
+
var C, B, z;
|
|
3303
3329
|
return /* @__PURE__ */ n(
|
|
3304
|
-
|
|
3330
|
+
Z,
|
|
3305
3331
|
{
|
|
3306
|
-
...
|
|
3307
|
-
value:
|
|
3308
|
-
type: h.valueDataType ===
|
|
3332
|
+
...R,
|
|
3333
|
+
value: R.value || "",
|
|
3334
|
+
type: h.valueDataType === Ie.DigitOnly ? "number" : "text",
|
|
3309
3335
|
placeholder: "Enter your answer...",
|
|
3310
|
-
error: (z = (B = (
|
|
3311
|
-
onKeyDown: (
|
|
3312
|
-
h.valueDataType ===
|
|
3336
|
+
error: (z = (B = (C = y.criteriaValueInputs) == null ? void 0 : C[N]) == null ? void 0 : B.values) == null ? void 0 : z.message,
|
|
3337
|
+
onKeyDown: (v) => {
|
|
3338
|
+
h.valueDataType === Ie.DigitOnly && ["e", "E", "+", "-", "."].includes(v.key) && v.preventDefault();
|
|
3313
3339
|
}
|
|
3314
3340
|
}
|
|
3315
3341
|
);
|
|
@@ -3319,17 +3345,17 @@ const Ur = de.any(), fr = ({
|
|
|
3319
3345
|
w === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3320
3346
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
|
|
3321
3347
|
/* @__PURE__ */ n(
|
|
3322
|
-
|
|
3348
|
+
G,
|
|
3323
3349
|
{
|
|
3324
3350
|
control: m,
|
|
3325
3351
|
name: `criteriaValueInputs.${N}.values.0`,
|
|
3326
|
-
render: ({ field: { value:
|
|
3352
|
+
render: ({ field: { value: R, onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3327
3353
|
/* @__PURE__ */ n(
|
|
3328
3354
|
"input",
|
|
3329
3355
|
{
|
|
3330
3356
|
type: "radio",
|
|
3331
|
-
checked:
|
|
3332
|
-
onChange: () =>
|
|
3357
|
+
checked: R === B,
|
|
3358
|
+
onChange: () => C(B),
|
|
3333
3359
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3334
3360
|
}
|
|
3335
3361
|
),
|
|
@@ -3341,19 +3367,19 @@ const Ur = de.any(), fr = ({
|
|
|
3341
3367
|
w === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3342
3368
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
|
|
3343
3369
|
/* @__PURE__ */ n(
|
|
3344
|
-
|
|
3370
|
+
G,
|
|
3345
3371
|
{
|
|
3346
3372
|
control: m,
|
|
3347
3373
|
name: `criteriaValueInputs.${N}.values`,
|
|
3348
|
-
render: ({ field: { value:
|
|
3374
|
+
render: ({ field: { value: R = [], onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3349
3375
|
/* @__PURE__ */ n(
|
|
3350
3376
|
"input",
|
|
3351
3377
|
{
|
|
3352
3378
|
type: "checkbox",
|
|
3353
|
-
checked: Array.isArray(
|
|
3354
|
-
onChange: (
|
|
3355
|
-
const
|
|
3356
|
-
A
|
|
3379
|
+
checked: Array.isArray(R) && R.includes(B),
|
|
3380
|
+
onChange: (v) => {
|
|
3381
|
+
const E = Array.isArray(R) ? R : [], A = v.target.checked ? [...E, B] : E.filter((k) => k !== B);
|
|
3382
|
+
C(A);
|
|
3357
3383
|
},
|
|
3358
3384
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3359
3385
|
}
|
|
@@ -3364,16 +3390,16 @@ const Ur = de.any(), fr = ({
|
|
|
3364
3390
|
)
|
|
3365
3391
|
] }),
|
|
3366
3392
|
w === "country" && /* @__PURE__ */ n(
|
|
3367
|
-
|
|
3393
|
+
G,
|
|
3368
3394
|
{
|
|
3369
3395
|
control: m,
|
|
3370
3396
|
name: `criteriaValueInputs.${N}.values.0`,
|
|
3371
|
-
render: ({ field:
|
|
3372
|
-
var
|
|
3397
|
+
render: ({ field: R }) => {
|
|
3398
|
+
var C, B, z;
|
|
3373
3399
|
return /* @__PURE__ */ n(
|
|
3374
|
-
|
|
3400
|
+
ge,
|
|
3375
3401
|
{
|
|
3376
|
-
...
|
|
3402
|
+
...R,
|
|
3377
3403
|
options: [
|
|
3378
3404
|
{ value: "US", label: "United States" },
|
|
3379
3405
|
{ value: "GB", label: "United Kingdom" },
|
|
@@ -3381,19 +3407,19 @@ const Ur = de.any(), fr = ({
|
|
|
3381
3407
|
// TODO: Load from base information service
|
|
3382
3408
|
],
|
|
3383
3409
|
placeholder: "Select a country...",
|
|
3384
|
-
error: (z = (B = (
|
|
3410
|
+
error: (z = (B = (C = y.criteriaValueInputs) == null ? void 0 : C[N]) == null ? void 0 : B.values) == null ? void 0 : z.message
|
|
3385
3411
|
}
|
|
3386
3412
|
);
|
|
3387
3413
|
}
|
|
3388
3414
|
}
|
|
3389
3415
|
),
|
|
3390
|
-
((
|
|
3416
|
+
((L = (P = (I = y.criteriaValueInputs) == null ? void 0 : I[N]) == null ? void 0 : P.values) == null ? void 0 : L.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: y.criteriaValueInputs[N].values.message })
|
|
3391
3417
|
] }, h.id);
|
|
3392
3418
|
}) }),
|
|
3393
3419
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3394
|
-
r && /* @__PURE__ */ n(
|
|
3420
|
+
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3395
3421
|
/* @__PURE__ */ n(
|
|
3396
|
-
|
|
3422
|
+
j,
|
|
3397
3423
|
{
|
|
3398
3424
|
type: "submit",
|
|
3399
3425
|
isLoading: i,
|
|
@@ -3409,14 +3435,14 @@ const Ur = de.any(), fr = ({
|
|
|
3409
3435
|
c.message
|
|
3410
3436
|
] }) })
|
|
3411
3437
|
] }) }) : null;
|
|
3412
|
-
},
|
|
3438
|
+
}, Sr = ({
|
|
3413
3439
|
applicantId: t,
|
|
3414
3440
|
onComplete: e,
|
|
3415
3441
|
onBack: r
|
|
3416
3442
|
}) => {
|
|
3417
|
-
const { investorCategorizationService:
|
|
3443
|
+
const { investorCategorizationService: s } = re(), [a, i] = x(null), [c, l] = x(!1), [d, u] = x(null);
|
|
3418
3444
|
return /* @__PURE__ */ n("form", { onSubmit: async (p) => {
|
|
3419
|
-
if (p.preventDefault(),
|
|
3445
|
+
if (p.preventDefault(), a === null) {
|
|
3420
3446
|
u("Please select an investor type");
|
|
3421
3447
|
return;
|
|
3422
3448
|
}
|
|
@@ -3424,29 +3450,29 @@ const Ur = de.any(), fr = ({
|
|
|
3424
3450
|
try {
|
|
3425
3451
|
const m = {
|
|
3426
3452
|
applicantId: t,
|
|
3427
|
-
investorType:
|
|
3453
|
+
investorType: a
|
|
3428
3454
|
};
|
|
3429
3455
|
console.log("Submitting investor categorization:", m);
|
|
3430
|
-
const
|
|
3431
|
-
console.log("Investor categorization result:",
|
|
3456
|
+
const f = await s.setInvestorCategorization(m);
|
|
3457
|
+
console.log("Investor categorization result:", f), e == null || e();
|
|
3432
3458
|
} catch (m) {
|
|
3433
3459
|
console.error("Error submitting investor categorization:", m), u(m.message || "Failed to submit investor categorization");
|
|
3434
3460
|
} finally {
|
|
3435
3461
|
l(!1);
|
|
3436
3462
|
}
|
|
3437
|
-
}, children: /* @__PURE__ */ o(
|
|
3438
|
-
/* @__PURE__ */ o(
|
|
3463
|
+
}, children: /* @__PURE__ */ o(T, { children: [
|
|
3464
|
+
/* @__PURE__ */ o(J, { children: [
|
|
3439
3465
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
3440
3466
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
|
|
3441
3467
|
] }),
|
|
3442
|
-
/* @__PURE__ */ o(
|
|
3468
|
+
/* @__PURE__ */ o(M, { className: "space-y-4", children: [
|
|
3443
3469
|
/* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
|
|
3444
3470
|
/* @__PURE__ */ n(
|
|
3445
3471
|
"label",
|
|
3446
3472
|
{
|
|
3447
3473
|
className: `
|
|
3448
3474
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3449
|
-
${
|
|
3475
|
+
${a === ee.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3450
3476
|
`,
|
|
3451
3477
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3452
3478
|
/* @__PURE__ */ n(
|
|
@@ -3454,9 +3480,9 @@ const Ur = de.any(), fr = ({
|
|
|
3454
3480
|
{
|
|
3455
3481
|
type: "radio",
|
|
3456
3482
|
name: "investorType",
|
|
3457
|
-
value:
|
|
3458
|
-
checked:
|
|
3459
|
-
onChange: () => i(
|
|
3483
|
+
value: ee.Individual,
|
|
3484
|
+
checked: a === ee.Individual,
|
|
3485
|
+
onChange: () => i(ee.Individual),
|
|
3460
3486
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3461
3487
|
}
|
|
3462
3488
|
),
|
|
@@ -3472,7 +3498,7 @@ const Ur = de.any(), fr = ({
|
|
|
3472
3498
|
{
|
|
3473
3499
|
className: `
|
|
3474
3500
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3475
|
-
${
|
|
3501
|
+
${a === ee.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3476
3502
|
`,
|
|
3477
3503
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3478
3504
|
/* @__PURE__ */ n(
|
|
@@ -3480,9 +3506,9 @@ const Ur = de.any(), fr = ({
|
|
|
3480
3506
|
{
|
|
3481
3507
|
type: "radio",
|
|
3482
3508
|
name: "investorType",
|
|
3483
|
-
value:
|
|
3484
|
-
checked:
|
|
3485
|
-
onChange: () => i(
|
|
3509
|
+
value: ee.Sophisticated,
|
|
3510
|
+
checked: a === ee.Sophisticated,
|
|
3511
|
+
onChange: () => i(ee.Sophisticated),
|
|
3486
3512
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3487
3513
|
}
|
|
3488
3514
|
),
|
|
@@ -3503,7 +3529,7 @@ const Ur = de.any(), fr = ({
|
|
|
3503
3529
|
{
|
|
3504
3530
|
className: `
|
|
3505
3531
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3506
|
-
${
|
|
3532
|
+
${a === ee.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3507
3533
|
`,
|
|
3508
3534
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3509
3535
|
/* @__PURE__ */ n(
|
|
@@ -3511,9 +3537,9 @@ const Ur = de.any(), fr = ({
|
|
|
3511
3537
|
{
|
|
3512
3538
|
type: "radio",
|
|
3513
3539
|
name: "investorType",
|
|
3514
|
-
value:
|
|
3515
|
-
checked:
|
|
3516
|
-
onChange: () => i(
|
|
3540
|
+
value: ee.HighNetWorth,
|
|
3541
|
+
checked: a === ee.HighNetWorth,
|
|
3542
|
+
onChange: () => i(ee.HighNetWorth),
|
|
3517
3543
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3518
3544
|
}
|
|
3519
3545
|
),
|
|
@@ -3535,32 +3561,32 @@ const Ur = de.any(), fr = ({
|
|
|
3535
3561
|
] }) })
|
|
3536
3562
|
] }),
|
|
3537
3563
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3538
|
-
r && /* @__PURE__ */ n(
|
|
3564
|
+
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3539
3565
|
/* @__PURE__ */ n(
|
|
3540
|
-
|
|
3566
|
+
j,
|
|
3541
3567
|
{
|
|
3542
3568
|
type: "submit",
|
|
3543
3569
|
isLoading: c,
|
|
3544
|
-
disabled:
|
|
3570
|
+
disabled: a === null,
|
|
3545
3571
|
children: "Submit"
|
|
3546
3572
|
}
|
|
3547
3573
|
)
|
|
3548
3574
|
] })
|
|
3549
3575
|
] }) });
|
|
3550
|
-
},
|
|
3576
|
+
}, Cr = ({
|
|
3551
3577
|
applicantId: t,
|
|
3552
3578
|
onComplete: e,
|
|
3553
3579
|
onBack: r
|
|
3554
3580
|
}) => {
|
|
3555
|
-
const { appropriatenessTestService:
|
|
3581
|
+
const { appropriatenessTestService: s } = re(), [a, i] = x(null), [c, l] = x(!0), [d, u] = x(!1), [g, p] = x(null), [m, f] = x({}), [y, b] = x(0), [F, h] = x(!1), [N, w] = x(!1), [I, P] = x(0);
|
|
3556
3582
|
V(() => {
|
|
3557
3583
|
(async () => {
|
|
3558
3584
|
try {
|
|
3559
3585
|
l(!0), p(null), console.log("Loading appropriateness test for applicant:", t);
|
|
3560
|
-
const k = await
|
|
3586
|
+
const k = await s.getAppropriatenessTest(t);
|
|
3561
3587
|
if (console.log("Appropriateness test data:", k), i(k), k.waitTimeSpanForNextTry && k.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3562
|
-
const S =
|
|
3563
|
-
S > 0 &&
|
|
3588
|
+
const S = L(k.waitTimeSpanForNextTry);
|
|
3589
|
+
S > 0 && P(S);
|
|
3564
3590
|
}
|
|
3565
3591
|
} catch (k) {
|
|
3566
3592
|
console.error("Error loading appropriateness test:", k), p(k.message || "Failed to load appropriateness test");
|
|
@@ -3568,44 +3594,44 @@ const Ur = de.any(), fr = ({
|
|
|
3568
3594
|
l(!1);
|
|
3569
3595
|
}
|
|
3570
3596
|
})();
|
|
3571
|
-
}, [t,
|
|
3572
|
-
const
|
|
3573
|
-
const k =
|
|
3597
|
+
}, [t, s]);
|
|
3598
|
+
const L = (A) => {
|
|
3599
|
+
const k = A.split(":").map(Number);
|
|
3574
3600
|
if (k.length === 3) {
|
|
3575
|
-
const [S,
|
|
3576
|
-
return S * 3600 +
|
|
3601
|
+
const [S, _, oe] = k;
|
|
3602
|
+
return S * 3600 + _ * 60 + oe;
|
|
3577
3603
|
}
|
|
3578
3604
|
return 0;
|
|
3579
|
-
},
|
|
3580
|
-
const k = Math.floor(
|
|
3605
|
+
}, R = (A) => {
|
|
3606
|
+
const k = Math.floor(A / 60), S = A % 60;
|
|
3581
3607
|
return `${k.toString().padStart(2, "0")}:${S.toString().padStart(2, "0")}`;
|
|
3582
3608
|
};
|
|
3583
3609
|
V(() => {
|
|
3584
|
-
if (!
|
|
3585
|
-
const
|
|
3586
|
-
|
|
3610
|
+
if (!F || y <= 0) return;
|
|
3611
|
+
const A = setInterval(() => {
|
|
3612
|
+
b((k) => k <= 1 ? (w(!0), 0) : k - 1);
|
|
3587
3613
|
}, 1e3);
|
|
3588
|
-
return () => clearInterval(
|
|
3589
|
-
}, [
|
|
3590
|
-
if (
|
|
3591
|
-
const
|
|
3592
|
-
|
|
3614
|
+
return () => clearInterval(A);
|
|
3615
|
+
}, [F, y]), V(() => {
|
|
3616
|
+
if (I <= 0) return;
|
|
3617
|
+
const A = setInterval(() => {
|
|
3618
|
+
P((k) => k <= 1 ? 0 : k - 1);
|
|
3593
3619
|
}, 1e3);
|
|
3594
|
-
return () => clearInterval(
|
|
3595
|
-
}, [
|
|
3620
|
+
return () => clearInterval(A);
|
|
3621
|
+
}, [I]), V(() => {
|
|
3596
3622
|
N && !d && z();
|
|
3597
3623
|
}, [N]);
|
|
3598
|
-
const
|
|
3599
|
-
|
|
3600
|
-
}, B = (
|
|
3601
|
-
|
|
3624
|
+
const C = () => {
|
|
3625
|
+
a && (h(!0), b(a.testDurationSec));
|
|
3626
|
+
}, B = (A, k) => {
|
|
3627
|
+
f((S) => ({
|
|
3602
3628
|
...S,
|
|
3603
|
-
[
|
|
3629
|
+
[A]: k
|
|
3604
3630
|
}));
|
|
3605
|
-
}, z = async (
|
|
3606
|
-
if (
|
|
3631
|
+
}, z = async (A) => {
|
|
3632
|
+
if (A && A.preventDefault(), !!a) {
|
|
3607
3633
|
if (!N) {
|
|
3608
|
-
const k =
|
|
3634
|
+
const k = a.appropriatenessQuestions.length - Object.keys(m).length;
|
|
3609
3635
|
if (k > 0) {
|
|
3610
3636
|
p(`Please answer all questions. ${k} question(s) remaining.`);
|
|
3611
3637
|
return;
|
|
@@ -3613,105 +3639,105 @@ const Ur = de.any(), fr = ({
|
|
|
3613
3639
|
}
|
|
3614
3640
|
u(!0), p(null);
|
|
3615
3641
|
try {
|
|
3616
|
-
const k =
|
|
3617
|
-
(
|
|
3618
|
-
appropriatenessQuestionId:
|
|
3619
|
-
value: m[
|
|
3642
|
+
const k = a.appropriatenessQuestions.map(
|
|
3643
|
+
(_) => ({
|
|
3644
|
+
appropriatenessQuestionId: _.id,
|
|
3645
|
+
value: m[_.id] || ""
|
|
3620
3646
|
// Empty string if not answered
|
|
3621
3647
|
})
|
|
3622
3648
|
), S = {
|
|
3623
3649
|
applicantId: t,
|
|
3624
|
-
appropriatenessTestId:
|
|
3650
|
+
appropriatenessTestId: a.id,
|
|
3625
3651
|
appropriatenessQuestionResults: k
|
|
3626
3652
|
};
|
|
3627
3653
|
console.log("Submitting appropriateness test:", S);
|
|
3628
3654
|
try {
|
|
3629
|
-
const
|
|
3630
|
-
console.log("Appropriateness test result:",
|
|
3631
|
-
} catch (
|
|
3632
|
-
if (
|
|
3633
|
-
const oe =
|
|
3634
|
-
console.log("Test failed:", oe), p(oe), h(!1), w(!1),
|
|
3655
|
+
const _ = await s.fillAppropriatenessTest(S);
|
|
3656
|
+
console.log("Appropriateness test result:", _), _.message && (_.message.toLowerCase().includes("pass") || _.message.toLowerCase().includes("success") || _.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p(_.message || "Test completed. Please check the result."), h(!1), w(!1), f({}), setTimeout(() => v(), 1e3));
|
|
3657
|
+
} catch (_) {
|
|
3658
|
+
if (_.code === 400 && _.message) {
|
|
3659
|
+
const oe = _.message;
|
|
3660
|
+
console.log("Test failed:", oe), p(oe), h(!1), w(!1), f({}), setTimeout(() => v(), 1500);
|
|
3635
3661
|
} else
|
|
3636
|
-
throw
|
|
3662
|
+
throw _;
|
|
3637
3663
|
}
|
|
3638
3664
|
} catch (k) {
|
|
3639
|
-
console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), h(!1), w(!1),
|
|
3665
|
+
console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), h(!1), w(!1), f({});
|
|
3640
3666
|
} finally {
|
|
3641
3667
|
u(!1);
|
|
3642
3668
|
}
|
|
3643
3669
|
}
|
|
3644
|
-
},
|
|
3670
|
+
}, v = async () => {
|
|
3645
3671
|
try {
|
|
3646
|
-
const
|
|
3647
|
-
if (console.log("Reloaded test data:",
|
|
3648
|
-
const k =
|
|
3649
|
-
k > 0 &&
|
|
3672
|
+
const A = await s.getAppropriatenessTest(t);
|
|
3673
|
+
if (console.log("Reloaded test data:", A), i(A), A.waitTimeSpanForNextTry && A.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3674
|
+
const k = L(A.waitTimeSpanForNextTry);
|
|
3675
|
+
k > 0 && P(k);
|
|
3650
3676
|
}
|
|
3651
|
-
} catch (
|
|
3652
|
-
console.error("Error reloading test data:",
|
|
3677
|
+
} catch (A) {
|
|
3678
|
+
console.error("Error reloading test data:", A), p((k) => k + `
|
|
3653
3679
|
|
|
3654
3680
|
Failed to reload test data. Please refresh the page.`);
|
|
3655
3681
|
}
|
|
3656
3682
|
};
|
|
3657
3683
|
if (c)
|
|
3658
|
-
return /* @__PURE__ */ n(
|
|
3659
|
-
/* @__PURE__ */ n(
|
|
3684
|
+
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
3685
|
+
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
3660
3686
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
3661
3687
|
] }) });
|
|
3662
|
-
if (!
|
|
3663
|
-
return /* @__PURE__ */ n(
|
|
3688
|
+
if (!a)
|
|
3689
|
+
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
|
|
3664
3690
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
3665
3691
|
g && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g })
|
|
3666
3692
|
] }) });
|
|
3667
|
-
if (
|
|
3668
|
-
return /* @__PURE__ */ o(
|
|
3669
|
-
/* @__PURE__ */ o(
|
|
3670
|
-
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children:
|
|
3671
|
-
|
|
3693
|
+
if (I > 0)
|
|
3694
|
+
return /* @__PURE__ */ o(T, { children: [
|
|
3695
|
+
/* @__PURE__ */ o(J, { children: [
|
|
3696
|
+
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
|
|
3697
|
+
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
|
|
3672
3698
|
] }),
|
|
3673
|
-
/* @__PURE__ */ o(
|
|
3699
|
+
/* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
|
|
3674
3700
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3675
|
-
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: I
|
|
3701
|
+
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: R(I) }),
|
|
3676
3702
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
3677
3703
|
] }),
|
|
3678
3704
|
g && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: g }) })
|
|
3679
3705
|
] })
|
|
3680
3706
|
] });
|
|
3681
|
-
const
|
|
3682
|
-
return
|
|
3683
|
-
/* @__PURE__ */ n(
|
|
3707
|
+
const E = a.testAllowedMaxTry - a.totalFailedTries;
|
|
3708
|
+
return F ? /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(T, { children: [
|
|
3709
|
+
/* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
3684
3710
|
/* @__PURE__ */ o("div", { children: [
|
|
3685
|
-
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children:
|
|
3686
|
-
|
|
3711
|
+
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
|
|
3712
|
+
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3687
3713
|
] }),
|
|
3688
3714
|
/* @__PURE__ */ o("div", { className: "text-right", children: [
|
|
3689
3715
|
/* @__PURE__ */ n(
|
|
3690
3716
|
"div",
|
|
3691
3717
|
{
|
|
3692
3718
|
className: `text-3xl font-bold ${y <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
3693
|
-
children:
|
|
3719
|
+
children: R(y)
|
|
3694
3720
|
}
|
|
3695
3721
|
),
|
|
3696
3722
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
3697
3723
|
] })
|
|
3698
3724
|
] }) }),
|
|
3699
|
-
/* @__PURE__ */ o(
|
|
3725
|
+
/* @__PURE__ */ o(M, { className: "space-y-6", children: [
|
|
3700
3726
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
3701
|
-
/* @__PURE__ */ o(
|
|
3727
|
+
/* @__PURE__ */ o(me, { variant: "info", children: [
|
|
3702
3728
|
"Question ",
|
|
3703
3729
|
Object.keys(m).length,
|
|
3704
3730
|
" of ",
|
|
3705
|
-
|
|
3731
|
+
a.totalQuestionCount
|
|
3706
3732
|
] }),
|
|
3707
|
-
/* @__PURE__ */ o(
|
|
3708
|
-
|
|
3733
|
+
/* @__PURE__ */ o(me, { variant: E > 1 ? "success" : "warning", children: [
|
|
3734
|
+
E,
|
|
3709
3735
|
" attempt",
|
|
3710
|
-
|
|
3736
|
+
E !== 1 ? "s" : "",
|
|
3711
3737
|
" remaining"
|
|
3712
3738
|
] })
|
|
3713
3739
|
] }),
|
|
3714
|
-
|
|
3740
|
+
a.appropriatenessQuestions.map((A, k) => /* @__PURE__ */ o(
|
|
3715
3741
|
"div",
|
|
3716
3742
|
{
|
|
3717
3743
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -3721,25 +3747,25 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3721
3747
|
"Question ",
|
|
3722
3748
|
k + 1
|
|
3723
3749
|
] }),
|
|
3724
|
-
|
|
3725
|
-
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children:
|
|
3750
|
+
A.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: A.groupName }),
|
|
3751
|
+
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: A.question })
|
|
3726
3752
|
] }),
|
|
3727
|
-
/* @__PURE__ */ n("div", { className: "space-y-2", children:
|
|
3753
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: A.answers.map((S, _) => /* @__PURE__ */ o(
|
|
3728
3754
|
"label",
|
|
3729
3755
|
{
|
|
3730
3756
|
className: `
|
|
3731
3757
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
3732
|
-
${m[
|
|
3758
|
+
${m[A.id] === S ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3733
3759
|
`,
|
|
3734
3760
|
children: [
|
|
3735
3761
|
/* @__PURE__ */ n(
|
|
3736
3762
|
"input",
|
|
3737
3763
|
{
|
|
3738
3764
|
type: "radio",
|
|
3739
|
-
name: `question-${
|
|
3765
|
+
name: `question-${A.id}`,
|
|
3740
3766
|
value: S,
|
|
3741
|
-
checked: m[
|
|
3742
|
-
onChange: (oe) => B(
|
|
3767
|
+
checked: m[A.id] === S,
|
|
3768
|
+
onChange: (oe) => B(A.id, oe.target.value),
|
|
3743
3769
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
3744
3770
|
disabled: d
|
|
3745
3771
|
}
|
|
@@ -3747,11 +3773,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3747
3773
|
/* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: S })
|
|
3748
3774
|
]
|
|
3749
3775
|
},
|
|
3750
|
-
|
|
3776
|
+
_
|
|
3751
3777
|
)) })
|
|
3752
3778
|
]
|
|
3753
3779
|
},
|
|
3754
|
-
|
|
3780
|
+
A.id
|
|
3755
3781
|
)),
|
|
3756
3782
|
g && !N && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
3757
3783
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
@@ -3765,7 +3791,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3765
3791
|
] }),
|
|
3766
3792
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3767
3793
|
/* @__PURE__ */ n(
|
|
3768
|
-
|
|
3794
|
+
j,
|
|
3769
3795
|
{
|
|
3770
3796
|
type: "button",
|
|
3771
3797
|
variant: "outline",
|
|
@@ -3775,38 +3801,38 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3775
3801
|
}
|
|
3776
3802
|
),
|
|
3777
3803
|
/* @__PURE__ */ n(
|
|
3778
|
-
|
|
3804
|
+
j,
|
|
3779
3805
|
{
|
|
3780
3806
|
type: "submit",
|
|
3781
3807
|
isLoading: d,
|
|
3782
|
-
disabled: Object.keys(m).length <
|
|
3808
|
+
disabled: Object.keys(m).length < a.totalQuestionCount,
|
|
3783
3809
|
children: N ? "Submitting..." : "Submit Test"
|
|
3784
3810
|
}
|
|
3785
3811
|
)
|
|
3786
3812
|
] })
|
|
3787
|
-
] }) }) : /* @__PURE__ */ o(
|
|
3788
|
-
/* @__PURE__ */ o(
|
|
3789
|
-
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children:
|
|
3790
|
-
|
|
3813
|
+
] }) }) : /* @__PURE__ */ o(T, { children: [
|
|
3814
|
+
/* @__PURE__ */ o(J, { children: [
|
|
3815
|
+
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
|
|
3816
|
+
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
|
|
3791
3817
|
] }),
|
|
3792
|
-
/* @__PURE__ */ o(
|
|
3793
|
-
|
|
3818
|
+
/* @__PURE__ */ o(M, { children: [
|
|
3819
|
+
a.description && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-gray-700 dark:text-gray-300", children: a.description }) }),
|
|
3794
3820
|
/* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
3795
3821
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3796
3822
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
3797
|
-
/* @__PURE__ */ n(
|
|
3823
|
+
/* @__PURE__ */ n(me, { variant: "info", children: a.totalQuestionCount })
|
|
3798
3824
|
] }),
|
|
3799
3825
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3800
3826
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
3801
|
-
/* @__PURE__ */ n(
|
|
3827
|
+
/* @__PURE__ */ n(me, { variant: "info", children: R(a.testDurationSec) })
|
|
3802
3828
|
] }),
|
|
3803
3829
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3804
3830
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
3805
|
-
/* @__PURE__ */ n(
|
|
3831
|
+
/* @__PURE__ */ n(me, { variant: "info", children: a.testCorrectAnswerPassLimit })
|
|
3806
3832
|
] }),
|
|
3807
3833
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
3808
3834
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
3809
|
-
/* @__PURE__ */ n(
|
|
3835
|
+
/* @__PURE__ */ n(me, { variant: E > 1 ? "success" : "warning", children: E })
|
|
3810
3836
|
] })
|
|
3811
3837
|
] }),
|
|
3812
3838
|
g && /* @__PURE__ */ n("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -3814,28 +3840,28 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3814
3840
|
" ",
|
|
3815
3841
|
g
|
|
3816
3842
|
] }) }),
|
|
3817
|
-
|
|
3843
|
+
E <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
3818
3844
|
] }),
|
|
3819
3845
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
3820
|
-
r && /* @__PURE__ */ n(
|
|
3846
|
+
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3821
3847
|
/* @__PURE__ */ n(
|
|
3822
|
-
|
|
3848
|
+
j,
|
|
3823
3849
|
{
|
|
3824
3850
|
type: "button",
|
|
3825
|
-
onClick:
|
|
3826
|
-
disabled:
|
|
3851
|
+
onClick: C,
|
|
3852
|
+
disabled: E <= 0,
|
|
3827
3853
|
children: "Start Test"
|
|
3828
3854
|
}
|
|
3829
3855
|
)
|
|
3830
3856
|
] })
|
|
3831
3857
|
] });
|
|
3832
|
-
},
|
|
3858
|
+
}, Ar = ({
|
|
3833
3859
|
applicantId: t,
|
|
3834
3860
|
onComplete: e,
|
|
3835
3861
|
onBack: r
|
|
3836
3862
|
}) => {
|
|
3837
|
-
var
|
|
3838
|
-
const { applicantService:
|
|
3863
|
+
var S, _, oe, Fe;
|
|
3864
|
+
const { applicantService: s, baseInformationService: a, config: i } = re(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = er(t), [f, y] = x(null), [b, F] = x(null), [h, N] = x([]), [w, I] = x(!0), [P, L] = x(!1), [R, C] = x(null), [B, z] = x(!1), v = le.useRef(!1), E = Pe({
|
|
3839
3865
|
defaultValues: {
|
|
3840
3866
|
street: "",
|
|
3841
3867
|
streetNumber: "",
|
|
@@ -3849,18 +3875,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3849
3875
|
V(() => {
|
|
3850
3876
|
(async () => {
|
|
3851
3877
|
try {
|
|
3852
|
-
const [
|
|
3853
|
-
|
|
3854
|
-
|
|
3878
|
+
const [D, W] = await Promise.all([
|
|
3879
|
+
s.getApplicantData(t),
|
|
3880
|
+
a.getCountries("", "en")
|
|
3855
3881
|
]);
|
|
3856
|
-
|
|
3857
|
-
const H = /* @__PURE__ */ new Set(),
|
|
3858
|
-
const
|
|
3859
|
-
return !
|
|
3882
|
+
F(D);
|
|
3883
|
+
const H = /* @__PURE__ */ new Set(), ne = W.filter((ue) => {
|
|
3884
|
+
const Se = ue.abbreviation3 || ue.abbreviation;
|
|
3885
|
+
return !Se || H.has(Se) ? !1 : (H.add(Se), !0);
|
|
3860
3886
|
});
|
|
3861
|
-
N(
|
|
3862
|
-
const $ =
|
|
3863
|
-
if (
|
|
3887
|
+
N(ne);
|
|
3888
|
+
const $ = D.applicantRequestData;
|
|
3889
|
+
if (E.reset({
|
|
3864
3890
|
street: ($ == null ? void 0 : $.street) || "",
|
|
3865
3891
|
streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
|
|
3866
3892
|
city: ($ == null ? void 0 : $.city) || "",
|
|
@@ -3868,73 +3894,75 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3868
3894
|
country: ($ == null ? void 0 : $.country) || "",
|
|
3869
3895
|
nationality: ($ == null ? void 0 : $.nationality) || "",
|
|
3870
3896
|
phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
|
|
3871
|
-
}),
|
|
3872
|
-
console.log("[Identity]
|
|
3897
|
+
}), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !v.current) {
|
|
3898
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), v.current = !0;
|
|
3873
3899
|
try {
|
|
3874
|
-
await p(),
|
|
3875
|
-
} catch (
|
|
3876
|
-
console.error("[Identity] Auto-request failed:",
|
|
3900
|
+
await p(), L(!0);
|
|
3901
|
+
} catch (ue) {
|
|
3902
|
+
console.error("[Identity] Auto-request failed:", ue);
|
|
3877
3903
|
}
|
|
3878
3904
|
}
|
|
3879
|
-
} catch (
|
|
3880
|
-
console.error("Error loading applicant data:",
|
|
3905
|
+
} catch (D) {
|
|
3906
|
+
console.error("Error loading applicant data:", D);
|
|
3881
3907
|
} finally {
|
|
3882
|
-
|
|
3908
|
+
I(!1);
|
|
3883
3909
|
}
|
|
3884
3910
|
})();
|
|
3885
|
-
}, [t,
|
|
3911
|
+
}, [t, s, a, E, p]), V(() => {
|
|
3912
|
+
c && !P && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
|
|
3913
|
+
}, [c, P]), V(() => {
|
|
3886
3914
|
if (d) {
|
|
3887
3915
|
if (d.expiresAt) {
|
|
3888
3916
|
const O = new Date(d.expiresAt).getTime();
|
|
3889
3917
|
if (Date.now() >= O) {
|
|
3890
|
-
console.warn("[Identity] Token has expired (expiresAt)"), z(!0),
|
|
3918
|
+
console.warn("[Identity] Token has expired (expiresAt)"), z(!0), C("Your verification session has expired. Please restart.");
|
|
3891
3919
|
return;
|
|
3892
3920
|
}
|
|
3893
3921
|
}
|
|
3894
3922
|
if (d.url)
|
|
3895
3923
|
try {
|
|
3896
|
-
const
|
|
3897
|
-
if (
|
|
3898
|
-
console.warn("[Identity] Token URL indicates expiration"), z(!0),
|
|
3924
|
+
const D = new URL(d.url).toString().toLowerCase();
|
|
3925
|
+
if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
|
|
3926
|
+
console.warn("[Identity] Token URL indicates expiration"), z(!0), C("Your verification link has expired. Please restart.");
|
|
3899
3927
|
return;
|
|
3900
3928
|
}
|
|
3901
3929
|
} catch {
|
|
3902
3930
|
console.error("[Identity] Invalid token URL");
|
|
3903
3931
|
}
|
|
3904
3932
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
3905
|
-
console.warn("[Identity] Token object indicates expiration"), z(!0),
|
|
3933
|
+
console.warn("[Identity] Token object indicates expiration"), z(!0), C("Your verification session has expired. Please restart.");
|
|
3906
3934
|
return;
|
|
3907
3935
|
}
|
|
3908
3936
|
}
|
|
3909
3937
|
}, [d]), V(() => {
|
|
3910
|
-
if (l !== null && d && !
|
|
3938
|
+
if (l !== null && d && !f && P && !B) {
|
|
3911
3939
|
const O = l;
|
|
3912
3940
|
if (d.url) {
|
|
3913
|
-
console.log("[Identity] Loading provider URL for user verification:", d.url),
|
|
3941
|
+
console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
|
|
3914
3942
|
try {
|
|
3915
|
-
if (new URL(d.url), O ===
|
|
3943
|
+
if (new URL(d.url), O === se.SardinAI) {
|
|
3916
3944
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
3917
3945
|
try {
|
|
3918
|
-
const
|
|
3919
|
-
|
|
3946
|
+
const D = ye.parseProviderConfig(l, d, i);
|
|
3947
|
+
ye.createProvider(l, D).initialize().then(() => {
|
|
3920
3948
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
3921
3949
|
}).catch((H) => {
|
|
3922
3950
|
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", H);
|
|
3923
3951
|
});
|
|
3924
|
-
} catch (
|
|
3925
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
3952
|
+
} catch (D) {
|
|
3953
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
|
|
3926
3954
|
}
|
|
3927
3955
|
}
|
|
3928
3956
|
y({ type: "url", url: d.url });
|
|
3929
|
-
} catch (
|
|
3930
|
-
console.error("[Identity] Invalid URL:",
|
|
3957
|
+
} catch (D) {
|
|
3958
|
+
console.error("[Identity] Invalid URL:", D), C("Invalid verification URL. Please restart."), z(!0);
|
|
3931
3959
|
}
|
|
3932
3960
|
return;
|
|
3933
3961
|
}
|
|
3934
|
-
if (O ===
|
|
3935
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
3962
|
+
if (O === se.SardinAI) {
|
|
3963
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), C(null);
|
|
3936
3964
|
try {
|
|
3937
|
-
const
|
|
3965
|
+
const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
|
|
3938
3966
|
W.initialize().then(() => {
|
|
3939
3967
|
console.log("[SardinAI] Risk SDK initialized successfully"), y(W), setTimeout(() => {
|
|
3940
3968
|
e == null || e();
|
|
@@ -3942,65 +3970,65 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3942
3970
|
}).catch((H) => {
|
|
3943
3971
|
var $;
|
|
3944
3972
|
console.error("[SardinAI] Failed to initialize:", H);
|
|
3945
|
-
const
|
|
3946
|
-
|
|
3973
|
+
const ne = (($ = H.message) == null ? void 0 : $.toLowerCase()) || "";
|
|
3974
|
+
ne.includes("expired") || ne.includes("invalid") || ne.includes("401") || ne.includes("400") ? (z(!0), C("Session expired or invalid. Please restart verification.")) : C(`Failed to initialize: ${H.message}`);
|
|
3947
3975
|
});
|
|
3948
|
-
} catch (
|
|
3949
|
-
console.error("[SardinAI] Error creating provider:",
|
|
3976
|
+
} catch (D) {
|
|
3977
|
+
console.error("[SardinAI] Error creating provider:", D), C(`Configuration error: ${D.message}`);
|
|
3950
3978
|
}
|
|
3951
3979
|
return;
|
|
3952
3980
|
}
|
|
3953
3981
|
try {
|
|
3954
|
-
|
|
3955
|
-
const
|
|
3956
|
-
O ===
|
|
3957
|
-
var
|
|
3958
|
-
console.error("[Sumsub] Initialization error:", H),
|
|
3982
|
+
C(null);
|
|
3983
|
+
const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
|
|
3984
|
+
O === se.Sumsub ? (W.initialize("identity-container").catch((H) => {
|
|
3985
|
+
var ne;
|
|
3986
|
+
console.error("[Sumsub] Initialization error:", H), C(`Failed to initialize: ${H.message}`), (ne = H.message) != null && ne.toLowerCase().includes("expired") && z(!0);
|
|
3959
3987
|
}), W.onComplete && W.onComplete(() => {
|
|
3960
3988
|
e == null || e();
|
|
3961
|
-
})) : O ===
|
|
3962
|
-
console.error("[Onfido] Initialization error:", H),
|
|
3989
|
+
})) : O === se.Onfido && W.initialize("identity-container").catch((H) => {
|
|
3990
|
+
console.error("[Onfido] Initialization error:", H), C(`Failed to initialize: ${H.message}`);
|
|
3963
3991
|
}), y(W);
|
|
3964
|
-
} catch (
|
|
3965
|
-
console.error("[Identity] Provider setup error:",
|
|
3992
|
+
} catch (D) {
|
|
3993
|
+
console.error("[Identity] Provider setup error:", D), C(`Setup error: ${D.message}`);
|
|
3966
3994
|
}
|
|
3967
3995
|
}
|
|
3968
3996
|
return () => {
|
|
3969
|
-
if (
|
|
3997
|
+
if (f && f.destroy)
|
|
3970
3998
|
try {
|
|
3971
|
-
|
|
3999
|
+
f.destroy();
|
|
3972
4000
|
} catch (O) {
|
|
3973
4001
|
console.error("[Identity] Error destroying provider:", O);
|
|
3974
4002
|
}
|
|
3975
4003
|
};
|
|
3976
|
-
}, [l, d,
|
|
3977
|
-
const
|
|
4004
|
+
}, [l, d, f, P, e, B]);
|
|
4005
|
+
const A = async () => {
|
|
3978
4006
|
try {
|
|
3979
|
-
|
|
4007
|
+
C(null), z(!1), await p(), L(!0);
|
|
3980
4008
|
} catch (O) {
|
|
3981
4009
|
console.error("Error starting identity verification:", O);
|
|
3982
4010
|
}
|
|
3983
|
-
},
|
|
4011
|
+
}, k = async () => {
|
|
3984
4012
|
try {
|
|
3985
|
-
|
|
4013
|
+
C(null), z(!1), y(null), console.log("[Identity] Restarting verification..."), await m(), L(!0);
|
|
3986
4014
|
} catch (O) {
|
|
3987
|
-
console.error("Error restarting identity verification:", O),
|
|
4015
|
+
console.error("Error restarting identity verification:", O), C(O.message || "Failed to restart verification");
|
|
3988
4016
|
}
|
|
3989
4017
|
};
|
|
3990
4018
|
if (w || u)
|
|
3991
|
-
return /* @__PURE__ */ n(
|
|
3992
|
-
/* @__PURE__ */ n(
|
|
4019
|
+
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4020
|
+
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
3993
4021
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
3994
4022
|
] }) });
|
|
3995
4023
|
if (g)
|
|
3996
|
-
return /* @__PURE__ */ n(
|
|
4024
|
+
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3997
4025
|
"Error: ",
|
|
3998
4026
|
g.message
|
|
3999
4027
|
] }) }) });
|
|
4000
|
-
if (
|
|
4001
|
-
return /* @__PURE__ */ o(
|
|
4002
|
-
/* @__PURE__ */ n(
|
|
4003
|
-
/* @__PURE__ */ o(
|
|
4028
|
+
if (P && (R || B))
|
|
4029
|
+
return /* @__PURE__ */ o(T, { children: [
|
|
4030
|
+
/* @__PURE__ */ n(J, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4031
|
+
/* @__PURE__ */ o(M, { children: [
|
|
4004
4032
|
/* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4005
4033
|
/* @__PURE__ */ n(
|
|
4006
4034
|
"svg",
|
|
@@ -4022,7 +4050,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4022
4050
|
),
|
|
4023
4051
|
/* @__PURE__ */ o("div", { children: [
|
|
4024
4052
|
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: B ? "Session Expired" : "Verification Error" }),
|
|
4025
|
-
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4053
|
+
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: R || "Your verification session has expired and needs to be restarted." })
|
|
4026
4054
|
] })
|
|
4027
4055
|
] }) }),
|
|
4028
4056
|
/* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -4035,31 +4063,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4035
4063
|
] })
|
|
4036
4064
|
] }),
|
|
4037
4065
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
4038
|
-
r && /* @__PURE__ */ n(
|
|
4039
|
-
/* @__PURE__ */ n(
|
|
4066
|
+
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4067
|
+
/* @__PURE__ */ n(j, { type: "button", onClick: k, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
|
|
4040
4068
|
] })
|
|
4041
4069
|
] });
|
|
4042
|
-
if (
|
|
4070
|
+
if (P && c) {
|
|
4043
4071
|
const O = l;
|
|
4044
|
-
return d != null && d.url ? /* @__PURE__ */ o(
|
|
4045
|
-
/* @__PURE__ */ n(
|
|
4072
|
+
return d != null && d.url ? /* @__PURE__ */ o(T, { children: [
|
|
4073
|
+
/* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4046
4074
|
/* @__PURE__ */ o("div", { children: [
|
|
4047
4075
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4048
4076
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4049
4077
|
] }),
|
|
4050
4078
|
/* @__PURE__ */ n(
|
|
4051
|
-
|
|
4079
|
+
j,
|
|
4052
4080
|
{
|
|
4053
4081
|
type: "button",
|
|
4054
4082
|
variant: "outline",
|
|
4055
4083
|
size: "sm",
|
|
4056
|
-
onClick:
|
|
4084
|
+
onClick: k,
|
|
4057
4085
|
disabled: u,
|
|
4058
4086
|
children: "Restart"
|
|
4059
4087
|
}
|
|
4060
4088
|
)
|
|
4061
4089
|
] }) }),
|
|
4062
|
-
/* @__PURE__ */ o(
|
|
4090
|
+
/* @__PURE__ */ o(M, { children: [
|
|
4063
4091
|
/* @__PURE__ */ n("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
|
|
4064
4092
|
/* @__PURE__ */ n("strong", { children: "Important:" }),
|
|
4065
4093
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -4071,14 +4099,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4071
4099
|
className: "w-full h-full border-0 rounded-lg",
|
|
4072
4100
|
allow: "camera; microphone; geolocation",
|
|
4073
4101
|
title: "Identity Verification",
|
|
4074
|
-
onLoad: (
|
|
4075
|
-
var W, H,
|
|
4102
|
+
onLoad: (D) => {
|
|
4103
|
+
var W, H, ne;
|
|
4076
4104
|
console.log("[Identity] Iframe loaded");
|
|
4077
4105
|
try {
|
|
4078
|
-
const $ =
|
|
4079
|
-
if (
|
|
4080
|
-
const
|
|
4081
|
-
(
|
|
4106
|
+
const $ = D.target, Ne = $.contentDocument || ((W = $.contentWindow) == null ? void 0 : W.document);
|
|
4107
|
+
if (Ne) {
|
|
4108
|
+
const ue = ((ne = (H = Ne.body) == null ? void 0 : H.textContent) == null ? void 0 : ne.toLowerCase()) || "";
|
|
4109
|
+
(ue.includes("expired") || ue.includes("invalid") || ue.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), C("Your verification link has expired."));
|
|
4082
4110
|
}
|
|
4083
4111
|
} catch {
|
|
4084
4112
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4087,68 +4115,68 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4087
4115
|
}
|
|
4088
4116
|
) })
|
|
4089
4117
|
] }),
|
|
4090
|
-
r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
4091
|
-
] }) : O ===
|
|
4092
|
-
/* @__PURE__ */ o(
|
|
4118
|
+
r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4119
|
+
] }) : O === se.SardinAI ? /* @__PURE__ */ o(T, { children: [
|
|
4120
|
+
/* @__PURE__ */ o(J, { children: [
|
|
4093
4121
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4094
4122
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4095
4123
|
] }),
|
|
4096
|
-
/* @__PURE__ */ n(
|
|
4097
|
-
/* @__PURE__ */ n(
|
|
4124
|
+
/* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
|
|
4125
|
+
/* @__PURE__ */ n(ie, { className: "mb-4" }),
|
|
4098
4126
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4099
4127
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
4100
4128
|
] }) })
|
|
4101
|
-
] }) : /* @__PURE__ */ o(
|
|
4102
|
-
/* @__PURE__ */ o(
|
|
4129
|
+
] }) : /* @__PURE__ */ o(T, { children: [
|
|
4130
|
+
/* @__PURE__ */ o(J, { children: [
|
|
4103
4131
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4104
4132
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4105
4133
|
] }),
|
|
4106
|
-
/* @__PURE__ */ n(
|
|
4107
|
-
r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
4134
|
+
/* @__PURE__ */ n(M, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4135
|
+
r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4108
4136
|
] });
|
|
4109
4137
|
}
|
|
4110
|
-
return /* @__PURE__ */ n("form", { onSubmit:
|
|
4111
|
-
/* @__PURE__ */ o(
|
|
4138
|
+
return /* @__PURE__ */ n("form", { onSubmit: E.handleSubmit(A), children: /* @__PURE__ */ o(T, { children: [
|
|
4139
|
+
/* @__PURE__ */ o(J, { children: [
|
|
4112
4140
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
|
|
4113
4141
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
4114
4142
|
] }),
|
|
4115
|
-
/* @__PURE__ */ o(
|
|
4143
|
+
/* @__PURE__ */ o(M, { className: "space-y-6", children: [
|
|
4116
4144
|
/* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
|
|
4117
4145
|
/* @__PURE__ */ o("div", { children: [
|
|
4118
4146
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4119
4147
|
/* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
|
|
4120
|
-
(
|
|
4148
|
+
(S = b == null ? void 0 : b.applicantRequestData) == null ? void 0 : S.firstName,
|
|
4121
4149
|
" ",
|
|
4122
|
-
(
|
|
4150
|
+
(_ = b == null ? void 0 : b.applicantRequestData) == null ? void 0 : _.lastName
|
|
4123
4151
|
] })
|
|
4124
4152
|
] }),
|
|
4125
4153
|
/* @__PURE__ */ o("div", { children: [
|
|
4126
4154
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4127
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (
|
|
4155
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (oe = b == null ? void 0 : b.applicantRequestData) == null ? void 0 : oe.email })
|
|
4128
4156
|
] }),
|
|
4129
4157
|
/* @__PURE__ */ o("div", { children: [
|
|
4130
4158
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4131
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((
|
|
4159
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((Fe = b == null ? void 0 : b.applicantRequestData) == null ? void 0 : Fe.dateOfBirth) || "Not provided" })
|
|
4132
4160
|
] })
|
|
4133
4161
|
] }),
|
|
4134
4162
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
4135
4163
|
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
|
|
4136
4164
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4137
4165
|
/* @__PURE__ */ n(
|
|
4138
|
-
|
|
4166
|
+
G,
|
|
4139
4167
|
{
|
|
4140
|
-
control:
|
|
4168
|
+
control: E.control,
|
|
4141
4169
|
name: "country",
|
|
4142
4170
|
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4143
|
-
|
|
4171
|
+
ge,
|
|
4144
4172
|
{
|
|
4145
4173
|
...O,
|
|
4146
4174
|
label: "Country",
|
|
4147
4175
|
options: [
|
|
4148
4176
|
{ value: "", label: "Select country..." },
|
|
4149
|
-
...h.map((
|
|
4150
|
-
value:
|
|
4151
|
-
label:
|
|
4177
|
+
...h.map((D) => ({
|
|
4178
|
+
value: D.abbreviation3 || D.abbreviation,
|
|
4179
|
+
label: D.name
|
|
4152
4180
|
}))
|
|
4153
4181
|
]
|
|
4154
4182
|
}
|
|
@@ -4156,20 +4184,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4156
4184
|
}
|
|
4157
4185
|
),
|
|
4158
4186
|
/* @__PURE__ */ n(
|
|
4159
|
-
|
|
4187
|
+
G,
|
|
4160
4188
|
{
|
|
4161
|
-
control:
|
|
4189
|
+
control: E.control,
|
|
4162
4190
|
name: "nationality",
|
|
4163
4191
|
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4164
|
-
|
|
4192
|
+
ge,
|
|
4165
4193
|
{
|
|
4166
4194
|
...O,
|
|
4167
4195
|
label: "Nationality",
|
|
4168
4196
|
options: [
|
|
4169
4197
|
{ value: "", label: "Select nationality..." },
|
|
4170
|
-
...h.map((
|
|
4171
|
-
value:
|
|
4172
|
-
label:
|
|
4198
|
+
...h.map((D) => ({
|
|
4199
|
+
value: D.abbreviation3 || D.abbreviation,
|
|
4200
|
+
label: D.name
|
|
4173
4201
|
}))
|
|
4174
4202
|
]
|
|
4175
4203
|
}
|
|
@@ -4179,120 +4207,120 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4179
4207
|
] }),
|
|
4180
4208
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4181
4209
|
/* @__PURE__ */ n(
|
|
4182
|
-
|
|
4210
|
+
G,
|
|
4183
4211
|
{
|
|
4184
|
-
control:
|
|
4212
|
+
control: E.control,
|
|
4185
4213
|
name: "street",
|
|
4186
|
-
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4214
|
+
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street" })
|
|
4187
4215
|
}
|
|
4188
4216
|
),
|
|
4189
4217
|
/* @__PURE__ */ n(
|
|
4190
|
-
|
|
4218
|
+
G,
|
|
4191
4219
|
{
|
|
4192
|
-
control:
|
|
4220
|
+
control: E.control,
|
|
4193
4221
|
name: "streetNumber",
|
|
4194
|
-
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4222
|
+
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street Number" })
|
|
4195
4223
|
}
|
|
4196
4224
|
)
|
|
4197
4225
|
] }),
|
|
4198
4226
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4199
4227
|
/* @__PURE__ */ n(
|
|
4200
|
-
|
|
4228
|
+
G,
|
|
4201
4229
|
{
|
|
4202
|
-
control:
|
|
4230
|
+
control: E.control,
|
|
4203
4231
|
name: "city",
|
|
4204
|
-
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4232
|
+
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "City" })
|
|
4205
4233
|
}
|
|
4206
4234
|
),
|
|
4207
4235
|
/* @__PURE__ */ n(
|
|
4208
|
-
|
|
4236
|
+
G,
|
|
4209
4237
|
{
|
|
4210
|
-
control:
|
|
4238
|
+
control: E.control,
|
|
4211
4239
|
name: "zip",
|
|
4212
|
-
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4240
|
+
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "ZIP/Postal Code" })
|
|
4213
4241
|
}
|
|
4214
4242
|
)
|
|
4215
4243
|
] }),
|
|
4216
4244
|
/* @__PURE__ */ n(
|
|
4217
|
-
|
|
4245
|
+
G,
|
|
4218
4246
|
{
|
|
4219
|
-
control:
|
|
4247
|
+
control: E.control,
|
|
4220
4248
|
name: "phonenumber",
|
|
4221
|
-
render: ({ field: O }) => /* @__PURE__ */ n(
|
|
4249
|
+
render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Phone Number", type: "tel" })
|
|
4222
4250
|
}
|
|
4223
4251
|
)
|
|
4224
4252
|
] })
|
|
4225
4253
|
] }),
|
|
4226
4254
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
4227
|
-
r && /* @__PURE__ */ n(
|
|
4228
|
-
/* @__PURE__ */ n(
|
|
4255
|
+
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4256
|
+
/* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4229
4257
|
] })
|
|
4230
4258
|
] }) });
|
|
4231
|
-
},
|
|
4259
|
+
}, ze = ({
|
|
4232
4260
|
kycStatus: t,
|
|
4233
4261
|
reviewStatus: e,
|
|
4234
4262
|
workflowResult: r,
|
|
4235
|
-
customMessage:
|
|
4236
|
-
onContinue:
|
|
4263
|
+
customMessage: s,
|
|
4264
|
+
onContinue: a,
|
|
4237
4265
|
onContactSupport: i
|
|
4238
4266
|
}) => {
|
|
4239
|
-
const l = t ===
|
|
4267
|
+
const l = t === he.Approved ? {
|
|
4240
4268
|
type: "success",
|
|
4241
4269
|
title: "Verification Approved",
|
|
4242
4270
|
icon: "✓",
|
|
4243
4271
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4244
4272
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4245
4273
|
message: "Your identity verification has been successfully approved."
|
|
4246
|
-
} : t ===
|
|
4274
|
+
} : t === he.Rejected ? {
|
|
4247
4275
|
type: "error",
|
|
4248
4276
|
title: "Verification Rejected",
|
|
4249
4277
|
icon: "✕",
|
|
4250
4278
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4251
4279
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4252
4280
|
message: "Unfortunately, your identity verification was not approved."
|
|
4253
|
-
} : t ===
|
|
4281
|
+
} : t === he.Pending || t === he.InProgress ? {
|
|
4254
4282
|
type: "pending",
|
|
4255
4283
|
title: "Verification Pending",
|
|
4256
4284
|
icon: "⏱",
|
|
4257
4285
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
4258
4286
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4259
4287
|
message: "Your identity verification is currently being processed."
|
|
4260
|
-
} : e ===
|
|
4288
|
+
} : e === pe.Approved ? {
|
|
4261
4289
|
type: "success",
|
|
4262
4290
|
title: "Application Approved",
|
|
4263
4291
|
icon: "✓",
|
|
4264
4292
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4265
4293
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4266
4294
|
message: "Your application has been approved."
|
|
4267
|
-
} : e ===
|
|
4295
|
+
} : e === pe.Reject ? {
|
|
4268
4296
|
type: "error",
|
|
4269
4297
|
title: "Application Rejected",
|
|
4270
4298
|
icon: "✕",
|
|
4271
4299
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4272
4300
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4273
4301
|
message: "Your application has been rejected."
|
|
4274
|
-
} : e ===
|
|
4302
|
+
} : e === pe.UnderReview || e === pe.AdminReview ? {
|
|
4275
4303
|
type: "pending",
|
|
4276
4304
|
title: "Under Review",
|
|
4277
4305
|
icon: "📋",
|
|
4278
4306
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4279
4307
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4280
4308
|
message: "Your application is currently under manual review."
|
|
4281
|
-
} : r ===
|
|
4309
|
+
} : r === we.Success ? {
|
|
4282
4310
|
type: "success",
|
|
4283
4311
|
title: "Process Complete",
|
|
4284
4312
|
icon: "✓",
|
|
4285
4313
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4286
4314
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4287
4315
|
message: "Your verification process has been completed successfully."
|
|
4288
|
-
} : r ===
|
|
4316
|
+
} : r === we.Failed ? {
|
|
4289
4317
|
type: "error",
|
|
4290
4318
|
title: "Process Failed",
|
|
4291
4319
|
icon: "✕",
|
|
4292
4320
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4293
4321
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4294
4322
|
message: "The verification process could not be completed."
|
|
4295
|
-
} : r ===
|
|
4323
|
+
} : r === we.AdminReview ? {
|
|
4296
4324
|
type: "pending",
|
|
4297
4325
|
title: "Admin Review Required",
|
|
4298
4326
|
icon: "📋",
|
|
@@ -4307,8 +4335,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4307
4335
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4308
4336
|
message: "Your application is being reviewed."
|
|
4309
4337
|
};
|
|
4310
|
-
return /* @__PURE__ */ o(
|
|
4311
|
-
/* @__PURE__ */ o(
|
|
4338
|
+
return /* @__PURE__ */ o(T, { children: [
|
|
4339
|
+
/* @__PURE__ */ o(M, { className: "py-12", children: [
|
|
4312
4340
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
|
|
4313
4341
|
"div",
|
|
4314
4342
|
{
|
|
@@ -4318,13 +4346,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4318
4346
|
) }),
|
|
4319
4347
|
/* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: l.title }),
|
|
4320
4348
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
|
|
4321
|
-
|
|
4349
|
+
me,
|
|
4322
4350
|
{
|
|
4323
4351
|
variant: l.type === "success" ? "success" : l.type === "error" ? "danger" : l.type === "pending" ? "warning" : "info",
|
|
4324
|
-
children: t != null ?
|
|
4352
|
+
children: t != null ? he[t] : pe[e]
|
|
4325
4353
|
}
|
|
4326
4354
|
) }),
|
|
4327
|
-
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children:
|
|
4355
|
+
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: s || l.message }),
|
|
4328
4356
|
l.type === "success" && /* @__PURE__ */ o("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: [
|
|
4329
4357
|
/* @__PURE__ */ n("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
|
|
4330
4358
|
/* @__PURE__ */ o("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
|
|
@@ -4353,24 +4381,24 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4353
4381
|
/* @__PURE__ */ n("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
4354
4382
|
/* @__PURE__ */ o("div", { children: [
|
|
4355
4383
|
/* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
|
|
4356
|
-
/* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ?
|
|
4384
|
+
/* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? he[t] : "Not Available" })
|
|
4357
4385
|
] }),
|
|
4358
4386
|
/* @__PURE__ */ o("div", { children: [
|
|
4359
4387
|
/* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
|
|
4360
|
-
/* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children:
|
|
4388
|
+
/* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: pe[e] })
|
|
4361
4389
|
] })
|
|
4362
4390
|
] }) })
|
|
4363
4391
|
] }),
|
|
4364
4392
|
/* @__PURE__ */ o(te, { className: "flex justify-center gap-4", children: [
|
|
4365
|
-
l.type === "success" &&
|
|
4366
|
-
l.type === "error" && /* @__PURE__ */ o(
|
|
4367
|
-
i && /* @__PURE__ */ n(
|
|
4368
|
-
|
|
4393
|
+
l.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
|
|
4394
|
+
l.type === "error" && /* @__PURE__ */ o(nt, { children: [
|
|
4395
|
+
i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
|
|
4396
|
+
a && /* @__PURE__ */ n(j, { onClick: a, children: "Try Again" })
|
|
4369
4397
|
] }),
|
|
4370
4398
|
l.type === "pending" && /* @__PURE__ */ n("div", { className: "text-center", children: /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
4371
4399
|
] })
|
|
4372
4400
|
] });
|
|
4373
|
-
},
|
|
4401
|
+
}, Er = ({ config: t, className: e = "" }) => !(t != null && t.visible) || !(t != null && t.url) ? null : /* @__PURE__ */ n("div", { className: `metakyc-logo ${e}`, children: /* @__PURE__ */ n(
|
|
4374
4402
|
"img",
|
|
4375
4403
|
{
|
|
4376
4404
|
src: t.url,
|
|
@@ -4385,20 +4413,33 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4385
4413
|
console.warn("[Logo] Failed to load logo:", t.url), r.target.style.display = "none";
|
|
4386
4414
|
}
|
|
4387
4415
|
}
|
|
4388
|
-
) }),
|
|
4416
|
+
) }), Ze = ({
|
|
4417
|
+
title: t,
|
|
4418
|
+
subtitle: e,
|
|
4419
|
+
className: r = ""
|
|
4420
|
+
}) => {
|
|
4421
|
+
const { themeManager: s } = re(), a = s.getCurrentTheme(), i = t || a.title || "KYC Verification";
|
|
4422
|
+
return /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
|
|
4423
|
+
a.logo && a.logo.visible && /* @__PURE__ */ n("div", { className: "mb-3", children: /* @__PURE__ */ n(Er, { config: a.logo }) }),
|
|
4424
|
+
/* @__PURE__ */ o("div", { children: [
|
|
4425
|
+
/* @__PURE__ */ n("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: i }),
|
|
4426
|
+
e && /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: e })
|
|
4427
|
+
] })
|
|
4428
|
+
] });
|
|
4429
|
+
}, Yr = ({
|
|
4389
4430
|
workflowKey: t,
|
|
4390
4431
|
externalRefId: e,
|
|
4391
4432
|
onSuccess: r,
|
|
4392
|
-
onCancel:
|
|
4433
|
+
onCancel: s
|
|
4393
4434
|
}) => {
|
|
4394
|
-
var
|
|
4395
|
-
const { config:
|
|
4396
|
-
if (!
|
|
4435
|
+
var C, B, z;
|
|
4436
|
+
const { config: a, baseInformationService: i } = re(), { createApplicant: c, isLoading: l } = rr(), [d, u] = x([]), [g, p] = x(!0), [m, f] = x(!1), [y, b] = x(null), F = t || ((C = a.applicantForm) == null ? void 0 : C.workflowKey);
|
|
4437
|
+
if (!F)
|
|
4397
4438
|
throw new Error(
|
|
4398
4439
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4399
4440
|
);
|
|
4400
|
-
const h = e || ((B =
|
|
4401
|
-
workflowKey:
|
|
4441
|
+
const h = e || ((B = a.applicantForm) == null ? void 0 : B.externalRefId) || "", N = ((z = a.applicantForm) == null ? void 0 : z.visibleFields) || gt, [w, I] = x({
|
|
4442
|
+
workflowKey: F,
|
|
4402
4443
|
firstName: "",
|
|
4403
4444
|
lastName: "",
|
|
4404
4445
|
title: "",
|
|
@@ -4428,28 +4469,28 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4428
4469
|
(async () => {
|
|
4429
4470
|
try {
|
|
4430
4471
|
p(!0);
|
|
4431
|
-
const
|
|
4472
|
+
const E = await i.getCountries("", a.locale || "en"), A = /* @__PURE__ */ new Set(), k = E.map((S) => ({
|
|
4432
4473
|
value: S.abbreviation3 || S.abbreviation,
|
|
4433
4474
|
label: S.name
|
|
4434
|
-
})).filter((S) => !S.value ||
|
|
4475
|
+
})).filter((S) => !S.value || A.has(S.value) ? !1 : (A.add(S.value), !0));
|
|
4435
4476
|
u(k);
|
|
4436
|
-
} catch (
|
|
4437
|
-
console.error("Failed to load countries:",
|
|
4477
|
+
} catch (E) {
|
|
4478
|
+
console.error("Failed to load countries:", E);
|
|
4438
4479
|
} finally {
|
|
4439
4480
|
p(!1);
|
|
4440
4481
|
}
|
|
4441
4482
|
})();
|
|
4442
|
-
}, [i,
|
|
4443
|
-
const
|
|
4444
|
-
|
|
4445
|
-
},
|
|
4446
|
-
|
|
4483
|
+
}, [i, a.locale]);
|
|
4484
|
+
const P = (v, E) => {
|
|
4485
|
+
I((A) => ({ ...A, [v]: E }));
|
|
4486
|
+
}, L = async (v) => {
|
|
4487
|
+
v.preventDefault(), f(!0), b(null);
|
|
4447
4488
|
try {
|
|
4448
4489
|
if (!w.externalRefId || w.externalRefId.trim() === "") {
|
|
4449
|
-
|
|
4490
|
+
b("External Reference ID is required and cannot be empty"), f(!1);
|
|
4450
4491
|
return;
|
|
4451
4492
|
}
|
|
4452
|
-
const
|
|
4493
|
+
const E = {
|
|
4453
4494
|
workflowKey: w.workflowKey,
|
|
4454
4495
|
externalRefId: w.externalRefId.trim()
|
|
4455
4496
|
// Always include, never empty
|
|
@@ -4457,142 +4498,145 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4457
4498
|
N.forEach((k) => {
|
|
4458
4499
|
if (k === "externalRefId") return;
|
|
4459
4500
|
const S = w[k];
|
|
4460
|
-
S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (
|
|
4461
|
-
}), console.log("Creating applicant with data:",
|
|
4462
|
-
const
|
|
4463
|
-
|
|
4501
|
+
S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (E[k] = S);
|
|
4502
|
+
}), console.log("Creating applicant with data:", E);
|
|
4503
|
+
const A = await c(
|
|
4504
|
+
E
|
|
4464
4505
|
);
|
|
4465
|
-
console.log("Applicant created:",
|
|
4466
|
-
} catch (
|
|
4467
|
-
console.error("Error creating applicant:",
|
|
4506
|
+
console.log("Applicant created:", A), r(A.applicantId);
|
|
4507
|
+
} catch (E) {
|
|
4508
|
+
console.error("Error creating applicant:", E), b(E.message || "Failed to create applicant");
|
|
4468
4509
|
} finally {
|
|
4469
|
-
|
|
4510
|
+
f(!1);
|
|
4470
4511
|
}
|
|
4471
|
-
},
|
|
4472
|
-
var
|
|
4473
|
-
const
|
|
4474
|
-
switch (
|
|
4512
|
+
}, R = (v) => {
|
|
4513
|
+
var A, k;
|
|
4514
|
+
const E = yt[v];
|
|
4515
|
+
switch (E.type) {
|
|
4475
4516
|
case "select":
|
|
4476
|
-
return
|
|
4477
|
-
|
|
4517
|
+
return v === "country" || v === "nationality" || v === "taxCountry" || v === "countryOfBirth" ? /* @__PURE__ */ n(
|
|
4518
|
+
ge,
|
|
4478
4519
|
{
|
|
4479
|
-
label:
|
|
4480
|
-
value: w[
|
|
4481
|
-
onChange: (S) =>
|
|
4520
|
+
label: E.label,
|
|
4521
|
+
value: w[v] || "",
|
|
4522
|
+
onChange: (S) => P(v, S.target.value),
|
|
4482
4523
|
options: [
|
|
4483
|
-
{ value: "", label: `Select ${
|
|
4524
|
+
{ value: "", label: `Select ${E.label.toLowerCase()}...` },
|
|
4484
4525
|
...d
|
|
4485
4526
|
],
|
|
4486
4527
|
disabled: g
|
|
4487
4528
|
},
|
|
4488
|
-
|
|
4489
|
-
) :
|
|
4490
|
-
|
|
4529
|
+
v
|
|
4530
|
+
) : v === "salutation" ? /* @__PURE__ */ n(
|
|
4531
|
+
ge,
|
|
4491
4532
|
{
|
|
4492
|
-
label:
|
|
4493
|
-
value: ((
|
|
4494
|
-
onChange: (S) =>
|
|
4533
|
+
label: E.label,
|
|
4534
|
+
value: ((A = w[v]) == null ? void 0 : A.toString()) || "",
|
|
4535
|
+
onChange: (S) => P(v, S.target.value ? Number(S.target.value) : null),
|
|
4495
4536
|
options: [
|
|
4496
4537
|
{ value: "", label: "Select salutation..." },
|
|
4497
|
-
{ value:
|
|
4498
|
-
{ value:
|
|
4499
|
-
{ value:
|
|
4538
|
+
{ value: ke.Male.toString(), label: "Male" },
|
|
4539
|
+
{ value: ke.Female.toString(), label: "Female" },
|
|
4540
|
+
{ value: ke.Other.toString(), label: "Other" }
|
|
4500
4541
|
]
|
|
4501
4542
|
},
|
|
4502
|
-
|
|
4543
|
+
v
|
|
4503
4544
|
) : null;
|
|
4504
4545
|
case "multiselect":
|
|
4505
|
-
return
|
|
4506
|
-
|
|
4546
|
+
return v === "otherNationality" ? /* @__PURE__ */ n(
|
|
4547
|
+
Z,
|
|
4507
4548
|
{
|
|
4508
4549
|
type: "text",
|
|
4509
|
-
label:
|
|
4510
|
-
value: ((k = w[
|
|
4550
|
+
label: E.label,
|
|
4551
|
+
value: ((k = w[v]) == null ? void 0 : k.join(", ")) || "",
|
|
4511
4552
|
onChange: (S) => {
|
|
4512
|
-
const
|
|
4513
|
-
|
|
4553
|
+
const _ = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
|
|
4554
|
+
P(v, _);
|
|
4514
4555
|
},
|
|
4515
4556
|
placeholder: "Enter countries separated by commas"
|
|
4516
4557
|
},
|
|
4517
|
-
|
|
4558
|
+
v
|
|
4518
4559
|
) : null;
|
|
4519
4560
|
case "date":
|
|
4520
4561
|
return /* @__PURE__ */ n(
|
|
4521
|
-
|
|
4562
|
+
Z,
|
|
4522
4563
|
{
|
|
4523
4564
|
type: "date",
|
|
4524
|
-
label:
|
|
4525
|
-
value: w[
|
|
4526
|
-
onChange: (S) =>
|
|
4565
|
+
label: E.label,
|
|
4566
|
+
value: w[v] || "",
|
|
4567
|
+
onChange: (S) => P(v, S.target.value)
|
|
4527
4568
|
},
|
|
4528
|
-
|
|
4569
|
+
v
|
|
4529
4570
|
);
|
|
4530
4571
|
case "email":
|
|
4531
4572
|
return /* @__PURE__ */ n(
|
|
4532
|
-
|
|
4573
|
+
Z,
|
|
4533
4574
|
{
|
|
4534
4575
|
type: "email",
|
|
4535
|
-
label:
|
|
4536
|
-
value: w[
|
|
4537
|
-
onChange: (S) =>
|
|
4538
|
-
required:
|
|
4576
|
+
label: E.label,
|
|
4577
|
+
value: w[v] || "",
|
|
4578
|
+
onChange: (S) => P(v, S.target.value),
|
|
4579
|
+
required: v === "email"
|
|
4539
4580
|
},
|
|
4540
|
-
|
|
4581
|
+
v
|
|
4541
4582
|
);
|
|
4542
4583
|
case "tel":
|
|
4543
4584
|
return /* @__PURE__ */ n(
|
|
4544
|
-
|
|
4585
|
+
Z,
|
|
4545
4586
|
{
|
|
4546
4587
|
type: "tel",
|
|
4547
|
-
label:
|
|
4548
|
-
value: w[
|
|
4549
|
-
onChange: (S) =>
|
|
4550
|
-
required:
|
|
4588
|
+
label: E.label,
|
|
4589
|
+
value: w[v] || "",
|
|
4590
|
+
onChange: (S) => P(v, S.target.value),
|
|
4591
|
+
required: v === "phonenumber"
|
|
4551
4592
|
},
|
|
4552
|
-
|
|
4593
|
+
v
|
|
4553
4594
|
);
|
|
4554
4595
|
case "text":
|
|
4555
4596
|
default:
|
|
4556
4597
|
return /* @__PURE__ */ n(
|
|
4557
|
-
|
|
4598
|
+
Z,
|
|
4558
4599
|
{
|
|
4559
4600
|
type: "text",
|
|
4560
|
-
label:
|
|
4561
|
-
value: w[
|
|
4562
|
-
onChange: (S) =>
|
|
4563
|
-
required:
|
|
4601
|
+
label: E.label,
|
|
4602
|
+
value: w[v] || "",
|
|
4603
|
+
onChange: (S) => P(v, S.target.value),
|
|
4604
|
+
required: v === "firstName" || v === "lastName" || v === "externalRefId"
|
|
4564
4605
|
},
|
|
4565
|
-
|
|
4606
|
+
v
|
|
4566
4607
|
);
|
|
4567
4608
|
}
|
|
4568
4609
|
};
|
|
4569
|
-
return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(
|
|
4570
|
-
/* @__PURE__ */ n(
|
|
4610
|
+
return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4611
|
+
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
4571
4612
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4572
|
-
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit:
|
|
4573
|
-
/* @__PURE__ */
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4613
|
+
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: L, children: /* @__PURE__ */ o(T, { children: [
|
|
4614
|
+
/* @__PURE__ */ n(J, { children: /* @__PURE__ */ n(
|
|
4615
|
+
Ze,
|
|
4616
|
+
{
|
|
4617
|
+
title: "Create Applicant",
|
|
4618
|
+
subtitle: "Please fill in the required information to begin the KYC verification process."
|
|
4619
|
+
}
|
|
4620
|
+
) }),
|
|
4621
|
+
/* @__PURE__ */ o(M, { children: [
|
|
4578
4622
|
y && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4579
4623
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
4580
4624
|
" ",
|
|
4581
4625
|
y
|
|
4582
4626
|
] }) }),
|
|
4583
|
-
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: N.map((
|
|
4627
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: N.map((v) => R(v)) })
|
|
4584
4628
|
] }),
|
|
4585
4629
|
/* @__PURE__ */ o(te, { className: "flex justify-between", children: [
|
|
4586
|
-
|
|
4587
|
-
/* @__PURE__ */ n(
|
|
4630
|
+
s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: m || l, children: "Cancel" }),
|
|
4631
|
+
/* @__PURE__ */ n(j, { type: "submit", isLoading: m || l, children: "Create Applicant" })
|
|
4588
4632
|
] })
|
|
4589
4633
|
] }) }) });
|
|
4590
|
-
},
|
|
4634
|
+
}, Wr = ({
|
|
4591
4635
|
applicantId: t,
|
|
4592
4636
|
onComplete: e,
|
|
4593
4637
|
onError: r,
|
|
4594
|
-
theme:
|
|
4595
|
-
className:
|
|
4638
|
+
theme: s = "light",
|
|
4639
|
+
className: a
|
|
4596
4640
|
}) => {
|
|
4597
4641
|
const {
|
|
4598
4642
|
progress: i,
|
|
@@ -4603,29 +4647,29 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4603
4647
|
hasWorkflowChanged: g,
|
|
4604
4648
|
isLoading: p,
|
|
4605
4649
|
error: m,
|
|
4606
|
-
moveBack:
|
|
4650
|
+
moveBack: f,
|
|
4607
4651
|
refreshProgress: y
|
|
4608
|
-
} =
|
|
4609
|
-
if (
|
|
4652
|
+
} = Gt(t), [b, F] = le.useState(!1);
|
|
4653
|
+
if (le.useEffect(() => {
|
|
4610
4654
|
m && r && r(m);
|
|
4611
|
-
}, [m, r]),
|
|
4655
|
+
}, [m, r]), le.useEffect(() => {
|
|
4612
4656
|
i != null && i.workflowResult && e && e(i.workflowResult);
|
|
4613
|
-
}, [i == null ? void 0 : i.workflowResult, e]),
|
|
4614
|
-
|
|
4615
|
-
}, [
|
|
4616
|
-
g &&
|
|
4657
|
+
}, [i == null ? void 0 : i.workflowResult, e]), le.useEffect(() => {
|
|
4658
|
+
s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
4659
|
+
}, [s]), le.useEffect(() => {
|
|
4660
|
+
g && F(!1);
|
|
4617
4661
|
}, [g]), p || !i)
|
|
4618
|
-
return /* @__PURE__ */ n("div", { className:
|
|
4619
|
-
/* @__PURE__ */ n(
|
|
4662
|
+
return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4663
|
+
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
4620
4664
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
4621
4665
|
] }) }) });
|
|
4622
4666
|
if (m)
|
|
4623
|
-
return /* @__PURE__ */ n("div", { className:
|
|
4667
|
+
return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4624
4668
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
4625
4669
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
|
|
4626
4670
|
] }) }) }) });
|
|
4627
|
-
if (g && !
|
|
4628
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${
|
|
4671
|
+
if (g && !b)
|
|
4672
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4629
4673
|
/* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
|
|
4630
4674
|
/* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
4631
4675
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
|
|
@@ -4646,15 +4690,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4646
4690
|
/* @__PURE__ */ n(
|
|
4647
4691
|
"button",
|
|
4648
4692
|
{
|
|
4649
|
-
onClick: () =>
|
|
4693
|
+
onClick: () => F(!0),
|
|
4650
4694
|
className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
|
|
4651
4695
|
children: "Continue with New Workflow"
|
|
4652
4696
|
}
|
|
4653
4697
|
)
|
|
4654
4698
|
] }) }) }) });
|
|
4655
4699
|
if (i.status === ae.Finished || i.status === ae.OnHold)
|
|
4656
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${
|
|
4657
|
-
|
|
4700
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
|
|
4701
|
+
ze,
|
|
4658
4702
|
{
|
|
4659
4703
|
kycStatus: i.kycStatus,
|
|
4660
4704
|
reviewStatus: i.reviewStatus,
|
|
@@ -4667,25 +4711,25 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4667
4711
|
}
|
|
4668
4712
|
) });
|
|
4669
4713
|
if (!c)
|
|
4670
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${
|
|
4671
|
-
/* @__PURE__ */ n(
|
|
4714
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
|
|
4715
|
+
/* @__PURE__ */ n(ie, { className: "my-8" }),
|
|
4672
4716
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === ae.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
4673
4717
|
] }) }) });
|
|
4674
4718
|
const h = () => {
|
|
4675
|
-
const w = l.filter((
|
|
4719
|
+
const w = l.filter((R) => R.visibility !== !1), I = w.findIndex((R) => R.order === c.order), P = I >= 0 ? I + 1 : 1, L = w.length;
|
|
4676
4720
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
4677
|
-
/* @__PURE__ */ o("div", { className: "flex items-
|
|
4678
|
-
/* @__PURE__ */ n(
|
|
4679
|
-
/* @__PURE__ */ o(
|
|
4721
|
+
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
4722
|
+
/* @__PURE__ */ n(Ze, {}),
|
|
4723
|
+
/* @__PURE__ */ o(me, { variant: i.status === 1 ? "info" : "success", children: [
|
|
4680
4724
|
"Step ",
|
|
4681
|
-
|
|
4725
|
+
P,
|
|
4682
4726
|
" of ",
|
|
4683
|
-
|
|
4727
|
+
L
|
|
4684
4728
|
] })
|
|
4685
4729
|
] }),
|
|
4686
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((
|
|
4687
|
-
const B =
|
|
4688
|
-
return /* @__PURE__ */ o(
|
|
4730
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((R, C) => {
|
|
4731
|
+
const B = C < I, z = R.order === c.order;
|
|
4732
|
+
return /* @__PURE__ */ o(le.Fragment, { children: [
|
|
4689
4733
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
4690
4734
|
/* @__PURE__ */ n(
|
|
4691
4735
|
"div",
|
|
@@ -4694,24 +4738,24 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4694
4738
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
4695
4739
|
${B || z ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
4696
4740
|
`,
|
|
4697
|
-
children:
|
|
4741
|
+
children: C + 1
|
|
4698
4742
|
}
|
|
4699
4743
|
),
|
|
4700
4744
|
/* @__PURE__ */ n(
|
|
4701
4745
|
"span",
|
|
4702
4746
|
{
|
|
4703
4747
|
className: `ml-2 text-sm ${z ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
4704
|
-
children:
|
|
4748
|
+
children: R.displayName
|
|
4705
4749
|
}
|
|
4706
4750
|
)
|
|
4707
4751
|
] }),
|
|
4708
|
-
|
|
4752
|
+
C < w.length - 1 && /* @__PURE__ */ n(
|
|
4709
4753
|
"div",
|
|
4710
4754
|
{
|
|
4711
4755
|
className: `flex-1 h-0.5 mx-4 ${B ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
4712
4756
|
}
|
|
4713
4757
|
)
|
|
4714
|
-
] },
|
|
4758
|
+
] }, R.order);
|
|
4715
4759
|
}) })
|
|
4716
4760
|
] });
|
|
4717
4761
|
}, N = () => {
|
|
@@ -4720,27 +4764,27 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4720
4764
|
onComplete: async () => {
|
|
4721
4765
|
await y();
|
|
4722
4766
|
},
|
|
4723
|
-
onBack: c.order > 0 ?
|
|
4767
|
+
onBack: c.order > 0 ? f : void 0
|
|
4724
4768
|
};
|
|
4725
4769
|
switch (c.action) {
|
|
4726
|
-
case
|
|
4727
|
-
return /* @__PURE__ */ n(fr, { ...w });
|
|
4728
|
-
case K.UploadDocument:
|
|
4729
|
-
return /* @__PURE__ */ n(br, { ...w });
|
|
4730
|
-
case K.Overview:
|
|
4731
|
-
return /* @__PURE__ */ n(xr, { ...w });
|
|
4732
|
-
case K.IdentitySdk:
|
|
4733
|
-
return /* @__PURE__ */ n(Nr, { ...w });
|
|
4734
|
-
case K.RiskScoring:
|
|
4770
|
+
case U.Questionaries:
|
|
4735
4771
|
return /* @__PURE__ */ n(vr, { ...w });
|
|
4736
|
-
case
|
|
4737
|
-
case K.InvestorCategorization:
|
|
4772
|
+
case U.UploadDocument:
|
|
4738
4773
|
return /* @__PURE__ */ n(wr, { ...w });
|
|
4739
|
-
case
|
|
4774
|
+
case U.Overview:
|
|
4740
4775
|
return /* @__PURE__ */ n(kr, { ...w });
|
|
4741
|
-
case
|
|
4776
|
+
case U.IdentitySdk:
|
|
4777
|
+
return /* @__PURE__ */ n(Ar, { ...w });
|
|
4778
|
+
case U.RiskScoring:
|
|
4779
|
+
return /* @__PURE__ */ n(Nr, { ...w });
|
|
4780
|
+
case U.AdditionalData:
|
|
4781
|
+
case U.InvestorCategorization:
|
|
4782
|
+
return /* @__PURE__ */ n(Sr, { ...w });
|
|
4783
|
+
case U.AppropriatenessTest:
|
|
4784
|
+
return /* @__PURE__ */ n(Cr, { ...w });
|
|
4785
|
+
case U.ManualReview:
|
|
4742
4786
|
return /* @__PURE__ */ n(
|
|
4743
|
-
|
|
4787
|
+
ze,
|
|
4744
4788
|
{
|
|
4745
4789
|
kycStatus: i.kycStatus,
|
|
4746
4790
|
reviewStatus: i.reviewStatus,
|
|
@@ -4749,134 +4793,135 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4749
4793
|
}
|
|
4750
4794
|
);
|
|
4751
4795
|
default:
|
|
4752
|
-
return /* @__PURE__ */ n(
|
|
4753
|
-
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(
|
|
4796
|
+
return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
|
|
4797
|
+
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ie, {}) }),
|
|
4754
4798
|
/* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
4755
4799
|
"Processing step: ",
|
|
4756
4800
|
c.title || c.name
|
|
4757
4801
|
] }),
|
|
4758
4802
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
4759
4803
|
"Action type: ",
|
|
4760
|
-
|
|
4804
|
+
U[c.action]
|
|
4761
4805
|
] })
|
|
4762
4806
|
] }) });
|
|
4763
4807
|
}
|
|
4764
4808
|
};
|
|
4765
|
-
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${
|
|
4809
|
+
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
|
|
4766
4810
|
h(),
|
|
4767
4811
|
N()
|
|
4768
4812
|
] });
|
|
4769
4813
|
};
|
|
4770
4814
|
export {
|
|
4771
|
-
|
|
4772
|
-
|
|
4815
|
+
Tr as ALL_APPLICANT_FIELDS,
|
|
4816
|
+
st as ApplicantProgressOnHoldReason,
|
|
4773
4817
|
ae as ApplicantProgressStatus,
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4818
|
+
vt as ApplicantService,
|
|
4819
|
+
it as ApplicantStatus,
|
|
4820
|
+
ut as AppropriatenessQuestionType,
|
|
4821
|
+
Nt as AppropriatenessTestService,
|
|
4822
|
+
Cr as AppropriatenessTestStep,
|
|
4823
|
+
me as Badge,
|
|
4824
|
+
Et as BaseInformationService,
|
|
4825
|
+
j as Button,
|
|
4826
|
+
T as Card,
|
|
4827
|
+
M as CardContent,
|
|
4784
4828
|
te as CardFooter,
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4829
|
+
J as CardHeader,
|
|
4830
|
+
Yr as CreateApplicantForm,
|
|
4831
|
+
ht as CriteriaBuiltInType,
|
|
4832
|
+
gt as DEFAULT_VISIBLE_FIELDS,
|
|
4833
|
+
dt as DocumentReviewStatus,
|
|
4834
|
+
bt as EndpointBuilder,
|
|
4835
|
+
be as ErrorHandler,
|
|
4836
|
+
Bt as EventEmitter,
|
|
4837
|
+
yt as FIELD_METADATA,
|
|
4838
|
+
ct as FileType,
|
|
4839
|
+
nr as FileUpload,
|
|
4840
|
+
ke as GenderType,
|
|
4841
|
+
Ze as Header,
|
|
4842
|
+
xt as HttpClient,
|
|
4843
|
+
ye as IdentityProviderManager,
|
|
4844
|
+
At as IdentityService,
|
|
4845
|
+
se as IdentityVerificationProvider,
|
|
4846
|
+
Ar as IdentityVerificationStep,
|
|
4847
|
+
Z as Input,
|
|
4848
|
+
It as InvestorCategorizationService,
|
|
4849
|
+
Sr as InvestorCategorizationStep,
|
|
4850
|
+
ee as InvestorCategorizationType,
|
|
4851
|
+
pt as InvestorCategoryType,
|
|
4852
|
+
ot as KycProcessStatus,
|
|
4853
|
+
he as KycStatus,
|
|
4854
|
+
ze as KycStatusDisplay,
|
|
4855
|
+
Wr as KycWorkflow,
|
|
4856
|
+
Er as Logo,
|
|
4857
|
+
Ue as MetaKYCContext,
|
|
4858
|
+
ce as MetaKYCError,
|
|
4859
|
+
Or as MetaKYCProvider,
|
|
4860
|
+
_t as OnfidoProvider,
|
|
4861
|
+
St as OverviewService,
|
|
4862
|
+
kr as OverviewStep,
|
|
4863
|
+
sr as PhoneInput,
|
|
4864
|
+
wt as QuestionnaireService,
|
|
4865
|
+
vr as QuestionnaireStep,
|
|
4866
|
+
pe as ReviewStatus,
|
|
4867
|
+
mt as RiskCriteriaType,
|
|
4868
|
+
at as RiskLevel,
|
|
4869
|
+
Ct as RiskScoringService,
|
|
4870
|
+
Nr as RiskScoringStep,
|
|
4871
|
+
Kt as SardinAIProvider,
|
|
4872
|
+
ge as Select,
|
|
4873
|
+
ie as Spinner,
|
|
4874
|
+
zt as StepRouter,
|
|
4875
|
+
jt as SumsubProvider,
|
|
4876
|
+
Ut as ThemeManager,
|
|
4832
4877
|
Y as ThemePreset,
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4878
|
+
Mt as ThemeService,
|
|
4879
|
+
kt as UploadDocumentService,
|
|
4880
|
+
wr as UploadDocumentStep,
|
|
4881
|
+
lt as UserType,
|
|
4882
|
+
Ie as ValueDataType,
|
|
4883
|
+
$t as WorkflowOrchestrator,
|
|
4884
|
+
we as WorkflowResultType,
|
|
4885
|
+
Ot as WorkflowState,
|
|
4886
|
+
U as WorkflowStepAction,
|
|
4887
|
+
Vr as appropriatenessTestSchema,
|
|
4888
|
+
Kr as clearAllStorage,
|
|
4889
|
+
Yt as clearApplicantId,
|
|
4890
|
+
Qt as clearWorkflowState,
|
|
4891
|
+
X as cn,
|
|
4892
|
+
Rt as corporateTheme,
|
|
4893
|
+
ft as defaultConfig,
|
|
4894
|
+
Q as defaultTheme,
|
|
4895
|
+
qt as fileToBase64,
|
|
4896
|
+
Dt as fintechTheme,
|
|
4897
|
+
Ae as formatFileSize,
|
|
4898
|
+
Hr as generateAppropriatenessSchema,
|
|
4899
|
+
yr as generateQuestionnaireSchema,
|
|
4900
|
+
br as generateRiskScoringSchema,
|
|
4901
|
+
qr as generateUploadDocumentSchema,
|
|
4902
|
+
jr as getAcceptString,
|
|
4903
|
+
Vt as getApplicantId,
|
|
4904
|
+
xe as getThemePreset,
|
|
4905
|
+
_r as getWorkflowState,
|
|
4906
|
+
Pt as healthcareTheme,
|
|
4907
|
+
Mr as isScriptLoaded,
|
|
4908
|
+
Ke as loadScript,
|
|
4909
|
+
Lt as minimalTheme,
|
|
4910
|
+
Ft as modernTheme,
|
|
4911
|
+
Br as removeScript,
|
|
4912
|
+
Ht as saveApplicantId,
|
|
4913
|
+
Wt as saveWorkflowState,
|
|
4914
|
+
Tt as themePresets,
|
|
4915
|
+
rr as useApplicant,
|
|
4916
|
+
Ur as useAppropriatenessTest,
|
|
4917
|
+
er as useIdentityVerification,
|
|
4918
|
+
Gt as useKycWorkflow,
|
|
4919
|
+
re as useMetaKYC,
|
|
4920
|
+
Xt as useOverview,
|
|
4921
|
+
Zt as useQuestionnaire,
|
|
4922
|
+
tr as useRiskScoring,
|
|
4923
|
+
Jt as useUploadDocument,
|
|
4924
|
+
zr as validateFileSize,
|
|
4925
|
+
$r as validateFileType
|
|
4881
4926
|
};
|
|
4882
4927
|
//# sourceMappingURL=index.js.map
|