@vpdev2/metakyc-sdk 1.0.95 → 1.0.96

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
@@ -1,14 +1,14 @@
1
1
  var Mt = Object.defineProperty;
2
2
  var Ot = (e, t, n) => t in e ? Mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var pe = (e, t, n) => Ot(e, typeof t != "symbol" ? t + "" : t, n);
4
- import $t from "axios";
4
+ import zt from "axios";
5
5
  import * as xt from "react";
6
- import Ae, { createContext as zt, useState as w, useMemo as Re, useEffect as ye, useContext as Bt, useRef as ce, useCallback as ee, forwardRef as ct, createElement as ht } from "react";
6
+ import Ae, { createContext as $t, useState as w, useMemo as Re, useEffect as ye, useContext as Bt, useRef as ce, useCallback as ee, forwardRef as ct, createElement as ht } from "react";
7
7
  import { jsx as r, jsxs as i, Fragment as ot } from "react/jsx-runtime";
8
8
  import _t, { createPortal as gt } from "react-dom";
9
9
  import { useForm as jt, Controller as Ye } from "react-hook-form";
10
10
  import { z as _e } from "zod";
11
- var se = /* @__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))(se || {}), ut = /* @__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))(ut || {}), Te = /* @__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))(Te || {}), Ht = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(Ht || {}), Ut = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Ut || {}), Ve = /* @__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))(Ve || {}), Qe = /* @__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))(Qe || {}), Kt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Kt || {}), Wt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Wt || {}), Le = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Le || {}), qt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(qt || {}), mt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(mt || {}), Yt = /* @__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))(Yt || {}), Vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Vt || {}), Qt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Qt || {}), ze = /* @__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))(ze || {}), Gt = /* @__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))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Jt || {}), Se = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Se || {}), Zt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Zt || {});
11
+ var se = /* @__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))(se || {}), ut = /* @__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))(ut || {}), Te = /* @__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))(Te || {}), Ht = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(Ht || {}), Ut = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Ut || {}), Ve = /* @__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))(Ve || {}), Qe = /* @__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))(Qe || {}), Kt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Kt || {}), Wt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Wt || {}), Le = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Le || {}), qt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(qt || {}), mt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(mt || {}), Yt = /* @__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))(Yt || {}), Vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Vt || {}), Qt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Qt || {}), $e = /* @__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))($e || {}), Gt = /* @__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))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Jt || {}), Se = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Se || {}), Zt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Zt || {});
12
12
  const Ue = {
13
13
  Nationality: 10,
14
14
  Address: 20,
@@ -137,11 +137,11 @@ class rr {
137
137
  }[t] || t;
138
138
  }
139
139
  }
140
- class $e extends Error {
140
+ class ze extends Error {
141
141
  constructor(n, a, s, l, d) {
142
142
  super(n);
143
143
  pe(this, "response");
144
- this.code = a, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = d, Object.setPrototypeOf(this, $e.prototype);
144
+ this.code = a, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = d, Object.setPrototypeOf(this, ze.prototype);
145
145
  }
146
146
  }
147
147
  class at {
@@ -149,7 +149,7 @@ class at {
149
149
  * Process an error from the API response
150
150
  */
