@jsfsi-core/ts-crossplatform 1.1.14 → 1.1.15
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.cjs +3 -3
- package/dist/index.mjs +336 -327
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ur = (e = {}) => e, sr = (e) => [e, void 0], ir = (e) => [
|
|
2
2
|
void 0,
|
|
3
3
|
e
|
|
4
4
|
];
|
|
5
|
-
class
|
|
5
|
+
class cr {
|
|
6
6
|
name;
|
|
7
7
|
constructor() {
|
|
8
8
|
this.name = this.constructor.name;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const ar = (
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
((e) => (n) => !(n instanceof e))
|
|
14
|
-
),
|
|
14
|
+
), lr = (
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
((e) => (n) => n instanceof e)
|
|
17
|
-
),
|
|
17
|
+
), fr = (e, n = process.env) => {
|
|
18
18
|
const t = e.safeParse(n);
|
|
19
19
|
if (!t.success)
|
|
20
20
|
throw new Error(`Invalid environment variables: ${JSON.stringify(t.error.issues)}`);
|
|
21
21
|
return t.data;
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function dr(e) {
|
|
24
24
|
return new Promise((n) => setTimeout(n, e));
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Ye(e, n) {
|
|
27
27
|
return new Date(e).toLocaleDateString(n, {
|
|
28
28
|
year: "numeric",
|
|
29
29
|
month: "2-digit",
|
|
30
30
|
day: "2-digit"
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function He(e, n) {
|
|
34
34
|
return new Date(e).toLocaleTimeString(n, {
|
|
35
35
|
hour12: !1,
|
|
36
36
|
hour: "2-digit",
|
|
@@ -38,10 +38,10 @@ function Ye(e, n) {
|
|
|
38
38
|
second: "2-digit"
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return `${
|
|
41
|
+
function hr(e, n) {
|
|
42
|
+
return `${Ye(e, n)} ${He(e, n)}`;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function pr({
|
|
45
45
|
allDay: e,
|
|
46
46
|
startDate: n,
|
|
47
47
|
startTime: t,
|
|
@@ -73,47 +73,47 @@ function hr({
|
|
|
73
73
|
}
|
|
74
74
|
return o;
|
|
75
75
|
}
|
|
76
|
-
const
|
|
77
|
-
function
|
|
78
|
-
return typeof e == "string" &&
|
|
76
|
+
const qe = "00000000-0000-0000-0000-000000000000", Be = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
77
|
+
function $e(e) {
|
|
78
|
+
return typeof e == "string" && Be.test(e);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
if (
|
|
80
|
+
function Xe(e) {
|
|
81
|
+
if (!$e(e))
|
|
82
82
|
throw TypeError("Invalid UUID");
|
|
83
83
|
let n;
|
|
84
84
|
return Uint8Array.of((n = parseInt(e.slice(0, 8), 16)) >>> 24, n >>> 16 & 255, n >>> 8 & 255, n & 255, (n = parseInt(e.slice(9, 13), 16)) >>> 8, n & 255, (n = parseInt(e.slice(14, 18), 16)) >>> 8, n & 255, (n = parseInt(e.slice(19, 23), 16)) >>> 8, n & 255, (n = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, n / 4294967296 & 255, n >>> 24 & 255, n >>> 16 & 255, n >>> 8 & 255, n & 255);
|
|
85
85
|
}
|
|
86
|
-
const
|
|
86
|
+
const z = [];
|
|
87
87
|
for (let e = 0; e < 256; ++e)
|
|
88
|
-
|
|
89
|
-
function
|
|
90
|
-
return (
|
|
88
|
+
z.push((e + 256).toString(16).slice(1));
|
|
89
|
+
function We(e, n = 0) {
|
|
90
|
+
return (z[e[n + 0]] + z[e[n + 1]] + z[e[n + 2]] + z[e[n + 3]] + "-" + z[e[n + 4]] + z[e[n + 5]] + "-" + z[e[n + 6]] + z[e[n + 7]] + "-" + z[e[n + 8]] + z[e[n + 9]] + "-" + z[e[n + 10]] + z[e[n + 11]] + z[e[n + 12]] + z[e[n + 13]] + z[e[n + 14]] + z[e[n + 15]]).toLowerCase();
|
|
91
91
|
}
|
|
92
92
|
let J;
|
|
93
|
-
const
|
|
94
|
-
function
|
|
93
|
+
const Qe = new Uint8Array(16);
|
|
94
|
+
function en() {
|
|
95
95
|
if (!J) {
|
|
96
96
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
97
97
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
98
98
|
J = crypto.getRandomValues.bind(crypto);
|
|
99
99
|
}
|
|
100
|
-
return J(
|
|
100
|
+
return J(Qe);
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
function
|
|
102
|
+
const nn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), oe = { randomUUID: nn };
|
|
103
|
+
function tn(e, n, t) {
|
|
104
104
|
e = e || {};
|
|
105
|
-
const r = e.random ?? e.rng?.() ??
|
|
105
|
+
const r = e.random ?? e.rng?.() ?? en();
|
|
106
106
|
if (r.length < 16)
|
|
107
107
|
throw new Error("Random bytes length must be >= 16");
|
|
108
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
108
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, We(r);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return oe.randomUUID && !e ? oe.randomUUID() :
|
|
110
|
+
function rn(e, n, t) {
|
|
111
|
+
return oe.randomUUID && !e ? oe.randomUUID() : tn(e);
|
|
112
112
|
}
|
|
113
113
|
class S {
|
|
114
114
|
uuid;
|
|
115
115
|
constructor(n) {
|
|
116
|
-
|
|
116
|
+
Xe(n), this.uuid = n;
|
|
117
117
|
}
|
|
118
118
|
toString() {
|
|
119
119
|
return this.uuid;
|
|
@@ -122,13 +122,13 @@ class S {
|
|
|
122
122
|
return this.uuid === n.toString();
|
|
123
123
|
}
|
|
124
124
|
static new() {
|
|
125
|
-
return new S(
|
|
125
|
+
return new S(rn());
|
|
126
126
|
}
|
|
127
127
|
static empty() {
|
|
128
|
-
return new S(
|
|
128
|
+
return new S(qe);
|
|
129
129
|
}
|
|
130
130
|
static isValid(n) {
|
|
131
|
-
return !!(n &&
|
|
131
|
+
return !!(n && $e(n));
|
|
132
132
|
}
|
|
133
133
|
static parse(n) {
|
|
134
134
|
return n && S.isValid(n) ? new S(n) : void 0;
|
|
@@ -136,14 +136,21 @@ class S {
|
|
|
136
136
|
}
|
|
137
137
|
function a(e, n, t) {
|
|
138
138
|
function r(i, c) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
if (i._zod || Object.defineProperty(i, "_zod", {
|
|
140
|
+
value: {
|
|
141
|
+
def: c,
|
|
142
|
+
constr: s,
|
|
143
|
+
traits: /* @__PURE__ */ new Set()
|
|
144
|
+
},
|
|
142
145
|
enumerable: !1
|
|
143
|
-
}),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
}), i._zod.traits.has(e))
|
|
147
|
+
return;
|
|
148
|
+
i._zod.traits.add(e), n(i, c);
|
|
149
|
+
const l = s.prototype, f = Object.keys(l);
|
|
150
|
+
for (let m = 0; m < f.length; m++) {
|
|
151
|
+
const d = f[m];
|
|
152
|
+
d in i || (i[d] = l[d].bind(i));
|
|
153
|
+
}
|
|
147
154
|
}
|
|
148
155
|
const o = t?.Parent ?? Object;
|
|
149
156
|
class u extends o {
|
|
@@ -166,16 +173,16 @@ class j extends Error {
|
|
|
166
173
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
167
174
|
}
|
|
168
175
|
}
|
|
169
|
-
class
|
|
176
|
+
class Ze extends Error {
|
|
170
177
|
constructor(n) {
|
|
171
178
|
super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
|
|
172
179
|
}
|
|
173
180
|
}
|
|
174
|
-
const
|
|
181
|
+
const Pe = {};
|
|
175
182
|
function P(e) {
|
|
176
|
-
return
|
|
183
|
+
return Pe;
|
|
177
184
|
}
|
|
178
|
-
function
|
|
185
|
+
function on(e) {
|
|
179
186
|
const n = Object.values(e).filter((r) => typeof r == "number");
|
|
180
187
|
return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
|
|
181
188
|
}
|
|
@@ -199,7 +206,7 @@ function Q(e) {
|
|
|
199
206
|
const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
|
|
200
207
|
return e.slice(n, t);
|
|
201
208
|
}
|
|
202
|
-
function
|
|
209
|
+
function un(e, n) {
|
|
203
210
|
const t = (e.toString().split(".")[1] || "").length, r = n.toString();
|
|
204
211
|
let o = (r.split(".")[1] || "").length;
|
|
205
212
|
if (o === 0 && /\d?e-\d?/.test(r)) {
|
|
@@ -210,7 +217,7 @@ function on(e, n) {
|
|
|
210
217
|
return s % i / 10 ** u;
|
|
211
218
|
}
|
|
212
219
|
const ue = Symbol("evaluating");
|
|
213
|
-
function
|
|
220
|
+
function h(e, n, t) {
|
|
214
221
|
let r;
|
|
215
222
|
Object.defineProperty(e, n, {
|
|
216
223
|
get() {
|
|
@@ -226,7 +233,7 @@ function d(e, n, t) {
|
|
|
226
233
|
configurable: !0
|
|
227
234
|
});
|
|
228
235
|
}
|
|
229
|
-
function
|
|
236
|
+
function T(e, n, t) {
|
|
230
237
|
Object.defineProperty(e, n, {
|
|
231
238
|
value: t,
|
|
232
239
|
writable: !0,
|
|
@@ -234,7 +241,7 @@ function I(e, n, t) {
|
|
|
234
241
|
configurable: !0
|
|
235
242
|
});
|
|
236
243
|
}
|
|
237
|
-
function
|
|
244
|
+
function I(...e) {
|
|
238
245
|
const n = {};
|
|
239
246
|
for (const t of e) {
|
|
240
247
|
const r = Object.getOwnPropertyDescriptors(t);
|
|
@@ -245,12 +252,12 @@ function T(...e) {
|
|
|
245
252
|
function se(e) {
|
|
246
253
|
return JSON.stringify(e);
|
|
247
254
|
}
|
|
248
|
-
const
|
|
255
|
+
const Oe = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
249
256
|
};
|
|
250
257
|
function U(e) {
|
|
251
258
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
252
259
|
}
|
|
253
|
-
const
|
|
260
|
+
const sn = X(() => {
|
|
254
261
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
255
262
|
return !1;
|
|
256
263
|
try {
|
|
@@ -264,16 +271,16 @@ function x(e) {
|
|
|
264
271
|
if (U(e) === !1)
|
|
265
272
|
return !1;
|
|
266
273
|
const n = e.constructor;
|
|
267
|
-
if (n === void 0)
|
|
274
|
+
if (n === void 0 || typeof n != "function")
|
|
268
275
|
return !0;
|
|
269
276
|
const t = n.prototype;
|
|
270
277
|
return !(U(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
|
|
271
278
|
}
|
|
272
|
-
function
|
|
279
|
+
function Te(e) {
|
|
273
280
|
return x(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
274
281
|
}
|
|
275
|
-
const
|
|
276
|
-
function
|
|
282
|
+
const cn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
283
|
+
function an(e) {
|
|
277
284
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
278
285
|
}
|
|
279
286
|
function $(e, n, t) {
|
|
@@ -293,18 +300,18 @@ function p(e) {
|
|
|
293
300
|
}
|
|
294
301
|
return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
|
|
295
302
|
}
|
|
296
|
-
function
|
|
303
|
+
function ln(e) {
|
|
297
304
|
return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
|
|
298
305
|
}
|
|
299
|
-
const
|
|
306
|
+
const fn = {
|
|
300
307
|
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
301
308
|
int32: [-2147483648, 2147483647],
|
|
302
309
|
uint32: [0, 4294967295],
|
|
303
310
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
304
311
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
305
312
|
};
|
|
306
|
-
function
|
|
307
|
-
const t = e._zod.def, r =
|
|
313
|
+
function dn(e, n) {
|
|
314
|
+
const t = e._zod.def, r = I(e._zod.def, {
|
|
308
315
|
get shape() {
|
|
309
316
|
const o = {};
|
|
310
317
|
for (const u in n) {
|
|
@@ -312,14 +319,14 @@ function fn(e, n) {
|
|
|
312
319
|
throw new Error(`Unrecognized key: "${u}"`);
|
|
313
320
|
n[u] && (o[u] = t.shape[u]);
|
|
314
321
|
}
|
|
315
|
-
return
|
|
322
|
+
return T(this, "shape", o), o;
|
|
316
323
|
},
|
|
317
324
|
checks: []
|
|
318
325
|
});
|
|
319
326
|
return $(e, r);
|
|
320
327
|
}
|
|
321
|
-
function
|
|
322
|
-
const t = e._zod.def, r =
|
|
328
|
+
function hn(e, n) {
|
|
329
|
+
const t = e._zod.def, r = I(e._zod.def, {
|
|
323
330
|
get shape() {
|
|
324
331
|
const o = { ...e._zod.def.shape };
|
|
325
332
|
for (const u in n) {
|
|
@@ -327,45 +334,45 @@ function dn(e, n) {
|
|
|
327
334
|
throw new Error(`Unrecognized key: "${u}"`);
|
|
328
335
|
n[u] && delete o[u];
|
|
329
336
|
}
|
|
330
|
-
return
|
|
337
|
+
return T(this, "shape", o), o;
|
|
331
338
|
},
|
|
332
339
|
checks: []
|
|
333
340
|
});
|
|
334
341
|
return $(e, r);
|
|
335
342
|
}
|
|
336
|
-
function
|
|
343
|
+
function pn(e, n) {
|
|
337
344
|
if (!x(n))
|
|
338
345
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
339
346
|
const t = e._zod.def.checks;
|
|
340
347
|
if (t && t.length > 0)
|
|
341
348
|
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
342
|
-
const o =
|
|
349
|
+
const o = I(e._zod.def, {
|
|
343
350
|
get shape() {
|
|
344
351
|
const u = { ...e._zod.def.shape, ...n };
|
|
345
|
-
return
|
|
352
|
+
return T(this, "shape", u), u;
|
|
346
353
|
},
|
|
347
354
|
checks: []
|
|
348
355
|
});
|
|
349
356
|
return $(e, o);
|
|
350
357
|
}
|
|
351
|
-
function
|
|
358
|
+
function mn(e, n) {
|
|
352
359
|
if (!x(n))
|
|
353
360
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
354
361
|
const t = {
|
|
355
362
|
...e._zod.def,
|
|
356
363
|
get shape() {
|
|
357
364
|
const r = { ...e._zod.def.shape, ...n };
|
|
358
|
-
return
|
|
365
|
+
return T(this, "shape", r), r;
|
|
359
366
|
},
|
|
360
367
|
checks: e._zod.def.checks
|
|
361
368
|
};
|
|
362
369
|
return $(e, t);
|
|
363
370
|
}
|
|
364
|
-
function
|
|
365
|
-
const t =
|
|
371
|
+
function _n(e, n) {
|
|
372
|
+
const t = I(e._zod.def, {
|
|
366
373
|
get shape() {
|
|
367
374
|
const r = { ...e._zod.def.shape, ...n._zod.def.shape };
|
|
368
|
-
return
|
|
375
|
+
return T(this, "shape", r), r;
|
|
369
376
|
},
|
|
370
377
|
get catchall() {
|
|
371
378
|
return n._zod.def.catchall;
|
|
@@ -375,8 +382,8 @@ function mn(e, n) {
|
|
|
375
382
|
});
|
|
376
383
|
return $(e, t);
|
|
377
384
|
}
|
|
378
|
-
function
|
|
379
|
-
const r =
|
|
385
|
+
function gn(e, n, t) {
|
|
386
|
+
const r = I(n._zod.def, {
|
|
380
387
|
get shape() {
|
|
381
388
|
const o = n._zod.def.shape, u = { ...o };
|
|
382
389
|
if (t)
|
|
@@ -394,14 +401,14 @@ function _n(e, n, t) {
|
|
|
394
401
|
type: "optional",
|
|
395
402
|
innerType: o[s]
|
|
396
403
|
}) : o[s];
|
|
397
|
-
return
|
|
404
|
+
return T(this, "shape", u), u;
|
|
398
405
|
},
|
|
399
406
|
checks: []
|
|
400
407
|
});
|
|
401
408
|
return $(n, r);
|
|
402
409
|
}
|
|
403
|
-
function
|
|
404
|
-
const r =
|
|
410
|
+
function vn(e, n, t) {
|
|
411
|
+
const r = I(n._zod.def, {
|
|
405
412
|
get shape() {
|
|
406
413
|
const o = n._zod.def.shape, u = { ...o };
|
|
407
414
|
if (t)
|
|
@@ -419,7 +426,7 @@ function gn(e, n, t) {
|
|
|
419
426
|
type: "nonoptional",
|
|
420
427
|
innerType: o[s]
|
|
421
428
|
});
|
|
422
|
-
return
|
|
429
|
+
return T(this, "shape", u), u;
|
|
423
430
|
},
|
|
424
431
|
checks: []
|
|
425
432
|
});
|
|
@@ -462,7 +469,7 @@ function R(...e) {
|
|
|
462
469
|
inst: r
|
|
463
470
|
} : { ...n };
|
|
464
471
|
}
|
|
465
|
-
const
|
|
472
|
+
const Ne = (e, n) => {
|
|
466
473
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
467
474
|
value: e._zod,
|
|
468
475
|
enumerable: !1
|
|
@@ -473,14 +480,14 @@ const Te = (e, n) => {
|
|
|
473
480
|
value: () => e.message,
|
|
474
481
|
enumerable: !1
|
|
475
482
|
});
|
|
476
|
-
},
|
|
477
|
-
function
|
|
483
|
+
}, je = a("$ZodError", Ne), Ae = a("$ZodError", Ne, { Parent: Error });
|
|
484
|
+
function zn(e, n = (t) => t.message) {
|
|
478
485
|
const t = {}, r = [];
|
|
479
486
|
for (const o of e.issues)
|
|
480
487
|
o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
|
|
481
488
|
return { formErrors: r, fieldErrors: t };
|
|
482
489
|
}
|
|
483
|
-
function
|
|
490
|
+
function bn(e, n = (t) => t.message) {
|
|
484
491
|
const t = { _errors: [] }, r = (o) => {
|
|
485
492
|
for (const u of o.issues)
|
|
486
493
|
if (u.code === "invalid_union" && u.errors.length)
|
|
@@ -507,7 +514,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
507
514
|
throw new j();
|
|
508
515
|
if (s.issues.length) {
|
|
509
516
|
const i = new (o?.Err ?? e)(s.issues.map((c) => O(c, u, P())));
|
|
510
|
-
throw
|
|
517
|
+
throw Oe(i, o?.callee), i;
|
|
511
518
|
}
|
|
512
519
|
return s.value;
|
|
513
520
|
}, te = (e) => async (n, t, r, o) => {
|
|
@@ -515,7 +522,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
515
522
|
let s = n._zod.run({ value: t, issues: [] }, u);
|
|
516
523
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
517
524
|
const i = new (o?.Err ?? e)(s.issues.map((c) => O(c, u, P())));
|
|
518
|
-
throw
|
|
525
|
+
throw Oe(i, o?.callee), i;
|
|
519
526
|
}
|
|
520
527
|
return s.value;
|
|
521
528
|
}, V = (e) => (n, t, r) => {
|
|
@@ -524,37 +531,37 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
524
531
|
throw new j();
|
|
525
532
|
return u.issues.length ? {
|
|
526
533
|
success: !1,
|
|
527
|
-
error: new (e ??
|
|
534
|
+
error: new (e ?? je)(u.issues.map((s) => O(s, o, P())))
|
|
528
535
|
} : { success: !0, data: u.value };
|
|
529
|
-
},
|
|
536
|
+
}, wn = /* @__PURE__ */ V(Ae), L = (e) => async (n, t, r) => {
|
|
530
537
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
531
538
|
let u = n._zod.run({ value: t, issues: [] }, o);
|
|
532
539
|
return u instanceof Promise && (u = await u), u.issues.length ? {
|
|
533
540
|
success: !1,
|
|
534
541
|
error: new e(u.issues.map((s) => O(s, o, P())))
|
|
535
542
|
} : { success: !0, data: u.value };
|
|
536
|
-
},
|
|
543
|
+
}, yn = /* @__PURE__ */ L(Ae), kn = (e) => (n, t, r) => {
|
|
537
544
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
538
545
|
return ne(e)(n, t, o);
|
|
539
|
-
},
|
|
546
|
+
}, En = (e) => (n, t, r) => ne(e)(n, t, r), $n = (e) => async (n, t, r) => {
|
|
540
547
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
541
548
|
return te(e)(n, t, o);
|
|
542
|
-
},
|
|
549
|
+
}, Zn = (e) => async (n, t, r) => te(e)(n, t, r), Pn = (e) => (n, t, r) => {
|
|
543
550
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
544
551
|
return V(e)(n, t, o);
|
|
545
|
-
},
|
|
552
|
+
}, On = (e) => (n, t, r) => V(e)(n, t, r), Tn = (e) => async (n, t, r) => {
|
|
546
553
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
547
554
|
return L(e)(n, t, o);
|
|
548
|
-
}, In = (e) => async (n, t, r) => L(e)(n, t, r),
|
|
555
|
+
}, In = (e) => async (n, t, r) => L(e)(n, t, r), Nn = /^-?\d+$/, jn = /^-?\d+(?:\.\d+)?/, k = /* @__PURE__ */ a("$ZodCheck", (e, n) => {
|
|
549
556
|
var t;
|
|
550
557
|
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
|
|
551
|
-
}),
|
|
558
|
+
}), Se = {
|
|
552
559
|
number: "number",
|
|
553
560
|
bigint: "bigint",
|
|
554
561
|
object: "date"
|
|
555
|
-
},
|
|
562
|
+
}, xe = /* @__PURE__ */ a("$ZodCheckLessThan", (e, n) => {
|
|
556
563
|
k.init(e, n);
|
|
557
|
-
const t =
|
|
564
|
+
const t = Se[typeof n.value];
|
|
558
565
|
e._zod.onattach.push((r) => {
|
|
559
566
|
const o = r._zod.bag, u = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
560
567
|
n.value < u && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
|
|
@@ -569,9 +576,9 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
569
576
|
continue: !n.abort
|
|
570
577
|
});
|
|
571
578
|
};
|
|
572
|
-
}),
|
|
579
|
+
}), Re = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, n) => {
|
|
573
580
|
k.init(e, n);
|
|
574
|
-
const t =
|
|
581
|
+
const t = Se[typeof n.value];
|
|
575
582
|
e._zod.onattach.push((r) => {
|
|
576
583
|
const o = r._zod.bag, u = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
577
584
|
n.value > u && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
|
|
@@ -586,14 +593,14 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
586
593
|
continue: !n.abort
|
|
587
594
|
});
|
|
588
595
|
};
|
|
589
|
-
}),
|
|
596
|
+
}), An = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, n) => {
|
|
590
597
|
k.init(e, n), e._zod.onattach.push((t) => {
|
|
591
598
|
var r;
|
|
592
599
|
(r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
|
|
593
600
|
}), e._zod.check = (t) => {
|
|
594
601
|
if (typeof t.value != typeof n.value)
|
|
595
602
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
596
|
-
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) :
|
|
603
|
+
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : un(t.value, n.value) === 0) || t.issues.push({
|
|
597
604
|
origin: typeof t.value,
|
|
598
605
|
code: "not_multiple_of",
|
|
599
606
|
divisor: n.value,
|
|
@@ -602,12 +609,12 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
602
609
|
continue: !n.abort
|
|
603
610
|
});
|
|
604
611
|
};
|
|
605
|
-
}),
|
|
612
|
+
}), Sn = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, n) => {
|
|
606
613
|
k.init(e, n), n.format = n.format || "float64";
|
|
607
|
-
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] =
|
|
614
|
+
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, u] = fn[n.format];
|
|
608
615
|
e._zod.onattach.push((s) => {
|
|
609
616
|
const i = s._zod.bag;
|
|
610
|
-
i.format = n.format, i.minimum = o, i.maximum = u, t && (i.pattern =
|
|
617
|
+
i.format = n.format, i.minimum = o, i.maximum = u, t && (i.pattern = Nn);
|
|
611
618
|
}), e._zod.check = (s) => {
|
|
612
619
|
const i = s.value;
|
|
613
620
|
if (t) {
|
|
@@ -659,7 +666,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
659
666
|
inst: e
|
|
660
667
|
});
|
|
661
668
|
};
|
|
662
|
-
}),
|
|
669
|
+
}), xn = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, n) => {
|
|
663
670
|
var t;
|
|
664
671
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
665
672
|
const o = r.value;
|
|
@@ -682,7 +689,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
682
689
|
continue: !n.abort
|
|
683
690
|
});
|
|
684
691
|
};
|
|
685
|
-
}),
|
|
692
|
+
}), Rn = /* @__PURE__ */ a("$ZodCheckMinLength", (e, n) => {
|
|
686
693
|
var t;
|
|
687
694
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
688
695
|
const o = r.value;
|
|
@@ -705,7 +712,7 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
705
712
|
continue: !n.abort
|
|
706
713
|
});
|
|
707
714
|
};
|
|
708
|
-
}),
|
|
715
|
+
}), Dn = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, n) => {
|
|
709
716
|
var t;
|
|
710
717
|
k.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
|
|
711
718
|
const o = r.value;
|
|
@@ -728,12 +735,12 @@ const ne = (e) => (n, t, r, o) => {
|
|
|
728
735
|
continue: !n.abort
|
|
729
736
|
});
|
|
730
737
|
};
|
|
731
|
-
}),
|
|
738
|
+
}), Cn = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, n) => {
|
|
732
739
|
k.init(e, n), e._zod.check = (t) => {
|
|
733
740
|
t.value = n.tx(t.value);
|
|
734
741
|
};
|
|
735
742
|
});
|
|
736
|
-
class
|
|
743
|
+
class Mn {
|
|
737
744
|
constructor(n = []) {
|
|
738
745
|
this.content = [], this.indent = 0, this && (this.args = n);
|
|
739
746
|
}
|
|
@@ -756,13 +763,13 @@ class Cn {
|
|
|
756
763
|
`));
|
|
757
764
|
}
|
|
758
765
|
}
|
|
759
|
-
const
|
|
766
|
+
const Un = {
|
|
760
767
|
major: 4,
|
|
761
768
|
minor: 1,
|
|
762
|
-
patch:
|
|
763
|
-
},
|
|
769
|
+
patch: 13
|
|
770
|
+
}, _ = /* @__PURE__ */ a("$ZodType", (e, n) => {
|
|
764
771
|
var t;
|
|
765
|
-
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version =
|
|
772
|
+
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Un;
|
|
766
773
|
const r = [...e._zod.def.checks ?? []];
|
|
767
774
|
e._zod.traits.has("$ZodCheck") && r.unshift(e);
|
|
768
775
|
for (const o of r)
|
|
@@ -775,23 +782,23 @@ const Mn = {
|
|
|
775
782
|
else {
|
|
776
783
|
const o = (s, i, c) => {
|
|
777
784
|
let l = N(s), f;
|
|
778
|
-
for (const
|
|
779
|
-
if (
|
|
780
|
-
if (!
|
|
785
|
+
for (const m of i) {
|
|
786
|
+
if (m._zod.def.when) {
|
|
787
|
+
if (!m._zod.def.when(s))
|
|
781
788
|
continue;
|
|
782
789
|
} else if (l)
|
|
783
790
|
continue;
|
|
784
|
-
const
|
|
785
|
-
if (
|
|
791
|
+
const d = s.issues.length, g = m._zod.check(s);
|
|
792
|
+
if (g instanceof Promise && c?.async === !1)
|
|
786
793
|
throw new j();
|
|
787
|
-
if (f ||
|
|
794
|
+
if (f || g instanceof Promise)
|
|
788
795
|
f = (f ?? Promise.resolve()).then(async () => {
|
|
789
|
-
await
|
|
796
|
+
await g, s.issues.length !== d && (l || (l = N(s, d)));
|
|
790
797
|
});
|
|
791
798
|
else {
|
|
792
|
-
if (s.issues.length ===
|
|
799
|
+
if (s.issues.length === d)
|
|
793
800
|
continue;
|
|
794
|
-
l || (l = N(s,
|
|
801
|
+
l || (l = N(s, d));
|
|
795
802
|
}
|
|
796
803
|
}
|
|
797
804
|
return f ? f.then(() => s) : s;
|
|
@@ -825,17 +832,17 @@ const Mn = {
|
|
|
825
832
|
e["~standard"] = {
|
|
826
833
|
validate: (o) => {
|
|
827
834
|
try {
|
|
828
|
-
const u =
|
|
835
|
+
const u = wn(e, o);
|
|
829
836
|
return u.success ? { value: u.data } : { issues: u.error?.issues };
|
|
830
837
|
} catch {
|
|
831
|
-
return
|
|
838
|
+
return yn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
|
|
832
839
|
}
|
|
833
840
|
},
|
|
834
841
|
vendor: "zod",
|
|
835
842
|
version: 1
|
|
836
843
|
};
|
|
837
|
-
}),
|
|
838
|
-
|
|
844
|
+
}), De = /* @__PURE__ */ a("$ZodNumber", (e, n) => {
|
|
845
|
+
_.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? jn, e._zod.parse = (t, r) => {
|
|
839
846
|
if (n.coerce)
|
|
840
847
|
try {
|
|
841
848
|
t.value = Number(t.value);
|
|
@@ -853,12 +860,12 @@ const Mn = {
|
|
|
853
860
|
...u ? { received: u } : {}
|
|
854
861
|
}), t;
|
|
855
862
|
};
|
|
856
|
-
}),
|
|
857
|
-
|
|
858
|
-
}),
|
|
859
|
-
|
|
860
|
-
}),
|
|
861
|
-
|
|
863
|
+
}), Fn = /* @__PURE__ */ a("$ZodNumberFormat", (e, n) => {
|
|
864
|
+
Sn.init(e, n), De.init(e, n);
|
|
865
|
+
}), Vn = /* @__PURE__ */ a("$ZodUnknown", (e, n) => {
|
|
866
|
+
_.init(e, n), e._zod.parse = (t) => t;
|
|
867
|
+
}), Ln = /* @__PURE__ */ a("$ZodNever", (e, n) => {
|
|
868
|
+
_.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
|
|
862
869
|
expected: "never",
|
|
863
870
|
code: "invalid_type",
|
|
864
871
|
input: t.value,
|
|
@@ -868,8 +875,8 @@ const Mn = {
|
|
|
868
875
|
function ie(e, n, t) {
|
|
869
876
|
e.issues.length && n.issues.push(...Ie(t, e.issues)), n.value[t] = e.value;
|
|
870
877
|
}
|
|
871
|
-
const
|
|
872
|
-
|
|
878
|
+
const Gn = /* @__PURE__ */ a("$ZodArray", (e, n) => {
|
|
879
|
+
_.init(e, n), e._zod.parse = (t, r) => {
|
|
873
880
|
const o = t.value;
|
|
874
881
|
if (!Array.isArray(o))
|
|
875
882
|
return t.issues.push({
|
|
@@ -893,12 +900,12 @@ const Ln = /* @__PURE__ */ a("$ZodArray", (e, n) => {
|
|
|
893
900
|
function F(e, n, t, r) {
|
|
894
901
|
e.issues.length && n.issues.push(...Ie(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
|
|
895
902
|
}
|
|
896
|
-
function
|
|
903
|
+
function Ce(e) {
|
|
897
904
|
const n = Object.keys(e.shape);
|
|
898
905
|
for (const r of n)
|
|
899
906
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
900
907
|
throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
|
|
901
|
-
const t =
|
|
908
|
+
const t = ln(e.shape);
|
|
902
909
|
return {
|
|
903
910
|
...e,
|
|
904
911
|
keys: n,
|
|
@@ -907,17 +914,17 @@ function De(e) {
|
|
|
907
914
|
optionalKeys: new Set(t)
|
|
908
915
|
};
|
|
909
916
|
}
|
|
910
|
-
function
|
|
917
|
+
function Me(e, n, t, r, o, u) {
|
|
911
918
|
const s = [], i = o.keySet, c = o.catchall._zod, l = c.def.type;
|
|
912
|
-
for (const f
|
|
919
|
+
for (const f in n) {
|
|
913
920
|
if (i.has(f))
|
|
914
921
|
continue;
|
|
915
922
|
if (l === "never") {
|
|
916
923
|
s.push(f);
|
|
917
924
|
continue;
|
|
918
925
|
}
|
|
919
|
-
const
|
|
920
|
-
|
|
926
|
+
const m = c.run({ value: n[f], issues: [] }, r);
|
|
927
|
+
m instanceof Promise ? e.push(m.then((d) => F(d, t, f, n))) : F(m, t, f, n);
|
|
921
928
|
}
|
|
922
929
|
return s.length && t.issues.push({
|
|
923
930
|
code: "unrecognized_keys",
|
|
@@ -926,8 +933,8 @@ function Ce(e, n, t, r, o, u) {
|
|
|
926
933
|
inst: u
|
|
927
934
|
}), e.length ? Promise.all(e).then(() => t) : t;
|
|
928
935
|
}
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
936
|
+
const Jn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
937
|
+
if (_.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
|
|
931
938
|
const i = n.shape;
|
|
932
939
|
Object.defineProperty(n, "shape", {
|
|
933
940
|
get: () => {
|
|
@@ -938,15 +945,15 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
938
945
|
}
|
|
939
946
|
});
|
|
940
947
|
}
|
|
941
|
-
const r = X(() =>
|
|
942
|
-
|
|
948
|
+
const r = X(() => Ce(n));
|
|
949
|
+
h(e._zod, "propValues", () => {
|
|
943
950
|
const i = n.shape, c = {};
|
|
944
951
|
for (const l in i) {
|
|
945
952
|
const f = i[l]._zod;
|
|
946
953
|
if (f.values) {
|
|
947
954
|
c[l] ?? (c[l] = /* @__PURE__ */ new Set());
|
|
948
|
-
for (const
|
|
949
|
-
c[l].add(
|
|
955
|
+
for (const m of f.values)
|
|
956
|
+
c[l].add(m);
|
|
950
957
|
}
|
|
951
958
|
}
|
|
952
959
|
return c;
|
|
@@ -964,29 +971,29 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
964
971
|
inst: e
|
|
965
972
|
}), i;
|
|
966
973
|
i.value = {};
|
|
967
|
-
const f = [],
|
|
968
|
-
for (const
|
|
969
|
-
const b =
|
|
970
|
-
b instanceof Promise ? f.push(b.then((G) => F(G, i,
|
|
974
|
+
const f = [], m = s.shape;
|
|
975
|
+
for (const d of s.keys) {
|
|
976
|
+
const b = m[d]._zod.run({ value: l[d], issues: [] }, c);
|
|
977
|
+
b instanceof Promise ? f.push(b.then((G) => F(G, i, d, l))) : F(b, i, d, l);
|
|
971
978
|
}
|
|
972
|
-
return u ?
|
|
979
|
+
return u ? Me(f, l, i, c, r.value, e) : f.length ? Promise.all(f).then(() => i) : i;
|
|
973
980
|
};
|
|
974
|
-
}),
|
|
975
|
-
|
|
976
|
-
const t = e._zod.parse, r = X(() =>
|
|
977
|
-
const
|
|
981
|
+
}), Kn = /* @__PURE__ */ a("$ZodObjectJIT", (e, n) => {
|
|
982
|
+
Jn.init(e, n);
|
|
983
|
+
const t = e._zod.parse, r = X(() => Ce(n)), o = (d) => {
|
|
984
|
+
const g = new Mn(["shape", "payload", "ctx"]), b = r.value, G = (E) => {
|
|
978
985
|
const y = se(E);
|
|
979
986
|
return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`;
|
|
980
987
|
};
|
|
981
|
-
|
|
988
|
+
g.write("const input = payload.value;");
|
|
982
989
|
const re = /* @__PURE__ */ Object.create(null);
|
|
983
|
-
let
|
|
990
|
+
let Je = 0;
|
|
984
991
|
for (const E of b.keys)
|
|
985
|
-
re[E] = `key_${
|
|
986
|
-
|
|
992
|
+
re[E] = `key_${Je++}`;
|
|
993
|
+
g.write("const newResult = {};");
|
|
987
994
|
for (const E of b.keys) {
|
|
988
995
|
const y = re[E], A = se(E);
|
|
989
|
-
|
|
996
|
+
g.write(`const ${y} = ${G(E)};`), g.write(`
|
|
990
997
|
if (${y}.issues.length) {
|
|
991
998
|
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
992
999
|
...iss,
|
|
@@ -1005,22 +1012,22 @@ const Gn = /* @__PURE__ */ a("$ZodObject", (e, n) => {
|
|
|
1005
1012
|
|
|
1006
1013
|
`);
|
|
1007
1014
|
}
|
|
1008
|
-
|
|
1009
|
-
const
|
|
1010
|
-
return (E, y) =>
|
|
1015
|
+
g.write("payload.value = newResult;"), g.write("return payload;");
|
|
1016
|
+
const Ke = g.compile();
|
|
1017
|
+
return (E, y) => Ke(d, E, y);
|
|
1011
1018
|
};
|
|
1012
1019
|
let u;
|
|
1013
|
-
const s = U, i = !
|
|
1014
|
-
let
|
|
1015
|
-
e._zod.parse = (
|
|
1016
|
-
|
|
1017
|
-
const b =
|
|
1018
|
-
return s(b) ? i && l &&
|
|
1020
|
+
const s = U, i = !Pe.jitless, l = i && sn.value, f = n.catchall;
|
|
1021
|
+
let m;
|
|
1022
|
+
e._zod.parse = (d, g) => {
|
|
1023
|
+
m ?? (m = r.value);
|
|
1024
|
+
const b = d.value;
|
|
1025
|
+
return s(b) ? i && l && g?.async === !1 && g.jitless !== !0 ? (u || (u = o(n.shape)), d = u(d, g), f ? Me([], b, d, g, m, e) : d) : t(d, g) : (d.issues.push({
|
|
1019
1026
|
expected: "object",
|
|
1020
1027
|
code: "invalid_type",
|
|
1021
1028
|
input: b,
|
|
1022
1029
|
inst: e
|
|
1023
|
-
}),
|
|
1030
|
+
}), d);
|
|
1024
1031
|
};
|
|
1025
1032
|
});
|
|
1026
1033
|
function ce(e, n, t, r) {
|
|
@@ -1035,11 +1042,11 @@ function ce(e, n, t, r) {
|
|
|
1035
1042
|
errors: e.map((u) => u.issues.map((s) => O(s, r, P())))
|
|
1036
1043
|
}), n);
|
|
1037
1044
|
}
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1045
|
+
const Yn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
|
|
1046
|
+
_.init(e, n), h(e._zod, "optin", () => n.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), h(e._zod, "optout", () => n.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), h(e._zod, "values", () => {
|
|
1040
1047
|
if (n.options.every((o) => o._zod.values))
|
|
1041
1048
|
return new Set(n.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1042
|
-
}),
|
|
1049
|
+
}), h(e._zod, "pattern", () => {
|
|
1043
1050
|
if (n.options.every((o) => o._zod.pattern)) {
|
|
1044
1051
|
const o = n.options.map((u) => u._zod.pattern);
|
|
1045
1052
|
return new RegExp(`^(${o.map((u) => Q(u.source)).join("|")})$`);
|
|
@@ -1066,8 +1073,8 @@ const Kn = /* @__PURE__ */ a("$ZodUnion", (e, n) => {
|
|
|
1066
1073
|
}
|
|
1067
1074
|
return s ? Promise.all(i).then((c) => ce(c, o, e, u)) : ce(i, o, e, u);
|
|
1068
1075
|
};
|
|
1069
|
-
}),
|
|
1070
|
-
|
|
1076
|
+
}), Hn = /* @__PURE__ */ a("$ZodIntersection", (e, n) => {
|
|
1077
|
+
_.init(e, n), e._zod.parse = (t, r) => {
|
|
1071
1078
|
const o = t.value, u = n.left._zod.run({ value: o, issues: [] }, r), s = n.right._zod.run({ value: o, issues: [] }, r);
|
|
1072
1079
|
return u instanceof Promise || s instanceof Promise ? Promise.all([u, s]).then(([c, l]) => ae(t, c, l)) : ae(t, u, s);
|
|
1073
1080
|
};
|
|
@@ -1115,10 +1122,10 @@ function ae(e, n, t) {
|
|
|
1115
1122
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
1116
1123
|
return e.value = r.data, e;
|
|
1117
1124
|
}
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
const t =
|
|
1121
|
-
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) =>
|
|
1125
|
+
const qn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
1126
|
+
_.init(e, n);
|
|
1127
|
+
const t = on(n.entries), r = new Set(t);
|
|
1128
|
+
e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((o) => cn.has(typeof o)).map((o) => typeof o == "string" ? an(o) : o.toString()).join("|")})$`), e._zod.parse = (o, u) => {
|
|
1122
1129
|
const s = o.value;
|
|
1123
1130
|
return r.has(s) || o.issues.push({
|
|
1124
1131
|
code: "invalid_value",
|
|
@@ -1127,10 +1134,10 @@ const Hn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
|
1127
1134
|
inst: e
|
|
1128
1135
|
}), o;
|
|
1129
1136
|
};
|
|
1130
|
-
}),
|
|
1131
|
-
|
|
1137
|
+
}), Bn = /* @__PURE__ */ a("$ZodTransform", (e, n) => {
|
|
1138
|
+
_.init(e, n), e._zod.parse = (t, r) => {
|
|
1132
1139
|
if (r.direction === "backward")
|
|
1133
|
-
throw new
|
|
1140
|
+
throw new Ze(e.constructor.name);
|
|
1134
1141
|
const o = n.transform(t.value, t);
|
|
1135
1142
|
if (r.async)
|
|
1136
1143
|
return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (t.value = s, t));
|
|
@@ -1142,8 +1149,8 @@ const Hn = /* @__PURE__ */ a("$ZodEnum", (e, n) => {
|
|
|
1142
1149
|
function le(e, n) {
|
|
1143
1150
|
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
1144
1151
|
}
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1152
|
+
const Xn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
1153
|
+
_.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", h(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), h(e._zod, "pattern", () => {
|
|
1147
1154
|
const t = n.innerType._zod.pattern;
|
|
1148
1155
|
return t ? new RegExp(`^(${Q(t.source)})?$`) : void 0;
|
|
1149
1156
|
}), e._zod.parse = (t, r) => {
|
|
@@ -1153,13 +1160,13 @@ const Bn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
|
1153
1160
|
}
|
|
1154
1161
|
return t.value === void 0 ? t : n.innerType._zod.run(t, r);
|
|
1155
1162
|
};
|
|
1156
|
-
}),
|
|
1157
|
-
|
|
1163
|
+
}), Wn = /* @__PURE__ */ a("$ZodNullable", (e, n) => {
|
|
1164
|
+
_.init(e, n), h(e._zod, "optin", () => n.innerType._zod.optin), h(e._zod, "optout", () => n.innerType._zod.optout), h(e._zod, "pattern", () => {
|
|
1158
1165
|
const t = n.innerType._zod.pattern;
|
|
1159
1166
|
return t ? new RegExp(`^(${Q(t.source)}|null)$`) : void 0;
|
|
1160
|
-
}),
|
|
1161
|
-
}),
|
|
1162
|
-
|
|
1167
|
+
}), h(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
|
|
1168
|
+
}), Qn = /* @__PURE__ */ a("$ZodDefault", (e, n) => {
|
|
1169
|
+
_.init(e, n), e._zod.optin = "optional", h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1163
1170
|
if (r.direction === "backward")
|
|
1164
1171
|
return n.innerType._zod.run(t, r);
|
|
1165
1172
|
if (t.value === void 0)
|
|
@@ -1171,10 +1178,10 @@ const Bn = /* @__PURE__ */ a("$ZodOptional", (e, n) => {
|
|
|
1171
1178
|
function fe(e, n) {
|
|
1172
1179
|
return e.value === void 0 && (e.value = n.defaultValue), e;
|
|
1173
1180
|
}
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1176
|
-
}),
|
|
1177
|
-
|
|
1181
|
+
const et = /* @__PURE__ */ a("$ZodPrefault", (e, n) => {
|
|
1182
|
+
_.init(e, n), e._zod.optin = "optional", h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
|
|
1183
|
+
}), nt = /* @__PURE__ */ a("$ZodNonOptional", (e, n) => {
|
|
1184
|
+
_.init(e, n), h(e._zod, "values", () => {
|
|
1178
1185
|
const t = n.innerType._zod.values;
|
|
1179
1186
|
return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
|
|
1180
1187
|
}), e._zod.parse = (t, r) => {
|
|
@@ -1190,8 +1197,8 @@ function de(e, n) {
|
|
|
1190
1197
|
inst: n
|
|
1191
1198
|
}), e;
|
|
1192
1199
|
}
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1200
|
+
const tt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
1201
|
+
_.init(e, n), h(e._zod, "optin", () => n.innerType._zod.optin), h(e._zod, "optout", () => n.innerType._zod.optout), h(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
|
|
1195
1202
|
if (r.direction === "backward")
|
|
1196
1203
|
return n.innerType._zod.run(t, r);
|
|
1197
1204
|
const o = n.innerType._zod.run(t, r);
|
|
@@ -1209,8 +1216,8 @@ const nt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
|
1209
1216
|
input: t.value
|
|
1210
1217
|
}), t.issues = []), t);
|
|
1211
1218
|
};
|
|
1212
|
-
}),
|
|
1213
|
-
|
|
1219
|
+
}), rt = /* @__PURE__ */ a("$ZodPipe", (e, n) => {
|
|
1220
|
+
_.init(e, n), h(e._zod, "values", () => n.in._zod.values), h(e._zod, "optin", () => n.in._zod.optin), h(e._zod, "optout", () => n.out._zod.optout), h(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
|
|
1214
1221
|
if (r.direction === "backward") {
|
|
1215
1222
|
const u = n.out._zod.run(t, r);
|
|
1216
1223
|
return u instanceof Promise ? u.then((s) => C(s, n.in, r)) : C(u, n.in, r);
|
|
@@ -1222,8 +1229,8 @@ const nt = /* @__PURE__ */ a("$ZodCatch", (e, n) => {
|
|
|
1222
1229
|
function C(e, n, t) {
|
|
1223
1230
|
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1224
1231
|
}
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1232
|
+
const ot = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
|
|
1233
|
+
_.init(e, n), h(e._zod, "propValues", () => n.innerType._zod.propValues), h(e._zod, "values", () => n.innerType._zod.values), h(e._zod, "optin", () => n.innerType?._zod?.optin), h(e._zod, "optout", () => n.innerType?._zod?.optout), e._zod.parse = (t, r) => {
|
|
1227
1234
|
if (r.direction === "backward")
|
|
1228
1235
|
return n.innerType._zod.run(t, r);
|
|
1229
1236
|
const o = n.innerType._zod.run(t, r);
|
|
@@ -1233,8 +1240,8 @@ const rt = /* @__PURE__ */ a("$ZodReadonly", (e, n) => {
|
|
|
1233
1240
|
function he(e) {
|
|
1234
1241
|
return e.value = Object.freeze(e.value), e;
|
|
1235
1242
|
}
|
|
1236
|
-
const
|
|
1237
|
-
k.init(e, n),
|
|
1243
|
+
const ut = /* @__PURE__ */ a("$ZodCustom", (e, n) => {
|
|
1244
|
+
k.init(e, n), _.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
|
|
1238
1245
|
const r = t.value, o = n.fn(r);
|
|
1239
1246
|
if (o instanceof Promise)
|
|
1240
1247
|
return o.then((u) => pe(u, t, r, e));
|
|
@@ -1256,7 +1263,8 @@ function pe(e, n, t, r) {
|
|
|
1256
1263
|
r._zod.def.params && (o.params = r._zod.def.params), n.issues.push(R(o));
|
|
1257
1264
|
}
|
|
1258
1265
|
}
|
|
1259
|
-
|
|
1266
|
+
var me;
|
|
1267
|
+
class st {
|
|
1260
1268
|
constructor() {
|
|
1261
1269
|
this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
|
|
1262
1270
|
}
|
|
@@ -1290,18 +1298,19 @@ class ut {
|
|
|
1290
1298
|
return this._map.has(n);
|
|
1291
1299
|
}
|
|
1292
1300
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return new
|
|
1301
|
+
function it() {
|
|
1302
|
+
return new st();
|
|
1295
1303
|
}
|
|
1296
|
-
|
|
1297
|
-
|
|
1304
|
+
(me = globalThis).__zod_globalRegistry ?? (me.__zod_globalRegistry = it());
|
|
1305
|
+
const M = globalThis.__zod_globalRegistry;
|
|
1306
|
+
function ct(e, n) {
|
|
1298
1307
|
return new e({
|
|
1299
1308
|
type: "number",
|
|
1300
1309
|
checks: [],
|
|
1301
1310
|
...p(n)
|
|
1302
1311
|
});
|
|
1303
1312
|
}
|
|
1304
|
-
function
|
|
1313
|
+
function at(e, n) {
|
|
1305
1314
|
return new e({
|
|
1306
1315
|
type: "number",
|
|
1307
1316
|
check: "number_format",
|
|
@@ -1310,19 +1319,19 @@ function ct(e, n) {
|
|
|
1310
1319
|
...p(n)
|
|
1311
1320
|
});
|
|
1312
1321
|
}
|
|
1313
|
-
function
|
|
1322
|
+
function lt(e) {
|
|
1314
1323
|
return new e({
|
|
1315
1324
|
type: "unknown"
|
|
1316
1325
|
});
|
|
1317
1326
|
}
|
|
1318
|
-
function
|
|
1327
|
+
function ft(e, n) {
|
|
1319
1328
|
return new e({
|
|
1320
1329
|
type: "never",
|
|
1321
1330
|
...p(n)
|
|
1322
1331
|
});
|
|
1323
1332
|
}
|
|
1324
|
-
function
|
|
1325
|
-
return new
|
|
1333
|
+
function _e(e, n) {
|
|
1334
|
+
return new xe({
|
|
1326
1335
|
check: "less_than",
|
|
1327
1336
|
...p(n),
|
|
1328
1337
|
value: e,
|
|
@@ -1330,15 +1339,15 @@ function me(e, n) {
|
|
|
1330
1339
|
});
|
|
1331
1340
|
}
|
|
1332
1341
|
function K(e, n) {
|
|
1333
|
-
return new
|
|
1342
|
+
return new xe({
|
|
1334
1343
|
check: "less_than",
|
|
1335
1344
|
...p(n),
|
|
1336
1345
|
value: e,
|
|
1337
1346
|
inclusive: !0
|
|
1338
1347
|
});
|
|
1339
1348
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return new
|
|
1349
|
+
function ge(e, n) {
|
|
1350
|
+
return new Re({
|
|
1342
1351
|
check: "greater_than",
|
|
1343
1352
|
...p(n),
|
|
1344
1353
|
value: e,
|
|
@@ -1346,48 +1355,48 @@ function _e(e, n) {
|
|
|
1346
1355
|
});
|
|
1347
1356
|
}
|
|
1348
1357
|
function Y(e, n) {
|
|
1349
|
-
return new
|
|
1358
|
+
return new Re({
|
|
1350
1359
|
check: "greater_than",
|
|
1351
1360
|
...p(n),
|
|
1352
1361
|
value: e,
|
|
1353
1362
|
inclusive: !0
|
|
1354
1363
|
});
|
|
1355
1364
|
}
|
|
1356
|
-
function
|
|
1357
|
-
return new
|
|
1365
|
+
function ve(e, n) {
|
|
1366
|
+
return new An({
|
|
1358
1367
|
check: "multiple_of",
|
|
1359
1368
|
...p(n),
|
|
1360
1369
|
value: e
|
|
1361
1370
|
});
|
|
1362
1371
|
}
|
|
1363
|
-
function
|
|
1364
|
-
return new
|
|
1372
|
+
function dt(e, n) {
|
|
1373
|
+
return new xn({
|
|
1365
1374
|
check: "max_length",
|
|
1366
1375
|
...p(n),
|
|
1367
1376
|
maximum: e
|
|
1368
1377
|
});
|
|
1369
1378
|
}
|
|
1370
|
-
function
|
|
1371
|
-
return new
|
|
1379
|
+
function ze(e, n) {
|
|
1380
|
+
return new Rn({
|
|
1372
1381
|
check: "min_length",
|
|
1373
1382
|
...p(n),
|
|
1374
1383
|
minimum: e
|
|
1375
1384
|
});
|
|
1376
1385
|
}
|
|
1377
|
-
function
|
|
1378
|
-
return new
|
|
1386
|
+
function ht(e, n) {
|
|
1387
|
+
return new Dn({
|
|
1379
1388
|
check: "length_equals",
|
|
1380
1389
|
...p(n),
|
|
1381
1390
|
length: e
|
|
1382
1391
|
});
|
|
1383
1392
|
}
|
|
1384
|
-
function
|
|
1385
|
-
return new
|
|
1393
|
+
function pt(e) {
|
|
1394
|
+
return new Cn({
|
|
1386
1395
|
check: "overwrite",
|
|
1387
1396
|
tx: e
|
|
1388
1397
|
});
|
|
1389
1398
|
}
|
|
1390
|
-
function
|
|
1399
|
+
function mt(e, n, t) {
|
|
1391
1400
|
return new e({
|
|
1392
1401
|
type: "array",
|
|
1393
1402
|
element: n,
|
|
@@ -1397,7 +1406,7 @@ function pt(e, n, t) {
|
|
|
1397
1406
|
...p(t)
|
|
1398
1407
|
});
|
|
1399
1408
|
}
|
|
1400
|
-
function
|
|
1409
|
+
function _t(e, n, t) {
|
|
1401
1410
|
return new e({
|
|
1402
1411
|
type: "custom",
|
|
1403
1412
|
check: "custom",
|
|
@@ -1405,8 +1414,8 @@ function mt(e, n, t) {
|
|
|
1405
1414
|
...p(t)
|
|
1406
1415
|
});
|
|
1407
1416
|
}
|
|
1408
|
-
function
|
|
1409
|
-
const n =
|
|
1417
|
+
function gt(e) {
|
|
1418
|
+
const n = vt((t) => (t.addIssue = (r) => {
|
|
1410
1419
|
if (typeof r == "string")
|
|
1411
1420
|
t.issues.push(R(r, t.value, n._zod.def));
|
|
1412
1421
|
else {
|
|
@@ -1416,21 +1425,21 @@ function _t(e) {
|
|
|
1416
1425
|
}, e(t.value, t)));
|
|
1417
1426
|
return n;
|
|
1418
1427
|
}
|
|
1419
|
-
function
|
|
1428
|
+
function vt(e, n) {
|
|
1420
1429
|
const t = new k({
|
|
1421
1430
|
check: "custom",
|
|
1422
1431
|
...p(n)
|
|
1423
1432
|
});
|
|
1424
1433
|
return t._zod.check = e, t;
|
|
1425
1434
|
}
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1435
|
+
const zt = (e, n) => {
|
|
1436
|
+
je.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
|
|
1428
1437
|
format: {
|
|
1429
|
-
value: (t) =>
|
|
1438
|
+
value: (t) => bn(e, t)
|
|
1430
1439
|
// enumerable: false,
|
|
1431
1440
|
},
|
|
1432
1441
|
flatten: {
|
|
1433
|
-
value: (t) =>
|
|
1442
|
+
value: (t) => zn(e, t)
|
|
1434
1443
|
// enumerable: false,
|
|
1435
1444
|
},
|
|
1436
1445
|
addIssue: {
|
|
@@ -1452,14 +1461,14 @@ const vt = (e, n) => {
|
|
|
1452
1461
|
// enumerable: false,
|
|
1453
1462
|
}
|
|
1454
1463
|
});
|
|
1455
|
-
}, w = a("ZodError",
|
|
1464
|
+
}, w = a("ZodError", zt, {
|
|
1456
1465
|
Parent: Error
|
|
1457
|
-
}),
|
|
1466
|
+
}), bt = /* @__PURE__ */ ne(w), wt = /* @__PURE__ */ te(w), yt = /* @__PURE__ */ V(w), kt = /* @__PURE__ */ L(w), Et = /* @__PURE__ */ kn(w), $t = /* @__PURE__ */ En(w), Zt = /* @__PURE__ */ $n(w), Pt = /* @__PURE__ */ Zn(w), Ot = /* @__PURE__ */ Pn(w), Tt = /* @__PURE__ */ On(w), It = /* @__PURE__ */ Tn(w), Nt = /* @__PURE__ */ In(w), v = /* @__PURE__ */ a("ZodType", (e, n) => (_.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(I(n, {
|
|
1458
1467
|
checks: [
|
|
1459
1468
|
...n.checks ?? [],
|
|
1460
1469
|
...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
1461
1470
|
]
|
|
1462
|
-
})), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) =>
|
|
1471
|
+
})), e.clone = (t, r) => $(e, t, r), e.brand = () => e, e.register = ((t, r) => (t.add(e, r), e)), e.parse = (t, r) => bt(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => yt(e, t, r), e.parseAsync = async (t, r) => wt(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => kt(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => Et(e, t, r), e.decode = (t, r) => $t(e, t, r), e.encodeAsync = async (t, r) => Zt(e, t, r), e.decodeAsync = async (t, r) => Pt(e, t, r), e.safeEncode = (t, r) => Ot(e, t, r), e.safeDecode = (t, r) => Tt(e, t, r), e.safeEncodeAsync = async (t, r) => It(e, t, r), e.safeDecodeAsync = async (t, r) => Nt(e, t, r), e.refine = (t, r) => e.check(rr(t, r)), e.superRefine = (t) => e.check(or(t)), e.overwrite = (t) => e.check(pt(t)), e.optional = () => ye(e), e.nullable = () => ke(e), e.nullish = () => ye(ke(e)), e.nonoptional = (t) => Bt(e, t), e.array = () => Fe(e), e.or = (t) => Mt([e, t]), e.and = (t) => Ft(e, t), e.transform = (t) => Ee(e, Gt(t)), e.default = (t) => Yt(e, t), e.prefault = (t) => qt(e, t), e.catch = (t) => Wt(e, t), e.pipe = (t) => Ee(e, t), e.readonly = () => nr(e), e.describe = (t) => {
|
|
1463
1472
|
const r = e.clone();
|
|
1464
1473
|
return M.add(r, { description: t }), r;
|
|
1465
1474
|
}, Object.defineProperty(e, "description", {
|
|
@@ -1472,71 +1481,71 @@ const vt = (e, n) => {
|
|
|
1472
1481
|
return M.get(e);
|
|
1473
1482
|
const r = e.clone();
|
|
1474
1483
|
return M.add(r, t[0]), r;
|
|
1475
|
-
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)),
|
|
1476
|
-
|
|
1484
|
+
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ue = /* @__PURE__ */ a("ZodNumber", (e, n) => {
|
|
1485
|
+
De.init(e, n), v.init(e, n), e.gt = (r, o) => e.check(ge(r, o)), e.gte = (r, o) => e.check(Y(r, o)), e.min = (r, o) => e.check(Y(r, o)), e.lt = (r, o) => e.check(_e(r, o)), e.lte = (r, o) => e.check(K(r, o)), e.max = (r, o) => e.check(K(r, o)), e.int = (r) => e.check(be(r)), e.safe = (r) => e.check(be(r)), e.positive = (r) => e.check(ge(0, r)), e.nonnegative = (r) => e.check(Y(0, r)), e.negative = (r) => e.check(_e(0, r)), e.nonpositive = (r) => e.check(K(0, r)), e.multipleOf = (r, o) => e.check(ve(r, o)), e.step = (r, o) => e.check(ve(r, o)), e.finite = () => e;
|
|
1477
1486
|
const t = e._zod.bag;
|
|
1478
1487
|
e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
|
|
1479
1488
|
});
|
|
1480
1489
|
function Z(e) {
|
|
1481
|
-
return
|
|
1490
|
+
return ct(Ue, e);
|
|
1482
1491
|
}
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1492
|
+
const jt = /* @__PURE__ */ a("ZodNumberFormat", (e, n) => {
|
|
1493
|
+
Fn.init(e, n), Ue.init(e, n);
|
|
1485
1494
|
});
|
|
1486
|
-
function
|
|
1487
|
-
return
|
|
1495
|
+
function be(e) {
|
|
1496
|
+
return at(jt, e);
|
|
1488
1497
|
}
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1498
|
+
const At = /* @__PURE__ */ a("ZodUnknown", (e, n) => {
|
|
1499
|
+
Vn.init(e, n), v.init(e, n);
|
|
1491
1500
|
});
|
|
1492
|
-
function
|
|
1493
|
-
return
|
|
1501
|
+
function we() {
|
|
1502
|
+
return lt(At);
|
|
1494
1503
|
}
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1504
|
+
const St = /* @__PURE__ */ a("ZodNever", (e, n) => {
|
|
1505
|
+
Ln.init(e, n), v.init(e, n);
|
|
1497
1506
|
});
|
|
1498
|
-
function
|
|
1499
|
-
return
|
|
1507
|
+
function xt(e) {
|
|
1508
|
+
return ft(St, e);
|
|
1500
1509
|
}
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1510
|
+
const Rt = /* @__PURE__ */ a("ZodArray", (e, n) => {
|
|
1511
|
+
Gn.init(e, n), v.init(e, n), e.element = n.element, e.min = (t, r) => e.check(ze(t, r)), e.nonempty = (t) => e.check(ze(1, t)), e.max = (t, r) => e.check(dt(t, r)), e.length = (t, r) => e.check(ht(t, r)), e.unwrap = () => e.element;
|
|
1503
1512
|
});
|
|
1504
|
-
function
|
|
1505
|
-
return
|
|
1513
|
+
function Fe(e, n) {
|
|
1514
|
+
return mt(Rt, e, n);
|
|
1506
1515
|
}
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1516
|
+
const Dt = /* @__PURE__ */ a("ZodObject", (e, n) => {
|
|
1517
|
+
Kn.init(e, n), v.init(e, n), h(e, "shape", () => n.shape), e.keyof = () => Vt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: we() }), e.loose = () => e.clone({ ...e._zod.def, catchall: we() }), e.strict = () => e.clone({ ...e._zod.def, catchall: xt() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => pn(e, t), e.safeExtend = (t) => mn(e, t), e.merge = (t) => _n(e, t), e.pick = (t) => dn(e, t), e.omit = (t) => hn(e, t), e.partial = (...t) => gn(Le, e, t[0]), e.required = (...t) => vn(Ge, e, t[0]);
|
|
1509
1518
|
});
|
|
1510
|
-
function
|
|
1519
|
+
function Ve(e, n) {
|
|
1511
1520
|
const t = {
|
|
1512
1521
|
type: "object",
|
|
1513
1522
|
shape: e ?? {},
|
|
1514
1523
|
...p(n)
|
|
1515
1524
|
};
|
|
1516
|
-
return new
|
|
1525
|
+
return new Dt(t);
|
|
1517
1526
|
}
|
|
1518
|
-
const
|
|
1519
|
-
|
|
1527
|
+
const Ct = /* @__PURE__ */ a("ZodUnion", (e, n) => {
|
|
1528
|
+
Yn.init(e, n), v.init(e, n), e.options = n.options;
|
|
1520
1529
|
});
|
|
1521
|
-
function
|
|
1522
|
-
return new
|
|
1530
|
+
function Mt(e, n) {
|
|
1531
|
+
return new Ct({
|
|
1523
1532
|
type: "union",
|
|
1524
1533
|
options: e,
|
|
1525
1534
|
...p(n)
|
|
1526
1535
|
});
|
|
1527
1536
|
}
|
|
1528
|
-
const
|
|
1529
|
-
|
|
1537
|
+
const Ut = /* @__PURE__ */ a("ZodIntersection", (e, n) => {
|
|
1538
|
+
Hn.init(e, n), v.init(e, n);
|
|
1530
1539
|
});
|
|
1531
|
-
function
|
|
1532
|
-
return new
|
|
1540
|
+
function Ft(e, n) {
|
|
1541
|
+
return new Ut({
|
|
1533
1542
|
type: "intersection",
|
|
1534
1543
|
left: e,
|
|
1535
1544
|
right: n
|
|
1536
1545
|
});
|
|
1537
1546
|
}
|
|
1538
1547
|
const B = /* @__PURE__ */ a("ZodEnum", (e, n) => {
|
|
1539
|
-
|
|
1548
|
+
qn.init(e, n), v.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
|
|
1540
1549
|
const t = new Set(Object.keys(n.entries));
|
|
1541
1550
|
e.extract = (r, o) => {
|
|
1542
1551
|
const u = {};
|
|
@@ -1566,7 +1575,7 @@ const B = /* @__PURE__ */ a("ZodEnum", (e, n) => {
|
|
|
1566
1575
|
});
|
|
1567
1576
|
};
|
|
1568
1577
|
});
|
|
1569
|
-
function
|
|
1578
|
+
function Vt(e, n) {
|
|
1570
1579
|
const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
1571
1580
|
return new B({
|
|
1572
1581
|
type: "enum",
|
|
@@ -1574,10 +1583,10 @@ function Ft(e, n) {
|
|
|
1574
1583
|
...p(n)
|
|
1575
1584
|
});
|
|
1576
1585
|
}
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1586
|
+
const Lt = /* @__PURE__ */ a("ZodTransform", (e, n) => {
|
|
1587
|
+
Bn.init(e, n), v.init(e, n), e._zod.parse = (t, r) => {
|
|
1579
1588
|
if (r.direction === "backward")
|
|
1580
|
-
throw new
|
|
1589
|
+
throw new Ze(e.constructor.name);
|
|
1581
1590
|
t.addIssue = (u) => {
|
|
1582
1591
|
if (typeof u == "string")
|
|
1583
1592
|
t.issues.push(R(u, t.value, n));
|
|
@@ -1590,128 +1599,128 @@ const Vt = /* @__PURE__ */ a("ZodTransform", (e, n) => {
|
|
|
1590
1599
|
return o instanceof Promise ? o.then((u) => (t.value = u, t)) : (t.value = o, t);
|
|
1591
1600
|
};
|
|
1592
1601
|
});
|
|
1593
|
-
function
|
|
1594
|
-
return new
|
|
1602
|
+
function Gt(e) {
|
|
1603
|
+
return new Lt({
|
|
1595
1604
|
type: "transform",
|
|
1596
1605
|
transform: e
|
|
1597
1606
|
});
|
|
1598
1607
|
}
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1608
|
+
const Le = /* @__PURE__ */ a("ZodOptional", (e, n) => {
|
|
1609
|
+
Xn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1601
1610
|
});
|
|
1602
|
-
function
|
|
1603
|
-
return new
|
|
1611
|
+
function ye(e) {
|
|
1612
|
+
return new Le({
|
|
1604
1613
|
type: "optional",
|
|
1605
1614
|
innerType: e
|
|
1606
1615
|
});
|
|
1607
1616
|
}
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1617
|
+
const Jt = /* @__PURE__ */ a("ZodNullable", (e, n) => {
|
|
1618
|
+
Wn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1610
1619
|
});
|
|
1611
|
-
function
|
|
1612
|
-
return new
|
|
1620
|
+
function ke(e) {
|
|
1621
|
+
return new Jt({
|
|
1613
1622
|
type: "nullable",
|
|
1614
1623
|
innerType: e
|
|
1615
1624
|
});
|
|
1616
1625
|
}
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1626
|
+
const Kt = /* @__PURE__ */ a("ZodDefault", (e, n) => {
|
|
1627
|
+
Qn.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
1619
1628
|
});
|
|
1620
|
-
function
|
|
1621
|
-
return new
|
|
1629
|
+
function Yt(e, n) {
|
|
1630
|
+
return new Kt({
|
|
1622
1631
|
type: "default",
|
|
1623
1632
|
innerType: e,
|
|
1624
1633
|
get defaultValue() {
|
|
1625
|
-
return typeof n == "function" ? n() :
|
|
1634
|
+
return typeof n == "function" ? n() : Te(n);
|
|
1626
1635
|
}
|
|
1627
1636
|
});
|
|
1628
1637
|
}
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1638
|
+
const Ht = /* @__PURE__ */ a("ZodPrefault", (e, n) => {
|
|
1639
|
+
et.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1631
1640
|
});
|
|
1632
|
-
function
|
|
1633
|
-
return new
|
|
1641
|
+
function qt(e, n) {
|
|
1642
|
+
return new Ht({
|
|
1634
1643
|
type: "prefault",
|
|
1635
1644
|
innerType: e,
|
|
1636
1645
|
get defaultValue() {
|
|
1637
|
-
return typeof n == "function" ? n() :
|
|
1646
|
+
return typeof n == "function" ? n() : Te(n);
|
|
1638
1647
|
}
|
|
1639
1648
|
});
|
|
1640
1649
|
}
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1650
|
+
const Ge = /* @__PURE__ */ a("ZodNonOptional", (e, n) => {
|
|
1651
|
+
nt.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1643
1652
|
});
|
|
1644
|
-
function
|
|
1645
|
-
return new
|
|
1653
|
+
function Bt(e, n) {
|
|
1654
|
+
return new Ge({
|
|
1646
1655
|
type: "nonoptional",
|
|
1647
1656
|
innerType: e,
|
|
1648
1657
|
...p(n)
|
|
1649
1658
|
});
|
|
1650
1659
|
}
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1660
|
+
const Xt = /* @__PURE__ */ a("ZodCatch", (e, n) => {
|
|
1661
|
+
tt.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
1653
1662
|
});
|
|
1654
|
-
function
|
|
1655
|
-
return new
|
|
1663
|
+
function Wt(e, n) {
|
|
1664
|
+
return new Xt({
|
|
1656
1665
|
type: "catch",
|
|
1657
1666
|
innerType: e,
|
|
1658
1667
|
catchValue: typeof n == "function" ? n : () => n
|
|
1659
1668
|
});
|
|
1660
1669
|
}
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1670
|
+
const Qt = /* @__PURE__ */ a("ZodPipe", (e, n) => {
|
|
1671
|
+
rt.init(e, n), v.init(e, n), e.in = n.in, e.out = n.out;
|
|
1663
1672
|
});
|
|
1664
|
-
function
|
|
1665
|
-
return new
|
|
1673
|
+
function Ee(e, n) {
|
|
1674
|
+
return new Qt({
|
|
1666
1675
|
type: "pipe",
|
|
1667
1676
|
in: e,
|
|
1668
1677
|
out: n
|
|
1669
1678
|
// ...util.normalizeParams(params),
|
|
1670
1679
|
});
|
|
1671
1680
|
}
|
|
1672
|
-
const
|
|
1673
|
-
|
|
1681
|
+
const er = /* @__PURE__ */ a("ZodReadonly", (e, n) => {
|
|
1682
|
+
ot.init(e, n), v.init(e, n), e.unwrap = () => e._zod.def.innerType;
|
|
1674
1683
|
});
|
|
1675
|
-
function
|
|
1676
|
-
return new
|
|
1684
|
+
function nr(e) {
|
|
1685
|
+
return new er({
|
|
1677
1686
|
type: "readonly",
|
|
1678
1687
|
innerType: e
|
|
1679
1688
|
});
|
|
1680
1689
|
}
|
|
1681
|
-
const
|
|
1682
|
-
|
|
1690
|
+
const tr = /* @__PURE__ */ a("ZodCustom", (e, n) => {
|
|
1691
|
+
ut.init(e, n), v.init(e, n);
|
|
1683
1692
|
});
|
|
1684
|
-
function
|
|
1685
|
-
return
|
|
1693
|
+
function rr(e, n = {}) {
|
|
1694
|
+
return _t(tr, e, n);
|
|
1686
1695
|
}
|
|
1687
|
-
function
|
|
1688
|
-
return
|
|
1696
|
+
function or(e) {
|
|
1697
|
+
return gt(e);
|
|
1689
1698
|
}
|
|
1690
|
-
const
|
|
1699
|
+
const mr = (e) => Ve({
|
|
1691
1700
|
pages: Z(),
|
|
1692
1701
|
nextPage: Z().optional(),
|
|
1693
1702
|
totalElements: Z(),
|
|
1694
1703
|
currentPage: Z(),
|
|
1695
1704
|
pageSize: Z(),
|
|
1696
|
-
elements:
|
|
1697
|
-
}),
|
|
1705
|
+
elements: Fe(e)
|
|
1706
|
+
}), _r = Ve({
|
|
1698
1707
|
page: Z(),
|
|
1699
1708
|
pageSize: Z()
|
|
1700
1709
|
});
|
|
1701
1710
|
export {
|
|
1702
|
-
|
|
1703
|
-
|
|
1711
|
+
ir as Fail,
|
|
1712
|
+
cr as Failure,
|
|
1704
1713
|
S as Guid,
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1714
|
+
sr as Ok,
|
|
1715
|
+
_r as PageQuery,
|
|
1716
|
+
pr as convertDateInfoToDateRange,
|
|
1717
|
+
mr as createPageSchema,
|
|
1718
|
+
Ye as formatDate,
|
|
1719
|
+
hr as formatDateTime,
|
|
1720
|
+
He as formatTime,
|
|
1721
|
+
lr as isFailure,
|
|
1722
|
+
ur as mock,
|
|
1723
|
+
ar as notFailure,
|
|
1724
|
+
fr as parseConfig,
|
|
1725
|
+
dr as sleep
|
|
1717
1726
|
};
|