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