react-luminus-components 1.3.34 → 1.3.36

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.
Files changed (36) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +64 -64
  3. package/dist/{FromToDatePickerDropdownToggle-Dk7MFcJp.js → FromToDatePickerDropdownToggle-DrEcMDSn.js} +2445 -2414
  4. package/dist/FromToDatePickerDropdownToggle-U9J8VvT9.cjs +253 -0
  5. package/dist/PrimaryButton-Da4GxIOm.cjs +1 -0
  6. package/dist/{PrimaryButton-Bbl06m-g.js → PrimaryButton-Dqcs3CVC.js} +36 -34
  7. package/dist/{SimpleTooltip-C32Faxrc.js → SimpleTooltip-BAj8LkNU.js} +1 -1
  8. package/dist/{SimpleTooltip-Bz22xxXa.cjs → SimpleTooltip-Dzk5Xqz6.cjs} +1 -1
  9. package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +4 -3
  10. package/dist/contexts.cjs.js +1 -1
  11. package/dist/contexts.es.js +58 -59
  12. package/dist/{dateUtils-Bs39Qj7k.cjs → dateUtils--qPvcQrY.cjs} +1 -1
  13. package/dist/{dateUtils-B9-rf1Eh.js → dateUtils-BBdAuKvy.js} +1 -1
  14. package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +1 -1
  15. package/dist/hooks.cjs.js +1 -1
  16. package/dist/hooks.es.js +2937 -72
  17. package/dist/layout.cjs.js +1 -1
  18. package/dist/layout.es.js +11 -12
  19. package/dist/main.cjs.js +1 -1
  20. package/dist/main.es.js +1408 -1401
  21. package/dist/{searchUtils-CxNriHg_.cjs → searchUtils-BRuoWynE.cjs} +1 -1
  22. package/dist/{searchUtils-BCxOKHVq.js → searchUtils-D44ZkVNs.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useFormControlType-oJGqgThz.js → useFormControlType-BAFqxupC.js} +3 -3
  25. package/dist/{useLocalStorageState-Cs1tOpr1.js → useLocalStorageState-BuXnU9lw.js} +18 -19
  26. package/dist/useLocalStorageState-CBt0FNic.cjs +1 -0
  27. package/dist/usePermissions-BrYbzBzf.cjs +1 -0
  28. package/dist/{usePermissions-CfJgVLTi.js → usePermissions-DF_q-wC1.js} +1 -2
  29. package/dist/utils.cjs.js +1 -1
  30. package/dist/utils.es.js +53 -54
  31. package/dist/variables.scss +171 -171
  32. package/package.json +106 -106
  33. package/dist/FromToDatePickerDropdownToggle-DhzBIJXw.cjs +0 -253
  34. package/dist/PrimaryButton-D33g-RWP.cjs +0 -1
  35. package/dist/useLocalStorageState-3ebV2Hf5.cjs +0 -1
  36. package/dist/usePermissions-BZPN1OT2.cjs +0 -1
package/dist/hooks.es.js CHANGED
@@ -1,93 +1,2958 @@
1
- import { U as q, aD as z, a4 as _ } from "./FromToDatePickerDropdownToggle-Dk7MFcJp.js";
2
- import { aF as U, ae as V, aE as K } from "./FromToDatePickerDropdownToggle-Dk7MFcJp.js";
3
- import { c as Z, b as $, a as H, u as J } from "./useLocalStorageState-Cs1tOpr1.js";
4
- import { useContext as g, useState as I, useEffect as S } from "react";
5
- import { z as s } from "zod";
6
- import { i as j } from "./dateUtils-B9-rf1Eh.js";
1
+ import { U as We, aD as Ye, a5 as Je } from "./FromToDatePickerDropdownToggle-DrEcMDSn.js";
2
+ import { aF as hr, aa as mr, aE as pr } from "./FromToDatePickerDropdownToggle-DrEcMDSn.js";
3
+ import { c as _r, b as vr, a as gr, u as xr } from "./useLocalStorageState-BuXnU9lw.js";
4
+ import { useContext as Ge, useState as He, useEffect as Xe } from "react";
5
+ import { i as Ke } from "./dateUtils-BBdAuKvy.js";
7
6
  import "@azure/msal-browser";
8
7
  import "@azure/msal-react";
9
8
  import "react-router-dom";
10
9
  import "react-hook-form";
