@reformer/core 2.0.0-beta.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { d as y, w as u, E, r as U } from "./behaviors-2HSqHPb4.js";
2
- import { i as Ee } from "./behaviors-2HSqHPb4.js";
3
- import { i as C, a as D, A as j, V as q, T as K } from "./validators-gXoHPdqM.js";
4
- import { g as Se, c as we, d as Ae, v as Ve, b as ke } from "./validators-gXoHPdqM.js";
5
- import { V as H, B as W, c as R } from "./registry-helpers-BRxAr6nG.js";
6
- import { R as Oe, a as Fe, e as Pe, b as Ce, g as De, t as Re } from "./registry-helpers-BRxAr6nG.js";
1
+ import { d as y, w as u, E, r as U } from "./behaviors-DzYL8kY_.js";
2
+ import { i as Ee } from "./behaviors-DzYL8kY_.js";
3
+ import { i as T, a as R, A as j, V as q, T as K } from "./validators-gXoHPdqM.js";
4
+ import { g as be, c as Ve, d as we, v as Ae, b as ke } from "./validators-gXoHPdqM.js";
5
+ import { V as H, B as W, c as I } from "./registry-helpers-BRxAr6nG.js";
6
+ import { R as Fe, a as Oe, e as Pe, b as Te, g as Re, t as Ie } from "./registry-helpers-BRxAr6nG.js";
7
7
  import { v4 as z } from "uuid";
