stone-kit 0.0.236 → 0.0.239

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,63 +1,64 @@
1
- import { jsx as W, jsxs as Se } from "react/jsx-runtime";
2
- import { I as xt } from "../../../index-DB-VhohW.js";
3
- import { M as Vt } from "../../../Modal-G1ISsPJt.js";
4
- import { Flex as Ft } from "../../Flex/ui/Flex.js";
5
- import { Input as je } from "../../Input/ui/Input.js";
6
- import I from "react";
1
+ import { jsx as N, jsxs as Se } from "react/jsx-runtime";
2
+ import { I as xt } from "../../../index-CbZmuQco.js";
3
+ import { M as Vt } from "../../../Modal-258KOiTO.js";
4
+ import { Flex as At } from "../../Flex/ui/Flex.js";
5
+ import { Input as Ee } from "../../Input/ui/Input.js";
6
+ import P from "react";
7
7
  import { Button as Ke } from "../../Button/ui/Button.js";
8
- import { NewIcon as At } from "../../NewIcon/ui/NewIcon.js";
9
- import { phoneReg as wt, nameReg as pt } from "../utils/reg.js";
8
+ import { NewIcon as Ft } from "../../NewIcon/ui/NewIcon.js";
9
+ import { phoneReg as wt, nameReg as pt, emailReg as Dt } from "../utils/reg.js";
10
10
  import { CheckBox as Ge } from "../../CheckBox/CheckBox.js";
