@vpdev2/metakyc-sdk 1.0.16 → 1.0.18

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,121 +3239,115 @@ 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: [
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
- "div",
3284
- {
3285
- className: "metakyc-overview-step-item flex items-start p-4 rounded-lg bg-gray-50 dark:bg-gray-800",
3286
- style: {
3287
- border: "0",
3288
- borderWidth: "0",
3289
- borderStyle: "none",
3290
- borderTop: "0",
3291
- borderBottom: "0",
3292
- borderLeft: "0",
3293
- borderRight: "0"
3294
- },
3295
- children: [
3296
- /* @__PURE__ */ n(
3297
- "div",
3298
- {
3299
- className: "metakyc-step-icon flex-shrink-0",
3300
- style: {
3301
- border: "0",
3302
- borderTop: "0"
3303
- },
3304
- children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-green-500 text-white flex items-center justify-center font-medium text-sm", children: "✓" })
3305
- }
3306
- ),
3307
- /* @__PURE__ */ o(
3308
- "div",
3309
- {
3310
- className: "metakyc-step-content",
3311
- style: {
3312
- flex: 1,
3313
- marginLeft: "1rem",
3314
- border: "none",
3315
- height: "auto",
3316
- background: "transparent",
3317
- margin: "0 0 0 1rem"
3318
- },
3319
- children: [
3320
- /* @__PURE__ */ n(
3321
- "h3",
3322
- {
3323
- className: "metakyc-step-title text-lg font-semibold text-gray-900 dark:text-white",
3324
- style: {
3325
- border: "0",
3326
- borderWidth: "0",
3327
- borderStyle: "none",
3328
- borderTop: "0",
3329
- borderBottom: "0",
3330
- borderLeft: "0",
3331
- borderRight: "0",
3332
- paddingTop: "0",
3333
- marginTop: "0",
3334
- boxShadow: "none",
3335
- outline: "none",
3336
- textDecoration: "none"
3337
- },
3338
- children: u.title
3339
- }
3340
- ),
3341
- u.description && /* @__PURE__ */ n("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400 mt-1", children: u.description })
3342
- ]
3343
- }
3344
- )
3345
- ]
3281
+ /* @__PURE__ */ n(M, { className: "space-y-6", children: 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(
3282
+ "div",
3283
+ {
3284
+ className: "metakyc-overview-step-item flex items-start p-4 rounded-lg bg-gray-50 dark:bg-gray-800",
3285
+ style: {
3286
+ border: "0",
3287
+ borderWidth: "0",
3288
+ borderStyle: "none",
3289
+ borderTop: "0",
3290
+ borderBottom: "0",
3291
+ borderLeft: "0",
3292
+ borderRight: "0"
3346
3293
  },
3347
- u.order
3348
- )) }) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }),
3349
- s.steps && s.steps.length > 0 && /* @__PURE__ */ n("div", { className: "mt-6 p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-green-800 dark:text-green-300 text-sm", children: [
3350
- /* @__PURE__ */ n("strong", { children: "✓ All steps completed!" }),
3351
- " Review the information above and confirm to proceed."
3352
- ] }) })
3353
- ] }),
3294
+ children: [
3295
+ /* @__PURE__ */ n(
3296
+ "div",
3297
+ {
3298
+ className: "metakyc-step-icon flex-shrink-0",
3299
+ style: {
3300
+ border: "0",
3301
+ borderTop: "0"
3302
+ },
3303
+ children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: u.order + 1 })
3304
+ }
3305
+ ),
3306
+ /* @__PURE__ */ o(
3307
+ "div",
3308
+ {
3309
+ className: "metakyc-step-content",
3310
+ style: {
3311
+ flex: 1,
3312
+ marginLeft: "1rem",
3313
+ border: "none",
3314
+ height: "auto",
3315
+ background: "transparent",
3316
+ margin: "0 0 0 1rem"
3317
+ },
3318
+ children: [
3319
+ /* @__PURE__ */ n(
3320
+ "h3",
3321
+ {
3322
+ className: "metakyc-step-title text-lg font-semibold text-gray-900 dark:text-white",
3323
+ style: {
3324
+ border: "0",
3325
+ borderWidth: "0",
3326
+ borderStyle: "none",
3327
+ borderTop: "0",
3328
+ borderBottom: "0",
3329
+ borderLeft: "0",
3330
+ borderRight: "0",
3331
+ paddingTop: "0",
3332
+ marginTop: "0",
3333
+ boxShadow: "none",
3334
+ outline: "none",
3335
+ textDecoration: "none"
3336
+ },
3337
+ children: u.title
3338
+ }
3339
+ ),
3340
+ u.description && /* @__PURE__ */ n("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400 mt-1", children: u.description })
3341
+ ]
3342
+ }
3343
+ )
3344
+ ]
3345
+ },
3346
+ u.order
3347
+ )) }) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
3354
3348
  /* @__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" })
3349
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3350
+ /* @__PURE__ */ n(_, { onClick: d, isLoading: i, children: "Continue" })
3357
3351
  ] })
3358
3352
  ] }) : null;
3359
3353
  }, Nr = ({
@@ -3367,12 +3361,12 @@ const Vr = ue.any(), xr = ({
3367
3361
  values: [""]
3368
3362
  // Initialize with empty string to prevent uncontrolled input warning
3369
3363
  }))
3370
- }, [s]), x = s && s.length > 0 ? br() : null, {
3364
+ }, [s]), v = s && s.length > 0 ? br() : null, {
3371
3365
  control: g,
3372
3366
  handleSubmit: b,
3373
3367
  formState: { errors: m }
3374
3368
  } = Te({
3375
- resolver: x ? Ge(x) : void 0,
3369
+ resolver: v ? Ge(v) : void 0,
3376
3370
  defaultValues: y
3377
3371
  });
3378
3372
  ie.useEffect(() => {
@@ -3382,127 +3376,127 @@ const Vr = ue.any(), xr = ({
3382
3376
  if (s)
3383
3377
  try {
3384
3378
  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
3379
+ const A = h.criteriaValueInputs.map((w, E) => {
3380
+ const P = w.values || [], I = Array.isArray(P) ? P.filter((C) => C && C.trim()) : P && P.toString().trim() ? [P.toString()] : [];
3381
+ return I.length === 0 ? null : {
3382
+ riskCriteriaId: s[E].id,
3383
+ values: I
3390
3384
  };
3391
- }).filter((S) => S !== null);
3392
- console.log("Risk scoring criteriaValueInputs to submit:", E);
3393
- const v = {
3385
+ }).filter((w) => w !== null);
3386
+ console.log("Risk scoring criteriaValueInputs to submit:", A);
3387
+ const S = {
3394
3388
  applicantId: t,
3395
- criteriaValueInputs: E
3389
+ criteriaValueInputs: A
3396
3390
  };
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;
3391
+ console.log("Final risk scoring input:", S), await c(S), console.log("Risk scoring submitted successfully!"), e == null || e();
3392
+ } catch (A) {
3393
+ throw console.error("Error submitting risk scoring:", A), A;
3400
3394
  }
3401
3395
  }, 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: [
3396
+ return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3403
3397
  /* @__PURE__ */ n(ce, { className: "my-8" }),
3404
3398
  /* @__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: [
3399
+ ] }) }) : l ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3406
3400
  "Error loading criteria: ",
3407
3401
  l.message
3408
- ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3402
+ ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3409
3403
  /* @__PURE__ */ n(ce, { className: "my-8" }),
3410
3404
  /* @__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: [
3405
+ ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: b(f), children: /* @__PURE__ */ o(T, { children: [
3412
3406
  /* @__PURE__ */ o(ee, { children: [
3413
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
3407
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
3414
3408
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
3415
3409
  ] }),
3416
- /* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h, E) => {
3417
- var S, I, P;
3418
- const v = k(h);
3410
+ /* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((h, A) => {
3411
+ var w, E, P;
3412
+ const S = k(h);
3419
3413
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3420
3414
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3421
3415
  h.displayName,
3422
3416
  h.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3423
3417
  ] }),
3424
3418
  h.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: h.description }),
3425
- v === "text" && /* @__PURE__ */ n(
3419
+ S === "text" && /* @__PURE__ */ n(
3426
3420
  J,
3427
3421
  {
3428
3422
  control: g,
3429
- name: `criteriaValueInputs.${E}.values.0`,
3430
- render: ({ field: C }) => {
3431
- var A, M, B;
3423
+ name: `criteriaValueInputs.${A}.values.0`,
3424
+ render: ({ field: I }) => {
3425
+ var C, F, O;
3432
3426
  return /* @__PURE__ */ n(
3433
3427
  X,
3434
3428
  {
3435
- ...C,
3436
- value: C.value || "",
3429
+ ...I,
3430
+ value: I.value || "",
3437
3431
  type: h.valueDataType === Pe.DigitOnly ? "number" : "text",
3438
3432
  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();
3433
+ error: (O = (F = (C = m.criteriaValueInputs) == null ? void 0 : C[A]) == null ? void 0 : F.values) == null ? void 0 : O.message,
3434
+ onKeyDown: (V) => {
3435
+ h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(V.key) && V.preventDefault();
3442
3436
  }
3443
3437
  }
3444
3438
  );
3445
3439
  }
3446
3440
  }
3447
3441
  ),
3448
- v === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3442
+ S === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3449
3443
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
3450
3444
  /* @__PURE__ */ n(
3451
3445
  J,
3452
3446
  {
3453
3447
  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: [
3448
+ name: `criteriaValueInputs.${A}.values.0`,
3449
+ 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
3450
  /* @__PURE__ */ n(
3457
3451
  "input",
3458
3452
  {
3459
3453
  type: "radio",
3460
- checked: C === M,
3461
- onChange: () => A(M),
3454
+ checked: I === F,
3455
+ onChange: () => C(F),
3462
3456
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3463
3457
  }
3464
3458
  ),
3465
- /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3466
- ] }, `${E}-${B}`)) })
3459
+ /* @__PURE__ */ n("span", { className: "text-sm", children: F })
3460
+ ] }, `${A}-${O}`)) })
3467
3461
  }
