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