11
- import { b as X, u as Y, a as p } from "./useFormControlType-oJGqgThz.js";
12
- import { u as re } from "./usePermissions-CfJgVLTi.js";
13
- const B = () => {
14
- const { texts: { formValidation: n } } = g(q), u = (e) => (e != null && e.useCoerce ? s.coerce : s).string({
15
- invalid_type_error: n.required,
16
- required_error: n.required
17
- }).transform((t) => t ?? null), a = (e) => u(e).nullable().optional().transform((r) => r ?? null), i = (e) => {
18
- const r = (e != null && e.useCoerce ? s.coerce : s).number({
19
- invalid_type_error: n.required,
20
- required_error: n.required
21
- });
22
- return (e == null ? void 0 : e.min) !== void 0 && r.min(e.min), (e == null ? void 0 : e.max) !== void 0 && r.max(e.max), r.transform((t) => t ?? null);
23
- }, c = (e) => i(e).nullable().optional().transform((r) => r ?? null), m = (e) => (e != null && e.useCoerce ? s.coerce : s).boolean({
24
- invalid_type_error: n.required,
25
- required_error: n.required
26
- }).transform((r) => r ?? null), l = (e) => (e != null && e.useCoerce ? s.coerce : s).string({
27
- invalid_type_error: n.required,
28
- required_error: n.required
29
- }).refine(j, { message: n.invalidDate }).transform((t) => t ?? null), h = (e) => l(e).nullable().transform((r) => r ?? null), d = (e, r) => s.enum(e, {
30
- invalid_type_error: n.required,
31
- required_error: n.required
32
- }).transform((f) => f ?? null);
10
+ import { a as br, b as wr, u as Tr } from "./useFormControlType-BAFqxupC.js";
11
+ import { u as Sr } from "./usePermissions-DF_q-wC1.js";
12
+ var x;
13
+ (function(r) {
14
+ r.assertEqual = (s) => s;
15
+ function e(s) {
16
+ }
17
+ r.assertIs = e;
18
+ function t(s) {
19
+ throw new Error();
20
+ }
21
+ r.assertNever = t, r.arrayToEnum = (s) => {
22
+ const a = {};
23
+ for (const i of s)
24
+ a[i] = i;
25
+ return a;
26
+ }, r.getValidEnumValues = (s) => {
27
+ const a = r.objectKeys(s).filter((o) => typeof s[s[o]] != "number"), i = {};
28
+ for (const o of a)
29
+ i[o] = s[o];
30
+ return r.objectValues(i);
31
+ }, r.objectValues = (s) => r.objectKeys(s).map(function(a) {
32
+ return s[a];
33
+ }), r.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
34
+ const a = [];
35
+ for (const i in s)
36
+ Object.prototype.hasOwnProperty.call(s, i) && a.push(i);
37
+ return a;
38
+ }, r.find = (s, a) => {
39
+ for (const i of s)
40
+ if (a(i))
41
+ return i;
42
+ }, r.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && isFinite(s) && Math.floor(s) === s;
43
+ function n(s, a = " | ") {
44
+ return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
45
+ }
46
+ r.joinValues = n, r.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
47
+ })(x || (x = {}));
48
+ var Se;
49
+ (function(r) {
50
+ r.mergeShapes = (e, t) => ({
51
+ ...e,
52
+ ...t
53
+ // second overwrites first
54
+ });
55
+ })(Se || (Se = {}));
56
+ const f = x.arrayToEnum([
57
+ "string",
58
+ "nan",
59
+ "number",
60
+ "integer",
61
+ "float",
62
+ "boolean",
63
+ "date",
64
+ "bigint",
65
+ "symbol",
66
+ "function",
67
+ "undefined",
68
+ "null",
69
+ "array",
70
+ "object",
71
+ "unknown",
72
+ "promise",
73
+ "void",
74
+ "never",
75
+ "map",
76
+ "set"
77
+ ]), P = (r) => {
78
+ switch (typeof r) {
79
+ case "undefined":
80
+ return f.undefined;
81
+ case "string":
82
+ return f.string;
83
+ case "number":
84
+ return isNaN(r) ? f.nan : f.number;
85
+ case "boolean":
86
+ return f.boolean;
87
+ case "function":
88
+ return f.function;
89
+ case "bigint":
90
+ return f.bigint;
91
+ case "symbol":
92
+ return f.symbol;
93
+ case "object":
94
+ return Array.isArray(r) ? f.array : r === null ? f.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? f.promise : typeof Map < "u" && r instanceof Map ? f.map : typeof Set < "u" && r instanceof Set ? f.set : typeof Date < "u" && r instanceof Date ? f.date : f.object;
95
+ default:
96
+ return f.unknown;
97
+ }
98
+ }, d = x.arrayToEnum([
99
+ "invalid_type",
100
+ "invalid_literal",
101
+ "custom",
102
+ "invalid_union",
103
+ "invalid_union_discriminator",
104
+ "invalid_enum_value",
105
+ "unrecognized_keys",
106
+ "invalid_arguments",
107
+ "invalid_return_type",
108
+ "invalid_date",
109
+ "invalid_string",
110
+ "too_small",
111
+ "too_big",
112
+ "invalid_intersection_types",
113
+ "not_multiple_of",
114
+ "not_finite"
115
+ ]), Qe = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
116
+ class N extends Error {
117
+ constructor(e) {
118
+ super(), this.issues = [], this.addIssue = (n) => {
119
+ this.issues = [...this.issues, n];
120
+ }, this.addIssues = (n = []) => {
121
+ this.issues = [...this.issues, ...n];
122
+ };
123
+ const t = new.target.prototype;
124
+ Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
125
+ }
126
+ get errors() {
127
+ return this.issues;
128
+ }
129
+ format(e) {
130
+ const t = e || function(a) {
131
+ return a.message;
132
+ }, n = { _errors: [] }, s = (a) => {
133
+ for (const i of a.issues)
134
+ if (i.code === "invalid_union")
135
+ i.unionErrors.map(s);
136
+ else if (i.code === "invalid_return_type")
137
+ s(i.returnTypeError);
138
+ else if (i.code === "invalid_arguments")
139
+ s(i.argumentsError);
140
+ else if (i.path.length === 0)
141
+ n._errors.push(t(i));
142
+ else {
143
+ let o = n, u = 0;
144
+ for (; u < i.path.length; ) {
145
+ const c = i.path[u];
146
+ u === i.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(t(i))) : o[c] = o[c] || { _errors: [] }, o = o[c], u++;
147
+ }
148
+ }
149
+ };
150
+ return s(this), n;
151
+ }
152
+ static assert(e) {
153
+ if (!(e instanceof N))
154
+ throw new Error(`Not a ZodError: ${e}`);
155
+ }
156
+ toString() {
157
+ return this.message;
158
+ }
159
+ get message() {
160
+ return JSON.stringify(this.issues, x.jsonStringifyReplacer, 2);
161
+ }
162
+ get isEmpty() {
163
+ return this.issues.length === 0;
164
+ }
165
+ flatten(e = (t) => t.message) {
166
+ const t = {}, n = [];
167
+ for (const s of this.issues)
168
+ s.path.length > 0 ? (t[s.path[0]] = t[s.path[0]] || [], t[s.path[0]].push(e(s))) : n.push(e(s));
169
+ return { formErrors: n, fieldErrors: t };
170
+ }
171
+ get formErrors() {
172
+ return this.flatten();
173
+ }
174
+ }
175
+ N.create = (r) => new N(r);
176
+ const H = (r, e) => {
177
+ let t;
178
+ switch (r.code) {
179
+ case d.invalid_type:
180
+ r.received === f.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
181
+ break;
182
+ case d.invalid_literal:
183
+ t = `Invalid literal value, expected ${JSON.stringify(r.expected, x.jsonStringifyReplacer)}`;
184
+ break;
185
+ case d.unrecognized_keys:
186
+ t = `Unrecognized key(s) in object: ${x.joinValues(r.keys, ", ")}`;
187
+ break;
188
+ case d.invalid_union:
189
+ t = "Invalid input";
190
+ break;
191
+ case d.invalid_union_discriminator:
192
+ t = `Invalid discriminator value. Expected ${x.joinValues(r.options)}`;
193
+ break;
194
+ case d.invalid_enum_value:
195
+ t = `Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;
196
+ break;
197
+ case d.invalid_arguments:
198
+ t = "Invalid function arguments";
199
+ break;
200
+ case d.invalid_return_type:
201
+ t = "Invalid function return type";
202
+ break;
203
+ case d.invalid_date:
204
+ t = "Invalid date";
205
+ break;
206
+ case d.invalid_string:
207
+ typeof r.validation == "object" ? "includes" in r.validation ? (t = `Invalid input: must include "${r.validation.includes}"`, typeof r.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${r.validation.position}`)) : "startsWith" in r.validation ? t = `Invalid input: must start with "${r.validation.startsWith}"` : "endsWith" in r.validation ? t = `Invalid input: must end with "${r.validation.endsWith}"` : x.assertNever(r.validation) : r.validation !== "regex" ? t = `Invalid ${r.validation}` : t = "Invalid";
208
+ break;
209
+ case d.too_small:
210
+ r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "more than"} ${r.minimum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at least" : "over"} ${r.minimum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${r.minimum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly equal to " : r.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r.minimum))}` : t = "Invalid input";
211
+ break;
212
+ case d.too_big:
213
+ r.type === "array" ? t = `Array must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "less than"} ${r.maximum} element(s)` : r.type === "string" ? t = `String must contain ${r.exact ? "exactly" : r.inclusive ? "at most" : "under"} ${r.maximum} character(s)` : r.type === "number" ? t = `Number must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "bigint" ? t = `BigInt must be ${r.exact ? "exactly" : r.inclusive ? "less than or equal to" : "less than"} ${r.maximum}` : r.type === "date" ? t = `Date must be ${r.exact ? "exactly" : r.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r.maximum))}` : t = "Invalid input";
214
+ break;
215
+ case d.custom:
216
+ t = "Invalid input";
217
+ break;
218
+ case d.invalid_intersection_types:
219
+ t = "Intersection results could not be merged";
220
+ break;
221
+ case d.not_multiple_of:
222
+ t = `Number must be a multiple of ${r.multipleOf}`;
223
+ break;
224
+ case d.not_finite:
225
+ t = "Number must be finite";
226
+ break;
227
+ default:
228
+ t = e.defaultError, x.assertNever(r);
229
+ }
230
+ return { message: t };
231
+ };
232
+ let Ae = H;
233
+ function Fe(r) {
234
+ Ae = r;
235
+ }
236
+ function ye() {
237
+ return Ae;
238
+ }
239
+ const _e = (r) => {
240
+ const { data: e, path: t, errorMaps: n, issueData: s } = r, a = [...t, ...s.path || []], i = {
241
+ ...s,
242
+ path: a
243
+ };
244
+ if (s.message !== void 0)
245
+ return {
246
+ ...s,
247
+ path: a,
248
+ message: s.message
249
+ };
250
+ let o = "";
251
+ const u = n.filter((c) => !!c).slice().reverse();
252
+ for (const c of u)
253
+ o = c(i, { data: e, defaultError: o }).message;
254
+ return {
255
+ ...s,
256
+ path: a,
257
+ message: o
258
+ };
259
+ }, et = [];
260
+ function l(r, e) {
261
+ const t = ye(), n = _e({
262
+ issueData: e,
263
+ data: r.data,
264
+ path: r.path,
265
+ errorMaps: [
266
+ r.common.contextualErrorMap,
267
+ r.schemaErrorMap,
268
+ t,
269
+ t === H ? void 0 : H
270
+ // then global default map
271
+ ].filter((s) => !!s)
272
+ });
273
+ r.common.issues.push(n);
274
+ }
275
+ class Z {
276
+ constructor() {
277
+ this.value = "valid";
278
+ }
279
+ dirty() {
280
+ this.value === "valid" && (this.value = "dirty");
281
+ }
282
+ abort() {
283
+ this.value !== "aborted" && (this.value = "aborted");
284
+ }
285
+ static mergeArray(e, t) {
286
+ const n = [];
287
+ for (const s of t) {
288
+ if (s.status === "aborted")
289
+ return p;
290
+ s.status === "dirty" && e.dirty(), n.push(s.value);
291
+ }
292
+ return { status: e.value, value: n };
293
+ }
294
+ static async mergeObjectAsync(e, t) {
295
+ const n = [];
296
+ for (const s of t) {
297
+ const a = await s.key, i = await s.value;
298
+ n.push({
299
+ key: a,
300
+ value: i
301
+ });
302
+ }
303
+ return Z.mergeObjectSync(e, n);
304
+ }
305
+ static mergeObjectSync(e, t) {
306
+ const n = {};
307
+ for (const s of t) {
308
+ const { key: a, value: i } = s;
309
+ if (a.status === "aborted" || i.status === "aborted")
310
+ return p;
311
+ a.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof i.value < "u" || s.alwaysSet) && (n[a.value] = i.value);
312
+ }
313
+ return { status: e.value, value: n };
314
+ }
315
+ }
316
+ const p = Object.freeze({
317
+ status: "aborted"
318
+ }), J = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), Ce = (r) => r.status === "aborted", Oe = (r) => r.status === "dirty", ee = (r) => r.status === "valid", te = (r) => typeof Promise < "u" && r instanceof Promise;
319
+ function ve(r, e, t, n) {
320
+ if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
321
+ return e.get(r);
322
+ }
323
+ function Me(r, e, t, n, s) {
324
+ if (typeof e == "function" ? r !== e || !s : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
325
+ return e.set(r, t), t;
326
+ }
327
+ var h;
328
+ (function(r) {
329
+ r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
330
+ })(h || (h = {}));
331
+ var Q, F;
332
+ class A {
333
+ constructor(e, t, n, s) {
334
+ this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = s;
335
+ }
336
+ get path() {
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
+ }
339
+ }
340
+ const Ie = (r, e) => {
341
+ if (ee(e))
342
+ return { success: !0, data: e.value };
343
+ if (!r.common.issues.length)
344
+ throw new Error("Validation failed but no issues detected.");
345
+ return {
346
+ success: !1,
347
+ get error() {
348
+ if (this._error)
349
+ return this._error;
350
+ const t = new N(r.common.issues);
351
+ return this._error = t, this._error;
352
+ }
353
+ };
354
+ };
355
+ function _(r) {
356
+ if (!r)
357
+ return {};
358
+ const { errorMap: e, invalid_type_error: t, required_error: n, description: s } = r;
359
+ if (e && (t || n))
360
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
361
+ return e ? { errorMap: e, description: s } : { errorMap: (i, o) => {
362
+ var u, c;
363
+ const { message: y } = r;
364
+ return i.code === "invalid_enum_value" ? { message: y ?? o.defaultError } : typeof o.data > "u" ? { message: (u = y ?? n) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = y ?? t) !== null && c !== void 0 ? c : o.defaultError };
365
+ }, description: s };
366
+ }
367
+ class v {
368
+ constructor(e) {
369
+ this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
370
+ }
371
+ get description() {
372
+ return this._def.description;
373
+ }
374
+ _getType(e) {
375
+ return P(e.data);
376
+ }
377
+ _getOrReturnCtx(e, t) {
378
+ return t || {
379
+ common: e.parent.common,
380
+ data: e.data,
381
+ parsedType: P(e.data),
382
+ schemaErrorMap: this._def.errorMap,
383
+ path: e.path,
384
+ parent: e.parent
385
+ };
386
+ }
387
+ _processInputParams(e) {
388
+ return {
389
+ status: new Z(),
390
+ ctx: {
391
+ common: e.parent.common,
392
+ data: e.data,
393
+ parsedType: P(e.data),
394
+ schemaErrorMap: this._def.errorMap,
395
+ path: e.path,
396
+ parent: e.parent
397
+ }
398
+ };
399
+ }
400
+ _parseSync(e) {
401
+ const t = this._parse(e);
402
+ if (te(t))
403
+ throw new Error("Synchronous parse encountered promise.");
404
+ return t;
405
+ }
406
+ _parseAsync(e) {
407
+ const t = this._parse(e);
408
+ return Promise.resolve(t);
409
+ }
410
+ parse(e, t) {
411
+ const n = this.safeParse(e, t);
412
+ if (n.success)
413
+ return n.data;
414
+ throw n.error;
415
+ }
416
+ safeParse(e, t) {
417
+ var n;
418
+ const s = {
419
+ common: {
420
+ issues: [],
421
+ async: (n = t == null ? void 0 : t.async) !== null && n !== void 0 ? n : !1,
422
+ contextualErrorMap: t == null ? void 0 : t.errorMap
423
+ },
424
+ path: (t == null ? void 0 : t.path) || [],
425
+ schemaErrorMap: this._def.errorMap,
426
+ parent: null,
427
+ data: e,
428
+ parsedType: P(e)
429
+ }, a = this._parseSync({ data: e, path: s.path, parent: s });
430
+ return Ie(s, a);
431
+ }
432
+ async parseAsync(e, t) {
433
+ const n = await this.safeParseAsync(e, t);
434
+ if (n.success)
435
+ return n.data;
436
+ throw n.error;
437
+ }
438
+ async safeParseAsync(e, t) {
439
+ const n = {
440
+ common: {
441
+ issues: [],
442
+ contextualErrorMap: t == null ? void 0 : t.errorMap,
443
+ async: !0
444
+ },
445
+ path: (t == null ? void 0 : t.path) || [],
446
+ schemaErrorMap: this._def.errorMap,
447
+ parent: null,
448
+ data: e,
449
+ parsedType: P(e)
450
+ }, s = this._parse({ data: e, path: n.path, parent: n }), a = await (te(s) ? s : Promise.resolve(s));
451
+ return Ie(n, a);
452
+ }
453
+ refine(e, t) {
454
+ const n = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
455
+ return this._refinement((s, a) => {
456
+ const i = e(s), o = () => a.addIssue({
457
+ code: d.custom,
458
+ ...n(s)
459
+ });
460
+ return typeof Promise < "u" && i instanceof Promise ? i.then((u) => u ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
461
+ });
462
+ }
463
+ refinement(e, t) {
464
+ return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
465
+ }
466
+ _refinement(e) {
467
+ return new I({
468
+ schema: this,
469
+ typeName: m.ZodEffects,
470
+ effect: { type: "refinement", refinement: e }
471
+ });
472
+ }
473
+ superRefine(e) {
474
+ return this._refinement(e);
475
+ }
476
+ optional() {
477
+ return j.create(this, this._def);
478
+ }
479
+ nullable() {
480
+ return q.create(this, this._def);
481
+ }
482
+ nullish() {
483
+ return this.nullable().optional();
484
+ }
485
+ array() {
486
+ return R.create(this, this._def);
487
+ }
488
+ promise() {
489
+ return K.create(this, this._def);
490
+ }
491
+ or(e) {
492
+ return ae.create([this, e], this._def);
493
+ }
494
+ and(e) {
495
+ return ie.create(this, e, this._def);
496
+ }
497
+ transform(e) {
498
+ return new I({
499
+ ..._(this._def),
500
+ schema: this,
501
+ typeName: m.ZodEffects,
502
+ effect: { type: "transform", transform: e }
503
+ });
504
+ }
505
+ default(e) {
506
+ const t = typeof e == "function" ? e : () => e;
507
+ return new le({
508
+ ..._(this._def),
509
+ innerType: this,
510
+ defaultValue: t,
511
+ typeName: m.ZodDefault
512
+ });
513
+ }
514
+ brand() {
515
+ return new Ee({
516
+ typeName: m.ZodBranded,
517
+ type: this,
518
+ ..._(this._def)
519
+ });
520
+ }
521
+ catch(e) {
522
+ const t = typeof e == "function" ? e : () => e;
523
+ return new fe({
524
+ ..._(this._def),
525
+ innerType: this,
526
+ catchValue: t,
527
+ typeName: m.ZodCatch
528
+ });
529
+ }
530
+ describe(e) {
531
+ const t = this.constructor;
532
+ return new t({
533
+ ...this._def,
534
+ description: e
535
+ });
536
+ }
537
+ pipe(e) {
538
+ return me.create(this, e);
539
+ }
540
+ readonly() {
541
+ return he.create(this);
542
+ }
543
+ isOptional() {
544
+ return this.safeParse(void 0).success;
545
+ }
546
+ isNullable() {
547
+ return this.safeParse(null).success;
548
+ }
549
+ }
550
+ const tt = /^c[^\s-]{8,}$/i, rt = /^[0-9a-z]+$/, nt = /^[0-9A-HJKMNP-TV-Z]{26}$/, st = /^[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, at = /^[a-z0-9_-]{21}$/i, it = /^[-+]?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)?)??$/, ot = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, dt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
551
+ let Ze;
552
+ const ct = /^(?:(?: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])$/, ut = /^(([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})))$/, lt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, $e = "((\\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])))", ft = new RegExp(`^${$e}$`);
553
+ function ze(r) {
554
+ let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
555
+ return r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`), e;
556
+ }
557
+ function ht(r) {
558
+ return new RegExp(`^${ze(r)}$`);
559
+ }
560
+ function Pe(r) {
561
+ let e = `${$e}T${ze(r)}`;
562
+ const t = [];
563
+ return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
564
+ }
565
+ function mt(r, e) {
566
+ return !!((e === "v4" || !e) && ct.test(r) || (e === "v6" || !e) && ut.test(r));
567
+ }
568
+ class E extends v {
569
+ _parse(e) {
570
+ if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
571
+ const a = this._getOrReturnCtx(e);
572
+ return l(a, {
573
+ code: d.invalid_type,
574
+ expected: f.string,
575
+ received: a.parsedType
576
+ }), p;
577
+ }
578
+ const n = new Z();
579
+ let s;
580
+ for (const a of this._def.checks)
581
+ if (a.kind === "min")
582
+ e.data.length < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
583
+ code: d.too_small,
584
+ minimum: a.value,
585
+ type: "string",
586
+ inclusive: !0,
587
+ exact: !1,
588
+ message: a.message
589
+ }), n.dirty());
590
+ else if (a.kind === "max")
591
+ e.data.length > a.value && (s = this._getOrReturnCtx(e, s), l(s, {
592
+ code: d.too_big,
593
+ maximum: a.value,
594
+ type: "string",
595
+ inclusive: !0,
596
+ exact: !1,
597
+ message: a.message
598
+ }), n.dirty());
599
+ else if (a.kind === "length") {
600
+ const i = e.data.length > a.value, o = e.data.length < a.value;
601
+ (i || o) && (s = this._getOrReturnCtx(e, s), i ? l(s, {
602
+ code: d.too_big,
603
+ maximum: a.value,
604
+ type: "string",
605
+ inclusive: !0,
606
+ exact: !0,
607
+ message: a.message
608
+ }) : o && l(s, {
609
+ code: d.too_small,
610
+ minimum: a.value,
611
+ type: "string",
612
+ inclusive: !0,
613
+ exact: !0,
614
+ message: a.message
615
+ }), n.dirty());
616
+ } else if (a.kind === "email")
617
+ ot.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
618
+ validation: "email",
619
+ code: d.invalid_string,
620
+ message: a.message
621
+ }), n.dirty());
622
+ else if (a.kind === "emoji")
623
+ Ze || (Ze = new RegExp(dt, "u")), Ze.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
624
+ validation: "emoji",
625
+ code: d.invalid_string,
626
+ message: a.message
627
+ }), n.dirty());
628
+ else if (a.kind === "uuid")
629
+ st.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
630
+ validation: "uuid",
631
+ code: d.invalid_string,
632
+ message: a.message
633
+ }), n.dirty());
634
+ else if (a.kind === "nanoid")
635
+ at.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
636
+ validation: "nanoid",
637
+ code: d.invalid_string,
638
+ message: a.message
639
+ }), n.dirty());
640
+ else if (a.kind === "cuid")
641
+ tt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
642
+ validation: "cuid",
643
+ code: d.invalid_string,
644
+ message: a.message
645
+ }), n.dirty());
646
+ else if (a.kind === "cuid2")
647
+ rt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
648
+ validation: "cuid2",
649
+ code: d.invalid_string,
650
+ message: a.message
651
+ }), n.dirty());
652
+ else if (a.kind === "ulid")
653
+ nt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
654
+ validation: "ulid",
655
+ code: d.invalid_string,
656
+ message: a.message
657
+ }), n.dirty());
658
+ else if (a.kind === "url")
659
+ try {
660
+ new URL(e.data);
661
+ } catch {
662
+ s = this._getOrReturnCtx(e, s), l(s, {
663
+ validation: "url",
664
+ code: d.invalid_string,
665
+ message: a.message
666
+ }), n.dirty();
667
+ }
668
+ else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
669
+ validation: "regex",
670
+ code: d.invalid_string,
671
+ message: a.message
672
+ }), n.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), l(s, {
673
+ code: d.invalid_string,
674
+ validation: { includes: a.value, position: a.position },
675
+ message: a.message
676
+ }), n.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), l(s, {
677
+ code: d.invalid_string,
678
+ validation: { startsWith: a.value },
679
+ message: a.message
680
+ }), n.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), l(s, {
681
+ code: d.invalid_string,
682
+ validation: { endsWith: a.value },
683
+ message: a.message
684
+ }), n.dirty()) : a.kind === "datetime" ? Pe(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
685
+ code: d.invalid_string,
686
+ validation: "datetime",
687
+ message: a.message
688
+ }), n.dirty()) : a.kind === "date" ? ft.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
689
+ code: d.invalid_string,
690
+ validation: "date",
691
+ message: a.message
692
+ }), n.dirty()) : a.kind === "time" ? ht(a).test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
693
+ code: d.invalid_string,
694
+ validation: "time",
695
+ message: a.message
696
+ }), n.dirty()) : a.kind === "duration" ? it.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
697
+ validation: "duration",
698
+ code: d.invalid_string,
699
+ message: a.message
700
+ }), n.dirty()) : a.kind === "ip" ? mt(e.data, a.version) || (s = this._getOrReturnCtx(e, s), l(s, {
701
+ validation: "ip",
702
+ code: d.invalid_string,
703
+ message: a.message
704
+ }), n.dirty()) : a.kind === "base64" ? lt.test(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
705
+ validation: "base64",
706
+ code: d.invalid_string,
707
+ message: a.message
708
+ }), n.dirty()) : x.assertNever(a);
709
+ return { status: n.value, value: e.data };
710
+ }
711
+ _regex(e, t, n) {
712
+ return this.refinement((s) => e.test(s), {
713
+ validation: t,
714
+ code: d.invalid_string,
715
+ ...h.errToObj(n)
716
+ });
717
+ }
718
+ _addCheck(e) {
719
+ return new E({
720
+ ...this._def,
721
+ checks: [...this._def.checks, e]
722
+ });
723
+ }
724
+ email(e) {
725
+ return this._addCheck({ kind: "email", ...h.errToObj(e) });
726
+ }
727
+ url(e) {
728
+ return this._addCheck({ kind: "url", ...h.errToObj(e) });
729
+ }
730
+ emoji(e) {
731
+ return this._addCheck({ kind: "emoji", ...h.errToObj(e) });
732
+ }
733
+ uuid(e) {
734
+ return this._addCheck({ kind: "uuid", ...h.errToObj(e) });
735
+ }
736
+ nanoid(e) {
737
+ return this._addCheck({ kind: "nanoid", ...h.errToObj(e) });
738
+ }
739
+ cuid(e) {
740
+ return this._addCheck({ kind: "cuid", ...h.errToObj(e) });
741
+ }
742
+ cuid2(e) {
743
+ return this._addCheck({ kind: "cuid2", ...h.errToObj(e) });
744
+ }
745
+ ulid(e) {
746
+ return this._addCheck({ kind: "ulid", ...h.errToObj(e) });
747
+ }
748
+ base64(e) {
749
+ return this._addCheck({ kind: "base64", ...h.errToObj(e) });
750
+ }
751
+ ip(e) {
752
+ return this._addCheck({ kind: "ip", ...h.errToObj(e) });
753
+ }
754
+ datetime(e) {
755
+ var t, n;
756
+ return typeof e == "string" ? this._addCheck({
757
+ kind: "datetime",
758
+ precision: null,
759
+ offset: !1,
760
+ local: !1,
761
+ message: e
762
+ }) : this._addCheck({
763
+ kind: "datetime",
764
+ precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
765
+ offset: (t = e == null ? void 0 : e.offset) !== null && t !== void 0 ? t : !1,
766
+ local: (n = e == null ? void 0 : e.local) !== null && n !== void 0 ? n : !1,
767
+ ...h.errToObj(e == null ? void 0 : e.message)
768
+ });
769
+ }
770
+ date(e) {
771
+ return this._addCheck({ kind: "date", message: e });
772
+ }
773
+ time(e) {
774
+ return typeof e == "string" ? this._addCheck({
775
+ kind: "time",
776
+ precision: null,
777
+ message: e
778
+ }) : this._addCheck({
779
+ kind: "time",
780
+ precision: typeof (e == null ? void 0 : e.precision) > "u" ? null : e == null ? void 0 : e.precision,
781
+ ...h.errToObj(e == null ? void 0 : e.message)
782
+ });
783
+ }
784
+ duration(e) {
785
+ return this._addCheck({ kind: "duration", ...h.errToObj(e) });
786
+ }
787
+ regex(e, t) {
788
+ return this._addCheck({
789
+ kind: "regex",
790
+ regex: e,
791
+ ...h.errToObj(t)
792
+ });
793
+ }
794
+ includes(e, t) {
795
+ return this._addCheck({
796
+ kind: "includes",
797
+ value: e,
798
+ position: t == null ? void 0 : t.position,
799
+ ...h.errToObj(t == null ? void 0 : t.message)
800
+ });
801
+ }
802
+ startsWith(e, t) {
803
+ return this._addCheck({
804
+ kind: "startsWith",
805
+ value: e,
806
+ ...h.errToObj(t)
807
+ });
808
+ }
809
+ endsWith(e, t) {
810
+ return this._addCheck({
811
+ kind: "endsWith",
812
+ value: e,
813
+ ...h.errToObj(t)
814
+ });
815
+ }
816
+ min(e, t) {
817
+ return this._addCheck({
818
+ kind: "min",
819
+ value: e,
820
+ ...h.errToObj(t)
821
+ });
822
+ }
823
+ max(e, t) {
824
+ return this._addCheck({
825
+ kind: "max",
826
+ value: e,
827
+ ...h.errToObj(t)
828
+ });
829
+ }
830
+ length(e, t) {
831
+ return this._addCheck({
832
+ kind: "length",
833
+ value: e,
834
+ ...h.errToObj(t)
835
+ });
836
+ }
837
+ /**
838
+ * @deprecated Use z.string().min(1) instead.
839
+ * @see {@link ZodString.min}
840
+ */
841
+ nonempty(e) {
842
+ return this.min(1, h.errToObj(e));
843
+ }
844
+ trim() {
845
+ return new E({
846
+ ...this._def,
847
+ checks: [...this._def.checks, { kind: "trim" }]
848
+ });
849
+ }
850
+ toLowerCase() {
851
+ return new E({
852
+ ...this._def,
853
+ checks: [...this._def.checks, { kind: "toLowerCase" }]
854
+ });
855
+ }
856
+ toUpperCase() {
857
+ return new E({
858
+ ...this._def,
859
+ checks: [...this._def.checks, { kind: "toUpperCase" }]
860
+ });
861
+ }
862
+ get isDatetime() {
863
+ return !!this._def.checks.find((e) => e.kind === "datetime");
864
+ }
865
+ get isDate() {
866
+ return !!this._def.checks.find((e) => e.kind === "date");
867
+ }
868
+ get isTime() {
869
+ return !!this._def.checks.find((e) => e.kind === "time");
870
+ }
871
+ get isDuration() {
872
+ return !!this._def.checks.find((e) => e.kind === "duration");
873
+ }
874
+ get isEmail() {
875
+ return !!this._def.checks.find((e) => e.kind === "email");
876
+ }
877
+ get isURL() {
878
+ return !!this._def.checks.find((e) => e.kind === "url");
879
+ }
880
+ get isEmoji() {
881
+ return !!this._def.checks.find((e) => e.kind === "emoji");
882
+ }
883
+ get isUUID() {
884
+ return !!this._def.checks.find((e) => e.kind === "uuid");
885
+ }
886
+ get isNANOID() {
887
+ return !!this._def.checks.find((e) => e.kind === "nanoid");
888
+ }
889
+ get isCUID() {
890
+ return !!this._def.checks.find((e) => e.kind === "cuid");
891
+ }
892
+ get isCUID2() {
893
+ return !!this._def.checks.find((e) => e.kind === "cuid2");
894
+ }
895
+ get isULID() {
896
+ return !!this._def.checks.find((e) => e.kind === "ulid");
897
+ }
898
+ get isIP() {
899
+ return !!this._def.checks.find((e) => e.kind === "ip");
900
+ }
901
+ get isBase64() {
902
+ return !!this._def.checks.find((e) => e.kind === "base64");
903
+ }
904
+ get minLength() {
905
+ let e = null;
906
+ for (const t of this._def.checks)
907
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
908
+ return e;
909
+ }
910
+ get maxLength() {
911
+ let e = null;
912
+ for (const t of this._def.checks)
913
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
914
+ return e;
915
+ }
916
+ }
917
+ E.create = (r) => {
918
+ var e;
919
+ return new E({
920
+ checks: [],
921
+ typeName: m.ZodString,
922
+ coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
923
+ ..._(r)
924
+ });
925
+ };
926
+ function pt(r, e) {
927
+ 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(".", ""));
928
+ return a % i / Math.pow(10, s);
929
+ }
930
+ class V extends v {
931
+ constructor() {
932
+ super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
933
+ }
934
+ _parse(e) {
935
+ if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== f.number) {
936
+ const a = this._getOrReturnCtx(e);
937
+ return l(a, {
938
+ code: d.invalid_type,
939
+ expected: f.number,
940
+ received: a.parsedType
941
+ }), p;
942
+ }
943
+ let n;
944
+ const s = new Z();
945
+ for (const a of this._def.checks)
946
+ a.kind === "int" ? x.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
947
+ code: d.invalid_type,
948
+ expected: "integer",
949
+ received: "float",
950
+ message: a.message
951
+ }), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
952
+ code: d.too_small,
953
+ minimum: a.value,
954
+ type: "number",
955
+ inclusive: a.inclusive,
956
+ exact: !1,
957
+ message: a.message
958
+ }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
959
+ code: d.too_big,
960
+ maximum: a.value,
961
+ type: "number",
962
+ inclusive: a.inclusive,
963
+ exact: !1,
964
+ message: a.message
965
+ }), s.dirty()) : a.kind === "multipleOf" ? pt(e.data, a.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
966
+ code: d.not_multiple_of,
967
+ multipleOf: a.value,
968
+ message: a.message
969
+ }), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
970
+ code: d.not_finite,
971
+ message: a.message
972
+ }), s.dirty()) : x.assertNever(a);
973
+ return { status: s.value, value: e.data };
974
+ }
975
+ gte(e, t) {
976
+ return this.setLimit("min", e, !0, h.toString(t));
977
+ }
978
+ gt(e, t) {
979
+ return this.setLimit("min", e, !1, h.toString(t));
980
+ }
981
+ lte(e, t) {
982
+ return this.setLimit("max", e, !0, h.toString(t));
983
+ }
984
+ lt(e, t) {
985
+ return this.setLimit("max", e, !1, h.toString(t));
986
+ }
987
+ setLimit(e, t, n, s) {
988
+ return new V({
989
+ ...this._def,
990
+ checks: [
991
+ ...this._def.checks,
992
+ {
993
+ kind: e,
994
+ value: t,
995
+ inclusive: n,
996
+ message: h.toString(s)
997
+ }
998
+ ]
999
+ });
1000
+ }
1001
+ _addCheck(e) {
1002
+ return new V({
1003
+ ...this._def,
1004
+ checks: [...this._def.checks, e]
1005
+ });
1006
+ }
1007
+ int(e) {
1008
+ return this._addCheck({
1009
+ kind: "int",
1010
+ message: h.toString(e)
1011
+ });
1012
+ }
1013
+ positive(e) {
1014
+ return this._addCheck({
1015
+ kind: "min",
1016
+ value: 0,
1017
+ inclusive: !1,
1018
+ message: h.toString(e)
1019
+ });
1020
+ }
1021
+ negative(e) {
1022
+ return this._addCheck({
1023
+ kind: "max",
1024
+ value: 0,
1025
+ inclusive: !1,
1026
+ message: h.toString(e)
1027
+ });
1028
+ }
1029
+ nonpositive(e) {
1030
+ return this._addCheck({
1031
+ kind: "max",
1032
+ value: 0,
1033
+ inclusive: !0,
1034
+ message: h.toString(e)
1035
+ });
1036
+ }
1037
+ nonnegative(e) {
1038
+ return this._addCheck({
1039
+ kind: "min",
1040
+ value: 0,
1041
+ inclusive: !0,
1042
+ message: h.toString(e)
1043
+ });
1044
+ }
1045
+ multipleOf(e, t) {
1046
+ return this._addCheck({
1047
+ kind: "multipleOf",
1048
+ value: e,
1049
+ message: h.toString(t)
1050
+ });
1051
+ }
1052
+ finite(e) {
1053
+ return this._addCheck({
1054
+ kind: "finite",
1055
+ message: h.toString(e)
1056
+ });
1057
+ }
1058
+ safe(e) {
1059
+ return this._addCheck({
1060
+ kind: "min",
1061
+ inclusive: !0,
1062
+ value: Number.MIN_SAFE_INTEGER,
1063
+ message: h.toString(e)
1064
+ })._addCheck({
1065
+ kind: "max",
1066
+ inclusive: !0,
1067
+ value: Number.MAX_SAFE_INTEGER,
1068
+ message: h.toString(e)
1069
+ });
1070
+ }
1071
+ get minValue() {
1072
+ let e = null;
1073
+ for (const t of this._def.checks)
1074
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1075
+ return e;
1076
+ }
1077
+ get maxValue() {
1078
+ let e = null;
1079
+ for (const t of this._def.checks)
1080
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1081
+ return e;
1082
+ }
1083
+ get isInt() {
1084
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && x.isInteger(e.value));
1085
+ }
1086
+ get isFinite() {
1087
+ let e = null, t = null;
1088
+ for (const n of this._def.checks) {
1089
+ if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf")
1090
+ return !0;
1091
+ n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
1092
+ }
1093
+ return Number.isFinite(t) && Number.isFinite(e);
1094
+ }
1095
+ }
1096
+ V.create = (r) => new V({
1097
+ checks: [],
1098
+ typeName: m.ZodNumber,
1099
+ coerce: (r == null ? void 0 : r.coerce) || !1,
1100
+ ..._(r)
1101
+ });
1102
+ class D extends v {
1103
+ constructor() {
1104
+ super(...arguments), this.min = this.gte, this.max = this.lte;
1105
+ }
1106
+ _parse(e) {
1107
+ if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== f.bigint) {
1108
+ const a = this._getOrReturnCtx(e);
1109
+ return l(a, {
1110
+ code: d.invalid_type,
1111
+ expected: f.bigint,
1112
+ received: a.parsedType
1113
+ }), p;
1114
+ }
1115
+ let n;
1116
+ const s = new Z();
1117
+ for (const a of this._def.checks)
1118
+ a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1119
+ code: d.too_small,
1120
+ type: "bigint",
1121
+ minimum: a.value,
1122
+ inclusive: a.inclusive,
1123
+ message: a.message
1124
+ }), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (n = this._getOrReturnCtx(e, n), l(n, {
1125
+ code: d.too_big,
1126
+ type: "bigint",
1127
+ maximum: a.value,
1128
+ inclusive: a.inclusive,
1129
+ message: a.message
1130
+ }), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), l(n, {
1131
+ code: d.not_multiple_of,
1132
+ multipleOf: a.value,
1133
+ message: a.message
1134
+ }), s.dirty()) : x.assertNever(a);
1135
+ return { status: s.value, value: e.data };
1136
+ }
1137
+ gte(e, t) {
1138
+ return this.setLimit("min", e, !0, h.toString(t));
1139
+ }
1140
+ gt(e, t) {
1141
+ return this.setLimit("min", e, !1, h.toString(t));
1142
+ }
1143
+ lte(e, t) {
1144
+ return this.setLimit("max", e, !0, h.toString(t));
1145
+ }
1146
+ lt(e, t) {
1147
+ return this.setLimit("max", e, !1, h.toString(t));
1148
+ }
1149
+ setLimit(e, t, n, s) {
1150
+ return new D({
1151
+ ...this._def,
1152
+ checks: [
1153
+ ...this._def.checks,
1154
+ {
1155
+ kind: e,
1156
+ value: t,
1157
+ inclusive: n,
1158
+ message: h.toString(s)
1159
+ }
1160
+ ]
1161
+ });
1162
+ }
1163
+ _addCheck(e) {
1164
+ return new D({
1165
+ ...this._def,
1166
+ checks: [...this._def.checks, e]
1167
+ });
1168
+ }
1169
+ positive(e) {
1170
+ return this._addCheck({
1171
+ kind: "min",
1172
+ value: BigInt(0),
1173
+ inclusive: !1,
1174
+ message: h.toString(e)
1175
+ });
1176
+ }
1177
+ negative(e) {
1178
+ return this._addCheck({
1179
+ kind: "max",
1180
+ value: BigInt(0),
1181
+ inclusive: !1,
1182
+ message: h.toString(e)
1183
+ });
1184
+ }
1185
+ nonpositive(e) {
1186
+ return this._addCheck({
1187
+ kind: "max",
1188
+ value: BigInt(0),
1189
+ inclusive: !0,
1190
+ message: h.toString(e)
1191
+ });
1192
+ }
1193
+ nonnegative(e) {
1194
+ return this._addCheck({
1195
+ kind: "min",
1196
+ value: BigInt(0),
1197
+ inclusive: !0,
1198
+ message: h.toString(e)
1199
+ });
1200
+ }
1201
+ multipleOf(e, t) {
1202
+ return this._addCheck({
1203
+ kind: "multipleOf",
1204
+ value: e,
1205
+ message: h.toString(t)
1206
+ });
1207
+ }
1208
+ get minValue() {
1209
+ let e = null;
1210
+ for (const t of this._def.checks)
1211
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1212
+ return e;
1213
+ }
1214
+ get maxValue() {
1215
+ let e = null;
1216
+ for (const t of this._def.checks)
1217
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1218
+ return e;
1219
+ }
1220
+ }
1221
+ D.create = (r) => {
1222
+ var e;
1223
+ return new D({
1224
+ checks: [],
1225
+ typeName: m.ZodBigInt,
1226
+ coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
1227
+ ..._(r)
1228
+ });
1229
+ };
1230
+ class re extends v {
1231
+ _parse(e) {
1232
+ if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== f.boolean) {
1233
+ const n = this._getOrReturnCtx(e);
1234
+ return l(n, {
1235
+ code: d.invalid_type,
1236
+ expected: f.boolean,
1237
+ received: n.parsedType
1238
+ }), p;
1239
+ }
1240
+ return S(e.data);
1241
+ }
1242
+ }
1243
+ re.create = (r) => new re({
1244
+ typeName: m.ZodBoolean,
1245
+ coerce: (r == null ? void 0 : r.coerce) || !1,
1246
+ ..._(r)
1247
+ });
1248
+ class B extends v {
1249
+ _parse(e) {
1250
+ if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== f.date) {
1251
+ const a = this._getOrReturnCtx(e);
1252
+ return l(a, {
1253
+ code: d.invalid_type,
1254
+ expected: f.date,
1255
+ received: a.parsedType
1256
+ }), p;
1257
+ }
1258
+ if (isNaN(e.data.getTime())) {
1259
+ const a = this._getOrReturnCtx(e);
1260
+ return l(a, {
1261
+ code: d.invalid_date
1262
+ }), p;
1263
+ }
1264
+ const n = new Z();
1265
+ let s;
1266
+ for (const a of this._def.checks)
1267
+ a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), l(s, {
1268
+ code: d.too_small,
1269
+ message: a.message,
1270
+ inclusive: !0,
1271
+ exact: !1,
1272
+ minimum: a.value,
1273
+ type: "date"
1274
+ }), n.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), l(s, {
1275
+ code: d.too_big,
1276
+ message: a.message,
1277
+ inclusive: !0,
1278
+ exact: !1,
1279
+ maximum: a.value,
1280
+ type: "date"
1281
+ }), n.dirty()) : x.assertNever(a);
1282
+ return {
1283
+ status: n.value,
1284
+ value: new Date(e.data.getTime())
1285
+ };
1286
+ }
1287
+ _addCheck(e) {
1288
+ return new B({
1289
+ ...this._def,
1290
+ checks: [...this._def.checks, e]
1291
+ });
1292
+ }
1293
+ min(e, t) {
1294
+ return this._addCheck({
1295
+ kind: "min",
1296
+ value: e.getTime(),
1297
+ message: h.toString(t)
1298
+ });
1299
+ }
1300
+ max(e, t) {
1301
+ return this._addCheck({
1302
+ kind: "max",
1303
+ value: e.getTime(),
1304
+ message: h.toString(t)
1305
+ });
1306
+ }
1307
+ get minDate() {
1308
+ let e = null;
1309
+ for (const t of this._def.checks)
1310
+ t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1311
+ return e != null ? new Date(e) : null;
1312
+ }
1313
+ get maxDate() {
1314
+ let e = null;
1315
+ for (const t of this._def.checks)
1316
+ t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1317
+ return e != null ? new Date(e) : null;
1318
+ }
1319
+ }
1320
+ B.create = (r) => new B({
1321
+ checks: [],
1322
+ coerce: (r == null ? void 0 : r.coerce) || !1,
1323
+ typeName: m.ZodDate,
1324
+ ..._(r)
1325
+ });
1326
+ class ge extends v {
1327
+ _parse(e) {
1328
+ if (this._getType(e) !== f.symbol) {
1329
+ const n = this._getOrReturnCtx(e);
1330
+ return l(n, {
1331
+ code: d.invalid_type,
1332
+ expected: f.symbol,
1333
+ received: n.parsedType
1334
+ }), p;
1335
+ }
1336
+ return S(e.data);
1337
+ }
1338
+ }
1339
+ ge.create = (r) => new ge({
1340
+ typeName: m.ZodSymbol,
1341
+ ..._(r)
1342
+ });
1343
+ class ne extends v {
1344
+ _parse(e) {
1345
+ if (this._getType(e) !== f.undefined) {
1346
+ const n = this._getOrReturnCtx(e);
1347
+ return l(n, {
1348
+ code: d.invalid_type,
1349
+ expected: f.undefined,
1350
+ received: n.parsedType
1351
+ }), p;
1352
+ }
1353
+ return S(e.data);
1354
+ }
1355
+ }
1356
+ ne.create = (r) => new ne({
1357
+ typeName: m.ZodUndefined,
1358
+ ..._(r)
1359
+ });
1360
+ class se extends v {
1361
+ _parse(e) {
1362
+ if (this._getType(e) !== f.null) {
1363
+ const n = this._getOrReturnCtx(e);
1364
+ return l(n, {
1365
+ code: d.invalid_type,
1366
+ expected: f.null,
1367
+ received: n.parsedType
1368
+ }), p;
1369
+ }
1370
+ return S(e.data);
1371
+ }
1372
+ }
1373
+ se.create = (r) => new se({
1374
+ typeName: m.ZodNull,
1375
+ ..._(r)
1376
+ });
1377
+ class X extends v {
1378
+ constructor() {
1379
+ super(...arguments), this._any = !0;
1380
+ }
1381
+ _parse(e) {
1382
+ return S(e.data);
1383
+ }
1384
+ }
1385
+ X.create = (r) => new X({
1386
+ typeName: m.ZodAny,
1387
+ ..._(r)
1388
+ });
1389
+ class U extends v {
1390
+ constructor() {
1391
+ super(...arguments), this._unknown = !0;
1392
+ }
1393
+ _parse(e) {
1394
+ return S(e.data);
1395
+ }
1396
+ }
1397
+ U.create = (r) => new U({
1398
+ typeName: m.ZodUnknown,
1399
+ ..._(r)
1400
+ });
1401
+ class z extends v {
1402
+ _parse(e) {
1403
+ const t = this._getOrReturnCtx(e);
1404
+ return l(t, {
1405
+ code: d.invalid_type,
1406
+ expected: f.never,
1407
+ received: t.parsedType
1408
+ }), p;
1409
+ }
1410
+ }
1411
+ z.create = (r) => new z({
1412
+ typeName: m.ZodNever,
1413
+ ..._(r)
1414
+ });
1415
+ class xe extends v {
1416
+ _parse(e) {
1417
+ if (this._getType(e) !== f.undefined) {
1418
+ const n = this._getOrReturnCtx(e);
1419
+ return l(n, {
1420
+ code: d.invalid_type,
1421
+ expected: f.void,
1422
+ received: n.parsedType
1423
+ }), p;
1424
+ }
1425
+ return S(e.data);
1426
+ }
1427
+ }
1428
+ xe.create = (r) => new xe({
1429
+ typeName: m.ZodVoid,
1430
+ ..._(r)
1431
+ });
1432
+ class R extends v {
1433
+ _parse(e) {
1434
+ const { ctx: t, status: n } = this._processInputParams(e), s = this._def;
1435
+ if (t.parsedType !== f.array)
1436
+ return l(t, {
1437
+ code: d.invalid_type,
1438
+ expected: f.array,
1439
+ received: t.parsedType
1440
+ }), p;
1441
+ if (s.exactLength !== null) {
1442
+ const i = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
1443
+ (i || o) && (l(t, {
1444
+ code: i ? d.too_big : d.too_small,
1445
+ minimum: o ? s.exactLength.value : void 0,
1446
+ maximum: i ? s.exactLength.value : void 0,
1447
+ type: "array",
1448
+ inclusive: !0,
1449
+ exact: !0,
1450
+ message: s.exactLength.message
1451
+ }), n.dirty());
1452
+ }
1453
+ if (s.minLength !== null && t.data.length < s.minLength.value && (l(t, {
1454
+ code: d.too_small,
1455
+ minimum: s.minLength.value,
1456
+ type: "array",
1457
+ inclusive: !0,
1458
+ exact: !1,
1459
+ message: s.minLength.message
1460
+ }), n.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (l(t, {
1461
+ code: d.too_big,
1462
+ maximum: s.maxLength.value,
1463
+ type: "array",
1464
+ inclusive: !0,
1465
+ exact: !1,
1466
+ message: s.maxLength.message
1467
+ }), n.dirty()), t.common.async)
1468
+ return Promise.all([...t.data].map((i, o) => s.type._parseAsync(new A(t, i, t.path, o)))).then((i) => Z.mergeArray(n, i));
1469
+ const a = [...t.data].map((i, o) => s.type._parseSync(new A(t, i, t.path, o)));
1470
+ return Z.mergeArray(n, a);
1471
+ }
1472
+ get element() {
1473
+ return this._def.type;
1474
+ }
1475
+ min(e, t) {
1476
+ return new R({
1477
+ ...this._def,
1478
+ minLength: { value: e, message: h.toString(t) }
1479
+ });
1480
+ }
1481
+ max(e, t) {
1482
+ return new R({
1483
+ ...this._def,
1484
+ maxLength: { value: e, message: h.toString(t) }
1485
+ });
1486
+ }
1487
+ length(e, t) {
1488
+ return new R({
1489
+ ...this._def,
1490
+ exactLength: { value: e, message: h.toString(t) }
1491
+ });
1492
+ }
1493
+ nonempty(e) {
1494
+ return this.min(1, e);
1495
+ }
1496
+ }
1497
+ R.create = (r, e) => new R({
1498
+ type: r,
1499
+ minLength: null,
1500
+ maxLength: null,
1501
+ exactLength: null,
1502
+ typeName: m.ZodArray,
1503
+ ..._(e)
1504
+ });
1505
+ function Y(r) {
1506
+ if (r instanceof k) {
1507
+ const e = {};
1508
+ for (const t in r.shape) {
1509
+ const n = r.shape[t];
1510
+ e[t] = j.create(Y(n));
1511
+ }
1512
+ return new k({
1513
+ ...r._def,
1514
+ shape: () => e
1515
+ });
1516
+ } else return r instanceof R ? new R({
1517
+ ...r._def,
1518
+ type: Y(r.element)
1519
+ }) : r instanceof j ? j.create(Y(r.unwrap())) : r instanceof q ? q.create(Y(r.unwrap())) : r instanceof M ? M.create(r.items.map((e) => Y(e))) : r;
1520
+ }
1521
+ class k extends v {
1522
+ constructor() {
1523
+ super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1524
+ }
1525
+ _getCached() {
1526
+ if (this._cached !== null)
1527
+ return this._cached;
1528
+ const e = this._def.shape(), t = x.objectKeys(e);
1529
+ return this._cached = { shape: e, keys: t };
1530
+ }
1531
+ _parse(e) {
1532
+ if (this._getType(e) !== f.object) {
1533
+ const c = this._getOrReturnCtx(e);
1534
+ return l(c, {
1535
+ code: d.invalid_type,
1536
+ expected: f.object,
1537
+ received: c.parsedType
1538
+ }), p;
1539
+ }
1540
+ const { status: n, ctx: s } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
1541
+ if (!(this._def.catchall instanceof z && this._def.unknownKeys === "strip"))
1542
+ for (const c in s.data)
1543
+ i.includes(c) || o.push(c);
1544
+ const u = [];
1545
+ for (const c of i) {
1546
+ const y = a[c], O = s.data[c];
1547
+ u.push({
1548
+ key: { status: "valid", value: c },
1549
+ value: y._parse(new A(s, O, s.path, c)),
1550
+ alwaysSet: c in s.data
1551
+ });
1552
+ }
1553
+ if (this._def.catchall instanceof z) {
1554
+ const c = this._def.unknownKeys;
1555
+ if (c === "passthrough")
1556
+ for (const y of o)
1557
+ u.push({
1558
+ key: { status: "valid", value: y },
1559
+ value: { status: "valid", value: s.data[y] }
1560
+ });
1561
+ else if (c === "strict")
1562
+ o.length > 0 && (l(s, {
1563
+ code: d.unrecognized_keys,
1564
+ keys: o
1565
+ }), n.dirty());
1566
+ else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1567
+ } else {
1568
+ const c = this._def.catchall;
1569
+ for (const y of o) {
1570
+ const O = s.data[y];
1571
+ u.push({
1572
+ key: { status: "valid", value: y },
1573
+ value: c._parse(
1574
+ new A(s, O, s.path, y)
1575
+ //, ctx.child(key), value, getParsedType(value)
1576
+ ),
1577
+ alwaysSet: y in s.data
1578
+ });
1579
+ }
1580
+ }
1581
+ return s.common.async ? Promise.resolve().then(async () => {
1582
+ const c = [];
1583
+ for (const y of u) {
1584
+ const O = await y.key, Te = await y.value;
1585
+ c.push({
1586
+ key: O,
1587
+ value: Te,
1588
+ alwaysSet: y.alwaysSet
1589
+ });
1590
+ }
1591
+ return c;
1592
+ }).then((c) => Z.mergeObjectSync(n, c)) : Z.mergeObjectSync(n, u);
1593
+ }
1594
+ get shape() {
1595
+ return this._def.shape();
1596
+ }
1597
+ strict(e) {
1598
+ return h.errToObj, new k({
1599
+ ...this._def,
1600
+ unknownKeys: "strict",
1601
+ ...e !== void 0 ? {
1602
+ errorMap: (t, n) => {
1603
+ var s, a, i, o;
1604
+ const u = (i = (a = (s = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(s, t, n).message) !== null && i !== void 0 ? i : n.defaultError;
1605
+ return t.code === "unrecognized_keys" ? {
1606
+ message: (o = h.errToObj(e).message) !== null && o !== void 0 ? o : u
1607
+ } : {
1608
+ message: u
1609
+ };
1610
+ }
1611
+ } : {}
1612
+ });
1613
+ }
1614
+ strip() {
1615
+ return new k({
1616
+ ...this._def,
1617
+ unknownKeys: "strip"
1618
+ });
1619
+ }
1620
+ passthrough() {
1621
+ return new k({
1622
+ ...this._def,
1623
+ unknownKeys: "passthrough"
1624
+ });
1625
+ }
1626
+ // const AugmentFactory =
1627
+ // <Def extends ZodObjectDef>(def: Def) =>
1628
+ // <Augmentation extends ZodRawShape>(
1629
+ // augmentation: Augmentation
1630
+ // ): ZodObject<
1631
+ // extendShape<ReturnType<Def["shape"]>, Augmentation>,
1632
+ // Def["unknownKeys"],
1633
+ // Def["catchall"]
1634
+ // > => {
1635
+ // return new ZodObject({
1636
+ // ...def,
1637
+ // shape: () => ({
1638
+ // ...def.shape(),
1639
+ // ...augmentation,
1640
+ // }),
1641
+ // }) as any;
1642
+ // };
1643
+ extend(e) {
1644
+ return new k({
1645
+ ...this._def,
1646
+ shape: () => ({
1647
+ ...this._def.shape(),
1648
+ ...e
1649
+ })
1650
+ });
1651
+ }
1652
+ /**
1653
+ * Prior to zod@1.0.12 there was a bug in the
1654
+ * inferred type of merged objects. Please
1655
+ * upgrade if you are experiencing issues.
1656
+ */
1657
+ merge(e) {
1658
+ return new k({
1659
+ unknownKeys: e._def.unknownKeys,
1660
+ catchall: e._def.catchall,
1661
+ shape: () => ({
1662
+ ...this._def.shape(),
1663
+ ...e._def.shape()
1664
+ }),
1665
+ typeName: m.ZodObject
1666
+ });
1667
+ }
1668
+ // merge<
1669
+ // Incoming extends AnyZodObject,
1670
+ // Augmentation extends Incoming["shape"],
1671
+ // NewOutput extends {
1672
+ // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1673
+ // ? Augmentation[k]["_output"]
1674
+ // : k extends keyof Output
1675
+ // ? Output[k]
1676
+ // : never;
1677
+ // },
1678
+ // NewInput extends {
1679
+ // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1680
+ // ? Augmentation[k]["_input"]
1681
+ // : k extends keyof Input
1682
+ // ? Input[k]
1683
+ // : never;
1684
+ // }
1685
+ // >(
1686
+ // merging: Incoming
1687
+ // ): ZodObject<
1688
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1689
+ // Incoming["_def"]["unknownKeys"],
1690
+ // Incoming["_def"]["catchall"],
1691
+ // NewOutput,
1692
+ // NewInput
1693
+ // > {
1694
+ // const merged: any = new ZodObject({
1695
+ // unknownKeys: merging._def.unknownKeys,
1696
+ // catchall: merging._def.catchall,
1697
+ // shape: () =>
1698
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1699
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
1700
+ // }) as any;
1701
+ // return merged;
1702
+ // }
1703
+ setKey(e, t) {
1704
+ return this.augment({ [e]: t });
1705
+ }
1706
+ // merge<Incoming extends AnyZodObject>(
1707
+ // merging: Incoming
1708
+ // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
1709
+ // ZodObject<
1710
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1711
+ // Incoming["_def"]["unknownKeys"],
1712
+ // Incoming["_def"]["catchall"]
1713
+ // > {
1714
+ // // const mergedShape = objectUtil.mergeShapes(
1715
+ // // this._def.shape(),
1716
+ // // merging._def.shape()
1717
+ // // );
1718
+ // const merged: any = new ZodObject({
1719
+ // unknownKeys: merging._def.unknownKeys,
1720
+ // catchall: merging._def.catchall,
1721
+ // shape: () =>
1722
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1723
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
1724
+ // }) as any;
1725
+ // return merged;
1726
+ // }
1727
+ catchall(e) {
1728
+ return new k({
1729
+ ...this._def,
1730
+ catchall: e
1731
+ });
1732
+ }
1733
+ pick(e) {
1734
+ const t = {};
1735
+ return x.objectKeys(e).forEach((n) => {
1736
+ e[n] && this.shape[n] && (t[n] = this.shape[n]);
1737
+ }), new k({
1738
+ ...this._def,
1739
+ shape: () => t
1740
+ });
1741
+ }
1742
+ omit(e) {
1743
+ const t = {};
1744
+ return x.objectKeys(this.shape).forEach((n) => {
1745
+ e[n] || (t[n] = this.shape[n]);
1746
+ }), new k({
1747
+ ...this._def,
1748
+ shape: () => t
1749
+ });
1750
+ }
1751
+ /**
1752
+ * @deprecated
1753
+ */
1754
+ deepPartial() {
1755
+ return Y(this);
1756
+ }
1757
+ partial(e) {
1758
+ const t = {};
1759
+ return x.objectKeys(this.shape).forEach((n) => {
1760
+ const s = this.shape[n];
1761
+ e && !e[n] ? t[n] = s : t[n] = s.optional();
1762
+ }), new k({
1763
+ ...this._def,
1764
+ shape: () => t
1765
+ });
1766
+ }
1767
+ required(e) {
1768
+ const t = {};
1769
+ return x.objectKeys(this.shape).forEach((n) => {
1770
+ if (e && !e[n])
1771
+ t[n] = this.shape[n];
1772
+ else {
1773
+ let a = this.shape[n];
1774
+ for (; a instanceof j; )
1775
+ a = a._def.innerType;
1776
+ t[n] = a;
1777
+ }
1778
+ }), new k({
1779
+ ...this._def,
1780
+ shape: () => t
1781
+ });
1782
+ }
1783
+ keyof() {
1784
+ return Ve(x.objectKeys(this.shape));
1785
+ }
1786
+ }
1787
+ k.create = (r, e) => new k({
1788
+ shape: () => r,
1789
+ unknownKeys: "strip",
1790
+ catchall: z.create(),
1791
+ typeName: m.ZodObject,
1792
+ ..._(e)
1793
+ });
1794
+ k.strictCreate = (r, e) => new k({
1795
+ shape: () => r,
1796
+ unknownKeys: "strict",
1797
+ catchall: z.create(),
1798
+ typeName: m.ZodObject,
1799
+ ..._(e)
1800
+ });
1801
+ k.lazycreate = (r, e) => new k({
1802
+ shape: r,
1803
+ unknownKeys: "strip",
1804
+ catchall: z.create(),
1805
+ typeName: m.ZodObject,
1806
+ ..._(e)
1807
+ });
1808
+ class ae extends v {
1809
+ _parse(e) {
1810
+ const { ctx: t } = this._processInputParams(e), n = this._def.options;
1811
+ function s(a) {
1812
+ for (const o of a)
1813
+ if (o.result.status === "valid")
1814
+ return o.result;
1815
+ for (const o of a)
1816
+ if (o.result.status === "dirty")
1817
+ return t.common.issues.push(...o.ctx.common.issues), o.result;
1818
+ const i = a.map((o) => new N(o.ctx.common.issues));
1819
+ return l(t, {
1820
+ code: d.invalid_union,
1821
+ unionErrors: i
1822
+ }), p;
1823
+ }
1824
+ if (t.common.async)
1825
+ return Promise.all(n.map(async (a) => {
1826
+ const i = {
1827
+ ...t,
1828
+ common: {
1829
+ ...t.common,
1830
+ issues: []
1831
+ },
1832
+ parent: null
1833
+ };
1834
+ return {
1835
+ result: await a._parseAsync({
1836
+ data: t.data,
1837
+ path: t.path,
1838
+ parent: i
1839
+ }),
1840
+ ctx: i
1841
+ };
1842
+ })).then(s);
1843
+ {
1844
+ let a;
1845
+ const i = [];
1846
+ for (const u of n) {
1847
+ const c = {
1848
+ ...t,
1849
+ common: {
1850
+ ...t.common,
1851
+ issues: []
1852
+ },
1853
+ parent: null
1854
+ }, y = u._parseSync({
1855
+ data: t.data,
1856
+ path: t.path,
1857
+ parent: c
1858
+ });
1859
+ if (y.status === "valid")
1860
+ return y;
1861
+ y.status === "dirty" && !a && (a = { result: y, ctx: c }), c.common.issues.length && i.push(c.common.issues);
1862
+ }
1863
+ if (a)
1864
+ return t.common.issues.push(...a.ctx.common.issues), a.result;
1865
+ const o = i.map((u) => new N(u));
1866
+ return l(t, {
1867
+ code: d.invalid_union,
1868
+ unionErrors: o
1869
+ }), p;
1870
+ }
1871
+ }
1872
+ get options() {
1873
+ return this._def.options;
1874
+ }
1875
+ }
1876
+ ae.create = (r, e) => new ae({
1877
+ options: r,
1878
+ typeName: m.ZodUnion,
1879
+ ..._(e)
1880
+ });
1881
+ const $ = (r) => r instanceof de ? $(r.schema) : r instanceof I ? $(r.innerType()) : r instanceof ce ? [r.value] : r instanceof L ? r.options : r instanceof ue ? x.objectValues(r.enum) : r instanceof le ? $(r._def.innerType) : r instanceof ne ? [void 0] : r instanceof se ? [null] : r instanceof j ? [void 0, ...$(r.unwrap())] : r instanceof q ? [null, ...$(r.unwrap())] : r instanceof Ee || r instanceof he ? $(r.unwrap()) : r instanceof fe ? $(r._def.innerType) : [];
1882
+ class we extends v {
1883
+ _parse(e) {
1884
+ const { ctx: t } = this._processInputParams(e);
1885
+ if (t.parsedType !== f.object)
1886
+ return l(t, {
1887
+ code: d.invalid_type,
1888
+ expected: f.object,
1889
+ received: t.parsedType
1890
+ }), p;
1891
+ const n = this.discriminator, s = t.data[n], a = this.optionsMap.get(s);
1892
+ return a ? t.common.async ? a._parseAsync({
1893
+ data: t.data,
1894
+ path: t.path,
1895
+ parent: t
1896
+ }) : a._parseSync({
1897
+ data: t.data,
1898
+ path: t.path,
1899
+ parent: t
1900
+ }) : (l(t, {
1901
+ code: d.invalid_union_discriminator,
1902
+ options: Array.from(this.optionsMap.keys()),
1903
+ path: [n]
1904
+ }), p);
1905
+ }
1906
+ get discriminator() {
1907
+ return this._def.discriminator;
1908
+ }
1909
+ get options() {
1910
+ return this._def.options;
1911
+ }
1912
+ get optionsMap() {
1913
+ return this._def.optionsMap;
1914
+ }
1915
+ /**
1916
+ * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
1917
+ * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
1918
+ * have a different value for each object in the union.
1919
+ * @param discriminator the name of the discriminator property
1920
+ * @param types an array of object schemas
1921
+ * @param params
1922
+ */
1923
+ static create(e, t, n) {
1924
+ const s = /* @__PURE__ */ new Map();
1925
+ for (const a of t) {
1926
+ const i = $(a.shape[e]);
1927
+ if (!i.length)
1928
+ throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
1929
+ for (const o of i) {
1930
+ if (s.has(o))
1931
+ throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);
1932
+ s.set(o, a);
1933
+ }
1934
+ }
1935
+ return new we({
1936
+ typeName: m.ZodDiscriminatedUnion,
1937
+ discriminator: e,
1938
+ options: t,
1939
+ optionsMap: s,
1940
+ ..._(n)
1941
+ });
1942
+ }
1943
+ }
1944
+ function Ne(r, e) {
1945
+ const t = P(r), n = P(e);
1946
+ if (r === e)
1947
+ return { valid: !0, data: r };
1948
+ if (t === f.object && n === f.object) {
1949
+ const s = x.objectKeys(e), a = x.objectKeys(r).filter((o) => s.indexOf(o) !== -1), i = { ...r, ...e };
1950
+ for (const o of a) {
1951
+ const u = Ne(r[o], e[o]);
1952
+ if (!u.valid)
1953
+ return { valid: !1 };
1954
+ i[o] = u.data;
1955
+ }
1956
+ return { valid: !0, data: i };
1957
+ } else if (t === f.array && n === f.array) {
1958
+ if (r.length !== e.length)
1959
+ return { valid: !1 };
1960
+ const s = [];
1961
+ for (let a = 0; a < r.length; a++) {
1962
+ const i = r[a], o = e[a], u = Ne(i, o);
1963
+ if (!u.valid)
1964
+ return { valid: !1 };
1965
+ s.push(u.data);
1966
+ }
1967
+ return { valid: !0, data: s };
1968
+ } else return t === f.date && n === f.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
1969
+ }
1970
+ class ie extends v {
1971
+ _parse(e) {
1972
+ const { status: t, ctx: n } = this._processInputParams(e), s = (a, i) => {
1973
+ if (Ce(a) || Ce(i))
1974
+ return p;
1975
+ const o = Ne(a.value, i.value);
1976
+ return o.valid ? ((Oe(a) || Oe(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(n, {
1977
+ code: d.invalid_intersection_types
1978
+ }), p);
1979
+ };
1980
+ return n.common.async ? Promise.all([
1981
+ this._def.left._parseAsync({
1982
+ data: n.data,
1983
+ path: n.path,
1984
+ parent: n
1985
+ }),
1986
+ this._def.right._parseAsync({
1987
+ data: n.data,
1988
+ path: n.path,
1989
+ parent: n
1990
+ })
1991
+ ]).then(([a, i]) => s(a, i)) : s(this._def.left._parseSync({
1992
+ data: n.data,
1993
+ path: n.path,
1994
+ parent: n
1995
+ }), this._def.right._parseSync({
1996
+ data: n.data,
1997
+ path: n.path,
1998
+ parent: n
1999
+ }));
2000
+ }
2001
+ }
2002
+ ie.create = (r, e, t) => new ie({
2003
+ left: r,
2004
+ right: e,
2005
+ typeName: m.ZodIntersection,
2006
+ ..._(t)
2007
+ });
2008
+ class M extends v {
2009
+ _parse(e) {
2010
+ const { status: t, ctx: n } = this._processInputParams(e);
2011
+ if (n.parsedType !== f.array)
2012
+ return l(n, {
2013
+ code: d.invalid_type,
2014
+ expected: f.array,
2015
+ received: n.parsedType
2016
+ }), p;
2017
+ if (n.data.length < this._def.items.length)
2018
+ return l(n, {
2019
+ code: d.too_small,
2020
+ minimum: this._def.items.length,
2021
+ inclusive: !0,
2022
+ exact: !1,
2023
+ type: "array"
2024
+ }), p;
2025
+ !this._def.rest && n.data.length > this._def.items.length && (l(n, {
2026
+ code: d.too_big,
2027
+ maximum: this._def.items.length,
2028
+ inclusive: !0,
2029
+ exact: !1,
2030
+ type: "array"
2031
+ }), t.dirty());
2032
+ const a = [...n.data].map((i, o) => {
2033
+ const u = this._def.items[o] || this._def.rest;
2034
+ return u ? u._parse(new A(n, i, n.path, o)) : null;
2035
+ }).filter((i) => !!i);
2036
+ return n.common.async ? Promise.all(a).then((i) => Z.mergeArray(t, i)) : Z.mergeArray(t, a);
2037
+ }
2038
+ get items() {
2039
+ return this._def.items;
2040
+ }
2041
+ rest(e) {
2042
+ return new M({
2043
+ ...this._def,
2044
+ rest: e
2045
+ });
2046
+ }
2047
+ }
2048
+ M.create = (r, e) => {
2049
+ if (!Array.isArray(r))
2050
+ throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2051
+ return new M({
2052
+ items: r,
2053
+ typeName: m.ZodTuple,
2054
+ rest: null,
2055
+ ..._(e)
2056
+ });
2057
+ };
2058
+ class oe extends v {
2059
+ get keySchema() {
2060
+ return this._def.keyType;
2061
+ }
2062
+ get valueSchema() {
2063
+ return this._def.valueType;
2064
+ }
2065
+ _parse(e) {
2066
+ const { status: t, ctx: n } = this._processInputParams(e);
2067
+ if (n.parsedType !== f.object)
2068
+ return l(n, {
2069
+ code: d.invalid_type,
2070
+ expected: f.object,
2071
+ received: n.parsedType
2072
+ }), p;
2073
+ const s = [], a = this._def.keyType, i = this._def.valueType;
2074
+ for (const o in n.data)
2075
+ s.push({
2076
+ key: a._parse(new A(n, o, n.path, o)),
2077
+ value: i._parse(new A(n, n.data[o], n.path, o)),
2078
+ alwaysSet: o in n.data
2079
+ });
2080
+ return n.common.async ? Z.mergeObjectAsync(t, s) : Z.mergeObjectSync(t, s);
2081
+ }
2082
+ get element() {
2083
+ return this._def.valueType;
2084
+ }
2085
+ static create(e, t, n) {
2086
+ return t instanceof v ? new oe({
2087
+ keyType: e,
2088
+ valueType: t,
2089
+ typeName: m.ZodRecord,
2090
+ ..._(n)
2091
+ }) : new oe({
2092
+ keyType: E.create(),
2093
+ valueType: e,
2094
+ typeName: m.ZodRecord,
2095
+ ..._(t)
2096
+ });
2097
+ }
2098
+ }
2099
+ class ke extends v {
2100
+ get keySchema() {
2101
+ return this._def.keyType;
2102
+ }
2103
+ get valueSchema() {
2104
+ return this._def.valueType;
2105
+ }
2106
+ _parse(e) {
2107
+ const { status: t, ctx: n } = this._processInputParams(e);
2108
+ if (n.parsedType !== f.map)
2109
+ return l(n, {
2110
+ code: d.invalid_type,
2111
+ expected: f.map,
2112
+ received: n.parsedType
2113
+ }), p;
2114
+ const s = this._def.keyType, a = this._def.valueType, i = [...n.data.entries()].map(([o, u], c) => ({
2115
+ key: s._parse(new A(n, o, n.path, [c, "key"])),
2116
+ value: a._parse(new A(n, u, n.path, [c, "value"]))
2117
+ }));
2118
+ if (n.common.async) {
2119
+ const o = /* @__PURE__ */ new Map();
2120
+ return Promise.resolve().then(async () => {
2121
+ for (const u of i) {
2122
+ const c = await u.key, y = await u.value;
2123
+ if (c.status === "aborted" || y.status === "aborted")
2124
+ return p;
2125
+ (c.status === "dirty" || y.status === "dirty") && t.dirty(), o.set(c.value, y.value);
2126
+ }
2127
+ return { status: t.value, value: o };
2128
+ });
2129
+ } else {
2130
+ const o = /* @__PURE__ */ new Map();
2131
+ for (const u of i) {
2132
+ const c = u.key, y = u.value;
2133
+ if (c.status === "aborted" || y.status === "aborted")
2134
+ return p;
2135
+ (c.status === "dirty" || y.status === "dirty") && t.dirty(), o.set(c.value, y.value);
2136
+ }
2137
+ return { status: t.value, value: o };
2138
+ }
2139
+ }
2140
+ }
2141
+ ke.create = (r, e, t) => new ke({
2142
+ valueType: e,
2143
+ keyType: r,
2144
+ typeName: m.ZodMap,
2145
+ ..._(t)
2146
+ });
2147
+ class W extends v {
2148
+ _parse(e) {
2149
+ const { status: t, ctx: n } = this._processInputParams(e);
2150
+ if (n.parsedType !== f.set)
2151
+ return l(n, {
2152
+ code: d.invalid_type,
2153
+ expected: f.set,
2154
+ received: n.parsedType
2155
+ }), p;
2156
+ const s = this._def;
2157
+ s.minSize !== null && n.data.size < s.minSize.value && (l(n, {
2158
+ code: d.too_small,
2159
+ minimum: s.minSize.value,
2160
+ type: "set",
2161
+ inclusive: !0,
2162
+ exact: !1,
2163
+ message: s.minSize.message
2164
+ }), t.dirty()), s.maxSize !== null && n.data.size > s.maxSize.value && (l(n, {
2165
+ code: d.too_big,
2166
+ maximum: s.maxSize.value,
2167
+ type: "set",
2168
+ inclusive: !0,
2169
+ exact: !1,
2170
+ message: s.maxSize.message
2171
+ }), t.dirty());
2172
+ const a = this._def.valueType;
2173
+ function i(u) {
2174
+ const c = /* @__PURE__ */ new Set();
2175
+ for (const y of u) {
2176
+ if (y.status === "aborted")
2177
+ return p;
2178
+ y.status === "dirty" && t.dirty(), c.add(y.value);
2179
+ }
2180
+ return { status: t.value, value: c };
2181
+ }
2182
+ const o = [...n.data.values()].map((u, c) => a._parse(new A(n, u, n.path, c)));
2183
+ return n.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
2184
+ }
2185
+ min(e, t) {
2186
+ return new W({
2187
+ ...this._def,
2188
+ minSize: { value: e, message: h.toString(t) }
2189
+ });
2190
+ }
2191
+ max(e, t) {
2192
+ return new W({
2193
+ ...this._def,
2194
+ maxSize: { value: e, message: h.toString(t) }
2195
+ });
2196
+ }
2197
+ size(e, t) {
2198
+ return this.min(e, t).max(e, t);
2199
+ }
2200
+ nonempty(e) {
2201
+ return this.min(1, e);
2202
+ }
2203
+ }
2204
+ W.create = (r, e) => new W({
2205
+ valueType: r,
2206
+ minSize: null,
2207
+ maxSize: null,
2208
+ typeName: m.ZodSet,
2209
+ ..._(e)
2210
+ });
2211
+ class G extends v {
2212
+ constructor() {
2213
+ super(...arguments), this.validate = this.implement;
2214
+ }
2215
+ _parse(e) {
2216
+ const { ctx: t } = this._processInputParams(e);
2217
+ if (t.parsedType !== f.function)
2218
+ return l(t, {
2219
+ code: d.invalid_type,
2220
+ expected: f.function,
2221
+ received: t.parsedType
2222
+ }), p;
2223
+ function n(o, u) {
2224
+ return _e({
2225
+ data: o,
2226
+ path: t.path,
2227
+ errorMaps: [
2228
+ t.common.contextualErrorMap,
2229
+ t.schemaErrorMap,
2230
+ ye(),
2231
+ H
2232
+ ].filter((c) => !!c),
2233
+ issueData: {
2234
+ code: d.invalid_arguments,
2235
+ argumentsError: u
2236
+ }
2237
+ });
2238
+ }
2239
+ function s(o, u) {
2240
+ return _e({
2241
+ data: o,
2242
+ path: t.path,
2243
+ errorMaps: [
2244
+ t.common.contextualErrorMap,
2245
+ t.schemaErrorMap,
2246
+ ye(),
2247
+ H
2248
+ ].filter((c) => !!c),
2249
+ issueData: {
2250
+ code: d.invalid_return_type,
2251
+ returnTypeError: u
2252
+ }
2253
+ });
2254
+ }
2255
+ const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
2256
+ if (this._def.returns instanceof K) {
2257
+ const o = this;
2258
+ return S(async function(...u) {
2259
+ const c = new N([]), y = await o._def.args.parseAsync(u, a).catch((pe) => {
2260
+ throw c.addIssue(n(u, pe)), c;
2261
+ }), O = await Reflect.apply(i, this, y);
2262
+ return await o._def.returns._def.type.parseAsync(O, a).catch((pe) => {
2263
+ throw c.addIssue(s(O, pe)), c;
2264
+ });
2265
+ });
2266
+ } else {
2267
+ const o = this;
2268
+ return S(function(...u) {
2269
+ const c = o._def.args.safeParse(u, a);
2270
+ if (!c.success)
2271
+ throw new N([n(u, c.error)]);
2272
+ const y = Reflect.apply(i, this, c.data), O = o._def.returns.safeParse(y, a);
2273
+ if (!O.success)
2274
+ throw new N([s(y, O.error)]);
2275
+ return O.data;
2276
+ });
2277
+ }
2278
+ }
2279
+ parameters() {
2280
+ return this._def.args;
2281
+ }
2282
+ returnType() {
2283
+ return this._def.returns;
2284
+ }
2285
+ args(...e) {
2286
+ return new G({
2287
+ ...this._def,
2288
+ args: M.create(e).rest(U.create())
2289
+ });
2290
+ }
2291
+ returns(e) {
2292
+ return new G({
2293
+ ...this._def,
2294
+ returns: e
2295
+ });
2296
+ }
2297
+ implement(e) {
2298
+ return this.parse(e);
2299
+ }
2300
+ strictImplement(e) {
2301
+ return this.parse(e);
2302
+ }
2303
+ static create(e, t, n) {
2304
+ return new G({
2305
+ args: e || M.create([]).rest(U.create()),
2306
+ returns: t || U.create(),
2307
+ typeName: m.ZodFunction,
2308
+ ..._(n)
2309
+ });
2310
+ }
2311
+ }
2312
+ class de extends v {
2313
+ get schema() {
2314
+ return this._def.getter();
2315
+ }
2316
+ _parse(e) {
2317
+ const { ctx: t } = this._processInputParams(e);
2318
+ return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2319
+ }
2320
+ }
2321
+ de.create = (r, e) => new de({
2322
+ getter: r,
2323
+ typeName: m.ZodLazy,
2324
+ ..._(e)
2325
+ });
2326
+ class ce extends v {
2327
+ _parse(e) {
2328
+ if (e.data !== this._def.value) {
2329
+ const t = this._getOrReturnCtx(e);
2330
+ return l(t, {
2331
+ received: t.data,
2332
+ code: d.invalid_literal,
2333
+ expected: this._def.value
2334
+ }), p;
2335
+ }
2336
+ return { status: "valid", value: e.data };
2337
+ }
2338
+ get value() {
2339
+ return this._def.value;
2340
+ }
2341
+ }
2342
+ ce.create = (r, e) => new ce({
2343
+ value: r,
2344
+ typeName: m.ZodLiteral,
2345
+ ..._(e)
2346
+ });
2347
+ function Ve(r, e) {
2348
+ return new L({
2349
+ values: r,
2350
+ typeName: m.ZodEnum,
2351
+ ..._(e)
2352
+ });
2353
+ }
2354
+ class L extends v {
2355
+ constructor() {
2356
+ super(...arguments), Q.set(this, void 0);
2357
+ }
2358
+ _parse(e) {
2359
+ if (typeof e.data != "string") {
2360
+ const t = this._getOrReturnCtx(e), n = this._def.values;
2361
+ return l(t, {
2362
+ expected: x.joinValues(n),
2363
+ received: t.parsedType,
2364
+ code: d.invalid_type
2365
+ }), p;
2366
+ }
2367
+ if (ve(this, Q) || Me(this, Q, new Set(this._def.values)), !ve(this, Q).has(e.data)) {
2368
+ const t = this._getOrReturnCtx(e), n = this._def.values;
2369
+ return l(t, {
2370
+ received: t.data,
2371
+ code: d.invalid_enum_value,
2372
+ options: n
2373
+ }), p;
2374
+ }
2375
+ return S(e.data);
2376
+ }
2377
+ get options() {
2378
+ return this._def.values;
2379
+ }
2380
+ get enum() {
2381
+ const e = {};
2382
+ for (const t of this._def.values)
2383
+ e[t] = t;
2384
+ return e;
2385
+ }
2386
+ get Values() {
2387
+ const e = {};
2388
+ for (const t of this._def.values)
2389
+ e[t] = t;
2390
+ return e;
2391
+ }
2392
+ get Enum() {
2393
+ const e = {};
2394
+ for (const t of this._def.values)
2395
+ e[t] = t;
2396
+ return e;
2397
+ }
2398
+ extract(e, t = this._def) {
2399
+ return L.create(e, {
2400
+ ...this._def,
2401
+ ...t
2402
+ });
2403
+ }
2404
+ exclude(e, t = this._def) {
2405
+ return L.create(this.options.filter((n) => !e.includes(n)), {
2406
+ ...this._def,
2407
+ ...t
2408
+ });
2409
+ }
2410
+ }
2411
+ Q = /* @__PURE__ */ new WeakMap();
2412
+ L.create = Ve;
2413
+ class ue extends v {
2414
+ constructor() {
2415
+ super(...arguments), F.set(this, void 0);
2416
+ }
2417
+ _parse(e) {
2418
+ const t = x.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2419
+ if (n.parsedType !== f.string && n.parsedType !== f.number) {
2420
+ const s = x.objectValues(t);
2421
+ return l(n, {
2422
+ expected: x.joinValues(s),
2423
+ received: n.parsedType,
2424
+ code: d.invalid_type
2425
+ }), p;
2426
+ }
2427
+ if (ve(this, F) || Me(this, F, new Set(x.getValidEnumValues(this._def.values))), !ve(this, F).has(e.data)) {
2428
+ const s = x.objectValues(t);
2429
+ return l(n, {
2430
+ received: n.data,
2431
+ code: d.invalid_enum_value,
2432
+ options: s
2433
+ }), p;
2434
+ }
2435
+ return S(e.data);
2436
+ }
2437
+ get enum() {
2438
+ return this._def.values;
2439
+ }
2440
+ }
2441
+ F = /* @__PURE__ */ new WeakMap();
2442
+ ue.create = (r, e) => new ue({
2443
+ values: r,
2444
+ typeName: m.ZodNativeEnum,
2445
+ ..._(e)
2446
+ });
2447
+ class K extends v {
2448
+ unwrap() {
2449
+ return this._def.type;
2450
+ }
2451
+ _parse(e) {
2452
+ const { ctx: t } = this._processInputParams(e);
2453
+ if (t.parsedType !== f.promise && t.common.async === !1)
2454
+ return l(t, {
2455
+ code: d.invalid_type,
2456
+ expected: f.promise,
2457
+ received: t.parsedType
2458
+ }), p;
2459
+ const n = t.parsedType === f.promise ? t.data : Promise.resolve(t.data);
2460
+ return S(n.then((s) => this._def.type.parseAsync(s, {
2461
+ path: t.path,
2462
+ errorMap: t.common.contextualErrorMap
2463
+ })));
2464
+ }
2465
+ }
2466
+ K.create = (r, e) => new K({
2467
+ type: r,
2468
+ typeName: m.ZodPromise,
2469
+ ..._(e)
2470
+ });
2471
+ class I extends v {
2472
+ innerType() {
2473
+ return this._def.schema;
2474
+ }
2475
+ sourceType() {
2476
+ return this._def.schema._def.typeName === m.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2477
+ }
2478
+ _parse(e) {
2479
+ const { status: t, ctx: n } = this._processInputParams(e), s = this._def.effect || null, a = {
2480
+ addIssue: (i) => {
2481
+ l(n, i), i.fatal ? t.abort() : t.dirty();
2482
+ },
2483
+ get path() {
2484
+ return n.path;
2485
+ }
2486
+ };
2487
+ if (a.addIssue = a.addIssue.bind(a), s.type === "preprocess") {
2488
+ const i = s.transform(n.data, a);
2489
+ if (n.common.async)
2490
+ return Promise.resolve(i).then(async (o) => {
2491
+ if (t.value === "aborted")
2492
+ return p;
2493
+ const u = await this._def.schema._parseAsync({
2494
+ data: o,
2495
+ path: n.path,
2496
+ parent: n
2497
+ });
2498
+ return u.status === "aborted" ? p : u.status === "dirty" || t.value === "dirty" ? J(u.value) : u;
2499
+ });
2500
+ {
2501
+ if (t.value === "aborted")
2502
+ return p;
2503
+ const o = this._def.schema._parseSync({
2504
+ data: i,
2505
+ path: n.path,
2506
+ parent: n
2507
+ });
2508
+ return o.status === "aborted" ? p : o.status === "dirty" || t.value === "dirty" ? J(o.value) : o;
2509
+ }
2510
+ }
2511
+ if (s.type === "refinement") {
2512
+ const i = (o) => {
2513
+ const u = s.refinement(o, a);
2514
+ if (n.common.async)
2515
+ return Promise.resolve(u);
2516
+ if (u instanceof Promise)
2517
+ throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2518
+ return o;
2519
+ };
2520
+ if (n.common.async === !1) {
2521
+ const o = this._def.schema._parseSync({
2522
+ data: n.data,
2523
+ path: n.path,
2524
+ parent: n
2525
+ });
2526
+ return o.status === "aborted" ? p : (o.status === "dirty" && t.dirty(), i(o.value), { status: t.value, value: o.value });
2527
+ } else
2528
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((o) => o.status === "aborted" ? p : (o.status === "dirty" && t.dirty(), i(o.value).then(() => ({ status: t.value, value: o.value }))));
2529
+ }
2530
+ if (s.type === "transform")
2531
+ if (n.common.async === !1) {
2532
+ const i = this._def.schema._parseSync({
2533
+ data: n.data,
2534
+ path: n.path,
2535
+ parent: n
2536
+ });
2537
+ if (!ee(i))
2538
+ return i;
2539
+ const o = s.transform(i.value, a);
2540
+ if (o instanceof Promise)
2541
+ throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2542
+ return { status: t.value, value: o };
2543
+ } else
2544
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ee(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
2545
+ x.assertNever(s);
2546
+ }
2547
+ }
2548
+ I.create = (r, e, t) => new I({
2549
+ schema: r,
2550
+ typeName: m.ZodEffects,
2551
+ effect: e,
2552
+ ..._(t)
2553
+ });
2554
+ I.createWithPreprocess = (r, e, t) => new I({
2555
+ schema: e,
2556
+ effect: { type: "preprocess", transform: r },
2557
+ typeName: m.ZodEffects,
2558
+ ..._(t)
2559
+ });
2560
+ class j extends v {
2561
+ _parse(e) {
2562
+ return this._getType(e) === f.undefined ? S(void 0) : this._def.innerType._parse(e);
2563
+ }
2564
+ unwrap() {
2565
+ return this._def.innerType;
2566
+ }
2567
+ }
2568
+ j.create = (r, e) => new j({
2569
+ innerType: r,
2570
+ typeName: m.ZodOptional,
2571
+ ..._(e)
2572
+ });
2573
+ class q extends v {
2574
+ _parse(e) {
2575
+ return this._getType(e) === f.null ? S(null) : this._def.innerType._parse(e);
2576
+ }
2577
+ unwrap() {
2578
+ return this._def.innerType;
2579
+ }
2580
+ }
2581
+ q.create = (r, e) => new q({
2582
+ innerType: r,
2583
+ typeName: m.ZodNullable,
2584
+ ..._(e)
2585
+ });
2586
+ class le extends v {
2587
+ _parse(e) {
2588
+ const { ctx: t } = this._processInputParams(e);
2589
+ let n = t.data;
2590
+ return t.parsedType === f.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
2591
+ data: n,
2592
+ path: t.path,
2593
+ parent: t
2594
+ });
2595
+ }
2596
+ removeDefault() {
2597
+ return this._def.innerType;
2598
+ }
2599
+ }
2600
+ le.create = (r, e) => new le({
2601
+ innerType: r,
2602
+ typeName: m.ZodDefault,
2603
+ defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2604
+ ..._(e)
2605
+ });
2606
+ class fe extends v {
2607
+ _parse(e) {
2608
+ const { ctx: t } = this._processInputParams(e), n = {
2609
+ ...t,
2610
+ common: {
2611
+ ...t.common,
2612
+ issues: []
2613
+ }
2614
+ }, s = this._def.innerType._parse({
2615
+ data: n.data,
2616
+ path: n.path,
2617
+ parent: {
2618
+ ...n
2619
+ }
2620
+ });
2621
+ return te(s) ? s.then((a) => ({
2622
+ status: "valid",
2623
+ value: a.status === "valid" ? a.value : this._def.catchValue({
2624
+ get error() {
2625
+ return new N(n.common.issues);
2626
+ },
2627
+ input: n.data
2628
+ })
2629
+ })) : {
2630
+ status: "valid",
2631
+ value: s.status === "valid" ? s.value : this._def.catchValue({
2632
+ get error() {
2633
+ return new N(n.common.issues);
2634
+ },
2635
+ input: n.data
2636
+ })
2637
+ };
2638
+ }
2639
+ removeCatch() {
2640
+ return this._def.innerType;
2641
+ }
2642
+ }
2643
+ fe.create = (r, e) => new fe({
2644
+ innerType: r,
2645
+ typeName: m.ZodCatch,
2646
+ catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2647
+ ..._(e)
2648
+ });
2649
+ class be extends v {
2650
+ _parse(e) {
2651
+ if (this._getType(e) !== f.nan) {
2652
+ const n = this._getOrReturnCtx(e);
2653
+ return l(n, {
2654
+ code: d.invalid_type,
2655
+ expected: f.nan,
2656
+ received: n.parsedType
2657
+ }), p;
2658
+ }
2659
+ return { status: "valid", value: e.data };
2660
+ }
2661
+ }
2662
+ be.create = (r) => new be({
2663
+ typeName: m.ZodNaN,
2664
+ ..._(r)
2665
+ });
2666
+ const yt = Symbol("zod_brand");
2667
+ class Ee extends v {
2668
+ _parse(e) {
2669
+ const { ctx: t } = this._processInputParams(e), n = t.data;
2670
+ return this._def.type._parse({
2671
+ data: n,
2672
+ path: t.path,
2673
+ parent: t
2674
+ });
2675
+ }
2676
+ unwrap() {
2677
+ return this._def.type;
2678
+ }
2679
+ }
2680
+ class me extends v {
2681
+ _parse(e) {
2682
+ const { status: t, ctx: n } = this._processInputParams(e);
2683
+ if (n.common.async)
2684
+ return (async () => {
2685
+ const a = await this._def.in._parseAsync({
2686
+ data: n.data,
2687
+ path: n.path,
2688
+ parent: n
2689
+ });
2690
+ return a.status === "aborted" ? p : a.status === "dirty" ? (t.dirty(), J(a.value)) : this._def.out._parseAsync({
2691
+ data: a.value,
2692
+ path: n.path,
2693
+ parent: n
2694
+ });
2695
+ })();
2696
+ {
2697
+ const s = this._def.in._parseSync({
2698
+ data: n.data,
2699
+ path: n.path,
2700
+ parent: n
2701
+ });
2702
+ return s.status === "aborted" ? p : s.status === "dirty" ? (t.dirty(), {
2703
+ status: "dirty",
2704
+ value: s.value
2705
+ }) : this._def.out._parseSync({
2706
+ data: s.value,
2707
+ path: n.path,
2708
+ parent: n
2709
+ });
2710
+ }
2711
+ }
2712
+ static create(e, t) {
2713
+ return new me({
2714
+ in: e,
2715
+ out: t,
2716
+ typeName: m.ZodPipeline
2717
+ });
2718
+ }
2719
+ }
2720
+ class he extends v {
2721
+ _parse(e) {
2722
+ const t = this._def.innerType._parse(e), n = (s) => (ee(s) && (s.value = Object.freeze(s.value)), s);
2723
+ return te(t) ? t.then((s) => n(s)) : n(t);
2724
+ }
2725
+ unwrap() {
2726
+ return this._def.innerType;
2727
+ }
2728
+ }
2729
+ he.create = (r, e) => new he({
2730
+ innerType: r,
2731
+ typeName: m.ZodReadonly,
2732
+ ..._(e)
2733
+ });
2734
+ function De(r, e = {}, t) {
2735
+ return r ? X.create().superRefine((n, s) => {
2736
+ var a, i;
2737
+ if (!r(n)) {
2738
+ 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;
2739
+ s.addIssue({ code: "custom", ...c, fatal: u });
2740
+ }
2741
+ }) : X.create();
2742
+ }
2743
+ const _t = {
2744
+ object: k.lazycreate
2745
+ };
2746
+ var m;
2747
+ (function(r) {
2748
+ r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2749
+ })(m || (m = {}));
2750
+ const vt = (r, e = {
2751
+ message: `Input not instance of ${r.name}`
2752
+ }) => De((t) => t instanceof r, e), Le = E.create, qe = V.create, gt = be.create, xt = D.create, Ue = re.create, kt = B.create, bt = ge.create, wt = ne.create, Tt = se.create, Zt = X.create, St = U.create, Ct = z.create, Ot = xe.create, Nt = R.create, Et = k.create, Rt = k.strictCreate, It = ae.create, jt = we.create, At = ie.create, Mt = M.create, $t = oe.create, zt = ke.create, Pt = W.create, Vt = G.create, Dt = de.create, Lt = ce.create, qt = L.create, Ut = ue.create, Bt = K.create, je = I.create, Wt = j.create, Yt = q.create, Jt = I.createWithPreprocess, Gt = me.create, Ht = () => Le().optional(), Xt = () => qe().optional(), Kt = () => Ue().optional(), Qt = {
2753
+ string: (r) => E.create({ ...r, coerce: !0 }),
2754
+ number: (r) => V.create({ ...r, coerce: !0 }),
2755
+ boolean: (r) => re.create({
2756
+ ...r,
2757
+ coerce: !0
2758
+ }),
2759
+ bigint: (r) => D.create({ ...r, coerce: !0 }),
2760
+ date: (r) => B.create({ ...r, coerce: !0 })
2761
+ }, Ft = p;
2762
+ var C = /* @__PURE__ */ Object.freeze({
2763
+ __proto__: null,
2764
+ defaultErrorMap: H,
2765
+ setErrorMap: Fe,
2766
+ getErrorMap: ye,
2767
+ makeIssue: _e,
2768
+ EMPTY_PATH: et,
2769
+ addIssueToContext: l,
2770
+ ParseStatus: Z,
2771
+ INVALID: p,
2772
+ DIRTY: J,
2773
+ OK: S,
2774
+ isAborted: Ce,
2775
+ isDirty: Oe,
2776
+ isValid: ee,
2777
+ isAsync: te,
2778
+ get util() {
2779
+ return x;
2780
+ },
2781
+ get objectUtil() {
2782
+ return Se;
2783
+ },
2784
+ ZodParsedType: f,
2785
+ getParsedType: P,
2786
+ ZodType: v,
2787
+ datetimeRegex: Pe,
2788
+ ZodString: E,
2789
+ ZodNumber: V,
2790
+ ZodBigInt: D,
2791
+ ZodBoolean: re,
2792
+ ZodDate: B,
2793
+ ZodSymbol: ge,
2794
+ ZodUndefined: ne,
2795
+ ZodNull: se,
2796
+ ZodAny: X,
2797
+ ZodUnknown: U,
2798
+ ZodNever: z,
2799
+ ZodVoid: xe,
2800
+ ZodArray: R,
2801
+ ZodObject: k,
2802
+ ZodUnion: ae,
2803
+ ZodDiscriminatedUnion: we,
2804
+ ZodIntersection: ie,
2805
+ ZodTuple: M,
2806
+ ZodRecord: oe,
2807
+ ZodMap: ke,
2808
+ ZodSet: W,
2809
+ ZodFunction: G,
2810
+ ZodLazy: de,
2811
+ ZodLiteral: ce,
2812
+ ZodEnum: L,
2813
+ ZodNativeEnum: ue,
2814
+ ZodPromise: K,
2815
+ ZodEffects: I,
2816
+ ZodTransformer: I,
2817
+ ZodOptional: j,
2818
+ ZodNullable: q,
2819
+ ZodDefault: le,
2820
+ ZodCatch: fe,
2821
+ ZodNaN: be,
2822
+ BRAND: yt,
2823
+ ZodBranded: Ee,
2824
+ ZodPipeline: me,
2825
+ ZodReadonly: he,
2826
+ custom: De,
2827
+ Schema: v,
2828
+ ZodSchema: v,
2829
+ late: _t,
2830
+ get ZodFirstPartyTypeKind() {
2831
+ return m;
2832
+ },
2833
+ coerce: Qt,
2834
+ any: Zt,
2835
+ array: Nt,
2836
+ bigint: xt,
2837
+ boolean: Ue,
2838
+ date: kt,
2839
+ discriminatedUnion: jt,
2840
+ effect: je,
2841
+ enum: qt,
2842
+ function: Vt,
2843
+ instanceof: vt,
2844
+ intersection: At,
2845
+ lazy: Dt,
2846
+ literal: Lt,
2847
+ map: zt,
2848
+ nan: gt,
2849
+ nativeEnum: Ut,
2850
+ never: Ct,
2851
+ null: Tt,
2852
+ nullable: Yt,
2853
+ number: qe,
2854
+ object: Et,
2855
+ oboolean: Kt,
2856
+ onumber: Xt,
2857
+ optional: Wt,
2858
+ ostring: Ht,
2859
+ pipeline: Gt,
2860
+ preprocess: Jt,
2861
+ promise: Bt,
2862
+ record: $t,
2863
+ set: Pt,
2864
+ strictObject: Rt,
2865
+ string: Le,
2866
+ symbol: bt,
2867
+ transformer: je,
2868
+ tuple: Mt,
2869
+ undefined: wt,
2870
+ union: It,
2871
+ unknown: St,
2872
+ void: Ot,
2873
+ NEVER: Ft,
2874
+ ZodIssueCode: d,
2875
+ quotelessJson: Qe,
2876
+ ZodError: N
2877
+ });
2878
+ const cr = () => {
2879
+ const { texts: { formValidation: r } } = Ge(We), e = (g) => (g != null && g.useCoerce ? C.coerce : C).string({
2880
+ invalid_type_error: r.required,
2881
+ required_error: r.required
2882
+ }).transform((w) => w ?? null), t = (g) => e(g).nullable().optional().transform((b) => b ?? null), n = (g) => {
2883
+ const b = (g != null && g.useCoerce ? C.coerce : C).number({
2884
+ invalid_type_error: r.required,
2885
+ required_error: r.required
2886
+ });
2887
+ return (g == null ? void 0 : g.min) !== void 0 && b.min(g.min), (g == null ? void 0 : g.max) !== void 0 && b.max(g.max), b.transform((w) => w ?? null);
2888
+ }, s = (g) => n(g).nullable().optional().transform((b) => b ?? null), a = (g) => (g != null && g.useCoerce ? C.coerce : C).boolean({
2889
+ invalid_type_error: r.required,
2890
+ required_error: r.required
2891
+ }).transform((b) => b ?? null), i = (g) => (g != null && g.useCoerce ? C.coerce : C).string({
2892
+ invalid_type_error: r.required,
2893
+ required_error: r.required
2894
+ }).refine(Ke, { message: r.invalidDate }).transform((w) => w ?? null), o = (g) => i(g).nullable().transform((b) => b ?? null), u = (g, b) => C.enum(g, {
2895
+ invalid_type_error: r.required,
2896
+ required_error: r.required
2897
+ }).transform((Re) => Re ?? null);
33
2898
  return {
34
- zString: a,
35
- zStringRequired: u,
36
- zNumber: c,
37
- zNumberRequired: i,
38
- zBool: m,
39
- zDate: h,
40
- zDateRequired: l,
41
- zEnum: (e, r) => d(e).nullable().transform((t) => t ?? null),
42
- zEnumRequired: d,
43
- zObjectIdInt: (e) => s.object({ id: c({ useCoerce: !0 }) }).nullable().transform((t) => t ?? null),
44
- zObjectIdIntRequired: (e) => s.object({ id: i() }).transform((t) => t ?? null),
45
- zObjectIdStr: (e) => s.object({ id: a({ useCoerce: !0 }) }).nullable().transform((t) => t ?? null),
46
- zObjectIdStrRequired: (e) => s.object({ id: u() }).transform((t) => t ?? null),
47
- zFile: ({ required: e, multiple: r, maxFileSize: t }) => s.any().transform((o) => Array.from(o ?? [])).refine((o) => !e || (o == null ? void 0 : o.length) > 0, "File is required.").refine((o) => r || (o == null ? void 0 : o.length) <= 1, "Multiple files not allowed.").refine((o) => o.every((b) => b.size <= t), `Maximum file size is ${z(t)}.`).transform((o) => (r ? o : o == null ? void 0 : o[0]) ?? null)
2899
+ zString: t,
2900
+ zStringRequired: e,
2901
+ zNumber: s,
2902
+ zNumberRequired: n,
2903
+ zBool: a,
2904
+ zDate: o,
2905
+ zDateRequired: i,
2906
+ zEnum: (g, b) => u(g).nullable().transform((w) => w ?? null),
2907
+ zEnumRequired: u,
2908
+ zObjectIdInt: (g) => C.object({ id: s({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
2909
+ zObjectIdIntRequired: (g) => C.object({ id: n() }).transform((w) => w ?? null),
2910
+ zObjectIdStr: (g) => C.object({ id: t({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
2911
+ zObjectIdStrRequired: (g) => C.object({ id: e() }).transform((w) => w ?? null),
2912
+ zFile: ({ required: g, multiple: b, maxFileSize: w }) => C.any().transform((T) => Array.from(T ?? [])).refine((T) => !g || (T == null ? void 0 : T.length) > 0, "File is required.").refine((T) => b || (T == null ? void 0 : T.length) <= 1, "Multiple files not allowed.").refine((T) => T.every((Be) => Be.size <= w), `Maximum file size is ${Ye(w)}.`).transform((T) => (b ? T : T == null ? void 0 : T[0]) ?? null)
48
2913
  };
49
- }, y = (n) => {
50
- let u = "pending", a;
51
- const i = n.then((c) => {
52
- u = "success", a = c;
53
- }, (c) => {
54
- u = "error", a = c;
2914
+ }, er = (r) => {
2915
+ let e = "pending", t;
2916
+ const n = r.then((s) => {
2917
+ e = "success", t = s;
2918
+ }, (s) => {
2919
+ e = "error", t = s;
55
2920
  });
56
2921
  return () => {
57
- switch (u) {
2922
+ switch (e) {
58
2923
  case "pending":
59
- throw i;
2924
+ throw n;
60
2925
  case "success":
61
- return a;
2926
+ return t;
62
2927
  case "error":
63
- throw a;
2928
+ throw t;
64
2929
  default:
65
2930
  throw new Error("Unknown status");
66
2931
  }
67
2932
  };
68
2933
  };
69
- function G(n) {
70
- const u = _({ silent: !0 }), [a, i] = I(null);
71
- return S(() => {
2934
+ function ur(r) {
2935
+ const e = Je({ silent: !0 }), [t, n] = He(null);
2936
+ return Xe(() => {
72
2937
  (async () => {
73
- const m = u.get(n).then((l) => l.data);
74
- i(y(m));
2938
+ const a = e.get(r).then((i) => i.data);
2939
+ n(er(a));
75
2940
  })();
76
- }, [u, n]), a;
2941
+ }, [e, r]), t;
77
2942
  }
78
2943
  export {
79
- U as cancelToken,
80
- V as useAuth,
81
- _ as useAxios,
82
- X as useClickOutside,
83
- Z as useConfirm,
84
- Y as useFormControlType,
85
- $ as useGetApiData,
86
- G as useGetDataBound,
87
- p as useKeyPress,
88
- H as useLocalStorageState,
89
- K as useNotifications,
90
- re as usePermissions,
91
- J as usePrompt,
92
- B as useZodSchemaTypes
2944
+ hr as cancelToken,
2945
+ mr as useAuth,
2946
+ Je as useAxios,
2947
+ br as useClickOutside,
2948
+ _r as useConfirm,
2949
+ wr as useFormControlType,
2950
+ vr as useGetApiData,
2951
+ ur as useGetDataBound,
2952
+ Tr as useKeyPress,
2953
+ gr as useLocalStorageState,
2954
+ pr as useNotifications,
2955
+ Sr as usePermissions,
2956
+ xr as usePrompt,
2957
+ cr as useZodSchemaTypes
93
2958
  };