react-luminus-components 1.3.10 → 1.3.13
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/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +15 -2
- package/dist/components/common/AppSearch/comps/TypeSelector/TypeSelector.d.ts +1 -1
- package/dist/hooks/useGetApiData/useGetApiData.d.ts +2 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +332 -324
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +411 -410
- package/dist/models/index.d.ts +1 -0
- package/dist/models/types/UseGetApiDataOptions.d.ts +6 -0
- package/package.json +1 -1
package/dist/hooks.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Q as
|
|
2
|
-
import { aH as
|
|
3
|
-
import { a as
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { f as
|
|
6
|
-
import { i as
|
|
1
|
+
import { Q as Qe, a4 as $e, ap as Xe } from "./NoInputContainer-DPjgKLR8.js";
|
|
2
|
+
import { aH as yr, a9 as _r, aG as vr } from "./NoInputContainer-DPjgKLR8.js";
|
|
3
|
+
import { a as xr, u as br } from "./useConfirm-Dv-I8Odc.js";
|
|
4
|
+
import { useContext as Me, useRef as Ke, useState as ze, useCallback as Fe, useEffect as Pe } from "react";
|
|
5
|
+
import { f as et } from "./latinize-BQrinury.js";
|
|
6
|
+
import { i as tt } from "./dateUtils-7nL2BXlo.js";
|
|
7
7
|
import "react-hook-form";
|
|
8
|
-
import { a as
|
|
9
|
-
import { u as
|
|
8
|
+
import { a as wr, b as Tr, u as Zr } from "./useFormControlType-BAFqxupC.js";
|
|
9
|
+
import { u as Sr } from "./usePermissions-C6VQVWtc.js";
|
|
10
10
|
var x;
|
|
11
11
|
(function(r) {
|
|
12
12
|
r.assertEqual = (s) => s;
|
|
@@ -43,14 +43,14 @@ var x;
|
|
|
43
43
|
}
|
|
44
44
|
r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
45
45
|
})(x || (x = {}));
|
|
46
|
-
var
|
|
46
|
+
var Se;
|
|
47
47
|
(function(r) {
|
|
48
48
|
r.mergeShapes = (e, t) => ({
|
|
49
49
|
...e,
|
|
50
50
|
...t
|
|
51
51
|
// second overwrites first
|
|
52
52
|
});
|
|
53
|
-
})(
|
|
53
|
+
})(Se || (Se = {}));
|
|
54
54
|
const f = x.arrayToEnum([
|
|
55
55
|
"string",
|
|
56
56
|
"nan",
|
|
@@ -110,7 +110,7 @@ const f = x.arrayToEnum([
|
|
|
110
110
|
"invalid_intersection_types",
|
|
111
111
|
"not_multiple_of",
|
|
112
112
|
"not_finite"
|
|
113
|
-
]),
|
|
113
|
+
]), rt = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
114
114
|
class N extends Error {
|
|
115
115
|
constructor(e) {
|
|
116
116
|
super(), this.issues = [], this.addIssue = (n) => {
|
|
@@ -171,7 +171,7 @@ class N extends Error {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
N.create = (r) => new N(r);
|
|
174
|
-
const
|
|
174
|
+
const X = (r, e) => {
|
|
175
175
|
let t;
|
|
176
176
|
switch (r.code) {
|
|
177
177
|
case d.invalid_type:
|
|
@@ -227,14 +227,14 @@ const J = (r, e) => {
|
|
|
227
227
|
}
|
|
228
228
|
return { message: t };
|
|
229
229
|
};
|
|
230
|
-
let
|
|
231
|
-
function
|
|
232
|
-
|
|
230
|
+
let De = X;
|
|
231
|
+
function nt(r) {
|
|
232
|
+
De = r;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
return
|
|
234
|
+
function ve() {
|
|
235
|
+
return De;
|
|
236
236
|
}
|
|
237
|
-
const
|
|
237
|
+
const ge = (r) => {
|
|
238
238
|
const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], i = {
|
|
239
239
|
...s,
|
|
240
240
|
path: a
|
|
@@ -254,9 +254,9 @@ const _e = (r) => {
|
|
|
254
254
|
path: a,
|
|
255
255
|
message: o
|
|
256
256
|
};
|
|
257
|
-
},
|
|
257
|
+
}, st = [];
|
|
258
258
|
function l(r, e) {
|
|
259
|
-
const t =
|
|
259
|
+
const t = ve(), n = ge({
|
|
260
260
|
issueData: e,
|
|
261
261
|
data: r.data,
|
|
262
262
|
path: r.path,
|
|
@@ -264,13 +264,13 @@ function l(r, e) {
|
|
|
264
264
|
r.common.contextualErrorMap,
|
|
265
265
|
r.schemaErrorMap,
|
|
266
266
|
t,
|
|
267
|
-
t ===
|
|
267
|
+
t === X ? void 0 : X
|
|
268
268
|
// then global default map
|
|
269
269
|
].filter((s) => !!s)
|
|
270
270
|
});
|
|
271
271
|
r.common.issues.push(n);
|
|
272
272
|
}
|
|
273
|
-
class
|
|
273
|
+
class C {
|
|
274
274
|
constructor() {
|
|
275
275
|
this.value = "valid";
|
|
276
276
|
}
|
|
@@ -298,7 +298,7 @@ class Z {
|
|
|
298
298
|
value: i
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
return
|
|
301
|
+
return C.mergeObjectSync(e, n);
|
|
302
302
|
}
|
|
303
303
|
static mergeObjectSync(e, t) {
|
|
304
304
|
const n = {};
|
|
@@ -313,13 +313,13 @@ class Z {
|
|
|
313
313
|
}
|
|
314
314
|
const y = Object.freeze({
|
|
315
315
|
status: "aborted"
|
|
316
|
-
}),
|
|
317
|
-
function
|
|
316
|
+
}), J = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Oe = (r) => r.status === "aborted", Ne = (r) => r.status === "dirty", re = (r) => r.status === "valid", ne = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
317
|
+
function xe(r, e, t, n) {
|
|
318
318
|
if (typeof e == "function" ? r !== e || !n : !e.has(r))
|
|
319
319
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
320
320
|
return e.get(r);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function Ve(r, e, t, n, s) {
|
|
323
323
|
if (typeof e == "function" ? r !== e || !s : !e.has(r))
|
|
324
324
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
325
325
|
return e.set(r, t), t;
|
|
@@ -328,7 +328,7 @@ var h;
|
|
|
328
328
|
(function(r) {
|
|
329
329
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
330
330
|
})(h || (h = {}));
|
|
331
|
-
var
|
|
331
|
+
var ee, te;
|
|
332
332
|
class A {
|
|
333
333
|
constructor(e, t, n, s) {
|
|
334
334
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
|
|
@@ -337,8 +337,8 @@ class A {
|
|
|
337
337
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
if (
|
|
340
|
+
const je = (r, e) => {
|
|
341
|
+
if (re(e))
|
|
342
342
|
return { success: !0, data: e.value };
|
|
343
343
|
if (!r.common.issues.length)
|
|
344
344
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -386,7 +386,7 @@ class v {
|
|
|
386
386
|
}
|
|
387
387
|
_processInputParams(e) {
|
|
388
388
|
return {
|
|
389
|
-
status: new
|
|
389
|
+
status: new C(),
|
|
390
390
|
ctx: {
|
|
391
391
|
common: e.parent.common,
|
|
392
392
|
data: e.data,
|
|
@@ -399,7 +399,7 @@ class v {
|
|
|
399
399
|
}
|
|
400
400
|
_parseSync(e) {
|
|
401
401
|
const t = this._parse(e);
|
|
402
|
-
if (
|
|
402
|
+
if (ne(t))
|
|
403
403
|
throw new Error("Synchronous parse encountered promise.");
|
|
404
404
|
return t;
|
|
405
405
|
}
|
|
@@ -427,7 +427,7 @@ class v {
|
|
|
427
427
|
data: e,
|
|
428
428
|
parsedType: P(e)
|
|
429
429
|
}, a = this._parseSync({ data: e, path: s.path, parent: s });
|
|
430
|
-
return
|
|
430
|
+
return je(s, a);
|
|
431
431
|
}
|
|
432
432
|
async parseAsync(e, t) {
|
|
433
433
|
const n = await this.safeParseAsync(e, t);
|
|
@@ -447,8 +447,8 @@ class v {
|
|
|
447
447
|
parent: null,
|
|
448
448
|
data: e,
|
|
449
449
|
parsedType: P(e)
|
|
450
|
-
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (
|
|
451
|
-
return
|
|
450
|
+
}, s = this._parse({ data: e, path: n.path, parent: n }), a = await (ne(s) ? s : Promise.resolve(s));
|
|
451
|
+
return je(n, a);
|
|
452
452
|
}
|
|
453
453
|
refine(e, t) {
|
|
454
454
|
const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
@@ -486,13 +486,13 @@ class v {
|
|
|
486
486
|
return R.create(this, this._def);
|
|
487
487
|
}
|
|
488
488
|
promise() {
|
|
489
|
-
return
|
|
489
|
+
return F.create(this, this._def);
|
|
490
490
|
}
|
|
491
491
|
or(e) {
|
|
492
|
-
return
|
|
492
|
+
return oe.create([this, e], this._def);
|
|
493
493
|
}
|
|
494
494
|
and(e) {
|
|
495
|
-
return
|
|
495
|
+
return de.create(this, e, this._def);
|
|
496
496
|
}
|
|
497
497
|
transform(e) {
|
|
498
498
|
return new I({
|
|
@@ -504,7 +504,7 @@ class v {
|
|
|
504
504
|
}
|
|
505
505
|
default(e) {
|
|
506
506
|
const t = typeof e == "function" ? e : () => e;
|
|
507
|
-
return new
|
|
507
|
+
return new he({
|
|
508
508
|
..._(this._def),
|
|
509
509
|
innerType: this,
|
|
510
510
|
defaultValue: t,
|
|
@@ -512,7 +512,7 @@ class v {
|
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
brand() {
|
|
515
|
-
return new
|
|
515
|
+
return new Re({
|
|
516
516
|
typeName: p.ZodBranded,
|
|
517
517
|
type: this,
|
|
518
518
|
..._(this._def)
|
|
@@ -520,7 +520,7 @@ class v {
|
|
|
520
520
|
}
|
|
521
521
|
catch(e) {
|
|
522
522
|
const t = typeof e == "function" ? e : () => e;
|
|
523
|
-
return new
|
|
523
|
+
return new me({
|
|
524
524
|
..._(this._def),
|
|
525
525
|
innerType: this,
|
|
526
526
|
catchValue: t,
|
|
@@ -535,10 +535,10 @@ class v {
|
|
|
535
535
|
});
|
|
536
536
|
}
|
|
537
537
|
pipe(e) {
|
|
538
|
-
return
|
|
538
|
+
return ye.create(this, e);
|
|
539
539
|
}
|
|
540
540
|
readonly() {
|
|
541
|
-
return
|
|
541
|
+
return pe.create(this);
|
|
542
542
|
}
|
|
543
543
|
isOptional() {
|
|
544
544
|
return this.safeParse(void 0).success;
|
|
@@ -547,23 +547,23 @@ class v {
|
|
|
547
547
|
return this.safeParse(null).success;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
let
|
|
552
|
-
const
|
|
553
|
-
function
|
|
550
|
+
const at = /^c[^\s-]{8,}$/i, it = /^[0-9a-z]+$/, ot = /^[0-9A-HJKMNP-TV-Z]{26}$/, dt = /^[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, ct = /^[a-z0-9_-]{21}$/i, ut = /^[-+]?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)?)??$/, lt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ft = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
551
|
+
let Ce;
|
|
552
|
+
const ht = /^(?:(?: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])$/, mt = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, pt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Le = "((\\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])))", yt = new RegExp(`^${Le}$`);
|
|
553
|
+
function qe(r) {
|
|
554
554
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
555
555
|
return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
556
556
|
}
|
|
557
|
-
function
|
|
558
|
-
return new RegExp(`^${
|
|
557
|
+
function _t(r) {
|
|
558
|
+
return new RegExp(`^${qe(r)}$`);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
let e = `${
|
|
560
|
+
function Ue(r) {
|
|
561
|
+
let e = `${Le}T${qe(r)}`;
|
|
562
562
|
const t = [];
|
|
563
563
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
return !!((e === "v4" || !e) &&
|
|
565
|
+
function vt(r, e) {
|
|
566
|
+
return !!((e === "v4" || !e) && ht.test(r) || (e === "v6" || !e) && mt.test(r));
|
|
567
567
|
}
|
|
568
568
|
class E extends v {
|
|
569
569
|
_parse(e) {
|
|
@@ -575,7 +575,7 @@ class E extends v {
|
|
|
575
575
|
received: a.parsedType
|
|
576
576
|
}), y;
|
|
577
577
|
}
|
|
578
|
-
const n = new
|
|
578
|
+
const n = new C();
|
|
579
579
|
let s;
|
|
580
580
|
for (const a of this._def.checks)
|
|
581
581
|
if (a.kind === "min")
|
|
@@ -614,43 +614,43 @@ class E extends v {
|
|
|
614
614
|
message: a.message
|
|
615
615
|
}), n.dirty());
|
|
616
616
|
} else if (a.kind === "email")
|
|
617
|
-
|
|
617
|
+
lt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
618
618
|
validation: "email",
|
|
619
619
|
code: d.invalid_string,
|
|
620
620
|
message: a.message
|
|
621
621
|
}), n.dirty());
|
|
622
622
|
else if (a.kind === "emoji")
|
|
623
|
-
|
|
623
|
+
Ce || (Ce = new RegExp(ft, "u")), Ce.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
624
624
|
validation: "emoji",
|
|
625
625
|
code: d.invalid_string,
|
|
626
626
|
message: a.message
|
|
627
627
|
}), n.dirty());
|
|
628
628
|
else if (a.kind === "uuid")
|
|
629
|
-
|
|
629
|
+
dt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
630
630
|
validation: "uuid",
|
|
631
631
|
code: d.invalid_string,
|
|
632
632
|
message: a.message
|
|
633
633
|
}), n.dirty());
|
|
634
634
|
else if (a.kind === "nanoid")
|
|
635
|
-
|
|
635
|
+
ct.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
636
636
|
validation: "nanoid",
|
|
637
637
|
code: d.invalid_string,
|
|
638
638
|
message: a.message
|
|
639
639
|
}), n.dirty());
|
|
640
640
|
else if (a.kind === "cuid")
|
|
641
|
-
|
|
641
|
+
at.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
642
642
|
validation: "cuid",
|
|
643
643
|
code: d.invalid_string,
|
|
644
644
|
message: a.message
|
|
645
645
|
}), n.dirty());
|
|
646
646
|
else if (a.kind === "cuid2")
|
|
647
|
-
|
|
647
|
+
it.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
648
648
|
validation: "cuid2",
|
|
649
649
|
code: d.invalid_string,
|
|
650
650
|
message: a.message
|
|
651
651
|
}), n.dirty());
|
|
652
652
|
else if (a.kind === "ulid")
|
|
653
|
-
|
|
653
|
+
ot.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
654
654
|
validation: "ulid",
|
|
655
655
|
code: d.invalid_string,
|
|
656
656
|
message: a.message
|
|
@@ -682,27 +682,27 @@ class E extends v {
|
|
|
682
682
|
code: d.invalid_string,
|
|
683
683
|
validation: { endsWith: a.value },
|
|
684
684
|
message: a.message
|
|
685
|
-
}), n.dirty()) : a.kind === "datetime" ?
|
|
685
|
+
}), n.dirty()) : a.kind === "datetime" ? Ue(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
686
686
|
code: d.invalid_string,
|
|
687
687
|
validation: "datetime",
|
|
688
688
|
message: a.message
|
|
689
|
-
}), n.dirty()) : a.kind === "date" ?
|
|
689
|
+
}), n.dirty()) : a.kind === "date" ? yt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
690
690
|
code: d.invalid_string,
|
|
691
691
|
validation: "date",
|
|
692
692
|
message: a.message
|
|
693
|
-
}), n.dirty()) : a.kind === "time" ?
|
|
693
|
+
}), n.dirty()) : a.kind === "time" ? _t(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
694
694
|
code: d.invalid_string,
|
|
695
695
|
validation: "time",
|
|
696
696
|
message: a.message
|
|
697
|
-
}), n.dirty()) : a.kind === "duration" ?
|
|
697
|
+
}), n.dirty()) : a.kind === "duration" ? ut.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
698
698
|
validation: "duration",
|
|
699
699
|
code: d.invalid_string,
|
|
700
700
|
message: a.message
|
|
701
|
-
}), n.dirty()) : a.kind === "ip" ?
|
|
701
|
+
}), n.dirty()) : a.kind === "ip" ? vt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
702
702
|
validation: "ip",
|
|
703
703
|
code: d.invalid_string,
|
|
704
704
|
message: a.message
|
|
705
|
-
}), n.dirty()) : a.kind === "base64" ?
|
|
705
|
+
}), n.dirty()) : a.kind === "base64" ? pt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
706
706
|
validation: "base64",
|
|
707
707
|
code: d.invalid_string,
|
|
708
708
|
message: a.message
|
|
@@ -924,7 +924,7 @@ E.create = (r) => {
|
|
|
924
924
|
..._(r)
|
|
925
925
|
});
|
|
926
926
|
};
|
|
927
|
-
function
|
|
927
|
+
function gt(r, e) {
|
|
928
928
|
const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = t > n ? t : n, a = parseInt(r.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
929
929
|
return a % i / Math.pow(10, s);
|
|
930
930
|
}
|
|
@@ -942,7 +942,7 @@ class D extends v {
|
|
|
942
942
|
}), y;
|
|
943
943
|
}
|
|
944
944
|
let n;
|
|
945
|
-
const s = new
|
|
945
|
+
const s = new C();
|
|
946
946
|
for (const a of this._def.checks)
|
|
947
947
|
a.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
948
948
|
code: d.invalid_type,
|
|
@@ -963,7 +963,7 @@ class D extends v {
|
|
|
963
963
|
inclusive: a.inclusive,
|
|
964
964
|
exact: !1,
|
|
965
965
|
message: a.message
|
|
966
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
966
|
+
}), s.dirty()) : a.kind === "multipleOf" ? gt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
967
967
|
code: d.not_multiple_of,
|
|
968
968
|
multipleOf: a.value,
|
|
969
969
|
message: a.message
|
|
@@ -1114,7 +1114,7 @@ class V extends v {
|
|
|
1114
1114
|
}), y;
|
|
1115
1115
|
}
|
|
1116
1116
|
let n;
|
|
1117
|
-
const s = new
|
|
1117
|
+
const s = new C();
|
|
1118
1118
|
for (const a of this._def.checks)
|
|
1119
1119
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
1120
1120
|
code: d.too_small,
|
|
@@ -1228,7 +1228,7 @@ V.create = (r) => {
|
|
|
1228
1228
|
..._(r)
|
|
1229
1229
|
});
|
|
1230
1230
|
};
|
|
1231
|
-
class
|
|
1231
|
+
class se extends v {
|
|
1232
1232
|
_parse(e) {
|
|
1233
1233
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
|
|
1234
1234
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1241,7 +1241,7 @@ class re extends v {
|
|
|
1241
1241
|
return S(e.data);
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
|
|
1244
|
+
se.create = (r) => new se({
|
|
1245
1245
|
typeName: p.ZodBoolean,
|
|
1246
1246
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1247
1247
|
..._(r)
|
|
@@ -1262,7 +1262,7 @@ class B extends v {
|
|
|
1262
1262
|
code: d.invalid_date
|
|
1263
1263
|
}), y;
|
|
1264
1264
|
}
|
|
1265
|
-
const n = new
|
|
1265
|
+
const n = new C();
|
|
1266
1266
|
let s;
|
|
1267
1267
|
for (const a of this._def.checks)
|
|
1268
1268
|
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
|
|
@@ -1324,7 +1324,7 @@ B.create = (r) => new B({
|
|
|
1324
1324
|
typeName: p.ZodDate,
|
|
1325
1325
|
..._(r)
|
|
1326
1326
|
});
|
|
1327
|
-
class
|
|
1327
|
+
class be extends v {
|
|
1328
1328
|
_parse(e) {
|
|
1329
1329
|
if (this._getType(e) !== f.symbol) {
|
|
1330
1330
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1337,11 +1337,11 @@ class ge extends v {
|
|
|
1337
1337
|
return S(e.data);
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
|
-
|
|
1340
|
+
be.create = (r) => new be({
|
|
1341
1341
|
typeName: p.ZodSymbol,
|
|
1342
1342
|
..._(r)
|
|
1343
1343
|
});
|
|
1344
|
-
class
|
|
1344
|
+
class ae extends v {
|
|
1345
1345
|
_parse(e) {
|
|
1346
1346
|
if (this._getType(e) !== f.undefined) {
|
|
1347
1347
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1354,11 +1354,11 @@ class ne extends v {
|
|
|
1354
1354
|
return S(e.data);
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
|
-
|
|
1357
|
+
ae.create = (r) => new ae({
|
|
1358
1358
|
typeName: p.ZodUndefined,
|
|
1359
1359
|
..._(r)
|
|
1360
1360
|
});
|
|
1361
|
-
class
|
|
1361
|
+
class ie extends v {
|
|
1362
1362
|
_parse(e) {
|
|
1363
1363
|
if (this._getType(e) !== f.null) {
|
|
1364
1364
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1371,11 +1371,11 @@ class se extends v {
|
|
|
1371
1371
|
return S(e.data);
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
-
|
|
1374
|
+
ie.create = (r) => new ie({
|
|
1375
1375
|
typeName: p.ZodNull,
|
|
1376
1376
|
..._(r)
|
|
1377
1377
|
});
|
|
1378
|
-
class
|
|
1378
|
+
class K extends v {
|
|
1379
1379
|
constructor() {
|
|
1380
1380
|
super(...arguments), this._any = !0;
|
|
1381
1381
|
}
|
|
@@ -1383,7 +1383,7 @@ class Q extends v {
|
|
|
1383
1383
|
return S(e.data);
|
|
1384
1384
|
}
|
|
1385
1385
|
}
|
|
1386
|
-
|
|
1386
|
+
K.create = (r) => new K({
|
|
1387
1387
|
typeName: p.ZodAny,
|
|
1388
1388
|
..._(r)
|
|
1389
1389
|
});
|
|
@@ -1413,7 +1413,7 @@ z.create = (r) => new z({
|
|
|
1413
1413
|
typeName: p.ZodNever,
|
|
1414
1414
|
..._(r)
|
|
1415
1415
|
});
|
|
1416
|
-
class
|
|
1416
|
+
class ke extends v {
|
|
1417
1417
|
_parse(e) {
|
|
1418
1418
|
if (this._getType(e) !== f.undefined) {
|
|
1419
1419
|
const n = this._getOrReturnCtx(e);
|
|
@@ -1426,7 +1426,7 @@ class xe extends v {
|
|
|
1426
1426
|
return S(e.data);
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
|
-
|
|
1429
|
+
ke.create = (r) => new ke({
|
|
1430
1430
|
typeName: p.ZodVoid,
|
|
1431
1431
|
..._(r)
|
|
1432
1432
|
});
|
|
@@ -1466,9 +1466,9 @@ class R extends v {
|
|
|
1466
1466
|
exact: !1,
|
|
1467
1467
|
message: s.maxLength.message
|
|
1468
1468
|
}), n.dirty()), t.common.async)
|
|
1469
|
-
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new A(t, i, t.path, o)))).then((i) =>
|
|
1469
|
+
return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new A(t, i, t.path, o)))).then((i) => C.mergeArray(n, i));
|
|
1470
1470
|
const a = [...t.data].map((i, o) => s.type._parseSync(new A(t, i, t.path, o)));
|
|
1471
|
-
return
|
|
1471
|
+
return C.mergeArray(n, a);
|
|
1472
1472
|
}
|
|
1473
1473
|
get element() {
|
|
1474
1474
|
return this._def.type;
|
|
@@ -1503,24 +1503,24 @@ R.create = (r, e) => new R({
|
|
|
1503
1503
|
typeName: p.ZodArray,
|
|
1504
1504
|
..._(e)
|
|
1505
1505
|
});
|
|
1506
|
-
function
|
|
1507
|
-
if (r instanceof
|
|
1506
|
+
function H(r) {
|
|
1507
|
+
if (r instanceof b) {
|
|
1508
1508
|
const e = {};
|
|
1509
1509
|
for (const t in r.shape) {
|
|
1510
1510
|
const n = r.shape[t];
|
|
1511
|
-
e[t] = j.create(
|
|
1511
|
+
e[t] = j.create(H(n));
|
|
1512
1512
|
}
|
|
1513
|
-
return new
|
|
1513
|
+
return new b({
|
|
1514
1514
|
...r._def,
|
|
1515
1515
|
shape: () => e
|
|
1516
1516
|
});
|
|
1517
1517
|
} else
|
|
1518
1518
|
return r instanceof R ? new R({
|
|
1519
1519
|
...r._def,
|
|
1520
|
-
type:
|
|
1521
|
-
}) : r instanceof j ? j.create(
|
|
1520
|
+
type: H(r.element)
|
|
1521
|
+
}) : r instanceof j ? j.create(H(r.unwrap())) : r instanceof q ? q.create(H(r.unwrap())) : r instanceof $ ? $.create(r.items.map((e) => H(e))) : r;
|
|
1522
1522
|
}
|
|
1523
|
-
class
|
|
1523
|
+
class b extends v {
|
|
1524
1524
|
constructor() {
|
|
1525
1525
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1526
1526
|
}
|
|
@@ -1545,10 +1545,10 @@ class k extends v {
|
|
|
1545
1545
|
i.includes(c) || o.push(c);
|
|
1546
1546
|
const u = [];
|
|
1547
1547
|
for (const c of i) {
|
|
1548
|
-
const m = a[c],
|
|
1548
|
+
const m = a[c], T = s.data[c];
|
|
1549
1549
|
u.push({
|
|
1550
1550
|
key: { status: "valid", value: c },
|
|
1551
|
-
value: m._parse(new A(s,
|
|
1551
|
+
value: m._parse(new A(s, T, s.path, c)),
|
|
1552
1552
|
alwaysSet: c in s.data
|
|
1553
1553
|
});
|
|
1554
1554
|
}
|
|
@@ -1570,11 +1570,11 @@ class k extends v {
|
|
|
1570
1570
|
} else {
|
|
1571
1571
|
const c = this._def.catchall;
|
|
1572
1572
|
for (const m of o) {
|
|
1573
|
-
const
|
|
1573
|
+
const T = s.data[m];
|
|
1574
1574
|
u.push({
|
|
1575
1575
|
key: { status: "valid", value: m },
|
|
1576
1576
|
value: c._parse(
|
|
1577
|
-
new A(s,
|
|
1577
|
+
new A(s, T, s.path, m)
|
|
1578
1578
|
//, ctx.child(key), value, getParsedType(value)
|
|
1579
1579
|
),
|
|
1580
1580
|
alwaysSet: m in s.data
|
|
@@ -1584,21 +1584,21 @@ class k extends v {
|
|
|
1584
1584
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1585
1585
|
const c = [];
|
|
1586
1586
|
for (const m of u) {
|
|
1587
|
-
const
|
|
1587
|
+
const T = await m.key, Y = await m.value;
|
|
1588
1588
|
c.push({
|
|
1589
|
-
key:
|
|
1590
|
-
value:
|
|
1589
|
+
key: T,
|
|
1590
|
+
value: Y,
|
|
1591
1591
|
alwaysSet: m.alwaysSet
|
|
1592
1592
|
});
|
|
1593
1593
|
}
|
|
1594
1594
|
return c;
|
|
1595
|
-
}).then((c) =>
|
|
1595
|
+
}).then((c) => C.mergeObjectSync(n, c)) : C.mergeObjectSync(n, u);
|
|
1596
1596
|
}
|
|
1597
1597
|
get shape() {
|
|
1598
1598
|
return this._def.shape();
|
|
1599
1599
|
}
|
|
1600
1600
|
strict(e) {
|
|
1601
|
-
return h.errToObj, new
|
|
1601
|
+
return h.errToObj, new b({
|
|
1602
1602
|
...this._def,
|
|
1603
1603
|
unknownKeys: "strict",
|
|
1604
1604
|
...e !== void 0 ? {
|
|
@@ -1615,13 +1615,13 @@ class k extends v {
|
|
|
1615
1615
|
});
|
|
1616
1616
|
}
|
|
1617
1617
|
strip() {
|
|
1618
|
-
return new
|
|
1618
|
+
return new b({
|
|
1619
1619
|
...this._def,
|
|
1620
1620
|
unknownKeys: "strip"
|
|
1621
1621
|
});
|
|
1622
1622
|
}
|
|
1623
1623
|
passthrough() {
|
|
1624
|
-
return new
|
|
1624
|
+
return new b({
|
|
1625
1625
|
...this._def,
|
|
1626
1626
|
unknownKeys: "passthrough"
|
|
1627
1627
|
});
|
|
@@ -1644,7 +1644,7 @@ class k extends v {
|
|
|
1644
1644
|
// }) as any;
|
|
1645
1645
|
// };
|
|
1646
1646
|
extend(e) {
|
|
1647
|
-
return new
|
|
1647
|
+
return new b({
|
|
1648
1648
|
...this._def,
|
|
1649
1649
|
shape: () => ({
|
|
1650
1650
|
...this._def.shape(),
|
|
@@ -1658,7 +1658,7 @@ class k extends v {
|
|
|
1658
1658
|
* upgrade if you are experiencing issues.
|
|
1659
1659
|
*/
|
|
1660
1660
|
merge(e) {
|
|
1661
|
-
return new
|
|
1661
|
+
return new b({
|
|
1662
1662
|
unknownKeys: e._def.unknownKeys,
|
|
1663
1663
|
catchall: e._def.catchall,
|
|
1664
1664
|
shape: () => ({
|
|
@@ -1728,7 +1728,7 @@ class k extends v {
|
|
|
1728
1728
|
// return merged;
|
|
1729
1729
|
// }
|
|
1730
1730
|
catchall(e) {
|
|
1731
|
-
return new
|
|
1731
|
+
return new b({
|
|
1732
1732
|
...this._def,
|
|
1733
1733
|
catchall: e
|
|
1734
1734
|
});
|
|
@@ -1737,7 +1737,7 @@ class k extends v {
|
|
|
1737
1737
|
const t = {};
|
|
1738
1738
|
return x.objectKeys(e).forEach((n) => {
|
|
1739
1739
|
e[n] && this.shape[n] && (t[n] = this.shape[n]);
|
|
1740
|
-
}), new
|
|
1740
|
+
}), new b({
|
|
1741
1741
|
...this._def,
|
|
1742
1742
|
shape: () => t
|
|
1743
1743
|
});
|
|
@@ -1746,7 +1746,7 @@ class k extends v {
|
|
|
1746
1746
|
const t = {};
|
|
1747
1747
|
return x.objectKeys(this.shape).forEach((n) => {
|
|
1748
1748
|
e[n] || (t[n] = this.shape[n]);
|
|
1749
|
-
}), new
|
|
1749
|
+
}), new b({
|
|
1750
1750
|
...this._def,
|
|
1751
1751
|
shape: () => t
|
|
1752
1752
|
});
|
|
@@ -1755,14 +1755,14 @@ class k extends v {
|
|
|
1755
1755
|
* @deprecated
|
|
1756
1756
|
*/
|
|
1757
1757
|
deepPartial() {
|
|
1758
|
-
return
|
|
1758
|
+
return H(this);
|
|
1759
1759
|
}
|
|
1760
1760
|
partial(e) {
|
|
1761
1761
|
const t = {};
|
|
1762
1762
|
return x.objectKeys(this.shape).forEach((n) => {
|
|
1763
1763
|
const s = this.shape[n];
|
|
1764
1764
|
e && !e[n] ? t[n] = s : t[n] = s.optional();
|
|
1765
|
-
}), new
|
|
1765
|
+
}), new b({
|
|
1766
1766
|
...this._def,
|
|
1767
1767
|
shape: () => t
|
|
1768
1768
|
});
|
|
@@ -1778,37 +1778,37 @@ class k extends v {
|
|
|
1778
1778
|
a = a._def.innerType;
|
|
1779
1779
|
t[n] = a;
|
|
1780
1780
|
}
|
|
1781
|
-
}), new
|
|
1781
|
+
}), new b({
|
|
1782
1782
|
...this._def,
|
|
1783
1783
|
shape: () => t
|
|
1784
1784
|
});
|
|
1785
1785
|
}
|
|
1786
1786
|
keyof() {
|
|
1787
|
-
return
|
|
1787
|
+
return Be(x.objectKeys(this.shape));
|
|
1788
1788
|
}
|
|
1789
1789
|
}
|
|
1790
|
-
|
|
1790
|
+
b.create = (r, e) => new b({
|
|
1791
1791
|
shape: () => r,
|
|
1792
1792
|
unknownKeys: "strip",
|
|
1793
1793
|
catchall: z.create(),
|
|
1794
1794
|
typeName: p.ZodObject,
|
|
1795
1795
|
..._(e)
|
|
1796
1796
|
});
|
|
1797
|
-
|
|
1797
|
+
b.strictCreate = (r, e) => new b({
|
|
1798
1798
|
shape: () => r,
|
|
1799
1799
|
unknownKeys: "strict",
|
|
1800
1800
|
catchall: z.create(),
|
|
1801
1801
|
typeName: p.ZodObject,
|
|
1802
1802
|
..._(e)
|
|
1803
1803
|
});
|
|
1804
|
-
|
|
1804
|
+
b.lazycreate = (r, e) => new b({
|
|
1805
1805
|
shape: r,
|
|
1806
1806
|
unknownKeys: "strip",
|
|
1807
1807
|
catchall: z.create(),
|
|
1808
1808
|
typeName: p.ZodObject,
|
|
1809
1809
|
..._(e)
|
|
1810
1810
|
});
|
|
1811
|
-
class
|
|
1811
|
+
class oe extends v {
|
|
1812
1812
|
_parse(e) {
|
|
1813
1813
|
const { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1814
1814
|
function s(a) {
|
|
@@ -1876,13 +1876,13 @@ class ae extends v {
|
|
|
1876
1876
|
return this._def.options;
|
|
1877
1877
|
}
|
|
1878
1878
|
}
|
|
1879
|
-
|
|
1879
|
+
oe.create = (r, e) => new oe({
|
|
1880
1880
|
options: r,
|
|
1881
1881
|
typeName: p.ZodUnion,
|
|
1882
1882
|
..._(e)
|
|
1883
1883
|
});
|
|
1884
|
-
const M = (r) => r instanceof
|
|
1885
|
-
class
|
|
1884
|
+
const M = (r) => r instanceof ue ? M(r.schema) : r instanceof I ? M(r.innerType()) : r instanceof le ? [r.value] : r instanceof L ? r.options : r instanceof fe ? x.objectValues(r.enum) : r instanceof he ? M(r._def.innerType) : r instanceof ae ? [void 0] : r instanceof ie ? [null] : r instanceof j ? [void 0, ...M(r.unwrap())] : r instanceof q ? [null, ...M(r.unwrap())] : r instanceof Re || r instanceof pe ? M(r.unwrap()) : r instanceof me ? M(r._def.innerType) : [];
|
|
1885
|
+
class Ze extends v {
|
|
1886
1886
|
_parse(e) {
|
|
1887
1887
|
const { ctx: t } = this._processInputParams(e);
|
|
1888
1888
|
if (t.parsedType !== f.object)
|
|
@@ -1935,7 +1935,7 @@ class we extends v {
|
|
|
1935
1935
|
s.set(o, a);
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
|
-
return new
|
|
1938
|
+
return new Ze({
|
|
1939
1939
|
typeName: p.ZodDiscriminatedUnion,
|
|
1940
1940
|
discriminator: e,
|
|
1941
1941
|
options: t,
|
|
@@ -1944,14 +1944,14 @@ class we extends v {
|
|
|
1944
1944
|
});
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
|
-
function
|
|
1947
|
+
function Ee(r, e) {
|
|
1948
1948
|
const t = P(r), n = P(e);
|
|
1949
1949
|
if (r === e)
|
|
1950
1950
|
return { valid: !0, data: r };
|
|
1951
1951
|
if (t === f.object && n === f.object) {
|
|
1952
1952
|
const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
|
|
1953
1953
|
for (const o of a) {
|
|
1954
|
-
const u =
|
|
1954
|
+
const u = Ee(r[o], e[o]);
|
|
1955
1955
|
if (!u.valid)
|
|
1956
1956
|
return { valid: !1 };
|
|
1957
1957
|
i[o] = u.data;
|
|
@@ -1962,7 +1962,7 @@ function Ne(r, e) {
|
|
|
1962
1962
|
return { valid: !1 };
|
|
1963
1963
|
const s = [];
|
|
1964
1964
|
for (let a = 0; a < r.length; a++) {
|
|
1965
|
-
const i = r[a], o = e[a], u =
|
|
1965
|
+
const i = r[a], o = e[a], u = Ee(i, o);
|
|
1966
1966
|
if (!u.valid)
|
|
1967
1967
|
return { valid: !1 };
|
|
1968
1968
|
s.push(u.data);
|
|
@@ -1971,13 +1971,13 @@ function Ne(r, e) {
|
|
|
1971
1971
|
} else
|
|
1972
1972
|
return t === f.date && n === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
1973
1973
|
}
|
|
1974
|
-
class
|
|
1974
|
+
class de extends v {
|
|
1975
1975
|
_parse(e) {
|
|
1976
1976
|
const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
|
|
1977
|
-
if (
|
|
1977
|
+
if (Oe(a) || Oe(i))
|
|
1978
1978
|
return y;
|
|
1979
|
-
const o =
|
|
1980
|
-
return o.valid ? ((
|
|
1979
|
+
const o = Ee(a.value, i.value);
|
|
1980
|
+
return o.valid ? ((Ne(a) || Ne(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
|
|
1981
1981
|
code: d.invalid_intersection_types
|
|
1982
1982
|
}), y);
|
|
1983
1983
|
};
|
|
@@ -2003,7 +2003,7 @@ class ie extends v {
|
|
|
2003
2003
|
}));
|
|
2004
2004
|
}
|
|
2005
2005
|
}
|
|
2006
|
-
|
|
2006
|
+
de.create = (r, e, t) => new de({
|
|
2007
2007
|
left: r,
|
|
2008
2008
|
right: e,
|
|
2009
2009
|
typeName: p.ZodIntersection,
|
|
@@ -2037,7 +2037,7 @@ class $ extends v {
|
|
|
2037
2037
|
const u = this._def.items[o] || this._def.rest;
|
|
2038
2038
|
return u ? u._parse(new A(n, i, n.path, o)) : null;
|
|
2039
2039
|
}).filter((i) => !!i);
|
|
2040
|
-
return n.common.async ? Promise.all(a).then((i) =>
|
|
2040
|
+
return n.common.async ? Promise.all(a).then((i) => C.mergeArray(t, i)) : C.mergeArray(t, a);
|
|
2041
2041
|
}
|
|
2042
2042
|
get items() {
|
|
2043
2043
|
return this._def.items;
|
|
@@ -2059,7 +2059,7 @@ $.create = (r, e) => {
|
|
|
2059
2059
|
..._(e)
|
|
2060
2060
|
});
|
|
2061
2061
|
};
|
|
2062
|
-
class
|
|
2062
|
+
class ce extends v {
|
|
2063
2063
|
get keySchema() {
|
|
2064
2064
|
return this._def.keyType;
|
|
2065
2065
|
}
|
|
@@ -2081,18 +2081,18 @@ class oe extends v {
|
|
|
2081
2081
|
value: i._parse(new A(n, n.data[o], n.path, o)),
|
|
2082
2082
|
alwaysSet: o in n.data
|
|
2083
2083
|
});
|
|
2084
|
-
return n.common.async ?
|
|
2084
|
+
return n.common.async ? C.mergeObjectAsync(t, s) : C.mergeObjectSync(t, s);
|
|
2085
2085
|
}
|
|
2086
2086
|
get element() {
|
|
2087
2087
|
return this._def.valueType;
|
|
2088
2088
|
}
|
|
2089
2089
|
static create(e, t, n) {
|
|
2090
|
-
return t instanceof v ? new
|
|
2090
|
+
return t instanceof v ? new ce({
|
|
2091
2091
|
keyType: e,
|
|
2092
2092
|
valueType: t,
|
|
2093
2093
|
typeName: p.ZodRecord,
|
|
2094
2094
|
..._(n)
|
|
2095
|
-
}) : new
|
|
2095
|
+
}) : new ce({
|
|
2096
2096
|
keyType: E.create(),
|
|
2097
2097
|
valueType: e,
|
|
2098
2098
|
typeName: p.ZodRecord,
|
|
@@ -2100,7 +2100,7 @@ class oe extends v {
|
|
|
2100
2100
|
});
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
|
-
class
|
|
2103
|
+
class we extends v {
|
|
2104
2104
|
get keySchema() {
|
|
2105
2105
|
return this._def.keyType;
|
|
2106
2106
|
}
|
|
@@ -2142,7 +2142,7 @@ class ke extends v {
|
|
|
2142
2142
|
}
|
|
2143
2143
|
}
|
|
2144
2144
|
}
|
|
2145
|
-
|
|
2145
|
+
we.create = (r, e, t) => new we({
|
|
2146
2146
|
valueType: e,
|
|
2147
2147
|
keyType: r,
|
|
2148
2148
|
typeName: p.ZodMap,
|
|
@@ -2212,7 +2212,7 @@ W.create = (r, e) => new W({
|
|
|
2212
2212
|
typeName: p.ZodSet,
|
|
2213
2213
|
..._(e)
|
|
2214
2214
|
});
|
|
2215
|
-
class
|
|
2215
|
+
class Q extends v {
|
|
2216
2216
|
constructor() {
|
|
2217
2217
|
super(...arguments), this.validate = this.implement;
|
|
2218
2218
|
}
|
|
@@ -2225,14 +2225,14 @@ class H extends v {
|
|
|
2225
2225
|
received: t.parsedType
|
|
2226
2226
|
}), y;
|
|
2227
2227
|
function n(o, u) {
|
|
2228
|
-
return
|
|
2228
|
+
return ge({
|
|
2229
2229
|
data: o,
|
|
2230
2230
|
path: t.path,
|
|
2231
2231
|
errorMaps: [
|
|
2232
2232
|
t.common.contextualErrorMap,
|
|
2233
2233
|
t.schemaErrorMap,
|
|
2234
|
-
|
|
2235
|
-
|
|
2234
|
+
ve(),
|
|
2235
|
+
X
|
|
2236
2236
|
].filter((c) => !!c),
|
|
2237
2237
|
issueData: {
|
|
2238
2238
|
code: d.invalid_arguments,
|
|
@@ -2241,14 +2241,14 @@ class H extends v {
|
|
|
2241
2241
|
});
|
|
2242
2242
|
}
|
|
2243
2243
|
function s(o, u) {
|
|
2244
|
-
return
|
|
2244
|
+
return ge({
|
|
2245
2245
|
data: o,
|
|
2246
2246
|
path: t.path,
|
|
2247
2247
|
errorMaps: [
|
|
2248
2248
|
t.common.contextualErrorMap,
|
|
2249
2249
|
t.schemaErrorMap,
|
|
2250
|
-
|
|
2251
|
-
|
|
2250
|
+
ve(),
|
|
2251
|
+
X
|
|
2252
2252
|
].filter((c) => !!c),
|
|
2253
2253
|
issueData: {
|
|
2254
2254
|
code: d.invalid_return_type,
|
|
@@ -2257,14 +2257,14 @@ class H extends v {
|
|
|
2257
2257
|
});
|
|
2258
2258
|
}
|
|
2259
2259
|
const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2260
|
-
if (this._def.returns instanceof
|
|
2260
|
+
if (this._def.returns instanceof F) {
|
|
2261
2261
|
const o = this;
|
|
2262
2262
|
return S(async function(...u) {
|
|
2263
|
-
const c = new N([]), m = await o._def.args.parseAsync(u, a).catch((
|
|
2264
|
-
throw c.addIssue(n(u,
|
|
2265
|
-
}),
|
|
2266
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2267
|
-
throw c.addIssue(s(
|
|
2263
|
+
const c = new N([]), m = await o._def.args.parseAsync(u, a).catch((G) => {
|
|
2264
|
+
throw c.addIssue(n(u, G)), c;
|
|
2265
|
+
}), T = await Reflect.apply(i, this, m);
|
|
2266
|
+
return await o._def.returns._def.type.parseAsync(T, a).catch((G) => {
|
|
2267
|
+
throw c.addIssue(s(T, G)), c;
|
|
2268
2268
|
});
|
|
2269
2269
|
});
|
|
2270
2270
|
} else {
|
|
@@ -2273,10 +2273,10 @@ class H extends v {
|
|
|
2273
2273
|
const c = o._def.args.safeParse(u, a);
|
|
2274
2274
|
if (!c.success)
|
|
2275
2275
|
throw new N([n(u, c.error)]);
|
|
2276
|
-
const m = Reflect.apply(i, this, c.data),
|
|
2277
|
-
if (!
|
|
2278
|
-
throw new N([s(m,
|
|
2279
|
-
return
|
|
2276
|
+
const m = Reflect.apply(i, this, c.data), T = o._def.returns.safeParse(m, a);
|
|
2277
|
+
if (!T.success)
|
|
2278
|
+
throw new N([s(m, T.error)]);
|
|
2279
|
+
return T.data;
|
|
2280
2280
|
});
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
@@ -2287,13 +2287,13 @@ class H extends v {
|
|
|
2287
2287
|
return this._def.returns;
|
|
2288
2288
|
}
|
|
2289
2289
|
args(...e) {
|
|
2290
|
-
return new
|
|
2290
|
+
return new Q({
|
|
2291
2291
|
...this._def,
|
|
2292
2292
|
args: $.create(e).rest(U.create())
|
|
2293
2293
|
});
|
|
2294
2294
|
}
|
|
2295
2295
|
returns(e) {
|
|
2296
|
-
return new
|
|
2296
|
+
return new Q({
|
|
2297
2297
|
...this._def,
|
|
2298
2298
|
returns: e
|
|
2299
2299
|
});
|
|
@@ -2305,7 +2305,7 @@ class H extends v {
|
|
|
2305
2305
|
return this.parse(e);
|
|
2306
2306
|
}
|
|
2307
2307
|
static create(e, t, n) {
|
|
2308
|
-
return new
|
|
2308
|
+
return new Q({
|
|
2309
2309
|
args: e || $.create([]).rest(U.create()),
|
|
2310
2310
|
returns: t || U.create(),
|
|
2311
2311
|
typeName: p.ZodFunction,
|
|
@@ -2313,7 +2313,7 @@ class H extends v {
|
|
|
2313
2313
|
});
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
|
-
class
|
|
2316
|
+
class ue extends v {
|
|
2317
2317
|
get schema() {
|
|
2318
2318
|
return this._def.getter();
|
|
2319
2319
|
}
|
|
@@ -2322,12 +2322,12 @@ class de extends v {
|
|
|
2322
2322
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
|
-
|
|
2325
|
+
ue.create = (r, e) => new ue({
|
|
2326
2326
|
getter: r,
|
|
2327
2327
|
typeName: p.ZodLazy,
|
|
2328
2328
|
..._(e)
|
|
2329
2329
|
});
|
|
2330
|
-
class
|
|
2330
|
+
class le extends v {
|
|
2331
2331
|
_parse(e) {
|
|
2332
2332
|
if (e.data !== this._def.value) {
|
|
2333
2333
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2343,12 +2343,12 @@ class ce extends v {
|
|
|
2343
2343
|
return this._def.value;
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
|
-
|
|
2346
|
+
le.create = (r, e) => new le({
|
|
2347
2347
|
value: r,
|
|
2348
2348
|
typeName: p.ZodLiteral,
|
|
2349
2349
|
..._(e)
|
|
2350
2350
|
});
|
|
2351
|
-
function
|
|
2351
|
+
function Be(r, e) {
|
|
2352
2352
|
return new L({
|
|
2353
2353
|
values: r,
|
|
2354
2354
|
typeName: p.ZodEnum,
|
|
@@ -2357,7 +2357,7 @@ function Ue(r, e) {
|
|
|
2357
2357
|
}
|
|
2358
2358
|
class L extends v {
|
|
2359
2359
|
constructor() {
|
|
2360
|
-
super(...arguments),
|
|
2360
|
+
super(...arguments), ee.set(this, void 0);
|
|
2361
2361
|
}
|
|
2362
2362
|
_parse(e) {
|
|
2363
2363
|
if (typeof e.data != "string") {
|
|
@@ -2368,7 +2368,7 @@ class L extends v {
|
|
|
2368
2368
|
code: d.invalid_type
|
|
2369
2369
|
}), y;
|
|
2370
2370
|
}
|
|
2371
|
-
if (
|
|
2371
|
+
if (xe(this, ee) || Ve(this, ee, new Set(this._def.values)), !xe(this, ee).has(e.data)) {
|
|
2372
2372
|
const t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2373
2373
|
return l(t, {
|
|
2374
2374
|
received: t.data,
|
|
@@ -2412,11 +2412,11 @@ class L extends v {
|
|
|
2412
2412
|
});
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
2415
|
-
|
|
2416
|
-
L.create =
|
|
2417
|
-
class
|
|
2415
|
+
ee = /* @__PURE__ */ new WeakMap();
|
|
2416
|
+
L.create = Be;
|
|
2417
|
+
class fe extends v {
|
|
2418
2418
|
constructor() {
|
|
2419
|
-
super(...arguments),
|
|
2419
|
+
super(...arguments), te.set(this, void 0);
|
|
2420
2420
|
}
|
|
2421
2421
|
_parse(e) {
|
|
2422
2422
|
const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
@@ -2428,7 +2428,7 @@ class ue extends v {
|
|
|
2428
2428
|
code: d.invalid_type
|
|
2429
2429
|
}), y;
|
|
2430
2430
|
}
|
|
2431
|
-
if (
|
|
2431
|
+
if (xe(this, te) || Ve(this, te, new Set(x.getValidEnumValues(this._def.values))), !xe(this, te).has(e.data)) {
|
|
2432
2432
|
const s = x.objectValues(t);
|
|
2433
2433
|
return l(n, {
|
|
2434
2434
|
received: n.data,
|
|
@@ -2442,13 +2442,13 @@ class ue extends v {
|
|
|
2442
2442
|
return this._def.values;
|
|
2443
2443
|
}
|
|
2444
2444
|
}
|
|
2445
|
-
|
|
2446
|
-
|
|
2445
|
+
te = /* @__PURE__ */ new WeakMap();
|
|
2446
|
+
fe.create = (r, e) => new fe({
|
|
2447
2447
|
values: r,
|
|
2448
2448
|
typeName: p.ZodNativeEnum,
|
|
2449
2449
|
..._(e)
|
|
2450
2450
|
});
|
|
2451
|
-
class
|
|
2451
|
+
class F extends v {
|
|
2452
2452
|
unwrap() {
|
|
2453
2453
|
return this._def.type;
|
|
2454
2454
|
}
|
|
@@ -2467,7 +2467,7 @@ class X extends v {
|
|
|
2467
2467
|
})));
|
|
2468
2468
|
}
|
|
2469
2469
|
}
|
|
2470
|
-
|
|
2470
|
+
F.create = (r, e) => new F({
|
|
2471
2471
|
type: r,
|
|
2472
2472
|
typeName: p.ZodPromise,
|
|
2473
2473
|
..._(e)
|
|
@@ -2499,7 +2499,7 @@ class I extends v {
|
|
|
2499
2499
|
path: n.path,
|
|
2500
2500
|
parent: n
|
|
2501
2501
|
});
|
|
2502
|
-
return u.status === "aborted" ? y : u.status === "dirty" || t.value === "dirty" ?
|
|
2502
|
+
return u.status === "aborted" ? y : u.status === "dirty" || t.value === "dirty" ? J(u.value) : u;
|
|
2503
2503
|
});
|
|
2504
2504
|
{
|
|
2505
2505
|
if (t.value === "aborted")
|
|
@@ -2509,7 +2509,7 @@ class I extends v {
|
|
|
2509
2509
|
path: n.path,
|
|
2510
2510
|
parent: n
|
|
2511
2511
|
});
|
|
2512
|
-
return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ?
|
|
2512
|
+
return o.status === "aborted" ? y : o.status === "dirty" || t.value === "dirty" ? J(o.value) : o;
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
if (s.type === "refinement") {
|
|
@@ -2538,14 +2538,14 @@ class I extends v {
|
|
|
2538
2538
|
path: n.path,
|
|
2539
2539
|
parent: n
|
|
2540
2540
|
});
|
|
2541
|
-
if (!
|
|
2541
|
+
if (!re(i))
|
|
2542
2542
|
return i;
|
|
2543
2543
|
const o = s.transform(i.value, a);
|
|
2544
2544
|
if (o instanceof Promise)
|
|
2545
2545
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2546
2546
|
return { status: t.value, value: o };
|
|
2547
2547
|
} else
|
|
2548
|
-
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) =>
|
|
2548
|
+
return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => re(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
|
|
2549
2549
|
x.assertNever(s);
|
|
2550
2550
|
}
|
|
2551
2551
|
}
|
|
@@ -2587,7 +2587,7 @@ q.create = (r, e) => new q({
|
|
|
2587
2587
|
typeName: p.ZodNullable,
|
|
2588
2588
|
..._(e)
|
|
2589
2589
|
});
|
|
2590
|
-
class
|
|
2590
|
+
class he extends v {
|
|
2591
2591
|
_parse(e) {
|
|
2592
2592
|
const { ctx: t } = this._processInputParams(e);
|
|
2593
2593
|
let n = t.data;
|
|
@@ -2601,13 +2601,13 @@ class le extends v {
|
|
|
2601
2601
|
return this._def.innerType;
|
|
2602
2602
|
}
|
|
2603
2603
|
}
|
|
2604
|
-
|
|
2604
|
+
he.create = (r, e) => new he({
|
|
2605
2605
|
innerType: r,
|
|
2606
2606
|
typeName: p.ZodDefault,
|
|
2607
2607
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2608
2608
|
..._(e)
|
|
2609
2609
|
});
|
|
2610
|
-
class
|
|
2610
|
+
class me extends v {
|
|
2611
2611
|
_parse(e) {
|
|
2612
2612
|
const { ctx: t } = this._processInputParams(e), n = {
|
|
2613
2613
|
...t,
|
|
@@ -2622,7 +2622,7 @@ class fe extends v {
|
|
|
2622
2622
|
...n
|
|
2623
2623
|
}
|
|
2624
2624
|
});
|
|
2625
|
-
return
|
|
2625
|
+
return ne(s) ? s.then((a) => ({
|
|
2626
2626
|
status: "valid",
|
|
2627
2627
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2628
2628
|
get error() {
|
|
@@ -2644,13 +2644,13 @@ class fe extends v {
|
|
|
2644
2644
|
return this._def.innerType;
|
|
2645
2645
|
}
|
|
2646
2646
|
}
|
|
2647
|
-
|
|
2647
|
+
me.create = (r, e) => new me({
|
|
2648
2648
|
innerType: r,
|
|
2649
2649
|
typeName: p.ZodCatch,
|
|
2650
2650
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2651
2651
|
..._(e)
|
|
2652
2652
|
});
|
|
2653
|
-
class
|
|
2653
|
+
class Te extends v {
|
|
2654
2654
|
_parse(e) {
|
|
2655
2655
|
if (this._getType(e) !== f.nan) {
|
|
2656
2656
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2663,12 +2663,12 @@ class be extends v {
|
|
|
2663
2663
|
return { status: "valid", value: e.data };
|
|
2664
2664
|
}
|
|
2665
2665
|
}
|
|
2666
|
-
|
|
2666
|
+
Te.create = (r) => new Te({
|
|
2667
2667
|
typeName: p.ZodNaN,
|
|
2668
2668
|
..._(r)
|
|
2669
2669
|
});
|
|
2670
|
-
const
|
|
2671
|
-
class
|
|
2670
|
+
const xt = Symbol("zod_brand");
|
|
2671
|
+
class Re extends v {
|
|
2672
2672
|
_parse(e) {
|
|
2673
2673
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2674
2674
|
return this._def.type._parse({
|
|
@@ -2681,7 +2681,7 @@ class Ee extends v {
|
|
|
2681
2681
|
return this._def.type;
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
class
|
|
2684
|
+
class ye extends v {
|
|
2685
2685
|
_parse(e) {
|
|
2686
2686
|
const { status: t, ctx: n } = this._processInputParams(e);
|
|
2687
2687
|
if (n.common.async)
|
|
@@ -2691,7 +2691,7 @@ class me extends v {
|
|
|
2691
2691
|
path: n.path,
|
|
2692
2692
|
parent: n
|
|
2693
2693
|
});
|
|
2694
|
-
return a.status === "aborted" ? y : a.status === "dirty" ? (t.dirty(),
|
|
2694
|
+
return a.status === "aborted" ? y : a.status === "dirty" ? (t.dirty(), J(a.value)) : this._def.out._parseAsync({
|
|
2695
2695
|
data: a.value,
|
|
2696
2696
|
path: n.path,
|
|
2697
2697
|
parent: n
|
|
@@ -2714,38 +2714,38 @@ class me extends v {
|
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
2716
|
static create(e, t) {
|
|
2717
|
-
return new
|
|
2717
|
+
return new ye({
|
|
2718
2718
|
in: e,
|
|
2719
2719
|
out: t,
|
|
2720
2720
|
typeName: p.ZodPipeline
|
|
2721
2721
|
});
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
|
-
class
|
|
2724
|
+
class pe extends v {
|
|
2725
2725
|
_parse(e) {
|
|
2726
|
-
const t = this._def.innerType._parse(e), n = (s) => (
|
|
2727
|
-
return
|
|
2726
|
+
const t = this._def.innerType._parse(e), n = (s) => (re(s) && (s.value = Object.freeze(s.value)), s);
|
|
2727
|
+
return ne(t) ? t.then((s) => n(s)) : n(t);
|
|
2728
2728
|
}
|
|
2729
2729
|
unwrap() {
|
|
2730
2730
|
return this._def.innerType;
|
|
2731
2731
|
}
|
|
2732
2732
|
}
|
|
2733
|
-
|
|
2733
|
+
pe.create = (r, e) => new pe({
|
|
2734
2734
|
innerType: r,
|
|
2735
2735
|
typeName: p.ZodReadonly,
|
|
2736
2736
|
..._(e)
|
|
2737
2737
|
});
|
|
2738
|
-
function
|
|
2739
|
-
return r ?
|
|
2738
|
+
function We(r, e = {}, t) {
|
|
2739
|
+
return r ? K.create().superRefine((n, s) => {
|
|
2740
2740
|
var a, i;
|
|
2741
2741
|
if (!r(n)) {
|
|
2742
2742
|
const o = typeof e == "function" ? e(n) : typeof e == "string" ? { message: e } : e, u = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, c = typeof o == "string" ? { message: o } : o;
|
|
2743
2743
|
s.addIssue({ code: "custom", ...c, fatal: u });
|
|
2744
2744
|
}
|
|
2745
|
-
}) :
|
|
2745
|
+
}) : K.create();
|
|
2746
2746
|
}
|
|
2747
|
-
const
|
|
2748
|
-
object:
|
|
2747
|
+
const bt = {
|
|
2748
|
+
object: b.lazycreate
|
|
2749
2749
|
};
|
|
2750
2750
|
var p;
|
|
2751
2751
|
(function(r) {
|
|
@@ -2753,152 +2753,152 @@ var p;
|
|
|
2753
2753
|
})(p || (p = {}));
|
|
2754
2754
|
const kt = (r, e = {
|
|
2755
2755
|
message: `Input not instance of ${r.name}`
|
|
2756
|
-
}) =>
|
|
2756
|
+
}) => We((t) => t instanceof r, e), Ye = E.create, Ge = D.create, wt = Te.create, Tt = V.create, He = se.create, Zt = B.create, Ct = be.create, St = ae.create, Ot = ie.create, Nt = K.create, Et = U.create, Rt = z.create, It = ke.create, jt = R.create, At = b.create, $t = b.strictCreate, Mt = oe.create, zt = Ze.create, Pt = de.create, Dt = $.create, Vt = ce.create, Lt = we.create, qt = W.create, Ut = Q.create, Bt = ue.create, Wt = le.create, Yt = L.create, Gt = fe.create, Ht = F.create, Ae = I.create, Jt = j.create, Qt = q.create, Xt = I.createWithPreprocess, Kt = ye.create, Ft = () => Ye().optional(), er = () => Ge().optional(), tr = () => He().optional(), rr = {
|
|
2757
2757
|
string: (r) => E.create({ ...r, coerce: !0 }),
|
|
2758
2758
|
number: (r) => D.create({ ...r, coerce: !0 }),
|
|
2759
|
-
boolean: (r) =>
|
|
2759
|
+
boolean: (r) => se.create({
|
|
2760
2760
|
...r,
|
|
2761
2761
|
coerce: !0
|
|
2762
2762
|
}),
|
|
2763
2763
|
bigint: (r) => V.create({ ...r, coerce: !0 }),
|
|
2764
2764
|
date: (r) => B.create({ ...r, coerce: !0 })
|
|
2765
|
-
},
|
|
2765
|
+
}, nr = y;
|
|
2766
2766
|
var O = /* @__PURE__ */ Object.freeze({
|
|
2767
2767
|
__proto__: null,
|
|
2768
|
-
defaultErrorMap:
|
|
2769
|
-
setErrorMap:
|
|
2770
|
-
getErrorMap:
|
|
2771
|
-
makeIssue:
|
|
2772
|
-
EMPTY_PATH:
|
|
2768
|
+
defaultErrorMap: X,
|
|
2769
|
+
setErrorMap: nt,
|
|
2770
|
+
getErrorMap: ve,
|
|
2771
|
+
makeIssue: ge,
|
|
2772
|
+
EMPTY_PATH: st,
|
|
2773
2773
|
addIssueToContext: l,
|
|
2774
|
-
ParseStatus:
|
|
2774
|
+
ParseStatus: C,
|
|
2775
2775
|
INVALID: y,
|
|
2776
|
-
DIRTY:
|
|
2776
|
+
DIRTY: J,
|
|
2777
2777
|
OK: S,
|
|
2778
|
-
isAborted:
|
|
2779
|
-
isDirty:
|
|
2780
|
-
isValid:
|
|
2781
|
-
isAsync:
|
|
2778
|
+
isAborted: Oe,
|
|
2779
|
+
isDirty: Ne,
|
|
2780
|
+
isValid: re,
|
|
2781
|
+
isAsync: ne,
|
|
2782
2782
|
get util() {
|
|
2783
2783
|
return x;
|
|
2784
2784
|
},
|
|
2785
2785
|
get objectUtil() {
|
|
2786
|
-
return
|
|
2786
|
+
return Se;
|
|
2787
2787
|
},
|
|
2788
2788
|
ZodParsedType: f,
|
|
2789
2789
|
getParsedType: P,
|
|
2790
2790
|
ZodType: v,
|
|
2791
|
-
datetimeRegex:
|
|
2791
|
+
datetimeRegex: Ue,
|
|
2792
2792
|
ZodString: E,
|
|
2793
2793
|
ZodNumber: D,
|
|
2794
2794
|
ZodBigInt: V,
|
|
2795
|
-
ZodBoolean:
|
|
2795
|
+
ZodBoolean: se,
|
|
2796
2796
|
ZodDate: B,
|
|
2797
|
-
ZodSymbol:
|
|
2798
|
-
ZodUndefined:
|
|
2799
|
-
ZodNull:
|
|
2800
|
-
ZodAny:
|
|
2797
|
+
ZodSymbol: be,
|
|
2798
|
+
ZodUndefined: ae,
|
|
2799
|
+
ZodNull: ie,
|
|
2800
|
+
ZodAny: K,
|
|
2801
2801
|
ZodUnknown: U,
|
|
2802
2802
|
ZodNever: z,
|
|
2803
|
-
ZodVoid:
|
|
2803
|
+
ZodVoid: ke,
|
|
2804
2804
|
ZodArray: R,
|
|
2805
|
-
ZodObject:
|
|
2806
|
-
ZodUnion:
|
|
2807
|
-
ZodDiscriminatedUnion:
|
|
2808
|
-
ZodIntersection:
|
|
2805
|
+
ZodObject: b,
|
|
2806
|
+
ZodUnion: oe,
|
|
2807
|
+
ZodDiscriminatedUnion: Ze,
|
|
2808
|
+
ZodIntersection: de,
|
|
2809
2809
|
ZodTuple: $,
|
|
2810
|
-
ZodRecord:
|
|
2811
|
-
ZodMap:
|
|
2810
|
+
ZodRecord: ce,
|
|
2811
|
+
ZodMap: we,
|
|
2812
2812
|
ZodSet: W,
|
|
2813
|
-
ZodFunction:
|
|
2814
|
-
ZodLazy:
|
|
2815
|
-
ZodLiteral:
|
|
2813
|
+
ZodFunction: Q,
|
|
2814
|
+
ZodLazy: ue,
|
|
2815
|
+
ZodLiteral: le,
|
|
2816
2816
|
ZodEnum: L,
|
|
2817
|
-
ZodNativeEnum:
|
|
2818
|
-
ZodPromise:
|
|
2817
|
+
ZodNativeEnum: fe,
|
|
2818
|
+
ZodPromise: F,
|
|
2819
2819
|
ZodEffects: I,
|
|
2820
2820
|
ZodTransformer: I,
|
|
2821
2821
|
ZodOptional: j,
|
|
2822
2822
|
ZodNullable: q,
|
|
2823
|
-
ZodDefault:
|
|
2824
|
-
ZodCatch:
|
|
2825
|
-
ZodNaN:
|
|
2826
|
-
BRAND:
|
|
2827
|
-
ZodBranded:
|
|
2828
|
-
ZodPipeline:
|
|
2829
|
-
ZodReadonly:
|
|
2830
|
-
custom:
|
|
2823
|
+
ZodDefault: he,
|
|
2824
|
+
ZodCatch: me,
|
|
2825
|
+
ZodNaN: Te,
|
|
2826
|
+
BRAND: xt,
|
|
2827
|
+
ZodBranded: Re,
|
|
2828
|
+
ZodPipeline: ye,
|
|
2829
|
+
ZodReadonly: pe,
|
|
2830
|
+
custom: We,
|
|
2831
2831
|
Schema: v,
|
|
2832
2832
|
ZodSchema: v,
|
|
2833
|
-
late:
|
|
2833
|
+
late: bt,
|
|
2834
2834
|
get ZodFirstPartyTypeKind() {
|
|
2835
2835
|
return p;
|
|
2836
2836
|
},
|
|
2837
|
-
coerce:
|
|
2838
|
-
any:
|
|
2839
|
-
array:
|
|
2840
|
-
bigint:
|
|
2841
|
-
boolean:
|
|
2842
|
-
date:
|
|
2843
|
-
discriminatedUnion:
|
|
2844
|
-
effect:
|
|
2845
|
-
enum:
|
|
2846
|
-
function:
|
|
2837
|
+
coerce: rr,
|
|
2838
|
+
any: Nt,
|
|
2839
|
+
array: jt,
|
|
2840
|
+
bigint: Tt,
|
|
2841
|
+
boolean: He,
|
|
2842
|
+
date: Zt,
|
|
2843
|
+
discriminatedUnion: zt,
|
|
2844
|
+
effect: Ae,
|
|
2845
|
+
enum: Yt,
|
|
2846
|
+
function: Ut,
|
|
2847
2847
|
instanceof: kt,
|
|
2848
|
-
intersection:
|
|
2849
|
-
lazy:
|
|
2850
|
-
literal:
|
|
2851
|
-
map:
|
|
2852
|
-
nan:
|
|
2853
|
-
nativeEnum:
|
|
2854
|
-
never:
|
|
2855
|
-
null:
|
|
2856
|
-
nullable:
|
|
2857
|
-
number:
|
|
2858
|
-
object:
|
|
2859
|
-
oboolean:
|
|
2860
|
-
onumber:
|
|
2861
|
-
optional:
|
|
2862
|
-
ostring:
|
|
2863
|
-
pipeline:
|
|
2864
|
-
preprocess:
|
|
2865
|
-
promise:
|
|
2866
|
-
record:
|
|
2867
|
-
set:
|
|
2868
|
-
strictObject:
|
|
2869
|
-
string:
|
|
2870
|
-
symbol:
|
|
2871
|
-
transformer:
|
|
2872
|
-
tuple:
|
|
2873
|
-
undefined:
|
|
2874
|
-
union:
|
|
2875
|
-
unknown:
|
|
2876
|
-
void:
|
|
2877
|
-
NEVER:
|
|
2848
|
+
intersection: Pt,
|
|
2849
|
+
lazy: Bt,
|
|
2850
|
+
literal: Wt,
|
|
2851
|
+
map: Lt,
|
|
2852
|
+
nan: wt,
|
|
2853
|
+
nativeEnum: Gt,
|
|
2854
|
+
never: Rt,
|
|
2855
|
+
null: Ot,
|
|
2856
|
+
nullable: Qt,
|
|
2857
|
+
number: Ge,
|
|
2858
|
+
object: At,
|
|
2859
|
+
oboolean: tr,
|
|
2860
|
+
onumber: er,
|
|
2861
|
+
optional: Jt,
|
|
2862
|
+
ostring: Ft,
|
|
2863
|
+
pipeline: Kt,
|
|
2864
|
+
preprocess: Xt,
|
|
2865
|
+
promise: Ht,
|
|
2866
|
+
record: Vt,
|
|
2867
|
+
set: qt,
|
|
2868
|
+
strictObject: $t,
|
|
2869
|
+
string: Ye,
|
|
2870
|
+
symbol: Ct,
|
|
2871
|
+
transformer: Ae,
|
|
2872
|
+
tuple: Dt,
|
|
2873
|
+
undefined: St,
|
|
2874
|
+
union: Mt,
|
|
2875
|
+
unknown: Et,
|
|
2876
|
+
void: It,
|
|
2877
|
+
NEVER: nr,
|
|
2878
2878
|
ZodIssueCode: d,
|
|
2879
|
-
quotelessJson:
|
|
2879
|
+
quotelessJson: rt,
|
|
2880
2880
|
ZodError: N
|
|
2881
2881
|
});
|
|
2882
|
-
const
|
|
2883
|
-
const { formValidationTexts: r } =
|
|
2882
|
+
const lr = () => {
|
|
2883
|
+
const { formValidationTexts: r } = Me(Qe), e = (g) => (g != null && g.useCoerce ? O.coerce : O).string({
|
|
2884
2884
|
invalid_type_error: r.required,
|
|
2885
2885
|
required_error: r.required
|
|
2886
|
-
}).transform((w) => w ?? null), t = (g) => e(g).nullable().optional().transform((
|
|
2887
|
-
const
|
|
2886
|
+
}).transform((w) => w ?? null), t = (g) => e(g).nullable().optional().transform((k) => k ?? null), n = (g) => {
|
|
2887
|
+
const k = (g != null && g.useCoerce ? O.coerce : O).number({
|
|
2888
2888
|
invalid_type_error: r.required,
|
|
2889
2889
|
required_error: r.required
|
|
2890
2890
|
});
|
|
2891
|
-
return (g == null ? void 0 : g.min) !== void 0 &&
|
|
2892
|
-
}, s = (g) => n(g).nullable().optional().transform((
|
|
2891
|
+
return (g == null ? void 0 : g.min) !== void 0 && k.min(g.min), (g == null ? void 0 : g.max) !== void 0 && k.max(g.max), k.transform((w) => w ?? null);
|
|
2892
|
+
}, s = (g) => n(g).nullable().optional().transform((k) => k ?? null), a = (g) => (g != null && g.useCoerce ? O.coerce : O).boolean({
|
|
2893
2893
|
invalid_type_error: r.required,
|
|
2894
2894
|
required_error: r.required
|
|
2895
|
-
}).transform((
|
|
2895
|
+
}).transform((k) => k ?? null), i = (g) => (g != null && g.useCoerce ? O.coerce : O).string({
|
|
2896
2896
|
invalid_type_error: r.required,
|
|
2897
2897
|
required_error: r.required
|
|
2898
|
-
}).refine(
|
|
2898
|
+
}).refine(tt, { message: r.invalidDate }).transform((w) => w ?? null), o = (g) => i(g).nullable().transform((k) => k ?? null), u = (g, k) => O.enum(g, {
|
|
2899
2899
|
invalid_type_error: r.required,
|
|
2900
2900
|
required_error: r.required
|
|
2901
|
-
}).transform((
|
|
2901
|
+
}).transform((Ie) => Ie ?? null);
|
|
2902
2902
|
return {
|
|
2903
2903
|
zString: t,
|
|
2904
2904
|
zStringRequired: e,
|
|
@@ -2907,33 +2907,41 @@ const ur = () => {
|
|
|
2907
2907
|
zBool: a,
|
|
2908
2908
|
zDate: o,
|
|
2909
2909
|
zDateRequired: i,
|
|
2910
|
-
zEnum: (g,
|
|
2910
|
+
zEnum: (g, k) => u(g).nullable().transform((w) => w ?? null),
|
|
2911
2911
|
zEnumRequired: u,
|
|
2912
2912
|
zObjectIdInt: (g) => O.object({ id: s({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2913
2913
|
zObjectIdIntRequired: (g) => O.object({ id: n() }).transform((w) => w ?? null),
|
|
2914
2914
|
zObjectIdStr: (g) => O.object({ id: t({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2915
2915
|
zObjectIdStrRequired: (g) => O.object({ id: e() }).transform((w) => w ?? null),
|
|
2916
|
-
zFile: ({ required: g, multiple:
|
|
2916
|
+
zFile: ({ required: g, multiple: k, maxFileSize: w }) => O.any().transform((Z) => Array.from(Z ?? [])).refine((Z) => !g || (Z == null ? void 0 : Z.length) > 0, "File is required.").refine((Z) => k || (Z == null ? void 0 : Z.length) <= 1, "Multiple files not allowed.").refine((Z) => Z.every((Je) => Je.size <= w), `Maximum file size is ${et(w)}.`).transform((Z) => (k ? Z : Z == null ? void 0 : Z[0]) ?? null)
|
|
2917
2917
|
};
|
|
2918
|
-
},
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2918
|
+
}, _e = {
|
|
2919
|
+
loadOnInit: !0,
|
|
2920
|
+
silent: !1,
|
|
2921
|
+
enabled: !0
|
|
2922
|
+
}, fr = (r, { loadOnInit: e = _e.loadOnInit, enabled: t = _e.enabled, silent: n = _e.silent } = _e) => {
|
|
2923
|
+
const s = $e({ silent: n }), { startLoading: a, stopLoading: i } = Me(Xe), o = Ke(0), [u, c] = ze(null), m = Fe(async (T, Y) => {
|
|
2924
|
+
if (t !== !1) {
|
|
2925
|
+
!n && a(`loadData-${r}-${Y}`), c(null);
|
|
2926
|
+
try {
|
|
2927
|
+
const G = await s.get(r, {
|
|
2928
|
+
signal: T
|
|
2929
|
+
});
|
|
2930
|
+
c(G.data);
|
|
2931
|
+
} finally {
|
|
2932
|
+
!n && i(`loadData-${r}-${Y}`);
|
|
2933
|
+
}
|
|
2928
2934
|
}
|
|
2929
|
-
}, [t, n,
|
|
2930
|
-
return
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2935
|
+
}, [t, n, a, r, s, i]);
|
|
2936
|
+
return Pe(() => {
|
|
2937
|
+
if (e === !1)
|
|
2938
|
+
return;
|
|
2939
|
+
const T = new AbortController();
|
|
2940
|
+
return m(T.signal, ++o.current), () => {
|
|
2941
|
+
T.abort();
|
|
2934
2942
|
};
|
|
2935
|
-
}, [
|
|
2936
|
-
},
|
|
2943
|
+
}, [m, e]), { data: u, setData: c, reloadData: m };
|
|
2944
|
+
}, sr = (r) => {
|
|
2937
2945
|
let e = "pending", t;
|
|
2938
2946
|
const n = r.then((s) => {
|
|
2939
2947
|
e = "success", t = s;
|
|
@@ -2953,27 +2961,27 @@ const ur = () => {
|
|
|
2953
2961
|
}
|
|
2954
2962
|
};
|
|
2955
2963
|
};
|
|
2956
|
-
function
|
|
2957
|
-
const e =
|
|
2958
|
-
return
|
|
2964
|
+
function hr(r) {
|
|
2965
|
+
const e = $e({ silent: !0 }), [t, n] = ze(null);
|
|
2966
|
+
return Pe(() => {
|
|
2959
2967
|
(async () => {
|
|
2960
2968
|
const a = e.get(r).then((i) => i.data);
|
|
2961
|
-
n(
|
|
2969
|
+
n(sr(a));
|
|
2962
2970
|
})();
|
|
2963
2971
|
}, [e, r]), t;
|
|
2964
2972
|
}
|
|
2965
2973
|
export {
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2974
|
+
yr as cancelToken,
|
|
2975
|
+
_r as useAuth,
|
|
2976
|
+
$e as useAxios,
|
|
2977
|
+
wr as useClickOutside,
|
|
2978
|
+
xr as useConfirm,
|
|
2979
|
+
Tr as useFormControlType,
|
|
2980
|
+
fr as useGetApiData,
|
|
2981
|
+
hr as useGetDataBound,
|
|
2982
|
+
Zr as useKeyPress,
|
|
2983
|
+
vr as useNotifications,
|
|
2984
|
+
Sr as usePermissions,
|
|
2985
|
+
br as usePrompt,
|
|
2986
|
+
lr as useZodSchemaTypes
|
|
2979
2987
|
};
|