11
- const Dt = "_btn_m4eyd_1", kt = "_modal_m4eyd_9", St = "_modalBody_m4eyd_16", Et = "_root_m4eyd_21", Ct = "_title_m4eyd_31", Bt = "_description_m4eyd_38", Tt = "_inputWrapper_m4eyd_45", X = {
12
- btn: Dt,
13
- modal: kt,
14
- modalBody: St,
15
- root: Et,
16
- title: Ct,
17
- description: Bt,
18
- inputWrapper: Tt
11
+ import { TextArea as kt } from "../../TextArea/TextArea.js";
12
+ const St = "_btn_m4eyd_1", Et = "_modal_m4eyd_9", Ct = "_modalBody_m4eyd_16", Bt = "_root_m4eyd_21", Tt = "_title_m4eyd_31", Rt = "_description_m4eyd_38", Lt = "_inputWrapper_m4eyd_45", X = {
13
+ btn: St,
14
+ modal: Et,
15
+ modalBody: Ct,
16
+ root: Bt,
17
+ title: Tt,
18
+ description: Rt,
19
+ inputWrapper: Lt
19
20
  };
20
- var ye = (e) => e.type === "checkbox", ae = (e) => e instanceof Date, B = (e) => e == null;
21
- const nt = (e) => typeof e == "object";
22
- var S = (e) => !B(e) && !Array.isArray(e) && nt(e) && !ae(e), Rt = (e) => S(e) && e.target ? ye(e.target) ? e.target.checked : e.target.value : e, Lt = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Mt = (e, s) => e.has(Lt(s)), Ot = (e) => {
21
+ var he = (e) => e.type === "checkbox", ue = (e) => e instanceof Date, B = (e) => e == null;
22
+ const at = (e) => typeof e == "object";
23
+ var S = (e) => !B(e) && !Array.isArray(e) && at(e) && !ue(e), Mt = (e) => S(e) && e.target ? he(e.target) ? e.target.checked : e.target.value : e, Ot = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Nt = (e, s) => e.has(Ot(s)), Ut = (e) => {
23
24
  const s = e.constructor && e.constructor.prototype;
24
25
  return S(s) && s.hasOwnProperty("isPrototypeOf");
25
- }, Te = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
26
- function U(e) {
26
+ }, Re = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
27
+ function q(e) {
27
28
  let s;
28
29
  const r = Array.isArray(e);
29
30
  if (e instanceof Date)
30
31
  s = new Date(e);
31
32
  else if (e instanceof Set)
32
33
  s = new Set(e);
33
- else if (!(Te && (e instanceof Blob || e instanceof FileList)) && (r || S(e)))
34
- if (s = r ? [] : {}, !r && !Ot(e))
34
+ else if (!(Re && (e instanceof Blob || e instanceof FileList)) && (r || S(e)))
35
+ if (s = r ? [] : {}, !r && !Ut(e))
35
36
  s = e;
36
37
  else
37
- for (const l in e)
38
- e.hasOwnProperty(l) && (s[l] = U(e[l]));
38
+ for (const n in e)
39
+ e.hasOwnProperty(n) && (s[n] = q(e[n]));
39
40
  else
40
41
  return e;
41
42
  return s;
42
43
  }
43
- var Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], A = (e) => e === void 0, d = (e, s, r) => {
44
+ var Fe = (e) => Array.isArray(e) ? e.filter(Boolean) : [], w = (e) => e === void 0, f = (e, s, r) => {
44
45
  if (!s || !S(e))
45
46
  return r;
46
- const l = Ae(s.split(/[,[\].]+?/)).reduce((u, a) => B(u) ? u : u[a], e);
47
- return A(l) || l === e ? A(e[s]) ? r : e[s] : l;
48
- }, Y = (e) => typeof e == "boolean", Re = (e) => /^\w*$/.test(e), at = (e) => Ae(e.replace(/["|']|\]/g, "").split(/\.|\[/)), V = (e, s, r) => {
49
- let l = -1;
50
- const u = Re(s) ? [s] : at(s), a = u.length, y = a - 1;
51
- for (; ++l < a; ) {
52
- const g = u[l];
53
- let R = r;
54
- if (l !== y) {
47
+ const n = Fe(s.split(/[,[\].]+?/)).reduce((u, l) => B(u) ? u : u[l], e);
48
+ return w(n) || n === e ? w(e[s]) ? r : e[s] : n;
49
+ }, Y = (e) => typeof e == "boolean", Le = (e) => /^\w*$/.test(e), lt = (e) => Fe(e.replace(/["|']|\]/g, "").split(/\.|\[/)), A = (e, s, r) => {
50
+ let n = -1;
51
+ const u = Le(s) ? [s] : lt(s), l = u.length, y = l - 1;
52
+ for (; ++n < l; ) {
53
+ const g = u[n];
54
+ let L = r;
55
+ if (n !== y) {
55
56
  const M = e[g];
56
- R = S(M) || Array.isArray(M) ? M : isNaN(+u[l + 1]) ? {} : [];
57
+ L = S(M) || Array.isArray(M) ? M : isNaN(+u[n + 1]) ? {} : [];
57
58
  }
58
59
  if (g === "__proto__")
59
60
  return;
60
- e[g] = R, e = e[g];
61
+ e[g] = L, e = e[g];
61
62
  }
62
63
  return e;
63
64
  };
@@ -65,13 +66,13 @@ const Je = {
65
66
  BLUR: "blur",
66
67
  FOCUS_OUT: "focusout",
67
68
  CHANGE: "change"
68
- }, H = {
69
+ }, $ = {
69
70
  onBlur: "onBlur",
70
71
  onChange: "onChange",
71
72
  onSubmit: "onSubmit",
72
73
  onTouched: "onTouched",
73
74
  all: "all"
74
- }, Q = {
75
+ }, J = {
75
76
  max: "max",
76
77
  min: "min",
77
78
  maxLength: "maxLength",
@@ -80,27 +81,27 @@ const Je = {
80
81
  required: "required",
81
82
  validate: "validate"
82
83
  };
83
- I.createContext(null);
84
- var Nt = (e, s, r, l = !0) => {
84
+ P.createContext(null);
85
+ var It = (e, s, r, n = !0) => {
85
86
  const u = {
86
87
  defaultValues: s._defaultValues
87
88
  };
88
- for (const a in e)
89
- Object.defineProperty(u, a, {
89
+ for (const l in e)
90
+ Object.defineProperty(u, l, {
90
91
  get: () => {
91
- const y = a;
92
- return s._proxyFormState[y] !== H.all && (s._proxyFormState[y] = !l || H.all), e[y];
92
+ const y = l;
93
+ return s._proxyFormState[y] !== $.all && (s._proxyFormState[y] = !n || $.all), e[y];
93
94
  }
94
95
  });
95
96
  return u;
96
- }, T = (e) => S(e) && !Object.keys(e).length, Ut = (e, s, r, l) => {
97
+ }, R = (e) => S(e) && !Object.keys(e).length, qt = (e, s, r, n) => {
97
98
  r(e);
98
- const { name: u, ...a } = e;
99
- return T(a) || Object.keys(a).length >= Object.keys(s).length || Object.keys(a).find((y) => s[y] === H.all);
99
+ const { name: u, ...l } = e;
100
+ return R(l) || Object.keys(l).length >= Object.keys(s).length || Object.keys(l).find((y) => s[y] === $.all);
100
101
  }, _e = (e) => Array.isArray(e) ? e : [e];
101
- function It(e) {
102
- const s = I.useRef(e);
103
- s.current = e, I.useEffect(() => {
102
+ function Pt(e) {
103
+ const s = P.useRef(e);
104
+ s.current = e, P.useEffect(() => {
104
105
  const r = !e.disabled && s.current.subject && s.current.subject.subscribe({
105
106
  next: s.current.next
106
107
  });
@@ -109,49 +110,49 @@ function It(e) {
109
110
  };
110
111
  }, [e.disabled]);
111
112
  }
112
- var K = (e) => typeof e == "string", Pt = (e, s, r, l, u) => K(e) ? (l && s.watch.add(e), d(r, e, u)) : Array.isArray(e) ? e.map((a) => (l && s.watch.add(a), d(r, a))) : (l && (s.watchAll = !0), r), qt = (e, s, r, l, u) => s ? {
113
+ var G = (e) => typeof e == "string", Wt = (e, s, r, n, u) => G(e) ? (n && s.watch.add(e), f(r, e, u)) : Array.isArray(e) ? e.map((l) => (n && s.watch.add(l), f(r, l))) : (n && (s.watchAll = !0), r), Ht = (e, s, r, n, u) => s ? {
113
114
  ...r[e],
114
115
  types: {
115
116
  ...r[e] && r[e].types ? r[e].types : {},
116
- [l]: u || !0
117
+ [n]: u || !0
117
118
  }
118
119
  } : {}, Qe = (e) => ({
119
- isOnSubmit: !e || e === H.onSubmit,
120
- isOnBlur: e === H.onBlur,
121
- isOnChange: e === H.onChange,
122
- isOnAll: e === H.all,
123
- isOnTouch: e === H.onTouched
124
- }), Xe = (e, s, r) => !r && (s.watchAll || s.watch.has(e) || [...s.watch].some((l) => e.startsWith(l) && /^\.\w+/.test(e.slice(l.length))));
125
- const de = (e, s, r, l) => {
120
+ isOnSubmit: !e || e === $.onSubmit,
121
+ isOnBlur: e === $.onBlur,
122
+ isOnChange: e === $.onChange,
123
+ isOnAll: e === $.all,
124
+ isOnTouch: e === $.onTouched
125
+ }), Xe = (e, s, r) => !r && (s.watchAll || s.watch.has(e) || [...s.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
126
+ const ye = (e, s, r, n) => {
126
127
  for (const u of r || Object.keys(e)) {
127
- const a = d(e, u);
128
- if (a) {
129
- const { _f: y, ...g } = a;
128
+ const l = f(e, u);
129
+ if (l) {
130
+ const { _f: y, ...g } = l;
130
131
  if (y) {
131
- if (y.refs && y.refs[0] && s(y.refs[0], u) && !l)
132
+ if (y.refs && y.refs[0] && s(y.refs[0], u) && !n)
132
133
  break;
133
- if (y.ref && s(y.ref, y.name) && !l)
134
+ if (y.ref && s(y.ref, y.name) && !n)
134
135
  break;
135
- de(g, s);
136
+ ye(g, s);
136
137
  } else
137
- S(g) && de(g, s);
138
+ S(g) && ye(g, s);
138
139
  }
139
140
  }
140
141
  };
141
- var Wt = (e, s, r) => {
142
- const l = _e(d(e, r));
143
- return V(l, "root", s[r]), V(e, r, l), e;
144
- }, Le = (e) => e.type === "file", Z = (e) => typeof e == "function", be = (e) => {
145
- if (!Te)
142
+ var zt = (e, s, r) => {
143
+ const n = _e(f(e, r));
144
+ return A(n, "root", s[r]), A(e, r, n), e;
145
+ }, Me = (e) => e.type === "file", Z = (e) => typeof e == "function", be = (e) => {
146
+ if (!Re)
146
147
  return !1;
147
148
  const s = e ? e.ownerDocument : 0;
148
149
  return e instanceof (s && s.defaultView ? s.defaultView.HTMLElement : HTMLElement);
149
- }, me = (e) => K(e), Me = (e) => e.type === "radio", xe = (e) => e instanceof RegExp;
150
+ }, me = (e) => G(e), Oe = (e) => e.type === "radio", xe = (e) => e instanceof RegExp;
150
151
  const Ye = {
151
152
  value: !1,
152
153
  isValid: !1
153
154
  }, Ze = { value: !0, isValid: !0 };
154
- var lt = (e) => {
155
+ var nt = (e) => {
155
156
  if (Array.isArray(e)) {
156
157
  if (e.length > 1) {
157
158
  const s = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
@@ -159,7 +160,7 @@ var lt = (e) => {
159
160
  }
160
161
  return e[0].checked && !e[0].disabled ? (
161
162
  // @ts-expect-error expected to work in the browser
162
- e[0].attributes && !A(e[0].attributes.value) ? A(e[0].value) || e[0].value === "" ? Ze : { value: e[0].value, isValid: !0 } : Ze
163
+ e[0].attributes && !w(e[0].attributes.value) ? w(e[0].value) || e[0].value === "" ? Ze : { value: e[0].value, isValid: !0 } : Ze
163
164
  ) : Ye;
164
165
  }
165
166
  return Ye;
@@ -183,198 +184,198 @@ function tt(e, s, r = "validate") {
183
184
  var ne = (e) => S(e) && !xe(e) ? e : {
184
185
  value: e,
185
186
  message: ""
186
- }, rt = async (e, s, r, l, u) => {
187
- const { ref: a, refs: y, required: g, maxLength: R, minLength: M, min: F, max: v, pattern: G, validate: z, name: C, valueAsNumber: le, mount: $, disabled: j } = e._f, m = d(s, C);
188
- if (!$ || j)
187
+ }, rt = async (e, s, r, n, u) => {
188
+ const { ref: l, refs: y, required: g, maxLength: L, minLength: M, min: V, max: v, pattern: re, validate: j, name: C, valueAsNumber: se, mount: T, disabled: K } = e._f, m = f(s, C);
189
+ if (!T || K)
189
190
  return {};
190
- const P = y ? y[0] : a, J = (_) => {
191
- l && P.reportValidity && (P.setCustomValidity(Y(_) ? "" : _ || ""), P.reportValidity());
192
- }, p = {}, re = Me(a), he = ye(a), ee = re || he, se = (le || Le(a)) && A(a.value) && A(m) || be(a) && a.value === "" || m === "" || Array.isArray(m) && !m.length, O = qt.bind(null, C, r, p), ge = (_, b, D, E = Q.maxLength, q = Q.minLength) => {
193
- const N = _ ? b : D;
194
- p[C] = {
195
- type: _ ? E : q,
196
- message: N,
197
- ref: a,
198
- ...O(_ ? E : q, N)
191
+ const W = y ? y[0] : l, H = (_) => {
192
+ n && W.reportValidity && (W.setCustomValidity(Y(_) ? "" : _ || ""), W.reportValidity());
193
+ }, F = {}, Q = Oe(l), ie = he(l), ee = Q || ie, ae = (se || Me(l)) && w(l.value) && w(m) || be(l) && l.value === "" || m === "" || Array.isArray(m) && !m.length, U = Ht.bind(null, C, r, F), ge = (_, b, D, E = J.maxLength, z = J.minLength) => {
194
+ const I = _ ? b : D;
195
+ F[C] = {
196
+ type: _ ? E : z,
197
+ message: I,
198
+ ref: l,
199
+ ...U(_ ? E : z, I)
199
200
  };
200
201
  };
201
- if (u ? !Array.isArray(m) || !m.length : g && (!ee && (se || B(m)) || Y(m) && !m || he && !lt(y).isValid || re && !ut(y).isValid)) {
202
+ if (u ? !Array.isArray(m) || !m.length : g && (!ee && (ae || B(m)) || Y(m) && !m || ie && !nt(y).isValid || Q && !ut(y).isValid)) {
202
203
  const { value: _, message: b } = me(g) ? { value: !!g, message: g } : ne(g);
203
- if (_ && (p[C] = {
204
- type: Q.required,
204
+ if (_ && (F[C] = {
205
+ type: J.required,
205
206
  message: b,
206
- ref: P,
207
- ...O(Q.required, b)
207
+ ref: W,
208
+ ...U(J.required, b)
208
209
  }, !r))
209
- return J(b), p;
210
+ return H(b), F;
210
211
  }
211
- if (!se && (!B(F) || !B(v))) {
212
+ if (!ae && (!B(V) || !B(v))) {
212
213
  let _, b;
213
- const D = ne(v), E = ne(F);
214
+ const D = ne(v), E = ne(V);
214
215
  if (!B(m) && !isNaN(m)) {
215
- const q = a.valueAsNumber || m && +m;
216
- B(D.value) || (_ = q > D.value), B(E.value) || (b = q < E.value);
216
+ const z = l.valueAsNumber || m && +m;
217
+ B(D.value) || (_ = z > D.value), B(E.value) || (b = z < E.value);
217
218
  } else {
218
- const q = a.valueAsDate || new Date(m), N = (ce) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ce), ue = a.type == "time", oe = a.type == "week";
219
- K(D.value) && m && (_ = ue ? N(m) > N(D.value) : oe ? m > D.value : q > new Date(D.value)), K(E.value) && m && (b = ue ? N(m) < N(E.value) : oe ? m < E.value : q < new Date(E.value));
219
+ const z = l.valueAsDate || new Date(m), I = (de) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + de), oe = l.type == "time", ce = l.type == "week";
220
+ G(D.value) && m && (_ = oe ? I(m) > I(D.value) : ce ? m > D.value : z > new Date(D.value)), G(E.value) && m && (b = oe ? I(m) < I(E.value) : ce ? m < E.value : z < new Date(E.value));
220
221
  }
221
- if ((_ || b) && (ge(!!_, D.message, E.message, Q.max, Q.min), !r))
222
- return J(p[C].message), p;
222
+ if ((_ || b) && (ge(!!_, D.message, E.message, J.max, J.min), !r))
223
+ return H(F[C].message), F;
223
224
  }
224
- if ((R || M) && !se && (K(m) || u && Array.isArray(m))) {
225
- const _ = ne(R), b = ne(M), D = !B(_.value) && m.length > +_.value, E = !B(b.value) && m.length < +b.value;
225
+ if ((L || M) && !ae && (G(m) || u && Array.isArray(m))) {
226
+ const _ = ne(L), b = ne(M), D = !B(_.value) && m.length > +_.value, E = !B(b.value) && m.length < +b.value;
226
227
  if ((D || E) && (ge(D, _.message, b.message), !r))
227
- return J(p[C].message), p;
228
+ return H(F[C].message), F;
228
229
  }
229
- if (G && !se && K(m)) {
230
- const { value: _, message: b } = ne(G);
231
- if (xe(_) && !m.match(_) && (p[C] = {
232
- type: Q.pattern,
230
+ if (re && !ae && G(m)) {
231
+ const { value: _, message: b } = ne(re);
232
+ if (xe(_) && !m.match(_) && (F[C] = {
233
+ type: J.pattern,
233
234
  message: b,
234
- ref: a,
235
- ...O(Q.pattern, b)
235
+ ref: l,
236
+ ...U(J.pattern, b)
236
237
  }, !r))
237
- return J(b), p;
238
+ return H(b), F;
238
239
  }
239
- if (z) {
240
- if (Z(z)) {
241
- const _ = await z(m, s), b = tt(_, P);
242
- if (b && (p[C] = {
240
+ if (j) {
241
+ if (Z(j)) {
242
+ const _ = await j(m, s), b = tt(_, W);
243
+ if (b && (F[C] = {
243
244
  ...b,
244
- ...O(Q.validate, b.message)
245
+ ...U(J.validate, b.message)
245
246
  }, !r))
246
- return J(b.message), p;
247
- } else if (S(z)) {
247
+ return H(b.message), F;
248
+ } else if (S(j)) {
248
249
  let _ = {};
249
- for (const b in z) {
250
- if (!T(_) && !r)
250
+ for (const b in j) {
251
+ if (!R(_) && !r)
251
252
  break;
252
- const D = tt(await z[b](m, s), P, b);
253
+ const D = tt(await j[b](m, s), W, b);
253
254
  D && (_ = {
254
255
  ...D,
255
- ...O(b, D.message)
256
- }, J(D.message), r && (p[C] = _));
256
+ ...U(b, D.message)
257
+ }, H(D.message), r && (F[C] = _));
257
258
  }
258
- if (!T(_) && (p[C] = {
259
- ref: P,
259
+ if (!R(_) && (F[C] = {
260
+ ref: W,
260
261
  ..._
261
262
  }, !r))
262
- return p;
263
+ return F;
263
264
  }
264
265
  }
265
- return J(!0), p;
266
+ return H(!0), F;
266
267
  };
267
- function Ht(e, s) {
268
+ function $t(e, s) {
268
269
  const r = s.slice(0, -1).length;
269
- let l = 0;
270
- for (; l < r; )
271
- e = A(e) ? l++ : e[s[l++]];
270
+ let n = 0;
271
+ for (; n < r; )
272
+ e = w(e) ? n++ : e[s[n++]];
272
273
  return e;
273
274
  }
274
- function zt(e) {
275
+ function jt(e) {
275
276
  for (const s in e)
276
- if (e.hasOwnProperty(s) && !A(e[s]))
277
+ if (e.hasOwnProperty(s) && !w(e[s]))
277
278
  return !1;
278
279
  return !0;
279
280
  }
280
281
  function k(e, s) {
281
- const r = Array.isArray(s) ? s : Re(s) ? [s] : at(s), l = r.length === 1 ? e : Ht(e, r), u = r.length - 1, a = r[u];
282
- return l && delete l[a], u !== 0 && (S(l) && T(l) || Array.isArray(l) && zt(l)) && k(e, r.slice(0, -1)), e;
282
+ const r = Array.isArray(s) ? s : Le(s) ? [s] : lt(s), n = r.length === 1 ? e : $t(e, r), u = r.length - 1, l = r[u];
283
+ return n && delete n[l], u !== 0 && (S(n) && R(n) || Array.isArray(n) && jt(n)) && k(e, r.slice(0, -1)), e;
283
284
  }
284
- var Ee = () => {
285
+ var Ce = () => {
285
286
  let e = [];
286
287
  return {
287
288
  get observers() {
288
289
  return e;
289
290
  },
290
291
  next: (u) => {
291
- for (const a of e)
292
- a.next && a.next(u);
292
+ for (const l of e)
293
+ l.next && l.next(u);
293
294
  },
294
295
  subscribe: (u) => (e.push(u), {
295
296
  unsubscribe: () => {
296
- e = e.filter((a) => a !== u);
297
+ e = e.filter((l) => l !== u);
297
298
  }
298
299
  }),
299
300
  unsubscribe: () => {
300
301
  e = [];
301
302
  }
302
303
  };
303
- }, Ve = (e) => B(e) || !nt(e);
304
+ }, Ve = (e) => B(e) || !at(e);
304
305
  function te(e, s) {
305
306
  if (Ve(e) || Ve(s))
306
307
  return e === s;
307
- if (ae(e) && ae(s))
308
+ if (ue(e) && ue(s))
308
309
  return e.getTime() === s.getTime();
309
- const r = Object.keys(e), l = Object.keys(s);
310
- if (r.length !== l.length)
310
+ const r = Object.keys(e), n = Object.keys(s);
311
+ if (r.length !== n.length)
311
312
  return !1;
312
313
  for (const u of r) {
313
- const a = e[u];
314
- if (!l.includes(u))
314
+ const l = e[u];
315
+ if (!n.includes(u))
315
316
  return !1;
316
317
  if (u !== "ref") {
317
318
  const y = s[u];
318
- if (ae(a) && ae(y) || S(a) && S(y) || Array.isArray(a) && Array.isArray(y) ? !te(a, y) : a !== y)
319
+ if (ue(l) && ue(y) || S(l) && S(y) || Array.isArray(l) && Array.isArray(y) ? !te(l, y) : l !== y)
319
320
  return !1;
320
321
  }
321
322
  }
322
323
  return !0;
323
324
  }
324
- var ot = (e) => e.type === "select-multiple", $t = (e) => Me(e) || ye(e), Ce = (e) => be(e) && e.isConnected, ct = (e) => {
325
+ var ot = (e) => e.type === "select-multiple", Kt = (e) => Oe(e) || he(e), Be = (e) => be(e) && e.isConnected, ct = (e) => {
325
326
  for (const s in e)
326
327
  if (Z(e[s]))
327
328
  return !0;
328
329
  return !1;
329
330
  };
330
- function Fe(e, s = {}) {
331
+ function Ae(e, s = {}) {
331
332
  const r = Array.isArray(e);
332
333
  if (S(e) || r)
333
- for (const l in e)
334
- Array.isArray(e[l]) || S(e[l]) && !ct(e[l]) ? (s[l] = Array.isArray(e[l]) ? [] : {}, Fe(e[l], s[l])) : B(e[l]) || (s[l] = !0);
334
+ for (const n in e)
335
+ Array.isArray(e[n]) || S(e[n]) && !ct(e[n]) ? (s[n] = Array.isArray(e[n]) ? [] : {}, Ae(e[n], s[n])) : B(e[n]) || (s[n] = !0);
335
336
  return s;
336
337
  }
337
- function ft(e, s, r) {
338
- const l = Array.isArray(e);
339
- if (S(e) || l)
338
+ function dt(e, s, r) {
339
+ const n = Array.isArray(e);
340
+ if (S(e) || n)
340
341
  for (const u in e)
341
- Array.isArray(e[u]) || S(e[u]) && !ct(e[u]) ? A(s) || Ve(r[u]) ? r[u] = Array.isArray(e[u]) ? Fe(e[u], []) : { ...Fe(e[u]) } : ft(e[u], B(s) ? {} : s[u], r[u]) : r[u] = !te(e[u], s[u]);
342
+ Array.isArray(e[u]) || S(e[u]) && !ct(e[u]) ? w(s) || Ve(r[u]) ? r[u] = Array.isArray(e[u]) ? Ae(e[u], []) : { ...Ae(e[u]) } : dt(e[u], B(s) ? {} : s[u], r[u]) : r[u] = !te(e[u], s[u]);
342
343
  return r;
343
344
  }
344
- var ve = (e, s) => ft(e, s, Fe(s)), dt = (e, { valueAsNumber: s, valueAsDate: r, setValueAs: l }) => A(e) ? e : s ? e === "" ? NaN : e && +e : r && K(e) ? new Date(e) : l ? l(e) : e;
345
- function Be(e) {
345
+ var ve = (e, s) => dt(e, s, Ae(s)), ft = (e, { valueAsNumber: s, valueAsDate: r, setValueAs: n }) => w(e) ? e : s ? e === "" ? NaN : e && +e : r && G(e) ? new Date(e) : n ? n(e) : e;
346
+ function Te(e) {
346
347
  const s = e.ref;
347
348
  if (!(e.refs ? e.refs.every((r) => r.disabled) : s.disabled))
348
- return Le(s) ? s.files : Me(s) ? ut(e.refs).value : ot(s) ? [...s.selectedOptions].map(({ value: r }) => r) : ye(s) ? lt(e.refs).value : dt(A(s.value) ? e.ref.value : s.value, e);
349
+ return Me(s) ? s.files : Oe(s) ? ut(e.refs).value : ot(s) ? [...s.selectedOptions].map(({ value: r }) => r) : he(s) ? nt(e.refs).value : ft(w(s.value) ? e.ref.value : s.value, e);
349
350
  }
350
- var jt = (e, s, r, l) => {
351
+ var Gt = (e, s, r, n) => {
351
352
  const u = {};
352
- for (const a of e) {
353
- const y = d(s, a);
354
- y && V(u, a, y._f);
353
+ for (const l of e) {
354
+ const y = f(s, l);
355
+ y && A(u, l, y._f);
355
356
  }
356
357
  return {
357
358
  criteriaMode: r,
358
359
  names: [...e],
359
360
  fields: u,
360
- shouldUseNativeValidation: l
361
+ shouldUseNativeValidation: n
361
362
  };
362
- }, fe = (e) => A(e) ? e : xe(e) ? e.source : S(e) ? xe(e.value) ? e.value.source : e.value : e, Kt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
363
+ }, fe = (e) => w(e) ? e : xe(e) ? e.source : S(e) ? xe(e.value) ? e.value.source : e.value : e, Jt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
363
364
  function st(e, s, r) {
364
- const l = d(e, r);
365
- if (l || Re(r))
365
+ const n = f(e, r);
366
+ if (n || Le(r))
366
367
  return {
367
- error: l,
368
+ error: n,
368
369
  name: r
369
370
  };
370
371
  const u = r.split(".");
371
372
  for (; u.length; ) {
372
- const a = u.join("."), y = d(s, a), g = d(e, a);
373
- if (y && !Array.isArray(y) && r !== a)
373
+ const l = u.join("."), y = f(s, l), g = f(e, l);
374
+ if (y && !Array.isArray(y) && r !== l)
374
375
  return { name: r };
375
376
  if (g && g.type)
376
377
  return {
377
- name: a,
378
+ name: l,
378
379
  error: g
379
380
  };
380
381
  u.pop();
@@ -383,15 +384,15 @@ function st(e, s, r) {
383
384
  name: r
384
385
  };
385
386
  }
386
- var Gt = (e, s, r, l, u) => u.isOnAll ? !1 : !r && u.isOnTouch ? !(s || e) : (r ? l.isOnBlur : u.isOnBlur) ? !e : (r ? l.isOnChange : u.isOnChange) ? e : !0, Jt = (e, s) => !Ae(d(e, s)).length && k(e, s);
387
- const Qt = {
388
- mode: H.onSubmit,
389
- reValidateMode: H.onChange,
387
+ var Qt = (e, s, r, n, u) => u.isOnAll ? !1 : !r && u.isOnTouch ? !(s || e) : (r ? n.isOnBlur : u.isOnBlur) ? !e : (r ? n.isOnChange : u.isOnChange) ? e : !0, Xt = (e, s) => !Fe(f(e, s)).length && k(e, s);
388
+ const Yt = {
389
+ mode: $.onSubmit,
390
+ reValidateMode: $.onChange,
390
391
  shouldFocusError: !0
391
392
  };
392
- function Xt(e = {}) {
393
+ function Zt(e = {}) {
393
394
  let s = {
394
- ...Qt,
395
+ ...Yt,
395
396
  ...e
396
397
  }, r = {
397
398
  submitCount: 0,
@@ -407,7 +408,7 @@ function Xt(e = {}) {
407
408
  validatingFields: {},
408
409
  errors: s.errors || {},
409
410
  disabled: s.disabled || !1
410
- }, l = {}, u = S(s.defaultValues) || S(s.values) ? U(s.defaultValues || s.values) || {} : {}, a = s.shouldUnregister ? {} : U(u), y = {
411
+ }, n = {}, u = S(s.defaultValues) || S(s.values) ? q(s.defaultValues || s.values) || {} : {}, l = s.shouldUnregister ? {} : q(u), y = {
411
412
  action: !1,
412
413
  mount: !1,
413
414
  watch: !1
@@ -416,8 +417,8 @@ function Xt(e = {}) {
416
417
  unMount: /* @__PURE__ */ new Set(),
417
418
  array: /* @__PURE__ */ new Set(),
418
419
  watch: /* @__PURE__ */ new Set()
419
- }, R, M = 0;
420
- const F = {
420
+ }, L, M = 0;
421
+ const V = {
421
422
  isDirty: !1,
422
423
  dirtyFields: !1,
423
424
  validatingFields: !1,
@@ -426,40 +427,40 @@ function Xt(e = {}) {
426
427
  isValid: !1,
427
428
  errors: !1
428
429
  }, v = {
429
- values: Ee(),
430
- array: Ee(),
431
- state: Ee()
432
- }, G = Qe(s.mode), z = Qe(s.reValidateMode), C = s.criteriaMode === H.all, le = (t) => (i) => {
430
+ values: Ce(),
431
+ array: Ce(),
432
+ state: Ce()
433
+ }, re = Qe(s.mode), j = Qe(s.reValidateMode), C = s.criteriaMode === $.all, se = (t) => (i) => {
433
434
  clearTimeout(M), M = setTimeout(t, i);
434
- }, $ = async (t) => {
435
- if (F.isValid || t) {
436
- const i = s.resolver ? T((await ee()).errors) : await O(l, !0);
435
+ }, T = async (t) => {
436
+ if (V.isValid || t) {
437
+ const i = s.resolver ? R((await ee()).errors) : await U(n, !0);
437
438
  i !== r.isValid && v.state.next({
438
439
  isValid: i
439
440
  });
440
441
  }
441
- }, j = (t, i) => {
442
- (F.isValidating || F.validatingFields) && ((t || Array.from(g.mount)).forEach((n) => {
443
- n && (i ? V(r.validatingFields, n, i) : k(r.validatingFields, n));
442
+ }, K = (t, i) => {
443
+ (V.isValidating || V.validatingFields) && ((t || Array.from(g.mount)).forEach((a) => {
444
+ a && (i ? A(r.validatingFields, a, i) : k(r.validatingFields, a));
444
445
  }), v.state.next({
445
446
  validatingFields: r.validatingFields,
446
- isValidating: !T(r.validatingFields)
447
+ isValidating: !R(r.validatingFields)
447
448
  }));
448
- }, m = (t, i = [], n, f, c = !0, o = !0) => {
449
- if (f && n) {
450
- if (y.action = !0, o && Array.isArray(d(l, t))) {
451
- const h = n(d(l, t), f.argA, f.argB);
452
- c && V(l, t, h);
449
+ }, m = (t, i = [], a, d, c = !0, o = !0) => {
450
+ if (d && a) {
451
+ if (y.action = !0, o && Array.isArray(f(n, t))) {
452
+ const h = a(f(n, t), d.argA, d.argB);
453
+ c && A(n, t, h);
453
454
  }
454
- if (o && Array.isArray(d(r.errors, t))) {
455
- const h = n(d(r.errors, t), f.argA, f.argB);
456
- c && V(r.errors, t, h), Jt(r.errors, t);
455
+ if (o && Array.isArray(f(r.errors, t))) {
456
+ const h = a(f(r.errors, t), d.argA, d.argB);
457
+ c && A(r.errors, t, h), Xt(r.errors, t);
457
458
  }
458
- if (F.touchedFields && o && Array.isArray(d(r.touchedFields, t))) {
459
- const h = n(d(r.touchedFields, t), f.argA, f.argB);
460
- c && V(r.touchedFields, t, h);
459
+ if (V.touchedFields && o && Array.isArray(f(r.touchedFields, t))) {
460
+ const h = a(f(r.touchedFields, t), d.argA, d.argB);
461
+ c && A(r.touchedFields, t, h);
461
462
  }
462
- F.dirtyFields && (r.dirtyFields = ve(u, a)), v.state.next({
463
+ V.dirtyFields && (r.dirtyFields = ve(u, l)), v.state.next({
463
464
  name: t,
464
465
  isDirty: _(t, i),
465
466
  dirtyFields: r.dirtyFields,
@@ -467,42 +468,42 @@ function Xt(e = {}) {
467
468
  isValid: r.isValid
468
469
  });
469
470
  } else
470
- V(a, t, i);
471
- }, P = (t, i) => {
472
- V(r.errors, t, i), v.state.next({
471
+ A(l, t, i);
472
+ }, W = (t, i) => {
473
+ A(r.errors, t, i), v.state.next({
473
474
  errors: r.errors
474
475
  });
475
- }, J = (t) => {
476
+ }, H = (t) => {
476
477
  r.errors = t, v.state.next({
477
478
  errors: r.errors,
478
479
  isValid: !1
479
480
  });
480
- }, p = (t, i, n, f) => {
481
- const c = d(l, t);
481
+ }, F = (t, i, a, d) => {
482
+ const c = f(n, t);
482
483
  if (c) {
483
- const o = d(a, t, A(n) ? d(u, t) : n);
484
- A(o) || f && f.defaultChecked || i ? V(a, t, i ? o : Be(c._f)) : E(t, o), y.mount && $();
484
+ const o = f(l, t, w(a) ? f(u, t) : a);
485
+ w(o) || d && d.defaultChecked || i ? A(l, t, i ? o : Te(c._f)) : E(t, o), y.mount && T();
485
486
  }
486
- }, re = (t, i, n, f, c) => {
487
+ }, Q = (t, i, a, d, c) => {
487
488
  let o = !1, h = !1;
488
489
  const x = {
489
490
  name: t
490
- }, w = !!(d(l, t) && d(l, t)._f && d(l, t)._f.disabled);
491
- if (!n || f) {
492
- F.isDirty && (h = r.isDirty, r.isDirty = x.isDirty = _(), o = h !== x.isDirty);
493
- const L = w || te(d(u, t), i);
494
- h = !!(!w && d(r.dirtyFields, t)), L || w ? k(r.dirtyFields, t) : V(r.dirtyFields, t, !0), x.dirtyFields = r.dirtyFields, o = o || F.dirtyFields && h !== !L;
491
+ }, p = !!(f(n, t) && f(n, t)._f && f(n, t)._f.disabled);
492
+ if (!a || d) {
493
+ V.isDirty && (h = r.isDirty, r.isDirty = x.isDirty = _(), o = h !== x.isDirty);
494
+ const O = p || te(f(u, t), i);
495
+ h = !!(!p && f(r.dirtyFields, t)), O || p ? k(r.dirtyFields, t) : A(r.dirtyFields, t, !0), x.dirtyFields = r.dirtyFields, o = o || V.dirtyFields && h !== !O;
495
496
  }
496
- if (n) {
497
- const L = d(r.touchedFields, t);
498
- L || (V(r.touchedFields, t, n), x.touchedFields = r.touchedFields, o = o || F.touchedFields && L !== n);
497
+ if (a) {
498
+ const O = f(r.touchedFields, t);
499
+ O || (A(r.touchedFields, t, a), x.touchedFields = r.touchedFields, o = o || V.touchedFields && O !== a);
499
500
  }
500
501
  return o && c && v.state.next(x), o ? x : {};
501
- }, he = (t, i, n, f) => {
502
- const c = d(r.errors, t), o = F.isValid && Y(i) && r.isValid !== i;
503
- if (e.delayError && n ? (R = le(() => P(t, n)), R(e.delayError)) : (clearTimeout(M), R = null, n ? V(r.errors, t, n) : k(r.errors, t)), (n ? !te(c, n) : c) || !T(f) || o) {
502
+ }, ie = (t, i, a, d) => {
503
+ const c = f(r.errors, t), o = V.isValid && Y(i) && r.isValid !== i;
504
+ if (e.delayError && a ? (L = se(() => W(t, a)), L(e.delayError)) : (clearTimeout(M), L = null, a ? A(r.errors, t, a) : k(r.errors, t)), (a ? !te(c, a) : c) || !R(d) || o) {
504
505
  const h = {
505
- ...f,
506
+ ...d,
506
507
  ...o && Y(i) ? { isValid: i } : {},
507
508
  errors: r.errors,
508
509
  name: t
@@ -513,182 +514,182 @@ function Xt(e = {}) {
513
514
  }, v.state.next(h);
514
515
  }
515
516
  }, ee = async (t) => {
516
- j(t, !0);
517
- const i = await s.resolver(a, s.context, jt(t || g.mount, l, s.criteriaMode, s.shouldUseNativeValidation));
518
- return j(t), i;
519
- }, se = async (t) => {
517
+ K(t, !0);
518
+ const i = await s.resolver(l, s.context, Gt(t || g.mount, n, s.criteriaMode, s.shouldUseNativeValidation));
519
+ return K(t), i;
520
+ }, ae = async (t) => {
520
521
  const { errors: i } = await ee(t);
521
522
  if (t)
522
- for (const n of t) {
523
- const f = d(i, n);
524
- f ? V(r.errors, n, f) : k(r.errors, n);
523
+ for (const a of t) {
524
+ const d = f(i, a);
525
+ d ? A(r.errors, a, d) : k(r.errors, a);
525
526
  }
526
527
  else
527
528
  r.errors = i;
528
529
  return i;
529
- }, O = async (t, i, n = {
530
+ }, U = async (t, i, a = {
530
531
  valid: !0
531
532
  }) => {
532
- for (const f in t) {
533
- const c = t[f];
533
+ for (const d in t) {
534
+ const c = t[d];
534
535
  if (c) {
535
536
  const { _f: o, ...h } = c;
536
537
  if (o) {
537
538
  const x = g.array.has(o.name);
538
- j([f], !0);
539
- const w = await rt(c, a, C, s.shouldUseNativeValidation && !i, x);
540
- if (j([f]), w[o.name] && (n.valid = !1, i))
539
+ K([d], !0);
540
+ const p = await rt(c, l, C, s.shouldUseNativeValidation && !i, x);
541
+ if (K([d]), p[o.name] && (a.valid = !1, i))
541
542
  break;
542
- !i && (d(w, o.name) ? x ? Wt(r.errors, w, o.name) : V(r.errors, o.name, w[o.name]) : k(r.errors, o.name));
543
+ !i && (f(p, o.name) ? x ? zt(r.errors, p, o.name) : A(r.errors, o.name, p[o.name]) : k(r.errors, o.name));
543
544
  }
544
- !T(h) && await O(h, i, n);
545
+ !R(h) && await U(h, i, a);
545
546
  }
546
547
  }
547
- return n.valid;
548
+ return a.valid;
548
549
  }, ge = () => {
549
550
  for (const t of g.unMount) {
550
- const i = d(l, t);
551
- i && (i._f.refs ? i._f.refs.every((n) => !Ce(n)) : !Ce(i._f.ref)) && we(t);
551
+ const i = f(n, t);
552
+ i && (i._f.refs ? i._f.refs.every((a) => !Be(a)) : !Be(i._f.ref)) && we(t);
552
553
  }
553
554
  g.unMount = /* @__PURE__ */ new Set();
554
- }, _ = (t, i) => (t && i && V(a, t, i), !te(Oe(), u)), b = (t, i, n) => Pt(t, g, {
555
- ...y.mount ? a : A(i) ? u : K(t) ? { [t]: i } : i
556
- }, n, i), D = (t) => Ae(d(y.mount ? a : u, t, e.shouldUnregister ? d(u, t, []) : [])), E = (t, i, n = {}) => {
557
- const f = d(l, t);
555
+ }, _ = (t, i) => (t && i && A(l, t, i), !te(Ne(), u)), b = (t, i, a) => Wt(t, g, {
556
+ ...y.mount ? l : w(i) ? u : G(t) ? { [t]: i } : i
557
+ }, a, i), D = (t) => Fe(f(y.mount ? l : u, t, e.shouldUnregister ? f(u, t, []) : [])), E = (t, i, a = {}) => {
558
+ const d = f(n, t);
558
559
  let c = i;
559
- if (f) {
560
- const o = f._f;
561
- o && (!o.disabled && V(a, t, dt(i, o)), c = be(o.ref) && B(i) ? "" : i, ot(o.ref) ? [...o.ref.options].forEach((h) => h.selected = c.includes(h.value)) : o.refs ? ye(o.ref) ? o.refs.length > 1 ? o.refs.forEach((h) => (!h.defaultChecked || !h.disabled) && (h.checked = Array.isArray(c) ? !!c.find((x) => x === h.value) : c === h.value)) : o.refs[0] && (o.refs[0].checked = !!c) : o.refs.forEach((h) => h.checked = h.value === c) : Le(o.ref) ? o.ref.value = "" : (o.ref.value = c, o.ref.type || v.values.next({
560
+ if (d) {
561
+ const o = d._f;
562
+ o && (!o.disabled && A(l, t, ft(i, o)), c = be(o.ref) && B(i) ? "" : i, ot(o.ref) ? [...o.ref.options].forEach((h) => h.selected = c.includes(h.value)) : o.refs ? he(o.ref) ? o.refs.length > 1 ? o.refs.forEach((h) => (!h.defaultChecked || !h.disabled) && (h.checked = Array.isArray(c) ? !!c.find((x) => x === h.value) : c === h.value)) : o.refs[0] && (o.refs[0].checked = !!c) : o.refs.forEach((h) => h.checked = h.value === c) : Me(o.ref) ? o.ref.value = "" : (o.ref.value = c, o.ref.type || v.values.next({
562
563
  name: t,
563
- values: { ...a }
564
+ values: { ...l }
564
565
  })));
565
566
  }
566
- (n.shouldDirty || n.shouldTouch) && re(t, c, n.shouldTouch, n.shouldDirty, !0), n.shouldValidate && ce(t);
567
- }, q = (t, i, n) => {
568
- for (const f in i) {
569
- const c = i[f], o = `${t}.${f}`, h = d(l, o);
570
- (g.array.has(t) || !Ve(c) || h && !h._f) && !ae(c) ? q(o, c, n) : E(o, c, n);
567
+ (a.shouldDirty || a.shouldTouch) && Q(t, c, a.shouldTouch, a.shouldDirty, !0), a.shouldValidate && de(t);
568
+ }, z = (t, i, a) => {
569
+ for (const d in i) {
570
+ const c = i[d], o = `${t}.${d}`, h = f(n, o);
571
+ (g.array.has(t) || !Ve(c) || h && !h._f) && !ue(c) ? z(o, c, a) : E(o, c, a);
571
572
  }
572
- }, N = (t, i, n = {}) => {
573
- const f = d(l, t), c = g.array.has(t), o = U(i);
574
- V(a, t, o), c ? (v.array.next({
573
+ }, I = (t, i, a = {}) => {
574
+ const d = f(n, t), c = g.array.has(t), o = q(i);
575
+ A(l, t, o), c ? (v.array.next({
575
576
  name: t,
576
- values: { ...a }
577
- }), (F.isDirty || F.dirtyFields) && n.shouldDirty && v.state.next({
577
+ values: { ...l }
578
+ }), (V.isDirty || V.dirtyFields) && a.shouldDirty && v.state.next({
578
579
  name: t,
579
- dirtyFields: ve(u, a),
580
+ dirtyFields: ve(u, l),
580
581
  isDirty: _(t, o)
581
- })) : f && !f._f && !B(o) ? q(t, o, n) : E(t, o, n), Xe(t, g) && v.state.next({ ...r }), v.values.next({
582
+ })) : d && !d._f && !B(o) ? z(t, o, a) : E(t, o, a), Xe(t, g) && v.state.next({ ...r }), v.values.next({
582
583
  name: y.mount ? t : void 0,
583
- values: { ...a }
584
+ values: { ...l }
584
585
  });
585
- }, ue = async (t) => {
586
+ }, oe = async (t) => {
586
587
  y.mount = !0;
587
588
  const i = t.target;
588
- let n = i.name, f = !0;
589
- const c = d(l, n), o = () => i.type ? Be(c._f) : Rt(t), h = (x) => {
590
- f = Number.isNaN(x) || x === d(a, n, x);
589
+ let a = i.name, d = !0;
590
+ const c = f(n, a), o = () => i.type ? Te(c._f) : Mt(t), h = (x) => {
591
+ d = Number.isNaN(x) || x === f(l, a, x);
591
592
  };
592
593
  if (c) {
593
- let x, w;
594
- const L = o(), ie = t.type === Je.BLUR || t.type === Je.FOCUS_OUT, _t = !Kt(c._f) && !s.resolver && !d(r.errors, n) && !c._f.deps || Gt(ie, d(r.touchedFields, n), r.isSubmitted, z, G), De = Xe(n, g, ie);
595
- V(a, n, L), ie ? (c._f.onBlur && c._f.onBlur(t), R && R(0)) : c._f.onChange && c._f.onChange(t);
596
- const ke = re(n, L, ie, !1), mt = !T(ke) || De;
597
- if (!ie && v.values.next({
598
- name: n,
594
+ let x, p;
595
+ const O = o(), le = t.type === Je.BLUR || t.type === Je.FOCUS_OUT, _t = !Jt(c._f) && !s.resolver && !f(r.errors, a) && !c._f.deps || Qt(le, f(r.touchedFields, a), r.isSubmitted, j, re), De = Xe(a, g, le);
596
+ A(l, a, O), le ? (c._f.onBlur && c._f.onBlur(t), L && L(0)) : c._f.onChange && c._f.onChange(t);
597
+ const ke = Q(a, O, le, !1), mt = !R(ke) || De;
598
+ if (!le && v.values.next({
599
+ name: a,
599
600
  type: t.type,
600
- values: { ...a }
601
+ values: { ...l }
601
602
  }), _t)
602
- return F.isValid && $(), mt && v.state.next({ name: n, ...De ? {} : ke });
603
- if (!ie && De && v.state.next({ ...r }), s.resolver) {
604
- const { errors: ze } = await ee([n]);
605
- if (h(L), f) {
606
- const bt = st(r.errors, l, n), $e = st(ze, l, bt.name || n);
607
- x = $e.error, n = $e.name, w = T(ze);
603
+ return V.isValid && T(), mt && v.state.next({ name: a, ...De ? {} : ke });
604
+ if (!le && De && v.state.next({ ...r }), s.resolver) {
605
+ const { errors: $e } = await ee([a]);
606
+ if (h(O), d) {
607
+ const bt = st(r.errors, n, a), je = st($e, n, bt.name || a);
608
+ x = je.error, a = je.name, p = R($e);
608
609
  }
609
610
  } else
610
- j([n], !0), x = (await rt(c, a, C, s.shouldUseNativeValidation))[n], j([n]), h(L), f && (x ? w = !1 : F.isValid && (w = await O(l, !0)));
611
- f && (c._f.deps && ce(c._f.deps), he(n, w, x, ke));
611
+ K([a], !0), x = (await rt(c, l, C, s.shouldUseNativeValidation))[a], K([a]), h(O), d && (x ? p = !1 : V.isValid && (p = await U(n, !0)));
612
+ d && (c._f.deps && de(c._f.deps), ie(a, p, x, ke));
612
613
  }
613
- }, oe = (t, i) => {
614
- if (d(r.errors, i) && t.focus)
614
+ }, ce = (t, i) => {
615
+ if (f(r.errors, i) && t.focus)
615
616
  return t.focus(), 1;
616
- }, ce = async (t, i = {}) => {
617
- let n, f;
617
+ }, de = async (t, i = {}) => {
618
+ let a, d;
618
619
  const c = _e(t);
619
620
  if (s.resolver) {
620
- const o = await se(A(t) ? t : c);
621
- n = T(o), f = t ? !c.some((h) => d(o, h)) : n;
621
+ const o = await ae(w(t) ? t : c);
622
+ a = R(o), d = t ? !c.some((h) => f(o, h)) : a;
622
623
  } else
623
- t ? (f = (await Promise.all(c.map(async (o) => {
624
- const h = d(l, o);
625
- return await O(h && h._f ? { [o]: h } : h);
626
- }))).every(Boolean), !(!f && !r.isValid) && $()) : f = n = await O(l);
624
+ t ? (d = (await Promise.all(c.map(async (o) => {
625
+ const h = f(n, o);
626
+ return await U(h && h._f ? { [o]: h } : h);
627
+ }))).every(Boolean), !(!d && !r.isValid) && T()) : d = a = await U(n);
627
628
  return v.state.next({
628
- ...!K(t) || F.isValid && n !== r.isValid ? {} : { name: t },
629
- ...s.resolver || !t ? { isValid: n } : {},
629
+ ...!G(t) || V.isValid && a !== r.isValid ? {} : { name: t },
630
+ ...s.resolver || !t ? { isValid: a } : {},
630
631
  errors: r.errors
631
- }), i.shouldFocus && !f && de(l, oe, t ? c : g.mount), f;
632
- }, Oe = (t) => {
632
+ }), i.shouldFocus && !d && ye(n, ce, t ? c : g.mount), d;
633
+ }, Ne = (t) => {
633
634
  const i = {
634
- ...y.mount ? a : u
635
+ ...y.mount ? l : u
635
636
  };
636
- return A(t) ? i : K(t) ? d(i, t) : t.map((n) => d(i, n));
637
- }, Ne = (t, i) => ({
638
- invalid: !!d((i || r).errors, t),
639
- isDirty: !!d((i || r).dirtyFields, t),
640
- error: d((i || r).errors, t),
641
- isValidating: !!d(r.validatingFields, t),
642
- isTouched: !!d((i || r).touchedFields, t)
637
+ return w(t) ? i : G(t) ? f(i, t) : t.map((a) => f(i, a));
638
+ }, Ue = (t, i) => ({
639
+ invalid: !!f((i || r).errors, t),
640
+ isDirty: !!f((i || r).dirtyFields, t),
641
+ error: f((i || r).errors, t),
642
+ isValidating: !!f(r.validatingFields, t),
643
+ isTouched: !!f((i || r).touchedFields, t)
643
644
  }), yt = (t) => {
644
645
  t && _e(t).forEach((i) => k(r.errors, i)), v.state.next({
645
646
  errors: t ? r.errors : {}
646
647
  });
647
- }, Ue = (t, i, n) => {
648
- const f = (d(l, t, { _f: {} })._f || {}).ref, c = d(r.errors, t) || {}, { ref: o, message: h, type: x, ...w } = c;
649
- V(r.errors, t, {
650
- ...w,
648
+ }, Ie = (t, i, a) => {
649
+ const d = (f(n, t, { _f: {} })._f || {}).ref, c = f(r.errors, t) || {}, { ref: o, message: h, type: x, ...p } = c;
650
+ A(r.errors, t, {
651
+ ...p,
651
652
  ...i,
652
- ref: f
653
+ ref: d
653
654
  }), v.state.next({
654
655
  name: t,
655
656
  errors: r.errors,
656
657
  isValid: !1
657
- }), n && n.shouldFocus && f && f.focus && f.focus();
658
+ }), a && a.shouldFocus && d && d.focus && d.focus();
658
659
  }, ht = (t, i) => Z(t) ? v.values.subscribe({
659
- next: (n) => t(b(void 0, i), n)
660
+ next: (a) => t(b(void 0, i), a)
660
661
  }) : b(t, i, !0), we = (t, i = {}) => {
661
- for (const n of t ? _e(t) : g.mount)
662
- g.mount.delete(n), g.array.delete(n), i.keepValue || (k(l, n), k(a, n)), !i.keepError && k(r.errors, n), !i.keepDirty && k(r.dirtyFields, n), !i.keepTouched && k(r.touchedFields, n), !i.keepIsValidating && k(r.validatingFields, n), !s.shouldUnregister && !i.keepDefaultValue && k(u, n);
662
+ for (const a of t ? _e(t) : g.mount)
663
+ g.mount.delete(a), g.array.delete(a), i.keepValue || (k(n, a), k(l, a)), !i.keepError && k(r.errors, a), !i.keepDirty && k(r.dirtyFields, a), !i.keepTouched && k(r.touchedFields, a), !i.keepIsValidating && k(r.validatingFields, a), !s.shouldUnregister && !i.keepDefaultValue && k(u, a);
663
664
  v.values.next({
664
- values: { ...a }
665
+ values: { ...l }
665
666
  }), v.state.next({
666
667
  ...r,
667
668
  ...i.keepDirty ? { isDirty: _() } : {}
668
- }), !i.keepIsValid && $();
669
- }, Ie = ({ disabled: t, name: i, field: n, fields: f, value: c }) => {
669
+ }), !i.keepIsValid && T();
670
+ }, qe = ({ disabled: t, name: i, field: a, fields: d, value: c }) => {
670
671
  if (Y(t) && y.mount || t) {
671
- const o = t ? void 0 : A(c) ? Be(n ? n._f : d(f, i)._f) : c;
672
- V(a, i, o), re(i, o, !1, !1, !0);
672
+ const o = t ? void 0 : w(c) ? Te(a ? a._f : f(d, i)._f) : c;
673
+ A(l, i, o), Q(i, o, !1, !1, !0);
673
674
  }
674
675
  }, pe = (t, i = {}) => {
675
- let n = d(l, t);
676
- const f = Y(i.disabled);
677
- return V(l, t, {
678
- ...n || {},
676
+ let a = f(n, t);
677
+ const d = Y(i.disabled);
678
+ return A(n, t, {
679
+ ...a || {},
679
680
  _f: {
680
- ...n && n._f ? n._f : { ref: { name: t } },
681
+ ...a && a._f ? a._f : { ref: { name: t } },
681
682
  name: t,
682
683
  mount: !0,
683
684
  ...i
684
685
  }
685
- }), g.mount.add(t), n ? Ie({
686
- field: n,
686
+ }), g.mount.add(t), a ? qe({
687
+ field: a,
687
688
  disabled: i.disabled,
688
689
  name: t,
689
690
  value: i.value
690
- }) : p(t, !0, i.value), {
691
- ...f ? { disabled: i.disabled } : {},
691
+ }) : F(t, !0, i.value), {
692
+ ...d ? { disabled: i.disabled } : {},
692
693
  ...s.progressive ? {
693
694
  required: !!i.required,
694
695
  min: fe(i.min),
@@ -698,94 +699,94 @@ function Xt(e = {}) {
698
699
  pattern: fe(i.pattern)
699
700
  } : {},
700
701
  name: t,
701
- onChange: ue,
702
- onBlur: ue,
702
+ onChange: oe,
703
+ onBlur: oe,
703
704
  ref: (c) => {
704
705
  if (c) {
705
- pe(t, i), n = d(l, t);
706
- const o = A(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, h = $t(o), x = n._f.refs || [];
707
- if (h ? x.find((w) => w === o) : o === n._f.ref)
706
+ pe(t, i), a = f(n, t);
707
+ const o = w(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, h = Kt(o), x = a._f.refs || [];
708
+ if (h ? x.find((p) => p === o) : o === a._f.ref)
708
709
  return;
709
- V(l, t, {
710
+ A(n, t, {
710
711
  _f: {
711
- ...n._f,
712
+ ...a._f,
712
713
  ...h ? {
713
714
  refs: [
714
- ...x.filter(Ce),
715
+ ...x.filter(Be),
715
716
  o,
716
- ...Array.isArray(d(u, t)) ? [{}] : []
717
+ ...Array.isArray(f(u, t)) ? [{}] : []
717
718
  ],
718
719
  ref: { type: o.type, name: t }
719
720
  } : { ref: o }
720
721
  }
721
- }), p(t, !1, void 0, o);
722
+ }), F(t, !1, void 0, o);
722
723
  } else
723
- n = d(l, t, {}), n._f && (n._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(Mt(g.array, t) && y.action) && g.unMount.add(t);
724
+ a = f(n, t, {}), a._f && (a._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(Nt(g.array, t) && y.action) && g.unMount.add(t);
724
725
  }
725
726
  };
726
- }, Pe = () => s.shouldFocusError && de(l, oe, g.mount), gt = (t) => {
727
- Y(t) && (v.state.next({ disabled: t }), de(l, (i, n) => {
728
- const f = d(l, n);
729
- f && (i.disabled = f._f.disabled || t, Array.isArray(f._f.refs) && f._f.refs.forEach((c) => {
730
- c.disabled = f._f.disabled || t;
727
+ }, Pe = () => s.shouldFocusError && ye(n, ce, g.mount), gt = (t) => {
728
+ Y(t) && (v.state.next({ disabled: t }), ye(n, (i, a) => {
729
+ const d = f(n, a);
730
+ d && (i.disabled = d._f.disabled || t, Array.isArray(d._f.refs) && d._f.refs.forEach((c) => {
731
+ c.disabled = d._f.disabled || t;
731
732
  }));
732
733
  }, 0, !1));
733
- }, qe = (t, i) => async (n) => {
734
- let f;
735
- n && (n.preventDefault && n.preventDefault(), n.persist && n.persist());
736
- let c = U(a);
734
+ }, We = (t, i) => async (a) => {
735
+ let d;
736
+ a && (a.preventDefault && a.preventDefault(), a.persist && a.persist());
737
+ let c = q(l);
737
738
  if (v.state.next({
738
739
  isSubmitting: !0
739
740
  }), s.resolver) {
740
741
  const { errors: o, values: h } = await ee();
741
742
  r.errors = o, c = h;
742
743
  } else
743
- await O(l);
744
- if (k(r.errors, "root"), T(r.errors)) {
744
+ await U(n);
745
+ if (k(r.errors, "root"), R(r.errors)) {
745
746
  v.state.next({
746
747
  errors: {}
747
748
  });
748
749
  try {
749
- await t(c, n);
750
+ await t(c, a);
750
751
  } catch (o) {
751
- f = o;
752
+ d = o;
752
753
  }
753
754
  } else
754
- i && await i({ ...r.errors }, n), Pe(), setTimeout(Pe);
755
+ i && await i({ ...r.errors }, a), Pe(), setTimeout(Pe);
755
756
  if (v.state.next({
756
757
  isSubmitted: !0,
757
758
  isSubmitting: !1,
758
- isSubmitSuccessful: T(r.errors) && !f,
759
+ isSubmitSuccessful: R(r.errors) && !d,
759
760
  submitCount: r.submitCount + 1,
760
761
  errors: r.errors
761
- }), f)
762
- throw f;
762
+ }), d)
763
+ throw d;
763
764
  }, vt = (t, i = {}) => {
764
- d(l, t) && (A(i.defaultValue) ? N(t, U(d(u, t))) : (N(t, i.defaultValue), V(u, t, U(i.defaultValue))), i.keepTouched || k(r.touchedFields, t), i.keepDirty || (k(r.dirtyFields, t), r.isDirty = i.defaultValue ? _(t, U(d(u, t))) : _()), i.keepError || (k(r.errors, t), F.isValid && $()), v.state.next({ ...r }));
765
- }, We = (t, i = {}) => {
766
- const n = t ? U(t) : u, f = U(n), c = T(t), o = c ? u : f;
767
- if (i.keepDefaultValues || (u = n), !i.keepValues) {
765
+ f(n, t) && (w(i.defaultValue) ? I(t, q(f(u, t))) : (I(t, i.defaultValue), A(u, t, q(i.defaultValue))), i.keepTouched || k(r.touchedFields, t), i.keepDirty || (k(r.dirtyFields, t), r.isDirty = i.defaultValue ? _(t, q(f(u, t))) : _()), i.keepError || (k(r.errors, t), V.isValid && T()), v.state.next({ ...r }));
766
+ }, He = (t, i = {}) => {
767
+ const a = t ? q(t) : u, d = q(a), c = R(t), o = c ? u : d;
768
+ if (i.keepDefaultValues || (u = a), !i.keepValues) {
768
769
  if (i.keepDirtyValues)
769
770
  for (const h of g.mount)
770
- d(r.dirtyFields, h) ? V(o, h, d(a, h)) : N(h, d(o, h));
771
+ f(r.dirtyFields, h) ? A(o, h, f(l, h)) : I(h, f(o, h));
771
772
  else {
772
- if (Te && A(t))
773
+ if (Re && w(t))
773
774
  for (const h of g.mount) {
774
- const x = d(l, h);
775
+ const x = f(n, h);
775
776
  if (x && x._f) {
776
- const w = Array.isArray(x._f.refs) ? x._f.refs[0] : x._f.ref;
777
- if (be(w)) {
778
- const L = w.closest("form");
779
- if (L) {
780
- L.reset();
777
+ const p = Array.isArray(x._f.refs) ? x._f.refs[0] : x._f.ref;
778
+ if (be(p)) {
779
+ const O = p.closest("form");
780
+ if (O) {
781
+ O.reset();
781
782
  break;
782
783
  }
783
784
  }
784
785
  }
785
786
  }
786
- l = {};
787
+ n = {};
787
788
  }
788
- a = e.shouldUnregister ? i.keepDefaultValues ? U(u) : {} : U(o), v.array.next({
789
+ l = e.shouldUnregister ? i.keepDefaultValues ? q(u) : {} : q(o), v.array.next({
789
790
  values: { ...o }
790
791
  }), v.values.next({
791
792
  values: { ...o }
@@ -798,35 +799,35 @@ function Xt(e = {}) {
798
799
  watch: /* @__PURE__ */ new Set(),
799
800
  watchAll: !1,
800
801
  focus: ""
801
- }, y.mount = !F.isValid || !!i.keepIsValid || !!i.keepDirtyValues, y.watch = !!e.shouldUnregister, v.state.next({
802
+ }, y.mount = !V.isValid || !!i.keepIsValid || !!i.keepDirtyValues, y.watch = !!e.shouldUnregister, v.state.next({
802
803
  submitCount: i.keepSubmitCount ? r.submitCount : 0,
803
804
  isDirty: c ? !1 : i.keepDirty ? r.isDirty : !!(i.keepDefaultValues && !te(t, u)),
804
805
  isSubmitted: i.keepIsSubmitted ? r.isSubmitted : !1,
805
- dirtyFields: c ? {} : i.keepDirtyValues ? i.keepDefaultValues && a ? ve(u, a) : r.dirtyFields : i.keepDefaultValues && t ? ve(u, t) : i.keepDirty ? r.dirtyFields : {},
806
+ dirtyFields: c ? {} : i.keepDirtyValues ? i.keepDefaultValues && l ? ve(u, l) : r.dirtyFields : i.keepDefaultValues && t ? ve(u, t) : i.keepDirty ? r.dirtyFields : {},
806
807
  touchedFields: i.keepTouched ? r.touchedFields : {},
807
808
  errors: i.keepErrors ? r.errors : {},
808
809
  isSubmitSuccessful: i.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
809
810
  isSubmitting: !1
810
811
  });
811
- }, He = (t, i) => We(Z(t) ? t(a) : t, i);
812
+ }, ze = (t, i) => He(Z(t) ? t(l) : t, i);
812
813
  return {
813
814
  control: {
814
815
  register: pe,
815
816
  unregister: we,
816
- getFieldState: Ne,
817
- handleSubmit: qe,
818
- setError: Ue,
817
+ getFieldState: Ue,
818
+ handleSubmit: We,
819
+ setError: Ie,
819
820
  _executeSchema: ee,
820
821
  _getWatch: b,
821
822
  _getDirty: _,
822
- _updateValid: $,
823
+ _updateValid: T,
823
824
  _removeUnmounted: ge,
824
825
  _updateFieldArray: m,
825
- _updateDisabledField: Ie,
826
+ _updateDisabledField: qe,
826
827
  _getFieldArray: D,
827
- _reset: We,
828
+ _reset: He,
828
829
  _resetDefaultValues: () => Z(s.defaultValues) && s.defaultValues().then((t) => {
829
- He(t, s.resetOptions), v.state.next({
830
+ ze(t, s.resetOptions), v.state.next({
830
831
  isLoading: !1
831
832
  });
832
833
  }),
@@ -838,13 +839,13 @@ function Xt(e = {}) {
838
839
  },
839
840
  _disableForm: gt,
840
841
  _subjects: v,
841
- _proxyFormState: F,
842
- _setErrors: J,
842
+ _proxyFormState: V,
843
+ _setErrors: H,
843
844
  get _fields() {
844
- return l;
845
+ return n;
845
846
  },
846
847
  get _formValues() {
847
- return a;
848
+ return l;
848
849
  },
849
850
  get _state() {
850
851
  return y;
@@ -877,29 +878,29 @@ function Xt(e = {}) {
877
878
  };
878
879
  }
879
880
  },
880
- trigger: ce,
881
+ trigger: de,
881
882
  register: pe,
882
- handleSubmit: qe,
883
+ handleSubmit: We,
883
884
  watch: ht,
884
- setValue: N,
885
- getValues: Oe,
886
- reset: He,
885
+ setValue: I,
886
+ getValues: Ne,
887
+ reset: ze,
887
888
  resetField: vt,
888
889
  clearErrors: yt,
889
890
  unregister: we,
890
- setError: Ue,
891
+ setError: Ie,
891
892
  setFocus: (t, i = {}) => {
892
- const n = d(l, t), f = n && n._f;
893
- if (f) {
894
- const c = f.refs ? f.refs[0] : f.ref;
893
+ const a = f(n, t), d = a && a._f;
894
+ if (d) {
895
+ const c = d.refs ? d.refs[0] : d.ref;
895
896
  c.focus && (c.focus(), i.shouldSelect && c.select());
896
897
  }
897
898
  },
898
- getFieldState: Ne
899
+ getFieldState: Ue
899
900
  };
900
901
  }
901
- function Yt(e = {}) {
902
- const s = I.useRef(), r = I.useRef(), [l, u] = I.useState({
902
+ function er(e = {}) {
903
+ const s = P.useRef(), r = P.useRef(), [n, u] = P.useState({
903
904
  isDirty: !1,
904
905
  isValidating: !1,
905
906
  isLoading: Z(e.defaultValues),
@@ -916,60 +917,64 @@ function Yt(e = {}) {
916
917
  defaultValues: Z(e.defaultValues) ? void 0 : e.defaultValues
917
918
  });
918
919
  s.current || (s.current = {
919
- ...Xt(e),
920
- formState: l
920
+ ...Zt(e),
921
+ formState: n
921
922
  });
922
- const a = s.current.control;
923
- return a._options = e, It({
924
- subject: a._subjects.state,
923
+ const l = s.current.control;
924
+ return l._options = e, Pt({
925
+ subject: l._subjects.state,
925
926
  next: (y) => {
926
- Ut(y, a._proxyFormState, a._updateFormState) && u({ ...a._formState });
927
+ qt(y, l._proxyFormState, l._updateFormState) && u({ ...l._formState });
927
928
  }
928
- }), I.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), I.useEffect(() => {
929
- if (a._proxyFormState.isDirty) {
930
- const y = a._getDirty();
931
- y !== l.isDirty && a._subjects.state.next({
929
+ }), P.useEffect(() => l._disableForm(e.disabled), [l, e.disabled]), P.useEffect(() => {
930
+ if (l._proxyFormState.isDirty) {
931
+ const y = l._getDirty();
932
+ y !== n.isDirty && l._subjects.state.next({
932
933
  isDirty: y
933
934
  });
934
935
  }
935
- }, [a, l.isDirty]), I.useEffect(() => {
936
- e.values && !te(e.values, r.current) ? (a._reset(e.values, a._options.resetOptions), r.current = e.values, u((y) => ({ ...y }))) : a._resetDefaultValues();
937
- }, [e.values, a]), I.useEffect(() => {
938
- e.errors && a._setErrors(e.errors);
939
- }, [e.errors, a]), I.useEffect(() => {
940
- a._state.mount || (a._updateValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
941
- }), I.useEffect(() => {
942
- e.shouldUnregister && a._subjects.values.next({
943
- values: a._getWatch()
936
+ }, [l, n.isDirty]), P.useEffect(() => {
937
+ e.values && !te(e.values, r.current) ? (l._reset(e.values, l._options.resetOptions), r.current = e.values, u((y) => ({ ...y }))) : l._resetDefaultValues();
938
+ }, [e.values, l]), P.useEffect(() => {
939
+ e.errors && l._setErrors(e.errors);
940
+ }, [e.errors, l]), P.useEffect(() => {
941
+ l._state.mount || (l._updateValid(), l._state.mount = !0), l._state.watch && (l._state.watch = !1, l._subjects.state.next({ ...l._formState })), l._removeUnmounted();
942
+ }), P.useEffect(() => {
943
+ e.shouldUnregister && l._subjects.values.next({
944
+ values: l._getWatch()
944
945
  });
945
- }, [e.shouldUnregister, a]), s.current.formState = Nt(l, a), s.current;
946
+ }, [e.shouldUnregister, l]), s.current.formState = It(n, l), s.current;
946
947
  }
947
948
  const it = `Я принимаю условия Политики обработки
948
949
  и защиты персональных данных, даю согласия на обработку персональных
949
- данных`, dr = ({
950
+ данных`, gr = ({
950
951
  isFormOpen: e,
951
952
  setIsFormOpen: s,
952
953
  title: r,
953
- subTitle: l,
954
- submitHandler: u,
955
- personalCheckBox: a = { text: it, isRequired: !0 },
956
- advCheckBox: y = { text: it, isRequired: !0 }
954
+ isEmail: n,
955
+ isTextArea: u,
956
+ textAreaPlaceholder: l,
957
+ subTitle: y,
958
+ submitHandler: g,
959
+ rowsTextArea: L = 2,
960
+ personalCheckBox: M = { text: it, isRequired: !0 },
961
+ advCheckBox: V = { text: it, isRequired: !0 }
957
962
  }) => {
958
963
  const {
959
- register: g,
960
- handleSubmit: R,
961
- trigger: M,
962
- reset: F,
963
- watch: v,
964
- formState: { errors: G }
965
- } = Yt(), { onChange: z, onBlur: C, ...le } = g("phone", {
964
+ register: v,
965
+ handleSubmit: re,
966
+ trigger: j,
967
+ reset: C,
968
+ watch: se,
969
+ formState: { errors: T }
970
+ } = er(), { onChange: K, onBlur: m, ...W } = v("phone", {
966
971
  required: !0,
967
972
  pattern: { value: wt, message: "" },
968
- onBlur: () => M("phone")
969
- }), $ = v("personalCheckBox"), j = v("advCheckBox"), m = (P) => {
970
- u(P), F();
973
+ onBlur: () => j("phone")
974
+ }), H = se("personalCheckBox"), F = se("advCheckBox"), Q = (ie) => {
975
+ g(ie), C();
971
976
  };
972
- return /* @__PURE__ */ W(
977
+ return /* @__PURE__ */ N(
973
978
  Vt,
974
979
  {
975
980
  isOpen: e,
@@ -979,73 +984,98 @@ const it = `Я принимаю условия Политики обработк
979
984
  isTransparentBack: !0,
980
985
  additionalClassModalBody: X.modalBody,
981
986
  children: /* @__PURE__ */ Se("div", { className: X.root, children: [
982
- /* @__PURE__ */ W("div", { className: X.title, dangerouslySetInnerHTML: { __html: r ?? "Оставить обращение" } }),
983
- /* @__PURE__ */ W(
987
+ /* @__PURE__ */ N("div", { className: X.title, dangerouslySetInnerHTML: { __html: r ?? "Оставить обращение" } }),
988
+ /* @__PURE__ */ N(
984
989
  "div",
985
990
  {
986
991
  className: X.description,
987
- dangerouslySetInnerHTML: { __html: l ?? "Оставьте номер телефона для получения консультации" }
992
+ dangerouslySetInnerHTML: { __html: y ?? "Оставьте номер телефона для получения консультации" }
988
993
  }
989
994
  ),
990
- /* @__PURE__ */ Se("form", { onSubmit: R(m), children: [
991
- /* @__PURE__ */ Se(Ft, { className: X.inputWrapper, children: [
992
- /* @__PURE__ */ W(
993
- je,
995
+ /* @__PURE__ */ Se("form", { onSubmit: re(Q), children: [
996
+ /* @__PURE__ */ Se(At, { className: X.inputWrapper, children: [
997
+ /* @__PURE__ */ N(
998
+ Ee,
994
999
  {
995
1000
  width: "full",
996
1001
  size_s: "small",
997
1002
  variant: "light",
998
1003
  placeholder: "Введите имя",
999
1004
  "data-testid": "modal_name",
1000
- ...g("name", { required: !0, pattern: pt }),
1001
- error: !!G.name
1005
+ ...v("name", { required: !0, pattern: pt }),
1006
+ error: !!T.name
1002
1007
  }
1003
1008
  ),
1004
- /* @__PURE__ */ W(
1009
+ /* @__PURE__ */ N(
1005
1010
  xt,
1006
1011
  {
1007
1012
  inputMode: "numeric",
1008
1013
  name: "phone",
1009
1014
  mask: "+7 (999) 999-99-99",
1010
- onChange: z,
1015
+ onChange: K,
1011
1016
  placeholder: "+7 (- - -) - - - - - - -",
1012
- onBlur: C,
1013
- children: /* @__PURE__ */ W(
1014
- je,
1017
+ onBlur: m,
1018
+ children: /* @__PURE__ */ N(
1019
+ Ee,
1015
1020
  {
1016
1021
  width: "full",
1017
1022
  "data-testid": "phone_modal",
1018
1023
  type: "tel",
1019
1024
  size_s: "small",
1020
1025
  variant: "light",
1021
- ...le,
1022
- ...g("phone"),
1023
- error: !!G.phone
1026
+ ...W,
1027
+ ...v("phone"),
1028
+ error: !!T.phone
1024
1029
  }
1025
1030
  )
1026
1031
  }
1027
1032
  ),
1028
- y && /* @__PURE__ */ W(
1033
+ n && /* @__PURE__ */ N(
1034
+ Ee,
1035
+ {
1036
+ width: "full",
1037
+ size_s: "small",
1038
+ variant: "light",
1039
+ placeholder: "Введите email",
1040
+ "data-testid": "modal_email",
1041
+ ...v(
1042
+ "email",
1043
+ { required: !1, pattern: Dt }
1044
+ ),
1045
+ error: !!T.email
1046
+ }
1047
+ ),
1048
+ u && /* @__PURE__ */ N(
1049
+ kt,
1050
+ {
1051
+ "data-testid": "modal_textarea",
1052
+ placeholder: l,
1053
+ rows: L,
1054
+ width: "full",
1055
+ ...v("textarea")
1056
+ }
1057
+ ),
1058
+ V && /* @__PURE__ */ N(
1029
1059
  Ge,
1030
1060
  {
1031
1061
  "data-testid": "modal_advCheckBox",
1032
- isChecked: j,
1033
- error: !!G.advCheckBox,
1034
- text: y.text,
1035
- ...g("advCheckBox", { required: y == null ? void 0 : y.isRequired })
1062
+ isChecked: F,
1063
+ error: !!T.advCheckBox,
1064
+ text: V.text,
1065
+ ...v("advCheckBox", { required: V == null ? void 0 : V.isRequired })
1036
1066
  }
1037
1067
  ),
1038
- /* @__PURE__ */ W(
1068
+ /* @__PURE__ */ N(
1039
1069
  Ge,
1040
1070
  {
1041
1071
  "data-testid": "modal_personalCheckBox",
1042
- isChecked: $,
1043
- error: !!G.personalCheckBox,
1044
- text: a.text,
1045
- ...g("personalCheckBox", { required: a.isRequired })
1072
+ isChecked: H,
1073
+ error: !!T.personalCheckBox,
1074
+ text: M.text,
1075
+ ...v("personalCheckBox", { required: M.isRequired })
1046
1076
  }
1047
1077
  ),
1048
- /* @__PURE__ */ W(
1078
+ /* @__PURE__ */ N(
1049
1079
  Ke,
1050
1080
  {
1051
1081
  "data-testid": "modal_submit",
@@ -1059,7 +1089,7 @@ const it = `Я принимаю условия Политики обработк
1059
1089
  }
1060
1090
  )
1061
1091
  ] }),
1062
- /* @__PURE__ */ W(
1092
+ /* @__PURE__ */ N(
1063
1093
  Ke,
1064
1094
  {
1065
1095
  additionalClass: X.btn,
@@ -1068,8 +1098,8 @@ const it = `Я принимаю условия Политики обработк
1068
1098
  variant: "gray",
1069
1099
  type: "button",
1070
1100
  size: "small",
1071
- children: /* @__PURE__ */ W(
1072
- At,
1101
+ children: /* @__PURE__ */ N(
1102
+ Ft,
1073
1103
  {
1074
1104
  name: "close",
1075
1105
  size: "16",
@@ -1084,5 +1114,5 @@ const it = `Я принимаю условия Политики обработк
1084
1114
  );
1085
1115
  };
1086
1116
  export {
1087
- dr as ModalForm
1117
+ gr as ModalForm
1088
1118
  };