@vpdev2/metakyc-sdk 1.0.74 → 1.0.76

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