@burdenoff/microfe-admin 2026.1116.1 → 2026.1123.2

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 (66) hide show
  1. package/dist/admin/components/forms/SubscriptionForm.d.ts +19 -20
  2. package/dist/admin/components/forms/SubscriptionForm.js +6 -6
  3. package/dist/admin/components/forms/SubscriptionForm.js.map +1 -1
  4. package/dist/admin/components/forms/TenantForm.d.ts +4 -42
  5. package/dist/admin/components/forms/TenantForm.js +75 -75
  6. package/dist/admin/components/forms/TenantForm.js.map +1 -1
  7. package/dist/admin/components/forms/TicketForm.d.ts +21 -22
  8. package/dist/admin/components/forms/TicketForm.js +1 -1
  9. package/dist/admin/components/forms/TicketForm.js.map +1 -1
  10. package/dist/admin/components/forms/UserForm.d.ts +14 -20
  11. package/dist/admin/components/forms/UserForm.js +55 -55
  12. package/dist/admin/components/forms/UserForm.js.map +1 -1
  13. package/dist/admin/schemas/index.d.ts +128 -243
  14. package/dist/admin/schemas/index.js +58 -58
  15. package/dist/admin/schemas/index.js.map +1 -1
  16. package/dist/node_modules/zod/v4/classic/errors.js +44 -0
  17. package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
  18. package/dist/node_modules/zod/v4/classic/parse.js +7 -0
  19. package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
  20. package/dist/node_modules/zod/v4/classic/schemas.js +722 -0
  21. package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
  22. package/dist/node_modules/zod/v4/core/api.js +498 -0
  23. package/dist/node_modules/zod/v4/core/api.js.map +1 -0
  24. package/dist/node_modules/zod/v4/core/checks.js +245 -0
  25. package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
  26. package/dist/node_modules/zod/v4/core/core.js +84 -0
  27. package/dist/node_modules/zod/v4/core/core.js.map +1 -0
  28. package/dist/node_modules/zod/v4/core/doc.js +29 -0
  29. package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
  30. package/dist/node_modules/zod/v4/core/errors.js +90 -0
  31. package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
  32. package/dist/node_modules/zod/v4/core/json-schema-processors.js +223 -0
  33. package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +1 -0
  34. package/dist/node_modules/zod/v4/core/memoizer.js +188 -0
  35. package/dist/node_modules/zod/v4/core/memoizer.js.map +1 -0
  36. package/dist/node_modules/zod/v4/core/parse.js +159 -0
  37. package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
  38. package/dist/node_modules/zod/v4/core/regexes.js +34 -0
  39. package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
  40. package/dist/node_modules/zod/v4/core/registries.js +41 -0
  41. package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
  42. package/dist/node_modules/zod/v4/core/schemas.js +904 -0
  43. package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
  44. package/dist/node_modules/zod/v4/core/to-json-schema.js +330 -0
  45. package/dist/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
  46. package/dist/node_modules/zod/v4/core/util.js +421 -0
  47. package/dist/node_modules/zod/v4/core/util.js.map +1 -0
  48. package/dist/node_modules/zod/v4/core/versions.js +9 -0
  49. package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
  50. package/dist/node_modules/zod/v4/locales/en.js +96 -0
  51. package/dist/node_modules/zod/v4/locales/en.js.map +1 -0
  52. package/package.json +2 -2
  53. package/dist/node_modules/zod/v3/ZodError.js +0 -81
  54. package/dist/node_modules/zod/v3/ZodError.js.map +0 -1
  55. package/dist/node_modules/zod/v3/errors.js +0 -9
  56. package/dist/node_modules/zod/v3/errors.js.map +0 -1
  57. package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -8
  58. package/dist/node_modules/zod/v3/helpers/errorUtil.js.map +0 -1
  59. package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -92
  60. package/dist/node_modules/zod/v3/helpers/parseUtil.js.map +0 -1
  61. package/dist/node_modules/zod/v3/helpers/util.js +0 -75
  62. package/dist/node_modules/zod/v3/helpers/util.js.map +0 -1
  63. package/dist/node_modules/zod/v3/locales/en.js +0 -61
  64. package/dist/node_modules/zod/v3/locales/en.js.map +0 -1
  65. package/dist/node_modules/zod/v3/types.js +0 -2469
  66. package/dist/node_modules/zod/v3/types.js.map +0 -1
