@scbt-ecom/ui 0.24.0 → 0.25.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/dist/{CustomLink-BuvHLRaW.js → CustomLink-CKaoTS8A.js} +3 -18
- package/dist/{CustomLink-BuvHLRaW.js.map → CustomLink-CKaoTS8A.js.map} +1 -1
- package/dist/hooks.js +39 -105
- package/dist/hooks.js.map +1 -1
- package/dist/{parse-DTNzQgVi.js → parse-C_80L3wX.js} +262 -248
- package/dist/parse-C_80L3wX.js.map +1 -0
- package/dist/shared/ui/customLink/CustomLink.d.ts +1 -2
- package/dist/shared/ui/formElements/controlled/index.d.ts +1 -0
- package/dist/shared/ui/formElements/editorControl/model/config.d.ts +1 -1
- package/dist/shared/ui/formElements/editorControl/ui/commands/index.d.ts +1 -1
- package/dist/shared/ui/formElements/editorControl/ui/commands/setCustomLink.d.ts +6 -0
- package/dist/shared/ui/formElements/uncontrolled/index.d.ts +1 -0
- package/dist/shared/ui/formElements/uncontrolled/select/Select.d.ts +15 -0
- package/dist/shared/ui/formElements/uncontrolled/select/hooks/useSelectController.d.ts +3 -1
- package/dist/shared/validation/messages.d.ts +1 -0
- package/dist/ui.js +5720 -5685
- package/dist/ui.js.map +1 -1
- package/dist/useDebounce-DyvGYvL9.js +1169 -0
- package/dist/useDebounce-DyvGYvL9.js.map +1 -0
- package/dist/validation.js +26 -37
- package/dist/validation.js.map +1 -1
- package/dist/widget.js +1 -1
- package/package.json +1 -2
- package/dist/parse-DTNzQgVi.js.map +0 -1
- package/dist/shared/ui/formElements/editorControl/ui/commands/SetLink.d.ts +0 -6
- package/dist/useDebounce-DSBzpBLy.js +0 -1106
- package/dist/useDebounce-DSBzpBLy.js.map +0 -1
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (n, t, e) =>
|
|
1
|
+
var Nt = Object.defineProperty;
|
|
2
|
+
var Ct = (n, t, e) => t in n ? Nt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var h = (n, t, e) => Ct(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const Zs = {
|
|
5
|
+
REQUIRED: "Поле обязательно к заполнению",
|
|
6
|
+
MIN_LENGTH: "Минимальная длина символов должна быть не менее",
|
|
7
|
+
MAX_LENGTH: "Максимальная длина символов должна быть не более",
|
|
8
|
+
FIX_LENGTH: "Длина символов должна быть равна",
|
|
9
|
+
MAX_LENGTH_ELEMENTS: "Максимальное количество элементов должно быть не более",
|
|
10
|
+
MIN_LENGTH_ELEMENTS: "Минимальное количество элементов должно быть не менее",
|
|
11
|
+
FIX_LENGTH_ELEMENTS: "Количество элементов должно быть равно",
|
|
12
|
+
INVALID_VALUE: "Поле заполнено некорректно",
|
|
13
|
+
INVALID_DATE: "Введите корректную дату",
|
|
14
|
+
FUTURE_DATE_NOT_ALLOWED: "Нельзя выбрать дату позже текущей",
|
|
15
|
+
INVALID_URL: "Некорректная ссылка"
|
|
16
|
+
};
|
|
4
17
|
var w;
|
|
5
18
|
(function(n) {
|
|
6
19
|
n.assertEqual = (s) => s;
|
|
@@ -104,8 +117,8 @@ const f = w.arrayToEnum([
|
|
|
104
117
|
"invalid_intersection_types",
|
|
105
118
|
"not_multiple_of",
|
|
106
119
|
"not_finite"
|
|
107
|
-
]),
|
|
108
|
-
class
|
|
120
|
+
]), Dt = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
121
|
+
class Z extends Error {
|
|
109
122
|
get errors() {
|
|
110
123
|
return this.issues;
|
|
111
124
|
}
|
|
@@ -142,7 +155,7 @@ class A extends Error {
|
|
|
142
155
|
return s(this), r;
|
|
143
156
|
}
|
|
144
157
|
static assert(t) {
|
|
145
|
-
if (!(t instanceof
|
|
158
|
+
if (!(t instanceof Z))
|
|
146
159
|
throw new Error(`Not a ZodError: ${t}`);
|
|
147
160
|
}
|
|
148
161
|
toString() {
|
|
@@ -164,7 +177,7 @@ class A extends Error {
|
|
|
164
177
|
return this.flatten();
|
|
165
178
|
}
|
|
166
179
|
}
|
|
167
|
-
|
|
180
|
+
Z.create = (n) => new Z(n);
|
|
168
181
|
const ce = (n, t) => {
|
|
169
182
|
let e;
|
|
170
183
|
switch (n.code) {
|
|
@@ -222,13 +235,13 @@ const ce = (n, t) => {
|
|
|
222
235
|
return { message: e };
|
|
223
236
|
};
|
|
224
237
|
let dt = ce;
|
|
225
|
-
function
|
|
238
|
+
function It(n) {
|
|
226
239
|
dt = n;
|
|
227
240
|
}
|
|
228
|
-
function
|
|
241
|
+
function De() {
|
|
229
242
|
return dt;
|
|
230
243
|
}
|
|
231
|
-
const
|
|
244
|
+
const Ie = (n) => {
|
|
232
245
|
const { data: t, path: e, errorMaps: r, issueData: s } = n, a = [...e, ...s.path || []], i = {
|
|
233
246
|
...s,
|
|
234
247
|
path: a
|
|
@@ -248,9 +261,9 @@ const Ze = (n) => {
|
|
|
248
261
|
path: a,
|
|
249
262
|
message: o
|
|
250
263
|
};
|
|
251
|
-
},
|
|
264
|
+
}, At = [];
|
|
252
265
|
function l(n, t) {
|
|
253
|
-
const e =
|
|
266
|
+
const e = De(), r = Ie({
|
|
254
267
|
issueData: t,
|
|
255
268
|
data: n.data,
|
|
256
269
|
path: n.path,
|
|
@@ -267,7 +280,7 @@ function l(n, t) {
|
|
|
267
280
|
});
|
|
268
281
|
n.common.issues.push(r);
|
|
269
282
|
}
|
|
270
|
-
class
|
|
283
|
+
class D {
|
|
271
284
|
constructor() {
|
|
272
285
|
this.value = "valid";
|
|
273
286
|
}
|
|
@@ -295,7 +308,7 @@ class N {
|
|
|
295
308
|
value: i
|
|
296
309
|
});
|
|
297
310
|
}
|
|
298
|
-
return
|
|
311
|
+
return D.mergeObjectSync(t, r);
|
|
299
312
|
}
|
|
300
313
|
static mergeObjectSync(t, e) {
|
|
301
314
|
const r = {};
|
|
@@ -310,8 +323,8 @@ class N {
|
|
|
310
323
|
}
|
|
311
324
|
const g = Object.freeze({
|
|
312
325
|
status: "aborted"
|
|
313
|
-
}), ie = (n) => ({ status: "dirty", value: n }),
|
|
314
|
-
function
|
|
326
|
+
}), ie = (n) => ({ status: "dirty", value: n }), A = (n) => ({ status: "valid", value: n }), ze = (n) => n.status === "aborted", qe = (n) => n.status === "dirty", re = (n) => n.status === "valid", ye = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
327
|
+
function Ae(n, t, e, r) {
|
|
315
328
|
if (typeof t == "function" ? n !== t || !0 : !t.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
316
329
|
return t.get(n);
|
|
317
330
|
}
|
|
@@ -342,7 +355,7 @@ const st = (n, t) => {
|
|
|
342
355
|
get error() {
|
|
343
356
|
if (this._error)
|
|
344
357
|
return this._error;
|
|
345
|
-
const e = new
|
|
358
|
+
const e = new Z(n.common.issues);
|
|
346
359
|
return this._error = e, this._error;
|
|
347
360
|
}
|
|
348
361
|
};
|
|
@@ -378,7 +391,7 @@ class v {
|
|
|
378
391
|
}
|
|
379
392
|
_processInputParams(t) {
|
|
380
393
|
return {
|
|
381
|
-
status: new
|
|
394
|
+
status: new D(),
|
|
382
395
|
ctx: {
|
|
383
396
|
common: t.parent.common,
|
|
384
397
|
data: t.data,
|
|
@@ -489,7 +502,7 @@ class v {
|
|
|
489
502
|
return this._refinement((r, s) => t(r) ? !0 : (s.addIssue(typeof e == "function" ? e(r, s) : e), !1));
|
|
490
503
|
}
|
|
491
504
|
_refinement(t) {
|
|
492
|
-
return new
|
|
505
|
+
return new Y({
|
|
493
506
|
schema: this,
|
|
494
507
|
typeName: y.ZodEffects,
|
|
495
508
|
effect: { type: "refinement", refinement: t }
|
|
@@ -527,7 +540,7 @@ class v {
|
|
|
527
540
|
return be.create(this, t, this._def);
|
|
528
541
|
}
|
|
529
542
|
transform(t) {
|
|
530
|
-
return new
|
|
543
|
+
return new Y({
|
|
531
544
|
..._(this._def),
|
|
532
545
|
schema: this,
|
|
533
546
|
typeName: y.ZodEffects,
|
|
@@ -552,7 +565,7 @@ class v {
|
|
|
552
565
|
}
|
|
553
566
|
catch(t) {
|
|
554
567
|
const e = typeof t == "function" ? t : () => t;
|
|
555
|
-
return new
|
|
568
|
+
return new Ee({
|
|
556
569
|
..._(this._def),
|
|
557
570
|
innerType: this,
|
|
558
571
|
catchValue: e,
|
|
@@ -567,7 +580,7 @@ class v {
|
|
|
567
580
|
});
|
|
568
581
|
}
|
|
569
582
|
pipe(t) {
|
|
570
|
-
return
|
|
583
|
+
return Ne.create(this, t);
|
|
571
584
|
}
|
|
572
585
|
readonly() {
|
|
573
586
|
return Me.create(this);
|
|
@@ -579,8 +592,8 @@ class v {
|
|
|
579
592
|
return this.safeParse(null).success;
|
|
580
593
|
}
|
|
581
594
|
}
|
|
582
|
-
const
|
|
583
|
-
let
|
|
595
|
+
const Zt = /^c[^\s-]{8,}$/i, Rt = /^[0-9a-z]+$/, jt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Lt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Wt = /^[a-z0-9_-]{21}$/i, Yt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, St = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, $t = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Vt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
596
|
+
let $e;
|
|
584
597
|
const Ft = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, zt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, qt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Ht = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Bt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ut = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ft = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Qt = new RegExp(`^${ft}$`);
|
|
585
598
|
function ht(n) {
|
|
586
599
|
let t = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
@@ -598,7 +611,7 @@ function Gt(n, t) {
|
|
|
598
611
|
return !!((t === "v4" || !t) && Ft.test(n) || (t === "v6" || !t) && qt.test(n));
|
|
599
612
|
}
|
|
600
613
|
function Jt(n, t) {
|
|
601
|
-
if (!
|
|
614
|
+
if (!Yt.test(n))
|
|
602
615
|
return !1;
|
|
603
616
|
try {
|
|
604
617
|
const [e] = n.split("."), r = e.replace(/-/g, "+").replace(/_/g, "/").padEnd(e.length + (4 - e.length % 4) % 4, "="), s = JSON.parse(atob(r));
|
|
@@ -610,7 +623,7 @@ function Jt(n, t) {
|
|
|
610
623
|
function Kt(n, t) {
|
|
611
624
|
return !!((t === "v4" || !t) && zt.test(n) || (t === "v6" || !t) && Ht.test(n));
|
|
612
625
|
}
|
|
613
|
-
class
|
|
626
|
+
class L extends v {
|
|
614
627
|
_parse(t) {
|
|
615
628
|
if (this._def.coerce && (t.data = String(t.data)), this._getType(t) !== f.string) {
|
|
616
629
|
const a = this._getOrReturnCtx(t);
|
|
@@ -620,7 +633,7 @@ class Y extends v {
|
|
|
620
633
|
received: a.parsedType
|
|
621
634
|
}), g;
|
|
622
635
|
}
|
|
623
|
-
const r = new
|
|
636
|
+
const r = new D();
|
|
624
637
|
let s;
|
|
625
638
|
for (const a of this._def.checks)
|
|
626
639
|
if (a.kind === "min")
|
|
@@ -659,19 +672,19 @@ class Y extends v {
|
|
|
659
672
|
message: a.message
|
|
660
673
|
}), r.dirty());
|
|
661
674
|
} else if (a.kind === "email")
|
|
662
|
-
|
|
675
|
+
$t.test(t.data) || (s = this._getOrReturnCtx(t, s), l(s, {
|
|
663
676
|
validation: "email",
|
|
664
677
|
code: u.invalid_string,
|
|
665
678
|
message: a.message
|
|
666
679
|
}), r.dirty());
|
|
667
680
|
else if (a.kind === "emoji")
|
|
668
|
-
|
|
681
|
+
$e || ($e = new RegExp(Vt, "u")), $e.test(t.data) || (s = this._getOrReturnCtx(t, s), l(s, {
|
|
669
682
|
validation: "emoji",
|
|
670
683
|
code: u.invalid_string,
|
|
671
684
|
message: a.message
|
|
672
685
|
}), r.dirty());
|
|
673
686
|
else if (a.kind === "uuid")
|
|
674
|
-
|
|
687
|
+
Lt.test(t.data) || (s = this._getOrReturnCtx(t, s), l(s, {
|
|
675
688
|
validation: "uuid",
|
|
676
689
|
code: u.invalid_string,
|
|
677
690
|
message: a.message
|
|
@@ -683,7 +696,7 @@ class Y extends v {
|
|
|
683
696
|
message: a.message
|
|
684
697
|
}), r.dirty());
|
|
685
698
|
else if (a.kind === "cuid")
|
|
686
|
-
|
|
699
|
+
Zt.test(t.data) || (s = this._getOrReturnCtx(t, s), l(s, {
|
|
687
700
|
validation: "cuid",
|
|
688
701
|
code: u.invalid_string,
|
|
689
702
|
message: a.message
|
|
@@ -738,7 +751,7 @@ class Y extends v {
|
|
|
738
751
|
code: u.invalid_string,
|
|
739
752
|
validation: "time",
|
|
740
753
|
message: a.message
|
|
741
|
-
}), r.dirty()) : a.kind === "duration" ?
|
|
754
|
+
}), r.dirty()) : a.kind === "duration" ? St.test(t.data) || (s = this._getOrReturnCtx(t, s), l(s, {
|
|
742
755
|
validation: "duration",
|
|
743
756
|
code: u.invalid_string,
|
|
744
757
|
message: a.message
|
|
@@ -773,7 +786,7 @@ class Y extends v {
|
|
|
773
786
|
});
|
|
774
787
|
}
|
|
775
788
|
_addCheck(t) {
|
|
776
|
-
return new
|
|
789
|
+
return new L({
|
|
777
790
|
...this._def,
|
|
778
791
|
checks: [...this._def.checks, t]
|
|
779
792
|
});
|
|
@@ -910,19 +923,19 @@ class Y extends v {
|
|
|
910
923
|
return this.min(1, p.errToObj(t));
|
|
911
924
|
}
|
|
912
925
|
trim() {
|
|
913
|
-
return new
|
|
926
|
+
return new L({
|
|
914
927
|
...this._def,
|
|
915
928
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
916
929
|
});
|
|
917
930
|
}
|
|
918
931
|
toLowerCase() {
|
|
919
|
-
return new
|
|
932
|
+
return new L({
|
|
920
933
|
...this._def,
|
|
921
934
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
922
935
|
});
|
|
923
936
|
}
|
|
924
937
|
toUpperCase() {
|
|
925
|
-
return new
|
|
938
|
+
return new L({
|
|
926
939
|
...this._def,
|
|
927
940
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
928
941
|
});
|
|
@@ -988,9 +1001,9 @@ class Y extends v {
|
|
|
988
1001
|
return t;
|
|
989
1002
|
}
|
|
990
1003
|
}
|
|
991
|
-
|
|
1004
|
+
L.create = (n) => {
|
|
992
1005
|
var t;
|
|
993
|
-
return new
|
|
1006
|
+
return new L({
|
|
994
1007
|
checks: [],
|
|
995
1008
|
typeName: y.ZodString,
|
|
996
1009
|
coerce: (t = n == null ? void 0 : n.coerce) !== null && t !== void 0 ? t : !1,
|
|
@@ -1015,7 +1028,7 @@ class X extends v {
|
|
|
1015
1028
|
}), g;
|
|
1016
1029
|
}
|
|
1017
1030
|
let r;
|
|
1018
|
-
const s = new
|
|
1031
|
+
const s = new D();
|
|
1019
1032
|
for (const a of this._def.checks)
|
|
1020
1033
|
a.kind === "int" ? w.isInteger(t.data) || (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1021
1034
|
code: u.invalid_type,
|
|
@@ -1187,7 +1200,7 @@ class G extends v {
|
|
|
1187
1200
|
if (this._getType(t) !== f.bigint)
|
|
1188
1201
|
return this._getInvalidInput(t);
|
|
1189
1202
|
let r;
|
|
1190
|
-
const s = new
|
|
1203
|
+
const s = new D();
|
|
1191
1204
|
for (const a of this._def.checks)
|
|
1192
1205
|
a.kind === "min" ? (a.inclusive ? t.data < a.value : t.data <= a.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1193
1206
|
code: u.too_small,
|
|
@@ -1319,7 +1332,7 @@ class ge extends v {
|
|
|
1319
1332
|
received: r.parsedType
|
|
1320
1333
|
}), g;
|
|
1321
1334
|
}
|
|
1322
|
-
return
|
|
1335
|
+
return A(t.data);
|
|
1323
1336
|
}
|
|
1324
1337
|
}
|
|
1325
1338
|
ge.create = (n) => new ge({
|
|
@@ -1343,7 +1356,7 @@ class ne extends v {
|
|
|
1343
1356
|
code: u.invalid_date
|
|
1344
1357
|
}), g;
|
|
1345
1358
|
}
|
|
1346
|
-
const r = new
|
|
1359
|
+
const r = new D();
|
|
1347
1360
|
let s;
|
|
1348
1361
|
for (const a of this._def.checks)
|
|
1349
1362
|
a.kind === "min" ? t.data.getTime() < a.value && (s = this._getOrReturnCtx(t, s), l(s, {
|
|
@@ -1405,7 +1418,7 @@ ne.create = (n) => new ne({
|
|
|
1405
1418
|
typeName: y.ZodDate,
|
|
1406
1419
|
..._(n)
|
|
1407
1420
|
});
|
|
1408
|
-
class
|
|
1421
|
+
class Ze extends v {
|
|
1409
1422
|
_parse(t) {
|
|
1410
1423
|
if (this._getType(t) !== f.symbol) {
|
|
1411
1424
|
const r = this._getOrReturnCtx(t);
|
|
@@ -1415,10 +1428,10 @@ class Ae extends v {
|
|
|
1415
1428
|
received: r.parsedType
|
|
1416
1429
|
}), g;
|
|
1417
1430
|
}
|
|
1418
|
-
return
|
|
1431
|
+
return A(t.data);
|
|
1419
1432
|
}
|
|
1420
1433
|
}
|
|
1421
|
-
|
|
1434
|
+
Ze.create = (n) => new Ze({
|
|
1422
1435
|
typeName: y.ZodSymbol,
|
|
1423
1436
|
..._(n)
|
|
1424
1437
|
});
|
|
@@ -1432,7 +1445,7 @@ class _e extends v {
|
|
|
1432
1445
|
received: r.parsedType
|
|
1433
1446
|
}), g;
|
|
1434
1447
|
}
|
|
1435
|
-
return
|
|
1448
|
+
return A(t.data);
|
|
1436
1449
|
}
|
|
1437
1450
|
}
|
|
1438
1451
|
_e.create = (n) => new _e({
|
|
@@ -1449,7 +1462,7 @@ class ve extends v {
|
|
|
1449
1462
|
received: r.parsedType
|
|
1450
1463
|
}), g;
|
|
1451
1464
|
}
|
|
1452
|
-
return
|
|
1465
|
+
return A(t.data);
|
|
1453
1466
|
}
|
|
1454
1467
|
}
|
|
1455
1468
|
ve.create = (n) => new ve({
|
|
@@ -1461,7 +1474,7 @@ class ue extends v {
|
|
|
1461
1474
|
super(...arguments), this._any = !0;
|
|
1462
1475
|
}
|
|
1463
1476
|
_parse(t) {
|
|
1464
|
-
return
|
|
1477
|
+
return A(t.data);
|
|
1465
1478
|
}
|
|
1466
1479
|
}
|
|
1467
1480
|
ue.create = (n) => new ue({
|
|
@@ -1473,7 +1486,7 @@ class te extends v {
|
|
|
1473
1486
|
super(...arguments), this._unknown = !0;
|
|
1474
1487
|
}
|
|
1475
1488
|
_parse(t) {
|
|
1476
|
-
return
|
|
1489
|
+
return A(t.data);
|
|
1477
1490
|
}
|
|
1478
1491
|
}
|
|
1479
1492
|
te.create = (n) => new te({
|
|
@@ -1504,7 +1517,7 @@ class Re extends v {
|
|
|
1504
1517
|
received: r.parsedType
|
|
1505
1518
|
}), g;
|
|
1506
1519
|
}
|
|
1507
|
-
return
|
|
1520
|
+
return A(t.data);
|
|
1508
1521
|
}
|
|
1509
1522
|
}
|
|
1510
1523
|
Re.create = (n) => new Re({
|
|
@@ -1547,9 +1560,9 @@ class W extends v {
|
|
|
1547
1560
|
exact: !1,
|
|
1548
1561
|
message: s.maxLength.message
|
|
1549
1562
|
}), r.dirty()), e.common.async)
|
|
1550
|
-
return Promise.all([...e.data].map((i, o) => s.type._parseAsync(new z(e, i, e.path, o)))).then((i) =>
|
|
1563
|
+
return Promise.all([...e.data].map((i, o) => s.type._parseAsync(new z(e, i, e.path, o)))).then((i) => D.mergeArray(r, i));
|
|
1551
1564
|
const a = [...e.data].map((i, o) => s.type._parseSync(new z(e, i, e.path, o)));
|
|
1552
|
-
return
|
|
1565
|
+
return D.mergeArray(r, a);
|
|
1553
1566
|
}
|
|
1554
1567
|
get element() {
|
|
1555
1568
|
return this._def.type;
|
|
@@ -1671,7 +1684,7 @@ class T extends v {
|
|
|
1671
1684
|
});
|
|
1672
1685
|
}
|
|
1673
1686
|
return c;
|
|
1674
|
-
}).then((c) =>
|
|
1687
|
+
}).then((c) => D.mergeObjectSync(r, c)) : D.mergeObjectSync(r, d);
|
|
1675
1688
|
}
|
|
1676
1689
|
get shape() {
|
|
1677
1690
|
return this._def.shape();
|
|
@@ -1897,7 +1910,7 @@ class we extends v {
|
|
|
1897
1910
|
for (const o of a)
|
|
1898
1911
|
if (o.result.status === "dirty")
|
|
1899
1912
|
return e.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1900
|
-
const i = a.map((o) => new
|
|
1913
|
+
const i = a.map((o) => new Z(o.ctx.common.issues));
|
|
1901
1914
|
return l(e, {
|
|
1902
1915
|
code: u.invalid_union,
|
|
1903
1916
|
unionErrors: i
|
|
@@ -1944,7 +1957,7 @@ class we extends v {
|
|
|
1944
1957
|
}
|
|
1945
1958
|
if (a)
|
|
1946
1959
|
return e.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1947
|
-
const o = i.map((d) => new
|
|
1960
|
+
const o = i.map((d) => new Z(d));
|
|
1948
1961
|
return l(e, {
|
|
1949
1962
|
code: u.invalid_union,
|
|
1950
1963
|
unionErrors: o
|
|
@@ -1960,8 +1973,8 @@ we.create = (n, t) => new we({
|
|
|
1960
1973
|
typeName: y.ZodUnion,
|
|
1961
1974
|
..._(t)
|
|
1962
1975
|
});
|
|
1963
|
-
const B = (n) => n instanceof ke ? B(n.schema) : n instanceof
|
|
1964
|
-
class
|
|
1976
|
+
const B = (n) => n instanceof ke ? B(n.schema) : n instanceof Y ? B(n.innerType()) : n instanceof Te ? [n.value] : n instanceof J ? n.options : n instanceof Oe ? w.objectValues(n.enum) : n instanceof Pe ? B(n._def.innerType) : n instanceof _e ? [void 0] : n instanceof ve ? [null] : n instanceof F ? [void 0, ...B(n.unwrap())] : n instanceof K ? [null, ...B(n.unwrap())] : n instanceof Be || n instanceof Me ? B(n.unwrap()) : n instanceof Ee ? B(n._def.innerType) : [];
|
|
1977
|
+
class Ye extends v {
|
|
1965
1978
|
_parse(t) {
|
|
1966
1979
|
const { ctx: e } = this._processInputParams(t);
|
|
1967
1980
|
if (e.parsedType !== f.object)
|
|
@@ -2014,7 +2027,7 @@ class Le extends v {
|
|
|
2014
2027
|
s.set(o, a);
|
|
2015
2028
|
}
|
|
2016
2029
|
}
|
|
2017
|
-
return new
|
|
2030
|
+
return new Ye({
|
|
2018
2031
|
typeName: y.ZodDiscriminatedUnion,
|
|
2019
2032
|
discriminator: t,
|
|
2020
2033
|
options: e,
|
|
@@ -2115,7 +2128,7 @@ class q extends v {
|
|
|
2115
2128
|
const d = this._def.items[o] || this._def.rest;
|
|
2116
2129
|
return d ? d._parse(new z(r, i, r.path, o)) : null;
|
|
2117
2130
|
}).filter((i) => !!i);
|
|
2118
|
-
return r.common.async ? Promise.all(a).then((i) =>
|
|
2131
|
+
return r.common.async ? Promise.all(a).then((i) => D.mergeArray(e, i)) : D.mergeArray(e, a);
|
|
2119
2132
|
}
|
|
2120
2133
|
get items() {
|
|
2121
2134
|
return this._def.items;
|
|
@@ -2159,7 +2172,7 @@ class xe extends v {
|
|
|
2159
2172
|
value: i._parse(new z(r, r.data[o], r.path, o)),
|
|
2160
2173
|
alwaysSet: o in r.data
|
|
2161
2174
|
});
|
|
2162
|
-
return r.common.async ?
|
|
2175
|
+
return r.common.async ? D.mergeObjectAsync(e, s) : D.mergeObjectSync(e, s);
|
|
2163
2176
|
}
|
|
2164
2177
|
get element() {
|
|
2165
2178
|
return this._def.valueType;
|
|
@@ -2171,7 +2184,7 @@ class xe extends v {
|
|
|
2171
2184
|
typeName: y.ZodRecord,
|
|
2172
2185
|
..._(r)
|
|
2173
2186
|
}) : new xe({
|
|
2174
|
-
keyType:
|
|
2187
|
+
keyType: L.create(),
|
|
2175
2188
|
valueType: t,
|
|
2176
2189
|
typeName: y.ZodRecord,
|
|
2177
2190
|
..._(e)
|
|
@@ -2303,13 +2316,13 @@ class oe extends v {
|
|
|
2303
2316
|
received: e.parsedType
|
|
2304
2317
|
}), g;
|
|
2305
2318
|
function r(o, d) {
|
|
2306
|
-
return
|
|
2319
|
+
return Ie({
|
|
2307
2320
|
data: o,
|
|
2308
2321
|
path: e.path,
|
|
2309
2322
|
errorMaps: [
|
|
2310
2323
|
e.common.contextualErrorMap,
|
|
2311
2324
|
e.schemaErrorMap,
|
|
2312
|
-
|
|
2325
|
+
De(),
|
|
2313
2326
|
ce
|
|
2314
2327
|
].filter((c) => !!c),
|
|
2315
2328
|
issueData: {
|
|
@@ -2319,13 +2332,13 @@ class oe extends v {
|
|
|
2319
2332
|
});
|
|
2320
2333
|
}
|
|
2321
2334
|
function s(o, d) {
|
|
2322
|
-
return
|
|
2335
|
+
return Ie({
|
|
2323
2336
|
data: o,
|
|
2324
2337
|
path: e.path,
|
|
2325
2338
|
errorMaps: [
|
|
2326
2339
|
e.common.contextualErrorMap,
|
|
2327
2340
|
e.schemaErrorMap,
|
|
2328
|
-
|
|
2341
|
+
De(),
|
|
2329
2342
|
ce
|
|
2330
2343
|
].filter((c) => !!c),
|
|
2331
2344
|
issueData: {
|
|
@@ -2337,8 +2350,8 @@ class oe extends v {
|
|
|
2337
2350
|
const a = { errorMap: e.common.contextualErrorMap }, i = e.data;
|
|
2338
2351
|
if (this._def.returns instanceof de) {
|
|
2339
2352
|
const o = this;
|
|
2340
|
-
return
|
|
2341
|
-
const c = new
|
|
2353
|
+
return A(async function(...d) {
|
|
2354
|
+
const c = new Z([]), m = await o._def.args.parseAsync(d, a).catch((j) => {
|
|
2342
2355
|
throw c.addIssue(r(d, j)), c;
|
|
2343
2356
|
}), k = await Reflect.apply(i, this, m);
|
|
2344
2357
|
return await o._def.returns._def.type.parseAsync(k, a).catch((j) => {
|
|
@@ -2347,13 +2360,13 @@ class oe extends v {
|
|
|
2347
2360
|
});
|
|
2348
2361
|
} else {
|
|
2349
2362
|
const o = this;
|
|
2350
|
-
return
|
|
2363
|
+
return A(function(...d) {
|
|
2351
2364
|
const c = o._def.args.safeParse(d, a);
|
|
2352
2365
|
if (!c.success)
|
|
2353
|
-
throw new
|
|
2366
|
+
throw new Z([r(d, c.error)]);
|
|
2354
2367
|
const m = Reflect.apply(i, this, c.data), k = o._def.returns.safeParse(m, a);
|
|
2355
2368
|
if (!k.success)
|
|
2356
|
-
throw new
|
|
2369
|
+
throw new Z([s(m, k.error)]);
|
|
2357
2370
|
return k.data;
|
|
2358
2371
|
});
|
|
2359
2372
|
}
|
|
@@ -2446,7 +2459,7 @@ class J extends v {
|
|
|
2446
2459
|
code: u.invalid_type
|
|
2447
2460
|
}), g;
|
|
2448
2461
|
}
|
|
2449
|
-
if (
|
|
2462
|
+
if (Ae(this, me) || lt(this, me, new Set(this._def.values)), !Ae(this, me).has(t.data)) {
|
|
2450
2463
|
const e = this._getOrReturnCtx(t), r = this._def.values;
|
|
2451
2464
|
return l(e, {
|
|
2452
2465
|
received: e.data,
|
|
@@ -2454,7 +2467,7 @@ class J extends v {
|
|
|
2454
2467
|
options: r
|
|
2455
2468
|
}), g;
|
|
2456
2469
|
}
|
|
2457
|
-
return
|
|
2470
|
+
return A(t.data);
|
|
2458
2471
|
}
|
|
2459
2472
|
get options() {
|
|
2460
2473
|
return this._def.values;
|
|
@@ -2506,7 +2519,7 @@ class Oe extends v {
|
|
|
2506
2519
|
code: u.invalid_type
|
|
2507
2520
|
}), g;
|
|
2508
2521
|
}
|
|
2509
|
-
if (
|
|
2522
|
+
if (Ae(this, pe) || lt(this, pe, new Set(w.getValidEnumValues(this._def.values))), !Ae(this, pe).has(t.data)) {
|
|
2510
2523
|
const s = w.objectValues(e);
|
|
2511
2524
|
return l(r, {
|
|
2512
2525
|
received: r.data,
|
|
@@ -2514,7 +2527,7 @@ class Oe extends v {
|
|
|
2514
2527
|
options: s
|
|
2515
2528
|
}), g;
|
|
2516
2529
|
}
|
|
2517
|
-
return
|
|
2530
|
+
return A(t.data);
|
|
2518
2531
|
}
|
|
2519
2532
|
get enum() {
|
|
2520
2533
|
return this._def.values;
|
|
@@ -2539,7 +2552,7 @@ class de extends v {
|
|
|
2539
2552
|
received: e.parsedType
|
|
2540
2553
|
}), g;
|
|
2541
2554
|
const r = e.parsedType === f.promise ? e.data : Promise.resolve(e.data);
|
|
2542
|
-
return
|
|
2555
|
+
return A(r.then((s) => this._def.type.parseAsync(s, {
|
|
2543
2556
|
path: e.path,
|
|
2544
2557
|
errorMap: e.common.contextualErrorMap
|
|
2545
2558
|
})));
|
|
@@ -2550,7 +2563,7 @@ de.create = (n, t) => new de({
|
|
|
2550
2563
|
typeName: y.ZodPromise,
|
|
2551
2564
|
..._(t)
|
|
2552
2565
|
});
|
|
2553
|
-
class
|
|
2566
|
+
class Y extends v {
|
|
2554
2567
|
innerType() {
|
|
2555
2568
|
return this._def.schema;
|
|
2556
2569
|
}
|
|
@@ -2627,13 +2640,13 @@ class L extends v {
|
|
|
2627
2640
|
w.assertNever(s);
|
|
2628
2641
|
}
|
|
2629
2642
|
}
|
|
2630
|
-
|
|
2643
|
+
Y.create = (n, t, e) => new Y({
|
|
2631
2644
|
schema: n,
|
|
2632
2645
|
typeName: y.ZodEffects,
|
|
2633
2646
|
effect: t,
|
|
2634
2647
|
..._(e)
|
|
2635
2648
|
});
|
|
2636
|
-
|
|
2649
|
+
Y.createWithPreprocess = (n, t, e) => new Y({
|
|
2637
2650
|
schema: t,
|
|
2638
2651
|
effect: { type: "preprocess", transform: n },
|
|
2639
2652
|
typeName: y.ZodEffects,
|
|
@@ -2641,7 +2654,7 @@ L.createWithPreprocess = (n, t, e) => new L({
|
|
|
2641
2654
|
});
|
|
2642
2655
|
class F extends v {
|
|
2643
2656
|
_parse(t) {
|
|
2644
|
-
return this._getType(t) === f.undefined ?
|
|
2657
|
+
return this._getType(t) === f.undefined ? A(void 0) : this._def.innerType._parse(t);
|
|
2645
2658
|
}
|
|
2646
2659
|
unwrap() {
|
|
2647
2660
|
return this._def.innerType;
|
|
@@ -2654,7 +2667,7 @@ F.create = (n, t) => new F({
|
|
|
2654
2667
|
});
|
|
2655
2668
|
class K extends v {
|
|
2656
2669
|
_parse(t) {
|
|
2657
|
-
return this._getType(t) === f.null ?
|
|
2670
|
+
return this._getType(t) === f.null ? A(null) : this._def.innerType._parse(t);
|
|
2658
2671
|
}
|
|
2659
2672
|
unwrap() {
|
|
2660
2673
|
return this._def.innerType;
|
|
@@ -2685,7 +2698,7 @@ Pe.create = (n, t) => new Pe({
|
|
|
2685
2698
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2686
2699
|
..._(t)
|
|
2687
2700
|
});
|
|
2688
|
-
class
|
|
2701
|
+
class Ee extends v {
|
|
2689
2702
|
_parse(t) {
|
|
2690
2703
|
const { ctx: e } = this._processInputParams(t), r = {
|
|
2691
2704
|
...e,
|
|
@@ -2704,7 +2717,7 @@ class Ce extends v {
|
|
|
2704
2717
|
status: "valid",
|
|
2705
2718
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2706
2719
|
get error() {
|
|
2707
|
-
return new
|
|
2720
|
+
return new Z(r.common.issues);
|
|
2708
2721
|
},
|
|
2709
2722
|
input: r.data
|
|
2710
2723
|
})
|
|
@@ -2712,7 +2725,7 @@ class Ce extends v {
|
|
|
2712
2725
|
status: "valid",
|
|
2713
2726
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2714
2727
|
get error() {
|
|
2715
|
-
return new
|
|
2728
|
+
return new Z(r.common.issues);
|
|
2716
2729
|
},
|
|
2717
2730
|
input: r.data
|
|
2718
2731
|
})
|
|
@@ -2722,13 +2735,13 @@ class Ce extends v {
|
|
|
2722
2735
|
return this._def.innerType;
|
|
2723
2736
|
}
|
|
2724
2737
|
}
|
|
2725
|
-
|
|
2738
|
+
Ee.create = (n, t) => new Ee({
|
|
2726
2739
|
innerType: n,
|
|
2727
2740
|
typeName: y.ZodCatch,
|
|
2728
2741
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2729
2742
|
..._(t)
|
|
2730
2743
|
});
|
|
2731
|
-
class
|
|
2744
|
+
class Le extends v {
|
|
2732
2745
|
_parse(t) {
|
|
2733
2746
|
if (this._getType(t) !== f.nan) {
|
|
2734
2747
|
const r = this._getOrReturnCtx(t);
|
|
@@ -2741,7 +2754,7 @@ class Ye extends v {
|
|
|
2741
2754
|
return { status: "valid", value: t.data };
|
|
2742
2755
|
}
|
|
2743
2756
|
}
|
|
2744
|
-
|
|
2757
|
+
Le.create = (n) => new Le({
|
|
2745
2758
|
typeName: y.ZodNaN,
|
|
2746
2759
|
..._(n)
|
|
2747
2760
|
});
|
|
@@ -2759,7 +2772,7 @@ class Be extends v {
|
|
|
2759
2772
|
return this._def.type;
|
|
2760
2773
|
}
|
|
2761
2774
|
}
|
|
2762
|
-
class
|
|
2775
|
+
class Ne extends v {
|
|
2763
2776
|
_parse(t) {
|
|
2764
2777
|
const { status: e, ctx: r } = this._processInputParams(t);
|
|
2765
2778
|
if (r.common.async)
|
|
@@ -2792,7 +2805,7 @@ class Ee extends v {
|
|
|
2792
2805
|
}
|
|
2793
2806
|
}
|
|
2794
2807
|
static create(t, e) {
|
|
2795
|
-
return new
|
|
2808
|
+
return new Ne({
|
|
2796
2809
|
in: t,
|
|
2797
2810
|
out: e,
|
|
2798
2811
|
typeName: y.ZodPipeline
|
|
@@ -2831,8 +2844,8 @@ var y;
|
|
|
2831
2844
|
})(y || (y = {}));
|
|
2832
2845
|
const nr = (n, t = {
|
|
2833
2846
|
message: `Input not instance of ${n.name}`
|
|
2834
|
-
}) => yt((e) => e instanceof n, t), gt =
|
|
2835
|
-
string: (n) =>
|
|
2847
|
+
}) => yt((e) => e instanceof n, t), gt = L.create, _t = X.create, sr = Le.create, ar = G.create, vt = ge.create, ir = ne.create, or = Ze.create, cr = _e.create, ur = ve.create, dr = ue.create, lr = te.create, fr = Q.create, hr = Re.create, mr = W.create, pr = T.create, yr = T.strictCreate, gr = we.create, _r = Ye.create, vr = be.create, wr = q.create, br = xe.create, xr = je.create, kr = se.create, Tr = oe.create, Or = ke.create, Pr = Te.create, Er = J.create, Mr = Oe.create, Nr = de.create, at = Y.create, Cr = F.create, Dr = K.create, Ir = Y.createWithPreprocess, Ar = Ne.create, Zr = () => gt().optional(), Rr = () => _t().optional(), jr = () => vt().optional(), Lr = {
|
|
2848
|
+
string: (n) => L.create({ ...n, coerce: !0 }),
|
|
2836
2849
|
number: (n) => X.create({ ...n, coerce: !0 }),
|
|
2837
2850
|
boolean: (n) => ge.create({
|
|
2838
2851
|
...n,
|
|
@@ -2841,18 +2854,18 @@ const nr = (n, t = {
|
|
|
2841
2854
|
bigint: (n) => G.create({ ...n, coerce: !0 }),
|
|
2842
2855
|
date: (n) => ne.create({ ...n, coerce: !0 })
|
|
2843
2856
|
}, Wr = g;
|
|
2844
|
-
var
|
|
2857
|
+
var Rs = /* @__PURE__ */ Object.freeze({
|
|
2845
2858
|
__proto__: null,
|
|
2846
2859
|
defaultErrorMap: ce,
|
|
2847
|
-
setErrorMap:
|
|
2848
|
-
getErrorMap:
|
|
2849
|
-
makeIssue:
|
|
2850
|
-
EMPTY_PATH:
|
|
2860
|
+
setErrorMap: It,
|
|
2861
|
+
getErrorMap: De,
|
|
2862
|
+
makeIssue: Ie,
|
|
2863
|
+
EMPTY_PATH: At,
|
|
2851
2864
|
addIssueToContext: l,
|
|
2852
|
-
ParseStatus:
|
|
2865
|
+
ParseStatus: D,
|
|
2853
2866
|
INVALID: g,
|
|
2854
2867
|
DIRTY: ie,
|
|
2855
|
-
OK:
|
|
2868
|
+
OK: A,
|
|
2856
2869
|
isAborted: ze,
|
|
2857
2870
|
isDirty: qe,
|
|
2858
2871
|
isValid: re,
|
|
@@ -2867,12 +2880,12 @@ var As = /* @__PURE__ */ Object.freeze({
|
|
|
2867
2880
|
getParsedType: U,
|
|
2868
2881
|
ZodType: v,
|
|
2869
2882
|
datetimeRegex: mt,
|
|
2870
|
-
ZodString:
|
|
2883
|
+
ZodString: L,
|
|
2871
2884
|
ZodNumber: X,
|
|
2872
2885
|
ZodBigInt: G,
|
|
2873
2886
|
ZodBoolean: ge,
|
|
2874
2887
|
ZodDate: ne,
|
|
2875
|
-
ZodSymbol:
|
|
2888
|
+
ZodSymbol: Ze,
|
|
2876
2889
|
ZodUndefined: _e,
|
|
2877
2890
|
ZodNull: ve,
|
|
2878
2891
|
ZodAny: ue,
|
|
@@ -2882,7 +2895,7 @@ var As = /* @__PURE__ */ Object.freeze({
|
|
|
2882
2895
|
ZodArray: W,
|
|
2883
2896
|
ZodObject: T,
|
|
2884
2897
|
ZodUnion: we,
|
|
2885
|
-
ZodDiscriminatedUnion:
|
|
2898
|
+
ZodDiscriminatedUnion: Ye,
|
|
2886
2899
|
ZodIntersection: be,
|
|
2887
2900
|
ZodTuple: q,
|
|
2888
2901
|
ZodRecord: xe,
|
|
@@ -2894,16 +2907,16 @@ var As = /* @__PURE__ */ Object.freeze({
|
|
|
2894
2907
|
ZodEnum: J,
|
|
2895
2908
|
ZodNativeEnum: Oe,
|
|
2896
2909
|
ZodPromise: de,
|
|
2897
|
-
ZodEffects:
|
|
2898
|
-
ZodTransformer:
|
|
2910
|
+
ZodEffects: Y,
|
|
2911
|
+
ZodTransformer: Y,
|
|
2899
2912
|
ZodOptional: F,
|
|
2900
2913
|
ZodNullable: K,
|
|
2901
2914
|
ZodDefault: Pe,
|
|
2902
|
-
ZodCatch:
|
|
2903
|
-
ZodNaN:
|
|
2915
|
+
ZodCatch: Ee,
|
|
2916
|
+
ZodNaN: Le,
|
|
2904
2917
|
BRAND: tr,
|
|
2905
2918
|
ZodBranded: Be,
|
|
2906
|
-
ZodPipeline:
|
|
2919
|
+
ZodPipeline: Ne,
|
|
2907
2920
|
ZodReadonly: Me,
|
|
2908
2921
|
custom: yt,
|
|
2909
2922
|
Schema: v,
|
|
@@ -2912,7 +2925,7 @@ var As = /* @__PURE__ */ Object.freeze({
|
|
|
2912
2925
|
get ZodFirstPartyTypeKind() {
|
|
2913
2926
|
return y;
|
|
2914
2927
|
},
|
|
2915
|
-
coerce:
|
|
2928
|
+
coerce: Lr,
|
|
2916
2929
|
any: dr,
|
|
2917
2930
|
array: mr,
|
|
2918
2931
|
bigint: ar,
|
|
@@ -2920,7 +2933,7 @@ var As = /* @__PURE__ */ Object.freeze({
|
|
|
2920
2933
|
date: ir,
|
|
2921
2934
|
discriminatedUnion: _r,
|
|
2922
2935
|
effect: at,
|
|
2923
|
-
enum:
|
|
2936
|
+
enum: Er,
|
|
2924
2937
|
function: Tr,
|
|
2925
2938
|
instanceof: nr,
|
|
2926
2939
|
intersection: vr,
|
|
@@ -2931,16 +2944,16 @@ var As = /* @__PURE__ */ Object.freeze({
|
|
|
2931
2944
|
nativeEnum: Mr,
|
|
2932
2945
|
never: fr,
|
|
2933
2946
|
null: ur,
|
|
2934
|
-
nullable:
|
|
2947
|
+
nullable: Dr,
|
|
2935
2948
|
number: _t,
|
|
2936
2949
|
object: pr,
|
|
2937
2950
|
oboolean: jr,
|
|
2938
2951
|
onumber: Rr,
|
|
2939
|
-
optional:
|
|
2940
|
-
ostring:
|
|
2941
|
-
pipeline:
|
|
2942
|
-
preprocess:
|
|
2943
|
-
promise:
|
|
2952
|
+
optional: Cr,
|
|
2953
|
+
ostring: Zr,
|
|
2954
|
+
pipeline: Ar,
|
|
2955
|
+
preprocess: Ir,
|
|
2956
|
+
promise: Nr,
|
|
2944
2957
|
record: br,
|
|
2945
2958
|
set: kr,
|
|
2946
2959
|
strictObject: yr,
|
|
@@ -2954,42 +2967,42 @@ var As = /* @__PURE__ */ Object.freeze({
|
|
|
2954
2967
|
void: hr,
|
|
2955
2968
|
NEVER: Wr,
|
|
2956
2969
|
ZodIssueCode: u,
|
|
2957
|
-
quotelessJson:
|
|
2958
|
-
ZodError:
|
|
2970
|
+
quotelessJson: Dt,
|
|
2971
|
+
ZodError: Z
|
|
2959
2972
|
});
|
|
2960
|
-
const wt = 6048e5,
|
|
2961
|
-
function
|
|
2973
|
+
const wt = 6048e5, js = 864e5, Yr = 6e4, Sr = 36e5, $r = 1e3, it = Symbol.for("constructDateFrom");
|
|
2974
|
+
function C(n, t) {
|
|
2962
2975
|
return typeof n == "function" ? n(t) : n && typeof n == "object" && it in n ? n[it](t) : n instanceof Date ? new n.constructor(t) : new Date(t);
|
|
2963
2976
|
}
|
|
2964
|
-
function
|
|
2965
|
-
return
|
|
2977
|
+
function I(n, t) {
|
|
2978
|
+
return C(t || n, n);
|
|
2966
2979
|
}
|
|
2967
2980
|
function bt(n, t, e) {
|
|
2968
|
-
const r =
|
|
2969
|
-
return isNaN(t) ?
|
|
2981
|
+
const r = I(n, e == null ? void 0 : e.in);
|
|
2982
|
+
return isNaN(t) ? C((e == null ? void 0 : e.in) || n, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
2970
2983
|
}
|
|
2971
2984
|
let Vr = {};
|
|
2972
|
-
function
|
|
2985
|
+
function Ce() {
|
|
2973
2986
|
return Vr;
|
|
2974
2987
|
}
|
|
2975
2988
|
function ee(n, t) {
|
|
2976
2989
|
var o, d, c, m;
|
|
2977
|
-
const e =
|
|
2990
|
+
const e = Ce(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((d = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : d.weekStartsOn) ?? e.weekStartsOn ?? ((m = (c = e.locale) == null ? void 0 : c.options) == null ? void 0 : m.weekStartsOn) ?? 0, s = I(n, t == null ? void 0 : t.in), a = s.getDay(), i = (a < r ? 7 : 0) + a - r;
|
|
2978
2991
|
return s.setDate(s.getDate() - i), s.setHours(0, 0, 0, 0), s;
|
|
2979
2992
|
}
|
|
2980
2993
|
function le(n, t) {
|
|
2981
2994
|
return ee(n, { ...t, weekStartsOn: 1 });
|
|
2982
2995
|
}
|
|
2983
2996
|
function Fr(n, t) {
|
|
2984
|
-
const e =
|
|
2997
|
+
const e = I(n, t == null ? void 0 : t.in), r = e.getFullYear(), s = C(e, 0);
|
|
2985
2998
|
s.setFullYear(r + 1, 0, 4), s.setHours(0, 0, 0, 0);
|
|
2986
|
-
const a = le(s), i =
|
|
2999
|
+
const a = le(s), i = C(e, 0);
|
|
2987
3000
|
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
2988
3001
|
const o = le(i);
|
|
2989
3002
|
return e.getTime() >= a.getTime() ? r + 1 : e.getTime() >= o.getTime() ? r : r - 1;
|
|
2990
3003
|
}
|
|
2991
3004
|
function xt(n) {
|
|
2992
|
-
const t =
|
|
3005
|
+
const t = I(n), e = new Date(
|
|
2993
3006
|
Date.UTC(
|
|
2994
3007
|
t.getFullYear(),
|
|
2995
3008
|
t.getMonth(),
|
|
@@ -3003,14 +3016,14 @@ function xt(n) {
|
|
|
3003
3016
|
return e.setUTCFullYear(t.getFullYear()), +n - +e;
|
|
3004
3017
|
}
|
|
3005
3018
|
function zr(n, t) {
|
|
3006
|
-
const e = Fr(n, t), r =
|
|
3019
|
+
const e = Fr(n, t), r = C(n, 0);
|
|
3007
3020
|
return r.setFullYear(e, 0, 4), r.setHours(0, 0, 0, 0), le(r);
|
|
3008
3021
|
}
|
|
3009
3022
|
function qr(n) {
|
|
3010
3023
|
return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]";
|
|
3011
3024
|
}
|
|
3012
|
-
function
|
|
3013
|
-
return !(!qr(n) && typeof n != "number" || isNaN(+
|
|
3025
|
+
function Ls(n) {
|
|
3026
|
+
return !(!qr(n) && typeof n != "number" || isNaN(+I(n)));
|
|
3014
3027
|
}
|
|
3015
3028
|
const Hr = {
|
|
3016
3029
|
lessThanXSeconds: {
|
|
@@ -3444,25 +3457,25 @@ const fn = /^(\d+)(th|st|nd|rd)?/i, hn = /\d+/i, mn = {
|
|
|
3444
3457
|
}
|
|
3445
3458
|
};
|
|
3446
3459
|
function Pn(n, t) {
|
|
3447
|
-
const e =
|
|
3460
|
+
const e = I(n, t == null ? void 0 : t.in), r = +le(e) - +zr(e);
|
|
3448
3461
|
return Math.round(r / wt) + 1;
|
|
3449
3462
|
}
|
|
3450
3463
|
function kt(n, t) {
|
|
3451
3464
|
var m, k, R, j;
|
|
3452
|
-
const e =
|
|
3465
|
+
const e = I(n, t == null ? void 0 : t.in), r = e.getFullYear(), s = Ce(), a = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((k = (m = t == null ? void 0 : t.locale) == null ? void 0 : m.options) == null ? void 0 : k.firstWeekContainsDate) ?? s.firstWeekContainsDate ?? ((j = (R = s.locale) == null ? void 0 : R.options) == null ? void 0 : j.firstWeekContainsDate) ?? 1, i = C((t == null ? void 0 : t.in) || n, 0);
|
|
3453
3466
|
i.setFullYear(r + 1, 0, a), i.setHours(0, 0, 0, 0);
|
|
3454
|
-
const o = ee(i, t), d =
|
|
3467
|
+
const o = ee(i, t), d = C((t == null ? void 0 : t.in) || n, 0);
|
|
3455
3468
|
d.setFullYear(r, 0, a), d.setHours(0, 0, 0, 0);
|
|
3456
3469
|
const c = ee(d, t);
|
|
3457
3470
|
return +e >= +o ? r + 1 : +e >= +c ? r : r - 1;
|
|
3458
3471
|
}
|
|
3459
|
-
function
|
|
3472
|
+
function En(n, t) {
|
|
3460
3473
|
var o, d, c, m;
|
|
3461
|
-
const e =
|
|
3474
|
+
const e = Ce(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : d.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((m = (c = e.locale) == null ? void 0 : c.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, s = kt(n, t), a = C((t == null ? void 0 : t.in) || n, 0);
|
|
3462
3475
|
return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0), ee(a, t);
|
|
3463
3476
|
}
|
|
3464
3477
|
function Mn(n, t) {
|
|
3465
|
-
const e =
|
|
3478
|
+
const e = I(n, t == null ? void 0 : t.in), r = +ee(e, t) - +En(e, t);
|
|
3466
3479
|
return Math.round(r / wt) + 1;
|
|
3467
3480
|
}
|
|
3468
3481
|
const ot = (n, t) => {
|
|
@@ -3489,7 +3502,7 @@ const ot = (n, t) => {
|
|
|
3489
3502
|
default:
|
|
3490
3503
|
return t.time({ width: "full" });
|
|
3491
3504
|
}
|
|
3492
|
-
},
|
|
3505
|
+
}, Nn = (n, t) => {
|
|
3493
3506
|
const e = n.match(/(P+)(p+)?/) || [], r = e[1], s = e[2];
|
|
3494
3507
|
if (!s)
|
|
3495
3508
|
return ot(n, t);
|
|
@@ -3512,31 +3525,31 @@ const ot = (n, t) => {
|
|
|
3512
3525
|
return a.replace("{{date}}", ot(r, t)).replace("{{time}}", Tt(s, t));
|
|
3513
3526
|
}, ct = {
|
|
3514
3527
|
p: Tt,
|
|
3515
|
-
P:
|
|
3516
|
-
},
|
|
3517
|
-
function In(n) {
|
|
3518
|
-
return Dn.test(n);
|
|
3519
|
-
}
|
|
3528
|
+
P: Nn
|
|
3529
|
+
}, Cn = /^D+$/, Dn = /^Y+$/, In = ["D", "DD", "YY", "YYYY"];
|
|
3520
3530
|
function An(n) {
|
|
3521
|
-
return
|
|
3531
|
+
return Cn.test(n);
|
|
3532
|
+
}
|
|
3533
|
+
function Zn(n) {
|
|
3534
|
+
return Dn.test(n);
|
|
3522
3535
|
}
|
|
3523
3536
|
function ut(n, t, e) {
|
|
3524
3537
|
const r = Rn(n, t, e);
|
|
3525
|
-
if (console.warn(r),
|
|
3538
|
+
if (console.warn(r), In.includes(n)) throw new RangeError(r);
|
|
3526
3539
|
}
|
|
3527
3540
|
function Rn(n, t, e) {
|
|
3528
3541
|
const r = n[0] === "Y" ? "years" : "days of the month";
|
|
3529
3542
|
return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
3530
3543
|
}
|
|
3531
3544
|
function jn() {
|
|
3532
|
-
return Object.assign({},
|
|
3545
|
+
return Object.assign({}, Ce());
|
|
3533
3546
|
}
|
|
3534
|
-
function
|
|
3535
|
-
const e =
|
|
3547
|
+
function Ln(n, t) {
|
|
3548
|
+
const e = I(n, t == null ? void 0 : t.in).getDay();
|
|
3536
3549
|
return e === 0 ? 7 : e;
|
|
3537
3550
|
}
|
|
3538
3551
|
function Wn(n, t) {
|
|
3539
|
-
const e =
|
|
3552
|
+
const e = Yn(t) ? new t(0) : C(t, 0);
|
|
3540
3553
|
return e.setFullYear(n.getFullYear(), n.getMonth(), n.getDate()), e.setHours(
|
|
3541
3554
|
n.getHours(),
|
|
3542
3555
|
n.getMinutes(),
|
|
@@ -3544,11 +3557,11 @@ function Wn(n, t) {
|
|
|
3544
3557
|
n.getMilliseconds()
|
|
3545
3558
|
), e;
|
|
3546
3559
|
}
|
|
3547
|
-
function
|
|
3560
|
+
function Yn(n) {
|
|
3548
3561
|
var t;
|
|
3549
3562
|
return typeof n == "function" && ((t = n.prototype) == null ? void 0 : t.constructor) === n;
|
|
3550
3563
|
}
|
|
3551
|
-
const
|
|
3564
|
+
const Sn = 10;
|
|
3552
3565
|
class Ot {
|
|
3553
3566
|
constructor() {
|
|
3554
3567
|
h(this, "subPriority", 0);
|
|
@@ -3557,7 +3570,7 @@ class Ot {
|
|
|
3557
3570
|
return !0;
|
|
3558
3571
|
}
|
|
3559
3572
|
}
|
|
3560
|
-
class
|
|
3573
|
+
class $n extends Ot {
|
|
3561
3574
|
constructor(t, e, r, s, a) {
|
|
3562
3575
|
super(), this.value = t, this.validateValue = e, this.setValue = r, this.priority = s, a && (this.subPriority = a);
|
|
3563
3576
|
}
|
|
@@ -3571,19 +3584,19 @@ class Sn extends Ot {
|
|
|
3571
3584
|
class Vn extends Ot {
|
|
3572
3585
|
constructor(e, r) {
|
|
3573
3586
|
super();
|
|
3574
|
-
h(this, "priority",
|
|
3587
|
+
h(this, "priority", Sn);
|
|
3575
3588
|
h(this, "subPriority", -1);
|
|
3576
|
-
this.context = e || ((s) =>
|
|
3589
|
+
this.context = e || ((s) => C(r, s));
|
|
3577
3590
|
}
|
|
3578
3591
|
set(e, r) {
|
|
3579
|
-
return r.timestampIsSet ? e :
|
|
3592
|
+
return r.timestampIsSet ? e : C(e, Wn(e, this.context));
|
|
3580
3593
|
}
|
|
3581
3594
|
}
|
|
3582
3595
|
class x {
|
|
3583
3596
|
run(t, e, r, s) {
|
|
3584
3597
|
const a = this.parse(t, e, r, s);
|
|
3585
3598
|
return a ? {
|
|
3586
|
-
setter: new
|
|
3599
|
+
setter: new $n(
|
|
3587
3600
|
a.value,
|
|
3588
3601
|
this.validate,
|
|
3589
3602
|
this.set,
|
|
@@ -3661,14 +3674,14 @@ const M = {
|
|
|
3661
3674
|
// 0 to 999, -0 to -999
|
|
3662
3675
|
fourDigitsSigned: /^-?\d{1,4}/
|
|
3663
3676
|
// 0 to 9999, -0 to -9999
|
|
3664
|
-
},
|
|
3677
|
+
}, $ = {
|
|
3665
3678
|
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
3666
3679
|
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
3667
3680
|
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
3668
3681
|
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
3669
3682
|
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
3670
3683
|
};
|
|
3671
|
-
function
|
|
3684
|
+
function N(n, t) {
|
|
3672
3685
|
return n && {
|
|
3673
3686
|
value: t(n.value),
|
|
3674
3687
|
rest: n.rest
|
|
@@ -3692,14 +3705,14 @@ function V(n, t) {
|
|
|
3692
3705
|
};
|
|
3693
3706
|
const r = e[1] === "+" ? 1 : -1, s = e[2] ? parseInt(e[2], 10) : 0, a = e[3] ? parseInt(e[3], 10) : 0, i = e[5] ? parseInt(e[5], 10) : 0;
|
|
3694
3707
|
return {
|
|
3695
|
-
value: r * (s *
|
|
3708
|
+
value: r * (s * Sr + a * Yr + i * $r),
|
|
3696
3709
|
rest: t.slice(e[0].length)
|
|
3697
3710
|
};
|
|
3698
3711
|
}
|
|
3699
3712
|
function Pt(n) {
|
|
3700
3713
|
return O(M.anyDigitsSigned, n);
|
|
3701
3714
|
}
|
|
3702
|
-
function
|
|
3715
|
+
function E(n, t) {
|
|
3703
3716
|
switch (n) {
|
|
3704
3717
|
case 1:
|
|
3705
3718
|
return O(M.singleDigit, t);
|
|
@@ -3744,7 +3757,7 @@ function Ue(n) {
|
|
|
3744
3757
|
return 0;
|
|
3745
3758
|
}
|
|
3746
3759
|
}
|
|
3747
|
-
function
|
|
3760
|
+
function Et(n, t) {
|
|
3748
3761
|
const e = t > 0, r = e ? t : 1 - t;
|
|
3749
3762
|
let s;
|
|
3750
3763
|
if (r <= 50)
|
|
@@ -3771,16 +3784,16 @@ class zn extends x {
|
|
|
3771
3784
|
});
|
|
3772
3785
|
switch (r) {
|
|
3773
3786
|
case "y":
|
|
3774
|
-
return E(
|
|
3787
|
+
return N(E(4, e), a);
|
|
3775
3788
|
case "yo":
|
|
3776
|
-
return
|
|
3789
|
+
return N(
|
|
3777
3790
|
s.ordinalNumber(e, {
|
|
3778
3791
|
unit: "year"
|
|
3779
3792
|
}),
|
|
3780
3793
|
a
|
|
3781
3794
|
);
|
|
3782
3795
|
default:
|
|
3783
|
-
return E(
|
|
3796
|
+
return N(E(r.length, e), a);
|
|
3784
3797
|
}
|
|
3785
3798
|
}
|
|
3786
3799
|
validate(e, r) {
|
|
@@ -3789,7 +3802,7 @@ class zn extends x {
|
|
|
3789
3802
|
set(e, r, s) {
|
|
3790
3803
|
const a = e.getFullYear();
|
|
3791
3804
|
if (s.isTwoDigitYear) {
|
|
3792
|
-
const o =
|
|
3805
|
+
const o = Et(
|
|
3793
3806
|
s.year,
|
|
3794
3807
|
a
|
|
3795
3808
|
);
|
|
@@ -3826,16 +3839,16 @@ class qn extends x {
|
|
|
3826
3839
|
});
|
|
3827
3840
|
switch (r) {
|
|
3828
3841
|
case "Y":
|
|
3829
|
-
return E(
|
|
3842
|
+
return N(E(4, e), a);
|
|
3830
3843
|
case "Yo":
|
|
3831
|
-
return
|
|
3844
|
+
return N(
|
|
3832
3845
|
s.ordinalNumber(e, {
|
|
3833
3846
|
unit: "year"
|
|
3834
3847
|
}),
|
|
3835
3848
|
a
|
|
3836
3849
|
);
|
|
3837
3850
|
default:
|
|
3838
|
-
return E(
|
|
3851
|
+
return N(E(r.length, e), a);
|
|
3839
3852
|
}
|
|
3840
3853
|
}
|
|
3841
3854
|
validate(e, r) {
|
|
@@ -3844,7 +3857,7 @@ class qn extends x {
|
|
|
3844
3857
|
set(e, r, s, a) {
|
|
3845
3858
|
const i = kt(e, a);
|
|
3846
3859
|
if (s.isTwoDigitYear) {
|
|
3847
|
-
const d =
|
|
3860
|
+
const d = Et(
|
|
3848
3861
|
s.year,
|
|
3849
3862
|
i
|
|
3850
3863
|
);
|
|
@@ -3884,7 +3897,7 @@ class Hn extends x {
|
|
|
3884
3897
|
return We(r === "R" ? 4 : r.length, e);
|
|
3885
3898
|
}
|
|
3886
3899
|
set(e, r, s) {
|
|
3887
|
-
const a =
|
|
3900
|
+
const a = C(e, 0);
|
|
3888
3901
|
return a.setFullYear(s, 0, 4), a.setHours(0, 0, 0, 0), le(a);
|
|
3889
3902
|
}
|
|
3890
3903
|
}
|
|
@@ -3927,7 +3940,7 @@ class Un extends x {
|
|
|
3927
3940
|
// 1, 2, 3, 4
|
|
3928
3941
|
case "Q":
|
|
3929
3942
|
case "QQ":
|
|
3930
|
-
return
|
|
3943
|
+
return E(r.length, e);
|
|
3931
3944
|
// 1st, 2nd, 3rd, 4th
|
|
3932
3945
|
case "Qo":
|
|
3933
3946
|
return s.ordinalNumber(e, { unit: "quarter" });
|
|
@@ -3994,7 +4007,7 @@ class Qn extends x {
|
|
|
3994
4007
|
// 1, 2, 3, 4
|
|
3995
4008
|
case "q":
|
|
3996
4009
|
case "qq":
|
|
3997
|
-
return
|
|
4010
|
+
return E(r.length, e);
|
|
3998
4011
|
// 1st, 2nd, 3rd, 4th
|
|
3999
4012
|
case "qo":
|
|
4000
4013
|
return s.ordinalNumber(e, { unit: "quarter" });
|
|
@@ -4060,16 +4073,16 @@ class Xn extends x {
|
|
|
4060
4073
|
switch (r) {
|
|
4061
4074
|
// 1, 2, ..., 12
|
|
4062
4075
|
case "M":
|
|
4063
|
-
return
|
|
4076
|
+
return N(
|
|
4064
4077
|
O(M.month, e),
|
|
4065
4078
|
a
|
|
4066
4079
|
);
|
|
4067
4080
|
// 01, 02, ..., 12
|
|
4068
4081
|
case "MM":
|
|
4069
|
-
return E(
|
|
4082
|
+
return N(E(2, e), a);
|
|
4070
4083
|
// 1st, 2nd, ..., 12th
|
|
4071
4084
|
case "Mo":
|
|
4072
|
-
return
|
|
4085
|
+
return N(
|
|
4073
4086
|
s.ordinalNumber(e, {
|
|
4074
4087
|
unit: "month"
|
|
4075
4088
|
}),
|
|
@@ -4128,16 +4141,16 @@ class Gn extends x {
|
|
|
4128
4141
|
switch (r) {
|
|
4129
4142
|
// 1, 2, ..., 12
|
|
4130
4143
|
case "L":
|
|
4131
|
-
return
|
|
4144
|
+
return N(
|
|
4132
4145
|
O(M.month, e),
|
|
4133
4146
|
a
|
|
4134
4147
|
);
|
|
4135
4148
|
// 01, 02, ..., 12
|
|
4136
4149
|
case "LL":
|
|
4137
|
-
return E(
|
|
4150
|
+
return N(E(2, e), a);
|
|
4138
4151
|
// 1st, 2nd, ..., 12th
|
|
4139
4152
|
case "Lo":
|
|
4140
|
-
return
|
|
4153
|
+
return N(
|
|
4141
4154
|
s.ordinalNumber(e, {
|
|
4142
4155
|
unit: "month"
|
|
4143
4156
|
}),
|
|
@@ -4172,8 +4185,8 @@ class Gn extends x {
|
|
|
4172
4185
|
}
|
|
4173
4186
|
}
|
|
4174
4187
|
function Jn(n, t, e) {
|
|
4175
|
-
const r =
|
|
4176
|
-
return r.setDate(r.getDate() - s * 7),
|
|
4188
|
+
const r = I(n, e == null ? void 0 : e.in), s = Mn(r, e) - t;
|
|
4189
|
+
return r.setDate(r.getDate() - s * 7), I(r, e == null ? void 0 : e.in);
|
|
4177
4190
|
}
|
|
4178
4191
|
class Kn extends x {
|
|
4179
4192
|
constructor() {
|
|
@@ -4202,7 +4215,7 @@ class Kn extends x {
|
|
|
4202
4215
|
case "wo":
|
|
4203
4216
|
return s.ordinalNumber(e, { unit: "week" });
|
|
4204
4217
|
default:
|
|
4205
|
-
return
|
|
4218
|
+
return E(r.length, e);
|
|
4206
4219
|
}
|
|
4207
4220
|
}
|
|
4208
4221
|
validate(e, r) {
|
|
@@ -4213,7 +4226,7 @@ class Kn extends x {
|
|
|
4213
4226
|
}
|
|
4214
4227
|
}
|
|
4215
4228
|
function es(n, t, e) {
|
|
4216
|
-
const r =
|
|
4229
|
+
const r = I(n, e == null ? void 0 : e.in), s = Pn(r, e) - t;
|
|
4217
4230
|
return r.setDate(r.getDate() - s * 7), r;
|
|
4218
4231
|
}
|
|
4219
4232
|
class ts extends x {
|
|
@@ -4244,7 +4257,7 @@ class ts extends x {
|
|
|
4244
4257
|
case "Io":
|
|
4245
4258
|
return s.ordinalNumber(e, { unit: "week" });
|
|
4246
4259
|
default:
|
|
4247
|
-
return
|
|
4260
|
+
return E(r.length, e);
|
|
4248
4261
|
}
|
|
4249
4262
|
}
|
|
4250
4263
|
validate(e, r) {
|
|
@@ -4295,7 +4308,7 @@ class ss extends x {
|
|
|
4295
4308
|
case "do":
|
|
4296
4309
|
return s.ordinalNumber(e, { unit: "date" });
|
|
4297
4310
|
default:
|
|
4298
|
-
return
|
|
4311
|
+
return E(r.length, e);
|
|
4299
4312
|
}
|
|
4300
4313
|
}
|
|
4301
4314
|
validate(e, r) {
|
|
@@ -4337,7 +4350,7 @@ class as extends x {
|
|
|
4337
4350
|
case "Do":
|
|
4338
4351
|
return s.ordinalNumber(e, { unit: "date" });
|
|
4339
4352
|
default:
|
|
4340
|
-
return
|
|
4353
|
+
return E(r.length, e);
|
|
4341
4354
|
}
|
|
4342
4355
|
}
|
|
4343
4356
|
validate(e, r) {
|
|
@@ -4350,7 +4363,7 @@ class as extends x {
|
|
|
4350
4363
|
}
|
|
4351
4364
|
function Qe(n, t, e) {
|
|
4352
4365
|
var k, R, j, H;
|
|
4353
|
-
const r =
|
|
4366
|
+
const r = Ce(), s = (e == null ? void 0 : e.weekStartsOn) ?? ((R = (k = e == null ? void 0 : e.locale) == null ? void 0 : k.options) == null ? void 0 : R.weekStartsOn) ?? r.weekStartsOn ?? ((H = (j = r.locale) == null ? void 0 : j.options) == null ? void 0 : H.weekStartsOn) ?? 0, a = I(n, e == null ? void 0 : e.in), i = a.getDay(), d = (t % 7 + 7) % 7, c = 7 - s, m = t < 0 || t > 6 ? t - (i + c) % 7 : (d + c) % 7 - (i + c) % 7;
|
|
4354
4367
|
return bt(a, m, e);
|
|
4355
4368
|
}
|
|
4356
4369
|
class is extends x {
|
|
@@ -4425,10 +4438,10 @@ class os extends x {
|
|
|
4425
4438
|
// 3
|
|
4426
4439
|
case "e":
|
|
4427
4440
|
case "ee":
|
|
4428
|
-
return E(
|
|
4441
|
+
return N(E(r.length, e), i);
|
|
4429
4442
|
// 3rd
|
|
4430
4443
|
case "eo":
|
|
4431
|
-
return
|
|
4444
|
+
return N(
|
|
4432
4445
|
s.ordinalNumber(e, {
|
|
4433
4446
|
unit: "day"
|
|
4434
4447
|
}),
|
|
@@ -4496,10 +4509,10 @@ class cs extends x {
|
|
|
4496
4509
|
// 3
|
|
4497
4510
|
case "c":
|
|
4498
4511
|
case "cc":
|
|
4499
|
-
return E(
|
|
4512
|
+
return N(E(r.length, e), i);
|
|
4500
4513
|
// 3rd
|
|
4501
4514
|
case "co":
|
|
4502
|
-
return
|
|
4515
|
+
return N(
|
|
4503
4516
|
s.ordinalNumber(e, {
|
|
4504
4517
|
unit: "day"
|
|
4505
4518
|
}),
|
|
@@ -4537,7 +4550,7 @@ class cs extends x {
|
|
|
4537
4550
|
}
|
|
4538
4551
|
}
|
|
4539
4552
|
function us(n, t, e) {
|
|
4540
|
-
const r =
|
|
4553
|
+
const r = I(n, e == null ? void 0 : e.in), s = Ln(r, e), a = t - s;
|
|
4541
4554
|
return bt(r, a, e);
|
|
4542
4555
|
}
|
|
4543
4556
|
class ds extends x {
|
|
@@ -4568,13 +4581,13 @@ class ds extends x {
|
|
|
4568
4581
|
// 2
|
|
4569
4582
|
case "i":
|
|
4570
4583
|
case "ii":
|
|
4571
|
-
return
|
|
4584
|
+
return E(r.length, e);
|
|
4572
4585
|
// 2nd
|
|
4573
4586
|
case "io":
|
|
4574
4587
|
return s.ordinalNumber(e, { unit: "day" });
|
|
4575
4588
|
// Tue
|
|
4576
4589
|
case "iii":
|
|
4577
|
-
return
|
|
4590
|
+
return N(
|
|
4578
4591
|
s.day(e, {
|
|
4579
4592
|
width: "abbreviated",
|
|
4580
4593
|
context: "formatting"
|
|
@@ -4589,7 +4602,7 @@ class ds extends x {
|
|
|
4589
4602
|
);
|
|
4590
4603
|
// T
|
|
4591
4604
|
case "iiiii":
|
|
4592
|
-
return
|
|
4605
|
+
return N(
|
|
4593
4606
|
s.day(e, {
|
|
4594
4607
|
width: "narrow",
|
|
4595
4608
|
context: "formatting"
|
|
@@ -4598,7 +4611,7 @@ class ds extends x {
|
|
|
4598
4611
|
);
|
|
4599
4612
|
// Tu
|
|
4600
4613
|
case "iiiiii":
|
|
4601
|
-
return
|
|
4614
|
+
return N(
|
|
4602
4615
|
s.day(e, {
|
|
4603
4616
|
width: "short",
|
|
4604
4617
|
context: "formatting"
|
|
@@ -4611,7 +4624,7 @@ class ds extends x {
|
|
|
4611
4624
|
// Tuesday
|
|
4612
4625
|
case "iiii":
|
|
4613
4626
|
default:
|
|
4614
|
-
return
|
|
4627
|
+
return N(
|
|
4615
4628
|
s.day(e, {
|
|
4616
4629
|
width: "wide",
|
|
4617
4630
|
context: "formatting"
|
|
@@ -4772,7 +4785,7 @@ class ms extends x {
|
|
|
4772
4785
|
case "ho":
|
|
4773
4786
|
return s.ordinalNumber(e, { unit: "hour" });
|
|
4774
4787
|
default:
|
|
4775
|
-
return
|
|
4788
|
+
return E(r.length, e);
|
|
4776
4789
|
}
|
|
4777
4790
|
}
|
|
4778
4791
|
validate(e, r) {
|
|
@@ -4796,7 +4809,7 @@ class ps extends x {
|
|
|
4796
4809
|
case "Ho":
|
|
4797
4810
|
return s.ordinalNumber(e, { unit: "hour" });
|
|
4798
4811
|
default:
|
|
4799
|
-
return
|
|
4812
|
+
return E(r.length, e);
|
|
4800
4813
|
}
|
|
4801
4814
|
}
|
|
4802
4815
|
validate(e, r) {
|
|
@@ -4819,7 +4832,7 @@ class ys extends x {
|
|
|
4819
4832
|
case "Ko":
|
|
4820
4833
|
return s.ordinalNumber(e, { unit: "hour" });
|
|
4821
4834
|
default:
|
|
4822
|
-
return
|
|
4835
|
+
return E(r.length, e);
|
|
4823
4836
|
}
|
|
4824
4837
|
}
|
|
4825
4838
|
validate(e, r) {
|
|
@@ -4842,7 +4855,7 @@ class gs extends x {
|
|
|
4842
4855
|
case "ko":
|
|
4843
4856
|
return s.ordinalNumber(e, { unit: "hour" });
|
|
4844
4857
|
default:
|
|
4845
|
-
return
|
|
4858
|
+
return E(r.length, e);
|
|
4846
4859
|
}
|
|
4847
4860
|
}
|
|
4848
4861
|
validate(e, r) {
|
|
@@ -4866,7 +4879,7 @@ class _s extends x {
|
|
|
4866
4879
|
case "mo":
|
|
4867
4880
|
return s.ordinalNumber(e, { unit: "minute" });
|
|
4868
4881
|
default:
|
|
4869
|
-
return
|
|
4882
|
+
return E(r.length, e);
|
|
4870
4883
|
}
|
|
4871
4884
|
}
|
|
4872
4885
|
validate(e, r) {
|
|
@@ -4889,7 +4902,7 @@ class vs extends x {
|
|
|
4889
4902
|
case "so":
|
|
4890
4903
|
return s.ordinalNumber(e, { unit: "second" });
|
|
4891
4904
|
default:
|
|
4892
|
-
return
|
|
4905
|
+
return E(r.length, e);
|
|
4893
4906
|
}
|
|
4894
4907
|
}
|
|
4895
4908
|
validate(e, r) {
|
|
@@ -4907,7 +4920,7 @@ class ws extends x {
|
|
|
4907
4920
|
}
|
|
4908
4921
|
parse(e, r) {
|
|
4909
4922
|
const s = (a) => Math.trunc(a * Math.pow(10, -r.length + 3));
|
|
4910
|
-
return E(
|
|
4923
|
+
return N(E(r.length, e), s);
|
|
4911
4924
|
}
|
|
4912
4925
|
set(e, r, s) {
|
|
4913
4926
|
return e.setMilliseconds(s), e;
|
|
@@ -4923,28 +4936,28 @@ class bs extends x {
|
|
|
4923
4936
|
switch (r) {
|
|
4924
4937
|
case "X":
|
|
4925
4938
|
return V(
|
|
4926
|
-
|
|
4939
|
+
$.basicOptionalMinutes,
|
|
4927
4940
|
e
|
|
4928
4941
|
);
|
|
4929
4942
|
case "XX":
|
|
4930
|
-
return V(
|
|
4943
|
+
return V($.basic, e);
|
|
4931
4944
|
case "XXXX":
|
|
4932
4945
|
return V(
|
|
4933
|
-
|
|
4946
|
+
$.basicOptionalSeconds,
|
|
4934
4947
|
e
|
|
4935
4948
|
);
|
|
4936
4949
|
case "XXXXX":
|
|
4937
4950
|
return V(
|
|
4938
|
-
|
|
4951
|
+
$.extendedOptionalSeconds,
|
|
4939
4952
|
e
|
|
4940
4953
|
);
|
|
4941
4954
|
case "XXX":
|
|
4942
4955
|
default:
|
|
4943
|
-
return V(
|
|
4956
|
+
return V($.extended, e);
|
|
4944
4957
|
}
|
|
4945
4958
|
}
|
|
4946
4959
|
set(e, r, s) {
|
|
4947
|
-
return r.timestampIsSet ? e :
|
|
4960
|
+
return r.timestampIsSet ? e : C(
|
|
4948
4961
|
e,
|
|
4949
4962
|
e.getTime() - xt(e) - s
|
|
4950
4963
|
);
|
|
@@ -4960,28 +4973,28 @@ class xs extends x {
|
|
|
4960
4973
|
switch (r) {
|
|
4961
4974
|
case "x":
|
|
4962
4975
|
return V(
|
|
4963
|
-
|
|
4976
|
+
$.basicOptionalMinutes,
|
|
4964
4977
|
e
|
|
4965
4978
|
);
|
|
4966
4979
|
case "xx":
|
|
4967
|
-
return V(
|
|
4980
|
+
return V($.basic, e);
|
|
4968
4981
|
case "xxxx":
|
|
4969
4982
|
return V(
|
|
4970
|
-
|
|
4983
|
+
$.basicOptionalSeconds,
|
|
4971
4984
|
e
|
|
4972
4985
|
);
|
|
4973
4986
|
case "xxxxx":
|
|
4974
4987
|
return V(
|
|
4975
|
-
|
|
4988
|
+
$.extendedOptionalSeconds,
|
|
4976
4989
|
e
|
|
4977
4990
|
);
|
|
4978
4991
|
case "xxx":
|
|
4979
4992
|
default:
|
|
4980
|
-
return V(
|
|
4993
|
+
return V($.extended, e);
|
|
4981
4994
|
}
|
|
4982
4995
|
}
|
|
4983
4996
|
set(e, r, s) {
|
|
4984
|
-
return r.timestampIsSet ? e :
|
|
4997
|
+
return r.timestampIsSet ? e : C(
|
|
4985
4998
|
e,
|
|
4986
4999
|
e.getTime() - xt(e) - s
|
|
4987
5000
|
);
|
|
@@ -4997,7 +5010,7 @@ class ks extends x {
|
|
|
4997
5010
|
return Pt(e);
|
|
4998
5011
|
}
|
|
4999
5012
|
set(e, r, s) {
|
|
5000
|
-
return [
|
|
5013
|
+
return [C(e, s * 1e3), { timestampIsSet: !0 }];
|
|
5001
5014
|
}
|
|
5002
5015
|
}
|
|
5003
5016
|
class Ts extends x {
|
|
@@ -5010,7 +5023,7 @@ class Ts extends x {
|
|
|
5010
5023
|
return Pt(e);
|
|
5011
5024
|
}
|
|
5012
5025
|
set(e, r, s) {
|
|
5013
|
-
return [
|
|
5026
|
+
return [C(e, s), { timestampIsSet: !0 }];
|
|
5014
5027
|
}
|
|
5015
5028
|
}
|
|
5016
5029
|
const Os = {
|
|
@@ -5045,29 +5058,29 @@ const Os = {
|
|
|
5045
5058
|
x: new xs(),
|
|
5046
5059
|
t: new ks(),
|
|
5047
5060
|
T: new Ts()
|
|
5048
|
-
}, Ps = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,
|
|
5049
|
-
function
|
|
5061
|
+
}, Ps = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Es = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ms = /^'([^]*?)'?$/, Ns = /''/g, Cs = /\S/, Ds = /[a-zA-Z]/;
|
|
5062
|
+
function Ws(n, t, e, r) {
|
|
5050
5063
|
var Ge, Je, Ke, et;
|
|
5051
|
-
const s = () =>
|
|
5064
|
+
const s = () => C(e, NaN), a = jn(), i = a.locale ?? On, o = a.firstWeekContainsDate ?? ((Je = (Ge = a.locale) == null ? void 0 : Ge.options) == null ? void 0 : Je.firstWeekContainsDate) ?? 1, d = a.weekStartsOn ?? ((et = (Ke = a.locale) == null ? void 0 : Ke.options) == null ? void 0 : et.weekStartsOn) ?? 0;
|
|
5052
5065
|
if (!t)
|
|
5053
|
-
return n ? s() :
|
|
5066
|
+
return n ? s() : I(e, r == null ? void 0 : r.in);
|
|
5054
5067
|
const c = {
|
|
5055
5068
|
firstWeekContainsDate: o,
|
|
5056
5069
|
weekStartsOn: d,
|
|
5057
5070
|
locale: i
|
|
5058
|
-
}, m = [new Vn(r == null ? void 0 : r.in, e)], k = t.match(
|
|
5071
|
+
}, m = [new Vn(r == null ? void 0 : r.in, e)], k = t.match(Es).map((b) => {
|
|
5059
5072
|
const P = b[0];
|
|
5060
5073
|
if (P in ct) {
|
|
5061
|
-
const
|
|
5062
|
-
return
|
|
5074
|
+
const S = ct[P];
|
|
5075
|
+
return S(b, i.formatLong);
|
|
5063
5076
|
}
|
|
5064
5077
|
return b;
|
|
5065
5078
|
}).join("").match(Ps), R = [];
|
|
5066
5079
|
for (let b of k) {
|
|
5067
|
-
|
|
5068
|
-
const P = b[0],
|
|
5069
|
-
if (
|
|
5070
|
-
const { incompatibleTokens: tt } =
|
|
5080
|
+
Zn(b) && ut(b, t, n), An(b) && ut(b, t, n);
|
|
5081
|
+
const P = b[0], S = Os[P];
|
|
5082
|
+
if (S) {
|
|
5083
|
+
const { incompatibleTokens: tt } = S;
|
|
5071
5084
|
if (Array.isArray(tt)) {
|
|
5072
5085
|
const rt = R.find(
|
|
5073
5086
|
(nt) => tt.includes(nt.token) || nt.token === P
|
|
@@ -5076,37 +5089,37 @@ function Ys(n, t, e, r) {
|
|
|
5076
5089
|
throw new RangeError(
|
|
5077
5090
|
`The format string mustn't contain \`${rt.fullToken}\` and \`${b}\` at the same time`
|
|
5078
5091
|
);
|
|
5079
|
-
} else if (
|
|
5092
|
+
} else if (S.incompatibleTokens === "*" && R.length > 0)
|
|
5080
5093
|
throw new RangeError(
|
|
5081
5094
|
`The format string mustn't contain \`${b}\` and any other token at the same time`
|
|
5082
5095
|
);
|
|
5083
5096
|
R.push({ token: P, fullToken: b });
|
|
5084
|
-
const
|
|
5097
|
+
const Se = S.run(
|
|
5085
5098
|
n,
|
|
5086
5099
|
b,
|
|
5087
5100
|
i.match,
|
|
5088
5101
|
c
|
|
5089
5102
|
);
|
|
5090
|
-
if (
|
|
5103
|
+
if (!Se)
|
|
5091
5104
|
return s();
|
|
5092
|
-
m.push(
|
|
5105
|
+
m.push(Se.setter), n = Se.rest;
|
|
5093
5106
|
} else {
|
|
5094
|
-
if (P.match(
|
|
5107
|
+
if (P.match(Ds))
|
|
5095
5108
|
throw new RangeError(
|
|
5096
5109
|
"Format string contains an unescaped latin alphabet character `" + P + "`"
|
|
5097
5110
|
);
|
|
5098
|
-
if (b === "''" ? b = "'" : P === "'" && (b =
|
|
5111
|
+
if (b === "''" ? b = "'" : P === "'" && (b = Is(b)), n.indexOf(b) === 0)
|
|
5099
5112
|
n = n.slice(b.length);
|
|
5100
5113
|
else
|
|
5101
5114
|
return s();
|
|
5102
5115
|
}
|
|
5103
5116
|
}
|
|
5104
|
-
if (n.length > 0 &&
|
|
5117
|
+
if (n.length > 0 && Cs.test(n))
|
|
5105
5118
|
return s();
|
|
5106
|
-
const j = m.map((b) => b.priority).sort((b, P) => P - b).filter((b, P,
|
|
5107
|
-
(b) => m.filter((P) => P.priority === b).sort((P,
|
|
5119
|
+
const j = m.map((b) => b.priority).sort((b, P) => P - b).filter((b, P, S) => S.indexOf(b) === P).map(
|
|
5120
|
+
(b) => m.filter((P) => P.priority === b).sort((P, S) => S.subPriority - P.subPriority)
|
|
5108
5121
|
).map((b) => b[0]);
|
|
5109
|
-
let H =
|
|
5122
|
+
let H = I(e, r == null ? void 0 : r.in);
|
|
5110
5123
|
if (isNaN(+H)) return s();
|
|
5111
5124
|
const Xe = {};
|
|
5112
5125
|
for (const b of j) {
|
|
@@ -5117,34 +5130,35 @@ function Ys(n, t, e, r) {
|
|
|
5117
5130
|
}
|
|
5118
5131
|
return H;
|
|
5119
5132
|
}
|
|
5120
|
-
function
|
|
5121
|
-
return n.match(Ms)[1].replace(
|
|
5133
|
+
function Is(n) {
|
|
5134
|
+
return n.match(Ms)[1].replace(Ns, "'");
|
|
5122
5135
|
}
|
|
5123
5136
|
export {
|
|
5137
|
+
Zs as V,
|
|
5124
5138
|
bt as a,
|
|
5125
|
-
|
|
5126
|
-
|
|
5139
|
+
Ce as b,
|
|
5140
|
+
C as c,
|
|
5127
5141
|
kt as d,
|
|
5128
5142
|
Fr as e,
|
|
5129
5143
|
Mn as f,
|
|
5130
5144
|
xt as g,
|
|
5131
5145
|
Pn as h,
|
|
5132
|
-
|
|
5146
|
+
Ls as i,
|
|
5133
5147
|
On as j,
|
|
5134
|
-
|
|
5148
|
+
Zn as k,
|
|
5135
5149
|
ct as l,
|
|
5136
|
-
|
|
5137
|
-
|
|
5150
|
+
js as m,
|
|
5151
|
+
An as n,
|
|
5138
5152
|
Ve as o,
|
|
5139
|
-
|
|
5153
|
+
Ws as p,
|
|
5140
5154
|
fe as q,
|
|
5141
5155
|
ln as r,
|
|
5142
5156
|
ee as s,
|
|
5143
|
-
|
|
5157
|
+
I as t,
|
|
5144
5158
|
he as u,
|
|
5145
5159
|
qr as v,
|
|
5146
5160
|
ut as w,
|
|
5147
5161
|
le as x,
|
|
5148
|
-
|
|
5162
|
+
Rs as z
|
|
5149
5163
|
};
|
|
5150
|
-
//# sourceMappingURL=parse-
|
|
5164
|
+
//# sourceMappingURL=parse-C_80L3wX.js.map
|