@vpdev2/metakyc-sdk 1.0.50 → 1.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ var ft = (e, t, n) => t in e ? yt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var te = (e, t, n) => ft(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import xt from "axios";
5
5
  import * as tt from "react";
6
- import fe, { createContext as bt, useState as b, useMemo as Ae, useEffect as re, useContext as vt, useRef as X, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
6
+ import fe, { createContext as bt, useState as v, useMemo as Ae, useEffect as re, useContext as vt, useRef as X, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
7
7
  import { jsx as r, jsxs as i, Fragment as wt } from "react/jsx-runtime";
8
8
  import { createPortal as ot } from "react-dom";
9
9
  import { useForm as kt, Controller as Re } from "react-hook-form";
@@ -907,7 +907,16 @@ class Xt {
907
907
  }), n.result.applicantFormVisibleFields && n.result.applicantFormVisibleFields.length > 0 && (a.applicantFormVisibleFields = n.result.applicantFormVisibleFields), n.result.applicantFormRequiredFields && n.result.applicantFormRequiredFields.length > 0 && (a.applicantFormRequiredFields = n.result.applicantFormRequiredFields), n.result.allowedLanguages && n.result.allowedLanguages.length > 0 && (a.allowedLanguages = n.result.allowedLanguages), n.result.applicantFormPages)
908
908
  try {
909
909
  const s = typeof n.result.applicantFormPages == "string" ? JSON.parse(n.result.applicantFormPages) : n.result.applicantFormPages;
910
- Array.isArray(s) && s.length > 0 && (a.applicantFormPages = s);
910
+ Array.isArray(s) && s.length > 0 && (a.applicantFormPages = s.map((o) => {
911
+ const l = !o._v || o._v < 4;
912
+ return {
913
+ ...o,
914
+ fields: (o.fields || []).map((c) => ({
915
+ ...c,
916
+ colSpan: l ? c.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, c.colSpan ?? 4))
917
+ }))
918
+ };
919
+ }));
911
920
  } catch {
912
921
  }
913
922
  return a;
@@ -1778,7 +1787,7 @@ class or {
1778
1787
  }
1779
1788
  }
