@kvell-group/ui 1.8.3 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +0 -0
  2. package/dist/Text.module-R-XLggXY.js +8 -0
  3. package/dist/assets/CardInput.css +1 -0
  4. package/dist/assets/Text.css +1 -0
  5. package/dist/components/Button/Button.js +9 -592
  6. package/dist/components/CardInput/CardInput.d.ts +145 -0
  7. package/dist/components/CardInput/CardInput.js +3223 -0
  8. package/dist/components/CardInput/index.d.ts +1 -0
  9. package/dist/components/CardInput/index.js +4 -0
  10. package/dist/components/CardInput/useCardLogo.d.ts +1 -0
  11. package/dist/components/CardInput/useCardLogo.js +47 -0
  12. package/dist/components/MainProvider/MantineProvider.js +9 -425
  13. package/dist/components/Text/Text.d.ts +9 -0
  14. package/dist/components/Text/Text.js +13 -0
  15. package/dist/components/Text/index.d.ts +1 -0
  16. package/dist/components/Text/index.js +4 -0
  17. package/dist/components/theme.js +40 -25
  18. package/dist/main.d.ts +3 -1
  19. package/dist/main.js +13 -46
  20. package/package.json +10 -10
  21. package/dist/MantineThemeProvider-kHsOfZUW.js +0 -705
  22. package/dist/Text-B8e4XllM.js +0 -80
  23. package/dist/assets/TypographyBodySMedium.css +0 -1
  24. package/dist/assets/TypographyCaptionLMedium.css +0 -1
  25. package/dist/components/Typography/TypographyBodySMedium.d.ts +0 -2
  26. package/dist/components/Typography/TypographyBodySMedium.js +0 -14
  27. package/dist/components/Typography/TypographyCaptionLMedium.d.ts +0 -2
  28. package/dist/components/Typography/TypographyCaptionLMedium.js +0 -14
  29. package/dist/components/Typography/types.d.ts +0 -5
  30. package/dist/components/Typography/types.js +0 -1
  31. package/dist/polymorphic-factory-DUeudAZR.js +0 -767
