@vpdev2/metakyc-sdk 1.0.45 → 1.0.46

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 ot = (e, t, r) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var V = (e, t, r) => ot(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import ct from "axios";
5
5
  import * as Ze from "react";
6
- import ge, { createContext as dt, useState as x, useMemo as ke, useEffect as X, useContext as ut, useRef as J, useCallback as Y, forwardRef as $e, createElement as We } from "react";
6
+ import ge, { createContext as dt, useState as x, useMemo as we, useEffect as ee, useContext as ut, useRef as X, useCallback as Y, forwardRef as Be, createElement as We } from "react";
7
7
  import { jsx as a, jsxs as i, Fragment as mt } from "react/jsx-runtime";
8
8
  import { useForm as pt, Controller as Ie } from "react-hook-form";
9
9
  import { z as Ne } from "zod";
10
- var _ = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(_ || {}), _e = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(_e || {}), fe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(fe || {}), ht = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(ht || {}), gt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(gt || {}), Ee = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(Ee || {}), Re = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(Re || {}), yt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(yt || {}), ft = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(ft || {}), ye = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ye || {}), xt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(xt || {}), Ue = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ue || {}), bt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(bt || {}), vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(vt || {}), wt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(wt || {}), Ce = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ce || {}), kt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(kt || {}), Nt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Nt || {}), pe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(pe || {}), St = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(St || {});
10
+ var _ = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(_ || {}), _e = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(_e || {}), fe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(fe || {}), ht = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(ht || {}), gt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(gt || {}), Ee = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(Ee || {}), Re = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(Re || {}), yt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(yt || {}), ft = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(ft || {}), ye = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ye || {}), xt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(xt || {}), Ue = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ue || {}), bt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(bt || {}), vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(vt || {}), kt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(kt || {}), Ce = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ce || {}), wt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(wt || {}), Nt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Nt || {}), pe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(pe || {}), St = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(St || {});
11
11
  const Ke = {
12
12
  firstName: { label: "First Name", type: "text" },
13
13
  lastName: { label: "Last Name", type: "text" },
@@ -56,7 +56,7 @@ const Ke = {
56
56
  { value: "FI", label: "Finnish" },
57
57
  { value: "NO", label: "Norwegian" }
58
58
  ];
59
- var se = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(se || {});
59
+ var ie = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(ie || {});
60
60
  const At = {
61
61
  timeout: 3e4,
62
62
  retries: 3,
@@ -105,11 +105,11 @@ class It {
105
105
  }[t] || t;
106
106
  }
107
107
  }