3468
3462
  )
3469
3463
  ] }),
3470
- v === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3464
+ S === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3471
3465
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
3472
3466
  /* @__PURE__ */ n(
3473
3467
  J,
3474
3468
  {
3475
3469
  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: [
3470
+ name: `criteriaValueInputs.${A}.values`,
3471
+ 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
3472
  /* @__PURE__ */ n(
3479
3473
  "input",
3480
3474
  {
3481
3475
  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);
3476
+ checked: Array.isArray(I) && I.includes(F),
3477
+ onChange: (V) => {
3478
+ const U = Array.isArray(I) ? I : [], p = V.target.checked ? [...U, F] : U.filter((x) => x !== F);
3479
+ C(p);
3486
3480
  },
3487
3481
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3488
3482
  }
3489
3483
  ),
3490
- /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3491
- ] }, `${E}-${B}`)) })
3484
+ /* @__PURE__ */ n("span", { className: "text-sm", children: F })
3485
+ ] }, `${A}-${O}`)) })
3492
3486
  }
3493
3487
  )
3494
3488
  ] }),
3495
- v === "country" && /* @__PURE__ */ n(
3489
+ S === "country" && /* @__PURE__ */ n(
3496
3490
  J,
3497
3491
  {
3498
3492
  control: g,
3499
- name: `criteriaValueInputs.${E}.values.0`,
3500
- render: ({ field: C }) => {
3501
- var A, M, B;
3493
+ name: `criteriaValueInputs.${A}.values.0`,
3494
+ render: ({ field: I }) => {
3495
+ var C, F, O;
3502
3496
  return /* @__PURE__ */ n(
3503
3497
  ye,
3504
3498
  {
3505
- ...C,
3499
+ ...I,
3506
3500
  options: [
3507
3501
  { value: "US", label: "United States" },
3508
3502
  { value: "GB", label: "United Kingdom" },
@@ -3510,19 +3504,19 @@ const Vr = ue.any(), xr = ({
3510
3504
  // TODO: Load from base information service
3511
3505
  ],
3512
3506
  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
3507
+ error: (O = (F = (C = m.criteriaValueInputs) == null ? void 0 : C[A]) == null ? void 0 : F.values) == null ? void 0 : O.message
3514
3508
  }
3515
3509
  );
3516
3510
  }
3517
3511
  }
3518
3512
  ),
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 })
3513
+ ((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
3514
  ] }, h.id);
3521
3515
  }) }),
