stone-kit 0.0.188 → 0.0.190
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/components/FormModal/ui/ModalForm.d.ts +3 -2
- package/dist/components/FormModal/ui/ModalForm.js +699 -2246
- package/dist/components/SortSelect/ui/SortSelect.js +8 -6
- package/dist/index-DB-VhohW.js +1559 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +12 -10
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,1629 +1,77 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { Button as
|
|
8
|
-
import { NewIcon as
|
|
9
|
-
import { phoneReg as
|
|
10
|
-
import { CheckBox as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
|
-
var Vt;
|
|
21
|
-
function Or() {
|
|
22
|
-
if (Vt)
|
|
23
|
-
return se;
|
|
24
|
-
Vt = 1;
|
|
25
|
-
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, l = e ? Symbol.for("react.fragment") : 60107, f = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, E = e ? Symbol.for("react.provider") : 60109, k = e ? Symbol.for("react.context") : 60110, X = e ? Symbol.for("react.async_mode") : 60111, H = e ? Symbol.for("react.concurrent_mode") : 60111, L = e ? Symbol.for("react.forward_ref") : 60112, V = e ? Symbol.for("react.suspense") : 60113, ne = e ? Symbol.for("react.suspense_list") : 60120, G = e ? Symbol.for("react.memo") : 60115, te = e ? Symbol.for("react.lazy") : 60116, K = e ? Symbol.for("react.block") : 60121, re = e ? Symbol.for("react.fundamental") : 60117, ue = e ? Symbol.for("react.responder") : 60118, Z = e ? Symbol.for("react.scope") : 60119;
|
|
26
|
-
function ie(o) {
|
|
27
|
-
if (typeof o == "object" && o !== null) {
|
|
28
|
-
var _ = o.$$typeof;
|
|
29
|
-
switch (_) {
|
|
30
|
-
case t:
|
|
31
|
-
switch (o = o.type, o) {
|
|
32
|
-
case X:
|
|
33
|
-
case H:
|
|
34
|
-
case l:
|
|
35
|
-
case i:
|
|
36
|
-
case f:
|
|
37
|
-
case V:
|
|
38
|
-
return o;
|
|
39
|
-
default:
|
|
40
|
-
switch (o = o && o.$$typeof, o) {
|
|
41
|
-
case k:
|
|
42
|
-
case L:
|
|
43
|
-
case te:
|
|
44
|
-
case G:
|
|
45
|
-
case E:
|
|
46
|
-
return o;
|
|
47
|
-
default:
|
|
48
|
-
return _;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
case r:
|
|
52
|
-
return _;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function ee(o) {
|
|
57
|
-
return ie(o) === H;
|
|
58
|
-
}
|
|
59
|
-
return se.AsyncMode = X, se.ConcurrentMode = H, se.ContextConsumer = k, se.ContextProvider = E, se.Element = t, se.ForwardRef = L, se.Fragment = l, se.Lazy = te, se.Memo = G, se.Portal = r, se.Profiler = i, se.StrictMode = f, se.Suspense = V, se.isAsyncMode = function(o) {
|
|
60
|
-
return ee(o) || ie(o) === X;
|
|
61
|
-
}, se.isConcurrentMode = ee, se.isContextConsumer = function(o) {
|
|
62
|
-
return ie(o) === k;
|
|
63
|
-
}, se.isContextProvider = function(o) {
|
|
64
|
-
return ie(o) === E;
|
|
65
|
-
}, se.isElement = function(o) {
|
|
66
|
-
return typeof o == "object" && o !== null && o.$$typeof === t;
|
|
67
|
-
}, se.isForwardRef = function(o) {
|
|
68
|
-
return ie(o) === L;
|
|
69
|
-
}, se.isFragment = function(o) {
|
|
70
|
-
return ie(o) === l;
|
|
71
|
-
}, se.isLazy = function(o) {
|
|
72
|
-
return ie(o) === te;
|
|
73
|
-
}, se.isMemo = function(o) {
|
|
74
|
-
return ie(o) === G;
|
|
75
|
-
}, se.isPortal = function(o) {
|
|
76
|
-
return ie(o) === r;
|
|
77
|
-
}, se.isProfiler = function(o) {
|
|
78
|
-
return ie(o) === i;
|
|
79
|
-
}, se.isStrictMode = function(o) {
|
|
80
|
-
return ie(o) === f;
|
|
81
|
-
}, se.isSuspense = function(o) {
|
|
82
|
-
return ie(o) === V;
|
|
83
|
-
}, se.isValidElementType = function(o) {
|
|
84
|
-
return typeof o == "string" || typeof o == "function" || o === l || o === H || o === i || o === f || o === V || o === ne || typeof o == "object" && o !== null && (o.$$typeof === te || o.$$typeof === G || o.$$typeof === E || o.$$typeof === k || o.$$typeof === L || o.$$typeof === re || o.$$typeof === ue || o.$$typeof === Z || o.$$typeof === K);
|
|
85
|
-
}, se.typeOf = ie, se;
|
|
86
|
-
}
|
|
87
|
-
var oe = {};
|
|
88
|
-
/** @license React v16.13.1
|
|
89
|
-
* react-is.development.js
|
|
90
|
-
*
|
|
91
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the MIT license found in the
|
|
94
|
-
* LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/
|
|
96
|
-
var Ft;
|
|
97
|
-
function Cr() {
|
|
98
|
-
return Ft || (Ft = 1, process.env.NODE_ENV !== "production" && function() {
|
|
99
|
-
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, l = e ? Symbol.for("react.fragment") : 60107, f = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, E = e ? Symbol.for("react.provider") : 60109, k = e ? Symbol.for("react.context") : 60110, X = e ? Symbol.for("react.async_mode") : 60111, H = e ? Symbol.for("react.concurrent_mode") : 60111, L = e ? Symbol.for("react.forward_ref") : 60112, V = e ? Symbol.for("react.suspense") : 60113, ne = e ? Symbol.for("react.suspense_list") : 60120, G = e ? Symbol.for("react.memo") : 60115, te = e ? Symbol.for("react.lazy") : 60116, K = e ? Symbol.for("react.block") : 60121, re = e ? Symbol.for("react.fundamental") : 60117, ue = e ? Symbol.for("react.responder") : 60118, Z = e ? Symbol.for("react.scope") : 60119;
|
|
100
|
-
function ie(h) {
|
|
101
|
-
return typeof h == "string" || typeof h == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
102
|
-
h === l || h === H || h === i || h === f || h === V || h === ne || typeof h == "object" && h !== null && (h.$$typeof === te || h.$$typeof === G || h.$$typeof === E || h.$$typeof === k || h.$$typeof === L || h.$$typeof === re || h.$$typeof === ue || h.$$typeof === Z || h.$$typeof === K);
|
|
103
|
-
}
|
|
104
|
-
function ee(h) {
|
|
105
|
-
if (typeof h == "object" && h !== null) {
|
|
106
|
-
var I = h.$$typeof;
|
|
107
|
-
switch (I) {
|
|
108
|
-
case t:
|
|
109
|
-
var q = h.type;
|
|
110
|
-
switch (q) {
|
|
111
|
-
case X:
|
|
112
|
-
case H:
|
|
113
|
-
case l:
|
|
114
|
-
case i:
|
|
115
|
-
case f:
|
|
116
|
-
case V:
|
|
117
|
-
return q;
|
|
118
|
-
default:
|
|
119
|
-
var $ = q && q.$$typeof;
|
|
120
|
-
switch ($) {
|
|
121
|
-
case k:
|
|
122
|
-
case L:
|
|
123
|
-
case te:
|
|
124
|
-
case G:
|
|
125
|
-
case E:
|
|
126
|
-
return $;
|
|
127
|
-
default:
|
|
128
|
-
return I;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
case r:
|
|
132
|
-
return I;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
var o = X, _ = H, m = k, b = E, P = t, F = L, Y = l, T = te, B = G, W = r, M = i, R = f, z = V, J = !1;
|
|
137
|
-
function le(h) {
|
|
138
|
-
return J || (J = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), g(h) || ee(h) === X;
|
|
139
|
-
}
|
|
140
|
-
function g(h) {
|
|
141
|
-
return ee(h) === H;
|
|
142
|
-
}
|
|
143
|
-
function S(h) {
|
|
144
|
-
return ee(h) === k;
|
|
145
|
-
}
|
|
146
|
-
function v(h) {
|
|
147
|
-
return ee(h) === E;
|
|
148
|
-
}
|
|
149
|
-
function u(h) {
|
|
150
|
-
return typeof h == "object" && h !== null && h.$$typeof === t;
|
|
151
|
-
}
|
|
152
|
-
function a(h) {
|
|
153
|
-
return ee(h) === L;
|
|
154
|
-
}
|
|
155
|
-
function c(h) {
|
|
156
|
-
return ee(h) === l;
|
|
157
|
-
}
|
|
158
|
-
function y(h) {
|
|
159
|
-
return ee(h) === te;
|
|
160
|
-
}
|
|
161
|
-
function p(h) {
|
|
162
|
-
return ee(h) === G;
|
|
163
|
-
}
|
|
164
|
-
function D(h) {
|
|
165
|
-
return ee(h) === r;
|
|
166
|
-
}
|
|
167
|
-
function O(h) {
|
|
168
|
-
return ee(h) === i;
|
|
169
|
-
}
|
|
170
|
-
function C(h) {
|
|
171
|
-
return ee(h) === f;
|
|
172
|
-
}
|
|
173
|
-
function U(h) {
|
|
174
|
-
return ee(h) === V;
|
|
175
|
-
}
|
|
176
|
-
oe.AsyncMode = o, oe.ConcurrentMode = _, oe.ContextConsumer = m, oe.ContextProvider = b, oe.Element = P, oe.ForwardRef = F, oe.Fragment = Y, oe.Lazy = T, oe.Memo = B, oe.Portal = W, oe.Profiler = M, oe.StrictMode = R, oe.Suspense = z, oe.isAsyncMode = le, oe.isConcurrentMode = g, oe.isContextConsumer = S, oe.isContextProvider = v, oe.isElement = u, oe.isForwardRef = a, oe.isFragment = c, oe.isLazy = y, oe.isMemo = p, oe.isPortal = D, oe.isProfiler = O, oe.isStrictMode = C, oe.isSuspense = U, oe.isValidElementType = ie, oe.typeOf = ee;
|
|
177
|
-
}()), oe;
|
|
178
|
-
}
|
|
179
|
-
var Dt;
|
|
180
|
-
function nr() {
|
|
181
|
-
return Dt || (Dt = 1, process.env.NODE_ENV === "production" ? He.exports = Or() : He.exports = Cr()), He.exports;
|
|
182
|
-
}
|
|
183
|
-
/*
|
|
184
|
-
object-assign
|
|
185
|
-
(c) Sindre Sorhus
|
|
186
|
-
@license MIT
|
|
187
|
-
*/
|
|
188
|
-
var ot, Mt;
|
|
189
|
-
function Ar() {
|
|
190
|
-
if (Mt)
|
|
191
|
-
return ot;
|
|
192
|
-
Mt = 1;
|
|
193
|
-
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
|
|
194
|
-
function l(i) {
|
|
195
|
-
if (i == null)
|
|
196
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
197
|
-
return Object(i);
|
|
198
|
-
}
|
|
199
|
-
function f() {
|
|
200
|
-
try {
|
|
201
|
-
if (!Object.assign)
|
|
202
|
-
return !1;
|
|
203
|
-
var i = new String("abc");
|
|
204
|
-
if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
|
|
205
|
-
return !1;
|
|
206
|
-
for (var E = {}, k = 0; k < 10; k++)
|
|
207
|
-
E["_" + String.fromCharCode(k)] = k;
|
|
208
|
-
var X = Object.getOwnPropertyNames(E).map(function(L) {
|
|
209
|
-
return E[L];
|
|
210
|
-
});
|
|
211
|
-
if (X.join("") !== "0123456789")
|
|
212
|
-
return !1;
|
|
213
|
-
var H = {};
|
|
214
|
-
return "abcdefghijklmnopqrst".split("").forEach(function(L) {
|
|
215
|
-
H[L] = L;
|
|
216
|
-
}), Object.keys(Object.assign({}, H)).join("") === "abcdefghijklmnopqrst";
|
|
217
|
-
} catch {
|
|
218
|
-
return !1;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return ot = f() ? Object.assign : function(i, E) {
|
|
222
|
-
for (var k, X = l(i), H, L = 1; L < arguments.length; L++) {
|
|
223
|
-
k = Object(arguments[L]);
|
|
224
|
-
for (var V in k)
|
|
225
|
-
t.call(k, V) && (X[V] = k[V]);
|
|
226
|
-
if (e) {
|
|
227
|
-
H = e(k);
|
|
228
|
-
for (var ne = 0; ne < H.length; ne++)
|
|
229
|
-
r.call(k, H[ne]) && (X[H[ne]] = k[H[ne]]);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return X;
|
|
233
|
-
}, ot;
|
|
234
|
-
}
|
|
235
|
-
var ut, Lt;
|
|
236
|
-
function Et() {
|
|
237
|
-
if (Lt)
|
|
238
|
-
return ut;
|
|
239
|
-
Lt = 1;
|
|
240
|
-
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
241
|
-
return ut = e, ut;
|
|
242
|
-
}
|
|
243
|
-
var lt, It;
|
|
244
|
-
function ir() {
|
|
245
|
-
return It || (It = 1, lt = Function.call.bind(Object.prototype.hasOwnProperty)), lt;
|
|
246
|
-
}
|
|
247
|
-
var ct, jt;
|
|
248
|
-
function Tr() {
|
|
249
|
-
if (jt)
|
|
250
|
-
return ct;
|
|
251
|
-
jt = 1;
|
|
252
|
-
var e = function() {
|
|
253
|
-
};
|
|
254
|
-
if (process.env.NODE_ENV !== "production") {
|
|
255
|
-
var t = Et(), r = {}, l = ir();
|
|
256
|
-
e = function(i) {
|
|
257
|
-
var E = "Warning: " + i;
|
|
258
|
-
typeof console < "u" && console.error(E);
|
|
259
|
-
try {
|
|
260
|
-
throw new Error(E);
|
|
261
|
-
} catch {
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
function f(i, E, k, X, H) {
|
|
266
|
-
if (process.env.NODE_ENV !== "production") {
|
|
267
|
-
for (var L in i)
|
|
268
|
-
if (l(i, L)) {
|
|
269
|
-
var V;
|
|
270
|
-
try {
|
|
271
|
-
if (typeof i[L] != "function") {
|
|
272
|
-
var ne = Error(
|
|
273
|
-
(X || "React class") + ": " + k + " type `" + L + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[L] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
274
|
-
);
|
|
275
|
-
throw ne.name = "Invariant Violation", ne;
|
|
276
|
-
}
|
|
277
|
-
V = i[L](E, L, X, k, null, t);
|
|
278
|
-
} catch (te) {
|
|
279
|
-
V = te;
|
|
280
|
-
}
|
|
281
|
-
if (V && !(V instanceof Error) && e(
|
|
282
|
-
(X || "React class") + ": type specification of " + k + " `" + L + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof V + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
283
|
-
), V instanceof Error && !(V.message in r)) {
|
|
284
|
-
r[V.message] = !0;
|
|
285
|
-
var G = H ? H() : "";
|
|
286
|
-
e(
|
|
287
|
-
"Failed " + k + " type: " + V.message + (G ?? "")
|
|
288
|
-
);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return f.resetWarningCache = function() {
|
|
294
|
-
process.env.NODE_ENV !== "production" && (r = {});
|
|
295
|
-
}, ct = f, ct;
|
|
296
|
-
}
|
|
297
|
-
var ft, qt;
|
|
298
|
-
function Rr() {
|
|
299
|
-
if (qt)
|
|
300
|
-
return ft;
|
|
301
|
-
qt = 1;
|
|
302
|
-
var e = nr(), t = Ar(), r = Et(), l = ir(), f = Tr(), i = function() {
|
|
303
|
-
};
|
|
304
|
-
process.env.NODE_ENV !== "production" && (i = function(k) {
|
|
305
|
-
var X = "Warning: " + k;
|
|
306
|
-
typeof console < "u" && console.error(X);
|
|
307
|
-
try {
|
|
308
|
-
throw new Error(X);
|
|
309
|
-
} catch {
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
function E() {
|
|
313
|
-
return null;
|
|
314
|
-
}
|
|
315
|
-
return ft = function(k, X) {
|
|
316
|
-
var H = typeof Symbol == "function" && Symbol.iterator, L = "@@iterator";
|
|
317
|
-
function V(g) {
|
|
318
|
-
var S = g && (H && g[H] || g[L]);
|
|
319
|
-
if (typeof S == "function")
|
|
320
|
-
return S;
|
|
321
|
-
}
|
|
322
|
-
var ne = "<<anonymous>>", G = {
|
|
323
|
-
array: ue("array"),
|
|
324
|
-
bigint: ue("bigint"),
|
|
325
|
-
bool: ue("boolean"),
|
|
326
|
-
func: ue("function"),
|
|
327
|
-
number: ue("number"),
|
|
328
|
-
object: ue("object"),
|
|
329
|
-
string: ue("string"),
|
|
330
|
-
symbol: ue("symbol"),
|
|
331
|
-
any: Z(),
|
|
332
|
-
arrayOf: ie,
|
|
333
|
-
element: ee(),
|
|
334
|
-
elementType: o(),
|
|
335
|
-
instanceOf: _,
|
|
336
|
-
node: F(),
|
|
337
|
-
objectOf: b,
|
|
338
|
-
oneOf: m,
|
|
339
|
-
oneOfType: P,
|
|
340
|
-
shape: T,
|
|
341
|
-
exact: B
|
|
342
|
-
};
|
|
343
|
-
function te(g, S) {
|
|
344
|
-
return g === S ? g !== 0 || 1 / g === 1 / S : g !== g && S !== S;
|
|
345
|
-
}
|
|
346
|
-
function K(g, S) {
|
|
347
|
-
this.message = g, this.data = S && typeof S == "object" ? S : {}, this.stack = "";
|
|
348
|
-
}
|
|
349
|
-
K.prototype = Error.prototype;
|
|
350
|
-
function re(g) {
|
|
351
|
-
if (process.env.NODE_ENV !== "production")
|
|
352
|
-
var S = {}, v = 0;
|
|
353
|
-
function u(c, y, p, D, O, C, U) {
|
|
354
|
-
if (D = D || ne, C = C || p, U !== r) {
|
|
355
|
-
if (X) {
|
|
356
|
-
var h = new Error(
|
|
357
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
358
|
-
);
|
|
359
|
-
throw h.name = "Invariant Violation", h;
|
|
360
|
-
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
361
|
-
var I = D + ":" + p;
|
|
362
|
-
!S[I] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
363
|
-
v < 3 && (i(
|
|
364
|
-
"You are manually calling a React.PropTypes validation function for the `" + C + "` prop on `" + D + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
365
|
-
), S[I] = !0, v++);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
return y[p] == null ? c ? y[p] === null ? new K("The " + O + " `" + C + "` is marked as required " + ("in `" + D + "`, but its value is `null`.")) : new K("The " + O + " `" + C + "` is marked as required in " + ("`" + D + "`, but its value is `undefined`.")) : null : g(y, p, D, O, C);
|
|
369
|
-
}
|
|
370
|
-
var a = u.bind(null, !1);
|
|
371
|
-
return a.isRequired = u.bind(null, !0), a;
|
|
372
|
-
}
|
|
373
|
-
function ue(g) {
|
|
374
|
-
function S(v, u, a, c, y, p) {
|
|
375
|
-
var D = v[u], O = R(D);
|
|
376
|
-
if (O !== g) {
|
|
377
|
-
var C = z(D);
|
|
378
|
-
return new K(
|
|
379
|
-
"Invalid " + c + " `" + y + "` of type " + ("`" + C + "` supplied to `" + a + "`, expected ") + ("`" + g + "`."),
|
|
380
|
-
{ expectedType: g }
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
return null;
|
|
384
|
-
}
|
|
385
|
-
return re(S);
|
|
386
|
-
}
|
|
387
|
-
function Z() {
|
|
388
|
-
return re(E);
|
|
389
|
-
}
|
|
390
|
-
function ie(g) {
|
|
391
|
-
function S(v, u, a, c, y) {
|
|
392
|
-
if (typeof g != "function")
|
|
393
|
-
return new K("Property `" + y + "` of component `" + a + "` has invalid PropType notation inside arrayOf.");
|
|
394
|
-
var p = v[u];
|
|
395
|
-
if (!Array.isArray(p)) {
|
|
396
|
-
var D = R(p);
|
|
397
|
-
return new K("Invalid " + c + " `" + y + "` of type " + ("`" + D + "` supplied to `" + a + "`, expected an array."));
|
|
398
|
-
}
|
|
399
|
-
for (var O = 0; O < p.length; O++) {
|
|
400
|
-
var C = g(p, O, a, c, y + "[" + O + "]", r);
|
|
401
|
-
if (C instanceof Error)
|
|
402
|
-
return C;
|
|
403
|
-
}
|
|
404
|
-
return null;
|
|
405
|
-
}
|
|
406
|
-
return re(S);
|
|
407
|
-
}
|
|
408
|
-
function ee() {
|
|
409
|
-
function g(S, v, u, a, c) {
|
|
410
|
-
var y = S[v];
|
|
411
|
-
if (!k(y)) {
|
|
412
|
-
var p = R(y);
|
|
413
|
-
return new K("Invalid " + a + " `" + c + "` of type " + ("`" + p + "` supplied to `" + u + "`, expected a single ReactElement."));
|
|
414
|
-
}
|
|
415
|
-
return null;
|
|
416
|
-
}
|
|
417
|
-
return re(g);
|
|
418
|
-
}
|
|
419
|
-
function o() {
|
|
420
|
-
function g(S, v, u, a, c) {
|
|
421
|
-
var y = S[v];
|
|
422
|
-
if (!e.isValidElementType(y)) {
|
|
423
|
-
var p = R(y);
|
|
424
|
-
return new K("Invalid " + a + " `" + c + "` of type " + ("`" + p + "` supplied to `" + u + "`, expected a single ReactElement type."));
|
|
425
|
-
}
|
|
426
|
-
return null;
|
|
427
|
-
}
|
|
428
|
-
return re(g);
|
|
429
|
-
}
|
|
430
|
-
function _(g) {
|
|
431
|
-
function S(v, u, a, c, y) {
|
|
432
|
-
if (!(v[u] instanceof g)) {
|
|
433
|
-
var p = g.name || ne, D = le(v[u]);
|
|
434
|
-
return new K("Invalid " + c + " `" + y + "` of type " + ("`" + D + "` supplied to `" + a + "`, expected ") + ("instance of `" + p + "`."));
|
|
435
|
-
}
|
|
436
|
-
return null;
|
|
437
|
-
}
|
|
438
|
-
return re(S);
|
|
439
|
-
}
|
|
440
|
-
function m(g) {
|
|
441
|
-
if (!Array.isArray(g))
|
|
442
|
-
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
|
|
443
|
-
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
444
|
-
) : i("Invalid argument supplied to oneOf, expected an array.")), E;
|
|
445
|
-
function S(v, u, a, c, y) {
|
|
446
|
-
for (var p = v[u], D = 0; D < g.length; D++)
|
|
447
|
-
if (te(p, g[D]))
|
|
448
|
-
return null;
|
|
449
|
-
var O = JSON.stringify(g, function(U, h) {
|
|
450
|
-
var I = z(h);
|
|
451
|
-
return I === "symbol" ? String(h) : h;
|
|
452
|
-
});
|
|
453
|
-
return new K("Invalid " + c + " `" + y + "` of value `" + String(p) + "` " + ("supplied to `" + a + "`, expected one of " + O + "."));
|
|
454
|
-
}
|
|
455
|
-
return re(S);
|
|
456
|
-
}
|
|
457
|
-
function b(g) {
|
|
458
|
-
function S(v, u, a, c, y) {
|
|
459
|
-
if (typeof g != "function")
|
|
460
|
-
return new K("Property `" + y + "` of component `" + a + "` has invalid PropType notation inside objectOf.");
|
|
461
|
-
var p = v[u], D = R(p);
|
|
462
|
-
if (D !== "object")
|
|
463
|
-
return new K("Invalid " + c + " `" + y + "` of type " + ("`" + D + "` supplied to `" + a + "`, expected an object."));
|
|
464
|
-
for (var O in p)
|
|
465
|
-
if (l(p, O)) {
|
|
466
|
-
var C = g(p, O, a, c, y + "." + O, r);
|
|
467
|
-
if (C instanceof Error)
|
|
468
|
-
return C;
|
|
469
|
-
}
|
|
470
|
-
return null;
|
|
471
|
-
}
|
|
472
|
-
return re(S);
|
|
473
|
-
}
|
|
474
|
-
function P(g) {
|
|
475
|
-
if (!Array.isArray(g))
|
|
476
|
-
return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), E;
|
|
477
|
-
for (var S = 0; S < g.length; S++) {
|
|
478
|
-
var v = g[S];
|
|
479
|
-
if (typeof v != "function")
|
|
480
|
-
return i(
|
|
481
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + J(v) + " at index " + S + "."
|
|
482
|
-
), E;
|
|
483
|
-
}
|
|
484
|
-
function u(a, c, y, p, D) {
|
|
485
|
-
for (var O = [], C = 0; C < g.length; C++) {
|
|
486
|
-
var U = g[C], h = U(a, c, y, p, D, r);
|
|
487
|
-
if (h == null)
|
|
488
|
-
return null;
|
|
489
|
-
h.data && l(h.data, "expectedType") && O.push(h.data.expectedType);
|
|
490
|
-
}
|
|
491
|
-
var I = O.length > 0 ? ", expected one of type [" + O.join(", ") + "]" : "";
|
|
492
|
-
return new K("Invalid " + p + " `" + D + "` supplied to " + ("`" + y + "`" + I + "."));
|
|
493
|
-
}
|
|
494
|
-
return re(u);
|
|
495
|
-
}
|
|
496
|
-
function F() {
|
|
497
|
-
function g(S, v, u, a, c) {
|
|
498
|
-
return W(S[v]) ? null : new K("Invalid " + a + " `" + c + "` supplied to " + ("`" + u + "`, expected a ReactNode."));
|
|
499
|
-
}
|
|
500
|
-
return re(g);
|
|
501
|
-
}
|
|
502
|
-
function Y(g, S, v, u, a) {
|
|
503
|
-
return new K(
|
|
504
|
-
(g || "React class") + ": " + S + " type `" + v + "." + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + a + "`."
|
|
505
|
-
);
|
|
506
|
-
}
|
|
507
|
-
function T(g) {
|
|
508
|
-
function S(v, u, a, c, y) {
|
|
509
|
-
var p = v[u], D = R(p);
|
|
510
|
-
if (D !== "object")
|
|
511
|
-
return new K("Invalid " + c + " `" + y + "` of type `" + D + "` " + ("supplied to `" + a + "`, expected `object`."));
|
|
512
|
-
for (var O in g) {
|
|
513
|
-
var C = g[O];
|
|
514
|
-
if (typeof C != "function")
|
|
515
|
-
return Y(a, c, y, O, z(C));
|
|
516
|
-
var U = C(p, O, a, c, y + "." + O, r);
|
|
517
|
-
if (U)
|
|
518
|
-
return U;
|
|
519
|
-
}
|
|
520
|
-
return null;
|
|
521
|
-
}
|
|
522
|
-
return re(S);
|
|
523
|
-
}
|
|
524
|
-
function B(g) {
|
|
525
|
-
function S(v, u, a, c, y) {
|
|
526
|
-
var p = v[u], D = R(p);
|
|
527
|
-
if (D !== "object")
|
|
528
|
-
return new K("Invalid " + c + " `" + y + "` of type `" + D + "` " + ("supplied to `" + a + "`, expected `object`."));
|
|
529
|
-
var O = t({}, v[u], g);
|
|
530
|
-
for (var C in O) {
|
|
531
|
-
var U = g[C];
|
|
532
|
-
if (l(g, C) && typeof U != "function")
|
|
533
|
-
return Y(a, c, y, C, z(U));
|
|
534
|
-
if (!U)
|
|
535
|
-
return new K(
|
|
536
|
-
"Invalid " + c + " `" + y + "` key `" + C + "` supplied to `" + a + "`.\nBad object: " + JSON.stringify(v[u], null, " ") + `
|
|
537
|
-
Valid keys: ` + JSON.stringify(Object.keys(g), null, " ")
|
|
538
|
-
);
|
|
539
|
-
var h = U(p, C, a, c, y + "." + C, r);
|
|
540
|
-
if (h)
|
|
541
|
-
return h;
|
|
542
|
-
}
|
|
543
|
-
return null;
|
|
544
|
-
}
|
|
545
|
-
return re(S);
|
|
546
|
-
}
|
|
547
|
-
function W(g) {
|
|
548
|
-
switch (typeof g) {
|
|
549
|
-
case "number":
|
|
550
|
-
case "string":
|
|
551
|
-
case "undefined":
|
|
552
|
-
return !0;
|
|
553
|
-
case "boolean":
|
|
554
|
-
return !g;
|
|
555
|
-
case "object":
|
|
556
|
-
if (Array.isArray(g))
|
|
557
|
-
return g.every(W);
|
|
558
|
-
if (g === null || k(g))
|
|
559
|
-
return !0;
|
|
560
|
-
var S = V(g);
|
|
561
|
-
if (S) {
|
|
562
|
-
var v = S.call(g), u;
|
|
563
|
-
if (S !== g.entries) {
|
|
564
|
-
for (; !(u = v.next()).done; )
|
|
565
|
-
if (!W(u.value))
|
|
566
|
-
return !1;
|
|
567
|
-
} else
|
|
568
|
-
for (; !(u = v.next()).done; ) {
|
|
569
|
-
var a = u.value;
|
|
570
|
-
if (a && !W(a[1]))
|
|
571
|
-
return !1;
|
|
572
|
-
}
|
|
573
|
-
} else
|
|
574
|
-
return !1;
|
|
575
|
-
return !0;
|
|
576
|
-
default:
|
|
577
|
-
return !1;
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
function M(g, S) {
|
|
581
|
-
return g === "symbol" ? !0 : S ? S["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && S instanceof Symbol : !1;
|
|
582
|
-
}
|
|
583
|
-
function R(g) {
|
|
584
|
-
var S = typeof g;
|
|
585
|
-
return Array.isArray(g) ? "array" : g instanceof RegExp ? "object" : M(S, g) ? "symbol" : S;
|
|
586
|
-
}
|
|
587
|
-
function z(g) {
|
|
588
|
-
if (typeof g > "u" || g === null)
|
|
589
|
-
return "" + g;
|
|
590
|
-
var S = R(g);
|
|
591
|
-
if (S === "object") {
|
|
592
|
-
if (g instanceof Date)
|
|
593
|
-
return "date";
|
|
594
|
-
if (g instanceof RegExp)
|
|
595
|
-
return "regexp";
|
|
596
|
-
}
|
|
597
|
-
return S;
|
|
598
|
-
}
|
|
599
|
-
function J(g) {
|
|
600
|
-
var S = z(g);
|
|
601
|
-
switch (S) {
|
|
602
|
-
case "array":
|
|
603
|
-
case "object":
|
|
604
|
-
return "an " + S;
|
|
605
|
-
case "boolean":
|
|
606
|
-
case "date":
|
|
607
|
-
case "regexp":
|
|
608
|
-
return "a " + S;
|
|
609
|
-
default:
|
|
610
|
-
return S;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
function le(g) {
|
|
614
|
-
return !g.constructor || !g.constructor.name ? ne : g.constructor.name;
|
|
615
|
-
}
|
|
616
|
-
return G.checkPropTypes = f, G.resetWarningCache = f.resetWarningCache, G.PropTypes = G, G;
|
|
617
|
-
}, ft;
|
|
618
|
-
}
|
|
619
|
-
var dt, Nt;
|
|
620
|
-
function Vr() {
|
|
621
|
-
if (Nt)
|
|
622
|
-
return dt;
|
|
623
|
-
Nt = 1;
|
|
624
|
-
var e = Et();
|
|
625
|
-
function t() {
|
|
626
|
-
}
|
|
627
|
-
function r() {
|
|
628
|
-
}
|
|
629
|
-
return r.resetWarningCache = t, dt = function() {
|
|
630
|
-
function l(E, k, X, H, L, V) {
|
|
631
|
-
if (V !== e) {
|
|
632
|
-
var ne = new Error(
|
|
633
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
634
|
-
);
|
|
635
|
-
throw ne.name = "Invariant Violation", ne;
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
l.isRequired = l;
|
|
639
|
-
function f() {
|
|
640
|
-
return l;
|
|
641
|
-
}
|
|
642
|
-
var i = {
|
|
643
|
-
array: l,
|
|
644
|
-
bigint: l,
|
|
645
|
-
bool: l,
|
|
646
|
-
func: l,
|
|
647
|
-
number: l,
|
|
648
|
-
object: l,
|
|
649
|
-
string: l,
|
|
650
|
-
symbol: l,
|
|
651
|
-
any: l,
|
|
652
|
-
arrayOf: f,
|
|
653
|
-
element: l,
|
|
654
|
-
elementType: l,
|
|
655
|
-
instanceOf: f,
|
|
656
|
-
node: l,
|
|
657
|
-
objectOf: f,
|
|
658
|
-
oneOf: f,
|
|
659
|
-
oneOfType: f,
|
|
660
|
-
shape: f,
|
|
661
|
-
exact: f,
|
|
662
|
-
checkPropTypes: r,
|
|
663
|
-
resetWarningCache: t
|
|
664
|
-
};
|
|
665
|
-
return i.PropTypes = i, i;
|
|
666
|
-
}, dt;
|
|
667
|
-
}
|
|
668
|
-
var Bt;
|
|
669
|
-
function ar() {
|
|
670
|
-
if (Bt)
|
|
671
|
-
return ze.exports;
|
|
672
|
-
if (Bt = 1, process.env.NODE_ENV !== "production") {
|
|
673
|
-
var e = nr(), t = !0;
|
|
674
|
-
ze.exports = Rr()(e.isElement, t);
|
|
675
|
-
} else
|
|
676
|
-
ze.exports = Vr()();
|
|
677
|
-
return ze.exports;
|
|
678
|
-
}
|
|
679
|
-
var vt, $t;
|
|
680
|
-
function sr() {
|
|
681
|
-
if ($t)
|
|
682
|
-
return vt;
|
|
683
|
-
$t = 1;
|
|
684
|
-
var e = function(t, r, l, f, i, E, k, X) {
|
|
685
|
-
if (process.env.NODE_ENV !== "production" && r === void 0)
|
|
686
|
-
throw new Error("invariant requires an error message argument");
|
|
687
|
-
if (!t) {
|
|
688
|
-
var H;
|
|
689
|
-
if (r === void 0)
|
|
690
|
-
H = new Error(
|
|
691
|
-
"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
|
|
692
|
-
);
|
|
693
|
-
else {
|
|
694
|
-
var L = [l, f, i, E, k, X], V = 0;
|
|
695
|
-
H = new Error(
|
|
696
|
-
r.replace(/%s/g, function() {
|
|
697
|
-
return L[V++];
|
|
698
|
-
})
|
|
699
|
-
), H.name = "Invariant Violation";
|
|
700
|
-
}
|
|
701
|
-
throw H.framesToPop = 1, H;
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
return vt = e, vt;
|
|
705
|
-
}
|
|
706
|
-
var ht, Ut;
|
|
707
|
-
function or() {
|
|
708
|
-
if (Ut)
|
|
709
|
-
return ht;
|
|
710
|
-
Ut = 1;
|
|
711
|
-
var e = process.env.NODE_ENV !== "production", t = function() {
|
|
712
|
-
};
|
|
713
|
-
if (e) {
|
|
714
|
-
var r = function(f, i) {
|
|
715
|
-
var E = arguments.length;
|
|
716
|
-
i = new Array(E > 1 ? E - 1 : 0);
|
|
717
|
-
for (var k = 1; k < E; k++)
|
|
718
|
-
i[k - 1] = arguments[k];
|
|
719
|
-
var X = 0, H = "Warning: " + f.replace(/%s/g, function() {
|
|
720
|
-
return i[X++];
|
|
721
|
-
});
|
|
722
|
-
typeof console < "u" && console.error(H);
|
|
723
|
-
try {
|
|
724
|
-
throw new Error(H);
|
|
725
|
-
} catch {
|
|
726
|
-
}
|
|
727
|
-
};
|
|
728
|
-
t = function(l, f, i) {
|
|
729
|
-
var E = arguments.length;
|
|
730
|
-
i = new Array(E > 2 ? E - 2 : 0);
|
|
731
|
-
for (var k = 2; k < E; k++)
|
|
732
|
-
i[k - 2] = arguments[k];
|
|
733
|
-
if (f === void 0)
|
|
734
|
-
throw new Error(
|
|
735
|
-
"`warning(condition, format, ...args)` requires a warning message argument"
|
|
736
|
-
);
|
|
737
|
-
l || r.apply(null, [f].concat(i));
|
|
738
|
-
};
|
|
739
|
-
}
|
|
740
|
-
return ht = t, ht;
|
|
741
|
-
}
|
|
742
|
-
var Wt;
|
|
743
|
-
function Fr() {
|
|
744
|
-
if (Wt)
|
|
745
|
-
return st.exports;
|
|
746
|
-
Wt = 1;
|
|
747
|
-
function e(o) {
|
|
748
|
-
return o && typeof o == "object" && "default" in o ? o.default : o;
|
|
749
|
-
}
|
|
750
|
-
var t = Pe, r = e(t), l = rr;
|
|
751
|
-
ar();
|
|
752
|
-
var f = e(sr());
|
|
753
|
-
function i() {
|
|
754
|
-
return (i = Object.assign || function(o) {
|
|
755
|
-
for (var _ = 1; _ < arguments.length; _++) {
|
|
756
|
-
var m = arguments[_];
|
|
757
|
-
for (var b in m)
|
|
758
|
-
Object.prototype.hasOwnProperty.call(m, b) && (o[b] = m[b]);
|
|
759
|
-
}
|
|
760
|
-
return o;
|
|
761
|
-
}).apply(this, arguments);
|
|
762
|
-
}
|
|
763
|
-
function E(o, _) {
|
|
764
|
-
o.prototype = Object.create(_.prototype), o.prototype.constructor = o, function(m, b) {
|
|
765
|
-
for (var P = Object.getOwnPropertyNames(b), F = 0; F < P.length; F++) {
|
|
766
|
-
var Y = P[F], T = Object.getOwnPropertyDescriptor(b, Y);
|
|
767
|
-
T && T.configurable && m[Y] === void 0 && Object.defineProperty(m, Y, T);
|
|
768
|
-
}
|
|
769
|
-
}(o, _);
|
|
770
|
-
}
|
|
771
|
-
function k(o, _) {
|
|
772
|
-
if (o == null)
|
|
773
|
-
return {};
|
|
774
|
-
var m, b, P = {}, F = Object.keys(o);
|
|
775
|
-
for (b = 0; b < F.length; b++)
|
|
776
|
-
m = F[b], _.indexOf(m) >= 0 || (P[m] = o[m]);
|
|
777
|
-
return P;
|
|
778
|
-
}
|
|
779
|
-
function X(o) {
|
|
780
|
-
return requestAnimationFrame(o);
|
|
781
|
-
}
|
|
782
|
-
function H(o) {
|
|
783
|
-
cancelAnimationFrame(o);
|
|
784
|
-
}
|
|
785
|
-
function L(o) {
|
|
786
|
-
var _ = o.ownerDocument;
|
|
787
|
-
return _.hasFocus() && _.activeElement === o;
|
|
788
|
-
}
|
|
789
|
-
function V(o) {
|
|
790
|
-
return o == null ? void 0 : o.ownerDocument;
|
|
791
|
-
}
|
|
792
|
-
function ne(o) {
|
|
793
|
-
var _ = function(m) {
|
|
794
|
-
var b;
|
|
795
|
-
return (b = V(m)) == null ? void 0 : b.defaultView;
|
|
796
|
-
}(o);
|
|
797
|
-
return !!_ && o instanceof _.HTMLElement;
|
|
798
|
-
}
|
|
799
|
-
function G(o) {
|
|
800
|
-
return t.useCallback(function() {
|
|
801
|
-
var _ = o.current, m = typeof window < "u" && ne(_);
|
|
802
|
-
if (!_ || !m)
|
|
803
|
-
return null;
|
|
804
|
-
if (_.nodeName !== "INPUT" && (_ = _.querySelector("input")), !_)
|
|
805
|
-
throw new Error("react-input-mask: inputComponent doesn't contain input node");
|
|
806
|
-
return _;
|
|
807
|
-
}, [o]);
|
|
808
|
-
}
|
|
809
|
-
function te(o, _) {
|
|
810
|
-
var m, b, P, F, Y = t.useRef({ start: null, end: null }), T = G(o), B = t.useCallback(function() {
|
|
811
|
-
return function(g) {
|
|
812
|
-
var S = g.selectionStart, v = g.selectionEnd;
|
|
813
|
-
return { start: S, end: v, length: v - S };
|
|
814
|
-
}(T());
|
|
815
|
-
}, [T]), W = t.useCallback(function() {
|
|
816
|
-
return Y.current;
|
|
817
|
-
}, []), M = t.useCallback(function(g) {
|
|
818
|
-
var S = T();
|
|
819
|
-
S && L(S) && (function(v, u, a) {
|
|
820
|
-
a === void 0 && (a = u), v.setSelectionRange(u, a);
|
|
821
|
-
}(S, g.start, g.end), Y.current = B());
|
|
822
|
-
}, [T, B]), R = t.useCallback(function() {
|
|
823
|
-
Y.current = B();
|
|
824
|
-
}, [B]), z = (m = R, b = t.useRef(null), P = t.useCallback(function() {
|
|
825
|
-
b.current === null && function g() {
|
|
826
|
-
m(), b.current = X(g);
|
|
827
|
-
}();
|
|
828
|
-
}, [m]), F = t.useCallback(function() {
|
|
829
|
-
H(b.current), b.current = null;
|
|
830
|
-
}, []), t.useEffect(function() {
|
|
831
|
-
b.current && (F(), P());
|
|
832
|
-
}, [P, F]), t.useEffect(H, []), [P, F]), J = z[0], le = z[1];
|
|
833
|
-
return t.useLayoutEffect(function() {
|
|
834
|
-
if (_) {
|
|
835
|
-
var g = T();
|
|
836
|
-
return g.addEventListener("focus", J), g.addEventListener("blur", le), L(g) && J(), function() {
|
|
837
|
-
g.removeEventListener("focus", J), g.removeEventListener("blur", le), le();
|
|
838
|
-
};
|
|
839
|
-
}
|
|
840
|
-
}), { getSelection: B, getLastSelection: W, setSelection: M };
|
|
841
|
-
}
|
|
842
|
-
function K(o, _) {
|
|
843
|
-
var m = t.useRef(), b = te(m, _), P = b.getSelection, F = b.getLastSelection, Y = b.setSelection, T = function(R, z) {
|
|
844
|
-
var J = G(R), le = t.useRef(z);
|
|
845
|
-
return { getValue: t.useCallback(function() {
|
|
846
|
-
return J().value;
|
|
847
|
-
}, [J]), getLastValue: t.useCallback(function() {
|
|
848
|
-
return le.current;
|
|
849
|
-
}, []), setValue: t.useCallback(function(g) {
|
|
850
|
-
le.current = g;
|
|
851
|
-
var S = J();
|
|
852
|
-
S && (S.value = g);
|
|
853
|
-
}, [J]) };
|
|
854
|
-
}(m, o), B = T.getValue, W = T.getLastValue, M = T.setValue;
|
|
855
|
-
return { inputRef: m, getInputState: function() {
|
|
856
|
-
return { value: B(), selection: P() };
|
|
857
|
-
}, getLastInputState: function() {
|
|
858
|
-
return { value: W(), selection: F() };
|
|
859
|
-
}, setInputState: function(R) {
|
|
860
|
-
var z = R.value, J = R.selection;
|
|
861
|
-
M(z), Y(J);
|
|
862
|
-
} };
|
|
863
|
-
}
|
|
864
|
-
or();
|
|
865
|
-
var re = ["disabled", "onBlur", "onChange", "onFocus", "onMouseDown", "readOnly", "value"], ue = { 9: /[0-9]/, a: /[A-Za-z]/, "*": /[A-Za-z0-9]/ }, Z = function(o) {
|
|
866
|
-
var _ = this;
|
|
867
|
-
this.isCharacterAllowedAtPosition = function(m, b) {
|
|
868
|
-
var P = _.maskOptions.maskPlaceholder;
|
|
869
|
-
return !!_.isCharacterFillingPosition(m, b) || !!P && P[b] === m;
|
|
870
|
-
}, this.isCharacterFillingPosition = function(m, b) {
|
|
871
|
-
var P = _.maskOptions.mask;
|
|
872
|
-
if (!m || b >= P.length)
|
|
873
|
-
return !1;
|
|
874
|
-
if (!_.isPositionEditable(b))
|
|
875
|
-
return P[b] === m;
|
|
876
|
-
var F = P[b];
|
|
877
|
-
return new RegExp(F).test(m);
|
|
878
|
-
}, this.isPositionEditable = function(m) {
|
|
879
|
-
var b = _.maskOptions, P = b.mask, F = b.permanents;
|
|
880
|
-
return m < P.length && F.indexOf(m) === -1;
|
|
881
|
-
}, this.isValueEmpty = function(m) {
|
|
882
|
-
return m.split("").every(function(b, P) {
|
|
883
|
-
return !_.isPositionEditable(P) || !_.isCharacterFillingPosition(b, P);
|
|
884
|
-
});
|
|
885
|
-
}, this.isValueFilled = function(m) {
|
|
886
|
-
return _.getFilledLength(m) === _.maskOptions.lastEditablePosition + 1;
|
|
887
|
-
}, this.getDefaultSelectionForValue = function(m) {
|
|
888
|
-
var b = _.getFilledLength(m), P = _.getRightEditablePosition(b);
|
|
889
|
-
return { start: P, end: P };
|
|
890
|
-
}, this.getFilledLength = function(m) {
|
|
891
|
-
return function(b, P) {
|
|
892
|
-
for (var F = b.length - 1; F >= 0; F--)
|
|
893
|
-
if (P(b[F], F))
|
|
894
|
-
return F;
|
|
895
|
-
return -1;
|
|
896
|
-
}(m.split(""), function(b, P) {
|
|
897
|
-
return _.isPositionEditable(P) && _.isCharacterFillingPosition(b, P);
|
|
898
|
-
}) + 1;
|
|
899
|
-
}, this.getStringFillingLengthAtPosition = function(m, b) {
|
|
900
|
-
return m.split("").reduce(function(P, F) {
|
|
901
|
-
return _.insertCharacterAtPosition(P, F, P.length);
|
|
902
|
-
}, function(P, F) {
|
|
903
|
-
F === void 0 && (F = 1);
|
|
904
|
-
for (var Y = "", T = 0; T < F; T++)
|
|
905
|
-
Y += P;
|
|
906
|
-
return Y;
|
|
907
|
-
}(" ", b)).length - b;
|
|
908
|
-
}, this.getLeftEditablePosition = function(m) {
|
|
909
|
-
for (var b = m; b >= 0; b--)
|
|
910
|
-
if (_.isPositionEditable(b))
|
|
911
|
-
return b;
|
|
912
|
-
return null;
|
|
913
|
-
}, this.getRightEditablePosition = function(m) {
|
|
914
|
-
for (var b = _.maskOptions.mask, P = m; P < b.length; P++)
|
|
915
|
-
if (_.isPositionEditable(P))
|
|
916
|
-
return P;
|
|
917
|
-
return null;
|
|
918
|
-
}, this.formatValue = function(m) {
|
|
919
|
-
var b = _.maskOptions, P = b.maskPlaceholder, F = b.mask;
|
|
920
|
-
if (!P) {
|
|
921
|
-
for (m = _.insertStringAtPosition("", m, 0); m.length < F.length && !_.isPositionEditable(m.length); )
|
|
922
|
-
m += F[m.length];
|
|
923
|
-
return m;
|
|
924
|
-
}
|
|
925
|
-
return _.insertStringAtPosition(P, m, 0);
|
|
926
|
-
}, this.clearRange = function(m, b, P) {
|
|
927
|
-
if (!P)
|
|
928
|
-
return m;
|
|
929
|
-
var F = b + P, Y = _.maskOptions, T = Y.maskPlaceholder, B = Y.mask, W = m.split("").map(function(M, R) {
|
|
930
|
-
var z = _.isPositionEditable(R);
|
|
931
|
-
return !T && R >= F && !z ? "" : R < b || R >= F ? M : z ? T ? T[R] : "" : B[R];
|
|
932
|
-
}).join("");
|
|
933
|
-
return _.formatValue(W);
|
|
934
|
-
}, this.insertCharacterAtPosition = function(m, b, P) {
|
|
935
|
-
var F = _.maskOptions, Y = F.mask, T = F.maskPlaceholder;
|
|
936
|
-
if (P >= Y.length)
|
|
937
|
-
return m;
|
|
938
|
-
var B = _.isCharacterAllowedAtPosition(b, P), W = _.isPositionEditable(P), M = _.getRightEditablePosition(P), R = T && M ? b === T[M] : null, z = m.slice(0, P);
|
|
939
|
-
return !B && W || (m = z + (B ? b : Y[P])), B || W || R || (m = _.insertCharacterAtPosition(m, b, P + 1)), m;
|
|
940
|
-
}, this.insertStringAtPosition = function(m, b, P) {
|
|
941
|
-
var F = _.maskOptions, Y = F.mask, T = F.maskPlaceholder;
|
|
942
|
-
if (!b || P >= Y.length)
|
|
943
|
-
return m;
|
|
944
|
-
var B = b.split(""), W = _.isValueFilled(m) || !!T, M = m.slice(P);
|
|
945
|
-
return m = B.reduce(function(R, z) {
|
|
946
|
-
return _.insertCharacterAtPosition(R, z, R.length);
|
|
947
|
-
}, m.slice(0, P)), W ? m += M.slice(m.length - P) : _.isValueFilled(m) ? m += Y.slice(m.length).join("") : m = M.split("").filter(function(R, z) {
|
|
948
|
-
return _.isPositionEditable(P + z);
|
|
949
|
-
}).reduce(function(R, z) {
|
|
950
|
-
var J = _.getRightEditablePosition(R.length);
|
|
951
|
-
return J === null ? R : (_.isPositionEditable(R.length) || (R += Y.slice(R.length, J).join("")), _.insertCharacterAtPosition(R, z, R.length));
|
|
952
|
-
}, m), m;
|
|
953
|
-
}, this.processChange = function(m, b) {
|
|
954
|
-
var P = _.maskOptions, F = P.mask, Y = P.prefix, T = P.lastEditablePosition, B = m.value, W = m.selection, M = b.value, R = b.selection, z = B, J = "", le = 0, g = 0, S = Math.min(R.start, W.start);
|
|
955
|
-
return W.end > R.start ? (J = z.slice(R.start, W.end), g = (le = _.getStringFillingLengthAtPosition(J, S)) ? R.length : 0) : z.length < M.length && (g = M.length - z.length), z = M, g && (g === 1 && !R.length && (S = R.start === W.start ? _.getRightEditablePosition(W.start) : _.getLeftEditablePosition(W.start)), z = _.clearRange(z, S, g)), z = _.insertStringAtPosition(z, J, S), (S += le) >= F.length ? S = F.length : S < Y.length && !le ? S = Y.length : S >= Y.length && S < T && le && (S = _.getRightEditablePosition(S)), { value: z = _.formatValue(z), enteredString: J, selection: { start: S, end: S } };
|
|
956
|
-
}, this.maskOptions = function(m) {
|
|
957
|
-
var b = m.mask, P = m.maskPlaceholder, F = [];
|
|
958
|
-
if (!b)
|
|
959
|
-
return { maskPlaceholder: null, mask: null, prefix: null, lastEditablePosition: null, permanents: [] };
|
|
960
|
-
if (typeof b == "string") {
|
|
961
|
-
var Y = !1, T = "";
|
|
962
|
-
b.split("").forEach(function(M) {
|
|
963
|
-
Y || M !== "\\" ? (!Y && ue[M] || F.push(T.length), T += M, Y = !1) : Y = !0;
|
|
964
|
-
}), b = T.split("").map(function(M, R) {
|
|
965
|
-
return F.indexOf(R) === -1 ? ue[M] : M;
|
|
966
|
-
});
|
|
967
|
-
} else
|
|
968
|
-
b.forEach(function(M, R) {
|
|
969
|
-
typeof M == "string" && F.push(R);
|
|
970
|
-
});
|
|
971
|
-
P && (P = P.length === 1 ? b.map(function(M, R) {
|
|
972
|
-
return F.indexOf(R) !== -1 ? M : P;
|
|
973
|
-
}) : P.split(""), F.forEach(function(M) {
|
|
974
|
-
P[M] = b[M];
|
|
975
|
-
}), P = P.join(""));
|
|
976
|
-
for (var B = F.filter(function(M, R) {
|
|
977
|
-
return M === R;
|
|
978
|
-
}).map(function(M) {
|
|
979
|
-
return b[M];
|
|
980
|
-
}).join(""), W = b.length - 1; F.indexOf(W) !== -1; )
|
|
981
|
-
W--;
|
|
982
|
-
return { maskPlaceholder: P, prefix: B, mask: b, lastEditablePosition: W, permanents: F };
|
|
983
|
-
}(o);
|
|
984
|
-
}, ie = function(o) {
|
|
985
|
-
function _() {
|
|
986
|
-
return o.apply(this, arguments) || this;
|
|
987
|
-
}
|
|
988
|
-
return E(_, o), _.prototype.render = function() {
|
|
989
|
-
var m = this.props, b = m.children, P = k(m, ["children"]);
|
|
990
|
-
return r.cloneElement(b, P);
|
|
991
|
-
}, _;
|
|
992
|
-
}(r.Component), ee = t.forwardRef(function(o, _) {
|
|
993
|
-
var m = o.alwaysShowMask, b = o.children, P = o.mask, F = o.maskPlaceholder, Y = o.beforeMaskedStateChange, T = k(o, ["alwaysShowMask", "children", "mask", "maskPlaceholder", "beforeMaskedStateChange"]);
|
|
994
|
-
(function(h) {
|
|
995
|
-
var I = h.mask, q = h.maskPlaceholder;
|
|
996
|
-
I && q && q.length !== 1 && q.length !== I.length && f(!1);
|
|
997
|
-
})(o);
|
|
998
|
-
var B, W, M = new Z({ mask: P, maskPlaceholder: F }), R = !!P, z = !T.disabled && !T.readOnly, J = o.value !== null && o.value !== void 0, le = (B = R, W = t.useRef(), t.useEffect(function() {
|
|
999
|
-
W.current = B;
|
|
1000
|
-
}), W.current), g = K(function(h) {
|
|
1001
|
-
return "" + h;
|
|
1002
|
-
}((J ? o.value : o.defaultValue) || ""), R), S = g.inputRef, v = g.getInputState, u = g.setInputState, a = g.getLastInputState, c = G(S);
|
|
1003
|
-
if (R && J) {
|
|
1004
|
-
var y = c(), p = y && L(y) || m || o.value ? M.formatValue(o.value) : o.value;
|
|
1005
|
-
Y && (p = Y({ nextState: { value: p, selection: { start: null, end: null } } }).value), u(i({}, a(), { value: p }));
|
|
1006
|
-
}
|
|
1007
|
-
var D = a(), O = D.selection, C = D.value;
|
|
1008
|
-
t.useLayoutEffect(function() {
|
|
1009
|
-
if (R) {
|
|
1010
|
-
var h = L(c()), I = O, q = v(), $ = i({}, q);
|
|
1011
|
-
if (!J) {
|
|
1012
|
-
var ae = q.value, he = M.formatValue(ae), n = M.isValueEmpty(he);
|
|
1013
|
-
!n || h || m ? $.value = he : n && !h && ($.value = "");
|
|
1014
|
-
}
|
|
1015
|
-
h && !le ? $.selection = M.getDefaultSelectionForValue($.value) : J && h && I && I.start !== null && I.end !== null && ($.selection = I), Y && ($ = Y({ currentState: q, nextState: $ })), u($);
|
|
1016
|
-
}
|
|
1017
|
-
});
|
|
1018
|
-
var U = i({}, T, { onFocus: function(h) {
|
|
1019
|
-
S.current = h.target;
|
|
1020
|
-
var I = v().value;
|
|
1021
|
-
if (R && !M.isValueFilled(I)) {
|
|
1022
|
-
var q = M.formatValue(I), $ = M.getDefaultSelectionForValue(q), ae = { value: q, selection: $ };
|
|
1023
|
-
Y && (q = (ae = Y({ currentState: v(), nextState: ae })).value, $ = ae.selection), u(ae), q !== I && o.onChange && o.onChange(h), X(function() {
|
|
1024
|
-
u(a());
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
o.onFocus && o.onFocus(h);
|
|
1028
|
-
}, onBlur: function(h) {
|
|
1029
|
-
var I = v().value, q = a().value;
|
|
1030
|
-
if (R && !m && M.isValueEmpty(q)) {
|
|
1031
|
-
var $ = "", ae = { value: $, selection: { start: null, end: null } };
|
|
1032
|
-
Y && ($ = (ae = Y({ currentState: v(), nextState: ae })).value), u(ae), $ !== I && o.onChange && o.onChange(h);
|
|
1033
|
-
}
|
|
1034
|
-
o.onBlur && o.onBlur(h);
|
|
1035
|
-
}, onChange: R && z ? function(h) {
|
|
1036
|
-
var I = v(), q = a(), $ = M.processChange(I, q);
|
|
1037
|
-
Y && ($ = Y({ currentState: I, previousState: q, nextState: $ })), u($), o.onChange && o.onChange(h);
|
|
1038
|
-
} : o.onChange, onMouseDown: R && z ? function(h) {
|
|
1039
|
-
var I = c(), q = v().value, $ = V(I);
|
|
1040
|
-
if (!L(I) && !M.isValueFilled(q)) {
|
|
1041
|
-
var ae = h.clientX, he = h.clientY, n = (/* @__PURE__ */ new Date()).getTime();
|
|
1042
|
-
$.addEventListener("mouseup", function s(d) {
|
|
1043
|
-
if ($.removeEventListener("mouseup", s), L(I)) {
|
|
1044
|
-
var A = Math.abs(d.clientX - ae), w = Math.abs(d.clientY - he), x = Math.max(A, w), N = (/* @__PURE__ */ new Date()).getTime() - n;
|
|
1045
|
-
if (x <= 10 && N <= 200 || x <= 5 && N <= 300) {
|
|
1046
|
-
var Q = a(), fe = i({}, Q, { selection: M.getDefaultSelectionForValue(Q.value) });
|
|
1047
|
-
u(fe);
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
});
|
|
1051
|
-
}
|
|
1052
|
-
o.onMouseDown && o.onMouseDown(h);
|
|
1053
|
-
} : o.onMouseDown, ref: function(h) {
|
|
1054
|
-
S.current = l.findDOMNode(h), /* @__PURE__ */ function(I) {
|
|
1055
|
-
return typeof I == "function";
|
|
1056
|
-
}(_) ? _(h) : _ !== null && typeof _ == "object" && (_.current = h);
|
|
1057
|
-
}, value: R && J ? C : o.value });
|
|
1058
|
-
return b ? (function(h, I) {
|
|
1059
|
-
re.filter(function(q) {
|
|
1060
|
-
return I.props[q] != null && I.props[q] !== h[q];
|
|
1061
|
-
}).length && f(!1);
|
|
1062
|
-
}(o, b), r.createElement(ie, U, b)) : r.createElement("input", U);
|
|
1063
|
-
});
|
|
1064
|
-
return ee.displayName = "InputMask", ee.defaultProps = { alwaysShowMask: !1, maskPlaceholder: "_" }, st.exports = ee, st.exports;
|
|
1065
|
-
}
|
|
1066
|
-
var gt, Yt;
|
|
1067
|
-
function Dr() {
|
|
1068
|
-
if (Yt)
|
|
1069
|
-
return gt;
|
|
1070
|
-
Yt = 1;
|
|
1071
|
-
function e(v) {
|
|
1072
|
-
return v && typeof v == "object" && "default" in v ? v.default : v;
|
|
1073
|
-
}
|
|
1074
|
-
var t = Pe, r = e(t), l = rr, f = e(ar()), i = e(sr()), E = e(or());
|
|
1075
|
-
function k(v, u) {
|
|
1076
|
-
for (var a = Object.getOwnPropertyNames(u), c = 0; c < a.length; c++) {
|
|
1077
|
-
var y = a[c], p = Object.getOwnPropertyDescriptor(u, y);
|
|
1078
|
-
p && p.configurable && v[y] === void 0 && Object.defineProperty(v, y, p);
|
|
1079
|
-
}
|
|
1080
|
-
return v;
|
|
1081
|
-
}
|
|
1082
|
-
function X() {
|
|
1083
|
-
return X = Object.assign || function(v) {
|
|
1084
|
-
for (var u = 1; u < arguments.length; u++) {
|
|
1085
|
-
var a = arguments[u];
|
|
1086
|
-
for (var c in a)
|
|
1087
|
-
Object.prototype.hasOwnProperty.call(a, c) && (v[c] = a[c]);
|
|
1088
|
-
}
|
|
1089
|
-
return v;
|
|
1090
|
-
}, X.apply(this, arguments);
|
|
1091
|
-
}
|
|
1092
|
-
function H(v, u) {
|
|
1093
|
-
v.prototype = Object.create(u.prototype), v.prototype.constructor = v, k(v, u);
|
|
1094
|
-
}
|
|
1095
|
-
function L(v, u) {
|
|
1096
|
-
if (v == null)
|
|
1097
|
-
return {};
|
|
1098
|
-
var a = {}, c = Object.keys(v), y, p;
|
|
1099
|
-
for (p = 0; p < c.length; p++)
|
|
1100
|
-
y = c[p], !(u.indexOf(y) >= 0) && (a[y] = v[y]);
|
|
1101
|
-
return a;
|
|
1102
|
-
}
|
|
1103
|
-
function V(v) {
|
|
1104
|
-
return requestAnimationFrame(v);
|
|
1105
|
-
}
|
|
1106
|
-
function ne(v) {
|
|
1107
|
-
cancelAnimationFrame(v);
|
|
1108
|
-
}
|
|
1109
|
-
function G(v, u, a) {
|
|
1110
|
-
a === void 0 && (a = u), v.setSelectionRange(u, a);
|
|
1111
|
-
}
|
|
1112
|
-
function te(v) {
|
|
1113
|
-
var u = v.selectionStart, a = v.selectionEnd;
|
|
1114
|
-
return {
|
|
1115
|
-
start: u,
|
|
1116
|
-
end: a,
|
|
1117
|
-
length: a - u
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
function K(v) {
|
|
1121
|
-
var u = v.ownerDocument;
|
|
1122
|
-
return u.hasFocus() && u.activeElement === v;
|
|
1123
|
-
}
|
|
1124
|
-
function re(v) {
|
|
1125
|
-
return v == null ? void 0 : v.ownerDocument;
|
|
1126
|
-
}
|
|
1127
|
-
function ue(v) {
|
|
1128
|
-
var u;
|
|
1129
|
-
return (u = re(v)) == null ? void 0 : u.defaultView;
|
|
1130
|
-
}
|
|
1131
|
-
function Z(v) {
|
|
1132
|
-
var u = ue(v);
|
|
1133
|
-
return !!u && v instanceof u.HTMLElement;
|
|
1134
|
-
}
|
|
1135
|
-
function ie(v) {
|
|
1136
|
-
return typeof v == "function";
|
|
1137
|
-
}
|
|
1138
|
-
function ee(v, u) {
|
|
1139
|
-
for (var a = v.length - 1; a >= 0; a--) {
|
|
1140
|
-
var c = v[a];
|
|
1141
|
-
if (u(c, a))
|
|
1142
|
-
return a;
|
|
1143
|
-
}
|
|
1144
|
-
return -1;
|
|
1145
|
-
}
|
|
1146
|
-
function o(v, u) {
|
|
1147
|
-
u === void 0 && (u = 1);
|
|
1148
|
-
for (var a = "", c = 0; c < u; c++)
|
|
1149
|
-
a += v;
|
|
1150
|
-
return a;
|
|
1151
|
-
}
|
|
1152
|
-
function _(v) {
|
|
1153
|
-
return "" + v;
|
|
1154
|
-
}
|
|
1155
|
-
function m(v) {
|
|
1156
|
-
return t.useCallback(function() {
|
|
1157
|
-
var u = v.current, a = typeof window < "u" && Z(u);
|
|
1158
|
-
if (!u || !a)
|
|
1159
|
-
return null;
|
|
1160
|
-
if (u.nodeName !== "INPUT" && (u = u.querySelector("input")), !u)
|
|
1161
|
-
throw new Error("react-input-mask: inputComponent doesn't contain input node");
|
|
1162
|
-
return u;
|
|
1163
|
-
}, [v]);
|
|
1164
|
-
}
|
|
1165
|
-
function b(v) {
|
|
1166
|
-
var u = t.useRef(null), a = t.useCallback(function() {
|
|
1167
|
-
if (u.current !== null)
|
|
1168
|
-
return;
|
|
1169
|
-
function y() {
|
|
1170
|
-
v(), u.current = V(y);
|
|
1171
|
-
}
|
|
1172
|
-
y();
|
|
1173
|
-
}, [v]), c = t.useCallback(function() {
|
|
1174
|
-
ne(u.current), u.current = null;
|
|
1175
|
-
}, []);
|
|
1176
|
-
return t.useEffect(function() {
|
|
1177
|
-
u.current && (c(), a());
|
|
1178
|
-
}, [a, c]), t.useEffect(ne, []), [a, c];
|
|
1179
|
-
}
|
|
1180
|
-
function P(v, u) {
|
|
1181
|
-
var a = t.useRef({
|
|
1182
|
-
start: null,
|
|
1183
|
-
end: null
|
|
1184
|
-
}), c = m(v), y = t.useCallback(function() {
|
|
1185
|
-
var I = c();
|
|
1186
|
-
return te(I);
|
|
1187
|
-
}, [c]), p = t.useCallback(function() {
|
|
1188
|
-
return a.current;
|
|
1189
|
-
}, []), D = t.useCallback(function(I) {
|
|
1190
|
-
var q = c();
|
|
1191
|
-
!q || !K(q) || (G(q, I.start, I.end), a.current = y());
|
|
1192
|
-
}, [c, y]), O = t.useCallback(function() {
|
|
1193
|
-
a.current = y();
|
|
1194
|
-
}, [y]), C = b(O), U = C[0], h = C[1];
|
|
1195
|
-
return t.useLayoutEffect(function() {
|
|
1196
|
-
if (u) {
|
|
1197
|
-
var I = c();
|
|
1198
|
-
return I.addEventListener("focus", U), I.addEventListener("blur", h), K(I) && U(), function() {
|
|
1199
|
-
I.removeEventListener("focus", U), I.removeEventListener("blur", h), h();
|
|
1200
|
-
};
|
|
1201
|
-
}
|
|
1202
|
-
}), {
|
|
1203
|
-
getSelection: y,
|
|
1204
|
-
getLastSelection: p,
|
|
1205
|
-
setSelection: D
|
|
1206
|
-
};
|
|
1207
|
-
}
|
|
1208
|
-
function F(v, u) {
|
|
1209
|
-
var a = m(v), c = t.useRef(u), y = t.useCallback(function() {
|
|
1210
|
-
var O = a();
|
|
1211
|
-
return O.value;
|
|
1212
|
-
}, [a]), p = t.useCallback(function() {
|
|
1213
|
-
return c.current;
|
|
1214
|
-
}, []), D = t.useCallback(function(O) {
|
|
1215
|
-
c.current = O;
|
|
1216
|
-
var C = a();
|
|
1217
|
-
C && (C.value = O);
|
|
1218
|
-
}, [a]);
|
|
1219
|
-
return {
|
|
1220
|
-
getValue: y,
|
|
1221
|
-
getLastValue: p,
|
|
1222
|
-
setValue: D
|
|
1223
|
-
};
|
|
1224
|
-
}
|
|
1225
|
-
function Y(v, u) {
|
|
1226
|
-
var a = t.useRef(), c = P(a, u), y = c.getSelection, p = c.getLastSelection, D = c.setSelection, O = F(a, v), C = O.getValue, U = O.getLastValue, h = O.setValue;
|
|
1227
|
-
function I() {
|
|
1228
|
-
return {
|
|
1229
|
-
value: U(),
|
|
1230
|
-
selection: p()
|
|
1231
|
-
};
|
|
1232
|
-
}
|
|
1233
|
-
function q() {
|
|
1234
|
-
return {
|
|
1235
|
-
value: C(),
|
|
1236
|
-
selection: y()
|
|
1237
|
-
};
|
|
1238
|
-
}
|
|
1239
|
-
function $(ae) {
|
|
1240
|
-
var he = ae.value, n = ae.selection;
|
|
1241
|
-
h(he), D(n);
|
|
1242
|
-
}
|
|
1243
|
-
return {
|
|
1244
|
-
inputRef: a,
|
|
1245
|
-
getInputState: q,
|
|
1246
|
-
getLastInputState: I,
|
|
1247
|
-
setInputState: $
|
|
1248
|
-
};
|
|
1249
|
-
}
|
|
1250
|
-
function T(v) {
|
|
1251
|
-
var u = t.useRef();
|
|
1252
|
-
return t.useEffect(function() {
|
|
1253
|
-
u.current = v;
|
|
1254
|
-
}), u.current;
|
|
1255
|
-
}
|
|
1256
|
-
var B = ["disabled", "onBlur", "onChange", "onFocus", "onMouseDown", "readOnly", "value"], W = {
|
|
1257
|
-
9: /[0-9]/,
|
|
1258
|
-
a: /[A-Za-z]/,
|
|
1259
|
-
"*": /[A-Za-z0-9]/
|
|
1260
|
-
};
|
|
1261
|
-
function M(v) {
|
|
1262
|
-
process.env.NODE_ENV !== "production" && E(!v.maxLength || !v.mask, "react-input-mask: maxLength property shouldn't be passed to the masked input. It breaks masking and unnecessary because length is limited by the mask length.");
|
|
1263
|
-
}
|
|
1264
|
-
function R(v) {
|
|
1265
|
-
var u = v.mask, a = v.maskPlaceholder;
|
|
1266
|
-
!u || !a || a.length === 1 || a.length === u.length || (process.env.NODE_ENV !== "production" ? i(!1, `react-input-mask: maskPlaceholder should either be a single character or have the same length as the mask:
|
|
1267
|
-
` + ("mask: " + u + `
|
|
1268
|
-
`) + ("maskPlaceholder: " + a)) : i(!1));
|
|
1269
|
-
}
|
|
1270
|
-
function z(v, u) {
|
|
1271
|
-
var a = B.filter(function(c) {
|
|
1272
|
-
return u.props[c] != null && u.props[c] !== v[c];
|
|
1273
|
-
});
|
|
1274
|
-
a.length && (process.env.NODE_ENV !== "production" ? i(!1, "react-input-mask: the following props should be passed to the InputMask component, not to children: " + a.join(",")) : i(!1));
|
|
1275
|
-
}
|
|
1276
|
-
function J(v) {
|
|
1277
|
-
var u = v.mask, a = v.maskPlaceholder, c = [];
|
|
1278
|
-
if (!u)
|
|
1279
|
-
return {
|
|
1280
|
-
maskPlaceholder: null,
|
|
1281
|
-
mask: null,
|
|
1282
|
-
prefix: null,
|
|
1283
|
-
lastEditablePosition: null,
|
|
1284
|
-
permanents: []
|
|
1285
|
-
};
|
|
1286
|
-
if (typeof u == "string") {
|
|
1287
|
-
var y = !1, p = "";
|
|
1288
|
-
u.split("").forEach(function(C) {
|
|
1289
|
-
!y && C === "\\" ? y = !0 : ((y || !W[C]) && c.push(p.length), p += C, y = !1);
|
|
1290
|
-
}), u = p.split("").map(function(C, U) {
|
|
1291
|
-
return c.indexOf(U) === -1 ? W[C] : C;
|
|
1292
|
-
});
|
|
1293
|
-
} else
|
|
1294
|
-
u.forEach(function(C, U) {
|
|
1295
|
-
typeof C == "string" && c.push(U);
|
|
1296
|
-
});
|
|
1297
|
-
a && (a.length === 1 ? a = u.map(function(C, U) {
|
|
1298
|
-
return c.indexOf(U) !== -1 ? C : a;
|
|
1299
|
-
}) : a = a.split(""), c.forEach(function(C) {
|
|
1300
|
-
a[C] = u[C];
|
|
1301
|
-
}), a = a.join(""));
|
|
1302
|
-
for (var D = c.filter(function(C, U) {
|
|
1303
|
-
return C === U;
|
|
1304
|
-
}).map(function(C) {
|
|
1305
|
-
return u[C];
|
|
1306
|
-
}).join(""), O = u.length - 1; c.indexOf(O) !== -1; )
|
|
1307
|
-
O--;
|
|
1308
|
-
return {
|
|
1309
|
-
maskPlaceholder: a,
|
|
1310
|
-
prefix: D,
|
|
1311
|
-
mask: u,
|
|
1312
|
-
lastEditablePosition: O,
|
|
1313
|
-
permanents: c
|
|
1314
|
-
};
|
|
1315
|
-
}
|
|
1316
|
-
var le = function(u) {
|
|
1317
|
-
var a = this;
|
|
1318
|
-
this.isCharacterAllowedAtPosition = function(c, y) {
|
|
1319
|
-
var p = a.maskOptions.maskPlaceholder;
|
|
1320
|
-
return a.isCharacterFillingPosition(c, y) ? !0 : p ? p[y] === c : !1;
|
|
1321
|
-
}, this.isCharacterFillingPosition = function(c, y) {
|
|
1322
|
-
var p = a.maskOptions.mask;
|
|
1323
|
-
if (!c || y >= p.length)
|
|
1324
|
-
return !1;
|
|
1325
|
-
if (!a.isPositionEditable(y))
|
|
1326
|
-
return p[y] === c;
|
|
1327
|
-
var D = p[y];
|
|
1328
|
-
return new RegExp(D).test(c);
|
|
1329
|
-
}, this.isPositionEditable = function(c) {
|
|
1330
|
-
var y = a.maskOptions, p = y.mask, D = y.permanents;
|
|
1331
|
-
return c < p.length && D.indexOf(c) === -1;
|
|
1332
|
-
}, this.isValueEmpty = function(c) {
|
|
1333
|
-
return c.split("").every(function(y, p) {
|
|
1334
|
-
return !a.isPositionEditable(p) || !a.isCharacterFillingPosition(y, p);
|
|
1335
|
-
});
|
|
1336
|
-
}, this.isValueFilled = function(c) {
|
|
1337
|
-
return a.getFilledLength(c) === a.maskOptions.lastEditablePosition + 1;
|
|
1338
|
-
}, this.getDefaultSelectionForValue = function(c) {
|
|
1339
|
-
var y = a.getFilledLength(c), p = a.getRightEditablePosition(y);
|
|
1340
|
-
return {
|
|
1341
|
-
start: p,
|
|
1342
|
-
end: p
|
|
1343
|
-
};
|
|
1344
|
-
}, this.getFilledLength = function(c) {
|
|
1345
|
-
var y = c.split(""), p = ee(y, function(D, O) {
|
|
1346
|
-
return a.isPositionEditable(O) && a.isCharacterFillingPosition(D, O);
|
|
1347
|
-
});
|
|
1348
|
-
return p + 1;
|
|
1349
|
-
}, this.getStringFillingLengthAtPosition = function(c, y) {
|
|
1350
|
-
var p = c.split(""), D = p.reduce(function(O, C) {
|
|
1351
|
-
return a.insertCharacterAtPosition(O, C, O.length);
|
|
1352
|
-
}, o(" ", y));
|
|
1353
|
-
return D.length - y;
|
|
1354
|
-
}, this.getLeftEditablePosition = function(c) {
|
|
1355
|
-
for (var y = c; y >= 0; y--)
|
|
1356
|
-
if (a.isPositionEditable(y))
|
|
1357
|
-
return y;
|
|
1358
|
-
return null;
|
|
1359
|
-
}, this.getRightEditablePosition = function(c) {
|
|
1360
|
-
for (var y = a.maskOptions.mask, p = c; p < y.length; p++)
|
|
1361
|
-
if (a.isPositionEditable(p))
|
|
1362
|
-
return p;
|
|
1363
|
-
return null;
|
|
1364
|
-
}, this.formatValue = function(c) {
|
|
1365
|
-
var y = a.maskOptions, p = y.maskPlaceholder, D = y.mask;
|
|
1366
|
-
if (!p) {
|
|
1367
|
-
for (c = a.insertStringAtPosition("", c, 0); c.length < D.length && !a.isPositionEditable(c.length); )
|
|
1368
|
-
c += D[c.length];
|
|
1369
|
-
return c;
|
|
1370
|
-
}
|
|
1371
|
-
return a.insertStringAtPosition(p, c, 0);
|
|
1372
|
-
}, this.clearRange = function(c, y, p) {
|
|
1373
|
-
if (!p)
|
|
1374
|
-
return c;
|
|
1375
|
-
var D = y + p, O = a.maskOptions, C = O.maskPlaceholder, U = O.mask, h = c.split("").map(function(I, q) {
|
|
1376
|
-
var $ = a.isPositionEditable(q);
|
|
1377
|
-
return !C && q >= D && !$ ? "" : q < y || q >= D ? I : $ ? C ? C[q] : "" : U[q];
|
|
1378
|
-
}).join("");
|
|
1379
|
-
return a.formatValue(h);
|
|
1380
|
-
}, this.insertCharacterAtPosition = function(c, y, p) {
|
|
1381
|
-
var D = a.maskOptions, O = D.mask, C = D.maskPlaceholder;
|
|
1382
|
-
if (p >= O.length)
|
|
1383
|
-
return c;
|
|
1384
|
-
var U = a.isCharacterAllowedAtPosition(y, p), h = a.isPositionEditable(p), I = a.getRightEditablePosition(p), q = C && I ? y === C[I] : null, $ = c.slice(0, p);
|
|
1385
|
-
if (U || !h) {
|
|
1386
|
-
var ae = U ? y : O[p];
|
|
1387
|
-
c = $ + ae;
|
|
1388
|
-
}
|
|
1389
|
-
return !U && !h && !q && (c = a.insertCharacterAtPosition(c, y, p + 1)), c;
|
|
1390
|
-
}, this.insertStringAtPosition = function(c, y, p) {
|
|
1391
|
-
var D = a.maskOptions, O = D.mask, C = D.maskPlaceholder;
|
|
1392
|
-
if (!y || p >= O.length)
|
|
1393
|
-
return c;
|
|
1394
|
-
var U = y.split(""), h = a.isValueFilled(c) || !!C, I = c.slice(p);
|
|
1395
|
-
if (c = U.reduce(function($, ae) {
|
|
1396
|
-
return a.insertCharacterAtPosition($, ae, $.length);
|
|
1397
|
-
}, c.slice(0, p)), h)
|
|
1398
|
-
c += I.slice(c.length - p);
|
|
1399
|
-
else if (a.isValueFilled(c))
|
|
1400
|
-
c += O.slice(c.length).join("");
|
|
1401
|
-
else {
|
|
1402
|
-
var q = I.split("").filter(function($, ae) {
|
|
1403
|
-
return a.isPositionEditable(p + ae);
|
|
1404
|
-
});
|
|
1405
|
-
c = q.reduce(function($, ae) {
|
|
1406
|
-
var he = a.getRightEditablePosition($.length);
|
|
1407
|
-
return he === null ? $ : (a.isPositionEditable($.length) || ($ += O.slice($.length, he).join("")), a.insertCharacterAtPosition($, ae, $.length));
|
|
1408
|
-
}, c);
|
|
1409
|
-
}
|
|
1410
|
-
return c;
|
|
1411
|
-
}, this.processChange = function(c, y) {
|
|
1412
|
-
var p = a.maskOptions, D = p.mask, O = p.prefix, C = p.lastEditablePosition, U = c.value, h = c.selection, I = y.value, q = y.selection, $ = U, ae = "", he = 0, n = 0, s = Math.min(q.start, h.start);
|
|
1413
|
-
if (h.end > q.start ? (ae = $.slice(q.start, h.end), he = a.getStringFillingLengthAtPosition(ae, s), he ? n = q.length : n = 0) : $.length < I.length && (n = I.length - $.length), $ = I, n) {
|
|
1414
|
-
if (n === 1 && !q.length) {
|
|
1415
|
-
var d = q.start === h.start;
|
|
1416
|
-
s = d ? a.getRightEditablePosition(h.start) : a.getLeftEditablePosition(h.start);
|
|
1417
|
-
}
|
|
1418
|
-
$ = a.clearRange($, s, n);
|
|
1419
|
-
}
|
|
1420
|
-
return $ = a.insertStringAtPosition($, ae, s), s += he, s >= D.length ? s = D.length : s < O.length && !he ? s = O.length : s >= O.length && s < C && he && (s = a.getRightEditablePosition(s)), $ = a.formatValue($), {
|
|
1421
|
-
value: $,
|
|
1422
|
-
enteredString: ae,
|
|
1423
|
-
selection: {
|
|
1424
|
-
start: s,
|
|
1425
|
-
end: s
|
|
1426
|
-
}
|
|
1427
|
-
};
|
|
1428
|
-
}, this.maskOptions = J(u);
|
|
1429
|
-
}, g = /* @__PURE__ */ function(v) {
|
|
1430
|
-
H(u, v);
|
|
1431
|
-
function u() {
|
|
1432
|
-
return v.apply(this, arguments) || this;
|
|
1433
|
-
}
|
|
1434
|
-
var a = u.prototype;
|
|
1435
|
-
return a.render = function() {
|
|
1436
|
-
var y = this.props, p = y.children, D = L(y, ["children"]);
|
|
1437
|
-
return r.cloneElement(p, D);
|
|
1438
|
-
}, u;
|
|
1439
|
-
}(r.Component), S = t.forwardRef(function(u, a) {
|
|
1440
|
-
var c = u.alwaysShowMask, y = u.children, p = u.mask, D = u.maskPlaceholder, O = u.beforeMaskedStateChange, C = L(u, ["alwaysShowMask", "children", "mask", "maskPlaceholder", "beforeMaskedStateChange"]);
|
|
1441
|
-
M(u), R(u);
|
|
1442
|
-
var U = new le({
|
|
1443
|
-
mask: p,
|
|
1444
|
-
maskPlaceholder: D
|
|
1445
|
-
}), h = !!p, I = !C.disabled && !C.readOnly, q = u.value !== null && u.value !== void 0, $ = T(h), ae = _((q ? u.value : u.defaultValue) || ""), he = Y(ae, h), n = he.inputRef, s = he.getInputState, d = he.setInputState, A = he.getLastInputState, w = m(n);
|
|
1446
|
-
function x(me) {
|
|
1447
|
-
var de = s(), Ee = A(), _e = U.processChange(de, Ee);
|
|
1448
|
-
O && (_e = O({
|
|
1449
|
-
currentState: de,
|
|
1450
|
-
previousState: Ee,
|
|
1451
|
-
nextState: _e
|
|
1452
|
-
})), d(_e), u.onChange && u.onChange(me);
|
|
1453
|
-
}
|
|
1454
|
-
function N(me) {
|
|
1455
|
-
n.current = me.target;
|
|
1456
|
-
var de = s().value;
|
|
1457
|
-
if (h && !U.isValueFilled(de)) {
|
|
1458
|
-
var Ee = U.formatValue(de), _e = U.getDefaultSelectionForValue(Ee), ve = {
|
|
1459
|
-
value: Ee,
|
|
1460
|
-
selection: _e
|
|
1461
|
-
};
|
|
1462
|
-
O && (ve = O({
|
|
1463
|
-
currentState: s(),
|
|
1464
|
-
nextState: ve
|
|
1465
|
-
}), Ee = ve.value, _e = ve.selection), d(ve), Ee !== de && u.onChange && u.onChange(me), V(function() {
|
|
1466
|
-
d(A());
|
|
1467
|
-
});
|
|
1468
|
-
}
|
|
1469
|
-
u.onFocus && u.onFocus(me);
|
|
1470
|
-
}
|
|
1471
|
-
function Q(me) {
|
|
1472
|
-
var de = s().value, Ee = A().value;
|
|
1473
|
-
if (h && !c && U.isValueEmpty(Ee)) {
|
|
1474
|
-
var _e = "", ve = {
|
|
1475
|
-
value: _e,
|
|
1476
|
-
selection: {
|
|
1477
|
-
start: null,
|
|
1478
|
-
end: null
|
|
1479
|
-
}
|
|
1480
|
-
};
|
|
1481
|
-
O && (ve = O({
|
|
1482
|
-
currentState: s(),
|
|
1483
|
-
nextState: ve
|
|
1484
|
-
}), _e = ve.value), d(ve), _e !== de && u.onChange && u.onChange(me);
|
|
1485
|
-
}
|
|
1486
|
-
u.onBlur && u.onBlur(me);
|
|
1487
|
-
}
|
|
1488
|
-
function fe(me) {
|
|
1489
|
-
var de = w(), Ee = s(), _e = Ee.value, ve = re(de);
|
|
1490
|
-
if (!K(de) && !U.isValueFilled(_e)) {
|
|
1491
|
-
var nt = me.clientX, We = me.clientY, Ye = (/* @__PURE__ */ new Date()).getTime(), it = function yr(xt) {
|
|
1492
|
-
if (ve.removeEventListener("mouseup", yr), !!K(de)) {
|
|
1493
|
-
var pr = Math.abs(xt.clientX - nt), mr = Math.abs(xt.clientY - We), wt = Math.max(pr, mr), Ot = (/* @__PURE__ */ new Date()).getTime() - Ye;
|
|
1494
|
-
if (wt <= 10 && Ot <= 200 || wt <= 5 && Ot <= 300) {
|
|
1495
|
-
var Ct = A(), br = U.getDefaultSelectionForValue(Ct.value), Er = X({}, Ct, {
|
|
1496
|
-
selection: br
|
|
1497
|
-
});
|
|
1498
|
-
d(Er);
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
};
|
|
1502
|
-
ve.addEventListener("mouseup", it);
|
|
1503
|
-
}
|
|
1504
|
-
u.onMouseDown && u.onMouseDown(me);
|
|
1505
|
-
}
|
|
1506
|
-
if (h && q) {
|
|
1507
|
-
var be = w(), Te = be && K(be), je = Te || c || u.value ? U.formatValue(u.value) : u.value;
|
|
1508
|
-
O && (je = O({
|
|
1509
|
-
nextState: {
|
|
1510
|
-
value: je,
|
|
1511
|
-
selection: {
|
|
1512
|
-
start: null,
|
|
1513
|
-
end: null
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
}).value), d(X({}, A(), {
|
|
1517
|
-
value: je
|
|
1518
|
-
}));
|
|
1519
|
-
}
|
|
1520
|
-
var Me = A(), qe = Me.selection, rt = Me.value;
|
|
1521
|
-
t.useLayoutEffect(function() {
|
|
1522
|
-
if (h) {
|
|
1523
|
-
var me = w(), de = K(me), Ee = qe, _e = s(), ve = X({}, _e);
|
|
1524
|
-
if (!q) {
|
|
1525
|
-
var nt = _e.value, We = U.formatValue(nt), Ye = U.isValueEmpty(We), it = !Ye || de || c;
|
|
1526
|
-
it ? ve.value = We : Ye && !de && (ve.value = "");
|
|
1527
|
-
}
|
|
1528
|
-
de && !$ ? ve.selection = U.getDefaultSelectionForValue(ve.value) : q && de && Ee && Ee.start !== null && Ee.end !== null && (ve.selection = Ee), O && (ve = O({
|
|
1529
|
-
currentState: _e,
|
|
1530
|
-
nextState: ve
|
|
1531
|
-
})), d(ve);
|
|
1532
|
-
}
|
|
1533
|
-
});
|
|
1534
|
-
var Ne = X({}, C, {
|
|
1535
|
-
onFocus: N,
|
|
1536
|
-
onBlur: Q,
|
|
1537
|
-
onChange: h && I ? x : u.onChange,
|
|
1538
|
-
onMouseDown: h && I ? fe : u.onMouseDown,
|
|
1539
|
-
ref: function(de) {
|
|
1540
|
-
n.current = l.findDOMNode(de), ie(a) ? a(de) : a !== null && typeof a == "object" && (a.current = de);
|
|
1541
|
-
},
|
|
1542
|
-
value: h && q ? rt : u.value
|
|
1543
|
-
});
|
|
1544
|
-
return y ? (z(u, y), r.createElement(g, Ne, y)) : r.createElement("input", Ne);
|
|
1545
|
-
});
|
|
1546
|
-
return S.displayName = "InputMask", S.defaultProps = {
|
|
1547
|
-
alwaysShowMask: !1,
|
|
1548
|
-
maskPlaceholder: "_"
|
|
1549
|
-
}, S.propTypes = {
|
|
1550
|
-
alwaysShowMask: f.bool,
|
|
1551
|
-
beforeMaskedStateChange: f.func,
|
|
1552
|
-
children: f.element,
|
|
1553
|
-
mask: f.oneOfType([f.string, f.arrayOf(f.oneOfType([f.string, f.instanceOf(RegExp)]))]),
|
|
1554
|
-
maskPlaceholder: f.string,
|
|
1555
|
-
onFocus: f.func,
|
|
1556
|
-
onBlur: f.func,
|
|
1557
|
-
onChange: f.func,
|
|
1558
|
-
onMouseDown: f.func
|
|
1559
|
-
}, gt = S, gt;
|
|
1560
|
-
}
|
|
1561
|
-
process.env.NODE_ENV === "production" ? bt.exports = Fr() : bt.exports = Dr();
|
|
1562
|
-
var Mr = bt.exports;
|
|
1563
|
-
const Lr = /* @__PURE__ */ _r(Mr), Ir = "_btn_m4eyd_1", jr = "_modal_m4eyd_9", qr = "_modalBody_m4eyd_16", Nr = "_root_m4eyd_21", Br = "_title_m4eyd_31", $r = "_description_m4eyd_38", Ur = "_inputWrapper_m4eyd_45", Re = {
|
|
1564
|
-
btn: Ir,
|
|
1565
|
-
modal: jr,
|
|
1566
|
-
modalBody: qr,
|
|
1567
|
-
root: Nr,
|
|
1568
|
-
title: Br,
|
|
1569
|
-
description: $r,
|
|
1570
|
-
inputWrapper: Ur
|
|
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";
|
|
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";
|
|
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
|
|
1571
19
|
};
|
|
1572
|
-
var
|
|
1573
|
-
const
|
|
1574
|
-
var
|
|
1575
|
-
const
|
|
1576
|
-
return
|
|
1577
|
-
},
|
|
1578
|
-
function
|
|
1579
|
-
let
|
|
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) => {
|
|
23
|
+
const s = e.constructor && e.constructor.prototype;
|
|
24
|
+
return S(s) && s.hasOwnProperty("isPrototypeOf");
|
|
25
|
+
}, Te = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
26
|
+
function U(e) {
|
|
27
|
+
let s;
|
|
1580
28
|
const r = Array.isArray(e);
|
|
1581
29
|
if (e instanceof Date)
|
|
1582
|
-
|
|
30
|
+
s = new Date(e);
|
|
1583
31
|
else if (e instanceof Set)
|
|
1584
|
-
|
|
1585
|
-
else if (!(
|
|
1586
|
-
if (
|
|
1587
|
-
|
|
32
|
+
s = new Set(e);
|
|
33
|
+
else if (!(Te && (e instanceof Blob || e instanceof FileList)) && (r || S(e)))
|
|
34
|
+
if (s = r ? [] : {}, !r && !Ot(e))
|
|
35
|
+
s = e;
|
|
1588
36
|
else
|
|
1589
37
|
for (const l in e)
|
|
1590
|
-
e.hasOwnProperty(l) && (
|
|
38
|
+
e.hasOwnProperty(l) && (s[l] = U(e[l]));
|
|
1591
39
|
else
|
|
1592
40
|
return e;
|
|
1593
|
-
return
|
|
41
|
+
return s;
|
|
1594
42
|
}
|
|
1595
|
-
var
|
|
1596
|
-
if (!
|
|
43
|
+
var Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], A = (e) => e === void 0, d = (e, s, r) => {
|
|
44
|
+
if (!s || !S(e))
|
|
1597
45
|
return r;
|
|
1598
|
-
const l =
|
|
1599
|
-
return
|
|
1600
|
-
},
|
|
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) => {
|
|
1601
49
|
let l = -1;
|
|
1602
|
-
const
|
|
1603
|
-
for (; ++l <
|
|
1604
|
-
const
|
|
1605
|
-
let
|
|
1606
|
-
if (l !==
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1609
|
-
}
|
|
1610
|
-
if (
|
|
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) {
|
|
55
|
+
const M = e[g];
|
|
56
|
+
R = S(M) || Array.isArray(M) ? M : isNaN(+u[l + 1]) ? {} : [];
|
|
57
|
+
}
|
|
58
|
+
if (g === "__proto__")
|
|
1611
59
|
return;
|
|
1612
|
-
e[
|
|
60
|
+
e[g] = R, e = e[g];
|
|
1613
61
|
}
|
|
1614
62
|
return e;
|
|
1615
63
|
};
|
|
1616
|
-
const
|
|
64
|
+
const Je = {
|
|
1617
65
|
BLUR: "blur",
|
|
1618
66
|
FOCUS_OUT: "focusout",
|
|
1619
67
|
CHANGE: "change"
|
|
1620
|
-
},
|
|
68
|
+
}, H = {
|
|
1621
69
|
onBlur: "onBlur",
|
|
1622
70
|
onChange: "onChange",
|
|
1623
71
|
onSubmit: "onSubmit",
|
|
1624
72
|
onTouched: "onTouched",
|
|
1625
73
|
all: "all"
|
|
1626
|
-
},
|
|
74
|
+
}, Q = {
|
|
1627
75
|
max: "max",
|
|
1628
76
|
min: "min",
|
|
1629
77
|
maxLength: "maxLength",
|
|
@@ -1632,323 +80,323 @@ const zt = {
|
|
|
1632
80
|
required: "required",
|
|
1633
81
|
validate: "validate"
|
|
1634
82
|
};
|
|
1635
|
-
|
|
1636
|
-
var
|
|
1637
|
-
const
|
|
1638
|
-
defaultValues:
|
|
83
|
+
I.createContext(null);
|
|
84
|
+
var Nt = (e, s, r, l = !0) => {
|
|
85
|
+
const u = {
|
|
86
|
+
defaultValues: s._defaultValues
|
|
1639
87
|
};
|
|
1640
|
-
for (const
|
|
1641
|
-
Object.defineProperty(
|
|
88
|
+
for (const a in e)
|
|
89
|
+
Object.defineProperty(u, a, {
|
|
1642
90
|
get: () => {
|
|
1643
|
-
const
|
|
1644
|
-
return
|
|
91
|
+
const y = a;
|
|
92
|
+
return s._proxyFormState[y] !== H.all && (s._proxyFormState[y] = !l || H.all), e[y];
|
|
1645
93
|
}
|
|
1646
94
|
});
|
|
1647
|
-
return
|
|
1648
|
-
},
|
|
95
|
+
return u;
|
|
96
|
+
}, T = (e) => S(e) && !Object.keys(e).length, Ut = (e, s, r, l) => {
|
|
1649
97
|
r(e);
|
|
1650
|
-
const { name:
|
|
1651
|
-
return
|
|
1652
|
-
},
|
|
1653
|
-
function
|
|
1654
|
-
const
|
|
1655
|
-
|
|
1656
|
-
const r = !e.disabled &&
|
|
1657
|
-
next:
|
|
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);
|
|
100
|
+
}, _e = (e) => Array.isArray(e) ? e : [e];
|
|
101
|
+
function It(e) {
|
|
102
|
+
const s = I.useRef(e);
|
|
103
|
+
s.current = e, I.useEffect(() => {
|
|
104
|
+
const r = !e.disabled && s.current.subject && s.current.subject.subscribe({
|
|
105
|
+
next: s.current.next
|
|
1658
106
|
});
|
|
1659
107
|
return () => {
|
|
1660
108
|
r && r.unsubscribe();
|
|
1661
109
|
};
|
|
1662
110
|
}, [e.disabled]);
|
|
1663
111
|
}
|
|
1664
|
-
var
|
|
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 ? {
|
|
1665
113
|
...r[e],
|
|
1666
114
|
types: {
|
|
1667
115
|
...r[e] && r[e].types ? r[e].types : {},
|
|
1668
|
-
[l]:
|
|
116
|
+
[l]: u || !0
|
|
1669
117
|
}
|
|
1670
|
-
} : {},
|
|
1671
|
-
isOnSubmit: !e || e ===
|
|
1672
|
-
isOnBlur: e ===
|
|
1673
|
-
isOnChange: e ===
|
|
1674
|
-
isOnAll: e ===
|
|
1675
|
-
isOnTouch: e ===
|
|
1676
|
-
}),
|
|
1677
|
-
const
|
|
1678
|
-
for (const
|
|
1679
|
-
const
|
|
1680
|
-
if (
|
|
1681
|
-
const { _f:
|
|
1682
|
-
if (
|
|
1683
|
-
if (
|
|
118
|
+
} : {}, 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) => {
|
|
126
|
+
for (const u of r || Object.keys(e)) {
|
|
127
|
+
const a = d(e, u);
|
|
128
|
+
if (a) {
|
|
129
|
+
const { _f: y, ...g } = a;
|
|
130
|
+
if (y) {
|
|
131
|
+
if (y.refs && y.refs[0] && s(y.refs[0], u) && !l)
|
|
1684
132
|
break;
|
|
1685
|
-
if (
|
|
133
|
+
if (y.ref && s(y.ref, y.name) && !l)
|
|
1686
134
|
break;
|
|
1687
|
-
|
|
135
|
+
de(g, s);
|
|
1688
136
|
} else
|
|
1689
|
-
|
|
137
|
+
S(g) && de(g, s);
|
|
1690
138
|
}
|
|
1691
139
|
}
|
|
1692
140
|
};
|
|
1693
|
-
var
|
|
1694
|
-
const l =
|
|
1695
|
-
return
|
|
1696
|
-
},
|
|
1697
|
-
if (!
|
|
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)
|
|
1698
146
|
return !1;
|
|
1699
|
-
const
|
|
1700
|
-
return e instanceof (
|
|
1701
|
-
},
|
|
1702
|
-
const
|
|
147
|
+
const s = e ? e.ownerDocument : 0;
|
|
148
|
+
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
|
+
const Ye = {
|
|
1703
151
|
value: !1,
|
|
1704
152
|
isValid: !1
|
|
1705
|
-
},
|
|
1706
|
-
var
|
|
153
|
+
}, Ze = { value: !0, isValid: !0 };
|
|
154
|
+
var lt = (e) => {
|
|
1707
155
|
if (Array.isArray(e)) {
|
|
1708
156
|
if (e.length > 1) {
|
|
1709
|
-
const
|
|
1710
|
-
return { value:
|
|
157
|
+
const s = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
|
|
158
|
+
return { value: s, isValid: !!s.length };
|
|
1711
159
|
}
|
|
1712
160
|
return e[0].checked && !e[0].disabled ? (
|
|
1713
161
|
// @ts-expect-error expected to work in the browser
|
|
1714
|
-
e[0].attributes && !
|
|
1715
|
-
) :
|
|
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
|
+
) : Ye;
|
|
1716
164
|
}
|
|
1717
|
-
return
|
|
165
|
+
return Ye;
|
|
1718
166
|
};
|
|
1719
|
-
const
|
|
167
|
+
const et = {
|
|
1720
168
|
isValid: !1,
|
|
1721
169
|
value: null
|
|
1722
170
|
};
|
|
1723
|
-
var
|
|
171
|
+
var ut = (e) => Array.isArray(e) ? e.reduce((s, r) => r && r.checked && !r.disabled ? {
|
|
1724
172
|
isValid: !0,
|
|
1725
173
|
value: r.value
|
|
1726
|
-
} :
|
|
1727
|
-
function
|
|
1728
|
-
if (
|
|
174
|
+
} : s, et) : et;
|
|
175
|
+
function tt(e, s, r = "validate") {
|
|
176
|
+
if (me(e) || Array.isArray(e) && e.every(me) || Y(e) && !e)
|
|
1729
177
|
return {
|
|
1730
178
|
type: r,
|
|
1731
|
-
message:
|
|
1732
|
-
ref:
|
|
179
|
+
message: me(e) ? e : "",
|
|
180
|
+
ref: s
|
|
1733
181
|
};
|
|
1734
182
|
}
|
|
1735
|
-
var
|
|
183
|
+
var ne = (e) => S(e) && !xe(e) ? e : {
|
|
1736
184
|
value: e,
|
|
1737
185
|
message: ""
|
|
1738
|
-
},
|
|
1739
|
-
const { ref:
|
|
1740
|
-
if (
|
|
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)
|
|
1741
189
|
return {};
|
|
1742
|
-
const
|
|
1743
|
-
l &&
|
|
1744
|
-
},
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1747
|
-
type:
|
|
1748
|
-
message:
|
|
1749
|
-
ref:
|
|
1750
|
-
...
|
|
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)
|
|
1751
199
|
};
|
|
1752
200
|
};
|
|
1753
|
-
if (
|
|
1754
|
-
const { value:
|
|
1755
|
-
if (
|
|
1756
|
-
type:
|
|
1757
|
-
message:
|
|
1758
|
-
ref:
|
|
1759
|
-
...
|
|
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
|
+
const { value: _, message: b } = me(g) ? { value: !!g, message: g } : ne(g);
|
|
203
|
+
if (_ && (p[C] = {
|
|
204
|
+
type: Q.required,
|
|
205
|
+
message: b,
|
|
206
|
+
ref: P,
|
|
207
|
+
...O(Q.required, b)
|
|
1760
208
|
}, !r))
|
|
1761
|
-
return
|
|
209
|
+
return J(b), p;
|
|
1762
210
|
}
|
|
1763
|
-
if (!
|
|
1764
|
-
let
|
|
1765
|
-
const
|
|
1766
|
-
if (!
|
|
1767
|
-
const
|
|
1768
|
-
|
|
211
|
+
if (!se && (!B(F) || !B(v))) {
|
|
212
|
+
let _, b;
|
|
213
|
+
const D = ne(v), E = ne(F);
|
|
214
|
+
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);
|
|
1769
217
|
} else {
|
|
1770
|
-
const
|
|
1771
|
-
|
|
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));
|
|
1772
220
|
}
|
|
1773
|
-
if ((
|
|
1774
|
-
return
|
|
221
|
+
if ((_ || b) && (ge(!!_, D.message, E.message, Q.max, Q.min), !r))
|
|
222
|
+
return J(p[C].message), p;
|
|
1775
223
|
}
|
|
1776
|
-
if ((
|
|
1777
|
-
const
|
|
1778
|
-
if ((
|
|
1779
|
-
return
|
|
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;
|
|
226
|
+
if ((D || E) && (ge(D, _.message, b.message), !r))
|
|
227
|
+
return J(p[C].message), p;
|
|
1780
228
|
}
|
|
1781
|
-
if (
|
|
1782
|
-
const { value:
|
|
1783
|
-
if (
|
|
1784
|
-
type:
|
|
1785
|
-
message:
|
|
1786
|
-
ref:
|
|
1787
|
-
...
|
|
229
|
+
if (G && !se && K(m)) {
|
|
230
|
+
const { value: _, message: b } = ne(G);
|
|
231
|
+
if (xe(_) && !m.match(_) && (p[C] = {
|
|
232
|
+
type: Q.pattern,
|
|
233
|
+
message: b,
|
|
234
|
+
ref: a,
|
|
235
|
+
...O(Q.pattern, b)
|
|
1788
236
|
}, !r))
|
|
1789
|
-
return
|
|
237
|
+
return J(b), p;
|
|
1790
238
|
}
|
|
1791
|
-
if (
|
|
1792
|
-
if (
|
|
1793
|
-
const
|
|
1794
|
-
if (
|
|
1795
|
-
...
|
|
1796
|
-
...
|
|
239
|
+
if (z) {
|
|
240
|
+
if (Z(z)) {
|
|
241
|
+
const _ = await z(m, s), b = tt(_, P);
|
|
242
|
+
if (b && (p[C] = {
|
|
243
|
+
...b,
|
|
244
|
+
...O(Q.validate, b.message)
|
|
1797
245
|
}, !r))
|
|
1798
|
-
return
|
|
1799
|
-
} else if (
|
|
1800
|
-
let
|
|
1801
|
-
for (const
|
|
1802
|
-
if (!
|
|
246
|
+
return J(b.message), p;
|
|
247
|
+
} else if (S(z)) {
|
|
248
|
+
let _ = {};
|
|
249
|
+
for (const b in z) {
|
|
250
|
+
if (!T(_) && !r)
|
|
1803
251
|
break;
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1806
|
-
...
|
|
1807
|
-
...
|
|
1808
|
-
},
|
|
252
|
+
const D = tt(await z[b](m, s), P, b);
|
|
253
|
+
D && (_ = {
|
|
254
|
+
...D,
|
|
255
|
+
...O(b, D.message)
|
|
256
|
+
}, J(D.message), r && (p[C] = _));
|
|
1809
257
|
}
|
|
1810
|
-
if (!
|
|
1811
|
-
ref:
|
|
1812
|
-
...
|
|
258
|
+
if (!T(_) && (p[C] = {
|
|
259
|
+
ref: P,
|
|
260
|
+
..._
|
|
1813
261
|
}, !r))
|
|
1814
|
-
return
|
|
262
|
+
return p;
|
|
1815
263
|
}
|
|
1816
264
|
}
|
|
1817
|
-
return
|
|
265
|
+
return J(!0), p;
|
|
1818
266
|
};
|
|
1819
|
-
function
|
|
1820
|
-
const r =
|
|
267
|
+
function Ht(e, s) {
|
|
268
|
+
const r = s.slice(0, -1).length;
|
|
1821
269
|
let l = 0;
|
|
1822
270
|
for (; l < r; )
|
|
1823
|
-
e =
|
|
271
|
+
e = A(e) ? l++ : e[s[l++]];
|
|
1824
272
|
return e;
|
|
1825
273
|
}
|
|
1826
|
-
function
|
|
1827
|
-
for (const
|
|
1828
|
-
if (e.hasOwnProperty(
|
|
274
|
+
function zt(e) {
|
|
275
|
+
for (const s in e)
|
|
276
|
+
if (e.hasOwnProperty(s) && !A(e[s]))
|
|
1829
277
|
return !1;
|
|
1830
278
|
return !0;
|
|
1831
279
|
}
|
|
1832
|
-
function
|
|
1833
|
-
const r = Array.isArray(
|
|
1834
|
-
return l && delete l[
|
|
280
|
+
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;
|
|
1835
283
|
}
|
|
1836
|
-
var
|
|
284
|
+
var Ee = () => {
|
|
1837
285
|
let e = [];
|
|
1838
286
|
return {
|
|
1839
287
|
get observers() {
|
|
1840
288
|
return e;
|
|
1841
289
|
},
|
|
1842
|
-
next: (
|
|
1843
|
-
for (const
|
|
1844
|
-
|
|
290
|
+
next: (u) => {
|
|
291
|
+
for (const a of e)
|
|
292
|
+
a.next && a.next(u);
|
|
1845
293
|
},
|
|
1846
|
-
subscribe: (
|
|
294
|
+
subscribe: (u) => (e.push(u), {
|
|
1847
295
|
unsubscribe: () => {
|
|
1848
|
-
e = e.filter((
|
|
296
|
+
e = e.filter((a) => a !== u);
|
|
1849
297
|
}
|
|
1850
298
|
}),
|
|
1851
299
|
unsubscribe: () => {
|
|
1852
300
|
e = [];
|
|
1853
301
|
}
|
|
1854
302
|
};
|
|
1855
|
-
},
|
|
1856
|
-
function
|
|
1857
|
-
if (
|
|
1858
|
-
return e ===
|
|
1859
|
-
if (
|
|
1860
|
-
return e.getTime() ===
|
|
1861
|
-
const r = Object.keys(e), l = Object.keys(
|
|
303
|
+
}, Ve = (e) => B(e) || !nt(e);
|
|
304
|
+
function te(e, s) {
|
|
305
|
+
if (Ve(e) || Ve(s))
|
|
306
|
+
return e === s;
|
|
307
|
+
if (ae(e) && ae(s))
|
|
308
|
+
return e.getTime() === s.getTime();
|
|
309
|
+
const r = Object.keys(e), l = Object.keys(s);
|
|
1862
310
|
if (r.length !== l.length)
|
|
1863
311
|
return !1;
|
|
1864
|
-
for (const
|
|
1865
|
-
const
|
|
1866
|
-
if (!l.includes(
|
|
312
|
+
for (const u of r) {
|
|
313
|
+
const a = e[u];
|
|
314
|
+
if (!l.includes(u))
|
|
1867
315
|
return !1;
|
|
1868
|
-
if (
|
|
1869
|
-
const
|
|
1870
|
-
if (
|
|
316
|
+
if (u !== "ref") {
|
|
317
|
+
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)
|
|
1871
319
|
return !1;
|
|
1872
320
|
}
|
|
1873
321
|
}
|
|
1874
322
|
return !0;
|
|
1875
323
|
}
|
|
1876
|
-
var
|
|
1877
|
-
for (const
|
|
1878
|
-
if (
|
|
324
|
+
var ot = (e) => e.type === "select-multiple", $t = (e) => Me(e) || ye(e), Ce = (e) => be(e) && e.isConnected, ct = (e) => {
|
|
325
|
+
for (const s in e)
|
|
326
|
+
if (Z(e[s]))
|
|
1879
327
|
return !0;
|
|
1880
328
|
return !1;
|
|
1881
329
|
};
|
|
1882
|
-
function
|
|
330
|
+
function Fe(e, s = {}) {
|
|
1883
331
|
const r = Array.isArray(e);
|
|
1884
|
-
if (
|
|
332
|
+
if (S(e) || r)
|
|
1885
333
|
for (const l in e)
|
|
1886
|
-
Array.isArray(e[l]) ||
|
|
1887
|
-
return
|
|
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);
|
|
335
|
+
return s;
|
|
1888
336
|
}
|
|
1889
|
-
function
|
|
337
|
+
function ft(e, s, r) {
|
|
1890
338
|
const l = Array.isArray(e);
|
|
1891
|
-
if (
|
|
1892
|
-
for (const
|
|
1893
|
-
Array.isArray(e[
|
|
339
|
+
if (S(e) || l)
|
|
340
|
+
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]);
|
|
1894
342
|
return r;
|
|
1895
343
|
}
|
|
1896
|
-
var
|
|
1897
|
-
function
|
|
1898
|
-
const
|
|
1899
|
-
if (!(e.refs ? e.refs.every((r) => r.disabled) :
|
|
1900
|
-
return
|
|
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) {
|
|
346
|
+
const s = e.ref;
|
|
347
|
+
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);
|
|
1901
349
|
}
|
|
1902
|
-
var
|
|
1903
|
-
const
|
|
1904
|
-
for (const
|
|
1905
|
-
const
|
|
1906
|
-
|
|
350
|
+
var jt = (e, s, r, l) => {
|
|
351
|
+
const u = {};
|
|
352
|
+
for (const a of e) {
|
|
353
|
+
const y = d(s, a);
|
|
354
|
+
y && V(u, a, y._f);
|
|
1907
355
|
}
|
|
1908
356
|
return {
|
|
1909
357
|
criteriaMode: r,
|
|
1910
358
|
names: [...e],
|
|
1911
|
-
fields:
|
|
359
|
+
fields: u,
|
|
1912
360
|
shouldUseNativeValidation: l
|
|
1913
361
|
};
|
|
1914
|
-
},
|
|
1915
|
-
function
|
|
1916
|
-
const l =
|
|
1917
|
-
if (l ||
|
|
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
|
+
function st(e, s, r) {
|
|
364
|
+
const l = d(e, r);
|
|
365
|
+
if (l || Re(r))
|
|
1918
366
|
return {
|
|
1919
367
|
error: l,
|
|
1920
368
|
name: r
|
|
1921
369
|
};
|
|
1922
|
-
const
|
|
1923
|
-
for (;
|
|
1924
|
-
const
|
|
1925
|
-
if (
|
|
370
|
+
const u = r.split(".");
|
|
371
|
+
for (; u.length; ) {
|
|
372
|
+
const a = u.join("."), y = d(s, a), g = d(e, a);
|
|
373
|
+
if (y && !Array.isArray(y) && r !== a)
|
|
1926
374
|
return { name: r };
|
|
1927
|
-
if (
|
|
375
|
+
if (g && g.type)
|
|
1928
376
|
return {
|
|
1929
|
-
name:
|
|
1930
|
-
error:
|
|
377
|
+
name: a,
|
|
378
|
+
error: g
|
|
1931
379
|
};
|
|
1932
|
-
|
|
380
|
+
u.pop();
|
|
1933
381
|
}
|
|
1934
382
|
return {
|
|
1935
383
|
name: r
|
|
1936
384
|
};
|
|
1937
385
|
}
|
|
1938
|
-
var
|
|
1939
|
-
const
|
|
1940
|
-
mode:
|
|
1941
|
-
reValidateMode:
|
|
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,
|
|
1942
390
|
shouldFocusError: !0
|
|
1943
391
|
};
|
|
1944
|
-
function
|
|
1945
|
-
let
|
|
1946
|
-
...
|
|
392
|
+
function Xt(e = {}) {
|
|
393
|
+
let s = {
|
|
394
|
+
...Qt,
|
|
1947
395
|
...e
|
|
1948
396
|
}, r = {
|
|
1949
397
|
submitCount: 0,
|
|
1950
398
|
isDirty: !1,
|
|
1951
|
-
isLoading:
|
|
399
|
+
isLoading: Z(s.defaultValues),
|
|
1952
400
|
isValidating: !1,
|
|
1953
401
|
isSubmitted: !1,
|
|
1954
402
|
isSubmitting: !1,
|
|
@@ -1957,19 +405,19 @@ function ln(e = {}) {
|
|
|
1957
405
|
touchedFields: {},
|
|
1958
406
|
dirtyFields: {},
|
|
1959
407
|
validatingFields: {},
|
|
1960
|
-
errors:
|
|
1961
|
-
disabled:
|
|
1962
|
-
}, l = {},
|
|
408
|
+
errors: s.errors || {},
|
|
409
|
+
disabled: s.disabled || !1
|
|
410
|
+
}, l = {}, u = S(s.defaultValues) || S(s.values) ? U(s.defaultValues || s.values) || {} : {}, a = s.shouldUnregister ? {} : U(u), y = {
|
|
1963
411
|
action: !1,
|
|
1964
412
|
mount: !1,
|
|
1965
413
|
watch: !1
|
|
1966
|
-
},
|
|
414
|
+
}, g = {
|
|
1967
415
|
mount: /* @__PURE__ */ new Set(),
|
|
1968
416
|
unMount: /* @__PURE__ */ new Set(),
|
|
1969
417
|
array: /* @__PURE__ */ new Set(),
|
|
1970
418
|
watch: /* @__PURE__ */ new Set()
|
|
1971
|
-
},
|
|
1972
|
-
const
|
|
419
|
+
}, R, M = 0;
|
|
420
|
+
const F = {
|
|
1973
421
|
isDirty: !1,
|
|
1974
422
|
dirtyFields: !1,
|
|
1975
423
|
validatingFields: !1,
|
|
@@ -1977,359 +425,359 @@ function ln(e = {}) {
|
|
|
1977
425
|
isValidating: !1,
|
|
1978
426
|
isValid: !1,
|
|
1979
427
|
errors: !1
|
|
1980
|
-
},
|
|
1981
|
-
values:
|
|
1982
|
-
array:
|
|
1983
|
-
state:
|
|
1984
|
-
},
|
|
1985
|
-
clearTimeout(
|
|
1986
|
-
},
|
|
1987
|
-
if (
|
|
1988
|
-
const
|
|
1989
|
-
|
|
1990
|
-
isValid:
|
|
428
|
+
}, 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) => {
|
|
433
|
+
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);
|
|
437
|
+
i !== r.isValid && v.state.next({
|
|
438
|
+
isValid: i
|
|
1991
439
|
});
|
|
1992
440
|
}
|
|
1993
|
-
},
|
|
1994
|
-
(
|
|
1995
|
-
|
|
1996
|
-
}),
|
|
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));
|
|
444
|
+
}), v.state.next({
|
|
1997
445
|
validatingFields: r.validatingFields,
|
|
1998
|
-
isValidating: !
|
|
446
|
+
isValidating: !T(r.validatingFields)
|
|
1999
447
|
}));
|
|
2000
|
-
},
|
|
2001
|
-
if (
|
|
2002
|
-
if (
|
|
2003
|
-
const
|
|
2004
|
-
|
|
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);
|
|
2005
453
|
}
|
|
2006
|
-
if (
|
|
2007
|
-
const
|
|
2008
|
-
|
|
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);
|
|
2009
457
|
}
|
|
2010
|
-
if (
|
|
2011
|
-
const
|
|
2012
|
-
|
|
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);
|
|
2013
461
|
}
|
|
2014
|
-
|
|
2015
|
-
name:
|
|
2016
|
-
isDirty:
|
|
462
|
+
F.dirtyFields && (r.dirtyFields = ve(u, a)), v.state.next({
|
|
463
|
+
name: t,
|
|
464
|
+
isDirty: _(t, i),
|
|
2017
465
|
dirtyFields: r.dirtyFields,
|
|
2018
466
|
errors: r.errors,
|
|
2019
467
|
isValid: r.isValid
|
|
2020
468
|
});
|
|
2021
469
|
} else
|
|
2022
|
-
|
|
2023
|
-
},
|
|
2024
|
-
|
|
470
|
+
V(a, t, i);
|
|
471
|
+
}, P = (t, i) => {
|
|
472
|
+
V(r.errors, t, i), v.state.next({
|
|
2025
473
|
errors: r.errors
|
|
2026
474
|
});
|
|
2027
|
-
},
|
|
2028
|
-
r.errors =
|
|
475
|
+
}, J = (t) => {
|
|
476
|
+
r.errors = t, v.state.next({
|
|
2029
477
|
errors: r.errors,
|
|
2030
478
|
isValid: !1
|
|
2031
479
|
});
|
|
2032
|
-
},
|
|
2033
|
-
const
|
|
2034
|
-
if (
|
|
2035
|
-
const
|
|
2036
|
-
|
|
2037
|
-
}
|
|
2038
|
-
},
|
|
2039
|
-
let
|
|
2040
|
-
const
|
|
2041
|
-
name:
|
|
2042
|
-
},
|
|
2043
|
-
if (!
|
|
2044
|
-
|
|
2045
|
-
const
|
|
2046
|
-
|
|
2047
|
-
}
|
|
2048
|
-
if (
|
|
2049
|
-
const
|
|
2050
|
-
|
|
2051
|
-
}
|
|
2052
|
-
return
|
|
2053
|
-
},
|
|
2054
|
-
const
|
|
2055
|
-
if (e.delayError &&
|
|
2056
|
-
const
|
|
2057
|
-
...
|
|
2058
|
-
...
|
|
480
|
+
}, p = (t, i, n, f) => {
|
|
481
|
+
const c = d(l, t);
|
|
482
|
+
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 && $();
|
|
485
|
+
}
|
|
486
|
+
}, re = (t, i, n, f, c) => {
|
|
487
|
+
let o = !1, h = !1;
|
|
488
|
+
const x = {
|
|
489
|
+
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;
|
|
495
|
+
}
|
|
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);
|
|
499
|
+
}
|
|
500
|
+
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) {
|
|
504
|
+
const h = {
|
|
505
|
+
...f,
|
|
506
|
+
...o && Y(i) ? { isValid: i } : {},
|
|
2059
507
|
errors: r.errors,
|
|
2060
|
-
name:
|
|
508
|
+
name: t
|
|
2061
509
|
};
|
|
2062
510
|
r = {
|
|
2063
511
|
...r,
|
|
2064
|
-
...
|
|
2065
|
-
},
|
|
2066
|
-
}
|
|
2067
|
-
},
|
|
2068
|
-
|
|
2069
|
-
const
|
|
2070
|
-
return
|
|
2071
|
-
},
|
|
2072
|
-
const { errors:
|
|
2073
|
-
if (
|
|
2074
|
-
for (const
|
|
2075
|
-
const
|
|
2076
|
-
|
|
512
|
+
...h
|
|
513
|
+
}, v.state.next(h);
|
|
514
|
+
}
|
|
515
|
+
}, 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) => {
|
|
520
|
+
const { errors: i } = await ee(t);
|
|
521
|
+
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);
|
|
2077
525
|
}
|
|
2078
526
|
else
|
|
2079
|
-
r.errors =
|
|
2080
|
-
return
|
|
2081
|
-
},
|
|
527
|
+
r.errors = i;
|
|
528
|
+
return i;
|
|
529
|
+
}, O = async (t, i, n = {
|
|
2082
530
|
valid: !0
|
|
2083
531
|
}) => {
|
|
2084
|
-
for (const
|
|
2085
|
-
const
|
|
2086
|
-
if (
|
|
2087
|
-
const { _f:
|
|
2088
|
-
if (
|
|
2089
|
-
const
|
|
2090
|
-
|
|
2091
|
-
const
|
|
2092
|
-
if (
|
|
532
|
+
for (const f in t) {
|
|
533
|
+
const c = t[f];
|
|
534
|
+
if (c) {
|
|
535
|
+
const { _f: o, ...h } = c;
|
|
536
|
+
if (o) {
|
|
537
|
+
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))
|
|
2093
541
|
break;
|
|
2094
|
-
!
|
|
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));
|
|
2095
543
|
}
|
|
2096
|
-
!
|
|
544
|
+
!T(h) && await O(h, i, n);
|
|
2097
545
|
}
|
|
2098
546
|
}
|
|
2099
|
-
return
|
|
2100
|
-
},
|
|
2101
|
-
for (const
|
|
2102
|
-
const
|
|
2103
|
-
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
},
|
|
2107
|
-
...
|
|
2108
|
-
},
|
|
2109
|
-
const
|
|
2110
|
-
let
|
|
2111
|
-
if (
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2114
|
-
name:
|
|
2115
|
-
values: { ...
|
|
547
|
+
return n.valid;
|
|
548
|
+
}, ge = () => {
|
|
549
|
+
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);
|
|
552
|
+
}
|
|
553
|
+
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);
|
|
558
|
+
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({
|
|
562
|
+
name: t,
|
|
563
|
+
values: { ...a }
|
|
2116
564
|
})));
|
|
2117
565
|
}
|
|
2118
|
-
(
|
|
2119
|
-
},
|
|
2120
|
-
for (const
|
|
2121
|
-
const
|
|
2122
|
-
(
|
|
2123
|
-
}
|
|
2124
|
-
},
|
|
2125
|
-
const
|
|
2126
|
-
|
|
2127
|
-
name:
|
|
2128
|
-
values: { ...
|
|
2129
|
-
}), (
|
|
2130
|
-
name:
|
|
2131
|
-
dirtyFields:
|
|
2132
|
-
isDirty:
|
|
2133
|
-
})) :
|
|
2134
|
-
name:
|
|
2135
|
-
values: { ...
|
|
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);
|
|
571
|
+
}
|
|
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({
|
|
575
|
+
name: t,
|
|
576
|
+
values: { ...a }
|
|
577
|
+
}), (F.isDirty || F.dirtyFields) && n.shouldDirty && v.state.next({
|
|
578
|
+
name: t,
|
|
579
|
+
dirtyFields: ve(u, a),
|
|
580
|
+
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
|
+
name: y.mount ? t : void 0,
|
|
583
|
+
values: { ...a }
|
|
2136
584
|
});
|
|
2137
|
-
},
|
|
2138
|
-
|
|
2139
|
-
const
|
|
2140
|
-
let
|
|
2141
|
-
const
|
|
2142
|
-
|
|
585
|
+
}, ue = async (t) => {
|
|
586
|
+
y.mount = !0;
|
|
587
|
+
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);
|
|
2143
591
|
};
|
|
2144
|
-
if (
|
|
2145
|
-
let
|
|
2146
|
-
const
|
|
2147
|
-
|
|
2148
|
-
const
|
|
2149
|
-
if (!
|
|
2150
|
-
name:
|
|
2151
|
-
type:
|
|
2152
|
-
values: { ...
|
|
2153
|
-
}),
|
|
2154
|
-
return
|
|
2155
|
-
if (!
|
|
2156
|
-
const { errors:
|
|
2157
|
-
if (
|
|
2158
|
-
const
|
|
2159
|
-
|
|
592
|
+
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,
|
|
599
|
+
type: t.type,
|
|
600
|
+
values: { ...a }
|
|
601
|
+
}), _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);
|
|
2160
608
|
}
|
|
2161
609
|
} else
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
}
|
|
2165
|
-
},
|
|
2166
|
-
if (
|
|
2167
|
-
return
|
|
2168
|
-
},
|
|
2169
|
-
let
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2172
|
-
const
|
|
2173
|
-
|
|
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));
|
|
612
|
+
}
|
|
613
|
+
}, oe = (t, i) => {
|
|
614
|
+
if (d(r.errors, i) && t.focus)
|
|
615
|
+
return t.focus(), 1;
|
|
616
|
+
}, ce = async (t, i = {}) => {
|
|
617
|
+
let n, f;
|
|
618
|
+
const c = _e(t);
|
|
619
|
+
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;
|
|
2174
622
|
} else
|
|
2175
|
-
|
|
2176
|
-
const
|
|
2177
|
-
return await
|
|
2178
|
-
}))).every(Boolean), !(!
|
|
2179
|
-
return
|
|
2180
|
-
...!
|
|
2181
|
-
...
|
|
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);
|
|
627
|
+
return v.state.next({
|
|
628
|
+
...!K(t) || F.isValid && n !== r.isValid ? {} : { name: t },
|
|
629
|
+
...s.resolver || !t ? { isValid: n } : {},
|
|
2182
630
|
errors: r.errors
|
|
2183
|
-
}),
|
|
2184
|
-
},
|
|
2185
|
-
const
|
|
2186
|
-
...
|
|
631
|
+
}), i.shouldFocus && !f && de(l, oe, t ? c : g.mount), f;
|
|
632
|
+
}, Oe = (t) => {
|
|
633
|
+
const i = {
|
|
634
|
+
...y.mount ? a : u
|
|
2187
635
|
};
|
|
2188
|
-
return
|
|
2189
|
-
},
|
|
2190
|
-
invalid: !!
|
|
2191
|
-
isDirty: !!
|
|
2192
|
-
error:
|
|
2193
|
-
isValidating: !!
|
|
2194
|
-
isTouched: !!
|
|
2195
|
-
}),
|
|
2196
|
-
|
|
2197
|
-
errors:
|
|
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)
|
|
643
|
+
}), yt = (t) => {
|
|
644
|
+
t && _e(t).forEach((i) => k(r.errors, i)), v.state.next({
|
|
645
|
+
errors: t ? r.errors : {}
|
|
2198
646
|
});
|
|
2199
|
-
},
|
|
2200
|
-
const
|
|
2201
|
-
|
|
2202
|
-
...
|
|
2203
|
-
...
|
|
2204
|
-
ref:
|
|
2205
|
-
}),
|
|
2206
|
-
name:
|
|
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,
|
|
651
|
+
...i,
|
|
652
|
+
ref: f
|
|
653
|
+
}), v.state.next({
|
|
654
|
+
name: t,
|
|
2207
655
|
errors: r.errors,
|
|
2208
656
|
isValid: !1
|
|
2209
|
-
}),
|
|
2210
|
-
},
|
|
2211
|
-
next: (
|
|
2212
|
-
}) :
|
|
2213
|
-
for (const
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
values: { ...
|
|
2217
|
-
}),
|
|
657
|
+
}), n && n.shouldFocus && f && f.focus && f.focus();
|
|
658
|
+
}, ht = (t, i) => Z(t) ? v.values.subscribe({
|
|
659
|
+
next: (n) => t(b(void 0, i), n)
|
|
660
|
+
}) : 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);
|
|
663
|
+
v.values.next({
|
|
664
|
+
values: { ...a }
|
|
665
|
+
}), v.state.next({
|
|
2218
666
|
...r,
|
|
2219
|
-
...
|
|
2220
|
-
}), !
|
|
2221
|
-
},
|
|
2222
|
-
if (
|
|
2223
|
-
const
|
|
2224
|
-
|
|
2225
|
-
}
|
|
2226
|
-
},
|
|
2227
|
-
let
|
|
2228
|
-
const
|
|
2229
|
-
return
|
|
2230
|
-
...
|
|
667
|
+
...i.keepDirty ? { isDirty: _() } : {}
|
|
668
|
+
}), !i.keepIsValid && $();
|
|
669
|
+
}, Ie = ({ disabled: t, name: i, field: n, fields: f, value: c }) => {
|
|
670
|
+
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);
|
|
673
|
+
}
|
|
674
|
+
}, pe = (t, i = {}) => {
|
|
675
|
+
let n = d(l, t);
|
|
676
|
+
const f = Y(i.disabled);
|
|
677
|
+
return V(l, t, {
|
|
678
|
+
...n || {},
|
|
2231
679
|
_f: {
|
|
2232
|
-
...
|
|
2233
|
-
name:
|
|
680
|
+
...n && n._f ? n._f : { ref: { name: t } },
|
|
681
|
+
name: t,
|
|
2234
682
|
mount: !0,
|
|
2235
|
-
...
|
|
683
|
+
...i
|
|
2236
684
|
}
|
|
2237
|
-
}),
|
|
2238
|
-
field:
|
|
2239
|
-
disabled:
|
|
2240
|
-
name:
|
|
2241
|
-
value:
|
|
2242
|
-
}) :
|
|
2243
|
-
...
|
|
2244
|
-
...
|
|
2245
|
-
required: !!
|
|
2246
|
-
min:
|
|
2247
|
-
max:
|
|
2248
|
-
minLength:
|
|
2249
|
-
maxLength:
|
|
2250
|
-
pattern:
|
|
685
|
+
}), g.mount.add(t), n ? Ie({
|
|
686
|
+
field: n,
|
|
687
|
+
disabled: i.disabled,
|
|
688
|
+
name: t,
|
|
689
|
+
value: i.value
|
|
690
|
+
}) : p(t, !0, i.value), {
|
|
691
|
+
...f ? { disabled: i.disabled } : {},
|
|
692
|
+
...s.progressive ? {
|
|
693
|
+
required: !!i.required,
|
|
694
|
+
min: fe(i.min),
|
|
695
|
+
max: fe(i.max),
|
|
696
|
+
minLength: fe(i.minLength),
|
|
697
|
+
maxLength: fe(i.maxLength),
|
|
698
|
+
pattern: fe(i.pattern)
|
|
2251
699
|
} : {},
|
|
2252
|
-
name:
|
|
2253
|
-
onChange:
|
|
2254
|
-
onBlur:
|
|
2255
|
-
ref: (
|
|
2256
|
-
if (
|
|
2257
|
-
|
|
2258
|
-
const
|
|
2259
|
-
if (
|
|
700
|
+
name: t,
|
|
701
|
+
onChange: ue,
|
|
702
|
+
onBlur: ue,
|
|
703
|
+
ref: (c) => {
|
|
704
|
+
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)
|
|
2260
708
|
return;
|
|
2261
|
-
|
|
709
|
+
V(l, t, {
|
|
2262
710
|
_f: {
|
|
2263
|
-
...
|
|
2264
|
-
...
|
|
711
|
+
...n._f,
|
|
712
|
+
...h ? {
|
|
2265
713
|
refs: [
|
|
2266
|
-
...
|
|
2267
|
-
|
|
2268
|
-
...Array.isArray(
|
|
714
|
+
...x.filter(Ce),
|
|
715
|
+
o,
|
|
716
|
+
...Array.isArray(d(u, t)) ? [{}] : []
|
|
2269
717
|
],
|
|
2270
|
-
ref: { type:
|
|
2271
|
-
} : { ref:
|
|
718
|
+
ref: { type: o.type, name: t }
|
|
719
|
+
} : { ref: o }
|
|
2272
720
|
}
|
|
2273
|
-
}),
|
|
721
|
+
}), p(t, !1, void 0, o);
|
|
2274
722
|
} else
|
|
2275
|
-
|
|
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);
|
|
2276
724
|
}
|
|
2277
725
|
};
|
|
2278
|
-
},
|
|
2279
|
-
|
|
2280
|
-
const
|
|
2281
|
-
|
|
2282
|
-
|
|
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;
|
|
2283
731
|
}));
|
|
2284
732
|
}, 0, !1));
|
|
2285
|
-
},
|
|
2286
|
-
let
|
|
2287
|
-
|
|
2288
|
-
let
|
|
2289
|
-
if (
|
|
733
|
+
}, qe = (t, i) => async (n) => {
|
|
734
|
+
let f;
|
|
735
|
+
n && (n.preventDefault && n.preventDefault(), n.persist && n.persist());
|
|
736
|
+
let c = U(a);
|
|
737
|
+
if (v.state.next({
|
|
2290
738
|
isSubmitting: !0
|
|
2291
|
-
}),
|
|
2292
|
-
const { errors:
|
|
2293
|
-
r.errors =
|
|
739
|
+
}), s.resolver) {
|
|
740
|
+
const { errors: o, values: h } = await ee();
|
|
741
|
+
r.errors = o, c = h;
|
|
2294
742
|
} else
|
|
2295
|
-
await
|
|
2296
|
-
if (
|
|
2297
|
-
|
|
743
|
+
await O(l);
|
|
744
|
+
if (k(r.errors, "root"), T(r.errors)) {
|
|
745
|
+
v.state.next({
|
|
2298
746
|
errors: {}
|
|
2299
747
|
});
|
|
2300
748
|
try {
|
|
2301
|
-
await
|
|
2302
|
-
} catch (
|
|
2303
|
-
|
|
749
|
+
await t(c, n);
|
|
750
|
+
} catch (o) {
|
|
751
|
+
f = o;
|
|
2304
752
|
}
|
|
2305
753
|
} else
|
|
2306
|
-
|
|
2307
|
-
if (
|
|
754
|
+
i && await i({ ...r.errors }, n), Pe(), setTimeout(Pe);
|
|
755
|
+
if (v.state.next({
|
|
2308
756
|
isSubmitted: !0,
|
|
2309
757
|
isSubmitting: !1,
|
|
2310
|
-
isSubmitSuccessful:
|
|
758
|
+
isSubmitSuccessful: T(r.errors) && !f,
|
|
2311
759
|
submitCount: r.submitCount + 1,
|
|
2312
760
|
errors: r.errors
|
|
2313
|
-
}),
|
|
2314
|
-
throw
|
|
2315
|
-
},
|
|
2316
|
-
|
|
2317
|
-
},
|
|
2318
|
-
const
|
|
2319
|
-
if (
|
|
2320
|
-
if (
|
|
2321
|
-
for (const
|
|
2322
|
-
|
|
761
|
+
}), f)
|
|
762
|
+
throw f;
|
|
763
|
+
}, 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) {
|
|
768
|
+
if (i.keepDirtyValues)
|
|
769
|
+
for (const h of g.mount)
|
|
770
|
+
d(r.dirtyFields, h) ? V(o, h, d(a, h)) : N(h, d(o, h));
|
|
2323
771
|
else {
|
|
2324
|
-
if (
|
|
2325
|
-
for (const
|
|
2326
|
-
const
|
|
2327
|
-
if (
|
|
2328
|
-
const
|
|
2329
|
-
if (
|
|
2330
|
-
const
|
|
2331
|
-
if (
|
|
2332
|
-
|
|
772
|
+
if (Te && A(t))
|
|
773
|
+
for (const h of g.mount) {
|
|
774
|
+
const x = d(l, h);
|
|
775
|
+
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();
|
|
2333
781
|
break;
|
|
2334
782
|
}
|
|
2335
783
|
}
|
|
@@ -2337,124 +785,124 @@ function ln(e = {}) {
|
|
|
2337
785
|
}
|
|
2338
786
|
l = {};
|
|
2339
787
|
}
|
|
2340
|
-
|
|
2341
|
-
values: { ...
|
|
2342
|
-
}),
|
|
2343
|
-
values: { ...
|
|
788
|
+
a = e.shouldUnregister ? i.keepDefaultValues ? U(u) : {} : U(o), v.array.next({
|
|
789
|
+
values: { ...o }
|
|
790
|
+
}), v.values.next({
|
|
791
|
+
values: { ...o }
|
|
2344
792
|
});
|
|
2345
793
|
}
|
|
2346
|
-
|
|
2347
|
-
mount:
|
|
794
|
+
g = {
|
|
795
|
+
mount: i.keepDirtyValues ? g.mount : /* @__PURE__ */ new Set(),
|
|
2348
796
|
unMount: /* @__PURE__ */ new Set(),
|
|
2349
797
|
array: /* @__PURE__ */ new Set(),
|
|
2350
798
|
watch: /* @__PURE__ */ new Set(),
|
|
2351
799
|
watchAll: !1,
|
|
2352
800
|
focus: ""
|
|
2353
|
-
},
|
|
2354
|
-
submitCount:
|
|
2355
|
-
isDirty:
|
|
2356
|
-
isSubmitted:
|
|
2357
|
-
dirtyFields:
|
|
2358
|
-
touchedFields:
|
|
2359
|
-
errors:
|
|
2360
|
-
isSubmitSuccessful:
|
|
801
|
+
}, y.mount = !F.isValid || !!i.keepIsValid || !!i.keepDirtyValues, y.watch = !!e.shouldUnregister, v.state.next({
|
|
802
|
+
submitCount: i.keepSubmitCount ? r.submitCount : 0,
|
|
803
|
+
isDirty: c ? !1 : i.keepDirty ? r.isDirty : !!(i.keepDefaultValues && !te(t, u)),
|
|
804
|
+
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
|
+
touchedFields: i.keepTouched ? r.touchedFields : {},
|
|
807
|
+
errors: i.keepErrors ? r.errors : {},
|
|
808
|
+
isSubmitSuccessful: i.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
|
|
2361
809
|
isSubmitting: !1
|
|
2362
810
|
});
|
|
2363
|
-
},
|
|
811
|
+
}, He = (t, i) => We(Z(t) ? t(a) : t, i);
|
|
2364
812
|
return {
|
|
2365
813
|
control: {
|
|
2366
|
-
register:
|
|
2367
|
-
unregister:
|
|
2368
|
-
getFieldState:
|
|
2369
|
-
handleSubmit:
|
|
2370
|
-
setError:
|
|
2371
|
-
_executeSchema:
|
|
2372
|
-
_getWatch:
|
|
2373
|
-
_getDirty:
|
|
2374
|
-
_updateValid:
|
|
2375
|
-
_removeUnmounted:
|
|
2376
|
-
_updateFieldArray:
|
|
2377
|
-
_updateDisabledField:
|
|
2378
|
-
_getFieldArray:
|
|
2379
|
-
_reset:
|
|
2380
|
-
_resetDefaultValues: () =>
|
|
2381
|
-
|
|
814
|
+
register: pe,
|
|
815
|
+
unregister: we,
|
|
816
|
+
getFieldState: Ne,
|
|
817
|
+
handleSubmit: qe,
|
|
818
|
+
setError: Ue,
|
|
819
|
+
_executeSchema: ee,
|
|
820
|
+
_getWatch: b,
|
|
821
|
+
_getDirty: _,
|
|
822
|
+
_updateValid: $,
|
|
823
|
+
_removeUnmounted: ge,
|
|
824
|
+
_updateFieldArray: m,
|
|
825
|
+
_updateDisabledField: Ie,
|
|
826
|
+
_getFieldArray: D,
|
|
827
|
+
_reset: We,
|
|
828
|
+
_resetDefaultValues: () => Z(s.defaultValues) && s.defaultValues().then((t) => {
|
|
829
|
+
He(t, s.resetOptions), v.state.next({
|
|
2382
830
|
isLoading: !1
|
|
2383
831
|
});
|
|
2384
832
|
}),
|
|
2385
|
-
_updateFormState: (
|
|
833
|
+
_updateFormState: (t) => {
|
|
2386
834
|
r = {
|
|
2387
835
|
...r,
|
|
2388
|
-
...
|
|
836
|
+
...t
|
|
2389
837
|
};
|
|
2390
838
|
},
|
|
2391
|
-
_disableForm:
|
|
2392
|
-
_subjects:
|
|
2393
|
-
_proxyFormState:
|
|
2394
|
-
_setErrors:
|
|
839
|
+
_disableForm: gt,
|
|
840
|
+
_subjects: v,
|
|
841
|
+
_proxyFormState: F,
|
|
842
|
+
_setErrors: J,
|
|
2395
843
|
get _fields() {
|
|
2396
844
|
return l;
|
|
2397
845
|
},
|
|
2398
846
|
get _formValues() {
|
|
2399
|
-
return
|
|
847
|
+
return a;
|
|
2400
848
|
},
|
|
2401
849
|
get _state() {
|
|
2402
|
-
return
|
|
850
|
+
return y;
|
|
2403
851
|
},
|
|
2404
|
-
set _state(
|
|
2405
|
-
|
|
852
|
+
set _state(t) {
|
|
853
|
+
y = t;
|
|
2406
854
|
},
|
|
2407
855
|
get _defaultValues() {
|
|
2408
|
-
return
|
|
856
|
+
return u;
|
|
2409
857
|
},
|
|
2410
858
|
get _names() {
|
|
2411
|
-
return
|
|
859
|
+
return g;
|
|
2412
860
|
},
|
|
2413
|
-
set _names(
|
|
2414
|
-
|
|
861
|
+
set _names(t) {
|
|
862
|
+
g = t;
|
|
2415
863
|
},
|
|
2416
864
|
get _formState() {
|
|
2417
865
|
return r;
|
|
2418
866
|
},
|
|
2419
|
-
set _formState(
|
|
2420
|
-
r =
|
|
867
|
+
set _formState(t) {
|
|
868
|
+
r = t;
|
|
2421
869
|
},
|
|
2422
870
|
get _options() {
|
|
2423
|
-
return
|
|
871
|
+
return s;
|
|
2424
872
|
},
|
|
2425
|
-
set _options(
|
|
2426
|
-
|
|
2427
|
-
...
|
|
2428
|
-
...
|
|
873
|
+
set _options(t) {
|
|
874
|
+
s = {
|
|
875
|
+
...s,
|
|
876
|
+
...t
|
|
2429
877
|
};
|
|
2430
878
|
}
|
|
2431
879
|
},
|
|
2432
|
-
trigger:
|
|
2433
|
-
register:
|
|
2434
|
-
handleSubmit:
|
|
2435
|
-
watch:
|
|
2436
|
-
setValue:
|
|
2437
|
-
getValues:
|
|
2438
|
-
reset:
|
|
2439
|
-
resetField:
|
|
2440
|
-
clearErrors:
|
|
2441
|
-
unregister:
|
|
2442
|
-
setError:
|
|
2443
|
-
setFocus: (
|
|
2444
|
-
const
|
|
2445
|
-
if (
|
|
2446
|
-
const
|
|
2447
|
-
|
|
880
|
+
trigger: ce,
|
|
881
|
+
register: pe,
|
|
882
|
+
handleSubmit: qe,
|
|
883
|
+
watch: ht,
|
|
884
|
+
setValue: N,
|
|
885
|
+
getValues: Oe,
|
|
886
|
+
reset: He,
|
|
887
|
+
resetField: vt,
|
|
888
|
+
clearErrors: yt,
|
|
889
|
+
unregister: we,
|
|
890
|
+
setError: Ue,
|
|
891
|
+
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;
|
|
895
|
+
c.focus && (c.focus(), i.shouldSelect && c.select());
|
|
2448
896
|
}
|
|
2449
897
|
},
|
|
2450
|
-
getFieldState:
|
|
898
|
+
getFieldState: Ne
|
|
2451
899
|
};
|
|
2452
900
|
}
|
|
2453
|
-
function
|
|
2454
|
-
const
|
|
901
|
+
function Yt(e = {}) {
|
|
902
|
+
const s = I.useRef(), r = I.useRef(), [l, u] = I.useState({
|
|
2455
903
|
isDirty: !1,
|
|
2456
904
|
isValidating: !1,
|
|
2457
|
-
isLoading:
|
|
905
|
+
isLoading: Z(e.defaultValues),
|
|
2458
906
|
isSubmitted: !1,
|
|
2459
907
|
isSubmitting: !1,
|
|
2460
908
|
isSubmitSuccessful: !1,
|
|
@@ -2465,158 +913,163 @@ function cn(e = {}) {
|
|
|
2465
913
|
validatingFields: {},
|
|
2466
914
|
errors: e.errors || {},
|
|
2467
915
|
disabled: e.disabled || !1,
|
|
2468
|
-
defaultValues:
|
|
916
|
+
defaultValues: Z(e.defaultValues) ? void 0 : e.defaultValues
|
|
2469
917
|
});
|
|
2470
|
-
|
|
2471
|
-
...
|
|
918
|
+
s.current || (s.current = {
|
|
919
|
+
...Xt(e),
|
|
2472
920
|
formState: l
|
|
2473
921
|
});
|
|
2474
|
-
const
|
|
2475
|
-
return
|
|
2476
|
-
subject:
|
|
2477
|
-
next: (
|
|
2478
|
-
|
|
2479
|
-
}
|
|
2480
|
-
}),
|
|
2481
|
-
if (
|
|
2482
|
-
const
|
|
2483
|
-
|
|
2484
|
-
isDirty:
|
|
922
|
+
const a = s.current.control;
|
|
923
|
+
return a._options = e, It({
|
|
924
|
+
subject: a._subjects.state,
|
|
925
|
+
next: (y) => {
|
|
926
|
+
Ut(y, a._proxyFormState, a._updateFormState) && u({ ...a._formState });
|
|
927
|
+
}
|
|
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({
|
|
932
|
+
isDirty: y
|
|
2485
933
|
});
|
|
2486
934
|
}
|
|
2487
|
-
}, [
|
|
2488
|
-
e.values && !
|
|
2489
|
-
}, [e.values,
|
|
2490
|
-
e.errors &&
|
|
2491
|
-
}, [e.errors,
|
|
2492
|
-
|
|
2493
|
-
}),
|
|
2494
|
-
e.shouldUnregister &&
|
|
2495
|
-
values:
|
|
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()
|
|
2496
944
|
});
|
|
2497
|
-
}, [e.shouldUnregister,
|
|
945
|
+
}, [e.shouldUnregister, a]), s.current.formState = Nt(l, a), s.current;
|
|
2498
946
|
}
|
|
2499
|
-
const
|
|
947
|
+
const it = `Я принимаю условия Политики обработки
|
|
2500
948
|
и защиты персональных данных, даю согласия на обработку персональных
|
|
2501
|
-
данных`,
|
|
949
|
+
данных`, dr = ({
|
|
2502
950
|
isFormOpen: e,
|
|
2503
|
-
setIsFormOpen:
|
|
951
|
+
setIsFormOpen: s,
|
|
2504
952
|
title: r,
|
|
2505
953
|
subTitle: l,
|
|
2506
|
-
|
|
2507
|
-
|
|
954
|
+
submitHandler: u,
|
|
955
|
+
personalCheckBox: a = { text: it, isRequired: !0 },
|
|
956
|
+
advCheckBox: y = { text: it, isRequired: !0 }
|
|
2508
957
|
}) => {
|
|
2509
958
|
const {
|
|
2510
|
-
register:
|
|
2511
|
-
handleSubmit:
|
|
2512
|
-
trigger:
|
|
2513
|
-
reset:
|
|
2514
|
-
watch:
|
|
2515
|
-
formState: { errors:
|
|
2516
|
-
} =
|
|
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", {
|
|
2517
966
|
required: !0,
|
|
2518
|
-
pattern: { value:
|
|
2519
|
-
onBlur: () =>
|
|
2520
|
-
}),
|
|
2521
|
-
|
|
967
|
+
pattern: { value: wt, message: "" },
|
|
968
|
+
onBlur: () => M("phone")
|
|
969
|
+
}), $ = v("personalCheckBox"), j = v("advCheckBox"), m = (P) => {
|
|
970
|
+
u(P), F();
|
|
2522
971
|
};
|
|
2523
|
-
return /* @__PURE__ */
|
|
2524
|
-
|
|
972
|
+
return /* @__PURE__ */ W(
|
|
973
|
+
Vt,
|
|
2525
974
|
{
|
|
2526
975
|
isOpen: e,
|
|
2527
|
-
emitIsOpen: () =>
|
|
2528
|
-
additionalClass:
|
|
976
|
+
emitIsOpen: () => s(!1),
|
|
977
|
+
additionalClass: X.modal,
|
|
2529
978
|
opacity: 0.7,
|
|
2530
979
|
isTransparentBack: !0,
|
|
2531
|
-
additionalClassModalBody:
|
|
2532
|
-
children: /* @__PURE__ */
|
|
2533
|
-
/* @__PURE__ */
|
|
2534
|
-
/* @__PURE__ */
|
|
980
|
+
additionalClassModalBody: X.modalBody,
|
|
981
|
+
children: /* @__PURE__ */ Se("div", { className: X.root, children: [
|
|
982
|
+
/* @__PURE__ */ W("div", { className: X.title, dangerouslySetInnerHTML: { __html: r ?? "Оставить обращение" } }),
|
|
983
|
+
/* @__PURE__ */ W(
|
|
2535
984
|
"div",
|
|
2536
985
|
{
|
|
2537
|
-
className:
|
|
986
|
+
className: X.description,
|
|
2538
987
|
dangerouslySetInnerHTML: { __html: l ?? "Оставьте номер телефона для получения консультации" }
|
|
2539
988
|
}
|
|
2540
989
|
),
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2543
|
-
/* @__PURE__ */
|
|
2544
|
-
|
|
990
|
+
/* @__PURE__ */ Se("form", { onSubmit: R(m), children: [
|
|
991
|
+
/* @__PURE__ */ Se(Ft, { className: X.inputWrapper, children: [
|
|
992
|
+
/* @__PURE__ */ W(
|
|
993
|
+
je,
|
|
2545
994
|
{
|
|
2546
995
|
width: "full",
|
|
2547
996
|
size_s: "small",
|
|
2548
997
|
variant: "light",
|
|
2549
998
|
placeholder: "Введите имя",
|
|
2550
|
-
|
|
2551
|
-
|
|
999
|
+
"data-testid": "modal_name",
|
|
1000
|
+
...g("name", { required: !0, pattern: pt }),
|
|
1001
|
+
error: !!G.name
|
|
2552
1002
|
}
|
|
2553
1003
|
),
|
|
2554
|
-
/* @__PURE__ */
|
|
2555
|
-
|
|
1004
|
+
/* @__PURE__ */ W(
|
|
1005
|
+
xt,
|
|
2556
1006
|
{
|
|
2557
1007
|
inputMode: "numeric",
|
|
2558
1008
|
name: "phone",
|
|
2559
1009
|
mask: "+7 (999) 999-99-99",
|
|
2560
|
-
onChange:
|
|
1010
|
+
onChange: z,
|
|
2561
1011
|
placeholder: "+7 (- - -) - - - - - - -",
|
|
2562
|
-
onBlur:
|
|
2563
|
-
children: /* @__PURE__ */
|
|
2564
|
-
|
|
1012
|
+
onBlur: C,
|
|
1013
|
+
children: /* @__PURE__ */ W(
|
|
1014
|
+
je,
|
|
2565
1015
|
{
|
|
2566
1016
|
width: "full",
|
|
2567
1017
|
"data-testid": "phone_modal",
|
|
2568
1018
|
type: "tel",
|
|
2569
1019
|
size_s: "small",
|
|
2570
1020
|
variant: "light",
|
|
2571
|
-
...
|
|
2572
|
-
...
|
|
2573
|
-
error: !!
|
|
1021
|
+
...le,
|
|
1022
|
+
...g("phone"),
|
|
1023
|
+
error: !!G.phone
|
|
2574
1024
|
}
|
|
2575
1025
|
)
|
|
2576
1026
|
}
|
|
2577
1027
|
),
|
|
2578
|
-
|
|
2579
|
-
|
|
1028
|
+
y && /* @__PURE__ */ W(
|
|
1029
|
+
Ge,
|
|
2580
1030
|
{
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
1031
|
+
"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 })
|
|
2585
1036
|
}
|
|
2586
1037
|
),
|
|
2587
|
-
/* @__PURE__ */
|
|
2588
|
-
|
|
1038
|
+
/* @__PURE__ */ W(
|
|
1039
|
+
Ge,
|
|
2589
1040
|
{
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
1041
|
+
"data-testid": "modal_personalCheckBox",
|
|
1042
|
+
isChecked: $,
|
|
1043
|
+
error: !!G.personalCheckBox,
|
|
1044
|
+
text: a.text,
|
|
1045
|
+
...g("personalCheckBox", { required: a.isRequired })
|
|
2594
1046
|
}
|
|
2595
1047
|
),
|
|
2596
|
-
/* @__PURE__ */
|
|
2597
|
-
|
|
1048
|
+
/* @__PURE__ */ W(
|
|
1049
|
+
Ke,
|
|
2598
1050
|
{
|
|
1051
|
+
"data-testid": "modal_submit",
|
|
2599
1052
|
variant: "blue",
|
|
2600
1053
|
width: "full",
|
|
2601
1054
|
type: "submit",
|
|
2602
1055
|
size: "large",
|
|
2603
1056
|
as: "button",
|
|
2604
|
-
additionalClass:
|
|
1057
|
+
additionalClass: X.modalBtn,
|
|
2605
1058
|
children: "Отправить"
|
|
2606
1059
|
}
|
|
2607
1060
|
)
|
|
2608
1061
|
] }),
|
|
2609
|
-
/* @__PURE__ */
|
|
2610
|
-
|
|
1062
|
+
/* @__PURE__ */ W(
|
|
1063
|
+
Ke,
|
|
2611
1064
|
{
|
|
2612
|
-
additionalClass:
|
|
2613
|
-
onClick: () =>
|
|
1065
|
+
additionalClass: X.btn,
|
|
1066
|
+
onClick: () => s(!1),
|
|
2614
1067
|
as: "button",
|
|
2615
1068
|
variant: "gray",
|
|
2616
1069
|
type: "button",
|
|
2617
1070
|
size: "small",
|
|
2618
|
-
children: /* @__PURE__ */
|
|
2619
|
-
|
|
1071
|
+
children: /* @__PURE__ */ W(
|
|
1072
|
+
At,
|
|
2620
1073
|
{
|
|
2621
1074
|
name: "close",
|
|
2622
1075
|
size: "16",
|
|
@@ -2631,5 +1084,5 @@ const tr = `Я принимаю условия Политики обработк
|
|
|
2631
1084
|
);
|
|
2632
1085
|
};
|
|
2633
1086
|
export {
|
|
2634
|
-
|
|
1087
|
+
dr as ModalForm
|
|
2635
1088
|
};
|