@arudovwen/form-builder-react 1.5.4 → 1.5.6

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.
@@ -27,11 +27,11 @@ function wo() {
27
27
  if (ee) return Gi;
28
28
  ee = 1;
29
29
  var i = bi, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
30
- function d(t, u, c) {
31
- var r, v = {}, m = null, h = null;
32
- c !== void 0 && (m = "" + c), u.key !== void 0 && (m = "" + u.key), u.ref !== void 0 && (h = u.ref);
33
- for (r in u) s.call(u, r) && !l.hasOwnProperty(r) && (v[r] = u[r]);
34
- if (t && t.defaultProps) for (r in u = t.defaultProps, u) v[r] === void 0 && (v[r] = u[r]);
30
+ function d(t, u, r) {
31
+ var c, v = {}, m = null, h = null;
32
+ r !== void 0 && (m = "" + r), u.key !== void 0 && (m = "" + u.key), u.ref !== void 0 && (h = u.ref);
33
+ for (c in u) s.call(u, c) && !l.hasOwnProperty(c) && (v[c] = u[c]);
34
+ if (t && t.defaultProps) for (c in u = t.defaultProps, u) v[c] === void 0 && (v[c] = u[c]);
35
35
  return { $$typeof: e, type: t, key: m, ref: h, props: v, _owner: a.current };
36
36
  }
37
37
  return Gi.Fragment = o, Gi.jsx = d, Gi.jsxs = d, Gi;
@@ -49,7 +49,7 @@ var Hi = {};
49
49
  var oe;
50
50
  function Bo() {
51
51
  return oe || (oe = 1, process.env.NODE_ENV !== "production" && function() {
52
- var i = bi, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), t = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), r = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), f = Symbol.iterator, y = "@@iterator";
52
+ var i = bi, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), t = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), r = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), f = Symbol.iterator, y = "@@iterator";
53
53
  function g(b) {
54
54
  if (b === null || typeof b != "object")
55
55
  return null;
@@ -77,7 +77,7 @@ function Bo() {
77
77
  var S = !1, j = !1, A = !1, N = !1, E = !1, ei;
78
78
  ei = Symbol.for("react.module.reference");
79
79
  function Y(b) {
80
- return !!(typeof b == "string" || typeof b == "function" || b === s || b === l || E || b === a || b === c || b === r || N || b === h || S || j || A || typeof b == "object" && b !== null && (b.$$typeof === m || b.$$typeof === v || b.$$typeof === d || b.$$typeof === t || b.$$typeof === u || // This needs to include all possible module reference object
80
+ return !!(typeof b == "string" || typeof b == "function" || b === s || b === l || E || b === a || b === r || b === c || N || b === h || S || j || A || typeof b == "object" && b !== null && (b.$$typeof === m || b.$$typeof === v || b.$$typeof === d || b.$$typeof === t || b.$$typeof === u || // This needs to include all possible module reference object
81
81
  // types supported by any Flight configuration anywhere since
82
82
  // we don't know which Flight build this will end up being used
83
83
  // with.
@@ -109,9 +109,9 @@ function Bo() {
109
109
  return "Profiler";
110
110
  case a:
111
111
  return "StrictMode";
112
- case c:
113
- return "Suspense";
114
112
  case r:
113
+ return "Suspense";
114
+ case c:
115
115
  return "SuspenseList";
116
116
  }
117
117
  if (typeof b == "object")
@@ -305,9 +305,9 @@ function Bo() {
305
305
  if (typeof b == "string")
306
306
  return V(b);
307
307
  switch (b) {
308
- case c:
309
- return V("Suspense");
310
308
  case r:
309
+ return V("Suspense");
310
+ case c:
311
311
  return V("SuspenseList");
312
312
  }
313
313
  if (typeof b == "object")
@@ -649,7 +649,7 @@ const fi = ho(void 0), se = {
649
649
  disabled: !1,
650
650
  isHidden: !1
651
651
  }, je = ({ children: i }) => {
652
- const [e, o] = R(!0), [s, a] = R({}), [l, d] = R({}), [t, u] = R([se]), [c, r] = R(!1), [v, m] = R(null), [h, f] = R([
652
+ const [e, o] = R(!0), [s, a] = R({}), [l, d] = R({}), [t, u] = R([se]), [r, c] = R(!1), [v, m] = R(null), [h, f] = R([
653
653
  0
654
654
  ]), [y, g] = R(""), p = bi.useCallback(() => {
655
655
  }, []), x = bi.useCallback(() => {
@@ -887,8 +887,8 @@ const fi = ho(void 0), se = {
887
887
  addSection: x,
888
888
  removeSection: C,
889
889
  updateSection: L,
890
- isDragging: c,
891
- setIsDragging: r,
890
+ isDragging: r,
891
+ setIsDragging: c,
892
892
  selectedSection: v,
893
893
  setSelectedSection: m,
894
894
  activeSections: h,
@@ -915,7 +915,7 @@ const fi = ho(void 0), se = {
915
915
  x,
916
916
  C,
917
917
  L,
918
- c,
918
+ r,
919
919
  v,
920
920
  h,
921
921
  ei,
@@ -1125,13 +1125,13 @@ const Nn = ({
1125
1125
  maxDate: t,
1126
1126
  showYearDropdown: u
1127
1127
  }) => {
1128
- const c = i ? new Date(i) : null, [r, v] = R(c);
1128
+ const r = i ? new Date(i) : null, [c, v] = R(r);
1129
1129
  O(() => {
1130
1130
  const h = i ? new Date(i) : null;
1131
- (h && r && h.getTime() !== r.getTime() || !h && r || h && !r) && v(h);
1131
+ (h && c && h.getTime() !== c.getTime() || !h && c || h && !c) && v(h);
1132
1132
  }, [i]), O(() => {
1133
- e && e(a, r);
1134
- }, [r, e, a]);
1133
+ e && e(a, c);
1134
+ }, [c, e, a]);
1135
1135
  const m = (h) => {
1136
1136
  v(h);
1137
1137
  };
@@ -1143,7 +1143,7 @@ const Nn = ({
1143
1143
  showPopperArrow: !1,
1144
1144
  dateFormat: s,
1145
1145
  disabled: o,
1146
- selected: r,
1146
+ selected: c,
1147
1147
  onChange: m,
1148
1148
  className: "field-control",
1149
1149
  portalId: "root-portal",
@@ -1324,12 +1324,12 @@ const Be = /^[a-z0-9]+(-[a-z0-9]+)*$/, ln = (i, e, o, s = "") => {
1324
1324
  }
1325
1325
  if (a.length > 3 || !a.length) return null;
1326
1326
  if (a.length > 1) {
1327
- const t = a.pop(), u = a.pop(), c = {
1327
+ const t = a.pop(), u = a.pop(), r = {
1328
1328
  provider: a.length > 0 ? a[0] : s,
1329
1329
  prefix: u,
1330
1330
  name: t
1331
1331
  };
1332
- return e && !$i(c) ? null : c;
1332
+ return e && !$i(r) ? null : r;
1333
1333
  }
1334
1334
  const l = a[0], d = l.split("-");
1335
1335
  if (d.length > 1) {
@@ -1462,18 +1462,18 @@ function Yo(i, e) {
1462
1462
  }
1463
1463
  C % 2 === 1 && (a.left !== a.top && (S = a.left, a.left = a.top, a.top = S), a.width !== a.height && (S = a.width, a.width = a.height, a.height = S)), g.length && (l = _o(l, '<g transform="' + g.join(" ") + '">', "</g>"));
1464
1464
  });
1465
- const d = s.width, t = s.height, u = a.width, c = a.height;
1466
- let r, v;
1467
- d === null ? (v = t === null ? "1em" : t === "auto" ? c : t, r = te(v, u / c)) : (r = d === "auto" ? u : d, v = t === null ? te(r, c / u) : t === "auto" ? c : t);
1465
+ const d = s.width, t = s.height, u = a.width, r = a.height;
1466
+ let c, v;
1467
+ d === null ? (v = t === null ? "1em" : t === "auto" ? r : t, c = te(v, u / r)) : (c = d === "auto" ? u : d, v = t === null ? te(c, r / u) : t === "auto" ? r : t);
1468
1468
  const m = {}, h = (y, g) => {
1469
1469
  Jo(g) || (m[y] = g.toString());
1470
1470
  };
1471
- h("width", r), h("height", v);
1471
+ h("width", c), h("height", v);
1472
1472
  const f = [
1473
1473
  a.left,
1474
1474
  a.top,
1475
1475
  u,
1476
- c
1476
+ r
1477
1477
  ];
1478
1478
  return m.viewBox = f.join(" "), {
1479
1479
  attributes: m,
@@ -1560,8 +1560,8 @@ const aa = (i, e, o) => {
1560
1560
  prefix: e,
1561
1561
  icons: []
1562
1562
  }, t = 0;
1563
- return o.forEach((u, c) => {
1564
- t += u.length + 1, t >= a && c > 0 && (s.push(d), d = {
1563
+ return o.forEach((u, r) => {
1564
+ t += u.length + 1, t >= a && r > 0 && (s.push(d), d = {
1565
1565
  type: l,
1566
1566
  provider: i,
1567
1567
  prefix: e,
@@ -1641,16 +1641,16 @@ function ua(i) {
1641
1641
  const d = l.icons, t = d.pending.length;
1642
1642
  d.pending = d.pending.filter((u) => {
1643
1643
  if (u.prefix !== a) return !0;
1644
- const c = u.name;
1645
- if (i.icons[c]) d.loaded.push({
1644
+ const r = u.name;
1645
+ if (i.icons[r]) d.loaded.push({
1646
1646
  provider: s,
1647
1647
  prefix: a,
1648
- name: c
1648
+ name: r
1649
1649
  });
1650
- else if (i.missing.has(c)) d.missing.push({
1650
+ else if (i.missing.has(r)) d.missing.push({
1651
1651
  provider: s,
1652
1652
  prefix: a,
1653
- name: c
1653
+ name: r
1654
1654
  });
1655
1655
  else
1656
1656
  return o = !0, !0;
@@ -1688,15 +1688,15 @@ function ra(i) {
1688
1688
  return i.forEach((a) => {
1689
1689
  if (s.name === a.name && s.prefix === a.prefix && s.provider === a.provider) return;
1690
1690
  s = a;
1691
- const l = a.provider, d = a.prefix, t = a.name, u = o[l] || (o[l] = /* @__PURE__ */ Object.create(null)), c = u[d] || (u[d] = Oi(l, d));
1692
- let r;
1693
- t in c.icons ? r = e.loaded : d === "" || c.missing.has(t) ? r = e.missing : r = e.pending;
1691
+ const l = a.provider, d = a.prefix, t = a.name, u = o[l] || (o[l] = /* @__PURE__ */ Object.create(null)), r = u[d] || (u[d] = Oi(l, d));
1692
+ let c;
1693
+ t in r.icons ? c = e.loaded : d === "" || r.missing.has(t) ? c = e.missing : c = e.pending;
1694
1694
  const v = {
1695
1695
  provider: l,
1696
1696
  prefix: d,
1697
1697
  name: t
1698
1698
  };
1699
- r.push(v);
1699
+ c.push(v);
1700
1700
  }), e;
1701
1701
  }
1702
1702
  function ma(i, e = !0, o = !1) {
@@ -1726,7 +1726,7 @@ function va(i, e, o, s) {
1726
1726
  d = d.concat(A);
1727
1727
  } else d = i.resources.slice(l).concat(i.resources.slice(0, l));
1728
1728
  const t = Date.now();
1729
- let u = "pending", c = 0, r, v = null, m = [], h = [];
1729
+ let u = "pending", r = 0, c, v = null, m = [], h = [];
1730
1730
  typeof s == "function" && h.push(s);
1731
1731
  function f() {
1732
1732
  v && (clearTimeout(v), v = null);
@@ -1744,7 +1744,7 @@ function va(i, e, o, s) {
1744
1744
  startTime: t,
1745
1745
  payload: e,
1746
1746
  status: u,
1747
- queriesSent: c,
1747
+ queriesSent: r,
1748
1748
  queriesPending: m.length,
1749
1749
  subscribe: g,
1750
1750
  abort: y
@@ -1752,7 +1752,7 @@ function va(i, e, o, s) {
1752
1752
  }
1753
1753
  function x() {
1754
1754
  u = "failed", h.forEach((A) => {
1755
- A(void 0, r);
1755
+ A(void 0, c);
1756
1756
  });
1757
1757
  }
1758
1758
  function C() {
@@ -1772,11 +1772,11 @@ function va(i, e, o, s) {
1772
1772
  return;
1773
1773
  }
1774
1774
  if (N === "abort") {
1775
- r = E, x();
1775
+ c = E, x();
1776
1776
  return;
1777
1777
  }
1778
1778
  if (ei) {
1779
- r = E, m.length || (d.length ? j() : x());
1779
+ c = E, m.length || (d.length ? j() : x());
1780
1780
  return;
1781
1781
  }
1782
1782
  if (f(), C(), !i.random) {
@@ -1808,7 +1808,7 @@ function va(i, e, o, s) {
1808
1808
  S(N, E, ei);
1809
1809
  }
1810
1810
  };
1811
- m.push(N), c++, v = setTimeout(j, i.rotate), o(A, e, N.callback);
1811
+ m.push(N), r++, v = setTimeout(j, i.rotate), o(A, e, N.callback);
1812
1812
  }
1813
1813
  return setTimeout(j), p;
1814
1814
  }
@@ -1821,11 +1821,11 @@ function De(i) {
1821
1821
  function s() {
1822
1822
  o = o.filter((t) => t().status === "pending");
1823
1823
  }
1824
- function a(t, u, c) {
1825
- const r = va(e, t, u, (v, m) => {
1826
- s(), c && c(v, m);
1824
+ function a(t, u, r) {
1825
+ const c = va(e, t, u, (v, m) => {
1826
+ s(), r && r(v, m);
1827
1827
  });
1828
- return o.push(r), r;
1828
+ return o.push(c), c;
1829
1829
  }
1830
1830
  function l(t) {
1831
1831
  return o.find((u) => t(u)) || null;
@@ -1921,20 +1921,20 @@ function xa(i, e) {
1921
1921
  if (delete i.iconsToLoad, !a || !a.length) return;
1922
1922
  const l = i.loadIcon;
1923
1923
  if (i.loadIcons && (a.length > 1 || !l)) {
1924
- be(i.loadIcons(a, s, o), (r) => {
1925
- Fi(i, a, r);
1924
+ be(i.loadIcons(a, s, o), (c) => {
1925
+ Fi(i, a, c);
1926
1926
  });
1927
1927
  return;
1928
1928
  }
1929
1929
  if (l) {
1930
- a.forEach((r) => {
1931
- const v = l(r, s, o);
1930
+ a.forEach((c) => {
1931
+ const v = l(c, s, o);
1932
1932
  be(v, (m) => {
1933
1933
  const h = m ? {
1934
1934
  prefix: s,
1935
- icons: { [r]: m }
1935
+ icons: { [c]: m }
1936
1936
  } : null;
1937
- Fi(i, [r], h);
1937
+ Fi(i, [c], h);
1938
1938
  });
1939
1939
  });
1940
1940
  return;
@@ -1946,9 +1946,9 @@ function xa(i, e) {
1946
1946
  Fi(i, d, null);
1947
1947
  return;
1948
1948
  }
1949
- u.prepare(o, s, d).forEach((r) => {
1950
- pa(o, r, (v) => {
1951
- Fi(i, r.icons, v);
1949
+ u.prepare(o, s, d).forEach((c) => {
1950
+ pa(o, c, (v) => {
1951
+ Fi(i, c.icons, v);
1952
1952
  });
1953
1953
  });
1954
1954
  }));
@@ -1966,17 +1966,17 @@ const ya = (i, e) => {
1966
1966
  const a = /* @__PURE__ */ Object.create(null), l = [];
1967
1967
  let d, t;
1968
1968
  return s.pending.forEach((u) => {
1969
- const { provider: c, prefix: r } = u;
1970
- if (r === t && c === d) return;
1971
- d = c, t = r, l.push(Oi(c, r));
1972
- const v = a[c] || (a[c] = /* @__PURE__ */ Object.create(null));
1973
- v[r] || (v[r] = []);
1969
+ const { provider: r, prefix: c } = u;
1970
+ if (c === t && r === d) return;
1971
+ d = r, t = c, l.push(Oi(r, c));
1972
+ const v = a[r] || (a[r] = /* @__PURE__ */ Object.create(null));
1973
+ v[c] || (v[c] = []);
1974
1974
  }), s.pending.forEach((u) => {
1975
- const { provider: c, prefix: r, name: v } = u, m = Oi(c, r), h = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
1976
- h.has(v) || (h.add(v), a[c][r].push(v));
1975
+ const { provider: r, prefix: c, name: v } = u, m = Oi(r, c), h = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
1976
+ h.has(v) || (h.add(v), a[r][c].push(v));
1977
1977
  }), l.forEach((u) => {
1978
- const c = a[u.provider][u.prefix];
1979
- c.length && xa(u, c);
1978
+ const r = a[u.provider][u.prefix];
1979
+ r.length && xa(u, r);
1980
1980
  }), e ? ca(e, s, l) : me;
1981
1981
  };
1982
1982
  function Aa(i, e) {
@@ -2150,27 +2150,27 @@ const Ra = (i, e, o) => {
2150
2150
  s[g] === void 0 && (u[g] = p);
2151
2151
  }
2152
2152
  }
2153
- const c = Yo(i, a), r = c.attributes;
2153
+ const r = Yo(i, a), c = r.attributes;
2154
2154
  if (a.inline && (d.verticalAlign = "-0.125em"), l === "svg") {
2155
2155
  u.style = {
2156
2156
  ...d,
2157
2157
  ...t
2158
- }, Object.assign(u, r);
2158
+ }, Object.assign(u, c);
2159
2159
  let g = 0, p = e.id;
2160
2160
  return typeof p == "string" && (p = p.replace(/-/g, "_")), u.dangerouslySetInnerHTML = {
2161
- __html: Ba(Qo(c.body, p ? () => p + "ID" + g++ : "iconifyReact"))
2161
+ __html: Ba(Qo(r.body, p ? () => p + "ID" + g++ : "iconifyReact"))
2162
2162
  }, Sn("svg", u);
2163
2163
  }
2164
2164
  const { body: v, width: m, height: h } = i, f = l === "mask" || (l === "bg" ? !1 : v.indexOf("currentColor") !== -1), y = ka(v, {
2165
- ...r,
2165
+ ...c,
2166
2166
  width: m + "",
2167
2167
  height: h + ""
2168
2168
  });
2169
2169
  return u.style = {
2170
2170
  ...d,
2171
2171
  "--svg": Ta(y),
2172
- width: pe(r.width),
2173
- height: pe(r.height),
2172
+ width: pe(c.width),
2173
+ height: pe(c.height),
2174
2174
  ...La,
2175
2175
  ...f ? Mn : Oe,
2176
2176
  ...t
@@ -2235,34 +2235,34 @@ function Ke(i) {
2235
2235
  const h = s.callback;
2236
2236
  h && (h(), a({}));
2237
2237
  }
2238
- function c(h) {
2238
+ function r(h) {
2239
2239
  if (JSON.stringify(d) !== JSON.stringify(h))
2240
2240
  return u(), t(h), !0;
2241
2241
  }
2242
- function r() {
2242
+ function c() {
2243
2243
  var h;
2244
2244
  const f = i.icon;
2245
2245
  if (typeof f == "object") {
2246
- c({
2246
+ r({
2247
2247
  name: "",
2248
2248
  data: f
2249
2249
  });
2250
2250
  return;
2251
2251
  }
2252
2252
  const y = ue(f);
2253
- if (c({
2253
+ if (r({
2254
2254
  name: f,
2255
2255
  data: y
2256
2256
  }))
2257
2257
  if (y === void 0) {
2258
- const g = ya([f], r);
2258
+ const g = ya([f], c);
2259
2259
  a({
2260
2260
  callback: g
2261
2261
  });
2262
2262
  } else y && ((h = i.onLoad) === null || h === void 0 || h.call(i, f));
2263
2263
  }
2264
2264
  O(() => (o(!0), u), []), O(() => {
2265
- e && r();
2265
+ e && c();
2266
2266
  }, [i.icon, e]);
2267
2267
  const { name: v, data: m } = d;
2268
2268
  return m ? Ra({
@@ -2297,10 +2297,10 @@ function In({
2297
2297
  isReadOnly: l,
2298
2298
  watch: d,
2299
2299
  getValues: t
2300
- } = e || {}, [u, c] = R(() => {
2300
+ } = e || {}, [u, r] = R(() => {
2301
2301
  const m = t == null ? void 0 : t(i.id);
2302
2302
  return Array.isArray(m) ? m : [];
2303
- }), r = si(
2303
+ }), c = si(
2304
2304
  () => u == null ? void 0 : u.map((m) => m.label).join(", "),
2305
2305
  [u]
2306
2306
  );
@@ -2310,7 +2310,7 @@ function In({
2310
2310
  if (!d) return;
2311
2311
  const m = d((h) => {
2312
2312
  const f = h[i.id];
2313
- f !== void 0 && c(Array.isArray(f) ? f : []);
2313
+ f !== void 0 && r(Array.isArray(f) ? f : []);
2314
2314
  });
2315
2315
  return () => {
2316
2316
  var h;
@@ -2321,7 +2321,7 @@ function In({
2321
2321
  {
2322
2322
  value: u || [],
2323
2323
  onChange: (m) => {
2324
- c(m), a == null || a(i.id, m);
2324
+ r(m), a == null || a(i.id, m);
2325
2325
  },
2326
2326
  multiple: !0,
2327
2327
  disabled: l,
@@ -2333,7 +2333,7 @@ function In({
2333
2333
  className: "custom-select__control field-control",
2334
2334
  disabled: l,
2335
2335
  children: [
2336
- /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (u == null ? void 0 : u.length) > 0 ? r : /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o != null ? o : " Select options" }) }),
2336
+ /* @__PURE__ */ n.jsx("span", { className: "custom-select__value", children: (u == null ? void 0 : u.length) > 0 ? c : /* @__PURE__ */ n.jsx("span", { className: "custom-select__placeholder", children: o != null ? o : " Select options" }) }),
2337
2337
  /* @__PURE__ */ n.jsx("span", { className: "custom-select__icon", children: /* @__PURE__ */ n.jsx(q, { icon: "lucide:chevron-down" }) })
2338
2338
  ]
2339
2339
  }
@@ -2410,9 +2410,9 @@ function He({
2410
2410
  else
2411
2411
  u(null);
2412
2412
  }, [i, l]);
2413
- const c = () => {
2413
+ const r = () => {
2414
2414
  l === "image" || l === "pdf" ? a(!0) : window.open(t || i, "_blank");
2415
- }, r = () => a(!1), v = e || (i == null ? void 0 : i.split("/").pop()) || "Unknown file";
2415
+ }, c = () => a(!1), v = e || (i == null ? void 0 : i.split("/").pop()) || "Unknown file";
2416
2416
  function m(h, f = "download") {
2417
2417
  if (!h) return;
2418
2418
  if (h.startsWith("data:")) {
@@ -2427,7 +2427,7 @@ function He({
2427
2427
  /* @__PURE__ */ n.jsxs(
2428
2428
  "div",
2429
2429
  {
2430
- onClick: c,
2430
+ onClick: r,
2431
2431
  className: "!flex items-center rounded cursor-pointer gap-x-3",
2432
2432
  title: `Click to preview ${v}`,
2433
2433
  children: [
@@ -2462,7 +2462,7 @@ function He({
2462
2462
  "div",
2463
2463
  {
2464
2464
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",
2465
- onClick: r,
2465
+ onClick: c,
2466
2466
  children: /* @__PURE__ */ n.jsxs(
2467
2467
  "div",
2468
2468
  {
@@ -2472,7 +2472,7 @@ function He({
2472
2472
  /* @__PURE__ */ n.jsx(
2473
2473
  "button",
2474
2474
  {
2475
- onClick: r,
2475
+ onClick: c,
2476
2476
  className: "absolute text-2xl font-bold text-gray-700 top-2 right-2",
2477
2477
  "aria-label": "Close preview",
2478
2478
  children: "×"
@@ -2520,9 +2520,9 @@ function Ga({
2520
2520
  list: a = null,
2521
2521
  accept: l = []
2522
2522
  }) {
2523
- const { uploadUrl: d } = ji(fi), t = Mi(null), [u, c] = R(a), [r, v] = R(!1);
2523
+ const { uploadUrl: d } = ji(fi), t = Mi(null), [u, r] = R(a), [c, v] = R(!1);
2524
2524
  O(() => {
2525
- c(a);
2525
+ r(a);
2526
2526
  }, [a]);
2527
2527
  const m = si(
2528
2528
  () => l == null ? void 0 : l.map((S) => S.value).join(", "),
@@ -2592,7 +2592,7 @@ function Ga({
2592
2592
  ), p = X(
2593
2593
  async (S) => {
2594
2594
  const j = Array.from(S.target.files || []);
2595
- if (!(!j.length || r)) {
2595
+ if (!(!j.length || c)) {
2596
2596
  if (!g(j)) {
2597
2597
  t.current && (t.current.value = "");
2598
2598
  return;
@@ -2600,7 +2600,7 @@ function Ga({
2600
2600
  try {
2601
2601
  v(!0);
2602
2602
  const A = await Promise.all(j == null ? void 0 : j.map(y)), N = s && u ? [...u, ...A] : A;
2603
- c(N), i(N), ki.success(`Successfully uploaded ${j.length} file(s)`);
2603
+ r(N), i(N), ki.success(`Successfully uploaded ${j.length} file(s)`);
2604
2604
  } catch (A) {
2605
2605
  console.error("Upload error:", A), ki.error("Failed to upload file(s). Please try again.");
2606
2606
  } finally {
@@ -2608,15 +2608,15 @@ function Ga({
2608
2608
  }
2609
2609
  }
2610
2610
  },
2611
- [r, g, y, i, s, u]
2611
+ [c, g, y, i, s, u]
2612
2612
  ), x = X(
2613
2613
  (S) => {
2614
- r || (t.current && (t.current.value = ""), c((j) => {
2614
+ c || (t.current && (t.current.value = ""), r((j) => {
2615
2615
  const A = S === void 0 ? null : (j == null ? void 0 : j.filter((N, E) => E !== S)) || null;
2616
2616
  return i(A), A;
2617
2617
  }), o == null || o());
2618
2618
  },
2619
- [o, i, r]
2619
+ [o, i, c]
2620
2620
  ), C = u && u.length > 0;
2621
2621
  return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-start gap-2", children: [
2622
2622
  !e && /* @__PURE__ */ n.jsxs("div", { className: "!flex field-control !py-0 !px-0 relative", children: [
@@ -2626,7 +2626,7 @@ function Ga({
2626
2626
  ref: t,
2627
2627
  type: "file",
2628
2628
  onChange: p,
2629
- disabled: e || r,
2629
+ disabled: e || c,
2630
2630
  multiple: s,
2631
2631
  accept: m || "",
2632
2632
  className: `w-full text-sm text-gray-500 file:mr-4 flex-1 file:px-4 !py-1 !pl-1\r
@@ -2642,14 +2642,14 @@ function Ga({
2642
2642
  type: "button",
2643
2643
  className: "p-2 text-lg text-red-500 hover:text-red-600 transition-colors disabled:opacity-50",
2644
2644
  onClick: () => x(),
2645
- disabled: r,
2645
+ disabled: c,
2646
2646
  "aria-label": "Remove all files",
2647
2647
  children: /* @__PURE__ */ n.jsx(q, { icon: "lets-icons:trash-duotone" })
2648
2648
  }
2649
2649
  )
2650
2650
  ] }),
2651
2651
  C && /* @__PURE__ */ n.jsxs("div", { className: "relative grid gap-y-1 flex-1 w-full", children: [
2652
- r && /* @__PURE__ */ n.jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/60 rounded", children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2 text-sm text-blue-600 font-medium", children: [
2652
+ c && /* @__PURE__ */ n.jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-white/60 rounded", children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2 text-sm text-blue-600 font-medium", children: [
2653
2653
  /* @__PURE__ */ n.jsx("span", { className: "animate-spin h-4 w-4 border-2 border-blue-500 border-t-transparent rounded-full" }),
2654
2654
  "Uploading..."
2655
2655
  ] }) }),
@@ -2666,8 +2666,8 @@ function Ga({
2666
2666
  ] });
2667
2667
  }
2668
2668
  function Ha({ element: i, validationData: e }) {
2669
- var r;
2670
- const [o, s] = R((r = i == null ? void 0 : i.value) != null ? r : null), {
2669
+ var c;
2670
+ const [o, s] = R((c = i == null ? void 0 : i.value) != null ? c : null), {
2671
2671
  register: a = () => ({}),
2672
2672
  setValue: l,
2673
2673
  isReadOnly: d,
@@ -2691,7 +2691,7 @@ function Ha({ element: i, validationData: e }) {
2691
2691
  l == null || l(i.id, v), s(v);
2692
2692
  },
2693
2693
  [i.id, l]
2694
- ), c = () => {
2694
+ ), r = () => {
2695
2695
  l == null || l(i.id, null), s(null);
2696
2696
  };
2697
2697
  return /* @__PURE__ */ n.jsxs("div", { children: [
@@ -2701,7 +2701,7 @@ function Ha({ element: i, validationData: e }) {
2701
2701
  onFileLoaded: u,
2702
2702
  disabled: d,
2703
2703
  multiple: i == null ? void 0 : i.isMultiple,
2704
- handleDeleteFile: c,
2704
+ handleDeleteFile: r,
2705
2705
  list: o,
2706
2706
  accept: i == null ? void 0 : i.acceptedFiles
2707
2707
  }
@@ -2735,8 +2735,8 @@ const z = ({
2735
2735
  placeholder: d = "",
2736
2736
  isFloating: t,
2737
2737
  setValue: u,
2738
- value: c,
2739
- trigger: r,
2738
+ value: r,
2739
+ trigger: c,
2740
2740
  prefix: v,
2741
2741
  disabled: m,
2742
2742
  watch: h,
@@ -2760,12 +2760,12 @@ const z = ({
2760
2760
  sn,
2761
2761
  {
2762
2762
  onValueChange: (N) => {
2763
- u(e, N != null ? N : null), o && o(e), r && r(e);
2763
+ u(e, N != null ? N : null), o && o(e), c && c(e);
2764
2764
  },
2765
2765
  placeholder: d,
2766
2766
  className: `field-control ${s != null && s[e] ? "border-red-300" : "border-[#D0D5DD]"}`,
2767
2767
  decimalsLimit: 2,
2768
- value: c,
2768
+ value: r,
2769
2769
  prefix: v,
2770
2770
  disabled: m
2771
2771
  }
@@ -2775,7 +2775,7 @@ const z = ({
2775
2775
  if (["checkbox", "radio"].includes(l)) {
2776
2776
  const N = (h == null ? void 0 : h(e)) || null;
2777
2777
  let E = !1;
2778
- return N && (N != null && N.length && l === "checkbox" ? E = N == null ? void 0 : N.includes(c) : E = N == c), /* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
2778
+ return N && (N != null && N.length && l === "checkbox" ? E = N == null ? void 0 : N.includes(r) : E = N == r), /* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
2779
2779
  /* @__PURE__ */ n.jsxs(
2780
2780
  "label",
2781
2781
  {
@@ -2786,7 +2786,7 @@ const z = ({
2786
2786
  {
2787
2787
  ...x,
2788
2788
  type: l,
2789
- value: c || "",
2789
+ value: r || "",
2790
2790
  disabled: m,
2791
2791
  className: "peer sr-only"
2792
2792
  }
@@ -2931,14 +2931,14 @@ const Di = ({
2931
2931
  label: d,
2932
2932
  value: t,
2933
2933
  trigger: u,
2934
- isMultiple: c,
2935
- isFloatingLabel: r,
2934
+ isMultiple: r,
2935
+ isFloatingLabel: c,
2936
2936
  subText: v,
2937
2937
  labelClass: m = "text-[10px]",
2938
2938
  loading: h,
2939
2939
  disabled: f
2940
2940
  }) => {
2941
- const [y, g] = R(c ? [] : null), p = Mi(!1), x = si(() => !t || !i || i.length === 0 ? c ? [] : null : c ? Array.isArray(t) ? i.filter((j) => t.some(
2941
+ const [y, g] = R(r ? [] : null), p = Mi(!1), x = si(() => !t || !i || i.length === 0 ? r ? [] : null : r ? Array.isArray(t) ? i.filter((j) => t.some(
2942
2942
  (A) => {
2943
2943
  var N;
2944
2944
  return typeof j.value == "object" ? ((N = j.value) == null ? void 0 : N.id) === (A == null ? void 0 : A.id) : j.value === A;
@@ -2946,28 +2946,28 @@ const Di = ({
2946
2946
  )) : [] : i.find((j) => {
2947
2947
  var A;
2948
2948
  return typeof j.value == "string" && typeof t == "string" ? j.value.toLowerCase() === t.toLowerCase() : typeof j.value == "object" && typeof t == "object" ? ((A = j.value) == null ? void 0 : A.id) === (t == null ? void 0 : t.id) : j.value === t;
2949
- }) || null, [t, i, c]);
2949
+ }) || null, [t, i, r]);
2950
2950
  O(() => {
2951
2951
  if (p.current) {
2952
2952
  p.current = !1;
2953
2953
  return;
2954
2954
  }
2955
- if (c && Array.isArray(x) && Array.isArray(y)) {
2955
+ if (r && Array.isArray(x) && Array.isArray(y)) {
2956
2956
  const j = y == null ? void 0 : y.map((N) => N.value), A = x == null ? void 0 : x.map((N) => N.value);
2957
2957
  JSON.stringify(j) !== JSON.stringify(A) && g(x);
2958
2958
  } else (x == null ? void 0 : x.value) !== (y == null ? void 0 : y.value) && g(x);
2959
- }, [x, c]);
2959
+ }, [x, r]);
2960
2960
  const C = X((j) => {
2961
2961
  var A;
2962
2962
  if (p.current = !0, g(j), a) {
2963
- const N = c ? Array.isArray(j) ? j == null ? void 0 : j.map((E) => E.value) : [] : (A = j == null ? void 0 : j.value) != null ? A : null;
2963
+ const N = r ? Array.isArray(j) ? j == null ? void 0 : j.map((E) => E.value) : [] : (A = j == null ? void 0 : j.value) != null ? A : null;
2964
2964
  a(l, N), u == null || u(l);
2965
2965
  }
2966
2966
  s && !p.current && s(l);
2967
- }, [a, l, u, s, c]), S = si(() => h ? "Fetching data..." : y ? c && Array.isArray(y) ? y.length > 0 ? y == null ? void 0 : y.map((j) => j.label).join(", ") : e : (y == null ? void 0 : y.label) || e : e, [y, h, e, c]);
2967
+ }, [a, l, u, s, r]), S = si(() => h ? "Fetching data..." : y ? r && Array.isArray(y) ? y.length > 0 ? y == null ? void 0 : y.map((j) => j.label).join(", ") : e : (y == null ? void 0 : y.label) || e : e, [y, h, e, r]);
2968
2968
  return /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
2969
- !r && d && /* @__PURE__ */ n.jsx("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
2970
- r && d && /* @__PURE__ */ n.jsx(
2969
+ !c && d && /* @__PURE__ */ n.jsx("label", { className: "block text-sm text-[#686878] darks:text-white/70 mb-2", children: d }),
2970
+ c && d && /* @__PURE__ */ n.jsx(
2971
2971
  "label",
2972
2972
  {
2973
2973
  className: Z(
@@ -2982,7 +2982,7 @@ const Di = ({
2982
2982
  {
2983
2983
  value: y,
2984
2984
  onChange: C,
2985
- multiple: c,
2985
+ multiple: r,
2986
2986
  disabled: f || h,
2987
2987
  children: /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
2988
2988
  /* @__PURE__ */ n.jsxs(ui.Button, { className: "field-control", disabled: f || h, children: [
@@ -3035,11 +3035,11 @@ function Tn({
3035
3035
  const [d, t] = R(""), u = si(() => {
3036
3036
  const h = e != null ? e : o;
3037
3037
  return i.find((f) => f.value === h || f.label === h) || null;
3038
- }, [e, o, i]), [c, r] = R(u);
3038
+ }, [e, o, i]), [r, c] = R(u);
3039
3039
  O(() => {
3040
3040
  if (e !== void 0) {
3041
3041
  const h = i.find((f) => f.value === e || f.label === e) || null;
3042
- r(h);
3042
+ c(h);
3043
3043
  }
3044
3044
  }, [e, i]);
3045
3045
  const v = si(() => {
@@ -3049,12 +3049,12 @@ function Tn({
3049
3049
  (f) => f.label.toLowerCase().includes(h)
3050
3050
  );
3051
3051
  }, [d, i]), m = X((h) => {
3052
- r(h), s(l, h);
3052
+ c(h), s(l, h);
3053
3053
  }, [l, s]);
3054
3054
  return /* @__PURE__ */ n.jsx("div", { className: "relative w-full", children: /* @__PURE__ */ n.jsxs(
3055
3055
  Ri,
3056
3056
  {
3057
- value: c,
3057
+ value: r,
3058
3058
  onChange: m,
3059
3059
  disabled: a,
3060
3060
  children: [
@@ -3141,21 +3141,21 @@ function On(i, e, o) {
3141
3141
  try {
3142
3142
  return Promise.resolve(function(d, t) {
3143
3143
  try {
3144
- var u = (e.context && process.env.NODE_ENV === "development" && console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"), Promise.resolve(i[o.mode === "sync" ? "validateSync" : "validate"](s, Object.assign({ abortEarly: !1 }, e, { context: a }))).then(function(c) {
3145
- return l.shouldUseNativeValidation && ko({}, l), { values: o.raw ? s : c, errors: {} };
3144
+ var u = (e.context && process.env.NODE_ENV === "development" && console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"), Promise.resolve(i[o.mode === "sync" ? "validateSync" : "validate"](s, Object.assign({ abortEarly: !1 }, e, { context: a }))).then(function(r) {
3145
+ return l.shouldUseNativeValidation && ko({}, l), { values: o.raw ? s : r, errors: {} };
3146
3146
  }));
3147
- } catch (c) {
3148
- return t(c);
3147
+ } catch (r) {
3148
+ return t(r);
3149
3149
  }
3150
3150
  return u && u.then ? u.then(void 0, t) : u;
3151
3151
  }(0, function(d) {
3152
3152
  if (!d.inner) throw d;
3153
- return { values: {}, errors: Co((t = d, u = !l.shouldUseNativeValidation && l.criteriaMode === "all", (t.inner || []).reduce(function(c, r) {
3154
- if (c[r.path] || (c[r.path] = { message: r.message, type: r.type }), u) {
3155
- var v = c[r.path].types, m = v && v[r.type];
3156
- c[r.path] = So(r.path, u, c, r.type, m ? [].concat(m, r.message) : r.message);
3153
+ return { values: {}, errors: Co((t = d, u = !l.shouldUseNativeValidation && l.criteriaMode === "all", (t.inner || []).reduce(function(r, c) {
3154
+ if (r[c.path] || (r[c.path] = { message: c.message, type: c.type }), u) {
3155
+ var v = r[c.path].types, m = v && v[c.type];
3156
+ r[c.path] = So(c.path, u, r, c.type, m ? [].concat(m, c.message) : c.message);
3157
3157
  }
3158
- return c;
3158
+ return r;
3159
3159
  }, {})), l) };
3160
3160
  var t, u;
3161
3161
  }));
@@ -3177,19 +3177,19 @@ const Ja = ({
3177
3177
  e
3178
3178
  );
3179
3179
  return /* @__PURE__ */ n.jsx("div", { className: d, children: i == null ? void 0 : i.map((t) => {
3180
- const u = a === t.key, c = o[t.key] || 0, r = Z(
3180
+ const u = a === t.key, r = o[t.key] || 0, c = Z(
3181
3181
  "capitalize text-sm whitespace-nowrap no-scrollbar font-semibold pb-[14px] border-b-2 border-[#EAECF0] px-6 flex items-center gap-x-1 flex-1 text-center",
3182
3182
  `${i.length === 1 ? "justify-start" : "justify-center"}`,
3183
3183
  l
3184
3184
  ), v = Z({
3185
3185
  "border-gray-500 border-primary border-primary-500 text-primary text-primary-500": u,
3186
3186
  "border-transparent text-gray-400 ": !u
3187
- }), m = c > 0 && /* @__PURE__ */ n.jsx("span", { className: "text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80", children: c });
3187
+ }), m = r > 0 && /* @__PURE__ */ n.jsx("span", { className: "text-xs h-6 min-w-[24px] rounded-full flex justify-center items-center border border-[#EAECF0] darks:border-gray-500 bg-[#F9FAFB] darks:bg-gray-800 text-[#454745] darks:text-white/80", children: r });
3188
3188
  return /* @__PURE__ */ n.jsxs(
3189
3189
  "button",
3190
3190
  {
3191
3191
  onClick: () => s(t.key),
3192
- className: Z(r, v),
3192
+ className: Z(c, v),
3193
3193
  "aria-selected": u,
3194
3194
  role: "tab",
3195
3195
  type: "button",
@@ -3591,12 +3591,12 @@ function us({
3591
3591
  O(() => {
3592
3592
  (i == null ? void 0 : i.length) > 0 && JSON.stringify(i) !== JSON.stringify(s) && a(i);
3593
3593
  }, [i]);
3594
- function l(u, c) {
3595
- const r = [...s];
3596
- r[c] = {
3597
- ...r[c],
3594
+ function l(u, r) {
3595
+ const c = [...s];
3596
+ c[r] = {
3597
+ ...c[r],
3598
3598
  value: u
3599
- }, a(r), e && e(r);
3599
+ }, a(c), e && e(c);
3600
3600
  }
3601
3601
  function d() {
3602
3602
  const u = [
@@ -3608,15 +3608,15 @@ function us({
3608
3608
  a(u), e && e(u);
3609
3609
  }
3610
3610
  function t(u) {
3611
- const c = s.filter((r, v) => v !== u);
3612
- a(c), e && e(c);
3611
+ const r = s.filter((c, v) => v !== u);
3612
+ a(r), e && e(r);
3613
3613
  }
3614
3614
  return O(() => {
3615
3615
  o && o(JSON.stringify({ values: s }));
3616
3616
  }, [o, s]), /* @__PURE__ */ n.jsxs("div", { className: "]", children: [
3617
3617
  /* @__PURE__ */ n.jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: [
3618
3618
  /* @__PURE__ */ n.jsx("div", { className: "grid text-sm font-bold border-b border-gray-100 bg-gray-50", children: /* @__PURE__ */ n.jsx("div", { className: "px-2 py-2", children: /* @__PURE__ */ n.jsx("span", { className: "", children: "Add Denominations" }) }) }),
3619
- s == null ? void 0 : s.map((u, c) => /* @__PURE__ */ n.jsx(
3619
+ s == null ? void 0 : s.map((u, r) => /* @__PURE__ */ n.jsx(
3620
3620
  "div",
3621
3621
  {
3622
3622
  className: "grid text-sm border-b border-gray-100",
@@ -3628,14 +3628,14 @@ function us({
3628
3628
  className: "border border-gray-100 rounded w-full px-3 py-1 outline-none",
3629
3629
  decimalsLimit: 6,
3630
3630
  defaultValue: u.value,
3631
- onValueChange: (r) => l(r, c),
3631
+ onValueChange: (c) => l(c, r),
3632
3632
  allowNegativeValue: !1
3633
3633
  }
3634
3634
  ) }),
3635
3635
  /* @__PURE__ */ n.jsx(
3636
3636
  "button",
3637
3637
  {
3638
- onClick: () => t(c),
3638
+ onClick: () => t(r),
3639
3639
  className: "text-red-500 hover:text-red-700 px-2",
3640
3640
  type: "button",
3641
3641
  "aria-label": "Remove row",
@@ -3644,7 +3644,7 @@ function us({
3644
3644
  )
3645
3645
  ] })
3646
3646
  },
3647
- c + "index"
3647
+ r + "index"
3648
3648
  ))
3649
3649
  ] }),
3650
3650
  /* @__PURE__ */ n.jsx("div", { className: "mt-1 flex justify-end", children: /* @__PURE__ */ n.jsx(
@@ -3713,12 +3713,12 @@ const ts = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
3713
3713
  label: s,
3714
3714
  type: a
3715
3715
  }) => {
3716
- const [l, d] = R(""), t = gi("config"), u = (c) => {
3717
- const r = c.target.files[0];
3718
- if (!r) return;
3719
- d(r.name);
3716
+ const [l, d] = R(""), t = gi("config"), u = (r) => {
3717
+ const c = r.target.files[0];
3718
+ if (!c) return;
3719
+ d(c.name);
3720
3720
  const v = new FileReader();
3721
- r.name.endsWith(".csv") ? (v.onload = (m) => {
3721
+ c.name.endsWith(".csv") ? (v.onload = (m) => {
3722
3722
  const h = m.target.result, f = Mo.parse(h, { header: !0 });
3723
3723
  i(
3724
3724
  e,
@@ -3726,13 +3726,13 @@ const ts = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
3726
3726
  f.data
3727
3727
  )
3728
3728
  );
3729
- }, v.readAsText(r)) : r.name.endsWith(".xlsx") || r.name.endsWith(".xls") ? (v.onload = (m) => {
3729
+ }, v.readAsText(c)) : c.name.endsWith(".xlsx") || c.name.endsWith(".xls") ? (v.onload = (m) => {
3730
3730
  const h = new Uint8Array(m.target.result), f = ne.read(h, { type: "array" }), y = f.SheetNames[0], g = f.Sheets[y], p = ne.utils.sheet_to_json(g);
3731
3731
  i(
3732
3732
  e,
3733
3733
  (a === "dataGrid" ? Bn : wn)(p)
3734
3734
  );
3735
- }, v.readAsArrayBuffer(r)) : ki.error("Unsupported file type. Please upload a CSV or Excel file.");
3735
+ }, v.readAsArrayBuffer(c)) : ki.error("Unsupported file type. Please upload a CSV or Excel file.");
3736
3736
  };
3737
3737
  return /* @__PURE__ */ n.jsxs("div", { children: [
3738
3738
  /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
@@ -3762,6 +3762,8 @@ const ts = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
3762
3762
  {
3763
3763
  download: !0,
3764
3764
  href: a === "dataGrid" ? "https://res.cloudinary.com/arudovwen-me/raw/upload/v1775419737/table_sheet_bu7l6g.xlsx" : "https://res.cloudinary.com/arudovwen-me/raw/upload/v1775419737/list_sheet_1_pi6bwv.xlsx",
3765
+ target: "_blank",
3766
+ rel: "noopener noreferrer",
3765
3767
  style: { color: (t == null ? void 0 : t.buttonColor) || "#333" },
3766
3768
  className: "text-xs text-gray-600 mb-2 cursor-pointer font-medium",
3767
3769
  children: "Download Sample File"
@@ -3833,24 +3835,24 @@ function ps({
3833
3835
  id: a
3834
3836
  }) {
3835
3837
  const { formData: l } = ji(fi), d = s("visibilityDependentFields") || [], t = si(() => {
3836
- var c;
3837
- return (c = vs(l).filter((r) => r.id !== a)) == null ? void 0 : c.map((r) => {
3838
+ var r;
3839
+ return (r = vs(l).filter((c) => c.id !== a)) == null ? void 0 : r.map((c) => {
3838
3840
  const v = d.find(
3839
- (m) => m.id === r.id
3841
+ (m) => m.id === c.id
3840
3842
  );
3841
3843
  return {
3842
- id: r.id,
3843
- value: r.id,
3844
- label: r.inputLabel,
3845
- sectionId: r.sectionId,
3844
+ id: c.id,
3845
+ value: c.id,
3846
+ label: c.inputLabel,
3847
+ sectionId: c.sectionId,
3846
3848
  fieldType: (v == null ? void 0 : v.fieldType) || "text",
3847
3849
  operator: (v == null ? void 0 : v.operator) || "equals",
3848
3850
  fieldValue: (v == null ? void 0 : v.fieldValue) !== void 0 ? v.fieldValue : ""
3849
3851
  };
3850
3852
  });
3851
- }, [l, d, a]), u = (c, r, v) => {
3853
+ }, [l, d, a]), u = (r, c, v) => {
3852
3854
  const m = d == null ? void 0 : d.map(
3853
- (h, f) => f === c ? { ...h, [r]: v } : h
3855
+ (h, f) => f === r ? { ...h, [c]: v } : h
3854
3856
  );
3855
3857
  e("visibilityDependentFields", m);
3856
3858
  };
@@ -3867,14 +3869,14 @@ function ps({
3867
3869
  validationData: { register: i, setValue: e, trigger: o, watch: s }
3868
3870
  }
3869
3871
  ),
3870
- d.length > 0 && /* @__PURE__ */ n.jsx("div", { className: "py-1 bg-gray-100 rounded dependent-fields", children: d == null ? void 0 : d.map((c, r) => {
3872
+ d.length > 0 && /* @__PURE__ */ n.jsx("div", { className: "py-1 bg-gray-100 rounded dependent-fields", children: d == null ? void 0 : d.map((r, c) => {
3871
3873
  var v, m;
3872
3874
  return /* @__PURE__ */ n.jsxs("div", { className: "dependent-field", children: [
3873
3875
  /* @__PURE__ */ n.jsx(
3874
3876
  "input",
3875
3877
  {
3876
3878
  type: "text",
3877
- value: c.label,
3879
+ value: r.label,
3878
3880
  readOnly: !0,
3879
3881
  disabled: !0,
3880
3882
  className: "field-label"
@@ -3883,10 +3885,10 @@ function ps({
3883
3885
  /* @__PURE__ */ n.jsx("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ n.jsx(
3884
3886
  ui,
3885
3887
  {
3886
- value: c.fieldType,
3887
- onChange: (h) => u(r, "fieldType", h),
3888
+ value: r.fieldType,
3889
+ onChange: (h) => u(c, "fieldType", h),
3888
3890
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3889
- /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: c.fieldType }),
3891
+ /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: r.fieldType }),
3890
3892
  /* @__PURE__ */ n.jsx(
3891
3893
  Ei,
3892
3894
  {
@@ -3918,10 +3920,10 @@ function ps({
3918
3920
  /* @__PURE__ */ n.jsx("div", { className: "field-listbox min-w-[100px]", children: /* @__PURE__ */ n.jsx(
3919
3921
  ui,
3920
3922
  {
3921
- value: c.operator,
3922
- onChange: (h) => u(r, "operator", h),
3923
+ value: r.operator,
3924
+ onChange: (h) => u(c, "operator", h),
3923
3925
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3924
- /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: c.operator.replace("_", " ") }),
3926
+ /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: r.operator.replace("_", " ") }),
3925
3927
  /* @__PURE__ */ n.jsx(
3926
3928
  Ei,
3927
3929
  {
@@ -3934,7 +3936,7 @@ function ps({
3934
3936
  {
3935
3937
  className: "listbox-options ",
3936
3938
  anchor: "bottom",
3937
- children: (v = c.fieldType === "number" ? [...fe, ...hs] : fe) == null ? void 0 : v.map((h) => /* @__PURE__ */ n.jsx(
3939
+ children: (v = r.fieldType === "number" ? [...fe, ...hs] : fe) == null ? void 0 : v.map((h) => /* @__PURE__ */ n.jsx(
3938
3940
  ui.Option,
3939
3941
  {
3940
3942
  value: h,
@@ -3950,22 +3952,22 @@ function ps({
3950
3952
  ] })
3951
3953
  }
3952
3954
  ) }),
3953
- c.fieldType !== "boolean" ? /* @__PURE__ */ n.jsx(
3955
+ r.fieldType !== "boolean" ? /* @__PURE__ */ n.jsx(
3954
3956
  "input",
3955
3957
  {
3956
- type: c.fieldType,
3957
- value: c.fieldValue || "",
3958
- onChange: (h) => u(r, "fieldValue", h.target.value),
3958
+ type: r.fieldType,
3959
+ value: r.fieldValue || "",
3960
+ onChange: (h) => u(c, "fieldValue", h.target.value),
3959
3961
  placeholder: "Value",
3960
3962
  className: "field-value"
3961
3963
  }
3962
3964
  ) : /* @__PURE__ */ n.jsx("div", { className: "field-listbox", children: /* @__PURE__ */ n.jsx(
3963
3965
  ui,
3964
3966
  {
3965
- value: (m = c.fieldValue) != null ? m : "",
3966
- onChange: (h) => u(r, "fieldValue", h),
3967
+ value: (m = r.fieldValue) != null ? m : "",
3968
+ onChange: (h) => u(c, "fieldValue", h),
3967
3969
  children: /* @__PURE__ */ n.jsxs("div", { className: "listbox-wrapper", children: [
3968
- /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: c.fieldValue === !0 ? "True" : c.fieldValue === !1 ? "False" : "Select value" }),
3970
+ /* @__PURE__ */ n.jsx(ui.Button, { className: "listbox-button", children: r.fieldValue === !0 ? "True" : r.fieldValue === !1 ? "False" : "Select value" }),
3969
3971
  /* @__PURE__ */ n.jsx(
3970
3972
  Ei,
3971
3973
  {
@@ -4003,7 +4005,7 @@ function ps({
4003
4005
  ] })
4004
4006
  }
4005
4007
  ) })
4006
- ] }, c.id);
4008
+ ] }, r.id);
4007
4009
  }) })
4008
4010
  ] });
4009
4011
  }
@@ -4084,10 +4086,9 @@ const gs = w.object().shape({
4084
4086
  onClose: e,
4085
4087
  element: o
4086
4088
  }) => {
4087
- console.log(o);
4088
4089
  const s = fs.filter(
4089
4090
  (D) => !qi.includes(o.inputType) || D.key !== "validation"
4090
- ), { updateElement: a } = bi.useContext(fi), [l, d] = R("basic"), [t, u] = R(!1), [c, r] = R("manual"), v = gi("config"), {
4091
+ ), { updateElement: a } = bi.useContext(fi), [l, d] = R("basic"), [t, u] = R(!1), [r, c] = R("manual"), v = gi("config"), {
4091
4092
  register: m,
4092
4093
  handleSubmit: h,
4093
4094
  control: f,
@@ -4156,7 +4157,7 @@ const gs = w.object().shape({
4156
4157
  }
4157
4158
  }, [o.type, y, A.apiUrl]), J = ["manual", "api", "sheet"];
4158
4159
  function ri() {
4159
- c === "api" && B();
4160
+ r === "api" && B();
4160
4161
  }
4161
4162
  const ii = () => {
4162
4163
  var D, _;
@@ -4167,7 +4168,7 @@ const gs = w.object().shape({
4167
4168
  {
4168
4169
  type: "radio",
4169
4170
  name: "optionType",
4170
- onChange: (F) => r(F.target.value),
4171
+ onChange: (F) => c(F.target.value),
4171
4172
  value: V
4172
4173
  }
4173
4174
  ),
@@ -4177,7 +4178,7 @@ const gs = w.object().shape({
4177
4178
  " options"
4178
4179
  ] })
4179
4180
  ] }, V)) }),
4180
- c === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4181
+ r === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4181
4182
  /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
4182
4183
  /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center w-full mb-2", children: [
4183
4184
  /* @__PURE__ */ n.jsx(
@@ -4207,7 +4208,7 @@ const gs = w.object().shape({
4207
4208
  ] }),
4208
4209
  /* @__PURE__ */ n.jsx(cs, {})
4209
4210
  ] }),
4210
- c === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4211
+ r === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4211
4212
  ge,
4212
4213
  {
4213
4214
  type: o.type,
@@ -4377,9 +4378,9 @@ const gs = w.object().shape({
4377
4378
  {
4378
4379
  type: "radio",
4379
4380
  name: "optionType",
4380
- onChange: (_) => r(_.target.value),
4381
+ onChange: (_) => c(_.target.value),
4381
4382
  value: D,
4382
- checked: D === c
4383
+ checked: D === r
4383
4384
  }
4384
4385
  ),
4385
4386
  " ",
@@ -4388,7 +4389,7 @@ const gs = w.object().shape({
4388
4389
  " options"
4389
4390
  ] })
4390
4391
  ] }, D)) }),
4391
- c === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4392
+ r === "api" && /* @__PURE__ */ n.jsxs("div", { className: "mb-4", children: [
4392
4393
  /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-x-2", children: [
4393
4394
  /* @__PURE__ */ n.jsxs("div", { className: "relative flex items-center w-full mb-2", children: [
4394
4395
  /* @__PURE__ */ n.jsx(
@@ -4418,7 +4419,7 @@ const gs = w.object().shape({
4418
4419
  ] }),
4419
4420
  /* @__PURE__ */ n.jsx(rs, {})
4420
4421
  ] }),
4421
- c === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4422
+ r === "sheet" && /* @__PURE__ */ n.jsx("div", { className: "mb-4", children: /* @__PURE__ */ n.jsx(
4422
4423
  ge,
4423
4424
  {
4424
4425
  type: o.type,
@@ -5065,8 +5066,8 @@ const gs = w.object().shape({
5065
5066
  ({ state: i, element: e, children: o }) => {
5066
5067
  const [s, a] = R(!1), { removeElement: l, duplicateElement: d } = bi.useContext(fi), t = si(
5067
5068
  () => {
5068
- var c;
5069
- return (c = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : c.map((r) => r.label).join(", ");
5069
+ var r;
5070
+ return (r = e == null ? void 0 : e.acceptedFiles) == null ? void 0 : r.map((c) => c.label).join(", ");
5070
5071
  },
5071
5072
  [e]
5072
5073
  ), u = X(() => {
@@ -5258,7 +5259,7 @@ function Ns({
5258
5259
  validationData: e
5259
5260
  }) {
5260
5261
  var A;
5261
- const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, d] = R(), [t, u] = R(!1), [c, r] = R(!1), [v, m] = R(""), h = a && a(i == null ? void 0 : i.id);
5262
+ const { register: o = () => ({}), setValue: s, watch: a } = e || {}, [l, d] = R(), [t, u] = R(!1), [r, c] = R(!1), [v, m] = R(""), h = a && a(i == null ? void 0 : i.id);
5262
5263
  O(() => {
5263
5264
  d(h);
5264
5265
  }, [h]);
@@ -5284,15 +5285,15 @@ function Ns({
5284
5285
  B = await Ii.post(g, { value: N }, S);
5285
5286
  else
5286
5287
  throw new Error("Unsupported HTTP method");
5287
- B.status === 200 && ((((ei = (E = B == null ? void 0 : B.data) == null ? void 0 : E.data) == null ? void 0 : ei.status) || ((Y = B == null ? void 0 : B.data) == null ? void 0 : Y.status)) === !0 ? (r(!0), x === "string" ? m(
5288
+ B.status === 200 && ((((ei = (E = B == null ? void 0 : B.data) == null ? void 0 : E.data) == null ? void 0 : ei.status) || ((Y = B == null ? void 0 : B.data) == null ? void 0 : Y.status)) === !0 ? (c(!0), x === "string" ? m(
5288
5289
  ((L = (Q = B == null ? void 0 : B.data) == null ? void 0 : Q.data) == null ? void 0 : L.description) || ((U = B == null ? void 0 : B.data) == null ? void 0 : U.description) || "Validation successful"
5289
5290
  ) : y(
5290
5291
  ((K = (I = B == null ? void 0 : B.data) == null ? void 0 : I.data) == null ? void 0 : K.description) || ((G = B == null ? void 0 : B.data) == null ? void 0 : G.description) || {}
5291
- )) : (console.error("Invalid input:", N), m("Unable to validate input"), r(!1)));
5292
+ )) : (console.error("Invalid input:", N), m("Unable to validate input"), c(!1)));
5292
5293
  } catch (B) {
5293
5294
  console.error("Error validating input:", B), m(
5294
5295
  ((M = (P = B == null ? void 0 : B.response) == null ? void 0 : P.data) == null ? void 0 : M.message) || "Unable to validate input"
5295
- ), r(!1);
5296
+ ), c(!1);
5296
5297
  } finally {
5297
5298
  u(!1);
5298
5299
  }
@@ -5356,13 +5357,13 @@ function Ns({
5356
5357
  }
5357
5358
  )
5358
5359
  ] }),
5359
- c && !t && /* @__PURE__ */ n.jsx("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ n.jsx(q, { icon: "gg:check-o" }) })
5360
+ r && !t && /* @__PURE__ */ n.jsx("span", { className: "block pr-3 text-lg text-green-600", children: /* @__PURE__ */ n.jsx(q, { icon: "gg:check-o" }) })
5360
5361
  ] })
5361
5362
  ] }),
5362
5363
  v && x === "string" && /* @__PURE__ */ n.jsx(
5363
5364
  "span",
5364
5365
  {
5365
- className: `${c ? "text-green-600" : "text-red-600"} text-sm`,
5366
+ className: `${r ? "text-green-600" : "text-red-600"} text-sm`,
5366
5367
  children: v
5367
5368
  }
5368
5369
  ),
@@ -5382,22 +5383,22 @@ function js({
5382
5383
  denominators: s
5383
5384
  }) {
5384
5385
  const [a, l] = R([...o]);
5385
- function d(c, r) {
5386
+ function d(r, c) {
5386
5387
  l((v) => {
5387
5388
  const m = [...v];
5388
- return m[r] = {
5389
- ...m[r],
5390
- value: c
5389
+ return m[c] = {
5390
+ ...m[c],
5391
+ value: r
5391
5392
  }, m;
5392
5393
  });
5393
5394
  }
5394
- function t(c, r) {
5395
- return parseFloat(c) * parseFloat(r) || 0;
5395
+ function t(r, c) {
5396
+ return parseFloat(r) * parseFloat(c) || 0;
5396
5397
  }
5397
5398
  const u = si(
5398
- () => a.reduce((c, r) => {
5399
- const v = t(r.key, r.value);
5400
- return c + v;
5399
+ () => a.reduce((r, c) => {
5400
+ const v = t(c.key, c.value);
5401
+ return r + v;
5401
5402
  }, 0),
5402
5403
  [a]
5403
5404
  );
@@ -5405,11 +5406,11 @@ function js({
5405
5406
  i && i(a);
5406
5407
  }, [a]), O(() => {
5407
5408
  if (s != null && s.length) {
5408
- const c = s == null ? void 0 : s.map((r, v) => ({
5409
- key: r.value,
5409
+ const r = s == null ? void 0 : s.map((c, v) => ({
5410
+ key: c.value,
5410
5411
  value: Array.isArray(o) && o[v] ? o[v].value : ""
5411
5412
  }));
5412
- l(c);
5413
+ l(r);
5413
5414
  }
5414
5415
  }, [o, s]), /* @__PURE__ */ n.jsx("div", { className: "mt-2", children: /* @__PURE__ */ n.jsxs("div", { className: "border border-gray-200 rounded-lg overflow-hidden text-gray-700", children: [
5415
5416
  /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-3 text-sm font-bold border-b border-gray-100 bg-gray-50", children: [
@@ -5417,30 +5418,30 @@ function js({
5417
5418
  /* @__PURE__ */ n.jsx("div", { className: "border-r px-4 py-2", children: /* @__PURE__ */ n.jsx("span", { children: "Quantity" }) }),
5418
5419
  /* @__PURE__ */ n.jsx("div", { className: "px-4 py-2", children: /* @__PURE__ */ n.jsx("span", { children: "Sub total" }) })
5419
5420
  ] }),
5420
- a == null ? void 0 : a.map((c, r) => {
5421
+ a == null ? void 0 : a.map((r, c) => {
5421
5422
  var v, m;
5422
5423
  return /* @__PURE__ */ n.jsxs(
5423
5424
  "div",
5424
5425
  {
5425
5426
  className: "grid grid-cols-3 text-sm border-b border-gray-100",
5426
5427
  children: [
5427
- /* @__PURE__ */ n.jsx("div", { className: "border-r px-4 py-2 flex items-center", children: /* @__PURE__ */ n.jsx("span", { className: "", children: (v = parseFloat(c.key)) == null ? void 0 : v.toLocaleString() }) }),
5428
+ /* @__PURE__ */ n.jsx("div", { className: "border-r px-4 py-2 flex items-center", children: /* @__PURE__ */ n.jsx("span", { className: "", children: (v = parseFloat(r.key)) == null ? void 0 : v.toLocaleString() }) }),
5428
5429
  /* @__PURE__ */ n.jsx("div", { className: "border-r px-4 py-1", children: /* @__PURE__ */ n.jsx("span", { children: /* @__PURE__ */ n.jsx(
5429
5430
  sn,
5430
5431
  {
5431
5432
  id: "input-example",
5432
5433
  className: "border border-gray-100 rounded w-full px-3 py-1 outline-none",
5433
5434
  decimalsLimit: 6,
5434
- value: c.value,
5435
- onValueChange: (h) => d(h, r),
5435
+ value: r.value,
5436
+ onValueChange: (h) => d(h, c),
5436
5437
  disabled: e,
5437
5438
  allowNegativeValue: !1
5438
5439
  }
5439
5440
  ) }) }),
5440
- /* @__PURE__ */ n.jsx("div", { className: "px-4 py-2 flex justify-between items-center", children: /* @__PURE__ */ n.jsx("span", { children: (m = t(c.key, c.value)) == null ? void 0 : m.toLocaleString() }) })
5441
+ /* @__PURE__ */ n.jsx("div", { className: "px-4 py-2 flex justify-between items-center", children: /* @__PURE__ */ n.jsx("span", { children: (m = t(r.key, r.value)) == null ? void 0 : m.toLocaleString() }) })
5441
5442
  ]
5442
5443
  },
5443
- r + "index"
5444
+ c + "index"
5444
5445
  );
5445
5446
  }),
5446
5447
  /* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-3 text-sm font-bold bg-gray-50", children: [
@@ -5506,9 +5507,9 @@ function Bs({
5506
5507
  return /* @__PURE__ */ n.jsxs("tr", { children: [
5507
5508
  e.map((d) => {
5508
5509
  var h;
5509
- const t = i[d.field], u = d.editable && !o, { isValidating: c, result: r } = a(i.id, d.field);
5510
+ const t = i[d.field], u = d.editable && !o, { isValidating: r, result: c } = a(i.id, d.field);
5510
5511
  let v = "border-gray-300";
5511
- d.validate && ((r == null ? void 0 : r.isValid) === !1 ? v = "border-red-500 bg-red-50" : (r == null ? void 0 : r.isValid) === !0 && (v = "border-green-500 bg-green-50"));
5512
+ d.validate && ((c == null ? void 0 : c.isValid) === !1 ? v = "border-red-500 bg-red-50" : (c == null ? void 0 : c.isValid) === !0 && (v = "border-green-500 bg-green-50"));
5512
5513
  const m = `w-full py-1 rounded outline-none ${v}`;
5513
5514
  return /* @__PURE__ */ n.jsx(
5514
5515
  "td",
@@ -5556,18 +5557,18 @@ function Bs({
5556
5557
  className: m
5557
5558
  }
5558
5559
  ),
5559
- c && /* @__PURE__ */ n.jsx("div", { className: "absolute right-1 top-1", children: /* @__PURE__ */ n.jsx("div", { className: "w-4 h-4 border-2 border-blue-500 rounded-full border-t-transparent animate-spin" }) })
5560
- ] }) : d.validate && r ? /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
5560
+ r && /* @__PURE__ */ n.jsx("div", { className: "absolute right-1 top-1", children: /* @__PURE__ */ n.jsx("div", { className: "w-4 h-4 border-2 border-blue-500 rounded-full border-t-transparent animate-spin" }) })
5561
+ ] }) : d.validate && c ? /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
5561
5562
  /* @__PURE__ */ n.jsxs("span", { children: [
5562
5563
  String(t != null ? t : ""),
5563
5564
  " ",
5564
- r.data && `[${r.data}]`
5565
+ c.data && `[${c.data}]`
5565
5566
  ] }),
5566
- r.isValid ? /* @__PURE__ */ n.jsx("span", { className: "text-xs text-green-600", children: "✓" }) : /* @__PURE__ */ n.jsx(
5567
+ c.isValid ? /* @__PURE__ */ n.jsx("span", { className: "text-xs text-green-600", children: "✓" }) : /* @__PURE__ */ n.jsx(
5567
5568
  "span",
5568
5569
  {
5569
5570
  className: "text-xs text-red-600 cursor-help",
5570
- title: (h = r.error) != null ? h : "",
5571
+ title: (h = c.error) != null ? h : "",
5571
5572
  children: "✗"
5572
5573
  }
5573
5574
  )
@@ -5613,9 +5614,9 @@ function Ls({
5613
5614
  ), u = X(() => {
5614
5615
  const v = Si(), m = s.reduce((h, f) => (h[f.field] = f.field === "id" ? v : "", h), {});
5615
5616
  l((h) => [...h, { id: v, ...m }]);
5616
- }, [s]), c = X((v) => {
5617
+ }, [s]), r = X((v) => {
5617
5618
  l((m) => m.filter((h) => h.id !== v));
5618
- }, []), r = X(
5619
+ }, []), c = X(
5619
5620
  (v, m) => ({
5620
5621
  isValidating: !1,
5621
5622
  result: void 0
@@ -5648,8 +5649,8 @@ function Ls({
5648
5649
  columns: s,
5649
5650
  isReadOnly: o,
5650
5651
  handleCellChange: t,
5651
- getValidationStatus: r,
5652
- deleteRow: c
5652
+ getValidationStatus: c,
5653
+ deleteRow: r
5653
5654
  },
5654
5655
  v.id
5655
5656
  )) : /* @__PURE__ */ n.jsx("tr", { children: /* @__PURE__ */ n.jsx(
@@ -5677,17 +5678,17 @@ function Ps({
5677
5678
  element: i,
5678
5679
  validationData: e
5679
5680
  }) {
5680
- var r;
5681
+ var c;
5681
5682
  const {
5682
5683
  register: o = () => ({}),
5683
5684
  setValue: s,
5684
5685
  watch: a,
5685
5686
  isReadOnly: l
5686
- } = e || {}, d = a && a(i == null ? void 0 : i.id) || {}, t = Array.isArray(d) ? d : (r = d == null ? void 0 : d.rows) != null ? r : [];
5687
+ } = e || {}, d = a && a(i == null ? void 0 : i.id) || {}, t = Array.isArray(d) ? d : (c = d == null ? void 0 : d.rows) != null ? c : [];
5687
5688
  O(() => {
5688
5689
  o(i.id);
5689
5690
  }, [i.id, o]);
5690
- const u = Mi(""), c = X(
5691
+ const u = Mi(""), r = X(
5691
5692
  (v) => {
5692
5693
  const m = JSON.stringify(v);
5693
5694
  m !== u.current && (u.current = m, s == null || s(i.id, {
@@ -5701,7 +5702,7 @@ function Ps({
5701
5702
  Ls,
5702
5703
  {
5703
5704
  value: t,
5704
- onChange: c,
5705
+ onChange: r,
5705
5706
  columns: i == null ? void 0 : i.dataColumns,
5706
5707
  isReadOnly: l
5707
5708
  }
@@ -5717,15 +5718,15 @@ const xe = ({
5717
5718
  name: d,
5718
5719
  label: t,
5719
5720
  value: u,
5720
- trigger: c,
5721
- isMultiple: r = !1,
5721
+ trigger: r,
5722
+ isMultiple: c = !1,
5722
5723
  isFloatingLabel: v = !1,
5723
5724
  subText: m,
5724
5725
  labelClass: h = "",
5725
5726
  loading: f,
5726
5727
  disabled: y
5727
5728
  }) => {
5728
- const [g, p] = R(r ? [] : null), x = Z("custom-select__control", i), C = si(() => e, [e]);
5729
+ const [g, p] = R(c ? [] : null), x = Z("custom-select__control", i), C = si(() => e, [e]);
5729
5730
  return O(() => {
5730
5731
  const S = e == null ? void 0 : e.find((j) => {
5731
5732
  var A;
@@ -5733,7 +5734,7 @@ const xe = ({
5733
5734
  });
5734
5735
  p(S || null);
5735
5736
  }, [u, e]), O(() => {
5736
- g && l && a && (l(d, g == null ? void 0 : g.value), a(d), c == null || c(d));
5737
+ g && l && a && (l(d, g == null ? void 0 : g.value), a(d), r == null || r(d));
5737
5738
  }, [d, g]), /* @__PURE__ */ n.jsxs("div", { className: "custom-select", children: [
5738
5739
  t && !v && /* @__PURE__ */ n.jsx("label", { className: "custom-select__label", children: t }),
5739
5740
  v && t && /* @__PURE__ */ n.jsx("label", { className: Z("custom-select__floating-label", h), children: t }),
@@ -5742,7 +5743,7 @@ const xe = ({
5742
5743
  {
5743
5744
  value: g,
5744
5745
  onChange: p,
5745
- multiple: r,
5746
+ multiple: c,
5746
5747
  disabled: y,
5747
5748
  children: /* @__PURE__ */ n.jsxs("div", { className: "custom-select__wrapper", children: [
5748
5749
  /* @__PURE__ */ n.jsxs(ui.Button, { className: x, disabled: y, children: [
@@ -5794,18 +5795,18 @@ const xe = ({
5794
5795
  setValue: a,
5795
5796
  watch: l,
5796
5797
  isReadOnly: d
5797
- } = e || {}, t = (y = i == null ? void 0 : i.id) != null ? y : "cascadeValue", [u, c] = R(""), [r, v] = R(""), m = (g, p) => {
5798
+ } = e || {}, t = (y = i == null ? void 0 : i.id) != null ? y : "cascadeValue", [u, r] = R(""), [c, v] = R(""), m = (g, p) => {
5798
5799
  const x = g && p ? `${g}_${p}` : "";
5799
5800
  a == null || a(t, x), s == null || s(t);
5800
5801
  }, h = (g, p) => {
5801
- g === "first" ? (c(p), v(""), m(p, "")) : (v(p), m(u, p));
5802
+ g === "first" ? (r(p), v(""), m(p, "")) : (v(p), m(u, p));
5802
5803
  };
5803
5804
  O(() => {
5804
5805
  if (l) {
5805
5806
  const g = l(t);
5806
5807
  if (g != null && g.includes("_")) {
5807
5808
  const [p, x] = g.split("_");
5808
- c(p), v(x);
5809
+ r(p), v(x);
5809
5810
  }
5810
5811
  }
5811
5812
  }, [l, t]);
@@ -5837,7 +5838,7 @@ const xe = ({
5837
5838
  options: f,
5838
5839
  name: `${t}`,
5839
5840
  register: o,
5840
- value: r
5841
+ value: c
5841
5842
  }
5842
5843
  )
5843
5844
  ] })
@@ -5855,18 +5856,18 @@ const xe = ({
5855
5856
  var p;
5856
5857
  const {
5857
5858
  register: u = () => ({}),
5858
- trigger: c,
5859
- setValue: r,
5859
+ trigger: r,
5860
+ setValue: c,
5860
5861
  watch: v,
5861
5862
  isReadOnly: m
5862
5863
  } = t || {}, h = (p = v == null ? void 0 : v(d.id)) != null ? p : 0, [f, y] = R(null);
5863
5864
  O(() => {
5864
- h == null && (r == null || r(d.id, i));
5865
+ h == null && (c == null || c(d.id, i));
5865
5866
  }, []);
5866
5867
  const g = (x) => {
5867
5868
  if (!o && !m) {
5868
5869
  const C = x + 1;
5869
- r == null || r(d.id, C), c == null || c(d.id), s == null || s(C);
5870
+ c == null || c(d.id, C), r == null || r(d.id), s == null || s(C);
5870
5871
  }
5871
5872
  };
5872
5873
  return /* @__PURE__ */ n.jsxs("div", { className: `flex gap-1 ${l}`, children: [
@@ -5938,14 +5939,14 @@ function ye({
5938
5939
  trigger: a,
5939
5940
  isReadOnly: l,
5940
5941
  watch: d
5941
- } = e || {}, t = (d == null ? void 0 : d(i.id)) || "", { country: u, state: c } = si(() => {
5942
+ } = e || {}, t = (d == null ? void 0 : d(i.id)) || "", { country: u, state: r } = si(() => {
5942
5943
  var f;
5943
5944
  if (typeof t == "string" && t.includes(",")) {
5944
5945
  const [y, g] = (f = t.split(",")) == null ? void 0 : f.map((p) => p.trim());
5945
5946
  return { country: g, state: y };
5946
5947
  }
5947
5948
  return { country: t, state: "" };
5948
- }, [t]), r = Mi(t), v = si(() => {
5949
+ }, [t]), c = Mi(t), v = si(() => {
5949
5950
  var f, y;
5950
5951
  return u ? ((y = (f = Xi.find((g) => g.name === u)) == null ? void 0 : f.states) == null ? void 0 : y.map((g) => ({
5951
5952
  label: g.name,
@@ -5953,13 +5954,13 @@ function ye({
5953
5954
  }))) || [] : [];
5954
5955
  }, [u]), m = (f, y) => {
5955
5956
  const p = (y == null ? void 0 : y.value) || "";
5956
- s && p !== r.current && (s(i.id, p), a == null || a(i.id), r.current = p);
5957
+ s && p !== c.current && (s(i.id, p), a == null || a(i.id), c.current = p);
5957
5958
  }, h = (f, y) => {
5958
5959
  const g = (y == null ? void 0 : y.value) || "", p = g ? `${g}, ${u}` : u;
5959
- s && p !== r.current && (s(i.id, p), a == null || a(i.id), r.current = p);
5960
+ s && p !== c.current && (s(i.id, p), a == null || a(i.id), c.current = p);
5960
5961
  };
5961
5962
  return O(() => {
5962
- r.current = t;
5963
+ c.current = t;
5963
5964
  }, [t]), /* @__PURE__ */ n.jsxs("div", { className: "grid gap-y-6", children: [
5964
5965
  /* @__PURE__ */ n.jsx("input", { type: "hidden", ...o(i.id) }),
5965
5966
  /* @__PURE__ */ n.jsx(
@@ -5982,9 +5983,9 @@ function ye({
5982
5983
  onGetValue: h,
5983
5984
  name: `${i.id}-state`,
5984
5985
  readOnly: l,
5985
- defaultValue: c
5986
+ defaultValue: r
5986
5987
  },
5987
- `state-${c}`
5988
+ `state-${r}`
5988
5989
  )
5989
5990
  ] })
5990
5991
  ] });
@@ -5993,7 +5994,7 @@ function Os({
5993
5994
  element: i,
5994
5995
  validationData: e
5995
5996
  }) {
5996
- const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: d } = i, t = si(() => gi("config"), []), [u, c] = R(!1), [r, v] = R(!1), m = X(async () => {
5997
+ const { register: o = () => ({}), isReadOnly: s } = e || {}, { validationUrl: a, documentObj: l, signatureLink: d } = i, t = si(() => gi("config"), []), [u, r] = R(!1), [c, v] = R(!1), m = X(async () => {
5997
5998
  var h, f;
5998
5999
  if (!(!a || !l))
5999
6000
  try {
@@ -6006,7 +6007,7 @@ function Os({
6006
6007
  `${a}/${l}`,
6007
6008
  g
6008
6009
  ), x = !!((f = (h = p == null ? void 0 : p.data) == null ? void 0 : h.isSigned) != null ? f : p != null && p.isSigned);
6009
- return c(x), x;
6010
+ return r(x), x;
6010
6011
  } catch (y) {
6011
6012
  console.error("Failed to check sign status", y);
6012
6013
  } finally {
@@ -6038,21 +6039,21 @@ function Os({
6038
6039
  {
6039
6040
  type: "button",
6040
6041
  onClick: m,
6041
- disabled: r || u,
6042
+ disabled: c || u,
6042
6043
  style: { background: (t == null ? void 0 : t.buttonColor) || "#333" },
6043
6044
  className: Z(
6044
6045
  "flex items-center gap-x-1 rounded-lg border border-gray-200 bg-gray-200 px-3 py-[10px] text-sm text-white",
6045
- { "!opacity-60": r }
6046
+ { "!opacity-60": c }
6046
6047
  ),
6047
6048
  children: [
6048
6049
  /* @__PURE__ */ n.jsx(
6049
6050
  q,
6050
6051
  {
6051
- icon: r ? "solar:refresh-outline" : u ? "solar:check-circle-bold" : "solar:pen-2-line-duotone",
6052
- iconClass: r ? "animate-spin" : ""
6052
+ icon: c ? "solar:refresh-outline" : u ? "solar:check-circle-bold" : "solar:pen-2-line-duotone",
6053
+ iconClass: c ? "animate-spin" : ""
6053
6054
  }
6054
6055
  ),
6055
- r ? "Checking..." : u ? "Signed" : "Sign"
6056
+ c ? "Checking..." : u ? "Signed" : "Sign"
6056
6057
  ]
6057
6058
  }
6058
6059
  ) })
@@ -6314,8 +6315,8 @@ function Ks({
6314
6315
  value: d,
6315
6316
  error: t,
6316
6317
  disabled: u,
6317
- readOnly: c,
6318
- horizontal: r,
6318
+ readOnly: r,
6319
+ horizontal: c,
6319
6320
  description: v,
6320
6321
  validate: m,
6321
6322
  onChange: h,
@@ -6352,13 +6353,13 @@ function Ks({
6352
6353
  }, [C, p, Q]), /* @__PURE__ */ n.jsxs(
6353
6354
  "div",
6354
6355
  {
6355
- className: `relative formGroup ${Q && !c ? "has-error" : ""} ${r ? "flex" : ""} ${!Q && C.length > 0 && !c ? "is-valid" : ""}`,
6356
+ className: `relative formGroup ${Q && !r ? "has-error" : ""} ${c ? "flex" : ""} ${!Q && C.length > 0 && !r ? "is-valid" : ""}`,
6356
6357
  children: [
6357
6358
  i && /* @__PURE__ */ n.jsxs(
6358
6359
  "label",
6359
6360
  {
6360
6361
  htmlFor: l,
6361
- className: `${o} ${r ? "flex-0 mr-6 md:w-[100px] w-[60px] break-words" : ""} flex items-center gap-x-1 input-label text-sm text-[#1B2B41B8]`,
6362
+ className: `${o} ${c ? "flex-0 mr-6 md:w-[100px] w-[60px] break-words" : ""} flex items-center gap-x-1 input-label text-sm text-[#1B2B41B8]`,
6362
6363
  children: [
6363
6364
  i,
6364
6365
  " ",
@@ -6402,7 +6403,7 @@ function Ks({
6402
6403
  inputMode: "numeric",
6403
6404
  value: C,
6404
6405
  disabled: u,
6405
- readOnly: c,
6406
+ readOnly: r,
6406
6407
  onChange: (L) => {
6407
6408
  const U = L.target.value.replace(/\D/g, "");
6408
6409
  S(U);
@@ -6413,7 +6414,7 @@ function Ks({
6413
6414
  minLength: N
6414
6415
  }
6415
6416
  ),
6416
- /* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !Q && C.length > 0 && !c && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(q, { icon: "bi:check-lg" }) }) })
6417
+ /* @__PURE__ */ n.jsx("div", { className: "absolute flex text-xl -translate-y-1/2 top-1/2 right-4", children: !Q && C.length > 0 && !r && /* @__PURE__ */ n.jsx("span", { className: "text-green-500", children: /* @__PURE__ */ n.jsx(q, { icon: "bi:check-lg" }) }) })
6417
6418
  ] })
6418
6419
  ] }),
6419
6420
  v && /* @__PURE__ */ n.jsx("span", { className: "block text-[#475467] font-light leading-4 text-xs mt-2", children: v })
@@ -6445,11 +6446,11 @@ function Gs({
6445
6446
  value: u,
6446
6447
  readOnly: l,
6447
6448
  disabled: l,
6448
- onError: (c) => {
6449
- c ? d == null || d(i.id, { type: "manual", message: c }) : t == null || t(i.id);
6449
+ onError: (r) => {
6450
+ r ? d == null || d(i.id, { type: "manual", message: r }) : t == null || t(i.id);
6450
6451
  },
6451
- onChange: (c) => {
6452
- c && (s == null || s(i.id, c));
6452
+ onChange: (r) => {
6453
+ r && (s == null || s(i.id, r));
6453
6454
  }
6454
6455
  }
6455
6456
  );
@@ -6458,10 +6459,10 @@ function Hs({
6458
6459
  element: i,
6459
6460
  validationData: e
6460
6461
  }) {
6461
- var c;
6462
+ var r;
6462
6463
  const { register: o = () => ({}), watch: s } = e || {};
6463
6464
  let a = "";
6464
- s && (a = (c = s()[i.id]) != null ? c : "");
6465
+ s && (a = (r = s()[i.id]) != null ? r : "");
6465
6466
  const l = a.trim(), d = /^https?:\/\//i.test(l), t = l ? d ? l : `https://${l}` : "", u = !d;
6466
6467
  return /* @__PURE__ */ n.jsxs("div", { children: [
6467
6468
  !(e != null && e.isReadOnly) && /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
@@ -6565,8 +6566,8 @@ const We = {
6565
6566
  formData: d,
6566
6567
  addElement: t,
6567
6568
  setIsDragging: u,
6568
- moveElement: c,
6569
- isDragging: r,
6569
+ moveElement: r,
6570
+ isDragging: c,
6570
6571
  removeElement: v
6571
6572
  } = ji(fi), m = si(
6572
6573
  () => Array.from({ length: i.columns }),
@@ -6600,7 +6601,7 @@ const We = {
6600
6601
  S.preventDefault(), S.stopPropagation(), u(!1), f(null);
6601
6602
  const A = j + 1, N = S.dataTransfer.getData("elementId");
6602
6603
  if (N) {
6603
- c({
6604
+ r({
6604
6605
  draggedId: N,
6605
6606
  sectionId: e,
6606
6607
  targetGridId: i.id,
@@ -6632,7 +6633,7 @@ const We = {
6632
6633
  console.error("Drop failed in grid:", ei), u(!1);
6633
6634
  }
6634
6635
  },
6635
- [t, i.id, d, e, u, c]
6636
+ [t, i.id, d, e, u, r]
6636
6637
  ), C = (S, j, A) => {
6637
6638
  var K, G, P;
6638
6639
  const N = S + 1, E = (G = (K = d.find((M) => M.id === e)) == null ? void 0 : K.questionData) == null ? void 0 : G.find(
@@ -6643,7 +6644,7 @@ const We = {
6643
6644
  ), ei = (P = E == null ? void 0 : E.id) != null ? P : null, Y = Array.isArray(o) && o.find((M) => {
6644
6645
  var B;
6645
6646
  return ((B = M == null ? void 0 : M.props) == null ? void 0 : B.col) === N;
6646
- }), Q = r && h === S, L = !!Y, U = r && !!l, I = L && ei && A === "edit" ? {
6647
+ }), Q = c && h === S, L = !!Y, U = c && !!l, I = L && ei && A === "edit" ? {
6647
6648
  draggable: !0,
6648
6649
  onDragStart: (M) => {
6649
6650
  M.stopPropagation(), M.dataTransfer.setData("elementId", ei), M.dataTransfer.setData("properties", ei), M.dataTransfer.effectAllowed = "move", u(!0);
@@ -6751,13 +6752,13 @@ function Us({ elementData: i, sectionId: e }) {
6751
6752
  setIsDragging: a,
6752
6753
  addElementInPosition: l,
6753
6754
  moveElement: d
6754
- } = ji(fi), [t, u] = R(null), c = si(
6755
+ } = ji(fi), [t, u] = R(null), r = si(
6755
6756
  () => {
6756
6757
  var p;
6757
6758
  return ((p = o.find((x) => x.id === e)) == null ? void 0 : p.questionData) || [];
6758
6759
  },
6759
6760
  [o, e]
6760
- ), r = X(
6761
+ ), c = X(
6761
6762
  (p, x) => {
6762
6763
  p.dataTransfer.setData("elementId", x), p.dataTransfer.setData("properties", x), p.dataTransfer.effectAllowed = "move", u(x), a(!0);
6763
6764
  },
@@ -6776,12 +6777,12 @@ function Us({ elementData: i, sectionId: e }) {
6776
6777
  v();
6777
6778
  return;
6778
6779
  }
6779
- const S = c.find((A) => A.id === x), j = c.findIndex(
6780
+ const S = r.find((A) => A.id === x), j = r.findIndex(
6780
6781
  (A) => A.id === C
6781
6782
  );
6782
6783
  S != null && S.gridId && j !== -1 ? d({ draggedId: x, sectionId: e, targetIndex: j }) : d({ draggedId: x, sectionId: e, targetId: C }), u(null), a(!1);
6783
6784
  },
6784
- [e, d, a, v, c]
6785
+ [e, d, a, v, r]
6785
6786
  ), h = X(
6786
6787
  (p, x) => {
6787
6788
  p.preventDefault(), p.stopPropagation(), a(!1);
@@ -6806,7 +6807,7 @@ function Us({ elementData: i, sectionId: e }) {
6806
6807
  {
6807
6808
  id: p.id,
6808
6809
  draggable: !0,
6809
- onDragStart: (C) => r(C, p.id),
6810
+ onDragStart: (C) => c(C, p.id),
6810
6811
  onDragOver: x ? void 0 : (C) => {
6811
6812
  C.preventDefault(), C.stopPropagation();
6812
6813
  },
@@ -6821,7 +6822,7 @@ function Us({ elementData: i, sectionId: e }) {
6821
6822
  },
6822
6823
  p.id
6823
6824
  ),
6824
- [t, m, e, r, v]
6825
+ [t, m, e, c, v]
6825
6826
  ), y = si(() => (i == null ? void 0 : i.reduce((p, x) => (x.gridId && (p[x.gridId] = p[x.gridId] || [], p[x.gridId].push(x)), p), {})) || {}, [i]);
6826
6827
  if (!(i != null && i.length))
6827
6828
  return /* @__PURE__ */ n.jsx(
@@ -6846,7 +6847,7 @@ function Us({ elementData: i, sectionId: e }) {
6846
6847
  }
6847
6848
  ),
6848
6849
  g.map((p) => {
6849
- const x = c.findIndex((C) => C.id === p.id);
6850
+ const x = r.findIndex((C) => C.id === p.id);
6850
6851
  if (p.type === "grid") {
6851
6852
  const C = y[p.id] || [], S = t === p.id, j = !!t && !S;
6852
6853
  return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-0", children: [
@@ -6855,7 +6856,7 @@ function Us({ elementData: i, sectionId: e }) {
6855
6856
  {
6856
6857
  id: p.id,
6857
6858
  draggable: !0,
6858
- onDragStart: (A) => r(A, p.id),
6859
+ onDragStart: (A) => c(A, p.id),
6859
6860
  onDragOver: (A) => {
6860
6861
  A.preventDefault(), A.stopPropagation();
6861
6862
  },
@@ -6919,15 +6920,15 @@ const zs = an(Us), _s = w.object({
6919
6920
  register: a,
6920
6921
  handleSubmit: l,
6921
6922
  watch: d,
6922
- formState: { errors: t, isSubmitting: u, isValid: c },
6923
- reset: r
6923
+ formState: { errors: t, isSubmitting: u, isValid: r },
6924
+ reset: c
6924
6925
  } = En({
6925
6926
  resolver: On(_s),
6926
6927
  defaultValues: o
6927
6928
  });
6928
6929
  if (bi.useEffect(() => {
6929
- i || r();
6930
- }, [i, r]), !i) return null;
6930
+ i || c();
6931
+ }, [i, c]), !i) return null;
6931
6932
  const v = (h) => {
6932
6933
  s(h, o.id), e();
6933
6934
  }, m = d();
@@ -7007,9 +7008,9 @@ const zs = an(Us), _s = w.object({
7007
7008
  "button",
7008
7009
  {
7009
7010
  type: "submit",
7010
- disabled: !c || u,
7011
+ disabled: !r || u,
7011
7012
  style: { background: (yn == null ? void 0 : yn.buttonColor) || "#333" },
7012
- className: `flex-1 px-4 py-2.5 ${!c || u ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!c || u ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,
7013
+ className: `flex-1 px-4 py-2.5 ${!r || u ? "bg-[#F2F4F7]" : "bg-[#2563EB]"} ${!r || u ? "text-[#98A2B3]" : "text-white"} rounded-lg shadow-xs font-semibold font-onest disabled:opacity-50`,
7013
7014
  children: u ? "Saving..." : "Save"
7014
7015
  }
7015
7016
  )
@@ -7026,8 +7027,8 @@ const zs = an(Us), _s = w.object({
7026
7027
  handleSectionEdit: d,
7027
7028
  removeSection: t,
7028
7029
  formDataLength: u,
7029
- onDragOver: c,
7030
- setIsDragging: r
7030
+ onDragOver: r,
7031
+ setIsDragging: c
7031
7032
  }) => {
7032
7033
  var h, f;
7033
7034
  const v = Mi(null), m = Mi((h = i.questionData) == null ? void 0 : h.length);
@@ -7102,8 +7103,8 @@ const zs = an(Us), _s = w.object({
7102
7103
  {
7103
7104
  className: "h-full mt-4 transition-all duration-200",
7104
7105
  id: i.id,
7105
- onDragOver: c,
7106
- onDragEnd: () => r(!1),
7106
+ onDragOver: r,
7107
+ onDragEnd: () => c(!1),
7107
7108
  onClick: () => s(i.id),
7108
7109
  children: [
7109
7110
  /* @__PURE__ */ n.jsx("hr", { className: "group-last:hidden" }),
@@ -7131,8 +7132,8 @@ const zs = an(Us), _s = w.object({
7131
7132
  formData: d,
7132
7133
  setIsDragging: t,
7133
7134
  setSelectedSection: u,
7134
- selectedSection: c,
7135
- activeSections: r,
7135
+ selectedSection: r,
7136
+ activeSections: c,
7136
7137
  setActiveSections: v
7137
7138
  } = ji(fi), m = Mi((d == null ? void 0 : d.length) || 0);
7138
7139
  O(() => {
@@ -7151,7 +7152,7 @@ const zs = an(Us), _s = w.object({
7151
7152
  p.preventDefault(), p.dataTransfer.dropEffect = "move", s.current && (s.current.scrollTop = s.current.scrollHeight);
7152
7153
  }, []);
7153
7154
  function f(p) {
7154
- r.includes(p) ? v(
7155
+ c.includes(p) ? v(
7155
7156
  (x) => x.filter((C) => C !== p)
7156
7157
  ) : v((x) => [...x, p]);
7157
7158
  }
@@ -7185,9 +7186,9 @@ const zs = an(Us), _s = w.object({
7185
7186
  {
7186
7187
  section: p,
7187
7188
  index: x,
7188
- selectedSection: c,
7189
+ selectedSection: r,
7189
7190
  setSelectedSection: u,
7190
- activeSections: r,
7191
+ activeSections: c,
7191
7192
  toggleSection: f,
7192
7193
  handleSectionEdit: y,
7193
7194
  removeSection: a,
@@ -7312,7 +7313,7 @@ const An = [
7312
7313
  };
7313
7314
  s(f, a);
7314
7315
  }
7315
- const t = gi("config") || {}, u = t.elementColor, c = t.elementBgColor, r = t.elementBorderColor, v = $a.filter(
7316
+ const t = gi("config") || {}, u = t.elementColor, r = t.elementBgColor, c = t.elementBorderColor, v = $a.filter(
7316
7317
  (h) => h.label.toLowerCase().includes(i.toLowerCase())
7317
7318
  ), m = An == null ? void 0 : An.map((h) => ({
7318
7319
  title: h.title,
@@ -7346,8 +7347,8 @@ const An = [
7346
7347
  onDragEnd: () => o(!1),
7347
7348
  onClick: () => d(g),
7348
7349
  style: {
7349
- borderColor: r,
7350
- backgroundColor: c
7350
+ borderColor: c,
7351
+ backgroundColor: r
7351
7352
  },
7352
7353
  className: `cursor-move text-[#475467] flex justify-between items-center \r
7353
7354
  border-[1.5px] border-[#98A2B3] rounded-lg py-2 px-2 shadow-custom\r
@@ -7381,8 +7382,8 @@ const An = [
7381
7382
  iconClass: d = "text-[20px]",
7382
7383
  loadingClass: t = "",
7383
7384
  link: u = "",
7384
- div: c = !1,
7385
- type: r = "button",
7385
+ div: r = !1,
7386
+ type: c = "button",
7386
7387
  style: v,
7387
7388
  onClick: m
7388
7389
  }) => {
@@ -7430,11 +7431,11 @@ const An = [
7430
7431
  i && /* @__PURE__ */ n.jsx("span", { children: i }),
7431
7432
  a && l === "right" && /* @__PURE__ */ n.jsx("span", { className: `ml-[6px] ${d}`, children: /* @__PURE__ */ n.jsx(q, { icon: a }) })
7432
7433
  ] });
7433
- return c ? /* @__PURE__ */ n.jsx("div", { className: h, children: f() }) : u ? /* @__PURE__ */ n.jsx(To, { to: u, className: h, children: f() }) : /* @__PURE__ */ n.jsx(
7434
+ return r ? /* @__PURE__ */ n.jsx("div", { className: h, children: f() }) : u ? /* @__PURE__ */ n.jsx(To, { to: u, className: h, children: f() }) : /* @__PURE__ */ n.jsx(
7434
7435
  "button",
7435
7436
  {
7436
7437
  disabled: e,
7437
- type: r,
7438
+ type: c,
7438
7439
  className: h,
7439
7440
  "data-testid": "btn",
7440
7441
  onClick: m,
@@ -7546,7 +7547,7 @@ function ol({
7546
7547
  publishLoading: d,
7547
7548
  onTitleChange: t
7548
7549
  }) {
7549
- const { formData: u, setShowPreview: c, showPreview: r } = ji(fi), [v, m] = R(!1), [h, f] = R(!1), [y, g] = R(i || ""), p = gi("config");
7550
+ const { formData: u, setShowPreview: r, showPreview: c } = ji(fi), [v, m] = R(!1), [h, f] = R(!1), [y, g] = R(i || ""), p = gi("config");
7550
7551
  function x() {
7551
7552
  localStorage.setItem("formData", JSON.stringify(u)), o == null || o(u);
7552
7553
  }
@@ -7601,10 +7602,10 @@ function ol({
7601
7602
  /* @__PURE__ */ n.jsx(
7602
7603
  Bi,
7603
7604
  {
7604
- onClick: () => c((j) => !j),
7605
- text: r ? "Hide Preview" : "Preview",
7605
+ onClick: () => r((j) => !j),
7606
+ text: c ? "Hide Preview" : "Preview",
7606
7607
  btnClass: "px-2 bg-transparent font-medium text-sm form_preview",
7607
- icon: r ? "iconamoon:eye-off-duotone" : "solar:eye-bold-duotone",
7608
+ icon: c ? "iconamoon:eye-off-duotone" : "solar:eye-bold-duotone",
7608
7609
  iconClass: "text-base",
7609
7610
  style: { color: (p == null ? void 0 : p.buttonColor) || "#333" },
7610
7611
  isDisabled: a,
@@ -7658,8 +7659,8 @@ function al({
7658
7659
  previewLoading: d,
7659
7660
  saveLoading: t,
7660
7661
  publishLoading: u,
7661
- onTitleChange: c,
7662
- uploadUrl: r
7662
+ onTitleChange: r,
7663
+ uploadUrl: c
7663
7664
  }) {
7664
7665
  return /* @__PURE__ */ n.jsxs(je, { children: [
7665
7666
  /* @__PURE__ */ n.jsx(Ne, { position: "top-right", richColors: !0, closeButton: !0 }),
@@ -7676,10 +7677,10 @@ function al({
7676
7677
  previewLoading: d,
7677
7678
  saveLoading: t,
7678
7679
  publishLoading: u,
7679
- onTitleChange: c
7680
+ onTitleChange: r
7680
7681
  }
7681
7682
  ) }),
7682
- /* @__PURE__ */ n.jsx("div", { className: "p-6 h-[calc(100vh-70px)]", children: a ? /* @__PURE__ */ n.jsx(Ue, { loadingClass: "!w-full !h-[800px]" }) : /* @__PURE__ */ n.jsx($s, { questionData: e, uploadUrl: r }) })
7683
+ /* @__PURE__ */ n.jsx("div", { className: "p-6 h-[calc(100vh-70px)]", children: a ? /* @__PURE__ */ n.jsx(Ue, { loadingClass: "!w-full !h-[800px]" }) : /* @__PURE__ */ n.jsx($s, { questionData: e, uploadUrl: c }) })
7683
7684
  ] })
7684
7685
  ] }) })
7685
7686
  ] });
@@ -7696,8 +7697,8 @@ const Ml = ({
7696
7697
  goBackUrl: d,
7697
7698
  onPublish: t,
7698
7699
  previewLoading: u,
7699
- saveLoading: c,
7700
- publishLoading: r,
7700
+ saveLoading: r,
7701
+ publishLoading: c,
7701
7702
  onTitleChange: v,
7702
7703
  uploadUrl: m
7703
7704
  }) => (O(() => {
@@ -7713,8 +7714,8 @@ const Ml = ({
7713
7714
  goBackUrl: d,
7714
7715
  loading: l,
7715
7716
  previewLoading: u,
7716
- saveLoading: c,
7717
- publishLoading: r,
7717
+ saveLoading: r,
7718
+ publishLoading: c,
7718
7719
  onTitleChange: v,
7719
7720
  uploadUrl: m
7720
7721
  }
@@ -7726,19 +7727,19 @@ const Ml = ({
7726
7727
  maxLength: (i) => `Maximum length is ${i}`,
7727
7728
  minAmount: (i) => `Minimum amount is ${i}`,
7728
7729
  maxAmount: (i) => `Maximum amount is ${i}`
7729
- }, sl = (i) => ({
7730
+ }, sl = (i, e = !1) => ({
7730
7731
  textField: w.string().nullable(),
7731
7732
  longText: w.string().nullable(),
7732
- numberField: w.number().nullable().transform((o) => isNaN(o) ? null : o),
7733
- amountField: w.number().nullable().transform((o) => isNaN(o) ? null : o),
7733
+ numberField: w.number().nullable().transform((s) => isNaN(s) ? null : s),
7734
+ amountField: w.number().nullable().transform((s) => isNaN(s) ? null : s),
7734
7735
  selectField: w.string().nullable(),
7735
7736
  checkbox: w.mixed().nullable(),
7736
7737
  radio: w.mixed().nullable(),
7737
7738
  matrix: w.mixed().nullable(),
7738
- email: w.string().nullable().test("email-format", Ti.email, (o) => !o || o.trim() === "" ? !0 : /^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/.test(o)),
7739
- date: w.date().typeError("Invalid date").nullable(),
7740
- url: w.string().nullable().test("url-format", Ti.url, (o) => !o || o.trim() === "" ? !0 : /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(
7741
- o
7739
+ email: w.string().nullable().test("email-format", Ti.email, (s) => !s || s.trim() === "" ? !0 : /^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/.test(s)),
7740
+ date: w.date().nullable().transform((s, a) => e && a === "" ? null : s).typeError("Invalid date"),
7741
+ url: w.string().nullable().test("url-format", Ti.url, (s) => !s || s.trim() === "" ? !0 : /^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(
7742
+ s
7742
7743
  ))
7743
7744
  })[i] || w.mixed().nullable(), ll = (i, e, o) => e ? i.type === "boolean" ? i.oneOf([!0], o || Ti.required) : i.required(o || Ti.required) : i, dl = (i, {
7744
7745
  minLength: e,
@@ -7769,25 +7770,25 @@ const Ml = ({
7769
7770
  a || Ti.maxAmount(o)
7770
7771
  )), l;
7771
7772
  };
7772
- function tl(i) {
7773
- const e = {};
7774
- return i.forEach(({ questionData: o }) => {
7775
- o == null || o.forEach((s) => {
7776
- const { id: a, type: l, isRequired: d, requiredMessage: t, isDisabled: u } = s;
7777
- let c = sl(l);
7773
+ function tl({ formData: i, isReadOnly: e }) {
7774
+ const o = {};
7775
+ return i.forEach(({ questionData: s }) => {
7776
+ s == null || s.forEach((a) => {
7777
+ const { id: l, type: d, isRequired: t, requiredMessage: u, isDisabled: r } = a;
7778
+ let c = sl(d, e);
7778
7779
  c = ll(
7779
7780
  c,
7780
- u ? !1 : d,
7781
- t
7782
- ), l === "textField" || l === "longText" || l === "email" || l === "url" ? c = dl(
7781
+ r || e ? !1 : t,
7782
+ u
7783
+ ), d === "textField" || d === "longText" || d === "email" || d === "url" ? c = dl(
7783
7784
  c,
7784
- s
7785
- ) : (l === "numberField" || l === "amountField") && (c = ul(
7785
+ a
7786
+ ) : (d === "numberField" || d === "amountField") && (c = ul(
7786
7787
  c,
7787
- s
7788
- )), e[a] = c;
7788
+ a
7789
+ )), o[l] = c;
7789
7790
  });
7790
- }), w.object().shape(e);
7791
+ }), w.object().shape(o);
7791
7792
  }
7792
7793
  const en = ({ element: i, validationData: e }) => {
7793
7794
  const o = We[i.type], { answerData: s } = ji(fi), a = si(
@@ -7802,20 +7803,20 @@ const en = ({ element: i, validationData: e }) => {
7802
7803
  ), d = si(() => l.length ? l.every(
7803
7804
  (t) => {
7804
7805
  if (!i.isHidden) return !0;
7805
- const u = s == null ? void 0 : s[t.id], c = t.fieldValue, r = u;
7806
+ const u = s == null ? void 0 : s[t.id], r = t.fieldValue, c = u;
7806
7807
  switch (t.operator) {
7807
7808
  case "equals":
7808
- return String(c).toLowerCase() === String(r).toLowerCase();
7809
+ return String(r).toLowerCase() === String(c).toLowerCase();
7809
7810
  case "not_equals":
7810
- return String(c).toLowerCase() !== String(r).toLowerCase();
7811
+ return String(r).toLowerCase() !== String(c).toLowerCase();
7811
7812
  case "greater":
7812
- return Number(r) > Number(c);
7813
+ return Number(c) > Number(r);
7813
7814
  case "less":
7814
- return Number(r) < Number(c);
7815
+ return Number(c) < Number(r);
7815
7816
  case "contains":
7816
- return String(r).toLowerCase().includes(String(c).toLowerCase());
7817
+ return String(c).toLowerCase().includes(String(r).toLowerCase());
7817
7818
  case "not_contains":
7818
- return !String(r).toLowerCase().includes(String(c).toLowerCase());
7819
+ return !String(c).toLowerCase().includes(String(r).toLowerCase());
7819
7820
  default:
7820
7821
  return !0;
7821
7822
  }
@@ -7857,7 +7858,7 @@ function cl({ form_data: i, options: e }) {
7857
7858
  element: a,
7858
7859
  customClass: "p-0 min-h-[60px] border-none",
7859
7860
  children: l == null ? void 0 : l.map((d) => {
7860
- var t, u, c;
7861
+ var t, u, r;
7861
7862
  return /* @__PURE__ */ n.jsxs(
7862
7863
  Gn,
7863
7864
  {
@@ -7871,7 +7872,7 @@ function cl({ form_data: i, options: e }) {
7871
7872
  validationData: on(d, e)
7872
7873
  }
7873
7874
  ),
7874
- ((c = (u = e == null ? void 0 : e.errors) == null ? void 0 : u[d.id]) == null ? void 0 : c.message) && /* @__PURE__ */ n.jsx("div", { className: "mt-1 text-xs text-red-600", children: e.errors[d.id].message })
7875
+ ((r = (u = e == null ? void 0 : e.errors) == null ? void 0 : u[d.id]) == null ? void 0 : r.message) && /* @__PURE__ */ n.jsx("div", { className: "mt-1 text-xs text-red-600", children: e.errors[d.id].message })
7875
7876
  ]
7876
7877
  },
7877
7878
  d.id
@@ -7929,11 +7930,11 @@ function rl({ form_data: i, options: e, current: o }) {
7929
7930
  element: a,
7930
7931
  customClass: "p-0 min-h-[60px] border-none",
7931
7932
  children: t == null ? void 0 : t.map((u) => {
7932
- var c, r, v;
7933
+ var r, c, v;
7933
7934
  return /* @__PURE__ */ n.jsxs(
7934
7935
  Gn,
7935
7936
  {
7936
- col: (c = u.gridPosition) == null ? void 0 : c.col,
7937
+ col: (r = u.gridPosition) == null ? void 0 : r.col,
7937
7938
  customClass: "p-0",
7938
7939
  children: [
7939
7940
  /* @__PURE__ */ n.jsx(
@@ -7943,7 +7944,7 @@ function rl({ form_data: i, options: e, current: o }) {
7943
7944
  validationData: on(u, e)
7944
7945
  }
7945
7946
  ),
7946
- /* @__PURE__ */ n.jsx("div", { className: "mt-1 text-xs text-red-600", children: (v = (r = e == null ? void 0 : e.errors) == null ? void 0 : r[u.id]) == null ? void 0 : v.message })
7947
+ /* @__PURE__ */ n.jsx("div", { className: "mt-1 text-xs text-red-600", children: (v = (c = e == null ? void 0 : e.errors) == null ? void 0 : c[u.id]) == null ? void 0 : v.message })
7947
7948
  ]
7948
7949
  },
7949
7950
  u.id
@@ -7987,10 +7988,10 @@ const bl = ({
7987
7988
  renderType: d = "multi",
7988
7989
  children: t,
7989
7990
  hideFooter: u = !1,
7990
- uploadUrl: c
7991
+ uploadUrl: r
7991
7992
  }) => {
7992
7993
  var ii, di, pi, vi, D, _, V, F;
7993
- const { setAnswerData: r, setUploadUrl: v } = ji(fi), [m, h] = R(0), f = si(
7994
+ const { setAnswerData: c, setUploadUrl: v } = ji(fi), [m, h] = R(0), f = si(
7994
7995
  () => i.filter((W) => !W.isHidden).map((W) => {
7995
7996
  var ti;
7996
7997
  return W.isDisabled || W.disabled ? {
@@ -8003,8 +8004,8 @@ const bl = ({
8003
8004
  }),
8004
8005
  [i]
8005
8006
  ), y = (ii = f == null ? void 0 : f.length) != null ? ii : 0, g = gi("config"), p = si(
8006
- () => tl(f),
8007
- [f]
8007
+ () => tl({ formData: f, isReadOnly: l }),
8008
+ [f, l]
8008
8009
  ), x = En({
8009
8010
  resolver: On(p),
8010
8011
  mode: "onSubmit",
@@ -8031,8 +8032,8 @@ const bl = ({
8031
8032
  [a]
8032
8033
  );
8033
8034
  O(() => {
8034
- v(c);
8035
- }, [v, c]), O(() => {
8035
+ v(r);
8036
+ }, [v, r]), O(() => {
8036
8037
  if (!(f != null && f.length) || !a) return;
8037
8038
  const W = f.flatMap(
8038
8039
  (oi) => {
@@ -8049,13 +8050,13 @@ const bl = ({
8049
8050
  }));
8050
8051
  }
8051
8052
  );
8052
- P(W), r(G);
8053
+ P(W), c(G);
8053
8054
  }, [
8054
8055
  G,
8055
8056
  f,
8056
8057
  P,
8057
8058
  a,
8058
- r
8059
+ c
8059
8060
  ]), O(() => {
8060
8061
  e != null && e.length && N(ml(e));
8061
8062
  }, [e, N]);
@@ -8213,8 +8214,8 @@ function ze({
8213
8214
  config: d = { buttonColor: "#333" },
8214
8215
  renderType: t,
8215
8216
  children: u,
8216
- hideFooter: c,
8217
- onGetValues: r,
8217
+ hideFooter: r,
8218
+ onGetValues: c,
8218
8219
  uploadUrl: v
8219
8220
  }) {
8220
8221
  O(() => {
@@ -8222,9 +8223,9 @@ function ze({
8222
8223
  }, [d]);
8223
8224
  const m = X(
8224
8225
  (h) => {
8225
- r && r(h);
8226
+ c && c(h);
8226
8227
  },
8227
- [r]
8228
+ [c]
8228
8229
  );
8229
8230
  return l ? /* @__PURE__ */ n.jsx(Ue, {}) : e ? /* @__PURE__ */ n.jsxs("div", { className: "w-full h-full min-w-0", children: [
8230
8231
  /* @__PURE__ */ n.jsx("div", { id: "root-portal" }),
@@ -8237,7 +8238,7 @@ function ze({
8237
8238
  onSubmitData: s,
8238
8239
  isReadOnly: a,
8239
8240
  renderType: t,
8240
- hideFooter: c,
8241
+ hideFooter: r,
8241
8242
  onGetValues: m,
8242
8243
  uploadUrl: v,
8243
8244
  children: u