3522
3516
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3523
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3517
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3524
3518
  /* @__PURE__ */ n(
3525
- j,
3519
+ _,
3526
3520
  {
3527
3521
  type: "submit",
3528
3522
  isLoading: i,
@@ -3544,8 +3538,8 @@ const Vr = ue.any(), xr = ({
3544
3538
  onBack: r
3545
3539
  }) => {
3546
3540
  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) {
3541
+ return /* @__PURE__ */ n("form", { onSubmit: async (v) => {
3542
+ if (v.preventDefault(), a === null) {
3549
3543
  u("Please select an investor type");
3550
3544
  return;
3551
3545
  }
@@ -3563,12 +3557,12 @@ const Vr = ue.any(), xr = ({
3563
3557
  } finally {
3564
3558
  c(!1);
3565
3559
  }
3566
- }, children: /* @__PURE__ */ o(L, { children: [
3560
+ }, children: /* @__PURE__ */ o(T, { children: [
3567
3561
  /* @__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?" }),
3562
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
3569
3563
  /* @__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
3564
  ] }),
3571
- /* @__PURE__ */ o(T, { className: "space-y-4", children: [
3565
+ /* @__PURE__ */ o(M, { className: "space-y-4", children: [
3572
3566
  /* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
3573
3567
  /* @__PURE__ */ n(
3574
3568
  "label",
@@ -3664,9 +3658,9 @@ const Vr = ue.any(), xr = ({
3664
3658
  ] }) })
3665
3659
  ] }),
3666
3660
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3667
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3661
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3668
3662
  /* @__PURE__ */ n(
3669
- j,
3663
+ _,
3670
3664
  {
3671
3665
  type: "submit",
3672
3666
  isLoading: l,
@@ -3681,137 +3675,137 @@ const Vr = ue.any(), xr = ({
3681
3675
  onComplete: e,
3682
3676
  onBack: r
3683
3677
  }) => {
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(() => {
3678
+ 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);
3679
+ W(() => {
3686
3680
  (async () => {
3687
3681
  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);
3682
+ c(!0), v(null), console.log("Loading appropriateness test for applicant:", t);
3683
+ const x = await s.getAppropriatenessTest(t);
3684
+ if (console.log("Appropriateness test data:", x), i(x), x.waitTimeSpanForNextTry && x.waitTimeSpanForNextTry !== "00:00:00") {
3685
+ const z = P(x.waitTimeSpanForNextTry);
3686
+ z > 0 && E(z);
3693
3687
  }
3694
- } catch (w) {
3695
- console.error("Error loading appropriateness test:", w), x(w.message || "Failed to load appropriateness test");
3688
+ } catch (x) {
3689
+ console.error("Error loading appropriateness test:", x), v(x.message || "Failed to load appropriateness test");
3696
3690
  } finally {
3697
3691
  c(!1);
3698
3692
  }
3699
3693
  })();
3700
3694
  }, [t, s]);
3701
3695
  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;
3696
+ const x = p.split(":").map(Number);
3697
+ if (x.length === 3) {
3698
+ const [z, $, R] = x;
3699
+ return z * 3600 + $ * 60 + R;
3706
3700
  }
3707
3701
  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")}`;
3702
+ }, I = (p) => {
3703
+ const x = Math.floor(p / 60), z = p % 60;
3704
+ return `${x.toString().padStart(2, "0")}:${z.toString().padStart(2, "0")}`;
3711
3705
  };
3712
- Y(() => {
3706
+ W(() => {
3713
3707
  if (!k || m <= 0) return;
3714
3708
  const p = setInterval(() => {
3715
- f((w) => w <= 1 ? (v(!0), 0) : w - 1);
3709
+ f((x) => x <= 1 ? (S(!0), 0) : x - 1);
3716
3710
  }, 1e3);
3717
3711
  return () => clearInterval(p);
3718
- }, [k, m]), Y(() => {
3719
- if (S <= 0) return;
3712
+ }, [k, m]), W(() => {
3713
+ if (w <= 0) return;
3720
3714
  const p = setInterval(() => {
3721
- I((w) => w <= 1 ? 0 : w - 1);
3715
+ E((x) => x <= 1 ? 0 : x - 1);
3722
3716
  }, 1e3);
3723
3717
  return () => clearInterval(p);
3724
- }, [S]), Y(() => {
3725
- E && !d && B();
3726
- }, [E]);
3727
- const A = () => {
3718
+ }, [w]), W(() => {
3719
+ A && !d && O();
3720
+ }, [A]);
3721
+ const C = () => {
3728
3722
  a && (h(!0), f(a.testDurationSec));
3729
- }, M = (p, w) => {
3730
- b((O) => ({
3731
- ...O,
3732
- [p]: w
3723
+ }, F = (p, x) => {
3724
+ b((z) => ({
3725
+ ...z,
3726
+ [p]: x
3733
3727
  }));
3734
- }, B = async (p) => {
3728
+ }, O = async (p) => {
3735
3729
  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.`);
3730
+ if (!A) {
3731
+ const x = a.appropriatenessQuestions.length - Object.keys(g).length;
3732
+ if (x > 0) {
3733
+ v(`Please answer all questions. ${x} question(s) remaining.`);
3740
3734
  return;
3741
3735
  }
3742
3736
  }
3743
- u(!0), x(null);
3737
+ u(!0), v(null);
3744
3738
  try {
3745
- const w = a.appropriatenessQuestions.map(
3746
- (z) => ({
3747
- appropriatenessQuestionId: z.id,
3748
- value: g[z.id] || ""
3739
+ const x = a.appropriatenessQuestions.map(
3740
+ ($) => ({
3741
+ appropriatenessQuestionId: $.id,
3742
+ value: g[$.id] || ""
3749
3743
  // Empty string if not answered
3750
3744
  })
3751
- ), O = {
3745
+ ), z = {
3752
3746
  applicantId: t,
3753
3747
  appropriatenessTestId: a.id,
3754
- appropriatenessQuestionResults: w
3748
+ appropriatenessQuestionResults: x
3755
3749
  };
3756
- console.log("Submitting appropriateness test:", O);
3750
+ console.log("Submitting appropriateness test:", z);
3757
3751
  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);
3752
+ const $ = await s.fillAppropriatenessTest(z);
3753
+ 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));
3754
+ } catch ($) {
3755
+ if ($.code === 400 && $.message) {
3756
+ const R = $.message;
3757
+ console.log("Test failed:", R), v(R), h(!1), S(!1), b({}), setTimeout(() => V(), 1500);
3764
3758
  } else
3765
- throw z;
3759
+ throw $;
3766
3760
  }
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({});
3761
+ } catch (x) {
3762
+ console.error("Error submitting appropriateness test:", x), v(x.message || "Failed to submit test. Please try again."), h(!1), S(!1), b({});
3769
3763
  } finally {
3770
3764
  u(!1);
3771
3765
  }
3772
3766
  }
3773
- }, Q = async () => {
3767
+ }, V = async () => {
3774
3768
  try {
3775
3769
  const p = await s.getAppropriatenessTest(t);
3776
3770
  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);
3771
+ const x = P(p.waitTimeSpanForNextTry);
3772
+ x > 0 && E(x);
3779
3773
  }
3780
3774
  } catch (p) {
3781
- console.error("Error reloading test data:", p), x((w) => w + `
3775
+ console.error("Error reloading test data:", p), v((x) => x + `
3782
3776
 
3783
3777
  Failed to reload test data. Please refresh the page.`);
3784
3778
  }
3785
3779
  };
3786
3780
  if (l)
3787
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3781
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3788
3782
  /* @__PURE__ */ n(ce, { className: "my-8" }),
3789
3783
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
3790
3784
  ] }) });
3791
3785
  if (!a)
3792
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3786
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3793
3787
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
3794
3788
  y && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: y })
3795
3789
  ] }) });
3796
- if (S > 0)
3797
- return /* @__PURE__ */ o(L, { children: [
3790
+ if (w > 0)
3791
+ return /* @__PURE__ */ o(T, { children: [
3798
3792
  /* @__PURE__ */ o(ee, { children: [
3799
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3793
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: a.displayName }),
3800
3794
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3801
3795
  ] }),
3802
- /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3796
+ /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3803
3797
  /* @__PURE__ */ o("div", { className: "mb-6", children: [
3804
- /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: C(S) }),
3798
+ /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: I(w) }),
3805
3799
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
3806
3800
  ] }),
3807
3801
  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
3802
  ] })
3809
3803
  ] });
3810
- const _ = a.testAllowedMaxTry - a.totalFailedTries;
3811
- return k ? /* @__PURE__ */ n("form", { onSubmit: B, children: /* @__PURE__ */ o(L, { children: [
3804
+ const U = a.testAllowedMaxTry - a.totalFailedTries;
3805
+ return k ? /* @__PURE__ */ n("form", { onSubmit: O, children: /* @__PURE__ */ o(T, { children: [
3812
3806
  /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
3813
3807
  /* @__PURE__ */ o("div", { children: [
3814
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3808
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: a.displayName }),
3815
3809
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3816
3810
  ] }),
3817
3811
  /* @__PURE__ */ o("div", { className: "text-right", children: [
@@ -3819,13 +3813,13 @@ Failed to reload test data. Please refresh the page.`);
3819
3813
  "div",
3820
3814
  {
3821
3815
  className: `text-3xl font-bold ${m <= 60 ? "text-danger-500" : "text-primary-500"}`,
3822
- children: C(m)
3816
+ children: I(m)
3823
3817
  }
3824
3818
  ),
3825
3819
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
3826
3820
  ] })
3827
3821
  ] }) }),
3828
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3822
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3829
3823
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
3830
3824
  /* @__PURE__ */ o(he, { variant: "info", children: [
3831
3825
  "Question ",
@@ -3833,14 +3827,14 @@ Failed to reload test data. Please refresh the page.`);
3833
3827
  " of ",
3834
3828
  a.totalQuestionCount
3835
3829
  ] }),
3836
- /* @__PURE__ */ o(he, { variant: _ > 1 ? "success" : "warning", children: [
3837
- _,
3830
+ /* @__PURE__ */ o(he, { variant: U > 1 ? "success" : "warning", children: [
3831
+ U,
3838
3832
  " attempt",
3839
- _ !== 1 ? "s" : "",
3833
+ U !== 1 ? "s" : "",
3840
3834
  " remaining"
3841
3835
  ] })
3842
3836
  ] }),
3843
- a.appropriatenessQuestions.map((p, w) => /* @__PURE__ */ o(
3837
+ a.appropriatenessQuestions.map((p, x) => /* @__PURE__ */ o(
3844
3838
  "div",
3845
3839
  {
3846
3840
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -3848,17 +3842,17 @@ Failed to reload test data. Please refresh the page.`);
3848
3842
  /* @__PURE__ */ o("div", { className: "mb-4", children: [
3849
3843
  /* @__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
3844
  "Question ",
3851
- w + 1
3845
+ x + 1
3852
3846
  ] }),
3853
3847
  p.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: p.groupName }),
3854
3848
  /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: p.question })
3855
3849
  ] }),
3856
- /* @__PURE__ */ n("div", { className: "space-y-2", children: p.answers.map((O, z) => /* @__PURE__ */ o(
3850
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: p.answers.map((z, $) => /* @__PURE__ */ o(
3857
3851
  "label",
3858
3852
  {
3859
3853
  className: `
3860
3854
  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"}
3855
+ ${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
3856
  `,
3863
3857
  children: [
3864
3858
  /* @__PURE__ */ n(
@@ -3866,35 +3860,35 @@ Failed to reload test data. Please refresh the page.`);
3866
3860
  {
3867
3861
  type: "radio",
3868
3862
  name: `question-${p.id}`,
3869
- value: O,
3870
- checked: g[p.id] === O,
3871
- onChange: (R) => M(p.id, R.target.value),
3863
+ value: z,
3864
+ checked: g[p.id] === z,
3865
+ onChange: (R) => F(p.id, R.target.value),
3872
3866
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
3873
3867
  disabled: d
3874
3868
  }
3875
3869
  ),
3876
- /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: O })
3870
+ /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: z })
3877
3871
  ]
3878
3872
  },
3879
- z
3873
+ $
3880
3874
  )) })
3881
3875
  ]
3882
3876
  },
3883
3877
  p.id
