@vpdev2/metakyc-sdk 1.0.105 → 1.0.106

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
@@ -3,12 +3,12 @@ var Ut = (e, t, n) => t in e ? Wt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var he = (e, t, n) => Ut(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import Kt from "axios";
5
5
  import * as Nt from "react";
6
- import Se, { createContext as qt, useState as k, useMemo as De, useEffect as fe, useContext as Vt, useRef as de, useCallback as ae, forwardRef as mt, createElement as kt } from "react";
6
+ import we, { createContext as qt, useState as k, useMemo as De, useEffect as ge, useContext as Vt, useRef as de, useCallback as ae, forwardRef as mt, createElement as kt } from "react";
7
7
  import { jsx as r, jsxs as s, Fragment as ot } from "react/jsx-runtime";
8
8
  import Yt, { createPortal as wt } from "react-dom";
9
9
  import { useForm as Qt, Controller as Xe } from "react-hook-form";
10
10
  import { z as qe } from "zod";
11
- var ce = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(ce || {}), gt = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(gt || {}), ze = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ze || {}), Gt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Jt || {}), et = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(et || {}), tt = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(tt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Zt || {}), Xt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Xt || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Oe || {}), er = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(er || {}), ft = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(ft || {}), tr = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(tr || {}), rr = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(rr || {}), nr = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(nr || {}), Ue = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ue || {}), ar = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(ar || {}), ir = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(ir || {}), Ee = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Ee || {}), sr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(sr || {});
11
+ var ce = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(ce || {}), ft = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(ft || {}), ze = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ze || {}), Gt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Jt || {}), et = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(et || {}), tt = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(tt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Zt || {}), Xt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Xt || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Oe || {}), er = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(er || {}), gt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(gt || {}), tr = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(tr || {}), rr = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(rr || {}), nr = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(nr || {}), Ue = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ue || {}), ar = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(ar || {}), ir = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(ir || {}), Ee = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Ee || {}), sr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(sr || {});
12
12
  const Ge = {
13
13
  Nationality: 10,
14
14
  Address: 20,
@@ -138,10 +138,10 @@ class dr {
138
138
  }
139
139
  }
140
140
  class We extends Error {
141
- constructor(n, a, i, l, c) {
141
+ constructor(n, a, i, o, c) {
142
142
  super(n);
143
143
  he(this, "response");
144
- this.code = a, this.details = i, this.validationErrors = l, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, We.prototype);
144
+ this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, We.prototype);
145
145
  }
146
146
  }
147
147
  class ct {
@@ -214,7 +214,7 @@ class ur {
214
214
  var i;
215
215
  const a = n.config;
216
216
  return ((i = n.response) == null ? void 0 : i.status) >= 500 && !a._retry && (a._retry = !0, a._retryCount = (a._retryCount || 0) + 1, a._retryCount < (this.config.retries || 3)) ? (await new Promise(
217
- (l) => setTimeout(l, 1e3 * a._retryCount)
217
+ (o) => setTimeout(o, 1e3 * a._retryCount)
218
218
  ), this.axiosInstance(a)) : Promise.reject(n);
219
219
  }
220
220
  );
