@kvell-group/ui 1.9.2 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -193
- package/dist/Text.module-D3VLOIGk.js +8 -0
- package/dist/assets/CardInput.css +1 -1
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Text.css +1 -1
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/CardInput/CardInput.js +459 -499
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/Input/Input.js +11 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/index.js +4 -0
- package/dist/components/Text/Text.js +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +6 -4
- package/package.json +3 -3
- package/dist/Text.module-R-XLggXY.js +0 -8
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { InputBase as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsx as It } from "react/jsx-runtime";
|
|
2
|
+
import { InputBase as re } from "@mantine/core";
|
|
3
|
+
import * as Ot from "react";
|
|
4
4
|
import X from "react";
|
|
5
|
-
import { c as
|
|
6
|
-
import { useCardLogo as
|
|
5
|
+
import { c as ne } from "../../Text.module-D3VLOIGk.js";
|
|
6
|
+
import { useCardLogo as ae } from "./useCardLogo.js";
|
|
7
|
+
import { c as ue } from "../../clsx-OuTLNxxd.js";
|
|
7
8
|
import '../../assets/CardInput.css';function G(a) {
|
|
8
9
|
return typeof a == "string" || a instanceof String;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function Dt(a) {
|
|
11
12
|
var t;
|
|
12
13
|
return typeof a == "object" && a != null && (a == null || (t = a.constructor) == null ? void 0 : t.name) === "Object";
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
return Array.isArray(t) ?
|
|
16
|
-
let [
|
|
17
|
-
return t(
|
|
15
|
+
function Kt(a, t) {
|
|
16
|
+
return Array.isArray(t) ? Kt(a, (e, s) => t.includes(s)) : Object.entries(a).reduce((e, s) => {
|
|
17
|
+
let [i, r] = s;
|
|
18
|
+
return t(r, i) && (e[i] = r), e;
|
|
18
19
|
}, {});
|
|
19
20
|
}
|
|
20
21
|
const m = {
|
|
@@ -24,7 +25,7 @@ const m = {
|
|
|
24
25
|
RIGHT: "RIGHT",
|
|
25
26
|
FORCE_RIGHT: "FORCE_RIGHT"
|
|
26
27
|
};
|
|
27
|
-
function
|
|
28
|
+
function oe(a) {
|
|
28
29
|
switch (a) {
|
|
29
30
|
case m.LEFT:
|
|
30
31
|
return m.FORCE_LEFT;
|
|
@@ -40,29 +41,29 @@ function Ct(a) {
|
|
|
40
41
|
function ot(a, t) {
|
|
41
42
|
if (t === a) return !0;
|
|
42
43
|
const e = Array.isArray(t), s = Array.isArray(a);
|
|
43
|
-
let
|
|
44
|
+
let i;
|
|
44
45
|
if (e && s) {
|
|
45
46
|
if (t.length != a.length) return !1;
|
|
46
|
-
for (
|
|
47
|
+
for (i = 0; i < t.length; i++) if (!ot(t[i], a[i])) return !1;
|
|
47
48
|
return !0;
|
|
48
49
|
}
|
|
49
50
|
if (e != s) return !1;
|
|
50
51
|
if (t && a && typeof t == "object" && typeof a == "object") {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
if (
|
|
52
|
+
const r = t instanceof Date, n = a instanceof Date;
|
|
53
|
+
if (r && n) return t.getTime() == a.getTime();
|
|
54
|
+
if (r != n) return !1;
|
|
54
55
|
const u = t instanceof RegExp, l = a instanceof RegExp;
|
|
55
56
|
if (u && l) return t.toString() == a.toString();
|
|
56
57
|
if (u != l) return !1;
|
|
57
58
|
const h = Object.keys(t);
|
|
58
|
-
for (
|
|
59
|
-
for (
|
|
59
|
+
for (i = 0; i < h.length; i++) if (!Object.prototype.hasOwnProperty.call(a, h[i])) return !1;
|
|
60
|
+
for (i = 0; i < h.length; i++) if (!ot(a[h[i]], t[h[i]])) return !1;
|
|
60
61
|
return !0;
|
|
61
62
|
} else if (t && a && typeof t == "function" && typeof a == "function")
|
|
62
63
|
return t.toString() === a.toString();
|
|
63
64
|
return !1;
|
|
64
65
|
}
|
|
65
|
-
class
|
|
66
|
+
class le {
|
|
66
67
|
/** Current input value */
|
|
67
68
|
/** Current cursor position */
|
|
68
69
|
/** Old input value */
|
|
@@ -112,7 +113,7 @@ class pe {
|
|
|
112
113
|
function g(a, t) {
|
|
113
114
|
return new g.InputMask(a, t);
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function Gt(a) {
|
|
116
117
|
if (a == null) throw new Error("mask property should be defined");
|
|
117
118
|
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
|
}
|
|
@@ -127,18 +128,18 @@ function et(a) {
|
|
|
127
128
|
...e
|
|
128
129
|
} = a instanceof g.Masked ? {
|
|
129
130
|
mask: a
|
|
130
|
-
} :
|
|
131
|
+
} : Dt(a) && a.mask instanceof g.Masked ? a : {};
|
|
131
132
|
if (t) {
|
|
132
133
|
const s = t.mask;
|
|
133
134
|
return {
|
|
134
|
-
...
|
|
135
|
+
...Kt(t, (i, r) => !r.startsWith("_")),
|
|
135
136
|
mask: t.constructor,
|
|
136
137
|
_mask: s,
|
|
137
138
|
...e
|
|
138
139
|
};
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
|
-
return
|
|
142
|
+
return Dt(a) ? {
|
|
142
143
|
...a
|
|
143
144
|
} : {
|
|
144
145
|
mask: a
|
|
@@ -146,12 +147,12 @@ function et(a) {
|
|
|
146
147
|
}
|
|
147
148
|
function K(a) {
|
|
148
149
|
if (g.Masked && a instanceof g.Masked) return a;
|
|
149
|
-
const t = et(a), e =
|
|
150
|
+
const t = et(a), e = Gt(t.mask);
|
|
150
151
|
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
152
|
return t.mask === e && delete t.mask, t._mask && (t.mask = t._mask, delete t._mask), new e(t);
|
|
152
153
|
}
|
|
153
154
|
g.createMask = K;
|
|
154
|
-
class
|
|
155
|
+
class Rt {
|
|
155
156
|
/** */
|
|
156
157
|
/** */
|
|
157
158
|
/** */
|
|
@@ -189,9 +190,9 @@ class Mt {
|
|
|
189
190
|
/** */
|
|
190
191
|
/** */
|
|
191
192
|
}
|
|
192
|
-
g.MaskElement =
|
|
193
|
-
const
|
|
194
|
-
class ht extends
|
|
193
|
+
g.MaskElement = Rt;
|
|
194
|
+
const Vt = 90, he = 89;
|
|
195
|
+
class ht extends Rt {
|
|
195
196
|
/** HTMLElement to use mask on */
|
|
196
197
|
constructor(t) {
|
|
197
198
|
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);
|
|
@@ -209,9 +210,9 @@ class ht extends Mt {
|
|
|
209
210
|
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
|
}
|
|
211
212
|
_onKeydown(t) {
|
|
212
|
-
if (this._handlers.redo && (t.keyCode ===
|
|
213
|
+
if (this._handlers.redo && (t.keyCode === Vt && t.shiftKey && (t.metaKey || t.ctrlKey) || t.keyCode === he && t.ctrlKey))
|
|
213
214
|
return t.preventDefault(), this._handlers.redo(t);
|
|
214
|
-
if (this._handlers.undo && t.keyCode ===
|
|
215
|
+
if (this._handlers.undo && t.keyCode === Vt && (t.metaKey || t.ctrlKey))
|
|
215
216
|
return t.preventDefault(), this._handlers.undo(t);
|
|
216
217
|
t.isComposing || this._handlers.selectionChange(t);
|
|
217
218
|
}
|
|
@@ -233,7 +234,7 @@ class ht extends Mt {
|
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
236
|
g.HTMLMaskElement = ht;
|
|
236
|
-
class
|
|
237
|
+
class pe extends ht {
|
|
237
238
|
/** InputElement to use mask on */
|
|
238
239
|
constructor(t) {
|
|
239
240
|
super(t), this.input = t;
|
|
@@ -258,24 +259,24 @@ class de extends ht {
|
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
g.HTMLMaskElement = ht;
|
|
261
|
-
class
|
|
262
|
+
class Wt extends ht {
|
|
262
263
|
/** Returns HTMLElement selection start */
|
|
263
264
|
get _unsafeSelectionStart() {
|
|
264
|
-
const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset,
|
|
265
|
-
return
|
|
265
|
+
const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
|
|
266
|
+
return i == null || s == null || s < i ? s : i;
|
|
266
267
|
}
|
|
267
268
|
/** Returns HTMLElement selection end */
|
|
268
269
|
get _unsafeSelectionEnd() {
|
|
269
|
-
const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset,
|
|
270
|
-
return
|
|
270
|
+
const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
|
|
271
|
+
return i == null || s == null || s > i ? s : i;
|
|
271
272
|
}
|
|
272
273
|
/** Sets HTMLElement selection */
|
|
273
274
|
_unsafeSelect(t, e) {
|
|
274
275
|
if (!this.rootElement.createRange) return;
|
|
275
276
|
const s = this.rootElement.createRange();
|
|
276
277
|
s.setStart(this.input.firstChild || this.input, t), s.setEnd(this.input.lastChild || this.input, e);
|
|
277
|
-
const
|
|
278
|
-
|
|
278
|
+
const i = this.rootElement, r = i.getSelection && i.getSelection();
|
|
279
|
+
r && (r.removeAllRanges(), r.addRange(s));
|
|
279
280
|
}
|
|
280
281
|
/** HTMLElement value */
|
|
281
282
|
get value() {
|
|
@@ -285,7 +286,7 @@ class Xt extends ht {
|
|
|
285
286
|
this.input.textContent = t;
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
|
-
g.HTMLContenteditableMaskElement =
|
|
289
|
+
g.HTMLContenteditableMaskElement = Wt;
|
|
289
290
|
class pt {
|
|
290
291
|
constructor() {
|
|
291
292
|
this.states = [], this.currentIndex = 0;
|
|
@@ -313,13 +314,13 @@ class pt {
|
|
|
313
314
|
}
|
|
314
315
|
}
|
|
315
316
|
pt.MAX_LENGTH = 100;
|
|
316
|
-
class
|
|
317
|
+
class ce {
|
|
317
318
|
/**
|
|
318
319
|
View element
|
|
319
320
|
*/
|
|
320
321
|
/** Internal {@link Masked} model */
|
|
321
322
|
constructor(t, e) {
|
|
322
|
-
this.el = t instanceof
|
|
323
|
+
this.el = t instanceof Rt ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new Wt(t) : new pe(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
|
}
|
|
324
325
|
maskEquals(t) {
|
|
325
326
|
var e;
|
|
@@ -331,7 +332,7 @@ class fe {
|
|
|
331
332
|
}
|
|
332
333
|
set mask(t) {
|
|
333
334
|
if (this.maskEquals(t)) return;
|
|
334
|
-
if (!(t instanceof g.Masked) && this.masked.constructor ===
|
|
335
|
+
if (!(t instanceof g.Masked) && this.masked.constructor === Gt(t)) {
|
|
335
336
|
this.masked.updateOptions({
|
|
336
337
|
mask: t
|
|
337
338
|
});
|
|
@@ -394,7 +395,7 @@ class fe {
|
|
|
394
395
|
/** Fires custom event */
|
|
395
396
|
_fireEvent(t, e) {
|
|
396
397
|
const s = this._listeners[t];
|
|
397
|
-
s && s.forEach((
|
|
398
|
+
s && s.forEach((i) => i(e));
|
|
398
399
|
}
|
|
399
400
|
/** Current selection start */
|
|
400
401
|
get selectionStart() {
|
|
@@ -420,8 +421,8 @@ class fe {
|
|
|
420
421
|
}
|
|
421
422
|
/** Syncronizes view from model value, fires change events */
|
|
422
423
|
updateControl(t) {
|
|
423
|
-
const e = this.masked.unmaskedValue, s = this.masked.value,
|
|
424
|
-
this._unmaskedValue = e, this._value = s, this._rawInputValue =
|
|
424
|
+
const e = this.masked.unmaskedValue, s = this.masked.value, i = this.masked.rawInputValue, r = this.displayValue, n = this.unmaskedValue !== e || this.value !== s || this._rawInputValue !== i;
|
|
425
|
+
this._unmaskedValue = e, this._value = s, this._rawInputValue = i, this.el.value !== r && (this.el.value = r), t === "auto" ? this.alignCursor() : t != null && (this.cursorPos = t), n && this._fireChangeEvents(), !this._historyChanging && (n || this.history.isEmpty) && this.history.push({
|
|
425
426
|
unmaskedValue: e,
|
|
426
427
|
selection: {
|
|
427
428
|
start: this.selectionStart,
|
|
@@ -434,8 +435,8 @@ class fe {
|
|
|
434
435
|
const {
|
|
435
436
|
mask: e,
|
|
436
437
|
...s
|
|
437
|
-
} = t,
|
|
438
|
-
|
|
438
|
+
} = t, i = !this.maskEquals(e), r = this.masked.optionsIsChanged(s);
|
|
439
|
+
i && (this.mask = e), r && this.masked.updateOptions(s), (i || r) && this.updateControl();
|
|
439
440
|
}
|
|
440
441
|
/** Updates cursor */
|
|
441
442
|
updateCursor(t) {
|
|
@@ -478,19 +479,19 @@ class fe {
|
|
|
478
479
|
/** Handles view input event */
|
|
479
480
|
_onInput(t) {
|
|
480
481
|
this._inputEvent = t, this._abortUpdateCursor();
|
|
481
|
-
const e = new
|
|
482
|
+
const e = new le({
|
|
482
483
|
// new state
|
|
483
484
|
value: this.el.value,
|
|
484
485
|
cursorPos: this.cursorPos,
|
|
485
486
|
// old state
|
|
486
487
|
oldValue: this.displayValue,
|
|
487
488
|
oldSelection: this._selection
|
|
488
|
-
}), s = this.masked.rawInputValue,
|
|
489
|
+
}), s = this.masked.rawInputValue, i = this.masked.splice(e.startChangePos, e.removed.length, e.inserted, e.removeDirection, {
|
|
489
490
|
input: !0,
|
|
490
491
|
raw: !0
|
|
491
|
-
}).offset,
|
|
492
|
-
let n = this.masked.nearestInputPos(e.startChangePos +
|
|
493
|
-
|
|
492
|
+
}).offset, r = s === this.masked.rawInputValue ? e.removeDirection : m.NONE;
|
|
493
|
+
let n = this.masked.nearestInputPos(e.startChangePos + i, r);
|
|
494
|
+
r !== m.NONE && (n = this.masked.nearestInputPos(n, m.NONE)), this.updateControl(n), delete this._inputEvent;
|
|
494
495
|
}
|
|
495
496
|
/** Handles view change event and commits model value */
|
|
496
497
|
_onChange() {
|
|
@@ -522,7 +523,7 @@ class fe {
|
|
|
522
523
|
this._unbindEvents(), this._listeners.length = 0, delete this.el;
|
|
523
524
|
}
|
|
524
525
|
}
|
|
525
|
-
g.InputMask =
|
|
526
|
+
g.InputMask = ce;
|
|
526
527
|
class E {
|
|
527
528
|
/** Inserted symbols */
|
|
528
529
|
/** Additional offset if any changes occurred before tail */
|
|
@@ -711,36 +712,36 @@ class P {
|
|
|
711
712
|
/** Appends char */
|
|
712
713
|
_appendChar(t, e, s) {
|
|
713
714
|
e === void 0 && (e = {});
|
|
714
|
-
const
|
|
715
|
-
let
|
|
716
|
-
if ([t,
|
|
715
|
+
const i = this.state;
|
|
716
|
+
let r;
|
|
717
|
+
if ([t, r] = this.doPrepareChar(t, e), t && (r = r.aggregate(this._appendCharRaw(t, e)), !r.rawInserted && this.autofix === "pad")) {
|
|
717
718
|
const n = this.state;
|
|
718
|
-
this.state =
|
|
719
|
+
this.state = i;
|
|
719
720
|
let u = this.pad(e);
|
|
720
721
|
const l = this._appendCharRaw(t, e);
|
|
721
|
-
u = u.aggregate(l), l.rawInserted || u.equals(
|
|
722
|
+
u = u.aggregate(l), l.rawInserted || u.equals(r) ? r = u : this.state = n;
|
|
722
723
|
}
|
|
723
|
-
if (
|
|
724
|
+
if (r.inserted) {
|
|
724
725
|
let n, u = this.doValidate(e) !== !1;
|
|
725
726
|
if (u && s != null) {
|
|
726
727
|
const l = this.state;
|
|
727
728
|
if (this.overwrite === !0) {
|
|
728
729
|
n = s.state;
|
|
729
|
-
for (let v = 0; v <
|
|
730
|
-
s.unshift(this.displayValue.length -
|
|
730
|
+
for (let v = 0; v < r.rawInserted.length; ++v)
|
|
731
|
+
s.unshift(this.displayValue.length - r.tailShift);
|
|
731
732
|
}
|
|
732
733
|
let h = this.appendTail(s);
|
|
733
734
|
if (u = h.rawInserted.length === s.toString().length, !(u && h.inserted) && this.overwrite === "shift") {
|
|
734
735
|
this.state = l, n = s.state;
|
|
735
|
-
for (let v = 0; v <
|
|
736
|
+
for (let v = 0; v < r.rawInserted.length; ++v)
|
|
736
737
|
s.shift();
|
|
737
738
|
h = this.appendTail(s), u = h.rawInserted.length === s.toString().length;
|
|
738
739
|
}
|
|
739
740
|
u && h.inserted && (this.state = l);
|
|
740
741
|
}
|
|
741
|
-
u || (
|
|
742
|
+
u || (r = new E(), this.state = i, s && n && (s.state = n));
|
|
742
743
|
}
|
|
743
|
-
return
|
|
744
|
+
return r;
|
|
744
745
|
}
|
|
745
746
|
/** Appends optional placeholder at the end */
|
|
746
747
|
_appendPlaceholder() {
|
|
@@ -753,16 +754,16 @@ class P {
|
|
|
753
754
|
/** Appends symbols considering flags */
|
|
754
755
|
append(t, e, s) {
|
|
755
756
|
if (!G(t)) throw new Error("value should be string");
|
|
756
|
-
const
|
|
757
|
+
const i = G(s) ? new H(String(s)) : s;
|
|
757
758
|
e != null && e.tail && (e._beforeTailState = this.state);
|
|
758
|
-
let
|
|
759
|
-
[t,
|
|
759
|
+
let r;
|
|
760
|
+
[t, r] = this.doPrepare(t, e);
|
|
760
761
|
for (let n = 0; n < t.length; ++n) {
|
|
761
|
-
const u = this._appendChar(t[n], e,
|
|
762
|
-
if (!u.rawInserted && !this.doSkipInvalid(t[n], e,
|
|
763
|
-
|
|
762
|
+
const u = this._appendChar(t[n], e, i);
|
|
763
|
+
if (!u.rawInserted && !this.doSkipInvalid(t[n], e, i)) break;
|
|
764
|
+
r.aggregate(u);
|
|
764
765
|
}
|
|
765
|
-
return (this.eager === !0 || this.eager === "append") && e != null && e.input && t &&
|
|
766
|
+
return (this.eager === !0 || this.eager === "append") && e != null && e.input && t && r.aggregate(this._appendEager()), i != null && (r.tailShift += this.appendTail(i).tailShift), r;
|
|
766
767
|
}
|
|
767
768
|
remove(t, e) {
|
|
768
769
|
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();
|
|
@@ -771,8 +772,8 @@ class P {
|
|
|
771
772
|
withValueRefresh(t) {
|
|
772
773
|
if (this._refreshing || !this._initialized) return t();
|
|
773
774
|
this._refreshing = !0;
|
|
774
|
-
const e = this.rawInputValue, s = this.value,
|
|
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,
|
|
775
|
+
const e = this.rawInputValue, s = this.value, i = t();
|
|
776
|
+
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, i;
|
|
776
777
|
}
|
|
777
778
|
runIsolated(t) {
|
|
778
779
|
if (this._isolated || !this._initialized) return t(this);
|
|
@@ -799,26 +800,26 @@ class P {
|
|
|
799
800
|
doCommit() {
|
|
800
801
|
this.commit && this.commit(this.value, this);
|
|
801
802
|
}
|
|
802
|
-
splice(t, e, s,
|
|
803
|
-
s === void 0 && (s = ""),
|
|
803
|
+
splice(t, e, s, i, r) {
|
|
804
|
+
s === void 0 && (s = ""), i === void 0 && (i = m.NONE), r === void 0 && (r = {
|
|
804
805
|
input: !0
|
|
805
806
|
});
|
|
806
807
|
const n = t + e, u = this.extractTail(n), l = this.eager === !0 || this.eager === "remove";
|
|
807
808
|
let h;
|
|
808
|
-
l && (
|
|
809
|
+
l && (i = oe(i), h = this.extractInput(0, n, {
|
|
809
810
|
raw: !0
|
|
810
811
|
}));
|
|
811
812
|
let v = t;
|
|
812
813
|
const _ = new E();
|
|
813
|
-
if (
|
|
814
|
-
if (
|
|
815
|
-
let
|
|
816
|
-
for (; h === this.rawInputValue && (
|
|
814
|
+
if (i !== m.NONE && (v = this.nearestInputPos(t, e > 1 && t !== 0 && !l ? m.NONE : i), _.tailShift = v - t), _.aggregate(this.remove(v)), l && i !== m.NONE && h === this.rawInputValue)
|
|
815
|
+
if (i === m.FORCE_LEFT) {
|
|
816
|
+
let F;
|
|
817
|
+
for (; h === this.rawInputValue && (F = this.displayValue.length); )
|
|
817
818
|
_.aggregate(new E({
|
|
818
819
|
tailShift: -1
|
|
819
|
-
})).aggregate(this.remove(
|
|
820
|
-
} else
|
|
821
|
-
return _.aggregate(this.append(s,
|
|
820
|
+
})).aggregate(this.remove(F - 1));
|
|
821
|
+
} else i === m.FORCE_RIGHT && u.unshift();
|
|
822
|
+
return _.aggregate(this.append(s, r, u));
|
|
822
823
|
}
|
|
823
824
|
maskEquals(t) {
|
|
824
825
|
return this.mask === t;
|
|
@@ -857,9 +858,9 @@ class J {
|
|
|
857
858
|
s ? e.extend(t.toString()) : this.chunks.push(t);
|
|
858
859
|
else if (t instanceof J) {
|
|
859
860
|
if (t.stop == null) {
|
|
860
|
-
let
|
|
861
|
+
let i;
|
|
861
862
|
for (; t.chunks.length && t.chunks[0].stop == null; )
|
|
862
|
-
|
|
863
|
+
i = t.chunks.shift(), i.from += t.from, this.extend(i);
|
|
863
864
|
}
|
|
864
865
|
t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
|
|
865
866
|
}
|
|
@@ -869,19 +870,19 @@ class J {
|
|
|
869
870
|
return new H(this.toString()).appendTo(t);
|
|
870
871
|
const e = new E();
|
|
871
872
|
for (let s = 0; s < this.chunks.length; ++s) {
|
|
872
|
-
const
|
|
873
|
+
const i = this.chunks[s], r = t._mapPosToBlock(t.displayValue.length), n = i.stop;
|
|
873
874
|
let u;
|
|
874
875
|
if (n != null && // if block not found or stop is behind lastBlock
|
|
875
|
-
(!
|
|
876
|
-
t._stops.indexOf(n) >= 0) && e.aggregate(t._appendPlaceholder(n)), u =
|
|
877
|
-
const l = u.appendTail(
|
|
876
|
+
(!r || r.index <= n) && ((i instanceof J || // for continuous block also check if stop is exist
|
|
877
|
+
t._stops.indexOf(n) >= 0) && e.aggregate(t._appendPlaceholder(n)), u = i instanceof J && t._blocks[n]), u) {
|
|
878
|
+
const l = u.appendTail(i);
|
|
878
879
|
e.aggregate(l);
|
|
879
|
-
const h =
|
|
880
|
+
const h = i.toString().slice(l.rawInserted.length);
|
|
880
881
|
h && e.aggregate(t.append(h, {
|
|
881
882
|
tail: !0
|
|
882
883
|
}));
|
|
883
884
|
} else
|
|
884
|
-
e.aggregate(t.append(
|
|
885
|
+
e.aggregate(t.append(i.toString(), {
|
|
885
886
|
tail: !0
|
|
886
887
|
}));
|
|
887
888
|
}
|
|
@@ -900,9 +901,9 @@ class J {
|
|
|
900
901
|
chunks: e,
|
|
901
902
|
...s
|
|
902
903
|
} = t;
|
|
903
|
-
Object.assign(this, s), this.chunks = e.map((
|
|
904
|
-
const
|
|
905
|
-
return
|
|
904
|
+
Object.assign(this, s), this.chunks = e.map((i) => {
|
|
905
|
+
const r = "chunks" in i ? new J() : new H();
|
|
906
|
+
return r.state = i, r;
|
|
906
907
|
});
|
|
907
908
|
}
|
|
908
909
|
unshift(t) {
|
|
@@ -910,13 +911,13 @@ class J {
|
|
|
910
911
|
const e = t != null ? t - this.from : t;
|
|
911
912
|
let s = 0;
|
|
912
913
|
for (; s < this.chunks.length; ) {
|
|
913
|
-
const
|
|
914
|
-
if (
|
|
915
|
-
if (!
|
|
914
|
+
const i = this.chunks[s], r = i.unshift(e);
|
|
915
|
+
if (i.toString()) {
|
|
916
|
+
if (!r) break;
|
|
916
917
|
++s;
|
|
917
918
|
} else
|
|
918
919
|
this.chunks.splice(s, 1);
|
|
919
|
-
if (
|
|
920
|
+
if (r) return r;
|
|
920
921
|
}
|
|
921
922
|
return "";
|
|
922
923
|
}
|
|
@@ -935,12 +936,12 @@ class J {
|
|
|
935
936
|
return "";
|
|
936
937
|
}
|
|
937
938
|
}
|
|
938
|
-
class
|
|
939
|
+
class de {
|
|
939
940
|
constructor(t, e) {
|
|
940
941
|
this.masked = t, this._log = [];
|
|
941
942
|
const {
|
|
942
943
|
offset: s,
|
|
943
|
-
index:
|
|
944
|
+
index: i
|
|
944
945
|
} = t._mapPosToBlock(e) || (e < 0 ? (
|
|
945
946
|
// first
|
|
946
947
|
{
|
|
@@ -954,7 +955,7 @@ class me {
|
|
|
954
955
|
offset: 0
|
|
955
956
|
}
|
|
956
957
|
));
|
|
957
|
-
this.offset = s, this.index =
|
|
958
|
+
this.offset = s, this.index = i, this.ok = !1;
|
|
958
959
|
}
|
|
959
960
|
get block() {
|
|
960
961
|
return this.masked._blocks[this.index];
|
|
@@ -1031,7 +1032,7 @@ class me {
|
|
|
1031
1032
|
});
|
|
1032
1033
|
}
|
|
1033
1034
|
}
|
|
1034
|
-
class
|
|
1035
|
+
class Zt {
|
|
1035
1036
|
/** */
|
|
1036
1037
|
/** */
|
|
1037
1038
|
/** */
|
|
@@ -1061,7 +1062,7 @@ class Jt {
|
|
|
1061
1062
|
}
|
|
1062
1063
|
nearestInputPos(t, e) {
|
|
1063
1064
|
e === void 0 && (e = m.NONE);
|
|
1064
|
-
const s = 0,
|
|
1065
|
+
const s = 0, i = this._value.length;
|
|
1065
1066
|
switch (e) {
|
|
1066
1067
|
case m.LEFT:
|
|
1067
1068
|
case m.FORCE_LEFT:
|
|
@@ -1070,7 +1071,7 @@ class Jt {
|
|
|
1070
1071
|
case m.RIGHT:
|
|
1071
1072
|
case m.FORCE_RIGHT:
|
|
1072
1073
|
default:
|
|
1073
|
-
return
|
|
1074
|
+
return i;
|
|
1074
1075
|
}
|
|
1075
1076
|
}
|
|
1076
1077
|
totalInputPositions(t, e) {
|
|
@@ -1087,11 +1088,11 @@ class Jt {
|
|
|
1087
1088
|
}
|
|
1088
1089
|
_appendChar(t, e) {
|
|
1089
1090
|
if (e === void 0 && (e = {}), this.isFilled) return new E();
|
|
1090
|
-
const s = this.eager === !0 || this.eager === "append",
|
|
1091
|
+
const s = this.eager === !0 || this.eager === "append", r = this.char === t && (this.isUnmasking || e.input || e.raw) && (!e.raw || !s) && !e.tail, n = new E({
|
|
1091
1092
|
inserted: this.char,
|
|
1092
|
-
rawInserted:
|
|
1093
|
+
rawInserted: r ? this.char : ""
|
|
1093
1094
|
});
|
|
1094
|
-
return this._value = this.char, this._isRawInput =
|
|
1095
|
+
return this._value = this.char, this._isRawInput = r && (e.raw || e.input), n;
|
|
1095
1096
|
}
|
|
1096
1097
|
_appendEager() {
|
|
1097
1098
|
return this._appendChar(this.char, {
|
|
@@ -1109,8 +1110,8 @@ class Jt {
|
|
|
1109
1110
|
return G(t) && (t = new H(String(t))), t.appendTo(this);
|
|
1110
1111
|
}
|
|
1111
1112
|
append(t, e, s) {
|
|
1112
|
-
const
|
|
1113
|
-
return s != null && (
|
|
1113
|
+
const i = this._appendChar(t[0], e);
|
|
1114
|
+
return s != null && (i.tailShift += this.appendTail(s).tailShift), i;
|
|
1114
1115
|
}
|
|
1115
1116
|
doCommit() {
|
|
1116
1117
|
}
|
|
@@ -1140,8 +1141,8 @@ class lt {
|
|
|
1140
1141
|
const {
|
|
1141
1142
|
parent: e,
|
|
1142
1143
|
isOptional: s,
|
|
1143
|
-
placeholderChar:
|
|
1144
|
-
displayChar:
|
|
1144
|
+
placeholderChar: i,
|
|
1145
|
+
displayChar: r,
|
|
1145
1146
|
lazy: n,
|
|
1146
1147
|
eager: u,
|
|
1147
1148
|
...l
|
|
@@ -1149,8 +1150,8 @@ class lt {
|
|
|
1149
1150
|
this.masked = K(l), Object.assign(this, {
|
|
1150
1151
|
parent: e,
|
|
1151
1152
|
isOptional: s,
|
|
1152
|
-
placeholderChar:
|
|
1153
|
-
displayChar:
|
|
1153
|
+
placeholderChar: i,
|
|
1154
|
+
displayChar: r,
|
|
1154
1155
|
lazy: n,
|
|
1155
1156
|
eager: u
|
|
1156
1157
|
});
|
|
@@ -1179,8 +1180,8 @@ class lt {
|
|
|
1179
1180
|
_appendChar(t, e) {
|
|
1180
1181
|
if (e === void 0 && (e = {}), this.isFilled) return new E();
|
|
1181
1182
|
const s = this.masked.state;
|
|
1182
|
-
let
|
|
1183
|
-
return
|
|
1183
|
+
let i = this.masked._appendChar(t, this.currentMaskFlags(e));
|
|
1184
|
+
return i.inserted && this.doValidate(e) === !1 && (i = new E(), this.masked.state = s), !i.inserted && !this.isOptional && !this.lazy && !e.input && (i.inserted = this.placeholderChar), i.skip = !i.inserted && !this.isOptional, this.isFilled = !!i.inserted, i;
|
|
1184
1185
|
}
|
|
1185
1186
|
append(t, e, s) {
|
|
1186
1187
|
return this.masked.append(t, this.currentMaskFlags(e), s);
|
|
@@ -1204,17 +1205,17 @@ class lt {
|
|
|
1204
1205
|
}
|
|
1205
1206
|
nearestInputPos(t, e) {
|
|
1206
1207
|
e === void 0 && (e = m.NONE);
|
|
1207
|
-
const s = 0,
|
|
1208
|
+
const s = 0, i = this.value.length, r = Math.min(Math.max(t, s), i);
|
|
1208
1209
|
switch (e) {
|
|
1209
1210
|
case m.LEFT:
|
|
1210
1211
|
case m.FORCE_LEFT:
|
|
1211
|
-
return this.isComplete ?
|
|
1212
|
+
return this.isComplete ? r : s;
|
|
1212
1213
|
case m.RIGHT:
|
|
1213
1214
|
case m.FORCE_RIGHT:
|
|
1214
|
-
return this.isComplete ?
|
|
1215
|
+
return this.isComplete ? r : i;
|
|
1215
1216
|
case m.NONE:
|
|
1216
1217
|
default:
|
|
1217
|
-
return
|
|
1218
|
+
return r;
|
|
1218
1219
|
}
|
|
1219
1220
|
}
|
|
1220
1221
|
totalInputPositions(t, e) {
|
|
@@ -1254,7 +1255,7 @@ lt.DEFAULT_DEFINITIONS = {
|
|
|
1254
1255
|
// http://stackoverflow.com/a/22075070
|
|
1255
1256
|
"*": /./
|
|
1256
1257
|
};
|
|
1257
|
-
class
|
|
1258
|
+
class fe extends P {
|
|
1258
1259
|
/** */
|
|
1259
1260
|
/** Enable characters overwriting */
|
|
1260
1261
|
/** */
|
|
@@ -1268,7 +1269,7 @@ class ve extends P {
|
|
|
1268
1269
|
e && (t.validate = (s) => s.search(e) >= 0), super._update(t);
|
|
1269
1270
|
}
|
|
1270
1271
|
}
|
|
1271
|
-
g.MaskedRegExp =
|
|
1272
|
+
g.MaskedRegExp = fe;
|
|
1272
1273
|
class L extends P {
|
|
1273
1274
|
/** */
|
|
1274
1275
|
/** */
|
|
@@ -1297,15 +1298,15 @@ class L extends P {
|
|
|
1297
1298
|
this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
|
|
1298
1299
|
const e = this.mask;
|
|
1299
1300
|
if (!e || !t) return;
|
|
1300
|
-
let s = !1,
|
|
1301
|
-
for (let
|
|
1301
|
+
let s = !1, i = !1;
|
|
1302
|
+
for (let r = 0; r < e.length; ++r) {
|
|
1302
1303
|
if (this.blocks) {
|
|
1303
|
-
const h = e.slice(
|
|
1304
|
-
v.sort((
|
|
1304
|
+
const h = e.slice(r), v = Object.keys(this.blocks).filter((F) => h.indexOf(F) === 0);
|
|
1305
|
+
v.sort((F, B) => B.length - F.length);
|
|
1305
1306
|
const _ = v[0];
|
|
1306
1307
|
if (_) {
|
|
1307
1308
|
const {
|
|
1308
|
-
expose:
|
|
1309
|
+
expose: F,
|
|
1309
1310
|
repeat: B,
|
|
1310
1311
|
...N
|
|
1311
1312
|
} = et(this.blocks[_]), M = {
|
|
@@ -1322,11 +1323,11 @@ class L extends P {
|
|
|
1322
1323
|
M
|
|
1323
1324
|
/* TODO */
|
|
1324
1325
|
) : K(M);
|
|
1325
|
-
O && (this._blocks.push(O),
|
|
1326
|
+
O && (this._blocks.push(O), F && (this.exposeBlock = O), this._maskedBlocks[_] || (this._maskedBlocks[_] = []), this._maskedBlocks[_].push(this._blocks.length - 1)), r += _.length - 1;
|
|
1326
1327
|
continue;
|
|
1327
1328
|
}
|
|
1328
1329
|
}
|
|
1329
|
-
let n = e[
|
|
1330
|
+
let n = e[r], u = n in t;
|
|
1330
1331
|
if (n === L.STOP_CHAR) {
|
|
1331
1332
|
this._stops.push(this._blocks.length);
|
|
1332
1333
|
continue;
|
|
@@ -1336,22 +1337,22 @@ class L extends P {
|
|
|
1336
1337
|
continue;
|
|
1337
1338
|
}
|
|
1338
1339
|
if (n === "[" || n === "]") {
|
|
1339
|
-
|
|
1340
|
+
i = !i;
|
|
1340
1341
|
continue;
|
|
1341
1342
|
}
|
|
1342
1343
|
if (n === L.ESCAPE_CHAR) {
|
|
1343
|
-
if (++
|
|
1344
|
+
if (++r, n = e[r], !n) break;
|
|
1344
1345
|
u = !1;
|
|
1345
1346
|
}
|
|
1346
1347
|
const l = u ? new lt({
|
|
1347
|
-
isOptional:
|
|
1348
|
+
isOptional: i,
|
|
1348
1349
|
lazy: this.lazy,
|
|
1349
1350
|
eager: this.eager,
|
|
1350
1351
|
placeholderChar: this.placeholderChar,
|
|
1351
1352
|
displayChar: this.displayChar,
|
|
1352
1353
|
...et(t[n]),
|
|
1353
1354
|
parent: this
|
|
1354
|
-
}) : new
|
|
1355
|
+
}) : new Zt({
|
|
1355
1356
|
char: n,
|
|
1356
1357
|
eager: this.eager,
|
|
1357
1358
|
isUnmasking: s
|
|
@@ -1374,7 +1375,7 @@ class L extends P {
|
|
|
1374
1375
|
_blocks: e,
|
|
1375
1376
|
...s
|
|
1376
1377
|
} = t;
|
|
1377
|
-
this._blocks.forEach((
|
|
1378
|
+
this._blocks.forEach((i, r) => i.state = e[r]), super.state = s;
|
|
1378
1379
|
}
|
|
1379
1380
|
reset() {
|
|
1380
1381
|
super.reset(), this._blocks.forEach((t) => t.reset());
|
|
@@ -1436,47 +1437,47 @@ class L extends P {
|
|
|
1436
1437
|
let s = (t = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : t.index;
|
|
1437
1438
|
if (s == null) return e;
|
|
1438
1439
|
this._blocks[s].isFilled && ++s;
|
|
1439
|
-
for (let
|
|
1440
|
-
const
|
|
1441
|
-
if (!
|
|
1442
|
-
e.aggregate(
|
|
1440
|
+
for (let i = s; i < this._blocks.length; ++i) {
|
|
1441
|
+
const r = this._blocks[i]._appendEager();
|
|
1442
|
+
if (!r.inserted) break;
|
|
1443
|
+
e.aggregate(r);
|
|
1443
1444
|
}
|
|
1444
1445
|
return e;
|
|
1445
1446
|
}
|
|
1446
1447
|
_appendCharRaw(t, e) {
|
|
1447
1448
|
e === void 0 && (e = {});
|
|
1448
|
-
const s = this._mapPosToBlock(this.displayValue.length),
|
|
1449
|
-
if (!s) return
|
|
1449
|
+
const s = this._mapPosToBlock(this.displayValue.length), i = new E();
|
|
1450
|
+
if (!s) return i;
|
|
1450
1451
|
for (let n = s.index, u; u = this._blocks[n]; ++n) {
|
|
1451
|
-
var
|
|
1452
|
+
var r;
|
|
1452
1453
|
const l = u._appendChar(t, {
|
|
1453
1454
|
...e,
|
|
1454
|
-
_beforeTailState: (
|
|
1455
|
+
_beforeTailState: (r = e._beforeTailState) == null || (r = r._blocks) == null ? void 0 : r[n]
|
|
1455
1456
|
});
|
|
1456
|
-
if (
|
|
1457
|
+
if (i.aggregate(l), l.consumed) break;
|
|
1457
1458
|
}
|
|
1458
|
-
return
|
|
1459
|
+
return i;
|
|
1459
1460
|
}
|
|
1460
1461
|
extractTail(t, e) {
|
|
1461
1462
|
t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
|
|
1462
1463
|
const s = new J();
|
|
1463
|
-
return t === e || this._forEachBlocksInRange(t, e, (
|
|
1464
|
-
const l =
|
|
1465
|
-
l.stop = this._findStopBefore(
|
|
1464
|
+
return t === e || this._forEachBlocksInRange(t, e, (i, r, n, u) => {
|
|
1465
|
+
const l = i.extractTail(n, u);
|
|
1466
|
+
l.stop = this._findStopBefore(r), l.from = this._blockStartPos(r), l instanceof J && (l.blockIndex = r), s.extend(l);
|
|
1466
1467
|
}), s;
|
|
1467
1468
|
}
|
|
1468
1469
|
extractInput(t, e, s) {
|
|
1469
1470
|
if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), s === void 0 && (s = {}), t === e) return "";
|
|
1470
|
-
let
|
|
1471
|
-
return this._forEachBlocksInRange(t, e, (
|
|
1472
|
-
|
|
1473
|
-
}),
|
|
1471
|
+
let i = "";
|
|
1472
|
+
return this._forEachBlocksInRange(t, e, (r, n, u, l) => {
|
|
1473
|
+
i += r.extractInput(u, l, s);
|
|
1474
|
+
}), i;
|
|
1474
1475
|
}
|
|
1475
1476
|
_findStopBefore(t) {
|
|
1476
1477
|
let e;
|
|
1477
1478
|
for (let s = 0; s < this._stops.length; ++s) {
|
|
1478
|
-
const
|
|
1479
|
-
if (
|
|
1479
|
+
const i = this._stops[s];
|
|
1480
|
+
if (i <= t) e = i;
|
|
1480
1481
|
else break;
|
|
1481
1482
|
}
|
|
1482
1483
|
return e;
|
|
@@ -1487,8 +1488,8 @@ class L extends P {
|
|
|
1487
1488
|
if (this.lazy && t == null) return e;
|
|
1488
1489
|
const s = this._mapPosToBlock(this.displayValue.length);
|
|
1489
1490
|
if (!s) return e;
|
|
1490
|
-
const
|
|
1491
|
-
return this._blocks.slice(
|
|
1491
|
+
const i = s.index, r = t ?? this._blocks.length;
|
|
1492
|
+
return this._blocks.slice(i, r).forEach((n) => {
|
|
1492
1493
|
if (!n.lazy || t != null) {
|
|
1493
1494
|
var u;
|
|
1494
1495
|
e.aggregate(n._appendPlaceholder((u = n._blocks) == null ? void 0 : u.length));
|
|
@@ -1499,11 +1500,11 @@ class L extends P {
|
|
|
1499
1500
|
_mapPosToBlock(t) {
|
|
1500
1501
|
let e = "";
|
|
1501
1502
|
for (let s = 0; s < this._blocks.length; ++s) {
|
|
1502
|
-
const
|
|
1503
|
-
if (e +=
|
|
1503
|
+
const i = this._blocks[s], r = e.length;
|
|
1504
|
+
if (e += i.displayValue, t <= e.length)
|
|
1504
1505
|
return {
|
|
1505
1506
|
index: s,
|
|
1506
|
-
offset: t -
|
|
1507
|
+
offset: t - r
|
|
1507
1508
|
};
|
|
1508
1509
|
}
|
|
1509
1510
|
}
|
|
@@ -1512,26 +1513,26 @@ class L extends P {
|
|
|
1512
1513
|
}
|
|
1513
1514
|
_forEachBlocksInRange(t, e, s) {
|
|
1514
1515
|
e === void 0 && (e = this.displayValue.length);
|
|
1515
|
-
const
|
|
1516
|
-
if (
|
|
1517
|
-
const
|
|
1518
|
-
if (s(this._blocks[
|
|
1519
|
-
for (let h =
|
|
1516
|
+
const i = this._mapPosToBlock(t);
|
|
1517
|
+
if (i) {
|
|
1518
|
+
const r = this._mapPosToBlock(e), n = r && i.index === r.index, u = i.offset, l = r && n ? r.offset : this._blocks[i.index].displayValue.length;
|
|
1519
|
+
if (s(this._blocks[i.index], i.index, u, l), r && !n) {
|
|
1520
|
+
for (let h = i.index + 1; h < r.index; ++h)
|
|
1520
1521
|
s(this._blocks[h], h, 0, this._blocks[h].displayValue.length);
|
|
1521
|
-
s(this._blocks[
|
|
1522
|
+
s(this._blocks[r.index], r.index, 0, r.offset);
|
|
1522
1523
|
}
|
|
1523
1524
|
}
|
|
1524
1525
|
}
|
|
1525
1526
|
remove(t, e) {
|
|
1526
1527
|
t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
|
|
1527
1528
|
const s = super.remove(t, e);
|
|
1528
|
-
return this._forEachBlocksInRange(t, e, (
|
|
1529
|
-
s.aggregate(
|
|
1529
|
+
return this._forEachBlocksInRange(t, e, (i, r, n, u) => {
|
|
1530
|
+
s.aggregate(i.remove(n, u));
|
|
1530
1531
|
}), s;
|
|
1531
1532
|
}
|
|
1532
1533
|
nearestInputPos(t, e) {
|
|
1533
1534
|
if (e === void 0 && (e = m.NONE), !this._blocks.length) return 0;
|
|
1534
|
-
const s = new
|
|
1535
|
+
const s = new de(this, t);
|
|
1535
1536
|
if (e === m.NONE)
|
|
1536
1537
|
return s.pushRightBeforeInput() || (s.popState(), s.pushLeftBeforeInput()) ? s.pos : this.displayValue.length;
|
|
1537
1538
|
if (e === m.LEFT || e === m.FORCE_LEFT) {
|
|
@@ -1550,8 +1551,8 @@ class L extends P {
|
|
|
1550
1551
|
totalInputPositions(t, e) {
|
|
1551
1552
|
t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
|
|
1552
1553
|
let s = 0;
|
|
1553
|
-
return this._forEachBlocksInRange(t, e, (
|
|
1554
|
-
s +=
|
|
1554
|
+
return this._forEachBlocksInRange(t, e, (i, r, n, u) => {
|
|
1555
|
+
s += i.totalInputPositions(n, u);
|
|
1555
1556
|
}), s;
|
|
1556
1557
|
}
|
|
1557
1558
|
/** Get block by name */
|
|
@@ -1576,7 +1577,7 @@ L.DEFAULTS = {
|
|
|
1576
1577
|
L.STOP_CHAR = "`";
|
|
1577
1578
|
L.ESCAPE_CHAR = "\\";
|
|
1578
1579
|
L.InputDefinition = lt;
|
|
1579
|
-
L.FixedDefinition =
|
|
1580
|
+
L.FixedDefinition = Zt;
|
|
1580
1581
|
g.MaskedPattern = L;
|
|
1581
1582
|
class ut extends L {
|
|
1582
1583
|
/**
|
|
@@ -1598,11 +1599,11 @@ class ut extends L {
|
|
|
1598
1599
|
const {
|
|
1599
1600
|
to: e = this.to || 0,
|
|
1600
1601
|
from: s = this.from || 0,
|
|
1601
|
-
maxLength:
|
|
1602
|
-
autofix:
|
|
1602
|
+
maxLength: i = this.maxLength || 0,
|
|
1603
|
+
autofix: r = this.autofix,
|
|
1603
1604
|
...n
|
|
1604
1605
|
} = t;
|
|
1605
|
-
this.to = e, this.from = s, this.maxLength = Math.max(String(e).length,
|
|
1606
|
+
this.to = e, this.from = s, this.maxLength = Math.max(String(e).length, i), this.autofix = r;
|
|
1606
1607
|
const u = String(this.from).padStart(this.maxLength, "0"), l = String(this.to).padStart(this.maxLength, "0");
|
|
1607
1608
|
let h = 0;
|
|
1608
1609
|
for (; h < l.length && l[h] === u[h]; ) ++h;
|
|
@@ -1613,8 +1614,8 @@ class ut extends L {
|
|
|
1613
1614
|
}
|
|
1614
1615
|
boundaries(t) {
|
|
1615
1616
|
let e = "", s = "";
|
|
1616
|
-
const [,
|
|
1617
|
-
return
|
|
1617
|
+
const [, i, r] = t.match(/^(\D*)(\d*)(\D*)/) || [];
|
|
1618
|
+
return r && (e = "0".repeat(i.length) + r, s = "9".repeat(i.length) + r), e = e.padEnd(this.maxLength, "0"), s = s.padEnd(this.maxLength, "9"), [e, s];
|
|
1618
1619
|
}
|
|
1619
1620
|
doPrepareChar(t, e) {
|
|
1620
1621
|
e === void 0 && (e = {});
|
|
@@ -1623,39 +1624,39 @@ class ut extends L {
|
|
|
1623
1624
|
}
|
|
1624
1625
|
_appendCharRaw(t, e) {
|
|
1625
1626
|
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"),
|
|
1627
|
-
return Number(n) < this.from ? super._appendCharRaw(s[this.value.length], e) : Number(
|
|
1627
|
+
const s = String(this.from).padStart(this.maxLength, "0"), i = String(this.to).padStart(this.maxLength, "0"), [r, n] = this.boundaries(this.value + t);
|
|
1628
|
+
return Number(n) < this.from ? super._appendCharRaw(s[this.value.length], e) : Number(r) > 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(i[this.value.length], e) : super._appendCharRaw(t, e);
|
|
1628
1629
|
}
|
|
1629
1630
|
doValidate(t) {
|
|
1630
1631
|
const e = this.value;
|
|
1631
1632
|
if (e.search(/[^0]/) === -1 && e.length <= this._matchFrom) return !0;
|
|
1632
|
-
const [
|
|
1633
|
-
return this.from <= Number(
|
|
1633
|
+
const [i, r] = this.boundaries(e);
|
|
1634
|
+
return this.from <= Number(r) && Number(i) <= this.to && super.doValidate(t);
|
|
1634
1635
|
}
|
|
1635
1636
|
pad(t) {
|
|
1636
1637
|
const e = new E();
|
|
1637
1638
|
if (this.value.length === this.maxLength) return e;
|
|
1638
|
-
const s = this.value,
|
|
1639
|
-
if (
|
|
1639
|
+
const s = this.value, i = this.maxLength - this.value.length;
|
|
1640
|
+
if (i) {
|
|
1640
1641
|
this.reset();
|
|
1641
|
-
for (let
|
|
1642
|
+
for (let r = 0; r < i; ++r)
|
|
1642
1643
|
e.aggregate(super._appendCharRaw("0", t));
|
|
1643
|
-
s.split("").forEach((
|
|
1644
|
+
s.split("").forEach((r) => this._appendCharRaw(r));
|
|
1644
1645
|
}
|
|
1645
1646
|
return e;
|
|
1646
1647
|
}
|
|
1647
1648
|
}
|
|
1648
1649
|
g.MaskedRange = ut;
|
|
1649
|
-
const
|
|
1650
|
+
const me = "d{.}`m{.}`Y";
|
|
1650
1651
|
class z extends L {
|
|
1651
1652
|
static extractPatternOptions(t) {
|
|
1652
1653
|
const {
|
|
1653
1654
|
mask: e,
|
|
1654
1655
|
pattern: s,
|
|
1655
|
-
...
|
|
1656
|
+
...i
|
|
1656
1657
|
} = t;
|
|
1657
1658
|
return {
|
|
1658
|
-
...
|
|
1659
|
+
...i,
|
|
1659
1660
|
mask: G(e) ? e : s
|
|
1660
1661
|
};
|
|
1661
1662
|
}
|
|
@@ -1677,14 +1678,14 @@ class z extends L {
|
|
|
1677
1678
|
const {
|
|
1678
1679
|
mask: e,
|
|
1679
1680
|
pattern: s,
|
|
1680
|
-
blocks:
|
|
1681
|
-
...
|
|
1681
|
+
blocks: i,
|
|
1682
|
+
...r
|
|
1682
1683
|
} = {
|
|
1683
1684
|
...z.DEFAULTS,
|
|
1684
1685
|
...t
|
|
1685
1686
|
}, 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,
|
|
1687
|
-
...
|
|
1687
|
+
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, i), super._update({
|
|
1688
|
+
...r,
|
|
1688
1689
|
mask: G(e) ? e : s,
|
|
1689
1690
|
blocks: n
|
|
1690
1691
|
});
|
|
@@ -1739,15 +1740,15 @@ z.GET_DEFAULT_BLOCKS = () => ({
|
|
|
1739
1740
|
z.DEFAULTS = {
|
|
1740
1741
|
...L.DEFAULTS,
|
|
1741
1742
|
mask: Date,
|
|
1742
|
-
pattern:
|
|
1743
|
+
pattern: me,
|
|
1743
1744
|
format: (a, t) => {
|
|
1744
1745
|
if (!a) return "";
|
|
1745
|
-
const e = String(a.getDate()).padStart(2, "0"), s = String(a.getMonth() + 1).padStart(2, "0"),
|
|
1746
|
-
return [e, s,
|
|
1746
|
+
const e = String(a.getDate()).padStart(2, "0"), s = String(a.getMonth() + 1).padStart(2, "0"), i = a.getFullYear();
|
|
1747
|
+
return [e, s, i].join(".");
|
|
1747
1748
|
},
|
|
1748
1749
|
parse: (a, t) => {
|
|
1749
|
-
const [e, s,
|
|
1750
|
-
return new Date(
|
|
1750
|
+
const [e, s, i] = a.split(".").map(Number);
|
|
1751
|
+
return new Date(i, s - 1, e);
|
|
1751
1752
|
}
|
|
1752
1753
|
};
|
|
1753
1754
|
g.MaskedDate = z;
|
|
@@ -1765,14 +1766,14 @@ class ct extends P {
|
|
|
1765
1766
|
super._update(t), "mask" in t && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(t.mask) ? t.mask.map((e) => {
|
|
1766
1767
|
const {
|
|
1767
1768
|
expose: s,
|
|
1768
|
-
...
|
|
1769
|
-
} = et(e),
|
|
1769
|
+
...i
|
|
1770
|
+
} = et(e), r = K({
|
|
1770
1771
|
overwrite: this._overwrite,
|
|
1771
1772
|
eager: this._eager,
|
|
1772
1773
|
skipInvalid: this._skipInvalid,
|
|
1773
|
-
...
|
|
1774
|
+
...i
|
|
1774
1775
|
});
|
|
1775
|
-
return s && (this.exposeMask =
|
|
1776
|
+
return s && (this.exposeMask = r), r;
|
|
1776
1777
|
}) : []);
|
|
1777
1778
|
}
|
|
1778
1779
|
_appendCharRaw(t, e) {
|
|
@@ -1782,12 +1783,12 @@ class ct extends P {
|
|
|
1782
1783
|
}
|
|
1783
1784
|
_applyDispatch(t, e, s) {
|
|
1784
1785
|
t === void 0 && (t = ""), e === void 0 && (e = {}), s === void 0 && (s = "");
|
|
1785
|
-
const
|
|
1786
|
+
const i = e.tail && e._beforeTailState != null ? e._beforeTailState._value : this.value, r = this.rawInputValue, n = e.tail && e._beforeTailState != null ? e._beforeTailState._rawInputValue : r, u = r.slice(n.length), l = this.currentMask, h = new E(), v = l == null ? void 0 : l.state;
|
|
1786
1787
|
return this.currentMask = this.doDispatch(t, {
|
|
1787
1788
|
...e
|
|
1788
1789
|
}, s), this.currentMask && (this.currentMask !== l ? (this.currentMask.reset(), n && (this.currentMask.append(n, {
|
|
1789
1790
|
raw: !0
|
|
1790
|
-
}), h.tailShift = this.currentMask.value.length -
|
|
1791
|
+
}), h.tailShift = this.currentMask.value.length - i.length), u && (h.tailShift += this.currentMask.append(u, {
|
|
1791
1792
|
raw: !0,
|
|
1792
1793
|
tail: !0
|
|
1793
1794
|
}).tailShift)) : v && (this.currentMask.state = v)), h;
|
|
@@ -1819,21 +1820,21 @@ class ct extends P {
|
|
|
1819
1820
|
}
|
|
1820
1821
|
doPrepare(t, e) {
|
|
1821
1822
|
e === void 0 && (e = {});
|
|
1822
|
-
let [s,
|
|
1823
|
+
let [s, i] = super.doPrepare(t, e);
|
|
1823
1824
|
if (this.currentMask) {
|
|
1824
|
-
let
|
|
1825
|
-
[s,
|
|
1825
|
+
let r;
|
|
1826
|
+
[s, r] = super.doPrepare(s, this.currentMaskFlags(e)), i = i.aggregate(r);
|
|
1826
1827
|
}
|
|
1827
|
-
return [s,
|
|
1828
|
+
return [s, i];
|
|
1828
1829
|
}
|
|
1829
1830
|
doPrepareChar(t, e) {
|
|
1830
1831
|
e === void 0 && (e = {});
|
|
1831
|
-
let [s,
|
|
1832
|
+
let [s, i] = super.doPrepareChar(t, e);
|
|
1832
1833
|
if (this.currentMask) {
|
|
1833
|
-
let
|
|
1834
|
-
[s,
|
|
1834
|
+
let r;
|
|
1835
|
+
[s, r] = super.doPrepareChar(s, this.currentMaskFlags(e)), i = i.aggregate(r);
|
|
1835
1836
|
}
|
|
1836
|
-
return [s,
|
|
1837
|
+
return [s, i];
|
|
1837
1838
|
}
|
|
1838
1839
|
reset() {
|
|
1839
1840
|
var t;
|
|
@@ -1891,10 +1892,10 @@ class ct extends P {
|
|
|
1891
1892
|
const {
|
|
1892
1893
|
compiledMasks: e,
|
|
1893
1894
|
currentMaskRef: s,
|
|
1894
|
-
currentMask:
|
|
1895
|
-
...
|
|
1895
|
+
currentMask: i,
|
|
1896
|
+
...r
|
|
1896
1897
|
} = t;
|
|
1897
|
-
e && this.compiledMasks.forEach((n, u) => n.state = e[u]), s != null && (this.currentMask = s, this.currentMask.state =
|
|
1898
|
+
e && this.compiledMasks.forEach((n, u) => n.state = e[u]), s != null && (this.currentMask = s, this.currentMask.state = i), super.state = r;
|
|
1898
1899
|
}
|
|
1899
1900
|
extractInput(t, e, s) {
|
|
1900
1901
|
return this.currentMask ? this.currentMask.extractInput(t, e, s) : "";
|
|
@@ -1936,10 +1937,10 @@ class ct extends P {
|
|
|
1936
1937
|
return Array.isArray(t) ? this.compiledMasks.every((e, s) => {
|
|
1937
1938
|
if (!t[s]) return;
|
|
1938
1939
|
const {
|
|
1939
|
-
mask:
|
|
1940
|
-
...
|
|
1940
|
+
mask: i,
|
|
1941
|
+
...r
|
|
1941
1942
|
} = t[s];
|
|
1942
|
-
return ot(e,
|
|
1943
|
+
return ot(e, r) && e.maskEquals(i);
|
|
1943
1944
|
}) : super.maskEquals(t);
|
|
1944
1945
|
}
|
|
1945
1946
|
typedValueEquals(t) {
|
|
@@ -1951,9 +1952,9 @@ ct.DEFAULTS = {
|
|
|
1951
1952
|
...P.DEFAULTS,
|
|
1952
1953
|
dispatch: (a, t, e, s) => {
|
|
1953
1954
|
if (!t.compiledMasks.length) return;
|
|
1954
|
-
const
|
|
1955
|
+
const i = t.rawInputValue, r = t.compiledMasks.map((n, u) => {
|
|
1955
1956
|
const l = t.currentMask === n, h = l ? n.displayValue.length : n.nearestInputPos(n.displayValue.length, m.FORCE_LEFT);
|
|
1956
|
-
return n.rawInputValue !==
|
|
1957
|
+
return n.rawInputValue !== i ? (n.reset(), n.append(i, {
|
|
1957
1958
|
raw: !0
|
|
1958
1959
|
})) : l || n.remove(h), n.append(a, t.currentMaskFlags(e)), n.appendTail(s), {
|
|
1959
1960
|
index: u,
|
|
@@ -1961,7 +1962,7 @@ ct.DEFAULTS = {
|
|
|
1961
1962
|
totalInputPositions: n.totalInputPositions(0, Math.max(h, n.nearestInputPos(n.displayValue.length, m.FORCE_LEFT)))
|
|
1962
1963
|
};
|
|
1963
1964
|
});
|
|
1964
|
-
return
|
|
1965
|
+
return r.sort((n, u) => u.weight - n.weight || u.totalInputPositions - n.totalInputPositions), t.compiledMasks[r[0].index];
|
|
1965
1966
|
}
|
|
1966
1967
|
};
|
|
1967
1968
|
g.MaskedDynamic = ct;
|
|
@@ -1981,21 +1982,21 @@ class dt extends L {
|
|
|
1981
1982
|
...s
|
|
1982
1983
|
} = t;
|
|
1983
1984
|
if (e) {
|
|
1984
|
-
const
|
|
1985
|
-
s.mask = "*".repeat(
|
|
1985
|
+
const i = e.map((u) => u.length), r = Math.min(...i), n = Math.max(...i) - r;
|
|
1986
|
+
s.mask = "*".repeat(r), n && (s.mask += "[" + "*".repeat(n) + "]"), this.enum = e;
|
|
1986
1987
|
}
|
|
1987
1988
|
super._update(s);
|
|
1988
1989
|
}
|
|
1989
1990
|
_appendCharRaw(t, e) {
|
|
1990
1991
|
e === void 0 && (e = {});
|
|
1991
|
-
const s = Math.min(this.nearestInputPos(0, m.FORCE_RIGHT), this.value.length),
|
|
1992
|
-
if (
|
|
1993
|
-
|
|
1994
|
-
const l =
|
|
1992
|
+
const s = Math.min(this.nearestInputPos(0, m.FORCE_RIGHT), this.value.length), i = this.enum.filter((r) => this.matchValue(r, this.unmaskedValue + t, s));
|
|
1993
|
+
if (i.length) {
|
|
1994
|
+
i.length === 1 && this._forEachBlocksInRange(0, this.value.length, (n, u) => {
|
|
1995
|
+
const l = i[0][u];
|
|
1995
1996
|
u >= this.value.length || l === n.value || (n.reset(), n._appendChar(l, e));
|
|
1996
1997
|
});
|
|
1997
|
-
const
|
|
1998
|
-
return
|
|
1998
|
+
const r = super._appendCharRaw(i[0][this.value.length], e);
|
|
1999
|
+
return i.length === 1 && i[0].slice(this.unmaskedValue.length).split("").forEach((n) => r.aggregate(super._appendCharRaw(n))), r;
|
|
1999
2000
|
}
|
|
2000
2001
|
return new E({
|
|
2001
2002
|
skip: !this.isComplete
|
|
@@ -2007,11 +2008,11 @@ class dt extends L {
|
|
|
2007
2008
|
remove(t, e) {
|
|
2008
2009
|
if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), t === e) return new E();
|
|
2009
2010
|
const s = Math.min(super.nearestInputPos(0, m.FORCE_RIGHT), this.value.length);
|
|
2010
|
-
let
|
|
2011
|
-
for (
|
|
2011
|
+
let i;
|
|
2012
|
+
for (i = t; i >= 0 && !(this.enum.filter((u) => this.matchValue(u, this.value.slice(s, i), s)).length > 1); --i)
|
|
2012
2013
|
;
|
|
2013
|
-
const
|
|
2014
|
-
return
|
|
2014
|
+
const r = super.remove(i, e);
|
|
2015
|
+
return r.tailShift += i - t, r;
|
|
2015
2016
|
}
|
|
2016
2017
|
get isComplete() {
|
|
2017
2018
|
return this.enum.indexOf(this.value) >= 0;
|
|
@@ -2022,7 +2023,7 @@ dt.DEFAULTS = {
|
|
|
2022
2023
|
matchValue: (a, t, e) => a.indexOf(t, e) === e
|
|
2023
2024
|
};
|
|
2024
2025
|
g.MaskedEnum = dt;
|
|
2025
|
-
class
|
|
2026
|
+
class ve extends P {
|
|
2026
2027
|
/** */
|
|
2027
2028
|
/** Enable characters overwriting */
|
|
2028
2029
|
/** */
|
|
@@ -2038,8 +2039,8 @@ class _e extends P {
|
|
|
2038
2039
|
});
|
|
2039
2040
|
}
|
|
2040
2041
|
}
|
|
2041
|
-
g.MaskedFunction =
|
|
2042
|
-
var
|
|
2042
|
+
g.MaskedFunction = ve;
|
|
2043
|
+
var Xt;
|
|
2043
2044
|
class U extends P {
|
|
2044
2045
|
/** Single char */
|
|
2045
2046
|
/** Single char */
|
|
@@ -2080,7 +2081,7 @@ class U extends P {
|
|
|
2080
2081
|
}
|
|
2081
2082
|
doPrepareChar(t, e) {
|
|
2082
2083
|
e === void 0 && (e = {});
|
|
2083
|
-
const [s,
|
|
2084
|
+
const [s, i] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
|
|
2084
2085
|
radix should be mapped when
|
|
2085
2086
|
1) input is done from keyboard = flags.input && flags.raw
|
|
2086
2087
|
2) unmasked value is set = !flags.input && !flags.raw
|
|
@@ -2089,13 +2090,13 @@ class U extends P {
|
|
|
2089
2090
|
2) raw value is set = !flags.input && flags.raw
|
|
2090
2091
|
*/
|
|
2091
2092
|
(e.input && e.raw || !e.input && !e.raw) ? t.replace(this._mapToRadixRegExp, this.radix) : t), e);
|
|
2092
|
-
return t && !s && (
|
|
2093
|
+
return t && !s && (i.skip = !0), s && !this.allowPositive && !this.value && s !== "-" && i.aggregate(this._appendChar("-")), [s, i];
|
|
2093
2094
|
}
|
|
2094
2095
|
_separatorsCount(t, e) {
|
|
2095
2096
|
e === void 0 && (e = !1);
|
|
2096
2097
|
let s = 0;
|
|
2097
|
-
for (let
|
|
2098
|
-
this._value.indexOf(this.thousandsSeparator,
|
|
2098
|
+
for (let i = 0; i < t; ++i)
|
|
2099
|
+
this._value.indexOf(this.thousandsSeparator, i) === i && (++s, e && (t += this.thousandsSeparator.length));
|
|
2099
2100
|
return s;
|
|
2100
2101
|
}
|
|
2101
2102
|
_separatorsCountFromSlice(t) {
|
|
@@ -2106,24 +2107,24 @@ class U extends P {
|
|
|
2106
2107
|
}
|
|
2107
2108
|
_appendCharRaw(t, e) {
|
|
2108
2109
|
e === void 0 && (e = {});
|
|
2109
|
-
const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value,
|
|
2110
|
+
const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, i = this._separatorsCountFromSlice(s);
|
|
2110
2111
|
this._value = this._removeThousandsSeparators(this.value);
|
|
2111
|
-
const
|
|
2112
|
+
const r = this._value;
|
|
2112
2113
|
this._value += t;
|
|
2113
2114
|
const n = this.number;
|
|
2114
2115
|
let u = !isNaN(n), l = !1;
|
|
2115
2116
|
if (u) {
|
|
2116
|
-
let
|
|
2117
|
-
this.min != null && this.min < 0 && this.number < this.min && (
|
|
2117
|
+
let F;
|
|
2118
|
+
this.min != null && this.min < 0 && this.number < this.min && (F = this.min), this.max != null && this.max > 0 && this.number > this.max && (F = this.max), F != null && (this.autofix ? (this._value = this.format(F, this).replace(U.UNMASKED_RADIX, this.radix), l || (l = r === this._value && !e.tail)) : u = !1), u && (u = !!this._value.match(this._numberRegExp));
|
|
2118
2119
|
}
|
|
2119
2120
|
let h;
|
|
2120
2121
|
u ? h = new E({
|
|
2121
|
-
inserted: this._value.slice(
|
|
2122
|
+
inserted: this._value.slice(r.length),
|
|
2122
2123
|
rawInserted: l ? "" : t,
|
|
2123
2124
|
skip: l
|
|
2124
|
-
}) : (this._value =
|
|
2125
|
+
}) : (this._value = r, h = new E()), this._value = this._insertThousandsSeparators(this._value);
|
|
2125
2126
|
const v = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, _ = this._separatorsCountFromSlice(v);
|
|
2126
|
-
return h.tailShift += (_ -
|
|
2127
|
+
return h.tailShift += (_ - i) * this.thousandsSeparator.length, h;
|
|
2127
2128
|
}
|
|
2128
2129
|
_findSeparatorAround(t) {
|
|
2129
2130
|
if (this.thousandsSeparator) {
|
|
@@ -2135,16 +2136,16 @@ class U extends P {
|
|
|
2135
2136
|
_adjustRangeWithSeparators(t, e) {
|
|
2136
2137
|
const s = this._findSeparatorAround(t);
|
|
2137
2138
|
s >= 0 && (t = s);
|
|
2138
|
-
const
|
|
2139
|
-
return
|
|
2139
|
+
const i = this._findSeparatorAround(e);
|
|
2140
|
+
return i >= 0 && (e = i + this.thousandsSeparator.length), [t, e];
|
|
2140
2141
|
}
|
|
2141
2142
|
remove(t, e) {
|
|
2142
2143
|
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),
|
|
2144
|
-
this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(s +
|
|
2144
|
+
const s = this.value.slice(0, t), i = this.value.slice(e), r = this._separatorsCount(s.length);
|
|
2145
|
+
this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(s + i));
|
|
2145
2146
|
const n = this._separatorsCountFromSlice(s);
|
|
2146
2147
|
return new E({
|
|
2147
|
-
tailShift: (n -
|
|
2148
|
+
tailShift: (n - r) * this.thousandsSeparator.length
|
|
2148
2149
|
});
|
|
2149
2150
|
}
|
|
2150
2151
|
nearestInputPos(t, e) {
|
|
@@ -2155,8 +2156,8 @@ class U extends P {
|
|
|
2155
2156
|
case m.FORCE_LEFT: {
|
|
2156
2157
|
const s = this._findSeparatorAround(t - 1);
|
|
2157
2158
|
if (s >= 0) {
|
|
2158
|
-
const
|
|
2159
|
-
if (t <
|
|
2159
|
+
const i = s + this.thousandsSeparator.length;
|
|
2160
|
+
if (t < i || this.value.length <= i || e === m.FORCE_LEFT)
|
|
2160
2161
|
return s;
|
|
2161
2162
|
}
|
|
2162
2163
|
break;
|
|
@@ -2182,7 +2183,7 @@ class U extends P {
|
|
|
2182
2183
|
}
|
|
2183
2184
|
_normalizeZeros(t) {
|
|
2184
2185
|
const e = this._removeThousandsSeparators(t).split(this.radix);
|
|
2185
|
-
return e[0] = e[0].replace(/^(\D*)(0*)(\d*)/, (s,
|
|
2186
|
+
return e[0] = e[0].replace(/^(\D*)(0*)(\d*)/, (s, i, r, n) => i + 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
|
}
|
|
2187
2188
|
_padFractionalZeros(t) {
|
|
2188
2189
|
if (!t) return t;
|
|
@@ -2191,8 +2192,8 @@ class U extends P {
|
|
|
2191
2192
|
}
|
|
2192
2193
|
doSkipInvalid(t, e, s) {
|
|
2193
2194
|
e === void 0 && (e = {});
|
|
2194
|
-
const
|
|
2195
|
-
return super.doSkipInvalid(t, e, s) && !
|
|
2195
|
+
const i = this.scale === 0 && t !== this.thousandsSeparator && (t === this.radix || t === U.UNMASKED_RADIX || this.mapToRadix.includes(t));
|
|
2196
|
+
return super.doSkipInvalid(t, e, s) && !i;
|
|
2196
2197
|
}
|
|
2197
2198
|
get unmaskedValue() {
|
|
2198
2199
|
return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, U.UNMASKED_RADIX);
|
|
@@ -2223,7 +2224,7 @@ class U extends P {
|
|
|
2223
2224
|
return (super.typedValueEquals(t) || U.EMPTY_VALUES.includes(t) && U.EMPTY_VALUES.includes(this.typedValue)) && !(t === 0 && this.value === "");
|
|
2224
2225
|
}
|
|
2225
2226
|
}
|
|
2226
|
-
|
|
2227
|
+
Xt = U;
|
|
2227
2228
|
U.UNMASKED_RADIX = ".";
|
|
2228
2229
|
U.EMPTY_VALUES = [...P.EMPTY_VALUES, 0];
|
|
2229
2230
|
U.DEFAULTS = {
|
|
@@ -2231,7 +2232,7 @@ U.DEFAULTS = {
|
|
|
2231
2232
|
mask: Number,
|
|
2232
2233
|
radix: ",",
|
|
2233
2234
|
thousandsSeparator: "",
|
|
2234
|
-
mapToRadix: [
|
|
2235
|
+
mapToRadix: [Xt.UNMASKED_RADIX],
|
|
2235
2236
|
min: Number.MIN_SAFE_INTEGER,
|
|
2236
2237
|
max: Number.MAX_SAFE_INTEGER,
|
|
2237
2238
|
scale: 2,
|
|
@@ -2244,23 +2245,23 @@ U.DEFAULTS = {
|
|
|
2244
2245
|
})
|
|
2245
2246
|
};
|
|
2246
2247
|
g.MaskedNumber = U;
|
|
2247
|
-
const
|
|
2248
|
+
const wt = {
|
|
2248
2249
|
MASKED: "value",
|
|
2249
2250
|
UNMASKED: "unmaskedValue",
|
|
2250
2251
|
TYPED: "typedValue"
|
|
2251
2252
|
};
|
|
2252
|
-
function
|
|
2253
|
-
t === void 0 && (t =
|
|
2253
|
+
function Jt(a, t, e) {
|
|
2254
|
+
t === void 0 && (t = wt.MASKED), e === void 0 && (e = wt.MASKED);
|
|
2254
2255
|
const s = K(a);
|
|
2255
|
-
return (
|
|
2256
|
+
return (i) => s.runIsolated((r) => (r[t] = i, r[e]));
|
|
2256
2257
|
}
|
|
2257
|
-
function
|
|
2258
|
-
return
|
|
2258
|
+
function ge(a, t, e, s) {
|
|
2259
|
+
return Jt(t, e, s)(a);
|
|
2259
2260
|
}
|
|
2260
|
-
g.PIPE_TYPE =
|
|
2261
|
-
g.createPipe =
|
|
2262
|
-
g.pipe =
|
|
2263
|
-
class
|
|
2261
|
+
g.PIPE_TYPE = wt;
|
|
2262
|
+
g.createPipe = Jt;
|
|
2263
|
+
g.pipe = ge;
|
|
2264
|
+
class _e extends L {
|
|
2264
2265
|
get repeatFrom() {
|
|
2265
2266
|
var t;
|
|
2266
2267
|
return (t = Array.isArray(this.repeat) ? this.repeat[0] : this.repeat === 1 / 0 ? 0 : this.repeat) != null ? t : 0;
|
|
@@ -2276,15 +2277,15 @@ class Ee extends L {
|
|
|
2276
2277
|
super.updateOptions(t);
|
|
2277
2278
|
}
|
|
2278
2279
|
_update(t) {
|
|
2279
|
-
var e, s,
|
|
2280
|
+
var e, s, i;
|
|
2280
2281
|
const {
|
|
2281
|
-
repeat:
|
|
2282
|
+
repeat: r,
|
|
2282
2283
|
...n
|
|
2283
2284
|
} = et(t);
|
|
2284
2285
|
this._blockOpts = Object.assign({}, this._blockOpts, n);
|
|
2285
2286
|
const u = K(this._blockOpts);
|
|
2286
|
-
this.repeat = (e = (s =
|
|
2287
|
-
mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((
|
|
2287
|
+
this.repeat = (e = (s = r ?? u.repeat) != null ? s : this.repeat) != null ? e : 1 / 0, super._update({
|
|
2288
|
+
mask: "m".repeat(Math.max(this.repeatTo === 1 / 0 && ((i = this._blocks) == null ? void 0 : i.length) || 0, this.repeatFrom)),
|
|
2288
2289
|
blocks: {
|
|
2289
2290
|
m: u
|
|
2290
2291
|
},
|
|
@@ -2305,13 +2306,13 @@ class Ee extends L {
|
|
|
2305
2306
|
e === void 0 && (e = {});
|
|
2306
2307
|
const s = new E();
|
|
2307
2308
|
for (
|
|
2308
|
-
let l = (
|
|
2309
|
+
let l = (i = (r = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : r.index) != null ? i : Math.max(this._blocks.length - 1, 0), h, v;
|
|
2309
2310
|
// try to get a block or
|
|
2310
2311
|
// try to allocate a new block if not allocated already
|
|
2311
2312
|
h = (n = this._blocks[l]) != null ? n : v = !v && this._allocateBlock(l);
|
|
2312
2313
|
++l
|
|
2313
2314
|
) {
|
|
2314
|
-
var
|
|
2315
|
+
var i, r, n, u;
|
|
2315
2316
|
const _ = h._appendChar(t, {
|
|
2316
2317
|
...e,
|
|
2317
2318
|
_beforeTailState: (u = e._beforeTailState) == null || (u = u._blocks) == null ? void 0 : u[l]
|
|
@@ -2325,13 +2326,13 @@ class Ee extends L {
|
|
|
2325
2326
|
return s;
|
|
2326
2327
|
}
|
|
2327
2328
|
_trimEmptyTail(t, e) {
|
|
2328
|
-
var s,
|
|
2329
|
+
var s, i;
|
|
2329
2330
|
t === void 0 && (t = 0);
|
|
2330
|
-
const
|
|
2331
|
+
const r = Math.max(((s = this._mapPosToBlock(t)) == null ? void 0 : s.index) || 0, this.repeatFrom, 0);
|
|
2331
2332
|
let n;
|
|
2332
|
-
e != null && (n = (
|
|
2333
|
+
e != null && (n = (i = this._mapPosToBlock(e)) == null ? void 0 : i.index), n == null && (n = this._blocks.length - 1);
|
|
2333
2334
|
let u = 0;
|
|
2334
|
-
for (let l = n;
|
|
2335
|
+
for (let l = n; r <= l && !this._blocks[l].unmaskedValue; --l, ++u)
|
|
2335
2336
|
;
|
|
2336
2337
|
u && (this._blocks.splice(n - u + 1, u), this.mask = this.mask.slice(u));
|
|
2337
2338
|
}
|
|
@@ -2353,12 +2354,12 @@ class Ee extends L {
|
|
|
2353
2354
|
this._blocks.length = t._blocks.length, this.mask = this.mask.slice(0, this._blocks.length), super.state = t;
|
|
2354
2355
|
}
|
|
2355
2356
|
}
|
|
2356
|
-
g.RepeatBlock =
|
|
2357
|
+
g.RepeatBlock = _e;
|
|
2357
2358
|
try {
|
|
2358
2359
|
globalThis.IMask = g;
|
|
2359
2360
|
} catch {
|
|
2360
2361
|
}
|
|
2361
|
-
function
|
|
2362
|
+
function ke(a) {
|
|
2362
2363
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
2363
2364
|
}
|
|
2364
2365
|
var nt = { exports: {} }, at = { exports: {} }, I = {};
|
|
@@ -2370,11 +2371,11 @@ var nt = { exports: {} }, at = { exports: {} }, I = {};
|
|
|
2370
2371
|
* This source code is licensed under the MIT license found in the
|
|
2371
2372
|
* LICENSE file in the root directory of this source tree.
|
|
2372
2373
|
*/
|
|
2373
|
-
var
|
|
2374
|
-
function
|
|
2375
|
-
if (
|
|
2376
|
-
|
|
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,
|
|
2374
|
+
var Pt;
|
|
2375
|
+
function Ee() {
|
|
2376
|
+
if (Pt) return I;
|
|
2377
|
+
Pt = 1;
|
|
2378
|
+
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, i = a ? Symbol.for("react.strict_mode") : 60108, r = 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, F = 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
2379
|
function V(c) {
|
|
2379
2380
|
if (typeof c == "object" && c !== null) {
|
|
2380
2381
|
var W = c.$$typeof;
|
|
@@ -2384,8 +2385,8 @@ function ye() {
|
|
|
2384
2385
|
case l:
|
|
2385
2386
|
case h:
|
|
2386
2387
|
case s:
|
|
2387
|
-
case i:
|
|
2388
2388
|
case r:
|
|
2389
|
+
case i:
|
|
2389
2390
|
case _:
|
|
2390
2391
|
return c;
|
|
2391
2392
|
default:
|
|
@@ -2408,7 +2409,7 @@ function ye() {
|
|
|
2408
2409
|
function D(c) {
|
|
2409
2410
|
return V(c) === h;
|
|
2410
2411
|
}
|
|
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 =
|
|
2412
|
+
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 = r, I.StrictMode = i, I.Suspense = _, I.isAsyncMode = function(c) {
|
|
2412
2413
|
return D(c) || V(c) === l;
|
|
2413
2414
|
}, I.isConcurrentMode = D, I.isContextConsumer = function(c) {
|
|
2414
2415
|
return V(c) === u;
|
|
@@ -2427,13 +2428,13 @@ function ye() {
|
|
|
2427
2428
|
}, I.isPortal = function(c) {
|
|
2428
2429
|
return V(c) === e;
|
|
2429
2430
|
}, I.isProfiler = function(c) {
|
|
2430
|
-
return V(c) === i;
|
|
2431
|
-
}, I.isStrictMode = function(c) {
|
|
2432
2431
|
return V(c) === r;
|
|
2432
|
+
}, I.isStrictMode = function(c) {
|
|
2433
|
+
return V(c) === i;
|
|
2433
2434
|
}, I.isSuspense = function(c) {
|
|
2434
2435
|
return V(c) === _;
|
|
2435
2436
|
}, I.isValidElementType = function(c) {
|
|
2436
|
-
return typeof c == "string" || typeof c == "function" || c === s || c === h || c ===
|
|
2437
|
+
return typeof c == "string" || typeof c == "function" || c === s || c === h || c === r || c === i || c === _ || c === F || 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
2438
|
}, I.typeOf = V, I;
|
|
2438
2439
|
}
|
|
2439
2440
|
var w = {};
|
|
@@ -2445,13 +2446,13 @@ var w = {};
|
|
|
2445
2446
|
* This source code is licensed under the MIT license found in the
|
|
2446
2447
|
* LICENSE file in the root directory of this source tree.
|
|
2447
2448
|
*/
|
|
2448
|
-
var
|
|
2449
|
-
function
|
|
2450
|
-
return
|
|
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,
|
|
2449
|
+
var Lt;
|
|
2450
|
+
function ye() {
|
|
2451
|
+
return Lt || (Lt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
2452
|
+
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, i = a ? Symbol.for("react.strict_mode") : 60108, r = 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, F = 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
2453
|
function V(p) {
|
|
2453
2454
|
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 ===
|
|
2455
|
+
p === s || p === h || p === r || p === i || p === _ || p === F || 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
|
}
|
|
2456
2457
|
function D(p) {
|
|
2457
2458
|
if (typeof p == "object" && p !== null) {
|
|
@@ -2463,19 +2464,19 @@ function Ce() {
|
|
|
2463
2464
|
case l:
|
|
2464
2465
|
case h:
|
|
2465
2466
|
case s:
|
|
2466
|
-
case i:
|
|
2467
2467
|
case r:
|
|
2468
|
+
case i:
|
|
2468
2469
|
case _:
|
|
2469
2470
|
return rt;
|
|
2470
2471
|
default:
|
|
2471
|
-
var
|
|
2472
|
-
switch (
|
|
2472
|
+
var Bt = rt && rt.$$typeof;
|
|
2473
|
+
switch (Bt) {
|
|
2473
2474
|
case u:
|
|
2474
2475
|
case v:
|
|
2475
2476
|
case N:
|
|
2476
2477
|
case B:
|
|
2477
2478
|
case n:
|
|
2478
|
-
return
|
|
2479
|
+
return Bt;
|
|
2479
2480
|
default:
|
|
2480
2481
|
return Y;
|
|
2481
2482
|
}
|
|
@@ -2485,7 +2486,7 @@ function Ce() {
|
|
|
2485
2486
|
}
|
|
2486
2487
|
}
|
|
2487
2488
|
}
|
|
2488
|
-
var c = l, W = h, ft = u, mt = n, vt = t, gt = v, st = s, _t = N, kt = B, Q = e, Et =
|
|
2489
|
+
var c = l, W = h, ft = u, mt = n, vt = t, gt = v, st = s, _t = N, kt = B, Q = e, Et = r, $ = i, Z = _, it = !1;
|
|
2489
2490
|
function yt(p) {
|
|
2490
2491
|
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
|
}
|
|
@@ -2504,7 +2505,7 @@ function Ce() {
|
|
|
2504
2505
|
function k(p) {
|
|
2505
2506
|
return D(p) === v;
|
|
2506
2507
|
}
|
|
2507
|
-
function
|
|
2508
|
+
function S(p) {
|
|
2508
2509
|
return D(p) === s;
|
|
2509
2510
|
}
|
|
2510
2511
|
function y(p) {
|
|
@@ -2517,42 +2518,42 @@ function Ce() {
|
|
|
2517
2518
|
return D(p) === e;
|
|
2518
2519
|
}
|
|
2519
2520
|
function R(p) {
|
|
2520
|
-
return D(p) ===
|
|
2521
|
+
return D(p) === r;
|
|
2521
2522
|
}
|
|
2522
2523
|
function T(p) {
|
|
2523
|
-
return D(p) ===
|
|
2524
|
+
return D(p) === i;
|
|
2524
2525
|
}
|
|
2525
2526
|
function j(p) {
|
|
2526
2527
|
return D(p) === _;
|
|
2527
2528
|
}
|
|
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 =
|
|
2529
|
+
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 = S, 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
2530
|
}()), w;
|
|
2530
2531
|
}
|
|
2531
|
-
var
|
|
2532
|
-
function
|
|
2533
|
-
return
|
|
2532
|
+
var Nt;
|
|
2533
|
+
function Qt() {
|
|
2534
|
+
return Nt || (Nt = 1, process.env.NODE_ENV === "production" ? at.exports = Ee() : at.exports = ye()), at.exports;
|
|
2534
2535
|
}
|
|
2535
2536
|
/*
|
|
2536
2537
|
object-assign
|
|
2537
2538
|
(c) Sindre Sorhus
|
|
2538
2539
|
@license MIT
|
|
2539
2540
|
*/
|
|
2540
|
-
var At,
|
|
2541
|
-
function
|
|
2542
|
-
if (
|
|
2543
|
-
|
|
2541
|
+
var At, jt;
|
|
2542
|
+
function Ce() {
|
|
2543
|
+
if (jt) return At;
|
|
2544
|
+
jt = 1;
|
|
2544
2545
|
var a = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, e = Object.prototype.propertyIsEnumerable;
|
|
2545
|
-
function s(
|
|
2546
|
-
if (
|
|
2546
|
+
function s(r) {
|
|
2547
|
+
if (r == null)
|
|
2547
2548
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
2548
|
-
return Object(
|
|
2549
|
+
return Object(r);
|
|
2549
2550
|
}
|
|
2550
|
-
function
|
|
2551
|
+
function i() {
|
|
2551
2552
|
try {
|
|
2552
2553
|
if (!Object.assign)
|
|
2553
2554
|
return !1;
|
|
2554
|
-
var
|
|
2555
|
-
if (
|
|
2555
|
+
var r = new String("abc");
|
|
2556
|
+
if (r[5] = "de", Object.getOwnPropertyNames(r)[0] === "5")
|
|
2556
2557
|
return !1;
|
|
2557
2558
|
for (var n = {}, u = 0; u < 10; u++)
|
|
2558
2559
|
n["_" + String.fromCharCode(u)] = u;
|
|
@@ -2569,41 +2570,41 @@ function Ae() {
|
|
|
2569
2570
|
return !1;
|
|
2570
2571
|
}
|
|
2571
2572
|
}
|
|
2572
|
-
return At =
|
|
2573
|
-
for (var u, l = s(
|
|
2573
|
+
return At = i() ? Object.assign : function(r, n) {
|
|
2574
|
+
for (var u, l = s(r), h, v = 1; v < arguments.length; v++) {
|
|
2574
2575
|
u = Object(arguments[v]);
|
|
2575
2576
|
for (var _ in u)
|
|
2576
2577
|
t.call(u, _) && (l[_] = u[_]);
|
|
2577
2578
|
if (a) {
|
|
2578
2579
|
h = a(u);
|
|
2579
|
-
for (var
|
|
2580
|
-
e.call(u, h[
|
|
2580
|
+
for (var F = 0; F < h.length; F++)
|
|
2581
|
+
e.call(u, h[F]) && (l[h[F]] = u[h[F]]);
|
|
2581
2582
|
}
|
|
2582
2583
|
}
|
|
2583
2584
|
return l;
|
|
2584
2585
|
}, At;
|
|
2585
2586
|
}
|
|
2586
|
-
var bt,
|
|
2587
|
-
function
|
|
2588
|
-
if (
|
|
2589
|
-
|
|
2587
|
+
var bt, Ut;
|
|
2588
|
+
function Mt() {
|
|
2589
|
+
if (Ut) return bt;
|
|
2590
|
+
Ut = 1;
|
|
2590
2591
|
var a = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
2591
2592
|
return bt = a, bt;
|
|
2592
2593
|
}
|
|
2593
|
-
var
|
|
2594
|
-
function
|
|
2595
|
-
return
|
|
2594
|
+
var Ft, qt;
|
|
2595
|
+
function te() {
|
|
2596
|
+
return qt || (qt = 1, Ft = Function.call.bind(Object.prototype.hasOwnProperty)), Ft;
|
|
2596
2597
|
}
|
|
2597
|
-
var
|
|
2598
|
-
function
|
|
2599
|
-
if (
|
|
2600
|
-
|
|
2598
|
+
var St, $t;
|
|
2599
|
+
function Ae() {
|
|
2600
|
+
if ($t) return St;
|
|
2601
|
+
$t = 1;
|
|
2601
2602
|
var a = function() {
|
|
2602
2603
|
};
|
|
2603
2604
|
if (process.env.NODE_ENV !== "production") {
|
|
2604
|
-
var t = /* @__PURE__ */
|
|
2605
|
-
a = function(
|
|
2606
|
-
var n = "Warning: " +
|
|
2605
|
+
var t = /* @__PURE__ */ Mt(), e = {}, s = /* @__PURE__ */ te();
|
|
2606
|
+
a = function(r) {
|
|
2607
|
+
var n = "Warning: " + r;
|
|
2607
2608
|
typeof console < "u" && console.error(n);
|
|
2608
2609
|
try {
|
|
2609
2610
|
throw new Error(n);
|
|
@@ -2611,19 +2612,19 @@ function be() {
|
|
|
2611
2612
|
}
|
|
2612
2613
|
};
|
|
2613
2614
|
}
|
|
2614
|
-
function r
|
|
2615
|
+
function i(r, n, u, l, h) {
|
|
2615
2616
|
if (process.env.NODE_ENV !== "production") {
|
|
2616
|
-
for (var v in
|
|
2617
|
-
if (s(
|
|
2617
|
+
for (var v in r)
|
|
2618
|
+
if (s(r, v)) {
|
|
2618
2619
|
var _;
|
|
2619
2620
|
try {
|
|
2620
|
-
if (typeof
|
|
2621
|
-
var
|
|
2622
|
-
(l || "React class") + ": " + u + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof
|
|
2621
|
+
if (typeof r[v] != "function") {
|
|
2622
|
+
var F = Error(
|
|
2623
|
+
(l || "React class") + ": " + u + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
2623
2624
|
);
|
|
2624
|
-
throw
|
|
2625
|
+
throw F.name = "Invariant Violation", F;
|
|
2625
2626
|
}
|
|
2626
|
-
_ =
|
|
2627
|
+
_ = r[v](n, v, l, u, null, t);
|
|
2627
2628
|
} catch (N) {
|
|
2628
2629
|
_ = N;
|
|
2629
2630
|
}
|
|
@@ -2639,17 +2640,17 @@ function be() {
|
|
|
2639
2640
|
}
|
|
2640
2641
|
}
|
|
2641
2642
|
}
|
|
2642
|
-
return
|
|
2643
|
+
return i.resetWarningCache = function() {
|
|
2643
2644
|
process.env.NODE_ENV !== "production" && (e = {});
|
|
2644
|
-
},
|
|
2645
|
+
}, St = i, St;
|
|
2645
2646
|
}
|
|
2646
|
-
var xt,
|
|
2647
|
-
function
|
|
2648
|
-
if (
|
|
2649
|
-
|
|
2650
|
-
var a =
|
|
2647
|
+
var xt, Yt;
|
|
2648
|
+
function be() {
|
|
2649
|
+
if (Yt) return xt;
|
|
2650
|
+
Yt = 1;
|
|
2651
|
+
var a = Qt(), t = Ce(), e = /* @__PURE__ */ Mt(), s = /* @__PURE__ */ te(), i = /* @__PURE__ */ Ae(), r = function() {
|
|
2651
2652
|
};
|
|
2652
|
-
process.env.NODE_ENV !== "production" && (
|
|
2653
|
+
process.env.NODE_ENV !== "production" && (r = function(u) {
|
|
2653
2654
|
var l = "Warning: " + u;
|
|
2654
2655
|
typeof console < "u" && console.error(l);
|
|
2655
2656
|
try {
|
|
@@ -2667,7 +2668,7 @@ function Se() {
|
|
|
2667
2668
|
if (typeof d == "function")
|
|
2668
2669
|
return d;
|
|
2669
2670
|
}
|
|
2670
|
-
var
|
|
2671
|
+
var F = "<<anonymous>>", B = {
|
|
2671
2672
|
array: q("array"),
|
|
2672
2673
|
bigint: q("bigint"),
|
|
2673
2674
|
bool: q("boolean"),
|
|
@@ -2698,8 +2699,8 @@ function Se() {
|
|
|
2698
2699
|
function O(o) {
|
|
2699
2700
|
if (process.env.NODE_ENV !== "production")
|
|
2700
2701
|
var d = {}, b = 0;
|
|
2701
|
-
function C(
|
|
2702
|
-
if (x = x ||
|
|
2702
|
+
function C(S, y, A, x, R, T, j) {
|
|
2703
|
+
if (x = x || F, T = T || A, j !== e) {
|
|
2703
2704
|
if (l) {
|
|
2704
2705
|
var p = new Error(
|
|
2705
2706
|
"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"
|
|
@@ -2708,23 +2709,23 @@ function Se() {
|
|
|
2708
2709
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
2709
2710
|
var Y = x + ":" + A;
|
|
2710
2711
|
!d[Y] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
2711
|
-
b < 3 && (
|
|
2712
|
+
b < 3 && (r(
|
|
2712
2713
|
"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
2714
|
), d[Y] = !0, b++);
|
|
2714
2715
|
}
|
|
2715
2716
|
}
|
|
2716
|
-
return y[A] == null ?
|
|
2717
|
+
return y[A] == null ? S ? 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
|
}
|
|
2718
2719
|
var k = C.bind(null, !1);
|
|
2719
2720
|
return k.isRequired = C.bind(null, !0), k;
|
|
2720
2721
|
}
|
|
2721
2722
|
function q(o) {
|
|
2722
|
-
function d(b, C, k,
|
|
2723
|
+
function d(b, C, k, S, y, A) {
|
|
2723
2724
|
var x = b[C], R = $(x);
|
|
2724
2725
|
if (R !== o) {
|
|
2725
2726
|
var T = Z(x);
|
|
2726
2727
|
return new M(
|
|
2727
|
-
"Invalid " +
|
|
2728
|
+
"Invalid " + S + " `" + y + "` of type " + ("`" + T + "` supplied to `" + k + "`, expected ") + ("`" + o + "`."),
|
|
2728
2729
|
{ expectedType: o }
|
|
2729
2730
|
);
|
|
2730
2731
|
}
|
|
@@ -2736,16 +2737,16 @@ function Se() {
|
|
|
2736
2737
|
return O(n);
|
|
2737
2738
|
}
|
|
2738
2739
|
function V(o) {
|
|
2739
|
-
function d(b, C, k,
|
|
2740
|
+
function d(b, C, k, S, y) {
|
|
2740
2741
|
if (typeof o != "function")
|
|
2741
2742
|
return new M("Property `" + y + "` of component `" + k + "` has invalid PropType notation inside arrayOf.");
|
|
2742
2743
|
var A = b[C];
|
|
2743
2744
|
if (!Array.isArray(A)) {
|
|
2744
2745
|
var x = $(A);
|
|
2745
|
-
return new M("Invalid " +
|
|
2746
|
+
return new M("Invalid " + S + " `" + y + "` of type " + ("`" + x + "` supplied to `" + k + "`, expected an array."));
|
|
2746
2747
|
}
|
|
2747
2748
|
for (var R = 0; R < A.length; R++) {
|
|
2748
|
-
var T = o(A, R, k,
|
|
2749
|
+
var T = o(A, R, k, S, y + "[" + R + "]", e);
|
|
2749
2750
|
if (T instanceof Error)
|
|
2750
2751
|
return T;
|
|
2751
2752
|
}
|
|
@@ -2754,32 +2755,32 @@ function Se() {
|
|
|
2754
2755
|
return O(d);
|
|
2755
2756
|
}
|
|
2756
2757
|
function D() {
|
|
2757
|
-
function o(d, b, C, k,
|
|
2758
|
+
function o(d, b, C, k, S) {
|
|
2758
2759
|
var y = d[b];
|
|
2759
2760
|
if (!u(y)) {
|
|
2760
2761
|
var A = $(y);
|
|
2761
|
-
return new M("Invalid " + k + " `" +
|
|
2762
|
+
return new M("Invalid " + k + " `" + S + "` of type " + ("`" + A + "` supplied to `" + C + "`, expected a single ReactElement."));
|
|
2762
2763
|
}
|
|
2763
2764
|
return null;
|
|
2764
2765
|
}
|
|
2765
2766
|
return O(o);
|
|
2766
2767
|
}
|
|
2767
2768
|
function c() {
|
|
2768
|
-
function o(d, b, C, k,
|
|
2769
|
+
function o(d, b, C, k, S) {
|
|
2769
2770
|
var y = d[b];
|
|
2770
2771
|
if (!a.isValidElementType(y)) {
|
|
2771
2772
|
var A = $(y);
|
|
2772
|
-
return new M("Invalid " + k + " `" +
|
|
2773
|
+
return new M("Invalid " + k + " `" + S + "` of type " + ("`" + A + "` supplied to `" + C + "`, expected a single ReactElement type."));
|
|
2773
2774
|
}
|
|
2774
2775
|
return null;
|
|
2775
2776
|
}
|
|
2776
2777
|
return O(o);
|
|
2777
2778
|
}
|
|
2778
2779
|
function W(o) {
|
|
2779
|
-
function d(b, C, k,
|
|
2780
|
+
function d(b, C, k, S, y) {
|
|
2780
2781
|
if (!(b[C] instanceof o)) {
|
|
2781
|
-
var A = o.name ||
|
|
2782
|
-
return new M("Invalid " +
|
|
2782
|
+
var A = o.name || F, x = yt(b[C]);
|
|
2783
|
+
return new M("Invalid " + S + " `" + y + "` of type " + ("`" + x + "` supplied to `" + k + "`, expected ") + ("instance of `" + A + "`."));
|
|
2783
2784
|
}
|
|
2784
2785
|
return null;
|
|
2785
2786
|
}
|
|
@@ -2787,10 +2788,10 @@ function Se() {
|
|
|
2787
2788
|
}
|
|
2788
2789
|
function ft(o) {
|
|
2789
2790
|
if (!Array.isArray(o))
|
|
2790
|
-
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ?
|
|
2791
|
+
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? r(
|
|
2791
2792
|
"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
|
-
) :
|
|
2793
|
-
function d(b, C, k,
|
|
2793
|
+
) : r("Invalid argument supplied to oneOf, expected an array.")), n;
|
|
2794
|
+
function d(b, C, k, S, y) {
|
|
2794
2795
|
for (var A = b[C], x = 0; x < o.length; x++)
|
|
2795
2796
|
if (N(A, o[x]))
|
|
2796
2797
|
return null;
|
|
@@ -2798,20 +2799,20 @@ function Se() {
|
|
|
2798
2799
|
var Y = Z(p);
|
|
2799
2800
|
return Y === "symbol" ? String(p) : p;
|
|
2800
2801
|
});
|
|
2801
|
-
return new M("Invalid " +
|
|
2802
|
+
return new M("Invalid " + S + " `" + y + "` of value `" + String(A) + "` " + ("supplied to `" + k + "`, expected one of " + R + "."));
|
|
2802
2803
|
}
|
|
2803
2804
|
return O(d);
|
|
2804
2805
|
}
|
|
2805
2806
|
function mt(o) {
|
|
2806
|
-
function d(b, C, k,
|
|
2807
|
+
function d(b, C, k, S, y) {
|
|
2807
2808
|
if (typeof o != "function")
|
|
2808
2809
|
return new M("Property `" + y + "` of component `" + k + "` has invalid PropType notation inside objectOf.");
|
|
2809
2810
|
var A = b[C], x = $(A);
|
|
2810
2811
|
if (x !== "object")
|
|
2811
|
-
return new M("Invalid " +
|
|
2812
|
+
return new M("Invalid " + S + " `" + y + "` of type " + ("`" + x + "` supplied to `" + k + "`, expected an object."));
|
|
2812
2813
|
for (var R in A)
|
|
2813
2814
|
if (s(A, R)) {
|
|
2814
|
-
var T = o(A, R, k,
|
|
2815
|
+
var T = o(A, R, k, S, y + "." + R, e);
|
|
2815
2816
|
if (T instanceof Error)
|
|
2816
2817
|
return T;
|
|
2817
2818
|
}
|
|
@@ -2821,17 +2822,17 @@ function Se() {
|
|
|
2821
2822
|
}
|
|
2822
2823
|
function vt(o) {
|
|
2823
2824
|
if (!Array.isArray(o))
|
|
2824
|
-
return process.env.NODE_ENV !== "production" &&
|
|
2825
|
+
return process.env.NODE_ENV !== "production" && r("Invalid argument supplied to oneOfType, expected an instance of array."), n;
|
|
2825
2826
|
for (var d = 0; d < o.length; d++) {
|
|
2826
2827
|
var b = o[d];
|
|
2827
2828
|
if (typeof b != "function")
|
|
2828
|
-
return
|
|
2829
|
+
return r(
|
|
2829
2830
|
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + it(b) + " at index " + d + "."
|
|
2830
2831
|
), n;
|
|
2831
2832
|
}
|
|
2832
|
-
function C(k,
|
|
2833
|
+
function C(k, S, y, A, x) {
|
|
2833
2834
|
for (var R = [], T = 0; T < o.length; T++) {
|
|
2834
|
-
var j = o[T], p = j(k,
|
|
2835
|
+
var j = o[T], p = j(k, S, y, A, x, e);
|
|
2835
2836
|
if (p == null)
|
|
2836
2837
|
return null;
|
|
2837
2838
|
p.data && s(p.data, "expectedType") && R.push(p.data.expectedType);
|
|
@@ -2842,8 +2843,8 @@ function Se() {
|
|
|
2842
2843
|
return O(C);
|
|
2843
2844
|
}
|
|
2844
2845
|
function gt() {
|
|
2845
|
-
function o(d, b, C, k,
|
|
2846
|
-
return Q(d[b]) ? null : new M("Invalid " + k + " `" +
|
|
2846
|
+
function o(d, b, C, k, S) {
|
|
2847
|
+
return Q(d[b]) ? null : new M("Invalid " + k + " `" + S + "` supplied to " + ("`" + C + "`, expected a ReactNode."));
|
|
2847
2848
|
}
|
|
2848
2849
|
return O(o);
|
|
2849
2850
|
}
|
|
@@ -2853,15 +2854,15 @@ function Se() {
|
|
|
2853
2854
|
);
|
|
2854
2855
|
}
|
|
2855
2856
|
function _t(o) {
|
|
2856
|
-
function d(b, C, k,
|
|
2857
|
+
function d(b, C, k, S, y) {
|
|
2857
2858
|
var A = b[C], x = $(A);
|
|
2858
2859
|
if (x !== "object")
|
|
2859
|
-
return new M("Invalid " +
|
|
2860
|
+
return new M("Invalid " + S + " `" + y + "` of type `" + x + "` " + ("supplied to `" + k + "`, expected `object`."));
|
|
2860
2861
|
for (var R in o) {
|
|
2861
2862
|
var T = o[R];
|
|
2862
2863
|
if (typeof T != "function")
|
|
2863
|
-
return st(k,
|
|
2864
|
-
var j = T(A, R, k,
|
|
2864
|
+
return st(k, S, y, R, Z(T));
|
|
2865
|
+
var j = T(A, R, k, S, y + "." + R, e);
|
|
2865
2866
|
if (j)
|
|
2866
2867
|
return j;
|
|
2867
2868
|
}
|
|
@@ -2870,21 +2871,21 @@ function Se() {
|
|
|
2870
2871
|
return O(d);
|
|
2871
2872
|
}
|
|
2872
2873
|
function kt(o) {
|
|
2873
|
-
function d(b, C, k,
|
|
2874
|
+
function d(b, C, k, S, y) {
|
|
2874
2875
|
var A = b[C], x = $(A);
|
|
2875
2876
|
if (x !== "object")
|
|
2876
|
-
return new M("Invalid " +
|
|
2877
|
+
return new M("Invalid " + S + " `" + y + "` of type `" + x + "` " + ("supplied to `" + k + "`, expected `object`."));
|
|
2877
2878
|
var R = t({}, b[C], o);
|
|
2878
2879
|
for (var T in R) {
|
|
2879
2880
|
var j = o[T];
|
|
2880
2881
|
if (s(o, T) && typeof j != "function")
|
|
2881
|
-
return st(k,
|
|
2882
|
+
return st(k, S, y, T, Z(j));
|
|
2882
2883
|
if (!j)
|
|
2883
2884
|
return new M(
|
|
2884
|
-
"Invalid " +
|
|
2885
|
+
"Invalid " + S + " `" + y + "` key `" + T + "` supplied to `" + k + "`.\nBad object: " + JSON.stringify(b[C], null, " ") + `
|
|
2885
2886
|
Valid keys: ` + JSON.stringify(Object.keys(o), null, " ")
|
|
2886
2887
|
);
|
|
2887
|
-
var p = j(A, T, k,
|
|
2888
|
+
var p = j(A, T, k, S, y + "." + T, e);
|
|
2888
2889
|
if (p)
|
|
2889
2890
|
return p;
|
|
2890
2891
|
}
|
|
@@ -2959,16 +2960,16 @@ Valid keys: ` + JSON.stringify(Object.keys(o), null, " ")
|
|
|
2959
2960
|
}
|
|
2960
2961
|
}
|
|
2961
2962
|
function yt(o) {
|
|
2962
|
-
return !o.constructor || !o.constructor.name ?
|
|
2963
|
+
return !o.constructor || !o.constructor.name ? F : o.constructor.name;
|
|
2963
2964
|
}
|
|
2964
|
-
return B.checkPropTypes =
|
|
2965
|
+
return B.checkPropTypes = i, B.resetWarningCache = i.resetWarningCache, B.PropTypes = B, B;
|
|
2965
2966
|
}, xt;
|
|
2966
2967
|
}
|
|
2967
|
-
var Tt,
|
|
2968
|
+
var Tt, Ht;
|
|
2968
2969
|
function Fe() {
|
|
2969
|
-
if (
|
|
2970
|
-
|
|
2971
|
-
var a = /* @__PURE__ */
|
|
2970
|
+
if (Ht) return Tt;
|
|
2971
|
+
Ht = 1;
|
|
2972
|
+
var a = /* @__PURE__ */ Mt();
|
|
2972
2973
|
function t() {
|
|
2973
2974
|
}
|
|
2974
2975
|
function e() {
|
|
@@ -2976,17 +2977,17 @@ function Fe() {
|
|
|
2976
2977
|
return e.resetWarningCache = t, Tt = function() {
|
|
2977
2978
|
function s(n, u, l, h, v, _) {
|
|
2978
2979
|
if (_ !== a) {
|
|
2979
|
-
var
|
|
2980
|
+
var F = new Error(
|
|
2980
2981
|
"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
|
);
|
|
2982
|
-
throw
|
|
2983
|
+
throw F.name = "Invariant Violation", F;
|
|
2983
2984
|
}
|
|
2984
2985
|
}
|
|
2985
2986
|
s.isRequired = s;
|
|
2986
|
-
function
|
|
2987
|
+
function i() {
|
|
2987
2988
|
return s;
|
|
2988
2989
|
}
|
|
2989
|
-
var
|
|
2990
|
+
var r = {
|
|
2990
2991
|
array: s,
|
|
2991
2992
|
bigint: s,
|
|
2992
2993
|
bool: s,
|
|
@@ -2996,34 +2997,34 @@ function Fe() {
|
|
|
2996
2997
|
string: s,
|
|
2997
2998
|
symbol: s,
|
|
2998
2999
|
any: s,
|
|
2999
|
-
arrayOf:
|
|
3000
|
+
arrayOf: i,
|
|
3000
3001
|
element: s,
|
|
3001
3002
|
elementType: s,
|
|
3002
|
-
instanceOf:
|
|
3003
|
+
instanceOf: i,
|
|
3003
3004
|
node: s,
|
|
3004
|
-
objectOf:
|
|
3005
|
-
oneOf:
|
|
3006
|
-
oneOfType:
|
|
3007
|
-
shape:
|
|
3008
|
-
exact:
|
|
3005
|
+
objectOf: i,
|
|
3006
|
+
oneOf: i,
|
|
3007
|
+
oneOfType: i,
|
|
3008
|
+
shape: i,
|
|
3009
|
+
exact: i,
|
|
3009
3010
|
checkPropTypes: e,
|
|
3010
3011
|
resetWarningCache: t
|
|
3011
3012
|
};
|
|
3012
|
-
return
|
|
3013
|
+
return r.PropTypes = r, r;
|
|
3013
3014
|
}, Tt;
|
|
3014
3015
|
}
|
|
3015
|
-
var
|
|
3016
|
-
function
|
|
3017
|
-
if (
|
|
3018
|
-
if (
|
|
3019
|
-
var a =
|
|
3020
|
-
nt.exports = /* @__PURE__ */
|
|
3016
|
+
var zt;
|
|
3017
|
+
function Se() {
|
|
3018
|
+
if (zt) return nt.exports;
|
|
3019
|
+
if (zt = 1, process.env.NODE_ENV !== "production") {
|
|
3020
|
+
var a = Qt(), t = !0;
|
|
3021
|
+
nt.exports = /* @__PURE__ */ be()(a.isElement, t);
|
|
3021
3022
|
} else
|
|
3022
3023
|
nt.exports = /* @__PURE__ */ Fe()();
|
|
3023
3024
|
return nt.exports;
|
|
3024
3025
|
}
|
|
3025
|
-
var
|
|
3026
|
-
const f = /* @__PURE__ */
|
|
3026
|
+
var xe = /* @__PURE__ */ Se();
|
|
3027
|
+
const f = /* @__PURE__ */ ke(xe), ee = {
|
|
3027
3028
|
// common
|
|
3028
3029
|
mask: f.oneOfType([f.array, f.func, f.string, f.instanceOf(RegExp), f.oneOf([Date, Number, g.Masked]), f.instanceOf(g.Masked)]),
|
|
3029
3030
|
value: f.any,
|
|
@@ -3070,64 +3071,64 @@ const f = /* @__PURE__ */ ee(Te), re = {
|
|
|
3070
3071
|
inputRef: f.oneOfType([f.func, f.shape({
|
|
3071
3072
|
current: f.object
|
|
3072
3073
|
})])
|
|
3073
|
-
},
|
|
3074
|
-
function
|
|
3074
|
+
}, se = Object.keys(ee).filter((a) => a !== "value"), Te = ["value", "unmask", "onAccept", "onComplete", "inputRef"], Ie = se.filter((a) => Te.indexOf(a) < 0);
|
|
3075
|
+
function we(a) {
|
|
3075
3076
|
var t;
|
|
3076
3077
|
const e = (t = class extends X.Component {
|
|
3077
|
-
constructor(
|
|
3078
|
-
super(
|
|
3078
|
+
constructor(r) {
|
|
3079
|
+
super(r), this._inputRef = this._inputRef.bind(this);
|
|
3079
3080
|
}
|
|
3080
3081
|
componentDidMount() {
|
|
3081
3082
|
this.props.mask && this.initMask();
|
|
3082
3083
|
}
|
|
3083
3084
|
componentDidUpdate() {
|
|
3084
|
-
const
|
|
3085
|
+
const r = this.props, n = this._extractMaskOptionsFromProps(r);
|
|
3085
3086
|
if (n.mask)
|
|
3086
|
-
this.maskRef ? (this.maskRef.updateOptions(n), "value" in
|
|
3087
|
-
else if (this.destroyMask(), "value" in
|
|
3087
|
+
this.maskRef ? (this.maskRef.updateOptions(n), "value" in r && r.value !== void 0 && (this.maskValue = r.value)) : this.initMask(n);
|
|
3088
|
+
else if (this.destroyMask(), "value" in r && r.value !== void 0) {
|
|
3088
3089
|
var u;
|
|
3089
|
-
(u = this.element) != null && u.isContentEditable && this.element.tagName !== "INPUT" && this.element.tagName !== "TEXTAREA" ? this.element.textContent =
|
|
3090
|
+
(u = this.element) != null && u.isContentEditable && this.element.tagName !== "INPUT" && this.element.tagName !== "TEXTAREA" ? this.element.textContent = r.value : this.element.value = r.value;
|
|
3090
3091
|
}
|
|
3091
3092
|
}
|
|
3092
3093
|
componentWillUnmount() {
|
|
3093
3094
|
this.destroyMask();
|
|
3094
3095
|
}
|
|
3095
|
-
_inputRef(
|
|
3096
|
-
this.element =
|
|
3096
|
+
_inputRef(r) {
|
|
3097
|
+
this.element = r, this.props.inputRef && (Object.prototype.hasOwnProperty.call(this.props.inputRef, "current") ? this.props.inputRef.current = r : this.props.inputRef(r));
|
|
3097
3098
|
}
|
|
3098
|
-
initMask(
|
|
3099
|
-
|
|
3099
|
+
initMask(r) {
|
|
3100
|
+
r === void 0 && (r = this._extractMaskOptionsFromProps(this.props)), this.maskRef = g(this.element, r).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
|
}
|
|
3101
3102
|
destroyMask() {
|
|
3102
3103
|
this.maskRef && (this.maskRef.destroy(), delete this.maskRef);
|
|
3103
3104
|
}
|
|
3104
|
-
_extractMaskOptionsFromProps(
|
|
3105
|
+
_extractMaskOptionsFromProps(r) {
|
|
3105
3106
|
const {
|
|
3106
3107
|
...n
|
|
3107
|
-
} =
|
|
3108
|
-
return Object.keys(n).filter((u) =>
|
|
3108
|
+
} = r;
|
|
3109
|
+
return Object.keys(n).filter((u) => Ie.indexOf(u) < 0).forEach((u) => {
|
|
3109
3110
|
delete n[u];
|
|
3110
3111
|
}), n;
|
|
3111
3112
|
}
|
|
3112
|
-
_extractNonMaskProps(
|
|
3113
|
+
_extractNonMaskProps(r) {
|
|
3113
3114
|
const {
|
|
3114
3115
|
...n
|
|
3115
|
-
} =
|
|
3116
|
-
return
|
|
3116
|
+
} = r;
|
|
3117
|
+
return se.forEach((u) => {
|
|
3117
3118
|
u !== "maxLength" && delete n[u];
|
|
3118
|
-
}), "defaultValue" in n || (n.defaultValue =
|
|
3119
|
+
}), "defaultValue" in n || (n.defaultValue = r.mask ? "" : n.value), delete n.value, n;
|
|
3119
3120
|
}
|
|
3120
3121
|
get maskValue() {
|
|
3121
3122
|
return this.maskRef ? this.props.unmask === "typed" ? this.maskRef.typedValue : this.props.unmask ? this.maskRef.unmaskedValue : this.maskRef.value : "";
|
|
3122
3123
|
}
|
|
3123
|
-
set maskValue(
|
|
3124
|
-
this.maskRef && (
|
|
3124
|
+
set maskValue(r) {
|
|
3125
|
+
this.maskRef && (r = r == null && this.props.unmask !== "typed" ? "" : r, this.props.unmask === "typed" ? this.maskRef.typedValue = r : this.props.unmask ? this.maskRef.unmaskedValue = r : this.maskRef.value = r);
|
|
3125
3126
|
}
|
|
3126
|
-
_onAccept(
|
|
3127
|
-
this.props.onAccept && this.maskRef && this.props.onAccept(this.maskValue, this.maskRef,
|
|
3127
|
+
_onAccept(r) {
|
|
3128
|
+
this.props.onAccept && this.maskRef && this.props.onAccept(this.maskValue, this.maskRef, r);
|
|
3128
3129
|
}
|
|
3129
|
-
_onComplete(
|
|
3130
|
-
this.props.onComplete && this.maskRef && this.props.onComplete(this.maskValue, this.maskRef,
|
|
3130
|
+
_onComplete(r) {
|
|
3131
|
+
this.props.onComplete && this.maskRef && this.props.onComplete(this.maskValue, this.maskRef, r);
|
|
3131
3132
|
}
|
|
3132
3133
|
render() {
|
|
3133
3134
|
return X.createElement(a, {
|
|
@@ -3136,12 +3137,12 @@ function Re(a) {
|
|
|
3136
3137
|
});
|
|
3137
3138
|
}
|
|
3138
3139
|
}, t.displayName = void 0, t.propTypes = void 0, t), s = a.displayName || a.name || "Component";
|
|
3139
|
-
return e.displayName = "IMask(" + s + ")", e.propTypes =
|
|
3140
|
-
...
|
|
3141
|
-
ref:
|
|
3140
|
+
return e.displayName = "IMask(" + s + ")", e.propTypes = ee, X.forwardRef((i, r) => X.createElement(e, {
|
|
3141
|
+
...i,
|
|
3142
|
+
ref: r
|
|
3142
3143
|
}));
|
|
3143
3144
|
}
|
|
3144
|
-
const
|
|
3145
|
+
const Re = we((a) => {
|
|
3145
3146
|
let {
|
|
3146
3147
|
inputRef: t,
|
|
3147
3148
|
...e
|
|
@@ -3150,74 +3151,33 @@ const Me = Re((a) => {
|
|
|
3150
3151
|
...e,
|
|
3151
3152
|
ref: t
|
|
3152
3153
|
});
|
|
3153
|
-
}),
|
|
3154
|
+
}), Me = (a, t) => X.createElement(Re, {
|
|
3154
3155
|
...a,
|
|
3155
3156
|
ref: t
|
|
3156
|
-
}),
|
|
3157
|
-
input:
|
|
3158
|
-
section:
|
|
3159
|
-
},
|
|
3157
|
+
}), Be = X.forwardRef(Me), Oe = "_input_1uqnk_1", De = "_section_1uqnk_7", ie = {
|
|
3158
|
+
input: Oe,
|
|
3159
|
+
section: De
|
|
3160
|
+
}, Ve = (a) => /* @__PURE__ */ Ot.createElement("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...a }, /* @__PURE__ */ Ot.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
3161
|
fill: "#0D1126",
|
|
3161
3162
|
fill: "color(display-p3 0.0510 0.0667 0.1490)",
|
|
3162
3163
|
fillOpacity: 0.4
|
|
3163
|
-
} }))
|
|
3164
|
-
|
|
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,
|
|
3164
|
+
} })), Pe = ue(ie.input, ne["caption-l-regular"]), Le = re.withProps({
|
|
3165
|
+
leftSection: /* @__PURE__ */ It(Ve, {}),
|
|
3166
|
+
component: Be,
|
|
3207
3167
|
mask: "0000 0000 0000 0000",
|
|
3208
3168
|
placeholder: "____ ____ ____ ____",
|
|
3209
|
-
classNames: { input:
|
|
3210
|
-
}),
|
|
3211
|
-
const t =
|
|
3212
|
-
return /* @__PURE__ */
|
|
3213
|
-
|
|
3169
|
+
classNames: { input: Pe, section: ie.section }
|
|
3170
|
+
}), ze = (a) => {
|
|
3171
|
+
const t = ae(a.value);
|
|
3172
|
+
return /* @__PURE__ */ It(
|
|
3173
|
+
Le,
|
|
3214
3174
|
{
|
|
3215
3175
|
...a,
|
|
3216
|
-
rightSection: t && /* @__PURE__ */
|
|
3176
|
+
rightSection: t && /* @__PURE__ */ It(t, {})
|
|
3217
3177
|
}
|
|
3218
3178
|
);
|
|
3219
3179
|
};
|
|
3220
3180
|
export {
|
|
3221
|
-
|
|
3222
|
-
|
|
3181
|
+
ze as CardInput,
|
|
3182
|
+
Le as CardInputBase
|
|
3223
3183
|
};
|