8
- import B, { useRef as L, useCallback as b } from "react";
9
- class F {
8
+ import B, { useRef as L, useCallback as S } from "react";
9
+ class O {
10
10
  // ============================================================================
11
11
  // Protected состояние (для Template Method паттерна)
12
12
  // ============================================================================
@@ -106,8 +106,8 @@ class F {
106
106
  if (e.params !== void 0) {
107
107
  if (!i.params)
108
108
  return !1;
109
- for (const [r, s] of Object.entries(e.params))
110
- if (i.params[r] !== s)
109
+ for (const [s, a] of Object.entries(e.params))
110
+ if (i.params[s] !== a)
111
111
  return !1;
112
112
  }
113
113
  return !(e.predicate !== void 0 && !e.predicate(i));
@@ -451,8 +451,8 @@ class P {
451
451
  this.clear();
452
452
  }
453
453
  }
454
- var A = /* @__PURE__ */ ((a) => (a.THROW = "throw", a.LOG = "log", a.CONVERT = "convert", a))(A || {});
455
- class O {
454
+ var w = /* @__PURE__ */ ((r) => (r.THROW = "throw", r.LOG = "log", r.CONVERT = "convert", r))(w || {});
455
+ class F {
456
456
  /**
457
457
  * Обработать ошибку согласно заданной стратегии
458
458
  *
@@ -493,7 +493,7 @@ class O {
493
493
  * ```
494
494
  */
495
495
  static handle(e, t, i = "throw") {
496
- const r = this.extractMessage(e);
496
+ const s = this.extractMessage(e);
497
497
  switch (i) {
498
498
  case "throw":
499
499
  throw e;
@@ -502,7 +502,7 @@ class O {
502
502
  case "convert":
503
503
  return {
504
504
  code: "validator_error",
505
- message: r,
505
+ message: s,
506
506
  params: { field: t }
507
507
  };
508
508
  }
@@ -584,7 +584,7 @@ class O {
584
584
  return typeof e == "object" && e !== null && "code" in e && "message" in e && typeof e.code == "string" && typeof e.message == "string";
585
585
  }
586
586
  }
587
- class J extends F {
587
+ class J extends O {
588
588
  // ============================================================================
589
589
  // Приватные сигналы
590
590
  // ============================================================================
@@ -618,7 +618,6 @@ class J extends F {
618
618
  updateOn;
619
619
  initialValue;
620
620
  currentValidationId = 0;
621
- currentAbortController;
622
621
  debounceMs;
623
622
  validateDebounceTimer;
624
623
  validateDebounceResolve;
@@ -645,12 +644,12 @@ class J extends F {
645
644
  setValue(e, t) {
646
645
  if (this._value.value = e, this._dirty.value = !0, t?.emitEvent === !1)
647
646
  return;
648
- const i = this.validators.length > 0 || this.asyncValidators.length > 0, r = this._errors.value.length > 0;
647
+ const i = this.validators.length > 0 || this.asyncValidators.length > 0, s = this._errors.value.length > 0;
649
648
  if (this.updateOn === "change") {
650
649
  this.validate();
651
650
  return;
652
651
  }
653
- r && i && this.validate();
652
+ s && i && this.validate();
654
653
  }
655
654
  patchValue(e) {
656
655
  this.setValue(e);
@@ -730,14 +729,14 @@ class J extends F {
730
729
  async validate(e) {
731
730
  const t = e?.debounce ?? this.debounceMs;
732
731
  return t > 0 && this.asyncValidators.length > 0 ? new Promise((i) => {
733
- const r = this.currentValidationId;
732
+ const s = this.currentValidationId;
734
733
  this.validateDebounceResolve && this.validateDebounceResolve(!1), this.validateDebounceTimer && clearTimeout(this.validateDebounceTimer), this.validateDebounceResolve = i, this.validateDebounceTimer = setTimeout(async () => {
735
- if (this.validateDebounceResolve = void 0, r !== this.currentValidationId) {
734
+ if (this.validateDebounceResolve = void 0, s !== this.currentValidationId) {
736
735
  i(!1);
737
736
  return;
738
737
  }
739
- const s = await this.validateImmediate();
740
- i(s);
738
+ const a = await this.validateImmediate();
739
+ i(a);
741
740
  }, t);
742
741
  }) : this.validateImmediate();
743
742
  }
@@ -745,64 +744,47 @@ class J extends F {
745
744
  * Немедленная валидация без debounce
746
745
  * @private
747
746
  * @remarks
748
- * Защищена от race conditions через AbortController:
749
- * - Отменяет предыдущую валидацию при запуске новой
750
- * - Передаёт AbortSignal в async валидаторы для отмены операций (например, fetch)
751
- * - Проверяет signal.aborted в ключевых точках
747
+ * Защищена от race conditions:
748
+ * - Проверка validationId после синхронной валидации
749
+ * - Проверка перед установкой pending
750
+ * - Проверка после Promise.all
751
+ * - Проверка перед обработкой async результатов
752
+ * - Проверка перед очисткой errors
752
753
  */
753
754
  async validateImmediate() {
754
- this.currentAbortController?.abort();
755
- const e = new AbortController();
756
- this.currentAbortController = e;
757
- const { signal: t } = e;
758
- ++this.currentValidationId;
759
- const i = [];
755
+ const e = ++this.currentValidationId, t = [];
760
756
  for (const s of this.validators) {
761
- const n = s(this._value.value);
762
- n && i.push(n);
757
+ const a = s(this._value.value);
758
+ a && t.push(a);
763
759
  }
764
- if (t.aborted)
760
+ if (e !== this.currentValidationId)
765
761
  return !1;
766
- if (i.length > 0)
767
- return this._errors.value = i, this._status.value = "invalid", !1;
762
+ if (t.length > 0)
763
+ return this._errors.value = t, this._status.value = "invalid", !1;
768
764
  if (this.asyncValidators.length > 0) {
769
- if (t.aborted)
765
+ if (e !== this.currentValidationId)
770
766
  return !1;
771
767
  this._pending.value = !0, this._status.value = "pending";
772
- try {
773
- const s = await Promise.all(
774
- this.asyncValidators.map(async (o) => {
775
- if (t.aborted)
776
- throw new DOMException("Validation aborted", "AbortError");
777
- try {
778
- const l = await o(this._value.value, { signal: t });
779
- if (t.aborted)
780
- throw new DOMException("Validation aborted", "AbortError");
781
- return l;
782
- } catch (l) {
783
- if (l instanceof DOMException && l.name === "AbortError")
784
- throw l;
785
- return O.handle(
786
- l,
787
- "FieldNode AsyncValidator",
788
- A.CONVERT
789
- );
790
- }
791
- })
792
- );
793
- if (t.aborted)
794
- return !1;
795
- this._pending.value = !1;
796
- const n = s.filter(Boolean);
797
- if (n.length > 0)
798
- return this._errors.value = n, this._status.value = "invalid", !1;
799
- } catch (s) {
800
- if (s instanceof DOMException && s.name === "AbortError")
801
- return !1;
802
- throw s;
803
- }
768
+ const s = await Promise.all(
769
+ this.asyncValidators.map(async (o) => {
770
+ try {
771
+ return await o(this._value.value);
772
+ } catch (n) {
773
+ return F.handle(
774
+ n,
775
+ "FieldNode AsyncValidator",
776
+ w.CONVERT
777
+ );
778
+ }
779
+ })
780
+ );
781
+ if (e !== this.currentValidationId || (this._pending.value = !1, e !== this.currentValidationId))
782
+ return !1;
783
+ const a = s.filter(Boolean);
784
+ if (a.length > 0)
785
+ return this._errors.value = a, this._status.value = "invalid", !1;
804
786
  }
805
- return t.aborted ? !1 : ((this.validators.length > 0 || this.asyncValidators.length > 0) && (this._errors.value = [], this._status.value = "valid"), this._errors.value.length === 0);
787
+ return e !== this.currentValidationId ? !1 : ((this.validators.length > 0 || this.asyncValidators.length > 0) && (this._errors.value = [], this._status.value = "valid"), this._errors.value.length === 0);
806
788
  }
807
789
  setErrors(e) {
808
790
  this._errors.value = e, this._status.value = e.length > 0 ? "invalid" : "valid";
@@ -915,8 +897,8 @@ class J extends F {
915
897
  */
916
898
  watch(e) {
917
899
  const t = E(() => {
918
- const r = this.value.value;
919
- e(r);
900
+ const s = this.value.value;
901
+ e(s);
920
902
  }), i = `watch-${Date.now()}-${Math.random()}`;
921
903
  return this.disposers.add(i, t);
922
904
  }
@@ -944,22 +926,15 @@ class J extends F {
944
926
  */
945
927
  computeFrom(e, t) {
946
928
  const i = E(() => {
947
- const s = e.map((o) => o.value), n = t(...s);
948
- this.setValue(n, { emitEvent: !1 });
949
- }), r = `computeFrom-${Date.now()}-${Math.random()}`;
950
- return this.disposers.add(r, i);
929
+ const a = e.map((n) => n.value), o = t(...a);
930
+ this.setValue(o, { emitEvent: !1 });
931
+ }), s = `computeFrom-${Date.now()}-${Math.random()}`;
932
+ return this.disposers.add(s, i);
951
933
  }
952
934
  /**
953
935
  * Очистить все ресурсы и таймеры
954
936
  * Должен вызываться при unmount компонента
955
937
  *
956
- * @remarks
957
- * Освобождает все ресурсы:
958
- * - Отписывает все subscriptions через SubscriptionManager
959
- * - Очищает debounce таймер
960
- * - Resolve'ит висячий debounce промис (предотвращает утечку памяти)
961
- * - Отменяет текущую async валидацию через AbortController
962
- *
963
938
  * @example
964
939
  * ```typescript
965
940
  * useEffect(() => {
@@ -970,7 +945,7 @@ class J extends F {
970
945
  * ```
971
946
  */
972
947
  dispose() {
973
- this.disposers.dispose(), this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0), this.validateDebounceResolve && (this.validateDebounceResolve(!1), this.validateDebounceResolve = void 0), this.currentAbortController && (this.currentAbortController.abort(), this.currentAbortController = void 0);
948
+ this.disposers.dispose(), this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0);
974
949
  }
975
950
  }
976
951
  class Y {
@@ -1004,12 +979,12 @@ class Y {
1004
979
  */
1005
980
  groupValidators(e) {
1006
981
  const t = /* @__PURE__ */ new Map(), i = [];
1007
- for (const r of e)
1008
- if (r.type === "tree")
1009
- i.push(r);
982
+ for (const s of e)
983
+ if (s.type === "tree")
984
+ i.push(s);
1010
985
  else {
1011
- const s = t.get(r.fieldPath) || [];
1012
- s.push(r), t.set(r.fieldPath, s);
986
+ const a = t.get(s.fieldPath) || [];
987
+ a.push(s), t.set(s.fieldPath, a);
1013
988
  }
1014
989
  return { validatorsByField: t, treeValidators: i };
1015
990
  }
@@ -1026,36 +1001,36 @@ class Y {
1026
1001
  */
1027
1002
  async applyFieldValidators(e) {
1028
1003
  for (const [t, i] of e) {
1029
- const r = this.form.getFieldByPath(t);
1030
- if (!r) {
1004
+ const s = this.form.getFieldByPath(t);
1005
+ if (!s) {
1031
1006
  console.warn(`Field ${t} not found in GroupNode`);
1032
1007
  continue;
1033
1008
  }
1034
- if (!C(r) && !D(r)) {
1009
+ if (!T(s) && !R(s)) {
1035
1010
  process.env.NODE_ENV !== "production" && console.warn(`Validation can only run on FieldNode or ArrayNode, skipping ${t}`);
1036
1011
  continue;
1037
1012
  }
1038
- const s = [];
1039
- let n;
1040
- if (D(r)) {
1041
- const o = r.getValue();
1042
- n = new j(this.form, t, o);
1013
+ const a = [];
1014
+ let o;
1015
+ if (R(s)) {
1016
+ const n = s.getValue();
1017
+ o = new j(this.form, t, n);
1043
1018
  } else
1044
- n = new q(this.form, t, r);
1045
- for (const o of i)
1046
- if (!(o.condition && !this.checkCondition(o.condition)))
1019
+ o = new q(this.form, t, s);
1020
+ for (const n of i)
1021
+ if (!(n.condition && !this.checkCondition(n.condition)))
1047
1022
  try {
1048
1023
  let l = null;
1049
- const d = n.value(), m = o.validator;
1050
- o.type === "sync" ? l = m(d, n) : o.type === "async" && (l = await m(d, n)), l && s.push(l);
1024
+ const d = o.value(), m = n.validator;
1025
+ n.type === "sync" ? l = m(d, o) : n.type === "async" && (l = await m(d, o)), l && a.push(l);
1051
1026
  } catch (l) {
1052
- O.handle(
1027
+ F.handle(
1053
1028
  l,
1054
1029
  `ValidationApplicator: validator for ${t}`,
1055
- A.LOG
1030
+ w.LOG
1056
1031
  );
1057
1032
  }
1058
- s.length > 0 ? r.setErrors(s) : r.clearErrors();
1033
+ a.length > 0 ? s.setErrors(a) : s.errors.value.length > 0 && !s.errors.value.some((n) => n.code !== "contextual") && s.clearErrors();
1059
1034
  }
1060
1035
  }
1061
1036
  /**
@@ -1073,19 +1048,19 @@ class Y {
1073
1048
  try {
1074
1049
  if (t.type !== "tree")
1075
1050
  continue;
1076
- const r = t.validator(i);
1077
- if (r && t.options && "targetField" in t.options) {
1078
- const s = t.options.targetField;
1079
- if (s) {
1080
- const n = this.form.getFieldByPath(String(s));
1081
- if (n && C(n)) {
1082
- const o = n.errors.value;
1083
- n.setErrors([...o, r]);
1051
+ const s = t.validator(i);
1052
+ if (s && t.options && "targetField" in t.options) {
1053
+ const a = t.options.targetField;
1054
+ if (a) {
1055
+ const o = this.form.getFieldByPath(String(a));
1056
+ if (o && T(o)) {
1057
+ const n = o.errors.value;
1058
+ o.setErrors([...n, s]);
1084
1059
  }
1085
1060
  }
1086
1061
  }
1087
- } catch (r) {
1088
- O.handle(r, "ValidationApplicator: tree validator", A.LOG);
1062
+ } catch (s) {
1063
+ F.handle(s, "ValidationApplicator: tree validator", w.LOG);
1089
1064
  }
1090
1065
  }
1091
1066
  }
@@ -1133,10 +1108,10 @@ class Q {
1133
1108
  */
1134
1109
  parsePath(e) {
1135
1110
  const t = [];
1136
- let i = "", r = !1;
1137
- for (let s = 0; s < e.length; s++) {
1138
- const n = e[s];
1139
- n === "[" ? (r = !0, i += n) : n === "]" ? (r = !1, i += n) : n === "." && !r ? i && (this.addSegment(t, i), i = "") : i += n;
1111
+ let i = "", s = !1;
1112
+ for (let a = 0; a < e.length; a++) {
1113
+ const o = e[a];
1114
+ o === "[" ? (s = !0, i += o) : o === "]" ? (s = !1, i += o) : o === "." && !s ? i && (this.addSegment(t, i), i = "") : i += o;
1140
1115
  }
1141
1116
  return i && this.addSegment(t, i), t;
1142
1117
  }
@@ -1184,15 +1159,15 @@ class Q {
1184
1159
  */
1185
1160
  getValueByPath(e, t) {
1186
1161
  const i = this.parsePath(t);
1187
- let r = e;
1188
- for (const s of i) {
1189
- if (r == null) return;
1190
- if (r = r[s.key], s.index !== void 0) {
1191
- if (!Array.isArray(r)) return;
1192
- r = r[s.index];
1162
+ let s = e;
1163
+ for (const a of i) {
1164
+ if (s == null) return;
1165
+ if (s = s[a.key], a.index !== void 0) {
1166
+ if (!Array.isArray(s)) return;
1167
+ s = s[a.index];
1193
1168
  }
1194
1169
  }
1195
- return r;
1170
+ return s;
1196
1171
  }
1197
1172
  /**
1198
1173
  * Устанавливает значение по пути в объекте (мутирует объект)
@@ -1222,30 +1197,30 @@ class Q {
1222
1197
  * ```
1223
1198
  */
1224
1199
  setValueByPath(e, t, i) {
1225
- const r = this.parsePath(t);
1226
- if (r.length === 0)
1200
+ const s = this.parsePath(t);
1201
+ if (s.length === 0)
1227
1202
  throw new Error("Cannot set value: empty path");
1228
- let s = e;
1229
- for (let o = 0; o < r.length - 1; o++) {
1230
- const l = r[o];
1231
- let d = s[l.key];
1203
+ let a = e;
1204
+ for (let n = 0; n < s.length - 1; n++) {
1205
+ const l = s[n];
1206
+ let d = a[l.key];
1232
1207
  if (l.index !== void 0) {
1233
1208
  if (!Array.isArray(d))
1234
1209
  throw new Error(`Expected array at path segment: ${l.key}, but got ${typeof d}`);
1235
- s = d[l.index];
1210
+ a = d[l.index];
1236
1211
  } else
1237
- d == null && (s[l.key] = {}, d = s[l.key]), s = d;
1212
+ d == null && (a[l.key] = {}, d = a[l.key]), a = d;
1238
1213
  }
1239
- const n = r[r.length - 1];
1240
- if (n.index !== void 0) {
1241
- const o = s[n.key];
1242
- if (!Array.isArray(o))
1214
+ const o = s[s.length - 1];
1215
+ if (o.index !== void 0) {
1216
+ const n = a[o.key];
1217
+ if (!Array.isArray(n))
1243
1218
  throw new Error(
1244
- `Expected array at path segment: ${n.key}, but got ${typeof o}`
1219
+ `Expected array at path segment: ${o.key}, but got ${typeof n}`
1245
1220
  );
1246
- o[n.index] = i;
1221
+ n[o.index] = i;
1247
1222
  } else
1248
- s[n.key] = i;
1223
+ a[o.key] = i;
1249
1224
  }
1250
1225
  /**
1251
1226
  * Получить значение из FormNode по пути
@@ -1343,35 +1318,35 @@ class Q {
1343
1318
  */
1344
1319
  getNodeByPath(e, t) {
1345
1320
  const i = this.parsePath(t);
1346
- let r = e;
1347
- for (const s of i) {
1348
- if (r == null) return null;
1349
- const n = r;
1350
- if (n.fields && n.fields instanceof Map) {
1351
- if (r = n.fields.get(s.key), s.index === void 0) {
1352
- if (r == null) return null;
1321
+ let s = e;
1322
+ for (const a of i) {
1323
+ if (s == null) return null;
1324
+ const o = s;
1325
+ if (o.fields && o.fields instanceof Map) {
1326
+ if (s = o.fields.get(a.key), a.index === void 0) {
1327
+ if (s == null) return null;
1353
1328
  continue;
1354
1329
  }
1355
- } else if (s.index !== void 0 && n.items) {
1356
- const o = n.items.value || n.items;
1357
- if (!Array.isArray(o) || (r = o[s.index], r == null)) return null;
1330
+ } else if (a.index !== void 0 && o.items) {
1331
+ const n = o.items.value || o.items;
1332
+ if (!Array.isArray(n) || (s = n[a.index], s == null)) return null;
1358
1333
  continue;
1359
- } else if (s.index === void 0) {
1360
- if (r = n[s.key], r == null) return null;
1334
+ } else if (a.index === void 0) {
1335
+ if (s = o[a.key], s == null) return null;
1361
1336
  continue;
1362
1337
  }
1363
- if (r && s.index !== void 0 && r.items) {
1364
- const o = r.items.value || r.items;
1365
- if (!Array.isArray(o)) return null;
1366
- r = o[s.index];
1367
- } else if (r && s.index !== void 0 && !r.items)
1338
+ if (s && a.index !== void 0 && s.items) {
1339
+ const n = s.items.value || s.items;
1340
+ if (!Array.isArray(n)) return null;
1341
+ s = n[a.index];
1342
+ } else if (s && a.index !== void 0 && !s.items)
1368
1343
  return null;
1369
- if (r == null) return null;
1344
+ if (s == null) return null;
1370
1345
  }
1371
- return r;
1346
+ return s;
1372
1347
  }
1373
1348
  }
1374
- class S extends F {
1349
+ class b extends O {
1375
1350
  // ============================================================================
1376
1351
  // Приватные поля
1377
1352
  // ============================================================================
@@ -1432,30 +1407,30 @@ class S extends F {
1432
1407
  submitting;
1433
1408
  constructor(e) {
1434
1409
  super();
1435
- const t = "form" in e, i = t ? e.form : e, r = t ? e.behavior : void 0, s = t ? e.validation : void 0;
1436
- for (const [o, l] of Object.entries(i)) {
1410
+ const t = "form" in e, i = t ? e.form : e, s = t ? e.behavior : void 0, a = t ? e.validation : void 0;
1411
+ for (const [n, l] of Object.entries(i)) {
1437
1412
  const d = this.createNode(l);
1438
- this._fields.set(o, d);
1413
+ this._fields.set(n, d);
1439
1414
  }
1440
1415
  this.value = u(() => {
1441
- const o = {};
1416
+ const n = {};
1442
1417
  return this._fields.forEach((l, d) => {
1443
- o[d] = l.value.value;
1444
- }), o;
1445
- }), this.valid = u(() => this._formErrors.value.length > 0 ? !1 : Array.from(this._fields.values()).every((o) => o.valid.value)), this.invalid = u(() => !this.valid.value), this.pending = u(
1446
- () => Array.from(this._fields.values()).some((o) => o.pending.value)
1418
+ n[d] = l.value.value;
1419
+ }), n;
1420
+ }), this.valid = u(() => this._formErrors.value.length > 0 ? !1 : Array.from(this._fields.values()).every((n) => n.valid.value)), this.invalid = u(() => !this.valid.value), this.pending = u(
1421
+ () => Array.from(this._fields.values()).some((n) => n.pending.value)
1447
1422
  ), this.touched = u(
1448
- () => Array.from(this._fields.values()).some((o) => o.touched.value)
1423
+ () => Array.from(this._fields.values()).some((n) => n.touched.value)
1449
1424
  ), this.dirty = u(
1450
- () => Array.from(this._fields.values()).some((o) => o.dirty.value)
1425
+ () => Array.from(this._fields.values()).some((n) => n.dirty.value)
1451
1426
  ), this.errors = u(() => {
1452
- const o = [...this._formErrors.value];
1427
+ const n = [...this._formErrors.value];
1453
1428
  return this._fields.forEach((l) => {
1454
- o.push(...l.errors.value);
1455
- }), o;
1429
+ n.push(...l.errors.value);
1430
+ }), n;
1456
1431
  }), this.status = u(() => this._disabled.value ? "disabled" : this.pending.value ? "pending" : this.invalid.value ? "invalid" : "valid"), this.submitting = u(() => this._submitting.value);
1457
- const n = this.buildProxy();
1458
- return this._proxyInstance = n, r && this.applyBehaviorSchema(r), s && this.applyValidationSchema(s), n;
1432
+ const o = this.buildProxy();
1433
+ return this._proxyInstance = o, s && this.applyBehaviorSchema(s), a && this.applyValidationSchema(a), o;
1459
1434
  }
1460
1435
  // ============================================================================
1461
1436
  // Приватный метод для создания Proxy (inline из ProxyBuilder)
@@ -1472,11 +1447,11 @@ class S extends F {
1472
1447
  if (typeof i == "string" && e._fields.has(i))
1473
1448
  return e._fields.get(i);
1474
1449
  },
1475
- set: (t, i, r) => typeof i == "string" && e._fields.has(i) ? !1 : (t[i] = r, !0),
1450
+ set: (t, i, s) => typeof i == "string" && e._fields.has(i) ? !1 : (t[i] = s, !0),
1476
1451
  has: (t, i) => typeof i == "string" && e._fields.has(i) ? !0 : i in t,
1477
1452
  ownKeys: (t) => {
1478
- const i = Reflect.ownKeys(t), r = Array.from(e._fields.keys());
1479
- return [.../* @__PURE__ */ new Set([...i, ...r])];
1453
+ const i = Reflect.ownKeys(t), s = Array.from(e._fields.keys());
1454
+ return [.../* @__PURE__ */ new Set([...i, ...s])];
1480
1455
  },
1481
1456
  getOwnPropertyDescriptor: (t, i) => typeof i == "string" && e._fields.has(i) ? { enumerable: !0, configurable: !0 } : Reflect.getOwnPropertyDescriptor(t, i)
1482
1457
  });
@@ -1491,16 +1466,16 @@ class S extends F {
1491
1466
  }), e;
1492
1467
  }
1493
1468
  setValue(e, t) {
1494
- for (const [i, r] of Object.entries(e)) {
1495
- const s = this._fields.get(i);
1496
- s && s.setValue(r, t);
1469
+ for (const [i, s] of Object.entries(e)) {
1470
+ const a = this._fields.get(i);
1471
+ a && a.setValue(s, t);
1497
1472
  }
1498
1473
  }
1499
1474
  patchValue(e) {
1500
1475
  U(() => {
1501
1476
  for (const [t, i] of Object.entries(e)) {
1502
- const r = this._fields.get(t);
1503
- r && i !== void 0 && r.setValue(i);
1477
+ const s = this._fields.get(t);
1478
+ s && i !== void 0 && s.setValue(i);
1504
1479
  }
1505
1480
  });
1506
1481
  }
@@ -1523,8 +1498,8 @@ class S extends F {
1523
1498
  */
1524
1499
  reset(e) {
1525
1500
  this._fields.forEach((t, i) => {
1526
- const r = e?.[i];
1527
- t.reset(r);
1501
+ const s = e?.[i];
1502
+ t.reset(s);
1528
1503
  });
1529
1504
  }
1530
1505
  /**
@@ -1639,7 +1614,7 @@ class S extends F {
1639
1614
  applyValidationSchema(e) {
1640
1615
  this.validationRegistry.beginRegistration();
1641
1616
  try {
1642
- const t = R();
1617
+ const t = I();
1643
1618
  e(t);
1644
1619
  const i = this.getProxy();
1645
1620
  this.validationRegistry.endRegistration(i);
@@ -1654,7 +1629,7 @@ class S extends F {
1654
1629
  applyBehaviorSchema(e) {
1655
1630
  this.behaviorRegistry.beginRegistration();
1656
1631
  try {
1657
- const t = R();
1632
+ const t = I();
1658
1633
  return e(t), this.behaviorRegistry.endRegistration(this.getProxy()).cleanup;
1659
1634
  } catch (t) {
1660
1635
  throw console.error("Error applying behavior schema:", t), t;
@@ -1696,13 +1671,13 @@ class S extends F {
1696
1671
  if (t.length === 0)
1697
1672
  return;
1698
1673
  let i = this;
1699
- for (const r of t) {
1700
- if (!(i instanceof S) || (i = i.getField(r.key), !i)) return;
1701
- if (r.index !== void 0)
1674
+ for (const s of t) {
1675
+ if (!(i instanceof b) || (i = i.getField(s.key), !i)) return;
1676
+ if (s.index !== void 0)
1702
1677
  if ("at" in i && "length" in i && typeof i.at == "function") {
1703
- const s = i.at(r.index);
1704
- if (!s) return;
1705
- i = s;
1678
+ const a = i.at(s.index);
1679
+ if (!a) return;
1680
+ i = a;
1706
1681
  } else
1707
1682
  return;
1708
1683
  }
@@ -1751,15 +1726,15 @@ class S extends F {
1751
1726
  * Связывает два поля: при изменении source автоматически обновляется target
1752
1727
  */
1753
1728
  linkFields(e, t, i) {
1754
- const r = this._fields.get(e), s = this._fields.get(t);
1755
- if (!r || !s)
1729
+ const s = this._fields.get(e), a = this._fields.get(t);
1730
+ if (!s || !a)
1756
1731
  return () => {
1757
1732
  };
1758
- const n = E(() => {
1759
- const l = r.value.value, d = i ? i(l) : l;
1760
- s.setValue(d, { emitEvent: !1 });
1761
- }), o = `linkFields-${Date.now()}-${Math.random()}`;
1762
- return this.disposers.add(o, n);
1733
+ const o = E(() => {
1734
+ const l = s.value.value, d = i ? i(l) : l;
1735
+ a.setValue(d, { emitEvent: !1 });
1736
+ }), n = `linkFields-${Date.now()}-${Math.random()}`;
1737
+ return this.disposers.add(n, o);
1763
1738
  }
1764
1739
  /**
1765
1740
  * Подписка на изменения вложенного поля по строковому пути
@@ -1793,11 +1768,11 @@ class S extends F {
1793
1768
  if (!i)
1794
1769
  return () => {
1795
1770
  };
1796
- const r = E(() => {
1797
- const n = i.value.value;
1798
- t(n);
1799
- }), s = `watchField-${Date.now()}-${Math.random()}`;
1800
- return this.disposers.add(s, r);
1771
+ const s = E(() => {
1772
+ const o = i.value.value;
1773
+ t(o);
1774
+ }), a = `watchField-${Date.now()}-${Math.random()}`;
1775
+ return this.disposers.add(a, s);
1801
1776
  }
1802
1777
  /**
1803
1778
  * Hook: вызывается после disable()
@@ -1820,7 +1795,7 @@ class S extends F {
1820
1795
  });
1821
1796
  }
1822
1797
  }
1823
- class T extends F {
1798
+ class C extends O {
1824
1799
  // ============================================================================
1825
1800
  // Приватные поля
1826
1801
  // ============================================================================
@@ -1858,8 +1833,8 @@ class T extends F {
1858
1833
  this.push(i);
1859
1834
  this.length = u(() => this.items.value.length), this.value = u(() => this.items.value.map((i) => i.value.value)), this.valid = u(() => this.items.value.every((i) => i.valid.value)), this.invalid = u(() => !this.valid.value), this.pending = u(() => this.items.value.some((i) => i.pending.value)), this.touched = u(() => this.items.value.some((i) => i.touched.value)), this.dirty = u(() => this.items.value.some((i) => i.dirty.value)), this.errors = u(() => {
1860
1835
  const i = [];
1861
- return this.items.value.forEach((r) => {
1862
- i.push(...r.errors.value);
1836
+ return this.items.value.forEach((s) => {
1837
+ i.push(...s.errors.value);
1863
1838
  }), i;
1864
1839
  }), this.status = u(() => this.pending.value ? "pending" : this.invalid.value ? "invalid" : "valid");
1865
1840
  }
@@ -1889,8 +1864,8 @@ class T extends F {
1889
1864
  insert(e, t) {
1890
1865
  if (e < 0 || e > this.items.value.length)
1891
1866
  return;
1892
- const i = this.createItem(t), r = [...this.items.value];
1893
- r.splice(e, 0, i), this.items.value = r;
1867
+ const i = this.createItem(t), s = [...this.items.value];
1868
+ s.splice(e, 0, i), this.items.value = s;
1894
1869
  }
1895
1870
  /**
1896
1871
  * Удалить все элементы массива
@@ -2044,7 +2019,7 @@ class T extends F {
2044
2019
  */
2045
2020
  createItem(e) {
2046
2021
  if (this.isGroupSchema(this.itemSchema)) {
2047
- const t = new S(this.itemSchema);
2022
+ const t = new b(this.itemSchema);
2048
2023
  return e && t.patchValue(e), this.validationSchemaFn && "applyValidationSchema" in t && t.applyValidationSchema(this.validationSchemaFn), this.behaviorSchemaFn && "applyBehaviorSchema" in t && t.applyBehaviorSchema(this.behaviorSchemaFn), t;
2049
2024
  }
2050
2025
  throw new Error(
@@ -2132,13 +2107,13 @@ class T extends F {
2132
2107
  */
2133
2108
  watchItems(e, t) {
2134
2109
  const i = E(() => {
2135
- const s = this.items.value.map((n) => {
2136
- if (n instanceof S)
2137
- return n.getFieldByPath(e)?.value.value;
2110
+ const a = this.items.value.map((o) => {
2111
+ if (o instanceof b)
2112
+ return o.getFieldByPath(e)?.value.value;
2138
2113
  });
2139
- t(s);
2140
- }), r = `watchItems-${Date.now()}-${Math.random()}`;
2141
- return this.disposers.add(r, i);
2114
+ t(a);
2115
+ }), s = `watchItems-${Date.now()}-${Math.random()}`;
2116
+ return this.disposers.add(s, i);
2142
2117
  }
2143
2118
  /**
2144
2119
  * Подписка на изменение длины массива
@@ -2164,8 +2139,8 @@ class T extends F {
2164
2139
  */
2165
2140
  watchLength(e) {
2166
2141
  const t = E(() => {
2167
- const r = this.length.value;
2168
- e(r);
2142
+ const s = this.length.value;
2143
+ e(s);
2169
2144
  }), i = `watchLength-${Date.now()}-${Math.random()}`;
2170
2145
  return this.disposers.add(i, t);
2171
2146
  }
@@ -2283,13 +2258,13 @@ class X {
2283
2258
  return new J(e);
2284
2259
  if (this.isArrayConfig(e)) {
2285
2260
  const t = e;
2286
- return new T(
2261
+ return new C(
2287
2262
  t.schema,
2288
2263
  t.initialItems
2289
2264
  );
2290
2265
  }
2291
2266
  if (this.isGroupConfig(e))
2292
- return new S(e);
2267
+ return new b(e);
2293
2268
  throw new Error(
2294
2269
  `NodeFactory: Unknown node config. Expected FieldConfig, GroupConfig, or ArrayConfig, but got: ${JSON.stringify(
2295
2270
  e
@@ -2323,11 +2298,11 @@ class X {
2323
2298
  */
2324
2299
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2325
2300
  createArrayNodeFromArray(e) {
2326
- const [t, ...i] = e, r = [];
2327
- this.isGroupConfig(t) && r.push(this.extractValues(t));
2328
- for (const s of i)
2329
- this.isGroupConfig(s) ? r.push(this.extractValues(s)) : r.push(s);
2330
- return new T(t, r);
2301
+ const [t, ...i] = e, s = [];
2302
+ this.isGroupConfig(t) && s.push(this.extractValues(t));
2303
+ for (const a of i)
2304
+ this.isGroupConfig(a) ? s.push(this.extractValues(a)) : s.push(a);
2305
+ return new C(t, s);
2331
2306
  }
2332
2307
  /**
2333
2308
  * Извлечь значения из схемы (рекурсивно)
@@ -2365,8 +2340,8 @@ class X {
2365
2340
  return e.map((t) => this.extractValues(t));
2366
2341
  if (this.isGroupConfig(e)) {
2367
2342
  const t = {};
2368
- for (const [i, r] of Object.entries(e))
2369
- t[i] = this.extractValues(r);
2343
+ for (const [i, s] of Object.entries(e))
2344
+ t[i] = this.extractValues(s);
2370
2345
  return t;
2371
2346
  }
2372
2347
  return e;
@@ -2496,10 +2471,10 @@ class fe {
2496
2471
  }
2497
2472
  this.timer = setTimeout(async () => {
2498
2473
  try {
2499
- const r = await e();
2500
- t(r);
2501
- } catch (r) {
2502
- i(r);
2474
+ const s = await e();
2475
+ t(s);
2476
+ } catch (s) {
2477
+ i(s);
2503
2478
  }
2504
2479
  }, this.delay);
2505
2480
  });
@@ -2571,25 +2546,25 @@ class fe {
2571
2546
  return this.timer !== void 0;
2572
2547
  }
2573
2548
  }
2574
- function ve(a) {
2575
- return new S(a);
2549
+ function ve(r) {
2550
+ return new b(r);
2576
2551
  }
2577
- function Z(a) {
2552
+ function Z(r) {
2578
2553
  return {
2579
2554
  type: "static",
2580
2555
  load: async () => ({
2581
- items: a,
2582
- totalCount: a.length
2556
+ items: r,
2557
+ totalCount: r.length
2583
2558
  })
2584
2559
  };
2585
2560
  }
2586
- function ee(a) {
2561
+ function ee(r) {
2587
2562
  let e = null;
2588
2563
  return {
2589
2564
  type: "preload",
2590
2565
  load: async (t) => {
2591
2566
  if (!e) {
2592
- const i = await a(t);
2567
+ const i = await r(t);
2593
2568
  e = {
2594
2569
  items: i,
2595
2570
  totalCount: i.length
@@ -2599,11 +2574,11 @@ function ee(a) {
2599
2574
  }
2600
2575
  };
2601
2576
  }
2602
- function te(a) {
2577
+ function te(r) {
2603
2578
  return {
2604
2579
  type: "partial",
2605
2580
  load: async (e) => {
2606
- const t = await a(e);
2581
+ const t = await r(e);
2607
2582
  return {
2608
2583
  items: t,
2609
2584
  totalCount: t.length
@@ -2617,31 +2592,31 @@ const pe = {
2617
2592
  preload: ee,
2618
2593
  partial: te
2619
2594
  };
2620
- var w = { exports: {} }, k = {};
2621
- var M;
2595
+ var V = { exports: {} }, k = {};
2596
+ var D;
2622
2597
  function ie() {
2623
- if (M) return k;
2624
- M = 1;
2625
- var a = B;
2598
+ if (D) return k;
2599
+ D = 1;
2600
+ var r = B;
2626
2601
  function e(c, f) {
2627
2602
  return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
2628
2603
  }
2629
- var t = typeof Object.is == "function" ? Object.is : e, i = a.useState, r = a.useEffect, s = a.useLayoutEffect, n = a.useDebugValue;
2630
- function o(c, f) {
2604
+ var t = typeof Object.is == "function" ? Object.is : e, i = r.useState, s = r.useEffect, a = r.useLayoutEffect, o = r.useDebugValue;
2605
+ function n(c, f) {
2631
2606
  var h = f(), v = i({ inst: { value: h, getSnapshot: f } }), p = v[0].inst, g = v[1];
2632
- return s(
2607
+ return a(
2633
2608
  function() {
2634
2609
  p.value = h, p.getSnapshot = f, l(p) && g({ inst: p });
2635
2610
  },
2636
2611
  [c, h, f]
2637
- ), r(
2612
+ ), s(
2638
2613
  function() {
2639
2614
  return l(p) && g({ inst: p }), c(function() {
2640
2615
  l(p) && g({ inst: p });
2641
2616
  });
2642
2617
  },
2643
2618
  [c]
2644
- ), n(h), h;
2619
+ ), o(h), h;
2645
2620
  }
2646
2621
  function l(c) {
2647
2622
  var f = c.getSnapshot;
@@ -2656,40 +2631,40 @@ function ie() {
2656
2631
  function d(c, f) {
2657
2632
  return f();
2658
2633
  }
2659
- var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : o;
2660
- return k.useSyncExternalStore = a.useSyncExternalStore !== void 0 ? a.useSyncExternalStore : m, k;
2634
+ var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : n;
2635
+ return k.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : m, k;
2661
2636
  }
2662
2637
  var x = {};
2663
- var I;
2664
- function re() {
2665
- return I || (I = 1, process.env.NODE_ENV !== "production" && (function() {
2666
- function a(h, v) {
2638
+ var N;
2639
+ function se() {
2640
+ return N || (N = 1, process.env.NODE_ENV !== "production" && (function() {
2641
+ function r(h, v) {
2667
2642
  return h === v && (h !== 0 || 1 / h === 1 / v) || h !== h && v !== v;
2668
2643
  }
2669
2644
  function e(h, v) {
2670
- m || r.startTransition === void 0 || (m = !0, console.error(
2645
+ m || s.startTransition === void 0 || (m = !0, console.error(
2671
2646
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
2672
2647
  ));
2673
2648
  var p = v();
2674
2649
  if (!c) {
2675
2650
  var g = v();
2676
- s(p, g) || (console.error(
2651
+ a(p, g) || (console.error(
2677
2652
  "The result of getSnapshot should be cached to avoid an infinite loop"
2678
2653
  ), c = !0);
2679
2654
  }
2680
- g = n({
2655
+ g = o({
2681
2656
  inst: { value: p, getSnapshot: v }
2682
2657
  });
2683
- var _ = g[0].inst, V = g[1];
2658
+ var _ = g[0].inst, A = g[1];
2684
2659
  return l(
2685
2660
  function() {
2686
- _.value = p, _.getSnapshot = v, t(_) && V({ inst: _ });
2661
+ _.value = p, _.getSnapshot = v, t(_) && A({ inst: _ });
2687
2662
  },
2688
2663
  [h, p, v]
2689
- ), o(
2664
+ ), n(
2690
2665
  function() {
2691
- return t(_) && V({ inst: _ }), h(function() {
2692
- t(_) && V({ inst: _ });
2666
+ return t(_) && A({ inst: _ }), h(function() {
2667
+ t(_) && A({ inst: _ });
2693
2668
  });
2694
2669
  },
2695
2670
  [h]
@@ -2700,7 +2675,7 @@ function re() {
2700
2675
  h = h.value;
2701
2676
  try {
2702
2677
  var p = v();
2703
- return !s(h, p);
2678
+ return !a(h, p);
2704
2679
  } catch {
2705
2680
  return !0;
2706
2681
  }
@@ -2709,51 +2684,51 @@ function re() {
2709
2684
  return v();
2710
2685
  }
2711
2686
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
2712
- var r = B, s = typeof Object.is == "function" ? Object.is : a, n = r.useState, o = r.useEffect, l = r.useLayoutEffect, d = r.useDebugValue, m = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? i : e;
2713
- x.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2687
+ var s = B, a = typeof Object.is == "function" ? Object.is : r, o = s.useState, n = s.useEffect, l = s.useLayoutEffect, d = s.useDebugValue, m = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? i : e;
2688
+ x.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2714
2689
  })()), x;
2715
2690
  }
2716
- var N;
2717
- function se() {
2718
- return N || (N = 1, process.env.NODE_ENV === "production" ? w.exports = ie() : w.exports = re()), w.exports;
2691
+ var M;
2692
+ function re() {
2693
+ return M || (M = 1, process.env.NODE_ENV === "production" ? V.exports = ie() : V.exports = se()), V.exports;
2719
2694
  }
2720
- var $ = se();
2721
- function ae(a, e) {
2722
- if (a === e) return !0;
2723
- if (a.length !== e.length) return !1;
2724
- for (let t = 0; t < a.length; t++)
2725
- if (a[t] !== e[t]) return !1;
2695
+ var $ = re();
2696
+ function ae(r, e) {
2697
+ if (r === e) return !0;
2698
+ if (r.length !== e.length) return !1;
2699
+ for (let t = 0; t < r.length; t++)
2700
+ if (r[t] !== e[t]) return !1;
2726
2701
  return !0;
2727
2702
  }
2728
- function G(a, e, t) {
2703
+ function G(r, e, t) {
2729
2704
  const i = L(null);
2730
2705
  if (i.current === null) {
2731
- const n = {};
2732
- for (const o in a)
2733
- n[o] = a[o].value;
2734
- i.current = { ...n, __snapshot: null };
2735
- }
2736
- const r = b(
2737
- (n) => {
2738
- let o = !0;
2706
+ const o = {};
2707
+ for (const n in r)
2708
+ o[n] = r[n].value;
2709
+ i.current = { ...o, __snapshot: null };
2710
+ }
2711
+ const s = S(
2712
+ (o) => {
2713
+ let n = !0;
2739
2714
  return E(() => {
2740
- for (const d in a)
2741
- a[d].value;
2742
- if (o) {
2743
- o = !1;
2715
+ for (const d in r)
2716
+ r[d].value;
2717
+ if (n) {
2718
+ n = !1;
2744
2719
  return;
2745
2720
  }
2746
- n();
2721
+ o();
2747
2722
  });
2748
2723
  },
2749
- [a]
2750
- ), s = b(() => {
2751
- const n = i.current, o = {};
2752
- for (const d in a)
2753
- o[d] = a[d].value;
2724
+ [r]
2725
+ ), a = S(() => {
2726
+ const o = i.current, n = {};
2727
+ for (const d in r)
2728
+ n[d] = r[d].value;
2754
2729
  let l = !1;
2755
2730
  for (const d of e) {
2756
- const { key: m, useShallowArrayEqual: c } = d, f = o[m], h = n[m];
2731
+ const { key: m, useShallowArrayEqual: c } = d, f = n[m], h = o[m];
2757
2732
  if (c) {
2758
2733
  if (!ae(h, f)) {
2759
2734
  l = !0;
@@ -2764,25 +2739,25 @@ function G(a, e, t) {
2764
2739
  break;
2765
2740
  }
2766
2741
  }
2767
- if (!l && n.__snapshot)
2768
- return n.__snapshot;
2769
- for (const d in a)
2770
- n[d] = o[d];
2771
- return n.__snapshot = t(o), n.__snapshot;
2772
- }, [a, t]);
2773
- return $.useSyncExternalStore(r, s, s);
2742
+ if (!l && o.__snapshot)
2743
+ return o.__snapshot;
2744
+ for (const d in r)
2745
+ o[d] = n[d];
2746
+ return o.__snapshot = t(n), o.__snapshot;
2747
+ }, [r, t]);
2748
+ return $.useSyncExternalStore(s, a, a);
2774
2749
  }
2775
- function ne(a) {
2750
+ function ne(r) {
2776
2751
  const e = {
2777
- value: a.value,
2778
- disabled: a.disabled,
2779
- errors: a.errors,
2780
- pending: a.pending,
2781
- valid: a.valid,
2782
- invalid: a.invalid,
2783
- touched: a.touched,
2784
- shouldShowError: a.shouldShowError,
2785
- componentProps: a.componentProps
2752
+ value: r.value,
2753
+ disabled: r.disabled,
2754
+ errors: r.errors,
2755
+ pending: r.pending,
2756
+ valid: r.valid,
2757
+ invalid: r.invalid,
2758
+ touched: r.touched,
2759
+ shouldShowError: r.shouldShowError,
2760
+ componentProps: r.componentProps
2786
2761
  }, t = [
2787
2762
  { key: "value" },
2788
2763
  { key: "disabled" },
@@ -2793,32 +2768,32 @@ function ne(a) {
2793
2768
  { key: "touched" },
2794
2769
  { key: "shouldShowError" },
2795
2770
  { key: "componentProps" }
2796
- ], i = b(
2797
- (r) => ({
2798
- value: r.value,
2799
- pending: r.pending,
2800
- disabled: r.disabled,
2801
- errors: r.errors,
2802
- valid: r.valid,
2803
- invalid: r.invalid,
2804
- touched: r.touched,
2805
- shouldShowError: r.shouldShowError,
2806
- componentProps: r.componentProps
2771
+ ], i = S(
2772
+ (s) => ({
2773
+ value: s.value,
2774
+ pending: s.pending,
2775
+ disabled: s.disabled,
2776
+ errors: s.errors,
2777
+ valid: s.valid,
2778
+ invalid: s.invalid,
2779
+ touched: s.touched,
2780
+ shouldShowError: s.shouldShowError,
2781
+ componentProps: s.componentProps
2807
2782
  }),
2808
2783
  []
2809
2784
  );
2810
2785
  return G(e, t, i);
2811
2786
  }
2812
- function oe(a) {
2787
+ function oe(r) {
2813
2788
  const e = {
2814
- value: a.value,
2815
- length: a.length,
2816
- errors: a.errors,
2817
- pending: a.pending,
2818
- valid: a.valid,
2819
- invalid: a.invalid,
2820
- touched: a.touched,
2821
- dirty: a.dirty
2789
+ value: r.value,
2790
+ length: r.length,
2791
+ errors: r.errors,
2792
+ pending: r.pending,
2793
+ valid: r.valid,
2794
+ invalid: r.invalid,
2795
+ touched: r.touched,
2796
+ dirty: r.dirty
2822
2797
  }, t = [
2823
2798
  { key: "value" },
2824
2799
  { key: "length" },
@@ -2828,24 +2803,24 @@ function oe(a) {
2828
2803
  { key: "invalid" },
2829
2804
  { key: "touched" },
2830
2805
  { key: "dirty" }
2831
- ], i = b(
2832
- (r) => ({
2833
- value: r.value,
2834
- length: r.length,
2835
- pending: r.pending,
2836
- errors: r.errors,
2837
- valid: r.valid,
2838
- invalid: r.invalid,
2839
- touched: r.touched,
2840
- dirty: r.dirty
2806
+ ], i = S(
2807
+ (s) => ({
2808
+ value: s.value,
2809
+ length: s.length,
2810
+ pending: s.pending,
2811
+ errors: s.errors,
2812
+ valid: s.valid,
2813
+ invalid: s.invalid,
2814
+ touched: s.touched,
2815
+ dirty: s.dirty
2841
2816
  }),
2842
2817
  []
2843
2818
  );
2844
2819
  return G(e, t, i);
2845
2820
  }
2846
- function ye(a) {
2847
- const e = a && "length" in a && "map" in a;
2848
- return a ? e ? oe(a) : ne(a) : {
2821
+ function ye(r) {
2822
+ const e = r && "length" in r && "map" in r;
2823
+ return r ? e ? oe(r) : ne(r) : {
2849
2824
  value: [],
2850
2825
  length: 0,
2851
2826
  pending: !1,
@@ -2856,56 +2831,56 @@ function ye(a) {
2856
2831
  dirty: !1
2857
2832
  };
2858
2833
  }
2859
- function me(a) {
2860
- const e = L({ value: a.value.value }), t = b(
2861
- (r) => {
2862
- let s = !0;
2834
+ function me(r) {
2835
+ const e = L({ value: r.value.value }), t = S(
2836
+ (s) => {
2837
+ let a = !0;
2863
2838
  return E(() => {
2864
- if (a.value.value, s) {
2865
- s = !1;
2839
+ if (r.value.value, a) {
2840
+ a = !1;
2866
2841
  return;
2867
2842
  }
2868
- r();
2843
+ s();
2869
2844
  });
2870
2845
  },
2871
- [a]
2872
- ), i = b(() => {
2873
- const r = a.value.value;
2874
- return e.current.value === r ? e.current.value : (e.current.value = r, r);
2875
- }, [a]);
2846
+ [r]
2847
+ ), i = S(() => {
2848
+ const s = r.value.value;
2849
+ return e.current.value === s ? e.current.value : (e.current.value = s, s);
2850
+ }, [r]);
2876
2851
  return $.useSyncExternalStore(t, i, i);
2877
2852
  }
2878
2853
  export {
2879
- T as ArrayNode,
2854
+ C as ArrayNode,
2880
2855
  fe as Debouncer,
2881
- A as ErrorStrategy,
2856
+ w as ErrorStrategy,
2882
2857
  J as FieldNode,
2883
2858
  Q as FieldPathNavigator,
2884
- O as FormErrorHandler,
2885
- F as FormNode,
2886
- S as GroupNode,
2859
+ F as FormErrorHandler,
2860
+ O as FormNode,
2861
+ b as GroupNode,
2887
2862
  X as NodeFactory,
2888
- Oe as RegistryStack,
2863
+ Fe as RegistryStack,
2889
2864
  pe as Resources,
2890
2865
  P as SubscriptionManager,
2891
2866
  Ee as behaviors,
2892
- R as createFieldPath,
2867
+ I as createFieldPath,
2893
2868
  ve as createForm,
2894
- Fe as extractKey,
2869
+ Oe as extractKey,
2895
2870
  Pe as extractPath,
2896
- Ce as getCurrentBehaviorRegistry,
2897
- De as getCurrentValidationRegistry,
2898
- Se as getNodeType,
2899
- D as isArrayNode,
2900
- C as isFieldNode,
2901
- we as isFormNode,
2902
- Ae as isGroupNode,
2871
+ Te as getCurrentBehaviorRegistry,
2872
+ Re as getCurrentValidationRegistry,
2873
+ be as getNodeType,
2874
+ R as isArrayNode,
2875
+ T as isFieldNode,
2876
+ Ve as isFormNode,
2877
+ we as isGroupNode,
2903
2878
  te as partialResource,
2904
2879
  ee as preloadResource,
2905
2880
  Z as staticResource,
2906
- Re as toFieldPath,
2881
+ Ie as toFieldPath,
2907
2882
  ye as useFormControl,
2908
2883
  me as useFormControlValue,
2909
- Ve as validateForm,
2884
+ Ae as validateForm,
2910
2885
  ke as validators
2911
2886
  };