3884
3878
  )),
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: [
3879
+ 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
3880
  /* @__PURE__ */ n("strong", { children: "Error:" }),
3887
3881
  " ",
3888
3882
  y
3889
3883
  ] }) }),
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: [
3884
+ 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
3885
  /* @__PURE__ */ n("strong", { children: "Time's up!" }),
3892
3886
  " Your answers are being submitted automatically."
3893
3887
  ] }) })
3894
3888
  ] }),
3895
3889
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3896
3890
  /* @__PURE__ */ n(
3897
- j,
3891
+ _,
3898
3892
  {
3899
3893
  type: "button",
3900
3894
  variant: "outline",
@@ -3904,21 +3898,21 @@ Failed to reload test data. Please refresh the page.`);
3904
3898
  }
3905
3899
  ),
3906
3900
  /* @__PURE__ */ n(
3907
- j,
3901
+ _,
3908
3902
  {
3909
3903
  type: "submit",
3910
3904
  isLoading: d,
3911
3905
  disabled: Object.keys(g).length < a.totalQuestionCount,
3912
- children: E ? "Submitting..." : "Submit Test"
3906
+ children: A ? "Submitting..." : "Submit Test"
3913
3907
  }
3914
3908
  )
3915
3909
  ] })
3916
- ] }) }) : /* @__PURE__ */ o(L, { children: [
3910
+ ] }) }) : /* @__PURE__ */ o(T, { children: [
3917
3911
  /* @__PURE__ */ o(ee, { children: [
3918
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3912
+ /* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: a.displayName }),
3919
3913
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3920
3914
  ] }),
3921
- /* @__PURE__ */ o(T, { children: [
3915
+ /* @__PURE__ */ o(M, { children: [
3922
3916
  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
3917
  /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
3924
3918
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
@@ -3927,7 +3921,7 @@ Failed to reload test data. Please refresh the page.`);
3927
3921
  ] }),
3928
3922
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3929
3923
  /* @__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) })
3924
+ /* @__PURE__ */ n(he, { variant: "info", children: I(a.testDurationSec) })
3931
3925
  ] }),
3932
3926
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3933
3927
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
@@ -3935,7 +3929,7 @@ Failed to reload test data. Please refresh the page.`);
3935
3929
  ] }),
3936
3930
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3937
3931
  /* @__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: _ })
3932
+ /* @__PURE__ */ n(he, { variant: U > 1 ? "success" : "warning", children: U })
3939
3933
  ] })
3940
3934
  ] }),
3941
3935
  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 +3937,16 @@ Failed to reload test data. Please refresh the page.`);
3943
3937
  " ",
3944
3938
  y
3945
3939
  ] }) }),
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." }) })
3940
+ 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
3941
  ] }),
3948
3942
  /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3949
- r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3943
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3950
3944
  /* @__PURE__ */ n(
3951
- j,
3945
+ _,
3952
3946
  {
3953
3947
  type: "button",
3954
- onClick: A,
3955
- disabled: _ <= 0,
3948
+ onClick: C,
3949
+ disabled: U <= 0,
3956
3950
  children: "Start Test"
3957
3951
  }
3958
3952
  )
@@ -3963,8 +3957,8 @@ Failed to reload test data. Please refresh the page.`);
3963
3957
  onComplete: e,
3964
3958
  onBack: r
3965
3959
  }) => {
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({
3960
+ var z, $, R, we;
3961
+ 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
3962
  defaultValues: {
3969
3963
  street: "",
3970
3964
  streetNumber: "",
@@ -3975,7 +3969,7 @@ Failed to reload test data. Please refresh the page.`);
3975
3969
  phonenumber: ""
3976
3970
  }
3977
3971
  });
3978
- Y(() => {
3972
+ W(() => {
3979
3973
  (async () => {
3980
3974
  try {
3981
3975
  const [D, G] = await Promise.all([
@@ -3983,24 +3977,24 @@ Failed to reload test data. Please refresh the page.`);
3983
3977
  a.getCountries("", "en")
3984
3978
  ]);
3985
3979
  k(D);
3986
- const V = /* @__PURE__ */ new Set(), ae = G.filter((me) => {
3980
+ const Y = /* @__PURE__ */ new Set(), ae = G.filter((me) => {
3987
3981
  const Ae = me.abbreviation3 || me.abbreviation;
3988
- return !Ae || V.has(Ae) ? !1 : (V.add(Ae), !0);
3982
+ return !Ae || Y.has(Ae) ? !1 : (Y.add(Ae), !0);
3989
3983
  });
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;
3984
+ A(ae);
3985
+ const j = D.applicantRequestData;
3986
+ if (U.reset({
3987
+ street: (j == null ? void 0 : j.street) || "",
3988
+ streetNumber: (j == null ? void 0 : j.streetNumber) || "",
3989
+ city: (j == null ? void 0 : j.city) || "",
3990
+ zip: (j == null ? void 0 : j.zip) || "",
3991
+ country: (j == null ? void 0 : j.country) || "",
3992
+ nationality: (j == null ? void 0 : j.nationality) || "",
3993
+ phonenumber: (j == null ? void 0 : j.phonenumber) || ""
3994
+ }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !V.current) {
3995
+ console.log("[Identity] Found existing identity verification, auto-requesting..."), V.current = !0;
4002
3996
  try {
4003
- await x(), P(!0);
3997
+ await v(), P(!0);
4004
3998
  } catch (me) {
4005
3999
  console.error("[Identity] Auto-request failed:", me);
4006
4000
  }
@@ -4008,17 +4002,17 @@ Failed to reload test data. Please refresh the page.`);
4008
4002
  } catch (D) {
4009
4003
  console.error("Error loading applicant data:", D);
4010
4004
  } finally {
4011
- S(!1);
4005
+ w(!1);
4012
4006
  }
4013
4007
  })();
4014
- }, [t]), Y(() => {
4015
- l && !I && (console.log("[Identity] Identity data already loaded, showing provider"), P(!0));
4016
- }, [l, I]), Y(() => {
4008
+ }, [t]), W(() => {
4009
+ l && !E && (console.log("[Identity] Identity data already loaded, showing provider"), P(!0));
4010
+ }, [l, E]), W(() => {
4017
4011
  if (d) {
4018
4012
  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.");
4013
+ const L = new Date(d.expiresAt).getTime();
4014
+ if (Date.now() >= L) {
4015
+ console.warn("[Identity] Token has expired (expiresAt)"), O(!0), C("Your verification session has expired. Please restart.");
4022
4016
  return;
4023
4017
  }
4024
4018
  }
@@ -4026,31 +4020,31 @@ Failed to reload test data. Please refresh the page.`);
4026
4020
  try {
4027
4021
  const D = new URL(d.url).toString().toLowerCase();
4028
4022
  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.");
4023
+ console.warn("[Identity] Token URL indicates expiration"), O(!0), C("Your verification link has expired. Please restart.");
4030
4024
  return;
4031
4025
  }
4032
4026
  } catch {
4033
4027
  console.error("[Identity] Invalid token URL");
4034
4028
  }
4035
4029
  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.");
4030
+ console.warn("[Identity] Token object indicates expiration"), O(!0), C("Your verification session has expired. Please restart.");
4037
4031
  return;
4038
4032
  }
4039
4033
  }
4040
- }, [d]), Y(() => {
4041
- if (c !== null && d && !b && I && !M) {
4042
- const F = c;
4034
+ }, [d]), W(() => {
4035
+ if (c !== null && d && !b && E && !F) {
4036
+ const L = c;
4043
4037
  if (d.url) {
4044
- console.log("[Identity] Loading provider URL for user verification:", d.url), A(null);
4038
+ console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
4045
4039
  try {
4046
- if (new URL(d.url), F === oe.SardinAI) {
4040
+ if (new URL(d.url), L === oe.SardinAI) {
4047
4041
  console.log("[SardinAI] Initializing Risk SDK in background...");
4048
4042
  try {
4049
4043
  const D = fe.parseProviderConfig(c, d, i);
4050
4044
  fe.createProvider(c, D).initialize().then(() => {
4051
4045
  console.log("[SardinAI] Risk SDK initialized successfully in background");
4052
- }).catch((V) => {
4053
- console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", V);
4046
+ }).catch((Y) => {
4047
+ console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", Y);
4054
4048
  });
4055
4049
  } catch (D) {
4056
4050
  console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
@@ -4058,80 +4052,80 @@ Failed to reload test data. Please refresh the page.`);
4058
4052
  }
4059
4053
  m({ type: "url", url: d.url });
4060
4054
  } catch (D) {
4061
- console.error("[Identity] Invalid URL:", D), A("Invalid verification URL. Please restart."), B(!0);
4055
+ console.error("[Identity] Invalid URL:", D), C("Invalid verification URL. Please restart."), O(!0);
4062
4056
  }
4063
4057
  return;
4064
4058
  }
4065
- if (F === oe.SardinAI) {
4066
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), A(null);
4059
+ if (L === oe.SardinAI) {
4060
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), C(null);
4067
4061
  try {
4068
4062
  const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
4069
4063
  G.initialize().then(() => {
4070
4064
  console.log("[SardinAI] Risk SDK initialized successfully"), m(G), setTimeout(() => {
4071
4065
  e == null || e();
4072
4066
  }, 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}`);
4067
+ }).catch((Y) => {
4068
+ var j;
4069
+ console.error("[SardinAI] Failed to initialize:", Y);
4070
+ const ae = ((j = Y.message) == null ? void 0 : j.toLowerCase()) || "";
4071
+ 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
4072
  });
4079
4073
  } catch (D) {
4080
- console.error("[SardinAI] Error creating provider:", D), A(`Configuration error: ${D.message}`);
4074
+ console.error("[SardinAI] Error creating provider:", D), C(`Configuration error: ${D.message}`);
4081
4075
  }
4082
4076
  return;
4083
4077
  }
4084
4078
  try {
4085
- A(null);
4079
+ C(null);
4086
4080
  const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
4087
- F === oe.Sumsub ? (G.initialize("identity-container").catch((V) => {
4081
+ L === oe.Sumsub ? (G.initialize("identity-container").catch((Y) => {
4088
4082
  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);
4083
+ console.error("[Sumsub] Initialization error:", Y), C(`Failed to initialize: ${Y.message}`), (ae = Y.message) != null && ae.toLowerCase().includes("expired") && O(!0);
4090
4084
  }), G.onComplete && G.onComplete(() => {
4091
4085
  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}`);
4086
+ })) : L === oe.Onfido && G.initialize("identity-container").catch((Y) => {
4087
+ console.error("[Onfido] Initialization error:", Y), C(`Failed to initialize: ${Y.message}`);
4094
4088
  }), m(G);