@@ -1,2469 +0,0 @@
1
- import { ZodError as e, ZodIssueCode as t } from "./ZodError.js";
2
- import { getErrorMap as n } from "./errors.js";
3
- import r from "./locales/en.js";
4
- import { errorUtil as i } from "./helpers/errorUtil.js";
5
- import { DIRTY as a, INVALID as o, OK as s, ParseStatus as c, addIssueToContext as l, isAborted as u, isAsync as d, isDirty as f, isValid as p, makeIssue as ee } from "./helpers/parseUtil.js";
6
- import { ZodParsedType as m, getParsedType as h, util as g } from "./helpers/util.js";
7
- // node_modules/zod/v3/types.js
8
- var _ = class {
9
- constructor(e, t, n, r) {
10
- this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
11
- }
12
- get path() {
13
- return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
14
- }
15
- }, te = (t, n) => {
16
- if (p(n)) return {
17
- success: !0,
18
- data: n.value
19
- };
20
- if (!t.common.issues.length) throw Error("Validation failed but no issues detected.");
21
- return {
22
- success: !1,
23
- get error() {
24
- if (this._error) return this._error;
25
- let n = new e(t.common.issues);
26
- return this._error = n, this._error;
27
- }
28
- };
29
- };
30
- function v(e) {
31
- if (!e) return {};
32
- let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
33
- if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
34
- return t ? {
35
- errorMap: t,
36
- description: i
37
- } : {
38
- errorMap: (t, i) => {
39
- let { message: a } = e;
40
- return t.code === "invalid_enum_value" ? { message: a ?? i.defaultError } : i.data === void 0 ? { message: a ?? r ?? i.defaultError } : t.code === "invalid_type" ? { message: a ?? n ?? i.defaultError } : { message: i.defaultError };
41
- },
42
- description: i
43
- };
44
- }
45
- var y = class {
46
- get description() {
47
- return this._def.description;
48
- }
49
- _getType(e) {
50
- return h(e.data);
51
- }
52
- _getOrReturnCtx(e, t) {
53
- return t || {
54
- common: e.parent.common,
55
- data: e.data,
56
- parsedType: h(e.data),
57
- schemaErrorMap: this._def.errorMap,
58
- path: e.path,
59
- parent: e.parent
60
- };
61
- }
62
- _processInputParams(e) {
63
- return {
64
- status: new c(),
65
- ctx: {
66
- common: e.parent.common,
67
- data: e.data,
68
- parsedType: h(e.data),
69
- schemaErrorMap: this._def.errorMap,
70
- path: e.path,
71
- parent: e.parent
72
- }
73
- };
74
- }
75
- _parseSync(e) {
76
- let t = this._parse(e);
77
- if (d(t)) throw Error("Synchronous parse encountered promise.");
78
- return t;
79
- }
80
- _parseAsync(e) {
81
- let t = this._parse(e);
82
- return Promise.resolve(t);
83
- }
84
- parse(e, t) {
85
- let n = this.safeParse(e, t);
86
- if (n.success) return n.data;
87
- throw n.error;
88
- }
89
- safeParse(e, t) {
90
- let n = {
91
- common: {
92
- issues: [],
93
- async: t?.async ?? !1,
94
- contextualErrorMap: t?.errorMap
95
- },
96
- path: t?.path || [],
97
- schemaErrorMap: this._def.errorMap,
98
- parent: null,
99
- data: e,
100
- parsedType: h(e)
101
- };
102
- return te(n, this._parseSync({
103
- data: e,
104
- path: n.path,
105
- parent: n
106
- }));
107
- }
108
- "~validate"(e) {
109
- let t = {
110
- common: {
111
- issues: [],
112
- async: !!this["~standard"].async
113
- },
114
- path: [],
115
- schemaErrorMap: this._def.errorMap,
116
- parent: null,
117
- data: e,
118
- parsedType: h(e)
119
- };
120
- if (!this["~standard"].async) try {
121
- let n = this._parseSync({
122
- data: e,
123
- path: [],
124
- parent: t
125
- });
126
- return p(n) ? { value: n.value } : { issues: t.common.issues };
127
- } catch (e) {
128
- e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
129
- issues: [],
130
- async: !0
131
- };
132
- }
133
- return this._parseAsync({
134
- data: e,
135
- path: [],
136
- parent: t
137
- }).then((e) => p(e) ? { value: e.value } : { issues: t.common.issues });
138
- }
139
- async parseAsync(e, t) {
140
- let n = await this.safeParseAsync(e, t);
141
- if (n.success) return n.data;
142
- throw n.error;
143
- }
144
- async safeParseAsync(e, t) {
145
- let n = {
146
- common: {
147
- issues: [],
148
- contextualErrorMap: t?.errorMap,
149
- async: !0
150
- },
151
- path: t?.path || [],
152
- schemaErrorMap: this._def.errorMap,
153
- parent: null,
154
- data: e,
155
- parsedType: h(e)
156
- }, r = this._parse({
157
- data: e,
158
- path: n.path,
159
- parent: n
160
- });
161
- return te(n, await (d(r) ? r : Promise.resolve(r)));
162
- }
163
- refine(e, n) {
164
- let r = (e) => typeof n == "string" || n === void 0 ? { message: n } : typeof n == "function" ? n(e) : n;
165
- return this._refinement((n, i) => {
166
- let a = e(n), o = () => i.addIssue({
167
- code: t.custom,
168
- ...r(n)
169
- });
170
- return typeof Promise < "u" && a instanceof Promise ? a.then((e) => e ? !0 : (o(), !1)) : a ? !0 : (o(), !1);
171
- });
172
- }
173
- refinement(e, t) {
174
- return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
175
- }
176
- _refinement(e) {
177
- return new K({
178
- schema: this,
179
- typeName: $.ZodEffects,
180
- effect: {
181
- type: "refinement",
182
- refinement: e
183
- }
184
- });
185
- }
186
- superRefine(e) {
187
- return this._refinement(e);
188
- }
189
- constructor(e) {
190
- 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), this["~standard"] = {
191
- version: 1,
192
- vendor: "zod",
193
- validate: (e) => this["~validate"](e)
194
- };
195
- }
196
- optional() {
197
- return q.create(this, this._def);
198
- }
199
- nullable() {
200
- return J.create(this, this._def);
201
- }
202
- nullish() {
203
- return this.nullable().optional();
204
- }
205
- array() {
206
- return M.create(this);
207
- }
208
- promise() {
209
- return G.create(this, this._def);
210
- }
211
- or(e) {
212
- return F.create([this, e], this._def);
213
- }
214
- and(e) {
215
- return L.create(this, e, this._def);
216
- }
217
- transform(e) {
218
- return new K({
219
- ...v(this._def),
220
- schema: this,
221
- typeName: $.ZodEffects,
222
- effect: {
223
- type: "transform",
224
- transform: e
225
- }
226
- });
227
- }
228
- default(e) {
229
- let t = typeof e == "function" ? e : () => e;
230
- return new Y({
231
- ...v(this._def),
232
- innerType: this,
233
- defaultValue: t,
234
- typeName: $.ZodDefault
235
- });
236
- }
237
- brand() {
238
- return new Me({
239
- typeName: $.ZodBranded,
240
- type: this,
241
- ...v(this._def)
242
- });
243
- }
244
- catch(e) {
245
- let t = typeof e == "function" ? e : () => e;
246
- return new X({
247
- ...v(this._def),
248
- innerType: this,
249
- catchValue: t,
250
- typeName: $.ZodCatch
251
- });
252
- }
253
- describe(e) {
254
- let t = this.constructor;
255
- return new t({
256
- ...this._def,
257
- description: e
258
- });
259
- }
260
- pipe(e) {
261
- return Ne.create(this, e);
262
- }
263
- readonly() {
264
- return Q.create(this);
265
- }
266
- isOptional() {
267
- return this.safeParse(void 0).success;
268
- }
269
- isNullable() {
270
- return this.safeParse(null).success;
271
- }
272
- }, ne = /^c[^\s-]{8,}$/i, re = /^[0-9a-z]+$/, ie = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ae = /^[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, oe = /^[a-z0-9_-]{21}$/i, se = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, ce = /^[-+]?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)?)??$/, le = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ue = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", de, fe = /^(?:(?: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])$/, pe = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, me = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, he = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ge = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, _e = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ve = "((\\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])))", ye = RegExp(`^${ve}$`);
273
- function be(e) {
274
- let t = "[0-5]\\d";
275
- e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
276
- let n = e.precision ? "+" : "?";
277
- return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
278
- }
279
- function xe(e) {
280
- return RegExp(`^${be(e)}$`);
281
- }
282
- function Se(e) {
283
- let t = `${ve}T${be(e)}`, n = [];
284
- return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
285
- }
286
- function Ce(e, t) {
287
- return !((t !== "v4" && t || !fe.test(e)) && (t !== "v6" && t || !me.test(e)));
288
- }
289
- function we(e, t) {
290
- if (!se.test(e)) return !1;
291
- try {
292
- let [n] = e.split(".");
293
- if (!n) return !1;
294
- let r = n.replace(/-/g, "+").replace(/_/g, "/").padEnd(n.length + (4 - n.length % 4) % 4, "="), i = JSON.parse(atob(r));
295
- return !(typeof i != "object" || !i || "typ" in i && i?.typ !== "JWT" || !i.alg || t && i.alg !== t);
296
- } catch {
297
- return !1;
298
- }
299
- }
300
- function Te(e, t) {
301
- return !((t !== "v4" && t || !pe.test(e)) && (t !== "v6" && t || !he.test(e)));
302
- }
303
- var b = class e extends y {
304
- _parse(e) {
305
- if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== m.string) {
306
- let n = this._getOrReturnCtx(e);
307
- return l(n, {
308
- code: t.invalid_type,
309
- expected: m.string,
310
- received: n.parsedType
311
- }), o;
312
- }
313
- let n = new c(), r;
314
- for (let i of this._def.checks) if (i.kind === "min") e.data.length < i.value && (r = this._getOrReturnCtx(e, r), l(r, {
315
- code: t.too_small,
316
- minimum: i.value,
317
- type: "string",
318
- inclusive: !0,
319
- exact: !1,
320
- message: i.message
321
- }), n.dirty());
322
- else if (i.kind === "max") e.data.length > i.value && (r = this._getOrReturnCtx(e, r), l(r, {
323
- code: t.too_big,
324
- maximum: i.value,
325
- type: "string",
326
- inclusive: !0,
327
- exact: !1,
328
- message: i.message
329
- }), n.dirty());
330
- else if (i.kind === "length") {
331
- let a = e.data.length > i.value, o = e.data.length < i.value;
332
- (a || o) && (r = this._getOrReturnCtx(e, r), a ? l(r, {
333
- code: t.too_big,
334
- maximum: i.value,
335
- type: "string",
336
- inclusive: !0,
337
- exact: !0,
338
- message: i.message
339
- }) : o && l(r, {
340
- code: t.too_small,
341
- minimum: i.value,
342
- type: "string",
343
- inclusive: !0,
344
- exact: !0,
345
- message: i.message
346
- }), n.dirty());
347
- } else if (i.kind === "email") le.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
348
- validation: "email",
349
- code: t.invalid_string,
350
- message: i.message
351
- }), n.dirty());
352
- else if (i.kind === "emoji") de ||= new RegExp(ue, "u"), de.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
353
- validation: "emoji",
354
- code: t.invalid_string,
355
- message: i.message
356
- }), n.dirty());
357
- else if (i.kind === "uuid") ae.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
358
- validation: "uuid",
359
- code: t.invalid_string,
360
- message: i.message
361
- }), n.dirty());
362
- else if (i.kind === "nanoid") oe.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
363
- validation: "nanoid",
364
- code: t.invalid_string,
365
- message: i.message
366
- }), n.dirty());
367
- else if (i.kind === "cuid") ne.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
368
- validation: "cuid",
369
- code: t.invalid_string,
370
- message: i.message
371
- }), n.dirty());
372
- else if (i.kind === "cuid2") re.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
373
- validation: "cuid2",
374
- code: t.invalid_string,
375
- message: i.message
376
- }), n.dirty());
377
- else if (i.kind === "ulid") ie.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
378
- validation: "ulid",
379
- code: t.invalid_string,
380
- message: i.message
381
- }), n.dirty());
382
- else if (i.kind === "url") try {
383
- new URL(e.data);
384
- } catch {
385
- r = this._getOrReturnCtx(e, r), l(r, {
386
- validation: "url",
387
- code: t.invalid_string,
388
- message: i.message
389
- }), n.dirty();
390
- }
391
- else i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
392
- validation: "regex",
393
- code: t.invalid_string,
394
- message: i.message
395
- }), n.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (r = this._getOrReturnCtx(e, r), l(r, {
396
- code: t.invalid_string,
397
- validation: {
398
- includes: i.value,
399
- position: i.position
400
- },
401
- message: i.message
402
- }), n.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (r = this._getOrReturnCtx(e, r), l(r, {
403
- code: t.invalid_string,
404
- validation: { startsWith: i.value },
405
- message: i.message
406
- }), n.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (r = this._getOrReturnCtx(e, r), l(r, {
407
- code: t.invalid_string,
408
- validation: { endsWith: i.value },
409
- message: i.message
410
- }), n.dirty()) : i.kind === "datetime" ? Se(i).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
411
- code: t.invalid_string,
412
- validation: "datetime",
413
- message: i.message
414
- }), n.dirty()) : i.kind === "date" ? ye.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
415
- code: t.invalid_string,
416
- validation: "date",
417
- message: i.message
418
- }), n.dirty()) : i.kind === "time" ? xe(i).test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
419
- code: t.invalid_string,
420
- validation: "time",
421
- message: i.message
422
- }), n.dirty()) : i.kind === "duration" ? ce.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
423
- validation: "duration",
424
- code: t.invalid_string,
425
- message: i.message
426
- }), n.dirty()) : i.kind === "ip" ? Ce(e.data, i.version) || (r = this._getOrReturnCtx(e, r), l(r, {
427
- validation: "ip",
428
- code: t.invalid_string,
429
- message: i.message
430
- }), n.dirty()) : i.kind === "jwt" ? we(e.data, i.alg) || (r = this._getOrReturnCtx(e, r), l(r, {
431
- validation: "jwt",
432
- code: t.invalid_string,
433
- message: i.message
434
- }), n.dirty()) : i.kind === "cidr" ? Te(e.data, i.version) || (r = this._getOrReturnCtx(e, r), l(r, {
435
- validation: "cidr",
436
- code: t.invalid_string,
437
- message: i.message
438
- }), n.dirty()) : i.kind === "base64" ? ge.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
439
- validation: "base64",
440
- code: t.invalid_string,
441
- message: i.message
442
- }), n.dirty()) : i.kind === "base64url" ? _e.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
443
- validation: "base64url",
444
- code: t.invalid_string,
445
- message: i.message
446
- }), n.dirty()) : g.assertNever(i);
447
- return {
448
- status: n.value,
449
- value: e.data
450
- };
451
- }
452
- _regex(e, n, r) {
453
- return this.refinement((t) => e.test(t), {
454
- validation: n,
455
- code: t.invalid_string,
456
- ...i.errToObj(r)
457
- });
458
- }
459
- _addCheck(t) {
460
- return new e({
461
- ...this._def,
462
- checks: [...this._def.checks, t]
463
- });
464
- }
465
- email(e) {
466
- return this._addCheck({
467
- kind: "email",
468
- ...i.errToObj(e)
469
- });
470
- }
471
- url(e) {
472
- return this._addCheck({
473
- kind: "url",
474
- ...i.errToObj(e)
475
- });
476
- }
477
- emoji(e) {
478
- return this._addCheck({
479
- kind: "emoji",
480
- ...i.errToObj(e)
481
- });
482
- }
483
- uuid(e) {
484
- return this._addCheck({
485
- kind: "uuid",
486
- ...i.errToObj(e)
487
- });
488
- }
489
- nanoid(e) {
490
- return this._addCheck({
491
- kind: "nanoid",
492
- ...i.errToObj(e)
493
- });
494
- }
495
- cuid(e) {
496
- return this._addCheck({
497
- kind: "cuid",
498
- ...i.errToObj(e)
499
- });
500
- }
501
- cuid2(e) {
502
- return this._addCheck({
503
- kind: "cuid2",
504
- ...i.errToObj(e)
505
- });
506
- }
507
- ulid(e) {
508
- return this._addCheck({
509
- kind: "ulid",
510
- ...i.errToObj(e)
511
- });
512
- }
513
- base64(e) {
514
- return this._addCheck({
515
- kind: "base64",
516
- ...i.errToObj(e)
517
- });
518
- }
519
- base64url(e) {
520
- return this._addCheck({
521
- kind: "base64url",
522
- ...i.errToObj(e)
523
- });
524
- }
525
- jwt(e) {
526
- return this._addCheck({
527
- kind: "jwt",
528
- ...i.errToObj(e)
529
- });
530
- }
531
- ip(e) {
532
- return this._addCheck({
533
- kind: "ip",
534
- ...i.errToObj(e)
535
- });
536
- }
537
- cidr(e) {
538
- return this._addCheck({
539
- kind: "cidr",
540
- ...i.errToObj(e)
541
- });
542
- }
543
- datetime(e) {
544
- return typeof e == "string" ? this._addCheck({
545
- kind: "datetime",
546
- precision: null,
547
- offset: !1,
548
- local: !1,
549
- message: e
550
- }) : this._addCheck({
551
- kind: "datetime",
552
- precision: e?.precision === void 0 ? null : e?.precision,
553
- offset: e?.offset ?? !1,
554
- local: e?.local ?? !1,
555
- ...i.errToObj(e?.message)
556
- });
557
- }
558
- date(e) {
559
- return this._addCheck({
560
- kind: "date",
561
- message: e
562
- });
563
- }
564
- time(e) {
565
- return typeof e == "string" ? this._addCheck({
566
- kind: "time",
567
- precision: null,
568
- message: e
569
- }) : this._addCheck({
570
- kind: "time",
571
- precision: e?.precision === void 0 ? null : e?.precision,
572
- ...i.errToObj(e?.message)
573
- });
574
- }
575
- duration(e) {
576
- return this._addCheck({
577
- kind: "duration",
578
- ...i.errToObj(e)
579
- });
580
- }
581
- regex(e, t) {
582
- return this._addCheck({
583
- kind: "regex",
584
- regex: e,
585
- ...i.errToObj(t)
586
- });
587
- }
588
- includes(e, t) {
589
- return this._addCheck({
590
- kind: "includes",
591
- value: e,
592
- position: t?.position,
593
- ...i.errToObj(t?.message)
594
- });
595
- }
596
- startsWith(e, t) {
597
- return this._addCheck({
598
- kind: "startsWith",
599
- value: e,
600
- ...i.errToObj(t)
601
- });
602
- }
603
- endsWith(e, t) {
604
- return this._addCheck({
605
- kind: "endsWith",
606
- value: e,
607
- ...i.errToObj(t)
608
- });
609
- }
610
- min(e, t) {
611
- return this._addCheck({
612
- kind: "min",
613
- value: e,
614
- ...i.errToObj(t)
615
- });
616
- }
617
- max(e, t) {
618
- return this._addCheck({
619
- kind: "max",
620
- value: e,
621
- ...i.errToObj(t)
622
- });
623
- }
624
- length(e, t) {
625
- return this._addCheck({
626
- kind: "length",
627
- value: e,
628
- ...i.errToObj(t)
629
- });
630
- }
631
- nonempty(e) {
632
- return this.min(1, i.errToObj(e));
633
- }
634
- trim() {
635
- return new e({
636
- ...this._def,
637
- checks: [...this._def.checks, { kind: "trim" }]
638
- });
639
- }
640
- toLowerCase() {
641
- return new e({
642
- ...this._def,
643
- checks: [...this._def.checks, { kind: "toLowerCase" }]
644
- });
645
- }
646
- toUpperCase() {
647
- return new e({
648
- ...this._def,
649
- checks: [...this._def.checks, { kind: "toUpperCase" }]
650
- });
651
- }
652
- get isDatetime() {
653
- return !!this._def.checks.find((e) => e.kind === "datetime");
654
- }
655
- get isDate() {
656
- return !!this._def.checks.find((e) => e.kind === "date");
657
- }
658
- get isTime() {
659
- return !!this._def.checks.find((e) => e.kind === "time");
660
- }
661
- get isDuration() {
662
- return !!this._def.checks.find((e) => e.kind === "duration");
663
- }
664
- get isEmail() {
665
- return !!this._def.checks.find((e) => e.kind === "email");
666
- }
667
- get isURL() {
668
- return !!this._def.checks.find((e) => e.kind === "url");
669
- }
670
- get isEmoji() {
671
- return !!this._def.checks.find((e) => e.kind === "emoji");
672
- }
673
- get isUUID() {
674
- return !!this._def.checks.find((e) => e.kind === "uuid");
675
- }
676
- get isNANOID() {
677
- return !!this._def.checks.find((e) => e.kind === "nanoid");
678
- }
679
- get isCUID() {
680
- return !!this._def.checks.find((e) => e.kind === "cuid");
681
- }
682
- get isCUID2() {
683
- return !!this._def.checks.find((e) => e.kind === "cuid2");
684
- }
685
- get isULID() {
686
- return !!this._def.checks.find((e) => e.kind === "ulid");
687
- }
688
- get isIP() {
689
- return !!this._def.checks.find((e) => e.kind === "ip");
690
- }
691
- get isCIDR() {
692
- return !!this._def.checks.find((e) => e.kind === "cidr");
693
- }
694
- get isBase64() {
695
- return !!this._def.checks.find((e) => e.kind === "base64");
696
- }
697
- get isBase64url() {
698
- return !!this._def.checks.find((e) => e.kind === "base64url");
699
- }
700
- get minLength() {
701
- let e = null;
702
- for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
703
- return e;
704
- }
705
- get maxLength() {
706
- let e = null;
707
- for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
708
- return e;
709
- }
710
- };
711
- b.create = (e) => new b({
712
- checks: [],
713
- typeName: $.ZodString,
714
- coerce: e?.coerce ?? !1,
715
- ...v(e)
716
- });
717
- function Ee(e, t) {
718
- let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
719
- return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
720
- }
721
- var x = class e extends y {
722
- constructor() {
723
- super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
724
- }
725
- _parse(e) {
726
- if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== m.number) {
727
- let n = this._getOrReturnCtx(e);
728
- return l(n, {
729
- code: t.invalid_type,
730
- expected: m.number,
731
- received: n.parsedType
732
- }), o;
733
- }
734
- let n, r = new c();
735
- for (let i of this._def.checks) i.kind === "int" ? g.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
736
- code: t.invalid_type,
737
- expected: "integer",
738
- received: "float",
739
- message: i.message
740
- }), r.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), l(n, {
741
- code: t.too_small,
742
- minimum: i.value,
743
- type: "number",
744
- inclusive: i.inclusive,
745
- exact: !1,
746
- message: i.message
747
- }), r.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), l(n, {
748
- code: t.too_big,
749
- maximum: i.value,
750
- type: "number",
751
- inclusive: i.inclusive,
752
- exact: !1,
753
- message: i.message
754
- }), r.dirty()) : i.kind === "multipleOf" ? Ee(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), l(n, {
755
- code: t.not_multiple_of,
756
- multipleOf: i.value,
757
- message: i.message
758
- }), r.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
759
- code: t.not_finite,
760
- message: i.message
761
- }), r.dirty()) : g.assertNever(i);
762
- return {
763
- status: r.value,
764
- value: e.data
765
- };
766
- }
767
- gte(e, t) {
768
- return this.setLimit("min", e, !0, i.toString(t));
769
- }
770
- gt(e, t) {
771
- return this.setLimit("min", e, !1, i.toString(t));
772
- }
773
- lte(e, t) {
774
- return this.setLimit("max", e, !0, i.toString(t));
775
- }
776
- lt(e, t) {
777
- return this.setLimit("max", e, !1, i.toString(t));
778
- }
779
- setLimit(t, n, r, a) {
780
- return new e({
781
- ...this._def,
782
- checks: [...this._def.checks, {
783
- kind: t,
784
- value: n,
785
- inclusive: r,
786
- message: i.toString(a)
787
- }]
788
- });
789
- }
790
- _addCheck(t) {
791
- return new e({
792
- ...this._def,
793
- checks: [...this._def.checks, t]
794
- });
795
- }
796
- int(e) {
797
- return this._addCheck({
798
- kind: "int",
799
- message: i.toString(e)
800
- });
801
- }
802
- positive(e) {
803
- return this._addCheck({
804
- kind: "min",
805
- value: 0,
806
- inclusive: !1,
807
- message: i.toString(e)
808
- });
809
- }
810
- negative(e) {
811
- return this._addCheck({
812
- kind: "max",
813
- value: 0,
814
- inclusive: !1,
815
- message: i.toString(e)
816
- });
817
- }
818
- nonpositive(e) {
819
- return this._addCheck({
820
- kind: "max",
821
- value: 0,
822
- inclusive: !0,
823
- message: i.toString(e)
824
- });
825
- }
826
- nonnegative(e) {
827
- return this._addCheck({
828
- kind: "min",
829
- value: 0,
830
- inclusive: !0,
831
- message: i.toString(e)
832
- });
833
- }
834
- multipleOf(e, t) {
835
- return this._addCheck({
836
- kind: "multipleOf",
837
- value: e,
838
- message: i.toString(t)
839
- });
840
- }
841
- finite(e) {
842
- return this._addCheck({
843
- kind: "finite",
844
- message: i.toString(e)
845
- });
846
- }
847
- safe(e) {
848
- return this._addCheck({
849
- kind: "min",
850
- inclusive: !0,
851
- value: -(2 ** 53 - 1),
852
- message: i.toString(e)
853
- })._addCheck({
854
- kind: "max",
855
- inclusive: !0,
856
- value: 2 ** 53 - 1,
857
- message: i.toString(e)
858
- });
859
- }
860
- get minValue() {
861
- let e = null;
862
- for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
863
- return e;
864
- }
865
- get maxValue() {
866
- let e = null;
867
- for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
868
- return e;
869
- }
870
- get isInt() {
871
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && g.isInteger(e.value));
872
- }
873
- get isFinite() {
874
- let e = null, t = null;
875
- for (let n of this._def.checks) if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf") return !0;
876
- else n.kind === "min" ? (t === null || n.value > t) && (t = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value);
877
- return Number.isFinite(t) && Number.isFinite(e);
878
- }
879
- };
880
- x.create = (e) => new x({
881
- checks: [],
882
- typeName: $.ZodNumber,
883
- coerce: e?.coerce || !1,
884
- ...v(e)
885
- });
886
- var S = class e extends y {
887
- constructor() {
888
- super(...arguments), this.min = this.gte, this.max = this.lte;
889
- }
890
- _parse(e) {
891
- if (this._def.coerce) try {
892
- e.data = BigInt(e.data);
893
- } catch {
894
- return this._getInvalidInput(e);
895
- }
896
- if (this._getType(e) !== m.bigint) return this._getInvalidInput(e);
897
- let n, r = new c();
898
- for (let i of this._def.checks) i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), l(n, {
899
- code: t.too_small,
900
- type: "bigint",
901
- minimum: i.value,
902
- inclusive: i.inclusive,
903
- message: i.message
904
- }), r.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (n = this._getOrReturnCtx(e, n), l(n, {
905
- code: t.too_big,
906
- type: "bigint",
907
- maximum: i.value,
908
- inclusive: i.inclusive,
909
- message: i.message
910
- }), r.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), l(n, {
911
- code: t.not_multiple_of,
912
- multipleOf: i.value,
913
- message: i.message
914
- }), r.dirty()) : g.assertNever(i);
915
- return {
916
- status: r.value,
917
- value: e.data
918
- };
919
- }
920
- _getInvalidInput(e) {
921
- let n = this._getOrReturnCtx(e);
922
- return l(n, {
923
- code: t.invalid_type,
924
- expected: m.bigint,
925
- received: n.parsedType
926
- }), o;
927
- }
928
- gte(e, t) {
929
- return this.setLimit("min", e, !0, i.toString(t));
930
- }
931
- gt(e, t) {
932
- return this.setLimit("min", e, !1, i.toString(t));
933
- }
934
- lte(e, t) {
935
- return this.setLimit("max", e, !0, i.toString(t));
936
- }
937
- lt(e, t) {
938
- return this.setLimit("max", e, !1, i.toString(t));
939
- }
940
- setLimit(t, n, r, a) {
941
- return new e({
942
- ...this._def,
943
- checks: [...this._def.checks, {
944
- kind: t,
945
- value: n,
946
- inclusive: r,
947
- message: i.toString(a)
948
- }]
949
- });
950
- }
951
- _addCheck(t) {
952
- return new e({
953
- ...this._def,
954
- checks: [...this._def.checks, t]
955
- });
956
- }
957
- positive(e) {
958
- return this._addCheck({
959
- kind: "min",
960
- value: BigInt(0),
961
- inclusive: !1,
962
- message: i.toString(e)
963
- });
964
- }
965
- negative(e) {
966
- return this._addCheck({
967
- kind: "max",
968
- value: BigInt(0),
969
- inclusive: !1,
970
- message: i.toString(e)
971
- });
972
- }
973
- nonpositive(e) {
974
- return this._addCheck({
975
- kind: "max",
976
- value: BigInt(0),
977
- inclusive: !0,
978
- message: i.toString(e)
979
- });
980
- }
981
- nonnegative(e) {
982
- return this._addCheck({
983
- kind: "min",
984
- value: BigInt(0),
985
- inclusive: !0,
986
- message: i.toString(e)
987
- });
988
- }
989
- multipleOf(e, t) {
990
- return this._addCheck({
991
- kind: "multipleOf",
992
- value: e,
993
- message: i.toString(t)
994
- });
995
- }
996
- get minValue() {
997
- let e = null;
998
- for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
999
- return e;
1000
- }
1001
- get maxValue() {
1002
- let e = null;
1003
- for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1004
- return e;
1005
- }
1006
- };
1007
- S.create = (e) => new S({
1008
- checks: [],
1009
- typeName: $.ZodBigInt,
1010
- coerce: e?.coerce ?? !1,
1011
- ...v(e)
1012
- });
1013
- var C = class extends y {
1014
- _parse(e) {
1015
- if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== m.boolean) {
1016
- let n = this._getOrReturnCtx(e);
1017
- return l(n, {
1018
- code: t.invalid_type,
1019
- expected: m.boolean,
1020
- received: n.parsedType
1021
- }), o;
1022
- }
1023
- return s(e.data);
1024
- }
1025
- };
1026
- C.create = (e) => new C({
1027
- typeName: $.ZodBoolean,
1028
- coerce: e?.coerce || !1,
1029
- ...v(e)
1030
- });
1031
- var w = class e extends y {
1032
- _parse(e) {
1033
- if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== m.date) {
1034
- let n = this._getOrReturnCtx(e);
1035
- return l(n, {
1036
- code: t.invalid_type,
1037
- expected: m.date,
1038
- received: n.parsedType
1039
- }), o;
1040
- }
1041
- if (Number.isNaN(e.data.getTime())) {
1042
- let n = this._getOrReturnCtx(e);
1043
- return l(n, { code: t.invalid_date }), o;
1044
- }
1045
- let n = new c(), r;
1046
- for (let i of this._def.checks) i.kind === "min" ? e.data.getTime() < i.value && (r = this._getOrReturnCtx(e, r), l(r, {
1047
- code: t.too_small,
1048
- message: i.message,
1049
- inclusive: !0,
1050
- exact: !1,
1051
- minimum: i.value,
1052
- type: "date"
1053
- }), n.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (r = this._getOrReturnCtx(e, r), l(r, {
1054
- code: t.too_big,
1055
- message: i.message,
1056
- inclusive: !0,
1057
- exact: !1,
1058
- maximum: i.value,
1059
- type: "date"
1060
- }), n.dirty()) : g.assertNever(i);
1061
- return {
1062
- status: n.value,
1063
- value: new Date(e.data.getTime())
1064
- };
1065
- }
1066
- _addCheck(t) {
1067
- return new e({
1068
- ...this._def,
1069
- checks: [...this._def.checks, t]
1070
- });
1071
- }
1072
- min(e, t) {
1073
- return this._addCheck({
1074
- kind: "min",
1075
- value: e.getTime(),
1076
- message: i.toString(t)
1077
- });
1078
- }
1079
- max(e, t) {
1080
- return this._addCheck({
1081
- kind: "max",
1082
- value: e.getTime(),
1083
- message: i.toString(t)
1084
- });
1085
- }
1086
- get minDate() {
1087
- let e = null;
1088
- for (let t of this._def.checks) t.kind === "min" && (e === null || t.value > e) && (e = t.value);
1089
- return e == null ? null : new Date(e);
1090
- }
1091
- get maxDate() {
1092
- let e = null;
1093
- for (let t of this._def.checks) t.kind === "max" && (e === null || t.value < e) && (e = t.value);
1094
- return e == null ? null : new Date(e);
1095
- }
1096
- };
1097
- w.create = (e) => new w({
1098
- checks: [],
1099
- coerce: e?.coerce || !1,
1100
- typeName: $.ZodDate,
1101
- ...v(e)
1102
- });
1103
- var T = class extends y {
1104
- _parse(e) {
1105
- if (this._getType(e) !== m.symbol) {
1106
- let n = this._getOrReturnCtx(e);
1107
- return l(n, {
1108
- code: t.invalid_type,
1109
- expected: m.symbol,
1110
- received: n.parsedType
1111
- }), o;
1112
- }
1113
- return s(e.data);
1114
- }
1115
- };
1116
- T.create = (e) => new T({
1117
- typeName: $.ZodSymbol,
1118
- ...v(e)
1119
- });
1120
- var E = class extends y {
1121
- _parse(e) {
1122
- if (this._getType(e) !== m.undefined) {
1123
- let n = this._getOrReturnCtx(e);
1124
- return l(n, {
1125
- code: t.invalid_type,
1126
- expected: m.undefined,
1127
- received: n.parsedType
1128
- }), o;
1129
- }
1130
- return s(e.data);
1131
- }
1132
- };
1133
- E.create = (e) => new E({
1134
- typeName: $.ZodUndefined,
1135
- ...v(e)
1136
- });
1137
- var D = class extends y {
1138
- _parse(e) {
1139
- if (this._getType(e) !== m.null) {
1140
- let n = this._getOrReturnCtx(e);
1141
- return l(n, {
1142
- code: t.invalid_type,
1143
- expected: m.null,
1144
- received: n.parsedType
1145
- }), o;
1146
- }
1147
- return s(e.data);
1148
- }
1149
- };
1150
- D.create = (e) => new D({
1151
- typeName: $.ZodNull,
1152
- ...v(e)
1153
- });
1154
- var O = class extends y {
1155
- constructor() {
1156
- super(...arguments), this._any = !0;
1157
- }
1158
- _parse(e) {
1159
- return s(e.data);
1160
- }
1161
- };
1162
- O.create = (e) => new O({
1163
- typeName: $.ZodAny,
1164
- ...v(e)
1165
- });
1166
- var k = class extends y {
1167
- constructor() {
1168
- super(...arguments), this._unknown = !0;
1169
- }
1170
- _parse(e) {
1171
- return s(e.data);
1172
- }
1173
- };
1174
- k.create = (e) => new k({
1175
- typeName: $.ZodUnknown,
1176
- ...v(e)
1177
- });
1178
- var A = class extends y {
1179
- _parse(e) {
1180
- let n = this._getOrReturnCtx(e);
1181
- return l(n, {
1182
- code: t.invalid_type,
1183
- expected: m.never,
1184
- received: n.parsedType
1185
- }), o;
1186
- }
1187
- };
1188
- A.create = (e) => new A({
1189
- typeName: $.ZodNever,
1190
- ...v(e)
1191
- });
1192
- var j = class extends y {
1193
- _parse(e) {
1194
- if (this._getType(e) !== m.undefined) {
1195
- let n = this._getOrReturnCtx(e);
1196
- return l(n, {
1197
- code: t.invalid_type,
1198
- expected: m.void,
1199
- received: n.parsedType
1200
- }), o;
1201
- }
1202
- return s(e.data);
1203
- }
1204
- };
1205
- j.create = (e) => new j({
1206
- typeName: $.ZodVoid,
1207
- ...v(e)
1208
- });
1209
- var M = class e extends y {
1210
- _parse(e) {
1211
- let { ctx: n, status: r } = this._processInputParams(e), i = this._def;
1212
- if (n.parsedType !== m.array) return l(n, {
1213
- code: t.invalid_type,
1214
- expected: m.array,
1215
- received: n.parsedType
1216
- }), o;
1217
- if (i.exactLength !== null) {
1218
- let e = n.data.length > i.exactLength.value, a = n.data.length < i.exactLength.value;
1219
- (e || a) && (l(n, {
1220
- code: e ? t.too_big : t.too_small,
1221
- minimum: a ? i.exactLength.value : void 0,
1222
- maximum: e ? i.exactLength.value : void 0,
1223
- type: "array",
1224
- inclusive: !0,
1225
- exact: !0,
1226
- message: i.exactLength.message
1227
- }), r.dirty());
1228
- }
1229
- if (i.minLength !== null && n.data.length < i.minLength.value && (l(n, {
1230
- code: t.too_small,
1231
- minimum: i.minLength.value,
1232
- type: "array",
1233
- inclusive: !0,
1234
- exact: !1,
1235
- message: i.minLength.message
1236
- }), r.dirty()), i.maxLength !== null && n.data.length > i.maxLength.value && (l(n, {
1237
- code: t.too_big,
1238
- maximum: i.maxLength.value,
1239
- type: "array",
1240
- inclusive: !0,
1241
- exact: !1,
1242
- message: i.maxLength.message
1243
- }), r.dirty()), n.common.async) return Promise.all([...n.data].map((e, t) => i.type._parseAsync(new _(n, e, n.path, t)))).then((e) => c.mergeArray(r, e));
1244
- let a = [...n.data].map((e, t) => i.type._parseSync(new _(n, e, n.path, t)));
1245
- return c.mergeArray(r, a);
1246
- }
1247
- get element() {
1248
- return this._def.type;
1249
- }
1250
- min(t, n) {
1251
- return new e({
1252
- ...this._def,
1253
- minLength: {
1254
- value: t,
1255
- message: i.toString(n)
1256
- }
1257
- });
1258
- }
1259
- max(t, n) {
1260
- return new e({
1261
- ...this._def,
1262
- maxLength: {
1263
- value: t,
1264
- message: i.toString(n)
1265
- }
1266
- });
1267
- }
1268
- length(t, n) {
1269
- return new e({
1270
- ...this._def,
1271
- exactLength: {
1272
- value: t,
1273
- message: i.toString(n)
1274
- }
1275
- });
1276
- }
1277
- nonempty(e) {
1278
- return this.min(1, e);
1279
- }
1280
- };
1281
- M.create = (e, t) => new M({
1282
- type: e,
1283
- minLength: null,
1284
- maxLength: null,
1285
- exactLength: null,
1286
- typeName: $.ZodArray,
1287
- ...v(t)
1288
- });
1289
- function N(e) {
1290
- if (e instanceof P) {
1291
- let t = {};
1292
- for (let n in e.shape) {
1293
- let r = e.shape[n];
1294
- t[n] = q.create(N(r));
1295
- }
1296
- return new P({
1297
- ...e._def,
1298
- shape: () => t
1299
- });
1300
- }
1301
- return e instanceof M ? new M({
1302
- ...e._def,
1303
- type: N(e.element)
1304
- }) : e instanceof q ? q.create(N(e.unwrap())) : e instanceof J ? J.create(N(e.unwrap())) : e instanceof R ? R.create(e.items.map((e) => N(e))) : e;
1305
- }
1306
- var P = class e extends y {
1307
- constructor() {
1308
- super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1309
- }
1310
- _getCached() {
1311
- if (this._cached !== null) return this._cached;
1312
- let e = this._def.shape(), t = g.objectKeys(e);
1313
- return this._cached = {
1314
- shape: e,
1315
- keys: t
1316
- }, this._cached;
1317
- }
1318
- _parse(e) {
1319
- if (this._getType(e) !== m.object) {
1320
- let n = this._getOrReturnCtx(e);
1321
- return l(n, {
1322
- code: t.invalid_type,
1323
- expected: m.object,
1324
- received: n.parsedType
1325
- }), o;
1326
- }
1327
- let { status: n, ctx: r } = this._processInputParams(e), { shape: i, keys: a } = this._getCached(), s = [];
1328
- if (!(this._def.catchall instanceof A && this._def.unknownKeys === "strip")) for (let e in r.data) a.includes(e) || s.push(e);
1329
- let u = [];
1330
- for (let e of a) {
1331
- let t = i[e], n = r.data[e];
1332
- u.push({
1333
- key: {
1334
- status: "valid",
1335
- value: e
1336
- },
1337
- value: t._parse(new _(r, n, r.path, e)),
1338
- alwaysSet: e in r.data
1339
- });
1340
- }
1341
- if (this._def.catchall instanceof A) {
1342
- let e = this._def.unknownKeys;
1343
- if (e === "passthrough") for (let e of s) u.push({
1344
- key: {
1345
- status: "valid",
1346
- value: e
1347
- },
1348
- value: {
1349
- status: "valid",
1350
- value: r.data[e]
1351
- }
1352
- });
1353
- else if (e === "strict") s.length > 0 && (l(r, {
1354
- code: t.unrecognized_keys,
1355
- keys: s
1356
- }), n.dirty());
1357
- else if (e !== "strip") throw Error("Internal ZodObject error: invalid unknownKeys value.");
1358
- } else {
1359
- let e = this._def.catchall;
1360
- for (let t of s) {
1361
- let n = r.data[t];
1362
- u.push({
1363
- key: {
1364
- status: "valid",
1365
- value: t
1366
- },
1367
- value: e._parse(new _(r, n, r.path, t)),
1368
- alwaysSet: t in r.data
1369
- });
1370
- }
1371
- }
1372
- return r.common.async ? Promise.resolve().then(async () => {
1373
- let e = [];
1374
- for (let t of u) {
1375
- let n = await t.key, r = await t.value;
1376
- e.push({
1377
- key: n,
1378
- value: r,
1379
- alwaysSet: t.alwaysSet
1380
- });
1381
- }
1382
- return e;
1383
- }).then((e) => c.mergeObjectSync(n, e)) : c.mergeObjectSync(n, u);
1384
- }
1385
- get shape() {
1386
- return this._def.shape();
1387
- }
1388
- strict(t) {
1389
- return i.errToObj, new e({
1390
- ...this._def,
1391
- unknownKeys: "strict",
1392
- ...t === void 0 ? {} : { errorMap: (e, n) => {
1393
- let r = this._def.errorMap?.(e, n).message ?? n.defaultError;
1394
- return e.code === "unrecognized_keys" ? { message: i.errToObj(t).message ?? r } : { message: r };
1395
- } }
1396
- });
1397
- }
1398
- strip() {
1399
- return new e({
1400
- ...this._def,
1401
- unknownKeys: "strip"
1402
- });
1403
- }
1404
- passthrough() {
1405
- return new e({
1406
- ...this._def,
1407
- unknownKeys: "passthrough"
1408
- });
1409
- }
1410
- extend(t) {
1411
- return new e({
1412
- ...this._def,
1413
- shape: () => ({
1414
- ...this._def.shape(),
1415
- ...t
1416
- })
1417
- });
1418
- }
1419
- merge(t) {
1420
- return new e({
1421
- unknownKeys: t._def.unknownKeys,
1422
- catchall: t._def.catchall,
1423
- shape: () => ({
1424
- ...this._def.shape(),
1425
- ...t._def.shape()
1426
- }),
1427
- typeName: $.ZodObject
1428
- });
1429
- }
1430
- setKey(e, t) {
1431
- return this.augment({ [e]: t });
1432
- }
1433
- catchall(t) {
1434
- return new e({
1435
- ...this._def,
1436
- catchall: t
1437
- });
1438
- }
1439
- pick(t) {
1440
- let n = {};
1441
- for (let e of g.objectKeys(t)) t[e] && this.shape[e] && (n[e] = this.shape[e]);
1442
- return new e({
1443
- ...this._def,
1444
- shape: () => n
1445
- });
1446
- }
1447
- omit(t) {
1448
- let n = {};
1449
- for (let e of g.objectKeys(this.shape)) t[e] || (n[e] = this.shape[e]);
1450
- return new e({
1451
- ...this._def,
1452
- shape: () => n
1453
- });
1454
- }
1455
- deepPartial() {
1456
- return N(this);
1457
- }
1458
- partial(t) {
1459
- let n = {};
1460
- for (let e of g.objectKeys(this.shape)) {
1461
- let r = this.shape[e];
1462
- n[e] = t && !t[e] ? r : r.optional();
1463
- }
1464
- return new e({
1465
- ...this._def,
1466
- shape: () => n
1467
- });
1468
- }
1469
- required(t) {
1470
- let n = {};
1471
- for (let e of g.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
1472
- else {
1473
- let t = this.shape[e];
1474
- for (; t instanceof q;) t = t._def.innerType;
1475
- n[e] = t;
1476
- }
1477
- return new e({
1478
- ...this._def,
1479
- shape: () => n
1480
- });
1481
- }
1482
- keyof() {
1483
- return je(g.objectKeys(this.shape));
1484
- }
1485
- };
1486
- P.create = (e, t) => new P({
1487
- shape: () => e,
1488
- unknownKeys: "strip",
1489
- catchall: A.create(),
1490
- typeName: $.ZodObject,
1491
- ...v(t)
1492
- }), P.strictCreate = (e, t) => new P({
1493
- shape: () => e,
1494
- unknownKeys: "strict",
1495
- catchall: A.create(),
1496
- typeName: $.ZodObject,
1497
- ...v(t)
1498
- }), P.lazycreate = (e, t) => new P({
1499
- shape: e,
1500
- unknownKeys: "strip",
1501
- catchall: A.create(),
1502
- typeName: $.ZodObject,
1503
- ...v(t)
1504
- });
1505
- var F = class extends y {
1506
- _parse(n) {
1507
- let { ctx: r } = this._processInputParams(n), i = this._def.options;
1508
- function a(n) {
1509
- for (let e of n) if (e.result.status === "valid") return e.result;
1510
- for (let e of n) if (e.result.status === "dirty") return r.common.issues.push(...e.ctx.common.issues), e.result;
1511
- let i = n.map((t) => new e(t.ctx.common.issues));
1512
- return l(r, {
1513
- code: t.invalid_union,
1514
- unionErrors: i
1515
- }), o;
1516
- }
1517
- if (r.common.async) return Promise.all(i.map(async (e) => {
1518
- let t = {
1519
- ...r,
1520
- common: {
1521
- ...r.common,
1522
- issues: []
1523
- },
1524
- parent: null
1525
- };
1526
- return {
1527
- result: await e._parseAsync({
1528
- data: r.data,
1529
- path: r.path,
1530
- parent: t
1531
- }),
1532
- ctx: t
1533
- };
1534
- })).then(a);
1535
- {
1536
- let n, a = [];
1537
- for (let e of i) {
1538
- let t = {
1539
- ...r,
1540
- common: {
1541
- ...r.common,
1542
- issues: []
1543
- },
1544
- parent: null
1545
- }, i = e._parseSync({
1546
- data: r.data,
1547
- path: r.path,
1548
- parent: t
1549
- });
1550
- if (i.status === "valid") return i;
1551
- i.status === "dirty" && !n && (n = {
1552
- result: i,
1553
- ctx: t
1554
- }), t.common.issues.length && a.push(t.common.issues);
1555
- }
1556
- if (n) return r.common.issues.push(...n.ctx.common.issues), n.result;
1557
- let s = a.map((t) => new e(t));
1558
- return l(r, {
1559
- code: t.invalid_union,
1560
- unionErrors: s
1561
- }), o;
1562
- }
1563
- }
1564
- get options() {
1565
- return this._def.options;
1566
- }
1567
- };
1568
- F.create = (e, t) => new F({
1569
- options: e,
1570
- typeName: $.ZodUnion,
1571
- ...v(t)
1572
- });
1573
- var I = (e) => e instanceof V ? I(e.schema) : e instanceof K ? I(e.innerType()) : e instanceof H ? [e.value] : e instanceof U ? e.options : e instanceof W ? g.objectValues(e.enum) : e instanceof Y ? I(e._def.innerType) : e instanceof E ? [void 0] : e instanceof D ? [null] : e instanceof q ? [void 0, ...I(e.unwrap())] : e instanceof J ? [null, ...I(e.unwrap())] : e instanceof Me || e instanceof Q ? I(e.unwrap()) : e instanceof X ? I(e._def.innerType) : [], De = class e extends y {
1574
- _parse(e) {
1575
- let { ctx: n } = this._processInputParams(e);
1576
- if (n.parsedType !== m.object) return l(n, {
1577
- code: t.invalid_type,
1578
- expected: m.object,
1579
- received: n.parsedType
1580
- }), o;
1581
- let r = this.discriminator, i = n.data[r], a = this.optionsMap.get(i);
1582
- return a ? n.common.async ? a._parseAsync({
1583
- data: n.data,
1584
- path: n.path,
1585
- parent: n
1586
- }) : a._parseSync({
1587
- data: n.data,
1588
- path: n.path,
1589
- parent: n
1590
- }) : (l(n, {
1591
- code: t.invalid_union_discriminator,
1592
- options: Array.from(this.optionsMap.keys()),
1593
- path: [r]
1594
- }), o);
1595
- }
1596
- get discriminator() {
1597
- return this._def.discriminator;
1598
- }
1599
- get options() {
1600
- return this._def.options;
1601
- }
1602
- get optionsMap() {
1603
- return this._def.optionsMap;
1604
- }
1605
- static create(t, n, r) {
1606
- let i = /* @__PURE__ */ new Map();
1607
- for (let e of n) {
1608
- let n = I(e.shape[t]);
1609
- if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
1610
- for (let r of n) {
1611
- if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
1612
- i.set(r, e);
1613
- }
1614
- }
1615
- return new e({
1616
- typeName: $.ZodDiscriminatedUnion,
1617
- discriminator: t,
1618
- options: n,
1619
- optionsMap: i,
1620
- ...v(r)
1621
- });
1622
- }
1623
- };
1624
- function Oe(e, t) {
1625
- let n = h(e), r = h(t);
1626
- if (e === t) return {
1627
- valid: !0,
1628
- data: e
1629
- };
1630
- if (n === m.object && r === m.object) {
1631
- let n = g.objectKeys(t), r = g.objectKeys(e).filter((e) => n.indexOf(e) !== -1), i = {
1632
- ...e,
1633
- ...t
1634
- };
1635
- for (let n of r) {
1636
- let r = Oe(e[n], t[n]);
1637
- if (!r.valid) return { valid: !1 };
1638
- i[n] = r.data;
1639
- }
1640
- return {
1641
- valid: !0,
1642
- data: i
1643
- };
1644
- }
1645
- if (n === m.array && r === m.array) {
1646
- if (e.length !== t.length) return { valid: !1 };
1647
- let n = [];
1648
- for (let r = 0; r < e.length; r++) {
1649
- let i = e[r], a = t[r], o = Oe(i, a);
1650
- if (!o.valid) return { valid: !1 };
1651
- n.push(o.data);
1652
- }
1653
- return {
1654
- valid: !0,
1655
- data: n
1656
- };
1657
- }
1658
- return n === m.date && r === m.date && +e == +t ? {
1659
- valid: !0,
1660
- data: e
1661
- } : { valid: !1 };
1662
- }
1663
- var L = class extends y {
1664
- _parse(e) {
1665
- let { status: n, ctx: r } = this._processInputParams(e), i = (e, i) => {
1666
- if (u(e) || u(i)) return o;
1667
- let a = Oe(e.value, i.value);
1668
- return a.valid ? ((f(e) || f(i)) && n.dirty(), {
1669
- status: n.value,
1670
- value: a.data
1671
- }) : (l(r, { code: t.invalid_intersection_types }), o);
1672
- };
1673
- return r.common.async ? Promise.all([this._def.left._parseAsync({
1674
- data: r.data,
1675
- path: r.path,
1676
- parent: r
1677
- }), this._def.right._parseAsync({
1678
- data: r.data,
1679
- path: r.path,
1680
- parent: r
1681
- })]).then(([e, t]) => i(e, t)) : i(this._def.left._parseSync({
1682
- data: r.data,
1683
- path: r.path,
1684
- parent: r
1685
- }), this._def.right._parseSync({
1686
- data: r.data,
1687
- path: r.path,
1688
- parent: r
1689
- }));
1690
- }
1691
- };
1692
- L.create = (e, t, n) => new L({
1693
- left: e,
1694
- right: t,
1695
- typeName: $.ZodIntersection,
1696
- ...v(n)
1697
- });
1698
- var R = class e extends y {
1699
- _parse(e) {
1700
- let { status: n, ctx: r } = this._processInputParams(e);
1701
- if (r.parsedType !== m.array) return l(r, {
1702
- code: t.invalid_type,
1703
- expected: m.array,
1704
- received: r.parsedType
1705
- }), o;
1706
- if (r.data.length < this._def.items.length) return l(r, {
1707
- code: t.too_small,
1708
- minimum: this._def.items.length,
1709
- inclusive: !0,
1710
- exact: !1,
1711
- type: "array"
1712
- }), o;
1713
- !this._def.rest && r.data.length > this._def.items.length && (l(r, {
1714
- code: t.too_big,
1715
- maximum: this._def.items.length,
1716
- inclusive: !0,
1717
- exact: !1,
1718
- type: "array"
1719
- }), n.dirty());
1720
- let i = [...r.data].map((e, t) => {
1721
- let n = this._def.items[t] || this._def.rest;
1722
- return n ? n._parse(new _(r, e, r.path, t)) : null;
1723
- }).filter((e) => !!e);
1724
- return r.common.async ? Promise.all(i).then((e) => c.mergeArray(n, e)) : c.mergeArray(n, i);
1725
- }
1726
- get items() {
1727
- return this._def.items;
1728
- }
1729
- rest(t) {
1730
- return new e({
1731
- ...this._def,
1732
- rest: t
1733
- });
1734
- }
1735
- };
1736
- R.create = (e, t) => {
1737
- if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
1738
- return new R({
1739
- items: e,
1740
- typeName: $.ZodTuple,
1741
- rest: null,
1742
- ...v(t)
1743
- });
1744
- };
1745
- var ke = class e extends y {
1746
- get keySchema() {
1747
- return this._def.keyType;
1748
- }
1749
- get valueSchema() {
1750
- return this._def.valueType;
1751
- }
1752
- _parse(e) {
1753
- let { status: n, ctx: r } = this._processInputParams(e);
1754
- if (r.parsedType !== m.object) return l(r, {
1755
- code: t.invalid_type,
1756
- expected: m.object,
1757
- received: r.parsedType
1758
- }), o;
1759
- let i = [], a = this._def.keyType, s = this._def.valueType;
1760
- for (let e in r.data) i.push({
1761
- key: a._parse(new _(r, e, r.path, e)),
1762
- value: s._parse(new _(r, r.data[e], r.path, e)),
1763
- alwaysSet: e in r.data
1764
- });
1765
- return r.common.async ? c.mergeObjectAsync(n, i) : c.mergeObjectSync(n, i);
1766
- }
1767
- get element() {
1768
- return this._def.valueType;
1769
- }
1770
- static create(t, n, r) {
1771
- return n instanceof y ? new e({
1772
- keyType: t,
1773
- valueType: n,
1774
- typeName: $.ZodRecord,
1775
- ...v(r)
1776
- }) : new e({
1777
- keyType: b.create(),
1778
- valueType: t,
1779
- typeName: $.ZodRecord,
1780
- ...v(n)
1781
- });
1782
- }
1783
- }, z = class extends y {
1784
- get keySchema() {
1785
- return this._def.keyType;
1786
- }
1787
- get valueSchema() {
1788
- return this._def.valueType;
1789
- }
1790
- _parse(e) {
1791
- let { status: n, ctx: r } = this._processInputParams(e);
1792
- if (r.parsedType !== m.map) return l(r, {
1793
- code: t.invalid_type,
1794
- expected: m.map,
1795
- received: r.parsedType
1796
- }), o;
1797
- let i = this._def.keyType, a = this._def.valueType, s = [...r.data.entries()].map(([e, t], n) => ({
1798
- key: i._parse(new _(r, e, r.path, [n, "key"])),
1799
- value: a._parse(new _(r, t, r.path, [n, "value"]))
1800
- }));
1801
- if (r.common.async) {
1802
- let e = /* @__PURE__ */ new Map();
1803
- return Promise.resolve().then(async () => {
1804
- for (let t of s) {
1805
- let r = await t.key, i = await t.value;
1806
- if (r.status === "aborted" || i.status === "aborted") return o;
1807
- (r.status === "dirty" || i.status === "dirty") && n.dirty(), e.set(r.value, i.value);
1808
- }
1809
- return {
1810
- status: n.value,
1811
- value: e
1812
- };
1813
- });
1814
- }
1815
- {
1816
- let e = /* @__PURE__ */ new Map();
1817
- for (let t of s) {
1818
- let r = t.key, i = t.value;
1819
- if (r.status === "aborted" || i.status === "aborted") return o;
1820
- (r.status === "dirty" || i.status === "dirty") && n.dirty(), e.set(r.value, i.value);
1821
- }
1822
- return {
1823
- status: n.value,
1824
- value: e
1825
- };
1826
- }
1827
- }
1828
- };
1829
- z.create = (e, t, n) => new z({
1830
- valueType: t,
1831
- keyType: e,
1832
- typeName: $.ZodMap,
1833
- ...v(n)
1834
- });
1835
- var B = class e extends y {
1836
- _parse(e) {
1837
- let { status: n, ctx: r } = this._processInputParams(e);
1838
- if (r.parsedType !== m.set) return l(r, {
1839
- code: t.invalid_type,
1840
- expected: m.set,
1841
- received: r.parsedType
1842
- }), o;
1843
- let i = this._def;
1844
- i.minSize !== null && r.data.size < i.minSize.value && (l(r, {
1845
- code: t.too_small,
1846
- minimum: i.minSize.value,
1847
- type: "set",
1848
- inclusive: !0,
1849
- exact: !1,
1850
- message: i.minSize.message
1851
- }), n.dirty()), i.maxSize !== null && r.data.size > i.maxSize.value && (l(r, {
1852
- code: t.too_big,
1853
- maximum: i.maxSize.value,
1854
- type: "set",
1855
- inclusive: !0,
1856
- exact: !1,
1857
- message: i.maxSize.message
1858
- }), n.dirty());
1859
- let a = this._def.valueType;
1860
- function s(e) {
1861
- let t = /* @__PURE__ */ new Set();
1862
- for (let r of e) {
1863
- if (r.status === "aborted") return o;
1864
- r.status === "dirty" && n.dirty(), t.add(r.value);
1865
- }
1866
- return {
1867
- status: n.value,
1868
- value: t
1869
- };
1870
- }
1871
- let c = [...r.data.values()].map((e, t) => a._parse(new _(r, e, r.path, t)));
1872
- return r.common.async ? Promise.all(c).then((e) => s(e)) : s(c);
1873
- }
1874
- min(t, n) {
1875
- return new e({
1876
- ...this._def,
1877
- minSize: {
1878
- value: t,
1879
- message: i.toString(n)
1880
- }
1881
- });
1882
- }
1883
- max(t, n) {
1884
- return new e({
1885
- ...this._def,
1886
- maxSize: {
1887
- value: t,
1888
- message: i.toString(n)
1889
- }
1890
- });
1891
- }
1892
- size(e, t) {
1893
- return this.min(e, t).max(e, t);
1894
- }
1895
- nonempty(e) {
1896
- return this.min(1, e);
1897
- }
1898
- };
1899
- B.create = (e, t) => new B({
1900
- valueType: e,
1901
- minSize: null,
1902
- maxSize: null,
1903
- typeName: $.ZodSet,
1904
- ...v(t)
1905
- });
1906
- var Ae = class i extends y {
1907
- constructor() {
1908
- super(...arguments), this.validate = this.implement;
1909
- }
1910
- _parse(i) {
1911
- let { ctx: a } = this._processInputParams(i);
1912
- if (a.parsedType !== m.function) return l(a, {
1913
- code: t.invalid_type,
1914
- expected: m.function,
1915
- received: a.parsedType
1916
- }), o;
1917
- function c(e, i) {
1918
- return ee({
1919
- data: e,
1920
- path: a.path,
1921
- errorMaps: [
1922
- a.common.contextualErrorMap,
1923
- a.schemaErrorMap,
1924
- n(),
1925
- r
1926
- ].filter((e) => !!e),
1927
- issueData: {
1928
- code: t.invalid_arguments,
1929
- argumentsError: i
1930
- }
1931
- });
1932
- }
1933
- function u(e, i) {
1934
- return ee({
1935
- data: e,
1936
- path: a.path,
1937
- errorMaps: [
1938
- a.common.contextualErrorMap,
1939
- a.schemaErrorMap,
1940
- n(),
1941
- r
1942
- ].filter((e) => !!e),
1943
- issueData: {
1944
- code: t.invalid_return_type,
1945
- returnTypeError: i
1946
- }
1947
- });
1948
- }
1949
- let d = { errorMap: a.common.contextualErrorMap }, f = a.data;
1950
- if (this._def.returns instanceof G) {
1951
- let t = this;
1952
- return s(async function(...n) {
1953
- let r = new e([]), i = await t._def.args.parseAsync(n, d).catch((e) => {
1954
- throw r.addIssue(c(n, e)), r;
1955
- }), a = await Reflect.apply(f, this, i);
1956
- return await t._def.returns._def.type.parseAsync(a, d).catch((e) => {
1957
- throw r.addIssue(u(a, e)), r;
1958
- });
1959
- });
1960
- }
1961
- {
1962
- let t = this;
1963
- return s(function(...n) {
1964
- let r = t._def.args.safeParse(n, d);
1965
- if (!r.success) throw new e([c(n, r.error)]);
1966
- let i = Reflect.apply(f, this, r.data), a = t._def.returns.safeParse(i, d);
1967
- if (!a.success) throw new e([u(i, a.error)]);
1968
- return a.data;
1969
- });
1970
- }
1971
- }
1972
- parameters() {
1973
- return this._def.args;
1974
- }
1975
- returnType() {
1976
- return this._def.returns;
1977
- }
1978
- args(...e) {
1979
- return new i({
1980
- ...this._def,
1981
- args: R.create(e).rest(k.create())
1982
- });
1983
- }
1984
- returns(e) {
1985
- return new i({
1986
- ...this._def,
1987
- returns: e
1988
- });
1989
- }
1990
- implement(e) {
1991
- return this.parse(e);
1992
- }
1993
- strictImplement(e) {
1994
- return this.parse(e);
1995
- }
1996
- static create(e, t, n) {
1997
- return new i({
1998
- args: e || R.create([]).rest(k.create()),
1999
- returns: t || k.create(),
2000
- typeName: $.ZodFunction,
2001
- ...v(n)
2002
- });
2003
- }
2004
- }, V = class extends y {
2005
- get schema() {
2006
- return this._def.getter();
2007
- }
2008
- _parse(e) {
2009
- let { ctx: t } = this._processInputParams(e);
2010
- return this._def.getter()._parse({
2011
- data: t.data,
2012
- path: t.path,
2013
- parent: t
2014
- });
2015
- }
2016
- };
2017
- V.create = (e, t) => new V({
2018
- getter: e,
2019
- typeName: $.ZodLazy,
2020
- ...v(t)
2021
- });
2022
- var H = class extends y {
2023
- _parse(e) {
2024
- if (e.data !== this._def.value) {
2025
- let n = this._getOrReturnCtx(e);
2026
- return l(n, {
2027
- received: n.data,
2028
- code: t.invalid_literal,
2029
- expected: this._def.value
2030
- }), o;
2031
- }
2032
- return {
2033
- status: "valid",
2034
- value: e.data
2035
- };
2036
- }
2037
- get value() {
2038
- return this._def.value;
2039
- }
2040
- };
2041
- H.create = (e, t) => new H({
2042
- value: e,
2043
- typeName: $.ZodLiteral,
2044
- ...v(t)
2045
- });
2046
- function je(e, t) {
2047
- return new U({
2048
- values: e,
2049
- typeName: $.ZodEnum,
2050
- ...v(t)
2051
- });
2052
- }
2053
- var U = class e extends y {
2054
- _parse(e) {
2055
- if (typeof e.data != "string") {
2056
- let n = this._getOrReturnCtx(e), r = this._def.values;
2057
- return l(n, {
2058
- expected: g.joinValues(r),
2059
- received: n.parsedType,
2060
- code: t.invalid_type
2061
- }), o;
2062
- }
2063
- if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) {
2064
- let n = this._getOrReturnCtx(e), r = this._def.values;
2065
- return l(n, {
2066
- received: n.data,
2067
- code: t.invalid_enum_value,
2068
- options: r
2069
- }), o;
2070
- }
2071
- return s(e.data);
2072
- }
2073
- get options() {
2074
- return this._def.values;
2075
- }
2076
- get enum() {
2077
- let e = {};
2078
- for (let t of this._def.values) e[t] = t;
2079
- return e;
2080
- }
2081
- get Values() {
2082
- let e = {};
2083
- for (let t of this._def.values) e[t] = t;
2084
- return e;
2085
- }
2086
- get Enum() {
2087
- let e = {};
2088
- for (let t of this._def.values) e[t] = t;
2089
- return e;
2090
- }
2091
- extract(t, n = this._def) {
2092
- return e.create(t, {
2093
- ...this._def,
2094
- ...n
2095
- });
2096
- }
2097
- exclude(t, n = this._def) {
2098
- return e.create(this.options.filter((e) => !t.includes(e)), {
2099
- ...this._def,
2100
- ...n
2101
- });
2102
- }
2103
- };
2104
- U.create = je;
2105
- var W = class extends y {
2106
- _parse(e) {
2107
- let n = g.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
2108
- if (r.parsedType !== m.string && r.parsedType !== m.number) {
2109
- let e = g.objectValues(n);
2110
- return l(r, {
2111
- expected: g.joinValues(e),
2112
- received: r.parsedType,
2113
- code: t.invalid_type
2114
- }), o;
2115
- }
2116
- if (this._cache ||= new Set(g.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) {
2117
- let e = g.objectValues(n);
2118
- return l(r, {
2119
- received: r.data,
2120
- code: t.invalid_enum_value,
2121
- options: e
2122
- }), o;
2123
- }
2124
- return s(e.data);
2125
- }
2126
- get enum() {
2127
- return this._def.values;
2128
- }
2129
- };
2130
- W.create = (e, t) => new W({
2131
- values: e,
2132
- typeName: $.ZodNativeEnum,
2133
- ...v(t)
2134
- });
2135
- var G = class extends y {
2136
- unwrap() {
2137
- return this._def.type;
2138
- }
2139
- _parse(e) {
2140
- let { ctx: n } = this._processInputParams(e);
2141
- if (n.parsedType !== m.promise && n.common.async === !1) return l(n, {
2142
- code: t.invalid_type,
2143
- expected: m.promise,
2144
- received: n.parsedType
2145
- }), o;
2146
- let r = n.parsedType === m.promise ? n.data : Promise.resolve(n.data);
2147
- return s(r.then((e) => this._def.type.parseAsync(e, {
2148
- path: n.path,
2149
- errorMap: n.common.contextualErrorMap
2150
- })));
2151
- }
2152
- };
2153
- G.create = (e, t) => new G({
2154
- type: e,
2155
- typeName: $.ZodPromise,
2156
- ...v(t)
2157
- });
2158
- var K = class extends y {
2159
- innerType() {
2160
- return this._def.schema;
2161
- }
2162
- sourceType() {
2163
- return this._def.schema._def.typeName === $.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2164
- }
2165
- _parse(e) {
2166
- let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
2167
- addIssue: (e) => {
2168
- l(n, e), e.fatal ? t.abort() : t.dirty();
2169
- },
2170
- get path() {
2171
- return n.path;
2172
- }
2173
- };
2174
- if (i.addIssue = i.addIssue.bind(i), r.type === "preprocess") {
2175
- let e = r.transform(n.data, i);
2176
- if (n.common.async) return Promise.resolve(e).then(async (e) => {
2177
- if (t.value === "aborted") return o;
2178
- let r = await this._def.schema._parseAsync({
2179
- data: e,
2180
- path: n.path,
2181
- parent: n
2182
- });
2183
- return r.status === "aborted" ? o : r.status === "dirty" || t.value === "dirty" ? a(r.value) : r;
2184
- });
2185
- {
2186
- if (t.value === "aborted") return o;
2187
- let r = this._def.schema._parseSync({
2188
- data: e,
2189
- path: n.path,
2190
- parent: n
2191
- });
2192
- return r.status === "aborted" ? o : r.status === "dirty" || t.value === "dirty" ? a(r.value) : r;
2193
- }
2194
- }
2195
- if (r.type === "refinement") {
2196
- let e = (e) => {
2197
- let t = r.refinement(e, i);
2198
- if (n.common.async) return Promise.resolve(t);
2199
- if (t instanceof Promise) throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2200
- return e;
2201
- };
2202
- if (n.common.async === !1) {
2203
- let r = this._def.schema._parseSync({
2204
- data: n.data,
2205
- path: n.path,
2206
- parent: n
2207
- });
2208
- return r.status === "aborted" ? o : (r.status === "dirty" && t.dirty(), e(r.value), {
2209
- status: t.value,
2210
- value: r.value
2211
- });
2212
- }
2213
- return this._def.schema._parseAsync({
2214
- data: n.data,
2215
- path: n.path,
2216
- parent: n
2217
- }).then((n) => n.status === "aborted" ? o : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
2218
- status: t.value,
2219
- value: n.value
2220
- }))));
2221
- }
2222
- if (r.type === "transform") {
2223
- if (n.common.async === !1) {
2224
- let e = this._def.schema._parseSync({
2225
- data: n.data,
2226
- path: n.path,
2227
- parent: n
2228
- });
2229
- if (!p(e)) return o;
2230
- let a = r.transform(e.value, i);
2231
- if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2232
- return {
2233
- status: t.value,
2234
- value: a
2235
- };
2236
- }
2237
- return this._def.schema._parseAsync({
2238
- data: n.data,
2239
- path: n.path,
2240
- parent: n
2241
- }).then((e) => p(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
2242
- status: t.value,
2243
- value: e
2244
- })) : o);
2245
- }
2246
- g.assertNever(r);
2247
- }
2248
- };
2249
- K.create = (e, t, n) => new K({
2250
- schema: e,
2251
- typeName: $.ZodEffects,
2252
- effect: t,
2253
- ...v(n)
2254
- }), K.createWithPreprocess = (e, t, n) => new K({
2255
- schema: t,
2256
- effect: {
2257
- type: "preprocess",
2258
- transform: e
2259
- },
2260
- typeName: $.ZodEffects,
2261
- ...v(n)
2262
- });
2263
- var q = class extends y {
2264
- _parse(e) {
2265
- return this._getType(e) === m.undefined ? s(void 0) : this._def.innerType._parse(e);
2266
- }
2267
- unwrap() {
2268
- return this._def.innerType;
2269
- }
2270
- };
2271
- q.create = (e, t) => new q({
2272
- innerType: e,
2273
- typeName: $.ZodOptional,
2274
- ...v(t)
2275
- });
2276
- var J = class extends y {
2277
- _parse(e) {
2278
- return this._getType(e) === m.null ? s(null) : this._def.innerType._parse(e);
2279
- }
2280
- unwrap() {
2281
- return this._def.innerType;
2282
- }
2283
- };
2284
- J.create = (e, t) => new J({
2285
- innerType: e,
2286
- typeName: $.ZodNullable,
2287
- ...v(t)
2288
- });
2289
- var Y = class extends y {
2290
- _parse(e) {
2291
- let { ctx: t } = this._processInputParams(e), n = t.data;
2292
- return t.parsedType === m.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
2293
- data: n,
2294
- path: t.path,
2295
- parent: t
2296
- });
2297
- }
2298
- removeDefault() {
2299
- return this._def.innerType;
2300
- }
2301
- };
2302
- Y.create = (e, t) => new Y({
2303
- innerType: e,
2304
- typeName: $.ZodDefault,
2305
- defaultValue: typeof t.default == "function" ? t.default : () => t.default,
2306
- ...v(t)
2307
- });
2308
- var X = class extends y {
2309
- _parse(t) {
2310
- let { ctx: n } = this._processInputParams(t), r = {
2311
- ...n,
2312
- common: {
2313
- ...n.common,
2314
- issues: []
2315
- }
2316
- }, i = this._def.innerType._parse({
2317
- data: r.data,
2318
- path: r.path,
2319
- parent: { ...r }
2320
- });
2321
- return d(i) ? i.then((t) => ({
2322
- status: "valid",
2323
- value: t.status === "valid" ? t.value : this._def.catchValue({
2324
- get error() {
2325
- return new e(r.common.issues);
2326
- },
2327
- input: r.data
2328
- })
2329
- })) : {
2330
- status: "valid",
2331
- value: i.status === "valid" ? i.value : this._def.catchValue({
2332
- get error() {
2333
- return new e(r.common.issues);
2334
- },
2335
- input: r.data
2336
- })
2337
- };
2338
- }
2339
- removeCatch() {
2340
- return this._def.innerType;
2341
- }
2342
- };
2343
- X.create = (e, t) => new X({
2344
- innerType: e,
2345
- typeName: $.ZodCatch,
2346
- catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
2347
- ...v(t)
2348
- });
2349
- var Z = class extends y {
2350
- _parse(e) {
2351
- if (this._getType(e) !== m.nan) {
2352
- let n = this._getOrReturnCtx(e);
2353
- return l(n, {
2354
- code: t.invalid_type,
2355
- expected: m.nan,
2356
- received: n.parsedType
2357
- }), o;
2358
- }
2359
- return {
2360
- status: "valid",
2361
- value: e.data
2362
- };
2363
- }
2364
- };
2365
- Z.create = (e) => new Z({
2366
- typeName: $.ZodNaN,
2367
- ...v(e)
2368
- });
2369
- var Me = class extends y {
2370
- _parse(e) {
2371
- let { ctx: t } = this._processInputParams(e), n = t.data;
2372
- return this._def.type._parse({
2373
- data: n,
2374
- path: t.path,
2375
- parent: t
2376
- });
2377
- }
2378
- unwrap() {
2379
- return this._def.type;
2380
- }
2381
- }, Ne = class e extends y {
2382
- _parse(e) {
2383
- let { status: t, ctx: n } = this._processInputParams(e);
2384
- if (n.common.async) return (async () => {
2385
- let e = await this._def.in._parseAsync({
2386
- data: n.data,
2387
- path: n.path,
2388
- parent: n
2389
- });
2390
- return e.status === "aborted" ? o : e.status === "dirty" ? (t.dirty(), a(e.value)) : this._def.out._parseAsync({
2391
- data: e.value,
2392
- path: n.path,
2393
- parent: n
2394
- });
2395
- })();
2396
- {
2397
- let e = this._def.in._parseSync({
2398
- data: n.data,
2399
- path: n.path,
2400
- parent: n
2401
- });
2402
- return e.status === "aborted" ? o : e.status === "dirty" ? (t.dirty(), {
2403
- status: "dirty",
2404
- value: e.value
2405
- }) : this._def.out._parseSync({
2406
- data: e.value,
2407
- path: n.path,
2408
- parent: n
2409
- });
2410
- }
2411
- }
2412
- static create(t, n) {
2413
- return new e({
2414
- in: t,
2415
- out: n,
2416
- typeName: $.ZodPipeline
2417
- });
2418
- }
2419
- }, Q = class extends y {
2420
- _parse(e) {
2421
- let t = this._def.innerType._parse(e), n = (e) => (p(e) && (e.value = Object.freeze(e.value)), e);
2422
- return d(t) ? t.then((e) => n(e)) : n(t);
2423
- }
2424
- unwrap() {
2425
- return this._def.innerType;
2426
- }
2427
- };
2428
- Q.create = (e, t) => new Q({
2429
- innerType: e,
2430
- typeName: $.ZodReadonly,
2431
- ...v(t)
2432
- }), P.lazycreate;
2433
- var $;
2434
- (function(e) {
2435
- e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
2436
- })($ ||= {});
2437
- var Pe = b.create, Fe = x.create;
2438
- Z.create, S.create;
2439
- var Ie = C.create;
2440
- w.create, T.create, E.create, D.create, O.create, k.create, A.create, j.create, M.create;
2441
- var Le = P.create;
2442
- P.strictCreate, F.create, De.create, L.create, R.create, ke.create, z.create, B.create, Ae.create, V.create;
2443
- var Re = H.create, ze = U.create;
2444
- W.create, G.create, K.create, q.create, J.create, K.createWithPreprocess, Ne.create;
2445
- var Be = {
2446
- string: ((e) => b.create({
2447
- ...e,
2448
- coerce: !0
2449
- })),
2450
- number: ((e) => x.create({
2451
- ...e,
2452
- coerce: !0
2453
- })),
2454
- boolean: ((e) => C.create({
2455
- ...e,
2456
- coerce: !0
2457
- })),
2458
- bigint: ((e) => S.create({
2459
- ...e,
2460
- coerce: !0
2461
- })),
2462
- date: ((e) => w.create({
2463
- ...e,
2464
- coerce: !0
2465
- }))
2466
- };
2467
- export { y as Schema, y as ZodSchema, y as ZodType, O as ZodAny, M as ZodArray, S as ZodBigInt, C as ZodBoolean, Me as ZodBranded, X as ZodCatch, w as ZodDate, Y as ZodDefault, De as ZodDiscriminatedUnion, K as ZodEffects, K as ZodTransformer, U as ZodEnum, $ as ZodFirstPartyTypeKind, Ae as ZodFunction, L as ZodIntersection, V as ZodLazy, H as ZodLiteral, z as ZodMap, Z as ZodNaN, W as ZodNativeEnum, A as ZodNever, D as ZodNull, J as ZodNullable, x as ZodNumber, P as ZodObject, q as ZodOptional, Ne as ZodPipeline, G as ZodPromise, Q as ZodReadonly, ke as ZodRecord, B as ZodSet, b as ZodString, T as ZodSymbol, R as ZodTuple, E as ZodUndefined, F as ZodUnion, k as ZodUnknown, j as ZodVoid, Ie as boolean, Be as coerce, Se as datetimeRegex, ze as enum, Re as literal, Fe as number, Le as object, Pe as string };
2468
-
2469
- //# sourceMappingURL=types.js.map