@@ -0,0 +1,3223 @@
1
+ import { jsx as wt } from "react/jsx-runtime";
2
+ import { InputBase as ue } from "@mantine/core";
3
+ import * as Dt from "react";
4
+ import X from "react";
5
+ import { c as oe } from "../../Text.module-R-XLggXY.js";
6
+ import { useCardLogo as le } from "./useCardLogo.js";
7
+ import '../../assets/CardInput.css';function G(a) {
8
+ return typeof a == "string" || a instanceof String;
9
+ }
10
+ function Vt(a) {
11
+ var t;
12
+ return typeof a == "object" && a != null && (a == null || (t = a.constructor) == null ? void 0 : t.name) === "Object";
13
+ }
14
+ function Wt(a, t) {
15
+ return Array.isArray(t) ? Wt(a, (e, s) => t.includes(s)) : Object.entries(a).reduce((e, s) => {
16
+ let [r, i] = s;
17
+ return t(i, r) && (e[r] = i), e;
18
+ }, {});
19
+ }
20
+ const m = {
21
+ NONE: "NONE",
22
+ LEFT: "LEFT",
23
+ FORCE_LEFT: "FORCE_LEFT",
24
+ RIGHT: "RIGHT",
25
+ FORCE_RIGHT: "FORCE_RIGHT"
26
+ };
27
+ function he(a) {
28
+ switch (a) {
29
+ case m.LEFT:
30
+ return m.FORCE_LEFT;
31
+ case m.RIGHT:
32
+ return m.FORCE_RIGHT;
33
+ default:
34
+ return a;
35
+ }
36
+ }
37
+ function Ct(a) {
38
+ return a.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
39
+ }
40
+ function ot(a, t) {
41
+ if (t === a) return !0;
42
+ const e = Array.isArray(t), s = Array.isArray(a);
43
+ let r;
44
+ if (e && s) {
45
+ if (t.length != a.length) return !1;
46
+ for (r = 0; r < t.length; r++) if (!ot(t[r], a[r])) return !1;
47
+ return !0;
48
+ }
49
+ if (e != s) return !1;
50
+ if (t && a && typeof t == "object" && typeof a == "object") {
51
+ const i = t instanceof Date, n = a instanceof Date;
52
+ if (i && n) return t.getTime() == a.getTime();
53
+ if (i != n) return !1;
54
+ const u = t instanceof RegExp, l = a instanceof RegExp;
55
+ if (u && l) return t.toString() == a.toString();
56
+ if (u != l) return !1;
57
+ const h = Object.keys(t);
58
+ for (r = 0; r < h.length; r++) if (!Object.prototype.hasOwnProperty.call(a, h[r])) return !1;
59
+ for (r = 0; r < h.length; r++) if (!ot(a[h[r]], t[h[r]])) return !1;
60
+ return !0;
61
+ } else if (t && a && typeof t == "function" && typeof a == "function")
62
+ return t.toString() === a.toString();
63
+ return !1;
64
+ }
65
+ class pe {
66
+ /** Current input value */
67
+ /** Current cursor position */
68
+ /** Old input value */
69
+ /** Old selection */
70
+ constructor(t) {
71
+ for (Object.assign(this, t); this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); )
72
+ --this.oldSelection.start;
73
+ if (this.insertedCount)
74
+ for (; this.value.slice(this.cursorPos) !== this.oldValue.slice(this.oldSelection.end); )
75
+ this.value.length - this.cursorPos < this.oldValue.length - this.oldSelection.end ? ++this.oldSelection.end : ++this.cursorPos;
76
+ }
77
+ /** Start changing position */
78
+ get startChangePos() {
79
+ return Math.min(this.cursorPos, this.oldSelection.start);
80
+ }
81
+ /** Inserted symbols count */
82
+ get insertedCount() {
83
+ return this.cursorPos - this.startChangePos;
84
+ }
85
+ /** Inserted symbols */
86
+ get inserted() {
87
+ return this.value.substr(this.startChangePos, this.insertedCount);
88
+ }
89
+ /** Removed symbols count */
90
+ get removedCount() {
91
+ return Math.max(this.oldSelection.end - this.startChangePos || // for Delete
92
+ this.oldValue.length - this.value.length, 0);
93
+ }
94
+ /** Removed symbols */
95
+ get removed() {
96
+ return this.oldValue.substr(this.startChangePos, this.removedCount);
97
+ }
98
+ /** Unchanged head symbols */
99
+ get head() {
100
+ return this.value.substring(0, this.startChangePos);
101
+ }
102
+ /** Unchanged tail symbols */
103
+ get tail() {
104
+ return this.value.substring(this.startChangePos + this.insertedCount);
105
+ }
106
+ /** Remove direction */
107
+ get removeDirection() {
108
+ return !this.removedCount || this.insertedCount ? m.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
109
+ this.oldSelection.end === this.oldSelection.start ? m.RIGHT : m.LEFT;
110
+ }
111
+ }
112
+ function g(a, t) {
113
+ return new g.InputMask(a, t);
114
+ }
115
+ function Zt(a) {
116
+ if (a == null) throw new Error("mask property should be defined");
117
+ return a instanceof RegExp ? g.MaskedRegExp : G(a) ? g.MaskedPattern : a === Date ? g.MaskedDate : a === Number ? g.MaskedNumber : Array.isArray(a) || a === Array ? g.MaskedDynamic : g.Masked && a.prototype instanceof g.Masked ? a : g.Masked && a instanceof g.Masked ? a.constructor : a instanceof Function ? g.MaskedFunction : (console.warn("Mask not found for mask", a), g.Masked);
118
+ }
119
+ function et(a) {
120
+ if (!a) throw new Error("Options in not defined");
121
+ if (g.Masked) {
122
+ if (a.prototype instanceof g.Masked) return {
123
+ mask: a
124
+ };
125
+ const {
126
+ mask: t = void 0,
127
+ ...e
128
+ } = a instanceof g.Masked ? {
129
+ mask: a
130
+ } : Vt(a) && a.mask instanceof g.Masked ? a : {};
131
+ if (t) {
132
+ const s = t.mask;
133
+ return {
134
+ ...Wt(t, (r, i) => !i.startsWith("_")),
135
+ mask: t.constructor,
136
+ _mask: s,
137
+ ...e
138
+ };
139
+ }
140
+ }
141
+ return Vt(a) ? {
142
+ ...a
143
+ } : {
144
+ mask: a
145
+ };
146
+ }
147
+ function K(a) {
148
+ if (g.Masked && a instanceof g.Masked) return a;
149
+ const t = et(a), e = Zt(t.mask);
150
+ if (!e) throw new Error("Masked class is not found for provided mask " + t.mask + ", appropriate module needs to be imported manually before creating mask.");
151
+ return t.mask === e && delete t.mask, t._mask && (t.mask = t._mask, delete t._mask), new e(t);
152
+ }
153
+ g.createMask = K;
154
+ class Mt {
155
+ /** */
156
+ /** */
157
+ /** */
158
+ /** Safely returns selection start */
159
+ get selectionStart() {
160
+ let t;
161
+ try {
162
+ t = this._unsafeSelectionStart;
163
+ } catch {
164
+ }
165
+ return t ?? this.value.length;
166
+ }
167
+ /** Safely returns selection end */
168
+ get selectionEnd() {
169
+ let t;
170
+ try {
171
+ t = this._unsafeSelectionEnd;
172
+ } catch {
173
+ }
174
+ return t ?? this.value.length;
175
+ }
176
+ /** Safely sets element selection */
177
+ select(t, e) {
178
+ if (!(t == null || e == null || t === this.selectionStart && e === this.selectionEnd))
179
+ try {
180
+ this._unsafeSelect(t, e);
181
+ } catch {
182
+ }
183
+ }
184
+ /** */
185
+ get isActive() {
186
+ return !1;
187
+ }
188
+ /** */
189
+ /** */
190
+ /** */
191
+ }
192
+ g.MaskElement = Mt;
193
+ const Pt = 90, ce = 89;
194
+ class ht extends Mt {
195
+ /** HTMLElement to use mask on */
196
+ constructor(t) {
197
+ super(), this.input = t, this._onKeydown = this._onKeydown.bind(this), this._onInput = this._onInput.bind(this), this._onBeforeinput = this._onBeforeinput.bind(this), this._onCompositionEnd = this._onCompositionEnd.bind(this);
198
+ }
199
+ get rootElement() {
200
+ var t, e, s;
201
+ return (t = (e = (s = this.input).getRootNode) == null ? void 0 : e.call(s)) != null ? t : document;
202
+ }
203
+ /** Is element in focus */
204
+ get isActive() {
205
+ return this.input === this.rootElement.activeElement;
206
+ }
207
+ /** Binds HTMLElement events to mask internal events */
208
+ bindEvents(t) {
209
+ this.input.addEventListener("keydown", this._onKeydown), this.input.addEventListener("input", this._onInput), this.input.addEventListener("beforeinput", this._onBeforeinput), this.input.addEventListener("compositionend", this._onCompositionEnd), this.input.addEventListener("drop", t.drop), this.input.addEventListener("click", t.click), this.input.addEventListener("focus", t.focus), this.input.addEventListener("blur", t.commit), this._handlers = t;
210
+ }
211
+ _onKeydown(t) {
212
+ if (this._handlers.redo && (t.keyCode === Pt && t.shiftKey && (t.metaKey || t.ctrlKey) || t.keyCode === ce && t.ctrlKey))
213
+ return t.preventDefault(), this._handlers.redo(t);
214
+ if (this._handlers.undo && t.keyCode === Pt && (t.metaKey || t.ctrlKey))
215
+ return t.preventDefault(), this._handlers.undo(t);
216
+ t.isComposing || this._handlers.selectionChange(t);
217
+ }
218
+ _onBeforeinput(t) {
219
+ if (t.inputType === "historyUndo" && this._handlers.undo)
220
+ return t.preventDefault(), this._handlers.undo(t);
221
+ if (t.inputType === "historyRedo" && this._handlers.redo)
222
+ return t.preventDefault(), this._handlers.redo(t);
223
+ }
224
+ _onCompositionEnd(t) {
225
+ this._handlers.input(t);
226
+ }
227
+ _onInput(t) {
228
+ t.isComposing || this._handlers.input(t);
229
+ }
230
+ /** Unbinds HTMLElement events to mask internal events */
231
+ unbindEvents() {
232
+ this.input.removeEventListener("keydown", this._onKeydown), this.input.removeEventListener("input", this._onInput), this.input.removeEventListener("beforeinput", this._onBeforeinput), this.input.removeEventListener("compositionend", this._onCompositionEnd), this.input.removeEventListener("drop", this._handlers.drop), this.input.removeEventListener("click", this._handlers.click), this.input.removeEventListener("focus", this._handlers.focus), this.input.removeEventListener("blur", this._handlers.commit), this._handlers = {};
233
+ }
234
+ }
235
+ g.HTMLMaskElement = ht;
236
+ class de extends ht {
237
+ /** InputElement to use mask on */
238
+ constructor(t) {
239
+ super(t), this.input = t;
240
+ }
241
+ /** Returns InputElement selection start */
242
+ get _unsafeSelectionStart() {
243
+ return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;
244
+ }
245
+ /** Returns InputElement selection end */
246
+ get _unsafeSelectionEnd() {
247
+ return this.input.selectionEnd;
248
+ }
249
+ /** Sets InputElement selection */
250
+ _unsafeSelect(t, e) {
251
+ this.input.setSelectionRange(t, e);
252
+ }
253
+ get value() {
254
+ return this.input.value;
255
+ }
256
+ set value(t) {
257
+ this.input.value = t;
258
+ }
259
+ }
260
+ g.HTMLMaskElement = ht;
261
+ class Xt extends ht {
262
+ /** Returns HTMLElement selection start */
263
+ get _unsafeSelectionStart() {
264
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, r = e && e.focusOffset;
265
+ return r == null || s == null || s < r ? s : r;
266
+ }
267
+ /** Returns HTMLElement selection end */
268
+ get _unsafeSelectionEnd() {
269
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, r = e && e.focusOffset;
270
+ return r == null || s == null || s > r ? s : r;
271
+ }
272
+ /** Sets HTMLElement selection */
273
+ _unsafeSelect(t, e) {
274
+ if (!this.rootElement.createRange) return;
275
+ const s = this.rootElement.createRange();
276
+ s.setStart(this.input.firstChild || this.input, t), s.setEnd(this.input.lastChild || this.input, e);
277
+ const r = this.rootElement, i = r.getSelection && r.getSelection();
278
+ i && (i.removeAllRanges(), i.addRange(s));
279
+ }
280
+ /** HTMLElement value */
281
+ get value() {
282
+ return this.input.textContent || "";
283
+ }
284
+ set value(t) {
285
+ this.input.textContent = t;
286
+ }
287
+ }
288
+ g.HTMLContenteditableMaskElement = Xt;
289
+ class pt {
290
+ constructor() {
291
+ this.states = [], this.currentIndex = 0;
292
+ }
293
+ get currentState() {
294
+ return this.states[this.currentIndex];
295
+ }
296
+ get isEmpty() {
297
+ return this.states.length === 0;
298
+ }
299
+ push(t) {
300
+ this.currentIndex < this.states.length - 1 && (this.states.length = this.currentIndex + 1), this.states.push(t), this.states.length > pt.MAX_LENGTH && this.states.shift(), this.currentIndex = this.states.length - 1;
301
+ }
302
+ go(t) {
303
+ return this.currentIndex = Math.min(Math.max(this.currentIndex + t, 0), this.states.length - 1), this.currentState;
304
+ }
305
+ undo() {
306
+ return this.go(-1);
307
+ }
308
+ redo() {
309
+ return this.go(1);
310
+ }
311
+ clear() {
312
+ this.states.length = 0, this.currentIndex = 0;
313
+ }
314
+ }
315
+ pt.MAX_LENGTH = 100;
316
+ class fe {
317
+ /**
318
+ View element
319
+ */
320
+ /** Internal {@link Masked} model */
321
+ constructor(t, e) {
322
+ this.el = t instanceof Mt ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new Xt(t) : new de(t), this.masked = K(e), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._rawInputValue = "", this.history = new pt(), this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this._onUndo = this._onUndo.bind(this), this._onRedo = this._onRedo.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange();
323
+ }
324
+ maskEquals(t) {
325
+ var e;
326
+ return t == null || ((e = this.masked) == null ? void 0 : e.maskEquals(t));
327
+ }
328
+ /** Masked */
329
+ get mask() {
330
+ return this.masked.mask;
331
+ }
332
+ set mask(t) {
333
+ if (this.maskEquals(t)) return;
334
+ if (!(t instanceof g.Masked) && this.masked.constructor === Zt(t)) {
335
+ this.masked.updateOptions({
336
+ mask: t
337
+ });
338
+ return;
339
+ }
340
+ const e = t instanceof g.Masked ? t : K({
341
+ mask: t
342
+ });
343
+ e.unmaskedValue = this.masked.unmaskedValue, this.masked = e;
344
+ }
345
+ /** Raw value */
346
+ get value() {
347
+ return this._value;
348
+ }
349
+ set value(t) {
350
+ this.value !== t && (this.masked.value = t, this.updateControl("auto"));
351
+ }
352
+ /** Unmasked value */
353
+ get unmaskedValue() {
354
+ return this._unmaskedValue;
355
+ }
356
+ set unmaskedValue(t) {
357
+ this.unmaskedValue !== t && (this.masked.unmaskedValue = t, this.updateControl("auto"));
358
+ }
359
+ /** Raw input value */
360
+ get rawInputValue() {
361
+ return this._rawInputValue;
362
+ }
363
+ set rawInputValue(t) {
364
+ this.rawInputValue !== t && (this.masked.rawInputValue = t, this.updateControl(), this.alignCursor());
365
+ }
366
+ /** Typed unmasked value */
367
+ get typedValue() {
368
+ return this.masked.typedValue;
369
+ }
370
+ set typedValue(t) {
371
+ this.masked.typedValueEquals(t) || (this.masked.typedValue = t, this.updateControl("auto"));
372
+ }
373
+ /** Display value */
374
+ get displayValue() {
375
+ return this.masked.displayValue;
376
+ }
377
+ /** Starts listening to element events */
378
+ _bindEvents() {
379
+ this.el.bindEvents({
380
+ selectionChange: this._saveSelection,
381
+ input: this._onInput,
382
+ drop: this._onDrop,
383
+ click: this._onClick,
384
+ focus: this._onFocus,
385
+ commit: this._onChange,
386
+ undo: this._onUndo,
387
+ redo: this._onRedo
388
+ });
389
+ }
390
+ /** Stops listening to element events */
391
+ _unbindEvents() {
392
+ this.el && this.el.unbindEvents();
393
+ }
394
+ /** Fires custom event */
395
+ _fireEvent(t, e) {
396
+ const s = this._listeners[t];
397
+ s && s.forEach((r) => r(e));
398
+ }
399
+ /** Current selection start */
400
+ get selectionStart() {
401
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;
402
+ }
403
+ /** Current cursor position */
404
+ get cursorPos() {
405
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;
406
+ }
407
+ set cursorPos(t) {
408
+ !this.el || !this.el.isActive || (this.el.select(t, t), this._saveSelection());
409
+ }
410
+ /** Stores current selection */
411
+ _saveSelection() {
412
+ this.displayValue !== this.el.value && console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."), this._selection = {
413
+ start: this.selectionStart,
414
+ end: this.cursorPos
415
+ };
416
+ }
417
+ /** Syncronizes model value from view */
418
+ updateValue() {
419
+ this.masked.value = this.el.value, this._value = this.masked.value, this._unmaskedValue = this.masked.unmaskedValue, this._rawInputValue = this.masked.rawInputValue;
420
+ }
421
+ /** Syncronizes view from model value, fires change events */
422
+ updateControl(t) {
423
+ const e = this.masked.unmaskedValue, s = this.masked.value, r = this.masked.rawInputValue, i = this.displayValue, n = this.unmaskedValue !== e || this.value !== s || this._rawInputValue !== r;
424
+ this._unmaskedValue = e, this._value = s, this._rawInputValue = r, this.el.value !== i && (this.el.value = i), t === "auto" ? this.alignCursor() : t != null && (this.cursorPos = t), n && this._fireChangeEvents(), !this._historyChanging && (n || this.history.isEmpty) && this.history.push({
425
+ unmaskedValue: e,
426
+ selection: {
427
+ start: this.selectionStart,
428
+ end: this.cursorPos
429
+ }
430
+ });
431
+ }
432
+ /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */
433
+ updateOptions(t) {
434
+ const {
435
+ mask: e,
436
+ ...s
437
+ } = t, r = !this.maskEquals(e), i = this.masked.optionsIsChanged(s);
438
+ r && (this.mask = e), i && this.masked.updateOptions(s), (r || i) && this.updateControl();
439
+ }
440
+ /** Updates cursor */
441
+ updateCursor(t) {
442
+ t != null && (this.cursorPos = t, this._delayUpdateCursor(t));
443
+ }
444
+ /** Delays cursor update to support mobile browsers */
445
+ _delayUpdateCursor(t) {
446
+ this._abortUpdateCursor(), this._changingCursorPos = t, this._cursorChanging = setTimeout(() => {
447
+ this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor());
448
+ }, 10);
449
+ }
450
+ /** Fires custom events */
451
+ _fireChangeEvents() {
452
+ this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent);
453
+ }
454
+ /** Aborts delayed cursor update */
455
+ _abortUpdateCursor() {
456
+ this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging);
457
+ }
458
+ /** Aligns cursor to nearest available position */
459
+ alignCursor() {
460
+ this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, m.LEFT));
461
+ }
462
+ /** Aligns cursor only if selection is empty */
463
+ alignCursorFriendly() {
464
+ this.selectionStart === this.cursorPos && this.alignCursor();
465
+ }
466
+ /** Adds listener on custom event */
467
+ on(t, e) {
468
+ return this._listeners[t] || (this._listeners[t] = []), this._listeners[t].push(e), this;
469
+ }
470
+ /** Removes custom event listener */
471
+ off(t, e) {
472
+ if (!this._listeners[t]) return this;
473
+ if (!e)
474
+ return delete this._listeners[t], this;
475
+ const s = this._listeners[t].indexOf(e);
476
+ return s >= 0 && this._listeners[t].splice(s, 1), this;
477
+ }
478
+ /** Handles view input event */
479
+ _onInput(t) {
480
+ this._inputEvent = t, this._abortUpdateCursor();
481
+ const e = new pe({
482
+ // new state
483
+ value: this.el.value,
484
+ cursorPos: this.cursorPos,
485
+ // old state
486
+ oldValue: this.displayValue,
487
+ oldSelection: this._selection
488
+ }), s = this.masked.rawInputValue, r = this.masked.splice(e.startChangePos, e.removed.length, e.inserted, e.removeDirection, {
489
+ input: !0,
490
+ raw: !0
491
+ }).offset, i = s === this.masked.rawInputValue ? e.removeDirection : m.NONE;
492
+ let n = this.masked.nearestInputPos(e.startChangePos + r, i);
493
+ i !== m.NONE && (n = this.masked.nearestInputPos(n, m.NONE)), this.updateControl(n), delete this._inputEvent;
494
+ }
495
+ /** Handles view change event and commits model value */
496
+ _onChange() {
497
+ this.displayValue !== this.el.value && this.updateValue(), this.masked.doCommit(), this.updateControl(), this._saveSelection();
498
+ }
499
+ /** Handles view drop event, prevents by default */
500
+ _onDrop(t) {
501
+ t.preventDefault(), t.stopPropagation();
502
+ }
503
+ /** Restore last selection on focus */
504
+ _onFocus(t) {
505
+ this.alignCursorFriendly();
506
+ }
507
+ /** Restore last selection on focus */
508
+ _onClick(t) {
509
+ this.alignCursorFriendly();
510
+ }
511
+ _onUndo() {
512
+ this._applyHistoryState(this.history.undo());
513
+ }
514
+ _onRedo() {
515
+ this._applyHistoryState(this.history.redo());
516
+ }
517
+ _applyHistoryState(t) {
518
+ t && (this._historyChanging = !0, this.unmaskedValue = t.unmaskedValue, this.el.select(t.selection.start, t.selection.end), this._saveSelection(), this._historyChanging = !1);
519
+ }
520
+ /** Unbind view events and removes element reference */
521
+ destroy() {
522
+ this._unbindEvents(), this._listeners.length = 0, delete this.el;
523
+ }
524
+ }
525
+ g.InputMask = fe;
526
+ class E {
527
+ /** Inserted symbols */
528
+ /** Additional offset if any changes occurred before tail */
529
+ /** Raw inserted is used by dynamic mask */
530
+ /** Can skip chars */
531
+ static normalize(t) {
532
+ return Array.isArray(t) ? t : [t, new E()];
533
+ }
534
+ constructor(t) {
535
+ Object.assign(this, {
536
+ inserted: "",
537
+ rawInserted: "",
538
+ tailShift: 0,
539
+ skip: !1
540
+ }, t);
541
+ }
542
+ /** Aggregate changes */
543
+ aggregate(t) {
544
+ return this.inserted += t.inserted, this.rawInserted += t.rawInserted, this.tailShift += t.tailShift, this.skip = this.skip || t.skip, this;
545
+ }
546
+ /** Total offset considering all changes */
547
+ get offset() {
548
+ return this.tailShift + this.inserted.length;
549
+ }
550
+ get consumed() {
551
+ return !!this.rawInserted || this.skip;
552
+ }
553
+ equals(t) {
554
+ return this.inserted === t.inserted && this.tailShift === t.tailShift && this.rawInserted === t.rawInserted && this.skip === t.skip;
555
+ }
556
+ }
557
+ g.ChangeDetails = E;
558
+ class H {
559
+ /** Tail value as string */
560
+ /** Tail start position */
561
+ /** Start position */
562
+ constructor(t, e, s) {
563
+ t === void 0 && (t = ""), e === void 0 && (e = 0), this.value = t, this.from = e, this.stop = s;
564
+ }
565
+ toString() {
566
+ return this.value;
567
+ }
568
+ extend(t) {
569
+ this.value += String(t);
570
+ }
571
+ appendTo(t) {
572
+ return t.append(this.toString(), {
573
+ tail: !0
574
+ }).aggregate(t._appendPlaceholder());
575
+ }
576
+ get state() {
577
+ return {
578
+ value: this.value,
579
+ from: this.from,
580
+ stop: this.stop
581
+ };
582
+ }
583
+ set state(t) {
584
+ Object.assign(this, t);
585
+ }
586
+ unshift(t) {
587
+ if (!this.value.length || t != null && this.from >= t) return "";
588
+ const e = this.value[0];
589
+ return this.value = this.value.slice(1), e;
590
+ }
591
+ shift() {
592
+ if (!this.value.length) return "";
593
+ const t = this.value[this.value.length - 1];
594
+ return this.value = this.value.slice(0, -1), t;
595
+ }
596
+ }
597
+ class P {
598
+ /** */
599
+ /** */
600
+ /** Transforms value before mask processing */
601
+ /** Transforms each char before mask processing */
602
+ /** Validates if value is acceptable */
603
+ /** Does additional processing at the end of editing */
604
+ /** Format typed value to string */
605
+ /** Parse string to get typed value */
606
+ /** Enable characters overwriting */
607
+ /** */
608
+ /** */
609
+ /** */
610
+ /** */
611
+ constructor(t) {
612
+ this._value = "", this._update({
613
+ ...P.DEFAULTS,
614
+ ...t
615
+ }), this._initialized = !0;
616
+ }
617
+ /** Sets and applies new options */
618
+ updateOptions(t) {
619
+ this.optionsIsChanged(t) && this.withValueRefresh(this._update.bind(this, t));
620
+ }
621
+ /** Sets new options */
622
+ _update(t) {
623
+ Object.assign(this, t);
624
+ }
625
+ /** Mask state */
626
+ get state() {
627
+ return {
628
+ _value: this.value,
629
+ _rawInputValue: this.rawInputValue
630
+ };
631
+ }
632
+ set state(t) {
633
+ this._value = t._value;
634
+ }
635
+ /** Resets value */
636
+ reset() {
637
+ this._value = "";
638
+ }
639
+ get value() {
640
+ return this._value;
641
+ }
642
+ set value(t) {
643
+ this.resolve(t, {
644
+ input: !0
645
+ });
646
+ }
647
+ /** Resolve new value */
648
+ resolve(t, e) {
649
+ e === void 0 && (e = {
650
+ input: !0
651
+ }), this.reset(), this.append(t, e, ""), this.doCommit();
652
+ }
653
+ get unmaskedValue() {
654
+ return this.value;
655
+ }
656
+ set unmaskedValue(t) {
657
+ this.resolve(t, {});
658
+ }
659
+ get typedValue() {
660
+ return this.parse ? this.parse(this.value, this) : this.unmaskedValue;
661
+ }
662
+ set typedValue(t) {
663
+ this.format ? this.value = this.format(t, this) : this.unmaskedValue = String(t);
664
+ }
665
+ /** Value that includes raw user input */
666
+ get rawInputValue() {
667
+ return this.extractInput(0, this.displayValue.length, {
668
+ raw: !0
669
+ });
670
+ }
671
+ set rawInputValue(t) {
672
+ this.resolve(t, {
673
+ raw: !0
674
+ });
675
+ }
676
+ get displayValue() {
677
+ return this.value;
678
+ }
679
+ get isComplete() {
680
+ return !0;
681
+ }
682
+ get isFilled() {
683
+ return this.isComplete;
684
+ }
685
+ /** Finds nearest input position in direction */
686
+ nearestInputPos(t, e) {
687
+ return t;
688
+ }
689
+ totalInputPositions(t, e) {
690
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), Math.min(this.displayValue.length, e - t);
691
+ }
692
+ /** Extracts value in range considering flags */
693
+ extractInput(t, e, s) {
694
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this.displayValue.slice(t, e);
695
+ }
696
+ /** Extracts tail in range */
697
+ extractTail(t, e) {
698
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new H(this.extractInput(t, e), t);
699
+ }
700
+ /** Appends tail */
701
+ appendTail(t) {
702
+ return G(t) && (t = new H(String(t))), t.appendTo(this);
703
+ }
704
+ /** Appends char */
705
+ _appendCharRaw(t, e) {
706
+ return t ? (this._value += t, new E({
707
+ inserted: t,
708
+ rawInserted: t
709
+ })) : new E();
710
+ }
711
+ /** Appends char */
712
+ _appendChar(t, e, s) {
713
+ e === void 0 && (e = {});
714
+ const r = this.state;
715
+ let i;
716
+ if ([t, i] = this.doPrepareChar(t, e), t && (i = i.aggregate(this._appendCharRaw(t, e)), !i.rawInserted && this.autofix === "pad")) {
717
+ const n = this.state;
718
+ this.state = r;
719
+ let u = this.pad(e);
720
+ const l = this._appendCharRaw(t, e);
721
+ u = u.aggregate(l), l.rawInserted || u.equals(i) ? i = u : this.state = n;
722
+ }
723
+ if (i.inserted) {
724
+ let n, u = this.doValidate(e) !== !1;
725
+ if (u && s != null) {
726
+ const l = this.state;
727
+ if (this.overwrite === !0) {
728
+ n = s.state;
729
+ for (let v = 0; v < i.rawInserted.length; ++v)
730
+ s.unshift(this.displayValue.length - i.tailShift);
731
+ }
732
+ let h = this.appendTail(s);
733
+ if (u = h.rawInserted.length === s.toString().length, !(u && h.inserted) && this.overwrite === "shift") {
734
+ this.state = l, n = s.state;
735
+ for (let v = 0; v < i.rawInserted.length; ++v)
736
+ s.shift();
737
+ h = this.appendTail(s), u = h.rawInserted.length === s.toString().length;
738
+ }
739
+ u && h.inserted && (this.state = l);
740
+ }
741
+ u || (i = new E(), this.state = r, s && n && (s.state = n));
742
+ }
743
+ return i;
744
+ }
745
+ /** Appends optional placeholder at the end */
746
+ _appendPlaceholder() {
747
+ return new E();
748
+ }
749
+ /** Appends optional eager placeholder at the end */
750
+ _appendEager() {
751
+ return new E();
752
+ }
753
+ /** Appends symbols considering flags */
754
+ append(t, e, s) {
755
+ if (!G(t)) throw new Error("value should be string");
756
+ const r = G(s) ? new H(String(s)) : s;
757
+ e != null && e.tail && (e._beforeTailState = this.state);
758
+ let i;
759
+ [t, i] = this.doPrepare(t, e);
760
+ for (let n = 0; n < t.length; ++n) {
761
+ const u = this._appendChar(t[n], e, r);
762
+ if (!u.rawInserted && !this.doSkipInvalid(t[n], e, r)) break;
763
+ i.aggregate(u);
764
+ }
765
+ return (this.eager === !0 || this.eager === "append") && e != null && e.input && t && i.aggregate(this._appendEager()), r != null && (i.tailShift += this.appendTail(r).tailShift), i;
766
+ }
767
+ remove(t, e) {
768
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this._value = this.displayValue.slice(0, t) + this.displayValue.slice(e), new E();
769
+ }
770
+ /** Calls function and reapplies current value */
771
+ withValueRefresh(t) {
772
+ if (this._refreshing || !this._initialized) return t();
773
+ this._refreshing = !0;
774
+ const e = this.rawInputValue, s = this.value, r = t();
775
+ return this.rawInputValue = e, this.value && this.value !== s && s.indexOf(this.value) === 0 && (this.append(s.slice(this.displayValue.length), {}, ""), this.doCommit()), delete this._refreshing, r;
776
+ }
777
+ runIsolated(t) {
778
+ if (this._isolated || !this._initialized) return t(this);
779
+ this._isolated = !0;
780
+ const e = this.state, s = t(this);
781
+ return this.state = e, delete this._isolated, s;
782
+ }
783
+ doSkipInvalid(t, e, s) {
784
+ return !!this.skipInvalid;
785
+ }
786
+ /** Prepares string before mask processing */
787
+ doPrepare(t, e) {
788
+ return e === void 0 && (e = {}), E.normalize(this.prepare ? this.prepare(t, this, e) : t);
789
+ }
790
+ /** Prepares each char before mask processing */
791
+ doPrepareChar(t, e) {
792
+ return e === void 0 && (e = {}), E.normalize(this.prepareChar ? this.prepareChar(t, this, e) : t);
793
+ }
794
+ /** Validates if value is acceptable */
795
+ doValidate(t) {
796
+ return (!this.validate || this.validate(this.value, this, t)) && (!this.parent || this.parent.doValidate(t));
797
+ }
798
+ /** Does additional processing at the end of editing */
799
+ doCommit() {
800
+ this.commit && this.commit(this.value, this);
801
+ }
802
+ splice(t, e, s, r, i) {
803
+ s === void 0 && (s = ""), r === void 0 && (r = m.NONE), i === void 0 && (i = {
804
+ input: !0
805
+ });
806
+ const n = t + e, u = this.extractTail(n), l = this.eager === !0 || this.eager === "remove";
807
+ let h;
808
+ l && (r = he(r), h = this.extractInput(0, n, {
809
+ raw: !0
810
+ }));
811
+ let v = t;
812
+ const _ = new E();
813
+ if (r !== m.NONE && (v = this.nearestInputPos(t, e > 1 && t !== 0 && !l ? m.NONE : r), _.tailShift = v - t), _.aggregate(this.remove(v)), l && r !== m.NONE && h === this.rawInputValue)
814
+ if (r === m.FORCE_LEFT) {
815
+ let S;
816
+ for (; h === this.rawInputValue && (S = this.displayValue.length); )
817
+ _.aggregate(new E({
818
+ tailShift: -1
819
+ })).aggregate(this.remove(S - 1));
820
+ } else r === m.FORCE_RIGHT && u.unshift();
821
+ return _.aggregate(this.append(s, i, u));
822
+ }
823
+ maskEquals(t) {
824
+ return this.mask === t;
825
+ }
826
+ optionsIsChanged(t) {
827
+ return !ot(this, t);
828
+ }
829
+ typedValueEquals(t) {
830
+ const e = this.typedValue;
831
+ return t === e || P.EMPTY_VALUES.includes(t) && P.EMPTY_VALUES.includes(e) || (this.format ? this.format(t, this) === this.format(this.typedValue, this) : !1);
832
+ }
833
+ pad(t) {
834
+ return new E();
835
+ }
836
+ }
837
+ P.DEFAULTS = {
838
+ skipInvalid: !0
839
+ };
840
+ P.EMPTY_VALUES = [void 0, null, ""];
841
+ g.Masked = P;
842
+ class J {
843
+ /** */
844
+ constructor(t, e) {
845
+ t === void 0 && (t = []), e === void 0 && (e = 0), this.chunks = t, this.from = e;
846
+ }
847
+ toString() {
848
+ return this.chunks.map(String).join("");
849
+ }
850
+ extend(t) {
851
+ if (!String(t)) return;
852
+ t = G(t) ? new H(String(t)) : t;
853
+ const e = this.chunks[this.chunks.length - 1], s = e && // if stops are same or tail has no stop
854
+ (e.stop === t.stop || t.stop == null) && // if tail chunk goes just after last chunk
855
+ t.from === e.from + e.toString().length;
856
+ if (t instanceof H)
857
+ s ? e.extend(t.toString()) : this.chunks.push(t);
858
+ else if (t instanceof J) {
859
+ if (t.stop == null) {
860
+ let r;
861
+ for (; t.chunks.length && t.chunks[0].stop == null; )
862
+ r = t.chunks.shift(), r.from += t.from, this.extend(r);
863
+ }
864
+ t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
865
+ }
866
+ }
867
+ appendTo(t) {
868
+ if (!(t instanceof g.MaskedPattern))
869
+ return new H(this.toString()).appendTo(t);
870
+ const e = new E();
871
+ for (let s = 0; s < this.chunks.length; ++s) {
872
+ const r = this.chunks[s], i = t._mapPosToBlock(t.displayValue.length), n = r.stop;
873
+ let u;
874
+ if (n != null && // if block not found or stop is behind lastBlock
875
+ (!i || i.index <= n) && ((r instanceof J || // for continuous block also check if stop is exist
876
+ t._stops.indexOf(n) >= 0) && e.aggregate(t._appendPlaceholder(n)), u = r instanceof J && t._blocks[n]), u) {
877
+ const l = u.appendTail(r);
878
+ e.aggregate(l);
879
+ const h = r.toString().slice(l.rawInserted.length);
880
+ h && e.aggregate(t.append(h, {
881
+ tail: !0
882
+ }));
883
+ } else
884
+ e.aggregate(t.append(r.toString(), {
885
+ tail: !0
886
+ }));
887
+ }
888
+ return e;
889
+ }
890
+ get state() {
891
+ return {
892
+ chunks: this.chunks.map((t) => t.state),
893
+ from: this.from,
894
+ stop: this.stop,
895
+ blockIndex: this.blockIndex
896
+ };
897
+ }
898
+ set state(t) {
899
+ const {
900
+ chunks: e,
901
+ ...s
902
+ } = t;
903
+ Object.assign(this, s), this.chunks = e.map((r) => {
904
+ const i = "chunks" in r ? new J() : new H();
905
+ return i.state = r, i;
906
+ });
907
+ }
908
+ unshift(t) {
909
+ if (!this.chunks.length || t != null && this.from >= t) return "";
910
+ const e = t != null ? t - this.from : t;
911
+ let s = 0;
912
+ for (; s < this.chunks.length; ) {
913
+ const r = this.chunks[s], i = r.unshift(e);
914
+ if (r.toString()) {
915
+ if (!i) break;
916
+ ++s;
917
+ } else
918
+ this.chunks.splice(s, 1);
919
+ if (i) return i;
920
+ }
921
+ return "";
922
+ }
923
+ shift() {
924
+ if (!this.chunks.length) return "";
925
+ let t = this.chunks.length - 1;
926
+ for (; 0 <= t; ) {
927
+ const e = this.chunks[t], s = e.shift();
928
+ if (e.toString()) {
929
+ if (!s) break;
930
+ --t;
931
+ } else
932
+ this.chunks.splice(t, 1);
933
+ if (s) return s;
934
+ }
935
+ return "";
936
+ }
937
+ }
938
+ class me {
939
+ constructor(t, e) {
940
+ this.masked = t, this._log = [];
941
+ const {
942
+ offset: s,
943
+ index: r
944
+ } = t._mapPosToBlock(e) || (e < 0 ? (
945
+ // first
946
+ {
947
+ index: 0,
948
+ offset: 0
949
+ }
950
+ ) : (
951
+ // last
952
+ {
953
+ index: this.masked._blocks.length,
954
+ offset: 0
955
+ }
956
+ ));
957
+ this.offset = s, this.index = r, this.ok = !1;
958
+ }
959
+ get block() {
960
+ return this.masked._blocks[this.index];
961
+ }
962
+ get pos() {
963
+ return this.masked._blockStartPos(this.index) + this.offset;
964
+ }
965
+ get state() {
966
+ return {
967
+ index: this.index,
968
+ offset: this.offset,
969
+ ok: this.ok
970
+ };
971
+ }
972
+ set state(t) {
973
+ Object.assign(this, t);
974
+ }
975
+ pushState() {
976
+ this._log.push(this.state);
977
+ }
978
+ popState() {
979
+ const t = this._log.pop();
980
+ return t && (this.state = t), t;
981
+ }
982
+ bindBlock() {
983
+ this.block || (this.index < 0 && (this.index = 0, this.offset = 0), this.index >= this.masked._blocks.length && (this.index = this.masked._blocks.length - 1, this.offset = this.block.displayValue.length));
984
+ }
985
+ _pushLeft(t) {
986
+ for (this.pushState(), this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((e = this.block) == null ? void 0 : e.displayValue.length) || 0) {
987
+ var e;
988
+ if (t()) return this.ok = !0;
989
+ }
990
+ return this.ok = !1;
991
+ }
992
+ _pushRight(t) {
993
+ for (this.pushState(), this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0)
994
+ if (t()) return this.ok = !0;
995
+ return this.ok = !1;
996
+ }
997
+ pushLeftBeforeFilled() {
998
+ return this._pushLeft(() => {
999
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, m.FORCE_LEFT), this.offset !== 0))
1000
+ return !0;
1001
+ });
1002
+ }
1003
+ pushLeftBeforeInput() {
1004
+ return this._pushLeft(() => {
1005
+ if (!this.block.isFixed)
1006
+ return this.offset = this.block.nearestInputPos(this.offset, m.LEFT), !0;
1007
+ });
1008
+ }
1009
+ pushLeftBeforeRequired() {
1010
+ return this._pushLeft(() => {
1011
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1012
+ return this.offset = this.block.nearestInputPos(this.offset, m.LEFT), !0;
1013
+ });
1014
+ }
1015
+ pushRightBeforeFilled() {
1016
+ return this._pushRight(() => {
1017
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, m.FORCE_RIGHT), this.offset !== this.block.value.length))
1018
+ return !0;
1019
+ });
1020
+ }
1021
+ pushRightBeforeInput() {
1022
+ return this._pushRight(() => {
1023
+ if (!this.block.isFixed)
1024
+ return this.offset = this.block.nearestInputPos(this.offset, m.NONE), !0;
1025
+ });
1026
+ }
1027
+ pushRightBeforeRequired() {
1028
+ return this._pushRight(() => {
1029
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
1030
+ return this.offset = this.block.nearestInputPos(this.offset, m.NONE), !0;
1031
+ });
1032
+ }
1033
+ }
1034
+ class Jt {
1035
+ /** */
1036
+ /** */
1037
+ /** */
1038
+ /** */
1039
+ /** */
1040
+ /** */
1041
+ constructor(t) {
1042
+ Object.assign(this, t), this._value = "", this.isFixed = !0;
1043
+ }
1044
+ get value() {
1045
+ return this._value;
1046
+ }
1047
+ get unmaskedValue() {
1048
+ return this.isUnmasking ? this.value : "";
1049
+ }
1050
+ get rawInputValue() {
1051
+ return this._isRawInput ? this.value : "";
1052
+ }
1053
+ get displayValue() {
1054
+ return this.value;
1055
+ }
1056
+ reset() {
1057
+ this._isRawInput = !1, this._value = "";
1058
+ }
1059
+ remove(t, e) {
1060
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._value = this._value.slice(0, t) + this._value.slice(e), this._value || (this._isRawInput = !1), new E();
1061
+ }
1062
+ nearestInputPos(t, e) {
1063
+ e === void 0 && (e = m.NONE);
1064
+ const s = 0, r = this._value.length;
1065
+ switch (e) {
1066
+ case m.LEFT:
1067
+ case m.FORCE_LEFT:
1068
+ return s;
1069
+ case m.NONE:
1070
+ case m.RIGHT:
1071
+ case m.FORCE_RIGHT:
1072
+ default:
1073
+ return r;
1074
+ }
1075
+ }
1076
+ totalInputPositions(t, e) {
1077
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._isRawInput ? e - t : 0;
1078
+ }
1079
+ extractInput(t, e, s) {
1080
+ return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), s === void 0 && (s = {}), s.raw && this._isRawInput && this._value.slice(t, e) || "";
1081
+ }
1082
+ get isComplete() {
1083
+ return !0;
1084
+ }
1085
+ get isFilled() {
1086
+ return !!this._value;
1087
+ }
1088
+ _appendChar(t, e) {
1089
+ if (e === void 0 && (e = {}), this.isFilled) return new E();
1090
+ const s = this.eager === !0 || this.eager === "append", i = this.char === t && (this.isUnmasking || e.input || e.raw) && (!e.raw || !s) && !e.tail, n = new E({
1091
+ inserted: this.char,
1092
+ rawInserted: i ? this.char : ""
1093
+ });
1094
+ return this._value = this.char, this._isRawInput = i && (e.raw || e.input), n;
1095
+ }
1096
+ _appendEager() {
1097
+ return this._appendChar(this.char, {
1098
+ tail: !0
1099
+ });
1100
+ }
1101
+ _appendPlaceholder() {
1102
+ const t = new E();
1103
+ return this.isFilled || (this._value = t.inserted = this.char), t;
1104
+ }
1105
+ extractTail() {
1106
+ return new H("");
1107
+ }
1108
+ appendTail(t) {
1109
+ return G(t) && (t = new H(String(t))), t.appendTo(this);
1110
+ }
1111
+ append(t, e, s) {
1112
+ const r = this._appendChar(t[0], e);
1113
+ return s != null && (r.tailShift += this.appendTail(s).tailShift), r;
1114
+ }
1115
+ doCommit() {
1116
+ }
1117
+ get state() {
1118
+ return {
1119
+ _value: this._value,
1120
+ _rawInputValue: this.rawInputValue
1121
+ };
1122
+ }
1123
+ set state(t) {
1124
+ this._value = t._value, this._isRawInput = !!t._rawInputValue;
1125
+ }
1126
+ pad(t) {
1127
+ return this._appendPlaceholder();
1128
+ }
1129
+ }
1130
+ class lt {
1131
+ /** */
1132
+ /** */
1133
+ /** */
1134
+ /** */
1135
+ /** */
1136
+ /** */
1137
+ /** */
1138
+ /** */
1139
+ constructor(t) {
1140
+ const {
1141
+ parent: e,
1142
+ isOptional: s,
1143
+ placeholderChar: r,
1144
+ displayChar: i,
1145
+ lazy: n,
1146
+ eager: u,
1147
+ ...l
1148
+ } = t;
1149
+ this.masked = K(l), Object.assign(this, {
1150
+ parent: e,
1151
+ isOptional: s,
1152
+ placeholderChar: r,
1153
+ displayChar: i,
1154
+ lazy: n,
1155
+ eager: u
1156
+ });
1157
+ }
1158
+ reset() {
1159
+ this.isFilled = !1, this.masked.reset();
1160
+ }
1161
+ remove(t, e) {
1162
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), t === 0 && e >= 1 ? (this.isFilled = !1, this.masked.remove(t, e)) : new E();
1163
+ }
1164
+ get value() {
1165
+ return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
1166
+ }
1167
+ get unmaskedValue() {
1168
+ return this.masked.unmaskedValue;
1169
+ }
1170
+ get rawInputValue() {
1171
+ return this.masked.rawInputValue;
1172
+ }
1173
+ get displayValue() {
1174
+ return this.masked.value && this.displayChar || this.value;
1175
+ }
1176
+ get isComplete() {
1177
+ return !!this.masked.value || this.isOptional;
1178
+ }
1179
+ _appendChar(t, e) {
1180
+ if (e === void 0 && (e = {}), this.isFilled) return new E();
1181
+ const s = this.masked.state;
1182
+ let r = this.masked._appendChar(t, this.currentMaskFlags(e));
1183
+ return r.inserted && this.doValidate(e) === !1 && (r = new E(), this.masked.state = s), !r.inserted && !this.isOptional && !this.lazy && !e.input && (r.inserted = this.placeholderChar), r.skip = !r.inserted && !this.isOptional, this.isFilled = !!r.inserted, r;
1184
+ }
1185
+ append(t, e, s) {
1186
+ return this.masked.append(t, this.currentMaskFlags(e), s);
1187
+ }
1188
+ _appendPlaceholder() {
1189
+ return this.isFilled || this.isOptional ? new E() : (this.isFilled = !0, new E({
1190
+ inserted: this.placeholderChar
1191
+ }));
1192
+ }
1193
+ _appendEager() {
1194
+ return new E();
1195
+ }
1196
+ extractTail(t, e) {
1197
+ return this.masked.extractTail(t, e);
1198
+ }
1199
+ appendTail(t) {
1200
+ return this.masked.appendTail(t);
1201
+ }
1202
+ extractInput(t, e, s) {
1203
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.masked.extractInput(t, e, s);
1204
+ }
1205
+ nearestInputPos(t, e) {
1206
+ e === void 0 && (e = m.NONE);
1207
+ const s = 0, r = this.value.length, i = Math.min(Math.max(t, s), r);
1208
+ switch (e) {
1209
+ case m.LEFT:
1210
+ case m.FORCE_LEFT:
1211
+ return this.isComplete ? i : s;
1212
+ case m.RIGHT:
1213
+ case m.FORCE_RIGHT:
1214
+ return this.isComplete ? i : r;
1215
+ case m.NONE:
1216
+ default:
1217
+ return i;
1218
+ }
1219
+ }
1220
+ totalInputPositions(t, e) {
1221
+ return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.value.slice(t, e).length;
1222
+ }
1223
+ doValidate(t) {
1224
+ return this.masked.doValidate(this.currentMaskFlags(t)) && (!this.parent || this.parent.doValidate(this.currentMaskFlags(t)));
1225
+ }
1226
+ doCommit() {
1227
+ this.masked.doCommit();
1228
+ }
1229
+ get state() {
1230
+ return {
1231
+ _value: this.value,
1232
+ _rawInputValue: this.rawInputValue,
1233
+ masked: this.masked.state,
1234
+ isFilled: this.isFilled
1235
+ };
1236
+ }
1237
+ set state(t) {
1238
+ this.masked.state = t.masked, this.isFilled = t.isFilled;
1239
+ }
1240
+ currentMaskFlags(t) {
1241
+ var e;
1242
+ return {
1243
+ ...t,
1244
+ _beforeTailState: (t == null || (e = t._beforeTailState) == null ? void 0 : e.masked) || (t == null ? void 0 : t._beforeTailState)
1245
+ };
1246
+ }
1247
+ pad(t) {
1248
+ return new E();
1249
+ }
1250
+ }
1251
+ lt.DEFAULT_DEFINITIONS = {
1252
+ 0: /\d/,
1253
+ a: /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
1254
+ // http://stackoverflow.com/a/22075070
1255
+ "*": /./
1256
+ };
1257
+ class ve extends P {
1258
+ /** */
1259
+ /** Enable characters overwriting */
1260
+ /** */
1261
+ /** */
1262
+ /** */
1263
+ updateOptions(t) {
1264
+ super.updateOptions(t);
1265
+ }
1266
+ _update(t) {
1267
+ const e = t.mask;
1268
+ e && (t.validate = (s) => s.search(e) >= 0), super._update(t);
1269
+ }
1270
+ }
1271
+ g.MaskedRegExp = ve;
1272
+ class L extends P {
1273
+ /** */
1274
+ /** */
1275
+ /** Single char for empty input */
1276
+ /** Single char for filled input */
1277
+ /** Show placeholder only when needed */
1278
+ /** Enable characters overwriting */
1279
+ /** */
1280
+ /** */
1281
+ /** */
1282
+ constructor(t) {
1283
+ super({
1284
+ ...L.DEFAULTS,
1285
+ ...t,
1286
+ definitions: Object.assign({}, lt.DEFAULT_DEFINITIONS, t == null ? void 0 : t.definitions)
1287
+ });
1288
+ }
1289
+ updateOptions(t) {
1290
+ super.updateOptions(t);
1291
+ }
1292
+ _update(t) {
1293
+ t.definitions = Object.assign({}, this.definitions, t.definitions), super._update(t), this._rebuildMask();
1294
+ }
1295
+ _rebuildMask() {
1296
+ const t = this.definitions;
1297
+ this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
1298
+ const e = this.mask;
1299
+ if (!e || !t) return;
1300
+ let s = !1, r = !1;
1301
+ for (let i = 0; i < e.length; ++i) {
1302
+ if (this.blocks) {
1303
+ const h = e.slice(i), v = Object.keys(this.blocks).filter((S) => h.indexOf(S) === 0);
1304
+ v.sort((S, B) => B.length - S.length);
1305
+ const _ = v[0];
1306
+ if (_) {
1307
+ const {
1308
+ expose: S,
1309
+ repeat: B,
1310
+ ...N
1311
+ } = et(this.blocks[_]), M = {
1312
+ lazy: this.lazy,
1313
+ eager: this.eager,
1314
+ placeholderChar: this.placeholderChar,
1315
+ displayChar: this.displayChar,
1316
+ overwrite: this.overwrite,
1317
+ autofix: this.autofix,
1318
+ ...N,
1319
+ repeat: B,
1320
+ parent: this
1321
+ }, O = B != null ? new g.RepeatBlock(
1322
+ M
1323
+ /* TODO */
1324
+ ) : K(M);
1325
+ O && (this._blocks.push(O), S && (this.exposeBlock = O), this._maskedBlocks[_] || (this._maskedBlocks[_] = []), this._maskedBlocks[_].push(this._blocks.length - 1)), i += _.length - 1;
1326
+ continue;
1327
+ }
1328
+ }
1329
+ let n = e[i], u = n in t;
1330
+ if (n === L.STOP_CHAR) {
1331
+ this._stops.push(this._blocks.length);
1332
+ continue;
1333
+ }
1334
+ if (n === "{" || n === "}") {
1335
+ s = !s;
1336
+ continue;
1337
+ }
1338
+ if (n === "[" || n === "]") {
1339
+ r = !r;
1340
+ continue;
1341
+ }
1342
+ if (n === L.ESCAPE_CHAR) {
1343
+ if (++i, n = e[i], !n) break;
1344
+ u = !1;
1345
+ }
1346
+ const l = u ? new lt({
1347
+ isOptional: r,
1348
+ lazy: this.lazy,
1349
+ eager: this.eager,
1350
+ placeholderChar: this.placeholderChar,
1351
+ displayChar: this.displayChar,
1352
+ ...et(t[n]),
1353
+ parent: this
1354
+ }) : new Jt({
1355
+ char: n,
1356
+ eager: this.eager,
1357
+ isUnmasking: s
1358
+ });
1359
+ this._blocks.push(l);
1360
+ }
1361
+ }
1362
+ get state() {
1363
+ return {
1364
+ ...super.state,
1365
+ _blocks: this._blocks.map((t) => t.state)
1366
+ };
1367
+ }
1368
+ set state(t) {
1369
+ if (!t) {
1370
+ this.reset();
1371
+ return;
1372
+ }
1373
+ const {
1374
+ _blocks: e,
1375
+ ...s
1376
+ } = t;
1377
+ this._blocks.forEach((r, i) => r.state = e[i]), super.state = s;
1378
+ }
1379
+ reset() {
1380
+ super.reset(), this._blocks.forEach((t) => t.reset());
1381
+ }
1382
+ get isComplete() {
1383
+ return this.exposeBlock ? this.exposeBlock.isComplete : this._blocks.every((t) => t.isComplete);
1384
+ }
1385
+ get isFilled() {
1386
+ return this._blocks.every((t) => t.isFilled);
1387
+ }
1388
+ get isFixed() {
1389
+ return this._blocks.every((t) => t.isFixed);
1390
+ }
1391
+ get isOptional() {
1392
+ return this._blocks.every((t) => t.isOptional);
1393
+ }
1394
+ doCommit() {
1395
+ this._blocks.forEach((t) => t.doCommit()), super.doCommit();
1396
+ }
1397
+ get unmaskedValue() {
1398
+ return this.exposeBlock ? this.exposeBlock.unmaskedValue : this._blocks.reduce((t, e) => t += e.unmaskedValue, "");
1399
+ }
1400
+ set unmaskedValue(t) {
1401
+ if (this.exposeBlock) {
1402
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1403
+ this.exposeBlock.unmaskedValue = t, this.appendTail(e), this.doCommit();
1404
+ } else super.unmaskedValue = t;
1405
+ }
1406
+ get value() {
1407
+ return this.exposeBlock ? this.exposeBlock.value : (
1408
+ // TODO return _value when not in change?
1409
+ this._blocks.reduce((t, e) => t += e.value, "")
1410
+ );
1411
+ }
1412
+ set value(t) {
1413
+ if (this.exposeBlock) {
1414
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1415
+ this.exposeBlock.value = t, this.appendTail(e), this.doCommit();
1416
+ } else super.value = t;
1417
+ }
1418
+ get typedValue() {
1419
+ return this.exposeBlock ? this.exposeBlock.typedValue : super.typedValue;
1420
+ }
1421
+ set typedValue(t) {
1422
+ if (this.exposeBlock) {
1423
+ const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1424
+ this.exposeBlock.typedValue = t, this.appendTail(e), this.doCommit();
1425
+ } else super.typedValue = t;
1426
+ }
1427
+ get displayValue() {
1428
+ return this._blocks.reduce((t, e) => t += e.displayValue, "");
1429
+ }
1430
+ appendTail(t) {
1431
+ return super.appendTail(t).aggregate(this._appendPlaceholder());
1432
+ }
1433
+ _appendEager() {
1434
+ var t;
1435
+ const e = new E();
1436
+ let s = (t = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : t.index;
1437
+ if (s == null) return e;
1438
+ this._blocks[s].isFilled && ++s;
1439
+ for (let r = s; r < this._blocks.length; ++r) {
1440
+ const i = this._blocks[r]._appendEager();
1441
+ if (!i.inserted) break;
1442
+ e.aggregate(i);
1443
+ }
1444
+ return e;
1445
+ }
1446
+ _appendCharRaw(t, e) {
1447
+ e === void 0 && (e = {});
1448
+ const s = this._mapPosToBlock(this.displayValue.length), r = new E();
1449
+ if (!s) return r;
1450
+ for (let n = s.index, u; u = this._blocks[n]; ++n) {
1451
+ var i;
1452
+ const l = u._appendChar(t, {
1453
+ ...e,
1454
+ _beforeTailState: (i = e._beforeTailState) == null || (i = i._blocks) == null ? void 0 : i[n]
1455
+ });
1456
+ if (r.aggregate(l), l.consumed) break;
1457
+ }
1458
+ return r;
1459
+ }
1460
+ extractTail(t, e) {
1461
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1462
+ const s = new J();
1463
+ return t === e || this._forEachBlocksInRange(t, e, (r, i, n, u) => {
1464
+ const l = r.extractTail(n, u);
1465
+ l.stop = this._findStopBefore(i), l.from = this._blockStartPos(i), l instanceof J && (l.blockIndex = i), s.extend(l);
1466
+ }), s;
1467
+ }
1468
+ extractInput(t, e, s) {
1469
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), s === void 0 && (s = {}), t === e) return "";
1470
+ let r = "";
1471
+ return this._forEachBlocksInRange(t, e, (i, n, u, l) => {
1472
+ r += i.extractInput(u, l, s);
1473
+ }), r;
1474
+ }
1475
+ _findStopBefore(t) {
1476
+ let e;
1477
+ for (let s = 0; s < this._stops.length; ++s) {
1478
+ const r = this._stops[s];
1479
+ if (r <= t) e = r;
1480
+ else break;
1481
+ }
1482
+ return e;
1483
+ }
1484
+ /** Appends placeholder depending on laziness */
1485
+ _appendPlaceholder(t) {
1486
+ const e = new E();
1487
+ if (this.lazy && t == null) return e;
1488
+ const s = this._mapPosToBlock(this.displayValue.length);
1489
+ if (!s) return e;
1490
+ const r = s.index, i = t ?? this._blocks.length;
1491
+ return this._blocks.slice(r, i).forEach((n) => {
1492
+ if (!n.lazy || t != null) {
1493
+ var u;
1494
+ e.aggregate(n._appendPlaceholder((u = n._blocks) == null ? void 0 : u.length));
1495
+ }
1496
+ }), e;
1497
+ }
1498
+ /** Finds block in pos */
1499
+ _mapPosToBlock(t) {
1500
+ let e = "";
1501
+ for (let s = 0; s < this._blocks.length; ++s) {
1502
+ const r = this._blocks[s], i = e.length;
1503
+ if (e += r.displayValue, t <= e.length)
1504
+ return {
1505
+ index: s,
1506
+ offset: t - i
1507
+ };
1508
+ }
1509
+ }
1510
+ _blockStartPos(t) {
1511
+ return this._blocks.slice(0, t).reduce((e, s) => e += s.displayValue.length, 0);
1512
+ }
1513
+ _forEachBlocksInRange(t, e, s) {
1514
+ e === void 0 && (e = this.displayValue.length);
1515
+ const r = this._mapPosToBlock(t);
1516
+ if (r) {
1517
+ const i = this._mapPosToBlock(e), n = i && r.index === i.index, u = r.offset, l = i && n ? i.offset : this._blocks[r.index].displayValue.length;
1518
+ if (s(this._blocks[r.index], r.index, u, l), i && !n) {
1519
+ for (let h = r.index + 1; h < i.index; ++h)
1520
+ s(this._blocks[h], h, 0, this._blocks[h].displayValue.length);
1521
+ s(this._blocks[i.index], i.index, 0, i.offset);
1522
+ }
1523
+ }
1524
+ }
1525
+ remove(t, e) {
1526
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1527
+ const s = super.remove(t, e);
1528
+ return this._forEachBlocksInRange(t, e, (r, i, n, u) => {
1529
+ s.aggregate(r.remove(n, u));
1530
+ }), s;
1531
+ }
1532
+ nearestInputPos(t, e) {
1533
+ if (e === void 0 && (e = m.NONE), !this._blocks.length) return 0;
1534
+ const s = new me(this, t);
1535
+ if (e === m.NONE)
1536
+ return s.pushRightBeforeInput() || (s.popState(), s.pushLeftBeforeInput()) ? s.pos : this.displayValue.length;
1537
+ if (e === m.LEFT || e === m.FORCE_LEFT) {
1538
+ if (e === m.LEFT) {
1539
+ if (s.pushRightBeforeFilled(), s.ok && s.pos === t) return t;
1540
+ s.popState();
1541
+ }
1542
+ if (s.pushLeftBeforeInput(), s.pushLeftBeforeRequired(), s.pushLeftBeforeFilled(), e === m.LEFT) {
1543
+ if (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.ok && s.pos <= t || (s.popState(), s.ok && s.pos <= t)) return s.pos;
1544
+ s.popState();
1545
+ }
1546
+ return s.ok ? s.pos : e === m.FORCE_LEFT ? 0 : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : 0);
1547
+ }
1548
+ return e === m.RIGHT || e === m.FORCE_RIGHT ? (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.pushRightBeforeFilled() ? s.pos : e === m.FORCE_RIGHT ? this.displayValue.length : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : this.nearestInputPos(t, m.LEFT))) : t;
1549
+ }
1550
+ totalInputPositions(t, e) {
1551
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1552
+ let s = 0;
1553
+ return this._forEachBlocksInRange(t, e, (r, i, n, u) => {
1554
+ s += r.totalInputPositions(n, u);
1555
+ }), s;
1556
+ }
1557
+ /** Get block by name */
1558
+ maskedBlock(t) {
1559
+ return this.maskedBlocks(t)[0];
1560
+ }
1561
+ /** Get all blocks by name */
1562
+ maskedBlocks(t) {
1563
+ const e = this._maskedBlocks[t];
1564
+ return e ? e.map((s) => this._blocks[s]) : [];
1565
+ }
1566
+ pad(t) {
1567
+ const e = new E();
1568
+ return this._forEachBlocksInRange(0, this.displayValue.length, (s) => e.aggregate(s.pad(t))), e;
1569
+ }
1570
+ }
1571
+ L.DEFAULTS = {
1572
+ ...P.DEFAULTS,
1573
+ lazy: !0,
1574
+ placeholderChar: "_"
1575
+ };
1576
+ L.STOP_CHAR = "`";
1577
+ L.ESCAPE_CHAR = "\\";
1578
+ L.InputDefinition = lt;
1579
+ L.FixedDefinition = Jt;
1580
+ g.MaskedPattern = L;
1581
+ class ut extends L {
1582
+ /**
1583
+ Optionally sets max length of pattern.
1584
+ Used when pattern length is longer then `to` param length. Pads zeros at start in this case.
1585
+ */
1586
+ /** Min bound */
1587
+ /** Max bound */
1588
+ get _matchFrom() {
1589
+ return this.maxLength - String(this.from).length;
1590
+ }
1591
+ constructor(t) {
1592
+ super(t);
1593
+ }
1594
+ updateOptions(t) {
1595
+ super.updateOptions(t);
1596
+ }
1597
+ _update(t) {
1598
+ const {
1599
+ to: e = this.to || 0,
1600
+ from: s = this.from || 0,
1601
+ maxLength: r = this.maxLength || 0,
1602
+ autofix: i = this.autofix,
1603
+ ...n
1604
+ } = t;
1605
+ this.to = e, this.from = s, this.maxLength = Math.max(String(e).length, r), this.autofix = i;
1606
+ const u = String(this.from).padStart(this.maxLength, "0"), l = String(this.to).padStart(this.maxLength, "0");
1607
+ let h = 0;
1608
+ for (; h < l.length && l[h] === u[h]; ) ++h;
1609
+ n.mask = l.slice(0, h).replace(/0/g, "\\0") + "0".repeat(this.maxLength - h), super._update(n);
1610
+ }
1611
+ get isComplete() {
1612
+ return super.isComplete && !!this.value;
1613
+ }
1614
+ boundaries(t) {
1615
+ let e = "", s = "";
1616
+ const [, r, i] = t.match(/^(\D*)(\d*)(\D*)/) || [];
1617
+ return i && (e = "0".repeat(r.length) + i, s = "9".repeat(r.length) + i), e = e.padEnd(this.maxLength, "0"), s = s.padEnd(this.maxLength, "9"), [e, s];
1618
+ }
1619
+ doPrepareChar(t, e) {
1620
+ e === void 0 && (e = {});
1621
+ let s;
1622
+ return [t, s] = super.doPrepareChar(t.replace(/\D/g, ""), e), t || (s.skip = !this.isComplete), [t, s];
1623
+ }
1624
+ _appendCharRaw(t, e) {
1625
+ if (e === void 0 && (e = {}), !this.autofix || this.value.length + 1 > this.maxLength) return super._appendCharRaw(t, e);
1626
+ const s = String(this.from).padStart(this.maxLength, "0"), r = String(this.to).padStart(this.maxLength, "0"), [i, n] = this.boundaries(this.value + t);
1627
+ return Number(n) < this.from ? super._appendCharRaw(s[this.value.length], e) : Number(i) > this.to ? !e.tail && this.autofix === "pad" && this.value.length + 1 < this.maxLength ? super._appendCharRaw(s[this.value.length], e).aggregate(this._appendCharRaw(t, e)) : super._appendCharRaw(r[this.value.length], e) : super._appendCharRaw(t, e);
1628
+ }
1629
+ doValidate(t) {
1630
+ const e = this.value;
1631
+ if (e.search(/[^0]/) === -1 && e.length <= this._matchFrom) return !0;
1632
+ const [r, i] = this.boundaries(e);
1633
+ return this.from <= Number(i) && Number(r) <= this.to && super.doValidate(t);
1634
+ }
1635
+ pad(t) {
1636
+ const e = new E();
1637
+ if (this.value.length === this.maxLength) return e;
1638
+ const s = this.value, r = this.maxLength - this.value.length;
1639
+ if (r) {
1640
+ this.reset();
1641
+ for (let i = 0; i < r; ++i)
1642
+ e.aggregate(super._appendCharRaw("0", t));
1643
+ s.split("").forEach((i) => this._appendCharRaw(i));
1644
+ }
1645
+ return e;
1646
+ }
1647
+ }
1648
+ g.MaskedRange = ut;
1649
+ const ge = "d{.}`m{.}`Y";
1650
+ class z extends L {
1651
+ static extractPatternOptions(t) {
1652
+ const {
1653
+ mask: e,
1654
+ pattern: s,
1655
+ ...r
1656
+ } = t;
1657
+ return {
1658
+ ...r,
1659
+ mask: G(e) ? e : s
1660
+ };
1661
+ }
1662
+ /** Pattern mask for date according to {@link MaskedDate#format} */
1663
+ /** Start date */
1664
+ /** End date */
1665
+ /** Format typed value to string */
1666
+ /** Parse string to get typed value */
1667
+ constructor(t) {
1668
+ super(z.extractPatternOptions({
1669
+ ...z.DEFAULTS,
1670
+ ...t
1671
+ }));
1672
+ }
1673
+ updateOptions(t) {
1674
+ super.updateOptions(t);
1675
+ }
1676
+ _update(t) {
1677
+ const {
1678
+ mask: e,
1679
+ pattern: s,
1680
+ blocks: r,
1681
+ ...i
1682
+ } = {
1683
+ ...z.DEFAULTS,
1684
+ ...t
1685
+ }, n = Object.assign({}, z.GET_DEFAULT_BLOCKS());
1686
+ t.min && (n.Y.from = t.min.getFullYear()), t.max && (n.Y.to = t.max.getFullYear()), t.min && t.max && n.Y.from === n.Y.to && (n.m.from = t.min.getMonth() + 1, n.m.to = t.max.getMonth() + 1, n.m.from === n.m.to && (n.d.from = t.min.getDate(), n.d.to = t.max.getDate())), Object.assign(n, this.blocks, r), super._update({
1687
+ ...i,
1688
+ mask: G(e) ? e : s,
1689
+ blocks: n
1690
+ });
1691
+ }
1692
+ doValidate(t) {
1693
+ const e = this.date;
1694
+ return super.doValidate(t) && (!this.isComplete || this.isDateExist(this.value) && e != null && (this.min == null || this.min <= e) && (this.max == null || e <= this.max));
1695
+ }
1696
+ /** Checks if date is exists */
1697
+ isDateExist(t) {
1698
+ return this.format(this.parse(t, this), this).indexOf(t) >= 0;
1699
+ }
1700
+ /** Parsed Date */
1701
+ get date() {
1702
+ return this.typedValue;
1703
+ }
1704
+ set date(t) {
1705
+ this.typedValue = t;
1706
+ }
1707
+ get typedValue() {
1708
+ return this.isComplete ? super.typedValue : null;
1709
+ }
1710
+ set typedValue(t) {
1711
+ super.typedValue = t;
1712
+ }
1713
+ maskEquals(t) {
1714
+ return t === Date || super.maskEquals(t);
1715
+ }
1716
+ optionsIsChanged(t) {
1717
+ return super.optionsIsChanged(z.extractPatternOptions(t));
1718
+ }
1719
+ }
1720
+ z.GET_DEFAULT_BLOCKS = () => ({
1721
+ d: {
1722
+ mask: ut,
1723
+ from: 1,
1724
+ to: 31,
1725
+ maxLength: 2
1726
+ },
1727
+ m: {
1728
+ mask: ut,
1729
+ from: 1,
1730
+ to: 12,
1731
+ maxLength: 2
1732
+ },
1733
+ Y: {
1734
+ mask: ut,
1735
+ from: 1900,
1736
+ to: 9999
1737
+ }
1738
+ });
1739
+ z.DEFAULTS = {
1740
+ ...L.DEFAULTS,
1741
+ mask: Date,
1742
+ pattern: ge,
1743
+ format: (a, t) => {
1744
+ if (!a) return "";
1745
+ const e = String(a.getDate()).padStart(2, "0"), s = String(a.getMonth() + 1).padStart(2, "0"), r = a.getFullYear();
1746
+ return [e, s, r].join(".");
1747
+ },
1748
+ parse: (a, t) => {
1749
+ const [e, s, r] = a.split(".").map(Number);
1750
+ return new Date(r, s - 1, e);
1751
+ }
1752
+ };
1753
+ g.MaskedDate = z;
1754
+ class ct extends P {
1755
+ constructor(t) {
1756
+ super({
1757
+ ...ct.DEFAULTS,
1758
+ ...t
1759
+ }), this.currentMask = void 0;
1760
+ }
1761
+ updateOptions(t) {
1762
+ super.updateOptions(t);
1763
+ }
1764
+ _update(t) {
1765
+ super._update(t), "mask" in t && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(t.mask) ? t.mask.map((e) => {
1766
+ const {
1767
+ expose: s,
1768
+ ...r
1769
+ } = et(e), i = K({
1770
+ overwrite: this._overwrite,
1771
+ eager: this._eager,
1772
+ skipInvalid: this._skipInvalid,
1773
+ ...r
1774
+ });
1775
+ return s && (this.exposeMask = i), i;
1776
+ }) : []);
1777
+ }
1778
+ _appendCharRaw(t, e) {
1779
+ e === void 0 && (e = {});
1780
+ const s = this._applyDispatch(t, e);
1781
+ return this.currentMask && s.aggregate(this.currentMask._appendChar(t, this.currentMaskFlags(e))), s;
1782
+ }
1783
+ _applyDispatch(t, e, s) {
1784
+ t === void 0 && (t = ""), e === void 0 && (e = {}), s === void 0 && (s = "");
1785
+ const r = e.tail && e._beforeTailState != null ? e._beforeTailState._value : this.value, i = this.rawInputValue, n = e.tail && e._beforeTailState != null ? e._beforeTailState._rawInputValue : i, u = i.slice(n.length), l = this.currentMask, h = new E(), v = l == null ? void 0 : l.state;
1786
+ return this.currentMask = this.doDispatch(t, {
1787
+ ...e
1788
+ }, s), this.currentMask && (this.currentMask !== l ? (this.currentMask.reset(), n && (this.currentMask.append(n, {
1789
+ raw: !0
1790
+ }), h.tailShift = this.currentMask.value.length - r.length), u && (h.tailShift += this.currentMask.append(u, {
1791
+ raw: !0,
1792
+ tail: !0
1793
+ }).tailShift)) : v && (this.currentMask.state = v)), h;
1794
+ }
1795
+ _appendPlaceholder() {
1796
+ const t = this._applyDispatch();
1797
+ return this.currentMask && t.aggregate(this.currentMask._appendPlaceholder()), t;
1798
+ }
1799
+ _appendEager() {
1800
+ const t = this._applyDispatch();
1801
+ return this.currentMask && t.aggregate(this.currentMask._appendEager()), t;
1802
+ }
1803
+ appendTail(t) {
1804
+ const e = new E();
1805
+ return t && e.aggregate(this._applyDispatch("", {}, t)), e.aggregate(this.currentMask ? this.currentMask.appendTail(t) : super.appendTail(t));
1806
+ }
1807
+ currentMaskFlags(t) {
1808
+ var e, s;
1809
+ return {
1810
+ ...t,
1811
+ _beforeTailState: ((e = t._beforeTailState) == null ? void 0 : e.currentMaskRef) === this.currentMask && ((s = t._beforeTailState) == null ? void 0 : s.currentMask) || t._beforeTailState
1812
+ };
1813
+ }
1814
+ doDispatch(t, e, s) {
1815
+ return e === void 0 && (e = {}), s === void 0 && (s = ""), this.dispatch(t, this, e, s);
1816
+ }
1817
+ doValidate(t) {
1818
+ return super.doValidate(t) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(t)));
1819
+ }
1820
+ doPrepare(t, e) {
1821
+ e === void 0 && (e = {});
1822
+ let [s, r] = super.doPrepare(t, e);
1823
+ if (this.currentMask) {
1824
+ let i;
1825
+ [s, i] = super.doPrepare(s, this.currentMaskFlags(e)), r = r.aggregate(i);
1826
+ }
1827
+ return [s, r];
1828
+ }
1829
+ doPrepareChar(t, e) {
1830
+ e === void 0 && (e = {});
1831
+ let [s, r] = super.doPrepareChar(t, e);
1832
+ if (this.currentMask) {
1833
+ let i;
1834
+ [s, i] = super.doPrepareChar(s, this.currentMaskFlags(e)), r = r.aggregate(i);
1835
+ }
1836
+ return [s, r];
1837
+ }
1838
+ reset() {
1839
+ var t;
1840
+ (t = this.currentMask) == null || t.reset(), this.compiledMasks.forEach((e) => e.reset());
1841
+ }
1842
+ get value() {
1843
+ return this.exposeMask ? this.exposeMask.value : this.currentMask ? this.currentMask.value : "";
1844
+ }
1845
+ set value(t) {
1846
+ this.exposeMask ? (this.exposeMask.value = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.value = t;
1847
+ }
1848
+ get unmaskedValue() {
1849
+ return this.exposeMask ? this.exposeMask.unmaskedValue : this.currentMask ? this.currentMask.unmaskedValue : "";
1850
+ }
1851
+ set unmaskedValue(t) {
1852
+ this.exposeMask ? (this.exposeMask.unmaskedValue = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.unmaskedValue = t;
1853
+ }
1854
+ get typedValue() {
1855
+ return this.exposeMask ? this.exposeMask.typedValue : this.currentMask ? this.currentMask.typedValue : "";
1856
+ }
1857
+ set typedValue(t) {
1858
+ if (this.exposeMask) {
1859
+ this.exposeMask.typedValue = t, this.currentMask = this.exposeMask, this._applyDispatch();
1860
+ return;
1861
+ }
1862
+ let e = String(t);
1863
+ this.currentMask && (this.currentMask.typedValue = t, e = this.currentMask.unmaskedValue), this.unmaskedValue = e;
1864
+ }
1865
+ get displayValue() {
1866
+ return this.currentMask ? this.currentMask.displayValue : "";
1867
+ }
1868
+ get isComplete() {
1869
+ var t;
1870
+ return !!((t = this.currentMask) != null && t.isComplete);
1871
+ }
1872
+ get isFilled() {
1873
+ var t;
1874
+ return !!((t = this.currentMask) != null && t.isFilled);
1875
+ }
1876
+ remove(t, e) {
1877
+ const s = new E();
1878
+ return this.currentMask && s.aggregate(this.currentMask.remove(t, e)).aggregate(this._applyDispatch()), s;
1879
+ }
1880
+ get state() {
1881
+ var t;
1882
+ return {
1883
+ ...super.state,
1884
+ _rawInputValue: this.rawInputValue,
1885
+ compiledMasks: this.compiledMasks.map((e) => e.state),
1886
+ currentMaskRef: this.currentMask,
1887
+ currentMask: (t = this.currentMask) == null ? void 0 : t.state
1888
+ };
1889
+ }
1890
+ set state(t) {
1891
+ const {
1892
+ compiledMasks: e,
1893
+ currentMaskRef: s,
1894
+ currentMask: r,
1895
+ ...i
1896
+ } = t;
1897
+ e && this.compiledMasks.forEach((n, u) => n.state = e[u]), s != null && (this.currentMask = s, this.currentMask.state = r), super.state = i;
1898
+ }
1899
+ extractInput(t, e, s) {
1900
+ return this.currentMask ? this.currentMask.extractInput(t, e, s) : "";
1901
+ }
1902
+ extractTail(t, e) {
1903
+ return this.currentMask ? this.currentMask.extractTail(t, e) : super.extractTail(t, e);
1904
+ }
1905
+ doCommit() {
1906
+ this.currentMask && this.currentMask.doCommit(), super.doCommit();
1907
+ }
1908
+ nearestInputPos(t, e) {
1909
+ return this.currentMask ? this.currentMask.nearestInputPos(t, e) : super.nearestInputPos(t, e);
1910
+ }
1911
+ get overwrite() {
1912
+ return this.currentMask ? this.currentMask.overwrite : this._overwrite;
1913
+ }
1914
+ set overwrite(t) {
1915
+ this._overwrite = t;
1916
+ }
1917
+ get eager() {
1918
+ return this.currentMask ? this.currentMask.eager : this._eager;
1919
+ }
1920
+ set eager(t) {
1921
+ this._eager = t;
1922
+ }
1923
+ get skipInvalid() {
1924
+ return this.currentMask ? this.currentMask.skipInvalid : this._skipInvalid;
1925
+ }
1926
+ set skipInvalid(t) {
1927
+ this._skipInvalid = t;
1928
+ }
1929
+ get autofix() {
1930
+ return this.currentMask ? this.currentMask.autofix : this._autofix;
1931
+ }
1932
+ set autofix(t) {
1933
+ this._autofix = t;
1934
+ }
1935
+ maskEquals(t) {
1936
+ return Array.isArray(t) ? this.compiledMasks.every((e, s) => {
1937
+ if (!t[s]) return;
1938
+ const {
1939
+ mask: r,
1940
+ ...i
1941
+ } = t[s];
1942
+ return ot(e, i) && e.maskEquals(r);
1943
+ }) : super.maskEquals(t);
1944
+ }
1945
+ typedValueEquals(t) {
1946
+ var e;
1947
+ return !!((e = this.currentMask) != null && e.typedValueEquals(t));
1948
+ }
1949
+ }
1950
+ ct.DEFAULTS = {
1951
+ ...P.DEFAULTS,
1952
+ dispatch: (a, t, e, s) => {
1953
+ if (!t.compiledMasks.length) return;
1954
+ const r = t.rawInputValue, i = t.compiledMasks.map((n, u) => {
1955
+ const l = t.currentMask === n, h = l ? n.displayValue.length : n.nearestInputPos(n.displayValue.length, m.FORCE_LEFT);
1956
+ return n.rawInputValue !== r ? (n.reset(), n.append(r, {
1957
+ raw: !0
1958
+ })) : l || n.remove(h), n.append(a, t.currentMaskFlags(e)), n.appendTail(s), {
1959
+ index: u,
1960
+ weight: n.rawInputValue.length,
1961
+ totalInputPositions: n.totalInputPositions(0, Math.max(h, n.nearestInputPos(n.displayValue.length, m.FORCE_LEFT)))
1962
+ };
1963
+ });
1964
+ return i.sort((n, u) => u.weight - n.weight || u.totalInputPositions - n.totalInputPositions), t.compiledMasks[i[0].index];
1965
+ }
1966
+ };
1967
+ g.MaskedDynamic = ct;
1968
+ class dt extends L {
1969
+ constructor(t) {
1970
+ super({
1971
+ ...dt.DEFAULTS,
1972
+ ...t
1973
+ });
1974
+ }
1975
+ updateOptions(t) {
1976
+ super.updateOptions(t);
1977
+ }
1978
+ _update(t) {
1979
+ const {
1980
+ enum: e,
1981
+ ...s
1982
+ } = t;
1983
+ if (e) {
1984
+ const r = e.map((u) => u.length), i = Math.min(...r), n = Math.max(...r) - i;
1985
+ s.mask = "*".repeat(i), n && (s.mask += "[" + "*".repeat(n) + "]"), this.enum = e;
1986
+ }
1987
+ super._update(s);
1988
+ }
1989
+ _appendCharRaw(t, e) {
1990
+ e === void 0 && (e = {});
1991
+ const s = Math.min(this.nearestInputPos(0, m.FORCE_RIGHT), this.value.length), r = this.enum.filter((i) => this.matchValue(i, this.unmaskedValue + t, s));
1992
+ if (r.length) {
1993
+ r.length === 1 && this._forEachBlocksInRange(0, this.value.length, (n, u) => {
1994
+ const l = r[0][u];
1995
+ u >= this.value.length || l === n.value || (n.reset(), n._appendChar(l, e));
1996
+ });
1997
+ const i = super._appendCharRaw(r[0][this.value.length], e);
1998
+ return r.length === 1 && r[0].slice(this.unmaskedValue.length).split("").forEach((n) => i.aggregate(super._appendCharRaw(n))), i;
1999
+ }
2000
+ return new E({
2001
+ skip: !this.isComplete
2002
+ });
2003
+ }
2004
+ extractTail(t, e) {
2005
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new H("", t);
2006
+ }
2007
+ remove(t, e) {
2008
+ if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), t === e) return new E();
2009
+ const s = Math.min(super.nearestInputPos(0, m.FORCE_RIGHT), this.value.length);
2010
+ let r;
2011
+ for (r = t; r >= 0 && !(this.enum.filter((u) => this.matchValue(u, this.value.slice(s, r), s)).length > 1); --r)
2012
+ ;
2013
+ const i = super.remove(r, e);
2014
+ return i.tailShift += r - t, i;
2015
+ }
2016
+ get isComplete() {
2017
+ return this.enum.indexOf(this.value) >= 0;
2018
+ }
2019
+ }
2020
+ dt.DEFAULTS = {
2021
+ ...L.DEFAULTS,
2022
+ matchValue: (a, t, e) => a.indexOf(t, e) === e
2023
+ };
2024
+ g.MaskedEnum = dt;
2025
+ class _e extends P {
2026
+ /** */
2027
+ /** Enable characters overwriting */
2028
+ /** */
2029
+ /** */
2030
+ /** */
2031
+ updateOptions(t) {
2032
+ super.updateOptions(t);
2033
+ }
2034
+ _update(t) {
2035
+ super._update({
2036
+ ...t,
2037
+ validate: t.mask
2038
+ });
2039
+ }
2040
+ }
2041
+ g.MaskedFunction = _e;
2042
+ var Qt;
2043
+ class U extends P {
2044
+ /** Single char */
2045
+ /** Single char */
2046
+ /** Array of single chars */
2047
+ /** */
2048
+ /** */
2049
+ /** Digits after point */
2050
+ /** Flag to remove leading and trailing zeros in the end of editing */
2051
+ /** Flag to pad trailing zeros after point in the end of editing */
2052
+ /** Enable characters overwriting */
2053
+ /** */
2054
+ /** */
2055
+ /** */
2056
+ /** Format typed value to string */
2057
+ /** Parse string to get typed value */
2058
+ constructor(t) {
2059
+ super({
2060
+ ...U.DEFAULTS,
2061
+ ...t
2062
+ });
2063
+ }
2064
+ updateOptions(t) {
2065
+ super.updateOptions(t);
2066
+ }
2067
+ _update(t) {
2068
+ super._update(t), this._updateRegExps();
2069
+ }
2070
+ _updateRegExps() {
2071
+ const t = "^" + (this.allowNegative ? "[+|\\-]?" : ""), e = "\\d*", s = (this.scale ? "(" + Ct(this.radix) + "\\d{0," + this.scale + "})?" : "") + "$";
2072
+ this._numberRegExp = new RegExp(t + e + s), this._mapToRadixRegExp = new RegExp("[" + this.mapToRadix.map(Ct).join("") + "]", "g"), this._thousandsSeparatorRegExp = new RegExp(Ct(this.thousandsSeparator), "g");
2073
+ }
2074
+ _removeThousandsSeparators(t) {
2075
+ return t.replace(this._thousandsSeparatorRegExp, "");
2076
+ }
2077
+ _insertThousandsSeparators(t) {
2078
+ const e = t.split(this.radix);
2079
+ return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator), e.join(this.radix);
2080
+ }
2081
+ doPrepareChar(t, e) {
2082
+ e === void 0 && (e = {});
2083
+ const [s, r] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
2084
+ radix should be mapped when
2085
+ 1) input is done from keyboard = flags.input && flags.raw
2086
+ 2) unmasked value is set = !flags.input && !flags.raw
2087
+ and should not be mapped when
2088
+ 1) value is set = flags.input && !flags.raw
2089
+ 2) raw value is set = !flags.input && flags.raw
2090
+ */
2091
+ (e.input && e.raw || !e.input && !e.raw) ? t.replace(this._mapToRadixRegExp, this.radix) : t), e);
2092
+ return t && !s && (r.skip = !0), s && !this.allowPositive && !this.value && s !== "-" && r.aggregate(this._appendChar("-")), [s, r];
2093
+ }
2094
+ _separatorsCount(t, e) {
2095
+ e === void 0 && (e = !1);
2096
+ let s = 0;
2097
+ for (let r = 0; r < t; ++r)
2098
+ this._value.indexOf(this.thousandsSeparator, r) === r && (++s, e && (t += this.thousandsSeparator.length));
2099
+ return s;
2100
+ }
2101
+ _separatorsCountFromSlice(t) {
2102
+ return t === void 0 && (t = this._value), this._separatorsCount(this._removeThousandsSeparators(t).length, !0);
2103
+ }
2104
+ extractInput(t, e, s) {
2105
+ return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e), this._removeThousandsSeparators(super.extractInput(t, e, s));
2106
+ }
2107
+ _appendCharRaw(t, e) {
2108
+ e === void 0 && (e = {});
2109
+ const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, r = this._separatorsCountFromSlice(s);
2110
+ this._value = this._removeThousandsSeparators(this.value);
2111
+ const i = this._value;
2112
+ this._value += t;
2113
+ const n = this.number;
2114
+ let u = !isNaN(n), l = !1;
2115
+ if (u) {
2116
+ let S;
2117
+ this.min != null && this.min < 0 && this.number < this.min && (S = this.min), this.max != null && this.max > 0 && this.number > this.max && (S = this.max), S != null && (this.autofix ? (this._value = this.format(S, this).replace(U.UNMASKED_RADIX, this.radix), l || (l = i === this._value && !e.tail)) : u = !1), u && (u = !!this._value.match(this._numberRegExp));
2118
+ }
2119
+ let h;
2120
+ u ? h = new E({
2121
+ inserted: this._value.slice(i.length),
2122
+ rawInserted: l ? "" : t,
2123
+ skip: l
2124
+ }) : (this._value = i, h = new E()), this._value = this._insertThousandsSeparators(this._value);
2125
+ const v = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, _ = this._separatorsCountFromSlice(v);
2126
+ return h.tailShift += (_ - r) * this.thousandsSeparator.length, h;
2127
+ }
2128
+ _findSeparatorAround(t) {
2129
+ if (this.thousandsSeparator) {
2130
+ const e = t - this.thousandsSeparator.length + 1, s = this.value.indexOf(this.thousandsSeparator, e);
2131
+ if (s <= t) return s;
2132
+ }
2133
+ return -1;
2134
+ }
2135
+ _adjustRangeWithSeparators(t, e) {
2136
+ const s = this._findSeparatorAround(t);
2137
+ s >= 0 && (t = s);
2138
+ const r = this._findSeparatorAround(e);
2139
+ return r >= 0 && (e = r + this.thousandsSeparator.length), [t, e];
2140
+ }
2141
+ remove(t, e) {
2142
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e);
2143
+ const s = this.value.slice(0, t), r = this.value.slice(e), i = this._separatorsCount(s.length);
2144
+ this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(s + r));
2145
+ const n = this._separatorsCountFromSlice(s);
2146
+ return new E({
2147
+ tailShift: (n - i) * this.thousandsSeparator.length
2148
+ });
2149
+ }
2150
+ nearestInputPos(t, e) {
2151
+ if (!this.thousandsSeparator) return t;
2152
+ switch (e) {
2153
+ case m.NONE:
2154
+ case m.LEFT:
2155
+ case m.FORCE_LEFT: {
2156
+ const s = this._findSeparatorAround(t - 1);
2157
+ if (s >= 0) {
2158
+ const r = s + this.thousandsSeparator.length;
2159
+ if (t < r || this.value.length <= r || e === m.FORCE_LEFT)
2160
+ return s;
2161
+ }
2162
+ break;
2163
+ }
2164
+ case m.RIGHT:
2165
+ case m.FORCE_RIGHT: {
2166
+ const s = this._findSeparatorAround(t);
2167
+ if (s >= 0)
2168
+ return s + this.thousandsSeparator.length;
2169
+ }
2170
+ }
2171
+ return t;
2172
+ }
2173
+ doCommit() {
2174
+ if (this.value) {
2175
+ const t = this.number;
2176
+ let e = t;
2177
+ this.min != null && (e = Math.max(e, this.min)), this.max != null && (e = Math.min(e, this.max)), e !== t && (this.unmaskedValue = this.format(e, this));
2178
+ let s = this.value;
2179
+ this.normalizeZeros && (s = this._normalizeZeros(s)), this.padFractionalZeros && this.scale > 0 && (s = this._padFractionalZeros(s)), this._value = s;
2180
+ }
2181
+ super.doCommit();
2182
+ }
2183
+ _normalizeZeros(t) {
2184
+ const e = this._removeThousandsSeparators(t).split(this.radix);
2185
+ return e[0] = e[0].replace(/^(\D*)(0*)(\d*)/, (s, r, i, n) => r + n), t.length && !/\d$/.test(e[0]) && (e[0] = e[0] + "0"), e.length > 1 && (e[1] = e[1].replace(/0*$/, ""), e[1].length || (e.length = 1)), this._insertThousandsSeparators(e.join(this.radix));
2186
+ }
2187
+ _padFractionalZeros(t) {
2188
+ if (!t) return t;
2189
+ const e = t.split(this.radix);
2190
+ return e.length < 2 && e.push(""), e[1] = e[1].padEnd(this.scale, "0"), e.join(this.radix);
2191
+ }
2192
+ doSkipInvalid(t, e, s) {
2193
+ e === void 0 && (e = {});
2194
+ const r = this.scale === 0 && t !== this.thousandsSeparator && (t === this.radix || t === U.UNMASKED_RADIX || this.mapToRadix.includes(t));
2195
+ return super.doSkipInvalid(t, e, s) && !r;
2196
+ }
2197
+ get unmaskedValue() {
2198
+ return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, U.UNMASKED_RADIX);
2199
+ }
2200
+ set unmaskedValue(t) {
2201
+ super.unmaskedValue = t;
2202
+ }
2203
+ get typedValue() {
2204
+ return this.parse(this.unmaskedValue, this);
2205
+ }
2206
+ set typedValue(t) {
2207
+ this.rawInputValue = this.format(t, this).replace(U.UNMASKED_RADIX, this.radix);
2208
+ }
2209
+ /** Parsed Number */
2210
+ get number() {
2211
+ return this.typedValue;
2212
+ }
2213
+ set number(t) {
2214
+ this.typedValue = t;
2215
+ }
2216
+ get allowNegative() {
2217
+ return this.min != null && this.min < 0 || this.max != null && this.max < 0;
2218
+ }
2219
+ get allowPositive() {
2220
+ return this.min != null && this.min > 0 || this.max != null && this.max > 0;
2221
+ }
2222
+ typedValueEquals(t) {
2223
+ return (super.typedValueEquals(t) || U.EMPTY_VALUES.includes(t) && U.EMPTY_VALUES.includes(this.typedValue)) && !(t === 0 && this.value === "");
2224
+ }
2225
+ }
2226
+ Qt = U;
2227
+ U.UNMASKED_RADIX = ".";
2228
+ U.EMPTY_VALUES = [...P.EMPTY_VALUES, 0];
2229
+ U.DEFAULTS = {
2230
+ ...P.DEFAULTS,
2231
+ mask: Number,
2232
+ radix: ",",
2233
+ thousandsSeparator: "",
2234
+ mapToRadix: [Qt.UNMASKED_RADIX],
2235
+ min: Number.MIN_SAFE_INTEGER,
2236
+ max: Number.MAX_SAFE_INTEGER,
2237
+ scale: 2,
2238
+ normalizeZeros: !0,
2239
+ padFractionalZeros: !1,
2240
+ parse: Number,
2241
+ format: (a) => a.toLocaleString("en-US", {
2242
+ useGrouping: !1,
2243
+ maximumFractionDigits: 20
2244
+ })
2245
+ };
2246
+ g.MaskedNumber = U;
2247
+ const Rt = {
2248
+ MASKED: "value",
2249
+ UNMASKED: "unmaskedValue",
2250
+ TYPED: "typedValue"
2251
+ };
2252
+ function te(a, t, e) {
2253
+ t === void 0 && (t = Rt.MASKED), e === void 0 && (e = Rt.MASKED);
2254
+ const s = K(a);
2255
+ return (r) => s.runIsolated((i) => (i[t] = r, i[e]));
2256
+ }
2257
+ function ke(a, t, e, s) {
2258
+ return te(t, e, s)(a);
2259
+ }
2260
+ g.PIPE_TYPE = Rt;
2261
+ g.createPipe = te;
2262
+ g.pipe = ke;
2263
+ class Ee extends L {
2264
+ get repeatFrom() {
2265
+ var t;
2266
+ return (t = Array.isArray(this.repeat) ? this.repeat[0] : this.repeat === 1 / 0 ? 0 : this.repeat) != null ? t : 0;
2267
+ }
2268
+ get repeatTo() {
2269
+ var t;
2270
+ return (t = Array.isArray(this.repeat) ? this.repeat[1] : this.repeat) != null ? t : 1 / 0;
2271
+ }
2272
+ constructor(t) {
2273
+ super(t);
2274
+ }
2275
+ updateOptions(t) {
2276
+ super.updateOptions(t);
2277
+ }
2278
+ _update(t) {
2279
+ var e, s, r;
2280
+ const {
2281
+ repeat: i,
2282
+ ...n
2283
+ } = et(t);
2284
+ this._blockOpts = Object.assign({}, this._blockOpts, n);
2285
+ const u = K(this._blockOpts);
2286
+ this.repeat = (e = (s = i ?? u.repeat) != null ? s : this.repeat) != null ? e : 1 / 0, super._update({
2287
+ mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((r = this._blocks) == null ? void 0 : r.length) || 0, this.repeatFrom)),
2288
+ blocks: {
2289
+ m: u
2290
+ },
2291
+ eager: u.eager,
2292
+ overwrite: u.overwrite,
2293
+ skipInvalid: u.skipInvalid,
2294
+ lazy: u.lazy,
2295
+ placeholderChar: u.placeholderChar,
2296
+ displayChar: u.displayChar
2297
+ });
2298
+ }
2299
+ _allocateBlock(t) {
2300
+ if (t < this._blocks.length) return this._blocks[t];
2301
+ if (this.repeatTo === 1 / 0 || this._blocks.length < this.repeatTo)
2302
+ return this._blocks.push(K(this._blockOpts)), this.mask += "m", this._blocks[this._blocks.length - 1];
2303
+ }
2304
+ _appendCharRaw(t, e) {
2305
+ e === void 0 && (e = {});
2306
+ const s = new E();
2307
+ for (
2308
+ let l = (r = (i = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : i.index) != null ? r : Math.max(this._blocks.length - 1, 0), h, v;
2309
+ // try to get a block or
2310
+ // try to allocate a new block if not allocated already
2311
+ h = (n = this._blocks[l]) != null ? n : v = !v && this._allocateBlock(l);
2312
+ ++l
2313
+ ) {
2314
+ var r, i, n, u;
2315
+ const _ = h._appendChar(t, {
2316
+ ...e,
2317
+ _beforeTailState: (u = e._beforeTailState) == null || (u = u._blocks) == null ? void 0 : u[l]
2318
+ });
2319
+ if (_.skip && v) {
2320
+ this._blocks.pop(), this.mask = this.mask.slice(1);
2321
+ break;
2322
+ }
2323
+ if (s.aggregate(_), _.consumed) break;
2324
+ }
2325
+ return s;
2326
+ }
2327
+ _trimEmptyTail(t, e) {
2328
+ var s, r;
2329
+ t === void 0 && (t = 0);
2330
+ const i = Math.max(((s = this._mapPosToBlock(t)) == null ? void 0 : s.index) || 0, this.repeatFrom, 0);
2331
+ let n;
2332
+ e != null && (n = (r = this._mapPosToBlock(e)) == null ? void 0 : r.index), n == null && (n = this._blocks.length - 1);
2333
+ let u = 0;
2334
+ for (let l = n; i <= l && !this._blocks[l].unmaskedValue; --l, ++u)
2335
+ ;
2336
+ u && (this._blocks.splice(n - u + 1, u), this.mask = this.mask.slice(u));
2337
+ }
2338
+ reset() {
2339
+ super.reset(), this._trimEmptyTail();
2340
+ }
2341
+ remove(t, e) {
2342
+ t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
2343
+ const s = super.remove(t, e);
2344
+ return this._trimEmptyTail(t, e), s;
2345
+ }
2346
+ totalInputPositions(t, e) {
2347
+ return t === void 0 && (t = 0), e == null && this.repeatTo === 1 / 0 ? 1 / 0 : super.totalInputPositions(t, e);
2348
+ }
2349
+ get state() {
2350
+ return super.state;
2351
+ }
2352
+ set state(t) {
2353
+ this._blocks.length = t._blocks.length, this.mask = this.mask.slice(0, this._blocks.length), super.state = t;
2354
+ }
2355
+ }
2356
+ g.RepeatBlock = Ee;
2357
+ try {
2358
+ globalThis.IMask = g;
2359
+ } catch {
2360
+ }
2361
+ function ee(a) {
2362
+ return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
2363
+ }
2364
+ var nt = { exports: {} }, at = { exports: {} }, I = {};
2365
+ /** @license React v16.13.1
2366
+ * react-is.production.min.js
2367
+ *
2368
+ * Copyright (c) Facebook, Inc. and its affiliates.
2369
+ *
2370
+ * This source code is licensed under the MIT license found in the
2371
+ * LICENSE file in the root directory of this source tree.
2372
+ */
2373
+ var Lt;
2374
+ function ye() {
2375
+ if (Lt) return I;
2376
+ Lt = 1;
2377
+ var a = typeof Symbol == "function" && Symbol.for, t = a ? Symbol.for("react.element") : 60103, e = a ? Symbol.for("react.portal") : 60106, s = a ? Symbol.for("react.fragment") : 60107, r = a ? Symbol.for("react.strict_mode") : 60108, i = a ? Symbol.for("react.profiler") : 60114, n = a ? Symbol.for("react.provider") : 60109, u = a ? Symbol.for("react.context") : 60110, l = a ? Symbol.for("react.async_mode") : 60111, h = a ? Symbol.for("react.concurrent_mode") : 60111, v = a ? Symbol.for("react.forward_ref") : 60112, _ = a ? Symbol.for("react.suspense") : 60113, S = a ? Symbol.for("react.suspense_list") : 60120, B = a ? Symbol.for("react.memo") : 60115, N = a ? Symbol.for("react.lazy") : 60116, M = a ? Symbol.for("react.block") : 60121, O = a ? Symbol.for("react.fundamental") : 60117, q = a ? Symbol.for("react.responder") : 60118, tt = a ? Symbol.for("react.scope") : 60119;
2378
+ function V(c) {
2379
+ if (typeof c == "object" && c !== null) {
2380
+ var W = c.$$typeof;
2381
+ switch (W) {
2382
+ case t:
2383
+ switch (c = c.type, c) {
2384
+ case l:
2385
+ case h:
2386
+ case s:
2387
+ case i:
2388
+ case r:
2389
+ case _:
2390
+ return c;
2391
+ default:
2392
+ switch (c = c && c.$$typeof, c) {
2393
+ case u:
2394
+ case v:
2395
+ case N:
2396
+ case B:
2397
+ case n:
2398
+ return c;
2399
+ default:
2400
+ return W;
2401
+ }
2402
+ }
2403
+ case e:
2404
+ return W;
2405
+ }
2406
+ }
2407
+ }
2408
+ function D(c) {
2409
+ return V(c) === h;
2410
+ }
2411
+ return I.AsyncMode = l, I.ConcurrentMode = h, I.ContextConsumer = u, I.ContextProvider = n, I.Element = t, I.ForwardRef = v, I.Fragment = s, I.Lazy = N, I.Memo = B, I.Portal = e, I.Profiler = i, I.StrictMode = r, I.Suspense = _, I.isAsyncMode = function(c) {
2412
+ return D(c) || V(c) === l;
2413
+ }, I.isConcurrentMode = D, I.isContextConsumer = function(c) {
2414
+ return V(c) === u;
2415
+ }, I.isContextProvider = function(c) {
2416
+ return V(c) === n;
2417
+ }, I.isElement = function(c) {
2418
+ return typeof c == "object" && c !== null && c.$$typeof === t;
2419
+ }, I.isForwardRef = function(c) {
2420
+ return V(c) === v;
2421
+ }, I.isFragment = function(c) {
2422
+ return V(c) === s;
2423
+ }, I.isLazy = function(c) {
2424
+ return V(c) === N;
2425
+ }, I.isMemo = function(c) {
2426
+ return V(c) === B;
2427
+ }, I.isPortal = function(c) {
2428
+ return V(c) === e;
2429
+ }, I.isProfiler = function(c) {
2430
+ return V(c) === i;
2431
+ }, I.isStrictMode = function(c) {
2432
+ return V(c) === r;
2433
+ }, I.isSuspense = function(c) {
2434
+ return V(c) === _;
2435
+ }, I.isValidElementType = function(c) {
2436
+ return typeof c == "string" || typeof c == "function" || c === s || c === h || c === i || c === r || c === _ || c === S || typeof c == "object" && c !== null && (c.$$typeof === N || c.$$typeof === B || c.$$typeof === n || c.$$typeof === u || c.$$typeof === v || c.$$typeof === O || c.$$typeof === q || c.$$typeof === tt || c.$$typeof === M);
2437
+ }, I.typeOf = V, I;
2438
+ }
2439
+ var w = {};
2440
+ /** @license React v16.13.1
2441
+ * react-is.development.js
2442
+ *
2443
+ * Copyright (c) Facebook, Inc. and its affiliates.
2444
+ *
2445
+ * This source code is licensed under the MIT license found in the
2446
+ * LICENSE file in the root directory of this source tree.
2447
+ */
2448
+ var Nt;
2449
+ function Ce() {
2450
+ return Nt || (Nt = 1, process.env.NODE_ENV !== "production" && function() {
2451
+ var a = typeof Symbol == "function" && Symbol.for, t = a ? Symbol.for("react.element") : 60103, e = a ? Symbol.for("react.portal") : 60106, s = a ? Symbol.for("react.fragment") : 60107, r = a ? Symbol.for("react.strict_mode") : 60108, i = a ? Symbol.for("react.profiler") : 60114, n = a ? Symbol.for("react.provider") : 60109, u = a ? Symbol.for("react.context") : 60110, l = a ? Symbol.for("react.async_mode") : 60111, h = a ? Symbol.for("react.concurrent_mode") : 60111, v = a ? Symbol.for("react.forward_ref") : 60112, _ = a ? Symbol.for("react.suspense") : 60113, S = a ? Symbol.for("react.suspense_list") : 60120, B = a ? Symbol.for("react.memo") : 60115, N = a ? Symbol.for("react.lazy") : 60116, M = a ? Symbol.for("react.block") : 60121, O = a ? Symbol.for("react.fundamental") : 60117, q = a ? Symbol.for("react.responder") : 60118, tt = a ? Symbol.for("react.scope") : 60119;
2452
+ function V(p) {
2453
+ return typeof p == "string" || typeof p == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
2454
+ p === s || p === h || p === i || p === r || p === _ || p === S || typeof p == "object" && p !== null && (p.$$typeof === N || p.$$typeof === B || p.$$typeof === n || p.$$typeof === u || p.$$typeof === v || p.$$typeof === O || p.$$typeof === q || p.$$typeof === tt || p.$$typeof === M);
2455
+ }
2456
+ function D(p) {
2457
+ if (typeof p == "object" && p !== null) {
2458
+ var Y = p.$$typeof;
2459
+ switch (Y) {
2460
+ case t:
2461
+ var rt = p.type;
2462
+ switch (rt) {
2463
+ case l:
2464
+ case h:
2465
+ case s:
2466
+ case i:
2467
+ case r:
2468
+ case _:
2469
+ return rt;
2470
+ default:
2471
+ var Ot = rt && rt.$$typeof;
2472
+ switch (Ot) {
2473
+ case u:
2474
+ case v:
2475
+ case N:
2476
+ case B:
2477
+ case n:
2478
+ return Ot;
2479
+ default:
2480
+ return Y;
2481
+ }
2482
+ }
2483
+ case e:
2484
+ return Y;
2485
+ }
2486
+ }
2487
+ }
2488
+ var c = l, W = h, ft = u, mt = n, vt = t, gt = v, st = s, _t = N, kt = B, Q = e, Et = i, $ = r, Z = _, it = !1;
2489
+ function yt(p) {
2490
+ return it || (it = !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.")), o(p) || D(p) === l;
2491
+ }
2492
+ function o(p) {
2493
+ return D(p) === h;
2494
+ }
2495
+ function d(p) {
2496
+ return D(p) === u;
2497
+ }
2498
+ function b(p) {
2499
+ return D(p) === n;
2500
+ }
2501
+ function C(p) {
2502
+ return typeof p == "object" && p !== null && p.$$typeof === t;
2503
+ }
2504
+ function k(p) {
2505
+ return D(p) === v;
2506
+ }
2507
+ function F(p) {
2508
+ return D(p) === s;
2509
+ }
2510
+ function y(p) {
2511
+ return D(p) === N;
2512
+ }
2513
+ function A(p) {
2514
+ return D(p) === B;
2515
+ }
2516
+ function x(p) {
2517
+ return D(p) === e;
2518
+ }
2519
+ function R(p) {
2520
+ return D(p) === i;
2521
+ }
2522
+ function T(p) {
2523
+ return D(p) === r;
2524
+ }
2525
+ function j(p) {
2526
+ return D(p) === _;
2527
+ }
2528
+ w.AsyncMode = c, w.ConcurrentMode = W, w.ContextConsumer = ft, w.ContextProvider = mt, w.Element = vt, w.ForwardRef = gt, w.Fragment = st, w.Lazy = _t, w.Memo = kt, w.Portal = Q, w.Profiler = Et, w.StrictMode = $, w.Suspense = Z, w.isAsyncMode = yt, w.isConcurrentMode = o, w.isContextConsumer = d, w.isContextProvider = b, w.isElement = C, w.isForwardRef = k, w.isFragment = F, w.isLazy = y, w.isMemo = A, w.isPortal = x, w.isProfiler = R, w.isStrictMode = T, w.isSuspense = j, w.isValidElementType = V, w.typeOf = D;
2529
+ }()), w;
2530
+ }
2531
+ var jt;
2532
+ function se() {
2533
+ return jt || (jt = 1, process.env.NODE_ENV === "production" ? at.exports = ye() : at.exports = Ce()), at.exports;
2534
+ }
2535
+ /*
2536
+ object-assign
2537
+ (c) Sindre Sorhus
2538
+ @license MIT
2539
+ */
2540
+ var At, Ut;
2541
+ function Ae() {
2542
+ if (Ut) return At;
2543
+ Ut = 1;
2544
+ var a = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, e = Object.prototype.propertyIsEnumerable;
2545
+ function s(i) {
2546
+ if (i == null)
2547
+ throw new TypeError("Object.assign cannot be called with null or undefined");
2548
+ return Object(i);
2549
+ }
2550
+ function r() {
2551
+ try {
2552
+ if (!Object.assign)
2553
+ return !1;
2554
+ var i = new String("abc");
2555
+ if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
2556
+ return !1;
2557
+ for (var n = {}, u = 0; u < 10; u++)
2558
+ n["_" + String.fromCharCode(u)] = u;
2559
+ var l = Object.getOwnPropertyNames(n).map(function(v) {
2560
+ return n[v];
2561
+ });
2562
+ if (l.join("") !== "0123456789")
2563
+ return !1;
2564
+ var h = {};
2565
+ return "abcdefghijklmnopqrst".split("").forEach(function(v) {
2566
+ h[v] = v;
2567
+ }), Object.keys(Object.assign({}, h)).join("") === "abcdefghijklmnopqrst";
2568
+ } catch {
2569
+ return !1;
2570
+ }
2571
+ }
2572
+ return At = r() ? Object.assign : function(i, n) {
2573
+ for (var u, l = s(i), h, v = 1; v < arguments.length; v++) {
2574
+ u = Object(arguments[v]);
2575
+ for (var _ in u)
2576
+ t.call(u, _) && (l[_] = u[_]);
2577
+ if (a) {
2578
+ h = a(u);
2579
+ for (var S = 0; S < h.length; S++)
2580
+ e.call(u, h[S]) && (l[h[S]] = u[h[S]]);
2581
+ }
2582
+ }
2583
+ return l;
2584
+ }, At;
2585
+ }
2586
+ var bt, qt;
2587
+ function Bt() {
2588
+ if (qt) return bt;
2589
+ qt = 1;
2590
+ var a = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
2591
+ return bt = a, bt;
2592
+ }
2593
+ var St, $t;
2594
+ function ie() {
2595
+ return $t || ($t = 1, St = Function.call.bind(Object.prototype.hasOwnProperty)), St;
2596
+ }
2597
+ var Ft, Yt;
2598
+ function be() {
2599
+ if (Yt) return Ft;
2600
+ Yt = 1;
2601
+ var a = function() {
2602
+ };
2603
+ if (process.env.NODE_ENV !== "production") {
2604
+ var t = /* @__PURE__ */ Bt(), e = {}, s = /* @__PURE__ */ ie();
2605
+ a = function(i) {
2606
+ var n = "Warning: " + i;
2607
+ typeof console < "u" && console.error(n);
2608
+ try {
2609
+ throw new Error(n);
2610
+ } catch {
2611
+ }
2612
+ };
2613
+ }
2614
+ function r(i, n, u, l, h) {
2615
+ if (process.env.NODE_ENV !== "production") {
2616
+ for (var v in i)
2617
+ if (s(i, v)) {
2618
+ var _;
2619
+ try {
2620
+ if (typeof i[v] != "function") {
2621
+ var S = Error(
2622
+ (l || "React class") + ": " + u + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
2623
+ );
2624
+ throw S.name = "Invariant Violation", S;
2625
+ }
2626
+ _ = i[v](n, v, l, u, null, t);
2627
+ } catch (N) {
2628
+ _ = N;
2629
+ }
2630
+ if (_ && !(_ instanceof Error) && a(
2631
+ (l || "React class") + ": type specification of " + u + " `" + v + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof _ + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
2632
+ ), _ instanceof Error && !(_.message in e)) {
2633
+ e[_.message] = !0;
2634
+ var B = h ? h() : "";
2635
+ a(
2636
+ "Failed " + u + " type: " + _.message + (B ?? "")
2637
+ );
2638
+ }
2639
+ }
2640
+ }
2641
+ }
2642
+ return r.resetWarningCache = function() {
2643
+ process.env.NODE_ENV !== "production" && (e = {});
2644
+ }, Ft = r, Ft;
2645
+ }
2646
+ var xt, Ht;
2647
+ function Se() {
2648
+ if (Ht) return xt;
2649
+ Ht = 1;
2650
+ var a = se(), t = Ae(), e = /* @__PURE__ */ Bt(), s = /* @__PURE__ */ ie(), r = /* @__PURE__ */ be(), i = function() {
2651
+ };
2652
+ process.env.NODE_ENV !== "production" && (i = function(u) {
2653
+ var l = "Warning: " + u;
2654
+ typeof console < "u" && console.error(l);
2655
+ try {
2656
+ throw new Error(l);
2657
+ } catch {
2658
+ }
2659
+ });
2660
+ function n() {
2661
+ return null;
2662
+ }
2663
+ return xt = function(u, l) {
2664
+ var h = typeof Symbol == "function" && Symbol.iterator, v = "@@iterator";
2665
+ function _(o) {
2666
+ var d = o && (h && o[h] || o[v]);
2667
+ if (typeof d == "function")
2668
+ return d;
2669
+ }
2670
+ var S = "<<anonymous>>", B = {
2671
+ array: q("array"),
2672
+ bigint: q("bigint"),
2673
+ bool: q("boolean"),
2674
+ func: q("function"),
2675
+ number: q("number"),
2676
+ object: q("object"),
2677
+ string: q("string"),
2678
+ symbol: q("symbol"),
2679
+ any: tt(),
2680
+ arrayOf: V,
2681
+ element: D(),
2682
+ elementType: c(),
2683
+ instanceOf: W,
2684
+ node: gt(),
2685
+ objectOf: mt,
2686
+ oneOf: ft,
2687
+ oneOfType: vt,
2688
+ shape: _t,
2689
+ exact: kt
2690
+ };
2691
+ function N(o, d) {
2692
+ return o === d ? o !== 0 || 1 / o === 1 / d : o !== o && d !== d;
2693
+ }
2694
+ function M(o, d) {
2695
+ this.message = o, this.data = d && typeof d == "object" ? d : {}, this.stack = "";
2696
+ }
2697
+ M.prototype = Error.prototype;
2698
+ function O(o) {
2699
+ if (process.env.NODE_ENV !== "production")
2700
+ var d = {}, b = 0;
2701
+ function C(F, y, A, x, R, T, j) {
2702
+ if (x = x || S, T = T || A, j !== e) {
2703
+ if (l) {
2704
+ var p = new Error(
2705
+ "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"
2706
+ );
2707
+ throw p.name = "Invariant Violation", p;
2708
+ } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
2709
+ var Y = x + ":" + A;
2710
+ !d[Y] && // Avoid spamming the console because they are often not actionable except for lib authors
2711
+ b < 3 && (i(
2712
+ "You are manually calling a React.PropTypes validation function for the `" + T + "` prop on `" + x + "`. 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."
2713
+ ), d[Y] = !0, b++);
2714
+ }
2715
+ }
2716
+ return y[A] == null ? F ? y[A] === null ? new M("The " + R + " `" + T + "` is marked as required " + ("in `" + x + "`, but its value is `null`.")) : new M("The " + R + " `" + T + "` is marked as required in " + ("`" + x + "`, but its value is `undefined`.")) : null : o(y, A, x, R, T);
2717
+ }
2718
+ var k = C.bind(null, !1);
2719
+ return k.isRequired = C.bind(null, !0), k;
2720
+ }
2721
+ function q(o) {
2722
+ function d(b, C, k, F, y, A) {
2723
+ var x = b[C], R = $(x);
2724
+ if (R !== o) {
2725
+ var T = Z(x);
2726
+ return new M(
2727
+ "Invalid " + F + " `" + y + "` of type " + ("`" + T + "` supplied to `" + k + "`, expected ") + ("`" + o + "`."),
2728
+ { expectedType: o }
2729
+ );
2730
+ }
2731
+ return null;
2732
+ }
2733
+ return O(d);
2734
+ }
2735
+ function tt() {
2736
+ return O(n);
2737
+ }
2738
+ function V(o) {
2739
+ function d(b, C, k, F, y) {
2740
+ if (typeof o != "function")
2741
+ return new M("Property `" + y + "` of component `" + k + "` has invalid PropType notation inside arrayOf.");
2742
+ var A = b[C];
2743
+ if (!Array.isArray(A)) {
2744
+ var x = $(A);
2745
+ return new M("Invalid " + F + " `" + y + "` of type " + ("`" + x + "` supplied to `" + k + "`, expected an array."));
2746
+ }
2747
+ for (var R = 0; R < A.length; R++) {
2748
+ var T = o(A, R, k, F, y + "[" + R + "]", e);
2749
+ if (T instanceof Error)
2750
+ return T;
2751
+ }
2752
+ return null;
2753
+ }
2754
+ return O(d);
2755
+ }
2756
+ function D() {
2757
+ function o(d, b, C, k, F) {
2758
+ var y = d[b];
2759
+ if (!u(y)) {
2760
+ var A = $(y);
2761
+ return new M("Invalid " + k + " `" + F + "` of type " + ("`" + A + "` supplied to `" + C + "`, expected a single ReactElement."));
2762
+ }
2763
+ return null;
2764
+ }
2765
+ return O(o);
2766
+ }
2767
+ function c() {
2768
+ function o(d, b, C, k, F) {
2769
+ var y = d[b];
2770
+ if (!a.isValidElementType(y)) {
2771
+ var A = $(y);
2772
+ return new M("Invalid " + k + " `" + F + "` of type " + ("`" + A + "` supplied to `" + C + "`, expected a single ReactElement type."));
2773
+ }
2774
+ return null;
2775
+ }
2776
+ return O(o);
2777
+ }
2778
+ function W(o) {
2779
+ function d(b, C, k, F, y) {
2780
+ if (!(b[C] instanceof o)) {
2781
+ var A = o.name || S, x = yt(b[C]);
2782
+ return new M("Invalid " + F + " `" + y + "` of type " + ("`" + x + "` supplied to `" + k + "`, expected ") + ("instance of `" + A + "`."));
2783
+ }
2784
+ return null;
2785
+ }
2786
+ return O(d);
2787
+ }
2788
+ function ft(o) {
2789
+ if (!Array.isArray(o))
2790
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
2791
+ "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])."
2792
+ ) : i("Invalid argument supplied to oneOf, expected an array.")), n;
2793
+ function d(b, C, k, F, y) {
2794
+ for (var A = b[C], x = 0; x < o.length; x++)
2795
+ if (N(A, o[x]))
2796
+ return null;
2797
+ var R = JSON.stringify(o, function(j, p) {
2798
+ var Y = Z(p);
2799
+ return Y === "symbol" ? String(p) : p;
2800
+ });
2801
+ return new M("Invalid " + F + " `" + y + "` of value `" + String(A) + "` " + ("supplied to `" + k + "`, expected one of " + R + "."));
2802
+ }
2803
+ return O(d);
2804
+ }
2805
+ function mt(o) {
2806
+ function d(b, C, k, F, y) {
2807
+ if (typeof o != "function")
2808
+ return new M("Property `" + y + "` of component `" + k + "` has invalid PropType notation inside objectOf.");
2809
+ var A = b[C], x = $(A);
2810
+ if (x !== "object")
2811
+ return new M("Invalid " + F + " `" + y + "` of type " + ("`" + x + "` supplied to `" + k + "`, expected an object."));
2812
+ for (var R in A)
2813
+ if (s(A, R)) {
2814
+ var T = o(A, R, k, F, y + "." + R, e);
2815
+ if (T instanceof Error)
2816
+ return T;
2817
+ }
2818
+ return null;
2819
+ }
2820
+ return O(d);
2821
+ }
2822
+ function vt(o) {
2823
+ if (!Array.isArray(o))
2824
+ return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), n;
2825
+ for (var d = 0; d < o.length; d++) {
2826
+ var b = o[d];
2827
+ if (typeof b != "function")
2828
+ return i(
2829
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + it(b) + " at index " + d + "."
2830
+ ), n;
2831
+ }
2832
+ function C(k, F, y, A, x) {
2833
+ for (var R = [], T = 0; T < o.length; T++) {
2834
+ var j = o[T], p = j(k, F, y, A, x, e);
2835
+ if (p == null)
2836
+ return null;
2837
+ p.data && s(p.data, "expectedType") && R.push(p.data.expectedType);
2838
+ }
2839
+ var Y = R.length > 0 ? ", expected one of type [" + R.join(", ") + "]" : "";
2840
+ return new M("Invalid " + A + " `" + x + "` supplied to " + ("`" + y + "`" + Y + "."));
2841
+ }
2842
+ return O(C);
2843
+ }
2844
+ function gt() {
2845
+ function o(d, b, C, k, F) {
2846
+ return Q(d[b]) ? null : new M("Invalid " + k + " `" + F + "` supplied to " + ("`" + C + "`, expected a ReactNode."));
2847
+ }
2848
+ return O(o);
2849
+ }
2850
+ function st(o, d, b, C, k) {
2851
+ return new M(
2852
+ (o || "React class") + ": " + d + " type `" + b + "." + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + k + "`."
2853
+ );
2854
+ }
2855
+ function _t(o) {
2856
+ function d(b, C, k, F, y) {
2857
+ var A = b[C], x = $(A);
2858
+ if (x !== "object")
2859
+ return new M("Invalid " + F + " `" + y + "` of type `" + x + "` " + ("supplied to `" + k + "`, expected `object`."));
2860
+ for (var R in o) {
2861
+ var T = o[R];
2862
+ if (typeof T != "function")
2863
+ return st(k, F, y, R, Z(T));
2864
+ var j = T(A, R, k, F, y + "." + R, e);
2865
+ if (j)
2866
+ return j;
2867
+ }
2868
+ return null;
2869
+ }
2870
+ return O(d);
2871
+ }
2872
+ function kt(o) {
2873
+ function d(b, C, k, F, y) {
2874
+ var A = b[C], x = $(A);
2875
+ if (x !== "object")
2876
+ return new M("Invalid " + F + " `" + y + "` of type `" + x + "` " + ("supplied to `" + k + "`, expected `object`."));
2877
+ var R = t({}, b[C], o);
2878
+ for (var T in R) {
2879
+ var j = o[T];
2880
+ if (s(o, T) && typeof j != "function")
2881
+ return st(k, F, y, T, Z(j));
2882
+ if (!j)
2883
+ return new M(
2884
+ "Invalid " + F + " `" + y + "` key `" + T + "` supplied to `" + k + "`.\nBad object: " + JSON.stringify(b[C], null, " ") + `
2885
+ Valid keys: ` + JSON.stringify(Object.keys(o), null, " ")
2886
+ );
2887
+ var p = j(A, T, k, F, y + "." + T, e);
2888
+ if (p)
2889
+ return p;
2890
+ }
2891
+ return null;
2892
+ }
2893
+ return O(d);
2894
+ }
2895
+ function Q(o) {
2896
+ switch (typeof o) {
2897
+ case "number":
2898
+ case "string":
2899
+ case "undefined":
2900
+ return !0;
2901
+ case "boolean":
2902
+ return !o;
2903
+ case "object":
2904
+ if (Array.isArray(o))
2905
+ return o.every(Q);
2906
+ if (o === null || u(o))
2907
+ return !0;
2908
+ var d = _(o);
2909
+ if (d) {
2910
+ var b = d.call(o), C;
2911
+ if (d !== o.entries) {
2912
+ for (; !(C = b.next()).done; )
2913
+ if (!Q(C.value))
2914
+ return !1;
2915
+ } else
2916
+ for (; !(C = b.next()).done; ) {
2917
+ var k = C.value;
2918
+ if (k && !Q(k[1]))
2919
+ return !1;
2920
+ }
2921
+ } else
2922
+ return !1;
2923
+ return !0;
2924
+ default:
2925
+ return !1;
2926
+ }
2927
+ }
2928
+ function Et(o, d) {
2929
+ return o === "symbol" ? !0 : d ? d["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && d instanceof Symbol : !1;
2930
+ }
2931
+ function $(o) {
2932
+ var d = typeof o;
2933
+ return Array.isArray(o) ? "array" : o instanceof RegExp ? "object" : Et(d, o) ? "symbol" : d;
2934
+ }
2935
+ function Z(o) {
2936
+ if (typeof o > "u" || o === null)
2937
+ return "" + o;
2938
+ var d = $(o);
2939
+ if (d === "object") {
2940
+ if (o instanceof Date)
2941
+ return "date";
2942
+ if (o instanceof RegExp)
2943
+ return "regexp";
2944
+ }
2945
+ return d;
2946
+ }
2947
+ function it(o) {
2948
+ var d = Z(o);
2949
+ switch (d) {
2950
+ case "array":
2951
+ case "object":
2952
+ return "an " + d;
2953
+ case "boolean":
2954
+ case "date":
2955
+ case "regexp":
2956
+ return "a " + d;
2957
+ default:
2958
+ return d;
2959
+ }
2960
+ }
2961
+ function yt(o) {
2962
+ return !o.constructor || !o.constructor.name ? S : o.constructor.name;
2963
+ }
2964
+ return B.checkPropTypes = r, B.resetWarningCache = r.resetWarningCache, B.PropTypes = B, B;
2965
+ }, xt;
2966
+ }
2967
+ var Tt, zt;
2968
+ function Fe() {
2969
+ if (zt) return Tt;
2970
+ zt = 1;
2971
+ var a = /* @__PURE__ */ Bt();
2972
+ function t() {
2973
+ }
2974
+ function e() {
2975
+ }
2976
+ return e.resetWarningCache = t, Tt = function() {
2977
+ function s(n, u, l, h, v, _) {
2978
+ if (_ !== a) {
2979
+ var S = new Error(
2980
+ "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"
2981
+ );
2982
+ throw S.name = "Invariant Violation", S;
2983
+ }
2984
+ }
2985
+ s.isRequired = s;
2986
+ function r() {
2987
+ return s;
2988
+ }
2989
+ var i = {
2990
+ array: s,
2991
+ bigint: s,
2992
+ bool: s,
2993
+ func: s,
2994
+ number: s,
2995
+ object: s,
2996
+ string: s,
2997
+ symbol: s,
2998
+ any: s,
2999
+ arrayOf: r,
3000
+ element: s,
3001
+ elementType: s,
3002
+ instanceOf: r,
3003
+ node: s,
3004
+ objectOf: r,
3005
+ oneOf: r,
3006
+ oneOfType: r,
3007
+ shape: r,
3008
+ exact: r,
3009
+ checkPropTypes: e,
3010
+ resetWarningCache: t
3011
+ };
3012
+ return i.PropTypes = i, i;
3013
+ }, Tt;
3014
+ }
3015
+ var Kt;
3016
+ function xe() {
3017
+ if (Kt) return nt.exports;
3018
+ if (Kt = 1, process.env.NODE_ENV !== "production") {
3019
+ var a = se(), t = !0;
3020
+ nt.exports = /* @__PURE__ */ Se()(a.isElement, t);
3021
+ } else
3022
+ nt.exports = /* @__PURE__ */ Fe()();
3023
+ return nt.exports;
3024
+ }
3025
+ var Te = /* @__PURE__ */ xe();
3026
+ const f = /* @__PURE__ */ ee(Te), re = {
3027
+ // common
3028
+ mask: f.oneOfType([f.array, f.func, f.string, f.instanceOf(RegExp), f.oneOf([Date, Number, g.Masked]), f.instanceOf(g.Masked)]),
3029
+ value: f.any,
3030
+ unmask: f.oneOfType([f.bool, f.oneOf(["typed"])]),
3031
+ prepare: f.func,
3032
+ prepareChar: f.func,
3033
+ validate: f.func,
3034
+ commit: f.func,
3035
+ overwrite: f.oneOfType([f.bool, f.oneOf(["shift"])]),
3036
+ eager: f.oneOfType([f.bool, f.oneOf(["append", "remove"])]),
3037
+ skipInvalid: f.bool,
3038
+ // events
3039
+ onAccept: f.func,
3040
+ onComplete: f.func,
3041
+ // pattern
3042
+ placeholderChar: f.string,
3043
+ displayChar: f.string,
3044
+ lazy: f.bool,
3045
+ definitions: f.object,
3046
+ blocks: f.object,
3047
+ // enum
3048
+ enum: f.arrayOf(f.string),
3049
+ // range
3050
+ maxLength: f.number,
3051
+ from: f.number,
3052
+ to: f.number,
3053
+ // date
3054
+ pattern: f.string,
3055
+ format: f.func,
3056
+ parse: f.func,
3057
+ autofix: f.oneOfType([f.bool, f.oneOf(["pad"])]),
3058
+ // number
3059
+ radix: f.string,
3060
+ thousandsSeparator: f.string,
3061
+ mapToRadix: f.arrayOf(f.string),
3062
+ scale: f.number,
3063
+ normalizeZeros: f.bool,
3064
+ padFractionalZeros: f.bool,
3065
+ min: f.oneOfType([f.number, f.instanceOf(Date)]),
3066
+ max: f.oneOfType([f.number, f.instanceOf(Date)]),
3067
+ // dynamic
3068
+ dispatch: f.func,
3069
+ // ref
3070
+ inputRef: f.oneOfType([f.func, f.shape({
3071
+ current: f.object
3072
+ })])
3073
+ }, ne = Object.keys(re).filter((a) => a !== "value"), Ie = ["value", "unmask", "onAccept", "onComplete", "inputRef"], we = ne.filter((a) => Ie.indexOf(a) < 0);
3074
+ function Re(a) {
3075
+ var t;
3076
+ const e = (t = class extends X.Component {
3077
+ constructor(i) {
3078
+ super(i), this._inputRef = this._inputRef.bind(this);
3079
+ }
3080
+ componentDidMount() {
3081
+ this.props.mask && this.initMask();
3082
+ }
3083
+ componentDidUpdate() {
3084
+ const i = this.props, n = this._extractMaskOptionsFromProps(i);
3085
+ if (n.mask)
3086
+ this.maskRef ? (this.maskRef.updateOptions(n), "value" in i && i.value !== void 0 && (this.maskValue = i.value)) : this.initMask(n);
3087
+ else if (this.destroyMask(), "value" in i && i.value !== void 0) {
3088
+ var u;
3089
+ (u = this.element) != null && u.isContentEditable && this.element.tagName !== "INPUT" && this.element.tagName !== "TEXTAREA" ? this.element.textContent = i.value : this.element.value = i.value;
3090
+ }
3091
+ }
3092
+ componentWillUnmount() {
3093
+ this.destroyMask();
3094
+ }
3095
+ _inputRef(i) {
3096
+ this.element = i, this.props.inputRef && (Object.prototype.hasOwnProperty.call(this.props.inputRef, "current") ? this.props.inputRef.current = i : this.props.inputRef(i));
3097
+ }
3098
+ initMask(i) {
3099
+ i === void 0 && (i = this._extractMaskOptionsFromProps(this.props)), this.maskRef = g(this.element, i).on("accept", this._onAccept.bind(this)).on("complete", this._onComplete.bind(this)), "value" in this.props && this.props.value !== void 0 && (this.maskValue = this.props.value);
3100
+ }
3101
+ destroyMask() {
3102
+ this.maskRef && (this.maskRef.destroy(), delete this.maskRef);
3103
+ }
3104
+ _extractMaskOptionsFromProps(i) {
3105
+ const {
3106
+ ...n
3107
+ } = i;
3108
+ return Object.keys(n).filter((u) => we.indexOf(u) < 0).forEach((u) => {
3109
+ delete n[u];
3110
+ }), n;
3111
+ }
3112
+ _extractNonMaskProps(i) {
3113
+ const {
3114
+ ...n
3115
+ } = i;
3116
+ return ne.forEach((u) => {
3117
+ u !== "maxLength" && delete n[u];
3118
+ }), "defaultValue" in n || (n.defaultValue = i.mask ? "" : n.value), delete n.value, n;
3119
+ }
3120
+ get maskValue() {
3121
+ return this.maskRef ? this.props.unmask === "typed" ? this.maskRef.typedValue : this.props.unmask ? this.maskRef.unmaskedValue : this.maskRef.value : "";
3122
+ }
3123
+ set maskValue(i) {
3124
+ this.maskRef && (i = i == null && this.props.unmask !== "typed" ? "" : i, this.props.unmask === "typed" ? this.maskRef.typedValue = i : this.props.unmask ? this.maskRef.unmaskedValue = i : this.maskRef.value = i);
3125
+ }
3126
+ _onAccept(i) {
3127
+ this.props.onAccept && this.maskRef && this.props.onAccept(this.maskValue, this.maskRef, i);
3128
+ }
3129
+ _onComplete(i) {
3130
+ this.props.onComplete && this.maskRef && this.props.onComplete(this.maskValue, this.maskRef, i);
3131
+ }
3132
+ render() {
3133
+ return X.createElement(a, {
3134
+ ...this._extractNonMaskProps(this.props),
3135
+ inputRef: this._inputRef
3136
+ });
3137
+ }
3138
+ }, t.displayName = void 0, t.propTypes = void 0, t), s = a.displayName || a.name || "Component";
3139
+ return e.displayName = "IMask(" + s + ")", e.propTypes = re, X.forwardRef((r, i) => X.createElement(e, {
3140
+ ...r,
3141
+ ref: i
3142
+ }));
3143
+ }
3144
+ const Me = Re((a) => {
3145
+ let {
3146
+ inputRef: t,
3147
+ ...e
3148
+ } = a;
3149
+ return X.createElement("input", {
3150
+ ...e,
3151
+ ref: t
3152
+ });
3153
+ }), Be = (a, t) => X.createElement(Me, {
3154
+ ...a,
3155
+ ref: t
3156
+ }), Oe = X.forwardRef(Be), De = "_input_u23b9_1", Ve = "_section_u23b9_7", ae = {
3157
+ input: De,
3158
+ section: Ve
3159
+ }, Pe = (a) => /* @__PURE__ */ Dt.createElement("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ Dt.createElement("path", { d: "M2.49984 2.5H17.4998C17.7209 2.5 17.9328 2.5878 18.0891 2.74408C18.2454 2.90036 18.3332 3.11232 18.3332 3.33333V16.6667C18.3332 16.8877 18.2454 17.0996 18.0891 17.2559C17.9328 17.4122 17.7209 17.5 17.4998 17.5H2.49984C2.27882 17.5 2.06686 17.4122 1.91058 17.2559C1.7543 17.0996 1.6665 16.8877 1.6665 16.6667V3.33333C1.6665 3.11232 1.7543 2.90036 1.91058 2.74408C2.06686 2.5878 2.27882 2.5 2.49984 2.5ZM16.6665 9.16667H3.33317V15.8333H16.6665V9.16667ZM16.6665 7.5V4.16667H3.33317V7.5H16.6665ZM11.6665 12.5H14.9998V14.1667H11.6665V12.5Z", fill: "currentColor", fillOpacity: 0.4, style: {
3160
+ fill: "#0D1126",
3161
+ fill: "color(display-p3 0.0510 0.0667 0.1490)",
3162
+ fillOpacity: 0.4
3163
+ } }));
3164
+ var It = { exports: {} };
3165
+ /*!
3166
+ Copyright (c) 2018 Jed Watson.
3167
+ Licensed under the MIT License (MIT), see
3168
+ http://jedwatson.github.io/classnames
3169
+ */
3170
+ var Gt;
3171
+ function Le() {
3172
+ return Gt || (Gt = 1, function(a) {
3173
+ (function() {
3174
+ var t = {}.hasOwnProperty;
3175
+ function e() {
3176
+ for (var i = "", n = 0; n < arguments.length; n++) {
3177
+ var u = arguments[n];
3178
+ u && (i = r(i, s(u)));
3179
+ }
3180
+ return i;
3181
+ }
3182
+ function s(i) {
3183
+ if (typeof i == "string" || typeof i == "number")
3184
+ return i;
3185
+ if (typeof i != "object")
3186
+ return "";
3187
+ if (Array.isArray(i))
3188
+ return e.apply(null, i);
3189
+ if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
3190
+ return i.toString();
3191
+ var n = "";
3192
+ for (var u in i)
3193
+ t.call(i, u) && i[u] && (n = r(n, u));
3194
+ return n;
3195
+ }
3196
+ function r(i, n) {
3197
+ return n ? i ? i + " " + n : i + n : i;
3198
+ }
3199
+ a.exports ? (e.default = e, a.exports = e) : window.classNames = e;
3200
+ })();
3201
+ }(It)), It.exports;
3202
+ }
3203
+ var Ne = Le();
3204
+ const je = /* @__PURE__ */ ee(Ne), Ue = je(ae.input, oe["caption-l-regular"]), qe = ue.withProps({
3205
+ leftSection: /* @__PURE__ */ wt(Pe, {}),
3206
+ component: Oe,
3207
+ mask: "0000 0000 0000 0000",
3208
+ placeholder: "____ ____ ____ ____",
3209
+ classNames: { input: Ue, section: ae.section }
3210
+ }), We = (a) => {
3211
+ const t = le(a.value);
3212
+ return /* @__PURE__ */ wt(
3213
+ qe,
3214
+ {
3215
+ ...a,
3216
+ rightSection: t && /* @__PURE__ */ wt(t, {})
3217
+ }
3218
+ );
3219
+ };
3220
+ export {
3221
+ We as CardInput,
3222
+ qe as CardInputBase
3223
+ };