1780
1789
  const ct = bt(null), nn = ({ config: e, children: t }) => {
1781
- const [n, a] = b(null), s = fe.useRef(!1), o = fe.useRef(!1), l = Ae(() => {
1790
+ const [n, a] = v(null), s = fe.useRef(!1), o = fe.useRef(!1), l = Ae(() => {
1782
1791
  const u = new zt(e), m = new Bt(u), x = new $t(u), p = new _t(u), y = new Ut(u), g = new Ht(u), h = new qt(u), S = new Kt(u), F = new jt(u), w = new Wt(u), M = new Xt(u), A = new or();
1783
1792
  return {
1784
1793
  httpClient: u,
@@ -1922,7 +1931,7 @@ function cn() {
1922
1931
  ur(), pr();
1923
1932
  }
1924
1933
  function hr(e) {
1925
- const { createOrchestrator: t } = ye(), [n, a] = b(null), [s, o] = b(!1), [l, c] = b(null), u = X(null), m = e || dr();
1934
+ const { createOrchestrator: t } = ye(), [n, a] = v(null), [s, o] = v(!1), [l, c] = v(null), u = X(null), m = e || dr();
1926
1935
  re(() => {
1927
1936
  u.current || (u.current = t());
1928
1937
  }, [t]), re(() => {
@@ -2032,7 +2041,7 @@ function hr(e) {
2032
2041
  };
2033
2042
  }
2034
2043
  function gr(e) {
2035
- const { questionnaireService: t, applicantService: n } = ye(), [a, s] = b(null), [o, l] = b({}), [c, u] = b(!1), [m, x] = b(!1), [p, y] = b(null), g = X(!1), h = X(null), S = Q(async () => {
2044
+ const { questionnaireService: t, applicantService: n } = ye(), [a, s] = v(null), [o, l] = v({}), [c, u] = v(!1), [m, x] = v(!1), [p, y] = v(null), g = X(!1), h = X(null), S = Q(async () => {
2036
2045
  var w, M;
2037
2046
  if (e) {
2038
2047
  if (g.current) {
@@ -2091,7 +2100,7 @@ function gr(e) {
2091
2100
  };
2092
2101
  }
2093
2102
  function yr(e) {
2094
- const { uploadDocumentService: t } = ye(), [n, a] = b(null), [s, o] = b(!1), [l, c] = b(!1), [u, m] = b(0), [x, p] = b(null), y = X(!1), g = X(null), h = Q(async () => {
2103
+ const { uploadDocumentService: t } = ye(), [n, a] = v(null), [s, o] = v(!1), [l, c] = v(!1), [u, m] = v(0), [x, p] = v(null), y = X(!1), g = X(null), h = Q(async () => {
2095
2104
  if (e) {
2096
2105
  if (y.current) {
2097
2106
  console.log("[UploadDocument] Load already in progress, skipping...");
@@ -2135,7 +2144,7 @@ function yr(e) {
2135
2144
  };
2136
2145
  }
2137
2146
  function dn(e) {
2138
- const { appropriatenessTestService: t } = ye(), [n, a] = b(null), [s, o] = b(!1), [l, c] = b(!1), [u, m] = b(null), [x, p] = b(null), y = X(!1), g = X(null), h = Q(async () => {
2147
+ const { appropriatenessTestService: t } = ye(), [n, a] = v(null), [s, o] = v(!1), [l, c] = v(!1), [u, m] = v(null), [x, p] = v(null), y = X(!1), g = X(null), h = Q(async () => {
2139
2148
  if (e) {
2140
2149
  if (y.current) {
2141
2150
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
@@ -2180,7 +2189,7 @@ function dn(e) {
2180
2189
  };
2181
2190
  }
2182
2191
  function fr(e) {
2183
- const { overviewService: t } = ye(), [n, a] = b(null), [s, o] = b(!1), [l, c] = b(!1), [u, m] = b(null), x = X(!1), p = X(null), y = Q(async () => {
2192
+ const { overviewService: t } = ye(), [n, a] = v(null), [s, o] = v(!1), [l, c] = v(!1), [u, m] = v(null), x = X(!1), p = X(null), y = Q(async () => {
2184
2193
  if (e) {
2185
2194
  if (x.current) {
2186
2195
  console.log("[Overview] Load already in progress, skipping...");
@@ -2222,9 +2231,9 @@ function fr(e) {
2222
2231
  };
2223
2232
  }
2224
2233
  function xr(e) {
2225
- const { identityService: t } = ye(), [n, a] = b(
2234
+ const { identityService: t } = ye(), [n, a] = v(
2226
2235
  null
2227
- ), [s, o] = b(!1), [l, c] = b(null), u = X(!1), m = Q(
2236
+ ), [s, o] = v(!1), [l, c] = v(null), u = X(!1), m = Q(
2228
2237
  async (y, g) => {
2229
2238
  if (e) {
2230
2239
  if (u.current) {
@@ -2308,7 +2317,7 @@ function xr(e) {
2308
2317
  };
2309
2318
  }
2310
2319
  function br(e) {
2311
- const { riskScoringService: t, applicantService: n } = ye(), [a, s] = b(null), [o, l] = b({}), [c, u] = b(!1), [m, x] = b(!1), [p, y] = b(null), [g, h] = b(null), S = X(!1), F = X(null), w = Q(async () => {
2320
+ const { riskScoringService: t, applicantService: n } = ye(), [a, s] = v(null), [o, l] = v({}), [c, u] = v(!1), [m, x] = v(!1), [p, y] = v(null), [g, h] = v(null), S = X(!1), F = X(null), w = Q(async () => {
2312
2321
  var A;
2313
2322
  if (e) {
2314
2323
  if (S.current) {
@@ -2369,7 +2378,7 @@ function br(e) {
2369
2378
  };
2370
2379
  }
2371
2380
  function vr() {
2372
- const { applicantService: e, config: t } = ye(), [n, a] = b(!1), [s, o] = b(null), l = X(!1), c = X(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(g) {
2381
+ const { applicantService: e, config: t } = ye(), [n, a] = v(!1), [s, o] = v(null), l = X(!1), c = X(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(g) {
2373
2382
  const h = Math.random() * 16 | 0;
2374
2383
  return (g === "x" ? h : h & 3 | 8).toString(16);
2375
2384
  }), m = Q(
@@ -2698,7 +2707,7 @@ const nt = 280, wr = ({
2698
2707
  disabled: o = !1,
2699
2708
  required: l = !1
2700
2709
  }) => {
2701
- const [c, u] = b(!1), [m, x] = b(""), [p, y] = b(null), g = X(null), h = X(null), S = X(null), F = Q(() => {
2710
+ const [c, u] = v(!1), [m, x] = v(""), [p, y] = v(null), g = X(null), h = X(null), S = X(null), F = Q(() => {
2702
2711
  if (!h.current) return null;
2703
2712
  const N = h.current.getBoundingClientRect(), ne = window.innerHeight - N.bottom < nt && N.top > nt;
2704
2713
  return { top: ne ? N.top : N.bottom + 4, left: N.left, width: N.width, openUp: ne };
@@ -2941,7 +2950,7 @@ const nt = 280, wr = ({
2941
2950
  className: m
2942
2951
  }) => {
2943
2952
  var D;
2944
- const [x, p] = b(!1), [y, g] = b(""), [h, S] = b(null), F = X(null), w = X(null), M = X(null), A = X(null), I = Q(() => {
2953
+ const [x, p] = v(!1), [y, g] = v(""), [h, S] = v(null), F = X(null), w = X(null), M = X(null), A = X(null), I = Q(() => {
2945
2954
  if (!w.current) return null;
2946
2955
  const C = w.current.getBoundingClientRect(), ee = window.innerHeight - C.bottom < at && C.top > at;
2947
2956
  return {
@@ -3142,7 +3151,7 @@ const kr = ({
3142
3151
  value: l = [],
3143
3152
  className: c
3144
3153
  }) => {
3145
- const [u, m] = b(!1), x = X(null), p = (w) => {
3154
+ const [u, m] = v(!1), x = X(null), p = (w) => {
3146
3155
  if (!w) return;
3147
3156
  const M = Array.from(w);
3148
3157
  if (s && M.filter((I) => I.size > s).length > 0) {
@@ -3487,7 +3496,7 @@ const Lr = ({
3487
3496
  onComplete: t,
3488
3497
  onBack: n
3489
3498
  }) => {
3490
- const { questionnaire: a, initialAnswers: s, isLoading: o, isSubmitting: l, error: c, submit: u } = gr(e), [m, x] = b({}), [p, y] = b({}), [g, h] = b(0);
3499
+ const { questionnaire: a, initialAnswers: s, isLoading: o, isSubmitting: l, error: c, submit: u } = gr(e), [m, x] = v({}), [p, y] = v({}), [g, h] = v(0);
3491
3500
  fe.useEffect(() => {
3492
3501
  s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && x(s);
3493
3502
  }, [s]);
@@ -3715,7 +3724,7 @@ const Lr = ({
3715
3724
  onComplete: t,
3716
3725
  onBack: n
3717
3726
  }) => {
3718
- const { uploadDocument: a, isLoading: s, isSubmitting: o, error: l, submit: c } = yr(e), [u, m] = b({}), x = async (p) => {
3727
+ const { uploadDocument: a, isLoading: s, isSubmitting: o, error: l, submit: c } = yr(e), [u, m] = v({}), x = async (p) => {
3719
3728
  if (p.preventDefault(), !a) return;
3720
3729
  const y = await Promise.all(
3721
3730
  a.uploadDocumentFiles.map(async (h) => {
@@ -3846,7 +3855,7 @@ const _r = ({
3846
3855
  onComplete: t,
3847
3856
  onBack: n
3848
3857
  }) => {
3849
- const { criteria: a, initialAnswers: s, isLoading: o, isSubmitting: l, error: c, submit: u } = br(e), [m, x] = b({}), [p, y] = b({}), [g, h] = b(0), [S, F] = b(!1);
3858
+ const { criteria: a, initialAnswers: s, isLoading: o, isSubmitting: l, error: c, submit: u } = br(e), [m, x] = v({}), [p, y] = v({}), [g, h] = v(0), [S, F] = v(!1);
3850
3859
  fe.useEffect(() => {
3851
3860
  s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && x(s);
3852
3861
  }, [s]);
@@ -4080,7 +4089,7 @@ const _r = ({
4080
4089
  onComplete: t,
4081
4090
  onBack: n
4082
4091
  }) => {
4083
- const { investorCategorizationService: a } = ye(), [s, o] = b(null), [l, c] = b(!1), [u, m] = b(null);
4092
+ const { investorCategorizationService: a } = ye(), [s, o] = v(null), [l, c] = v(!1), [u, m] = v(null);
4084
4093
  return /* @__PURE__ */ r("form", { onSubmit: async (p) => {
4085
4094
  if (p.preventDefault(), s === null) {
4086
4095
  m("Please select an investor type");
@@ -4218,7 +4227,7 @@ const _r = ({
4218
4227
  onComplete: t,
4219
4228
  onBack: n
4220
4229
  }) => {
4221
- const { appropriatenessTestService: a } = ye(), [s, o] = b(null), [l, c] = b(!0), [u, m] = b(!1), [x, p] = b(null), [y, g] = b({}), [h, S] = b(0), [F, w] = b(!1), [M, A] = b(!1), [I, H] = b(0);
4230
+ const { appropriatenessTestService: a } = ye(), [s, o] = v(null), [l, c] = v(!0), [u, m] = v(!1), [x, p] = v(null), [y, g] = v({}), [h, S] = v(0), [F, w] = v(!1), [M, A] = v(!1), [I, H] = v(0);
4222
4231
  re(() => {
4223
4232
  (async () => {
4224
4233
  try {
@@ -4501,7 +4510,7 @@ Failed to reload test data. Please refresh the page.`);
4501
4510
  onBack: n
4502
4511
  }) => {
4503
4512
  var Z, N, _, ne;
4504
- const { applicantService: a, baseInformationService: s, config: o } = ye(), { identityData: l, provider: c, token: u, isLoading: m, error: x, requestIdentity: p, restartIdentity: y } = xr(e), [g, h] = b(null), [S, F] = b(null), [w, M] = b([]), [A, I] = b(!0), [H, J] = b(!1), [f, k] = b(null), [E, O] = b(!1), P = fe.useRef(!1), W = kt({
4513
+ const { applicantService: a, baseInformationService: s, config: o } = ye(), { identityData: l, provider: c, token: u, isLoading: m, error: x, requestIdentity: p, restartIdentity: y } = xr(e), [g, h] = v(null), [S, F] = v(null), [w, M] = v([]), [A, I] = v(!0), [H, J] = v(!1), [f, k] = v(null), [E, O] = v(!1), P = fe.useRef(!1), W = kt({
4505
4514
  defaultValues: {
4506
4515
  street: "",
4507
4516
  streetNumber: "",
@@ -5110,20 +5119,20 @@ const $e = {
5110
5119
  if ($) for (const T of $) d.add(T);
5111
5120
  if (p)
5112
5121
  for (const T of p)
5113
- for (const v of T.fields)
5114
- !v.isCustom && v.name && v.required && d.add(v.name);
5122
+ for (const b of T.fields)
5123
+ !b.isCustom && b.name && b.required && d.add(b.name);
5115
5124
  return Array.from(d);
5116
5125
  }, [l == null ? void 0 : l.applicantFormRequiredFields, p]), g = Ae(() => {
5117
5126
  var T;
5118
5127
  if (p) {
5119
- const v = p.flatMap((Y) => Y.fields).filter((Y) => !Y.isCustom && Y.name).map((Y) => Y.name), R = new Set(v);
5128
+ const b = p.flatMap((Y) => Y.fields).filter((Y) => !Y.isCustom && Y.name).map((Y) => Y.name), R = new Set(b);
5120
5129
  for (const Y of Ye) R.add(Y);
5121
5130
  return Array.from(R);
5122
5131
  }
5123
5132
  let d;
5124
5133
  (T = s.applicantForm) != null && T.visibleFields ? d = s.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? d = l.applicantFormVisibleFields : d = Tt;
5125
5134
  const $ = new Set(d);
5126
- for (const v of Ye) $.add(v);
5135
+ for (const b of Ye) $.add(b);
5127
5136
  return Array.from($);
5128
5137
  }, [(Xe = s.applicantForm) == null ? void 0 : Xe.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields, p]), h = /* @__PURE__ */ new Set([
5129
5138
  "country",
@@ -5136,19 +5145,19 @@ const $e = {
5136
5145
  var $, T;
5137
5146
  const d = /* @__PURE__ */ new Set();
5138
5147
  if (p)
5139
- for (const v of p)
5140
- for (const R of v.fields)
5148
+ for (const b of p)
5149
+ for (const R of b.fields)
5141
5150
  !R.isCustom && R.name && h.has(R.name) && d.add(R.countriesType ?? (($ = Le[R.name]) == null ? void 0 : $.countriesType));
5142
5151
  else
5143
- for (const v of g)
5144
- h.has(v) && d.add((T = Le[v]) == null ? void 0 : T.countriesType);
5152
+ for (const b of g)
5153
+ h.has(b) && d.add((T = Le[b]) == null ? void 0 : T.countriesType);
5145
5154
  return d.size === 0 && d.add(void 0), Array.from(d);
5146
- }, [g, p]), [F, w] = b({}), [M, A] = b(!0), I = X(!1), H = X(/* @__PURE__ */ new Set());
5155
+ }, [g, p]), [F, w] = v({}), [M, A] = v(!0), I = X(!1), H = X(/* @__PURE__ */ new Set());
5147
5156
  re(() => {
5148
5157
  if (I.current || S.length === 0) return;
5149
5158
  const d = S.filter((T) => {
5150
- const v = T != null ? String(T) : "all";
5151
- return !H.current.has(v);
5159
+ const b = T != null ? String(T) : "all";
5160
+ return !H.current.has(b);
5152
5161
  });
5153
5162
  if (d.length === 0) {
5154
5163
  A(!1);
@@ -5157,12 +5166,12 @@ const $e = {
5157
5166
  I.current = !0, A(!0), (async () => {
5158
5167
  try {
5159
5168
  const T = await Promise.all(
5160
- d.map(async (v) => {
5161
- const R = v != null ? String(v) : "all", Y = await o.getCountries("", s.locale || "en", v), ae = /* @__PURE__ */ new Set(), se = Y.map((ie) => ({ value: ie.abbreviation3 || ie.abbreviation, label: ie.name })).filter((ie) => !ie.value || ae.has(ie.value) ? !1 : (ae.add(ie.value), !0));
5169
+ d.map(async (b) => {
5170
+ const R = b != null ? String(b) : "all", Y = await o.getCountries("", s.locale || "en", b), ae = /* @__PURE__ */ new Set(), se = Y.map((ie) => ({ value: ie.abbreviation3 || ie.abbreviation, label: ie.name })).filter((ie) => !ie.value || ae.has(ie.value) ? !1 : (ae.add(ie.value), !0));
5162
5171
  return H.current.add(R), [R, se];
5163
5172
  })
5164
5173
  );
5165
- w((v) => ({ ...v, ...Object.fromEntries(T) }));
5174
+ w((b) => ({ ...b, ...Object.fromEntries(T) }));
5166
5175
  } catch (T) {
5167
5176
  console.error("Failed to load countries:", T);
5168
5177
  } finally {
@@ -5172,9 +5181,9 @@ const $e = {
5172
5181
  }, [S]);
5173
5182
  const J = (d, $) => {
5174
5183
  var R;
5175
- const T = $ ?? ((R = Le[d]) == null ? void 0 : R.countriesType), v = T != null ? String(T) : "all";
5176
- return F[v] || [];
5177
- }, [f, k] = b({
5184
+ const T = $ ?? ((R = Le[d]) == null ? void 0 : R.countriesType), b = T != null ? String(T) : "all";
5185
+ return F[b] || [];
5186
+ }, [f, k] = v({
5178
5187
  workflowKey: m,
5179
5188
  firstName: "",
5180
5189
  lastName: "",
@@ -5199,19 +5208,19 @@ const $e = {
5199
5208
  educationLevel: "",
5200
5209
  occupation: "",
5201
5210
  taxNumber: ""
5202
- }), [E, O] = b({}), [P, W] = b(0), [z, L] = b({}), [Z, N] = b(null), [_, ne] = b(!1), B = (d, $) => k((T) => ({ ...T, [d]: $ })), D = (d, $) => O((T) => ({ ...T, [d]: $ })), C = (d) => !d.conditionalOn || E[d.conditionalOn] === "true", U = p && P < p.length - 1 ? P + 1 : -1, ee = p && P > 0 ? P - 1 : -1, j = (d) => {
5211
+ }), [E, O] = v({}), [P, W] = v(0), [z, L] = v({}), [Z, N] = v(null), [_, ne] = v(!1), B = (d, $) => k((T) => ({ ...T, [d]: $ })), D = (d, $) => O((T) => ({ ...T, [d]: $ })), C = (d) => !d.conditionalOn || E[d.conditionalOn] === "true", U = p && P < p.length - 1 ? P + 1 : -1, ee = p && P > 0 ? P - 1 : -1, j = (d) => {
5203
5212
  var T;
5204
5213
  const $ = {};
5205
- for (const v of d.fields)
5206
- if (v.isCustom) {
5207
- if (v.required && v.paramName) {
5208
- const R = E[v.paramName], Y = v.displayText || v.label || v.paramName;
5209
- v.customType === "checkbox" || v.customType === "link_checkbox" ? R !== "true" && ($[v.paramName] = `${Y} is required.`) : (!R || R.trim() === "") && ($[v.paramName] = `${Y} is required.`);
5214
+ for (const b of d.fields)
5215
+ if (b.isCustom) {
5216
+ if (b.required && b.paramName) {
5217
+ const R = E[b.paramName], Y = b.displayText || b.label || b.paramName;
5218
+ b.customType === "checkbox" || b.customType === "link_checkbox" ? R !== "true" && ($[b.paramName] = `${Y} is required.`) : (!R || R.trim() === "") && ($[b.paramName] = `${Y} is required.`);
5210
5219
  }
5211
- } else if (v.name) {
5212
- const R = v.name;
5220
+ } else if (b.name) {
5221
+ const R = b.name;
5213
5222
  if (y.includes(R) && He(f[R])) {
5214
- const Y = v.displayText || ((T = Le[R]) == null ? void 0 : T.label) || R;
5223
+ const Y = b.displayText || ((T = Le[R]) == null ? void 0 : T.label) || R;
5215
5224
  $[R] = `${Y} is required.`;
5216
5225
  }
5217
5226
  }
@@ -5250,25 +5259,25 @@ const $e = {
5250
5259
  externalRefId: f.externalRefId.trim()
5251
5260
  };
5252
5261
  if (p) {
5253
- for (const v of p)
5254
- if (C(v)) {
5255
- for (const R of v.fields)
5262
+ for (const b of p)
5263
+ if (C(b)) {
5264
+ for (const R of b.fields)
5256
5265
  if (!R.isCustom && R.name) {
5257
5266
  const Y = R.name, ae = f[Y];
5258
5267
  He(ae) || (d[Y] = ae);
5259
5268
  }
5260
5269
  }
5261
5270
  } else
5262
- g.forEach((v) => {
5263
- if (v === "externalRefId") return;
5264
- const R = f[v];
5265
- He(R) || (d[v] = R);
5271
+ g.forEach((b) => {
5272
+ if (b === "externalRefId") return;
5273
+ const R = f[b];
5274
+ He(R) || (d[b] = R);
5266
5275
  });
5267
5276
  const $ = [];
5268
5277
  if (p) {
5269
- for (const v of p)
5270
- if (C(v)) {
5271
- for (const R of v.fields)
5278
+ for (const b of p)
5279
+ if (C(b)) {
5280
+ for (const R of b.fields)
5272
5281
  if (R.isCustom && R.paramName) {
5273
5282
  const Y = E[R.paramName] ?? "";
5274
5283
  $.push({ paramName: R.paramName, paramValue: Y });
@@ -5288,12 +5297,12 @@ const $e = {
5288
5297
  d.preventDefault();
5289
5298
  for (const T of y)
5290
5299
  if (He(f[T])) {
5291
- const v = (($ = Le[T]) == null ? void 0 : $.label) || T;
5292
- N(`${v} is required.`);
5300
+ const b = (($ = Le[T]) == null ? void 0 : $.label) || T;
5301
+ N(`${b} is required.`);
5293
5302
  return;
5294
5303
  }
5295
5304
  await he();
5296
- }, Ve = (d, $, T, v) => {
5305
+ }, Ve = (d, $, T, b) => {
5297
5306
  var et;
5298
5307
  const R = Le[d];
5299
5308
  if (!R) return null;
@@ -5301,7 +5310,7 @@ const $e = {
5301
5310
  switch (R.type) {
5302
5311
  case "select":
5303
5312
  if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth" || d === "mobileCountryCode") {
5304
- const le = J(d, v);
5313
+ const le = J(d, b);
5305
5314
  return /* @__PURE__ */ r(
5306
5315
  je,
5307
5316
  {
@@ -5352,7 +5361,7 @@ const $e = {
5352
5361
  return null;
5353
5362
  case "multiselect":
5354
5363
  if (d === "otherNationality") {
5355
- const le = J(d, v);
5364
+ const le = J(d, b);
5356
5365
  return /* @__PURE__ */ r(
5357
5366
  wr,
5358
5367
  {
@@ -5423,7 +5432,7 @@ const $e = {
5423
5432
  }
5424
5433
  }, ht = (d, $) => {
5425
5434
  if (!d.paramName) return null;
5426
- const T = z[d.paramName], v = d.displayText || d.label || d.paramName;
5435
+ const T = z[d.paramName], b = d.displayText || d.label || d.paramName;
5427
5436
  if (d.customType === "checkbox")
5428
5437
  return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
5429
5438
  /* @__PURE__ */ i(
@@ -5448,7 +5457,7 @@ const $e = {
5448
5457
  className: "metakyc-option-text",
5449
5458
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5450
5459
  children: [
5451
- v,
5460
+ b,
5452
5461
  d.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5453
5462
  ]
5454
5463
  }
@@ -5482,7 +5491,7 @@ const $e = {
5482
5491
  className: "metakyc-option-text",
5483
5492
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5484
5493
  children: [
5485
- v,
5494
+ b,
5486
5495
  " ",
5487
5496
  d.linkUrl && /* @__PURE__ */ r(
5488
5497
  "a",
@@ -5514,7 +5523,7 @@ const $e = {
5514
5523
  className: "text-sm font-medium",
5515
5524
  style: { color: "var(--metakyc-text-primary, #111827)" },
5516
5525
  children: [
5517
- v,
5526
+ b,
5518
5527
  d.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5519
5528
  ]
5520
5529
  }
@@ -5560,7 +5569,7 @@ const $e = {
5560
5569
  className: "text-sm font-medium",
5561
5570
  style: { color: "var(--metakyc-text-primary, #111827)" },
5562
5571
  children: [
5563
- v,
5572
+ b,
5564
5573
  d.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5565
5574
  ]
5566
5575
  }
@@ -5599,7 +5608,7 @@ const $e = {
5599
5608
  me,
5600
5609
  {
5601
5610
  type: "text",
5602
- label: `${v}${d.required ? " *" : ""}`,
5611
+ label: `${b}${d.required ? " *" : ""}`,
5603
5612
  value: E[d.paramName] || "",
5604
5613
  onChange: (R) => D(d.paramName, R.target.value),
5605
5614
  required: d.required,
@@ -5621,7 +5630,7 @@ const $e = {
5621
5630
  {
5622
5631
  type: "checkbox",
5623
5632
  checked: T,
5624
- onChange: (v) => D(d.conditionalOn, v.target.checked ? "true" : "false"),
5633
+ onChange: (b) => D(d.conditionalOn, b.target.checked ? "true" : "false"),
5625
5634
  className: "metakyc-option-input",
5626
5635
  style: $e
5627
5636
  }
@@ -5637,9 +5646,9 @@ const $e = {
5637
5646
  ]
5638
5647
  }
5639
5648
  ),
5640
- T && /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: d.fields.map((v, R) => {
5641
- const Y = v.colSpan === 1 ? "col-span-1" : "col-span-2", ae = v.isCustom ? `custom-${R}-${v.paramName}` : `builtin-${v.name}-${R}`;
5642
- return /* @__PURE__ */ r("div", { className: Y, children: v.isCustom ? ht(v, R) : Ve(v.name, ae, v.displayText, v.countriesType) }, ae);
5649
+ T && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: d.fields.map((b, R) => {
5650
+ const Y = b.colSpan === 1 ? "col-span-1" : b.colSpan === 2 ? "col-span-2" : b.colSpan === 3 ? "col-span-3" : "col-span-4", ae = b.isCustom ? `custom-${R}-${b.paramName}` : `builtin-${b.name}-${R}`;
5651
+ return /* @__PURE__ */ r("div", { className: Y, children: b.isCustom ? ht(b, R) : Ve(b.name, ae, b.displayText, b.countriesType) }, ae);
5643
5652
  }) })
5644
5653
  ] });
5645
5654
  };
@@ -5649,7 +5658,7 @@ const $e = {
5649
5658
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
5650
5659
  ] }) }) });
5651
5660
  if (p) {
5652
- const d = p[P] ?? p[0], $ = ee === -1, T = U === -1, v = p.length, R = C(d), Y = Object.values(z);
5661
+ const d = p[P] ?? p[0], $ = ee === -1, T = U === -1, b = p.length, R = C(d), Y = Object.values(z);
5653
5662
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(q, { children: [
5654
5663
  /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
5655
5664
  /* @__PURE__ */ i(K, { children: [
@@ -5687,7 +5696,7 @@ const $e = {
5687
5696
  ] }),
5688
5697
  Y.map((ae, se) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ae }, se))
5689
5698
  ] }),
5690
- v > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
5699
+ b > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
5691
5700
  p.map((ae, se) => /* @__PURE__ */ r(
5692
5701
  "div",
5693
5702
  {
@@ -5699,7 +5708,7 @@ const $e = {
5699
5708
  /* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
5700
5709
  P + 1,
5701
5710
  " / ",
5702
- v
5711
+ b
5703
5712
  ] })
5704
5713
  ] }),
5705
5714
  gt(d)
@@ -5740,7 +5749,7 @@ const $e = {
5740
5749
  " ",
5741
5750
  Z
5742
5751
  ] }) }),
5743
- /* @__PURE__ */ r("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: g.map((d) => Ve(d)) })
5752
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: g.map((d) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ve(d) }, d)) })
5744
5753
  ] }),
5745
5754
  /* @__PURE__ */ i(pe, { className: "flex justify-between", children: [
5746
5755
  a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: _ || u, children: "Cancel" }),