4095
4089
  } catch (D) {
4096
- console.error("[Identity] Provider setup error:", D), A(`Setup error: ${D.message}`);
4090
+ console.error("[Identity] Provider setup error:", D), C(`Setup error: ${D.message}`);
4097
4091
  }
4098
4092
  }
4099
4093
  return () => {
4100
4094
  if (b && b.destroy)
4101
4095
  try {
4102
4096
  b.destroy();
4103
- } catch (F) {
4104
- console.error("[Identity] Error destroying provider:", F);
4097
+ } catch (L) {
4098
+ console.error("[Identity] Error destroying provider:", L);
4105
4099
  }
4106
4100
  };
4107
- }, [c, d, b, I, e, M]);
4101
+ }, [c, d, b, E, e, F]);
4108
4102
  const p = async () => {
4109
4103
  try {
4110
- A(null), B(!1), await x(), P(!0);
4111
- } catch (F) {
4112
- console.error("Error starting identity verification:", F);
4104
+ C(null), O(!1), await v(), P(!0);
4105
+ } catch (L) {
4106
+ console.error("Error starting identity verification:", L);
4113
4107
  }
4114
- }, w = async () => {
4108
+ }, x = async () => {
4115
4109
  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");
4110
+ C(null), O(!1), m(null), console.log("[Identity] Restarting verification..."), await g(), P(!0);
4111
+ } catch (L) {
4112
+ console.error("Error restarting identity verification:", L), C(L.message || "Failed to restart verification");
4119
4113
  }
4120
4114
  };
4121
- if (v || u)
4122
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4115
+ if (S || u)
4116
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4123
4117
  /* @__PURE__ */ n(ce, { className: "my-8" }),
4124
4118
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4125
4119
  ] }) });
4126
4120
  if (y)
4127
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4121
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4128
4122
  "Error: ",
4129
4123
  y.message
4130
4124
  ] }) }) });
4131
- if (I && (C || M))
4132
- return /* @__PURE__ */ o(L, { children: [
4125
+ if (E && (I || F))
4126
+ return /* @__PURE__ */ o(T, { children: [
4133
4127
  /* @__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: [
4128
+ /* @__PURE__ */ o(M, { children: [
4135
4129
  /* @__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
4130
  /* @__PURE__ */ n(
4137
4131
  "svg",
@@ -4152,8 +4146,8 @@ Failed to reload test data. Please refresh the page.`);
4152
4146
  }
4153
4147
  ),
4154
4148
  /* @__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." })
4149
+ /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: F ? "Session Expired" : "Verification Error" }),
4150
+ /* @__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
4151
  ] })
4158
4152
  ] }) }),
4159
4153
  /* @__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 +4160,31 @@ Failed to reload test data. Please refresh the page.`);
4166
4160
  ] })
4167
4161
  ] }),
4168
4162
  /* @__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" })
4163
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4164
+ /* @__PURE__ */ n(_, { type: "button", onClick: x, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4171
4165
  ] })
4172
4166
  ] });
