@vpdev2/metakyc-sdk 1.0.74 → 1.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,12 +3,12 @@ var kt = (e, t, n) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var re = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import wt from "axios";
5
5
  import * as ot from "react";
6
- import xe, { createContext as Nt, useState as k, useMemo as Ee, useEffect as ne, useContext as St, useRef as ee, useCallback as V, forwardRef as Ge, createElement as nt } from "react";
6
+ import be, { createContext as Nt, useState as k, useMemo as Ee, useEffect as ne, useContext as St, useRef as ee, useCallback as V, forwardRef as Ge, createElement as nt } from "react";
7
7
  import { jsx as r, jsxs as o, Fragment as Qe } from "react/jsx-runtime";
8
8
  import Ct, { createPortal as it } from "react-dom";
9
- import { useForm as At, Controller as Le } from "react-hook-form";
9
+ import { useForm as At, Controller as Te } from "react-hook-form";
10
10
  import { z as Ce } from "zod";
11
- var J = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(J || {}), Je = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(Je || {}), ke = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ke || {}), It = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(It || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}), Te = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(Te || {}), De = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(De || {}), Rt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Rt || {}), Pt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Pt || {}), ve = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ve || {}), Ft = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Ft || {}), Ze = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ze || {}), Lt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(Lt || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Tt || {}), Dt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Dt || {}), Se = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Se || {}), Mt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(Mt || {}), Ot = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Ot || {}), fe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(fe || {}), $t = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))($t || {});
11
+ var J = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(J || {}), Je = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(Je || {}), ke = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ke || {}), It = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(It || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}), Le = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(Le || {}), De = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(De || {}), Rt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Rt || {}), Pt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Pt || {}), ve = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ve || {}), Ft = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Ft || {}), Ze = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ze || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(Tt || {}), Lt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Lt || {}), Dt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Dt || {}), Se = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Se || {}), Mt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(Mt || {}), Ot = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Ot || {}), fe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(fe || {}), $t = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))($t || {});
12
12
  const $e = {
13
13
  Nationality: 10,
14
14
  Address: 20,
@@ -1696,13 +1696,17 @@ class ur {
1696
1696
  danger: t.danger,
1697
1697
  info: t.info,
1698
1698
  background: t.background,
1699
- // alias used by Input, Select, SearchableSelect, MultiSelect components
1700
- "input-bg": t.background,
1701
1699
  surface: t.surface,
1702
1700
  border: t.border,
1703
1701
  "text-primary": t.textPrimary,
1704
1702
  "text-secondary": t.textSecondary,
1705
- "text-muted": t.textMuted
1703
+ "text-muted": t.textMuted,
1704
+ // Input-specific — fall back to general colors when not explicitly set
1705
+ "input-bg": t.inputBg ?? t.background,
1706
+ "input-text": t.inputText ?? t.textPrimary,
1707
+ "input-border": t.inputBorder ?? t.border,
1708
+ "input-border-focus": t.inputBorderFocus ?? t.primary,
1709
+ "input-placeholder": t.inputPlaceholder ?? t.textMuted
1706
1710
  };
1707
1711
  Object.entries(n).forEach(([s, l]) => {
1708
1712
  this.container.style.setProperty(`--metakyc-${s}`, l);
@@ -1797,21 +1801,21 @@ class ur {
1797
1801
  }
1798
1802
  }
1799
1803
  const gt = Nt(null), un = ({ config: e, children: t }) => {
1800
- const [n, a] = k(null), s = xe.useRef(!1), l = xe.useRef(!1), c = Ee(() => {
1801
- const h = new Ht(e), m = new Ut(h), v = new jt(h), S = new Kt(h), f = new Wt(h), N = new Yt(h), x = new qt(h), D = new Qt(h), F = new Gt(h), R = new Vt(h), $ = new nr(h), E = new ur();
1804
+ const [n, a] = k(null), s = be.useRef(!1), l = be.useRef(!1), c = Ee(() => {
1805
+ const h = new Ht(e), m = new Ut(h), v = new jt(h), C = new Kt(h), f = new Wt(h), S = new Yt(h), b = new qt(h), D = new Qt(h), F = new Gt(h), P = new Vt(h), $ = new nr(h), R = new ur();
1802
1806
  return {
1803
1807
  httpClient: h,
1804
1808
  applicantService: m,
1805
1809
  questionnaireService: v,
1806
- uploadDocumentService: S,
1810
+ uploadDocumentService: C,
1807
1811
  appropriatenessTestService: f,
1808
- overviewService: N,
1809
- riskScoringService: x,
1812
+ overviewService: S,
1813
+ riskScoringService: b,
1810
1814
  identityService: D,
1811
1815
  baseInformationService: F,
1812
- investorCategorizationService: R,
1816
+ investorCategorizationService: P,
1813
1817
  themeService: $,
1814
- themeManager: E
1818
+ themeManager: R
1815
1819
  };
1816
1820
  }, [e]), u = Ee(() => ({
1817
1821
  config: e,
@@ -1940,22 +1944,22 @@ function fr() {
1940
1944
  function yn() {
1941
1945
  gr(), fr();
1942
1946
  }
1943
- function xr(e) {
1947
+ function br(e) {
1944
1948
  const { createOrchestrator: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(null), h = ee(null), m = e || hr();
1945
1949
  ne(() => {
1946
1950
  h.current || (h.current = t());
1947
1951
  }, [t]), ne(() => {
1948
- var E;
1952
+ var R;
1949
1953
  n && m && (pr(m), yr({
1950
1954
  applicantId: m,
1951
- currentStepOrder: (E = n.currentStep) == null ? void 0 : E.order,
1955
+ currentStepOrder: (R = n.currentStep) == null ? void 0 : R.order,
1952
1956
  status: n.status,
1953
1957
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
1954
1958
  workflowKey: n.workFlowKey,
1955
1959
  nextWorkflowKey: n.nextWorkflowKey
1956
1960
  }));
1957
1961
  }, [n, m]);
1958
- const v = ee(!1), S = ee(!1), f = V(async () => {
1962
+ const v = ee(!1), C = ee(!1), f = V(async () => {
1959
1963
  if (!(!m || !h.current)) {
1960
1964
  if (v.current) {
1961
1965
  console.log("[Workflow] Load already in progress, skipping...");
@@ -1963,19 +1967,19 @@ function xr(e) {
1963
1967
  }
1964
1968
  v.current = !0, l(!0), u(null);
1965
1969
  try {
1966
- const E = await h.current.initialize(m);
1967
- a(E), S.current = !0;
1968
- } catch (E) {
1969
- u(E);
1970
+ const R = await h.current.initialize(m);
1971
+ a(R), C.current = !0;
1972
+ } catch (R) {
1973
+ u(R);
1970
1974
  } finally {
1971
1975
  l(!1), v.current = !1;
1972
1976
  }
1973
1977
  }
1974
1978
  }, [m]);
1975
1979
  ne(() => {
1976
- m && !S.current && f();
1980
+ m && !C.current && f();
1977
1981
  }, [m, f]);
1978
- const N = V(async () => {
1982
+ const S = V(async () => {
1979
1983
  if (h.current) {
1980
1984
  if (v.current) {
1981
1985
  console.log("[Workflow] Refresh already in progress, skipping...");
@@ -1983,22 +1987,22 @@ function xr(e) {
1983
1987
  }
1984
1988
  v.current = !0, l(!0), u(null);
1985
1989
  try {
1986
- const E = await h.current.refreshProgress();
1987
- a(E);
1988
- } catch (E) {
1989
- u(E);
1990
+ const R = await h.current.refreshProgress();
1991
+ a(R);
1992
+ } catch (R) {
1993
+ u(R);
1990
1994
  } finally {
1991
1995
  l(!1), v.current = !1;
1992
1996
  }
1993
1997
  }
1994
- }, []), x = V(async () => {
1998
+ }, []), b = V(async () => {
1995
1999
  if (h.current) {
1996
2000
  l(!0), u(null);
1997
2001
  try {
1998
- const E = await h.current.moveToNextStep();
1999
- a(E);
2000
- } catch (E) {
2001
- u(E);
2002
+ const R = await h.current.moveToNextStep();
2003
+ a(R);
2004
+ } catch (R) {
2005
+ u(R);
2002
2006
  } finally {
2003
2007
  l(!1);
2004
2008
  }
@@ -2007,33 +2011,33 @@ function xr(e) {
2007
2011
  if (h.current) {
2008
2012
  l(!0), u(null);
2009
2013
  try {
2010
- const E = await h.current.moveToPreviousStep();
2011
- a(E);
2012
- } catch (E) {
2013
- u(E);
2014
+ const R = await h.current.moveToPreviousStep();
2015
+ a(R);
2016
+ } catch (R) {
2017
+ u(R);
2014
2018
  } finally {
2015
2019
  l(!1);
2016
2020
  }
2017
2021
  }
2018
- }, []), F = V(async (E) => {
2022
+ }, []), F = V(async (R) => {
2019
2023
  if (h.current) {
2020
2024
  l(!0), u(null);
2021
2025
  try {
2022
- await h.current.submitCurrentStep(E);
2023
- const L = await h.current.refreshProgress();
2024
- a(L);
2025
- } catch (L) {
2026
- throw u(L), L;
2026
+ await h.current.submitCurrentStep(R);
2027
+ const T = await h.current.refreshProgress();
2028
+ a(T);
2029
+ } catch (T) {
2030
+ throw u(T), T;
2027
2031
  } finally {
2028
2032
  l(!1);
2029
2033
  }
2030
2034
  }
2031
- }, []), R = ot.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((E, L) => E.order - L.order) : [], [n == null ? void 0 : n.stepInfoList]), $ = ot.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2035
+ }, []), P = ot.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((R, T) => R.order - T.order) : [], [n == null ? void 0 : n.stepInfoList]), $ = ot.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2032
2036
  return {
2033
2037
  progress: n,
2034
2038
  applicantId: m,
2035
2039
  currentStep: (n == null ? void 0 : n.currentStep) || null,
2036
- steps: R,
2040
+ steps: P,
2037
2041
  status: (n == null ? void 0 : n.status) || ke.None,
2038
2042
  workflowResult: (n == null ? void 0 : n.workflowResult) || null,
2039
2043
  workflowKey: n == null ? void 0 : n.workFlowKey,
@@ -2043,54 +2047,54 @@ function xr(e) {
2043
2047
  error: c,
2044
2048
  isComplete: (n == null ? void 0 : n.status) === ke.Finished,
2045
2049
  isOnHold: (n == null ? void 0 : n.status) === ke.OnHold,
2046
- refreshProgress: N,
2047
- moveToNext: x,
2050
+ refreshProgress: S,
2051
+ moveToNext: b,
2048
2052
  moveBack: D,
2049
2053
  submitCurrentStep: F,
2050
2054
  orchestrator: h.current
2051
2055
  };
2052
2056
  }
2053
- function br(e) {
2054
- const { questionnaireService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [S, f] = k(null), N = ee(!1), x = ee(null), D = V(async () => {
2055
- var R, $;
2057
+ function xr(e) {
2058
+ const { questionnaireService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [C, f] = k(null), S = ee(!1), b = ee(null), D = V(async () => {
2059
+ var P, $;
2056
2060
  if (e) {
2057
- if (N.current) {
2061
+ if (S.current) {
2058
2062
  console.log("[Questionnaire] Load already in progress, skipping...");
2059
2063
  return;
2060
2064
  }
2061
- N.current = !0, h(!0), f(null);
2065
+ S.current = !0, h(!0), f(null);
2062
2066
  try {
2063
- const [E, L] = await Promise.all([
2067
+ const [R, T] = await Promise.all([
2064
2068
  t.getQuestionnaire(e),
2065
2069
  n.getApplicantData(e).catch(() => null)
2066
2070
  ]);
2067
- if (s(E), (R = L == null ? void 0 : L.questionnaireResults) != null && R.length && E) {
2071
+ if (s(R), (P = T == null ? void 0 : T.questionnaireResults) != null && P.length && R) {
2068
2072
  const Y = /* @__PURE__ */ new Map();
2069
- for (const w of L.questionnaireResults)
2070
- w.question && (($ = w.answers) != null && $.length) && Y.set(w.question.trim().toLowerCase(), w.answers);
2071
- const X = {}, P = E.questionGroups.flatMap((w) => w.questions ?? []);
2072
- for (const w of P) {
2073
- const H = w.text.trim().toLowerCase();
2074
- Y.has(H) && (X[w.id] = Y.get(H));
2073
+ for (const N of T.questionnaireResults)
2074
+ N.question && (($ = N.answers) != null && $.length) && Y.set(N.question.trim().toLowerCase(), N.answers);
2075
+ const X = {}, E = R.questionGroups.flatMap((N) => N.questions ?? []);
2076
+ for (const N of E) {
2077
+ const H = N.text.trim().toLowerCase();
2078
+ Y.has(H) && (X[N.id] = Y.get(H));
2075
2079
  }
2076
2080
  c(X);
2077
2081
  }
2078
- x.current = e;
2079
- } catch (E) {
2080
- f(E);
2082
+ b.current = e;
2083
+ } catch (R) {
2084
+ f(R);
2081
2085
  } finally {
2082
- h(!1), N.current = !1;
2086
+ h(!1), S.current = !1;
2083
2087
  }
2084
2088
  }
2085
2089
  }, [e, t, n]);
2086
2090
  ne(() => {
2087
- e && x.current !== e && D();
2091
+ e && b.current !== e && D();
2088
2092
  }, [e]);
2089
2093
  const F = V(
2090
- async (R) => {
2094
+ async (P) => {
2091
2095
  v(!0), f(null);
2092
2096
  try {
2093
- return await t.fillQuestionnaire(R);
2097
+ return await t.fillQuestionnaire(P);
2094
2098
  } catch ($) {
2095
2099
  throw f($), $;
2096
2100
  } finally {
@@ -2104,39 +2108,39 @@ function br(e) {
2104
2108
  initialAnswers: l,
2105
2109
  isLoading: u,
2106
2110
  isSubmitting: m,
2107
- error: S,
2111
+ error: C,
2108
2112
  load: D,
2109
2113
  submit: F
2110
2114
  };
2111
2115
  }
2112
2116
  function vr(e) {
2113
- const { uploadDocumentService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [v, S] = k(null), f = ee(!1), N = ee(null), x = V(async () => {
2117
+ const { uploadDocumentService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [v, C] = k(null), f = ee(!1), S = ee(null), b = V(async () => {
2114
2118
  if (e) {
2115
2119
  if (f.current) {
2116
2120
  console.log("[UploadDocument] Load already in progress, skipping...");
2117
2121
  return;
2118
2122
  }
2119
- f.current = !0, l(!0), S(null);
2123
+ f.current = !0, l(!0), C(null);
2120
2124
  try {
2121
2125
  const F = await t.getUploadDocument(e);
2122
- a(F), N.current = e;
2126
+ a(F), S.current = e;
2123
2127
  } catch (F) {
2124
- S(F);
2128
+ C(F);
2125
2129
  } finally {
2126
2130
  l(!1), f.current = !1;
2127
2131
  }
2128
2132
  }
2129
2133
  }, [e, t]);
2130
2134
  ne(() => {
2131
- e && N.current !== e && x();
2135
+ e && S.current !== e && b();
2132
2136
  }, [e]);
2133
2137
  const D = V(
2134
2138
  async (F) => {
2135
- u(!0), m(0), S(null);
2139
+ u(!0), m(0), C(null);
2136
2140
  try {
2137
2141
  await t.fillUploadDocument(F), m(100);
2138
- } catch (R) {
2139
- throw S(R), R;
2142
+ } catch (P) {
2143
+ throw C(P), P;
2140
2144
  } finally {
2141
2145
  u(!1);
2142
2146
  }
@@ -2149,12 +2153,12 @@ function vr(e) {
2149
2153
  isSubmitting: c,
2150
2154
  uploadProgress: h,
2151
2155
  error: v,
2152
- load: x,
2156
+ load: b,
2153
2157
  submit: D
2154
2158
  };
2155
2159
  }
2156
2160
  function fn(e) {
2157
- const { appropriatenessTestService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [v, S] = k(null), f = ee(!1), N = ee(null), x = V(async () => {
2161
+ const { appropriatenessTestService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [v, C] = k(null), f = ee(!1), S = ee(null), b = V(async () => {
2158
2162
  if (e) {
2159
2163
  if (f.current) {
2160
2164
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
@@ -2163,7 +2167,7 @@ function fn(e) {
2163
2167
  f.current = !0, l(!0), m(null);
2164
2168
  try {
2165
2169
  const F = await t.getAppropriatenessTest(e);
2166
- a(F), N.current = e;
2170
+ a(F), S.current = e;
2167
2171
  } catch (F) {
2168
2172
  m(F);
2169
2173
  } finally {
@@ -2172,16 +2176,16 @@ function fn(e) {
2172
2176
  }
2173
2177
  }, [e, t]);
2174
2178
  ne(() => {
2175
- e && N.current !== e && x();
2179
+ e && S.current !== e && b();
2176
2180
  }, [e]);
2177
2181
  const D = V(
2178
2182
  async (F) => {
2179
2183
  u(!0), m(null);
2180
2184
  try {
2181
- const R = await t.fillAppropriatenessTest(F);
2182
- return S(R), R;
2183
- } catch (R) {
2184
- throw m(R), R;
2185
+ const P = await t.fillAppropriatenessTest(F);
2186
+ return C(P), P;
2187
+ } catch (P) {
2188
+ throw m(P), P;
2185
2189
  } finally {
2186
2190
  u(!1);
2187
2191
  }
@@ -2194,12 +2198,12 @@ function fn(e) {
2194
2198
  isLoading: s,
2195
2199
  isSubmitting: c,
2196
2200
  error: h,
2197
- load: x,
2201
+ load: b,
2198
2202
  submit: D
2199
2203
  };
2200
2204
  }
2201
2205
  function kr(e) {
2202
- const { overviewService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), v = ee(!1), S = ee(null), f = V(async () => {
2206
+ const { overviewService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), v = ee(!1), C = ee(null), f = V(async () => {
2203
2207
  if (e) {
2204
2208
  if (v.current) {
2205
2209
  console.log("[Overview] Load already in progress, skipping...");
@@ -2207,25 +2211,25 @@ function kr(e) {
2207
2211
  }
2208
2212
  v.current = !0, l(!0), m(null);
2209
2213
  try {
2210
- const x = await t.getOverviewData(e);
2211
- a(x), S.current = e;
2212
- } catch (x) {
2213
- m(x);
2214
+ const b = await t.getOverviewData(e);
2215
+ a(b), C.current = e;
2216
+ } catch (b) {
2217
+ m(b);
2214
2218
  } finally {
2215
2219
  l(!1), v.current = !1;
2216
2220
  }
2217
2221
  }
2218
2222
  }, [e, t]);
2219
2223
  ne(() => {
2220
- e && S.current !== e && f();
2224
+ e && C.current !== e && f();
2221
2225
  }, [e]);
2222
- const N = V(async () => {
2226
+ const S = V(async () => {
2223
2227
  if (e) {
2224
2228
  u(!0), m(null);
2225
2229
  try {
2226
2230
  await t.passOverview(e);
2227
- } catch (x) {
2228
- throw m(x), x;
2231
+ } catch (b) {
2232
+ throw m(b), b;
2229
2233
  } finally {
2230
2234
  u(!1);
2231
2235
  }
@@ -2237,14 +2241,14 @@ function kr(e) {
2237
2241
  isSubmitting: c,
2238
2242
  error: h,
2239
2243
  load: f,
2240
- passOverview: N
2244
+ passOverview: S
2241
2245
  };
2242
2246
  }
2243
2247
  function wr(e) {
2244
2248
  const { identityService: t } = ge(), [n, a] = k(
2245
2249
  null
2246
2250
  ), [s, l] = k(!1), [c, u] = k(null), h = ee(!1), m = V(
2247
- async (f, N) => {
2251
+ async (f, S) => {
2248
2252
  if (e) {
2249
2253
  if (h.current) {
2250
2254
  console.log("[Identity] Request already in progress, skipping...");
@@ -2252,18 +2256,18 @@ function wr(e) {
2252
2256
  }
2253
2257
  h.current = !0, l(!0), u(null);
2254
2258
  try {
2255
- const x = {
2259
+ const b = {
2256
2260
  applicantId: e,
2257
2261
  restart: !1,
2258
2262
  redirectUrl: f || "",
2259
- ttl: N || 604800
2263
+ ttl: S || 604800
2260
2264
  // Default: 7 days
2261
2265
  };
2262
- console.log("Identity request input:", x);
2263
- const D = await t.identityRequest(x);
2266
+ console.log("Identity request input:", b);
2267
+ const D = await t.identityRequest(b);
2264
2268
  return console.log("Identity request result:", D), a(D), D;
2265
- } catch (x) {
2266
- throw u(x), x;
2269
+ } catch (b) {
2270
+ throw u(b), b;
2267
2271
  } finally {
2268
2272
  l(!1), h.current = !1;
2269
2273
  }
@@ -2271,26 +2275,26 @@ function wr(e) {
2271
2275
  },
2272
2276
  [e, t]
2273
2277
  ), v = V(
2274
- async (f, N) => {
2278
+ async (f, S) => {
2275
2279
  if (e) {
2276
2280
  l(!0), u(null);
2277
2281
  try {
2278
- const x = {
2282
+ const b = {
2279
2283
  applicantId: e,
2280
2284
  restart: !1,
2281
2285
  redirectUrl: f,
2282
- ttl: N
2283
- }, D = await t.identityCompanyRequest(x);
2286
+ ttl: S
2287
+ }, D = await t.identityCompanyRequest(b);
2284
2288
  return a(D), D;
2285
- } catch (x) {
2286
- throw u(x), x;
2289
+ } catch (b) {
2290
+ throw u(b), b;
2287
2291
  } finally {
2288
2292
  l(!1);
2289
2293
  }
2290
2294
  }
2291
2295
  },
2292
2296
  [e, t]
2293
- ), S = V(async () => {
2297
+ ), C = V(async () => {
2294
2298
  if (e) {
2295
2299
  if (h.current) {
2296
2300
  console.log("[Identity] Restart already in progress, skipping...");
@@ -2306,8 +2310,8 @@ function wr(e) {
2306
2310
  // 7 days
2307
2311
  };
2308
2312
  console.log("Restarting identity with input:", f);
2309
- const N = await t.identityRequest(f);
2310
- return console.log("Restart identity result:", N), a(N), N;
2313
+ const S = await t.identityRequest(f);
2314
+ return console.log("Restart identity result:", S), a(S), S;
2311
2315
  } catch (f) {
2312
2316
  throw u(f), f;
2313
2317
  } finally {
@@ -2323,12 +2327,12 @@ function wr(e) {
2323
2327
  error: c,
2324
2328
  requestIdentity: m,
2325
2329
  requestCompanyIdentity: v,
2326
- restartIdentity: S
2330
+ restartIdentity: C
2327
2331
  };
2328
2332
  }
2329
2333
  function Nr(e) {
2330
- const { riskScoringService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [S, f] = k(null), [N, x] = k(null), D = ee(!1), F = ee(null), R = V(async () => {
2331
- var E;
2334
+ const { riskScoringService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [C, f] = k(null), [S, b] = k(null), D = ee(!1), F = ee(null), P = V(async () => {
2335
+ var R;
2332
2336
  if (e) {
2333
2337
  if (D.current) {
2334
2338
  console.log("[RiskScoring] Load already in progress, skipping...");
@@ -2336,40 +2340,40 @@ function Nr(e) {
2336
2340
  }
2337
2341
  D.current = !0, h(!0), f(null);
2338
2342
  try {
2339
- const [L, Y] = await Promise.all([
2343
+ const [T, Y] = await Promise.all([
2340
2344
  t.getRiskCriterias(e),
2341
2345
  n.getApplicantData(e).catch(() => null)
2342
2346
  ]);
2343
- if (s(L), (E = Y == null ? void 0 : Y.riskScoringResults) != null && E.length) {
2344
- const X = Y.riskScoringResults[0], P = {};
2345
- for (const w of X.riskCriteriaResults ?? [])
2346
- if (w.riskCriteriaId != null && w.answer != null && w.answer !== "") {
2347
+ if (s(T), (R = Y == null ? void 0 : Y.riskScoringResults) != null && R.length) {
2348
+ const X = Y.riskScoringResults[0], E = {};
2349
+ for (const N of X.riskCriteriaResults ?? [])
2350
+ if (N.riskCriteriaId != null && N.answer != null && N.answer !== "") {
2347
2351
  const H = [...new Set(
2348
- w.answer.split(",").map((W) => W.trim()).filter((W) => W !== "")
2352
+ N.answer.split(",").map((W) => W.trim()).filter((W) => W !== "")
2349
2353
  )];
2350
- H.length > 0 && (P[w.riskCriteriaId] = H);
2354
+ H.length > 0 && (E[N.riskCriteriaId] = H);
2351
2355
  }
2352
- c(P);
2356
+ c(E);
2353
2357
  }
2354
2358
  F.current = e;
2355
- } catch (L) {
2356
- f(L);
2359
+ } catch (T) {
2360
+ f(T);
2357
2361
  } finally {
2358
2362
  h(!1), D.current = !1;
2359
2363
  }
2360
2364
  }
2361
2365
  }, [e, t, n]);
2362
2366
  ne(() => {
2363
- e && F.current !== e && R();
2367
+ e && F.current !== e && P();
2364
2368
  }, [e]);
2365
2369
  const $ = V(
2366
- async (E) => {
2370
+ async (R) => {
2367
2371
  v(!0), f(null);
2368
2372
  try {
2369
- const L = await t.submitRiskScoring(E);
2370
- return x(L), L;
2371
- } catch (L) {
2372
- throw f(L), L;
2373
+ const T = await t.submitRiskScoring(R);
2374
+ return b(T), T;
2375
+ } catch (T) {
2376
+ throw f(T), T;
2373
2377
  } finally {
2374
2378
  v(!1);
2375
2379
  }
@@ -2379,33 +2383,33 @@ function Nr(e) {
2379
2383
  return {
2380
2384
  criteria: a,
2381
2385
  initialAnswers: l,
2382
- result: N,
2386
+ result: S,
2383
2387
  isLoading: u,
2384
2388
  isSubmitting: m,
2385
- error: S,
2386
- load: R,
2389
+ error: C,
2390
+ load: P,
2387
2391
  submit: $
2388
2392
  };
2389
2393
  }
2390
2394
  function Sr() {
2391
- const { applicantService: e, config: t } = ge(), [n, a] = k(!1), [s, l] = k(null), c = ee(!1), u = ee(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(N) {
2392
- const x = Math.random() * 16 | 0;
2393
- return (N === "x" ? x : x & 3 | 8).toString(16);
2395
+ const { applicantService: e, config: t } = ge(), [n, a] = k(!1), [s, l] = k(null), c = ee(!1), u = ee(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(S) {
2396
+ const b = Math.random() * 16 | 0;
2397
+ return (S === "x" ? b : b & 3 | 8).toString(16);
2394
2398
  }), m = V(
2395
- async (N) => {
2396
- var x;
2399
+ async (S) => {
2400
+ var b;
2397
2401
  if (c.current)
2398
2402
  throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
2399
2403
  c.current = !0, a(!0), l(null);
2400
2404
  try {
2401
- if (N.applicantAdditionalDatas || (N.applicantAdditionalDatas = []), (x = t.identityProviders) != null && x.sardinai) {
2405
+ if (S.applicantAdditionalDatas || (S.applicantAdditionalDatas = []), (b = t.identityProviders) != null && b.sardinai) {
2402
2406
  const F = h();
2403
- console.log("[SardinAI] Generated session key:", F), N.applicantAdditionalDatas.push({
2407
+ console.log("[SardinAI] Generated session key:", F), S.applicantAdditionalDatas.push({
2404
2408
  paramName: "sessionKey",
2405
2409
  value: F
2406
2410
  });
2407
2411
  }
2408
- return await e.createApplicant(N);
2412
+ return await e.createApplicant(S);
2409
2413
  } catch (D) {
2410
2414
  throw l(D), D;
2411
2415
  } finally {
@@ -2414,38 +2418,38 @@ function Sr() {
2414
2418
  },
2415
2419
  [e, t]
2416
2420
  ), v = V(
2417
- async (N) => {
2421
+ async (S) => {
2418
2422
  a(!0), l(null);
2419
2423
  try {
2420
- return await e.createCompanyApplicant(N);
2421
- } catch (x) {
2422
- throw l(x), x;
2424
+ return await e.createCompanyApplicant(S);
2425
+ } catch (b) {
2426
+ throw l(b), b;
2423
2427
  } finally {
2424
2428
  a(!1);
2425
2429
  }
2426
2430
  },
2427
2431
  [e]
2428
- ), S = V(
2429
- async (N) => {
2432
+ ), C = V(
2433
+ async (S) => {
2430
2434
  if (u.current)
2431
2435
  throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
2432
2436
  u.current = !0, a(!0), l(null);
2433
2437
  try {
2434
- return await e.getApplicantData(N);
2435
- } catch (x) {
2436
- throw l(x), x;
2438
+ return await e.getApplicantData(S);
2439
+ } catch (b) {
2440
+ throw l(b), b;
2437
2441
  } finally {
2438
2442
  a(!1), u.current = !1;
2439
2443
  }
2440
2444
  },
2441
2445
  [e]
2442
2446
  ), f = V(
2443
- async (N) => {
2447
+ async (S) => {
2444
2448
  a(!0), l(null);
2445
2449
  try {
2446
- await e.stopProgress(N);
2447
- } catch (x) {
2448
- throw l(x), x;
2450
+ await e.stopProgress(S);
2451
+ } catch (b) {
2452
+ throw l(b), b;
2449
2453
  } finally {
2450
2454
  a(!1);
2451
2455
  }
@@ -2457,7 +2461,7 @@ function Sr() {
2457
2461
  error: s,
2458
2462
  createApplicant: m,
2459
2463
  createCompanyApplicant: v,
2460
- getApplicantData: S,
2464
+ getApplicantData: C,
2461
2465
  stopProgress: f
2462
2466
  };
2463
2467
  }
@@ -2551,8 +2555,9 @@ const Q = ({
2551
2555
  ),
2552
2556
  style: {
2553
2557
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
2554
- color: "var(--metakyc-text-primary, #111827)",
2555
- borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-border, #d1d5db)",
2558
+ color: "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))",
2559
+ borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
2560
+ // placeholder and focus-ring are handled via global CSS in styles.css
2556
2561
  ...c
2557
2562
  },
2558
2563
  ...u
@@ -2678,9 +2683,8 @@ const j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2678
2683
  ),
2679
2684
  style: {
2680
2685
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
2681
- color: "var(--metakyc-text-primary, #111827)",
2682
- borderColor: t ? "var(--metakyc-error, #ef4444)" : "var(--metakyc-border, #d1d5db)",
2683
- // ring color via outline on focus
2686
+ color: "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))",
2687
+ borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
2684
2688
  ...c
2685
2689
  },
2686
2690
  ...u,
@@ -2705,7 +2709,7 @@ const j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2705
2709
  disabled: m.disabled,
2706
2710
  style: {
2707
2711
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
2708
- color: m.disabled ? "var(--metakyc-text-secondary, #9ca3af)" : "var(--metakyc-text-primary, #111827)"
2712
+ color: m.disabled ? "var(--metakyc-text-muted, #9ca3af)" : "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))"
2709
2713
  },
2710
2714
  children: m.label
2711
2715
  },
@@ -2728,60 +2732,60 @@ const ct = 280, Cr = ({
2728
2732
  disabled: l = !1,
2729
2733
  required: c = !1
2730
2734
  }) => {
2731
- const [u, h] = k(!1), [m, v] = k(""), [S, f] = k(null), N = ee(null), x = ee(null), D = ee(null), F = V(() => {
2732
- if (!x.current) return null;
2733
- const C = x.current.getBoundingClientRect(), te = window.innerHeight - C.bottom < ct && C.top > ct;
2734
- return { top: te ? C.top : C.bottom + 4, left: C.left, width: C.width, openUp: te };
2735
- }, []), R = V(() => {
2735
+ const [u, h] = k(!1), [m, v] = k(""), [C, f] = k(null), S = ee(null), b = ee(null), D = ee(null), F = V(() => {
2736
+ if (!b.current) return null;
2737
+ const A = b.current.getBoundingClientRect(), te = window.innerHeight - A.bottom < ct && A.top > ct;
2738
+ return { top: te ? A.top : A.bottom + 4, left: A.left, width: A.width, openUp: te };
2739
+ }, []), P = V(() => {
2736
2740
  if (l) return;
2737
- const C = F();
2738
- C && f(C), h(!0);
2741
+ const A = F();
2742
+ A && f(A), h(!0);
2739
2743
  }, [l, F]), $ = V(() => {
2740
2744
  h(!1), v("");
2741
2745
  }, []);
2742
2746
  ne(() => {
2743
2747
  if (!u) return;
2744
- const C = (U) => {
2748
+ const A = (U) => {
2745
2749
  var ye, se;
2746
2750
  const te = U.target;
2747
- !((ye = N.current) != null && ye.contains(te)) && !((se = D.current) != null && se.contains(te)) && $();
2751
+ !((ye = S.current) != null && ye.contains(te)) && !((se = D.current) != null && se.contains(te)) && $();
2748
2752
  };
2749
- return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
2753
+ return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
2750
2754
  }, [u, $]), ne(() => {
2751
2755
  if (!u) return;
2752
- const C = () => {
2756
+ const A = () => {
2753
2757
  const U = F();
2754
2758
  U && f(U);
2755
2759
  };
2756
- return window.addEventListener("scroll", C, !0), window.addEventListener("resize", C), () => {
2757
- window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C);
2760
+ return window.addEventListener("scroll", A, !0), window.addEventListener("resize", A), () => {
2761
+ window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A);
2758
2762
  };
2759
2763
  }, [u, F]);
2760
- const E = a.filter(
2761
- (C) => C.label.toLowerCase().includes(m.toLowerCase())
2762
- ), L = (C) => {
2763
- l || n(t.includes(C) ? t.filter((U) => U !== C) : [...t, C]);
2764
- }, Y = (C, U) => {
2765
- U.stopPropagation(), l || n(t.filter((te) => te !== C));
2766
- }, X = (C) => {
2764
+ const R = a.filter(
2765
+ (A) => A.label.toLowerCase().includes(m.toLowerCase())
2766
+ ), T = (A) => {
2767
+ l || n(t.includes(A) ? t.filter((U) => U !== A) : [...t, A]);
2768
+ }, Y = (A, U) => {
2769
+ U.stopPropagation(), l || n(t.filter((te) => te !== A));
2770
+ }, X = (A) => {
2767
2771
  var U;
2768
- return ((U = a.find((te) => te.value === C)) == null ? void 0 : U.label) || C;
2769
- }, P = x.current ? getComputedStyle(x.current) : null, w = (P == null ? void 0 : P.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", H = (P == null ? void 0 : P.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", W = (P == null ? void 0 : P.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", I = (P == null ? void 0 : P.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", B = (P == null ? void 0 : P.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", T = (P == null ? void 0 : P.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", O = (P == null ? void 0 : P.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", G = u && S && /* @__PURE__ */ o(
2772
+ return ((U = a.find((te) => te.value === A)) == null ? void 0 : U.label) || A;
2773
+ }, E = b.current ? getComputedStyle(b.current) : null, N = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", H = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-border").trim()) || (E == null ? void 0 : E.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", W = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-text").trim()) || (E == null ? void 0 : E.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", w = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", B = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", L = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", O = (E == null ? void 0 : E.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", G = u && C && /* @__PURE__ */ o(
2770
2774
  "div",
2771
2775
  {
2772
2776
  ref: D,
2773
2777
  className: "metakyc-multiselect-dropdown",
2774
2778
  style: {
2775
2779
  position: "fixed",
2776
- top: S.openUp ? void 0 : S.top,
2777
- bottom: S.openUp ? window.innerHeight - S.top + 4 : void 0,
2778
- left: S.left,
2779
- width: S.width,
2780
+ top: C.openUp ? void 0 : C.top,
2781
+ bottom: C.openUp ? window.innerHeight - C.top + 4 : void 0,
2782
+ left: C.left,
2783
+ width: C.width,
2780
2784
  zIndex: 99999,
2781
2785
  borderRadius: "8px",
2782
2786
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
2783
2787
  border: `1px solid ${H}`,
2784
- backgroundColor: w,
2788
+ backgroundColor: N,
2785
2789
  overflow: "hidden"
2786
2790
  },
2787
2791
  children: [
@@ -2790,10 +2794,10 @@ const ct = 280, Cr = ({
2790
2794
  {
2791
2795
  type: "text",
2792
2796
  value: m,
2793
- onChange: (C) => v(C.target.value),
2797
+ onChange: (A) => v(A.target.value),
2794
2798
  placeholder: "Search...",
2795
2799
  autoFocus: !0,
2796
- onClick: (C) => C.stopPropagation(),
2800
+ onClick: (A) => A.stopPropagation(),
2797
2801
  className: "metakyc-multiselect-search w-full",
2798
2802
  style: {
2799
2803
  display: "block",
@@ -2802,19 +2806,19 @@ const ct = 280, Cr = ({
2802
2806
  fontSize: "13px",
2803
2807
  borderRadius: "6px",
2804
2808
  border: `1px solid ${H}`,
2805
- backgroundColor: w,
2809
+ backgroundColor: N,
2806
2810
  color: W,
2807
2811
  outline: "none",
2808
2812
  boxSizing: "border-box"
2809
2813
  }
2810
2814
  }
2811
2815
  ) }),
2812
- /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: E.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: I }, children: "No results" }) : E.map((C) => {
2813
- const U = t.includes(C.value);
2816
+ /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: R.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: w }, children: "No results" }) : R.map((A) => {
2817
+ const U = t.includes(A.value);
2814
2818
  return /* @__PURE__ */ o(
2815
2819
  "li",
2816
2820
  {
2817
- onClick: () => L(C.value),
2821
+ onClick: () => T(A.value),
2818
2822
  className: "metakyc-multiselect-option",
2819
2823
  style: {
2820
2824
  display: "flex",
@@ -2823,7 +2827,7 @@ const ct = 280, Cr = ({
2823
2827
  padding: "8px 12px",
2824
2828
  fontSize: "13px",
2825
2829
  cursor: "pointer",
2826
- backgroundColor: U ? T : "transparent",
2830
+ backgroundColor: U ? L : "transparent",
2827
2831
  color: U ? B : W,
2828
2832
  userSelect: "none"
2829
2833
  },
@@ -2843,10 +2847,10 @@ const ct = 280, Cr = ({
2843
2847
  style: { accentColor: B, pointerEvents: "none", flexShrink: 0 }
2844
2848
  }
2845
2849
  ),
2846
- /* @__PURE__ */ r("span", { children: C.label })
2850
+ /* @__PURE__ */ r("span", { children: A.label })
2847
2851
  ]
2848
2852
  },
2849
- C.value
2853
+ A.value
2850
2854
  );
2851
2855
  }) }),
2852
2856
  t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${H}` }, children: /* @__PURE__ */ o(
@@ -2867,7 +2871,7 @@ const ct = 280, Cr = ({
2867
2871
  ]
2868
2872
  }
2869
2873
  );
2870
- return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: N, children: [
2874
+ return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: S, children: [
2871
2875
  e && /* @__PURE__ */ o(
2872
2876
  "label",
2873
2877
  {
@@ -2882,8 +2886,8 @@ const ct = 280, Cr = ({
2882
2886
  /* @__PURE__ */ o(
2883
2887
  "div",
2884
2888
  {
2885
- ref: x,
2886
- onClick: () => u ? $() : R(),
2889
+ ref: b,
2890
+ onClick: () => u ? $() : P(),
2887
2891
  className: oe(
2888
2892
  "metakyc-multiselect-trigger",
2889
2893
  "min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
@@ -2891,8 +2895,8 @@ const ct = 280, Cr = ({
2891
2895
  ),
2892
2896
  style: {
2893
2897
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
2894
- borderColor: u ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)",
2895
- outline: u ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
2898
+ borderColor: u ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
2899
+ outline: u ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
2896
2900
  outlineOffset: "-1px"
2897
2901
  },
2898
2902
  children: [
@@ -2903,7 +2907,7 @@ const ct = 280, Cr = ({
2903
2907
  style: { color: "var(--metakyc-text-secondary, #9ca3af)" },
2904
2908
  children: s
2905
2909
  }
2906
- ) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((C) => /* @__PURE__ */ o(
2910
+ ) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((A) => /* @__PURE__ */ o(
2907
2911
  "span",
2908
2912
  {
2909
2913
  className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium",
@@ -2912,12 +2916,12 @@ const ct = 280, Cr = ({
2912
2916
  color: "var(--metakyc-primary, #2563eb)"
2913
2917
  },
2914
2918
  children: [
2915
- X(C),
2919
+ X(A),
2916
2920
  !l && /* @__PURE__ */ r(
2917
2921
  "button",
2918
2922
  {
2919
2923
  type: "button",
2920
- onClick: (U) => Y(C, U),
2924
+ onClick: (U) => Y(A, U),
2921
2925
  className: "metakyc-multiselect-chip-remove",
2922
2926
  style: {
2923
2927
  background: "transparent",
@@ -2943,7 +2947,7 @@ const ct = 280, Cr = ({
2943
2947
  )
2944
2948
  ]
2945
2949
  },
2946
- C
2950
+ A
2947
2951
  )) }),
2948
2952
  /* @__PURE__ */ r(
2949
2953
  "span",
@@ -2971,9 +2975,9 @@ const ct = 280, Cr = ({
2971
2975
  className: m
2972
2976
  }) => {
2973
2977
  var se;
2974
- const [v, S] = k(!1), [f, N] = k(""), [x, D] = k(null), F = ee(null), R = ee(null), $ = ee(null), E = ee(null), L = V(() => {
2975
- if (!R.current) return null;
2976
- const M = R.current.getBoundingClientRect(), ie = window.innerHeight - M.bottom < dt && M.top > dt;
2978
+ const [v, C] = k(!1), [f, S] = k(""), [b, D] = k(null), F = ee(null), P = ee(null), $ = ee(null), R = ee(null), T = V(() => {
2979
+ if (!P.current) return null;
2980
+ const M = P.current.getBoundingClientRect(), ie = window.innerHeight - M.bottom < dt && M.top > dt;
2977
2981
  return {
2978
2982
  top: ie ? M.top : M.bottom + 4,
2979
2983
  left: M.left,
@@ -2982,11 +2986,11 @@ const ct = 280, Cr = ({
2982
2986
  };
2983
2987
  }, []), Y = V(() => {
2984
2988
  if (u) return;
2985
- const M = L();
2986
- M && D(M), S(!0);
2987
- }, [u, L]), X = V(() => {
2988
- S(!1), N("");
2989
- }, []), P = () => v ? X() : Y();
2989
+ const M = T();
2990
+ M && D(M), C(!0);
2991
+ }, [u, T]), X = V(() => {
2992
+ C(!1), S("");
2993
+ }, []), E = () => v ? X() : Y();
2990
2994
  ne(() => {
2991
2995
  if (!v) return;
2992
2996
  const M = (Z) => {
@@ -2998,48 +3002,48 @@ const ct = 280, Cr = ({
2998
3002
  }, [v, X]), ne(() => {
2999
3003
  if (!v) return;
3000
3004
  const M = () => {
3001
- const Z = L();
3005
+ const Z = T();
3002
3006
  Z && D(Z);
3003
3007
  };
3004
3008
  return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), () => {
3005
3009
  window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
3006
3010
  };
3007
- }, [v, L]), ne(() => {
3008
- v && E.current && setTimeout(() => {
3011
+ }, [v, T]), ne(() => {
3012
+ v && R.current && setTimeout(() => {
3009
3013
  var M;
3010
- return (M = E.current) == null ? void 0 : M.focus();
3014
+ return (M = R.current) == null ? void 0 : M.focus();
3011
3015
  }, 0);
3012
3016
  }, [v]);
3013
- const w = a.filter(
3017
+ const N = a.filter(
3014
3018
  (M) => M.label.toLowerCase().includes(f.toLowerCase()) || M.value.toLowerCase().includes(f.toLowerCase())
3015
3019
  ), H = (se = a.find((M) => M.value === l)) == null ? void 0 : se.label, W = (M, Z) => {
3016
3020
  u || Z || (c(M), X());
3017
- }, I = R.current ? getComputedStyle(R.current) : null, B = (I == null ? void 0 : I.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", T = (I == null ? void 0 : I.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", O = (I == null ? void 0 : I.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", G = (I == null ? void 0 : I.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", C = (I == null ? void 0 : I.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", U = (I == null ? void 0 : I.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (I == null ? void 0 : I.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", ye = v && x && /* @__PURE__ */ o(
3021
+ }, w = P.current ? getComputedStyle(P.current) : null, B = (w == null ? void 0 : w.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", L = (w == null ? void 0 : w.getPropertyValue("--metakyc-input-border").trim()) || (w == null ? void 0 : w.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", O = (w == null ? void 0 : w.getPropertyValue("--metakyc-input-text").trim()) || (w == null ? void 0 : w.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", G = (w == null ? void 0 : w.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", A = (w == null ? void 0 : w.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", U = (w == null ? void 0 : w.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (w == null ? void 0 : w.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", ye = v && b && /* @__PURE__ */ o(
3018
3022
  "div",
3019
3023
  {
3020
3024
  ref: $,
3021
3025
  className: "metakyc-searchable-select-dropdown",
3022
3026
  style: {
3023
3027
  position: "fixed",
3024
- top: x.openUp ? void 0 : x.top,
3025
- bottom: x.openUp ? window.innerHeight - x.top + 4 : void 0,
3026
- left: x.left,
3027
- width: x.width,
3028
+ top: b.openUp ? void 0 : b.top,
3029
+ bottom: b.openUp ? window.innerHeight - b.top + 4 : void 0,
3030
+ left: b.left,
3031
+ width: b.width,
3028
3032
  zIndex: 99999,
3029
3033
  borderRadius: "8px",
3030
3034
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
3031
- border: `1px solid ${T}`,
3035
+ border: `1px solid ${L}`,
3032
3036
  backgroundColor: B,
3033
3037
  overflow: "hidden"
3034
3038
  },
3035
3039
  children: [
3036
- /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${T}` }, children: /* @__PURE__ */ r(
3040
+ /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${L}` }, children: /* @__PURE__ */ r(
3037
3041
  "input",
3038
3042
  {
3039
- ref: E,
3043
+ ref: R,
3040
3044
  type: "text",
3041
3045
  value: f,
3042
- onChange: (M) => N(M.target.value),
3046
+ onChange: (M) => S(M.target.value),
3043
3047
  placeholder: "Search...",
3044
3048
  onClick: (M) => M.stopPropagation(),
3045
3049
  className: "metakyc-searchable-select-search w-full",
@@ -3049,7 +3053,7 @@ const ct = 280, Cr = ({
3049
3053
  padding: "6px 8px",
3050
3054
  fontSize: "13px",
3051
3055
  borderRadius: "6px",
3052
- border: `1px solid ${T}`,
3056
+ border: `1px solid ${L}`,
3053
3057
  backgroundColor: B,
3054
3058
  color: O,
3055
3059
  outline: "none",
@@ -3067,7 +3071,7 @@ const ct = 280, Cr = ({
3067
3071
  maxHeight: "208px",
3068
3072
  overflowY: "auto"
3069
3073
  },
3070
- children: w.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: G }, children: "No results" }) : w.map((M) => {
3074
+ children: N.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: G }, children: "No results" }) : N.map((M) => {
3071
3075
  const Z = M.value === l;
3072
3076
  return /* @__PURE__ */ r(
3073
3077
  "li",
@@ -3080,7 +3084,7 @@ const ct = 280, Cr = ({
3080
3084
  cursor: M.disabled ? "not-allowed" : "pointer",
3081
3085
  opacity: M.disabled ? 0.4 : 1,
3082
3086
  backgroundColor: Z ? U : "transparent",
3083
- color: Z ? C : O,
3087
+ color: Z ? A : O,
3084
3088
  userSelect: "none"
3085
3089
  },
3086
3090
  onMouseEnter: (ie) => {
@@ -3119,12 +3123,12 @@ const ct = 280, Cr = ({
3119
3123
  /* @__PURE__ */ o(
3120
3124
  "div",
3121
3125
  {
3122
- ref: R,
3126
+ ref: P,
3123
3127
  role: "button",
3124
3128
  tabIndex: u ? -1 : 0,
3125
- onClick: P,
3129
+ onClick: E,
3126
3130
  onKeyDown: (M) => {
3127
- (M.key === "Enter" || M.key === " ") && (M.preventDefault(), P()), M.key === "Escape" && X();
3131
+ (M.key === "Enter" || M.key === " ") && (M.preventDefault(), E()), M.key === "Escape" && X();
3128
3132
  },
3129
3133
  className: oe(
3130
3134
  "metakyc-searchable-select-trigger",
@@ -3135,10 +3139,10 @@ const ct = 280, Cr = ({
3135
3139
  ),
3136
3140
  style: {
3137
3141
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
3138
- color: H ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-secondary, #9ca3af)",
3139
- borderColor: t ? "var(--metakyc-error, #ef4444)" : v ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)",
3142
+ color: H ? "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))" : "var(--metakyc-input-placeholder, var(--metakyc-text-muted, #9ca3af))",
3143
+ borderColor: t ? "var(--metakyc-danger, #ef4444)" : v ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
3140
3144
  minHeight: "42px",
3141
- outline: v ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
3145
+ outline: v ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
3142
3146
  outlineOffset: "-1px"
3143
3147
  },
3144
3148
  children: [
@@ -3172,26 +3176,26 @@ const Ar = ({
3172
3176
  value: c = [],
3173
3177
  className: u
3174
3178
  }) => {
3175
- const [h, m] = k(!1), v = ee(null), S = (R) => {
3176
- if (!R) return;
3177
- const $ = Array.from(R);
3178
- if (s && $.filter((L) => L.size > s).length > 0) {
3179
- const L = rt(s);
3180
- alert(`Some files exceed the maximum size of ${L}`);
3179
+ const [h, m] = k(!1), v = ee(null), C = (P) => {
3180
+ if (!P) return;
3181
+ const $ = Array.from(P);
3182
+ if (s && $.filter((T) => T.size > s).length > 0) {
3183
+ const T = rt(s);
3184
+ alert(`Some files exceed the maximum size of ${T}`);
3181
3185
  return;
3182
3186
  }
3183
3187
  l == null || l(a ? [...c, ...$] : [$[0]]);
3184
- }, f = (R) => {
3185
- R.preventDefault(), m(!0);
3186
- }, N = () => {
3188
+ }, f = (P) => {
3189
+ P.preventDefault(), m(!0);
3190
+ }, S = () => {
3187
3191
  m(!1);
3188
- }, x = (R) => {
3189
- R.preventDefault(), m(!1), S(R.dataTransfer.files);
3192
+ }, b = (P) => {
3193
+ P.preventDefault(), m(!1), C(P.dataTransfer.files);
3190
3194
  }, D = () => {
3191
- var R;
3192
- (R = v.current) == null || R.click();
3193
- }, F = (R) => {
3194
- const $ = c.filter((E, L) => L !== R);
3195
+ var P;
3196
+ (P = v.current) == null || P.click();
3197
+ }, F = (P) => {
3198
+ const $ = c.filter((R, T) => T !== P);
3195
3199
  l == null || l($);
3196
3200
  };
3197
3201
  return /* @__PURE__ */ o("div", { className: oe("w-full", u), children: [
@@ -3205,8 +3209,8 @@ const Ar = ({
3205
3209
  t && "border-danger-500"
3206
3210
  ),
3207
3211
  onDragOver: f,
3208
- onDragLeave: N,
3209
- onDrop: x,
3212
+ onDragLeave: S,
3213
+ onDrop: b,
3210
3214
  onClick: D,
3211
3215
  children: [
3212
3216
  /* @__PURE__ */ r(
@@ -3217,7 +3221,7 @@ const Ar = ({
3217
3221
  className: "hidden",
3218
3222
  accept: n,
3219
3223
  multiple: a,
3220
- onChange: (R) => S(R.target.files)
3224
+ onChange: (P) => C(P.target.files)
3221
3225
  }
3222
3226
  ),
3223
3227
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
@@ -3251,7 +3255,7 @@ const Ar = ({
3251
3255
  ]
3252
3256
  }
3253
3257
  ),
3254
- c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((R, $) => /* @__PURE__ */ o(
3258
+ c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((P, $) => /* @__PURE__ */ o(
3255
3259
  "div",
3256
3260
  {
3257
3261
  className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
@@ -3273,10 +3277,10 @@ const Ar = ({
3273
3277
  )
3274
3278
  }
3275
3279
  ),
3276
- /* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: R.name }),
3280
+ /* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: P.name }),
3277
3281
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
3278
3282
  "(",
3279
- rt(R.size),
3283
+ rt(P.size),
3280
3284
  ")"
3281
3285
  ] })
3282
3286
  ] }),
@@ -3284,8 +3288,8 @@ const Ar = ({
3284
3288
  "button",
3285
3289
  {
3286
3290
  type: "button",
3287
- onClick: (E) => {
3288
- E.stopPropagation(), F($);
3291
+ onClick: (R) => {
3292
+ R.stopPropagation(), F($);
3289
3293
  },
3290
3294
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
3291
3295
  children: /* @__PURE__ */ r("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
@@ -3420,7 +3424,7 @@ const Fr = (e) => {
3420
3424
  * This source code is licensed under the ISC license.
3421
3425
  * See the LICENSE file in the root directory of this source tree.
3422
3426
  */
3423
- const Lr = Ge(
3427
+ const Tr = Ge(
3424
3428
  ({
3425
3429
  color: e = "currentColor",
3426
3430
  size: t = 24,
@@ -3457,7 +3461,7 @@ const Lr = Ge(
3457
3461
  */
3458
3462
  const ft = (e, t) => {
3459
3463
  const n = Ge(
3460
- ({ className: a, ...s }, l) => nt(Lr, {
3464
+ ({ className: a, ...s }, l) => nt(Tr, {
3461
3465
  ref: l,
3462
3466
  iconNode: t,
3463
3467
  className: yt(
@@ -3476,14 +3480,14 @@ const ft = (e, t) => {
3476
3480
  * This source code is licensed under the ISC license.
3477
3481
  * See the LICENSE file in the root directory of this source tree.
3478
3482
  */
3479
- const Tr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], xt = ft("chevron-left", Tr);
3483
+ const Lr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], bt = ft("chevron-left", Lr);
3480
3484
  /**
3481
3485
  * @license lucide-react v0.574.0 - ISC
3482
3486
  *
3483
3487
  * This source code is licensed under the ISC license.
3484
3488
  * See the LICENSE file in the root directory of this source tree.
3485
3489
  */
3486
- const Dr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], bt = ft("chevron-right", Dr);
3490
+ const Dr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], xt = ft("chevron-right", Dr);
3487
3491
  function Mr(e, t) {
3488
3492
  const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
3489
3493
  if (e.isRequired && n)
@@ -3528,45 +3532,45 @@ const $r = ({
3528
3532
  onComplete: t,
3529
3533
  onBack: n
3530
3534
  }) => {
3531
- const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } = br(e), [m, v] = k({}), [S, f] = k({}), [N, x] = k(0);
3532
- xe.useEffect(() => {
3535
+ const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } = xr(e), [m, v] = k({}), [C, f] = k({}), [S, b] = k(0);
3536
+ be.useEffect(() => {
3533
3537
  s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && v(s);
3534
3538
  }, [s]);
3535
3539
  const D = Ee(
3536
3540
  () => a ? Or(a.questionGroups) : [],
3537
3541
  [a]
3538
- ), F = N === D.length - 1, R = D[N] ?? [], $ = V((P, w) => {
3539
- v((H) => ({ ...H, [P]: w })), f((H) => {
3542
+ ), F = S === D.length - 1, P = D[S] ?? [], $ = V((E, N) => {
3543
+ v((H) => ({ ...H, [E]: N })), f((H) => {
3540
3544
  const W = { ...H };
3541
- return delete W[P], W;
3545
+ return delete W[E], W;
3542
3546
  });
3543
- }, []), E = V(() => {
3544
- const P = {};
3545
- for (const { question: w } of R) {
3546
- const H = Mr(w, m[w.id] ?? []);
3547
- H && (P[w.id] = H);
3547
+ }, []), R = V(() => {
3548
+ const E = {};
3549
+ for (const { question: N } of P) {
3550
+ const H = Mr(N, m[N.id] ?? []);
3551
+ H && (E[N.id] = H);
3548
3552
  }
3549
- return f((w) => ({ ...w, ...P })), Object.keys(P).length === 0;
3550
- }, [R, m]), L = () => {
3551
- E() && x((P) => P + 1);
3553
+ return f((N) => ({ ...N, ...E })), Object.keys(E).length === 0;
3554
+ }, [P, m]), T = () => {
3555
+ R() && b((E) => E + 1);
3552
3556
  }, Y = () => {
3553
- N > 0 ? x((P) => P - 1) : n == null || n();
3557
+ S > 0 ? b((E) => E - 1) : n == null || n();
3554
3558
  }, X = async () => {
3555
- if (!(!E() || !a))
3559
+ if (!(!R() || !a))
3556
3560
  try {
3557
- const P = a.questionGroups.flatMap(
3561
+ const E = a.questionGroups.flatMap(
3558
3562
  (H) => (H.questions ?? []).map((W) => ({
3559
3563
  questionId: W.id,
3560
3564
  values: m[W.id] ?? []
3561
3565
  }))
3562
- ), w = {
3566
+ ), N = {
3563
3567
  applicantId: e,
3564
3568
  questionnarieId: a.id,
3565
- questionResults: P
3569
+ questionResults: E
3566
3570
  };
3567
- await h(w), t == null || t();
3568
- } catch (P) {
3569
- console.error("Questionnaire submit error:", P);
3571
+ await h(N), t == null || t();
3572
+ } catch (E) {
3573
+ console.error("Questionnaire submit error:", E);
3570
3574
  }
3571
3575
  };
3572
3576
  return l ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(we, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
@@ -3579,33 +3583,33 @@ const $r = ({
3579
3583
  D.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
3580
3584
  /* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3581
3585
  "Page ",
3582
- N + 1,
3586
+ S + 1,
3583
3587
  " of ",
3584
3588
  D.length
3585
3589
  ] }),
3586
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: D.map((P, w) => /* @__PURE__ */ r(
3590
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: D.map((E, N) => /* @__PURE__ */ r(
3587
3591
  "div",
3588
3592
  {
3589
3593
  className: "rounded-full transition-all duration-200",
3590
3594
  style: {
3591
3595
  height: "6px",
3592
- width: w === N ? "20px" : "6px",
3593
- backgroundColor: w <= N ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3596
+ width: N === S ? "20px" : "6px",
3597
+ backgroundColor: N <= S ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3594
3598
  }
3595
3599
  },
3596
- w
3600
+ N
3597
3601
  )) })
3598
3602
  ] })
3599
3603
  ] }),
3600
- /* @__PURE__ */ r(K, { className: "space-y-6", children: R.map(({ question: P }) => /* @__PURE__ */ r(
3604
+ /* @__PURE__ */ r(K, { className: "space-y-6", children: P.map(({ question: E }) => /* @__PURE__ */ r(
3601
3605
  zr,
3602
3606
  {
3603
- question: P,
3604
- value: m[P.id] ?? [],
3605
- error: S[P.id],
3606
- onChange: (w) => $(P.id, w)
3607
+ question: E,
3608
+ value: m[E.id] ?? [],
3609
+ error: C[E.id],
3610
+ onChange: (N) => $(E.id, N)
3607
3611
  },
3608
- P.id
3612
+ E.id
3609
3613
  )) }),
3610
3614
  /* @__PURE__ */ o(me, { className: "flex items-center justify-between", children: [
3611
3615
  /* @__PURE__ */ o(
@@ -3616,8 +3620,8 @@ const $r = ({
3616
3620
  onClick: Y,
3617
3621
  style: { display: "flex", alignItems: "center", gap: "4px" },
3618
3622
  children: [
3619
- /* @__PURE__ */ r(xt, { size: 14 }),
3620
- N > 0 ? "Previous" : "Back"
3623
+ /* @__PURE__ */ r(bt, { size: 14 }),
3624
+ S > 0 ? "Previous" : "Back"
3621
3625
  ]
3622
3626
  }
3623
3627
  ),
@@ -3633,11 +3637,11 @@ const $r = ({
3633
3637
  Q,
3634
3638
  {
3635
3639
  type: "button",
3636
- onClick: L,
3640
+ onClick: T,
3637
3641
  style: { display: "flex", alignItems: "center", gap: "4px" },
3638
3642
  children: [
3639
3643
  "Next",
3640
- /* @__PURE__ */ r(bt, { size: 14 })
3644
+ /* @__PURE__ */ r(xt, { size: 14 })
3641
3645
  ]
3642
3646
  }
3643
3647
  )
@@ -3756,27 +3760,27 @@ const $r = ({
3756
3760
  onComplete: t,
3757
3761
  onBack: n
3758
3762
  }) => {
3759
- const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = vr(e), [h, m] = k({}), v = async (S) => {
3760
- if (S.preventDefault(), !a) return;
3763
+ const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = vr(e), [h, m] = k({}), v = async (C) => {
3764
+ if (C.preventDefault(), !a) return;
3761
3765
  const f = await Promise.all(
3762
- a.uploadDocumentFiles.map(async (x) => {
3763
- const D = h[x.id] || [], F = await Promise.all(
3764
- D.map(async (R) => ({
3765
- fileName: R.name,
3766
- fileData: await mr(R)
3766
+ a.uploadDocumentFiles.map(async (b) => {
3767
+ const D = h[b.id] || [], F = await Promise.all(
3768
+ D.map(async (P) => ({
3769
+ fileName: P.name,
3770
+ fileData: await mr(P)
3767
3771
  }))
3768
3772
  );
3769
3773
  return {
3770
- uploadDocumentFileId: x.id,
3774
+ uploadDocumentFileId: b.id,
3771
3775
  valueList: F
3772
3776
  };
3773
3777
  })
3774
- ), N = {
3778
+ ), S = {
3775
3779
  applicantId: e,
3776
3780
  uploadDocumentId: a.id,
3777
3781
  uploadDocumentResults: f
3778
3782
  };
3779
- await u(N), t == null || t();
3783
+ await u(S), t == null || t();
3780
3784
  };
3781
3785
  return s ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(we, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3782
3786
  "Error loading document requirements: ",
@@ -3786,19 +3790,19 @@ const $r = ({
3786
3790
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
3787
3791
  a.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3788
3792
  ] }),
3789
- /* @__PURE__ */ r(K, { className: "space-y-6", children: a.uploadDocumentFiles.map((S) => /* @__PURE__ */ r(
3793
+ /* @__PURE__ */ r(K, { className: "space-y-6", children: a.uploadDocumentFiles.map((C) => /* @__PURE__ */ r(
3790
3794
  Ar,
3791
3795
  {
3792
- label: S.displayName,
3793
- accept: S.allowedTypes,
3794
- multiple: S.multipleFile,
3795
- maxSize: S.maxEachFileSizeByte,
3796
- value: h[S.id] || [],
3796
+ label: C.displayName,
3797
+ accept: C.allowedTypes,
3798
+ multiple: C.multipleFile,
3799
+ maxSize: C.maxEachFileSizeByte,
3800
+ value: h[C.id] || [],
3797
3801
  onChange: (f) => {
3798
- m((N) => ({ ...N, [S.id]: f }));
3802
+ m((S) => ({ ...S, [C.id]: f }));
3799
3803
  }
3800
3804
  },
3801
- S.id
3805
+ C.id
3802
3806
  )) }),
3803
3807
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
3804
3808
  n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
@@ -3908,43 +3912,43 @@ const qr = ({
3908
3912
  onComplete: t,
3909
3913
  onBack: n
3910
3914
  }) => {
3911
- const { config: a } = ge(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit: v } = Nr(e), [S, f] = k({}), [N, x] = k({}), [D, F] = k(0), [R, $] = k(!1);
3912
- xe.useEffect(() => {
3913
- c && Object.keys(c).length > 0 && Object.keys(S).length === 0 && f(c);
3915
+ const { config: a } = ge(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit: v } = Nr(e), [C, f] = k({}), [S, b] = k({}), [D, F] = k(0), [P, $] = k(!1);
3916
+ be.useEffect(() => {
3917
+ c && Object.keys(c).length > 0 && Object.keys(C).length === 0 && f(c);
3914
3918
  }, [c]);
3915
- const E = Ee(
3919
+ const R = Ee(
3916
3920
  () => l && l.length > 0 ? Wr(l) : [],
3917
3921
  [l]
3918
- ), L = D === E.length - 1, Y = E[D] ?? [];
3919
- xe.useEffect(() => {
3920
- !u && l && l.length === 0 && !R && !h && ($(!0), v({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3921
- }, [u, l, R, h, v, e, t]);
3922
- const X = V((I, B) => {
3923
- f((T) => ({ ...T, [I]: B })), x((T) => {
3924
- const O = { ...T };
3925
- return delete O[I], O;
3922
+ ), T = D === R.length - 1, Y = R[D] ?? [];
3923
+ be.useEffect(() => {
3924
+ !u && l && l.length === 0 && !P && !h && ($(!0), v({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3925
+ }, [u, l, P, h, v, e, t]);
3926
+ const X = V((w, B) => {
3927
+ f((L) => ({ ...L, [w]: B })), b((L) => {
3928
+ const O = { ...L };
3929
+ return delete O[w], O;
3926
3930
  });
3927
- }, []), P = V(() => {
3928
- const I = {};
3931
+ }, []), E = V(() => {
3932
+ const w = {};
3929
3933
  for (const { criterion: B } of Y) {
3930
- const T = Kr(B, S[B.id] ?? []);
3931
- T && (I[B.id] = T);
3934
+ const L = Kr(B, C[B.id] ?? []);
3935
+ L && (w[B.id] = L);
3932
3936
  }
3933
- return x((B) => ({ ...B, ...I })), Object.keys(I).length === 0;
3934
- }, [Y, S]), w = () => {
3935
- P() && F((I) => I + 1);
3937
+ return b((B) => ({ ...B, ...w })), Object.keys(w).length === 0;
3938
+ }, [Y, C]), N = () => {
3939
+ E() && F((w) => w + 1);
3936
3940
  }, H = () => {
3937
- D > 0 ? F((I) => I - 1) : n == null || n();
3941
+ D > 0 ? F((w) => w - 1) : n == null || n();
3938
3942
  }, W = async () => {
3939
- if (!(!P() || !l))
3943
+ if (!(!E() || !l))
3940
3944
  try {
3941
- const I = l.map((T) => {
3942
- const O = (S[T.id] ?? []).filter((G) => G && G.trim());
3943
- return O.length > 0 ? { riskCriteriaId: T.id, values: O } : null;
3944
- }).filter((T) => T !== null);
3945
- await v({ applicantId: e, criteriaValueInputs: I }), t == null || t();
3946
- } catch (I) {
3947
- console.error("Risk scoring submit error:", I);
3945
+ const w = l.map((L) => {
3946
+ const O = (C[L.id] ?? []).filter((G) => G && G.trim());
3947
+ return O.length > 0 ? { riskCriteriaId: L.id, values: O } : null;
3948
+ }).filter((L) => L !== null);
3949
+ await v({ applicantId: e, criteriaValueInputs: w }), t == null || t();
3950
+ } catch (w) {
3951
+ console.error("Risk scoring submit error:", w);
3948
3952
  }
3949
3953
  };
3950
3954
  return u ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
@@ -3960,14 +3964,14 @@ const qr = ({
3960
3964
  /* @__PURE__ */ o(ue, { children: [
3961
3965
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
3962
3966
  /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
3963
- E.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
3967
+ R.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
3964
3968
  /* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3965
3969
  "Page ",
3966
3970
  D + 1,
3967
3971
  " of ",
3968
- E.length
3972
+ R.length
3969
3973
  ] }),
3970
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: E.map((I, B) => /* @__PURE__ */ r(
3974
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: R.map((w, B) => /* @__PURE__ */ r(
3971
3975
  "div",
3972
3976
  {
3973
3977
  className: "rounded-full transition-all duration-200",
@@ -3981,16 +3985,16 @@ const qr = ({
3981
3985
  )) })
3982
3986
  ] })
3983
3987
  ] }),
3984
- /* @__PURE__ */ r(K, { className: "space-y-6", children: Y.map(({ criterion: I }) => /* @__PURE__ */ r(
3988
+ /* @__PURE__ */ r(K, { className: "space-y-6", children: Y.map(({ criterion: w }) => /* @__PURE__ */ r(
3985
3989
  Qr,
3986
3990
  {
3987
- criterion: I,
3988
- value: S[I.id] ?? [],
3989
- error: N[I.id],
3991
+ criterion: w,
3992
+ value: C[w.id] ?? [],
3993
+ error: S[w.id],
3990
3994
  locale: s,
3991
- onChange: (B) => X(I.id, B)
3995
+ onChange: (B) => X(w.id, B)
3992
3996
  },
3993
- I.id
3997
+ w.id
3994
3998
  )) }),
3995
3999
  /* @__PURE__ */ o(me, { className: "flex items-center justify-between", children: [
3996
4000
  /* @__PURE__ */ o(
@@ -4001,20 +4005,20 @@ const qr = ({
4001
4005
  onClick: H,
4002
4006
  style: { display: "flex", alignItems: "center", gap: "4px" },
4003
4007
  children: [
4004
- /* @__PURE__ */ r(xt, { size: 14 }),
4008
+ /* @__PURE__ */ r(bt, { size: 14 }),
4005
4009
  D > 0 ? "Previous" : "Back"
4006
4010
  ]
4007
4011
  }
4008
4012
  ),
4009
- L ? /* @__PURE__ */ r(Q, { type: "button", isLoading: h, onClick: W, children: "Continue" }) : /* @__PURE__ */ o(
4013
+ T ? /* @__PURE__ */ r(Q, { type: "button", isLoading: h, onClick: W, children: "Continue" }) : /* @__PURE__ */ o(
4010
4014
  Q,
4011
4015
  {
4012
4016
  type: "button",
4013
- onClick: w,
4017
+ onClick: N,
4014
4018
  style: { display: "flex", alignItems: "center", gap: "4px" },
4015
4019
  children: [
4016
4020
  "Next",
4017
- /* @__PURE__ */ r(bt, { size: 14 })
4021
+ /* @__PURE__ */ r(xt, { size: 14 })
4018
4022
  ]
4019
4023
  }
4020
4024
  )
@@ -4095,7 +4099,7 @@ const qr = ({
4095
4099
  type: "checkbox",
4096
4100
  checked: t.includes(m),
4097
4101
  onChange: (v) => {
4098
- v.target.checked ? s([...t, m]) : s(t.filter((S) => S !== m));
4102
+ v.target.checked ? s([...t, m]) : s(t.filter((C) => C !== m));
4099
4103
  },
4100
4104
  className: "metakyc-option-input",
4101
4105
  style: {
@@ -4144,8 +4148,8 @@ const qr = ({
4144
4148
  onBack: n
4145
4149
  }) => {
4146
4150
  const { investorCategorizationService: a } = ge(), [s, l] = k(null), [c, u] = k(!1), [h, m] = k(null);
4147
- return /* @__PURE__ */ r("form", { onSubmit: async (S) => {
4148
- if (S.preventDefault(), s === null) {
4151
+ return /* @__PURE__ */ r("form", { onSubmit: async (C) => {
4152
+ if (C.preventDefault(), s === null) {
4149
4153
  m("Please select an investor type");
4150
4154
  return;
4151
4155
  }
@@ -4156,8 +4160,8 @@ const qr = ({
4156
4160
  investorType: s
4157
4161
  };
4158
4162
  console.log("Submitting investor categorization:", f);
4159
- const N = await a.setInvestorCategorization(f);
4160
- console.log("Investor categorization result:", N), t == null || t();
4163
+ const S = await a.setInvestorCategorization(f);
4164
+ console.log("Investor categorization result:", S), t == null || t();
4161
4165
  } catch (f) {
4162
4166
  console.error("Error submitting investor categorization:", f), m(f.message || "Failed to submit investor categorization");
4163
4167
  } finally {
@@ -4281,71 +4285,71 @@ const qr = ({
4281
4285
  onComplete: t,
4282
4286
  onBack: n
4283
4287
  }) => {
4284
- const { appropriatenessTestService: a } = ge(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [v, S] = k(null), [f, N] = k({}), [x, D] = k(0), [F, R] = k(!1), [$, E] = k(!1), [L, Y] = k(0);
4288
+ const { appropriatenessTestService: a } = ge(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [v, C] = k(null), [f, S] = k({}), [b, D] = k(0), [F, P] = k(!1), [$, R] = k(!1), [T, Y] = k(0);
4285
4289
  ne(() => {
4286
4290
  (async () => {
4287
4291
  try {
4288
- u(!0), S(null), console.log("Loading appropriateness test for applicant:", e);
4292
+ u(!0), C(null), console.log("Loading appropriateness test for applicant:", e);
4289
4293
  const O = await a.getAppropriatenessTest(e);
4290
4294
  if (console.log("Appropriateness test data:", O), l(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
4291
4295
  const G = X(O.waitTimeSpanForNextTry);
4292
4296
  G > 0 && Y(G);
4293
4297
  }
4294
4298
  } catch (O) {
4295
- console.error("Error loading appropriateness test:", O), S(O.message || "Failed to load appropriateness test");
4299
+ console.error("Error loading appropriateness test:", O), C(O.message || "Failed to load appropriateness test");
4296
4300
  } finally {
4297
4301
  u(!1);
4298
4302
  }
4299
4303
  })();
4300
4304
  }, [e, a]);
4301
- const X = (T) => {
4302
- const O = T.split(":").map(Number);
4305
+ const X = (L) => {
4306
+ const O = L.split(":").map(Number);
4303
4307
  if (O.length === 3) {
4304
- const [G, C, U] = O;
4305
- return G * 3600 + C * 60 + U;
4308
+ const [G, A, U] = O;
4309
+ return G * 3600 + A * 60 + U;
4306
4310
  }
4307
4311
  return 0;
4308
- }, P = (T) => {
4309
- const O = Math.floor(T / 60), G = T % 60;
4312
+ }, E = (L) => {
4313
+ const O = Math.floor(L / 60), G = L % 60;
4310
4314
  return `${O.toString().padStart(2, "0")}:${G.toString().padStart(2, "0")}`;
4311
4315
  };
4312
4316
  ne(() => {
4313
- if (!F || x <= 0) return;
4314
- const T = setInterval(() => {
4315
- D((O) => O <= 1 ? (E(!0), 0) : O - 1);
4317
+ if (!F || b <= 0) return;
4318
+ const L = setInterval(() => {
4319
+ D((O) => O <= 1 ? (R(!0), 0) : O - 1);
4316
4320
  }, 1e3);
4317
- return () => clearInterval(T);
4318
- }, [F, x]), ne(() => {
4319
- if (L <= 0) return;
4320
- const T = setInterval(() => {
4321
+ return () => clearInterval(L);
4322
+ }, [F, b]), ne(() => {
4323
+ if (T <= 0) return;
4324
+ const L = setInterval(() => {
4321
4325
  Y((O) => O <= 1 ? 0 : O - 1);
4322
4326
  }, 1e3);
4323
- return () => clearInterval(T);
4324
- }, [L]), ne(() => {
4327
+ return () => clearInterval(L);
4328
+ }, [T]), ne(() => {
4325
4329
  $ && !h && W();
4326
4330
  }, [$]);
4327
- const w = () => {
4328
- s && (R(!0), D(s.testDurationSec));
4329
- }, H = (T, O) => {
4330
- N((G) => ({
4331
+ const N = () => {
4332
+ s && (P(!0), D(s.testDurationSec));
4333
+ }, H = (L, O) => {
4334
+ S((G) => ({
4331
4335
  ...G,
4332
- [T]: O
4336
+ [L]: O
4333
4337
  }));
4334
- }, W = async (T) => {
4335
- if (T && T.preventDefault(), !!s) {
4338
+ }, W = async (L) => {
4339
+ if (L && L.preventDefault(), !!s) {
4336
4340
  if (!$) {
4337
4341
  const O = s.appropriatenessQuestions.length - Object.keys(f).length;
4338
4342
  if (O > 0) {
4339
- S(`Please answer all questions. ${O} question(s) remaining.`);
4343
+ C(`Please answer all questions. ${O} question(s) remaining.`);
4340
4344
  return;
4341
4345
  }
4342
4346
  }
4343
- m(!0), S(null);
4347
+ m(!0), C(null);
4344
4348
  try {
4345
4349
  const O = s.appropriatenessQuestions.map(
4346
- (C) => ({
4347
- appropriatenessQuestionId: C.id,
4348
- value: f[C.id] || ""
4350
+ (A) => ({
4351
+ appropriatenessQuestionId: A.id,
4352
+ value: f[A.id] || ""
4349
4353
  // Empty string if not answered
4350
4354
  })
4351
4355
  ), G = {
@@ -4355,30 +4359,30 @@ const qr = ({
4355
4359
  };
4356
4360
  console.log("Submitting appropriateness test:", G);
4357
4361
  try {
4358
- const C = await a.fillAppropriatenessTest(G);
4359
- console.log("Appropriateness test result:", C), C.message && (C.message.toLowerCase().includes("pass") || C.message.toLowerCase().includes("success") || C.message.toLowerCase().includes("congratulations")) ? t == null || t() : (S(C.message || "Test completed. Please check the result."), R(!1), E(!1), N({}), setTimeout(() => I(), 1e3));
4360
- } catch (C) {
4361
- if (C.code === 400 && C.message) {
4362
- const U = C.message;
4363
- console.log("Test failed:", U), S(U), R(!1), E(!1), N({}), setTimeout(() => I(), 1500);
4362
+ const A = await a.fillAppropriatenessTest(G);
4363
+ console.log("Appropriateness test result:", A), A.message && (A.message.toLowerCase().includes("pass") || A.message.toLowerCase().includes("success") || A.message.toLowerCase().includes("congratulations")) ? t == null || t() : (C(A.message || "Test completed. Please check the result."), P(!1), R(!1), S({}), setTimeout(() => w(), 1e3));
4364
+ } catch (A) {
4365
+ if (A.code === 400 && A.message) {
4366
+ const U = A.message;
4367
+ console.log("Test failed:", U), C(U), P(!1), R(!1), S({}), setTimeout(() => w(), 1500);
4364
4368
  } else
4365
- throw C;
4369
+ throw A;
4366
4370
  }
4367
4371
  } catch (O) {
4368
- console.error("Error submitting appropriateness test:", O), S(O.message || "Failed to submit test. Please try again."), R(!1), E(!1), N({});
4372
+ console.error("Error submitting appropriateness test:", O), C(O.message || "Failed to submit test. Please try again."), P(!1), R(!1), S({});
4369
4373
  } finally {
4370
4374
  m(!1);
4371
4375
  }
4372
4376
  }
4373
- }, I = async () => {
4377
+ }, w = async () => {
4374
4378
  try {
4375
- const T = await a.getAppropriatenessTest(e);
4376
- if (console.log("Reloaded test data:", T), l(T), T.waitTimeSpanForNextTry && T.waitTimeSpanForNextTry !== "00:00:00") {
4377
- const O = X(T.waitTimeSpanForNextTry);
4379
+ const L = await a.getAppropriatenessTest(e);
4380
+ if (console.log("Reloaded test data:", L), l(L), L.waitTimeSpanForNextTry && L.waitTimeSpanForNextTry !== "00:00:00") {
4381
+ const O = X(L.waitTimeSpanForNextTry);
4378
4382
  O > 0 && Y(O);
4379
4383
  }
4380
- } catch (T) {
4381
- console.error("Error reloading test data:", T), S((O) => O + `
4384
+ } catch (L) {
4385
+ console.error("Error reloading test data:", L), C((O) => O + `
4382
4386
 
4383
4387
  Failed to reload test data. Please refresh the page.`);
4384
4388
  }
@@ -4393,7 +4397,7 @@ Failed to reload test data. Please refresh the page.`);
4393
4397
  /* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
4394
4398
  v && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: v })
4395
4399
  ] }) });
4396
- if (L > 0)
4400
+ if (T > 0)
4397
4401
  return /* @__PURE__ */ o(j, { children: [
4398
4402
  /* @__PURE__ */ o(ue, { children: [
4399
4403
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
@@ -4401,7 +4405,7 @@ Failed to reload test data. Please refresh the page.`);
4401
4405
  ] }),
4402
4406
  /* @__PURE__ */ o(K, { className: "py-12 text-center", children: [
4403
4407
  /* @__PURE__ */ o("div", { className: "mb-6", children: [
4404
- /* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: P(L) }),
4408
+ /* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: E(T) }),
4405
4409
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
4406
4410
  ] }),
4407
4411
  v && /* @__PURE__ */ r("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400 text-sm", children: v }) })
@@ -4418,8 +4422,8 @@ Failed to reload test data. Please refresh the page.`);
4418
4422
  /* @__PURE__ */ r(
4419
4423
  "div",
4420
4424
  {
4421
- className: `text-3xl font-bold ${x <= 60 ? "text-danger-500" : "text-primary-500"}`,
4422
- children: P(x)
4425
+ className: `text-3xl font-bold ${b <= 60 ? "text-danger-500" : "text-primary-500"}`,
4426
+ children: E(b)
4423
4427
  }
4424
4428
  ),
4425
4429
  /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
@@ -4440,7 +4444,7 @@ Failed to reload test data. Please refresh the page.`);
4440
4444
  " remaining"
4441
4445
  ] })
4442
4446
  ] }),
4443
- s.appropriatenessQuestions.map((T, O) => /* @__PURE__ */ o(
4447
+ s.appropriatenessQuestions.map((L, O) => /* @__PURE__ */ o(
4444
4448
  "div",
4445
4449
  {
4446
4450
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -4450,25 +4454,25 @@ Failed to reload test data. Please refresh the page.`);
4450
4454
  "Question ",
4451
4455
  O + 1
4452
4456
  ] }),
4453
- T.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: T.groupName }),
4454
- /* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: T.question })
4457
+ L.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: L.groupName }),
4458
+ /* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: L.question })
4455
4459
  ] }),
4456
- /* @__PURE__ */ r("div", { className: "space-y-2", children: T.answers.map((G, C) => /* @__PURE__ */ o(
4460
+ /* @__PURE__ */ r("div", { className: "space-y-2", children: L.answers.map((G, A) => /* @__PURE__ */ o(
4457
4461
  "label",
4458
4462
  {
4459
4463
  className: `
4460
4464
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
4461
- ${f[T.id] === G ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4465
+ ${f[L.id] === G ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
4462
4466
  `,
4463
4467
  children: [
4464
4468
  /* @__PURE__ */ r(
4465
4469
  "input",
4466
4470
  {
4467
4471
  type: "radio",
4468
- name: `question-${T.id}`,
4472
+ name: `question-${L.id}`,
4469
4473
  value: G,
4470
- checked: f[T.id] === G,
4471
- onChange: (U) => H(T.id, U.target.value),
4474
+ checked: f[L.id] === G,
4475
+ onChange: (U) => H(L.id, U.target.value),
4472
4476
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
4473
4477
  disabled: h
4474
4478
  }
@@ -4476,11 +4480,11 @@ Failed to reload test data. Please refresh the page.`);
4476
4480
  /* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: G })
4477
4481
  ]
4478
4482
  },
4479
- C
4483
+ A
4480
4484
  )) })
4481
4485
  ]
4482
4486
  },
4483
- T.id
4487
+ L.id
4484
4488
  )),
4485
4489
  v && !$ && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4486
4490
  /* @__PURE__ */ r("strong", { children: "Error:" }),
@@ -4527,7 +4531,7 @@ Failed to reload test data. Please refresh the page.`);
4527
4531
  ] }),
4528
4532
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4529
4533
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
4530
- /* @__PURE__ */ r(Ie, { variant: "info", children: P(s.testDurationSec) })
4534
+ /* @__PURE__ */ r(Ie, { variant: "info", children: E(s.testDurationSec) })
4531
4535
  ] }),
4532
4536
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4533
4537
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
@@ -4551,7 +4555,7 @@ Failed to reload test data. Please refresh the page.`);
4551
4555
  Q,
4552
4556
  {
4553
4557
  type: "button",
4554
- onClick: w,
4558
+ onClick: N,
4555
4559
  disabled: B <= 0,
4556
4560
  children: "Start Test"
4557
4561
  }
@@ -4564,7 +4568,7 @@ Failed to reload test data. Please refresh the page.`);
4564
4568
  onBack: n
4565
4569
  }) => {
4566
4570
  var _e, He, Ue, je;
4567
- const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = ge(), { identityData: u, provider: h, token: m, isLoading: v, error: S, requestIdentity: f, restartIdentity: N } = wr(e), [x, D] = k(null), [F, R] = k(null), [$, E] = k([]), [L, Y] = k([]), [X, P] = k(!0), [w, H] = k(!1), [W, I] = k(null), [B, T] = k(!1), O = xe.useRef(!1), [G, C] = k({}), [U, te] = k({}), ye = c != null && c.reviewPageFields && c.reviewPageFields.length > 0 ? c.reviewPageFields[0] : null, se = !!(c != null && c.reviewPageDisabled), M = ee(!1);
4571
+ const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = ge(), { identityData: u, provider: h, token: m, isLoading: v, error: C, requestIdentity: f, restartIdentity: S } = wr(e), [b, D] = k(null), [F, P] = k(null), [$, R] = k([]), [T, Y] = k([]), [X, E] = k(!0), [N, H] = k(!1), [W, w] = k(null), [B, L] = k(!1), O = be.useRef(!1), [G, A] = k({}), [U, te] = k({}), ye = c != null && c.reviewPageFields && c.reviewPageFields.length > 0 ? c.reviewPageFields[0] : null, se = !!(c != null && c.reviewPageDisabled), M = ee(!1);
4568
4572
  M.current = se;
4569
4573
  const Z = At({
4570
4574
  defaultValues: {
@@ -4579,24 +4583,24 @@ Failed to reload test data. Please refresh the page.`);
4579
4583
  });
4580
4584
  ne(() => {
4581
4585
  if (se) {
4582
- O.current || (O.current = !0, f().then(() => H(!0)).catch((g) => console.error("[Identity] Auto-request failed:", g)).finally(() => P(!1)));
4586
+ O.current || (O.current = !0, f().then(() => H(!0)).catch((g) => console.error("[Identity] Auto-request failed:", g)).finally(() => E(!1)));
4583
4587
  return;
4584
4588
  }
4585
4589
  (async () => {
4586
4590
  try {
4587
- const [g, b, d] = await Promise.all([
4591
+ const [g, x, d] = await Promise.all([
4588
4592
  a.getApplicantData(e),
4589
4593
  s.getCountries("", "en"),
4590
4594
  s.getCountries("", "en", 40)
4591
4595
  // CountriesType.PhoneNumber
4592
4596
  ]);
4593
- R(g);
4594
- const p = /* @__PURE__ */ new Set(), A = b.map((q) => ({ value: q.abbreviation3 || q.abbreviation, label: q.name })).filter((q) => !q.value || p.has(q.value) ? !1 : (p.add(q.value), !0));
4595
- E(A);
4597
+ P(g);
4598
+ const p = /* @__PURE__ */ new Set(), I = x.map((q) => ({ value: q.abbreviation3 || q.abbreviation, label: q.name })).filter((q) => !q.value || p.has(q.value) ? !1 : (p.add(q.value), !0));
4599
+ R(I);
4596
4600
  const z = /* @__PURE__ */ new Set(), _ = d.filter((q) => q.countryCode).map((q) => ({ value: q.countryCode, label: `${q.countryCode} – ${q.name}` })).filter((q) => z.has(q.value) ? !1 : (z.add(q.value), !0));
4597
4601
  Y(_);
4598
4602
  const y = g.applicantRequestData;
4599
- if (C({
4603
+ if (A({
4600
4604
  firstName: (y == null ? void 0 : y.firstName) || "",
4601
4605
  lastName: (y == null ? void 0 : y.lastName) || "",
4602
4606
  email: (y == null ? void 0 : y.email) || "",
@@ -4637,17 +4641,17 @@ Failed to reload test data. Please refresh the page.`);
4637
4641
  } catch (g) {
4638
4642
  console.error("Error loading applicant data:", g);
4639
4643
  } finally {
4640
- P(!1);
4644
+ E(!1);
4641
4645
  }
4642
4646
  })();
4643
4647
  }, [e]), ne(() => {
4644
- u && !w && M.current && (console.log("[Identity] Review page disabled — showing cached provider"), H(!0));
4645
- }, [u, w]), ne(() => {
4648
+ u && !N && M.current && (console.log("[Identity] Review page disabled — showing cached provider"), H(!0));
4649
+ }, [u, N]), ne(() => {
4646
4650
  if (m) {
4647
4651
  if (m.expiresAt) {
4648
4652
  const i = new Date(m.expiresAt).getTime();
4649
4653
  if (Date.now() >= i) {
4650
- console.warn("[Identity] Token has expired (expiresAt)"), T(!0), I("Your verification session has expired. Please restart.");
4654
+ console.warn("[Identity] Token has expired (expiresAt)"), L(!0), w("Your verification session has expired. Please restart.");
4651
4655
  return;
4652
4656
  }
4653
4657
  }
@@ -4655,22 +4659,22 @@ Failed to reload test data. Please refresh the page.`);
4655
4659
  try {
4656
4660
  const g = new URL(m.url).toString().toLowerCase();
4657
4661
  if (g.includes("expired") || g.includes("invalid") || g.includes("error")) {
4658
- console.warn("[Identity] Token URL indicates expiration"), T(!0), I("Your verification link has expired. Please restart.");
4662
+ console.warn("[Identity] Token URL indicates expiration"), L(!0), w("Your verification link has expired. Please restart.");
4659
4663
  return;
4660
4664
  }
4661
4665
  } catch {
4662
4666
  console.error("[Identity] Invalid token URL");
4663
4667
  }
4664
4668
  if (m.status === "expired" || m.error === "expired" || m.expired === !0) {
4665
- console.warn("[Identity] Token object indicates expiration"), T(!0), I("Your verification session has expired. Please restart.");
4669
+ console.warn("[Identity] Token object indicates expiration"), L(!0), w("Your verification session has expired. Please restart.");
4666
4670
  return;
4667
4671
  }
4668
4672
  }
4669
4673
  }, [m]), ne(() => {
4670
- if (h !== null && m && !x && w && !B) {
4674
+ if (h !== null && m && !b && N && !B) {
4671
4675
  const i = h;
4672
4676
  if (m.url) {
4673
- console.log("[Identity] Loading provider URL for user verification:", m.url), I(null);
4677
+ console.log("[Identity] Loading provider URL for user verification:", m.url), w(null);
4674
4678
  try {
4675
4679
  if (new URL(m.url), i === ve.SardinAI) {
4676
4680
  console.log("[SardinAI] Initializing Risk SDK in background...");
@@ -4687,64 +4691,64 @@ Failed to reload test data. Please refresh the page.`);
4687
4691
  }
4688
4692
  D({ type: "url", url: m.url });
4689
4693
  } catch (g) {
4690
- console.error("[Identity] Invalid URL:", g), I("Invalid verification URL. Please restart."), T(!0);
4694
+ console.error("[Identity] Invalid URL:", g), w("Invalid verification URL. Please restart."), L(!0);
4691
4695
  }
4692
4696
  return;
4693
4697
  }
4694
4698
  if (i === ve.SardinAI) {
4695
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), I(null);
4699
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), w(null);
4696
4700
  try {
4697
- const g = ze.parseProviderConfig(h, m, l), b = ze.createProvider(h, g);
4698
- b.initialize().then(() => {
4699
- console.log("[SardinAI] Risk SDK initialized successfully"), D(b), setTimeout(() => {
4701
+ const g = ze.parseProviderConfig(h, m, l), x = ze.createProvider(h, g);
4702
+ x.initialize().then(() => {
4703
+ console.log("[SardinAI] Risk SDK initialized successfully"), D(x), setTimeout(() => {
4700
4704
  t == null || t();
4701
4705
  }, 2e3);
4702
4706
  }).catch((d) => {
4703
- var A;
4707
+ var I;
4704
4708
  console.error("[SardinAI] Failed to initialize:", d);
4705
- const p = ((A = d.message) == null ? void 0 : A.toLowerCase()) || "";
4706
- p.includes("expired") || p.includes("invalid") || p.includes("401") || p.includes("400") ? (T(!0), I("Session expired or invalid. Please restart verification.")) : I(`Failed to initialize: ${d.message}`);
4709
+ const p = ((I = d.message) == null ? void 0 : I.toLowerCase()) || "";
4710
+ p.includes("expired") || p.includes("invalid") || p.includes("401") || p.includes("400") ? (L(!0), w("Session expired or invalid. Please restart verification.")) : w(`Failed to initialize: ${d.message}`);
4707
4711
  });
4708
4712
  } catch (g) {
4709
- console.error("[SardinAI] Error creating provider:", g), I(`Configuration error: ${g.message}`);
4713
+ console.error("[SardinAI] Error creating provider:", g), w(`Configuration error: ${g.message}`);
4710
4714
  }
4711
4715
  return;
4712
4716
  }
4713
4717
  try {
4714
- I(null);
4715
- const g = ze.parseProviderConfig(h, m, l), b = ze.createProvider(h, g);
4716
- i === ve.Sumsub ? (b.initialize("identity-container").catch((d) => {
4718
+ w(null);
4719
+ const g = ze.parseProviderConfig(h, m, l), x = ze.createProvider(h, g);
4720
+ i === ve.Sumsub ? (x.initialize("identity-container").catch((d) => {
4717
4721
  var p;
4718
- console.error("[Sumsub] Initialization error:", d), I(`Failed to initialize: ${d.message}`), (p = d.message) != null && p.toLowerCase().includes("expired") && T(!0);
4719
- }), b.onComplete && b.onComplete(() => {
4722
+ console.error("[Sumsub] Initialization error:", d), w(`Failed to initialize: ${d.message}`), (p = d.message) != null && p.toLowerCase().includes("expired") && L(!0);
4723
+ }), x.onComplete && x.onComplete(() => {
4720
4724
  t == null || t();
4721
- })) : i === ve.Onfido && b.initialize("identity-container").catch((d) => {
4722
- console.error("[Onfido] Initialization error:", d), I(`Failed to initialize: ${d.message}`);
4723
- }), D(b);
4725
+ })) : i === ve.Onfido && x.initialize("identity-container").catch((d) => {
4726
+ console.error("[Onfido] Initialization error:", d), w(`Failed to initialize: ${d.message}`);
4727
+ }), D(x);
4724
4728
  } catch (g) {
4725
- console.error("[Identity] Provider setup error:", g), I(`Setup error: ${g.message}`);
4729
+ console.error("[Identity] Provider setup error:", g), w(`Setup error: ${g.message}`);
4726
4730
  }
4727
4731
  }
4728
4732
  return () => {
4729
- if (x && x.destroy)
4733
+ if (b && b.destroy)
4730
4734
  try {
4731
- x.destroy();
4735
+ b.destroy();
4732
4736
  } catch (i) {
4733
4737
  console.error("[Identity] Error destroying provider:", i);
4734
4738
  }
4735
4739
  };
4736
- }, [h, m, x, w, t, B]);
4740
+ }, [h, m, b, N, t, B]);
4737
4741
  const ie = async () => {
4738
4742
  try {
4739
- I(null), T(!1), await f(), H(!0);
4743
+ w(null), L(!1), await f(), H(!0);
4740
4744
  } catch (i) {
4741
4745
  console.error("Error starting identity verification:", i);
4742
4746
  }
4743
4747
  }, Ae = async () => {
4744
4748
  try {
4745
- I(null), T(!1), D(null), console.log("[Identity] Restarting verification..."), await N(), H(!0);
4749
+ w(null), L(!1), D(null), console.log("[Identity] Restarting verification..."), await S(), H(!0);
4746
4750
  } catch (i) {
4747
- console.error("Error restarting identity verification:", i), I(i.message || "Failed to restart verification");
4751
+ console.error("Error restarting identity verification:", i), w(i.message || "Failed to restart verification");
4748
4752
  }
4749
4753
  };
4750
4754
  if (X || v)
@@ -4752,12 +4756,12 @@ Failed to reload test data. Please refresh the page.`);
4752
4756
  /* @__PURE__ */ r(we, { className: "my-8" }),
4753
4757
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4754
4758
  ] }) });
4755
- if (S)
4759
+ if (C)
4756
4760
  return /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4757
4761
  "Error: ",
4758
- S.message
4762
+ C.message
4759
4763
  ] }) }) });
4760
- if (w && (W || B))
4764
+ if (N && (W || B))
4761
4765
  return /* @__PURE__ */ o(j, { children: [
4762
4766
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4763
4767
  /* @__PURE__ */ o(K, { children: [
@@ -4799,7 +4803,7 @@ Failed to reload test data. Please refresh the page.`);
4799
4803
  /* @__PURE__ */ r(Q, { type: "button", onClick: Ae, disabled: v, children: v ? "Restarting..." : "Restart Verification" })
4800
4804
  ] })
4801
4805
  ] });
4802
- if (w && u) {
4806
+ if (N && u) {
4803
4807
  const i = h;
4804
4808
  return m != null && m.url ? /* @__PURE__ */ o(j, { children: [
4805
4809
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
@@ -4832,13 +4836,13 @@ Failed to reload test data. Please refresh the page.`);
4832
4836
  allow: "camera; microphone; geolocation",
4833
4837
  title: "Identity Verification",
4834
4838
  onLoad: (g) => {
4835
- var b, d, p;
4839
+ var x, d, p;
4836
4840
  console.log("[Identity] Iframe loaded");
4837
4841
  try {
4838
- const A = g.target, z = A.contentDocument || ((b = A.contentWindow) == null ? void 0 : b.document);
4842
+ const I = g.target, z = I.contentDocument || ((x = I.contentWindow) == null ? void 0 : x.document);
4839
4843
  if (z) {
4840
4844
  const _ = ((p = (d = z.body) == null ? void 0 : d.textContent) == null ? void 0 : p.toLowerCase()) || "";
4841
- (_.includes("expired") || _.includes("invalid") || _.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), T(!0), I("Your verification link has expired."));
4845
+ (_.includes("expired") || _.includes("invalid") || _.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), L(!0), w("Your verification link has expired."));
4842
4846
  }
4843
4847
  } catch {
4844
4848
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4870,12 +4874,12 @@ Failed to reload test data. Please refresh the page.`);
4870
4874
  const Pe = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), pe = (i = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[i] || "col-span-4", Oe = (i, g) => {
4871
4875
  if (!g && g !== 0) return "—";
4872
4876
  if (Pe.has(i) && i !== "mobileCountryCode") {
4873
- const b = $.find((d) => d.value === g);
4874
- return b ? b.label : String(g);
4877
+ const x = $.find((d) => d.value === g);
4878
+ return x ? x.label : String(g);
4875
4879
  }
4876
4880
  return String(g);
4877
4881
  }, Xe = ({ helpText: i }) => {
4878
- const [g, b] = k(!1), d = ee(null), [, p] = k({ top: 0, left: 0 });
4882
+ const [g, x] = k(!1), d = ee(null), [, p] = k({ top: 0, left: 0 });
4879
4883
  return /* @__PURE__ */ o(Qe, { children: [
4880
4884
  /* @__PURE__ */ r(
4881
4885
  "button",
@@ -4887,7 +4891,7 @@ Failed to reload test data. Please refresh the page.`);
4887
4891
  const z = d.current.getBoundingClientRect();
4888
4892
  p({ top: z.bottom + window.scrollY + 6, left: z.left + window.scrollX });
4889
4893
  }
4890
- b(!0);
4894
+ x(!0);
4891
4895
  },
4892
4896
  style: {
4893
4897
  width: 18,
@@ -4921,7 +4925,7 @@ Failed to reload test data. Please refresh the page.`);
4921
4925
  alignItems: "center",
4922
4926
  justifyContent: "center"
4923
4927
  },
4924
- onClick: () => b(!1),
4928
+ onClick: () => x(!1),
4925
4929
  children: /* @__PURE__ */ o(
4926
4930
  "div",
4927
4931
  {
@@ -4941,7 +4945,7 @@ Failed to reload test data. Please refresh the page.`);
4941
4945
  "button",
4942
4946
  {
4943
4947
  type: "button",
4944
- onClick: () => b(!1),
4948
+ onClick: () => x(!1),
4945
4949
  style: {
4946
4950
  marginTop: 12,
4947
4951
  padding: "4px 12px",
@@ -4963,13 +4967,13 @@ Failed to reload test data. Please refresh the page.`);
4963
4967
  document.body
4964
4968
  )
4965
4969
  ] });
4966
- }, be = (i, g) => g ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
4970
+ }, xe = (i, g) => g ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
4967
4971
  /* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: i }),
4968
4972
  /* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(Xe, { helpText: g }) })
4969
4973
  ] }) : i, et = (i, g) => {
4970
- const b = `cf-${g}`, d = i.paramName ?? "", p = U[d];
4974
+ const x = `cf-${g}`, d = i.paramName ?? "", p = U[d];
4971
4975
  if (i.customType === "br")
4972
- return /* @__PURE__ */ r("div", { className: pe(i.colSpan), style: { minHeight: "0.5rem" } }, b);
4976
+ return /* @__PURE__ */ r("div", { className: pe(i.colSpan), style: { minHeight: "0.5rem" } }, x);
4973
4977
  if (i.customType === "paragraph")
4974
4978
  return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: /* @__PURE__ */ r(
4975
4979
  "div",
@@ -4978,7 +4982,7 @@ Failed to reload test data. Please refresh the page.`);
4978
4982
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
4979
4983
  dangerouslySetInnerHTML: { __html: i.label || "" }
4980
4984
  }
4981
- ) }, b);
4985
+ ) }, x);
4982
4986
  if (i.customType === "html")
4983
4987
  return /* @__PURE__ */ r(
4984
4988
  "div",
@@ -4986,10 +4990,10 @@ Failed to reload test data. Please refresh the page.`);
4986
4990
  className: pe(i.colSpan),
4987
4991
  dangerouslySetInnerHTML: { __html: i.label || "" }
4988
4992
  },
4989
- b
4993
+ x
4990
4994
  );
4991
4995
  if (i.customType === "link")
4992
- return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
4996
+ return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
4993
4997
  /* @__PURE__ */ r(
4994
4998
  "a",
4995
4999
  {
@@ -5002,16 +5006,16 @@ Failed to reload test data. Please refresh the page.`);
5002
5006
  }
5003
5007
  ),
5004
5008
  i.helpText
5005
- ) }, b);
5009
+ ) }, x);
5006
5010
  if (i.customType === "checkbox" || i.customType === "link_checkbox") {
5007
- const A = p === "true" || p === !0;
5008
- return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
5011
+ const I = p === "true" || p === !0;
5012
+ return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
5009
5013
  /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5010
5014
  /* @__PURE__ */ r(
5011
5015
  "input",
5012
5016
  {
5013
5017
  type: "checkbox",
5014
- checked: !!A,
5018
+ checked: !!I,
5015
5019
  onChange: (z) => te((_) => ({ ..._, [d]: String(z.target.checked) })),
5016
5020
  style: {
5017
5021
  width: 16,
@@ -5028,16 +5032,16 @@ Failed to reload test data. Please refresh the page.`);
5028
5032
  ] }) : i.displayText || i.label })
5029
5033
  ] }),
5030
5034
  i.helpText
5031
- ) }, b);
5035
+ ) }, x);
5032
5036
  }
5033
5037
  if (i.customType === "group_checkbox") {
5034
- const A = Array.isArray(p) ? p : p ? [p] : [], z = (_) => {
5035
- i.singleSelect ? te((y) => ({ ...y, [d]: A[0] === _ ? [] : [_] })) : te((y) => ({
5038
+ const I = Array.isArray(p) ? p : p ? [p] : [], z = (_) => {
5039
+ i.singleSelect ? te((y) => ({ ...y, [d]: I[0] === _ ? [] : [_] })) : te((y) => ({
5036
5040
  ...y,
5037
- [d]: A.includes(_) ? A.filter((ae) => ae !== _) : [...A, _]
5041
+ [d]: I.includes(_) ? I.filter((ae) => ae !== _) : [...I, _]
5038
5042
  }));
5039
5043
  };
5040
- return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
5044
+ return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
5041
5045
  /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
5042
5046
  i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
5043
5047
  (i.options || []).map((_) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
@@ -5045,7 +5049,7 @@ Failed to reload test data. Please refresh the page.`);
5045
5049
  "input",
5046
5050
  {
5047
5051
  type: "checkbox",
5048
- checked: A.includes(_.value),
5052
+ checked: I.includes(_.value),
5049
5053
  onChange: () => z(_.value),
5050
5054
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5051
5055
  }
@@ -5054,92 +5058,92 @@ Failed to reload test data. Please refresh the page.`);
5054
5058
  ] }, _.value))
5055
5059
  ] }),
5056
5060
  i.helpText
5057
- ) }, b);
5061
+ ) }, x);
5058
5062
  }
5059
- return i.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
5063
+ return i.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
5060
5064
  /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
5061
5065
  i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
5062
- (i.options || []).map((A) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5066
+ (i.options || []).map((I) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5063
5067
  /* @__PURE__ */ r(
5064
5068
  "input",
5065
5069
  {
5066
5070
  type: "radio",
5067
5071
  name: `rg-${d}`,
5068
- value: A.value,
5069
- checked: p === A.value,
5070
- onChange: () => te((z) => ({ ...z, [d]: A.value })),
5072
+ value: I.value,
5073
+ checked: p === I.value,
5074
+ onChange: () => te((z) => ({ ...z, [d]: I.value })),
5071
5075
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5072
5076
  }
5073
5077
  ),
5074
- /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: A.label })
5075
- ] }, A.value))
5078
+ /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: I.label })
5079
+ ] }, I.value))
5076
5080
  ] }),
5077
5081
  i.helpText
5078
- ) }, b) : /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: be(
5082
+ ) }, x) : /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
5079
5083
  /* @__PURE__ */ r(
5080
5084
  de,
5081
5085
  {
5082
5086
  label: i.displayText || i.label || d,
5083
5087
  value: String(p ?? ""),
5084
- onChange: (A) => te((z) => ({ ...z, [d]: A.target.value }))
5088
+ onChange: (I) => te((z) => ({ ...z, [d]: I.target.value }))
5085
5089
  }
5086
5090
  ),
5087
5091
  i.helpText
5088
- ) }, b);
5092
+ ) }, x);
5089
5093
  }, tt = (i, g) => {
5090
5094
  if (i.isCustom) return et(i, g);
5091
- const b = i.name ?? "", d = Me[b], p = i.displayText || (d == null ? void 0 : d.label) || b, A = G[b] ?? "", z = b === "mobileCountryCode", _ = !!(d != null && d.countriesType) && !z;
5092
- return i.editable ? z ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5095
+ const x = i.name ?? "", d = Me[x], p = i.displayText || (d == null ? void 0 : d.label) || x, I = G[x] ?? "", z = x === "mobileCountryCode", _ = !!(d != null && d.countriesType) && !z;
5096
+ return i.editable ? z ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
5093
5097
  /* @__PURE__ */ r(
5094
5098
  Re,
5095
5099
  {
5096
5100
  label: p,
5097
- value: String(A),
5098
- onChange: (y) => C((ae) => ({ ...ae, [b]: y })),
5099
- options: [{ value: "", label: "Select country code…" }, ...L]
5101
+ value: String(I),
5102
+ onChange: (y) => A((ae) => ({ ...ae, [x]: y })),
5103
+ options: [{ value: "", label: "Select country code…" }, ...T]
5100
5104
  }
5101
5105
  ),
5102
5106
  i.helpText
5103
- ) }, `epc-${g}`) : _ ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5107
+ ) }, `epc-${g}`) : _ ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
5104
5108
  /* @__PURE__ */ r(
5105
5109
  Re,
5106
5110
  {
5107
5111
  label: p,
5108
- value: String(A),
5109
- onChange: (y) => C((ae) => ({ ...ae, [b]: y })),
5112
+ value: String(I),
5113
+ onChange: (y) => A((ae) => ({ ...ae, [x]: y })),
5110
5114
  options: [{ value: "", label: `Select ${p.toLowerCase()}…` }, ...$]
5111
5115
  }
5112
5116
  ),
5113
5117
  i.helpText
5114
- ) }, `ec-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5118
+ ) }, `ec-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
5115
5119
  /* @__PURE__ */ r(
5116
5120
  de,
5117
5121
  {
5118
5122
  label: p,
5119
5123
  type: (d == null ? void 0 : d.type) === "date" ? "date" : (d == null ? void 0 : d.type) === "email" ? "email" : "text",
5120
- value: String(A),
5121
- onChange: (y) => C((ae) => ({ ...ae, [b]: y.target.value }))
5124
+ value: String(I),
5125
+ onChange: (y) => A((ae) => ({ ...ae, [x]: y.target.value }))
5122
5126
  }
5123
5127
  ),
5124
5128
  i.helpText
5125
- ) }, `ei-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: be(
5129
+ ) }, `ei-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
5126
5130
  /* @__PURE__ */ o(Qe, { children: [
5127
5131
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p }),
5128
- /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Oe(b, A) })
5132
+ /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Oe(x, I) })
5129
5133
  ] }),
5130
5134
  i.helpText
5131
5135
  ) }, `ro-${g}`);
5132
5136
  };
5133
5137
  if (ye) {
5134
5138
  const i = ye.title || "Review Your Information", g = ye.subtitle || "Please review and confirm your information before starting identity verification";
5135
- return /* @__PURE__ */ r("form", { onSubmit: (b) => {
5136
- b.preventDefault(), ie();
5139
+ return /* @__PURE__ */ r("form", { onSubmit: (x) => {
5140
+ x.preventDefault(), ie();
5137
5141
  }, children: /* @__PURE__ */ o(j, { children: [
5138
5142
  /* @__PURE__ */ o(ue, { children: [
5139
5143
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i }),
5140
5144
  /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g })
5141
5145
  ] }),
5142
- /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: ye.fields.map((b, d) => tt(b, d)) }) }),
5146
+ /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: ye.fields.map((x, d) => tt(x, d)) }) }),
5143
5147
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
5144
5148
  n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5145
5149
  /* @__PURE__ */ r(Q, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
@@ -5164,7 +5168,7 @@ Failed to reload test data. Please refresh the page.`);
5164
5168
  /* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
5165
5169
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5166
5170
  /* @__PURE__ */ r(
5167
- Le,
5171
+ Te,
5168
5172
  {
5169
5173
  control: Z.control,
5170
5174
  name: "country",
@@ -5180,7 +5184,7 @@ Failed to reload test data. Please refresh the page.`);
5180
5184
  }
5181
5185
  ),
5182
5186
  /* @__PURE__ */ r(
5183
- Le,
5187
+ Te,
5184
5188
  {
5185
5189
  control: Z.control,
5186
5190
  name: "nationality",
@@ -5197,14 +5201,14 @@ Failed to reload test data. Please refresh the page.`);
5197
5201
  )
5198
5202
  ] }),
5199
5203
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5200
- /* @__PURE__ */ r(Le, { control: Z.control, name: "street", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street" }) }),
5201
- /* @__PURE__ */ r(Le, { control: Z.control, name: "streetNumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street Number" }) })
5204
+ /* @__PURE__ */ r(Te, { control: Z.control, name: "street", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street" }) }),
5205
+ /* @__PURE__ */ r(Te, { control: Z.control, name: "streetNumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street Number" }) })
5202
5206
  ] }),
5203
5207
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5204
- /* @__PURE__ */ r(Le, { control: Z.control, name: "city", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "City" }) }),
5205
- /* @__PURE__ */ r(Le, { control: Z.control, name: "zip", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "ZIP / Postal Code" }) })
5208
+ /* @__PURE__ */ r(Te, { control: Z.control, name: "city", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "City" }) }),
5209
+ /* @__PURE__ */ r(Te, { control: Z.control, name: "zip", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "ZIP / Postal Code" }) })
5206
5210
  ] }),
5207
- /* @__PURE__ */ r(Le, { control: Z.control, name: "phonenumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Phone Number", type: "tel" }) })
5211
+ /* @__PURE__ */ r(Te, { control: Z.control, name: "phonenumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Phone Number", type: "tel" }) })
5208
5212
  ] })
5209
5213
  ] }),
5210
5214
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
@@ -5220,21 +5224,21 @@ Failed to reload test data. Please refresh the page.`);
5220
5224
  onContinue: s,
5221
5225
  onContactSupport: l
5222
5226
  }) => {
5223
- const u = e === Te.Approved ? {
5227
+ const u = e === Le.Approved ? {
5224
5228
  type: "success",
5225
5229
  title: "Verification Approved",
5226
5230
  icon: "✓",
5227
5231
  iconBg: "bg-green-100 dark:bg-green-900/30",
5228
5232
  iconColor: "text-green-600 dark:text-green-400",
5229
5233
  message: "Your identity verification has been successfully approved."
5230
- } : e === Te.Rejected ? {
5234
+ } : e === Le.Rejected ? {
5231
5235
  type: "error",
5232
5236
  title: "Verification Rejected",
5233
5237
  icon: "✕",
5234
5238
  iconBg: "bg-red-100 dark:bg-red-900/30",
5235
5239
  iconColor: "text-red-600 dark:text-red-400",
5236
5240
  message: "Unfortunately, your identity verification was not approved."
5237
- } : e === Te.Pending || e === Te.InProgress ? {
5241
+ } : e === Le.Pending || e === Le.InProgress ? {
5238
5242
  type: "pending",
5239
5243
  title: "Verification Pending",
5240
5244
  icon: "⏱",
@@ -5305,7 +5309,7 @@ Failed to reload test data. Please refresh the page.`);
5305
5309
  Ie,
5306
5310
  {
5307
5311
  variant: u.type === "success" ? "success" : u.type === "error" ? "danger" : u.type === "pending" ? "warning" : "info",
5308
- children: e != null ? Te[e] : De[t]
5312
+ children: e != null ? Le[e] : De[t]
5309
5313
  }
5310
5314
  ) }),
5311
5315
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: a || u.message }),
@@ -5337,7 +5341,7 @@ Failed to reload test data. Please refresh the page.`);
5337
5341
  /* @__PURE__ */ r("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
5338
5342
  /* @__PURE__ */ o("div", { children: [
5339
5343
  /* @__PURE__ */ r("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
5340
- /* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ? Te[e] : "Not Available" })
5344
+ /* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ? Le[e] : "Not Available" })
5341
5345
  ] }),
5342
5346
  /* @__PURE__ */ o("div", { children: [
5343
5347
  /* @__PURE__ */ r("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
@@ -5407,7 +5411,7 @@ const qe = {
5407
5411
  display: "inline-block",
5408
5412
  verticalAlign: "middle"
5409
5413
  }, pt = ({ helpText: e, children: t }) => {
5410
- const [n, a] = xe.useState(!1);
5414
+ const [n, a] = be.useState(!1);
5411
5415
  if (!e) return /* @__PURE__ */ r(Qe, { children: t });
5412
5416
  const s = n ? /* @__PURE__ */ r(
5413
5417
  "div",
@@ -5521,7 +5525,7 @@ const qe = {
5521
5525
  ),
5522
5526
  typeof document < "u" && s ? it(s, document.body) : null
5523
5527
  ] });
5524
- }, xn = ({
5528
+ }, bn = ({
5525
5529
  workflowKey: e,
5526
5530
  externalRefId: t,
5527
5531
  onSuccess: n,
@@ -5533,26 +5537,26 @@ const qe = {
5533
5537
  throw new Error(
5534
5538
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
5535
5539
  );
5536
- const v = t || ((He = s.applicantForm) == null ? void 0 : He.externalRefId) || "", S = ((Ue = s.applicantForm) == null ? void 0 : Ue.email) || "", f = Ee(
5540
+ const v = t || ((He = s.applicantForm) == null ? void 0 : He.externalRefId) || "", C = ((Ue = s.applicantForm) == null ? void 0 : Ue.email) || "", f = Ee(
5537
5541
  () => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
5538
5542
  [c == null ? void 0 : c.applicantFormPages]
5539
- ), N = Ee(() => {
5543
+ ), S = Ee(() => {
5540
5544
  const i = new Set(Ve), g = c == null ? void 0 : c.applicantFormRequiredFields;
5541
- if (g) for (const b of g) i.add(b);
5545
+ if (g) for (const x of g) i.add(x);
5542
5546
  if (f)
5543
- for (const b of f)
5544
- for (const d of b.fields)
5547
+ for (const x of f)
5548
+ for (const d of x.fields)
5545
5549
  !d.isCustom && d.name && d.required && i.add(d.name);
5546
5550
  return Array.from(i);
5547
- }, [c == null ? void 0 : c.applicantFormRequiredFields, f]), x = Ee(() => {
5548
- var b;
5551
+ }, [c == null ? void 0 : c.applicantFormRequiredFields, f]), b = Ee(() => {
5552
+ var x;
5549
5553
  if (f) {
5550
- const d = f.flatMap((A) => A.fields).filter((A) => !A.isCustom && A.name).map((A) => A.name), p = new Set(d);
5551
- for (const A of Ve) p.add(A);
5554
+ const d = f.flatMap((I) => I.fields).filter((I) => !I.isCustom && I.name).map((I) => I.name), p = new Set(d);
5555
+ for (const I of Ve) p.add(I);
5552
5556
  return Array.from(p);
5553
5557
  }
5554
5558
  let i;
5555
- (b = s.applicantForm) != null && b.visibleFields ? i = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? i = c.applicantFormVisibleFields : i = zt;
5559
+ (x = s.applicantForm) != null && x.visibleFields ? i = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? i = c.applicantFormVisibleFields : i = zt;
5556
5560
  const g = new Set(i);
5557
5561
  for (const d of Ve) g.add(d);
5558
5562
  return Array.from(g);
@@ -5564,17 +5568,17 @@ const qe = {
5564
5568
  "mobileCountryCode",
5565
5569
  "otherNationality"
5566
5570
  ]), F = Ee(() => {
5567
- var g, b;
5571
+ var g, x;
5568
5572
  const i = /* @__PURE__ */ new Set();
5569
5573
  if (f)
5570
5574
  for (const d of f)
5571
5575
  for (const p of d.fields)
5572
5576
  !p.isCustom && p.name && D.has(p.name) && i.add(p.countriesType ?? ((g = Me[p.name]) == null ? void 0 : g.countriesType));
5573
5577
  else
5574
- for (const d of x)
5575
- D.has(d) && i.add((b = Me[d]) == null ? void 0 : b.countriesType);
5578
+ for (const d of b)
5579
+ D.has(d) && i.add((x = Me[d]) == null ? void 0 : x.countriesType);
5576
5580
  return i.size === 0 && i.add(void 0), Array.from(i);
5577
- }, [x, f]), [R, $] = k({}), [E, L] = k(!0), Y = ee(/* @__PURE__ */ new Set()), X = ee(/* @__PURE__ */ new Set());
5581
+ }, [b, f]), [P, $] = k({}), [R, T] = k(!0), Y = ee(/* @__PURE__ */ new Set()), X = ee(/* @__PURE__ */ new Set());
5578
5582
  ne(() => {
5579
5583
  if (!c) return;
5580
5584
  const i = F.filter((d) => {
@@ -5583,22 +5587,22 @@ const qe = {
5583
5587
  });
5584
5588
  if (i.length === 0) {
5585
5589
  F.every((p) => {
5586
- const A = p != null ? String(p) : "all";
5587
- return X.current.has(A);
5588
- }) && L(!1);
5590
+ const I = p != null ? String(p) : "all";
5591
+ return X.current.has(I);
5592
+ }) && T(!1);
5589
5593
  return;
5590
5594
  }
5591
- L(!0);
5595
+ T(!0);
5592
5596
  const g = i.map((d) => d != null ? String(d) : "all");
5593
5597
  g.forEach((d) => Y.current.add(d)), (async () => {
5594
5598
  try {
5595
5599
  const d = await Promise.all(
5596
5600
  i.map(async (p) => {
5597
- const A = p != null ? String(p) : "all", z = await l.getCountries("", s.locale || "en", p), _ = p === 40, y = /* @__PURE__ */ new Set(), ae = z.map((q) => _ && q.countryCode ? {
5601
+ const I = p != null ? String(p) : "all", z = await l.getCountries("", s.locale || "en", p), _ = p === 40, y = /* @__PURE__ */ new Set(), ae = z.map((q) => _ && q.countryCode ? {
5598
5602
  value: q.countryCode,
5599
5603
  label: `${q.countryCode} – ${q.name}`
5600
5604
  } : { value: q.abbreviation3 || q.abbreviation, label: q.name }).filter((q) => !q.value || y.has(q.value) ? !1 : (y.add(q.value), !0));
5601
- return X.current.add(A), Y.current.delete(A), [A, ae];
5605
+ return X.current.add(I), Y.current.delete(I), [I, ae];
5602
5606
  })
5603
5607
  );
5604
5608
  $((p) => ({ ...p, ...Object.fromEntries(d) }));
@@ -5606,22 +5610,22 @@ const qe = {
5606
5610
  g.forEach((p) => Y.current.delete(p)), console.error("Failed to load countries:", d);
5607
5611
  } finally {
5608
5612
  F.every((p) => {
5609
- const A = p != null ? String(p) : "all";
5610
- return X.current.has(A);
5611
- }) && L(!1);
5613
+ const I = p != null ? String(p) : "all";
5614
+ return X.current.has(I);
5615
+ }) && T(!1);
5612
5616
  }
5613
5617
  })();
5614
5618
  }, [F, c]);
5615
- const P = (i, g) => {
5619
+ const E = (i, g) => {
5616
5620
  var p;
5617
- const b = g ?? ((p = Me[i]) == null ? void 0 : p.countriesType), d = b != null ? String(b) : "all";
5618
- return R[d] || [];
5619
- }, [w, H] = k({
5621
+ const x = g ?? ((p = Me[i]) == null ? void 0 : p.countriesType), d = x != null ? String(x) : "all";
5622
+ return P[d] || [];
5623
+ }, [N, H] = k({
5620
5624
  workflowKey: m,
5621
5625
  firstName: "",
5622
5626
  lastName: "",
5623
5627
  title: "",
5624
- email: S,
5628
+ email: C,
5625
5629
  dateOfBirth: "",
5626
5630
  phonenumber: "",
5627
5631
  externalRefId: v,
@@ -5641,21 +5645,21 @@ const qe = {
5641
5645
  educationLevel: "",
5642
5646
  occupation: "",
5643
5647
  taxNumber: ""
5644
- }), [W, I] = k({}), [B, T] = k(0), [O, G] = k({}), [C, U] = k(null), [te, ye] = k(!1), se = (i, g) => H((b) => ({ ...b, [i]: g })), M = (i, g) => I((b) => ({ ...b, [i]: g })), Z = (i) => !i.conditionalOn || W[i.conditionalOn] === "true", ie = f && B < f.length - 1 ? B + 1 : -1, Ae = f && B > 0 ? B - 1 : -1, Pe = (i) => {
5645
- var b;
5648
+ }), [W, w] = k({}), [B, L] = k(0), [O, G] = k({}), [A, U] = k(null), [te, ye] = k(!1), se = (i, g) => H((x) => ({ ...x, [i]: g })), M = (i, g) => w((x) => ({ ...x, [i]: g })), Z = (i) => !i.conditionalOn || W[i.conditionalOn] === "true", ie = f && B < f.length - 1 ? B + 1 : -1, Ae = f && B > 0 ? B - 1 : -1, Pe = (i) => {
5649
+ var x;
5646
5650
  const g = {};
5647
5651
  for (const d of i.fields)
5648
5652
  if (d.isCustom) {
5649
5653
  if (d.customType === "paragraph" || d.customType === "html" || d.customType === "br" || d.customType === "link") continue;
5650
5654
  if (d.required && d.paramName) {
5651
- const p = W[d.paramName], A = d.displayText || d.label || d.paramName;
5652
- d.customType === "checkbox" || d.customType === "link_checkbox" ? p !== "true" && (g[d.paramName] = `${A} is required.`) : (!p || p.trim() === "") && (g[d.paramName] = `${A} is required.`);
5655
+ const p = W[d.paramName], I = d.displayText || d.label || d.paramName;
5656
+ d.customType === "checkbox" || d.customType === "link_checkbox" ? p !== "true" && (g[d.paramName] = `${I} is required.`) : (!p || p.trim() === "") && (g[d.paramName] = `${I} is required.`);
5653
5657
  }
5654
5658
  } else if (d.name) {
5655
5659
  const p = d.name;
5656
- if (N.includes(p) && Ye(w[p])) {
5657
- const A = d.displayText || ((b = Me[p]) == null ? void 0 : b.label) || p;
5658
- g[p] = `${A} is required.`;
5660
+ if (S.includes(p) && Ye(N[p])) {
5661
+ const I = d.displayText || ((x = Me[p]) == null ? void 0 : x.label) || p;
5662
+ g[p] = `${I} is required.`;
5659
5663
  }
5660
5664
  }
5661
5665
  return g;
@@ -5663,7 +5667,7 @@ const qe = {
5663
5667
  if (!f) return;
5664
5668
  const i = f[B];
5665
5669
  if (i.conditionalOn && !Z(i)) {
5666
- G({}), ie >= 0 ? T(ie) : await Oe();
5670
+ G({}), ie >= 0 ? L(ie) : await Oe();
5667
5671
  return;
5668
5672
  }
5669
5673
  const g = Pe(i);
@@ -5671,7 +5675,7 @@ const qe = {
5671
5675
  G(g);
5672
5676
  return;
5673
5677
  }
5674
- G({}), ie >= 0 ? T(ie) : await Oe();
5678
+ G({}), ie >= 0 ? L(ie) : await Oe();
5675
5679
  }, Oe = async () => {
5676
5680
  if (f) {
5677
5681
  let i = {};
@@ -5684,32 +5688,32 @@ const qe = {
5684
5688
  }
5685
5689
  ye(!0), U(null);
5686
5690
  try {
5687
- if (!w.externalRefId || w.externalRefId.trim() === "") {
5691
+ if (!N.externalRefId || N.externalRefId.trim() === "") {
5688
5692
  U("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
5689
5693
  return;
5690
5694
  }
5691
5695
  const i = {
5692
- workflowKey: w.workflowKey,
5693
- externalRefId: w.externalRefId.trim()
5696
+ workflowKey: N.workflowKey,
5697
+ externalRefId: N.externalRefId.trim()
5694
5698
  };
5695
5699
  if (f) {
5696
5700
  for (const d of f)
5697
5701
  if (Z(d)) {
5698
5702
  for (const p of d.fields)
5699
5703
  if (!p.isCustom && p.name) {
5700
- const A = p.name, z = w[A];
5701
- Ye(z) || (i[A] = z);
5704
+ const I = p.name, z = N[I];
5705
+ Ye(z) || (i[I] = z);
5702
5706
  }
5703
5707
  }
5704
5708
  for (const d of Ve)
5705
5709
  if (i[d] === void 0) {
5706
- const p = w[d];
5710
+ const p = N[d];
5707
5711
  Ye(p) || (i[d] = p);
5708
5712
  }
5709
5713
  } else
5710
- x.forEach((d) => {
5714
+ b.forEach((d) => {
5711
5715
  if (d === "externalRefId") return;
5712
- const p = w[d];
5716
+ const p = N[d];
5713
5717
  Ye(p) || (i[d] = p);
5714
5718
  });
5715
5719
  const g = [];
@@ -5718,17 +5722,17 @@ const qe = {
5718
5722
  if (Z(d))
5719
5723
  for (const p of d.fields) {
5720
5724
  if (!p.isCustom || !p.paramName || p.customType === "paragraph" || p.customType === "html" || p.customType === "br" || p.customType === "link") continue;
5721
- const A = W[p.paramName] ?? "";
5725
+ const I = W[p.paramName] ?? "";
5722
5726
  let z;
5723
5727
  if (p.customType === "checkbox" || p.customType === "link_checkbox")
5724
- z = A === "true" ? "yes" : "no";
5725
- else if (z = A, !z && !p.required) continue;
5728
+ z = I === "true" ? "yes" : "no";
5729
+ else if (z = I, !z && !p.required) continue;
5726
5730
  g.push({ paramName: p.paramName, value: z });
5727
5731
  }
5728
5732
  }
5729
5733
  g.length > 0 && (i.applicantAdditionalDatas = g);
5730
- const b = await u(i);
5731
- n(b.applicantId);
5734
+ const x = await u(i);
5735
+ n(x.applicantId);
5732
5736
  } catch (i) {
5733
5737
  console.error("Error creating applicant:", i), U(i.message || "Failed to create applicant");
5734
5738
  } finally {
@@ -5737,31 +5741,31 @@ const qe = {
5737
5741
  }, Xe = async (i) => {
5738
5742
  var g;
5739
5743
  i.preventDefault();
5740
- for (const b of N)
5741
- if (Ye(w[b])) {
5742
- const d = ((g = Me[b]) == null ? void 0 : g.label) || b;
5744
+ for (const x of S)
5745
+ if (Ye(N[x])) {
5746
+ const d = ((g = Me[x]) == null ? void 0 : g.label) || x;
5743
5747
  U(`${d} is required.`);
5744
5748
  return;
5745
5749
  }
5746
5750
  await Oe();
5747
- }, be = (i, g, b, d) => {
5751
+ }, xe = (i, g, x, d) => {
5748
5752
  var q;
5749
5753
  const p = Me[i];
5750
5754
  if (!p) return null;
5751
- const A = N.includes(i), z = O[i], _ = b || p.label, y = g ?? i, ae = { required: A };
5755
+ const I = S.includes(i), z = O[i], _ = x || p.label, y = g ?? i, ae = { required: I };
5752
5756
  switch (p.type) {
5753
5757
  case "select":
5754
5758
  if (i === "country" || i === "nationality" || i === "taxCountry" || i === "countryOfBirth" || i === "mobileCountryCode") {
5755
- const le = P(i, d);
5759
+ const le = E(i, d);
5756
5760
  return /* @__PURE__ */ r(
5757
5761
  Re,
5758
5762
  {
5759
5763
  ...ae,
5760
5764
  label: _,
5761
- value: w[i] || "",
5765
+ value: N[i] || "",
5762
5766
  onChange: (Fe) => se(i, Fe),
5763
5767
  options: [{ value: "", label: `Select ${_.toLowerCase()}...` }, ...le],
5764
- disabled: E,
5768
+ disabled: R,
5765
5769
  error: z
5766
5770
  },
5767
5771
  y
@@ -5773,7 +5777,7 @@ const qe = {
5773
5777
  {
5774
5778
  ...ae,
5775
5779
  label: _,
5776
- value: ((q = w[i]) == null ? void 0 : q.toString()) || "",
5780
+ value: ((q = N[i]) == null ? void 0 : q.toString()) || "",
5777
5781
  onChange: (le) => se(i, le ? Number(le) : null),
5778
5782
  options: [
5779
5783
  { value: "", label: "Select salutation..." },
@@ -5792,7 +5796,7 @@ const qe = {
5792
5796
  {
5793
5797
  ...ae,
5794
5798
  label: _,
5795
- value: w[i] || "",
5799
+ value: N[i] || "",
5796
5800
  onChange: (Fe) => se(i, Fe),
5797
5801
  options: [{ value: "", label: "Select language..." }, ...le],
5798
5802
  error: z
@@ -5803,17 +5807,17 @@ const qe = {
5803
5807
  return null;
5804
5808
  case "multiselect":
5805
5809
  if (i === "otherNationality") {
5806
- const le = P(i, d);
5810
+ const le = E(i, d);
5807
5811
  return /* @__PURE__ */ r(
5808
5812
  Cr,
5809
5813
  {
5810
5814
  ...ae,
5811
5815
  label: _,
5812
- value: w[i] || [],
5816
+ value: N[i] || [],
5813
5817
  onChange: (Fe) => se(i, Fe),
5814
5818
  options: le,
5815
5819
  placeholder: "Select other nationalities...",
5816
- disabled: E
5820
+ disabled: R
5817
5821
  },
5818
5822
  y
5819
5823
  );
@@ -5826,7 +5830,7 @@ const qe = {
5826
5830
  ...ae,
5827
5831
  type: "date",
5828
5832
  label: _,
5829
- value: w[i] || "",
5833
+ value: N[i] || "",
5830
5834
  onChange: (le) => se(i, le.target.value),
5831
5835
  error: z
5832
5836
  },
@@ -5839,7 +5843,7 @@ const qe = {
5839
5843
  ...ae,
5840
5844
  type: "email",
5841
5845
  label: _,
5842
- value: w[i] || "",
5846
+ value: N[i] || "",
5843
5847
  onChange: (le) => se(i, le.target.value),
5844
5848
  error: z
5845
5849
  },
@@ -5852,7 +5856,7 @@ const qe = {
5852
5856
  ...ae,
5853
5857
  type: "tel",
5854
5858
  label: _,
5855
- value: w[i] || "",
5859
+ value: N[i] || "",
5856
5860
  onChange: (le) => se(i, le.target.value),
5857
5861
  error: z
5858
5862
  },
@@ -5865,7 +5869,7 @@ const qe = {
5865
5869
  ...ae,
5866
5870
  type: "text",
5867
5871
  label: _,
5868
- value: w[i] || "",
5872
+ value: N[i] || "",
5869
5873
  onChange: (le) => se(i, le.target.value),
5870
5874
  error: z
5871
5875
  },
@@ -5925,7 +5929,7 @@ const qe = {
5925
5929
  ) }, `custom-${g}`);
5926
5930
  }
5927
5931
  if (!i.paramName) return null;
5928
- const b = O[i.paramName], d = i.displayText || i.label || i.paramName;
5932
+ const x = O[i.paramName], d = i.displayText || i.label || i.paramName;
5929
5933
  if (i.customType === "checkbox")
5930
5934
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
5931
5935
  /* @__PURE__ */ o(
@@ -5958,7 +5962,7 @@ const qe = {
5958
5962
  ]
5959
5963
  }
5960
5964
  ),
5961
- b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: b })
5965
+ x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
5962
5966
  ] }, `custom-${g}`);
5963
5967
  if (i.customType === "link_checkbox")
5964
5968
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
@@ -6005,7 +6009,7 @@ const qe = {
6005
6009
  ]
6006
6010
  }
6007
6011
  ),
6008
- b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: b })
6012
+ x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
6009
6013
  ] }, `custom-${g}`);
6010
6014
  if (i.customType === "group_checkbox") {
6011
6015
  const p = (W[i.paramName] || "").split(",").filter(Boolean);
@@ -6021,8 +6025,8 @@ const qe = {
6021
6025
  ]
6022
6026
  }
6023
6027
  ),
6024
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((A) => {
6025
- const z = i.singleSelect ? W[i.paramName] === A.value : p.includes(A.value);
6028
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((I) => {
6029
+ const z = i.singleSelect ? W[i.paramName] === I.value : p.includes(I.value);
6026
6030
  return /* @__PURE__ */ o(
6027
6031
  "label",
6028
6032
  {
@@ -6036,9 +6040,9 @@ const qe = {
6036
6040
  checked: z,
6037
6041
  onChange: (_) => {
6038
6042
  if (i.singleSelect)
6039
- M(i.paramName, _.target.checked ? A.value : "");
6043
+ M(i.paramName, _.target.checked ? I.value : "");
6040
6044
  else {
6041
- const y = _.target.checked ? [...p, A.value] : p.filter((ae) => ae !== A.value);
6045
+ const y = _.target.checked ? [...p, I.value] : p.filter((ae) => ae !== I.value);
6042
6046
  M(i.paramName, y.join(","));
6043
6047
  }
6044
6048
  },
@@ -6051,15 +6055,15 @@ const qe = {
6051
6055
  {
6052
6056
  className: "metakyc-option-text",
6053
6057
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
6054
- children: A.label
6058
+ children: I.label
6055
6059
  }
6056
6060
  )
6057
6061
  ]
6058
6062
  },
6059
- A.value
6063
+ I.value
6060
6064
  );
6061
6065
  }) }),
6062
- b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: b })
6066
+ x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: x })
6063
6067
  ] }, `custom-${g}`);
6064
6068
  }
6065
6069
  return i.customType === "radio_group" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
@@ -6103,7 +6107,7 @@ const qe = {
6103
6107
  },
6104
6108
  p.value
6105
6109
  )) }),
6106
- b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: b })
6110
+ x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: x })
6107
6111
  ] }, `custom-${g}`) : /* @__PURE__ */ r(
6108
6112
  de,
6109
6113
  {
@@ -6112,12 +6116,12 @@ const qe = {
6112
6116
  value: W[i.paramName] || "",
6113
6117
  onChange: (p) => M(i.paramName, p.target.value),
6114
6118
  required: i.required,
6115
- error: b
6119
+ error: x
6116
6120
  },
6117
6121
  `custom-${g}`
6118
6122
  );
6119
6123
  }, tt = (i, g) => {
6120
- const b = Z(i);
6124
+ const x = Z(i);
6121
6125
  return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
6122
6126
  i.conditionalOn && /* @__PURE__ */ r(pt, { helpText: i.conditionalHelpText, children: /* @__PURE__ */ o(
6123
6127
  "label",
@@ -6129,7 +6133,7 @@ const qe = {
6129
6133
  "input",
6130
6134
  {
6131
6135
  type: "checkbox",
6132
- checked: b,
6136
+ checked: x,
6133
6137
  onChange: (d) => M(i.conditionalOn, d.target.checked ? "true" : "false"),
6134
6138
  className: "metakyc-option-input",
6135
6139
  style: qe
@@ -6146,19 +6150,19 @@ const qe = {
6146
6150
  ]
6147
6151
  }
6148
6152
  ) }),
6149
- b && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: i.fields.map((d, p) => {
6150
- const A = d.colSpan === 1 ? "col-span-1" : d.colSpan === 2 ? "col-span-2" : d.colSpan === 3 ? "col-span-3" : "col-span-4", z = d.isCustom ? `custom-${p}-${d.paramName}` : `builtin-${d.name}-${p}`;
6151
- return /* @__PURE__ */ r("div", { className: A, children: /* @__PURE__ */ r(pt, { helpText: d.helpText, children: d.isCustom ? et(d, p) : be(d.name, z, d.displayText, d.countriesType) }) }, z);
6153
+ x && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: i.fields.map((d, p) => {
6154
+ const I = d.colSpan === 1 ? "col-span-1" : d.colSpan === 2 ? "col-span-2" : d.colSpan === 3 ? "col-span-3" : "col-span-4", z = d.isCustom ? `custom-${p}-${d.paramName}` : `builtin-${d.name}-${p}`;
6155
+ return /* @__PURE__ */ r("div", { className: I, children: /* @__PURE__ */ r(pt, { helpText: d.helpText, children: d.isCustom ? et(d, p) : xe(d.name, z, d.displayText, d.countriesType) }) }, z);
6152
6156
  }) })
6153
6157
  ] });
6154
6158
  };
6155
- if (!c || E)
6159
+ if (!c || R)
6156
6160
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
6157
6161
  /* @__PURE__ */ r(we, { className: "my-8" }),
6158
6162
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
6159
6163
  ] }) }) });
6160
6164
  if (f) {
6161
- const i = f[B] ?? f[0], g = Ae === -1, b = ie === -1, d = f.length, p = Z(i), A = Object.values(O);
6165
+ const i = f[B] ?? f[0], g = Ae === -1, x = ie === -1, d = f.length, p = Z(i), I = Object.values(O);
6162
6166
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(j, { children: [
6163
6167
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
6164
6168
  /* @__PURE__ */ o(K, { children: [
@@ -6188,13 +6192,13 @@ const qe = {
6188
6192
  }
6189
6193
  )
6190
6194
  ] }),
6191
- (C || A.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
6192
- C && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
6195
+ (A || I.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
6196
+ A && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
6193
6197
  /* @__PURE__ */ r("strong", { children: "Error:" }),
6194
6198
  " ",
6195
- C
6199
+ A
6196
6200
  ] }),
6197
- A.map((z, _) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: z }, _))
6201
+ I.map((z, _) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: z }, _))
6198
6202
  ] }),
6199
6203
  d > 1 && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-4", children: [
6200
6204
  f.map((z, _) => /* @__PURE__ */ r(
@@ -6221,7 +6225,7 @@ const qe = {
6221
6225
  type: "button",
6222
6226
  variant: "outline",
6223
6227
  onClick: () => {
6224
- T(Ae), G({});
6228
+ L(Ae), G({});
6225
6229
  },
6226
6230
  disabled: te || h,
6227
6231
  children: "Previous"
@@ -6234,8 +6238,8 @@ const qe = {
6234
6238
  {
6235
6239
  type: "button",
6236
6240
  isLoading: te || h,
6237
- onClick: b ? Oe : pe,
6238
- children: b ? i.conditionalOn && !p ? "Skip & Submit" : "Submit" : i.conditionalOn && !p ? "Skip" : "Next"
6241
+ onClick: x ? Oe : pe,
6242
+ children: x ? i.conditionalOn && !p ? "Skip & Submit" : "Submit" : i.conditionalOn && !p ? "Skip" : "Next"
6239
6243
  }
6240
6244
  )
6241
6245
  ] })
@@ -6244,19 +6248,19 @@ const qe = {
6244
6248
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Xe, children: /* @__PURE__ */ o(j, { children: [
6245
6249
  /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
6246
6250
  /* @__PURE__ */ o(K, { children: [
6247
- C && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
6251
+ A && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
6248
6252
  /* @__PURE__ */ r("strong", { children: "Error:" }),
6249
6253
  " ",
6250
- C
6254
+ A
6251
6255
  ] }) }),
6252
- /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: x.map((i) => /* @__PURE__ */ r("div", { className: "col-span-4", children: be(i) }, i)) })
6256
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: b.map((i) => /* @__PURE__ */ r("div", { className: "col-span-4", children: xe(i) }, i)) })
6253
6257
  ] }),
6254
6258
  /* @__PURE__ */ o(me, { className: "flex justify-between", children: [
6255
6259
  a && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: a, disabled: te || h, children: "Cancel" }),
6256
6260
  /* @__PURE__ */ r(Q, { type: "submit", isLoading: te || h, children: "Create Applicant" })
6257
6261
  ] })
6258
6262
  ] }) }) });
6259
- }, bn = ({
6263
+ }, xn = ({
6260
6264
  applicantId: e,
6261
6265
  onComplete: t,
6262
6266
  onError: n,
@@ -6270,20 +6274,20 @@ const qe = {
6270
6274
  workflowKey: h,
6271
6275
  nextWorkflowKey: m,
6272
6276
  hasWorkflowChanged: v,
6273
- isLoading: S,
6277
+ isLoading: C,
6274
6278
  error: f,
6275
- moveBack: N,
6276
- refreshProgress: x
6277
- } = xr(e), [D, F] = xe.useState(!1);
6278
- if (xe.useEffect(() => {
6279
+ moveBack: S,
6280
+ refreshProgress: b
6281
+ } = br(e), [D, F] = be.useState(!1);
6282
+ if (be.useEffect(() => {
6279
6283
  f && n && n(f);
6280
- }, [f, n]), xe.useEffect(() => {
6284
+ }, [f, n]), be.useEffect(() => {
6281
6285
  l != null && l.workflowResult && t && t(l.workflowResult);
6282
- }, [l == null ? void 0 : l.workflowResult, t]), xe.useEffect(() => {
6286
+ }, [l == null ? void 0 : l.workflowResult, t]), be.useEffect(() => {
6283
6287
  a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
6284
- }, [a]), xe.useEffect(() => {
6288
+ }, [a]), be.useEffect(() => {
6285
6289
  v && F(!1);
6286
- }, [v]), S || !l)
6290
+ }, [v]), C || !l)
6287
6291
  return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
6288
6292
  /* @__PURE__ */ r(we, { className: "my-8" }),
6289
6293
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
@@ -6340,8 +6344,8 @@ const qe = {
6340
6344
  /* @__PURE__ */ r(we, { className: "my-8" }),
6341
6345
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status === ke.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
6342
6346
  ] }) }) });
6343
- const R = (L) => {
6344
- switch (L) {
6347
+ const P = (T) => {
6348
+ switch (T) {
6345
6349
  case J.Overview:
6346
6350
  return "Overview";
6347
6351
  case J.Questionaries:
@@ -6364,7 +6368,7 @@ const qe = {
6364
6368
  return "";
6365
6369
  }
6366
6370
  }, $ = () => {
6367
- const L = u.filter((w) => w.visibility !== !1), Y = L.findIndex((w) => w.order === c.order), X = Y >= 0 ? Y + 1 : 1, P = L.length;
6371
+ const T = u.filter((N) => N.visibility !== !1), Y = T.findIndex((N) => N.order === c.order), X = Y >= 0 ? Y + 1 : 1, E = T.length;
6368
6372
  return /* @__PURE__ */ o("div", { className: "mb-6", children: [
6369
6373
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
6370
6374
  /* @__PURE__ */ r(at, {}),
@@ -6372,19 +6376,19 @@ const qe = {
6372
6376
  "Step ",
6373
6377
  X,
6374
6378
  " of ",
6375
- P
6379
+ E
6376
6380
  ] })
6377
6381
  ] }),
6378
- /* @__PURE__ */ r("div", { className: "flex items-center", children: L.map((w, H) => {
6379
- const W = H < Y, I = w.order === c.order;
6380
- return /* @__PURE__ */ o(xe.Fragment, { children: [
6382
+ /* @__PURE__ */ r("div", { className: "flex items-center", children: T.map((N, H) => {
6383
+ const W = H < Y, w = N.order === c.order;
6384
+ return /* @__PURE__ */ o(be.Fragment, { children: [
6381
6385
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
6382
6386
  /* @__PURE__ */ r(
6383
6387
  "div",
6384
6388
  {
6385
6389
  className: `
6386
6390
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
6387
- ${W || I ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
6391
+ ${W || w ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
6388
6392
  `,
6389
6393
  children: H + 1
6390
6394
  }
@@ -6392,44 +6396,44 @@ const qe = {
6392
6396
  /* @__PURE__ */ r(
6393
6397
  "span",
6394
6398
  {
6395
- className: `ml-2 text-sm ${I ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
6396
- children: w.displayName || w.name || R(w.action) || `Step ${H + 1}`
6399
+ className: `ml-2 text-sm ${w ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
6400
+ children: N.displayName || N.name || P(N.action) || `Step ${H + 1}`
6397
6401
  }
6398
6402
  )
6399
6403
  ] }),
6400
- H < L.length - 1 && /* @__PURE__ */ r(
6404
+ H < T.length - 1 && /* @__PURE__ */ r(
6401
6405
  "div",
6402
6406
  {
6403
6407
  className: `flex-1 h-0.5 mx-4 ${W ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
6404
6408
  }
6405
6409
  )
6406
- ] }, w.order);
6410
+ ] }, N.order);
6407
6411
  }) })
6408
6412
  ] });
6409
- }, E = () => {
6410
- const L = {
6413
+ }, R = () => {
6414
+ const T = {
6411
6415
  applicantId: e,
6412
6416
  onComplete: async () => {
6413
- await x();
6417
+ await b();
6414
6418
  },
6415
- onBack: c.order > 0 ? N : void 0
6419
+ onBack: c.order > 0 ? S : void 0
6416
6420
  };
6417
6421
  switch (c.action) {
6418
6422
  case J.Questionaries:
6419
- return /* @__PURE__ */ r($r, { ...L });
6423
+ return /* @__PURE__ */ r($r, { ...T });
6420
6424
  case J.UploadDocument:
6421
- return /* @__PURE__ */ r(Br, { ...L });
6425
+ return /* @__PURE__ */ r(Br, { ...T });
6422
6426
  case J.Overview:
6423
- return /* @__PURE__ */ r(_r, { ...L });
6427
+ return /* @__PURE__ */ r(_r, { ...T });
6424
6428
  case J.IdentitySdk:
6425
- return /* @__PURE__ */ r(Jr, { ...L });
6429
+ return /* @__PURE__ */ r(Jr, { ...T });
6426
6430
  case J.RiskScoring:
6427
- return /* @__PURE__ */ r(qr, { ...L });
6431
+ return /* @__PURE__ */ r(qr, { ...T });
6428
6432
  case J.AdditionalData:
6429
6433
  case J.InvestorCategorization:
6430
- return /* @__PURE__ */ r(Gr, { ...L });
6434
+ return /* @__PURE__ */ r(Gr, { ...T });
6431
6435
  case J.AppropriatenessTest:
6432
- return /* @__PURE__ */ r(Vr, { ...L });
6436
+ return /* @__PURE__ */ r(Vr, { ...T });
6433
6437
  case J.ManualReview:
6434
6438
  return /* @__PURE__ */ r(
6435
6439
  mt,
@@ -6456,7 +6460,7 @@ const qe = {
6456
6460
  };
6457
6461
  return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
6458
6462
  $(),
6459
- E()
6463
+ R()
6460
6464
  ] });
6461
6465
  };
6462
6466
  function vn(e) {
@@ -6524,15 +6528,15 @@ export {
6524
6528
  me as CardFooter,
6525
6529
  ue as CardHeader,
6526
6530
  $e as CountriesType,
6527
- xn as CreateApplicantForm,
6531
+ bn as CreateApplicantForm,
6528
6532
  Ot as CriteriaBuiltInType,
6529
6533
  zt as DEFAULT_VISIBLE_FIELDS,
6530
- Tt as DocumentReviewStatus,
6534
+ Lt as DocumentReviewStatus,
6531
6535
  _t as EndpointBuilder,
6532
6536
  Ke as ErrorHandler,
6533
6537
  ar as EventEmitter,
6534
6538
  Me as FIELD_METADATA,
6535
- Lt as FileType,
6539
+ Tt as FileType,
6536
6540
  Ar as FileUpload,
6537
6541
  Ze as GenderType,
6538
6542
  at as Header,
@@ -6547,9 +6551,9 @@ export {
6547
6551
  fe as InvestorCategorizationType,
6548
6552
  $t as InvestorCategoryType,
6549
6553
  Pt as KycProcessStatus,
6550
- Te as KycStatus,
6554
+ Le as KycStatus,
6551
6555
  mt as KycStatusDisplay,
6552
- bn as KycWorkflow,
6556
+ xn as KycWorkflow,
6553
6557
  Zr as Logo,
6554
6558
  gt as MetaKYCContext,
6555
6559
  Ne as MetaKYCError,
@@ -6614,10 +6618,10 @@ export {
6614
6618
  Sr as useApplicant,
6615
6619
  fn as useAppropriatenessTest,
6616
6620
  wr as useIdentityVerification,
6617
- xr as useKycWorkflow,
6621
+ br as useKycWorkflow,
6618
6622
  ge as useMetaKYC,
6619
6623
  kr as useOverview,
6620
- br as useQuestionnaire,
6624
+ xr as useQuestionnaire,
6621
6625
  Nr as useRiskScoring,
6622
6626
  vr as useUploadDocument,
6623
6627
  mn as validateFileSize,