@@ -230,10 +230,10 @@ class ur {
230
230
  */
231
231
  async get(t, n, a) {
232
232
  try {
233
- const i = this.buildEndpoint(t, n), l = await this.axiosInstance.get(i, {
233
+ const i = this.buildEndpoint(t, n), o = await this.axiosInstance.get(i, {
234
234
  params: a
235
235
  });
236
- return this.handleResponse(l);
236
+ return this.handleResponse(o);
237
237
  } catch (i) {
238
238
  throw ct.handleAxiosError(i);
239
239
  }
@@ -243,8 +243,8 @@ class ur {
243
243
  */
244
244
  async post(t, n, a) {
245
245
  try {
246
- const i = this.buildEndpoint(t, n), l = await this.axiosInstance.post(i, a);
247
- return this.handleResponse(l);
246
+ const i = this.buildEndpoint(t, n), o = await this.axiosInstance.post(i, a);
247
+ return this.handleResponse(o);
248
248
  } catch (i) {
249
249
  throw ct.handleAxiosError(i);
250
250
  }
@@ -254,8 +254,8 @@ class ur {
254
254
  */
255
255
  async put(t, n, a) {
256
256
  try {
257
- const i = this.buildEndpoint(t, n), l = await this.axiosInstance.put(i, a);
258
- return this.handleResponse(l);
257
+ const i = this.buildEndpoint(t, n), o = await this.axiosInstance.put(i, a);
258
+ return this.handleResponse(o);
259
259
  } catch (i) {
260
260
  throw ct.handleAxiosError(i);
261
261
  }
@@ -265,10 +265,10 @@ class ur {
265
265
  */
266
266
  async delete(t, n, a) {
267
267
  try {
268
- const i = this.buildEndpoint(t, n), l = await this.axiosInstance.delete(i, {
268
+ const i = this.buildEndpoint(t, n), o = await this.axiosInstance.delete(i, {
269
269
  params: a
270
270
  });
271
- return this.handleResponse(l);
271
+ return this.handleResponse(o);
272
272
  } catch (i) {
273
273
  throw ct.handleAxiosError(i);
274
274
  }
@@ -489,7 +489,7 @@ class hr {
489
489
  )).result;
490
490
  }
491
491
  }
492
- class gr {
492
+ class fr {
493
493
  constructor(t) {
494
494
  this.httpClient = t;
495
495
  }
@@ -511,7 +511,7 @@ class gr {
511
511
  await this.httpClient.get("Applicant", "PassOverview", { applicantId: t });
512
512
  }
513
513
  }
514
- class fr {
514
+ class gr {
515
515
  constructor(t) {
516
516
  this.httpClient = t;
517
517
  }
@@ -945,11 +945,11 @@ class Ir {
945
945
  }), n.result.applicantFormVisibleFields && n.result.applicantFormVisibleFields.length > 0 && (a.applicantFormVisibleFields = n.result.applicantFormVisibleFields), n.result.applicantFormRequiredFields && n.result.applicantFormRequiredFields.length > 0 && (a.applicantFormRequiredFields = n.result.applicantFormRequiredFields), n.result.allowedLanguages && n.result.allowedLanguages.length > 0 && (a.allowedLanguages = n.result.allowedLanguages), n.result.applicantFormPages)
946
946
  try {
947
947
  const i = typeof n.result.applicantFormPages == "string" ? JSON.parse(n.result.applicantFormPages) : n.result.applicantFormPages;
948
- Array.isArray(i) && i.length > 0 && (a.applicantFormPages = i.map((l) => {
949
- const c = !l._v || l._v < 4;
948
+ Array.isArray(i) && i.length > 0 && (a.applicantFormPages = i.map((o) => {
949
+ const c = !o._v || o._v < 4;
950
950
  return {
951
- ...l,
952
- fields: (l.fields || []).map((u) => ({
951
+ ...o,
952
+ fields: (o.fields || []).map((u) => ({
953
953
  ...u,
954
954
  colSpan: c ? u.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, u.colSpan ?? 4))
955
955
  }))
@@ -966,11 +966,11 @@ class Ir {
966
966
  if (n.result.reviewPageDisabled && (a.reviewPageDisabled = !0), n.result.fieldLabelMode === "placeholder" && (a.fieldLabelMode = "placeholder"), n.result.companyFormVisibleFields && n.result.companyFormVisibleFields.length > 0 && (a.companyFormVisibleFields = n.result.companyFormVisibleFields), n.result.companyFormRequiredFields && n.result.companyFormRequiredFields.length > 0 && (a.companyFormRequiredFields = n.result.companyFormRequiredFields), n.result.companyFormPages)
967
967
  try {
968
968
  const i = typeof n.result.companyFormPages == "string" ? JSON.parse(n.result.companyFormPages) : n.result.companyFormPages;
969
- Array.isArray(i) && i.length > 0 && (a.companyFormPages = i.map((l) => {
970
- const c = !l._v || l._v < 4;
969
+ Array.isArray(i) && i.length > 0 && (a.companyFormPages = i.map((o) => {
970
+ const c = !o._v || o._v < 4;
971
971
  return {
972
- ...l,
973
- fields: (l.fields || []).map((u) => ({
972
+ ...o,
973
+ fields: (o.fields || []).map((u) => ({
974
974
  ...u,
975
975
  colSpan: c ? u.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, u.colSpan ?? 4))
976
976
  }))
@@ -1050,8 +1050,8 @@ class Er {
1050
1050
  a && a.forEach((i) => {
1051
1051
  try {
1052
1052
  i(n);
1053
- } catch (l) {
1054
- console.error(`Error in event listener for "${t}":`, l);
1053
+ } catch (o) {
1054
+ console.error(`Error in event listener for "${t}":`, o);
1055
1055
  }
1056
1056
  });
1057
1057
  }
@@ -1249,11 +1249,11 @@ class Ar {
1249
1249
  return a.submitData(n);
1250
1250
  }
1251
1251
  }
1252
- class Pr {
1253
- constructor(t, n, a, i, l, c, u, y) {
1252
+ class Tr {
1253
+ constructor(t, n, a, i, o, c, u, y) {
1254
1254
  he(this, "state");
1255
1255
  he(this, "stepRouter");
1256
- this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = l, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new Fr(), this.stepRouter = new Ar(), this.registerStepHandlers();
1256
+ this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = o, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new Fr(), this.stepRouter = new Ar(), this.registerStepHandlers();
1257
1257
  }
1258
1258
  /**
1259
1259
  * Register all step handlers
@@ -1403,15 +1403,86 @@ function Dt(e, t) {
1403
1403
  i.src = e, t && (i.id = t), i.async = !0, i.onload = () => n(), i.onerror = () => a(new Error(`Failed to load script: ${e}`)), document.head.appendChild(i);
1404
1404
  });
1405
1405
  }
1406
- function jn(e) {
1406
+ function Hn(e) {
1407
1407
  return !!document.getElementById(e);
1408
1408
  }
1409
- function Hn(e) {
1409
+ function Wn(e) {
1410
1410
  const t = document.getElementById(e);
1411
1411
  t && t.remove();
1412
1412
  }
1413
- const Tr = "https://static.sumsub.com/idensic/static/sns-websdk-builder.js";
1414
- class Lr {
1413
+ const Pr = "https://static.sumsub.com/idensic/static/sns-websdk-builder.js";
1414
+ function Lr() {
1415
+ return `
1416
+ :root {
1417
+ --black: var(--metakyc-text-primary, #111827);
1418
+ --grey: var(--metakyc-surface, #f9fafb);
1419
+ --grey-darker: var(--metakyc-text-muted, #9ca3af);
1420
+ --border-color: var(--metakyc-border, #e5e7eb);
1421
+ }
1422
+ body, html {
1423
+ font-family: var(--metakyc-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif) !important;
1424
+ }
1425
+ p, span, label, div {
1426
+ color: var(--metakyc-text-primary, #111827);
1427
+ }
1428
+ h1, h2, h3, h4 {
1429
+ color: var(--metakyc-text-primary, #111827);
1430
+ }
1431
+ section.content {
1432
+ background-color: var(--metakyc-surface, #f9fafb);
1433
+ color: var(--metakyc-text-primary, #111827);
1434
+ padding: 32px 32px 16px;
1435
+ box-shadow: none;
1436
+ border-radius: 10px;
1437
+ border: 1px solid var(--metakyc-border, #e5e7eb);
1438
+ }
1439
+ input {
1440
+ color: var(--metakyc-text-primary, #111827);
1441
+ font-weight: 500;
1442
+ outline: none;
1443
+ }
1444
+ button.submit, button.back {
1445
+ border-radius: 8px;
1446
+ height: 44px;
1447
+ padding: 0 24px;
1448
+ font-size: 14px;
1449
+ font-weight: 600;
1450
+ background-image: none !important;
1451
+ transform: none !important;
1452
+ box-shadow: none !important;
1453
+ transition: all 0.15s ease;
1454
+ }
1455
+ button.submit {
1456
+ min-width: 120px;
1457
+ background: none;
1458
+ background-color: var(--metakyc-primary, #2563eb);
1459
+ color: #ffffff;
1460
+ }
1461
+ button.submit:hover {
1462
+ background-color: var(--metakyc-primary-hover, #1d4ed8);
1463
+ }
1464
+ button.back {
1465
+ background: none;
1466
+ background-color: var(--metakyc-background, #ffffff);
1467
+ border: 1px solid var(--metakyc-border, #d1d5db);
1468
+ color: var(--metakyc-text-primary, #111827);
1469
+ }
1470
+ button.back:hover {
1471
+ background-color: var(--metakyc-surface, #f3f4f6);
1472
+ }
1473
+ .round-icon {
1474
+ background-color: var(--metakyc-primary, #2563eb) !important;
1475
+ background-image: none !important;
1476
+ }
1477
+ .upload-item, .document-status {
1478
+ border-color: var(--metakyc-border, #e5e7eb) !important;
1479
+ }
1480
+ .step-desc {
1481
+ color: var(--metakyc-text-secondary, #6b7280);
1482
+ }
1483
+ `.replace(/\n\s+/g, " ").trim();
1484
+ }
1485
+ class Dr {
1415
1486
  constructor(t) {
1416
1487
  he(this, "sdk", null);
1417
1488
  he(this, "config");
@@ -1420,12 +1491,14 @@ class Lr {
1420
1491
  this.config = t;
1421
1492
  }
1422
1493
  async loadSDK() {
1423
- if (!window.snsWebSdk && (await Dt(Tr, "sumsub-websdk"), !window.snsWebSdk))
1494
+ if (!window.snsWebSdk && (await Dt(Pr, "sumsub-websdk"), !window.snsWebSdk))
1424
1495
  throw new Error("Sumsub Web SDK failed to load from CDN");
1425
1496
  }
1426
1497
  async initialize(t) {
1427
1498
  await this.loadSDK();
1428
- const n = window.snsWebSdk.init(
1499
+ const n = {};
1500
+ this.config.customCss && (n.customCss = this.config.customCss), n.customCssStr = Lr();
1501
+ const a = window.snsWebSdk.init(
1429
1502
  this.config.accessToken,
1430
1503
  () => this.config.onTokenRefresh()
1431
1504
  ).withConf({
@@ -1433,23 +1506,23 @@ class Lr {
1433
1506
  ...this.config.applicantEmail ? { email: this.config.applicantEmail } : {},
1434
1507
  ...this.config.applicantPhone ? { phone: this.config.applicantPhone } : {},
1435
1508
  ...this.config.theme ? { theme: this.config.theme } : {},
1436
- ...this.config.customCss ? { uiConf: { customCss: this.config.customCss } } : {}
1509
+ uiConf: n
1437
1510
  }).withOptions({
1438
1511
  addViewportTag: !1,
1439
1512
  adaptIframeHeight: this.config.adaptIframeHeight !== !1
1440
- }).on("idCheck.onStepCompleted", (a) => {
1441
- console.log("[Sumsub] Step completed:", a);
1442
- }).on("idCheck.applicantStatus", (a) => {
1443
- var i, l;
1444
- console.log("[Sumsub] Applicant status:", a), ((a == null ? void 0 : a.reviewStatus) === "completed" || ((i = a == null ? void 0 : a.reviewResult) == null ? void 0 : i.reviewAnswer) === "GREEN") && ((l = this.completeCallback) == null || l.call(this, a));
1445
- }).on("idCheck.onError", (a) => {
1446
- var i;
1447
- console.error("[Sumsub] Error:", a), (i = this.errorCallback) == null || i.call(this, a);
1448
- }).onMessage((a, i) => {
1449
- var l;
1450
- console.log("[Sumsub] Message:", a, i), a === "idCheck.onApplicantSubmitted" && ((l = this.completeCallback) == null || l.call(this, i));
1513
+ }).on("idCheck.onStepCompleted", (i) => {
1514
+ console.log("[Sumsub] Step completed:", i);
1515
+ }).on("idCheck.applicantStatus", (i) => {
1516
+ var o, c;
1517
+ console.log("[Sumsub] Applicant status:", i), ((i == null ? void 0 : i.reviewStatus) === "completed" || ((o = i == null ? void 0 : i.reviewResult) == null ? void 0 : o.reviewAnswer) === "GREEN") && ((c = this.completeCallback) == null || c.call(this, i));
1518
+ }).on("idCheck.onError", (i) => {
1519
+ var o;
1520
+ console.error("[Sumsub] Error:", i), (o = this.errorCallback) == null || o.call(this, i);
1521
+ }).onMessage((i, o) => {
1522
+ var c;
1523
+ console.log("[Sumsub] Message:", i, o), i === "idCheck.onApplicantSubmitted" && ((c = this.completeCallback) == null || c.call(this, o));
1451
1524
  });
1452
- this.sdk = n.build(), this.sdk.launch(`#${t}`);
1525
+ this.sdk = a.build(), this.sdk.launch(`#${t}`);
1453
1526
  }
1454
1527
  destroy() {
1455
1528
  if (this.sdk) {
@@ -1467,7 +1540,7 @@ class Lr {
1467
1540
  this.errorCallback = t;
1468
1541
  }
1469
1542
  }
1470
- class Dr {
1543
+ class Mr {
1471
1544
  constructor(t) {
1472
1545
  he(this, "sdk", null);
1473
1546
  he(this, "config");
@@ -1533,7 +1606,7 @@ class Dr {
1533
1606
  this.sdk && (this.sdk.tearDown(), this.sdk = null);
1534
1607
  }
1535
1608
  }
1536
- class Mr {
1609
+ class Or {
1537
1610
  constructor(t) {
1538
1611
  he(this, "sardineContext", null);
1539
1612
  he(this, "config");
@@ -1582,8 +1655,8 @@ class Mr {
1582
1655
  }, i.onerror = () => {
1583
1656
  n(new Error("Failed to load SardinAI SDK"));
1584
1657
  };
1585
- const l = document.getElementsByTagName("script")[0];
1586
- l && l.parentNode ? l.parentNode.insertBefore(i, l) : document.head.appendChild(i);
1658
+ const o = document.getElementsByTagName("script")[0];
1659
+ o && o.parentNode ? o.parentNode.insertBefore(i, o) : document.head.appendChild(i);
1587
1660
  });
1588
1661
  }
1589
1662
  /**
@@ -1593,7 +1666,7 @@ class Mr {
1593
1666
  try {
1594
1667
  if (await this.loadSDK(), !window._Sardine)
1595
1668
  throw new Error("SardinAI SDK not available after loading");
1596
- const t = this.getSardineHost(), { clientId: n, environment: a, flow: i, enableBiometrics: l, enablePortScanning: c } = this.config;
1669
+ const t = this.getSardineHost(), { clientId: n, environment: a, flow: i, enableBiometrics: o, enablePortScanning: c } = this.config;
1597
1670
  this.sardineContext = window._Sardine.createContext({
1598
1671
  clientId: n,
1599
1672
  sessionKey: this.sessionKey,
@@ -1602,7 +1675,7 @@ class Mr {
1602
1675
  flow: i || window.location.pathname,
1603
1676
  environment: a || "production",
1604
1677
  parentElement: document.body,
1605
- enableBiometrics: l !== !1,
1678
+ enableBiometrics: o !== !1,
1606
1679
  // Default true
1607
1680
  enablePortScanning: c === !0,
1608
1681
  // Default false
@@ -1636,8 +1709,8 @@ class Mr {
1636
1709
  * Add noscript fallback for cases where JS is disabled
1637
1710
  */
1638
1711
  addNoScriptFallback(t) {
1639
- const n = document.createElement("noscript"), a = document.createElement("img"), { clientId: i, flow: l } = this.config;
1640
- a.src = `https://${t}/v1/a.png?clientId=${i}&sessionKey=${this.sessionKey}&flow=${l || "kyc"}&ns=1`, a.style.display = "none", n.appendChild(a), document.body.appendChild(n);
1712
+ const n = document.createElement("noscript"), a = document.createElement("img"), { clientId: i, flow: o } = this.config;
1713
+ a.src = `https://${t}/v1/a.png?clientId=${i}&sessionKey=${this.sessionKey}&flow=${o || "kyc"}&ns=1`, a.style.display = "none", n.appendChild(a), document.body.appendChild(n);
1641
1714
  }
1642
1715
  /**
1643
1716
  * Update configuration (e.g., set userIdHash after login)
@@ -1684,11 +1757,11 @@ class Qe {
1684
1757
  static createProvider(t, n) {
1685
1758
  switch (t) {
1686
1759
  case Oe.Sumsub:
1687
- return new Lr(n);
1688
- case Oe.Onfido:
1689
1760
  return new Dr(n);
1690
- case Oe.SardinAI:
1761
+ case Oe.Onfido:
1691
1762
  return new Mr(n);
1763
+ case Oe.SardinAI:
1764
+ return new Or(n);
1692
1765
  default:
1693
1766
  throw new Error(`Unsupported identity provider: ${t}`);
1694
1767
  }
@@ -1697,7 +1770,7 @@ class Qe {
1697
1770
  * Get provider configuration from API token object
1698
1771
  */
1699
1772
  static parseProviderConfig(t, n, a) {
1700
- var i, l;
1773
+ var i, o;
1701
1774
  switch (t) {
1702
1775
  case Oe.Sumsub:
1703
1776
  const c = ((i = a == null ? void 0 : a.identityProviders) == null ? void 0 : i.sumsub) || {};
@@ -1716,7 +1789,7 @@ class Qe {
1716
1789
  token: n.token || n.sdkToken
1717
1790
  };
1718
1791
  case Oe.SardinAI:
1719
- const u = ((l = a == null ? void 0 : a.identityProviders) == null ? void 0 : l.sardinai) || {};
1792
+ const u = ((o = a == null ? void 0 : a.identityProviders) == null ? void 0 : o.sardinai) || {};
1720
1793
  return {
1721
1794
  clientId: u.clientId || n.clientId,
1722
1795
  sessionKey: u.sessionKey || n.sessionKey,
@@ -1731,7 +1804,7 @@ class Qe {
1731
1804
  }
1732
1805
  }
1733
1806
  }
1734
- function Or() {
1807
+ function zr() {
1735
1808
  return `
1736
1809
  /* ── metakyc-input-colors (ThemeManager failsafe — same rules as globals.css) ── */
1737
1810
  .metakyc-sdk input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
@@ -1765,7 +1838,7 @@ function Or() {
1765
1838
  }
1766
1839
  `;
1767
1840
  }
1768
- class zr {
1841
+ class Br {
1769
1842
  constructor(t) {
1770
1843
  he(this, "currentTheme", Le);
1771
1844
  he(this, "customStyleElement", null);
@@ -1809,8 +1882,8 @@ class zr {
1809
1882
  "input-border-focus": t.inputBorderFocus || t.primary,
1810
1883
  "input-placeholder": t.inputPlaceholder || t.textMuted
1811
1884
  };
1812
- Object.entries(n).forEach(([i, l]) => {
1813
- l && this.container.style.setProperty(`--metakyc-${i}`, l);
1885
+ Object.entries(n).forEach(([i, o]) => {
1886
+ o && this.container.style.setProperty(`--metakyc-${i}`, o);
1814
1887
  }), this.injectInputColors(), (a = this.currentTheme.darkMode) != null && a.colors && this.applyDarkModeColors(this.currentTheme.darkMode.colors);
1815
1888
  }
1816
1889
  /**
@@ -1848,7 +1921,7 @@ class zr {
1848
1921
  * These rules are placed BEFORE any custom CSS so that custom CSS can still override them.
1849
1922
  */
1850
1923
  injectInputColors() {
1851
- this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent = Or(), this.customStyleElement && this.customStyleElement.parentNode ? document.head.insertBefore(this.inputStyleElement, this.customStyleElement) : document.head.appendChild(this.inputStyleElement);
1924
+ this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent = zr(), this.customStyleElement && this.customStyleElement.parentNode ? document.head.insertBefore(this.inputStyleElement, this.customStyleElement) : document.head.appendChild(this.inputStyleElement);
1852
1925
  }
1853
1926
  /**
1854
1927
  * Inject custom CSS into document
@@ -1913,17 +1986,17 @@ class zr {
1913
1986
  return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1914
1987
  }
1915
1988
  }
1916
- const Mt = qt(null), Wn = ({ config: e, children: t }) => {
1917
- const [n, a] = k(null), i = Se.useRef(!1), l = Se.useRef(!1), c = De(() => {
1918
- const y = new ur(e), p = new pr(y), x = new mr(y), L = new yr(y), v = new hr(y), A = new gr(y), P = new fr(y), w = new br(y), N = new xr(y), z = new vr(y), Q = new Ir(y), M = new zr();
1989
+ const Mt = qt(null), Un = ({ config: e, children: t }) => {
1990
+ const [n, a] = k(null), i = we.useRef(!1), o = we.useRef(!1), c = De(() => {
1991
+ const y = new ur(e), p = new pr(y), x = new mr(y), P = new yr(y), v = new hr(y), A = new fr(y), T = new gr(y), w = new br(y), N = new xr(y), z = new vr(y), Q = new Ir(y), M = new Br();
1919
1992
  return {
1920
1993
  httpClient: y,
1921
1994
  applicantService: p,
1922
1995
  questionnaireService: x,
1923
- uploadDocumentService: L,
1996
+ uploadDocumentService: P,
1924
1997
  appropriatenessTestService: v,
1925
1998
  overviewService: A,
1926
- riskScoringService: P,
1999
+ riskScoringService: T,
1927
2000
  identityService: w,
1928
2001
  baseInformationService: N,
1929
2002
  investorCategorizationService: z,
@@ -1934,7 +2007,7 @@ const Mt = qt(null), Wn = ({ config: e, children: t }) => {
1934
2007
  config: e,
1935
2008
  ...c,
1936
2009
  currentTheme: n,
1937
- createOrchestrator: () => new Pr(
2010
+ createOrchestrator: () => new Tr(
1938
2011
  c.applicantService,
1939
2012
  c.questionnaireService,
1940
2013
  c.uploadDocumentService,
@@ -1945,22 +2018,22 @@ const Mt = qt(null), Wn = ({ config: e, children: t }) => {
1945
2018
  c.investorCategorizationService
1946
2019
  )
1947
2020
  }), [e, c, n]);
1948
- return fe(() => ((async () => {
1949
- if (i.current || l.current) {
2021
+ return ge(() => ((async () => {
2022
+ if (i.current || o.current) {
1950
2023
  console.log("[MetaKYC] Theme already loading or loaded, skipping...");
1951
2024
  return;
1952
2025
  }
1953
2026
  i.current = !0;
1954
2027
  try {
1955
2028
  if (e.theme) {
1956
- console.log("[MetaKYC] Applying static theme from config"), c.themeManager.applyTheme(e.theme), a(c.themeManager.getCurrentTheme()), l.current = !0;
2029
+ console.log("[MetaKYC] Applying static theme from config"), c.themeManager.applyTheme(e.theme), a(c.themeManager.getCurrentTheme()), o.current = !0;
1957
2030
  return;
1958
2031
  }
1959
2032
  console.log("[MetaKYC] Fetching theme from backend...");
1960
2033
  const p = await c.themeService.getThemeConfiguration();
1961
- c.themeManager.applyTheme(p), a(c.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", p);
2034
+ c.themeManager.applyTheme(p), a(c.themeManager.getCurrentTheme()), o.current = !0, console.log("[MetaKYC] Theme loaded and applied", p);
1962
2035
  } catch (p) {
1963
- console.warn("[MetaKYC] Failed to load theme, using default:", p), a(c.themeManager.getCurrentTheme()), l.current = !0;
2036
+ console.warn("[MetaKYC] Failed to load theme, using default:", p), a(c.themeManager.getCurrentTheme()), o.current = !0;
1964
2037
  } finally {
1965
2038
  i.current = !1;
1966
2039
  }
@@ -1968,25 +2041,25 @@ const Mt = qt(null), Wn = ({ config: e, children: t }) => {
1968
2041
  c.themeManager.cleanup();
1969
2042
  }), []), /* @__PURE__ */ r(Mt.Provider, { value: u, children: t });
1970
2043
  };
1971
- function Pe() {
2044
+ function Te() {
1972
2045
  const e = Vt(Mt);
1973
2046
  if (!e)
1974
2047
  throw new Error("useMetaKYC must be used within a MetaKYCProvider");
1975
2048
  return e;
1976
2049
  }
1977
- async function Br(e) {
2050
+ async function $r(e) {
1978
2051
  return new Promise((t, n) => {
1979
2052
  const a = new FileReader();
1980
2053
  a.readAsDataURL(e), a.onload = () => {
1981
- const l = a.result.split(",")[1];
1982
- t(l);
2054
+ const o = a.result.split(",")[1];
2055
+ t(o);
1983
2056
  }, a.onerror = (i) => n(i);
1984
2057
  });
1985
2058
  }
1986
- function Un(e, t) {
2059
+ function Kn(e, t) {
1987
2060
  return e.size <= t;
1988
2061
  }
1989
- function Kn(e, t) {
2062
+ function qn(e, t) {
1990
2063
  return t.split(",").map((a) => a.trim()).some((a) => {
1991
2064
  if (a.endsWith("/*")) {
1992
2065
  const i = a.slice(0, -2);
@@ -2000,7 +2073,7 @@ function bt(e) {
2000
2073
  const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
2001
2074
  return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
2002
2075
  }
2003
- function qn(e) {
2076
+ function Vn(e) {
2004
2077
  return e;
2005
2078
  }
2006
2079
  function Ae(...e) {
@@ -2010,14 +2083,14 @@ const lt = {
2010
2083
  APPLICANT_ID: "metakyc_applicant_id",
2011
2084
  WORKFLOW_STATE: "metakyc_workflow_state"
2012
2085
  };
2013
- function $r(e) {
2086
+ function _r(e) {
2014
2087
  try {
2015
2088
  localStorage.setItem(lt.APPLICANT_ID, e.toString());
2016
2089
  } catch (t) {
2017
2090
  console.warn("Failed to save applicant ID to storage:", t);
2018
2091
  }
2019
2092
  }
2020
- function _r() {
2093
+ function jr() {
2021
2094
  try {
2022
2095
  const e = localStorage.getItem(lt.APPLICANT_ID);
2023
2096
  return e ? parseInt(e, 10) : null;
@@ -2025,21 +2098,21 @@ function _r() {
2025
2098
  return console.warn("Failed to retrieve applicant ID from storage:", e), null;
2026
2099
  }
2027
2100
  }
2028
- function jr() {
2101
+ function Hr() {
2029
2102
  try {
2030
2103
  localStorage.removeItem(lt.APPLICANT_ID);
2031
2104
  } catch (e) {
2032
2105
  console.warn("Failed to clear applicant ID from storage:", e);
2033
2106
  }
2034
2107
  }
2035
- function Hr(e) {
2108
+ function Wr(e) {
2036
2109
  try {
2037
2110
  localStorage.setItem(lt.WORKFLOW_STATE, JSON.stringify(e));
2038
2111
  } catch (t) {
2039
2112
  console.warn("Failed to save workflow state to storage:", t);
2040
2113
  }
2041
2114
  }
2042
- function Vn() {
2115
+ function Yn() {
2043
2116
  try {
2044
2117
  const e = localStorage.getItem(lt.WORKFLOW_STATE);
2045
2118
  return e ? JSON.parse(e) : null;
@@ -2047,23 +2120,23 @@ function Vn() {
2047
2120
  return console.warn("Failed to retrieve workflow state from storage:", e), null;
2048
2121
  }
2049
2122
  }
2050
- function Wr() {
2123
+ function Ur() {
2051
2124
  try {
2052
2125
  localStorage.removeItem(lt.WORKFLOW_STATE);
2053
2126
  } catch (e) {
2054
2127
  console.warn("Failed to clear workflow state from storage:", e);
2055
2128
  }
2056
2129
  }
2057
- function Yn() {
2058
- jr(), Wr();
2130
+ function Qn() {
2131
+ Hr(), Ur();
2059
2132
  }
2060
- function Ur(e) {
2061
- const { createOrchestrator: t } = Pe(), [n, a] = k(null), [i, l] = k(!1), [c, u] = k(null), y = de(null), p = e || _r();
2062
- fe(() => {
2133
+ function Kr(e) {
2134
+ const { createOrchestrator: t } = Te(), [n, a] = k(null), [i, o] = k(!1), [c, u] = k(null), y = de(null), p = e || jr();
2135
+ ge(() => {
2063
2136
  y.current || (y.current = t());
2064
- }, [t]), fe(() => {
2137
+ }, [t]), ge(() => {
2065
2138
  var M;
2066
- n && p && ($r(p), Hr({
2139
+ n && p && (_r(p), Wr({
2067
2140
  applicantId: p,
2068
2141
  currentStepOrder: (M = n.currentStep) == null ? void 0 : M.order,
2069
2142
  status: n.status,
@@ -2072,25 +2145,25 @@ function Ur(e) {
2072
2145
  nextWorkflowKey: n.nextWorkflowKey
2073
2146
  }));
2074
2147
  }, [n, p]);
2075
- const x = de(!1), L = de(!1), v = ae(async () => {
2148
+ const x = de(!1), P = de(!1), v = ae(async () => {
2076
2149
  if (!(!p || !y.current)) {
2077
2150
  if (x.current) {
2078
2151
  console.log("[Workflow] Load already in progress, skipping...");
2079
2152
  return;
2080
2153
  }
2081
- x.current = !0, l(!0), u(null);
2154
+ x.current = !0, o(!0), u(null);
2082
2155
  try {
2083
2156
  const M = await y.current.initialize(p);
2084
- a(M), L.current = !0;
2157
+ a(M), P.current = !0;
2085
2158
  } catch (M) {
2086
2159
  u(M);
2087
2160
  } finally {
2088
- l(!1), x.current = !1;
2161
+ o(!1), x.current = !1;
2089
2162
  }
2090
2163
  }
2091
2164
  }, [p]);
2092
- fe(() => {
2093
- p && !L.current && v();
2165
+ ge(() => {
2166
+ p && !P.current && v();
2094
2167
  }, [p, v]);
2095
2168
  const A = ae(async () => {
2096
2169
  if (y.current) {
@@ -2098,43 +2171,43 @@ function Ur(e) {
2098
2171
  console.log("[Workflow] Refresh already in progress, skipping...");
2099
2172
  return;
2100
2173
  }
2101
- x.current = !0, l(!0), u(null);
2174
+ x.current = !0, o(!0), u(null);
2102
2175
  try {
2103
2176
  const M = await y.current.refreshProgress();
2104
2177
  a(M);
2105
2178
  } catch (M) {
2106
2179
  u(M);
2107
2180
  } finally {
2108
- l(!1), x.current = !1;
2181
+ o(!1), x.current = !1;
2109
2182
  }
2110
2183
  }
2111
- }, []), P = ae(async () => {
2184
+ }, []), T = ae(async () => {
2112
2185
  if (y.current) {
2113
- l(!0), u(null);
2186
+ o(!0), u(null);
2114
2187
  try {
2115
2188
  const M = await y.current.moveToNextStep();
2116
2189
  a(M);
2117
2190
  } catch (M) {
2118
2191
  u(M);
2119
2192
  } finally {
2120
- l(!1);
2193
+ o(!1);
2121
2194
  }
2122
2195
  }
2123
2196
  }, []), w = ae(async () => {
2124
2197
  if (y.current) {
2125
- l(!0), u(null);
2198
+ o(!0), u(null);
2126
2199
  try {
2127
2200
  const M = await y.current.moveToPreviousStep();
2128
2201
  a(M);
2129
2202
  } catch (M) {
2130
2203
  u(M);
2131
2204
  } finally {
2132
- l(!1);
2205
+ o(!1);
2133
2206
  }
2134
2207
  }
2135
2208
  }, []), N = ae(async (M) => {
2136
2209
  if (y.current) {
2137
- l(!0), u(null);
2210
+ o(!0), u(null);
2138
2211
  try {
2139
2212
  await y.current.submitCurrentStep(M);
2140
2213
  const j = await y.current.refreshProgress();
@@ -2142,7 +2215,7 @@ function Ur(e) {
2142
2215
  } catch (j) {
2143
2216
  throw u(j), j;
2144
2217
  } finally {
2145
- l(!1);
2218
+ o(!1);
2146
2219
  }
2147
2220
  }
2148
2221
  }, []), z = Nt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, j) => M.order - j.order) : [], [n == null ? void 0 : n.stepInfoList]), Q = Nt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
@@ -2161,14 +2234,14 @@ function Ur(e) {
2161
2234
  isComplete: (n == null ? void 0 : n.status) === ze.Finished,
2162
2235
  isOnHold: (n == null ? void 0 : n.status) === ze.OnHold,
2163
2236
  refreshProgress: A,
2164
- moveToNext: P,
2237
+ moveToNext: T,
2165
2238
  moveBack: w,
2166
2239
  submitCurrentStep: N,
2167
2240
  orchestrator: y.current
2168
2241
  };
2169
2242
  }
2170
- function Kr(e) {
2171
- const { questionnaireService: t, applicantService: n } = Pe(), [a, i] = k(null), [l, c] = k({}), [u, y] = k(!1), [p, x] = k(!1), [L, v] = k(null), A = de(!1), P = de(null), w = ae(async () => {
2243
+ function qr(e) {
2244
+ const { questionnaireService: t, applicantService: n } = Te(), [a, i] = k(null), [o, c] = k({}), [u, y] = k(!1), [p, x] = k(!1), [P, v] = k(null), A = de(!1), T = de(null), w = ae(async () => {
2172
2245
  var z, Q;
2173
2246
  if (e) {
2174
2247
  if (A.current) {
@@ -2192,7 +2265,7 @@ function Kr(e) {
2192
2265
  }
2193
2266
  c(ee);
2194
2267
  }
2195
- P.current = e;
2268
+ T.current = e;
2196
2269
  } catch (M) {
2197
2270
  v(M);
2198
2271
  } finally {
@@ -2200,8 +2273,8 @@ function Kr(e) {
2200
2273
  }
2201
2274
  }
2202
2275
  }, [e, t, n]);
2203
- fe(() => {
2204
- e && P.current !== e && w();
2276
+ ge(() => {
2277
+ e && T.current !== e && w();
2205
2278
  }, [e]);
2206
2279
  const N = ae(
2207
2280
  async (z) => {
@@ -2218,42 +2291,42 @@ function Kr(e) {
2218
2291
  );
2219
2292
  return {
2220
2293
  questionnaire: a,
2221
- initialAnswers: l,
2294
+ initialAnswers: o,
2222
2295
  isLoading: u,
2223
2296
  isSubmitting: p,
2224
- error: L,
2297
+ error: P,
2225
2298
  load: w,
2226
2299
  submit: N
2227
2300
  };
2228
2301
  }
2229
- function qr(e) {
2230
- const { uploadDocumentService: t } = Pe(), [n, a] = k(null), [i, l] = k(!1), [c, u] = k(!1), [y, p] = k(0), [x, L] = k(null), v = de(!1), A = de(null), P = ae(async () => {
2302
+ function Vr(e) {
2303
+ const { uploadDocumentService: t } = Te(), [n, a] = k(null), [i, o] = k(!1), [c, u] = k(!1), [y, p] = k(0), [x, P] = k(null), v = de(!1), A = de(null), T = ae(async () => {
2231
2304
  if (e) {
2232
2305
  if (v.current) {
2233
2306
  console.log("[UploadDocument] Load already in progress, skipping...");
2234
2307
  return;
2235
2308
  }
2236
- v.current = !0, l(!0), L(null);
2309
+ v.current = !0, o(!0), P(null);
2237
2310
  try {
2238
2311
  const N = await t.getUploadDocument(e);
2239
2312
  a(N), A.current = e;
2240
2313
  } catch (N) {
2241
- L(N);
2314
+ P(N);
2242
2315
  } finally {
2243
- l(!1), v.current = !1;
2316
+ o(!1), v.current = !1;
2244
2317
  }
2245
2318
  }
2246
2319
  }, [e, t]);
2247
- fe(() => {
2248
- e && A.current !== e && P();
2320
+ ge(() => {
2321
+ e && A.current !== e && T();
2249
2322
  }, [e]);
2250
2323
  const w = ae(
2251
2324
  async (N) => {
2252
- u(!0), p(0), L(null);
2325
+ u(!0), p(0), P(null);
2253
2326
  try {
2254
2327
  await t.fillUploadDocument(N), p(100);
2255
2328
  } catch (z) {
2256
- throw L(z), z;
2329
+ throw P(z), z;
2257
2330
  } finally {
2258
2331
  u(!1);
2259
2332
  }
@@ -2266,37 +2339,37 @@ function qr(e) {
2266
2339
  isSubmitting: c,
2267
2340
  uploadProgress: y,
2268
2341
  error: x,
2269
- load: P,
2342
+ load: T,
2270
2343
  submit: w
2271
2344
  };
2272
2345
  }
2273
- function Qn(e) {
2274
- const { appropriatenessTestService: t } = Pe(), [n, a] = k(null), [i, l] = k(!1), [c, u] = k(!1), [y, p] = k(null), [x, L] = k(null), v = de(!1), A = de(null), P = ae(async () => {
2346
+ function Gn(e) {
2347
+ const { appropriatenessTestService: t } = Te(), [n, a] = k(null), [i, o] = k(!1), [c, u] = k(!1), [y, p] = k(null), [x, P] = k(null), v = de(!1), A = de(null), T = ae(async () => {
2275
2348
  if (e) {
2276
2349
  if (v.current) {
2277
2350
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
2278
2351
  return;
2279
2352
  }
2280
- v.current = !0, l(!0), p(null);
2353
+ v.current = !0, o(!0), p(null);
2281
2354
  try {
2282
2355
  const N = await t.getAppropriatenessTest(e);
2283
2356
  a(N), A.current = e;
2284
2357
  } catch (N) {
2285
2358
  p(N);
2286
2359
  } finally {
2287
- l(!1), v.current = !1;
2360
+ o(!1), v.current = !1;
2288
2361
  }
2289
2362
  }
2290
2363
  }, [e, t]);
2291
- fe(() => {
2292
- e && A.current !== e && P();
2364
+ ge(() => {
2365
+ e && A.current !== e && T();
2293
2366
  }, [e]);
2294
2367
  const w = ae(
2295
2368
  async (N) => {
2296
2369
  u(!0), p(null);
2297
2370
  try {
2298
2371
  const z = await t.fillAppropriatenessTest(N);
2299
- return L(z), z;
2372
+ return P(z), z;
2300
2373
  } catch (z) {
2301
2374
  throw p(z), z;
2302
2375
  } finally {
@@ -2311,38 +2384,38 @@ function Qn(e) {
2311
2384
  isLoading: i,
2312
2385
  isSubmitting: c,
2313
2386
  error: y,
2314
- load: P,
2387
+ load: T,
2315
2388
  submit: w
2316
2389
  };
2317
2390
  }
2318
- function Vr(e) {
2319
- const { overviewService: t } = Pe(), [n, a] = k(null), [i, l] = k(!1), [c, u] = k(!1), [y, p] = k(null), x = de(!1), L = de(null), v = ae(async () => {
2391
+ function Yr(e) {
2392
+ const { overviewService: t } = Te(), [n, a] = k(null), [i, o] = k(!1), [c, u] = k(!1), [y, p] = k(null), x = de(!1), P = de(null), v = ae(async () => {
2320
2393
  if (e) {
2321
2394
  if (x.current) {
2322
2395
  console.log("[Overview] Load already in progress, skipping...");
2323
2396
  return;
2324
2397
  }
2325
- x.current = !0, l(!0), p(null);
2398
+ x.current = !0, o(!0), p(null);
2326
2399
  try {
2327
- const P = await t.getOverviewData(e);
2328
- a(P), L.current = e;
2329
- } catch (P) {
2330
- p(P);
2400
+ const T = await t.getOverviewData(e);
2401
+ a(T), P.current = e;
2402
+ } catch (T) {
2403
+ p(T);
2331
2404
  } finally {
2332
- l(!1), x.current = !1;
2405
+ o(!1), x.current = !1;
2333
2406
  }
2334
2407
  }
2335
2408
  }, [e, t]);
2336
- fe(() => {
2337
- e && L.current !== e && v();
2409
+ ge(() => {
2410
+ e && P.current !== e && v();
2338
2411
  }, [e]);
2339
2412
  const A = ae(async () => {
2340
2413
  if (e) {
2341
2414
  u(!0), p(null);
2342
2415
  try {
2343
2416
  await t.passOverview(e);
2344
- } catch (P) {
2345
- throw p(P), P;
2417
+ } catch (T) {
2418
+ throw p(T), T;
2346
2419
  } finally {
2347
2420
  u(!1);
2348
2421
  }
@@ -2357,32 +2430,32 @@ function Vr(e) {
2357
2430
  passOverview: A
2358
2431
  };
2359
2432
  }
2360
- function Yr(e) {
2361
- const { identityService: t } = Pe(), [n, a] = k(
2433
+ function Qr(e) {
2434
+ const { identityService: t } = Te(), [n, a] = k(
2362
2435
  null
2363
- ), [i, l] = k(!1), [c, u] = k(null), y = de(!1), p = ae(
2436
+ ), [i, o] = k(!1), [c, u] = k(null), y = de(!1), p = ae(
2364
2437
  async (v, A) => {
2365
2438
  if (e) {
2366
2439
  if (y.current) {
2367
2440
  console.log("[Identity] Request already in progress, skipping...");
2368
2441
  return;
2369
2442
  }
2370
- y.current = !0, l(!0), u(null);
2443
+ y.current = !0, o(!0), u(null);
2371
2444
  try {
2372
- const P = {
2445
+ const T = {
2373
2446
  applicantId: e,
2374
2447
  restart: !1,
2375
2448
  redirectUrl: v || "",
2376
2449
  ttl: A || 604800
2377
2450
  // Default: 7 days
2378
2451
  };
2379
- console.log("Identity request input:", P);
2380
- const w = await t.identityRequest(P);
2452
+ console.log("Identity request input:", T);
2453
+ const w = await t.identityRequest(T);
2381
2454
  return console.log("Identity request result:", w), a(w), w;
2382
- } catch (P) {
2383
- throw u(P), P;
2455
+ } catch (T) {
2456
+ throw u(T), T;
2384
2457
  } finally {
2385
- l(!1), y.current = !1;
2458
+ o(!1), y.current = !1;
2386
2459
  }
2387
2460
  }
2388
2461
  },
@@ -2390,30 +2463,30 @@ function Yr(e) {
2390
2463
  ), x = ae(
2391
2464
  async (v, A) => {
2392
2465
  if (e) {
2393
- l(!0), u(null);
2466
+ o(!0), u(null);
2394
2467
  try {
2395
- const P = {
2468
+ const T = {
2396
2469
  applicantId: e,
2397
2470
  restart: !1,
2398
2471
  redirectUrl: v,
2399
2472
  ttl: A
2400
- }, w = await t.identityCompanyRequest(P);
2473
+ }, w = await t.identityCompanyRequest(T);
2401
2474
  return a(w), w;
2402
- } catch (P) {
2403
- throw u(P), P;
2475
+ } catch (T) {
2476
+ throw u(T), T;
2404
2477
  } finally {
2405
- l(!1);
2478
+ o(!1);
2406
2479
  }
2407
2480
  }
2408
2481
  },
2409
2482
  [e, t]
2410
- ), L = ae(async () => {
2483
+ ), P = ae(async () => {
2411
2484
  if (e) {
2412
2485
  if (y.current) {
2413
2486
  console.log("[Identity] Restart already in progress, skipping...");
2414
2487
  return;
2415
2488
  }
2416
- y.current = !0, l(!0), u(null);
2489
+ y.current = !0, o(!0), u(null);
2417
2490
  try {
2418
2491
  const v = {
2419
2492
  applicantId: e,
@@ -2428,7 +2501,7 @@ function Yr(e) {
2428
2501
  } catch (v) {
2429
2502
  throw u(v), v;
2430
2503
  } finally {
2431
- l(!1), y.current = !1;
2504
+ o(!1), y.current = !1;
2432
2505
  }
2433
2506
  }
2434
2507
  }, [e, t]);
@@ -2440,11 +2513,11 @@ function Yr(e) {
2440
2513
  error: c,
2441
2514
  requestIdentity: p,
2442
2515
  requestCompanyIdentity: x,
2443
- restartIdentity: L
2516
+ restartIdentity: P
2444
2517
  };
2445
2518
  }
2446
- function Qr(e) {
2447
- const { riskScoringService: t, applicantService: n } = Pe(), [a, i] = k(null), [l, c] = k({}), [u, y] = k(!1), [p, x] = k(!1), [L, v] = k(null), [A, P] = k(null), w = de(!1), N = de(null), z = ae(async () => {
2519
+ function Gr(e) {
2520
+ const { riskScoringService: t, applicantService: n } = Te(), [a, i] = k(null), [o, c] = k({}), [u, y] = k(!1), [p, x] = k(!1), [P, v] = k(null), [A, T] = k(null), w = de(!1), N = de(null), z = ae(async () => {
2448
2521
  var M;
2449
2522
  if (e) {
2450
2523
  if (w.current) {
@@ -2476,7 +2549,7 @@ function Qr(e) {
2476
2549
  }
2477
2550
  }
2478
2551
  }, [e, t, n]);
2479
- fe(() => {
2552
+ ge(() => {
2480
2553
  e && N.current !== e && z();
2481
2554
  }, [e]);
2482
2555
  const Q = ae(
@@ -2484,7 +2557,7 @@ function Qr(e) {
2484
2557
  x(!0), v(null);
2485
2558
  try {
2486
2559
  const j = await t.submitRiskScoring(M);
2487
- return P(j), j;
2560
+ return T(j), j;
2488
2561
  } catch (j) {
2489
2562
  throw v(j), j;
2490
2563
  } finally {
@@ -2495,27 +2568,27 @@ function Qr(e) {
2495
2568
  );
2496
2569
  return {
2497
2570
  criteria: a,
2498
- initialAnswers: l,
2571
+ initialAnswers: o,
2499
2572
  result: A,
2500
2573
  isLoading: u,
2501
2574
  isSubmitting: p,
2502
- error: L,
2575
+ error: P,
2503
2576
  load: z,
2504
2577
  submit: Q
2505
2578
  };
2506
2579
  }
2507
2580
  function Ot() {
2508
- const { applicantService: e, config: t } = Pe(), [n, a] = k(!1), [i, l] = k(null), c = de(!1), u = de(!1), y = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(A) {
2509
- const P = Math.random() * 16 | 0;
2510
- return (A === "x" ? P : P & 3 | 8).toString(16);
2581
+ const { applicantService: e, config: t } = Te(), [n, a] = k(!1), [i, o] = k(null), c = de(!1), u = de(!1), y = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(A) {
2582
+ const T = Math.random() * 16 | 0;
2583
+ return (A === "x" ? T : T & 3 | 8).toString(16);
2511
2584
  }), p = ae(
2512
2585
  async (A) => {
2513
- var P;
2586
+ var T;
2514
2587
  if (c.current)
2515
2588
  throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
2516
- c.current = !0, a(!0), l(null);
2589
+ c.current = !0, a(!0), o(null);
2517
2590
  try {
2518
- if (A.applicantAdditionalDatas || (A.applicantAdditionalDatas = []), (P = t.identityProviders) != null && P.sardinai) {
2591
+ if (A.applicantAdditionalDatas || (A.applicantAdditionalDatas = []), (T = t.identityProviders) != null && T.sardinai) {
2519
2592
  const N = y();
2520
2593
  console.log("[SardinAI] Generated session key:", N), A.applicantAdditionalDatas.push({
2521
2594
  paramName: "sessionKey",
@@ -2524,7 +2597,7 @@ function Ot() {
2524
2597
  }
2525
2598
  return await e.createApplicant(A);
2526
2599
  } catch (w) {
2527
- throw l(w), w;
2600
+ throw o(w), w;
2528
2601
  } finally {
2529
2602
  a(!1), c.current = !1;
2530
2603
  }
@@ -2532,25 +2605,25 @@ function Ot() {
2532
2605
  [e, t]
2533
2606
  ), x = ae(
2534
2607
  async (A) => {
2535
- a(!0), l(null);
2608
+ a(!0), o(null);
2536
2609
  try {
2537
2610
  return await e.createCompanyApplicant(A);
2538
- } catch (P) {
2539
- throw l(P), P;
2611
+ } catch (T) {
2612
+ throw o(T), T;
2540
2613
  } finally {
2541
2614
  a(!1);
2542
2615
  }
2543
2616
  },
2544
2617
  [e]
2545
- ), L = ae(
2618
+ ), P = ae(
2546
2619
  async (A) => {
2547
2620
  if (u.current)
2548
2621
  throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
2549
- u.current = !0, a(!0), l(null);
2622
+ u.current = !0, a(!0), o(null);
2550
2623
  try {
2551
2624
  return await e.getApplicantData(A);
2552
- } catch (P) {
2553
- throw l(P), P;
2625
+ } catch (T) {
2626
+ throw o(T), T;
2554
2627
  } finally {
2555
2628
  a(!1), u.current = !1;
2556
2629
  }
@@ -2558,11 +2631,11 @@ function Ot() {
2558
2631
  [e]
2559
2632
  ), v = ae(
2560
2633
  async (A) => {
2561
- a(!0), l(null);
2634
+ a(!0), o(null);
2562
2635
  try {
2563
2636
  await e.stopProgress(A);
2564
- } catch (P) {
2565
- throw l(P), P;
2637
+ } catch (T) {
2638
+ throw o(T), T;
2566
2639
  } finally {
2567
2640
  a(!1);
2568
2641
  }
@@ -2574,11 +2647,11 @@ function Ot() {
2574
2647
  error: i,
2575
2648
  createApplicant: p,
2576
2649
  createCompanyApplicant: x,
2577
- getApplicantData: L,
2650
+ getApplicantData: P,
2578
2651
  stopProgress: v
2579
2652
  };
2580
2653
  }
2581
- const Gr = {
2654
+ const Jr = {
2582
2655
  primary: {
2583
2656
  backgroundColor: "var(--metakyc-primary, #2563eb)",
2584
2657
  color: "#ffffff",
@@ -2610,7 +2683,7 @@ const Gr = {
2610
2683
  size: n = "md",
2611
2684
  isLoading: a = !1,
2612
2685
  disabled: i,
2613
- className: l,
2686
+ className: o,
2614
2687
  style: c,
2615
2688
  ...u
2616
2689
  }) => /* @__PURE__ */ s(
@@ -2620,8 +2693,8 @@ const Gr = {
2620
2693
  sm: "px-3 py-1.5 text-sm",
2621
2694
  md: "px-4 py-2 text-sm",
2622
2695
  lg: "px-6 py-3 text-base"
2623
- }[n], l),
2624
- style: { ...Gr[t], ...c },
2696
+ }[n], o),
2697
+ style: { ...Jr[t], ...c },
2625
2698
  disabled: i || a,
2626
2699
  ...u,
2627
2700
  children: [
@@ -2659,7 +2732,7 @@ const Gr = {
2659
2732
  ]
2660
2733
  }
2661
2734
  ), xe = mt(
2662
- ({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: l, style: c, ...u }, y) => /* @__PURE__ */ s("div", { className: "w-full", children: [
2735
+ ({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: c, ...u }, y) => /* @__PURE__ */ s("div", { className: "w-full", children: [
2663
2736
  e && /* @__PURE__ */ s(
2664
2737
  "label",
2665
2738
  {
@@ -2683,7 +2756,7 @@ const Gr = {
2683
2756
  "disabled:opacity-60 disabled:cursor-not-allowed",
2684
2757
  a ? "pl-10" : "",
2685
2758
  i ? "pr-10" : "",
2686
- l
2759
+ o
2687
2760
  ),
2688
2761
  style: {
2689
2762
  backgroundColor: u.readOnly ? "var(--metakyc-surface, #f3f4f6)" : "var(--metakyc-input-bg, #ffffff)",
@@ -2702,7 +2775,7 @@ const Gr = {
2702
2775
  ] })
2703
2776
  );
2704
2777
  xe.displayName = "Input";
2705
- const te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2778
+ const re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2706
2779
  "div",
2707
2780
  {
2708
2781
  className: Ae(
@@ -2716,7 +2789,7 @@ const te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2716
2789
  ...n,
2717
2790
  children: e
2718
2791
  }
2719
- ), we = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2792
+ ), Se = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2720
2793
  "div",
2721
2794
  {
2722
2795
  className: Ae("px-6 py-4 border-b", t),
@@ -2726,7 +2799,7 @@ const te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2726
2799
  ...n,
2727
2800
  children: e
2728
2801
  }
2729
- ), re = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: Ae("px-6 py-4", t), ...n, children: e }), Ce = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2802
+ ), ne = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: Ae("px-6 py-4", t), ...n, children: e }), Ce = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2730
2803
  "div",
2731
2804
  {
2732
2805
  className: Ae("px-6 py-4 border-t", t),
@@ -2736,7 +2809,7 @@ const te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2736
2809
  ...n,
2737
2810
  children: e
2738
2811
  }
2739
- ), Jr = {
2812
+ ), Zr = {
2740
2813
  // Theme-aware variants
2741
2814
  default: {
2742
2815
  backgroundColor: "var(--metakyc-surface, #f3f4f6)",
@@ -2766,7 +2839,7 @@ const te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2766
2839
  "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
2767
2840
  n
2768
2841
  ),
2769
- style: { ...Jr[t], ...a },
2842
+ style: { ...Zr[t], ...a },
2770
2843
  ...i,
2771
2844
  children: e
2772
2845
  }
@@ -2807,7 +2880,7 @@ const te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2807
2880
  }
2808
2881
  ) });
2809
2882
  }, St = mt(
2810
- ({ label: e, error: t, helperText: n, options: a, placeholder: i, className: l, style: c, ...u }, y) => /* @__PURE__ */ s("div", { className: "w-full", children: [
2883
+ ({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: c, ...u }, y) => /* @__PURE__ */ s("div", { className: "w-full", children: [
2811
2884
  e && /* @__PURE__ */ s(
2812
2885
  "label",
2813
2886
  {
@@ -2828,7 +2901,7 @@ const te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2828
2901
  "focus:outline-none focus:ring-2 focus:ring-offset-0",
2829
2902
  "disabled:opacity-60 disabled:cursor-not-allowed",
2830
2903
  t ? "border-danger-500" : "",
2831
- l
2904
+ o
2832
2905
  ),
2833
2906
  style: {
2834
2907
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
@@ -2872,17 +2945,17 @@ const te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2872
2945
  ] })
2873
2946
  );
2874
2947
  St.displayName = "Select";
2875
- const It = 280, Zr = ({
2948
+ const It = 280, Xr = ({
2876
2949
  label: e,
2877
2950
  value: t,
2878
2951
  onChange: n,
2879
2952
  options: a,
2880
2953
  placeholder: i = "Select...",
2881
- disabled: l = !1,
2954
+ disabled: o = !1,
2882
2955
  readOnly: c = !1,
2883
2956
  required: u = !1
2884
2957
  }) => {
2885
- const y = l || c, [p, x] = k(!1), [L, v] = k(""), [A, P] = k(null), [w, N] = k({
2958
+ const y = o || c, [p, x] = k(!1), [P, v] = k(""), [A, T] = k(null), [w, N] = k({
2886
2959
  bg: "#ffffff",
2887
2960
  borderColor: "#d1d5db",
2888
2961
  textPrimary: "#111827",
@@ -2895,7 +2968,7 @@ const It = 280, Zr = ({
2895
2968
  const F = Q.current.getBoundingClientRect(), $ = window.innerHeight - F.bottom < It && F.top > It;
2896
2969
  return { top: $ ? F.top : F.bottom + 4, left: F.left, width: F.width, openUp: $ };
2897
2970
  }, []), K = ae(() => {
2898
- const F = getComputedStyle(document.documentElement), U = (H, ge) => F.getPropertyValue(H).trim() || ge, $ = U("--metakyc-input-bg", U("--metakyc-background", "#ffffff"));
2971
+ const F = getComputedStyle(document.documentElement), U = (H, fe) => F.getPropertyValue(H).trim() || fe, $ = U("--metakyc-input-bg", U("--metakyc-background", "#ffffff"));
2899
2972
  N({
2900
2973
  bg: $,
2901
2974
  borderColor: U("--metakyc-input-border", U("--metakyc-border", "#d1d5db")),
@@ -2909,30 +2982,30 @@ const It = 280, Zr = ({
2909
2982
  if (y) return;
2910
2983
  K();
2911
2984
  const F = j();
2912
- F && P(F), x(!0);
2985
+ F && T(F), x(!0);
2913
2986
  }, [y, j, K]), E = ae(() => {
2914
2987
  x(!1), v("");
2915
2988
  }, []);
2916
- fe(() => {
2989
+ ge(() => {
2917
2990
  if (!p) return;
2918
2991
  const F = (U) => {
2919
- var H, ge;
2992
+ var H, fe;
2920
2993
  const $ = U.target;
2921
- !((H = z.current) != null && H.contains($)) && !((ge = M.current) != null && ge.contains($)) && E();
2994
+ !((H = z.current) != null && H.contains($)) && !((fe = M.current) != null && fe.contains($)) && E();
2922
2995
  };
2923
2996
  return document.addEventListener("mousedown", F), () => document.removeEventListener("mousedown", F);
2924
- }, [p, E]), fe(() => {
2997
+ }, [p, E]), ge(() => {
2925
2998
  if (!p) return;
2926
2999
  const F = () => {
2927
3000
  const U = j();
2928
- U && P(U);
3001
+ U && T(U);
2929
3002
  };
2930
3003
  return window.addEventListener("scroll", F, !0), window.addEventListener("resize", F), () => {
2931
3004
  window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F);
2932
3005
  };
2933
3006
  }, [p, j]);
2934
3007
  const b = a.filter(
2935
- (F) => F.label.toLowerCase().includes(L.toLowerCase())
3008
+ (F) => F.label.toLowerCase().includes(P.toLowerCase())
2936
3009
  ), B = (F) => {
2937
3010
  y || n(t.includes(F) ? t.filter((U) => U !== F) : [...t, F]);
2938
3011
  }, V = (F, U) => {
@@ -2963,7 +3036,7 @@ const It = 280, Zr = ({
2963
3036
  "input",
2964
3037
  {
2965
3038
  type: "text",
2966
- value: L,
3039
+ value: P,
2967
3040
  onChange: (F) => v(F.target.value),
2968
3041
  placeholder: "Search...",
2969
3042
  autoFocus: !0,
@@ -3145,15 +3218,15 @@ const It = 280, Zr = ({
3145
3218
  helperText: n,
3146
3219
  options: a,
3147
3220
  placeholder: i = "Select...",
3148
- value: l,
3221
+ value: o,
3149
3222
  onChange: c,
3150
3223
  disabled: u = !1,
3151
3224
  readOnly: y = !1,
3152
3225
  required: p = !1,
3153
3226
  className: x
3154
3227
  }) => {
3155
- var ge;
3156
- const L = u || y, [v, A] = k(!1), [P, w] = k(""), [N, z] = k(null), [Q, M] = k({
3228
+ var fe;
3229
+ const P = u || y, [v, A] = k(!1), [T, w] = k(""), [N, z] = k(null), [Q, M] = k({
3157
3230
  bg: "#ffffff",
3158
3231
  border: "#d1d5db",
3159
3232
  text: "#111827",
@@ -3162,15 +3235,15 @@ const It = 280, Zr = ({
3162
3235
  primaryLight: "#eff6ff",
3163
3236
  hoverBg: "#f9fafb"
3164
3237
  }), j = ae(() => {
3165
- const I = getComputedStyle(document.documentElement), ne = (oe, Ne) => I.getPropertyValue(oe).trim() || Ne, ye = ne("--metakyc-input-bg", ne("--metakyc-background", "#ffffff"));
3238
+ const I = getComputedStyle(document.documentElement), te = (oe, Ne) => I.getPropertyValue(oe).trim() || Ne, ye = te("--metakyc-input-bg", te("--metakyc-background", "#ffffff"));
3166
3239
  M({
3167
3240
  bg: ye,
3168
- border: ne("--metakyc-input-border", ne("--metakyc-border", "#d1d5db")),
3169
- text: ne("--metakyc-input-text", ne("--metakyc-text-primary", "#111827")),
3170
- textSecondary: ne("--metakyc-text-secondary", "#6b7280"),
3171
- primary: ne("--metakyc-primary", "#2563eb"),
3172
- primaryLight: ne("--metakyc-primary-light", "#eff6ff"),
3173
- hoverBg: ne("--metakyc-surface", ye)
3241
+ border: te("--metakyc-input-border", te("--metakyc-border", "#d1d5db")),
3242
+ text: te("--metakyc-input-text", te("--metakyc-text-primary", "#111827")),
3243
+ textSecondary: te("--metakyc-text-secondary", "#6b7280"),
3244
+ primary: te("--metakyc-primary", "#2563eb"),
3245
+ primaryLight: te("--metakyc-primary-light", "#eff6ff"),
3246
+ hoverBg: te("--metakyc-surface", ye)
3174
3247
  });
3175
3248
  }, []), K = de(null), ee = de(null), E = de(null), b = de(null), B = ae(() => {
3176
3249
  if (!ee.current) return null;
@@ -3182,40 +3255,40 @@ const It = 280, Zr = ({
3182
3255
  openUp: ye
3183
3256
  };
3184
3257
  }, []), V = ae(() => {
3185
- if (L) return;
3258
+ if (P) return;
3186
3259
  j();
3187
3260
  const I = B();
3188
3261
  I && z(I), A(!0);
3189
- }, [L, B, j]), G = ae(() => {
3262
+ }, [P, B, j]), G = ae(() => {
3190
3263
  A(!1), w("");
3191
3264
  }, []), _ = () => v ? G() : V();
3192
- fe(() => {
3265
+ ge(() => {
3193
3266
  if (!v) return;
3194
- const I = (ne) => {
3267
+ const I = (te) => {
3195
3268
  var oe, Ne;
3196
- const ye = ne.target;
3269
+ const ye = te.target;
3197
3270
  !((oe = K.current) != null && oe.contains(ye)) && !((Ne = E.current) != null && Ne.contains(ye)) && G();
3198
3271
  };
3199
3272
  return document.addEventListener("mousedown", I), () => document.removeEventListener("mousedown", I);
3200
- }, [v, G]), fe(() => {
3273
+ }, [v, G]), ge(() => {
3201
3274
  if (!v) return;
3202
3275
  const I = () => {
3203
- const ne = B();
3204
- ne && z(ne);
3276
+ const te = B();
3277
+ te && z(te);
3205
3278
  };
3206
3279
  return window.addEventListener("scroll", I, !0), window.addEventListener("resize", I), () => {
3207
3280
  window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
3208
3281
  };
3209
- }, [v, B]), fe(() => {
3282
+ }, [v, B]), ge(() => {
3210
3283
  v && b.current && setTimeout(() => {
3211
3284
  var I;
3212
3285
  return (I = b.current) == null ? void 0 : I.focus();
3213
3286
  }, 0);
3214
3287
  }, [v]);
3215
3288
  const J = a.filter(
3216
- (I) => I.label.toLowerCase().includes(P.toLowerCase()) || I.value.toLowerCase().includes(P.toLowerCase())
3217
- ), se = (ge = a.find((I) => I.value === l)) == null ? void 0 : ge.label, Y = (I, ne) => {
3218
- L || ne || (c(I), G());
3289
+ (I) => I.label.toLowerCase().includes(T.toLowerCase()) || I.value.toLowerCase().includes(T.toLowerCase())
3290
+ ), se = (fe = a.find((I) => I.value === o)) == null ? void 0 : fe.label, Y = (I, te) => {
3291
+ P || te || (c(I), G());
3219
3292
  }, { bg: ve, border: ue, text: me, textSecondary: ke, primary: F, primaryLight: U, hoverBg: $ } = Q, H = v && N && /* @__PURE__ */ s(
3220
3293
  "div",
3221
3294
  {
@@ -3240,7 +3313,7 @@ const It = 280, Zr = ({
3240
3313
  {
3241
3314
  ref: b,
3242
3315
  type: "text",
3243
- value: P,
3316
+ value: T,
3244
3317
  onChange: (I) => w(I.target.value),
3245
3318
  placeholder: "Search...",
3246
3319
  onClick: (I) => I.stopPropagation(),
@@ -3258,7 +3331,7 @@ const It = 280, Zr = ({
3258
3331
  boxSizing: "border-box"
3259
3332
  },
3260
3333
  onFocus: (I) => {
3261
- const ne = getComputedStyle(document.documentElement), ye = ne.getPropertyValue("--metakyc-input-border-focus").trim() || ne.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
3334
+ const te = getComputedStyle(document.documentElement), ye = te.getPropertyValue("--metakyc-input-border-focus").trim() || te.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
3262
3335
  I.currentTarget.style.backgroundColor = ve, I.currentTarget.style.color = me, I.currentTarget.style.borderColor = ye, I.currentTarget.style.outline = "none", I.currentTarget.style.boxShadow = `0 0 0 2px ${ye}33`;
3263
3336
  },
3264
3337
  onBlur: (I) => {
@@ -3277,7 +3350,7 @@ const It = 280, Zr = ({
3277
3350
  overflowY: "auto"
3278
3351
  },
3279
3352
  children: J.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: ke }, children: "No results" }) : J.map((I) => {
3280
- const ne = I.value === l;
3353
+ const te = I.value === o;
3281
3354
  return /* @__PURE__ */ r(
3282
3355
  "li",
3283
3356
  {
@@ -3288,15 +3361,15 @@ const It = 280, Zr = ({
3288
3361
  fontSize: "13px",
3289
3362
  cursor: I.disabled ? "not-allowed" : "pointer",
3290
3363
  opacity: I.disabled ? 0.4 : 1,
3291
- backgroundColor: ne ? U : "transparent",
3292
- color: ne ? F : me,
3364
+ backgroundColor: te ? U : "transparent",
3365
+ color: te ? F : me,
3293
3366
  userSelect: "none"
3294
3367
  },
3295
3368
  onMouseEnter: (ye) => {
3296
- !ne && !I.disabled && (ye.currentTarget.style.backgroundColor = $);
3369
+ !te && !I.disabled && (ye.currentTarget.style.backgroundColor = $);
3297
3370
  },
3298
3371
  onMouseLeave: (ye) => {
3299
- ne || (ye.currentTarget.style.backgroundColor = "transparent");
3372
+ te || (ye.currentTarget.style.backgroundColor = "transparent");
3300
3373
  },
3301
3374
  children: I.label
3302
3375
  },
@@ -3330,7 +3403,7 @@ const It = 280, Zr = ({
3330
3403
  {
3331
3404
  ref: ee,
3332
3405
  role: "button",
3333
- tabIndex: L ? -1 : 0,
3406
+ tabIndex: P ? -1 : 0,
3334
3407
  onClick: _,
3335
3408
  onKeyDown: (I) => {
3336
3409
  (I.key === "Enter" || I.key === " ") && (I.preventDefault(), _()), I.key === "Escape" && G();
@@ -3340,7 +3413,7 @@ const It = 280, Zr = ({
3340
3413
  "w-full px-3 py-2 rounded-lg border text-sm transition-colors text-left",
3341
3414
  "flex items-center justify-between gap-2",
3342
3415
  "focus:outline-none",
3343
- L ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
3416
+ P ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
3344
3417
  ),
3345
3418
  style: {
3346
3419
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
@@ -3371,40 +3444,40 @@ const It = 280, Zr = ({
3371
3444
  );
3372
3445
  };
3373
3446
  Ke.displayName = "SearchableSelect";
3374
- function Xr(e) {
3447
+ function en(e) {
3375
3448
  const t = e.type;
3376
3449
  return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : "file";
3377
3450
  }
3378
- const en = ({
3451
+ const tn = ({
3379
3452
  label: e,
3380
3453
  subtitle: t,
3381
3454
  error: n,
3382
3455
  accept: a,
3383
3456
  multiple: i = !1,
3384
- maxSize: l,
3457
+ maxSize: o,
3385
3458
  required: c,
3386
3459
  onChange: u,
3387
3460
  value: y = [],
3388
3461
  className: p
3389
3462
  }) => {
3390
- const [x, L] = k(!1), [v, A] = k(null), P = de(null), w = ae((E) => {
3463
+ const [x, P] = k(!1), [v, A] = k(null), T = de(null), w = ae((E) => {
3391
3464
  if (!E) return;
3392
3465
  A(null);
3393
3466
  const b = Array.from(E);
3394
- if (l && b.filter((V) => V.size > l).length > 0) {
3395
- A(`File exceeds the maximum size of ${bt(l)}`);
3467
+ if (o && b.filter((V) => V.size > o).length > 0) {
3468
+ A(`File exceeds the maximum size of ${bt(o)}`);
3396
3469
  return;
3397
3470
  }
3398
3471
  u == null || u(i ? [...y, ...b] : [b[0]]);
3399
- }, [l, i, u, y]), N = ae((E) => {
3400
- E.preventDefault(), E.stopPropagation(), L(!0);
3472
+ }, [o, i, u, y]), N = ae((E) => {
3473
+ E.preventDefault(), E.stopPropagation(), P(!0);
3401
3474
  }, []), z = ae((E) => {
3402
- E.preventDefault(), E.stopPropagation(), L(!1);
3475
+ E.preventDefault(), E.stopPropagation(), P(!1);
3403
3476
  }, []), Q = ae((E) => {
3404
- E.preventDefault(), E.stopPropagation(), L(!1), w(E.dataTransfer.files);
3477
+ E.preventDefault(), E.stopPropagation(), P(!1), w(E.dataTransfer.files);
3405
3478
  }, [w]), M = () => {
3406
3479
  var E;
3407
- (E = P.current) == null || E.click();
3480
+ (E = T.current) == null || E.click();
3408
3481
  }, j = (E) => {
3409
3482
  A(null);
3410
3483
  const b = y.filter((B, V) => V !== E);
@@ -3450,7 +3523,7 @@ const en = ({
3450
3523
  /* @__PURE__ */ r(
3451
3524
  "input",
3452
3525
  {
3453
- ref: P,
3526
+ ref: T,
3454
3527
  type: "file",
3455
3528
  style: { display: "none" },
3456
3529
  accept: a,
@@ -3501,12 +3574,12 @@ const en = ({
3501
3574
  " ",
3502
3575
  "or drag and drop"
3503
3576
  ] }),
3504
- (a || l) && /* @__PURE__ */ s("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: [
3577
+ (a || o) && /* @__PURE__ */ s("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: [
3505
3578
  a && /* @__PURE__ */ r("span", { children: a }),
3506
- a && l && /* @__PURE__ */ r("span", { children: " · " }),
3507
- l && /* @__PURE__ */ s("span", { children: [
3579
+ a && o && /* @__PURE__ */ r("span", { children: " · " }),
3580
+ o && /* @__PURE__ */ s("span", { children: [
3508
3581
  "Max ",
3509
- bt(l)
3582
+ bt(o)
3510
3583
  ] })
3511
3584
  ] })
3512
3585
  ] })
@@ -3515,7 +3588,7 @@ const en = ({
3515
3588
  }
3516
3589
  ),
3517
3590
  ee && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, b) => {
3518
- const B = Xr(E), V = B === "image", G = V ? URL.createObjectURL(E) : null;
3591
+ const B = en(E), V = B === "image", G = V ? URL.createObjectURL(E) : null;
3519
3592
  return /* @__PURE__ */ s(
3520
3593
  "div",
3521
3594
  {
@@ -3617,7 +3690,7 @@ const en = ({
3617
3690
  }) }),
3618
3691
  K && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: K })
3619
3692
  ] });
3620
- }, tn = mt(
3693
+ }, rn = mt(
3621
3694
  ({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ s("div", { className: "w-full", children: [
3622
3695
  a.label && /* @__PURE__ */ s(
3623
3696
  "label",
@@ -3636,7 +3709,7 @@ const en = ({
3636
3709
  {
3637
3710
  type: "text",
3638
3711
  value: e,
3639
- onChange: (l) => t == null ? void 0 : t(l.target.value),
3712
+ onChange: (o) => t == null ? void 0 : t(o.target.value),
3640
3713
  className: Ae(
3641
3714
  "w-20 rounded-lg border px-3 py-2 text-sm",
3642
3715
  "focus:outline-none focus:ring-2 focus:ring-offset-0"
@@ -3663,7 +3736,7 @@ const en = ({
3663
3736
  a.error && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: a.error })
3664
3737
  ] })
3665
3738
  );
3666
- tn.displayName = "PhoneInput";
3739
+ rn.displayName = "PhoneInput";
3667
3740
  /**
3668
3741
  * @license lucide-react v0.574.0 - ISC
3669
3742
  *
@@ -3677,14 +3750,14 @@ const Bt = (...e) => e.filter((t, n, a) => !!t && t.trim() !== "" && a.indexOf(t
3677
3750
  * This source code is licensed under the ISC license.
3678
3751
  * See the LICENSE file in the root directory of this source tree.
3679
3752
  */
3680
- const rn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3753
+ const nn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3681
3754
  /**
3682
3755
  * @license lucide-react v0.574.0 - ISC
3683
3756
  *
3684
3757
  * This source code is licensed under the ISC license.
3685
3758
  * See the LICENSE file in the root directory of this source tree.
3686
3759
  */
3687
- const nn = (e) => e.replace(
3760
+ const an = (e) => e.replace(
3688
3761
  /^([A-Z])|[\s-_]+(\w)/g,
3689
3762
  (t, n, a) => a ? a.toUpperCase() : n.toLowerCase()
3690
3763
  );
@@ -3695,7 +3768,7 @@ const nn = (e) => e.replace(
3695
3768
  * See the LICENSE file in the root directory of this source tree.
3696
3769
  */
3697
3770
  const Ft = (e) => {
3698
- const t = nn(e);
3771
+ const t = an(e);
3699
3772
  return t.charAt(0).toUpperCase() + t.slice(1);
3700
3773
  };
3701
3774
  /**
@@ -3704,7 +3777,7 @@ const Ft = (e) => {
3704
3777
  * This source code is licensed under the ISC license.
3705
3778
  * See the LICENSE file in the root directory of this source tree.
3706
3779
  */
3707
- var an = {
3780
+ var sn = {
3708
3781
  xmlns: "http://www.w3.org/2000/svg",
3709
3782
  width: 24,
3710
3783
  height: 24,
@@ -3721,7 +3794,7 @@ var an = {
3721
3794
  * This source code is licensed under the ISC license.
3722
3795
  * See the LICENSE file in the root directory of this source tree.
3723
3796
  */
3724
- const sn = (e) => {
3797
+ const on = (e) => {
3725
3798
  for (const t in e)
3726
3799
  if (t.startsWith("aria-") || t === "role" || t === "title")
3727
3800
  return !0;
@@ -3733,32 +3806,32 @@ const sn = (e) => {
3733
3806
  * This source code is licensed under the ISC license.
3734
3807
  * See the LICENSE file in the root directory of this source tree.
3735
3808
  */
3736
- const on = mt(
3809
+ const ln = mt(
3737
3810
  ({
3738
3811
  color: e = "currentColor",
3739
3812
  size: t = 24,
3740
3813
  strokeWidth: n = 2,
3741
3814
  absoluteStrokeWidth: a,
3742
3815
  className: i = "",
3743
- children: l,
3816
+ children: o,
3744
3817
  iconNode: c,
3745
3818
  ...u
3746
3819
  }, y) => kt(
3747
3820
  "svg",
3748
3821
  {
3749
3822
  ref: y,
3750
- ...an,
3823
+ ...sn,
3751
3824
  width: t,
3752
3825
  height: t,
3753
3826
  stroke: e,
3754
3827
  strokeWidth: a ? Number(n) * 24 / Number(t) : n,
3755
3828
  className: Bt("lucide", i),
3756
- ...!l && !sn(u) && { "aria-hidden": "true" },
3829
+ ...!o && !on(u) && { "aria-hidden": "true" },
3757
3830
  ...u
3758
3831
  },
3759
3832
  [
3760
3833
  ...c.map(([p, x]) => kt(p, x)),
3761
- ...Array.isArray(l) ? l : [l]
3834
+ ...Array.isArray(o) ? o : [o]
3762
3835
  ]
3763
3836
  )
3764
3837
  );
@@ -3770,11 +3843,11 @@ const on = mt(
3770
3843
  */
3771
3844
  const $t = (e, t) => {
3772
3845
  const n = mt(
3773
- ({ className: a, ...i }, l) => kt(on, {
3774
- ref: l,
3846
+ ({ className: a, ...i }, o) => kt(ln, {
3847
+ ref: o,
3775
3848
  iconNode: t,
3776
3849
  className: Bt(
3777
- `lucide-${rn(Ft(e))}`,
3850
+ `lucide-${nn(Ft(e))}`,
3778
3851
  `lucide-${e}`,
3779
3852
  a
3780
3853
  ),
@@ -3789,15 +3862,15 @@ const $t = (e, t) => {
3789
3862
  * This source code is licensed under the ISC license.
3790
3863
  * See the LICENSE file in the root directory of this source tree.
3791
3864
  */
3792
- const ln = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], _t = $t("chevron-left", ln);
3865
+ const cn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], _t = $t("chevron-left", cn);
3793
3866
  /**
3794
3867
  * @license lucide-react v0.574.0 - ISC
3795
3868
  *
3796
3869
  * This source code is licensed under the ISC license.
3797
3870
  * See the LICENSE file in the root directory of this source tree.
3798
3871
  */
3799
- const cn = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], jt = $t("chevron-right", cn);
3800
- function dn(e, t) {
3872
+ const dn = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], jt = $t("chevron-right", dn);
3873
+ function un(e, t) {
3801
3874
  const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
3802
3875
  if (e.isRequired && n)
3803
3876
  return e.errorMessage || "This field is required";
@@ -3826,9 +3899,9 @@ function dn(e, t) {
3826
3899
  }
3827
3900
  return null;
3828
3901
  }
3829
- function un(e) {
3902
+ function pn(e) {
3830
3903
  const t = e.flatMap(
3831
- (a, i) => (a.questions ?? []).map((l, c) => ({ question: l, groupIndex: i, qIdx: c }))
3904
+ (a, i) => (a.questions ?? []).map((o, c) => ({ question: o, groupIndex: i, qIdx: c }))
3832
3905
  ), n = /* @__PURE__ */ new Map();
3833
3906
  for (const a of t) {
3834
3907
  const i = a.question.pageNumber != null && a.question.pageNumber > 0 ? a.question.pageNumber : 1;
@@ -3836,17 +3909,17 @@ function un(e) {
3836
3909
  }
3837
3910
  return Array.from(n.entries()).sort(([a], [i]) => a - i).map(([, a]) => a);
3838
3911
  }
3839
- const pn = ({
3912
+ const mn = ({
3840
3913
  applicantId: e,
3841
3914
  onComplete: t,
3842
3915
  onBack: n
3843
3916
  }) => {
3844
- const { questionnaire: a, initialAnswers: i, isLoading: l, isSubmitting: c, error: u, submit: y } = Kr(e), [p, x] = k({}), [L, v] = k({}), [A, P] = k(0);
3845
- Se.useEffect(() => {
3917
+ const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: c, error: u, submit: y } = qr(e), [p, x] = k({}), [P, v] = k({}), [A, T] = k(0);
3918
+ we.useEffect(() => {
3846
3919
  i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && x(i);
3847
3920
  }, [i]);
3848
3921
  const w = De(
3849
- () => a ? un(a.questionGroups) : [],
3922
+ () => a ? pn(a.questionGroups) : [],
3850
3923
  [a]
3851
3924
  ), N = A === w.length - 1, z = w[A] ?? [], Q = ae((E, b) => {
3852
3925
  x((B) => ({ ...B, [E]: b })), v((B) => {
@@ -3856,14 +3929,14 @@ const pn = ({
3856
3929
  }, []), M = ae(() => {
3857
3930
  const E = {};
3858
3931
  for (const { question: b } of z) {
3859
- const B = dn(b, p[b.id] ?? []);
3932
+ const B = un(b, p[b.id] ?? []);
3860
3933
  B && (E[b.id] = B);
3861
3934
  }
3862
3935
  return v((b) => ({ ...b, ...E })), Object.keys(E).length === 0;
3863
3936
  }, [z, p]), j = () => {
3864
- M() && P((E) => E + 1);
3937
+ M() && T((E) => E + 1);
3865
3938
  }, K = () => {
3866
- A > 0 ? P((E) => E - 1) : n == null || n();
3939
+ A > 0 ? T((E) => E - 1) : n == null || n();
3867
3940
  }, ee = async () => {
3868
3941
  if (!(!M() || !a))
3869
3942
  try {
@@ -3882,11 +3955,11 @@ const pn = ({
3882
3955
  console.error("Questionnaire submit error:", E);
3883
3956
  }
3884
3957
  };
3885
- return l ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3958
+ return o ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3886
3959
  "Error loading questionnaire: ",
3887
3960
  u.message
3888
- ] }) }) }) : a ? /* @__PURE__ */ s(te, { children: [
3889
- /* @__PURE__ */ s(we, { children: [
3961
+ ] }) }) }) : a ? /* @__PURE__ */ s(re, { children: [
3962
+ /* @__PURE__ */ s(Se, { children: [
3890
3963
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
3891
3964
  a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
3892
3965
  w.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
@@ -3910,12 +3983,12 @@ const pn = ({
3910
3983
  )) })
3911
3984
  ] })
3912
3985
  ] }),
3913
- /* @__PURE__ */ r(re, { className: "space-y-6", children: z.map(({ question: E }) => /* @__PURE__ */ r(
3914
- mn,
3986
+ /* @__PURE__ */ r(ne, { className: "space-y-6", children: z.map(({ question: E }) => /* @__PURE__ */ r(
3987
+ yn,
3915
3988
  {
3916
3989
  question: E,
3917
3990
  value: p[E.id] ?? [],
3918
- error: L[E.id],
3991
+ error: P[E.id],
3919
3992
  onChange: (b) => Q(E.id, b)
3920
3993
  },
3921
3994
  E.id
@@ -3957,9 +4030,9 @@ const pn = ({
3957
4030
  ] }),
3958
4031
  u && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: u.message }) })
3959
4032
  ] }) : null;
3960
- }, mn = ({ question: e, value: t, error: n, onChange: a }) => {
4033
+ }, yn = ({ question: e, value: t, error: n, onChange: a }) => {
3961
4034
  var c;
3962
- const l = (((c = e.defaultAnswers) == null ? void 0 : c.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
4035
+ const o = (((c = e.defaultAnswers) == null ? void 0 : c.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
3963
4036
  return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
3964
4037
  /* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
3965
4038
  e.text,
@@ -3967,7 +4040,7 @@ const pn = ({
3967
4040
  ] }),
3968
4041
  e.subtitle && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.subtitle }),
3969
4042
  e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.description }),
3970
- l === "text" && /* @__PURE__ */ r(
4043
+ o === "text" && /* @__PURE__ */ r(
3971
4044
  xe,
3972
4045
  {
3973
4046
  value: t[0] ?? "",
@@ -3977,7 +4050,7 @@ const pn = ({
3977
4050
  required: e.isRequired
3978
4051
  }
3979
4052
  ),
3980
- l === "single-select" && /* @__PURE__ */ r(
4053
+ o === "single-select" && /* @__PURE__ */ r(
3981
4054
  St,
3982
4055
  {
3983
4056
  value: t[0] ?? "",
@@ -3988,7 +4061,7 @@ const pn = ({
3988
4061
  required: e.isRequired
3989
4062
  }
3990
4063
  ),
3991
- l === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4064
+ o === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3992
4065
  (e.defaultAnswers ?? []).map((u) => /* @__PURE__ */ s(
3993
4066
  "label",
3994
4067
  {
@@ -4024,7 +4097,7 @@ const pn = ({
4024
4097
  )),
4025
4098
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4026
4099
  ] }),
4027
- (l === "checkbox" || l === "multi-select") && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4100
+ (o === "checkbox" || o === "multi-select") && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4028
4101
  (e.defaultAnswers ?? []).map((u) => /* @__PURE__ */ s(
4029
4102
  "label",
4030
4103
  {
@@ -4062,10 +4135,10 @@ const pn = ({
4062
4135
  )),
4063
4136
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4064
4137
  ] }),
4065
- n && l === "text" && null
4138
+ n && o === "text" && null
4066
4139
  ] });
4067
4140
  };
4068
- function yn(e) {
4141
+ function hn(e) {
4069
4142
  const t = /* @__PURE__ */ new Map();
4070
4143
  for (const n of e) {
4071
4144
  const a = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
@@ -4073,13 +4146,13 @@ function yn(e) {
4073
4146
  }
4074
4147
  return Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
4075
4148
  }
4076
- const hn = ({
4149
+ const fn = ({
4077
4150
  applicantId: e,
4078
4151
  onComplete: t,
4079
4152
  onBack: n
4080
4153
  }) => {
4081
- const { uploadDocument: a, isLoading: i, isSubmitting: l, error: c, submit: u } = qr(e), [y, p] = k({}), [x, L] = k(null), [v, A] = k(0), [P, w] = k({}), N = De(
4082
- () => a ? yn(a.uploadDocumentFiles) : [],
4154
+ const { uploadDocument: a, isLoading: i, isSubmitting: o, error: c, submit: u } = Vr(e), [y, p] = k({}), [x, P] = k(null), [v, A] = k(0), [T, w] = k({}), N = De(
4155
+ () => a ? hn(a.uploadDocumentFiles) : [],
4083
4156
  [a]
4084
4157
  ), z = N[v] ?? [], Q = v === N.length - 1, M = N.length, j = ae(() => {
4085
4158
  const b = {};
@@ -4092,14 +4165,14 @@ const hn = ({
4092
4165
  v > 0 ? (A((b) => b - 1), w({})) : n == null || n();
4093
4166
  }, E = async () => {
4094
4167
  if (!(!j() || !a)) {
4095
- L(null);
4168
+ P(null);
4096
4169
  try {
4097
4170
  const b = await Promise.all(
4098
4171
  a.uploadDocumentFiles.map(async (V) => {
4099
4172
  const G = y[V.id] || [], _ = await Promise.all(
4100
4173
  G.map(async (J) => ({
4101
4174
  fileName: J.name,
4102
- fileData: await Br(J)
4175
+ fileData: await $r(J)
4103
4176
  }))
4104
4177
  );
4105
4178
  return {
@@ -4114,14 +4187,14 @@ const hn = ({
4114
4187
  };
4115
4188
  await u(B), t == null || t();
4116
4189
  } catch (b) {
4117
- L((b == null ? void 0 : b.message) || "Failed to submit documents. Please try again.");
4190
+ P((b == null ? void 0 : b.message) || "Failed to submit documents. Please try again.");
4118
4191
  }
4119
4192
  }
4120
4193
  };
4121
- return i ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
4194
+ return i ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
4122
4195
  /* @__PURE__ */ r(Me, { className: "my-8" }),
4123
4196
  /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Loading document requirements..." })
4124
- ] }) }) }) : c ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { style: {
4197
+ ] }) }) }) : c ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { style: {
4125
4198
  display: "flex",
4126
4199
  flexDirection: "column",
4127
4200
  alignItems: "center",
@@ -4144,8 +4217,8 @@ const hn = ({
4144
4217
  ] }) }),
4145
4218
  /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-danger, #ef4444)", fontWeight: 500 }, children: "Error loading document requirements" }),
4146
4219
  /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: c.message })
4147
- ] }) }) }) : a ? /* @__PURE__ */ s(te, { children: [
4148
- /* @__PURE__ */ s(we, { children: [
4220
+ ] }) }) }) : a ? /* @__PURE__ */ s(re, { children: [
4221
+ /* @__PURE__ */ s(Se, { children: [
4149
4222
  /* @__PURE__ */ r("h2", { style: {
4150
4223
  fontSize: "18px",
4151
4224
  fontWeight: 700,
@@ -4220,8 +4293,8 @@ const hn = ({
4220
4293
  lineHeight: 1.5
4221
4294
  }, children: a.description })
4222
4295
  ] }),
4223
- /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((b) => /* @__PURE__ */ r(
4224
- en,
4296
+ /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((b) => /* @__PURE__ */ r(
4297
+ tn,
4225
4298
  {
4226
4299
  label: b.displayName,
4227
4300
  subtitle: b.subtitle,
@@ -4229,10 +4302,10 @@ const hn = ({
4229
4302
  multiple: b.multipleFile,
4230
4303
  maxSize: b.maxEachFileSizeByte,
4231
4304
  required: b.isRequired,
4232
- error: P[b.id],
4305
+ error: T[b.id],
4233
4306
  value: y[b.id] || [],
4234
4307
  onChange: (B) => {
4235
- L(null), w((V) => {
4308
+ P(null), w((V) => {
4236
4309
  const G = { ...V };
4237
4310
  return delete G[b.id], G;
4238
4311
  }), p((V) => ({ ...V, [b.id]: B }));
@@ -4276,9 +4349,9 @@ const hn = ({
4276
4349
  Z,
4277
4350
  {
4278
4351
  type: "button",
4279
- isLoading: l,
4352
+ isLoading: o,
4280
4353
  onClick: E,
4281
- children: l ? "Uploading..." : "Continue"
4354
+ children: o ? "Uploading..." : "Continue"
4282
4355
  }
4283
4356
  ) : /* @__PURE__ */ r(
4284
4357
  Z,
@@ -4291,18 +4364,18 @@ const hn = ({
4291
4364
  ] }) })
4292
4365
  ] }) : null;
4293
4366
  }, gn = ({ applicantId: e, onComplete: t, onBack: n }) => {
4294
- const { overview: a, isLoading: i, isSubmitting: l, error: c, passOverview: u } = Vr(e), y = async () => {
4367
+ const { overview: a, isLoading: i, isSubmitting: o, error: c, passOverview: u } = Yr(e), y = async () => {
4295
4368
  await u(), t == null || t();
4296
4369
  };
4297
- return i ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
4370
+ return i ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
4298
4371
  "Error loading overview: ",
4299
4372
  c.message
4300
- ] }) }) }) : a ? /* @__PURE__ */ s(te, { children: [
4301
- /* @__PURE__ */ s(we, { children: [
4373
+ ] }) }) }) : a ? /* @__PURE__ */ s(re, { children: [
4374
+ /* @__PURE__ */ s(Se, { children: [
4302
4375
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
4303
4376
  a.description && /* @__PURE__ */ r("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.description })
4304
4377
  ] }),
4305
- /* @__PURE__ */ r(re, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((p, x) => p.order - x.order).map((p) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
4378
+ /* @__PURE__ */ r(ne, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((p, x) => p.order - x.order).map((p) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
4306
4379
  /* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r(
4307
4380
  "div",
4308
4381
  {
@@ -4330,11 +4403,11 @@ const hn = ({
4330
4403
  ] }, p.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading overview data..." }) }) }),
4331
4404
  /* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
4332
4405
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4333
- /* @__PURE__ */ r(Z, { onClick: y, isLoading: l, children: "Continue" })
4406
+ /* @__PURE__ */ r(Z, { onClick: y, isLoading: o, children: "Continue" })
4334
4407
  ] })
4335
4408
  ] }) : null;
4336
4409
  };
4337
- function fn(e) {
4410
+ function bn(e) {
4338
4411
  const t = (e ?? "en").toLowerCase().replace("_", "-");
4339
4412
  try {
4340
4413
  return Intl.NumberFormat.supportedLocalesOf([t]), t;
@@ -4342,11 +4415,11 @@ function fn(e) {
4342
4415
  return "en";
4343
4416
  }
4344
4417
  }
4345
- function bn(e) {
4418
+ function xn(e) {
4346
4419
  return e.valueDataType === Ue.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
4347
4420
  }
4348
- function xn(e, t) {
4349
- const n = new Intl.NumberFormat(fn(t), {
4421
+ function vn(e, t) {
4422
+ const n = new Intl.NumberFormat(bn(t), {
4350
4423
  minimumFractionDigits: 0,
4351
4424
  maximumFractionDigits: 2
4352
4425
  });
@@ -4355,7 +4428,7 @@ function xn(e, t) {
4355
4428
  return isNaN(i) ? a : n.format(i);
4356
4429
  });
4357
4430
  }
4358
- function vn(e, t) {
4431
+ function kn(e, t) {
4359
4432
  const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
4360
4433
  if (e.isRequired && n)
4361
4434
  return e.errorMessage || `${e.displayName} is required`;
@@ -4369,11 +4442,11 @@ function vn(e, t) {
4369
4442
  }
4370
4443
  const i = e.valueDataType === Ue.Integer || e.valueDataType === Ue.Money || e.valueDataType === Ue.DigitOnly;
4371
4444
  if (i && a.trim() !== "") {
4372
- const l = Number(a);
4373
- if (!isNaN(l)) {
4374
- if (e.min !== void 0 && e.min !== null && l < e.min)
4445
+ const o = Number(a);
4446
+ if (!isNaN(o)) {
4447
+ if (e.min !== void 0 && e.min !== null && o < e.min)
4375
4448
  return `Minimum value is ${e.min}`;
4376
- if (e.max !== void 0 && e.max !== null && l > e.max)
4449
+ if (e.max !== void 0 && e.max !== null && o > e.max)
4377
4450
  return `Maximum value is ${e.max}`;
4378
4451
  }
4379
4452
  } else if (!i && a !== "") {
@@ -4385,53 +4458,53 @@ function vn(e, t) {
4385
4458
  }
4386
4459
  return null;
4387
4460
  }
4388
- function kn(e) {
4461
+ function wn(e) {
4389
4462
  const t = /* @__PURE__ */ new Map();
4390
4463
  return e.forEach((n, a) => {
4391
4464
  const i = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
4392
4465
  t.has(i) || t.set(i, []), t.get(i).push({ criterion: n, idx: a });
4393
4466
  }), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
4394
4467
  }
4395
- function wn(e) {
4468
+ function Sn(e) {
4396
4469
  return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
4397
4470
  }
4398
- const Sn = ({
4471
+ const Cn = ({
4399
4472
  applicantId: e,
4400
4473
  onComplete: t,
4401
4474
  onBack: n
4402
4475
  }) => {
4403
- const { config: a } = Pe(), i = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: y, error: p, submit: x } = Qr(e), [L, v] = k({}), [A, P] = k({}), [w, N] = k(0), [z, Q] = k(!1);
4404
- Se.useEffect(() => {
4405
- c && Object.keys(c).length > 0 && Object.keys(L).length === 0 && v(c);
4476
+ const { config: a } = Te(), i = a.locale ?? "en", { criteria: o, initialAnswers: c, isLoading: u, isSubmitting: y, error: p, submit: x } = Gr(e), [P, v] = k({}), [A, T] = k({}), [w, N] = k(0), [z, Q] = k(!1);
4477
+ we.useEffect(() => {
4478
+ c && Object.keys(c).length > 0 && Object.keys(P).length === 0 && v(c);
4406
4479
  }, [c]);
4407
4480
  const M = De(
4408
- () => l && l.length > 0 ? kn(l) : [],
4409
- [l]
4481
+ () => o && o.length > 0 ? wn(o) : [],
4482
+ [o]
4410
4483
  ), j = w === M.length - 1, K = M[w] ?? [];
4411
- Se.useEffect(() => {
4412
- !u && l && l.length === 0 && !z && !y && (Q(!0), x({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
4413
- }, [u, l, z, y, x, e, t]);
4484
+ we.useEffect(() => {
4485
+ !u && o && o.length === 0 && !z && !y && (Q(!0), x({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
4486
+ }, [u, o, z, y, x, e, t]);
4414
4487
  const ee = ae((G, _) => {
4415
- v((J) => ({ ...J, [G]: _ })), P((J) => {
4488
+ v((J) => ({ ...J, [G]: _ })), T((J) => {
4416
4489
  const se = { ...J };
4417
4490
  return delete se[G], se;
4418
4491
  });
4419
4492
  }, []), E = ae(() => {
4420
4493
  const G = {};
4421
4494
  for (const { criterion: _ } of K) {
4422
- const J = vn(_, L[_.id] ?? []);
4495
+ const J = kn(_, P[_.id] ?? []);
4423
4496
  J && (G[_.id] = J);
4424
4497
  }
4425
- return P((_) => ({ ..._, ...G })), Object.keys(G).length === 0;
4426
- }, [K, L]), b = () => {
4498
+ return T((_) => ({ ..._, ...G })), Object.keys(G).length === 0;
4499
+ }, [K, P]), b = () => {
4427
4500
  E() && N((G) => G + 1);
4428
4501
  }, B = () => {
4429
4502
  w > 0 ? N((G) => G - 1) : n == null || n();
4430
4503
  }, V = async () => {
4431
- if (!(!E() || !l))
4504
+ if (!(!E() || !o))
4432
4505
  try {
4433
- const G = l.map((J) => {
4434
- const se = (L[J.id] ?? []).filter((Y) => Y && Y.trim());
4506
+ const G = o.map((J) => {
4507
+ const se = (P[J.id] ?? []).filter((Y) => Y && Y.trim());
4435
4508
  return se.length > 0 ? { riskCriteriaId: J.id, values: se } : null;
4436
4509
  }).filter((J) => J !== null);
4437
4510
  await x({ applicantId: e, criteriaValueInputs: G }), t == null || t();
@@ -4439,17 +4512,17 @@ const Sn = ({
4439
4512
  console.error("Risk scoring submit error:", G);
4440
4513
  }
4441
4514
  };
4442
- return u ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ s(re, { children: [
4515
+ return u ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
4443
4516
  /* @__PURE__ */ r(Me, { className: "my-8" }),
4444
4517
  /* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
4445
- ] }) }) : !u && l && l.length === 0 ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ s(re, { children: [
4518
+ ] }) }) : !u && o && o.length === 0 ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
4446
4519
  /* @__PURE__ */ r(Me, { className: "my-8" }),
4447
4520
  /* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
4448
- ] }) }) : p ? /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
4521
+ ] }) }) : p ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
4449
4522
  "Error loading criteria: ",
4450
4523
  p.message
4451
- ] }) }) }) : l ? /* @__PURE__ */ s(te, { children: [
4452
- /* @__PURE__ */ s(we, { children: [
4524
+ ] }) }) }) : o ? /* @__PURE__ */ s(re, { children: [
4525
+ /* @__PURE__ */ s(Se, { children: [
4453
4526
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
4454
4527
  /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
4455
4528
  M.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
@@ -4473,11 +4546,11 @@ const Sn = ({
4473
4546
  )) })
4474
4547
  ] })
4475
4548
  ] }),
4476
- /* @__PURE__ */ r(re, { className: "space-y-6", children: K.map(({ criterion: G }) => /* @__PURE__ */ r(
4477
- Cn,
4549
+ /* @__PURE__ */ r(ne, { className: "space-y-6", children: K.map(({ criterion: G }) => /* @__PURE__ */ r(
4550
+ Nn,
4478
4551
  {
4479
4552
  criterion: G,
4480
- value: L[G.id] ?? [],
4553
+ value: P[G.id] ?? [],
4481
4554
  error: A[G.id],
4482
4555
  locale: i,
4483
4556
  onChange: (_) => ee(G.id, _)
@@ -4513,8 +4586,8 @@ const Sn = ({
4513
4586
  ] }),
4514
4587
  p && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: p.message }) })
4515
4588
  ] }) : null;
4516
- }, Cn = ({ criterion: e, value: t, error: n, locale: a, onChange: i }) => {
4517
- const l = wn(e), c = e.valueDataType === Ue.Integer || e.valueDataType === Ue.Money || e.valueDataType === Ue.DigitOnly, u = bn(e), y = (p) => u ? xn(p, a) : p;
4589
+ }, Nn = ({ criterion: e, value: t, error: n, locale: a, onChange: i }) => {
4590
+ const o = Sn(e), c = e.valueDataType === Ue.Integer || e.valueDataType === Ue.Money || e.valueDataType === Ue.DigitOnly, u = xn(e), y = (p) => u ? vn(p, a) : p;
4518
4591
  return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
4519
4592
  /* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
4520
4593
  e.displayName,
@@ -4522,7 +4595,7 @@ const Sn = ({
4522
4595
  ] }),
4523
4596
  e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
4524
4597
  c && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.min !== void 0 && e.max !== void 0 ? `Range: ${e.min} – ${e.max}` : e.min !== void 0 ? `Minimum: ${e.min}` : `Maximum: ${e.max}` }),
4525
- l === "text" && /* @__PURE__ */ r(
4598
+ o === "text" && /* @__PURE__ */ r(
4526
4599
  xe,
4527
4600
  {
4528
4601
  value: t[0] ?? "",
@@ -4538,7 +4611,7 @@ const Sn = ({
4538
4611
  }
4539
4612
  }
4540
4613
  ),
4541
- l === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4614
+ o === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4542
4615
  (e.defaultValues ?? []).map((p) => /* @__PURE__ */ s(
4543
4616
  "label",
4544
4617
  {
@@ -4574,7 +4647,7 @@ const Sn = ({
4574
4647
  )),
4575
4648
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4576
4649
  ] }),
4577
- l === "checkbox" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4650
+ o === "checkbox" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4578
4651
  (e.defaultValues ?? []).map((p) => /* @__PURE__ */ s(
4579
4652
  "label",
4580
4653
  {
@@ -4587,7 +4660,7 @@ const Sn = ({
4587
4660
  type: "checkbox",
4588
4661
  checked: t.includes(p),
4589
4662
  onChange: (x) => {
4590
- x.target.checked ? i([...t, p]) : i(t.filter((L) => L !== p));
4663
+ x.target.checked ? i([...t, p]) : i(t.filter((P) => P !== p));
4591
4664
  },
4592
4665
  className: "metakyc-option-input",
4593
4666
  style: {
@@ -4612,7 +4685,7 @@ const Sn = ({
4612
4685
  )),
4613
4686
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4614
4687
  ] }),
4615
- l === "country" && /* @__PURE__ */ r(
4688
+ o === "country" && /* @__PURE__ */ r(
4616
4689
  St,
4617
4690
  {
4618
4691
  value: t[0] ?? "",
@@ -4630,14 +4703,14 @@ const Sn = ({
4630
4703
  }
4631
4704
  )
4632
4705
  ] });
4633
- }, Nn = ({
4706
+ }, Rn = ({
4634
4707
  applicantId: e,
4635
4708
  onComplete: t,
4636
4709
  onBack: n
4637
4710
  }) => {
4638
- const { investorCategorizationService: a } = Pe(), [i, l] = k(null), [c, u] = k(!1), [y, p] = k(null);
4639
- return /* @__PURE__ */ r("form", { onSubmit: async (L) => {
4640
- if (L.preventDefault(), i === null) {
4711
+ const { investorCategorizationService: a } = Te(), [i, o] = k(null), [c, u] = k(!1), [y, p] = k(null);
4712
+ return /* @__PURE__ */ r("form", { onSubmit: async (P) => {
4713
+ if (P.preventDefault(), i === null) {
4641
4714
  p("Please select an investor type");
4642
4715
  return;
4643
4716
  }
@@ -4655,12 +4728,12 @@ const Sn = ({
4655
4728
  } finally {
4656
4729
  u(!1);
4657
4730
  }
4658
- }, children: /* @__PURE__ */ s(te, { children: [
4659
- /* @__PURE__ */ s(we, { children: [
4731
+ }, children: /* @__PURE__ */ s(re, { children: [
4732
+ /* @__PURE__ */ s(Se, { children: [
4660
4733
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Which statement best describes you?" }),
4661
4734
  /* @__PURE__ */ r("p", { className: "mt-2", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
4662
4735
  ] }),
4663
- /* @__PURE__ */ s(re, { className: "space-y-4", children: [
4736
+ /* @__PURE__ */ s(ne, { className: "space-y-4", children: [
4664
4737
  /* @__PURE__ */ r("p", { className: "text-sm font-medium mb-3", style: { color: "var(--metakyc-text-secondary, #374151)" }, children: "Choose one" }),
4665
4738
  /* @__PURE__ */ r(
4666
4739
  "label",
@@ -4678,7 +4751,7 @@ const Sn = ({
4678
4751
  name: "investorType",
4679
4752
  value: Ee.Individual,
4680
4753
  checked: i === Ee.Individual,
4681
- onChange: () => l(Ee.Individual),
4754
+ onChange: () => o(Ee.Individual),
4682
4755
  className: "mt-1"
4683
4756
  }
4684
4757
  ),
@@ -4705,7 +4778,7 @@ const Sn = ({
4705
4778
  name: "investorType",
4706
4779
  value: Ee.Sophisticated,
4707
4780
  checked: i === Ee.Sophisticated,
4708
- onChange: () => l(Ee.Sophisticated),
4781
+ onChange: () => o(Ee.Sophisticated),
4709
4782
  className: "mt-1"
4710
4783
  }
4711
4784
  ),
@@ -4737,7 +4810,7 @@ const Sn = ({
4737
4810
  name: "investorType",
4738
4811
  value: Ee.HighNetWorth,
4739
4812
  checked: i === Ee.HighNetWorth,
4740
- onChange: () => l(Ee.HighNetWorth),
4813
+ onChange: () => o(Ee.HighNetWorth),
4741
4814
  className: "mt-1"
4742
4815
  }
4743
4816
  ),
@@ -4780,50 +4853,50 @@ function xt(e) {
4780
4853
  const t = Math.floor(e / 60), n = e % 60;
4781
4854
  return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
4782
4855
  }
4783
- const Rn = ({
4856
+ const In = ({
4784
4857
  applicantId: e,
4785
4858
  onComplete: t,
4786
4859
  onBack: n
4787
4860
  }) => {
4788
- const { appropriatenessTestService: a } = Pe(), [i, l] = k(null), [c, u] = k(!0), [y, p] = k(!1), [x, L] = k(null), [v, A] = k({}), [P, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [ee, E] = k(0), [b, B] = k(null);
4789
- fe(() => {
4861
+ const { appropriatenessTestService: a } = Te(), [i, o] = k(null), [c, u] = k(!0), [y, p] = k(!1), [x, P] = k(null), [v, A] = k({}), [T, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [ee, E] = k(0), [b, B] = k(null);
4862
+ ge(() => {
4790
4863
  (async () => {
4791
4864
  try {
4792
- u(!0), L(null);
4865
+ u(!0), P(null);
4793
4866
  const $ = await a.getAppropriatenessTest(e);
4794
- if (l($), $.waitTimeSpanForNextTry && $.waitTimeSpanForNextTry !== "00:00:00") {
4867
+ if (o($), $.waitTimeSpanForNextTry && $.waitTimeSpanForNextTry !== "00:00:00") {
4795
4868
  const H = At($.waitTimeSpanForNextTry);
4796
4869
  H > 0 && K(H);
4797
4870
  }
4798
4871
  } catch ($) {
4799
- L($.message || "Failed to load appropriateness test");
4872
+ P($.message || "Failed to load appropriateness test");
4800
4873
  } finally {
4801
4874
  u(!1);
4802
4875
  }
4803
4876
  })();
4804
- }, [e, a]), fe(() => {
4805
- if (!N || P <= 0) return;
4877
+ }, [e, a]), ge(() => {
4878
+ if (!N || T <= 0) return;
4806
4879
  const $ = setInterval(() => {
4807
4880
  w((H) => H <= 1 ? (M(!0), 0) : H - 1);
4808
4881
  }, 1e3);
4809
4882
  return () => clearInterval($);
4810
- }, [N, P]), fe(() => {
4883
+ }, [N, T]), ge(() => {
4811
4884
  if (j <= 0) return;
4812
4885
  const $ = setInterval(() => {
4813
4886
  K((H) => H <= 1 ? 0 : H - 1);
4814
4887
  }, 1e3);
4815
4888
  return () => clearInterval($);
4816
- }, [j]), fe(() => {
4889
+ }, [j]), ge(() => {
4817
4890
  Q && !y && J();
4818
4891
  }, [Q]);
4819
4892
  const V = () => {
4820
- i && (z(!0), w(i.testDurationSec), E(0), A({}), L(null));
4893
+ i && (z(!0), w(i.testDurationSec), E(0), A({}), P(null));
4821
4894
  }, G = ($, H) => {
4822
- A((ge) => ({ ...ge, [$]: H }));
4895
+ A((fe) => ({ ...fe, [$]: H }));
4823
4896
  }, _ = ae(async () => {
4824
4897
  try {
4825
4898
  const $ = await a.getAppropriatenessTest(e);
4826
- if (l($), $.waitTimeSpanForNextTry && $.waitTimeSpanForNextTry !== "00:00:00") {
4899
+ if (o($), $.waitTimeSpanForNextTry && $.waitTimeSpanForNextTry !== "00:00:00") {
4827
4900
  const H = At($.waitTimeSpanForNextTry);
4828
4901
  H > 0 && K(H);
4829
4902
  }
@@ -4834,21 +4907,21 @@ const Rn = ({
4834
4907
  if (!Q) {
4835
4908
  const H = i.appropriatenessQuestions.length - Object.keys(v).length;
4836
4909
  if (H > 0) {
4837
- L(`Please answer all questions. ${H} remaining.`);
4910
+ P(`Please answer all questions. ${H} remaining.`);
4838
4911
  return;
4839
4912
  }
4840
4913
  }
4841
- p(!0), L(null);
4914
+ p(!0), P(null);
4842
4915
  try {
4843
4916
  const H = i.appropriatenessQuestions.map(
4844
4917
  (I) => ({ appropriatenessQuestionId: I.id, value: v[I.id] || "" })
4845
- ), ge = {
4918
+ ), fe = {
4846
4919
  applicantId: e,
4847
4920
  appropriatenessTestId: i.id,
4848
4921
  appropriatenessQuestionResults: H
4849
4922
  };
4850
4923
  try {
4851
- const I = await a.fillAppropriatenessTest(ge);
4924
+ const I = await a.fillAppropriatenessTest(fe);
4852
4925
  I.isSuccess ? B({ success: !0, message: I.message || "Congratulations! You have passed the test." }) : (B({ success: !1, message: I.message || "You did not pass the test." }), setTimeout(() => _(), 1e3));
4853
4926
  } catch (I) {
4854
4927
  if (I.code === 400 && I.message)
@@ -4857,7 +4930,7 @@ const Rn = ({
4857
4930
  throw I;
4858
4931
  }
4859
4932
  } catch (H) {
4860
- L(H.message || "Failed to submit test. Please try again."), se();
4933
+ P(H.message || "Failed to submit test. Please try again."), se();
4861
4934
  } finally {
4862
4935
  p(!1);
4863
4936
  }
@@ -4866,20 +4939,20 @@ const Rn = ({
4866
4939
  z(!1), M(!1), A({}), E(0);
4867
4940
  };
4868
4941
  if (c)
4869
- return /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
4942
+ return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
4870
4943
  /* @__PURE__ */ r(Me, { className: "my-8" }),
4871
4944
  /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Loading test..." })
4872
4945
  ] }) }) });
4873
4946
  if (!i)
4874
- return /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
4947
+ return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
4875
4948
  /* @__PURE__ */ r("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: "No test data available" }),
4876
4949
  x && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: x })
4877
4950
  ] }) }) });
4878
4951
  const Y = i.testAllowedMaxTry - i.totalFailedTries, ve = i.appropriatenessQuestions.length, ue = Object.keys(v).length;
4879
4952
  if (j > 0)
4880
- return /* @__PURE__ */ s(te, { children: [
4881
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }) }),
4882
- /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
4953
+ return /* @__PURE__ */ s(re, { children: [
4954
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }) }),
4955
+ /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
4883
4956
  /* @__PURE__ */ r("div", { style: {
4884
4957
  width: "100px",
4885
4958
  height: "100px",
@@ -4908,10 +4981,10 @@ const Rn = ({
4908
4981
  ] });
4909
4982
  if (b) {
4910
4983
  const $ = () => {
4911
- B(null), se(), L(null);
4984
+ B(null), se(), P(null);
4912
4985
  };
4913
- return /* @__PURE__ */ s(te, { children: [
4914
- /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { style: {
4986
+ return /* @__PURE__ */ s(re, { children: [
4987
+ /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { style: {
4915
4988
  display: "flex",
4916
4989
  flexDirection: "column",
4917
4990
  alignItems: "center",
@@ -4986,12 +5059,12 @@ const Rn = ({
4986
5059
  ] });
4987
5060
  }
4988
5061
  if (!N)
4989
- return /* @__PURE__ */ s(te, { children: [
4990
- /* @__PURE__ */ s(we, { children: [
5062
+ return /* @__PURE__ */ s(re, { children: [
5063
+ /* @__PURE__ */ s(Se, { children: [
4991
5064
  /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }),
4992
5065
  i.subtitle && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", marginTop: "4px" }, children: i.subtitle })
4993
5066
  ] }),
4994
- /* @__PURE__ */ s(re, { children: [
5067
+ /* @__PURE__ */ s(ne, { children: [
4995
5068
  i.description && /* @__PURE__ */ s("div", { style: {
4996
5069
  marginBottom: "20px",
4997
5070
  padding: "12px 14px",
@@ -5054,9 +5127,9 @@ const Rn = ({
5054
5127
  /* @__PURE__ */ r(Z, { type: "button", onClick: V, disabled: Y <= 0, children: "Start Test" })
5055
5128
  ] }) })
5056
5129
  ] });
5057
- const me = i.appropriatenessQuestions[ee], ke = ee === ve - 1, F = ue === ve, U = P <= 60;
5058
- return /* @__PURE__ */ s(te, { children: [
5059
- /* @__PURE__ */ s(we, { children: [
5130
+ const me = i.appropriatenessQuestions[ee], ke = ee === ve - 1, F = ue === ve, U = T <= 60;
5131
+ return /* @__PURE__ */ s(re, { children: [
5132
+ /* @__PURE__ */ s(Se, { children: [
5060
5133
  /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
5061
5134
  /* @__PURE__ */ s("div", { children: [
5062
5135
  /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }),
@@ -5099,7 +5172,7 @@ const Rn = ({
5099
5172
  fontVariantNumeric: "tabular-nums",
5100
5173
  color: U ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-primary, #111827)",
5101
5174
  transition: "color 0.3s ease"
5102
- }, children: xt(P) })
5175
+ }, children: xt(T) })
5103
5176
  ] })
5104
5177
  ] }),
5105
5178
  /* @__PURE__ */ s("div", { style: { marginTop: "12px" }, children: [
@@ -5133,9 +5206,9 @@ const Rn = ({
5133
5206
  ] })
5134
5207
  ] })
5135
5208
  ] }),
5136
- /* @__PURE__ */ s(re, { children: [
5209
+ /* @__PURE__ */ s(ne, { children: [
5137
5210
  me && /* @__PURE__ */ r(
5138
- En,
5211
+ Fn,
5139
5212
  {
5140
5213
  question: me,
5141
5214
  index: ee,
@@ -5235,7 +5308,7 @@ const Rn = ({
5235
5308
  ] })
5236
5309
  ] }) })
5237
5310
  ] });
5238
- }, In = {
5311
+ }, En = {
5239
5312
  questions: /* @__PURE__ */ s("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
5240
5313
  /* @__PURE__ */ r("path", { d: "M9 11l3 3L22 4" }),
5241
5314
  /* @__PURE__ */ r("path", { d: "M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" })
@@ -5267,7 +5340,7 @@ const Rn = ({
5267
5340
  /* @__PURE__ */ r("div", { style: {
5268
5341
  color: i ? "#f59e0b" : "var(--metakyc-primary, #2563eb)",
5269
5342
  flexShrink: 0
5270
- }, children: In[e] }),
5343
+ }, children: En[e] }),
5271
5344
  /* @__PURE__ */ s("div", { children: [
5272
5345
  /* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0 }, children: t }),
5273
5346
  /* @__PURE__ */ r("p", { style: {
@@ -5279,7 +5352,7 @@ const Rn = ({
5279
5352
  }, children: n })
5280
5353
  ] })
5281
5354
  ] });
5282
- }, En = ({ question: e, selectedAnswer: t, onSelect: n, disabled: a }) => /* @__PURE__ */ s("div", { children: [
5355
+ }, Fn = ({ question: e, selectedAnswer: t, onSelect: n, disabled: a }) => /* @__PURE__ */ s("div", { children: [
5283
5356
  /* @__PURE__ */ s("div", { style: { marginBottom: "16px" }, children: [
5284
5357
  e.groupName && /* @__PURE__ */ r("span", { style: {
5285
5358
  display: "inline-block",
@@ -5298,7 +5371,7 @@ const Rn = ({
5298
5371
  lineHeight: 1.5
5299
5372
  }, children: e.question })
5300
5373
  ] }),
5301
- /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: e.answers.map((i, l) => {
5374
+ /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: e.answers.map((i, o) => {
5302
5375
  const c = t === i;
5303
5376
  return /* @__PURE__ */ s(
5304
5377
  "label",
@@ -5358,16 +5431,16 @@ const Rn = ({
5358
5431
  }, children: i })
5359
5432
  ]
5360
5433
  },
5361
- l
5434
+ o
5362
5435
  );
5363
5436
  }) })
5364
- ] }), Fn = ({
5437
+ ] }), An = ({
5365
5438
  applicantId: e,
5366
5439
  onComplete: t,
5367
5440
  onBack: n
5368
5441
  }) => {
5369
5442
  var Je, je, at, Ve;
5370
- const { applicantService: a, baseInformationService: i, identityService: l, config: c, currentTheme: u } = Pe(), { identityData: y, provider: p, token: x, isLoading: L, error: v, requestIdentity: A, restartIdentity: P } = Yr(e), [w, N] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, ee] = k([]), [E, b] = k(!0), [B, V] = k(!1), [G, _] = k(null), [J, se] = k(!1), Y = Se.useRef(!1), [ve, ue] = k({}), [me, ke] = k({}), F = u != null && u.reviewPageFields && u.reviewPageFields.length > 0 ? u.reviewPageFields[0] : null, U = !!(u != null && u.reviewPageDisabled), $ = de(!1);
5443
+ const { applicantService: a, baseInformationService: i, identityService: o, config: c, currentTheme: u } = Te(), { identityData: y, provider: p, token: x, isLoading: P, error: v, requestIdentity: A, restartIdentity: T } = Qr(e), [w, N] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, ee] = k([]), [E, b] = k(!0), [B, V] = k(!1), [G, _] = k(null), [J, se] = k(!1), Y = we.useRef(!1), [ve, ue] = k({}), [me, ke] = k({}), F = u != null && u.reviewPageFields && u.reviewPageFields.length > 0 ? u.reviewPageFields[0] : null, U = !!(u != null && u.reviewPageDisabled), $ = de(!1);
5371
5444
  $.current = U;
5372
5445
  const H = Qt({
5373
5446
  defaultValues: {
@@ -5380,7 +5453,7 @@ const Rn = ({
5380
5453
  phonenumber: ""
5381
5454
  }
5382
5455
  });
5383
- fe(() => {
5456
+ ge(() => {
5384
5457
  if (U) {
5385
5458
  Y.current || (Y.current = !0, A().then(() => V(!0)).catch((O) => console.error("[Identity] Auto-request failed:", O)).finally(() => b(!1)));
5386
5459
  return;
@@ -5394,10 +5467,10 @@ const Rn = ({
5394
5467
  // CountriesType.PhoneNumber
5395
5468
  ]);
5396
5469
  Q(O);
5397
- const X = /* @__PURE__ */ new Set(), m = q.map((g) => ({ value: g.abbreviation3 || g.abbreviation, label: g.name })).filter((g) => !g.value || X.has(g.value) ? !1 : (X.add(g.value), !0));
5470
+ const X = /* @__PURE__ */ new Set(), m = q.map((f) => ({ value: f.abbreviation3 || f.abbreviation, label: f.name })).filter((f) => !f.value || X.has(f.value) ? !1 : (X.add(f.value), !0));
5398
5471
  j(m);
5399
- const R = /* @__PURE__ */ new Set(), T = W.filter((g) => g.countryCode).map((g) => ({ value: g.countryCode, label: `${g.countryCode} – ${g.name}` })).filter((g) => R.has(g.value) ? !1 : (R.add(g.value), !0));
5400
- ee(T);
5472
+ const R = /* @__PURE__ */ new Set(), L = W.filter((f) => f.countryCode).map((f) => ({ value: f.countryCode, label: `${f.countryCode} – ${f.name}` })).filter((f) => R.has(f.value) ? !1 : (R.add(f.value), !0));
5473
+ ee(L);
5401
5474
  const d = O.applicantRequestData;
5402
5475
  if (ue({
5403
5476
  firstName: (d == null ? void 0 : d.firstName) || "",
@@ -5433,8 +5506,8 @@ const Rn = ({
5433
5506
  console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), Y.current = !0;
5434
5507
  try {
5435
5508
  await A(), V(!0);
5436
- } catch (g) {
5437
- console.error("[Identity] Auto-request failed:", g);
5509
+ } catch (f) {
5510
+ console.error("[Identity] Auto-request failed:", f);
5438
5511
  }
5439
5512
  }
5440
5513
  } catch (O) {
@@ -5443,9 +5516,9 @@ const Rn = ({
5443
5516
  b(!1);
5444
5517
  }
5445
5518
  })();
5446
- }, [e]), fe(() => {
5519
+ }, [e]), ge(() => {
5447
5520
  y && !B && $.current && (console.log("[Identity] Review page disabled — showing cached provider"), V(!0));
5448
- }, [y, B]), fe(() => {
5521
+ }, [y, B]), ge(() => {
5449
5522
  if (x) {
5450
5523
  if (x.expiresAt) {
5451
5524
  const h = new Date(x.expiresAt).getTime();
@@ -5470,15 +5543,15 @@ const Rn = ({
5470
5543
  }
5471
5544
  }
5472
5545
  }, [x]);
5473
- const ge = p !== null && p === Oe.Sumsub;
5474
- fe(() => {
5546
+ const fe = p !== null && p === Oe.Sumsub;
5547
+ ge(() => {
5475
5548
  if (p !== null && x && !w && B && !J) {
5476
5549
  const h = p;
5477
- if (ge) {
5550
+ if (fe) {
5478
5551
  console.log("[Sumsub] Fetching access token for Web SDK…"), _(null), (async () => {
5479
5552
  try {
5480
- const O = await l.refreshSumsubToken(e), q = Qe.parseProviderConfig(p, x, c);
5481
- q.accessToken = O, q.onTokenRefresh = () => l.refreshSumsubToken(e);
5553
+ const O = await o.refreshSumsubToken(e), q = Qe.parseProviderConfig(p, x, c);
5554
+ q.accessToken = O, q.onTokenRefresh = () => o.refreshSumsubToken(e);
5482
5555
  const W = Qe.createProvider(p, q);
5483
5556
  W.onComplete((X) => {
5484
5557
  console.log("[Sumsub] Verification complete:", X), t == null || t();
@@ -5544,34 +5617,34 @@ const Rn = ({
5544
5617
  console.error("[Identity] Error destroying provider:", h);
5545
5618
  }
5546
5619
  };
5547
- }, [p, x, w, B, t, J, ge, e, c, l]);
5620
+ }, [p, x, w, B, t, J, fe, e, c, o]);
5548
5621
  const I = async () => {
5549
5622
  try {
5550
5623
  _(null), se(!1), await A(), V(!0);
5551
5624
  } catch (h) {
5552
5625
  console.error("Error starting identity verification:", h);
5553
5626
  }
5554
- }, ne = async () => {
5627
+ }, te = async () => {
5555
5628
  try {
5556
- _(null), se(!1), N(null), console.log("[Identity] Restarting verification..."), await P(), V(!0);
5629
+ _(null), se(!1), N(null), console.log("[Identity] Restarting verification..."), await T(), V(!0);
5557
5630
  } catch (h) {
5558
5631
  console.error("Error restarting identity verification:", h), _(h.message || "Failed to restart verification");
5559
5632
  }
5560
5633
  };
5561
- if (E || L)
5562
- return /* @__PURE__ */ r(te, { children: /* @__PURE__ */ s(re, { children: [
5634
+ if (E || P)
5635
+ return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
5563
5636
  /* @__PURE__ */ r(Me, { className: "my-8" }),
5564
5637
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
5565
5638
  ] }) });
5566
5639
  if (v)
5567
- return /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
5640
+ return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
5568
5641
  "Error: ",
5569
5642
  v.message
5570
5643
  ] }) }) });
5571
5644
  if (B && (G || J))
5572
- return /* @__PURE__ */ s(te, { children: [
5573
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
5574
- /* @__PURE__ */ s(re, { children: [
5645
+ return /* @__PURE__ */ s(re, { children: [
5646
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
5647
+ /* @__PURE__ */ s(ne, { children: [
5575
5648
  /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ s("div", { className: "flex items-start", children: [
5576
5649
  /* @__PURE__ */ r(
5577
5650
  "svg",
@@ -5607,39 +5680,76 @@ const Rn = ({
5607
5680
  ] }),
5608
5681
  /* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
5609
5682
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5610
- /* @__PURE__ */ r(Z, { type: "button", onClick: ne, disabled: L, children: L ? "Restarting..." : "Restart Verification" })
5683
+ /* @__PURE__ */ r(Z, { type: "button", onClick: te, disabled: P, children: P ? "Restarting..." : "Restart Verification" })
5611
5684
  ] })
5612
5685
  ] });
5613
5686
  if (B && y) {
5614
5687
  const h = p;
5615
- return ge ? /* @__PURE__ */ s(te, { children: [
5616
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
5688
+ return fe ? /* @__PURE__ */ s("div", { style: {
5689
+ background: "var(--metakyc-background, #ffffff)",
5690
+ borderRadius: "12px",
5691
+ border: "1px solid var(--metakyc-border, #e5e7eb)",
5692
+ overflow: "hidden"
5693
+ }, children: [
5694
+ /* @__PURE__ */ s("div", { style: {
5695
+ display: "flex",
5696
+ alignItems: "center",
5697
+ justifyContent: "space-between",
5698
+ padding: "20px 24px",
5699
+ borderBottom: "1px solid var(--metakyc-border, #e5e7eb)"
5700
+ }, children: [
5617
5701
  /* @__PURE__ */ s("div", { children: [
5618
- /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Identity Verification" }),
5619
- /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)", marginTop: "4px", fontSize: "14px" }, children: "Please complete the identity verification process" })
5702
+ /* @__PURE__ */ r("h2", { style: {
5703
+ margin: 0,
5704
+ fontSize: "20px",
5705
+ fontWeight: 700,
5706
+ color: "var(--metakyc-text-primary, #111827)"
5707
+ }, children: "Identity Verification" }),
5708
+ /* @__PURE__ */ r("p", { style: {
5709
+ margin: "4px 0 0",
5710
+ fontSize: "14px",
5711
+ color: "var(--metakyc-text-secondary, #6b7280)"
5712
+ }, children: "Please complete the identity verification process" })
5620
5713
  ] }),
5621
5714
  /* @__PURE__ */ r(
5622
- Z,
5715
+ "button",
5623
5716
  {
5624
5717
  type: "button",
5625
- variant: "outline",
5626
- size: "sm",
5627
- onClick: ne,
5628
- disabled: L,
5629
- children: "Restart"
5718
+ onClick: te,
5719
+ disabled: P,
5720
+ style: {
5721
+ padding: "6px 14px",
5722
+ fontSize: "13px",
5723
+ fontWeight: 500,
5724
+ borderRadius: "8px",
5725
+ border: "1px solid var(--metakyc-border, #d1d5db)",
5726
+ background: "var(--metakyc-background, #ffffff)",
5727
+ color: "var(--metakyc-text-primary, #111827)",
5728
+ cursor: P ? "not-allowed" : "pointer",
5729
+ opacity: P ? 0.5 : 1
5730
+ },
5731
+ children: P ? "Restarting…" : "Restart"
5630
5732
  }
5631
5733
  )
5632
- ] }) }),
5633
- /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(
5734
+ ] }),
5735
+ /* @__PURE__ */ r(
5634
5736
  "div",
5635
5737
  {
5636
5738
  id: "sumsub-websdk-container",
5637
- style: { minHeight: "500px", width: "100%" }
5739
+ style: {
5740
+ minHeight: "520px",
5741
+ width: "100%",
5742
+ padding: "16px 24px",
5743
+ background: "var(--metakyc-background, #ffffff)"
5744
+ }
5638
5745
  }
5639
- ) }),
5640
- n && /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5641
- ] }) : x != null && x.url ? /* @__PURE__ */ s(te, { children: [
5642
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
5746
+ ),
5747
+ n && /* @__PURE__ */ r("div", { style: {
5748
+ padding: "16px 24px",
5749
+ borderTop: "1px solid var(--metakyc-border, #e5e7eb)"
5750
+ }, children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5751
+ ] }) : x != null && x.url ? /* @__PURE__ */ s(re, { children: [
5752
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
5643
5753
  /* @__PURE__ */ s("div", { children: [
5644
5754
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
5645
5755
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
@@ -5650,13 +5760,13 @@ const Rn = ({
5650
5760
  type: "button",
5651
5761
  variant: "outline",
5652
5762
  size: "sm",
5653
- onClick: ne,
5654
- disabled: L,
5763
+ onClick: te,
5764
+ disabled: P,
5655
5765
  children: "Restart"
5656
5766
  }
5657
5767
  )
5658
5768
  ] }) }),
5659
- /* @__PURE__ */ s(re, { children: [
5769
+ /* @__PURE__ */ s(ne, { children: [
5660
5770
  /* @__PURE__ */ r("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__ */ s("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
5661
5771
  /* @__PURE__ */ r("strong", { children: "Important:" }),
5662
5772
  ' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
@@ -5674,8 +5784,8 @@ const Rn = ({
5674
5784
  try {
5675
5785
  const m = O.target, R = m.contentDocument || ((q = m.contentWindow) == null ? void 0 : q.document);
5676
5786
  if (R) {
5677
- const T = ((X = (W = R.body) == null ? void 0 : W.textContent) == null ? void 0 : X.toLowerCase()) || "";
5678
- (T.includes("expired") || T.includes("invalid") || T.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), se(!0), _("Your verification link has expired."));
5787
+ const L = ((X = (W = R.body) == null ? void 0 : W.textContent) == null ? void 0 : X.toLowerCase()) || "";
5788
+ (L.includes("expired") || L.includes("invalid") || L.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), se(!0), _("Your verification link has expired."));
5679
5789
  }
5680
5790
  } catch {
5681
5791
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -5685,22 +5795,22 @@ const Rn = ({
5685
5795
  ) })
5686
5796
  ] }),
5687
5797
  n && /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5688
- ] }) : h === Oe.SardinAI ? /* @__PURE__ */ s(te, { children: [
5689
- /* @__PURE__ */ s(we, { children: [
5798
+ ] }) : h === Oe.SardinAI ? /* @__PURE__ */ s(re, { children: [
5799
+ /* @__PURE__ */ s(Se, { children: [
5690
5800
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
5691
5801
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
5692
5802
  ] }),
5693
- /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { className: "text-center py-12", children: [
5803
+ /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { className: "text-center py-12", children: [
5694
5804
  /* @__PURE__ */ r(Me, { className: "mb-4" }),
5695
5805
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
5696
5806
  /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
5697
5807
  ] }) })
5698
- ] }) : /* @__PURE__ */ s(te, { children: [
5699
- /* @__PURE__ */ s(we, { children: [
5808
+ ] }) : /* @__PURE__ */ s(re, { children: [
5809
+ /* @__PURE__ */ s(Se, { children: [
5700
5810
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
5701
5811
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
5702
5812
  ] }),
5703
- /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
5813
+ /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
5704
5814
  n && /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5705
5815
  ] });
5706
5816
  }
@@ -5854,7 +5964,7 @@ const Rn = ({
5854
5964
  {
5855
5965
  type: "checkbox",
5856
5966
  checked: !!m,
5857
- onChange: (R) => ke((T) => ({ ...T, [W]: String(R.target.checked) })),
5967
+ onChange: (R) => ke((L) => ({ ...L, [W]: String(R.target.checked) })),
5858
5968
  style: {
5859
5969
  width: 16,
5860
5970
  height: 16,
@@ -5873,27 +5983,27 @@ const Rn = ({
5873
5983
  ) }, q);
5874
5984
  }
5875
5985
  if (h.customType === "group_checkbox") {
5876
- const m = Array.isArray(X) ? X : X ? [X] : [], R = (T) => {
5877
- h.singleSelect ? ke((d) => ({ ...d, [W]: m[0] === T ? [] : [T] })) : ke((d) => ({
5986
+ const m = Array.isArray(X) ? X : X ? [X] : [], R = (L) => {
5987
+ h.singleSelect ? ke((d) => ({ ...d, [W]: m[0] === L ? [] : [L] })) : ke((d) => ({
5878
5988
  ...d,
5879
- [W]: m.includes(T) ? m.filter((o) => o !== T) : [...m, T]
5989
+ [W]: m.includes(L) ? m.filter((l) => l !== L) : [...m, L]
5880
5990
  }));
5881
5991
  };
5882
5992
  return /* @__PURE__ */ r("div", { className: oe(h.colSpan), children: Re(
5883
5993
  /* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
5884
5994
  h.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.displayText || h.label }),
5885
- (h.options || []).map((T) => /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5995
+ (h.options || []).map((L) => /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5886
5996
  /* @__PURE__ */ r(
5887
5997
  "input",
5888
5998
  {
5889
5999
  type: "checkbox",
5890
- checked: m.includes(T.value),
5891
- onChange: () => R(T.value),
6000
+ checked: m.includes(L.value),
6001
+ onChange: () => R(L.value),
5892
6002
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5893
6003
  }
5894
6004
  ),
5895
- /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: T.label })
5896
- ] }, T.value))
6005
+ /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: L.label })
6006
+ ] }, L.value))
5897
6007
  ] }),
5898
6008
  h.helpText
5899
6009
  ) }, q);
@@ -5930,25 +6040,25 @@ const Rn = ({
5930
6040
  ) }, q);
5931
6041
  }, nt = (h, O) => {
5932
6042
  if (h.isCustom) return _e(h, O);
5933
- const q = h.name ?? "", W = rt[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = ve[q] ?? "", R = q === "mobileCountryCode", T = !!(W != null && W.countriesType) && !R;
6043
+ const q = h.name ?? "", W = rt[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = ve[q] ?? "", R = q === "mobileCountryCode", L = !!(W != null && W.countriesType) && !R;
5934
6044
  return h.editable ? R ? /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
5935
6045
  /* @__PURE__ */ r(
5936
6046
  Ke,
5937
6047
  {
5938
6048
  label: X,
5939
6049
  value: String(m),
5940
- onChange: (d) => ue((o) => ({ ...o, [q]: d })),
6050
+ onChange: (d) => ue((l) => ({ ...l, [q]: d })),
5941
6051
  options: [{ value: "", label: "Select country code…" }, ...K]
5942
6052
  }
5943
6053
  ),
5944
6054
  h.helpText
5945
- ) }, `epc-${O}`) : T ? /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
6055
+ ) }, `epc-${O}`) : L ? /* @__PURE__ */ r("div", { className: oe(h.colSpan ?? 2), children: Re(
5946
6056
  /* @__PURE__ */ r(
5947
6057
  Ke,
5948
6058
  {
5949
6059
  label: X,
5950
6060
  value: String(m),
5951
- onChange: (d) => ue((o) => ({ ...o, [q]: d })),
6061
+ onChange: (d) => ue((l) => ({ ...l, [q]: d })),
5952
6062
  options: [{ value: "", label: `Select ${X.toLowerCase()}…` }, ...M]
5953
6063
  }
5954
6064
  ),
@@ -5960,7 +6070,7 @@ const Rn = ({
5960
6070
  label: X,
5961
6071
  type: (W == null ? void 0 : W.type) === "date" ? "date" : (W == null ? void 0 : W.type) === "email" ? "email" : "text",
5962
6072
  value: String(m),
5963
- onChange: (d) => ue((o) => ({ ...o, [q]: d.target.value }))
6073
+ onChange: (d) => ue((l) => ({ ...l, [q]: d.target.value }))
5964
6074
  }
5965
6075
  ),
5966
6076
  h.helpText
@@ -5976,24 +6086,24 @@ const Rn = ({
5976
6086
  const h = F.title || "Review Your Information", O = F.subtitle || "Please review and confirm your information before starting identity verification";
5977
6087
  return /* @__PURE__ */ r("form", { onSubmit: (q) => {
5978
6088
  q.preventDefault(), I();
5979
- }, children: /* @__PURE__ */ s(te, { children: [
5980
- /* @__PURE__ */ s(we, { children: [
6089
+ }, children: /* @__PURE__ */ s(re, { children: [
6090
+ /* @__PURE__ */ s(Se, { children: [
5981
6091
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h }),
5982
6092
  /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: O })
5983
6093
  ] }),
5984
- /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: F.fields.map((q, W) => nt(q, W)) }) }),
6094
+ /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: F.fields.map((q, W) => nt(q, W)) }) }),
5985
6095
  /* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
5986
6096
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5987
- /* @__PURE__ */ r(Z, { type: "submit", isLoading: L, children: "Confirm and Start Verification" })
6097
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: P, children: "Confirm and Start Verification" })
5988
6098
  ] })
5989
6099
  ] }) });
5990
6100
  }
5991
- return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(I), children: /* @__PURE__ */ s(te, { children: [
5992
- /* @__PURE__ */ s(we, { children: [
6101
+ return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(I), children: /* @__PURE__ */ s(re, { children: [
6102
+ /* @__PURE__ */ s(Se, { children: [
5993
6103
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
5994
6104
  /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please review and confirm your information before starting identity verification" })
5995
6105
  ] }),
5996
- /* @__PURE__ */ s(re, { className: "space-y-6", children: [
6106
+ /* @__PURE__ */ s(ne, { className: "space-y-6", children: [
5997
6107
  /* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
5998
6108
  { label: "Name", value: `${((Je = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Je.firstName) || ""} ${((je = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : je.lastName) || ""}`.trim() },
5999
6109
  { label: "Email", value: (at = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : at.email },
@@ -6051,16 +6161,16 @@ const Rn = ({
6051
6161
  ] }),
6052
6162
  /* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
6053
6163
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
6054
- /* @__PURE__ */ r(Z, { type: "submit", isLoading: L, children: "Confirm and Start Verification" })
6164
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: P, children: "Confirm and Start Verification" })
6055
6165
  ] })
6056
6166
  ] }) });
6057
- }, Pt = ({
6167
+ }, Tt = ({
6058
6168
  kycStatus: e,
6059
6169
  reviewStatus: t,
6060
6170
  workflowResult: n,
6061
6171
  customMessage: a,
6062
6172
  onContinue: i,
6063
- onContactSupport: l
6173
+ onContactSupport: o
6064
6174
  }) => {
6065
6175
  const u = e === et.Approved ? {
6066
6176
  type: "success",
@@ -6104,21 +6214,21 @@ const Rn = ({
6104
6214
  iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
6105
6215
  iconColor: "text-yellow-700 dark:text-yellow-400",
6106
6216
  message: "Your application is currently under manual review."
6107
- } : n === gt.Success ? {
6217
+ } : n === ft.Success ? {
6108
6218
  type: "success",
6109
6219
  title: "Process Complete",
6110
6220
  icon: "✓",
6111
6221
  iconBg: "bg-green-100 dark:bg-green-900/30",
6112
6222
  iconColor: "text-green-600 dark:text-green-400",
6113
6223
  message: "Your verification process has been completed successfully."
6114
- } : n === gt.Failed ? {
6224
+ } : n === ft.Failed ? {
6115
6225
  type: "error",
6116
6226
  title: "Process Failed",
6117
6227
  icon: "✕",
6118
6228
  iconBg: "bg-red-100 dark:bg-red-900/30",
6119
6229
  iconColor: "text-red-600 dark:text-red-400",
6120
6230
  message: "The verification process could not be completed."
6121
- } : n === gt.AdminReview ? {
6231
+ } : n === ft.AdminReview ? {
6122
6232
  type: "pending",
6123
6233
  title: "Admin Review Required",
6124
6234
  icon: "📋",
@@ -6133,8 +6243,8 @@ const Rn = ({
6133
6243
  iconColor: "text-blue-600 dark:text-blue-400",
6134
6244
  message: "Your application is being reviewed."
6135
6245
  };
6136
- return /* @__PURE__ */ s(te, { children: [
6137
- /* @__PURE__ */ s(re, { className: "py-12", children: [
6246
+ return /* @__PURE__ */ s(re, { children: [
6247
+ /* @__PURE__ */ s(ne, { className: "py-12", children: [
6138
6248
  /* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
6139
6249
  "div",
6140
6250
  {
@@ -6190,13 +6300,13 @@ const Rn = ({
6190
6300
  /* @__PURE__ */ s(Ce, { className: "flex justify-center gap-4", children: [
6191
6301
  u.type === "success" && i && /* @__PURE__ */ r(Z, { onClick: i, size: "lg", children: "Continue" }),
6192
6302
  u.type === "error" && /* @__PURE__ */ s(ot, { children: [
6193
- l && /* @__PURE__ */ r(Z, { variant: "outline", onClick: l, children: "Contact Support" }),
6303
+ o && /* @__PURE__ */ r(Z, { variant: "outline", onClick: o, children: "Contact Support" }),
6194
6304
  i && /* @__PURE__ */ r(Z, { onClick: i, children: "Try Again" })
6195
6305
  ] }),
6196
6306
  u.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
6197
6307
  ] })
6198
6308
  ] });
6199
- }, An = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
6309
+ }, Tn = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
6200
6310
  "img",
6201
6311
  {
6202
6312
  src: e.url,
@@ -6216,16 +6326,16 @@ const Rn = ({
6216
6326
  subtitle: t,
6217
6327
  className: n = ""
6218
6328
  }) => {
6219
- const { currentTheme: a } = Pe(), i = e || (a == null ? void 0 : a.title) || "", l = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!i;
6220
- return !l && !c ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${n}`, children: [
6329
+ const { currentTheme: a } = Te(), i = e || (a == null ? void 0 : a.title) || "", o = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!i;
6330
+ return !o && !c ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${n}`, children: [
6221
6331
  /* @__PURE__ */ s(
6222
6332
  "div",
6223
6333
  {
6224
6334
  className: "metakyc-header-title flex items-center text-xl font-bold",
6225
6335
  style: { color: "var(--metakyc-text-primary, #111827)" },
6226
6336
  children: [
6227
- l && /* @__PURE__ */ r(An, { config: a.logo }),
6228
- l && c && /* @__PURE__ */ r(
6337
+ o && /* @__PURE__ */ r(Tn, { config: a.logo }),
6338
+ o && c && /* @__PURE__ */ r(
6229
6339
  "span",
6230
6340
  {
6231
6341
  style: { fontSize: "1.5rem", fontWeight: 300, color: "var(--metakyc-text-muted, #9ca3af)", margin: "0 12px" },
@@ -6254,8 +6364,8 @@ const ut = {
6254
6364
  padding: 0,
6255
6365
  display: "inline-block",
6256
6366
  verticalAlign: "middle"
6257
- }, Tt = ({ helpText: e, children: t }) => {
6258
- const [n, a] = Se.useState(!1);
6367
+ }, Pt = ({ helpText: e, children: t }) => {
6368
+ const [n, a] = we.useState(!1);
6259
6369
  if (!e) return /* @__PURE__ */ r(ot, { children: t });
6260
6370
  const i = n ? /* @__PURE__ */ r(
6261
6371
  "div",
@@ -6278,7 +6388,7 @@ const ut = {
6278
6388
  children: /* @__PURE__ */ s(
6279
6389
  "div",
6280
6390
  {
6281
- onClick: (l) => l.stopPropagation(),
6391
+ onClick: (o) => o.stopPropagation(),
6282
6392
  style: {
6283
6393
  background: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
6284
6394
  border: "1px solid var(--metakyc-border, #e5e7eb)",
@@ -6364,52 +6474,52 @@ const ut = {
6364
6474
  zIndex: 2,
6365
6475
  transition: "background 0.15s, color 0.15s"
6366
6476
  },
6367
- onMouseEnter: (l) => {
6368
- l.currentTarget.style.background = "var(--metakyc-primary, #2563eb)", l.currentTarget.style.color = "#ffffff";
6477
+ onMouseEnter: (o) => {
6478
+ o.currentTarget.style.background = "var(--metakyc-primary, #2563eb)", o.currentTarget.style.color = "#ffffff";
6369
6479
  },
6370
- onMouseLeave: (l) => {
6371
- l.currentTarget.style.background = "transparent", l.currentTarget.style.color = "var(--metakyc-primary, #2563eb)";
6480
+ onMouseLeave: (o) => {
6481
+ o.currentTarget.style.background = "transparent", o.currentTarget.style.color = "var(--metakyc-primary, #2563eb)";
6372
6482
  },
6373
6483
  children: "?"
6374
6484
  }
6375
6485
  ),
6376
6486
  typeof document < "u" && i ? wt(i, document.body) : null
6377
6487
  ] });
6378
- }, Gn = ({
6488
+ }, Jn = ({
6379
6489
  workflowKey: e,
6380
6490
  externalRefId: t,
6381
6491
  onSuccess: n,
6382
6492
  onCancel: a
6383
6493
  }) => {
6384
- var q, W, X, m, R, T, d;
6385
- const { config: i, baseInformationService: l, currentTheme: c } = Pe(), { createApplicant: u, isLoading: y } = Ot(), p = e || ((q = i.applicantForm) == null ? void 0 : q.workflowKey);
6494
+ var q, W, X, m, R, L, d;
6495
+ const { config: i, baseInformationService: o, currentTheme: c } = Te(), { createApplicant: u, isLoading: y } = Ot(), p = e || ((q = i.applicantForm) == null ? void 0 : q.workflowKey);
6386
6496
  if (!p)
6387
6497
  throw new Error(
6388
6498
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
6389
6499
  );
6390
- const x = t || ((W = i.applicantForm) == null ? void 0 : W.externalRefId) || "", L = ((X = i.applicantForm) == null ? void 0 : X.email) || "", v = ((m = i.applicantForm) == null ? void 0 : m.hiddenValues) || {}, A = ((R = i.applicantForm) == null ? void 0 : R.initialValues) || {}, w = (((T = i.applicantForm) == null ? void 0 : T.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", N = De(
6500
+ const x = t || ((W = i.applicantForm) == null ? void 0 : W.externalRefId) || "", P = ((X = i.applicantForm) == null ? void 0 : X.email) || "", v = ((m = i.applicantForm) == null ? void 0 : m.hiddenValues) || {}, A = ((R = i.applicantForm) == null ? void 0 : R.initialValues) || {}, w = (((L = i.applicantForm) == null ? void 0 : L.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", N = De(
6391
6501
  () => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
6392
6502
  [c == null ? void 0 : c.applicantFormPages]
6393
6503
  ), z = De(() => {
6394
- const o = new Set(ht), g = c == null ? void 0 : c.applicantFormRequiredFields;
6395
- if (g) for (const D of g) o.add(D);
6504
+ const l = new Set(ht), f = c == null ? void 0 : c.applicantFormRequiredFields;
6505
+ if (f) for (const D of f) l.add(D);
6396
6506
  if (N)
6397
6507
  for (const D of N)
6398
- for (const f of D.fields)
6399
- !f.isCustom && f.name && f.required && o.add(f.name);
6400
- return Array.from(o);
6508
+ for (const g of D.fields)
6509
+ !g.isCustom && g.name && g.required && l.add(g.name);
6510
+ return Array.from(l);
6401
6511
  }, [c == null ? void 0 : c.applicantFormRequiredFields, N]), Q = De(() => {
6402
6512
  var D;
6403
6513
  if (N) {
6404
- const f = N.flatMap((S) => S.fields).filter((S) => !S.isCustom && S.name).map((S) => S.name), C = new Set(f);
6514
+ const g = N.flatMap((S) => S.fields).filter((S) => !S.isCustom && S.name).map((S) => S.name), C = new Set(g);
6405
6515
  for (const S of ht) C.add(S);
6406
6516
  return Array.from(C);
6407
6517
  }
6408
- let o;
6409
- (D = i.applicantForm) != null && D.visibleFields ? o = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? o = c.applicantFormVisibleFields : o = lr;
6410
- const g = new Set(o);
6411
- for (const f of ht) g.add(f);
6412
- return Array.from(g);
6518
+ let l;
6519
+ (D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = lr;
6520
+ const f = new Set(l);
6521
+ for (const g of ht) f.add(g);
6522
+ return Array.from(f);
6413
6523
  }, [(d = i.applicantForm) == null ? void 0 : d.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, N]), M = /* @__PURE__ */ new Set([
6414
6524
  "country",
6415
6525
  "nationality",
@@ -6418,24 +6528,24 @@ const ut = {
6418
6528
  "mobileCountryCode",
6419
6529
  "otherNationality"
6420
6530
  ]), j = De(() => {
6421
- var g, D;
6422
- const o = /* @__PURE__ */ new Set();
6531
+ var f, D;
6532
+ const l = /* @__PURE__ */ new Set();
6423
6533
  if (N)
6424
- for (const f of N)
6425
- for (const C of f.fields)
6426
- !C.isCustom && C.name && M.has(C.name) && o.add(C.countriesType ?? ((g = rt[C.name]) == null ? void 0 : g.countriesType));
6534
+ for (const g of N)
6535
+ for (const C of g.fields)
6536
+ !C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f = rt[C.name]) == null ? void 0 : f.countriesType));
6427
6537
  else
6428
- for (const f of Q)
6429
- M.has(f) && o.add((D = rt[f]) == null ? void 0 : D.countriesType);
6430
- return o.size === 0 && o.add(void 0), Array.from(o);
6538
+ for (const g of Q)
6539
+ M.has(g) && l.add((D = rt[g]) == null ? void 0 : D.countriesType);
6540
+ return l.size === 0 && l.add(void 0), Array.from(l);
6431
6541
  }, [Q, N]), [K, ee] = k({}), [E, b] = k(!0), B = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
6432
- fe(() => {
6542
+ ge(() => {
6433
6543
  if (!c) return;
6434
- const o = j.filter((f) => {
6435
- const C = f != null ? String(f) : "all";
6544
+ const l = j.filter((g) => {
6545
+ const C = g != null ? String(g) : "all";
6436
6546
  return !V.current.has(C) && !B.current.has(C);
6437
6547
  });
6438
- if (o.length === 0) {
6548
+ if (l.length === 0) {
6439
6549
  j.every((C) => {
6440
6550
  const S = C != null ? String(C) : "all";
6441
6551
  return V.current.has(S);
@@ -6443,21 +6553,21 @@ const ut = {
6443
6553
  return;
6444
6554
  }
6445
6555
  b(!0);
6446
- const g = o.map((f) => f != null ? String(f) : "all");
6447
- g.forEach((f) => B.current.add(f)), (async () => {
6556
+ const f = l.map((g) => g != null ? String(g) : "all");
6557
+ f.forEach((g) => B.current.add(g)), (async () => {
6448
6558
  try {
6449
- const f = await Promise.all(
6450
- o.map(async (C) => {
6451
- const S = C != null ? String(C) : "all", pe = await l.getCountries("", i.locale || "en", C), ie = C === 40, be = /* @__PURE__ */ new Set(), Te = pe.map((le) => ie && le.countryCode ? {
6559
+ const g = await Promise.all(
6560
+ l.map(async (C) => {
6561
+ const S = C != null ? String(C) : "all", pe = await o.getCountries("", i.locale || "en", C), ie = C === 40, be = /* @__PURE__ */ new Set(), Pe = pe.map((le) => ie && le.countryCode ? {
6452
6562
  value: le.countryCode,
6453
6563
  label: `${le.countryCode} – ${le.name}`
6454
6564
  } : { value: le.abbreviation3 || le.abbreviation, label: le.name }).filter((le) => !le.value || be.has(le.value) ? !1 : (be.add(le.value), !0));
6455
- return V.current.add(S), B.current.delete(S), [S, Te];
6565
+ return V.current.add(S), B.current.delete(S), [S, Pe];
6456
6566
  })
6457
6567
  );
6458
- ee((C) => ({ ...C, ...Object.fromEntries(f) }));
6459
- } catch (f) {
6460
- g.forEach((C) => B.current.delete(C)), console.error("Failed to load countries:", f);
6568
+ ee((C) => ({ ...C, ...Object.fromEntries(g) }));
6569
+ } catch (g) {
6570
+ f.forEach((C) => B.current.delete(C)), console.error("Failed to load countries:", g);
6461
6571
  } finally {
6462
6572
  j.every((C) => {
6463
6573
  const S = C != null ? String(C) : "all";
@@ -6466,10 +6576,10 @@ const ut = {
6466
6576
  }
6467
6577
  })();
6468
6578
  }, [j, c]);
6469
- const G = (o, g) => {
6579
+ const G = (l, f) => {
6470
6580
  var C;
6471
- const D = g ?? ((C = rt[o]) == null ? void 0 : C.countriesType), f = D != null ? String(D) : "all";
6472
- return K[f] || [];
6581
+ const D = f ?? ((C = rt[l]) == null ? void 0 : C.countriesType), g = D != null ? String(D) : "all";
6582
+ return K[g] || [];
6473
6583
  }, _ = {
6474
6584
  firstName: 1,
6475
6585
  lastName: 1,
@@ -6494,15 +6604,15 @@ const ut = {
6494
6604
  occupation: 1,
6495
6605
  taxNumber: 1
6496
6606
  }, J = Object.fromEntries(
6497
- Object.entries(v).filter(([o]) => o in _)
6607
+ Object.entries(v).filter(([l]) => l in _)
6498
6608
  ), se = Object.fromEntries(
6499
- Object.entries(A).filter(([o]) => o in _)
6609
+ Object.entries(A).filter(([l]) => l in _)
6500
6610
  ), [Y, ve] = k({
6501
6611
  workflowKey: p,
6502
6612
  firstName: "",
6503
6613
  lastName: "",
6504
6614
  title: "",
6505
- email: L,
6615
+ email: P,
6506
6616
  dateOfBirth: "",
6507
6617
  phonenumber: "",
6508
6618
  externalRefId: x,
@@ -6525,45 +6635,45 @@ const ut = {
6525
6635
  ...J,
6526
6636
  ...se
6527
6637
  }), ue = Object.fromEntries(
6528
- Object.entries(v).filter(([o]) => !(o in J) && o !== "externalRefId" && o !== "workflowKey")
6529
- ), [me, ke] = k({ ...ue }), [F, U] = k(0), [$, H] = k({}), [ge, I] = k(null), [ne, ye] = k(!1), oe = (o, g) => ve((D) => ({ ...D, [o]: g })), Ne = (o, g) => ke((D) => ({ ...D, [o]: g })), Be = (o) => !o.conditionalOn || me[o.conditionalOn] === "true", Re = N && F < N.length - 1 ? F + 1 : -1, _e = N && F > 0 ? F - 1 : -1, nt = (o) => {
6638
+ Object.entries(v).filter(([l]) => !(l in J) && l !== "externalRefId" && l !== "workflowKey")
6639
+ ), [me, ke] = k({ ...ue }), [F, U] = k(0), [$, H] = k({}), [fe, I] = k(null), [te, ye] = k(!1), oe = (l, f) => ve((D) => ({ ...D, [l]: f })), Ne = (l, f) => ke((D) => ({ ...D, [l]: f })), Be = (l) => !l.conditionalOn || me[l.conditionalOn] === "true", Re = N && F < N.length - 1 ? F + 1 : -1, _e = N && F > 0 ? F - 1 : -1, nt = (l) => {
6530
6640
  var D;
6531
- const g = {};
6532
- for (const f of o.fields)
6533
- if (f.isCustom) {
6534
- if (f.customType === "paragraph" || f.customType === "html" || f.customType === "br" || f.customType === "link") continue;
6535
- if (f.required && f.paramName) {
6536
- const C = me[f.paramName], S = f.displayText || f.label || f.paramName;
6537
- f.customType === "checkbox" || f.customType === "link_checkbox" ? C !== "true" && (g[f.paramName] = `${S} is required.`) : (!C || C.trim() === "") && (g[f.paramName] = `${S} is required.`);
6641
+ const f = {};
6642
+ for (const g of l.fields)
6643
+ if (g.isCustom) {
6644
+ if (g.customType === "paragraph" || g.customType === "html" || g.customType === "br" || g.customType === "link") continue;
6645
+ if (g.required && g.paramName) {
6646
+ const C = me[g.paramName], S = g.displayText || g.label || g.paramName;
6647
+ g.customType === "checkbox" || g.customType === "link_checkbox" ? C !== "true" && (f[g.paramName] = `${S} is required.`) : (!C || C.trim() === "") && (f[g.paramName] = `${S} is required.`);
6538
6648
  }
6539
- } else if (f.name) {
6540
- const C = f.name;
6649
+ } else if (g.name) {
6650
+ const C = g.name;
6541
6651
  if (z.includes(C) && st(Y[C])) {
6542
- const S = f.displayText || ((D = rt[C]) == null ? void 0 : D.label) || C;
6543
- g[C] = `${S} is required.`;
6652
+ const S = g.displayText || ((D = rt[C]) == null ? void 0 : D.label) || C;
6653
+ f[C] = `${S} is required.`;
6544
6654
  }
6545
6655
  }
6546
- return g;
6656
+ return f;
6547
6657
  }, Je = async () => {
6548
6658
  if (!N) return;
6549
- const o = N[F];
6550
- if (o.conditionalOn && !Be(o)) {
6659
+ const l = N[F];
6660
+ if (l.conditionalOn && !Be(l)) {
6551
6661
  H({}), Re >= 0 ? U(Re) : await je();
6552
6662
  return;
6553
6663
  }
6554
- const g = nt(o);
6555
- if (Object.keys(g).length > 0) {
6556
- H(g);
6664
+ const f = nt(l);
6665
+ if (Object.keys(f).length > 0) {
6666
+ H(f);
6557
6667
  return;
6558
6668
  }
6559
6669
  H({}), Re >= 0 ? U(Re) : await je();
6560
6670
  }, je = async () => {
6561
6671
  if (N) {
6562
- let o = {};
6563
- for (const g of N)
6564
- Be(g) && (o = { ...o, ...nt(g) });
6565
- if (Object.keys(o).length > 0) {
6566
- H(o);
6672
+ let l = {};
6673
+ for (const f of N)
6674
+ Be(f) && (l = { ...l, ...nt(f) });
6675
+ if (Object.keys(l).length > 0) {
6676
+ H(l);
6567
6677
  return;
6568
6678
  }
6569
6679
  }
@@ -6573,7 +6683,7 @@ const ut = {
6573
6683
  I("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
6574
6684
  return;
6575
6685
  }
6576
- const o = {
6686
+ const l = {
6577
6687
  workflowKey: Y.workflowKey,
6578
6688
  externalRefId: Y.externalRefId.trim()
6579
6689
  };
@@ -6583,21 +6693,21 @@ const ut = {
6583
6693
  for (const S of C.fields)
6584
6694
  if (!S.isCustom && S.name) {
6585
6695
  const pe = S.name, ie = Y[pe];
6586
- st(ie) || (o[pe] = ie);
6696
+ st(ie) || (l[pe] = ie);
6587
6697
  }
6588
6698
  }
6589
6699
  for (const C of ht)
6590
- if (o[C] === void 0) {
6700
+ if (l[C] === void 0) {
6591
6701
  const S = Y[C];
6592
- st(S) || (o[C] = S);
6702
+ st(S) || (l[C] = S);
6593
6703
  }
6594
6704
  } else
6595
6705
  Q.forEach((C) => {
6596
6706
  if (C === "externalRefId") return;
6597
6707
  const S = Y[C];
6598
- st(S) || (o[C] = S);
6708
+ st(S) || (l[C] = S);
6599
6709
  });
6600
- const g = [];
6710
+ const f = [];
6601
6711
  if (N) {
6602
6712
  for (const C of N)
6603
6713
  if (Be(C))
@@ -6608,86 +6718,86 @@ const ut = {
6608
6718
  if (S.customType === "checkbox" || S.customType === "link_checkbox")
6609
6719
  ie = pe === "true" ? "yes" : "no";
6610
6720
  else if (ie = pe, !ie && !S.required) continue;
6611
- g.push({ paramName: S.paramName, value: ie });
6721
+ f.push({ paramName: S.paramName, value: ie });
6612
6722
  }
6613
6723
  }
6614
6724
  for (const [C, S] of Object.entries(J))
6615
- o[C] === void 0 && !st(S) && (o[C] = S);
6616
- const D = new Set(g.map((C) => C.paramName));
6725
+ l[C] === void 0 && !st(S) && (l[C] = S);
6726
+ const D = new Set(f.map((C) => C.paramName));
6617
6727
  for (const [C, S] of Object.entries(ue))
6618
- !D.has(C) && S && g.push({ paramName: C, value: S });
6619
- g.length > 0 && (o.applicantAdditionalDatas = g);
6620
- const f = await u(o);
6621
- n(f.applicantId);
6622
- } catch (o) {
6623
- console.error("Error creating applicant:", o), I(o.message || "Failed to create applicant");
6728
+ !D.has(C) && S && f.push({ paramName: C, value: S });
6729
+ f.length > 0 && (l.applicantAdditionalDatas = f);
6730
+ const g = await u(l);
6731
+ n(g.applicantId);
6732
+ } catch (l) {
6733
+ console.error("Error creating applicant:", l), I(l.message || "Failed to create applicant");
6624
6734
  } finally {
6625
6735
  ye(!1);
6626
6736
  }
6627
- }, at = async (o) => {
6628
- var g;
6629
- o.preventDefault();
6737
+ }, at = async (l) => {
6738
+ var f;
6739
+ l.preventDefault();
6630
6740
  for (const D of z)
6631
6741
  if (st(Y[D])) {
6632
- const f = ((g = rt[D]) == null ? void 0 : g.label) || D;
6633
- I(`${f} is required.`);
6742
+ const g = ((f = rt[D]) == null ? void 0 : f.label) || D;
6743
+ I(`${g} is required.`);
6634
6744
  return;
6635
6745
  }
6636
6746
  await je();
6637
- }, Ve = (o, g, D, f, C) => {
6747
+ }, Ve = (l, f, D, g, C) => {
6638
6748
  var Ct;
6639
- const S = rt[o];
6749
+ const S = rt[l];
6640
6750
  if (!S) return null;
6641
- const pe = z.includes(o), ie = $[o], be = D || S.label, Te = o in se, le = g ?? o, $e = { required: pe }, He = C ? C !== "placeholder" : w, Ye = He ? be : void 0, Ht = He ? "..." : be;
6751
+ const pe = z.includes(l), ie = $[l], be = D || S.label, Pe = l in se, le = f ?? l, $e = { required: pe }, He = C ? C !== "placeholder" : w, Ye = He ? be : void 0, Ht = He ? "..." : be;
6642
6752
  switch (S.type) {
6643
6753
  case "select":
6644
- if (o === "country" || o === "nationality" || o === "taxCountry" || o === "countryOfBirth" || o === "mobileCountryCode") {
6645
- const Ie = G(o, f);
6754
+ if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
6755
+ const Ie = G(l, g);
6646
6756
  return /* @__PURE__ */ r(
6647
6757
  Ke,
6648
6758
  {
6649
6759
  ...$e,
6650
6760
  label: Ye,
6651
- value: Y[o] || "",
6652
- onChange: (Ze) => oe(o, Ze),
6761
+ value: Y[l] || "",
6762
+ onChange: (Ze) => oe(l, Ze),
6653
6763
  options: [{ value: "", label: `Select ${Ht.toLowerCase()}` }, ...Ie],
6654
6764
  disabled: E,
6655
- readOnly: Te,
6765
+ readOnly: Pe,
6656
6766
  error: ie
6657
6767
  },
6658
6768
  le
6659
6769
  );
6660
6770
  }
6661
- if (o === "salutation")
6771
+ if (l === "salutation")
6662
6772
  return /* @__PURE__ */ r(
6663
6773
  Ke,
6664
6774
  {
6665
6775
  ...$e,
6666
6776
  label: Ye,
6667
- value: ((Ct = Y[o]) == null ? void 0 : Ct.toString()) || "",
6668
- onChange: (Ie) => oe(o, Ie ? Number(Ie) : null),
6777
+ value: ((Ct = Y[l]) == null ? void 0 : Ct.toString()) || "",
6778
+ onChange: (Ie) => oe(l, Ie ? Number(Ie) : null),
6669
6779
  options: [
6670
6780
  { value: "", label: He ? "Select salutation..." : be },
6671
- { value: ft.Male.toString(), label: "Male" },
6672
- { value: ft.Female.toString(), label: "Female" },
6673
- { value: ft.Other.toString(), label: "Other" }
6781
+ { value: gt.Male.toString(), label: "Male" },
6782
+ { value: gt.Female.toString(), label: "Female" },
6783
+ { value: gt.Other.toString(), label: "Other" }
6674
6784
  ],
6675
- readOnly: Te,
6785
+ readOnly: Pe,
6676
6786
  error: ie
6677
6787
  },
6678
6788
  le
6679
6789
  );
6680
- if (o === "defaultLanguage") {
6790
+ if (l === "defaultLanguage") {
6681
6791
  const Ie = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? Rt.filter((Ze) => c.allowedLanguages.includes(Ze.value)) : Rt;
6682
6792
  return /* @__PURE__ */ r(
6683
6793
  Ke,
6684
6794
  {
6685
6795
  ...$e,
6686
6796
  label: Ye,
6687
- value: Y[o] || "",
6688
- onChange: (Ze) => oe(o, Ze),
6797
+ value: Y[l] || "",
6798
+ onChange: (Ze) => oe(l, Ze),
6689
6799
  options: [{ value: "", label: He ? "Select language..." : be }, ...Ie],
6690
- readOnly: Te,
6800
+ readOnly: Pe,
6691
6801
  error: ie
6692
6802
  },
6693
6803
  le
@@ -6695,19 +6805,19 @@ const ut = {
6695
6805
  }
6696
6806
  return null;
6697
6807
  case "multiselect":
6698
- if (o === "otherNationality") {
6699
- const Ie = G(o, f);
6808
+ if (l === "otherNationality") {
6809
+ const Ie = G(l, g);
6700
6810
  return /* @__PURE__ */ r(
6701
- Zr,
6811
+ Xr,
6702
6812
  {
6703
6813
  ...$e,
6704
6814
  label: Ye,
6705
- value: Y[o] || [],
6706
- onChange: (Ze) => oe(o, Ze),
6815
+ value: Y[l] || [],
6816
+ onChange: (Ze) => oe(l, Ze),
6707
6817
  options: Ie,
6708
6818
  placeholder: He ? "Select other nationalities..." : be,
6709
6819
  disabled: E,
6710
- readOnly: Te
6820
+ readOnly: Pe
6711
6821
  },
6712
6822
  le
6713
6823
  );
@@ -6721,9 +6831,9 @@ const ut = {
6721
6831
  type: "date",
6722
6832
  label: Ye,
6723
6833
  placeholder: He ? void 0 : be,
6724
- value: Y[o] || "",
6725
- onChange: (Ie) => oe(o, Ie.target.value),
6726
- readOnly: Te,
6834
+ value: Y[l] || "",
6835
+ onChange: (Ie) => oe(l, Ie.target.value),
6836
+ readOnly: Pe,
6727
6837
  error: ie
6728
6838
  },
6729
6839
  le
@@ -6736,9 +6846,9 @@ const ut = {
6736
6846
  type: "email",
6737
6847
  label: Ye,
6738
6848
  placeholder: He ? void 0 : be,
6739
- value: Y[o] || "",
6740
- onChange: (Ie) => oe(o, Ie.target.value),
6741
- readOnly: Te,
6849
+ value: Y[l] || "",
6850
+ onChange: (Ie) => oe(l, Ie.target.value),
6851
+ readOnly: Pe,
6742
6852
  error: ie
6743
6853
  },
6744
6854
  le
@@ -6751,9 +6861,9 @@ const ut = {
6751
6861
  type: "tel",
6752
6862
  label: Ye,
6753
6863
  placeholder: He ? void 0 : be,
6754
- value: Y[o] || "",
6755
- onChange: (Ie) => oe(o, Ie.target.value),
6756
- readOnly: Te,
6864
+ value: Y[l] || "",
6865
+ onChange: (Ie) => oe(l, Ie.target.value),
6866
+ readOnly: Pe,
6757
6867
  error: ie
6758
6868
  },
6759
6869
  le
@@ -6766,18 +6876,18 @@ const ut = {
6766
6876
  type: "text",
6767
6877
  label: Ye,
6768
6878
  placeholder: He ? void 0 : be,
6769
- value: Y[o] || "",
6770
- onChange: (Ie) => oe(o, Ie.target.value),
6771
- readOnly: Te,
6879
+ value: Y[l] || "",
6880
+ onChange: (Ie) => oe(l, Ie.target.value),
6881
+ readOnly: Pe,
6772
6882
  error: ie
6773
6883
  },
6774
6884
  le
6775
6885
  );
6776
6886
  }
6777
- }, h = (o, g) => {
6778
- const D = o.labelMode ? o.labelMode !== "placeholder" : w;
6779
- if (o.customType === "paragraph") {
6780
- const S = o.displayText || o.label || "";
6887
+ }, h = (l, f) => {
6888
+ const D = l.labelMode ? l.labelMode !== "placeholder" : w;
6889
+ if (l.customType === "paragraph") {
6890
+ const S = l.displayText || l.label || "";
6781
6891
  return /* @__PURE__ */ r(
6782
6892
  "p",
6783
6893
  {
@@ -6790,25 +6900,25 @@ const ut = {
6790
6900
  },
6791
6901
  dangerouslySetInnerHTML: { __html: S }
6792
6902
  },
6793
- `custom-${g}`
6903
+ `custom-${f}`
6794
6904
  );
6795
6905
  }
6796
- if (o.customType === "html")
6906
+ if (l.customType === "html")
6797
6907
  return /* @__PURE__ */ r(
6798
6908
  "div",
6799
6909
  {
6800
- dangerouslySetInnerHTML: { __html: o.label || "" }
6910
+ dangerouslySetInnerHTML: { __html: l.label || "" }
6801
6911
  },
6802
- `custom-${g}`
6912
+ `custom-${f}`
6803
6913
  );
6804
- if (o.customType === "br")
6805
- return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${g}`);
6806
- if (o.customType === "link") {
6807
- const S = o.displayText || o.label || o.linkText || o.linkUrl || "";
6914
+ if (l.customType === "br")
6915
+ return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${f}`);
6916
+ if (l.customType === "link") {
6917
+ const S = l.displayText || l.label || l.linkText || l.linkUrl || "";
6808
6918
  return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ s(
6809
6919
  "a",
6810
6920
  {
6811
- href: o.linkUrl || "#",
6921
+ href: l.linkUrl || "#",
6812
6922
  target: "_blank",
6813
6923
  rel: "noopener noreferrer",
6814
6924
  style: {
@@ -6825,11 +6935,11 @@ const ut = {
6825
6935
  /* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
6826
6936
  ]
6827
6937
  }
6828
- ) }, `custom-${g}`);
6938
+ ) }, `custom-${f}`);
6829
6939
  }
6830
- if (!o.paramName) return null;
6831
- const f = $[o.paramName], C = o.displayText || o.label || o.paramName;
6832
- if (o.customType === "checkbox")
6940
+ if (!l.paramName) return null;
6941
+ const g = $[l.paramName], C = l.displayText || l.label || l.paramName;
6942
+ if (l.customType === "checkbox")
6833
6943
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
6834
6944
  /* @__PURE__ */ s(
6835
6945
  "label",
@@ -6841,8 +6951,8 @@ const ut = {
6841
6951
  "input",
6842
6952
  {
6843
6953
  type: "checkbox",
6844
- checked: me[o.paramName] === "true",
6845
- onChange: (S) => Ne(o.paramName, S.target.checked ? "true" : "false"),
6954
+ checked: me[l.paramName] === "true",
6955
+ onChange: (S) => Ne(l.paramName, S.target.checked ? "true" : "false"),
6846
6956
  className: "metakyc-option-input",
6847
6957
  style: ut
6848
6958
  }
@@ -6854,16 +6964,16 @@ const ut = {
6854
6964
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
6855
6965
  children: [
6856
6966
  C,
6857
- o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
6967
+ l.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
6858
6968
  ]
6859
6969
  }
6860
6970
  )
6861
6971
  ]
6862
6972
  }
6863
6973
  ),
6864
- f && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: f })
6865
- ] }, `custom-${g}`);
6866
- if (o.customType === "link_checkbox")
6974
+ g && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: g })
6975
+ ] }, `custom-${f}`);
6976
+ if (l.customType === "link_checkbox")
6867
6977
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
6868
6978
  /* @__PURE__ */ s(
6869
6979
  "label",
@@ -6875,8 +6985,8 @@ const ut = {
6875
6985
  "input",
6876
6986
  {
6877
6987
  type: "checkbox",
6878
- checked: me[o.paramName] === "true",
6879
- onChange: (S) => Ne(o.paramName, S.target.checked ? "true" : "false"),
6988
+ checked: me[l.paramName] === "true",
6989
+ onChange: (S) => Ne(l.paramName, S.target.checked ? "true" : "false"),
6880
6990
  className: "metakyc-option-input",
6881
6991
  style: { ...ut, alignSelf: "flex-start", marginTop: "2px" }
6882
6992
  }
@@ -6889,29 +6999,29 @@ const ut = {
6889
6999
  children: [
6890
7000
  C,
6891
7001
  " ",
6892
- o.linkUrl && /* @__PURE__ */ r(
7002
+ l.linkUrl && /* @__PURE__ */ r(
6893
7003
  "a",
6894
7004
  {
6895
- href: o.linkUrl,
7005
+ href: l.linkUrl,
6896
7006
  target: "_blank",
6897
7007
  rel: "noopener noreferrer",
6898
7008
  className: "underline",
6899
7009
  style: { color: "var(--metakyc-primary, #2563eb)" },
6900
7010
  onClick: (S) => S.stopPropagation(),
6901
- children: o.linkText || o.linkUrl
7011
+ children: l.linkText || l.linkUrl
6902
7012
  }
6903
7013
  ),
6904
- o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
7014
+ l.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
6905
7015
  ]
6906
7016
  }
6907
7017
  )
6908
7018
  ]
6909
7019
  }
6910
7020
  ),
6911
- f && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: f })
6912
- ] }, `custom-${g}`);
6913
- if (o.customType === "group_checkbox") {
6914
- const S = (me[o.paramName] || "").split(",").filter(Boolean);
7021
+ g && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: g })
7022
+ ] }, `custom-${f}`);
7023
+ if (l.customType === "group_checkbox") {
7024
+ const S = (me[l.paramName] || "").split(",").filter(Boolean);
6915
7025
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
6916
7026
  D && /* @__PURE__ */ s(
6917
7027
  "div",
@@ -6920,12 +7030,12 @@ const ut = {
6920
7030
  style: { color: "var(--metakyc-text-primary, #111827)" },
6921
7031
  children: [
6922
7032
  C,
6923
- o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
7033
+ l.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
6924
7034
  ]
6925
7035
  }
6926
7036
  ),
6927
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (o.options || []).map((pe) => {
6928
- const ie = o.singleSelect ? me[o.paramName] === pe.value : S.includes(pe.value);
7037
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((pe) => {
7038
+ const ie = l.singleSelect ? me[l.paramName] === pe.value : S.includes(pe.value);
6929
7039
  return /* @__PURE__ */ s(
6930
7040
  "label",
6931
7041
  {
@@ -6938,11 +7048,11 @@ const ut = {
6938
7048
  type: "checkbox",
6939
7049
  checked: ie,
6940
7050
  onChange: (be) => {
6941
- if (o.singleSelect)
6942
- Ne(o.paramName, be.target.checked ? pe.value : "");
7051
+ if (l.singleSelect)
7052
+ Ne(l.paramName, be.target.checked ? pe.value : "");
6943
7053
  else {
6944
- const Te = be.target.checked ? [...S, pe.value] : S.filter((le) => le !== pe.value);
6945
- Ne(o.paramName, Te.join(","));
7054
+ const Pe = be.target.checked ? [...S, pe.value] : S.filter((le) => le !== pe.value);
7055
+ Ne(l.paramName, Pe.join(","));
6946
7056
  }
6947
7057
  },
6948
7058
  className: "metakyc-option-input",
@@ -6962,10 +7072,10 @@ const ut = {
6962
7072
  pe.value
6963
7073
  );
6964
7074
  }) }),
6965
- f && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: f })
6966
- ] }, `custom-${g}`);
7075
+ g && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: g })
7076
+ ] }, `custom-${f}`);
6967
7077
  }
6968
- return o.customType === "radio_group" ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
7078
+ return l.customType === "radio_group" ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
6969
7079
  D && /* @__PURE__ */ s(
6970
7080
  "div",
6971
7081
  {
@@ -6973,11 +7083,11 @@ const ut = {
6973
7083
  style: { color: "var(--metakyc-text-primary, #111827)" },
6974
7084
  children: [
6975
7085
  C,
6976
- o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
7086
+ l.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
6977
7087
  ]
6978
7088
  }
6979
7089
  ),
6980
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (o.options || []).map((S) => /* @__PURE__ */ s(
7090
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((S) => /* @__PURE__ */ s(
6981
7091
  "label",
6982
7092
  {
6983
7093
  className: "metakyc-option-label",
@@ -6987,9 +7097,9 @@ const ut = {
6987
7097
  "input",
6988
7098
  {
6989
7099
  type: "radio",
6990
- checked: me[o.paramName] === S.value,
6991
- onChange: () => Ne(o.paramName, S.value),
6992
- name: `radio-group-${o.paramName}-${g}`,
7100
+ checked: me[l.paramName] === S.value,
7101
+ onChange: () => Ne(l.paramName, S.value),
7102
+ name: `radio-group-${l.paramName}-${f}`,
6993
7103
  className: "metakyc-option-input",
6994
7104
  style: ut
6995
7105
  }
@@ -7006,24 +7116,24 @@ const ut = {
7006
7116
  },
7007
7117
  S.value
7008
7118
  )) }),
7009
- f && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: f })
7010
- ] }, `custom-${g}`) : /* @__PURE__ */ r(
7119
+ g && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: g })
7120
+ ] }, `custom-${f}`) : /* @__PURE__ */ r(
7011
7121
  xe,
7012
7122
  {
7013
7123
  type: "text",
7014
- label: D ? `${C}${o.required ? " *" : ""}` : void 0,
7124
+ label: D ? `${C}${l.required ? " *" : ""}` : void 0,
7015
7125
  placeholder: D ? void 0 : C,
7016
- value: me[o.paramName] || "",
7017
- onChange: (S) => Ne(o.paramName, S.target.value),
7018
- required: o.required,
7019
- error: f
7126
+ value: me[l.paramName] || "",
7127
+ onChange: (S) => Ne(l.paramName, S.target.value),
7128
+ required: l.required,
7129
+ error: g
7020
7130
  },
7021
- `custom-${g}`
7131
+ `custom-${f}`
7022
7132
  );
7023
- }, O = (o, g) => {
7024
- const D = Be(o);
7133
+ }, O = (l, f) => {
7134
+ const D = Be(l);
7025
7135
  return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
7026
- o.conditionalOn && /* @__PURE__ */ r(Tt, { helpText: o.conditionalHelpText, children: /* @__PURE__ */ s(
7136
+ l.conditionalOn && /* @__PURE__ */ r(Pt, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ s(
7027
7137
  "label",
7028
7138
  {
7029
7139
  className: "metakyc-option-label",
@@ -7034,7 +7144,7 @@ const ut = {
7034
7144
  {
7035
7145
  type: "checkbox",
7036
7146
  checked: D,
7037
- onChange: (f) => Ne(o.conditionalOn, f.target.checked ? "true" : "false"),
7147
+ onChange: (g) => Ne(l.conditionalOn, g.target.checked ? "true" : "false"),
7038
7148
  className: "metakyc-option-input",
7039
7149
  style: ut
7040
7150
  }
@@ -7044,63 +7154,63 @@ const ut = {
7044
7154
  {
7045
7155
  className: "metakyc-option-text",
7046
7156
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", fontWeight: 500 },
7047
- children: o.conditionalOn
7157
+ children: l.conditionalOn
7048
7158
  }
7049
7159
  )
7050
7160
  ]
7051
7161
  }
7052
7162
  ) }),
7053
- D && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: o.fields.map((f, C) => {
7054
- const S = f.colSpan === 1 ? "col-span-1" : f.colSpan === 2 ? "col-span-2" : f.colSpan === 3 ? "col-span-3" : "col-span-4", pe = f.isCustom ? `custom-${C}-${f.paramName}` : `builtin-${f.name}-${C}`;
7055
- return /* @__PURE__ */ r("div", { className: S, children: /* @__PURE__ */ r(Tt, { helpText: f.helpText, children: f.isCustom ? h(f, C) : Ve(f.name, pe, f.displayText, f.countriesType, f.labelMode) }) }, pe);
7163
+ D && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: l.fields.map((g, C) => {
7164
+ const S = g.colSpan === 1 ? "col-span-1" : g.colSpan === 2 ? "col-span-2" : g.colSpan === 3 ? "col-span-3" : "col-span-4", pe = g.isCustom ? `custom-${C}-${g.paramName}` : `builtin-${g.name}-${C}`;
7165
+ return /* @__PURE__ */ r("div", { className: S, children: /* @__PURE__ */ r(Pt, { helpText: g.helpText, children: g.isCustom ? h(g, C) : Ve(g.name, pe, g.displayText, g.countriesType, g.labelMode) }) }, pe);
7056
7166
  }) })
7057
7167
  ] });
7058
7168
  };
7059
7169
  if (!c || E)
7060
- return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ s(re, { children: [
7170
+ return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
7061
7171
  /* @__PURE__ */ r(Me, { className: "my-8" }),
7062
7172
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
7063
7173
  ] }) }) });
7064
7174
  if (N) {
7065
- const o = N[F] ?? N[0], g = _e === -1, D = Re === -1, f = N.length, C = Be(o), S = Object.values($);
7066
- return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(te, { children: [
7067
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
7068
- /* @__PURE__ */ s(re, { children: [
7069
- (o.title || o.subtitle || o.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
7070
- o.title && /* @__PURE__ */ r(
7175
+ const l = N[F] ?? N[0], f = _e === -1, D = Re === -1, g = N.length, C = Be(l), S = Object.values($);
7176
+ return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(re, { children: [
7177
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
7178
+ /* @__PURE__ */ s(ne, { children: [
7179
+ (l.title || l.subtitle || l.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
7180
+ l.title && /* @__PURE__ */ r(
7071
7181
  "h3",
7072
7182
  {
7073
7183
  className: "font-semibold text-base",
7074
7184
  style: { color: "var(--metakyc-text-primary, #111827)" },
7075
- children: o.title
7185
+ children: l.title
7076
7186
  }
7077
7187
  ),
7078
- o.subtitle && /* @__PURE__ */ r(
7188
+ l.subtitle && /* @__PURE__ */ r(
7079
7189
  "p",
7080
7190
  {
7081
7191
  className: "text-sm mt-0.5",
7082
7192
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
7083
- children: o.subtitle
7193
+ children: l.subtitle
7084
7194
  }
7085
7195
  ),
7086
- o.description && o.description !== o.subtitle && /* @__PURE__ */ r(
7196
+ l.description && l.description !== l.subtitle && /* @__PURE__ */ r(
7087
7197
  "p",
7088
7198
  {
7089
7199
  className: "text-xs mt-1",
7090
7200
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
7091
- children: o.description
7201
+ children: l.description
7092
7202
  }
7093
7203
  )
7094
7204
  ] }),
7095
- (ge || S.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
7096
- ge && /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
7205
+ (fe || S.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
7206
+ fe && /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
7097
7207
  /* @__PURE__ */ r("strong", { children: "Error:" }),
7098
7208
  " ",
7099
- ge
7209
+ fe
7100
7210
  ] }),
7101
7211
  S.map((pe, ie) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: pe }, ie))
7102
7212
  ] }),
7103
- f > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
7213
+ g > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
7104
7214
  N.map((pe, ie) => /* @__PURE__ */ r(
7105
7215
  "div",
7106
7216
  {
@@ -7112,14 +7222,14 @@ const ut = {
7112
7222
  /* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
7113
7223
  F + 1,
7114
7224
  " / ",
7115
- f
7225
+ g
7116
7226
  ] })
7117
7227
  ] }),
7118
- O(o)
7228
+ O(l)
7119
7229
  ] }),
7120
7230
  /* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
7121
7231
  /* @__PURE__ */ s("div", { children: [
7122
- !g && /* @__PURE__ */ r(
7232
+ !f && /* @__PURE__ */ r(
7123
7233
  Z,
7124
7234
  {
7125
7235
  type: "button",
@@ -7127,94 +7237,94 @@ const ut = {
7127
7237
  onClick: () => {
7128
7238
  U(_e), H({});
7129
7239
  },
7130
- disabled: ne || y,
7240
+ disabled: te || y,
7131
7241
  children: "Previous"
7132
7242
  }
7133
7243
  ),
7134
- g && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: ne || y, children: "Cancel" })
7244
+ f && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || y, children: "Cancel" })
7135
7245
  ] }),
7136
7246
  /* @__PURE__ */ r(
7137
7247
  Z,
7138
7248
  {
7139
7249
  type: "button",
7140
- isLoading: ne || y,
7250
+ isLoading: te || y,
7141
7251
  onClick: D ? je : Je,
7142
- children: D ? o.conditionalOn && !C ? "Skip & Submit" : "Submit" : o.conditionalOn && !C ? "Skip" : "Next"
7252
+ children: D ? l.conditionalOn && !C ? "Skip & Submit" : "Submit" : l.conditionalOn && !C ? "Skip" : "Next"
7143
7253
  }
7144
7254
  )
7145
7255
  ] })
7146
7256
  ] }) });
7147
7257
  }
7148
- return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: at, children: /* @__PURE__ */ s(te, { children: [
7149
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
7150
- /* @__PURE__ */ s(re, { children: [
7151
- ge && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
7258
+ return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: at, children: /* @__PURE__ */ s(re, { children: [
7259
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
7260
+ /* @__PURE__ */ s(ne, { children: [
7261
+ fe && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
7152
7262
  /* @__PURE__ */ r("strong", { children: "Error:" }),
7153
7263
  " ",
7154
- ge
7264
+ fe
7155
7265
  ] }) }),
7156
- /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: Q.map((o) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ve(o) }, o)) })
7266
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: Q.map((l) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ve(l) }, l)) })
7157
7267
  ] }),
7158
7268
  /* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
7159
- a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: ne || y, children: "Cancel" }),
7160
- /* @__PURE__ */ r(Z, { type: "submit", isLoading: ne || y, children: "Create Applicant" })
7269
+ a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || y, children: "Cancel" }),
7270
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: te || y, children: "Create Applicant" })
7161
7271
  ] })
7162
7272
  ] }) }) });
7163
7273
  }, Lt = ["companyName", "email"];
7164
7274
  function vt(e) {
7165
7275
  return e == null || e === "" || Array.isArray(e) && e.length === 0;
7166
7276
  }
7167
- const Jn = ({
7277
+ const Zn = ({
7168
7278
  workflowKey: e,
7169
7279
  externalRefId: t,
7170
7280
  onSuccess: n,
7171
7281
  onCancel: a
7172
7282
  }) => {
7173
7283
  var Ve, h, O, q, W, X;
7174
- const { config: i, baseInformationService: l, currentTheme: c } = Pe(), { createCompanyApplicant: u, isLoading: y } = Ot(), p = e || ((Ve = i.applicantForm) == null ? void 0 : Ve.workflowKey);
7284
+ const { config: i, baseInformationService: o, currentTheme: c } = Te(), { createCompanyApplicant: u, isLoading: y } = Ot(), p = e || ((Ve = i.applicantForm) == null ? void 0 : Ve.workflowKey);
7175
7285
  if (!p)
7176
7286
  throw new Error(
7177
7287
  "workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
7178
7288
  );
7179
- const x = t || ((h = i.applicantForm) == null ? void 0 : h.externalRefId) || "", L = ((O = i.applicantForm) == null ? void 0 : O.email) || "", v = ((q = i.applicantForm) == null ? void 0 : q.initialValues) || {}, P = (((W = i.applicantForm) == null ? void 0 : W.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", w = De(
7289
+ const x = t || ((h = i.applicantForm) == null ? void 0 : h.externalRefId) || "", P = ((O = i.applicantForm) == null ? void 0 : O.email) || "", v = ((q = i.applicantForm) == null ? void 0 : q.initialValues) || {}, T = (((W = i.applicantForm) == null ? void 0 : W.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", w = De(
7180
7290
  () => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
7181
7291
  [c == null ? void 0 : c.companyFormPages]
7182
7292
  ), N = De(() => {
7183
7293
  const m = new Set(Lt), R = c == null ? void 0 : c.companyFormRequiredFields;
7184
- if (R) for (const T of R) m.add(T);
7294
+ if (R) for (const L of R) m.add(L);
7185
7295
  if (w)
7186
- for (const T of w)
7187
- for (const d of T.fields)
7296
+ for (const L of w)
7297
+ for (const d of L.fields)
7188
7298
  !d.isCustom && d.name && d.required && m.add(d.name);
7189
7299
  return Array.from(m);
7190
7300
  }, [c == null ? void 0 : c.companyFormRequiredFields, w]), z = De(() => {
7191
7301
  var m;
7192
7302
  if (w) {
7193
- const R = w.flatMap((d) => d.fields).filter((d) => !d.isCustom && d.name).map((d) => d.name), T = new Set(R);
7194
- for (const d of Lt) T.add(d);
7195
- return Array.from(T);
7303
+ const R = w.flatMap((d) => d.fields).filter((d) => !d.isCustom && d.name).map((d) => d.name), L = new Set(R);
7304
+ for (const d of Lt) L.add(d);
7305
+ return Array.from(L);
7196
7306
  }
7197
7307
  return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : or;
7198
7308
  }, [(X = i.applicantForm) == null ? void 0 : X.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, w]), Q = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = De(() => {
7199
- var R, T;
7309
+ var R, L;
7200
7310
  const m = /* @__PURE__ */ new Set();
7201
7311
  if (w)
7202
7312
  for (const d of w)
7203
- for (const o of d.fields)
7204
- !o.isCustom && o.name && Q.has(o.name) && m.add(o.countriesType ?? ((R = it[o.name]) == null ? void 0 : R.countriesType));
7313
+ for (const l of d.fields)
7314
+ !l.isCustom && l.name && Q.has(l.name) && m.add(l.countriesType ?? ((R = it[l.name]) == null ? void 0 : R.countriesType));
7205
7315
  else
7206
7316
  for (const d of z)
7207
- Q.has(d) && m.add((T = it[d]) == null ? void 0 : T.countriesType);
7317
+ Q.has(d) && m.add((L = it[d]) == null ? void 0 : L.countriesType);
7208
7318
  return m.size === 0 && m.add(void 0), Array.from(m);
7209
7319
  }, [z, w]), [j, K] = k({}), [ee, E] = k(!0), b = de(/* @__PURE__ */ new Set()), B = de(/* @__PURE__ */ new Set());
7210
- fe(() => {
7320
+ ge(() => {
7211
7321
  if (!c) return;
7212
7322
  const m = M.filter((d) => {
7213
- const o = d != null ? String(d) : "all";
7214
- return !B.current.has(o) && !b.current.has(o);
7323
+ const l = d != null ? String(d) : "all";
7324
+ return !B.current.has(l) && !b.current.has(l);
7215
7325
  });
7216
7326
  if (m.length === 0) {
7217
- M.every((o) => B.current.has(o != null ? String(o) : "all")) && E(!1);
7327
+ M.every((l) => B.current.has(l != null ? String(l) : "all")) && E(!1);
7218
7328
  return;
7219
7329
  }
7220
7330
  E(!0);
@@ -7222,22 +7332,22 @@ const Jn = ({
7222
7332
  R.forEach((d) => b.current.add(d)), (async () => {
7223
7333
  try {
7224
7334
  const d = await Promise.all(
7225
- m.map(async (o) => {
7226
- const g = o != null ? String(o) : "all", D = await l.getCountries("", i.locale || "en", o), f = /* @__PURE__ */ new Set(), C = D.map((S) => ({ value: S.abbreviation3 || S.abbreviation, label: S.name })).filter((S) => !S.value || f.has(S.value) ? !1 : (f.add(S.value), !0));
7227
- return B.current.add(g), b.current.delete(g), [g, C];
7335
+ m.map(async (l) => {
7336
+ const f = l != null ? String(l) : "all", D = await o.getCountries("", i.locale || "en", l), g = /* @__PURE__ */ new Set(), C = D.map((S) => ({ value: S.abbreviation3 || S.abbreviation, label: S.name })).filter((S) => !S.value || g.has(S.value) ? !1 : (g.add(S.value), !0));
7337
+ return B.current.add(f), b.current.delete(f), [f, C];
7228
7338
  })
7229
7339
  );
7230
- K((o) => ({ ...o, ...Object.fromEntries(d) }));
7340
+ K((l) => ({ ...l, ...Object.fromEntries(d) }));
7231
7341
  } catch (d) {
7232
- R.forEach((o) => b.current.delete(o)), console.error("Failed to load countries:", d);
7342
+ R.forEach((l) => b.current.delete(l)), console.error("Failed to load countries:", d);
7233
7343
  } finally {
7234
- M.every((o) => B.current.has(o != null ? String(o) : "all")) && E(!1);
7344
+ M.every((l) => B.current.has(l != null ? String(l) : "all")) && E(!1);
7235
7345
  }
7236
7346
  })();
7237
7347
  }, [M, c]);
7238
7348
  const V = (m, R) => {
7239
- var o;
7240
- const T = R ?? ((o = it[m]) == null ? void 0 : o.countriesType), d = T != null ? String(T) : "all";
7349
+ var l;
7350
+ const L = R ?? ((l = it[m]) == null ? void 0 : l.countriesType), d = L != null ? String(L) : "all";
7241
7351
  return j[d] || [];
7242
7352
  }, G = {
7243
7353
  companyName: 1,
@@ -7264,7 +7374,7 @@ const Jn = ({
7264
7374
  ), [J, se] = k({
7265
7375
  workflowKey: p,
7266
7376
  companyName: "",
7267
- email: L,
7377
+ email: P,
7268
7378
  phone: "",
7269
7379
  registrationNumber: "",
7270
7380
  countryResidence: "",
@@ -7284,21 +7394,21 @@ const Jn = ({
7284
7394
  lei: "",
7285
7395
  externalRefId: x,
7286
7396
  ..._
7287
- }), [Y, ve] = k({}), [ue, me] = k(0), [ke, F] = k({}), [U, $] = k(null), [H, ge] = k(!1), I = (m, R) => se((T) => ({ ...T, [m]: R })), ne = (m, R) => ve((T) => ({ ...T, [m]: R })), ye = (m) => !m.conditionalOn || Y[m.conditionalOn] === "true", oe = w && ue < w.length - 1 ? ue + 1 : -1, Ne = w && ue > 0 ? ue - 1 : -1, Be = (m) => {
7288
- var T;
7397
+ }), [Y, ve] = k({}), [ue, me] = k(0), [ke, F] = k({}), [U, $] = k(null), [H, fe] = k(!1), I = (m, R) => se((L) => ({ ...L, [m]: R })), te = (m, R) => ve((L) => ({ ...L, [m]: R })), ye = (m) => !m.conditionalOn || Y[m.conditionalOn] === "true", oe = w && ue < w.length - 1 ? ue + 1 : -1, Ne = w && ue > 0 ? ue - 1 : -1, Be = (m) => {
7398
+ var L;
7289
7399
  const R = {};
7290
7400
  for (const d of m.fields)
7291
7401
  if (d.isCustom) {
7292
7402
  if (d.customType === "paragraph" || d.customType === "html" || d.customType === "br" || d.customType === "link") continue;
7293
7403
  if (d.required && d.paramName) {
7294
- const o = Y[d.paramName], g = d.displayText || d.label || d.paramName;
7295
- d.customType === "checkbox" || d.customType === "link_checkbox" ? o !== "true" && (R[d.paramName] = `${g} is required.`) : (!o || o.trim() === "") && (R[d.paramName] = `${g} is required.`);
7404
+ const l = Y[d.paramName], f = d.displayText || d.label || d.paramName;
7405
+ d.customType === "checkbox" || d.customType === "link_checkbox" ? l !== "true" && (R[d.paramName] = `${f} is required.`) : (!l || l.trim() === "") && (R[d.paramName] = `${f} is required.`);
7296
7406
  }
7297
7407
  } else if (d.name) {
7298
- const o = d.name;
7299
- if (N.includes(o) && vt(J[o])) {
7300
- const g = d.displayText || ((T = it[o]) == null ? void 0 : T.label) || o;
7301
- R[o] = `${g} is required.`;
7408
+ const l = d.name;
7409
+ if (N.includes(l) && vt(J[l])) {
7410
+ const f = d.displayText || ((L = it[l]) == null ? void 0 : L.label) || l;
7411
+ R[l] = `${f} is required.`;
7302
7412
  }
7303
7413
  }
7304
7414
  return R;
@@ -7319,23 +7429,23 @@ const Jn = ({
7319
7429
  var m;
7320
7430
  if (w) {
7321
7431
  let R = {};
7322
- for (const T of w)
7323
- ye(T) && (R = { ...R, ...Be(T) });
7432
+ for (const L of w)
7433
+ ye(L) && (R = { ...R, ...Be(L) });
7324
7434
  if (Object.keys(R).length > 0) {
7325
7435
  F(R);
7326
7436
  return;
7327
7437
  }
7328
7438
  }
7329
- ge(!0), $(null);
7439
+ fe(!0), $(null);
7330
7440
  try {
7331
7441
  const R = {
7332
7442
  workflowKey: J.workflowKey,
7333
7443
  externalRefId: ((m = J.externalRefId) == null ? void 0 : m.trim()) || void 0
7334
- }, T = w ? w.filter((g) => ye(g)).flatMap((g) => g.fields).filter((g) => !g.isCustom && g.name).map((g) => g.name) : z;
7335
- for (const g of T) {
7336
- const D = J[g];
7444
+ }, L = w ? w.filter((f) => ye(f)).flatMap((f) => f.fields).filter((f) => !f.isCustom && f.name).map((f) => f.name) : z;
7445
+ for (const f of L) {
7446
+ const D = J[f];
7337
7447
  if (!vt(D))
7338
- switch (g) {
7448
+ switch (f) {
7339
7449
  case "companyName":
7340
7450
  R.companyName = D;
7341
7451
  break;
@@ -7361,47 +7471,47 @@ const Jn = ({
7361
7471
  R.companyZip = D;
7362
7472
  break;
7363
7473
  default:
7364
- R[g] = D;
7474
+ R[f] = D;
7365
7475
  break;
7366
7476
  }
7367
7477
  }
7368
7478
  const d = [];
7369
7479
  if (w) {
7370
- for (const g of w)
7371
- if (ye(g))
7372
- for (const D of g.fields) {
7480
+ for (const f of w)
7481
+ if (ye(f))
7482
+ for (const D of f.fields) {
7373
7483
  if (!D.isCustom || !D.paramName || D.customType === "paragraph" || D.customType === "html" || D.customType === "br" || D.customType === "link") continue;
7374
- const f = Y[D.paramName] ?? "";
7484
+ const g = Y[D.paramName] ?? "";
7375
7485
  let C;
7376
7486
  if (D.customType === "checkbox" || D.customType === "link_checkbox")
7377
- C = f === "true" ? "yes" : "no";
7378
- else if (C = f, !C && !D.required) continue;
7487
+ C = g === "true" ? "yes" : "no";
7488
+ else if (C = g, !C && !D.required) continue;
7379
7489
  d.push({ paramName: D.paramName, value: C });
7380
7490
  }
7381
7491
  }
7382
7492
  d.length > 0 && (R.applicantAdditionalDatas = d);
7383
- const o = await u(R);
7384
- n(o.applicantId);
7493
+ const l = await u(R);
7494
+ n(l.applicantId);
7385
7495
  } catch (R) {
7386
7496
  console.error("Error creating company applicant:", R), $(R.message || "Failed to create company applicant");
7387
7497
  } finally {
7388
- ge(!1);
7498
+ fe(!1);
7389
7499
  }
7390
7500
  }, nt = async (m) => {
7391
7501
  var R;
7392
7502
  m.preventDefault();
7393
- for (const T of N)
7394
- if (vt(J[T])) {
7395
- const d = ((R = it[T]) == null ? void 0 : R.label) || T;
7503
+ for (const L of N)
7504
+ if (vt(J[L])) {
7505
+ const d = ((R = it[L]) == null ? void 0 : R.label) || L;
7396
7506
  $(`${d} is required.`);
7397
7507
  return;
7398
7508
  }
7399
7509
  await _e();
7400
- }, Je = (m, R, T, d, o) => {
7401
- const g = it[m];
7402
- if (!g) return null;
7403
- const D = N.includes(m), f = ke[m], C = T || g.label, S = m in _, pe = R ?? m, ie = o ? o !== "placeholder" : P, be = ie ? C : void 0, Te = ie ? "..." : C;
7404
- switch (g.type) {
7510
+ }, Je = (m, R, L, d, l) => {
7511
+ const f = it[m];
7512
+ if (!f) return null;
7513
+ const D = N.includes(m), g = ke[m], C = L || f.label, S = m in _, pe = R ?? m, ie = l ? l !== "placeholder" : T, be = ie ? C : void 0, Pe = ie ? "..." : C;
7514
+ switch (f.type) {
7405
7515
  case "select":
7406
7516
  if (m === "countryResidence" || m === "addressCountry") {
7407
7517
  const le = V(m, d);
@@ -7412,10 +7522,10 @@ const Jn = ({
7412
7522
  label: be,
7413
7523
  value: J[m] || "",
7414
7524
  onChange: ($e) => I(m, $e),
7415
- options: [{ value: "", label: `Select ${Te.toLowerCase()}` }, ...le],
7525
+ options: [{ value: "", label: `Select ${Pe.toLowerCase()}` }, ...le],
7416
7526
  disabled: ee,
7417
7527
  readOnly: S,
7418
- error: f
7528
+ error: g
7419
7529
  },
7420
7530
  pe
7421
7531
  );
@@ -7432,7 +7542,7 @@ const Jn = ({
7432
7542
  value: J[m] || "",
7433
7543
  onChange: (le) => I(m, le.target.value),
7434
7544
  readOnly: S,
7435
- error: f
7545
+ error: g
7436
7546
  },
7437
7547
  pe
7438
7548
  );
@@ -7447,7 +7557,7 @@ const Jn = ({
7447
7557
  value: J[m] || "",
7448
7558
  onChange: (le) => I(m, le.target.value),
7449
7559
  readOnly: S,
7450
- error: f
7560
+ error: g
7451
7561
  },
7452
7562
  pe
7453
7563
  );
@@ -7462,7 +7572,7 @@ const Jn = ({
7462
7572
  value: J[m] || "",
7463
7573
  onChange: (le) => I(m, le.target.value),
7464
7574
  readOnly: S,
7465
- error: f
7575
+ error: g
7466
7576
  },
7467
7577
  pe
7468
7578
  );
@@ -7477,7 +7587,7 @@ const Jn = ({
7477
7587
  value: J[m] || "",
7478
7588
  onChange: (le) => I(m, le.target.value),
7479
7589
  readOnly: S,
7480
- error: f
7590
+ error: g
7481
7591
  },
7482
7592
  pe
7483
7593
  );
@@ -7508,7 +7618,7 @@ const Jn = ({
7508
7618
  }
7509
7619
  ) }, `custom-${R}`);
7510
7620
  if (!m.paramName) return null;
7511
- const T = ke[m.paramName], d = m.displayText || m.label || m.paramName, o = m.labelMode ? m.labelMode !== "placeholder" : P;
7621
+ const L = ke[m.paramName], d = m.displayText || m.label || m.paramName, l = m.labelMode ? m.labelMode !== "placeholder" : T;
7512
7622
  return m.customType === "checkbox" ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
7513
7623
  /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
7514
7624
  /* @__PURE__ */ r(
@@ -7516,7 +7626,7 @@ const Jn = ({
7516
7626
  {
7517
7627
  type: "checkbox",
7518
7628
  checked: Y[m.paramName] === "true",
7519
- onChange: (g) => ne(m.paramName, g.target.checked ? "true" : "false"),
7629
+ onChange: (f) => te(m.paramName, f.target.checked ? "true" : "false"),
7520
7630
  style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
7521
7631
  }
7522
7632
  ),
@@ -7525,17 +7635,17 @@ const Jn = ({
7525
7635
  m.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
7526
7636
  ] })
7527
7637
  ] }),
7528
- T && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: T })
7638
+ L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: L })
7529
7639
  ] }, `custom-${R}`) : /* @__PURE__ */ r(
7530
7640
  xe,
7531
7641
  {
7532
7642
  type: "text",
7533
- label: o ? `${d}${m.required ? " *" : ""}` : void 0,
7534
- placeholder: o ? void 0 : d,
7643
+ label: l ? `${d}${m.required ? " *" : ""}` : void 0,
7644
+ placeholder: l ? void 0 : d,
7535
7645
  value: Y[m.paramName] || "",
7536
- onChange: (g) => ne(m.paramName, g.target.value),
7646
+ onChange: (f) => te(m.paramName, f.target.value),
7537
7647
  required: m.required,
7538
- error: T
7648
+ error: L
7539
7649
  },
7540
7650
  `custom-${R}`
7541
7651
  );
@@ -7548,48 +7658,48 @@ const Jn = ({
7548
7658
  {
7549
7659
  type: "checkbox",
7550
7660
  checked: R,
7551
- onChange: (T) => ne(m.conditionalOn, T.target.checked ? "true" : "false"),
7661
+ onChange: (L) => te(m.conditionalOn, L.target.checked ? "true" : "false"),
7552
7662
  style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
7553
7663
  }
7554
7664
  ),
7555
7665
  /* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: m.conditionalOn })
7556
7666
  ] }),
7557
- R && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: m.fields.map((T, d) => {
7558
- const o = T.colSpan === 1 ? "col-span-1" : T.colSpan === 2 ? "col-span-2" : T.colSpan === 3 ? "col-span-3" : "col-span-4", g = T.isCustom ? `custom-${d}-${T.paramName}` : `builtin-${T.name}-${d}`;
7559
- return /* @__PURE__ */ r("div", { className: o, children: T.isCustom ? je(T, d) : Je(T.name, g, T.displayText, T.countriesType, T.labelMode) }, g);
7667
+ R && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: m.fields.map((L, d) => {
7668
+ const l = L.colSpan === 1 ? "col-span-1" : L.colSpan === 2 ? "col-span-2" : L.colSpan === 3 ? "col-span-3" : "col-span-4", f = L.isCustom ? `custom-${d}-${L.paramName}` : `builtin-${L.name}-${d}`;
7669
+ return /* @__PURE__ */ r("div", { className: l, children: L.isCustom ? je(L, d) : Je(L.name, f, L.displayText, L.countriesType, L.labelMode) }, f);
7560
7670
  }) })
7561
7671
  ] });
7562
7672
  };
7563
7673
  if (!c || ee)
7564
- return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ s(re, { children: [
7674
+ return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
7565
7675
  /* @__PURE__ */ r(Me, { className: "my-8" }),
7566
7676
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
7567
7677
  ] }) }) });
7568
7678
  if (w) {
7569
- const m = w[ue] ?? w[0], R = Ne === -1, T = oe === -1, d = w.length, o = ye(m), g = Object.values(ke);
7570
- return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(te, { children: [
7571
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
7572
- /* @__PURE__ */ s(re, { children: [
7679
+ const m = w[ue] ?? w[0], R = Ne === -1, L = oe === -1, d = w.length, l = ye(m), f = Object.values(ke);
7680
+ return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(re, { children: [
7681
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
7682
+ /* @__PURE__ */ s(ne, { children: [
7573
7683
  (m.title || m.subtitle) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
7574
7684
  m.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: m.title }),
7575
7685
  m.subtitle && /* @__PURE__ */ r("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: m.subtitle })
7576
7686
  ] }),
7577
- (U || g.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
7687
+ (U || f.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
7578
7688
  U && /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
7579
7689
  /* @__PURE__ */ r("strong", { children: "Error:" }),
7580
7690
  " ",
7581
7691
  U
7582
7692
  ] }),
7583
- g.map((D, f) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: D }, f))
7693
+ f.map((D, g) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: D }, g))
7584
7694
  ] }),
7585
7695
  d > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
7586
- w.map((D, f) => /* @__PURE__ */ r(
7696
+ w.map((D, g) => /* @__PURE__ */ r(
7587
7697
  "div",
7588
7698
  {
7589
- className: `h-1.5 rounded-full transition-all ${f === ue ? "flex-1" : "w-8"}`,
7590
- style: f === ue ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : f < ue ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
7699
+ className: `h-1.5 rounded-full transition-all ${g === ue ? "flex-1" : "w-8"}`,
7700
+ style: g === ue ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : g < ue ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
7591
7701
  },
7592
- f
7702
+ g
7593
7703
  )),
7594
7704
  /* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
7595
7705
  ue + 1,
@@ -7615,13 +7725,13 @@ const Jn = ({
7615
7725
  ),
7616
7726
  R && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" })
7617
7727
  ] }),
7618
- /* @__PURE__ */ r(Z, { type: "button", isLoading: H || y, onClick: T ? _e : Re, children: T ? m.conditionalOn && !o ? "Skip & Submit" : "Submit" : m.conditionalOn && !o ? "Skip" : "Next" })
7728
+ /* @__PURE__ */ r(Z, { type: "button", isLoading: H || y, onClick: L ? _e : Re, children: L ? m.conditionalOn && !l ? "Skip & Submit" : "Submit" : m.conditionalOn && !l ? "Skip" : "Next" })
7619
7729
  ] })
7620
7730
  ] }) });
7621
7731
  }
7622
- return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: nt, children: /* @__PURE__ */ s(te, { children: [
7623
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
7624
- /* @__PURE__ */ s(re, { children: [
7732
+ return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: nt, children: /* @__PURE__ */ s(re, { children: [
7733
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
7734
+ /* @__PURE__ */ s(ne, { children: [
7625
7735
  U && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
7626
7736
  /* @__PURE__ */ r("strong", { children: "Error:" }),
7627
7737
  " ",
@@ -7634,7 +7744,7 @@ const Jn = ({
7634
7744
  /* @__PURE__ */ r(Z, { type: "submit", isLoading: H || y, children: "Register Company" })
7635
7745
  ] })
7636
7746
  ] }) }) });
7637
- }, Zn = ({
7747
+ }, Xn = ({
7638
7748
  applicantId: e,
7639
7749
  onComplete: t,
7640
7750
  onError: n,
@@ -7642,37 +7752,37 @@ const Jn = ({
7642
7752
  className: i
7643
7753
  }) => {
7644
7754
  const {
7645
- progress: l,
7755
+ progress: o,
7646
7756
  currentStep: c,
7647
7757
  steps: u,
7648
7758
  workflowKey: y,
7649
7759
  nextWorkflowKey: p,
7650
7760
  hasWorkflowChanged: x,
7651
- isLoading: L,
7761
+ isLoading: P,
7652
7762
  error: v,
7653
7763
  moveBack: A,
7654
- refreshProgress: P
7655
- } = Ur(e), [w, N] = Se.useState(!1), z = Se.useRef(null);
7656
- if (Se.useEffect(() => {
7764
+ refreshProgress: T
7765
+ } = Kr(e), [w, N] = we.useState(!1), z = we.useRef(null);
7766
+ if (we.useEffect(() => {
7657
7767
  v && n && n(v);
7658
- }, [v, n]), Se.useEffect(() => {
7659
- l != null && l.workflowResult && t && t(l.workflowResult);
7660
- }, [l == null ? void 0 : l.workflowResult, t]), Se.useEffect(() => {
7768
+ }, [v, n]), we.useEffect(() => {
7769
+ o != null && o.workflowResult && t && t(o.workflowResult);
7770
+ }, [o == null ? void 0 : o.workflowResult, t]), we.useEffect(() => {
7661
7771
  a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
7662
- }, [a]), Se.useEffect(() => {
7772
+ }, [a]), we.useEffect(() => {
7663
7773
  x && N(!1);
7664
- }, [x]), L || !l)
7665
- return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ s(re, { children: [
7774
+ }, [x]), P || !o)
7775
+ return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
7666
7776
  /* @__PURE__ */ r(Me, { className: "my-8" }),
7667
7777
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
7668
7778
  ] }) }) });
7669
7779
  if (v)
7670
- return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
7780
+ return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
7671
7781
  /* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "An error occurred" }),
7672
7782
  /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: v.message })
7673
7783
  ] }) }) }) });
7674
7784
  if (x && !w)
7675
- return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
7785
+ return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
7676
7786
  /* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full mb-4", style: { backgroundColor: "var(--metakyc-primary-light, #dbeafe)" }, children: /* @__PURE__ */ r("svg", { className: "w-8 h-8", style: { color: "var(--metakyc-primary, #2563eb)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
7677
7787
  /* @__PURE__ */ r("h3", { className: "text-xl font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Workflow Transition" }),
7678
7788
  /* @__PURE__ */ r("p", { className: "mb-6", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Your application workflow has been updated based on your progress." }),
@@ -7688,7 +7798,7 @@ const Jn = ({
7688
7798
  /* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-primary, #2563eb)" }, children: p })
7689
7799
  ] })
7690
7800
  ] }),
7691
- l.nextWorkflowName && /* @__PURE__ */ r("p", { className: "text-center mt-2 text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: l.nextWorkflowName })
7801
+ o.nextWorkflowName && /* @__PURE__ */ r("p", { className: "text-center mt-2 text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o.nextWorkflowName })
7692
7802
  ] }),
7693
7803
  /* @__PURE__ */ r(
7694
7804
  "button",
@@ -7700,24 +7810,24 @@ const Jn = ({
7700
7810
  }
7701
7811
  )
7702
7812
  ] }) }) }) });
7703
- if (l.status === ze.Finished || l.status === ze.OnHold)
7813
+ if (o.status === ze.Finished || o.status === ze.OnHold)
7704
7814
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
7705
- Pt,
7815
+ Tt,
7706
7816
  {
7707
- kycStatus: l.kycStatus,
7708
- reviewStatus: l.reviewStatus,
7709
- workflowResult: l.workflowResult,
7710
- customMessage: l.customMessage,
7711
- onContinue: t && l.workflowResult ? () => t(l.workflowResult) : void 0,
7817
+ kycStatus: o.kycStatus,
7818
+ reviewStatus: o.reviewStatus,
7819
+ workflowResult: o.workflowResult,
7820
+ customMessage: o.customMessage,
7821
+ onContinue: t && o.workflowResult ? () => t(o.workflowResult) : void 0,
7712
7822
  onContactSupport: () => {
7713
7823
  typeof window < "u" && (window.location.href = "mailto:support@example.com");
7714
7824
  }
7715
7825
  }
7716
7826
  ) });
7717
7827
  if (!c)
7718
- return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ s(re, { children: [
7828
+ return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { children: [
7719
7829
  /* @__PURE__ */ r(Me, { className: "my-8" }),
7720
- /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: l.status === ze.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
7830
+ /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: o.status === ze.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
7721
7831
  ] }) }) });
7722
7832
  const Q = (K) => {
7723
7833
  switch (K) {
@@ -7747,7 +7857,7 @@ const Jn = ({
7747
7857
  return /* @__PURE__ */ s("div", { style: { marginBottom: "24px" }, children: [
7748
7858
  /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
7749
7859
  /* @__PURE__ */ r(pt, {}),
7750
- /* @__PURE__ */ s(zt, { variant: l.status === 1 ? "info" : "success", children: [
7860
+ /* @__PURE__ */ s(zt, { variant: o.status === 1 ? "info" : "success", children: [
7751
7861
  "Step ",
7752
7862
  E,
7753
7863
  " of ",
@@ -7780,38 +7890,38 @@ const Jn = ({
7780
7890
  const K = {
7781
7891
  applicantId: e,
7782
7892
  onComplete: async () => {
7783
- await P();
7893
+ await T();
7784
7894
  },
7785
7895
  onBack: c.order > 0 ? A : void 0
7786
7896
  };
7787
7897
  switch (c.action) {
7788
7898
  case ce.Questionaries:
7789
- return /* @__PURE__ */ r(pn, { ...K });
7899
+ return /* @__PURE__ */ r(mn, { ...K });
7790
7900
  case ce.UploadDocument:
7791
- return /* @__PURE__ */ r(hn, { ...K });
7901
+ return /* @__PURE__ */ r(fn, { ...K });
7792
7902
  case ce.Overview:
7793
7903
  return /* @__PURE__ */ r(gn, { ...K });
7794
7904
  case ce.IdentitySdk:
7795
- return /* @__PURE__ */ r(Fn, { ...K });
7905
+ return /* @__PURE__ */ r(An, { ...K });
7796
7906
  case ce.RiskScoring:
7797
- return /* @__PURE__ */ r(Sn, { ...K });
7907
+ return /* @__PURE__ */ r(Cn, { ...K });
7798
7908
  case ce.AdditionalData:
7799
7909
  case ce.InvestorCategorization:
7800
- return /* @__PURE__ */ r(Nn, { ...K });
7801
- case ce.AppropriatenessTest:
7802
7910
  return /* @__PURE__ */ r(Rn, { ...K });
7911
+ case ce.AppropriatenessTest:
7912
+ return /* @__PURE__ */ r(In, { ...K });
7803
7913
  case ce.ManualReview:
7804
7914
  return /* @__PURE__ */ r(
7805
- Pt,
7915
+ Tt,
7806
7916
  {
7807
- kycStatus: l.kycStatus,
7808
- reviewStatus: l.reviewStatus,
7809
- workflowResult: l.workflowResult,
7810
- customMessage: l.customMessage
7917
+ kycStatus: o.kycStatus,
7918
+ reviewStatus: o.reviewStatus,
7919
+ workflowResult: o.workflowResult,
7920
+ customMessage: o.customMessage
7811
7921
  }
7812
7922
  );
7813
7923
  default:
7814
- return /* @__PURE__ */ r(te, { children: /* @__PURE__ */ s(re, { className: "py-12 text-center", children: [
7924
+ return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ s(ne, { className: "py-12 text-center", children: [
7815
7925
  /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(Me, {}) }),
7816
7926
  /* @__PURE__ */ s("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
7817
7927
  "Processing step: ",
@@ -7828,12 +7938,12 @@ const Jn = ({
7828
7938
  M(),
7829
7939
  j()
7830
7940
  ] });
7831
- }, Pn = Se.forwardRef(
7941
+ }, Pn = we.forwardRef(
7832
7942
  ({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: n }, a) => {
7833
- const i = Se.useRef(null), l = Se.useRef(null);
7834
- return Se.useImperativeHandle(a, () => i.current), Se.useEffect(() => {
7835
- if (l.current && i.current) {
7836
- const c = i.current, u = l.current, y = u.offsetLeft - c.offsetWidth / 2 + u.offsetWidth / 2;
7943
+ const i = we.useRef(null), o = we.useRef(null);
7944
+ return we.useImperativeHandle(a, () => i.current), we.useEffect(() => {
7945
+ if (o.current && i.current) {
7946
+ const c = i.current, u = o.current, y = u.offsetLeft - c.offsetWidth / 2 + u.offsetWidth / 2;
7837
7947
  c.scrollTo({ left: Math.max(0, y), behavior: "smooth" });
7838
7948
  }
7839
7949
  }, [t]), /* @__PURE__ */ r(
@@ -7853,12 +7963,12 @@ const Jn = ({
7853
7963
  gap: "0"
7854
7964
  },
7855
7965
  children: e.map((c, u) => {
7856
- const y = u < t, p = u === t, x = y || p, L = c.displayName || c.name || n(c.action) || `Step ${u + 1}`;
7857
- return /* @__PURE__ */ s(Se.Fragment, { children: [
7966
+ const y = u < t, p = u === t, x = y || p, P = c.displayName || c.name || n(c.action) || `Step ${u + 1}`;
7967
+ return /* @__PURE__ */ s(we.Fragment, { children: [
7858
7968
  /* @__PURE__ */ s(
7859
7969
  "div",
7860
7970
  {
7861
- ref: p ? l : void 0,
7971
+ ref: p ? o : void 0,
7862
7972
  style: {
7863
7973
  display: "flex",
7864
7974
  alignItems: "center",
@@ -7893,7 +8003,7 @@ const Jn = ({
7893
8003
  fontWeight: p ? 600 : 400,
7894
8004
  color: p ? "var(--metakyc-text-primary, #111827)" : y ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
7895
8005
  transition: "color 0.2s ease"
7896
- }, children: L })
8006
+ }, children: P })
7897
8007
  ]
7898
8008
  }
7899
8009
  ),
@@ -7913,12 +8023,12 @@ const Jn = ({
7913
8023
  );
7914
8024
  }
7915
8025
  );
7916
- function Xn(e) {
8026
+ function ea(e) {
7917
8027
  return qe.object({
7918
8028
  questionResults: qe.any()
7919
8029
  }).passthrough();
7920
8030
  }
7921
- function Tn(e) {
8031
+ function Ln(e) {
7922
8032
  let t = qe.array(qe.instanceof(File));
7923
8033
  if (e.isRequired ? t = t.min(
7924
8034
  1,
@@ -7933,34 +8043,34 @@ function Tn(e) {
7933
8043
  const n = e.allowedTypes.split(",").map((a) => a.trim());
7934
8044
  t = t.refine(
7935
8045
  (a) => a ? a.every(
7936
- (i) => n.some((l) => l.endsWith("/*") ? i.type.startsWith(l.slice(0, -2)) : i.type === l)
8046
+ (i) => n.some((o) => o.endsWith("/*") ? i.type.startsWith(o.slice(0, -2)) : i.type === o)
7937
8047
  ) : !0,
7938
8048
  { message: "Invalid file type" }
7939
8049
  );
7940
8050
  }
7941
8051
  return t;
7942
8052
  }
7943
- function ea(e) {
8053
+ function ta(e) {
7944
8054
  const t = {};
7945
8055
  return e.uploadDocumentFiles.forEach((n) => {
7946
8056
  const a = `file_${n.id}`;
7947
- t[a] = Tn(n);
8057
+ t[a] = Ln(n);
7948
8058
  }), qe.object(t);
7949
8059
  }
7950
- function ta(e) {
8060
+ function ra(e) {
7951
8061
  return qe.any();
7952
8062
  }
7953
- function Ln(e) {
8063
+ function Dn(e) {
7954
8064
  return qe.string().min(1, "This question is required");
7955
8065
  }
7956
- function ra(e) {
8066
+ function na(e) {
7957
8067
  const t = {};
7958
8068
  return e.appropriatenessQuestions.forEach((n) => {
7959
8069
  const a = `question_${n.id}`;
7960
- t[a] = Ln();
8070
+ t[a] = Dn();
7961
8071
  }), qe.object(t);
7962
8072
  }
7963
- const na = qe.any();
8073
+ const aa = qe.any();
7964
8074
  export {
7965
8075
  Rt as ALLOWED_LANGUAGES,
7966
8076
  Gt as ApplicantProgressOnHoldReason,
@@ -7969,18 +8079,18 @@ export {
7969
8079
  Zt as ApplicantStatus,
7970
8080
  nr as AppropriatenessQuestionType,
7971
8081
  hr as AppropriatenessTestService,
7972
- Rn as AppropriatenessTestStep,
8082
+ In as AppropriatenessTestStep,
7973
8083
  zt as Badge,
7974
8084
  xr as BaseInformationService,
7975
8085
  Z as Button,
7976
8086
  it as COMPANY_FIELD_METADATA,
7977
- te as Card,
7978
- re as CardContent,
8087
+ re as Card,
8088
+ ne as CardContent,
7979
8089
  Ce as CardFooter,
7980
- we as CardHeader,
8090
+ Se as CardHeader,
7981
8091
  Ge as CountriesType,
7982
- Gn as CreateApplicantForm,
7983
- Jn as CreateCompanyApplicantForm,
8092
+ Jn as CreateApplicantForm,
8093
+ Zn as CreateCompanyApplicantForm,
7984
8094
  ir as CriteriaBuiltInType,
7985
8095
  or as DEFAULT_COMPANY_VISIBLE_FIELDS,
7986
8096
  lr as DEFAULT_VISIBLE_FIELDS,
@@ -7990,94 +8100,94 @@ export {
7990
8100
  Er as EventEmitter,
7991
8101
  rt as FIELD_METADATA,
7992
8102
  tr as FileType,
7993
- en as FileUpload,
7994
- ft as GenderType,
8103
+ tn as FileUpload,
8104
+ gt as GenderType,
7995
8105
  pt as Header,
7996
8106
  ur as HttpClient,
7997
8107
  Qe as IdentityProviderManager,
7998
8108
  br as IdentityService,
7999
8109
  Oe as IdentityVerificationProvider,
8000
- Fn as IdentityVerificationStep,
8110
+ An as IdentityVerificationStep,
8001
8111
  xe as Input,
8002
8112
  vr as InvestorCategorizationService,
8003
- Nn as InvestorCategorizationStep,
8113
+ Rn as InvestorCategorizationStep,
8004
8114
  Ee as InvestorCategorizationType,
8005
8115
  sr as InvestorCategoryType,
8006
8116
  Xt as KycProcessStatus,
8007
8117
  et as KycStatus,
8008
- Pt as KycStatusDisplay,
8009
- Zn as KycWorkflow,
8010
- An as Logo,
8118
+ Tt as KycStatusDisplay,
8119
+ Xn as KycWorkflow,
8120
+ Tn as Logo,
8011
8121
  Mt as MetaKYCContext,
8012
8122
  We as MetaKYCError,
8013
- Wn as MetaKYCProvider,
8014
- Zr as MultiSelect,
8015
- Dr as OnfidoProvider,
8016
- gr as OverviewService,
8123
+ Un as MetaKYCProvider,
8124
+ Xr as MultiSelect,
8125
+ Mr as OnfidoProvider,
8126
+ fr as OverviewService,
8017
8127
  gn as OverviewStep,
8018
- tn as PhoneInput,
8128
+ rn as PhoneInput,
8019
8129
  mr as QuestionnaireService,
8020
- pn as QuestionnaireStep,
8130
+ mn as QuestionnaireStep,
8021
8131
  tt as ReviewStatus,
8022
8132
  ar as RiskCriteriaType,
8023
8133
  Jt as RiskLevel,
8024
- fr as RiskScoringService,
8025
- Sn as RiskScoringStep,
8026
- Mr as SardinAIProvider,
8134
+ gr as RiskScoringService,
8135
+ Cn as RiskScoringStep,
8136
+ Or as SardinAIProvider,
8027
8137
  Ke as SearchableSelect,
8028
8138
  St as Select,
8029
8139
  Me as Spinner,
8030
8140
  Ar as StepRouter,
8031
- Lr as SumsubProvider,
8032
- zr as ThemeManager,
8141
+ Dr as SumsubProvider,
8142
+ Br as ThemeManager,
8033
8143
  Fe as ThemePreset,
8034
8144
  Ir as ThemeService,
8035
8145
  yr as UploadDocumentService,
8036
- hn as UploadDocumentStep,
8146
+ fn as UploadDocumentStep,
8037
8147
  er as UserType,
8038
8148
  Ue as ValueDataType,
8039
- Pr as WorkflowOrchestrator,
8040
- gt as WorkflowResultType,
8149
+ Tr as WorkflowOrchestrator,
8150
+ ft as WorkflowResultType,
8041
8151
  Fr as WorkflowState,
8042
8152
  ce as WorkflowStepAction,
8043
- na as appropriatenessTestSchema,
8044
- Yn as clearAllStorage,
8045
- jr as clearApplicantId,
8046
- Wr as clearWorkflowState,
8153
+ aa as appropriatenessTestSchema,
8154
+ Qn as clearAllStorage,
8155
+ Hr as clearApplicantId,
8156
+ Ur as clearWorkflowState,
8047
8157
  Ae as cn,
8048
8158
  kr as corporateTheme,
8049
8159
  cr as defaultConfig,
8050
8160
  Le as defaultTheme,
8051
- Br as fileToBase64,
8161
+ $r as fileToBase64,
8052
8162
  wr as fintechTheme,
8053
8163
  bt as formatFileSize,
8054
- ra as generateAppropriatenessSchema,
8055
- Xn as generateQuestionnaireSchema,
8056
- ta as generateRiskScoringSchema,
8057
- ea as generateUploadDocumentSchema,
8058
- qn as getAcceptString,
8059
- _r as getApplicantId,
8164
+ na as generateAppropriatenessSchema,
8165
+ ea as generateQuestionnaireSchema,
8166
+ ra as generateRiskScoringSchema,
8167
+ ta as generateUploadDocumentSchema,
8168
+ Vn as getAcceptString,
8169
+ jr as getApplicantId,
8060
8170
  dt as getThemePreset,
8061
- Vn as getWorkflowState,
8171
+ Yn as getWorkflowState,
8062
8172
  Sr as healthcareTheme,
8063
- jn as isScriptLoaded,
8173
+ Hn as isScriptLoaded,
8064
8174
  Dt as loadScript,
8065
8175
  Nr as minimalTheme,
8066
8176
  Cr as modernTheme,
8067
- Hn as removeScript,
8068
- $r as saveApplicantId,
8069
- Hr as saveWorkflowState,
8177
+ Wn as removeScript,
8178
+ _r as saveApplicantId,
8179
+ Wr as saveWorkflowState,
8070
8180
  Rr as themePresets,
8071
8181
  Ot as useApplicant,
8072
- Qn as useAppropriatenessTest,
8073
- Yr as useIdentityVerification,
8074
- Ur as useKycWorkflow,
8075
- Pe as useMetaKYC,
8076
- Vr as useOverview,
8077
- Kr as useQuestionnaire,
8078
- Qr as useRiskScoring,
8079
- qr as useUploadDocument,
8080
- Un as validateFileSize,
8081
- Kn as validateFileType
8182
+ Gn as useAppropriatenessTest,
8183
+ Qr as useIdentityVerification,
8184
+ Kr as useKycWorkflow,
8185
+ Te as useMetaKYC,
8186
+ Yr as useOverview,
8187
+ qr as useQuestionnaire,
8188
+ Gr as useRiskScoring,
8189
+ Vr as useUploadDocument,
8190
+ Kn as validateFileSize,
8191
+ qn as validateFileType
8082
8192
  };
8083
8193
  //# sourceMappingURL=index.js.map