@vpdev2/metakyc-sdk 1.0.73 → 1.0.74

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 kt = (e, t, n) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var re = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import wt from "axios";
5
5
  import * as ot from "react";
6
- import fe, { createContext as Nt, useState as w, useMemo as Ie, useEffect as ne, useContext as St, useRef as ee, useCallback as G, forwardRef as Ge, createElement as nt } from "react";
6
+ import xe, { createContext as Nt, useState as k, useMemo as Ee, useEffect as ne, useContext as St, useRef as ee, useCallback as V, forwardRef as Ge, createElement as nt } from "react";
7
7
  import { jsx as r, jsxs as o, Fragment as Qe } from "react/jsx-runtime";
8
8
  import Ct, { createPortal as it } from "react-dom";
9
- import { useForm as At, Controller as Te } from "react-hook-form";
10
- import { z as Se } from "zod";
11
- var V = /* @__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))(V || {}), Je = /* @__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))(Je || {}), ke = /* @__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))(ke || {}), It = /* @__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))(It || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}), Le = /* @__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))(Le || {}), De = /* @__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))(De || {}), Rt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Rt || {}), Pt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Pt || {}), ve = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ve || {}), Ft = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Ft || {}), Ze = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ze || {}), Tt = /* @__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))(Tt || {}), Lt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Lt || {}), Dt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Dt || {}), Ee = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ee || {}), Mt = /* @__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))(Mt || {}), Ot = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Ot || {}), ye = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(ye || {}), $t = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))($t || {});
9
+ import { useForm as At, Controller as Le } from "react-hook-form";
10
+ import { z as Ce } from "zod";
11
+ var J = /* @__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))(J || {}), Je = /* @__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))(Je || {}), ke = /* @__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))(ke || {}), It = /* @__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))(It || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}), Te = /* @__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))(Te || {}), De = /* @__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))(De || {}), Rt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Rt || {}), Pt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Pt || {}), ve = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ve || {}), Ft = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Ft || {}), Ze = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ze || {}), Lt = /* @__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))(Lt || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Tt || {}), Dt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Dt || {}), Se = /* @__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))(Se || {}), Mt = /* @__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))(Mt || {}), Ot = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Ot || {}), fe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(fe || {}), $t = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))($t || {});
12
12
  const $e = {
13
13
  Nationality: 10,
14
14
  Address: 20,
@@ -1177,7 +1177,7 @@ class sr {
1177
1177
  async loadStepData(t, n) {
1178
1178
  const a = this.getHandler(t);
1179
1179
  if (!a)
1180
- throw new Error(`No handler registered for step action: ${V[t]}`);
1180
+ throw new Error(`No handler registered for step action: ${J[t]}`);
1181
1181
  return a.loadData(n);
1182
1182
  }
1183
1183
  /**
@@ -1186,7 +1186,7 @@ class sr {
1186
1186
  async submitStepData(t, n) {
1187
1187
  const a = this.getHandler(t);
1188
1188
  if (!a)
1189
- throw new Error(`No handler registered for step action: ${V[t]}`);
1189
+ throw new Error(`No handler registered for step action: ${J[t]}`);
1190
1190
  return a.submitData(n);
1191
1191
  }
1192
1192
  }
@@ -1200,47 +1200,47 @@ class or {
1200
1200
  * Register all step handlers
1201
1201
  */
