reactaform 1.9.0 → 1.9.1

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.
@@ -1,8 +1,8 @@
1
1
  import { jsx as p, jsxs as D, Fragment as Ie } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
- import { createContext as ot, useContext as it, useRef as pe, useEffect as Ue, useCallback as ge } from "react";
3
+ import { createContext as it, useContext as st, useRef as pe, useEffect as Ue, useCallback as ge } from "react";
4
4
  import * as de from "react-dom";
5
- const st = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
5
+ const ct = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
6
6
  \r
7
7
  /* Default Light Theme */\r
8
8
  :root {\r
@@ -65,7 +65,7 @@ const st = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
65
65
  --reactaform-button-bg: var(--reactaform-success-color);\r
66
66
  --reactaform-button-text: #ffffff;\r
67
67
  --reactaform-button-padding: var(--reactaform-space) 12px;\r
68
- --reactaform-button-border-radius: var(--reactaform-border-radius);\r
68
+ --reactaform-button-border-radius: 6px;\r
69
69
  --reactaform-button-font-size: 14px;\r
70
70
  --reactaform-button-font-weight: var(--reactaform-font-weight);\r
71
71
  --reactaform-button-hover-opacity: 0.9;\r
@@ -200,6 +200,15 @@ const st = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
200
200
  user-select: none;\r
201
201
  }\r
202
202
  \r
