@scbt-ecom/ui 0.74.1 → 0.75.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/index-BcOxdcOI.js +561 -0
- package/dist/{index-CrR6G9lz.js.map → index-BcOxdcOI.js.map} +1 -1
- package/dist/{index-B6MrMsbc.js → index-DRIZ5Qrl.js} +4897 -4883
- package/dist/{index-B6MrMsbc.js.map → index-DRIZ5Qrl.js.map} +1 -1
- package/dist/shared/ui/formElements/controlled/slider/SliderControl.d.ts +1 -1
- package/dist/shared/ui/formElements/uncontrolled/index.d.ts +1 -1
- package/dist/shared/ui/formElements/uncontrolled/slider/index.d.ts +1 -0
- package/dist/shared/ui/formElements/uncontrolled/slider/model/index.d.ts +2 -0
- package/dist/shared/ui/formElements/uncontrolled/slider/model/types.d.ts +10 -0
- package/dist/shared/ui/formElements/uncontrolled/slider/ui/Slider.d.ts +3 -1
- package/dist/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/SliderAlgorithmic.d.ts +1 -1
- package/dist/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/SliderMarks.d.ts +1 -1
- package/dist/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/SliderStep.d.ts +1 -1
- package/dist/ui.js +3 -3
- package/dist/{utils-k3uzuyeN.js → utils-CaWgHX_C.js} +1224 -1256
- package/dist/utils-CaWgHX_C.js.map +1 -0
- package/dist/validation.js +47 -47
- package/dist/validation.js.map +1 -1
- package/dist/widget.js +953 -891
- package/dist/widget.js.map +1 -1
- package/dist/widgets/calculator/ui/calculatorFields/CalculatorFields.d.ts +4 -1
- package/dist/widgets/calculator/ui/calculatorFields/hooks/index.d.ts +1 -0
- package/dist/widgets/calculator/ui/calculatorFields/hooks/useAdditionalSlider.d.ts +19 -0
- package/dist/widgets/calculator/ui/calculatorFields/ui/AdditionalSlider.d.ts +8 -0
- package/dist/widgets/calculator/ui/calculatorFields/ui/FieldsGroup.d.ts +6 -1
- package/dist/widgets/calculator/ui/calculatorFields/ui/index.d.ts +1 -0
- package/dist/widgets/model/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/index-CrR6G9lz.js +0 -446
- package/dist/utils-k3uzuyeN.js.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { c as
|
|
1
|
+
var Ot = Object.defineProperty;
|
|
2
|
+
var Pt = (n, t, e) => t in n ? Ot(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var f = (n, t, e) => Pt(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { c as Ae } from "./typeGuards-CSiImkUY.js";
|
|
5
5
|
var w;
|
|
6
6
|
(function(n) {
|
|
7
|
-
n.assertEqual = (a) =>
|
|
7
|
+
n.assertEqual = (a) => {
|
|
8
|
+
};
|
|
8
9
|
function t(a) {
|
|
9
10
|
}
|
|
10
11
|
n.assertIs = t;
|
|
@@ -32,21 +33,21 @@ var w;
|
|
|
32
33
|
for (const i of a)
|
|
33
34
|
if (s(i))
|
|
34
35
|
return i;
|
|
35
|
-
}, n.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && isFinite(a) && Math.floor(a) === a;
|
|
36
|
+
}, n.isInteger = typeof Number.isInteger == "function" ? (a) => Number.isInteger(a) : (a) => typeof a == "number" && Number.isFinite(a) && Math.floor(a) === a;
|
|
36
37
|
function r(a, s = " | ") {
|
|
37
38
|
return a.map((i) => typeof i == "string" ? `'${i}'` : i).join(s);
|
|
38
39
|
}
|
|
39
40
|
n.joinValues = r, n.jsonStringifyReplacer = (a, s) => typeof s == "bigint" ? s.toString() : s;
|
|
40
41
|
})(w || (w = {}));
|
|
41
|
-
var
|
|
42
|
+
var tt;
|
|
42
43
|
(function(n) {
|
|
43
44
|
n.mergeShapes = (t, e) => ({
|
|
44
45
|
...t,
|
|
45
46
|
...e
|
|
46
47
|
// second overwrites first
|
|
47
48
|
});
|
|
48
|
-
})(
|
|
49
|
-
const
|
|
49
|
+
})(tt || (tt = {}));
|
|
50
|
+
const h = w.arrayToEnum([
|
|
50
51
|
"string",
|
|
51
52
|
"nan",
|
|
52
53
|
"number",
|
|
@@ -67,28 +68,28 @@ const f = w.arrayToEnum([
|
|
|
67
68
|
"never",
|
|
68
69
|
"map",
|
|
69
70
|
"set"
|
|
70
|
-
]),
|
|
71
|
+
]), Q = (n) => {
|
|
71
72
|
switch (typeof n) {
|
|
72
73
|
case "undefined":
|
|
73
|
-
return
|
|
74
|
+
return h.undefined;
|
|
74
75
|
case "string":
|
|
75
|
-
return
|
|
76
|
+
return h.string;
|
|
76
77
|
case "number":
|
|
77
|
-
return isNaN(n) ?
|
|
78
|
+
return Number.isNaN(n) ? h.nan : h.number;
|
|
78
79
|
case "boolean":
|
|
79
|
-
return
|
|
80
|
+
return h.boolean;
|
|
80
81
|
case "function":
|
|
81
|
-
return
|
|
82
|
+
return h.function;
|
|
82
83
|
case "bigint":
|
|
83
|
-
return
|
|
84
|
+
return h.bigint;
|
|
84
85
|
case "symbol":
|
|
85
|
-
return
|
|
86
|
+
return h.symbol;
|
|
86
87
|
case "object":
|
|
87
|
-
return Array.isArray(n) ?
|
|
88
|
+
return Array.isArray(n) ? h.array : n === null ? h.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? h.promise : typeof Map < "u" && n instanceof Map ? h.map : typeof Set < "u" && n instanceof Set ? h.set : typeof Date < "u" && n instanceof Date ? h.date : h.object;
|
|
88
89
|
default:
|
|
89
|
-
return
|
|
90
|
+
return h.unknown;
|
|
90
91
|
}
|
|
91
|
-
},
|
|
92
|
+
}, c = w.arrayToEnum([
|
|
92
93
|
"invalid_type",
|
|
93
94
|
"invalid_literal",
|
|
94
95
|
"custom",
|
|
@@ -105,8 +106,8 @@ const f = w.arrayToEnum([
|
|
|
105
106
|
"invalid_intersection_types",
|
|
106
107
|
"not_multiple_of",
|
|
107
108
|
"not_finite"
|
|
108
|
-
]),
|
|
109
|
-
class
|
|
109
|
+
]), Un = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
110
|
+
class Z extends Error {
|
|
110
111
|
get errors() {
|
|
111
112
|
return this.issues;
|
|
112
113
|
}
|
|
@@ -135,15 +136,15 @@ class R extends Error {
|
|
|
135
136
|
else {
|
|
136
137
|
let o = r, u = 0;
|
|
137
138
|
for (; u < i.path.length; ) {
|
|
138
|
-
const
|
|
139
|
-
u === i.path.length - 1 ? (o[
|
|
139
|
+
const d = i.path[u];
|
|
140
|
+
u === i.path.length - 1 ? (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(e(i))) : o[d] = o[d] || { _errors: [] }, o = o[d], u++;
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
};
|
|
143
144
|
return a(this), r;
|
|
144
145
|
}
|
|
145
146
|
static assert(t) {
|
|
146
|
-
if (!(t instanceof
|
|
147
|
+
if (!(t instanceof Z))
|
|
147
148
|
throw new Error(`Not a ZodError: ${t}`);
|
|
148
149
|
}
|
|
149
150
|
toString() {
|
|
@@ -165,56 +166,56 @@ class R extends Error {
|
|
|
165
166
|
return this.flatten();
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
|
-
|
|
169
|
-
const
|
|
169
|
+
Z.create = (n) => new Z(n);
|
|
170
|
+
const he = (n, t) => {
|
|
170
171
|
let e;
|
|
171
172
|
switch (n.code) {
|
|
172
|
-
case
|
|
173
|
-
n.received ===
|
|
173
|
+
case c.invalid_type:
|
|
174
|
+
n.received === h.undefined ? e = "Required" : e = `Expected ${n.expected}, received ${n.received}`;
|
|
174
175
|
break;
|
|
175
|
-
case
|
|
176
|
+
case c.invalid_literal:
|
|
176
177
|
e = `Invalid literal value, expected ${JSON.stringify(n.expected, w.jsonStringifyReplacer)}`;
|
|
177
178
|
break;
|
|
178
|
-
case
|
|
179
|
+
case c.unrecognized_keys:
|
|
179
180
|
e = `Unrecognized key(s) in object: ${w.joinValues(n.keys, ", ")}`;
|
|
180
181
|
break;
|
|
181
|
-
case
|
|
182
|
+
case c.invalid_union:
|
|
182
183
|
e = "Invalid input";
|
|
183
184
|
break;
|
|
184
|
-
case
|
|
185
|
+
case c.invalid_union_discriminator:
|
|
185
186
|
e = `Invalid discriminator value. Expected ${w.joinValues(n.options)}`;
|
|
186
187
|
break;
|
|
187
|
-
case
|
|
188
|
+
case c.invalid_enum_value:
|
|
188
189
|
e = `Invalid enum value. Expected ${w.joinValues(n.options)}, received '${n.received}'`;
|
|
189
190
|
break;
|
|
190
|
-
case
|
|
191
|
+
case c.invalid_arguments:
|
|
191
192
|
e = "Invalid function arguments";
|
|
192
193
|
break;
|
|
193
|
-
case
|
|
194
|
+
case c.invalid_return_type:
|
|
194
195
|
e = "Invalid function return type";
|
|
195
196
|
break;
|
|
196
|
-
case
|
|
197
|
+
case c.invalid_date:
|
|
197
198
|
e = "Invalid date";
|
|
198
199
|
break;
|
|
199
|
-
case
|
|
200
|
+
case c.invalid_string:
|
|
200
201
|
typeof n.validation == "object" ? "includes" in n.validation ? (e = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (e = `${e} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? e = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? e = `Invalid input: must end with "${n.validation.endsWith}"` : w.assertNever(n.validation) : n.validation !== "regex" ? e = `Invalid ${n.validation}` : e = "Invalid";
|
|
201
202
|
break;
|
|
202
|
-
case
|
|
203
|
+
case c.too_small:
|
|
203
204
|
n.type === "array" ? e = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? e = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? e = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? e = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : e = "Invalid input";
|
|
204
205
|
break;
|
|
205
|
-
case
|
|
206
|
+
case c.too_big:
|
|
206
207
|
n.type === "array" ? e = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "less than"} ${n.maximum} element(s)` : n.type === "string" ? e = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "under"} ${n.maximum} character(s)` : n.type === "number" ? e = `Number must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "bigint" ? e = `BigInt must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "date" ? e = `Date must be ${n.exact ? "exactly" : n.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(n.maximum))}` : e = "Invalid input";
|
|
207
208
|
break;
|
|
208
|
-
case
|
|
209
|
+
case c.custom:
|
|
209
210
|
e = "Invalid input";
|
|
210
211
|
break;
|
|
211
|
-
case
|
|
212
|
+
case c.invalid_intersection_types:
|
|
212
213
|
e = "Intersection results could not be merged";
|
|
213
214
|
break;
|
|
214
|
-
case
|
|
215
|
+
case c.not_multiple_of:
|
|
215
216
|
e = `Number must be a multiple of ${n.multipleOf}`;
|
|
216
217
|
break;
|
|
217
|
-
case
|
|
218
|
+
case c.not_finite:
|
|
218
219
|
e = "Number must be finite";
|
|
219
220
|
break;
|
|
220
221
|
default:
|
|
@@ -222,14 +223,14 @@ const ce = (n, t) => {
|
|
|
222
223
|
}
|
|
223
224
|
return { message: e };
|
|
224
225
|
};
|
|
225
|
-
let
|
|
226
|
-
function
|
|
227
|
-
|
|
226
|
+
let dt = he;
|
|
227
|
+
function Xn(n) {
|
|
228
|
+
dt = n;
|
|
228
229
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
230
|
+
function We() {
|
|
231
|
+
return dt;
|
|
231
232
|
}
|
|
232
|
-
const
|
|
233
|
+
const Ye = (n) => {
|
|
233
234
|
const { data: t, path: e, errorMaps: r, issueData: a } = n, s = [...e, ...a.path || []], i = {
|
|
234
235
|
...a,
|
|
235
236
|
path: s
|
|
@@ -241,17 +242,17 @@ const Ie = (n) => {
|
|
|
241
242
|
message: a.message
|
|
242
243
|
};
|
|
243
244
|
let o = "";
|
|
244
|
-
const u = r.filter((
|
|
245
|
-
for (const
|
|
246
|
-
o =
|
|
245
|
+
const u = r.filter((d) => !!d).slice().reverse();
|
|
246
|
+
for (const d of u)
|
|
247
|
+
o = d(i, { data: t, defaultError: o }).message;
|
|
247
248
|
return {
|
|
248
249
|
...a,
|
|
249
250
|
path: s,
|
|
250
251
|
message: o
|
|
251
252
|
};
|
|
252
|
-
},
|
|
253
|
+
}, Gn = [];
|
|
253
254
|
function l(n, t) {
|
|
254
|
-
const e =
|
|
255
|
+
const e = We(), r = Ye({
|
|
255
256
|
issueData: t,
|
|
256
257
|
data: n.data,
|
|
257
258
|
path: n.path,
|
|
@@ -262,13 +263,13 @@ function l(n, t) {
|
|
|
262
263
|
// then schema-bound map if available
|
|
263
264
|
e,
|
|
264
265
|
// then global override map
|
|
265
|
-
e ===
|
|
266
|
+
e === he ? void 0 : he
|
|
266
267
|
// then global default map
|
|
267
268
|
].filter((a) => !!a)
|
|
268
269
|
});
|
|
269
270
|
n.common.issues.push(r);
|
|
270
271
|
}
|
|
271
|
-
class
|
|
272
|
+
class I {
|
|
272
273
|
constructor() {
|
|
273
274
|
this.value = "valid";
|
|
274
275
|
}
|
|
@@ -296,7 +297,7 @@ class N {
|
|
|
296
297
|
value: i
|
|
297
298
|
});
|
|
298
299
|
}
|
|
299
|
-
return
|
|
300
|
+
return I.mergeObjectSync(t, r);
|
|
300
301
|
}
|
|
301
302
|
static mergeObjectSync(t, e) {
|
|
302
303
|
const r = {};
|
|
@@ -311,30 +312,31 @@ class N {
|
|
|
311
312
|
}
|
|
312
313
|
const g = Object.freeze({
|
|
313
314
|
status: "aborted"
|
|
314
|
-
}),
|
|
315
|
-
|
|
316
|
-
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");
|
|
317
|
-
return t.get(n);
|
|
318
|
-
}
|
|
319
|
-
function ht(n, t, e, r, a) {
|
|
320
|
-
if (typeof t == "function" ? n !== t || !0 : !t.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
321
|
-
return t.set(n, e), e;
|
|
322
|
-
}
|
|
323
|
-
var p;
|
|
315
|
+
}), ue = (n) => ({ status: "dirty", value: n }), R = (n) => ({ status: "valid", value: n }), rt = (n) => n.status === "aborted", nt = (n) => n.status === "dirty", ne = (n) => n.status === "valid", ge = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
316
|
+
var m;
|
|
324
317
|
(function(n) {
|
|
325
318
|
n.errToObj = (t) => typeof t == "string" ? { message: t } : t || {}, n.toString = (t) => typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
326
|
-
})(
|
|
327
|
-
var
|
|
328
|
-
|
|
319
|
+
})(m || (m = {}));
|
|
320
|
+
var _e = function(n, t, e, r) {
|
|
321
|
+
if (e === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
322
|
+
if (typeof t == "function" ? n !== t || !r : !t.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
323
|
+
return e === "m" ? r : e === "a" ? r.call(n) : r ? r.value : t.get(n);
|
|
324
|
+
}, lt = function(n, t, e, r, a) {
|
|
325
|
+
if (r === "m") throw new TypeError("Private method is not writable");
|
|
326
|
+
if (r === "a" && !a) throw new TypeError("Private accessor was defined without a setter");
|
|
327
|
+
if (typeof t == "function" ? n !== t || !a : !t.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
328
|
+
return r === "a" ? a.call(n, e) : a ? a.value = e : t.set(n, e), e;
|
|
329
|
+
}, de, le;
|
|
330
|
+
class S {
|
|
329
331
|
constructor(t, e, r, a) {
|
|
330
332
|
this._cachedPath = [], this.parent = t, this.data = e, this._path = r, this._key = a;
|
|
331
333
|
}
|
|
332
334
|
get path() {
|
|
333
|
-
return this._cachedPath.length || (this._key
|
|
335
|
+
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
334
336
|
}
|
|
335
337
|
}
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
+
const at = (n, t) => {
|
|
339
|
+
if (ne(t))
|
|
338
340
|
return { success: !0, data: t.value };
|
|
339
341
|
if (!n.common.issues.length)
|
|
340
342
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -343,35 +345,34 @@ const st = (n, t) => {
|
|
|
343
345
|
get error() {
|
|
344
346
|
if (this._error)
|
|
345
347
|
return this._error;
|
|
346
|
-
const e = new
|
|
348
|
+
const e = new Z(n.common.issues);
|
|
347
349
|
return this._error = e, this._error;
|
|
348
350
|
}
|
|
349
351
|
};
|
|
350
352
|
};
|
|
351
|
-
function
|
|
353
|
+
function _(n) {
|
|
352
354
|
if (!n)
|
|
353
355
|
return {};
|
|
354
356
|
const { errorMap: t, invalid_type_error: e, required_error: r, description: a } = n;
|
|
355
357
|
if (t && (e || r))
|
|
356
358
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
357
359
|
return t ? { errorMap: t, description: a } : { errorMap: (i, o) => {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
return i.code === "invalid_enum_value" ? { message: m ?? o.defaultError } : typeof o.data > "u" ? { message: (u = m ?? r) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = m ?? e) !== null && c !== void 0 ? c : o.defaultError };
|
|
360
|
+
const { message: u } = n;
|
|
361
|
+
return i.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: u ?? r ?? o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: u ?? e ?? o.defaultError };
|
|
361
362
|
}, description: a };
|
|
362
363
|
}
|
|
363
|
-
class
|
|
364
|
+
class v {
|
|
364
365
|
get description() {
|
|
365
366
|
return this._def.description;
|
|
366
367
|
}
|
|
367
368
|
_getType(t) {
|
|
368
|
-
return
|
|
369
|
+
return Q(t.data);
|
|
369
370
|
}
|
|
370
371
|
_getOrReturnCtx(t, e) {
|
|
371
372
|
return e || {
|
|
372
373
|
common: t.parent.common,
|
|
373
374
|
data: t.data,
|
|
374
|
-
parsedType:
|
|
375
|
+
parsedType: Q(t.data),
|
|
375
376
|
schemaErrorMap: this._def.errorMap,
|
|
376
377
|
path: t.path,
|
|
377
378
|
parent: t.parent
|
|
@@ -379,11 +380,11 @@ class _ {
|
|
|
379
380
|
}
|
|
380
381
|
_processInputParams(t) {
|
|
381
382
|
return {
|
|
382
|
-
status: new
|
|
383
|
+
status: new I(),
|
|
383
384
|
ctx: {
|
|
384
385
|
common: t.parent.common,
|
|
385
386
|
data: t.data,
|
|
386
|
-
parsedType:
|
|
387
|
+
parsedType: Q(t.data),
|
|
387
388
|
schemaErrorMap: this._def.errorMap,
|
|
388
389
|
path: t.path,
|
|
389
390
|
parent: t.parent
|
|
@@ -392,7 +393,7 @@ class _ {
|
|
|
392
393
|
}
|
|
393
394
|
_parseSync(t) {
|
|
394
395
|
const e = this._parse(t);
|
|
395
|
-
if (
|
|
396
|
+
if (ge(e))
|
|
396
397
|
throw new Error("Synchronous parse encountered promise.");
|
|
397
398
|
return e;
|
|
398
399
|
}
|
|
@@ -407,24 +408,23 @@ class _ {
|
|
|
407
408
|
throw r.error;
|
|
408
409
|
}
|
|
409
410
|
safeParse(t, e) {
|
|
410
|
-
|
|
411
|
-
const a = {
|
|
411
|
+
const r = {
|
|
412
412
|
common: {
|
|
413
413
|
issues: [],
|
|
414
|
-
async: (
|
|
414
|
+
async: (e == null ? void 0 : e.async) ?? !1,
|
|
415
415
|
contextualErrorMap: e == null ? void 0 : e.errorMap
|
|
416
416
|
},
|
|
417
417
|
path: (e == null ? void 0 : e.path) || [],
|
|
418
418
|
schemaErrorMap: this._def.errorMap,
|
|
419
419
|
parent: null,
|
|
420
420
|
data: t,
|
|
421
|
-
parsedType:
|
|
422
|
-
},
|
|
423
|
-
return
|
|
421
|
+
parsedType: Q(t)
|
|
422
|
+
}, a = this._parseSync({ data: t, path: r.path, parent: r });
|
|
423
|
+
return at(r, a);
|
|
424
424
|
}
|
|
425
425
|
"~validate"(t) {
|
|
426
|
-
var
|
|
427
|
-
const
|
|
426
|
+
var r, a;
|
|
427
|
+
const e = {
|
|
428
428
|
common: {
|
|
429
429
|
issues: [],
|
|
430
430
|
async: !!this["~standard"].async
|
|
@@ -433,26 +433,26 @@ class _ {
|
|
|
433
433
|
schemaErrorMap: this._def.errorMap,
|
|
434
434
|
parent: null,
|
|
435
435
|
data: t,
|
|
436
|
-
parsedType:
|
|
436
|
+
parsedType: Q(t)
|
|
437
437
|
};
|
|
438
438
|
if (!this["~standard"].async)
|
|
439
439
|
try {
|
|
440
|
-
const s = this._parseSync({ data: t, path: [], parent:
|
|
441
|
-
return
|
|
440
|
+
const s = this._parseSync({ data: t, path: [], parent: e });
|
|
441
|
+
return ne(s) ? {
|
|
442
442
|
value: s.value
|
|
443
443
|
} : {
|
|
444
|
-
issues:
|
|
444
|
+
issues: e.common.issues
|
|
445
445
|
};
|
|
446
446
|
} catch (s) {
|
|
447
|
-
|
|
447
|
+
(a = (r = s == null ? void 0 : s.message) == null ? void 0 : r.toLowerCase()) != null && a.includes("encountered") && (this["~standard"].async = !0), e.common = {
|
|
448
448
|
issues: [],
|
|
449
449
|
async: !0
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
return this._parseAsync({ data: t, path: [], parent:
|
|
452
|
+
return this._parseAsync({ data: t, path: [], parent: e }).then((s) => ne(s) ? {
|
|
453
453
|
value: s.value
|
|
454
454
|
} : {
|
|
455
|
-
issues:
|
|
455
|
+
issues: e.common.issues
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
async parseAsync(t, e) {
|
|
@@ -472,15 +472,15 @@ class _ {
|
|
|
472
472
|
schemaErrorMap: this._def.errorMap,
|
|
473
473
|
parent: null,
|
|
474
474
|
data: t,
|
|
475
|
-
parsedType:
|
|
476
|
-
}, a = this._parse({ data: t, path: r.path, parent: r }), s = await (
|
|
477
|
-
return
|
|
475
|
+
parsedType: Q(t)
|
|
476
|
+
}, a = this._parse({ data: t, path: r.path, parent: r }), s = await (ge(a) ? a : Promise.resolve(a));
|
|
477
|
+
return at(r, s);
|
|
478
478
|
}
|
|
479
479
|
refine(t, e) {
|
|
480
480
|
const r = (a) => typeof e == "string" || typeof e > "u" ? { message: e } : typeof e == "function" ? e(a) : e;
|
|
481
481
|
return this._refinement((a, s) => {
|
|
482
482
|
const i = t(a), o = () => s.addIssue({
|
|
483
|
-
code:
|
|
483
|
+
code: c.custom,
|
|
484
484
|
...r(a)
|
|
485
485
|
});
|
|
486
486
|
return typeof Promise < "u" && i instanceof Promise ? i.then((u) => u ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
@@ -490,7 +490,7 @@ class _ {
|
|
|
490
490
|
return this._refinement((r, a) => t(r) ? !0 : (a.addIssue(typeof e == "function" ? e(r, a) : e), !1));
|
|
491
491
|
}
|
|
492
492
|
_refinement(t) {
|
|
493
|
-
return new
|
|
493
|
+
return new B({
|
|
494
494
|
schema: this,
|
|
495
495
|
typeName: y.ZodEffects,
|
|
496
496
|
effect: { type: "refinement", refinement: t }
|
|
@@ -507,29 +507,29 @@ class _ {
|
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
509
|
optional() {
|
|
510
|
-
return
|
|
510
|
+
return q.create(this, this._def);
|
|
511
511
|
}
|
|
512
512
|
nullable() {
|
|
513
|
-
return
|
|
513
|
+
return ee.create(this, this._def);
|
|
514
514
|
}
|
|
515
515
|
nullish() {
|
|
516
516
|
return this.nullable().optional();
|
|
517
517
|
}
|
|
518
518
|
array() {
|
|
519
|
-
return
|
|
519
|
+
return F.create(this);
|
|
520
520
|
}
|
|
521
521
|
promise() {
|
|
522
|
-
return
|
|
522
|
+
return pe.create(this, this._def);
|
|
523
523
|
}
|
|
524
524
|
or(t) {
|
|
525
|
-
return
|
|
525
|
+
return xe.create([this, t], this._def);
|
|
526
526
|
}
|
|
527
527
|
and(t) {
|
|
528
|
-
return
|
|
528
|
+
return ke.create(this, t, this._def);
|
|
529
529
|
}
|
|
530
530
|
transform(t) {
|
|
531
|
-
return new
|
|
532
|
-
...
|
|
531
|
+
return new B({
|
|
532
|
+
..._(this._def),
|
|
533
533
|
schema: this,
|
|
534
534
|
typeName: y.ZodEffects,
|
|
535
535
|
effect: { type: "transform", transform: t }
|
|
@@ -537,24 +537,24 @@ class _ {
|
|
|
537
537
|
}
|
|
538
538
|
default(t) {
|
|
539
539
|
const e = typeof t == "function" ? t : () => t;
|
|
540
|
-
return new
|
|
541
|
-
...
|
|
540
|
+
return new Me({
|
|
541
|
+
..._(this._def),
|
|
542
542
|
innerType: this,
|
|
543
543
|
defaultValue: e,
|
|
544
544
|
typeName: y.ZodDefault
|
|
545
545
|
});
|
|
546
546
|
}
|
|
547
547
|
brand() {
|
|
548
|
-
return new
|
|
548
|
+
return new pt({
|
|
549
549
|
typeName: y.ZodBranded,
|
|
550
550
|
type: this,
|
|
551
|
-
...
|
|
551
|
+
..._(this._def)
|
|
552
552
|
});
|
|
553
553
|
}
|
|
554
554
|
catch(t) {
|
|
555
555
|
const e = typeof t == "function" ? t : () => t;
|
|
556
|
-
return new
|
|
557
|
-
...
|
|
556
|
+
return new De({
|
|
557
|
+
..._(this._def),
|
|
558
558
|
innerType: this,
|
|
559
559
|
catchValue: e,
|
|
560
560
|
typeName: y.ZodCatch
|
|
@@ -568,10 +568,10 @@ class _ {
|
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
570
|
pipe(t) {
|
|
571
|
-
return
|
|
571
|
+
return Ie.create(this, t);
|
|
572
572
|
}
|
|
573
573
|
readonly() {
|
|
574
|
-
return
|
|
574
|
+
return Ne.create(this);
|
|
575
575
|
}
|
|
576
576
|
isOptional() {
|
|
577
577
|
return this.safeParse(void 0).success;
|
|
@@ -580,55 +580,55 @@ class _ {
|
|
|
580
580
|
return this.safeParse(null).success;
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
|
-
const
|
|
584
|
-
let
|
|
585
|
-
const
|
|
586
|
-
function
|
|
583
|
+
const Ct = /^c[^\s-]{8,}$/i, Mt = /^[0-9a-z]+$/, Dt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Nt = /^[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, Et = /^[a-z0-9_-]{21}$/i, It = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Rt = /^[-+]?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)?)??$/, At = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Zt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
584
|
+
let Ze;
|
|
585
|
+
const jt = /^(?:(?: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])$/, Wt = /^(?:(?: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])$/, Yt = /^(([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]))$/, $t = /^(([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])$/, Lt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Ft = /^([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])))", St = new RegExp(`^${ft}$`);
|
|
586
|
+
function ht(n) {
|
|
587
587
|
let t = "[0-5]\\d";
|
|
588
588
|
n.precision ? t = `${t}\\.\\d{${n.precision}}` : n.precision == null && (t = `${t}(\\.\\d+)?`);
|
|
589
589
|
const e = n.precision ? "+" : "?";
|
|
590
590
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${e}`;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
593
|
-
return new RegExp(`^${
|
|
592
|
+
function Vt(n) {
|
|
593
|
+
return new RegExp(`^${ht(n)}$`);
|
|
594
594
|
}
|
|
595
|
-
function
|
|
596
|
-
let t = `${
|
|
595
|
+
function zt(n) {
|
|
596
|
+
let t = `${ft}T${ht(n)}`;
|
|
597
597
|
const e = [];
|
|
598
598
|
return e.push(n.local ? "Z?" : "Z"), n.offset && e.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${e.join("|")})`, new RegExp(`^${t}$`);
|
|
599
599
|
}
|
|
600
|
-
function
|
|
601
|
-
return !!((t === "v4" || !t) &&
|
|
600
|
+
function qt(n, t) {
|
|
601
|
+
return !!((t === "v4" || !t) && jt.test(n) || (t === "v6" || !t) && Yt.test(n));
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
if (!
|
|
603
|
+
function Ht(n, t) {
|
|
604
|
+
if (!It.test(n))
|
|
605
605
|
return !1;
|
|
606
606
|
try {
|
|
607
607
|
const [e] = n.split("."), r = e.replace(/-/g, "+").replace(/_/g, "/").padEnd(e.length + (4 - e.length % 4) % 4, "="), a = JSON.parse(atob(r));
|
|
608
|
-
return !(typeof a != "object" || a === null ||
|
|
608
|
+
return !(typeof a != "object" || a === null || "typ" in a && (a == null ? void 0 : a.typ) !== "JWT" || !a.alg || t && a.alg !== t);
|
|
609
609
|
} catch {
|
|
610
610
|
return !1;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
return !!((t === "v4" || !t) &&
|
|
613
|
+
function Bt(n, t) {
|
|
614
|
+
return !!((t === "v4" || !t) && Wt.test(n) || (t === "v6" || !t) && $t.test(n));
|
|
615
615
|
}
|
|
616
|
-
class
|
|
616
|
+
class L extends v {
|
|
617
617
|
_parse(t) {
|
|
618
|
-
if (this._def.coerce && (t.data = String(t.data)), this._getType(t) !==
|
|
618
|
+
if (this._def.coerce && (t.data = String(t.data)), this._getType(t) !== h.string) {
|
|
619
619
|
const s = this._getOrReturnCtx(t);
|
|
620
620
|
return l(s, {
|
|
621
|
-
code:
|
|
622
|
-
expected:
|
|
621
|
+
code: c.invalid_type,
|
|
622
|
+
expected: h.string,
|
|
623
623
|
received: s.parsedType
|
|
624
624
|
}), g;
|
|
625
625
|
}
|
|
626
|
-
const r = new
|
|
626
|
+
const r = new I();
|
|
627
627
|
let a;
|
|
628
628
|
for (const s of this._def.checks)
|
|
629
629
|
if (s.kind === "min")
|
|
630
630
|
t.data.length < s.value && (a = this._getOrReturnCtx(t, a), l(a, {
|
|
631
|
-
code:
|
|
631
|
+
code: c.too_small,
|
|
632
632
|
minimum: s.value,
|
|
633
633
|
type: "string",
|
|
634
634
|
inclusive: !0,
|
|
@@ -637,7 +637,7 @@ class Y extends _ {
|
|
|
637
637
|
}), r.dirty());
|
|
638
638
|
else if (s.kind === "max")
|
|
639
639
|
t.data.length > s.value && (a = this._getOrReturnCtx(t, a), l(a, {
|
|
640
|
-
code:
|
|
640
|
+
code: c.too_big,
|
|
641
641
|
maximum: s.value,
|
|
642
642
|
type: "string",
|
|
643
643
|
inclusive: !0,
|
|
@@ -647,14 +647,14 @@ class Y extends _ {
|
|
|
647
647
|
else if (s.kind === "length") {
|
|
648
648
|
const i = t.data.length > s.value, o = t.data.length < s.value;
|
|
649
649
|
(i || o) && (a = this._getOrReturnCtx(t, a), i ? l(a, {
|
|
650
|
-
code:
|
|
650
|
+
code: c.too_big,
|
|
651
651
|
maximum: s.value,
|
|
652
652
|
type: "string",
|
|
653
653
|
inclusive: !0,
|
|
654
654
|
exact: !0,
|
|
655
655
|
message: s.message
|
|
656
656
|
}) : o && l(a, {
|
|
657
|
-
code:
|
|
657
|
+
code: c.too_small,
|
|
658
658
|
minimum: s.value,
|
|
659
659
|
type: "string",
|
|
660
660
|
inclusive: !0,
|
|
@@ -662,45 +662,45 @@ class Y extends _ {
|
|
|
662
662
|
message: s.message
|
|
663
663
|
}), r.dirty());
|
|
664
664
|
} else if (s.kind === "email")
|
|
665
|
-
|
|
665
|
+
At.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
666
666
|
validation: "email",
|
|
667
|
-
code:
|
|
667
|
+
code: c.invalid_string,
|
|
668
668
|
message: s.message
|
|
669
669
|
}), r.dirty());
|
|
670
670
|
else if (s.kind === "emoji")
|
|
671
|
-
|
|
671
|
+
Ze || (Ze = new RegExp(Zt, "u")), Ze.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
672
672
|
validation: "emoji",
|
|
673
|
-
code:
|
|
673
|
+
code: c.invalid_string,
|
|
674
674
|
message: s.message
|
|
675
675
|
}), r.dirty());
|
|
676
676
|
else if (s.kind === "uuid")
|
|
677
|
-
|
|
677
|
+
Nt.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
678
678
|
validation: "uuid",
|
|
679
|
-
code:
|
|
679
|
+
code: c.invalid_string,
|
|
680
680
|
message: s.message
|
|
681
681
|
}), r.dirty());
|
|
682
682
|
else if (s.kind === "nanoid")
|
|
683
|
-
|
|
683
|
+
Et.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
684
684
|
validation: "nanoid",
|
|
685
|
-
code:
|
|
685
|
+
code: c.invalid_string,
|
|
686
686
|
message: s.message
|
|
687
687
|
}), r.dirty());
|
|
688
688
|
else if (s.kind === "cuid")
|
|
689
|
-
|
|
689
|
+
Ct.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
690
690
|
validation: "cuid",
|
|
691
|
-
code:
|
|
691
|
+
code: c.invalid_string,
|
|
692
692
|
message: s.message
|
|
693
693
|
}), r.dirty());
|
|
694
694
|
else if (s.kind === "cuid2")
|
|
695
|
-
|
|
695
|
+
Mt.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
696
696
|
validation: "cuid2",
|
|
697
|
-
code:
|
|
697
|
+
code: c.invalid_string,
|
|
698
698
|
message: s.message
|
|
699
699
|
}), r.dirty());
|
|
700
700
|
else if (s.kind === "ulid")
|
|
701
|
-
|
|
701
|
+
Dt.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
702
702
|
validation: "ulid",
|
|
703
|
-
code:
|
|
703
|
+
code: c.invalid_string,
|
|
704
704
|
message: s.message
|
|
705
705
|
}), r.dirty());
|
|
706
706
|
else if (s.kind === "url")
|
|
@@ -709,61 +709,61 @@ class Y extends _ {
|
|
|
709
709
|
} catch {
|
|
710
710
|
a = this._getOrReturnCtx(t, a), l(a, {
|
|
711
711
|
validation: "url",
|
|
712
|
-
code:
|
|
712
|
+
code: c.invalid_string,
|
|
713
713
|
message: s.message
|
|
714
714
|
}), r.dirty();
|
|
715
715
|
}
|
|
716
716
|
else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
717
717
|
validation: "regex",
|
|
718
|
-
code:
|
|
718
|
+
code: c.invalid_string,
|
|
719
719
|
message: s.message
|
|
720
720
|
}), r.dirty())) : s.kind === "trim" ? t.data = t.data.trim() : s.kind === "includes" ? t.data.includes(s.value, s.position) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
721
|
-
code:
|
|
721
|
+
code: c.invalid_string,
|
|
722
722
|
validation: { includes: s.value, position: s.position },
|
|
723
723
|
message: s.message
|
|
724
724
|
}), r.dirty()) : s.kind === "toLowerCase" ? t.data = t.data.toLowerCase() : s.kind === "toUpperCase" ? t.data = t.data.toUpperCase() : s.kind === "startsWith" ? t.data.startsWith(s.value) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
725
|
-
code:
|
|
725
|
+
code: c.invalid_string,
|
|
726
726
|
validation: { startsWith: s.value },
|
|
727
727
|
message: s.message
|
|
728
728
|
}), r.dirty()) : s.kind === "endsWith" ? t.data.endsWith(s.value) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
729
|
-
code:
|
|
729
|
+
code: c.invalid_string,
|
|
730
730
|
validation: { endsWith: s.value },
|
|
731
731
|
message: s.message
|
|
732
|
-
}), r.dirty()) : s.kind === "datetime" ?
|
|
733
|
-
code:
|
|
732
|
+
}), r.dirty()) : s.kind === "datetime" ? zt(s).test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
733
|
+
code: c.invalid_string,
|
|
734
734
|
validation: "datetime",
|
|
735
735
|
message: s.message
|
|
736
|
-
}), r.dirty()) : s.kind === "date" ?
|
|
737
|
-
code:
|
|
736
|
+
}), r.dirty()) : s.kind === "date" ? St.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
737
|
+
code: c.invalid_string,
|
|
738
738
|
validation: "date",
|
|
739
739
|
message: s.message
|
|
740
|
-
}), r.dirty()) : s.kind === "time" ?
|
|
741
|
-
code:
|
|
740
|
+
}), r.dirty()) : s.kind === "time" ? Vt(s).test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
741
|
+
code: c.invalid_string,
|
|
742
742
|
validation: "time",
|
|
743
743
|
message: s.message
|
|
744
|
-
}), r.dirty()) : s.kind === "duration" ?
|
|
744
|
+
}), r.dirty()) : s.kind === "duration" ? Rt.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
745
745
|
validation: "duration",
|
|
746
|
-
code:
|
|
746
|
+
code: c.invalid_string,
|
|
747
747
|
message: s.message
|
|
748
|
-
}), r.dirty()) : s.kind === "ip" ?
|
|
748
|
+
}), r.dirty()) : s.kind === "ip" ? qt(t.data, s.version) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
749
749
|
validation: "ip",
|
|
750
|
-
code:
|
|
750
|
+
code: c.invalid_string,
|
|
751
751
|
message: s.message
|
|
752
|
-
}), r.dirty()) : s.kind === "jwt" ?
|
|
752
|
+
}), r.dirty()) : s.kind === "jwt" ? Ht(t.data, s.alg) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
753
753
|
validation: "jwt",
|
|
754
|
-
code:
|
|
754
|
+
code: c.invalid_string,
|
|
755
755
|
message: s.message
|
|
756
|
-
}), r.dirty()) : s.kind === "cidr" ?
|
|
756
|
+
}), r.dirty()) : s.kind === "cidr" ? Bt(t.data, s.version) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
757
757
|
validation: "cidr",
|
|
758
|
-
code:
|
|
758
|
+
code: c.invalid_string,
|
|
759
759
|
message: s.message
|
|
760
|
-
}), r.dirty()) : s.kind === "base64" ?
|
|
760
|
+
}), r.dirty()) : s.kind === "base64" ? Lt.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
761
761
|
validation: "base64",
|
|
762
|
-
code:
|
|
762
|
+
code: c.invalid_string,
|
|
763
763
|
message: s.message
|
|
764
|
-
}), r.dirty()) : s.kind === "base64url" ?
|
|
764
|
+
}), r.dirty()) : s.kind === "base64url" ? Ft.test(t.data) || (a = this._getOrReturnCtx(t, a), l(a, {
|
|
765
765
|
validation: "base64url",
|
|
766
|
-
code:
|
|
766
|
+
code: c.invalid_string,
|
|
767
767
|
message: s.message
|
|
768
768
|
}), r.dirty()) : w.assertNever(s);
|
|
769
769
|
return { status: r.value, value: t.data };
|
|
@@ -771,60 +771,59 @@ class Y extends _ {
|
|
|
771
771
|
_regex(t, e, r) {
|
|
772
772
|
return this.refinement((a) => t.test(a), {
|
|
773
773
|
validation: e,
|
|
774
|
-
code:
|
|
775
|
-
...
|
|
774
|
+
code: c.invalid_string,
|
|
775
|
+
...m.errToObj(r)
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
778
|
_addCheck(t) {
|
|
779
|
-
return new
|
|
779
|
+
return new L({
|
|
780
780
|
...this._def,
|
|
781
781
|
checks: [...this._def.checks, t]
|
|
782
782
|
});
|
|
783
783
|
}
|
|
784
784
|
email(t) {
|
|
785
|
-
return this._addCheck({ kind: "email", ...
|
|
785
|
+
return this._addCheck({ kind: "email", ...m.errToObj(t) });
|
|
786
786
|
}
|
|
787
787
|
url(t) {
|
|
788
|
-
return this._addCheck({ kind: "url", ...
|
|
788
|
+
return this._addCheck({ kind: "url", ...m.errToObj(t) });
|
|
789
789
|
}
|
|
790
790
|
emoji(t) {
|
|
791
|
-
return this._addCheck({ kind: "emoji", ...
|
|
791
|
+
return this._addCheck({ kind: "emoji", ...m.errToObj(t) });
|
|
792
792
|
}
|
|
793
793
|
uuid(t) {
|
|
794
|
-
return this._addCheck({ kind: "uuid", ...
|
|
794
|
+
return this._addCheck({ kind: "uuid", ...m.errToObj(t) });
|
|
795
795
|
}
|
|
796
796
|
nanoid(t) {
|
|
797
|
-
return this._addCheck({ kind: "nanoid", ...
|
|
797
|
+
return this._addCheck({ kind: "nanoid", ...m.errToObj(t) });
|
|
798
798
|
}
|
|
799
799
|
cuid(t) {
|
|
800
|
-
return this._addCheck({ kind: "cuid", ...
|
|
800
|
+
return this._addCheck({ kind: "cuid", ...m.errToObj(t) });
|
|
801
801
|
}
|
|
802
802
|
cuid2(t) {
|
|
803
|
-
return this._addCheck({ kind: "cuid2", ...
|
|
803
|
+
return this._addCheck({ kind: "cuid2", ...m.errToObj(t) });
|
|
804
804
|
}
|
|
805
805
|
ulid(t) {
|
|
806
|
-
return this._addCheck({ kind: "ulid", ...
|
|
806
|
+
return this._addCheck({ kind: "ulid", ...m.errToObj(t) });
|
|
807
807
|
}
|
|
808
808
|
base64(t) {
|
|
809
|
-
return this._addCheck({ kind: "base64", ...
|
|
809
|
+
return this._addCheck({ kind: "base64", ...m.errToObj(t) });
|
|
810
810
|
}
|
|
811
811
|
base64url(t) {
|
|
812
812
|
return this._addCheck({
|
|
813
813
|
kind: "base64url",
|
|
814
|
-
...
|
|
814
|
+
...m.errToObj(t)
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
jwt(t) {
|
|
818
|
-
return this._addCheck({ kind: "jwt", ...
|
|
818
|
+
return this._addCheck({ kind: "jwt", ...m.errToObj(t) });
|
|
819
819
|
}
|
|
820
820
|
ip(t) {
|
|
821
|
-
return this._addCheck({ kind: "ip", ...
|
|
821
|
+
return this._addCheck({ kind: "ip", ...m.errToObj(t) });
|
|
822
822
|
}
|
|
823
823
|
cidr(t) {
|
|
824
|
-
return this._addCheck({ kind: "cidr", ...
|
|
824
|
+
return this._addCheck({ kind: "cidr", ...m.errToObj(t) });
|
|
825
825
|
}
|
|
826
826
|
datetime(t) {
|
|
827
|
-
var e, r;
|
|
828
827
|
return typeof t == "string" ? this._addCheck({
|
|
829
828
|
kind: "datetime",
|
|
830
829
|
precision: null,
|
|
@@ -834,9 +833,9 @@ class Y extends _ {
|
|
|
834
833
|
}) : this._addCheck({
|
|
835
834
|
kind: "datetime",
|
|
836
835
|
precision: typeof (t == null ? void 0 : t.precision) > "u" ? null : t == null ? void 0 : t.precision,
|
|
837
|
-
offset: (
|
|
838
|
-
local: (
|
|
839
|
-
...
|
|
836
|
+
offset: (t == null ? void 0 : t.offset) ?? !1,
|
|
837
|
+
local: (t == null ? void 0 : t.local) ?? !1,
|
|
838
|
+
...m.errToObj(t == null ? void 0 : t.message)
|
|
840
839
|
});
|
|
841
840
|
}
|
|
842
841
|
date(t) {
|
|
@@ -850,17 +849,17 @@ class Y extends _ {
|
|
|
850
849
|
}) : this._addCheck({
|
|
851
850
|
kind: "time",
|
|
852
851
|
precision: typeof (t == null ? void 0 : t.precision) > "u" ? null : t == null ? void 0 : t.precision,
|
|
853
|
-
...
|
|
852
|
+
...m.errToObj(t == null ? void 0 : t.message)
|
|
854
853
|
});
|
|
855
854
|
}
|
|
856
855
|
duration(t) {
|
|
857
|
-
return this._addCheck({ kind: "duration", ...
|
|
856
|
+
return this._addCheck({ kind: "duration", ...m.errToObj(t) });
|
|
858
857
|
}
|
|
859
858
|
regex(t, e) {
|
|
860
859
|
return this._addCheck({
|
|
861
860
|
kind: "regex",
|
|
862
861
|
regex: t,
|
|
863
|
-
...
|
|
862
|
+
...m.errToObj(e)
|
|
864
863
|
});
|
|
865
864
|
}
|
|
866
865
|
includes(t, e) {
|
|
@@ -868,64 +867,64 @@ class Y extends _ {
|
|
|
868
867
|
kind: "includes",
|
|
869
868
|
value: t,
|
|
870
869
|
position: e == null ? void 0 : e.position,
|
|
871
|
-
...
|
|
870
|
+
...m.errToObj(e == null ? void 0 : e.message)
|
|
872
871
|
});
|
|
873
872
|
}
|
|
874
873
|
startsWith(t, e) {
|
|
875
874
|
return this._addCheck({
|
|
876
875
|
kind: "startsWith",
|
|
877
876
|
value: t,
|
|
878
|
-
...
|
|
877
|
+
...m.errToObj(e)
|
|
879
878
|
});
|
|
880
879
|
}
|
|
881
880
|
endsWith(t, e) {
|
|
882
881
|
return this._addCheck({
|
|
883
882
|
kind: "endsWith",
|
|
884
883
|
value: t,
|
|
885
|
-
...
|
|
884
|
+
...m.errToObj(e)
|
|
886
885
|
});
|
|
887
886
|
}
|
|
888
887
|
min(t, e) {
|
|
889
888
|
return this._addCheck({
|
|
890
889
|
kind: "min",
|
|
891
890
|
value: t,
|
|
892
|
-
...
|
|
891
|
+
...m.errToObj(e)
|
|
893
892
|
});
|
|
894
893
|
}
|
|
895
894
|
max(t, e) {
|
|
896
895
|
return this._addCheck({
|
|
897
896
|
kind: "max",
|
|
898
897
|
value: t,
|
|
899
|
-
...
|
|
898
|
+
...m.errToObj(e)
|
|
900
899
|
});
|
|
901
900
|
}
|
|
902
901
|
length(t, e) {
|
|
903
902
|
return this._addCheck({
|
|
904
903
|
kind: "length",
|
|
905
904
|
value: t,
|
|
906
|
-
...
|
|
905
|
+
...m.errToObj(e)
|
|
907
906
|
});
|
|
908
907
|
}
|
|
909
908
|
/**
|
|
910
909
|
* Equivalent to `.min(1)`
|
|
911
910
|
*/
|
|
912
911
|
nonempty(t) {
|
|
913
|
-
return this.min(1,
|
|
912
|
+
return this.min(1, m.errToObj(t));
|
|
914
913
|
}
|
|
915
914
|
trim() {
|
|
916
|
-
return new
|
|
915
|
+
return new L({
|
|
917
916
|
...this._def,
|
|
918
917
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
919
918
|
});
|
|
920
919
|
}
|
|
921
920
|
toLowerCase() {
|
|
922
|
-
return new
|
|
921
|
+
return new L({
|
|
923
922
|
...this._def,
|
|
924
923
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
925
924
|
});
|
|
926
925
|
}
|
|
927
926
|
toUpperCase() {
|
|
928
|
-
return new
|
|
927
|
+
return new L({
|
|
929
928
|
...this._def,
|
|
930
929
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
931
930
|
});
|
|
@@ -991,78 +990,75 @@ class Y extends _ {
|
|
|
991
990
|
return t;
|
|
992
991
|
}
|
|
993
992
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
function rr(n, t) {
|
|
1004
|
-
const e = (n.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, a = e > r ? e : r, s = parseInt(n.toFixed(a).replace(".", "")), i = parseInt(t.toFixed(a).replace(".", ""));
|
|
1005
|
-
return s % i / Math.pow(10, a);
|
|
993
|
+
L.create = (n) => new L({
|
|
994
|
+
checks: [],
|
|
995
|
+
typeName: y.ZodString,
|
|
996
|
+
coerce: (n == null ? void 0 : n.coerce) ?? !1,
|
|
997
|
+
..._(n)
|
|
998
|
+
});
|
|
999
|
+
function Qt(n, t) {
|
|
1000
|
+
const e = (n.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, a = e > r ? e : r, s = Number.parseInt(n.toFixed(a).replace(".", "")), i = Number.parseInt(t.toFixed(a).replace(".", ""));
|
|
1001
|
+
return s % i / 10 ** a;
|
|
1006
1002
|
}
|
|
1007
|
-
class
|
|
1003
|
+
class G extends v {
|
|
1008
1004
|
constructor() {
|
|
1009
1005
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1010
1006
|
}
|
|
1011
1007
|
_parse(t) {
|
|
1012
|
-
if (this._def.coerce && (t.data = Number(t.data)), this._getType(t) !==
|
|
1008
|
+
if (this._def.coerce && (t.data = Number(t.data)), this._getType(t) !== h.number) {
|
|
1013
1009
|
const s = this._getOrReturnCtx(t);
|
|
1014
1010
|
return l(s, {
|
|
1015
|
-
code:
|
|
1016
|
-
expected:
|
|
1011
|
+
code: c.invalid_type,
|
|
1012
|
+
expected: h.number,
|
|
1017
1013
|
received: s.parsedType
|
|
1018
1014
|
}), g;
|
|
1019
1015
|
}
|
|
1020
1016
|
let r;
|
|
1021
|
-
const a = new
|
|
1017
|
+
const a = new I();
|
|
1022
1018
|
for (const s of this._def.checks)
|
|
1023
1019
|
s.kind === "int" ? w.isInteger(t.data) || (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1024
|
-
code:
|
|
1020
|
+
code: c.invalid_type,
|
|
1025
1021
|
expected: "integer",
|
|
1026
1022
|
received: "float",
|
|
1027
1023
|
message: s.message
|
|
1028
1024
|
}), a.dirty()) : s.kind === "min" ? (s.inclusive ? t.data < s.value : t.data <= s.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1029
|
-
code:
|
|
1025
|
+
code: c.too_small,
|
|
1030
1026
|
minimum: s.value,
|
|
1031
1027
|
type: "number",
|
|
1032
1028
|
inclusive: s.inclusive,
|
|
1033
1029
|
exact: !1,
|
|
1034
1030
|
message: s.message
|
|
1035
1031
|
}), a.dirty()) : s.kind === "max" ? (s.inclusive ? t.data > s.value : t.data >= s.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1036
|
-
code:
|
|
1032
|
+
code: c.too_big,
|
|
1037
1033
|
maximum: s.value,
|
|
1038
1034
|
type: "number",
|
|
1039
1035
|
inclusive: s.inclusive,
|
|
1040
1036
|
exact: !1,
|
|
1041
1037
|
message: s.message
|
|
1042
|
-
}), a.dirty()) : s.kind === "multipleOf" ?
|
|
1043
|
-
code:
|
|
1038
|
+
}), a.dirty()) : s.kind === "multipleOf" ? Qt(t.data, s.value) !== 0 && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1039
|
+
code: c.not_multiple_of,
|
|
1044
1040
|
multipleOf: s.value,
|
|
1045
1041
|
message: s.message
|
|
1046
1042
|
}), a.dirty()) : s.kind === "finite" ? Number.isFinite(t.data) || (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1047
|
-
code:
|
|
1043
|
+
code: c.not_finite,
|
|
1048
1044
|
message: s.message
|
|
1049
1045
|
}), a.dirty()) : w.assertNever(s);
|
|
1050
1046
|
return { status: a.value, value: t.data };
|
|
1051
1047
|
}
|
|
1052
1048
|
gte(t, e) {
|
|
1053
|
-
return this.setLimit("min", t, !0,
|
|
1049
|
+
return this.setLimit("min", t, !0, m.toString(e));
|
|
1054
1050
|
}
|
|
1055
1051
|
gt(t, e) {
|
|
1056
|
-
return this.setLimit("min", t, !1,
|
|
1052
|
+
return this.setLimit("min", t, !1, m.toString(e));
|
|
1057
1053
|
}
|
|
1058
1054
|
lte(t, e) {
|
|
1059
|
-
return this.setLimit("max", t, !0,
|
|
1055
|
+
return this.setLimit("max", t, !0, m.toString(e));
|
|
1060
1056
|
}
|
|
1061
1057
|
lt(t, e) {
|
|
1062
|
-
return this.setLimit("max", t, !1,
|
|
1058
|
+
return this.setLimit("max", t, !1, m.toString(e));
|
|
1063
1059
|
}
|
|
1064
1060
|
setLimit(t, e, r, a) {
|
|
1065
|
-
return new
|
|
1061
|
+
return new G({
|
|
1066
1062
|
...this._def,
|
|
1067
1063
|
checks: [
|
|
1068
1064
|
...this._def.checks,
|
|
@@ -1070,13 +1066,13 @@ class X extends _ {
|
|
|
1070
1066
|
kind: t,
|
|
1071
1067
|
value: e,
|
|
1072
1068
|
inclusive: r,
|
|
1073
|
-
message:
|
|
1069
|
+
message: m.toString(a)
|
|
1074
1070
|
}
|
|
1075
1071
|
]
|
|
1076
1072
|
});
|
|
1077
1073
|
}
|
|
1078
1074
|
_addCheck(t) {
|
|
1079
|
-
return new
|
|
1075
|
+
return new G({
|
|
1080
1076
|
...this._def,
|
|
1081
1077
|
checks: [...this._def.checks, t]
|
|
1082
1078
|
});
|
|
@@ -1084,7 +1080,7 @@ class X extends _ {
|
|
|
1084
1080
|
int(t) {
|
|
1085
1081
|
return this._addCheck({
|
|
1086
1082
|
kind: "int",
|
|
1087
|
-
message:
|
|
1083
|
+
message: m.toString(t)
|
|
1088
1084
|
});
|
|
1089
1085
|
}
|
|
1090
1086
|
positive(t) {
|
|
@@ -1092,7 +1088,7 @@ class X extends _ {
|
|
|
1092
1088
|
kind: "min",
|
|
1093
1089
|
value: 0,
|
|
1094
1090
|
inclusive: !1,
|
|
1095
|
-
message:
|
|
1091
|
+
message: m.toString(t)
|
|
1096
1092
|
});
|
|
1097
1093
|
}
|
|
1098
1094
|
negative(t) {
|
|
@@ -1100,7 +1096,7 @@ class X extends _ {
|
|
|
1100
1096
|
kind: "max",
|
|
1101
1097
|
value: 0,
|
|
1102
1098
|
inclusive: !1,
|
|
1103
|
-
message:
|
|
1099
|
+
message: m.toString(t)
|
|
1104
1100
|
});
|
|
1105
1101
|
}
|
|
1106
1102
|
nonpositive(t) {
|
|
@@ -1108,7 +1104,7 @@ class X extends _ {
|
|
|
1108
1104
|
kind: "max",
|
|
1109
1105
|
value: 0,
|
|
1110
1106
|
inclusive: !0,
|
|
1111
|
-
message:
|
|
1107
|
+
message: m.toString(t)
|
|
1112
1108
|
});
|
|
1113
1109
|
}
|
|
1114
1110
|
nonnegative(t) {
|
|
@@ -1116,20 +1112,20 @@ class X extends _ {
|
|
|
1116
1112
|
kind: "min",
|
|
1117
1113
|
value: 0,
|
|
1118
1114
|
inclusive: !0,
|
|
1119
|
-
message:
|
|
1115
|
+
message: m.toString(t)
|
|
1120
1116
|
});
|
|
1121
1117
|
}
|
|
1122
1118
|
multipleOf(t, e) {
|
|
1123
1119
|
return this._addCheck({
|
|
1124
1120
|
kind: "multipleOf",
|
|
1125
1121
|
value: t,
|
|
1126
|
-
message:
|
|
1122
|
+
message: m.toString(e)
|
|
1127
1123
|
});
|
|
1128
1124
|
}
|
|
1129
1125
|
finite(t) {
|
|
1130
1126
|
return this._addCheck({
|
|
1131
1127
|
kind: "finite",
|
|
1132
|
-
message:
|
|
1128
|
+
message: m.toString(t)
|
|
1133
1129
|
});
|
|
1134
1130
|
}
|
|
1135
1131
|
safe(t) {
|
|
@@ -1137,12 +1133,12 @@ class X extends _ {
|
|
|
1137
1133
|
kind: "min",
|
|
1138
1134
|
inclusive: !0,
|
|
1139
1135
|
value: Number.MIN_SAFE_INTEGER,
|
|
1140
|
-
message:
|
|
1136
|
+
message: m.toString(t)
|
|
1141
1137
|
})._addCheck({
|
|
1142
1138
|
kind: "max",
|
|
1143
1139
|
inclusive: !0,
|
|
1144
1140
|
value: Number.MAX_SAFE_INTEGER,
|
|
1145
|
-
message:
|
|
1141
|
+
message: m.toString(t)
|
|
1146
1142
|
});
|
|
1147
1143
|
}
|
|
1148
1144
|
get minValue() {
|
|
@@ -1170,13 +1166,13 @@ class X extends _ {
|
|
|
1170
1166
|
return Number.isFinite(e) && Number.isFinite(t);
|
|
1171
1167
|
}
|
|
1172
1168
|
}
|
|
1173
|
-
|
|
1169
|
+
G.create = (n) => new G({
|
|
1174
1170
|
checks: [],
|
|
1175
1171
|
typeName: y.ZodNumber,
|
|
1176
1172
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1177
|
-
...
|
|
1173
|
+
..._(n)
|
|
1178
1174
|
});
|
|
1179
|
-
class
|
|
1175
|
+
class J extends v {
|
|
1180
1176
|
constructor() {
|
|
1181
1177
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1182
1178
|
}
|
|
@@ -1187,25 +1183,25 @@ class G extends _ {
|
|
|
1187
1183
|
} catch {
|
|
1188
1184
|
return this._getInvalidInput(t);
|
|
1189
1185
|
}
|
|
1190
|
-
if (this._getType(t) !==
|
|
1186
|
+
if (this._getType(t) !== h.bigint)
|
|
1191
1187
|
return this._getInvalidInput(t);
|
|
1192
1188
|
let r;
|
|
1193
|
-
const a = new
|
|
1189
|
+
const a = new I();
|
|
1194
1190
|
for (const s of this._def.checks)
|
|
1195
1191
|
s.kind === "min" ? (s.inclusive ? t.data < s.value : t.data <= s.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1196
|
-
code:
|
|
1192
|
+
code: c.too_small,
|
|
1197
1193
|
type: "bigint",
|
|
1198
1194
|
minimum: s.value,
|
|
1199
1195
|
inclusive: s.inclusive,
|
|
1200
1196
|
message: s.message
|
|
1201
1197
|
}), a.dirty()) : s.kind === "max" ? (s.inclusive ? t.data > s.value : t.data >= s.value) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1202
|
-
code:
|
|
1198
|
+
code: c.too_big,
|
|
1203
1199
|
type: "bigint",
|
|
1204
1200
|
maximum: s.value,
|
|
1205
1201
|
inclusive: s.inclusive,
|
|
1206
1202
|
message: s.message
|
|
1207
1203
|
}), a.dirty()) : s.kind === "multipleOf" ? t.data % s.value !== BigInt(0) && (r = this._getOrReturnCtx(t, r), l(r, {
|
|
1208
|
-
code:
|
|
1204
|
+
code: c.not_multiple_of,
|
|
1209
1205
|
multipleOf: s.value,
|
|
1210
1206
|
message: s.message
|
|
1211
1207
|
}), a.dirty()) : w.assertNever(s);
|
|
@@ -1214,25 +1210,25 @@ class G extends _ {
|
|
|
1214
1210
|
_getInvalidInput(t) {
|
|
1215
1211
|
const e = this._getOrReturnCtx(t);
|
|
1216
1212
|
return l(e, {
|
|
1217
|
-
code:
|
|
1218
|
-
expected:
|
|
1213
|
+
code: c.invalid_type,
|
|
1214
|
+
expected: h.bigint,
|
|
1219
1215
|
received: e.parsedType
|
|
1220
1216
|
}), g;
|
|
1221
1217
|
}
|
|
1222
1218
|
gte(t, e) {
|
|
1223
|
-
return this.setLimit("min", t, !0,
|
|
1219
|
+
return this.setLimit("min", t, !0, m.toString(e));
|
|
1224
1220
|
}
|
|
1225
1221
|
gt(t, e) {
|
|
1226
|
-
return this.setLimit("min", t, !1,
|
|
1222
|
+
return this.setLimit("min", t, !1, m.toString(e));
|
|
1227
1223
|
}
|
|
1228
1224
|
lte(t, e) {
|
|
1229
|
-
return this.setLimit("max", t, !0,
|
|
1225
|
+
return this.setLimit("max", t, !0, m.toString(e));
|
|
1230
1226
|
}
|
|
1231
1227
|
lt(t, e) {
|
|
1232
|
-
return this.setLimit("max", t, !1,
|
|
1228
|
+
return this.setLimit("max", t, !1, m.toString(e));
|
|
1233
1229
|
}
|
|
1234
1230
|
setLimit(t, e, r, a) {
|
|
1235
|
-
return new
|
|
1231
|
+
return new J({
|
|
1236
1232
|
...this._def,
|
|
1237
1233
|
checks: [
|
|
1238
1234
|
...this._def.checks,
|
|
@@ -1240,13 +1236,13 @@ class G extends _ {
|
|
|
1240
1236
|
kind: t,
|
|
1241
1237
|
value: e,
|
|
1242
1238
|
inclusive: r,
|
|
1243
|
-
message:
|
|
1239
|
+
message: m.toString(a)
|
|
1244
1240
|
}
|
|
1245
1241
|
]
|
|
1246
1242
|
});
|
|
1247
1243
|
}
|
|
1248
1244
|
_addCheck(t) {
|
|
1249
|
-
return new
|
|
1245
|
+
return new J({
|
|
1250
1246
|
...this._def,
|
|
1251
1247
|
checks: [...this._def.checks, t]
|
|
1252
1248
|
});
|
|
@@ -1256,7 +1252,7 @@ class G extends _ {
|
|
|
1256
1252
|
kind: "min",
|
|
1257
1253
|
value: BigInt(0),
|
|
1258
1254
|
inclusive: !1,
|
|
1259
|
-
message:
|
|
1255
|
+
message: m.toString(t)
|
|
1260
1256
|
});
|
|
1261
1257
|
}
|
|
1262
1258
|
negative(t) {
|
|
@@ -1264,7 +1260,7 @@ class G extends _ {
|
|
|
1264
1260
|
kind: "max",
|
|
1265
1261
|
value: BigInt(0),
|
|
1266
1262
|
inclusive: !1,
|
|
1267
|
-
message:
|
|
1263
|
+
message: m.toString(t)
|
|
1268
1264
|
});
|
|
1269
1265
|
}
|
|
1270
1266
|
nonpositive(t) {
|
|
@@ -1272,7 +1268,7 @@ class G extends _ {
|
|
|
1272
1268
|
kind: "max",
|
|
1273
1269
|
value: BigInt(0),
|
|
1274
1270
|
inclusive: !0,
|
|
1275
|
-
message:
|
|
1271
|
+
message: m.toString(t)
|
|
1276
1272
|
});
|
|
1277
1273
|
}
|
|
1278
1274
|
nonnegative(t) {
|
|
@@ -1280,14 +1276,14 @@ class G extends _ {
|
|
|
1280
1276
|
kind: "min",
|
|
1281
1277
|
value: BigInt(0),
|
|
1282
1278
|
inclusive: !0,
|
|
1283
|
-
message:
|
|
1279
|
+
message: m.toString(t)
|
|
1284
1280
|
});
|
|
1285
1281
|
}
|
|
1286
1282
|
multipleOf(t, e) {
|
|
1287
1283
|
return this._addCheck({
|
|
1288
1284
|
kind: "multipleOf",
|
|
1289
1285
|
value: t,
|
|
1290
|
-
message:
|
|
1286
|
+
message: m.toString(e)
|
|
1291
1287
|
});
|
|
1292
1288
|
}
|
|
1293
1289
|
get minValue() {
|
|
@@ -1303,61 +1299,58 @@ class G extends _ {
|
|
|
1303
1299
|
return t;
|
|
1304
1300
|
}
|
|
1305
1301
|
}
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
});
|
|
1314
|
-
};
|
|
1315
|
-
class ge extends _ {
|
|
1302
|
+
J.create = (n) => new J({
|
|
1303
|
+
checks: [],
|
|
1304
|
+
typeName: y.ZodBigInt,
|
|
1305
|
+
coerce: (n == null ? void 0 : n.coerce) ?? !1,
|
|
1306
|
+
..._(n)
|
|
1307
|
+
});
|
|
1308
|
+
class ve extends v {
|
|
1316
1309
|
_parse(t) {
|
|
1317
|
-
if (this._def.coerce && (t.data = !!t.data), this._getType(t) !==
|
|
1310
|
+
if (this._def.coerce && (t.data = !!t.data), this._getType(t) !== h.boolean) {
|
|
1318
1311
|
const r = this._getOrReturnCtx(t);
|
|
1319
1312
|
return l(r, {
|
|
1320
|
-
code:
|
|
1321
|
-
expected:
|
|
1313
|
+
code: c.invalid_type,
|
|
1314
|
+
expected: h.boolean,
|
|
1322
1315
|
received: r.parsedType
|
|
1323
1316
|
}), g;
|
|
1324
1317
|
}
|
|
1325
|
-
return
|
|
1318
|
+
return R(t.data);
|
|
1326
1319
|
}
|
|
1327
1320
|
}
|
|
1328
|
-
|
|
1321
|
+
ve.create = (n) => new ve({
|
|
1329
1322
|
typeName: y.ZodBoolean,
|
|
1330
1323
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1331
|
-
...
|
|
1324
|
+
..._(n)
|
|
1332
1325
|
});
|
|
1333
|
-
class
|
|
1326
|
+
class ae extends v {
|
|
1334
1327
|
_parse(t) {
|
|
1335
|
-
if (this._def.coerce && (t.data = new Date(t.data)), this._getType(t) !==
|
|
1328
|
+
if (this._def.coerce && (t.data = new Date(t.data)), this._getType(t) !== h.date) {
|
|
1336
1329
|
const s = this._getOrReturnCtx(t);
|
|
1337
1330
|
return l(s, {
|
|
1338
|
-
code:
|
|
1339
|
-
expected:
|
|
1331
|
+
code: c.invalid_type,
|
|
1332
|
+
expected: h.date,
|
|
1340
1333
|
received: s.parsedType
|
|
1341
1334
|
}), g;
|
|
1342
1335
|
}
|
|
1343
|
-
if (isNaN(t.data.getTime())) {
|
|
1336
|
+
if (Number.isNaN(t.data.getTime())) {
|
|
1344
1337
|
const s = this._getOrReturnCtx(t);
|
|
1345
1338
|
return l(s, {
|
|
1346
|
-
code:
|
|
1339
|
+
code: c.invalid_date
|
|
1347
1340
|
}), g;
|
|
1348
1341
|
}
|
|
1349
|
-
const r = new
|
|
1342
|
+
const r = new I();
|
|
1350
1343
|
let a;
|
|
1351
1344
|
for (const s of this._def.checks)
|
|
1352
1345
|
s.kind === "min" ? t.data.getTime() < s.value && (a = this._getOrReturnCtx(t, a), l(a, {
|
|
1353
|
-
code:
|
|
1346
|
+
code: c.too_small,
|
|
1354
1347
|
message: s.message,
|
|
1355
1348
|
inclusive: !0,
|
|
1356
1349
|
exact: !1,
|
|
1357
1350
|
minimum: s.value,
|
|
1358
1351
|
type: "date"
|
|
1359
1352
|
}), r.dirty()) : s.kind === "max" ? t.data.getTime() > s.value && (a = this._getOrReturnCtx(t, a), l(a, {
|
|
1360
|
-
code:
|
|
1353
|
+
code: c.too_big,
|
|
1361
1354
|
message: s.message,
|
|
1362
1355
|
inclusive: !0,
|
|
1363
1356
|
exact: !1,
|
|
@@ -1370,7 +1363,7 @@ class ne extends _ {
|
|
|
1370
1363
|
};
|
|
1371
1364
|
}
|
|
1372
1365
|
_addCheck(t) {
|
|
1373
|
-
return new
|
|
1366
|
+
return new ae({
|
|
1374
1367
|
...this._def,
|
|
1375
1368
|
checks: [...this._def.checks, t]
|
|
1376
1369
|
});
|
|
@@ -1379,14 +1372,14 @@ class ne extends _ {
|
|
|
1379
1372
|
return this._addCheck({
|
|
1380
1373
|
kind: "min",
|
|
1381
1374
|
value: t.getTime(),
|
|
1382
|
-
message:
|
|
1375
|
+
message: m.toString(e)
|
|
1383
1376
|
});
|
|
1384
1377
|
}
|
|
1385
1378
|
max(t, e) {
|
|
1386
1379
|
return this._addCheck({
|
|
1387
1380
|
kind: "max",
|
|
1388
1381
|
value: t.getTime(),
|
|
1389
|
-
message:
|
|
1382
|
+
message: m.toString(e)
|
|
1390
1383
|
});
|
|
1391
1384
|
}
|
|
1392
1385
|
get minDate() {
|
|
@@ -1402,131 +1395,131 @@ class ne extends _ {
|
|
|
1402
1395
|
return t != null ? new Date(t) : null;
|
|
1403
1396
|
}
|
|
1404
1397
|
}
|
|
1405
|
-
|
|
1398
|
+
ae.create = (n) => new ae({
|
|
1406
1399
|
checks: [],
|
|
1407
1400
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1408
1401
|
typeName: y.ZodDate,
|
|
1409
|
-
...
|
|
1402
|
+
..._(n)
|
|
1410
1403
|
});
|
|
1411
|
-
class
|
|
1404
|
+
class $e extends v {
|
|
1412
1405
|
_parse(t) {
|
|
1413
|
-
if (this._getType(t) !==
|
|
1406
|
+
if (this._getType(t) !== h.symbol) {
|
|
1414
1407
|
const r = this._getOrReturnCtx(t);
|
|
1415
1408
|
return l(r, {
|
|
1416
|
-
code:
|
|
1417
|
-
expected:
|
|
1409
|
+
code: c.invalid_type,
|
|
1410
|
+
expected: h.symbol,
|
|
1418
1411
|
received: r.parsedType
|
|
1419
1412
|
}), g;
|
|
1420
1413
|
}
|
|
1421
|
-
return
|
|
1414
|
+
return R(t.data);
|
|
1422
1415
|
}
|
|
1423
1416
|
}
|
|
1424
|
-
|
|
1417
|
+
$e.create = (n) => new $e({
|
|
1425
1418
|
typeName: y.ZodSymbol,
|
|
1426
|
-
...
|
|
1419
|
+
..._(n)
|
|
1427
1420
|
});
|
|
1428
|
-
class
|
|
1421
|
+
class we extends v {
|
|
1429
1422
|
_parse(t) {
|
|
1430
|
-
if (this._getType(t) !==
|
|
1423
|
+
if (this._getType(t) !== h.undefined) {
|
|
1431
1424
|
const r = this._getOrReturnCtx(t);
|
|
1432
1425
|
return l(r, {
|
|
1433
|
-
code:
|
|
1434
|
-
expected:
|
|
1426
|
+
code: c.invalid_type,
|
|
1427
|
+
expected: h.undefined,
|
|
1435
1428
|
received: r.parsedType
|
|
1436
1429
|
}), g;
|
|
1437
1430
|
}
|
|
1438
|
-
return
|
|
1431
|
+
return R(t.data);
|
|
1439
1432
|
}
|
|
1440
1433
|
}
|
|
1441
|
-
|
|
1434
|
+
we.create = (n) => new we({
|
|
1442
1435
|
typeName: y.ZodUndefined,
|
|
1443
|
-
...
|
|
1436
|
+
..._(n)
|
|
1444
1437
|
});
|
|
1445
|
-
class
|
|
1438
|
+
class be extends v {
|
|
1446
1439
|
_parse(t) {
|
|
1447
|
-
if (this._getType(t) !==
|
|
1440
|
+
if (this._getType(t) !== h.null) {
|
|
1448
1441
|
const r = this._getOrReturnCtx(t);
|
|
1449
1442
|
return l(r, {
|
|
1450
|
-
code:
|
|
1451
|
-
expected:
|
|
1443
|
+
code: c.invalid_type,
|
|
1444
|
+
expected: h.null,
|
|
1452
1445
|
received: r.parsedType
|
|
1453
1446
|
}), g;
|
|
1454
1447
|
}
|
|
1455
|
-
return
|
|
1448
|
+
return R(t.data);
|
|
1456
1449
|
}
|
|
1457
1450
|
}
|
|
1458
|
-
|
|
1451
|
+
be.create = (n) => new be({
|
|
1459
1452
|
typeName: y.ZodNull,
|
|
1460
|
-
...
|
|
1453
|
+
..._(n)
|
|
1461
1454
|
});
|
|
1462
|
-
class
|
|
1455
|
+
class me extends v {
|
|
1463
1456
|
constructor() {
|
|
1464
1457
|
super(...arguments), this._any = !0;
|
|
1465
1458
|
}
|
|
1466
1459
|
_parse(t) {
|
|
1467
|
-
return
|
|
1460
|
+
return R(t.data);
|
|
1468
1461
|
}
|
|
1469
1462
|
}
|
|
1470
|
-
|
|
1463
|
+
me.create = (n) => new me({
|
|
1471
1464
|
typeName: y.ZodAny,
|
|
1472
|
-
...
|
|
1465
|
+
..._(n)
|
|
1473
1466
|
});
|
|
1474
|
-
class
|
|
1467
|
+
class re extends v {
|
|
1475
1468
|
constructor() {
|
|
1476
1469
|
super(...arguments), this._unknown = !0;
|
|
1477
1470
|
}
|
|
1478
1471
|
_parse(t) {
|
|
1479
|
-
return
|
|
1472
|
+
return R(t.data);
|
|
1480
1473
|
}
|
|
1481
1474
|
}
|
|
1482
|
-
|
|
1475
|
+
re.create = (n) => new re({
|
|
1483
1476
|
typeName: y.ZodUnknown,
|
|
1484
|
-
...
|
|
1477
|
+
..._(n)
|
|
1485
1478
|
});
|
|
1486
|
-
class
|
|
1479
|
+
class U extends v {
|
|
1487
1480
|
_parse(t) {
|
|
1488
1481
|
const e = this._getOrReturnCtx(t);
|
|
1489
1482
|
return l(e, {
|
|
1490
|
-
code:
|
|
1491
|
-
expected:
|
|
1483
|
+
code: c.invalid_type,
|
|
1484
|
+
expected: h.never,
|
|
1492
1485
|
received: e.parsedType
|
|
1493
1486
|
}), g;
|
|
1494
1487
|
}
|
|
1495
1488
|
}
|
|
1496
|
-
|
|
1489
|
+
U.create = (n) => new U({
|
|
1497
1490
|
typeName: y.ZodNever,
|
|
1498
|
-
...
|
|
1491
|
+
..._(n)
|
|
1499
1492
|
});
|
|
1500
|
-
class
|
|
1493
|
+
class Le extends v {
|
|
1501
1494
|
_parse(t) {
|
|
1502
|
-
if (this._getType(t) !==
|
|
1495
|
+
if (this._getType(t) !== h.undefined) {
|
|
1503
1496
|
const r = this._getOrReturnCtx(t);
|
|
1504
1497
|
return l(r, {
|
|
1505
|
-
code:
|
|
1506
|
-
expected:
|
|
1498
|
+
code: c.invalid_type,
|
|
1499
|
+
expected: h.void,
|
|
1507
1500
|
received: r.parsedType
|
|
1508
1501
|
}), g;
|
|
1509
1502
|
}
|
|
1510
|
-
return
|
|
1503
|
+
return R(t.data);
|
|
1511
1504
|
}
|
|
1512
1505
|
}
|
|
1513
|
-
|
|
1506
|
+
Le.create = (n) => new Le({
|
|
1514
1507
|
typeName: y.ZodVoid,
|
|
1515
|
-
...
|
|
1508
|
+
..._(n)
|
|
1516
1509
|
});
|
|
1517
|
-
class
|
|
1510
|
+
class F extends v {
|
|
1518
1511
|
_parse(t) {
|
|
1519
1512
|
const { ctx: e, status: r } = this._processInputParams(t), a = this._def;
|
|
1520
|
-
if (e.parsedType !==
|
|
1513
|
+
if (e.parsedType !== h.array)
|
|
1521
1514
|
return l(e, {
|
|
1522
|
-
code:
|
|
1523
|
-
expected:
|
|
1515
|
+
code: c.invalid_type,
|
|
1516
|
+
expected: h.array,
|
|
1524
1517
|
received: e.parsedType
|
|
1525
1518
|
}), g;
|
|
1526
1519
|
if (a.exactLength !== null) {
|
|
1527
1520
|
const i = e.data.length > a.exactLength.value, o = e.data.length < a.exactLength.value;
|
|
1528
1521
|
(i || o) && (l(e, {
|
|
1529
|
-
code: i ?
|
|
1522
|
+
code: i ? c.too_big : c.too_small,
|
|
1530
1523
|
minimum: o ? a.exactLength.value : void 0,
|
|
1531
1524
|
maximum: i ? a.exactLength.value : void 0,
|
|
1532
1525
|
type: "array",
|
|
@@ -1536,74 +1529,74 @@ class W extends _ {
|
|
|
1536
1529
|
}), r.dirty());
|
|
1537
1530
|
}
|
|
1538
1531
|
if (a.minLength !== null && e.data.length < a.minLength.value && (l(e, {
|
|
1539
|
-
code:
|
|
1532
|
+
code: c.too_small,
|
|
1540
1533
|
minimum: a.minLength.value,
|
|
1541
1534
|
type: "array",
|
|
1542
1535
|
inclusive: !0,
|
|
1543
1536
|
exact: !1,
|
|
1544
1537
|
message: a.minLength.message
|
|
1545
1538
|
}), r.dirty()), a.maxLength !== null && e.data.length > a.maxLength.value && (l(e, {
|
|
1546
|
-
code:
|
|
1539
|
+
code: c.too_big,
|
|
1547
1540
|
maximum: a.maxLength.value,
|
|
1548
1541
|
type: "array",
|
|
1549
1542
|
inclusive: !0,
|
|
1550
1543
|
exact: !1,
|
|
1551
1544
|
message: a.maxLength.message
|
|
1552
1545
|
}), r.dirty()), e.common.async)
|
|
1553
|
-
return Promise.all([...e.data].map((i, o) => a.type._parseAsync(new
|
|
1554
|
-
const s = [...e.data].map((i, o) => a.type._parseSync(new
|
|
1555
|
-
return
|
|
1546
|
+
return Promise.all([...e.data].map((i, o) => a.type._parseAsync(new S(e, i, e.path, o)))).then((i) => I.mergeArray(r, i));
|
|
1547
|
+
const s = [...e.data].map((i, o) => a.type._parseSync(new S(e, i, e.path, o)));
|
|
1548
|
+
return I.mergeArray(r, s);
|
|
1556
1549
|
}
|
|
1557
1550
|
get element() {
|
|
1558
1551
|
return this._def.type;
|
|
1559
1552
|
}
|
|
1560
1553
|
min(t, e) {
|
|
1561
|
-
return new
|
|
1554
|
+
return new F({
|
|
1562
1555
|
...this._def,
|
|
1563
|
-
minLength: { value: t, message:
|
|
1556
|
+
minLength: { value: t, message: m.toString(e) }
|
|
1564
1557
|
});
|
|
1565
1558
|
}
|
|
1566
1559
|
max(t, e) {
|
|
1567
|
-
return new
|
|
1560
|
+
return new F({
|
|
1568
1561
|
...this._def,
|
|
1569
|
-
maxLength: { value: t, message:
|
|
1562
|
+
maxLength: { value: t, message: m.toString(e) }
|
|
1570
1563
|
});
|
|
1571
1564
|
}
|
|
1572
1565
|
length(t, e) {
|
|
1573
|
-
return new
|
|
1566
|
+
return new F({
|
|
1574
1567
|
...this._def,
|
|
1575
|
-
exactLength: { value: t, message:
|
|
1568
|
+
exactLength: { value: t, message: m.toString(e) }
|
|
1576
1569
|
});
|
|
1577
1570
|
}
|
|
1578
1571
|
nonempty(t) {
|
|
1579
1572
|
return this.min(1, t);
|
|
1580
1573
|
}
|
|
1581
1574
|
}
|
|
1582
|
-
|
|
1575
|
+
F.create = (n, t) => new F({
|
|
1583
1576
|
type: n,
|
|
1584
1577
|
minLength: null,
|
|
1585
1578
|
maxLength: null,
|
|
1586
1579
|
exactLength: null,
|
|
1587
1580
|
typeName: y.ZodArray,
|
|
1588
|
-
...
|
|
1581
|
+
..._(t)
|
|
1589
1582
|
});
|
|
1590
|
-
function
|
|
1591
|
-
if (n instanceof
|
|
1583
|
+
function te(n) {
|
|
1584
|
+
if (n instanceof P) {
|
|
1592
1585
|
const t = {};
|
|
1593
1586
|
for (const e in n.shape) {
|
|
1594
1587
|
const r = n.shape[e];
|
|
1595
|
-
t[e] =
|
|
1588
|
+
t[e] = q.create(te(r));
|
|
1596
1589
|
}
|
|
1597
|
-
return new
|
|
1590
|
+
return new P({
|
|
1598
1591
|
...n._def,
|
|
1599
1592
|
shape: () => t
|
|
1600
1593
|
});
|
|
1601
|
-
} else return n instanceof
|
|
1594
|
+
} else return n instanceof F ? new F({
|
|
1602
1595
|
...n._def,
|
|
1603
|
-
type:
|
|
1604
|
-
}) : n instanceof
|
|
1596
|
+
type: te(n.element)
|
|
1597
|
+
}) : n instanceof q ? q.create(te(n.unwrap())) : n instanceof ee ? ee.create(te(n.unwrap())) : n instanceof H ? H.create(n.items.map((t) => te(t))) : n;
|
|
1605
1598
|
}
|
|
1606
|
-
class
|
|
1599
|
+
class P extends v {
|
|
1607
1600
|
constructor() {
|
|
1608
1601
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1609
1602
|
}
|
|
@@ -1611,99 +1604,99 @@ class T extends _ {
|
|
|
1611
1604
|
if (this._cached !== null)
|
|
1612
1605
|
return this._cached;
|
|
1613
1606
|
const t = this._def.shape(), e = w.objectKeys(t);
|
|
1614
|
-
return this._cached = { shape: t, keys: e };
|
|
1607
|
+
return this._cached = { shape: t, keys: e }, this._cached;
|
|
1615
1608
|
}
|
|
1616
1609
|
_parse(t) {
|
|
1617
|
-
if (this._getType(t) !==
|
|
1618
|
-
const
|
|
1619
|
-
return l(
|
|
1620
|
-
code:
|
|
1621
|
-
expected:
|
|
1622
|
-
received:
|
|
1610
|
+
if (this._getType(t) !== h.object) {
|
|
1611
|
+
const d = this._getOrReturnCtx(t);
|
|
1612
|
+
return l(d, {
|
|
1613
|
+
code: c.invalid_type,
|
|
1614
|
+
expected: h.object,
|
|
1615
|
+
received: d.parsedType
|
|
1623
1616
|
}), g;
|
|
1624
1617
|
}
|
|
1625
1618
|
const { status: r, ctx: a } = this._processInputParams(t), { shape: s, keys: i } = this._getCached(), o = [];
|
|
1626
|
-
if (!(this._def.catchall instanceof
|
|
1627
|
-
for (const
|
|
1628
|
-
i.includes(
|
|
1619
|
+
if (!(this._def.catchall instanceof U && this._def.unknownKeys === "strip"))
|
|
1620
|
+
for (const d in a.data)
|
|
1621
|
+
i.includes(d) || o.push(d);
|
|
1629
1622
|
const u = [];
|
|
1630
|
-
for (const
|
|
1631
|
-
const
|
|
1623
|
+
for (const d of i) {
|
|
1624
|
+
const p = s[d], k = a.data[d];
|
|
1632
1625
|
u.push({
|
|
1633
|
-
key: { status: "valid", value:
|
|
1634
|
-
value:
|
|
1635
|
-
alwaysSet:
|
|
1626
|
+
key: { status: "valid", value: d },
|
|
1627
|
+
value: p._parse(new S(a, k, a.path, d)),
|
|
1628
|
+
alwaysSet: d in a.data
|
|
1636
1629
|
});
|
|
1637
1630
|
}
|
|
1638
|
-
if (this._def.catchall instanceof
|
|
1639
|
-
const
|
|
1640
|
-
if (
|
|
1641
|
-
for (const
|
|
1631
|
+
if (this._def.catchall instanceof U) {
|
|
1632
|
+
const d = this._def.unknownKeys;
|
|
1633
|
+
if (d === "passthrough")
|
|
1634
|
+
for (const p of o)
|
|
1642
1635
|
u.push({
|
|
1643
|
-
key: { status: "valid", value:
|
|
1644
|
-
value: { status: "valid", value: a.data[
|
|
1636
|
+
key: { status: "valid", value: p },
|
|
1637
|
+
value: { status: "valid", value: a.data[p] }
|
|
1645
1638
|
});
|
|
1646
|
-
else if (
|
|
1639
|
+
else if (d === "strict")
|
|
1647
1640
|
o.length > 0 && (l(a, {
|
|
1648
|
-
code:
|
|
1641
|
+
code: c.unrecognized_keys,
|
|
1649
1642
|
keys: o
|
|
1650
1643
|
}), r.dirty());
|
|
1651
|
-
else if (
|
|
1644
|
+
else if (d !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1652
1645
|
} else {
|
|
1653
|
-
const
|
|
1654
|
-
for (const
|
|
1655
|
-
const k = a.data[
|
|
1646
|
+
const d = this._def.catchall;
|
|
1647
|
+
for (const p of o) {
|
|
1648
|
+
const k = a.data[p];
|
|
1656
1649
|
u.push({
|
|
1657
|
-
key: { status: "valid", value:
|
|
1658
|
-
value:
|
|
1659
|
-
new
|
|
1650
|
+
key: { status: "valid", value: p },
|
|
1651
|
+
value: d._parse(
|
|
1652
|
+
new S(a, k, a.path, p)
|
|
1660
1653
|
//, ctx.child(key), value, getParsedType(value)
|
|
1661
1654
|
),
|
|
1662
|
-
alwaysSet:
|
|
1655
|
+
alwaysSet: p in a.data
|
|
1663
1656
|
});
|
|
1664
1657
|
}
|
|
1665
1658
|
}
|
|
1666
1659
|
return a.common.async ? Promise.resolve().then(async () => {
|
|
1667
|
-
const
|
|
1668
|
-
for (const
|
|
1669
|
-
const k = await
|
|
1670
|
-
|
|
1660
|
+
const d = [];
|
|
1661
|
+
for (const p of u) {
|
|
1662
|
+
const k = await p.key, A = await p.value;
|
|
1663
|
+
d.push({
|
|
1671
1664
|
key: k,
|
|
1672
1665
|
value: A,
|
|
1673
|
-
alwaysSet:
|
|
1666
|
+
alwaysSet: p.alwaysSet
|
|
1674
1667
|
});
|
|
1675
1668
|
}
|
|
1676
|
-
return
|
|
1677
|
-
}).then((
|
|
1669
|
+
return d;
|
|
1670
|
+
}).then((d) => I.mergeObjectSync(r, d)) : I.mergeObjectSync(r, u);
|
|
1678
1671
|
}
|
|
1679
1672
|
get shape() {
|
|
1680
1673
|
return this._def.shape();
|
|
1681
1674
|
}
|
|
1682
1675
|
strict(t) {
|
|
1683
|
-
return
|
|
1676
|
+
return m.errToObj, new P({
|
|
1684
1677
|
...this._def,
|
|
1685
1678
|
unknownKeys: "strict",
|
|
1686
1679
|
...t !== void 0 ? {
|
|
1687
1680
|
errorMap: (e, r) => {
|
|
1688
|
-
var
|
|
1689
|
-
const
|
|
1681
|
+
var s, i;
|
|
1682
|
+
const a = ((i = (s = this._def).errorMap) == null ? void 0 : i.call(s, e, r).message) ?? r.defaultError;
|
|
1690
1683
|
return e.code === "unrecognized_keys" ? {
|
|
1691
|
-
message:
|
|
1684
|
+
message: m.errToObj(t).message ?? a
|
|
1692
1685
|
} : {
|
|
1693
|
-
message:
|
|
1686
|
+
message: a
|
|
1694
1687
|
};
|
|
1695
1688
|
}
|
|
1696
1689
|
} : {}
|
|
1697
1690
|
});
|
|
1698
1691
|
}
|
|
1699
1692
|
strip() {
|
|
1700
|
-
return new
|
|
1693
|
+
return new P({
|
|
1701
1694
|
...this._def,
|
|
1702
1695
|
unknownKeys: "strip"
|
|
1703
1696
|
});
|
|
1704
1697
|
}
|
|
1705
1698
|
passthrough() {
|
|
1706
|
-
return new
|
|
1699
|
+
return new P({
|
|
1707
1700
|
...this._def,
|
|
1708
1701
|
unknownKeys: "passthrough"
|
|
1709
1702
|
});
|
|
@@ -1726,7 +1719,7 @@ class T extends _ {
|
|
|
1726
1719
|
// }) as any;
|
|
1727
1720
|
// };
|
|
1728
1721
|
extend(t) {
|
|
1729
|
-
return new
|
|
1722
|
+
return new P({
|
|
1730
1723
|
...this._def,
|
|
1731
1724
|
shape: () => ({
|
|
1732
1725
|
...this._def.shape(),
|
|
@@ -1740,7 +1733,7 @@ class T extends _ {
|
|
|
1740
1733
|
* upgrade if you are experiencing issues.
|
|
1741
1734
|
*/
|
|
1742
1735
|
merge(t) {
|
|
1743
|
-
return new
|
|
1736
|
+
return new P({
|
|
1744
1737
|
unknownKeys: t._def.unknownKeys,
|
|
1745
1738
|
catchall: t._def.catchall,
|
|
1746
1739
|
shape: () => ({
|
|
@@ -1810,25 +1803,25 @@ class T extends _ {
|
|
|
1810
1803
|
// return merged;
|
|
1811
1804
|
// }
|
|
1812
1805
|
catchall(t) {
|
|
1813
|
-
return new
|
|
1806
|
+
return new P({
|
|
1814
1807
|
...this._def,
|
|
1815
1808
|
catchall: t
|
|
1816
1809
|
});
|
|
1817
1810
|
}
|
|
1818
1811
|
pick(t) {
|
|
1819
1812
|
const e = {};
|
|
1820
|
-
|
|
1813
|
+
for (const r of w.objectKeys(t))
|
|
1821
1814
|
t[r] && this.shape[r] && (e[r] = this.shape[r]);
|
|
1822
|
-
|
|
1815
|
+
return new P({
|
|
1823
1816
|
...this._def,
|
|
1824
1817
|
shape: () => e
|
|
1825
1818
|
});
|
|
1826
1819
|
}
|
|
1827
1820
|
omit(t) {
|
|
1828
1821
|
const e = {};
|
|
1829
|
-
|
|
1822
|
+
for (const r of w.objectKeys(this.shape))
|
|
1830
1823
|
t[r] || (e[r] = this.shape[r]);
|
|
1831
|
-
|
|
1824
|
+
return new P({
|
|
1832
1825
|
...this._def,
|
|
1833
1826
|
shape: () => e
|
|
1834
1827
|
});
|
|
@@ -1837,60 +1830,61 @@ class T extends _ {
|
|
|
1837
1830
|
* @deprecated
|
|
1838
1831
|
*/
|
|
1839
1832
|
deepPartial() {
|
|
1840
|
-
return
|
|
1833
|
+
return te(this);
|
|
1841
1834
|
}
|
|
1842
1835
|
partial(t) {
|
|
1843
1836
|
const e = {};
|
|
1844
|
-
|
|
1837
|
+
for (const r of w.objectKeys(this.shape)) {
|
|
1845
1838
|
const a = this.shape[r];
|
|
1846
1839
|
t && !t[r] ? e[r] = a : e[r] = a.optional();
|
|
1847
|
-
}
|
|
1840
|
+
}
|
|
1841
|
+
return new P({
|
|
1848
1842
|
...this._def,
|
|
1849
1843
|
shape: () => e
|
|
1850
1844
|
});
|
|
1851
1845
|
}
|
|
1852
1846
|
required(t) {
|
|
1853
1847
|
const e = {};
|
|
1854
|
-
|
|
1848
|
+
for (const r of w.objectKeys(this.shape))
|
|
1855
1849
|
if (t && !t[r])
|
|
1856
1850
|
e[r] = this.shape[r];
|
|
1857
1851
|
else {
|
|
1858
1852
|
let s = this.shape[r];
|
|
1859
|
-
for (; s instanceof
|
|
1853
|
+
for (; s instanceof q; )
|
|
1860
1854
|
s = s._def.innerType;
|
|
1861
1855
|
e[r] = s;
|
|
1862
1856
|
}
|
|
1863
|
-
|
|
1857
|
+
return new P({
|
|
1864
1858
|
...this._def,
|
|
1865
1859
|
shape: () => e
|
|
1866
1860
|
});
|
|
1867
1861
|
}
|
|
1868
1862
|
keyof() {
|
|
1869
|
-
return
|
|
1863
|
+
return mt(w.objectKeys(this.shape));
|
|
1870
1864
|
}
|
|
1871
1865
|
}
|
|
1872
|
-
|
|
1866
|
+
P.create = (n, t) => new P({
|
|
1873
1867
|
shape: () => n,
|
|
1874
1868
|
unknownKeys: "strip",
|
|
1875
|
-
catchall:
|
|
1869
|
+
catchall: U.create(),
|
|
1876
1870
|
typeName: y.ZodObject,
|
|
1877
|
-
...
|
|
1871
|
+
..._(t)
|
|
1878
1872
|
});
|
|
1879
|
-
|
|
1873
|
+
P.strictCreate = (n, t) => new P({
|
|
1880
1874
|
shape: () => n,
|
|
1881
1875
|
unknownKeys: "strict",
|
|
1882
|
-
catchall:
|
|
1876
|
+
catchall: U.create(),
|
|
1883
1877
|
typeName: y.ZodObject,
|
|
1884
|
-
...
|
|
1878
|
+
..._(t)
|
|
1885
1879
|
});
|
|
1886
|
-
|
|
1880
|
+
P.lazycreate = (n, t) => new P({
|
|
1887
1881
|
shape: n,
|
|
1888
1882
|
unknownKeys: "strip",
|
|
1889
|
-
catchall:
|
|
1883
|
+
catchall: U.create(),
|
|
1890
1884
|
typeName: y.ZodObject,
|
|
1891
|
-
...
|
|
1885
|
+
..._(t)
|
|
1892
1886
|
});
|
|
1893
|
-
class
|
|
1887
|
+
class xe extends v {
|
|
1894
1888
|
_parse(t) {
|
|
1895
1889
|
const { ctx: e } = this._processInputParams(t), r = this._def.options;
|
|
1896
1890
|
function a(s) {
|
|
@@ -1900,9 +1894,9 @@ class we extends _ {
|
|
|
1900
1894
|
for (const o of s)
|
|
1901
1895
|
if (o.result.status === "dirty")
|
|
1902
1896
|
return e.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1903
|
-
const i = s.map((o) => new
|
|
1897
|
+
const i = s.map((o) => new Z(o.ctx.common.issues));
|
|
1904
1898
|
return l(e, {
|
|
1905
|
-
code:
|
|
1899
|
+
code: c.invalid_union,
|
|
1906
1900
|
unionErrors: i
|
|
1907
1901
|
}), g;
|
|
1908
1902
|
}
|
|
@@ -1929,27 +1923,27 @@ class we extends _ {
|
|
|
1929
1923
|
let s;
|
|
1930
1924
|
const i = [];
|
|
1931
1925
|
for (const u of r) {
|
|
1932
|
-
const
|
|
1926
|
+
const d = {
|
|
1933
1927
|
...e,
|
|
1934
1928
|
common: {
|
|
1935
1929
|
...e.common,
|
|
1936
1930
|
issues: []
|
|
1937
1931
|
},
|
|
1938
1932
|
parent: null
|
|
1939
|
-
},
|
|
1933
|
+
}, p = u._parseSync({
|
|
1940
1934
|
data: e.data,
|
|
1941
1935
|
path: e.path,
|
|
1942
|
-
parent:
|
|
1936
|
+
parent: d
|
|
1943
1937
|
});
|
|
1944
|
-
if (
|
|
1945
|
-
return
|
|
1946
|
-
|
|
1938
|
+
if (p.status === "valid")
|
|
1939
|
+
return p;
|
|
1940
|
+
p.status === "dirty" && !s && (s = { result: p, ctx: d }), d.common.issues.length && i.push(d.common.issues);
|
|
1947
1941
|
}
|
|
1948
1942
|
if (s)
|
|
1949
1943
|
return e.common.issues.push(...s.ctx.common.issues), s.result;
|
|
1950
|
-
const o = i.map((u) => new
|
|
1944
|
+
const o = i.map((u) => new Z(u));
|
|
1951
1945
|
return l(e, {
|
|
1952
|
-
code:
|
|
1946
|
+
code: c.invalid_union,
|
|
1953
1947
|
unionErrors: o
|
|
1954
1948
|
}), g;
|
|
1955
1949
|
}
|
|
@@ -1958,19 +1952,19 @@ class we extends _ {
|
|
|
1958
1952
|
return this._def.options;
|
|
1959
1953
|
}
|
|
1960
1954
|
}
|
|
1961
|
-
|
|
1955
|
+
xe.create = (n, t) => new xe({
|
|
1962
1956
|
options: n,
|
|
1963
1957
|
typeName: y.ZodUnion,
|
|
1964
|
-
...
|
|
1958
|
+
..._(t)
|
|
1965
1959
|
});
|
|
1966
|
-
const
|
|
1967
|
-
class
|
|
1960
|
+
const z = (n) => n instanceof Oe ? z(n.schema) : n instanceof B ? z(n.innerType()) : n instanceof Pe ? [n.value] : n instanceof K ? n.options : n instanceof Ce ? w.objectValues(n.enum) : n instanceof Me ? z(n._def.innerType) : n instanceof we ? [void 0] : n instanceof be ? [null] : n instanceof q ? [void 0, ...z(n.unwrap())] : n instanceof ee ? [null, ...z(n.unwrap())] : n instanceof pt || n instanceof Ne ? z(n.unwrap()) : n instanceof De ? z(n._def.innerType) : [];
|
|
1961
|
+
class ze extends v {
|
|
1968
1962
|
_parse(t) {
|
|
1969
1963
|
const { ctx: e } = this._processInputParams(t);
|
|
1970
|
-
if (e.parsedType !==
|
|
1964
|
+
if (e.parsedType !== h.object)
|
|
1971
1965
|
return l(e, {
|
|
1972
|
-
code:
|
|
1973
|
-
expected:
|
|
1966
|
+
code: c.invalid_type,
|
|
1967
|
+
expected: h.object,
|
|
1974
1968
|
received: e.parsedType
|
|
1975
1969
|
}), g;
|
|
1976
1970
|
const r = this.discriminator, a = e.data[r], s = this.optionsMap.get(a);
|
|
@@ -1983,7 +1977,7 @@ class Le extends _ {
|
|
|
1983
1977
|
path: e.path,
|
|
1984
1978
|
parent: e
|
|
1985
1979
|
}) : (l(e, {
|
|
1986
|
-
code:
|
|
1980
|
+
code: c.invalid_union_discriminator,
|
|
1987
1981
|
options: Array.from(this.optionsMap.keys()),
|
|
1988
1982
|
path: [r]
|
|
1989
1983
|
}), g);
|
|
@@ -2008,7 +2002,7 @@ class Le extends _ {
|
|
|
2008
2002
|
static create(t, e, r) {
|
|
2009
2003
|
const a = /* @__PURE__ */ new Map();
|
|
2010
2004
|
for (const s of e) {
|
|
2011
|
-
const i =
|
|
2005
|
+
const i = z(s.shape[t]);
|
|
2012
2006
|
if (!i.length)
|
|
2013
2007
|
throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
2014
2008
|
for (const o of i) {
|
|
@@ -2017,49 +2011,49 @@ class Le extends _ {
|
|
|
2017
2011
|
a.set(o, s);
|
|
2018
2012
|
}
|
|
2019
2013
|
}
|
|
2020
|
-
return new
|
|
2014
|
+
return new ze({
|
|
2021
2015
|
typeName: y.ZodDiscriminatedUnion,
|
|
2022
2016
|
discriminator: t,
|
|
2023
2017
|
options: e,
|
|
2024
2018
|
optionsMap: a,
|
|
2025
|
-
...
|
|
2019
|
+
..._(r)
|
|
2026
2020
|
});
|
|
2027
2021
|
}
|
|
2028
2022
|
}
|
|
2029
|
-
function
|
|
2030
|
-
const e =
|
|
2023
|
+
function Fe(n, t) {
|
|
2024
|
+
const e = Q(n), r = Q(t);
|
|
2031
2025
|
if (n === t)
|
|
2032
2026
|
return { valid: !0, data: n };
|
|
2033
|
-
if (e ===
|
|
2027
|
+
if (e === h.object && r === h.object) {
|
|
2034
2028
|
const a = w.objectKeys(t), s = w.objectKeys(n).filter((o) => a.indexOf(o) !== -1), i = { ...n, ...t };
|
|
2035
2029
|
for (const o of s) {
|
|
2036
|
-
const u =
|
|
2030
|
+
const u = Fe(n[o], t[o]);
|
|
2037
2031
|
if (!u.valid)
|
|
2038
2032
|
return { valid: !1 };
|
|
2039
2033
|
i[o] = u.data;
|
|
2040
2034
|
}
|
|
2041
2035
|
return { valid: !0, data: i };
|
|
2042
|
-
} else if (e ===
|
|
2036
|
+
} else if (e === h.array && r === h.array) {
|
|
2043
2037
|
if (n.length !== t.length)
|
|
2044
2038
|
return { valid: !1 };
|
|
2045
2039
|
const a = [];
|
|
2046
2040
|
for (let s = 0; s < n.length; s++) {
|
|
2047
|
-
const i = n[s], o = t[s], u =
|
|
2041
|
+
const i = n[s], o = t[s], u = Fe(i, o);
|
|
2048
2042
|
if (!u.valid)
|
|
2049
2043
|
return { valid: !1 };
|
|
2050
2044
|
a.push(u.data);
|
|
2051
2045
|
}
|
|
2052
2046
|
return { valid: !0, data: a };
|
|
2053
|
-
} else return e ===
|
|
2047
|
+
} else return e === h.date && r === h.date && +n == +t ? { valid: !0, data: n } : { valid: !1 };
|
|
2054
2048
|
}
|
|
2055
|
-
class
|
|
2049
|
+
class ke extends v {
|
|
2056
2050
|
_parse(t) {
|
|
2057
2051
|
const { status: e, ctx: r } = this._processInputParams(t), a = (s, i) => {
|
|
2058
|
-
if (
|
|
2052
|
+
if (rt(s) || rt(i))
|
|
2059
2053
|
return g;
|
|
2060
|
-
const o =
|
|
2061
|
-
return o.valid ? ((
|
|
2062
|
-
code:
|
|
2054
|
+
const o = Fe(s.value, i.value);
|
|
2055
|
+
return o.valid ? ((nt(s) || nt(i)) && e.dirty(), { status: e.value, value: o.data }) : (l(r, {
|
|
2056
|
+
code: c.invalid_intersection_types
|
|
2063
2057
|
}), g);
|
|
2064
2058
|
};
|
|
2065
2059
|
return r.common.async ? Promise.all([
|
|
@@ -2084,31 +2078,31 @@ class be extends _ {
|
|
|
2084
2078
|
}));
|
|
2085
2079
|
}
|
|
2086
2080
|
}
|
|
2087
|
-
|
|
2081
|
+
ke.create = (n, t, e) => new ke({
|
|
2088
2082
|
left: n,
|
|
2089
2083
|
right: t,
|
|
2090
2084
|
typeName: y.ZodIntersection,
|
|
2091
|
-
...
|
|
2085
|
+
..._(e)
|
|
2092
2086
|
});
|
|
2093
|
-
class
|
|
2087
|
+
class H extends v {
|
|
2094
2088
|
_parse(t) {
|
|
2095
2089
|
const { status: e, ctx: r } = this._processInputParams(t);
|
|
2096
|
-
if (r.parsedType !==
|
|
2090
|
+
if (r.parsedType !== h.array)
|
|
2097
2091
|
return l(r, {
|
|
2098
|
-
code:
|
|
2099
|
-
expected:
|
|
2092
|
+
code: c.invalid_type,
|
|
2093
|
+
expected: h.array,
|
|
2100
2094
|
received: r.parsedType
|
|
2101
2095
|
}), g;
|
|
2102
2096
|
if (r.data.length < this._def.items.length)
|
|
2103
2097
|
return l(r, {
|
|
2104
|
-
code:
|
|
2098
|
+
code: c.too_small,
|
|
2105
2099
|
minimum: this._def.items.length,
|
|
2106
2100
|
inclusive: !0,
|
|
2107
2101
|
exact: !1,
|
|
2108
2102
|
type: "array"
|
|
2109
2103
|
}), g;
|
|
2110
2104
|
!this._def.rest && r.data.length > this._def.items.length && (l(r, {
|
|
2111
|
-
code:
|
|
2105
|
+
code: c.too_big,
|
|
2112
2106
|
maximum: this._def.items.length,
|
|
2113
2107
|
inclusive: !0,
|
|
2114
2108
|
exact: !1,
|
|
@@ -2116,31 +2110,31 @@ class q extends _ {
|
|
|
2116
2110
|
}), e.dirty());
|
|
2117
2111
|
const s = [...r.data].map((i, o) => {
|
|
2118
2112
|
const u = this._def.items[o] || this._def.rest;
|
|
2119
|
-
return u ? u._parse(new
|
|
2113
|
+
return u ? u._parse(new S(r, i, r.path, o)) : null;
|
|
2120
2114
|
}).filter((i) => !!i);
|
|
2121
|
-
return r.common.async ? Promise.all(s).then((i) =>
|
|
2115
|
+
return r.common.async ? Promise.all(s).then((i) => I.mergeArray(e, i)) : I.mergeArray(e, s);
|
|
2122
2116
|
}
|
|
2123
2117
|
get items() {
|
|
2124
2118
|
return this._def.items;
|
|
2125
2119
|
}
|
|
2126
2120
|
rest(t) {
|
|
2127
|
-
return new
|
|
2121
|
+
return new H({
|
|
2128
2122
|
...this._def,
|
|
2129
2123
|
rest: t
|
|
2130
2124
|
});
|
|
2131
2125
|
}
|
|
2132
2126
|
}
|
|
2133
|
-
|
|
2127
|
+
H.create = (n, t) => {
|
|
2134
2128
|
if (!Array.isArray(n))
|
|
2135
2129
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2136
|
-
return new
|
|
2130
|
+
return new H({
|
|
2137
2131
|
items: n,
|
|
2138
2132
|
typeName: y.ZodTuple,
|
|
2139
2133
|
rest: null,
|
|
2140
|
-
...
|
|
2134
|
+
..._(t)
|
|
2141
2135
|
});
|
|
2142
2136
|
};
|
|
2143
|
-
class
|
|
2137
|
+
class Te extends v {
|
|
2144
2138
|
get keySchema() {
|
|
2145
2139
|
return this._def.keyType;
|
|
2146
2140
|
}
|
|
@@ -2149,39 +2143,39 @@ class xe extends _ {
|
|
|
2149
2143
|
}
|
|
2150
2144
|
_parse(t) {
|
|
2151
2145
|
const { status: e, ctx: r } = this._processInputParams(t);
|
|
2152
|
-
if (r.parsedType !==
|
|
2146
|
+
if (r.parsedType !== h.object)
|
|
2153
2147
|
return l(r, {
|
|
2154
|
-
code:
|
|
2155
|
-
expected:
|
|
2148
|
+
code: c.invalid_type,
|
|
2149
|
+
expected: h.object,
|
|
2156
2150
|
received: r.parsedType
|
|
2157
2151
|
}), g;
|
|
2158
2152
|
const a = [], s = this._def.keyType, i = this._def.valueType;
|
|
2159
2153
|
for (const o in r.data)
|
|
2160
2154
|
a.push({
|
|
2161
|
-
key: s._parse(new
|
|
2162
|
-
value: i._parse(new
|
|
2155
|
+
key: s._parse(new S(r, o, r.path, o)),
|
|
2156
|
+
value: i._parse(new S(r, r.data[o], r.path, o)),
|
|
2163
2157
|
alwaysSet: o in r.data
|
|
2164
2158
|
});
|
|
2165
|
-
return r.common.async ?
|
|
2159
|
+
return r.common.async ? I.mergeObjectAsync(e, a) : I.mergeObjectSync(e, a);
|
|
2166
2160
|
}
|
|
2167
2161
|
get element() {
|
|
2168
2162
|
return this._def.valueType;
|
|
2169
2163
|
}
|
|
2170
2164
|
static create(t, e, r) {
|
|
2171
|
-
return e instanceof
|
|
2165
|
+
return e instanceof v ? new Te({
|
|
2172
2166
|
keyType: t,
|
|
2173
2167
|
valueType: e,
|
|
2174
2168
|
typeName: y.ZodRecord,
|
|
2175
|
-
...
|
|
2176
|
-
}) : new
|
|
2177
|
-
keyType:
|
|
2169
|
+
..._(r)
|
|
2170
|
+
}) : new Te({
|
|
2171
|
+
keyType: L.create(),
|
|
2178
2172
|
valueType: t,
|
|
2179
2173
|
typeName: y.ZodRecord,
|
|
2180
|
-
...
|
|
2174
|
+
..._(e)
|
|
2181
2175
|
});
|
|
2182
2176
|
}
|
|
2183
2177
|
}
|
|
2184
|
-
class
|
|
2178
|
+
class Se extends v {
|
|
2185
2179
|
get keySchema() {
|
|
2186
2180
|
return this._def.keyType;
|
|
2187
2181
|
}
|
|
@@ -2190,64 +2184,64 @@ class je extends _ {
|
|
|
2190
2184
|
}
|
|
2191
2185
|
_parse(t) {
|
|
2192
2186
|
const { status: e, ctx: r } = this._processInputParams(t);
|
|
2193
|
-
if (r.parsedType !==
|
|
2187
|
+
if (r.parsedType !== h.map)
|
|
2194
2188
|
return l(r, {
|
|
2195
|
-
code:
|
|
2196
|
-
expected:
|
|
2189
|
+
code: c.invalid_type,
|
|
2190
|
+
expected: h.map,
|
|
2197
2191
|
received: r.parsedType
|
|
2198
2192
|
}), g;
|
|
2199
|
-
const a = this._def.keyType, s = this._def.valueType, i = [...r.data.entries()].map(([o, u],
|
|
2200
|
-
key: a._parse(new
|
|
2201
|
-
value: s._parse(new
|
|
2193
|
+
const a = this._def.keyType, s = this._def.valueType, i = [...r.data.entries()].map(([o, u], d) => ({
|
|
2194
|
+
key: a._parse(new S(r, o, r.path, [d, "key"])),
|
|
2195
|
+
value: s._parse(new S(r, u, r.path, [d, "value"]))
|
|
2202
2196
|
}));
|
|
2203
2197
|
if (r.common.async) {
|
|
2204
2198
|
const o = /* @__PURE__ */ new Map();
|
|
2205
2199
|
return Promise.resolve().then(async () => {
|
|
2206
2200
|
for (const u of i) {
|
|
2207
|
-
const
|
|
2208
|
-
if (
|
|
2201
|
+
const d = await u.key, p = await u.value;
|
|
2202
|
+
if (d.status === "aborted" || p.status === "aborted")
|
|
2209
2203
|
return g;
|
|
2210
|
-
(
|
|
2204
|
+
(d.status === "dirty" || p.status === "dirty") && e.dirty(), o.set(d.value, p.value);
|
|
2211
2205
|
}
|
|
2212
2206
|
return { status: e.value, value: o };
|
|
2213
2207
|
});
|
|
2214
2208
|
} else {
|
|
2215
2209
|
const o = /* @__PURE__ */ new Map();
|
|
2216
2210
|
for (const u of i) {
|
|
2217
|
-
const
|
|
2218
|
-
if (
|
|
2211
|
+
const d = u.key, p = u.value;
|
|
2212
|
+
if (d.status === "aborted" || p.status === "aborted")
|
|
2219
2213
|
return g;
|
|
2220
|
-
(
|
|
2214
|
+
(d.status === "dirty" || p.status === "dirty") && e.dirty(), o.set(d.value, p.value);
|
|
2221
2215
|
}
|
|
2222
2216
|
return { status: e.value, value: o };
|
|
2223
2217
|
}
|
|
2224
2218
|
}
|
|
2225
2219
|
}
|
|
2226
|
-
|
|
2220
|
+
Se.create = (n, t, e) => new Se({
|
|
2227
2221
|
valueType: t,
|
|
2228
2222
|
keyType: n,
|
|
2229
2223
|
typeName: y.ZodMap,
|
|
2230
|
-
...
|
|
2224
|
+
..._(e)
|
|
2231
2225
|
});
|
|
2232
|
-
class
|
|
2226
|
+
class se extends v {
|
|
2233
2227
|
_parse(t) {
|
|
2234
2228
|
const { status: e, ctx: r } = this._processInputParams(t);
|
|
2235
|
-
if (r.parsedType !==
|
|
2229
|
+
if (r.parsedType !== h.set)
|
|
2236
2230
|
return l(r, {
|
|
2237
|
-
code:
|
|
2238
|
-
expected:
|
|
2231
|
+
code: c.invalid_type,
|
|
2232
|
+
expected: h.set,
|
|
2239
2233
|
received: r.parsedType
|
|
2240
2234
|
}), g;
|
|
2241
2235
|
const a = this._def;
|
|
2242
2236
|
a.minSize !== null && r.data.size < a.minSize.value && (l(r, {
|
|
2243
|
-
code:
|
|
2237
|
+
code: c.too_small,
|
|
2244
2238
|
minimum: a.minSize.value,
|
|
2245
2239
|
type: "set",
|
|
2246
2240
|
inclusive: !0,
|
|
2247
2241
|
exact: !1,
|
|
2248
2242
|
message: a.minSize.message
|
|
2249
2243
|
}), e.dirty()), a.maxSize !== null && r.data.size > a.maxSize.value && (l(r, {
|
|
2250
|
-
code:
|
|
2244
|
+
code: c.too_big,
|
|
2251
2245
|
maximum: a.maxSize.value,
|
|
2252
2246
|
type: "set",
|
|
2253
2247
|
inclusive: !0,
|
|
@@ -2256,27 +2250,27 @@ class ae extends _ {
|
|
|
2256
2250
|
}), e.dirty());
|
|
2257
2251
|
const s = this._def.valueType;
|
|
2258
2252
|
function i(u) {
|
|
2259
|
-
const
|
|
2260
|
-
for (const
|
|
2261
|
-
if (
|
|
2253
|
+
const d = /* @__PURE__ */ new Set();
|
|
2254
|
+
for (const p of u) {
|
|
2255
|
+
if (p.status === "aborted")
|
|
2262
2256
|
return g;
|
|
2263
|
-
|
|
2257
|
+
p.status === "dirty" && e.dirty(), d.add(p.value);
|
|
2264
2258
|
}
|
|
2265
|
-
return { status: e.value, value:
|
|
2259
|
+
return { status: e.value, value: d };
|
|
2266
2260
|
}
|
|
2267
|
-
const o = [...r.data.values()].map((u,
|
|
2261
|
+
const o = [...r.data.values()].map((u, d) => s._parse(new S(r, u, r.path, d)));
|
|
2268
2262
|
return r.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
|
|
2269
2263
|
}
|
|
2270
2264
|
min(t, e) {
|
|
2271
|
-
return new
|
|
2265
|
+
return new se({
|
|
2272
2266
|
...this._def,
|
|
2273
|
-
minSize: { value: t, message:
|
|
2267
|
+
minSize: { value: t, message: m.toString(e) }
|
|
2274
2268
|
});
|
|
2275
2269
|
}
|
|
2276
2270
|
max(t, e) {
|
|
2277
|
-
return new
|
|
2271
|
+
return new se({
|
|
2278
2272
|
...this._def,
|
|
2279
|
-
maxSize: { value: t, message:
|
|
2273
|
+
maxSize: { value: t, message: m.toString(e) }
|
|
2280
2274
|
});
|
|
2281
2275
|
}
|
|
2282
2276
|
size(t, e) {
|
|
@@ -2286,77 +2280,67 @@ class ae extends _ {
|
|
|
2286
2280
|
return this.min(1, t);
|
|
2287
2281
|
}
|
|
2288
2282
|
}
|
|
2289
|
-
|
|
2283
|
+
se.create = (n, t) => new se({
|
|
2290
2284
|
valueType: n,
|
|
2291
2285
|
minSize: null,
|
|
2292
2286
|
maxSize: null,
|
|
2293
2287
|
typeName: y.ZodSet,
|
|
2294
|
-
...
|
|
2288
|
+
..._(t)
|
|
2295
2289
|
});
|
|
2296
|
-
class
|
|
2290
|
+
class fe extends v {
|
|
2297
2291
|
constructor() {
|
|
2298
2292
|
super(...arguments), this.validate = this.implement;
|
|
2299
2293
|
}
|
|
2300
2294
|
_parse(t) {
|
|
2301
2295
|
const { ctx: e } = this._processInputParams(t);
|
|
2302
|
-
if (e.parsedType !==
|
|
2296
|
+
if (e.parsedType !== h.function)
|
|
2303
2297
|
return l(e, {
|
|
2304
|
-
code:
|
|
2305
|
-
expected:
|
|
2298
|
+
code: c.invalid_type,
|
|
2299
|
+
expected: h.function,
|
|
2306
2300
|
received: e.parsedType
|
|
2307
2301
|
}), g;
|
|
2308
2302
|
function r(o, u) {
|
|
2309
|
-
return
|
|
2303
|
+
return Ye({
|
|
2310
2304
|
data: o,
|
|
2311
2305
|
path: e.path,
|
|
2312
|
-
errorMaps: [
|
|
2313
|
-
e.common.contextualErrorMap,
|
|
2314
|
-
e.schemaErrorMap,
|
|
2315
|
-
Ne(),
|
|
2316
|
-
ce
|
|
2317
|
-
].filter((c) => !!c),
|
|
2306
|
+
errorMaps: [e.common.contextualErrorMap, e.schemaErrorMap, We(), he].filter((d) => !!d),
|
|
2318
2307
|
issueData: {
|
|
2319
|
-
code:
|
|
2308
|
+
code: c.invalid_arguments,
|
|
2320
2309
|
argumentsError: u
|
|
2321
2310
|
}
|
|
2322
2311
|
});
|
|
2323
2312
|
}
|
|
2324
2313
|
function a(o, u) {
|
|
2325
|
-
return
|
|
2314
|
+
return Ye({
|
|
2326
2315
|
data: o,
|
|
2327
2316
|
path: e.path,
|
|
2328
|
-
errorMaps: [
|
|
2329
|
-
e.common.contextualErrorMap,
|
|
2330
|
-
e.schemaErrorMap,
|
|
2331
|
-
Ne(),
|
|
2332
|
-
ce
|
|
2333
|
-
].filter((c) => !!c),
|
|
2317
|
+
errorMaps: [e.common.contextualErrorMap, e.schemaErrorMap, We(), he].filter((d) => !!d),
|
|
2334
2318
|
issueData: {
|
|
2335
|
-
code:
|
|
2319
|
+
code: c.invalid_return_type,
|
|
2336
2320
|
returnTypeError: u
|
|
2337
2321
|
}
|
|
2338
2322
|
});
|
|
2339
2323
|
}
|
|
2340
2324
|
const s = { errorMap: e.common.contextualErrorMap }, i = e.data;
|
|
2341
|
-
if (this._def.returns instanceof
|
|
2325
|
+
if (this._def.returns instanceof pe) {
|
|
2342
2326
|
const o = this;
|
|
2343
|
-
return
|
|
2344
|
-
const
|
|
2345
|
-
throw
|
|
2346
|
-
}), k = await Reflect.apply(i, this,
|
|
2327
|
+
return R(async function(...u) {
|
|
2328
|
+
const d = new Z([]), p = await o._def.args.parseAsync(u, s).catch((j) => {
|
|
2329
|
+
throw d.addIssue(r(u, j)), d;
|
|
2330
|
+
}), k = await Reflect.apply(i, this, p);
|
|
2347
2331
|
return await o._def.returns._def.type.parseAsync(k, s).catch((j) => {
|
|
2348
|
-
throw
|
|
2332
|
+
throw d.addIssue(a(k, j)), d;
|
|
2349
2333
|
});
|
|
2350
2334
|
});
|
|
2351
2335
|
} else {
|
|
2352
2336
|
const o = this;
|
|
2353
|
-
return
|
|
2354
|
-
const
|
|
2355
|
-
if (!
|
|
2356
|
-
throw new
|
|
2357
|
-
const
|
|
2337
|
+
return R(function(...u) {
|
|
2338
|
+
const d = o._def.args.safeParse(u, s);
|
|
2339
|
+
if (!d.success)
|
|
2340
|
+
throw new Z([r(u, d.error)]);
|
|
2341
|
+
const p = Reflect.apply(i, this, d.data), k = o._def.returns.safeParse(p, s);
|
|
2358
2342
|
if (!k.success)
|
|
2359
|
-
throw new
|
|
2343
|
+
throw new Z([a(p, k.error)]);
|
|
2360
2344
|
return k.data;
|
|
2361
2345
|
});
|
|
2362
2346
|
}
|
|
@@ -2368,13 +2352,13 @@ class oe extends _ {
|
|
|
2368
2352
|
return this._def.returns;
|
|
2369
2353
|
}
|
|
2370
2354
|
args(...t) {
|
|
2371
|
-
return new
|
|
2355
|
+
return new fe({
|
|
2372
2356
|
...this._def,
|
|
2373
|
-
args:
|
|
2357
|
+
args: H.create(t).rest(re.create())
|
|
2374
2358
|
});
|
|
2375
2359
|
}
|
|
2376
2360
|
returns(t) {
|
|
2377
|
-
return new
|
|
2361
|
+
return new fe({
|
|
2378
2362
|
...this._def,
|
|
2379
2363
|
returns: t
|
|
2380
2364
|
});
|
|
@@ -2386,15 +2370,15 @@ class oe extends _ {
|
|
|
2386
2370
|
return this.parse(t);
|
|
2387
2371
|
}
|
|
2388
2372
|
static create(t, e, r) {
|
|
2389
|
-
return new
|
|
2390
|
-
args: t ||
|
|
2391
|
-
returns: e ||
|
|
2373
|
+
return new fe({
|
|
2374
|
+
args: t || H.create([]).rest(re.create()),
|
|
2375
|
+
returns: e || re.create(),
|
|
2392
2376
|
typeName: y.ZodFunction,
|
|
2393
|
-
...
|
|
2377
|
+
..._(r)
|
|
2394
2378
|
});
|
|
2395
2379
|
}
|
|
2396
2380
|
}
|
|
2397
|
-
class
|
|
2381
|
+
class Oe extends v {
|
|
2398
2382
|
get schema() {
|
|
2399
2383
|
return this._def.getter();
|
|
2400
2384
|
}
|
|
@@ -2403,18 +2387,18 @@ class ke extends _ {
|
|
|
2403
2387
|
return this._def.getter()._parse({ data: e.data, path: e.path, parent: e });
|
|
2404
2388
|
}
|
|
2405
2389
|
}
|
|
2406
|
-
|
|
2390
|
+
Oe.create = (n, t) => new Oe({
|
|
2407
2391
|
getter: n,
|
|
2408
2392
|
typeName: y.ZodLazy,
|
|
2409
|
-
...
|
|
2393
|
+
..._(t)
|
|
2410
2394
|
});
|
|
2411
|
-
class
|
|
2395
|
+
class Pe extends v {
|
|
2412
2396
|
_parse(t) {
|
|
2413
2397
|
if (t.data !== this._def.value) {
|
|
2414
2398
|
const e = this._getOrReturnCtx(t);
|
|
2415
2399
|
return l(e, {
|
|
2416
2400
|
received: e.data,
|
|
2417
|
-
code:
|
|
2401
|
+
code: c.invalid_literal,
|
|
2418
2402
|
expected: this._def.value
|
|
2419
2403
|
}), g;
|
|
2420
2404
|
}
|
|
@@ -2424,21 +2408,21 @@ class Te extends _ {
|
|
|
2424
2408
|
return this._def.value;
|
|
2425
2409
|
}
|
|
2426
2410
|
}
|
|
2427
|
-
|
|
2411
|
+
Pe.create = (n, t) => new Pe({
|
|
2428
2412
|
value: n,
|
|
2429
2413
|
typeName: y.ZodLiteral,
|
|
2430
|
-
...
|
|
2414
|
+
..._(t)
|
|
2431
2415
|
});
|
|
2432
|
-
function
|
|
2433
|
-
return new
|
|
2416
|
+
function mt(n, t) {
|
|
2417
|
+
return new K({
|
|
2434
2418
|
values: n,
|
|
2435
2419
|
typeName: y.ZodEnum,
|
|
2436
|
-
...
|
|
2420
|
+
..._(t)
|
|
2437
2421
|
});
|
|
2438
2422
|
}
|
|
2439
|
-
class
|
|
2423
|
+
class K extends v {
|
|
2440
2424
|
constructor() {
|
|
2441
|
-
super(...arguments),
|
|
2425
|
+
super(...arguments), de.set(this, void 0);
|
|
2442
2426
|
}
|
|
2443
2427
|
_parse(t) {
|
|
2444
2428
|
if (typeof t.data != "string") {
|
|
@@ -2446,18 +2430,18 @@ class J extends _ {
|
|
|
2446
2430
|
return l(e, {
|
|
2447
2431
|
expected: w.joinValues(r),
|
|
2448
2432
|
received: e.parsedType,
|
|
2449
|
-
code:
|
|
2433
|
+
code: c.invalid_type
|
|
2450
2434
|
}), g;
|
|
2451
2435
|
}
|
|
2452
|
-
if (
|
|
2436
|
+
if (_e(this, de, "f") || lt(this, de, new Set(this._def.values), "f"), !_e(this, de, "f").has(t.data)) {
|
|
2453
2437
|
const e = this._getOrReturnCtx(t), r = this._def.values;
|
|
2454
2438
|
return l(e, {
|
|
2455
2439
|
received: e.data,
|
|
2456
|
-
code:
|
|
2440
|
+
code: c.invalid_enum_value,
|
|
2457
2441
|
options: r
|
|
2458
2442
|
}), g;
|
|
2459
2443
|
}
|
|
2460
|
-
return
|
|
2444
|
+
return R(t.data);
|
|
2461
2445
|
}
|
|
2462
2446
|
get options() {
|
|
2463
2447
|
return this._def.values;
|
|
@@ -2481,79 +2465,79 @@ class J extends _ {
|
|
|
2481
2465
|
return t;
|
|
2482
2466
|
}
|
|
2483
2467
|
extract(t, e = this._def) {
|
|
2484
|
-
return
|
|
2468
|
+
return K.create(t, {
|
|
2485
2469
|
...this._def,
|
|
2486
2470
|
...e
|
|
2487
2471
|
});
|
|
2488
2472
|
}
|
|
2489
2473
|
exclude(t, e = this._def) {
|
|
2490
|
-
return
|
|
2474
|
+
return K.create(this.options.filter((r) => !t.includes(r)), {
|
|
2491
2475
|
...this._def,
|
|
2492
2476
|
...e
|
|
2493
2477
|
});
|
|
2494
2478
|
}
|
|
2495
2479
|
}
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
class
|
|
2480
|
+
de = /* @__PURE__ */ new WeakMap();
|
|
2481
|
+
K.create = mt;
|
|
2482
|
+
class Ce extends v {
|
|
2499
2483
|
constructor() {
|
|
2500
|
-
super(...arguments),
|
|
2484
|
+
super(...arguments), le.set(this, void 0);
|
|
2501
2485
|
}
|
|
2502
2486
|
_parse(t) {
|
|
2503
2487
|
const e = w.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(t);
|
|
2504
|
-
if (r.parsedType !==
|
|
2488
|
+
if (r.parsedType !== h.string && r.parsedType !== h.number) {
|
|
2505
2489
|
const a = w.objectValues(e);
|
|
2506
2490
|
return l(r, {
|
|
2507
2491
|
expected: w.joinValues(a),
|
|
2508
2492
|
received: r.parsedType,
|
|
2509
|
-
code:
|
|
2493
|
+
code: c.invalid_type
|
|
2510
2494
|
}), g;
|
|
2511
2495
|
}
|
|
2512
|
-
if (
|
|
2496
|
+
if (_e(this, le, "f") || lt(this, le, new Set(w.getValidEnumValues(this._def.values)), "f"), !_e(this, le, "f").has(t.data)) {
|
|
2513
2497
|
const a = w.objectValues(e);
|
|
2514
2498
|
return l(r, {
|
|
2515
2499
|
received: r.data,
|
|
2516
|
-
code:
|
|
2500
|
+
code: c.invalid_enum_value,
|
|
2517
2501
|
options: a
|
|
2518
2502
|
}), g;
|
|
2519
2503
|
}
|
|
2520
|
-
return
|
|
2504
|
+
return R(t.data);
|
|
2521
2505
|
}
|
|
2522
2506
|
get enum() {
|
|
2523
2507
|
return this._def.values;
|
|
2524
2508
|
}
|
|
2525
2509
|
}
|
|
2526
|
-
|
|
2527
|
-
|
|
2510
|
+
le = /* @__PURE__ */ new WeakMap();
|
|
2511
|
+
Ce.create = (n, t) => new Ce({
|
|
2528
2512
|
values: n,
|
|
2529
2513
|
typeName: y.ZodNativeEnum,
|
|
2530
|
-
...
|
|
2514
|
+
..._(t)
|
|
2531
2515
|
});
|
|
2532
|
-
class
|
|
2516
|
+
class pe extends v {
|
|
2533
2517
|
unwrap() {
|
|
2534
2518
|
return this._def.type;
|
|
2535
2519
|
}
|
|
2536
2520
|
_parse(t) {
|
|
2537
2521
|
const { ctx: e } = this._processInputParams(t);
|
|
2538
|
-
if (e.parsedType !==
|
|
2522
|
+
if (e.parsedType !== h.promise && e.common.async === !1)
|
|
2539
2523
|
return l(e, {
|
|
2540
|
-
code:
|
|
2541
|
-
expected:
|
|
2524
|
+
code: c.invalid_type,
|
|
2525
|
+
expected: h.promise,
|
|
2542
2526
|
received: e.parsedType
|
|
2543
2527
|
}), g;
|
|
2544
|
-
const r = e.parsedType ===
|
|
2545
|
-
return
|
|
2528
|
+
const r = e.parsedType === h.promise ? e.data : Promise.resolve(e.data);
|
|
2529
|
+
return R(r.then((a) => this._def.type.parseAsync(a, {
|
|
2546
2530
|
path: e.path,
|
|
2547
2531
|
errorMap: e.common.contextualErrorMap
|
|
2548
2532
|
})));
|
|
2549
2533
|
}
|
|
2550
2534
|
}
|
|
2551
|
-
|
|
2535
|
+
pe.create = (n, t) => new pe({
|
|
2552
2536
|
type: n,
|
|
2553
2537
|
typeName: y.ZodPromise,
|
|
2554
|
-
...
|
|
2538
|
+
..._(t)
|
|
2555
2539
|
});
|
|
2556
|
-
class
|
|
2540
|
+
class B extends v {
|
|
2557
2541
|
innerType() {
|
|
2558
2542
|
return this._def.schema;
|
|
2559
2543
|
}
|
|
@@ -2580,7 +2564,7 @@ class L extends _ {
|
|
|
2580
2564
|
path: r.path,
|
|
2581
2565
|
parent: r
|
|
2582
2566
|
});
|
|
2583
|
-
return u.status === "aborted" ? g : u.status === "dirty" || e.value === "dirty" ?
|
|
2567
|
+
return u.status === "aborted" ? g : u.status === "dirty" || e.value === "dirty" ? ue(u.value) : u;
|
|
2584
2568
|
});
|
|
2585
2569
|
{
|
|
2586
2570
|
if (e.value === "aborted")
|
|
@@ -2590,7 +2574,7 @@ class L extends _ {
|
|
|
2590
2574
|
path: r.path,
|
|
2591
2575
|
parent: r
|
|
2592
2576
|
});
|
|
2593
|
-
return o.status === "aborted" ? g : o.status === "dirty" || e.value === "dirty" ?
|
|
2577
|
+
return o.status === "aborted" ? g : o.status === "dirty" || e.value === "dirty" ? ue(o.value) : o;
|
|
2594
2578
|
}
|
|
2595
2579
|
}
|
|
2596
2580
|
if (a.type === "refinement") {
|
|
@@ -2619,60 +2603,63 @@ class L extends _ {
|
|
|
2619
2603
|
path: r.path,
|
|
2620
2604
|
parent: r
|
|
2621
2605
|
});
|
|
2622
|
-
if (!
|
|
2606
|
+
if (!ne(i))
|
|
2623
2607
|
return i;
|
|
2624
2608
|
const o = a.transform(i.value, s);
|
|
2625
2609
|
if (o instanceof Promise)
|
|
2626
2610
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2627
2611
|
return { status: e.value, value: o };
|
|
2628
2612
|
} else
|
|
2629
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) =>
|
|
2613
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => ne(i) ? Promise.resolve(a.transform(i.value, s)).then((o) => ({
|
|
2614
|
+
status: e.value,
|
|
2615
|
+
value: o
|
|
2616
|
+
})) : i);
|
|
2630
2617
|
w.assertNever(a);
|
|
2631
2618
|
}
|
|
2632
2619
|
}
|
|
2633
|
-
|
|
2620
|
+
B.create = (n, t, e) => new B({
|
|
2634
2621
|
schema: n,
|
|
2635
2622
|
typeName: y.ZodEffects,
|
|
2636
2623
|
effect: t,
|
|
2637
|
-
...
|
|
2624
|
+
..._(e)
|
|
2638
2625
|
});
|
|
2639
|
-
|
|
2626
|
+
B.createWithPreprocess = (n, t, e) => new B({
|
|
2640
2627
|
schema: t,
|
|
2641
2628
|
effect: { type: "preprocess", transform: n },
|
|
2642
2629
|
typeName: y.ZodEffects,
|
|
2643
|
-
...
|
|
2630
|
+
..._(e)
|
|
2644
2631
|
});
|
|
2645
|
-
class
|
|
2632
|
+
class q extends v {
|
|
2646
2633
|
_parse(t) {
|
|
2647
|
-
return this._getType(t) ===
|
|
2634
|
+
return this._getType(t) === h.undefined ? R(void 0) : this._def.innerType._parse(t);
|
|
2648
2635
|
}
|
|
2649
2636
|
unwrap() {
|
|
2650
2637
|
return this._def.innerType;
|
|
2651
2638
|
}
|
|
2652
2639
|
}
|
|
2653
|
-
|
|
2640
|
+
q.create = (n, t) => new q({
|
|
2654
2641
|
innerType: n,
|
|
2655
2642
|
typeName: y.ZodOptional,
|
|
2656
|
-
...
|
|
2643
|
+
..._(t)
|
|
2657
2644
|
});
|
|
2658
|
-
class
|
|
2645
|
+
class ee extends v {
|
|
2659
2646
|
_parse(t) {
|
|
2660
|
-
return this._getType(t) ===
|
|
2647
|
+
return this._getType(t) === h.null ? R(null) : this._def.innerType._parse(t);
|
|
2661
2648
|
}
|
|
2662
2649
|
unwrap() {
|
|
2663
2650
|
return this._def.innerType;
|
|
2664
2651
|
}
|
|
2665
2652
|
}
|
|
2666
|
-
|
|
2653
|
+
ee.create = (n, t) => new ee({
|
|
2667
2654
|
innerType: n,
|
|
2668
2655
|
typeName: y.ZodNullable,
|
|
2669
|
-
...
|
|
2656
|
+
..._(t)
|
|
2670
2657
|
});
|
|
2671
|
-
class
|
|
2658
|
+
class Me extends v {
|
|
2672
2659
|
_parse(t) {
|
|
2673
2660
|
const { ctx: e } = this._processInputParams(t);
|
|
2674
2661
|
let r = e.data;
|
|
2675
|
-
return e.parsedType ===
|
|
2662
|
+
return e.parsedType === h.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
|
|
2676
2663
|
data: r,
|
|
2677
2664
|
path: e.path,
|
|
2678
2665
|
parent: e
|
|
@@ -2682,13 +2669,13 @@ class Pe extends _ {
|
|
|
2682
2669
|
return this._def.innerType;
|
|
2683
2670
|
}
|
|
2684
2671
|
}
|
|
2685
|
-
|
|
2672
|
+
Me.create = (n, t) => new Me({
|
|
2686
2673
|
innerType: n,
|
|
2687
2674
|
typeName: y.ZodDefault,
|
|
2688
2675
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2689
|
-
...
|
|
2676
|
+
..._(t)
|
|
2690
2677
|
});
|
|
2691
|
-
class
|
|
2678
|
+
class De extends v {
|
|
2692
2679
|
_parse(t) {
|
|
2693
2680
|
const { ctx: e } = this._processInputParams(t), r = {
|
|
2694
2681
|
...e,
|
|
@@ -2703,11 +2690,11 @@ class Ce extends _ {
|
|
|
2703
2690
|
...r
|
|
2704
2691
|
}
|
|
2705
2692
|
});
|
|
2706
|
-
return
|
|
2693
|
+
return ge(a) ? a.then((s) => ({
|
|
2707
2694
|
status: "valid",
|
|
2708
2695
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2709
2696
|
get error() {
|
|
2710
|
-
return new
|
|
2697
|
+
return new Z(r.common.issues);
|
|
2711
2698
|
},
|
|
2712
2699
|
input: r.data
|
|
2713
2700
|
})
|
|
@@ -2715,7 +2702,7 @@ class Ce extends _ {
|
|
|
2715
2702
|
status: "valid",
|
|
2716
2703
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2717
2704
|
get error() {
|
|
2718
|
-
return new
|
|
2705
|
+
return new Z(r.common.issues);
|
|
2719
2706
|
},
|
|
2720
2707
|
input: r.data
|
|
2721
2708
|
})
|
|
@@ -2725,31 +2712,31 @@ class Ce extends _ {
|
|
|
2725
2712
|
return this._def.innerType;
|
|
2726
2713
|
}
|
|
2727
2714
|
}
|
|
2728
|
-
|
|
2715
|
+
De.create = (n, t) => new De({
|
|
2729
2716
|
innerType: n,
|
|
2730
2717
|
typeName: y.ZodCatch,
|
|
2731
2718
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2732
|
-
...
|
|
2719
|
+
..._(t)
|
|
2733
2720
|
});
|
|
2734
|
-
class
|
|
2721
|
+
class Ve extends v {
|
|
2735
2722
|
_parse(t) {
|
|
2736
|
-
if (this._getType(t) !==
|
|
2723
|
+
if (this._getType(t) !== h.nan) {
|
|
2737
2724
|
const r = this._getOrReturnCtx(t);
|
|
2738
2725
|
return l(r, {
|
|
2739
|
-
code:
|
|
2740
|
-
expected:
|
|
2726
|
+
code: c.invalid_type,
|
|
2727
|
+
expected: h.nan,
|
|
2741
2728
|
received: r.parsedType
|
|
2742
2729
|
}), g;
|
|
2743
2730
|
}
|
|
2744
2731
|
return { status: "valid", value: t.data };
|
|
2745
2732
|
}
|
|
2746
2733
|
}
|
|
2747
|
-
|
|
2734
|
+
Ve.create = (n) => new Ve({
|
|
2748
2735
|
typeName: y.ZodNaN,
|
|
2749
|
-
...
|
|
2736
|
+
..._(n)
|
|
2750
2737
|
});
|
|
2751
|
-
const
|
|
2752
|
-
class
|
|
2738
|
+
const Jn = Symbol("zod_brand");
|
|
2739
|
+
class pt extends v {
|
|
2753
2740
|
_parse(t) {
|
|
2754
2741
|
const { ctx: e } = this._processInputParams(t), r = e.data;
|
|
2755
2742
|
return this._def.type._parse({
|
|
@@ -2762,7 +2749,7 @@ class Ue extends _ {
|
|
|
2762
2749
|
return this._def.type;
|
|
2763
2750
|
}
|
|
2764
2751
|
}
|
|
2765
|
-
class
|
|
2752
|
+
class Ie extends v {
|
|
2766
2753
|
_parse(t) {
|
|
2767
2754
|
const { status: e, ctx: r } = this._processInputParams(t);
|
|
2768
2755
|
if (r.common.async)
|
|
@@ -2772,7 +2759,7 @@ class De extends _ {
|
|
|
2772
2759
|
path: r.path,
|
|
2773
2760
|
parent: r
|
|
2774
2761
|
});
|
|
2775
|
-
return s.status === "aborted" ? g : s.status === "dirty" ? (e.dirty(),
|
|
2762
|
+
return s.status === "aborted" ? g : s.status === "dirty" ? (e.dirty(), ue(s.value)) : this._def.out._parseAsync({
|
|
2776
2763
|
data: s.value,
|
|
2777
2764
|
path: r.path,
|
|
2778
2765
|
parent: r
|
|
@@ -2795,217 +2782,98 @@ class De extends _ {
|
|
|
2795
2782
|
}
|
|
2796
2783
|
}
|
|
2797
2784
|
static create(t, e) {
|
|
2798
|
-
return new
|
|
2785
|
+
return new Ie({
|
|
2799
2786
|
in: t,
|
|
2800
2787
|
out: e,
|
|
2801
2788
|
typeName: y.ZodPipeline
|
|
2802
2789
|
});
|
|
2803
2790
|
}
|
|
2804
2791
|
}
|
|
2805
|
-
class
|
|
2792
|
+
class Ne extends v {
|
|
2806
2793
|
_parse(t) {
|
|
2807
|
-
const e = this._def.innerType._parse(t), r = (a) => (
|
|
2808
|
-
return
|
|
2794
|
+
const e = this._def.innerType._parse(t), r = (a) => (ne(a) && (a.value = Object.freeze(a.value)), a);
|
|
2795
|
+
return ge(e) ? e.then((a) => r(a)) : r(e);
|
|
2809
2796
|
}
|
|
2810
2797
|
unwrap() {
|
|
2811
2798
|
return this._def.innerType;
|
|
2812
2799
|
}
|
|
2813
2800
|
}
|
|
2814
|
-
|
|
2801
|
+
Ne.create = (n, t) => new Ne({
|
|
2815
2802
|
innerType: n,
|
|
2816
2803
|
typeName: y.ZodReadonly,
|
|
2817
|
-
...
|
|
2804
|
+
..._(t)
|
|
2818
2805
|
});
|
|
2819
|
-
function
|
|
2806
|
+
function st(n, t) {
|
|
2820
2807
|
const e = typeof n == "function" ? n(t) : typeof n == "string" ? { message: n } : n;
|
|
2821
2808
|
return typeof e == "string" ? { message: e } : e;
|
|
2822
2809
|
}
|
|
2823
|
-
function
|
|
2824
|
-
return n ?
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
const k = it(t, r), A = (m = (c = k.fatal) !== null && c !== void 0 ? c : e) !== null && m !== void 0 ? m : !0;
|
|
2832
|
-
a.addIssue({ code: "custom", ...k, fatal: A });
|
|
2810
|
+
function Ut(n, t = {}, e) {
|
|
2811
|
+
return n ? me.create().superRefine((r, a) => {
|
|
2812
|
+
const s = n(r);
|
|
2813
|
+
if (s instanceof Promise)
|
|
2814
|
+
return s.then((i) => {
|
|
2815
|
+
if (!i) {
|
|
2816
|
+
const o = st(t, r), u = o.fatal ?? e ?? !0;
|
|
2817
|
+
a.addIssue({ code: "custom", ...o, fatal: u });
|
|
2833
2818
|
}
|
|
2834
2819
|
});
|
|
2835
|
-
if (!
|
|
2836
|
-
const
|
|
2837
|
-
a.addIssue({ code: "custom", ...
|
|
2820
|
+
if (!s) {
|
|
2821
|
+
const i = st(t, r), o = i.fatal ?? e ?? !0;
|
|
2822
|
+
a.addIssue({ code: "custom", ...i, fatal: o });
|
|
2838
2823
|
}
|
|
2839
|
-
}) :
|
|
2824
|
+
}) : me.create();
|
|
2840
2825
|
}
|
|
2841
|
-
const
|
|
2842
|
-
object:
|
|
2826
|
+
const Kn = {
|
|
2827
|
+
object: P.lazycreate
|
|
2843
2828
|
};
|
|
2844
2829
|
var y;
|
|
2845
2830
|
(function(n) {
|
|
2846
2831
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2847
2832
|
})(y || (y = {}));
|
|
2848
|
-
const
|
|
2833
|
+
const ea = (n, t = {
|
|
2849
2834
|
message: `Input not instance of ${n.name}`
|
|
2850
|
-
}) =>
|
|
2851
|
-
string: (n) =>
|
|
2852
|
-
number: (n) =>
|
|
2853
|
-
boolean: (n) =>
|
|
2835
|
+
}) => Ut((e) => e instanceof n, t), Xt = L.create, Gt = G.create, ta = Ve.create, ra = J.create, Jt = ve.create, na = ae.create, aa = $e.create, sa = we.create, ia = be.create, oa = me.create, ca = re.create, ua = U.create, da = Le.create, la = F.create, fa = P.create, ha = P.strictCreate, ma = xe.create, pa = ze.create, ya = ke.create, ga = H.create, _a = Te.create, va = Se.create, wa = se.create, ba = fe.create, xa = Oe.create, ka = Pe.create, Ta = K.create, Oa = Ce.create, Pa = pe.create, Ca = B.create, Ma = q.create, Da = ee.create, Na = B.createWithPreprocess, Ea = Ie.create, Ia = () => Xt().optional(), Ra = () => Gt().optional(), Aa = () => Jt().optional(), Za = {
|
|
2836
|
+
string: (n) => L.create({ ...n, coerce: !0 }),
|
|
2837
|
+
number: (n) => G.create({ ...n, coerce: !0 }),
|
|
2838
|
+
boolean: (n) => ve.create({
|
|
2854
2839
|
...n,
|
|
2855
2840
|
coerce: !0
|
|
2856
2841
|
}),
|
|
2857
|
-
bigint: (n) =>
|
|
2858
|
-
date: (n) =>
|
|
2859
|
-
},
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
defaultErrorMap: ce,
|
|
2863
|
-
setErrorMap: At,
|
|
2864
|
-
getErrorMap: Ne,
|
|
2865
|
-
makeIssue: Ie,
|
|
2866
|
-
EMPTY_PATH: Rt,
|
|
2867
|
-
addIssueToContext: l,
|
|
2868
|
-
ParseStatus: N,
|
|
2869
|
-
INVALID: g,
|
|
2870
|
-
DIRTY: ie,
|
|
2871
|
-
OK: Z,
|
|
2872
|
-
isAborted: qe,
|
|
2873
|
-
isDirty: He,
|
|
2874
|
-
isValid: re,
|
|
2875
|
-
isAsync: ye,
|
|
2876
|
-
get util() {
|
|
2877
|
-
return w;
|
|
2878
|
-
},
|
|
2879
|
-
get objectUtil() {
|
|
2880
|
-
return ze;
|
|
2881
|
-
},
|
|
2882
|
-
ZodParsedType: f,
|
|
2883
|
-
getParsedType: U,
|
|
2884
|
-
ZodType: _,
|
|
2885
|
-
datetimeRegex: yt,
|
|
2886
|
-
ZodString: Y,
|
|
2887
|
-
ZodNumber: X,
|
|
2888
|
-
ZodBigInt: G,
|
|
2889
|
-
ZodBoolean: ge,
|
|
2890
|
-
ZodDate: ne,
|
|
2891
|
-
ZodSymbol: Ae,
|
|
2892
|
-
ZodUndefined: ve,
|
|
2893
|
-
ZodNull: _e,
|
|
2894
|
-
ZodAny: ue,
|
|
2895
|
-
ZodUnknown: te,
|
|
2896
|
-
ZodNever: Q,
|
|
2897
|
-
ZodVoid: Re,
|
|
2898
|
-
ZodArray: W,
|
|
2899
|
-
ZodObject: T,
|
|
2900
|
-
ZodUnion: we,
|
|
2901
|
-
ZodDiscriminatedUnion: Le,
|
|
2902
|
-
ZodIntersection: be,
|
|
2903
|
-
ZodTuple: q,
|
|
2904
|
-
ZodRecord: xe,
|
|
2905
|
-
ZodMap: je,
|
|
2906
|
-
ZodSet: ae,
|
|
2907
|
-
ZodFunction: oe,
|
|
2908
|
-
ZodLazy: ke,
|
|
2909
|
-
ZodLiteral: Te,
|
|
2910
|
-
ZodEnum: J,
|
|
2911
|
-
ZodNativeEnum: Oe,
|
|
2912
|
-
ZodPromise: de,
|
|
2913
|
-
ZodEffects: L,
|
|
2914
|
-
ZodTransformer: L,
|
|
2915
|
-
ZodOptional: V,
|
|
2916
|
-
ZodNullable: K,
|
|
2917
|
-
ZodDefault: Pe,
|
|
2918
|
-
ZodCatch: Ce,
|
|
2919
|
-
ZodNaN: Ye,
|
|
2920
|
-
BRAND: nr,
|
|
2921
|
-
ZodBranded: Ue,
|
|
2922
|
-
ZodPipeline: De,
|
|
2923
|
-
ZodReadonly: Me,
|
|
2924
|
-
custom: vt,
|
|
2925
|
-
Schema: _,
|
|
2926
|
-
ZodSchema: _,
|
|
2927
|
-
late: ar,
|
|
2928
|
-
get ZodFirstPartyTypeKind() {
|
|
2929
|
-
return y;
|
|
2930
|
-
},
|
|
2931
|
-
coerce: Lr,
|
|
2932
|
-
any: fr,
|
|
2933
|
-
array: yr,
|
|
2934
|
-
bigint: or,
|
|
2935
|
-
boolean: bt,
|
|
2936
|
-
date: cr,
|
|
2937
|
-
discriminatedUnion: wr,
|
|
2938
|
-
effect: ot,
|
|
2939
|
-
enum: Dr,
|
|
2940
|
-
function: Pr,
|
|
2941
|
-
instanceof: sr,
|
|
2942
|
-
intersection: br,
|
|
2943
|
-
lazy: Cr,
|
|
2944
|
-
literal: Mr,
|
|
2945
|
-
map: Tr,
|
|
2946
|
-
nan: ir,
|
|
2947
|
-
nativeEnum: Er,
|
|
2948
|
-
never: mr,
|
|
2949
|
-
null: lr,
|
|
2950
|
-
nullable: Zr,
|
|
2951
|
-
number: wt,
|
|
2952
|
-
object: gr,
|
|
2953
|
-
oboolean: Wr,
|
|
2954
|
-
onumber: Yr,
|
|
2955
|
-
optional: Ir,
|
|
2956
|
-
ostring: jr,
|
|
2957
|
-
pipeline: Rr,
|
|
2958
|
-
preprocess: Ar,
|
|
2959
|
-
promise: Nr,
|
|
2960
|
-
record: kr,
|
|
2961
|
-
set: Or,
|
|
2962
|
-
strictObject: vr,
|
|
2963
|
-
string: _t,
|
|
2964
|
-
symbol: ur,
|
|
2965
|
-
transformer: ot,
|
|
2966
|
-
tuple: xr,
|
|
2967
|
-
undefined: dr,
|
|
2968
|
-
union: _r,
|
|
2969
|
-
unknown: hr,
|
|
2970
|
-
void: pr,
|
|
2971
|
-
NEVER: $r,
|
|
2972
|
-
ZodIssueCode: d,
|
|
2973
|
-
quotelessJson: Zt,
|
|
2974
|
-
ZodError: R
|
|
2975
|
-
});
|
|
2976
|
-
const xt = 6048e5, Wa = 864e5, Sr = 6e4, Fr = 36e5, Vr = 1e3, ct = Symbol.for("constructDateFrom");
|
|
2977
|
-
function E(n, t) {
|
|
2978
|
-
return typeof n == "function" ? n(t) : n && typeof n == "object" && ct in n ? n[ct](t) : n instanceof Date ? new n.constructor(t) : new Date(t);
|
|
2842
|
+
bigint: (n) => J.create({ ...n, coerce: !0 }),
|
|
2843
|
+
date: (n) => ae.create({ ...n, coerce: !0 })
|
|
2844
|
+
}, ja = g, yt = 6048e5, Wa = 864e5, Kt = 6e4, er = 36e5, tr = 1e3, it = Symbol.for("constructDateFrom");
|
|
2845
|
+
function N(n, t) {
|
|
2846
|
+
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);
|
|
2979
2847
|
}
|
|
2980
|
-
function
|
|
2981
|
-
return
|
|
2848
|
+
function E(n, t) {
|
|
2849
|
+
return N(t || n, n);
|
|
2982
2850
|
}
|
|
2983
|
-
function
|
|
2984
|
-
const r =
|
|
2985
|
-
return isNaN(t) ?
|
|
2851
|
+
function gt(n, t, e) {
|
|
2852
|
+
const r = E(n, e == null ? void 0 : e.in);
|
|
2853
|
+
return isNaN(t) ? N((e == null ? void 0 : e.in) || n, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
2986
2854
|
}
|
|
2987
|
-
let
|
|
2988
|
-
function
|
|
2989
|
-
return
|
|
2855
|
+
let rr = {};
|
|
2856
|
+
function ye() {
|
|
2857
|
+
return rr;
|
|
2990
2858
|
}
|
|
2991
|
-
function
|
|
2992
|
-
var o, u,
|
|
2993
|
-
const e =
|
|
2859
|
+
function X(n, t) {
|
|
2860
|
+
var o, u, d, p;
|
|
2861
|
+
const e = ye(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : u.weekStartsOn) ?? e.weekStartsOn ?? ((p = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : p.weekStartsOn) ?? 0, a = E(n, t == null ? void 0 : t.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
|
|
2994
2862
|
return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
|
|
2995
2863
|
}
|
|
2996
|
-
function
|
|
2997
|
-
return
|
|
2864
|
+
function ie(n, t) {
|
|
2865
|
+
return X(n, { ...t, weekStartsOn: 1 });
|
|
2998
2866
|
}
|
|
2999
|
-
function
|
|
3000
|
-
const e =
|
|
2867
|
+
function nr(n, t) {
|
|
2868
|
+
const e = E(n, t == null ? void 0 : t.in), r = e.getFullYear(), a = N(e, 0);
|
|
3001
2869
|
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
3002
|
-
const s =
|
|
2870
|
+
const s = ie(a), i = N(e, 0);
|
|
3003
2871
|
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
3004
|
-
const o =
|
|
2872
|
+
const o = ie(i);
|
|
3005
2873
|
return e.getTime() >= s.getTime() ? r + 1 : e.getTime() >= o.getTime() ? r : r - 1;
|
|
3006
2874
|
}
|
|
3007
|
-
function
|
|
3008
|
-
const t =
|
|
2875
|
+
function _t(n) {
|
|
2876
|
+
const t = E(n), e = new Date(
|
|
3009
2877
|
Date.UTC(
|
|
3010
2878
|
t.getFullYear(),
|
|
3011
2879
|
t.getMonth(),
|
|
@@ -3018,17 +2886,17 @@ function Tt(n) {
|
|
|
3018
2886
|
);
|
|
3019
2887
|
return e.setUTCFullYear(t.getFullYear()), +n - +e;
|
|
3020
2888
|
}
|
|
3021
|
-
function
|
|
3022
|
-
const e =
|
|
3023
|
-
return r.setFullYear(e, 0, 4), r.setHours(0, 0, 0, 0),
|
|
2889
|
+
function ar(n, t) {
|
|
2890
|
+
const e = nr(n, t), r = N(n, 0);
|
|
2891
|
+
return r.setFullYear(e, 0, 4), r.setHours(0, 0, 0, 0), ie(r);
|
|
3024
2892
|
}
|
|
3025
|
-
function
|
|
2893
|
+
function sr(n) {
|
|
3026
2894
|
return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]";
|
|
3027
2895
|
}
|
|
3028
|
-
function
|
|
3029
|
-
return !(!
|
|
2896
|
+
function Ya(n) {
|
|
2897
|
+
return !(!sr(n) && typeof n != "number" || isNaN(+E(n)));
|
|
3030
2898
|
}
|
|
3031
|
-
const
|
|
2899
|
+
const ir = {
|
|
3032
2900
|
lessThanXSeconds: {
|
|
3033
2901
|
one: "less than a second",
|
|
3034
2902
|
other: "less than {{count}} seconds"
|
|
@@ -3090,54 +2958,54 @@ const Ur = {
|
|
|
3090
2958
|
one: "almost 1 year",
|
|
3091
2959
|
other: "almost {{count}} years"
|
|
3092
2960
|
}
|
|
3093
|
-
},
|
|
2961
|
+
}, or = (n, t, e) => {
|
|
3094
2962
|
let r;
|
|
3095
|
-
const a =
|
|
2963
|
+
const a = ir[n];
|
|
3096
2964
|
return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
3097
2965
|
};
|
|
3098
|
-
function
|
|
2966
|
+
function je(n) {
|
|
3099
2967
|
return (t = {}) => {
|
|
3100
2968
|
const e = t.width ? String(t.width) : n.defaultWidth;
|
|
3101
2969
|
return n.formats[e] || n.formats[n.defaultWidth];
|
|
3102
2970
|
};
|
|
3103
2971
|
}
|
|
3104
|
-
const
|
|
2972
|
+
const cr = {
|
|
3105
2973
|
full: "EEEE, MMMM do, y",
|
|
3106
2974
|
long: "MMMM do, y",
|
|
3107
2975
|
medium: "MMM d, y",
|
|
3108
2976
|
short: "MM/dd/yyyy"
|
|
3109
|
-
},
|
|
2977
|
+
}, ur = {
|
|
3110
2978
|
full: "h:mm:ss a zzzz",
|
|
3111
2979
|
long: "h:mm:ss a z",
|
|
3112
2980
|
medium: "h:mm:ss a",
|
|
3113
2981
|
short: "h:mm a"
|
|
3114
|
-
},
|
|
2982
|
+
}, dr = {
|
|
3115
2983
|
full: "{{date}} 'at' {{time}}",
|
|
3116
2984
|
long: "{{date}} 'at' {{time}}",
|
|
3117
2985
|
medium: "{{date}}, {{time}}",
|
|
3118
2986
|
short: "{{date}}, {{time}}"
|
|
3119
|
-
},
|
|
3120
|
-
date:
|
|
3121
|
-
formats:
|
|
2987
|
+
}, lr = {
|
|
2988
|
+
date: je({
|
|
2989
|
+
formats: cr,
|
|
3122
2990
|
defaultWidth: "full"
|
|
3123
2991
|
}),
|
|
3124
|
-
time:
|
|
3125
|
-
formats:
|
|
2992
|
+
time: je({
|
|
2993
|
+
formats: ur,
|
|
3126
2994
|
defaultWidth: "full"
|
|
3127
2995
|
}),
|
|
3128
|
-
dateTime:
|
|
3129
|
-
formats:
|
|
2996
|
+
dateTime: je({
|
|
2997
|
+
formats: dr,
|
|
3130
2998
|
defaultWidth: "full"
|
|
3131
2999
|
})
|
|
3132
|
-
},
|
|
3000
|
+
}, fr = {
|
|
3133
3001
|
lastWeek: "'last' eeee 'at' p",
|
|
3134
3002
|
yesterday: "'yesterday at' p",
|
|
3135
3003
|
today: "'today at' p",
|
|
3136
3004
|
tomorrow: "'tomorrow at' p",
|
|
3137
3005
|
nextWeek: "eeee 'at' p",
|
|
3138
3006
|
other: "P"
|
|
3139
|
-
},
|
|
3140
|
-
function
|
|
3007
|
+
}, hr = (n, t, e, r) => fr[n];
|
|
3008
|
+
function oe(n) {
|
|
3141
3009
|
return (t, e) => {
|
|
3142
3010
|
const r = e != null && e.context ? String(e.context) : "standalone";
|
|
3143
3011
|
let a;
|
|
@@ -3152,15 +3020,15 @@ function fe(n) {
|
|
|
3152
3020
|
return a[s];
|
|
3153
3021
|
};
|
|
3154
3022
|
}
|
|
3155
|
-
const
|
|
3023
|
+
const mr = {
|
|
3156
3024
|
narrow: ["B", "A"],
|
|
3157
3025
|
abbreviated: ["BC", "AD"],
|
|
3158
3026
|
wide: ["Before Christ", "Anno Domini"]
|
|
3159
|
-
},
|
|
3027
|
+
}, pr = {
|
|
3160
3028
|
narrow: ["1", "2", "3", "4"],
|
|
3161
3029
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
3162
3030
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
3163
|
-
},
|
|
3031
|
+
}, yr = {
|
|
3164
3032
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
3165
3033
|
abbreviated: [
|
|
3166
3034
|
"Jan",
|
|
@@ -3190,7 +3058,7 @@ const rn = {
|
|
|
3190
3058
|
"November",
|
|
3191
3059
|
"December"
|
|
3192
3060
|
]
|
|
3193
|
-
},
|
|
3061
|
+
}, gr = {
|
|
3194
3062
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
3195
3063
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
3196
3064
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -3203,7 +3071,7 @@ const rn = {
|
|
|
3203
3071
|
"Friday",
|
|
3204
3072
|
"Saturday"
|
|
3205
3073
|
]
|
|
3206
|
-
},
|
|
3074
|
+
}, _r = {
|
|
3207
3075
|
narrow: {
|
|
3208
3076
|
am: "a",
|
|
3209
3077
|
pm: "p",
|
|
@@ -3234,7 +3102,7 @@ const rn = {
|
|
|
3234
3102
|
evening: "evening",
|
|
3235
3103
|
night: "night"
|
|
3236
3104
|
}
|
|
3237
|
-
},
|
|
3105
|
+
}, vr = {
|
|
3238
3106
|
narrow: {
|
|
3239
3107
|
am: "a",
|
|
3240
3108
|
pm: "p",
|
|
@@ -3265,7 +3133,7 @@ const rn = {
|
|
|
3265
3133
|
evening: "in the evening",
|
|
3266
3134
|
night: "at night"
|
|
3267
3135
|
}
|
|
3268
|
-
},
|
|
3136
|
+
}, wr = (n, t) => {
|
|
3269
3137
|
const e = Number(n), r = e % 100;
|
|
3270
3138
|
if (r > 20 || r < 10)
|
|
3271
3139
|
switch (r % 10) {
|
|
@@ -3277,61 +3145,61 @@ const rn = {
|
|
|
3277
3145
|
return e + "rd";
|
|
3278
3146
|
}
|
|
3279
3147
|
return e + "th";
|
|
3280
|
-
},
|
|
3281
|
-
ordinalNumber:
|
|
3282
|
-
era:
|
|
3283
|
-
values:
|
|
3148
|
+
}, br = {
|
|
3149
|
+
ordinalNumber: wr,
|
|
3150
|
+
era: oe({
|
|
3151
|
+
values: mr,
|
|
3284
3152
|
defaultWidth: "wide"
|
|
3285
3153
|
}),
|
|
3286
|
-
quarter:
|
|
3287
|
-
values:
|
|
3154
|
+
quarter: oe({
|
|
3155
|
+
values: pr,
|
|
3288
3156
|
defaultWidth: "wide",
|
|
3289
3157
|
argumentCallback: (n) => n - 1
|
|
3290
3158
|
}),
|
|
3291
|
-
month:
|
|
3292
|
-
values:
|
|
3159
|
+
month: oe({
|
|
3160
|
+
values: yr,
|
|
3293
3161
|
defaultWidth: "wide"
|
|
3294
3162
|
}),
|
|
3295
|
-
day:
|
|
3296
|
-
values:
|
|
3163
|
+
day: oe({
|
|
3164
|
+
values: gr,
|
|
3297
3165
|
defaultWidth: "wide"
|
|
3298
3166
|
}),
|
|
3299
|
-
dayPeriod:
|
|
3300
|
-
values:
|
|
3167
|
+
dayPeriod: oe({
|
|
3168
|
+
values: _r,
|
|
3301
3169
|
defaultWidth: "wide",
|
|
3302
|
-
formattingValues:
|
|
3170
|
+
formattingValues: vr,
|
|
3303
3171
|
defaultFormattingWidth: "wide"
|
|
3304
3172
|
})
|
|
3305
3173
|
};
|
|
3306
|
-
function
|
|
3174
|
+
function ce(n) {
|
|
3307
3175
|
return (t, e = {}) => {
|
|
3308
3176
|
const r = e.width, a = r && n.matchPatterns[r] || n.matchPatterns[n.defaultMatchWidth], s = t.match(a);
|
|
3309
3177
|
if (!s)
|
|
3310
3178
|
return null;
|
|
3311
|
-
const i = s[0], o = r && n.parsePatterns[r] || n.parsePatterns[n.defaultParseWidth], u = Array.isArray(o) ?
|
|
3179
|
+
const i = s[0], o = r && n.parsePatterns[r] || n.parsePatterns[n.defaultParseWidth], u = Array.isArray(o) ? kr(o, (k) => k.test(i)) : (
|
|
3312
3180
|
// [TODO] -- I challenge you to fix the type
|
|
3313
|
-
|
|
3181
|
+
xr(o, (k) => k.test(i))
|
|
3314
3182
|
);
|
|
3315
|
-
let
|
|
3316
|
-
|
|
3183
|
+
let d;
|
|
3184
|
+
d = n.valueCallback ? n.valueCallback(u) : u, d = e.valueCallback ? (
|
|
3317
3185
|
// [TODO] -- I challenge you to fix the type
|
|
3318
|
-
e.valueCallback(
|
|
3319
|
-
) :
|
|
3320
|
-
const
|
|
3321
|
-
return { value:
|
|
3186
|
+
e.valueCallback(d)
|
|
3187
|
+
) : d;
|
|
3188
|
+
const p = t.slice(i.length);
|
|
3189
|
+
return { value: d, rest: p };
|
|
3322
3190
|
};
|
|
3323
3191
|
}
|
|
3324
|
-
function
|
|
3192
|
+
function xr(n, t) {
|
|
3325
3193
|
for (const e in n)
|
|
3326
3194
|
if (Object.prototype.hasOwnProperty.call(n, e) && t(n[e]))
|
|
3327
3195
|
return e;
|
|
3328
3196
|
}
|
|
3329
|
-
function
|
|
3197
|
+
function kr(n, t) {
|
|
3330
3198
|
for (let e = 0; e < n.length; e++)
|
|
3331
3199
|
if (t(n[e]))
|
|
3332
3200
|
return e;
|
|
3333
3201
|
}
|
|
3334
|
-
function
|
|
3202
|
+
function Tr(n) {
|
|
3335
3203
|
return (t, e = {}) => {
|
|
3336
3204
|
const r = t.match(n.matchPattern);
|
|
3337
3205
|
if (!r) return null;
|
|
@@ -3343,23 +3211,23 @@ function hn(n) {
|
|
|
3343
3211
|
return { value: i, rest: o };
|
|
3344
3212
|
};
|
|
3345
3213
|
}
|
|
3346
|
-
const
|
|
3214
|
+
const Or = /^(\d+)(th|st|nd|rd)?/i, Pr = /\d+/i, Cr = {
|
|
3347
3215
|
narrow: /^(b|a)/i,
|
|
3348
3216
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
3349
3217
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
3350
|
-
},
|
|
3218
|
+
}, Mr = {
|
|
3351
3219
|
any: [/^b/i, /^(a|c)/i]
|
|
3352
|
-
},
|
|
3220
|
+
}, Dr = {
|
|
3353
3221
|
narrow: /^[1234]/i,
|
|
3354
3222
|
abbreviated: /^q[1234]/i,
|
|
3355
3223
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
3356
|
-
},
|
|
3224
|
+
}, Nr = {
|
|
3357
3225
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
3358
|
-
},
|
|
3226
|
+
}, Er = {
|
|
3359
3227
|
narrow: /^[jfmasond]/i,
|
|
3360
3228
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
3361
3229
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
3362
|
-
},
|
|
3230
|
+
}, Ir = {
|
|
3363
3231
|
narrow: [
|
|
3364
3232
|
/^j/i,
|
|
3365
3233
|
/^f/i,
|
|
@@ -3388,18 +3256,18 @@ const mn = /^(\d+)(th|st|nd|rd)?/i, pn = /\d+/i, yn = {
|
|
|
3388
3256
|
/^n/i,
|
|
3389
3257
|
/^d/i
|
|
3390
3258
|
]
|
|
3391
|
-
},
|
|
3259
|
+
}, Rr = {
|
|
3392
3260
|
narrow: /^[smtwf]/i,
|
|
3393
3261
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
3394
3262
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
3395
3263
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
3396
|
-
},
|
|
3264
|
+
}, Ar = {
|
|
3397
3265
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
3398
3266
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
3399
|
-
},
|
|
3267
|
+
}, Zr = {
|
|
3400
3268
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
3401
3269
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
3402
|
-
},
|
|
3270
|
+
}, jr = {
|
|
3403
3271
|
any: {
|
|
3404
3272
|
am: /^a/i,
|
|
3405
3273
|
pm: /^p/i,
|
|
@@ -3410,78 +3278,78 @@ const mn = /^(\d+)(th|st|nd|rd)?/i, pn = /\d+/i, yn = {
|
|
|
3410
3278
|
evening: /evening/i,
|
|
3411
3279
|
night: /night/i
|
|
3412
3280
|
}
|
|
3413
|
-
},
|
|
3414
|
-
ordinalNumber:
|
|
3415
|
-
matchPattern:
|
|
3416
|
-
parsePattern:
|
|
3281
|
+
}, Wr = {
|
|
3282
|
+
ordinalNumber: Tr({
|
|
3283
|
+
matchPattern: Or,
|
|
3284
|
+
parsePattern: Pr,
|
|
3417
3285
|
valueCallback: (n) => parseInt(n, 10)
|
|
3418
3286
|
}),
|
|
3419
|
-
era:
|
|
3420
|
-
matchPatterns:
|
|
3287
|
+
era: ce({
|
|
3288
|
+
matchPatterns: Cr,
|
|
3421
3289
|
defaultMatchWidth: "wide",
|
|
3422
|
-
parsePatterns:
|
|
3290
|
+
parsePatterns: Mr,
|
|
3423
3291
|
defaultParseWidth: "any"
|
|
3424
3292
|
}),
|
|
3425
|
-
quarter:
|
|
3426
|
-
matchPatterns:
|
|
3293
|
+
quarter: ce({
|
|
3294
|
+
matchPatterns: Dr,
|
|
3427
3295
|
defaultMatchWidth: "wide",
|
|
3428
|
-
parsePatterns:
|
|
3296
|
+
parsePatterns: Nr,
|
|
3429
3297
|
defaultParseWidth: "any",
|
|
3430
3298
|
valueCallback: (n) => n + 1
|
|
3431
3299
|
}),
|
|
3432
|
-
month:
|
|
3433
|
-
matchPatterns:
|
|
3300
|
+
month: ce({
|
|
3301
|
+
matchPatterns: Er,
|
|
3434
3302
|
defaultMatchWidth: "wide",
|
|
3435
|
-
parsePatterns:
|
|
3303
|
+
parsePatterns: Ir,
|
|
3436
3304
|
defaultParseWidth: "any"
|
|
3437
3305
|
}),
|
|
3438
|
-
day:
|
|
3439
|
-
matchPatterns:
|
|
3306
|
+
day: ce({
|
|
3307
|
+
matchPatterns: Rr,
|
|
3440
3308
|
defaultMatchWidth: "wide",
|
|
3441
|
-
parsePatterns:
|
|
3309
|
+
parsePatterns: Ar,
|
|
3442
3310
|
defaultParseWidth: "any"
|
|
3443
3311
|
}),
|
|
3444
|
-
dayPeriod:
|
|
3445
|
-
matchPatterns:
|
|
3312
|
+
dayPeriod: ce({
|
|
3313
|
+
matchPatterns: Zr,
|
|
3446
3314
|
defaultMatchWidth: "any",
|
|
3447
|
-
parsePatterns:
|
|
3315
|
+
parsePatterns: jr,
|
|
3448
3316
|
defaultParseWidth: "any"
|
|
3449
3317
|
})
|
|
3450
|
-
},
|
|
3318
|
+
}, Yr = {
|
|
3451
3319
|
code: "en-US",
|
|
3452
|
-
formatDistance:
|
|
3453
|
-
formatLong:
|
|
3454
|
-
formatRelative:
|
|
3455
|
-
localize:
|
|
3456
|
-
match:
|
|
3320
|
+
formatDistance: or,
|
|
3321
|
+
formatLong: lr,
|
|
3322
|
+
formatRelative: hr,
|
|
3323
|
+
localize: br,
|
|
3324
|
+
match: Wr,
|
|
3457
3325
|
options: {
|
|
3458
3326
|
weekStartsOn: 0,
|
|
3459
3327
|
firstWeekContainsDate: 1
|
|
3460
3328
|
}
|
|
3461
3329
|
};
|
|
3462
|
-
function
|
|
3463
|
-
const e =
|
|
3464
|
-
return Math.round(r /
|
|
3330
|
+
function $r(n, t) {
|
|
3331
|
+
const e = E(n, t == null ? void 0 : t.in), r = +ie(e) - +ar(e);
|
|
3332
|
+
return Math.round(r / yt) + 1;
|
|
3465
3333
|
}
|
|
3466
|
-
function
|
|
3467
|
-
var
|
|
3468
|
-
const e =
|
|
3334
|
+
function vt(n, t) {
|
|
3335
|
+
var p, k, A, j;
|
|
3336
|
+
const e = E(n, t == null ? void 0 : t.in), r = e.getFullYear(), a = ye(), s = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((k = (p = t == null ? void 0 : t.locale) == null ? void 0 : p.options) == null ? void 0 : k.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((j = (A = a.locale) == null ? void 0 : A.options) == null ? void 0 : j.firstWeekContainsDate) ?? 1, i = N((t == null ? void 0 : t.in) || n, 0);
|
|
3469
3337
|
i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
|
|
3470
|
-
const o =
|
|
3338
|
+
const o = X(i, t), u = N((t == null ? void 0 : t.in) || n, 0);
|
|
3471
3339
|
u.setFullYear(r, 0, s), u.setHours(0, 0, 0, 0);
|
|
3472
|
-
const
|
|
3473
|
-
return +e >= +o ? r + 1 : +e >= +
|
|
3340
|
+
const d = X(u, t);
|
|
3341
|
+
return +e >= +o ? r + 1 : +e >= +d ? r : r - 1;
|
|
3474
3342
|
}
|
|
3475
|
-
function
|
|
3476
|
-
var o, u,
|
|
3477
|
-
const e =
|
|
3478
|
-
return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0),
|
|
3343
|
+
function Lr(n, t) {
|
|
3344
|
+
var o, u, d, p;
|
|
3345
|
+
const e = ye(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((u = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : u.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((p = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : p.firstWeekContainsDate) ?? 1, a = vt(n, t), s = N((t == null ? void 0 : t.in) || n, 0);
|
|
3346
|
+
return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), X(s, t);
|
|
3479
3347
|
}
|
|
3480
|
-
function
|
|
3481
|
-
const e =
|
|
3482
|
-
return Math.round(r /
|
|
3348
|
+
function Fr(n, t) {
|
|
3349
|
+
const e = E(n, t == null ? void 0 : t.in), r = +X(e, t) - +Lr(e, t);
|
|
3350
|
+
return Math.round(r / yt) + 1;
|
|
3483
3351
|
}
|
|
3484
|
-
const
|
|
3352
|
+
const ot = (n, t) => {
|
|
3485
3353
|
switch (n) {
|
|
3486
3354
|
case "P":
|
|
3487
3355
|
return t.date({ width: "short" });
|
|
@@ -3493,7 +3361,7 @@ const ut = (n, t) => {
|
|
|
3493
3361
|
default:
|
|
3494
3362
|
return t.date({ width: "full" });
|
|
3495
3363
|
}
|
|
3496
|
-
},
|
|
3364
|
+
}, wt = (n, t) => {
|
|
3497
3365
|
switch (n) {
|
|
3498
3366
|
case "p":
|
|
3499
3367
|
return t.time({ width: "short" });
|
|
@@ -3505,10 +3373,10 @@ const ut = (n, t) => {
|
|
|
3505
3373
|
default:
|
|
3506
3374
|
return t.time({ width: "full" });
|
|
3507
3375
|
}
|
|
3508
|
-
},
|
|
3376
|
+
}, Sr = (n, t) => {
|
|
3509
3377
|
const e = n.match(/(P+)(p+)?/) || [], r = e[1], a = e[2];
|
|
3510
3378
|
if (!a)
|
|
3511
|
-
return
|
|
3379
|
+
return ot(n, t);
|
|
3512
3380
|
let s;
|
|
3513
3381
|
switch (r) {
|
|
3514
3382
|
case "P":
|
|
@@ -3525,34 +3393,34 @@ const ut = (n, t) => {
|
|
|
3525
3393
|
s = t.dateTime({ width: "full" });
|
|
3526
3394
|
break;
|
|
3527
3395
|
}
|
|
3528
|
-
return s.replace("{{date}}",
|
|
3529
|
-
},
|
|
3530
|
-
p:
|
|
3531
|
-
P:
|
|
3532
|
-
},
|
|
3533
|
-
function
|
|
3534
|
-
return
|
|
3396
|
+
return s.replace("{{date}}", ot(r, t)).replace("{{time}}", wt(a, t));
|
|
3397
|
+
}, ct = {
|
|
3398
|
+
p: wt,
|
|
3399
|
+
P: Sr
|
|
3400
|
+
}, Vr = /^D+$/, zr = /^Y+$/, qr = ["D", "DD", "YY", "YYYY"];
|
|
3401
|
+
function Hr(n) {
|
|
3402
|
+
return Vr.test(n);
|
|
3535
3403
|
}
|
|
3536
|
-
function
|
|
3537
|
-
return
|
|
3404
|
+
function Br(n) {
|
|
3405
|
+
return zr.test(n);
|
|
3538
3406
|
}
|
|
3539
|
-
function
|
|
3540
|
-
const r =
|
|
3541
|
-
if (console.warn(r),
|
|
3407
|
+
function ut(n, t, e) {
|
|
3408
|
+
const r = Qr(n, t, e);
|
|
3409
|
+
if (console.warn(r), qr.includes(n)) throw new RangeError(r);
|
|
3542
3410
|
}
|
|
3543
|
-
function
|
|
3411
|
+
function Qr(n, t, e) {
|
|
3544
3412
|
const r = n[0] === "Y" ? "years" : "days of the month";
|
|
3545
3413
|
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`;
|
|
3546
3414
|
}
|
|
3547
|
-
function
|
|
3548
|
-
return Object.assign({},
|
|
3415
|
+
function Ur() {
|
|
3416
|
+
return Object.assign({}, ye());
|
|
3549
3417
|
}
|
|
3550
|
-
function
|
|
3551
|
-
const e =
|
|
3418
|
+
function Xr(n, t) {
|
|
3419
|
+
const e = E(n, t == null ? void 0 : t.in).getDay();
|
|
3552
3420
|
return e === 0 ? 7 : e;
|
|
3553
3421
|
}
|
|
3554
|
-
function
|
|
3555
|
-
const e =
|
|
3422
|
+
function Gr(n, t) {
|
|
3423
|
+
const e = Jr(t) ? new t(0) : N(t, 0);
|
|
3556
3424
|
return e.setFullYear(n.getFullYear(), n.getMonth(), n.getDate()), e.setHours(
|
|
3557
3425
|
n.getHours(),
|
|
3558
3426
|
n.getMinutes(),
|
|
@@ -3560,20 +3428,20 @@ function $n(n, t) {
|
|
|
3560
3428
|
n.getMilliseconds()
|
|
3561
3429
|
), e;
|
|
3562
3430
|
}
|
|
3563
|
-
function
|
|
3431
|
+
function Jr(n) {
|
|
3564
3432
|
var t;
|
|
3565
3433
|
return typeof n == "function" && ((t = n.prototype) == null ? void 0 : t.constructor) === n;
|
|
3566
3434
|
}
|
|
3567
|
-
const
|
|
3568
|
-
class
|
|
3435
|
+
const Kr = 10;
|
|
3436
|
+
class bt {
|
|
3569
3437
|
constructor() {
|
|
3570
|
-
|
|
3438
|
+
f(this, "subPriority", 0);
|
|
3571
3439
|
}
|
|
3572
3440
|
validate(t, e) {
|
|
3573
3441
|
return !0;
|
|
3574
3442
|
}
|
|
3575
3443
|
}
|
|
3576
|
-
class
|
|
3444
|
+
class en extends bt {
|
|
3577
3445
|
constructor(t, e, r, a, s) {
|
|
3578
3446
|
super(), this.value = t, this.validateValue = e, this.setValue = r, this.priority = a, s && (this.subPriority = s);
|
|
3579
3447
|
}
|
|
@@ -3584,22 +3452,22 @@ class Vn extends Ct {
|
|
|
3584
3452
|
return this.setValue(t, e, this.value, r);
|
|
3585
3453
|
}
|
|
3586
3454
|
}
|
|
3587
|
-
class
|
|
3455
|
+
class tn extends bt {
|
|
3588
3456
|
constructor(e, r) {
|
|
3589
3457
|
super();
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
this.context = e || ((a) =>
|
|
3458
|
+
f(this, "priority", Kr);
|
|
3459
|
+
f(this, "subPriority", -1);
|
|
3460
|
+
this.context = e || ((a) => N(r, a));
|
|
3593
3461
|
}
|
|
3594
3462
|
set(e, r) {
|
|
3595
|
-
return r.timestampIsSet ? e :
|
|
3463
|
+
return r.timestampIsSet ? e : N(e, Gr(e, this.context));
|
|
3596
3464
|
}
|
|
3597
3465
|
}
|
|
3598
3466
|
class x {
|
|
3599
3467
|
run(t, e, r, a) {
|
|
3600
3468
|
const s = this.parse(t, e, r, a);
|
|
3601
3469
|
return s ? {
|
|
3602
|
-
setter: new
|
|
3470
|
+
setter: new en(
|
|
3603
3471
|
s.value,
|
|
3604
3472
|
this.validate,
|
|
3605
3473
|
this.set,
|
|
@@ -3613,11 +3481,11 @@ class x {
|
|
|
3613
3481
|
return !0;
|
|
3614
3482
|
}
|
|
3615
3483
|
}
|
|
3616
|
-
class
|
|
3484
|
+
class rn extends x {
|
|
3617
3485
|
constructor() {
|
|
3618
3486
|
super(...arguments);
|
|
3619
|
-
|
|
3620
|
-
|
|
3487
|
+
f(this, "priority", 140);
|
|
3488
|
+
f(this, "incompatibleTokens", ["R", "u", "t", "T"]);
|
|
3621
3489
|
}
|
|
3622
3490
|
parse(e, r, a) {
|
|
3623
3491
|
switch (r) {
|
|
@@ -3677,7 +3545,7 @@ const M = {
|
|
|
3677
3545
|
// 0 to 999, -0 to -999
|
|
3678
3546
|
fourDigitsSigned: /^-?\d{1,4}/
|
|
3679
3547
|
// 0 to 9999, -0 to -9999
|
|
3680
|
-
},
|
|
3548
|
+
}, Y = {
|
|
3681
3549
|
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
3682
3550
|
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
3683
3551
|
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
@@ -3690,14 +3558,14 @@ function D(n, t) {
|
|
|
3690
3558
|
rest: n.rest
|
|
3691
3559
|
};
|
|
3692
3560
|
}
|
|
3693
|
-
function
|
|
3561
|
+
function T(n, t) {
|
|
3694
3562
|
const e = t.match(n);
|
|
3695
3563
|
return e ? {
|
|
3696
3564
|
value: parseInt(e[0], 10),
|
|
3697
3565
|
rest: t.slice(e[0].length)
|
|
3698
3566
|
} : null;
|
|
3699
3567
|
}
|
|
3700
|
-
function
|
|
3568
|
+
function $(n, t) {
|
|
3701
3569
|
const e = t.match(n);
|
|
3702
3570
|
if (!e)
|
|
3703
3571
|
return null;
|
|
@@ -3708,42 +3576,42 @@ function F(n, t) {
|
|
|
3708
3576
|
};
|
|
3709
3577
|
const r = e[1] === "+" ? 1 : -1, a = e[2] ? parseInt(e[2], 10) : 0, s = e[3] ? parseInt(e[3], 10) : 0, i = e[5] ? parseInt(e[5], 10) : 0;
|
|
3710
3578
|
return {
|
|
3711
|
-
value: r * (a *
|
|
3579
|
+
value: r * (a * er + s * Kt + i * tr),
|
|
3712
3580
|
rest: t.slice(e[0].length)
|
|
3713
3581
|
};
|
|
3714
3582
|
}
|
|
3715
|
-
function
|
|
3716
|
-
return
|
|
3583
|
+
function xt(n) {
|
|
3584
|
+
return T(M.anyDigitsSigned, n);
|
|
3717
3585
|
}
|
|
3718
3586
|
function C(n, t) {
|
|
3719
3587
|
switch (n) {
|
|
3720
3588
|
case 1:
|
|
3721
|
-
return
|
|
3589
|
+
return T(M.singleDigit, t);
|
|
3722
3590
|
case 2:
|
|
3723
|
-
return
|
|
3591
|
+
return T(M.twoDigits, t);
|
|
3724
3592
|
case 3:
|
|
3725
|
-
return
|
|
3593
|
+
return T(M.threeDigits, t);
|
|
3726
3594
|
case 4:
|
|
3727
|
-
return
|
|
3595
|
+
return T(M.fourDigits, t);
|
|
3728
3596
|
default:
|
|
3729
|
-
return
|
|
3597
|
+
return T(new RegExp("^\\d{1," + n + "}"), t);
|
|
3730
3598
|
}
|
|
3731
3599
|
}
|
|
3732
|
-
function
|
|
3600
|
+
function Ee(n, t) {
|
|
3733
3601
|
switch (n) {
|
|
3734
3602
|
case 1:
|
|
3735
|
-
return
|
|
3603
|
+
return T(M.singleDigitSigned, t);
|
|
3736
3604
|
case 2:
|
|
3737
|
-
return
|
|
3605
|
+
return T(M.twoDigitsSigned, t);
|
|
3738
3606
|
case 3:
|
|
3739
|
-
return
|
|
3607
|
+
return T(M.threeDigitsSigned, t);
|
|
3740
3608
|
case 4:
|
|
3741
|
-
return
|
|
3609
|
+
return T(M.fourDigitsSigned, t);
|
|
3742
3610
|
default:
|
|
3743
|
-
return
|
|
3611
|
+
return T(new RegExp("^-?\\d{1," + n + "}"), t);
|
|
3744
3612
|
}
|
|
3745
3613
|
}
|
|
3746
|
-
function
|
|
3614
|
+
function qe(n) {
|
|
3747
3615
|
switch (n) {
|
|
3748
3616
|
case "morning":
|
|
3749
3617
|
return 4;
|
|
@@ -3760,7 +3628,7 @@ function Qe(n) {
|
|
|
3760
3628
|
return 0;
|
|
3761
3629
|
}
|
|
3762
3630
|
}
|
|
3763
|
-
function
|
|
3631
|
+
function kt(n, t) {
|
|
3764
3632
|
const e = t > 0, r = e ? t : 1 - t;
|
|
3765
3633
|
let a;
|
|
3766
3634
|
if (r <= 50)
|
|
@@ -3771,14 +3639,14 @@ function Dt(n, t) {
|
|
|
3771
3639
|
}
|
|
3772
3640
|
return e ? a : 1 - a;
|
|
3773
3641
|
}
|
|
3774
|
-
function
|
|
3642
|
+
function Tt(n) {
|
|
3775
3643
|
return n % 400 === 0 || n % 4 === 0 && n % 100 !== 0;
|
|
3776
3644
|
}
|
|
3777
|
-
class
|
|
3645
|
+
class nn extends x {
|
|
3778
3646
|
constructor() {
|
|
3779
3647
|
super(...arguments);
|
|
3780
|
-
|
|
3781
|
-
|
|
3648
|
+
f(this, "priority", 130);
|
|
3649
|
+
f(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
3782
3650
|
}
|
|
3783
3651
|
parse(e, r, a) {
|
|
3784
3652
|
const s = (i) => ({
|
|
@@ -3805,7 +3673,7 @@ class Hn extends x {
|
|
|
3805
3673
|
set(e, r, a) {
|
|
3806
3674
|
const s = e.getFullYear();
|
|
3807
3675
|
if (a.isTwoDigitYear) {
|
|
3808
|
-
const o =
|
|
3676
|
+
const o = kt(
|
|
3809
3677
|
a.year,
|
|
3810
3678
|
s
|
|
3811
3679
|
);
|
|
@@ -3815,11 +3683,11 @@ class Hn extends x {
|
|
|
3815
3683
|
return e.setFullYear(i, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3816
3684
|
}
|
|
3817
3685
|
}
|
|
3818
|
-
class
|
|
3686
|
+
class an extends x {
|
|
3819
3687
|
constructor() {
|
|
3820
3688
|
super(...arguments);
|
|
3821
|
-
|
|
3822
|
-
|
|
3689
|
+
f(this, "priority", 130);
|
|
3690
|
+
f(this, "incompatibleTokens", [
|
|
3823
3691
|
"y",
|
|
3824
3692
|
"R",
|
|
3825
3693
|
"u",
|
|
@@ -3858,9 +3726,9 @@ class Bn extends x {
|
|
|
3858
3726
|
return r.isTwoDigitYear || r.year > 0;
|
|
3859
3727
|
}
|
|
3860
3728
|
set(e, r, a, s) {
|
|
3861
|
-
const i =
|
|
3729
|
+
const i = vt(e, s);
|
|
3862
3730
|
if (a.isTwoDigitYear) {
|
|
3863
|
-
const u =
|
|
3731
|
+
const u = kt(
|
|
3864
3732
|
a.year,
|
|
3865
3733
|
i
|
|
3866
3734
|
);
|
|
@@ -3868,17 +3736,17 @@ class Bn extends x {
|
|
|
3868
3736
|
u,
|
|
3869
3737
|
0,
|
|
3870
3738
|
s.firstWeekContainsDate
|
|
3871
|
-
), e.setHours(0, 0, 0, 0),
|
|
3739
|
+
), e.setHours(0, 0, 0, 0), X(e, s);
|
|
3872
3740
|
}
|
|
3873
3741
|
const o = !("era" in r) || r.era === 1 ? a.year : 1 - a.year;
|
|
3874
|
-
return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0),
|
|
3742
|
+
return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), X(e, s);
|
|
3875
3743
|
}
|
|
3876
3744
|
}
|
|
3877
|
-
class
|
|
3745
|
+
class sn extends x {
|
|
3878
3746
|
constructor() {
|
|
3879
3747
|
super(...arguments);
|
|
3880
|
-
|
|
3881
|
-
|
|
3748
|
+
f(this, "priority", 130);
|
|
3749
|
+
f(this, "incompatibleTokens", [
|
|
3882
3750
|
"G",
|
|
3883
3751
|
"y",
|
|
3884
3752
|
"Y",
|
|
@@ -3897,31 +3765,31 @@ class Un extends x {
|
|
|
3897
3765
|
]);
|
|
3898
3766
|
}
|
|
3899
3767
|
parse(e, r) {
|
|
3900
|
-
return
|
|
3768
|
+
return Ee(r === "R" ? 4 : r.length, e);
|
|
3901
3769
|
}
|
|
3902
3770
|
set(e, r, a) {
|
|
3903
|
-
const s =
|
|
3904
|
-
return s.setFullYear(a, 0, 4), s.setHours(0, 0, 0, 0),
|
|
3771
|
+
const s = N(e, 0);
|
|
3772
|
+
return s.setFullYear(a, 0, 4), s.setHours(0, 0, 0, 0), ie(s);
|
|
3905
3773
|
}
|
|
3906
3774
|
}
|
|
3907
|
-
class
|
|
3775
|
+
class on extends x {
|
|
3908
3776
|
constructor() {
|
|
3909
3777
|
super(...arguments);
|
|
3910
|
-
|
|
3911
|
-
|
|
3778
|
+
f(this, "priority", 130);
|
|
3779
|
+
f(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
|
|
3912
3780
|
}
|
|
3913
3781
|
parse(e, r) {
|
|
3914
|
-
return
|
|
3782
|
+
return Ee(r === "u" ? 4 : r.length, e);
|
|
3915
3783
|
}
|
|
3916
3784
|
set(e, r, a) {
|
|
3917
3785
|
return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3918
3786
|
}
|
|
3919
3787
|
}
|
|
3920
|
-
class
|
|
3788
|
+
class cn extends x {
|
|
3921
3789
|
constructor() {
|
|
3922
3790
|
super(...arguments);
|
|
3923
|
-
|
|
3924
|
-
|
|
3791
|
+
f(this, "priority", 120);
|
|
3792
|
+
f(this, "incompatibleTokens", [
|
|
3925
3793
|
"Y",
|
|
3926
3794
|
"R",
|
|
3927
3795
|
"q",
|
|
@@ -3984,11 +3852,11 @@ class Xn extends x {
|
|
|
3984
3852
|
return e.setMonth((a - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
3985
3853
|
}
|
|
3986
3854
|
}
|
|
3987
|
-
class
|
|
3855
|
+
class un extends x {
|
|
3988
3856
|
constructor() {
|
|
3989
3857
|
super(...arguments);
|
|
3990
|
-
|
|
3991
|
-
|
|
3858
|
+
f(this, "priority", 120);
|
|
3859
|
+
f(this, "incompatibleTokens", [
|
|
3992
3860
|
"Y",
|
|
3993
3861
|
"R",
|
|
3994
3862
|
"Q",
|
|
@@ -4051,10 +3919,10 @@ class Gn extends x {
|
|
|
4051
3919
|
return e.setMonth((a - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
4052
3920
|
}
|
|
4053
3921
|
}
|
|
4054
|
-
class
|
|
3922
|
+
class dn extends x {
|
|
4055
3923
|
constructor() {
|
|
4056
3924
|
super(...arguments);
|
|
4057
|
-
|
|
3925
|
+
f(this, "incompatibleTokens", [
|
|
4058
3926
|
"Y",
|
|
4059
3927
|
"R",
|
|
4060
3928
|
"q",
|
|
@@ -4069,7 +3937,7 @@ class Jn extends x {
|
|
|
4069
3937
|
"t",
|
|
4070
3938
|
"T"
|
|
4071
3939
|
]);
|
|
4072
|
-
|
|
3940
|
+
f(this, "priority", 110);
|
|
4073
3941
|
}
|
|
4074
3942
|
parse(e, r, a) {
|
|
4075
3943
|
const s = (i) => i - 1;
|
|
@@ -4077,7 +3945,7 @@ class Jn extends x {
|
|
|
4077
3945
|
// 1, 2, ..., 12
|
|
4078
3946
|
case "M":
|
|
4079
3947
|
return D(
|
|
4080
|
-
|
|
3948
|
+
T(M.month, e),
|
|
4081
3949
|
s
|
|
4082
3950
|
);
|
|
4083
3951
|
// 01, 02, ..., 12
|
|
@@ -4119,11 +3987,11 @@ class Jn extends x {
|
|
|
4119
3987
|
return e.setMonth(a, 1), e.setHours(0, 0, 0, 0), e;
|
|
4120
3988
|
}
|
|
4121
3989
|
}
|
|
4122
|
-
class
|
|
3990
|
+
class ln extends x {
|
|
4123
3991
|
constructor() {
|
|
4124
3992
|
super(...arguments);
|
|
4125
|
-
|
|
4126
|
-
|
|
3993
|
+
f(this, "priority", 110);
|
|
3994
|
+
f(this, "incompatibleTokens", [
|
|
4127
3995
|
"Y",
|
|
4128
3996
|
"R",
|
|
4129
3997
|
"q",
|
|
@@ -4145,7 +4013,7 @@ class Kn extends x {
|
|
|
4145
4013
|
// 1, 2, ..., 12
|
|
4146
4014
|
case "L":
|
|
4147
4015
|
return D(
|
|
4148
|
-
|
|
4016
|
+
T(M.month, e),
|
|
4149
4017
|
s
|
|
4150
4018
|
);
|
|
4151
4019
|
// 01, 02, ..., 12
|
|
@@ -4187,15 +4055,15 @@ class Kn extends x {
|
|
|
4187
4055
|
return e.setMonth(a, 1), e.setHours(0, 0, 0, 0), e;
|
|
4188
4056
|
}
|
|
4189
4057
|
}
|
|
4190
|
-
function
|
|
4191
|
-
const r =
|
|
4192
|
-
return r.setDate(r.getDate() - a * 7),
|
|
4058
|
+
function fn(n, t, e) {
|
|
4059
|
+
const r = E(n, e == null ? void 0 : e.in), a = Fr(r, e) - t;
|
|
4060
|
+
return r.setDate(r.getDate() - a * 7), E(r, e == null ? void 0 : e.in);
|
|
4193
4061
|
}
|
|
4194
|
-
class
|
|
4062
|
+
class hn extends x {
|
|
4195
4063
|
constructor() {
|
|
4196
4064
|
super(...arguments);
|
|
4197
|
-
|
|
4198
|
-
|
|
4065
|
+
f(this, "priority", 100);
|
|
4066
|
+
f(this, "incompatibleTokens", [
|
|
4199
4067
|
"y",
|
|
4200
4068
|
"R",
|
|
4201
4069
|
"u",
|
|
@@ -4214,7 +4082,7 @@ class ta extends x {
|
|
|
4214
4082
|
parse(e, r, a) {
|
|
4215
4083
|
switch (r) {
|
|
4216
4084
|
case "w":
|
|
4217
|
-
return
|
|
4085
|
+
return T(M.week, e);
|
|
4218
4086
|
case "wo":
|
|
4219
4087
|
return a.ordinalNumber(e, { unit: "week" });
|
|
4220
4088
|
default:
|
|
@@ -4225,18 +4093,18 @@ class ta extends x {
|
|
|
4225
4093
|
return r >= 1 && r <= 53;
|
|
4226
4094
|
}
|
|
4227
4095
|
set(e, r, a, s) {
|
|
4228
|
-
return
|
|
4096
|
+
return X(fn(e, a, s), s);
|
|
4229
4097
|
}
|
|
4230
4098
|
}
|
|
4231
|
-
function
|
|
4232
|
-
const r =
|
|
4099
|
+
function mn(n, t, e) {
|
|
4100
|
+
const r = E(n, e == null ? void 0 : e.in), a = $r(r, e) - t;
|
|
4233
4101
|
return r.setDate(r.getDate() - a * 7), r;
|
|
4234
4102
|
}
|
|
4235
|
-
class
|
|
4103
|
+
class pn extends x {
|
|
4236
4104
|
constructor() {
|
|
4237
4105
|
super(...arguments);
|
|
4238
|
-
|
|
4239
|
-
|
|
4106
|
+
f(this, "priority", 100);
|
|
4107
|
+
f(this, "incompatibleTokens", [
|
|
4240
4108
|
"y",
|
|
4241
4109
|
"Y",
|
|
4242
4110
|
"u",
|
|
@@ -4256,7 +4124,7 @@ class na extends x {
|
|
|
4256
4124
|
parse(e, r, a) {
|
|
4257
4125
|
switch (r) {
|
|
4258
4126
|
case "I":
|
|
4259
|
-
return
|
|
4127
|
+
return T(M.week, e);
|
|
4260
4128
|
case "Io":
|
|
4261
4129
|
return a.ordinalNumber(e, { unit: "week" });
|
|
4262
4130
|
default:
|
|
@@ -4267,10 +4135,10 @@ class na extends x {
|
|
|
4267
4135
|
return r >= 1 && r <= 53;
|
|
4268
4136
|
}
|
|
4269
4137
|
set(e, r, a) {
|
|
4270
|
-
return
|
|
4138
|
+
return ie(mn(e, a));
|
|
4271
4139
|
}
|
|
4272
4140
|
}
|
|
4273
|
-
const
|
|
4141
|
+
const yn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], gn = [
|
|
4274
4142
|
31,
|
|
4275
4143
|
29,
|
|
4276
4144
|
31,
|
|
@@ -4284,12 +4152,12 @@ const aa = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], sa = [
|
|
|
4284
4152
|
30,
|
|
4285
4153
|
31
|
|
4286
4154
|
];
|
|
4287
|
-
class
|
|
4155
|
+
class _n extends x {
|
|
4288
4156
|
constructor() {
|
|
4289
4157
|
super(...arguments);
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4158
|
+
f(this, "priority", 90);
|
|
4159
|
+
f(this, "subPriority", 1);
|
|
4160
|
+
f(this, "incompatibleTokens", [
|
|
4293
4161
|
"Y",
|
|
4294
4162
|
"R",
|
|
4295
4163
|
"q",
|
|
@@ -4307,7 +4175,7 @@ class ia extends x {
|
|
|
4307
4175
|
parse(e, r, a) {
|
|
4308
4176
|
switch (r) {
|
|
4309
4177
|
case "d":
|
|
4310
|
-
return
|
|
4178
|
+
return T(M.date, e);
|
|
4311
4179
|
case "do":
|
|
4312
4180
|
return a.ordinalNumber(e, { unit: "date" });
|
|
4313
4181
|
default:
|
|
@@ -4315,19 +4183,19 @@ class ia extends x {
|
|
|
4315
4183
|
}
|
|
4316
4184
|
}
|
|
4317
4185
|
validate(e, r) {
|
|
4318
|
-
const a = e.getFullYear(), s =
|
|
4319
|
-
return s ? r >= 1 && r <=
|
|
4186
|
+
const a = e.getFullYear(), s = Tt(a), i = e.getMonth();
|
|
4187
|
+
return s ? r >= 1 && r <= gn[i] : r >= 1 && r <= yn[i];
|
|
4320
4188
|
}
|
|
4321
4189
|
set(e, r, a) {
|
|
4322
4190
|
return e.setDate(a), e.setHours(0, 0, 0, 0), e;
|
|
4323
4191
|
}
|
|
4324
4192
|
}
|
|
4325
|
-
class
|
|
4193
|
+
class vn extends x {
|
|
4326
4194
|
constructor() {
|
|
4327
4195
|
super(...arguments);
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4196
|
+
f(this, "priority", 90);
|
|
4197
|
+
f(this, "subpriority", 1);
|
|
4198
|
+
f(this, "incompatibleTokens", [
|
|
4331
4199
|
"Y",
|
|
4332
4200
|
"R",
|
|
4333
4201
|
"q",
|
|
@@ -4349,7 +4217,7 @@ class oa extends x {
|
|
|
4349
4217
|
switch (r) {
|
|
4350
4218
|
case "D":
|
|
4351
4219
|
case "DD":
|
|
4352
|
-
return
|
|
4220
|
+
return T(M.dayOfYear, e);
|
|
4353
4221
|
case "Do":
|
|
4354
4222
|
return a.ordinalNumber(e, { unit: "date" });
|
|
4355
4223
|
default:
|
|
@@ -4358,22 +4226,22 @@ class oa extends x {
|
|
|
4358
4226
|
}
|
|
4359
4227
|
validate(e, r) {
|
|
4360
4228
|
const a = e.getFullYear();
|
|
4361
|
-
return
|
|
4229
|
+
return Tt(a) ? r >= 1 && r <= 366 : r >= 1 && r <= 365;
|
|
4362
4230
|
}
|
|
4363
4231
|
set(e, r, a) {
|
|
4364
4232
|
return e.setMonth(0, a), e.setHours(0, 0, 0, 0), e;
|
|
4365
4233
|
}
|
|
4366
4234
|
}
|
|
4367
|
-
function
|
|
4368
|
-
var k, A, j,
|
|
4369
|
-
const r =
|
|
4370
|
-
return
|
|
4235
|
+
function He(n, t, e) {
|
|
4236
|
+
var k, A, j, V;
|
|
4237
|
+
const r = ye(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((A = (k = e == null ? void 0 : e.locale) == null ? void 0 : k.options) == null ? void 0 : A.weekStartsOn) ?? r.weekStartsOn ?? ((V = (j = r.locale) == null ? void 0 : j.options) == null ? void 0 : V.weekStartsOn) ?? 0, s = E(n, e == null ? void 0 : e.in), i = s.getDay(), u = (t % 7 + 7) % 7, d = 7 - a, p = t < 0 || t > 6 ? t - (i + d) % 7 : (u + d) % 7 - (i + d) % 7;
|
|
4238
|
+
return gt(s, p, e);
|
|
4371
4239
|
}
|
|
4372
|
-
class
|
|
4240
|
+
class wn extends x {
|
|
4373
4241
|
constructor() {
|
|
4374
4242
|
super(...arguments);
|
|
4375
|
-
|
|
4376
|
-
|
|
4243
|
+
f(this, "priority", 90);
|
|
4244
|
+
f(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
|
|
4377
4245
|
}
|
|
4378
4246
|
parse(e, r, a) {
|
|
4379
4247
|
switch (r) {
|
|
@@ -4407,14 +4275,14 @@ class ca extends x {
|
|
|
4407
4275
|
return r >= 0 && r <= 6;
|
|
4408
4276
|
}
|
|
4409
4277
|
set(e, r, a, s) {
|
|
4410
|
-
return e =
|
|
4278
|
+
return e = He(e, a, s), e.setHours(0, 0, 0, 0), e;
|
|
4411
4279
|
}
|
|
4412
4280
|
}
|
|
4413
|
-
class
|
|
4281
|
+
class bn extends x {
|
|
4414
4282
|
constructor() {
|
|
4415
4283
|
super(...arguments);
|
|
4416
|
-
|
|
4417
|
-
|
|
4284
|
+
f(this, "priority", 90);
|
|
4285
|
+
f(this, "incompatibleTokens", [
|
|
4418
4286
|
"y",
|
|
4419
4287
|
"R",
|
|
4420
4288
|
"u",
|
|
@@ -4478,14 +4346,14 @@ class ua extends x {
|
|
|
4478
4346
|
return r >= 0 && r <= 6;
|
|
4479
4347
|
}
|
|
4480
4348
|
set(e, r, a, s) {
|
|
4481
|
-
return e =
|
|
4349
|
+
return e = He(e, a, s), e.setHours(0, 0, 0, 0), e;
|
|
4482
4350
|
}
|
|
4483
4351
|
}
|
|
4484
|
-
class
|
|
4352
|
+
class xn extends x {
|
|
4485
4353
|
constructor() {
|
|
4486
4354
|
super(...arguments);
|
|
4487
|
-
|
|
4488
|
-
|
|
4355
|
+
f(this, "priority", 90);
|
|
4356
|
+
f(this, "incompatibleTokens", [
|
|
4489
4357
|
"y",
|
|
4490
4358
|
"R",
|
|
4491
4359
|
"u",
|
|
@@ -4549,18 +4417,18 @@ class da extends x {
|
|
|
4549
4417
|
return r >= 0 && r <= 6;
|
|
4550
4418
|
}
|
|
4551
4419
|
set(e, r, a, s) {
|
|
4552
|
-
return e =
|
|
4420
|
+
return e = He(e, a, s), e.setHours(0, 0, 0, 0), e;
|
|
4553
4421
|
}
|
|
4554
4422
|
}
|
|
4555
|
-
function
|
|
4556
|
-
const r =
|
|
4557
|
-
return
|
|
4423
|
+
function kn(n, t, e) {
|
|
4424
|
+
const r = E(n, e == null ? void 0 : e.in), a = Xr(r, e), s = t - a;
|
|
4425
|
+
return gt(r, s, e);
|
|
4558
4426
|
}
|
|
4559
|
-
class
|
|
4427
|
+
class Tn extends x {
|
|
4560
4428
|
constructor() {
|
|
4561
4429
|
super(...arguments);
|
|
4562
|
-
|
|
4563
|
-
|
|
4430
|
+
f(this, "priority", 90);
|
|
4431
|
+
f(this, "incompatibleTokens", [
|
|
4564
4432
|
"y",
|
|
4565
4433
|
"Y",
|
|
4566
4434
|
"u",
|
|
@@ -4649,14 +4517,14 @@ class fa extends x {
|
|
|
4649
4517
|
return r >= 1 && r <= 7;
|
|
4650
4518
|
}
|
|
4651
4519
|
set(e, r, a) {
|
|
4652
|
-
return e =
|
|
4520
|
+
return e = kn(e, a), e.setHours(0, 0, 0, 0), e;
|
|
4653
4521
|
}
|
|
4654
4522
|
}
|
|
4655
|
-
class
|
|
4523
|
+
class On extends x {
|
|
4656
4524
|
constructor() {
|
|
4657
4525
|
super(...arguments);
|
|
4658
|
-
|
|
4659
|
-
|
|
4526
|
+
f(this, "priority", 80);
|
|
4527
|
+
f(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
|
|
4660
4528
|
}
|
|
4661
4529
|
parse(e, r, a) {
|
|
4662
4530
|
switch (r) {
|
|
@@ -4690,14 +4558,14 @@ class ha extends x {
|
|
|
4690
4558
|
}
|
|
4691
4559
|
}
|
|
4692
4560
|
set(e, r, a) {
|
|
4693
|
-
return e.setHours(
|
|
4561
|
+
return e.setHours(qe(a), 0, 0, 0), e;
|
|
4694
4562
|
}
|
|
4695
4563
|
}
|
|
4696
|
-
class
|
|
4564
|
+
class Pn extends x {
|
|
4697
4565
|
constructor() {
|
|
4698
4566
|
super(...arguments);
|
|
4699
|
-
|
|
4700
|
-
|
|
4567
|
+
f(this, "priority", 80);
|
|
4568
|
+
f(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
|
|
4701
4569
|
}
|
|
4702
4570
|
parse(e, r, a) {
|
|
4703
4571
|
switch (r) {
|
|
@@ -4731,14 +4599,14 @@ class ma extends x {
|
|
|
4731
4599
|
}
|
|
4732
4600
|
}
|
|
4733
4601
|
set(e, r, a) {
|
|
4734
|
-
return e.setHours(
|
|
4602
|
+
return e.setHours(qe(a), 0, 0, 0), e;
|
|
4735
4603
|
}
|
|
4736
4604
|
}
|
|
4737
|
-
class
|
|
4605
|
+
class Cn extends x {
|
|
4738
4606
|
constructor() {
|
|
4739
4607
|
super(...arguments);
|
|
4740
|
-
|
|
4741
|
-
|
|
4608
|
+
f(this, "priority", 80);
|
|
4609
|
+
f(this, "incompatibleTokens", ["a", "b", "t", "T"]);
|
|
4742
4610
|
}
|
|
4743
4611
|
parse(e, r, a) {
|
|
4744
4612
|
switch (r) {
|
|
@@ -4772,19 +4640,19 @@ class pa extends x {
|
|
|
4772
4640
|
}
|
|
4773
4641
|
}
|
|
4774
4642
|
set(e, r, a) {
|
|
4775
|
-
return e.setHours(
|
|
4643
|
+
return e.setHours(qe(a), 0, 0, 0), e;
|
|
4776
4644
|
}
|
|
4777
4645
|
}
|
|
4778
|
-
class
|
|
4646
|
+
class Mn extends x {
|
|
4779
4647
|
constructor() {
|
|
4780
4648
|
super(...arguments);
|
|
4781
|
-
|
|
4782
|
-
|
|
4649
|
+
f(this, "priority", 70);
|
|
4650
|
+
f(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
|
|
4783
4651
|
}
|
|
4784
4652
|
parse(e, r, a) {
|
|
4785
4653
|
switch (r) {
|
|
4786
4654
|
case "h":
|
|
4787
|
-
return
|
|
4655
|
+
return T(M.hour12h, e);
|
|
4788
4656
|
case "ho":
|
|
4789
4657
|
return a.ordinalNumber(e, { unit: "hour" });
|
|
4790
4658
|
default:
|
|
@@ -4799,16 +4667,16 @@ class ya extends x {
|
|
|
4799
4667
|
return s && a < 12 ? e.setHours(a + 12, 0, 0, 0) : !s && a === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(a, 0, 0, 0), e;
|
|
4800
4668
|
}
|
|
4801
4669
|
}
|
|
4802
|
-
class
|
|
4670
|
+
class Dn extends x {
|
|
4803
4671
|
constructor() {
|
|
4804
4672
|
super(...arguments);
|
|
4805
|
-
|
|
4806
|
-
|
|
4673
|
+
f(this, "priority", 70);
|
|
4674
|
+
f(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
|
|
4807
4675
|
}
|
|
4808
4676
|
parse(e, r, a) {
|
|
4809
4677
|
switch (r) {
|
|
4810
4678
|
case "H":
|
|
4811
|
-
return
|
|
4679
|
+
return T(M.hour23h, e);
|
|
4812
4680
|
case "Ho":
|
|
4813
4681
|
return a.ordinalNumber(e, { unit: "hour" });
|
|
4814
4682
|
default:
|
|
@@ -4822,16 +4690,16 @@ class ga extends x {
|
|
|
4822
4690
|
return e.setHours(a, 0, 0, 0), e;
|
|
4823
4691
|
}
|
|
4824
4692
|
}
|
|
4825
|
-
class
|
|
4693
|
+
class Nn extends x {
|
|
4826
4694
|
constructor() {
|
|
4827
4695
|
super(...arguments);
|
|
4828
|
-
|
|
4829
|
-
|
|
4696
|
+
f(this, "priority", 70);
|
|
4697
|
+
f(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
|
|
4830
4698
|
}
|
|
4831
4699
|
parse(e, r, a) {
|
|
4832
4700
|
switch (r) {
|
|
4833
4701
|
case "K":
|
|
4834
|
-
return
|
|
4702
|
+
return T(M.hour11h, e);
|
|
4835
4703
|
case "Ko":
|
|
4836
4704
|
return a.ordinalNumber(e, { unit: "hour" });
|
|
4837
4705
|
default:
|
|
@@ -4845,16 +4713,16 @@ class va extends x {
|
|
|
4845
4713
|
return e.getHours() >= 12 && a < 12 ? e.setHours(a + 12, 0, 0, 0) : e.setHours(a, 0, 0, 0), e;
|
|
4846
4714
|
}
|
|
4847
4715
|
}
|
|
4848
|
-
class
|
|
4716
|
+
class En extends x {
|
|
4849
4717
|
constructor() {
|
|
4850
4718
|
super(...arguments);
|
|
4851
|
-
|
|
4852
|
-
|
|
4719
|
+
f(this, "priority", 70);
|
|
4720
|
+
f(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
|
|
4853
4721
|
}
|
|
4854
4722
|
parse(e, r, a) {
|
|
4855
4723
|
switch (r) {
|
|
4856
4724
|
case "k":
|
|
4857
|
-
return
|
|
4725
|
+
return T(M.hour24h, e);
|
|
4858
4726
|
case "ko":
|
|
4859
4727
|
return a.ordinalNumber(e, { unit: "hour" });
|
|
4860
4728
|
default:
|
|
@@ -4869,16 +4737,16 @@ class _a extends x {
|
|
|
4869
4737
|
return e.setHours(s, 0, 0, 0), e;
|
|
4870
4738
|
}
|
|
4871
4739
|
}
|
|
4872
|
-
class
|
|
4740
|
+
class In extends x {
|
|
4873
4741
|
constructor() {
|
|
4874
4742
|
super(...arguments);
|
|
4875
|
-
|
|
4876
|
-
|
|
4743
|
+
f(this, "priority", 60);
|
|
4744
|
+
f(this, "incompatibleTokens", ["t", "T"]);
|
|
4877
4745
|
}
|
|
4878
4746
|
parse(e, r, a) {
|
|
4879
4747
|
switch (r) {
|
|
4880
4748
|
case "m":
|
|
4881
|
-
return
|
|
4749
|
+
return T(M.minute, e);
|
|
4882
4750
|
case "mo":
|
|
4883
4751
|
return a.ordinalNumber(e, { unit: "minute" });
|
|
4884
4752
|
default:
|
|
@@ -4892,16 +4760,16 @@ class wa extends x {
|
|
|
4892
4760
|
return e.setMinutes(a, 0, 0), e;
|
|
4893
4761
|
}
|
|
4894
4762
|
}
|
|
4895
|
-
class
|
|
4763
|
+
class Rn extends x {
|
|
4896
4764
|
constructor() {
|
|
4897
4765
|
super(...arguments);
|
|
4898
|
-
|
|
4899
|
-
|
|
4766
|
+
f(this, "priority", 50);
|
|
4767
|
+
f(this, "incompatibleTokens", ["t", "T"]);
|
|
4900
4768
|
}
|
|
4901
4769
|
parse(e, r, a) {
|
|
4902
4770
|
switch (r) {
|
|
4903
4771
|
case "s":
|
|
4904
|
-
return
|
|
4772
|
+
return T(M.second, e);
|
|
4905
4773
|
case "so":
|
|
4906
4774
|
return a.ordinalNumber(e, { unit: "second" });
|
|
4907
4775
|
default:
|
|
@@ -4915,11 +4783,11 @@ class ba extends x {
|
|
|
4915
4783
|
return e.setSeconds(a, 0), e;
|
|
4916
4784
|
}
|
|
4917
4785
|
}
|
|
4918
|
-
class
|
|
4786
|
+
class An extends x {
|
|
4919
4787
|
constructor() {
|
|
4920
4788
|
super(...arguments);
|
|
4921
|
-
|
|
4922
|
-
|
|
4789
|
+
f(this, "priority", 30);
|
|
4790
|
+
f(this, "incompatibleTokens", ["t", "T"]);
|
|
4923
4791
|
}
|
|
4924
4792
|
parse(e, r) {
|
|
4925
4793
|
const a = (s) => Math.trunc(s * Math.pow(10, -r.length + 3));
|
|
@@ -4929,227 +4797,227 @@ class xa extends x {
|
|
|
4929
4797
|
return e.setMilliseconds(a), e;
|
|
4930
4798
|
}
|
|
4931
4799
|
}
|
|
4932
|
-
class
|
|
4800
|
+
class Zn extends x {
|
|
4933
4801
|
constructor() {
|
|
4934
4802
|
super(...arguments);
|
|
4935
|
-
|
|
4936
|
-
|
|
4803
|
+
f(this, "priority", 10);
|
|
4804
|
+
f(this, "incompatibleTokens", ["t", "T", "x"]);
|
|
4937
4805
|
}
|
|
4938
4806
|
parse(e, r) {
|
|
4939
4807
|
switch (r) {
|
|
4940
4808
|
case "X":
|
|
4941
|
-
return
|
|
4942
|
-
|
|
4809
|
+
return $(
|
|
4810
|
+
Y.basicOptionalMinutes,
|
|
4943
4811
|
e
|
|
4944
4812
|
);
|
|
4945
4813
|
case "XX":
|
|
4946
|
-
return
|
|
4814
|
+
return $(Y.basic, e);
|
|
4947
4815
|
case "XXXX":
|
|
4948
|
-
return
|
|
4949
|
-
|
|
4816
|
+
return $(
|
|
4817
|
+
Y.basicOptionalSeconds,
|
|
4950
4818
|
e
|
|
4951
4819
|
);
|
|
4952
4820
|
case "XXXXX":
|
|
4953
|
-
return
|
|
4954
|
-
|
|
4821
|
+
return $(
|
|
4822
|
+
Y.extendedOptionalSeconds,
|
|
4955
4823
|
e
|
|
4956
4824
|
);
|
|
4957
4825
|
case "XXX":
|
|
4958
4826
|
default:
|
|
4959
|
-
return
|
|
4827
|
+
return $(Y.extended, e);
|
|
4960
4828
|
}
|
|
4961
4829
|
}
|
|
4962
4830
|
set(e, r, a) {
|
|
4963
|
-
return r.timestampIsSet ? e :
|
|
4831
|
+
return r.timestampIsSet ? e : N(
|
|
4964
4832
|
e,
|
|
4965
|
-
e.getTime() -
|
|
4833
|
+
e.getTime() - _t(e) - a
|
|
4966
4834
|
);
|
|
4967
4835
|
}
|
|
4968
4836
|
}
|
|
4969
|
-
class
|
|
4837
|
+
class jn extends x {
|
|
4970
4838
|
constructor() {
|
|
4971
4839
|
super(...arguments);
|
|
4972
|
-
|
|
4973
|
-
|
|
4840
|
+
f(this, "priority", 10);
|
|
4841
|
+
f(this, "incompatibleTokens", ["t", "T", "X"]);
|
|
4974
4842
|
}
|
|
4975
4843
|
parse(e, r) {
|
|
4976
4844
|
switch (r) {
|
|
4977
4845
|
case "x":
|
|
4978
|
-
return
|
|
4979
|
-
|
|
4846
|
+
return $(
|
|
4847
|
+
Y.basicOptionalMinutes,
|
|
4980
4848
|
e
|
|
4981
4849
|
);
|
|
4982
4850
|
case "xx":
|
|
4983
|
-
return
|
|
4851
|
+
return $(Y.basic, e);
|
|
4984
4852
|
case "xxxx":
|
|
4985
|
-
return
|
|
4986
|
-
|
|
4853
|
+
return $(
|
|
4854
|
+
Y.basicOptionalSeconds,
|
|
4987
4855
|
e
|
|
4988
4856
|
);
|
|
4989
4857
|
case "xxxxx":
|
|
4990
|
-
return
|
|
4991
|
-
|
|
4858
|
+
return $(
|
|
4859
|
+
Y.extendedOptionalSeconds,
|
|
4992
4860
|
e
|
|
4993
4861
|
);
|
|
4994
4862
|
case "xxx":
|
|
4995
4863
|
default:
|
|
4996
|
-
return
|
|
4864
|
+
return $(Y.extended, e);
|
|
4997
4865
|
}
|
|
4998
4866
|
}
|
|
4999
4867
|
set(e, r, a) {
|
|
5000
|
-
return r.timestampIsSet ? e :
|
|
4868
|
+
return r.timestampIsSet ? e : N(
|
|
5001
4869
|
e,
|
|
5002
|
-
e.getTime() -
|
|
4870
|
+
e.getTime() - _t(e) - a
|
|
5003
4871
|
);
|
|
5004
4872
|
}
|
|
5005
4873
|
}
|
|
5006
|
-
class
|
|
4874
|
+
class Wn extends x {
|
|
5007
4875
|
constructor() {
|
|
5008
4876
|
super(...arguments);
|
|
5009
|
-
|
|
5010
|
-
|
|
4877
|
+
f(this, "priority", 40);
|
|
4878
|
+
f(this, "incompatibleTokens", "*");
|
|
5011
4879
|
}
|
|
5012
4880
|
parse(e) {
|
|
5013
|
-
return
|
|
4881
|
+
return xt(e);
|
|
5014
4882
|
}
|
|
5015
4883
|
set(e, r, a) {
|
|
5016
|
-
return [
|
|
4884
|
+
return [N(e, a * 1e3), { timestampIsSet: !0 }];
|
|
5017
4885
|
}
|
|
5018
4886
|
}
|
|
5019
|
-
class
|
|
4887
|
+
class Yn extends x {
|
|
5020
4888
|
constructor() {
|
|
5021
4889
|
super(...arguments);
|
|
5022
|
-
|
|
5023
|
-
|
|
4890
|
+
f(this, "priority", 20);
|
|
4891
|
+
f(this, "incompatibleTokens", "*");
|
|
5024
4892
|
}
|
|
5025
4893
|
parse(e) {
|
|
5026
|
-
return
|
|
4894
|
+
return xt(e);
|
|
5027
4895
|
}
|
|
5028
4896
|
set(e, r, a) {
|
|
5029
|
-
return [
|
|
5030
|
-
}
|
|
5031
|
-
}
|
|
5032
|
-
const
|
|
5033
|
-
G: new
|
|
5034
|
-
y: new
|
|
5035
|
-
Y: new
|
|
5036
|
-
R: new
|
|
5037
|
-
u: new
|
|
5038
|
-
Q: new
|
|
5039
|
-
q: new
|
|
5040
|
-
M: new
|
|
5041
|
-
L: new
|
|
5042
|
-
w: new
|
|
5043
|
-
I: new
|
|
5044
|
-
d: new
|
|
5045
|
-
D: new
|
|
5046
|
-
E: new
|
|
5047
|
-
e: new
|
|
5048
|
-
c: new
|
|
5049
|
-
i: new
|
|
5050
|
-
a: new
|
|
5051
|
-
b: new
|
|
5052
|
-
B: new
|
|
5053
|
-
h: new
|
|
5054
|
-
H: new
|
|
5055
|
-
K: new
|
|
5056
|
-
k: new
|
|
5057
|
-
m: new
|
|
5058
|
-
s: new
|
|
5059
|
-
S: new
|
|
5060
|
-
X: new
|
|
5061
|
-
x: new
|
|
5062
|
-
t: new
|
|
5063
|
-
T: new
|
|
5064
|
-
},
|
|
4897
|
+
return [N(e, a), { timestampIsSet: !0 }];
|
|
4898
|
+
}
|
|
4899
|
+
}
|
|
4900
|
+
const $n = {
|
|
4901
|
+
G: new rn(),
|
|
4902
|
+
y: new nn(),
|
|
4903
|
+
Y: new an(),
|
|
4904
|
+
R: new sn(),
|
|
4905
|
+
u: new on(),
|
|
4906
|
+
Q: new cn(),
|
|
4907
|
+
q: new un(),
|
|
4908
|
+
M: new dn(),
|
|
4909
|
+
L: new ln(),
|
|
4910
|
+
w: new hn(),
|
|
4911
|
+
I: new pn(),
|
|
4912
|
+
d: new _n(),
|
|
4913
|
+
D: new vn(),
|
|
4914
|
+
E: new wn(),
|
|
4915
|
+
e: new bn(),
|
|
4916
|
+
c: new xn(),
|
|
4917
|
+
i: new Tn(),
|
|
4918
|
+
a: new On(),
|
|
4919
|
+
b: new Pn(),
|
|
4920
|
+
B: new Cn(),
|
|
4921
|
+
h: new Mn(),
|
|
4922
|
+
H: new Dn(),
|
|
4923
|
+
K: new Nn(),
|
|
4924
|
+
k: new En(),
|
|
4925
|
+
m: new In(),
|
|
4926
|
+
s: new Rn(),
|
|
4927
|
+
S: new An(),
|
|
4928
|
+
X: new Zn(),
|
|
4929
|
+
x: new jn(),
|
|
4930
|
+
t: new Wn(),
|
|
4931
|
+
T: new Yn()
|
|
4932
|
+
}, Ln = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Fn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Sn = /^'([^]*?)'?$/, Vn = /''/g, zn = /\S/, qn = /[a-zA-Z]/;
|
|
5065
4933
|
function $a(n, t, e, r) {
|
|
5066
|
-
var
|
|
5067
|
-
const a = () =>
|
|
4934
|
+
var Qe, Ue, Xe, Ge;
|
|
4935
|
+
const a = () => N(e, NaN), s = Ur(), i = s.locale ?? Yr, o = s.firstWeekContainsDate ?? ((Ue = (Qe = s.locale) == null ? void 0 : Qe.options) == null ? void 0 : Ue.firstWeekContainsDate) ?? 1, u = s.weekStartsOn ?? ((Ge = (Xe = s.locale) == null ? void 0 : Xe.options) == null ? void 0 : Ge.weekStartsOn) ?? 0;
|
|
5068
4936
|
if (!t)
|
|
5069
|
-
return n ? a() :
|
|
5070
|
-
const
|
|
4937
|
+
return n ? a() : E(e, r == null ? void 0 : r.in);
|
|
4938
|
+
const d = {
|
|
5071
4939
|
firstWeekContainsDate: o,
|
|
5072
4940
|
weekStartsOn: u,
|
|
5073
4941
|
locale: i
|
|
5074
|
-
},
|
|
5075
|
-
const
|
|
5076
|
-
if (
|
|
5077
|
-
const
|
|
5078
|
-
return
|
|
4942
|
+
}, p = [new tn(r == null ? void 0 : r.in, e)], k = t.match(Fn).map((b) => {
|
|
4943
|
+
const O = b[0];
|
|
4944
|
+
if (O in ct) {
|
|
4945
|
+
const W = ct[O];
|
|
4946
|
+
return W(b, i.formatLong);
|
|
5079
4947
|
}
|
|
5080
4948
|
return b;
|
|
5081
|
-
}).join("").match(
|
|
4949
|
+
}).join("").match(Ln), A = [];
|
|
5082
4950
|
for (let b of k) {
|
|
5083
|
-
|
|
5084
|
-
const
|
|
5085
|
-
if (
|
|
5086
|
-
const { incompatibleTokens:
|
|
5087
|
-
if (Array.isArray(
|
|
5088
|
-
const
|
|
5089
|
-
(
|
|
4951
|
+
Br(b) && ut(b, t, n), Hr(b) && ut(b, t, n);
|
|
4952
|
+
const O = b[0], W = $n[O];
|
|
4953
|
+
if (W) {
|
|
4954
|
+
const { incompatibleTokens: Je } = W;
|
|
4955
|
+
if (Array.isArray(Je)) {
|
|
4956
|
+
const Ke = A.find(
|
|
4957
|
+
(et) => Je.includes(et.token) || et.token === O
|
|
5090
4958
|
);
|
|
5091
|
-
if (
|
|
4959
|
+
if (Ke)
|
|
5092
4960
|
throw new RangeError(
|
|
5093
|
-
`The format string mustn't contain \`${
|
|
4961
|
+
`The format string mustn't contain \`${Ke.fullToken}\` and \`${b}\` at the same time`
|
|
5094
4962
|
);
|
|
5095
|
-
} else if (
|
|
4963
|
+
} else if (W.incompatibleTokens === "*" && A.length > 0)
|
|
5096
4964
|
throw new RangeError(
|
|
5097
4965
|
`The format string mustn't contain \`${b}\` and any other token at the same time`
|
|
5098
4966
|
);
|
|
5099
|
-
A.push({ token:
|
|
5100
|
-
const
|
|
4967
|
+
A.push({ token: O, fullToken: b });
|
|
4968
|
+
const Re = W.run(
|
|
5101
4969
|
n,
|
|
5102
4970
|
b,
|
|
5103
4971
|
i.match,
|
|
5104
|
-
|
|
4972
|
+
d
|
|
5105
4973
|
);
|
|
5106
|
-
if (
|
|
4974
|
+
if (!Re)
|
|
5107
4975
|
return a();
|
|
5108
|
-
|
|
4976
|
+
p.push(Re.setter), n = Re.rest;
|
|
5109
4977
|
} else {
|
|
5110
|
-
if (
|
|
4978
|
+
if (O.match(qn))
|
|
5111
4979
|
throw new RangeError(
|
|
5112
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
4980
|
+
"Format string contains an unescaped latin alphabet character `" + O + "`"
|
|
5113
4981
|
);
|
|
5114
|
-
if (b === "''" ? b = "'" :
|
|
4982
|
+
if (b === "''" ? b = "'" : O === "'" && (b = Hn(b)), n.indexOf(b) === 0)
|
|
5115
4983
|
n = n.slice(b.length);
|
|
5116
4984
|
else
|
|
5117
4985
|
return a();
|
|
5118
4986
|
}
|
|
5119
4987
|
}
|
|
5120
|
-
if (n.length > 0 &&
|
|
4988
|
+
if (n.length > 0 && zn.test(n))
|
|
5121
4989
|
return a();
|
|
5122
|
-
const j =
|
|
5123
|
-
(b) =>
|
|
4990
|
+
const j = p.map((b) => b.priority).sort((b, O) => O - b).filter((b, O, W) => W.indexOf(b) === O).map(
|
|
4991
|
+
(b) => p.filter((O) => O.priority === b).sort((O, W) => W.subPriority - O.subPriority)
|
|
5124
4992
|
).map((b) => b[0]);
|
|
5125
|
-
let
|
|
5126
|
-
if (isNaN(+
|
|
5127
|
-
const
|
|
4993
|
+
let V = E(e, r == null ? void 0 : r.in);
|
|
4994
|
+
if (isNaN(+V)) return a();
|
|
4995
|
+
const Be = {};
|
|
5128
4996
|
for (const b of j) {
|
|
5129
|
-
if (!b.validate(
|
|
4997
|
+
if (!b.validate(V, d))
|
|
5130
4998
|
return a();
|
|
5131
|
-
const
|
|
5132
|
-
Array.isArray(
|
|
4999
|
+
const O = b.set(V, Be, d);
|
|
5000
|
+
Array.isArray(O) ? (V = O[0], Object.assign(Be, O[1])) : V = O;
|
|
5133
5001
|
}
|
|
5134
|
-
return
|
|
5002
|
+
return V;
|
|
5135
5003
|
}
|
|
5136
|
-
function
|
|
5137
|
-
return n.match(
|
|
5004
|
+
function Hn(n) {
|
|
5005
|
+
return n.match(Sn)[1].replace(Vn, "'");
|
|
5138
5006
|
}
|
|
5139
|
-
const
|
|
5007
|
+
const La = "dd.MM.yyyy", Fa = (n, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
5140
5008
|
day: "2-digit",
|
|
5141
5009
|
month: "2-digit",
|
|
5142
5010
|
year: "numeric"
|
|
5143
|
-
}).format(n),
|
|
5011
|
+
}).format(n), Sa = (n, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
5144
5012
|
year: "numeric"
|
|
5145
|
-
}).format(n),
|
|
5013
|
+
}).format(n), Va = (n, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
5146
5014
|
month: "long"
|
|
5147
|
-
}).format(n),
|
|
5148
|
-
today:
|
|
5015
|
+
}).format(n), za = {
|
|
5016
|
+
today: Ae("text-color-primary-default"),
|
|
5149
5017
|
outside: "text-color-tetriary",
|
|
5150
5018
|
selected: "bg-color-primary-default text-color-white",
|
|
5151
|
-
range_outer:
|
|
5152
|
-
range_middle:
|
|
5019
|
+
range_outer: Ae("text-color-primary-default text-color-white"),
|
|
5020
|
+
range_middle: Ae(
|
|
5153
5021
|
"bg-color-primary-tr-hover relative text-color-dark rounded-none",
|
|
5154
5022
|
'after:absolute after:content-[""] after:top-0 after:left-0',
|
|
5155
5023
|
"after:w-full after:h-[4px] after:bg-color-white after:z-0",
|
|
@@ -5161,37 +5029,137 @@ const Sa = "dd.MM.yyyy", Fa = (n, t = "ru-RU") => new Intl.DateTimeFormat(t, {
|
|
|
5161
5029
|
day: "text-center"
|
|
5162
5030
|
};
|
|
5163
5031
|
export {
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5032
|
+
oa as $,
|
|
5033
|
+
be as A,
|
|
5034
|
+
Jn as B,
|
|
5035
|
+
ee as C,
|
|
5036
|
+
ue as D,
|
|
5037
|
+
Gn as E,
|
|
5038
|
+
G as F,
|
|
5039
|
+
P as G,
|
|
5040
|
+
q as H,
|
|
5041
|
+
g as I,
|
|
5042
|
+
h as J,
|
|
5043
|
+
Ie as K,
|
|
5044
|
+
pe as L,
|
|
5045
|
+
Ne as M,
|
|
5046
|
+
ja as N,
|
|
5047
|
+
R as O,
|
|
5048
|
+
I as P,
|
|
5049
|
+
Te as Q,
|
|
5050
|
+
se as R,
|
|
5051
|
+
L as S,
|
|
5052
|
+
$e as T,
|
|
5053
|
+
H as U,
|
|
5054
|
+
we as V,
|
|
5055
|
+
xe as W,
|
|
5056
|
+
re as X,
|
|
5057
|
+
Le as Y,
|
|
5058
|
+
c as Z,
|
|
5059
|
+
l as _,
|
|
5060
|
+
v as a,
|
|
5061
|
+
Fr as a$,
|
|
5062
|
+
la as a0,
|
|
5063
|
+
ra as a1,
|
|
5064
|
+
Jt as a2,
|
|
5065
|
+
Ut as a3,
|
|
5066
|
+
na as a4,
|
|
5067
|
+
zt as a5,
|
|
5068
|
+
he as a6,
|
|
5069
|
+
pa as a7,
|
|
5070
|
+
Ca as a8,
|
|
5071
|
+
Ta as a9,
|
|
5072
|
+
Ea as aA,
|
|
5073
|
+
Na as aB,
|
|
5074
|
+
Pa as aC,
|
|
5075
|
+
Un as aD,
|
|
5076
|
+
_a as aE,
|
|
5077
|
+
wa as aF,
|
|
5078
|
+
Xn as aG,
|
|
5079
|
+
ha as aH,
|
|
5080
|
+
aa as aI,
|
|
5081
|
+
ga as aJ,
|
|
5082
|
+
sa as aK,
|
|
5083
|
+
ma as aL,
|
|
5084
|
+
ca as aM,
|
|
5085
|
+
w as aN,
|
|
5086
|
+
da as aO,
|
|
5087
|
+
Fa as aP,
|
|
5088
|
+
La as aQ,
|
|
5089
|
+
Sa as aR,
|
|
5090
|
+
Va as aS,
|
|
5091
|
+
za as aT,
|
|
5092
|
+
E as aU,
|
|
5093
|
+
N as aV,
|
|
5094
|
+
_t as aW,
|
|
5095
|
+
Wa as aX,
|
|
5096
|
+
gt as aY,
|
|
5097
|
+
ye as aZ,
|
|
5098
|
+
$r as a_,
|
|
5099
|
+
ba as aa,
|
|
5100
|
+
We as ab,
|
|
5101
|
+
Q as ac,
|
|
5102
|
+
ea as ad,
|
|
5103
|
+
ya as ae,
|
|
5104
|
+
rt as af,
|
|
5105
|
+
ge as ag,
|
|
5106
|
+
nt as ah,
|
|
5107
|
+
ne as ai,
|
|
5108
|
+
Kn as aj,
|
|
5109
|
+
xa as ak,
|
|
5110
|
+
ka as al,
|
|
5111
|
+
Ye as am,
|
|
5112
|
+
va as an,
|
|
5113
|
+
ta as ao,
|
|
5114
|
+
Oa as ap,
|
|
5115
|
+
ua as aq,
|
|
5116
|
+
ia as ar,
|
|
5117
|
+
Da as as,
|
|
5118
|
+
Gt as at,
|
|
5119
|
+
fa as au,
|
|
5120
|
+
tt as av,
|
|
5121
|
+
Aa as aw,
|
|
5122
|
+
Ra as ax,
|
|
5123
|
+
Ma as ay,
|
|
5124
|
+
Ia as az,
|
|
5125
|
+
me as b,
|
|
5126
|
+
nr as b0,
|
|
5127
|
+
vt as b1,
|
|
5128
|
+
Yr as b2,
|
|
5129
|
+
ct as b3,
|
|
5130
|
+
Br as b4,
|
|
5131
|
+
Hr as b5,
|
|
5132
|
+
ut as b6,
|
|
5133
|
+
X as b7,
|
|
5134
|
+
sr as b8,
|
|
5135
|
+
ie as b9,
|
|
5136
|
+
je as ba,
|
|
5137
|
+
oe as bb,
|
|
5138
|
+
ce as bc,
|
|
5139
|
+
Tr as bd,
|
|
5140
|
+
Za as c,
|
|
5141
|
+
F as d,
|
|
5142
|
+
J as e,
|
|
5143
|
+
ve as f,
|
|
5144
|
+
pt as g,
|
|
5145
|
+
De as h,
|
|
5146
|
+
Ya as i,
|
|
5147
|
+
ae as j,
|
|
5148
|
+
Me as k,
|
|
5149
|
+
ze as l,
|
|
5150
|
+
B as m,
|
|
5151
|
+
K as n,
|
|
5152
|
+
Z as o,
|
|
5185
5153
|
$a as p,
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5154
|
+
y as q,
|
|
5155
|
+
fe as r,
|
|
5156
|
+
Xt as s,
|
|
5157
|
+
ke as t,
|
|
5158
|
+
Oe as u,
|
|
5159
|
+
Pe as v,
|
|
5160
|
+
Se as w,
|
|
5161
|
+
Ve as x,
|
|
5162
|
+
Ce as y,
|
|
5163
|
+
U as z
|
|
5196
5164
|
};
|
|
5197
|
-
//# sourceMappingURL=utils-
|
|
5165
|
+
//# sourceMappingURL=utils-CaWgHX_C.js.map
|