4173
- if (I && l) {
4174
- const F = c;
4175
- return d != null && d.url ? /* @__PURE__ */ o(L, { children: [
4167
+ if (E && l) {
4168
+ const L = c;
4169
+ return d != null && d.url ? /* @__PURE__ */ o(T, { children: [
4176
4170
  /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4177
4171
  /* @__PURE__ */ o("div", { children: [
4178
4172
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4179
4173
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4180
4174
  ] }),
4181
4175
  /* @__PURE__ */ n(
4182
- j,
4176
+ _,
4183
4177
  {
4184
4178
  type: "button",
4185
4179
  variant: "outline",
4186
4180
  size: "sm",
4187
- onClick: w,
4181
+ onClick: x,
4188
4182
  disabled: u,
4189
4183
  children: "Restart"
4190
4184
  }
4191
4185
  )
4192
4186
  ] }) }),
4193
- /* @__PURE__ */ o(T, { children: [
4187
+ /* @__PURE__ */ o(M, { children: [
4194
4188
  /* @__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
4189
  /* @__PURE__ */ n("strong", { children: "Important:" }),
4196
4190
  ' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
@@ -4203,13 +4197,13 @@ Failed to reload test data. Please refresh the page.`);
4203
4197
  allow: "camera; microphone; geolocation",
4204
4198
  title: "Identity Verification",
4205
4199
  onLoad: (D) => {
4206
- var G, V, ae;
4200
+ var G, Y, ae;
4207
4201
  console.log("[Identity] Iframe loaded");
4208
4202
  try {
4209
- const $ = D.target, Ce = $.contentDocument || ((G = $.contentWindow) == null ? void 0 : G.document);
4203
+ const j = D.target, Ce = j.contentDocument || ((G = j.contentWindow) == null ? void 0 : G.document);
4210
4204
  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."));
4205
+ const me = ((ae = (Y = Ce.body) == null ? void 0 : Y.textContent) == null ? void 0 : ae.toLowerCase()) || "";
4206
+ (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
4207
  }
4214
4208
  } catch {
4215
4209
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4218,39 +4212,39 @@ Failed to reload test data. Please refresh the page.`);
4218
4212
  }
4219
4213
  ) })
4220
4214
  ] }),
4221
- r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4222
- ] }) : F === oe.SardinAI ? /* @__PURE__ */ o(L, { children: [
4215
+ r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4216
+ ] }) : L === oe.SardinAI ? /* @__PURE__ */ o(T, { children: [
4223
4217
  /* @__PURE__ */ o(ee, { children: [
4224
4218
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4225
4219
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4226
4220
  ] }),
4227
- /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4221
+ /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4228
4222
  /* @__PURE__ */ n(ce, { className: "mb-4" }),
4229
4223
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4230
4224
  /* @__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
4225
  ] }) })
4232
- ] }) : /* @__PURE__ */ o(L, { children: [
4226
+ ] }) : /* @__PURE__ */ o(T, { children: [
4233
4227
  /* @__PURE__ */ o(ee, { children: [
4234
4228
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4235
4229
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4236
4230
  ] }),
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" }) })
4231
+ /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4232
+ r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4239
4233
  ] });
4240
4234
  }
4241
- return /* @__PURE__ */ n("form", { onSubmit: _.handleSubmit(p), children: /* @__PURE__ */ o(L, { children: [
4235
+ return /* @__PURE__ */ n("form", { onSubmit: U.handleSubmit(p), children: /* @__PURE__ */ o(T, { children: [
4242
4236
  /* @__PURE__ */ o(ee, { children: [
4243
4237
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
4244
4238
  /* @__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
4239
  ] }),
4246
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
4240
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
4247
4241
  /* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
4248
4242
  /* @__PURE__ */ o("div", { children: [
4249
4243
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4250
4244
  /* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
4251
- (O = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : O.firstName,
4245
+ (z = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : z.firstName,
4252
4246
  " ",
4253
- (z = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : z.lastName
4247
+ ($ = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : $.lastName
4254
4248
  ] })
4255
4249
  ] }),
4256
4250
  /* @__PURE__ */ o("div", { children: [
@@ -4268,12 +4262,12 @@ Failed to reload test data. Please refresh the page.`);
4268
4262
  /* @__PURE__ */ n(
4269
4263
  J,
4270
4264
  {
4271
- control: _.control,
4265
+ control: U.control,
4272
4266
  name: "country",
4273
- render: ({ field: F }) => /* @__PURE__ */ n(
4267
+ render: ({ field: L }) => /* @__PURE__ */ n(
4274
4268
  ye,
4275
4269
  {
4276
- ...F,
4270
+ ...L,
4277
4271
  label: "Country",
4278
4272
  options: [
4279
4273
  { value: "", label: "Select country..." },
@@ -4289,12 +4283,12 @@ Failed to reload test data. Please refresh the page.`);
4289
4283
  /* @__PURE__ */ n(
4290
4284
  J,
4291
4285
  {
4292
- control: _.control,
4286
+ control: U.control,
4293
4287
  name: "nationality",
4294
- render: ({ field: F }) => /* @__PURE__ */ n(
4288
+ render: ({ field: L }) => /* @__PURE__ */ n(
4295
4289
  ye,
4296
4290
  {
4297
- ...F,
4291
+ ...L,
4298
4292
  label: "Nationality",
4299
4293
  options: [
4300
4294
  { value: "", label: "Select nationality..." },
@@ -4312,17 +4306,17 @@ Failed to reload test data. Please refresh the page.`);
4312
4306
  /* @__PURE__ */ n(
4313
4307
  J,
4314
4308
  {
4315
- control: _.control,
4309
+ control: U.control,
4316
4310
  name: "street",
4317
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street" })
4311
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "Street" })
4318
4312
  }
4319
4313
  ),
4320
4314
  /* @__PURE__ */ n(
4321
4315
  J,
4322
4316
  {
4323
- control: _.control,
4317
+ control: U.control,
4324
4318
  name: "streetNumber",
4325
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street Number" })
4319
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "Street Number" })
4326
4320
  }
4327
4321
  )
4328
4322
  ] }),
@@ -4330,33 +4324,33 @@ Failed to reload test data. Please refresh the page.`);
4330
4324
  /* @__PURE__ */ n(
4331
4325
  J,
4332
4326
  {
4333
- control: _.control,
4327
+ control: U.control,
4334
4328
  name: "city",
4335
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "City" })
4329
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "City" })
4336
4330
  }
4337
4331
  ),
4338
4332
  /* @__PURE__ */ n(
4339
4333
  J,
4340
4334
  {
4341
- control: _.control,
4335
+ control: U.control,
4342
4336
  name: "zip",
4343
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "ZIP/Postal Code" })
4337
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "ZIP/Postal Code" })
4344
4338
  }
4345
4339
  )
4346
4340
  ] }),
4347
4341
  /* @__PURE__ */ n(
4348
4342
  J,
4349
4343
  {
4350
- control: _.control,
4344
+ control: U.control,
4351
4345
  name: "phonenumber",
4352
- render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Phone Number", type: "tel" })
4346
+ render: ({ field: L }) => /* @__PURE__ */ n(X, { ...L, label: "Phone Number", type: "tel" })
4353
4347
  }
4354
4348
  )
4355
4349
  ] })
4356
4350
  ] }),
4357
4351
  /* @__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" })
4352
+ r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4353
+ /* @__PURE__ */ n(_, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4360
4354
  ] })
4361
4355
  ] }) });
4362
4356
  }, je = ({
@@ -4438,8 +4432,8 @@ Failed to reload test data. Please refresh the page.`);
4438
4432
  iconColor: "text-blue-600 dark:text-blue-400",
4439
4433
  message: "Your application is being reviewed."
4440
4434
  };
4441
- return /* @__PURE__ */ o(L, { children: [
4442
- /* @__PURE__ */ o(T, { className: "py-12", children: [
4435
+ return /* @__PURE__ */ o(T, { children: [
4436
+ /* @__PURE__ */ o(M, { className: "py-12", children: [
4443
4437
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4444
4438
  "div",
4445
4439
  {
@@ -4493,10 +4487,10 @@ Failed to reload test data. Please refresh the page.`);
4493
4487
  ] }) })
4494
4488
  ] }),
4495
4489
  /* @__PURE__ */ o(ne, { className: "flex justify-center gap-4", children: [
4496
- c.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
4490
+ c.type === "success" && a && /* @__PURE__ */ n(_, { onClick: a, size: "lg", children: "Continue" }),
4497
4491
  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" })
4492
+ i && /* @__PURE__ */ n(_, { variant: "outline", onClick: i, children: "Contact Support" }),
4493
+ a && /* @__PURE__ */ n(_, { onClick: a, children: "Try Again" })
4500
4494
  ] }),
4501
4495
  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
4496
  ] })
@@ -4535,21 +4529,21 @@ Failed to reload test data. Please refresh the page.`);
4535
4529
  onSuccess: r,
4536
4530
  onCancel: s
4537
4531
  }) => {
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)
4532
+ var O, V, U;
4533
+ 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);
4534
+ if (!A)
4541
4535
  throw new Error(
4542
4536
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
4543
4537
  );
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,
4538
+ const S = e || ((V = a.applicantForm) == null ? void 0 : V.externalRefId) || "", w = ((U = a.applicantForm) == null ? void 0 : U.visibleFields) || gt, [E, P] = N({
4539
+ workflowKey: A,
4546
4540
  firstName: "",
4547
4541
  lastName: "",
4548
4542
  title: "",
4549
4543
  email: "",
4550
4544
  dateOfBirth: "",
4551
4545
  phonenumber: "",
4552
- externalRefId: v,
4546
+ externalRefId: S,
4553
4547
  // Set from config or prop
4554
4548
  mobileCountryCode: "",
4555
4549
  street: "",
@@ -4568,67 +4562,67 @@ Failed to reload test data. Please refresh the page.`);
4568
4562
  occupation: "",
4569
4563
  taxNumber: ""
4570
4564
  });