1202
1202
  registerStepHandlers() {
1203
- this.stepRouter.registerHandler(V.Questionaries, {
1203
+ this.stepRouter.registerHandler(J.Questionaries, {
1204
1204
  loadData: (t) => this.questionnaireService.getQuestionnaire(t),
1205
1205
  submitData: async (t) => {
1206
1206
  await this.questionnaireService.fillQuestionnaire(t);
1207
1207
  }
1208
- }), this.stepRouter.registerHandler(V.UploadDocument, {
1208
+ }), this.stepRouter.registerHandler(J.UploadDocument, {
1209
1209
  loadData: (t) => this.uploadDocumentService.getUploadDocument(t),
1210
1210
  submitData: (t) => this.uploadDocumentService.fillUploadDocument(t)
1211
- }), this.stepRouter.registerHandler(V.AppropriatenessTest, {
1211
+ }), this.stepRouter.registerHandler(J.AppropriatenessTest, {
1212
1212
  loadData: (t) => this.appropriatenessTestService.getAppropriatenessTest(t),
1213
1213
  submitData: async (t) => {
1214
1214
  await this.appropriatenessTestService.fillAppropriatenessTest(t);
1215
1215
  }
1216
- }), this.stepRouter.registerHandler(V.Overview, {
1216
+ }), this.stepRouter.registerHandler(J.Overview, {
1217
1217
  loadData: (t) => this.overviewService.getOverviewData(t),
1218
1218
  submitData: (t) => this.overviewService.passOverview(t.applicantId)
1219
- }), this.stepRouter.registerHandler(V.RiskScoring, {
1219
+ }), this.stepRouter.registerHandler(J.RiskScoring, {
1220
1220
  loadData: (t) => this.riskScoringService.getRiskCriterias(t),
1221
1221
  submitData: async (t) => {
1222
1222
  await this.riskScoringService.submitRiskScoring(t);
1223
1223
  }
1224
- }), this.stepRouter.registerHandler(V.IdentitySdk, {
1224
+ }), this.stepRouter.registerHandler(J.IdentitySdk, {
1225
1225
  loadData: async (t) => ({
1226
1226
  applicantId: t,
1227
1227
  message: "Identity verification required"
1228
1228
  }),
1229
1229
  submitData: async () => {
1230
1230
  }
1231
- }), this.stepRouter.registerHandler(V.InvestorCategorization, {
1231
+ }), this.stepRouter.registerHandler(J.InvestorCategorization, {
1232
1232
  loadData: (t) => this.investorCategorizationService.getInvestorCategorization(t),
1233
1233
  submitData: async (t) => {
1234
1234
  await this.investorCategorizationService.setInvestorCategorization(t);
1235
1235
  }
1236
- }), this.stepRouter.registerHandler(V.ManualReview, {
1236
+ }), this.stepRouter.registerHandler(J.ManualReview, {
1237
1237
  loadData: async (t) => ({
1238
1238
  applicantId: t,
1239
1239
  message: "Your application is under manual review"
1240
1240
  }),
1241
1241
  submitData: async () => {
1242
1242
  }
1243
- }), this.stepRouter.registerHandler(V.AdditionalData, {
1243
+ }), this.stepRouter.registerHandler(J.AdditionalData, {
1244
1244
  loadData: async (t) => ({
1245
1245
  applicantId: t,
1246
1246
  message: "Additional data required"
@@ -1344,10 +1344,10 @@ function ht(e, t) {
1344
1344
  s.src = e, t && (s.id = t), s.async = !0, s.onload = () => n(), s.onerror = () => a(new Error(`Failed to load script: ${e}`)), document.head.appendChild(s);
1345
1345
  });
1346
1346
  }
1347
- function sn(e) {
1347
+ function cn(e) {
1348
1348
  return !!document.getElementById(e);
1349
1349
  }
1350
- function on(e) {
1350
+ function dn(e) {
1351
1351
  const t = document.getElementById(e);
1352
1352
  t && t.remove();
1353
1353
  }
@@ -1551,10 +1551,10 @@ class dr {
1551
1551
  console.log(`[SardinAI] Device ID: ${u.deviceId}`);
1552
1552
  },
1553
1553
  // New callback for session updates
1554
- onConfigUpdate: (u, h, p) => {
1554
+ onConfigUpdate: (u, h, m) => {
1555
1555
  switch (u) {
1556
1556
  case "SESSION_UPDATE_FAILED":
1557
- console.error("[SardinAI] Session update failed:", p);
1557
+ console.error("[SardinAI] Session update failed:", m);
1558
1558
  break;
1559
1559
  case "SESSION_UPDATED":
1560
1560
  console.log("[SardinAI] Session updated:", h);
@@ -1796,24 +1796,24 @@ class ur {
1796
1796
  return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1797
1797
  }
1798
1798
  }
1799
- const gt = Nt(null), ln = ({ config: e, children: t }) => {
1800
- const [n, a] = w(null), s = fe.useRef(!1), l = fe.useRef(!1), c = Ie(() => {
1801
- const h = new Ht(e), p = new Ut(h), v = new jt(h), I = new Kt(h), f = new Wt(h), k = new Yt(h), x = new qt(h), D = new Qt(h), P = new Gt(h), A = new Vt(h), z = new nr(h), E = new ur();
1799
+ const gt = Nt(null), un = ({ config: e, children: t }) => {
1800
+ const [n, a] = k(null), s = xe.useRef(!1), l = xe.useRef(!1), c = Ee(() => {
1801
+ const h = new Ht(e), m = new Ut(h), v = new jt(h), S = new Kt(h), f = new Wt(h), N = new Yt(h), x = new qt(h), D = new Qt(h), F = new Gt(h), R = new Vt(h), $ = new nr(h), E = new ur();
1802
1802
  return {
1803
1803
  httpClient: h,
1804
- applicantService: p,
1804
+ applicantService: m,
1805
1805
  questionnaireService: v,
1806
- uploadDocumentService: I,
1806
+ uploadDocumentService: S,
1807
1807
  appropriatenessTestService: f,
1808
- overviewService: k,
1808
+ overviewService: N,
1809
1809
  riskScoringService: x,
1810
1810
  identityService: D,
1811
- baseInformationService: P,
1812
- investorCategorizationService: A,
1813
- themeService: z,
1811
+ baseInformationService: F,
1812
+ investorCategorizationService: R,
1813
+ themeService: $,
1814
1814
  themeManager: E
1815
1815
  };
1816
- }, [e]), u = Ie(() => ({
1816
+ }, [e]), u = Ee(() => ({
1817
1817
  config: e,
1818
1818
  ...c,
1819
1819
  currentTheme: n,
@@ -1840,10 +1840,10 @@ const gt = Nt(null), ln = ({ config: e, children: t }) => {
1840
1840
  return;
1841
1841
  }
1842
1842
  console.log("[MetaKYC] Fetching theme from backend...");
1843
- const p = await c.themeService.getThemeConfiguration();
1844
- c.themeManager.applyTheme(p), a(c.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", p);
1845
- } catch (p) {
1846
- console.warn("[MetaKYC] Failed to load theme, using default:", p), a(c.themeManager.getCurrentTheme()), l.current = !0;
1843
+ const m = await c.themeService.getThemeConfiguration();
1844
+ c.themeManager.applyTheme(m), a(c.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", m);
1845
+ } catch (m) {
1846
+ console.warn("[MetaKYC] Failed to load theme, using default:", m), a(c.themeManager.getCurrentTheme()), l.current = !0;
1847
1847
  } finally {
1848
1848
  s.current = !1;
1849
1849
  }
@@ -1851,7 +1851,7 @@ const gt = Nt(null), ln = ({ config: e, children: t }) => {
1851
1851
  c.themeManager.cleanup();
1852
1852
  }), []), /* @__PURE__ */ r(gt.Provider, { value: u, children: t });
1853
1853
  };
1854
- function xe() {
1854
+ function ge() {
1855
1855
  const e = St(gt);
1856
1856
  if (!e)
1857
1857
  throw new Error("useMetaKYC must be used within a MetaKYCProvider");
@@ -1866,10 +1866,10 @@ async function mr(e) {
1866
1866
  }, a.onerror = (s) => n(s);
1867
1867
  });
1868
1868
  }
1869
- function cn(e, t) {
1869
+ function mn(e, t) {
1870
1870
  return e.size <= t;
1871
1871
  }
1872
- function dn(e, t) {
1872
+ function pn(e, t) {
1873
1873
  return t.split(",").map((a) => a.trim()).some((a) => {
1874
1874
  if (a.endsWith("/*")) {
1875
1875
  const s = a.slice(0, -2);
@@ -1883,7 +1883,7 @@ function rt(e) {
1883
1883
  const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
1884
1884
  return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
1885
1885
  }
1886
- function un(e) {
1886
+ function hn(e) {
1887
1887
  return e;
1888
1888
  }
1889
1889
  function oe(...e) {
@@ -1922,7 +1922,7 @@ function yr(e) {
1922
1922
  console.warn("Failed to save workflow state to storage:", t);
1923
1923
  }
1924
1924
  }
1925
- function mn() {
1925
+ function gn() {
1926
1926
  try {
1927
1927
  const e = localStorage.getItem(Be.WORKFLOW_STATE);
1928
1928
  return e ? JSON.parse(e) : null;
@@ -1937,45 +1937,45 @@ function fr() {
1937
1937
  console.warn("Failed to clear workflow state from storage:", e);
1938
1938
  }
1939
1939
  }
1940
- function pn() {
1940
+ function yn() {
1941
1941
  gr(), fr();
1942
1942
  }
1943
1943
  function xr(e) {
1944
- const { createOrchestrator: t } = xe(), [n, a] = w(null), [s, l] = w(!1), [c, u] = w(null), h = ee(null), p = e || hr();
1944
+ const { createOrchestrator: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(null), h = ee(null), m = e || hr();
1945
1945
  ne(() => {
1946
1946
  h.current || (h.current = t());
1947
1947
  }, [t]), ne(() => {
1948
1948
  var E;
1949
- n && p && (pr(p), yr({
1950
- applicantId: p,
1949
+ n && m && (pr(m), yr({
1950
+ applicantId: m,
1951
1951
  currentStepOrder: (E = n.currentStep) == null ? void 0 : E.order,
1952
1952
  status: n.status,
1953
1953
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
1954
1954
  workflowKey: n.workFlowKey,
1955
1955
  nextWorkflowKey: n.nextWorkflowKey
1956
1956
  }));
1957
- }, [n, p]);
1958
- const v = ee(!1), I = ee(!1), f = G(async () => {
1959
- if (!(!p || !h.current)) {
1957
+ }, [n, m]);
1958
+ const v = ee(!1), S = ee(!1), f = V(async () => {
1959
+ if (!(!m || !h.current)) {
1960
1960
  if (v.current) {
1961
1961
  console.log("[Workflow] Load already in progress, skipping...");
1962
1962
  return;
1963
1963
  }
1964
1964
  v.current = !0, l(!0), u(null);
1965
1965
  try {
1966
- const E = await h.current.initialize(p);
1967
- a(E), I.current = !0;
1966
+ const E = await h.current.initialize(m);
1967
+ a(E), S.current = !0;
1968
1968
  } catch (E) {
1969
1969
  u(E);
1970
1970
  } finally {
1971
1971
  l(!1), v.current = !1;
1972
1972
  }
1973
1973
  }
1974
- }, [p]);
1974
+ }, [m]);
1975
1975
  ne(() => {
1976
- p && !I.current && f();
1977
- }, [p, f]);
1978
- const k = G(async () => {
1976
+ m && !S.current && f();
1977
+ }, [m, f]);
1978
+ const N = V(async () => {
1979
1979
  if (h.current) {
1980
1980
  if (v.current) {
1981
1981
  console.log("[Workflow] Refresh already in progress, skipping...");
@@ -1991,7 +1991,7 @@ function xr(e) {
1991
1991
  l(!1), v.current = !1;
1992
1992
  }
1993
1993
  }
1994
- }, []), x = G(async () => {
1994
+ }, []), x = V(async () => {
1995
1995
  if (h.current) {
1996
1996
  l(!0), u(null);
1997
1997
  try {
@@ -2003,7 +2003,7 @@ function xr(e) {
2003
2003
  l(!1);
2004
2004
  }
2005
2005
  }
2006
- }, []), D = G(async () => {
2006
+ }, []), D = V(async () => {
2007
2007
  if (h.current) {
2008
2008
  l(!0), u(null);
2009
2009
  try {
@@ -2015,63 +2015,63 @@ function xr(e) {
2015
2015
  l(!1);
2016
2016
  }
2017
2017
  }
2018
- }, []), P = G(async (E) => {
2018
+ }, []), F = V(async (E) => {
2019
2019
  if (h.current) {
2020
2020
  l(!0), u(null);
2021
2021
  try {
2022
2022
  await h.current.submitCurrentStep(E);
2023
- const F = await h.current.refreshProgress();
2024
- a(F);
2025
- } catch (F) {
2026
- throw u(F), F;
2023
+ const L = await h.current.refreshProgress();
2024
+ a(L);
2025
+ } catch (L) {
2026
+ throw u(L), L;
2027
2027
  } finally {
2028
2028
  l(!1);
2029
2029
  }
2030
2030
  }
2031
- }, []), A = ot.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((E, F) => E.order - F.order) : [], [n == null ? void 0 : n.stepInfoList]), z = ot.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2031
+ }, []), R = ot.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((E, L) => E.order - L.order) : [], [n == null ? void 0 : n.stepInfoList]), $ = ot.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2032
2032
  return {
2033
2033
  progress: n,
2034
- applicantId: p,
2034
+ applicantId: m,
2035
2035
  currentStep: (n == null ? void 0 : n.currentStep) || null,
2036
- steps: A,
2036
+ steps: R,
2037
2037
  status: (n == null ? void 0 : n.status) || ke.None,
2038
2038
  workflowResult: (n == null ? void 0 : n.workflowResult) || null,
2039
2039
  workflowKey: n == null ? void 0 : n.workFlowKey,
2040
2040
  nextWorkflowKey: n == null ? void 0 : n.nextWorkflowKey,
2041
- hasWorkflowChanged: z,
2041
+ hasWorkflowChanged: $,
2042
2042
  isLoading: s,
2043
2043
  error: c,
2044
2044
  isComplete: (n == null ? void 0 : n.status) === ke.Finished,
2045
2045
  isOnHold: (n == null ? void 0 : n.status) === ke.OnHold,
2046
- refreshProgress: k,
2046
+ refreshProgress: N,
2047
2047
  moveToNext: x,
2048
2048
  moveBack: D,
2049
- submitCurrentStep: P,
2049
+ submitCurrentStep: F,
2050
2050
  orchestrator: h.current
2051
2051
  };
2052
2052
  }
2053
2053
  function br(e) {
2054
- const { questionnaireService: t, applicantService: n } = xe(), [a, s] = w(null), [l, c] = w({}), [u, h] = w(!1), [p, v] = w(!1), [I, f] = w(null), k = ee(!1), x = ee(null), D = G(async () => {
2055
- var A, z;
2054
+ const { questionnaireService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [S, f] = k(null), N = ee(!1), x = ee(null), D = V(async () => {
2055
+ var R, $;
2056
2056
  if (e) {
2057
- if (k.current) {
2057
+ if (N.current) {
2058
2058
  console.log("[Questionnaire] Load already in progress, skipping...");
2059
2059
  return;
2060
2060
  }
2061
- k.current = !0, h(!0), f(null);
2061
+ N.current = !0, h(!0), f(null);
2062
2062
  try {
2063
- const [E, F] = await Promise.all([
2063
+ const [E, L] = await Promise.all([
2064
2064
  t.getQuestionnaire(e),
2065
2065
  n.getApplicantData(e).catch(() => null)
2066
2066
  ]);
2067
- if (s(E), (A = F == null ? void 0 : F.questionnaireResults) != null && A.length && E) {
2068
- const Q = /* @__PURE__ */ new Map();
2069
- for (const N of F.questionnaireResults)
2070
- N.question && ((z = N.answers) != null && z.length) && Q.set(N.question.trim().toLowerCase(), N.answers);
2071
- const X = {}, R = E.questionGroups.flatMap((N) => N.questions ?? []);
2072
- for (const N of R) {
2073
- const L = N.text.trim().toLowerCase();
2074
- Q.has(L) && (X[N.id] = Q.get(L));
2067
+ if (s(E), (R = L == null ? void 0 : L.questionnaireResults) != null && R.length && E) {
2068
+ const Y = /* @__PURE__ */ new Map();
2069
+ for (const w of L.questionnaireResults)
2070
+ w.question && (($ = w.answers) != null && $.length) && Y.set(w.question.trim().toLowerCase(), w.answers);
2071
+ const X = {}, P = E.questionGroups.flatMap((w) => w.questions ?? []);
2072
+ for (const w of P) {
2073
+ const H = w.text.trim().toLowerCase();
2074
+ Y.has(H) && (X[w.id] = Y.get(H));
2075
2075
  }
2076
2076
  c(X);
2077
2077
  }
@@ -2079,20 +2079,20 @@ function br(e) {
2079
2079
  } catch (E) {
2080
2080
  f(E);
2081
2081
  } finally {
2082
- h(!1), k.current = !1;
2082
+ h(!1), N.current = !1;
2083
2083
  }
2084
2084
  }
2085
2085
  }, [e, t, n]);
2086
2086
  ne(() => {
2087
2087
  e && x.current !== e && D();
2088
2088
  }, [e]);
2089
- const P = G(
2090
- async (A) => {
2089
+ const F = V(
2090
+ async (R) => {
2091
2091
  v(!0), f(null);
2092
2092
  try {
2093
- return await t.fillQuestionnaire(A);
2094
- } catch (z) {
2095
- throw f(z), z;
2093
+ return await t.fillQuestionnaire(R);
2094
+ } catch ($) {
2095
+ throw f($), $;
2096
2096
  } finally {
2097
2097
  v(!1);
2098
2098
  }
@@ -2103,40 +2103,40 @@ function br(e) {
2103
2103
  questionnaire: a,
2104
2104
  initialAnswers: l,
2105
2105
  isLoading: u,
2106
- isSubmitting: p,
2107
- error: I,
2106
+ isSubmitting: m,
2107
+ error: S,
2108
2108
  load: D,
2109
- submit: P
2109
+ submit: F
2110
2110
  };
2111
2111
  }
2112
2112
  function vr(e) {
2113
- const { uploadDocumentService: t } = xe(), [n, a] = w(null), [s, l] = w(!1), [c, u] = w(!1), [h, p] = w(0), [v, I] = w(null), f = ee(!1), k = ee(null), x = G(async () => {
2113
+ const { uploadDocumentService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [v, S] = k(null), f = ee(!1), N = ee(null), x = V(async () => {
2114
2114
  if (e) {
2115
2115
  if (f.current) {
2116
2116
  console.log("[UploadDocument] Load already in progress, skipping...");
2117
2117
  return;
2118
2118
  }
2119
- f.current = !0, l(!0), I(null);
2119
+ f.current = !0, l(!0), S(null);
2120
2120
  try {
2121
- const P = await t.getUploadDocument(e);
2122
- a(P), k.current = e;
2123
- } catch (P) {
2124
- I(P);
2121
+ const F = await t.getUploadDocument(e);
2122
+ a(F), N.current = e;
2123
+ } catch (F) {
2124
+ S(F);
2125
2125
  } finally {
2126
2126
  l(!1), f.current = !1;
2127
2127
  }
2128
2128
  }
2129
2129
  }, [e, t]);
2130
2130
  ne(() => {
2131
- e && k.current !== e && x();
2131
+ e && N.current !== e && x();
2132
2132
  }, [e]);
2133
- const D = G(
2134
- async (P) => {
2135
- u(!0), p(0), I(null);
2133
+ const D = V(
2134
+ async (F) => {
2135
+ u(!0), m(0), S(null);
2136
2136
  try {
2137
- await t.fillUploadDocument(P), p(100);
2138
- } catch (A) {
2139
- throw I(A), A;
2137
+ await t.fillUploadDocument(F), m(100);
2138
+ } catch (R) {
2139
+ throw S(R), R;
2140
2140
  } finally {
2141
2141
  u(!1);
2142
2142
  }
@@ -2153,35 +2153,35 @@ function vr(e) {
2153
2153
  submit: D
2154
2154
  };
2155
2155
  }
2156
- function hn(e) {
2157
- const { appropriatenessTestService: t } = xe(), [n, a] = w(null), [s, l] = w(!1), [c, u] = w(!1), [h, p] = w(null), [v, I] = w(null), f = ee(!1), k = ee(null), x = G(async () => {
2156
+ function fn(e) {
2157
+ const { appropriatenessTestService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [v, S] = k(null), f = ee(!1), N = ee(null), x = V(async () => {
2158
2158
  if (e) {
2159
2159
  if (f.current) {
2160
2160
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
2161
2161
  return;
2162
2162
  }
2163
- f.current = !0, l(!0), p(null);
2163
+ f.current = !0, l(!0), m(null);
2164
2164
  try {
2165
- const P = await t.getAppropriatenessTest(e);
2166
- a(P), k.current = e;
2167
- } catch (P) {
2168
- p(P);
2165
+ const F = await t.getAppropriatenessTest(e);
2166
+ a(F), N.current = e;
2167
+ } catch (F) {
2168
+ m(F);
2169
2169
  } finally {
2170
2170
  l(!1), f.current = !1;
2171
2171
  }
2172
2172
  }
2173
2173
  }, [e, t]);
2174
2174
  ne(() => {
2175
- e && k.current !== e && x();
2175
+ e && N.current !== e && x();
2176
2176
  }, [e]);
2177
- const D = G(
2178
- async (P) => {
2179
- u(!0), p(null);
2177
+ const D = V(
2178
+ async (F) => {
2179
+ u(!0), m(null);
2180
2180
  try {
2181
- const A = await t.fillAppropriatenessTest(P);
2182
- return I(A), A;
2183
- } catch (A) {
2184
- throw p(A), A;
2181
+ const R = await t.fillAppropriatenessTest(F);
2182
+ return S(R), R;
2183
+ } catch (R) {
2184
+ throw m(R), R;
2185
2185
  } finally {
2186
2186
  u(!1);
2187
2187
  }
@@ -2199,33 +2199,33 @@ function hn(e) {
2199
2199
  };
2200
2200
  }
2201
2201
  function kr(e) {
2202
- const { overviewService: t } = xe(), [n, a] = w(null), [s, l] = w(!1), [c, u] = w(!1), [h, p] = w(null), v = ee(!1), I = ee(null), f = G(async () => {
2202
+ const { overviewService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), v = ee(!1), S = ee(null), f = V(async () => {
2203
2203
  if (e) {
2204
2204
  if (v.current) {
2205
2205
  console.log("[Overview] Load already in progress, skipping...");
2206
2206
  return;
2207
2207
  }
2208
- v.current = !0, l(!0), p(null);
2208
+ v.current = !0, l(!0), m(null);
2209
2209
  try {
2210
2210
  const x = await t.getOverviewData(e);
2211
- a(x), I.current = e;
2211
+ a(x), S.current = e;
2212
2212
  } catch (x) {
2213
- p(x);
2213
+ m(x);
2214
2214
  } finally {
2215
2215
  l(!1), v.current = !1;
2216
2216
  }
2217
2217
  }
2218
2218
  }, [e, t]);
2219
2219
  ne(() => {
2220
- e && I.current !== e && f();
2220
+ e && S.current !== e && f();
2221
2221
  }, [e]);
2222
- const k = G(async () => {
2222
+ const N = V(async () => {
2223
2223
  if (e) {
2224
- u(!0), p(null);
2224
+ u(!0), m(null);
2225
2225
  try {
2226
2226
  await t.passOverview(e);
2227
2227
  } catch (x) {
2228
- throw p(x), x;
2228
+ throw m(x), x;
2229
2229
  } finally {
2230
2230
  u(!1);
2231
2231
  }
@@ -2237,14 +2237,14 @@ function kr(e) {
2237
2237
  isSubmitting: c,
2238
2238
  error: h,
2239
2239
  load: f,
2240
- passOverview: k
2240
+ passOverview: N
2241
2241
  };
2242
2242
  }
2243
2243
  function wr(e) {
2244
- const { identityService: t } = xe(), [n, a] = w(
2244
+ const { identityService: t } = ge(), [n, a] = k(
2245
2245
  null
2246
- ), [s, l] = w(!1), [c, u] = w(null), h = ee(!1), p = G(
2247
- async (f, k) => {
2246
+ ), [s, l] = k(!1), [c, u] = k(null), h = ee(!1), m = V(
2247
+ async (f, N) => {
2248
2248
  if (e) {
2249
2249
  if (h.current) {
2250
2250
  console.log("[Identity] Request already in progress, skipping...");
@@ -2256,7 +2256,7 @@ function wr(e) {
2256
2256
  applicantId: e,
2257
2257
  restart: !1,
2258
2258
  redirectUrl: f || "",
2259
- ttl: k || 604800
2259
+ ttl: N || 604800
2260
2260
  // Default: 7 days
2261
2261
  };
2262
2262
  console.log("Identity request input:", x);
@@ -2270,8 +2270,8 @@ function wr(e) {
2270
2270
  }
2271
2271
  },
2272
2272
  [e, t]
2273
- ), v = G(
2274
- async (f, k) => {
2273
+ ), v = V(
2274
+ async (f, N) => {
2275
2275
  if (e) {
2276
2276
  l(!0), u(null);
2277
2277
  try {
@@ -2279,7 +2279,7 @@ function wr(e) {
2279
2279
  applicantId: e,
2280
2280
  restart: !1,
2281
2281
  redirectUrl: f,
2282
- ttl: k
2282
+ ttl: N
2283
2283
  }, D = await t.identityCompanyRequest(x);
2284
2284
  return a(D), D;
2285
2285
  } catch (x) {
@@ -2290,7 +2290,7 @@ function wr(e) {
2290
2290
  }
2291
2291
  },
2292
2292
  [e, t]
2293
- ), I = G(async () => {
2293
+ ), S = V(async () => {
2294
2294
  if (e) {
2295
2295
  if (h.current) {
2296
2296
  console.log("[Identity] Restart already in progress, skipping...");
@@ -2306,8 +2306,8 @@ function wr(e) {
2306
2306
  // 7 days
2307
2307
  };
2308
2308
  console.log("Restarting identity with input:", f);
2309
- const k = await t.identityRequest(f);
2310
- return console.log("Restart identity result:", k), a(k), k;
2309
+ const N = await t.identityRequest(f);
2310
+ return console.log("Restart identity result:", N), a(N), N;
2311
2311
  } catch (f) {
2312
2312
  throw u(f), f;
2313
2313
  } finally {
@@ -2321,13 +2321,13 @@ function wr(e) {
2321
2321
  token: (n == null ? void 0 : n.publicProviderTokenObject) || null,
2322
2322
  isLoading: s,
2323
2323
  error: c,
2324
- requestIdentity: p,
2324
+ requestIdentity: m,
2325
2325
  requestCompanyIdentity: v,
2326
- restartIdentity: I
2326
+ restartIdentity: S
2327
2327
  };
2328
2328
  }
2329
2329
  function Nr(e) {
2330
- const { riskScoringService: t, applicantService: n } = xe(), [a, s] = w(null), [l, c] = w({}), [u, h] = w(!1), [p, v] = w(!1), [I, f] = w(null), [k, x] = w(null), D = ee(!1), P = ee(null), A = G(async () => {
2330
+ const { riskScoringService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [S, f] = k(null), [N, x] = k(null), D = ee(!1), F = ee(null), R = V(async () => {
2331
2331
  var E;
2332
2332
  if (e) {
2333
2333
  if (D.current) {
@@ -2336,40 +2336,40 @@ function Nr(e) {
2336
2336
  }
2337
2337
  D.current = !0, h(!0), f(null);
2338
2338
  try {
2339
- const [F, Q] = await Promise.all([
2339
+ const [L, Y] = await Promise.all([
2340
2340
  t.getRiskCriterias(e),
2341
2341
  n.getApplicantData(e).catch(() => null)
2342
2342
  ]);
2343
- if (s(F), (E = Q == null ? void 0 : Q.riskScoringResults) != null && E.length) {
2344
- const X = Q.riskScoringResults[0], R = {};
2345
- for (const N of X.riskCriteriaResults ?? [])
2346
- if (N.riskCriteriaId != null && N.answer != null && N.answer !== "") {
2347
- const L = [...new Set(
2348
- N.answer.split(",").map((B) => B.trim()).filter((B) => B !== "")
2343
+ if (s(L), (E = Y == null ? void 0 : Y.riskScoringResults) != null && E.length) {
2344
+ const X = Y.riskScoringResults[0], P = {};
2345
+ for (const w of X.riskCriteriaResults ?? [])
2346
+ if (w.riskCriteriaId != null && w.answer != null && w.answer !== "") {
2347
+ const H = [...new Set(
2348
+ w.answer.split(",").map((W) => W.trim()).filter((W) => W !== "")
2349
2349
  )];
2350
- L.length > 0 && (R[N.riskCriteriaId] = L);
2350
+ H.length > 0 && (P[w.riskCriteriaId] = H);
2351
2351
  }
2352
- c(R);
2352
+ c(P);
2353
2353
  }
2354
- P.current = e;
2355
- } catch (F) {
2356
- f(F);
2354
+ F.current = e;
2355
+ } catch (L) {
2356
+ f(L);
2357
2357
  } finally {
2358
2358
  h(!1), D.current = !1;
2359
2359
  }
2360
2360
  }
2361
2361
  }, [e, t, n]);
2362
2362
  ne(() => {
2363
- e && P.current !== e && A();
2363
+ e && F.current !== e && R();
2364
2364
  }, [e]);
2365
- const z = G(
2365
+ const $ = V(
2366
2366
  async (E) => {
2367
2367
  v(!0), f(null);
2368
2368
  try {
2369
- const F = await t.submitRiskScoring(E);
2370
- return x(F), F;
2371
- } catch (F) {
2372
- throw f(F), F;
2369
+ const L = await t.submitRiskScoring(E);
2370
+ return x(L), L;
2371
+ } catch (L) {
2372
+ throw f(L), L;
2373
2373
  } finally {
2374
2374
  v(!1);
2375
2375
  }
@@ -2379,33 +2379,33 @@ function Nr(e) {
2379
2379
  return {
2380
2380
  criteria: a,
2381
2381
  initialAnswers: l,
2382
- result: k,
2382
+ result: N,
2383
2383
  isLoading: u,
2384
- isSubmitting: p,
2385
- error: I,
2386
- load: A,
2387
- submit: z
2384
+ isSubmitting: m,
2385
+ error: S,
2386
+ load: R,
2387
+ submit: $
2388
2388
  };
2389
2389
  }
2390
2390
  function Sr() {
2391
- const { applicantService: e, config: t } = xe(), [n, a] = w(!1), [s, l] = w(null), c = ee(!1), u = ee(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(k) {
2391
+ const { applicantService: e, config: t } = ge(), [n, a] = k(!1), [s, l] = k(null), c = ee(!1), u = ee(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(N) {
2392
2392
  const x = Math.random() * 16 | 0;
2393
- return (k === "x" ? x : x & 3 | 8).toString(16);
2394
- }), p = G(
2395
- async (k) => {
2393
+ return (N === "x" ? x : x & 3 | 8).toString(16);
2394
+ }), m = V(
2395
+ async (N) => {
2396
2396
  var x;
2397
2397
  if (c.current)
2398
2398
  throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
2399
2399
  c.current = !0, a(!0), l(null);
2400
2400
  try {
2401
- if (k.applicantAdditionalDatas || (k.applicantAdditionalDatas = []), (x = t.identityProviders) != null && x.sardinai) {
2402
- const P = h();
2403
- console.log("[SardinAI] Generated session key:", P), k.applicantAdditionalDatas.push({
2401
+ if (N.applicantAdditionalDatas || (N.applicantAdditionalDatas = []), (x = t.identityProviders) != null && x.sardinai) {
2402
+ const F = h();
2403
+ console.log("[SardinAI] Generated session key:", F), N.applicantAdditionalDatas.push({
2404
2404
  paramName: "sessionKey",
2405
- value: P
2405
+ value: F
2406
2406
  });
2407
2407
  }
2408
- return await e.createApplicant(k);
2408
+ return await e.createApplicant(N);
2409
2409
  } catch (D) {
2410
2410
  throw l(D), D;
2411
2411
  } finally {
@@ -2413,11 +2413,11 @@ function Sr() {
2413
2413
  }
2414
2414
  },
2415
2415
  [e, t]
2416
- ), v = G(
2417
- async (k) => {
2416
+ ), v = V(
2417
+ async (N) => {
2418
2418
  a(!0), l(null);
2419
2419
  try {
2420
- return await e.createCompanyApplicant(k);
2420
+ return await e.createCompanyApplicant(N);
2421
2421
  } catch (x) {
2422
2422
  throw l(x), x;
2423
2423
  } finally {
@@ -2425,13 +2425,13 @@ function Sr() {
2425
2425
  }
2426
2426
  },
2427
2427
  [e]
2428
- ), I = G(
2429
- async (k) => {
2428
+ ), S = V(
2429
+ async (N) => {
2430
2430
  if (u.current)
2431
2431
  throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
2432
2432
  u.current = !0, a(!0), l(null);
2433
2433
  try {
2434
- return await e.getApplicantData(k);
2434
+ return await e.getApplicantData(N);
2435
2435
  } catch (x) {
2436
2436
  throw l(x), x;
2437
2437
  } finally {
@@ -2439,11 +2439,11 @@ function Sr() {
2439
2439
  }
2440
2440
  },
2441
2441
  [e]
2442
- ), f = G(
2443
- async (k) => {
2442
+ ), f = V(
2443
+ async (N) => {
2444
2444
  a(!0), l(null);
2445
2445
  try {
2446
- await e.stopProgress(k);
2446
+ await e.stopProgress(N);
2447
2447
  } catch (x) {
2448
2448
  throw l(x), x;
2449
2449
  } finally {
@@ -2455,13 +2455,13 @@ function Sr() {
2455
2455
  return {
2456
2456
  isLoading: n,
2457
2457
  error: s,
2458
- createApplicant: p,
2458
+ createApplicant: m,
2459
2459
  createCompanyApplicant: v,
2460
- getApplicantData: I,
2460
+ getApplicantData: S,
2461
2461
  stopProgress: f
2462
2462
  };
2463
2463
  }
2464
- const q = ({
2464
+ const Q = ({
2465
2465
  children: e,
2466
2466
  variant: t = "primary",
2467
2467
  size: n = "md",
@@ -2476,7 +2476,7 @@ const q = ({
2476
2476
  outline: "border-2 border-primary-500 text-primary-500 hover:bg-primary-50 focus:ring-primary-500",
2477
2477
  danger: "bg-danger-500 text-white hover:bg-danger-600 focus:ring-danger-500",
2478
2478
  ghost: "text-gray-700 hover:bg-gray-100 focus:ring-gray-400"
2479
- }, p = {
2479
+ }, m = {
2480
2480
  sm: "px-3 py-1.5 text-sm",
2481
2481
  md: "px-4 py-2 text-base",
2482
2482
  lg: "px-6 py-3 text-lg"
@@ -2484,7 +2484,7 @@ const q = ({
2484
2484
  return /* @__PURE__ */ o(
2485
2485
  "button",
2486
2486
  {
2487
- className: oe(u, h[t], p[n], l),
2487
+ className: oe(u, h[t], m[n], l),
2488
2488
  disabled: s || a,
2489
2489
  ...c,
2490
2490
  children: [
@@ -2599,7 +2599,7 @@ const j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2599
2599
  ...n,
2600
2600
  children: e
2601
2601
  }
2602
- ), Ae = ({ children: e, variant: t = "default", className: n, ...a }) => /* @__PURE__ */ r(
2602
+ ), Ie = ({ children: e, variant: t = "default", className: n, ...a }) => /* @__PURE__ */ r(
2603
2603
  "span",
2604
2604
  {
2605
2605
  className: oe(
@@ -2698,18 +2698,18 @@ const j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2698
2698
  },
2699
2699
  "__placeholder__"
2700
2700
  ),
2701
- a.map((p, v) => /* @__PURE__ */ r(
2701
+ a.map((m, v) => /* @__PURE__ */ r(
2702
2702
  "option",
2703
2703
  {
2704
- value: p.value,
2705
- disabled: p.disabled,
2704
+ value: m.value,
2705
+ disabled: m.disabled,
2706
2706
  style: {
2707
2707
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
2708
- color: p.disabled ? "var(--metakyc-text-secondary, #9ca3af)" : "var(--metakyc-text-primary, #111827)"
2708
+ color: m.disabled ? "var(--metakyc-text-secondary, #9ca3af)" : "var(--metakyc-text-primary, #111827)"
2709
2709
  },
2710
- children: p.label
2710
+ children: m.label
2711
2711
  },
2712
- p.value || `option-${v}`
2712
+ m.value || `option-${v}`
2713
2713
  ))
2714
2714
  ]
2715
2715
  }
@@ -2728,72 +2728,72 @@ const ct = 280, Cr = ({
2728
2728
  disabled: l = !1,
2729
2729
  required: c = !1
2730
2730
  }) => {
2731
- const [u, h] = w(!1), [p, v] = w(""), [I, f] = w(null), k = ee(null), x = ee(null), D = ee(null), P = G(() => {
2731
+ const [u, h] = k(!1), [m, v] = k(""), [S, f] = k(null), N = ee(null), x = ee(null), D = ee(null), F = V(() => {
2732
2732
  if (!x.current) return null;
2733
- const S = x.current.getBoundingClientRect(), te = window.innerHeight - S.bottom < ct && S.top > ct;
2734
- return { top: te ? S.top : S.bottom + 4, left: S.left, width: S.width, openUp: te };
2735
- }, []), A = G(() => {
2733
+ const C = x.current.getBoundingClientRect(), te = window.innerHeight - C.bottom < ct && C.top > ct;
2734
+ return { top: te ? C.top : C.bottom + 4, left: C.left, width: C.width, openUp: te };
2735
+ }, []), R = V(() => {
2736
2736
  if (l) return;
2737
- const S = P();
2738
- S && f(S), h(!0);
2739
- }, [l, P]), z = G(() => {
2737
+ const C = F();
2738
+ C && f(C), h(!0);
2739
+ }, [l, F]), $ = V(() => {
2740
2740
  h(!1), v("");
2741
2741
  }, []);
2742
2742
  ne(() => {
2743
2743
  if (!u) return;
2744
- const S = (U) => {
2745
- var ge, se;
2744
+ const C = (U) => {
2745
+ var ye, se;
2746
2746
  const te = U.target;
2747
- !((ge = k.current) != null && ge.contains(te)) && !((se = D.current) != null && se.contains(te)) && z();
2747
+ !((ye = N.current) != null && ye.contains(te)) && !((se = D.current) != null && se.contains(te)) && $();
2748
2748
  };
2749
- return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
2750
- }, [u, z]), ne(() => {
2749
+ return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
2750
+ }, [u, $]), ne(() => {
2751
2751
  if (!u) return;
2752
- const S = () => {
2753
- const U = P();
2752
+ const C = () => {
2753
+ const U = F();
2754
2754
  U && f(U);
2755
2755
  };
2756
- return window.addEventListener("scroll", S, !0), window.addEventListener("resize", S), () => {
2757
- window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S);
2756
+ return window.addEventListener("scroll", C, !0), window.addEventListener("resize", C), () => {
2757
+ window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C);
2758
2758
  };
2759
- }, [u, P]);
2759
+ }, [u, F]);
2760
2760
  const E = a.filter(
2761
- (S) => S.label.toLowerCase().includes(p.toLowerCase())
2762
- ), F = (S) => {
2763
- l || n(t.includes(S) ? t.filter((U) => U !== S) : [...t, S]);
2764
- }, Q = (S, U) => {
2765
- U.stopPropagation(), l || n(t.filter((te) => te !== S));
2766
- }, X = (S) => {
2761
+ (C) => C.label.toLowerCase().includes(m.toLowerCase())
2762
+ ), L = (C) => {
2763
+ l || n(t.includes(C) ? t.filter((U) => U !== C) : [...t, C]);
2764
+ }, Y = (C, U) => {
2765
+ U.stopPropagation(), l || n(t.filter((te) => te !== C));
2766
+ }, X = (C) => {
2767
2767
  var U;
2768
- return ((U = a.find((te) => te.value === S)) == null ? void 0 : U.label) || S;
2769
- }, R = x.current ? getComputedStyle(x.current) : null, N = (R == null ? void 0 : R.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", L = (R == null ? void 0 : R.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", B = (R == null ? void 0 : R.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", T = (R == null ? void 0 : R.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", W = (R == null ? void 0 : R.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", O = (R == null ? void 0 : R.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", $ = (R == null ? void 0 : R.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", J = u && I && /* @__PURE__ */ o(
2768
+ return ((U = a.find((te) => te.value === C)) == null ? void 0 : U.label) || C;
2769
+ }, P = x.current ? getComputedStyle(x.current) : null, w = (P == null ? void 0 : P.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", H = (P == null ? void 0 : P.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", W = (P == null ? void 0 : P.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", I = (P == null ? void 0 : P.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", B = (P == null ? void 0 : P.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", T = (P == null ? void 0 : P.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", O = (P == null ? void 0 : P.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", G = u && S && /* @__PURE__ */ o(
2770
2770
  "div",
2771
2771
  {
2772
2772
  ref: D,
2773
2773
  className: "metakyc-multiselect-dropdown",
2774
2774
  style: {
2775
2775
  position: "fixed",
2776
- top: I.openUp ? void 0 : I.top,
2777
- bottom: I.openUp ? window.innerHeight - I.top + 4 : void 0,
2778
- left: I.left,
2779
- width: I.width,
2776
+ top: S.openUp ? void 0 : S.top,
2777
+ bottom: S.openUp ? window.innerHeight - S.top + 4 : void 0,
2778
+ left: S.left,
2779
+ width: S.width,
2780
2780
  zIndex: 99999,
2781
2781
  borderRadius: "8px",
2782
2782
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
2783
- border: `1px solid ${L}`,
2784
- backgroundColor: N,
2783
+ border: `1px solid ${H}`,
2784
+ backgroundColor: w,
2785
2785
  overflow: "hidden"
2786
2786
  },
2787
2787
  children: [
2788
- /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${L}` }, children: /* @__PURE__ */ r(
2788
+ /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${H}` }, children: /* @__PURE__ */ r(
2789
2789
  "input",
2790
2790
  {
2791
2791
  type: "text",
2792
- value: p,
2793
- onChange: (S) => v(S.target.value),
2792
+ value: m,
2793
+ onChange: (C) => v(C.target.value),
2794
2794
  placeholder: "Search...",
2795
2795
  autoFocus: !0,
2796
- onClick: (S) => S.stopPropagation(),
2796
+ onClick: (C) => C.stopPropagation(),
2797
2797
  className: "metakyc-multiselect-search w-full",
2798
2798
  style: {
2799
2799
  display: "block",
@@ -2801,20 +2801,20 @@ const ct = 280, Cr = ({
2801
2801
  padding: "6px 8px",
2802
2802
  fontSize: "13px",
2803
2803
  borderRadius: "6px",
2804
- border: `1px solid ${L}`,
2805
- backgroundColor: N,
2806
- color: B,
2804
+ border: `1px solid ${H}`,
2805
+ backgroundColor: w,
2806
+ color: W,
2807
2807
  outline: "none",
2808
2808
  boxSizing: "border-box"
2809
2809
  }
2810
2810
  }
2811
2811
  ) }),
2812
- /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: E.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: T }, children: "No results" }) : E.map((S) => {
2813
- const U = t.includes(S.value);
2812
+ /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: E.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: I }, children: "No results" }) : E.map((C) => {
2813
+ const U = t.includes(C.value);
2814
2814
  return /* @__PURE__ */ o(
2815
2815
  "li",
2816
2816
  {
2817
- onClick: () => F(S.value),
2817
+ onClick: () => L(C.value),
2818
2818
  className: "metakyc-multiselect-option",
2819
2819
  style: {
2820
2820
  display: "flex",
@@ -2823,12 +2823,12 @@ const ct = 280, Cr = ({
2823
2823
  padding: "8px 12px",
2824
2824
  fontSize: "13px",
2825
2825
  cursor: "pointer",
2826
- backgroundColor: U ? O : "transparent",
2827
- color: U ? W : B,
2826
+ backgroundColor: U ? T : "transparent",
2827
+ color: U ? B : W,
2828
2828
  userSelect: "none"
2829
2829
  },
2830
2830
  onMouseEnter: (te) => {
2831
- U || (te.currentTarget.style.backgroundColor = $);
2831
+ U || (te.currentTarget.style.backgroundColor = O);
2832
2832
  },
2833
2833
  onMouseLeave: (te) => {
2834
2834
  U || (te.currentTarget.style.backgroundColor = "transparent");
@@ -2840,16 +2840,16 @@ const ct = 280, Cr = ({
2840
2840
  type: "checkbox",
2841
2841
  checked: U,
2842
2842
  readOnly: !0,
2843
- style: { accentColor: W, pointerEvents: "none", flexShrink: 0 }
2843
+ style: { accentColor: B, pointerEvents: "none", flexShrink: 0 }
2844
2844
  }
2845
2845
  ),
2846
- /* @__PURE__ */ r("span", { children: S.label })
2846
+ /* @__PURE__ */ r("span", { children: C.label })
2847
2847
  ]
2848
2848
  },
2849
- S.value
2849
+ C.value
2850
2850
  );
2851
2851
  }) }),
2852
- t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${L}` }, children: /* @__PURE__ */ o(
2852
+ t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${H}` }, children: /* @__PURE__ */ o(
2853
2853
  "button",
2854
2854
  {
2855
2855
  type: "button",
@@ -2867,7 +2867,7 @@ const ct = 280, Cr = ({
2867
2867
  ]
2868
2868
  }
2869
2869
  );
2870
- return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: k, children: [
2870
+ return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: N, children: [
2871
2871
  e && /* @__PURE__ */ o(
2872
2872
  "label",
2873
2873
  {
@@ -2883,7 +2883,7 @@ const ct = 280, Cr = ({
2883
2883
  "div",
2884
2884
  {
2885
2885
  ref: x,
2886
- onClick: () => u ? z() : A(),
2886
+ onClick: () => u ? $() : R(),
2887
2887
  className: oe(
2888
2888
  "metakyc-multiselect-trigger",
2889
2889
  "min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
@@ -2903,7 +2903,7 @@ const ct = 280, Cr = ({
2903
2903
  style: { color: "var(--metakyc-text-secondary, #9ca3af)" },
2904
2904
  children: s
2905
2905
  }
2906
- ) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((S) => /* @__PURE__ */ o(
2906
+ ) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((C) => /* @__PURE__ */ o(
2907
2907
  "span",
2908
2908
  {
2909
2909
  className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium",
@@ -2912,12 +2912,12 @@ const ct = 280, Cr = ({
2912
2912
  color: "var(--metakyc-primary, #2563eb)"
2913
2913
  },
2914
2914
  children: [
2915
- X(S),
2915
+ X(C),
2916
2916
  !l && /* @__PURE__ */ r(
2917
2917
  "button",
2918
2918
  {
2919
2919
  type: "button",
2920
- onClick: (U) => Q(S, U),
2920
+ onClick: (U) => Y(C, U),
2921
2921
  className: "metakyc-multiselect-chip-remove",
2922
2922
  style: {
2923
2923
  background: "transparent",
@@ -2943,7 +2943,7 @@ const ct = 280, Cr = ({
2943
2943
  )
2944
2944
  ]
2945
2945
  },
2946
- S
2946
+ C
2947
2947
  )) }),
2948
2948
  /* @__PURE__ */ r(
2949
2949
  "span",
@@ -2956,7 +2956,7 @@ const ct = 280, Cr = ({
2956
2956
  ]
2957
2957
  }
2958
2958
  ),
2959
- typeof document < "u" && J ? it(J, document.body) : null
2959
+ typeof document < "u" && G ? it(G, document.body) : null
2960
2960
  ] });
2961
2961
  }, dt = 260, Re = ({
2962
2962
  label: e,
@@ -2968,56 +2968,56 @@ const ct = 280, Cr = ({
2968
2968
  onChange: c,
2969
2969
  disabled: u = !1,
2970
2970
  required: h = !1,
2971
- className: p
2971
+ className: m
2972
2972
  }) => {
2973
2973
  var se;
2974
- const [v, I] = w(!1), [f, k] = w(""), [x, D] = w(null), P = ee(null), A = ee(null), z = ee(null), E = ee(null), F = G(() => {
2975
- if (!A.current) return null;
2976
- const M = A.current.getBoundingClientRect(), ie = window.innerHeight - M.bottom < dt && M.top > dt;
2974
+ const [v, S] = k(!1), [f, N] = k(""), [x, D] = k(null), F = ee(null), R = ee(null), $ = ee(null), E = ee(null), L = V(() => {
2975
+ if (!R.current) return null;
2976
+ const M = R.current.getBoundingClientRect(), ie = window.innerHeight - M.bottom < dt && M.top > dt;
2977
2977
  return {
2978
2978
  top: ie ? M.top : M.bottom + 4,
2979
2979
  left: M.left,
2980
2980
  width: M.width,
2981
2981
  openUp: ie
2982
2982
  };
2983
- }, []), Q = G(() => {
2983
+ }, []), Y = V(() => {
2984
2984
  if (u) return;
2985
- const M = F();
2986
- M && D(M), I(!0);
2987
- }, [u, F]), X = G(() => {
2988
- I(!1), k("");
2989
- }, []), R = () => v ? X() : Q();
2985
+ const M = L();
2986
+ M && D(M), S(!0);
2987
+ }, [u, L]), X = V(() => {
2988
+ S(!1), N("");
2989
+ }, []), P = () => v ? X() : Y();
2990
2990
  ne(() => {
2991
2991
  if (!v) return;
2992
2992
  const M = (Z) => {
2993
- var Ce, Pe;
2993
+ var Ae, Pe;
2994
2994
  const ie = Z.target;
2995
- !((Ce = P.current) != null && Ce.contains(ie)) && !((Pe = z.current) != null && Pe.contains(ie)) && X();
2995
+ !((Ae = F.current) != null && Ae.contains(ie)) && !((Pe = $.current) != null && Pe.contains(ie)) && X();
2996
2996
  };
2997
2997
  return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
2998
2998
  }, [v, X]), ne(() => {
2999
2999
  if (!v) return;
3000
3000
  const M = () => {
3001
- const Z = F();
3001
+ const Z = L();
3002
3002
  Z && D(Z);
3003
3003
  };
3004
3004
  return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), () => {
3005
3005
  window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
3006
3006
  };
3007
- }, [v, F]), ne(() => {
3007
+ }, [v, L]), ne(() => {
3008
3008
  v && E.current && setTimeout(() => {
3009
3009
  var M;
3010
3010
  return (M = E.current) == null ? void 0 : M.focus();
3011
3011
  }, 0);
3012
3012
  }, [v]);
3013
- const N = a.filter(
3013
+ const w = a.filter(
3014
3014
  (M) => M.label.toLowerCase().includes(f.toLowerCase()) || M.value.toLowerCase().includes(f.toLowerCase())
3015
- ), L = (se = a.find((M) => M.value === l)) == null ? void 0 : se.label, B = (M, Z) => {
3015
+ ), H = (se = a.find((M) => M.value === l)) == null ? void 0 : se.label, W = (M, Z) => {
3016
3016
  u || Z || (c(M), X());
3017
- }, T = A.current ? getComputedStyle(A.current) : null, W = (T == null ? void 0 : T.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", O = (T == null ? void 0 : T.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", $ = (T == null ? void 0 : T.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", J = (T == null ? void 0 : T.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", S = (T == null ? void 0 : T.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", U = (T == null ? void 0 : T.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (T == null ? void 0 : T.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", ge = v && x && /* @__PURE__ */ o(
3017
+ }, I = R.current ? getComputedStyle(R.current) : null, B = (I == null ? void 0 : I.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", T = (I == null ? void 0 : I.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", O = (I == null ? void 0 : I.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", G = (I == null ? void 0 : I.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", C = (I == null ? void 0 : I.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", U = (I == null ? void 0 : I.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (I == null ? void 0 : I.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", ye = v && x && /* @__PURE__ */ o(
3018
3018
  "div",
3019
3019
  {
3020
- ref: z,
3020
+ ref: $,
3021
3021
  className: "metakyc-searchable-select-dropdown",
3022
3022
  style: {
3023
3023
  position: "fixed",
@@ -3028,18 +3028,18 @@ const ct = 280, Cr = ({
3028
3028
  zIndex: 99999,
3029
3029
  borderRadius: "8px",
3030
3030
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
3031
- border: `1px solid ${O}`,
3032
- backgroundColor: W,
3031
+ border: `1px solid ${T}`,
3032
+ backgroundColor: B,
3033
3033
  overflow: "hidden"
3034
3034
  },
3035
3035
  children: [
3036
- /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${O}` }, children: /* @__PURE__ */ r(
3036
+ /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${T}` }, children: /* @__PURE__ */ r(
3037
3037
  "input",
3038
3038
  {
3039
3039
  ref: E,
3040
3040
  type: "text",
3041
3041
  value: f,
3042
- onChange: (M) => k(M.target.value),
3042
+ onChange: (M) => N(M.target.value),
3043
3043
  placeholder: "Search...",
3044
3044
  onClick: (M) => M.stopPropagation(),
3045
3045
  className: "metakyc-searchable-select-search w-full",
@@ -3049,9 +3049,9 @@ const ct = 280, Cr = ({
3049
3049
  padding: "6px 8px",
3050
3050
  fontSize: "13px",
3051
3051
  borderRadius: "6px",
3052
- border: `1px solid ${O}`,
3053
- backgroundColor: W,
3054
- color: $,
3052
+ border: `1px solid ${T}`,
3053
+ backgroundColor: B,
3054
+ color: O,
3055
3055
  outline: "none",
3056
3056
  boxSizing: "border-box"
3057
3057
  }
@@ -3067,20 +3067,20 @@ const ct = 280, Cr = ({
3067
3067
  maxHeight: "208px",
3068
3068
  overflowY: "auto"
3069
3069
  },
3070
- children: N.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: J }, children: "No results" }) : N.map((M) => {
3070
+ children: w.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: G }, children: "No results" }) : w.map((M) => {
3071
3071
  const Z = M.value === l;
3072
3072
  return /* @__PURE__ */ r(
3073
3073
  "li",
3074
3074
  {
3075
3075
  className: "metakyc-searchable-select-option",
3076
- onClick: () => B(M.value, M.disabled),
3076
+ onClick: () => W(M.value, M.disabled),
3077
3077
  style: {
3078
3078
  padding: "8px 12px",
3079
3079
  fontSize: "13px",
3080
3080
  cursor: M.disabled ? "not-allowed" : "pointer",
3081
3081
  opacity: M.disabled ? 0.4 : 1,
3082
3082
  backgroundColor: Z ? U : "transparent",
3083
- color: Z ? S : $,
3083
+ color: Z ? C : O,
3084
3084
  userSelect: "none"
3085
3085
  },
3086
3086
  onMouseEnter: (ie) => {
@@ -3102,8 +3102,8 @@ const ct = 280, Cr = ({
3102
3102
  return /* @__PURE__ */ o(
3103
3103
  "div",
3104
3104
  {
3105
- className: oe("w-full metakyc-searchable-select", p),
3106
- ref: P,
3105
+ className: oe("w-full metakyc-searchable-select", m),
3106
+ ref: F,
3107
3107
  children: [
3108
3108
  e && /* @__PURE__ */ o(
3109
3109
  "label",
@@ -3119,12 +3119,12 @@ const ct = 280, Cr = ({
3119
3119
  /* @__PURE__ */ o(
3120
3120
  "div",
3121
3121
  {
3122
- ref: A,
3122
+ ref: R,
3123
3123
  role: "button",
3124
3124
  tabIndex: u ? -1 : 0,
3125
- onClick: R,
3125
+ onClick: P,
3126
3126
  onKeyDown: (M) => {
3127
- (M.key === "Enter" || M.key === " ") && (M.preventDefault(), R()), M.key === "Escape" && X();
3127
+ (M.key === "Enter" || M.key === " ") && (M.preventDefault(), P()), M.key === "Escape" && X();
3128
3128
  },
3129
3129
  className: oe(
3130
3130
  "metakyc-searchable-select-trigger",
@@ -3135,14 +3135,14 @@ const ct = 280, Cr = ({
3135
3135
  ),
3136
3136
  style: {
3137
3137
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
3138
- color: L ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-secondary, #9ca3af)",
3138
+ color: H ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-secondary, #9ca3af)",
3139
3139
  borderColor: t ? "var(--metakyc-error, #ef4444)" : v ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)",
3140
3140
  minHeight: "42px",
3141
3141
  outline: v ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
3142
3142
  outlineOffset: "-1px"
3143
3143
  },
3144
3144
  children: [
3145
- /* @__PURE__ */ r("span", { className: "truncate flex-1", children: L || s }),
3145
+ /* @__PURE__ */ r("span", { className: "truncate flex-1", children: H || s }),
3146
3146
  /* @__PURE__ */ r(
3147
3147
  "span",
3148
3148
  {
@@ -3154,7 +3154,7 @@ const ct = 280, Cr = ({
3154
3154
  ]
3155
3155
  }
3156
3156
  ),
3157
- typeof document < "u" && ge ? it(ge, document.body) : null,
3157
+ typeof document < "u" && ye ? it(ye, document.body) : null,
3158
3158
  t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
3159
3159
  !t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
3160
3160
  ]
@@ -3172,27 +3172,27 @@ const Ar = ({
3172
3172
  value: c = [],
3173
3173
  className: u
3174
3174
  }) => {
3175
- const [h, p] = w(!1), v = ee(null), I = (A) => {
3176
- if (!A) return;
3177
- const z = Array.from(A);
3178
- if (s && z.filter((F) => F.size > s).length > 0) {
3179
- const F = rt(s);
3180
- alert(`Some files exceed the maximum size of ${F}`);
3175
+ const [h, m] = k(!1), v = ee(null), S = (R) => {
3176
+ if (!R) return;
3177
+ const $ = Array.from(R);
3178
+ if (s && $.filter((L) => L.size > s).length > 0) {
3179
+ const L = rt(s);
3180
+ alert(`Some files exceed the maximum size of ${L}`);
3181
3181
  return;
3182
3182
  }
3183
- l == null || l(a ? [...c, ...z] : [z[0]]);
3184
- }, f = (A) => {
3185
- A.preventDefault(), p(!0);
3186
- }, k = () => {
3187
- p(!1);
3188
- }, x = (A) => {
3189
- A.preventDefault(), p(!1), I(A.dataTransfer.files);
3183
+ l == null || l(a ? [...c, ...$] : [$[0]]);
3184
+ }, f = (R) => {
3185
+ R.preventDefault(), m(!0);
3186
+ }, N = () => {
3187
+ m(!1);
3188
+ }, x = (R) => {
3189
+ R.preventDefault(), m(!1), S(R.dataTransfer.files);
3190
3190
  }, D = () => {
3191
- var A;
3192
- (A = v.current) == null || A.click();
3193
- }, P = (A) => {
3194
- const z = c.filter((E, F) => F !== A);
3195
- l == null || l(z);
3191
+ var R;
3192
+ (R = v.current) == null || R.click();
3193
+ }, F = (R) => {
3194
+ const $ = c.filter((E, L) => L !== R);
3195
+ l == null || l($);
3196
3196
  };
3197
3197
  return /* @__PURE__ */ o("div", { className: oe("w-full", u), children: [
3198
3198
  e && /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: e }),
@@ -3205,7 +3205,7 @@ const Ar = ({
3205
3205
  t && "border-danger-500"
3206
3206
  ),
3207
3207
  onDragOver: f,
3208
- onDragLeave: k,
3208
+ onDragLeave: N,
3209
3209
  onDrop: x,
3210
3210
  onClick: D,
3211
3211
  children: [
@@ -3217,7 +3217,7 @@ const Ar = ({
3217
3217
  className: "hidden",
3218
3218
  accept: n,
3219
3219
  multiple: a,
3220
- onChange: (A) => I(A.target.files)
3220
+ onChange: (R) => S(R.target.files)
3221
3221
  }
3222
3222
  ),
3223
3223
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
@@ -3251,7 +3251,7 @@ const Ar = ({
3251
3251
  ]
3252
3252
  }
3253
3253
  ),
3254
- c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((A, z) => /* @__PURE__ */ o(
3254
+ c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((R, $) => /* @__PURE__ */ o(
3255
3255
  "div",
3256
3256
  {
3257
3257
  className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
@@ -3273,10 +3273,10 @@ const Ar = ({
3273
3273
  )
3274
3274
  }
3275
3275
  ),
3276
- /* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: A.name }),
3276
+ /* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: R.name }),
3277
3277
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
3278
3278
  "(",
3279
- rt(A.size),
3279
+ rt(R.size),
3280
3280
  ")"
3281
3281
  ] })
3282
3282
  ] }),
@@ -3285,7 +3285,7 @@ const Ar = ({
3285
3285
  {
3286
3286
  type: "button",
3287
3287
  onClick: (E) => {
3288
- E.stopPropagation(), P(z);
3288
+ E.stopPropagation(), F($);
3289
3289
  },
3290
3290
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
3291
3291
  children: /* @__PURE__ */ r("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
@@ -3300,7 +3300,7 @@ const Ar = ({
3300
3300
  )
3301
3301
  ]
3302
3302
  },
3303
- z
3303
+ $
3304
3304
  )) }),
3305
3305
  t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t })
3306
3306
  ] });
@@ -3420,7 +3420,7 @@ const Fr = (e) => {
3420
3420
  * This source code is licensed under the ISC license.
3421
3421
  * See the LICENSE file in the root directory of this source tree.
3422
3422
  */
3423
- const Tr = Ge(
3423
+ const Lr = Ge(
3424
3424
  ({
3425
3425
  color: e = "currentColor",
3426
3426
  size: t = 24,
@@ -3444,7 +3444,7 @@ const Tr = Ge(
3444
3444
  ...u
3445
3445
  },
3446
3446
  [
3447
- ...c.map(([p, v]) => nt(p, v)),
3447
+ ...c.map(([m, v]) => nt(m, v)),
3448
3448
  ...Array.isArray(l) ? l : [l]
3449
3449
  ]
3450
3450
  )
@@ -3457,7 +3457,7 @@ const Tr = Ge(
3457
3457
  */
3458
3458
  const ft = (e, t) => {
3459
3459
  const n = Ge(
3460
- ({ className: a, ...s }, l) => nt(Tr, {
3460
+ ({ className: a, ...s }, l) => nt(Lr, {
3461
3461
  ref: l,
3462
3462
  iconNode: t,
3463
3463
  className: yt(
@@ -3476,7 +3476,7 @@ const ft = (e, t) => {
3476
3476
  * This source code is licensed under the ISC license.
3477
3477
  * See the LICENSE file in the root directory of this source tree.
3478
3478
  */
3479
- const Lr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], xt = ft("chevron-left", Lr);
3479
+ const Tr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], xt = ft("chevron-left", Tr);
3480
3480
  /**
3481
3481
  * @license lucide-react v0.574.0 - ISC
3482
3482
  *
@@ -3528,45 +3528,45 @@ const $r = ({
3528
3528
  onComplete: t,
3529
3529
  onBack: n
3530
3530
  }) => {
3531
- const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } = br(e), [p, v] = w({}), [I, f] = w({}), [k, x] = w(0);
3532
- fe.useEffect(() => {
3533
- s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && v(s);
3531
+ const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } = br(e), [m, v] = k({}), [S, f] = k({}), [N, x] = k(0);
3532
+ xe.useEffect(() => {
3533
+ s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && v(s);
3534
3534
  }, [s]);
3535
- const D = Ie(
3535
+ const D = Ee(
3536
3536
  () => a ? Or(a.questionGroups) : [],
3537
3537
  [a]
3538
- ), P = k === D.length - 1, A = D[k] ?? [], z = G((R, N) => {
3539
- v((L) => ({ ...L, [R]: N })), f((L) => {
3540
- const B = { ...L };
3541
- return delete B[R], B;
3538
+ ), F = N === D.length - 1, R = D[N] ?? [], $ = V((P, w) => {
3539
+ v((H) => ({ ...H, [P]: w })), f((H) => {
3540
+ const W = { ...H };
3541
+ return delete W[P], W;
3542
3542
  });
3543
- }, []), E = G(() => {
3544
- const R = {};
3545
- for (const { question: N } of A) {
3546
- const L = Mr(N, p[N.id] ?? []);
3547
- L && (R[N.id] = L);
3543
+ }, []), E = V(() => {
3544
+ const P = {};
3545
+ for (const { question: w } of R) {
3546
+ const H = Mr(w, m[w.id] ?? []);
3547
+ H && (P[w.id] = H);
3548
3548
  }
3549
- return f((N) => ({ ...N, ...R })), Object.keys(R).length === 0;
3550
- }, [A, p]), F = () => {
3551
- E() && x((R) => R + 1);
3552
- }, Q = () => {
3553
- k > 0 ? x((R) => R - 1) : n == null || n();
3549
+ return f((w) => ({ ...w, ...P })), Object.keys(P).length === 0;
3550
+ }, [R, m]), L = () => {
3551
+ E() && x((P) => P + 1);
3552
+ }, Y = () => {
3553
+ N > 0 ? x((P) => P - 1) : n == null || n();
3554
3554
  }, X = async () => {
3555
3555
  if (!(!E() || !a))
3556
3556
  try {
3557
- const R = a.questionGroups.flatMap(
3558
- (L) => (L.questions ?? []).map((B) => ({
3559
- questionId: B.id,
3560
- values: p[B.id] ?? []
3557
+ const P = a.questionGroups.flatMap(
3558
+ (H) => (H.questions ?? []).map((W) => ({
3559
+ questionId: W.id,
3560
+ values: m[W.id] ?? []
3561
3561
  }))
3562
- ), N = {
3562
+ ), w = {
3563
3563
  applicantId: e,
3564
3564
  questionnarieId: a.id,
3565
- questionResults: R
3565
+ questionResults: P
3566
3566
  };
3567
- await h(N), t == null || t();
3568
- } catch (R) {
3569
- console.error("Questionnaire submit error:", R);
3567
+ await h(w), t == null || t();
3568
+ } catch (P) {
3569
+ console.error("Questionnaire submit error:", P);
3570
3570
  }
3571
3571
  };
3572
3572
  return l ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(we, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
@@ -3579,50 +3579,50 @@ const $r = ({
3579
3579
  D.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
3580
3580
  /* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3581
3581
  "Page ",
3582
- k + 1,
3582
+ N + 1,
3583
3583
  " of ",
3584
3584
  D.length
3585
3585
  ] }),
3586
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: D.map((R, N) => /* @__PURE__ */ r(
3586
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: D.map((P, w) => /* @__PURE__ */ r(
3587
3587
  "div",
3588
3588
  {
3589
3589
  className: "rounded-full transition-all duration-200",
3590
3590
  style: {
3591
3591
  height: "6px",
3592
- width: N === k ? "20px" : "6px",
3593
- backgroundColor: N <= k ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3592
+ width: w === N ? "20px" : "6px",
3593
+ backgroundColor: w <= N ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3594
3594
  }
3595
3595
  },
3596
- N
3596
+ w
3597
3597
  )) })
3598
3598
  ] })
3599
3599
  ] }),
3600
- /* @__PURE__ */ r(K, { className: "space-y-6", children: A.map(({ question: R }) => /* @__PURE__ */ r(
3600
+ /* @__PURE__ */ r(K, { className: "space-y-6", children: R.map(({ question: P }) => /* @__PURE__ */ r(
3601
3601
  zr,
3602
3602
  {
3603
- question: R,
3604
- value: p[R.id] ?? [],
3605
- error: I[R.id],
3606
- onChange: (N) => z(R.id, N)
3603
+ question: P,
3604
+ value: m[P.id] ?? [],
3605
+ error: S[P.id],
3606
+ onChange: (w) => $(P.id, w)
3607
3607
  },
3608
- R.id
3608
+ P.id
3609
3609
  )) }),
3610
3610
  /* @__PURE__ */ o(me, { className: "flex items-center justify-between", children: [
3611
3611
  /* @__PURE__ */ o(
3612
- q,
3612
+ Q,
3613
3613
  {
3614
3614
  type: "button",
3615
3615
  variant: "outline",
3616
- onClick: Q,
3616
+ onClick: Y,
3617
3617
  style: { display: "flex", alignItems: "center", gap: "4px" },
3618
3618
  children: [
3619
3619
  /* @__PURE__ */ r(xt, { size: 14 }),
3620
- k > 0 ? "Previous" : "Back"
3620
+ N > 0 ? "Previous" : "Back"
3621
3621
  ]
3622
3622
  }
3623
3623
  ),
3624
- P ? /* @__PURE__ */ r(
3625
- q,
3624
+ F ? /* @__PURE__ */ r(
3625
+ Q,
3626
3626
  {
3627
3627
  type: "button",
3628
3628
  isLoading: c,
@@ -3630,10 +3630,10 @@ const $r = ({
3630
3630
  children: "Continue"
3631
3631
  }
3632
3632
  ) : /* @__PURE__ */ o(
3633
- q,
3633
+ Q,
3634
3634
  {
3635
3635
  type: "button",
3636
- onClick: F,
3636
+ onClick: L,
3637
3637
  style: { display: "flex", alignItems: "center", gap: "4px" },
3638
3638
  children: [
3639
3639
  "Next",
@@ -3724,7 +3724,7 @@ const $r = ({
3724
3724
  type: "checkbox",
3725
3725
  checked: t.includes(u),
3726
3726
  onChange: (h) => {
3727
- h.target.checked ? a([...t, u]) : a(t.filter((p) => p !== u));
3727
+ h.target.checked ? a([...t, u]) : a(t.filter((m) => m !== u));
3728
3728
  },
3729
3729
  className: "metakyc-option-input",
3730
3730
  style: {
@@ -3756,27 +3756,27 @@ const $r = ({
3756
3756
  onComplete: t,
3757
3757
  onBack: n
3758
3758
  }) => {
3759
- const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = vr(e), [h, p] = w({}), v = async (I) => {
3760
- if (I.preventDefault(), !a) return;
3759
+ const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = vr(e), [h, m] = k({}), v = async (S) => {
3760
+ if (S.preventDefault(), !a) return;
3761
3761
  const f = await Promise.all(
3762
3762
  a.uploadDocumentFiles.map(async (x) => {
3763
- const D = h[x.id] || [], P = await Promise.all(
3764
- D.map(async (A) => ({
3765
- fileName: A.name,
3766
- fileData: await mr(A)
3763
+ const D = h[x.id] || [], F = await Promise.all(
3764
+ D.map(async (R) => ({
3765
+ fileName: R.name,
3766
+ fileData: await mr(R)
3767
3767
  }))
3768
3768
  );
3769
3769
  return {
3770
3770
  uploadDocumentFileId: x.id,
3771
- valueList: P
3771
+ valueList: F
3772
3772
  };
3773
3773
  })
3774
- ), k = {
3774
+ ), N = {
3775
3775
  applicantId: e,
3776
3776
  uploadDocumentId: a.id,
3777
3777
  uploadDocumentResults: f
3778
3778
  };
3779
- await u(k), t == null || t();
3779
+ await u(N), t == null || t();
3780
3780
  };
3781
3781
  return s ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(we, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3782
3782
  "Error loading document requirements: ",
@@ -3786,23 +3786,23 @@ const $r = ({
3786
3786
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
3787
3787
  a.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3788
3788
  ] }),
3789
- /* @__PURE__ */ r(K, { className: "space-y-6", children: a.uploadDocumentFiles.map((I) => /* @__PURE__ */ r(
3789
+ /* @__PURE__ */ r(K, { className: "space-y-6", children: a.uploadDocumentFiles.map((S) => /* @__PURE__ */ r(
3790
3790
  Ar,
3791
3791
  {
3792
- label: I.displayName,
3793
- accept: I.allowedTypes,
3794
- multiple: I.multipleFile,
3795
- maxSize: I.maxEachFileSizeByte,
3796
- value: h[I.id] || [],
3792
+ label: S.displayName,
3793
+ accept: S.allowedTypes,
3794
+ multiple: S.multipleFile,
3795
+ maxSize: S.maxEachFileSizeByte,
3796
+ value: h[S.id] || [],
3797
3797
  onChange: (f) => {
3798
- p((k) => ({ ...k, [I.id]: f }));
3798
+ m((N) => ({ ...N, [S.id]: f }));
3799
3799
  }
3800
3800
  },
3801
- I.id
3801
+ S.id
3802
3802
  )) }),
3803
3803
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
3804
- n && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3805
- /* @__PURE__ */ r(q, { type: "submit", isLoading: l, children: "Continue" })
3804
+ n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3805
+ /* @__PURE__ */ r(Q, { type: "submit", isLoading: l, children: "Continue" })
3806
3806
  ] })
3807
3807
  ] }) }) : null;
3808
3808
  }, _r = ({ applicantId: e, onComplete: t, onBack: n }) => {
@@ -3817,8 +3817,8 @@ const $r = ({
3817
3817
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
3818
3818
  a.description && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
3819
3819
  ] }),
3820
- /* @__PURE__ */ r(K, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((p, v) => p.order - v.order).map((p) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
3821
- /* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: p.order + 1 }) }),
3820
+ /* @__PURE__ */ r(K, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((m, v) => m.order - v.order).map((m) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
3821
+ /* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: m.order + 1 }) }),
3822
3822
  /* @__PURE__ */ o(
3823
3823
  "div",
3824
3824
  {
@@ -3830,19 +3830,40 @@ const $r = ({
3830
3830
  background: "transparent"
3831
3831
  },
3832
3832
  children: [
3833
- /* @__PURE__ */ r("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children: p.title }),
3834
- p.description && /* @__PURE__ */ r("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400", children: p.description })
3833
+ /* @__PURE__ */ r("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children: m.title }),
3834
+ m.description && /* @__PURE__ */ r("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400", children: m.description })
3835
3835
  ]
3836
3836
  }
3837
3837
  )
3838
- ] }, p.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
3838
+ ] }, m.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
3839
3839
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
3840
- n && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3841
- /* @__PURE__ */ r(q, { onClick: h, isLoading: l, children: "Continue" })
3840
+ n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3841
+ /* @__PURE__ */ r(Q, { onClick: h, isLoading: l, children: "Continue" })
3842
3842
  ] })
3843
3843
  ] }) : null;
3844
3844
  };
3845
- function Hr(e, t) {
3845
+ function Hr(e) {
3846
+ const t = (e ?? "en").toLowerCase().replace("_", "-");
3847
+ try {
3848
+ return Intl.NumberFormat.supportedLocalesOf([t]), t;
3849
+ } catch {
3850
+ return "en";
3851
+ }
3852
+ }
3853
+ function Ur(e) {
3854
+ return e.valueDataType === Se.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
3855
+ }
3856
+ function jr(e, t) {
3857
+ const n = new Intl.NumberFormat(Hr(t), {
3858
+ minimumFractionDigits: 0,
3859
+ maximumFractionDigits: 2
3860
+ });
3861
+ return e.replace(/([\d]+(?:\.\d+)?)/g, (a) => {
3862
+ const s = parseFloat(a);
3863
+ return isNaN(s) ? a : n.format(s);
3864
+ });
3865
+ }
3866
+ function Kr(e, t) {
3846
3867
  const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
3847
3868
  if (e.isRequired && n)
3848
3869
  return e.errorMessage || `${e.displayName} is required`;
@@ -3854,7 +3875,7 @@ function Hr(e, t) {
3854
3875
  return e.errorMessage || "Invalid format";
3855
3876
  } catch {
3856
3877
  }
3857
- const s = e.valueDataType === Ee.Integer || e.valueDataType === Ee.Decimal || e.valueDataType === Ee.DigitOnly;
3878
+ const s = e.valueDataType === Se.Integer || e.valueDataType === Se.Money || e.valueDataType === Se.DigitOnly;
3858
3879
  if (s && a.trim() !== "") {
3859
3880
  const l = Number(a);
3860
3881
  if (!isNaN(l)) {
@@ -3872,123 +3893,124 @@ function Hr(e, t) {
3872
3893
  }
3873
3894
  return null;
3874
3895
  }
3875
- function Ur(e) {
3896
+ function Wr(e) {
3876
3897
  const t = /* @__PURE__ */ new Map();
3877
3898
  return e.forEach((n, a) => {
3878
3899
  const s = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
3879
3900
  t.has(s) || t.set(s, []), t.get(s).push({ criterion: n, idx: a });
3880
3901
  }), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
3881
3902
  }
3882
- function jr(e) {
3903
+ function Yr(e) {
3883
3904
  return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
3884
3905
  }
3885
- const Kr = ({
3906
+ const qr = ({
3886
3907
  applicantId: e,
3887
3908
  onComplete: t,
3888
3909
  onBack: n
3889
3910
  }) => {
3890
- const { criteria: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } = Nr(e), [p, v] = w({}), [I, f] = w({}), [k, x] = w(0), [D, P] = w(!1);
3891
- fe.useEffect(() => {
3892
- s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && v(s);
3893
- }, [s]);
3894
- const A = Ie(
3895
- () => a && a.length > 0 ? Ur(a) : [],
3896
- [a]
3897
- ), z = k === A.length - 1, E = A[k] ?? [];
3898
- fe.useEffect(() => {
3899
- !l && a && a.length === 0 && !D && !c && (P(!0), h({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3900
- }, [l, a, D, c, h, e, t]);
3901
- const F = G((L, B) => {
3902
- v((T) => ({ ...T, [L]: B })), f((T) => {
3903
- const W = { ...T };
3904
- return delete W[L], W;
3911
+ const { config: a } = ge(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit: v } = Nr(e), [S, f] = k({}), [N, x] = k({}), [D, F] = k(0), [R, $] = k(!1);
3912
+ xe.useEffect(() => {
3913
+ c && Object.keys(c).length > 0 && Object.keys(S).length === 0 && f(c);
3914
+ }, [c]);
3915
+ const E = Ee(
3916
+ () => l && l.length > 0 ? Wr(l) : [],
3917
+ [l]
3918
+ ), L = D === E.length - 1, Y = E[D] ?? [];
3919
+ xe.useEffect(() => {
3920
+ !u && l && l.length === 0 && !R && !h && ($(!0), v({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3921
+ }, [u, l, R, h, v, e, t]);
3922
+ const X = V((I, B) => {
3923
+ f((T) => ({ ...T, [I]: B })), x((T) => {
3924
+ const O = { ...T };
3925
+ return delete O[I], O;
3905
3926
  });
3906
- }, []), Q = G(() => {
3907
- const L = {};
3908
- for (const { criterion: B } of E) {
3909
- const T = Hr(B, p[B.id] ?? []);
3910
- T && (L[B.id] = T);
3927
+ }, []), P = V(() => {
3928
+ const I = {};
3929
+ for (const { criterion: B } of Y) {
3930
+ const T = Kr(B, S[B.id] ?? []);
3931
+ T && (I[B.id] = T);
3911
3932
  }
3912
- return f((B) => ({ ...B, ...L })), Object.keys(L).length === 0;
3913
- }, [E, p]), X = () => {
3914
- Q() && x((L) => L + 1);
3915
- }, R = () => {
3916
- k > 0 ? x((L) => L - 1) : n == null || n();
3917
- }, N = async () => {
3918
- if (!(!Q() || !a))
3933
+ return x((B) => ({ ...B, ...I })), Object.keys(I).length === 0;
3934
+ }, [Y, S]), w = () => {
3935
+ P() && F((I) => I + 1);
3936
+ }, H = () => {
3937
+ D > 0 ? F((I) => I - 1) : n == null || n();
3938
+ }, W = async () => {
3939
+ if (!(!P() || !l))
3919
3940
  try {
3920
- const L = a.map((T) => {
3921
- const W = (p[T.id] ?? []).filter((O) => O && O.trim());
3922
- return W.length > 0 ? { riskCriteriaId: T.id, values: W } : null;
3941
+ const I = l.map((T) => {
3942
+ const O = (S[T.id] ?? []).filter((G) => G && G.trim());
3943
+ return O.length > 0 ? { riskCriteriaId: T.id, values: O } : null;
3923
3944
  }).filter((T) => T !== null);
3924
- await h({ applicantId: e, criteriaValueInputs: L }), t == null || t();
3925
- } catch (L) {
3926
- console.error("Risk scoring submit error:", L);
3945
+ await v({ applicantId: e, criteriaValueInputs: I }), t == null || t();
3946
+ } catch (I) {
3947
+ console.error("Risk scoring submit error:", I);
3927
3948
  }
3928
3949
  };
3929
- return l ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
3950
+ return u ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
3930
3951
  /* @__PURE__ */ r(we, { className: "my-8" }),
3931
3952
  /* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
3932
- ] }) }) : !l && a && a.length === 0 ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
3953
+ ] }) }) : !u && l && l.length === 0 ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
3933
3954
  /* @__PURE__ */ r(we, { className: "my-8" }),
3934
3955
  /* @__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…" })
3935
- ] }) }) : u ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3956
+ ] }) }) : m ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3936
3957
  "Error loading criteria: ",
3937
- u.message
3938
- ] }) }) }) : a ? /* @__PURE__ */ o(j, { children: [
3958
+ m.message
3959
+ ] }) }) }) : l ? /* @__PURE__ */ o(j, { children: [
3939
3960
  /* @__PURE__ */ o(ue, { children: [
3940
3961
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
3941
3962
  /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
3942
- A.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
3963
+ E.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
3943
3964
  /* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3944
3965
  "Page ",
3945
- k + 1,
3966
+ D + 1,
3946
3967
  " of ",
3947
- A.length
3968
+ E.length
3948
3969
  ] }),
3949
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: A.map((L, B) => /* @__PURE__ */ r(
3970
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: E.map((I, B) => /* @__PURE__ */ r(
3950
3971
  "div",
3951
3972
  {
3952
3973
  className: "rounded-full transition-all duration-200",
3953
3974
  style: {
3954
3975
  height: "6px",
3955
- width: B === k ? "20px" : "6px",
3956
- backgroundColor: B <= k ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3976
+ width: B === D ? "20px" : "6px",
3977
+ backgroundColor: B <= D ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3957
3978
  }
3958
3979
  },
3959
3980
  B
3960
3981
  )) })
3961
3982
  ] })
3962
3983
  ] }),
3963
- /* @__PURE__ */ r(K, { className: "space-y-6", children: E.map(({ criterion: L }) => /* @__PURE__ */ r(
3964
- Wr,
3984
+ /* @__PURE__ */ r(K, { className: "space-y-6", children: Y.map(({ criterion: I }) => /* @__PURE__ */ r(
3985
+ Qr,
3965
3986
  {
3966
- criterion: L,
3967
- value: p[L.id] ?? [],
3968
- error: I[L.id],
3969
- onChange: (B) => F(L.id, B)
3987
+ criterion: I,
3988
+ value: S[I.id] ?? [],
3989
+ error: N[I.id],
3990
+ locale: s,
3991
+ onChange: (B) => X(I.id, B)
3970
3992
  },
3971
- L.id
3993
+ I.id
3972
3994
  )) }),
3973
3995
  /* @__PURE__ */ o(me, { className: "flex items-center justify-between", children: [
3974
3996
  /* @__PURE__ */ o(
3975
- q,
3997
+ Q,
3976
3998
  {
3977
3999
  type: "button",
3978
4000
  variant: "outline",
3979
- onClick: R,
4001
+ onClick: H,
3980
4002
  style: { display: "flex", alignItems: "center", gap: "4px" },
3981
4003
  children: [
3982
4004
  /* @__PURE__ */ r(xt, { size: 14 }),
3983
- k > 0 ? "Previous" : "Back"
4005
+ D > 0 ? "Previous" : "Back"
3984
4006
  ]
3985
4007
  }
3986
4008
  ),
3987
- z ? /* @__PURE__ */ r(q, { type: "button", isLoading: c, onClick: N, children: "Continue" }) : /* @__PURE__ */ o(
3988
- q,
4009
+ L ? /* @__PURE__ */ r(Q, { type: "button", isLoading: h, onClick: W, children: "Continue" }) : /* @__PURE__ */ o(
4010
+ Q,
3989
4011
  {
3990
4012
  type: "button",
3991
- onClick: X,
4013
+ onClick: w,
3992
4014
  style: { display: "flex", alignItems: "center", gap: "4px" },
3993
4015
  children: [
3994
4016
  "Next",
@@ -3997,35 +4019,35 @@ const Kr = ({
3997
4019
  }
3998
4020
  )
3999
4021
  ] }),
4000
- 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 }) })
4022
+ m && /* @__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: m.message }) })
4001
4023
  ] }) : null;
4002
- }, Wr = ({ criterion: e, value: t, error: n, onChange: a }) => {
4003
- const s = jr(e), l = e.valueDataType === Ee.Integer || e.valueDataType === Ee.Decimal || e.valueDataType === Ee.DigitOnly;
4024
+ }, Qr = ({ criterion: e, value: t, error: n, locale: a, onChange: s }) => {
4025
+ const l = Yr(e), c = e.valueDataType === Se.Integer || e.valueDataType === Se.Money || e.valueDataType === Se.DigitOnly, u = Ur(e), h = (m) => u ? jr(m, a) : m;
4004
4026
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
4005
4027
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
4006
4028
  e.displayName,
4007
4029
  e.isRequired && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
4008
4030
  ] }),
4009
4031
  e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
4010
- l && (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}` }),
4011
- s === "text" && /* @__PURE__ */ r(
4032
+ 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}` }),
4033
+ l === "text" && /* @__PURE__ */ r(
4012
4034
  de,
4013
4035
  {
4014
4036
  value: t[0] ?? "",
4015
- onChange: (c) => a([c.target.value]),
4016
- type: l ? "number" : "text",
4037
+ onChange: (m) => s([m.target.value]),
4038
+ type: c ? "number" : "text",
4017
4039
  placeholder: "Enter your answer…",
4018
4040
  error: n,
4019
4041
  required: e.isRequired,
4020
4042
  min: e.min,
4021
4043
  max: e.max,
4022
- onKeyDown: (c) => {
4023
- e.valueDataType === Ee.DigitOnly && ["e", "E", "+", "-", "."].includes(c.key) && c.preventDefault();
4044
+ onKeyDown: (m) => {
4045
+ e.valueDataType === Se.DigitOnly && ["e", "E", "+", "-", "."].includes(m.key) && m.preventDefault();
4024
4046
  }
4025
4047
  }
4026
4048
  ),
4027
- s === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4028
- (e.defaultValues ?? []).map((c) => /* @__PURE__ */ o(
4049
+ l === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4050
+ (e.defaultValues ?? []).map((m) => /* @__PURE__ */ o(
4029
4051
  "label",
4030
4052
  {
4031
4053
  className: "metakyc-option-label",
@@ -4035,8 +4057,8 @@ const Kr = ({
4035
4057
  "input",
4036
4058
  {
4037
4059
  type: "radio",
4038
- checked: t[0] === c,
4039
- onChange: () => a([c]),
4060
+ checked: t[0] === m,
4061
+ onChange: () => s([m]),
4040
4062
  className: "metakyc-option-input",
4041
4063
  style: {
4042
4064
  width: "16px",
@@ -4053,15 +4075,15 @@ const Kr = ({
4053
4075
  }
4054
4076
  }
4055
4077
  ),
4056
- /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: c })
4078
+ /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: h(m) })
4057
4079
  ]
4058
4080
  },
4059
- c
4081
+ m
4060
4082
  )),
4061
4083
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4062
4084
  ] }),
4063
- s === "checkbox" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4064
- (e.defaultValues ?? []).map((c) => /* @__PURE__ */ o(
4085
+ l === "checkbox" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4086
+ (e.defaultValues ?? []).map((m) => /* @__PURE__ */ o(
4065
4087
  "label",
4066
4088
  {
4067
4089
  className: "metakyc-option-label",
@@ -4071,9 +4093,9 @@ const Kr = ({
4071
4093
  "input",
4072
4094
  {
4073
4095
  type: "checkbox",
4074
- checked: t.includes(c),
4075
- onChange: (u) => {
4076
- u.target.checked ? a([...t, c]) : a(t.filter((h) => h !== c));
4096
+ checked: t.includes(m),
4097
+ onChange: (v) => {
4098
+ v.target.checked ? s([...t, m]) : s(t.filter((S) => S !== m));
4077
4099
  },
4078
4100
  className: "metakyc-option-input",
4079
4101
  style: {
@@ -4091,18 +4113,18 @@ const Kr = ({
4091
4113
  }
4092
4114
  }
4093
4115
  ),
4094
- /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: c })
4116
+ /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: h(m) })
4095
4117
  ]
4096
4118
  },
4097
- c
4119
+ m
4098
4120
  )),
4099
4121
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4100
4122
  ] }),
4101
- s === "country" && /* @__PURE__ */ r(
4123
+ l === "country" && /* @__PURE__ */ r(
4102
4124
  st,
4103
4125
  {
4104
4126
  value: t[0] ?? "",
4105
- onChange: (c) => a([c.target.value]),
4127
+ onChange: (m) => s([m.target.value]),
4106
4128
  options: [
4107
4129
  { value: "US", label: "United States" },
4108
4130
  { value: "GB", label: "United Kingdom" },
@@ -4116,28 +4138,28 @@ const Kr = ({
4116
4138
  }
4117
4139
  )
4118
4140
  ] });
4119
- }, Yr = ({
4141
+ }, Gr = ({
4120
4142
  applicantId: e,
4121
4143
  onComplete: t,
4122
4144
  onBack: n
4123
4145
  }) => {
4124
- const { investorCategorizationService: a } = xe(), [s, l] = w(null), [c, u] = w(!1), [h, p] = w(null);
4125
- return /* @__PURE__ */ r("form", { onSubmit: async (I) => {
4126
- if (I.preventDefault(), s === null) {
4127
- p("Please select an investor type");
4146
+ const { investorCategorizationService: a } = ge(), [s, l] = k(null), [c, u] = k(!1), [h, m] = k(null);
4147
+ return /* @__PURE__ */ r("form", { onSubmit: async (S) => {
4148
+ if (S.preventDefault(), s === null) {
4149
+ m("Please select an investor type");
4128
4150
  return;
4129
4151
  }
4130
- u(!0), p(null);
4152
+ u(!0), m(null);
4131
4153
  try {
4132
4154
  const f = {
4133
4155
  applicantId: e,
4134
4156
  investorType: s
4135
4157
  };
4136
4158
  console.log("Submitting investor categorization:", f);
4137
- const k = await a.setInvestorCategorization(f);
4138
- console.log("Investor categorization result:", k), t == null || t();
4159
+ const N = await a.setInvestorCategorization(f);
4160
+ console.log("Investor categorization result:", N), t == null || t();
4139
4161
  } catch (f) {
4140
- console.error("Error submitting investor categorization:", f), p(f.message || "Failed to submit investor categorization");
4162
+ console.error("Error submitting investor categorization:", f), m(f.message || "Failed to submit investor categorization");
4141
4163
  } finally {
4142
4164
  u(!1);
4143
4165
  }
@@ -4153,7 +4175,7 @@ const Kr = ({
4153
4175
  {
4154
4176
  className: `
4155
4177
  block p-4 border-2 rounded-lg cursor-pointer transition-all
4156
- ${s === ye.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4178
+ ${s === fe.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4157
4179
  `,
4158
4180
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4159
4181
  /* @__PURE__ */ r(
@@ -4161,9 +4183,9 @@ const Kr = ({
4161
4183
  {
4162
4184
  type: "radio",
4163
4185
  name: "investorType",
4164
- value: ye.Individual,
4165
- checked: s === ye.Individual,
4166
- onChange: () => l(ye.Individual),
4186
+ value: fe.Individual,
4187
+ checked: s === fe.Individual,
4188
+ onChange: () => l(fe.Individual),
4167
4189
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
4168
4190
  }
4169
4191
  ),
@@ -4179,7 +4201,7 @@ const Kr = ({
4179
4201
  {
4180
4202
  className: `
4181
4203
  block p-4 border-2 rounded-lg cursor-pointer transition-all
4182
- ${s === ye.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4204
+ ${s === fe.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4183
4205
  `,
4184
4206
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4185
4207
  /* @__PURE__ */ r(
@@ -4187,9 +4209,9 @@ const Kr = ({
4187
4209
  {
4188
4210
  type: "radio",
4189
4211
  name: "investorType",
4190
- value: ye.Sophisticated,
4191
- checked: s === ye.Sophisticated,
4192
- onChange: () => l(ye.Sophisticated),
4212
+ value: fe.Sophisticated,
4213
+ checked: s === fe.Sophisticated,
4214
+ onChange: () => l(fe.Sophisticated),
4193
4215
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
4194
4216
  }
4195
4217
  ),
@@ -4210,7 +4232,7 @@ const Kr = ({
4210
4232
  {
4211
4233
  className: `
4212
4234
  block p-4 border-2 rounded-lg cursor-pointer transition-all
4213
- ${s === ye.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4235
+ ${s === fe.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4214
4236
  `,
4215
4237
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4216
4238
  /* @__PURE__ */ r(
@@ -4218,9 +4240,9 @@ const Kr = ({
4218
4240
  {
4219
4241
  type: "radio",
4220
4242
  name: "investorType",
4221
- value: ye.HighNetWorth,
4222
- checked: s === ye.HighNetWorth,
4223
- onChange: () => l(ye.HighNetWorth),
4243
+ value: fe.HighNetWorth,
4244
+ checked: s === fe.HighNetWorth,
4245
+ onChange: () => l(fe.HighNetWorth),
4224
4246
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
4225
4247
  }
4226
4248
  ),
@@ -4242,9 +4264,9 @@ const Kr = ({
4242
4264
  ] }) })
4243
4265
  ] }),
4244
4266
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
4245
- n && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4267
+ n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4246
4268
  /* @__PURE__ */ r(
4247
- q,
4269
+ Q,
4248
4270
  {
4249
4271
  type: "submit",
4250
4272
  isLoading: c,
@@ -4254,109 +4276,109 @@ const Kr = ({
4254
4276
  )
4255
4277
  ] })
4256
4278
  ] }) });
4257
- }, qr = ({
4279
+ }, Vr = ({
4258
4280
  applicantId: e,
4259
4281
  onComplete: t,
4260
4282
  onBack: n
4261
4283
  }) => {
4262
- const { appropriatenessTestService: a } = xe(), [s, l] = w(null), [c, u] = w(!0), [h, p] = w(!1), [v, I] = w(null), [f, k] = w({}), [x, D] = w(0), [P, A] = w(!1), [z, E] = w(!1), [F, Q] = w(0);
4284
+ const { appropriatenessTestService: a } = ge(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [v, S] = k(null), [f, N] = k({}), [x, D] = k(0), [F, R] = k(!1), [$, E] = k(!1), [L, Y] = k(0);
4263
4285
  ne(() => {
4264
4286
  (async () => {
4265
4287
  try {
4266
- u(!0), I(null), console.log("Loading appropriateness test for applicant:", e);
4267
- const $ = await a.getAppropriatenessTest(e);
4268
- if (console.log("Appropriateness test data:", $), l($), $.waitTimeSpanForNextTry && $.waitTimeSpanForNextTry !== "00:00:00") {
4269
- const J = X($.waitTimeSpanForNextTry);
4270
- J > 0 && Q(J);
4288
+ u(!0), S(null), console.log("Loading appropriateness test for applicant:", e);
4289
+ const O = await a.getAppropriatenessTest(e);
4290
+ if (console.log("Appropriateness test data:", O), l(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
4291
+ const G = X(O.waitTimeSpanForNextTry);
4292
+ G > 0 && Y(G);
4271
4293
  }
4272
- } catch ($) {
4273
- console.error("Error loading appropriateness test:", $), I($.message || "Failed to load appropriateness test");
4294
+ } catch (O) {
4295
+ console.error("Error loading appropriateness test:", O), S(O.message || "Failed to load appropriateness test");
4274
4296
  } finally {
4275
4297
  u(!1);
4276
4298
  }
4277
4299
  })();
4278
4300
  }, [e, a]);
4279
- const X = (O) => {
4280
- const $ = O.split(":").map(Number);
4281
- if ($.length === 3) {
4282
- const [J, S, U] = $;
4283
- return J * 3600 + S * 60 + U;
4301
+ const X = (T) => {
4302
+ const O = T.split(":").map(Number);
4303
+ if (O.length === 3) {
4304
+ const [G, C, U] = O;
4305
+ return G * 3600 + C * 60 + U;
4284
4306
  }
4285
4307
  return 0;
4286
- }, R = (O) => {
4287
- const $ = Math.floor(O / 60), J = O % 60;
4288
- return `${$.toString().padStart(2, "0")}:${J.toString().padStart(2, "0")}`;
4308
+ }, P = (T) => {
4309
+ const O = Math.floor(T / 60), G = T % 60;
4310
+ return `${O.toString().padStart(2, "0")}:${G.toString().padStart(2, "0")}`;
4289
4311
  };
4290
4312
  ne(() => {
4291
- if (!P || x <= 0) return;
4292
- const O = setInterval(() => {
4293
- D(($) => $ <= 1 ? (E(!0), 0) : $ - 1);
4313
+ if (!F || x <= 0) return;
4314
+ const T = setInterval(() => {
4315
+ D((O) => O <= 1 ? (E(!0), 0) : O - 1);
4294
4316
  }, 1e3);
4295
- return () => clearInterval(O);
4296
- }, [P, x]), ne(() => {
4297
- if (F <= 0) return;
4298
- const O = setInterval(() => {
4299
- Q(($) => $ <= 1 ? 0 : $ - 1);
4317
+ return () => clearInterval(T);
4318
+ }, [F, x]), ne(() => {
4319
+ if (L <= 0) return;
4320
+ const T = setInterval(() => {
4321
+ Y((O) => O <= 1 ? 0 : O - 1);
4300
4322
  }, 1e3);
4301
- return () => clearInterval(O);
4302
- }, [F]), ne(() => {
4303
- z && !h && B();
4304
- }, [z]);
4305
- const N = () => {
4306
- s && (A(!0), D(s.testDurationSec));
4307
- }, L = (O, $) => {
4308
- k((J) => ({
4309
- ...J,
4310
- [O]: $
4323
+ return () => clearInterval(T);
4324
+ }, [L]), ne(() => {
4325
+ $ && !h && W();
4326
+ }, [$]);
4327
+ const w = () => {
4328
+ s && (R(!0), D(s.testDurationSec));
4329
+ }, H = (T, O) => {
4330
+ N((G) => ({
4331
+ ...G,
4332
+ [T]: O
4311
4333
  }));
4312
- }, B = async (O) => {
4313
- if (O && O.preventDefault(), !!s) {
4314
- if (!z) {
4315
- const $ = s.appropriatenessQuestions.length - Object.keys(f).length;
4316
- if ($ > 0) {
4317
- I(`Please answer all questions. ${$} question(s) remaining.`);
4334
+ }, W = async (T) => {
4335
+ if (T && T.preventDefault(), !!s) {
4336
+ if (!$) {
4337
+ const O = s.appropriatenessQuestions.length - Object.keys(f).length;
4338
+ if (O > 0) {
4339
+ S(`Please answer all questions. ${O} question(s) remaining.`);
4318
4340
  return;
4319
4341
  }
4320
4342
  }
4321
- p(!0), I(null);
4343
+ m(!0), S(null);
4322
4344
  try {
4323
- const $ = s.appropriatenessQuestions.map(
4324
- (S) => ({
4325
- appropriatenessQuestionId: S.id,
4326
- value: f[S.id] || ""
4345
+ const O = s.appropriatenessQuestions.map(
4346
+ (C) => ({
4347
+ appropriatenessQuestionId: C.id,
4348
+ value: f[C.id] || ""
4327
4349
  // Empty string if not answered
4328
4350
  })
4329
- ), J = {
4351
+ ), G = {
4330
4352
  applicantId: e,
4331
4353
  appropriatenessTestId: s.id,
4332
- appropriatenessQuestionResults: $
4354
+ appropriatenessQuestionResults: O
4333
4355
  };
4334
- console.log("Submitting appropriateness test:", J);
4356
+ console.log("Submitting appropriateness test:", G);
4335
4357
  try {
4336
- const S = await a.fillAppropriatenessTest(J);
4337
- console.log("Appropriateness test result:", S), S.message && (S.message.toLowerCase().includes("pass") || S.message.toLowerCase().includes("success") || S.message.toLowerCase().includes("congratulations")) ? t == null || t() : (I(S.message || "Test completed. Please check the result."), A(!1), E(!1), k({}), setTimeout(() => T(), 1e3));
4338
- } catch (S) {
4339
- if (S.code === 400 && S.message) {
4340
- const U = S.message;
4341
- console.log("Test failed:", U), I(U), A(!1), E(!1), k({}), setTimeout(() => T(), 1500);
4358
+ const C = await a.fillAppropriatenessTest(G);
4359
+ console.log("Appropriateness test result:", C), C.message && (C.message.toLowerCase().includes("pass") || C.message.toLowerCase().includes("success") || C.message.toLowerCase().includes("congratulations")) ? t == null || t() : (S(C.message || "Test completed. Please check the result."), R(!1), E(!1), N({}), setTimeout(() => I(), 1e3));
4360
+ } catch (C) {
4361
+ if (C.code === 400 && C.message) {
4362
+ const U = C.message;
4363
+ console.log("Test failed:", U), S(U), R(!1), E(!1), N({}), setTimeout(() => I(), 1500);
4342
4364
  } else
4343
- throw S;
4365
+ throw C;
4344
4366
  }
4345
- } catch ($) {
4346
- console.error("Error submitting appropriateness test:", $), I($.message || "Failed to submit test. Please try again."), A(!1), E(!1), k({});
4367
+ } catch (O) {
4368
+ console.error("Error submitting appropriateness test:", O), S(O.message || "Failed to submit test. Please try again."), R(!1), E(!1), N({});
4347
4369
  } finally {
4348
- p(!1);
4370
+ m(!1);
4349
4371
  }
4350
4372
  }
4351
- }, T = async () => {
4373
+ }, I = async () => {
4352
4374
  try {
4353
- const O = await a.getAppropriatenessTest(e);
4354
- if (console.log("Reloaded test data:", O), l(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
4355
- const $ = X(O.waitTimeSpanForNextTry);
4356
- $ > 0 && Q($);
4375
+ const T = await a.getAppropriatenessTest(e);
4376
+ if (console.log("Reloaded test data:", T), l(T), T.waitTimeSpanForNextTry && T.waitTimeSpanForNextTry !== "00:00:00") {
4377
+ const O = X(T.waitTimeSpanForNextTry);
4378
+ O > 0 && Y(O);
4357
4379
  }
4358
- } catch (O) {
4359
- console.error("Error reloading test data:", O), I(($) => $ + `
4380
+ } catch (T) {
4381
+ console.error("Error reloading test data:", T), S((O) => O + `
4360
4382
 
4361
4383
  Failed to reload test data. Please refresh the page.`);
4362
4384
  }
@@ -4371,7 +4393,7 @@ Failed to reload test data. Please refresh the page.`);
4371
4393
  /* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
4372
4394
  v && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: v })
4373
4395
  ] }) });
4374
- if (F > 0)
4396
+ if (L > 0)
4375
4397
  return /* @__PURE__ */ o(j, { children: [
4376
4398
  /* @__PURE__ */ o(ue, { children: [
4377
4399
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
@@ -4379,14 +4401,14 @@ Failed to reload test data. Please refresh the page.`);
4379
4401
  ] }),
4380
4402
  /* @__PURE__ */ o(K, { className: "py-12 text-center", children: [
4381
4403
  /* @__PURE__ */ o("div", { className: "mb-6", children: [
4382
- /* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: R(F) }),
4404
+ /* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: P(L) }),
4383
4405
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
4384
4406
  ] }),
4385
4407
  v && /* @__PURE__ */ r("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400 text-sm", children: v }) })
4386
4408
  ] })
4387
4409
  ] });
4388
- const W = s.testAllowedMaxTry - s.totalFailedTries;
4389
- return P ? /* @__PURE__ */ r("form", { onSubmit: B, children: /* @__PURE__ */ o(j, { children: [
4410
+ const B = s.testAllowedMaxTry - s.totalFailedTries;
4411
+ return F ? /* @__PURE__ */ r("form", { onSubmit: W, children: /* @__PURE__ */ o(j, { children: [
4390
4412
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4391
4413
  /* @__PURE__ */ o("div", { children: [
4392
4414
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
@@ -4397,7 +4419,7 @@ Failed to reload test data. Please refresh the page.`);
4397
4419
  "div",
4398
4420
  {
4399
4421
  className: `text-3xl font-bold ${x <= 60 ? "text-danger-500" : "text-primary-500"}`,
4400
- children: R(x)
4422
+ children: P(x)
4401
4423
  }
4402
4424
  ),
4403
4425
  /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
@@ -4405,20 +4427,20 @@ Failed to reload test data. Please refresh the page.`);
4405
4427
  ] }) }),
4406
4428
  /* @__PURE__ */ o(K, { className: "space-y-6", children: [
4407
4429
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
4408
- /* @__PURE__ */ o(Ae, { variant: "info", children: [
4430
+ /* @__PURE__ */ o(Ie, { variant: "info", children: [
4409
4431
  "Question ",
4410
4432
  Object.keys(f).length,
4411
4433
  " of ",
4412
4434
  s.totalQuestionCount
4413
4435
  ] }),
4414
- /* @__PURE__ */ o(Ae, { variant: W > 1 ? "success" : "warning", children: [
4415
- W,
4436
+ /* @__PURE__ */ o(Ie, { variant: B > 1 ? "success" : "warning", children: [
4437
+ B,
4416
4438
  " attempt",
4417
- W !== 1 ? "s" : "",
4439
+ B !== 1 ? "s" : "",
4418
4440
  " remaining"
4419
4441
  ] })
4420
4442
  ] }),
4421
- s.appropriatenessQuestions.map((O, $) => /* @__PURE__ */ o(
4443
+ s.appropriatenessQuestions.map((T, O) => /* @__PURE__ */ o(
4422
4444
  "div",
4423
4445
  {
4424
4446
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -4426,53 +4448,53 @@ Failed to reload test data. Please refresh the page.`);
4426
4448
  /* @__PURE__ */ o("div", { className: "mb-4", children: [
4427
4449
  /* @__PURE__ */ o("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
4428
4450
  "Question ",
4429
- $ + 1
4451
+ O + 1
4430
4452
  ] }),
4431
- O.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: O.groupName }),
4432
- /* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: O.question })
4453
+ T.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: T.groupName }),
4454
+ /* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: T.question })
4433
4455
  ] }),
4434
- /* @__PURE__ */ r("div", { className: "space-y-2", children: O.answers.map((J, S) => /* @__PURE__ */ o(
4456
+ /* @__PURE__ */ r("div", { className: "space-y-2", children: T.answers.map((G, C) => /* @__PURE__ */ o(
4435
4457
  "label",
4436
4458
  {
4437
4459
  className: `
4438
4460
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
4439
- ${f[O.id] === J ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4461
+ ${f[T.id] === G ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4440
4462
  `,
4441
4463
  children: [
4442
4464
  /* @__PURE__ */ r(
4443
4465
  "input",
4444
4466
  {
4445
4467
  type: "radio",
4446
- name: `question-${O.id}`,
4447
- value: J,
4448
- checked: f[O.id] === J,
4449
- onChange: (U) => L(O.id, U.target.value),
4468
+ name: `question-${T.id}`,
4469
+ value: G,
4470
+ checked: f[T.id] === G,
4471
+ onChange: (U) => H(T.id, U.target.value),
4450
4472
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
4451
4473
  disabled: h
4452
4474
  }
4453
4475
  ),
4454
- /* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: J })
4476
+ /* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: G })
4455
4477
  ]
4456
4478
  },
4457
- S
4479
+ C
4458
4480
  )) })
4459
4481
  ]
4460
4482
  },
4461
- O.id
4483
+ T.id
4462
4484
  )),
4463
- v && !z && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4485
+ v && !$ && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4464
4486
  /* @__PURE__ */ r("strong", { children: "Error:" }),
4465
4487
  " ",
4466
4488
  v
4467
4489
  ] }) }),
4468
- z && /* @__PURE__ */ r("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
4490
+ $ && /* @__PURE__ */ r("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
4469
4491
  /* @__PURE__ */ r("strong", { children: "Time's up!" }),
4470
4492
  " Your answers are being submitted automatically."
4471
4493
  ] }) })
4472
4494
  ] }),
4473
4495
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
4474
4496
  /* @__PURE__ */ r(
4475
- q,
4497
+ Q,
4476
4498
  {
4477
4499
  type: "button",
4478
4500
  variant: "outline",
@@ -4482,12 +4504,12 @@ Failed to reload test data. Please refresh the page.`);
4482
4504
  }
4483
4505
  ),
4484
4506
  /* @__PURE__ */ r(
4485
- q,
4507
+ Q,
4486
4508
  {
4487
4509
  type: "submit",
4488
4510
  isLoading: h,
4489
4511
  disabled: Object.keys(f).length < s.totalQuestionCount,
4490
- children: z ? "Submitting..." : "Submit Test"
4512
+ children: $ ? "Submitting..." : "Submit Test"
4491
4513
  }
4492
4514
  )
4493
4515
  ] })
@@ -4501,19 +4523,19 @@ Failed to reload test data. Please refresh the page.`);
4501
4523
  /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
4502
4524
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4503
4525
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
4504
- /* @__PURE__ */ r(Ae, { variant: "info", children: s.totalQuestionCount })
4526
+ /* @__PURE__ */ r(Ie, { variant: "info", children: s.totalQuestionCount })
4505
4527
  ] }),
4506
4528
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4507
4529
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
4508
- /* @__PURE__ */ r(Ae, { variant: "info", children: R(s.testDurationSec) })
4530
+ /* @__PURE__ */ r(Ie, { variant: "info", children: P(s.testDurationSec) })
4509
4531
  ] }),
4510
4532
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4511
4533
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
4512
- /* @__PURE__ */ r(Ae, { variant: "info", children: s.testCorrectAnswerPassLimit })
4534
+ /* @__PURE__ */ r(Ie, { variant: "info", children: s.testCorrectAnswerPassLimit })
4513
4535
  ] }),
4514
4536
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4515
4537
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
4516
- /* @__PURE__ */ r(Ae, { variant: W > 1 ? "success" : "warning", children: W })
4538
+ /* @__PURE__ */ r(Ie, { variant: B > 1 ? "success" : "warning", children: B })
4517
4539
  ] })
4518
4540
  ] }),
4519
4541
  v && /* @__PURE__ */ r("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
@@ -4521,28 +4543,28 @@ Failed to reload test data. Please refresh the page.`);
4521
4543
  " ",
4522
4544
  v
4523
4545
  ] }) }),
4524
- W <= 0 && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
4546
+ B <= 0 && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
4525
4547
  ] }),
4526
4548
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
4527
- n && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4549
+ n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4528
4550
  /* @__PURE__ */ r(
4529
- q,
4551
+ Q,
4530
4552
  {
4531
4553
  type: "button",
4532
- onClick: N,
4533
- disabled: W <= 0,
4554
+ onClick: w,
4555
+ disabled: B <= 0,
4534
4556
  children: "Start Test"
4535
4557
  }
4536
4558
  )
4537
4559
  ] })
4538
4560
  ] });
4539
- }, Qr = ({
4561
+ }, Jr = ({
4540
4562
  applicantId: e,
4541
4563
  onComplete: t,
4542
4564
  onBack: n
4543
4565
  }) => {
4544
4566
  var _e, He, Ue, je;
4545
- const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = xe(), { identityData: u, provider: h, token: p, isLoading: v, error: I, requestIdentity: f, restartIdentity: k } = wr(e), [x, D] = w(null), [P, A] = w(null), [z, E] = w([]), [F, Q] = w([]), [X, R] = w(!0), [N, L] = w(!1), [B, T] = w(null), [W, O] = w(!1), $ = fe.useRef(!1), [J, S] = w({}), [U, te] = w({}), ge = c != null && c.reviewPageFields && c.reviewPageFields.length > 0 ? c.reviewPageFields[0] : null, se = !!(c != null && c.reviewPageDisabled), M = ee(!1);
4567
+ const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = ge(), { identityData: u, provider: h, token: m, isLoading: v, error: S, requestIdentity: f, restartIdentity: N } = wr(e), [x, D] = k(null), [F, R] = k(null), [$, E] = k([]), [L, Y] = k([]), [X, P] = k(!0), [w, H] = k(!1), [W, I] = k(null), [B, T] = k(!1), O = xe.useRef(!1), [G, C] = k({}), [U, te] = k({}), ye = c != null && c.reviewPageFields && c.reviewPageFields.length > 0 ? c.reviewPageFields[0] : null, se = !!(c != null && c.reviewPageDisabled), M = ee(!1);
4546
4568
  M.current = se;
4547
4569
  const Z = At({
4548
4570
  defaultValues: {
@@ -4557,7 +4579,7 @@ Failed to reload test data. Please refresh the page.`);
4557
4579
  });
4558
4580
  ne(() => {
4559
4581
  if (se) {
4560
- $.current || ($.current = !0, f().then(() => L(!0)).catch((g) => console.error("[Identity] Auto-request failed:", g)).finally(() => R(!1)));
4582
+ O.current || (O.current = !0, f().then(() => H(!0)).catch((g) => console.error("[Identity] Auto-request failed:", g)).finally(() => P(!1)));
4561
4583
  return;
4562
4584
  }
4563
4585
  (async () => {
@@ -4568,13 +4590,13 @@ Failed to reload test data. Please refresh the page.`);
4568
4590
  s.getCountries("", "en", 40)
4569
4591
  // CountriesType.PhoneNumber
4570
4592
  ]);
4571
- A(g);
4572
- const m = /* @__PURE__ */ new Set(), C = b.map((Y) => ({ value: Y.abbreviation3 || Y.abbreviation, label: Y.name })).filter((Y) => !Y.value || m.has(Y.value) ? !1 : (m.add(Y.value), !0));
4573
- E(C);
4574
- const _ = /* @__PURE__ */ new Set(), H = d.filter((Y) => Y.countryCode).map((Y) => ({ value: Y.countryCode, label: `${Y.countryCode} – ${Y.name}` })).filter((Y) => _.has(Y.value) ? !1 : (_.add(Y.value), !0));
4575
- Q(H);
4593
+ R(g);
4594
+ const p = /* @__PURE__ */ new Set(), A = b.map((q) => ({ value: q.abbreviation3 || q.abbreviation, label: q.name })).filter((q) => !q.value || p.has(q.value) ? !1 : (p.add(q.value), !0));
4595
+ E(A);
4596
+ const z = /* @__PURE__ */ new Set(), _ = d.filter((q) => q.countryCode).map((q) => ({ value: q.countryCode, label: `${q.countryCode} – ${q.name}` })).filter((q) => z.has(q.value) ? !1 : (z.add(q.value), !0));
4597
+ Y(_);
4576
4598
  const y = g.applicantRequestData;
4577
- if (S({
4599
+ if (C({
4578
4600
  firstName: (y == null ? void 0 : y.firstName) || "",
4579
4601
  lastName: (y == null ? void 0 : y.lastName) || "",
4580
4602
  email: (y == null ? void 0 : y.email) || "",
@@ -4604,56 +4626,56 @@ Failed to reload test data. Please refresh the page.`);
4604
4626
  country: (y == null ? void 0 : y.country) || "",
4605
4627
  nationality: (y == null ? void 0 : y.nationality) || "",
4606
4628
  phonenumber: (y == null ? void 0 : y.phonenumber) || ""
4607
- }), g.kycRecords && g.kycRecords.length > 0 && g.kycRecords[0].providerTokenObject !== null && !$.current && M.current) {
4608
- console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), $.current = !0;
4629
+ }), g.kycRecords && g.kycRecords.length > 0 && g.kycRecords[0].providerTokenObject !== null && !O.current && M.current) {
4630
+ console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), O.current = !0;
4609
4631
  try {
4610
- await f(), L(!0);
4611
- } catch (Y) {
4612
- console.error("[Identity] Auto-request failed:", Y);
4632
+ await f(), H(!0);
4633
+ } catch (q) {
4634
+ console.error("[Identity] Auto-request failed:", q);
4613
4635
  }
4614
4636
  }
4615
4637
  } catch (g) {
4616
4638
  console.error("Error loading applicant data:", g);
4617
4639
  } finally {
4618
- R(!1);
4640
+ P(!1);
4619
4641
  }
4620
4642
  })();
4621
4643
  }, [e]), ne(() => {
4622
- u && !N && M.current && (console.log("[Identity] Review page disabled — showing cached provider"), L(!0));
4623
- }, [u, N]), ne(() => {
4624
- if (p) {
4625
- if (p.expiresAt) {
4626
- const i = new Date(p.expiresAt).getTime();
4644
+ u && !w && M.current && (console.log("[Identity] Review page disabled — showing cached provider"), H(!0));
4645
+ }, [u, w]), ne(() => {
4646
+ if (m) {
4647
+ if (m.expiresAt) {
4648
+ const i = new Date(m.expiresAt).getTime();
4627
4649
  if (Date.now() >= i) {
4628
- console.warn("[Identity] Token has expired (expiresAt)"), O(!0), T("Your verification session has expired. Please restart.");
4650
+ console.warn("[Identity] Token has expired (expiresAt)"), T(!0), I("Your verification session has expired. Please restart.");
4629
4651
  return;
4630
4652
  }
4631
4653
  }
4632
- if (p.url)
4654
+ if (m.url)
4633
4655
  try {
4634
- const g = new URL(p.url).toString().toLowerCase();
4656
+ const g = new URL(m.url).toString().toLowerCase();
4635
4657
  if (g.includes("expired") || g.includes("invalid") || g.includes("error")) {
4636
- console.warn("[Identity] Token URL indicates expiration"), O(!0), T("Your verification link has expired. Please restart.");
4658
+ console.warn("[Identity] Token URL indicates expiration"), T(!0), I("Your verification link has expired. Please restart.");
4637
4659
  return;
4638
4660
  }
4639
4661
  } catch {
4640
4662
  console.error("[Identity] Invalid token URL");
4641
4663
  }
4642
- if (p.status === "expired" || p.error === "expired" || p.expired === !0) {
4643
- console.warn("[Identity] Token object indicates expiration"), O(!0), T("Your verification session has expired. Please restart.");
4664
+ if (m.status === "expired" || m.error === "expired" || m.expired === !0) {
4665
+ console.warn("[Identity] Token object indicates expiration"), T(!0), I("Your verification session has expired. Please restart.");
4644
4666
  return;
4645
4667
  }
4646
4668
  }
4647
- }, [p]), ne(() => {
4648
- if (h !== null && p && !x && N && !W) {
4669
+ }, [m]), ne(() => {
4670
+ if (h !== null && m && !x && w && !B) {
4649
4671
  const i = h;
4650
- if (p.url) {
4651
- console.log("[Identity] Loading provider URL for user verification:", p.url), T(null);
4672
+ if (m.url) {
4673
+ console.log("[Identity] Loading provider URL for user verification:", m.url), I(null);
4652
4674
  try {
4653
- if (new URL(p.url), i === ve.SardinAI) {
4675
+ if (new URL(m.url), i === ve.SardinAI) {
4654
4676
  console.log("[SardinAI] Initializing Risk SDK in background...");
4655
4677
  try {
4656
- const g = ze.parseProviderConfig(h, p, l);
4678
+ const g = ze.parseProviderConfig(h, m, l);
4657
4679
  ze.createProvider(h, g).initialize().then(() => {
4658
4680
  console.log("[SardinAI] Risk SDK initialized successfully in background");
4659
4681
  }).catch((d) => {
@@ -4663,44 +4685,44 @@ Failed to reload test data. Please refresh the page.`);
4663
4685
  console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", g);
4664
4686
  }
4665
4687
  }
4666
- D({ type: "url", url: p.url });
4688
+ D({ type: "url", url: m.url });
4667
4689
  } catch (g) {
4668
- console.error("[Identity] Invalid URL:", g), T("Invalid verification URL. Please restart."), O(!0);
4690
+ console.error("[Identity] Invalid URL:", g), I("Invalid verification URL. Please restart."), T(!0);
4669
4691
  }
4670
4692
  return;
4671
4693
  }
4672
4694
  if (i === ve.SardinAI) {
4673
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), T(null);
4695
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), I(null);
4674
4696
  try {
4675
- const g = ze.parseProviderConfig(h, p, l), b = ze.createProvider(h, g);
4697
+ const g = ze.parseProviderConfig(h, m, l), b = ze.createProvider(h, g);
4676
4698
  b.initialize().then(() => {
4677
4699
  console.log("[SardinAI] Risk SDK initialized successfully"), D(b), setTimeout(() => {
4678
4700
  t == null || t();
4679
4701
  }, 2e3);
4680
4702
  }).catch((d) => {
4681
- var C;
4703
+ var A;
4682
4704
  console.error("[SardinAI] Failed to initialize:", d);
4683
- const m = ((C = d.message) == null ? void 0 : C.toLowerCase()) || "";
4684
- m.includes("expired") || m.includes("invalid") || m.includes("401") || m.includes("400") ? (O(!0), T("Session expired or invalid. Please restart verification.")) : T(`Failed to initialize: ${d.message}`);
4705
+ const p = ((A = d.message) == null ? void 0 : A.toLowerCase()) || "";
4706
+ p.includes("expired") || p.includes("invalid") || p.includes("401") || p.includes("400") ? (T(!0), I("Session expired or invalid. Please restart verification.")) : I(`Failed to initialize: ${d.message}`);
4685
4707
  });
4686
4708
  } catch (g) {
4687
- console.error("[SardinAI] Error creating provider:", g), T(`Configuration error: ${g.message}`);
4709
+ console.error("[SardinAI] Error creating provider:", g), I(`Configuration error: ${g.message}`);
4688
4710
  }
4689
4711
  return;
4690
4712
  }
4691
4713
  try {
4692
- T(null);
4693
- const g = ze.parseProviderConfig(h, p, l), b = ze.createProvider(h, g);
4714
+ I(null);
4715
+ const g = ze.parseProviderConfig(h, m, l), b = ze.createProvider(h, g);
4694
4716
  i === ve.Sumsub ? (b.initialize("identity-container").catch((d) => {
4695
- var m;
4696
- console.error("[Sumsub] Initialization error:", d), T(`Failed to initialize: ${d.message}`), (m = d.message) != null && m.toLowerCase().includes("expired") && O(!0);
4717
+ var p;
4718
+ console.error("[Sumsub] Initialization error:", d), I(`Failed to initialize: ${d.message}`), (p = d.message) != null && p.toLowerCase().includes("expired") && T(!0);
4697
4719
  }), b.onComplete && b.onComplete(() => {
4698
4720
  t == null || t();
4699
4721
  })) : i === ve.Onfido && b.initialize("identity-container").catch((d) => {
4700
- console.error("[Onfido] Initialization error:", d), T(`Failed to initialize: ${d.message}`);
4722
+ console.error("[Onfido] Initialization error:", d), I(`Failed to initialize: ${d.message}`);
4701
4723
  }), D(b);
4702
4724
  } catch (g) {
4703
- console.error("[Identity] Provider setup error:", g), T(`Setup error: ${g.message}`);
4725
+ console.error("[Identity] Provider setup error:", g), I(`Setup error: ${g.message}`);
4704
4726
  }
4705
4727
  }
4706
4728
  return () => {
@@ -4711,18 +4733,18 @@ Failed to reload test data. Please refresh the page.`);
4711
4733
  console.error("[Identity] Error destroying provider:", i);
4712
4734
  }
4713
4735
  };
4714
- }, [h, p, x, N, t, W]);
4736
+ }, [h, m, x, w, t, B]);
4715
4737
  const ie = async () => {
4716
4738
  try {
4717
- T(null), O(!1), await f(), L(!0);
4739
+ I(null), T(!1), await f(), H(!0);
4718
4740
  } catch (i) {
4719
4741
  console.error("Error starting identity verification:", i);
4720
4742
  }
4721
- }, Ce = async () => {
4743
+ }, Ae = async () => {
4722
4744
  try {
4723
- T(null), O(!1), D(null), console.log("[Identity] Restarting verification..."), await k(), L(!0);
4745
+ I(null), T(!1), D(null), console.log("[Identity] Restarting verification..."), await N(), H(!0);
4724
4746
  } catch (i) {
4725
- console.error("Error restarting identity verification:", i), T(i.message || "Failed to restart verification");
4747
+ console.error("Error restarting identity verification:", i), I(i.message || "Failed to restart verification");
4726
4748
  }
4727
4749
  };
4728
4750
  if (X || v)
@@ -4730,12 +4752,12 @@ Failed to reload test data. Please refresh the page.`);
4730
4752
  /* @__PURE__ */ r(we, { className: "my-8" }),
4731
4753
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4732
4754
  ] }) });
4733
- if (I)
4755
+ if (S)
4734
4756
  return /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4735
4757
  "Error: ",
4736
- I.message
4758
+ S.message
4737
4759
  ] }) }) });
4738
- if (N && (B || W))
4760
+ if (w && (W || B))
4739
4761
  return /* @__PURE__ */ o(j, { children: [
4740
4762
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4741
4763
  /* @__PURE__ */ o(K, { children: [
@@ -4759,8 +4781,8 @@ Failed to reload test data. Please refresh the page.`);
4759
4781
  }
4760
4782
  ),
4761
4783
  /* @__PURE__ */ o("div", { children: [
4762
- /* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: W ? "Session Expired" : "Verification Error" }),
4763
- /* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children: B || "Your verification session has expired and needs to be restarted." })
4784
+ /* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: B ? "Session Expired" : "Verification Error" }),
4785
+ /* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children: W || "Your verification session has expired and needs to be restarted." })
4764
4786
  ] })
4765
4787
  ] }) }),
4766
4788
  /* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
@@ -4773,25 +4795,25 @@ Failed to reload test data. Please refresh the page.`);
4773
4795
  ] })
4774
4796
  ] }),
4775
4797
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
4776
- n && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4777
- /* @__PURE__ */ r(q, { type: "button", onClick: Ce, disabled: v, children: v ? "Restarting..." : "Restart Verification" })
4798
+ n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4799
+ /* @__PURE__ */ r(Q, { type: "button", onClick: Ae, disabled: v, children: v ? "Restarting..." : "Restart Verification" })
4778
4800
  ] })
4779
4801
  ] });
4780
- if (N && u) {
4802
+ if (w && u) {
4781
4803
  const i = h;
4782
- return p != null && p.url ? /* @__PURE__ */ o(j, { children: [
4804
+ return m != null && m.url ? /* @__PURE__ */ o(j, { children: [
4783
4805
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4784
4806
  /* @__PURE__ */ o("div", { children: [
4785
4807
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4786
4808
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4787
4809
  ] }),
4788
4810
  /* @__PURE__ */ r(
4789
- q,
4811
+ Q,
4790
4812
  {
4791
4813
  type: "button",
4792
4814
  variant: "outline",
4793
4815
  size: "sm",
4794
- onClick: Ce,
4816
+ onClick: Ae,
4795
4817
  disabled: v,
4796
4818
  children: "Restart"
4797
4819
  }
@@ -4805,18 +4827,18 @@ Failed to reload test data. Please refresh the page.`);
4805
4827
  /* @__PURE__ */ r("div", { className: "w-full", style: { height: "600px" }, children: /* @__PURE__ */ r(
4806
4828
  "iframe",
4807
4829
  {
4808
- src: p.url,
4830
+ src: m.url,
4809
4831
  className: "w-full h-full border-0 rounded-lg",
4810
4832
  allow: "camera; microphone; geolocation",
4811
4833
  title: "Identity Verification",
4812
4834
  onLoad: (g) => {
4813
- var b, d, m;
4835
+ var b, d, p;
4814
4836
  console.log("[Identity] Iframe loaded");
4815
4837
  try {
4816
- const C = g.target, _ = C.contentDocument || ((b = C.contentWindow) == null ? void 0 : b.document);
4817
- if (_) {
4818
- const H = ((m = (d = _.body) == null ? void 0 : d.textContent) == null ? void 0 : m.toLowerCase()) || "";
4819
- (H.includes("expired") || H.includes("invalid") || H.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), O(!0), T("Your verification link has expired."));
4838
+ const A = g.target, z = A.contentDocument || ((b = A.contentWindow) == null ? void 0 : b.document);
4839
+ if (z) {
4840
+ const _ = ((p = (d = z.body) == null ? void 0 : d.textContent) == null ? void 0 : p.toLowerCase()) || "";
4841
+ (_.includes("expired") || _.includes("invalid") || _.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), T(!0), I("Your verification link has expired."));
4820
4842
  }
4821
4843
  } catch {
4822
4844
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4825,7 +4847,7 @@ Failed to reload test data. Please refresh the page.`);
4825
4847
  }
4826
4848
  ) })
4827
4849
  ] }),
4828
- n && /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(q, { variant: "outline", onClick: n, children: "Back" }) })
4850
+ n && /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(Q, { variant: "outline", onClick: n, children: "Back" }) })
4829
4851
  ] }) : i === ve.SardinAI ? /* @__PURE__ */ o(j, { children: [
4830
4852
  /* @__PURE__ */ o(ue, { children: [
4831
4853
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
@@ -4842,18 +4864,18 @@ Failed to reload test data. Please refresh the page.`);
4842
4864
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4843
4865
  ] }),
4844
4866
  /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4845
- n && /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(q, { variant: "outline", onClick: n, children: "Back" }) })
4867
+ n && /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(Q, { variant: "outline", onClick: n, children: "Back" }) })
4846
4868
  ] });
4847
4869
  }
4848
4870
  const Pe = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), pe = (i = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[i] || "col-span-4", Oe = (i, g) => {
4849
4871
  if (!g && g !== 0) return "—";
4850
4872
  if (Pe.has(i) && i !== "mobileCountryCode") {
4851
- const b = z.find((d) => d.value === g);
4873
+ const b = $.find((d) => d.value === g);
4852
4874
  return b ? b.label : String(g);
4853
4875
  }
4854
4876
  return String(g);
4855
4877
  }, Xe = ({ helpText: i }) => {
4856
- const [g, b] = w(!1), d = ee(null), [, m] = w({ top: 0, left: 0 });
4878
+ const [g, b] = k(!1), d = ee(null), [, p] = k({ top: 0, left: 0 });
4857
4879
  return /* @__PURE__ */ o(Qe, { children: [
4858
4880
  /* @__PURE__ */ r(
4859
4881
  "button",
@@ -4862,8 +4884,8 @@ Failed to reload test data. Please refresh the page.`);
4862
4884
  ref: d,
4863
4885
  onClick: () => {
4864
4886
  if (d.current) {
4865
- const _ = d.current.getBoundingClientRect();
4866
- m({ top: _.bottom + window.scrollY + 6, left: _.left + window.scrollX });
4887
+ const z = d.current.getBoundingClientRect();
4888
+ p({ top: z.bottom + window.scrollY + 6, left: z.left + window.scrollX });
4867
4889
  }
4868
4890
  b(!0);
4869
4891
  },
@@ -4903,7 +4925,7 @@ Failed to reload test data. Please refresh the page.`);
4903
4925
  children: /* @__PURE__ */ o(
4904
4926
  "div",
4905
4927
  {
4906
- onClick: (_) => _.stopPropagation(),
4928
+ onClick: (z) => z.stopPropagation(),
4907
4929
  style: {
4908
4930
  background: "var(--metakyc-surface, #fff)",
4909
4931
  border: "1px solid var(--metakyc-border, #e5e7eb)",
@@ -4945,7 +4967,7 @@ Failed to reload test data. Please refresh the page.`);
4945
4967
  /* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: i }),
4946
4968
  /* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(Xe, { helpText: g }) })
4947
4969
  ] }) : i, et = (i, g) => {
4948
- const b = `cf-${g}`, d = i.paramName ?? "", m = U[d];
4970
+ const b = `cf-${g}`, d = i.paramName ?? "", p = U[d];
4949
4971
  if (i.customType === "br")
4950
4972
  return /* @__PURE__ */ r("div", { className: pe(i.colSpan), style: { minHeight: "0.5rem" } }, b);
4951
4973
  if (i.customType === "paragraph")
@@ -4982,15 +5004,15 @@ Failed to reload test data. Please refresh the page.`);
4982
5004
  i.helpText
4983
5005
  ) }, b);
4984
5006
  if (i.customType === "checkbox" || i.customType === "link_checkbox") {
4985
- const C = m === "true" || m === !0;
5007
+ const A = p === "true" || p === !0;
4986
5008
  return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
4987
5009
  /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
4988
5010
  /* @__PURE__ */ r(
4989
5011
  "input",
4990
5012
  {
4991
5013
  type: "checkbox",
4992
- checked: !!C,
4993
- onChange: (_) => te((H) => ({ ...H, [d]: String(_.target.checked) })),
5014
+ checked: !!A,
5015
+ onChange: (z) => te((_) => ({ ..._, [d]: String(z.target.checked) })),
4994
5016
  style: {
4995
5017
  width: 16,
4996
5018
  height: 16,
@@ -5009,27 +5031,27 @@ Failed to reload test data. Please refresh the page.`);
5009
5031
  ) }, b);
5010
5032
  }
5011
5033
  if (i.customType === "group_checkbox") {
5012
- const C = Array.isArray(m) ? m : m ? [m] : [], _ = (H) => {
5013
- i.singleSelect ? te((y) => ({ ...y, [d]: C[0] === H ? [] : [H] })) : te((y) => ({
5034
+ const A = Array.isArray(p) ? p : p ? [p] : [], z = (_) => {
5035
+ i.singleSelect ? te((y) => ({ ...y, [d]: A[0] === _ ? [] : [_] })) : te((y) => ({
5014
5036
  ...y,
5015
- [d]: C.includes(H) ? C.filter((ae) => ae !== H) : [...C, H]
5037
+ [d]: A.includes(_) ? A.filter((ae) => ae !== _) : [...A, _]
5016
5038
  }));
5017
5039
  };
5018
5040
  return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
5019
5041
  /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
5020
5042
  i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
5021
- (i.options || []).map((H) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5043
+ (i.options || []).map((_) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5022
5044
  /* @__PURE__ */ r(
5023
5045
  "input",
5024
5046
  {
5025
5047
  type: "checkbox",
5026
- checked: C.includes(H.value),
5027
- onChange: () => _(H.value),
5048
+ checked: A.includes(_.value),
5049
+ onChange: () => z(_.value),
5028
5050
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5029
5051
  }
5030
5052
  ),
5031
- /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: H.label })
5032
- ] }, H.value))
5053
+ /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: _.label })
5054
+ ] }, _.value))
5033
5055
  ] }),
5034
5056
  i.helpText
5035
5057
  ) }, b);
@@ -5037,20 +5059,20 @@ Failed to reload test data. Please refresh the page.`);
5037
5059
  return i.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
5038
5060
  /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
5039
5061
  i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
5040
- (i.options || []).map((C) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5062
+ (i.options || []).map((A) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5041
5063
  /* @__PURE__ */ r(
5042
5064
  "input",
5043
5065
  {
5044
5066
  type: "radio",
5045
5067
  name: `rg-${d}`,
5046
- value: C.value,
5047
- checked: m === C.value,
5048
- onChange: () => te((_) => ({ ..._, [d]: C.value })),
5068
+ value: A.value,
5069
+ checked: p === A.value,
5070
+ onChange: () => te((z) => ({ ...z, [d]: A.value })),
5049
5071
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5050
5072
  }
5051
5073
  ),
5052
- /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: C.label })
5053
- ] }, C.value))
5074
+ /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: A.label })
5075
+ ] }, A.value))
5054
5076
  ] }),
5055
5077
  i.helpText
5056
5078
  ) }, b) : /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
@@ -5058,34 +5080,34 @@ Failed to reload test data. Please refresh the page.`);
5058
5080
  de,
5059
5081
  {
5060
5082
  label: i.displayText || i.label || d,
5061
- value: String(m ?? ""),
5062
- onChange: (C) => te((_) => ({ ..._, [d]: C.target.value }))
5083
+ value: String(p ?? ""),
5084
+ onChange: (A) => te((z) => ({ ...z, [d]: A.target.value }))
5063
5085
  }
5064
5086
  ),
5065
5087
  i.helpText
5066
5088
  ) }, b);
5067
5089
  }, tt = (i, g) => {
5068
5090
  if (i.isCustom) return et(i, g);
5069
- const b = i.name ?? "", d = Me[b], m = i.displayText || (d == null ? void 0 : d.label) || b, C = J[b] ?? "", _ = b === "mobileCountryCode", H = !!(d != null && d.countriesType) && !_;
5070
- return i.editable ? _ ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5091
+ const b = i.name ?? "", d = Me[b], p = i.displayText || (d == null ? void 0 : d.label) || b, A = G[b] ?? "", z = b === "mobileCountryCode", _ = !!(d != null && d.countriesType) && !z;
5092
+ return i.editable ? z ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5071
5093
  /* @__PURE__ */ r(
5072
5094
  Re,
5073
5095
  {
5074
- label: m,
5075
- value: String(C),
5076
- onChange: (y) => S((ae) => ({ ...ae, [b]: y })),
5077
- options: [{ value: "", label: "Select country code…" }, ...F]
5096
+ label: p,
5097
+ value: String(A),
5098
+ onChange: (y) => C((ae) => ({ ...ae, [b]: y })),
5099
+ options: [{ value: "", label: "Select country code…" }, ...L]
5078
5100
  }
5079
5101
  ),
5080
5102
  i.helpText
5081
- ) }, `epc-${g}`) : H ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5103
+ ) }, `epc-${g}`) : _ ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5082
5104
  /* @__PURE__ */ r(
5083
5105
  Re,
5084
5106
  {
5085
- label: m,
5086
- value: String(C),
5087
- onChange: (y) => S((ae) => ({ ...ae, [b]: y })),
5088
- options: [{ value: "", label: `Select ${m.toLowerCase()}…` }, ...z]
5107
+ label: p,
5108
+ value: String(A),
5109
+ onChange: (y) => C((ae) => ({ ...ae, [b]: y })),
5110
+ options: [{ value: "", label: `Select ${p.toLowerCase()}…` }, ...$]
5089
5111
  }
5090
5112
  ),
5091
5113
  i.helpText
@@ -5093,23 +5115,23 @@ Failed to reload test data. Please refresh the page.`);
5093
5115
  /* @__PURE__ */ r(
5094
5116
  de,
5095
5117
  {
5096
- label: m,
5118
+ label: p,
5097
5119
  type: (d == null ? void 0 : d.type) === "date" ? "date" : (d == null ? void 0 : d.type) === "email" ? "email" : "text",
5098
- value: String(C),
5099
- onChange: (y) => S((ae) => ({ ...ae, [b]: y.target.value }))
5120
+ value: String(A),
5121
+ onChange: (y) => C((ae) => ({ ...ae, [b]: y.target.value }))
5100
5122
  }
5101
5123
  ),
5102
5124
  i.helpText
5103
5125
  ) }, `ei-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5104
5126
  /* @__PURE__ */ o(Qe, { children: [
5105
- /* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: m }),
5106
- /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Oe(b, C) })
5127
+ /* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p }),
5128
+ /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Oe(b, A) })
5107
5129
  ] }),
5108
5130
  i.helpText
5109
5131
  ) }, `ro-${g}`);
5110
5132
  };
5111
- if (ge) {
5112
- const i = ge.title || "Review Your Information", g = ge.subtitle || "Please review and confirm your information before starting identity verification";
5133
+ if (ye) {
5134
+ const i = ye.title || "Review Your Information", g = ye.subtitle || "Please review and confirm your information before starting identity verification";
5113
5135
  return /* @__PURE__ */ r("form", { onSubmit: (b) => {
5114
5136
  b.preventDefault(), ie();
5115
5137
  }, children: /* @__PURE__ */ o(j, { children: [
@@ -5117,10 +5139,10 @@ Failed to reload test data. Please refresh the page.`);
5117
5139
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i }),
5118
5140
  /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g })
5119
5141
  ] }),
5120
- /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: ge.fields.map((b, d) => tt(b, d)) }) }),
5142
+ /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: ye.fields.map((b, d) => tt(b, d)) }) }),
5121
5143
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
5122
- n && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5123
- /* @__PURE__ */ r(q, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
5144
+ n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5145
+ /* @__PURE__ */ r(Q, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
5124
5146
  ] })
5125
5147
  ] }) });
5126
5148
  }
@@ -5131,9 +5153,9 @@ Failed to reload test data. Please refresh the page.`);
5131
5153
  ] }),
5132
5154
  /* @__PURE__ */ o(K, { className: "space-y-6", children: [
5133
5155
  /* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
5134
- { label: "Name", value: `${((_e = P == null ? void 0 : P.applicantRequestData) == null ? void 0 : _e.firstName) || ""} ${((He = P == null ? void 0 : P.applicantRequestData) == null ? void 0 : He.lastName) || ""}`.trim() },
5135
- { label: "Email", value: (Ue = P == null ? void 0 : P.applicantRequestData) == null ? void 0 : Ue.email },
5136
- { label: "Date of Birth", value: ((je = P == null ? void 0 : P.applicantRequestData) == null ? void 0 : je.dateOfBirth) || "Not provided" }
5156
+ { label: "Name", value: `${((_e = F == null ? void 0 : F.applicantRequestData) == null ? void 0 : _e.firstName) || ""} ${((He = F == null ? void 0 : F.applicantRequestData) == null ? void 0 : He.lastName) || ""}`.trim() },
5157
+ { label: "Email", value: (Ue = F == null ? void 0 : F.applicantRequestData) == null ? void 0 : Ue.email },
5158
+ { label: "Date of Birth", value: ((je = F == null ? void 0 : F.applicantRequestData) == null ? void 0 : je.dateOfBirth) || "Not provided" }
5137
5159
  ].map(({ label: i, value: g }) => /* @__PURE__ */ o("div", { children: [
5138
5160
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: i }),
5139
5161
  /* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g })
@@ -5142,7 +5164,7 @@ Failed to reload test data. Please refresh the page.`);
5142
5164
  /* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
5143
5165
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5144
5166
  /* @__PURE__ */ r(
5145
- Te,
5167
+ Le,
5146
5168
  {
5147
5169
  control: Z.control,
5148
5170
  name: "country",
@@ -5152,13 +5174,13 @@ Failed to reload test data. Please refresh the page.`);
5152
5174
  label: "Country",
5153
5175
  value: i.value,
5154
5176
  onChange: i.onChange,
5155
- options: [{ value: "", label: "Select country…" }, ...z]
5177
+ options: [{ value: "", label: "Select country…" }, ...$]
5156
5178
  }
5157
5179
  )
5158
5180
  }
5159
5181
  ),
5160
5182
  /* @__PURE__ */ r(
5161
- Te,
5183
+ Le,
5162
5184
  {
5163
5185
  control: Z.control,
5164
5186
  name: "nationality",
@@ -5168,26 +5190,26 @@ Failed to reload test data. Please refresh the page.`);
5168
5190
  label: "Nationality",
5169
5191
  value: i.value,
5170
5192
  onChange: i.onChange,
5171
- options: [{ value: "", label: "Select nationality…" }, ...z]
5193
+ options: [{ value: "", label: "Select nationality…" }, ...$]
5172
5194
  }
5173
5195
  )
5174
5196
  }
5175
5197
  )
5176
5198
  ] }),
5177
5199
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5178
- /* @__PURE__ */ r(Te, { control: Z.control, name: "street", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street" }) }),
5179
- /* @__PURE__ */ r(Te, { control: Z.control, name: "streetNumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street Number" }) })
5200
+ /* @__PURE__ */ r(Le, { control: Z.control, name: "street", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street" }) }),
5201
+ /* @__PURE__ */ r(Le, { control: Z.control, name: "streetNumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street Number" }) })
5180
5202
  ] }),
5181
5203
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5182
- /* @__PURE__ */ r(Te, { control: Z.control, name: "city", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "City" }) }),
5183
- /* @__PURE__ */ r(Te, { control: Z.control, name: "zip", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "ZIP / Postal Code" }) })
5204
+ /* @__PURE__ */ r(Le, { control: Z.control, name: "city", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "City" }) }),
5205
+ /* @__PURE__ */ r(Le, { control: Z.control, name: "zip", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "ZIP / Postal Code" }) })
5184
5206
  ] }),
5185
- /* @__PURE__ */ r(Te, { control: Z.control, name: "phonenumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Phone Number", type: "tel" }) })
5207
+ /* @__PURE__ */ r(Le, { control: Z.control, name: "phonenumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Phone Number", type: "tel" }) })
5186
5208
  ] })
5187
5209
  ] }),
5188
5210
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
5189
- n && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5190
- /* @__PURE__ */ r(q, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
5211
+ n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5212
+ /* @__PURE__ */ r(Q, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
5191
5213
  ] })
5192
5214
  ] }) });
5193
5215
  }, mt = ({
@@ -5198,21 +5220,21 @@ Failed to reload test data. Please refresh the page.`);
5198
5220
  onContinue: s,
5199
5221
  onContactSupport: l
5200
5222
  }) => {
5201
- const u = e === Le.Approved ? {
5223
+ const u = e === Te.Approved ? {
5202
5224
  type: "success",
5203
5225
  title: "Verification Approved",
5204
5226
  icon: "✓",
5205
5227
  iconBg: "bg-green-100 dark:bg-green-900/30",
5206
5228
  iconColor: "text-green-600 dark:text-green-400",
5207
5229
  message: "Your identity verification has been successfully approved."
5208
- } : e === Le.Rejected ? {
5230
+ } : e === Te.Rejected ? {
5209
5231
  type: "error",
5210
5232
  title: "Verification Rejected",
5211
5233
  icon: "✕",
5212
5234
  iconBg: "bg-red-100 dark:bg-red-900/30",
5213
5235
  iconColor: "text-red-600 dark:text-red-400",
5214
5236
  message: "Unfortunately, your identity verification was not approved."
5215
- } : e === Le.Pending || e === Le.InProgress ? {
5237
+ } : e === Te.Pending || e === Te.InProgress ? {
5216
5238
  type: "pending",
5217
5239
  title: "Verification Pending",
5218
5240
  icon: "⏱",
@@ -5280,10 +5302,10 @@ Failed to reload test data. Please refresh the page.`);
5280
5302
  ) }),
5281
5303
  /* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: u.title }),
5282
5304
  /* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
5283
- Ae,
5305
+ Ie,
5284
5306
  {
5285
5307
  variant: u.type === "success" ? "success" : u.type === "error" ? "danger" : u.type === "pending" ? "warning" : "info",
5286
- children: e != null ? Le[e] : De[t]
5308
+ children: e != null ? Te[e] : De[t]
5287
5309
  }
5288
5310
  ) }),
5289
5311
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: a || u.message }),
@@ -5315,7 +5337,7 @@ Failed to reload test data. Please refresh the page.`);
5315
5337
  /* @__PURE__ */ r("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
5316
5338
  /* @__PURE__ */ o("div", { children: [
5317
5339
  /* @__PURE__ */ r("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
5318
- /* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ? Le[e] : "Not Available" })
5340
+ /* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ? Te[e] : "Not Available" })
5319
5341
  ] }),
5320
5342
  /* @__PURE__ */ o("div", { children: [
5321
5343
  /* @__PURE__ */ r("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
@@ -5324,15 +5346,15 @@ Failed to reload test data. Please refresh the page.`);
5324
5346
  ] }) })
5325
5347
  ] }),
5326
5348
  /* @__PURE__ */ o(me, { className: "flex justify-center gap-4", children: [
5327
- u.type === "success" && s && /* @__PURE__ */ r(q, { onClick: s, size: "lg", children: "Continue" }),
5349
+ u.type === "success" && s && /* @__PURE__ */ r(Q, { onClick: s, size: "lg", children: "Continue" }),
5328
5350
  u.type === "error" && /* @__PURE__ */ o(Qe, { children: [
5329
- l && /* @__PURE__ */ r(q, { variant: "outline", onClick: l, children: "Contact Support" }),
5330
- s && /* @__PURE__ */ r(q, { onClick: s, children: "Try Again" })
5351
+ l && /* @__PURE__ */ r(Q, { variant: "outline", onClick: l, children: "Contact Support" }),
5352
+ s && /* @__PURE__ */ r(Q, { onClick: s, children: "Try Again" })
5331
5353
  ] }),
5332
5354
  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" }) })
5333
5355
  ] })
5334
5356
  ] });
5335
- }, Gr = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
5357
+ }, Zr = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
5336
5358
  "img",
5337
5359
  {
5338
5360
  src: e.url,
@@ -5352,10 +5374,10 @@ Failed to reload test data. Please refresh the page.`);
5352
5374
  subtitle: t,
5353
5375
  className: n = ""
5354
5376
  }) => {
5355
- const { currentTheme: a } = xe(), s = e || (a == null ? void 0 : a.title) || "", l = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!s;
5377
+ const { currentTheme: a } = ge(), s = e || (a == null ? void 0 : a.title) || "", l = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!s;
5356
5378
  return !l && !c ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${n}`, children: [
5357
5379
  /* @__PURE__ */ o("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
5358
- l && /* @__PURE__ */ r(Gr, { config: a.logo }),
5380
+ l && /* @__PURE__ */ r(Zr, { config: a.logo }),
5359
5381
  l && c && /* @__PURE__ */ r(
5360
5382
  "span",
5361
5383
  {
@@ -5385,7 +5407,7 @@ const qe = {
5385
5407
  display: "inline-block",
5386
5408
  verticalAlign: "middle"
5387
5409
  }, pt = ({ helpText: e, children: t }) => {
5388
- const [n, a] = fe.useState(!1);
5410
+ const [n, a] = xe.useState(!1);
5389
5411
  if (!e) return /* @__PURE__ */ r(Qe, { children: t });
5390
5412
  const s = n ? /* @__PURE__ */ r(
5391
5413
  "div",
@@ -5499,22 +5521,22 @@ const qe = {
5499
5521
  ),
5500
5522
  typeof document < "u" && s ? it(s, document.body) : null
5501
5523
  ] });
5502
- }, gn = ({
5524
+ }, xn = ({
5503
5525
  workflowKey: e,
5504
5526
  externalRefId: t,
5505
5527
  onSuccess: n,
5506
5528
  onCancel: a
5507
5529
  }) => {
5508
5530
  var _e, He, Ue, je;
5509
- const { config: s, baseInformationService: l, currentTheme: c } = xe(), { createApplicant: u, isLoading: h } = Sr(), p = e || ((_e = s.applicantForm) == null ? void 0 : _e.workflowKey);
5510
- if (!p)
5531
+ const { config: s, baseInformationService: l, currentTheme: c } = ge(), { createApplicant: u, isLoading: h } = Sr(), m = e || ((_e = s.applicantForm) == null ? void 0 : _e.workflowKey);
5532
+ if (!m)
5511
5533
  throw new Error(
5512
5534
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
5513
5535
  );
5514
- const v = t || ((He = s.applicantForm) == null ? void 0 : He.externalRefId) || "", I = ((Ue = s.applicantForm) == null ? void 0 : Ue.email) || "", f = Ie(
5536
+ const v = t || ((He = s.applicantForm) == null ? void 0 : He.externalRefId) || "", S = ((Ue = s.applicantForm) == null ? void 0 : Ue.email) || "", f = Ee(
5515
5537
  () => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
5516
5538
  [c == null ? void 0 : c.applicantFormPages]
5517
- ), k = Ie(() => {
5539
+ ), N = Ee(() => {
5518
5540
  const i = new Set(Ve), g = c == null ? void 0 : c.applicantFormRequiredFields;
5519
5541
  if (g) for (const b of g) i.add(b);
5520
5542
  if (f)
@@ -5522,12 +5544,12 @@ const qe = {
5522
5544
  for (const d of b.fields)
5523
5545
  !d.isCustom && d.name && d.required && i.add(d.name);
5524
5546
  return Array.from(i);
5525
- }, [c == null ? void 0 : c.applicantFormRequiredFields, f]), x = Ie(() => {
5547
+ }, [c == null ? void 0 : c.applicantFormRequiredFields, f]), x = Ee(() => {
5526
5548
  var b;
5527
5549
  if (f) {
5528
- const d = f.flatMap((C) => C.fields).filter((C) => !C.isCustom && C.name).map((C) => C.name), m = new Set(d);
5529
- for (const C of Ve) m.add(C);
5530
- return Array.from(m);
5550
+ const d = f.flatMap((A) => A.fields).filter((A) => !A.isCustom && A.name).map((A) => A.name), p = new Set(d);
5551
+ for (const A of Ve) p.add(A);
5552
+ return Array.from(p);
5531
5553
  }
5532
5554
  let i;
5533
5555
  (b = s.applicantForm) != null && b.visibleFields ? i = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? i = c.applicantFormVisibleFields : i = zt;
@@ -5541,65 +5563,65 @@ const qe = {
5541
5563
  "countryOfBirth",
5542
5564
  "mobileCountryCode",
5543
5565
  "otherNationality"
5544
- ]), P = Ie(() => {
5566
+ ]), F = Ee(() => {
5545
5567
  var g, b;
5546
5568
  const i = /* @__PURE__ */ new Set();
5547
5569
  if (f)
5548
5570
  for (const d of f)
5549
- for (const m of d.fields)
5550
- !m.isCustom && m.name && D.has(m.name) && i.add(m.countriesType ?? ((g = Me[m.name]) == null ? void 0 : g.countriesType));
5571
+ for (const p of d.fields)
5572
+ !p.isCustom && p.name && D.has(p.name) && i.add(p.countriesType ?? ((g = Me[p.name]) == null ? void 0 : g.countriesType));
5551
5573
  else
5552
5574
  for (const d of x)
5553
5575
  D.has(d) && i.add((b = Me[d]) == null ? void 0 : b.countriesType);
5554
5576
  return i.size === 0 && i.add(void 0), Array.from(i);
5555
- }, [x, f]), [A, z] = w({}), [E, F] = w(!0), Q = ee(/* @__PURE__ */ new Set()), X = ee(/* @__PURE__ */ new Set());
5577
+ }, [x, f]), [R, $] = k({}), [E, L] = k(!0), Y = ee(/* @__PURE__ */ new Set()), X = ee(/* @__PURE__ */ new Set());
5556
5578
  ne(() => {
5557
5579
  if (!c) return;
5558
- const i = P.filter((d) => {
5559
- const m = d != null ? String(d) : "all";
5560
- return !X.current.has(m) && !Q.current.has(m);
5580
+ const i = F.filter((d) => {
5581
+ const p = d != null ? String(d) : "all";
5582
+ return !X.current.has(p) && !Y.current.has(p);
5561
5583
  });
5562
5584
  if (i.length === 0) {
5563
- P.every((m) => {
5564
- const C = m != null ? String(m) : "all";
5565
- return X.current.has(C);
5566
- }) && F(!1);
5585
+ F.every((p) => {
5586
+ const A = p != null ? String(p) : "all";
5587
+ return X.current.has(A);
5588
+ }) && L(!1);
5567
5589
  return;
5568
5590
  }
5569
- F(!0);
5591
+ L(!0);
5570
5592
  const g = i.map((d) => d != null ? String(d) : "all");
5571
- g.forEach((d) => Q.current.add(d)), (async () => {
5593
+ g.forEach((d) => Y.current.add(d)), (async () => {
5572
5594
  try {
5573
5595
  const d = await Promise.all(
5574
- i.map(async (m) => {
5575
- const C = m != null ? String(m) : "all", _ = await l.getCountries("", s.locale || "en", m), H = m === 40, y = /* @__PURE__ */ new Set(), ae = _.map((Y) => H && Y.countryCode ? {
5576
- value: Y.countryCode,
5577
- label: `${Y.countryCode} – ${Y.name}`
5578
- } : { value: Y.abbreviation3 || Y.abbreviation, label: Y.name }).filter((Y) => !Y.value || y.has(Y.value) ? !1 : (y.add(Y.value), !0));
5579
- return X.current.add(C), Q.current.delete(C), [C, ae];
5596
+ i.map(async (p) => {
5597
+ const A = p != null ? String(p) : "all", z = await l.getCountries("", s.locale || "en", p), _ = p === 40, y = /* @__PURE__ */ new Set(), ae = z.map((q) => _ && q.countryCode ? {
5598
+ value: q.countryCode,
5599
+ label: `${q.countryCode} – ${q.name}`
5600
+ } : { value: q.abbreviation3 || q.abbreviation, label: q.name }).filter((q) => !q.value || y.has(q.value) ? !1 : (y.add(q.value), !0));
5601
+ return X.current.add(A), Y.current.delete(A), [A, ae];
5580
5602
  })
5581
5603
  );
5582
- z((m) => ({ ...m, ...Object.fromEntries(d) }));
5604
+ $((p) => ({ ...p, ...Object.fromEntries(d) }));
5583
5605
  } catch (d) {
5584
- g.forEach((m) => Q.current.delete(m)), console.error("Failed to load countries:", d);
5606
+ g.forEach((p) => Y.current.delete(p)), console.error("Failed to load countries:", d);
5585
5607
  } finally {
5586
- P.every((m) => {
5587
- const C = m != null ? String(m) : "all";
5588
- return X.current.has(C);
5589
- }) && F(!1);
5608
+ F.every((p) => {
5609
+ const A = p != null ? String(p) : "all";
5610
+ return X.current.has(A);
5611
+ }) && L(!1);
5590
5612
  }
5591
5613
  })();
5592
- }, [P, c]);
5593
- const R = (i, g) => {
5594
- var m;
5595
- const b = g ?? ((m = Me[i]) == null ? void 0 : m.countriesType), d = b != null ? String(b) : "all";
5596
- return A[d] || [];
5597
- }, [N, L] = w({
5598
- workflowKey: p,
5614
+ }, [F, c]);
5615
+ const P = (i, g) => {
5616
+ var p;
5617
+ const b = g ?? ((p = Me[i]) == null ? void 0 : p.countriesType), d = b != null ? String(b) : "all";
5618
+ return R[d] || [];
5619
+ }, [w, H] = k({
5620
+ workflowKey: m,
5599
5621
  firstName: "",
5600
5622
  lastName: "",
5601
5623
  title: "",
5602
- email: I,
5624
+ email: S,
5603
5625
  dateOfBirth: "",
5604
5626
  phonenumber: "",
5605
5627
  externalRefId: v,
@@ -5619,89 +5641,89 @@ const qe = {
5619
5641
  educationLevel: "",
5620
5642
  occupation: "",
5621
5643
  taxNumber: ""
5622
- }), [B, T] = w({}), [W, O] = w(0), [$, J] = w({}), [S, U] = w(null), [te, ge] = w(!1), se = (i, g) => L((b) => ({ ...b, [i]: g })), M = (i, g) => T((b) => ({ ...b, [i]: g })), Z = (i) => !i.conditionalOn || B[i.conditionalOn] === "true", ie = f && W < f.length - 1 ? W + 1 : -1, Ce = f && W > 0 ? W - 1 : -1, Pe = (i) => {
5644
+ }), [W, I] = k({}), [B, T] = k(0), [O, G] = k({}), [C, U] = k(null), [te, ye] = k(!1), se = (i, g) => H((b) => ({ ...b, [i]: g })), M = (i, g) => I((b) => ({ ...b, [i]: g })), Z = (i) => !i.conditionalOn || W[i.conditionalOn] === "true", ie = f && B < f.length - 1 ? B + 1 : -1, Ae = f && B > 0 ? B - 1 : -1, Pe = (i) => {
5623
5645
  var b;
5624
5646
  const g = {};
5625
5647
  for (const d of i.fields)
5626
5648
  if (d.isCustom) {
5627
5649
  if (d.customType === "paragraph" || d.customType === "html" || d.customType === "br" || d.customType === "link") continue;
5628
5650
  if (d.required && d.paramName) {
5629
- const m = B[d.paramName], C = d.displayText || d.label || d.paramName;
5630
- d.customType === "checkbox" || d.customType === "link_checkbox" ? m !== "true" && (g[d.paramName] = `${C} is required.`) : (!m || m.trim() === "") && (g[d.paramName] = `${C} is required.`);
5651
+ const p = W[d.paramName], A = d.displayText || d.label || d.paramName;
5652
+ d.customType === "checkbox" || d.customType === "link_checkbox" ? p !== "true" && (g[d.paramName] = `${A} is required.`) : (!p || p.trim() === "") && (g[d.paramName] = `${A} is required.`);
5631
5653
  }
5632
5654
  } else if (d.name) {
5633
- const m = d.name;
5634
- if (k.includes(m) && Ye(N[m])) {
5635
- const C = d.displayText || ((b = Me[m]) == null ? void 0 : b.label) || m;
5636
- g[m] = `${C} is required.`;
5655
+ const p = d.name;
5656
+ if (N.includes(p) && Ye(w[p])) {
5657
+ const A = d.displayText || ((b = Me[p]) == null ? void 0 : b.label) || p;
5658
+ g[p] = `${A} is required.`;
5637
5659
  }
5638
5660
  }
5639
5661
  return g;
5640
5662
  }, pe = async () => {
5641
5663
  if (!f) return;
5642
- const i = f[W];
5664
+ const i = f[B];
5643
5665
  if (i.conditionalOn && !Z(i)) {
5644
- J({}), ie >= 0 ? O(ie) : await Oe();
5666
+ G({}), ie >= 0 ? T(ie) : await Oe();
5645
5667
  return;
5646
5668
  }
5647
5669
  const g = Pe(i);
5648
5670
  if (Object.keys(g).length > 0) {
5649
- J(g);
5671
+ G(g);
5650
5672
  return;
5651
5673
  }
5652
- J({}), ie >= 0 ? O(ie) : await Oe();
5674
+ G({}), ie >= 0 ? T(ie) : await Oe();
5653
5675
  }, Oe = async () => {
5654
5676
  if (f) {
5655
5677
  let i = {};
5656
5678
  for (const g of f)
5657
5679
  Z(g) && (i = { ...i, ...Pe(g) });
5658
5680
  if (Object.keys(i).length > 0) {
5659
- J(i);
5681
+ G(i);
5660
5682
  return;
5661
5683
  }
5662
5684
  }
5663
- ge(!0), U(null);
5685
+ ye(!0), U(null);
5664
5686
  try {
5665
- if (!N.externalRefId || N.externalRefId.trim() === "") {
5687
+ if (!w.externalRefId || w.externalRefId.trim() === "") {
5666
5688
  U("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
5667
5689
  return;
5668
5690
  }
5669
5691
  const i = {
5670
- workflowKey: N.workflowKey,
5671
- externalRefId: N.externalRefId.trim()
5692
+ workflowKey: w.workflowKey,
5693
+ externalRefId: w.externalRefId.trim()
5672
5694
  };
5673
5695
  if (f) {
5674
5696
  for (const d of f)
5675
5697
  if (Z(d)) {
5676
- for (const m of d.fields)
5677
- if (!m.isCustom && m.name) {
5678
- const C = m.name, _ = N[C];
5679
- Ye(_) || (i[C] = _);
5698
+ for (const p of d.fields)
5699
+ if (!p.isCustom && p.name) {
5700
+ const A = p.name, z = w[A];
5701
+ Ye(z) || (i[A] = z);
5680
5702
  }
5681
5703
  }
5682
5704
  for (const d of Ve)
5683
5705
  if (i[d] === void 0) {
5684
- const m = N[d];
5685
- Ye(m) || (i[d] = m);
5706
+ const p = w[d];
5707
+ Ye(p) || (i[d] = p);
5686
5708
  }
5687
5709
  } else
5688
5710
  x.forEach((d) => {
5689
5711
  if (d === "externalRefId") return;
5690
- const m = N[d];
5691
- Ye(m) || (i[d] = m);
5712
+ const p = w[d];
5713
+ Ye(p) || (i[d] = p);
5692
5714
  });
5693
5715
  const g = [];
5694
5716
  if (f) {
5695
5717
  for (const d of f)
5696
5718
  if (Z(d))
5697
- for (const m of d.fields) {
5698
- if (!m.isCustom || !m.paramName || m.customType === "paragraph" || m.customType === "html" || m.customType === "br" || m.customType === "link") continue;
5699
- const C = B[m.paramName] ?? "";
5700
- let _;
5701
- if (m.customType === "checkbox" || m.customType === "link_checkbox")
5702
- _ = C === "true" ? "yes" : "no";
5703
- else if (_ = C, !_ && !m.required) continue;
5704
- g.push({ paramName: m.paramName, value: _ });
5719
+ for (const p of d.fields) {
5720
+ if (!p.isCustom || !p.paramName || p.customType === "paragraph" || p.customType === "html" || p.customType === "br" || p.customType === "link") continue;
5721
+ const A = W[p.paramName] ?? "";
5722
+ let z;
5723
+ if (p.customType === "checkbox" || p.customType === "link_checkbox")
5724
+ z = A === "true" ? "yes" : "no";
5725
+ else if (z = A, !z && !p.required) continue;
5726
+ g.push({ paramName: p.paramName, value: z });
5705
5727
  }
5706
5728
  }
5707
5729
  g.length > 0 && (i.applicantAdditionalDatas = g);
@@ -5710,37 +5732,37 @@ const qe = {
5710
5732
  } catch (i) {
5711
5733
  console.error("Error creating applicant:", i), U(i.message || "Failed to create applicant");
5712
5734
  } finally {
5713
- ge(!1);
5735
+ ye(!1);
5714
5736
  }
5715
5737
  }, Xe = async (i) => {
5716
5738
  var g;
5717
5739
  i.preventDefault();
5718
- for (const b of k)
5719
- if (Ye(N[b])) {
5740
+ for (const b of N)
5741
+ if (Ye(w[b])) {
5720
5742
  const d = ((g = Me[b]) == null ? void 0 : g.label) || b;
5721
5743
  U(`${d} is required.`);
5722
5744
  return;
5723
5745
  }
5724
5746
  await Oe();
5725
5747
  }, be = (i, g, b, d) => {
5726
- var Y;
5727
- const m = Me[i];
5728
- if (!m) return null;
5729
- const C = k.includes(i), _ = $[i], H = b || m.label, y = g ?? i, ae = { required: C };
5730
- switch (m.type) {
5748
+ var q;
5749
+ const p = Me[i];
5750
+ if (!p) return null;
5751
+ const A = N.includes(i), z = O[i], _ = b || p.label, y = g ?? i, ae = { required: A };
5752
+ switch (p.type) {
5731
5753
  case "select":
5732
5754
  if (i === "country" || i === "nationality" || i === "taxCountry" || i === "countryOfBirth" || i === "mobileCountryCode") {
5733
- const le = R(i, d);
5755
+ const le = P(i, d);
5734
5756
  return /* @__PURE__ */ r(
5735
5757
  Re,
5736
5758
  {
5737
5759
  ...ae,
5738
- label: H,
5739
- value: N[i] || "",
5760
+ label: _,
5761
+ value: w[i] || "",
5740
5762
  onChange: (Fe) => se(i, Fe),
5741
- options: [{ value: "", label: `Select ${H.toLowerCase()}...` }, ...le],
5763
+ options: [{ value: "", label: `Select ${_.toLowerCase()}...` }, ...le],
5742
5764
  disabled: E,
5743
- error: _
5765
+ error: z
5744
5766
  },
5745
5767
  y
5746
5768
  );
@@ -5750,8 +5772,8 @@ const qe = {
5750
5772
  Re,
5751
5773
  {
5752
5774
  ...ae,
5753
- label: H,
5754
- value: ((Y = N[i]) == null ? void 0 : Y.toString()) || "",
5775
+ label: _,
5776
+ value: ((q = w[i]) == null ? void 0 : q.toString()) || "",
5755
5777
  onChange: (le) => se(i, le ? Number(le) : null),
5756
5778
  options: [
5757
5779
  { value: "", label: "Select salutation..." },
@@ -5759,7 +5781,7 @@ const qe = {
5759
5781
  { value: Ze.Female.toString(), label: "Female" },
5760
5782
  { value: Ze.Other.toString(), label: "Other" }
5761
5783
  ],
5762
- error: _
5784
+ error: z
5763
5785
  },
5764
5786
  y
5765
5787
  );
@@ -5769,11 +5791,11 @@ const qe = {
5769
5791
  Re,
5770
5792
  {
5771
5793
  ...ae,
5772
- label: H,
5773
- value: N[i] || "",
5794
+ label: _,
5795
+ value: w[i] || "",
5774
5796
  onChange: (Fe) => se(i, Fe),
5775
5797
  options: [{ value: "", label: "Select language..." }, ...le],
5776
- error: _
5798
+ error: z
5777
5799
  },
5778
5800
  y
5779
5801
  );
@@ -5781,13 +5803,13 @@ const qe = {
5781
5803
  return null;
5782
5804
  case "multiselect":
5783
5805
  if (i === "otherNationality") {
5784
- const le = R(i, d);
5806
+ const le = P(i, d);
5785
5807
  return /* @__PURE__ */ r(
5786
5808
  Cr,
5787
5809
  {
5788
5810
  ...ae,
5789
- label: H,
5790
- value: N[i] || [],
5811
+ label: _,
5812
+ value: w[i] || [],
5791
5813
  onChange: (Fe) => se(i, Fe),
5792
5814
  options: le,
5793
5815
  placeholder: "Select other nationalities...",
@@ -5803,10 +5825,10 @@ const qe = {
5803
5825
  {
5804
5826
  ...ae,
5805
5827
  type: "date",
5806
- label: H,
5807
- value: N[i] || "",
5828
+ label: _,
5829
+ value: w[i] || "",
5808
5830
  onChange: (le) => se(i, le.target.value),
5809
- error: _
5831
+ error: z
5810
5832
  },
5811
5833
  y
5812
5834
  );
@@ -5816,10 +5838,10 @@ const qe = {
5816
5838
  {
5817
5839
  ...ae,
5818
5840
  type: "email",
5819
- label: H,
5820
- value: N[i] || "",
5841
+ label: _,
5842
+ value: w[i] || "",
5821
5843
  onChange: (le) => se(i, le.target.value),
5822
- error: _
5844
+ error: z
5823
5845
  },
5824
5846
  y
5825
5847
  );
@@ -5829,10 +5851,10 @@ const qe = {
5829
5851
  {
5830
5852
  ...ae,
5831
5853
  type: "tel",
5832
- label: H,
5833
- value: N[i] || "",
5854
+ label: _,
5855
+ value: w[i] || "",
5834
5856
  onChange: (le) => se(i, le.target.value),
5835
- error: _
5857
+ error: z
5836
5858
  },
5837
5859
  y
5838
5860
  );
@@ -5842,17 +5864,17 @@ const qe = {
5842
5864
  {
5843
5865
  ...ae,
5844
5866
  type: "text",
5845
- label: H,
5846
- value: N[i] || "",
5867
+ label: _,
5868
+ value: w[i] || "",
5847
5869
  onChange: (le) => se(i, le.target.value),
5848
- error: _
5870
+ error: z
5849
5871
  },
5850
5872
  y
5851
5873
  );
5852
5874
  }
5853
5875
  }, et = (i, g) => {
5854
5876
  if (i.customType === "paragraph") {
5855
- const m = i.displayText || i.label || "";
5877
+ const p = i.displayText || i.label || "";
5856
5878
  return /* @__PURE__ */ r(
5857
5879
  "p",
5858
5880
  {
@@ -5863,7 +5885,7 @@ const qe = {
5863
5885
  margin: 0,
5864
5886
  color: "var(--metakyc-text-secondary, #6b7280)"
5865
5887
  },
5866
- dangerouslySetInnerHTML: { __html: m }
5888
+ dangerouslySetInnerHTML: { __html: p }
5867
5889
  },
5868
5890
  `custom-${g}`
5869
5891
  );
@@ -5879,7 +5901,7 @@ const qe = {
5879
5901
  if (i.customType === "br")
5880
5902
  return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${g}`);
5881
5903
  if (i.customType === "link") {
5882
- const m = i.displayText || i.label || i.linkText || i.linkUrl || "";
5904
+ const p = i.displayText || i.label || i.linkText || i.linkUrl || "";
5883
5905
  return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ o(
5884
5906
  "a",
5885
5907
  {
@@ -5896,14 +5918,14 @@ const qe = {
5896
5918
  cursor: "pointer"
5897
5919
  },
5898
5920
  children: [
5899
- m,
5921
+ p,
5900
5922
  /* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
5901
5923
  ]
5902
5924
  }
5903
5925
  ) }, `custom-${g}`);
5904
5926
  }
5905
5927
  if (!i.paramName) return null;
5906
- const b = $[i.paramName], d = i.displayText || i.label || i.paramName;
5928
+ const b = O[i.paramName], d = i.displayText || i.label || i.paramName;
5907
5929
  if (i.customType === "checkbox")
5908
5930
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
5909
5931
  /* @__PURE__ */ o(
@@ -5916,8 +5938,8 @@ const qe = {
5916
5938
  "input",
5917
5939
  {
5918
5940
  type: "checkbox",
5919
- checked: B[i.paramName] === "true",
5920
- onChange: (m) => M(i.paramName, m.target.checked ? "true" : "false"),
5941
+ checked: W[i.paramName] === "true",
5942
+ onChange: (p) => M(i.paramName, p.target.checked ? "true" : "false"),
5921
5943
  className: "metakyc-option-input",
5922
5944
  style: qe
5923
5945
  }
@@ -5950,8 +5972,8 @@ const qe = {
5950
5972
  "input",
5951
5973
  {
5952
5974
  type: "checkbox",
5953
- checked: B[i.paramName] === "true",
5954
- onChange: (m) => M(i.paramName, m.target.checked ? "true" : "false"),
5975
+ checked: W[i.paramName] === "true",
5976
+ onChange: (p) => M(i.paramName, p.target.checked ? "true" : "false"),
5955
5977
  className: "metakyc-option-input",
5956
5978
  style: { ...qe, alignSelf: "flex-start", marginTop: "2px" }
5957
5979
  }
@@ -5972,7 +5994,7 @@ const qe = {
5972
5994
  rel: "noopener noreferrer",
5973
5995
  className: "underline",
5974
5996
  style: { color: "var(--metakyc-primary, #2563eb)" },
5975
- onClick: (m) => m.stopPropagation(),
5997
+ onClick: (p) => p.stopPropagation(),
5976
5998
  children: i.linkText || i.linkUrl
5977
5999
  }
5978
6000
  ),
@@ -5986,7 +6008,7 @@ const qe = {
5986
6008
  b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: b })
5987
6009
  ] }, `custom-${g}`);
5988
6010
  if (i.customType === "group_checkbox") {
5989
- const m = (B[i.paramName] || "").split(",").filter(Boolean);
6011
+ const p = (W[i.paramName] || "").split(",").filter(Boolean);
5990
6012
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
5991
6013
  /* @__PURE__ */ o(
5992
6014
  "div",
@@ -5999,8 +6021,8 @@ const qe = {
5999
6021
  ]
6000
6022
  }
6001
6023
  ),
6002
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((C) => {
6003
- const _ = i.singleSelect ? B[i.paramName] === C.value : m.includes(C.value);
6024
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((A) => {
6025
+ const z = i.singleSelect ? W[i.paramName] === A.value : p.includes(A.value);
6004
6026
  return /* @__PURE__ */ o(
6005
6027
  "label",
6006
6028
  {
@@ -6011,12 +6033,12 @@ const qe = {
6011
6033
  "input",
6012
6034
  {
6013
6035
  type: "checkbox",
6014
- checked: _,
6015
- onChange: (H) => {
6036
+ checked: z,
6037
+ onChange: (_) => {
6016
6038
  if (i.singleSelect)
6017
- M(i.paramName, H.target.checked ? C.value : "");
6039
+ M(i.paramName, _.target.checked ? A.value : "");
6018
6040
  else {
6019
- const y = H.target.checked ? [...m, C.value] : m.filter((ae) => ae !== C.value);
6041
+ const y = _.target.checked ? [...p, A.value] : p.filter((ae) => ae !== A.value);
6020
6042
  M(i.paramName, y.join(","));
6021
6043
  }
6022
6044
  },
@@ -6029,12 +6051,12 @@ const qe = {
6029
6051
  {
6030
6052
  className: "metakyc-option-text",
6031
6053
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
6032
- children: C.label
6054
+ children: A.label
6033
6055
  }
6034
6056
  )
6035
6057
  ]
6036
6058
  },
6037
- C.value
6059
+ A.value
6038
6060
  );
6039
6061
  }) }),
6040
6062
  b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: b })
@@ -6052,7 +6074,7 @@ const qe = {
6052
6074
  ]
6053
6075
  }
6054
6076
  ),
6055
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((m) => /* @__PURE__ */ o(
6077
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((p) => /* @__PURE__ */ o(
6056
6078
  "label",
6057
6079
  {
6058
6080
  className: "metakyc-option-label",
@@ -6062,8 +6084,8 @@ const qe = {
6062
6084
  "input",
6063
6085
  {
6064
6086
  type: "radio",
6065
- checked: B[i.paramName] === m.value,
6066
- onChange: () => M(i.paramName, m.value),
6087
+ checked: W[i.paramName] === p.value,
6088
+ onChange: () => M(i.paramName, p.value),
6067
6089
  name: `radio-group-${i.paramName}-${g}`,
6068
6090
  className: "metakyc-option-input",
6069
6091
  style: qe
@@ -6074,12 +6096,12 @@ const qe = {
6074
6096
  {
6075
6097
  className: "metakyc-option-text",
6076
6098
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
6077
- children: m.label
6099
+ children: p.label
6078
6100
  }
6079
6101
  )
6080
6102
  ]
6081
6103
  },
6082
- m.value
6104
+ p.value
6083
6105
  )) }),
6084
6106
  b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: b })
6085
6107
  ] }, `custom-${g}`) : /* @__PURE__ */ r(
@@ -6087,8 +6109,8 @@ const qe = {
6087
6109
  {
6088
6110
  type: "text",
6089
6111
  label: `${d}${i.required ? " *" : ""}`,
6090
- value: B[i.paramName] || "",
6091
- onChange: (m) => M(i.paramName, m.target.value),
6112
+ value: W[i.paramName] || "",
6113
+ onChange: (p) => M(i.paramName, p.target.value),
6092
6114
  required: i.required,
6093
6115
  error: b
6094
6116
  },
@@ -6124,9 +6146,9 @@ const qe = {
6124
6146
  ]
6125
6147
  }
6126
6148
  ) }),
6127
- b && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: i.fields.map((d, m) => {
6128
- const C = d.colSpan === 1 ? "col-span-1" : d.colSpan === 2 ? "col-span-2" : d.colSpan === 3 ? "col-span-3" : "col-span-4", _ = d.isCustom ? `custom-${m}-${d.paramName}` : `builtin-${d.name}-${m}`;
6129
- return /* @__PURE__ */ r("div", { className: C, children: /* @__PURE__ */ r(pt, { helpText: d.helpText, children: d.isCustom ? et(d, m) : be(d.name, _, d.displayText, d.countriesType) }) }, _);
6149
+ b && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: i.fields.map((d, p) => {
6150
+ const A = d.colSpan === 1 ? "col-span-1" : d.colSpan === 2 ? "col-span-2" : d.colSpan === 3 ? "col-span-3" : "col-span-4", z = d.isCustom ? `custom-${p}-${d.paramName}` : `builtin-${d.name}-${p}`;
6151
+ return /* @__PURE__ */ r("div", { className: A, children: /* @__PURE__ */ r(pt, { helpText: d.helpText, children: d.isCustom ? et(d, p) : be(d.name, z, d.displayText, d.countriesType) }) }, z);
6130
6152
  }) })
6131
6153
  ] });
6132
6154
  };
@@ -6136,7 +6158,7 @@ const qe = {
6136
6158
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
6137
6159
  ] }) }) });
6138
6160
  if (f) {
6139
- const i = f[W] ?? f[0], g = Ce === -1, b = ie === -1, d = f.length, m = Z(i), C = Object.values($);
6161
+ const i = f[B] ?? f[0], g = Ae === -1, b = ie === -1, d = f.length, p = Z(i), A = Object.values(O);
6140
6162
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(j, { children: [
6141
6163
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
6142
6164
  /* @__PURE__ */ o(K, { children: [
@@ -6166,25 +6188,25 @@ const qe = {
6166
6188
  }
6167
6189
  )
6168
6190
  ] }),
6169
- (S || C.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
6170
- S && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
6191
+ (C || A.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
6192
+ C && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
6171
6193
  /* @__PURE__ */ r("strong", { children: "Error:" }),
6172
6194
  " ",
6173
- S
6195
+ C
6174
6196
  ] }),
6175
- C.map((_, H) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: _ }, H))
6197
+ A.map((z, _) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: z }, _))
6176
6198
  ] }),
6177
6199
  d > 1 && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-4", children: [
6178
- f.map((_, H) => /* @__PURE__ */ r(
6200
+ f.map((z, _) => /* @__PURE__ */ r(
6179
6201
  "div",
6180
6202
  {
6181
- className: `h-1.5 rounded-full transition-all ${H === W ? "flex-1" : "w-8"}`,
6182
- style: H === W ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : H < W ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
6203
+ className: `h-1.5 rounded-full transition-all ${_ === B ? "flex-1" : "w-8"}`,
6204
+ style: _ === B ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : _ < B ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
6183
6205
  },
6184
- H
6206
+ _
6185
6207
  )),
6186
6208
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
6187
- W + 1,
6209
+ B + 1,
6188
6210
  " / ",
6189
6211
  d
6190
6212
  ] })
@@ -6194,26 +6216,26 @@ const qe = {
6194
6216
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
6195
6217
  /* @__PURE__ */ o("div", { children: [
6196
6218
  !g && /* @__PURE__ */ r(
6197
- q,
6219
+ Q,
6198
6220
  {
6199
6221
  type: "button",
6200
6222
  variant: "outline",
6201
6223
  onClick: () => {
6202
- O(Ce), J({});
6224
+ T(Ae), G({});
6203
6225
  },
6204
6226
  disabled: te || h,
6205
6227
  children: "Previous"
6206
6228
  }
6207
6229
  ),
6208
- g && a && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: a, disabled: te || h, children: "Cancel" })
6230
+ g && a && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: a, disabled: te || h, children: "Cancel" })
6209
6231
  ] }),
6210
6232
  /* @__PURE__ */ r(
6211
- q,
6233
+ Q,
6212
6234
  {
6213
6235
  type: "button",
6214
6236
  isLoading: te || h,
6215
6237
  onClick: b ? Oe : pe,
6216
- children: b ? i.conditionalOn && !m ? "Skip & Submit" : "Submit" : i.conditionalOn && !m ? "Skip" : "Next"
6238
+ children: b ? i.conditionalOn && !p ? "Skip & Submit" : "Submit" : i.conditionalOn && !p ? "Skip" : "Next"
6217
6239
  }
6218
6240
  )
6219
6241
  ] })
@@ -6222,19 +6244,19 @@ const qe = {
6222
6244
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Xe, children: /* @__PURE__ */ o(j, { children: [
6223
6245
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
6224
6246
  /* @__PURE__ */ o(K, { children: [
6225
- S && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
6247
+ C && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
6226
6248
  /* @__PURE__ */ r("strong", { children: "Error:" }),
6227
6249
  " ",
6228
- S
6250
+ C
6229
6251
  ] }) }),
6230
6252
  /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: x.map((i) => /* @__PURE__ */ r("div", { className: "col-span-4", children: be(i) }, i)) })
6231
6253
  ] }),
6232
6254
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
6233
- a && /* @__PURE__ */ r(q, { type: "button", variant: "outline", onClick: a, disabled: te || h, children: "Cancel" }),
6234
- /* @__PURE__ */ r(q, { type: "submit", isLoading: te || h, children: "Create Applicant" })
6255
+ a && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: a, disabled: te || h, children: "Cancel" }),
6256
+ /* @__PURE__ */ r(Q, { type: "submit", isLoading: te || h, children: "Create Applicant" })
6235
6257
  ] })
6236
6258
  ] }) }) });
6237
- }, yn = ({
6259
+ }, bn = ({
6238
6260
  applicantId: e,
6239
6261
  onComplete: t,
6240
6262
  onError: n,
@@ -6246,22 +6268,22 @@ const qe = {
6246
6268
  currentStep: c,
6247
6269
  steps: u,
6248
6270
  workflowKey: h,
6249
- nextWorkflowKey: p,
6271
+ nextWorkflowKey: m,
6250
6272
  hasWorkflowChanged: v,
6251
- isLoading: I,
6273
+ isLoading: S,
6252
6274
  error: f,
6253
- moveBack: k,
6275
+ moveBack: N,
6254
6276
  refreshProgress: x
6255
- } = xr(e), [D, P] = fe.useState(!1);
6256
- if (fe.useEffect(() => {
6277
+ } = xr(e), [D, F] = xe.useState(!1);
6278
+ if (xe.useEffect(() => {
6257
6279
  f && n && n(f);
6258
- }, [f, n]), fe.useEffect(() => {
6280
+ }, [f, n]), xe.useEffect(() => {
6259
6281
  l != null && l.workflowResult && t && t(l.workflowResult);
6260
- }, [l == null ? void 0 : l.workflowResult, t]), fe.useEffect(() => {
6282
+ }, [l == null ? void 0 : l.workflowResult, t]), xe.useEffect(() => {
6261
6283
  a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
6262
- }, [a]), fe.useEffect(() => {
6263
- v && P(!1);
6264
- }, [v]), I || !l)
6284
+ }, [a]), xe.useEffect(() => {
6285
+ v && F(!1);
6286
+ }, [v]), S || !l)
6265
6287
  return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
6266
6288
  /* @__PURE__ */ r(we, { className: "my-8" }),
6267
6289
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
@@ -6285,7 +6307,7 @@ const qe = {
6285
6307
  /* @__PURE__ */ r("svg", { className: "w-6 h-6 text-gray-400 mx-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
6286
6308
  /* @__PURE__ */ o("div", { className: "text-right", children: [
6287
6309
  /* @__PURE__ */ r("p", { className: "text-gray-500 dark:text-gray-400 mb-1", children: "New Workflow" }),
6288
- /* @__PURE__ */ r("p", { className: "font-medium text-blue-600 dark:text-blue-400", children: p })
6310
+ /* @__PURE__ */ r("p", { className: "font-medium text-blue-600 dark:text-blue-400", children: m })
6289
6311
  ] })
6290
6312
  ] }),
6291
6313
  l.nextWorkflowName && /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-2 text-xs", children: l.nextWorkflowName })
@@ -6293,7 +6315,7 @@ const qe = {
6293
6315
  /* @__PURE__ */ r(
6294
6316
  "button",
6295
6317
  {
6296
- onClick: () => P(!0),
6318
+ onClick: () => F(!0),
6297
6319
  className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
6298
6320
  children: "Continue with New Workflow"
6299
6321
  }
@@ -6318,97 +6340,97 @@ const qe = {
6318
6340
  /* @__PURE__ */ r(we, { className: "my-8" }),
6319
6341
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status === ke.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
6320
6342
  ] }) }) });
6321
- const A = (F) => {
6322
- switch (F) {
6323
- case V.Overview:
6343
+ const R = (L) => {
6344
+ switch (L) {
6345
+ case J.Overview:
6324
6346
  return "Overview";
6325
- case V.Questionaries:
6347
+ case J.Questionaries:
6326
6348
  return "Questionnaire";
6327
- case V.UploadDocument:
6349
+ case J.UploadDocument:
6328
6350
  return "Documents";
6329
- case V.IdentitySdk:
6351
+ case J.IdentitySdk:
6330
6352
  return "Identity";
6331
- case V.RiskScoring:
6353
+ case J.RiskScoring:
6332
6354
  return "Risk Assessment";
6333
- case V.InvestorCategorization:
6355
+ case J.InvestorCategorization:
6334
6356
  return "Investor Categorization";
6335
- case V.AppropriatenessTest:
6357
+ case J.AppropriatenessTest:
6336
6358
  return "Appropriateness Test";
6337
- case V.AdditionalData:
6359
+ case J.AdditionalData:
6338
6360
  return "Additional Data";
6339
- case V.ManualReview:
6361
+ case J.ManualReview:
6340
6362
  return "Review";
6341
6363
  default:
6342
6364
  return "";
6343
6365
  }
6344
- }, z = () => {
6345
- const F = u.filter((N) => N.visibility !== !1), Q = F.findIndex((N) => N.order === c.order), X = Q >= 0 ? Q + 1 : 1, R = F.length;
6366
+ }, $ = () => {
6367
+ const L = u.filter((w) => w.visibility !== !1), Y = L.findIndex((w) => w.order === c.order), X = Y >= 0 ? Y + 1 : 1, P = L.length;
6346
6368
  return /* @__PURE__ */ o("div", { className: "mb-6", children: [
6347
6369
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
6348
6370
  /* @__PURE__ */ r(at, {}),
6349
- /* @__PURE__ */ o(Ae, { variant: l.status === 1 ? "info" : "success", children: [
6371
+ /* @__PURE__ */ o(Ie, { variant: l.status === 1 ? "info" : "success", children: [
6350
6372
  "Step ",
6351
6373
  X,
6352
6374
  " of ",
6353
- R
6375
+ P
6354
6376
  ] })
6355
6377
  ] }),
6356
- /* @__PURE__ */ r("div", { className: "flex items-center", children: F.map((N, L) => {
6357
- const B = L < Q, T = N.order === c.order;
6358
- return /* @__PURE__ */ o(fe.Fragment, { children: [
6378
+ /* @__PURE__ */ r("div", { className: "flex items-center", children: L.map((w, H) => {
6379
+ const W = H < Y, I = w.order === c.order;
6380
+ return /* @__PURE__ */ o(xe.Fragment, { children: [
6359
6381
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
6360
6382
  /* @__PURE__ */ r(
6361
6383
  "div",
6362
6384
  {
6363
6385
  className: `
6364
6386
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
6365
- ${B || T ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
6387
+ ${W || I ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
6366
6388
  `,
6367
- children: L + 1
6389
+ children: H + 1
6368
6390
  }
6369
6391
  ),
6370
6392
  /* @__PURE__ */ r(
6371
6393
  "span",
6372
6394
  {
6373
- className: `ml-2 text-sm ${T ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
6374
- children: N.displayName || N.name || A(N.action) || `Step ${L + 1}`
6395
+ className: `ml-2 text-sm ${I ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
6396
+ children: w.displayName || w.name || R(w.action) || `Step ${H + 1}`
6375
6397
  }
6376
6398
  )
6377
6399
  ] }),
6378
- L < F.length - 1 && /* @__PURE__ */ r(
6400
+ H < L.length - 1 && /* @__PURE__ */ r(
6379
6401
  "div",
6380
6402
  {
6381
- className: `flex-1 h-0.5 mx-4 ${B ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
6403
+ className: `flex-1 h-0.5 mx-4 ${W ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
6382
6404
  }
6383
6405
  )
6384
- ] }, N.order);
6406
+ ] }, w.order);
6385
6407
  }) })
6386
6408
  ] });
6387
6409
  }, E = () => {
6388
- const F = {
6410
+ const L = {
6389
6411
  applicantId: e,
6390
6412
  onComplete: async () => {
6391
6413
  await x();
6392
6414
  },
6393
- onBack: c.order > 0 ? k : void 0
6415
+ onBack: c.order > 0 ? N : void 0
6394
6416
  };
6395
6417
  switch (c.action) {
6396
- case V.Questionaries:
6397
- return /* @__PURE__ */ r($r, { ...F });
6398
- case V.UploadDocument:
6399
- return /* @__PURE__ */ r(Br, { ...F });
6400
- case V.Overview:
6401
- return /* @__PURE__ */ r(_r, { ...F });
6402
- case V.IdentitySdk:
6403
- return /* @__PURE__ */ r(Qr, { ...F });
6404
- case V.RiskScoring:
6405
- return /* @__PURE__ */ r(Kr, { ...F });
6406
- case V.AdditionalData:
6407
- case V.InvestorCategorization:
6408
- return /* @__PURE__ */ r(Yr, { ...F });
6409
- case V.AppropriatenessTest:
6410
- return /* @__PURE__ */ r(qr, { ...F });
6411
- case V.ManualReview:
6418
+ case J.Questionaries:
6419
+ return /* @__PURE__ */ r($r, { ...L });
6420
+ case J.UploadDocument:
6421
+ return /* @__PURE__ */ r(Br, { ...L });
6422
+ case J.Overview:
6423
+ return /* @__PURE__ */ r(_r, { ...L });
6424
+ case J.IdentitySdk:
6425
+ return /* @__PURE__ */ r(Jr, { ...L });
6426
+ case J.RiskScoring:
6427
+ return /* @__PURE__ */ r(qr, { ...L });
6428
+ case J.AdditionalData:
6429
+ case J.InvestorCategorization:
6430
+ return /* @__PURE__ */ r(Gr, { ...L });
6431
+ case J.AppropriatenessTest:
6432
+ return /* @__PURE__ */ r(Vr, { ...L });
6433
+ case J.ManualReview:
6412
6434
  return /* @__PURE__ */ r(
6413
6435
  mt,
6414
6436
  {
@@ -6427,23 +6449,23 @@ const qe = {
6427
6449
  ] }),
6428
6450
  /* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
6429
6451
  "Action type: ",
6430
- V[c.action]
6452
+ J[c.action]
6431
6453
  ] })
6432
6454
  ] }) });
6433
6455
  }
6434
6456
  };
6435
6457
  return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
6436
- z(),
6458
+ $(),
6437
6459
  E()
6438
6460
  ] });
6439
6461
  };
6440
- function fn(e) {
6441
- return Se.object({
6442
- questionResults: Se.any()
6462
+ function vn(e) {
6463
+ return Ce.object({
6464
+ questionResults: Ce.any()
6443
6465
  }).passthrough();
6444
6466
  }
6445
- function Vr(e) {
6446
- let t = Se.array(Se.instanceof(File));
6467
+ function Xr(e) {
6468
+ let t = Ce.array(Ce.instanceof(File));
6447
6469
  if (e.isRequired ? t = t.min(
6448
6470
  1,
6449
6471
  `${e.displayName} is required`
@@ -6464,27 +6486,27 @@ function Vr(e) {
6464
6486
  }
6465
6487
  return t;
6466
6488
  }
6467
- function xn(e) {
6489
+ function kn(e) {
6468
6490
  const t = {};
6469
6491
  return e.uploadDocumentFiles.forEach((n) => {
6470
6492
  const a = `file_${n.id}`;
6471
- t[a] = Vr(n);
6472
- }), Se.object(t);
6493
+ t[a] = Xr(n);
6494
+ }), Ce.object(t);
6473
6495
  }
6474
- function bn(e) {
6475
- return Se.any();
6496
+ function wn(e) {
6497
+ return Ce.any();
6476
6498
  }
6477
- function Jr(e) {
6478
- return Se.string().min(1, "This question is required");
6499
+ function en(e) {
6500
+ return Ce.string().min(1, "This question is required");
6479
6501
  }
6480
- function vn(e) {
6502
+ function Nn(e) {
6481
6503
  const t = {};
6482
6504
  return e.appropriatenessQuestions.forEach((n) => {
6483
6505
  const a = `question_${n.id}`;
6484
- t[a] = Jr();
6485
- }), Se.object(t);
6506
+ t[a] = en();
6507
+ }), Ce.object(t);
6486
6508
  }
6487
- const kn = Se.any();
6509
+ const Sn = Ce.any();
6488
6510
  export {
6489
6511
  lt as ALLOWED_LANGUAGES,
6490
6512
  It as ApplicantProgressOnHoldReason,
@@ -6493,24 +6515,24 @@ export {
6493
6515
  Rt as ApplicantStatus,
6494
6516
  Dt as AppropriatenessQuestionType,
6495
6517
  Wt as AppropriatenessTestService,
6496
- qr as AppropriatenessTestStep,
6497
- Ae as Badge,
6518
+ Vr as AppropriatenessTestStep,
6519
+ Ie as Badge,
6498
6520
  Gt as BaseInformationService,
6499
- q as Button,
6521
+ Q as Button,
6500
6522
  j as Card,
6501
6523
  K as CardContent,
6502
6524
  me as CardFooter,
6503
6525
  ue as CardHeader,
6504
6526
  $e as CountriesType,
6505
- gn as CreateApplicantForm,
6527
+ xn as CreateApplicantForm,
6506
6528
  Ot as CriteriaBuiltInType,
6507
6529
  zt as DEFAULT_VISIBLE_FIELDS,
6508
- Lt as DocumentReviewStatus,
6530
+ Tt as DocumentReviewStatus,
6509
6531
  _t as EndpointBuilder,
6510
6532
  Ke as ErrorHandler,
6511
6533
  ar as EventEmitter,
6512
6534
  Me as FIELD_METADATA,
6513
- Tt as FileType,
6535
+ Lt as FileType,
6514
6536
  Ar as FileUpload,
6515
6537
  Ze as GenderType,
6516
6538
  at as Header,
@@ -6518,20 +6540,20 @@ export {
6518
6540
  ze as IdentityProviderManager,
6519
6541
  Qt as IdentityService,
6520
6542
  ve as IdentityVerificationProvider,
6521
- Qr as IdentityVerificationStep,
6543
+ Jr as IdentityVerificationStep,
6522
6544
  de as Input,
6523
6545
  Vt as InvestorCategorizationService,
6524
- Yr as InvestorCategorizationStep,
6525
- ye as InvestorCategorizationType,
6546
+ Gr as InvestorCategorizationStep,
6547
+ fe as InvestorCategorizationType,
6526
6548
  $t as InvestorCategoryType,
6527
6549
  Pt as KycProcessStatus,
6528
- Le as KycStatus,
6550
+ Te as KycStatus,
6529
6551
  mt as KycStatusDisplay,
6530
- yn as KycWorkflow,
6531
- Gr as Logo,
6552
+ bn as KycWorkflow,
6553
+ Zr as Logo,
6532
6554
  gt as MetaKYCContext,
6533
6555
  Ne as MetaKYCError,
6534
- ln as MetaKYCProvider,
6556
+ un as MetaKYCProvider,
6535
6557
  Cr as MultiSelect,
6536
6558
  cr as OnfidoProvider,
6537
6559
  Yt as OverviewService,
@@ -6543,7 +6565,7 @@ export {
6543
6565
  Mt as RiskCriteriaType,
6544
6566
  Et as RiskLevel,
6545
6567
  qt as RiskScoringService,
6546
- Kr as RiskScoringStep,
6568
+ qr as RiskScoringStep,
6547
6569
  dr as SardinAIProvider,
6548
6570
  Re as SearchableSelect,
6549
6571
  st as Select,
@@ -6556,13 +6578,13 @@ export {
6556
6578
  Kt as UploadDocumentService,
6557
6579
  Br as UploadDocumentStep,
6558
6580
  Ft as UserType,
6559
- Ee as ValueDataType,
6581
+ Se as ValueDataType,
6560
6582
  or as WorkflowOrchestrator,
6561
6583
  Je as WorkflowResultType,
6562
6584
  ir as WorkflowState,
6563
- V as WorkflowStepAction,
6564
- kn as appropriatenessTestSchema,
6565
- pn as clearAllStorage,
6585
+ J as WorkflowStepAction,
6586
+ Sn as appropriatenessTestSchema,
6587
+ yn as clearAllStorage,
6566
6588
  gr as clearApplicantId,
6567
6589
  fr as clearWorkflowState,
6568
6590
  oe as cn,
@@ -6572,33 +6594,33 @@ export {
6572
6594
  mr as fileToBase64,
6573
6595
  Zt as fintechTheme,
6574
6596
  rt as formatFileSize,
6575
- vn as generateAppropriatenessSchema,
6576
- fn as generateQuestionnaireSchema,
6577
- bn as generateRiskScoringSchema,
6578
- xn as generateUploadDocumentSchema,
6579
- un as getAcceptString,
6597
+ Nn as generateAppropriatenessSchema,
6598
+ vn as generateQuestionnaireSchema,
6599
+ wn as generateRiskScoringSchema,
6600
+ kn as generateUploadDocumentSchema,
6601
+ hn as getAcceptString,
6580
6602
  hr as getApplicantId,
6581
6603
  We as getThemePreset,
6582
- mn as getWorkflowState,
6604
+ gn as getWorkflowState,
6583
6605
  Xt as healthcareTheme,
6584
- sn as isScriptLoaded,
6606
+ cn as isScriptLoaded,
6585
6607
  ht as loadScript,
6586
6608
  tr as minimalTheme,
6587
6609
  er as modernTheme,
6588
- on as removeScript,
6610
+ dn as removeScript,
6589
6611
  pr as saveApplicantId,
6590
6612
  yr as saveWorkflowState,
6591
6613
  rr as themePresets,
6592
6614
  Sr as useApplicant,
6593
- hn as useAppropriatenessTest,
6615
+ fn as useAppropriatenessTest,
6594
6616
  wr as useIdentityVerification,
6595
6617
  xr as useKycWorkflow,
6596
- xe as useMetaKYC,
6618
+ ge as useMetaKYC,
6597
6619
  kr as useOverview,
6598
6620
  br as useQuestionnaire,
6599
6621
  Nr as useRiskScoring,
6600
6622
  vr as useUploadDocument,
6601
- cn as validateFileSize,
6602
- dn as validateFileType
6623
+ mn as validateFileSize,
6624
+ pn as validateFileType
6603
6625
  };
6604
6626
  //# sourceMappingURL=index.js.map