stone-kit 0.0.737 → 0.0.738

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3336 +0,0 @@
1
- import { jsxs as pe, jsx as Z, Fragment as qt } from "react/jsx-runtime";
2
- import { NewIcon as Be } from "./components/NewIcon/ui/NewIcon.js";
3
- import { Modal as Ft } from "./components/Modal/ui/Modal.js";
4
- import Te, { forwardRef as Br, useState as je, useRef as mr, useEffect as Tt } from "react";
5
- import { Text as pr } from "./components/Text/ui/Text.js";
6
- import { c as Vt, g as yr } from "./index-rKuIKazb.js";
7
- import { Button as qe } from "./components/Button/ui/Button.js";
8
- import "./components/mobileButton/ui/MobileButton.js";
9
- import "./components/DestinationTab/ui/DestinationTab.js";
10
- import "./components/RoundButton/ui/RoundButton.js";
11
- import "./components/Tag/ui/Tag.js";
12
- import "./components/Switcher/ui/Switcher.js";
13
- import { Flex as Wr } from "./components/Flex/ui/Flex.js";
14
- import { Input as pt } from "./components/Input/ui/Input.js";
15
- import gr from "react-dom";
16
- import "./components/GroupedInput/ui/GroupedInputs.js";
17
- import "./components/MetroTag/ui/MetroTag.js";
18
- import "./components/LotCard/ui/LotCard.js";
19
- import "./components/Select/ui/Select.js";
20
- import { useClientWidth as ft } from "./shared/useClientWidth.js";
21
- import { s as we, u as zr } from "./useSortSelect-CjZXLFOG.js";
22
- import "./components/SliderNavigation/ui/SliderNavigation.js";
23
- import "./components/LotCardSkeleton/ui/LotCardSkeleton.js";
24
- import "./components/TabSelect/ui/TabSelect.js";
25
- import { phoneReg as jr, nameReg as qr, emailReg as $r } from "./components/FormModal/utils/reg.js";
26
- import { CheckBox as $t } from "./components/CheckBox/CheckBox.js";
27
- import { TextArea as Ur } from "./components/TextArea/TextArea.js";
28
- import { O as Ut } from "./Option-BVIm7wOW.js";
29
- import "./components/CheckboxSelect/ui/CheckboxSelect.js";
30
- const Yr = "_root_1975y_1", Hr = "_text_1975y_18", Xr = "_textMini_1975y_26", Jr = "_rootCol_1975y_32", Zr = "_item_1975y_38", Gr = "_whiteRow_1975y_57", Kr = "_firstItem_1975y_68", Qr = "_lastItem_1975y_72", en = "_whiteRowGrayLabel_1975y_103", tn = "_apart_1975y_141", rn = "_isLong_1975y_141", nn = "_autoWidth_1975y_166", an = "_mini_1975y_170", sn = "_isDisabled_1975y_178", on = "_grayRow_1975y_202", _e = {
31
- root: Yr,
32
- text: Hr,
33
- textMini: Xr,
34
- rootCol: Jr,
35
- item: Zr,
36
- whiteRow: Gr,
37
- firstItem: Kr,
38
- lastItem: Qr,
39
- whiteRowGrayLabel: en,
40
- apart: tn,
41
- isLong: rn,
42
- autoWidth: nn,
43
- mini: an,
44
- isDisabled: sn,
45
- grayRow: on,
46
- "tiny-size": "_tiny-size_1975y_230",
47
- "small-size": "_small-size_1975y_235",
48
- "medium-size": "_medium-size_1975y_240",
49
- "large-size": "_large-size_1975y_245",
50
- "text-tiny-size": "_text-tiny-size_1975y_250",
51
- "text-small-size": "_text-small-size_1975y_256",
52
- "text-medium-size": "_text-medium-size_1975y_261",
53
- "text-large-size": "_text-large-size_1975y_266",
54
- "small-size_m": "_small-size_m_1975y_272",
55
- "medium-size_m": "_medium-size_m_1975y_276",
56
- "large-size_m": "_large-size_m_1975y_280",
57
- "text-small-size_m": "_text-small-size_m_1975y_284",
58
- "text-medium-size_m": "_text-medium-size_m_1975y_288",
59
- "text-large-size_m": "_text-large-size_m_1975y_292",
60
- "small-size_l": "_small-size_l_1975y_307",
61
- "medium-size_l": "_medium-size_l_1975y_311",
62
- "large-size_l": "_large-size_l_1975y_315",
63
- "text-small-size_l": "_text-small-size_l_1975y_319",
64
- "text-medium-size_l": "_text-medium-size_l_1975y_323",
65
- "text-large-size_l": "_text-large-size_l_1975y_327"
66
- }, Je = Vt.bind(_e), ln = ({
67
- children: e,
68
- variant: r = "whiteRow",
69
- isApart: t = !1,
70
- addClassName: o = "",
71
- col: c = !1
72
- }) => /* @__PURE__ */ Z("div", { className: Je(_e.root, _e[r], { [_e.rootCol]: c, [_e.apart]: t }, o), children: e }), _r = Br((e, r) => {
73
- const { isTablet: t, isDesktop: o } = ft(), {
74
- index: c,
75
- children: i,
76
- addItemClassName: _,
77
- addLabelClassname: E,
78
- addTextClass: W,
79
- size_s: I = "large",
80
- size_m: R,
81
- size_l: C,
82
- disabled: te = !1,
83
- itemsLength: Q = 0,
84
- isLongOn: re = !0,
85
- width: K,
86
- width_m: G,
87
- width_l: ie,
88
- mini: Y = !1,
89
- ...ne
90
- } = e, ee = (i != null && i.toString().length ? (i == null ? void 0 : i.toString().length) > 2 : !1) && re, a = (d, p) => d && G ? G : p && ie ? ie : K, b = !K && !G && !ie && ee;
91
- return /* @__PURE__ */ pe("label", { className: Je(E, { [_e.isLong]: ee }), children: [
92
- /* @__PURE__ */ Z(
93
- "input",
94
- {
95
- ref: r,
96
- type: "checkbox",
97
- ...ne,
98
- disabled: te
99
- }
100
- ),
101
- /* @__PURE__ */ Z(
102
- "div",
103
- {
104
- style: { width: a(t, o) },
105
- className: Je(
106
- Je(
107
- _e.item,
108
- { [_e.firstItem]: c === 0 },
109
- { [_e.lastItem]: c === Q - 1 },
110
- { [_e.isDisabled]: te },
111
- { [_e.autoWidth]: b },
112
- _e[`${I}-size`],
113
- _e[`${R}-size_m`],
114
- _e[`${C}-size_l`],
115
- { [_e.mini]: Y }
116
- ),
117
- _
118
- ),
119
- children: /* @__PURE__ */ Z(
120
- pr,
121
- {
122
- className: Je(
123
- _e.text,
124
- _e[`text-${I}-size`],
125
- _e[`text-${R}-size_m`],
126
- _e[`text-${C}-size_l`],
127
- { [_e.textMini]: Y },
128
- W
129
- ),
130
- children: i
131
- }
132
- )
133
- }
134
- )
135
- ] });
136
- });
137
- _r.displayName = "TabSwitcherItem";
138
- const et = Object.assign(ln, { Item: _r }), tt = Vt.bind(we), un = ({
139
- options: e,
140
- selectedOption: r,
141
- placeholder: t = "",
142
- error: o,
143
- disabled: c,
144
- additionalClass: i = "",
145
- onChange: _,
146
- onBlur: E,
147
- mini: W,
148
- openOnTop: I = !1,
149
- onClickItem: R,
150
- onCLickSelect: C
151
- }) => {
152
- const [te, Q] = je(!1), re = mr(null), { isMobile: K } = ft(), { handleBlur: G, getInputValue: ie, getOption: Y, handleDocumentClick: ne } = zr(
153
- {
154
- selectedOption: r,
155
- onClickOption: R,
156
- setSelectedOption: _,
157
- setIsOpen: Q,
158
- containerRef: re,
159
- isOpen: te,
160
- isMobile: K,
161
- placeholder: t,
162
- onChange: _,
163
- onBlur: E
164
- }
165
- );
166
- return Tt(() => (document.addEventListener("click", ne), () => {
167
- document.removeEventListener("click", ne);
168
- }), []), /* @__PURE__ */ pe(
169
- "div",
170
- {
171
- ref: re,
172
- className: tt(
173
- we.sortSelectWrapper,
174
- { [we.sortSelectWrapperError]: o },
175
- { [we.sortSelectWrapperTop]: I },
176
- i
177
- ),
178
- tabIndex: 0,
179
- onBlur: G,
180
- onClick: () => {
181
- C && C();
182
- },
183
- children: [
184
- /* @__PURE__ */ pe("div", { className: tt(we.inputWrapper), children: [
185
- /* @__PURE__ */ Z(
186
- "input",
187
- {
188
- type: "text",
189
- readOnly: !0,
190
- value: ie(),
191
- className: tt(
192
- we.selectedOptions,
193
- { [we.selectOptionsDisabled]: c },
194
- { [we.selectionOptionMini]: W }
195
- ),
196
- onClick: () => Q(!te)
197
- }
198
- ),
199
- /* @__PURE__ */ Z(
200
- Be,
201
- {
202
- name: "twoArrows",
203
- size: "24",
204
- additionalClass: we.icon
205
- }
206
- )
207
- ] }),
208
- te && K && /* @__PURE__ */ pe(
209
- Ft,
210
- {
211
- isOpen: te,
212
- emitIsOpen: Q,
213
- additionalClassModalBody: we.modalAddBody,
214
- additionalClass: we.selectModal,
215
- createPortalObj: { domNode: document.querySelector("body") },
216
- isTransparentBack: !0,
217
- children: [
218
- /* @__PURE__ */ pe("div", { className: we.mobileSortHeader, children: [
219
- /* @__PURE__ */ Z(pr, { children: "Сортировка" }),
220
- /* @__PURE__ */ Z("div", { onClick: () => Q(!1), children: /* @__PURE__ */ Z(
221
- Be,
222
- {
223
- name: "close",
224
- size: "20"
225
- }
226
- ) })
227
- ] }),
228
- /* @__PURE__ */ Z("div", { className: we.mobileOptionList, children: e == null ? void 0 : e.map((ee) => Y(ee)) })
229
- ]
230
- }
231
- ),
232
- te && !K && /* @__PURE__ */ Z("div", { className: tt(we.optionsList, { [we.optionListOnTop]: I }), children: e == null ? void 0 : e.map((ee) => Y(ee)) })
233
- ]
234
- }
235
- );
236
- };
237
- un.displayName = "SortSelect";
238
- var Rt = { exports: {} }, yt = { exports: {} }, rt = { exports: {} }, nt = { exports: {} }, le = {};
239
- /** @license React v16.13.1
240
- * react-is.production.min.js
241
- *
242
- * Copyright (c) Facebook, Inc. and its affiliates.
243
- *
244
- * This source code is licensed under the MIT license found in the
245
- * LICENSE file in the root directory of this source tree.
246
- */
247
- var Yt;
248
- function cn() {
249
- if (Yt)
250
- return le;
251
- Yt = 1;
252
- var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, o = e ? Symbol.for("react.fragment") : 60107, c = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, _ = e ? Symbol.for("react.provider") : 60109, E = e ? Symbol.for("react.context") : 60110, W = e ? Symbol.for("react.async_mode") : 60111, I = e ? Symbol.for("react.concurrent_mode") : 60111, R = e ? Symbol.for("react.forward_ref") : 60112, C = e ? Symbol.for("react.suspense") : 60113, te = e ? Symbol.for("react.suspense_list") : 60120, Q = e ? Symbol.for("react.memo") : 60115, re = e ? Symbol.for("react.lazy") : 60116, K = e ? Symbol.for("react.block") : 60121, G = e ? Symbol.for("react.fundamental") : 60117, ie = e ? Symbol.for("react.responder") : 60118, Y = e ? Symbol.for("react.scope") : 60119;
253
- function ne(a) {
254
- if (typeof a == "object" && a !== null) {
255
- var b = a.$$typeof;
256
- switch (b) {
257
- case r:
258
- switch (a = a.type, a) {
259
- case W:
260
- case I:
261
- case o:
262
- case i:
263
- case c:
264
- case C:
265
- return a;
266
- default:
267
- switch (a = a && a.$$typeof, a) {
268
- case E:
269
- case R:
270
- case re:
271
- case Q:
272
- case _:
273
- return a;
274
- default:
275
- return b;
276
- }
277
- }
278
- case t:
279
- return b;
280
- }
281
- }
282
- }
283
- function ee(a) {
284
- return ne(a) === I;
285
- }
286
- return le.AsyncMode = W, le.ConcurrentMode = I, le.ContextConsumer = E, le.ContextProvider = _, le.Element = r, le.ForwardRef = R, le.Fragment = o, le.Lazy = re, le.Memo = Q, le.Portal = t, le.Profiler = i, le.StrictMode = c, le.Suspense = C, le.isAsyncMode = function(a) {
287
- return ee(a) || ne(a) === W;
288
- }, le.isConcurrentMode = ee, le.isContextConsumer = function(a) {
289
- return ne(a) === E;
290
- }, le.isContextProvider = function(a) {
291
- return ne(a) === _;
292
- }, le.isElement = function(a) {
293
- return typeof a == "object" && a !== null && a.$$typeof === r;
294
- }, le.isForwardRef = function(a) {
295
- return ne(a) === R;
296
- }, le.isFragment = function(a) {
297
- return ne(a) === o;
298
- }, le.isLazy = function(a) {
299
- return ne(a) === re;
300
- }, le.isMemo = function(a) {
301
- return ne(a) === Q;
302
- }, le.isPortal = function(a) {
303
- return ne(a) === t;
304
- }, le.isProfiler = function(a) {
305
- return ne(a) === i;
306
- }, le.isStrictMode = function(a) {
307
- return ne(a) === c;
308
- }, le.isSuspense = function(a) {
309
- return ne(a) === C;
310
- }, le.isValidElementType = function(a) {
311
- return typeof a == "string" || typeof a == "function" || a === o || a === I || a === i || a === c || a === C || a === te || typeof a == "object" && a !== null && (a.$$typeof === re || a.$$typeof === Q || a.$$typeof === _ || a.$$typeof === E || a.$$typeof === R || a.$$typeof === G || a.$$typeof === ie || a.$$typeof === Y || a.$$typeof === K);
312
- }, le.typeOf = ne, le;
313
- }
314
- var ue = {};
315
- /** @license React v16.13.1
316
- * react-is.development.js
317
- *
318
- * Copyright (c) Facebook, Inc. and its affiliates.
319
- *
320
- * This source code is licensed under the MIT license found in the
321
- * LICENSE file in the root directory of this source tree.
322
- */
323
- var Ht;
324
- function fn() {
325
- return Ht || (Ht = 1, process.env.NODE_ENV !== "production" && function() {
326
- var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, o = e ? Symbol.for("react.fragment") : 60107, c = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, _ = e ? Symbol.for("react.provider") : 60109, E = e ? Symbol.for("react.context") : 60110, W = e ? Symbol.for("react.async_mode") : 60111, I = e ? Symbol.for("react.concurrent_mode") : 60111, R = e ? Symbol.for("react.forward_ref") : 60112, C = e ? Symbol.for("react.suspense") : 60113, te = e ? Symbol.for("react.suspense_list") : 60120, Q = e ? Symbol.for("react.memo") : 60115, re = e ? Symbol.for("react.lazy") : 60116, K = e ? Symbol.for("react.block") : 60121, G = e ? Symbol.for("react.fundamental") : 60117, ie = e ? Symbol.for("react.responder") : 60118, Y = e ? Symbol.for("react.scope") : 60119;
327
- function ne(m) {
328
- return typeof m == "string" || typeof m == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
329
- m === o || m === I || m === i || m === c || m === C || m === te || typeof m == "object" && m !== null && (m.$$typeof === re || m.$$typeof === Q || m.$$typeof === _ || m.$$typeof === E || m.$$typeof === R || m.$$typeof === G || m.$$typeof === ie || m.$$typeof === Y || m.$$typeof === K);
330
- }
331
- function ee(m) {
332
- if (typeof m == "object" && m !== null) {
333
- var B = m.$$typeof;
334
- switch (B) {
335
- case r:
336
- var q = m.type;
337
- switch (q) {
338
- case W:
339
- case I:
340
- case o:
341
- case i:
342
- case c:
343
- case C:
344
- return q;
345
- default:
346
- var U = q && q.$$typeof;
347
- switch (U) {
348
- case E:
349
- case R:
350
- case re:
351
- case Q:
352
- case _:
353
- return U;
354
- default:
355
- return B;
356
- }
357
- }
358
- case t:
359
- return B;
360
- }
361
- }
362
- }
363
- var a = W, b = I, d = E, p = _, S = r, P = R, N = o, A = re, j = Q, H = t, L = i, F = c, X = C, ae = !1;
364
- function fe(m) {
365
- return ae || (ae = !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.")), y(m) || ee(m) === W;
366
- }
367
- function y(m) {
368
- return ee(m) === I;
369
- }
370
- function x(m) {
371
- return ee(m) === E;
372
- }
373
- function h(m) {
374
- return ee(m) === _;
375
- }
376
- function u(m) {
377
- return typeof m == "object" && m !== null && m.$$typeof === r;
378
- }
379
- function s(m) {
380
- return ee(m) === R;
381
- }
382
- function f(m) {
383
- return ee(m) === o;
384
- }
385
- function g(m) {
386
- return ee(m) === re;
387
- }
388
- function k(m) {
389
- return ee(m) === Q;
390
- }
391
- function D(m) {
392
- return ee(m) === t;
393
- }
394
- function T(m) {
395
- return ee(m) === i;
396
- }
397
- function V(m) {
398
- return ee(m) === c;
399
- }
400
- function J(m) {
401
- return ee(m) === C;
402
- }
403
- ue.AsyncMode = a, ue.ConcurrentMode = b, ue.ContextConsumer = d, ue.ContextProvider = p, ue.Element = S, ue.ForwardRef = P, ue.Fragment = N, ue.Lazy = A, ue.Memo = j, ue.Portal = H, ue.Profiler = L, ue.StrictMode = F, ue.Suspense = X, ue.isAsyncMode = fe, ue.isConcurrentMode = y, ue.isContextConsumer = x, ue.isContextProvider = h, ue.isElement = u, ue.isForwardRef = s, ue.isFragment = f, ue.isLazy = g, ue.isMemo = k, ue.isPortal = D, ue.isProfiler = T, ue.isStrictMode = V, ue.isSuspense = J, ue.isValidElementType = ne, ue.typeOf = ee;
404
- }()), ue;
405
- }
406
- var Xt;
407
- function br() {
408
- return Xt || (Xt = 1, process.env.NODE_ENV === "production" ? nt.exports = cn() : nt.exports = fn()), nt.exports;
409
- }
410
- /*
411
- object-assign
412
- (c) Sindre Sorhus
413
- @license MIT
414
- */
415
- var gt, Jt;
416
- function dn() {
417
- if (Jt)
418
- return gt;
419
- Jt = 1;
420
- var e = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
421
- function o(i) {
422
- if (i == null)
423
- throw new TypeError("Object.assign cannot be called with null or undefined");
424
- return Object(i);
425
- }
426
- function c() {
427
- try {
428
- if (!Object.assign)
429
- return !1;
430
- var i = new String("abc");
431
- if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
432
- return !1;
433
- for (var _ = {}, E = 0; E < 10; E++)
434
- _["_" + String.fromCharCode(E)] = E;
435
- var W = Object.getOwnPropertyNames(_).map(function(R) {
436
- return _[R];
437
- });
438
- if (W.join("") !== "0123456789")
439
- return !1;
440
- var I = {};
441
- return "abcdefghijklmnopqrst".split("").forEach(function(R) {
442
- I[R] = R;
443
- }), Object.keys(Object.assign({}, I)).join("") === "abcdefghijklmnopqrst";
444
- } catch {
445
- return !1;
446
- }
447
- }
448
- return gt = c() ? Object.assign : function(i, _) {
449
- for (var E, W = o(i), I, R = 1; R < arguments.length; R++) {
450
- E = Object(arguments[R]);
451
- for (var C in E)
452
- r.call(E, C) && (W[C] = E[C]);
453
- if (e) {
454
- I = e(E);
455
- for (var te = 0; te < I.length; te++)
456
- t.call(E, I[te]) && (W[I[te]] = E[I[te]]);
457
- }
458
- }
459
- return W;
460
- }, gt;
461
- }
462
- var _t, Zt;
463
- function Mt() {
464
- if (Zt)
465
- return _t;
466
- Zt = 1;
467
- var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
468
- return _t = e, _t;
469
- }
470
- var bt, Gt;
471
- function kr() {
472
- return Gt || (Gt = 1, bt = Function.call.bind(Object.prototype.hasOwnProperty)), bt;
473
- }
474
- var kt, Kt;
475
- function vn() {
476
- if (Kt)
477
- return kt;
478
- Kt = 1;
479
- var e = function() {
480
- };
481
- if (process.env.NODE_ENV !== "production") {
482
- var r = Mt(), t = {}, o = kr();
483
- e = function(i) {
484
- var _ = "Warning: " + i;
485
- typeof console < "u" && console.error(_);
486
- try {
487
- throw new Error(_);
488
- } catch {
489
- }
490
- };
491
- }
492
- function c(i, _, E, W, I) {
493
- if (process.env.NODE_ENV !== "production") {
494
- for (var R in i)
495
- if (o(i, R)) {
496
- var C;
497
- try {
498
- if (typeof i[R] != "function") {
499
- var te = Error(
500
- (W || "React class") + ": " + E + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
501
- );
502
- throw te.name = "Invariant Violation", te;
503
- }
504
- C = i[R](_, R, W, E, null, r);
505
- } catch (re) {
506
- C = re;
507
- }
508
- if (C && !(C instanceof Error) && e(
509
- (W || "React class") + ": type specification of " + E + " `" + R + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof C + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
510
- ), C instanceof Error && !(C.message in t)) {
511
- t[C.message] = !0;
512
- var Q = I ? I() : "";
513
- e(
514
- "Failed " + E + " type: " + C.message + (Q ?? "")
515
- );
516
- }
517
- }
518
- }
519
- }
520
- return c.resetWarningCache = function() {
521
- process.env.NODE_ENV !== "production" && (t = {});
522
- }, kt = c, kt;
523
- }
524
- var Et, Qt;
525
- function hn() {
526
- if (Qt)
527
- return Et;
528
- Qt = 1;
529
- var e = br(), r = dn(), t = Mt(), o = kr(), c = vn(), i = function() {
530
- };
531
- process.env.NODE_ENV !== "production" && (i = function(E) {
532
- var W = "Warning: " + E;
533
- typeof console < "u" && console.error(W);
534
- try {
535
- throw new Error(W);
536
- } catch {
537
- }
538
- });
539
- function _() {
540
- return null;
541
- }
542
- return Et = function(E, W) {
543
- var I = typeof Symbol == "function" && Symbol.iterator, R = "@@iterator";
544
- function C(y) {
545
- var x = y && (I && y[I] || y[R]);
546
- if (typeof x == "function")
547
- return x;
548
- }
549
- var te = "<<anonymous>>", Q = {
550
- array: ie("array"),
551
- bigint: ie("bigint"),
552
- bool: ie("boolean"),
553
- func: ie("function"),
554
- number: ie("number"),
555
- object: ie("object"),
556
- string: ie("string"),
557
- symbol: ie("symbol"),
558
- any: Y(),
559
- arrayOf: ne,
560
- element: ee(),
561
- elementType: a(),
562
- instanceOf: b,
563
- node: P(),
564
- objectOf: p,
565
- oneOf: d,
566
- oneOfType: S,
567
- shape: A,
568
- exact: j
569
- };
570
- function re(y, x) {
571
- return y === x ? y !== 0 || 1 / y === 1 / x : y !== y && x !== x;
572
- }
573
- function K(y, x) {
574
- this.message = y, this.data = x && typeof x == "object" ? x : {}, this.stack = "";
575
- }
576
- K.prototype = Error.prototype;
577
- function G(y) {
578
- if (process.env.NODE_ENV !== "production")
579
- var x = {}, h = 0;
580
- function u(f, g, k, D, T, V, J) {
581
- if (D = D || te, V = V || k, J !== t) {
582
- if (W) {
583
- var m = new Error(
584
- "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"
585
- );
586
- throw m.name = "Invariant Violation", m;
587
- } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
588
- var B = D + ":" + k;
589
- !x[B] && // Avoid spamming the console because they are often not actionable except for lib authors
590
- h < 3 && (i(
591
- "You are manually calling a React.PropTypes validation function for the `" + V + "` 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."
592
- ), x[B] = !0, h++);
593
- }
594
- }
595
- return g[k] == null ? f ? g[k] === null ? new K("The " + T + " `" + V + "` is marked as required " + ("in `" + D + "`, but its value is `null`.")) : new K("The " + T + " `" + V + "` is marked as required in " + ("`" + D + "`, but its value is `undefined`.")) : null : y(g, k, D, T, V);
596
- }
597
- var s = u.bind(null, !1);
598
- return s.isRequired = u.bind(null, !0), s;
599
- }
600
- function ie(y) {
601
- function x(h, u, s, f, g, k) {
602
- var D = h[u], T = F(D);
603
- if (T !== y) {
604
- var V = X(D);
605
- return new K(
606
- "Invalid " + f + " `" + g + "` of type " + ("`" + V + "` supplied to `" + s + "`, expected ") + ("`" + y + "`."),
607
- { expectedType: y }
608
- );
609
- }
610
- return null;
611
- }
612
- return G(x);
613
- }
614
- function Y() {
615
- return G(_);
616
- }
617
- function ne(y) {
618
- function x(h, u, s, f, g) {
619
- if (typeof y != "function")
620
- return new K("Property `" + g + "` of component `" + s + "` has invalid PropType notation inside arrayOf.");
621
- var k = h[u];
622
- if (!Array.isArray(k)) {
623
- var D = F(k);
624
- return new K("Invalid " + f + " `" + g + "` of type " + ("`" + D + "` supplied to `" + s + "`, expected an array."));
625
- }
626
- for (var T = 0; T < k.length; T++) {
627
- var V = y(k, T, s, f, g + "[" + T + "]", t);
628
- if (V instanceof Error)
629
- return V;
630
- }
631
- return null;
632
- }
633
- return G(x);
634
- }
635
- function ee() {
636
- function y(x, h, u, s, f) {
637
- var g = x[h];
638
- if (!E(g)) {
639
- var k = F(g);
640
- return new K("Invalid " + s + " `" + f + "` of type " + ("`" + k + "` supplied to `" + u + "`, expected a single ReactElement."));
641
- }
642
- return null;
643
- }
644
- return G(y);
645
- }
646
- function a() {
647
- function y(x, h, u, s, f) {
648
- var g = x[h];
649
- if (!e.isValidElementType(g)) {
650
- var k = F(g);
651
- return new K("Invalid " + s + " `" + f + "` of type " + ("`" + k + "` supplied to `" + u + "`, expected a single ReactElement type."));
652
- }
653
- return null;
654
- }
655
- return G(y);
656
- }
657
- function b(y) {
658
- function x(h, u, s, f, g) {
659
- if (!(h[u] instanceof y)) {
660
- var k = y.name || te, D = fe(h[u]);
661
- return new K("Invalid " + f + " `" + g + "` of type " + ("`" + D + "` supplied to `" + s + "`, expected ") + ("instance of `" + k + "`."));
662
- }
663
- return null;
664
- }
665
- return G(x);
666
- }
667
- function d(y) {
668
- if (!Array.isArray(y))
669
- return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
670
- "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])."
671
- ) : i("Invalid argument supplied to oneOf, expected an array.")), _;
672
- function x(h, u, s, f, g) {
673
- for (var k = h[u], D = 0; D < y.length; D++)
674
- if (re(k, y[D]))
675
- return null;
676
- var T = JSON.stringify(y, function(J, m) {
677
- var B = X(m);
678
- return B === "symbol" ? String(m) : m;
679
- });
680
- return new K("Invalid " + f + " `" + g + "` of value `" + String(k) + "` " + ("supplied to `" + s + "`, expected one of " + T + "."));
681
- }
682
- return G(x);
683
- }
684
- function p(y) {
685
- function x(h, u, s, f, g) {
686
- if (typeof y != "function")
687
- return new K("Property `" + g + "` of component `" + s + "` has invalid PropType notation inside objectOf.");
688
- var k = h[u], D = F(k);
689
- if (D !== "object")
690
- return new K("Invalid " + f + " `" + g + "` of type " + ("`" + D + "` supplied to `" + s + "`, expected an object."));
691
- for (var T in k)
692
- if (o(k, T)) {
693
- var V = y(k, T, s, f, g + "." + T, t);
694
- if (V instanceof Error)
695
- return V;
696
- }
697
- return null;
698
- }
699
- return G(x);
700
- }
701
- function S(y) {
702
- if (!Array.isArray(y))
703
- return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), _;
704
- for (var x = 0; x < y.length; x++) {
705
- var h = y[x];
706
- if (typeof h != "function")
707
- return i(
708
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ae(h) + " at index " + x + "."
709
- ), _;
710
- }
711
- function u(s, f, g, k, D) {
712
- for (var T = [], V = 0; V < y.length; V++) {
713
- var J = y[V], m = J(s, f, g, k, D, t);
714
- if (m == null)
715
- return null;
716
- m.data && o(m.data, "expectedType") && T.push(m.data.expectedType);
717
- }
718
- var B = T.length > 0 ? ", expected one of type [" + T.join(", ") + "]" : "";
719
- return new K("Invalid " + k + " `" + D + "` supplied to " + ("`" + g + "`" + B + "."));
720
- }
721
- return G(u);
722
- }
723
- function P() {
724
- function y(x, h, u, s, f) {
725
- return H(x[h]) ? null : new K("Invalid " + s + " `" + f + "` supplied to " + ("`" + u + "`, expected a ReactNode."));
726
- }
727
- return G(y);
728
- }
729
- function N(y, x, h, u, s) {
730
- return new K(
731
- (y || "React class") + ": " + x + " type `" + h + "." + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + s + "`."
732
- );
733
- }
734
- function A(y) {
735
- function x(h, u, s, f, g) {
736
- var k = h[u], D = F(k);
737
- if (D !== "object")
738
- return new K("Invalid " + f + " `" + g + "` of type `" + D + "` " + ("supplied to `" + s + "`, expected `object`."));
739
- for (var T in y) {
740
- var V = y[T];
741
- if (typeof V != "function")
742
- return N(s, f, g, T, X(V));
743
- var J = V(k, T, s, f, g + "." + T, t);
744
- if (J)
745
- return J;
746
- }
747
- return null;
748
- }
749
- return G(x);
750
- }
751
- function j(y) {
752
- function x(h, u, s, f, g) {
753
- var k = h[u], D = F(k);
754
- if (D !== "object")
755
- return new K("Invalid " + f + " `" + g + "` of type `" + D + "` " + ("supplied to `" + s + "`, expected `object`."));
756
- var T = r({}, h[u], y);
757
- for (var V in T) {
758
- var J = y[V];
759
- if (o(y, V) && typeof J != "function")
760
- return N(s, f, g, V, X(J));
761
- if (!J)
762
- return new K(
763
- "Invalid " + f + " `" + g + "` key `" + V + "` supplied to `" + s + "`.\nBad object: " + JSON.stringify(h[u], null, " ") + `
764
- Valid keys: ` + JSON.stringify(Object.keys(y), null, " ")
765
- );
766
- var m = J(k, V, s, f, g + "." + V, t);
767
- if (m)
768
- return m;
769
- }
770
- return null;
771
- }
772
- return G(x);
773
- }
774
- function H(y) {
775
- switch (typeof y) {
776
- case "number":
777
- case "string":
778
- case "undefined":
779
- return !0;
780
- case "boolean":
781
- return !y;
782
- case "object":
783
- if (Array.isArray(y))
784
- return y.every(H);
785
- if (y === null || E(y))
786
- return !0;
787
- var x = C(y);
788
- if (x) {
789
- var h = x.call(y), u;
790
- if (x !== y.entries) {
791
- for (; !(u = h.next()).done; )
792
- if (!H(u.value))
793
- return !1;
794
- } else
795
- for (; !(u = h.next()).done; ) {
796
- var s = u.value;
797
- if (s && !H(s[1]))
798
- return !1;
799
- }
800
- } else
801
- return !1;
802
- return !0;
803
- default:
804
- return !1;
805
- }
806
- }
807
- function L(y, x) {
808
- return y === "symbol" ? !0 : x ? x["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && x instanceof Symbol : !1;
809
- }
810
- function F(y) {
811
- var x = typeof y;
812
- return Array.isArray(y) ? "array" : y instanceof RegExp ? "object" : L(x, y) ? "symbol" : x;
813
- }
814
- function X(y) {
815
- if (typeof y > "u" || y === null)
816
- return "" + y;
817
- var x = F(y);
818
- if (x === "object") {
819
- if (y instanceof Date)
820
- return "date";
821
- if (y instanceof RegExp)
822
- return "regexp";
823
- }
824
- return x;
825
- }
826
- function ae(y) {
827
- var x = X(y);
828
- switch (x) {
829
- case "array":
830
- case "object":
831
- return "an " + x;
832
- case "boolean":
833
- case "date":
834
- case "regexp":
835
- return "a " + x;
836
- default:
837
- return x;
838
- }
839
- }
840
- function fe(y) {
841
- return !y.constructor || !y.constructor.name ? te : y.constructor.name;
842
- }
843
- return Q.checkPropTypes = c, Q.resetWarningCache = c.resetWarningCache, Q.PropTypes = Q, Q;
844
- }, Et;
845
- }
846
- var St, er;
847
- function mn() {
848
- if (er)
849
- return St;
850
- er = 1;
851
- var e = Mt();
852
- function r() {
853
- }
854
- function t() {
855
- }
856
- return t.resetWarningCache = r, St = function() {
857
- function o(_, E, W, I, R, C) {
858
- if (C !== e) {
859
- var te = new Error(
860
- "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"
861
- );
862
- throw te.name = "Invariant Violation", te;
863
- }
864
- }
865
- o.isRequired = o;
866
- function c() {
867
- return o;
868
- }
869
- var i = {
870
- array: o,
871
- bigint: o,
872
- bool: o,
873
- func: o,
874
- number: o,
875
- object: o,
876
- string: o,
877
- symbol: o,
878
- any: o,
879
- arrayOf: c,
880
- element: o,
881
- elementType: o,
882
- instanceOf: c,
883
- node: o,
884
- objectOf: c,
885
- oneOf: c,
886
- oneOfType: c,
887
- shape: c,
888
- exact: c,
889
- checkPropTypes: t,
890
- resetWarningCache: r
891
- };
892
- return i.PropTypes = i, i;
893
- }, St;
894
- }
895
- var tr;
896
- function Er() {
897
- if (tr)
898
- return rt.exports;
899
- if (tr = 1, process.env.NODE_ENV !== "production") {
900
- var e = br(), r = !0;
901
- rt.exports = hn()(e.isElement, r);
902
- } else
903
- rt.exports = mn()();
904
- return rt.exports;
905
- }
906
- var xt, rr;
907
- function Sr() {
908
- if (rr)
909
- return xt;
910
- rr = 1;
911
- var e = function(r, t, o, c, i, _, E, W) {
912
- if (process.env.NODE_ENV !== "production" && t === void 0)
913
- throw new Error("invariant requires an error message argument");
914
- if (!r) {
915
- var I;
916
- if (t === void 0)
917
- I = new Error(
918
- "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
919
- );
920
- else {
921
- var R = [o, c, i, _, E, W], C = 0;
922
- I = new Error(
923
- t.replace(/%s/g, function() {
924
- return R[C++];
925
- })
926
- ), I.name = "Invariant Violation";
927
- }
928
- throw I.framesToPop = 1, I;
929
- }
930
- };
931
- return xt = e, xt;
932
- }
933
- var Pt, nr;
934
- function xr() {
935
- if (nr)
936
- return Pt;
937
- nr = 1;
938
- var e = process.env.NODE_ENV !== "production", r = function() {
939
- };
940
- if (e) {
941
- var t = function(c, i) {
942
- var _ = arguments.length;
943
- i = new Array(_ > 1 ? _ - 1 : 0);
944
- for (var E = 1; E < _; E++)
945
- i[E - 1] = arguments[E];
946
- var W = 0, I = "Warning: " + c.replace(/%s/g, function() {
947
- return i[W++];
948
- });
949
- typeof console < "u" && console.error(I);
950
- try {
951
- throw new Error(I);
952
- } catch {
953
- }
954
- };
955
- r = function(o, c, i) {
956
- var _ = arguments.length;
957
- i = new Array(_ > 2 ? _ - 2 : 0);
958
- for (var E = 2; E < _; E++)
959
- i[E - 2] = arguments[E];
960
- if (c === void 0)
961
- throw new Error(
962
- "`warning(condition, format, ...args)` requires a warning message argument"
963
- );
964
- o || t.apply(null, [c].concat(i));
965
- };
966
- }
967
- return Pt = r, Pt;
968
- }
969
- var ir;
970
- function pn() {
971
- if (ir)
972
- return yt.exports;
973
- ir = 1;
974
- function e(a) {
975
- return a && typeof a == "object" && "default" in a ? a.default : a;
976
- }
977
- var r = Te, t = e(r), o = gr;
978
- Er();
979
- var c = e(Sr());
980
- function i() {
981
- return (i = Object.assign || function(a) {
982
- for (var b = 1; b < arguments.length; b++) {
983
- var d = arguments[b];
984
- for (var p in d)
985
- Object.prototype.hasOwnProperty.call(d, p) && (a[p] = d[p]);
986
- }
987
- return a;
988
- }).apply(this, arguments);
989
- }
990
- function _(a, b) {
991
- a.prototype = Object.create(b.prototype), a.prototype.constructor = a, function(d, p) {
992
- for (var S = Object.getOwnPropertyNames(p), P = 0; P < S.length; P++) {
993
- var N = S[P], A = Object.getOwnPropertyDescriptor(p, N);
994
- A && A.configurable && d[N] === void 0 && Object.defineProperty(d, N, A);
995
- }
996
- }(a, b);
997
- }
998
- function E(a, b) {
999
- if (a == null)
1000
- return {};
1001
- var d, p, S = {}, P = Object.keys(a);
1002
- for (p = 0; p < P.length; p++)
1003
- d = P[p], b.indexOf(d) >= 0 || (S[d] = a[d]);
1004
- return S;
1005
- }
1006
- function W(a) {
1007
- return requestAnimationFrame(a);
1008
- }
1009
- function I(a) {
1010
- cancelAnimationFrame(a);
1011
- }
1012
- function R(a) {
1013
- var b = a.ownerDocument;
1014
- return b.hasFocus() && b.activeElement === a;
1015
- }
1016
- function C(a) {
1017
- return a == null ? void 0 : a.ownerDocument;
1018
- }
1019
- function te(a) {
1020
- var b = function(d) {
1021
- var p;
1022
- return (p = C(d)) == null ? void 0 : p.defaultView;
1023
- }(a);
1024
- return !!b && a instanceof b.HTMLElement;
1025
- }
1026
- function Q(a) {
1027
- return r.useCallback(function() {
1028
- var b = a.current, d = typeof window < "u" && te(b);
1029
- if (!b || !d)
1030
- return null;
1031
- if (b.nodeName !== "INPUT" && (b = b.querySelector("input")), !b)
1032
- throw new Error("react-input-mask: inputComponent doesn't contain input node");
1033
- return b;
1034
- }, [a]);
1035
- }
1036
- function re(a, b) {
1037
- var d, p, S, P, N = r.useRef({ start: null, end: null }), A = Q(a), j = r.useCallback(function() {
1038
- return function(y) {
1039
- var x = y.selectionStart, h = y.selectionEnd;
1040
- return { start: x, end: h, length: h - x };
1041
- }(A());
1042
- }, [A]), H = r.useCallback(function() {
1043
- return N.current;
1044
- }, []), L = r.useCallback(function(y) {
1045
- var x = A();
1046
- x && R(x) && (function(h, u, s) {
1047
- s === void 0 && (s = u), h.setSelectionRange(u, s);
1048
- }(x, y.start, y.end), N.current = j());
1049
- }, [A, j]), F = r.useCallback(function() {
1050
- N.current = j();
1051
- }, [j]), X = (d = F, p = r.useRef(null), S = r.useCallback(function() {
1052
- p.current === null && function y() {
1053
- d(), p.current = W(y);
1054
- }();
1055
- }, [d]), P = r.useCallback(function() {
1056
- I(p.current), p.current = null;
1057
- }, []), r.useEffect(function() {
1058
- p.current && (P(), S());
1059
- }, [S, P]), r.useEffect(I, []), [S, P]), ae = X[0], fe = X[1];
1060
- return r.useLayoutEffect(function() {
1061
- if (b) {
1062
- var y = A();
1063
- return y.addEventListener("focus", ae), y.addEventListener("blur", fe), R(y) && ae(), function() {
1064
- y.removeEventListener("focus", ae), y.removeEventListener("blur", fe), fe();
1065
- };
1066
- }
1067
- }), { getSelection: j, getLastSelection: H, setSelection: L };
1068
- }
1069
- function K(a, b) {
1070
- var d = r.useRef(), p = re(d, b), S = p.getSelection, P = p.getLastSelection, N = p.setSelection, A = function(F, X) {
1071
- var ae = Q(F), fe = r.useRef(X);
1072
- return { getValue: r.useCallback(function() {
1073
- return ae().value;
1074
- }, [ae]), getLastValue: r.useCallback(function() {
1075
- return fe.current;
1076
- }, []), setValue: r.useCallback(function(y) {
1077
- fe.current = y;
1078
- var x = ae();
1079
- x && (x.value = y);
1080
- }, [ae]) };
1081
- }(d, a), j = A.getValue, H = A.getLastValue, L = A.setValue;
1082
- return { inputRef: d, getInputState: function() {
1083
- return { value: j(), selection: S() };
1084
- }, getLastInputState: function() {
1085
- return { value: H(), selection: P() };
1086
- }, setInputState: function(F) {
1087
- var X = F.value, ae = F.selection;
1088
- L(X), N(ae);
1089
- } };
1090
- }
1091
- xr();
1092
- var G = ["disabled", "onBlur", "onChange", "onFocus", "onMouseDown", "readOnly", "value"], ie = { 9: /[0-9]/, a: /[A-Za-z]/, "*": /[A-Za-z0-9]/ }, Y = function(a) {
1093
- var b = this;
1094
- this.isCharacterAllowedAtPosition = function(d, p) {
1095
- var S = b.maskOptions.maskPlaceholder;
1096
- return !!b.isCharacterFillingPosition(d, p) || !!S && S[p] === d;
1097
- }, this.isCharacterFillingPosition = function(d, p) {
1098
- var S = b.maskOptions.mask;
1099
- if (!d || p >= S.length)
1100
- return !1;
1101
- if (!b.isPositionEditable(p))
1102
- return S[p] === d;
1103
- var P = S[p];
1104
- return new RegExp(P).test(d);
1105
- }, this.isPositionEditable = function(d) {
1106
- var p = b.maskOptions, S = p.mask, P = p.permanents;
1107
- return d < S.length && P.indexOf(d) === -1;
1108
- }, this.isValueEmpty = function(d) {
1109
- return d.split("").every(function(p, S) {
1110
- return !b.isPositionEditable(S) || !b.isCharacterFillingPosition(p, S);
1111
- });
1112
- }, this.isValueFilled = function(d) {
1113
- return b.getFilledLength(d) === b.maskOptions.lastEditablePosition + 1;
1114
- }, this.getDefaultSelectionForValue = function(d) {
1115
- var p = b.getFilledLength(d), S = b.getRightEditablePosition(p);
1116
- return { start: S, end: S };
1117
- }, this.getFilledLength = function(d) {
1118
- return function(p, S) {
1119
- for (var P = p.length - 1; P >= 0; P--)
1120
- if (S(p[P], P))
1121
- return P;
1122
- return -1;
1123
- }(d.split(""), function(p, S) {
1124
- return b.isPositionEditable(S) && b.isCharacterFillingPosition(p, S);
1125
- }) + 1;
1126
- }, this.getStringFillingLengthAtPosition = function(d, p) {
1127
- return d.split("").reduce(function(S, P) {
1128
- return b.insertCharacterAtPosition(S, P, S.length);
1129
- }, function(S, P) {
1130
- P === void 0 && (P = 1);
1131
- for (var N = "", A = 0; A < P; A++)
1132
- N += S;
1133
- return N;
1134
- }(" ", p)).length - p;
1135
- }, this.getLeftEditablePosition = function(d) {
1136
- for (var p = d; p >= 0; p--)
1137
- if (b.isPositionEditable(p))
1138
- return p;
1139
- return null;
1140
- }, this.getRightEditablePosition = function(d) {
1141
- for (var p = b.maskOptions.mask, S = d; S < p.length; S++)
1142
- if (b.isPositionEditable(S))
1143
- return S;
1144
- return null;
1145
- }, this.formatValue = function(d) {
1146
- var p = b.maskOptions, S = p.maskPlaceholder, P = p.mask;
1147
- if (!S) {
1148
- for (d = b.insertStringAtPosition("", d, 0); d.length < P.length && !b.isPositionEditable(d.length); )
1149
- d += P[d.length];
1150
- return d;
1151
- }
1152
- return b.insertStringAtPosition(S, d, 0);
1153
- }, this.clearRange = function(d, p, S) {
1154
- if (!S)
1155
- return d;
1156
- var P = p + S, N = b.maskOptions, A = N.maskPlaceholder, j = N.mask, H = d.split("").map(function(L, F) {
1157
- var X = b.isPositionEditable(F);
1158
- return !A && F >= P && !X ? "" : F < p || F >= P ? L : X ? A ? A[F] : "" : j[F];
1159
- }).join("");
1160
- return b.formatValue(H);
1161
- }, this.insertCharacterAtPosition = function(d, p, S) {
1162
- var P = b.maskOptions, N = P.mask, A = P.maskPlaceholder;
1163
- if (S >= N.length)
1164
- return d;
1165
- var j = b.isCharacterAllowedAtPosition(p, S), H = b.isPositionEditable(S), L = b.getRightEditablePosition(S), F = A && L ? p === A[L] : null, X = d.slice(0, S);
1166
- return !j && H || (d = X + (j ? p : N[S])), j || H || F || (d = b.insertCharacterAtPosition(d, p, S + 1)), d;
1167
- }, this.insertStringAtPosition = function(d, p, S) {
1168
- var P = b.maskOptions, N = P.mask, A = P.maskPlaceholder;
1169
- if (!p || S >= N.length)
1170
- return d;
1171
- var j = p.split(""), H = b.isValueFilled(d) || !!A, L = d.slice(S);
1172
- return d = j.reduce(function(F, X) {
1173
- return b.insertCharacterAtPosition(F, X, F.length);
1174
- }, d.slice(0, S)), H ? d += L.slice(d.length - S) : b.isValueFilled(d) ? d += N.slice(d.length).join("") : d = L.split("").filter(function(F, X) {
1175
- return b.isPositionEditable(S + X);
1176
- }).reduce(function(F, X) {
1177
- var ae = b.getRightEditablePosition(F.length);
1178
- return ae === null ? F : (b.isPositionEditable(F.length) || (F += N.slice(F.length, ae).join("")), b.insertCharacterAtPosition(F, X, F.length));
1179
- }, d), d;
1180
- }, this.processChange = function(d, p) {
1181
- var S = b.maskOptions, P = S.mask, N = S.prefix, A = S.lastEditablePosition, j = d.value, H = d.selection, L = p.value, F = p.selection, X = j, ae = "", fe = 0, y = 0, x = Math.min(F.start, H.start);
1182
- return H.end > F.start ? (ae = X.slice(F.start, H.end), y = (fe = b.getStringFillingLengthAtPosition(ae, x)) ? F.length : 0) : X.length < L.length && (y = L.length - X.length), X = L, y && (y === 1 && !F.length && (x = F.start === H.start ? b.getRightEditablePosition(H.start) : b.getLeftEditablePosition(H.start)), X = b.clearRange(X, x, y)), X = b.insertStringAtPosition(X, ae, x), (x += fe) >= P.length ? x = P.length : x < N.length && !fe ? x = N.length : x >= N.length && x < A && fe && (x = b.getRightEditablePosition(x)), { value: X = b.formatValue(X), enteredString: ae, selection: { start: x, end: x } };
1183
- }, this.maskOptions = function(d) {
1184
- var p = d.mask, S = d.maskPlaceholder, P = [];
1185
- if (!p)
1186
- return { maskPlaceholder: null, mask: null, prefix: null, lastEditablePosition: null, permanents: [] };
1187
- if (typeof p == "string") {
1188
- var N = !1, A = "";
1189
- p.split("").forEach(function(L) {
1190
- N || L !== "\\" ? (!N && ie[L] || P.push(A.length), A += L, N = !1) : N = !0;
1191
- }), p = A.split("").map(function(L, F) {
1192
- return P.indexOf(F) === -1 ? ie[L] : L;
1193
- });
1194
- } else
1195
- p.forEach(function(L, F) {
1196
- typeof L == "string" && P.push(F);
1197
- });
1198
- S && (S = S.length === 1 ? p.map(function(L, F) {
1199
- return P.indexOf(F) !== -1 ? L : S;
1200
- }) : S.split(""), P.forEach(function(L) {
1201
- S[L] = p[L];
1202
- }), S = S.join(""));
1203
- for (var j = P.filter(function(L, F) {
1204
- return L === F;
1205
- }).map(function(L) {
1206
- return p[L];
1207
- }).join(""), H = p.length - 1; P.indexOf(H) !== -1; )
1208
- H--;
1209
- return { maskPlaceholder: S, prefix: j, mask: p, lastEditablePosition: H, permanents: P };
1210
- }(a);
1211
- }, ne = function(a) {
1212
- function b() {
1213
- return a.apply(this, arguments) || this;
1214
- }
1215
- return _(b, a), b.prototype.render = function() {
1216
- var d = this.props, p = d.children, S = E(d, ["children"]);
1217
- return t.cloneElement(p, S);
1218
- }, b;
1219
- }(t.Component), ee = r.forwardRef(function(a, b) {
1220
- var d = a.alwaysShowMask, p = a.children, S = a.mask, P = a.maskPlaceholder, N = a.beforeMaskedStateChange, A = E(a, ["alwaysShowMask", "children", "mask", "maskPlaceholder", "beforeMaskedStateChange"]);
1221
- (function(m) {
1222
- var B = m.mask, q = m.maskPlaceholder;
1223
- B && q && q.length !== 1 && q.length !== B.length && c(!1);
1224
- })(a);
1225
- var j, H, L = new Y({ mask: S, maskPlaceholder: P }), F = !!S, X = !A.disabled && !A.readOnly, ae = a.value !== null && a.value !== void 0, fe = (j = F, H = r.useRef(), r.useEffect(function() {
1226
- H.current = j;
1227
- }), H.current), y = K(function(m) {
1228
- return "" + m;
1229
- }((ae ? a.value : a.defaultValue) || ""), F), x = y.inputRef, h = y.getInputState, u = y.setInputState, s = y.getLastInputState, f = Q(x);
1230
- if (F && ae) {
1231
- var g = f(), k = g && R(g) || d || a.value ? L.formatValue(a.value) : a.value;
1232
- N && (k = N({ nextState: { value: k, selection: { start: null, end: null } } }).value), u(i({}, s(), { value: k }));
1233
- }
1234
- var D = s(), T = D.selection, V = D.value;
1235
- r.useLayoutEffect(function() {
1236
- if (F) {
1237
- var m = R(f()), B = T, q = h(), U = i({}, q);
1238
- if (!ae) {
1239
- var oe = q.value, ye = L.formatValue(oe), n = L.isValueEmpty(ye);
1240
- !n || m || d ? U.value = ye : n && !m && (U.value = "");
1241
- }
1242
- m && !fe ? U.selection = L.getDefaultSelectionForValue(U.value) : ae && m && B && B.start !== null && B.end !== null && (U.selection = B), N && (U = N({ currentState: q, nextState: U })), u(U);
1243
- }
1244
- });
1245
- var J = i({}, A, { onFocus: function(m) {
1246
- x.current = m.target;
1247
- var B = h().value;
1248
- if (F && !L.isValueFilled(B)) {
1249
- var q = L.formatValue(B), U = L.getDefaultSelectionForValue(q), oe = { value: q, selection: U };
1250
- N && (q = (oe = N({ currentState: h(), nextState: oe })).value, U = oe.selection), u(oe), q !== B && a.onChange && a.onChange(m), W(function() {
1251
- u(s());
1252
- });
1253
- }
1254
- a.onFocus && a.onFocus(m);
1255
- }, onBlur: function(m) {
1256
- var B = h().value, q = s().value;
1257
- if (F && !d && L.isValueEmpty(q)) {
1258
- var U = "", oe = { value: U, selection: { start: null, end: null } };
1259
- N && (U = (oe = N({ currentState: h(), nextState: oe })).value), u(oe), U !== B && a.onChange && a.onChange(m);
1260
- }
1261
- a.onBlur && a.onBlur(m);
1262
- }, onChange: F && X ? function(m) {
1263
- var B = h(), q = s(), U = L.processChange(B, q);
1264
- N && (U = N({ currentState: B, previousState: q, nextState: U })), u(U), a.onChange && a.onChange(m);
1265
- } : a.onChange, onMouseDown: F && X ? function(m) {
1266
- var B = f(), q = h().value, U = C(B);
1267
- if (!R(B) && !L.isValueFilled(q)) {
1268
- var oe = m.clientX, ye = m.clientY, n = (/* @__PURE__ */ new Date()).getTime();
1269
- U.addEventListener("mouseup", function l(v) {
1270
- if (U.removeEventListener("mouseup", l), R(B)) {
1271
- var M = Math.abs(v.clientX - oe), O = Math.abs(v.clientY - ye), w = Math.max(M, O), $ = (/* @__PURE__ */ new Date()).getTime() - n;
1272
- if (w <= 10 && $ <= 200 || w <= 5 && $ <= 300) {
1273
- var se = s(), ve = i({}, se, { selection: L.getDefaultSelectionForValue(se.value) });
1274
- u(ve);
1275
- }
1276
- }
1277
- });
1278
- }
1279
- a.onMouseDown && a.onMouseDown(m);
1280
- } : a.onMouseDown, ref: function(m) {
1281
- x.current = o.findDOMNode(m), /* @__PURE__ */ function(B) {
1282
- return typeof B == "function";
1283
- }(b) ? b(m) : b !== null && typeof b == "object" && (b.current = m);
1284
- }, value: F && ae ? V : a.value });
1285
- return p ? (function(m, B) {
1286
- G.filter(function(q) {
1287
- return B.props[q] != null && B.props[q] !== m[q];
1288
- }).length && c(!1);
1289
- }(a, p), t.createElement(ne, J, p)) : t.createElement("input", J);
1290
- });
1291
- return ee.displayName = "InputMask", ee.defaultProps = { alwaysShowMask: !1, maskPlaceholder: "_" }, yt.exports = ee, yt.exports;
1292
- }
1293
- var wt, ar;
1294
- function yn() {
1295
- if (ar)
1296
- return wt;
1297
- ar = 1;
1298
- function e(h) {
1299
- return h && typeof h == "object" && "default" in h ? h.default : h;
1300
- }
1301
- var r = Te, t = e(r), o = gr, c = e(Er()), i = e(Sr()), _ = e(xr());
1302
- function E(h, u) {
1303
- for (var s = Object.getOwnPropertyNames(u), f = 0; f < s.length; f++) {
1304
- var g = s[f], k = Object.getOwnPropertyDescriptor(u, g);
1305
- k && k.configurable && h[g] === void 0 && Object.defineProperty(h, g, k);
1306
- }
1307
- return h;
1308
- }
1309
- function W() {
1310
- return W = Object.assign || function(h) {
1311
- for (var u = 1; u < arguments.length; u++) {
1312
- var s = arguments[u];
1313
- for (var f in s)
1314
- Object.prototype.hasOwnProperty.call(s, f) && (h[f] = s[f]);
1315
- }
1316
- return h;
1317
- }, W.apply(this, arguments);
1318
- }
1319
- function I(h, u) {
1320
- h.prototype = Object.create(u.prototype), h.prototype.constructor = h, E(h, u);
1321
- }
1322
- function R(h, u) {
1323
- if (h == null)
1324
- return {};
1325
- var s = {}, f = Object.keys(h), g, k;
1326
- for (k = 0; k < f.length; k++)
1327
- g = f[k], !(u.indexOf(g) >= 0) && (s[g] = h[g]);
1328
- return s;
1329
- }
1330
- function C(h) {
1331
- return requestAnimationFrame(h);
1332
- }
1333
- function te(h) {
1334
- cancelAnimationFrame(h);
1335
- }
1336
- function Q(h, u, s) {
1337
- s === void 0 && (s = u), h.setSelectionRange(u, s);
1338
- }
1339
- function re(h) {
1340
- var u = h.selectionStart, s = h.selectionEnd;
1341
- return {
1342
- start: u,
1343
- end: s,
1344
- length: s - u
1345
- };
1346
- }
1347
- function K(h) {
1348
- var u = h.ownerDocument;
1349
- return u.hasFocus() && u.activeElement === h;
1350
- }
1351
- function G(h) {
1352
- return h == null ? void 0 : h.ownerDocument;
1353
- }
1354
- function ie(h) {
1355
- var u;
1356
- return (u = G(h)) == null ? void 0 : u.defaultView;
1357
- }
1358
- function Y(h) {
1359
- var u = ie(h);
1360
- return !!u && h instanceof u.HTMLElement;
1361
- }
1362
- function ne(h) {
1363
- return typeof h == "function";
1364
- }
1365
- function ee(h, u) {
1366
- for (var s = h.length - 1; s >= 0; s--) {
1367
- var f = h[s];
1368
- if (u(f, s))
1369
- return s;
1370
- }
1371
- return -1;
1372
- }
1373
- function a(h, u) {
1374
- u === void 0 && (u = 1);
1375
- for (var s = "", f = 0; f < u; f++)
1376
- s += h;
1377
- return s;
1378
- }
1379
- function b(h) {
1380
- return "" + h;
1381
- }
1382
- function d(h) {
1383
- return r.useCallback(function() {
1384
- var u = h.current, s = typeof window < "u" && Y(u);
1385
- if (!u || !s)
1386
- return null;
1387
- if (u.nodeName !== "INPUT" && (u = u.querySelector("input")), !u)
1388
- throw new Error("react-input-mask: inputComponent doesn't contain input node");
1389
- return u;
1390
- }, [h]);
1391
- }
1392
- function p(h) {
1393
- var u = r.useRef(null), s = r.useCallback(function() {
1394
- if (u.current !== null)
1395
- return;
1396
- function g() {
1397
- h(), u.current = C(g);
1398
- }
1399
- g();
1400
- }, [h]), f = r.useCallback(function() {
1401
- te(u.current), u.current = null;
1402
- }, []);
1403
- return r.useEffect(function() {
1404
- u.current && (f(), s());
1405
- }, [s, f]), r.useEffect(te, []), [s, f];
1406
- }
1407
- function S(h, u) {
1408
- var s = r.useRef({
1409
- start: null,
1410
- end: null
1411
- }), f = d(h), g = r.useCallback(function() {
1412
- var B = f();
1413
- return re(B);
1414
- }, [f]), k = r.useCallback(function() {
1415
- return s.current;
1416
- }, []), D = r.useCallback(function(B) {
1417
- var q = f();
1418
- !q || !K(q) || (Q(q, B.start, B.end), s.current = g());
1419
- }, [f, g]), T = r.useCallback(function() {
1420
- s.current = g();
1421
- }, [g]), V = p(T), J = V[0], m = V[1];
1422
- return r.useLayoutEffect(function() {
1423
- if (u) {
1424
- var B = f();
1425
- return B.addEventListener("focus", J), B.addEventListener("blur", m), K(B) && J(), function() {
1426
- B.removeEventListener("focus", J), B.removeEventListener("blur", m), m();
1427
- };
1428
- }
1429
- }), {
1430
- getSelection: g,
1431
- getLastSelection: k,
1432
- setSelection: D
1433
- };
1434
- }
1435
- function P(h, u) {
1436
- var s = d(h), f = r.useRef(u), g = r.useCallback(function() {
1437
- var T = s();
1438
- return T.value;
1439
- }, [s]), k = r.useCallback(function() {
1440
- return f.current;
1441
- }, []), D = r.useCallback(function(T) {
1442
- f.current = T;
1443
- var V = s();
1444
- V && (V.value = T);
1445
- }, [s]);
1446
- return {
1447
- getValue: g,
1448
- getLastValue: k,
1449
- setValue: D
1450
- };
1451
- }
1452
- function N(h, u) {
1453
- var s = r.useRef(), f = S(s, u), g = f.getSelection, k = f.getLastSelection, D = f.setSelection, T = P(s, h), V = T.getValue, J = T.getLastValue, m = T.setValue;
1454
- function B() {
1455
- return {
1456
- value: J(),
1457
- selection: k()
1458
- };
1459
- }
1460
- function q() {
1461
- return {
1462
- value: V(),
1463
- selection: g()
1464
- };
1465
- }
1466
- function U(oe) {
1467
- var ye = oe.value, n = oe.selection;
1468
- m(ye), D(n);
1469
- }
1470
- return {
1471
- inputRef: s,
1472
- getInputState: q,
1473
- getLastInputState: B,
1474
- setInputState: U
1475
- };
1476
- }
1477
- function A(h) {
1478
- var u = r.useRef();
1479
- return r.useEffect(function() {
1480
- u.current = h;
1481
- }), u.current;
1482
- }
1483
- var j = ["disabled", "onBlur", "onChange", "onFocus", "onMouseDown", "readOnly", "value"], H = {
1484
- 9: /[0-9]/,
1485
- a: /[A-Za-z]/,
1486
- "*": /[A-Za-z0-9]/
1487
- };
1488
- function L(h) {
1489
- process.env.NODE_ENV !== "production" && _(!h.maxLength || !h.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.");
1490
- }
1491
- function F(h) {
1492
- var u = h.mask, s = h.maskPlaceholder;
1493
- !u || !s || s.length === 1 || s.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:
1494
- ` + ("mask: " + u + `
1495
- `) + ("maskPlaceholder: " + s)) : i(!1));
1496
- }
1497
- function X(h, u) {
1498
- var s = j.filter(function(f) {
1499
- return u.props[f] != null && u.props[f] !== h[f];
1500
- });
1501
- s.length && (process.env.NODE_ENV !== "production" ? i(!1, "react-input-mask: the following props should be passed to the InputMask component, not to children: " + s.join(",")) : i(!1));
1502
- }
1503
- function ae(h) {
1504
- var u = h.mask, s = h.maskPlaceholder, f = [];
1505
- if (!u)
1506
- return {
1507
- maskPlaceholder: null,
1508
- mask: null,
1509
- prefix: null,
1510
- lastEditablePosition: null,
1511
- permanents: []
1512
- };
1513
- if (typeof u == "string") {
1514
- var g = !1, k = "";
1515
- u.split("").forEach(function(V) {
1516
- !g && V === "\\" ? g = !0 : ((g || !H[V]) && f.push(k.length), k += V, g = !1);
1517
- }), u = k.split("").map(function(V, J) {
1518
- return f.indexOf(J) === -1 ? H[V] : V;
1519
- });
1520
- } else
1521
- u.forEach(function(V, J) {
1522
- typeof V == "string" && f.push(J);
1523
- });
1524
- s && (s.length === 1 ? s = u.map(function(V, J) {
1525
- return f.indexOf(J) !== -1 ? V : s;
1526
- }) : s = s.split(""), f.forEach(function(V) {
1527
- s[V] = u[V];
1528
- }), s = s.join(""));
1529
- for (var D = f.filter(function(V, J) {
1530
- return V === J;
1531
- }).map(function(V) {
1532
- return u[V];
1533
- }).join(""), T = u.length - 1; f.indexOf(T) !== -1; )
1534
- T--;
1535
- return {
1536
- maskPlaceholder: s,
1537
- prefix: D,
1538
- mask: u,
1539
- lastEditablePosition: T,
1540
- permanents: f
1541
- };
1542
- }
1543
- var fe = function(u) {
1544
- var s = this;
1545
- this.isCharacterAllowedAtPosition = function(f, g) {
1546
- var k = s.maskOptions.maskPlaceholder;
1547
- return s.isCharacterFillingPosition(f, g) ? !0 : k ? k[g] === f : !1;
1548
- }, this.isCharacterFillingPosition = function(f, g) {
1549
- var k = s.maskOptions.mask;
1550
- if (!f || g >= k.length)
1551
- return !1;
1552
- if (!s.isPositionEditable(g))
1553
- return k[g] === f;
1554
- var D = k[g];
1555
- return new RegExp(D).test(f);
1556
- }, this.isPositionEditable = function(f) {
1557
- var g = s.maskOptions, k = g.mask, D = g.permanents;
1558
- return f < k.length && D.indexOf(f) === -1;
1559
- }, this.isValueEmpty = function(f) {
1560
- return f.split("").every(function(g, k) {
1561
- return !s.isPositionEditable(k) || !s.isCharacterFillingPosition(g, k);
1562
- });
1563
- }, this.isValueFilled = function(f) {
1564
- return s.getFilledLength(f) === s.maskOptions.lastEditablePosition + 1;
1565
- }, this.getDefaultSelectionForValue = function(f) {
1566
- var g = s.getFilledLength(f), k = s.getRightEditablePosition(g);
1567
- return {
1568
- start: k,
1569
- end: k
1570
- };
1571
- }, this.getFilledLength = function(f) {
1572
- var g = f.split(""), k = ee(g, function(D, T) {
1573
- return s.isPositionEditable(T) && s.isCharacterFillingPosition(D, T);
1574
- });
1575
- return k + 1;
1576
- }, this.getStringFillingLengthAtPosition = function(f, g) {
1577
- var k = f.split(""), D = k.reduce(function(T, V) {
1578
- return s.insertCharacterAtPosition(T, V, T.length);
1579
- }, a(" ", g));
1580
- return D.length - g;
1581
- }, this.getLeftEditablePosition = function(f) {
1582
- for (var g = f; g >= 0; g--)
1583
- if (s.isPositionEditable(g))
1584
- return g;
1585
- return null;
1586
- }, this.getRightEditablePosition = function(f) {
1587
- for (var g = s.maskOptions.mask, k = f; k < g.length; k++)
1588
- if (s.isPositionEditable(k))
1589
- return k;
1590
- return null;
1591
- }, this.formatValue = function(f) {
1592
- var g = s.maskOptions, k = g.maskPlaceholder, D = g.mask;
1593
- if (!k) {
1594
- for (f = s.insertStringAtPosition("", f, 0); f.length < D.length && !s.isPositionEditable(f.length); )
1595
- f += D[f.length];
1596
- return f;
1597
- }
1598
- return s.insertStringAtPosition(k, f, 0);
1599
- }, this.clearRange = function(f, g, k) {
1600
- if (!k)
1601
- return f;
1602
- var D = g + k, T = s.maskOptions, V = T.maskPlaceholder, J = T.mask, m = f.split("").map(function(B, q) {
1603
- var U = s.isPositionEditable(q);
1604
- return !V && q >= D && !U ? "" : q < g || q >= D ? B : U ? V ? V[q] : "" : J[q];
1605
- }).join("");
1606
- return s.formatValue(m);
1607
- }, this.insertCharacterAtPosition = function(f, g, k) {
1608
- var D = s.maskOptions, T = D.mask, V = D.maskPlaceholder;
1609
- if (k >= T.length)
1610
- return f;
1611
- var J = s.isCharacterAllowedAtPosition(g, k), m = s.isPositionEditable(k), B = s.getRightEditablePosition(k), q = V && B ? g === V[B] : null, U = f.slice(0, k);
1612
- if (J || !m) {
1613
- var oe = J ? g : T[k];
1614
- f = U + oe;
1615
- }
1616
- return !J && !m && !q && (f = s.insertCharacterAtPosition(f, g, k + 1)), f;
1617
- }, this.insertStringAtPosition = function(f, g, k) {
1618
- var D = s.maskOptions, T = D.mask, V = D.maskPlaceholder;
1619
- if (!g || k >= T.length)
1620
- return f;
1621
- var J = g.split(""), m = s.isValueFilled(f) || !!V, B = f.slice(k);
1622
- if (f = J.reduce(function(U, oe) {
1623
- return s.insertCharacterAtPosition(U, oe, U.length);
1624
- }, f.slice(0, k)), m)
1625
- f += B.slice(f.length - k);
1626
- else if (s.isValueFilled(f))
1627
- f += T.slice(f.length).join("");
1628
- else {
1629
- var q = B.split("").filter(function(U, oe) {
1630
- return s.isPositionEditable(k + oe);
1631
- });
1632
- f = q.reduce(function(U, oe) {
1633
- var ye = s.getRightEditablePosition(U.length);
1634
- return ye === null ? U : (s.isPositionEditable(U.length) || (U += T.slice(U.length, ye).join("")), s.insertCharacterAtPosition(U, oe, U.length));
1635
- }, f);
1636
- }
1637
- return f;
1638
- }, this.processChange = function(f, g) {
1639
- var k = s.maskOptions, D = k.mask, T = k.prefix, V = k.lastEditablePosition, J = f.value, m = f.selection, B = g.value, q = g.selection, U = J, oe = "", ye = 0, n = 0, l = Math.min(q.start, m.start);
1640
- if (m.end > q.start ? (oe = U.slice(q.start, m.end), ye = s.getStringFillingLengthAtPosition(oe, l), ye ? n = q.length : n = 0) : U.length < B.length && (n = B.length - U.length), U = B, n) {
1641
- if (n === 1 && !q.length) {
1642
- var v = q.start === m.start;
1643
- l = v ? s.getRightEditablePosition(m.start) : s.getLeftEditablePosition(m.start);
1644
- }
1645
- U = s.clearRange(U, l, n);
1646
- }
1647
- return U = s.insertStringAtPosition(U, oe, l), l += ye, l >= D.length ? l = D.length : l < T.length && !ye ? l = T.length : l >= T.length && l < V && ye && (l = s.getRightEditablePosition(l)), U = s.formatValue(U), {
1648
- value: U,
1649
- enteredString: oe,
1650
- selection: {
1651
- start: l,
1652
- end: l
1653
- }
1654
- };
1655
- }, this.maskOptions = ae(u);
1656
- }, y = /* @__PURE__ */ function(h) {
1657
- I(u, h);
1658
- function u() {
1659
- return h.apply(this, arguments) || this;
1660
- }
1661
- var s = u.prototype;
1662
- return s.render = function() {
1663
- var g = this.props, k = g.children, D = R(g, ["children"]);
1664
- return t.cloneElement(k, D);
1665
- }, u;
1666
- }(t.Component), x = r.forwardRef(function(u, s) {
1667
- var f = u.alwaysShowMask, g = u.children, k = u.mask, D = u.maskPlaceholder, T = u.beforeMaskedStateChange, V = R(u, ["alwaysShowMask", "children", "mask", "maskPlaceholder", "beforeMaskedStateChange"]);
1668
- L(u), F(u);
1669
- var J = new fe({
1670
- mask: k,
1671
- maskPlaceholder: D
1672
- }), m = !!k, B = !V.disabled && !V.readOnly, q = u.value !== null && u.value !== void 0, U = A(m), oe = b((q ? u.value : u.defaultValue) || ""), ye = N(oe, m), n = ye.inputRef, l = ye.getInputState, v = ye.setInputState, M = ye.getLastInputState, O = d(n);
1673
- function w(Ee) {
1674
- var he = l(), xe = M(), Pe = J.processChange(he, xe);
1675
- T && (Pe = T({
1676
- currentState: he,
1677
- previousState: xe,
1678
- nextState: Pe
1679
- })), v(Pe), u.onChange && u.onChange(Ee);
1680
- }
1681
- function $(Ee) {
1682
- n.current = Ee.target;
1683
- var he = l().value;
1684
- if (m && !J.isValueFilled(he)) {
1685
- var xe = J.formatValue(he), Pe = J.getDefaultSelectionForValue(xe), me = {
1686
- value: xe,
1687
- selection: Pe
1688
- };
1689
- T && (me = T({
1690
- currentState: l(),
1691
- nextState: me
1692
- }), xe = me.value, Pe = me.selection), v(me), xe !== he && u.onChange && u.onChange(Ee), C(function() {
1693
- v(M());
1694
- });
1695
- }
1696
- u.onFocus && u.onFocus(Ee);
1697
- }
1698
- function se(Ee) {
1699
- var he = l().value, xe = M().value;
1700
- if (m && !f && J.isValueEmpty(xe)) {
1701
- var Pe = "", me = {
1702
- value: Pe,
1703
- selection: {
1704
- start: null,
1705
- end: null
1706
- }
1707
- };
1708
- T && (me = T({
1709
- currentState: l(),
1710
- nextState: me
1711
- }), Pe = me.value), v(me), Pe !== he && u.onChange && u.onChange(Ee);
1712
- }
1713
- u.onBlur && u.onBlur(Ee);
1714
- }
1715
- function ve(Ee) {
1716
- var he = O(), xe = l(), Pe = xe.value, me = G(he);
1717
- if (!K(he) && !J.isValueFilled(Pe)) {
1718
- var ht = Ee.clientX, Ke = Ee.clientY, Qe = (/* @__PURE__ */ new Date()).getTime(), mt = function Mr(Bt) {
1719
- if (me.removeEventListener("mouseup", Mr), !!K(he)) {
1720
- var Dr = Math.abs(Bt.clientX - ht), Lr = Math.abs(Bt.clientY - Ke), Wt = Math.max(Dr, Lr), zt = (/* @__PURE__ */ new Date()).getTime() - Qe;
1721
- if (Wt <= 10 && zt <= 200 || Wt <= 5 && zt <= 300) {
1722
- var jt = M(), Ir = J.getDefaultSelectionForValue(jt.value), Nr = W({}, jt, {
1723
- selection: Ir
1724
- });
1725
- v(Nr);
1726
- }
1727
- }
1728
- };
1729
- me.addEventListener("mouseup", mt);
1730
- }
1731
- u.onMouseDown && u.onMouseDown(Ee);
1732
- }
1733
- if (m && q) {
1734
- var Se = O(), De = Se && K(Se), Ue = De || f || u.value ? J.formatValue(u.value) : u.value;
1735
- T && (Ue = T({
1736
- nextState: {
1737
- value: Ue,
1738
- selection: {
1739
- start: null,
1740
- end: null
1741
- }
1742
- }
1743
- }).value), v(W({}, M(), {
1744
- value: Ue
1745
- }));
1746
- }
1747
- var We = M(), Ye = We.selection, vt = We.value;
1748
- r.useLayoutEffect(function() {
1749
- if (m) {
1750
- var Ee = O(), he = K(Ee), xe = Ye, Pe = l(), me = W({}, Pe);
1751
- if (!q) {
1752
- var ht = Pe.value, Ke = J.formatValue(ht), Qe = J.isValueEmpty(Ke), mt = !Qe || he || f;
1753
- mt ? me.value = Ke : Qe && !he && (me.value = "");
1754
- }
1755
- he && !U ? me.selection = J.getDefaultSelectionForValue(me.value) : q && he && xe && xe.start !== null && xe.end !== null && (me.selection = xe), T && (me = T({
1756
- currentState: Pe,
1757
- nextState: me
1758
- })), v(me);
1759
- }
1760
- });
1761
- var He = W({}, V, {
1762
- onFocus: $,
1763
- onBlur: se,
1764
- onChange: m && B ? w : u.onChange,
1765
- onMouseDown: m && B ? ve : u.onMouseDown,
1766
- ref: function(he) {
1767
- n.current = o.findDOMNode(he), ne(s) ? s(he) : s !== null && typeof s == "object" && (s.current = he);
1768
- },
1769
- value: m && q ? vt : u.value
1770
- });
1771
- return g ? (X(u, g), t.createElement(y, He, g)) : t.createElement("input", He);
1772
- });
1773
- return x.displayName = "InputMask", x.defaultProps = {
1774
- alwaysShowMask: !1,
1775
- maskPlaceholder: "_"
1776
- }, x.propTypes = {
1777
- alwaysShowMask: c.bool,
1778
- beforeMaskedStateChange: c.func,
1779
- children: c.element,
1780
- mask: c.oneOfType([c.string, c.arrayOf(c.oneOfType([c.string, c.instanceOf(RegExp)]))]),
1781
- maskPlaceholder: c.string,
1782
- onFocus: c.func,
1783
- onBlur: c.func,
1784
- onChange: c.func,
1785
- onMouseDown: c.func
1786
- }, wt = x, wt;
1787
- }
1788
- process.env.NODE_ENV === "production" ? Rt.exports = pn() : Rt.exports = yn();
1789
- var gn = Rt.exports;
1790
- const _n = /* @__PURE__ */ yr(gn), bn = "_btn_7n08v_1", kn = "_modal_7n08v_9", En = "_modalBody_7n08v_16", Sn = "_root_7n08v_21", xn = "_title_7n08v_34", Pn = "_description_7n08v_41", wn = "_inputWrapper_7n08v_48", Cn = "_linkPolicy_7n08v_55", On = "_telegramLink_7n08v_60", An = "_telegramWrapper_7n08v_65", Tn = "_telegram_7n08v_60", Rn = "_orText_7n08v_88", Ce = {
1791
- btn: bn,
1792
- modal: kn,
1793
- modalBody: En,
1794
- root: Sn,
1795
- title: xn,
1796
- description: Pn,
1797
- inputWrapper: wn,
1798
- linkPolicy: Cn,
1799
- telegramLink: On,
1800
- telegramWrapper: An,
1801
- telegram: Tn,
1802
- orText: Rn
1803
- };
1804
- var Ge = (e) => e.type === "checkbox", $e = (e) => e instanceof Date, Oe = (e) => e == null;
1805
- const Pr = (e) => typeof e == "object";
1806
- var ke = (e) => !Oe(e) && !Array.isArray(e) && Pr(e) && !$e(e), Fn = (e) => ke(e) && e.target ? Ge(e.target) ? e.target.checked : e.target.value : e, Vn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Mn = (e, r) => e.has(Vn(r)), Dn = (e) => {
1807
- const r = e.constructor && e.constructor.prototype;
1808
- return ke(r) && r.hasOwnProperty("isPrototypeOf");
1809
- }, Dt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
1810
- function Re(e) {
1811
- let r;
1812
- const t = Array.isArray(e);
1813
- if (e instanceof Date)
1814
- r = new Date(e);
1815
- else if (e instanceof Set)
1816
- r = new Set(e);
1817
- else if (!(Dt && (e instanceof Blob || e instanceof FileList)) && (t || ke(e)))
1818
- if (r = t ? [] : {}, !t && !Dn(e))
1819
- r = e;
1820
- else
1821
- for (const o in e)
1822
- e.hasOwnProperty(o) && (r[o] = Re(e[o]));
1823
- else
1824
- return e;
1825
- return r;
1826
- }
1827
- var dt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], ge = (e) => e === void 0, z = (e, r, t) => {
1828
- if (!r || !ke(e))
1829
- return t;
1830
- const o = dt(r.split(/[,[\].]+?/)).reduce((c, i) => Oe(c) ? c : c[i], e);
1831
- return ge(o) || o === e ? ge(e[r]) ? t : e[r] : o;
1832
- }, Le = (e) => typeof e == "boolean", Lt = (e) => /^\w*$/.test(e), wr = (e) => dt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), de = (e, r, t) => {
1833
- let o = -1;
1834
- const c = Lt(r) ? [r] : wr(r), i = c.length, _ = i - 1;
1835
- for (; ++o < i; ) {
1836
- const E = c[o];
1837
- let W = t;
1838
- if (o !== _) {
1839
- const I = e[E];
1840
- W = ke(I) || Array.isArray(I) ? I : isNaN(+c[o + 1]) ? {} : [];
1841
- }
1842
- if (E === "__proto__")
1843
- return;
1844
- e[E] = W, e = e[E];
1845
- }
1846
- return e;
1847
- };
1848
- const sr = {
1849
- BLUR: "blur",
1850
- FOCUS_OUT: "focusout",
1851
- CHANGE: "change"
1852
- }, Fe = {
1853
- onBlur: "onBlur",
1854
- onChange: "onChange",
1855
- onSubmit: "onSubmit",
1856
- onTouched: "onTouched",
1857
- all: "all"
1858
- }, Me = {
1859
- max: "max",
1860
- min: "min",
1861
- maxLength: "maxLength",
1862
- minLength: "minLength",
1863
- pattern: "pattern",
1864
- required: "required",
1865
- validate: "validate"
1866
- };
1867
- Te.createContext(null);
1868
- var Ln = (e, r, t, o = !0) => {
1869
- const c = {
1870
- defaultValues: r._defaultValues
1871
- };
1872
- for (const i in e)
1873
- Object.defineProperty(c, i, {
1874
- get: () => {
1875
- const _ = i;
1876
- return r._proxyFormState[_] !== Fe.all && (r._proxyFormState[_] = !o || Fe.all), e[_];
1877
- }
1878
- });
1879
- return c;
1880
- }, Ae = (e) => ke(e) && !Object.keys(e).length, In = (e, r, t, o) => {
1881
- t(e);
1882
- const { name: c, ...i } = e;
1883
- return Ae(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((_) => r[_] === Fe.all);
1884
- }, at = (e) => Array.isArray(e) ? e : [e];
1885
- function Nn(e) {
1886
- const r = Te.useRef(e);
1887
- r.current = e, Te.useEffect(() => {
1888
- const t = !e.disabled && r.current.subject && r.current.subject.subscribe({
1889
- next: r.current.next
1890
- });
1891
- return () => {
1892
- t && t.unsubscribe();
1893
- };
1894
- }, [e.disabled]);
1895
- }
1896
- var Ve = (e) => typeof e == "string", Bn = (e, r, t, o, c) => Ve(e) ? (o && r.watch.add(e), z(t, e, c)) : Array.isArray(e) ? e.map((i) => (o && r.watch.add(i), z(t, i))) : (o && (r.watchAll = !0), t), Wn = (e, r, t, o, c) => r ? {
1897
- ...t[e],
1898
- types: {
1899
- ...t[e] && t[e].types ? t[e].types : {},
1900
- [o]: c || !0
1901
- }
1902
- } : {}, or = (e) => ({
1903
- isOnSubmit: !e || e === Fe.onSubmit,
1904
- isOnBlur: e === Fe.onBlur,
1905
- isOnChange: e === Fe.onChange,
1906
- isOnAll: e === Fe.all,
1907
- isOnTouch: e === Fe.onTouched
1908
- }), lr = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((o) => e.startsWith(o) && /^\.\w+/.test(e.slice(o.length))));
1909
- const Ze = (e, r, t, o) => {
1910
- for (const c of t || Object.keys(e)) {
1911
- const i = z(e, c);
1912
- if (i) {
1913
- const { _f: _, ...E } = i;
1914
- if (_) {
1915
- if (_.refs && _.refs[0] && r(_.refs[0], c) && !o)
1916
- break;
1917
- if (_.ref && r(_.ref, _.name) && !o)
1918
- break;
1919
- Ze(E, r);
1920
- } else
1921
- ke(E) && Ze(E, r);
1922
- }
1923
- }
1924
- };
1925
- var zn = (e, r, t) => {
1926
- const o = at(z(e, t));
1927
- return de(o, "root", r[t]), de(e, t, o), e;
1928
- }, It = (e) => e.type === "file", Ie = (e) => typeof e == "function", ot = (e) => {
1929
- if (!Dt)
1930
- return !1;
1931
- const r = e ? e.ownerDocument : 0;
1932
- return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
1933
- }, st = (e) => Ve(e), Nt = (e) => e.type === "radio", lt = (e) => e instanceof RegExp;
1934
- const ur = {
1935
- value: !1,
1936
- isValid: !1
1937
- }, cr = { value: !0, isValid: !0 };
1938
- var Cr = (e) => {
1939
- if (Array.isArray(e)) {
1940
- if (e.length > 1) {
1941
- const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
1942
- return { value: r, isValid: !!r.length };
1943
- }
1944
- return e[0].checked && !e[0].disabled ? (
1945
- // @ts-expect-error expected to work in the browser
1946
- e[0].attributes && !ge(e[0].attributes.value) ? ge(e[0].value) || e[0].value === "" ? cr : { value: e[0].value, isValid: !0 } : cr
1947
- ) : ur;
1948
- }
1949
- return ur;
1950
- };
1951
- const fr = {
1952
- isValid: !1,
1953
- value: null
1954
- };
1955
- var Or = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
1956
- isValid: !0,
1957
- value: t.value
1958
- } : r, fr) : fr;
1959
- function dr(e, r, t = "validate") {
1960
- if (st(e) || Array.isArray(e) && e.every(st) || Le(e) && !e)
1961
- return {
1962
- type: t,
1963
- message: st(e) ? e : "",
1964
- ref: r
1965
- };
1966
- }
1967
- var ze = (e) => ke(e) && !lt(e) ? e : {
1968
- value: e,
1969
- message: ""
1970
- }, vr = async (e, r, t, o, c) => {
1971
- const { ref: i, refs: _, required: E, maxLength: W, minLength: I, min: R, max: C, pattern: te, validate: Q, name: re, valueAsNumber: K, mount: G, disabled: ie } = e._f, Y = z(r, re);
1972
- if (!G || ie)
1973
- return {};
1974
- const ne = _ ? _[0] : i, ee = (A) => {
1975
- o && ne.reportValidity && (ne.setCustomValidity(Le(A) ? "" : A || ""), ne.reportValidity());
1976
- }, a = {}, b = Nt(i), d = Ge(i), p = b || d, S = (K || It(i)) && ge(i.value) && ge(Y) || ot(i) && i.value === "" || Y === "" || Array.isArray(Y) && !Y.length, P = Wn.bind(null, re, t, a), N = (A, j, H, L = Me.maxLength, F = Me.minLength) => {
1977
- const X = A ? j : H;
1978
- a[re] = {
1979
- type: A ? L : F,
1980
- message: X,
1981
- ref: i,
1982
- ...P(A ? L : F, X)
1983
- };
1984
- };
1985
- if (c ? !Array.isArray(Y) || !Y.length : E && (!p && (S || Oe(Y)) || Le(Y) && !Y || d && !Cr(_).isValid || b && !Or(_).isValid)) {
1986
- const { value: A, message: j } = st(E) ? { value: !!E, message: E } : ze(E);
1987
- if (A && (a[re] = {
1988
- type: Me.required,
1989
- message: j,
1990
- ref: ne,
1991
- ...P(Me.required, j)
1992
- }, !t))
1993
- return ee(j), a;
1994
- }
1995
- if (!S && (!Oe(R) || !Oe(C))) {
1996
- let A, j;
1997
- const H = ze(C), L = ze(R);
1998
- if (!Oe(Y) && !isNaN(Y)) {
1999
- const F = i.valueAsNumber || Y && +Y;
2000
- Oe(H.value) || (A = F > H.value), Oe(L.value) || (j = F < L.value);
2001
- } else {
2002
- const F = i.valueAsDate || new Date(Y), X = (y) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + y), ae = i.type == "time", fe = i.type == "week";
2003
- Ve(H.value) && Y && (A = ae ? X(Y) > X(H.value) : fe ? Y > H.value : F > new Date(H.value)), Ve(L.value) && Y && (j = ae ? X(Y) < X(L.value) : fe ? Y < L.value : F < new Date(L.value));
2004
- }
2005
- if ((A || j) && (N(!!A, H.message, L.message, Me.max, Me.min), !t))
2006
- return ee(a[re].message), a;
2007
- }
2008
- if ((W || I) && !S && (Ve(Y) || c && Array.isArray(Y))) {
2009
- const A = ze(W), j = ze(I), H = !Oe(A.value) && Y.length > +A.value, L = !Oe(j.value) && Y.length < +j.value;
2010
- if ((H || L) && (N(H, A.message, j.message), !t))
2011
- return ee(a[re].message), a;
2012
- }
2013
- if (te && !S && Ve(Y)) {
2014
- const { value: A, message: j } = ze(te);
2015
- if (lt(A) && !Y.match(A) && (a[re] = {
2016
- type: Me.pattern,
2017
- message: j,
2018
- ref: i,
2019
- ...P(Me.pattern, j)
2020
- }, !t))
2021
- return ee(j), a;
2022
- }
2023
- if (Q) {
2024
- if (Ie(Q)) {
2025
- const A = await Q(Y, r), j = dr(A, ne);
2026
- if (j && (a[re] = {
2027
- ...j,
2028
- ...P(Me.validate, j.message)
2029
- }, !t))
2030
- return ee(j.message), a;
2031
- } else if (ke(Q)) {
2032
- let A = {};
2033
- for (const j in Q) {
2034
- if (!Ae(A) && !t)
2035
- break;
2036
- const H = dr(await Q[j](Y, r), ne, j);
2037
- H && (A = {
2038
- ...H,
2039
- ...P(j, H.message)
2040
- }, ee(H.message), t && (a[re] = A));
2041
- }
2042
- if (!Ae(A) && (a[re] = {
2043
- ref: ne,
2044
- ...A
2045
- }, !t))
2046
- return a;
2047
- }
2048
- }
2049
- return ee(!0), a;
2050
- };
2051
- function jn(e, r) {
2052
- const t = r.slice(0, -1).length;
2053
- let o = 0;
2054
- for (; o < t; )
2055
- e = ge(e) ? o++ : e[r[o++]];
2056
- return e;
2057
- }
2058
- function qn(e) {
2059
- for (const r in e)
2060
- if (e.hasOwnProperty(r) && !ge(e[r]))
2061
- return !1;
2062
- return !0;
2063
- }
2064
- function be(e, r) {
2065
- const t = Array.isArray(r) ? r : Lt(r) ? [r] : wr(r), o = t.length === 1 ? e : jn(e, t), c = t.length - 1, i = t[c];
2066
- return o && delete o[i], c !== 0 && (ke(o) && Ae(o) || Array.isArray(o) && qn(o)) && be(e, t.slice(0, -1)), e;
2067
- }
2068
- var Ct = () => {
2069
- let e = [];
2070
- return {
2071
- get observers() {
2072
- return e;
2073
- },
2074
- next: (c) => {
2075
- for (const i of e)
2076
- i.next && i.next(c);
2077
- },
2078
- subscribe: (c) => (e.push(c), {
2079
- unsubscribe: () => {
2080
- e = e.filter((i) => i !== c);
2081
- }
2082
- }),
2083
- unsubscribe: () => {
2084
- e = [];
2085
- }
2086
- };
2087
- }, ut = (e) => Oe(e) || !Pr(e);
2088
- function Ne(e, r) {
2089
- if (ut(e) || ut(r))
2090
- return e === r;
2091
- if ($e(e) && $e(r))
2092
- return e.getTime() === r.getTime();
2093
- const t = Object.keys(e), o = Object.keys(r);
2094
- if (t.length !== o.length)
2095
- return !1;
2096
- for (const c of t) {
2097
- const i = e[c];
2098
- if (!o.includes(c))
2099
- return !1;
2100
- if (c !== "ref") {
2101
- const _ = r[c];
2102
- if ($e(i) && $e(_) || ke(i) && ke(_) || Array.isArray(i) && Array.isArray(_) ? !Ne(i, _) : i !== _)
2103
- return !1;
2104
- }
2105
- }
2106
- return !0;
2107
- }
2108
- var Ar = (e) => e.type === "select-multiple", $n = (e) => Nt(e) || Ge(e), Ot = (e) => ot(e) && e.isConnected, Tr = (e) => {
2109
- for (const r in e)
2110
- if (Ie(e[r]))
2111
- return !0;
2112
- return !1;
2113
- };
2114
- function ct(e, r = {}) {
2115
- const t = Array.isArray(e);
2116
- if (ke(e) || t)
2117
- for (const o in e)
2118
- Array.isArray(e[o]) || ke(e[o]) && !Tr(e[o]) ? (r[o] = Array.isArray(e[o]) ? [] : {}, ct(e[o], r[o])) : Oe(e[o]) || (r[o] = !0);
2119
- return r;
2120
- }
2121
- function Rr(e, r, t) {
2122
- const o = Array.isArray(e);
2123
- if (ke(e) || o)
2124
- for (const c in e)
2125
- Array.isArray(e[c]) || ke(e[c]) && !Tr(e[c]) ? ge(r) || ut(t[c]) ? t[c] = Array.isArray(e[c]) ? ct(e[c], []) : { ...ct(e[c]) } : Rr(e[c], Oe(r) ? {} : r[c], t[c]) : t[c] = !Ne(e[c], r[c]);
2126
- return t;
2127
- }
2128
- var it = (e, r) => Rr(e, r, ct(r)), Fr = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: o }) => ge(e) ? e : r ? e === "" ? NaN : e && +e : t && Ve(e) ? new Date(e) : o ? o(e) : e;
2129
- function At(e) {
2130
- const r = e.ref;
2131
- if (!(e.refs ? e.refs.every((t) => t.disabled) : r.disabled))
2132
- return It(r) ? r.files : Nt(r) ? Or(e.refs).value : Ar(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Ge(r) ? Cr(e.refs).value : Fr(ge(r.value) ? e.ref.value : r.value, e);
2133
- }
2134
- var Un = (e, r, t, o) => {
2135
- const c = {};
2136
- for (const i of e) {
2137
- const _ = z(r, i);
2138
- _ && de(c, i, _._f);
2139
- }
2140
- return {
2141
- criteriaMode: t,
2142
- names: [...e],
2143
- fields: c,
2144
- shouldUseNativeValidation: o
2145
- };
2146
- }, Xe = (e) => ge(e) ? e : lt(e) ? e.source : ke(e) ? lt(e.value) ? e.value.source : e.value : e, Yn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
2147
- function hr(e, r, t) {
2148
- const o = z(e, t);
2149
- if (o || Lt(t))
2150
- return {
2151
- error: o,
2152
- name: t
2153
- };
2154
- const c = t.split(".");
2155
- for (; c.length; ) {
2156
- const i = c.join("."), _ = z(r, i), E = z(e, i);
2157
- if (_ && !Array.isArray(_) && t !== i)
2158
- return { name: t };
2159
- if (E && E.type)
2160
- return {
2161
- name: i,
2162
- error: E
2163
- };
2164
- c.pop();
2165
- }
2166
- return {
2167
- name: t
2168
- };
2169
- }
2170
- var Hn = (e, r, t, o, c) => c.isOnAll ? !1 : !t && c.isOnTouch ? !(r || e) : (t ? o.isOnBlur : c.isOnBlur) ? !e : (t ? o.isOnChange : c.isOnChange) ? e : !0, Xn = (e, r) => !dt(z(e, r)).length && be(e, r);
2171
- const Jn = {
2172
- mode: Fe.onSubmit,
2173
- reValidateMode: Fe.onChange,
2174
- shouldFocusError: !0
2175
- };
2176
- function Zn(e = {}) {
2177
- let r = {
2178
- ...Jn,
2179
- ...e
2180
- }, t = {
2181
- submitCount: 0,
2182
- isDirty: !1,
2183
- isLoading: Ie(r.defaultValues),
2184
- isValidating: !1,
2185
- isSubmitted: !1,
2186
- isSubmitting: !1,
2187
- isSubmitSuccessful: !1,
2188
- isValid: !1,
2189
- touchedFields: {},
2190
- dirtyFields: {},
2191
- validatingFields: {},
2192
- errors: r.errors || {},
2193
- disabled: r.disabled || !1
2194
- }, o = {}, c = ke(r.defaultValues) || ke(r.values) ? Re(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : Re(c), _ = {
2195
- action: !1,
2196
- mount: !1,
2197
- watch: !1
2198
- }, E = {
2199
- mount: /* @__PURE__ */ new Set(),
2200
- unMount: /* @__PURE__ */ new Set(),
2201
- array: /* @__PURE__ */ new Set(),
2202
- watch: /* @__PURE__ */ new Set()
2203
- }, W, I = 0;
2204
- const R = {
2205
- isDirty: !1,
2206
- dirtyFields: !1,
2207
- validatingFields: !1,
2208
- touchedFields: !1,
2209
- isValidating: !1,
2210
- isValid: !1,
2211
- errors: !1
2212
- }, C = {
2213
- values: Ct(),
2214
- array: Ct(),
2215
- state: Ct()
2216
- }, te = or(r.mode), Q = or(r.reValidateMode), re = r.criteriaMode === Fe.all, K = (n) => (l) => {
2217
- clearTimeout(I), I = setTimeout(n, l);
2218
- }, G = async (n) => {
2219
- if (R.isValid || n) {
2220
- const l = r.resolver ? Ae((await p()).errors) : await P(o, !0);
2221
- l !== t.isValid && C.state.next({
2222
- isValid: l
2223
- });
2224
- }
2225
- }, ie = (n, l) => {
2226
- (R.isValidating || R.validatingFields) && ((n || Array.from(E.mount)).forEach((v) => {
2227
- v && (l ? de(t.validatingFields, v, l) : be(t.validatingFields, v));
2228
- }), C.state.next({
2229
- validatingFields: t.validatingFields,
2230
- isValidating: !Ae(t.validatingFields)
2231
- }));
2232
- }, Y = (n, l = [], v, M, O = !0, w = !0) => {
2233
- if (M && v) {
2234
- if (_.action = !0, w && Array.isArray(z(o, n))) {
2235
- const $ = v(z(o, n), M.argA, M.argB);
2236
- O && de(o, n, $);
2237
- }
2238
- if (w && Array.isArray(z(t.errors, n))) {
2239
- const $ = v(z(t.errors, n), M.argA, M.argB);
2240
- O && de(t.errors, n, $), Xn(t.errors, n);
2241
- }
2242
- if (R.touchedFields && w && Array.isArray(z(t.touchedFields, n))) {
2243
- const $ = v(z(t.touchedFields, n), M.argA, M.argB);
2244
- O && de(t.touchedFields, n, $);
2245
- }
2246
- R.dirtyFields && (t.dirtyFields = it(c, i)), C.state.next({
2247
- name: n,
2248
- isDirty: A(n, l),
2249
- dirtyFields: t.dirtyFields,
2250
- errors: t.errors,
2251
- isValid: t.isValid
2252
- });
2253
- } else
2254
- de(i, n, l);
2255
- }, ne = (n, l) => {
2256
- de(t.errors, n, l), C.state.next({
2257
- errors: t.errors
2258
- });
2259
- }, ee = (n) => {
2260
- t.errors = n, C.state.next({
2261
- errors: t.errors,
2262
- isValid: !1
2263
- });
2264
- }, a = (n, l, v, M) => {
2265
- const O = z(o, n);
2266
- if (O) {
2267
- const w = z(i, n, ge(v) ? z(c, n) : v);
2268
- ge(w) || M && M.defaultChecked || l ? de(i, n, l ? w : At(O._f)) : L(n, w), _.mount && G();
2269
- }
2270
- }, b = (n, l, v, M, O) => {
2271
- let w = !1, $ = !1;
2272
- const se = {
2273
- name: n
2274
- }, ve = !!(z(o, n) && z(o, n)._f && z(o, n)._f.disabled);
2275
- if (!v || M) {
2276
- R.isDirty && ($ = t.isDirty, t.isDirty = se.isDirty = A(), w = $ !== se.isDirty);
2277
- const Se = ve || Ne(z(c, n), l);
2278
- $ = !!(!ve && z(t.dirtyFields, n)), Se || ve ? be(t.dirtyFields, n) : de(t.dirtyFields, n, !0), se.dirtyFields = t.dirtyFields, w = w || R.dirtyFields && $ !== !Se;
2279
- }
2280
- if (v) {
2281
- const Se = z(t.touchedFields, n);
2282
- Se || (de(t.touchedFields, n, v), se.touchedFields = t.touchedFields, w = w || R.touchedFields && Se !== v);
2283
- }
2284
- return w && O && C.state.next(se), w ? se : {};
2285
- }, d = (n, l, v, M) => {
2286
- const O = z(t.errors, n), w = R.isValid && Le(l) && t.isValid !== l;
2287
- if (e.delayError && v ? (W = K(() => ne(n, v)), W(e.delayError)) : (clearTimeout(I), W = null, v ? de(t.errors, n, v) : be(t.errors, n)), (v ? !Ne(O, v) : O) || !Ae(M) || w) {
2288
- const $ = {
2289
- ...M,
2290
- ...w && Le(l) ? { isValid: l } : {},
2291
- errors: t.errors,
2292
- name: n
2293
- };
2294
- t = {
2295
- ...t,
2296
- ...$
2297
- }, C.state.next($);
2298
- }
2299
- }, p = async (n) => {
2300
- ie(n, !0);
2301
- const l = await r.resolver(i, r.context, Un(n || E.mount, o, r.criteriaMode, r.shouldUseNativeValidation));
2302
- return ie(n), l;
2303
- }, S = async (n) => {
2304
- const { errors: l } = await p(n);
2305
- if (n)
2306
- for (const v of n) {
2307
- const M = z(l, v);
2308
- M ? de(t.errors, v, M) : be(t.errors, v);
2309
- }
2310
- else
2311
- t.errors = l;
2312
- return l;
2313
- }, P = async (n, l, v = {
2314
- valid: !0
2315
- }) => {
2316
- for (const M in n) {
2317
- const O = n[M];
2318
- if (O) {
2319
- const { _f: w, ...$ } = O;
2320
- if (w) {
2321
- const se = E.array.has(w.name);
2322
- ie([M], !0);
2323
- const ve = await vr(O, i, re, r.shouldUseNativeValidation && !l, se);
2324
- if (ie([M]), ve[w.name] && (v.valid = !1, l))
2325
- break;
2326
- !l && (z(ve, w.name) ? se ? zn(t.errors, ve, w.name) : de(t.errors, w.name, ve[w.name]) : be(t.errors, w.name));
2327
- }
2328
- !Ae($) && await P($, l, v);
2329
- }
2330
- }
2331
- return v.valid;
2332
- }, N = () => {
2333
- for (const n of E.unMount) {
2334
- const l = z(o, n);
2335
- l && (l._f.refs ? l._f.refs.every((v) => !Ot(v)) : !Ot(l._f.ref)) && g(n);
2336
- }
2337
- E.unMount = /* @__PURE__ */ new Set();
2338
- }, A = (n, l) => (n && l && de(i, n, l), !Ne(x(), c)), j = (n, l, v) => Bn(n, E, {
2339
- ..._.mount ? i : ge(l) ? c : Ve(n) ? { [n]: l } : l
2340
- }, v, l), H = (n) => dt(z(_.mount ? i : c, n, e.shouldUnregister ? z(c, n, []) : [])), L = (n, l, v = {}) => {
2341
- const M = z(o, n);
2342
- let O = l;
2343
- if (M) {
2344
- const w = M._f;
2345
- w && (!w.disabled && de(i, n, Fr(l, w)), O = ot(w.ref) && Oe(l) ? "" : l, Ar(w.ref) ? [...w.ref.options].forEach(($) => $.selected = O.includes($.value)) : w.refs ? Ge(w.ref) ? w.refs.length > 1 ? w.refs.forEach(($) => (!$.defaultChecked || !$.disabled) && ($.checked = Array.isArray(O) ? !!O.find((se) => se === $.value) : O === $.value)) : w.refs[0] && (w.refs[0].checked = !!O) : w.refs.forEach(($) => $.checked = $.value === O) : It(w.ref) ? w.ref.value = "" : (w.ref.value = O, w.ref.type || C.values.next({
2346
- name: n,
2347
- values: { ...i }
2348
- })));
2349
- }
2350
- (v.shouldDirty || v.shouldTouch) && b(n, O, v.shouldTouch, v.shouldDirty, !0), v.shouldValidate && y(n);
2351
- }, F = (n, l, v) => {
2352
- for (const M in l) {
2353
- const O = l[M], w = `${n}.${M}`, $ = z(o, w);
2354
- (E.array.has(n) || !ut(O) || $ && !$._f) && !$e(O) ? F(w, O, v) : L(w, O, v);
2355
- }
2356
- }, X = (n, l, v = {}) => {
2357
- const M = z(o, n), O = E.array.has(n), w = Re(l);
2358
- de(i, n, w), O ? (C.array.next({
2359
- name: n,
2360
- values: { ...i }
2361
- }), (R.isDirty || R.dirtyFields) && v.shouldDirty && C.state.next({
2362
- name: n,
2363
- dirtyFields: it(c, i),
2364
- isDirty: A(n, w)
2365
- })) : M && !M._f && !Oe(w) ? F(n, w, v) : L(n, w, v), lr(n, E) && C.state.next({ ...t }), C.values.next({
2366
- name: _.mount ? n : void 0,
2367
- values: { ...i }
2368
- });
2369
- }, ae = async (n) => {
2370
- _.mount = !0;
2371
- const l = n.target;
2372
- let v = l.name, M = !0;
2373
- const O = z(o, v), w = () => l.type ? At(O._f) : Fn(n), $ = (se) => {
2374
- M = Number.isNaN(se) || se === z(i, v, se);
2375
- };
2376
- if (O) {
2377
- let se, ve;
2378
- const Se = w(), De = n.type === sr.BLUR || n.type === sr.FOCUS_OUT, Ue = !Yn(O._f) && !r.resolver && !z(t.errors, v) && !O._f.deps || Hn(De, z(t.touchedFields, v), t.isSubmitted, Q, te), We = lr(v, E, De);
2379
- de(i, v, Se), De ? (O._f.onBlur && O._f.onBlur(n), W && W(0)) : O._f.onChange && O._f.onChange(n);
2380
- const Ye = b(v, Se, De, !1), vt = !Ae(Ye) || We;
2381
- if (!De && C.values.next({
2382
- name: v,
2383
- type: n.type,
2384
- values: { ...i }
2385
- }), Ue)
2386
- return R.isValid && G(), vt && C.state.next({ name: v, ...We ? {} : Ye });
2387
- if (!De && We && C.state.next({ ...t }), r.resolver) {
2388
- const { errors: He } = await p([v]);
2389
- if ($(Se), M) {
2390
- const Ee = hr(t.errors, o, v), he = hr(He, o, Ee.name || v);
2391
- se = he.error, v = he.name, ve = Ae(He);
2392
- }
2393
- } else
2394
- ie([v], !0), se = (await vr(O, i, re, r.shouldUseNativeValidation))[v], ie([v]), $(Se), M && (se ? ve = !1 : R.isValid && (ve = await P(o, !0)));
2395
- M && (O._f.deps && y(O._f.deps), d(v, ve, se, Ye));
2396
- }
2397
- }, fe = (n, l) => {
2398
- if (z(t.errors, l) && n.focus)
2399
- return n.focus(), 1;
2400
- }, y = async (n, l = {}) => {
2401
- let v, M;
2402
- const O = at(n);
2403
- if (r.resolver) {
2404
- const w = await S(ge(n) ? n : O);
2405
- v = Ae(w), M = n ? !O.some(($) => z(w, $)) : v;
2406
- } else
2407
- n ? (M = (await Promise.all(O.map(async (w) => {
2408
- const $ = z(o, w);
2409
- return await P($ && $._f ? { [w]: $ } : $);
2410
- }))).every(Boolean), !(!M && !t.isValid) && G()) : M = v = await P(o);
2411
- return C.state.next({
2412
- ...!Ve(n) || R.isValid && v !== t.isValid ? {} : { name: n },
2413
- ...r.resolver || !n ? { isValid: v } : {},
2414
- errors: t.errors
2415
- }), l.shouldFocus && !M && Ze(o, fe, n ? O : E.mount), M;
2416
- }, x = (n) => {
2417
- const l = {
2418
- ..._.mount ? i : c
2419
- };
2420
- return ge(n) ? l : Ve(n) ? z(l, n) : n.map((v) => z(l, v));
2421
- }, h = (n, l) => ({
2422
- invalid: !!z((l || t).errors, n),
2423
- isDirty: !!z((l || t).dirtyFields, n),
2424
- error: z((l || t).errors, n),
2425
- isValidating: !!z(t.validatingFields, n),
2426
- isTouched: !!z((l || t).touchedFields, n)
2427
- }), u = (n) => {
2428
- n && at(n).forEach((l) => be(t.errors, l)), C.state.next({
2429
- errors: n ? t.errors : {}
2430
- });
2431
- }, s = (n, l, v) => {
2432
- const M = (z(o, n, { _f: {} })._f || {}).ref, O = z(t.errors, n) || {}, { ref: w, message: $, type: se, ...ve } = O;
2433
- de(t.errors, n, {
2434
- ...ve,
2435
- ...l,
2436
- ref: M
2437
- }), C.state.next({
2438
- name: n,
2439
- errors: t.errors,
2440
- isValid: !1
2441
- }), v && v.shouldFocus && M && M.focus && M.focus();
2442
- }, f = (n, l) => Ie(n) ? C.values.subscribe({
2443
- next: (v) => n(j(void 0, l), v)
2444
- }) : j(n, l, !0), g = (n, l = {}) => {
2445
- for (const v of n ? at(n) : E.mount)
2446
- E.mount.delete(v), E.array.delete(v), l.keepValue || (be(o, v), be(i, v)), !l.keepError && be(t.errors, v), !l.keepDirty && be(t.dirtyFields, v), !l.keepTouched && be(t.touchedFields, v), !l.keepIsValidating && be(t.validatingFields, v), !r.shouldUnregister && !l.keepDefaultValue && be(c, v);
2447
- C.values.next({
2448
- values: { ...i }
2449
- }), C.state.next({
2450
- ...t,
2451
- ...l.keepDirty ? { isDirty: A() } : {}
2452
- }), !l.keepIsValid && G();
2453
- }, k = ({ disabled: n, name: l, field: v, fields: M, value: O }) => {
2454
- if (Le(n) && _.mount || n) {
2455
- const w = n ? void 0 : ge(O) ? At(v ? v._f : z(M, l)._f) : O;
2456
- de(i, l, w), b(l, w, !1, !1, !0);
2457
- }
2458
- }, D = (n, l = {}) => {
2459
- let v = z(o, n);
2460
- const M = Le(l.disabled);
2461
- return de(o, n, {
2462
- ...v || {},
2463
- _f: {
2464
- ...v && v._f ? v._f : { ref: { name: n } },
2465
- name: n,
2466
- mount: !0,
2467
- ...l
2468
- }
2469
- }), E.mount.add(n), v ? k({
2470
- field: v,
2471
- disabled: l.disabled,
2472
- name: n,
2473
- value: l.value
2474
- }) : a(n, !0, l.value), {
2475
- ...M ? { disabled: l.disabled } : {},
2476
- ...r.progressive ? {
2477
- required: !!l.required,
2478
- min: Xe(l.min),
2479
- max: Xe(l.max),
2480
- minLength: Xe(l.minLength),
2481
- maxLength: Xe(l.maxLength),
2482
- pattern: Xe(l.pattern)
2483
- } : {},
2484
- name: n,
2485
- onChange: ae,
2486
- onBlur: ae,
2487
- ref: (O) => {
2488
- if (O) {
2489
- D(n, l), v = z(o, n);
2490
- const w = ge(O.value) && O.querySelectorAll && O.querySelectorAll("input,select,textarea")[0] || O, $ = $n(w), se = v._f.refs || [];
2491
- if ($ ? se.find((ve) => ve === w) : w === v._f.ref)
2492
- return;
2493
- de(o, n, {
2494
- _f: {
2495
- ...v._f,
2496
- ...$ ? {
2497
- refs: [
2498
- ...se.filter(Ot),
2499
- w,
2500
- ...Array.isArray(z(c, n)) ? [{}] : []
2501
- ],
2502
- ref: { type: w.type, name: n }
2503
- } : { ref: w }
2504
- }
2505
- }), a(n, !1, void 0, w);
2506
- } else
2507
- v = z(o, n, {}), v._f && (v._f.mount = !1), (r.shouldUnregister || l.shouldUnregister) && !(Mn(E.array, n) && _.action) && E.unMount.add(n);
2508
- }
2509
- };
2510
- }, T = () => r.shouldFocusError && Ze(o, fe, E.mount), V = (n) => {
2511
- Le(n) && (C.state.next({ disabled: n }), Ze(o, (l, v) => {
2512
- const M = z(o, v);
2513
- M && (l.disabled = M._f.disabled || n, Array.isArray(M._f.refs) && M._f.refs.forEach((O) => {
2514
- O.disabled = M._f.disabled || n;
2515
- }));
2516
- }, 0, !1));
2517
- }, J = (n, l) => async (v) => {
2518
- let M;
2519
- v && (v.preventDefault && v.preventDefault(), v.persist && v.persist());
2520
- let O = Re(i);
2521
- if (C.state.next({
2522
- isSubmitting: !0
2523
- }), r.resolver) {
2524
- const { errors: w, values: $ } = await p();
2525
- t.errors = w, O = $;
2526
- } else
2527
- await P(o);
2528
- if (be(t.errors, "root"), Ae(t.errors)) {
2529
- C.state.next({
2530
- errors: {}
2531
- });
2532
- try {
2533
- await n(O, v);
2534
- } catch (w) {
2535
- M = w;
2536
- }
2537
- } else
2538
- l && await l({ ...t.errors }, v), T(), setTimeout(T);
2539
- if (C.state.next({
2540
- isSubmitted: !0,
2541
- isSubmitting: !1,
2542
- isSubmitSuccessful: Ae(t.errors) && !M,
2543
- submitCount: t.submitCount + 1,
2544
- errors: t.errors
2545
- }), M)
2546
- throw M;
2547
- }, m = (n, l = {}) => {
2548
- z(o, n) && (ge(l.defaultValue) ? X(n, Re(z(c, n))) : (X(n, l.defaultValue), de(c, n, Re(l.defaultValue))), l.keepTouched || be(t.touchedFields, n), l.keepDirty || (be(t.dirtyFields, n), t.isDirty = l.defaultValue ? A(n, Re(z(c, n))) : A()), l.keepError || (be(t.errors, n), R.isValid && G()), C.state.next({ ...t }));
2549
- }, B = (n, l = {}) => {
2550
- const v = n ? Re(n) : c, M = Re(v), O = Ae(n), w = O ? c : M;
2551
- if (l.keepDefaultValues || (c = v), !l.keepValues) {
2552
- if (l.keepDirtyValues)
2553
- for (const $ of E.mount)
2554
- z(t.dirtyFields, $) ? de(w, $, z(i, $)) : X($, z(w, $));
2555
- else {
2556
- if (Dt && ge(n))
2557
- for (const $ of E.mount) {
2558
- const se = z(o, $);
2559
- if (se && se._f) {
2560
- const ve = Array.isArray(se._f.refs) ? se._f.refs[0] : se._f.ref;
2561
- if (ot(ve)) {
2562
- const Se = ve.closest("form");
2563
- if (Se) {
2564
- Se.reset();
2565
- break;
2566
- }
2567
- }
2568
- }
2569
- }
2570
- o = {};
2571
- }
2572
- i = e.shouldUnregister ? l.keepDefaultValues ? Re(c) : {} : Re(w), C.array.next({
2573
- values: { ...w }
2574
- }), C.values.next({
2575
- values: { ...w }
2576
- });
2577
- }
2578
- E = {
2579
- mount: l.keepDirtyValues ? E.mount : /* @__PURE__ */ new Set(),
2580
- unMount: /* @__PURE__ */ new Set(),
2581
- array: /* @__PURE__ */ new Set(),
2582
- watch: /* @__PURE__ */ new Set(),
2583
- watchAll: !1,
2584
- focus: ""
2585
- }, _.mount = !R.isValid || !!l.keepIsValid || !!l.keepDirtyValues, _.watch = !!e.shouldUnregister, C.state.next({
2586
- submitCount: l.keepSubmitCount ? t.submitCount : 0,
2587
- isDirty: O ? !1 : l.keepDirty ? t.isDirty : !!(l.keepDefaultValues && !Ne(n, c)),
2588
- isSubmitted: l.keepIsSubmitted ? t.isSubmitted : !1,
2589
- dirtyFields: O ? {} : l.keepDirtyValues ? l.keepDefaultValues && i ? it(c, i) : t.dirtyFields : l.keepDefaultValues && n ? it(c, n) : l.keepDirty ? t.dirtyFields : {},
2590
- touchedFields: l.keepTouched ? t.touchedFields : {},
2591
- errors: l.keepErrors ? t.errors : {},
2592
- isSubmitSuccessful: l.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
2593
- isSubmitting: !1
2594
- });
2595
- }, q = (n, l) => B(Ie(n) ? n(i) : n, l);
2596
- return {
2597
- control: {
2598
- register: D,
2599
- unregister: g,
2600
- getFieldState: h,
2601
- handleSubmit: J,
2602
- setError: s,
2603
- _executeSchema: p,
2604
- _getWatch: j,
2605
- _getDirty: A,
2606
- _updateValid: G,
2607
- _removeUnmounted: N,
2608
- _updateFieldArray: Y,
2609
- _updateDisabledField: k,
2610
- _getFieldArray: H,
2611
- _reset: B,
2612
- _resetDefaultValues: () => Ie(r.defaultValues) && r.defaultValues().then((n) => {
2613
- q(n, r.resetOptions), C.state.next({
2614
- isLoading: !1
2615
- });
2616
- }),
2617
- _updateFormState: (n) => {
2618
- t = {
2619
- ...t,
2620
- ...n
2621
- };
2622
- },
2623
- _disableForm: V,
2624
- _subjects: C,
2625
- _proxyFormState: R,
2626
- _setErrors: ee,
2627
- get _fields() {
2628
- return o;
2629
- },
2630
- get _formValues() {
2631
- return i;
2632
- },
2633
- get _state() {
2634
- return _;
2635
- },
2636
- set _state(n) {
2637
- _ = n;
2638
- },
2639
- get _defaultValues() {
2640
- return c;
2641
- },
2642
- get _names() {
2643
- return E;
2644
- },
2645
- set _names(n) {
2646
- E = n;
2647
- },
2648
- get _formState() {
2649
- return t;
2650
- },
2651
- set _formState(n) {
2652
- t = n;
2653
- },
2654
- get _options() {
2655
- return r;
2656
- },
2657
- set _options(n) {
2658
- r = {
2659
- ...r,
2660
- ...n
2661
- };
2662
- }
2663
- },
2664
- trigger: y,
2665
- register: D,
2666
- handleSubmit: J,
2667
- watch: f,
2668
- setValue: X,
2669
- getValues: x,
2670
- reset: q,
2671
- resetField: m,
2672
- clearErrors: u,
2673
- unregister: g,
2674
- setError: s,
2675
- setFocus: (n, l = {}) => {
2676
- const v = z(o, n), M = v && v._f;
2677
- if (M) {
2678
- const O = M.refs ? M.refs[0] : M.ref;
2679
- O.focus && (O.focus(), l.shouldSelect && O.select());
2680
- }
2681
- },
2682
- getFieldState: h
2683
- };
2684
- }
2685
- function Gn(e = {}) {
2686
- const r = Te.useRef(), t = Te.useRef(), [o, c] = Te.useState({
2687
- isDirty: !1,
2688
- isValidating: !1,
2689
- isLoading: Ie(e.defaultValues),
2690
- isSubmitted: !1,
2691
- isSubmitting: !1,
2692
- isSubmitSuccessful: !1,
2693
- isValid: !1,
2694
- submitCount: 0,
2695
- dirtyFields: {},
2696
- touchedFields: {},
2697
- validatingFields: {},
2698
- errors: e.errors || {},
2699
- disabled: e.disabled || !1,
2700
- defaultValues: Ie(e.defaultValues) ? void 0 : e.defaultValues
2701
- });
2702
- r.current || (r.current = {
2703
- ...Zn(e),
2704
- formState: o
2705
- });
2706
- const i = r.current.control;
2707
- return i._options = e, Nn({
2708
- subject: i._subjects.state,
2709
- next: (_) => {
2710
- In(_, i._proxyFormState, i._updateFormState) && c({ ...i._formState });
2711
- }
2712
- }), Te.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), Te.useEffect(() => {
2713
- if (i._proxyFormState.isDirty) {
2714
- const _ = i._getDirty();
2715
- _ !== o.isDirty && i._subjects.state.next({
2716
- isDirty: _
2717
- });
2718
- }
2719
- }, [i, o.isDirty]), Te.useEffect(() => {
2720
- e.values && !Ne(e.values, t.current) ? (i._reset(e.values, i._options.resetOptions), t.current = e.values, c((_) => ({ ..._ }))) : i._resetDefaultValues();
2721
- }, [e.values, i]), Te.useEffect(() => {
2722
- e.errors && i._setErrors(e.errors);
2723
- }, [e.errors, i]), Te.useEffect(() => {
2724
- i._state.mount || (i._updateValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
2725
- }), Te.useEffect(() => {
2726
- e.shouldUnregister && i._subjects.values.next({
2727
- values: i._getWatch()
2728
- });
2729
- }, [e.shouldUnregister, i]), r.current.formState = Ln(o, i), r.current;
2730
- }
2731
- const Kn = Vt.bind(Ce), Qn = "Я принимаю условия Политики обработки и защиты персональных данных, даю согласия на обработку персональных данных", Zi = ({
2732
- isFormOpen: e,
2733
- setIsFormOpen: r,
2734
- isNews: t,
2735
- title: o,
2736
- isEmail: c,
2737
- isPhone: i,
2738
- isTextArea: _,
2739
- telegramLink: E = "https://t.me/stone_developer",
2740
- isRequiredPhone: W = !0,
2741
- isRequiredEmail: I = !1,
2742
- isRequiredPhoneOrEmail: R,
2743
- textAreaPlaceholder: C,
2744
- subTitle: te,
2745
- submitHandler: Q,
2746
- modalWidth: re = "442px",
2747
- rowsTextArea: K = 2,
2748
- advCheckBox: G = { text: Qn, isRequired: !0 },
2749
- isAdvCheckBox: ie,
2750
- addTitleClassName: Y,
2751
- createPortalObj: ne,
2752
- telegramClickHandler: ee = () => null
2753
- }) => {
2754
- const {
2755
- register: a,
2756
- handleSubmit: b,
2757
- trigger: d,
2758
- reset: p,
2759
- watch: S,
2760
- formState: { errors: P }
2761
- } = Gn(), N = !!S("email"), { onChange: A, onBlur: j, ...H } = a("phone", {
2762
- required: I || W || R && !N,
2763
- pattern: { value: jr, message: "" },
2764
- onBlur: () => d("phone")
2765
- }), { isMobile: L, currentClientWidth: F } = ft(), X = S("personalCheckBox"), ae = S("advCheckBox"), fe = (y) => {
2766
- Q(y), p();
2767
- };
2768
- return F ? /* @__PURE__ */ Z(
2769
- Ft,
2770
- {
2771
- additionalClass: Ce.modal,
2772
- additionalClassModalBody: Ce.modalBody,
2773
- createPortalObj: ne,
2774
- isOpen: e,
2775
- isTransparentBack: !0,
2776
- emitIsOpen: () => r(!1),
2777
- opacity: 0.7,
2778
- children: /* @__PURE__ */ pe(
2779
- "div",
2780
- {
2781
- className: Ce.root,
2782
- style: { width: L ? "100%" : re },
2783
- "data-testid": "modal_window",
2784
- children: [
2785
- /* @__PURE__ */ Z(
2786
- "div",
2787
- {
2788
- className: Kn(Ce.title, Y),
2789
- dangerouslySetInnerHTML: { __html: o ?? "Оставить обращение" }
2790
- }
2791
- ),
2792
- t && /* @__PURE__ */ pe("div", { className: Ce.telegramWrapper, children: [
2793
- /* @__PURE__ */ Z(
2794
- "a",
2795
- {
2796
- className: Ce.telegramLink,
2797
- href: E,
2798
- target: "_blank",
2799
- children: /* @__PURE__ */ pe(
2800
- "div",
2801
- {
2802
- className: Ce.telegram,
2803
- onClick: ee,
2804
- children: [
2805
- /* @__PURE__ */ Z("div", { children: "Подписаться в Telegram" }),
2806
- /* @__PURE__ */ Z(Be, { name: "telegram" })
2807
- ]
2808
- }
2809
- )
2810
- }
2811
- ),
2812
- /* @__PURE__ */ Z("div", { className: Ce.orText, children: "или" })
2813
- ] }),
2814
- !t && /* @__PURE__ */ Z(
2815
- "div",
2816
- {
2817
- className: Ce.description,
2818
- dangerouslySetInnerHTML: {
2819
- __html: te && !t ? "Оставьте номер телефона для получения консультации" : `${/* @__PURE__ */ Z("div", { children: "привет" })}`
2820
- }
2821
- }
2822
- ),
2823
- /* @__PURE__ */ pe("form", { onSubmit: b(fe), children: [
2824
- /* @__PURE__ */ pe(Wr, { className: Ce.inputWrapper, children: [
2825
- /* @__PURE__ */ Z(
2826
- pt,
2827
- {
2828
- width: "full",
2829
- size_s: "large",
2830
- variant: "light",
2831
- placeholder: "Введите имя",
2832
- "data-testid": "modal_name",
2833
- ...a("name", { required: !0, pattern: qr }),
2834
- error: !!P.name
2835
- }
2836
- ),
2837
- i && /* @__PURE__ */ Z(
2838
- _n,
2839
- {
2840
- inputMode: "numeric",
2841
- name: "phone",
2842
- mask: "+7 (999) 999-99-99",
2843
- onChange: A,
2844
- placeholder: "+7 (- - -) - - - - - - -",
2845
- onBlur: j,
2846
- children: /* @__PURE__ */ Z(
2847
- pt,
2848
- {
2849
- width: "full",
2850
- "data-testid": "phone_modal",
2851
- type: "tel",
2852
- size_s: "large",
2853
- variant: "light",
2854
- ...H,
2855
- ...a("phone"),
2856
- error: !!P.phone
2857
- }
2858
- )
2859
- }
2860
- ),
2861
- c && /* @__PURE__ */ Z(
2862
- pt,
2863
- {
2864
- width: "full",
2865
- size_s: "small",
2866
- variant: "light",
2867
- placeholder: "Введите email",
2868
- "data-testid": "modal_email",
2869
- ...a("email", {
2870
- required: I || R && !N,
2871
- pattern: $r
2872
- }),
2873
- error: !!P.email
2874
- }
2875
- ),
2876
- _ && /* @__PURE__ */ Z(
2877
- Ur,
2878
- {
2879
- "data-testid": "modal_textarea",
2880
- placeholder: C,
2881
- rows: K,
2882
- width: "full",
2883
- ...a("textarea")
2884
- }
2885
- ),
2886
- G && !t && ie && /* @__PURE__ */ Z(
2887
- $t,
2888
- {
2889
- "data-testid": "modal_advCheckBox",
2890
- isChecked: ae,
2891
- error: !!P.advCheckBox,
2892
- text: G.text,
2893
- ...a("advCheckBox", { required: G == null ? void 0 : G.isRequired })
2894
- }
2895
- ),
2896
- /* @__PURE__ */ pe(
2897
- $t,
2898
- {
2899
- "data-testid": "modal_personalCheckBox",
2900
- isChecked: X,
2901
- error: !!P.personalCheckBox,
2902
- ...a("personalCheckBox", { required: !t }),
2903
- children: [
2904
- t && /* @__PURE__ */ pe("div", { children: [
2905
- "Согласен(-на)",
2906
- " ",
2907
- /* @__PURE__ */ Z(
2908
- "a",
2909
- {
2910
- className: Ce.linkPolicy,
2911
- href: "/documents/soglasie-na-rassylki",
2912
- children: "получать новости, информацию по сделке и рекламу"
2913
- }
2914
- ),
2915
- " ",
2916
- "от Stone"
2917
- ] }),
2918
- !t && /* @__PURE__ */ pe("div", { children: [
2919
- "Я принимаю условия",
2920
- " ",
2921
- /* @__PURE__ */ Z(
2922
- "a",
2923
- {
2924
- className: Ce.linkPolicy,
2925
- href: "/documents/docs",
2926
- children: "Политики обработки и защиты персональных данных"
2927
- }
2928
- ),
2929
- ", даю согласия на обработку персональных данных"
2930
- ] })
2931
- ]
2932
- }
2933
- ),
2934
- /* @__PURE__ */ Z(
2935
- qe,
2936
- {
2937
- "data-testid": "modal_submit",
2938
- variant: "blue",
2939
- width: "full",
2940
- type: "submit",
2941
- size: "large",
2942
- as: "button",
2943
- additionalClass: Ce.modalBtn,
2944
- disabled: !!P.name || !!P.phone && W || !!P.email && I || !!P.advCheckBox && (G == null ? void 0 : G.isRequired) || !!P.personalCheckBox && !t,
2945
- children: "Отправить запрос"
2946
- }
2947
- )
2948
- ] }),
2949
- /* @__PURE__ */ Z(
2950
- qe,
2951
- {
2952
- additionalClass: Ce.btn,
2953
- onClick: () => r(!1),
2954
- as: "button",
2955
- variant: "gray",
2956
- type: "button",
2957
- size: "small",
2958
- children: /* @__PURE__ */ Z(
2959
- Be,
2960
- {
2961
- name: "close",
2962
- size: "16",
2963
- color: "#141416"
2964
- }
2965
- )
2966
- }
2967
- )
2968
- ] })
2969
- ]
2970
- }
2971
- )
2972
- }
2973
- ) : null;
2974
- }, ei = "_root_7kbqy_1", ti = "_filterWithSaveModal_7kbqy_15", ri = "_modalAddBody_7kbqy_20", ni = "_closeBtn_7kbqy_29", ii = "_btnName_7kbqy_35", ai = "_modalTitle_7kbqy_39", si = "_tabSWitcherWrapper_7kbqy_48", oi = "_switcherTitle_7kbqy_56", li = "_switcherScroll_7kbqy_63", ui = "_tabs_7kbqy_72", ci = "_selectWrapper_7kbqy_77", fi = "_filterOption_7kbqy_81", di = "_btnWrapper_7kbqy_89", vi = "_resetBtn_7kbqy_95", hi = "_saveBtn_7kbqy_96", mi = "_desktopWrapper_7kbqy_100", pi = "_desktopWrapperOpen_7kbqy_123", ce = {
2975
- root: ei,
2976
- filterWithSaveModal: ti,
2977
- modalAddBody: ri,
2978
- closeBtn: ni,
2979
- btnName: ii,
2980
- modalTitle: ai,
2981
- tabSWitcherWrapper: si,
2982
- switcherTitle: oi,
2983
- switcherScroll: li,
2984
- tabs: ui,
2985
- selectWrapper: ci,
2986
- filterOption: fi,
2987
- btnWrapper: di,
2988
- resetBtn: vi,
2989
- saveBtn: hi,
2990
- desktopWrapper: mi,
2991
- desktopWrapperOpen: pi
2992
- };
2993
- var Vr = { exports: {} };
2994
- /*!
2995
- Copyright (c) 2018 Jed Watson.
2996
- Licensed under the MIT License (MIT), see
2997
- http://jedwatson.github.io/classnames
2998
- */
2999
- (function(e) {
3000
- (function() {
3001
- var r = {}.hasOwnProperty;
3002
- function t() {
3003
- for (var i = "", _ = 0; _ < arguments.length; _++) {
3004
- var E = arguments[_];
3005
- E && (i = c(i, o.call(this, E)));
3006
- }
3007
- return i;
3008
- }
3009
- function o(i) {
3010
- if (typeof i == "string" || typeof i == "number")
3011
- return this && this[i] || i;
3012
- if (typeof i != "object")
3013
- return "";
3014
- if (Array.isArray(i))
3015
- return t.apply(this, i);
3016
- if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
3017
- return i.toString();
3018
- var _ = "";
3019
- for (var E in i)
3020
- r.call(i, E) && i[E] && (_ = c(_, this && this[E] || E));
3021
- return _;
3022
- }
3023
- function c(i, _) {
3024
- return _ ? i ? i + " " + _ : i + _ : i;
3025
- }
3026
- e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
3027
- })();
3028
- })(Vr);
3029
- var yi = Vr.exports;
3030
- const gi = /* @__PURE__ */ yr(yi), _i = ({
3031
- selectedTabs: e = [],
3032
- selectedValues: r = [],
3033
- onClickItem: t,
3034
- disabledOptions: o = [],
3035
- tabs: c = [],
3036
- onChange: i,
3037
- setSelectedTabs: _
3038
- }) => {
3039
- const { isMobile: E } = ft(), [W, I] = je(!1), R = mr(null), [C, te] = je(e), [Q] = je(r), [re, K] = je(C), [G, ie] = je(Q), Y = (d) => {
3040
- if (t && t(d), o.some((S) => S.value === d.value))
3041
- return;
3042
- const p = G.some((S) => S.value === d.value) ? G.filter((S) => S.value !== d.value) : [...G, d];
3043
- ie(p);
3044
- }, ne = () => {
3045
- te(c), K(c), ie([]), i && (i([]), _ == null || _(c));
3046
- }, ee = () => {
3047
- ie(r), K(e);
3048
- }, a = () => {
3049
- ee(), I(!1);
3050
- }, b = (d) => {
3051
- d.stopPropagation(), i && (_ == null || _(re), i(G)), I(!1);
3052
- };
3053
- return Tt(() => {
3054
- W || K((d) => JSON.stringify(d) !== JSON.stringify(e) ? e : d);
3055
- }, [W, e]), Tt(() => {
3056
- const d = (p) => {
3057
- if (!R.current)
3058
- return;
3059
- const S = p.target;
3060
- R.current.contains(S) || S.closest("svg") || a();
3061
- };
3062
- return W ? document.addEventListener("click", d) : document.removeEventListener("click", d), () => {
3063
- document.removeEventListener("click", d);
3064
- };
3065
- }, [W]), {
3066
- isMobile: E,
3067
- handleClearClick: ne,
3068
- handleCloseModal: a,
3069
- handleOptionClick: Y,
3070
- handleSaveClick: b,
3071
- localSelectedTabs: re,
3072
- selectedOptions: G,
3073
- setSelectedOptions: ie,
3074
- isModalOpen: W,
3075
- setIsModalOpen: I,
3076
- setLocalSelectedTabs: K,
3077
- containerRef: R
3078
- };
3079
- }, bi = gi.bind(ce), Gi = ({
3080
- disabledOptions: e,
3081
- tabs: r = [],
3082
- selectOptions: t = [],
3083
- onChange: o,
3084
- selectedValues: c,
3085
- setSelectedTabs: i,
3086
- selectedTabs: _,
3087
- onClickItem: E,
3088
- onCLickSelect: W,
3089
- btnName: I = "Фильтр"
3090
- }) => {
3091
- const {
3092
- handleCloseModal: R,
3093
- localSelectedTabs: C,
3094
- selectedOptions: te,
3095
- isMobile: Q,
3096
- handleOptionClick: re,
3097
- handleClearClick: K,
3098
- handleSaveClick: G,
3099
- isModalOpen: ie,
3100
- setLocalSelectedTabs: Y,
3101
- setIsModalOpen: ne,
3102
- containerRef: ee
3103
- } = _i({
3104
- selectedTabs: _,
3105
- onClickItem: E,
3106
- setSelectedTabs: i,
3107
- tabs: r,
3108
- onChange: o,
3109
- disabledOptions: e,
3110
- selectedValues: c
3111
- }), a = () => /* @__PURE__ */ pe(qt, { children: [
3112
- /* @__PURE__ */ Z(
3113
- "div",
3114
- {
3115
- className: ce.closeBtn,
3116
- onClick: () => {
3117
- R();
3118
- },
3119
- children: /* @__PURE__ */ Z(
3120
- Be,
3121
- {
3122
- name: "close",
3123
- size: "24"
3124
- }
3125
- )
3126
- }
3127
- ),
3128
- /* @__PURE__ */ Z("div", { className: ce.modalTitle, children: "Фильтры" }),
3129
- /* @__PURE__ */ pe("div", { className: ce.tabSWitcherWrapper, children: [
3130
- /* @__PURE__ */ Z("div", { className: ce.switcherTitle, children: "Готовность" }),
3131
- /* @__PURE__ */ Z("div", { className: ce.switcherScroll, children: /* @__PURE__ */ Z(
3132
- et,
3133
- {
3134
- variant: "grayRow",
3135
- addClassName: ce.tabs,
3136
- isApart: !0,
3137
- children: r == null ? void 0 : r.map((b, d) => {
3138
- var S;
3139
- const p = b.value;
3140
- return /* @__PURE__ */ Z(
3141
- et.Item,
3142
- {
3143
- itemsLength: r == null ? void 0 : r.length,
3144
- mini: !0,
3145
- size_s: "small",
3146
- value: p,
3147
- onClick: () => {
3148
- },
3149
- checked: ((S = C == null ? void 0 : C.find((P) => P.value === p)) == null ? void 0 : S.state) ?? !1,
3150
- onChange: () => {
3151
- Y == null || Y(
3152
- (P) => P.map((N) => N.value === p ? { ...N, state: !N.state } : N)
3153
- );
3154
- },
3155
- index: d,
3156
- children: p
3157
- },
3158
- d
3159
- );
3160
- })
3161
- }
3162
- ) })
3163
- ] }),
3164
- /* @__PURE__ */ Z("div", { className: ce.selectWrapper, children: t == null ? void 0 : t.map((b, d) => /* @__PURE__ */ Z(
3165
- Ut,
3166
- {
3167
- sizeIcon: "24",
3168
- addClassName: ce.filterOption,
3169
- disabledOptions: [],
3170
- clickableOptions: t == null ? void 0 : t.map((p) => p.value.toString()),
3171
- selectedOptions: te,
3172
- option: b,
3173
- handleOptionClick: re
3174
- },
3175
- d
3176
- )) }),
3177
- /* @__PURE__ */ pe("div", { className: ce.btnWrapper, children: [
3178
- /* @__PURE__ */ Z(
3179
- qe,
3180
- {
3181
- as: "button",
3182
- variant: "gray",
3183
- additionalClass: ce.resetBtn,
3184
- onClick: K,
3185
- children: "Сбросить"
3186
- }
3187
- ),
3188
- /* @__PURE__ */ Z(
3189
- qe,
3190
- {
3191
- as: "button",
3192
- additionalClass: ce.saveBtn,
3193
- onClick: G,
3194
- children: "Сохранить"
3195
- }
3196
- )
3197
- ] })
3198
- ] });
3199
- return /* @__PURE__ */ pe(qt, { children: [
3200
- /* @__PURE__ */ pe("div", { style: { position: "relative" }, children: [
3201
- /* @__PURE__ */ pe(
3202
- "div",
3203
- {
3204
- className: ce.root,
3205
- onClick: () => {
3206
- W && W(), Q ? ne((b) => !b) : ie || ne(!0);
3207
- },
3208
- children: [
3209
- /* @__PURE__ */ Z("div", { className: ce.btnName, children: I }),
3210
- /* @__PURE__ */ Z(
3211
- Be,
3212
- {
3213
- name: "filter",
3214
- size: "16"
3215
- }
3216
- )
3217
- ]
3218
- }
3219
- ),
3220
- !Q && /* @__PURE__ */ pe(
3221
- "div",
3222
- {
3223
- ref: ee,
3224
- className: bi(ce.desktopWrapper, { [ce.desktopWrapperOpen]: ie }),
3225
- children: [
3226
- /* @__PURE__ */ Z(
3227
- "div",
3228
- {
3229
- className: ce.closeBtn,
3230
- onClick: () => {
3231
- R();
3232
- },
3233
- children: /* @__PURE__ */ Z(
3234
- Be,
3235
- {
3236
- name: "close",
3237
- size: "24"
3238
- }
3239
- )
3240
- }
3241
- ),
3242
- /* @__PURE__ */ Z("div", { className: ce.modalTitle, children: "Фильтры" }),
3243
- /* @__PURE__ */ pe("div", { className: ce.tabSWitcherWrapper, children: [
3244
- /* @__PURE__ */ Z("div", { className: ce.switcherTitle, children: "Готовность" }),
3245
- /* @__PURE__ */ Z("div", { className: ce.switcherScroll, children: /* @__PURE__ */ Z(
3246
- et,
3247
- {
3248
- variant: "grayRow",
3249
- addClassName: ce.tabs,
3250
- isApart: !0,
3251
- children: r == null ? void 0 : r.map((b, d) => {
3252
- var S;
3253
- const p = b.value;
3254
- return /* @__PURE__ */ Z(
3255
- et.Item,
3256
- {
3257
- itemsLength: r == null ? void 0 : r.length,
3258
- size_s: "small",
3259
- mini: !0,
3260
- value: p,
3261
- onClick: () => {
3262
- },
3263
- checked: ((S = C == null ? void 0 : C.find((P) => P.value === p)) == null ? void 0 : S.state) ?? !1,
3264
- onChange: () => {
3265
- Y == null || Y(
3266
- (P) => P.map((N) => N.value === p ? { ...N, state: !N.state } : N)
3267
- );
3268
- },
3269
- index: d,
3270
- addItemClassName: ce.tabSwitcher,
3271
- children: p
3272
- },
3273
- d
3274
- );
3275
- })
3276
- }
3277
- ) })
3278
- ] }),
3279
- /* @__PURE__ */ Z("div", { className: ce.selectWrapper, children: t == null ? void 0 : t.map((b, d) => /* @__PURE__ */ Z(
3280
- Ut,
3281
- {
3282
- sizeIcon: "24",
3283
- addClassName: ce.filterOption,
3284
- disabledOptions: [],
3285
- clickableOptions: t == null ? void 0 : t.map((p) => p.value.toString()),
3286
- selectedOptions: te,
3287
- option: b,
3288
- handleOptionClick: re
3289
- },
3290
- d
3291
- )) }),
3292
- /* @__PURE__ */ pe("div", { className: ce.btnWrapper, children: [
3293
- /* @__PURE__ */ Z(
3294
- qe,
3295
- {
3296
- as: "button",
3297
- variant: "gray",
3298
- additionalClass: ce.resetBtn,
3299
- onClick: K,
3300
- children: "Сбросить"
3301
- }
3302
- ),
3303
- /* @__PURE__ */ Z(
3304
- qe,
3305
- {
3306
- as: "button",
3307
- additionalClass: ce.saveBtn,
3308
- onClick: G,
3309
- children: "Сохранить"
3310
- }
3311
- )
3312
- ] })
3313
- ]
3314
- }
3315
- )
3316
- ] }),
3317
- Q && /* @__PURE__ */ Z(
3318
- Ft,
3319
- {
3320
- isOpen: ie,
3321
- emitIsOpen: ne,
3322
- isTransparentBack: !0,
3323
- additionalClassModalBody: ce.modalAddBody,
3324
- additionalClass: ce.filterWithSaveModal,
3325
- children: /* @__PURE__ */ Z(a, {})
3326
- }
3327
- )
3328
- ] });
3329
- };
3330
- export {
3331
- Gi as F,
3332
- Zi as M,
3333
- et as S,
3334
- un as a,
3335
- _i as u
3336
- };