203
+ /* Description (UI-only display text) */\r
204
+ .reactaform-description {\r
205
+ font-size: var(--reactaform-font-size, 14px);\r
206
+ font-weight: var(--reactaform-font-weight, 500);\r
207
+ margin: var(--reactaform-space, 8px) 0;\r
208
+ color: var(--reactaform-text-color, #000000);\r
209
+ user-select: none;\r
210
+ }\r
211
+ \r
203
212
  /* Ensure row layout labels are left-aligned */\r
204
213
  \r
205
214
  \r
@@ -292,7 +301,7 @@ const st = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
292
301
  background-color: var(--reactaform-button-bg, var(--reactaform-success-color, #4CAF50));\r
293
302
  color: var(--reactaform-button-text, var(--reactaform-text-color, #000000));\r
294
303
  padding: var(--reactaform-button-padding);\r
295
- border-radius: var(--reactaform-button-border-radius);\r
304
+ border-radius: var(--reactaform-button-border-radius, 6px);\r
296
305
  font-size: var(--reactaform-button-font-size);\r
297
306
  font-weight: var(--reactaform-button-font-weight);\r
298
307
  box-shadow: var(--reactaform-button-shadow);\r
@@ -300,10 +309,15 @@ const st = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
300
309
  border: none;\r
301
310
  cursor: pointer;\r
302
311
  transition: opacity 0.2s ease;\r
312
+ width: 100%;\r
313
+ display: flex;\r
314
+ justify-content: center;\r
315
+ align-items: center;\r
303
316
  }\r
304
317
  \r
305
318
  .reactaform-button:hover:not(:disabled) {\r
306
319
  opacity: var(--reactaform-button-hover-opacity);\r
320
+ background-color: var(--reactaform-button-bg-hover, #0056b3);\r
307
321
  }\r
308
322
  \r
309
323
  .reactaform-button:disabled {\r
@@ -380,8 +394,8 @@ const st = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
380
394
  \r
381
395
  \r
382
396
  }\r
383
- `, Ee = ot(void 0), H = () => {
384
- const e = it(Ee);
397
+ `, Ee = it(void 0), B = () => {
398
+ const e = st(Ee);
385
399
  if (!e)
386
400
  throw new Error("❌ useReactaFormContext must be used within a <ReactaFormProvider>");
387
401
  return e;
@@ -433,7 +447,7 @@ class ne {
433
447
  }
434
448
  }
435
449
  const ar = typeof process < "u" && process.env.NODE_ENV === "test";
436
- function ct(e, r = 300, t) {
450
+ function lt(e, r = 300, t) {
437
451
  const n = pe(), a = pe(e), o = pe(null), c = t?.leading === !0, s = t?.trailing !== !1;
438
452
  Ue(() => {
439
453
  a.current = e;
@@ -469,7 +483,8 @@ const V = {
469
483
  inputNumber: "reactaform-input--number",
470
484
  inputSelect: "reactaform-select",
471
485
  rangeInput: "reactaform-input--range",
472
- button: "reactaform-button"
486
+ button: "reactaform-button",
487
+ description: "reactaform-description"
473
488
  }, U = (...e) => {
474
489
  const r = [];
475
490
  for (const t of e)
@@ -481,7 +496,7 @@ const V = {
481
496
  function ie(e) {
482
497
  return e.toLowerCase().includes("dark");
483
498
  }
484
- function lt(e) {
499
+ function ut(e) {
485
500
  if (!e) return !1;
486
501
  const r = e.trim();
487
502
  let t = 0, n = 0, a = 0;
@@ -495,7 +510,7 @@ function lt(e) {
495
510
  return !1;
496
511
  return (t * 299 + n * 587 + a * 114) / 1e3 < 128;
497
512
  }
498
- const ut = () => /* @__PURE__ */ D(
513
+ const mt = () => /* @__PURE__ */ D(
499
514
  "svg",
500
515
  {
501
516
  width: "1em",
@@ -511,13 +526,13 @@ const ut = () => /* @__PURE__ */ D(
511
526
  /* @__PURE__ */ p("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
512
527
  ]
513
528
  }
514
- ), mt = ({ content: e, size: r = "medium", animation: t = !0 }) => {
515
- const { t: n, theme: a, formStyle: o, fieldStyle: c } = H(), [s, i] = l.useState(!1), [d, m] = l.useState({ x: 0, y: 0 }), [u, f] = l.useState(!1), b = l.useRef(null), N = l.useRef(null), C = l.useRef(null), h = l.useId(), y = ie(a), [E, F] = l.useState(void 0);
529
+ ), dt = ({ content: e, size: r = "medium", animation: t = !0 }) => {
530
+ const { t: n, theme: a, formStyle: o, fieldStyle: c } = B(), [s, i] = l.useState(!1), [d, m] = l.useState({ x: 0, y: 0 }), [u, f] = l.useState(!1), b = l.useRef(null), C = l.useRef(null), N = l.useRef(null), h = l.useId(), y = ie(a), [E, F] = l.useState(void 0);
516
531
  l.useLayoutEffect(() => {
517
532
  if (!b.current) return;
518
533
  const I = "rgba(255,255,255,0.1)", g = getComputedStyle(b.current).getPropertyValue("--reactaform-primary-bg").trim();
519
534
  if (g && typeof CSS < "u" && CSS.supports?.("color: color-mix(in srgb, red, blue)")) {
520
- const w = lt(g) ? "black" : "white";
535
+ const w = ut(g) ? "black" : "white";
521
536
  F(`color-mix(in srgb, var(--reactaform-primary-bg) 85%, ${w} 15%)`);
522
537
  } else
523
538
  F(I);
@@ -578,13 +593,13 @@ const ut = () => /* @__PURE__ */ D(
578
593
  };
579
594
  }, [y, r, t, o, c, E]);
580
595
  l.useLayoutEffect(() => {
581
- if (!s || !b.current || !N.current) {
596
+ if (!s || !b.current || !C.current) {
582
597
  f(!1);
583
598
  return;
584
599
  }
585
600
  const I = b.current.getBoundingClientRect();
586
- C.current = I;
587
- const v = N.current.getBoundingClientRect(), g = 8, w = window.innerWidth, x = window.innerHeight, k = -4;
601
+ N.current = I;
602
+ const v = C.current.getBoundingClientRect(), g = 8, w = window.innerWidth, x = window.innerHeight, k = -4;
588
603
  let S = I.right + g, A = I.top + I.height / 2 - v.height / 2 + k;
589
604
  S + v.width > w - g && (S = I.left - g - v.width), S = Math.max(g, Math.min(S, w - v.width - g)), A = Math.max(g, Math.min(A, x - v.height - g)), m({ x: S, y: A }), f(!0);
590
605
  const j = b.current.closest("[data-reactaform-theme]"), K = document.getElementById("popup-root");
@@ -602,7 +617,7 @@ const ut = () => /* @__PURE__ */ D(
602
617
  const $ = typeof document < "u" ? document.getElementById("popup-root") : null, R = /* @__PURE__ */ p(
603
618
  "div",
604
619
  {
605
- ref: N,
620
+ ref: C,
606
621
  "data-tooltip-id": h,
607
622
  style: {
608
623
  ...M.text,
@@ -629,18 +644,18 @@ const ut = () => /* @__PURE__ */ D(
629
644
  style: {
630
645
  ...M.icon
631
646
  },
632
- children: /* @__PURE__ */ p(ut, {})
647
+ children: /* @__PURE__ */ p(mt, {})
633
648
  }
634
649
  ),
635
650
  s && ($ ? de.createPortal(R, $) : R)
636
651
  ] });
637
- }, or = l.memo(mt), ve = l.memo(({
652
+ }, or = l.memo(dt), ve = l.memo(({
638
653
  field: e,
639
654
  error: r,
640
655
  children: t,
641
656
  showLabel: n = !0
642
657
  }) => {
643
- const { t: a } = H(), o = e.labelLayout === "column-center" ? "center" : "left", c = l.useMemo(() => {
658
+ const { t: a } = B(), o = e.labelLayout === "column-center" ? "center" : "left", c = l.useMemo(() => {
644
659
  const d = {
645
660
  display: "flex",
646
661
  flexDirection: "column",
@@ -684,7 +699,7 @@ const ir = l.memo(({
684
699
  children: t,
685
700
  rightAlign: n = !1
686
701
  }) => {
687
- const { t: a } = H(), o = l.useMemo(() => ({
702
+ const { t: a } = B(), o = l.useMemo(() => ({
688
703
  display: "flex",
689
704
  alignItems: "center",
690
705
  gap: "3px"
@@ -733,7 +748,7 @@ const Me = l.memo(({ children: e, id: r }) => {
733
748
  });
734
749
  Me.displayName = "ErrorDiv";
735
750
  const sr = l.memo(({ name: e, onChange: r }) => {
736
- const { t } = H();
751
+ const { t } = B();
737
752
  return /* @__PURE__ */ D("div", { style: { marginBottom: 16 }, children: [
738
753
  /* @__PURE__ */ D("div", { style: { display: "grid", gridTemplateColumns: "1fr 2fr", gap: 12, alignItems: "center" }, children: [
739
754
  /* @__PURE__ */ p(
@@ -765,7 +780,7 @@ const sr = l.memo(({ name: e, onChange: r }) => {
765
780
  ] });
766
781
  });
767
782
  sr.displayName = "InstanceName";
768
- class dt extends ne {
783
+ class ft extends ne {
769
784
  registerInCategory(r, t, n) {
770
785
  this.get(r) || this.register(r, {});
771
786
  const a = this.get(r);
@@ -781,15 +796,15 @@ class dt extends ne {
781
796
  return this.list();
782
797
  }
783
798
  }
784
- const cr = new ne(), lr = new dt(), Fe = new ne();
785
- function ft(e, r) {
799
+ const cr = new ne(), lr = new ft(), Fe = new ne();
800
+ function pt(e, r) {
786
801
  cr.register(e, r);
787
802
  }
788
- function pt(e, r, t) {
803
+ function gt(e, r, t) {
789
804
  lr.registerInCategory(e, r, t);
790
805
  }
791
- function gt(e, r) {
792
- if (tn(e)) {
806
+ function ht(e, r) {
807
+ if (an(e)) {
793
808
  console.warn(
794
809
  `[ReactaForm] Can't override builtin type field validation handler for type "${e}".`
795
810
  );
@@ -797,7 +812,7 @@ function gt(e, r) {
797
812
  }
798
813
  Fe.register(e, r);
799
814
  }
800
- function B(e, r) {
815
+ function H(e, r) {
801
816
  Fe.register(e, r);
802
817
  }
803
818
  function ur(e, r) {
@@ -809,7 +824,7 @@ function mr(e) {
809
824
  function dr(e) {
810
825
  return Fe.get(e) || null;
811
826
  }
812
- function ht(e) {
827
+ function bt(e) {
813
828
  return (typeof e == "object" || typeof e == "function") && e !== null && typeof e.then == "function";
814
829
  }
815
830
  const We = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
@@ -839,7 +854,7 @@ function fr(e, r, t, n) {
839
854
  }
840
855
  return null;
841
856
  }
842
- function ca(e, r, t, n) {
857
+ function ua(e, r, t, n) {
843
858
  return fr(e, r, t, n);
844
859
  }
845
860
  function pr(e, r, t, n) {
@@ -852,7 +867,7 @@ function pr(e, r, t, n) {
852
867
  return r.required ? n("Value required") : null;
853
868
  return fr(e, r, t, n);
854
869
  }
855
- async function bt(e, r, t) {
870
+ async function yt(e, r, t) {
856
871
  if (!e || typeof e.validationHandlerName != "string")
857
872
  return null;
858
873
  const n = e.validationHandlerName;
@@ -860,14 +875,14 @@ async function bt(e, r, t) {
860
875
  if (a === void 0 && (a = mr(n) || null, _e.set(n, a)), a)
861
876
  try {
862
877
  const o = a(r, t);
863
- return ht(o) ? await o || null : o || null;
878
+ return bt(o) ? await o || null : o || null;
864
879
  } catch (o) {
865
880
  return [String(o instanceof Error ? o.message : o)];
866
881
  }
867
882
  return null;
868
883
  }
869
884
  function T(e, r) {
870
- const { definitionName: t, t: n, fieldValidationMode: a } = H();
885
+ const { definitionName: t, t: n, fieldValidationMode: a } = B();
871
886
  return l.useCallback(
872
887
  (o) => a === "realTime" ? pr(t, e, o, n) : r ?? null,
873
888
  [t, e, n, a, r]
@@ -880,7 +895,7 @@ const gr = ({
880
895
  onError: n,
881
896
  error: a
882
897
  }) => {
883
- const { t: o } = H(), s = T(e, a)(r);
898
+ const { t: o } = B(), s = T(e, a)(r);
884
899
  l.useEffect(() => {
885
900
  a || n?.(s);
886
901
  }, [s, a, n]);
@@ -941,7 +956,7 @@ const gr = ({
941
956
  ) });
942
957
  };
943
958
  gr.displayName = "CheckboxInput";
944
- const yt = l.memo(gr);
959
+ const vt = l.memo(gr);
945
960
  function _({ value: e, onChange: r, onError: t, validate: n }) {
946
961
  const a = l.useRef(null), o = l.useRef(null), c = l.useRef(t), [s, i] = l.useState(null);
947
962
  l.useEffect(() => {
@@ -977,11 +992,11 @@ const Ke = [
977
992
  { label: "Gray", value: "#808080" },
978
993
  { label: "Light Gray", value: "#d3d3d3" },
979
994
  { label: "Pink", value: "#ffc0cb" }
980
- ], vt = /^#([0-9A-F]{3}){1,2}$/i, xt = "#000000", wt = (e) => vt.test(e), he = (e) => {
981
- if (!e || !wt(e)) return xt;
995
+ ], xt = /^#([0-9A-F]{3}){1,2}$/i, wt = "#000000", St = (e) => xt.test(e), he = (e) => {
996
+ if (!e || !St(e)) return wt;
982
997
  const r = e.toLowerCase();
983
998
  return r.length === 4 ? "#" + r.slice(1).split("").map((t) => t + t).join("") : r;
984
- }, St = (e) => {
999
+ }, Ct = (e) => {
985
1000
  const r = parseInt(e.slice(1), 16);
986
1001
  return {
987
1002
  r: r >> 16 & 255,
@@ -995,7 +1010,7 @@ const Ke = [
995
1010
  onError: n,
996
1011
  error: a
997
1012
  }) => {
998
- const { t: o } = H(), c = T(e, a), s = l.useMemo(
1013
+ const { t: o } = B(), c = T(e, a), s = l.useMemo(
999
1014
  () => he(r),
1000
1015
  [r]
1001
1016
  ), { inputRef: i, error: d, handleChange: m } = _({
@@ -1015,7 +1030,7 @@ const Ke = [
1015
1030
  });
1016
1031
  },
1017
1032
  [m]
1018
- ), N = l.useCallback(
1033
+ ), C = l.useCallback(
1019
1034
  (M) => {
1020
1035
  const $ = he(M.target.value);
1021
1036
  f($), m({
@@ -1027,7 +1042,7 @@ const Ke = [
1027
1042
  () => new Set(Ke.map((M) => M.value)),
1028
1043
  []
1029
1044
  ).has(u), { r: y, g: E, b: F } = l.useMemo(
1030
- () => St(u),
1045
+ () => Ct(u),
1031
1046
  [u]
1032
1047
  );
1033
1048
  return /* @__PURE__ */ p(O, { field: e, error: d, children: /* @__PURE__ */ D(
@@ -1045,7 +1060,7 @@ const Ke = [
1045
1060
  {
1046
1061
  id: e.name,
1047
1062
  value: u,
1048
- onChange: N,
1063
+ onChange: C,
1049
1064
  className: U(
1050
1065
  V.input,
1051
1066
  V.inputSelect
@@ -1097,7 +1112,7 @@ const Ke = [
1097
1112
  ) });
1098
1113
  };
1099
1114
  hr.displayName = "ColorInput";
1100
- const Ct = l.memo(hr), Ge = (e) => {
1115
+ const Nt = l.memo(hr), Ge = (e) => {
1101
1116
  if (!e) return null;
1102
1117
  const r = new Date(e);
1103
1118
  return isNaN(r.getTime()) ? null : r;
@@ -1141,33 +1156,45 @@ const Ct = l.memo(hr), Ge = (e) => {
1141
1156
  ) });
1142
1157
  };
1143
1158
  br.displayName = "DateInput";
1144
- const Nt = l.memo(br), yr = ({
1159
+ const kt = l.memo(br), yr = ({ field: e }) => {
1160
+ const { t: r } = B(), { displayText: t = "", textAlign: n = "left", allowHtml: a = !1 } = e;
1161
+ return /* @__PURE__ */ p(
1162
+ "div",
1163
+ {
1164
+ className: V.description,
1165
+ style: { textAlign: n },
1166
+ ...a ? { dangerouslySetInnerHTML: { __html: r(t) } } : { children: r(t) }
1167
+ }
1168
+ );
1169
+ };
1170
+ yr.displayName = "Description";
1171
+ const It = l.memo(yr), vr = ({
1145
1172
  field: e,
1146
1173
  value: r,
1147
1174
  onChange: t,
1148
1175
  onError: n,
1149
1176
  error: a
1150
1177
  }) => {
1151
- const { t: o, theme: c, formStyle: s, fieldStyle: i } = H(), d = l.useRef(null), m = l.useRef(n), [u, f] = l.useState(!1), [b, N] = l.useState(null);
1178
+ const { t: o, theme: c, formStyle: s, fieldStyle: i } = B(), d = l.useRef(null), m = l.useRef(n), [u, f] = l.useState(!1), [b, C] = l.useState(null);
1152
1179
  l.useEffect(() => {
1153
1180
  m.current = n;
1154
1181
  }, [n]);
1155
- const C = T(e, a), [h, y] = l.useState(null), E = l.useRef(null);
1182
+ const N = T(e, a), [h, y] = l.useState(null), E = l.useRef(null);
1156
1183
  l.useEffect(() => {
1157
1184
  const g = String(r ?? "");
1158
- let w = C(g);
1185
+ let w = N(g);
1159
1186
  if (w && e.options.length > 0) {
1160
1187
  const x = String(e.options[0].value);
1161
1188
  t?.(x), w = null;
1162
1189
  }
1163
1190
  w !== E.current && (E.current = w, y(w), m.current?.(w ?? null));
1164
- }, [r, C, t, e.options]);
1191
+ }, [r, N, t, e.options]);
1165
1192
  const F = () => {
1166
1193
  if (!d.current) return;
1167
1194
  const g = d.current.getBoundingClientRect();
1168
- N({ x: g.left, y: g.bottom }), f((w) => !w);
1195
+ C({ x: g.left, y: g.bottom }), f((w) => !w);
1169
1196
  }, M = (g) => {
1170
- const w = C(g);
1197
+ const w = N(g);
1171
1198
  w !== E.current && (E.current = w, y(w), m.current?.(w ?? null)), t?.(g), f(!1);
1172
1199
  }, $ = l.useMemo(() => {
1173
1200
  const g = e.options.find((w) => String(w.value) === String(r));
@@ -1222,7 +1249,7 @@ const Nt = l.memo(br), yr = ({
1222
1249
  }
1223
1250
  ) }),
1224
1251
  u && b && /* @__PURE__ */ p(
1225
- kt,
1252
+ Et,
1226
1253
  {
1227
1254
  position: b,
1228
1255
  options: e.options,
@@ -1235,7 +1262,7 @@ const Nt = l.memo(br), yr = ({
1235
1262
  }
1236
1263
  )
1237
1264
  ] });
1238
- }, kt = ({
1265
+ }, Et = ({
1239
1266
  position: e,
1240
1267
  options: r,
1241
1268
  selectedValue: t,
@@ -1245,7 +1272,7 @@ const Nt = l.memo(br), yr = ({
1245
1272
  theme: c,
1246
1273
  t: s
1247
1274
  }) => {
1248
- const i = l.useRef(null), [d, m] = l.useState(-1), { formStyle: u, fieldStyle: f } = H(), b = ie(c ?? "light");
1275
+ const i = l.useRef(null), [d, m] = l.useState(-1), { formStyle: u, fieldStyle: f } = B(), b = ie(c ?? "light");
1249
1276
  l.useLayoutEffect(() => {
1250
1277
  if (!o.current) return;
1251
1278
  const v = o.current.closest("[data-reactaform-theme]"), g = document.getElementById("popup-root");
@@ -1263,11 +1290,11 @@ const Nt = l.memo(br), yr = ({
1263
1290
  );
1264
1291
  }
1265
1292
  }, [o]);
1266
- const N = (v, g, w) => {
1293
+ const C = (v, g, w) => {
1267
1294
  if (!g) return {};
1268
1295
  const k = v?.[g];
1269
1296
  return (w && k ? k[w] : void 0) ?? {};
1270
- }, C = l.useMemo(() => ({
1297
+ }, N = l.useMemo(() => ({
1271
1298
  maxHeight: 200,
1272
1299
  overflowY: "auto",
1273
1300
  background: "var(--reactaform-secondary-bg, #fff)",
@@ -1278,8 +1305,8 @@ const Nt = l.memo(br), yr = ({
1278
1305
  pointerEvents: "auto",
1279
1306
  color: "var(--reactaform-text-color, #000)",
1280
1307
  fontSize: "var(--reactaform-popup-font-size, 0.875rem)",
1281
- ...N(u, "dropdown", "popup"),
1282
- ...N(f, void 0, "popup")
1308
+ ...C(u, "dropdown", "popup"),
1309
+ ...C(f, void 0, "popup")
1283
1310
  }), [u, f]), h = l.useMemo(() => ({
1284
1311
  padding: "6px 8px",
1285
1312
  cursor: "pointer",
@@ -1287,8 +1314,8 @@ const Nt = l.memo(br), yr = ({
1287
1314
  alignItems: "center",
1288
1315
  background: "transparent",
1289
1316
  color: "var(--reactaform-text-color, #000)",
1290
- ...N(u, "dropdown", "option"),
1291
- ...N(f, void 0, "option")
1317
+ ...C(u, "dropdown", "option"),
1318
+ ...C(f, void 0, "option")
1292
1319
  }), [u, f]);
1293
1320
  l.useEffect(() => {
1294
1321
  const v = (g) => {
@@ -1338,7 +1365,7 @@ const Nt = l.memo(br), yr = ({
1338
1365
  top: F ? F.top : e.y,
1339
1366
  left: F ? F.left : e.x,
1340
1367
  width: $ ?? y,
1341
- ...C
1368
+ ...N
1342
1369
  },
1343
1370
  "data-reactaform-theme": c ?? "light",
1344
1371
  children: r.map((v, g) => {
@@ -1398,8 +1425,8 @@ const Nt = l.memo(br), yr = ({
1398
1425
  I
1399
1426
  );
1400
1427
  };
1401
- yr.displayName = "DropdownInput";
1402
- const It = l.memo(yr), vr = ({
1428
+ vr.displayName = "DropdownInput";
1429
+ const Mt = l.memo(vr), xr = ({
1403
1430
  field: e,
1404
1431
  value: r,
1405
1432
  onChange: t,
@@ -1426,9 +1453,9 @@ const It = l.memo(yr), vr = ({
1426
1453
  }
1427
1454
  ) });
1428
1455
  };
1429
- vr.displayName = "EmailInput";
1430
- const Et = l.memo(vr), xr = ({ field: e }) => {
1431
- const { theme: r } = H(), {
1456
+ xr.displayName = "EmailInput";
1457
+ const Ft = l.memo(xr), wr = ({ field: e }) => {
1458
+ const { theme: r } = B(), {
1432
1459
  color: t = ie(r) ? "#444444" : "#CCCCCC",
1433
1460
  thickness: n = 1,
1434
1461
  margin: a = "8px 0"
@@ -1446,13 +1473,13 @@ const Et = l.memo(vr), xr = ({ field: e }) => {
1446
1473
  }
1447
1474
  );
1448
1475
  };
1449
- xr.displayName = "FieldSeparator";
1450
- const Mt = l.memo(xr), wr = ({ field: e, value: r, onChange: t, onError: n, error: a }) => {
1451
- const { t: o, theme: c } = H(), [s, i] = l.useState(!1), d = l.useRef(null), m = l.useRef(n), u = l.useRef(null), [f, b] = l.useState(null), N = ie(c);
1476
+ wr.displayName = "FieldSeparator";
1477
+ const $t = l.memo(wr), Sr = ({ field: e, value: r, onChange: t, onError: n, error: a }) => {
1478
+ const { t: o, theme: c } = B(), [s, i] = l.useState(!1), d = l.useRef(null), m = l.useRef(n), u = l.useRef(null), [f, b] = l.useState(null), C = ie(c);
1452
1479
  l.useEffect(() => {
1453
1480
  m.current = n;
1454
1481
  }, [n]);
1455
- const C = (g, w) => w.some(
1482
+ const N = (g, w) => w.some(
1456
1483
  (x) => x.name === g.name && x.size === g.size && x.lastModified === g.lastModified
1457
1484
  ), h = T(e, a);
1458
1485
  l.useEffect(() => {
@@ -1465,7 +1492,7 @@ const Mt = l.memo(xr), wr = ({ field: e, value: r, onChange: t, onError: n, erro
1465
1492
  if (w && w.length > 0) {
1466
1493
  const S = Array.from(w);
1467
1494
  if (e.multiple) {
1468
- const A = Array.isArray(r) ? r : [], j = S.filter((K) => !C(K, A));
1495
+ const A = Array.isArray(r) ? r : [], j = S.filter((K) => !N(K, A));
1469
1496
  x = [...A, ...j];
1470
1497
  } else
1471
1498
  x = S[0];
@@ -1479,7 +1506,7 @@ const Mt = l.memo(xr), wr = ({ field: e, value: r, onChange: t, onError: n, erro
1479
1506
  const x = Array.from(w);
1480
1507
  let k = null;
1481
1508
  if (e.multiple) {
1482
- const A = Array.isArray(r) ? r : [], j = x.filter((K) => !C(K, A));
1509
+ const A = Array.isArray(r) ? r : [], j = x.filter((K) => !N(K, A));
1483
1510
  k = [...A, ...j];
1484
1511
  } else
1485
1512
  k = x[0];
@@ -1584,7 +1611,7 @@ const Mt = l.memo(xr), wr = ({ field: e, value: r, onChange: t, onError: n, erro
1584
1611
  borderRadius: "var(--reactaform-border-radius, 4px)",
1585
1612
  padding: "8px 12px",
1586
1613
  textAlign: "center",
1587
- backgroundColor: s ? `var(--reactaform-bg-hover, ${N ? "#070707" : "#eff6ff"})` : void 0,
1614
+ backgroundColor: s ? `var(--reactaform-bg-hover, ${C ? "#070707" : "#eff6ff"})` : void 0,
1588
1615
  transition: "all 0.2s ease",
1589
1616
  cursor: "pointer",
1590
1617
  minHeight: "var(--reactaform-input-height, 34px)",
@@ -1640,8 +1667,8 @@ const Mt = l.memo(xr), wr = ({ field: e, value: r, onChange: t, onError: n, erro
1640
1667
  R()
1641
1668
  ] }) });
1642
1669
  };
1643
- wr.displayName = "FileInput";
1644
- const Ft = l.memo(wr), Sr = ({
1670
+ Sr.displayName = "FileInput";
1671
+ const Vt = l.memo(Sr), Cr = ({
1645
1672
  field: e,
1646
1673
  value: r,
1647
1674
  onChange: t,
@@ -1669,8 +1696,8 @@ const Ft = l.memo(wr), Sr = ({
1669
1696
  }
1670
1697
  ) });
1671
1698
  };
1672
- Sr.displayName = "FloatArrayInput";
1673
- const $t = l.memo(Sr), Cr = ({
1699
+ Cr.displayName = "FloatArrayInput";
1700
+ const At = l.memo(Cr), Nr = ({
1674
1701
  field: e,
1675
1702
  value: r,
1676
1703
  onChange: t,
@@ -1700,9 +1727,9 @@ const $t = l.memo(Sr), Cr = ({
1700
1727
  }
1701
1728
  ) });
1702
1729
  };
1703
- Cr.displayName = "FloatInput";
1704
- const Vt = l.memo(Cr);
1705
- function At() {
1730
+ Nr.displayName = "FloatInput";
1731
+ const Rt = l.memo(Nr);
1732
+ function Dt() {
1706
1733
  try {
1707
1734
  return "/";
1708
1735
  } catch {
@@ -1714,14 +1741,14 @@ function At() {
1714
1741
  }
1715
1742
  return "/";
1716
1743
  }
1717
- const Nr = ({ field: e, value: r }) => {
1718
- const { language: t, t: n } = H(), a = e.alignment || "center", o = {
1744
+ const kr = ({ field: e, value: r }) => {
1745
+ const { language: t, t: n } = B(), a = e.alignment || "center", o = {
1719
1746
  left: "flex-start",
1720
1747
  center: "center",
1721
1748
  right: "flex-end"
1722
1749
  }, c = typeof r == "string" ? r : "";
1723
1750
  let s = c && c.trim() !== "" ? c : typeof e.defaultValue == "string" ? e.defaultValue : "";
1724
- s && !s.startsWith("/") && (s = `${At()}${s}`);
1751
+ s && !s.startsWith("/") && (s = `${Dt()}${s}`);
1725
1752
  const i = e.localized?.split(";").map((h) => h.trim()), [d, m] = l.useState(s || ""), u = l.useRef(s || null);
1726
1753
  if (l.useEffect(() => {
1727
1754
  if (!s) return;
@@ -1747,13 +1774,13 @@ const Nr = ({ field: e, value: r }) => {
1747
1774
  R.abort();
1748
1775
  };
1749
1776
  }, [s, t, i]), !d) return null;
1750
- const { width: f, height: b } = e, N = {}, C = {
1777
+ const { width: f, height: b } = e, C = {}, N = {
1751
1778
  borderRadius: "8px",
1752
1779
  objectFit: "contain",
1753
1780
  boxShadow: "0 2px 6px rgba(0,0,0,0.1)",
1754
1781
  margin: "0 0 8px 0"
1755
1782
  };
1756
- return f && b ? (N.width = f, N.height = b, C.width = `${f}px`, C.height = `${b}px`) : f && !b ? (N.width = f, C.width = `${f}px`, C.height = "auto") : !f && b && (N.height = b, C.width = "auto", C.height = `${b}px`), /* @__PURE__ */ p(O, { field: e, children: /* @__PURE__ */ p(
1783
+ return f && b ? (C.width = f, C.height = b, N.width = `${f}px`, N.height = `${b}px`) : f && !b ? (C.width = f, N.width = `${f}px`, N.height = "auto") : !f && b && (C.height = b, N.width = "auto", N.height = `${b}px`), /* @__PURE__ */ p(O, { field: e, children: /* @__PURE__ */ p(
1757
1784
  "div",
1758
1785
  {
1759
1786
  "data-testid": "image-wrapper",
@@ -1767,15 +1794,15 @@ const Nr = ({ field: e, value: r }) => {
1767
1794
  {
1768
1795
  src: d,
1769
1796
  alt: n?.(e.displayName || "Image") || e.displayName || "Image",
1770
- ...N,
1771
- style: C
1797
+ ...C,
1798
+ style: N
1772
1799
  }
1773
1800
  )
1774
1801
  }
1775
1802
  ) });
1776
1803
  };
1777
- Nr.displayName = "ImageDisplay";
1778
- const Rt = l.memo(Nr), kr = ({
1804
+ kr.displayName = "ImageDisplay";
1805
+ const zt = l.memo(kr), Ir = ({
1779
1806
  field: e,
1780
1807
  value: r,
1781
1808
  onChange: t,
@@ -1803,8 +1830,8 @@ const Rt = l.memo(Nr), kr = ({
1803
1830
  }
1804
1831
  ) });
1805
1832
  };
1806
- kr.displayName = "IntegerArrayInput";
1807
- const Dt = l.memo(kr), Ir = ({
1833
+ Ir.displayName = "IntegerArrayInput";
1834
+ const Pt = l.memo(Ir), Er = ({
1808
1835
  field: e,
1809
1836
  value: r,
1810
1837
  onChange: t,
@@ -1831,8 +1858,8 @@ const Dt = l.memo(kr), Ir = ({
1831
1858
  }
1832
1859
  ) });
1833
1860
  };
1834
- Ir.displayName = "IntegerInput";
1835
- const Pt = l.memo(Ir), Er = ({
1861
+ Er.displayName = "IntegerInput";
1862
+ const Lt = l.memo(Er), Mr = ({
1836
1863
  field: e,
1837
1864
  value: r,
1838
1865
  onChange: t,
@@ -1864,8 +1891,8 @@ const Pt = l.memo(Ir), Er = ({
1864
1891
  }
1865
1892
  ) });
1866
1893
  };
1867
- Er.displayName = "MultilineTextInput";
1868
- const zt = l.memo(Er), Mr = ({
1894
+ Mr.displayName = "MultilineTextInput";
1895
+ const Ot = l.memo(Mr), Fr = ({
1869
1896
  field: e,
1870
1897
  value: r,
1871
1898
  onChange: t,
@@ -1878,11 +1905,11 @@ const zt = l.memo(Er), Mr = ({
1878
1905
  l.useEffect(() => {
1879
1906
  o.current = n;
1880
1907
  }, [n]);
1881
- const { t: c, theme: s, formStyle: i, fieldStyle: d } = H(), m = (x, k, S) => {
1908
+ const { t: c, theme: s, formStyle: i, fieldStyle: d } = B(), m = (x, k, S) => {
1882
1909
  if (!k) return {};
1883
1910
  const j = x?.[k];
1884
1911
  return (S && j ? j[S] : void 0) ?? {};
1885
- }, u = l.useRef(null), [f, b] = l.useState(!1), [N, C] = l.useState(null), h = l.useMemo(
1912
+ }, u = l.useRef(null), [f, b] = l.useState(!1), [C, N] = l.useState(null), h = l.useMemo(
1886
1913
  () => e.options.map((x) => ({ value: x.value, label: c(x.label) })),
1887
1914
  [e.options, c]
1888
1915
  ), y = l.useMemo(() => {
@@ -1896,7 +1923,7 @@ const zt = l.memo(Er), Mr = ({
1896
1923
  const R = () => {
1897
1924
  if (!u.current) return;
1898
1925
  const x = u.current.getBoundingClientRect();
1899
- C({ x: x.left, y: x.bottom }), b((k) => !k);
1926
+ N({ x: x.left, y: x.bottom }), b((k) => !k);
1900
1927
  }, I = (x) => {
1901
1928
  const k = y.includes(x) ? y.filter((A) => A !== x) : [...y, x], S = E(k);
1902
1929
  S !== $.current && ($.current = S, M(S), o.current?.(S ?? null)), t?.(k);
@@ -1987,10 +2014,10 @@ const zt = l.memo(Er), Mr = ({
1987
2014
  ]
1988
2015
  }
1989
2016
  ) }) }),
1990
- f && N && /* @__PURE__ */ p(
1991
- Lt,
2017
+ f && C && /* @__PURE__ */ p(
2018
+ Tt,
1992
2019
  {
1993
- position: N,
2020
+ position: C,
1994
2021
  options: h,
1995
2022
  selectedValues: y,
1996
2023
  onToggleOption: I,
@@ -2000,7 +2027,7 @@ const zt = l.memo(Er), Mr = ({
2000
2027
  }
2001
2028
  )
2002
2029
  ] });
2003
- }, Lt = ({
2030
+ }, Tt = ({
2004
2031
  position: e,
2005
2032
  options: r,
2006
2033
  selectedValues: t,
@@ -2009,7 +2036,7 @@ const zt = l.memo(Er), Mr = ({
2009
2036
  controlRef: o,
2010
2037
  theme: c
2011
2038
  }) => {
2012
- const s = l.useRef(null), [i, d] = l.useState(-1), { formStyle: m, fieldStyle: u } = H(), f = ie(c ?? "light");
2039
+ const s = l.useRef(null), [i, d] = l.useState(-1), { formStyle: m, fieldStyle: u } = B(), f = ie(c ?? "light");
2013
2040
  l.useLayoutEffect(() => {
2014
2041
  if (!o.current) return;
2015
2042
  const I = o.current.closest("[data-reactaform-theme]"), v = document.getElementById("popup-root");
@@ -2031,7 +2058,7 @@ const zt = l.memo(Er), Mr = ({
2031
2058
  if (!v) return {};
2032
2059
  const x = I?.[v];
2033
2060
  return (g && x ? x[g] : void 0) ?? {};
2034
- }, N = l.useMemo(
2061
+ }, C = l.useMemo(
2035
2062
  () => ({
2036
2063
  maxHeight: 200,
2037
2064
  overflowY: "auto",
@@ -2047,7 +2074,7 @@ const zt = l.memo(Er), Mr = ({
2047
2074
  ...b(u, void 0, "popup")
2048
2075
  }),
2049
2076
  [m, u]
2050
- ), C = l.useMemo(
2077
+ ), N = l.useMemo(
2051
2078
  () => ({
2052
2079
  padding: "6px 8px",
2053
2080
  cursor: "pointer",
@@ -2110,13 +2137,13 @@ const zt = l.memo(Er), Mr = ({
2110
2137
  left: E ? E.left : e.x,
2111
2138
  width: M ?? h,
2112
2139
  // spread the static popup styles
2113
- ...N
2140
+ ...C
2114
2141
  },
2115
2142
  "data-reactaform-theme": c ?? "light",
2116
2143
  children: r.map((I, v) => {
2117
2144
  const g = t.includes(I.value), w = f ? "var(--reactaform-option-menu-hover-bg, rgba(255,255,255,0.01))" : "var(--reactaform-option-menu-hover-bg, #eee)", x = {
2118
- ...C,
2119
- background: v === i ? w : C.background
2145
+ ...N,
2146
+ background: v === i ? w : N.background
2120
2147
  };
2121
2148
  return /* @__PURE__ */ D(
2122
2149
  "div",
@@ -2187,8 +2214,8 @@ const zt = l.memo(Er), Mr = ({
2187
2214
  R
2188
2215
  );
2189
2216
  };
2190
- Mr.displayName = "MultiSelect";
2191
- const Ot = l.memo(Mr), Fr = ({
2217
+ Fr.displayName = "MultiSelect";
2218
+ const jt = l.memo(Fr), $r = ({
2192
2219
  field: e,
2193
2220
  value: r,
2194
2221
  onChange: t,
@@ -2222,8 +2249,8 @@ const Ot = l.memo(Mr), Fr = ({
2222
2249
  }
2223
2250
  ) });
2224
2251
  };
2225
- Fr.displayName = "NumericStepperInput";
2226
- const Tt = l.memo(Fr), $r = ({
2252
+ $r.displayName = "NumericStepperInput";
2253
+ const Bt = l.memo($r), Vr = ({
2227
2254
  field: e,
2228
2255
  value: r,
2229
2256
  onChange: t,
@@ -2250,15 +2277,15 @@ const Tt = l.memo(Fr), $r = ({
2250
2277
  }
2251
2278
  ) });
2252
2279
  };
2253
- $r.displayName = "PhoneInput";
2254
- const jt = l.memo($r), Vr = ({
2280
+ Vr.displayName = "PhoneInput";
2281
+ const Ht = l.memo(Vr), Ar = ({
2255
2282
  field: e,
2256
2283
  value: r,
2257
2284
  onChange: t,
2258
2285
  onError: n,
2259
2286
  error: a
2260
2287
  }) => {
2261
- const { t: o } = H(), c = T(e, a), s = e.layout?.toLowerCase() === "horizontal" ? "row" : "column", i = l.useRef(n);
2288
+ const { t: o } = B(), c = T(e, a), s = e.layout?.toLowerCase() === "horizontal" ? "row" : "column", i = l.useRef(n);
2262
2289
  l.useEffect(() => {
2263
2290
  i.current = n;
2264
2291
  }, [n]);
@@ -2279,7 +2306,7 @@ const jt = l.memo($r), Vr = ({
2279
2306
  const b = (h) => {
2280
2307
  const y = h.target.value, E = c(y);
2281
2308
  f(E), t?.(y);
2282
- }, N = {
2309
+ }, C = {
2283
2310
  display: "flex",
2284
2311
  flexDirection: s,
2285
2312
  flexWrap: s === "row" ? "wrap" : "nowrap",
@@ -2288,7 +2315,7 @@ const jt = l.memo($r), Vr = ({
2288
2315
  width: "100%",
2289
2316
  padding: s === "row" ? "8px" : void 0,
2290
2317
  boxSizing: "border-box"
2291
- }, C = {
2318
+ }, N = {
2292
2319
  display: s === "column" ? "flex" : "inline-flex",
2293
2320
  gap: "8px",
2294
2321
  alignItems: "center",
@@ -2304,14 +2331,14 @@ const jt = l.memo($r), Vr = ({
2304
2331
  className: V.input,
2305
2332
  "aria-labelledby": `${e.name}-label`,
2306
2333
  "aria-invalid": !!d,
2307
- style: N,
2334
+ style: C,
2308
2335
  children: e.options.map((h) => {
2309
2336
  const y = String(h.value), E = `${e.name}-${y}`;
2310
2337
  return /* @__PURE__ */ D(
2311
2338
  "label",
2312
2339
  {
2313
2340
  className: U(V.label),
2314
- style: C,
2341
+ style: N,
2315
2342
  onMouseDown: (F) => F.preventDefault(),
2316
2343
  onClick: () => {
2317
2344
  String(r ?? "") !== y && b({ target: { value: y } });
@@ -2349,11 +2376,11 @@ const jt = l.memo($r), Vr = ({
2349
2376
  }
2350
2377
  ) });
2351
2378
  };
2352
- Vr.displayName = "RadioInput";
2353
- const Bt = l.memo(Vr), Ht = {
2379
+ Ar.displayName = "RadioInput";
2380
+ const qt = l.memo(Ar), Ut = {
2354
2381
  display: "flex",
2355
2382
  gap: 4
2356
- }, qt = {
2383
+ }, Wt = {
2357
2384
  cursor: "pointer",
2358
2385
  fontSize: "1.5rem",
2359
2386
  lineHeight: 1,
@@ -2361,23 +2388,23 @@ const Bt = l.memo(Vr), Ht = {
2361
2388
  marginRight: "0.25rem",
2362
2389
  userSelect: "none",
2363
2390
  transition: "color 0.12s ease"
2364
- }, Ar = ({ field: e, value: r, onChange: t, onError: n, error: a }) => {
2365
- const { t: o } = H(), c = T(e, a), s = e.max ?? 5, i = e.icon?.trim() || "★", [d, m] = l.useState(null), u = l.useRef([]), f = l.useMemo(() => Math.min(Math.max(r ?? 0, 0), s), [r, s]), b = l.useMemo(() => c(f) ?? null, [c, f]);
2391
+ }, Rr = ({ field: e, value: r, onChange: t, onError: n, error: a }) => {
2392
+ const { t: o } = B(), c = T(e, a), s = e.max ?? 5, i = e.icon?.trim() || "★", [d, m] = l.useState(null), u = l.useRef([]), f = l.useMemo(() => Math.min(Math.max(r ?? 0, 0), s), [r, s]), b = l.useMemo(() => c(f) ?? null, [c, f]);
2366
2393
  l.useEffect(() => {
2367
2394
  n?.(b);
2368
2395
  }, [b, n]);
2369
- const N = l.useCallback(
2396
+ const C = l.useCallback(
2370
2397
  (h) => {
2371
2398
  const y = Math.min(Math.max(h, 0), s);
2372
2399
  t?.(y);
2373
2400
  },
2374
2401
  [s, t]
2375
- ), C = l.useCallback(
2402
+ ), N = l.useCallback(
2376
2403
  (h, y) => {
2377
2404
  switch (h.key) {
2378
2405
  case "Enter":
2379
2406
  case " ":
2380
- h.preventDefault(), N(y + 1);
2407
+ h.preventDefault(), C(y + 1);
2381
2408
  break;
2382
2409
  case "ArrowRight":
2383
2410
  case "ArrowUp":
@@ -2389,7 +2416,7 @@ const Bt = l.memo(Vr), Ht = {
2389
2416
  break;
2390
2417
  }
2391
2418
  },
2392
- [s, N]
2419
+ [s, C]
2393
2420
  );
2394
2421
  return /* @__PURE__ */ p(O, { field: e, error: b, children: /* @__PURE__ */ p(
2395
2422
  "div",
@@ -2398,7 +2425,7 @@ const Bt = l.memo(Vr), Ht = {
2398
2425
  "aria-labelledby": `${e.name}-label`,
2399
2426
  "aria-invalid": !!b,
2400
2427
  "aria-describedby": b ? `${e.name}-error` : void 0,
2401
- style: Ht,
2428
+ style: Ut,
2402
2429
  children: Array.from({ length: s }, (h, y) => {
2403
2430
  const E = y < f, M = d !== null && y <= d || E ? "gold" : "lightgray";
2404
2431
  return /* @__PURE__ */ p(
@@ -2410,11 +2437,11 @@ const Bt = l.memo(Vr), Ht = {
2410
2437
  "aria-checked": E,
2411
2438
  "aria-label": `Rating ${y + 1}`,
2412
2439
  title: o(`${e.displayName} ${y + 1}`),
2413
- onClick: () => N(y + 1),
2414
- onKeyDown: ($) => C($, y),
2440
+ onClick: () => C(y + 1),
2441
+ onKeyDown: ($) => N($, y),
2415
2442
  onMouseEnter: () => m(y),
2416
2443
  onMouseLeave: () => m(null),
2417
- style: { ...qt, color: M },
2444
+ style: { ...Wt, color: M },
2418
2445
  children: i
2419
2446
  },
2420
2447
  y
@@ -2423,15 +2450,15 @@ const Bt = l.memo(Vr), Ht = {
2423
2450
  }
2424
2451
  ) });
2425
2452
  };
2426
- Ar.displayName = "RatingInput";
2427
- const Ut = l.memo(Ar), Rr = ({
2453
+ Rr.displayName = "RatingInput";
2454
+ const _t = l.memo(Rr), Dr = ({
2428
2455
  field: e,
2429
2456
  value: r,
2430
2457
  onChange: t,
2431
2458
  onError: n,
2432
2459
  error: a
2433
2460
  }) => {
2434
- const { t: o } = H(), c = T(e, a), { inputRef: s, error: i, handleChange: d } = _({
2461
+ const { t: o } = B(), c = T(e, a), { inputRef: s, error: i, handleChange: d } = _({
2435
2462
  value: r,
2436
2463
  onChange: t,
2437
2464
  onError: n,
@@ -2472,8 +2499,8 @@ const Ut = l.memo(Ar), Rr = ({
2472
2499
  )
2473
2500
  ] }) });
2474
2501
  };
2475
- Rr.displayName = "PasswordInput";
2476
- const Wt = l.memo(Rr), Dr = ({ field: e, value: r, onChange: t, onError: n, error: a }) => {
2502
+ Dr.displayName = "PasswordInput";
2503
+ const Kt = l.memo(Dr), zr = ({ field: e, value: r, onChange: t, onError: n, error: a }) => {
2477
2504
  const o = T(e, a), c = e.min ?? 0, s = e.max ?? 100, [i, d] = l.useState(
2478
2505
  () => isNaN(Number(r)) ? String(c) : String(Number(r))
2479
2506
  );
@@ -2487,8 +2514,8 @@ const Wt = l.memo(Rr), Dr = ({ field: e, value: r, onChange: t, onError: n, erro
2487
2514
  }, [m, n]);
2488
2515
  const u = l.useCallback(
2489
2516
  (b) => {
2490
- const N = b.target.value;
2491
- d(N), t?.(N);
2517
+ const C = b.target.value;
2518
+ d(C), t?.(C);
2492
2519
  },
2493
2520
  [t]
2494
2521
  ), f = isNaN(Number(i)) ? String(c) : String(Number(i));
@@ -2534,15 +2561,15 @@ const Wt = l.memo(Rr), Dr = ({ field: e, value: r, onChange: t, onError: n, erro
2534
2561
  )
2535
2562
  ] }) });
2536
2563
  };
2537
- Dr.displayName = "SliderInput";
2538
- const _t = l.memo(Dr), Pr = ({
2564
+ zr.displayName = "SliderInput";
2565
+ const Gt = l.memo(zr), Pr = ({
2539
2566
  field: e,
2540
2567
  value: r,
2541
2568
  onChange: t,
2542
2569
  onError: n,
2543
2570
  error: a
2544
2571
  }) => {
2545
- const { t: o, formStyle: c, fieldStyle: s } = H(), d = T(e, a)(r);
2572
+ const { t: o, formStyle: c, fieldStyle: s } = B(), d = T(e, a)(r);
2546
2573
  l.useEffect(() => {
2547
2574
  n?.(d);
2548
2575
  }, [d, n]);
@@ -2557,7 +2584,7 @@ const _t = l.memo(Dr), Pr = ({
2557
2584
  height: 24,
2558
2585
  ...f(m, "switch", "label"),
2559
2586
  ...f(u, void 0, "label")
2560
- }), [m, u]), N = l.useMemo(() => ({
2587
+ }), [m, u]), C = l.useMemo(() => ({
2561
2588
  position: "absolute",
2562
2589
  opacity: 0,
2563
2590
  top: 0,
@@ -2570,7 +2597,7 @@ const _t = l.memo(Dr), Pr = ({
2570
2597
  // Make hidden input non-interactive to avoid event conflicts
2571
2598
  ...f(m, "switch", "hiddenInput"),
2572
2599
  ...f(u, void 0, "hiddenInput")
2573
- }), [m, u]), C = l.useMemo(() => ({
2600
+ }), [m, u]), N = l.useMemo(() => ({
2574
2601
  position: "absolute",
2575
2602
  cursor: "pointer",
2576
2603
  top: 0,
@@ -2625,7 +2652,7 @@ const _t = l.memo(Dr), Pr = ({
2625
2652
  "aria-label": o(e.displayName),
2626
2653
  "aria-invalid": !1,
2627
2654
  "aria-describedby": void 0,
2628
- style: N,
2655
+ style: C,
2629
2656
  tabIndex: -1
2630
2657
  }
2631
2658
  ),
@@ -2643,7 +2670,7 @@ const _t = l.memo(Dr), Pr = ({
2643
2670
  (F.key === " " || F.key === "Spacebar" || F.key === "Space" || F.key === "Enter") && (F.preventDefault(), E());
2644
2671
  },
2645
2672
  className: `reactaform-switch ${y ? "active checked on" : ""} `,
2646
- style: y ? { ...C, backgroundColor: "var(--reactaform-switch-on-bg, #22c55e)", borderColor: "var(--reactaform-switch-on-border, #16a34a)" } : C,
2673
+ style: y ? { ...N, backgroundColor: "var(--reactaform-switch-on-bg, #22c55e)", borderColor: "var(--reactaform-switch-on-border, #16a34a)" } : N,
2647
2674
  children: /* @__PURE__ */ p(
2648
2675
  "span",
2649
2676
  {
@@ -2659,7 +2686,7 @@ const _t = l.memo(Dr), Pr = ({
2659
2686
  ] }) });
2660
2687
  };
2661
2688
  Pr.displayName = "SwitchInput";
2662
- const Kt = l.memo(Pr), xe = ({
2689
+ const Jt = l.memo(Pr), xe = ({
2663
2690
  field: e,
2664
2691
  value: r,
2665
2692
  onChange: t,
@@ -2688,7 +2715,7 @@ const Kt = l.memo(Pr), xe = ({
2688
2715
  ) });
2689
2716
  };
2690
2717
  xe.displayName = "TextInput";
2691
- const zr = ({
2718
+ const Lr = ({
2692
2719
  field: e,
2693
2720
  value: r,
2694
2721
  onChange: t,
@@ -2718,9 +2745,9 @@ const zr = ({
2718
2745
  }
2719
2746
  ) });
2720
2747
  };
2721
- zr.displayName = "TimeInput";
2722
- const Gt = l.memo(zr);
2723
- function Jt({
2748
+ Lr.displayName = "TimeInput";
2749
+ const Yt = l.memo(Lr);
2750
+ function Xt({
2724
2751
  pos: e,
2725
2752
  options: r,
2726
2753
  onClose: t,
@@ -2916,12 +2943,12 @@ const $e = {
2916
2943
  rad: Math.PI / 180,
2917
2944
  rev: 1 / 360
2918
2945
  }
2919
- }, Re = {}, Yt = /* @__PURE__ */ new Set([
2946
+ }, Re = {}, Zt = /* @__PURE__ */ new Set([
2920
2947
  ...Object.keys($e),
2921
2948
  ...Object.keys(Ve),
2922
2949
  ...Object.keys(Ae)
2923
2950
  ]);
2924
- for (const e of Yt) {
2951
+ for (const e of Zt) {
2925
2952
  const r = {}, t = $e[e] ?? [], n = Ve[e] ?? {}, a = Ae[e] ?? {};
2926
2953
  for (const o of t) {
2927
2954
  const c = n[o];
@@ -2940,7 +2967,7 @@ for (const e of Yt) {
2940
2967
  r[o] || (r[o] = { name: String(o), shortName: String(o), factor: c });
2941
2968
  Re[e] = r;
2942
2969
  }
2943
- function Lr(e, r, t) {
2970
+ function Or(e, r, t) {
2944
2971
  if (e === "C") {
2945
2972
  if (r === "F") return t * (9 / 5) + 32;
2946
2973
  if (r === "K") return t + 273.15;
@@ -2953,7 +2980,7 @@ function Lr(e, r, t) {
2953
2980
  }
2954
2981
  return t;
2955
2982
  }
2956
- function Or(e) {
2983
+ function Tr(e) {
2957
2984
  const r = Re[e];
2958
2985
  if (!r) return null;
2959
2986
  const t = {}, n = [];
@@ -2965,15 +2992,15 @@ function Or(e) {
2965
2992
  factors: t
2966
2993
  };
2967
2994
  }
2968
- const la = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2995
+ const ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2969
2996
  __proto__: null,
2970
- convertTemperature: Lr,
2997
+ convertTemperature: Or,
2971
2998
  dimensionUnitDisplayMap: Ve,
2972
2999
  dimensionUnitsMap: $e,
2973
3000
  dimensonUnitFactorsMap: Ae,
2974
- getUnitFactors: Or,
3001
+ getUnitFactors: Tr,
2975
3002
  unitsByDimension: Re
2976
- }, Symbol.toStringTag, { value: "Module" })), Tr = l.memo(({
3003
+ }, Symbol.toStringTag, { value: "Module" })), jr = l.memo(({
2977
3004
  disabled: e,
2978
3005
  inputValue: r,
2979
3006
  selectedUnit: t,
@@ -2992,7 +3019,7 @@ const la = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2992
3019
  const F = [];
2993
3020
  if (n === "temperature")
2994
3021
  a.units.forEach(($) => {
2995
- const R = Lr(t, $, y);
3022
+ const R = Or(t, $, y);
2996
3023
  Number.isFinite(R) && F.push({
2997
3024
  label: `${R.toFixed(6)} ${c($)}`,
2998
3025
  value: R.toString(),
@@ -3013,12 +3040,12 @@ const la = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3013
3040
  f(F), i(F.length > 0);
3014
3041
  },
3015
3042
  [e, r, t, n, a, c]
3016
- ), N = l.useCallback(
3043
+ ), C = l.useCallback(
3017
3044
  (h) => {
3018
3045
  i(!1), m(null), o(h);
3019
3046
  },
3020
3047
  [o]
3021
- ), C = l.useCallback(() => {
3048
+ ), N = l.useCallback(() => {
3022
3049
  i(!1), m(null);
3023
3050
  }, []);
3024
3051
  return /* @__PURE__ */ D(Ie, { children: [
@@ -3049,29 +3076,29 @@ const la = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3049
3076
  }
3050
3077
  ),
3051
3078
  s && u.length > 0 && /* @__PURE__ */ p(
3052
- Jt,
3079
+ Xt,
3053
3080
  {
3054
3081
  pos: d,
3055
3082
  options: u,
3056
- onClose: C,
3057
- onClickOption: N
3083
+ onClose: N,
3084
+ onClickOption: C
3058
3085
  }
3059
3086
  )
3060
3087
  ] });
3061
3088
  });
3062
- Tr.displayName = "ConversionButton";
3063
- const jr = ({ field: e, value: r, onChange: t, onError: n }) => {
3064
- const { t: a } = H(), o = T(e), c = e.dimension, s = l.useMemo(() => c ? Or(c) : null, [c]), i = String(r?.[0] ?? ""), d = String(r?.[1] ?? s?.default ?? ""), [m, u] = l.useState(i), [f, b] = l.useState(d);
3089
+ jr.displayName = "ConversionButton";
3090
+ const Br = ({ field: e, value: r, onChange: t, onError: n }) => {
3091
+ const { t: a } = B(), o = T(e), c = e.dimension, s = l.useMemo(() => c ? Tr(c) : null, [c]), i = String(r?.[0] ?? ""), d = String(r?.[1] ?? s?.default ?? ""), [m, u] = l.useState(i), [f, b] = l.useState(d);
3065
3092
  l.useEffect(() => {
3066
3093
  u(i);
3067
3094
  }, [i]), l.useEffect(() => {
3068
3095
  b(d);
3069
3096
  }, [d]);
3070
- const N = o([m, f]);
3097
+ const C = o([m, f]);
3071
3098
  l.useEffect(() => {
3072
- n?.(N);
3073
- }, [N, n]);
3074
- const C = l.useCallback(
3099
+ n?.(C);
3100
+ }, [C, n]);
3101
+ const N = l.useCallback(
3075
3102
  (M) => {
3076
3103
  const $ = M.target.value;
3077
3104
  u($), o([$, f]), t?.([$, f]);
@@ -3093,19 +3120,19 @@ const jr = ({ field: e, value: r, onChange: t, onError: n }) => {
3093
3120
  [s, a]
3094
3121
  );
3095
3122
  if (!c || !s) return null;
3096
- const F = !!N || !m.trim();
3097
- return /* @__PURE__ */ p(O, { field: e, error: N, children: /* @__PURE__ */ D("div", { style: { display: "flex", alignItems: "center", gap: "var(--reactaform-unit-gap, 8px)", width: "100%" }, children: [
3123
+ const F = !!C || !m.trim();
3124
+ return /* @__PURE__ */ p(O, { field: e, error: C, children: /* @__PURE__ */ D("div", { style: { display: "flex", alignItems: "center", gap: "var(--reactaform-unit-gap, 8px)", width: "100%" }, children: [
3098
3125
  /* @__PURE__ */ p(
3099
3126
  "input",
3100
3127
  {
3101
3128
  id: e.name,
3102
3129
  type: "text",
3103
3130
  value: m,
3104
- onChange: C,
3131
+ onChange: N,
3105
3132
  style: { flex: "2 1 0" },
3106
3133
  className: U(V.input, V.textInput),
3107
- "aria-invalid": !!N,
3108
- "aria-describedby": N ? `${e.name}-error` : void 0
3134
+ "aria-invalid": !!C,
3135
+ "aria-describedby": C ? `${e.name}-error` : void 0
3109
3136
  }
3110
3137
  ),
3111
3138
  /* @__PURE__ */ p(
@@ -3116,13 +3143,13 @@ const jr = ({ field: e, value: r, onChange: t, onError: n }) => {
3116
3143
  onChange: h,
3117
3144
  style: { flex: "1 1 0" },
3118
3145
  className: U(V.input, V.inputSelect),
3119
- "aria-invalid": !!N,
3120
- "aria-describedby": N ? `${e.name}-error` : void 0,
3146
+ "aria-invalid": !!C,
3147
+ "aria-describedby": C ? `${e.name}-error` : void 0,
3121
3148
  children: E
3122
3149
  }
3123
3150
  ),
3124
3151
  /* @__PURE__ */ p(
3125
- Tr,
3152
+ jr,
3126
3153
  {
3127
3154
  disabled: F,
3128
3155
  inputValue: m,
@@ -3135,8 +3162,8 @@ const jr = ({ field: e, value: r, onChange: t, onError: n }) => {
3135
3162
  )
3136
3163
  ] }) });
3137
3164
  };
3138
- jr.displayName = "UnitValueInput";
3139
- const Xt = l.memo(jr), Br = ({
3165
+ Br.displayName = "UnitValueInput";
3166
+ const Qt = l.memo(Br), Hr = ({
3140
3167
  field: e,
3141
3168
  value: r,
3142
3169
  onChange: t,
@@ -3164,57 +3191,54 @@ const Xt = l.memo(jr), Br = ({
3164
3191
  }
3165
3192
  ) });
3166
3193
  };
3167
- Br.displayName = "UrlInput";
3168
- const Zt = l.memo(Br), se = new ne();
3169
- function ua(e, r) {
3194
+ Hr.displayName = "UrlInput";
3195
+ const en = l.memo(Hr), se = new ne();
3196
+ function da(e, r) {
3170
3197
  se.register(e, r);
3171
3198
  }
3172
- function Qt(e) {
3199
+ function rn(e) {
3173
3200
  return se.get(e);
3174
3201
  }
3175
- function ma(e) {
3202
+ function fa(e) {
3176
3203
  return se.has(e);
3177
3204
  }
3178
- function da(e) {
3205
+ function pa(e) {
3179
3206
  return se.unregister(e);
3180
3207
  }
3181
- function fa() {
3208
+ function ga() {
3182
3209
  return se.list();
3183
3210
  }
3184
- const Hr = ({
3211
+ const qr = ({
3185
3212
  field: e,
3186
3213
  valuesMap: r,
3187
3214
  handleChange: t,
3188
3215
  handleError: n
3189
3216
  }) => {
3190
- const { t: a } = H(), [o, c] = l.useState(!1), [s, i] = l.useState(null), d = l.useCallback(async () => {
3217
+ const { t: a } = B(), [o, c] = l.useState(!1), [s, i] = l.useState(null), d = l.useCallback(async () => {
3191
3218
  if (!e.action) {
3192
3219
  console.warn(`Button "${e.name}" has no action defined`);
3193
3220
  return;
3194
3221
  }
3195
- const u = Qt(e.action);
3196
- if (!u) {
3197
- const f = `Button handler "${e.action}" not found`;
3198
- console.error(f), i(f);
3222
+ const f = rn(e.action);
3223
+ if (!f) {
3224
+ const b = `Button handler "${e.action}" not found`;
3225
+ console.error(b), i(b);
3199
3226
  return;
3200
3227
  }
3201
3228
  c(!0), i(null);
3202
3229
  try {
3203
- await u(r, t, n, a);
3204
- } catch (f) {
3205
- const b = f instanceof Error ? f.message : String(f);
3206
- console.error(`Button handler "${e.action}" failed:`, b), i(b);
3230
+ await f(r, t, n, a);
3231
+ } catch (b) {
3232
+ const C = b instanceof Error ? b.message : String(b);
3233
+ console.error(`Button handler "${e.action}" failed:`, C), i(C);
3207
3234
  } finally {
3208
3235
  c(!1);
3209
3236
  }
3210
- }, [e, r, t, n, a]), m = {
3211
- padding: "8px 16px",
3237
+ }, [e, r, t, n, a]), u = { ...{
3212
3238
  cursor: o ? "wait" : "pointer",
3213
- opacity: o ? 0.6 : 1,
3214
- width: "100%",
3215
- minHeight: "var(--reactaform-input-height, 34px)"
3216
- };
3217
- return /* @__PURE__ */ p(O, { field: e, rightAlign: !1, error: s, children: /* @__PURE__ */ p(
3239
+ opacity: o ? 0.6 : 1
3240
+ } };
3241
+ return e.width && typeof e.width == "number" && e.width > 0 && (u.width = `${e.width}px`), /* @__PURE__ */ p(O, { field: e, rightAlign: !0, error: s, children: /* @__PURE__ */ p(
3218
3242
  "button",
3219
3243
  {
3220
3244
  type: "button",
@@ -3223,19 +3247,13 @@ const Hr = ({
3223
3247
  disabled: o,
3224
3248
  "aria-label": a(e.displayName),
3225
3249
  "aria-busy": o,
3226
- style: m,
3227
- onMouseEnter: (u) => {
3228
- o || (u.currentTarget.style.backgroundColor = "var(--reactaform-button-bg-hover, var(--reactaform-success-color-hover, #0056b3))");
3229
- },
3230
- onMouseLeave: (u) => {
3231
- o || (u.currentTarget.style.backgroundColor = "var(--reactaform-button-bg, var(--reactaform-success-color, #4CAF50))");
3232
- },
3250
+ style: u,
3233
3251
  children: a(o ? "Processing..." : e.displayName)
3234
3252
  }
3235
3253
  ) });
3236
3254
  };
3237
- Hr.displayName = "Button";
3238
- const en = l.memo(Hr), rn = {
3255
+ qr.displayName = "Button";
3256
+ const tn = l.memo(qr), nn = {
3239
3257
  // No debounce
3240
3258
  checkbox: !1,
3241
3259
  switch: !1,
@@ -3247,6 +3265,7 @@ const en = l.memo(Hr), rn = {
3247
3265
  file: !1,
3248
3266
  image: !1,
3249
3267
  separator: !1,
3268
+ description: !1,
3250
3269
  button: !1,
3251
3270
  // Buttons don't need debouncing
3252
3271
  // Standard text inputs
@@ -3267,44 +3286,45 @@ const en = l.memo(Hr), rn = {
3267
3286
  slider: { wait: 100, leading: !0, trailing: !0 },
3268
3287
  stepper: { wait: 100, leading: !0, trailing: !0 }
3269
3288
  }, me = new ne(), De = {
3270
- button: en,
3271
- checkbox: yt,
3272
- color: Ct,
3273
- date: Nt,
3274
- dropdown: It,
3275
- email: Et,
3276
- file: Ft,
3277
- float: Vt,
3278
- "float-array": $t,
3279
- image: Rt,
3280
- int: Pt,
3281
- "int-array": Dt,
3282
- "multi-selection": Ot,
3283
- multiline: zt,
3284
- password: Wt,
3285
- phone: jt,
3286
- radio: Bt,
3287
- rating: Ut,
3288
- separator: Mt,
3289
- slider: _t,
3289
+ button: tn,
3290
+ checkbox: vt,
3291
+ color: Nt,
3292
+ date: kt,
3293
+ description: It,
3294
+ dropdown: Mt,
3295
+ email: Ft,
3296
+ file: Vt,
3297
+ float: Rt,
3298
+ "float-array": At,
3299
+ image: zt,
3300
+ int: Lt,
3301
+ "int-array": Pt,
3302
+ "multi-selection": jt,
3303
+ multiline: Ot,
3304
+ password: Kt,
3305
+ phone: Ht,
3306
+ radio: qt,
3307
+ rating: _t,
3308
+ separator: $t,
3309
+ slider: Gt,
3290
3310
  string: xe,
3291
- stepper: Tt,
3292
- switch: Kt,
3311
+ stepper: Bt,
3312
+ switch: Jt,
3293
3313
  text: xe,
3294
- time: Gt,
3295
- unit: Xt,
3296
- url: Zt
3314
+ time: Yt,
3315
+ unit: Qt,
3316
+ url: en
3297
3317
  };
3298
- function tn(e) {
3318
+ function an(e) {
3299
3319
  return e in De;
3300
3320
  }
3301
- function nn(e, r) {
3321
+ function on(e, r) {
3302
3322
  const { wait: t = 200, leading: n, trailing: a } = r, o = l.memo((c) => {
3303
3323
  const s = l.useRef(c.onChange);
3304
3324
  l.useEffect(() => {
3305
3325
  s.current = c.onChange;
3306
3326
  }, [c.onChange]);
3307
- const { callback: i, cancel: d } = ct(
3327
+ const { callback: i, cancel: d } = lt(
3308
3328
  (...m) => {
3309
3329
  s.current?.(...m);
3310
3330
  },
@@ -3318,13 +3338,13 @@ function nn(e, r) {
3318
3338
  });
3319
3339
  return o.displayName = "DebouncedFieldWrapper", o;
3320
3340
  }
3321
- function qr(e, r, t) {
3341
+ function Ur(e, r, t) {
3322
3342
  const n = r;
3323
3343
  if (!t && e in De) {
3324
3344
  console.warn(`Can't overwrite base component type "${e}".`);
3325
3345
  return;
3326
3346
  }
3327
- const a = rn[e];
3347
+ const a = nn[e];
3328
3348
  if (a === !1) {
3329
3349
  me.register(e, n);
3330
3350
  return;
@@ -3332,24 +3352,24 @@ function qr(e, r, t) {
3332
3352
  const o = a ?? { wait: 200 };
3333
3353
  ar ? me.register(e, n) : me.register(
3334
3354
  e,
3335
- nn(n, o)
3355
+ on(n, o)
3336
3356
  );
3337
3357
  }
3338
- function Ur(e, r) {
3339
- qr(e, r, !1);
3358
+ function Wr(e, r) {
3359
+ Ur(e, r, !1);
3340
3360
  }
3341
- function Wr(e) {
3361
+ function _r(e) {
3342
3362
  return me.get(e);
3343
3363
  }
3344
3364
  let Ye = !1;
3345
- function an() {
3365
+ function sn() {
3346
3366
  Ye || (Object.entries(De).forEach(([e, r]) => {
3347
- qr(e, r, !0);
3367
+ Ur(e, r, !0);
3348
3368
  }), Ye = !0);
3349
3369
  }
3350
- const Pe = l.memo(
3370
+ const ze = l.memo(
3351
3371
  ({ field: e, valuesMap: r, handleChange: t, handleError: n, errorsMap: a }) => {
3352
- const o = Wr(e.type), c = r[e.name], s = a ? a[e.name] ?? null : void 0, i = l.useMemo(() => c, [c]), d = l.useCallback(
3372
+ const o = _r(e.type), c = r[e.name], s = a ? a[e.name] ?? null : void 0, i = l.useMemo(() => c, [c]), d = l.useCallback(
3353
3373
  (u) => t(e.name, u),
3354
3374
  [t, e.name]
3355
3375
  ), m = l.useCallback(
@@ -3376,8 +3396,8 @@ const Pe = l.memo(
3376
3396
  },
3377
3397
  (e, r) => e.field === r.field && e.valuesMap[e.field.name] === r.valuesMap[r.field.name] && e.handleChange === r.handleChange && e.handleError === r.handleError && e.errorsMap?.[e.field.name] === r.errorsMap?.[r.field.name]
3378
3398
  );
3379
- Pe.displayName = "FieldRenderer";
3380
- const _r = l.memo(
3399
+ ze.displayName = "FieldRenderer";
3400
+ const Kr = l.memo(
3381
3401
  ({ groupName: e, defaultOpen: r = !0, fields: t, valuesMap: n, handleChange: a, handleError: o, errorsMap: c, t: s }) => {
3382
3402
  const [i, d] = l.useState(r), m = l.useCallback(() => d((u) => !u), []);
3383
3403
  return /* @__PURE__ */ D("fieldset", { className: "reactaform-group", children: [
@@ -3386,7 +3406,7 @@ const _r = l.memo(
3386
3406
  /* @__PURE__ */ p("span", { className: "reactaform-group_legend_arrow", children: i ? "▼" : "▶" })
3387
3407
  ] }),
3388
3408
  i && t.map((u) => /* @__PURE__ */ p(
3389
- Pe,
3409
+ ze,
3390
3410
  {
3391
3411
  field: u,
3392
3412
  valuesMap: n,
@@ -3399,35 +3419,35 @@ const _r = l.memo(
3399
3419
  ] });
3400
3420
  }
3401
3421
  );
3402
- _r.displayName = "FieldGroup";
3403
- const ze = (e, r, t, n) => {
3422
+ Kr.displayName = "FieldGroup";
3423
+ const Pe = (e, r, t, n) => {
3404
3424
  const a = r[e];
3405
3425
  if (!a?.children) return;
3406
3426
  const o = t[e], c = o != null ? String(o) : "", s = a.children[c];
3407
3427
  if (Array.isArray(s))
3408
3428
  for (const i of s)
3409
- typeof i == "string" && r[i] && (n[i] = !0, ze(i, r, t, n));
3410
- }, Kr = (e, r, t) => {
3429
+ typeof i == "string" && r[i] && (n[i] = !0, Pe(i, r, t, n));
3430
+ }, Gr = (e, r, t) => {
3411
3431
  const n = r[e];
3412
3432
  if (!n?.children) return;
3413
3433
  const a = Object.values(n.children).flat();
3414
3434
  for (const o of a)
3415
- typeof o == "string" && o in t && (t[o] = !1, Kr(o, r, t));
3416
- }, on = (e, r, t, n) => {
3435
+ typeof o == "string" && o in t && (t[o] = !1, Gr(o, r, t));
3436
+ }, cn = (e, r, t, n) => {
3417
3437
  const a = { ...t };
3418
3438
  return e.forEach((o) => {
3419
- (!o.parents || Object.keys(o.parents).length === 0) && (a[o.name] = !0, ze(o.name, n, r, a));
3439
+ (!o.parents || Object.keys(o.parents).length === 0) && (a[o.name] = !0, Pe(o.name, n, r, a));
3420
3440
  }), a;
3421
- }, sn = (e, r, t, n, a) => {
3441
+ }, ln = (e, r, t, n, a) => {
3422
3442
  const o = { ...e }, c = r[n];
3423
- if (Kr(n, r, o), a != null && c?.children) {
3443
+ if (Gr(n, r, o), a != null && c?.children) {
3424
3444
  const s = String(a), i = c.children[s];
3425
3445
  if (Array.isArray(i))
3426
3446
  for (const d of i)
3427
- typeof d == "string" && r[d] && (o[d] = !0, ze(d, r, t, o));
3447
+ typeof d == "string" && r[d] && (o[d] = !0, Pe(d, r, t, o));
3428
3448
  }
3429
3449
  return o;
3430
- }, cn = (e, r) => {
3450
+ }, un = (e, r) => {
3431
3451
  const t = /* @__PURE__ */ new Map();
3432
3452
  let n = null, a = null, o = 0;
3433
3453
  for (const c of e) {
@@ -3449,7 +3469,7 @@ const ze = (e, r, t, n) => {
3449
3469
  }
3450
3470
  }
3451
3471
  return o;
3452
- }, ln = (e, r = {}) => {
3472
+ }, mn = (e, r = {}) => {
3453
3473
  const { includeEmpty: t = !0 } = r, n = [];
3454
3474
  let a = null, o = [], c = 0;
3455
3475
  for (const i of e) {
@@ -3467,16 +3487,16 @@ const ze = (e, r, t, n) => {
3467
3487
  }
3468
3488
  };
3469
3489
  }, Le = new ne();
3470
- function Gr(e, r) {
3490
+ function Jr(e, r) {
3471
3491
  Le.register(e, r);
3472
3492
  }
3473
- function un(e) {
3493
+ function dn(e) {
3474
3494
  return Le.get(e);
3475
3495
  }
3476
- function mn(e) {
3496
+ function fn(e) {
3477
3497
  return Le.get(e);
3478
3498
  }
3479
- Gr(
3499
+ Jr(
3480
3500
  "Preset_AlertSubmitHandler",
3481
3501
  (e, r, t) => {
3482
3502
  const n = {
@@ -3488,7 +3508,7 @@ Gr(
3488
3508
  alert(a);
3489
3509
  }
3490
3510
  );
3491
- async function dn(e, r, t, n, a, o, c) {
3511
+ async function pn(e, r, t, n, a, o, c) {
3492
3512
  const s = a ? Object.values(a).filter(Boolean) : [];
3493
3513
  if (s.length > 0)
3494
3514
  return {
@@ -3501,28 +3521,28 @@ async function dn(e, r, t, n, a, o, c) {
3501
3521
  for (const u of e.properties) {
3502
3522
  const f = u.name, b = i[f];
3503
3523
  if (b == null) continue;
3504
- const N = u.type;
3524
+ const C = u.type;
3505
3525
  try {
3506
- if (N === "int") {
3507
- const C = String(b).trim();
3508
- if (C === "")
3526
+ if (C === "int") {
3527
+ const N = String(b).trim();
3528
+ if (N === "")
3509
3529
  i[f] = 0;
3510
3530
  else {
3511
- const h = Number(C);
3531
+ const h = Number(N);
3512
3532
  Number.isInteger(h) ? i[f] = Math.trunc(h) : d.push(n("Invalid integer format for field {{1}}", u.displayName || f));
3513
3533
  }
3514
- } else if (N === "number" || N === "float") {
3515
- const C = String(b).trim();
3516
- if (C === "")
3534
+ } else if (C === "number" || C === "float") {
3535
+ const N = String(b).trim();
3536
+ if (N === "")
3517
3537
  i[f] = 0;
3518
3538
  else {
3519
- const h = Number(C);
3539
+ const h = Number(N);
3520
3540
  isNaN(h) ? d.push(n("Invalid number format for field {{1}}", u.displayName || f)) : i[f] = h;
3521
3541
  }
3522
- } else if (N === "int-array" || N === "float-array") {
3523
- const C = String(b).split(",").map((E) => E.trim()).filter(Boolean), h = [];
3542
+ } else if (C === "int-array" || C === "float-array") {
3543
+ const N = String(b).split(",").map((E) => E.trim()).filter(Boolean), h = [];
3524
3544
  let y = !1;
3525
- for (const E of C) {
3545
+ for (const E of N) {
3526
3546
  const F = Number(E);
3527
3547
  if (isNaN(F)) {
3528
3548
  d.push(n("Invalid number {{1}} in array for field {{2}}", E, u.displayName || f)), y = !0;
@@ -3532,8 +3552,8 @@ async function dn(e, r, t, n, a, o, c) {
3532
3552
  }
3533
3553
  y || (i[f] = h);
3534
3554
  }
3535
- } catch (C) {
3536
- d.push(n("Error processing field {{1}}: {{2}}", u.displayName || f, C instanceof Error ? C.message : String(C)));
3555
+ } catch (N) {
3556
+ d.push(n("Error processing field {{1}}: {{2}}", u.displayName || f, N instanceof Error ? N.message : String(N)));
3537
3557
  }
3538
3558
  }
3539
3559
  if (d.length > 0)
@@ -3551,7 +3571,7 @@ async function dn(e, r, t, n, a, o, c) {
3551
3571
  errors: u
3552
3572
  };
3553
3573
  } else {
3554
- const u = await bt(e, i, n);
3574
+ const u = await yt(e, i, n);
3555
3575
  if (u && u.length > 0)
3556
3576
  return {
3557
3577
  success: !1,
@@ -3577,7 +3597,7 @@ async function dn(e, r, t, n, a, o, c) {
3577
3597
  };
3578
3598
  }
3579
3599
  else if (e && typeof e.submitHandlerName == "string") {
3580
- const u = un(e.submitHandlerName);
3600
+ const u = dn(e.submitHandlerName);
3581
3601
  if (u)
3582
3602
  try {
3583
3603
  const f = await u(e, r?.name ?? null, i, n), b = m(f);
@@ -3601,7 +3621,7 @@ async function dn(e, r, t, n, a, o, c) {
3601
3621
  data: i
3602
3622
  };
3603
3623
  }
3604
- const Jr = ({
3624
+ const Yr = ({
3605
3625
  message: e,
3606
3626
  success: r,
3607
3627
  onDismiss: t,
@@ -3643,8 +3663,8 @@ const Jr = ({
3643
3663
  ]
3644
3664
  }
3645
3665
  ) : null;
3646
- Jr.displayName = "SubmissionMessage";
3647
- const fn = ({ onClick: e, disabled: r = !1, t }) => {
3666
+ Yr.displayName = "SubmissionMessage";
3667
+ const gn = ({ onClick: e, disabled: r = !1, t }) => {
3648
3668
  const [n, a] = l.useState(!1);
3649
3669
  return /* @__PURE__ */ p(
3650
3670
  "button",
@@ -3670,7 +3690,7 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3670
3690
  children: t("Submit")
3671
3691
  }
3672
3692
  );
3673
- }, pn = ({
3693
+ }, hn = ({
3674
3694
  definition: e,
3675
3695
  instance: r,
3676
3696
  onSubmit: t = void 0,
@@ -3678,14 +3698,14 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3678
3698
  chunkSize: a = 50,
3679
3699
  chunkDelay: o = 50
3680
3700
  }) => {
3681
- const { properties: c, displayName: s } = e, i = H(), { t: d, formStyle: m, language: u, displayInstanceName: f } = i, b = {
3701
+ const { properties: c, displayName: s } = e, i = B(), { t: d, formStyle: m, language: u, displayInstanceName: f } = i, b = {
3682
3702
  ...i,
3683
3703
  definitionName: e?.name ?? i.definitionName
3684
- }, [N, C] = l.useState("en"), [h, y] = l.useState([]), [E, F] = l.useState({}), [M, $] = l.useState(
3704
+ }, [C, N] = l.useState("en"), [h, y] = l.useState([]), [E, F] = l.useState({}), [M, $] = l.useState(
3685
3705
  {}
3686
3706
  ), [R, I] = l.useState({}), [v, g] = l.useState({}), [w, x] = l.useState(null), [k, S] = l.useState(null), [A, j] = l.useState(0), [K, ce] = l.useState(!1), [je, ae] = l.useState(r.name || ""), Y = l.useRef(r), fe = l.useRef(!1);
3687
3707
  l.useEffect(() => {
3688
- const P = Object.fromEntries(
3708
+ const z = Object.fromEntries(
3689
3709
  c.map((L) => [
3690
3710
  L.name,
3691
3711
  { ...L, children: {} }
@@ -3693,55 +3713,55 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3693
3713
  );
3694
3714
  c.forEach((L) => {
3695
3715
  L.parents && Object.entries(L.parents).forEach(([Q, re]) => {
3696
- const X = P[Q];
3697
- X && re.forEach((at) => {
3716
+ const X = z[Q];
3717
+ X && re.forEach((ot) => {
3698
3718
  X.children || (X.children = {});
3699
- const qe = String(at);
3719
+ const qe = String(ot);
3700
3720
  X.children[qe] = [
3701
3721
  ...X.children[qe] || [],
3702
3722
  L.name
3703
3723
  ];
3704
3724
  });
3705
3725
  });
3706
- }), cn(c, P);
3726
+ }), un(c, z);
3707
3727
  const q = Object.values(
3708
- P
3709
- ), z = {};
3728
+ z
3729
+ ), P = {};
3710
3730
  q.forEach((L) => {
3711
3731
  if (L.type === "unit") {
3712
3732
  const Q = typeof L.defaultValue == "number" ? String(L.defaultValue) : "", re = typeof L.defaultUnit == "string" ? L.defaultUnit : String(L.defaultUnit ?? "m");
3713
- z[L.name] = [Q, re];
3733
+ P[L.name] = [Q, re];
3714
3734
  } else
3715
- z[L.name] = L.defaultValue;
3735
+ P[L.name] = L.defaultValue;
3716
3736
  }), Y.current = r, Object.keys(r.values).forEach((L) => {
3717
- P[L] !== void 0 && (z[L] = r.values[L]);
3737
+ z[L] !== void 0 && (P[L] = r.values[L]);
3718
3738
  });
3719
3739
  const J = Object.fromEntries(q.map((L) => [L.name, !1])), G = requestAnimationFrame(() => {
3720
- y(q), F(P), $(z), I(
3721
- on(q, z, J, P)
3740
+ y(q), F(z), $(P), I(
3741
+ cn(q, P, J, z)
3722
3742
  ), ce(!0), ae(r.name);
3723
3743
  });
3724
3744
  return () => cancelAnimationFrame(G);
3725
3745
  }, [c, r, e]), l.useEffect(() => {
3726
3746
  if (!K || A >= h.length) return;
3727
- const P = setTimeout(() => {
3747
+ const z = setTimeout(() => {
3728
3748
  j(
3729
3749
  (q) => Math.min(q + a, h.length)
3730
3750
  );
3731
3751
  }, o);
3732
- return () => clearTimeout(P);
3752
+ return () => clearTimeout(z);
3733
3753
  }, [K, A, h.length, a, o]);
3734
3754
  const Be = l.useCallback(
3735
- (P, q) => {
3736
- x(null), S(null), $((J) => ({ ...J, [P]: q }));
3737
- const z = E[P];
3738
- z && z.children && Object.keys(z.children).length > 0 && I((J) => {
3739
- const G = { ...M, [P]: q };
3740
- return sn(
3755
+ (z, q) => {
3756
+ x(null), S(null), $((J) => ({ ...J, [z]: q }));
3757
+ const P = E[z];
3758
+ P && P.children && Object.keys(P.children).length > 0 && I((J) => {
3759
+ const G = { ...M, [z]: q };
3760
+ return ln(
3741
3761
  J,
3742
3762
  E,
3743
3763
  G,
3744
- P,
3764
+ z,
3745
3765
  q
3746
3766
  );
3747
3767
  });
@@ -3749,25 +3769,25 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3749
3769
  [E, M]
3750
3770
  );
3751
3771
  l.useEffect(() => {
3752
- let P = 0;
3753
- return P = requestAnimationFrame(() => {
3754
- u !== N && (C(u || "en"), x(null), S(null));
3755
- }), () => cancelAnimationFrame(P);
3756
- }, [u, N]), l.useEffect(() => {
3757
- let P = 0;
3758
- return P = requestAnimationFrame(() => {
3772
+ let z = 0;
3773
+ return z = requestAnimationFrame(() => {
3774
+ u !== C && (N(u || "en"), x(null), S(null));
3775
+ }), () => cancelAnimationFrame(z);
3776
+ }, [u, C]), l.useEffect(() => {
3777
+ let z = 0;
3778
+ return z = requestAnimationFrame(() => {
3759
3779
  if (fe.current) {
3760
3780
  fe.current = !1, Y.current = r, ae(r.name || "");
3761
3781
  return;
3762
3782
  }
3763
3783
  Y.current = r, x(null), S(null), ae(r.name || "");
3764
- }), () => cancelAnimationFrame(P);
3784
+ }), () => cancelAnimationFrame(z);
3765
3785
  }, [r, r.name]);
3766
- const He = l.useCallback((P, q) => {
3767
- g((z) => q ? { ...z, [P]: String(q) } : Object.fromEntries(Object.entries(z).filter(([G]) => G !== P)));
3768
- }, []), tt = async () => {
3786
+ const He = l.useCallback((z, q) => {
3787
+ g((P) => q ? { ...P, [z]: String(q) } : Object.fromEntries(Object.entries(P).filter(([G]) => G !== z)));
3788
+ }, []), nt = async () => {
3769
3789
  fe.current = !0;
3770
- const P = Y.current?.name;
3790
+ const z = Y.current?.name;
3771
3791
  Y.current.name = je;
3772
3792
  let q = v;
3773
3793
  if (b.fieldValidationMode === "onSubmission") {
@@ -3783,18 +3803,18 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3783
3803
  } else
3784
3804
  x(null), S(null);
3785
3805
  }
3786
- const z = await dn(e, Y.current, M, d, q, t, n), J = typeof z.message == "string" ? z.message : String(z.message), G = Object.values(z.errors ?? {}).join(`
3806
+ const P = await pn(e, Y.current, M, d, q, t, n), J = typeof P.message == "string" ? P.message : String(P.message), G = Object.values(P.errors ?? {}).join(`
3787
3807
  `);
3788
3808
  x(G ? J + `
3789
- ` + G : J), S(z.success), z.success || (Y.current.name = P ?? Y.current.name, ae(P ?? ""));
3790
- }, nt = l.useMemo(
3809
+ ` + G : J), S(P.success), P.success || (Y.current.name = z ?? Y.current.name, ae(z ?? ""));
3810
+ }, at = l.useMemo(
3791
3811
  () => b.fieldValidationMode === "realTime" ? Object.values(v).some(Boolean) : !1,
3792
3812
  [v, b.fieldValidationMode]
3793
3813
  );
3794
3814
  return /* @__PURE__ */ p(Ee.Provider, { value: b, children: /* @__PURE__ */ D("div", { style: m.container, children: [
3795
3815
  s && /* @__PURE__ */ p("h2", { style: m.titleStyle, children: d(s) }),
3796
3816
  /* @__PURE__ */ p(
3797
- Jr,
3817
+ Yr,
3798
3818
  {
3799
3819
  message: w,
3800
3820
  success: k,
@@ -3808,29 +3828,29 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3808
3828
  sr,
3809
3829
  {
3810
3830
  name: je,
3811
- onChange: (P) => {
3812
- ae(P), x(null), S(null);
3831
+ onChange: (z) => {
3832
+ ae(z), x(null), S(null);
3813
3833
  }
3814
3834
  }
3815
3835
  ),
3816
3836
  /* @__PURE__ */ D(Ie, { children: [
3817
3837
  (() => {
3818
- const P = h.slice(0, A).filter((z) => R[z.name]), { groups: q } = ln(P);
3819
- return q.map((z, J) => z.name ? /* @__PURE__ */ p(
3820
- _r,
3838
+ const z = h.slice(0, A).filter((P) => R[P.name]), { groups: q } = mn(z);
3839
+ return q.map((P, J) => P.name ? /* @__PURE__ */ p(
3840
+ Kr,
3821
3841
  {
3822
- groupName: z.name,
3842
+ groupName: P.name,
3823
3843
  defaultOpen: !0,
3824
- fields: z.fields,
3844
+ fields: P.fields,
3825
3845
  valuesMap: M,
3826
3846
  handleChange: Be,
3827
3847
  handleError: He,
3828
3848
  errorsMap: v,
3829
3849
  t: d
3830
3850
  },
3831
- z.name
3832
- ) : /* @__PURE__ */ p(l.Fragment, { children: z.fields.map((G) => /* @__PURE__ */ p(
3833
- Pe,
3851
+ P.name
3852
+ ) : /* @__PURE__ */ p(l.Fragment, { children: P.fields.map((G) => /* @__PURE__ */ p(
3853
+ ze,
3834
3854
  {
3835
3855
  field: G,
3836
3856
  valuesMap: M,
@@ -3852,9 +3872,9 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3852
3872
  }
3853
3873
  )
3854
3874
  ] }),
3855
- /* @__PURE__ */ p(fn, { onClick: tt, disabled: nt, t: d })
3875
+ /* @__PURE__ */ p(gn, { onClick: nt, disabled: at, t: d })
3856
3876
  ] }) });
3857
- }, Yr = {
3877
+ }, Xr = {
3858
3878
  en: { name: "English", nativeName: "English" },
3859
3879
  fr: { name: "French", nativeName: "Français" },
3860
3880
  de: { name: "German", nativeName: "Deutsch" },
@@ -3885,13 +3905,13 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3885
3905
  uk: { name: "Ukrainian", nativeName: "Українська" },
3886
3906
  vi: { name: "Vietnamese", nativeName: "Tiếng Việt" },
3887
3907
  "zh-tw": { name: "Chinese (Traditional)", nativeName: "繁體中文" }
3888
- }, pa = () => Yr, be = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Set(), we = /* @__PURE__ */ new Map(), gn = async (e) => {
3908
+ }, ha = () => Xr, be = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Set(), we = /* @__PURE__ */ new Map(), bn = async (e) => {
3889
3909
  try {
3890
3910
  let r = {};
3891
3911
  const t = e.toLowerCase();
3892
3912
  if (t === "en")
3893
3913
  r = {};
3894
- else if (Yr[t]) {
3914
+ else if (Xr[t]) {
3895
3915
  const a = `https://reactaform.com/locales/${t}/common.json`, o = await fetch(a);
3896
3916
  o.ok && (r = await o.json());
3897
3917
  } else
@@ -3908,7 +3928,7 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3908
3928
  error: `Failed to load common translations for ${e}: ${r}`
3909
3929
  };
3910
3930
  }
3911
- }, hn = async (e) => {
3931
+ }, yn = async (e) => {
3912
3932
  if (!e || e.toLowerCase() === "en")
3913
3933
  return { success: !0, translations: {}, fromCache: !1 };
3914
3934
  const r = e.toLowerCase();
@@ -3918,13 +3938,13 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3918
3938
  translations: be.get(r) || {},
3919
3939
  fromCache: !0
3920
3940
  };
3921
- const t = await gn(r);
3941
+ const t = await bn(r);
3922
3942
  return t.success && (be.set(r, t.translations), we.set(r, {
3923
3943
  loadedAt: /* @__PURE__ */ new Date(),
3924
3944
  size: Object.keys(t.translations).length,
3925
3945
  source: "common"
3926
3946
  })), t;
3927
- }, bn = async (e, r) => {
3947
+ }, vn = async (e, r) => {
3928
3948
  if (!e || !r)
3929
3949
  return {
3930
3950
  success: !1,
@@ -3965,7 +3985,7 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
3965
3985
  fromCache: !1
3966
3986
  });
3967
3987
  const o = a.headers.get("content-type") || "";
3968
- !o.includes("application/json") && !o.includes("text/json") && Xr() && console.warn(
3988
+ !o.includes("application/json") && !o.includes("text/json") && Zr() && console.warn(
3969
3989
  `Translation file at ${n} has unexpected content-type: ${o}`
3970
3990
  );
3971
3991
  const c = await a.text();
@@ -4012,7 +4032,7 @@ const fn = ({ onClick: e, disabled: r = !1, t }) => {
4012
4032
  };
4013
4033
  }
4014
4034
  };
4015
- function Xr() {
4035
+ function Zr() {
4016
4036
  try {
4017
4037
  if (typeof process < "u" && process?.env?.NODE_ENV === "development")
4018
4038
  return !0;
@@ -4020,30 +4040,30 @@ function Xr() {
4020
4040
  }
4021
4041
  return !1;
4022
4042
  }
4023
- function yn(e, r) {
4043
+ function xn(e, r) {
4024
4044
  return r.length === 0 ? e : e.replace(/\{\{(\d+)\}\}/g, (t, n) => {
4025
4045
  const a = parseInt(n, 10) - 1, o = r[a];
4026
4046
  return o == null ? t : String(o);
4027
4047
  });
4028
4048
  }
4029
- const vn = (e, r, t) => (n, ...a) => {
4049
+ const wn = (e, r, t) => (n, ...a) => {
4030
4050
  let o = n, c = !1;
4031
- return !n || typeof n != "string" ? String(n || "") : (e.toLowerCase() === "en" ? (o = n, c = !0) : n in t ? (o = t[n], c = !0) : n in r ? (o = r[n], c = !0) : o = n, o = yn(o, a), !c && Xr() && console.debug(
4051
+ return !n || typeof n != "string" ? String(n || "") : (e.toLowerCase() === "en" ? (o = n, c = !0) : n in t ? (o = t[n], c = !0) : n in r ? (o = r[n], c = !0) : o = n, o = xn(o, a), !c && Zr() && console.debug(
4032
4052
  `Missing translation for "${n}" in language "${e}"`
4033
4053
  ), o);
4034
4054
  };
4035
- function xn(e) {
4055
+ function Sn(e) {
4036
4056
  return /^[-+]?\d*$/.test(e);
4037
4057
  }
4038
- function wn(e) {
4058
+ function Cn(e) {
4039
4059
  const r = /^[-+]?\d*$/;
4040
4060
  return e.split(",").map((t) => t.trim()).every((t) => r.test(t));
4041
4061
  }
4042
- const Sn = ",", Cn = (e) => !e || e.trim() === "" ? [] : e.split(Sn).map((r) => r.trim()).filter(Boolean).map((r) => Number(r)), Xe = (e, r, t) => {
4062
+ const Nn = ",", kn = (e) => !e || e.trim() === "" ? [] : e.split(Nn).map((r) => r.trim()).filter(Boolean).map((r) => Number(r)), Xe = (e, r, t) => {
4043
4063
  const n = String(r);
4044
4064
  if (n.trim() === "")
4045
4065
  return e.min !== void 0 || e.max !== void 0 ? t("Value required when min or max constraints is set") : e.required ? t("Value required") : void 0;
4046
- if (!xn(n))
4066
+ if (!Sn(n))
4047
4067
  return t("Must be a valid integer");
4048
4068
  const a = parseInt(n, 10);
4049
4069
  if (Number.isNaN(a)) return t("Must be a valid integer");
@@ -4067,13 +4087,13 @@ const Sn = ",", Cn = (e) => !e || e.trim() === "" ? [] : e.split(Sn).map((r) =>
4067
4087
  return t("Must be a multiple of {{1}}", o);
4068
4088
  }
4069
4089
  };
4070
- function Nn(e, r, t) {
4090
+ function In(e, r, t) {
4071
4091
  const n = String(r);
4072
4092
  if (n.trim() === "")
4073
4093
  return e.min !== void 0 || e.max !== void 0 ? t("Value required when min or max constraints is set") : e.required ? t("Value required") : void 0;
4074
- if (!wn(n))
4094
+ if (!Cn(n))
4075
4095
  return t("Each value must be a valid integer");
4076
- const a = Cn(n);
4096
+ const a = kn(n);
4077
4097
  if (e.minCount !== void 0 && a.length < e.minCount)
4078
4098
  return t("Minimum number of values: {{1}}", `${e.minCount}`);
4079
4099
  if (e.maxCount !== void 0 && a.length > e.maxCount)
@@ -4093,7 +4113,7 @@ function Nn(e, r, t) {
4093
4113
  );
4094
4114
  }
4095
4115
  }
4096
- function Zr(e, r, t) {
4116
+ function Qr(e, r, t) {
4097
4117
  const n = String(r);
4098
4118
  if (n.trim() === "")
4099
4119
  return e.min !== void 0 || e.max !== void 0 ? t("Value required when min or max constraints is set") : e.required ? t("Value required") : void 0;
@@ -4118,18 +4138,18 @@ function Zr(e, r, t) {
4118
4138
  );
4119
4139
  }
4120
4140
  }
4121
- const kn = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/;
4122
- function In(e) {
4123
- return e.split(",").map((r) => r.trim()).every((r) => kn.test(r));
4141
+ const En = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/;
4142
+ function Mn(e) {
4143
+ return e.split(",").map((r) => r.trim()).every((r) => En.test(r));
4124
4144
  }
4125
- const En = ",", Mn = (e) => !e || e.trim() === "" ? [] : e.split(En).map((r) => r.trim()).filter(Boolean).map((r) => Number(r));
4126
- function Fn(e, r, t) {
4145
+ const Fn = ",", $n = (e) => !e || e.trim() === "" ? [] : e.split(Fn).map((r) => r.trim()).filter(Boolean).map((r) => Number(r));
4146
+ function Vn(e, r, t) {
4127
4147
  const n = String(r);
4128
4148
  if (n.trim() === "")
4129
4149
  return e.min !== void 0 || e.max !== void 0 ? t("Value required when min or max constraints is set") : e.required ? t("Value required") : void 0;
4130
- if (!In(n))
4150
+ if (!Mn(n))
4131
4151
  return t("Each value must be a valid float");
4132
- const a = Mn(n);
4152
+ const a = $n(n);
4133
4153
  if (e.minCount !== void 0 && a.length < e.minCount)
4134
4154
  return t("Minimum number of values: {{1}}", e.minCount);
4135
4155
  if (e.maxCount !== void 0 && a.length > e.maxCount)
@@ -4181,26 +4201,26 @@ const Se = (e) => {
4181
4201
  if (!e) return null;
4182
4202
  const r = Date.parse(e);
4183
4203
  return Number.isNaN(r) ? null : r;
4184
- }, Ze = /* @__PURE__ */ new WeakMap(), $n = (e) => {
4204
+ }, Ze = /* @__PURE__ */ new WeakMap(), An = (e) => {
4185
4205
  let r = Ze.get(e);
4186
4206
  return r || (r = {
4187
4207
  minTime: Se(e.minDate),
4188
4208
  maxTime: Se(e.maxDate)
4189
4209
  }, Ze.set(e, r)), r;
4190
4210
  };
4191
- function Vn(e, r, t) {
4211
+ function Rn(e, r, t) {
4192
4212
  if (r == null || String(r).trim() === "")
4193
4213
  return e.required ? t("Value required") : void 0;
4194
4214
  const n = String(r).trim(), a = Se(n);
4195
4215
  if (a === null)
4196
4216
  return t("Invalid date format");
4197
- const { minTime: o, maxTime: c } = $n(e);
4217
+ const { minTime: o, maxTime: c } = An(e);
4198
4218
  if (o !== null && a < o)
4199
4219
  return t("Date must be on or after {{1}}", e.minDate);
4200
4220
  if (c !== null && a > c)
4201
4221
  return t("Date must be on or before {{1}}", e.maxDate);
4202
4222
  }
4203
- function An(e, r, t) {
4223
+ function Dn(e, r, t) {
4204
4224
  const n = String(r);
4205
4225
  if (!n || n.trim() === "")
4206
4226
  return e.required || e.min || e.max ? t("Value required") : void 0;
@@ -4234,29 +4254,29 @@ function An(e, r, t) {
4234
4254
  return t("Time must be on or before {{1}}", e.max);
4235
4255
  }
4236
4256
  }
4237
- function Rn(e) {
4257
+ function zn(e) {
4238
4258
  return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
4239
4259
  }
4240
- function Dn(e, r, t) {
4260
+ function Pn(e, r, t) {
4241
4261
  const n = String(r ?? "").trim();
4242
- return n === "" ? e.required ? t("Value required") : void 0 : Rn(n) ? Oe(e, r, t, t("Email does not match pattern: {{1}}", e.pattern)) : t("Must be valid email format");
4262
+ return n === "" ? e.required ? t("Value required") : void 0 : zn(n) ? Oe(e, r, t, t("Email does not match pattern: {{1}}", e.pattern)) : t("Must be valid email format");
4243
4263
  }
4244
- function Pn(e, r, t) {
4264
+ function Ln(e, r, t) {
4245
4265
  const n = String(r ?? "").trim();
4246
4266
  return n === "" ? e.required ? t("Value required") : void 0 : Oe(e, n, t, "Invalid phone number format");
4247
4267
  }
4248
- const zn = /^(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]$/i, Ln = (e) => {
4268
+ const On = /^(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]$/i, Tn = (e) => {
4249
4269
  try {
4250
4270
  return new URL(e), !0;
4251
4271
  } catch {
4252
4272
  return !1;
4253
4273
  }
4254
4274
  };
4255
- function On(e, r, t) {
4275
+ function jn(e, r, t) {
4256
4276
  const n = String(r ?? "").trim();
4257
4277
  if (n === "")
4258
4278
  return e.required ? t("Value required") : void 0;
4259
- if (!(zn.test(n) || Ln(n))) {
4279
+ if (!(On.test(n) || Tn(n))) {
4260
4280
  if (e.allowRelative === !0) {
4261
4281
  if (!n.startsWith("/") || encodeURI(n) !== n)
4262
4282
  return t("Must be a valid URL");
@@ -4270,11 +4290,11 @@ function On(e, r, t) {
4270
4290
  return t("Must be a valid URL");
4271
4291
  }
4272
4292
  }
4273
- function Tn(e, r, t) {
4293
+ function Bn(e, r, t) {
4274
4294
  const n = Array.isArray(r) ? r : [], a = n[0], o = n[1] ? String(n[1]).trim() : "";
4275
- return String(a ?? "").trim() === "" || o === "" ? e.required ? t("Value required") : void 0 : Zr(e, a, t);
4295
+ return String(a ?? "").trim() === "" || o === "" ? e.required ? t("Value required") : void 0 : Qr(e, a, t);
4276
4296
  }
4277
- function jn(e, r, t) {
4297
+ function Hn(e, r, t) {
4278
4298
  if (Array.isArray(r))
4279
4299
  return r.length === 0 ? t("Select a file") : r.every((n) => n instanceof File) ? void 0 : t("Invalid file input");
4280
4300
  if (!(r instanceof File)) {
@@ -4282,14 +4302,14 @@ function jn(e, r, t) {
4282
4302
  return e.required && (r == null || typeof n == "string" && n.trim() === "") ? t("Select a file") : t("Invalid file input: {{1}}", n);
4283
4303
  }
4284
4304
  }
4285
- function Bn(e, r, t) {
4305
+ function qn(e, r, t) {
4286
4306
  const n = String(r);
4287
4307
  if (n === "" || n === null || n === void 0)
4288
4308
  return e.required ? t("Value required") : void 0;
4289
4309
  if (!e.options?.some((a) => String(a.value) === n))
4290
4310
  return t("Invalid option selected");
4291
4311
  }
4292
- function Hn(e, r, t) {
4312
+ function Un(e, r, t) {
4293
4313
  const a = String(r ?? "").trim();
4294
4314
  if (a === "")
4295
4315
  return e.required ? t("Value required") : void 0;
@@ -4300,15 +4320,15 @@ function Hn(e, r, t) {
4300
4320
  if (!e.options?.some((s) => String(s.value) === c))
4301
4321
  return t("Invalid option selected");
4302
4322
  }
4303
- const qn = /^#([0-9A-F]{3}){1,2}$/i, Un = (e) => qn.test(e);
4304
- function Wn(e, r, t) {
4323
+ const Wn = /^#([0-9A-F]{3}){1,2}$/i, _n = (e) => Wn.test(e);
4324
+ function Kn(e, r, t) {
4305
4325
  const n = String(r).trim();
4306
4326
  if (n === "")
4307
4327
  return e.required ? t("Value required") : void 0;
4308
- if (!Un(n))
4328
+ if (!_n(n))
4309
4329
  return t("Invalid color format");
4310
4330
  }
4311
- function _n(e, r, t) {
4331
+ function Gn(e, r, t) {
4312
4332
  const n = String(r ?? "").trim();
4313
4333
  if (n === "")
4314
4334
  return e.required ? t("Value required") : void 0;
@@ -4318,7 +4338,7 @@ function _n(e, r, t) {
4318
4338
  if (e.max !== void 0 && a > e.max)
4319
4339
  return t("Must be ≤ {{1}}", e.max);
4320
4340
  }
4321
- function Kn(e, r, t) {
4341
+ function Jn(e, r, t) {
4322
4342
  const n = String(r);
4323
4343
  if (n.trim() === "")
4324
4344
  return e.required ? t("Value required") : void 0;
@@ -4331,13 +4351,13 @@ function Kn(e, r, t) {
4331
4351
  return t("Must be ≤ {{1}}", c);
4332
4352
  }
4333
4353
  let Qe = !1;
4334
- function Qr() {
4335
- Qe || (B("int", Xe), B("stepper", Xe), B("int-array", Nn), B("float", Zr), B("slider", Kn), B("float-array", Fn), B("text", ue), B("string", ue), B("multiline", ue), B("password", ue), B("email", Dn), B("date", Vn), B("time", An), B("url", On), B("phone", Pn), B("unit", Tn), B("dropdown", Bn), B("multi-selection", Hn), B("color", Wn), B("rating", _n), B("file", jn), Qe = !0);
4354
+ function et() {
4355
+ Qe || (H("int", Xe), H("stepper", Xe), H("int-array", In), H("float", Qr), H("slider", Jn), H("float-array", Vn), H("text", ue), H("string", ue), H("multiline", ue), H("password", ue), H("email", Pn), H("date", Rn), H("time", Dn), H("url", jn), H("phone", Ln), H("unit", Bn), H("dropdown", qn), H("multi-selection", Un), H("color", Kn), H("rating", Gn), H("file", Hn), Qe = !0);
4336
4356
  }
4337
- Qr();
4338
- an();
4339
- Qr();
4340
- const Gn = (e) => ({
4357
+ et();
4358
+ sn();
4359
+ et();
4360
+ const Yn = (e) => ({
4341
4361
  container: {
4342
4362
  padding: "var(--reactaform-space-sm, 8px)",
4343
4363
  margin: "0 auto",
@@ -4378,7 +4398,7 @@ const Gn = (e) => ({
4378
4398
  lineHeight: "1.2",
4379
4399
  textAlign: "left"
4380
4400
  }
4381
- }), Jn = (e) => {
4401
+ }), Xn = (e) => {
4382
4402
  const r = {
4383
4403
  color: "var(--reactaform-color-text)",
4384
4404
  fontFamily: e?.fontFamily || "var(--reactaform-font-family, inherit)",
@@ -4437,7 +4457,7 @@ const Gn = (e) => ({
4437
4457
  display: "block"
4438
4458
  }
4439
4459
  };
4440
- }, Yn = ({
4460
+ }, Zn = ({
4441
4461
  children: e,
4442
4462
  definitionName: r = "",
4443
4463
  defaultStyle: t,
@@ -4451,29 +4471,29 @@ const Gn = (e) => ({
4451
4471
  const d = r, m = o, u = a, f = n, b = l.useMemo(
4452
4472
  () => t ?? {},
4453
4473
  [t]
4454
- ), [N, C] = l.useState({}), [h, y] = l.useState({});
4474
+ ), [C, N] = l.useState({}), [h, y] = l.useState({});
4455
4475
  l.useEffect(() => {
4456
4476
  let v = !0;
4457
4477
  return (async () => {
4458
4478
  if (f === "en") {
4459
- v && (C({}), y({}));
4479
+ v && (N({}), y({}));
4460
4480
  return;
4461
4481
  }
4462
4482
  try {
4463
- const w = await hn(f), x = w.success ? w.translations : {};
4464
- v && C(x);
4465
- const k = await bn(f, m), S = k.success ? k.translations : {};
4483
+ const w = await yn(f), x = w.success ? w.translations : {};
4484
+ v && N(x);
4485
+ const k = await vn(f, m), S = k.success ? k.translations : {};
4466
4486
  v && y(S);
4467
4487
  } catch {
4468
- v && (C({}), y({}));
4488
+ v && (N({}), y({}));
4469
4489
  }
4470
4490
  })(), () => {
4471
4491
  v = !1;
4472
4492
  };
4473
4493
  }, [f, m]);
4474
- const E = l.useMemo(() => Gn(b), [b]), F = l.useMemo(() => Jn(b), [b]), M = l.useMemo(
4475
- () => vn(f, N, h),
4476
- [f, N, h]
4494
+ const E = l.useMemo(() => Yn(b), [b]), F = l.useMemo(() => Xn(b), [b]), M = l.useMemo(
4495
+ () => wn(f, C, h),
4496
+ [f, C, h]
4477
4497
  ), $ = l.useCallback(
4478
4498
  (v, ...g) => M(v, ...g),
4479
4499
  [M]
@@ -4509,7 +4529,7 @@ const Gn = (e) => ({
4509
4529
  }
4510
4530
  ) });
4511
4531
  };
4512
- function Xn(e) {
4532
+ function Qn(e) {
4513
4533
  if (!e || typeof e != "object")
4514
4534
  return "Definition must be an object";
4515
4535
  const r = e;
@@ -4537,7 +4557,7 @@ function Xn(e) {
4537
4557
  }
4538
4558
  return null;
4539
4559
  }
4540
- async function ga(e, r = {}) {
4560
+ async function ba(e, r = {}) {
4541
4561
  const { validateSchema: t = !0 } = r;
4542
4562
  try {
4543
4563
  if (!e || typeof e != "string")
@@ -4555,7 +4575,7 @@ async function ga(e, r = {}) {
4555
4575
  };
4556
4576
  }
4557
4577
  if (t) {
4558
- const o = Xn(a);
4578
+ const o = Qn(a);
4559
4579
  if (o)
4560
4580
  return { success: !1, error: `Schema validation failed: ${o}` };
4561
4581
  }
@@ -4564,7 +4584,7 @@ async function ga(e, r = {}) {
4564
4584
  return { success: !1, error: `Unexpected error loading definition: ${n instanceof Error ? n.message : "Unknown error"}` };
4565
4585
  }
4566
4586
  }
4567
- function Zn(e, r) {
4587
+ function ea(e, r) {
4568
4588
  try {
4569
4589
  if (!e)
4570
4590
  return { success: !1, error: "Definition is required" };
@@ -4591,7 +4611,7 @@ function Zn(e, r) {
4591
4611
  };
4592
4612
  }
4593
4613
  }
4594
- function ha(e) {
4614
+ function ya(e) {
4595
4615
  try {
4596
4616
  if (!e)
4597
4617
  return { success: !1, error: "Instance data is required" };
@@ -4615,7 +4635,7 @@ function ha(e) {
4615
4635
  };
4616
4636
  }
4617
4637
  }
4618
- function ba(e, r, t) {
4638
+ function va(e, r, t) {
4619
4639
  try {
4620
4640
  if (!e)
4621
4641
  return { success: !1, error: "Instance is required" };
@@ -4697,7 +4717,7 @@ function ba(e, r, t) {
4697
4717
  };
4698
4718
  }
4699
4719
  }
4700
- function Qn(e) {
4720
+ function ra(e) {
4701
4721
  const [r, t] = l.useState(null);
4702
4722
  return l.useEffect(() => {
4703
4723
  const n = document.querySelector("[data-reactaform-theme]");
@@ -4713,7 +4733,7 @@ function Qn(e) {
4713
4733
  return c.observe(a, { attributes: !0, attributeFilter: ["data-reactaform-theme"] }), () => c.disconnect();
4714
4734
  }, [e]), r;
4715
4735
  }
4716
- const ya = ({
4736
+ const xa = ({
4717
4737
  definitionData: e,
4718
4738
  instance: r,
4719
4739
  language: t,
@@ -4731,33 +4751,33 @@ const ya = ({
4731
4751
  } catch {
4732
4752
  return null;
4733
4753
  }
4734
- }, [e]), u = { fontSize: "inherit", fontFamily: "inherit", ...o }, f = Qn(), b = a ?? f ?? "light", N = t ?? "en";
4754
+ }, [e]), u = { fontSize: "inherit", fontFamily: "inherit", ...o }, f = ra(), b = a ?? f ?? "light", C = t ?? "en";
4735
4755
  l.useEffect(() => {
4736
4756
  let h = document.getElementById("popup-root");
4737
4757
  h || (h = document.createElement("div"), h.id = "popup-root", document.body.appendChild(h));
4738
4758
  }, []);
4739
- const C = l.useMemo(() => {
4759
+ const N = l.useMemo(() => {
4740
4760
  if (r) return r;
4741
4761
  if (!m) return null;
4742
- const h = Zn(m, m.name);
4762
+ const h = ea(m, m.name);
4743
4763
  return !h.success || !h.instance ? null : h.instance;
4744
4764
  }, [r, m]);
4745
- return m ? C ? /* @__PURE__ */ p(
4746
- Yn,
4765
+ return m ? N ? /* @__PURE__ */ p(
4766
+ Zn,
4747
4767
  {
4748
4768
  definitionName: m.name,
4749
4769
  defaultStyle: u,
4750
- defaultLanguage: N,
4770
+ defaultLanguage: C,
4751
4771
  defaultTheme: b,
4752
4772
  defaultLocalizeName: m.localization || "",
4753
4773
  className: n,
4754
4774
  defaultFieldValidationMode: c,
4755
4775
  defaultDisplayInstanceName: s,
4756
4776
  children: /* @__PURE__ */ p(
4757
- pn,
4777
+ hn,
4758
4778
  {
4759
4779
  definition: m,
4760
- instance: C,
4780
+ instance: N,
4761
4781
  onSubmit: i,
4762
4782
  onValidation: d
4763
4783
  }
@@ -4772,7 +4792,7 @@ const ya = ({
4772
4792
  formValidators: /* @__PURE__ */ new Map(),
4773
4793
  submissionHandlers: /* @__PURE__ */ new Map()
4774
4794
  };
4775
- function et(e, r, t) {
4795
+ function rt(e, r, t) {
4776
4796
  if (!e) return !0;
4777
4797
  if (t && !t(e))
4778
4798
  return !1;
@@ -4793,11 +4813,11 @@ function et(e, r, t) {
4793
4813
  return !1;
4794
4814
  }
4795
4815
  }
4796
- function ea(e) {
4816
+ function ta(e) {
4797
4817
  const r = [];
4798
4818
  if (e.components)
4799
4819
  for (const t of Object.keys(e.components)) {
4800
- const n = Wr(t);
4820
+ const n = _r(t);
4801
4821
  if (n) {
4802
4822
  let a;
4803
4823
  for (const [o, c] of Z)
@@ -4846,7 +4866,7 @@ function ea(e) {
4846
4866
  }
4847
4867
  if (e.submissionHandlers)
4848
4868
  for (const t of Object.keys(e.submissionHandlers)) {
4849
- const n = mn(t), a = W.submissionHandlers.get(t);
4869
+ const n = fn(t), a = W.submissionHandlers.get(t);
4850
4870
  n && a && a !== e.name && r.push({
4851
4871
  type: "submissionHandler",
4852
4872
  name: t,
@@ -4859,7 +4879,7 @@ function ea(e) {
4859
4879
  function oe(e, r, t, n, a, o, c, s) {
4860
4880
  for (const i of Object.keys(e)) {
4861
4881
  let d;
4862
- if (s ? d = a.find((m) => m.type === "fieldCustomValidator" && m.name === `${s}:${i}`) : e === n.components ? d = a.find((m) => m.type === "component" && m.name === i) : e === n.formValidators ? d = a.find((m) => m.type === "formValidator" && m.name === i) : e === n.fieldTypeValidators ? d = a.find((m) => m.type === "fieldTypeValidator" && m.name === `type:${i}`) : e === n.submissionHandlers && (d = a.find((m) => m.type === "submissionHandler" && m.name === i)), et(d || null, o, c))
4882
+ if (s ? d = a.find((m) => m.type === "fieldCustomValidator" && m.name === `${s}:${i}`) : e === n.components ? d = a.find((m) => m.type === "component" && m.name === i) : e === n.formValidators ? d = a.find((m) => m.type === "formValidator" && m.name === i) : e === n.fieldTypeValidators ? d = a.find((m) => m.type === "fieldTypeValidator" && m.name === `type:${i}`) : e === n.submissionHandlers && (d = a.find((m) => m.type === "submissionHandler" && m.name === i)), rt(d || null, o, c))
4863
4883
  if (s) {
4864
4884
  const m = r.get(s) || /* @__PURE__ */ new Map();
4865
4885
  m.set(i, n.name), r.set(s, m), t(i, e[i]);
@@ -4870,7 +4890,7 @@ function oe(e, r, t, n, a, o, c, s) {
4870
4890
  ) : r.set(i, n.name), t(i, e[i]);
4871
4891
  }
4872
4892
  }
4873
- function va(e, r) {
4893
+ function wa(e, r) {
4874
4894
  const t = r?.conflictResolution || "error";
4875
4895
  if (Z.has(e.name)) {
4876
4896
  const a = {
@@ -4879,13 +4899,13 @@ function va(e, r) {
4879
4899
  existingPlugin: e.name,
4880
4900
  newPlugin: e.name
4881
4901
  };
4882
- if (!et(a, t, r?.onConflict)) return;
4902
+ if (!rt(a, t, r?.onConflict)) return;
4883
4903
  }
4884
- const n = ea(e);
4904
+ const n = ta(e);
4885
4905
  if (e.components && oe(
4886
4906
  e.components,
4887
4907
  W.components,
4888
- Ur,
4908
+ Wr,
4889
4909
  e,
4890
4910
  n,
4891
4911
  t,
@@ -4895,7 +4915,7 @@ function va(e, r) {
4895
4915
  oe(
4896
4916
  o,
4897
4917
  W.fieldValidators,
4898
- (c, s) => pt(a, c, s),
4918
+ (c, s) => gt(a, c, s),
4899
4919
  e,
4900
4920
  n,
4901
4921
  t,
@@ -4905,7 +4925,7 @@ function va(e, r) {
4905
4925
  e.formValidators && oe(
4906
4926
  e.formValidators,
4907
4927
  W.formValidators,
4908
- ft,
4928
+ pt,
4909
4929
  e,
4910
4930
  n,
4911
4931
  t,
@@ -4913,7 +4933,7 @@ function va(e, r) {
4913
4933
  ), e.fieldTypeValidators && oe(
4914
4934
  e.fieldTypeValidators,
4915
4935
  W.fieldTypeValidators,
4916
- gt,
4936
+ ht,
4917
4937
  e,
4918
4938
  n,
4919
4939
  t,
@@ -4921,14 +4941,14 @@ function va(e, r) {
4921
4941
  ), e.submissionHandlers && oe(
4922
4942
  e.submissionHandlers,
4923
4943
  W.submissionHandlers,
4924
- Gr,
4944
+ Jr,
4925
4945
  e,
4926
4946
  n,
4927
4947
  t,
4928
4948
  r?.onConflict
4929
4949
  ), e.setup && e.setup(), Z.set(e.name, e);
4930
4950
  }
4931
- function xa(e, r = !1) {
4951
+ function Sa(e, r = !1) {
4932
4952
  const t = Z.get(e);
4933
4953
  if (!t) return !1;
4934
4954
  if (t.cleanup && t.cleanup(), r) {
@@ -4956,18 +4976,18 @@ function xa(e, r = !1) {
4956
4976
  }
4957
4977
  return Z.delete(e), !0;
4958
4978
  }
4959
- function wa(e) {
4979
+ function Ca(e) {
4960
4980
  return Z.get(e);
4961
4981
  }
4962
- function Sa() {
4982
+ function Na() {
4963
4983
  return Array.from(Z.values());
4964
4984
  }
4965
- function Ca(e) {
4985
+ function ka(e) {
4966
4986
  return Z.has(e);
4967
4987
  }
4968
- function Na(e) {
4988
+ function Ia(e) {
4969
4989
  for (const [r, t] of Object.entries(e))
4970
- Ur(r, t);
4990
+ Wr(r, t);
4971
4991
  }
4972
4992
  function ee(e) {
4973
4993
  return typeof e == "object" && e !== null;
@@ -4977,7 +4997,7 @@ function Te(e) {
4977
4997
  const r = e;
4978
4998
  return typeof r.name == "string" && typeof r.displayName == "string";
4979
4999
  }
4980
- function rt(e) {
5000
+ function tt(e) {
4981
5001
  if (!ee(e)) return !1;
4982
5002
  const r = e;
4983
5003
  return typeof r.name != "string" || typeof r.version != "string" || !Array.isArray(r.properties) ? !1 : r.properties.every((t) => Te(t));
@@ -4990,7 +5010,7 @@ function Ce(e) {
4990
5010
  return !!r && typeof r.name == "string" && typeof r.size == "number";
4991
5011
  }
4992
5012
  }
4993
- function ka(e, r, t = {}) {
5013
+ function Ea(e, r, t = {}) {
4994
5014
  try {
4995
5015
  const {
4996
5016
  includeMetadata: n = !1,
@@ -5005,7 +5025,7 @@ function ka(e, r, t = {}) {
5005
5025
  success: !1,
5006
5026
  error: "Instance must be a valid object"
5007
5027
  };
5008
- const d = [], m = [], u = {}, b = (rt(r) || ee(r) && Array.isArray(r.properties) ? r.properties : []).filter(Te), N = new Map(b.map((h) => [h.name, h]));
5028
+ const d = [], m = [], u = {}, b = (tt(r) || ee(r) && Array.isArray(r.properties) ? r.properties : []).filter(Te), C = new Map(b.map((h) => [h.name, h]));
5009
5029
  for (const [h, y] of Object.entries(e)) {
5010
5030
  if (s.includes(h)) {
5011
5031
  m.push(h);
@@ -5016,9 +5036,9 @@ function ka(e, r, t = {}) {
5016
5036
  continue;
5017
5037
  }
5018
5038
  if (y === void 0) continue;
5019
- const E = N.get(h);
5039
+ const E = C.get(h);
5020
5040
  try {
5021
- u[h] = ra(y, E, { dateFormat: a, fileHandling: o });
5041
+ u[h] = na(y, E, { dateFormat: a, fileHandling: o });
5022
5042
  } catch (F) {
5023
5043
  d.push(`Error serializing field '${h}': ${String(F)}`), u[h] = null;
5024
5044
  }
@@ -5044,7 +5064,7 @@ function ka(e, r, t = {}) {
5044
5064
  };
5045
5065
  }
5046
5066
  }
5047
- function ra(e, r, t = {}) {
5067
+ function na(e, r, t = {}) {
5048
5068
  const { dateFormat: n = "iso", fileHandling: a = "metadata" } = t;
5049
5069
  if (e == null)
5050
5070
  return null;
@@ -5114,7 +5134,7 @@ function tr(e, r) {
5114
5134
  _note: "Base64 encoding requires async implementation"
5115
5135
  };
5116
5136
  }
5117
- function Ia(e, r, t = {}) {
5137
+ function Ma(e, r, t = {}) {
5118
5138
  try {
5119
5139
  const {
5120
5140
  strict: n = !1,
@@ -5130,10 +5150,10 @@ function Ia(e, r, t = {}) {
5130
5150
  let s;
5131
5151
  try {
5132
5152
  s = JSON.parse(e);
5133
- } catch (C) {
5153
+ } catch (N) {
5134
5154
  return {
5135
5155
  success: !1,
5136
- error: `Invalid JSON: ${C instanceof Error ? C.message : "Unknown parsing error"}`
5156
+ error: `Invalid JSON: ${N instanceof Error ? N.message : "Unknown parsing error"}`
5137
5157
  };
5138
5158
  }
5139
5159
  if (!s || typeof s != "object")
@@ -5141,29 +5161,29 @@ function Ia(e, r, t = {}) {
5141
5161
  success: !1,
5142
5162
  error: "Parsed data must be an object"
5143
5163
  };
5144
- const i = [], d = [], m = {}, f = (rt(r) || ee(r) && Array.isArray(r.properties) ? r.properties : []).filter(Te), b = new Map(f.map((C) => [C.name, C]));
5145
- for (const C of f) {
5146
- const h = C.name, y = s[h];
5164
+ const i = [], d = [], m = {}, f = (tt(r) || ee(r) && Array.isArray(r.properties) ? r.properties : []).filter(Te), b = new Map(f.map((N) => [N.name, N]));
5165
+ for (const N of f) {
5166
+ const h = N.name, y = s[h];
5147
5167
  if (y === void 0) {
5148
- n && C.required && d.push(`Required field '${h}' is missing`);
5168
+ n && N.required && d.push(`Required field '${h}' is missing`);
5149
5169
  continue;
5150
5170
  }
5151
5171
  try {
5152
- m[h] = ta(y, C, { validateTypes: a, dateFormat: c });
5172
+ m[h] = aa(y, N, { validateTypes: a, dateFormat: c });
5153
5173
  } catch (E) {
5154
5174
  const F = `Error deserializing field '${h}': ${String(E)}`;
5155
5175
  n ? d.push(F) : (i.push(F), m[h] = y);
5156
5176
  }
5157
5177
  }
5158
5178
  if (o)
5159
- for (const [C, h] of Object.entries(s))
5160
- !b.has(C) && C !== "_metadata" && (n && i.push(`Unknown field '${C}' preserved`), m[C] = h);
5161
- const N = d.length > 0;
5179
+ for (const [N, h] of Object.entries(s))
5180
+ !b.has(N) && N !== "_metadata" && (n && i.push(`Unknown field '${N}' preserved`), m[N] = h);
5181
+ const C = d.length > 0;
5162
5182
  return {
5163
- success: !N,
5183
+ success: !C,
5164
5184
  data: m,
5165
5185
  warnings: i.length > 0 ? i : void 0,
5166
- validationErrors: N ? d : void 0
5186
+ validationErrors: C ? d : void 0
5167
5187
  };
5168
5188
  } catch (n) {
5169
5189
  return {
@@ -5172,7 +5192,7 @@ function Ia(e, r, t = {}) {
5172
5192
  };
5173
5193
  }
5174
5194
  }
5175
- function ta(e, r, t = {}) {
5195
+ function aa(e, r, t = {}) {
5176
5196
  const { validateTypes: n = !0, dateFormat: a = "auto" } = t;
5177
5197
  if (e == null)
5178
5198
  return e;
@@ -5181,7 +5201,7 @@ function ta(e, r, t = {}) {
5181
5201
  case "date":
5182
5202
  case "datetime":
5183
5203
  case "date-time":
5184
- return na(e, a, n);
5204
+ return oa(e, a, n);
5185
5205
  case "int":
5186
5206
  case "integer":
5187
5207
  return Ne(e, n);
@@ -5189,7 +5209,7 @@ function ta(e, r, t = {}) {
5189
5209
  case "number":
5190
5210
  return ke(e, n);
5191
5211
  case "boolean":
5192
- return aa(e, n);
5212
+ return ia(e, n);
5193
5213
  case "int-array":
5194
5214
  return nr(e, "integer", n);
5195
5215
  case "float-array":
@@ -5209,7 +5229,7 @@ function ta(e, r, t = {}) {
5209
5229
  return e;
5210
5230
  }
5211
5231
  }
5212
- function Ea(e, r = {}) {
5232
+ function Fa(e, r = {}) {
5213
5233
  try {
5214
5234
  const { prettify: t = !0, includeMetadata: n = !0 } = r;
5215
5235
  if (!e || typeof e != "object")
@@ -5238,7 +5258,7 @@ function Ea(e, r = {}) {
5238
5258
  };
5239
5259
  }
5240
5260
  }
5241
- function Ma(e, r = {}) {
5261
+ function $a(e, r = {}) {
5242
5262
  try {
5243
5263
  const { strict: t = !1, validateTypes: n = !0 } = r;
5244
5264
  let a;
@@ -5279,8 +5299,8 @@ function Ma(e, r = {}) {
5279
5299
  i ? a.properties = i.map((m, u) => {
5280
5300
  const f = ee(m) ? m : {}, b = { ...f };
5281
5301
  if (!f.name) {
5282
- const N = `Property at index ${u} missing 'name'`;
5283
- t ? c.push(N) : (o.push(`${N}, using 'field_${u}'`), b.name = `field_${u}`);
5302
+ const C = `Property at index ${u} missing 'name'`;
5303
+ t ? c.push(C) : (o.push(`${C}, using 'field_${u}'`), b.name = `field_${u}`);
5284
5304
  }
5285
5305
  return f.displayName || (b.displayName = f.name || `Field ${u}`), f.type || (t && n ? c.push(`Property '${f.name || u}' missing 'type'`) : (o.push(`Property '${f.name || u}' missing 'type', using 'string'`), b.type = "string")), f.defaultValue === void 0 && (b.defaultValue = null), f.required === void 0 && (b.required = !1), b;
5286
5306
  }) : t ? c.push("Properties must be an array") : (o.push("Properties not found or invalid, using empty array"), a.properties = []);
@@ -5298,7 +5318,7 @@ function Ma(e, r = {}) {
5298
5318
  };
5299
5319
  }
5300
5320
  }
5301
- function na(e, r, t) {
5321
+ function oa(e, r, t) {
5302
5322
  if (e instanceof Date)
5303
5323
  return e;
5304
5324
  if (typeof e == "number") {
@@ -5363,7 +5383,7 @@ function ke(e, r) {
5363
5383
  throw new Error(`Cannot convert ${typeof e} to number`);
5364
5384
  return e;
5365
5385
  }
5366
- function aa(e, r) {
5386
+ function ia(e, r) {
5367
5387
  if (typeof e == "boolean")
5368
5388
  return e;
5369
5389
  if (typeof e == "string") {
@@ -5397,55 +5417,55 @@ function nr(e, r, t) {
5397
5417
  }
5398
5418
  });
5399
5419
  }
5400
- function oa() {
5420
+ function sa() {
5401
5421
  if (!document.getElementById("reactaform-styles"))
5402
5422
  try {
5403
5423
  const e = document.createElement("style");
5404
- e.id = "reactaform-styles", e.textContent = st, document.head.appendChild(e);
5424
+ e.id = "reactaform-styles", e.textContent = ct, document.head.appendChild(e);
5405
5425
  } catch {
5406
5426
  }
5407
5427
  }
5408
- typeof document < "u" && oa();
5428
+ typeof document < "u" && sa();
5409
5429
  export {
5410
5430
  V as CSS_CLASSES,
5411
- ya as ReactaForm,
5412
- Yn as ReactaFormProvider,
5413
- pn as ReactaFormRenderer,
5431
+ xa as ReactaForm,
5432
+ Zn as ReactaFormProvider,
5433
+ hn as ReactaFormRenderer,
5414
5434
  O as StandardFieldLayout,
5415
- la as Units,
5435
+ ma as Units,
5416
5436
  U as combineClasses,
5417
- Zn as createInstanceFromDefinition,
5418
- Ma as deserializeDefinition,
5419
- Ia as deserializeInstance,
5420
- Sa as getAllPlugins,
5421
- Qt as getButtonHandler,
5422
- Wr as getComponent,
5423
- wa as getPlugin,
5424
- pa as getSupportedLanguages,
5425
- ma as hasButtonHandler,
5426
- Ca as hasPlugin,
5427
- oa as injectReactaFormStyles,
5437
+ ea as createInstanceFromDefinition,
5438
+ $a as deserializeDefinition,
5439
+ Ma as deserializeInstance,
5440
+ Na as getAllPlugins,
5441
+ rn as getButtonHandler,
5442
+ _r as getComponent,
5443
+ Ca as getPlugin,
5444
+ ha as getSupportedLanguages,
5445
+ fa as hasButtonHandler,
5446
+ ka as hasPlugin,
5447
+ sa as injectReactaFormStyles,
5428
5448
  ie as isDarkTheme,
5429
- fa as listButtonHandlers,
5430
- ha as loadInstance,
5431
- ga as loadJsonDefinition,
5432
- ua as registerButtonHandler,
5433
- Ur as registerComponent,
5434
- Na as registerComponents,
5435
- pt as registerFieldCustomValidationHandler,
5436
- gt as registerFieldTypeValidationHandler,
5437
- ft as registerFormValidationHandler,
5438
- va as registerPlugin,
5439
- Gr as registerSubmissionHandler,
5440
- Ea as serializeDefinition,
5441
- ka as serializeInstance,
5442
- da as unregisterButtonHandler,
5443
- xa as unregisterPlugin,
5444
- ba as upgradeInstanceToLatestDefinition,
5445
- ct as useDebouncedCallback,
5449
+ ga as listButtonHandlers,
5450
+ ya as loadInstance,
5451
+ ba as loadJsonDefinition,
5452
+ da as registerButtonHandler,
5453
+ Wr as registerComponent,
5454
+ Ia as registerComponents,
5455
+ gt as registerFieldCustomValidationHandler,
5456
+ ht as registerFieldTypeValidationHandler,
5457
+ pt as registerFormValidationHandler,
5458
+ wa as registerPlugin,
5459
+ Jr as registerSubmissionHandler,
5460
+ Fa as serializeDefinition,
5461
+ Ea as serializeInstance,
5462
+ pa as unregisterButtonHandler,
5463
+ Sa as unregisterPlugin,
5464
+ va as upgradeInstanceToLatestDefinition,
5465
+ lt as useDebouncedCallback,
5446
5466
  T as useFieldValidator,
5447
- H as useReactaFormContext,
5467
+ B as useReactaFormContext,
5448
5468
  _ as useUncontrolledValidatedInput,
5449
- ca as validateFieldValue,
5469
+ ua as validateFieldValue,
5450
5470
  fr as validateFieldWithCustomHandler
5451
5471
  };