@vpdev2/metakyc-sdk 1.0.16 → 1.0.17

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,11 +3,11 @@ var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writ
3
3
  var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
4
4
  import et from "axios";
5
5
  import * as Me from "react";
6
- import ie, { createContext as tt, useState as N, useMemo as Re, useEffect as Y, useContext as rt, useRef as H, useCallback as q, forwardRef as Le } from "react";
6
+ import ie, { createContext as tt, useState as N, useMemo as Re, useEffect as W, useContext as rt, useRef as H, useCallback as q, forwardRef as Le } from "react";
7
7
  import { jsx as n, jsxs as o, Fragment as nt } from "react/jsx-runtime";
8
8
  import { get as De, set as Ee, appendErrors as _e, useForm as Te, Controller as J } from "react-hook-form";
9
9
  import { z as ue } from "zod";
10
- var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}), Ne = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(Ne || {}), le = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(le || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), pe = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(pe || {}), ge = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(ge || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), oe = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(oe || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), Se = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Se || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), Pe = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Pe || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), re = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(re || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
10
+ var B = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(B || {}), Ne = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(Ne || {}), le = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(le || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), pe = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(pe || {}), ge = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(ge || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), oe = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(oe || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), Se = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Se || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), Pe = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Pe || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), re = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(re || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
11
11
  const gt = [
12
12
  "firstName",
13
13
  "lastName",
@@ -71,7 +71,7 @@ const gt = [
71
71
  taxNumber: { label: "Tax Number", type: "text" },
72
72
  externalRefId: { label: "External Reference ID", type: "text" }
73
73
  };
74
- var W = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(W || {});
74
+ var Q = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(Q || {});
75
75
  const ft = {
76
76
  timeout: 3e4,
77
77
  retries: 3,
@@ -880,12 +880,12 @@ const Z = {
880
880
  inputHeight: "2.25rem"
881
881
  }
882
882
  }, Tt = {
883
- [W.Default]: Z,
884
- [W.Corporate]: Rt,
885
- [W.Fintech]: Dt,
886
- [W.Healthcare]: Pt,
887
- [W.Modern]: Ft,
888
- [W.Minimal]: Lt
883
+ [Q.Default]: Z,
884
+ [Q.Corporate]: Rt,
885
+ [Q.Fintech]: Dt,
886
+ [Q.Healthcare]: Pt,
887
+ [Q.Modern]: Ft,
888
+ [Q.Minimal]: Lt
889
889
  };
890
890
  function xe(t) {
891
891
  return Tt[t] || Z;
@@ -905,8 +905,8 @@ class Mt {
905
905
  "GetThemeConfiguration"
906
906
  );
907
907
  if (!r.result.isEnabled)
908
- return xe(W.Default);
909
- let s = r.result.preset ? xe(r.result.preset) : xe(W.Default);
908
+ return xe(Q.Default);
909
+ let s = r.result.preset ? xe(r.result.preset) : xe(Q.Default);
910
910
  return r.result.title && (s.title = r.result.title), r.result.logo && (s.logo = { ...s.logo, ...r.result.logo }), r.result.colors && (s.colors = { ...s.colors, ...r.result.colors }), r.result.typography && (s.typography = { ...s.typography, ...r.result.typography }), r.result.spacing && (s.spacing = { ...s.spacing, ...r.result.spacing }), r.result.customCSS && (s.customCSS = r.result.customCSS), r.result.darkMode && (s.darkMode = {
911
911
  colors: {
912
912
  ...(e = s.darkMode) == null ? void 0 : e.colors,
@@ -914,7 +914,7 @@ class Mt {
914
914
  }
915
915
  }), s;
916
916
  } catch (r) {
917
- return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(W.Default);
917
+ return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(Q.Default);
918
918
  }
919
919
  }
920
920
  /**
@@ -928,12 +928,12 @@ class Mt {
928
928
  */
929
929
  getAvailablePresets() {
930
930
  return [
931
- { id: W.Default, name: "Default" },
932
- { id: W.Corporate, name: "Corporate" },
933
- { id: W.Fintech, name: "Fintech" },
934
- { id: W.Healthcare, name: "Healthcare" },
935
- { id: W.Modern, name: "Modern" },
936
- { id: W.Minimal, name: "Minimal" }
931
+ { id: Q.Default, name: "Default" },
932
+ { id: Q.Corporate, name: "Corporate" },
933
+ { id: Q.Fintech, name: "Fintech" },
934
+ { id: Q.Healthcare, name: "Healthcare" },
935
+ { id: Q.Modern, name: "Modern" },
936
+ { id: Q.Minimal, name: "Minimal" }
937
937
  ];
938
938
  }
939
939
  /**
@@ -1164,7 +1164,7 @@ class zt {
1164
1164
  async loadStepData(e, r) {
1165
1165
  const s = this.getHandler(e);
1166
1166
  if (!s)
1167
- throw new Error(`No handler registered for step action: ${U[e]}`);
1167
+ throw new Error(`No handler registered for step action: ${B[e]}`);
1168
1168
  return s.loadData(r);
1169
1169
  }
1170
1170
  /**
@@ -1173,7 +1173,7 @@ class zt {
1173
1173
  async submitStepData(e, r) {
1174
1174
  const s = this.getHandler(e);
1175
1175
  if (!s)
1176
- throw new Error(`No handler registered for step action: ${U[e]}`);
1176
+ throw new Error(`No handler registered for step action: ${B[e]}`);
1177
1177
  return s.submitData(r);
1178
1178
  }
1179
1179
  }
@@ -1187,47 +1187,47 @@ class $t {
1187
1187
  * Register all step handlers
1188
1188
  */
1189
1189
  registerStepHandlers() {
1190
- this.stepRouter.registerHandler(U.Questionaries, {
1190
+ this.stepRouter.registerHandler(B.Questionaries, {
1191
1191
  loadData: (e) => this.questionnaireService.getQuestionnaire(e),
1192
1192
  submitData: async (e) => {
1193
1193
  await this.questionnaireService.fillQuestionnaire(e);
1194
1194
  }
1195
- }), this.stepRouter.registerHandler(U.UploadDocument, {
1195
+ }), this.stepRouter.registerHandler(B.UploadDocument, {
1196
1196
  loadData: (e) => this.uploadDocumentService.getUploadDocument(e),
1197
1197
  submitData: (e) => this.uploadDocumentService.fillUploadDocument(e)
1198
- }), this.stepRouter.registerHandler(U.AppropriatenessTest, {
1198
+ }), this.stepRouter.registerHandler(B.AppropriatenessTest, {
1199
1199
  loadData: (e) => this.appropriatenessTestService.getAppropriatenessTest(e),
1200
1200
  submitData: async (e) => {
1201
1201
  await this.appropriatenessTestService.fillAppropriatenessTest(e);
1202
1202
  }
1203
- }), this.stepRouter.registerHandler(U.Overview, {
1203
+ }), this.stepRouter.registerHandler(B.Overview, {
1204
1204
  loadData: (e) => this.overviewService.getOverviewData(e),
1205
1205
  submitData: (e) => this.overviewService.passOverview(e.applicantId)
1206
- }), this.stepRouter.registerHandler(U.RiskScoring, {
1206
+ }), this.stepRouter.registerHandler(B.RiskScoring, {
1207
1207
  loadData: (e) => this.riskScoringService.getRiskCriterias(e),
1208
1208
  submitData: async (e) => {
1209
1209
  await this.riskScoringService.submitRiskScoring(e);
1210
1210
  }
1211
- }), this.stepRouter.registerHandler(U.IdentitySdk, {
1211
+ }), this.stepRouter.registerHandler(B.IdentitySdk, {
1212
1212
  loadData: async (e) => ({
1213
1213
  applicantId: e,
1214
1214
  message: "Identity verification required"
1215
1215
  }),
1216
1216
  submitData: async () => {
1217
1217
  }
1218
- }), this.stepRouter.registerHandler(U.InvestorCategorization, {
1218
+ }), this.stepRouter.registerHandler(B.InvestorCategorization, {
1219
1219
  loadData: (e) => this.investorCategorizationService.getInvestorCategorization(e),
1220
1220
  submitData: async (e) => {
1221
1221
  await this.investorCategorizationService.setInvestorCategorization(e);
1222
1222
  }
1223
- }), this.stepRouter.registerHandler(U.ManualReview, {
1223
+ }), this.stepRouter.registerHandler(B.ManualReview, {
1224
1224
  loadData: async (e) => ({
1225
1225
  applicantId: e,
1226
1226
  message: "Your application is under manual review"
1227
1227
  }),
1228
1228
  submitData: async () => {
1229
1229
  }
1230
- }), this.stepRouter.registerHandler(U.AdditionalData, {
1230
+ }), this.stepRouter.registerHandler(B.AdditionalData, {
1231
1231
  loadData: async (e) => ({
1232
1232
  applicantId: e,
1233
1233
  message: "Additional data required"
@@ -1321,7 +1321,7 @@ class $t {
1321
1321
  return this.stepRouter;
1322
1322
  }
1323
1323
  }
1324
- function Ke(t, e) {
1324
+ function Ue(t, e) {
1325
1325
  return new Promise((r, s) => {
1326
1326
  if (e && document.getElementById(e)) {
1327
1327
  r();
@@ -1348,7 +1348,7 @@ class jt {
1348
1348
  * Load Sumsub SDK
1349
1349
  */
1350
1350
  async loadSDK() {
1351
- await Ke(
1351
+ await Ue(
1352
1352
  "https://cdn.sumsub.com/websdk/v2/production/websdk.js",
1353
1353
  "sumsub-sdk"
1354
1354
  );
@@ -1403,7 +1403,7 @@ class _t {
1403
1403
  * Load Onfido SDK
1404
1404
  */
1405
1405
  async loadSDK() {
1406
- await Ke(
1406
+ await Ue(
1407
1407
  "https://sdk.onfido.com/v12.0.0/onfido.min.js",
1408
1408
  "onfido-sdk"
1409
1409
  );
@@ -1459,7 +1459,7 @@ class _t {
1459
1459
  this.sdk && (this.sdk.tearDown(), this.sdk = null);
1460
1460
  }
1461
1461
  }
1462
- class Kt {
1462
+ class Ut {
1463
1463
  constructor(e) {
1464
1464
  K(this, "sardineContext", null);
1465
1465
  K(this, "config");
@@ -1614,7 +1614,7 @@ class fe {
1614
1614
  case oe.Onfido:
1615
1615
  return new _t(r);
1616
1616
  case oe.SardinAI:
1617
- return new Kt(r);
1617
+ return new Ut(r);
1618
1618
  default:
1619
1619
  throw new Error(`Unsupported identity provider: ${e}`);
1620
1620
  }
@@ -1653,7 +1653,7 @@ class fe {
1653
1653
  }
1654
1654
  }
1655
1655
  }
1656
- class Ut {
1656
+ class Kt {
1657
1657
  constructor(e) {
1658
1658
  K(this, "currentTheme", Z);
1659
1659
  K(this, "customStyleElement", null);
@@ -1775,22 +1775,22 @@ class Ut {
1775
1775
  return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1776
1776
  }
1777
1777
  }
1778
- const Ue = tt(null), Or = ({ config: t, children: e }) => {
1778
+ const Ke = tt(null), Or = ({ config: t, children: e }) => {
1779
1779
  const [r, s] = N(null), a = ie.useRef(!1), i = ie.useRef(!1), l = Re(() => {
1780
- const d = new vt(t), u = new xt(d), y = new wt(d), x = new kt(d), g = new Nt(d), b = new St(d), m = new Ct(d), f = new At(d), k = new Et(d), h = new It(d), E = new Mt(d), v = new Ut();
1780
+ const d = new vt(t), u = new xt(d), y = new wt(d), v = new kt(d), g = new Nt(d), b = new St(d), m = new Ct(d), f = new At(d), k = new Et(d), h = new It(d), A = new Mt(d), S = new Kt();
1781
1781
  return {
1782
1782
  httpClient: d,
1783
1783
  applicantService: u,
1784
1784
  questionnaireService: y,
1785
- uploadDocumentService: x,
1785
+ uploadDocumentService: v,
1786
1786
  appropriatenessTestService: g,
1787
1787
  overviewService: b,
1788
1788
  riskScoringService: m,
1789
1789
  identityService: f,
1790
1790
  baseInformationService: k,
1791
1791
  investorCategorizationService: h,
1792
- themeService: E,
1793
- themeManager: v
1792
+ themeService: A,
1793
+ themeManager: S
1794
1794
  };
1795
1795
  }, [t]), c = Re(() => ({
1796
1796
  config: t,
@@ -1807,7 +1807,7 @@ const Ue = tt(null), Or = ({ config: t, children: e }) => {
1807
1807
  l.investorCategorizationService
1808
1808
  )
1809
1809
  }), [t, l, r]);
1810
- return Y(() => ((async () => {
1810
+ return W(() => ((async () => {
1811
1811
  if (a.current || i.current) {
1812
1812
  console.log("[MetaKYC] Theme already loading or loaded, skipping...");
1813
1813
  return;
@@ -1828,10 +1828,10 @@ const Ue = tt(null), Or = ({ config: t, children: e }) => {
1828
1828
  }
1829
1829
  })(), () => {
1830
1830
  l.themeManager.cleanup();
1831
- }), []), /* @__PURE__ */ n(Ue.Provider, { value: c, children: e });
1831
+ }), []), /* @__PURE__ */ n(Ke.Provider, { value: c, children: e });
1832
1832
  };
1833
1833
  function se() {
1834
- const t = rt(Ue);
1834
+ const t = rt(Ke);
1835
1835
  if (!t)
1836
1836
  throw new Error("useMetaKYC must be used within a MetaKYCProvider");
1837
1837
  return t;
@@ -1916,25 +1916,25 @@ function Qt() {
1916
1916
  console.warn("Failed to clear workflow state from storage:", t);
1917
1917
  }
1918
1918
  }
1919
- function Kr() {
1919
+ function Ur() {
1920
1920
  Yt(), Qt();
1921
1921
  }
1922
1922
  function Gt(t) {
1923
1923
  const { createOrchestrator: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(null), d = H(null), u = t || Vt();
1924
- Y(() => {
1924
+ W(() => {
1925
1925
  d.current || (d.current = e());
1926
- }, [e]), Y(() => {
1927
- var v;
1926
+ }, [e]), W(() => {
1927
+ var S;
1928
1928
  r && u && (Ht(u), Wt({
1929
1929
  applicantId: u,
1930
- currentStepOrder: (v = r.currentStep) == null ? void 0 : v.order,
1930
+ currentStepOrder: (S = r.currentStep) == null ? void 0 : S.order,
1931
1931
  status: r.status,
1932
1932
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
1933
1933
  workflowKey: r.workFlowKey,
1934
1934
  nextWorkflowKey: r.nextWorkflowKey
1935
1935
  }));
1936
1936
  }, [r, u]);
1937
- const y = H(!1), x = H(!1), g = q(async () => {
1937
+ const y = H(!1), v = H(!1), g = q(async () => {
1938
1938
  if (!(!u || !d.current)) {
1939
1939
  if (y.current) {
1940
1940
  console.log("[Workflow] Load already in progress, skipping...");
@@ -1942,17 +1942,17 @@ function Gt(t) {
1942
1942
  }
1943
1943
  y.current = !0, i(!0), c(null);
1944
1944
  try {
1945
- const v = await d.current.initialize(u);
1946
- s(v), x.current = !0;
1947
- } catch (v) {
1948
- c(v);
1945
+ const S = await d.current.initialize(u);
1946
+ s(S), v.current = !0;
1947
+ } catch (S) {
1948
+ c(S);
1949
1949
  } finally {
1950
1950
  i(!1), y.current = !1;
1951
1951
  }
1952
1952
  }
1953
1953
  }, [u]);
1954
- Y(() => {
1955
- u && !x.current && g();
1954
+ W(() => {
1955
+ u && !v.current && g();
1956
1956
  }, [u, g]);
1957
1957
  const b = q(async () => {
1958
1958
  if (d.current) {
@@ -1962,10 +1962,10 @@ function Gt(t) {
1962
1962
  }
1963
1963
  y.current = !0, i(!0), c(null);
1964
1964
  try {
1965
- const v = await d.current.refreshProgress();
1966
- s(v);
1967
- } catch (v) {
1968
- c(v);
1965
+ const S = await d.current.refreshProgress();
1966
+ s(S);
1967
+ } catch (S) {
1968
+ c(S);
1969
1969
  } finally {
1970
1970
  i(!1), y.current = !1;
1971
1971
  }
@@ -1974,10 +1974,10 @@ function Gt(t) {
1974
1974
  if (d.current) {
1975
1975
  i(!0), c(null);
1976
1976
  try {
1977
- const v = await d.current.moveToNextStep();
1978
- s(v);
1979
- } catch (v) {
1980
- c(v);
1977
+ const S = await d.current.moveToNextStep();
1978
+ s(S);
1979
+ } catch (S) {
1980
+ c(S);
1981
1981
  } finally {
1982
1982
  i(!1);
1983
1983
  }
@@ -1986,28 +1986,28 @@ function Gt(t) {
1986
1986
  if (d.current) {
1987
1987
  i(!0), c(null);
1988
1988
  try {
1989
- const v = await d.current.moveToPreviousStep();
1990
- s(v);
1991
- } catch (v) {
1992
- c(v);
1989
+ const S = await d.current.moveToPreviousStep();
1990
+ s(S);
1991
+ } catch (S) {
1992
+ c(S);
1993
1993
  } finally {
1994
1994
  i(!1);
1995
1995
  }
1996
1996
  }
1997
- }, []), k = q(async (v) => {
1997
+ }, []), k = q(async (S) => {
1998
1998
  if (d.current) {
1999
1999
  i(!0), c(null);
2000
2000
  try {
2001
- await d.current.submitCurrentStep(v);
2002
- const S = await d.current.refreshProgress();
2003
- s(S);
2004
- } catch (S) {
2005
- throw c(S), S;
2001
+ await d.current.submitCurrentStep(S);
2002
+ const w = await d.current.refreshProgress();
2003
+ s(w);
2004
+ } catch (w) {
2005
+ throw c(w), w;
2006
2006
  } finally {
2007
2007
  i(!1);
2008
2008
  }
2009
2009
  }
2010
- }, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((v, S) => v.order - S.order) : [], [r == null ? void 0 : r.stepInfoList]), E = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
2010
+ }, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((S, w) => S.order - w.order) : [], [r == null ? void 0 : r.stepInfoList]), A = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
2011
2011
  return {
2012
2012
  progress: r,
2013
2013
  applicantId: u,
@@ -2017,7 +2017,7 @@ function Gt(t) {
2017
2017
  workflowResult: (r == null ? void 0 : r.workflowResult) || null,
2018
2018
  workflowKey: r == null ? void 0 : r.workFlowKey,
2019
2019
  nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
2020
- hasWorkflowChanged: E,
2020
+ hasWorkflowChanged: A,
2021
2021
  isLoading: a,
2022
2022
  error: l,
2023
2023
  isComplete: (r == null ? void 0 : r.status) === le.Finished,
@@ -2030,7 +2030,7 @@ function Gt(t) {
2030
2030
  };
2031
2031
  }
2032
2032
  function Zt(t) {
2033
- const { questionnaireService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), y = H(!1), x = H(null), g = q(async () => {
2033
+ const { questionnaireService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), y = H(!1), v = H(null), g = q(async () => {
2034
2034
  if (t) {
2035
2035
  if (y.current) {
2036
2036
  console.log("[Questionnaire] Load already in progress, skipping...");
@@ -2039,7 +2039,7 @@ function Zt(t) {
2039
2039
  y.current = !0, i(!0), u(null);
2040
2040
  try {
2041
2041
  const m = await e.getQuestionnaire(t);
2042
- s(m), x.current = t;
2042
+ s(m), v.current = t;
2043
2043
  } catch (m) {
2044
2044
  u(m);
2045
2045
  } finally {
@@ -2047,8 +2047,8 @@ function Zt(t) {
2047
2047
  }
2048
2048
  }
2049
2049
  }, [t, e]);
2050
- Y(() => {
2051
- t && x.current !== t && g();
2050
+ W(() => {
2051
+ t && v.current !== t && g();
2052
2052
  }, [t]);
2053
2053
  const b = q(
2054
2054
  async (m) => {
@@ -2073,33 +2073,33 @@ function Zt(t) {
2073
2073
  };
2074
2074
  }
2075
2075
  function Jt(t) {
2076
- const { uploadDocumentService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(0), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2076
+ const { uploadDocumentService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(0), [y, v] = N(null), g = H(!1), b = H(null), m = q(async () => {
2077
2077
  if (t) {
2078
2078
  if (g.current) {
2079
2079
  console.log("[UploadDocument] Load already in progress, skipping...");
2080
2080
  return;
2081
2081
  }
2082
- g.current = !0, i(!0), x(null);
2082
+ g.current = !0, i(!0), v(null);
2083
2083
  try {
2084
2084
  const k = await e.getUploadDocument(t);
2085
2085
  s(k), b.current = t;
2086
2086
  } catch (k) {
2087
- x(k);
2087
+ v(k);
2088
2088
  } finally {
2089
2089
  i(!1), g.current = !1;
2090
2090
  }
2091
2091
  }
2092
2092
  }, [t, e]);
2093
- Y(() => {
2093
+ W(() => {
2094
2094
  t && b.current !== t && m();
2095
2095
  }, [t]);
2096
2096
  const f = q(
2097
2097
  async (k) => {
2098
- c(!0), u(0), x(null);
2098
+ c(!0), u(0), v(null);
2099
2099
  try {
2100
2100
  await e.fillUploadDocument(k), u(100);
2101
2101
  } catch (h) {
2102
- throw x(h), h;
2102
+ throw v(h), h;
2103
2103
  } finally {
2104
2104
  c(!1);
2105
2105
  }
@@ -2116,8 +2116,8 @@ function Jt(t) {
2116
2116
  submit: f
2117
2117
  };
2118
2118
  }
2119
- function Ur(t) {
2120
- const { appropriatenessTestService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2119
+ function Kr(t) {
2120
+ const { appropriatenessTestService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [y, v] = N(null), g = H(!1), b = H(null), m = q(async () => {
2121
2121
  if (t) {
2122
2122
  if (g.current) {
2123
2123
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
@@ -2134,7 +2134,7 @@ function Ur(t) {
2134
2134
  }
2135
2135
  }
2136
2136
  }, [t, e]);
2137
- Y(() => {
2137
+ W(() => {
2138
2138
  t && b.current !== t && m();
2139
2139
  }, [t]);
2140
2140
  const f = q(
@@ -2142,7 +2142,7 @@ function Ur(t) {
2142
2142
  c(!0), u(null);
2143
2143
  try {
2144
2144
  const h = await e.fillAppropriatenessTest(k);
2145
- return x(h), h;
2145
+ return v(h), h;
2146
2146
  } catch (h) {
2147
2147
  throw u(h), h;
2148
2148
  } finally {
@@ -2162,7 +2162,7 @@ function Ur(t) {
2162
2162
  };
2163
2163
  }
2164
2164
  function Xt(t) {
2165
- const { overviewService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), y = H(!1), x = H(null), g = q(async () => {
2165
+ const { overviewService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), y = H(!1), v = H(null), g = q(async () => {
2166
2166
  if (t) {
2167
2167
  if (y.current) {
2168
2168
  console.log("[Overview] Load already in progress, skipping...");
@@ -2171,7 +2171,7 @@ function Xt(t) {
2171
2171
  y.current = !0, i(!0), u(null);
2172
2172
  try {
2173
2173
  const m = await e.getOverviewData(t);
2174
- s(m), x.current = t;
2174
+ s(m), v.current = t;
2175
2175
  } catch (m) {
2176
2176
  u(m);
2177
2177
  } finally {
@@ -2179,8 +2179,8 @@ function Xt(t) {
2179
2179
  }
2180
2180
  }
2181
2181
  }, [t, e]);
2182
- Y(() => {
2183
- t && x.current !== t && g();
2182
+ W(() => {
2183
+ t && v.current !== t && g();
2184
2184
  }, [t]);
2185
2185
  const b = q(async () => {
2186
2186
  if (t) {
@@ -2253,7 +2253,7 @@ function er(t) {
2253
2253
  }
2254
2254
  },
2255
2255
  [t, e]
2256
- ), x = q(async () => {
2256
+ ), v = q(async () => {
2257
2257
  if (t) {
2258
2258
  if (d.current) {
2259
2259
  console.log("[Identity] Restart already in progress, skipping...");
@@ -2286,11 +2286,11 @@ function er(t) {
2286
2286
  error: l,
2287
2287
  requestIdentity: u,
2288
2288
  requestCompanyIdentity: y,
2289
- restartIdentity: x
2289
+ restartIdentity: v
2290
2290
  };
2291
2291
  }
2292
2292
  function tr(t) {
2293
- const { riskScoringService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2293
+ const { riskScoringService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [l, c] = N(!1), [d, u] = N(null), [y, v] = N(null), g = H(!1), b = H(null), m = q(async () => {
2294
2294
  if (t) {
2295
2295
  if (g.current) {
2296
2296
  console.log("[RiskScoring] Load already in progress, skipping...");
@@ -2307,7 +2307,7 @@ function tr(t) {
2307
2307
  }
2308
2308
  }
2309
2309
  }, [t, e]);
2310
- Y(() => {
2310
+ W(() => {
2311
2311
  t && b.current !== t && m();
2312
2312
  }, [t]);
2313
2313
  const f = q(
@@ -2315,7 +2315,7 @@ function tr(t) {
2315
2315
  c(!0), u(null);
2316
2316
  try {
2317
2317
  const h = await e.submitRiskScoring(k);
2318
- return x(h), h;
2318
+ return v(h), h;
2319
2319
  } catch (h) {
2320
2320
  throw u(h), h;
2321
2321
  } finally {
@@ -2372,7 +2372,7 @@ function rr() {
2372
2372
  }
2373
2373
  },
2374
2374
  [t]
2375
- ), x = q(
2375
+ ), v = q(
2376
2376
  async (b) => {
2377
2377
  if (c.current)
2378
2378
  throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
@@ -2404,11 +2404,11 @@ function rr() {
2404
2404
  error: a,
2405
2405
  createApplicant: u,
2406
2406
  createCompanyApplicant: y,
2407
- getApplicantData: x,
2407
+ getApplicantData: v,
2408
2408
  stopProgress: g
2409
2409
  };
2410
2410
  }
2411
- const j = ({
2411
+ const _ = ({
2412
2412
  children: t,
2413
2413
  variant: e = "primary",
2414
2414
  size: r = "md",
@@ -2501,7 +2501,7 @@ const j = ({
2501
2501
  ] })
2502
2502
  );
2503
2503
  X.displayName = "Input";
2504
- const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2504
+ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2505
2505
  "div",
2506
2506
  {
2507
2507
  className: te(
@@ -2525,7 +2525,7 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2525
2525
  ...r,
2526
2526
  children: t
2527
2527
  }
2528
- ), T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: te("px-6 py-4", e), ...r, children: t }), ne = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2528
+ ), M = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: te("px-6 py-4", e), ...r, children: t }), ne = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2529
2529
  "div",
2530
2530
  {
2531
2531
  className: te("px-6 py-4 border-t", e),
@@ -2636,27 +2636,27 @@ const nr = ({
2636
2636
  value: l = [],
2637
2637
  className: c
2638
2638
  }) => {
2639
- const [d, u] = N(!1), y = H(null), x = (h) => {
2639
+ const [d, u] = N(!1), y = H(null), v = (h) => {
2640
2640
  if (!h) return;
2641
- const E = Array.from(h);
2642
- if (a && E.filter((S) => S.size > a).length > 0) {
2643
- const S = Ie(a);
2644
- alert(`Some files exceed the maximum size of ${S}`);
2641
+ const A = Array.from(h);
2642
+ if (a && A.filter((w) => w.size > a).length > 0) {
2643
+ const w = Ie(a);
2644
+ alert(`Some files exceed the maximum size of ${w}`);
2645
2645
  return;
2646
2646
  }
2647
- i == null || i(s ? [...l, ...E] : [E[0]]);
2647
+ i == null || i(s ? [...l, ...A] : [A[0]]);
2648
2648
  }, g = (h) => {
2649
2649
  h.preventDefault(), u(!0);
2650
2650
  }, b = () => {
2651
2651
  u(!1);
2652
2652
  }, m = (h) => {
2653
- h.preventDefault(), u(!1), x(h.dataTransfer.files);
2653
+ h.preventDefault(), u(!1), v(h.dataTransfer.files);
2654
2654
  }, f = () => {
2655
2655
  var h;
2656
2656
  (h = y.current) == null || h.click();
2657
2657
  }, k = (h) => {
2658
- const E = l.filter((v, S) => S !== h);
2659
- i == null || i(E);
2658
+ const A = l.filter((S, w) => w !== h);
2659
+ i == null || i(A);
2660
2660
  };
2661
2661
  return /* @__PURE__ */ o("div", { className: te("w-full", c), children: [
2662
2662
  t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
@@ -2681,7 +2681,7 @@ const nr = ({
2681
2681
  className: "hidden",
2682
2682
  accept: r,
2683
2683
  multiple: s,
2684
- onChange: (h) => x(h.target.files)
2684
+ onChange: (h) => v(h.target.files)
2685
2685
  }
2686
2686
  ),
2687
2687
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
@@ -2715,7 +2715,7 @@ const nr = ({
2715
2715
  ]
2716
2716
  }
2717
2717
  ),
2718
- l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h, E) => /* @__PURE__ */ o(
2718
+ l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h, A) => /* @__PURE__ */ o(
2719
2719
  "div",
2720
2720
  {
2721
2721
  className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
@@ -2748,8 +2748,8 @@ const nr = ({
2748
2748
  "button",
2749
2749
  {
2750
2750
  type: "button",
2751
- onClick: (v) => {
2752
- v.stopPropagation(), k(E);
2751
+ onClick: (S) => {
2752
+ S.stopPropagation(), k(A);
2753
2753
  },
2754
2754
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
2755
2755
  children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
@@ -2764,7 +2764,7 @@ const nr = ({
2764
2764
  )
2765
2765
  ]
2766
2766
  },
2767
- E
2767
+ A
2768
2768
  )) }),
2769
2769
  e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
2770
2770
  ] });
@@ -2939,8 +2939,8 @@ function pr(t, e) {
2939
2939
  r[l] = { message: c.message, type: c.code };
2940
2940
  } else r[l] = { message: i, type: a };
2941
2941
  if ("unionErrors" in s && s.unionErrors.forEach(function(y) {
2942
- return y.errors.forEach(function(x) {
2943
- return t.push(x);
2942
+ return y.errors.forEach(function(v) {
2943
+ return t.push(v);
2944
2944
  });
2945
2945
  }), e) {
2946
2946
  var d = r[l].types, u = d && d[s.code];
@@ -2958,8 +2958,8 @@ function gr(t, e) {
2958
2958
  r[l] = { message: c.message, type: c.code };
2959
2959
  } else r[l] = { message: i, type: a };
2960
2960
  if (s.code === "invalid_union" && s.errors.forEach(function(y) {
2961
- return y.forEach(function(x) {
2962
- return t.push(x);
2961
+ return y.forEach(function(v) {
2962
+ return t.push(v);
2963
2963
  });
2964
2964
  }), e) {
2965
2965
  var d = r[l].types, u = d && d[s.code];
@@ -3067,7 +3067,7 @@ const Vr = ue.any(), xr = ({
3067
3067
  }))
3068
3068
  ) } : { questionResults: [] }, [s]), u = s ? yr() : null, {
3069
3069
  control: y,
3070
- handleSubmit: x,
3070
+ handleSubmit: v,
3071
3071
  formState: { errors: g }
3072
3072
  } = Te({
3073
3073
  resolver: u ? Ge(u) : void 0,
@@ -3077,11 +3077,11 @@ const Vr = ue.any(), xr = ({
3077
3077
  try {
3078
3078
  console.log("Form submitted with data:", m);
3079
3079
  const f = s.questionGroups.flatMap(
3080
- (h, E) => h.questions.map((v, S) => {
3081
- var I, P, C;
3080
+ (h, A) => h.questions.map((S, w) => {
3081
+ var E, P, I;
3082
3082
  return {
3083
- questionId: v.id,
3084
- values: ((C = (P = (I = m.questionResults) == null ? void 0 : I[E]) == null ? void 0 : P[S]) == null ? void 0 : C.values) || []
3083
+ questionId: S.id,
3084
+ values: ((I = (P = (E = m.questionResults) == null ? void 0 : E[A]) == null ? void 0 : P[w]) == null ? void 0 : I.values) || []
3085
3085
  };
3086
3086
  })
3087
3087
  );
@@ -3096,76 +3096,76 @@ const Vr = ue.any(), xr = ({
3096
3096
  console.error("Error submitting questionnaire:", f);
3097
3097
  }
3098
3098
  };
3099
- return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3099
+ return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3100
3100
  "Error loading questionnaire: ",
3101
3101
  l.message
3102
- ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: x(b), children: /* @__PURE__ */ o(L, { children: [
3102
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: v(b), children: /* @__PURE__ */ o(T, { children: [
3103
3103
  /* @__PURE__ */ o(ee, { children: [
3104
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3104
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: s.displayName }),
3105
3105
  s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3106
3106
  ] }),
3107
- /* @__PURE__ */ n(T, { className: "space-y-8", children: s.questionGroups.flatMap(
3107
+ /* @__PURE__ */ n(M, { className: "space-y-8", children: s.questionGroups.flatMap(
3108
3108
  (m, f) => m.questions.map((k, h) => {
3109
- const v = k.defaultAnswers && k.defaultAnswers.length > 0 ? k.showAsDropdown ? k.canMultipleAnswer ? "multi-select" : "single-select" : k.canMultipleAnswer ? "checkbox" : "radio" : "text";
3109
+ const S = k.defaultAnswers && k.defaultAnswers.length > 0 ? k.showAsDropdown ? k.canMultipleAnswer ? "multi-select" : "single-select" : k.canMultipleAnswer ? "checkbox" : "radio" : "text";
3110
3110
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3111
3111
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3112
3112
  k.text,
3113
3113
  k.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3114
3114
  ] }),
3115
- v === "text" && /* @__PURE__ */ n(
3115
+ S === "text" && /* @__PURE__ */ n(
3116
3116
  J,
3117
3117
  {
3118
3118
  control: y,
3119
3119
  name: `questionResults.${f}.${h}.values.0`,
3120
- render: ({ field: S }) => {
3121
- var I, P, C, A;
3120
+ render: ({ field: w }) => {
3121
+ var E, P, I, C;
3122
3122
  return /* @__PURE__ */ n(
3123
3123
  X,
3124
3124
  {
3125
- value: S.value || "",
3126
- onChange: S.onChange,
3127
- onBlur: S.onBlur,
3128
- name: S.name,
3125
+ value: w.value || "",
3126
+ onChange: w.onChange,
3127
+ onBlur: w.onBlur,
3128
+ name: w.name,
3129
3129
  placeholder: "Enter your answer...",
3130
- error: (A = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : A.message
3130
+ error: (C = (I = (P = (E = g.questionResults) == null ? void 0 : E[f]) == null ? void 0 : P[h]) == null ? void 0 : I.values) == null ? void 0 : C.message
3131
3131
  }
3132
3132
  );
3133
3133
  }
3134
3134
  }
3135
3135
  ),
3136
- (v === "single-select" || v === "radio") && /* @__PURE__ */ n(
3136
+ (S === "single-select" || S === "radio") && /* @__PURE__ */ n(
3137
3137
  J,
3138
3138
  {
3139
3139
  control: y,
3140
3140
  name: `questionResults.${f}.${h}.values.0`,
3141
- render: ({ field: S }) => {
3142
- var I, P, C, A;
3141
+ render: ({ field: w }) => {
3142
+ var E, P, I, C;
3143
3143
  return /* @__PURE__ */ n(
3144
3144
  ye,
3145
3145
  {
3146
- value: S.value || "",
3147
- onChange: S.onChange,
3148
- onBlur: S.onBlur,
3149
- name: S.name,
3150
- options: k.defaultAnswers.map((M) => ({
3151
- value: M,
3152
- label: M
3146
+ value: w.value || "",
3147
+ onChange: w.onChange,
3148
+ onBlur: w.onBlur,
3149
+ name: w.name,
3150
+ options: k.defaultAnswers.map((F) => ({
3151
+ value: F,
3152
+ label: F
3153
3153
  })),
3154
3154
  placeholder: "Select an option...",
3155
- error: (A = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : A.message
3155
+ error: (C = (I = (P = (E = g.questionResults) == null ? void 0 : E[f]) == null ? void 0 : P[h]) == null ? void 0 : I.values) == null ? void 0 : C.message
3156
3156
  }
3157
3157
  );
3158
3158
  }
3159
3159
  }
3160
3160
  ),
3161
- (v === "checkbox" || v === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3161
+ (S === "checkbox" || S === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3162
3162
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
3163
3163
  /* @__PURE__ */ n(
3164
3164
  J,
3165
3165
  {
3166
3166
  control: y,
3167
3167
  name: `questionResults.${f}.${h}.values`,
3168
- render: ({ field: { value: S = [], onChange: I } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: k.defaultAnswers.map((P, C) => /* @__PURE__ */ o(
3168
+ render: ({ field: { value: w = [], onChange: E } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: k.defaultAnswers.map((P, I) => /* @__PURE__ */ o(
3169
3169
  "label",
3170
3170
  {
3171
3171
  className: "flex items-center space-x-2 cursor-pointer",
@@ -3174,10 +3174,10 @@ const Vr = ue.any(), xr = ({
3174
3174
  "input",
3175
3175
  {
3176
3176
  type: "checkbox",
3177
- checked: Array.isArray(S) && S.includes(P),
3178
- onChange: (A) => {
3179
- const M = Array.isArray(S) ? S : [], B = A.target.checked ? [...M, P] : M.filter((Q) => Q !== P);
3180
- I(B);
3177
+ checked: Array.isArray(w) && w.includes(P),
3178
+ onChange: (C) => {
3179
+ const F = Array.isArray(w) ? w : [], O = C.target.checked ? [...F, P] : F.filter((V) => V !== P);
3180
+ E(O);
3181
3181
  },
3182
3182
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3183
3183
  }
@@ -3185,7 +3185,7 @@ const Vr = ue.any(), xr = ({
3185
3185
  /* @__PURE__ */ n("span", { className: "text-sm", children: P })
3186
3186
  ]
3187
3187
  },
3188
- `answer-${f}-${h}-${C}`
3188
+ `answer-${f}-${h}-${I}`
3189
3189
  )) })
3190
3190
  }
3191
3191
  )
@@ -3194,9 +3194,9 @@ const Vr = ue.any(), xr = ({
3194
3194
  })
3195
3195
  ) }),
3196
3196
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3197
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3197
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3198
3198
  /* @__PURE__ */ n(
3199
- j,
3199
+ _,
3200
3200
  {
3201
3201
  type: "submit",
3202
3202
  isLoading: i,
@@ -3217,8 +3217,8 @@ const Vr = ue.any(), xr = ({
3217
3217
  onComplete: e,
3218
3218
  onBack: r
3219
3219
  }) => {
3220
- const { uploadDocument: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Jt(t), [d, u] = N({}), y = async (x) => {
3221
- if (x.preventDefault(), !s) return;
3220
+ const { uploadDocument: s, isLoading: a, isSubmitting: i, error: l, submit: c } = Jt(t), [d, u] = N({}), y = async (v) => {
3221
+ if (v.preventDefault(), !s) return;
3222
3222
  const g = await Promise.all(
3223
3223
  s.uploadDocumentFiles.map(async (m) => {
3224
3224
  const f = d[m.id] || [], k = await Promise.all(
@@ -3239,46 +3239,46 @@ const Vr = ue.any(), xr = ({
3239
3239
  };
3240
3240
  await c(b), e == null || e();
3241
3241
  };
3242
- return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3242
+ return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3243
3243
  "Error loading document requirements: ",
3244
3244
  l.message
3245
- ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(L, { children: [
3245
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(T, { children: [
3246
3246
  /* @__PURE__ */ o(ee, { children: [
3247
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3247
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: s.displayName }),
3248
3248
  s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3249
3249
  ] }),
3250
- /* @__PURE__ */ n(T, { className: "space-y-6", children: s.uploadDocumentFiles.map((x) => /* @__PURE__ */ n(
3250
+ /* @__PURE__ */ n(M, { className: "space-y-6", children: s.uploadDocumentFiles.map((v) => /* @__PURE__ */ n(
3251
3251
  nr,
3252
3252
  {
3253
- label: x.displayName,
3254
- accept: x.allowedTypes,
3255
- multiple: x.multipleFile,
3256
- maxSize: x.maxEachFileSizeByte,
3257
- value: d[x.id] || [],
3253
+ label: v.displayName,
3254
+ accept: v.allowedTypes,
3255
+ multiple: v.multipleFile,
3256
+ maxSize: v.maxEachFileSizeByte,
3257
+ value: d[v.id] || [],
3258
3258
  onChange: (g) => {
3259
- u((b) => ({ ...b, [x.id]: g }));
3259
+ u((b) => ({ ...b, [v.id]: g }));
3260
3260
  }
3261
3261
  },
3262
- x.id
3262
+ v.id
3263
3263
  )) }),
3264
3264
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3265
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3266
- /* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
3265
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3266
+ /* @__PURE__ */ n(_, { type: "submit", isLoading: i, children: "Continue" })
3267
3267
  ] })
3268
3268
  ] }) }) : null;
3269
3269
  }, kr = ({ applicantId: t, onComplete: e, onBack: r }) => {
3270
3270
  const { overview: s, isLoading: a, isSubmitting: i, error: l, passOverview: c } = Xt(t), d = async () => {
3271
3271
  await c(), e == null || e();
3272
3272
  };
3273
- return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3273
+ return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ce, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3274
3274
  "Error loading overview: ",
3275
3275
  l.message
3276
- ] }) }) }) : s ? /* @__PURE__ */ o(L, { children: [
3276
+ ] }) }) }) : s ? /* @__PURE__ */ o(T, { children: [
3277
3277
  /* @__PURE__ */ o(ee, { children: [
3278
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.title || "Overview" }),
3278
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: s.title || "Overview" }),
3279
3279
  s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
3280
3280
  ] }),
3281
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3281
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3282
3282
  s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "metakyc-overview-steps space-y-3", children: s.steps.sort((u, y) => u.order - y.order).map((u) => /* @__PURE__ */ o(
3283
3283
  "div",
3284
3284
  {
@@ -3352,8 +3352,8 @@ const Vr = ue.any(), xr = ({
3352
3352
  ] }) })
3353
3353
  ] }),
3354
3354
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3355
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3356
- /* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3355
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3356
+ /* @__PURE__ */ n(_, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3357
3357
  ] })
3358
3358
  ] }) : null;
3359
3359
  }, Nr = ({
@@ -3367,12 +3367,12 @@ const Vr = ue.any(), xr = ({
3367
3367
  values: [""]
3368
3368
  // Initialize with empty string to prevent uncontrolled input warning
3369
3369
  }))
3370
- }, [s]), x = s && s.length > 0 ? br() : null, {
3370
+ }, [s]), v = s && s.length > 0 ? br() : null, {
3371
3371
  control: g,
3372
3372
  handleSubmit: b,
3373
3373
  formState: { errors: m }
3374
3374
  } = Te({
3375
- resolver: x ? Ge(x) : void 0,
3375
+ resolver: v ? Ge(v) : void 0,
3376
3376
  defaultValues: y
3377
3377
  });
3378
3378
  ie.useEffect(() => {
@@ -3382,127 +3382,127 @@ const Vr = ue.any(), xr = ({
3382
3382
  if (s)
3383
3383
  try {
3384
3384
  console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
3385
- const E = h.criteriaValueInputs.map((S, I) => {
3386
- const P = S.values || [], C = Array.isArray(P) ? P.filter((A) => A && A.trim()) : P && P.toString().trim() ? [P.toString()] : [];
3387
- return C.length === 0 ? null : {
3388
- riskCriteriaId: s[I].id,
3389
- values: C
3385
+ const A = h.criteriaValueInputs.map((w, E) => {
3386
+ const P = w.values || [], I = Array.isArray(P) ? P.filter((C) => C && C.trim()) : P && P.toString().trim() ? [P.toString()] : [];
3387
+ return I.length === 0 ? null : {
3388
+ riskCriteriaId: s[E].id,
3389
+ values: I
3390
3390
  };
3391
- }).filter((S) => S !== null);
3392
- console.log("Risk scoring criteriaValueInputs to submit:", E);
3393
- const v = {
3391
+ }).filter((w) => w !== null);
3392
+ console.log("Risk scoring criteriaValueInputs to submit:", A);
3393
+ const S = {
3394
3394
  applicantId: t,
3395
- criteriaValueInputs: E
3395
+ criteriaValueInputs: A
3396
3396
  };
3397
- console.log("Final risk scoring input:", v), await c(v), console.log("Risk scoring submitted successfully!"), e == null || e();
3398
- } catch (E) {
3399
- throw console.error("Error submitting risk scoring:", E), E;
3397
+ console.log("Final risk scoring input:", S), await c(S), console.log("Risk scoring submitted successfully!"), e == null || e();
3398
+ } catch (A) {
3399
+ throw console.error("Error submitting risk scoring:", A), A;
3400
3400
  }
3401
3401
  }, k = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
3402
- return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3402
+ return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3403
3403
  /* @__PURE__ */ n(ce, { className: "my-8" }),
3404
3404
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
3405
- ] }) }) : l ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3405
+ ] }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3406
3406
  "Error loading criteria: ",
3407
3407
  l.message
3408
- ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3408
+ ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3409
3409
  /* @__PURE__ */ n(ce, { className: "my-8" }),
3410
3410
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
3411
- ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: b(f), children: /* @__PURE__ */ o(L, { children: [
3411
+ ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: b(f), children: /* @__PURE__ */ o(T, { children: [
3412
3412
  /* @__PURE__ */ o(ee, { children: [
3413
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
3413
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
3414
3414
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
3415
3415
  ] }),
3416
- /* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h, E) => {
3417
- var S, I, P;
3418
- const v = k(h);
3416
+ /* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((h, A) => {
3417
+ var w, E, P;
3418
+ const S = k(h);
3419
3419
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3420
3420
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3421
3421
  h.displayName,
3422
3422
  h.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3423
3423
  ] }),
3424
3424
  h.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: h.description }),
3425
- v === "text" && /* @__PURE__ */ n(
3425
+ S === "text" && /* @__PURE__ */ n(
3426
3426
  J,
3427
3427
  {
3428
3428
  control: g,
3429
- name: `criteriaValueInputs.${E}.values.0`,
3430
- render: ({ field: C }) => {
3431
- var A, M, B;
3429
+ name: `criteriaValueInputs.${A}.values.0`,
3430
+ render: ({ field: I }) => {
3431
+ var C, F, O;
3432
3432
  return /* @__PURE__ */ n(
3433
3433
  X,
3434
3434
  {
3435
- ...C,
3436
- value: C.value || "",
3435
+ ...I,
3436
+ value: I.value || "",
3437
3437
  type: h.valueDataType === Pe.DigitOnly ? "number" : "text",
3438
3438
  placeholder: "Enter your answer...",
3439
- error: (B = (M = (A = m.criteriaValueInputs) == null ? void 0 : A[E]) == null ? void 0 : M.values) == null ? void 0 : B.message,
3440
- onKeyDown: (Q) => {
3441
- h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(Q.key) && Q.preventDefault();
3439
+ error: (O = (F = (C = m.criteriaValueInputs) == null ? void 0 : C[A]) == null ? void 0 : F.values) == null ? void 0 : O.message,
3440
+ onKeyDown: (V) => {
3441
+ h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(V.key) && V.preventDefault();
3442
3442
  }
3443
3443
  }
3444
3444
  );
3445
3445
  }
3446
3446
  }
3447
3447
  ),
3448
- v === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3448
+ S === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3449
3449
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
3450
3450
  /* @__PURE__ */ n(
3451
3451
  J,
3452
3452
  {
3453
3453
  control: g,
3454
- name: `criteriaValueInputs.${E}.values.0`,
3455
- render: ({ field: { value: C, onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3454
+ name: `criteriaValueInputs.${A}.values.0`,
3455
+ render: ({ field: { value: I, onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((F, O) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3456
3456
  /* @__PURE__ */ n(
3457
3457
  "input",
3458
3458
  {
3459
3459
  type: "radio",
3460
- checked: C === M,
3461
- onChange: () => A(M),
3460
+ checked: I === F,
3461
+ onChange: () => C(F),
3462
3462
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3463
3463
  }
3464
3464
  ),
3465
- /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3466
- ] }, `${E}-${B}`)) })
3465
+ /* @__PURE__ */ n("span", { className: "text-sm", children: F })
3466
+ ] }, `${A}-${O}`)) })
3467
3467
  }
3468
3468
  )
3469
3469
  ] }),
3470
- v === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3470
+ S === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3471
3471
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
3472
3472
  /* @__PURE__ */ n(
3473
3473
  J,
3474
3474
  {
3475
3475
  control: g,
3476
- name: `criteriaValueInputs.${E}.values`,
3477
- render: ({ field: { value: C = [], onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3476
+ name: `criteriaValueInputs.${A}.values`,
3477
+ render: ({ field: { value: I = [], onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((F, O) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3478
3478
  /* @__PURE__ */ n(
3479
3479
  "input",
3480
3480
  {
3481
3481
  type: "checkbox",
3482
- checked: Array.isArray(C) && C.includes(M),
3483
- onChange: (Q) => {
3484
- const _ = Array.isArray(C) ? C : [], p = Q.target.checked ? [..._, M] : _.filter((w) => w !== M);
3485
- A(p);
3482
+ checked: Array.isArray(I) && I.includes(F),
3483
+ onChange: (V) => {
3484
+ const U = Array.isArray(I) ? I : [], p = V.target.checked ? [...U, F] : U.filter((x) => x !== F);
3485
+ C(p);
3486
3486
  },
3487
3487
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3488
3488
  }
3489
3489
  ),
3490
- /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3491
- ] }, `${E}-${B}`)) })
3490
+ /* @__PURE__ */ n("span", { className: "text-sm", children: F })
3491
+ ] }, `${A}-${O}`)) })
3492
3492
  }
3493
3493
  )
3494
3494
  ] }),
3495
- v === "country" && /* @__PURE__ */ n(
3495
+ S === "country" && /* @__PURE__ */ n(
3496
3496
  J,
3497
3497
  {
3498
3498
  control: g,
3499
- name: `criteriaValueInputs.${E}.values.0`,
3500
- render: ({ field: C }) => {
3501
- var A, M, B;
3499
+ name: `criteriaValueInputs.${A}.values.0`,
3500
+ render: ({ field: I }) => {
3501
+ var C, F, O;
3502
3502
  return /* @__PURE__ */ n(
3503
3503
  ye,
3504
3504
  {
3505
- ...C,
3505
+ ...I,
3506
3506
  options: [
3507
3507
  { value: "US", label: "United States" },
3508
3508
  { value: "GB", label: "United Kingdom" },
@@ -3510,19 +3510,19 @@ const Vr = ue.any(), xr = ({
3510
3510
  // TODO: Load from base information service
3511
3511
  ],
3512
3512
  placeholder: "Select a country...",
3513
- error: (B = (M = (A = m.criteriaValueInputs) == null ? void 0 : A[E]) == null ? void 0 : M.values) == null ? void 0 : B.message
3513
+ error: (O = (F = (C = m.criteriaValueInputs) == null ? void 0 : C[A]) == null ? void 0 : F.values) == null ? void 0 : O.message
3514
3514
  }
3515
3515
  );
3516
3516
  }
3517
3517
  }
3518
3518
  ),
3519
- ((P = (I = (S = m.criteriaValueInputs) == null ? void 0 : S[E]) == null ? void 0 : I.values) == null ? void 0 : P.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: m.criteriaValueInputs[E].values.message })
3519
+ ((P = (E = (w = m.criteriaValueInputs) == null ? void 0 : w[A]) == null ? void 0 : E.values) == null ? void 0 : P.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: m.criteriaValueInputs[A].values.message })
3520
3520
  ] }, h.id);
3521
3521
  }) }),
3522
3522
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3523
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3523
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3524
3524
  /* @__PURE__ */ n(
3525
- j,
3525
+ _,
3526
3526
  {
3527
3527
  type: "submit",
3528
3528
  isLoading: i,
@@ -3544,8 +3544,8 @@ const Vr = ue.any(), xr = ({
3544
3544
  onBack: r
3545
3545
  }) => {
3546
3546
  const { investorCategorizationService: s } = se(), [a, i] = N(null), [l, c] = N(!1), [d, u] = N(null);
3547
- return /* @__PURE__ */ n("form", { onSubmit: async (x) => {
3548
- if (x.preventDefault(), a === null) {
3547
+ return /* @__PURE__ */ n("form", { onSubmit: async (v) => {
3548
+ if (v.preventDefault(), a === null) {
3549
3549
  u("Please select an investor type");
3550
3550
  return;
3551
3551
  }
@@ -3563,12 +3563,12 @@ const Vr = ue.any(), xr = ({
3563
3563
  } finally {
3564
3564
  c(!1);
3565
3565
  }
3566
- }, children: /* @__PURE__ */ o(L, { children: [
3566
+ }, children: /* @__PURE__ */ o(T, { children: [
3567
3567
  /* @__PURE__ */ o(ee, { children: [
3568
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
3568
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
3569
3569
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
3570
3570
  ] }),
3571
- /* @__PURE__ */ o(T, { className: "space-y-4", children: [
3571
+ /* @__PURE__ */ o(M, { className: "space-y-4", children: [
3572
3572
  /* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
3573
3573
  /* @__PURE__ */ n(
3574
3574
  "label",
@@ -3664,9 +3664,9 @@ const Vr = ue.any(), xr = ({
3664
3664
  ] }) })
3665
3665
  ] }),
3666
3666
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3667
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3667
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3668
3668
  /* @__PURE__ */ n(
3669
- j,
3669
+ _,
3670
3670
  {
3671
3671
  type: "submit",
3672
3672
  isLoading: l,
@@ -3681,137 +3681,137 @@ const Vr = ue.any(), xr = ({
3681
3681
  onComplete: e,
3682
3682
  onBack: r
3683
3683
  }) => {
3684
- const { appropriatenessTestService: s } = se(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [y, x] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [E, v] = N(!1), [S, I] = N(0);
3685
- Y(() => {
3684
+ const { appropriatenessTestService: s } = se(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [y, v] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [A, S] = N(!1), [w, E] = N(0);
3685
+ W(() => {
3686
3686
  (async () => {
3687
3687
  try {
3688
- c(!0), x(null), console.log("Loading appropriateness test for applicant:", t);
3689
- const w = await s.getAppropriatenessTest(t);
3690
- if (console.log("Appropriateness test data:", w), i(w), w.waitTimeSpanForNextTry && w.waitTimeSpanForNextTry !== "00:00:00") {
3691
- const O = P(w.waitTimeSpanForNextTry);
3692
- O > 0 && I(O);
3688
+ c(!0), v(null), console.log("Loading appropriateness test for applicant:", t);
3689
+ const x = await s.getAppropriatenessTest(t);
3690
+ if (console.log("Appropriateness test data:", x), i(x), x.waitTimeSpanForNextTry && x.waitTimeSpanForNextTry !== "00:00:00") {
3691
+ const z = P(x.waitTimeSpanForNextTry);
3692
+ z > 0 && E(z);
3693
3693
  }
3694
- } catch (w) {
3695
- console.error("Error loading appropriateness test:", w), x(w.message || "Failed to load appropriateness test");
3694
+ } catch (x) {
3695
+ console.error("Error loading appropriateness test:", x), v(x.message || "Failed to load appropriateness test");
3696
3696
  } finally {
3697
3697
  c(!1);
3698
3698
  }
3699
3699
  })();
3700
3700
  }, [t, s]);
3701
3701
  const P = (p) => {
3702
- const w = p.split(":").map(Number);
3703
- if (w.length === 3) {
3704
- const [O, z, R] = w;
3705
- return O * 3600 + z * 60 + R;
3702
+ const x = p.split(":").map(Number);
3703
+ if (x.length === 3) {
3704
+ const [z, $, R] = x;
3705
+ return z * 3600 + $ * 60 + R;
3706
3706
  }
3707
3707
  return 0;
3708
- }, C = (p) => {
3709
- const w = Math.floor(p / 60), O = p % 60;
3710
- return `${w.toString().padStart(2, "0")}:${O.toString().padStart(2, "0")}`;
3708
+ }, I = (p) => {
3709
+ const x = Math.floor(p / 60), z = p % 60;
3710
+ return `${x.toString().padStart(2, "0")}:${z.toString().padStart(2, "0")}`;
3711
3711
  };
3712
- Y(() => {
3712
+ W(() => {
3713
3713
  if (!k || m <= 0) return;
3714
3714
  const p = setInterval(() => {
3715
- f((w) => w <= 1 ? (v(!0), 0) : w - 1);
3715
+ f((x) => x <= 1 ? (S(!0), 0) : x - 1);
3716
3716
  }, 1e3);
3717
3717
  return () => clearInterval(p);
3718
- }, [k, m]), Y(() => {
3719
- if (S <= 0) return;
3718
+ }, [k, m]), W(() => {
3719
+ if (w <= 0) return;
3720
3720
  const p = setInterval(() => {
3721
- I((w) => w <= 1 ? 0 : w - 1);
3721
+ E((x) => x <= 1 ? 0 : x - 1);
3722
3722
  }, 1e3);
3723
3723
  return () => clearInterval(p);
3724
- }, [S]), Y(() => {
3725
- E && !d && B();
3726
- }, [E]);
3727
- const A = () => {
3724
+ }, [w]), W(() => {
3725
+ A && !d && O();
3726
+ }, [A]);
3727
+ const C = () => {
3728
3728
  a && (h(!0), f(a.testDurationSec));
3729
- }, M = (p, w) => {
3730
- b((O) => ({
3731
- ...O,
3732
- [p]: w
3729
+ }, F = (p, x) => {
3730
+ b((z) => ({
3731
+ ...z,
3732
+ [p]: x
3733
3733
  }));
3734
- }, B = async (p) => {
3734
+ }, O = async (p) => {
3735
3735
  if (p && p.preventDefault(), !!a) {
3736
- if (!E) {
3737
- const w = a.appropriatenessQuestions.length - Object.keys(g).length;
3738
- if (w > 0) {
3739
- x(`Please answer all questions. ${w} question(s) remaining.`);
3736
+ if (!A) {
3737
+ const x = a.appropriatenessQuestions.length - Object.keys(g).length;
3738
+ if (x > 0) {
3739
+ v(`Please answer all questions. ${x} question(s) remaining.`);
3740
3740
  return;
3741
3741
  }
3742
3742
  }
3743
- u(!0), x(null);
3743
+ u(!0), v(null);
3744
3744
  try {
3745
- const w = a.appropriatenessQuestions.map(
3746
- (z) => ({
3747
- appropriatenessQuestionId: z.id,
3748
- value: g[z.id] || ""
3745
+ const x = a.appropriatenessQuestions.map(
3746
+ ($) => ({
3747
+ appropriatenessQuestionId: $.id,
3748
+ value: g[$.id] || ""
3749
3749
  // Empty string if not answered
3750
3750
  })
3751
- ), O = {
3751
+ ), z = {
3752
3752
  applicantId: t,
3753
3753
  appropriatenessTestId: a.id,
3754
- appropriatenessQuestionResults: w
3754
+ appropriatenessQuestionResults: x
3755
3755
  };
3756
- console.log("Submitting appropriateness test:", O);
3756
+ console.log("Submitting appropriateness test:", z);
3757
3757
  try {
3758
- const z = await s.fillAppropriatenessTest(O);
3759
- console.log("Appropriateness test result:", z), z.message && (z.message.toLowerCase().includes("pass") || z.message.toLowerCase().includes("success") || z.message.toLowerCase().includes("congratulations")) ? e == null || e() : (x(z.message || "Test completed. Please check the result."), h(!1), v(!1), b({}), setTimeout(() => Q(), 1e3));
3760
- } catch (z) {
3761
- if (z.code === 400 && z.message) {
3762
- const R = z.message;
3763
- console.log("Test failed:", R), x(R), h(!1), v(!1), b({}), setTimeout(() => Q(), 1500);
3758
+ const $ = await s.fillAppropriatenessTest(z);
3759
+ console.log("Appropriateness test result:", $), $.message && ($.message.toLowerCase().includes("pass") || $.message.toLowerCase().includes("success") || $.message.toLowerCase().includes("congratulations")) ? e == null || e() : (v($.message || "Test completed. Please check the result."), h(!1), S(!1), b({}), setTimeout(() => V(), 1e3));
3760
+ } catch ($) {
3761
+ if ($.code === 400 && $.message) {
3762
+ const R = $.message;
3763
+ console.log("Test failed:", R), v(R), h(!1), S(!1), b({}), setTimeout(() => V(), 1500);
3764
3764
  } else
3765
- throw z;
3765
+ throw $;
3766
3766
  }
3767
- } catch (w) {
3768
- console.error("Error submitting appropriateness test:", w), x(w.message || "Failed to submit test. Please try again."), h(!1), v(!1), b({});
3767
+ } catch (x) {
3768
+ console.error("Error submitting appropriateness test:", x), v(x.message || "Failed to submit test. Please try again."), h(!1), S(!1), b({});
3769
3769
  } finally {
3770
3770
  u(!1);
3771
3771
  }
3772
3772
  }
3773
- }, Q = async () => {
3773
+ }, V = async () => {
3774
3774
  try {
3775
3775
  const p = await s.getAppropriatenessTest(t);
3776
3776
  if (console.log("Reloaded test data:", p), i(p), p.waitTimeSpanForNextTry && p.waitTimeSpanForNextTry !== "00:00:00") {
3777
- const w = P(p.waitTimeSpanForNextTry);
3778
- w > 0 && I(w);
3777
+ const x = P(p.waitTimeSpanForNextTry);
3778
+ x > 0 && E(x);
3779
3779
  }
3780
3780
  } catch (p) {
3781
- console.error("Error reloading test data:", p), x((w) => w + `
3781
+ console.error("Error reloading test data:", p), v((x) => x + `
3782
3782
 
3783
3783
  Failed to reload test data. Please refresh the page.`);
3784
3784
  }
3785
3785
  };
3786
3786
  if (l)
3787
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3787
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3788
3788
  /* @__PURE__ */ n(ce, { className: "my-8" }),
3789
3789
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
3790
3790
  ] }) });
3791
3791
  if (!a)
3792
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3792
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3793
3793
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
3794
3794
  y && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: y })
3795
3795
  ] }) });
3796
- if (S > 0)
3797
- return /* @__PURE__ */ o(L, { children: [
3796
+ if (w > 0)
3797
+ return /* @__PURE__ */ o(T, { children: [
3798
3798
  /* @__PURE__ */ o(ee, { children: [
3799
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3799
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: a.displayName }),
3800
3800
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3801
3801
  ] }),
3802
- /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3802
+ /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3803
3803
  /* @__PURE__ */ o("div", { className: "mb-6", children: [
3804
- /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: C(S) }),
3804
+ /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: I(w) }),
3805
3805
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
3806
3806
  ] }),
3807
3807
  y && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: y }) })
3808
3808
  ] })
3809
3809
  ] });
3810
- const _ = a.testAllowedMaxTry - a.totalFailedTries;
3811
- return k ? /* @__PURE__ */ n("form", { onSubmit: B, children: /* @__PURE__ */ o(L, { children: [
3810
+ const U = a.testAllowedMaxTry - a.totalFailedTries;
3811
+ return k ? /* @__PURE__ */ n("form", { onSubmit: O, children: /* @__PURE__ */ o(T, { children: [
3812
3812
  /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
3813
3813
  /* @__PURE__ */ o("div", { children: [
3814
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3814
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: a.displayName }),
3815
3815
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3816
3816
  ] }),
3817
3817
  /* @__PURE__ */ o("div", { className: "text-right", children: [
@@ -3819,13 +3819,13 @@ Failed to reload test data. Please refresh the page.`);
3819
3819
  "div",
3820
3820
  {
3821
3821
  className: `text-3xl font-bold ${m <= 60 ? "text-danger-500" : "text-primary-500"}`,
3822
- children: C(m)
3822
+ children: I(m)
3823
3823
  }
3824
3824
  ),
3825
3825
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
3826
3826
  ] })
3827
3827
  ] }) }),
3828
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3828
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3829
3829
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
3830
3830
  /* @__PURE__ */ o(he, { variant: "info", children: [
3831
3831
  "Question ",
@@ -3833,14 +3833,14 @@ Failed to reload test data. Please refresh the page.`);
3833
3833
  " of ",
3834
3834
  a.totalQuestionCount
3835
3835
  ] }),
3836
- /* @__PURE__ */ o(he, { variant: _ > 1 ? "success" : "warning", children: [
3837
- _,
3836
+ /* @__PURE__ */ o(he, { variant: U > 1 ? "success" : "warning", children: [
3837
+ U,
3838
3838
  " attempt",
3839
- _ !== 1 ? "s" : "",
3839
+ U !== 1 ? "s" : "",
3840
3840
  " remaining"
3841
3841
  ] })
3842
3842
  ] }),
3843
- a.appropriatenessQuestions.map((p, w) => /* @__PURE__ */ o(
3843
+ a.appropriatenessQuestions.map((p, x) => /* @__PURE__ */ o(
3844
3844
  "div",
3845
3845
  {
3846
3846
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -3848,17 +3848,17 @@ Failed to reload test data. Please refresh the page.`);
3848
3848
  /* @__PURE__ */ o("div", { className: "mb-4", children: [
3849
3849
  /* @__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: [
3850
3850
  "Question ",
3851
- w + 1
3851
+ x + 1
3852
3852
  ] }),
3853
3853
  p.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: p.groupName }),
3854
3854
  /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: p.question })
3855
3855
  ] }),
3856
- /* @__PURE__ */ n("div", { className: "space-y-2", children: p.answers.map((O, z) => /* @__PURE__ */ o(
3856
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: p.answers.map((z, $) => /* @__PURE__ */ o(
3857
3857
  "label",
3858
3858
  {
3859
3859
  className: `
3860
3860
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
3861
- ${g[p.id] === O ? "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"}
3861
+ ${g[p.id] === z ? "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"}
3862
3862
  `,
3863
3863
  children: [
3864
3864
  /* @__PURE__ */ n(
@@ -3866,35 +3866,35 @@ Failed to reload test data. Please refresh the page.`);
3866
3866
  {
3867
3867
  type: "radio",
3868
3868
  name: `question-${p.id}`,
3869
- value: O,
3870
- checked: g[p.id] === O,
3871
- onChange: (R) => M(p.id, R.target.value),
3869
+ value: z,
3870
+ checked: g[p.id] === z,
3871
+ onChange: (R) => F(p.id, R.target.value),
3872
3872
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
3873
3873
  disabled: d
3874
3874
  }
3875
3875
  ),
3876
- /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: O })
3876
+ /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: z })
3877
3877
  ]
3878
3878
  },
3879
- z
3879
+ $
3880
3880
  )) })
3881
3881
  ]
3882
3882
  },
3883
3883
  p.id
3884
3884
  )),
3885
- y && !E && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3885
+ y && !A && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3886
3886
  /* @__PURE__ */ n("strong", { children: "Error:" }),
3887
3887
  " ",
3888
3888
  y
3889
3889
  ] }) }),
3890
- E && /* @__PURE__ */ n("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: [
3890
+ A && /* @__PURE__ */ n("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: [
3891
3891
  /* @__PURE__ */ n("strong", { children: "Time's up!" }),
3892
3892
  " Your answers are being submitted automatically."
3893
3893
  ] }) })
3894
3894
  ] }),
3895
3895
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3896
3896
  /* @__PURE__ */ n(
3897
- j,
3897
+ _,
3898
3898
  {
3899
3899
  type: "button",
3900
3900
  variant: "outline",
@@ -3904,21 +3904,21 @@ Failed to reload test data. Please refresh the page.`);
3904
3904
  }
3905
3905
  ),
3906
3906
  /* @__PURE__ */ n(
3907
- j,
3907
+ _,
3908
3908
  {
3909
3909
  type: "submit",
3910
3910
  isLoading: d,
3911
3911
  disabled: Object.keys(g).length < a.totalQuestionCount,
3912
- children: E ? "Submitting..." : "Submit Test"
3912
+ children: A ? "Submitting..." : "Submit Test"
3913
3913
  }
3914
3914
  )
3915
3915
  ] })
3916
- ] }) }) : /* @__PURE__ */ o(L, { children: [
3916
+ ] }) }) : /* @__PURE__ */ o(T, { children: [
3917
3917
  /* @__PURE__ */ o(ee, { children: [
3918
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3918
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: a.displayName }),
3919
3919
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3920
3920
  ] }),
3921
- /* @__PURE__ */ o(T, { children: [
3921
+ /* @__PURE__ */ o(M, { children: [
3922
3922
  a.description && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-gray-700 dark:text-gray-300", children: a.description }) }),
3923
3923
  /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
3924
3924
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
@@ -3927,7 +3927,7 @@ Failed to reload test data. Please refresh the page.`);
3927
3927
  ] }),
3928
3928
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3929
3929
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
3930
- /* @__PURE__ */ n(he, { variant: "info", children: C(a.testDurationSec) })
3930
+ /* @__PURE__ */ n(he, { variant: "info", children: I(a.testDurationSec) })
3931
3931
  ] }),
3932
3932
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3933
3933
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
@@ -3935,7 +3935,7 @@ Failed to reload test data. Please refresh the page.`);
3935
3935
  ] }),
3936
3936
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3937
3937
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
3938
- /* @__PURE__ */ n(he, { variant: _ > 1 ? "success" : "warning", children: _ })
3938
+ /* @__PURE__ */ n(he, { variant: U > 1 ? "success" : "warning", children: U })
3939
3939
  ] })
3940
3940
  ] }),
3941
3941
  y && /* @__PURE__ */ n("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
@@ -3943,16 +3943,16 @@ Failed to reload test data. Please refresh the page.`);
3943
3943
  " ",
3944
3944
  y
3945
3945
  ] }) }),
3946
- _ <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
3946
+ U <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
3947
3947
  ] }),
3948
3948
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3949
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3949
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3950
3950
  /* @__PURE__ */ n(
3951
- j,
3951
+ _,
3952
3952
  {
3953
3953
  type: "button",
3954
- onClick: A,
3955
- disabled: _ <= 0,
3954
+ onClick: C,
3955
+ disabled: U <= 0,
3956
3956
  children: "Start Test"
3957
3957
  }
3958
3958
  )
@@ -3963,8 +3963,8 @@ Failed to reload test data. Please refresh the page.`);
3963
3963
  onComplete: e,
3964
3964
  onBack: r
3965
3965
  }) => {
3966
- var O, z, R, we;
3967
- const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: x, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h, E] = N([]), [v, S] = N(!0), [I, P] = N(!1), [C, A] = N(null), [M, B] = N(!1), Q = ie.useRef(!1), _ = Te({
3966
+ var z, $, R, we;
3967
+ const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: v, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h, A] = N([]), [S, w] = N(!0), [E, P] = N(!1), [I, C] = N(null), [F, O] = N(!1), V = ie.useRef(!1), U = Te({
3968
3968
  defaultValues: {
3969
3969
  street: "",
3970
3970
  streetNumber: "",
@@ -3975,7 +3975,7 @@ Failed to reload test data. Please refresh the page.`);
3975
3975
  phonenumber: ""
3976
3976
  }
3977
3977
  });
3978
- Y(() => {
3978
+ W(() => {
3979
3979
  (async () => {
3980
3980
  try {
3981
3981
  const [D, G] = await Promise.all([
@@ -3983,24 +3983,24 @@ Failed to reload test data. Please refresh the page.`);
3983
3983
  a.getCountries("", "en")
3984
3984
  ]);
3985
3985
  k(D);
3986
- const V = /* @__PURE__ */ new Set(), ae = G.filter((me) => {
3986
+ const Y = /* @__PURE__ */ new Set(), ae = G.filter((me) => {
3987
3987
  const Ae = me.abbreviation3 || me.abbreviation;
3988
- return !Ae || V.has(Ae) ? !1 : (V.add(Ae), !0);
3988
+ return !Ae || Y.has(Ae) ? !1 : (Y.add(Ae), !0);
3989
3989
  });
3990
- E(ae);
3991
- const $ = D.applicantRequestData;
3992
- if (_.reset({
3993
- street: ($ == null ? void 0 : $.street) || "",
3994
- streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
3995
- city: ($ == null ? void 0 : $.city) || "",
3996
- zip: ($ == null ? void 0 : $.zip) || "",
3997
- country: ($ == null ? void 0 : $.country) || "",
3998
- nationality: ($ == null ? void 0 : $.nationality) || "",
3999
- phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
4000
- }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !Q.current) {
4001
- console.log("[Identity] Found existing identity verification, auto-requesting..."), Q.current = !0;
3990
+ A(ae);
3991
+ const j = D.applicantRequestData;
3992
+ if (U.reset({
3993
+ street: (j == null ? void 0 : j.street) || "",
3994
+ streetNumber: (j == null ? void 0 : j.streetNumber) || "",
3995
+ city: (j == null ? void 0 : j.city) || "",
3996
+ zip: (j == null ? void 0 : j.zip) || "",
3997
+ country: (j == null ? void 0 : j.country) || "",
3998
+ nationality: (j == null ? void 0 : j.nationality) || "",
3999
+ phonenumber: (j == null ? void 0 : j.phonenumber) || ""
4000
+ }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !V.current) {
4001
+ console.log("[Identity] Found existing identity verification, auto-requesting..."), V.current = !0;
4002
4002
  try {
4003
- await x(), P(!0);
4003
+ await v(), P(!0);
4004
4004
  } catch (me) {
4005
4005
  console.error("[Identity] Auto-request failed:", me);
4006
4006
  }
@@ -4008,17 +4008,17 @@ Failed to reload test data. Please refresh the page.`);
4008
4008
  } catch (D) {
4009
4009
  console.error("Error loading applicant data:", D);
4010
4010
  } finally {
4011
- S(!1);
4011
+ w(!1);
4012
4012
  }
4013
4013
  })();
4014
- }, [t]), Y(() => {
4015
- l && !I && (console.log("[Identity] Identity data already loaded, showing provider"), P(!0));
4016
- }, [l, I]), Y(() => {
4014
+ }, [t]), W(() => {
4015
+ l && !E && (console.log("[Identity] Identity data already loaded, showing provider"), P(!0));
4016
+ }, [l, E]), W(() => {
4017
4017
  if (d) {
4018
4018
  if (d.expiresAt) {
4019
- const F = new Date(d.expiresAt).getTime();
4020
- if (Date.now() >= F) {
4021
- console.warn("[Identity] Token has expired (expiresAt)"), B(!0), A("Your verification session has expired. Please restart.");
4019
+ const L = new Date(d.expiresAt).getTime();
4020
+ if (Date.now() >= L) {
4021
+ console.warn("[Identity] Token has expired (expiresAt)"), O(!0), C("Your verification session has expired. Please restart.");
4022
4022
  return;
4023
4023
  }
4024
4024
  }
@@ -4026,31 +4026,31 @@ Failed to reload test data. Please refresh the page.`);
4026
4026
  try {
4027
4027
  const D = new URL(d.url).toString().toLowerCase();
4028
4028
  if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
4029
- console.warn("[Identity] Token URL indicates expiration"), B(!0), A("Your verification link has expired. Please restart.");
4029
+ console.warn("[Identity] Token URL indicates expiration"), O(!0), C("Your verification link has expired. Please restart.");
4030
4030
  return;
4031
4031
  }
4032
4032
  } catch {
4033
4033
  console.error("[Identity] Invalid token URL");
4034
4034
  }
4035
4035
  if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
4036
- console.warn("[Identity] Token object indicates expiration"), B(!0), A("Your verification session has expired. Please restart.");
4036
+ console.warn("[Identity] Token object indicates expiration"), O(!0), C("Your verification session has expired. Please restart.");
4037
4037
  return;
4038
4038
  }
4039
4039
  }
4040
- }, [d]), Y(() => {
4041
- if (c !== null && d && !b && I && !M) {
4042
- const F = c;
4040
+ }, [d]), W(() => {
4041
+ if (c !== null && d && !b && E && !F) {
4042
+ const L = c;
4043
4043
  if (d.url) {
4044
- console.log("[Identity] Loading provider URL for user verification:", d.url), A(null);
4044
+ console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
4045
4045
  try {
4046
- if (new URL(d.url), F === oe.SardinAI) {
4046
+ if (new URL(d.url), L === oe.SardinAI) {
4047
4047
  console.log("[SardinAI] Initializing Risk SDK in background...");
4048
4048
  try {
4049
4049
  const D = fe.parseProviderConfig(c, d, i);
4050
4050
  fe.createProvider(c, D).initialize().then(() => {
4051
4051
  console.log("[SardinAI] Risk SDK initialized successfully in background");
4052
- }).catch((V) => {
4053
- console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", V);
4052
+ }).catch((Y) => {
4053
+ console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", Y);
4054
4054
  });
4055
4055
  } catch (D) {
4056
4056
  console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
@@ -4058,80 +4058,80 @@ Failed to reload test data. Please refresh the page.`);
4058
4058
  }
4059
4059
  m({ type: "url", url: d.url });
4060
4060
  } catch (D) {
4061
- console.error("[Identity] Invalid URL:", D), A("Invalid verification URL. Please restart."), B(!0);
4061
+ console.error("[Identity] Invalid URL:", D), C("Invalid verification URL. Please restart."), O(!0);
4062
4062
  }
4063
4063
  return;
4064
4064
  }
4065
- if (F === oe.SardinAI) {
4066
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), A(null);
4065
+ if (L === oe.SardinAI) {
4066
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), C(null);
4067
4067
  try {
4068
4068
  const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
4069
4069
  G.initialize().then(() => {
4070
4070
  console.log("[SardinAI] Risk SDK initialized successfully"), m(G), setTimeout(() => {
4071
4071
  e == null || e();
4072
4072
  }, 2e3);
4073
- }).catch((V) => {
4074
- var $;
4075
- console.error("[SardinAI] Failed to initialize:", V);
4076
- const ae = (($ = V.message) == null ? void 0 : $.toLowerCase()) || "";
4077
- ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (B(!0), A("Session expired or invalid. Please restart verification.")) : A(`Failed to initialize: ${V.message}`);
4073
+ }).catch((Y) => {
4074
+ var j;
4075
+ console.error("[SardinAI] Failed to initialize:", Y);
4076
+ const ae = ((j = Y.message) == null ? void 0 : j.toLowerCase()) || "";
4077
+ ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (O(!0), C("Session expired or invalid. Please restart verification.")) : C(`Failed to initialize: ${Y.message}`);
4078
4078
  });
4079
4079
  } catch (D) {
4080
- console.error("[SardinAI] Error creating provider:", D), A(`Configuration error: ${D.message}`);
4080
+ console.error("[SardinAI] Error creating provider:", D), C(`Configuration error: ${D.message}`);
4081
4081
  }
4082
4082
  return;
4083
4083
  }
4084
4084
  try {
4085
- A(null);
4085
+ C(null);
4086
4086
  const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
4087
- F === oe.Sumsub ? (G.initialize("identity-container").catch((V) => {
4087
+ L === oe.Sumsub ? (G.initialize("identity-container").catch((Y) => {
4088
4088
  var ae;
4089
- console.error("[Sumsub] Initialization error:", V), A(`Failed to initialize: ${V.message}`), (ae = V.message) != null && ae.toLowerCase().includes("expired") && B(!0);
4089
+ console.error("[Sumsub] Initialization error:", Y), C(`Failed to initialize: ${Y.message}`), (ae = Y.message) != null && ae.toLowerCase().includes("expired") && O(!0);
4090
4090
  }), G.onComplete && G.onComplete(() => {
4091
4091
  e == null || e();
4092
- })) : F === oe.Onfido && G.initialize("identity-container").catch((V) => {
4093
- console.error("[Onfido] Initialization error:", V), A(`Failed to initialize: ${V.message}`);
4092
+ })) : L === oe.Onfido && G.initialize("identity-container").catch((Y) => {
4093
+ console.error("[Onfido] Initialization error:", Y), C(`Failed to initialize: ${Y.message}`);
4094
4094
  }), m(G);
4095
4095
  } catch (D) {
4096
- console.error("[Identity] Provider setup error:", D), A(`Setup error: ${D.message}`);
4096
+ console.error("[Identity] Provider setup error:", D), C(`Setup error: ${D.message}`);
4097
4097
  }
4098
4098
  }
4099
4099
  return () => {
4100
4100
  if (b && b.destroy)
4101
4101
  try {
4102
4102
  b.destroy();
4103
- } catch (F) {
4104
- console.error("[Identity] Error destroying provider:", F);
4103
+ } catch (L) {
4104
+ console.error("[Identity] Error destroying provider:", L);
4105
4105
  }
4106
4106
  };
4107
- }, [c, d, b, I, e, M]);
4107
+ }, [c, d, b, E, e, F]);
4108
4108
  const p = async () => {
4109
4109
  try {
4110
- A(null), B(!1), await x(), P(!0);
4111
- } catch (F) {
4112
- console.error("Error starting identity verification:", F);
4110
+ C(null), O(!1), await v(), P(!0);
4111
+ } catch (L) {
4112
+ console.error("Error starting identity verification:", L);
4113
4113
  }
4114
- }, w = async () => {
4114
+ }, x = async () => {
4115
4115
  try {
4116
- A(null), B(!1), m(null), console.log("[Identity] Restarting verification..."), await g(), P(!0);
4117
- } catch (F) {
4118
- console.error("Error restarting identity verification:", F), A(F.message || "Failed to restart verification");
4116
+ C(null), O(!1), m(null), console.log("[Identity] Restarting verification..."), await g(), P(!0);
4117
+ } catch (L) {
4118
+ console.error("Error restarting identity verification:", L), C(L.message || "Failed to restart verification");
4119
4119
  }
4120
4120
  };
4121
- if (v || u)
4122
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4121
+ if (S || u)
4122
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4123
4123
  /* @__PURE__ */ n(ce, { className: "my-8" }),
4124
4124
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4125
4125
  ] }) });
4126
4126
  if (y)
4127
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4127
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4128
4128
  "Error: ",
4129
4129
  y.message
4130
4130
  ] }) }) });
4131
- if (I && (C || M))
4132
- return /* @__PURE__ */ o(L, { children: [
4131
+ if (E && (I || F))
4132
+ return /* @__PURE__ */ o(T, { children: [
4133
4133
  /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4134
- /* @__PURE__ */ o(T, { children: [
4134
+ /* @__PURE__ */ o(M, { children: [
4135
4135
  /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4136
4136
  /* @__PURE__ */ n(
4137
4137
  "svg",
@@ -4152,8 +4152,8 @@ Failed to reload test data. Please refresh the page.`);
4152
4152
  }
4153
4153
  ),
4154
4154
  /* @__PURE__ */ o("div", { children: [
4155
- /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: M ? "Session Expired" : "Verification Error" }),
4156
- /* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: C || "Your verification session has expired and needs to be restarted." })
4155
+ /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: F ? "Session Expired" : "Verification Error" }),
4156
+ /* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: I || "Your verification session has expired and needs to be restarted." })
4157
4157
  ] })
4158
4158
  ] }) }),
4159
4159
  /* @__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: [
@@ -4166,31 +4166,31 @@ Failed to reload test data. Please refresh the page.`);
4166
4166
  ] })
4167
4167
  ] }),
4168
4168
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4169
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4170
- /* @__PURE__ */ n(j, { type: "button", onClick: w, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4169
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4170
+ /* @__PURE__ */ n(_, { type: "button", onClick: x, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4171
4171
  ] })
4172
4172
  ] });
4173
- if (I && l) {
4174
- const F = c;
4175
- return d != null && d.url ? /* @__PURE__ */ o(L, { children: [
4173
+ if (E && l) {
4174
+ const L = c;
4175
+ return d != null && d.url ? /* @__PURE__ */ o(T, { children: [
4176
4176
  /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4177
4177
  /* @__PURE__ */ o("div", { children: [
4178
4178
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4179
4179
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4180
4180
  ] }),
4181
4181
  /* @__PURE__ */ n(
4182
- j,
4182
+ _,
4183
4183
  {
4184
4184
  type: "button",
4185
4185
  variant: "outline",
4186
4186
  size: "sm",
4187
- onClick: w,
4187
+ onClick: x,
4188
4188
  disabled: u,
4189
4189
  children: "Restart"
4190
4190
  }
4191
4191
  )
4192
4192
  ] }) }),
4193
- /* @__PURE__ */ o(T, { children: [
4193
+ /* @__PURE__ */ o(M, { children: [
4194
4194
  /* @__PURE__ */ n("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
4195
4195
  /* @__PURE__ */ n("strong", { children: "Important:" }),
4196
4196
  ' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
@@ -4203,13 +4203,13 @@ Failed to reload test data. Please refresh the page.`);
4203
4203
  allow: "camera; microphone; geolocation",
4204
4204
  title: "Identity Verification",
4205
4205
  onLoad: (D) => {
4206
- var G, V, ae;
4206
+ var G, Y, ae;
4207
4207
  console.log("[Identity] Iframe loaded");
4208
4208
  try {
4209
- const $ = D.target, Ce = $.contentDocument || ((G = $.contentWindow) == null ? void 0 : G.document);
4209
+ const j = D.target, Ce = j.contentDocument || ((G = j.contentWindow) == null ? void 0 : G.document);
4210
4210
  if (Ce) {
4211
- const me = ((ae = (V = Ce.body) == null ? void 0 : V.textContent) == null ? void 0 : ae.toLowerCase()) || "";
4212
- (me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), B(!0), A("Your verification link has expired."));
4211
+ const me = ((ae = (Y = Ce.body) == null ? void 0 : Y.textContent) == null ? void 0 : ae.toLowerCase()) || "";
4212
+ (me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), O(!0), C("Your verification link has expired."));
4213
4213
  }
4214
4214
  } catch {
4215
4215
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4218,39 +4218,39 @@ Failed to reload test data. Please refresh the page.`);
4218
4218
  }
4219
4219
  ) })
4220
4220
  ] }),
4221
- r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4222
- ] }) : F === oe.SardinAI ? /* @__PURE__ */ o(L, { children: [
4221
+ r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4222
+ ] }) : L === oe.SardinAI ? /* @__PURE__ */ o(T, { children: [
4223
4223
  /* @__PURE__ */ o(ee, { children: [
4224
4224
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4225
4225
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4226
4226
  ] }),
4227
- /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4227
+ /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4228
4228
  /* @__PURE__ */ n(ce, { className: "mb-4" }),
4229
4229
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4230
4230
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
4231
4231
  ] }) })
4232
- ] }) : /* @__PURE__ */ o(L, { children: [
4232
+ ] }) : /* @__PURE__ */ o(T, { children: [
4233
4233
  /* @__PURE__ */ o(ee, { children: [
4234
4234
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4235
4235
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4236
4236
  ] }),
4237
- /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4238
- r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4237
+ /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4238
+ r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4239
4239
  ] });
4240
4240
  }
4241
- return /* @__PURE__ */ n("form", { onSubmit: _.handleSubmit(p), children: /* @__PURE__ */ o(L, { children: [
4241
+ return /* @__PURE__ */ n("form", { onSubmit: U.handleSubmit(p), children: /* @__PURE__ */ o(T, { children: [
4242
4242
  /* @__PURE__ */ o(ee, { children: [
4243
4243
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
4244
4244
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
4245
4245
  ] }),
4246
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
4246
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
4247
4247
  /* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
4248
4248
  /* @__PURE__ */ o("div", { children: [
4249
4249
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4250
4250
  /* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
4251
- (O = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : O.firstName,
4251
+ (z = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : z.firstName,
4252
4252
  " ",
4253
- (z = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : z.lastName
4253
+ ($ = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : $.lastName
4254
4254
  ] })
4255
4255
  ] }),
4256
4256
  /* @__PURE__ */ o("div", { children: [
@@ -4268,12 +4268,12 @@ Failed to reload test data. Please refresh the page.`);
4268
4268
  /* @__PURE__ */ n(
4269
4269
  J,
4270
4270
  {
4271
- control: _.control,
4271
+ control: U.control,
4272
4272
  name: "country",
4273
- render: ({ field: F }) => /* @__PURE__ */ n(
4273
+ render: ({ field: L }) => /* @__PURE__ */ n(
4274
4274
  ye,
4275
4275
  {
4276
- ...F,
4276
+ ...L,
4277
4277
  label: "Country",
4278
4278
  options: [
4279
4279
  { value: "", label: "Select country..." },
@@ -4289,12 +4289,12 @@ Failed to reload test data. Please refresh the page.`);
4289
4289
  /* @__PURE__ */ n(
4290
4290
  J,
4291
4291
  {
4292
- control: _.control,
4292
+ control: U.control,
4293
4293
  name: "nationality",
4294
- render: ({ field: F }) => /* @__PURE__ */ n(
4294
+ render: ({ field: L }) => /* @__PURE__ */ n(
4295
4295
  ye,
4296
4296
  {
4297
- ...F,
4297
+ ...L,
4298
4298
  label: "Nationality",
4299
4299
  options: [
4300
4300
  { value: "", label: "Select nationality..." },
@@ -4312,17 +4312,17 @@ Failed to reload test data. Please refresh the page.`);
4312
4312
  /* @__PURE__ */ n(
4313
4313
  J,
4314
4314
  {
4315
- control: _.control,
4315
+ control: U.control,
4316
4316
  name: "street",
4317
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street" })
4317
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "Street" })
4318
4318
  }
4319
4319
  ),
4320
4320
  /* @__PURE__ */ n(
4321
4321
  J,
4322
4322
  {
4323
- control: _.control,
4323
+ control: U.control,
4324
4324
  name: "streetNumber",
4325
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street Number" })
4325
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "Street Number" })
4326
4326
  }
4327
4327
  )
4328
4328
  ] }),
@@ -4330,33 +4330,33 @@ Failed to reload test data. Please refresh the page.`);
4330
4330
  /* @__PURE__ */ n(
4331
4331
  J,
4332
4332
  {
4333
- control: _.control,
4333
+ control: U.control,
4334
4334
  name: "city",
4335
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "City" })
4335
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "City" })
4336
4336
  }
4337
4337
  ),
4338
4338
  /* @__PURE__ */ n(
4339
4339
  J,
4340
4340
  {
4341
- control: _.control,
4341
+ control: U.control,
4342
4342
  name: "zip",
4343
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "ZIP/Postal Code" })
4343
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "ZIP/Postal Code" })
4344
4344
  }
4345
4345
  )
4346
4346
  ] }),
4347
4347
  /* @__PURE__ */ n(
4348
4348
  J,
4349
4349
  {
4350
- control: _.control,
4350
+ control: U.control,
4351
4351
  name: "phonenumber",
4352
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Phone Number", type: "tel" })
4352
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "Phone Number", type: "tel" })
4353
4353
  }
4354
4354
  )
4355
4355
  ] })
4356
4356
  ] }),
4357
4357
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4358
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4359
- /* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4358
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4359
+ /* @__PURE__ */ n(_, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4360
4360
  ] })
4361
4361
  ] }) });
4362
4362
  }, je = ({
@@ -4438,8 +4438,8 @@ Failed to reload test data. Please refresh the page.`);
4438
4438
  iconColor: "text-blue-600 dark:text-blue-400",
4439
4439
  message: "Your application is being reviewed."
4440
4440
  };
4441
- return /* @__PURE__ */ o(L, { children: [
4442
- /* @__PURE__ */ o(T, { className: "py-12", children: [
4441
+ return /* @__PURE__ */ o(T, { children: [
4442
+ /* @__PURE__ */ o(M, { className: "py-12", children: [
4443
4443
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4444
4444
  "div",
4445
4445
  {
@@ -4493,10 +4493,10 @@ Failed to reload test data. Please refresh the page.`);
4493
4493
  ] }) })
4494
4494
  ] }),
4495
4495
  /* @__PURE__ */ o(ne, { className: "flex justify-center gap-4", children: [
4496
- c.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
4496
+ c.type === "success" && a && /* @__PURE__ */ n(_, { onClick: a, size: "lg", children: "Continue" }),
4497
4497
  c.type === "error" && /* @__PURE__ */ o(nt, { children: [
4498
- i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
4499
- a && /* @__PURE__ */ n(j, { onClick: a, children: "Try Again" })
4498
+ i && /* @__PURE__ */ n(_, { variant: "outline", onClick: i, children: "Contact Support" }),
4499
+ a && /* @__PURE__ */ n(_, { onClick: a, children: "Try Again" })
4500
4500
  ] }),
4501
4501
  c.type === "pending" && /* @__PURE__ */ n("div", { className: "text-center", children: /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
4502
4502
  ] })
@@ -4535,21 +4535,21 @@ Failed to reload test data. Please refresh the page.`);
4535
4535
  onSuccess: r,
4536
4536
  onCancel: s
4537
4537
  }) => {
4538
- var B, Q, _;
4539
- const { config: a, baseInformationService: i } = se(), { createApplicant: l, isLoading: c } = rr(), [d, u] = N([]), [y, x] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1), E = t || ((B = a.applicantForm) == null ? void 0 : B.workflowKey);
4540
- if (!E)
4538
+ var O, V, U;
4539
+ const { config: a, baseInformationService: i } = se(), { createApplicant: l, isLoading: c } = rr(), [d, u] = N([]), [y, v] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1), A = t || ((O = a.applicantForm) == null ? void 0 : O.workflowKey);
4540
+ if (!A)
4541
4541
  throw new Error(
4542
4542
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
4543
4543
  );
4544
- const v = e || ((Q = a.applicantForm) == null ? void 0 : Q.externalRefId) || "", S = ((_ = a.applicantForm) == null ? void 0 : _.visibleFields) || gt, [I, P] = N({
4545
- workflowKey: E,
4544
+ const S = e || ((V = a.applicantForm) == null ? void 0 : V.externalRefId) || "", w = ((U = a.applicantForm) == null ? void 0 : U.visibleFields) || gt, [E, P] = N({
4545
+ workflowKey: A,
4546
4546
  firstName: "",
4547
4547
  lastName: "",
4548
4548
  title: "",
4549
4549
  email: "",
4550
4550
  dateOfBirth: "",
4551
4551
  phonenumber: "",
4552
- externalRefId: v,
4552
+ externalRefId: S,
4553
4553
  // Set from config or prop
4554
4554
  mobileCountryCode: "",
4555
4555
  street: "",
@@ -4568,67 +4568,67 @@ Failed to reload test data. Please refresh the page.`);
4568
4568
  occupation: "",
4569
4569
  taxNumber: ""
4570
4570
  });
4571
- Y(() => {
4571
+ W(() => {
4572
4572
  (async () => {
4573
4573
  if (k.current || h.current) {
4574
4574
  console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
4575
4575
  return;
4576
4576
  }
4577
- k.current = !0, x(!0);
4577
+ k.current = !0, v(!0);
4578
4578
  try {
4579
- const w = await i.getCountries("", a.locale || "en"), O = /* @__PURE__ */ new Set(), z = w.map((R) => ({
4579
+ const x = await i.getCountries("", a.locale || "en"), z = /* @__PURE__ */ new Set(), $ = x.map((R) => ({
4580
4580
  value: R.abbreviation3 || R.abbreviation,
4581
4581
  label: R.name
4582
- })).filter((R) => !R.value || O.has(R.value) ? !1 : (O.add(R.value), !0));
4583
- u(z), h.current = !0;
4584
- } catch (w) {
4585
- console.error("Failed to load countries:", w);
4582
+ })).filter((R) => !R.value || z.has(R.value) ? !1 : (z.add(R.value), !0));
4583
+ u($), h.current = !0;
4584
+ } catch (x) {
4585
+ console.error("Failed to load countries:", x);
4586
4586
  } finally {
4587
- x(!1), k.current = !1;
4587
+ v(!1), k.current = !1;
4588
4588
  }
4589
4589
  })();
4590
4590
  }, []);
4591
- const C = (p, w) => {
4592
- P((O) => ({ ...O, [p]: w }));
4593
- }, A = async (p) => {
4591
+ const I = (p, x) => {
4592
+ P((z) => ({ ...z, [p]: x }));
4593
+ }, C = async (p) => {
4594
4594
  p.preventDefault(), b(!0), f(null);
4595
4595
  try {
4596
- if (!I.externalRefId || I.externalRefId.trim() === "") {
4596
+ if (!E.externalRefId || E.externalRefId.trim() === "") {
4597
4597
  f("External Reference ID is required and cannot be empty"), b(!1);
4598
4598
  return;
4599
4599
  }
4600
- const w = {
4601
- workflowKey: I.workflowKey,
4602
- externalRefId: I.externalRefId.trim()
4600
+ const x = {
4601
+ workflowKey: E.workflowKey,
4602
+ externalRefId: E.externalRefId.trim()
4603
4603
  // Always include, never empty
4604
4604
  };
4605
- S.forEach((z) => {
4606
- if (z === "externalRefId") return;
4607
- const R = I[z];
4608
- R != null && R !== "" && !(Array.isArray(R) && R.length === 0) && (w[z] = R);
4609
- }), console.log("Creating applicant with data:", w);
4610
- const O = await l(
4611
- w
4605
+ w.forEach(($) => {
4606
+ if ($ === "externalRefId") return;
4607
+ const R = E[$];
4608
+ R != null && R !== "" && !(Array.isArray(R) && R.length === 0) && (x[$] = R);
4609
+ }), console.log("Creating applicant with data:", x);
4610
+ const z = await l(
4611
+ x
4612
4612
  );
4613
- console.log("Applicant created:", O), r(O.applicantId);
4614
- } catch (w) {
4615
- console.error("Error creating applicant:", w), f(w.message || "Failed to create applicant");
4613
+ console.log("Applicant created:", z), r(z.applicantId);
4614
+ } catch (x) {
4615
+ console.error("Error creating applicant:", x), f(x.message || "Failed to create applicant");
4616
4616
  } finally {
4617
4617
  b(!1);
4618
4618
  }
4619
- }, M = (p) => {
4620
- var O, z;
4621
- const w = yt[p];
4622
- switch (w.type) {
4619
+ }, F = (p) => {
4620
+ var z, $;
4621
+ const x = yt[p];
4622
+ switch (x.type) {
4623
4623
  case "select":
4624
4624
  return p === "country" || p === "nationality" || p === "taxCountry" || p === "countryOfBirth" ? /* @__PURE__ */ n(
4625
4625
  ye,
4626
4626
  {
4627
- label: w.label,
4628
- value: I[p] || "",
4629
- onChange: (R) => C(p, R.target.value),
4627
+ label: x.label,
4628
+ value: E[p] || "",
4629
+ onChange: (R) => I(p, R.target.value),
4630
4630
  options: [
4631
- { value: "", label: `Select ${w.label.toLowerCase()}...` },
4631
+ { value: "", label: `Select ${x.label.toLowerCase()}...` },
4632
4632
  ...d
4633
4633
  ],
4634
4634
  disabled: y
@@ -4637,9 +4637,9 @@ Failed to reload test data. Please refresh the page.`);
4637
4637
  ) : p === "salutation" ? /* @__PURE__ */ n(
4638
4638
  ye,
4639
4639
  {
4640
- label: w.label,
4641
- value: ((O = I[p]) == null ? void 0 : O.toString()) || "",
4642
- onChange: (R) => C(p, R.target.value ? Number(R.target.value) : null),
4640
+ label: x.label,
4641
+ value: ((z = E[p]) == null ? void 0 : z.toString()) || "",
4642
+ onChange: (R) => I(p, R.target.value ? Number(R.target.value) : null),
4643
4643
  options: [
4644
4644
  { value: "", label: "Select salutation..." },
4645
4645
  { value: Se.Male.toString(), label: "Male" },
@@ -4654,11 +4654,11 @@ Failed to reload test data. Please refresh the page.`);
4654
4654
  X,
4655
4655
  {
4656
4656
  type: "text",
4657
- label: w.label,
4658
- value: ((z = I[p]) == null ? void 0 : z.join(", ")) || "",
4657
+ label: x.label,
4658
+ value: (($ = E[p]) == null ? void 0 : $.join(", ")) || "",
4659
4659
  onChange: (R) => {
4660
- const we = R.target.value.split(",").map((F) => F.trim()).filter(Boolean);
4661
- C(p, we);
4660
+ const we = R.target.value.split(",").map((L) => L.trim()).filter(Boolean);
4661
+ I(p, we);
4662
4662
  },
4663
4663
  placeholder: "Enter countries separated by commas"
4664
4664
  },
@@ -4669,9 +4669,9 @@ Failed to reload test data. Please refresh the page.`);
4669
4669
  X,
4670
4670
  {
4671
4671
  type: "date",
4672
- label: w.label,
4673
- value: I[p] || "",
4674
- onChange: (R) => C(p, R.target.value)
4672
+ label: x.label,
4673
+ value: E[p] || "",
4674
+ onChange: (R) => I(p, R.target.value)
4675
4675
  },
4676
4676
  p
4677
4677
  );
@@ -4680,9 +4680,9 @@ Failed to reload test data. Please refresh the page.`);
4680
4680
  X,
4681
4681
  {
4682
4682
  type: "email",
4683
- label: w.label,
4684
- value: I[p] || "",
4685
- onChange: (R) => C(p, R.target.value),
4683
+ label: x.label,
4684
+ value: E[p] || "",
4685
+ onChange: (R) => I(p, R.target.value),
4686
4686
  required: p === "email"
4687
4687
  },
4688
4688
  p
@@ -4692,9 +4692,9 @@ Failed to reload test data. Please refresh the page.`);
4692
4692
  X,
4693
4693
  {
4694
4694
  type: "tel",
4695
- label: w.label,
4696
- value: I[p] || "",
4697
- onChange: (R) => C(p, R.target.value),
4695
+ label: x.label,
4696
+ value: E[p] || "",
4697
+ onChange: (R) => I(p, R.target.value),
4698
4698
  required: p === "phonenumber"
4699
4699
  },
4700
4700
  p
@@ -4705,19 +4705,19 @@ Failed to reload test data. Please refresh the page.`);
4705
4705
  X,
4706
4706
  {
4707
4707
  type: "text",
4708
- label: w.label,
4709
- value: I[p] || "",
4710
- onChange: (R) => C(p, R.target.value),
4708
+ label: x.label,
4709
+ value: E[p] || "",
4710
+ onChange: (R) => I(p, R.target.value),
4711
4711
  required: p === "firstName" || p === "lastName" || p === "externalRefId"
4712
4712
  },
4713
4713
  p
4714
4714
  );
4715
4715
  }
4716
4716
  };
4717
- return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4717
+ return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4718
4718
  /* @__PURE__ */ n(ce, { className: "my-8" }),
4719
4719
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
4720
- ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: A, children: /* @__PURE__ */ o(L, { children: [
4720
+ ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: C, children: /* @__PURE__ */ o(T, { children: [
4721
4721
  /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
4722
4722
  Ze,
4723
4723
  {
@@ -4725,17 +4725,17 @@ Failed to reload test data. Please refresh the page.`);
4725
4725
  subtitle: "Please fill in the required information to begin the KYC verification process."
4726
4726
  }
4727
4727
  ) }),
4728
- /* @__PURE__ */ o(T, { children: [
4728
+ /* @__PURE__ */ o(M, { children: [
4729
4729
  m && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4730
4730
  /* @__PURE__ */ n("strong", { children: "Error:" }),
4731
4731
  " ",
4732
4732
  m
4733
4733
  ] }) }),
4734
- /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: S.map((p) => M(p)) })
4734
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: w.map((p) => F(p)) })
4735
4735
  ] }),
4736
4736
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4737
- s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: g || c, children: "Cancel" }),
4738
- /* @__PURE__ */ n(j, { type: "submit", isLoading: g || c, children: "Create Applicant" })
4737
+ s && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: s, disabled: g || c, children: "Cancel" }),
4738
+ /* @__PURE__ */ n(_, { type: "submit", isLoading: g || c, children: "Create Applicant" })
4739
4739
  ] })
4740
4740
  ] }) }) });
4741
4741
  }, Wr = ({
@@ -4752,7 +4752,7 @@ Failed to reload test data. Please refresh the page.`);
4752
4752
  workflowKey: d,
4753
4753
  nextWorkflowKey: u,
4754
4754
  hasWorkflowChanged: y,
4755
- isLoading: x,
4755
+ isLoading: v,
4756
4756
  error: g,
4757
4757
  moveBack: b,
4758
4758
  refreshProgress: m
@@ -4765,18 +4765,18 @@ Failed to reload test data. Please refresh the page.`);
4765
4765
  s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
4766
4766
  }, [s]), ie.useEffect(() => {
4767
4767
  y && k(!1);
4768
- }, [y]), x || !i)
4769
- return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4768
+ }, [y]), v || !i)
4769
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4770
4770
  /* @__PURE__ */ n(ce, { className: "my-8" }),
4771
4771
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
4772
4772
  ] }) }) });
4773
4773
  if (g)
4774
- return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4774
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4775
4775
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
4776
4776
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
4777
4777
  ] }) }) }) });
4778
4778
  if (y && !f)
4779
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4779
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4780
4780
  /* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
4781
4781
  /* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
4782
4782
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
@@ -4818,24 +4818,47 @@ Failed to reload test data. Please refresh the page.`);
4818
4818
  }
4819
4819
  ) });
4820
4820
  if (!l)
4821
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4821
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4822
4822
  /* @__PURE__ */ n(ce, { className: "my-8" }),
4823
4823
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === le.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
4824
4824
  ] }) }) });
4825
- const h = () => {
4826
- const v = c.filter((C) => C.visibility !== !1), S = v.findIndex((C) => C.order === l.order), I = S >= 0 ? S + 1 : 1, P = v.length;
4825
+ const h = (w) => {
4826
+ switch (w) {
4827
+ case B.Overview:
4828
+ return "Overview";
4829
+ case B.Questionaries:
4830
+ return "Questionnaire";
4831
+ case B.UploadDocument:
4832
+ return "Documents";
4833
+ case B.IdentitySdk:
4834
+ return "Identity";
4835
+ case B.RiskScoring:
4836
+ return "Risk Assessment";
4837
+ case B.InvestorCategorization:
4838
+ return "Investor Categorization";
4839
+ case B.AppropriatenessTest:
4840
+ return "Appropriateness Test";
4841
+ case B.AdditionalData:
4842
+ return "Additional Data";
4843
+ case B.ManualReview:
4844
+ return "Review";
4845
+ default:
4846
+ return "";
4847
+ }
4848
+ }, A = () => {
4849
+ const w = c.filter((C) => C.visibility !== !1), E = w.findIndex((C) => C.order === l.order), P = E >= 0 ? E + 1 : 1, I = w.length;
4827
4850
  return /* @__PURE__ */ o("div", { className: "mb-6", children: [
4828
4851
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
4829
4852
  /* @__PURE__ */ n(Ze, {}),
4830
4853
  /* @__PURE__ */ o(he, { variant: i.status === 1 ? "info" : "success", children: [
4831
4854
  "Step ",
4832
- I,
4855
+ P,
4833
4856
  " of ",
4834
- P
4857
+ I
4835
4858
  ] })
4836
4859
  ] }),
4837
- /* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C, A) => {
4838
- const M = A < S, B = C.order === l.order;
4860
+ /* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((C, F) => {
4861
+ const O = F < E, V = C.order === l.order;
4839
4862
  return /* @__PURE__ */ o(ie.Fragment, { children: [
4840
4863
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
4841
4864
  /* @__PURE__ */ n(
@@ -4843,30 +4866,30 @@ Failed to reload test data. Please refresh the page.`);
4843
4866
  {
4844
4867
  className: `
4845
4868
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
4846
- ${M || B ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4869
+ ${O || V ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4847
4870
  `,
4848
- children: A + 1
4871
+ children: F + 1
4849
4872
  }
4850
4873
  ),
4851
4874
  /* @__PURE__ */ n(
4852
4875
  "span",
4853
4876
  {
4854
- className: `ml-2 text-sm ${B ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4855
- children: C.displayName || C.name || `Step ${A + 1}`
4877
+ className: `ml-2 text-sm ${V ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4878
+ children: C.displayName || C.name || h(C.action) || `Step ${F + 1}`
4856
4879
  }
4857
4880
  )
4858
4881
  ] }),
4859
- A < v.length - 1 && /* @__PURE__ */ n(
4882
+ F < w.length - 1 && /* @__PURE__ */ n(
4860
4883
  "div",
4861
4884
  {
4862
- className: `flex-1 h-0.5 mx-4 ${M ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4885
+ className: `flex-1 h-0.5 mx-4 ${O ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4863
4886
  }
4864
4887
  )
4865
4888
  ] }, C.order);
4866
4889
  }) })
4867
4890
  ] });
4868
- }, E = () => {
4869
- const v = {
4891
+ }, S = () => {
4892
+ const w = {
4870
4893
  applicantId: t,
4871
4894
  onComplete: async () => {
4872
4895
  await m();
@@ -4874,22 +4897,22 @@ Failed to reload test data. Please refresh the page.`);
4874
4897
  onBack: l.order > 0 ? b : void 0
4875
4898
  };
4876
4899
  switch (l.action) {
4877
- case U.Questionaries:
4878
- return /* @__PURE__ */ n(xr, { ...v });
4879
- case U.UploadDocument:
4880
- return /* @__PURE__ */ n(wr, { ...v });
4881
- case U.Overview:
4882
- return /* @__PURE__ */ n(kr, { ...v });
4883
- case U.IdentitySdk:
4884
- return /* @__PURE__ */ n(Ar, { ...v });
4885
- case U.RiskScoring:
4886
- return /* @__PURE__ */ n(Nr, { ...v });
4887
- case U.AdditionalData:
4888
- case U.InvestorCategorization:
4889
- return /* @__PURE__ */ n(Sr, { ...v });
4890
- case U.AppropriatenessTest:
4891
- return /* @__PURE__ */ n(Cr, { ...v });
4892
- case U.ManualReview:
4900
+ case B.Questionaries:
4901
+ return /* @__PURE__ */ n(xr, { ...w });
4902
+ case B.UploadDocument:
4903
+ return /* @__PURE__ */ n(wr, { ...w });
4904
+ case B.Overview:
4905
+ return /* @__PURE__ */ n(kr, { ...w });
4906
+ case B.IdentitySdk:
4907
+ return /* @__PURE__ */ n(Ar, { ...w });
4908
+ case B.RiskScoring:
4909
+ return /* @__PURE__ */ n(Nr, { ...w });
4910
+ case B.AdditionalData:
4911
+ case B.InvestorCategorization:
4912
+ return /* @__PURE__ */ n(Sr, { ...w });
4913
+ case B.AppropriatenessTest:
4914
+ return /* @__PURE__ */ n(Cr, { ...w });
4915
+ case B.ManualReview:
4893
4916
  return /* @__PURE__ */ n(
4894
4917
  je,
4895
4918
  {
@@ -4900,7 +4923,7 @@ Failed to reload test data. Please refresh the page.`);
4900
4923
  }
4901
4924
  );
4902
4925
  default:
4903
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
4926
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
4904
4927
  /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ce, {}) }),
4905
4928
  /* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
4906
4929
  "Processing step: ",
@@ -4908,14 +4931,14 @@ Failed to reload test data. Please refresh the page.`);
4908
4931
  ] }),
4909
4932
  /* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
4910
4933
  "Action type: ",
4911
- U[l.action]
4934
+ B[l.action]
4912
4935
  ] })
4913
4936
  ] }) });
4914
4937
  }
4915
4938
  };
4916
4939
  return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
4917
- h(),
4918
- E()
4940
+ A(),
4941
+ S()
4919
4942
  ] });
4920
4943
  };
4921
4944
  export {
@@ -4929,9 +4952,9 @@ export {
4929
4952
  Cr as AppropriatenessTestStep,
4930
4953
  he as Badge,
4931
4954
  Et as BaseInformationService,
4932
- j as Button,
4933
- L as Card,
4934
- T as CardContent,
4955
+ _ as Button,
4956
+ T as Card,
4957
+ M as CardContent,
4935
4958
  ne as CardFooter,
4936
4959
  ee as CardHeader,
4937
4960
  Yr as CreateApplicantForm,
@@ -4961,7 +4984,7 @@ export {
4961
4984
  je as KycStatusDisplay,
4962
4985
  Wr as KycWorkflow,
4963
4986
  Er as Logo,
4964
- Ue as MetaKYCContext,
4987
+ Ke as MetaKYCContext,
4965
4988
  de as MetaKYCError,
4966
4989
  Or as MetaKYCProvider,
4967
4990
  _t as OnfidoProvider,
@@ -4975,13 +4998,13 @@ export {
4975
4998
  at as RiskLevel,
4976
4999
  Ct as RiskScoringService,
4977
5000
  Nr as RiskScoringStep,
4978
- Kt as SardinAIProvider,
5001
+ Ut as SardinAIProvider,
4979
5002
  ye as Select,
4980
5003
  ce as Spinner,
4981
5004
  zt as StepRouter,
4982
5005
  jt as SumsubProvider,
4983
- Ut as ThemeManager,
4984
- W as ThemePreset,
5006
+ Kt as ThemeManager,
5007
+ Q as ThemePreset,
4985
5008
  Mt as ThemeService,
4986
5009
  kt as UploadDocumentService,
4987
5010
  wr as UploadDocumentStep,
@@ -4990,9 +5013,9 @@ export {
4990
5013
  $t as WorkflowOrchestrator,
4991
5014
  Ne as WorkflowResultType,
4992
5015
  Ot as WorkflowState,
4993
- U as WorkflowStepAction,
5016
+ B as WorkflowStepAction,
4994
5017
  Vr as appropriatenessTestSchema,
4995
- Kr as clearAllStorage,
5018
+ Ur as clearAllStorage,
4996
5019
  Yt as clearApplicantId,
4997
5020
  Qt as clearWorkflowState,
4998
5021
  te as cn,
@@ -5012,7 +5035,7 @@ export {
5012
5035
  _r as getWorkflowState,
5013
5036
  Pt as healthcareTheme,
5014
5037
  Mr as isScriptLoaded,
5015
- Ke as loadScript,
5038
+ Ue as loadScript,
5016
5039
  Lt as minimalTheme,
5017
5040
  Ft as modernTheme,
5018
5041
  Br as removeScript,
@@ -5020,7 +5043,7 @@ export {
5020
5043
  Wt as saveWorkflowState,
5021
5044
  Tt as themePresets,
5022
5045
  rr as useApplicant,
5023
- Ur as useAppropriatenessTest,
5046
+ Kr as useAppropriatenessTest,
5024
5047
  er as useIdentityVerification,
5025
5048
  Gt as useKycWorkflow,
5026
5049
  se as useMetaKYC,