151
151
  static handleApiError(t) {
152
- return new $e(
152
+ return new ze(
153
153
  t.message || "An unknown error occurred",
154
154
  t.code,
155
155
  t.details || void 0,
@@ -162,36 +162,36 @@ class at {
162
162
  static handleAxiosError(t) {
163
163
  if (t.response) {
164
164
  const n = t.response.data;
165
- return n && n.error ? new $e(
165
+ return n && n.error ? new ze(
166
166
  n.error.message || "An unknown error occurred",
167
167
  n.error.code,
168
168
  n.error.details || void 0,
169
169
  n.error.validationErrors || void 0,
170
170
  t.response
171
- ) : n && n.result && n.result.message ? new $e(
171
+ ) : n && n.result && n.result.message ? new ze(
172
172
  n.result.message,
173
173
  t.response.status,
174
174
  `HTTP ${t.response.status}: ${t.response.statusText}`,
175
175
  void 0,
176
176
  t.response
177
- ) : new $e(
177
+ ) : new ze(
178
178
  (n == null ? void 0 : n.message) || t.message || "Request failed",
179
179
  t.response.status,
180
180
  `HTTP ${t.response.status}: ${t.response.statusText}`,
181
181
  void 0,
182
182
  t.response
183
183
  );
184
- } else return t.request ? new $e(
184
+ } else return t.request ? new ze(
185
185
  "No response from server",
186
186
  0,
187
187
  "The request was made but no response was received. Please check your network connection."
188
- ) : new $e(t.message || "An unexpected error occurred", 0, t.toString());
188
+ ) : new ze(t.message || "An unexpected error occurred", 0, t.toString());
189
189
  }
190
190
  /**
191
191
  * Check if an error is a MetaKYCError
192
192
  */
193
193
  static isMetaKYCError(t) {
194
- return t instanceof $e;
194
+ return t instanceof ze;
195
195
  }
196
196
  }
197
197
  class nr {
@@ -199,7 +199,7 @@ class nr {
199
199
  pe(this, "axiosInstance");
200
200
  pe(this, "endpointBuilder");
201
201
  pe(this, "config");
202
- this.config = { ...tr, ...t }, this.endpointBuilder = new rr(this.config.endpoints), this.axiosInstance = $t.create({
202
+ this.config = { ...tr, ...t }, this.endpointBuilder = new rr(this.config.endpoints), this.axiosInstance = zt.create({
203
203
  baseURL: this.config.baseUrl,
204
204
  timeout: this.config.timeout,
205
205
  headers: {
@@ -1894,22 +1894,22 @@ class Er {
1894
1894
  return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1895
1895
  }
1896
1896
  }
1897
- const Et = zt(null), An = ({ config: e, children: t }) => {
1897
+ const Et = $t(null), An = ({ config: e, children: t }) => {
1898
1898
  const [n, a] = w(null), s = Ae.useRef(!1), l = Ae.useRef(!1), d = Re(() => {
1899
- const y = new nr(e), p = new ar(y), S = new ir(y), T = new sr(y), I = new or(y), P = new lr(y), f = new cr(y), v = new dr(y), E = new ur(y), U = new mr(y), H = new xr(y), M = new Er();
1899
+ const y = new nr(e), p = new ar(y), S = new ir(y), T = new sr(y), F = new or(y), P = new lr(y), f = new cr(y), v = new dr(y), C = new ur(y), U = new mr(y), H = new xr(y), D = new Er();
1900
1900
  return {
1901
1901
  httpClient: y,
1902
1902
  applicantService: p,
1903
1903
  questionnaireService: S,
1904
1904
  uploadDocumentService: T,
1905
- appropriatenessTestService: I,
1905
+ appropriatenessTestService: F,
1906
1906
  overviewService: P,
1907
1907
  riskScoringService: f,
1908
1908
  identityService: v,
1909
- baseInformationService: E,
1909
+ baseInformationService: C,
1910
1910
  investorCategorizationService: U,
1911
1911
  themeService: H,
1912
- themeManager: M
1912
+ themeManager: D
1913
1913
  };
1914
1914
  }, [e]), m = Re(() => ({
1915
1915
  config: e,
@@ -2043,17 +2043,17 @@ function Mr(e) {
2043
2043
  ye(() => {
2044
2044
  y.current || (y.current = t());
2045
2045
  }, [t]), ye(() => {
2046
- var M;
2046
+ var D;
2047
2047
  n && p && (Ar(p), Tr({
2048
2048
  applicantId: p,
2049
- currentStepOrder: (M = n.currentStep) == null ? void 0 : M.order,
2049
+ currentStepOrder: (D = n.currentStep) == null ? void 0 : D.order,
2050
2050
  status: n.status,
2051
2051
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
2052
2052
  workflowKey: n.workFlowKey,
2053
2053
  nextWorkflowKey: n.nextWorkflowKey
2054
2054
  }));
2055
2055
  }, [n, p]);
2056
- const S = ce(!1), T = ce(!1), I = ee(async () => {
2056
+ const S = ce(!1), T = ce(!1), F = ee(async () => {
2057
2057
  if (!(!p || !y.current)) {
2058
2058
  if (S.current) {
2059
2059
  console.log("[Workflow] Load already in progress, skipping...");
@@ -2061,18 +2061,18 @@ function Mr(e) {
2061
2061
  }
2062
2062
  S.current = !0, l(!0), m(null);
2063
2063
  try {
2064
- const M = await y.current.initialize(p);
2065
- a(M), T.current = !0;
2066
- } catch (M) {
2067
- m(M);
2064
+ const D = await y.current.initialize(p);
2065
+ a(D), T.current = !0;
2066
+ } catch (D) {
2067
+ m(D);
2068
2068
  } finally {
2069
2069
  l(!1), S.current = !1;
2070
2070
  }
2071
2071
  }
2072
2072
  }, [p]);
2073
2073
  ye(() => {
2074
- p && !T.current && I();
2075
- }, [p, I]);
2074
+ p && !T.current && F();
2075
+ }, [p, F]);
2076
2076
  const P = ee(async () => {
2077
2077
  if (y.current) {
2078
2078
  if (S.current) {
@@ -2081,10 +2081,10 @@ function Mr(e) {
2081
2081
  }
2082
2082
  S.current = !0, l(!0), m(null);
2083
2083
  try {
2084
- const M = await y.current.refreshProgress();
2085
- a(M);
2086
- } catch (M) {
2087
- m(M);
2084
+ const D = await y.current.refreshProgress();
2085
+ a(D);
2086
+ } catch (D) {
2087
+ m(D);
2088
2088
  } finally {
2089
2089
  l(!1), S.current = !1;
2090
2090
  }
@@ -2093,10 +2093,10 @@ function Mr(e) {
2093
2093
  if (y.current) {
2094
2094
  l(!0), m(null);
2095
2095
  try {
2096
- const M = await y.current.moveToNextStep();
2097
- a(M);
2098
- } catch (M) {
2099
- m(M);
2096
+ const D = await y.current.moveToNextStep();
2097
+ a(D);
2098
+ } catch (D) {
2099
+ m(D);
2100
2100
  } finally {
2101
2101
  l(!1);
2102
2102
  }
@@ -2105,19 +2105,19 @@ function Mr(e) {
2105
2105
  if (y.current) {
2106
2106
  l(!0), m(null);
2107
2107
  try {
2108
- const M = await y.current.moveToPreviousStep();
2109
- a(M);
2110
- } catch (M) {
2111
- m(M);
2108
+ const D = await y.current.moveToPreviousStep();
2109
+ a(D);
2110
+ } catch (D) {
2111
+ m(D);
2112
2112
  } finally {
2113
2113
  l(!1);
2114
2114
  }
2115
2115
  }
2116
- }, []), E = ee(async (M) => {
2116
+ }, []), C = ee(async (D) => {
2117
2117
  if (y.current) {
2118
2118
  l(!0), m(null);
2119
2119
  try {
2120
- await y.current.submitCurrentStep(M);
2120
+ await y.current.submitCurrentStep(D);
2121
2121
  const B = await y.current.refreshProgress();
2122
2122
  a(B);
2123
2123
  } catch (B) {
@@ -2126,7 +2126,7 @@ function Mr(e) {
2126
2126
  l(!1);
2127
2127
  }
2128
2128
  }
2129
- }, []), U = xt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, B) => M.order - B.order) : [], [n == null ? void 0 : n.stepInfoList]), H = xt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2129
+ }, []), U = xt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((D, B) => D.order - B.order) : [], [n == null ? void 0 : n.stepInfoList]), H = xt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2130
2130
  return {
2131
2131
  progress: n,
2132
2132
  applicantId: p,
@@ -2144,38 +2144,38 @@ function Mr(e) {
2144
2144
  refreshProgress: P,
2145
2145
  moveToNext: f,
2146
2146
  moveBack: v,
2147
- submitCurrentStep: E,
2147
+ submitCurrentStep: C,
2148
2148
  orchestrator: y.current
2149
2149
  };
2150
2150
  }
2151
2151
  function Or(e) {
2152
- const { questionnaireService: t, applicantService: n } = Fe(), [a, s] = w(null), [l, d] = w({}), [m, y] = w(!1), [p, S] = w(!1), [T, I] = w(null), P = ce(!1), f = ce(null), v = ee(async () => {
2152
+ const { questionnaireService: t, applicantService: n } = Fe(), [a, s] = w(null), [l, d] = w({}), [m, y] = w(!1), [p, S] = w(!1), [T, F] = w(null), P = ce(!1), f = ce(null), v = ee(async () => {
2153
2153
  var U, H;
2154
2154
  if (e) {
2155
2155
  if (P.current) {
2156
2156
  console.log("[Questionnaire] Load already in progress, skipping...");
2157
2157
  return;
2158
2158
  }
2159
- P.current = !0, y(!0), I(null);
2159
+ P.current = !0, y(!0), F(null);
2160
2160
  try {
2161
- const [M, B] = await Promise.all([
2161
+ const [D, B] = await Promise.all([
2162
2162
  t.getQuestionnaire(e),
2163
2163
  n.getApplicantData(e).catch(() => null)
2164
2164
  ]);
2165
- if (s(M), (U = B == null ? void 0 : B.questionnaireResults) != null && U.length && M) {
2165
+ if (s(D), (U = B == null ? void 0 : B.questionnaireResults) != null && U.length && D) {
2166
2166
  const V = /* @__PURE__ */ new Map();
2167
2167
  for (const A of B.questionnaireResults)
2168
2168
  A.question && ((H = A.answers) != null && H.length) && V.set(A.question.trim().toLowerCase(), A.answers);
2169
- const ne = {}, F = M.questionGroups.flatMap((A) => A.questions ?? []);
2170
- for (const A of F) {
2169
+ const ne = {}, E = D.questionGroups.flatMap((A) => A.questions ?? []);
2170
+ for (const A of E) {
2171
2171
  const W = A.text.trim().toLowerCase();
2172
2172
  V.has(W) && (ne[A.id] = V.get(W));
2173
2173
  }
2174
2174
  d(ne);
2175
2175
  }
2176
2176
  f.current = e;
2177
- } catch (M) {
2178
- I(M);
2177
+ } catch (D) {
2178
+ F(D);
2179
2179
  } finally {
2180
2180
  y(!1), P.current = !1;
2181
2181
  }
@@ -2184,13 +2184,13 @@ function Or(e) {
2184
2184
  ye(() => {
2185
2185
  e && f.current !== e && v();
2186
2186
  }, [e]);
2187
- const E = ee(
2187
+ const C = ee(
2188
2188
  async (U) => {
2189
- S(!0), I(null);
2189
+ S(!0), F(null);
2190
2190
  try {
2191
2191
  return await t.fillQuestionnaire(U);
2192
2192
  } catch (H) {
2193
- throw I(H), H;
2193
+ throw F(H), H;
2194
2194
  } finally {
2195
2195
  S(!1);
2196
2196
  }
@@ -2204,24 +2204,24 @@ function Or(e) {
2204
2204
  isSubmitting: p,
2205
2205
  error: T,
2206
2206
  load: v,
2207
- submit: E
2207
+ submit: C
2208
2208
  };
2209
2209
  }
2210
- function $r(e) {
2211
- const { uploadDocumentService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(0), [S, T] = w(null), I = ce(!1), P = ce(null), f = ee(async () => {
2210
+ function zr(e) {
2211
+ const { uploadDocumentService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(0), [S, T] = w(null), F = ce(!1), P = ce(null), f = ee(async () => {
2212
2212
  if (e) {
2213
- if (I.current) {
2213
+ if (F.current) {
2214
2214
  console.log("[UploadDocument] Load already in progress, skipping...");
2215
2215
  return;
2216
2216
  }
2217
- I.current = !0, l(!0), T(null);
2217
+ F.current = !0, l(!0), T(null);
2218
2218
  try {
2219
- const E = await t.getUploadDocument(e);
2220
- a(E), P.current = e;
2221
- } catch (E) {
2222
- T(E);
2219
+ const C = await t.getUploadDocument(e);
2220
+ a(C), P.current = e;
2221
+ } catch (C) {
2222
+ T(C);
2223
2223
  } finally {
2224
- l(!1), I.current = !1;
2224
+ l(!1), F.current = !1;
2225
2225
  }
2226
2226
  }
2227
2227
  }, [e, t]);
@@ -2229,10 +2229,10 @@ function $r(e) {
2229
2229
  e && P.current !== e && f();
2230
2230
  }, [e]);
2231
2231
  const v = ee(
2232
- async (E) => {
2232
+ async (C) => {
2233
2233
  m(!0), p(0), T(null);
2234
2234
  try {
2235
- await t.fillUploadDocument(E), p(100);
2235
+ await t.fillUploadDocument(C), p(100);
2236
2236
  } catch (U) {
2237
2237
  throw T(U), U;
2238
2238
  } finally {
@@ -2252,20 +2252,20 @@ function $r(e) {
2252
2252
  };
2253
2253
  }
2254
2254
  function On(e) {
2255
- const { appropriatenessTestService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(null), [S, T] = w(null), I = ce(!1), P = ce(null), f = ee(async () => {
2255
+ const { appropriatenessTestService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(null), [S, T] = w(null), F = ce(!1), P = ce(null), f = ee(async () => {
2256
2256
  if (e) {
2257
- if (I.current) {
2257
+ if (F.current) {
2258
2258
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
2259
2259
  return;
2260
2260
  }
2261
- I.current = !0, l(!0), p(null);
2261
+ F.current = !0, l(!0), p(null);
2262
2262
  try {
2263
- const E = await t.getAppropriatenessTest(e);
2264
- a(E), P.current = e;
2265
- } catch (E) {
2266
- p(E);
2263
+ const C = await t.getAppropriatenessTest(e);
2264
+ a(C), P.current = e;
2265
+ } catch (C) {
2266
+ p(C);
2267
2267
  } finally {
2268
- l(!1), I.current = !1;
2268
+ l(!1), F.current = !1;
2269
2269
  }
2270
2270
  }
2271
2271
  }, [e, t]);
@@ -2273,10 +2273,10 @@ function On(e) {
2273
2273
  e && P.current !== e && f();
2274
2274
  }, [e]);
2275
2275
  const v = ee(
2276
- async (E) => {
2276
+ async (C) => {
2277
2277
  m(!0), p(null);
2278
2278
  try {
2279
- const U = await t.fillAppropriatenessTest(E);
2279
+ const U = await t.fillAppropriatenessTest(C);
2280
2280
  return T(U), U;
2281
2281
  } catch (U) {
2282
2282
  throw p(U), U;
@@ -2296,8 +2296,8 @@ function On(e) {
2296
2296
  submit: v
2297
2297
  };
2298
2298
  }
2299
- function zr(e) {
2300
- const { overviewService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(null), S = ce(!1), T = ce(null), I = ee(async () => {
2299
+ function $r(e) {
2300
+ const { overviewService: t } = Fe(), [n, a] = w(null), [s, l] = w(!1), [d, m] = w(!1), [y, p] = w(null), S = ce(!1), T = ce(null), F = ee(async () => {
2301
2301
  if (e) {
2302
2302
  if (S.current) {
2303
2303
  console.log("[Overview] Load already in progress, skipping...");
@@ -2315,7 +2315,7 @@ function zr(e) {
2315
2315
  }
2316
2316
  }, [e, t]);
2317
2317
  ye(() => {
2318
- e && T.current !== e && I();
2318
+ e && T.current !== e && F();
2319
2319
  }, [e]);
2320
2320
  const P = ee(async () => {
2321
2321
  if (e) {
@@ -2334,7 +2334,7 @@ function zr(e) {
2334
2334
  isLoading: s,
2335
2335
  isSubmitting: d,
2336
2336
  error: y,
2337
- load: I,
2337
+ load: F,
2338
2338
  passOverview: P
2339
2339
  };
2340
2340
  }
@@ -2342,7 +2342,7 @@ function Br(e) {
2342
2342
  const { identityService: t } = Fe(), [n, a] = w(
2343
2343
  null
2344
2344
  ), [s, l] = w(!1), [d, m] = w(null), y = ce(!1), p = ee(
2345
- async (I, P) => {
2345
+ async (F, P) => {
2346
2346
  if (e) {
2347
2347
  if (y.current) {
2348
2348
  console.log("[Identity] Request already in progress, skipping...");
@@ -2353,7 +2353,7 @@ function Br(e) {
2353
2353
  const f = {
2354
2354
  applicantId: e,
2355
2355
  restart: !1,
2356
- redirectUrl: I || "",
2356
+ redirectUrl: F || "",
2357
2357
  ttl: P || 604800
2358
2358
  // Default: 7 days
2359
2359
  };
@@ -2369,14 +2369,14 @@ function Br(e) {
2369
2369
  },
2370
2370
  [e, t]
2371
2371
  ), S = ee(
2372
- async (I, P) => {
2372
+ async (F, P) => {
2373
2373
  if (e) {
2374
2374
  l(!0), m(null);
2375
2375
  try {
2376
2376
  const f = {
2377
2377
  applicantId: e,
2378
2378
  restart: !1,
2379
- redirectUrl: I,
2379
+ redirectUrl: F,
2380
2380
  ttl: P
2381
2381
  }, v = await t.identityCompanyRequest(f);
2382
2382
  return a(v), v;
@@ -2396,18 +2396,18 @@ function Br(e) {
2396
2396
  }
2397
2397
  y.current = !0, l(!0), m(null);
2398
2398
  try {
2399
- const I = {
2399
+ const F = {
2400
2400
  applicantId: e,
2401
2401
  restart: !0,
2402
2402
  redirectUrl: "",
2403
2403
  ttl: 604800
2404
2404
  // 7 days
2405
2405
  };
2406
- console.log("Restarting identity with input:", I);
2407
- const P = await t.identityRequest(I);
2406
+ console.log("Restarting identity with input:", F);
2407
+ const P = await t.identityRequest(F);
2408
2408
  return console.log("Restart identity result:", P), a(P), P;
2409
- } catch (I) {
2410
- throw m(I), I;
2409
+ } catch (F) {
2410
+ throw m(F), F;
2411
2411
  } finally {
2412
2412
  l(!1), y.current = !1;
2413
2413
  }
@@ -2425,49 +2425,49 @@ function Br(e) {
2425
2425
  };
2426
2426
  }
2427
2427
  function _r(e) {
2428
- const { riskScoringService: t, applicantService: n } = Fe(), [a, s] = w(null), [l, d] = w({}), [m, y] = w(!1), [p, S] = w(!1), [T, I] = w(null), [P, f] = w(null), v = ce(!1), E = ce(null), U = ee(async () => {
2429
- var M;
2428
+ const { riskScoringService: t, applicantService: n } = Fe(), [a, s] = w(null), [l, d] = w({}), [m, y] = w(!1), [p, S] = w(!1), [T, F] = w(null), [P, f] = w(null), v = ce(!1), C = ce(null), U = ee(async () => {
2429
+ var D;
2430
2430
  if (e) {
2431
2431
  if (v.current) {
2432
2432
  console.log("[RiskScoring] Load already in progress, skipping...");
2433
2433
  return;
2434
2434
  }
2435
- v.current = !0, y(!0), I(null);
2435
+ v.current = !0, y(!0), F(null);
2436
2436
  try {
2437
2437
  const [B, V] = await Promise.all([
2438
2438
  t.getRiskCriterias(e),
2439
2439
  n.getApplicantData(e).catch(() => null)
2440
2440
  ]);
2441
- if (s(B), (M = V == null ? void 0 : V.riskScoringResults) != null && M.length) {
2442
- const ne = V.riskScoringResults[0], F = {};
2441
+ if (s(B), (D = V == null ? void 0 : V.riskScoringResults) != null && D.length) {
2442
+ const ne = V.riskScoringResults[0], E = {};
2443
2443
  for (const A of ne.riskCriteriaResults ?? [])
2444
2444
  if (A.riskCriteriaId != null && A.answer != null && A.answer !== "") {
2445
2445
  const W = [...new Set(
2446
2446
  A.answer.split(",").map((K) => K.trim()).filter((K) => K !== "")
2447
2447
  )];
2448
- W.length > 0 && (F[A.riskCriteriaId] = W);
2448
+ W.length > 0 && (E[A.riskCriteriaId] = W);
2449
2449
  }
2450
- d(F);
2450
+ d(E);
2451
2451
  }
2452
- E.current = e;
2452
+ C.current = e;
2453
2453
  } catch (B) {
2454
- I(B);
2454
+ F(B);
2455
2455
  } finally {
2456
2456
  y(!1), v.current = !1;
2457
2457
  }
2458
2458
  }
2459
2459
  }, [e, t, n]);
2460
2460
  ye(() => {
2461
- e && E.current !== e && U();
2461
+ e && C.current !== e && U();
2462
2462
  }, [e]);
2463
2463
  const H = ee(
2464
- async (M) => {
2465
- S(!0), I(null);
2464
+ async (D) => {
2465
+ S(!0), F(null);
2466
2466
  try {
2467
- const B = await t.submitRiskScoring(M);
2467
+ const B = await t.submitRiskScoring(D);
2468
2468
  return f(B), B;
2469
2469
  } catch (B) {
2470
- throw I(B), B;
2470
+ throw F(B), B;
2471
2471
  } finally {
2472
2472
  S(!1);
2473
2473
  }
@@ -2497,10 +2497,10 @@ function Rt() {
2497
2497
  d.current = !0, a(!0), l(null);
2498
2498
  try {
2499
2499
  if (P.applicantAdditionalDatas || (P.applicantAdditionalDatas = []), (f = t.identityProviders) != null && f.sardinai) {
2500
- const E = y();
2501
- console.log("[SardinAI] Generated session key:", E), P.applicantAdditionalDatas.push({
2500
+ const C = y();
2501
+ console.log("[SardinAI] Generated session key:", C), P.applicantAdditionalDatas.push({
2502
2502
  paramName: "sessionKey",
2503
- value: E
2503
+ value: C
2504
2504
  });
2505
2505
  }
2506
2506
  return await e.createApplicant(P);
@@ -2537,7 +2537,7 @@ function Rt() {
2537
2537
  }
2538
2538
  },
2539
2539
  [e]
2540
- ), I = ee(
2540
+ ), F = ee(
2541
2541
  async (P) => {
2542
2542
  a(!0), l(null);
2543
2543
  try {
@@ -2556,7 +2556,7 @@ function Rt() {
2556
2556
  createApplicant: p,
2557
2557
  createCompanyApplicant: S,
2558
2558
  getApplicantData: T,
2559
- stopProgress: I
2559
+ stopProgress: F
2560
2560
  };
2561
2561
  }
2562
2562
  const jr = {
@@ -2862,7 +2862,7 @@ const kt = 280, Ur = ({
2862
2862
  disabled: l = !1,
2863
2863
  required: d = !1
2864
2864
  }) => {
2865
- const [m, y] = w(!1), [p, S] = w(""), [T, I] = w(null), [P, f] = w({
2865
+ const [m, y] = w(!1), [p, S] = w(""), [T, F] = w(null), [P, f] = w({
2866
2866
  bg: "#ffffff",
2867
2867
  borderColor: "#d1d5db",
2868
2868
  textPrimary: "#111827",
@@ -2870,11 +2870,11 @@ const kt = 280, Ur = ({
2870
2870
  primaryColor: "#2563eb",
2871
2871
  primaryLight: "#eff6ff",
2872
2872
  hoverBg: "#f9fafb"
2873
- }), v = ce(null), E = ce(null), U = ce(null), H = ee(() => {
2874
- if (!E.current) return null;
2875
- const L = E.current.getBoundingClientRect(), re = window.innerHeight - L.bottom < kt && L.top > kt;
2873
+ }), v = ce(null), C = ce(null), U = ce(null), H = ee(() => {
2874
+ if (!C.current) return null;
2875
+ const L = C.current.getBoundingClientRect(), re = window.innerHeight - L.bottom < kt && L.top > kt;
2876
2876
  return { top: re ? L.top : L.bottom + 4, left: L.left, width: L.width, openUp: re };
2877
- }, []), M = ee(() => {
2877
+ }, []), D = ee(() => {
2878
2878
  const L = getComputedStyle(document.documentElement), q = (fe, de) => L.getPropertyValue(fe).trim() || de, re = q("--metakyc-input-bg", q("--metakyc-background", "#ffffff"));
2879
2879
  f({
2880
2880
  bg: re,
@@ -2887,10 +2887,10 @@ const kt = 280, Ur = ({
2887
2887
  });
2888
2888
  }, []), B = ee(() => {
2889
2889
  if (l) return;
2890
- M();
2890
+ D();
2891
2891
  const L = H();
2892
- L && I(L), y(!0);
2893
- }, [l, H, M]), V = ee(() => {
2892
+ L && F(L), y(!0);
2893
+ }, [l, H, D]), V = ee(() => {
2894
2894
  y(!1), S("");
2895
2895
  }, []);
2896
2896
  ye(() => {
@@ -2905,7 +2905,7 @@ const kt = 280, Ur = ({
2905
2905
  if (!m) return;
2906
2906
  const L = () => {
2907
2907
  const q = H();
2908
- q && I(q);
2908
+ q && F(q);
2909
2909
  };
2910
2910
  return window.addEventListener("scroll", L, !0), window.addEventListener("resize", L), () => {
2911
2911
  window.removeEventListener("scroll", L, !0), window.removeEventListener("resize", L);
@@ -2913,14 +2913,14 @@ const kt = 280, Ur = ({
2913
2913
  }, [m, H]);
2914
2914
  const ne = a.filter(
2915
2915
  (L) => L.label.toLowerCase().includes(p.toLowerCase())
2916
- ), F = (L) => {
2916
+ ), E = (L) => {
2917
2917
  l || n(t.includes(L) ? t.filter((q) => q !== L) : [...t, L]);
2918
2918
  }, A = (L, q) => {
2919
2919
  q.stopPropagation(), l || n(t.filter((re) => re !== L));
2920
2920
  }, W = (L) => {
2921
2921
  var q;
2922
2922
  return ((q = a.find((re) => re.value === L)) == null ? void 0 : q.label) || L;
2923
- }, { bg: K, borderColor: z, textPrimary: O, textSecondary: _, primaryColor: $, primaryLight: Q, hoverBg: te } = P, oe = m && T && /* @__PURE__ */ i(
2923
+ }, { bg: K, borderColor: $, textPrimary: O, textSecondary: _, primaryColor: z, primaryLight: Q, hoverBg: te } = P, oe = m && T && /* @__PURE__ */ i(
2924
2924
  "div",
2925
2925
  {
2926
2926
  ref: U,
@@ -2934,12 +2934,12 @@ const kt = 280, Ur = ({
2934
2934
  zIndex: 99999,
2935
2935
  borderRadius: "8px",
2936
2936
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
2937
- border: `1px solid ${z}`,
2937
+ border: `1px solid ${$}`,
2938
2938
  backgroundColor: K,
2939
2939
  overflow: "hidden"
2940
2940
  },
2941
2941
  children: [
2942
- /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${z}` }, children: /* @__PURE__ */ r(
2942
+ /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${$}` }, children: /* @__PURE__ */ r(
2943
2943
  "input",
2944
2944
  {
2945
2945
  type: "text",
@@ -2955,7 +2955,7 @@ const kt = 280, Ur = ({
2955
2955
  padding: "6px 8px",
2956
2956
  fontSize: "13px",
2957
2957
  borderRadius: "6px",
2958
- border: `1px solid ${z}`,
2958
+ border: `1px solid ${$}`,
2959
2959
  backgroundColor: K,
2960
2960
  color: O,
2961
2961
  outline: "none",
@@ -2966,7 +2966,7 @@ const kt = 280, Ur = ({
2966
2966
  L.currentTarget.style.backgroundColor = K, L.currentTarget.style.color = O, L.currentTarget.style.borderColor = re, L.currentTarget.style.outline = "none", L.currentTarget.style.boxShadow = `0 0 0 2px ${re}33`;
2967
2967
  },
2968
2968
  onBlur: (L) => {
2969
- L.currentTarget.style.backgroundColor = K, L.currentTarget.style.color = O, L.currentTarget.style.borderColor = z, L.currentTarget.style.outline = "none", L.currentTarget.style.boxShadow = "none";
2969
+ L.currentTarget.style.backgroundColor = K, L.currentTarget.style.color = O, L.currentTarget.style.borderColor = $, L.currentTarget.style.outline = "none", L.currentTarget.style.boxShadow = "none";
2970
2970
  }
2971
2971
  }
2972
2972
  ) }),
@@ -2975,7 +2975,7 @@ const kt = 280, Ur = ({
2975
2975
  return /* @__PURE__ */ i(
2976
2976
  "li",
2977
2977
  {
2978
- onClick: () => F(L.value),
2978
+ onClick: () => E(L.value),
2979
2979
  className: "metakyc-multiselect-option",
2980
2980
  style: {
2981
2981
  display: "flex",
@@ -2985,7 +2985,7 @@ const kt = 280, Ur = ({
2985
2985
  fontSize: "13px",
2986
2986
  cursor: "pointer",
2987
2987
  backgroundColor: q ? Q : "transparent",
2988
- color: q ? $ : O,
2988
+ color: q ? z : O,
2989
2989
  userSelect: "none"
2990
2990
  },
2991
2991
  onMouseEnter: (re) => {
@@ -3001,7 +3001,7 @@ const kt = 280, Ur = ({
3001
3001
  type: "checkbox",
3002
3002
  checked: q,
3003
3003
  readOnly: !0,
3004
- style: { accentColor: $, pointerEvents: "none", flexShrink: 0 }
3004
+ style: { accentColor: z, pointerEvents: "none", flexShrink: 0 }
3005
3005
  }
3006
3006
  ),
3007
3007
  /* @__PURE__ */ r("span", { children: L.label })
@@ -3010,7 +3010,7 @@ const kt = 280, Ur = ({
3010
3010
  L.value
3011
3011
  );
3012
3012
  }) }),
3013
- t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${z}` }, children: /* @__PURE__ */ i(
3013
+ t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${$}` }, children: /* @__PURE__ */ i(
3014
3014
  "button",
3015
3015
  {
3016
3016
  type: "button",
@@ -3043,7 +3043,7 @@ const kt = 280, Ur = ({
3043
3043
  /* @__PURE__ */ i(
3044
3044
  "div",
3045
3045
  {
3046
- ref: E,
3046
+ ref: C,
3047
3047
  onClick: () => m ? V() : B(),
3048
3048
  className: Ie(
3049
3049
  "metakyc-multiselect-trigger",
@@ -3132,7 +3132,7 @@ const kt = 280, Ur = ({
3132
3132
  className: p
3133
3133
  }) => {
3134
3134
  var de;
3135
- const [S, T] = w(!1), [I, P] = w(""), [f, v] = w(null), [E, U] = w({
3135
+ const [S, T] = w(!1), [F, P] = w(""), [f, v] = w(null), [C, U] = w({
3136
3136
  bg: "#ffffff",
3137
3137
  border: "#d1d5db",
3138
3138
  text: "#111827",
@@ -3141,7 +3141,7 @@ const kt = 280, Ur = ({
3141
3141
  primaryLight: "#eff6ff",
3142
3142
  hoverBg: "#f9fafb"
3143
3143
  }), H = ee(() => {
3144
- const D = getComputedStyle(document.documentElement), G = (ue, we) => D.getPropertyValue(ue).trim() || we, ae = G("--metakyc-input-bg", G("--metakyc-background", "#ffffff"));
3144
+ const M = getComputedStyle(document.documentElement), G = (ue, we) => M.getPropertyValue(ue).trim() || we, ae = G("--metakyc-input-bg", G("--metakyc-background", "#ffffff"));
3145
3145
  U({
3146
3146
  bg: ae,
3147
3147
  border: G("--metakyc-input-border", G("--metakyc-border", "#d1d5db")),
@@ -3151,51 +3151,51 @@ const kt = 280, Ur = ({
3151
3151
  primaryLight: G("--metakyc-primary-light", "#eff6ff"),
3152
3152
  hoverBg: G("--metakyc-surface", ae)
3153
3153
  });
3154
- }, []), M = ce(null), B = ce(null), V = ce(null), ne = ce(null), F = ee(() => {
3154
+ }, []), D = ce(null), B = ce(null), V = ce(null), ne = ce(null), E = ee(() => {
3155
3155
  if (!B.current) return null;
3156
- const D = B.current.getBoundingClientRect(), ae = window.innerHeight - D.bottom < wt && D.top > wt;
3156
+ const M = B.current.getBoundingClientRect(), ae = window.innerHeight - M.bottom < wt && M.top > wt;
3157
3157
  return {
3158
- top: ae ? D.top : D.bottom + 4,
3159
- left: D.left,
3160
- width: D.width,
3158
+ top: ae ? M.top : M.bottom + 4,
3159
+ left: M.left,
3160
+ width: M.width,
3161
3161
  openUp: ae
3162
3162
  };
3163
3163
  }, []), A = ee(() => {
3164
3164
  if (m) return;
3165
3165
  H();
3166
- const D = F();
3167
- D && v(D), T(!0);
3168
- }, [m, F, H]), W = ee(() => {
3166
+ const M = E();
3167
+ M && v(M), T(!0);
3168
+ }, [m, E, H]), W = ee(() => {
3169
3169
  T(!1), P("");
3170
3170
  }, []), K = () => S ? W() : A();
3171
3171
  ye(() => {
3172
3172
  if (!S) return;
3173
- const D = (G) => {
3173
+ const M = (G) => {
3174
3174
  var ue, we;
3175
3175
  const ae = G.target;
3176
- !((ue = M.current) != null && ue.contains(ae)) && !((we = V.current) != null && we.contains(ae)) && W();
3176
+ !((ue = D.current) != null && ue.contains(ae)) && !((we = V.current) != null && we.contains(ae)) && W();
3177
3177
  };
3178
- return document.addEventListener("mousedown", D), () => document.removeEventListener("mousedown", D);
3178
+ return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
3179
3179
  }, [S, W]), ye(() => {
3180
3180
  if (!S) return;
3181
- const D = () => {
3182
- const G = F();
3181
+ const M = () => {
3182
+ const G = E();
3183
3183
  G && v(G);
3184
3184
  };
3185
- return window.addEventListener("scroll", D, !0), window.addEventListener("resize", D), () => {
3186
- window.removeEventListener("scroll", D, !0), window.removeEventListener("resize", D);
3185
+ return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), () => {
3186
+ window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
3187
3187
  };
3188
- }, [S, F]), ye(() => {
3188
+ }, [S, E]), ye(() => {
3189
3189
  S && ne.current && setTimeout(() => {
3190
- var D;
3191
- return (D = ne.current) == null ? void 0 : D.focus();
3190
+ var M;
3191
+ return (M = ne.current) == null ? void 0 : M.focus();
3192
3192
  }, 0);
3193
3193
  }, [S]);
3194
- const z = a.filter(
3195
- (D) => D.label.toLowerCase().includes(I.toLowerCase()) || D.value.toLowerCase().includes(I.toLowerCase())
3196
- ), O = (de = a.find((D) => D.value === l)) == null ? void 0 : de.label, _ = (D, G) => {
3197
- m || G || (d(D), W());
3198
- }, { bg: $, border: Q, text: te, textSecondary: oe, primary: L, primaryLight: q, hoverBg: re } = E, fe = S && f && /* @__PURE__ */ i(
3194
+ const $ = a.filter(
3195
+ (M) => M.label.toLowerCase().includes(F.toLowerCase()) || M.value.toLowerCase().includes(F.toLowerCase())
3196
+ ), O = (de = a.find((M) => M.value === l)) == null ? void 0 : de.label, _ = (M, G) => {
3197
+ m || G || (d(M), W());
3198
+ }, { bg: z, border: Q, text: te, textSecondary: oe, primary: L, primaryLight: q, hoverBg: re } = C, fe = S && f && /* @__PURE__ */ i(
3199
3199
  "div",
3200
3200
  {
3201
3201
  ref: V,
@@ -3210,7 +3210,7 @@ const kt = 280, Ur = ({
3210
3210
  borderRadius: "8px",
3211
3211
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
3212
3212
  border: `1px solid ${Q}`,
3213
- backgroundColor: $,
3213
+ backgroundColor: z,
3214
3214
  overflow: "hidden"
3215
3215
  },
3216
3216
  children: [
@@ -3219,10 +3219,10 @@ const kt = 280, Ur = ({
3219
3219
  {
3220
3220
  ref: ne,
3221
3221
  type: "text",
3222
- value: I,
3223
- onChange: (D) => P(D.target.value),
3222
+ value: F,
3223
+ onChange: (M) => P(M.target.value),
3224
3224
  placeholder: "Search...",
3225
- onClick: (D) => D.stopPropagation(),
3225
+ onClick: (M) => M.stopPropagation(),
3226
3226
  className: "metakyc-searchable-select-search w-full",
3227
3227
  style: {
3228
3228
  display: "block",
@@ -3231,17 +3231,17 @@ const kt = 280, Ur = ({
3231
3231
  fontSize: "13px",
3232
3232
  borderRadius: "6px",
3233
3233
  border: `1px solid ${Q}`,
3234
- backgroundColor: $,
3234
+ backgroundColor: z,
3235
3235
  color: te,
3236
3236
  outline: "none",
3237
3237
  boxSizing: "border-box"
3238
3238
  },
3239
- onFocus: (D) => {
3239
+ onFocus: (M) => {
3240
3240
  const G = getComputedStyle(document.documentElement), ae = G.getPropertyValue("--metakyc-input-border-focus").trim() || G.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
3241
- D.currentTarget.style.backgroundColor = $, D.currentTarget.style.color = te, D.currentTarget.style.borderColor = ae, D.currentTarget.style.outline = "none", D.currentTarget.style.boxShadow = `0 0 0 2px ${ae}33`;
3241
+ M.currentTarget.style.backgroundColor = z, M.currentTarget.style.color = te, M.currentTarget.style.borderColor = ae, M.currentTarget.style.outline = "none", M.currentTarget.style.boxShadow = `0 0 0 2px ${ae}33`;
3242
3242
  },
3243
- onBlur: (D) => {
3244
- D.currentTarget.style.backgroundColor = $, D.currentTarget.style.color = te, D.currentTarget.style.borderColor = Q, D.currentTarget.style.outline = "none", D.currentTarget.style.boxShadow = "none";
3243
+ onBlur: (M) => {
3244
+ M.currentTarget.style.backgroundColor = z, M.currentTarget.style.color = te, M.currentTarget.style.borderColor = Q, M.currentTarget.style.outline = "none", M.currentTarget.style.boxShadow = "none";
3245
3245
  }
3246
3246
  }
3247
3247
  ) }),
@@ -3255,31 +3255,31 @@ const kt = 280, Ur = ({
3255
3255
  maxHeight: "208px",
3256
3256
  overflowY: "auto"
3257
3257
  },
3258
- children: z.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: oe }, children: "No results" }) : z.map((D) => {
3259
- const G = D.value === l;
3258
+ children: $.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: oe }, children: "No results" }) : $.map((M) => {
3259
+ const G = M.value === l;
3260
3260
  return /* @__PURE__ */ r(
3261
3261
  "li",
3262
3262
  {
3263
3263
  className: "metakyc-searchable-select-option",
3264
- onClick: () => _(D.value, D.disabled),
3264
+ onClick: () => _(M.value, M.disabled),
3265
3265
  style: {
3266
3266
  padding: "8px 12px",
3267
3267
  fontSize: "13px",
3268
- cursor: D.disabled ? "not-allowed" : "pointer",
3269
- opacity: D.disabled ? 0.4 : 1,
3268
+ cursor: M.disabled ? "not-allowed" : "pointer",
3269
+ opacity: M.disabled ? 0.4 : 1,
3270
3270
  backgroundColor: G ? q : "transparent",
3271
3271
  color: G ? L : te,
3272
3272
  userSelect: "none"
3273
3273
  },
3274
3274
  onMouseEnter: (ae) => {
3275
- !G && !D.disabled && (ae.currentTarget.style.backgroundColor = re);
3275
+ !G && !M.disabled && (ae.currentTarget.style.backgroundColor = re);
3276
3276
  },
3277
3277
  onMouseLeave: (ae) => {
3278
3278
  G || (ae.currentTarget.style.backgroundColor = "transparent");
3279
3279
  },
3280
- children: D.label
3280
+ children: M.label
3281
3281
  },
3282
- D.value
3282
+ M.value
3283
3283
  );
3284
3284
  })
3285
3285
  }
@@ -3291,7 +3291,7 @@ const kt = 280, Ur = ({
3291
3291
  "div",
3292
3292
  {
3293
3293
  className: Ie("w-full metakyc-searchable-select", p),
3294
- ref: M,
3294
+ ref: D,
3295
3295
  children: [
3296
3296
  e && /* @__PURE__ */ i(
3297
3297
  "label",
@@ -3311,8 +3311,8 @@ const kt = 280, Ur = ({
3311
3311
  role: "button",
3312
3312
  tabIndex: m ? -1 : 0,
3313
3313
  onClick: K,
3314
- onKeyDown: (D) => {
3315
- (D.key === "Enter" || D.key === " ") && (D.preventDefault(), K()), D.key === "Escape" && W();
3314
+ onKeyDown: (M) => {
3315
+ (M.key === "Enter" || M.key === " ") && (M.preventDefault(), K()), M.key === "Escape" && W();
3316
3316
  },
3317
3317
  className: Ie(
3318
3318
  "metakyc-searchable-select-trigger",
@@ -3366,29 +3366,29 @@ const Wr = ({
3366
3366
  value: y = [],
3367
3367
  className: p
3368
3368
  }) => {
3369
- const [S, T] = w(!1), [I, P] = w(null), f = ce(null), v = ee((F) => {
3370
- if (!F) return;
3369
+ const [S, T] = w(!1), [F, P] = w(null), f = ce(null), v = ee((E) => {
3370
+ if (!E) return;
3371
3371
  P(null);
3372
- const A = Array.from(F);
3372
+ const A = Array.from(E);
3373
3373
  if (l && A.filter((K) => K.size > l).length > 0) {
3374
3374
  P(`File exceeds the maximum size of ${pt(l)}`);
3375
3375
  return;
3376
3376
  }
3377
3377
  m == null || m(s ? [...y, ...A] : [A[0]]);
3378
- }, [l, s, m, y]), E = ee((F) => {
3379
- F.preventDefault(), F.stopPropagation(), T(!0);
3380
- }, []), U = ee((F) => {
3381
- F.preventDefault(), F.stopPropagation(), T(!1);
3382
- }, []), H = ee((F) => {
3383
- F.preventDefault(), F.stopPropagation(), T(!1), v(F.dataTransfer.files);
3384
- }, [v]), M = () => {
3385
- var F;
3386
- (F = f.current) == null || F.click();
3387
- }, B = (F) => {
3378
+ }, [l, s, m, y]), C = ee((E) => {
3379
+ E.preventDefault(), E.stopPropagation(), T(!0);
3380
+ }, []), U = ee((E) => {
3381
+ E.preventDefault(), E.stopPropagation(), T(!1);
3382
+ }, []), H = ee((E) => {
3383
+ E.preventDefault(), E.stopPropagation(), T(!1), v(E.dataTransfer.files);
3384
+ }, [v]), D = () => {
3385
+ var E;
3386
+ (E = f.current) == null || E.click();
3387
+ }, B = (E) => {
3388
3388
  P(null);
3389
- const A = y.filter((W, K) => K !== F);
3389
+ const A = y.filter((W, K) => K !== E);
3390
3390
  m == null || m(A);
3391
- }, V = n || I, ne = y.length > 0;
3391
+ }, V = n || F, ne = y.length > 0;
3392
3392
  return /* @__PURE__ */ i("div", { className: Ie("metakyc-file-upload", p), style: { width: "100%" }, children: [
3393
3393
  e && /* @__PURE__ */ i("div", { style: { marginBottom: "8px" }, children: [
3394
3394
  /* @__PURE__ */ i(
@@ -3412,8 +3412,8 @@ const Wr = ({
3412
3412
  "div",
3413
3413
  {
3414
3414
  className: "metakyc-file-dropzone",
3415
- onClick: M,
3416
- onDragOver: E,
3415
+ onClick: D,
3416
+ onDragOver: C,
3417
3417
  onDragLeave: U,
3418
3418
  onDrop: H,
3419
3419
  style: {
@@ -3434,8 +3434,8 @@ const Wr = ({
3434
3434
  style: { display: "none" },
3435
3435
  accept: a,
3436
3436
  multiple: s,
3437
- onChange: (F) => {
3438
- v(F.target.files), F.target.value = "";
3437
+ onChange: (E) => {
3438
+ v(E.target.files), E.target.value = "";
3439
3439
  }
3440
3440
  }
3441
3441
  ),
@@ -3493,8 +3493,8 @@ const Wr = ({
3493
3493
  ]
3494
3494
  }
3495
3495
  ),
3496
- ne && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((F, A) => {
3497
- const W = Kr(F), K = W === "image", z = K ? URL.createObjectURL(F) : null;
3496
+ ne && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, A) => {
3497
+ const W = Kr(E), K = W === "image", $ = K ? URL.createObjectURL(E) : null;
3498
3498
  return /* @__PURE__ */ i(
3499
3499
  "div",
3500
3500
  {
@@ -3524,11 +3524,11 @@ const Wr = ({
3524
3524
  overflow: "hidden",
3525
3525
  backgroundColor: K ? "transparent" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 10%, transparent)"
3526
3526
  },
3527
- children: K && z ? /* @__PURE__ */ r(
3527
+ children: K && $ ? /* @__PURE__ */ r(
3528
3528
  "img",
3529
3529
  {
3530
- src: z,
3531
- alt: F.name,
3530
+ src: $,
3531
+ alt: E.name,
3532
3532
  style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
3533
3533
  }
3534
3534
  ) : W === "pdf" ? /* @__PURE__ */ i("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -3552,8 +3552,8 @@ const Wr = ({
3552
3552
  overflow: "hidden",
3553
3553
  textOverflow: "ellipsis",
3554
3554
  whiteSpace: "nowrap"
3555
- }, children: F.name }),
3556
- /* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: pt(F.size) })
3555
+ }, children: E.name }),
3556
+ /* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: pt(E.size) })
3557
3557
  ] }),
3558
3558
  /* @__PURE__ */ r(
3559
3559
  "button",
@@ -3591,7 +3591,7 @@ const Wr = ({
3591
3591
  )
3592
3592
  ]
3593
3593
  },
3594
- `${F.name}-${A}`
3594
+ `${E.name}-${A}`
3595
3595
  );
3596
3596
  }) }),
3597
3597
  V && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: V })
@@ -3820,33 +3820,33 @@ const rn = ({
3820
3820
  onComplete: t,
3821
3821
  onBack: n
3822
3822
  }) => {
3823
- const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: d, error: m, submit: y } = Or(e), [p, S] = w({}), [T, I] = w({}), [P, f] = w(0);
3823
+ const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: d, error: m, submit: y } = Or(e), [p, S] = w({}), [T, F] = w({}), [P, f] = w(0);
3824
3824
  Ae.useEffect(() => {
3825
3825
  s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && S(s);
3826
3826
  }, [s]);
3827
3827
  const v = Re(
3828
3828
  () => a ? tn(a.questionGroups) : [],
3829
3829
  [a]
3830
- ), E = P === v.length - 1, U = v[P] ?? [], H = ee((F, A) => {
3831
- S((W) => ({ ...W, [F]: A })), I((W) => {
3830
+ ), C = P === v.length - 1, U = v[P] ?? [], H = ee((E, A) => {
3831
+ S((W) => ({ ...W, [E]: A })), F((W) => {
3832
3832
  const K = { ...W };
3833
- return delete K[F], K;
3833
+ return delete K[E], K;
3834
3834
  });
3835
- }, []), M = ee(() => {
3836
- const F = {};
3835
+ }, []), D = ee(() => {
3836
+ const E = {};
3837
3837
  for (const { question: A } of U) {
3838
3838
  const W = en(A, p[A.id] ?? []);
3839
- W && (F[A.id] = W);
3839
+ W && (E[A.id] = W);
3840
3840
  }
3841
- return I((A) => ({ ...A, ...F })), Object.keys(F).length === 0;
3841
+ return F((A) => ({ ...A, ...E })), Object.keys(E).length === 0;
3842
3842
  }, [U, p]), B = () => {
3843
- M() && f((F) => F + 1);
3843
+ D() && f((E) => E + 1);
3844
3844
  }, V = () => {
3845
- P > 0 ? f((F) => F - 1) : n == null || n();
3845
+ P > 0 ? f((E) => E - 1) : n == null || n();
3846
3846
  }, ne = async () => {
3847
- if (!(!M() || !a))
3847
+ if (!(!D() || !a))
3848
3848
  try {
3849
- const F = a.questionGroups.flatMap(
3849
+ const E = a.questionGroups.flatMap(
3850
3850
  (W) => (W.questions ?? []).map((K) => ({
3851
3851
  questionId: K.id,
3852
3852
  values: p[K.id] ?? []
@@ -3854,11 +3854,11 @@ const rn = ({
3854
3854
  ), A = {
3855
3855
  applicantId: e,
3856
3856
  questionnarieId: a.id,
3857
- questionResults: F
3857
+ questionResults: E
3858
3858
  };
3859
3859
  await y(A), t == null || t();
3860
- } catch (F) {
3861
- console.error("Questionnaire submit error:", F);
3860
+ } catch (E) {
3861
+ console.error("Questionnaire submit error:", E);
3862
3862
  }
3863
3863
  };
3864
3864
  return l ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ r(Pe, { className: "my-8" }) }) }) : m ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
@@ -3875,7 +3875,7 @@ const rn = ({
3875
3875
  " of ",
3876
3876
  v.length
3877
3877
  ] }),
3878
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: v.map((F, A) => /* @__PURE__ */ r(
3878
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: v.map((E, A) => /* @__PURE__ */ r(
3879
3879
  "div",
3880
3880
  {
3881
3881
  className: "rounded-full transition-all duration-200",
@@ -3889,15 +3889,15 @@ const rn = ({
3889
3889
  )) })
3890
3890
  ] })
3891
3891
  ] }),
3892
- /* @__PURE__ */ r(Z, { className: "space-y-6", children: U.map(({ question: F }) => /* @__PURE__ */ r(
3892
+ /* @__PURE__ */ r(Z, { className: "space-y-6", children: U.map(({ question: E }) => /* @__PURE__ */ r(
3893
3893
  nn,
3894
3894
  {
3895
- question: F,
3896
- value: p[F.id] ?? [],
3897
- error: T[F.id],
3898
- onChange: (A) => H(F.id, A)
3895
+ question: E,
3896
+ value: p[E.id] ?? [],
3897
+ error: T[E.id],
3898
+ onChange: (A) => H(E.id, A)
3899
3899
  },
3900
- F.id
3900
+ E.id
3901
3901
  )) }),
3902
3902
  /* @__PURE__ */ i(ke, { className: "flex items-center justify-between", children: [
3903
3903
  /* @__PURE__ */ i(
@@ -3913,7 +3913,7 @@ const rn = ({
3913
3913
  ]
3914
3914
  }
3915
3915
  ),
3916
- E ? /* @__PURE__ */ r(
3916
+ C ? /* @__PURE__ */ r(
3917
3917
  X,
3918
3918
  {
3919
3919
  type: "button",
@@ -4048,8 +4048,8 @@ const rn = ({
4048
4048
  onComplete: t,
4049
4049
  onBack: n
4050
4050
  }) => {
4051
- const { uploadDocument: a, isLoading: s, isSubmitting: l, error: d, submit: m } = $r(e), [y, p] = w({}), [S, T] = w(null), I = Re(() => a ? a.uploadDocumentFiles.filter((E) => E.isRequired).every((E) => (y[E.id] || []).length > 0) : !1, [a, y]), P = Re(() => a ? a.uploadDocumentFiles.filter((E) => (y[E.id] || []).length > 0).length : 0, [a, y]), f = async (E) => {
4052
- if (E.preventDefault(), T(null), !a) return;
4051
+ const { uploadDocument: a, isLoading: s, isSubmitting: l, error: d, submit: m } = zr(e), [y, p] = w({}), [S, T] = w(null), F = Re(() => a ? a.uploadDocumentFiles.filter((C) => C.isRequired).every((C) => (y[C.id] || []).length > 0) : !1, [a, y]), P = Re(() => a ? a.uploadDocumentFiles.filter((C) => (y[C.id] || []).length > 0).length : 0, [a, y]), f = async (C) => {
4052
+ if (C.preventDefault(), T(null), !a) return;
4053
4053
  const U = a.uploadDocumentFiles.filter(
4054
4054
  (H) => H.isRequired && (y[H.id] || []).length === 0
4055
4055
  );
@@ -4061,9 +4061,9 @@ const rn = ({
4061
4061
  const H = await Promise.all(
4062
4062
  a.uploadDocumentFiles.map(async (B) => {
4063
4063
  const V = y[B.id] || [], ne = await Promise.all(
4064
- V.map(async (F) => ({
4065
- fileName: F.name,
4066
- fileData: await Rr(F)
4064
+ V.map(async (E) => ({
4065
+ fileName: E.name,
4066
+ fileData: await Rr(E)
4067
4067
  }))
4068
4068
  );
4069
4069
  return {
@@ -4071,12 +4071,12 @@ const rn = ({
4071
4071
  valueList: ne
4072
4072
  };
4073
4073
  })
4074
- ), M = {
4074
+ ), D = {
4075
4075
  applicantId: e,
4076
4076
  uploadDocumentId: a.id,
4077
4077
  uploadDocumentResults: H
4078
4078
  };
4079
- await m(M), t == null || t();
4079
+ await m(D), t == null || t();
4080
4080
  } catch (H) {
4081
4081
  T((H == null ? void 0 : H.message) || "Failed to submit documents. Please try again.");
4082
4082
  }
@@ -4143,11 +4143,11 @@ const rn = ({
4143
4143
  fontSize: "13px",
4144
4144
  fontWeight: 500,
4145
4145
  flexShrink: 0,
4146
- backgroundColor: I ? "color-mix(in srgb, var(--metakyc-success, #10b981) 10%, transparent)" : "var(--metakyc-surface, #f3f4f6)",
4147
- color: I ? "var(--metakyc-success, #10b981)" : "var(--metakyc-text-muted, #9ca3af)",
4146
+ backgroundColor: F ? "color-mix(in srgb, var(--metakyc-success, #10b981) 10%, transparent)" : "var(--metakyc-surface, #f3f4f6)",
4147
+ color: F ? "var(--metakyc-success, #10b981)" : "var(--metakyc-text-muted, #9ca3af)",
4148
4148
  transition: "all 0.2s ease"
4149
4149
  }, children: [
4150
- I ? /* @__PURE__ */ r("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r("polyline", { points: "20 6 9 17 4 12" }) }) : null,
4150
+ F ? /* @__PURE__ */ r("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r("polyline", { points: "20 6 9 17 4 12" }) }) : null,
4151
4151
  P,
4152
4152
  "/",
4153
4153
  v
@@ -4188,22 +4188,52 @@ const rn = ({
4188
4188
  }, children: a.description })
4189
4189
  ] })
4190
4190
  ] }),
4191
- /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: a.uploadDocumentFiles.map((E) => /* @__PURE__ */ r(
4192
- Wr,
4193
- {
4194
- label: E.displayName,
4195
- subtitle: E.subtitle,
4196
- accept: E.allowedTypes,
4197
- multiple: E.multipleFile,
4198
- maxSize: E.maxEachFileSizeByte,
4199
- required: E.isRequired,
4200
- value: y[E.id] || [],
4201
- onChange: (U) => {
4202
- T(null), p((H) => ({ ...H, [E.id]: U }));
4191
+ /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: a.uploadDocumentFiles.map((C, U) => /* @__PURE__ */ i("div", { children: [
4192
+ /* @__PURE__ */ i("div", { style: {
4193
+ display: "flex",
4194
+ alignItems: "center",
4195
+ gap: "8px",
4196
+ marginBottom: "10px"
4197
+ }, children: [
4198
+ /* @__PURE__ */ r("span", { style: {
4199
+ display: "inline-flex",
4200
+ alignItems: "center",
4201
+ justifyContent: "center",
4202
+ width: "24px",
4203
+ height: "24px",
4204
+ borderRadius: "6px",
4205
+ fontSize: "12px",
4206
+ fontWeight: 600,
4207
+ backgroundColor: (y[C.id] || []).length > 0 ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-surface, #f3f4f6)",
4208
+ color: (y[C.id] || []).length > 0 ? "#ffffff" : "var(--metakyc-text-muted, #9ca3af)",
4209
+ transition: "all 0.2s ease",
4210
+ flexShrink: 0
4211
+ }, children: C.pageNumber ?? U + 1 }),
4212
+ /* @__PURE__ */ i("span", { style: {
4213
+ fontSize: "13px",
4214
+ fontWeight: 500,
4215
+ color: "var(--metakyc-text-secondary, #6b7280)"
4216
+ }, children: [
4217
+ "Page ",
4218
+ C.pageNumber ?? U + 1
4219
+ ] })
4220
+ ] }),
4221
+ /* @__PURE__ */ r(
4222
+ Wr,
4223
+ {
4224
+ label: C.displayName,
4225
+ subtitle: C.subtitle,
4226
+ accept: C.allowedTypes,
4227
+ multiple: C.multipleFile,
4228
+ maxSize: C.maxEachFileSizeByte,
4229
+ required: C.isRequired,
4230
+ value: y[C.id] || [],
4231
+ onChange: (H) => {
4232
+ T(null), p((D) => ({ ...D, [C.id]: H }));
4233
+ }
4203
4234
  }
4204
- },
4205
- E.id
4206
- )) }) }),
4235
+ )
4236
+ ] }, C.id)) }) }),
4207
4237
  S && /* @__PURE__ */ i("div", { style: {
4208
4238
  margin: "0 24px",
4209
4239
  padding: "10px 14px",
@@ -4233,9 +4263,9 @@ const rn = ({
4233
4263
  {
4234
4264
  type: "submit",
4235
4265
  isLoading: l,
4236
- disabled: !I,
4266
+ disabled: !F,
4237
4267
  style: {
4238
- opacity: I ? 1 : 0.5
4268
+ opacity: F ? 1 : 0.5
4239
4269
  },
4240
4270
  children: l ? "Uploading..." : "Continue"
4241
4271
  }
@@ -4243,7 +4273,7 @@ const rn = ({
4243
4273
  ] }) })
4244
4274
  ] }) });
4245
4275
  }, sn = ({ applicantId: e, onComplete: t, onBack: n }) => {
4246
- const { overview: a, isLoading: s, isSubmitting: l, error: d, passOverview: m } = zr(e), y = async () => {
4276
+ const { overview: a, isLoading: s, isSubmitting: l, error: d, passOverview: m } = $r(e), y = async () => {
4247
4277
  await m(), t == null || t();
4248
4278
  };
4249
4279
  return s ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ r(Pe, { className: "my-8" }) }) }) : d ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
@@ -4295,7 +4325,7 @@ function on(e) {
4295
4325
  }
4296
4326
  }
4297
4327
  function ln(e) {
4298
- return e.valueDataType === ze.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
4328
+ return e.valueDataType === $e.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
4299
4329
  }
4300
4330
  function cn(e, t) {
4301
4331
  const n = new Intl.NumberFormat(on(t), {
@@ -4319,7 +4349,7 @@ function dn(e, t) {
4319
4349
  return e.errorMessage || "Invalid format";
4320
4350
  } catch {
4321
4351
  }
4322
- const s = e.valueDataType === ze.Integer || e.valueDataType === ze.Money || e.valueDataType === ze.DigitOnly;
4352
+ const s = e.valueDataType === $e.Integer || e.valueDataType === $e.Money || e.valueDataType === $e.DigitOnly;
4323
4353
  if (s && a.trim() !== "") {
4324
4354
  const l = Number(a);
4325
4355
  if (!isNaN(l)) {
@@ -4352,43 +4382,43 @@ const pn = ({
4352
4382
  onComplete: t,
4353
4383
  onBack: n
4354
4384
  }) => {
4355
- const { config: a } = Fe(), s = a.locale ?? "en", { criteria: l, initialAnswers: d, isLoading: m, isSubmitting: y, error: p, submit: S } = _r(e), [T, I] = w({}), [P, f] = w({}), [v, E] = w(0), [U, H] = w(!1);
4385
+ const { config: a } = Fe(), s = a.locale ?? "en", { criteria: l, initialAnswers: d, isLoading: m, isSubmitting: y, error: p, submit: S } = _r(e), [T, F] = w({}), [P, f] = w({}), [v, C] = w(0), [U, H] = w(!1);
4356
4386
  Ae.useEffect(() => {
4357
- d && Object.keys(d).length > 0 && Object.keys(T).length === 0 && I(d);
4387
+ d && Object.keys(d).length > 0 && Object.keys(T).length === 0 && F(d);
4358
4388
  }, [d]);
4359
- const M = Re(
4389
+ const D = Re(
4360
4390
  () => l && l.length > 0 ? un(l) : [],
4361
4391
  [l]
4362
- ), B = v === M.length - 1, V = M[v] ?? [];
4392
+ ), B = v === D.length - 1, V = D[v] ?? [];
4363
4393
  Ae.useEffect(() => {
4364
4394
  !m && l && l.length === 0 && !U && !y && (H(!0), S({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
4365
4395
  }, [m, l, U, y, S, e, t]);
4366
- const ne = ee((z, O) => {
4367
- I((_) => ({ ..._, [z]: O })), f((_) => {
4368
- const $ = { ..._ };
4369
- return delete $[z], $;
4396
+ const ne = ee(($, O) => {
4397
+ F((_) => ({ ..._, [$]: O })), f((_) => {
4398
+ const z = { ..._ };
4399
+ return delete z[$], z;
4370
4400
  });
4371
- }, []), F = ee(() => {
4372
- const z = {};
4401
+ }, []), E = ee(() => {
4402
+ const $ = {};
4373
4403
  for (const { criterion: O } of V) {
4374
4404
  const _ = dn(O, T[O.id] ?? []);
4375
- _ && (z[O.id] = _);
4405
+ _ && ($[O.id] = _);
4376
4406
  }
4377
- return f((O) => ({ ...O, ...z })), Object.keys(z).length === 0;
4407
+ return f((O) => ({ ...O, ...$ })), Object.keys($).length === 0;
4378
4408
  }, [V, T]), A = () => {
4379
- F() && E((z) => z + 1);
4409
+ E() && C(($) => $ + 1);
4380
4410
  }, W = () => {
4381
- v > 0 ? E((z) => z - 1) : n == null || n();
4411
+ v > 0 ? C(($) => $ - 1) : n == null || n();
4382
4412
  }, K = async () => {
4383
- if (!(!F() || !l))
4413
+ if (!(!E() || !l))
4384
4414
  try {
4385
- const z = l.map((_) => {
4386
- const $ = (T[_.id] ?? []).filter((Q) => Q && Q.trim());
4387
- return $.length > 0 ? { riskCriteriaId: _.id, values: $ } : null;
4415
+ const $ = l.map((_) => {
4416
+ const z = (T[_.id] ?? []).filter((Q) => Q && Q.trim());
4417
+ return z.length > 0 ? { riskCriteriaId: _.id, values: z } : null;
4388
4418
  }).filter((_) => _ !== null);
4389
- await S({ applicantId: e, criteriaValueInputs: z }), t == null || t();
4390
- } catch (z) {
4391
- console.error("Risk scoring submit error:", z);
4419
+ await S({ applicantId: e, criteriaValueInputs: $ }), t == null || t();
4420
+ } catch ($) {
4421
+ console.error("Risk scoring submit error:", $);
4392
4422
  }
4393
4423
  };
4394
4424
  return m ? /* @__PURE__ */ r(J, { children: /* @__PURE__ */ i(Z, { children: [
@@ -4404,14 +4434,14 @@ const pn = ({
4404
4434
  /* @__PURE__ */ i(ve, { children: [
4405
4435
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
4406
4436
  /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
4407
- M.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
4437
+ D.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
4408
4438
  /* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
4409
4439
  "Page ",
4410
4440
  v + 1,
4411
4441
  " of ",
4412
- M.length
4442
+ D.length
4413
4443
  ] }),
4414
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: M.map((z, O) => /* @__PURE__ */ r(
4444
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: D.map(($, O) => /* @__PURE__ */ r(
4415
4445
  "div",
4416
4446
  {
4417
4447
  className: "rounded-full transition-all duration-200",
@@ -4425,16 +4455,16 @@ const pn = ({
4425
4455
  )) })
4426
4456
  ] })
4427
4457
  ] }),
4428
- /* @__PURE__ */ r(Z, { className: "space-y-6", children: V.map(({ criterion: z }) => /* @__PURE__ */ r(
4458
+ /* @__PURE__ */ r(Z, { className: "space-y-6", children: V.map(({ criterion: $ }) => /* @__PURE__ */ r(
4429
4459
  yn,
4430
4460
  {
4431
- criterion: z,
4432
- value: T[z.id] ?? [],
4433
- error: P[z.id],
4461
+ criterion: $,
4462
+ value: T[$.id] ?? [],
4463
+ error: P[$.id],
4434
4464
  locale: s,
4435
- onChange: (O) => ne(z.id, O)
4465
+ onChange: (O) => ne($.id, O)
4436
4466
  },
4437
- z.id
4467
+ $.id
4438
4468
  )) }),
4439
4469
  /* @__PURE__ */ i(ke, { className: "flex items-center justify-between", children: [
4440
4470
  /* @__PURE__ */ i(
@@ -4466,7 +4496,7 @@ const pn = ({
4466
4496
  p && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: p.message }) })
4467
4497
  ] }) : null;
4468
4498
  }, yn = ({ criterion: e, value: t, error: n, locale: a, onChange: s }) => {
4469
- const l = mn(e), d = e.valueDataType === ze.Integer || e.valueDataType === ze.Money || e.valueDataType === ze.DigitOnly, m = ln(e), y = (p) => m ? cn(p, a) : p;
4499
+ const l = mn(e), d = e.valueDataType === $e.Integer || e.valueDataType === $e.Money || e.valueDataType === $e.DigitOnly, m = ln(e), y = (p) => m ? cn(p, a) : p;
4470
4500
  return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
4471
4501
  /* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
4472
4502
  e.displayName,
@@ -4486,7 +4516,7 @@ const pn = ({
4486
4516
  min: e.min,
4487
4517
  max: e.max,
4488
4518
  onKeyDown: (p) => {
4489
- e.valueDataType === ze.DigitOnly && ["e", "E", "+", "-", "."].includes(p.key) && p.preventDefault();
4519
+ e.valueDataType === $e.DigitOnly && ["e", "E", "+", "-", "."].includes(p.key) && p.preventDefault();
4490
4520
  }
4491
4521
  }
4492
4522
  ),
@@ -4595,15 +4625,15 @@ const pn = ({
4595
4625
  }
4596
4626
  m(!0), p(null);
4597
4627
  try {
4598
- const I = {
4628
+ const F = {
4599
4629
  applicantId: e,
4600
4630
  investorType: s
4601
4631
  };
4602
- console.log("Submitting investor categorization:", I);
4603
- const P = await a.setInvestorCategorization(I);
4632
+ console.log("Submitting investor categorization:", F);
4633
+ const P = await a.setInvestorCategorization(F);
4604
4634
  console.log("Investor categorization result:", P), t == null || t();
4605
- } catch (I) {
4606
- console.error("Error submitting investor categorization:", I), p(I.message || "Failed to submit investor categorization");
4635
+ } catch (F) {
4636
+ console.error("Error submitting investor categorization:", F), p(F.message || "Failed to submit investor categorization");
4607
4637
  } finally {
4608
4638
  m(!1);
4609
4639
  }
@@ -4728,44 +4758,44 @@ const pn = ({
4728
4758
  onComplete: t,
4729
4759
  onBack: n
4730
4760
  }) => {
4731
- const { appropriatenessTestService: a } = Fe(), [s, l] = w(null), [d, m] = w(!0), [y, p] = w(!1), [S, T] = w(null), [I, P] = w({}), [f, v] = w(0), [E, U] = w(!1), [H, M] = w(!1), [B, V] = w(0);
4761
+ const { appropriatenessTestService: a } = Fe(), [s, l] = w(null), [d, m] = w(!0), [y, p] = w(!1), [S, T] = w(null), [F, P] = w({}), [f, v] = w(0), [C, U] = w(!1), [H, D] = w(!1), [B, V] = w(0);
4732
4762
  ye(() => {
4733
4763
  (async () => {
4734
4764
  try {
4735
4765
  m(!0), T(null), console.log("Loading appropriateness test for applicant:", e);
4736
- const $ = await a.getAppropriatenessTest(e);
4737
- if (console.log("Appropriateness test data:", $), l($), $.waitTimeSpanForNextTry && $.waitTimeSpanForNextTry !== "00:00:00") {
4738
- const Q = ne($.waitTimeSpanForNextTry);
4766
+ const z = await a.getAppropriatenessTest(e);
4767
+ if (console.log("Appropriateness test data:", z), l(z), z.waitTimeSpanForNextTry && z.waitTimeSpanForNextTry !== "00:00:00") {
4768
+ const Q = ne(z.waitTimeSpanForNextTry);
4739
4769
  Q > 0 && V(Q);
4740
4770
  }
4741
- } catch ($) {
4742
- console.error("Error loading appropriateness test:", $), T($.message || "Failed to load appropriateness test");
4771
+ } catch (z) {
4772
+ console.error("Error loading appropriateness test:", z), T(z.message || "Failed to load appropriateness test");
4743
4773
  } finally {
4744
4774
  m(!1);
4745
4775
  }
4746
4776
  })();
4747
4777
  }, [e, a]);
4748
4778
  const ne = (_) => {
4749
- const $ = _.split(":").map(Number);
4750
- if ($.length === 3) {
4751
- const [Q, te, oe] = $;
4779
+ const z = _.split(":").map(Number);
4780
+ if (z.length === 3) {
4781
+ const [Q, te, oe] = z;
4752
4782
  return Q * 3600 + te * 60 + oe;
4753
4783
  }
4754
4784
  return 0;
4755
- }, F = (_) => {
4756
- const $ = Math.floor(_ / 60), Q = _ % 60;
4757
- return `${$.toString().padStart(2, "0")}:${Q.toString().padStart(2, "0")}`;
4785
+ }, E = (_) => {
4786
+ const z = Math.floor(_ / 60), Q = _ % 60;
4787
+ return `${z.toString().padStart(2, "0")}:${Q.toString().padStart(2, "0")}`;
4758
4788
  };
4759
4789
  ye(() => {
4760
- if (!E || f <= 0) return;
4790
+ if (!C || f <= 0) return;
4761
4791
  const _ = setInterval(() => {
4762
- v(($) => $ <= 1 ? (M(!0), 0) : $ - 1);
4792
+ v((z) => z <= 1 ? (D(!0), 0) : z - 1);
4763
4793
  }, 1e3);
4764
4794
  return () => clearInterval(_);
4765
- }, [E, f]), ye(() => {
4795
+ }, [C, f]), ye(() => {
4766
4796
  if (B <= 0) return;
4767
4797
  const _ = setInterval(() => {
4768
- V(($) => $ <= 1 ? 0 : $ - 1);
4798
+ V((z) => z <= 1 ? 0 : z - 1);
4769
4799
  }, 1e3);
4770
4800
  return () => clearInterval(_);
4771
4801
  }, [B]), ye(() => {
@@ -4773,59 +4803,59 @@ const pn = ({
4773
4803
  }, [H]);
4774
4804
  const A = () => {
4775
4805
  s && (U(!0), v(s.testDurationSec));
4776
- }, W = (_, $) => {
4806
+ }, W = (_, z) => {
4777
4807
  P((Q) => ({
4778
4808
  ...Q,
4779
- [_]: $
4809
+ [_]: z
4780
4810
  }));
4781
4811
  }, K = async (_) => {
4782
4812
  if (_ && _.preventDefault(), !!s) {
4783
4813
  if (!H) {
4784
- const $ = s.appropriatenessQuestions.length - Object.keys(I).length;
4785
- if ($ > 0) {
4786
- T(`Please answer all questions. ${$} question(s) remaining.`);
4814
+ const z = s.appropriatenessQuestions.length - Object.keys(F).length;
4815
+ if (z > 0) {
4816
+ T(`Please answer all questions. ${z} question(s) remaining.`);
4787
4817
  return;
4788
4818
  }
4789
4819
  }
4790
4820
  p(!0), T(null);
4791
4821
  try {
4792
- const $ = s.appropriatenessQuestions.map(
4822
+ const z = s.appropriatenessQuestions.map(
4793
4823
  (te) => ({
4794
4824
  appropriatenessQuestionId: te.id,
4795
- value: I[te.id] || ""
4825
+ value: F[te.id] || ""
4796
4826
  // Empty string if not answered
4797
4827
  })
4798
4828
  ), Q = {
4799
4829
  applicantId: e,
4800
4830
  appropriatenessTestId: s.id,
4801
- appropriatenessQuestionResults: $
4831
+ appropriatenessQuestionResults: z
4802
4832
  };
4803
4833
  console.log("Submitting appropriateness test:", Q);
4804
4834
  try {
4805
4835
  const te = await a.fillAppropriatenessTest(Q);
4806
- console.log("Appropriateness test result:", te), te.message && (te.message.toLowerCase().includes("pass") || te.message.toLowerCase().includes("success") || te.message.toLowerCase().includes("congratulations")) ? t == null || t() : (T(te.message || "Test completed. Please check the result."), U(!1), M(!1), P({}), setTimeout(() => z(), 1e3));
4836
+ console.log("Appropriateness test result:", te), te.message && (te.message.toLowerCase().includes("pass") || te.message.toLowerCase().includes("success") || te.message.toLowerCase().includes("congratulations")) ? t == null || t() : (T(te.message || "Test completed. Please check the result."), U(!1), D(!1), P({}), setTimeout(() => $(), 1e3));
4807
4837
  } catch (te) {
4808
4838
  if (te.code === 400 && te.message) {
4809
4839
  const oe = te.message;
4810
- console.log("Test failed:", oe), T(oe), U(!1), M(!1), P({}), setTimeout(() => z(), 1500);
4840
+ console.log("Test failed:", oe), T(oe), U(!1), D(!1), P({}), setTimeout(() => $(), 1500);
4811
4841
  } else
4812
4842
  throw te;
4813
4843
  }
4814
- } catch ($) {
4815
- console.error("Error submitting appropriateness test:", $), T($.message || "Failed to submit test. Please try again."), U(!1), M(!1), P({});
4844
+ } catch (z) {
4845
+ console.error("Error submitting appropriateness test:", z), T(z.message || "Failed to submit test. Please try again."), U(!1), D(!1), P({});
4816
4846
  } finally {
4817
4847
  p(!1);
4818
4848
  }
4819
4849
  }
4820
- }, z = async () => {
4850
+ }, $ = async () => {
4821
4851
  try {
4822
4852
  const _ = await a.getAppropriatenessTest(e);
4823
4853
  if (console.log("Reloaded test data:", _), l(_), _.waitTimeSpanForNextTry && _.waitTimeSpanForNextTry !== "00:00:00") {
4824
- const $ = ne(_.waitTimeSpanForNextTry);
4825
- $ > 0 && V($);
4854
+ const z = ne(_.waitTimeSpanForNextTry);
4855
+ z > 0 && V(z);
4826
4856
  }
4827
4857
  } catch (_) {
4828
- console.error("Error reloading test data:", _), T(($) => $ + `
4858
+ console.error("Error reloading test data:", _), T((z) => z + `
4829
4859
 
4830
4860
  Failed to reload test data. Please refresh the page.`);
4831
4861
  }
@@ -4848,14 +4878,14 @@ Failed to reload test data. Please refresh the page.`);
4848
4878
  ] }),
4849
4879
  /* @__PURE__ */ i(Z, { className: "py-12 text-center", children: [
4850
4880
  /* @__PURE__ */ i("div", { className: "mb-6", children: [
4851
- /* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: F(B) }),
4881
+ /* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: E(B) }),
4852
4882
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
4853
4883
  ] }),
4854
4884
  S && /* @__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: S }) })
4855
4885
  ] })
4856
4886
  ] });
4857
4887
  const O = s.testAllowedMaxTry - s.totalFailedTries;
4858
- return E ? /* @__PURE__ */ r("form", { onSubmit: K, children: /* @__PURE__ */ i(J, { children: [
4888
+ return C ? /* @__PURE__ */ r("form", { onSubmit: K, children: /* @__PURE__ */ i(J, { children: [
4859
4889
  /* @__PURE__ */ r(ve, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
4860
4890
  /* @__PURE__ */ i("div", { children: [
4861
4891
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
@@ -4866,7 +4896,7 @@ Failed to reload test data. Please refresh the page.`);
4866
4896
  "div",
4867
4897
  {
4868
4898
  className: `text-3xl font-bold ${f <= 60 ? "text-danger-500" : "text-primary-500"}`,
4869
- children: F(f)
4899
+ children: E(f)
4870
4900
  }
4871
4901
  ),
4872
4902
  /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
@@ -4876,7 +4906,7 @@ Failed to reload test data. Please refresh the page.`);
4876
4906
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
4877
4907
  /* @__PURE__ */ i(Ke, { variant: "info", children: [
4878
4908
  "Question ",
4879
- Object.keys(I).length,
4909
+ Object.keys(F).length,
4880
4910
  " of ",
4881
4911
  s.totalQuestionCount
4882
4912
  ] }),
@@ -4887,7 +4917,7 @@ Failed to reload test data. Please refresh the page.`);
4887
4917
  " remaining"
4888
4918
  ] })
4889
4919
  ] }),
4890
- s.appropriatenessQuestions.map((_, $) => /* @__PURE__ */ i(
4920
+ s.appropriatenessQuestions.map((_, z) => /* @__PURE__ */ i(
4891
4921
  "div",
4892
4922
  {
4893
4923
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -4895,7 +4925,7 @@ Failed to reload test data. Please refresh the page.`);
4895
4925
  /* @__PURE__ */ i("div", { className: "mb-4", children: [
4896
4926
  /* @__PURE__ */ i("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
4897
4927
  "Question ",
4898
- $ + 1
4928
+ z + 1
4899
4929
  ] }),
4900
4930
  _.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: _.groupName }),
4901
4931
  /* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: _.question })
@@ -4905,7 +4935,7 @@ Failed to reload test data. Please refresh the page.`);
4905
4935
  {
4906
4936
  className: `
4907
4937
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
4908
- ${I[_.id] === Q ? "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"}
4938
+ ${F[_.id] === Q ? "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"}
4909
4939
  `,
4910
4940
  children: [
4911
4941
  /* @__PURE__ */ r(
@@ -4914,7 +4944,7 @@ Failed to reload test data. Please refresh the page.`);
4914
4944
  type: "radio",
4915
4945
  name: `question-${_.id}`,
4916
4946
  value: Q,
4917
- checked: I[_.id] === Q,
4947
+ checked: F[_.id] === Q,
4918
4948
  onChange: (oe) => W(_.id, oe.target.value),
4919
4949
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
4920
4950
  disabled: y
@@ -4955,7 +4985,7 @@ Failed to reload test data. Please refresh the page.`);
4955
4985
  {
4956
4986
  type: "submit",
4957
4987
  isLoading: y,
4958
- disabled: Object.keys(I).length < s.totalQuestionCount,
4988
+ disabled: Object.keys(F).length < s.totalQuestionCount,
4959
4989
  children: H ? "Submitting..." : "Submit Test"
4960
4990
  }
4961
4991
  )
@@ -4974,7 +5004,7 @@ Failed to reload test data. Please refresh the page.`);
4974
5004
  ] }),
4975
5005
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4976
5006
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
4977
- /* @__PURE__ */ r(Ke, { variant: "info", children: F(s.testDurationSec) })
5007
+ /* @__PURE__ */ r(Ke, { variant: "info", children: E(s.testDurationSec) })
4978
5008
  ] }),
4979
5009
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4980
5010
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
@@ -5011,7 +5041,7 @@ Failed to reload test data. Please refresh the page.`);
5011
5041
  onBack: n
5012
5042
  }) => {
5013
5043
  var Me, Xe, je, We;
5014
- const { applicantService: a, baseInformationService: s, config: l, currentTheme: d } = Fe(), { identityData: m, provider: y, token: p, isLoading: S, error: T, requestIdentity: I, restartIdentity: P } = Br(e), [f, v] = w(null), [E, U] = w(null), [H, M] = w([]), [B, V] = w([]), [ne, F] = w(!0), [A, W] = w(!1), [K, z] = w(null), [O, _] = w(!1), $ = Ae.useRef(!1), [Q, te] = w({}), [oe, L] = w({}), q = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, re = !!(d != null && d.reviewPageDisabled), fe = ce(!1);
5044
+ const { applicantService: a, baseInformationService: s, config: l, currentTheme: d } = Fe(), { identityData: m, provider: y, token: p, isLoading: S, error: T, requestIdentity: F, restartIdentity: P } = Br(e), [f, v] = w(null), [C, U] = w(null), [H, D] = w([]), [B, V] = w([]), [ne, E] = w(!0), [A, W] = w(!1), [K, $] = w(null), [O, _] = w(!1), z = Ae.useRef(!1), [Q, te] = w({}), [oe, L] = w({}), q = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, re = !!(d != null && d.reviewPageDisabled), fe = ce(!1);
5015
5045
  fe.current = re;
5016
5046
  const de = jt({
5017
5047
  defaultValues: {
@@ -5026,7 +5056,7 @@ Failed to reload test data. Please refresh the page.`);
5026
5056
  });
5027
5057
  ye(() => {
5028
5058
  if (re) {
5029
- $.current || ($.current = !0, I().then(() => W(!0)).catch((j) => console.error("[Identity] Auto-request failed:", j)).finally(() => F(!1)));
5059
+ z.current || (z.current = !0, F().then(() => W(!0)).catch((j) => console.error("[Identity] Auto-request failed:", j)).finally(() => E(!1)));
5030
5060
  return;
5031
5061
  }
5032
5062
  (async () => {
@@ -5038,8 +5068,8 @@ Failed to reload test data. Please refresh the page.`);
5038
5068
  // CountriesType.PhoneNumber
5039
5069
  ]);
5040
5070
  U(j);
5041
- const x = /* @__PURE__ */ new Set(), C = Y.map((h) => ({ value: h.abbreviation3 || h.abbreviation, label: h.name })).filter((h) => !h.value || x.has(h.value) ? !1 : (x.add(h.value), !0));
5042
- M(C);
5071
+ const x = /* @__PURE__ */ new Set(), I = Y.map((h) => ({ value: h.abbreviation3 || h.abbreviation, label: h.name })).filter((h) => !h.value || x.has(h.value) ? !1 : (x.add(h.value), !0));
5072
+ D(I);
5043
5073
  const b = /* @__PURE__ */ new Set(), o = u.filter((h) => h.countryCode).map((h) => ({ value: h.countryCode, label: `${h.countryCode} – ${h.name}` })).filter((h) => b.has(h.value) ? !1 : (b.add(h.value), !0));
5044
5074
  V(o);
5045
5075
  const c = j.applicantRequestData;
@@ -5073,10 +5103,10 @@ Failed to reload test data. Please refresh the page.`);
5073
5103
  country: (c == null ? void 0 : c.country) || "",
5074
5104
  nationality: (c == null ? void 0 : c.nationality) || "",
5075
5105
  phonenumber: (c == null ? void 0 : c.phonenumber) || ""
5076
- }), j.kycRecords && j.kycRecords.length > 0 && j.kycRecords[0].providerTokenObject !== null && !$.current && fe.current) {
5077
- console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), $.current = !0;
5106
+ }), j.kycRecords && j.kycRecords.length > 0 && j.kycRecords[0].providerTokenObject !== null && !z.current && fe.current) {
5107
+ console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), z.current = !0;
5078
5108
  try {
5079
- await I(), W(!0);
5109
+ await F(), W(!0);
5080
5110
  } catch (h) {
5081
5111
  console.error("[Identity] Auto-request failed:", h);
5082
5112
  }
@@ -5084,7 +5114,7 @@ Failed to reload test data. Please refresh the page.`);
5084
5114
  } catch (j) {
5085
5115
  console.error("Error loading applicant data:", j);
5086
5116
  } finally {
5087
- F(!1);
5117
+ E(!1);
5088
5118
  }
5089
5119
  })();
5090
5120
  }, [e]), ye(() => {
@@ -5094,7 +5124,7 @@ Failed to reload test data. Please refresh the page.`);
5094
5124
  if (p.expiresAt) {
5095
5125
  const g = new Date(p.expiresAt).getTime();
5096
5126
  if (Date.now() >= g) {
5097
- console.warn("[Identity] Token has expired (expiresAt)"), _(!0), z("Your verification session has expired. Please restart.");
5127
+ console.warn("[Identity] Token has expired (expiresAt)"), _(!0), $("Your verification session has expired. Please restart.");
5098
5128
  return;
5099
5129
  }
5100
5130
  }
@@ -5102,14 +5132,14 @@ Failed to reload test data. Please refresh the page.`);
5102
5132
  try {
5103
5133
  const j = new URL(p.url).toString().toLowerCase();
5104
5134
  if (j.includes("expired") || j.includes("invalid") || j.includes("error")) {
5105
- console.warn("[Identity] Token URL indicates expiration"), _(!0), z("Your verification link has expired. Please restart.");
5135
+ console.warn("[Identity] Token URL indicates expiration"), _(!0), $("Your verification link has expired. Please restart.");
5106
5136
  return;
5107
5137
  }
5108
5138
  } catch {
5109
5139
  console.error("[Identity] Invalid token URL");
5110
5140
  }
5111
5141
  if (p.status === "expired" || p.error === "expired" || p.expired === !0) {
5112
- console.warn("[Identity] Token object indicates expiration"), _(!0), z("Your verification session has expired. Please restart.");
5142
+ console.warn("[Identity] Token object indicates expiration"), _(!0), $("Your verification session has expired. Please restart.");
5113
5143
  return;
5114
5144
  }
5115
5145
  }
@@ -5117,7 +5147,7 @@ Failed to reload test data. Please refresh the page.`);
5117
5147
  if (y !== null && p && !f && A && !O) {
5118
5148
  const g = y;
5119
5149
  if (p.url) {
5120
- console.log("[Identity] Loading provider URL for user verification:", p.url), z(null);
5150
+ console.log("[Identity] Loading provider URL for user verification:", p.url), $(null);
5121
5151
  try {
5122
5152
  if (new URL(p.url), g === Le.SardinAI) {
5123
5153
  console.log("[SardinAI] Initializing Risk SDK in background...");
@@ -5134,12 +5164,12 @@ Failed to reload test data. Please refresh the page.`);
5134
5164
  }
5135
5165
  v({ type: "url", url: p.url });
5136
5166
  } catch (j) {
5137
- console.error("[Identity] Invalid URL:", j), z("Invalid verification URL. Please restart."), _(!0);
5167
+ console.error("[Identity] Invalid URL:", j), $("Invalid verification URL. Please restart."), _(!0);
5138
5168
  }
5139
5169
  return;
5140
5170
  }
5141
5171
  if (g === Le.SardinAI) {
5142
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), z(null);
5172
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), $(null);
5143
5173
  try {
5144
5174
  const j = tt.parseProviderConfig(y, p, l), Y = tt.createProvider(y, j);
5145
5175
  Y.initialize().then(() => {
@@ -5147,29 +5177,29 @@ Failed to reload test data. Please refresh the page.`);
5147
5177
  t == null || t();
5148
5178
  }, 2e3);
5149
5179
  }).catch((u) => {
5150
- var C;
5180
+ var I;
5151
5181
  console.error("[SardinAI] Failed to initialize:", u);
5152
- const x = ((C = u.message) == null ? void 0 : C.toLowerCase()) || "";
5153
- x.includes("expired") || x.includes("invalid") || x.includes("401") || x.includes("400") ? (_(!0), z("Session expired or invalid. Please restart verification.")) : z(`Failed to initialize: ${u.message}`);
5182
+ const x = ((I = u.message) == null ? void 0 : I.toLowerCase()) || "";
5183
+ x.includes("expired") || x.includes("invalid") || x.includes("401") || x.includes("400") ? (_(!0), $("Session expired or invalid. Please restart verification.")) : $(`Failed to initialize: ${u.message}`);
5154
5184
  });
5155
5185
  } catch (j) {
5156
- console.error("[SardinAI] Error creating provider:", j), z(`Configuration error: ${j.message}`);
5186
+ console.error("[SardinAI] Error creating provider:", j), $(`Configuration error: ${j.message}`);
5157
5187
  }
5158
5188
  return;
5159
5189
  }
5160
5190
  try {
5161
- z(null);
5191
+ $(null);
5162
5192
  const j = tt.parseProviderConfig(y, p, l), Y = tt.createProvider(y, j);
5163
5193
  g === Le.Sumsub ? (Y.initialize("identity-container").catch((u) => {
5164
5194
  var x;
5165
- console.error("[Sumsub] Initialization error:", u), z(`Failed to initialize: ${u.message}`), (x = u.message) != null && x.toLowerCase().includes("expired") && _(!0);
5195
+ console.error("[Sumsub] Initialization error:", u), $(`Failed to initialize: ${u.message}`), (x = u.message) != null && x.toLowerCase().includes("expired") && _(!0);
5166
5196
  }), Y.onComplete && Y.onComplete(() => {
5167
5197
  t == null || t();
5168
5198
  })) : g === Le.Onfido && Y.initialize("identity-container").catch((u) => {
5169
- console.error("[Onfido] Initialization error:", u), z(`Failed to initialize: ${u.message}`);
5199
+ console.error("[Onfido] Initialization error:", u), $(`Failed to initialize: ${u.message}`);
5170
5200
  }), v(Y);
5171
5201
  } catch (j) {
5172
- console.error("[Identity] Provider setup error:", j), z(`Setup error: ${j.message}`);
5202
+ console.error("[Identity] Provider setup error:", j), $(`Setup error: ${j.message}`);
5173
5203
  }
5174
5204
  }
5175
5205
  return () => {
@@ -5181,17 +5211,17 @@ Failed to reload test data. Please refresh the page.`);
5181
5211
  }
5182
5212
  };
5183
5213
  }, [y, p, f, A, t, O]);
5184
- const D = async () => {
5214
+ const M = async () => {
5185
5215
  try {
5186
- z(null), _(!1), await I(), W(!0);
5216
+ $(null), _(!1), await F(), W(!0);
5187
5217
  } catch (g) {
5188
5218
  console.error("Error starting identity verification:", g);
5189
5219
  }
5190
5220
  }, G = async () => {
5191
5221
  try {
5192
- z(null), _(!1), v(null), console.log("[Identity] Restarting verification..."), await P(), W(!0);
5222
+ $(null), _(!1), v(null), console.log("[Identity] Restarting verification..."), await P(), W(!0);
5193
5223
  } catch (g) {
5194
- console.error("Error restarting identity verification:", g), z(g.message || "Failed to restart verification");
5224
+ console.error("Error restarting identity verification:", g), $(g.message || "Failed to restart verification");
5195
5225
  }
5196
5226
  };
5197
5227
  if (ne || S)
@@ -5282,10 +5312,10 @@ Failed to reload test data. Please refresh the page.`);
5282
5312
  var Y, u, x;
5283
5313
  console.log("[Identity] Iframe loaded");
5284
5314
  try {
5285
- const C = j.target, b = C.contentDocument || ((Y = C.contentWindow) == null ? void 0 : Y.document);
5315
+ const I = j.target, b = I.contentDocument || ((Y = I.contentWindow) == null ? void 0 : Y.document);
5286
5316
  if (b) {
5287
5317
  const o = ((x = (u = b.body) == null ? void 0 : u.textContent) == null ? void 0 : x.toLowerCase()) || "";
5288
- (o.includes("expired") || o.includes("invalid") || o.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), _(!0), z("Your verification link has expired."));
5318
+ (o.includes("expired") || o.includes("invalid") || o.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), _(!0), $("Your verification link has expired."));
5289
5319
  }
5290
5320
  } catch {
5291
5321
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -5456,14 +5486,14 @@ Failed to reload test data. Please refresh the page.`);
5456
5486
  g.helpText
5457
5487
  ) }, Y);
5458
5488
  if (g.customType === "checkbox" || g.customType === "link_checkbox") {
5459
- const C = x === "true" || x === !0;
5489
+ const I = x === "true" || x === !0;
5460
5490
  return /* @__PURE__ */ r("div", { className: ue(g.colSpan), children: be(
5461
5491
  /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5462
5492
  /* @__PURE__ */ r(
5463
5493
  "input",
5464
5494
  {
5465
5495
  type: "checkbox",
5466
- checked: !!C,
5496
+ checked: !!I,
5467
5497
  onChange: (b) => L((o) => ({ ...o, [u]: String(b.target.checked) })),
5468
5498
  style: {
5469
5499
  width: 16,
@@ -5483,10 +5513,10 @@ Failed to reload test data. Please refresh the page.`);
5483
5513
  ) }, Y);
5484
5514
  }
5485
5515
  if (g.customType === "group_checkbox") {
5486
- const C = Array.isArray(x) ? x : x ? [x] : [], b = (o) => {
5487
- g.singleSelect ? L((c) => ({ ...c, [u]: C[0] === o ? [] : [o] })) : L((c) => ({
5516
+ const I = Array.isArray(x) ? x : x ? [x] : [], b = (o) => {
5517
+ g.singleSelect ? L((c) => ({ ...c, [u]: I[0] === o ? [] : [o] })) : L((c) => ({
5488
5518
  ...c,
5489
- [u]: C.includes(o) ? C.filter((R) => R !== o) : [...C, o]
5519
+ [u]: I.includes(o) ? I.filter((R) => R !== o) : [...I, o]
5490
5520
  }));
5491
5521
  };
5492
5522
  return /* @__PURE__ */ r("div", { className: ue(g.colSpan), children: be(
@@ -5497,7 +5527,7 @@ Failed to reload test data. Please refresh the page.`);
5497
5527
  "input",
5498
5528
  {
5499
5529
  type: "checkbox",
5500
- checked: C.includes(o.value),
5530
+ checked: I.includes(o.value),
5501
5531
  onChange: () => b(o.value),
5502
5532
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5503
5533
  }
@@ -5511,20 +5541,20 @@ Failed to reload test data. Please refresh the page.`);
5511
5541
  return g.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: ue(g.colSpan), children: be(
5512
5542
  /* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
5513
5543
  g.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.displayText || g.label }),
5514
- (g.options || []).map((C) => /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5544
+ (g.options || []).map((I) => /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5515
5545
  /* @__PURE__ */ r(
5516
5546
  "input",
5517
5547
  {
5518
5548
  type: "radio",
5519
5549
  name: `rg-${u}`,
5520
- value: C.value,
5521
- checked: x === C.value,
5522
- onChange: () => L((b) => ({ ...b, [u]: C.value })),
5550
+ value: I.value,
5551
+ checked: x === I.value,
5552
+ onChange: () => L((b) => ({ ...b, [u]: I.value })),
5523
5553
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5524
5554
  }
5525
5555
  ),
5526
- /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: C.label })
5527
- ] }, C.value))
5556
+ /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: I.label })
5557
+ ] }, I.value))
5528
5558
  ] }),
5529
5559
  g.helpText
5530
5560
  ) }, Y) : /* @__PURE__ */ r("div", { className: ue(g.colSpan), children: be(
@@ -5533,20 +5563,20 @@ Failed to reload test data. Please refresh the page.`);
5533
5563
  {
5534
5564
  label: g.displayText || g.label || u,
5535
5565
  value: String(x ?? ""),
5536
- onChange: (C) => L((b) => ({ ...b, [u]: C.target.value }))
5566
+ onChange: (I) => L((b) => ({ ...b, [u]: I.target.value }))
5537
5567
  }
5538
5568
  ),
5539
5569
  g.helpText
5540
5570
  ) }, Y);
5541
5571
  }, Ze = (g, j) => {
5542
5572
  if (g.isCustom) return Je(g, j);
5543
- const Y = g.name ?? "", u = Ge[Y], x = g.displayText || (u == null ? void 0 : u.label) || Y, C = Q[Y] ?? "", b = Y === "mobileCountryCode", o = !!(u != null && u.countriesType) && !b;
5573
+ const Y = g.name ?? "", u = Ge[Y], x = g.displayText || (u == null ? void 0 : u.label) || Y, I = Q[Y] ?? "", b = Y === "mobileCountryCode", o = !!(u != null && u.countriesType) && !b;
5544
5574
  return g.editable ? b ? /* @__PURE__ */ r("div", { className: ue(g.colSpan ?? 2), children: be(
5545
5575
  /* @__PURE__ */ r(
5546
5576
  Be,
5547
5577
  {
5548
5578
  label: x,
5549
- value: String(C),
5579
+ value: String(I),
5550
5580
  onChange: (c) => te((R) => ({ ...R, [Y]: c })),
5551
5581
  options: [{ value: "", label: "Select country code…" }, ...B]
5552
5582
  }
@@ -5557,7 +5587,7 @@ Failed to reload test data. Please refresh the page.`);
5557
5587
  Be,
5558
5588
  {
5559
5589
  label: x,
5560
- value: String(C),
5590
+ value: String(I),
5561
5591
  onChange: (c) => te((R) => ({ ...R, [Y]: c })),
5562
5592
  options: [{ value: "", label: `Select ${x.toLowerCase()}…` }, ...H]
5563
5593
  }
@@ -5569,7 +5599,7 @@ Failed to reload test data. Please refresh the page.`);
5569
5599
  {
5570
5600
  label: x,
5571
5601
  type: (u == null ? void 0 : u.type) === "date" ? "date" : (u == null ? void 0 : u.type) === "email" ? "email" : "text",
5572
- value: String(C),
5602
+ value: String(I),
5573
5603
  onChange: (c) => te((R) => ({ ...R, [Y]: c.target.value }))
5574
5604
  }
5575
5605
  ),
@@ -5577,7 +5607,7 @@ Failed to reload test data. Please refresh the page.`);
5577
5607
  ) }, `ei-${j}`) : /* @__PURE__ */ r("div", { className: ue(g.colSpan ?? 2), children: be(
5578
5608
  /* @__PURE__ */ i(ot, { children: [
5579
5609
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: x }),
5580
- /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: we(Y, C) })
5610
+ /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: we(Y, I) })
5581
5611
  ] }),
5582
5612
  g.helpText
5583
5613
  ) }, `ro-${j}`);
@@ -5585,7 +5615,7 @@ Failed to reload test data. Please refresh the page.`);
5585
5615
  if (q) {
5586
5616
  const g = q.title || "Review Your Information", j = q.subtitle || "Please review and confirm your information before starting identity verification";
5587
5617
  return /* @__PURE__ */ r("form", { onSubmit: (Y) => {
5588
- Y.preventDefault(), D();
5618
+ Y.preventDefault(), M();
5589
5619
  }, children: /* @__PURE__ */ i(J, { children: [
5590
5620
  /* @__PURE__ */ i(ve, { children: [
5591
5621
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g }),
@@ -5598,16 +5628,16 @@ Failed to reload test data. Please refresh the page.`);
5598
5628
  ] })
5599
5629
  ] }) });
5600
5630
  }
5601
- return /* @__PURE__ */ r("form", { onSubmit: de.handleSubmit(D), children: /* @__PURE__ */ i(J, { children: [
5631
+ return /* @__PURE__ */ r("form", { onSubmit: de.handleSubmit(M), children: /* @__PURE__ */ i(J, { children: [
5602
5632
  /* @__PURE__ */ i(ve, { children: [
5603
5633
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
5604
5634
  /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please review and confirm your information before starting identity verification" })
5605
5635
  ] }),
5606
5636
  /* @__PURE__ */ i(Z, { className: "space-y-6", children: [
5607
5637
  /* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
5608
- { label: "Name", value: `${((Me = E == null ? void 0 : E.applicantRequestData) == null ? void 0 : Me.firstName) || ""} ${((Xe = E == null ? void 0 : E.applicantRequestData) == null ? void 0 : Xe.lastName) || ""}`.trim() },
5609
- { label: "Email", value: (je = E == null ? void 0 : E.applicantRequestData) == null ? void 0 : je.email },
5610
- { label: "Date of Birth", value: ((We = E == null ? void 0 : E.applicantRequestData) == null ? void 0 : We.dateOfBirth) || "Not provided" }
5638
+ { label: "Name", value: `${((Me = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : Me.firstName) || ""} ${((Xe = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : Xe.lastName) || ""}`.trim() },
5639
+ { label: "Email", value: (je = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : je.email },
5640
+ { label: "Date of Birth", value: ((We = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : We.dateOfBirth) || "Not provided" }
5611
5641
  ].map(({ label: g, value: j }) => /* @__PURE__ */ i("div", { children: [
5612
5642
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g }),
5613
5643
  /* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: j })
@@ -5985,22 +6015,22 @@ const st = {
5985
6015
  ),
5986
6016
  typeof document < "u" && s ? gt(s, document.body) : null
5987
6017
  ] });
5988
- }, $n = ({
6018
+ }, zn = ({
5989
6019
  workflowKey: e,
5990
6020
  externalRefId: t,
5991
6021
  onSuccess: n,
5992
6022
  onCancel: a
5993
6023
  }) => {
5994
- var j, Y, u, x, C, b;
6024
+ var j, Y, u, x, I, b;
5995
6025
  const { config: s, baseInformationService: l, currentTheme: d } = Fe(), { createApplicant: m, isLoading: y } = Rt(), p = e || ((j = s.applicantForm) == null ? void 0 : j.workflowKey);
5996
6026
  if (!p)
5997
6027
  throw new Error(
5998
6028
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
5999
6029
  );
6000
- const S = t || ((Y = s.applicantForm) == null ? void 0 : Y.externalRefId) || "", T = ((u = s.applicantForm) == null ? void 0 : u.email) || "", I = ((x = s.applicantForm) == null ? void 0 : x.hiddenValues) || {}, f = (((C = s.applicantForm) == null ? void 0 : C.fieldLabelMode) || (d == null ? void 0 : d.fieldLabelMode) || "label") !== "placeholder", v = Re(
6030
+ const S = t || ((Y = s.applicantForm) == null ? void 0 : Y.externalRefId) || "", T = ((u = s.applicantForm) == null ? void 0 : u.email) || "", F = ((x = s.applicantForm) == null ? void 0 : x.hiddenValues) || {}, f = (((I = s.applicantForm) == null ? void 0 : I.fieldLabelMode) || (d == null ? void 0 : d.fieldLabelMode) || "label") !== "placeholder", v = Re(
6001
6031
  () => d != null && d.applicantFormPages && d.applicantFormPages.length > 0 ? d.applicantFormPages : null,
6002
6032
  [d == null ? void 0 : d.applicantFormPages]
6003
- ), E = Re(() => {
6033
+ ), C = Re(() => {
6004
6034
  const o = new Set(dt), c = d == null ? void 0 : d.applicantFormRequiredFields;
6005
6035
  if (c) for (const R of c) o.add(R);
6006
6036
  if (v)
@@ -6027,7 +6057,7 @@ const st = {
6027
6057
  "countryOfBirth",
6028
6058
  "mobileCountryCode",
6029
6059
  "otherNationality"
6030
- ]), M = Re(() => {
6060
+ ]), D = Re(() => {
6031
6061
  var c, R;
6032
6062
  const o = /* @__PURE__ */ new Set();
6033
6063
  if (v)
@@ -6038,21 +6068,21 @@ const st = {
6038
6068
  for (const h of U)
6039
6069
  H.has(h) && o.add((R = Ge[h]) == null ? void 0 : R.countriesType);
6040
6070
  return o.size === 0 && o.add(void 0), Array.from(o);
6041
- }, [U, v]), [B, V] = w({}), [ne, F] = w(!0), A = ce(/* @__PURE__ */ new Set()), W = ce(/* @__PURE__ */ new Set());
6071
+ }, [U, v]), [B, V] = w({}), [ne, E] = w(!0), A = ce(/* @__PURE__ */ new Set()), W = ce(/* @__PURE__ */ new Set());
6042
6072
  ye(() => {
6043
6073
  if (!d) return;
6044
- const o = M.filter((h) => {
6074
+ const o = D.filter((h) => {
6045
6075
  const N = h != null ? String(h) : "all";
6046
6076
  return !W.current.has(N) && !A.current.has(N);
6047
6077
  });
6048
6078
  if (o.length === 0) {
6049
- M.every((N) => {
6079
+ D.every((N) => {
6050
6080
  const k = N != null ? String(N) : "all";
6051
6081
  return W.current.has(k);
6052
- }) && F(!1);
6082
+ }) && E(!1);
6053
6083
  return;
6054
6084
  }
6055
- F(!0);
6085
+ E(!0);
6056
6086
  const c = o.map((h) => h != null ? String(h) : "all");
6057
6087
  c.forEach((h) => A.current.add(h)), (async () => {
6058
6088
  try {
@@ -6069,19 +6099,19 @@ const st = {
6069
6099
  } catch (h) {
6070
6100
  c.forEach((N) => A.current.delete(N)), console.error("Failed to load countries:", h);
6071
6101
  } finally {
6072
- M.every((N) => {
6102
+ D.every((N) => {
6073
6103
  const k = N != null ? String(N) : "all";
6074
6104
  return W.current.has(k);
6075
- }) && F(!1);
6105
+ }) && E(!1);
6076
6106
  }
6077
6107
  })();
6078
- }, [M, d]);
6108
+ }, [D, d]);
6079
6109
  const K = (o, c) => {
6080
6110
  var N;
6081
6111
  const R = c ?? ((N = Ge[o]) == null ? void 0 : N.countriesType), h = R != null ? String(R) : "all";
6082
6112
  return B[h] || [];
6083
- }, z = Object.fromEntries(
6084
- Object.entries(I).filter(([o]) => o in {
6113
+ }, $ = Object.fromEntries(
6114
+ Object.entries(F).filter(([o]) => o in {
6085
6115
  firstName: 1,
6086
6116
  lastName: 1,
6087
6117
  title: 1,
@@ -6130,10 +6160,10 @@ const st = {
6130
6160
  educationLevel: "",
6131
6161
  occupation: "",
6132
6162
  taxNumber: "",
6133
- ...z
6134
- }), $ = Object.fromEntries(
6135
- Object.entries(I).filter(([o]) => !(o in z) && o !== "externalRefId" && o !== "workflowKey")
6136
- ), [Q, te] = w({ ...$ }), [oe, L] = w(0), [q, re] = w({}), [fe, de] = w(null), [D, G] = w(!1), ae = (o, c) => _((R) => ({ ...R, [o]: c })), ue = (o, c) => te((R) => ({ ...R, [o]: c })), we = (o) => !o.conditionalOn || Q[o.conditionalOn] === "true", De = v && oe < v.length - 1 ? oe + 1 : -1, be = v && oe > 0 ? oe - 1 : -1, Je = (o) => {
6163
+ ...$
6164
+ }), z = Object.fromEntries(
6165
+ Object.entries(F).filter(([o]) => !(o in $) && o !== "externalRefId" && o !== "workflowKey")
6166
+ ), [Q, te] = w({ ...z }), [oe, L] = w(0), [q, re] = w({}), [fe, de] = w(null), [M, G] = w(!1), ae = (o, c) => _((R) => ({ ...R, [o]: c })), ue = (o, c) => te((R) => ({ ...R, [o]: c })), we = (o) => !o.conditionalOn || Q[o.conditionalOn] === "true", De = v && oe < v.length - 1 ? oe + 1 : -1, be = v && oe > 0 ? oe - 1 : -1, Je = (o) => {
6137
6167
  var R;
6138
6168
  const c = {};
6139
6169
  for (const h of o.fields)
@@ -6145,7 +6175,7 @@ const st = {
6145
6175
  }
6146
6176
  } else if (h.name) {
6147
6177
  const N = h.name;
6148
- if (E.includes(N) && rt(O[N])) {
6178
+ if (C.includes(N) && rt(O[N])) {
6149
6179
  const k = h.displayText || ((R = Ge[N]) == null ? void 0 : R.label) || N;
6150
6180
  c[N] = `${k} is required.`;
6151
6181
  }
@@ -6218,10 +6248,10 @@ const st = {
6218
6248
  c.push({ paramName: k.paramName, value: ie });
6219
6249
  }
6220
6250
  }
6221
- for (const [N, k] of Object.entries(z))
6251
+ for (const [N, k] of Object.entries($))
6222
6252
  o[N] === void 0 && !rt(k) && (o[N] = k);
6223
6253
  const R = new Set(c.map((N) => N.paramName));
6224
- for (const [N, k] of Object.entries($))
6254
+ for (const [N, k] of Object.entries(z))
6225
6255
  !R.has(N) && k && c.push({ paramName: N, value: k });
6226
6256
  c.length > 0 && (o.applicantAdditionalDatas = c);
6227
6257
  const h = await m(o);
@@ -6234,7 +6264,7 @@ const st = {
6234
6264
  }, Xe = async (o) => {
6235
6265
  var c;
6236
6266
  o.preventDefault();
6237
- for (const R of E)
6267
+ for (const R of C)
6238
6268
  if (rt(O[R])) {
6239
6269
  const h = ((c = Ge[R]) == null ? void 0 : c.label) || R;
6240
6270
  de(`${h} is required.`);
@@ -6245,7 +6275,7 @@ const st = {
6245
6275
  var bt;
6246
6276
  const k = Ge[o];
6247
6277
  if (!k) return null;
6248
- const le = E.includes(o), ie = q[o], xe = R || k.label, he = c ?? o, me = { required: le }, Oe = N ? N !== "placeholder" : f, He = Oe ? xe : void 0, Dt = Oe ? "..." : xe;
6278
+ const le = C.includes(o), ie = q[o], xe = R || k.label, he = c ?? o, me = { required: le }, Oe = N ? N !== "placeholder" : f, He = Oe ? xe : void 0, Dt = Oe ? "..." : xe;
6249
6279
  switch (k.type) {
6250
6280
  case "select":
6251
6281
  if (o === "country" || o === "nationality" || o === "taxCountry" || o === "countryOfBirth" || o === "mobileCountryCode") {
@@ -6726,17 +6756,17 @@ const st = {
6726
6756
  onClick: () => {
6727
6757
  L(be), re({});
6728
6758
  },
6729
- disabled: D || y,
6759
+ disabled: M || y,
6730
6760
  children: "Previous"
6731
6761
  }
6732
6762
  ),
6733
- c && a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: D || y, children: "Cancel" })
6763
+ c && a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: M || y, children: "Cancel" })
6734
6764
  ] }),
6735
6765
  /* @__PURE__ */ r(
6736
6766
  X,
6737
6767
  {
6738
6768
  type: "button",
6739
- isLoading: D || y,
6769
+ isLoading: M || y,
6740
6770
  onClick: R ? Me : Ze,
6741
6771
  children: R ? o.conditionalOn && !N ? "Skip & Submit" : "Submit" : o.conditionalOn && !N ? "Skip" : "Next"
6742
6772
  }
@@ -6755,15 +6785,15 @@ const st = {
6755
6785
  /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: U.map((o) => /* @__PURE__ */ r("div", { className: "col-span-4", children: je(o) }, o)) })
6756
6786
  ] }),
6757
6787
  /* @__PURE__ */ i(ke, { className: "flex justify-between", children: [
6758
- a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: D || y, children: "Cancel" }),
6759
- /* @__PURE__ */ r(X, { type: "submit", isLoading: D || y, children: "Create Applicant" })
6788
+ a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: M || y, children: "Cancel" }),
6789
+ /* @__PURE__ */ r(X, { type: "submit", isLoading: M || y, children: "Create Applicant" })
6760
6790
  ] })
6761
6791
  ] }) }) });
6762
6792
  }, It = ["companyName", "email"];
6763
6793
  function yt(e) {
6764
6794
  return e == null || e === "" || Array.isArray(e) && e.length === 0;
6765
6795
  }
6766
- const zn = ({
6796
+ const $n = ({
6767
6797
  workflowKey: e,
6768
6798
  externalRefId: t,
6769
6799
  onSuccess: n,
@@ -6780,37 +6810,37 @@ const zn = ({
6780
6810
  [d == null ? void 0 : d.companyFormPages]
6781
6811
  ), v = Re(() => {
6782
6812
  const u = new Set(It), x = d == null ? void 0 : d.companyFormRequiredFields;
6783
- if (x) for (const C of x) u.add(C);
6813
+ if (x) for (const I of x) u.add(I);
6784
6814
  if (f)
6785
- for (const C of f)
6786
- for (const b of C.fields)
6815
+ for (const I of f)
6816
+ for (const b of I.fields)
6787
6817
  !b.isCustom && b.name && b.required && u.add(b.name);
6788
6818
  return Array.from(u);
6789
- }, [d == null ? void 0 : d.companyFormRequiredFields, f]), E = Re(() => {
6819
+ }, [d == null ? void 0 : d.companyFormRequiredFields, f]), C = Re(() => {
6790
6820
  var u;
6791
6821
  if (f) {
6792
- const x = f.flatMap((b) => b.fields).filter((b) => !b.isCustom && b.name).map((b) => b.name), C = new Set(x);
6793
- for (const b of It) C.add(b);
6794
- return Array.from(C);
6822
+ const x = f.flatMap((b) => b.fields).filter((b) => !b.isCustom && b.name).map((b) => b.name), I = new Set(x);
6823
+ for (const b of It) I.add(b);
6824
+ return Array.from(I);
6795
6825
  }
6796
6826
  return (u = s.applicantForm) != null && u.visibleFields ? s.applicantForm.visibleFields : d != null && d.companyFormVisibleFields && d.companyFormVisibleFields.length > 0 ? d.companyFormVisibleFields : Xt;
6797
6827
  }, [(Y = s.applicantForm) == null ? void 0 : Y.visibleFields, d == null ? void 0 : d.companyFormVisibleFields, f]), U = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), H = Re(() => {
6798
- var x, C;
6828
+ var x, I;
6799
6829
  const u = /* @__PURE__ */ new Set();
6800
6830
  if (f)
6801
6831
  for (const b of f)
6802
6832
  for (const o of b.fields)
6803
6833
  !o.isCustom && o.name && U.has(o.name) && u.add(o.countriesType ?? ((x = et[o.name]) == null ? void 0 : x.countriesType));
6804
6834
  else
6805
- for (const b of E)
6806
- U.has(b) && u.add((C = et[b]) == null ? void 0 : C.countriesType);
6835
+ for (const b of C)
6836
+ U.has(b) && u.add((I = et[b]) == null ? void 0 : I.countriesType);
6807
6837
  return u.size === 0 && u.add(void 0), Array.from(u);
6808
- }, [E, f]), [M, B] = w({}), [V, ne] = w(!0), F = ce(/* @__PURE__ */ new Set()), A = ce(/* @__PURE__ */ new Set());
6838
+ }, [C, f]), [D, B] = w({}), [V, ne] = w(!0), E = ce(/* @__PURE__ */ new Set()), A = ce(/* @__PURE__ */ new Set());
6809
6839
  ye(() => {
6810
6840
  if (!d) return;
6811
6841
  const u = H.filter((b) => {
6812
6842
  const o = b != null ? String(b) : "all";
6813
- return !A.current.has(o) && !F.current.has(o);
6843
+ return !A.current.has(o) && !E.current.has(o);
6814
6844
  });
6815
6845
  if (u.length === 0) {
6816
6846
  H.every((o) => A.current.has(o != null ? String(o) : "all")) && ne(!1);
@@ -6818,17 +6848,17 @@ const zn = ({
6818
6848
  }
6819
6849
  ne(!0);
6820
6850
  const x = u.map((b) => b != null ? String(b) : "all");
6821
- x.forEach((b) => F.current.add(b)), (async () => {
6851
+ x.forEach((b) => E.current.add(b)), (async () => {
6822
6852
  try {
6823
6853
  const b = await Promise.all(
6824
6854
  u.map(async (o) => {
6825
6855
  const c = o != null ? String(o) : "all", R = await l.getCountries("", s.locale || "en", o), h = /* @__PURE__ */ new Set(), N = R.map((k) => ({ value: k.abbreviation3 || k.abbreviation, label: k.name })).filter((k) => !k.value || h.has(k.value) ? !1 : (h.add(k.value), !0));
6826
- return A.current.add(c), F.current.delete(c), [c, N];
6856
+ return A.current.add(c), E.current.delete(c), [c, N];
6827
6857
  })
6828
6858
  );
6829
6859
  B((o) => ({ ...o, ...Object.fromEntries(b) }));
6830
6860
  } catch (b) {
6831
- x.forEach((o) => F.current.delete(o)), console.error("Failed to load countries:", b);
6861
+ x.forEach((o) => E.current.delete(o)), console.error("Failed to load countries:", b);
6832
6862
  } finally {
6833
6863
  H.every((o) => A.current.has(o != null ? String(o) : "all")) && ne(!1);
6834
6864
  }
@@ -6836,9 +6866,9 @@ const zn = ({
6836
6866
  }, [H, d]);
6837
6867
  const W = (u, x) => {
6838
6868
  var o;
6839
- const C = x ?? ((o = et[u]) == null ? void 0 : o.countriesType), b = C != null ? String(C) : "all";
6840
- return M[b] || [];
6841
- }, [K, z] = w({
6869
+ const I = x ?? ((o = et[u]) == null ? void 0 : o.countriesType), b = I != null ? String(I) : "all";
6870
+ return D[b] || [];
6871
+ }, [K, $] = w({
6842
6872
  workflowKey: p,
6843
6873
  companyName: "",
6844
6874
  email: T,
@@ -6860,8 +6890,8 @@ const zn = ({
6860
6890
  addressCountry: "",
6861
6891
  lei: "",
6862
6892
  externalRefId: S
6863
- }), [O, _] = w({}), [$, Q] = w(0), [te, oe] = w({}), [L, q] = w(null), [re, fe] = w(!1), de = (u, x) => z((C) => ({ ...C, [u]: x })), D = (u, x) => _((C) => ({ ...C, [u]: x })), G = (u) => !u.conditionalOn || O[u.conditionalOn] === "true", ae = f && $ < f.length - 1 ? $ + 1 : -1, ue = f && $ > 0 ? $ - 1 : -1, we = (u) => {
6864
- var C;
6893
+ }), [O, _] = w({}), [z, Q] = w(0), [te, oe] = w({}), [L, q] = w(null), [re, fe] = w(!1), de = (u, x) => $((I) => ({ ...I, [u]: x })), M = (u, x) => _((I) => ({ ...I, [u]: x })), G = (u) => !u.conditionalOn || O[u.conditionalOn] === "true", ae = f && z < f.length - 1 ? z + 1 : -1, ue = f && z > 0 ? z - 1 : -1, we = (u) => {
6894
+ var I;
6865
6895
  const x = {};
6866
6896
  for (const b of u.fields)
6867
6897
  if (b.isCustom) {
@@ -6873,14 +6903,14 @@ const zn = ({
6873
6903
  } else if (b.name) {
6874
6904
  const o = b.name;
6875
6905
  if (v.includes(o) && yt(K[o])) {
6876
- const c = b.displayText || ((C = et[o]) == null ? void 0 : C.label) || o;
6906
+ const c = b.displayText || ((I = et[o]) == null ? void 0 : I.label) || o;
6877
6907
  x[o] = `${c} is required.`;
6878
6908
  }
6879
6909
  }
6880
6910
  return x;
6881
6911
  }, De = async () => {
6882
6912
  if (!f) return;
6883
- const u = f[$];
6913
+ const u = f[z];
6884
6914
  if (u.conditionalOn && !G(u)) {
6885
6915
  oe({}), ae >= 0 ? Q(ae) : await be();
6886
6916
  return;
@@ -6895,8 +6925,8 @@ const zn = ({
6895
6925
  var u;
6896
6926
  if (f) {
6897
6927
  let x = {};
6898
- for (const C of f)
6899
- G(C) && (x = { ...x, ...we(C) });
6928
+ for (const I of f)
6929
+ G(I) && (x = { ...x, ...we(I) });
6900
6930
  if (Object.keys(x).length > 0) {
6901
6931
  oe(x);
6902
6932
  return;
@@ -6907,8 +6937,8 @@ const zn = ({
6907
6937
  const x = {
6908
6938
  workflowKey: K.workflowKey,
6909
6939
  externalRefId: ((u = K.externalRefId) == null ? void 0 : u.trim()) || void 0
6910
- }, C = f ? f.filter((c) => G(c)).flatMap((c) => c.fields).filter((c) => !c.isCustom && c.name).map((c) => c.name) : E;
6911
- for (const c of C) {
6940
+ }, I = f ? f.filter((c) => G(c)).flatMap((c) => c.fields).filter((c) => !c.isCustom && c.name).map((c) => c.name) : C;
6941
+ for (const c of I) {
6912
6942
  const R = K[c];
6913
6943
  if (!yt(R))
6914
6944
  switch (c) {
@@ -6966,17 +6996,17 @@ const zn = ({
6966
6996
  }, Je = async (u) => {
6967
6997
  var x;
6968
6998
  u.preventDefault();
6969
- for (const C of v)
6970
- if (yt(K[C])) {
6971
- const b = ((x = et[C]) == null ? void 0 : x.label) || C;
6999
+ for (const I of v)
7000
+ if (yt(K[I])) {
7001
+ const b = ((x = et[I]) == null ? void 0 : x.label) || I;
6972
7002
  q(`${b} is required.`);
6973
7003
  return;
6974
7004
  }
6975
7005
  await be();
6976
- }, Ze = (u, x, C, b, o) => {
7006
+ }, Ze = (u, x, I, b, o) => {
6977
7007
  const c = et[u];
6978
7008
  if (!c) return null;
6979
- const R = v.includes(u), h = te[u], N = C || c.label, k = x ?? u, le = o ? o !== "placeholder" : P, ie = le ? N : void 0, xe = le ? "..." : N;
7009
+ const R = v.includes(u), h = te[u], N = I || c.label, k = x ?? u, le = o ? o !== "placeholder" : P, ie = le ? N : void 0, xe = le ? "..." : N;
6980
7010
  switch (c.type) {
6981
7011
  case "select":
6982
7012
  if (u === "countryResidence" || u === "addressCountry") {
@@ -7079,7 +7109,7 @@ const zn = ({
7079
7109
  }
7080
7110
  ) }, `custom-${x}`);
7081
7111
  if (!u.paramName) return null;
7082
- const C = te[u.paramName], b = u.displayText || u.label || u.paramName, o = u.labelMode ? u.labelMode !== "placeholder" : P;
7112
+ const I = te[u.paramName], b = u.displayText || u.label || u.paramName, o = u.labelMode ? u.labelMode !== "placeholder" : P;
7083
7113
  return u.customType === "checkbox" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
7084
7114
  /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
7085
7115
  /* @__PURE__ */ r(
@@ -7087,7 +7117,7 @@ const zn = ({
7087
7117
  {
7088
7118
  type: "checkbox",
7089
7119
  checked: O[u.paramName] === "true",
7090
- onChange: (c) => D(u.paramName, c.target.checked ? "true" : "false"),
7120
+ onChange: (c) => M(u.paramName, c.target.checked ? "true" : "false"),
7091
7121
  style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
7092
7122
  }
7093
7123
  ),
@@ -7096,7 +7126,7 @@ const zn = ({
7096
7126
  u.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
7097
7127
  ] })
7098
7128
  ] }),
7099
- C && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: C })
7129
+ I && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: I })
7100
7130
  ] }, `custom-${x}`) : /* @__PURE__ */ r(
7101
7131
  ge,
7102
7132
  {
@@ -7104,9 +7134,9 @@ const zn = ({
7104
7134
  label: o ? `${b}${u.required ? " *" : ""}` : void 0,
7105
7135
  placeholder: o ? void 0 : b,
7106
7136
  value: O[u.paramName] || "",
7107
- onChange: (c) => D(u.paramName, c.target.value),
7137
+ onChange: (c) => M(u.paramName, c.target.value),
7108
7138
  required: u.required,
7109
- error: C
7139
+ error: I
7110
7140
  },
7111
7141
  `custom-${x}`
7112
7142
  );
@@ -7119,15 +7149,15 @@ const zn = ({
7119
7149
  {
7120
7150
  type: "checkbox",
7121
7151
  checked: x,
7122
- onChange: (C) => D(u.conditionalOn, C.target.checked ? "true" : "false"),
7152
+ onChange: (I) => M(u.conditionalOn, I.target.checked ? "true" : "false"),
7123
7153
  style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
7124
7154
  }
7125
7155
  ),
7126
7156
  /* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: u.conditionalOn })
7127
7157
  ] }),
7128
- x && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: u.fields.map((C, b) => {
7129
- const o = C.colSpan === 1 ? "col-span-1" : C.colSpan === 2 ? "col-span-2" : C.colSpan === 3 ? "col-span-3" : "col-span-4", c = C.isCustom ? `custom-${b}-${C.paramName}` : `builtin-${C.name}-${b}`;
7130
- return /* @__PURE__ */ r("div", { className: o, children: C.isCustom ? Me(C, b) : Ze(C.name, c, C.displayText, C.countriesType, C.labelMode) }, c);
7158
+ x && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: u.fields.map((I, b) => {
7159
+ const o = I.colSpan === 1 ? "col-span-1" : I.colSpan === 2 ? "col-span-2" : I.colSpan === 3 ? "col-span-3" : "col-span-4", c = I.isCustom ? `custom-${b}-${I.paramName}` : `builtin-${I.name}-${b}`;
7160
+ return /* @__PURE__ */ r("div", { className: o, children: I.isCustom ? Me(I, b) : Ze(I.name, c, I.displayText, I.countriesType, I.labelMode) }, c);
7131
7161
  }) })
7132
7162
  ] });
7133
7163
  };
@@ -7137,7 +7167,7 @@ const zn = ({
7137
7167
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
7138
7168
  ] }) }) });
7139
7169
  if (f) {
7140
- const u = f[$] ?? f[0], x = ue === -1, C = ae === -1, b = f.length, o = G(u), c = Object.values(te);
7170
+ const u = f[z] ?? f[0], x = ue === -1, I = ae === -1, b = f.length, o = G(u), c = Object.values(te);
7141
7171
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(J, { children: [
7142
7172
  /* @__PURE__ */ r(ve, { children: /* @__PURE__ */ r(lt, { title: (d == null ? void 0 : d.title) || "Company Registration" }) }),
7143
7173
  /* @__PURE__ */ i(Z, { children: [
@@ -7157,13 +7187,13 @@ const zn = ({
7157
7187
  f.map((R, h) => /* @__PURE__ */ r(
7158
7188
  "div",
7159
7189
  {
7160
- className: `h-1.5 rounded-full transition-all ${h === $ ? "flex-1" : "w-8"}`,
7161
- style: h === $ ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : h < $ ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
7190
+ className: `h-1.5 rounded-full transition-all ${h === z ? "flex-1" : "w-8"}`,
7191
+ style: h === z ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : h < z ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
7162
7192
  },
7163
7193
  h
7164
7194
  )),
7165
7195
  /* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
7166
- $ + 1,
7196
+ z + 1,
7167
7197
  " / ",
7168
7198
  b
7169
7199
  ] })
@@ -7186,7 +7216,7 @@ const zn = ({
7186
7216
  ),
7187
7217
  x && a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: re || y, children: "Cancel" })
7188
7218
  ] }),
7189
- /* @__PURE__ */ r(X, { type: "button", isLoading: re || y, onClick: C ? be : De, children: C ? u.conditionalOn && !o ? "Skip & Submit" : "Submit" : u.conditionalOn && !o ? "Skip" : "Next" })
7219
+ /* @__PURE__ */ r(X, { type: "button", isLoading: re || y, onClick: I ? be : De, children: I ? u.conditionalOn && !o ? "Skip & Submit" : "Submit" : u.conditionalOn && !o ? "Skip" : "Next" })
7190
7220
  ] })
7191
7221
  ] }) });
7192
7222
  }
@@ -7198,7 +7228,7 @@ const zn = ({
7198
7228
  " ",
7199
7229
  L
7200
7230
  ] }) }),
7201
- /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: E.map((u) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(u) }, u)) })
7231
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: C.map((u) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(u) }, u)) })
7202
7232
  ] }),
7203
7233
  /* @__PURE__ */ i(ke, { className: "flex justify-between", children: [
7204
7234
  a && /* @__PURE__ */ r(X, { type: "button", variant: "outline", onClick: a, disabled: re || y, children: "Cancel" }),
@@ -7220,27 +7250,27 @@ const zn = ({
7220
7250
  nextWorkflowKey: p,
7221
7251
  hasWorkflowChanged: S,
7222
7252
  isLoading: T,
7223
- error: I,
7253
+ error: F,
7224
7254
  moveBack: P,
7225
7255
  refreshProgress: f
7226
- } = Mr(e), [v, E] = Ae.useState(!1);
7256
+ } = Mr(e), [v, C] = Ae.useState(!1);
7227
7257
  if (Ae.useEffect(() => {
7228
- I && n && n(I);
7229
- }, [I, n]), Ae.useEffect(() => {
7258
+ F && n && n(F);
7259
+ }, [F, n]), Ae.useEffect(() => {
7230
7260
  l != null && l.workflowResult && t && t(l.workflowResult);
7231
7261
  }, [l == null ? void 0 : l.workflowResult, t]), Ae.useEffect(() => {
7232
7262
  a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
7233
7263
  }, [a]), Ae.useEffect(() => {
7234
- S && E(!1);
7264
+ S && C(!1);
7235
7265
  }, [S]), T || !l)
7236
7266
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(J, { children: /* @__PURE__ */ i(Z, { children: [
7237
7267
  /* @__PURE__ */ r(Pe, { className: "my-8" }),
7238
7268
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
7239
7269
  ] }) }) });
7240
- if (I)
7270
+ if (F)
7241
7271
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
7242
7272
  /* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "An error occurred" }),
7243
- /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: I.message })
7273
+ /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: F.message })
7244
7274
  ] }) }) }) });
7245
7275
  if (S && !v)
7246
7276
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
@@ -7264,7 +7294,7 @@ const zn = ({
7264
7294
  /* @__PURE__ */ r(
7265
7295
  "button",
7266
7296
  {
7267
- onClick: () => E(!0),
7297
+ onClick: () => C(!0),
7268
7298
  className: "px-6 py-3 font-medium rounded-lg transition-opacity hover:opacity-90",
7269
7299
  style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
7270
7300
  children: "Continue with New Workflow"
@@ -7314,7 +7344,7 @@ const zn = ({
7314
7344
  return "";
7315
7345
  }
7316
7346
  }, H = () => {
7317
- const B = m.filter((A) => A.visibility !== !1), V = B.findIndex((A) => A.order === d.order), ne = V >= 0 ? V + 1 : 1, F = B.length;
7347
+ const B = m.filter((A) => A.visibility !== !1), V = B.findIndex((A) => A.order === d.order), ne = V >= 0 ? V + 1 : 1, E = B.length;
7318
7348
  return /* @__PURE__ */ i("div", { className: "mb-6", children: [
7319
7349
  /* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
7320
7350
  /* @__PURE__ */ r(lt, {}),
@@ -7322,11 +7352,11 @@ const zn = ({
7322
7352
  "Step ",
7323
7353
  ne,
7324
7354
  " of ",
7325
- F
7355
+ E
7326
7356
  ] })
7327
7357
  ] }),
7328
7358
  /* @__PURE__ */ r("div", { className: "flex items-center", children: B.map((A, W) => {
7329
- const K = W < V, z = A.order === d.order, O = K || z;
7359
+ const K = W < V, $ = A.order === d.order, O = K || $;
7330
7360
  return /* @__PURE__ */ i(Ae.Fragment, { children: [
7331
7361
  /* @__PURE__ */ i("div", { className: "flex items-center", children: [
7332
7362
  /* @__PURE__ */ r(
@@ -7350,8 +7380,8 @@ const zn = ({
7350
7380
  {
7351
7381
  className: "ml-2 text-sm whitespace-nowrap",
7352
7382
  style: {
7353
- fontWeight: z ? 600 : 400,
7354
- color: z ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-muted, #9ca3af)"
7383
+ fontWeight: $ ? 600 : 400,
7384
+ color: $ ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-muted, #9ca3af)"
7355
7385
  },
7356
7386
  children: A.displayName || A.name || U(A.action) || `Step ${W + 1}`
7357
7387
  }
@@ -7369,7 +7399,7 @@ const zn = ({
7369
7399
  ] }, A.order);
7370
7400
  }) })
7371
7401
  ] });
7372
- }, M = () => {
7402
+ }, D = () => {
7373
7403
  const B = {
7374
7404
  applicantId: e,
7375
7405
  onComplete: async () => {
@@ -7419,7 +7449,7 @@ const zn = ({
7419
7449
  };
7420
7450
  return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
7421
7451
  H(),
7422
- M()
7452
+ D()
7423
7453
  ] });
7424
7454
  };
7425
7455
  function _n(e) {
@@ -7488,8 +7518,8 @@ export {
7488
7518
  ke as CardFooter,
7489
7519
  ve as CardHeader,
7490
7520
  Ue as CountriesType,
7491
- $n as CreateApplicantForm,
7492
- zn as CreateCompanyApplicantForm,
7521
+ zn as CreateApplicantForm,
7522
+ $n as CreateCompanyApplicantForm,
7493
7523
  Jt as CriteriaBuiltInType,
7494
7524
  Xt as DEFAULT_COMPANY_VISIBLE_FIELDS,
7495
7525
  er as DEFAULT_VISIBLE_FIELDS,
@@ -7518,7 +7548,7 @@ export {
7518
7548
  Bn as KycWorkflow,
7519
7549
  bn as Logo,
7520
7550
  Et as MetaKYCContext,
7521
- $e as MetaKYCError,
7551
+ ze as MetaKYCError,
7522
7552
  An as MetaKYCProvider,
7523
7553
  Ur as MultiSelect,
7524
7554
  Cr as OnfidoProvider,
@@ -7544,7 +7574,7 @@ export {
7544
7574
  sr as UploadDocumentService,
7545
7575
  an as UploadDocumentStep,
7546
7576
  qt as UserType,
7547
- ze as ValueDataType,
7577
+ $e as ValueDataType,
7548
7578
  Nr as WorkflowOrchestrator,
7549
7579
  ut as WorkflowResultType,
7550
7580
  kr as WorkflowState,
@@ -7582,10 +7612,10 @@ export {
7582
7612
  Br as useIdentityVerification,
7583
7613
  Mr as useKycWorkflow,
7584
7614
  Fe as useMetaKYC,
7585
- zr as useOverview,
7615
+ $r as useOverview,
7586
7616
  Or as useQuestionnaire,
7587
7617
  _r as useRiskScoring,
7588
- $r as useUploadDocument,
7618
+ zr as useUploadDocument,
7589
7619
  Pn as validateFileSize,
7590
7620
  Ln as validateFileType
7591
7621
  };