4571
- Y(() => {
4565
+ W(() => {
4572
4566
  (async () => {
4573
4567
  if (k.current || h.current) {
4574
4568
  console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
4575
4569
  return;
4576
4570
  }
4577
- k.current = !0, x(!0);
4571
+ k.current = !0, v(!0);
4578
4572
  try {
4579
- const w = await i.getCountries("", a.locale || "en"), O = /* @__PURE__ */ new Set(), z = w.map((R) => ({
4573
+ const x = await i.getCountries("", a.locale || "en"), z = /* @__PURE__ */ new Set(), $ = x.map((R) => ({
4580
4574
  value: R.abbreviation3 || R.abbreviation,
4581
4575
  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);
4576
+ })).filter((R) => !R.value || z.has(R.value) ? !1 : (z.add(R.value), !0));
4577
+ u($), h.current = !0;
4578
+ } catch (x) {
4579
+ console.error("Failed to load countries:", x);
4586
4580
  } finally {
4587
- x(!1), k.current = !1;
4581
+ v(!1), k.current = !1;
4588
4582
  }
4589
4583
  })();
4590
4584
  }, []);
4591
- const C = (p, w) => {
4592
- P((O) => ({ ...O, [p]: w }));
4593
- }, A = async (p) => {
4585
+ const I = (p, x) => {
4586
+ P((z) => ({ ...z, [p]: x }));
4587
+ }, C = async (p) => {
4594
4588
  p.preventDefault(), b(!0), f(null);
4595
4589
  try {
4596
- if (!I.externalRefId || I.externalRefId.trim() === "") {
4590
+ if (!E.externalRefId || E.externalRefId.trim() === "") {
4597
4591
  f("External Reference ID is required and cannot be empty"), b(!1);
4598
4592
  return;
4599
4593
  }
4600
- const w = {
4601
- workflowKey: I.workflowKey,
4602
- externalRefId: I.externalRefId.trim()
4594
+ const x = {
4595
+ workflowKey: E.workflowKey,
4596
+ externalRefId: E.externalRefId.trim()
4603
4597
  // Always include, never empty
4604
4598
  };
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
4599
+ w.forEach(($) => {
4600
+ if ($ === "externalRefId") return;
4601
+ const R = E[$];
4602
+ R != null && R !== "" && !(Array.isArray(R) && R.length === 0) && (x[$] = R);
4603
+ }), console.log("Creating applicant with data:", x);
4604
+ const z = await l(
4605
+ x
4612
4606
  );
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");
4607
+ console.log("Applicant created:", z), r(z.applicantId);
4608
+ } catch (x) {
4609
+ console.error("Error creating applicant:", x), f(x.message || "Failed to create applicant");
4616
4610
  } finally {
4617
4611
  b(!1);
4618
4612
  }
4619
- }, M = (p) => {
4620
- var O, z;
4621
- const w = yt[p];
4622
- switch (w.type) {
4613
+ }, F = (p) => {
4614
+ var z, $;
4615
+ const x = yt[p];
4616
+ switch (x.type) {
4623
4617
  case "select":
4624
4618
  return p === "country" || p === "nationality" || p === "taxCountry" || p === "countryOfBirth" ? /* @__PURE__ */ n(
4625
4619
  ye,
4626
4620
  {
4627
- label: w.label,
4628
- value: I[p] || "",
4629
- onChange: (R) => C(p, R.target.value),
4621
+ label: x.label,
4622
+ value: E[p] || "",
4623
+ onChange: (R) => I(p, R.target.value),
4630
4624
  options: [
4631
- { value: "", label: `Select ${w.label.toLowerCase()}...` },
4625
+ { value: "", label: `Select ${x.label.toLowerCase()}...` },
4632
4626
  ...d
4633
4627
  ],
4634
4628
  disabled: y
@@ -4637,9 +4631,9 @@ Failed to reload test data. Please refresh the page.`);
4637
4631
  ) : p === "salutation" ? /* @__PURE__ */ n(
4638
4632
  ye,
4639
4633
  {
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),
4634
+ label: x.label,
4635
+ value: ((z = E[p]) == null ? void 0 : z.toString()) || "",
4636
+ onChange: (R) => I(p, R.target.value ? Number(R.target.value) : null),
4643
4637
  options: [
4644
4638
  { value: "", label: "Select salutation..." },
4645
4639
  { value: Se.Male.toString(), label: "Male" },
@@ -4654,11 +4648,11 @@ Failed to reload test data. Please refresh the page.`);
4654
4648
  X,
4655
4649
  {
4656
4650
  type: "text",
4657
- label: w.label,
4658
- value: ((z = I[p]) == null ? void 0 : z.join(", ")) || "",
4651
+ label: x.label,
4652
+ value: (($ = E[p]) == null ? void 0 : $.join(", ")) || "",
4659
4653
  onChange: (R) => {
4660
- const we = R.target.value.split(",").map((F) => F.trim()).filter(Boolean);
4661
- C(p, we);
4654
+ const we = R.target.value.split(",").map((L) => L.trim()).filter(Boolean);
4655
+ I(p, we);
4662
4656
  },
4663
4657
  placeholder: "Enter countries separated by commas"
4664
4658
  },
@@ -4669,9 +4663,9 @@ Failed to reload test data. Please refresh the page.`);
4669
4663
  X,
4670
4664
  {
4671
4665
  type: "date",
4672
- label: w.label,
4673
- value: I[p] || "",
4674
- onChange: (R) => C(p, R.target.value)
4666
+ label: x.label,
4667
+ value: E[p] || "",
4668
+ onChange: (R) => I(p, R.target.value)
4675
4669
  },
4676
4670
  p
4677
4671
  );
@@ -4680,9 +4674,9 @@ Failed to reload test data. Please refresh the page.`);
4680
4674
  X,
4681
4675
  {
4682
4676
  type: "email",
4683
- label: w.label,
4684
- value: I[p] || "",
4685
- onChange: (R) => C(p, R.target.value),
4677
+ label: x.label,
4678
+ value: E[p] || "",
4679
+ onChange: (R) => I(p, R.target.value),
4686
4680
  required: p === "email"
4687
4681
  },
4688
4682
  p
@@ -4692,9 +4686,9 @@ Failed to reload test data. Please refresh the page.`);
4692
4686
  X,
4693
4687
  {
4694
4688
  type: "tel",
4695
- label: w.label,
4696
- value: I[p] || "",
4697
- onChange: (R) => C(p, R.target.value),
4689
+ label: x.label,
4690
+ value: E[p] || "",
4691
+ onChange: (R) => I(p, R.target.value),
4698
4692
  required: p === "phonenumber"
4699
4693
  },
4700
4694
  p
@@ -4705,19 +4699,19 @@ Failed to reload test data. Please refresh the page.`);
4705
4699
  X,
4706
4700
  {
4707
4701
  type: "text",
4708
- label: w.label,
4709
- value: I[p] || "",
4710
- onChange: (R) => C(p, R.target.value),
4702
+ label: x.label,
4703
+ value: E[p] || "",
4704
+ onChange: (R) => I(p, R.target.value),
4711
4705
  required: p === "firstName" || p === "lastName" || p === "externalRefId"
4712
4706
  },
4713
4707
  p
4714
4708
  );
4715
4709
  }
4716
4710
  };
4717
- return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4711
+ return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4718
4712
  /* @__PURE__ */ n(ce, { className: "my-8" }),
4719
4713
  /* @__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: [
4714
+ ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: C, children: /* @__PURE__ */ o(T, { children: [
4721
4715
  /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
4722
4716
  Ze,
4723
4717
  {
@@ -4725,17 +4719,17 @@ Failed to reload test data. Please refresh the page.`);
4725
4719
  subtitle: "Please fill in the required information to begin the KYC verification process."
4726
4720
  }
4727
4721
  ) }),
4728
- /* @__PURE__ */ o(T, { children: [
4722
+ /* @__PURE__ */ o(M, { children: [
4729
4723
  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
4724
  /* @__PURE__ */ n("strong", { children: "Error:" }),
4731
4725
  " ",
4732
4726
  m
4733
4727
  ] }) }),
4734
- /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: S.map((p) => M(p)) })
4728
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: w.map((p) => F(p)) })
4735
4729
  ] }),
4736
4730
  /* @__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" })
4731
+ s && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: s, disabled: g || c, children: "Cancel" }),
4732
+ /* @__PURE__ */ n(_, { type: "submit", isLoading: g || c, children: "Create Applicant" })
4739
4733
  ] })
4740
4734
  ] }) }) });
4741
4735
  }, Wr = ({
@@ -4752,7 +4746,7 @@ Failed to reload test data. Please refresh the page.`);
4752
4746
  workflowKey: d,
4753
4747
  nextWorkflowKey: u,
4754
4748
  hasWorkflowChanged: y,
4755
- isLoading: x,
4749
+ isLoading: v,
4756
4750
  error: g,
4757
4751
  moveBack: b,
4758
4752
  refreshProgress: m
@@ -4765,18 +4759,18 @@ Failed to reload test data. Please refresh the page.`);
4765
4759
  s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
4766
4760
  }, [s]), ie.useEffect(() => {
4767
4761
  y && k(!1);
4768
- }, [y]), x || !i)
4769
- return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4762
+ }, [y]), v || !i)
4763
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4770
4764
  /* @__PURE__ */ n(ce, { className: "my-8" }),
4771
4765
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
4772
4766
  ] }) }) });
4773
4767
  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: [
4768
+ 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
4769
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
4776
4770
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
4777
4771
  ] }) }) }) });
4778
4772
  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: [
4773
+ 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
4774
  /* @__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
4775
  /* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
4782
4776
  /* @__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 +4812,47 @@ Failed to reload test data. Please refresh the page.`);
4818
4812
  }
4819
4813
  ) });
4820
4814
  if (!l)
4821
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4815
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4822
4816
  /* @__PURE__ */ n(ce, { className: "my-8" }),
4823
4817
  /* @__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
4818
  ] }) }) });
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;
4819
+ const h = (w) => {
4820
+ switch (w) {
4821
+ case B.Overview:
4822
+ return "Overview";
4823
+ case B.Questionaries:
4824
+ return "Questionnaire";
4825
+ case B.UploadDocument:
4826
+ return "Documents";
4827
+ case B.IdentitySdk:
4828
+ return "Identity";
4829
+ case B.RiskScoring:
4830
+ return "Risk Assessment";
4831
+ case B.InvestorCategorization:
4832
+ return "Investor Categorization";
4833
+ case B.AppropriatenessTest:
4834
+ return "Appropriateness Test";
4835
+ case B.AdditionalData:
4836
+ return "Additional Data";
4837
+ case B.ManualReview:
4838
+ return "Review";
4839
+ default:
4840
+ return "";
4841
+ }
4842
+ }, A = () => {
4843
+ 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
4844
  return /* @__PURE__ */ o("div", { className: "mb-6", children: [
4828
4845
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
4829
4846
  /* @__PURE__ */ n(Ze, {}),
4830
4847
  /* @__PURE__ */ o(he, { variant: i.status === 1 ? "info" : "success", children: [
4831
4848
  "Step ",
4832
- I,
4849
+ P,
4833
4850
  " of ",
4834
- P
4851
+ I
4835
4852
  ] })
4836
4853
  ] }),
4837
- /* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C, A) => {
4838
- const M = A < S, B = C.order === l.order;
4854
+ /* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((C, F) => {
4855
+ const O = F < E, V = C.order === l.order;
4839
4856
  return /* @__PURE__ */ o(ie.Fragment, { children: [
4840
4857
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
4841
4858
  /* @__PURE__ */ n(
@@ -4843,30 +4860,30 @@ Failed to reload test data. Please refresh the page.`);
4843
4860
  {
4844
4861
  className: `
4845
4862
  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"}
4863
+ ${O || V ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4847
4864
  `,
4848
- children: A + 1
4865
+ children: F + 1
4849
4866
  }
4850
4867
  ),
4851
4868
  /* @__PURE__ */ n(
4852
4869
  "span",
4853
4870
  {
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}`
4871
+ className: `ml-2 text-sm ${V ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4872
+ children: C.displayName || C.name || h(C.action) || `Step ${F + 1}`
4856
4873
  }
4857
4874
  )
4858
4875
  ] }),
4859
- A < v.length - 1 && /* @__PURE__ */ n(
4876
+ F < w.length - 1 && /* @__PURE__ */ n(
4860
4877
  "div",
4861
4878
  {
4862
- className: `flex-1 h-0.5 mx-4 ${M ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4879
+ className: `flex-1 h-0.5 mx-4 ${O ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4863
4880
  }
4864
4881
  )
4865
4882
  ] }, C.order);
4866
4883
  }) })
4867
4884
  ] });
4868
- }, E = () => {
4869
- const v = {
4885
+ }, S = () => {
4886
+ const w = {
4870
4887
  applicantId: t,
4871
4888
  onComplete: async () => {
4872
4889
  await m();
@@ -4874,22 +4891,22 @@ Failed to reload test data. Please refresh the page.`);
4874
4891
  onBack: l.order > 0 ? b : void 0
4875
4892
  };
4876
4893
  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:
4894
+ case B.Questionaries:
4895
+ return /* @__PURE__ */ n(xr, { ...w });
4896
+ case B.UploadDocument:
4897
+ return /* @__PURE__ */ n(wr, { ...w });
4898
+ case B.Overview:
4899
+ return /* @__PURE__ */ n(kr, { ...w });
4900
+ case B.IdentitySdk:
4901
+ return /* @__PURE__ */ n(Ar, { ...w });
4902
+ case B.RiskScoring:
4903
+ return /* @__PURE__ */ n(Nr, { ...w });
4904
+ case B.AdditionalData:
4905
+ case B.InvestorCategorization:
4906
+ return /* @__PURE__ */ n(Sr, { ...w });
4907
+ case B.AppropriatenessTest:
4908
+ return /* @__PURE__ */ n(Cr, { ...w });
4909
+ case B.ManualReview:
4893
4910
  return /* @__PURE__ */ n(
4894
4911
  je,
4895
4912
  {
@@ -4900,7 +4917,7 @@ Failed to reload test data. Please refresh the page.`);
4900
4917
  }
4901
4918
  );
4902
4919
  default:
4903
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
4920
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
4904
4921
  /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ce, {}) }),
4905
4922
  /* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
4906
4923
  "Processing step: ",
@@ -4908,14 +4925,14 @@ Failed to reload test data. Please refresh the page.`);
4908
4925
  ] }),
4909
4926
  /* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
4910
4927
  "Action type: ",
4911
- U[l.action]
4928
+ B[l.action]
4912
4929
  ] })
4913
4930
  ] }) });
4914
4931
  }
4915
4932
  };
4916
4933
  return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
4917
- h(),
4918
- E()
4934
+ A(),
4935
+ S()
4919
4936
  ] });
4920
4937
  };
4921
4938
  export {
@@ -4929,9 +4946,9 @@ export {
4929
4946
  Cr as AppropriatenessTestStep,
4930
4947
  he as Badge,
4931
4948
  Et as BaseInformationService,
4932
- j as Button,
4933
- L as Card,
4934
- T as CardContent,
4949
+ _ as Button,
4950
+ T as Card,
4951
+ M as CardContent,
4935
4952
  ne as CardFooter,
4936
4953
  ee as CardHeader,
4937
4954
  Yr as CreateApplicantForm,
@@ -4961,7 +4978,7 @@ export {
4961
4978
  je as KycStatusDisplay,
4962
4979
  Wr as KycWorkflow,
4963
4980
  Er as Logo,
4964
- Ue as MetaKYCContext,
4981
+ Ke as MetaKYCContext,
4965
4982
  de as MetaKYCError,
4966
4983
  Or as MetaKYCProvider,
4967
4984
  _t as OnfidoProvider,
@@ -4975,13 +4992,13 @@ export {
4975
4992
  at as RiskLevel,
4976
4993
  Ct as RiskScoringService,
4977
4994
  Nr as RiskScoringStep,
4978
- Kt as SardinAIProvider,
4995
+ Ut as SardinAIProvider,
4979
4996
  ye as Select,
4980
4997
  ce as Spinner,
4981
4998
  zt as StepRouter,
4982
4999
  jt as SumsubProvider,
4983
- Ut as ThemeManager,
4984
- W as ThemePreset,
5000
+ Kt as ThemeManager,
5001
+ Q as ThemePreset,
4985
5002
  Mt as ThemeService,
4986
5003
  kt as UploadDocumentService,
4987
5004
  wr as UploadDocumentStep,
@@ -4990,9 +5007,9 @@ export {
4990
5007
  $t as WorkflowOrchestrator,
4991
5008
  Ne as WorkflowResultType,
4992
5009
  Ot as WorkflowState,
4993
- U as WorkflowStepAction,
5010
+ B as WorkflowStepAction,
4994
5011
  Vr as appropriatenessTestSchema,
4995
- Kr as clearAllStorage,
5012
+ Ur as clearAllStorage,
4996
5013
  Yt as clearApplicantId,
4997
5014
  Qt as clearWorkflowState,
4998
5015
  te as cn,
@@ -5012,7 +5029,7 @@ export {
5012
5029
  _r as getWorkflowState,
5013
5030
  Pt as healthcareTheme,
5014
5031
  Mr as isScriptLoaded,
5015
- Ke as loadScript,
5032
+ Ue as loadScript,
5016
5033
  Lt as minimalTheme,
5017
5034
  Ft as modernTheme,
5018
5035
  Br as removeScript,
@@ -5020,7 +5037,7 @@ export {
5020
5037
  Wt as saveWorkflowState,
5021
5038
  Tt as themePresets,
5022
5039
  rr as useApplicant,
5023
- Ur as useAppropriatenessTest,
5040
+ Kr as useAppropriatenessTest,
5024
5041
  er as useIdentityVerification,
5025
5042
  Gt as useKycWorkflow,
5026
5043
  se as useMetaKYC,