108
- class we extends Error {
108
+ class ke extends Error {
109
109
  constructor(r, n, s, l, o) {
110
110
  super(r);
111
111
  V(this, "response");
112
- this.code = n, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = o, Object.setPrototypeOf(this, we.prototype);
112
+ this.code = n, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = o, Object.setPrototypeOf(this, ke.prototype);
113
113
  }
114
114
  }
115
115
  class Te {
@@ -117,7 +117,7 @@ class Te {
117
117
  * Process an error from the API response
118
118
  */
119
119
  static handleApiError(t) {
120
- return new we(
120
+ return new ke(
121
121
  t.message || "An unknown error occurred",
122
122
  t.code,
123
123
  t.details || void 0,
@@ -130,36 +130,36 @@ class Te {
130
130
  static handleAxiosError(t) {
131
131
  if (t.response) {
132
132
  const r = t.response.data;
133
- return r && r.error ? new we(
133
+ return r && r.error ? new ke(
134
134
  r.error.message || "An unknown error occurred",
135
135
  r.error.code,
136
136
  r.error.details || void 0,
137
137
  r.error.validationErrors || void 0,
138
138
  t.response
139
- ) : r && r.result && r.result.message ? new we(
139
+ ) : r && r.result && r.result.message ? new ke(
140
140
  r.result.message,
141
141
  t.response.status,
142
142
  `HTTP ${t.response.status}: ${t.response.statusText}`,
143
143
  void 0,
144
144
  t.response
145
- ) : new we(
145
+ ) : new ke(
146
146
  (r == null ? void 0 : r.message) || t.message || "Request failed",
147
147
  t.response.status,
148
148
  `HTTP ${t.response.status}: ${t.response.statusText}`,
149
149
  void 0,
150
150
  t.response
151
151
  );
152
- } else return t.request ? new we(
152
+ } else return t.request ? new ke(
153
153
  "No response from server",
154
154
  0,
155
155
  "The request was made but no response was received. Please check your network connection."
156
- ) : new we(t.message || "An unexpected error occurred", 0, t.toString());
156
+ ) : new ke(t.message || "An unexpected error occurred", 0, t.toString());
157
157
  }
158
158
  /**
159
159
  * Check if an error is a MetaKYCError
160
160
  */
161
161
  static isMetaKYCError(t) {
162
- return t instanceof we;
162
+ return t instanceof ke;
163
163
  }
164
164
  }
165
165
  class Et {
@@ -865,12 +865,12 @@ const de = {
865
865
  inputHeight: "2.25rem"
866
866
  }
867
867
  }, Kt = {
868
- [se.Default]: de,
869
- [se.Corporate]: Bt,
870
- [se.Fintech]: zt,
871
- [se.Healthcare]: _t,
872
- [se.Modern]: Ut,
873
- [se.Minimal]: qt
868
+ [ie.Default]: de,
869
+ [ie.Corporate]: Bt,
870
+ [ie.Fintech]: zt,
871
+ [ie.Healthcare]: _t,
872
+ [ie.Modern]: Ut,
873
+ [ie.Minimal]: qt
874
874
  };
875
875
  function Oe(e) {
876
876
  return Kt[e] || de;
@@ -890,8 +890,8 @@ class jt {
890
890
  "GetThemeConfiguration"
891
891
  );
892
892
  if (!r.result.isEnabled)
893
- return Oe(se.Default);
894
- let n = r.result.preset ? Oe(r.result.preset) : Oe(se.Default);
893
+ return Oe(ie.Default);
894
+ let n = r.result.preset ? Oe(r.result.preset) : Oe(ie.Default);
895
895
  if (r.result.title && (n.title = r.result.title), r.result.logo && (n.logo = { ...n.logo, ...r.result.logo }), r.result.colors && (n.colors = { ...n.colors, ...r.result.colors }), r.result.typography && (n.typography = { ...n.typography, ...r.result.typography }), r.result.spacing && (n.spacing = { ...n.spacing, ...r.result.spacing }), r.result.customCSS && (n.customCSS = r.result.customCSS), r.result.darkMode && (n.darkMode = {
896
896
  colors: {
897
897
  ...(t = n.darkMode) == null ? void 0 : t.colors,
@@ -905,7 +905,7 @@ class jt {
905
905
  }
906
906
  return n;
907
907
  } catch (r) {
908
- return console.warn("[ThemeService] Failed to fetch theme configuration:", r), Oe(se.Default);
908
+ return console.warn("[ThemeService] Failed to fetch theme configuration:", r), Oe(ie.Default);
909
909
  }
910
910
  }
911
911
  /**
@@ -919,12 +919,12 @@ class jt {
919
919
  */
920
920
  getAvailablePresets() {
921
921
  return [
922
- { id: se.Default, name: "Default" },
923
- { id: se.Corporate, name: "Corporate" },
924
- { id: se.Fintech, name: "Fintech" },
925
- { id: se.Healthcare, name: "Healthcare" },
926
- { id: se.Modern, name: "Modern" },
927
- { id: se.Minimal, name: "Minimal" }
922
+ { id: ie.Default, name: "Default" },
923
+ { id: ie.Corporate, name: "Corporate" },
924
+ { id: ie.Fintech, name: "Fintech" },
925
+ { id: ie.Healthcare, name: "Healthcare" },
926
+ { id: ie.Modern, name: "Modern" },
927
+ { id: ie.Minimal, name: "Minimal" }
928
928
  ];
929
929
  }
930
930
  /**
@@ -1771,23 +1771,23 @@ class Jt {
1771
1771
  }
1772
1772
  }
1773
1773
  const rt = dt(null), Yr = ({ config: e, children: t }) => {
1774
- const [r, n] = x(null), s = ge.useRef(!1), l = ge.useRef(!1), o = ke(() => {
1775
- const u = new Et(e), p = new Rt(u), w = new Ft(u), N = new Dt(u), y = new Pt(u), h = new Lt(u), g = new Mt(u), k = new Tt(u), b = new Ot(u), m = new $t(u), F = new jt(u), S = new Jt();
1774
+ const [r, n] = x(null), s = ge.useRef(!1), l = ge.useRef(!1), o = we(() => {
1775
+ const u = new Et(e), p = new Rt(u), w = new Ft(u), S = new Dt(u), y = new Pt(u), h = new Lt(u), g = new Mt(u), N = new Tt(u), b = new Ot(u), m = new $t(u), R = new jt(u), A = new Jt();
1776
1776
  return {
1777
1777
  httpClient: u,
1778
1778
  applicantService: p,
1779
1779
  questionnaireService: w,
1780
- uploadDocumentService: N,
1780
+ uploadDocumentService: S,
1781
1781
  appropriatenessTestService: y,
1782
1782
  overviewService: h,
1783
1783
  riskScoringService: g,
1784
- identityService: k,
1784
+ identityService: N,
1785
1785
  baseInformationService: b,
1786
1786
  investorCategorizationService: m,
1787
- themeService: F,
1788
- themeManager: S
1787
+ themeService: R,
1788
+ themeManager: A
1789
1789
  };
1790
- }, [e]), c = ke(() => ({
1790
+ }, [e]), c = we(() => ({
1791
1791
  config: e,
1792
1792
  ...o,
1793
1793
  currentTheme: r,
@@ -1802,7 +1802,7 @@ const rt = dt(null), Yr = ({ config: e, children: t }) => {
1802
1802
  o.investorCategorizationService
1803
1803
  )
1804
1804
  }), [e, o, r]);
1805
- return X(() => ((async () => {
1805
+ return ee(() => ((async () => {
1806
1806
  if (s.current || l.current) {
1807
1807
  console.log("[MetaKYC] Theme already loading or loaded, skipping...");
1808
1808
  return;
@@ -1860,7 +1860,7 @@ function je(e) {
1860
1860
  function Gr(e) {
1861
1861
  return e;
1862
1862
  }
1863
- function ie(...e) {
1863
+ function le(...e) {
1864
1864
  return e.filter(Boolean).join(" ");
1865
1865
  }
1866
1866
  const Pe = {
@@ -1915,21 +1915,21 @@ function Jr() {
1915
1915
  rr(), nr();
1916
1916
  }
1917
1917
  function sr(e) {
1918
- const { createOrchestrator: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(null), u = J(null), p = e || tr();
1919
- X(() => {
1918
+ const { createOrchestrator: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(null), u = X(null), p = e || tr();
1919
+ ee(() => {
1920
1920
  u.current || (u.current = t());
1921
- }, [t]), X(() => {
1922
- var S;
1921
+ }, [t]), ee(() => {
1922
+ var A;
1923
1923
  r && p && (er(p), ar({
1924
1924
  applicantId: p,
1925
- currentStepOrder: (S = r.currentStep) == null ? void 0 : S.order,
1925
+ currentStepOrder: (A = r.currentStep) == null ? void 0 : A.order,
1926
1926
  status: r.status,
1927
1927
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
1928
1928
  workflowKey: r.workFlowKey,
1929
1929
  nextWorkflowKey: r.nextWorkflowKey
1930
1930
  }));
1931
1931
  }, [r, p]);
1932
- const w = J(!1), N = J(!1), y = Y(async () => {
1932
+ const w = X(!1), S = X(!1), y = Y(async () => {
1933
1933
  if (!(!p || !u.current)) {
1934
1934
  if (w.current) {
1935
1935
  console.log("[Workflow] Load already in progress, skipping...");
@@ -1937,17 +1937,17 @@ function sr(e) {
1937
1937
  }
1938
1938
  w.current = !0, l(!0), c(null);
1939
1939
  try {
1940
- const S = await u.current.initialize(p);
1941
- n(S), N.current = !0;
1942
- } catch (S) {
1943
- c(S);
1940
+ const A = await u.current.initialize(p);
1941
+ n(A), S.current = !0;
1942
+ } catch (A) {
1943
+ c(A);
1944
1944
  } finally {
1945
1945
  l(!1), w.current = !1;
1946
1946
  }
1947
1947
  }
1948
1948
  }, [p]);
1949
- X(() => {
1950
- p && !N.current && y();
1949
+ ee(() => {
1950
+ p && !S.current && y();
1951
1951
  }, [p, y]);
1952
1952
  const h = Y(async () => {
1953
1953
  if (u.current) {
@@ -1957,10 +1957,10 @@ function sr(e) {
1957
1957
  }
1958
1958
  w.current = !0, l(!0), c(null);
1959
1959
  try {
1960
- const S = await u.current.refreshProgress();
1961
- n(S);
1962
- } catch (S) {
1963
- c(S);
1960
+ const A = await u.current.refreshProgress();
1961
+ n(A);
1962
+ } catch (A) {
1963
+ c(A);
1964
1964
  } finally {
1965
1965
  l(!1), w.current = !1;
1966
1966
  }
@@ -1969,40 +1969,40 @@ function sr(e) {
1969
1969
  if (u.current) {
1970
1970
  l(!0), c(null);
1971
1971
  try {
1972
- const S = await u.current.moveToNextStep();
1973
- n(S);
1974
- } catch (S) {
1975
- c(S);
1972
+ const A = await u.current.moveToNextStep();
1973
+ n(A);
1974
+ } catch (A) {
1975
+ c(A);
1976
1976
  } finally {
1977
1977
  l(!1);
1978
1978
  }
1979
1979
  }
1980
- }, []), k = Y(async () => {
1980
+ }, []), N = Y(async () => {
1981
1981
  if (u.current) {
1982
1982
  l(!0), c(null);
1983
1983
  try {
1984
- const S = await u.current.moveToPreviousStep();
1985
- n(S);
1986
- } catch (S) {
1987
- c(S);
1984
+ const A = await u.current.moveToPreviousStep();
1985
+ n(A);
1986
+ } catch (A) {
1987
+ c(A);
1988
1988
  } finally {
1989
1989
  l(!1);
1990
1990
  }
1991
1991
  }
1992
- }, []), b = Y(async (S) => {
1992
+ }, []), b = Y(async (A) => {
1993
1993
  if (u.current) {
1994
1994
  l(!0), c(null);
1995
1995
  try {
1996
- await u.current.submitCurrentStep(S);
1997
- const v = await u.current.refreshProgress();
1998
- n(v);
1999
- } catch (v) {
2000
- throw c(v), v;
1996
+ await u.current.submitCurrentStep(A);
1997
+ const k = await u.current.refreshProgress();
1998
+ n(k);
1999
+ } catch (k) {
2000
+ throw c(k), k;
2001
2001
  } finally {
2002
2002
  l(!1);
2003
2003
  }
2004
2004
  }
2005
- }, []), m = Ze.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((S, v) => S.order - v.order) : [], [r == null ? void 0 : r.stepInfoList]), F = Ze.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
2005
+ }, []), m = Ze.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((A, k) => A.order - k.order) : [], [r == null ? void 0 : r.stepInfoList]), R = Ze.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
2006
2006
  return {
2007
2007
  progress: r,
2008
2008
  applicantId: p,
@@ -2012,21 +2012,21 @@ function sr(e) {
2012
2012
  workflowResult: (r == null ? void 0 : r.workflowResult) || null,
2013
2013
  workflowKey: r == null ? void 0 : r.workFlowKey,
2014
2014
  nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
2015
- hasWorkflowChanged: F,
2015
+ hasWorkflowChanged: R,
2016
2016
  isLoading: s,
2017
2017
  error: o,
2018
2018
  isComplete: (r == null ? void 0 : r.status) === fe.Finished,
2019
2019
  isOnHold: (r == null ? void 0 : r.status) === fe.OnHold,
2020
2020
  refreshProgress: h,
2021
2021
  moveToNext: g,
2022
- moveBack: k,
2022
+ moveBack: N,
2023
2023
  submitCurrentStep: b,
2024
2024
  orchestrator: u.current
2025
2025
  };
2026
2026
  }
2027
2027
  function ir(e) {
2028
- const { questionnaireService: t, applicantService: r } = he(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [p, w] = x(!1), [N, y] = x(null), h = J(!1), g = J(null), k = Y(async () => {
2029
- var m, F;
2028
+ const { questionnaireService: t, applicantService: r } = he(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [p, w] = x(!1), [S, y] = x(null), h = X(!1), g = X(null), N = Y(async () => {
2029
+ var m, R;
2030
2030
  if (e) {
2031
2031
  if (h.current) {
2032
2032
  console.log("[Questionnaire] Load already in progress, skipping...");
@@ -2034,39 +2034,39 @@ function ir(e) {
2034
2034
  }
2035
2035
  h.current = !0, u(!0), y(null);
2036
2036
  try {
2037
- const [S, v] = await Promise.all([
2037
+ const [A, k] = await Promise.all([
2038
2038
  t.getQuestionnaire(e),
2039
2039
  r.getApplicantData(e).catch(() => null)
2040
2040
  ]);
2041
- if (s(S), (m = v == null ? void 0 : v.questionnaireResults) != null && m.length && S) {
2041
+ if (s(A), (m = k == null ? void 0 : k.questionnaireResults) != null && m.length && A) {
2042
2042
  const q = /* @__PURE__ */ new Map();
2043
- for (const f of v.questionnaireResults)
2044
- f.question && ((F = f.answers) != null && F.length) && q.set(f.question.trim().toLowerCase(), f.answers);
2045
- const H = {}, T = S.questionGroups.flatMap((f) => f.questions ?? []);
2043
+ for (const f of k.questionnaireResults)
2044
+ f.question && ((R = f.answers) != null && R.length) && q.set(f.question.trim().toLowerCase(), f.answers);
2045
+ const K = {}, T = A.questionGroups.flatMap((f) => f.questions ?? []);
2046
2046
  for (const f of T) {
2047
- const A = f.text.trim().toLowerCase();
2048
- q.has(A) && (H[f.id] = q.get(A));
2047
+ const I = f.text.trim().toLowerCase();
2048
+ q.has(I) && (K[f.id] = q.get(I));
2049
2049
  }
2050
- o(H);
2050
+ o(K);
2051
2051
  }
2052
2052
  g.current = e;
2053
- } catch (S) {
2054
- y(S);
2053
+ } catch (A) {
2054
+ y(A);
2055
2055
  } finally {
2056
2056
  u(!1), h.current = !1;
2057
2057
  }
2058
2058
  }
2059
2059
  }, [e, t, r]);
2060
- X(() => {
2061
- e && g.current !== e && k();
2060
+ ee(() => {
2061
+ e && g.current !== e && N();
2062
2062
  }, [e]);
2063
2063
  const b = Y(
2064
2064
  async (m) => {
2065
2065
  w(!0), y(null);
2066
2066
  try {
2067
2067
  return await t.fillQuestionnaire(m);
2068
- } catch (F) {
2069
- throw y(F), F;
2068
+ } catch (R) {
2069
+ throw y(R), R;
2070
2070
  } finally {
2071
2071
  w(!1);
2072
2072
  }
@@ -2078,39 +2078,39 @@ function ir(e) {
2078
2078
  initialAnswers: l,
2079
2079
  isLoading: c,
2080
2080
  isSubmitting: p,
2081
- error: N,
2082
- load: k,
2081
+ error: S,
2082
+ load: N,
2083
2083
  submit: b
2084
2084
  };
2085
2085
  }
2086
2086
  function lr(e) {
2087
- const { uploadDocumentService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(0), [w, N] = x(null), y = J(!1), h = J(null), g = Y(async () => {
2087
+ const { uploadDocumentService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(0), [w, S] = x(null), y = X(!1), h = X(null), g = Y(async () => {
2088
2088
  if (e) {
2089
2089
  if (y.current) {
2090
2090
  console.log("[UploadDocument] Load already in progress, skipping...");
2091
2091
  return;
2092
2092
  }
2093
- y.current = !0, l(!0), N(null);
2093
+ y.current = !0, l(!0), S(null);
2094
2094
  try {
2095
2095
  const b = await t.getUploadDocument(e);
2096
2096
  n(b), h.current = e;
2097
2097
  } catch (b) {
2098
- N(b);
2098
+ S(b);
2099
2099
  } finally {
2100
2100
  l(!1), y.current = !1;
2101
2101
  }
2102
2102
  }
2103
2103
  }, [e, t]);
2104
- X(() => {
2104
+ ee(() => {
2105
2105
  e && h.current !== e && g();
2106
2106
  }, [e]);
2107
- const k = Y(
2107
+ const N = Y(
2108
2108
  async (b) => {
2109
- c(!0), p(0), N(null);
2109
+ c(!0), p(0), S(null);
2110
2110
  try {
2111
2111
  await t.fillUploadDocument(b), p(100);
2112
2112
  } catch (m) {
2113
- throw N(m), m;
2113
+ throw S(m), m;
2114
2114
  } finally {
2115
2115
  c(!1);
2116
2116
  }
@@ -2124,11 +2124,11 @@ function lr(e) {
2124
2124
  uploadProgress: u,
2125
2125
  error: w,
2126
2126
  load: g,
2127
- submit: k
2127
+ submit: N
2128
2128
  };
2129
2129
  }
2130
2130
  function Xr(e) {
2131
- const { appropriatenessTestService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(null), [w, N] = x(null), y = J(!1), h = J(null), g = Y(async () => {
2131
+ const { appropriatenessTestService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(null), [w, S] = x(null), y = X(!1), h = X(null), g = Y(async () => {
2132
2132
  if (e) {
2133
2133
  if (y.current) {
2134
2134
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
@@ -2145,15 +2145,15 @@ function Xr(e) {
2145
2145
  }
2146
2146
  }
2147
2147
  }, [e, t]);
2148
- X(() => {
2148
+ ee(() => {
2149
2149
  e && h.current !== e && g();
2150
2150
  }, [e]);
2151
- const k = Y(
2151
+ const N = Y(
2152
2152
  async (b) => {
2153
2153
  c(!0), p(null);
2154
2154
  try {
2155
2155
  const m = await t.fillAppropriatenessTest(b);
2156
- return N(m), m;
2156
+ return S(m), m;
2157
2157
  } catch (m) {
2158
2158
  throw p(m), m;
2159
2159
  } finally {
@@ -2169,11 +2169,11 @@ function Xr(e) {
2169
2169
  isSubmitting: o,
2170
2170
  error: u,
2171
2171
  load: g,
2172
- submit: k
2172
+ submit: N
2173
2173
  };
2174
2174
  }
2175
2175
  function or(e) {
2176
- const { overviewService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(null), w = J(!1), N = J(null), y = Y(async () => {
2176
+ const { overviewService: t } = he(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, p] = x(null), w = X(!1), S = X(null), y = Y(async () => {
2177
2177
  if (e) {
2178
2178
  if (w.current) {
2179
2179
  console.log("[Overview] Load already in progress, skipping...");
@@ -2182,7 +2182,7 @@ function or(e) {
2182
2182
  w.current = !0, l(!0), p(null);
2183
2183
  try {
2184
2184
  const g = await t.getOverviewData(e);
2185
- n(g), N.current = e;
2185
+ n(g), S.current = e;
2186
2186
  } catch (g) {
2187
2187
  p(g);
2188
2188
  } finally {
@@ -2190,8 +2190,8 @@ function or(e) {
2190
2190
  }
2191
2191
  }
2192
2192
  }, [e, t]);
2193
- X(() => {
2194
- e && N.current !== e && y();
2193
+ ee(() => {
2194
+ e && S.current !== e && y();
2195
2195
  }, [e]);
2196
2196
  const h = Y(async () => {
2197
2197
  if (e) {
@@ -2217,7 +2217,7 @@ function or(e) {
2217
2217
  function cr(e) {
2218
2218
  const { identityService: t } = he(), [r, n] = x(
2219
2219
  null
2220
- ), [s, l] = x(!1), [o, c] = x(null), u = J(!1), p = Y(
2220
+ ), [s, l] = x(!1), [o, c] = x(null), u = X(!1), p = Y(
2221
2221
  async (y, h) => {
2222
2222
  if (e) {
2223
2223
  if (u.current) {
@@ -2234,8 +2234,8 @@ function cr(e) {
2234
2234
  // Default: 7 days
2235
2235
  };
2236
2236
  console.log("Identity request input:", g);
2237
- const k = await t.identityRequest(g);
2238
- return console.log("Identity request result:", k), n(k), k;
2237
+ const N = await t.identityRequest(g);
2238
+ return console.log("Identity request result:", N), n(N), N;
2239
2239
  } catch (g) {
2240
2240
  throw c(g), g;
2241
2241
  } finally {
@@ -2254,8 +2254,8 @@ function cr(e) {
2254
2254
  restart: !1,
2255
2255
  redirectUrl: y,
2256
2256
  ttl: h
2257
- }, k = await t.identityCompanyRequest(g);
2258
- return n(k), k;
2257
+ }, N = await t.identityCompanyRequest(g);
2258
+ return n(N), N;
2259
2259
  } catch (g) {
2260
2260
  throw c(g), g;
2261
2261
  } finally {
@@ -2264,7 +2264,7 @@ function cr(e) {
2264
2264
  }
2265
2265
  },
2266
2266
  [e, t]
2267
- ), N = Y(async () => {
2267
+ ), S = Y(async () => {
2268
2268
  if (e) {
2269
2269
  if (u.current) {
2270
2270
  console.log("[Identity] Restart already in progress, skipping...");
@@ -2297,53 +2297,53 @@ function cr(e) {
2297
2297
  error: o,
2298
2298
  requestIdentity: p,
2299
2299
  requestCompanyIdentity: w,
2300
- restartIdentity: N
2300
+ restartIdentity: S
2301
2301
  };
2302
2302
  }
2303
2303
  function dr(e) {
2304
- const { riskScoringService: t, applicantService: r } = he(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [p, w] = x(!1), [N, y] = x(null), [h, g] = x(null), k = J(!1), b = J(null), m = Y(async () => {
2305
- var S;
2304
+ const { riskScoringService: t, applicantService: r } = he(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [p, w] = x(!1), [S, y] = x(null), [h, g] = x(null), N = X(!1), b = X(null), m = Y(async () => {
2305
+ var A;
2306
2306
  if (e) {
2307
- if (k.current) {
2307
+ if (N.current) {
2308
2308
  console.log("[RiskScoring] Load already in progress, skipping...");
2309
2309
  return;
2310
2310
  }
2311
- k.current = !0, u(!0), y(null);
2311
+ N.current = !0, u(!0), y(null);
2312
2312
  try {
2313
- const [v, q] = await Promise.all([
2313
+ const [k, q] = await Promise.all([
2314
2314
  t.getRiskCriterias(e),
2315
2315
  r.getApplicantData(e).catch(() => null)
2316
2316
  ]);
2317
- if (s(v), (S = q == null ? void 0 : q.riskScoringResults) != null && S.length) {
2318
- const H = q.riskScoringResults[0], T = {};
2319
- for (const f of H.riskCriteriaResults ?? [])
2317
+ if (s(k), (A = q == null ? void 0 : q.riskScoringResults) != null && A.length) {
2318
+ const K = q.riskScoringResults[0], T = {};
2319
+ for (const f of K.riskCriteriaResults ?? [])
2320
2320
  if (f.riskCriteriaId != null && f.answer != null && f.answer !== "") {
2321
- const A = [...new Set(
2322
- f.answer.split(",").map((D) => D.trim()).filter((D) => D !== "")
2321
+ const I = [...new Set(
2322
+ f.answer.split(",").map((F) => F.trim()).filter((F) => F !== "")
2323
2323
  )];
2324
- A.length > 0 && (T[f.riskCriteriaId] = A);
2324
+ I.length > 0 && (T[f.riskCriteriaId] = I);
2325
2325
  }
2326
2326
  o(T);
2327
2327
  }
2328
2328
  b.current = e;
2329
- } catch (v) {
2330
- y(v);
2329
+ } catch (k) {
2330
+ y(k);
2331
2331
  } finally {
2332
- u(!1), k.current = !1;
2332
+ u(!1), N.current = !1;
2333
2333
  }
2334
2334
  }
2335
2335
  }, [e, t, r]);
2336
- X(() => {
2336
+ ee(() => {
2337
2337
  e && b.current !== e && m();
2338
2338
  }, [e]);
2339
- const F = Y(
2340
- async (S) => {
2339
+ const R = Y(
2340
+ async (A) => {
2341
2341
  w(!0), y(null);
2342
2342
  try {
2343
- const v = await t.submitRiskScoring(S);
2344
- return g(v), v;
2345
- } catch (v) {
2346
- throw y(v), v;
2343
+ const k = await t.submitRiskScoring(A);
2344
+ return g(k), k;
2345
+ } catch (k) {
2346
+ throw y(k), k;
2347
2347
  } finally {
2348
2348
  w(!1);
2349
2349
  }
@@ -2356,13 +2356,13 @@ function dr(e) {
2356
2356
  result: h,
2357
2357
  isLoading: c,
2358
2358
  isSubmitting: p,
2359
- error: N,
2359
+ error: S,
2360
2360
  load: m,
2361
- submit: F
2361
+ submit: R
2362
2362
  };
2363
2363
  }
2364
2364
  function ur() {
2365
- const { applicantService: e, config: t } = he(), [r, n] = x(!1), [s, l] = x(null), o = J(!1), c = J(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(h) {
2365
+ const { applicantService: e, config: t } = he(), [r, n] = x(!1), [s, l] = x(null), o = X(!1), c = X(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(h) {
2366
2366
  const g = Math.random() * 16 | 0;
2367
2367
  return (h === "x" ? g : g & 3 | 8).toString(16);
2368
2368
  }), p = Y(
@@ -2380,8 +2380,8 @@ function ur() {
2380
2380
  });
2381
2381
  }
2382
2382
  return await e.createApplicant(h);
2383
- } catch (k) {
2384
- throw l(k), k;
2383
+ } catch (N) {
2384
+ throw l(N), N;
2385
2385
  } finally {
2386
2386
  n(!1), o.current = !1;
2387
2387
  }
@@ -2399,7 +2399,7 @@ function ur() {
2399
2399
  }
2400
2400
  },
2401
2401
  [e]
2402
- ), N = Y(
2402
+ ), S = Y(
2403
2403
  async (h) => {
2404
2404
  if (c.current)
2405
2405
  throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
@@ -2431,7 +2431,7 @@ function ur() {
2431
2431
  error: s,
2432
2432
  createApplicant: p,
2433
2433
  createCompanyApplicant: w,
2434
- getApplicantData: N,
2434
+ getApplicantData: S,
2435
2435
  stopProgress: y
2436
2436
  };
2437
2437
  }
@@ -2458,7 +2458,7 @@ const U = ({
2458
2458
  return /* @__PURE__ */ i(
2459
2459
  "button",
2460
2460
  {
2461
- className: ie(c, u[t], p[r], l),
2461
+ className: le(c, u[t], p[r], l),
2462
2462
  disabled: s || n,
2463
2463
  ...o,
2464
2464
  children: [
@@ -2496,7 +2496,7 @@ const U = ({
2496
2496
  ]
2497
2497
  }
2498
2498
  );
2499
- }, ue = $e(
2499
+ }, ue = Be(
2500
2500
  ({ label: e, error: t, helperText: r, leftIcon: n, rightIcon: s, className: l, ...o }, c) => /* @__PURE__ */ i("div", { className: "w-full", children: [
2501
2501
  e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2502
2502
  e,
@@ -2508,7 +2508,7 @@ const U = ({
2508
2508
  "input",
2509
2509
  {
2510
2510
  ref: c,
2511
- className: ie(
2511
+ className: le(
2512
2512
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2513
2513
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2514
2514
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
@@ -2528,10 +2528,10 @@ const U = ({
2528
2528
  ] })
2529
2529
  );
2530
2530
  ue.displayName = "Input";
2531
- const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2531
+ const B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2532
2532
  "div",
2533
2533
  {
2534
- className: ie(
2534
+ className: le(
2535
2535
  "metakyc-card rounded-xl shadow-sm border",
2536
2536
  t
2537
2537
  ),
@@ -2545,17 +2545,17 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2545
2545
  ), oe = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2546
2546
  "div",
2547
2547
  {
2548
- className: ie("px-6 py-4 border-b", t),
2548
+ className: le("px-6 py-4 border-b", t),
2549
2549
  style: {
2550
2550
  borderColor: "var(--metakyc-border, #e5e7eb)"
2551
2551
  },
2552
2552
  ...r,
2553
2553
  children: e
2554
2554
  }
2555
- ), B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a("div", { className: ie("px-6 py-4", t), ...r, children: e }), me = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2555
+ ), z = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a("div", { className: le("px-6 py-4", t), ...r, children: e }), me = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2556
2556
  "div",
2557
2557
  {
2558
- className: ie("px-6 py-4 border-t", t),
2558
+ className: le("px-6 py-4 border-t", t),
2559
2559
  style: {
2560
2560
  borderColor: "var(--metakyc-border, #e5e7eb)"
2561
2561
  },
@@ -2565,7 +2565,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2565
2565
  ), Se = ({ children: e, variant: t = "default", className: r, ...n }) => /* @__PURE__ */ a(
2566
2566
  "span",
2567
2567
  {
2568
- className: ie(
2568
+ className: le(
2569
2569
  "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
2570
2570
  {
2571
2571
  default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
@@ -2585,10 +2585,10 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2585
2585
  md: "h-8 w-8",
2586
2586
  lg: "h-12 w-12"
2587
2587
  };
2588
- return /* @__PURE__ */ a("div", { className: ie("flex items-center justify-center", t), ...r, children: /* @__PURE__ */ i(
2588
+ return /* @__PURE__ */ a("div", { className: le("flex items-center justify-center", t), ...r, children: /* @__PURE__ */ i(
2589
2589
  "svg",
2590
2590
  {
2591
- className: ie("animate-spin text-primary-500", n[e]),
2591
+ className: le("animate-spin text-primary-500", n[e]),
2592
2592
  xmlns: "http://www.w3.org/2000/svg",
2593
2593
  fill: "none",
2594
2594
  viewBox: "0 0 24 24",
@@ -2615,7 +2615,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2615
2615
  ]
2616
2616
  }
2617
2617
  ) });
2618
- }, Ae = $e(
2618
+ }, Ae = Be(
2619
2619
  ({ label: e, error: t, helperText: r, options: n, placeholder: s, className: l, style: o, ...c }, u) => /* @__PURE__ */ i("div", { className: "w-full", children: [
2620
2620
  e && /* @__PURE__ */ i(
2621
2621
  "label",
@@ -2632,7 +2632,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
2632
2632
  "select",
2633
2633
  {
2634
2634
  ref: u,
2635
- className: ie(
2635
+ className: le(
2636
2636
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2637
2637
  "focus:outline-none focus:ring-2 focus:ring-offset-0",
2638
2638
  "disabled:opacity-60 disabled:cursor-not-allowed",
@@ -2691,10 +2691,10 @@ const mr = ({
2691
2691
  disabled: l = !1,
2692
2692
  required: o = !1
2693
2693
  }) => {
2694
- const [c, u] = x(!1), [p, w] = x(""), N = J(null);
2695
- X(() => {
2694
+ const [c, u] = x(!1), [p, w] = x(""), S = X(null);
2695
+ ee(() => {
2696
2696
  const b = (m) => {
2697
- N.current && !N.current.contains(m.target) && (u(!1), w(""));
2697
+ S.current && !S.current.contains(m.target) && (u(!1), w(""));
2698
2698
  };
2699
2699
  return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
2700
2700
  }, []);
@@ -2703,12 +2703,12 @@ const mr = ({
2703
2703
  ), h = (b) => {
2704
2704
  l || (t.includes(b) ? r(t.filter((m) => m !== b)) : r([...t, b]));
2705
2705
  }, g = (b, m) => {
2706
- m.stopPropagation(), l || r(t.filter((F) => F !== b));
2707
- }, k = (b) => {
2706
+ m.stopPropagation(), l || r(t.filter((R) => R !== b));
2707
+ }, N = (b) => {
2708
2708
  var m;
2709
- return ((m = n.find((F) => F.value === b)) == null ? void 0 : m.label) || b;
2709
+ return ((m = n.find((R) => R.value === b)) == null ? void 0 : m.label) || b;
2710
2710
  };
2711
- return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref: N, children: [
2711
+ return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref: S, children: [
2712
2712
  e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2713
2713
  e,
2714
2714
  o && /* @__PURE__ */ a("span", { className: "text-red-500 ml-1", children: "*" })
@@ -2718,7 +2718,7 @@ const mr = ({
2718
2718
  "div",
2719
2719
  {
2720
2720
  onClick: () => !l && u(!c),
2721
- className: ie(
2721
+ className: le(
2722
2722
  "metakyc-multiselect-trigger",
2723
2723
  "min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors",
2724
2724
  "bg-white dark:bg-gray-800",
@@ -2732,7 +2732,7 @@ const mr = ({
2732
2732
  {
2733
2733
  className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded bg-blue-100 dark:bg-blue-900/40 text-blue-800 dark:text-blue-300 text-xs font-medium",
2734
2734
  children: [
2735
- k(b),
2735
+ N(b),
2736
2736
  !l && /* @__PURE__ */ a(
2737
2737
  "button",
2738
2738
  {
@@ -2792,7 +2792,7 @@ const mr = ({
2792
2792
  "li",
2793
2793
  {
2794
2794
  onClick: () => h(b.value),
2795
- className: ie(
2795
+ className: le(
2796
2796
  "metakyc-multiselect-option",
2797
2797
  "flex items-center gap-2 px-3 py-2 text-sm cursor-pointer",
2798
2798
  "hover:bg-gray-50 dark:hover:bg-gray-700",
@@ -2843,34 +2843,34 @@ const mr = ({
2843
2843
  value: o = [],
2844
2844
  className: c
2845
2845
  }) => {
2846
- const [u, p] = x(!1), w = J(null), N = (m) => {
2846
+ const [u, p] = x(!1), w = X(null), S = (m) => {
2847
2847
  if (!m) return;
2848
- const F = Array.from(m);
2849
- if (s && F.filter((v) => v.size > s).length > 0) {
2850
- const v = je(s);
2851
- alert(`Some files exceed the maximum size of ${v}`);
2848
+ const R = Array.from(m);
2849
+ if (s && R.filter((k) => k.size > s).length > 0) {
2850
+ const k = je(s);
2851
+ alert(`Some files exceed the maximum size of ${k}`);
2852
2852
  return;
2853
2853
  }
2854
- l == null || l(n ? [...o, ...F] : [F[0]]);
2854
+ l == null || l(n ? [...o, ...R] : [R[0]]);
2855
2855
  }, y = (m) => {
2856
2856
  m.preventDefault(), p(!0);
2857
2857
  }, h = () => {
2858
2858
  p(!1);
2859
2859
  }, g = (m) => {
2860
- m.preventDefault(), p(!1), N(m.dataTransfer.files);
2861
- }, k = () => {
2860
+ m.preventDefault(), p(!1), S(m.dataTransfer.files);
2861
+ }, N = () => {
2862
2862
  var m;
2863
2863
  (m = w.current) == null || m.click();
2864
2864
  }, b = (m) => {
2865
- const F = o.filter((S, v) => v !== m);
2866
- l == null || l(F);
2865
+ const R = o.filter((A, k) => k !== m);
2866
+ l == null || l(R);
2867
2867
  };
2868
- return /* @__PURE__ */ i("div", { className: ie("w-full", c), children: [
2868
+ return /* @__PURE__ */ i("div", { className: le("w-full", c), children: [
2869
2869
  e && /* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: e }),
2870
2870
  /* @__PURE__ */ i(
2871
2871
  "div",
2872
2872
  {
2873
- className: ie(
2873
+ className: le(
2874
2874
  "border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
2875
2875
  u ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
2876
2876
  t && "border-danger-500"
@@ -2878,7 +2878,7 @@ const mr = ({
2878
2878
  onDragOver: y,
2879
2879
  onDragLeave: h,
2880
2880
  onDrop: g,
2881
- onClick: k,
2881
+ onClick: N,
2882
2882
  children: [
2883
2883
  /* @__PURE__ */ a(
2884
2884
  "input",
@@ -2888,7 +2888,7 @@ const mr = ({
2888
2888
  className: "hidden",
2889
2889
  accept: r,
2890
2890
  multiple: n,
2891
- onChange: (m) => N(m.target.files)
2891
+ onChange: (m) => S(m.target.files)
2892
2892
  }
2893
2893
  ),
2894
2894
  /* @__PURE__ */ i("div", { className: "space-y-2", children: [
@@ -2922,7 +2922,7 @@ const mr = ({
2922
2922
  ]
2923
2923
  }
2924
2924
  ),
2925
- o.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: o.map((m, F) => /* @__PURE__ */ i(
2925
+ o.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: o.map((m, R) => /* @__PURE__ */ i(
2926
2926
  "div",
2927
2927
  {
2928
2928
  className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
@@ -2955,8 +2955,8 @@ const mr = ({
2955
2955
  "button",
2956
2956
  {
2957
2957
  type: "button",
2958
- onClick: (S) => {
2959
- S.stopPropagation(), b(F);
2958
+ onClick: (A) => {
2959
+ A.stopPropagation(), b(R);
2960
2960
  },
2961
2961
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
2962
2962
  children: /* @__PURE__ */ a("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ a(
@@ -2971,11 +2971,11 @@ const mr = ({
2971
2971
  )
2972
2972
  ]
2973
2973
  },
2974
- F
2974
+ R
2975
2975
  )) }),
2976
2976
  t && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: t })
2977
2977
  ] });
2978
- }, hr = $e(
2978
+ }, hr = Be(
2979
2979
  ({ countryCode: e = "+1", onCountryCodeChange: t, className: r, ...n }, s) => /* @__PURE__ */ i("div", { className: "w-full", children: [
2980
2980
  n.label && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2981
2981
  n.label,
@@ -2988,7 +2988,7 @@ const mr = ({
2988
2988
  type: "text",
2989
2989
  value: e,
2990
2990
  onChange: (l) => t == null ? void 0 : t(l.target.value),
2991
- className: ie(
2991
+ className: le(
2992
2992
  "w-20 rounded-lg border px-3 py-2 text-sm",
2993
2993
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2994
2994
  "border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
@@ -3001,7 +3001,7 @@ const mr = ({
3001
3001
  {
3002
3002
  ref: s,
3003
3003
  type: "tel",
3004
- className: ie("flex-1", r),
3004
+ className: le("flex-1", r),
3005
3005
  ...n,
3006
3006
  label: ""
3007
3007
  }
@@ -3080,7 +3080,7 @@ const xr = (e) => {
3080
3080
  * This source code is licensed under the ISC license.
3081
3081
  * See the LICENSE file in the root directory of this source tree.
3082
3082
  */
3083
- const br = $e(
3083
+ const br = Be(
3084
3084
  ({
3085
3085
  color: e = "currentColor",
3086
3086
  size: t = 24,
@@ -3116,7 +3116,7 @@ const br = $e(
3116
3116
  * See the LICENSE file in the root directory of this source tree.
3117
3117
  */
3118
3118
  const nt = (e, t) => {
3119
- const r = $e(
3119
+ const r = Be(
3120
3120
  ({ className: n, ...s }, l) => We(br, {
3121
3121
  ref: l,
3122
3122
  iconNode: t,
@@ -3143,8 +3143,8 @@ const vr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], st = nt("chevron-
3143
3143
  * This source code is licensed under the ISC license.
3144
3144
  * See the LICENSE file in the root directory of this source tree.
3145
3145
  */
3146
- const wr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], it = nt("chevron-right", wr);
3147
- function kr(e, t) {
3146
+ const kr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], it = nt("chevron-right", kr);
3147
+ function wr(e, t) {
3148
3148
  const r = !t || t.length === 0 || t.every((n) => !n || !n.trim());
3149
3149
  if (e.isRequired && r)
3150
3150
  return e.errorMessage || "This field is required";
@@ -3188,36 +3188,36 @@ const Sr = ({
3188
3188
  onComplete: t,
3189
3189
  onBack: r
3190
3190
  }) => {
3191
- const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = ir(e), [p, w] = x({}), [N, y] = x({}), [h, g] = x(0);
3191
+ const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = ir(e), [p, w] = x({}), [S, y] = x({}), [h, g] = x(0);
3192
3192
  ge.useEffect(() => {
3193
3193
  s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && w(s);
3194
3194
  }, [s]);
3195
- const k = ke(
3195
+ const N = we(
3196
3196
  () => n ? Nr(n.questionGroups) : [],
3197
3197
  [n]
3198
- ), b = h === k.length - 1, m = k[h] ?? [], F = Y((T, f) => {
3199
- w((A) => ({ ...A, [T]: f })), y((A) => {
3200
- const D = { ...A };
3201
- return delete D[T], D;
3198
+ ), b = h === N.length - 1, m = N[h] ?? [], R = Y((T, f) => {
3199
+ w((I) => ({ ...I, [T]: f })), y((I) => {
3200
+ const F = { ...I };
3201
+ return delete F[T], F;
3202
3202
  });
3203
- }, []), S = Y(() => {
3203
+ }, []), A = Y(() => {
3204
3204
  const T = {};
3205
3205
  for (const { question: f } of m) {
3206
- const A = kr(f, p[f.id] ?? []);
3207
- A && (T[f.id] = A);
3206
+ const I = wr(f, p[f.id] ?? []);
3207
+ I && (T[f.id] = I);
3208
3208
  }
3209
3209
  return y((f) => ({ ...f, ...T })), Object.keys(T).length === 0;
3210
- }, [m, p]), v = () => {
3211
- S() && g((T) => T + 1);
3210
+ }, [m, p]), k = () => {
3211
+ A() && g((T) => T + 1);
3212
3212
  }, q = () => {
3213
3213
  h > 0 ? g((T) => T - 1) : r == null || r();
3214
- }, H = async () => {
3215
- if (!(!S() || !n))
3214
+ }, K = async () => {
3215
+ if (!(!A() || !n))
3216
3216
  try {
3217
3217
  const T = n.questionGroups.flatMap(
3218
- (A) => (A.questions ?? []).map((D) => ({
3219
- questionId: D.id,
3220
- values: p[D.id] ?? []
3218
+ (I) => (I.questions ?? []).map((F) => ({
3219
+ questionId: F.id,
3220
+ values: p[F.id] ?? []
3221
3221
  }))
3222
3222
  ), f = {
3223
3223
  applicantId: e,
@@ -3229,21 +3229,21 @@ const Sr = ({
3229
3229
  console.error("Questionnaire submit error:", T);
3230
3230
  }
3231
3231
  };
3232
- return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
3232
+ return l ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
3233
3233
  "Error loading questionnaire: ",
3234
3234
  c.message
3235
- ] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
3235
+ ] }) }) }) : n ? /* @__PURE__ */ i(B, { children: [
3236
3236
  /* @__PURE__ */ i(oe, { children: [
3237
3237
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.displayName }),
3238
3238
  n.subtitle && /* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.subtitle }),
3239
- k.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
3239
+ N.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
3240
3240
  /* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3241
3241
  "Page ",
3242
3242
  h + 1,
3243
3243
  " of ",
3244
- k.length
3244
+ N.length
3245
3245
  ] }),
3246
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: k.map((T, f) => /* @__PURE__ */ a(
3246
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: N.map((T, f) => /* @__PURE__ */ a(
3247
3247
  "div",
3248
3248
  {
3249
3249
  className: "rounded-full transition-all duration-200",
@@ -3257,13 +3257,13 @@ const Sr = ({
3257
3257
  )) })
3258
3258
  ] })
3259
3259
  ] }),
3260
- /* @__PURE__ */ a(B, { className: "space-y-6", children: m.map(({ question: T }) => /* @__PURE__ */ a(
3260
+ /* @__PURE__ */ a(z, { className: "space-y-6", children: m.map(({ question: T }) => /* @__PURE__ */ a(
3261
3261
  Cr,
3262
3262
  {
3263
3263
  question: T,
3264
3264
  value: p[T.id] ?? [],
3265
- error: N[T.id],
3266
- onChange: (f) => F(T.id, f)
3265
+ error: S[T.id],
3266
+ onChange: (f) => R(T.id, f)
3267
3267
  },
3268
3268
  T.id
3269
3269
  )) }),
@@ -3286,14 +3286,14 @@ const Sr = ({
3286
3286
  {
3287
3287
  type: "button",
3288
3288
  isLoading: o,
3289
- onClick: H,
3289
+ onClick: K,
3290
3290
  children: "Continue"
3291
3291
  }
3292
3292
  ) : /* @__PURE__ */ i(
3293
3293
  U,
3294
3294
  {
3295
3295
  type: "button",
3296
- onClick: v,
3296
+ onClick: k,
3297
3297
  style: { display: "flex", alignItems: "center", gap: "4px" },
3298
3298
  children: [
3299
3299
  "Next",
@@ -3416,12 +3416,12 @@ const Sr = ({
3416
3416
  onComplete: t,
3417
3417
  onBack: r
3418
3418
  }) => {
3419
- const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } = lr(e), [u, p] = x({}), w = async (N) => {
3420
- if (N.preventDefault(), !n) return;
3419
+ const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } = lr(e), [u, p] = x({}), w = async (S) => {
3420
+ if (S.preventDefault(), !n) return;
3421
3421
  const y = await Promise.all(
3422
3422
  n.uploadDocumentFiles.map(async (g) => {
3423
- const k = u[g.id] || [], b = await Promise.all(
3424
- k.map(async (m) => ({
3423
+ const N = u[g.id] || [], b = await Promise.all(
3424
+ N.map(async (m) => ({
3425
3425
  fileName: m.name,
3426
3426
  fileData: await Xt(m)
3427
3427
  }))
@@ -3438,27 +3438,27 @@ const Sr = ({
3438
3438
  };
3439
3439
  await c(h), t == null || t();
3440
3440
  };
3441
- return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
3441
+ return s ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
3442
3442
  "Error loading document requirements: ",
3443
3443
  o.message
3444
- ] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit: w, children: /* @__PURE__ */ i($, { children: [
3444
+ ] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit: w, children: /* @__PURE__ */ i(B, { children: [
3445
3445
  /* @__PURE__ */ i(oe, { children: [
3446
3446
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.displayName }),
3447
3447
  n.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.subtitle })
3448
3448
  ] }),
3449
- /* @__PURE__ */ a(B, { className: "space-y-6", children: n.uploadDocumentFiles.map((N) => /* @__PURE__ */ a(
3449
+ /* @__PURE__ */ a(z, { className: "space-y-6", children: n.uploadDocumentFiles.map((S) => /* @__PURE__ */ a(
3450
3450
  pr,
3451
3451
  {
3452
- label: N.displayName,
3453
- accept: N.allowedTypes,
3454
- multiple: N.multipleFile,
3455
- maxSize: N.maxEachFileSizeByte,
3456
- value: u[N.id] || [],
3452
+ label: S.displayName,
3453
+ accept: S.allowedTypes,
3454
+ multiple: S.multipleFile,
3455
+ maxSize: S.maxEachFileSizeByte,
3456
+ value: u[S.id] || [],
3457
3457
  onChange: (y) => {
3458
- p((h) => ({ ...h, [N.id]: y }));
3458
+ p((h) => ({ ...h, [S.id]: y }));
3459
3459
  }
3460
3460
  },
3461
- N.id
3461
+ S.id
3462
3462
  )) }),
3463
3463
  /* @__PURE__ */ i(me, { className: "flex justify-between", children: [
3464
3464
  r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
@@ -3469,15 +3469,15 @@ const Sr = ({
3469
3469
  const { overview: n, isLoading: s, isSubmitting: l, error: o, passOverview: c } = or(e), u = async () => {
3470
3470
  await c(), t == null || t();
3471
3471
  };
3472
- return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
3472
+ return s ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a(xe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
3473
3473
  "Error loading overview: ",
3474
3474
  o.message
3475
- ] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
3475
+ ] }) }) }) : n ? /* @__PURE__ */ i(B, { children: [
3476
3476
  /* @__PURE__ */ i(oe, { children: [
3477
3477
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.title || "Overview" }),
3478
3478
  n.description && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.description })
3479
3479
  ] }),
3480
- /* @__PURE__ */ a(B, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((p, w) => p.order - w.order).map((p) => /* @__PURE__ */ i("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
3480
+ /* @__PURE__ */ a(z, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((p, w) => p.order - w.order).map((p) => /* @__PURE__ */ i("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
3481
3481
  /* @__PURE__ */ a("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ a("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: p.order + 1 }) }),
3482
3482
  /* @__PURE__ */ i(
3483
3483
  "div",
@@ -3547,55 +3547,55 @@ const Dr = ({
3547
3547
  onComplete: t,
3548
3548
  onBack: r
3549
3549
  }) => {
3550
- const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = dr(e), [p, w] = x({}), [N, y] = x({}), [h, g] = x(0), [k, b] = x(!1);
3550
+ const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = dr(e), [p, w] = x({}), [S, y] = x({}), [h, g] = x(0), [N, b] = x(!1);
3551
3551
  ge.useEffect(() => {
3552
3552
  s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && w(s);
3553
3553
  }, [s]);
3554
- const m = ke(
3554
+ const m = we(
3555
3555
  () => n && n.length > 0 ? Rr(n) : [],
3556
3556
  [n]
3557
- ), F = h === m.length - 1, S = m[h] ?? [];
3557
+ ), R = h === m.length - 1, A = m[h] ?? [];
3558
3558
  ge.useEffect(() => {
3559
- !l && n && n.length === 0 && !k && !o && (b(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3560
- }, [l, n, k, o, u, e, t]);
3561
- const v = Y((A, D) => {
3562
- w((Q) => ({ ...Q, [A]: D })), y((Q) => {
3559
+ !l && n && n.length === 0 && !N && !o && (b(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3560
+ }, [l, n, N, o, u, e, t]);
3561
+ const k = Y((I, F) => {
3562
+ w((Q) => ({ ...Q, [I]: F })), y((Q) => {
3563
3563
  const W = { ...Q };
3564
- return delete W[A], W;
3564
+ return delete W[I], W;
3565
3565
  });
3566
3566
  }, []), q = Y(() => {
3567
- const A = {};
3568
- for (const { criterion: D } of S) {
3569
- const Q = Er(D, p[D.id] ?? []);
3570
- Q && (A[D.id] = Q);
3567
+ const I = {};
3568
+ for (const { criterion: F } of A) {
3569
+ const Q = Er(F, p[F.id] ?? []);
3570
+ Q && (I[F.id] = Q);
3571
3571
  }
3572
- return y((D) => ({ ...D, ...A })), Object.keys(A).length === 0;
3573
- }, [S, p]), H = () => {
3574
- q() && g((A) => A + 1);
3572
+ return y((F) => ({ ...F, ...I })), Object.keys(I).length === 0;
3573
+ }, [A, p]), K = () => {
3574
+ q() && g((I) => I + 1);
3575
3575
  }, T = () => {
3576
- h > 0 ? g((A) => A - 1) : r == null || r();
3576
+ h > 0 ? g((I) => I - 1) : r == null || r();
3577
3577
  }, f = async () => {
3578
3578
  if (!(!q() || !n))
3579
3579
  try {
3580
- const A = n.map((Q) => {
3580
+ const I = n.map((Q) => {
3581
3581
  const W = (p[Q.id] ?? []).filter((P) => P && P.trim());
3582
3582
  return W.length > 0 ? { riskCriteriaId: Q.id, values: W } : null;
3583
3583
  }).filter((Q) => Q !== null);
3584
- await u({ applicantId: e, criteriaValueInputs: A }), t == null || t();
3585
- } catch (A) {
3586
- console.error("Risk scoring submit error:", A);
3584
+ await u({ applicantId: e, criteriaValueInputs: I }), t == null || t();
3585
+ } catch (I) {
3586
+ console.error("Risk scoring submit error:", I);
3587
3587
  }
3588
3588
  };
3589
- return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
3589
+ return l ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { children: [
3590
3590
  /* @__PURE__ */ a(xe, { className: "my-8" }),
3591
3591
  /* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
3592
- ] }) }) : !l && n && n.length === 0 ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
3592
+ ] }) }) : !l && n && n.length === 0 ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { children: [
3593
3593
  /* @__PURE__ */ a(xe, { className: "my-8" }),
3594
3594
  /* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
3595
- ] }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
3595
+ ] }) }) : c ? /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
3596
3596
  "Error loading criteria: ",
3597
3597
  c.message
3598
- ] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
3598
+ ] }) }) }) : n ? /* @__PURE__ */ i(B, { children: [
3599
3599
  /* @__PURE__ */ i(oe, { children: [
3600
3600
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
3601
3601
  /* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
@@ -3606,29 +3606,29 @@ const Dr = ({
3606
3606
  " of ",
3607
3607
  m.length
3608
3608
  ] }),
3609
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: m.map((A, D) => /* @__PURE__ */ a(
3609
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: m.map((I, F) => /* @__PURE__ */ a(
3610
3610
  "div",
3611
3611
  {
3612
3612
  className: "rounded-full transition-all duration-200",
3613
3613
  style: {
3614
3614
  height: "6px",
3615
- width: D === h ? "20px" : "6px",
3616
- backgroundColor: D <= h ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3615
+ width: F === h ? "20px" : "6px",
3616
+ backgroundColor: F <= h ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3617
3617
  }
3618
3618
  },
3619
- D
3619
+ F
3620
3620
  )) })
3621
3621
  ] })
3622
3622
  ] }),
3623
- /* @__PURE__ */ a(B, { className: "space-y-6", children: S.map(({ criterion: A }) => /* @__PURE__ */ a(
3623
+ /* @__PURE__ */ a(z, { className: "space-y-6", children: A.map(({ criterion: I }) => /* @__PURE__ */ a(
3624
3624
  Pr,
3625
3625
  {
3626
- criterion: A,
3627
- value: p[A.id] ?? [],
3628
- error: N[A.id],
3629
- onChange: (D) => v(A.id, D)
3626
+ criterion: I,
3627
+ value: p[I.id] ?? [],
3628
+ error: S[I.id],
3629
+ onChange: (F) => k(I.id, F)
3630
3630
  },
3631
- A.id
3631
+ I.id
3632
3632
  )) }),
3633
3633
  /* @__PURE__ */ i(me, { className: "flex items-center justify-between", children: [
3634
3634
  /* @__PURE__ */ i(
@@ -3644,11 +3644,11 @@ const Dr = ({
3644
3644
  ]
3645
3645
  }
3646
3646
  ),
3647
- F ? /* @__PURE__ */ a(U, { type: "button", isLoading: o, onClick: f, children: "Continue" }) : /* @__PURE__ */ i(
3647
+ R ? /* @__PURE__ */ a(U, { type: "button", isLoading: o, onClick: f, children: "Continue" }) : /* @__PURE__ */ i(
3648
3648
  U,
3649
3649
  {
3650
3650
  type: "button",
3651
- onClick: H,
3651
+ onClick: K,
3652
3652
  style: { display: "flex", alignItems: "center", gap: "4px" },
3653
3653
  children: [
3654
3654
  "Next",
@@ -3782,8 +3782,8 @@ const Dr = ({
3782
3782
  onBack: r
3783
3783
  }) => {
3784
3784
  const { investorCategorizationService: n } = he(), [s, l] = x(null), [o, c] = x(!1), [u, p] = x(null);
3785
- return /* @__PURE__ */ a("form", { onSubmit: async (N) => {
3786
- if (N.preventDefault(), s === null) {
3785
+ return /* @__PURE__ */ a("form", { onSubmit: async (S) => {
3786
+ if (S.preventDefault(), s === null) {
3787
3787
  p("Please select an investor type");
3788
3788
  return;
3789
3789
  }
@@ -3801,12 +3801,12 @@ const Dr = ({
3801
3801
  } finally {
3802
3802
  c(!1);
3803
3803
  }
3804
- }, children: /* @__PURE__ */ i($, { children: [
3804
+ }, children: /* @__PURE__ */ i(B, { children: [
3805
3805
  /* @__PURE__ */ i(oe, { children: [
3806
3806
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
3807
3807
  /* @__PURE__ */ a("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" })
3808
3808
  ] }),
3809
- /* @__PURE__ */ i(B, { className: "space-y-4", children: [
3809
+ /* @__PURE__ */ i(z, { className: "space-y-4", children: [
3810
3810
  /* @__PURE__ */ a("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
3811
3811
  /* @__PURE__ */ a(
3812
3812
  "label",
@@ -3919,91 +3919,91 @@ const Dr = ({
3919
3919
  onComplete: t,
3920
3920
  onBack: r
3921
3921
  }) => {
3922
- const { appropriatenessTestService: n } = he(), [s, l] = x(null), [o, c] = x(!0), [u, p] = x(!1), [w, N] = x(null), [y, h] = x({}), [g, k] = x(0), [b, m] = x(!1), [F, S] = x(!1), [v, q] = x(0);
3923
- X(() => {
3922
+ const { appropriatenessTestService: n } = he(), [s, l] = x(null), [o, c] = x(!0), [u, p] = x(!1), [w, S] = x(null), [y, h] = x({}), [g, N] = x(0), [b, m] = x(!1), [R, A] = x(!1), [k, q] = x(0);
3923
+ ee(() => {
3924
3924
  (async () => {
3925
3925
  try {
3926
- c(!0), N(null), console.log("Loading appropriateness test for applicant:", e);
3927
- const R = await n.getAppropriatenessTest(e);
3928
- if (console.log("Appropriateness test data:", R), l(R), R.waitTimeSpanForNextTry && R.waitTimeSpanForNextTry !== "00:00:00") {
3929
- const G = H(R.waitTimeSpanForNextTry);
3926
+ c(!0), S(null), console.log("Loading appropriateness test for applicant:", e);
3927
+ const E = await n.getAppropriatenessTest(e);
3928
+ if (console.log("Appropriateness test data:", E), l(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
3929
+ const G = K(E.waitTimeSpanForNextTry);
3930
3930
  G > 0 && q(G);
3931
3931
  }
3932
- } catch (R) {
3933
- console.error("Error loading appropriateness test:", R), N(R.message || "Failed to load appropriateness test");
3932
+ } catch (E) {
3933
+ console.error("Error loading appropriateness test:", E), S(E.message || "Failed to load appropriateness test");
3934
3934
  } finally {
3935
3935
  c(!1);
3936
3936
  }
3937
3937
  })();
3938
3938
  }, [e, n]);
3939
- const H = (P) => {
3940
- const R = P.split(":").map(Number);
3941
- if (R.length === 3) {
3942
- const [G, K, le] = R;
3943
- return G * 3600 + K * 60 + le;
3939
+ const K = (P) => {
3940
+ const E = P.split(":").map(Number);
3941
+ if (E.length === 3) {
3942
+ const [G, j, ae] = E;
3943
+ return G * 3600 + j * 60 + ae;
3944
3944
  }
3945
3945
  return 0;
3946
3946
  }, T = (P) => {
3947
- const R = Math.floor(P / 60), G = P % 60;
3948
- return `${R.toString().padStart(2, "0")}:${G.toString().padStart(2, "0")}`;
3947
+ const E = Math.floor(P / 60), G = P % 60;
3948
+ return `${E.toString().padStart(2, "0")}:${G.toString().padStart(2, "0")}`;
3949
3949
  };
3950
- X(() => {
3950
+ ee(() => {
3951
3951
  if (!b || g <= 0) return;
3952
3952
  const P = setInterval(() => {
3953
- k((R) => R <= 1 ? (S(!0), 0) : R - 1);
3953
+ N((E) => E <= 1 ? (A(!0), 0) : E - 1);
3954
3954
  }, 1e3);
3955
3955
  return () => clearInterval(P);
3956
- }, [b, g]), X(() => {
3957
- if (v <= 0) return;
3956
+ }, [b, g]), ee(() => {
3957
+ if (k <= 0) return;
3958
3958
  const P = setInterval(() => {
3959
- q((R) => R <= 1 ? 0 : R - 1);
3959
+ q((E) => E <= 1 ? 0 : E - 1);
3960
3960
  }, 1e3);
3961
3961
  return () => clearInterval(P);
3962
- }, [v]), X(() => {
3963
- F && !u && D();
3964
- }, [F]);
3962
+ }, [k]), ee(() => {
3963
+ R && !u && F();
3964
+ }, [R]);
3965
3965
  const f = () => {
3966
- s && (m(!0), k(s.testDurationSec));
3967
- }, A = (P, R) => {
3966
+ s && (m(!0), N(s.testDurationSec));
3967
+ }, I = (P, E) => {
3968
3968
  h((G) => ({
3969
3969
  ...G,
3970
- [P]: R
3970
+ [P]: E
3971
3971
  }));
3972
- }, D = async (P) => {
3972
+ }, F = async (P) => {
3973
3973
  if (P && P.preventDefault(), !!s) {
3974
- if (!F) {
3975
- const R = s.appropriatenessQuestions.length - Object.keys(y).length;
3976
- if (R > 0) {
3977
- N(`Please answer all questions. ${R} question(s) remaining.`);
3974
+ if (!R) {
3975
+ const E = s.appropriatenessQuestions.length - Object.keys(y).length;
3976
+ if (E > 0) {
3977
+ S(`Please answer all questions. ${E} question(s) remaining.`);
3978
3978
  return;
3979
3979
  }
3980
3980
  }
3981
- p(!0), N(null);
3981
+ p(!0), S(null);
3982
3982
  try {
3983
- const R = s.appropriatenessQuestions.map(
3984
- (K) => ({
3985
- appropriatenessQuestionId: K.id,
3986
- value: y[K.id] || ""
3983
+ const E = s.appropriatenessQuestions.map(
3984
+ (j) => ({
3985
+ appropriatenessQuestionId: j.id,
3986
+ value: y[j.id] || ""
3987
3987
  // Empty string if not answered
3988
3988
  })
3989
3989
  ), G = {
3990
3990
  applicantId: e,
3991
3991
  appropriatenessTestId: s.id,
3992
- appropriatenessQuestionResults: R
3992
+ appropriatenessQuestionResults: E
3993
3993
  };
3994
3994
  console.log("Submitting appropriateness test:", G);
3995
3995
  try {
3996
- const K = await n.fillAppropriatenessTest(G);
3997
- console.log("Appropriateness test result:", K), K.message && (K.message.toLowerCase().includes("pass") || K.message.toLowerCase().includes("success") || K.message.toLowerCase().includes("congratulations")) ? t == null || t() : (N(K.message || "Test completed. Please check the result."), m(!1), S(!1), h({}), setTimeout(() => Q(), 1e3));
3998
- } catch (K) {
3999
- if (K.code === 400 && K.message) {
4000
- const le = K.message;
4001
- console.log("Test failed:", le), N(le), m(!1), S(!1), h({}), setTimeout(() => Q(), 1500);
3996
+ const j = await n.fillAppropriatenessTest(G);
3997
+ console.log("Appropriateness test result:", j), j.message && (j.message.toLowerCase().includes("pass") || j.message.toLowerCase().includes("success") || j.message.toLowerCase().includes("congratulations")) ? t == null || t() : (S(j.message || "Test completed. Please check the result."), m(!1), A(!1), h({}), setTimeout(() => Q(), 1e3));
3998
+ } catch (j) {
3999
+ if (j.code === 400 && j.message) {
4000
+ const ae = j.message;
4001
+ console.log("Test failed:", ae), S(ae), m(!1), A(!1), h({}), setTimeout(() => Q(), 1500);
4002
4002
  } else
4003
- throw K;
4003
+ throw j;
4004
4004
  }
4005
- } catch (R) {
4006
- console.error("Error submitting appropriateness test:", R), N(R.message || "Failed to submit test. Please try again."), m(!1), S(!1), h({});
4005
+ } catch (E) {
4006
+ console.error("Error submitting appropriateness test:", E), S(E.message || "Failed to submit test. Please try again."), m(!1), A(!1), h({});
4007
4007
  } finally {
4008
4008
  p(!1);
4009
4009
  }
@@ -4012,41 +4012,41 @@ const Dr = ({
4012
4012
  try {
4013
4013
  const P = await n.getAppropriatenessTest(e);
4014
4014
  if (console.log("Reloaded test data:", P), l(P), P.waitTimeSpanForNextTry && P.waitTimeSpanForNextTry !== "00:00:00") {
4015
- const R = H(P.waitTimeSpanForNextTry);
4016
- R > 0 && q(R);
4015
+ const E = K(P.waitTimeSpanForNextTry);
4016
+ E > 0 && q(E);
4017
4017
  }
4018
4018
  } catch (P) {
4019
- console.error("Error reloading test data:", P), N((R) => R + `
4019
+ console.error("Error reloading test data:", P), S((E) => E + `
4020
4020
 
4021
4021
  Failed to reload test data. Please refresh the page.`);
4022
4022
  }
4023
4023
  };
4024
4024
  if (o)
4025
- return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
4025
+ return /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { children: [
4026
4026
  /* @__PURE__ */ a(xe, { className: "my-8" }),
4027
4027
  /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
4028
4028
  ] }) });
4029
4029
  if (!s)
4030
- return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
4030
+ return /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { className: "py-12 text-center", children: [
4031
4031
  /* @__PURE__ */ a("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
4032
4032
  w && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: w })
4033
4033
  ] }) });
4034
- if (v > 0)
4035
- return /* @__PURE__ */ i($, { children: [
4034
+ if (k > 0)
4035
+ return /* @__PURE__ */ i(B, { children: [
4036
4036
  /* @__PURE__ */ i(oe, { children: [
4037
4037
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
4038
4038
  s.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
4039
4039
  ] }),
4040
- /* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
4040
+ /* @__PURE__ */ i(z, { className: "py-12 text-center", children: [
4041
4041
  /* @__PURE__ */ i("div", { className: "mb-6", children: [
4042
- /* @__PURE__ */ a("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: T(v) }),
4042
+ /* @__PURE__ */ a("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: T(k) }),
4043
4043
  /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
4044
4044
  ] }),
4045
4045
  w && /* @__PURE__ */ a("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__ */ a("p", { className: "text-red-600 dark:text-red-400 text-sm", children: w }) })
4046
4046
  ] })
4047
4047
  ] });
4048
4048
  const W = s.testAllowedMaxTry - s.totalFailedTries;
4049
- return b ? /* @__PURE__ */ a("form", { onSubmit: D, children: /* @__PURE__ */ i($, { children: [
4049
+ return b ? /* @__PURE__ */ a("form", { onSubmit: F, children: /* @__PURE__ */ i(B, { children: [
4050
4050
  /* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
4051
4051
  /* @__PURE__ */ i("div", { children: [
4052
4052
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
@@ -4063,7 +4063,7 @@ Failed to reload test data. Please refresh the page.`);
4063
4063
  /* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
4064
4064
  ] })
4065
4065
  ] }) }),
4066
- /* @__PURE__ */ i(B, { className: "space-y-6", children: [
4066
+ /* @__PURE__ */ i(z, { className: "space-y-6", children: [
4067
4067
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
4068
4068
  /* @__PURE__ */ i(Se, { variant: "info", children: [
4069
4069
  "Question ",
@@ -4078,7 +4078,7 @@ Failed to reload test data. Please refresh the page.`);
4078
4078
  " remaining"
4079
4079
  ] })
4080
4080
  ] }),
4081
- s.appropriatenessQuestions.map((P, R) => /* @__PURE__ */ i(
4081
+ s.appropriatenessQuestions.map((P, E) => /* @__PURE__ */ i(
4082
4082
  "div",
4083
4083
  {
4084
4084
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -4086,12 +4086,12 @@ Failed to reload test data. Please refresh the page.`);
4086
4086
  /* @__PURE__ */ i("div", { className: "mb-4", children: [
4087
4087
  /* @__PURE__ */ i("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: [
4088
4088
  "Question ",
4089
- R + 1
4089
+ E + 1
4090
4090
  ] }),
4091
4091
  P.groupName && /* @__PURE__ */ a("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: P.groupName }),
4092
4092
  /* @__PURE__ */ a("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: P.question })
4093
4093
  ] }),
4094
- /* @__PURE__ */ a("div", { className: "space-y-2", children: P.answers.map((G, K) => /* @__PURE__ */ i(
4094
+ /* @__PURE__ */ a("div", { className: "space-y-2", children: P.answers.map((G, j) => /* @__PURE__ */ i(
4095
4095
  "label",
4096
4096
  {
4097
4097
  className: `
@@ -4106,7 +4106,7 @@ Failed to reload test data. Please refresh the page.`);
4106
4106
  name: `question-${P.id}`,
4107
4107
  value: G,
4108
4108
  checked: y[P.id] === G,
4109
- onChange: (le) => A(P.id, le.target.value),
4109
+ onChange: (ae) => I(P.id, ae.target.value),
4110
4110
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
4111
4111
  disabled: u
4112
4112
  }
@@ -4114,18 +4114,18 @@ Failed to reload test data. Please refresh the page.`);
4114
4114
  /* @__PURE__ */ a("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: G })
4115
4115
  ]
4116
4116
  },
4117
- K
4117
+ j
4118
4118
  )) })
4119
4119
  ]
4120
4120
  },
4121
4121
  P.id
4122
4122
  )),
4123
- w && !F && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4123
+ w && !R && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4124
4124
  /* @__PURE__ */ a("strong", { children: "Error:" }),
4125
4125
  " ",
4126
4126
  w
4127
4127
  ] }) }),
4128
- F && /* @__PURE__ */ a("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
4128
+ R && /* @__PURE__ */ a("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
4129
4129
  /* @__PURE__ */ a("strong", { children: "Time's up!" }),
4130
4130
  " Your answers are being submitted automatically."
4131
4131
  ] }) })
@@ -4147,16 +4147,16 @@ Failed to reload test data. Please refresh the page.`);
4147
4147
  type: "submit",
4148
4148
  isLoading: u,
4149
4149
  disabled: Object.keys(y).length < s.totalQuestionCount,
4150
- children: F ? "Submitting..." : "Submit Test"
4150
+ children: R ? "Submitting..." : "Submit Test"
4151
4151
  }
4152
4152
  )
4153
4153
  ] })
4154
- ] }) }) : /* @__PURE__ */ i($, { children: [
4154
+ ] }) }) : /* @__PURE__ */ i(B, { children: [
4155
4155
  /* @__PURE__ */ i(oe, { children: [
4156
4156
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
4157
4157
  s.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
4158
4158
  ] }),
4159
- /* @__PURE__ */ i(B, { children: [
4159
+ /* @__PURE__ */ i(z, { children: [
4160
4160
  s.description && /* @__PURE__ */ a("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-gray-700 dark:text-gray-300", children: s.description }) }),
4161
4161
  /* @__PURE__ */ i("div", { className: "space-y-4 mb-6", children: [
4162
4162
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
@@ -4201,8 +4201,8 @@ Failed to reload test data. Please refresh the page.`);
4201
4201
  onComplete: t,
4202
4202
  onBack: r
4203
4203
  }) => {
4204
- var G, K, le, be;
4205
- const { applicantService: n, baseInformationService: s, config: l } = he(), { identityData: o, provider: c, token: u, isLoading: p, error: w, requestIdentity: N, restartIdentity: y } = cr(e), [h, g] = x(null), [k, b] = x(null), [m, F] = x([]), [S, v] = x(!0), [q, H] = x(!1), [T, f] = x(null), [A, D] = x(!1), Q = ge.useRef(!1), W = pt({
4204
+ var G, j, ae, be;
4205
+ const { applicantService: n, baseInformationService: s, config: l } = he(), { identityData: o, provider: c, token: u, isLoading: p, error: w, requestIdentity: S, restartIdentity: y } = cr(e), [h, g] = x(null), [N, b] = x(null), [m, R] = x([]), [A, k] = x(!0), [q, K] = x(!1), [T, f] = x(null), [I, F] = x(!1), Q = ge.useRef(!1), W = pt({
4206
4206
  defaultValues: {
4207
4207
  street: "",
4208
4208
  streetNumber: "",
@@ -4213,163 +4213,163 @@ Failed to reload test data. Please refresh the page.`);
4213
4213
  phonenumber: ""
4214
4214
  }
4215
4215
  });
4216
- X(() => {
4216
+ ee(() => {
4217
4217
  (async () => {
4218
4218
  try {
4219
- const [L, ee] = await Promise.all([
4219
+ const [M, te] = await Promise.all([
4220
4220
  n.getApplicantData(e),
4221
4221
  s.getCountries("", "en")
4222
4222
  ]);
4223
- b(L);
4224
- const Z = /* @__PURE__ */ new Set(), ae = ee.filter((ve) => {
4223
+ b(M);
4224
+ const Z = /* @__PURE__ */ new Set(), ne = te.filter((ve) => {
4225
4225
  const Le = ve.abbreviation3 || ve.abbreviation;
4226
4226
  return !Le || Z.has(Le) ? !1 : (Z.add(Le), !0);
4227
4227
  });
4228
- F(ae);
4229
- const j = L.applicantRequestData;
4228
+ R(ne);
4229
+ const H = M.applicantRequestData;
4230
4230
  if (W.reset({
4231
- street: (j == null ? void 0 : j.street) || "",
4232
- streetNumber: (j == null ? void 0 : j.streetNumber) || "",
4233
- city: (j == null ? void 0 : j.city) || "",
4234
- zip: (j == null ? void 0 : j.zip) || "",
4235
- country: (j == null ? void 0 : j.country) || "",
4236
- nationality: (j == null ? void 0 : j.nationality) || "",
4237
- phonenumber: (j == null ? void 0 : j.phonenumber) || ""
4238
- }), L.kycRecords && L.kycRecords.length > 0 && L.kycRecords[0].providerTokenObject !== null && !Q.current) {
4231
+ street: (H == null ? void 0 : H.street) || "",
4232
+ streetNumber: (H == null ? void 0 : H.streetNumber) || "",
4233
+ city: (H == null ? void 0 : H.city) || "",
4234
+ zip: (H == null ? void 0 : H.zip) || "",
4235
+ country: (H == null ? void 0 : H.country) || "",
4236
+ nationality: (H == null ? void 0 : H.nationality) || "",
4237
+ phonenumber: (H == null ? void 0 : H.phonenumber) || ""
4238
+ }), M.kycRecords && M.kycRecords.length > 0 && M.kycRecords[0].providerTokenObject !== null && !Q.current) {
4239
4239
  console.log("[Identity] Found existing identity verification, auto-requesting..."), Q.current = !0;
4240
4240
  try {
4241
- await N(), H(!0);
4241
+ await S(), K(!0);
4242
4242
  } catch (ve) {
4243
4243
  console.error("[Identity] Auto-request failed:", ve);
4244
4244
  }
4245
4245
  }
4246
- } catch (L) {
4247
- console.error("Error loading applicant data:", L);
4246
+ } catch (M) {
4247
+ console.error("Error loading applicant data:", M);
4248
4248
  } finally {
4249
- v(!1);
4249
+ k(!1);
4250
4250
  }
4251
4251
  })();
4252
- }, [e]), X(() => {
4253
- o && !q && (console.log("[Identity] Identity data already loaded, showing provider"), H(!0));
4254
- }, [o, q]), X(() => {
4252
+ }, [e]), ee(() => {
4253
+ o && !q && (console.log("[Identity] Identity data already loaded, showing provider"), K(!0));
4254
+ }, [o, q]), ee(() => {
4255
4255
  if (u) {
4256
4256
  if (u.expiresAt) {
4257
- const O = new Date(u.expiresAt).getTime();
4258
- if (Date.now() >= O) {
4259
- console.warn("[Identity] Token has expired (expiresAt)"), D(!0), f("Your verification session has expired. Please restart.");
4257
+ const $ = new Date(u.expiresAt).getTime();
4258
+ if (Date.now() >= $) {
4259
+ console.warn("[Identity] Token has expired (expiresAt)"), F(!0), f("Your verification session has expired. Please restart.");
4260
4260
  return;
4261
4261
  }
4262
4262
  }
4263
4263
  if (u.url)
4264
4264
  try {
4265
- const L = new URL(u.url).toString().toLowerCase();
4266
- if (L.includes("expired") || L.includes("invalid") || L.includes("error")) {
4267
- console.warn("[Identity] Token URL indicates expiration"), D(!0), f("Your verification link has expired. Please restart.");
4265
+ const M = new URL(u.url).toString().toLowerCase();
4266
+ if (M.includes("expired") || M.includes("invalid") || M.includes("error")) {
4267
+ console.warn("[Identity] Token URL indicates expiration"), F(!0), f("Your verification link has expired. Please restart.");
4268
4268
  return;
4269
4269
  }
4270
4270
  } catch {
4271
4271
  console.error("[Identity] Invalid token URL");
4272
4272
  }
4273
4273
  if (u.status === "expired" || u.error === "expired" || u.expired === !0) {
4274
- console.warn("[Identity] Token object indicates expiration"), D(!0), f("Your verification session has expired. Please restart.");
4274
+ console.warn("[Identity] Token object indicates expiration"), F(!0), f("Your verification session has expired. Please restart.");
4275
4275
  return;
4276
4276
  }
4277
4277
  }
4278
- }, [u]), X(() => {
4279
- if (c !== null && u && !h && q && !A) {
4280
- const O = c;
4278
+ }, [u]), ee(() => {
4279
+ if (c !== null && u && !h && q && !I) {
4280
+ const $ = c;
4281
4281
  if (u.url) {
4282
4282
  console.log("[Identity] Loading provider URL for user verification:", u.url), f(null);
4283
4283
  try {
4284
- if (new URL(u.url), O === ye.SardinAI) {
4284
+ if (new URL(u.url), $ === ye.SardinAI) {
4285
4285
  console.log("[SardinAI] Initializing Risk SDK in background...");
4286
4286
  try {
4287
- const L = De.parseProviderConfig(c, u, l);
4288
- De.createProvider(c, L).initialize().then(() => {
4287
+ const M = De.parseProviderConfig(c, u, l);
4288
+ De.createProvider(c, M).initialize().then(() => {
4289
4289
  console.log("[SardinAI] Risk SDK initialized successfully in background");
4290
4290
  }).catch((Z) => {
4291
4291
  console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", Z);
4292
4292
  });
4293
- } catch (L) {
4294
- console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", L);
4293
+ } catch (M) {
4294
+ console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", M);
4295
4295
  }
4296
4296
  }
4297
4297
  g({ type: "url", url: u.url });
4298
- } catch (L) {
4299
- console.error("[Identity] Invalid URL:", L), f("Invalid verification URL. Please restart."), D(!0);
4298
+ } catch (M) {
4299
+ console.error("[Identity] Invalid URL:", M), f("Invalid verification URL. Please restart."), F(!0);
4300
4300
  }
4301
4301
  return;
4302
4302
  }
4303
- if (O === ye.SardinAI) {
4303
+ if ($ === ye.SardinAI) {
4304
4304
  console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
4305
4305
  try {
4306
- const L = De.parseProviderConfig(c, u, l), ee = De.createProvider(c, L);
4307
- ee.initialize().then(() => {
4308
- console.log("[SardinAI] Risk SDK initialized successfully"), g(ee), setTimeout(() => {
4306
+ const M = De.parseProviderConfig(c, u, l), te = De.createProvider(c, M);
4307
+ te.initialize().then(() => {
4308
+ console.log("[SardinAI] Risk SDK initialized successfully"), g(te), setTimeout(() => {
4309
4309
  t == null || t();
4310
4310
  }, 2e3);
4311
4311
  }).catch((Z) => {
4312
- var j;
4312
+ var H;
4313
4313
  console.error("[SardinAI] Failed to initialize:", Z);
4314
- const ae = ((j = Z.message) == null ? void 0 : j.toLowerCase()) || "";
4315
- ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (D(!0), f("Session expired or invalid. Please restart verification.")) : f(`Failed to initialize: ${Z.message}`);
4314
+ const ne = ((H = Z.message) == null ? void 0 : H.toLowerCase()) || "";
4315
+ ne.includes("expired") || ne.includes("invalid") || ne.includes("401") || ne.includes("400") ? (F(!0), f("Session expired or invalid. Please restart verification.")) : f(`Failed to initialize: ${Z.message}`);
4316
4316
  });
4317
- } catch (L) {
4318
- console.error("[SardinAI] Error creating provider:", L), f(`Configuration error: ${L.message}`);
4317
+ } catch (M) {
4318
+ console.error("[SardinAI] Error creating provider:", M), f(`Configuration error: ${M.message}`);
4319
4319
  }
4320
4320
  return;
4321
4321
  }
4322
4322
  try {
4323
4323
  f(null);
4324
- const L = De.parseProviderConfig(c, u, l), ee = De.createProvider(c, L);
4325
- O === ye.Sumsub ? (ee.initialize("identity-container").catch((Z) => {
4326
- var ae;
4327
- console.error("[Sumsub] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`), (ae = Z.message) != null && ae.toLowerCase().includes("expired") && D(!0);
4328
- }), ee.onComplete && ee.onComplete(() => {
4324
+ const M = De.parseProviderConfig(c, u, l), te = De.createProvider(c, M);
4325
+ $ === ye.Sumsub ? (te.initialize("identity-container").catch((Z) => {
4326
+ var ne;
4327
+ console.error("[Sumsub] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`), (ne = Z.message) != null && ne.toLowerCase().includes("expired") && F(!0);
4328
+ }), te.onComplete && te.onComplete(() => {
4329
4329
  t == null || t();
4330
- })) : O === ye.Onfido && ee.initialize("identity-container").catch((Z) => {
4330
+ })) : $ === ye.Onfido && te.initialize("identity-container").catch((Z) => {
4331
4331
  console.error("[Onfido] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`);
4332
- }), g(ee);
4333
- } catch (L) {
4334
- console.error("[Identity] Provider setup error:", L), f(`Setup error: ${L.message}`);
4332
+ }), g(te);
4333
+ } catch (M) {
4334
+ console.error("[Identity] Provider setup error:", M), f(`Setup error: ${M.message}`);
4335
4335
  }
4336
4336
  }
4337
4337
  return () => {
4338
4338
  if (h && h.destroy)
4339
4339
  try {
4340
4340
  h.destroy();
4341
- } catch (O) {
4342
- console.error("[Identity] Error destroying provider:", O);
4341
+ } catch ($) {
4342
+ console.error("[Identity] Error destroying provider:", $);
4343
4343
  }
4344
4344
  };
4345
- }, [c, u, h, q, t, A]);
4345
+ }, [c, u, h, q, t, I]);
4346
4346
  const P = async () => {
4347
4347
  try {
4348
- f(null), D(!1), await N(), H(!0);
4349
- } catch (O) {
4350
- console.error("Error starting identity verification:", O);
4348
+ f(null), F(!1), await S(), K(!0);
4349
+ } catch ($) {
4350
+ console.error("Error starting identity verification:", $);
4351
4351
  }
4352
- }, R = async () => {
4352
+ }, E = async () => {
4353
4353
  try {
4354
- f(null), D(!1), g(null), console.log("[Identity] Restarting verification..."), await y(), H(!0);
4355
- } catch (O) {
4356
- console.error("Error restarting identity verification:", O), f(O.message || "Failed to restart verification");
4354
+ f(null), F(!1), g(null), console.log("[Identity] Restarting verification..."), await y(), K(!0);
4355
+ } catch ($) {
4356
+ console.error("Error restarting identity verification:", $), f($.message || "Failed to restart verification");
4357
4357
  }
4358
4358
  };
4359
- if (S || p)
4360
- return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
4359
+ if (A || p)
4360
+ return /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { children: [
4361
4361
  /* @__PURE__ */ a(xe, { className: "my-8" }),
4362
4362
  /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4363
4363
  ] }) });
4364
4364
  if (w)
4365
- return /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
4365
+ return /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
4366
4366
  "Error: ",
4367
4367
  w.message
4368
4368
  ] }) }) });
4369
- if (q && (T || A))
4370
- return /* @__PURE__ */ i($, { children: [
4369
+ if (q && (T || I))
4370
+ return /* @__PURE__ */ i(B, { children: [
4371
4371
  /* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4372
- /* @__PURE__ */ i(B, { children: [
4372
+ /* @__PURE__ */ i(z, { children: [
4373
4373
  /* @__PURE__ */ a("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__ */ i("div", { className: "flex items-start", children: [
4374
4374
  /* @__PURE__ */ a(
4375
4375
  "svg",
@@ -4390,7 +4390,7 @@ Failed to reload test data. Please refresh the page.`);
4390
4390
  }
4391
4391
  ),
4392
4392
  /* @__PURE__ */ i("div", { children: [
4393
- /* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: A ? "Session Expired" : "Verification Error" }),
4393
+ /* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: I ? "Session Expired" : "Verification Error" }),
4394
4394
  /* @__PURE__ */ a("p", { className: "text-red-800 dark:text-red-200 text-sm", children: T || "Your verification session has expired and needs to be restarted." })
4395
4395
  ] })
4396
4396
  ] }) }),
@@ -4405,12 +4405,12 @@ Failed to reload test data. Please refresh the page.`);
4405
4405
  ] }),
4406
4406
  /* @__PURE__ */ i(me, { className: "flex justify-between", children: [
4407
4407
  r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4408
- /* @__PURE__ */ a(U, { type: "button", onClick: R, disabled: p, children: p ? "Restarting..." : "Restart Verification" })
4408
+ /* @__PURE__ */ a(U, { type: "button", onClick: E, disabled: p, children: p ? "Restarting..." : "Restart Verification" })
4409
4409
  ] })
4410
4410
  ] });
4411
4411
  if (q && o) {
4412
- const O = c;
4413
- return u != null && u.url ? /* @__PURE__ */ i($, { children: [
4412
+ const $ = c;
4413
+ return u != null && u.url ? /* @__PURE__ */ i(B, { children: [
4414
4414
  /* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
4415
4415
  /* @__PURE__ */ i("div", { children: [
4416
4416
  /* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
@@ -4422,13 +4422,13 @@ Failed to reload test data. Please refresh the page.`);
4422
4422
  type: "button",
4423
4423
  variant: "outline",
4424
4424
  size: "sm",
4425
- onClick: R,
4425
+ onClick: E,
4426
4426
  disabled: p,
4427
4427
  children: "Restart"
4428
4428
  }
4429
4429
  )
4430
4430
  ] }) }),
4431
- /* @__PURE__ */ i(B, { children: [
4431
+ /* @__PURE__ */ i(z, { children: [
4432
4432
  /* @__PURE__ */ a("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__ */ i("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
4433
4433
  /* @__PURE__ */ a("strong", { children: "Important:" }),
4434
4434
  ' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
@@ -4440,14 +4440,14 @@ Failed to reload test data. Please refresh the page.`);
4440
4440
  className: "w-full h-full border-0 rounded-lg",
4441
4441
  allow: "camera; microphone; geolocation",
4442
4442
  title: "Identity Verification",
4443
- onLoad: (L) => {
4444
- var ee, Z, ae;
4443
+ onLoad: (M) => {
4444
+ var te, Z, ne;
4445
4445
  console.log("[Identity] Iframe loaded");
4446
4446
  try {
4447
- const j = L.target, Fe = j.contentDocument || ((ee = j.contentWindow) == null ? void 0 : ee.document);
4447
+ const H = M.target, Fe = H.contentDocument || ((te = H.contentWindow) == null ? void 0 : te.document);
4448
4448
  if (Fe) {
4449
- const ve = ((ae = (Z = Fe.body) == null ? void 0 : Z.textContent) == null ? void 0 : ae.toLowerCase()) || "";
4450
- (ve.includes("expired") || ve.includes("invalid") || ve.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), D(!0), f("Your verification link has expired."));
4449
+ const ve = ((ne = (Z = Fe.body) == null ? void 0 : Z.textContent) == null ? void 0 : ne.toLowerCase()) || "";
4450
+ (ve.includes("expired") || ve.includes("invalid") || ve.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), F(!0), f("Your verification link has expired."));
4451
4451
  }
4452
4452
  } catch {
4453
4453
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4457,47 +4457,47 @@ Failed to reload test data. Please refresh the page.`);
4457
4457
  ) })
4458
4458
  ] }),
4459
4459
  r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
4460
- ] }) : O === ye.SardinAI ? /* @__PURE__ */ i($, { children: [
4460
+ ] }) : $ === ye.SardinAI ? /* @__PURE__ */ i(B, { children: [
4461
4461
  /* @__PURE__ */ i(oe, { children: [
4462
4462
  /* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4463
4463
  /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4464
4464
  ] }),
4465
- /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-12", children: [
4465
+ /* @__PURE__ */ a(z, { children: /* @__PURE__ */ i("div", { className: "text-center py-12", children: [
4466
4466
  /* @__PURE__ */ a(xe, { className: "mb-4" }),
4467
4467
  /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4468
4468
  /* @__PURE__ */ a("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" })
4469
4469
  ] }) })
4470
- ] }) : /* @__PURE__ */ i($, { children: [
4470
+ ] }) : /* @__PURE__ */ i(B, { children: [
4471
4471
  /* @__PURE__ */ i(oe, { children: [
4472
4472
  /* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4473
4473
  /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4474
4474
  ] }),
4475
- /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4475
+ /* @__PURE__ */ a(z, { children: /* @__PURE__ */ a("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4476
4476
  r && /* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
4477
4477
  ] });
4478
4478
  }
4479
- return /* @__PURE__ */ a("form", { onSubmit: W.handleSubmit(P), children: /* @__PURE__ */ i($, { children: [
4479
+ return /* @__PURE__ */ a("form", { onSubmit: W.handleSubmit(P), children: /* @__PURE__ */ i(B, { children: [
4480
4480
  /* @__PURE__ */ i(oe, { children: [
4481
4481
  /* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
4482
4482
  /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
4483
4483
  ] }),
4484
- /* @__PURE__ */ i(B, { className: "space-y-6", children: [
4484
+ /* @__PURE__ */ i(z, { className: "space-y-6", children: [
4485
4485
  /* @__PURE__ */ i("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
4486
4486
  /* @__PURE__ */ i("div", { children: [
4487
4487
  /* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4488
4488
  /* @__PURE__ */ i("p", { className: "mt-1 text-base", children: [
4489
- (G = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : G.firstName,
4489
+ (G = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : G.firstName,
4490
4490
  " ",
4491
- (K = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : K.lastName
4491
+ (j = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : j.lastName
4492
4492
  ] })
4493
4493
  ] }),
4494
4494
  /* @__PURE__ */ i("div", { children: [
4495
4495
  /* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4496
- /* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (le = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : le.email })
4496
+ /* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (ae = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : ae.email })
4497
4497
  ] }),
4498
4498
  /* @__PURE__ */ i("div", { children: [
4499
4499
  /* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
4500
- /* @__PURE__ */ a("p", { className: "mt-1 text-base", children: ((be = k == null ? void 0 : k.applicantRequestData) == null ? void 0 : be.dateOfBirth) || "Not provided" })
4500
+ /* @__PURE__ */ a("p", { className: "mt-1 text-base", children: ((be = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : be.dateOfBirth) || "Not provided" })
4501
4501
  ] })
4502
4502
  ] }),
4503
4503
  /* @__PURE__ */ i("div", { className: "space-y-4", children: [
@@ -4508,16 +4508,16 @@ Failed to reload test data. Please refresh the page.`);
4508
4508
  {
4509
4509
  control: W.control,
4510
4510
  name: "country",
4511
- render: ({ field: O }) => /* @__PURE__ */ a(
4511
+ render: ({ field: $ }) => /* @__PURE__ */ a(
4512
4512
  Ae,
4513
4513
  {
4514
- ...O,
4514
+ ...$,
4515
4515
  label: "Country",
4516
4516
  options: [
4517
4517
  { value: "", label: "Select country..." },
4518
- ...m.map((L) => ({
4519
- value: L.abbreviation3 || L.abbreviation,
4520
- label: L.name
4518
+ ...m.map((M) => ({
4519
+ value: M.abbreviation3 || M.abbreviation,
4520
+ label: M.name
4521
4521
  }))
4522
4522
  ]
4523
4523
  }
@@ -4529,16 +4529,16 @@ Failed to reload test data. Please refresh the page.`);
4529
4529
  {
4530
4530
  control: W.control,
4531
4531
  name: "nationality",
4532
- render: ({ field: O }) => /* @__PURE__ */ a(
4532
+ render: ({ field: $ }) => /* @__PURE__ */ a(
4533
4533
  Ae,
4534
4534
  {
4535
- ...O,
4535
+ ...$,
4536
4536
  label: "Nationality",
4537
4537
  options: [
4538
4538
  { value: "", label: "Select nationality..." },
4539
- ...m.map((L) => ({
4540
- value: L.abbreviation3 || L.abbreviation,
4541
- label: L.name
4539
+ ...m.map((M) => ({
4540
+ value: M.abbreviation3 || M.abbreviation,
4541
+ label: M.name
4542
4542
  }))
4543
4543
  ]
4544
4544
  }
@@ -4552,7 +4552,7 @@ Failed to reload test data. Please refresh the page.`);
4552
4552
  {
4553
4553
  control: W.control,
4554
4554
  name: "street",
4555
- render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Street" })
4555
+ render: ({ field: $ }) => /* @__PURE__ */ a(ue, { ...$, label: "Street" })
4556
4556
  }
4557
4557
  ),
4558
4558
  /* @__PURE__ */ a(
@@ -4560,7 +4560,7 @@ Failed to reload test data. Please refresh the page.`);
4560
4560
  {
4561
4561
  control: W.control,
4562
4562
  name: "streetNumber",
4563
- render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Street Number" })
4563
+ render: ({ field: $ }) => /* @__PURE__ */ a(ue, { ...$, label: "Street Number" })
4564
4564
  }
4565
4565
  )
4566
4566
  ] }),
@@ -4570,7 +4570,7 @@ Failed to reload test data. Please refresh the page.`);
4570
4570
  {
4571
4571
  control: W.control,
4572
4572
  name: "city",
4573
- render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "City" })
4573
+ render: ({ field: $ }) => /* @__PURE__ */ a(ue, { ...$, label: "City" })
4574
4574
  }
4575
4575
  ),
4576
4576
  /* @__PURE__ */ a(
@@ -4578,7 +4578,7 @@ Failed to reload test data. Please refresh the page.`);
4578
4578
  {
4579
4579
  control: W.control,
4580
4580
  name: "zip",
4581
- render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "ZIP/Postal Code" })
4581
+ render: ({ field: $ }) => /* @__PURE__ */ a(ue, { ...$, label: "ZIP/Postal Code" })
4582
4582
  }
4583
4583
  )
4584
4584
  ] }),
@@ -4587,7 +4587,7 @@ Failed to reload test data. Please refresh the page.`);
4587
4587
  {
4588
4588
  control: W.control,
4589
4589
  name: "phonenumber",
4590
- render: ({ field: O }) => /* @__PURE__ */ a(ue, { ...O, label: "Phone Number", type: "tel" })
4590
+ render: ({ field: $ }) => /* @__PURE__ */ a(ue, { ...$, label: "Phone Number", type: "tel" })
4591
4591
  }
4592
4592
  )
4593
4593
  ] })
@@ -4676,8 +4676,8 @@ Failed to reload test data. Please refresh the page.`);
4676
4676
  iconColor: "text-blue-600 dark:text-blue-400",
4677
4677
  message: "Your application is being reviewed."
4678
4678
  };
4679
- return /* @__PURE__ */ i($, { children: [
4680
- /* @__PURE__ */ i(B, { className: "py-12", children: [
4679
+ return /* @__PURE__ */ i(B, { children: [
4680
+ /* @__PURE__ */ i(z, { className: "py-12", children: [
4681
4681
  /* @__PURE__ */ a("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ a(
4682
4682
  "div",
4683
4683
  {
@@ -4776,10 +4776,10 @@ Failed to reload test data. Please refresh the page.`);
4776
4776
  t && /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
4777
4777
  ] });
4778
4778
  }, He = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
4779
- function Be(e) {
4779
+ function ze(e) {
4780
4780
  return e == null || e === "" || Array.isArray(e) && e.length === 0;
4781
4781
  }
4782
- const ze = {
4782
+ const $e = {
4783
4783
  width: "16px",
4784
4784
  height: "16px",
4785
4785
  minWidth: "16px",
@@ -4803,48 +4803,48 @@ const ze = {
4803
4803
  throw new Error(
4804
4804
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
4805
4805
  );
4806
- const w = t || ((Ve = s.applicantForm) == null ? void 0 : Ve.externalRefId) || "", [N, y] = x([]), [h, g] = x(!0), k = J(!1), b = J(!1);
4807
- X(() => {
4806
+ const w = t || ((Ve = s.applicantForm) == null ? void 0 : Ve.externalRefId) || "", [S, y] = x([]), [h, g] = x(!0), N = X(!1), b = X(!1);
4807
+ ee(() => {
4808
4808
  (async () => {
4809
- if (!(k.current || b.current)) {
4810
- k.current = !0, g(!0);
4809
+ if (!(N.current || b.current)) {
4810
+ N.current = !0, g(!0);
4811
4811
  try {
4812
- const I = await l.getCountries("", s.locale || "en"), M = /* @__PURE__ */ new Set();
4812
+ const D = await l.getCountries("", s.locale || "en"), L = /* @__PURE__ */ new Set();
4813
4813
  y(
4814
- I.map((C) => ({ value: C.abbreviation3 || C.abbreviation, label: C.name })).filter((C) => !C.value || M.has(C.value) ? !1 : (M.add(C.value), !0))
4814
+ D.map((v) => ({ value: v.abbreviation3 || v.abbreviation, label: v.name })).filter((v) => !v.value || L.has(v.value) ? !1 : (L.add(v.value), !0))
4815
4815
  ), b.current = !0;
4816
- } catch (I) {
4817
- console.error("Failed to load countries:", I);
4816
+ } catch (D) {
4817
+ console.error("Failed to load countries:", D);
4818
4818
  } finally {
4819
- g(!1), k.current = !1;
4819
+ g(!1), N.current = !1;
4820
4820
  }
4821
4821
  }
4822
4822
  })();
4823
4823
  }, []);
4824
- const m = ke(
4824
+ const m = we(
4825
4825
  () => o != null && o.applicantFormPages && o.applicantFormPages.length > 0 ? o.applicantFormPages : null,
4826
4826
  [o == null ? void 0 : o.applicantFormPages]
4827
- ), F = ke(() => {
4828
- const d = new Set(He), I = o == null ? void 0 : o.applicantFormRequiredFields;
4829
- if (I) for (const M of I) d.add(M);
4827
+ ), R = we(() => {
4828
+ const d = new Set(He), D = o == null ? void 0 : o.applicantFormRequiredFields;
4829
+ if (D) for (const L of D) d.add(L);
4830
4830
  if (m)
4831
- for (const M of m)
4832
- for (const C of M.fields)
4833
- !C.isCustom && C.name && C.required && d.add(C.name);
4831
+ for (const L of m)
4832
+ for (const v of L.fields)
4833
+ !v.isCustom && v.name && v.required && d.add(v.name);
4834
4834
  return Array.from(d);
4835
- }, [o == null ? void 0 : o.applicantFormRequiredFields, m]), S = ke(() => {
4836
- var M;
4835
+ }, [o == null ? void 0 : o.applicantFormRequiredFields, m]), A = we(() => {
4836
+ var L;
4837
4837
  if (m) {
4838
- const C = m.flatMap((z) => z.fields).filter((z) => !z.isCustom && z.name).map((z) => z.name), E = new Set(C);
4839
- for (const z of He) E.add(z);
4840
- return Array.from(E);
4838
+ const v = m.flatMap((O) => O.fields).filter((O) => !O.isCustom && O.name).map((O) => O.name), C = new Set(v);
4839
+ for (const O of He) C.add(O);
4840
+ return Array.from(C);
4841
4841
  }
4842
4842
  let d;
4843
- (M = s.applicantForm) != null && M.visibleFields ? d = s.applicantForm.visibleFields : o != null && o.applicantFormVisibleFields && o.applicantFormVisibleFields.length > 0 ? d = o.applicantFormVisibleFields : d = Ct;
4844
- const I = new Set(d);
4845
- for (const C of He) I.add(C);
4846
- return Array.from(I);
4847
- }, [(Ge = s.applicantForm) == null ? void 0 : Ge.visibleFields, o == null ? void 0 : o.applicantFormVisibleFields, m]), [v, q] = x({
4843
+ (L = s.applicantForm) != null && L.visibleFields ? d = s.applicantForm.visibleFields : o != null && o.applicantFormVisibleFields && o.applicantFormVisibleFields.length > 0 ? d = o.applicantFormVisibleFields : d = Ct;
4844
+ const D = new Set(d);
4845
+ for (const v of He) D.add(v);
4846
+ return Array.from(D);
4847
+ }, [(Ge = s.applicantForm) == null ? void 0 : Ge.visibleFields, o == null ? void 0 : o.applicantFormVisibleFields, m]), [k, q] = x({
4848
4848
  workflowKey: p,
4849
4849
  firstName: "",
4850
4850
  lastName: "",
@@ -4869,46 +4869,46 @@ const ze = {
4869
4869
  educationLevel: "",
4870
4870
  occupation: "",
4871
4871
  taxNumber: ""
4872
- }), [H, T] = x({}), [f, A] = x(0), [D, Q] = x({}), [W, P] = x(null), [R, G] = x(!1), K = (d, I) => q((M) => ({ ...M, [d]: I })), le = (d, I) => T((M) => ({ ...M, [d]: I })), be = (d) => !d.conditionalOn || H[d.conditionalOn] === "true", O = ke(() => {
4872
+ }), [K, T] = x({}), [f, I] = x(0), [F, Q] = x({}), [W, P] = x(null), [E, G] = x(!1), j = (d, D) => q((L) => ({ ...L, [d]: D })), ae = (d, D) => T((L) => ({ ...L, [d]: D })), be = (d) => !d.conditionalOn || K[d.conditionalOn] === "true", $ = we(() => {
4873
4873
  if (!m) return -1;
4874
4874
  for (let d = f + 1; d < m.length; d++)
4875
4875
  if (be(m[d])) return d;
4876
4876
  return -1;
4877
- }, [m, f, H]), L = ke(() => {
4877
+ }, [m, f, K]), M = we(() => {
4878
4878
  if (!m) return -1;
4879
4879
  for (let d = f - 1; d >= 0; d--)
4880
4880
  if (be(m[d])) return d;
4881
4881
  return -1;
4882
- }, [m, f, H]), ee = (d) => {
4883
- var M;
4884
- const I = {};
4885
- for (const C of d.fields)
4886
- if (C.isCustom) {
4887
- if (C.required && C.paramName) {
4888
- const E = H[C.paramName], z = C.displayText || C.label || C.paramName;
4889
- C.customType === "checkbox" || C.customType === "link_checkbox" ? E !== "true" && (I[C.paramName] = `${z} is required.`) : (!E || E.trim() === "") && (I[C.paramName] = `${z} is required.`);
4882
+ }, [m, f, K]), te = (d) => {
4883
+ var L;
4884
+ const D = {};
4885
+ for (const v of d.fields)
4886
+ if (v.isCustom) {
4887
+ if (v.required && v.paramName) {
4888
+ const C = K[v.paramName], O = v.displayText || v.label || v.paramName;
4889
+ v.customType === "checkbox" || v.customType === "link_checkbox" ? C !== "true" && (D[v.paramName] = `${O} is required.`) : (!C || C.trim() === "") && (D[v.paramName] = `${O} is required.`);
4890
4890
  }
4891
- } else if (C.name) {
4892
- const E = C.name;
4893
- if (F.includes(E) && Be(v[E])) {
4894
- const z = C.displayText || ((M = Ke[E]) == null ? void 0 : M.label) || E;
4895
- I[E] = `${z} is required.`;
4891
+ } else if (v.name) {
4892
+ const C = v.name;
4893
+ if (R.includes(C) && ze(k[C])) {
4894
+ const O = v.displayText || ((L = Ke[C]) == null ? void 0 : L.label) || C;
4895
+ D[C] = `${O} is required.`;
4896
4896
  }
4897
4897
  }
4898
- return I;
4898
+ return D;
4899
4899
  }, Z = async () => {
4900
4900
  if (!m) return;
4901
- const d = ee(m[f]);
4901
+ const d = te(m[f]);
4902
4902
  if (Object.keys(d).length > 0) {
4903
4903
  Q(d);
4904
4904
  return;
4905
4905
  }
4906
- Q({}), O >= 0 ? A(O) : await ae();
4907
- }, ae = async () => {
4906
+ Q({}), $ >= 0 ? I($) : await ne();
4907
+ }, ne = async () => {
4908
4908
  if (m) {
4909
4909
  let d = {};
4910
- for (const I of m)
4911
- be(I) && (d = { ...d, ...ee(I) });
4910
+ for (const D of m)
4911
+ be(D) && (d = { ...d, ...te(D) });
4912
4912
  if (Object.keys(d).length > 0) {
4913
4913
  Q(d);
4914
4914
  return;
@@ -4916,74 +4916,74 @@ const ze = {
4916
4916
  }
4917
4917
  G(!0), P(null);
4918
4918
  try {
4919
- if (!v.externalRefId || v.externalRefId.trim() === "") {
4919
+ if (!k.externalRefId || k.externalRefId.trim() === "") {
4920
4920
  P("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
4921
4921
  return;
4922
4922
  }
4923
4923
  const d = {
4924
- workflowKey: v.workflowKey,
4925
- externalRefId: v.externalRefId.trim()
4924
+ workflowKey: k.workflowKey,
4925
+ externalRefId: k.externalRefId.trim()
4926
4926
  };
4927
4927
  if (m) {
4928
- for (const C of m)
4929
- if (be(C)) {
4930
- for (const E of C.fields)
4931
- if (!E.isCustom && E.name) {
4932
- const z = E.name, te = v[z];
4933
- Be(te) || (d[z] = te);
4928
+ for (const v of m)
4929
+ if (be(v)) {
4930
+ for (const C of v.fields)
4931
+ if (!C.isCustom && C.name) {
4932
+ const O = C.name, J = k[O];
4933
+ ze(J) || (d[O] = J);
4934
4934
  }
4935
4935
  }
4936
4936
  } else
4937
- S.forEach((C) => {
4938
- if (C === "externalRefId") return;
4939
- const E = v[C];
4940
- Be(E) || (d[C] = E);
4937
+ A.forEach((v) => {
4938
+ if (v === "externalRefId") return;
4939
+ const C = k[v];
4940
+ ze(C) || (d[v] = C);
4941
4941
  });
4942
- const I = [];
4942
+ const D = [];
4943
4943
  if (m) {
4944
- for (const C of m)
4945
- if (be(C)) {
4946
- for (const E of C.fields)
4947
- if (E.isCustom && E.paramName) {
4948
- const z = H[E.paramName] ?? "";
4949
- I.push({ paramName: E.paramName, paramValue: z });
4944
+ for (const v of m)
4945
+ if (be(v)) {
4946
+ for (const C of v.fields)
4947
+ if (C.isCustom && C.paramName) {
4948
+ const O = K[C.paramName] ?? "";
4949
+ D.push({ paramName: C.paramName, paramValue: O });
4950
4950
  }
4951
4951
  }
4952
4952
  }
4953
- I.length > 0 && (d.applicantAdditionalDatas = I);
4954
- const M = await c(d);
4955
- r(M.applicantId);
4953
+ D.length > 0 && (d.applicantAdditionalDatas = D);
4954
+ const L = await c(d);
4955
+ r(L.applicantId);
4956
4956
  } catch (d) {
4957
4957
  console.error("Error creating applicant:", d), P(d.message || "Failed to create applicant");
4958
4958
  } finally {
4959
4959
  G(!1);
4960
4960
  }
4961
- }, j = async (d) => {
4962
- var I;
4961
+ }, H = async (d) => {
4962
+ var D;
4963
4963
  d.preventDefault();
4964
- for (const M of F)
4965
- if (Be(v[M])) {
4966
- const C = ((I = Ke[M]) == null ? void 0 : I.label) || M;
4967
- P(`${C} is required.`);
4964
+ for (const L of R)
4965
+ if (ze(k[L])) {
4966
+ const v = ((D = Ke[L]) == null ? void 0 : D.label) || L;
4967
+ P(`${v} is required.`);
4968
4968
  return;
4969
4969
  }
4970
- await ae();
4971
- }, Fe = (d, I, M) => {
4970
+ await ne();
4971
+ }, Fe = (d, D, L) => {
4972
4972
  var Me;
4973
- const C = Ke[d];
4974
- if (!C) return null;
4975
- const E = F.includes(d), z = D[d], te = M || C.label, ce = I ?? d, re = { required: E };
4976
- switch (C.type) {
4973
+ const v = Ke[d];
4974
+ if (!v) return null;
4975
+ const C = R.includes(d), O = F[d], J = L || v.label, ce = D ?? d, re = { required: C };
4976
+ switch (v.type) {
4977
4977
  case "select":
4978
4978
  if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth")
4979
4979
  return /* @__PURE__ */ a(
4980
4980
  Ae,
4981
4981
  {
4982
4982
  ...re,
4983
- label: te,
4984
- value: v[d] || "",
4985
- onChange: (ne) => K(d, ne.target.value),
4986
- options: [{ value: "", label: `Select ${te.toLowerCase()}...` }, ...N],
4983
+ label: J,
4984
+ value: k[d] || "",
4985
+ onChange: (se) => j(d, se.target.value),
4986
+ options: [{ value: "", label: `Select ${J.toLowerCase()}...` }, ...S],
4987
4987
  disabled: h
4988
4988
  },
4989
4989
  ce
@@ -4993,9 +4993,9 @@ const ze = {
4993
4993
  Ae,
4994
4994
  {
4995
4995
  ...re,
4996
- label: te,
4997
- value: ((Me = v[d]) == null ? void 0 : Me.toString()) || "",
4998
- onChange: (ne) => K(d, ne.target.value ? Number(ne.target.value) : null),
4996
+ label: J,
4997
+ value: ((Me = k[d]) == null ? void 0 : Me.toString()) || "",
4998
+ onChange: (se) => j(d, se.target.value ? Number(se.target.value) : null),
4999
4999
  options: [
5000
5000
  { value: "", label: "Select salutation..." },
5001
5001
  { value: Ue.Male.toString(), label: "Male" },
@@ -5006,15 +5006,15 @@ const ze = {
5006
5006
  ce
5007
5007
  );
5008
5008
  if (d === "defaultLanguage") {
5009
- const ne = o != null && o.allowedLanguages && o.allowedLanguages.length > 0 ? Je.filter((qe) => o.allowedLanguages.includes(qe.value)) : Je;
5009
+ const se = o != null && o.allowedLanguages && o.allowedLanguages.length > 0 ? Je.filter((qe) => o.allowedLanguages.includes(qe.value)) : Je;
5010
5010
  return /* @__PURE__ */ a(
5011
5011
  Ae,
5012
5012
  {
5013
5013
  ...re,
5014
- label: te,
5015
- value: v[d] || "",
5016
- onChange: (qe) => K(d, qe.target.value),
5017
- options: [{ value: "", label: "Select language..." }, ...ne]
5014
+ label: J,
5015
+ value: k[d] || "",
5016
+ onChange: (qe) => j(d, qe.target.value),
5017
+ options: [{ value: "", label: "Select language..." }, ...se]
5018
5018
  },
5019
5019
  ce
5020
5020
  );
@@ -5025,10 +5025,10 @@ const ze = {
5025
5025
  mr,
5026
5026
  {
5027
5027
  ...re,
5028
- label: te,
5029
- value: v[d] || [],
5030
- onChange: (ne) => K(d, ne),
5031
- options: N,
5028
+ label: J,
5029
+ value: k[d] || [],
5030
+ onChange: (se) => j(d, se),
5031
+ options: S,
5032
5032
  placeholder: "Select other nationalities...",
5033
5033
  disabled: h
5034
5034
  },
@@ -5040,10 +5040,10 @@ const ze = {
5040
5040
  {
5041
5041
  ...re,
5042
5042
  type: "date",
5043
- label: te,
5044
- value: v[d] || "",
5045
- onChange: (ne) => K(d, ne.target.value),
5046
- error: z
5043
+ label: J,
5044
+ value: k[d] || "",
5045
+ onChange: (se) => j(d, se.target.value),
5046
+ error: O
5047
5047
  },
5048
5048
  ce
5049
5049
  );
@@ -5053,10 +5053,10 @@ const ze = {
5053
5053
  {
5054
5054
  ...re,
5055
5055
  type: "email",
5056
- label: te,
5057
- value: v[d] || "",
5058
- onChange: (ne) => K(d, ne.target.value),
5059
- error: z
5056
+ label: J,
5057
+ value: k[d] || "",
5058
+ onChange: (se) => j(d, se.target.value),
5059
+ error: O
5060
5060
  },
5061
5061
  ce
5062
5062
  );
@@ -5066,10 +5066,10 @@ const ze = {
5066
5066
  {
5067
5067
  ...re,
5068
5068
  type: "tel",
5069
- label: te,
5070
- value: v[d] || "",
5071
- onChange: (ne) => K(d, ne.target.value),
5072
- error: z
5069
+ label: J,
5070
+ value: k[d] || "",
5071
+ onChange: (se) => j(d, se.target.value),
5072
+ error: O
5073
5073
  },
5074
5074
  ce
5075
5075
  );
@@ -5079,17 +5079,17 @@ const ze = {
5079
5079
  {
5080
5080
  ...re,
5081
5081
  type: "text",
5082
- label: te,
5083
- value: v[d] || "",
5084
- onChange: (ne) => K(d, ne.target.value),
5085
- error: z
5082
+ label: J,
5083
+ value: k[d] || "",
5084
+ onChange: (se) => j(d, se.target.value),
5085
+ error: O
5086
5086
  },
5087
5087
  ce
5088
5088
  );
5089
5089
  }
5090
- }, ve = (d, I) => {
5090
+ }, ve = (d, D) => {
5091
5091
  if (!d.paramName) return null;
5092
- const M = D[d.paramName], C = d.displayText || d.label || d.paramName;
5092
+ const L = F[d.paramName], v = d.displayText || d.label || d.paramName;
5093
5093
  if (d.customType === "checkbox")
5094
5094
  return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
5095
5095
  /* @__PURE__ */ i(
@@ -5102,10 +5102,10 @@ const ze = {
5102
5102
  "input",
5103
5103
  {
5104
5104
  type: "checkbox",
5105
- checked: H[d.paramName] === "true",
5106
- onChange: (E) => le(d.paramName, E.target.checked ? "true" : "false"),
5105
+ checked: K[d.paramName] === "true",
5106
+ onChange: (C) => ae(d.paramName, C.target.checked ? "true" : "false"),
5107
5107
  className: "metakyc-option-input",
5108
- style: ze
5108
+ style: $e
5109
5109
  }
5110
5110
  ),
5111
5111
  /* @__PURE__ */ i(
@@ -5114,7 +5114,7 @@ const ze = {
5114
5114
  className: "metakyc-option-text",
5115
5115
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5116
5116
  children: [
5117
- C,
5117
+ v,
5118
5118
  d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
5119
5119
  ]
5120
5120
  }
@@ -5122,8 +5122,8 @@ const ze = {
5122
5122
  ]
5123
5123
  }
5124
5124
  ),
5125
- M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
5126
- ] }, `custom-${I}`);
5125
+ L && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: L })
5126
+ ] }, `custom-${D}`);
5127
5127
  if (d.customType === "link_checkbox")
5128
5128
  return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
5129
5129
  /* @__PURE__ */ i(
@@ -5136,10 +5136,10 @@ const ze = {
5136
5136
  "input",
5137
5137
  {
5138
5138
  type: "checkbox",
5139
- checked: H[d.paramName] === "true",
5140
- onChange: (E) => le(d.paramName, E.target.checked ? "true" : "false"),
5139
+ checked: K[d.paramName] === "true",
5140
+ onChange: (C) => ae(d.paramName, C.target.checked ? "true" : "false"),
5141
5141
  className: "metakyc-option-input",
5142
- style: { ...ze, alignSelf: "flex-start", marginTop: "2px" }
5142
+ style: { ...$e, alignSelf: "flex-start", marginTop: "2px" }
5143
5143
  }
5144
5144
  ),
5145
5145
  /* @__PURE__ */ i(
@@ -5148,7 +5148,7 @@ const ze = {
5148
5148
  className: "metakyc-option-text",
5149
5149
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5150
5150
  children: [
5151
- C,
5151
+ v,
5152
5152
  " ",
5153
5153
  d.linkUrl && /* @__PURE__ */ a(
5154
5154
  "a",
@@ -5158,7 +5158,7 @@ const ze = {
5158
5158
  rel: "noopener noreferrer",
5159
5159
  className: "underline",
5160
5160
  style: { color: "var(--metakyc-primary, #2563eb)" },
5161
- onClick: (E) => E.stopPropagation(),
5161
+ onClick: (C) => C.stopPropagation(),
5162
5162
  children: d.linkText || d.linkUrl
5163
5163
  }
5164
5164
  ),
@@ -5169,10 +5169,10 @@ const ze = {
5169
5169
  ]
5170
5170
  }
5171
5171
  ),
5172
- M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
5173
- ] }, `custom-${I}`);
5172
+ L && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: L })
5173
+ ] }, `custom-${D}`);
5174
5174
  if (d.customType === "group_checkbox") {
5175
- const E = (H[d.paramName] || "").split(",").filter(Boolean);
5175
+ const C = (K[d.paramName] || "").split(",").filter(Boolean);
5176
5176
  return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
5177
5177
  /* @__PURE__ */ i(
5178
5178
  "div",
@@ -5180,12 +5180,12 @@ const ze = {
5180
5180
  className: "text-sm font-medium",
5181
5181
  style: { color: "var(--metakyc-text-primary, #111827)" },
5182
5182
  children: [
5183
- C,
5183
+ v,
5184
5184
  d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
5185
5185
  ]
5186
5186
  }
5187
5187
  ),
5188
- /* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((z) => /* @__PURE__ */ i(
5188
+ /* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((O) => /* @__PURE__ */ i(
5189
5189
  "label",
5190
5190
  {
5191
5191
  className: "metakyc-option-label",
@@ -5195,13 +5195,13 @@ const ze = {
5195
5195
  "input",
5196
5196
  {
5197
5197
  type: "checkbox",
5198
- checked: E.includes(z.value),
5199
- onChange: (te) => {
5200
- const ce = te.target.checked ? [...E, z.value] : E.filter((re) => re !== z.value);
5201
- le(d.paramName, ce.join(","));
5198
+ checked: C.includes(O.value),
5199
+ onChange: (J) => {
5200
+ const ce = J.target.checked ? [...C, O.value] : C.filter((re) => re !== O.value);
5201
+ ae(d.paramName, ce.join(","));
5202
5202
  },
5203
5203
  className: "metakyc-option-input",
5204
- style: ze
5204
+ style: $e
5205
5205
  }
5206
5206
  ),
5207
5207
  /* @__PURE__ */ a(
@@ -5209,15 +5209,15 @@ const ze = {
5209
5209
  {
5210
5210
  className: "metakyc-option-text",
5211
5211
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5212
- children: z.label
5212
+ children: O.label
5213
5213
  }
5214
5214
  )
5215
5215
  ]
5216
5216
  },
5217
- z.value
5217
+ O.value
5218
5218
  )) }),
5219
- M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
5220
- ] }, `custom-${I}`);
5219
+ L && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: L })
5220
+ ] }, `custom-${D}`);
5221
5221
  }
5222
5222
  return d.customType === "radio_group" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
5223
5223
  /* @__PURE__ */ i(
@@ -5226,12 +5226,12 @@ const ze = {
5226
5226
  className: "text-sm font-medium",
5227
5227
  style: { color: "var(--metakyc-text-primary, #111827)" },
5228
5228
  children: [
5229
- C,
5229
+ v,
5230
5230
  d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
5231
5231
  ]
5232
5232
  }
5233
5233
  ),
5234
- /* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((E) => /* @__PURE__ */ i(
5234
+ /* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((C) => /* @__PURE__ */ i(
5235
5235
  "label",
5236
5236
  {
5237
5237
  className: "metakyc-option-label",
@@ -5241,11 +5241,11 @@ const ze = {
5241
5241
  "input",
5242
5242
  {
5243
5243
  type: "radio",
5244
- checked: H[d.paramName] === E.value,
5245
- onChange: () => le(d.paramName, E.value),
5246
- name: `radio-group-${d.paramName}-${I}`,
5244
+ checked: K[d.paramName] === C.value,
5245
+ onChange: () => ae(d.paramName, C.value),
5246
+ name: `radio-group-${d.paramName}-${D}`,
5247
5247
  className: "metakyc-option-input",
5248
- style: ze
5248
+ style: $e
5249
5249
  }
5250
5250
  ),
5251
5251
  /* @__PURE__ */ a(
@@ -5253,40 +5253,82 @@ const ze = {
5253
5253
  {
5254
5254
  className: "metakyc-option-text",
5255
5255
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5256
- children: E.label
5256
+ children: C.label
5257
5257
  }
5258
5258
  )
5259
5259
  ]
5260
5260
  },
5261
- E.value
5261
+ C.value
5262
5262
  )) }),
5263
- M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
5264
- ] }, `custom-${I}`) : /* @__PURE__ */ a(
5263
+ L && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: L })
5264
+ ] }, `custom-${D}`) : /* @__PURE__ */ a(
5265
5265
  ue,
5266
5266
  {
5267
5267
  type: "text",
5268
- label: `${C}${d.required ? " *" : ""}`,
5269
- value: H[d.paramName] || "",
5270
- onChange: (E) => le(d.paramName, E.target.value),
5268
+ label: `${v}${d.required ? " *" : ""}`,
5269
+ value: K[d.paramName] || "",
5270
+ onChange: (C) => ae(d.paramName, C.target.value),
5271
5271
  required: d.required,
5272
- error: M
5272
+ error: L
5273
5273
  },
5274
- `custom-${I}`
5274
+ `custom-${D}`
5275
5275
  );
5276
- }, Le = (d) => /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-4", children: d.fields.map((I, M) => {
5277
- const C = I.colSpan === 1 ? "col-span-1" : "col-span-2", E = I.isCustom ? `custom-${M}-${I.paramName}` : `builtin-${I.name}-${M}`;
5278
- return /* @__PURE__ */ a("div", { className: C, children: I.isCustom ? ve(I, M) : Fe(I.name, E, I.displayText) }, E);
5279
- }) });
5276
+ }, Le = (d, D) => {
5277
+ const L = [];
5278
+ if (m) {
5279
+ const v = new Set(
5280
+ m.slice(0, D + 1).flatMap((C) => C.fields).filter((C) => C.isCustom && C.paramName).map((C) => C.paramName)
5281
+ );
5282
+ for (let C = D + 1; C < m.length; C++) {
5283
+ const O = m[C].conditionalOn;
5284
+ O && !v.has(O) && !L.includes(O) && L.push(O);
5285
+ }
5286
+ }
5287
+ return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
5288
+ /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-4", children: d.fields.map((v, C) => {
5289
+ const O = v.colSpan === 1 ? "col-span-1" : "col-span-2", J = v.isCustom ? `custom-${C}-${v.paramName}` : `builtin-${v.name}-${C}`;
5290
+ return /* @__PURE__ */ a("div", { className: O, children: v.isCustom ? ve(v, C) : Fe(v.name, J, v.displayText) }, J);
5291
+ }) }),
5292
+ L.length > 0 && /* @__PURE__ */ a("div", { className: "space-y-3 pt-2", children: L.map((v) => /* @__PURE__ */ i(
5293
+ "label",
5294
+ {
5295
+ className: "metakyc-option-label",
5296
+ style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
5297
+ children: [
5298
+ /* @__PURE__ */ a(
5299
+ "input",
5300
+ {
5301
+ type: "checkbox",
5302
+ checked: K[v] === "true",
5303
+ onChange: (C) => ae(v, C.target.checked ? "true" : "false"),
5304
+ className: "metakyc-option-input",
5305
+ style: $e
5306
+ }
5307
+ ),
5308
+ /* @__PURE__ */ a(
5309
+ "span",
5310
+ {
5311
+ className: "metakyc-option-text",
5312
+ style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5313
+ children: v
5314
+ }
5315
+ )
5316
+ ]
5317
+ },
5318
+ v
5319
+ )) })
5320
+ ] });
5321
+ };
5280
5322
  if (h)
5281
- return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
5323
+ return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { children: [
5282
5324
  /* @__PURE__ */ a(xe, { className: "my-8" }),
5283
5325
  /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
5284
5326
  ] }) }) });
5285
5327
  if (m) {
5286
- const d = m[f] ?? m[0], I = L === -1, M = O === -1, C = m.length, E = m.filter(be).length, z = m.slice(0, f + 1).filter(be).length, te = Object.values(D);
5287
- return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i($, { children: [
5328
+ const d = m[f] ?? m[0], D = M === -1, L = $ === -1, v = m.length, C = m.filter(be).length, O = m.slice(0, f + 1).filter(be).length, J = Object.values(F);
5329
+ return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(B, { children: [
5288
5330
  /* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(Ye, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
5289
- /* @__PURE__ */ i(B, { children: [
5331
+ /* @__PURE__ */ i(z, { children: [
5290
5332
  (d.title || d.subtitle || d.description) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
5291
5333
  d.title && /* @__PURE__ */ a(
5292
5334
  "h3",
@@ -5313,15 +5355,15 @@ const ze = {
5313
5355
  }
5314
5356
  )
5315
5357
  ] }),
5316
- (W || te.length > 0) && /* @__PURE__ */ i("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
5358
+ (W || J.length > 0) && /* @__PURE__ */ i("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
5317
5359
  W && /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
5318
5360
  /* @__PURE__ */ a("strong", { children: "Error:" }),
5319
5361
  " ",
5320
5362
  W
5321
5363
  ] }),
5322
- te.map((ce, re) => /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: ce }, re))
5364
+ J.map((ce, re) => /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: ce }, re))
5323
5365
  ] }),
5324
- C > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
5366
+ v > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
5325
5367
  m.map((ce, re) => {
5326
5368
  const Me = be(ce);
5327
5369
  return /* @__PURE__ */ a(
@@ -5334,54 +5376,54 @@ const ze = {
5334
5376
  );
5335
5377
  }),
5336
5378
  /* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
5337
- z,
5379
+ O,
5338
5380
  " / ",
5339
- E
5381
+ C
5340
5382
  ] })
5341
5383
  ] }),
5342
- Le(d)
5384
+ Le(d, f)
5343
5385
  ] }),
5344
5386
  /* @__PURE__ */ i(me, { className: "flex justify-between", children: [
5345
5387
  /* @__PURE__ */ i("div", { children: [
5346
- !I && /* @__PURE__ */ a(
5388
+ !D && /* @__PURE__ */ a(
5347
5389
  U,
5348
5390
  {
5349
5391
  type: "button",
5350
5392
  variant: "outline",
5351
5393
  onClick: () => {
5352
- A(L), Q({});
5394
+ I(M), Q({});
5353
5395
  },
5354
- disabled: R || u,
5396
+ disabled: E || u,
5355
5397
  children: "Previous"
5356
5398
  }
5357
5399
  ),
5358
- I && n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: R || u, children: "Cancel" })
5400
+ D && n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: E || u, children: "Cancel" })
5359
5401
  ] }),
5360
5402
  /* @__PURE__ */ a(
5361
5403
  U,
5362
5404
  {
5363
5405
  type: "button",
5364
- isLoading: R || u,
5365
- onClick: M ? ae : Z,
5366
- children: M ? "Submit" : "Next"
5406
+ isLoading: E || u,
5407
+ onClick: L ? ne : Z,
5408
+ children: L ? "Submit" : "Next"
5367
5409
  }
5368
5410
  )
5369
5411
  ] })
5370
5412
  ] }) });
5371
5413
  }
5372
- return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit: j, children: /* @__PURE__ */ i($, { children: [
5414
+ return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit: H, children: /* @__PURE__ */ i(B, { children: [
5373
5415
  /* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(Ye, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
5374
- /* @__PURE__ */ i(B, { children: [
5416
+ /* @__PURE__ */ i(z, { children: [
5375
5417
  W && /* @__PURE__ */ a("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
5376
5418
  /* @__PURE__ */ a("strong", { children: "Error:" }),
5377
5419
  " ",
5378
5420
  W
5379
5421
  ] }) }),
5380
- /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: S.map((d) => Fe(d)) })
5422
+ /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: A.map((d) => Fe(d)) })
5381
5423
  ] }),
5382
5424
  /* @__PURE__ */ i(me, { className: "flex justify-between", children: [
5383
- n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: R || u, children: "Cancel" }),
5384
- /* @__PURE__ */ a(U, { type: "submit", isLoading: R || u, children: "Create Applicant" })
5425
+ n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: E || u, children: "Cancel" }),
5426
+ /* @__PURE__ */ a(U, { type: "submit", isLoading: E || u, children: "Create Applicant" })
5385
5427
  ] })
5386
5428
  ] }) }) });
5387
5429
  }, ta = ({
@@ -5398,11 +5440,11 @@ const ze = {
5398
5440
  workflowKey: u,
5399
5441
  nextWorkflowKey: p,
5400
5442
  hasWorkflowChanged: w,
5401
- isLoading: N,
5443
+ isLoading: S,
5402
5444
  error: y,
5403
5445
  moveBack: h,
5404
5446
  refreshProgress: g
5405
- } = sr(e), [k, b] = ge.useState(!1);
5447
+ } = sr(e), [N, b] = ge.useState(!1);
5406
5448
  if (ge.useEffect(() => {
5407
5449
  y && r && r(y);
5408
5450
  }, [y, r]), ge.useEffect(() => {
@@ -5411,18 +5453,18 @@ const ze = {
5411
5453
  n === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
5412
5454
  }, [n]), ge.useEffect(() => {
5413
5455
  w && b(!1);
5414
- }, [w]), N || !l)
5415
- return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
5456
+ }, [w]), S || !l)
5457
+ return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { children: [
5416
5458
  /* @__PURE__ */ a(xe, { className: "my-8" }),
5417
5459
  /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
5418
5460
  ] }) }) });
5419
5461
  if (y)
5420
- return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
5462
+ return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
5421
5463
  /* @__PURE__ */ a("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
5422
5464
  /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: y.message })
5423
5465
  ] }) }) }) });
5424
- if (w && !k)
5425
- return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
5466
+ if (w && !N)
5467
+ return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(z, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
5426
5468
  /* @__PURE__ */ a("div", { className: "mb-6", children: /* @__PURE__ */ a("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__ */ a("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a("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" }) }) }) }),
5427
5469
  /* @__PURE__ */ a("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
5428
5470
  /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
@@ -5464,12 +5506,12 @@ const ze = {
5464
5506
  }
5465
5507
  ) });
5466
5508
  if (!o)
5467
- return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
5509
+ return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { children: [
5468
5510
  /* @__PURE__ */ a(xe, { className: "my-8" }),
5469
5511
  /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status === fe.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
5470
5512
  ] }) }) });
5471
- const m = (v) => {
5472
- switch (v) {
5513
+ const m = (k) => {
5514
+ switch (k) {
5473
5515
  case _.Overview:
5474
5516
  return "Overview";
5475
5517
  case _.Questionaries:
@@ -5491,20 +5533,20 @@ const ze = {
5491
5533
  default:
5492
5534
  return "";
5493
5535
  }
5494
- }, F = () => {
5495
- const v = c.filter((f) => f.visibility !== !1), q = v.findIndex((f) => f.order === o.order), H = q >= 0 ? q + 1 : 1, T = v.length;
5536
+ }, R = () => {
5537
+ const k = c.filter((f) => f.visibility !== !1), q = k.findIndex((f) => f.order === o.order), K = q >= 0 ? q + 1 : 1, T = k.length;
5496
5538
  return /* @__PURE__ */ i("div", { className: "mb-6", children: [
5497
5539
  /* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
5498
5540
  /* @__PURE__ */ a(Ye, {}),
5499
5541
  /* @__PURE__ */ i(Se, { variant: l.status === 1 ? "info" : "success", children: [
5500
5542
  "Step ",
5501
- H,
5543
+ K,
5502
5544
  " of ",
5503
5545
  T
5504
5546
  ] })
5505
5547
  ] }),
5506
- /* @__PURE__ */ a("div", { className: "flex items-center", children: v.map((f, A) => {
5507
- const D = A < q, Q = f.order === o.order;
5548
+ /* @__PURE__ */ a("div", { className: "flex items-center", children: k.map((f, I) => {
5549
+ const F = I < q, Q = f.order === o.order;
5508
5550
  return /* @__PURE__ */ i(ge.Fragment, { children: [
5509
5551
  /* @__PURE__ */ i("div", { className: "flex items-center", children: [
5510
5552
  /* @__PURE__ */ a(
@@ -5512,30 +5554,30 @@ const ze = {
5512
5554
  {
5513
5555
  className: `
5514
5556
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
5515
- ${D || Q ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
5557
+ ${F || Q ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
5516
5558
  `,
5517
- children: A + 1
5559
+ children: I + 1
5518
5560
  }
5519
5561
  ),
5520
5562
  /* @__PURE__ */ a(
5521
5563
  "span",
5522
5564
  {
5523
5565
  className: `ml-2 text-sm ${Q ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
5524
- children: f.displayName || f.name || m(f.action) || `Step ${A + 1}`
5566
+ children: f.displayName || f.name || m(f.action) || `Step ${I + 1}`
5525
5567
  }
5526
5568
  )
5527
5569
  ] }),
5528
- A < v.length - 1 && /* @__PURE__ */ a(
5570
+ I < k.length - 1 && /* @__PURE__ */ a(
5529
5571
  "div",
5530
5572
  {
5531
- className: `flex-1 h-0.5 mx-4 ${D ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
5573
+ className: `flex-1 h-0.5 mx-4 ${F ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
5532
5574
  }
5533
5575
  )
5534
5576
  ] }, f.order);
5535
5577
  }) })
5536
5578
  ] });
5537
- }, S = () => {
5538
- const v = {
5579
+ }, A = () => {
5580
+ const k = {
5539
5581
  applicantId: e,
5540
5582
  onComplete: async () => {
5541
5583
  await g();
@@ -5544,20 +5586,20 @@ const ze = {
5544
5586
  };
5545
5587
  switch (o.action) {
5546
5588
  case _.Questionaries:
5547
- return /* @__PURE__ */ a(Sr, { ...v });
5589
+ return /* @__PURE__ */ a(Sr, { ...k });
5548
5590
  case _.UploadDocument:
5549
- return /* @__PURE__ */ a(Ar, { ...v });
5591
+ return /* @__PURE__ */ a(Ar, { ...k });
5550
5592
  case _.Overview:
5551
- return /* @__PURE__ */ a(Ir, { ...v });
5593
+ return /* @__PURE__ */ a(Ir, { ...k });
5552
5594
  case _.IdentitySdk:
5553
- return /* @__PURE__ */ a(Tr, { ...v });
5595
+ return /* @__PURE__ */ a(Tr, { ...k });
5554
5596
  case _.RiskScoring:
5555
- return /* @__PURE__ */ a(Dr, { ...v });
5597
+ return /* @__PURE__ */ a(Dr, { ...k });
5556
5598
  case _.AdditionalData:
5557
5599
  case _.InvestorCategorization:
5558
- return /* @__PURE__ */ a(Lr, { ...v });
5600
+ return /* @__PURE__ */ a(Lr, { ...k });
5559
5601
  case _.AppropriatenessTest:
5560
- return /* @__PURE__ */ a(Mr, { ...v });
5602
+ return /* @__PURE__ */ a(Mr, { ...k });
5561
5603
  case _.ManualReview:
5562
5604
  return /* @__PURE__ */ a(
5563
5605
  et,
@@ -5569,7 +5611,7 @@ const ze = {
5569
5611
  }
5570
5612
  );
5571
5613
  default:
5572
- return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
5614
+ return /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i(z, { className: "py-12 text-center", children: [
5573
5615
  /* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(xe, {}) }),
5574
5616
  /* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
5575
5617
  "Processing step: ",
@@ -5583,8 +5625,8 @@ const ze = {
5583
5625
  }
5584
5626
  };
5585
5627
  return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
5586
- F(),
5587
- S()
5628
+ R(),
5629
+ A()
5588
5630
  ] });
5589
5631
  };
5590
5632
  function ra(e) {
@@ -5641,14 +5683,14 @@ export {
5641
5683
  fe as ApplicantProgressStatus,
5642
5684
  Rt as ApplicantService,
5643
5685
  yt as ApplicantStatus,
5644
- wt as AppropriatenessQuestionType,
5686
+ kt as AppropriatenessQuestionType,
5645
5687
  Pt as AppropriatenessTestService,
5646
5688
  Mr as AppropriatenessTestStep,
5647
5689
  Se as Badge,
5648
5690
  Ot as BaseInformationService,
5649
5691
  U as Button,
5650
- $ as Card,
5651
- B as CardContent,
5692
+ B as Card,
5693
+ z as CardContent,
5652
5694
  me as CardFooter,
5653
5695
  oe as CardHeader,
5654
5696
  ea as CreateApplicantForm,
@@ -5679,7 +5721,7 @@ export {
5679
5721
  ta as KycWorkflow,
5680
5722
  Or as Logo,
5681
5723
  rt as MetaKYCContext,
5682
- we as MetaKYCError,
5724
+ ke as MetaKYCError,
5683
5725
  Yr as MetaKYCProvider,
5684
5726
  mr as MultiSelect,
5685
5727
  Gt as OnfidoProvider,
@@ -5689,7 +5731,7 @@ export {
5689
5731
  Ft as QuestionnaireService,
5690
5732
  Sr as QuestionnaireStep,
5691
5733
  Re as ReviewStatus,
5692
- kt as RiskCriteriaType,
5734
+ wt as RiskCriteriaType,
5693
5735
  gt as RiskLevel,
5694
5736
  Mt as RiskScoringService,
5695
5737
  Dr as RiskScoringStep,
@@ -5699,7 +5741,7 @@ export {
5699
5741
  Yt as StepRouter,
5700
5742
  Vt as SumsubProvider,
5701
5743
  Jt as ThemeManager,
5702
- se as ThemePreset,
5744
+ ie as ThemePreset,
5703
5745
  jt as ThemeService,
5704
5746
  Dt as UploadDocumentService,
5705
5747
  Ar as UploadDocumentStep,
@@ -5713,7 +5755,7 @@ export {
5713
5755
  Jr as clearAllStorage,
5714
5756
  rr as clearApplicantId,
5715
5757
  nr as clearWorkflowState,
5716
- ie as cn,
5758
+ le as cn,
5717
5759
  Bt as corporateTheme,
5718
5760
  At as defaultConfig,
5719
5761
  de as defaultTheme,