react-luminus-components 2.1.8 → 2.1.9

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