PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0-beta3
Elementor Website Builder – more than just a page builder v4.3.0-beta3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / assets / js / packages / schema / schema.js

schema.js in Elementor Website Builder – more than just a page builder 4.3.0-beta3, at assets/js/packages/schema/schema.js

13,994 lines 443.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function() {
2
3 //#region \0rolldown/runtime.js
4 var __defProp = Object.defineProperty;
5 var __name = (target, value) => __defProp(target, "name", {
6 value,
7 configurable: true
8 });
9 var __exportAll = (all, no_symbols) => {
10 let target = {};
11 for (var name in all) {
12 __defProp(target, name, {
13 get: all[name],
14 enumerable: true
15 });
16 }
17 if (!no_symbols) {
18 __defProp(target, Symbol.toStringTag, { value: "Module" });
19 }
20 return target;
21 };
22
23 //#endregion
24
25 //#region node_modules/zod/v3/helpers/util.js
26 var util;
27 (function(util) {
28 util.assertEqual = (_) => {};
29 function assertIs(_arg) {}
30 util.assertIs = assertIs;
31 function assertNever(_x) {
32 throw new Error();
33 }
34 util.assertNever = assertNever;
35 util.arrayToEnum = (items) => {
36 const obj = {};
37 for (const item of items) obj[item] = item;
38 return obj;
39 };
40 util.getValidEnumValues = (obj) => {
41 const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
42 const filtered = {};
43 for (const k of validKeys) filtered[k] = obj[k];
44 return util.objectValues(filtered);
45 };
46 util.objectValues = (obj) => {
47 return util.objectKeys(obj).map(function(e) {
48 return obj[e];
49 });
50 };
51 util.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
52 const keys = [];
53 for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key)) keys.push(key);
54 return keys;
55 };
56 util.find = (arr, checker) => {
57 for (const item of arr) if (checker(item)) return item;
58 };
59 util.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
60 function joinValues(array, separator = " | ") {
61 return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
62 }
63 util.joinValues = joinValues;
64 util.jsonStringifyReplacer = (_, value) => {
65 if (typeof value === "bigint") return value.toString();
66 return value;
67 };
68 })(util || (util = {}));
69 var objectUtil;
70 (function(objectUtil) {
71 objectUtil.mergeShapes = (first, second) => {
72 return {
73 ...first,
74 ...second
75 };
76 };
77 })(objectUtil || (objectUtil = {}));
78 var ZodParsedType = util.arrayToEnum([
79 "string",
80 "nan",
81 "number",
82 "integer",
83 "float",
84 "boolean",
85 "date",
86 "bigint",
87 "symbol",
88 "function",
89 "undefined",
90 "null",
91 "array",
92 "object",
93 "unknown",
94 "promise",
95 "void",
96 "never",
97 "map",
98 "set"
99 ]);
100 var getParsedType$1 = /* @__PURE__ */ __name((data) => {
101 switch (typeof data) {
102 case "undefined": return ZodParsedType.undefined;
103 case "string": return ZodParsedType.string;
104 case "number": return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
105 case "boolean": return ZodParsedType.boolean;
106 case "function": return ZodParsedType.function;
107 case "bigint": return ZodParsedType.bigint;
108 case "symbol": return ZodParsedType.symbol;
109 case "object":
110 if (Array.isArray(data)) return ZodParsedType.array;
111 if (data === null) return ZodParsedType.null;
112 if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") return ZodParsedType.promise;
113 if (typeof Map !== "undefined" && data instanceof Map) return ZodParsedType.map;
114 if (typeof Set !== "undefined" && data instanceof Set) return ZodParsedType.set;
115 if (typeof Date !== "undefined" && data instanceof Date) return ZodParsedType.date;
116 return ZodParsedType.object;
117 default: return ZodParsedType.unknown;
118 }
119 }, "getParsedType");
120
121 //#endregion
122 //#region node_modules/zod/v3/ZodError.js
123 var ZodIssueCode$1 = util.arrayToEnum([
124 "invalid_type",
125 "invalid_literal",
126 "custom",
127 "invalid_union",
128 "invalid_union_discriminator",
129 "invalid_enum_value",
130 "unrecognized_keys",
131 "invalid_arguments",
132 "invalid_return_type",
133 "invalid_date",
134 "invalid_string",
135 "too_small",
136 "too_big",
137 "invalid_intersection_types",
138 "not_multiple_of",
139 "not_finite"
140 ]);
141 var quotelessJson = (obj) => {
142 return JSON.stringify(obj, null, 2).replace(/"([^"]+)":/g, "$1:");
143 };
144 var ZodError$1 = class ZodError$1 extends Error {
145 static {
146 __name(this, "ZodError");
147 }
148 get errors() {
149 return this.issues;
150 }
151 constructor(issues) {
152 super();
153 this.issues = [];
154 this.addIssue = (sub) => {
155 this.issues = [...this.issues, sub];
156 };
157 this.addIssues = (subs = []) => {
158 this.issues = [...this.issues, ...subs];
159 };
160 const actualProto = new.target.prototype;
161 if (Object.setPrototypeOf) Object.setPrototypeOf(this, actualProto);
162 else this.__proto__ = actualProto;
163 this.name = "ZodError";
164 this.issues = issues;
165 }
166 format(_mapper) {
167 const mapper = _mapper || function(issue) {
168 return issue.message;
169 };
170 const fieldErrors = { _errors: [] };
171 const processError = (error) => {
172 for (const issue of error.issues) if (issue.code === "invalid_union") issue.unionErrors.map(processError);
173 else if (issue.code === "invalid_return_type") processError(issue.returnTypeError);
174 else if (issue.code === "invalid_arguments") processError(issue.argumentsError);
175 else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));
176 else {
177 let curr = fieldErrors;
178 let i = 0;
179 while (i < issue.path.length) {
180 const el = issue.path[i];
181 if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
182 else {
183 curr[el] = curr[el] || { _errors: [] };
184 curr[el]._errors.push(mapper(issue));
185 }
186 curr = curr[el];
187 i++;
188 }
189 }
190 };
191 processError(this);
192 return fieldErrors;
193 }
194 static assert(value) {
195 if (!(value instanceof ZodError$1)) throw new Error(`Not a ZodError: ${value}`);
196 }
197 toString() {
198 return this.message;
199 }
200 get message() {
201 return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
202 }
203 get isEmpty() {
204 return this.issues.length === 0;
205 }
206 flatten(mapper = (issue) => issue.message) {
207 const fieldErrors = {};
208 const formErrors = [];
209 for (const sub of this.issues) if (sub.path.length > 0) {
210 const firstEl = sub.path[0];
211 fieldErrors[firstEl] = fieldErrors[firstEl] || [];
212 fieldErrors[firstEl].push(mapper(sub));
213 } else formErrors.push(mapper(sub));
214 return {
215 formErrors,
216 fieldErrors
217 };
218 }
219 get formErrors() {
220 return this.flatten();
221 }
222 };
223 ZodError$1.create = (issues) => {
224 return new ZodError$1(issues);
225 };
226
227 //#endregion
228 //#region node_modules/zod/v3/locales/en.js
229 var errorMap = (issue, _ctx) => {
230 let message;
231 switch (issue.code) {
232 case ZodIssueCode$1.invalid_type:
233 if (issue.received === ZodParsedType.undefined) message = "Required";
234 else message = `Expected ${issue.expected}, received ${issue.received}`;
235 break;
236 case ZodIssueCode$1.invalid_literal:
237 message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
238 break;
239 case ZodIssueCode$1.unrecognized_keys:
240 message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
241 break;
242 case ZodIssueCode$1.invalid_union:
243 message = `Invalid input`;
244 break;
245 case ZodIssueCode$1.invalid_union_discriminator:
246 message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
247 break;
248 case ZodIssueCode$1.invalid_enum_value:
249 message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
250 break;
251 case ZodIssueCode$1.invalid_arguments:
252 message = `Invalid function arguments`;
253 break;
254 case ZodIssueCode$1.invalid_return_type:
255 message = `Invalid function return type`;
256 break;
257 case ZodIssueCode$1.invalid_date:
258 message = `Invalid date`;
259 break;
260 case ZodIssueCode$1.invalid_string:
261 if (typeof issue.validation === "object") if ("includes" in issue.validation) {
262 message = `Invalid input: must include "${issue.validation.includes}"`;
263 if (typeof issue.validation.position === "number") message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
264 } else if ("startsWith" in issue.validation) message = `Invalid input: must start with "${issue.validation.startsWith}"`;
265 else if ("endsWith" in issue.validation) message = `Invalid input: must end with "${issue.validation.endsWith}"`;
266 else util.assertNever(issue.validation);
267 else if (issue.validation !== "regex") message = `Invalid ${issue.validation}`;
268 else message = "Invalid";
269 break;
270 case ZodIssueCode$1.too_small:
271 if (issue.type === "array") message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
272 else if (issue.type === "string") message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
273 else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
274 else if (issue.type === "bigint") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
275 else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
276 else message = "Invalid input";
277 break;
278 case ZodIssueCode$1.too_big:
279 if (issue.type === "array") message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
280 else if (issue.type === "string") message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
281 else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
282 else if (issue.type === "bigint") message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
283 else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
284 else message = "Invalid input";
285 break;
286 case ZodIssueCode$1.custom:
287 message = `Invalid input`;
288 break;
289 case ZodIssueCode$1.invalid_intersection_types:
290 message = `Intersection results could not be merged`;
291 break;
292 case ZodIssueCode$1.not_multiple_of:
293 message = `Number must be a multiple of ${issue.multipleOf}`;
294 break;
295 case ZodIssueCode$1.not_finite:
296 message = "Number must be finite";
297 break;
298 default:
299 message = _ctx.defaultError;
300 util.assertNever(issue);
301 }
302 return { message };
303 };
304
305 //#endregion
306 //#region node_modules/zod/v3/errors.js
307 var overrideErrorMap = errorMap;
308 function setErrorMap$1(map) {
309 overrideErrorMap = map;
310 }
311 __name(setErrorMap$1, "setErrorMap");
312 function getErrorMap$1() {
313 return overrideErrorMap;
314 }
315 __name(getErrorMap$1, "getErrorMap");
316
317 //#endregion
318 //#region node_modules/zod/v3/helpers/parseUtil.js
319 var makeIssue = (params) => {
320 const { data, path, errorMaps, issueData } = params;
321 const fullPath = [...path, ...issueData.path || []];
322 const fullIssue = {
323 ...issueData,
324 path: fullPath
325 };
326 if (issueData.message !== void 0) return {
327 ...issueData,
328 path: fullPath,
329 message: issueData.message
330 };
331 let errorMessage = "";
332 const maps = errorMaps.filter((m) => !!m).slice().reverse();
333 for (const map of maps) errorMessage = map(fullIssue, {
334 data,
335 defaultError: errorMessage
336 }).message;
337 return {
338 ...issueData,
339 path: fullPath,
340 message: errorMessage
341 };
342 };
343 var EMPTY_PATH = [];
344 function addIssueToContext(ctx, issueData) {
345 const overrideMap = getErrorMap$1();
346 const issue = makeIssue({
347 issueData,
348 data: ctx.data,
349 path: ctx.path,
350 errorMaps: [
351 ctx.common.contextualErrorMap,
352 ctx.schemaErrorMap,
353 overrideMap,
354 overrideMap === errorMap ? void 0 : errorMap
355 ].filter((x) => !!x)
356 });
357 ctx.common.issues.push(issue);
358 }
359 var ParseStatus = class ParseStatus {
360 constructor() {
361 this.value = "valid";
362 }
363 dirty() {
364 if (this.value === "valid") this.value = "dirty";
365 }
366 abort() {
367 if (this.value !== "aborted") this.value = "aborted";
368 }
369 static mergeArray(status, results) {
370 const arrayValue = [];
371 for (const s of results) {
372 if (s.status === "aborted") return INVALID;
373 if (s.status === "dirty") status.dirty();
374 arrayValue.push(s.value);
375 }
376 return {
377 status: status.value,
378 value: arrayValue
379 };
380 }
381 static async mergeObjectAsync(status, pairs) {
382 const syncPairs = [];
383 for (const pair of pairs) {
384 const key = await pair.key;
385 const value = await pair.value;
386 syncPairs.push({
387 key,
388 value
389 });
390 }
391 return ParseStatus.mergeObjectSync(status, syncPairs);
392 }
393 static mergeObjectSync(status, pairs) {
394 const finalObject = {};
395 for (const pair of pairs) {
396 const { key, value } = pair;
397 if (key.status === "aborted") return INVALID;
398 if (value.status === "aborted") return INVALID;
399 if (key.status === "dirty") status.dirty();
400 if (value.status === "dirty") status.dirty();
401 if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) finalObject[key.value] = value.value;
402 }
403 return {
404 status: status.value,
405 value: finalObject
406 };
407 }
408 };
409 var INVALID = Object.freeze({ status: "aborted" });
410 var DIRTY = (value) => ({
411 status: "dirty",
412 value
413 });
414 var OK = (value) => ({
415 status: "valid",
416 value
417 });
418 var isAborted = (x) => x.status === "aborted";
419 var isDirty = (x) => x.status === "dirty";
420 var isValid = (x) => x.status === "valid";
421 var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
422
423 //#endregion
424 //#region node_modules/zod/v3/helpers/errorUtil.js
425 var errorUtil;
426 (function(errorUtil) {
427 errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
428 errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
429 })(errorUtil || (errorUtil = {}));
430
431 //#endregion
432 //#region node_modules/zod/v3/types.js
433 var ParseInputLazyPath = class {
434 constructor(parent, value, path, key) {
435 this._cachedPath = [];
436 this.parent = parent;
437 this.data = value;
438 this._path = path;
439 this._key = key;
440 }
441 get path() {
442 if (!this._cachedPath.length) if (Array.isArray(this._key)) this._cachedPath.push(...this._path, ...this._key);
443 else this._cachedPath.push(...this._path, this._key);
444 return this._cachedPath;
445 }
446 };
447 var handleResult = (ctx, result) => {
448 if (isValid(result)) return {
449 success: true,
450 data: result.value
451 };
452 else {
453 if (!ctx.common.issues.length) throw new Error("Validation failed but no issues detected.");
454 return {
455 success: false,
456 get error() {
457 if (this._error) return this._error;
458 const error = new ZodError$1(ctx.common.issues);
459 this._error = error;
460 return this._error;
461 }
462 };
463 }
464 };
465 function processCreateParams(params) {
466 if (!params) return {};
467 const { errorMap, invalid_type_error, required_error, description } = params;
468 if (errorMap && (invalid_type_error || required_error)) throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
469 if (errorMap) return {
470 errorMap,
471 description
472 };
473 const customMap = (iss, ctx) => {
474 const { message } = params;
475 if (iss.code === "invalid_enum_value") return { message: message ?? ctx.defaultError };
476 if (typeof ctx.data === "undefined") return { message: message ?? required_error ?? ctx.defaultError };
477 if (iss.code !== "invalid_type") return { message: ctx.defaultError };
478 return { message: message ?? invalid_type_error ?? ctx.defaultError };
479 };
480 return {
481 errorMap: customMap,
482 description
483 };
484 }
485 var ZodType$1 = class {
486 static {
487 __name(this, "ZodType");
488 }
489 get description() {
490 return this._def.description;
491 }
492 _getType(input) {
493 return getParsedType$1(input.data);
494 }
495 _getOrReturnCtx(input, ctx) {
496 return ctx || {
497 common: input.parent.common,
498 data: input.data,
499 parsedType: getParsedType$1(input.data),
500 schemaErrorMap: this._def.errorMap,
501 path: input.path,
502 parent: input.parent
503 };
504 }
505 _processInputParams(input) {
506 return {
507 status: new ParseStatus(),
508 ctx: {
509 common: input.parent.common,
510 data: input.data,
511 parsedType: getParsedType$1(input.data),
512 schemaErrorMap: this._def.errorMap,
513 path: input.path,
514 parent: input.parent
515 }
516 };
517 }
518 _parseSync(input) {
519 const result = this._parse(input);
520 if (isAsync(result)) throw new Error("Synchronous parse encountered promise.");
521 return result;
522 }
523 _parseAsync(input) {
524 const result = this._parse(input);
525 return Promise.resolve(result);
526 }
527 parse(data, params) {
528 const result = this.safeParse(data, params);
529 if (result.success) return result.data;
530 throw result.error;
531 }
532 safeParse(data, params) {
533 const ctx = {
534 common: {
535 issues: [],
536 async: params?.async ?? false,
537 contextualErrorMap: params?.errorMap
538 },
539 path: params?.path || [],
540 schemaErrorMap: this._def.errorMap,
541 parent: null,
542 data,
543 parsedType: getParsedType$1(data)
544 };
545 const result = this._parseSync({
546 data,
547 path: ctx.path,
548 parent: ctx
549 });
550 return handleResult(ctx, result);
551 }
552 "~validate"(data) {
553 const ctx = {
554 common: {
555 issues: [],
556 async: !!this["~standard"].async
557 },
558 path: [],
559 schemaErrorMap: this._def.errorMap,
560 parent: null,
561 data,
562 parsedType: getParsedType$1(data)
563 };
564 if (!this["~standard"].async) try {
565 const result = this._parseSync({
566 data,
567 path: [],
568 parent: ctx
569 });
570 return isValid(result) ? { value: result.value } : { issues: ctx.common.issues };
571 } catch (err) {
572 if (err?.message?.toLowerCase()?.includes("encountered")) this["~standard"].async = true;
573 ctx.common = {
574 issues: [],
575 async: true
576 };
577 }
578 return this._parseAsync({
579 data,
580 path: [],
581 parent: ctx
582 }).then((result) => isValid(result) ? { value: result.value } : { issues: ctx.common.issues });
583 }
584 async parseAsync(data, params) {
585 const result = await this.safeParseAsync(data, params);
586 if (result.success) return result.data;
587 throw result.error;
588 }
589 async safeParseAsync(data, params) {
590 const ctx = {
591 common: {
592 issues: [],
593 contextualErrorMap: params?.errorMap,
594 async: true
595 },
596 path: params?.path || [],
597 schemaErrorMap: this._def.errorMap,
598 parent: null,
599 data,
600 parsedType: getParsedType$1(data)
601 };
602 const maybeAsyncResult = this._parse({
603 data,
604 path: ctx.path,
605 parent: ctx
606 });
607 const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
608 return handleResult(ctx, result);
609 }
610 refine(check, message) {
611 const getIssueProperties = (val) => {
612 if (typeof message === "string" || typeof message === "undefined") return { message };
613 else if (typeof message === "function") return message(val);
614 else return message;
615 };
616 return this._refinement((val, ctx) => {
617 const result = check(val);
618 const setError = () => ctx.addIssue({
619 code: ZodIssueCode$1.custom,
620 ...getIssueProperties(val)
621 });
622 if (typeof Promise !== "undefined" && result instanceof Promise) return result.then((data) => {
623 if (!data) {
624 setError();
625 return false;
626 } else return true;
627 });
628 if (!result) {
629 setError();
630 return false;
631 } else return true;
632 });
633 }
634 refinement(check, refinementData) {
635 return this._refinement((val, ctx) => {
636 if (!check(val)) {
637 ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
638 return false;
639 } else return true;
640 });
641 }
642 _refinement(refinement) {
643 return new ZodEffects({
644 schema: this,
645 typeName: ZodFirstPartyTypeKind.ZodEffects,
646 effect: {
647 type: "refinement",
648 refinement
649 }
650 });
651 }
652 superRefine(refinement) {
653 return this._refinement(refinement);
654 }
655 constructor(def) {
656 /** Alias of safeParseAsync */
657 this.spa = this.safeParseAsync;
658 this._def = def;
659 this.parse = this.parse.bind(this);
660 this.safeParse = this.safeParse.bind(this);
661 this.parseAsync = this.parseAsync.bind(this);
662 this.safeParseAsync = this.safeParseAsync.bind(this);
663 this.spa = this.spa.bind(this);
664 this.refine = this.refine.bind(this);
665 this.refinement = this.refinement.bind(this);
666 this.superRefine = this.superRefine.bind(this);
667 this.optional = this.optional.bind(this);
668 this.nullable = this.nullable.bind(this);
669 this.nullish = this.nullish.bind(this);
670 this.array = this.array.bind(this);
671 this.promise = this.promise.bind(this);
672 this.or = this.or.bind(this);
673 this.and = this.and.bind(this);
674 this.transform = this.transform.bind(this);
675 this.brand = this.brand.bind(this);
676 this.default = this.default.bind(this);
677 this.catch = this.catch.bind(this);
678 this.describe = this.describe.bind(this);
679 this.pipe = this.pipe.bind(this);
680 this.readonly = this.readonly.bind(this);
681 this.isNullable = this.isNullable.bind(this);
682 this.isOptional = this.isOptional.bind(this);
683 this["~standard"] = {
684 version: 1,
685 vendor: "zod",
686 validate: (data) => this["~validate"](data)
687 };
688 }
689 optional() {
690 return ZodOptional$1.create(this, this._def);
691 }
692 nullable() {
693 return ZodNullable$1.create(this, this._def);
694 }
695 nullish() {
696 return this.nullable().optional();
697 }
698 array() {
699 return ZodArray$1.create(this);
700 }
701 promise() {
702 return ZodPromise$1.create(this, this._def);
703 }
704 or(option) {
705 return ZodUnion$1.create([this, option], this._def);
706 }
707 and(incoming) {
708 return ZodIntersection$1.create(this, incoming, this._def);
709 }
710 transform(transform) {
711 return new ZodEffects({
712 ...processCreateParams(this._def),
713 schema: this,
714 typeName: ZodFirstPartyTypeKind.ZodEffects,
715 effect: {
716 type: "transform",
717 transform
718 }
719 });
720 }
721 default(def) {
722 const defaultValueFunc = typeof def === "function" ? def : () => def;
723 return new ZodDefault$1({
724 ...processCreateParams(this._def),
725 innerType: this,
726 defaultValue: defaultValueFunc,
727 typeName: ZodFirstPartyTypeKind.ZodDefault
728 });
729 }
730 brand() {
731 return new ZodBranded({
732 typeName: ZodFirstPartyTypeKind.ZodBranded,
733 type: this,
734 ...processCreateParams(this._def)
735 });
736 }
737 catch(def) {
738 const catchValueFunc = typeof def === "function" ? def : () => def;
739 return new ZodCatch$1({
740 ...processCreateParams(this._def),
741 innerType: this,
742 catchValue: catchValueFunc,
743 typeName: ZodFirstPartyTypeKind.ZodCatch
744 });
745 }
746 describe(description) {
747 const This = this.constructor;
748 return new This({
749 ...this._def,
750 description
751 });
752 }
753 pipe(target) {
754 return ZodPipeline.create(this, target);
755 }
756 readonly() {
757 return ZodReadonly$1.create(this);
758 }
759 isOptional() {
760 return this.safeParse(void 0).success;
761 }
762 isNullable() {
763 return this.safeParse(null).success;
764 }
765 };
766 var cuidRegex = /^c[^\s-]{8,}$/i;
767 var cuid2Regex = /^[0-9a-z]+$/;
768 var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
769 var uuidRegex = /^[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;
770 var nanoidRegex = /^[a-z0-9_-]{21}$/i;
771 var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
772 var durationRegex = /^[-+]?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)?)??$/;
773 var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
774 var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
775 var emojiRegex;
776 var ipv4Regex = /^(?:(?: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])$/;
777 var ipv4CidrRegex = /^(?:(?: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])$/;
778 var ipv6Regex = /^(([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]))$/;
779 var ipv6CidrRegex = /^(([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])$/;
780 var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
781 var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
782 var dateRegexSource = `((\\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])))`;
783 var dateRegex = new RegExp(`^${dateRegexSource}$`);
784 function timeRegexSource(args) {
785 let secondsRegexSource = `[0-5]\\d`;
786 if (args.precision) secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
787 else if (args.precision == null) secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
788 const secondsQuantifier = args.precision ? "+" : "?";
789 return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
790 }
791 function timeRegex(args) {
792 return new RegExp(`^${timeRegexSource(args)}$`);
793 }
794 function datetimeRegex(args) {
795 let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
796 const opts = [];
797 opts.push(args.local ? `Z?` : `Z`);
798 if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`);
799 regex = `${regex}(${opts.join("|")})`;
800 return new RegExp(`^${regex}$`);
801 }
802 function isValidIP(ip, version) {
803 if ((version === "v4" || !version) && ipv4Regex.test(ip)) return true;
804 if ((version === "v6" || !version) && ipv6Regex.test(ip)) return true;
805 return false;
806 }
807 function isValidJWT$1(jwt, alg) {
808 if (!jwtRegex.test(jwt)) return false;
809 try {
810 const [header] = jwt.split(".");
811 if (!header) return false;
812 const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
813 const decoded = JSON.parse(atob(base64));
814 if (typeof decoded !== "object" || decoded === null) return false;
815 if ("typ" in decoded && decoded?.typ !== "JWT") return false;
816 if (!decoded.alg) return false;
817 if (alg && decoded.alg !== alg) return false;
818 return true;
819 } catch {
820 return false;
821 }
822 }
823 __name(isValidJWT$1, "isValidJWT");
824 function isValidCidr(ip, version) {
825 if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) return true;
826 if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) return true;
827 return false;
828 }
829 var ZodString$1 = class ZodString$1 extends ZodType$1 {
830 static {
831 __name(this, "ZodString");
832 }
833 _parse(input) {
834 if (this._def.coerce) input.data = String(input.data);
835 if (this._getType(input) !== ZodParsedType.string) {
836 const ctx = this._getOrReturnCtx(input);
837 addIssueToContext(ctx, {
838 code: ZodIssueCode$1.invalid_type,
839 expected: ZodParsedType.string,
840 received: ctx.parsedType
841 });
842 return INVALID;
843 }
844 const status = new ParseStatus();
845 let ctx = void 0;
846 for (const check of this._def.checks) if (check.kind === "min") {
847 if (input.data.length < check.value) {
848 ctx = this._getOrReturnCtx(input, ctx);
849 addIssueToContext(ctx, {
850 code: ZodIssueCode$1.too_small,
851 minimum: check.value,
852 type: "string",
853 inclusive: true,
854 exact: false,
855 message: check.message
856 });
857 status.dirty();
858 }
859 } else if (check.kind === "max") {
860 if (input.data.length > check.value) {
861 ctx = this._getOrReturnCtx(input, ctx);
862 addIssueToContext(ctx, {
863 code: ZodIssueCode$1.too_big,
864 maximum: check.value,
865 type: "string",
866 inclusive: true,
867 exact: false,
868 message: check.message
869 });
870 status.dirty();
871 }
872 } else if (check.kind === "length") {
873 const tooBig = input.data.length > check.value;
874 const tooSmall = input.data.length < check.value;
875 if (tooBig || tooSmall) {
876 ctx = this._getOrReturnCtx(input, ctx);
877 if (tooBig) addIssueToContext(ctx, {
878 code: ZodIssueCode$1.too_big,
879 maximum: check.value,
880 type: "string",
881 inclusive: true,
882 exact: true,
883 message: check.message
884 });
885 else if (tooSmall) addIssueToContext(ctx, {
886 code: ZodIssueCode$1.too_small,
887 minimum: check.value,
888 type: "string",
889 inclusive: true,
890 exact: true,
891 message: check.message
892 });
893 status.dirty();
894 }
895 } else if (check.kind === "email") {
896 if (!emailRegex.test(input.data)) {
897 ctx = this._getOrReturnCtx(input, ctx);
898 addIssueToContext(ctx, {
899 validation: "email",
900 code: ZodIssueCode$1.invalid_string,
901 message: check.message
902 });
903 status.dirty();
904 }
905 } else if (check.kind === "emoji") {
906 if (!emojiRegex) emojiRegex = new RegExp(_emojiRegex, "u");
907 if (!emojiRegex.test(input.data)) {
908 ctx = this._getOrReturnCtx(input, ctx);
909 addIssueToContext(ctx, {
910 validation: "emoji",
911 code: ZodIssueCode$1.invalid_string,
912 message: check.message
913 });
914 status.dirty();
915 }
916 } else if (check.kind === "uuid") {
917 if (!uuidRegex.test(input.data)) {
918 ctx = this._getOrReturnCtx(input, ctx);
919 addIssueToContext(ctx, {
920 validation: "uuid",
921 code: ZodIssueCode$1.invalid_string,
922 message: check.message
923 });
924 status.dirty();
925 }
926 } else if (check.kind === "nanoid") {
927 if (!nanoidRegex.test(input.data)) {
928 ctx = this._getOrReturnCtx(input, ctx);
929 addIssueToContext(ctx, {
930 validation: "nanoid",
931 code: ZodIssueCode$1.invalid_string,
932 message: check.message
933 });
934 status.dirty();
935 }
936 } else if (check.kind === "cuid") {
937 if (!cuidRegex.test(input.data)) {
938 ctx = this._getOrReturnCtx(input, ctx);
939 addIssueToContext(ctx, {
940 validation: "cuid",
941 code: ZodIssueCode$1.invalid_string,
942 message: check.message
943 });
944 status.dirty();
945 }
946 } else if (check.kind === "cuid2") {
947 if (!cuid2Regex.test(input.data)) {
948 ctx = this._getOrReturnCtx(input, ctx);
949 addIssueToContext(ctx, {
950 validation: "cuid2",
951 code: ZodIssueCode$1.invalid_string,
952 message: check.message
953 });
954 status.dirty();
955 }
956 } else if (check.kind === "ulid") {
957 if (!ulidRegex.test(input.data)) {
958 ctx = this._getOrReturnCtx(input, ctx);
959 addIssueToContext(ctx, {
960 validation: "ulid",
961 code: ZodIssueCode$1.invalid_string,
962 message: check.message
963 });
964 status.dirty();
965 }
966 } else if (check.kind === "url") try {
967 new URL(input.data);
968 } catch {
969 ctx = this._getOrReturnCtx(input, ctx);
970 addIssueToContext(ctx, {
971 validation: "url",
972 code: ZodIssueCode$1.invalid_string,
973 message: check.message
974 });
975 status.dirty();
976 }
977 else if (check.kind === "regex") {
978 check.regex.lastIndex = 0;
979 if (!check.regex.test(input.data)) {
980 ctx = this._getOrReturnCtx(input, ctx);
981 addIssueToContext(ctx, {
982 validation: "regex",
983 code: ZodIssueCode$1.invalid_string,
984 message: check.message
985 });
986 status.dirty();
987 }
988 } else if (check.kind === "trim") input.data = input.data.trim();
989 else if (check.kind === "includes") {
990 if (!input.data.includes(check.value, check.position)) {
991 ctx = this._getOrReturnCtx(input, ctx);
992 addIssueToContext(ctx, {
993 code: ZodIssueCode$1.invalid_string,
994 validation: {
995 includes: check.value,
996 position: check.position
997 },
998 message: check.message
999 });
1000 status.dirty();
1001 }
1002 } else if (check.kind === "toLowerCase") input.data = input.data.toLowerCase();
1003 else if (check.kind === "toUpperCase") input.data = input.data.toUpperCase();
1004 else if (check.kind === "startsWith") {
1005 if (!input.data.startsWith(check.value)) {
1006 ctx = this._getOrReturnCtx(input, ctx);
1007 addIssueToContext(ctx, {
1008 code: ZodIssueCode$1.invalid_string,
1009 validation: { startsWith: check.value },
1010 message: check.message
1011 });
1012 status.dirty();
1013 }
1014 } else if (check.kind === "endsWith") {
1015 if (!input.data.endsWith(check.value)) {
1016 ctx = this._getOrReturnCtx(input, ctx);
1017 addIssueToContext(ctx, {
1018 code: ZodIssueCode$1.invalid_string,
1019 validation: { endsWith: check.value },
1020 message: check.message
1021 });
1022 status.dirty();
1023 }
1024 } else if (check.kind === "datetime") {
1025 if (!datetimeRegex(check).test(input.data)) {
1026 ctx = this._getOrReturnCtx(input, ctx);
1027 addIssueToContext(ctx, {
1028 code: ZodIssueCode$1.invalid_string,
1029 validation: "datetime",
1030 message: check.message
1031 });
1032 status.dirty();
1033 }
1034 } else if (check.kind === "date") {
1035 if (!dateRegex.test(input.data)) {
1036 ctx = this._getOrReturnCtx(input, ctx);
1037 addIssueToContext(ctx, {
1038 code: ZodIssueCode$1.invalid_string,
1039 validation: "date",
1040 message: check.message
1041 });
1042 status.dirty();
1043 }
1044 } else if (check.kind === "time") {
1045 if (!timeRegex(check).test(input.data)) {
1046 ctx = this._getOrReturnCtx(input, ctx);
1047 addIssueToContext(ctx, {
1048 code: ZodIssueCode$1.invalid_string,
1049 validation: "time",
1050 message: check.message
1051 });
1052 status.dirty();
1053 }
1054 } else if (check.kind === "duration") {
1055 if (!durationRegex.test(input.data)) {
1056 ctx = this._getOrReturnCtx(input, ctx);
1057 addIssueToContext(ctx, {
1058 validation: "duration",
1059 code: ZodIssueCode$1.invalid_string,
1060 message: check.message
1061 });
1062 status.dirty();
1063 }
1064 } else if (check.kind === "ip") {
1065 if (!isValidIP(input.data, check.version)) {
1066 ctx = this._getOrReturnCtx(input, ctx);
1067 addIssueToContext(ctx, {
1068 validation: "ip",
1069 code: ZodIssueCode$1.invalid_string,
1070 message: check.message
1071 });
1072 status.dirty();
1073 }
1074 } else if (check.kind === "jwt") {
1075 if (!isValidJWT$1(input.data, check.alg)) {
1076 ctx = this._getOrReturnCtx(input, ctx);
1077 addIssueToContext(ctx, {
1078 validation: "jwt",
1079 code: ZodIssueCode$1.invalid_string,
1080 message: check.message
1081 });
1082 status.dirty();
1083 }
1084 } else if (check.kind === "cidr") {
1085 if (!isValidCidr(input.data, check.version)) {
1086 ctx = this._getOrReturnCtx(input, ctx);
1087 addIssueToContext(ctx, {
1088 validation: "cidr",
1089 code: ZodIssueCode$1.invalid_string,
1090 message: check.message
1091 });
1092 status.dirty();
1093 }
1094 } else if (check.kind === "base64") {
1095 if (!base64Regex.test(input.data)) {
1096 ctx = this._getOrReturnCtx(input, ctx);
1097 addIssueToContext(ctx, {
1098 validation: "base64",
1099 code: ZodIssueCode$1.invalid_string,
1100 message: check.message
1101 });
1102 status.dirty();
1103 }
1104 } else if (check.kind === "base64url") {
1105 if (!base64urlRegex.test(input.data)) {
1106 ctx = this._getOrReturnCtx(input, ctx);
1107 addIssueToContext(ctx, {
1108 validation: "base64url",
1109 code: ZodIssueCode$1.invalid_string,
1110 message: check.message
1111 });
1112 status.dirty();
1113 }
1114 } else util.assertNever(check);
1115 return {
1116 status: status.value,
1117 value: input.data
1118 };
1119 }
1120 _regex(regex, validation, message) {
1121 return this.refinement((data) => regex.test(data), {
1122 validation,
1123 code: ZodIssueCode$1.invalid_string,
1124 ...errorUtil.errToObj(message)
1125 });
1126 }
1127 _addCheck(check) {
1128 return new ZodString$1({
1129 ...this._def,
1130 checks: [...this._def.checks, check]
1131 });
1132 }
1133 email(message) {
1134 return this._addCheck({
1135 kind: "email",
1136 ...errorUtil.errToObj(message)
1137 });
1138 }
1139 url(message) {
1140 return this._addCheck({
1141 kind: "url",
1142 ...errorUtil.errToObj(message)
1143 });
1144 }
1145 emoji(message) {
1146 return this._addCheck({
1147 kind: "emoji",
1148 ...errorUtil.errToObj(message)
1149 });
1150 }
1151 uuid(message) {
1152 return this._addCheck({
1153 kind: "uuid",
1154 ...errorUtil.errToObj(message)
1155 });
1156 }
1157 nanoid(message) {
1158 return this._addCheck({
1159 kind: "nanoid",
1160 ...errorUtil.errToObj(message)
1161 });
1162 }
1163 cuid(message) {
1164 return this._addCheck({
1165 kind: "cuid",
1166 ...errorUtil.errToObj(message)
1167 });
1168 }
1169 cuid2(message) {
1170 return this._addCheck({
1171 kind: "cuid2",
1172 ...errorUtil.errToObj(message)
1173 });
1174 }
1175 ulid(message) {
1176 return this._addCheck({
1177 kind: "ulid",
1178 ...errorUtil.errToObj(message)
1179 });
1180 }
1181 base64(message) {
1182 return this._addCheck({
1183 kind: "base64",
1184 ...errorUtil.errToObj(message)
1185 });
1186 }
1187 base64url(message) {
1188 return this._addCheck({
1189 kind: "base64url",
1190 ...errorUtil.errToObj(message)
1191 });
1192 }
1193 jwt(options) {
1194 return this._addCheck({
1195 kind: "jwt",
1196 ...errorUtil.errToObj(options)
1197 });
1198 }
1199 ip(options) {
1200 return this._addCheck({
1201 kind: "ip",
1202 ...errorUtil.errToObj(options)
1203 });
1204 }
1205 cidr(options) {
1206 return this._addCheck({
1207 kind: "cidr",
1208 ...errorUtil.errToObj(options)
1209 });
1210 }
1211 datetime(options) {
1212 if (typeof options === "string") return this._addCheck({
1213 kind: "datetime",
1214 precision: null,
1215 offset: false,
1216 local: false,
1217 message: options
1218 });
1219 return this._addCheck({
1220 kind: "datetime",
1221 precision: typeof options?.precision === "undefined" ? null : options?.precision,
1222 offset: options?.offset ?? false,
1223 local: options?.local ?? false,
1224 ...errorUtil.errToObj(options?.message)
1225 });
1226 }
1227 date(message) {
1228 return this._addCheck({
1229 kind: "date",
1230 message
1231 });
1232 }
1233 time(options) {
1234 if (typeof options === "string") return this._addCheck({
1235 kind: "time",
1236 precision: null,
1237 message: options
1238 });
1239 return this._addCheck({
1240 kind: "time",
1241 precision: typeof options?.precision === "undefined" ? null : options?.precision,
1242 ...errorUtil.errToObj(options?.message)
1243 });
1244 }
1245 duration(message) {
1246 return this._addCheck({
1247 kind: "duration",
1248 ...errorUtil.errToObj(message)
1249 });
1250 }
1251 regex(regex, message) {
1252 return this._addCheck({
1253 kind: "regex",
1254 regex,
1255 ...errorUtil.errToObj(message)
1256 });
1257 }
1258 includes(value, options) {
1259 return this._addCheck({
1260 kind: "includes",
1261 value,
1262 position: options?.position,
1263 ...errorUtil.errToObj(options?.message)
1264 });
1265 }
1266 startsWith(value, message) {
1267 return this._addCheck({
1268 kind: "startsWith",
1269 value,
1270 ...errorUtil.errToObj(message)
1271 });
1272 }
1273 endsWith(value, message) {
1274 return this._addCheck({
1275 kind: "endsWith",
1276 value,
1277 ...errorUtil.errToObj(message)
1278 });
1279 }
1280 min(minLength, message) {
1281 return this._addCheck({
1282 kind: "min",
1283 value: minLength,
1284 ...errorUtil.errToObj(message)
1285 });
1286 }
1287 max(maxLength, message) {
1288 return this._addCheck({
1289 kind: "max",
1290 value: maxLength,
1291 ...errorUtil.errToObj(message)
1292 });
1293 }
1294 length(len, message) {
1295 return this._addCheck({
1296 kind: "length",
1297 value: len,
1298 ...errorUtil.errToObj(message)
1299 });
1300 }
1301 /**
1302 * Equivalent to `.min(1)`
1303 */
1304 nonempty(message) {
1305 return this.min(1, errorUtil.errToObj(message));
1306 }
1307 trim() {
1308 return new ZodString$1({
1309 ...this._def,
1310 checks: [...this._def.checks, { kind: "trim" }]
1311 });
1312 }
1313 toLowerCase() {
1314 return new ZodString$1({
1315 ...this._def,
1316 checks: [...this._def.checks, { kind: "toLowerCase" }]
1317 });
1318 }
1319 toUpperCase() {
1320 return new ZodString$1({
1321 ...this._def,
1322 checks: [...this._def.checks, { kind: "toUpperCase" }]
1323 });
1324 }
1325 get isDatetime() {
1326 return !!this._def.checks.find((ch) => ch.kind === "datetime");
1327 }
1328 get isDate() {
1329 return !!this._def.checks.find((ch) => ch.kind === "date");
1330 }
1331 get isTime() {
1332 return !!this._def.checks.find((ch) => ch.kind === "time");
1333 }
1334 get isDuration() {
1335 return !!this._def.checks.find((ch) => ch.kind === "duration");
1336 }
1337 get isEmail() {
1338 return !!this._def.checks.find((ch) => ch.kind === "email");
1339 }
1340 get isURL() {
1341 return !!this._def.checks.find((ch) => ch.kind === "url");
1342 }
1343 get isEmoji() {
1344 return !!this._def.checks.find((ch) => ch.kind === "emoji");
1345 }
1346 get isUUID() {
1347 return !!this._def.checks.find((ch) => ch.kind === "uuid");
1348 }
1349 get isNANOID() {
1350 return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1351 }
1352 get isCUID() {
1353 return !!this._def.checks.find((ch) => ch.kind === "cuid");
1354 }
1355 get isCUID2() {
1356 return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1357 }
1358 get isULID() {
1359 return !!this._def.checks.find((ch) => ch.kind === "ulid");
1360 }
1361 get isIP() {
1362 return !!this._def.checks.find((ch) => ch.kind === "ip");
1363 }
1364 get isCIDR() {
1365 return !!this._def.checks.find((ch) => ch.kind === "cidr");
1366 }
1367 get isBase64() {
1368 return !!this._def.checks.find((ch) => ch.kind === "base64");
1369 }
1370 get isBase64url() {
1371 return !!this._def.checks.find((ch) => ch.kind === "base64url");
1372 }
1373 get minLength() {
1374 let min = null;
1375 for (const ch of this._def.checks) if (ch.kind === "min") {
1376 if (min === null || ch.value > min) min = ch.value;
1377 }
1378 return min;
1379 }
1380 get maxLength() {
1381 let max = null;
1382 for (const ch of this._def.checks) if (ch.kind === "max") {
1383 if (max === null || ch.value < max) max = ch.value;
1384 }
1385 return max;
1386 }
1387 };
1388 ZodString$1.create = (params) => {
1389 return new ZodString$1({
1390 checks: [],
1391 typeName: ZodFirstPartyTypeKind.ZodString,
1392 coerce: params?.coerce ?? false,
1393 ...processCreateParams(params)
1394 });
1395 };
1396 function floatSafeRemainder$1(val, step) {
1397 const valDecCount = (val.toString().split(".")[1] || "").length;
1398 const stepDecCount = (step.toString().split(".")[1] || "").length;
1399 const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1400 return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
1401 }
1402 __name(floatSafeRemainder$1, "floatSafeRemainder");
1403 var ZodNumber$1 = class ZodNumber$1 extends ZodType$1 {
1404 static {
1405 __name(this, "ZodNumber");
1406 }
1407 constructor() {
1408 super(...arguments);
1409 this.min = this.gte;
1410 this.max = this.lte;
1411 this.step = this.multipleOf;
1412 }
1413 _parse(input) {
1414 if (this._def.coerce) input.data = Number(input.data);
1415 if (this._getType(input) !== ZodParsedType.number) {
1416 const ctx = this._getOrReturnCtx(input);
1417 addIssueToContext(ctx, {
1418 code: ZodIssueCode$1.invalid_type,
1419 expected: ZodParsedType.number,
1420 received: ctx.parsedType
1421 });
1422 return INVALID;
1423 }
1424 let ctx = void 0;
1425 const status = new ParseStatus();
1426 for (const check of this._def.checks) if (check.kind === "int") {
1427 if (!util.isInteger(input.data)) {
1428 ctx = this._getOrReturnCtx(input, ctx);
1429 addIssueToContext(ctx, {
1430 code: ZodIssueCode$1.invalid_type,
1431 expected: "integer",
1432 received: "float",
1433 message: check.message
1434 });
1435 status.dirty();
1436 }
1437 } else if (check.kind === "min") {
1438 if (check.inclusive ? input.data < check.value : input.data <= check.value) {
1439 ctx = this._getOrReturnCtx(input, ctx);
1440 addIssueToContext(ctx, {
1441 code: ZodIssueCode$1.too_small,
1442 minimum: check.value,
1443 type: "number",
1444 inclusive: check.inclusive,
1445 exact: false,
1446 message: check.message
1447 });
1448 status.dirty();
1449 }
1450 } else if (check.kind === "max") {
1451 if (check.inclusive ? input.data > check.value : input.data >= check.value) {
1452 ctx = this._getOrReturnCtx(input, ctx);
1453 addIssueToContext(ctx, {
1454 code: ZodIssueCode$1.too_big,
1455 maximum: check.value,
1456 type: "number",
1457 inclusive: check.inclusive,
1458 exact: false,
1459 message: check.message
1460 });
1461 status.dirty();
1462 }
1463 } else if (check.kind === "multipleOf") {
1464 if (floatSafeRemainder$1(input.data, check.value) !== 0) {
1465 ctx = this._getOrReturnCtx(input, ctx);
1466 addIssueToContext(ctx, {
1467 code: ZodIssueCode$1.not_multiple_of,
1468 multipleOf: check.value,
1469 message: check.message
1470 });
1471 status.dirty();
1472 }
1473 } else if (check.kind === "finite") {
1474 if (!Number.isFinite(input.data)) {
1475 ctx = this._getOrReturnCtx(input, ctx);
1476 addIssueToContext(ctx, {
1477 code: ZodIssueCode$1.not_finite,
1478 message: check.message
1479 });
1480 status.dirty();
1481 }
1482 } else util.assertNever(check);
1483 return {
1484 status: status.value,
1485 value: input.data
1486 };
1487 }
1488 gte(value, message) {
1489 return this.setLimit("min", value, true, errorUtil.toString(message));
1490 }
1491 gt(value, message) {
1492 return this.setLimit("min", value, false, errorUtil.toString(message));
1493 }
1494 lte(value, message) {
1495 return this.setLimit("max", value, true, errorUtil.toString(message));
1496 }
1497 lt(value, message) {
1498 return this.setLimit("max", value, false, errorUtil.toString(message));
1499 }
1500 setLimit(kind, value, inclusive, message) {
1501 return new ZodNumber$1({
1502 ...this._def,
1503 checks: [...this._def.checks, {
1504 kind,
1505 value,
1506 inclusive,
1507 message: errorUtil.toString(message)
1508 }]
1509 });
1510 }
1511 _addCheck(check) {
1512 return new ZodNumber$1({
1513 ...this._def,
1514 checks: [...this._def.checks, check]
1515 });
1516 }
1517 int(message) {
1518 return this._addCheck({
1519 kind: "int",
1520 message: errorUtil.toString(message)
1521 });
1522 }
1523 positive(message) {
1524 return this._addCheck({
1525 kind: "min",
1526 value: 0,
1527 inclusive: false,
1528 message: errorUtil.toString(message)
1529 });
1530 }
1531 negative(message) {
1532 return this._addCheck({
1533 kind: "max",
1534 value: 0,
1535 inclusive: false,
1536 message: errorUtil.toString(message)
1537 });
1538 }
1539 nonpositive(message) {
1540 return this._addCheck({
1541 kind: "max",
1542 value: 0,
1543 inclusive: true,
1544 message: errorUtil.toString(message)
1545 });
1546 }
1547 nonnegative(message) {
1548 return this._addCheck({
1549 kind: "min",
1550 value: 0,
1551 inclusive: true,
1552 message: errorUtil.toString(message)
1553 });
1554 }
1555 multipleOf(value, message) {
1556 return this._addCheck({
1557 kind: "multipleOf",
1558 value,
1559 message: errorUtil.toString(message)
1560 });
1561 }
1562 finite(message) {
1563 return this._addCheck({
1564 kind: "finite",
1565 message: errorUtil.toString(message)
1566 });
1567 }
1568 safe(message) {
1569 return this._addCheck({
1570 kind: "min",
1571 inclusive: true,
1572 value: Number.MIN_SAFE_INTEGER,
1573 message: errorUtil.toString(message)
1574 })._addCheck({
1575 kind: "max",
1576 inclusive: true,
1577 value: Number.MAX_SAFE_INTEGER,
1578 message: errorUtil.toString(message)
1579 });
1580 }
1581 get minValue() {
1582 let min = null;
1583 for (const ch of this._def.checks) if (ch.kind === "min") {
1584 if (min === null || ch.value > min) min = ch.value;
1585 }
1586 return min;
1587 }
1588 get maxValue() {
1589 let max = null;
1590 for (const ch of this._def.checks) if (ch.kind === "max") {
1591 if (max === null || ch.value < max) max = ch.value;
1592 }
1593 return max;
1594 }
1595 get isInt() {
1596 return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1597 }
1598 get isFinite() {
1599 let max = null;
1600 let min = null;
1601 for (const ch of this._def.checks) if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") return true;
1602 else if (ch.kind === "min") {
1603 if (min === null || ch.value > min) min = ch.value;
1604 } else if (ch.kind === "max") {
1605 if (max === null || ch.value < max) max = ch.value;
1606 }
1607 return Number.isFinite(min) && Number.isFinite(max);
1608 }
1609 };
1610 ZodNumber$1.create = (params) => {
1611 return new ZodNumber$1({
1612 checks: [],
1613 typeName: ZodFirstPartyTypeKind.ZodNumber,
1614 coerce: params?.coerce || false,
1615 ...processCreateParams(params)
1616 });
1617 };
1618 var ZodBigInt$1 = class ZodBigInt$1 extends ZodType$1 {
1619 static {
1620 __name(this, "ZodBigInt");
1621 }
1622 constructor() {
1623 super(...arguments);
1624 this.min = this.gte;
1625 this.max = this.lte;
1626 }
1627 _parse(input) {
1628 if (this._def.coerce) try {
1629 input.data = BigInt(input.data);
1630 } catch {
1631 return this._getInvalidInput(input);
1632 }
1633 if (this._getType(input) !== ZodParsedType.bigint) return this._getInvalidInput(input);
1634 let ctx = void 0;
1635 const status = new ParseStatus();
1636 for (const check of this._def.checks) if (check.kind === "min") {
1637 if (check.inclusive ? input.data < check.value : input.data <= check.value) {
1638 ctx = this._getOrReturnCtx(input, ctx);
1639 addIssueToContext(ctx, {
1640 code: ZodIssueCode$1.too_small,
1641 type: "bigint",
1642 minimum: check.value,
1643 inclusive: check.inclusive,
1644 message: check.message
1645 });
1646 status.dirty();
1647 }
1648 } else if (check.kind === "max") {
1649 if (check.inclusive ? input.data > check.value : input.data >= check.value) {
1650 ctx = this._getOrReturnCtx(input, ctx);
1651 addIssueToContext(ctx, {
1652 code: ZodIssueCode$1.too_big,
1653 type: "bigint",
1654 maximum: check.value,
1655 inclusive: check.inclusive,
1656 message: check.message
1657 });
1658 status.dirty();
1659 }
1660 } else if (check.kind === "multipleOf") {
1661 if (input.data % check.value !== BigInt(0)) {
1662 ctx = this._getOrReturnCtx(input, ctx);
1663 addIssueToContext(ctx, {
1664 code: ZodIssueCode$1.not_multiple_of,
1665 multipleOf: check.value,
1666 message: check.message
1667 });
1668 status.dirty();
1669 }
1670 } else util.assertNever(check);
1671 return {
1672 status: status.value,
1673 value: input.data
1674 };
1675 }
1676 _getInvalidInput(input) {
1677 const ctx = this._getOrReturnCtx(input);
1678 addIssueToContext(ctx, {
1679 code: ZodIssueCode$1.invalid_type,
1680 expected: ZodParsedType.bigint,
1681 received: ctx.parsedType
1682 });
1683 return INVALID;
1684 }
1685 gte(value, message) {
1686 return this.setLimit("min", value, true, errorUtil.toString(message));
1687 }
1688 gt(value, message) {
1689 return this.setLimit("min", value, false, errorUtil.toString(message));
1690 }
1691 lte(value, message) {
1692 return this.setLimit("max", value, true, errorUtil.toString(message));
1693 }
1694 lt(value, message) {
1695 return this.setLimit("max", value, false, errorUtil.toString(message));
1696 }
1697 setLimit(kind, value, inclusive, message) {
1698 return new ZodBigInt$1({
1699 ...this._def,
1700 checks: [...this._def.checks, {
1701 kind,
1702 value,
1703 inclusive,
1704 message: errorUtil.toString(message)
1705 }]
1706 });
1707 }
1708 _addCheck(check) {
1709 return new ZodBigInt$1({
1710 ...this._def,
1711 checks: [...this._def.checks, check]
1712 });
1713 }
1714 positive(message) {
1715 return this._addCheck({
1716 kind: "min",
1717 value: BigInt(0),
1718 inclusive: false,
1719 message: errorUtil.toString(message)
1720 });
1721 }
1722 negative(message) {
1723 return this._addCheck({
1724 kind: "max",
1725 value: BigInt(0),
1726 inclusive: false,
1727 message: errorUtil.toString(message)
1728 });
1729 }
1730 nonpositive(message) {
1731 return this._addCheck({
1732 kind: "max",
1733 value: BigInt(0),
1734 inclusive: true,
1735 message: errorUtil.toString(message)
1736 });
1737 }
1738 nonnegative(message) {
1739 return this._addCheck({
1740 kind: "min",
1741 value: BigInt(0),
1742 inclusive: true,
1743 message: errorUtil.toString(message)
1744 });
1745 }
1746 multipleOf(value, message) {
1747 return this._addCheck({
1748 kind: "multipleOf",
1749 value,
1750 message: errorUtil.toString(message)
1751 });
1752 }
1753 get minValue() {
1754 let min = null;
1755 for (const ch of this._def.checks) if (ch.kind === "min") {
1756 if (min === null || ch.value > min) min = ch.value;
1757 }
1758 return min;
1759 }
1760 get maxValue() {
1761 let max = null;
1762 for (const ch of this._def.checks) if (ch.kind === "max") {
1763 if (max === null || ch.value < max) max = ch.value;
1764 }
1765 return max;
1766 }
1767 };
1768 ZodBigInt$1.create = (params) => {
1769 return new ZodBigInt$1({
1770 checks: [],
1771 typeName: ZodFirstPartyTypeKind.ZodBigInt,
1772 coerce: params?.coerce ?? false,
1773 ...processCreateParams(params)
1774 });
1775 };
1776 var ZodBoolean$1 = class extends ZodType$1 {
1777 static {
1778 __name(this, "ZodBoolean");
1779 }
1780 _parse(input) {
1781 if (this._def.coerce) input.data = Boolean(input.data);
1782 if (this._getType(input) !== ZodParsedType.boolean) {
1783 const ctx = this._getOrReturnCtx(input);
1784 addIssueToContext(ctx, {
1785 code: ZodIssueCode$1.invalid_type,
1786 expected: ZodParsedType.boolean,
1787 received: ctx.parsedType
1788 });
1789 return INVALID;
1790 }
1791 return OK(input.data);
1792 }
1793 };
1794 ZodBoolean$1.create = (params) => {
1795 return new ZodBoolean$1({
1796 typeName: ZodFirstPartyTypeKind.ZodBoolean,
1797 coerce: params?.coerce || false,
1798 ...processCreateParams(params)
1799 });
1800 };
1801 var ZodDate$1 = class ZodDate$1 extends ZodType$1 {
1802 static {
1803 __name(this, "ZodDate");
1804 }
1805 _parse(input) {
1806 if (this._def.coerce) input.data = new Date(input.data);
1807 if (this._getType(input) !== ZodParsedType.date) {
1808 const ctx = this._getOrReturnCtx(input);
1809 addIssueToContext(ctx, {
1810 code: ZodIssueCode$1.invalid_type,
1811 expected: ZodParsedType.date,
1812 received: ctx.parsedType
1813 });
1814 return INVALID;
1815 }
1816 if (Number.isNaN(input.data.getTime())) {
1817 addIssueToContext(this._getOrReturnCtx(input), { code: ZodIssueCode$1.invalid_date });
1818 return INVALID;
1819 }
1820 const status = new ParseStatus();
1821 let ctx = void 0;
1822 for (const check of this._def.checks) if (check.kind === "min") {
1823 if (input.data.getTime() < check.value) {
1824 ctx = this._getOrReturnCtx(input, ctx);
1825 addIssueToContext(ctx, {
1826 code: ZodIssueCode$1.too_small,
1827 message: check.message,
1828 inclusive: true,
1829 exact: false,
1830 minimum: check.value,
1831 type: "date"
1832 });
1833 status.dirty();
1834 }
1835 } else if (check.kind === "max") {
1836 if (input.data.getTime() > check.value) {
1837 ctx = this._getOrReturnCtx(input, ctx);
1838 addIssueToContext(ctx, {
1839 code: ZodIssueCode$1.too_big,
1840 message: check.message,
1841 inclusive: true,
1842 exact: false,
1843 maximum: check.value,
1844 type: "date"
1845 });
1846 status.dirty();
1847 }
1848 } else util.assertNever(check);
1849 return {
1850 status: status.value,
1851 value: new Date(input.data.getTime())
1852 };
1853 }
1854 _addCheck(check) {
1855 return new ZodDate$1({
1856 ...this._def,
1857 checks: [...this._def.checks, check]
1858 });
1859 }
1860 min(minDate, message) {
1861 return this._addCheck({
1862 kind: "min",
1863 value: minDate.getTime(),
1864 message: errorUtil.toString(message)
1865 });
1866 }
1867 max(maxDate, message) {
1868 return this._addCheck({
1869 kind: "max",
1870 value: maxDate.getTime(),
1871 message: errorUtil.toString(message)
1872 });
1873 }
1874 get minDate() {
1875 let min = null;
1876 for (const ch of this._def.checks) if (ch.kind === "min") {
1877 if (min === null || ch.value > min) min = ch.value;
1878 }
1879 return min != null ? new Date(min) : null;
1880 }
1881 get maxDate() {
1882 let max = null;
1883 for (const ch of this._def.checks) if (ch.kind === "max") {
1884 if (max === null || ch.value < max) max = ch.value;
1885 }
1886 return max != null ? new Date(max) : null;
1887 }
1888 };
1889 ZodDate$1.create = (params) => {
1890 return new ZodDate$1({
1891 checks: [],
1892 coerce: params?.coerce || false,
1893 typeName: ZodFirstPartyTypeKind.ZodDate,
1894 ...processCreateParams(params)
1895 });
1896 };
1897 var ZodSymbol$1 = class extends ZodType$1 {
1898 static {
1899 __name(this, "ZodSymbol");
1900 }
1901 _parse(input) {
1902 if (this._getType(input) !== ZodParsedType.symbol) {
1903 const ctx = this._getOrReturnCtx(input);
1904 addIssueToContext(ctx, {
1905 code: ZodIssueCode$1.invalid_type,
1906 expected: ZodParsedType.symbol,
1907 received: ctx.parsedType
1908 });
1909 return INVALID;
1910 }
1911 return OK(input.data);
1912 }
1913 };
1914 ZodSymbol$1.create = (params) => {
1915 return new ZodSymbol$1({
1916 typeName: ZodFirstPartyTypeKind.ZodSymbol,
1917 ...processCreateParams(params)
1918 });
1919 };
1920 var ZodUndefined$1 = class extends ZodType$1 {
1921 static {
1922 __name(this, "ZodUndefined");
1923 }
1924 _parse(input) {
1925 if (this._getType(input) !== ZodParsedType.undefined) {
1926 const ctx = this._getOrReturnCtx(input);
1927 addIssueToContext(ctx, {
1928 code: ZodIssueCode$1.invalid_type,
1929 expected: ZodParsedType.undefined,
1930 received: ctx.parsedType
1931 });
1932 return INVALID;
1933 }
1934 return OK(input.data);
1935 }
1936 };
1937 ZodUndefined$1.create = (params) => {
1938 return new ZodUndefined$1({
1939 typeName: ZodFirstPartyTypeKind.ZodUndefined,
1940 ...processCreateParams(params)
1941 });
1942 };
1943 var ZodNull$1 = class extends ZodType$1 {
1944 static {
1945 __name(this, "ZodNull");
1946 }
1947 _parse(input) {
1948 if (this._getType(input) !== ZodParsedType.null) {
1949 const ctx = this._getOrReturnCtx(input);
1950 addIssueToContext(ctx, {
1951 code: ZodIssueCode$1.invalid_type,
1952 expected: ZodParsedType.null,
1953 received: ctx.parsedType
1954 });
1955 return INVALID;
1956 }
1957 return OK(input.data);
1958 }
1959 };
1960 ZodNull$1.create = (params) => {
1961 return new ZodNull$1({
1962 typeName: ZodFirstPartyTypeKind.ZodNull,
1963 ...processCreateParams(params)
1964 });
1965 };
1966 var ZodAny$1 = class extends ZodType$1 {
1967 static {
1968 __name(this, "ZodAny");
1969 }
1970 constructor() {
1971 super(...arguments);
1972 this._any = true;
1973 }
1974 _parse(input) {
1975 return OK(input.data);
1976 }
1977 };
1978 ZodAny$1.create = (params) => {
1979 return new ZodAny$1({
1980 typeName: ZodFirstPartyTypeKind.ZodAny,
1981 ...processCreateParams(params)
1982 });
1983 };
1984 var ZodUnknown$1 = class extends ZodType$1 {
1985 static {
1986 __name(this, "ZodUnknown");
1987 }
1988 constructor() {
1989 super(...arguments);
1990 this._unknown = true;
1991 }
1992 _parse(input) {
1993 return OK(input.data);
1994 }
1995 };
1996 ZodUnknown$1.create = (params) => {
1997 return new ZodUnknown$1({
1998 typeName: ZodFirstPartyTypeKind.ZodUnknown,
1999 ...processCreateParams(params)
2000 });
2001 };
2002 var ZodNever$1 = class extends ZodType$1 {
2003 static {
2004 __name(this, "ZodNever");
2005 }
2006 _parse(input) {
2007 const ctx = this._getOrReturnCtx(input);
2008 addIssueToContext(ctx, {
2009 code: ZodIssueCode$1.invalid_type,
2010 expected: ZodParsedType.never,
2011 received: ctx.parsedType
2012 });
2013 return INVALID;
2014 }
2015 };
2016 ZodNever$1.create = (params) => {
2017 return new ZodNever$1({
2018 typeName: ZodFirstPartyTypeKind.ZodNever,
2019 ...processCreateParams(params)
2020 });
2021 };
2022 var ZodVoid$1 = class extends ZodType$1 {
2023 static {
2024 __name(this, "ZodVoid");
2025 }
2026 _parse(input) {
2027 if (this._getType(input) !== ZodParsedType.undefined) {
2028 const ctx = this._getOrReturnCtx(input);
2029 addIssueToContext(ctx, {
2030 code: ZodIssueCode$1.invalid_type,
2031 expected: ZodParsedType.void,
2032 received: ctx.parsedType
2033 });
2034 return INVALID;
2035 }
2036 return OK(input.data);
2037 }
2038 };
2039 ZodVoid$1.create = (params) => {
2040 return new ZodVoid$1({
2041 typeName: ZodFirstPartyTypeKind.ZodVoid,
2042 ...processCreateParams(params)
2043 });
2044 };
2045 var ZodArray$1 = class ZodArray$1 extends ZodType$1 {
2046 static {
2047 __name(this, "ZodArray");
2048 }
2049 _parse(input) {
2050 const { ctx, status } = this._processInputParams(input);
2051 const def = this._def;
2052 if (ctx.parsedType !== ZodParsedType.array) {
2053 addIssueToContext(ctx, {
2054 code: ZodIssueCode$1.invalid_type,
2055 expected: ZodParsedType.array,
2056 received: ctx.parsedType
2057 });
2058 return INVALID;
2059 }
2060 if (def.exactLength !== null) {
2061 const tooBig = ctx.data.length > def.exactLength.value;
2062 const tooSmall = ctx.data.length < def.exactLength.value;
2063 if (tooBig || tooSmall) {
2064 addIssueToContext(ctx, {
2065 code: tooBig ? ZodIssueCode$1.too_big : ZodIssueCode$1.too_small,
2066 minimum: tooSmall ? def.exactLength.value : void 0,
2067 maximum: tooBig ? def.exactLength.value : void 0,
2068 type: "array",
2069 inclusive: true,
2070 exact: true,
2071 message: def.exactLength.message
2072 });
2073 status.dirty();
2074 }
2075 }
2076 if (def.minLength !== null) {
2077 if (ctx.data.length < def.minLength.value) {
2078 addIssueToContext(ctx, {
2079 code: ZodIssueCode$1.too_small,
2080 minimum: def.minLength.value,
2081 type: "array",
2082 inclusive: true,
2083 exact: false,
2084 message: def.minLength.message
2085 });
2086 status.dirty();
2087 }
2088 }
2089 if (def.maxLength !== null) {
2090 if (ctx.data.length > def.maxLength.value) {
2091 addIssueToContext(ctx, {
2092 code: ZodIssueCode$1.too_big,
2093 maximum: def.maxLength.value,
2094 type: "array",
2095 inclusive: true,
2096 exact: false,
2097 message: def.maxLength.message
2098 });
2099 status.dirty();
2100 }
2101 }
2102 if (ctx.common.async) return Promise.all([...ctx.data].map((item, i) => {
2103 return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2104 })).then((result) => {
2105 return ParseStatus.mergeArray(status, result);
2106 });
2107 const result = [...ctx.data].map((item, i) => {
2108 return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2109 });
2110 return ParseStatus.mergeArray(status, result);
2111 }
2112 get element() {
2113 return this._def.type;
2114 }
2115 min(minLength, message) {
2116 return new ZodArray$1({
2117 ...this._def,
2118 minLength: {
2119 value: minLength,
2120 message: errorUtil.toString(message)
2121 }
2122 });
2123 }
2124 max(maxLength, message) {
2125 return new ZodArray$1({
2126 ...this._def,
2127 maxLength: {
2128 value: maxLength,
2129 message: errorUtil.toString(message)
2130 }
2131 });
2132 }
2133 length(len, message) {
2134 return new ZodArray$1({
2135 ...this._def,
2136 exactLength: {
2137 value: len,
2138 message: errorUtil.toString(message)
2139 }
2140 });
2141 }
2142 nonempty(message) {
2143 return this.min(1, message);
2144 }
2145 };
2146 ZodArray$1.create = (schema, params) => {
2147 return new ZodArray$1({
2148 type: schema,
2149 minLength: null,
2150 maxLength: null,
2151 exactLength: null,
2152 typeName: ZodFirstPartyTypeKind.ZodArray,
2153 ...processCreateParams(params)
2154 });
2155 };
2156 function deepPartialify(schema) {
2157 if (schema instanceof ZodObject$1) {
2158 const newShape = {};
2159 for (const key in schema.shape) {
2160 const fieldSchema = schema.shape[key];
2161 newShape[key] = ZodOptional$1.create(deepPartialify(fieldSchema));
2162 }
2163 return new ZodObject$1({
2164 ...schema._def,
2165 shape: () => newShape
2166 });
2167 } else if (schema instanceof ZodArray$1) return new ZodArray$1({
2168 ...schema._def,
2169 type: deepPartialify(schema.element)
2170 });
2171 else if (schema instanceof ZodOptional$1) return ZodOptional$1.create(deepPartialify(schema.unwrap()));
2172 else if (schema instanceof ZodNullable$1) return ZodNullable$1.create(deepPartialify(schema.unwrap()));
2173 else if (schema instanceof ZodTuple$1) return ZodTuple$1.create(schema.items.map((item) => deepPartialify(item)));
2174 else return schema;
2175 }
2176 var ZodObject$1 = class ZodObject$1 extends ZodType$1 {
2177 static {
2178 __name(this, "ZodObject");
2179 }
2180 constructor() {
2181 super(...arguments);
2182 this._cached = null;
2183 /**
2184 * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
2185 * If you want to pass through unknown properties, use `.passthrough()` instead.
2186 */
2187 this.nonstrict = this.passthrough;
2188 /**
2189 * @deprecated Use `.extend` instead
2190 * */
2191 this.augment = this.extend;
2192 }
2193 _getCached() {
2194 if (this._cached !== null) return this._cached;
2195 const shape = this._def.shape();
2196 const keys = util.objectKeys(shape);
2197 this._cached = {
2198 shape,
2199 keys
2200 };
2201 return this._cached;
2202 }
2203 _parse(input) {
2204 if (this._getType(input) !== ZodParsedType.object) {
2205 const ctx = this._getOrReturnCtx(input);
2206 addIssueToContext(ctx, {
2207 code: ZodIssueCode$1.invalid_type,
2208 expected: ZodParsedType.object,
2209 received: ctx.parsedType
2210 });
2211 return INVALID;
2212 }
2213 const { status, ctx } = this._processInputParams(input);
2214 const { shape, keys: shapeKeys } = this._getCached();
2215 const extraKeys = [];
2216 if (!(this._def.catchall instanceof ZodNever$1 && this._def.unknownKeys === "strip")) {
2217 for (const key in ctx.data) if (!shapeKeys.includes(key)) extraKeys.push(key);
2218 }
2219 const pairs = [];
2220 for (const key of shapeKeys) {
2221 const keyValidator = shape[key];
2222 const value = ctx.data[key];
2223 pairs.push({
2224 key: {
2225 status: "valid",
2226 value: key
2227 },
2228 value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2229 alwaysSet: key in ctx.data
2230 });
2231 }
2232 if (this._def.catchall instanceof ZodNever$1) {
2233 const unknownKeys = this._def.unknownKeys;
2234 if (unknownKeys === "passthrough") for (const key of extraKeys) pairs.push({
2235 key: {
2236 status: "valid",
2237 value: key
2238 },
2239 value: {
2240 status: "valid",
2241 value: ctx.data[key]
2242 }
2243 });
2244 else if (unknownKeys === "strict") {
2245 if (extraKeys.length > 0) {
2246 addIssueToContext(ctx, {
2247 code: ZodIssueCode$1.unrecognized_keys,
2248 keys: extraKeys
2249 });
2250 status.dirty();
2251 }
2252 } else if (unknownKeys === "strip") {} else throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
2253 } else {
2254 const catchall = this._def.catchall;
2255 for (const key of extraKeys) {
2256 const value = ctx.data[key];
2257 pairs.push({
2258 key: {
2259 status: "valid",
2260 value: key
2261 },
2262 value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2263 alwaysSet: key in ctx.data
2264 });
2265 }
2266 }
2267 if (ctx.common.async) return Promise.resolve().then(async () => {
2268 const syncPairs = [];
2269 for (const pair of pairs) {
2270 const key = await pair.key;
2271 const value = await pair.value;
2272 syncPairs.push({
2273 key,
2274 value,
2275 alwaysSet: pair.alwaysSet
2276 });
2277 }
2278 return syncPairs;
2279 }).then((syncPairs) => {
2280 return ParseStatus.mergeObjectSync(status, syncPairs);
2281 });
2282 else return ParseStatus.mergeObjectSync(status, pairs);
2283 }
2284 get shape() {
2285 return this._def.shape();
2286 }
2287 strict(message) {
2288 errorUtil.errToObj;
2289 return new ZodObject$1({
2290 ...this._def,
2291 unknownKeys: "strict",
2292 ...message !== void 0 ? { errorMap: (issue, ctx) => {
2293 const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
2294 if (issue.code === "unrecognized_keys") return { message: errorUtil.errToObj(message).message ?? defaultError };
2295 return { message: defaultError };
2296 } } : {}
2297 });
2298 }
2299 strip() {
2300 return new ZodObject$1({
2301 ...this._def,
2302 unknownKeys: "strip"
2303 });
2304 }
2305 passthrough() {
2306 return new ZodObject$1({
2307 ...this._def,
2308 unknownKeys: "passthrough"
2309 });
2310 }
2311 extend(augmentation) {
2312 return new ZodObject$1({
2313 ...this._def,
2314 shape: () => ({
2315 ...this._def.shape(),
2316 ...augmentation
2317 })
2318 });
2319 }
2320 /**
2321 * Prior to zod@1.0.12 there was a bug in the
2322 * inferred type of merged objects. Please
2323 * upgrade if you are experiencing issues.
2324 */
2325 merge(merging) {
2326 return new ZodObject$1({
2327 unknownKeys: merging._def.unknownKeys,
2328 catchall: merging._def.catchall,
2329 shape: () => ({
2330 ...this._def.shape(),
2331 ...merging._def.shape()
2332 }),
2333 typeName: ZodFirstPartyTypeKind.ZodObject
2334 });
2335 }
2336 setKey(key, schema) {
2337 return this.augment({ [key]: schema });
2338 }
2339 catchall(index) {
2340 return new ZodObject$1({
2341 ...this._def,
2342 catchall: index
2343 });
2344 }
2345 pick(mask) {
2346 const shape = {};
2347 for (const key of util.objectKeys(mask)) if (mask[key] && this.shape[key]) shape[key] = this.shape[key];
2348 return new ZodObject$1({
2349 ...this._def,
2350 shape: () => shape
2351 });
2352 }
2353 omit(mask) {
2354 const shape = {};
2355 for (const key of util.objectKeys(this.shape)) if (!mask[key]) shape[key] = this.shape[key];
2356 return new ZodObject$1({
2357 ...this._def,
2358 shape: () => shape
2359 });
2360 }
2361 /**
2362 * @deprecated
2363 */
2364 deepPartial() {
2365 return deepPartialify(this);
2366 }
2367 partial(mask) {
2368 const newShape = {};
2369 for (const key of util.objectKeys(this.shape)) {
2370 const fieldSchema = this.shape[key];
2371 if (mask && !mask[key]) newShape[key] = fieldSchema;
2372 else newShape[key] = fieldSchema.optional();
2373 }
2374 return new ZodObject$1({
2375 ...this._def,
2376 shape: () => newShape
2377 });
2378 }
2379 required(mask) {
2380 const newShape = {};
2381 for (const key of util.objectKeys(this.shape)) if (mask && !mask[key]) newShape[key] = this.shape[key];
2382 else {
2383 let newField = this.shape[key];
2384 while (newField instanceof ZodOptional$1) newField = newField._def.innerType;
2385 newShape[key] = newField;
2386 }
2387 return new ZodObject$1({
2388 ...this._def,
2389 shape: () => newShape
2390 });
2391 }
2392 keyof() {
2393 return createZodEnum(util.objectKeys(this.shape));
2394 }
2395 };
2396 ZodObject$1.create = (shape, params) => {
2397 return new ZodObject$1({
2398 shape: () => shape,
2399 unknownKeys: "strip",
2400 catchall: ZodNever$1.create(),
2401 typeName: ZodFirstPartyTypeKind.ZodObject,
2402 ...processCreateParams(params)
2403 });
2404 };
2405 ZodObject$1.strictCreate = (shape, params) => {
2406 return new ZodObject$1({
2407 shape: () => shape,
2408 unknownKeys: "strict",
2409 catchall: ZodNever$1.create(),
2410 typeName: ZodFirstPartyTypeKind.ZodObject,
2411 ...processCreateParams(params)
2412 });
2413 };
2414 ZodObject$1.lazycreate = (shape, params) => {
2415 return new ZodObject$1({
2416 shape,
2417 unknownKeys: "strip",
2418 catchall: ZodNever$1.create(),
2419 typeName: ZodFirstPartyTypeKind.ZodObject,
2420 ...processCreateParams(params)
2421 });
2422 };
2423 var ZodUnion$1 = class extends ZodType$1 {
2424 static {
2425 __name(this, "ZodUnion");
2426 }
2427 _parse(input) {
2428 const { ctx } = this._processInputParams(input);
2429 const options = this._def.options;
2430 function handleResults(results) {
2431 for (const result of results) if (result.result.status === "valid") return result.result;
2432 for (const result of results) if (result.result.status === "dirty") {
2433 ctx.common.issues.push(...result.ctx.common.issues);
2434 return result.result;
2435 }
2436 const unionErrors = results.map((result) => new ZodError$1(result.ctx.common.issues));
2437 addIssueToContext(ctx, {
2438 code: ZodIssueCode$1.invalid_union,
2439 unionErrors
2440 });
2441 return INVALID;
2442 }
2443 if (ctx.common.async) return Promise.all(options.map(async (option) => {
2444 const childCtx = {
2445 ...ctx,
2446 common: {
2447 ...ctx.common,
2448 issues: []
2449 },
2450 parent: null
2451 };
2452 return {
2453 result: await option._parseAsync({
2454 data: ctx.data,
2455 path: ctx.path,
2456 parent: childCtx
2457 }),
2458 ctx: childCtx
2459 };
2460 })).then(handleResults);
2461 else {
2462 let dirty = void 0;
2463 const issues = [];
2464 for (const option of options) {
2465 const childCtx = {
2466 ...ctx,
2467 common: {
2468 ...ctx.common,
2469 issues: []
2470 },
2471 parent: null
2472 };
2473 const result = option._parseSync({
2474 data: ctx.data,
2475 path: ctx.path,
2476 parent: childCtx
2477 });
2478 if (result.status === "valid") return result;
2479 else if (result.status === "dirty" && !dirty) dirty = {
2480 result,
2481 ctx: childCtx
2482 };
2483 if (childCtx.common.issues.length) issues.push(childCtx.common.issues);
2484 }
2485 if (dirty) {
2486 ctx.common.issues.push(...dirty.ctx.common.issues);
2487 return dirty.result;
2488 }
2489 const unionErrors = issues.map((issues) => new ZodError$1(issues));
2490 addIssueToContext(ctx, {
2491 code: ZodIssueCode$1.invalid_union,
2492 unionErrors
2493 });
2494 return INVALID;
2495 }
2496 }
2497 get options() {
2498 return this._def.options;
2499 }
2500 };
2501 ZodUnion$1.create = (types, params) => {
2502 return new ZodUnion$1({
2503 options: types,
2504 typeName: ZodFirstPartyTypeKind.ZodUnion,
2505 ...processCreateParams(params)
2506 });
2507 };
2508 var getDiscriminator = (type) => {
2509 if (type instanceof ZodLazy$1) return getDiscriminator(type.schema);
2510 else if (type instanceof ZodEffects) return getDiscriminator(type.innerType());
2511 else if (type instanceof ZodLiteral$1) return [type.value];
2512 else if (type instanceof ZodEnum$1) return type.options;
2513 else if (type instanceof ZodNativeEnum) return util.objectValues(type.enum);
2514 else if (type instanceof ZodDefault$1) return getDiscriminator(type._def.innerType);
2515 else if (type instanceof ZodUndefined$1) return [void 0];
2516 else if (type instanceof ZodNull$1) return [null];
2517 else if (type instanceof ZodOptional$1) return [void 0, ...getDiscriminator(type.unwrap())];
2518 else if (type instanceof ZodNullable$1) return [null, ...getDiscriminator(type.unwrap())];
2519 else if (type instanceof ZodBranded) return getDiscriminator(type.unwrap());
2520 else if (type instanceof ZodReadonly$1) return getDiscriminator(type.unwrap());
2521 else if (type instanceof ZodCatch$1) return getDiscriminator(type._def.innerType);
2522 else return [];
2523 };
2524 var ZodDiscriminatedUnion$1 = class ZodDiscriminatedUnion$1 extends ZodType$1 {
2525 static {
2526 __name(this, "ZodDiscriminatedUnion");
2527 }
2528 _parse(input) {
2529 const { ctx } = this._processInputParams(input);
2530 if (ctx.parsedType !== ZodParsedType.object) {
2531 addIssueToContext(ctx, {
2532 code: ZodIssueCode$1.invalid_type,
2533 expected: ZodParsedType.object,
2534 received: ctx.parsedType
2535 });
2536 return INVALID;
2537 }
2538 const discriminator = this.discriminator;
2539 const discriminatorValue = ctx.data[discriminator];
2540 const option = this.optionsMap.get(discriminatorValue);
2541 if (!option) {
2542 addIssueToContext(ctx, {
2543 code: ZodIssueCode$1.invalid_union_discriminator,
2544 options: Array.from(this.optionsMap.keys()),
2545 path: [discriminator]
2546 });
2547 return INVALID;
2548 }
2549 if (ctx.common.async) return option._parseAsync({
2550 data: ctx.data,
2551 path: ctx.path,
2552 parent: ctx
2553 });
2554 else return option._parseSync({
2555 data: ctx.data,
2556 path: ctx.path,
2557 parent: ctx
2558 });
2559 }
2560 get discriminator() {
2561 return this._def.discriminator;
2562 }
2563 get options() {
2564 return this._def.options;
2565 }
2566 get optionsMap() {
2567 return this._def.optionsMap;
2568 }
2569 /**
2570 * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2571 * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2572 * have a different value for each object in the union.
2573 * @param discriminator the name of the discriminator property
2574 * @param types an array of object schemas
2575 * @param params
2576 */
2577 static create(discriminator, options, params) {
2578 const optionsMap = /* @__PURE__ */ new Map();
2579 for (const type of options) {
2580 const discriminatorValues = getDiscriminator(type.shape[discriminator]);
2581 if (!discriminatorValues.length) throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
2582 for (const value of discriminatorValues) {
2583 if (optionsMap.has(value)) throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
2584 optionsMap.set(value, type);
2585 }
2586 }
2587 return new ZodDiscriminatedUnion$1({
2588 typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
2589 discriminator,
2590 options,
2591 optionsMap,
2592 ...processCreateParams(params)
2593 });
2594 }
2595 };
2596 function mergeValues$1(a, b) {
2597 const aType = getParsedType$1(a);
2598 const bType = getParsedType$1(b);
2599 if (a === b) return {
2600 valid: true,
2601 data: a
2602 };
2603 else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
2604 const bKeys = util.objectKeys(b);
2605 const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2606 const newObj = {
2607 ...a,
2608 ...b
2609 };
2610 for (const key of sharedKeys) {
2611 const sharedValue = mergeValues$1(a[key], b[key]);
2612 if (!sharedValue.valid) return { valid: false };
2613 newObj[key] = sharedValue.data;
2614 }
2615 return {
2616 valid: true,
2617 data: newObj
2618 };
2619 } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
2620 if (a.length !== b.length) return { valid: false };
2621 const newArray = [];
2622 for (let index = 0; index < a.length; index++) {
2623 const itemA = a[index];
2624 const itemB = b[index];
2625 const sharedValue = mergeValues$1(itemA, itemB);
2626 if (!sharedValue.valid) return { valid: false };
2627 newArray.push(sharedValue.data);
2628 }
2629 return {
2630 valid: true,
2631 data: newArray
2632 };
2633 } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) return {
2634 valid: true,
2635 data: a
2636 };
2637 else return { valid: false };
2638 }
2639 __name(mergeValues$1, "mergeValues");
2640 var ZodIntersection$1 = class extends ZodType$1 {
2641 static {
2642 __name(this, "ZodIntersection");
2643 }
2644 _parse(input) {
2645 const { status, ctx } = this._processInputParams(input);
2646 const handleParsed = (parsedLeft, parsedRight) => {
2647 if (isAborted(parsedLeft) || isAborted(parsedRight)) return INVALID;
2648 const merged = mergeValues$1(parsedLeft.value, parsedRight.value);
2649 if (!merged.valid) {
2650 addIssueToContext(ctx, { code: ZodIssueCode$1.invalid_intersection_types });
2651 return INVALID;
2652 }
2653 if (isDirty(parsedLeft) || isDirty(parsedRight)) status.dirty();
2654 return {
2655 status: status.value,
2656 value: merged.data
2657 };
2658 };
2659 if (ctx.common.async) return Promise.all([this._def.left._parseAsync({
2660 data: ctx.data,
2661 path: ctx.path,
2662 parent: ctx
2663 }), this._def.right._parseAsync({
2664 data: ctx.data,
2665 path: ctx.path,
2666 parent: ctx
2667 })]).then(([left, right]) => handleParsed(left, right));
2668 else return handleParsed(this._def.left._parseSync({
2669 data: ctx.data,
2670 path: ctx.path,
2671 parent: ctx
2672 }), this._def.right._parseSync({
2673 data: ctx.data,
2674 path: ctx.path,
2675 parent: ctx
2676 }));
2677 }
2678 };
2679 ZodIntersection$1.create = (left, right, params) => {
2680 return new ZodIntersection$1({
2681 left,
2682 right,
2683 typeName: ZodFirstPartyTypeKind.ZodIntersection,
2684 ...processCreateParams(params)
2685 });
2686 };
2687 var ZodTuple$1 = class ZodTuple$1 extends ZodType$1 {
2688 static {
2689 __name(this, "ZodTuple");
2690 }
2691 _parse(input) {
2692 const { status, ctx } = this._processInputParams(input);
2693 if (ctx.parsedType !== ZodParsedType.array) {
2694 addIssueToContext(ctx, {
2695 code: ZodIssueCode$1.invalid_type,
2696 expected: ZodParsedType.array,
2697 received: ctx.parsedType
2698 });
2699 return INVALID;
2700 }
2701 if (ctx.data.length < this._def.items.length) {
2702 addIssueToContext(ctx, {
2703 code: ZodIssueCode$1.too_small,
2704 minimum: this._def.items.length,
2705 inclusive: true,
2706 exact: false,
2707 type: "array"
2708 });
2709 return INVALID;
2710 }
2711 if (!this._def.rest && ctx.data.length > this._def.items.length) {
2712 addIssueToContext(ctx, {
2713 code: ZodIssueCode$1.too_big,
2714 maximum: this._def.items.length,
2715 inclusive: true,
2716 exact: false,
2717 type: "array"
2718 });
2719 status.dirty();
2720 }
2721 const items = [...ctx.data].map((item, itemIndex) => {
2722 const schema = this._def.items[itemIndex] || this._def.rest;
2723 if (!schema) return null;
2724 return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
2725 }).filter((x) => !!x);
2726 if (ctx.common.async) return Promise.all(items).then((results) => {
2727 return ParseStatus.mergeArray(status, results);
2728 });
2729 else return ParseStatus.mergeArray(status, items);
2730 }
2731 get items() {
2732 return this._def.items;
2733 }
2734 rest(rest) {
2735 return new ZodTuple$1({
2736 ...this._def,
2737 rest
2738 });
2739 }
2740 };
2741 ZodTuple$1.create = (schemas, params) => {
2742 if (!Array.isArray(schemas)) throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2743 return new ZodTuple$1({
2744 items: schemas,
2745 typeName: ZodFirstPartyTypeKind.ZodTuple,
2746 rest: null,
2747 ...processCreateParams(params)
2748 });
2749 };
2750 var ZodRecord$1 = class ZodRecord$1 extends ZodType$1 {
2751 static {
2752 __name(this, "ZodRecord");
2753 }
2754 get keySchema() {
2755 return this._def.keyType;
2756 }
2757 get valueSchema() {
2758 return this._def.valueType;
2759 }
2760 _parse(input) {
2761 const { status, ctx } = this._processInputParams(input);
2762 if (ctx.parsedType !== ZodParsedType.object) {
2763 addIssueToContext(ctx, {
2764 code: ZodIssueCode$1.invalid_type,
2765 expected: ZodParsedType.object,
2766 received: ctx.parsedType
2767 });
2768 return INVALID;
2769 }
2770 const pairs = [];
2771 const keyType = this._def.keyType;
2772 const valueType = this._def.valueType;
2773 for (const key in ctx.data) pairs.push({
2774 key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
2775 value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
2776 alwaysSet: key in ctx.data
2777 });
2778 if (ctx.common.async) return ParseStatus.mergeObjectAsync(status, pairs);
2779 else return ParseStatus.mergeObjectSync(status, pairs);
2780 }
2781 get element() {
2782 return this._def.valueType;
2783 }
2784 static create(first, second, third) {
2785 if (second instanceof ZodType$1) return new ZodRecord$1({
2786 keyType: first,
2787 valueType: second,
2788 typeName: ZodFirstPartyTypeKind.ZodRecord,
2789 ...processCreateParams(third)
2790 });
2791 return new ZodRecord$1({
2792 keyType: ZodString$1.create(),
2793 valueType: first,
2794 typeName: ZodFirstPartyTypeKind.ZodRecord,
2795 ...processCreateParams(second)
2796 });
2797 }
2798 };
2799 var ZodMap$1 = class extends ZodType$1 {
2800 static {
2801 __name(this, "ZodMap");
2802 }
2803 get keySchema() {
2804 return this._def.keyType;
2805 }
2806 get valueSchema() {
2807 return this._def.valueType;
2808 }
2809 _parse(input) {
2810 const { status, ctx } = this._processInputParams(input);
2811 if (ctx.parsedType !== ZodParsedType.map) {
2812 addIssueToContext(ctx, {
2813 code: ZodIssueCode$1.invalid_type,
2814 expected: ZodParsedType.map,
2815 received: ctx.parsedType
2816 });
2817 return INVALID;
2818 }
2819 const keyType = this._def.keyType;
2820 const valueType = this._def.valueType;
2821 const pairs = [...ctx.data.entries()].map(([key, value], index) => {
2822 return {
2823 key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
2824 value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
2825 };
2826 });
2827 if (ctx.common.async) {
2828 const finalMap = /* @__PURE__ */ new Map();
2829 return Promise.resolve().then(async () => {
2830 for (const pair of pairs) {
2831 const key = await pair.key;
2832 const value = await pair.value;
2833 if (key.status === "aborted" || value.status === "aborted") return INVALID;
2834 if (key.status === "dirty" || value.status === "dirty") status.dirty();
2835 finalMap.set(key.value, value.value);
2836 }
2837 return {
2838 status: status.value,
2839 value: finalMap
2840 };
2841 });
2842 } else {
2843 const finalMap = /* @__PURE__ */ new Map();
2844 for (const pair of pairs) {
2845 const key = pair.key;
2846 const value = pair.value;
2847 if (key.status === "aborted" || value.status === "aborted") return INVALID;
2848 if (key.status === "dirty" || value.status === "dirty") status.dirty();
2849 finalMap.set(key.value, value.value);
2850 }
2851 return {
2852 status: status.value,
2853 value: finalMap
2854 };
2855 }
2856 }
2857 };
2858 ZodMap$1.create = (keyType, valueType, params) => {
2859 return new ZodMap$1({
2860 valueType,
2861 keyType,
2862 typeName: ZodFirstPartyTypeKind.ZodMap,
2863 ...processCreateParams(params)
2864 });
2865 };
2866 var ZodSet$1 = class ZodSet$1 extends ZodType$1 {
2867 static {
2868 __name(this, "ZodSet");
2869 }
2870 _parse(input) {
2871 const { status, ctx } = this._processInputParams(input);
2872 if (ctx.parsedType !== ZodParsedType.set) {
2873 addIssueToContext(ctx, {
2874 code: ZodIssueCode$1.invalid_type,
2875 expected: ZodParsedType.set,
2876 received: ctx.parsedType
2877 });
2878 return INVALID;
2879 }
2880 const def = this._def;
2881 if (def.minSize !== null) {
2882 if (ctx.data.size < def.minSize.value) {
2883 addIssueToContext(ctx, {
2884 code: ZodIssueCode$1.too_small,
2885 minimum: def.minSize.value,
2886 type: "set",
2887 inclusive: true,
2888 exact: false,
2889 message: def.minSize.message
2890 });
2891 status.dirty();
2892 }
2893 }
2894 if (def.maxSize !== null) {
2895 if (ctx.data.size > def.maxSize.value) {
2896 addIssueToContext(ctx, {
2897 code: ZodIssueCode$1.too_big,
2898 maximum: def.maxSize.value,
2899 type: "set",
2900 inclusive: true,
2901 exact: false,
2902 message: def.maxSize.message
2903 });
2904 status.dirty();
2905 }
2906 }
2907 const valueType = this._def.valueType;
2908 function finalizeSet(elements) {
2909 const parsedSet = /* @__PURE__ */ new Set();
2910 for (const element of elements) {
2911 if (element.status === "aborted") return INVALID;
2912 if (element.status === "dirty") status.dirty();
2913 parsedSet.add(element.value);
2914 }
2915 return {
2916 status: status.value,
2917 value: parsedSet
2918 };
2919 }
2920 const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
2921 if (ctx.common.async) return Promise.all(elements).then((elements) => finalizeSet(elements));
2922 else return finalizeSet(elements);
2923 }
2924 min(minSize, message) {
2925 return new ZodSet$1({
2926 ...this._def,
2927 minSize: {
2928 value: minSize,
2929 message: errorUtil.toString(message)
2930 }
2931 });
2932 }
2933 max(maxSize, message) {
2934 return new ZodSet$1({
2935 ...this._def,
2936 maxSize: {
2937 value: maxSize,
2938 message: errorUtil.toString(message)
2939 }
2940 });
2941 }
2942 size(size, message) {
2943 return this.min(size, message).max(size, message);
2944 }
2945 nonempty(message) {
2946 return this.min(1, message);
2947 }
2948 };
2949 ZodSet$1.create = (valueType, params) => {
2950 return new ZodSet$1({
2951 valueType,
2952 minSize: null,
2953 maxSize: null,
2954 typeName: ZodFirstPartyTypeKind.ZodSet,
2955 ...processCreateParams(params)
2956 });
2957 };
2958 var ZodFunction = class ZodFunction extends ZodType$1 {
2959 constructor() {
2960 super(...arguments);
2961 this.validate = this.implement;
2962 }
2963 _parse(input) {
2964 const { ctx } = this._processInputParams(input);
2965 if (ctx.parsedType !== ZodParsedType.function) {
2966 addIssueToContext(ctx, {
2967 code: ZodIssueCode$1.invalid_type,
2968 expected: ZodParsedType.function,
2969 received: ctx.parsedType
2970 });
2971 return INVALID;
2972 }
2973 function makeArgsIssue(args, error) {
2974 return makeIssue({
2975 data: args,
2976 path: ctx.path,
2977 errorMaps: [
2978 ctx.common.contextualErrorMap,
2979 ctx.schemaErrorMap,
2980 getErrorMap$1(),
2981 errorMap
2982 ].filter((x) => !!x),
2983 issueData: {
2984 code: ZodIssueCode$1.invalid_arguments,
2985 argumentsError: error
2986 }
2987 });
2988 }
2989 function makeReturnsIssue(returns, error) {
2990 return makeIssue({
2991 data: returns,
2992 path: ctx.path,
2993 errorMaps: [
2994 ctx.common.contextualErrorMap,
2995 ctx.schemaErrorMap,
2996 getErrorMap$1(),
2997 errorMap
2998 ].filter((x) => !!x),
2999 issueData: {
3000 code: ZodIssueCode$1.invalid_return_type,
3001 returnTypeError: error
3002 }
3003 });
3004 }
3005 const params = { errorMap: ctx.common.contextualErrorMap };
3006 const fn = ctx.data;
3007 if (this._def.returns instanceof ZodPromise$1) {
3008 const me = this;
3009 return OK(async function(...args) {
3010 const error = new ZodError$1([]);
3011 const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
3012 error.addIssue(makeArgsIssue(args, e));
3013 throw error;
3014 });
3015 const result = await Reflect.apply(fn, this, parsedArgs);
3016 return await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3017 error.addIssue(makeReturnsIssue(result, e));
3018 throw error;
3019 });
3020 });
3021 } else {
3022 const me = this;
3023 return OK(function(...args) {
3024 const parsedArgs = me._def.args.safeParse(args, params);
3025 if (!parsedArgs.success) throw new ZodError$1([makeArgsIssue(args, parsedArgs.error)]);
3026 const result = Reflect.apply(fn, this, parsedArgs.data);
3027 const parsedReturns = me._def.returns.safeParse(result, params);
3028 if (!parsedReturns.success) throw new ZodError$1([makeReturnsIssue(result, parsedReturns.error)]);
3029 return parsedReturns.data;
3030 });
3031 }
3032 }
3033 parameters() {
3034 return this._def.args;
3035 }
3036 returnType() {
3037 return this._def.returns;
3038 }
3039 args(...items) {
3040 return new ZodFunction({
3041 ...this._def,
3042 args: ZodTuple$1.create(items).rest(ZodUnknown$1.create())
3043 });
3044 }
3045 returns(returnType) {
3046 return new ZodFunction({
3047 ...this._def,
3048 returns: returnType
3049 });
3050 }
3051 implement(func) {
3052 return this.parse(func);
3053 }
3054 strictImplement(func) {
3055 return this.parse(func);
3056 }
3057 static create(args, returns, params) {
3058 return new ZodFunction({
3059 args: args ? args : ZodTuple$1.create([]).rest(ZodUnknown$1.create()),
3060 returns: returns || ZodUnknown$1.create(),
3061 typeName: ZodFirstPartyTypeKind.ZodFunction,
3062 ...processCreateParams(params)
3063 });
3064 }
3065 };
3066 var ZodLazy$1 = class extends ZodType$1 {
3067 static {
3068 __name(this, "ZodLazy");
3069 }
3070 get schema() {
3071 return this._def.getter();
3072 }
3073 _parse(input) {
3074 const { ctx } = this._processInputParams(input);
3075 return this._def.getter()._parse({
3076 data: ctx.data,
3077 path: ctx.path,
3078 parent: ctx
3079 });
3080 }
3081 };
3082 ZodLazy$1.create = (getter, params) => {
3083 return new ZodLazy$1({
3084 getter,
3085 typeName: ZodFirstPartyTypeKind.ZodLazy,
3086 ...processCreateParams(params)
3087 });
3088 };
3089 var ZodLiteral$1 = class extends ZodType$1 {
3090 static {
3091 __name(this, "ZodLiteral");
3092 }
3093 _parse(input) {
3094 if (input.data !== this._def.value) {
3095 const ctx = this._getOrReturnCtx(input);
3096 addIssueToContext(ctx, {
3097 received: ctx.data,
3098 code: ZodIssueCode$1.invalid_literal,
3099 expected: this._def.value
3100 });
3101 return INVALID;
3102 }
3103 return {
3104 status: "valid",
3105 value: input.data
3106 };
3107 }
3108 get value() {
3109 return this._def.value;
3110 }
3111 };
3112 ZodLiteral$1.create = (value, params) => {
3113 return new ZodLiteral$1({
3114 value,
3115 typeName: ZodFirstPartyTypeKind.ZodLiteral,
3116 ...processCreateParams(params)
3117 });
3118 };
3119 function createZodEnum(values, params) {
3120 return new ZodEnum$1({
3121 values,
3122 typeName: ZodFirstPartyTypeKind.ZodEnum,
3123 ...processCreateParams(params)
3124 });
3125 }
3126 var ZodEnum$1 = class ZodEnum$1 extends ZodType$1 {
3127 static {
3128 __name(this, "ZodEnum");
3129 }
3130 _parse(input) {
3131 if (typeof input.data !== "string") {
3132 const ctx = this._getOrReturnCtx(input);
3133 const expectedValues = this._def.values;
3134 addIssueToContext(ctx, {
3135 expected: util.joinValues(expectedValues),
3136 received: ctx.parsedType,
3137 code: ZodIssueCode$1.invalid_type
3138 });
3139 return INVALID;
3140 }
3141 if (!this._cache) this._cache = new Set(this._def.values);
3142 if (!this._cache.has(input.data)) {
3143 const ctx = this._getOrReturnCtx(input);
3144 const expectedValues = this._def.values;
3145 addIssueToContext(ctx, {
3146 received: ctx.data,
3147 code: ZodIssueCode$1.invalid_enum_value,
3148 options: expectedValues
3149 });
3150 return INVALID;
3151 }
3152 return OK(input.data);
3153 }
3154 get options() {
3155 return this._def.values;
3156 }
3157 get enum() {
3158 const enumValues = {};
3159 for (const val of this._def.values) enumValues[val] = val;
3160 return enumValues;
3161 }
3162 get Values() {
3163 const enumValues = {};
3164 for (const val of this._def.values) enumValues[val] = val;
3165 return enumValues;
3166 }
3167 get Enum() {
3168 const enumValues = {};
3169 for (const val of this._def.values) enumValues[val] = val;
3170 return enumValues;
3171 }
3172 extract(values, newDef = this._def) {
3173 return ZodEnum$1.create(values, {
3174 ...this._def,
3175 ...newDef
3176 });
3177 }
3178 exclude(values, newDef = this._def) {
3179 return ZodEnum$1.create(this.options.filter((opt) => !values.includes(opt)), {
3180 ...this._def,
3181 ...newDef
3182 });
3183 }
3184 };
3185 ZodEnum$1.create = createZodEnum;
3186 var ZodNativeEnum = class extends ZodType$1 {
3187 _parse(input) {
3188 const nativeEnumValues = util.getValidEnumValues(this._def.values);
3189 const ctx = this._getOrReturnCtx(input);
3190 if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
3191 const expectedValues = util.objectValues(nativeEnumValues);
3192 addIssueToContext(ctx, {
3193 expected: util.joinValues(expectedValues),
3194 received: ctx.parsedType,
3195 code: ZodIssueCode$1.invalid_type
3196 });
3197 return INVALID;
3198 }
3199 if (!this._cache) this._cache = new Set(util.getValidEnumValues(this._def.values));
3200 if (!this._cache.has(input.data)) {
3201 const expectedValues = util.objectValues(nativeEnumValues);
3202 addIssueToContext(ctx, {
3203 received: ctx.data,
3204 code: ZodIssueCode$1.invalid_enum_value,
3205 options: expectedValues
3206 });
3207 return INVALID;
3208 }
3209 return OK(input.data);
3210 }
3211 get enum() {
3212 return this._def.values;
3213 }
3214 };
3215 ZodNativeEnum.create = (values, params) => {
3216 return new ZodNativeEnum({
3217 values,
3218 typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
3219 ...processCreateParams(params)
3220 });
3221 };
3222 var ZodPromise$1 = class extends ZodType$1 {
3223 static {
3224 __name(this, "ZodPromise");
3225 }
3226 unwrap() {
3227 return this._def.type;
3228 }
3229 _parse(input) {
3230 const { ctx } = this._processInputParams(input);
3231 if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
3232 addIssueToContext(ctx, {
3233 code: ZodIssueCode$1.invalid_type,
3234 expected: ZodParsedType.promise,
3235 received: ctx.parsedType
3236 });
3237 return INVALID;
3238 }
3239 return OK((ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data)).then((data) => {
3240 return this._def.type.parseAsync(data, {
3241 path: ctx.path,
3242 errorMap: ctx.common.contextualErrorMap
3243 });
3244 }));
3245 }
3246 };
3247 ZodPromise$1.create = (schema, params) => {
3248 return new ZodPromise$1({
3249 type: schema,
3250 typeName: ZodFirstPartyTypeKind.ZodPromise,
3251 ...processCreateParams(params)
3252 });
3253 };
3254 var ZodEffects = class extends ZodType$1 {
3255 innerType() {
3256 return this._def.schema;
3257 }
3258 sourceType() {
3259 return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3260 }
3261 _parse(input) {
3262 const { status, ctx } = this._processInputParams(input);
3263 const effect = this._def.effect || null;
3264 const checkCtx = {
3265 addIssue: (arg) => {
3266 addIssueToContext(ctx, arg);
3267 if (arg.fatal) status.abort();
3268 else status.dirty();
3269 },
3270 get path() {
3271 return ctx.path;
3272 }
3273 };
3274 checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
3275 if (effect.type === "preprocess") {
3276 const processed = effect.transform(ctx.data, checkCtx);
3277 if (ctx.common.async) return Promise.resolve(processed).then(async (processed) => {
3278 if (status.value === "aborted") return INVALID;
3279 const result = await this._def.schema._parseAsync({
3280 data: processed,
3281 path: ctx.path,
3282 parent: ctx
3283 });
3284 if (result.status === "aborted") return INVALID;
3285 if (result.status === "dirty") return DIRTY(result.value);
3286 if (status.value === "dirty") return DIRTY(result.value);
3287 return result;
3288 });
3289 else {
3290 if (status.value === "aborted") return INVALID;
3291 const result = this._def.schema._parseSync({
3292 data: processed,
3293 path: ctx.path,
3294 parent: ctx
3295 });
3296 if (result.status === "aborted") return INVALID;
3297 if (result.status === "dirty") return DIRTY(result.value);
3298 if (status.value === "dirty") return DIRTY(result.value);
3299 return result;
3300 }
3301 }
3302 if (effect.type === "refinement") {
3303 const executeRefinement = (acc) => {
3304 const result = effect.refinement(acc, checkCtx);
3305 if (ctx.common.async) return Promise.resolve(result);
3306 if (result instanceof Promise) throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
3307 return acc;
3308 };
3309 if (ctx.common.async === false) {
3310 const inner = this._def.schema._parseSync({
3311 data: ctx.data,
3312 path: ctx.path,
3313 parent: ctx
3314 });
3315 if (inner.status === "aborted") return INVALID;
3316 if (inner.status === "dirty") status.dirty();
3317 executeRefinement(inner.value);
3318 return {
3319 status: status.value,
3320 value: inner.value
3321 };
3322 } else return this._def.schema._parseAsync({
3323 data: ctx.data,
3324 path: ctx.path,
3325 parent: ctx
3326 }).then((inner) => {
3327 if (inner.status === "aborted") return INVALID;
3328 if (inner.status === "dirty") status.dirty();
3329 return executeRefinement(inner.value).then(() => {
3330 return {
3331 status: status.value,
3332 value: inner.value
3333 };
3334 });
3335 });
3336 }
3337 if (effect.type === "transform") if (ctx.common.async === false) {
3338 const base = this._def.schema._parseSync({
3339 data: ctx.data,
3340 path: ctx.path,
3341 parent: ctx
3342 });
3343 if (!isValid(base)) return INVALID;
3344 const result = effect.transform(base.value, checkCtx);
3345 if (result instanceof Promise) throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
3346 return {
3347 status: status.value,
3348 value: result
3349 };
3350 } else return this._def.schema._parseAsync({
3351 data: ctx.data,
3352 path: ctx.path,
3353 parent: ctx
3354 }).then((base) => {
3355 if (!isValid(base)) return INVALID;
3356 return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
3357 status: status.value,
3358 value: result
3359 }));
3360 });
3361 util.assertNever(effect);
3362 }
3363 };
3364 ZodEffects.create = (schema, effect, params) => {
3365 return new ZodEffects({
3366 schema,
3367 typeName: ZodFirstPartyTypeKind.ZodEffects,
3368 effect,
3369 ...processCreateParams(params)
3370 });
3371 };
3372 ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
3373 return new ZodEffects({
3374 schema,
3375 effect: {
3376 type: "preprocess",
3377 transform: preprocess
3378 },
3379 typeName: ZodFirstPartyTypeKind.ZodEffects,
3380 ...processCreateParams(params)
3381 });
3382 };
3383 var ZodOptional$1 = class extends ZodType$1 {
3384 static {
3385 __name(this, "ZodOptional");
3386 }
3387 _parse(input) {
3388 if (this._getType(input) === ZodParsedType.undefined) return OK(void 0);
3389 return this._def.innerType._parse(input);
3390 }
3391 unwrap() {
3392 return this._def.innerType;
3393 }
3394 };
3395 ZodOptional$1.create = (type, params) => {
3396 return new ZodOptional$1({
3397 innerType: type,
3398 typeName: ZodFirstPartyTypeKind.ZodOptional,
3399 ...processCreateParams(params)
3400 });
3401 };
3402 var ZodNullable$1 = class extends ZodType$1 {
3403 static {
3404 __name(this, "ZodNullable");
3405 }
3406 _parse(input) {
3407 if (this._getType(input) === ZodParsedType.null) return OK(null);
3408 return this._def.innerType._parse(input);
3409 }
3410 unwrap() {
3411 return this._def.innerType;
3412 }
3413 };
3414 ZodNullable$1.create = (type, params) => {
3415 return new ZodNullable$1({
3416 innerType: type,
3417 typeName: ZodFirstPartyTypeKind.ZodNullable,
3418 ...processCreateParams(params)
3419 });
3420 };
3421 var ZodDefault$1 = class extends ZodType$1 {
3422 static {
3423 __name(this, "ZodDefault");
3424 }
3425 _parse(input) {
3426 const { ctx } = this._processInputParams(input);
3427 let data = ctx.data;
3428 if (ctx.parsedType === ZodParsedType.undefined) data = this._def.defaultValue();
3429 return this._def.innerType._parse({
3430 data,
3431 path: ctx.path,
3432 parent: ctx
3433 });
3434 }
3435 removeDefault() {
3436 return this._def.innerType;
3437 }
3438 };
3439 ZodDefault$1.create = (type, params) => {
3440 return new ZodDefault$1({
3441 innerType: type,
3442 typeName: ZodFirstPartyTypeKind.ZodDefault,
3443 defaultValue: typeof params.default === "function" ? params.default : () => params.default,
3444 ...processCreateParams(params)
3445 });
3446 };
3447 var ZodCatch$1 = class extends ZodType$1 {
3448 static {
3449 __name(this, "ZodCatch");
3450 }
3451 _parse(input) {
3452 const { ctx } = this._processInputParams(input);
3453 const newCtx = {
3454 ...ctx,
3455 common: {
3456 ...ctx.common,
3457 issues: []
3458 }
3459 };
3460 const result = this._def.innerType._parse({
3461 data: newCtx.data,
3462 path: newCtx.path,
3463 parent: { ...newCtx }
3464 });
3465 if (isAsync(result)) return result.then((result) => {
3466 return {
3467 status: "valid",
3468 value: result.status === "valid" ? result.value : this._def.catchValue({
3469 get error() {
3470 return new ZodError$1(newCtx.common.issues);
3471 },
3472 input: newCtx.data
3473 })
3474 };
3475 });
3476 else return {
3477 status: "valid",
3478 value: result.status === "valid" ? result.value : this._def.catchValue({
3479 get error() {
3480 return new ZodError$1(newCtx.common.issues);
3481 },
3482 input: newCtx.data
3483 })
3484 };
3485 }
3486 removeCatch() {
3487 return this._def.innerType;
3488 }
3489 };
3490 ZodCatch$1.create = (type, params) => {
3491 return new ZodCatch$1({
3492 innerType: type,
3493 typeName: ZodFirstPartyTypeKind.ZodCatch,
3494 catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3495 ...processCreateParams(params)
3496 });
3497 };
3498 var ZodNaN$1 = class extends ZodType$1 {
3499 static {
3500 __name(this, "ZodNaN");
3501 }
3502 _parse(input) {
3503 if (this._getType(input) !== ZodParsedType.nan) {
3504 const ctx = this._getOrReturnCtx(input);
3505 addIssueToContext(ctx, {
3506 code: ZodIssueCode$1.invalid_type,
3507 expected: ZodParsedType.nan,
3508 received: ctx.parsedType
3509 });
3510 return INVALID;
3511 }
3512 return {
3513 status: "valid",
3514 value: input.data
3515 };
3516 }
3517 };
3518 ZodNaN$1.create = (params) => {
3519 return new ZodNaN$1({
3520 typeName: ZodFirstPartyTypeKind.ZodNaN,
3521 ...processCreateParams(params)
3522 });
3523 };
3524 var BRAND = Symbol("zod_brand");
3525 var ZodBranded = class extends ZodType$1 {
3526 _parse(input) {
3527 const { ctx } = this._processInputParams(input);
3528 const data = ctx.data;
3529 return this._def.type._parse({
3530 data,
3531 path: ctx.path,
3532 parent: ctx
3533 });
3534 }
3535 unwrap() {
3536 return this._def.type;
3537 }
3538 };
3539 var ZodPipeline = class ZodPipeline extends ZodType$1 {
3540 _parse(input) {
3541 const { status, ctx } = this._processInputParams(input);
3542 if (ctx.common.async) {
3543 const handleAsync = async () => {
3544 const inResult = await this._def.in._parseAsync({
3545 data: ctx.data,
3546 path: ctx.path,
3547 parent: ctx
3548 });
3549 if (inResult.status === "aborted") return INVALID;
3550 if (inResult.status === "dirty") {
3551 status.dirty();
3552 return DIRTY(inResult.value);
3553 } else return this._def.out._parseAsync({
3554 data: inResult.value,
3555 path: ctx.path,
3556 parent: ctx
3557 });
3558 };
3559 return handleAsync();
3560 } else {
3561 const inResult = this._def.in._parseSync({
3562 data: ctx.data,
3563 path: ctx.path,
3564 parent: ctx
3565 });
3566 if (inResult.status === "aborted") return INVALID;
3567 if (inResult.status === "dirty") {
3568 status.dirty();
3569 return {
3570 status: "dirty",
3571 value: inResult.value
3572 };
3573 } else return this._def.out._parseSync({
3574 data: inResult.value,
3575 path: ctx.path,
3576 parent: ctx
3577 });
3578 }
3579 }
3580 static create(a, b) {
3581 return new ZodPipeline({
3582 in: a,
3583 out: b,
3584 typeName: ZodFirstPartyTypeKind.ZodPipeline
3585 });
3586 }
3587 };
3588 var ZodReadonly$1 = class extends ZodType$1 {
3589 static {
3590 __name(this, "ZodReadonly");
3591 }
3592 _parse(input) {
3593 const result = this._def.innerType._parse(input);
3594 const freeze = (data) => {
3595 if (isValid(data)) data.value = Object.freeze(data.value);
3596 return data;
3597 };
3598 return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
3599 }
3600 unwrap() {
3601 return this._def.innerType;
3602 }
3603 };
3604 ZodReadonly$1.create = (type, params) => {
3605 return new ZodReadonly$1({
3606 innerType: type,
3607 typeName: ZodFirstPartyTypeKind.ZodReadonly,
3608 ...processCreateParams(params)
3609 });
3610 };
3611 function cleanParams(params, data) {
3612 const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3613 return typeof p === "string" ? { message: p } : p;
3614 }
3615 function custom$1(check, _params = {}, fatal) {
3616 if (check) return ZodAny$1.create().superRefine((data, ctx) => {
3617 const r = check(data);
3618 if (r instanceof Promise) return r.then((r) => {
3619 if (!r) {
3620 const params = cleanParams(_params, data);
3621 const _fatal = params.fatal ?? fatal ?? true;
3622 ctx.addIssue({
3623 code: "custom",
3624 ...params,
3625 fatal: _fatal
3626 });
3627 }
3628 });
3629 if (!r) {
3630 const params = cleanParams(_params, data);
3631 const _fatal = params.fatal ?? fatal ?? true;
3632 ctx.addIssue({
3633 code: "custom",
3634 ...params,
3635 fatal: _fatal
3636 });
3637 }
3638 });
3639 return ZodAny$1.create();
3640 }
3641 __name(custom$1, "custom");
3642 var late = { object: ZodObject$1.lazycreate };
3643 var ZodFirstPartyTypeKind;
3644 (function(ZodFirstPartyTypeKind) {
3645 ZodFirstPartyTypeKind["ZodString"] = "ZodString";
3646 ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
3647 ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
3648 ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
3649 ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
3650 ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
3651 ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
3652 ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
3653 ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
3654 ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
3655 ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
3656 ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
3657 ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
3658 ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
3659 ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
3660 ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
3661 ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
3662 ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
3663 ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
3664 ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
3665 ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
3666 ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
3667 ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
3668 ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
3669 ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
3670 ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
3671 ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
3672 ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
3673 ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
3674 ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
3675 ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
3676 ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
3677 ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
3678 ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
3679 ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
3680 ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
3681 })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
3682 var instanceOfType = (cls, params = { message: `Input not instance of ${cls.name}` }) => custom$1((data) => data instanceof cls, params);
3683 var stringType = ZodString$1.create;
3684 var numberType = ZodNumber$1.create;
3685 var nanType = ZodNaN$1.create;
3686 var bigIntType = ZodBigInt$1.create;
3687 var booleanType = ZodBoolean$1.create;
3688 var dateType = ZodDate$1.create;
3689 var symbolType = ZodSymbol$1.create;
3690 var undefinedType = ZodUndefined$1.create;
3691 var nullType = ZodNull$1.create;
3692 var anyType = ZodAny$1.create;
3693 var unknownType = ZodUnknown$1.create;
3694 var neverType = ZodNever$1.create;
3695 var voidType = ZodVoid$1.create;
3696 var arrayType = ZodArray$1.create;
3697 var objectType = ZodObject$1.create;
3698 var strictObjectType = ZodObject$1.strictCreate;
3699 var unionType = ZodUnion$1.create;
3700 var discriminatedUnionType = ZodDiscriminatedUnion$1.create;
3701 var intersectionType = ZodIntersection$1.create;
3702 var tupleType = ZodTuple$1.create;
3703 var recordType = ZodRecord$1.create;
3704 var mapType = ZodMap$1.create;
3705 var setType = ZodSet$1.create;
3706 var functionType = ZodFunction.create;
3707 var lazyType = ZodLazy$1.create;
3708 var literalType = ZodLiteral$1.create;
3709 var enumType = ZodEnum$1.create;
3710 var nativeEnumType = ZodNativeEnum.create;
3711 var promiseType = ZodPromise$1.create;
3712 var effectsType = ZodEffects.create;
3713 var optionalType = ZodOptional$1.create;
3714 var nullableType = ZodNullable$1.create;
3715 var preprocessType = ZodEffects.createWithPreprocess;
3716 var pipelineType = ZodPipeline.create;
3717 var ostring = () => stringType().optional();
3718 var onumber = () => numberType().optional();
3719 var oboolean = () => booleanType().optional();
3720 var coerce = {
3721 string: ((arg) => ZodString$1.create({
3722 ...arg,
3723 coerce: true
3724 })),
3725 number: ((arg) => ZodNumber$1.create({
3726 ...arg,
3727 coerce: true
3728 })),
3729 boolean: ((arg) => ZodBoolean$1.create({
3730 ...arg,
3731 coerce: true
3732 })),
3733 bigint: ((arg) => ZodBigInt$1.create({
3734 ...arg,
3735 coerce: true
3736 })),
3737 date: ((arg) => ZodDate$1.create({
3738 ...arg,
3739 coerce: true
3740 }))
3741 };
3742 var NEVER$1 = INVALID;
3743
3744 //#endregion
3745 //#region node_modules/zod/v3/external.js
3746 var external_exports$1 = /* @__PURE__ */ __exportAll({
3747 BRAND: () => BRAND,
3748 DIRTY: () => DIRTY,
3749 EMPTY_PATH: () => EMPTY_PATH,
3750 INVALID: () => INVALID,
3751 NEVER: () => NEVER$1,
3752 OK: () => OK,
3753 ParseStatus: () => ParseStatus,
3754 Schema: () => ZodType$1,
3755 ZodAny: () => ZodAny$1,
3756 ZodArray: () => ZodArray$1,
3757 ZodBigInt: () => ZodBigInt$1,
3758 ZodBoolean: () => ZodBoolean$1,
3759 ZodBranded: () => ZodBranded,
3760 ZodCatch: () => ZodCatch$1,
3761 ZodDate: () => ZodDate$1,
3762 ZodDefault: () => ZodDefault$1,
3763 ZodDiscriminatedUnion: () => ZodDiscriminatedUnion$1,
3764 ZodEffects: () => ZodEffects,
3765 ZodEnum: () => ZodEnum$1,
3766 ZodError: () => ZodError$1,
3767 ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
3768 ZodFunction: () => ZodFunction,
3769 ZodIntersection: () => ZodIntersection$1,
3770 ZodIssueCode: () => ZodIssueCode$1,
3771 ZodLazy: () => ZodLazy$1,
3772 ZodLiteral: () => ZodLiteral$1,
3773 ZodMap: () => ZodMap$1,
3774 ZodNaN: () => ZodNaN$1,
3775 ZodNativeEnum: () => ZodNativeEnum,
3776 ZodNever: () => ZodNever$1,
3777 ZodNull: () => ZodNull$1,
3778 ZodNullable: () => ZodNullable$1,
3779 ZodNumber: () => ZodNumber$1,
3780 ZodObject: () => ZodObject$1,
3781 ZodOptional: () => ZodOptional$1,
3782 ZodParsedType: () => ZodParsedType,
3783 ZodPipeline: () => ZodPipeline,
3784 ZodPromise: () => ZodPromise$1,
3785 ZodReadonly: () => ZodReadonly$1,
3786 ZodRecord: () => ZodRecord$1,
3787 ZodSchema: () => ZodType$1,
3788 ZodSet: () => ZodSet$1,
3789 ZodString: () => ZodString$1,
3790 ZodSymbol: () => ZodSymbol$1,
3791 ZodTransformer: () => ZodEffects,
3792 ZodTuple: () => ZodTuple$1,
3793 ZodType: () => ZodType$1,
3794 ZodUndefined: () => ZodUndefined$1,
3795 ZodUnion: () => ZodUnion$1,
3796 ZodUnknown: () => ZodUnknown$1,
3797 ZodVoid: () => ZodVoid$1,
3798 addIssueToContext: () => addIssueToContext,
3799 any: () => anyType,
3800 array: () => arrayType,
3801 bigint: () => bigIntType,
3802 boolean: () => booleanType,
3803 coerce: () => coerce,
3804 custom: () => custom$1,
3805 date: () => dateType,
3806 datetimeRegex: () => datetimeRegex,
3807 defaultErrorMap: () => errorMap,
3808 discriminatedUnion: () => discriminatedUnionType,
3809 effect: () => effectsType,
3810 enum: () => enumType,
3811 function: () => functionType,
3812 getErrorMap: () => getErrorMap$1,
3813 getParsedType: () => getParsedType$1,
3814 instanceof: () => instanceOfType,
3815 intersection: () => intersectionType,
3816 isAborted: () => isAborted,
3817 isAsync: () => isAsync,
3818 isDirty: () => isDirty,
3819 isValid: () => isValid,
3820 late: () => late,
3821 lazy: () => lazyType,
3822 literal: () => literalType,
3823 makeIssue: () => makeIssue,
3824 map: () => mapType,
3825 nan: () => nanType,
3826 nativeEnum: () => nativeEnumType,
3827 never: () => neverType,
3828 null: () => nullType,
3829 nullable: () => nullableType,
3830 number: () => numberType,
3831 object: () => objectType,
3832 objectUtil: () => objectUtil,
3833 oboolean: () => oboolean,
3834 onumber: () => onumber,
3835 optional: () => optionalType,
3836 ostring: () => ostring,
3837 pipeline: () => pipelineType,
3838 preprocess: () => preprocessType,
3839 promise: () => promiseType,
3840 quotelessJson: () => quotelessJson,
3841 record: () => recordType,
3842 set: () => setType,
3843 setErrorMap: () => setErrorMap$1,
3844 strictObject: () => strictObjectType,
3845 string: () => stringType,
3846 symbol: () => symbolType,
3847 transformer: () => effectsType,
3848 tuple: () => tupleType,
3849 undefined: () => undefinedType,
3850 union: () => unionType,
3851 unknown: () => unknownType,
3852 util: () => util,
3853 void: () => voidType
3854 });
3855
3856 //#endregion
3857 //#region node_modules/zod/v4/core/core.js
3858 /** A special constant with type `never` */
3859 var NEVER = Object.freeze({ status: "aborted" });
3860 function $constructor(name, initializer, params) {
3861 function init(inst, def) {
3862 var _a;
3863 Object.defineProperty(inst, "_zod", {
3864 value: inst._zod ?? {},
3865 enumerable: false
3866 });
3867 (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
3868 inst._zod.traits.add(name);
3869 initializer(inst, def);
3870 for (const k in _.prototype) if (!(k in inst)) Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
3871 inst._zod.constr = _;
3872 inst._zod.def = def;
3873 }
3874 const Parent = params?.Parent ?? Object;
3875 class Definition extends Parent {}
3876 Object.defineProperty(Definition, "name", { value: name });
3877 function _(def) {
3878 var _a;
3879 const inst = params?.Parent ? new Definition() : this;
3880 init(inst, def);
3881 (_a = inst._zod).deferred ?? (_a.deferred = []);
3882 for (const fn of inst._zod.deferred) fn();
3883 return inst;
3884 }
3885 Object.defineProperty(_, "init", { value: init });
3886 Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
3887 if (params?.Parent && inst instanceof params.Parent) return true;
3888 return inst?._zod?.traits?.has(name);
3889 } });
3890 Object.defineProperty(_, "name", { value: name });
3891 return _;
3892 }
3893 var $brand = Symbol("zod_brand");
3894 var $ZodAsyncError = class extends Error {
3895 constructor() {
3896 super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
3897 }
3898 };
3899 var globalConfig = {};
3900 function config(newConfig) {
3901 if (newConfig) Object.assign(globalConfig, newConfig);
3902 return globalConfig;
3903 }
3904
3905 //#endregion
3906 //#region node_modules/zod/v4/core/util.js
3907 var util_exports = /* @__PURE__ */ __exportAll({
3908 BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
3909 Class: () => Class,
3910 NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
3911 aborted: () => aborted,
3912 allowsEval: () => allowsEval,
3913 assert: () => assert,
3914 assertEqual: () => assertEqual,
3915 assertIs: () => assertIs,
3916 assertNever: () => assertNever,
3917 assertNotEqual: () => assertNotEqual,
3918 assignProp: () => assignProp,
3919 cached: () => cached,
3920 captureStackTrace: () => captureStackTrace,
3921 cleanEnum: () => cleanEnum,
3922 cleanRegex: () => cleanRegex,
3923 clone: () => clone,
3924 createTransparentProxy: () => createTransparentProxy,
3925 defineLazy: () => defineLazy,
3926 esc: () => esc,
3927 escapeRegex: () => escapeRegex,
3928 extend: () => extend,
3929 finalizeIssue: () => finalizeIssue,
3930 floatSafeRemainder: () => floatSafeRemainder,
3931 getElementAtPath: () => getElementAtPath,
3932 getEnumValues: () => getEnumValues,
3933 getLengthableOrigin: () => getLengthableOrigin,
3934 getParsedType: () => getParsedType,
3935 getSizableOrigin: () => getSizableOrigin,
3936 isObject: () => isObject,
3937 isPlainObject: () => isPlainObject,
3938 issue: () => issue,
3939 joinValues: () => joinValues,
3940 jsonStringifyReplacer: () => jsonStringifyReplacer,
3941 merge: () => merge,
3942 normalizeParams: () => normalizeParams,
3943 nullish: () => nullish$1,
3944 numKeys: () => numKeys,
3945 omit: () => omit,
3946 optionalKeys: () => optionalKeys,
3947 partial: () => partial,
3948 pick: () => pick,
3949 prefixIssues: () => prefixIssues,
3950 primitiveTypes: () => primitiveTypes,
3951 promiseAllObject: () => promiseAllObject,
3952 propertyKeyTypes: () => propertyKeyTypes,
3953 randomString: () => randomString,
3954 required: () => required,
3955 stringifyPrimitive: () => stringifyPrimitive,
3956 unwrapMessage: () => unwrapMessage
3957 });
3958 function assertEqual(val) {
3959 return val;
3960 }
3961 function assertNotEqual(val) {
3962 return val;
3963 }
3964 function assertIs(_arg) {}
3965 function assertNever(_x) {
3966 throw new Error();
3967 }
3968 function assert(_) {}
3969 function getEnumValues(entries) {
3970 const numericValues = Object.values(entries).filter((v) => typeof v === "number");
3971 return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
3972 }
3973 function joinValues(array, separator = "|") {
3974 return array.map((val) => stringifyPrimitive(val)).join(separator);
3975 }
3976 function jsonStringifyReplacer(_, value) {
3977 if (typeof value === "bigint") return value.toString();
3978 return value;
3979 }
3980 function cached(getter) {
3981 return { get value() {
3982 {
3983 const value = getter();
3984 Object.defineProperty(this, "value", { value });
3985 return value;
3986 }
3987 } };
3988 }
3989 function nullish$1(input) {
3990 return input === null || input === void 0;
3991 }
3992 __name(nullish$1, "nullish");
3993 function cleanRegex(source) {
3994 const start = source.startsWith("^") ? 1 : 0;
3995 const end = source.endsWith("$") ? source.length - 1 : source.length;
3996 return source.slice(start, end);
3997 }
3998 function floatSafeRemainder(val, step) {
3999 const valDecCount = (val.toString().split(".")[1] || "").length;
4000 const stepDecCount = (step.toString().split(".")[1] || "").length;
4001 const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
4002 return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
4003 }
4004 function defineLazy(object, key, getter) {
4005 Object.defineProperty(object, key, {
4006 get() {
4007 {
4008 const value = getter();
4009 object[key] = value;
4010 return value;
4011 }
4012 },
4013 set(v) {
4014 Object.defineProperty(object, key, { value: v });
4015 },
4016 configurable: true
4017 });
4018 }
4019 function assignProp(target, prop, value) {
4020 Object.defineProperty(target, prop, {
4021 value,
4022 writable: true,
4023 enumerable: true,
4024 configurable: true
4025 });
4026 }
4027 function getElementAtPath(obj, path) {
4028 if (!path) return obj;
4029 return path.reduce((acc, key) => acc?.[key], obj);
4030 }
4031 function promiseAllObject(promisesObj) {
4032 const keys = Object.keys(promisesObj);
4033 const promises = keys.map((key) => promisesObj[key]);
4034 return Promise.all(promises).then((results) => {
4035 const resolvedObj = {};
4036 for (let i = 0; i < keys.length; i++) resolvedObj[keys[i]] = results[i];
4037 return resolvedObj;
4038 });
4039 }
4040 function randomString(length = 10) {
4041 const chars = "abcdefghijklmnopqrstuvwxyz";
4042 let str = "";
4043 for (let i = 0; i < length; i++) str += chars[Math.floor(Math.random() * 26)];
4044 return str;
4045 }
4046 function esc(str) {
4047 return JSON.stringify(str);
4048 }
4049 var captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {};
4050 function isObject(data) {
4051 return typeof data === "object" && data !== null && !Array.isArray(data);
4052 }
4053 var allowsEval = cached(() => {
4054 if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
4055 try {
4056 new Function("");
4057 return true;
4058 } catch (_) {
4059 return false;
4060 }
4061 });
4062 function isPlainObject(o) {
4063 if (isObject(o) === false) return false;
4064 const ctor = o.constructor;
4065 if (ctor === void 0) return true;
4066 const prot = ctor.prototype;
4067 if (isObject(prot) === false) return false;
4068 if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
4069 return true;
4070 }
4071 function numKeys(data) {
4072 let keyCount = 0;
4073 for (const key in data) if (Object.prototype.hasOwnProperty.call(data, key)) keyCount++;
4074 return keyCount;
4075 }
4076 var getParsedType = (data) => {
4077 const t = typeof data;
4078 switch (t) {
4079 case "undefined": return "undefined";
4080 case "string": return "string";
4081 case "number": return Number.isNaN(data) ? "nan" : "number";
4082 case "boolean": return "boolean";
4083 case "function": return "function";
4084 case "bigint": return "bigint";
4085 case "symbol": return "symbol";
4086 case "object":
4087 if (Array.isArray(data)) return "array";
4088 if (data === null) return "null";
4089 if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") return "promise";
4090 if (typeof Map !== "undefined" && data instanceof Map) return "map";
4091 if (typeof Set !== "undefined" && data instanceof Set) return "set";
4092 if (typeof Date !== "undefined" && data instanceof Date) return "date";
4093 if (typeof File !== "undefined" && data instanceof File) return "file";
4094 return "object";
4095 default: throw new Error(`Unknown data type: ${t}`);
4096 }
4097 };
4098 var propertyKeyTypes = /* @__PURE__ */ new Set([
4099 "string",
4100 "number",
4101 "symbol"
4102 ]);
4103 var primitiveTypes = /* @__PURE__ */ new Set([
4104 "string",
4105 "number",
4106 "bigint",
4107 "boolean",
4108 "symbol",
4109 "undefined"
4110 ]);
4111 function escapeRegex(str) {
4112 return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4113 }
4114 function clone(inst, def, params) {
4115 const cl = new inst._zod.constr(def ?? inst._zod.def);
4116 if (!def || params?.parent) cl._zod.parent = inst;
4117 return cl;
4118 }
4119 function normalizeParams(_params) {
4120 const params = _params;
4121 if (!params) return {};
4122 if (typeof params === "string") return { error: () => params };
4123 if (params?.message !== void 0) {
4124 if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
4125 params.error = params.message;
4126 }
4127 delete params.message;
4128 if (typeof params.error === "string") return {
4129 ...params,
4130 error: () => params.error
4131 };
4132 return params;
4133 }
4134 function createTransparentProxy(getter) {
4135 let target;
4136 return new Proxy({}, {
4137 get(_, prop, receiver) {
4138 target ?? (target = getter());
4139 return Reflect.get(target, prop, receiver);
4140 },
4141 set(_, prop, value, receiver) {
4142 target ?? (target = getter());
4143 return Reflect.set(target, prop, value, receiver);
4144 },
4145 has(_, prop) {
4146 target ?? (target = getter());
4147 return Reflect.has(target, prop);
4148 },
4149 deleteProperty(_, prop) {
4150 target ?? (target = getter());
4151 return Reflect.deleteProperty(target, prop);
4152 },
4153 ownKeys(_) {
4154 target ?? (target = getter());
4155 return Reflect.ownKeys(target);
4156 },
4157 getOwnPropertyDescriptor(_, prop) {
4158 target ?? (target = getter());
4159 return Reflect.getOwnPropertyDescriptor(target, prop);
4160 },
4161 defineProperty(_, prop, descriptor) {
4162 target ?? (target = getter());
4163 return Reflect.defineProperty(target, prop, descriptor);
4164 }
4165 });
4166 }
4167 function stringifyPrimitive(value) {
4168 if (typeof value === "bigint") return value.toString() + "n";
4169 if (typeof value === "string") return `"${value}"`;
4170 return `${value}`;
4171 }
4172 function optionalKeys(shape) {
4173 return Object.keys(shape).filter((k) => {
4174 return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
4175 });
4176 }
4177 var NUMBER_FORMAT_RANGES = {
4178 safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
4179 int32: [-2147483648, 2147483647],
4180 uint32: [0, 4294967295],
4181 float32: [-34028234663852886e22, 34028234663852886e22],
4182 float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
4183 };
4184 var BIGINT_FORMAT_RANGES = {
4185 int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
4186 uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")]
4187 };
4188 function pick(schema, mask) {
4189 const newShape = {};
4190 const currDef = schema._zod.def;
4191 for (const key in mask) {
4192 if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
4193 if (!mask[key]) continue;
4194 newShape[key] = currDef.shape[key];
4195 }
4196 return clone(schema, {
4197 ...schema._zod.def,
4198 shape: newShape,
4199 checks: []
4200 });
4201 }
4202 function omit(schema, mask) {
4203 const newShape = { ...schema._zod.def.shape };
4204 const currDef = schema._zod.def;
4205 for (const key in mask) {
4206 if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
4207 if (!mask[key]) continue;
4208 delete newShape[key];
4209 }
4210 return clone(schema, {
4211 ...schema._zod.def,
4212 shape: newShape,
4213 checks: []
4214 });
4215 }
4216 function extend(schema, shape) {
4217 if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
4218 return clone(schema, {
4219 ...schema._zod.def,
4220 get shape() {
4221 const _shape = {
4222 ...schema._zod.def.shape,
4223 ...shape
4224 };
4225 assignProp(this, "shape", _shape);
4226 return _shape;
4227 },
4228 checks: []
4229 });
4230 }
4231 function merge(a, b) {
4232 return clone(a, {
4233 ...a._zod.def,
4234 get shape() {
4235 const _shape = {
4236 ...a._zod.def.shape,
4237 ...b._zod.def.shape
4238 };
4239 assignProp(this, "shape", _shape);
4240 return _shape;
4241 },
4242 catchall: b._zod.def.catchall,
4243 checks: []
4244 });
4245 }
4246 function partial(Class, schema, mask) {
4247 const oldShape = schema._zod.def.shape;
4248 const shape = { ...oldShape };
4249 if (mask) for (const key in mask) {
4250 if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
4251 if (!mask[key]) continue;
4252 shape[key] = Class ? new Class({
4253 type: "optional",
4254 innerType: oldShape[key]
4255 }) : oldShape[key];
4256 }
4257 else for (const key in oldShape) shape[key] = Class ? new Class({
4258 type: "optional",
4259 innerType: oldShape[key]
4260 }) : oldShape[key];
4261 return clone(schema, {
4262 ...schema._zod.def,
4263 shape,
4264 checks: []
4265 });
4266 }
4267 function required(Class, schema, mask) {
4268 const oldShape = schema._zod.def.shape;
4269 const shape = { ...oldShape };
4270 if (mask) for (const key in mask) {
4271 if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
4272 if (!mask[key]) continue;
4273 shape[key] = new Class({
4274 type: "nonoptional",
4275 innerType: oldShape[key]
4276 });
4277 }
4278 else for (const key in oldShape) shape[key] = new Class({
4279 type: "nonoptional",
4280 innerType: oldShape[key]
4281 });
4282 return clone(schema, {
4283 ...schema._zod.def,
4284 shape,
4285 checks: []
4286 });
4287 }
4288 function aborted(x, startIndex = 0) {
4289 for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
4290 return false;
4291 }
4292 function prefixIssues(path, issues) {
4293 return issues.map((iss) => {
4294 var _a;
4295 (_a = iss).path ?? (_a.path = []);
4296 iss.path.unshift(path);
4297 return iss;
4298 });
4299 }
4300 function unwrapMessage(message) {
4301 return typeof message === "string" ? message : message?.message;
4302 }
4303 function finalizeIssue(iss, ctx, config) {
4304 const full = {
4305 ...iss,
4306 path: iss.path ?? []
4307 };
4308 if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
4309 delete full.inst;
4310 delete full.continue;
4311 if (!ctx?.reportInput) delete full.input;
4312 return full;
4313 }
4314 function getSizableOrigin(input) {
4315 if (input instanceof Set) return "set";
4316 if (input instanceof Map) return "map";
4317 if (input instanceof File) return "file";
4318 return "unknown";
4319 }
4320 function getLengthableOrigin(input) {
4321 if (Array.isArray(input)) return "array";
4322 if (typeof input === "string") return "string";
4323 return "unknown";
4324 }
4325 function issue(...args) {
4326 const [iss, input, inst] = args;
4327 if (typeof iss === "string") return {
4328 message: iss,
4329 code: "custom",
4330 input,
4331 inst
4332 };
4333 return { ...iss };
4334 }
4335 function cleanEnum(obj) {
4336 return Object.entries(obj).filter(([k, _]) => {
4337 return Number.isNaN(Number.parseInt(k, 10));
4338 }).map((el) => el[1]);
4339 }
4340 var Class = class {
4341 constructor(..._args) {}
4342 };
4343
4344 //#endregion
4345 //#region node_modules/zod/v4/core/errors.js
4346 var initializer$1 = /* @__PURE__ */ __name((inst, def) => {
4347 inst.name = "$ZodError";
4348 Object.defineProperty(inst, "_zod", {
4349 value: inst._zod,
4350 enumerable: false
4351 });
4352 Object.defineProperty(inst, "issues", {
4353 value: def,
4354 enumerable: false
4355 });
4356 Object.defineProperty(inst, "message", {
4357 get() {
4358 return JSON.stringify(def, jsonStringifyReplacer, 2);
4359 },
4360 enumerable: true
4361 });
4362 Object.defineProperty(inst, "toString", {
4363 value: () => inst.message,
4364 enumerable: false
4365 });
4366 }, "initializer");
4367 var $ZodError = $constructor("$ZodError", initializer$1);
4368 var $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
4369 function flattenError(error, mapper = (issue) => issue.message) {
4370 const fieldErrors = {};
4371 const formErrors = [];
4372 for (const sub of error.issues) if (sub.path.length > 0) {
4373 fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
4374 fieldErrors[sub.path[0]].push(mapper(sub));
4375 } else formErrors.push(mapper(sub));
4376 return {
4377 formErrors,
4378 fieldErrors
4379 };
4380 }
4381 function formatError(error, _mapper) {
4382 const mapper = _mapper || function(issue) {
4383 return issue.message;
4384 };
4385 const fieldErrors = { _errors: [] };
4386 const processError = (error) => {
4387 for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }));
4388 else if (issue.code === "invalid_key") processError({ issues: issue.issues });
4389 else if (issue.code === "invalid_element") processError({ issues: issue.issues });
4390 else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));
4391 else {
4392 let curr = fieldErrors;
4393 let i = 0;
4394 while (i < issue.path.length) {
4395 const el = issue.path[i];
4396 if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
4397 else {
4398 curr[el] = curr[el] || { _errors: [] };
4399 curr[el]._errors.push(mapper(issue));
4400 }
4401 curr = curr[el];
4402 i++;
4403 }
4404 }
4405 };
4406 processError(error);
4407 return fieldErrors;
4408 }
4409 function treeifyError(error, _mapper) {
4410 const mapper = _mapper || function(issue) {
4411 return issue.message;
4412 };
4413 const result = { errors: [] };
4414 const processError = (error, path = []) => {
4415 var _a;
4416 var _b;
4417 for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, issue.path));
4418 else if (issue.code === "invalid_key") processError({ issues: issue.issues }, issue.path);
4419 else if (issue.code === "invalid_element") processError({ issues: issue.issues }, issue.path);
4420 else {
4421 const fullpath = [...path, ...issue.path];
4422 if (fullpath.length === 0) {
4423 result.errors.push(mapper(issue));
4424 continue;
4425 }
4426 let curr = result;
4427 let i = 0;
4428 while (i < fullpath.length) {
4429 const el = fullpath[i];
4430 const terminal = i === fullpath.length - 1;
4431 if (typeof el === "string") {
4432 curr.properties ?? (curr.properties = {});
4433 (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });
4434 curr = curr.properties[el];
4435 } else {
4436 curr.items ?? (curr.items = []);
4437 (_b = curr.items)[el] ?? (_b[el] = { errors: [] });
4438 curr = curr.items[el];
4439 }
4440 if (terminal) curr.errors.push(mapper(issue));
4441 i++;
4442 }
4443 }
4444 };
4445 processError(error);
4446 return result;
4447 }
4448 /** Format a ZodError as a human-readable string in the following form.
4449 *
4450 * From
4451 *
4452 * ```ts
4453 * ZodError {
4454 * issues: [
4455 * {
4456 * expected: 'string',
4457 * code: 'invalid_type',
4458 * path: [ 'username' ],
4459 * message: 'Invalid input: expected string'
4460 * },
4461 * {
4462 * expected: 'number',
4463 * code: 'invalid_type',
4464 * path: [ 'favoriteNumbers', 1 ],
4465 * message: 'Invalid input: expected number'
4466 * }
4467 * ];
4468 * }
4469 * ```
4470 *
4471 * to
4472 *
4473 * ```
4474 * username
4475 * ✖ Expected number, received string at "username
4476 * favoriteNumbers[0]
4477 * ✖ Invalid input: expected number
4478 * ```
4479 */
4480 function toDotPath(path) {
4481 const segs = [];
4482 for (const seg of path) if (typeof seg === "number") segs.push(`[${seg}]`);
4483 else if (typeof seg === "symbol") segs.push(`[${JSON.stringify(String(seg))}]`);
4484 else if (/[^\w$]/.test(seg)) segs.push(`[${JSON.stringify(seg)}]`);
4485 else {
4486 if (segs.length) segs.push(".");
4487 segs.push(seg);
4488 }
4489 return segs.join("");
4490 }
4491 function prettifyError(error) {
4492 const lines = [];
4493 const issues = [...error.issues].sort((a, b) => a.path.length - b.path.length);
4494 for (const issue of issues) {
4495 lines.push(`✖ ${issue.message}`);
4496 if (issue.path?.length) lines.push(` → at ${toDotPath(issue.path)}`);
4497 }
4498 return lines.join("\n");
4499 }
4500
4501 //#endregion
4502 //#region node_modules/zod/v4/core/parse.js
4503 var _parse = (_Err) => (schema, value, _ctx, _params) => {
4504 const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
4505 const result = schema._zod.run({
4506 value,
4507 issues: []
4508 }, ctx);
4509 if (result instanceof Promise) throw new $ZodAsyncError();
4510 if (result.issues.length) {
4511 const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
4512 captureStackTrace(e, _params?.callee);
4513 throw e;
4514 }
4515 return result.value;
4516 };
4517 var parse$1 = /* @__PURE__*/ _parse($ZodRealError);
4518 var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
4519 const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
4520 let result = schema._zod.run({
4521 value,
4522 issues: []
4523 }, ctx);
4524 if (result instanceof Promise) result = await result;
4525 if (result.issues.length) {
4526 const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
4527 captureStackTrace(e, params?.callee);
4528 throw e;
4529 }
4530 return result.value;
4531 };
4532 var parseAsync$1 = /* @__PURE__*/ _parseAsync($ZodRealError);
4533 var _safeParse = (_Err) => (schema, value, _ctx) => {
4534 const ctx = _ctx ? {
4535 ..._ctx,
4536 async: false
4537 } : { async: false };
4538 const result = schema._zod.run({
4539 value,
4540 issues: []
4541 }, ctx);
4542 if (result instanceof Promise) throw new $ZodAsyncError();
4543 return result.issues.length ? {
4544 success: false,
4545 error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
4546 } : {
4547 success: true,
4548 data: result.value
4549 };
4550 };
4551 var safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError);
4552 var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
4553 const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
4554 let result = schema._zod.run({
4555 value,
4556 issues: []
4557 }, ctx);
4558 if (result instanceof Promise) result = await result;
4559 return result.issues.length ? {
4560 success: false,
4561 error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
4562 } : {
4563 success: true,
4564 data: result.value
4565 };
4566 };
4567 var safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
4568
4569 //#endregion
4570 //#region node_modules/zod/v4/core/regexes.js
4571 var regexes_exports = /* @__PURE__ */ __exportAll({
4572 _emoji: () => _emoji$1,
4573 base64: () => base64$1,
4574 base64url: () => base64url$1,
4575 bigint: () => bigint$2,
4576 boolean: () => boolean$2,
4577 browserEmail: () => browserEmail,
4578 cidrv4: () => cidrv4$1,
4579 cidrv6: () => cidrv6$1,
4580 cuid: () => cuid$1,
4581 cuid2: () => cuid2$1,
4582 date: () => date$3,
4583 datetime: () => datetime$1,
4584 domain: () => domain,
4585 duration: () => duration$1,
4586 e164: () => e164$1,
4587 email: () => email$1,
4588 emoji: () => emoji$1,
4589 extendedDuration: () => extendedDuration,
4590 guid: () => guid$1,
4591 hostname: () => hostname,
4592 html5Email: () => html5Email,
4593 integer: () => integer,
4594 ipv4: () => ipv4$1,
4595 ipv6: () => ipv6$1,
4596 ksuid: () => ksuid$1,
4597 lowercase: () => lowercase,
4598 nanoid: () => nanoid$1,
4599 null: () => _null$2,
4600 number: () => number$2,
4601 rfc5322Email: () => rfc5322Email,
4602 string: () => string$2,
4603 time: () => time$1,
4604 ulid: () => ulid$1,
4605 undefined: () => _undefined$2,
4606 unicodeEmail: () => unicodeEmail,
4607 uppercase: () => uppercase,
4608 uuid: () => uuid$1,
4609 uuid4: () => uuid4,
4610 uuid6: () => uuid6,
4611 uuid7: () => uuid7,
4612 xid: () => xid$1
4613 });
4614 var cuid$1 = /^[cC][^\s-]{8,}$/;
4615 var cuid2$1 = /^[0-9a-z]+$/;
4616 var ulid$1 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
4617 var xid$1 = /^[0-9a-vA-V]{20}$/;
4618 var ksuid$1 = /^[A-Za-z0-9]{27}$/;
4619 var nanoid$1 = /^[a-zA-Z0-9_-]{21}$/;
4620 /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
4621 var duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
4622 /** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */
4623 var extendedDuration = /^[-+]?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)?)??$/;
4624 /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
4625 var guid$1 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
4626 /** Returns a regex for validating an RFC 4122 UUID.
4627 *
4628 * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
4629 var uuid$1 = /* @__PURE__ */ __name((version) => {
4630 if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
4631 return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
4632 }, "uuid");
4633 var uuid4 = /*@__PURE__*/ uuid$1(4);
4634 var uuid6 = /*@__PURE__*/ uuid$1(6);
4635 var uuid7 = /*@__PURE__*/ uuid$1(7);
4636 /** Practical email validation */
4637 var email$1 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
4638 /** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
4639 var html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
4640 /** The classic emailregex.com regex for RFC 5322-compliant emails */
4641 var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
4642 /** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */
4643 var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
4644 var browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
4645 var _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
4646 function emoji$1() {
4647 return new RegExp(_emoji$1, "u");
4648 }
4649 __name(emoji$1, "emoji");
4650 var ipv4$1 = /^(?:(?: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])$/;
4651 var ipv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;
4652 var cidrv4$1 = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/;
4653 var cidrv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
4654 var base64$1 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
4655 var base64url$1 = /^[A-Za-z0-9_-]*$/;
4656 var hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
4657 var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
4658 var e164$1 = /^\+(?:[0-9]){6,14}[0-9]$/;
4659 var dateSource = `(?:(?:\\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])))`;
4660 var date$3 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
4661 function timeSource(args) {
4662 const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
4663 return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
4664 }
4665 function time$1(args) {
4666 return new RegExp(`^${timeSource(args)}$`);
4667 }
4668 __name(time$1, "time");
4669 function datetime$1(args) {
4670 const time = timeSource({ precision: args.precision });
4671 const opts = ["Z"];
4672 if (args.local) opts.push("");
4673 if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
4674 const timeRegex = `${time}(?:${opts.join("|")})`;
4675 return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
4676 }
4677 __name(datetime$1, "datetime");
4678 var string$2 = /* @__PURE__ */ __name((params) => {
4679 const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
4680 return new RegExp(`^${regex}$`);
4681 }, "string");
4682 var bigint$2 = /^\d+n?$/;
4683 var integer = /^\d+$/;
4684 var number$2 = /^-?\d+(?:\.\d+)?/i;
4685 var boolean$2 = /true|false/i;
4686 var _null$2 = /null/i;
4687 var _undefined$2 = /undefined/i;
4688 var lowercase = /^[^A-Z]*$/;
4689 var uppercase = /^[^a-z]*$/;
4690
4691 //#endregion
4692 //#region node_modules/zod/v4/core/checks.js
4693 var $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
4694 var _a;
4695 inst._zod ?? (inst._zod = {});
4696 inst._zod.def = def;
4697 (_a = inst._zod).onattach ?? (_a.onattach = []);
4698 });
4699 var numericOriginMap = {
4700 number: "number",
4701 bigint: "bigint",
4702 object: "date"
4703 };
4704 var $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
4705 $ZodCheck.init(inst, def);
4706 const origin = numericOriginMap[typeof def.value];
4707 inst._zod.onattach.push((inst) => {
4708 const bag = inst._zod.bag;
4709 const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
4710 if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
4711 else bag.exclusiveMaximum = def.value;
4712 });
4713 inst._zod.check = (payload) => {
4714 if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
4715 payload.issues.push({
4716 origin,
4717 code: "too_big",
4718 maximum: def.value,
4719 input: payload.value,
4720 inclusive: def.inclusive,
4721 inst,
4722 continue: !def.abort
4723 });
4724 };
4725 });
4726 var $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
4727 $ZodCheck.init(inst, def);
4728 const origin = numericOriginMap[typeof def.value];
4729 inst._zod.onattach.push((inst) => {
4730 const bag = inst._zod.bag;
4731 const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
4732 if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
4733 else bag.exclusiveMinimum = def.value;
4734 });
4735 inst._zod.check = (payload) => {
4736 if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
4737 payload.issues.push({
4738 origin,
4739 code: "too_small",
4740 minimum: def.value,
4741 input: payload.value,
4742 inclusive: def.inclusive,
4743 inst,
4744 continue: !def.abort
4745 });
4746 };
4747 });
4748 var $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
4749 $ZodCheck.init(inst, def);
4750 inst._zod.onattach.push((inst) => {
4751 var _a;
4752 (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
4753 });
4754 inst._zod.check = (payload) => {
4755 if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
4756 if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
4757 payload.issues.push({
4758 origin: typeof payload.value,
4759 code: "not_multiple_of",
4760 divisor: def.value,
4761 input: payload.value,
4762 inst,
4763 continue: !def.abort
4764 });
4765 };
4766 });
4767 var $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => {
4768 $ZodCheck.init(inst, def);
4769 def.format = def.format || "float64";
4770 const isInt = def.format?.includes("int");
4771 const origin = isInt ? "int" : "number";
4772 const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
4773 inst._zod.onattach.push((inst) => {
4774 const bag = inst._zod.bag;
4775 bag.format = def.format;
4776 bag.minimum = minimum;
4777 bag.maximum = maximum;
4778 if (isInt) bag.pattern = integer;
4779 });
4780 inst._zod.check = (payload) => {
4781 const input = payload.value;
4782 if (isInt) {
4783 if (!Number.isInteger(input)) {
4784 payload.issues.push({
4785 expected: origin,
4786 format: def.format,
4787 code: "invalid_type",
4788 input,
4789 inst
4790 });
4791 return;
4792 }
4793 if (!Number.isSafeInteger(input)) {
4794 if (input > 0) payload.issues.push({
4795 input,
4796 code: "too_big",
4797 maximum: Number.MAX_SAFE_INTEGER,
4798 note: "Integers must be within the safe integer range.",
4799 inst,
4800 origin,
4801 continue: !def.abort
4802 });
4803 else payload.issues.push({
4804 input,
4805 code: "too_small",
4806 minimum: Number.MIN_SAFE_INTEGER,
4807 note: "Integers must be within the safe integer range.",
4808 inst,
4809 origin,
4810 continue: !def.abort
4811 });
4812 return;
4813 }
4814 }
4815 if (input < minimum) payload.issues.push({
4816 origin: "number",
4817 input,
4818 code: "too_small",
4819 minimum,
4820 inclusive: true,
4821 inst,
4822 continue: !def.abort
4823 });
4824 if (input > maximum) payload.issues.push({
4825 origin: "number",
4826 input,
4827 code: "too_big",
4828 maximum,
4829 inst
4830 });
4831 };
4832 });
4833 var $ZodCheckBigIntFormat = /*@__PURE__*/ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
4834 $ZodCheck.init(inst, def);
4835 const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
4836 inst._zod.onattach.push((inst) => {
4837 const bag = inst._zod.bag;
4838 bag.format = def.format;
4839 bag.minimum = minimum;
4840 bag.maximum = maximum;
4841 });
4842 inst._zod.check = (payload) => {
4843 const input = payload.value;
4844 if (input < minimum) payload.issues.push({
4845 origin: "bigint",
4846 input,
4847 code: "too_small",
4848 minimum,
4849 inclusive: true,
4850 inst,
4851 continue: !def.abort
4852 });
4853 if (input > maximum) payload.issues.push({
4854 origin: "bigint",
4855 input,
4856 code: "too_big",
4857 maximum,
4858 inst
4859 });
4860 };
4861 });
4862 var $ZodCheckMaxSize = /*@__PURE__*/ $constructor("$ZodCheckMaxSize", (inst, def) => {
4863 var _a;
4864 $ZodCheck.init(inst, def);
4865 (_a = inst._zod.def).when ?? (_a.when = (payload) => {
4866 const val = payload.value;
4867 return !nullish$1(val) && val.size !== void 0;
4868 });
4869 inst._zod.onattach.push((inst) => {
4870 const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
4871 if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
4872 });
4873 inst._zod.check = (payload) => {
4874 const input = payload.value;
4875 if (input.size <= def.maximum) return;
4876 payload.issues.push({
4877 origin: getSizableOrigin(input),
4878 code: "too_big",
4879 maximum: def.maximum,
4880 input,
4881 inst,
4882 continue: !def.abort
4883 });
4884 };
4885 });
4886 var $ZodCheckMinSize = /*@__PURE__*/ $constructor("$ZodCheckMinSize", (inst, def) => {
4887 var _a;
4888 $ZodCheck.init(inst, def);
4889 (_a = inst._zod.def).when ?? (_a.when = (payload) => {
4890 const val = payload.value;
4891 return !nullish$1(val) && val.size !== void 0;
4892 });
4893 inst._zod.onattach.push((inst) => {
4894 const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
4895 if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
4896 });
4897 inst._zod.check = (payload) => {
4898 const input = payload.value;
4899 if (input.size >= def.minimum) return;
4900 payload.issues.push({
4901 origin: getSizableOrigin(input),
4902 code: "too_small",
4903 minimum: def.minimum,
4904 input,
4905 inst,
4906 continue: !def.abort
4907 });
4908 };
4909 });
4910 var $ZodCheckSizeEquals = /*@__PURE__*/ $constructor("$ZodCheckSizeEquals", (inst, def) => {
4911 var _a;
4912 $ZodCheck.init(inst, def);
4913 (_a = inst._zod.def).when ?? (_a.when = (payload) => {
4914 const val = payload.value;
4915 return !nullish$1(val) && val.size !== void 0;
4916 });
4917 inst._zod.onattach.push((inst) => {
4918 const bag = inst._zod.bag;
4919 bag.minimum = def.size;
4920 bag.maximum = def.size;
4921 bag.size = def.size;
4922 });
4923 inst._zod.check = (payload) => {
4924 const input = payload.value;
4925 const size = input.size;
4926 if (size === def.size) return;
4927 const tooBig = size > def.size;
4928 payload.issues.push({
4929 origin: getSizableOrigin(input),
4930 ...tooBig ? {
4931 code: "too_big",
4932 maximum: def.size
4933 } : {
4934 code: "too_small",
4935 minimum: def.size
4936 },
4937 inclusive: true,
4938 exact: true,
4939 input: payload.value,
4940 inst,
4941 continue: !def.abort
4942 });
4943 };
4944 });
4945 var $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
4946 var _a;
4947 $ZodCheck.init(inst, def);
4948 (_a = inst._zod.def).when ?? (_a.when = (payload) => {
4949 const val = payload.value;
4950 return !nullish$1(val) && val.length !== void 0;
4951 });
4952 inst._zod.onattach.push((inst) => {
4953 const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
4954 if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
4955 });
4956 inst._zod.check = (payload) => {
4957 const input = payload.value;
4958 if (input.length <= def.maximum) return;
4959 const origin = getLengthableOrigin(input);
4960 payload.issues.push({
4961 origin,
4962 code: "too_big",
4963 maximum: def.maximum,
4964 inclusive: true,
4965 input,
4966 inst,
4967 continue: !def.abort
4968 });
4969 };
4970 });
4971 var $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
4972 var _a;
4973 $ZodCheck.init(inst, def);
4974 (_a = inst._zod.def).when ?? (_a.when = (payload) => {
4975 const val = payload.value;
4976 return !nullish$1(val) && val.length !== void 0;
4977 });
4978 inst._zod.onattach.push((inst) => {
4979 const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
4980 if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
4981 });
4982 inst._zod.check = (payload) => {
4983 const input = payload.value;
4984 if (input.length >= def.minimum) return;
4985 const origin = getLengthableOrigin(input);
4986 payload.issues.push({
4987 origin,
4988 code: "too_small",
4989 minimum: def.minimum,
4990 inclusive: true,
4991 input,
4992 inst,
4993 continue: !def.abort
4994 });
4995 };
4996 });
4997 var $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
4998 var _a;
4999 $ZodCheck.init(inst, def);
5000 (_a = inst._zod.def).when ?? (_a.when = (payload) => {
5001 const val = payload.value;
5002 return !nullish$1(val) && val.length !== void 0;
5003 });
5004 inst._zod.onattach.push((inst) => {
5005 const bag = inst._zod.bag;
5006 bag.minimum = def.length;
5007 bag.maximum = def.length;
5008 bag.length = def.length;
5009 });
5010 inst._zod.check = (payload) => {
5011 const input = payload.value;
5012 const length = input.length;
5013 if (length === def.length) return;
5014 const origin = getLengthableOrigin(input);
5015 const tooBig = length > def.length;
5016 payload.issues.push({
5017 origin,
5018 ...tooBig ? {
5019 code: "too_big",
5020 maximum: def.length
5021 } : {
5022 code: "too_small",
5023 minimum: def.length
5024 },
5025 inclusive: true,
5026 exact: true,
5027 input: payload.value,
5028 inst,
5029 continue: !def.abort
5030 });
5031 };
5032 });
5033 var $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
5034 var _a;
5035 var _b;
5036 $ZodCheck.init(inst, def);
5037 inst._zod.onattach.push((inst) => {
5038 const bag = inst._zod.bag;
5039 bag.format = def.format;
5040 if (def.pattern) {
5041 bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
5042 bag.patterns.add(def.pattern);
5043 }
5044 });
5045 if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
5046 def.pattern.lastIndex = 0;
5047 if (def.pattern.test(payload.value)) return;
5048 payload.issues.push({
5049 origin: "string",
5050 code: "invalid_format",
5051 format: def.format,
5052 input: payload.value,
5053 ...def.pattern ? { pattern: def.pattern.toString() } : {},
5054 inst,
5055 continue: !def.abort
5056 });
5057 });
5058 else (_b = inst._zod).check ?? (_b.check = () => {});
5059 });
5060 var $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => {
5061 $ZodCheckStringFormat.init(inst, def);
5062 inst._zod.check = (payload) => {
5063 def.pattern.lastIndex = 0;
5064 if (def.pattern.test(payload.value)) return;
5065 payload.issues.push({
5066 origin: "string",
5067 code: "invalid_format",
5068 format: "regex",
5069 input: payload.value,
5070 pattern: def.pattern.toString(),
5071 inst,
5072 continue: !def.abort
5073 });
5074 };
5075 });
5076 var $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => {
5077 def.pattern ?? (def.pattern = lowercase);
5078 $ZodCheckStringFormat.init(inst, def);
5079 });
5080 var $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => {
5081 def.pattern ?? (def.pattern = uppercase);
5082 $ZodCheckStringFormat.init(inst, def);
5083 });
5084 var $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
5085 $ZodCheck.init(inst, def);
5086 const escapedRegex = escapeRegex(def.includes);
5087 const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
5088 def.pattern = pattern;
5089 inst._zod.onattach.push((inst) => {
5090 const bag = inst._zod.bag;
5091 bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
5092 bag.patterns.add(pattern);
5093 });
5094 inst._zod.check = (payload) => {
5095 if (payload.value.includes(def.includes, def.position)) return;
5096 payload.issues.push({
5097 origin: "string",
5098 code: "invalid_format",
5099 format: "includes",
5100 includes: def.includes,
5101 input: payload.value,
5102 inst,
5103 continue: !def.abort
5104 });
5105 };
5106 });
5107 var $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => {
5108 $ZodCheck.init(inst, def);
5109 const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
5110 def.pattern ?? (def.pattern = pattern);
5111 inst._zod.onattach.push((inst) => {
5112 const bag = inst._zod.bag;
5113 bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
5114 bag.patterns.add(pattern);
5115 });
5116 inst._zod.check = (payload) => {
5117 if (payload.value.startsWith(def.prefix)) return;
5118 payload.issues.push({
5119 origin: "string",
5120 code: "invalid_format",
5121 format: "starts_with",
5122 prefix: def.prefix,
5123 input: payload.value,
5124 inst,
5125 continue: !def.abort
5126 });
5127 };
5128 });
5129 var $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => {
5130 $ZodCheck.init(inst, def);
5131 const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
5132 def.pattern ?? (def.pattern = pattern);
5133 inst._zod.onattach.push((inst) => {
5134 const bag = inst._zod.bag;
5135 bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
5136 bag.patterns.add(pattern);
5137 });
5138 inst._zod.check = (payload) => {
5139 if (payload.value.endsWith(def.suffix)) return;
5140 payload.issues.push({
5141 origin: "string",
5142 code: "invalid_format",
5143 format: "ends_with",
5144 suffix: def.suffix,
5145 input: payload.value,
5146 inst,
5147 continue: !def.abort
5148 });
5149 };
5150 });
5151 function handleCheckPropertyResult(result, payload, property) {
5152 if (result.issues.length) payload.issues.push(...prefixIssues(property, result.issues));
5153 }
5154 var $ZodCheckProperty = /*@__PURE__*/ $constructor("$ZodCheckProperty", (inst, def) => {
5155 $ZodCheck.init(inst, def);
5156 inst._zod.check = (payload) => {
5157 const result = def.schema._zod.run({
5158 value: payload.value[def.property],
5159 issues: []
5160 }, {});
5161 if (result instanceof Promise) return result.then((result) => handleCheckPropertyResult(result, payload, def.property));
5162 handleCheckPropertyResult(result, payload, def.property);
5163 };
5164 });
5165 var $ZodCheckMimeType = /*@__PURE__*/ $constructor("$ZodCheckMimeType", (inst, def) => {
5166 $ZodCheck.init(inst, def);
5167 const mimeSet = new Set(def.mime);
5168 inst._zod.onattach.push((inst) => {
5169 inst._zod.bag.mime = def.mime;
5170 });
5171 inst._zod.check = (payload) => {
5172 if (mimeSet.has(payload.value.type)) return;
5173 payload.issues.push({
5174 code: "invalid_value",
5175 values: def.mime,
5176 input: payload.value.type,
5177 inst
5178 });
5179 };
5180 });
5181 var $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => {
5182 $ZodCheck.init(inst, def);
5183 inst._zod.check = (payload) => {
5184 payload.value = def.tx(payload.value);
5185 };
5186 });
5187
5188 //#endregion
5189 //#region node_modules/zod/v4/core/doc.js
5190 var Doc = class {
5191 constructor(args = []) {
5192 this.content = [];
5193 this.indent = 0;
5194 if (this) this.args = args;
5195 }
5196 indented(fn) {
5197 this.indent += 1;
5198 fn(this);
5199 this.indent -= 1;
5200 }
5201 write(arg) {
5202 if (typeof arg === "function") {
5203 arg(this, { execution: "sync" });
5204 arg(this, { execution: "async" });
5205 return;
5206 }
5207 const lines = arg.split("\n").filter((x) => x);
5208 const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
5209 const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
5210 for (const line of dedented) this.content.push(line);
5211 }
5212 compile() {
5213 const F = Function;
5214 const args = this?.args;
5215 const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)];
5216 return new F(...args, lines.join("\n"));
5217 }
5218 };
5219
5220 //#endregion
5221 //#region node_modules/zod/v4/core/versions.js
5222 var version = {
5223 major: 4,
5224 minor: 0,
5225 patch: 0
5226 };
5227
5228 //#endregion
5229 //#region node_modules/zod/v4/core/schemas.js
5230 var $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
5231 var _a;
5232 inst ?? (inst = {});
5233 inst._zod.def = def;
5234 inst._zod.bag = inst._zod.bag || {};
5235 inst._zod.version = version;
5236 const checks = [...inst._zod.def.checks ?? []];
5237 if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
5238 for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
5239 if (checks.length === 0) {
5240 (_a = inst._zod).deferred ?? (_a.deferred = []);
5241 inst._zod.deferred?.push(() => {
5242 inst._zod.run = inst._zod.parse;
5243 });
5244 } else {
5245 const runChecks = (payload, checks, ctx) => {
5246 let isAborted = aborted(payload);
5247 let asyncResult;
5248 for (const ch of checks) {
5249 if (ch._zod.def.when) {
5250 if (!ch._zod.def.when(payload)) continue;
5251 } else if (isAborted) continue;
5252 const currLen = payload.issues.length;
5253 const _ = ch._zod.check(payload);
5254 if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
5255 if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
5256 await _;
5257 if (payload.issues.length === currLen) return;
5258 if (!isAborted) isAborted = aborted(payload, currLen);
5259 });
5260 else {
5261 if (payload.issues.length === currLen) continue;
5262 if (!isAborted) isAborted = aborted(payload, currLen);
5263 }
5264 }
5265 if (asyncResult) return asyncResult.then(() => {
5266 return payload;
5267 });
5268 return payload;
5269 };
5270 inst._zod.run = (payload, ctx) => {
5271 const result = inst._zod.parse(payload, ctx);
5272 if (result instanceof Promise) {
5273 if (ctx.async === false) throw new $ZodAsyncError();
5274 return result.then((result) => runChecks(result, checks, ctx));
5275 }
5276 return runChecks(result, checks, ctx);
5277 };
5278 }
5279 inst["~standard"] = {
5280 validate: (value) => {
5281 try {
5282 const r = safeParse$1(inst, value);
5283 return r.success ? { value: r.data } : { issues: r.error?.issues };
5284 } catch (_) {
5285 return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
5286 }
5287 },
5288 vendor: "zod",
5289 version: 1
5290 };
5291 });
5292 var $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
5293 $ZodType.init(inst, def);
5294 inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$2(inst._zod.bag);
5295 inst._zod.parse = (payload, _) => {
5296 if (def.coerce) try {
5297 payload.value = String(payload.value);
5298 } catch (_) {}
5299 if (typeof payload.value === "string") return payload;
5300 payload.issues.push({
5301 expected: "string",
5302 code: "invalid_type",
5303 input: payload.value,
5304 inst
5305 });
5306 return payload;
5307 };
5308 });
5309 var $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => {
5310 $ZodCheckStringFormat.init(inst, def);
5311 $ZodString.init(inst, def);
5312 });
5313 var $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => {
5314 def.pattern ?? (def.pattern = guid$1);
5315 $ZodStringFormat.init(inst, def);
5316 });
5317 var $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
5318 if (def.version) {
5319 const v = {
5320 v1: 1,
5321 v2: 2,
5322 v3: 3,
5323 v4: 4,
5324 v5: 5,
5325 v6: 6,
5326 v7: 7,
5327 v8: 8
5328 }[def.version];
5329 if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
5330 def.pattern ?? (def.pattern = uuid$1(v));
5331 } else def.pattern ?? (def.pattern = uuid$1());
5332 $ZodStringFormat.init(inst, def);
5333 });
5334 var $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
5335 def.pattern ?? (def.pattern = email$1);
5336 $ZodStringFormat.init(inst, def);
5337 });
5338 var $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
5339 $ZodStringFormat.init(inst, def);
5340 inst._zod.check = (payload) => {
5341 try {
5342 const orig = payload.value;
5343 const url = new URL(orig);
5344 const href = url.href;
5345 if (def.hostname) {
5346 def.hostname.lastIndex = 0;
5347 if (!def.hostname.test(url.hostname)) payload.issues.push({
5348 code: "invalid_format",
5349 format: "url",
5350 note: "Invalid hostname",
5351 pattern: hostname.source,
5352 input: payload.value,
5353 inst,
5354 continue: !def.abort
5355 });
5356 }
5357 if (def.protocol) {
5358 def.protocol.lastIndex = 0;
5359 if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
5360 code: "invalid_format",
5361 format: "url",
5362 note: "Invalid protocol",
5363 pattern: def.protocol.source,
5364 input: payload.value,
5365 inst,
5366 continue: !def.abort
5367 });
5368 }
5369 if (!orig.endsWith("/") && href.endsWith("/")) payload.value = href.slice(0, -1);
5370 else payload.value = href;
5371 return;
5372 } catch (_) {
5373 payload.issues.push({
5374 code: "invalid_format",
5375 format: "url",
5376 input: payload.value,
5377 inst,
5378 continue: !def.abort
5379 });
5380 }
5381 };
5382 });
5383 var $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
5384 def.pattern ?? (def.pattern = emoji$1());
5385 $ZodStringFormat.init(inst, def);
5386 });
5387 var $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
5388 def.pattern ?? (def.pattern = nanoid$1);
5389 $ZodStringFormat.init(inst, def);
5390 });
5391 var $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
5392 def.pattern ?? (def.pattern = cuid$1);
5393 $ZodStringFormat.init(inst, def);
5394 });
5395 var $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => {
5396 def.pattern ?? (def.pattern = cuid2$1);
5397 $ZodStringFormat.init(inst, def);
5398 });
5399 var $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => {
5400 def.pattern ?? (def.pattern = ulid$1);
5401 $ZodStringFormat.init(inst, def);
5402 });
5403 var $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => {
5404 def.pattern ?? (def.pattern = xid$1);
5405 $ZodStringFormat.init(inst, def);
5406 });
5407 var $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
5408 def.pattern ?? (def.pattern = ksuid$1);
5409 $ZodStringFormat.init(inst, def);
5410 });
5411 var $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
5412 def.pattern ?? (def.pattern = datetime$1(def));
5413 $ZodStringFormat.init(inst, def);
5414 });
5415 var $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
5416 def.pattern ?? (def.pattern = date$3);
5417 $ZodStringFormat.init(inst, def);
5418 });
5419 var $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
5420 def.pattern ?? (def.pattern = time$1(def));
5421 $ZodStringFormat.init(inst, def);
5422 });
5423 var $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
5424 def.pattern ?? (def.pattern = duration$1);
5425 $ZodStringFormat.init(inst, def);
5426 });
5427 var $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
5428 def.pattern ?? (def.pattern = ipv4$1);
5429 $ZodStringFormat.init(inst, def);
5430 inst._zod.onattach.push((inst) => {
5431 const bag = inst._zod.bag;
5432 bag.format = `ipv4`;
5433 });
5434 });
5435 var $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
5436 def.pattern ?? (def.pattern = ipv6$1);
5437 $ZodStringFormat.init(inst, def);
5438 inst._zod.onattach.push((inst) => {
5439 const bag = inst._zod.bag;
5440 bag.format = `ipv6`;
5441 });
5442 inst._zod.check = (payload) => {
5443 try {
5444 new URL(`http://[${payload.value}]`);
5445 } catch {
5446 payload.issues.push({
5447 code: "invalid_format",
5448 format: "ipv6",
5449 input: payload.value,
5450 inst,
5451 continue: !def.abort
5452 });
5453 }
5454 };
5455 });
5456 var $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
5457 def.pattern ?? (def.pattern = cidrv4$1);
5458 $ZodStringFormat.init(inst, def);
5459 });
5460 var $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
5461 def.pattern ?? (def.pattern = cidrv6$1);
5462 $ZodStringFormat.init(inst, def);
5463 inst._zod.check = (payload) => {
5464 const [address, prefix] = payload.value.split("/");
5465 try {
5466 if (!prefix) throw new Error();
5467 const prefixNum = Number(prefix);
5468 if (`${prefixNum}` !== prefix) throw new Error();
5469 if (prefixNum < 0 || prefixNum > 128) throw new Error();
5470 new URL(`http://[${address}]`);
5471 } catch {
5472 payload.issues.push({
5473 code: "invalid_format",
5474 format: "cidrv6",
5475 input: payload.value,
5476 inst,
5477 continue: !def.abort
5478 });
5479 }
5480 };
5481 });
5482 function isValidBase64(data) {
5483 if (data === "") return true;
5484 if (data.length % 4 !== 0) return false;
5485 try {
5486 atob(data);
5487 return true;
5488 } catch {
5489 return false;
5490 }
5491 }
5492 var $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
5493 def.pattern ?? (def.pattern = base64$1);
5494 $ZodStringFormat.init(inst, def);
5495 inst._zod.onattach.push((inst) => {
5496 inst._zod.bag.contentEncoding = "base64";
5497 });
5498 inst._zod.check = (payload) => {
5499 if (isValidBase64(payload.value)) return;
5500 payload.issues.push({
5501 code: "invalid_format",
5502 format: "base64",
5503 input: payload.value,
5504 inst,
5505 continue: !def.abort
5506 });
5507 };
5508 });
5509 function isValidBase64URL(data) {
5510 if (!base64url$1.test(data)) return false;
5511 const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
5512 return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
5513 }
5514 var $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
5515 def.pattern ?? (def.pattern = base64url$1);
5516 $ZodStringFormat.init(inst, def);
5517 inst._zod.onattach.push((inst) => {
5518 inst._zod.bag.contentEncoding = "base64url";
5519 });
5520 inst._zod.check = (payload) => {
5521 if (isValidBase64URL(payload.value)) return;
5522 payload.issues.push({
5523 code: "invalid_format",
5524 format: "base64url",
5525 input: payload.value,
5526 inst,
5527 continue: !def.abort
5528 });
5529 };
5530 });
5531 var $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => {
5532 def.pattern ?? (def.pattern = e164$1);
5533 $ZodStringFormat.init(inst, def);
5534 });
5535 function isValidJWT(token, algorithm = null) {
5536 try {
5537 const tokensParts = token.split(".");
5538 if (tokensParts.length !== 3) return false;
5539 const [header] = tokensParts;
5540 if (!header) return false;
5541 const parsedHeader = JSON.parse(atob(header));
5542 if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
5543 if (!parsedHeader.alg) return false;
5544 if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false;
5545 return true;
5546 } catch {
5547 return false;
5548 }
5549 }
5550 var $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
5551 $ZodStringFormat.init(inst, def);
5552 inst._zod.check = (payload) => {
5553 if (isValidJWT(payload.value, def.alg)) return;
5554 payload.issues.push({
5555 code: "invalid_format",
5556 format: "jwt",
5557 input: payload.value,
5558 inst,
5559 continue: !def.abort
5560 });
5561 };
5562 });
5563 var $ZodCustomStringFormat = /*@__PURE__*/ $constructor("$ZodCustomStringFormat", (inst, def) => {
5564 $ZodStringFormat.init(inst, def);
5565 inst._zod.check = (payload) => {
5566 if (def.fn(payload.value)) return;
5567 payload.issues.push({
5568 code: "invalid_format",
5569 format: def.format,
5570 input: payload.value,
5571 inst,
5572 continue: !def.abort
5573 });
5574 };
5575 });
5576 var $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
5577 $ZodType.init(inst, def);
5578 inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
5579 inst._zod.parse = (payload, _ctx) => {
5580 if (def.coerce) try {
5581 payload.value = Number(payload.value);
5582 } catch (_) {}
5583 const input = payload.value;
5584 if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
5585 const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
5586 payload.issues.push({
5587 expected: "number",
5588 code: "invalid_type",
5589 input,
5590 inst,
5591 ...received ? { received } : {}
5592 });
5593 return payload;
5594 };
5595 });
5596 var $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
5597 $ZodCheckNumberFormat.init(inst, def);
5598 $ZodNumber.init(inst, def);
5599 });
5600 var $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
5601 $ZodType.init(inst, def);
5602 inst._zod.pattern = boolean$2;
5603 inst._zod.parse = (payload, _ctx) => {
5604 if (def.coerce) try {
5605 payload.value = Boolean(payload.value);
5606 } catch (_) {}
5607 const input = payload.value;
5608 if (typeof input === "boolean") return payload;
5609 payload.issues.push({
5610 expected: "boolean",
5611 code: "invalid_type",
5612 input,
5613 inst
5614 });
5615 return payload;
5616 };
5617 });
5618 var $ZodBigInt = /*@__PURE__*/ $constructor("$ZodBigInt", (inst, def) => {
5619 $ZodType.init(inst, def);
5620 inst._zod.pattern = bigint$2;
5621 inst._zod.parse = (payload, _ctx) => {
5622 if (def.coerce) try {
5623 payload.value = BigInt(payload.value);
5624 } catch (_) {}
5625 if (typeof payload.value === "bigint") return payload;
5626 payload.issues.push({
5627 expected: "bigint",
5628 code: "invalid_type",
5629 input: payload.value,
5630 inst
5631 });
5632 return payload;
5633 };
5634 });
5635 var $ZodBigIntFormat = /*@__PURE__*/ $constructor("$ZodBigInt", (inst, def) => {
5636 $ZodCheckBigIntFormat.init(inst, def);
5637 $ZodBigInt.init(inst, def);
5638 });
5639 var $ZodSymbol = /*@__PURE__*/ $constructor("$ZodSymbol", (inst, def) => {
5640 $ZodType.init(inst, def);
5641 inst._zod.parse = (payload, _ctx) => {
5642 const input = payload.value;
5643 if (typeof input === "symbol") return payload;
5644 payload.issues.push({
5645 expected: "symbol",
5646 code: "invalid_type",
5647 input,
5648 inst
5649 });
5650 return payload;
5651 };
5652 });
5653 var $ZodUndefined = /*@__PURE__*/ $constructor("$ZodUndefined", (inst, def) => {
5654 $ZodType.init(inst, def);
5655 inst._zod.pattern = _undefined$2;
5656 inst._zod.values = /* @__PURE__ */ new Set([void 0]);
5657 inst._zod.optin = "optional";
5658 inst._zod.optout = "optional";
5659 inst._zod.parse = (payload, _ctx) => {
5660 const input = payload.value;
5661 if (typeof input === "undefined") return payload;
5662 payload.issues.push({
5663 expected: "undefined",
5664 code: "invalid_type",
5665 input,
5666 inst
5667 });
5668 return payload;
5669 };
5670 });
5671 var $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => {
5672 $ZodType.init(inst, def);
5673 inst._zod.pattern = _null$2;
5674 inst._zod.values = /* @__PURE__ */ new Set([null]);
5675 inst._zod.parse = (payload, _ctx) => {
5676 const input = payload.value;
5677 if (input === null) return payload;
5678 payload.issues.push({
5679 expected: "null",
5680 code: "invalid_type",
5681 input,
5682 inst
5683 });
5684 return payload;
5685 };
5686 });
5687 var $ZodAny = /*@__PURE__*/ $constructor("$ZodAny", (inst, def) => {
5688 $ZodType.init(inst, def);
5689 inst._zod.parse = (payload) => payload;
5690 });
5691 var $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
5692 $ZodType.init(inst, def);
5693 inst._zod.parse = (payload) => payload;
5694 });
5695 var $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
5696 $ZodType.init(inst, def);
5697 inst._zod.parse = (payload, _ctx) => {
5698 payload.issues.push({
5699 expected: "never",
5700 code: "invalid_type",
5701 input: payload.value,
5702 inst
5703 });
5704 return payload;
5705 };
5706 });
5707 var $ZodVoid = /*@__PURE__*/ $constructor("$ZodVoid", (inst, def) => {
5708 $ZodType.init(inst, def);
5709 inst._zod.parse = (payload, _ctx) => {
5710 const input = payload.value;
5711 if (typeof input === "undefined") return payload;
5712 payload.issues.push({
5713 expected: "void",
5714 code: "invalid_type",
5715 input,
5716 inst
5717 });
5718 return payload;
5719 };
5720 });
5721 var $ZodDate = /*@__PURE__*/ $constructor("$ZodDate", (inst, def) => {
5722 $ZodType.init(inst, def);
5723 inst._zod.parse = (payload, _ctx) => {
5724 if (def.coerce) try {
5725 payload.value = new Date(payload.value);
5726 } catch (_err) {}
5727 const input = payload.value;
5728 const isDate = input instanceof Date;
5729 if (isDate && !Number.isNaN(input.getTime())) return payload;
5730 payload.issues.push({
5731 expected: "date",
5732 code: "invalid_type",
5733 input,
5734 ...isDate ? { received: "Invalid Date" } : {},
5735 inst
5736 });
5737 return payload;
5738 };
5739 });
5740 function handleArrayResult(result, final, index) {
5741 if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
5742 final.value[index] = result.value;
5743 }
5744 var $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
5745 $ZodType.init(inst, def);
5746 inst._zod.parse = (payload, ctx) => {
5747 const input = payload.value;
5748 if (!Array.isArray(input)) {
5749 payload.issues.push({
5750 expected: "array",
5751 code: "invalid_type",
5752 input,
5753 inst
5754 });
5755 return payload;
5756 }
5757 payload.value = Array(input.length);
5758 const proms = [];
5759 for (let i = 0; i < input.length; i++) {
5760 const item = input[i];
5761 const result = def.element._zod.run({
5762 value: item,
5763 issues: []
5764 }, ctx);
5765 if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
5766 else handleArrayResult(result, payload, i);
5767 }
5768 if (proms.length) return Promise.all(proms).then(() => payload);
5769 return payload;
5770 };
5771 });
5772 function handleObjectResult(result, final, key) {
5773 if (result.issues.length) final.issues.push(...prefixIssues(key, result.issues));
5774 final.value[key] = result.value;
5775 }
5776 function handleOptionalObjectResult(result, final, key, input) {
5777 if (result.issues.length) if (input[key] === void 0) if (key in input) final.value[key] = void 0;
5778 else final.value[key] = result.value;
5779 else final.issues.push(...prefixIssues(key, result.issues));
5780 else if (result.value === void 0) {
5781 if (key in input) final.value[key] = void 0;
5782 } else final.value[key] = result.value;
5783 }
5784 var $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
5785 $ZodType.init(inst, def);
5786 const _normalized = cached(() => {
5787 const keys = Object.keys(def.shape);
5788 for (const k of keys) if (!(def.shape[k] instanceof $ZodType)) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
5789 const okeys = optionalKeys(def.shape);
5790 return {
5791 shape: def.shape,
5792 keys,
5793 keySet: new Set(keys),
5794 numKeys: keys.length,
5795 optionalKeys: new Set(okeys)
5796 };
5797 });
5798 defineLazy(inst._zod, "propValues", () => {
5799 const shape = def.shape;
5800 const propValues = {};
5801 for (const key in shape) {
5802 const field = shape[key]._zod;
5803 if (field.values) {
5804 propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
5805 for (const v of field.values) propValues[key].add(v);
5806 }
5807 }
5808 return propValues;
5809 });
5810 const generateFastpass = (shape) => {
5811 const doc = new Doc([
5812 "shape",
5813 "payload",
5814 "ctx"
5815 ]);
5816 const normalized = _normalized.value;
5817 const parseStr = (key) => {
5818 const k = esc(key);
5819 return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
5820 };
5821 doc.write(`const input = payload.value;`);
5822 const ids = Object.create(null);
5823 let counter = 0;
5824 for (const key of normalized.keys) ids[key] = `key_${counter++}`;
5825 doc.write(`const newResult = {}`);
5826 for (const key of normalized.keys) if (normalized.optionalKeys.has(key)) {
5827 const id = ids[key];
5828 doc.write(`const ${id} = ${parseStr(key)};`);
5829 const k = esc(key);
5830 doc.write(`
5831 if (${id}.issues.length) {
5832 if (input[${k}] === undefined) {
5833 if (${k} in input) {
5834 newResult[${k}] = undefined;
5835 }
5836 } else {
5837 payload.issues = payload.issues.concat(
5838 ${id}.issues.map((iss) => ({
5839 ...iss,
5840 path: iss.path ? [${k}, ...iss.path] : [${k}],
5841 }))
5842 );
5843 }
5844 } else if (${id}.value === undefined) {
5845 if (${k} in input) newResult[${k}] = undefined;
5846 } else {
5847 newResult[${k}] = ${id}.value;
5848 }
5849 `);
5850 } else {
5851 const id = ids[key];
5852 doc.write(`const ${id} = ${parseStr(key)};`);
5853 doc.write(`
5854 if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
5855 ...iss,
5856 path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
5857 })));`);
5858 doc.write(`newResult[${esc(key)}] = ${id}.value`);
5859 }
5860 doc.write(`payload.value = newResult;`);
5861 doc.write(`return payload;`);
5862 const fn = doc.compile();
5863 return (payload, ctx) => fn(shape, payload, ctx);
5864 };
5865 let fastpass;
5866 const isObject$1 = isObject;
5867 const jit = !globalConfig.jitless;
5868 const allowsEval$1 = allowsEval;
5869 const fastEnabled = jit && allowsEval$1.value;
5870 const catchall = def.catchall;
5871 let value;
5872 inst._zod.parse = (payload, ctx) => {
5873 value ?? (value = _normalized.value);
5874 const input = payload.value;
5875 if (!isObject$1(input)) {
5876 payload.issues.push({
5877 expected: "object",
5878 code: "invalid_type",
5879 input,
5880 inst
5881 });
5882 return payload;
5883 }
5884 const proms = [];
5885 if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
5886 if (!fastpass) fastpass = generateFastpass(def.shape);
5887 payload = fastpass(payload, ctx);
5888 } else {
5889 payload.value = {};
5890 const shape = value.shape;
5891 for (const key of value.keys) {
5892 const el = shape[key];
5893 const r = el._zod.run({
5894 value: input[key],
5895 issues: []
5896 }, ctx);
5897 const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
5898 if (r instanceof Promise) proms.push(r.then((r) => isOptional ? handleOptionalObjectResult(r, payload, key, input) : handleObjectResult(r, payload, key)));
5899 else if (isOptional) handleOptionalObjectResult(r, payload, key, input);
5900 else handleObjectResult(r, payload, key);
5901 }
5902 }
5903 if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
5904 const unrecognized = [];
5905 const keySet = value.keySet;
5906 const _catchall = catchall._zod;
5907 const t = _catchall.def.type;
5908 for (const key of Object.keys(input)) {
5909 if (keySet.has(key)) continue;
5910 if (t === "never") {
5911 unrecognized.push(key);
5912 continue;
5913 }
5914 const r = _catchall.run({
5915 value: input[key],
5916 issues: []
5917 }, ctx);
5918 if (r instanceof Promise) proms.push(r.then((r) => handleObjectResult(r, payload, key)));
5919 else handleObjectResult(r, payload, key);
5920 }
5921 if (unrecognized.length) payload.issues.push({
5922 code: "unrecognized_keys",
5923 keys: unrecognized,
5924 input,
5925 inst
5926 });
5927 if (!proms.length) return payload;
5928 return Promise.all(proms).then(() => {
5929 return payload;
5930 });
5931 };
5932 });
5933 function handleUnionResults(results, final, inst, ctx) {
5934 for (const result of results) if (result.issues.length === 0) {
5935 final.value = result.value;
5936 return final;
5937 }
5938 final.issues.push({
5939 code: "invalid_union",
5940 input: final.value,
5941 inst,
5942 errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
5943 });
5944 return final;
5945 }
5946 var $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
5947 $ZodType.init(inst, def);
5948 defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
5949 defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
5950 defineLazy(inst._zod, "values", () => {
5951 if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
5952 });
5953 defineLazy(inst._zod, "pattern", () => {
5954 if (def.options.every((o) => o._zod.pattern)) {
5955 const patterns = def.options.map((o) => o._zod.pattern);
5956 return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
5957 }
5958 });
5959 inst._zod.parse = (payload, ctx) => {
5960 let async = false;
5961 const results = [];
5962 for (const option of def.options) {
5963 const result = option._zod.run({
5964 value: payload.value,
5965 issues: []
5966 }, ctx);
5967 if (result instanceof Promise) {
5968 results.push(result);
5969 async = true;
5970 } else {
5971 if (result.issues.length === 0) return result;
5972 results.push(result);
5973 }
5974 }
5975 if (!async) return handleUnionResults(results, payload, inst, ctx);
5976 return Promise.all(results).then((results) => {
5977 return handleUnionResults(results, payload, inst, ctx);
5978 });
5979 };
5980 });
5981 var $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
5982 $ZodUnion.init(inst, def);
5983 const _super = inst._zod.parse;
5984 defineLazy(inst._zod, "propValues", () => {
5985 const propValues = {};
5986 for (const option of def.options) {
5987 const pv = option._zod.propValues;
5988 if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
5989 for (const [k, v] of Object.entries(pv)) {
5990 if (!propValues[k]) propValues[k] = /* @__PURE__ */ new Set();
5991 for (const val of v) propValues[k].add(val);
5992 }
5993 }
5994 return propValues;
5995 });
5996 const disc = cached(() => {
5997 const opts = def.options;
5998 const map = /* @__PURE__ */ new Map();
5999 for (const o of opts) {
6000 const values = o._zod.propValues[def.discriminator];
6001 if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
6002 for (const v of values) {
6003 if (map.has(v)) throw new Error(`Duplicate discriminator value "${String(v)}"`);
6004 map.set(v, o);
6005 }
6006 }
6007 return map;
6008 });
6009 inst._zod.parse = (payload, ctx) => {
6010 const input = payload.value;
6011 if (!isObject(input)) {
6012 payload.issues.push({
6013 code: "invalid_type",
6014 expected: "object",
6015 input,
6016 inst
6017 });
6018 return payload;
6019 }
6020 const opt = disc.value.get(input?.[def.discriminator]);
6021 if (opt) return opt._zod.run(payload, ctx);
6022 if (def.unionFallback) return _super(payload, ctx);
6023 payload.issues.push({
6024 code: "invalid_union",
6025 errors: [],
6026 note: "No matching discriminator",
6027 input,
6028 path: [def.discriminator],
6029 inst
6030 });
6031 return payload;
6032 };
6033 });
6034 var $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
6035 $ZodType.init(inst, def);
6036 inst._zod.parse = (payload, ctx) => {
6037 const input = payload.value;
6038 const left = def.left._zod.run({
6039 value: input,
6040 issues: []
6041 }, ctx);
6042 const right = def.right._zod.run({
6043 value: input,
6044 issues: []
6045 }, ctx);
6046 if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => {
6047 return handleIntersectionResults(payload, left, right);
6048 });
6049 return handleIntersectionResults(payload, left, right);
6050 };
6051 });
6052 function mergeValues(a, b) {
6053 if (a === b) return {
6054 valid: true,
6055 data: a
6056 };
6057 if (a instanceof Date && b instanceof Date && +a === +b) return {
6058 valid: true,
6059 data: a
6060 };
6061 if (isPlainObject(a) && isPlainObject(b)) {
6062 const bKeys = Object.keys(b);
6063 const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
6064 const newObj = {
6065 ...a,
6066 ...b
6067 };
6068 for (const key of sharedKeys) {
6069 const sharedValue = mergeValues(a[key], b[key]);
6070 if (!sharedValue.valid) return {
6071 valid: false,
6072 mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
6073 };
6074 newObj[key] = sharedValue.data;
6075 }
6076 return {
6077 valid: true,
6078 data: newObj
6079 };
6080 }
6081 if (Array.isArray(a) && Array.isArray(b)) {
6082 if (a.length !== b.length) return {
6083 valid: false,
6084 mergeErrorPath: []
6085 };
6086 const newArray = [];
6087 for (let index = 0; index < a.length; index++) {
6088 const itemA = a[index];
6089 const itemB = b[index];
6090 const sharedValue = mergeValues(itemA, itemB);
6091 if (!sharedValue.valid) return {
6092 valid: false,
6093 mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
6094 };
6095 newArray.push(sharedValue.data);
6096 }
6097 return {
6098 valid: true,
6099 data: newArray
6100 };
6101 }
6102 return {
6103 valid: false,
6104 mergeErrorPath: []
6105 };
6106 }
6107 function handleIntersectionResults(result, left, right) {
6108 if (left.issues.length) result.issues.push(...left.issues);
6109 if (right.issues.length) result.issues.push(...right.issues);
6110 if (aborted(result)) return result;
6111 const merged = mergeValues(left.value, right.value);
6112 if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
6113 result.value = merged.data;
6114 return result;
6115 }
6116 var $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
6117 $ZodType.init(inst, def);
6118 const items = def.items;
6119 const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
6120 inst._zod.parse = (payload, ctx) => {
6121 const input = payload.value;
6122 if (!Array.isArray(input)) {
6123 payload.issues.push({
6124 input,
6125 inst,
6126 expected: "tuple",
6127 code: "invalid_type"
6128 });
6129 return payload;
6130 }
6131 payload.value = [];
6132 const proms = [];
6133 if (!def.rest) {
6134 const tooBig = input.length > items.length;
6135 const tooSmall = input.length < optStart - 1;
6136 if (tooBig || tooSmall) {
6137 payload.issues.push({
6138 input,
6139 inst,
6140 origin: "array",
6141 ...tooBig ? {
6142 code: "too_big",
6143 maximum: items.length
6144 } : {
6145 code: "too_small",
6146 minimum: items.length
6147 }
6148 });
6149 return payload;
6150 }
6151 }
6152 let i = -1;
6153 for (const item of items) {
6154 i++;
6155 if (i >= input.length) {
6156 if (i >= optStart) continue;
6157 }
6158 const result = item._zod.run({
6159 value: input[i],
6160 issues: []
6161 }, ctx);
6162 if (result instanceof Promise) proms.push(result.then((result) => handleTupleResult(result, payload, i)));
6163 else handleTupleResult(result, payload, i);
6164 }
6165 if (def.rest) {
6166 const rest = input.slice(items.length);
6167 for (const el of rest) {
6168 i++;
6169 const result = def.rest._zod.run({
6170 value: el,
6171 issues: []
6172 }, ctx);
6173 if (result instanceof Promise) proms.push(result.then((result) => handleTupleResult(result, payload, i)));
6174 else handleTupleResult(result, payload, i);
6175 }
6176 }
6177 if (proms.length) return Promise.all(proms).then(() => payload);
6178 return payload;
6179 };
6180 });
6181 function handleTupleResult(result, final, index) {
6182 if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
6183 final.value[index] = result.value;
6184 }
6185 var $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
6186 $ZodType.init(inst, def);
6187 inst._zod.parse = (payload, ctx) => {
6188 const input = payload.value;
6189 if (!isPlainObject(input)) {
6190 payload.issues.push({
6191 expected: "record",
6192 code: "invalid_type",
6193 input,
6194 inst
6195 });
6196 return payload;
6197 }
6198 const proms = [];
6199 if (def.keyType._zod.values) {
6200 const values = def.keyType._zod.values;
6201 payload.value = {};
6202 for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
6203 const result = def.valueType._zod.run({
6204 value: input[key],
6205 issues: []
6206 }, ctx);
6207 if (result instanceof Promise) proms.push(result.then((result) => {
6208 if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
6209 payload.value[key] = result.value;
6210 }));
6211 else {
6212 if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
6213 payload.value[key] = result.value;
6214 }
6215 }
6216 let unrecognized;
6217 for (const key in input) if (!values.has(key)) {
6218 unrecognized = unrecognized ?? [];
6219 unrecognized.push(key);
6220 }
6221 if (unrecognized && unrecognized.length > 0) payload.issues.push({
6222 code: "unrecognized_keys",
6223 input,
6224 inst,
6225 keys: unrecognized
6226 });
6227 } else {
6228 payload.value = {};
6229 for (const key of Reflect.ownKeys(input)) {
6230 if (key === "__proto__") continue;
6231 const keyResult = def.keyType._zod.run({
6232 value: key,
6233 issues: []
6234 }, ctx);
6235 if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
6236 if (keyResult.issues.length) {
6237 payload.issues.push({
6238 origin: "record",
6239 code: "invalid_key",
6240 issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
6241 input: key,
6242 path: [key],
6243 inst
6244 });
6245 payload.value[keyResult.value] = keyResult.value;
6246 continue;
6247 }
6248 const result = def.valueType._zod.run({
6249 value: input[key],
6250 issues: []
6251 }, ctx);
6252 if (result instanceof Promise) proms.push(result.then((result) => {
6253 if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
6254 payload.value[keyResult.value] = result.value;
6255 }));
6256 else {
6257 if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
6258 payload.value[keyResult.value] = result.value;
6259 }
6260 }
6261 }
6262 if (proms.length) return Promise.all(proms).then(() => payload);
6263 return payload;
6264 };
6265 });
6266 var $ZodMap = /*@__PURE__*/ $constructor("$ZodMap", (inst, def) => {
6267 $ZodType.init(inst, def);
6268 inst._zod.parse = (payload, ctx) => {
6269 const input = payload.value;
6270 if (!(input instanceof Map)) {
6271 payload.issues.push({
6272 expected: "map",
6273 code: "invalid_type",
6274 input,
6275 inst
6276 });
6277 return payload;
6278 }
6279 const proms = [];
6280 payload.value = /* @__PURE__ */ new Map();
6281 for (const [key, value] of input) {
6282 const keyResult = def.keyType._zod.run({
6283 value: key,
6284 issues: []
6285 }, ctx);
6286 const valueResult = def.valueType._zod.run({
6287 value,
6288 issues: []
6289 }, ctx);
6290 if (keyResult instanceof Promise || valueResult instanceof Promise) proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
6291 handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
6292 }));
6293 else handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
6294 }
6295 if (proms.length) return Promise.all(proms).then(() => payload);
6296 return payload;
6297 };
6298 });
6299 function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
6300 if (keyResult.issues.length) if (propertyKeyTypes.has(typeof key)) final.issues.push(...prefixIssues(key, keyResult.issues));
6301 else final.issues.push({
6302 origin: "map",
6303 code: "invalid_key",
6304 input,
6305 inst,
6306 issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
6307 });
6308 if (valueResult.issues.length) if (propertyKeyTypes.has(typeof key)) final.issues.push(...prefixIssues(key, valueResult.issues));
6309 else final.issues.push({
6310 origin: "map",
6311 code: "invalid_element",
6312 input,
6313 inst,
6314 key,
6315 issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
6316 });
6317 final.value.set(keyResult.value, valueResult.value);
6318 }
6319 var $ZodSet = /*@__PURE__*/ $constructor("$ZodSet", (inst, def) => {
6320 $ZodType.init(inst, def);
6321 inst._zod.parse = (payload, ctx) => {
6322 const input = payload.value;
6323 if (!(input instanceof Set)) {
6324 payload.issues.push({
6325 input,
6326 inst,
6327 expected: "set",
6328 code: "invalid_type"
6329 });
6330 return payload;
6331 }
6332 const proms = [];
6333 payload.value = /* @__PURE__ */ new Set();
6334 for (const item of input) {
6335 const result = def.valueType._zod.run({
6336 value: item,
6337 issues: []
6338 }, ctx);
6339 if (result instanceof Promise) proms.push(result.then((result) => handleSetResult(result, payload)));
6340 else handleSetResult(result, payload);
6341 }
6342 if (proms.length) return Promise.all(proms).then(() => payload);
6343 return payload;
6344 };
6345 });
6346 function handleSetResult(result, final) {
6347 if (result.issues.length) final.issues.push(...result.issues);
6348 final.value.add(result.value);
6349 }
6350 var $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
6351 $ZodType.init(inst, def);
6352 const values = getEnumValues(def.entries);
6353 inst._zod.values = new Set(values);
6354 inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
6355 inst._zod.parse = (payload, _ctx) => {
6356 const input = payload.value;
6357 if (inst._zod.values.has(input)) return payload;
6358 payload.issues.push({
6359 code: "invalid_value",
6360 values,
6361 input,
6362 inst
6363 });
6364 return payload;
6365 };
6366 });
6367 var $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
6368 $ZodType.init(inst, def);
6369 inst._zod.values = new Set(def.values);
6370 inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? o.toString() : String(o)).join("|")})$`);
6371 inst._zod.parse = (payload, _ctx) => {
6372 const input = payload.value;
6373 if (inst._zod.values.has(input)) return payload;
6374 payload.issues.push({
6375 code: "invalid_value",
6376 values: def.values,
6377 input,
6378 inst
6379 });
6380 return payload;
6381 };
6382 });
6383 var $ZodFile = /*@__PURE__*/ $constructor("$ZodFile", (inst, def) => {
6384 $ZodType.init(inst, def);
6385 inst._zod.parse = (payload, _ctx) => {
6386 const input = payload.value;
6387 if (input instanceof File) return payload;
6388 payload.issues.push({
6389 expected: "file",
6390 code: "invalid_type",
6391 input,
6392 inst
6393 });
6394 return payload;
6395 };
6396 });
6397 var $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
6398 $ZodType.init(inst, def);
6399 inst._zod.parse = (payload, _ctx) => {
6400 const _out = def.transform(payload.value, payload);
6401 if (_ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
6402 payload.value = output;
6403 return payload;
6404 });
6405 if (_out instanceof Promise) throw new $ZodAsyncError();
6406 payload.value = _out;
6407 return payload;
6408 };
6409 });
6410 var $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
6411 $ZodType.init(inst, def);
6412 inst._zod.optin = "optional";
6413 inst._zod.optout = "optional";
6414 defineLazy(inst._zod, "values", () => {
6415 return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
6416 });
6417 defineLazy(inst._zod, "pattern", () => {
6418 const pattern = def.innerType._zod.pattern;
6419 return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
6420 });
6421 inst._zod.parse = (payload, ctx) => {
6422 if (def.innerType._zod.optin === "optional") return def.innerType._zod.run(payload, ctx);
6423 if (payload.value === void 0) return payload;
6424 return def.innerType._zod.run(payload, ctx);
6425 };
6426 });
6427 var $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
6428 $ZodType.init(inst, def);
6429 defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
6430 defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
6431 defineLazy(inst._zod, "pattern", () => {
6432 const pattern = def.innerType._zod.pattern;
6433 return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
6434 });
6435 defineLazy(inst._zod, "values", () => {
6436 return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
6437 });
6438 inst._zod.parse = (payload, ctx) => {
6439 if (payload.value === null) return payload;
6440 return def.innerType._zod.run(payload, ctx);
6441 };
6442 });
6443 var $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
6444 $ZodType.init(inst, def);
6445 inst._zod.optin = "optional";
6446 defineLazy(inst._zod, "values", () => def.innerType._zod.values);
6447 inst._zod.parse = (payload, ctx) => {
6448 if (payload.value === void 0) {
6449 payload.value = def.defaultValue;
6450 /**
6451 * $ZodDefault always returns the default value immediately.
6452 * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
6453 return payload;
6454 }
6455 const result = def.innerType._zod.run(payload, ctx);
6456 if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
6457 return handleDefaultResult(result, def);
6458 };
6459 });
6460 function handleDefaultResult(payload, def) {
6461 if (payload.value === void 0) payload.value = def.defaultValue;
6462 return payload;
6463 }
6464 var $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
6465 $ZodType.init(inst, def);
6466 inst._zod.optin = "optional";
6467 defineLazy(inst._zod, "values", () => def.innerType._zod.values);
6468 inst._zod.parse = (payload, ctx) => {
6469 if (payload.value === void 0) payload.value = def.defaultValue;
6470 return def.innerType._zod.run(payload, ctx);
6471 };
6472 });
6473 var $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
6474 $ZodType.init(inst, def);
6475 defineLazy(inst._zod, "values", () => {
6476 const v = def.innerType._zod.values;
6477 return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
6478 });
6479 inst._zod.parse = (payload, ctx) => {
6480 const result = def.innerType._zod.run(payload, ctx);
6481 if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst));
6482 return handleNonOptionalResult(result, inst);
6483 };
6484 });
6485 function handleNonOptionalResult(payload, inst) {
6486 if (!payload.issues.length && payload.value === void 0) payload.issues.push({
6487 code: "invalid_type",
6488 expected: "nonoptional",
6489 input: payload.value,
6490 inst
6491 });
6492 return payload;
6493 }
6494 var $ZodSuccess = /*@__PURE__*/ $constructor("$ZodSuccess", (inst, def) => {
6495 $ZodType.init(inst, def);
6496 inst._zod.parse = (payload, ctx) => {
6497 const result = def.innerType._zod.run(payload, ctx);
6498 if (result instanceof Promise) return result.then((result) => {
6499 payload.value = result.issues.length === 0;
6500 return payload;
6501 });
6502 payload.value = result.issues.length === 0;
6503 return payload;
6504 };
6505 });
6506 var $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
6507 $ZodType.init(inst, def);
6508 inst._zod.optin = "optional";
6509 defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
6510 defineLazy(inst._zod, "values", () => def.innerType._zod.values);
6511 inst._zod.parse = (payload, ctx) => {
6512 const result = def.innerType._zod.run(payload, ctx);
6513 if (result instanceof Promise) return result.then((result) => {
6514 payload.value = result.value;
6515 if (result.issues.length) {
6516 payload.value = def.catchValue({
6517 ...payload,
6518 error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
6519 input: payload.value
6520 });
6521 payload.issues = [];
6522 }
6523 return payload;
6524 });
6525 payload.value = result.value;
6526 if (result.issues.length) {
6527 payload.value = def.catchValue({
6528 ...payload,
6529 error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
6530 input: payload.value
6531 });
6532 payload.issues = [];
6533 }
6534 return payload;
6535 };
6536 });
6537 var $ZodNaN = /*@__PURE__*/ $constructor("$ZodNaN", (inst, def) => {
6538 $ZodType.init(inst, def);
6539 inst._zod.parse = (payload, _ctx) => {
6540 if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
6541 payload.issues.push({
6542 input: payload.value,
6543 inst,
6544 expected: "nan",
6545 code: "invalid_type"
6546 });
6547 return payload;
6548 }
6549 return payload;
6550 };
6551 });
6552 var $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
6553 $ZodType.init(inst, def);
6554 defineLazy(inst._zod, "values", () => def.in._zod.values);
6555 defineLazy(inst._zod, "optin", () => def.in._zod.optin);
6556 defineLazy(inst._zod, "optout", () => def.out._zod.optout);
6557 inst._zod.parse = (payload, ctx) => {
6558 const left = def.in._zod.run(payload, ctx);
6559 if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def, ctx));
6560 return handlePipeResult(left, def, ctx);
6561 };
6562 });
6563 function handlePipeResult(left, def, ctx) {
6564 if (aborted(left)) return left;
6565 return def.out._zod.run({
6566 value: left.value,
6567 issues: left.issues
6568 }, ctx);
6569 }
6570 var $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
6571 $ZodType.init(inst, def);
6572 defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
6573 defineLazy(inst._zod, "values", () => def.innerType._zod.values);
6574 defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
6575 defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
6576 inst._zod.parse = (payload, ctx) => {
6577 const result = def.innerType._zod.run(payload, ctx);
6578 if (result instanceof Promise) return result.then(handleReadonlyResult);
6579 return handleReadonlyResult(result);
6580 };
6581 });
6582 function handleReadonlyResult(payload) {
6583 payload.value = Object.freeze(payload.value);
6584 return payload;
6585 }
6586 var $ZodTemplateLiteral = /*@__PURE__*/ $constructor("$ZodTemplateLiteral", (inst, def) => {
6587 $ZodType.init(inst, def);
6588 const regexParts = [];
6589 for (const part of def.parts) if (part instanceof $ZodType) {
6590 if (!part._zod.pattern) throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
6591 const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
6592 if (!source) throw new Error(`Invalid template literal part: ${part._zod.traits}`);
6593 const start = source.startsWith("^") ? 1 : 0;
6594 const end = source.endsWith("$") ? source.length - 1 : source.length;
6595 regexParts.push(source.slice(start, end));
6596 } else if (part === null || primitiveTypes.has(typeof part)) regexParts.push(escapeRegex(`${part}`));
6597 else throw new Error(`Invalid template literal part: ${part}`);
6598 inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
6599 inst._zod.parse = (payload, _ctx) => {
6600 if (typeof payload.value !== "string") {
6601 payload.issues.push({
6602 input: payload.value,
6603 inst,
6604 expected: "template_literal",
6605 code: "invalid_type"
6606 });
6607 return payload;
6608 }
6609 inst._zod.pattern.lastIndex = 0;
6610 if (!inst._zod.pattern.test(payload.value)) {
6611 payload.issues.push({
6612 input: payload.value,
6613 inst,
6614 code: "invalid_format",
6615 format: "template_literal",
6616 pattern: inst._zod.pattern.source
6617 });
6618 return payload;
6619 }
6620 return payload;
6621 };
6622 });
6623 var $ZodPromise = /*@__PURE__*/ $constructor("$ZodPromise", (inst, def) => {
6624 $ZodType.init(inst, def);
6625 inst._zod.parse = (payload, ctx) => {
6626 return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({
6627 value: inner,
6628 issues: []
6629 }, ctx));
6630 };
6631 });
6632 var $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => {
6633 $ZodType.init(inst, def);
6634 defineLazy(inst._zod, "innerType", () => def.getter());
6635 defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
6636 defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
6637 defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin);
6638 defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout);
6639 inst._zod.parse = (payload, ctx) => {
6640 return inst._zod.innerType._zod.run(payload, ctx);
6641 };
6642 });
6643 var $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
6644 $ZodCheck.init(inst, def);
6645 $ZodType.init(inst, def);
6646 inst._zod.parse = (payload, _) => {
6647 return payload;
6648 };
6649 inst._zod.check = (payload) => {
6650 const input = payload.value;
6651 const r = def.fn(input);
6652 if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst));
6653 handleRefineResult(r, payload, input, inst);
6654 };
6655 });
6656 function handleRefineResult(result, payload, input, inst) {
6657 if (!result) {
6658 const _iss = {
6659 code: "custom",
6660 input,
6661 inst,
6662 path: [...inst._zod.def.path ?? []],
6663 continue: !inst._zod.def.abort
6664 };
6665 if (inst._zod.def.params) _iss.params = inst._zod.def.params;
6666 payload.issues.push(issue(_iss));
6667 }
6668 }
6669
6670 //#endregion
6671 //#region node_modules/zod/v4/locales/ar.js
6672 var error$38 = /* @__PURE__ */ __name(() => {
6673 const Sizable = {
6674 string: {
6675 unit: "حرف",
6676 verb: "أن يحوي"
6677 },
6678 file: {
6679 unit: "بايت",
6680 verb: "أن يحوي"
6681 },
6682 array: {
6683 unit: "عنصر",
6684 verb: "أن يحوي"
6685 },
6686 set: {
6687 unit: "عنصر",
6688 verb: "أن يحوي"
6689 }
6690 };
6691 function getSizing(origin) {
6692 return Sizable[origin] ?? null;
6693 }
6694 const parsedType = (data) => {
6695 const t = typeof data;
6696 switch (t) {
6697 case "number": return Number.isNaN(data) ? "NaN" : "number";
6698 case "object":
6699 if (Array.isArray(data)) return "array";
6700 if (data === null) return "null";
6701 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
6702 }
6703 return t;
6704 };
6705 const Nouns = {
6706 regex: "مدخل",
6707 email: "بريد إلكتروني",
6708 url: "رابط",
6709 emoji: "إيموجي",
6710 uuid: "UUID",
6711 uuidv4: "UUIDv4",
6712 uuidv6: "UUIDv6",
6713 nanoid: "nanoid",
6714 guid: "GUID",
6715 cuid: "cuid",
6716 cuid2: "cuid2",
6717 ulid: "ULID",
6718 xid: "XID",
6719 ksuid: "KSUID",
6720 datetime: "تاريخ ووقت بمعيار ISO",
6721 date: "تاريخ بمعيار ISO",
6722 time: "وقت بمعيار ISO",
6723 duration: "مدة بمعيار ISO",
6724 ipv4: "عنوان IPv4",
6725 ipv6: "عنوان IPv6",
6726 cidrv4: "مدى عناوين بصيغة IPv4",
6727 cidrv6: "مدى عناوين بصيغة IPv6",
6728 base64: "نَص بترميز base64-encoded",
6729 base64url: "نَص بترميز base64url-encoded",
6730 json_string: "نَص على هيئة JSON",
6731 e164: "رقم هاتف بمعيار E.164",
6732 jwt: "JWT",
6733 template_literal: "مدخل"
6734 };
6735 return (issue) => {
6736 switch (issue.code) {
6737 case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue.expected}، ولكن تم إدخال ${parsedType(issue.input)}`;
6738 case "invalid_value":
6739 if (issue.values.length === 1) return `مدخلات غير مقبولة: يفترض إدخال ${stringifyPrimitive(issue.values[0])}`;
6740 return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${joinValues(issue.values, "|")}`;
6741 case "too_big": {
6742 const adj = issue.inclusive ? "<=" : "<";
6743 const sizing = getSizing(issue.origin);
6744 if (sizing) return ` أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "عنصر"}`;
6745 return `أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${adj} ${issue.maximum.toString()}`;
6746 }
6747 case "too_small": {
6748 const adj = issue.inclusive ? ">=" : ">";
6749 const sizing = getSizing(issue.origin);
6750 if (sizing) return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
6751 return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()}`;
6752 }
6753 case "invalid_format": {
6754 const _issue = issue;
6755 if (_issue.format === "starts_with") return `نَص غير مقبول: يجب أن يبدأ بـ "${issue.prefix}"`;
6756 if (_issue.format === "ends_with") return `نَص غير مقبول: يجب أن ينتهي بـ "${_issue.suffix}"`;
6757 if (_issue.format === "includes") return `نَص غير مقبول: يجب أن يتضمَّن "${_issue.includes}"`;
6758 if (_issue.format === "regex") return `نَص غير مقبول: يجب أن يطابق النمط ${_issue.pattern}`;
6759 return `${Nouns[_issue.format] ?? issue.format} غير مقبول`;
6760 }
6761 case "not_multiple_of": return `رقم غير مقبول: يجب أن يكون من مضاعفات ${issue.divisor}`;
6762 case "unrecognized_keys": return `معرف${issue.keys.length > 1 ? "ات" : ""} غريب${issue.keys.length > 1 ? "ة" : ""}: ${joinValues(issue.keys, "، ")}`;
6763 case "invalid_key": return `معرف غير مقبول في ${issue.origin}`;
6764 case "invalid_union": return "مدخل غير مقبول";
6765 case "invalid_element": return `مدخل غير مقبول في ${issue.origin}`;
6766 default: return "مدخل غير مقبول";
6767 }
6768 };
6769 }, "error");
6770 function ar_default() {
6771 return { localeError: error$38() };
6772 }
6773 __name(ar_default, "default");
6774
6775 //#endregion
6776 //#region node_modules/zod/v4/locales/az.js
6777 var error$37 = /* @__PURE__ */ __name(() => {
6778 const Sizable = {
6779 string: {
6780 unit: "simvol",
6781 verb: "olmalıdır"
6782 },
6783 file: {
6784 unit: "bayt",
6785 verb: "olmalıdır"
6786 },
6787 array: {
6788 unit: "element",
6789 verb: "olmalıdır"
6790 },
6791 set: {
6792 unit: "element",
6793 verb: "olmalıdır"
6794 }
6795 };
6796 function getSizing(origin) {
6797 return Sizable[origin] ?? null;
6798 }
6799 const parsedType = (data) => {
6800 const t = typeof data;
6801 switch (t) {
6802 case "number": return Number.isNaN(data) ? "NaN" : "number";
6803 case "object":
6804 if (Array.isArray(data)) return "array";
6805 if (data === null) return "null";
6806 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
6807 }
6808 return t;
6809 };
6810 const Nouns = {
6811 regex: "input",
6812 email: "email address",
6813 url: "URL",
6814 emoji: "emoji",
6815 uuid: "UUID",
6816 uuidv4: "UUIDv4",
6817 uuidv6: "UUIDv6",
6818 nanoid: "nanoid",
6819 guid: "GUID",
6820 cuid: "cuid",
6821 cuid2: "cuid2",
6822 ulid: "ULID",
6823 xid: "XID",
6824 ksuid: "KSUID",
6825 datetime: "ISO datetime",
6826 date: "ISO date",
6827 time: "ISO time",
6828 duration: "ISO duration",
6829 ipv4: "IPv4 address",
6830 ipv6: "IPv6 address",
6831 cidrv4: "IPv4 range",
6832 cidrv6: "IPv6 range",
6833 base64: "base64-encoded string",
6834 base64url: "base64url-encoded string",
6835 json_string: "JSON string",
6836 e164: "E.164 number",
6837 jwt: "JWT",
6838 template_literal: "input"
6839 };
6840 return (issue) => {
6841 switch (issue.code) {
6842 case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue.expected}, daxil olan ${parsedType(issue.input)}`;
6843 case "invalid_value":
6844 if (issue.values.length === 1) return `Yanlış dəyər: gözlənilən ${stringifyPrimitive(issue.values[0])}`;
6845 return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${joinValues(issue.values, "|")}`;
6846 case "too_big": {
6847 const adj = issue.inclusive ? "<=" : "<";
6848 const sizing = getSizing(issue.origin);
6849 if (sizing) return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
6850 return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()}`;
6851 }
6852 case "too_small": {
6853 const adj = issue.inclusive ? ">=" : ">";
6854 const sizing = getSizing(issue.origin);
6855 if (sizing) return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
6856 return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()}`;
6857 }
6858 case "invalid_format": {
6859 const _issue = issue;
6860 if (_issue.format === "starts_with") return `Yanlış mətn: "${_issue.prefix}" ilə başlamalıdır`;
6861 if (_issue.format === "ends_with") return `Yanlış mətn: "${_issue.suffix}" ilə bitməlidir`;
6862 if (_issue.format === "includes") return `Yanlış mətn: "${_issue.includes}" daxil olmalıdır`;
6863 if (_issue.format === "regex") return `Yanlış mətn: ${_issue.pattern} şablonuna uyğun olmalıdır`;
6864 return `Yanlış ${Nouns[_issue.format] ?? issue.format}`;
6865 }
6866 case "not_multiple_of": return `Yanlış ədəd: ${issue.divisor} ilə bölünə bilən olmalıdır`;
6867 case "unrecognized_keys": return `Tanınmayan açar${issue.keys.length > 1 ? "lar" : ""}: ${joinValues(issue.keys, ", ")}`;
6868 case "invalid_key": return `${issue.origin} daxilində yanlış açar`;
6869 case "invalid_union": return "Yanlış dəyər";
6870 case "invalid_element": return `${issue.origin} daxilində yanlış dəyər`;
6871 default: return `Yanlış dəyər`;
6872 }
6873 };
6874 }, "error");
6875 function az_default() {
6876 return { localeError: error$37() };
6877 }
6878 __name(az_default, "default");
6879
6880 //#endregion
6881 //#region node_modules/zod/v4/locales/be.js
6882 function getBelarusianPlural(count, one, few, many) {
6883 const absCount = Math.abs(count);
6884 const lastDigit = absCount % 10;
6885 const lastTwoDigits = absCount % 100;
6886 if (lastTwoDigits >= 11 && lastTwoDigits <= 19) return many;
6887 if (lastDigit === 1) return one;
6888 if (lastDigit >= 2 && lastDigit <= 4) return few;
6889 return many;
6890 }
6891 var error$36 = /* @__PURE__ */ __name(() => {
6892 const Sizable = {
6893 string: {
6894 unit: {
6895 one: "сімвал",
6896 few: "сімвалы",
6897 many: "сімвалаў"
6898 },
6899 verb: "мець"
6900 },
6901 array: {
6902 unit: {
6903 one: "элемент",
6904 few: "элементы",
6905 many: "элементаў"
6906 },
6907 verb: "мець"
6908 },
6909 set: {
6910 unit: {
6911 one: "элемент",
6912 few: "элементы",
6913 many: "элементаў"
6914 },
6915 verb: "мець"
6916 },
6917 file: {
6918 unit: {
6919 one: "байт",
6920 few: "байты",
6921 many: "байтаў"
6922 },
6923 verb: "мець"
6924 }
6925 };
6926 function getSizing(origin) {
6927 return Sizable[origin] ?? null;
6928 }
6929 const parsedType = (data) => {
6930 const t = typeof data;
6931 switch (t) {
6932 case "number": return Number.isNaN(data) ? "NaN" : "лік";
6933 case "object":
6934 if (Array.isArray(data)) return "масіў";
6935 if (data === null) return "null";
6936 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
6937 }
6938 return t;
6939 };
6940 const Nouns = {
6941 regex: "увод",
6942 email: "email адрас",
6943 url: "URL",
6944 emoji: "эмодзі",
6945 uuid: "UUID",
6946 uuidv4: "UUIDv4",
6947 uuidv6: "UUIDv6",
6948 nanoid: "nanoid",
6949 guid: "GUID",
6950 cuid: "cuid",
6951 cuid2: "cuid2",
6952 ulid: "ULID",
6953 xid: "XID",
6954 ksuid: "KSUID",
6955 datetime: "ISO дата і час",
6956 date: "ISO дата",
6957 time: "ISO час",
6958 duration: "ISO працягласць",
6959 ipv4: "IPv4 адрас",
6960 ipv6: "IPv6 адрас",
6961 cidrv4: "IPv4 дыяпазон",
6962 cidrv6: "IPv6 дыяпазон",
6963 base64: "радок у фармаце base64",
6964 base64url: "радок у фармаце base64url",
6965 json_string: "JSON радок",
6966 e164: "нумар E.164",
6967 jwt: "JWT",
6968 template_literal: "увод"
6969 };
6970 return (issue) => {
6971 switch (issue.code) {
6972 case "invalid_type": return `Няправільны ўвод: чакаўся ${issue.expected}, атрымана ${parsedType(issue.input)}`;
6973 case "invalid_value":
6974 if (issue.values.length === 1) return `Няправільны ўвод: чакалася ${stringifyPrimitive(issue.values[0])}`;
6975 return `Няправільны варыянт: чакаўся адзін з ${joinValues(issue.values, "|")}`;
6976 case "too_big": {
6977 const adj = issue.inclusive ? "<=" : "<";
6978 const sizing = getSizing(issue.origin);
6979 if (sizing) {
6980 const unit = getBelarusianPlural(Number(issue.maximum), sizing.unit.one, sizing.unit.few, sizing.unit.many);
6981 return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна ${sizing.verb} ${adj}${issue.maximum.toString()} ${unit}`;
6982 }
6983 return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна быць ${adj}${issue.maximum.toString()}`;
6984 }
6985 case "too_small": {
6986 const adj = issue.inclusive ? ">=" : ">";
6987 const sizing = getSizing(issue.origin);
6988 if (sizing) {
6989 const unit = getBelarusianPlural(Number(issue.minimum), sizing.unit.one, sizing.unit.few, sizing.unit.many);
6990 return `Занадта малы: чакалася, што ${issue.origin} павінна ${sizing.verb} ${adj}${issue.minimum.toString()} ${unit}`;
6991 }
6992 return `Занадта малы: чакалася, што ${issue.origin} павінна быць ${adj}${issue.minimum.toString()}`;
6993 }
6994 case "invalid_format": {
6995 const _issue = issue;
6996 if (_issue.format === "starts_with") return `Няправільны радок: павінен пачынацца з "${_issue.prefix}"`;
6997 if (_issue.format === "ends_with") return `Няправільны радок: павінен заканчвацца на "${_issue.suffix}"`;
6998 if (_issue.format === "includes") return `Няправільны радок: павінен змяшчаць "${_issue.includes}"`;
6999 if (_issue.format === "regex") return `Няправільны радок: павінен адпавядаць шаблону ${_issue.pattern}`;
7000 return `Няправільны ${Nouns[_issue.format] ?? issue.format}`;
7001 }
7002 case "not_multiple_of": return `Няправільны лік: павінен быць кратным ${issue.divisor}`;
7003 case "unrecognized_keys": return `Нераспазнаны ${issue.keys.length > 1 ? "ключы" : "ключ"}: ${joinValues(issue.keys, ", ")}`;
7004 case "invalid_key": return `Няправільны ключ у ${issue.origin}`;
7005 case "invalid_union": return "Няправільны ўвод";
7006 case "invalid_element": return `Няправільнае значэнне ў ${issue.origin}`;
7007 default: return `Няправільны ўвод`;
7008 }
7009 };
7010 }, "error");
7011 function be_default() {
7012 return { localeError: error$36() };
7013 }
7014 __name(be_default, "default");
7015
7016 //#endregion
7017 //#region node_modules/zod/v4/locales/ca.js
7018 var error$35 = /* @__PURE__ */ __name(() => {
7019 const Sizable = {
7020 string: {
7021 unit: "caràcters",
7022 verb: "contenir"
7023 },
7024 file: {
7025 unit: "bytes",
7026 verb: "contenir"
7027 },
7028 array: {
7029 unit: "elements",
7030 verb: "contenir"
7031 },
7032 set: {
7033 unit: "elements",
7034 verb: "contenir"
7035 }
7036 };
7037 function getSizing(origin) {
7038 return Sizable[origin] ?? null;
7039 }
7040 const parsedType = (data) => {
7041 const t = typeof data;
7042 switch (t) {
7043 case "number": return Number.isNaN(data) ? "NaN" : "number";
7044 case "object":
7045 if (Array.isArray(data)) return "array";
7046 if (data === null) return "null";
7047 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
7048 }
7049 return t;
7050 };
7051 const Nouns = {
7052 regex: "entrada",
7053 email: "adreça electrònica",
7054 url: "URL",
7055 emoji: "emoji",
7056 uuid: "UUID",
7057 uuidv4: "UUIDv4",
7058 uuidv6: "UUIDv6",
7059 nanoid: "nanoid",
7060 guid: "GUID",
7061 cuid: "cuid",
7062 cuid2: "cuid2",
7063 ulid: "ULID",
7064 xid: "XID",
7065 ksuid: "KSUID",
7066 datetime: "data i hora ISO",
7067 date: "data ISO",
7068 time: "hora ISO",
7069 duration: "durada ISO",
7070 ipv4: "adreça IPv4",
7071 ipv6: "adreça IPv6",
7072 cidrv4: "rang IPv4",
7073 cidrv6: "rang IPv6",
7074 base64: "cadena codificada en base64",
7075 base64url: "cadena codificada en base64url",
7076 json_string: "cadena JSON",
7077 e164: "número E.164",
7078 jwt: "JWT",
7079 template_literal: "entrada"
7080 };
7081 return (issue) => {
7082 switch (issue.code) {
7083 case "invalid_type": return `Tipus invàlid: s'esperava ${issue.expected}, s'ha rebut ${parsedType(issue.input)}`;
7084 case "invalid_value":
7085 if (issue.values.length === 1) return `Valor invàlid: s'esperava ${stringifyPrimitive(issue.values[0])}`;
7086 return `Opció invàlida: s'esperava una de ${joinValues(issue.values, " o ")}`;
7087 case "too_big": {
7088 const adj = issue.inclusive ? "com a màxim" : "menys de";
7089 const sizing = getSizing(issue.origin);
7090 if (sizing) return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} contingués ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
7091 return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} fos ${adj} ${issue.maximum.toString()}`;
7092 }
7093 case "too_small": {
7094 const adj = issue.inclusive ? "com a mínim" : "més de";
7095 const sizing = getSizing(issue.origin);
7096 if (sizing) return `Massa petit: s'esperava que ${issue.origin} contingués ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
7097 return `Massa petit: s'esperava que ${issue.origin} fos ${adj} ${issue.minimum.toString()}`;
7098 }
7099 case "invalid_format": {
7100 const _issue = issue;
7101 if (_issue.format === "starts_with") return `Format invàlid: ha de començar amb "${_issue.prefix}"`;
7102 if (_issue.format === "ends_with") return `Format invàlid: ha d'acabar amb "${_issue.suffix}"`;
7103 if (_issue.format === "includes") return `Format invàlid: ha d'incloure "${_issue.includes}"`;
7104 if (_issue.format === "regex") return `Format invàlid: ha de coincidir amb el patró ${_issue.pattern}`;
7105 return `Format invàlid per a ${Nouns[_issue.format] ?? issue.format}`;
7106 }
7107 case "not_multiple_of": return `Número invàlid: ha de ser múltiple de ${issue.divisor}`;
7108 case "unrecognized_keys": return `Clau${issue.keys.length > 1 ? "s" : ""} no reconeguda${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
7109 case "invalid_key": return `Clau invàlida a ${issue.origin}`;
7110 case "invalid_union": return "Entrada invàlida";
7111 case "invalid_element": return `Element invàlid a ${issue.origin}`;
7112 default: return `Entrada invàlida`;
7113 }
7114 };
7115 }, "error");
7116 function ca_default() {
7117 return { localeError: error$35() };
7118 }
7119 __name(ca_default, "default");
7120
7121 //#endregion
7122 //#region node_modules/zod/v4/locales/cs.js
7123 var error$34 = /* @__PURE__ */ __name(() => {
7124 const Sizable = {
7125 string: {
7126 unit: "znaků",
7127 verb: "mít"
7128 },
7129 file: {
7130 unit: "bajtů",
7131 verb: "mít"
7132 },
7133 array: {
7134 unit: "prvků",
7135 verb: "mít"
7136 },
7137 set: {
7138 unit: "prvků",
7139 verb: "mít"
7140 }
7141 };
7142 function getSizing(origin) {
7143 return Sizable[origin] ?? null;
7144 }
7145 const parsedType = (data) => {
7146 const t = typeof data;
7147 switch (t) {
7148 case "number": return Number.isNaN(data) ? "NaN" : "číslo";
7149 case "string": return "řetězec";
7150 case "boolean": return "boolean";
7151 case "bigint": return "bigint";
7152 case "function": return "funkce";
7153 case "symbol": return "symbol";
7154 case "undefined": return "undefined";
7155 case "object":
7156 if (Array.isArray(data)) return "pole";
7157 if (data === null) return "null";
7158 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
7159 }
7160 return t;
7161 };
7162 const Nouns = {
7163 regex: "regulární výraz",
7164 email: "e-mailová adresa",
7165 url: "URL",
7166 emoji: "emoji",
7167 uuid: "UUID",
7168 uuidv4: "UUIDv4",
7169 uuidv6: "UUIDv6",
7170 nanoid: "nanoid",
7171 guid: "GUID",
7172 cuid: "cuid",
7173 cuid2: "cuid2",
7174 ulid: "ULID",
7175 xid: "XID",
7176 ksuid: "KSUID",
7177 datetime: "datum a čas ve formátu ISO",
7178 date: "datum ve formátu ISO",
7179 time: "čas ve formátu ISO",
7180 duration: "doba trvání ISO",
7181 ipv4: "IPv4 adresa",
7182 ipv6: "IPv6 adresa",
7183 cidrv4: "rozsah IPv4",
7184 cidrv6: "rozsah IPv6",
7185 base64: "řetězec zakódovaný ve formátu base64",
7186 base64url: "řetězec zakódovaný ve formátu base64url",
7187 json_string: "řetězec ve formátu JSON",
7188 e164: "číslo E.164",
7189 jwt: "JWT",
7190 template_literal: "vstup"
7191 };
7192 return (issue) => {
7193 switch (issue.code) {
7194 case "invalid_type": return `Neplatný vstup: očekáváno ${issue.expected}, obdrženo ${parsedType(issue.input)}`;
7195 case "invalid_value":
7196 if (issue.values.length === 1) return `Neplatný vstup: očekáváno ${stringifyPrimitive(issue.values[0])}`;
7197 return `Neplatná možnost: očekávána jedna z hodnot ${joinValues(issue.values, "|")}`;
7198 case "too_big": {
7199 const adj = issue.inclusive ? "<=" : "<";
7200 const sizing = getSizing(issue.origin);
7201 if (sizing) return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.maximum.toString()} ${sizing.unit ?? "prvků"}`;
7202 return `Hodnota je příliš velká: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.maximum.toString()}`;
7203 }
7204 case "too_small": {
7205 const adj = issue.inclusive ? ">=" : ">";
7206 const sizing = getSizing(issue.origin);
7207 if (sizing) return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí mít ${adj}${issue.minimum.toString()} ${sizing.unit ?? "prvků"}`;
7208 return `Hodnota je příliš malá: ${issue.origin ?? "hodnota"} musí být ${adj}${issue.minimum.toString()}`;
7209 }
7210 case "invalid_format": {
7211 const _issue = issue;
7212 if (_issue.format === "starts_with") return `Neplatný řetězec: musí začínat na "${_issue.prefix}"`;
7213 if (_issue.format === "ends_with") return `Neplatný řetězec: musí končit na "${_issue.suffix}"`;
7214 if (_issue.format === "includes") return `Neplatný řetězec: musí obsahovat "${_issue.includes}"`;
7215 if (_issue.format === "regex") return `Neplatný řetězec: musí odpovídat vzoru ${_issue.pattern}`;
7216 return `Neplatný formát ${Nouns[_issue.format] ?? issue.format}`;
7217 }
7218 case "not_multiple_of": return `Neplatné číslo: musí být násobkem ${issue.divisor}`;
7219 case "unrecognized_keys": return `Neznámé klíče: ${joinValues(issue.keys, ", ")}`;
7220 case "invalid_key": return `Neplatný klíč v ${issue.origin}`;
7221 case "invalid_union": return "Neplatný vstup";
7222 case "invalid_element": return `Neplatná hodnota v ${issue.origin}`;
7223 default: return `Neplatný vstup`;
7224 }
7225 };
7226 }, "error");
7227 function cs_default() {
7228 return { localeError: error$34() };
7229 }
7230 __name(cs_default, "default");
7231
7232 //#endregion
7233 //#region node_modules/zod/v4/locales/de.js
7234 var error$33 = /* @__PURE__ */ __name(() => {
7235 const Sizable = {
7236 string: {
7237 unit: "Zeichen",
7238 verb: "zu haben"
7239 },
7240 file: {
7241 unit: "Bytes",
7242 verb: "zu haben"
7243 },
7244 array: {
7245 unit: "Elemente",
7246 verb: "zu haben"
7247 },
7248 set: {
7249 unit: "Elemente",
7250 verb: "zu haben"
7251 }
7252 };
7253 function getSizing(origin) {
7254 return Sizable[origin] ?? null;
7255 }
7256 const parsedType = (data) => {
7257 const t = typeof data;
7258 switch (t) {
7259 case "number": return Number.isNaN(data) ? "NaN" : "Zahl";
7260 case "object":
7261 if (Array.isArray(data)) return "Array";
7262 if (data === null) return "null";
7263 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
7264 }
7265 return t;
7266 };
7267 const Nouns = {
7268 regex: "Eingabe",
7269 email: "E-Mail-Adresse",
7270 url: "URL",
7271 emoji: "Emoji",
7272 uuid: "UUID",
7273 uuidv4: "UUIDv4",
7274 uuidv6: "UUIDv6",
7275 nanoid: "nanoid",
7276 guid: "GUID",
7277 cuid: "cuid",
7278 cuid2: "cuid2",
7279 ulid: "ULID",
7280 xid: "XID",
7281 ksuid: "KSUID",
7282 datetime: "ISO-Datum und -Uhrzeit",
7283 date: "ISO-Datum",
7284 time: "ISO-Uhrzeit",
7285 duration: "ISO-Dauer",
7286 ipv4: "IPv4-Adresse",
7287 ipv6: "IPv6-Adresse",
7288 cidrv4: "IPv4-Bereich",
7289 cidrv6: "IPv6-Bereich",
7290 base64: "Base64-codierter String",
7291 base64url: "Base64-URL-codierter String",
7292 json_string: "JSON-String",
7293 e164: "E.164-Nummer",
7294 jwt: "JWT",
7295 template_literal: "Eingabe"
7296 };
7297 return (issue) => {
7298 switch (issue.code) {
7299 case "invalid_type": return `Ungültige Eingabe: erwartet ${issue.expected}, erhalten ${parsedType(issue.input)}`;
7300 case "invalid_value":
7301 if (issue.values.length === 1) return `Ungültige Eingabe: erwartet ${stringifyPrimitive(issue.values[0])}`;
7302 return `Ungültige Option: erwartet eine von ${joinValues(issue.values, "|")}`;
7303 case "too_big": {
7304 const adj = issue.inclusive ? "<=" : "<";
7305 const sizing = getSizing(issue.origin);
7306 if (sizing) return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`;
7307 return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ist`;
7308 }
7309 case "too_small": {
7310 const adj = issue.inclusive ? ">=" : ">";
7311 const sizing = getSizing(issue.origin);
7312 if (sizing) return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} hat`;
7313 return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ist`;
7314 }
7315 case "invalid_format": {
7316 const _issue = issue;
7317 if (_issue.format === "starts_with") return `Ungültiger String: muss mit "${_issue.prefix}" beginnen`;
7318 if (_issue.format === "ends_with") return `Ungültiger String: muss mit "${_issue.suffix}" enden`;
7319 if (_issue.format === "includes") return `Ungültiger String: muss "${_issue.includes}" enthalten`;
7320 if (_issue.format === "regex") return `Ungültiger String: muss dem Muster ${_issue.pattern} entsprechen`;
7321 return `Ungültig: ${Nouns[_issue.format] ?? issue.format}`;
7322 }
7323 case "not_multiple_of": return `Ungültige Zahl: muss ein Vielfaches von ${issue.divisor} sein`;
7324 case "unrecognized_keys": return `${issue.keys.length > 1 ? "Unbekannte Schlüssel" : "Unbekannter Schlüssel"}: ${joinValues(issue.keys, ", ")}`;
7325 case "invalid_key": return `Ungültiger Schlüssel in ${issue.origin}`;
7326 case "invalid_union": return "Ungültige Eingabe";
7327 case "invalid_element": return `Ungültiger Wert in ${issue.origin}`;
7328 default: return `Ungültige Eingabe`;
7329 }
7330 };
7331 }, "error");
7332 function de_default() {
7333 return { localeError: error$33() };
7334 }
7335 __name(de_default, "default");
7336
7337 //#endregion
7338 //#region node_modules/zod/v4/locales/en.js
7339 var parsedType$2 = /* @__PURE__ */ __name((data) => {
7340 const t = typeof data;
7341 switch (t) {
7342 case "number": return Number.isNaN(data) ? "NaN" : "number";
7343 case "object":
7344 if (Array.isArray(data)) return "array";
7345 if (data === null) return "null";
7346 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
7347 }
7348 return t;
7349 }, "parsedType");
7350 var error$32 = /* @__PURE__ */ __name(() => {
7351 const Sizable = {
7352 string: {
7353 unit: "characters",
7354 verb: "to have"
7355 },
7356 file: {
7357 unit: "bytes",
7358 verb: "to have"
7359 },
7360 array: {
7361 unit: "items",
7362 verb: "to have"
7363 },
7364 set: {
7365 unit: "items",
7366 verb: "to have"
7367 }
7368 };
7369 function getSizing(origin) {
7370 return Sizable[origin] ?? null;
7371 }
7372 const Nouns = {
7373 regex: "input",
7374 email: "email address",
7375 url: "URL",
7376 emoji: "emoji",
7377 uuid: "UUID",
7378 uuidv4: "UUIDv4",
7379 uuidv6: "UUIDv6",
7380 nanoid: "nanoid",
7381 guid: "GUID",
7382 cuid: "cuid",
7383 cuid2: "cuid2",
7384 ulid: "ULID",
7385 xid: "XID",
7386 ksuid: "KSUID",
7387 datetime: "ISO datetime",
7388 date: "ISO date",
7389 time: "ISO time",
7390 duration: "ISO duration",
7391 ipv4: "IPv4 address",
7392 ipv6: "IPv6 address",
7393 cidrv4: "IPv4 range",
7394 cidrv6: "IPv6 range",
7395 base64: "base64-encoded string",
7396 base64url: "base64url-encoded string",
7397 json_string: "JSON string",
7398 e164: "E.164 number",
7399 jwt: "JWT",
7400 template_literal: "input"
7401 };
7402 return (issue) => {
7403 switch (issue.code) {
7404 case "invalid_type": return `Invalid input: expected ${issue.expected}, received ${parsedType$2(issue.input)}`;
7405 case "invalid_value":
7406 if (issue.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
7407 return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
7408 case "too_big": {
7409 const adj = issue.inclusive ? "<=" : "<";
7410 const sizing = getSizing(issue.origin);
7411 if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
7412 return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
7413 }
7414 case "too_small": {
7415 const adj = issue.inclusive ? ">=" : ">";
7416 const sizing = getSizing(issue.origin);
7417 if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
7418 return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
7419 }
7420 case "invalid_format": {
7421 const _issue = issue;
7422 if (_issue.format === "starts_with") return `Invalid string: must start with "${_issue.prefix}"`;
7423 if (_issue.format === "ends_with") return `Invalid string: must end with "${_issue.suffix}"`;
7424 if (_issue.format === "includes") return `Invalid string: must include "${_issue.includes}"`;
7425 if (_issue.format === "regex") return `Invalid string: must match pattern ${_issue.pattern}`;
7426 return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
7427 }
7428 case "not_multiple_of": return `Invalid number: must be a multiple of ${issue.divisor}`;
7429 case "unrecognized_keys": return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
7430 case "invalid_key": return `Invalid key in ${issue.origin}`;
7431 case "invalid_union": return "Invalid input";
7432 case "invalid_element": return `Invalid value in ${issue.origin}`;
7433 default: return `Invalid input`;
7434 }
7435 };
7436 }, "error");
7437 function en_default() {
7438 return { localeError: error$32() };
7439 }
7440 __name(en_default, "default");
7441
7442 //#endregion
7443 //#region node_modules/zod/v4/locales/eo.js
7444 var parsedType$1 = /* @__PURE__ */ __name((data) => {
7445 const t = typeof data;
7446 switch (t) {
7447 case "number": return Number.isNaN(data) ? "NaN" : "nombro";
7448 case "object":
7449 if (Array.isArray(data)) return "tabelo";
7450 if (data === null) return "senvalora";
7451 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
7452 }
7453 return t;
7454 }, "parsedType");
7455 var error$31 = /* @__PURE__ */ __name(() => {
7456 const Sizable = {
7457 string: {
7458 unit: "karaktrojn",
7459 verb: "havi"
7460 },
7461 file: {
7462 unit: "bajtojn",
7463 verb: "havi"
7464 },
7465 array: {
7466 unit: "elementojn",
7467 verb: "havi"
7468 },
7469 set: {
7470 unit: "elementojn",
7471 verb: "havi"
7472 }
7473 };
7474 function getSizing(origin) {
7475 return Sizable[origin] ?? null;
7476 }
7477 const Nouns = {
7478 regex: "enigo",
7479 email: "retadreso",
7480 url: "URL",
7481 emoji: "emoĝio",
7482 uuid: "UUID",
7483 uuidv4: "UUIDv4",
7484 uuidv6: "UUIDv6",
7485 nanoid: "nanoid",
7486 guid: "GUID",
7487 cuid: "cuid",
7488 cuid2: "cuid2",
7489 ulid: "ULID",
7490 xid: "XID",
7491 ksuid: "KSUID",
7492 datetime: "ISO-datotempo",
7493 date: "ISO-dato",
7494 time: "ISO-tempo",
7495 duration: "ISO-daŭro",
7496 ipv4: "IPv4-adreso",
7497 ipv6: "IPv6-adreso",
7498 cidrv4: "IPv4-rango",
7499 cidrv6: "IPv6-rango",
7500 base64: "64-ume kodita karaktraro",
7501 base64url: "URL-64-ume kodita karaktraro",
7502 json_string: "JSON-karaktraro",
7503 e164: "E.164-nombro",
7504 jwt: "JWT",
7505 template_literal: "enigo"
7506 };
7507 return (issue) => {
7508 switch (issue.code) {
7509 case "invalid_type": return `Nevalida enigo: atendiĝis ${issue.expected}, riceviĝis ${parsedType$1(issue.input)}`;
7510 case "invalid_value":
7511 if (issue.values.length === 1) return `Nevalida enigo: atendiĝis ${stringifyPrimitive(issue.values[0])}`;
7512 return `Nevalida opcio: atendiĝis unu el ${joinValues(issue.values, "|")}`;
7513 case "too_big": {
7514 const adj = issue.inclusive ? "<=" : "<";
7515 const sizing = getSizing(issue.origin);
7516 if (sizing) return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
7517 return `Tro granda: atendiĝis ke ${issue.origin ?? "valoro"} havu ${adj}${issue.maximum.toString()}`;
7518 }
7519 case "too_small": {
7520 const adj = issue.inclusive ? ">=" : ">";
7521 const sizing = getSizing(issue.origin);
7522 if (sizing) return `Tro malgranda: atendiĝis ke ${issue.origin} havu ${adj}${issue.minimum.toString()} ${sizing.unit}`;
7523 return `Tro malgranda: atendiĝis ke ${issue.origin} estu ${adj}${issue.minimum.toString()}`;
7524 }
7525 case "invalid_format": {
7526 const _issue = issue;
7527 if (_issue.format === "starts_with") return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
7528 if (_issue.format === "ends_with") return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
7529 if (_issue.format === "includes") return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
7530 if (_issue.format === "regex") return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
7531 return `Nevalida ${Nouns[_issue.format] ?? issue.format}`;
7532 }
7533 case "not_multiple_of": return `Nevalida nombro: devas esti oblo de ${issue.divisor}`;
7534 case "unrecognized_keys": return `Nekonata${issue.keys.length > 1 ? "j" : ""} ŝlosilo${issue.keys.length > 1 ? "j" : ""}: ${joinValues(issue.keys, ", ")}`;
7535 case "invalid_key": return `Nevalida ŝlosilo en ${issue.origin}`;
7536 case "invalid_union": return "Nevalida enigo";
7537 case "invalid_element": return `Nevalida valoro en ${issue.origin}`;
7538 default: return `Nevalida enigo`;
7539 }
7540 };
7541 }, "error");
7542 function eo_default() {
7543 return { localeError: error$31() };
7544 }
7545 __name(eo_default, "default");
7546
7547 //#endregion
7548 //#region node_modules/zod/v4/locales/es.js
7549 var error$30 = /* @__PURE__ */ __name(() => {
7550 const Sizable = {
7551 string: {
7552 unit: "caracteres",
7553 verb: "tener"
7554 },
7555 file: {
7556 unit: "bytes",
7557 verb: "tener"
7558 },
7559 array: {
7560 unit: "elementos",
7561 verb: "tener"
7562 },
7563 set: {
7564 unit: "elementos",
7565 verb: "tener"
7566 }
7567 };
7568 function getSizing(origin) {
7569 return Sizable[origin] ?? null;
7570 }
7571 const parsedType = (data) => {
7572 const t = typeof data;
7573 switch (t) {
7574 case "number": return Number.isNaN(data) ? "NaN" : "número";
7575 case "object":
7576 if (Array.isArray(data)) return "arreglo";
7577 if (data === null) return "nulo";
7578 if (Object.getPrototypeOf(data) !== Object.prototype) return data.constructor.name;
7579 }
7580 return t;
7581 };
7582 const Nouns = {
7583 regex: "entrada",
7584 email: "dirección de correo electrónico",
7585 url: "URL",
7586 emoji: "emoji",
7587 uuid: "UUID",
7588 uuidv4: "UUIDv4",
7589 uuidv6: "UUIDv6",
7590 nanoid: "nanoid",
7591 guid: "GUID",
7592 cuid: "cuid",
7593 cuid2: "cuid2",
7594 ulid: "ULID",
7595 xid: "XID",
7596 ksuid: "KSUID",
7597 datetime: "fecha y hora ISO",
7598 date: "fecha ISO",
7599 time: "hora ISO",
7600 duration: "duración ISO",
7601 ipv4: "dirección IPv4",
7602 ipv6: "dirección IPv6",
7603 cidrv4: "rango IPv4",
7604 cidrv6: "rango IPv6",
7605 base64: "cadena codificada en base64",
7606 base64url: "URL codificada en base64",
7607 json_string: "cadena JSON",
7608 e164: "número E.164",
7609 jwt: "JWT",
7610 template_literal: "entrada"
7611 };
7612 return (issue) => {
7613 switch (issue.code) {
7614 case "invalid_type": return `Entrada inválida: se esperaba ${issue.expected}, recibido ${parsedType(issue.input)}`;
7615 case "invalid_value":
7616 if (issue.values.length === 1) return `Entrada inválida: se esperaba ${stringifyPrimitive(issue.values[0])}`;
7617 return `Opción inválida: se esperaba una de ${joinValues(issue.values, "|")}`;
7618 case "too_big": {
7619 const adj = issue.inclusive ? "<=" : "<";
7620 const sizing = getSizing(issue.origin);
7621 if (sizing) return `Demasiado grande: se esperaba que ${issue.origin ?? "valor"} tuviera ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
7622 return `Demasiado grande: se esperaba que ${issue.origin ?? "valor"} fuera ${adj}${issue.maximum.toString()}`;
7623 }
7624 case "too_small": {
7625 const adj = issue.inclusive ? ">=" : ">";
7626 const sizing = getSizing(issue.origin);
7627 if (sizing) return `Demasiado pequeño: se esperaba que ${issue.origin} tuviera ${adj}${issue.minimum.toString()} ${sizing.unit}`;
7628 return `Demasiado pequeño: se esperaba que ${issue.origin} fuera ${adj}${issue.minimum.toString()}`;
7629 }
7630 case "invalid_format": {
7631 const _issue = issue;
7632 if (_issue.format === "starts_with") return `Cadena inválida: debe comenzar con "${_issue.prefix}"`;
7633 if (_issue.format === "ends_with") return `Cadena inválida: debe terminar en "${_issue.suffix}"`;
7634 if (_issue.format === "includes") return `Cadena inválida: debe incluir "${_issue.includes}"`;
7635 if (_issue.format === "regex") return `Cadena inválida: debe coincidir con el patrón ${_issue.pattern}`;
7636 return `Inválido ${Nouns[_issue.format] ?? issue.format}`;
7637 }
7638 case "not_multiple_of": return `Número inválido: debe ser múltiplo de ${issue.divisor}`;
7639 case "unrecognized_keys": return `Llave${issue.keys.length > 1 ? "s" : ""} desconocida${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
7640 case "invalid_key": return `Llave inválida en ${issue.origin}`;
7641 case "invalid_union": return "Entrada inválida";
7642 case "invalid_element": return `Valor inválido en ${issue.origin}`;
7643 default: return `Entrada inválida`;
7644 }
7645 };
7646 }, "error");
7647 function es_default() {
7648 return { localeError: error$30() };
7649 }
7650 __name(es_default, "default");
7651
7652 //#endregion
7653 //#region node_modules/zod/v4/locales/fa.js
7654 var error$29 = /* @__PURE__ */ __name(() => {
7655 const Sizable = {
7656 string: {
7657 unit: "کاراکتر",
7658 verb: "داشته باشد"
7659 },
7660 file: {
7661 unit: "بایت",
7662 verb: "داشته باشد"
7663 },
7664 array: {
7665 unit: "آیتم",
7666 verb: "داشته باشد"
7667 },
7668 set: {
7669 unit: "آیتم",
7670 verb: "داشته باشد"
7671 }
7672 };
7673 function getSizing(origin) {
7674 return Sizable[origin] ?? null;
7675 }
7676 const parsedType = (data) => {
7677 const t = typeof data;
7678 switch (t) {
7679 case "number": return Number.isNaN(data) ? "NaN" : "عدد";
7680 case "object":
7681 if (Array.isArray(data)) return "آرایه";
7682 if (data === null) return "null";
7683 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
7684 }
7685 return t;
7686 };
7687 const Nouns = {
7688 regex: "ورودی",
7689 email: "آدرس ایمیل",
7690 url: "URL",
7691 emoji: "ایموجی",
7692 uuid: "UUID",
7693 uuidv4: "UUIDv4",
7694 uuidv6: "UUIDv6",
7695 nanoid: "nanoid",
7696 guid: "GUID",
7697 cuid: "cuid",
7698 cuid2: "cuid2",
7699 ulid: "ULID",
7700 xid: "XID",
7701 ksuid: "KSUID",
7702 datetime: "تاریخ و زمان ایزو",
7703 date: "تاریخ ایزو",
7704 time: "زمان ایزو",
7705 duration: "مدت زمان ایزو",
7706 ipv4: "IPv4 آدرس",
7707 ipv6: "IPv6 آدرس",
7708 cidrv4: "IPv4 دامنه",
7709 cidrv6: "IPv6 دامنه",
7710 base64: "base64-encoded رشته",
7711 base64url: "base64url-encoded رشته",
7712 json_string: "JSON رشته",
7713 e164: "E.164 عدد",
7714 jwt: "JWT",
7715 template_literal: "ورودی"
7716 };
7717 return (issue) => {
7718 switch (issue.code) {
7719 case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue.expected} می‌بود، ${parsedType(issue.input)} دریافت شد`;
7720 case "invalid_value":
7721 if (issue.values.length === 1) return `ورودی نامعتبر: می‌بایست ${stringifyPrimitive(issue.values[0])} می‌بود`;
7722 return `گزینه نامعتبر: می‌بایست یکی از ${joinValues(issue.values, "|")} می‌بود`;
7723 case "too_big": {
7724 const adj = issue.inclusive ? "<=" : "<";
7725 const sizing = getSizing(issue.origin);
7726 if (sizing) return `خیلی بزرگ: ${issue.origin ?? "مقدار"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصر"} باشد`;
7727 return `خیلی بزرگ: ${issue.origin ?? "مقدار"} باید ${adj}${issue.maximum.toString()} باشد`;
7728 }
7729 case "too_small": {
7730 const adj = issue.inclusive ? ">=" : ">";
7731 const sizing = getSizing(issue.origin);
7732 if (sizing) return `خیلی کوچک: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} باشد`;
7733 return `خیلی کوچک: ${issue.origin} باید ${adj}${issue.minimum.toString()} باشد`;
7734 }
7735 case "invalid_format": {
7736 const _issue = issue;
7737 if (_issue.format === "starts_with") return `رشته نامعتبر: باید با "${_issue.prefix}" شروع شود`;
7738 if (_issue.format === "ends_with") return `رشته نامعتبر: باید با "${_issue.suffix}" تمام شود`;
7739 if (_issue.format === "includes") return `رشته نامعتبر: باید شامل "${_issue.includes}" باشد`;
7740 if (_issue.format === "regex") return `رشته نامعتبر: باید با الگوی ${_issue.pattern} مطابقت داشته باشد`;
7741 return `${Nouns[_issue.format] ?? issue.format} نامعتبر`;
7742 }
7743 case "not_multiple_of": return `عدد نامعتبر: باید مضرب ${issue.divisor} باشد`;
7744 case "unrecognized_keys": return `کلید${issue.keys.length > 1 ? "های" : ""} ناشناس: ${joinValues(issue.keys, ", ")}`;
7745 case "invalid_key": return `کلید ناشناس در ${issue.origin}`;
7746 case "invalid_union": return `ورودی نامعتبر`;
7747 case "invalid_element": return `مقدار نامعتبر در ${issue.origin}`;
7748 default: return `ورودی نامعتبر`;
7749 }
7750 };
7751 }, "error");
7752 function fa_default() {
7753 return { localeError: error$29() };
7754 }
7755 __name(fa_default, "default");
7756
7757 //#endregion
7758 //#region node_modules/zod/v4/locales/fi.js
7759 var error$28 = /* @__PURE__ */ __name(() => {
7760 const Sizable = {
7761 string: {
7762 unit: "merkkiä",
7763 subject: "merkkijonon"
7764 },
7765 file: {
7766 unit: "tavua",
7767 subject: "tiedoston"
7768 },
7769 array: {
7770 unit: "alkiota",
7771 subject: "listan"
7772 },
7773 set: {
7774 unit: "alkiota",
7775 subject: "joukon"
7776 },
7777 number: {
7778 unit: "",
7779 subject: "luvun"
7780 },
7781 bigint: {
7782 unit: "",
7783 subject: "suuren kokonaisluvun"
7784 },
7785 int: {
7786 unit: "",
7787 subject: "kokonaisluvun"
7788 },
7789 date: {
7790 unit: "",
7791 subject: "päivämäärän"
7792 }
7793 };
7794 function getSizing(origin) {
7795 return Sizable[origin] ?? null;
7796 }
7797 const parsedType = (data) => {
7798 const t = typeof data;
7799 switch (t) {
7800 case "number": return Number.isNaN(data) ? "NaN" : "number";
7801 case "object":
7802 if (Array.isArray(data)) return "array";
7803 if (data === null) return "null";
7804 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
7805 }
7806 return t;
7807 };
7808 const Nouns = {
7809 regex: "säännöllinen lauseke",
7810 email: "sähköpostiosoite",
7811 url: "URL-osoite",
7812 emoji: "emoji",
7813 uuid: "UUID",
7814 uuidv4: "UUIDv4",
7815 uuidv6: "UUIDv6",
7816 nanoid: "nanoid",
7817 guid: "GUID",
7818 cuid: "cuid",
7819 cuid2: "cuid2",
7820 ulid: "ULID",
7821 xid: "XID",
7822 ksuid: "KSUID",
7823 datetime: "ISO-aikaleima",
7824 date: "ISO-päivämäärä",
7825 time: "ISO-aika",
7826 duration: "ISO-kesto",
7827 ipv4: "IPv4-osoite",
7828 ipv6: "IPv6-osoite",
7829 cidrv4: "IPv4-alue",
7830 cidrv6: "IPv6-alue",
7831 base64: "base64-koodattu merkkijono",
7832 base64url: "base64url-koodattu merkkijono",
7833 json_string: "JSON-merkkijono",
7834 e164: "E.164-luku",
7835 jwt: "JWT",
7836 template_literal: "templaattimerkkijono"
7837 };
7838 return (issue) => {
7839 switch (issue.code) {
7840 case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue.expected}, oli ${parsedType(issue.input)}`;
7841 case "invalid_value":
7842 if (issue.values.length === 1) return `Virheellinen syöte: täytyy olla ${stringifyPrimitive(issue.values[0])}`;
7843 return `Virheellinen valinta: täytyy olla yksi seuraavista: ${joinValues(issue.values, "|")}`;
7844 case "too_big": {
7845 const adj = issue.inclusive ? "<=" : "<";
7846 const sizing = getSizing(issue.origin);
7847 if (sizing) return `Liian suuri: ${sizing.subject} täytyy olla ${adj}${issue.maximum.toString()} ${sizing.unit}`.trim();
7848 return `Liian suuri: arvon täytyy olla ${adj}${issue.maximum.toString()}`;
7849 }
7850 case "too_small": {
7851 const adj = issue.inclusive ? ">=" : ">";
7852 const sizing = getSizing(issue.origin);
7853 if (sizing) return `Liian pieni: ${sizing.subject} täytyy olla ${adj}${issue.minimum.toString()} ${sizing.unit}`.trim();
7854 return `Liian pieni: arvon täytyy olla ${adj}${issue.minimum.toString()}`;
7855 }
7856 case "invalid_format": {
7857 const _issue = issue;
7858 if (_issue.format === "starts_with") return `Virheellinen syöte: täytyy alkaa "${_issue.prefix}"`;
7859 if (_issue.format === "ends_with") return `Virheellinen syöte: täytyy loppua "${_issue.suffix}"`;
7860 if (_issue.format === "includes") return `Virheellinen syöte: täytyy sisältää "${_issue.includes}"`;
7861 if (_issue.format === "regex") return `Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${_issue.pattern}`;
7862 return `Virheellinen ${Nouns[_issue.format] ?? issue.format}`;
7863 }
7864 case "not_multiple_of": return `Virheellinen luku: täytyy olla luvun ${issue.divisor} monikerta`;
7865 case "unrecognized_keys": return `${issue.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${joinValues(issue.keys, ", ")}`;
7866 case "invalid_key": return "Virheellinen avain tietueessa";
7867 case "invalid_union": return "Virheellinen unioni";
7868 case "invalid_element": return "Virheellinen arvo joukossa";
7869 default: return `Virheellinen syöte`;
7870 }
7871 };
7872 }, "error");
7873 function fi_default() {
7874 return { localeError: error$28() };
7875 }
7876 __name(fi_default, "default");
7877
7878 //#endregion
7879 //#region node_modules/zod/v4/locales/fr.js
7880 var error$27 = /* @__PURE__ */ __name(() => {
7881 const Sizable = {
7882 string: {
7883 unit: "caractères",
7884 verb: "avoir"
7885 },
7886 file: {
7887 unit: "octets",
7888 verb: "avoir"
7889 },
7890 array: {
7891 unit: "éléments",
7892 verb: "avoir"
7893 },
7894 set: {
7895 unit: "éléments",
7896 verb: "avoir"
7897 }
7898 };
7899 function getSizing(origin) {
7900 return Sizable[origin] ?? null;
7901 }
7902 const parsedType = (data) => {
7903 const t = typeof data;
7904 switch (t) {
7905 case "number": return Number.isNaN(data) ? "NaN" : "nombre";
7906 case "object":
7907 if (Array.isArray(data)) return "tableau";
7908 if (data === null) return "null";
7909 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
7910 }
7911 return t;
7912 };
7913 const Nouns = {
7914 regex: "entrée",
7915 email: "adresse e-mail",
7916 url: "URL",
7917 emoji: "emoji",
7918 uuid: "UUID",
7919 uuidv4: "UUIDv4",
7920 uuidv6: "UUIDv6",
7921 nanoid: "nanoid",
7922 guid: "GUID",
7923 cuid: "cuid",
7924 cuid2: "cuid2",
7925 ulid: "ULID",
7926 xid: "XID",
7927 ksuid: "KSUID",
7928 datetime: "date et heure ISO",
7929 date: "date ISO",
7930 time: "heure ISO",
7931 duration: "durée ISO",
7932 ipv4: "adresse IPv4",
7933 ipv6: "adresse IPv6",
7934 cidrv4: "plage IPv4",
7935 cidrv6: "plage IPv6",
7936 base64: "chaîne encodée en base64",
7937 base64url: "chaîne encodée en base64url",
7938 json_string: "chaîne JSON",
7939 e164: "numéro E.164",
7940 jwt: "JWT",
7941 template_literal: "entrée"
7942 };
7943 return (issue) => {
7944 switch (issue.code) {
7945 case "invalid_type": return `Entrée invalide : ${issue.expected} attendu, ${parsedType(issue.input)} reçu`;
7946 case "invalid_value":
7947 if (issue.values.length === 1) return `Entrée invalide : ${stringifyPrimitive(issue.values[0])} attendu`;
7948 return `Option invalide : une valeur parmi ${joinValues(issue.values, "|")} attendue`;
7949 case "too_big": {
7950 const adj = issue.inclusive ? "<=" : "<";
7951 const sizing = getSizing(issue.origin);
7952 if (sizing) return `Trop grand : ${issue.origin ?? "valeur"} doit ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "élément(s)"}`;
7953 return `Trop grand : ${issue.origin ?? "valeur"} doit être ${adj}${issue.maximum.toString()}`;
7954 }
7955 case "too_small": {
7956 const adj = issue.inclusive ? ">=" : ">";
7957 const sizing = getSizing(issue.origin);
7958 if (sizing) return `Trop petit : ${issue.origin} doit ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
7959 return `Trop petit : ${issue.origin} doit être ${adj}${issue.minimum.toString()}`;
7960 }
7961 case "invalid_format": {
7962 const _issue = issue;
7963 if (_issue.format === "starts_with") return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
7964 if (_issue.format === "ends_with") return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
7965 if (_issue.format === "includes") return `Chaîne invalide : doit inclure "${_issue.includes}"`;
7966 if (_issue.format === "regex") return `Chaîne invalide : doit correspondre au modèle ${_issue.pattern}`;
7967 return `${Nouns[_issue.format] ?? issue.format} invalide`;
7968 }
7969 case "not_multiple_of": return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
7970 case "unrecognized_keys": return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${joinValues(issue.keys, ", ")}`;
7971 case "invalid_key": return `Clé invalide dans ${issue.origin}`;
7972 case "invalid_union": return "Entrée invalide";
7973 case "invalid_element": return `Valeur invalide dans ${issue.origin}`;
7974 default: return `Entrée invalide`;
7975 }
7976 };
7977 }, "error");
7978 function fr_default() {
7979 return { localeError: error$27() };
7980 }
7981 __name(fr_default, "default");
7982
7983 //#endregion
7984 //#region node_modules/zod/v4/locales/fr-CA.js
7985 var error$26 = /* @__PURE__ */ __name(() => {
7986 const Sizable = {
7987 string: {
7988 unit: "caractères",
7989 verb: "avoir"
7990 },
7991 file: {
7992 unit: "octets",
7993 verb: "avoir"
7994 },
7995 array: {
7996 unit: "éléments",
7997 verb: "avoir"
7998 },
7999 set: {
8000 unit: "éléments",
8001 verb: "avoir"
8002 }
8003 };
8004 function getSizing(origin) {
8005 return Sizable[origin] ?? null;
8006 }
8007 const parsedType = (data) => {
8008 const t = typeof data;
8009 switch (t) {
8010 case "number": return Number.isNaN(data) ? "NaN" : "number";
8011 case "object":
8012 if (Array.isArray(data)) return "array";
8013 if (data === null) return "null";
8014 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8015 }
8016 return t;
8017 };
8018 const Nouns = {
8019 regex: "entrée",
8020 email: "adresse courriel",
8021 url: "URL",
8022 emoji: "emoji",
8023 uuid: "UUID",
8024 uuidv4: "UUIDv4",
8025 uuidv6: "UUIDv6",
8026 nanoid: "nanoid",
8027 guid: "GUID",
8028 cuid: "cuid",
8029 cuid2: "cuid2",
8030 ulid: "ULID",
8031 xid: "XID",
8032 ksuid: "KSUID",
8033 datetime: "date-heure ISO",
8034 date: "date ISO",
8035 time: "heure ISO",
8036 duration: "durée ISO",
8037 ipv4: "adresse IPv4",
8038 ipv6: "adresse IPv6",
8039 cidrv4: "plage IPv4",
8040 cidrv6: "plage IPv6",
8041 base64: "chaîne encodée en base64",
8042 base64url: "chaîne encodée en base64url",
8043 json_string: "chaîne JSON",
8044 e164: "numéro E.164",
8045 jwt: "JWT",
8046 template_literal: "entrée"
8047 };
8048 return (issue) => {
8049 switch (issue.code) {
8050 case "invalid_type": return `Entrée invalide : attendu ${issue.expected}, reçu ${parsedType(issue.input)}`;
8051 case "invalid_value":
8052 if (issue.values.length === 1) return `Entrée invalide : attendu ${stringifyPrimitive(issue.values[0])}`;
8053 return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue.values, "|")}`;
8054 case "too_big": {
8055 const adj = issue.inclusive ? "≤" : "<";
8056 const sizing = getSizing(issue.origin);
8057 if (sizing) return `Trop grand : attendu que ${issue.origin ?? "la valeur"} ait ${adj}${issue.maximum.toString()} ${sizing.unit}`;
8058 return `Trop grand : attendu que ${issue.origin ?? "la valeur"} soit ${adj}${issue.maximum.toString()}`;
8059 }
8060 case "too_small": {
8061 const adj = issue.inclusive ? "≥" : ">";
8062 const sizing = getSizing(issue.origin);
8063 if (sizing) return `Trop petit : attendu que ${issue.origin} ait ${adj}${issue.minimum.toString()} ${sizing.unit}`;
8064 return `Trop petit : attendu que ${issue.origin} soit ${adj}${issue.minimum.toString()}`;
8065 }
8066 case "invalid_format": {
8067 const _issue = issue;
8068 if (_issue.format === "starts_with") return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
8069 if (_issue.format === "ends_with") return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
8070 if (_issue.format === "includes") return `Chaîne invalide : doit inclure "${_issue.includes}"`;
8071 if (_issue.format === "regex") return `Chaîne invalide : doit correspondre au motif ${_issue.pattern}`;
8072 return `${Nouns[_issue.format] ?? issue.format} invalide`;
8073 }
8074 case "not_multiple_of": return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
8075 case "unrecognized_keys": return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${joinValues(issue.keys, ", ")}`;
8076 case "invalid_key": return `Clé invalide dans ${issue.origin}`;
8077 case "invalid_union": return "Entrée invalide";
8078 case "invalid_element": return `Valeur invalide dans ${issue.origin}`;
8079 default: return `Entrée invalide`;
8080 }
8081 };
8082 }, "error");
8083 function fr_CA_default() {
8084 return { localeError: error$26() };
8085 }
8086 __name(fr_CA_default, "default");
8087
8088 //#endregion
8089 //#region node_modules/zod/v4/locales/he.js
8090 var error$25 = /* @__PURE__ */ __name(() => {
8091 const Sizable = {
8092 string: {
8093 unit: "אותיות",
8094 verb: "לכלול"
8095 },
8096 file: {
8097 unit: "בייטים",
8098 verb: "לכלול"
8099 },
8100 array: {
8101 unit: "פריטים",
8102 verb: "לכלול"
8103 },
8104 set: {
8105 unit: "פריטים",
8106 verb: "לכלול"
8107 }
8108 };
8109 function getSizing(origin) {
8110 return Sizable[origin] ?? null;
8111 }
8112 const parsedType = (data) => {
8113 const t = typeof data;
8114 switch (t) {
8115 case "number": return Number.isNaN(data) ? "NaN" : "number";
8116 case "object":
8117 if (Array.isArray(data)) return "array";
8118 if (data === null) return "null";
8119 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8120 }
8121 return t;
8122 };
8123 const Nouns = {
8124 regex: "קלט",
8125 email: "כתובת אימייל",
8126 url: "כתובת רשת",
8127 emoji: "אימוג'י",
8128 uuid: "UUID",
8129 uuidv4: "UUIDv4",
8130 uuidv6: "UUIDv6",
8131 nanoid: "nanoid",
8132 guid: "GUID",
8133 cuid: "cuid",
8134 cuid2: "cuid2",
8135 ulid: "ULID",
8136 xid: "XID",
8137 ksuid: "KSUID",
8138 datetime: "תאריך וזמן ISO",
8139 date: "תאריך ISO",
8140 time: "זמן ISO",
8141 duration: "משך זמן ISO",
8142 ipv4: "כתובת IPv4",
8143 ipv6: "כתובת IPv6",
8144 cidrv4: "טווח IPv4",
8145 cidrv6: "טווח IPv6",
8146 base64: "מחרוזת בבסיס 64",
8147 base64url: "מחרוזת בבסיס 64 לכתובות רשת",
8148 json_string: "מחרוזת JSON",
8149 e164: "מספר E.164",
8150 jwt: "JWT",
8151 template_literal: "קלט"
8152 };
8153 return (issue) => {
8154 switch (issue.code) {
8155 case "invalid_type": return `קלט לא תקין: צריך ${issue.expected}, התקבל ${parsedType(issue.input)}`;
8156 case "invalid_value":
8157 if (issue.values.length === 1) return `קלט לא תקין: צריך ${stringifyPrimitive(issue.values[0])}`;
8158 return `קלט לא תקין: צריך אחת מהאפשרויות ${joinValues(issue.values, "|")}`;
8159 case "too_big": {
8160 const adj = issue.inclusive ? "<=" : "<";
8161 const sizing = getSizing(issue.origin);
8162 if (sizing) return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
8163 return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()}`;
8164 }
8165 case "too_small": {
8166 const adj = issue.inclusive ? ">=" : ">";
8167 const sizing = getSizing(issue.origin);
8168 if (sizing) return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()} ${sizing.unit}`;
8169 return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()}`;
8170 }
8171 case "invalid_format": {
8172 const _issue = issue;
8173 if (_issue.format === "starts_with") return `מחרוזת לא תקינה: חייבת להתחיל ב"${_issue.prefix}"`;
8174 if (_issue.format === "ends_with") return `מחרוזת לא תקינה: חייבת להסתיים ב "${_issue.suffix}"`;
8175 if (_issue.format === "includes") return `מחרוזת לא תקינה: חייבת לכלול "${_issue.includes}"`;
8176 if (_issue.format === "regex") return `מחרוזת לא תקינה: חייבת להתאים לתבנית ${_issue.pattern}`;
8177 return `${Nouns[_issue.format] ?? issue.format} לא תקין`;
8178 }
8179 case "not_multiple_of": return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
8180 case "unrecognized_keys": return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${joinValues(issue.keys, ", ")}`;
8181 case "invalid_key": return `מפתח לא תקין ב${issue.origin}`;
8182 case "invalid_union": return "קלט לא תקין";
8183 case "invalid_element": return `ערך לא תקין ב${issue.origin}`;
8184 default: return `קלט לא תקין`;
8185 }
8186 };
8187 }, "error");
8188 function he_default() {
8189 return { localeError: error$25() };
8190 }
8191 __name(he_default, "default");
8192
8193 //#endregion
8194 //#region node_modules/zod/v4/locales/hu.js
8195 var error$24 = /* @__PURE__ */ __name(() => {
8196 const Sizable = {
8197 string: {
8198 unit: "karakter",
8199 verb: "legyen"
8200 },
8201 file: {
8202 unit: "byte",
8203 verb: "legyen"
8204 },
8205 array: {
8206 unit: "elem",
8207 verb: "legyen"
8208 },
8209 set: {
8210 unit: "elem",
8211 verb: "legyen"
8212 }
8213 };
8214 function getSizing(origin) {
8215 return Sizable[origin] ?? null;
8216 }
8217 const parsedType = (data) => {
8218 const t = typeof data;
8219 switch (t) {
8220 case "number": return Number.isNaN(data) ? "NaN" : "szám";
8221 case "object":
8222 if (Array.isArray(data)) return "tömb";
8223 if (data === null) return "null";
8224 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8225 }
8226 return t;
8227 };
8228 const Nouns = {
8229 regex: "bemenet",
8230 email: "email cím",
8231 url: "URL",
8232 emoji: "emoji",
8233 uuid: "UUID",
8234 uuidv4: "UUIDv4",
8235 uuidv6: "UUIDv6",
8236 nanoid: "nanoid",
8237 guid: "GUID",
8238 cuid: "cuid",
8239 cuid2: "cuid2",
8240 ulid: "ULID",
8241 xid: "XID",
8242 ksuid: "KSUID",
8243 datetime: "ISO időbélyeg",
8244 date: "ISO dátum",
8245 time: "ISO idő",
8246 duration: "ISO időintervallum",
8247 ipv4: "IPv4 cím",
8248 ipv6: "IPv6 cím",
8249 cidrv4: "IPv4 tartomány",
8250 cidrv6: "IPv6 tartomány",
8251 base64: "base64-kódolt string",
8252 base64url: "base64url-kódolt string",
8253 json_string: "JSON string",
8254 e164: "E.164 szám",
8255 jwt: "JWT",
8256 template_literal: "bemenet"
8257 };
8258 return (issue) => {
8259 switch (issue.code) {
8260 case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue.expected}, a kapott érték ${parsedType(issue.input)}`;
8261 case "invalid_value":
8262 if (issue.values.length === 1) return `Érvénytelen bemenet: a várt érték ${stringifyPrimitive(issue.values[0])}`;
8263 return `Érvénytelen opció: valamelyik érték várt ${joinValues(issue.values, "|")}`;
8264 case "too_big": {
8265 const adj = issue.inclusive ? "<=" : "<";
8266 const sizing = getSizing(issue.origin);
8267 if (sizing) return `Túl nagy: ${issue.origin ?? "érték"} mérete túl nagy ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elem"}`;
8268 return `Túl nagy: a bemeneti érték ${issue.origin ?? "érték"} túl nagy: ${adj}${issue.maximum.toString()}`;
8269 }
8270 case "too_small": {
8271 const adj = issue.inclusive ? ">=" : ">";
8272 const sizing = getSizing(issue.origin);
8273 if (sizing) return `Túl kicsi: a bemeneti érték ${issue.origin} mérete túl kicsi ${adj}${issue.minimum.toString()} ${sizing.unit}`;
8274 return `Túl kicsi: a bemeneti érték ${issue.origin} túl kicsi ${adj}${issue.minimum.toString()}`;
8275 }
8276 case "invalid_format": {
8277 const _issue = issue;
8278 if (_issue.format === "starts_with") return `Érvénytelen string: "${_issue.prefix}" értékkel kell kezdődnie`;
8279 if (_issue.format === "ends_with") return `Érvénytelen string: "${_issue.suffix}" értékkel kell végződnie`;
8280 if (_issue.format === "includes") return `Érvénytelen string: "${_issue.includes}" értéket kell tartalmaznia`;
8281 if (_issue.format === "regex") return `Érvénytelen string: ${_issue.pattern} mintának kell megfelelnie`;
8282 return `Érvénytelen ${Nouns[_issue.format] ?? issue.format}`;
8283 }
8284 case "not_multiple_of": return `Érvénytelen szám: ${issue.divisor} többszörösének kell lennie`;
8285 case "unrecognized_keys": return `Ismeretlen kulcs${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
8286 case "invalid_key": return `Érvénytelen kulcs ${issue.origin}`;
8287 case "invalid_union": return "Érvénytelen bemenet";
8288 case "invalid_element": return `Érvénytelen érték: ${issue.origin}`;
8289 default: return `Érvénytelen bemenet`;
8290 }
8291 };
8292 }, "error");
8293 function hu_default() {
8294 return { localeError: error$24() };
8295 }
8296 __name(hu_default, "default");
8297
8298 //#endregion
8299 //#region node_modules/zod/v4/locales/id.js
8300 var error$23 = /* @__PURE__ */ __name(() => {
8301 const Sizable = {
8302 string: {
8303 unit: "karakter",
8304 verb: "memiliki"
8305 },
8306 file: {
8307 unit: "byte",
8308 verb: "memiliki"
8309 },
8310 array: {
8311 unit: "item",
8312 verb: "memiliki"
8313 },
8314 set: {
8315 unit: "item",
8316 verb: "memiliki"
8317 }
8318 };
8319 function getSizing(origin) {
8320 return Sizable[origin] ?? null;
8321 }
8322 const parsedType = (data) => {
8323 const t = typeof data;
8324 switch (t) {
8325 case "number": return Number.isNaN(data) ? "NaN" : "number";
8326 case "object":
8327 if (Array.isArray(data)) return "array";
8328 if (data === null) return "null";
8329 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8330 }
8331 return t;
8332 };
8333 const Nouns = {
8334 regex: "input",
8335 email: "alamat email",
8336 url: "URL",
8337 emoji: "emoji",
8338 uuid: "UUID",
8339 uuidv4: "UUIDv4",
8340 uuidv6: "UUIDv6",
8341 nanoid: "nanoid",
8342 guid: "GUID",
8343 cuid: "cuid",
8344 cuid2: "cuid2",
8345 ulid: "ULID",
8346 xid: "XID",
8347 ksuid: "KSUID",
8348 datetime: "tanggal dan waktu format ISO",
8349 date: "tanggal format ISO",
8350 time: "jam format ISO",
8351 duration: "durasi format ISO",
8352 ipv4: "alamat IPv4",
8353 ipv6: "alamat IPv6",
8354 cidrv4: "rentang alamat IPv4",
8355 cidrv6: "rentang alamat IPv6",
8356 base64: "string dengan enkode base64",
8357 base64url: "string dengan enkode base64url",
8358 json_string: "string JSON",
8359 e164: "angka E.164",
8360 jwt: "JWT",
8361 template_literal: "input"
8362 };
8363 return (issue) => {
8364 switch (issue.code) {
8365 case "invalid_type": return `Input tidak valid: diharapkan ${issue.expected}, diterima ${parsedType(issue.input)}`;
8366 case "invalid_value":
8367 if (issue.values.length === 1) return `Input tidak valid: diharapkan ${stringifyPrimitive(issue.values[0])}`;
8368 return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue.values, "|")}`;
8369 case "too_big": {
8370 const adj = issue.inclusive ? "<=" : "<";
8371 const sizing = getSizing(issue.origin);
8372 if (sizing) return `Terlalu besar: diharapkan ${issue.origin ?? "value"} memiliki ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
8373 return `Terlalu besar: diharapkan ${issue.origin ?? "value"} menjadi ${adj}${issue.maximum.toString()}`;
8374 }
8375 case "too_small": {
8376 const adj = issue.inclusive ? ">=" : ">";
8377 const sizing = getSizing(issue.origin);
8378 if (sizing) return `Terlalu kecil: diharapkan ${issue.origin} memiliki ${adj}${issue.minimum.toString()} ${sizing.unit}`;
8379 return `Terlalu kecil: diharapkan ${issue.origin} menjadi ${adj}${issue.minimum.toString()}`;
8380 }
8381 case "invalid_format": {
8382 const _issue = issue;
8383 if (_issue.format === "starts_with") return `String tidak valid: harus dimulai dengan "${_issue.prefix}"`;
8384 if (_issue.format === "ends_with") return `String tidak valid: harus berakhir dengan "${_issue.suffix}"`;
8385 if (_issue.format === "includes") return `String tidak valid: harus menyertakan "${_issue.includes}"`;
8386 if (_issue.format === "regex") return `String tidak valid: harus sesuai pola ${_issue.pattern}`;
8387 return `${Nouns[_issue.format] ?? issue.format} tidak valid`;
8388 }
8389 case "not_multiple_of": return `Angka tidak valid: harus kelipatan dari ${issue.divisor}`;
8390 case "unrecognized_keys": return `Kunci tidak dikenali ${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
8391 case "invalid_key": return `Kunci tidak valid di ${issue.origin}`;
8392 case "invalid_union": return "Input tidak valid";
8393 case "invalid_element": return `Nilai tidak valid di ${issue.origin}`;
8394 default: return `Input tidak valid`;
8395 }
8396 };
8397 }, "error");
8398 function id_default() {
8399 return { localeError: error$23() };
8400 }
8401 __name(id_default, "default");
8402
8403 //#endregion
8404 //#region node_modules/zod/v4/locales/it.js
8405 var error$22 = /* @__PURE__ */ __name(() => {
8406 const Sizable = {
8407 string: {
8408 unit: "caratteri",
8409 verb: "avere"
8410 },
8411 file: {
8412 unit: "byte",
8413 verb: "avere"
8414 },
8415 array: {
8416 unit: "elementi",
8417 verb: "avere"
8418 },
8419 set: {
8420 unit: "elementi",
8421 verb: "avere"
8422 }
8423 };
8424 function getSizing(origin) {
8425 return Sizable[origin] ?? null;
8426 }
8427 const parsedType = (data) => {
8428 const t = typeof data;
8429 switch (t) {
8430 case "number": return Number.isNaN(data) ? "NaN" : "numero";
8431 case "object":
8432 if (Array.isArray(data)) return "vettore";
8433 if (data === null) return "null";
8434 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8435 }
8436 return t;
8437 };
8438 const Nouns = {
8439 regex: "input",
8440 email: "indirizzo email",
8441 url: "URL",
8442 emoji: "emoji",
8443 uuid: "UUID",
8444 uuidv4: "UUIDv4",
8445 uuidv6: "UUIDv6",
8446 nanoid: "nanoid",
8447 guid: "GUID",
8448 cuid: "cuid",
8449 cuid2: "cuid2",
8450 ulid: "ULID",
8451 xid: "XID",
8452 ksuid: "KSUID",
8453 datetime: "data e ora ISO",
8454 date: "data ISO",
8455 time: "ora ISO",
8456 duration: "durata ISO",
8457 ipv4: "indirizzo IPv4",
8458 ipv6: "indirizzo IPv6",
8459 cidrv4: "intervallo IPv4",
8460 cidrv6: "intervallo IPv6",
8461 base64: "stringa codificata in base64",
8462 base64url: "URL codificata in base64",
8463 json_string: "stringa JSON",
8464 e164: "numero E.164",
8465 jwt: "JWT",
8466 template_literal: "input"
8467 };
8468 return (issue) => {
8469 switch (issue.code) {
8470 case "invalid_type": return `Input non valido: atteso ${issue.expected}, ricevuto ${parsedType(issue.input)}`;
8471 case "invalid_value":
8472 if (issue.values.length === 1) return `Input non valido: atteso ${stringifyPrimitive(issue.values[0])}`;
8473 return `Opzione non valida: atteso uno tra ${joinValues(issue.values, "|")}`;
8474 case "too_big": {
8475 const adj = issue.inclusive ? "<=" : "<";
8476 const sizing = getSizing(issue.origin);
8477 if (sizing) return `Troppo grande: ${issue.origin ?? "valore"} deve avere ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementi"}`;
8478 return `Troppo grande: ${issue.origin ?? "valore"} deve essere ${adj}${issue.maximum.toString()}`;
8479 }
8480 case "too_small": {
8481 const adj = issue.inclusive ? ">=" : ">";
8482 const sizing = getSizing(issue.origin);
8483 if (sizing) return `Troppo piccolo: ${issue.origin} deve avere ${adj}${issue.minimum.toString()} ${sizing.unit}`;
8484 return `Troppo piccolo: ${issue.origin} deve essere ${adj}${issue.minimum.toString()}`;
8485 }
8486 case "invalid_format": {
8487 const _issue = issue;
8488 if (_issue.format === "starts_with") return `Stringa non valida: deve iniziare con "${_issue.prefix}"`;
8489 if (_issue.format === "ends_with") return `Stringa non valida: deve terminare con "${_issue.suffix}"`;
8490 if (_issue.format === "includes") return `Stringa non valida: deve includere "${_issue.includes}"`;
8491 if (_issue.format === "regex") return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`;
8492 return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
8493 }
8494 case "not_multiple_of": return `Numero non valido: deve essere un multiplo di ${issue.divisor}`;
8495 case "unrecognized_keys": return `Chiav${issue.keys.length > 1 ? "i" : "e"} non riconosciut${issue.keys.length > 1 ? "e" : "a"}: ${joinValues(issue.keys, ", ")}`;
8496 case "invalid_key": return `Chiave non valida in ${issue.origin}`;
8497 case "invalid_union": return "Input non valido";
8498 case "invalid_element": return `Valore non valido in ${issue.origin}`;
8499 default: return `Input non valido`;
8500 }
8501 };
8502 }, "error");
8503 function it_default() {
8504 return { localeError: error$22() };
8505 }
8506 __name(it_default, "default");
8507
8508 //#endregion
8509 //#region node_modules/zod/v4/locales/ja.js
8510 var error$21 = /* @__PURE__ */ __name(() => {
8511 const Sizable = {
8512 string: {
8513 unit: "文字",
8514 verb: "である"
8515 },
8516 file: {
8517 unit: "バイト",
8518 verb: "である"
8519 },
8520 array: {
8521 unit: "要素",
8522 verb: "である"
8523 },
8524 set: {
8525 unit: "要素",
8526 verb: "である"
8527 }
8528 };
8529 function getSizing(origin) {
8530 return Sizable[origin] ?? null;
8531 }
8532 const parsedType = (data) => {
8533 const t = typeof data;
8534 switch (t) {
8535 case "number": return Number.isNaN(data) ? "NaN" : "数値";
8536 case "object":
8537 if (Array.isArray(data)) return "配列";
8538 if (data === null) return "null";
8539 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8540 }
8541 return t;
8542 };
8543 const Nouns = {
8544 regex: "入力値",
8545 email: "メールアドレス",
8546 url: "URL",
8547 emoji: "絵文字",
8548 uuid: "UUID",
8549 uuidv4: "UUIDv4",
8550 uuidv6: "UUIDv6",
8551 nanoid: "nanoid",
8552 guid: "GUID",
8553 cuid: "cuid",
8554 cuid2: "cuid2",
8555 ulid: "ULID",
8556 xid: "XID",
8557 ksuid: "KSUID",
8558 datetime: "ISO日時",
8559 date: "ISO日付",
8560 time: "ISO時刻",
8561 duration: "ISO期間",
8562 ipv4: "IPv4アドレス",
8563 ipv6: "IPv6アドレス",
8564 cidrv4: "IPv4範囲",
8565 cidrv6: "IPv6範囲",
8566 base64: "base64エンコード文字列",
8567 base64url: "base64urlエンコード文字列",
8568 json_string: "JSON文字列",
8569 e164: "E.164番号",
8570 jwt: "JWT",
8571 template_literal: "入力値"
8572 };
8573 return (issue) => {
8574 switch (issue.code) {
8575 case "invalid_type": return `無効な入力: ${issue.expected}が期待されましたが、${parsedType(issue.input)}が入力されました`;
8576 case "invalid_value":
8577 if (issue.values.length === 1) return `無効な入力: ${stringifyPrimitive(issue.values[0])}が期待されました`;
8578 return `無効な選択: ${joinValues(issue.values, "、")}のいずれかである必要があります`;
8579 case "too_big": {
8580 const adj = issue.inclusive ? "以下である" : "より小さい";
8581 const sizing = getSizing(issue.origin);
8582 if (sizing) return `大きすぎる値: ${issue.origin ?? "値"}は${issue.maximum.toString()}${sizing.unit ?? "要素"}${adj}必要があります`;
8583 return `大きすぎる値: ${issue.origin ?? "値"}は${issue.maximum.toString()}${adj}必要があります`;
8584 }
8585 case "too_small": {
8586 const adj = issue.inclusive ? "以上である" : "より大きい";
8587 const sizing = getSizing(issue.origin);
8588 if (sizing) return `小さすぎる値: ${issue.origin}は${issue.minimum.toString()}${sizing.unit}${adj}必要があります`;
8589 return `小さすぎる値: ${issue.origin}は${issue.minimum.toString()}${adj}必要があります`;
8590 }
8591 case "invalid_format": {
8592 const _issue = issue;
8593 if (_issue.format === "starts_with") return `無効な文字列: "${_issue.prefix}"で始まる必要があります`;
8594 if (_issue.format === "ends_with") return `無効な文字列: "${_issue.suffix}"で終わる必要があります`;
8595 if (_issue.format === "includes") return `無効な文字列: "${_issue.includes}"を含む必要があります`;
8596 if (_issue.format === "regex") return `無効な文字列: パターン${_issue.pattern}に一致する必要があります`;
8597 return `無効な${Nouns[_issue.format] ?? issue.format}`;
8598 }
8599 case "not_multiple_of": return `無効な数値: ${issue.divisor}の倍数である必要があります`;
8600 case "unrecognized_keys": return `認識されていないキー${issue.keys.length > 1 ? "群" : ""}: ${joinValues(issue.keys, "、")}`;
8601 case "invalid_key": return `${issue.origin}内の無効なキー`;
8602 case "invalid_union": return "無効な入力";
8603 case "invalid_element": return `${issue.origin}内の無効な値`;
8604 default: return `無効な入力`;
8605 }
8606 };
8607 }, "error");
8608 function ja_default() {
8609 return { localeError: error$21() };
8610 }
8611 __name(ja_default, "default");
8612
8613 //#endregion
8614 //#region node_modules/zod/v4/locales/kh.js
8615 var error$20 = /* @__PURE__ */ __name(() => {
8616 const Sizable = {
8617 string: {
8618 unit: "តួអក្សរ",
8619 verb: "គួរមាន"
8620 },
8621 file: {
8622 unit: "បៃ",
8623 verb: "គួរមាន"
8624 },
8625 array: {
8626 unit: "ធាតុ",
8627 verb: "គួរមាន"
8628 },
8629 set: {
8630 unit: "ធាតុ",
8631 verb: "គួរមាន"
8632 }
8633 };
8634 function getSizing(origin) {
8635 return Sizable[origin] ?? null;
8636 }
8637 const parsedType = (data) => {
8638 const t = typeof data;
8639 switch (t) {
8640 case "number": return Number.isNaN(data) ? "មិនមែនជាលេខ (NaN)" : "លេខ";
8641 case "object":
8642 if (Array.isArray(data)) return "អារេ (Array)";
8643 if (data === null) return "គ្មានតម្លៃ (null)";
8644 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8645 }
8646 return t;
8647 };
8648 const Nouns = {
8649 regex: "ទិន្នន័យបញ្ចូល",
8650 email: "អាសយដ្ឋានអ៊ីមែល",
8651 url: "URL",
8652 emoji: "សញ្ញាអារម្មណ៍",
8653 uuid: "UUID",
8654 uuidv4: "UUIDv4",
8655 uuidv6: "UUIDv6",
8656 nanoid: "nanoid",
8657 guid: "GUID",
8658 cuid: "cuid",
8659 cuid2: "cuid2",
8660 ulid: "ULID",
8661 xid: "XID",
8662 ksuid: "KSUID",
8663 datetime: "កាលបរិច្ឆេទ និងម៉ោង ISO",
8664 date: "កាលបរិច្ឆេទ ISO",
8665 time: "ម៉ោង ISO",
8666 duration: "រយៈពេល ISO",
8667 ipv4: "អាសយដ្ឋាន IPv4",
8668 ipv6: "អាសយដ្ឋាន IPv6",
8669 cidrv4: "ដែនអាសយដ្ឋាន IPv4",
8670 cidrv6: "ដែនអាសយដ្ឋាន IPv6",
8671 base64: "ខ្សែអក្សរអ៊ិកូដ base64",
8672 base64url: "ខ្សែអក្សរអ៊ិកូដ base64url",
8673 json_string: "ខ្សែអក្សរ JSON",
8674 e164: "លេខ E.164",
8675 jwt: "JWT",
8676 template_literal: "ទិន្នន័យបញ្ចូល"
8677 };
8678 return (issue) => {
8679 switch (issue.code) {
8680 case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue.expected} ប៉ុន្តែទទួលបាន ${parsedType(issue.input)}`;
8681 case "invalid_value":
8682 if (issue.values.length === 1) return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(issue.values[0])}`;
8683 return `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${joinValues(issue.values, "|")}`;
8684 case "too_big": {
8685 const adj = issue.inclusive ? "<=" : "<";
8686 const sizing = getSizing(issue.origin);
8687 if (sizing) return `ធំពេក៖ ត្រូវការ ${issue.origin ?? "តម្លៃ"} ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "ធាតុ"}`;
8688 return `ធំពេក៖ ត្រូវការ ${issue.origin ?? "តម្លៃ"} ${adj} ${issue.maximum.toString()}`;
8689 }
8690 case "too_small": {
8691 const adj = issue.inclusive ? ">=" : ">";
8692 const sizing = getSizing(issue.origin);
8693 if (sizing) return `តូចពេក៖ ត្រូវការ ${issue.origin} ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
8694 return `តូចពេក៖ ត្រូវការ ${issue.origin} ${adj} ${issue.minimum.toString()}`;
8695 }
8696 case "invalid_format": {
8697 const _issue = issue;
8698 if (_issue.format === "starts_with") return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${_issue.prefix}"`;
8699 if (_issue.format === "ends_with") return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${_issue.suffix}"`;
8700 if (_issue.format === "includes") return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${_issue.includes}"`;
8701 if (_issue.format === "regex") return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${_issue.pattern}`;
8702 return `មិនត្រឹមត្រូវ៖ ${Nouns[_issue.format] ?? issue.format}`;
8703 }
8704 case "not_multiple_of": return `លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${issue.divisor}`;
8705 case "unrecognized_keys": return `រកឃើញសោមិនស្គាល់៖ ${joinValues(issue.keys, ", ")}`;
8706 case "invalid_key": return `សោមិនត្រឹមត្រូវនៅក្នុង ${issue.origin}`;
8707 case "invalid_union": return `ទិន្នន័យមិនត្រឹមត្រូវ`;
8708 case "invalid_element": return `ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${issue.origin}`;
8709 default: return `ទិន្នន័យមិនត្រឹមត្រូវ`;
8710 }
8711 };
8712 }, "error");
8713 function kh_default() {
8714 return { localeError: error$20() };
8715 }
8716 __name(kh_default, "default");
8717
8718 //#endregion
8719 //#region node_modules/zod/v4/locales/ko.js
8720 var error$19 = /* @__PURE__ */ __name(() => {
8721 const Sizable = {
8722 string: {
8723 unit: "문자",
8724 verb: "to have"
8725 },
8726 file: {
8727 unit: "바이트",
8728 verb: "to have"
8729 },
8730 array: {
8731 unit: "개",
8732 verb: "to have"
8733 },
8734 set: {
8735 unit: "개",
8736 verb: "to have"
8737 }
8738 };
8739 function getSizing(origin) {
8740 return Sizable[origin] ?? null;
8741 }
8742 const parsedType = (data) => {
8743 const t = typeof data;
8744 switch (t) {
8745 case "number": return Number.isNaN(data) ? "NaN" : "number";
8746 case "object":
8747 if (Array.isArray(data)) return "array";
8748 if (data === null) return "null";
8749 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8750 }
8751 return t;
8752 };
8753 const Nouns = {
8754 regex: "입력",
8755 email: "이메일 주소",
8756 url: "URL",
8757 emoji: "이모지",
8758 uuid: "UUID",
8759 uuidv4: "UUIDv4",
8760 uuidv6: "UUIDv6",
8761 nanoid: "nanoid",
8762 guid: "GUID",
8763 cuid: "cuid",
8764 cuid2: "cuid2",
8765 ulid: "ULID",
8766 xid: "XID",
8767 ksuid: "KSUID",
8768 datetime: "ISO 날짜시간",
8769 date: "ISO 날짜",
8770 time: "ISO 시간",
8771 duration: "ISO 기간",
8772 ipv4: "IPv4 주소",
8773 ipv6: "IPv6 주소",
8774 cidrv4: "IPv4 범위",
8775 cidrv6: "IPv6 범위",
8776 base64: "base64 인코딩 문자열",
8777 base64url: "base64url 인코딩 문자열",
8778 json_string: "JSON 문자열",
8779 e164: "E.164 번호",
8780 jwt: "JWT",
8781 template_literal: "입력"
8782 };
8783 return (issue) => {
8784 switch (issue.code) {
8785 case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue.expected}, 받은 타입은 ${parsedType(issue.input)}입니다`;
8786 case "invalid_value":
8787 if (issue.values.length === 1) return `잘못된 입력: 값은 ${stringifyPrimitive(issue.values[0])} 이어야 합니다`;
8788 return `잘못된 옵션: ${joinValues(issue.values, "또는 ")} 중 하나여야 합니다`;
8789 case "too_big": {
8790 const adj = issue.inclusive ? "이하" : "미만";
8791 const suffix = adj === "미만" ? "이어야 합니다" : "여야 합니다";
8792 const sizing = getSizing(issue.origin);
8793 const unit = sizing?.unit ?? "요소";
8794 if (sizing) return `${issue.origin ?? "값"}이 너무 큽니다: ${issue.maximum.toString()}${unit} ${adj}${suffix}`;
8795 return `${issue.origin ?? "값"}이 너무 큽니다: ${issue.maximum.toString()} ${adj}${suffix}`;
8796 }
8797 case "too_small": {
8798 const adj = issue.inclusive ? "이상" : "초과";
8799 const suffix = adj === "이상" ? "이어야 합니다" : "여야 합니다";
8800 const sizing = getSizing(issue.origin);
8801 const unit = sizing?.unit ?? "요소";
8802 if (sizing) return `${issue.origin ?? "값"}이 너무 작습니다: ${issue.minimum.toString()}${unit} ${adj}${suffix}`;
8803 return `${issue.origin ?? "값"}이 너무 작습니다: ${issue.minimum.toString()} ${adj}${suffix}`;
8804 }
8805 case "invalid_format": {
8806 const _issue = issue;
8807 if (_issue.format === "starts_with") return `잘못된 문자열: "${_issue.prefix}"(으)로 시작해야 합니다`;
8808 if (_issue.format === "ends_with") return `잘못된 문자열: "${_issue.suffix}"(으)로 끝나야 합니다`;
8809 if (_issue.format === "includes") return `잘못된 문자열: "${_issue.includes}"을(를) 포함해야 합니다`;
8810 if (_issue.format === "regex") return `잘못된 문자열: 정규식 ${_issue.pattern} 패턴과 일치해야 합니다`;
8811 return `잘못된 ${Nouns[_issue.format] ?? issue.format}`;
8812 }
8813 case "not_multiple_of": return `잘못된 숫자: ${issue.divisor}의 배수여야 합니다`;
8814 case "unrecognized_keys": return `인식할 수 없는 키: ${joinValues(issue.keys, ", ")}`;
8815 case "invalid_key": return `잘못된 키: ${issue.origin}`;
8816 case "invalid_union": return `잘못된 입력`;
8817 case "invalid_element": return `잘못된 값: ${issue.origin}`;
8818 default: return `잘못된 입력`;
8819 }
8820 };
8821 }, "error");
8822 function ko_default() {
8823 return { localeError: error$19() };
8824 }
8825 __name(ko_default, "default");
8826
8827 //#endregion
8828 //#region node_modules/zod/v4/locales/mk.js
8829 var error$18 = /* @__PURE__ */ __name(() => {
8830 const Sizable = {
8831 string: {
8832 unit: "знаци",
8833 verb: "да имаат"
8834 },
8835 file: {
8836 unit: "бајти",
8837 verb: "да имаат"
8838 },
8839 array: {
8840 unit: "ставки",
8841 verb: "да имаат"
8842 },
8843 set: {
8844 unit: "ставки",
8845 verb: "да имаат"
8846 }
8847 };
8848 function getSizing(origin) {
8849 return Sizable[origin] ?? null;
8850 }
8851 const parsedType = (data) => {
8852 const t = typeof data;
8853 switch (t) {
8854 case "number": return Number.isNaN(data) ? "NaN" : "број";
8855 case "object":
8856 if (Array.isArray(data)) return "низа";
8857 if (data === null) return "null";
8858 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8859 }
8860 return t;
8861 };
8862 const Nouns = {
8863 regex: "внес",
8864 email: "адреса на е-пошта",
8865 url: "URL",
8866 emoji: "емоџи",
8867 uuid: "UUID",
8868 uuidv4: "UUIDv4",
8869 uuidv6: "UUIDv6",
8870 nanoid: "nanoid",
8871 guid: "GUID",
8872 cuid: "cuid",
8873 cuid2: "cuid2",
8874 ulid: "ULID",
8875 xid: "XID",
8876 ksuid: "KSUID",
8877 datetime: "ISO датум и време",
8878 date: "ISO датум",
8879 time: "ISO време",
8880 duration: "ISO времетраење",
8881 ipv4: "IPv4 адреса",
8882 ipv6: "IPv6 адреса",
8883 cidrv4: "IPv4 опсег",
8884 cidrv6: "IPv6 опсег",
8885 base64: "base64-енкодирана низа",
8886 base64url: "base64url-енкодирана низа",
8887 json_string: "JSON низа",
8888 e164: "E.164 број",
8889 jwt: "JWT",
8890 template_literal: "внес"
8891 };
8892 return (issue) => {
8893 switch (issue.code) {
8894 case "invalid_type": return `Грешен внес: се очекува ${issue.expected}, примено ${parsedType(issue.input)}`;
8895 case "invalid_value":
8896 if (issue.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
8897 return `Грешана опција: се очекува една ${joinValues(issue.values, "|")}`;
8898 case "too_big": {
8899 const adj = issue.inclusive ? "<=" : "<";
8900 const sizing = getSizing(issue.origin);
8901 if (sizing) return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да има ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементи"}`;
8902 return `Премногу голем: се очекува ${issue.origin ?? "вредноста"} да биде ${adj}${issue.maximum.toString()}`;
8903 }
8904 case "too_small": {
8905 const adj = issue.inclusive ? ">=" : ">";
8906 const sizing = getSizing(issue.origin);
8907 if (sizing) return `Премногу мал: се очекува ${issue.origin} да има ${adj}${issue.minimum.toString()} ${sizing.unit}`;
8908 return `Премногу мал: се очекува ${issue.origin} да биде ${adj}${issue.minimum.toString()}`;
8909 }
8910 case "invalid_format": {
8911 const _issue = issue;
8912 if (_issue.format === "starts_with") return `Неважечка низа: мора да започнува со "${_issue.prefix}"`;
8913 if (_issue.format === "ends_with") return `Неважечка низа: мора да завршува со "${_issue.suffix}"`;
8914 if (_issue.format === "includes") return `Неважечка низа: мора да вклучува "${_issue.includes}"`;
8915 if (_issue.format === "regex") return `Неважечка низа: мора да одгоара на патернот ${_issue.pattern}`;
8916 return `Invalid ${Nouns[_issue.format] ?? issue.format}`;
8917 }
8918 case "not_multiple_of": return `Грешен број: мора да биде делив со ${issue.divisor}`;
8919 case "unrecognized_keys": return `${issue.keys.length > 1 ? "Непрепознаени клучеви" : "Непрепознаен клуч"}: ${joinValues(issue.keys, ", ")}`;
8920 case "invalid_key": return `Грешен клуч во ${issue.origin}`;
8921 case "invalid_union": return "Грешен внес";
8922 case "invalid_element": return `Грешна вредност во ${issue.origin}`;
8923 default: return `Грешен внес`;
8924 }
8925 };
8926 }, "error");
8927 function mk_default() {
8928 return { localeError: error$18() };
8929 }
8930 __name(mk_default, "default");
8931
8932 //#endregion
8933 //#region node_modules/zod/v4/locales/ms.js
8934 var error$17 = /* @__PURE__ */ __name(() => {
8935 const Sizable = {
8936 string: {
8937 unit: "aksara",
8938 verb: "mempunyai"
8939 },
8940 file: {
8941 unit: "bait",
8942 verb: "mempunyai"
8943 },
8944 array: {
8945 unit: "elemen",
8946 verb: "mempunyai"
8947 },
8948 set: {
8949 unit: "elemen",
8950 verb: "mempunyai"
8951 }
8952 };
8953 function getSizing(origin) {
8954 return Sizable[origin] ?? null;
8955 }
8956 const parsedType = (data) => {
8957 const t = typeof data;
8958 switch (t) {
8959 case "number": return Number.isNaN(data) ? "NaN" : "nombor";
8960 case "object":
8961 if (Array.isArray(data)) return "array";
8962 if (data === null) return "null";
8963 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
8964 }
8965 return t;
8966 };
8967 const Nouns = {
8968 regex: "input",
8969 email: "alamat e-mel",
8970 url: "URL",
8971 emoji: "emoji",
8972 uuid: "UUID",
8973 uuidv4: "UUIDv4",
8974 uuidv6: "UUIDv6",
8975 nanoid: "nanoid",
8976 guid: "GUID",
8977 cuid: "cuid",
8978 cuid2: "cuid2",
8979 ulid: "ULID",
8980 xid: "XID",
8981 ksuid: "KSUID",
8982 datetime: "tarikh masa ISO",
8983 date: "tarikh ISO",
8984 time: "masa ISO",
8985 duration: "tempoh ISO",
8986 ipv4: "alamat IPv4",
8987 ipv6: "alamat IPv6",
8988 cidrv4: "julat IPv4",
8989 cidrv6: "julat IPv6",
8990 base64: "string dikodkan base64",
8991 base64url: "string dikodkan base64url",
8992 json_string: "string JSON",
8993 e164: "nombor E.164",
8994 jwt: "JWT",
8995 template_literal: "input"
8996 };
8997 return (issue) => {
8998 switch (issue.code) {
8999 case "invalid_type": return `Input tidak sah: dijangka ${issue.expected}, diterima ${parsedType(issue.input)}`;
9000 case "invalid_value":
9001 if (issue.values.length === 1) return `Input tidak sah: dijangka ${stringifyPrimitive(issue.values[0])}`;
9002 return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue.values, "|")}`;
9003 case "too_big": {
9004 const adj = issue.inclusive ? "<=" : "<";
9005 const sizing = getSizing(issue.origin);
9006 if (sizing) return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
9007 return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} adalah ${adj}${issue.maximum.toString()}`;
9008 }
9009 case "too_small": {
9010 const adj = issue.inclusive ? ">=" : ">";
9011 const sizing = getSizing(issue.origin);
9012 if (sizing) return `Terlalu kecil: dijangka ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
9013 return `Terlalu kecil: dijangka ${issue.origin} adalah ${adj}${issue.minimum.toString()}`;
9014 }
9015 case "invalid_format": {
9016 const _issue = issue;
9017 if (_issue.format === "starts_with") return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`;
9018 if (_issue.format === "ends_with") return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`;
9019 if (_issue.format === "includes") return `String tidak sah: mesti mengandungi "${_issue.includes}"`;
9020 if (_issue.format === "regex") return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`;
9021 return `${Nouns[_issue.format] ?? issue.format} tidak sah`;
9022 }
9023 case "not_multiple_of": return `Nombor tidak sah: perlu gandaan ${issue.divisor}`;
9024 case "unrecognized_keys": return `Kunci tidak dikenali: ${joinValues(issue.keys, ", ")}`;
9025 case "invalid_key": return `Kunci tidak sah dalam ${issue.origin}`;
9026 case "invalid_union": return "Input tidak sah";
9027 case "invalid_element": return `Nilai tidak sah dalam ${issue.origin}`;
9028 default: return `Input tidak sah`;
9029 }
9030 };
9031 }, "error");
9032 function ms_default() {
9033 return { localeError: error$17() };
9034 }
9035 __name(ms_default, "default");
9036
9037 //#endregion
9038 //#region node_modules/zod/v4/locales/nl.js
9039 var error$16 = /* @__PURE__ */ __name(() => {
9040 const Sizable = {
9041 string: { unit: "tekens" },
9042 file: { unit: "bytes" },
9043 array: { unit: "elementen" },
9044 set: { unit: "elementen" }
9045 };
9046 function getSizing(origin) {
9047 return Sizable[origin] ?? null;
9048 }
9049 const parsedType = (data) => {
9050 const t = typeof data;
9051 switch (t) {
9052 case "number": return Number.isNaN(data) ? "NaN" : "getal";
9053 case "object":
9054 if (Array.isArray(data)) return "array";
9055 if (data === null) return "null";
9056 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9057 }
9058 return t;
9059 };
9060 const Nouns = {
9061 regex: "invoer",
9062 email: "emailadres",
9063 url: "URL",
9064 emoji: "emoji",
9065 uuid: "UUID",
9066 uuidv4: "UUIDv4",
9067 uuidv6: "UUIDv6",
9068 nanoid: "nanoid",
9069 guid: "GUID",
9070 cuid: "cuid",
9071 cuid2: "cuid2",
9072 ulid: "ULID",
9073 xid: "XID",
9074 ksuid: "KSUID",
9075 datetime: "ISO datum en tijd",
9076 date: "ISO datum",
9077 time: "ISO tijd",
9078 duration: "ISO duur",
9079 ipv4: "IPv4-adres",
9080 ipv6: "IPv6-adres",
9081 cidrv4: "IPv4-bereik",
9082 cidrv6: "IPv6-bereik",
9083 base64: "base64-gecodeerde tekst",
9084 base64url: "base64 URL-gecodeerde tekst",
9085 json_string: "JSON string",
9086 e164: "E.164-nummer",
9087 jwt: "JWT",
9088 template_literal: "invoer"
9089 };
9090 return (issue) => {
9091 switch (issue.code) {
9092 case "invalid_type": return `Ongeldige invoer: verwacht ${issue.expected}, ontving ${parsedType(issue.input)}`;
9093 case "invalid_value":
9094 if (issue.values.length === 1) return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue.values[0])}`;
9095 return `Ongeldige optie: verwacht één van ${joinValues(issue.values, "|")}`;
9096 case "too_big": {
9097 const adj = issue.inclusive ? "<=" : "<";
9098 const sizing = getSizing(issue.origin);
9099 if (sizing) return `Te lang: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementen"} bevat`;
9100 return `Te lang: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} is`;
9101 }
9102 case "too_small": {
9103 const adj = issue.inclusive ? ">=" : ">";
9104 const sizing = getSizing(issue.origin);
9105 if (sizing) return `Te kort: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} bevat`;
9106 return `Te kort: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} is`;
9107 }
9108 case "invalid_format": {
9109 const _issue = issue;
9110 if (_issue.format === "starts_with") return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`;
9111 if (_issue.format === "ends_with") return `Ongeldige tekst: moet op "${_issue.suffix}" eindigen`;
9112 if (_issue.format === "includes") return `Ongeldige tekst: moet "${_issue.includes}" bevatten`;
9113 if (_issue.format === "regex") return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`;
9114 return `Ongeldig: ${Nouns[_issue.format] ?? issue.format}`;
9115 }
9116 case "not_multiple_of": return `Ongeldig getal: moet een veelvoud van ${issue.divisor} zijn`;
9117 case "unrecognized_keys": return `Onbekende key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
9118 case "invalid_key": return `Ongeldige key in ${issue.origin}`;
9119 case "invalid_union": return "Ongeldige invoer";
9120 case "invalid_element": return `Ongeldige waarde in ${issue.origin}`;
9121 default: return `Ongeldige invoer`;
9122 }
9123 };
9124 }, "error");
9125 function nl_default() {
9126 return { localeError: error$16() };
9127 }
9128 __name(nl_default, "default");
9129
9130 //#endregion
9131 //#region node_modules/zod/v4/locales/no.js
9132 var error$15 = /* @__PURE__ */ __name(() => {
9133 const Sizable = {
9134 string: {
9135 unit: "tegn",
9136 verb: "å ha"
9137 },
9138 file: {
9139 unit: "bytes",
9140 verb: "å ha"
9141 },
9142 array: {
9143 unit: "elementer",
9144 verb: "å inneholde"
9145 },
9146 set: {
9147 unit: "elementer",
9148 verb: "å inneholde"
9149 }
9150 };
9151 function getSizing(origin) {
9152 return Sizable[origin] ?? null;
9153 }
9154 const parsedType = (data) => {
9155 const t = typeof data;
9156 switch (t) {
9157 case "number": return Number.isNaN(data) ? "NaN" : "tall";
9158 case "object":
9159 if (Array.isArray(data)) return "liste";
9160 if (data === null) return "null";
9161 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9162 }
9163 return t;
9164 };
9165 const Nouns = {
9166 regex: "input",
9167 email: "e-postadresse",
9168 url: "URL",
9169 emoji: "emoji",
9170 uuid: "UUID",
9171 uuidv4: "UUIDv4",
9172 uuidv6: "UUIDv6",
9173 nanoid: "nanoid",
9174 guid: "GUID",
9175 cuid: "cuid",
9176 cuid2: "cuid2",
9177 ulid: "ULID",
9178 xid: "XID",
9179 ksuid: "KSUID",
9180 datetime: "ISO dato- og klokkeslett",
9181 date: "ISO-dato",
9182 time: "ISO-klokkeslett",
9183 duration: "ISO-varighet",
9184 ipv4: "IPv4-område",
9185 ipv6: "IPv6-område",
9186 cidrv4: "IPv4-spekter",
9187 cidrv6: "IPv6-spekter",
9188 base64: "base64-enkodet streng",
9189 base64url: "base64url-enkodet streng",
9190 json_string: "JSON-streng",
9191 e164: "E.164-nummer",
9192 jwt: "JWT",
9193 template_literal: "input"
9194 };
9195 return (issue) => {
9196 switch (issue.code) {
9197 case "invalid_type": return `Ugyldig input: forventet ${issue.expected}, fikk ${parsedType(issue.input)}`;
9198 case "invalid_value":
9199 if (issue.values.length === 1) return `Ugyldig verdi: forventet ${stringifyPrimitive(issue.values[0])}`;
9200 return `Ugyldig valg: forventet en av ${joinValues(issue.values, "|")}`;
9201 case "too_big": {
9202 const adj = issue.inclusive ? "<=" : "<";
9203 const sizing = getSizing(issue.origin);
9204 if (sizing) return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
9205 return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()}`;
9206 }
9207 case "too_small": {
9208 const adj = issue.inclusive ? ">=" : ">";
9209 const sizing = getSizing(issue.origin);
9210 if (sizing) return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
9211 return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()}`;
9212 }
9213 case "invalid_format": {
9214 const _issue = issue;
9215 if (_issue.format === "starts_with") return `Ugyldig streng: må starte med "${_issue.prefix}"`;
9216 if (_issue.format === "ends_with") return `Ugyldig streng: må ende med "${_issue.suffix}"`;
9217 if (_issue.format === "includes") return `Ugyldig streng: må inneholde "${_issue.includes}"`;
9218 if (_issue.format === "regex") return `Ugyldig streng: må matche mønsteret ${_issue.pattern}`;
9219 return `Ugyldig ${Nouns[_issue.format] ?? issue.format}`;
9220 }
9221 case "not_multiple_of": return `Ugyldig tall: må være et multiplum av ${issue.divisor}`;
9222 case "unrecognized_keys": return `${issue.keys.length > 1 ? "Ukjente nøkler" : "Ukjent nøkkel"}: ${joinValues(issue.keys, ", ")}`;
9223 case "invalid_key": return `Ugyldig nøkkel i ${issue.origin}`;
9224 case "invalid_union": return "Ugyldig input";
9225 case "invalid_element": return `Ugyldig verdi i ${issue.origin}`;
9226 default: return `Ugyldig input`;
9227 }
9228 };
9229 }, "error");
9230 function no_default() {
9231 return { localeError: error$15() };
9232 }
9233 __name(no_default, "default");
9234
9235 //#endregion
9236 //#region node_modules/zod/v4/locales/ota.js
9237 var error$14 = /* @__PURE__ */ __name(() => {
9238 const Sizable = {
9239 string: {
9240 unit: "harf",
9241 verb: "olmalıdır"
9242 },
9243 file: {
9244 unit: "bayt",
9245 verb: "olmalıdır"
9246 },
9247 array: {
9248 unit: "unsur",
9249 verb: "olmalıdır"
9250 },
9251 set: {
9252 unit: "unsur",
9253 verb: "olmalıdır"
9254 }
9255 };
9256 function getSizing(origin) {
9257 return Sizable[origin] ?? null;
9258 }
9259 const parsedType = (data) => {
9260 const t = typeof data;
9261 switch (t) {
9262 case "number": return Number.isNaN(data) ? "NaN" : "numara";
9263 case "object":
9264 if (Array.isArray(data)) return "saf";
9265 if (data === null) return "gayb";
9266 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9267 }
9268 return t;
9269 };
9270 const Nouns = {
9271 regex: "giren",
9272 email: "epostagâh",
9273 url: "URL",
9274 emoji: "emoji",
9275 uuid: "UUID",
9276 uuidv4: "UUIDv4",
9277 uuidv6: "UUIDv6",
9278 nanoid: "nanoid",
9279 guid: "GUID",
9280 cuid: "cuid",
9281 cuid2: "cuid2",
9282 ulid: "ULID",
9283 xid: "XID",
9284 ksuid: "KSUID",
9285 datetime: "ISO hengâmı",
9286 date: "ISO tarihi",
9287 time: "ISO zamanı",
9288 duration: "ISO müddeti",
9289 ipv4: "IPv4 nişânı",
9290 ipv6: "IPv6 nişânı",
9291 cidrv4: "IPv4 menzili",
9292 cidrv6: "IPv6 menzili",
9293 base64: "base64-şifreli metin",
9294 base64url: "base64url-şifreli metin",
9295 json_string: "JSON metin",
9296 e164: "E.164 sayısı",
9297 jwt: "JWT",
9298 template_literal: "giren"
9299 };
9300 return (issue) => {
9301 switch (issue.code) {
9302 case "invalid_type": return `Fâsit giren: umulan ${issue.expected}, alınan ${parsedType(issue.input)}`;
9303 case "invalid_value":
9304 if (issue.values.length === 1) return `Fâsit giren: umulan ${stringifyPrimitive(issue.values[0])}`;
9305 return `Fâsit tercih: mûteberler ${joinValues(issue.values, "|")}`;
9306 case "too_big": {
9307 const adj = issue.inclusive ? "<=" : "<";
9308 const sizing = getSizing(issue.origin);
9309 if (sizing) return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmalıydı.`;
9310 return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} olmalıydı.`;
9311 }
9312 case "too_small": {
9313 const adj = issue.inclusive ? ">=" : ">";
9314 const sizing = getSizing(issue.origin);
9315 if (sizing) return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} ${sizing.unit} sahip olmalıydı.`;
9316 return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} olmalıydı.`;
9317 }
9318 case "invalid_format": {
9319 const _issue = issue;
9320 if (_issue.format === "starts_with") return `Fâsit metin: "${_issue.prefix}" ile başlamalı.`;
9321 if (_issue.format === "ends_with") return `Fâsit metin: "${_issue.suffix}" ile bitmeli.`;
9322 if (_issue.format === "includes") return `Fâsit metin: "${_issue.includes}" ihtivâ etmeli.`;
9323 if (_issue.format === "regex") return `Fâsit metin: ${_issue.pattern} nakşına uymalı.`;
9324 return `Fâsit ${Nouns[_issue.format] ?? issue.format}`;
9325 }
9326 case "not_multiple_of": return `Fâsit sayı: ${issue.divisor} katı olmalıydı.`;
9327 case "unrecognized_keys": return `Tanınmayan anahtar ${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
9328 case "invalid_key": return `${issue.origin} için tanınmayan anahtar var.`;
9329 case "invalid_union": return "Giren tanınamadı.";
9330 case "invalid_element": return `${issue.origin} için tanınmayan kıymet var.`;
9331 default: return `Kıymet tanınamadı.`;
9332 }
9333 };
9334 }, "error");
9335 function ota_default() {
9336 return { localeError: error$14() };
9337 }
9338 __name(ota_default, "default");
9339
9340 //#endregion
9341 //#region node_modules/zod/v4/locales/ps.js
9342 var error$13 = /* @__PURE__ */ __name(() => {
9343 const Sizable = {
9344 string: {
9345 unit: "توکي",
9346 verb: "ولري"
9347 },
9348 file: {
9349 unit: "بایټس",
9350 verb: "ولري"
9351 },
9352 array: {
9353 unit: "توکي",
9354 verb: "ولري"
9355 },
9356 set: {
9357 unit: "توکي",
9358 verb: "ولري"
9359 }
9360 };
9361 function getSizing(origin) {
9362 return Sizable[origin] ?? null;
9363 }
9364 const parsedType = (data) => {
9365 const t = typeof data;
9366 switch (t) {
9367 case "number": return Number.isNaN(data) ? "NaN" : "عدد";
9368 case "object":
9369 if (Array.isArray(data)) return "ارې";
9370 if (data === null) return "null";
9371 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9372 }
9373 return t;
9374 };
9375 const Nouns = {
9376 regex: "ورودي",
9377 email: "بریښنالیک",
9378 url: "یو آر ال",
9379 emoji: "ایموجي",
9380 uuid: "UUID",
9381 uuidv4: "UUIDv4",
9382 uuidv6: "UUIDv6",
9383 nanoid: "nanoid",
9384 guid: "GUID",
9385 cuid: "cuid",
9386 cuid2: "cuid2",
9387 ulid: "ULID",
9388 xid: "XID",
9389 ksuid: "KSUID",
9390 datetime: "نیټه او وخت",
9391 date: "نېټه",
9392 time: "وخت",
9393 duration: "موده",
9394 ipv4: "د IPv4 پته",
9395 ipv6: "د IPv6 پته",
9396 cidrv4: "د IPv4 ساحه",
9397 cidrv6: "د IPv6 ساحه",
9398 base64: "base64-encoded متن",
9399 base64url: "base64url-encoded متن",
9400 json_string: "JSON متن",
9401 e164: "د E.164 شمېره",
9402 jwt: "JWT",
9403 template_literal: "ورودي"
9404 };
9405 return (issue) => {
9406 switch (issue.code) {
9407 case "invalid_type": return `ناسم ورودي: باید ${issue.expected} وای, مګر ${parsedType(issue.input)} ترلاسه شو`;
9408 case "invalid_value":
9409 if (issue.values.length === 1) return `ناسم ورودي: باید ${stringifyPrimitive(issue.values[0])} وای`;
9410 return `ناسم انتخاب: باید یو له ${joinValues(issue.values, "|")} څخه وای`;
9411 case "too_big": {
9412 const adj = issue.inclusive ? "<=" : "<";
9413 const sizing = getSizing(issue.origin);
9414 if (sizing) return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
9415 return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} وي`;
9416 }
9417 case "too_small": {
9418 const adj = issue.inclusive ? ">=" : ">";
9419 const sizing = getSizing(issue.origin);
9420 if (sizing) return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} ولري`;
9421 return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} وي`;
9422 }
9423 case "invalid_format": {
9424 const _issue = issue;
9425 if (_issue.format === "starts_with") return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
9426 if (_issue.format === "ends_with") return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
9427 if (_issue.format === "includes") return `ناسم متن: باید "${_issue.includes}" ولري`;
9428 if (_issue.format === "regex") return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
9429 return `${Nouns[_issue.format] ?? issue.format} ناسم دی`;
9430 }
9431 case "not_multiple_of": return `ناسم عدد: باید د ${issue.divisor} مضرب وي`;
9432 case "unrecognized_keys": return `ناسم ${issue.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${joinValues(issue.keys, ", ")}`;
9433 case "invalid_key": return `ناسم کلیډ په ${issue.origin} کې`;
9434 case "invalid_union": return `ناسمه ورودي`;
9435 case "invalid_element": return `ناسم عنصر په ${issue.origin} کې`;
9436 default: return `ناسمه ورودي`;
9437 }
9438 };
9439 }, "error");
9440 function ps_default() {
9441 return { localeError: error$13() };
9442 }
9443 __name(ps_default, "default");
9444
9445 //#endregion
9446 //#region node_modules/zod/v4/locales/pl.js
9447 var error$12 = /* @__PURE__ */ __name(() => {
9448 const Sizable = {
9449 string: {
9450 unit: "znaków",
9451 verb: "mieć"
9452 },
9453 file: {
9454 unit: "bajtów",
9455 verb: "mieć"
9456 },
9457 array: {
9458 unit: "elementów",
9459 verb: "mieć"
9460 },
9461 set: {
9462 unit: "elementów",
9463 verb: "mieć"
9464 }
9465 };
9466 function getSizing(origin) {
9467 return Sizable[origin] ?? null;
9468 }
9469 const parsedType = (data) => {
9470 const t = typeof data;
9471 switch (t) {
9472 case "number": return Number.isNaN(data) ? "NaN" : "liczba";
9473 case "object":
9474 if (Array.isArray(data)) return "tablica";
9475 if (data === null) return "null";
9476 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9477 }
9478 return t;
9479 };
9480 const Nouns = {
9481 regex: "wyrażenie",
9482 email: "adres email",
9483 url: "URL",
9484 emoji: "emoji",
9485 uuid: "UUID",
9486 uuidv4: "UUIDv4",
9487 uuidv6: "UUIDv6",
9488 nanoid: "nanoid",
9489 guid: "GUID",
9490 cuid: "cuid",
9491 cuid2: "cuid2",
9492 ulid: "ULID",
9493 xid: "XID",
9494 ksuid: "KSUID",
9495 datetime: "data i godzina w formacie ISO",
9496 date: "data w formacie ISO",
9497 time: "godzina w formacie ISO",
9498 duration: "czas trwania ISO",
9499 ipv4: "adres IPv4",
9500 ipv6: "adres IPv6",
9501 cidrv4: "zakres IPv4",
9502 cidrv6: "zakres IPv6",
9503 base64: "ciąg znaków zakodowany w formacie base64",
9504 base64url: "ciąg znaków zakodowany w formacie base64url",
9505 json_string: "ciąg znaków w formacie JSON",
9506 e164: "liczba E.164",
9507 jwt: "JWT",
9508 template_literal: "wejście"
9509 };
9510 return (issue) => {
9511 switch (issue.code) {
9512 case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue.expected}, otrzymano ${parsedType(issue.input)}`;
9513 case "invalid_value":
9514 if (issue.values.length === 1) return `Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(issue.values[0])}`;
9515 return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${joinValues(issue.values, "|")}`;
9516 case "too_big": {
9517 const adj = issue.inclusive ? "<=" : "<";
9518 const sizing = getSizing(issue.origin);
9519 if (sizing) return `Za duża wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementów"}`;
9520 return `Zbyt duż(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.maximum.toString()}`;
9521 }
9522 case "too_small": {
9523 const adj = issue.inclusive ? ">=" : ">";
9524 const sizing = getSizing(issue.origin);
9525 if (sizing) return `Za mała wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.minimum.toString()} ${sizing.unit ?? "elementów"}`;
9526 return `Zbyt mał(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.minimum.toString()}`;
9527 }
9528 case "invalid_format": {
9529 const _issue = issue;
9530 if (_issue.format === "starts_with") return `Nieprawidłowy ciąg znaków: musi zaczynać się od "${_issue.prefix}"`;
9531 if (_issue.format === "ends_with") return `Nieprawidłowy ciąg znaków: musi kończyć się na "${_issue.suffix}"`;
9532 if (_issue.format === "includes") return `Nieprawidłowy ciąg znaków: musi zawierać "${_issue.includes}"`;
9533 if (_issue.format === "regex") return `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${_issue.pattern}`;
9534 return `Nieprawidłow(y/a/e) ${Nouns[_issue.format] ?? issue.format}`;
9535 }
9536 case "not_multiple_of": return `Nieprawidłowa liczba: musi być wielokrotnością ${issue.divisor}`;
9537 case "unrecognized_keys": return `Nierozpoznane klucze${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
9538 case "invalid_key": return `Nieprawidłowy klucz w ${issue.origin}`;
9539 case "invalid_union": return "Nieprawidłowe dane wejściowe";
9540 case "invalid_element": return `Nieprawidłowa wartość w ${issue.origin}`;
9541 default: return `Nieprawidłowe dane wejściowe`;
9542 }
9543 };
9544 }, "error");
9545 function pl_default() {
9546 return { localeError: error$12() };
9547 }
9548 __name(pl_default, "default");
9549
9550 //#endregion
9551 //#region node_modules/zod/v4/locales/pt.js
9552 var error$11 = /* @__PURE__ */ __name(() => {
9553 const Sizable = {
9554 string: {
9555 unit: "caracteres",
9556 verb: "ter"
9557 },
9558 file: {
9559 unit: "bytes",
9560 verb: "ter"
9561 },
9562 array: {
9563 unit: "itens",
9564 verb: "ter"
9565 },
9566 set: {
9567 unit: "itens",
9568 verb: "ter"
9569 }
9570 };
9571 function getSizing(origin) {
9572 return Sizable[origin] ?? null;
9573 }
9574 const parsedType = (data) => {
9575 const t = typeof data;
9576 switch (t) {
9577 case "number": return Number.isNaN(data) ? "NaN" : "número";
9578 case "object":
9579 if (Array.isArray(data)) return "array";
9580 if (data === null) return "nulo";
9581 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9582 }
9583 return t;
9584 };
9585 const Nouns = {
9586 regex: "padrão",
9587 email: "endereço de e-mail",
9588 url: "URL",
9589 emoji: "emoji",
9590 uuid: "UUID",
9591 uuidv4: "UUIDv4",
9592 uuidv6: "UUIDv6",
9593 nanoid: "nanoid",
9594 guid: "GUID",
9595 cuid: "cuid",
9596 cuid2: "cuid2",
9597 ulid: "ULID",
9598 xid: "XID",
9599 ksuid: "KSUID",
9600 datetime: "data e hora ISO",
9601 date: "data ISO",
9602 time: "hora ISO",
9603 duration: "duração ISO",
9604 ipv4: "endereço IPv4",
9605 ipv6: "endereço IPv6",
9606 cidrv4: "faixa de IPv4",
9607 cidrv6: "faixa de IPv6",
9608 base64: "texto codificado em base64",
9609 base64url: "URL codificada em base64",
9610 json_string: "texto JSON",
9611 e164: "número E.164",
9612 jwt: "JWT",
9613 template_literal: "entrada"
9614 };
9615 return (issue) => {
9616 switch (issue.code) {
9617 case "invalid_type": return `Tipo inválido: esperado ${issue.expected}, recebido ${parsedType(issue.input)}`;
9618 case "invalid_value":
9619 if (issue.values.length === 1) return `Entrada inválida: esperado ${stringifyPrimitive(issue.values[0])}`;
9620 return `Opção inválida: esperada uma das ${joinValues(issue.values, "|")}`;
9621 case "too_big": {
9622 const adj = issue.inclusive ? "<=" : "<";
9623 const sizing = getSizing(issue.origin);
9624 if (sizing) return `Muito grande: esperado que ${issue.origin ?? "valor"} tivesse ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
9625 return `Muito grande: esperado que ${issue.origin ?? "valor"} fosse ${adj}${issue.maximum.toString()}`;
9626 }
9627 case "too_small": {
9628 const adj = issue.inclusive ? ">=" : ">";
9629 const sizing = getSizing(issue.origin);
9630 if (sizing) return `Muito pequeno: esperado que ${issue.origin} tivesse ${adj}${issue.minimum.toString()} ${sizing.unit}`;
9631 return `Muito pequeno: esperado que ${issue.origin} fosse ${adj}${issue.minimum.toString()}`;
9632 }
9633 case "invalid_format": {
9634 const _issue = issue;
9635 if (_issue.format === "starts_with") return `Texto inválido: deve começar com "${_issue.prefix}"`;
9636 if (_issue.format === "ends_with") return `Texto inválido: deve terminar com "${_issue.suffix}"`;
9637 if (_issue.format === "includes") return `Texto inválido: deve incluir "${_issue.includes}"`;
9638 if (_issue.format === "regex") return `Texto inválido: deve corresponder ao padrão ${_issue.pattern}`;
9639 return `${Nouns[_issue.format] ?? issue.format} inválido`;
9640 }
9641 case "not_multiple_of": return `Número inválido: deve ser múltiplo de ${issue.divisor}`;
9642 case "unrecognized_keys": return `Chave${issue.keys.length > 1 ? "s" : ""} desconhecida${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
9643 case "invalid_key": return `Chave inválida em ${issue.origin}`;
9644 case "invalid_union": return "Entrada inválida";
9645 case "invalid_element": return `Valor inválido em ${issue.origin}`;
9646 default: return `Campo inválido`;
9647 }
9648 };
9649 }, "error");
9650 function pt_default() {
9651 return { localeError: error$11() };
9652 }
9653 __name(pt_default, "default");
9654
9655 //#endregion
9656 //#region node_modules/zod/v4/locales/ru.js
9657 function getRussianPlural(count, one, few, many) {
9658 const absCount = Math.abs(count);
9659 const lastDigit = absCount % 10;
9660 const lastTwoDigits = absCount % 100;
9661 if (lastTwoDigits >= 11 && lastTwoDigits <= 19) return many;
9662 if (lastDigit === 1) return one;
9663 if (lastDigit >= 2 && lastDigit <= 4) return few;
9664 return many;
9665 }
9666 var error$10 = /* @__PURE__ */ __name(() => {
9667 const Sizable = {
9668 string: {
9669 unit: {
9670 one: "символ",
9671 few: "символа",
9672 many: "символов"
9673 },
9674 verb: "иметь"
9675 },
9676 file: {
9677 unit: {
9678 one: "байт",
9679 few: "байта",
9680 many: "байт"
9681 },
9682 verb: "иметь"
9683 },
9684 array: {
9685 unit: {
9686 one: "элемент",
9687 few: "элемента",
9688 many: "элементов"
9689 },
9690 verb: "иметь"
9691 },
9692 set: {
9693 unit: {
9694 one: "элемент",
9695 few: "элемента",
9696 many: "элементов"
9697 },
9698 verb: "иметь"
9699 }
9700 };
9701 function getSizing(origin) {
9702 return Sizable[origin] ?? null;
9703 }
9704 const parsedType = (data) => {
9705 const t = typeof data;
9706 switch (t) {
9707 case "number": return Number.isNaN(data) ? "NaN" : "число";
9708 case "object":
9709 if (Array.isArray(data)) return "массив";
9710 if (data === null) return "null";
9711 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9712 }
9713 return t;
9714 };
9715 const Nouns = {
9716 regex: "ввод",
9717 email: "email адрес",
9718 url: "URL",
9719 emoji: "эмодзи",
9720 uuid: "UUID",
9721 uuidv4: "UUIDv4",
9722 uuidv6: "UUIDv6",
9723 nanoid: "nanoid",
9724 guid: "GUID",
9725 cuid: "cuid",
9726 cuid2: "cuid2",
9727 ulid: "ULID",
9728 xid: "XID",
9729 ksuid: "KSUID",
9730 datetime: "ISO дата и время",
9731 date: "ISO дата",
9732 time: "ISO время",
9733 duration: "ISO длительность",
9734 ipv4: "IPv4 адрес",
9735 ipv6: "IPv6 адрес",
9736 cidrv4: "IPv4 диапазон",
9737 cidrv6: "IPv6 диапазон",
9738 base64: "строка в формате base64",
9739 base64url: "строка в формате base64url",
9740 json_string: "JSON строка",
9741 e164: "номер E.164",
9742 jwt: "JWT",
9743 template_literal: "ввод"
9744 };
9745 return (issue) => {
9746 switch (issue.code) {
9747 case "invalid_type": return `Неверный ввод: ожидалось ${issue.expected}, получено ${parsedType(issue.input)}`;
9748 case "invalid_value":
9749 if (issue.values.length === 1) return `Неверный ввод: ожидалось ${stringifyPrimitive(issue.values[0])}`;
9750 return `Неверный вариант: ожидалось одно из ${joinValues(issue.values, "|")}`;
9751 case "too_big": {
9752 const adj = issue.inclusive ? "<=" : "<";
9753 const sizing = getSizing(issue.origin);
9754 if (sizing) {
9755 const unit = getRussianPlural(Number(issue.maximum), sizing.unit.one, sizing.unit.few, sizing.unit.many);
9756 return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
9757 }
9758 return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
9759 }
9760 case "too_small": {
9761 const adj = issue.inclusive ? ">=" : ">";
9762 const sizing = getSizing(issue.origin);
9763 if (sizing) {
9764 const unit = getRussianPlural(Number(issue.minimum), sizing.unit.one, sizing.unit.few, sizing.unit.many);
9765 return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
9766 }
9767 return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
9768 }
9769 case "invalid_format": {
9770 const _issue = issue;
9771 if (_issue.format === "starts_with") return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
9772 if (_issue.format === "ends_with") return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
9773 if (_issue.format === "includes") return `Неверная строка: должна содержать "${_issue.includes}"`;
9774 if (_issue.format === "regex") return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
9775 return `Неверный ${Nouns[_issue.format] ?? issue.format}`;
9776 }
9777 case "not_multiple_of": return `Неверное число: должно быть кратным ${issue.divisor}`;
9778 case "unrecognized_keys": return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${joinValues(issue.keys, ", ")}`;
9779 case "invalid_key": return `Неверный ключ в ${issue.origin}`;
9780 case "invalid_union": return "Неверные входные данные";
9781 case "invalid_element": return `Неверное значение в ${issue.origin}`;
9782 default: return `Неверные входные данные`;
9783 }
9784 };
9785 }, "error");
9786 function ru_default() {
9787 return { localeError: error$10() };
9788 }
9789 __name(ru_default, "default");
9790
9791 //#endregion
9792 //#region node_modules/zod/v4/locales/sl.js
9793 var error$9 = /* @__PURE__ */ __name(() => {
9794 const Sizable = {
9795 string: {
9796 unit: "znakov",
9797 verb: "imeti"
9798 },
9799 file: {
9800 unit: "bajtov",
9801 verb: "imeti"
9802 },
9803 array: {
9804 unit: "elementov",
9805 verb: "imeti"
9806 },
9807 set: {
9808 unit: "elementov",
9809 verb: "imeti"
9810 }
9811 };
9812 function getSizing(origin) {
9813 return Sizable[origin] ?? null;
9814 }
9815 const parsedType = (data) => {
9816 const t = typeof data;
9817 switch (t) {
9818 case "number": return Number.isNaN(data) ? "NaN" : "število";
9819 case "object":
9820 if (Array.isArray(data)) return "tabela";
9821 if (data === null) return "null";
9822 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9823 }
9824 return t;
9825 };
9826 const Nouns = {
9827 regex: "vnos",
9828 email: "e-poštni naslov",
9829 url: "URL",
9830 emoji: "emoji",
9831 uuid: "UUID",
9832 uuidv4: "UUIDv4",
9833 uuidv6: "UUIDv6",
9834 nanoid: "nanoid",
9835 guid: "GUID",
9836 cuid: "cuid",
9837 cuid2: "cuid2",
9838 ulid: "ULID",
9839 xid: "XID",
9840 ksuid: "KSUID",
9841 datetime: "ISO datum in čas",
9842 date: "ISO datum",
9843 time: "ISO čas",
9844 duration: "ISO trajanje",
9845 ipv4: "IPv4 naslov",
9846 ipv6: "IPv6 naslov",
9847 cidrv4: "obseg IPv4",
9848 cidrv6: "obseg IPv6",
9849 base64: "base64 kodiran niz",
9850 base64url: "base64url kodiran niz",
9851 json_string: "JSON niz",
9852 e164: "E.164 številka",
9853 jwt: "JWT",
9854 template_literal: "vnos"
9855 };
9856 return (issue) => {
9857 switch (issue.code) {
9858 case "invalid_type": return `Neveljaven vnos: pričakovano ${issue.expected}, prejeto ${parsedType(issue.input)}`;
9859 case "invalid_value":
9860 if (issue.values.length === 1) return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue.values[0])}`;
9861 return `Neveljavna možnost: pričakovano eno izmed ${joinValues(issue.values, "|")}`;
9862 case "too_big": {
9863 const adj = issue.inclusive ? "<=" : "<";
9864 const sizing = getSizing(issue.origin);
9865 if (sizing) return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
9866 return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
9867 }
9868 case "too_small": {
9869 const adj = issue.inclusive ? ">=" : ">";
9870 const sizing = getSizing(issue.origin);
9871 if (sizing) return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
9872 return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
9873 }
9874 case "invalid_format": {
9875 const _issue = issue;
9876 if (_issue.format === "starts_with") return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
9877 if (_issue.format === "ends_with") return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
9878 if (_issue.format === "includes") return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
9879 if (_issue.format === "regex") return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
9880 return `Neveljaven ${Nouns[_issue.format] ?? issue.format}`;
9881 }
9882 case "not_multiple_of": return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
9883 case "unrecognized_keys": return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${joinValues(issue.keys, ", ")}`;
9884 case "invalid_key": return `Neveljaven ključ v ${issue.origin}`;
9885 case "invalid_union": return "Neveljaven vnos";
9886 case "invalid_element": return `Neveljavna vrednost v ${issue.origin}`;
9887 default: return "Neveljaven vnos";
9888 }
9889 };
9890 }, "error");
9891 function sl_default() {
9892 return { localeError: error$9() };
9893 }
9894 __name(sl_default, "default");
9895
9896 //#endregion
9897 //#region node_modules/zod/v4/locales/sv.js
9898 var error$8 = /* @__PURE__ */ __name(() => {
9899 const Sizable = {
9900 string: {
9901 unit: "tecken",
9902 verb: "att ha"
9903 },
9904 file: {
9905 unit: "bytes",
9906 verb: "att ha"
9907 },
9908 array: {
9909 unit: "objekt",
9910 verb: "att innehålla"
9911 },
9912 set: {
9913 unit: "objekt",
9914 verb: "att innehålla"
9915 }
9916 };
9917 function getSizing(origin) {
9918 return Sizable[origin] ?? null;
9919 }
9920 const parsedType = (data) => {
9921 const t = typeof data;
9922 switch (t) {
9923 case "number": return Number.isNaN(data) ? "NaN" : "antal";
9924 case "object":
9925 if (Array.isArray(data)) return "lista";
9926 if (data === null) return "null";
9927 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
9928 }
9929 return t;
9930 };
9931 const Nouns = {
9932 regex: "reguljärt uttryck",
9933 email: "e-postadress",
9934 url: "URL",
9935 emoji: "emoji",
9936 uuid: "UUID",
9937 uuidv4: "UUIDv4",
9938 uuidv6: "UUIDv6",
9939 nanoid: "nanoid",
9940 guid: "GUID",
9941 cuid: "cuid",
9942 cuid2: "cuid2",
9943 ulid: "ULID",
9944 xid: "XID",
9945 ksuid: "KSUID",
9946 datetime: "ISO-datum och tid",
9947 date: "ISO-datum",
9948 time: "ISO-tid",
9949 duration: "ISO-varaktighet",
9950 ipv4: "IPv4-intervall",
9951 ipv6: "IPv6-intervall",
9952 cidrv4: "IPv4-spektrum",
9953 cidrv6: "IPv6-spektrum",
9954 base64: "base64-kodad sträng",
9955 base64url: "base64url-kodad sträng",
9956 json_string: "JSON-sträng",
9957 e164: "E.164-nummer",
9958 jwt: "JWT",
9959 template_literal: "mall-literal"
9960 };
9961 return (issue) => {
9962 switch (issue.code) {
9963 case "invalid_type": return `Ogiltig inmatning: förväntat ${issue.expected}, fick ${parsedType(issue.input)}`;
9964 case "invalid_value":
9965 if (issue.values.length === 1) return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue.values[0])}`;
9966 return `Ogiltigt val: förväntade en av ${joinValues(issue.values, "|")}`;
9967 case "too_big": {
9968 const adj = issue.inclusive ? "<=" : "<";
9969 const sizing = getSizing(issue.origin);
9970 if (sizing) return `För stor(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
9971 return `För stor(t): förväntat ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()}`;
9972 }
9973 case "too_small": {
9974 const adj = issue.inclusive ? ">=" : ">";
9975 const sizing = getSizing(issue.origin);
9976 if (sizing) return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
9977 return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()}`;
9978 }
9979 case "invalid_format": {
9980 const _issue = issue;
9981 if (_issue.format === "starts_with") return `Ogiltig sträng: måste börja med "${_issue.prefix}"`;
9982 if (_issue.format === "ends_with") return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`;
9983 if (_issue.format === "includes") return `Ogiltig sträng: måste innehålla "${_issue.includes}"`;
9984 if (_issue.format === "regex") return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`;
9985 return `Ogiltig(t) ${Nouns[_issue.format] ?? issue.format}`;
9986 }
9987 case "not_multiple_of": return `Ogiltigt tal: måste vara en multipel av ${issue.divisor}`;
9988 case "unrecognized_keys": return `${issue.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${joinValues(issue.keys, ", ")}`;
9989 case "invalid_key": return `Ogiltig nyckel i ${issue.origin ?? "värdet"}`;
9990 case "invalid_union": return "Ogiltig input";
9991 case "invalid_element": return `Ogiltigt värde i ${issue.origin ?? "värdet"}`;
9992 default: return `Ogiltig input`;
9993 }
9994 };
9995 }, "error");
9996 function sv_default() {
9997 return { localeError: error$8() };
9998 }
9999 __name(sv_default, "default");
10000
10001 //#endregion
10002 //#region node_modules/zod/v4/locales/ta.js
10003 var error$7 = /* @__PURE__ */ __name(() => {
10004 const Sizable = {
10005 string: {
10006 unit: "எழுத்துக்கள்",
10007 verb: "கொண்டிருக்க வேண்டும்"
10008 },
10009 file: {
10010 unit: "பைட்டுகள்",
10011 verb: "கொண்டிருக்க வேண்டும்"
10012 },
10013 array: {
10014 unit: "உறுப்புகள்",
10015 verb: "கொண்டிருக்க வேண்டும்"
10016 },
10017 set: {
10018 unit: "உறுப்புகள்",
10019 verb: "கொண்டிருக்க வேண்டும்"
10020 }
10021 };
10022 function getSizing(origin) {
10023 return Sizable[origin] ?? null;
10024 }
10025 const parsedType = (data) => {
10026 const t = typeof data;
10027 switch (t) {
10028 case "number": return Number.isNaN(data) ? "எண் அல்லாதது" : "எண்";
10029 case "object":
10030 if (Array.isArray(data)) return "அணி";
10031 if (data === null) return "வெறுமை";
10032 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
10033 }
10034 return t;
10035 };
10036 const Nouns = {
10037 regex: "உள்ளீடு",
10038 email: "மின்னஞ்சல் முகவரி",
10039 url: "URL",
10040 emoji: "emoji",
10041 uuid: "UUID",
10042 uuidv4: "UUIDv4",
10043 uuidv6: "UUIDv6",
10044 nanoid: "nanoid",
10045 guid: "GUID",
10046 cuid: "cuid",
10047 cuid2: "cuid2",
10048 ulid: "ULID",
10049 xid: "XID",
10050 ksuid: "KSUID",
10051 datetime: "ISO தேதி நேரம்",
10052 date: "ISO தேதி",
10053 time: "ISO நேரம்",
10054 duration: "ISO கால அளவு",
10055 ipv4: "IPv4 முகவரி",
10056 ipv6: "IPv6 முகவரி",
10057 cidrv4: "IPv4 வரம்பு",
10058 cidrv6: "IPv6 வரம்பு",
10059 base64: "base64-encoded சரம்",
10060 base64url: "base64url-encoded சரம்",
10061 json_string: "JSON சரம்",
10062 e164: "E.164 எண்",
10063 jwt: "JWT",
10064 template_literal: "input"
10065 };
10066 return (issue) => {
10067 switch (issue.code) {
10068 case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue.expected}, பெறப்பட்டது ${parsedType(issue.input)}`;
10069 case "invalid_value":
10070 if (issue.values.length === 1) return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(issue.values[0])}`;
10071 return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${joinValues(issue.values, "|")} இல் ஒன்று`;
10072 case "too_big": {
10073 const adj = issue.inclusive ? "<=" : "<";
10074 const sizing = getSizing(issue.origin);
10075 if (sizing) return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "உறுப்புகள்"} ஆக இருக்க வேண்டும்`;
10076 return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue.origin ?? "மதிப்பு"} ${adj}${issue.maximum.toString()} ஆக இருக்க வேண்டும்`;
10077 }
10078 case "too_small": {
10079 const adj = issue.inclusive ? ">=" : ">";
10080 const sizing = getSizing(issue.origin);
10081 if (sizing) return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} ஆக இருக்க வேண்டும்`;
10082 return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue.origin} ${adj}${issue.minimum.toString()} ஆக இருக்க வேண்டும்`;
10083 }
10084 case "invalid_format": {
10085 const _issue = issue;
10086 if (_issue.format === "starts_with") return `தவறான சரம்: "${_issue.prefix}" இல் தொடங்க வேண்டும்`;
10087 if (_issue.format === "ends_with") return `தவறான சரம்: "${_issue.suffix}" இல் முடிவடைய வேண்டும்`;
10088 if (_issue.format === "includes") return `தவறான சரம்: "${_issue.includes}" ஐ உள்ளடக்க வேண்டும்`;
10089 if (_issue.format === "regex") return `தவறான சரம்: ${_issue.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;
10090 return `தவறான ${Nouns[_issue.format] ?? issue.format}`;
10091 }
10092 case "not_multiple_of": return `தவறான எண்: ${issue.divisor} இன் பலமாக இருக்க வேண்டும்`;
10093 case "unrecognized_keys": return `அடையாளம் தெரியாத விசை${issue.keys.length > 1 ? "கள்" : ""}: ${joinValues(issue.keys, ", ")}`;
10094 case "invalid_key": return `${issue.origin} இல் தவறான விசை`;
10095 case "invalid_union": return "தவறான உள்ளீடு";
10096 case "invalid_element": return `${issue.origin} இல் தவறான மதிப்பு`;
10097 default: return `தவறான உள்ளீடு`;
10098 }
10099 };
10100 }, "error");
10101 function ta_default() {
10102 return { localeError: error$7() };
10103 }
10104 __name(ta_default, "default");
10105
10106 //#endregion
10107 //#region node_modules/zod/v4/locales/th.js
10108 var error$6 = /* @__PURE__ */ __name(() => {
10109 const Sizable = {
10110 string: {
10111 unit: "ตัวอักษร",
10112 verb: "ควรมี"
10113 },
10114 file: {
10115 unit: "ไบต์",
10116 verb: "ควรมี"
10117 },
10118 array: {
10119 unit: "รายการ",
10120 verb: "ควรมี"
10121 },
10122 set: {
10123 unit: "รายการ",
10124 verb: "ควรมี"
10125 }
10126 };
10127 function getSizing(origin) {
10128 return Sizable[origin] ?? null;
10129 }
10130 const parsedType = (data) => {
10131 const t = typeof data;
10132 switch (t) {
10133 case "number": return Number.isNaN(data) ? "ไม่ใช่ตัวเลข (NaN)" : "ตัวเลข";
10134 case "object":
10135 if (Array.isArray(data)) return "อาร์เรย์ (Array)";
10136 if (data === null) return "ไม่มีค่า (null)";
10137 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
10138 }
10139 return t;
10140 };
10141 const Nouns = {
10142 regex: "ข้อมูลที่ป้อน",
10143 email: "ที่อยู่อีเมล",
10144 url: "URL",
10145 emoji: "อิโมจิ",
10146 uuid: "UUID",
10147 uuidv4: "UUIDv4",
10148 uuidv6: "UUIDv6",
10149 nanoid: "nanoid",
10150 guid: "GUID",
10151 cuid: "cuid",
10152 cuid2: "cuid2",
10153 ulid: "ULID",
10154 xid: "XID",
10155 ksuid: "KSUID",
10156 datetime: "วันที่เวลาแบบ ISO",
10157 date: "วันที่แบบ ISO",
10158 time: "เวลาแบบ ISO",
10159 duration: "ช่วงเวลาแบบ ISO",
10160 ipv4: "ที่อยู่ IPv4",
10161 ipv6: "ที่อยู่ IPv6",
10162 cidrv4: "ช่วง IP แบบ IPv4",
10163 cidrv6: "ช่วง IP แบบ IPv6",
10164 base64: "ข้อความแบบ Base64",
10165 base64url: "ข้อความแบบ Base64 สำหรับ URL",
10166 json_string: "ข้อความแบบ JSON",
10167 e164: "เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",
10168 jwt: "โทเคน JWT",
10169 template_literal: "ข้อมูลที่ป้อน"
10170 };
10171 return (issue) => {
10172 switch (issue.code) {
10173 case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue.expected} แต่ได้รับ ${parsedType(issue.input)}`;
10174 case "invalid_value":
10175 if (issue.values.length === 1) return `ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(issue.values[0])}`;
10176 return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${joinValues(issue.values, "|")}`;
10177 case "too_big": {
10178 const adj = issue.inclusive ? "ไม่เกิน" : "น้อยกว่า";
10179 const sizing = getSizing(issue.origin);
10180 if (sizing) return `เกินกำหนด: ${issue.origin ?? "ค่า"} ควรมี${adj} ${issue.maximum.toString()} ${sizing.unit ?? "รายการ"}`;
10181 return `เกินกำหนด: ${issue.origin ?? "ค่า"} ควรมี${adj} ${issue.maximum.toString()}`;
10182 }
10183 case "too_small": {
10184 const adj = issue.inclusive ? "อย่างน้อย" : "มากกว่า";
10185 const sizing = getSizing(issue.origin);
10186 if (sizing) return `น้อยกว่ากำหนด: ${issue.origin} ควรมี${adj} ${issue.minimum.toString()} ${sizing.unit}`;
10187 return `น้อยกว่ากำหนด: ${issue.origin} ควรมี${adj} ${issue.minimum.toString()}`;
10188 }
10189 case "invalid_format": {
10190 const _issue = issue;
10191 if (_issue.format === "starts_with") return `รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${_issue.prefix}"`;
10192 if (_issue.format === "ends_with") return `รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${_issue.suffix}"`;
10193 if (_issue.format === "includes") return `รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${_issue.includes}" อยู่ในข้อความ`;
10194 if (_issue.format === "regex") return `รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${_issue.pattern}`;
10195 return `รูปแบบไม่ถูกต้อง: ${Nouns[_issue.format] ?? issue.format}`;
10196 }
10197 case "not_multiple_of": return `ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${issue.divisor} ได้ลงตัว`;
10198 case "unrecognized_keys": return `พบคีย์ที่ไม่รู้จัก: ${joinValues(issue.keys, ", ")}`;
10199 case "invalid_key": return `คีย์ไม่ถูกต้องใน ${issue.origin}`;
10200 case "invalid_union": return "ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";
10201 case "invalid_element": return `ข้อมูลไม่ถูกต้องใน ${issue.origin}`;
10202 default: return `ข้อมูลไม่ถูกต้อง`;
10203 }
10204 };
10205 }, "error");
10206 function th_default() {
10207 return { localeError: error$6() };
10208 }
10209 __name(th_default, "default");
10210
10211 //#endregion
10212 //#region node_modules/zod/v4/locales/tr.js
10213 var parsedType = (data) => {
10214 const t = typeof data;
10215 switch (t) {
10216 case "number": return Number.isNaN(data) ? "NaN" : "number";
10217 case "object":
10218 if (Array.isArray(data)) return "array";
10219 if (data === null) return "null";
10220 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
10221 }
10222 return t;
10223 };
10224 var error$5 = /* @__PURE__ */ __name(() => {
10225 const Sizable = {
10226 string: {
10227 unit: "karakter",
10228 verb: "olmalı"
10229 },
10230 file: {
10231 unit: "bayt",
10232 verb: "olmalı"
10233 },
10234 array: {
10235 unit: "öğe",
10236 verb: "olmalı"
10237 },
10238 set: {
10239 unit: "öğe",
10240 verb: "olmalı"
10241 }
10242 };
10243 function getSizing(origin) {
10244 return Sizable[origin] ?? null;
10245 }
10246 const Nouns = {
10247 regex: "girdi",
10248 email: "e-posta adresi",
10249 url: "URL",
10250 emoji: "emoji",
10251 uuid: "UUID",
10252 uuidv4: "UUIDv4",
10253 uuidv6: "UUIDv6",
10254 nanoid: "nanoid",
10255 guid: "GUID",
10256 cuid: "cuid",
10257 cuid2: "cuid2",
10258 ulid: "ULID",
10259 xid: "XID",
10260 ksuid: "KSUID",
10261 datetime: "ISO tarih ve saat",
10262 date: "ISO tarih",
10263 time: "ISO saat",
10264 duration: "ISO süre",
10265 ipv4: "IPv4 adresi",
10266 ipv6: "IPv6 adresi",
10267 cidrv4: "IPv4 aralığı",
10268 cidrv6: "IPv6 aralığı",
10269 base64: "base64 ile şifrelenmiş metin",
10270 base64url: "base64url ile şifrelenmiş metin",
10271 json_string: "JSON dizesi",
10272 e164: "E.164 sayısı",
10273 jwt: "JWT",
10274 template_literal: "Şablon dizesi"
10275 };
10276 return (issue) => {
10277 switch (issue.code) {
10278 case "invalid_type": return `Geçersiz değer: beklenen ${issue.expected}, alınan ${parsedType(issue.input)}`;
10279 case "invalid_value":
10280 if (issue.values.length === 1) return `Geçersiz değer: beklenen ${stringifyPrimitive(issue.values[0])}`;
10281 return `Geçersiz seçenek: aşağıdakilerden biri olmalı: ${joinValues(issue.values, "|")}`;
10282 case "too_big": {
10283 const adj = issue.inclusive ? "<=" : "<";
10284 const sizing = getSizing(issue.origin);
10285 if (sizing) return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "öğe"}`;
10286 return `Çok büyük: beklenen ${issue.origin ?? "değer"} ${adj}${issue.maximum.toString()}`;
10287 }
10288 case "too_small": {
10289 const adj = issue.inclusive ? ">=" : ">";
10290 const sizing = getSizing(issue.origin);
10291 if (sizing) return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
10292 return `Çok küçük: beklenen ${issue.origin} ${adj}${issue.minimum.toString()}`;
10293 }
10294 case "invalid_format": {
10295 const _issue = issue;
10296 if (_issue.format === "starts_with") return `Geçersiz metin: "${_issue.prefix}" ile başlamalı`;
10297 if (_issue.format === "ends_with") return `Geçersiz metin: "${_issue.suffix}" ile bitmeli`;
10298 if (_issue.format === "includes") return `Geçersiz metin: "${_issue.includes}" içermeli`;
10299 if (_issue.format === "regex") return `Geçersiz metin: ${_issue.pattern} desenine uymalı`;
10300 return `Geçersiz ${Nouns[_issue.format] ?? issue.format}`;
10301 }
10302 case "not_multiple_of": return `Geçersiz sayı: ${issue.divisor} ile tam bölünebilmeli`;
10303 case "unrecognized_keys": return `Tanınmayan anahtar${issue.keys.length > 1 ? "lar" : ""}: ${joinValues(issue.keys, ", ")}`;
10304 case "invalid_key": return `${issue.origin} içinde geçersiz anahtar`;
10305 case "invalid_union": return "Geçersiz değer";
10306 case "invalid_element": return `${issue.origin} içinde geçersiz değer`;
10307 default: return `Geçersiz değer`;
10308 }
10309 };
10310 }, "error");
10311 function tr_default() {
10312 return { localeError: error$5() };
10313 }
10314 __name(tr_default, "default");
10315
10316 //#endregion
10317 //#region node_modules/zod/v4/locales/ua.js
10318 var error$4 = /* @__PURE__ */ __name(() => {
10319 const Sizable = {
10320 string: {
10321 unit: "символів",
10322 verb: "матиме"
10323 },
10324 file: {
10325 unit: "байтів",
10326 verb: "матиме"
10327 },
10328 array: {
10329 unit: "елементів",
10330 verb: "матиме"
10331 },
10332 set: {
10333 unit: "елементів",
10334 verb: "матиме"
10335 }
10336 };
10337 function getSizing(origin) {
10338 return Sizable[origin] ?? null;
10339 }
10340 const parsedType = (data) => {
10341 const t = typeof data;
10342 switch (t) {
10343 case "number": return Number.isNaN(data) ? "NaN" : "число";
10344 case "object":
10345 if (Array.isArray(data)) return "масив";
10346 if (data === null) return "null";
10347 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
10348 }
10349 return t;
10350 };
10351 const Nouns = {
10352 regex: "вхідні дані",
10353 email: "адреса електронної пошти",
10354 url: "URL",
10355 emoji: "емодзі",
10356 uuid: "UUID",
10357 uuidv4: "UUIDv4",
10358 uuidv6: "UUIDv6",
10359 nanoid: "nanoid",
10360 guid: "GUID",
10361 cuid: "cuid",
10362 cuid2: "cuid2",
10363 ulid: "ULID",
10364 xid: "XID",
10365 ksuid: "KSUID",
10366 datetime: "дата та час ISO",
10367 date: "дата ISO",
10368 time: "час ISO",
10369 duration: "тривалість ISO",
10370 ipv4: "адреса IPv4",
10371 ipv6: "адреса IPv6",
10372 cidrv4: "діапазон IPv4",
10373 cidrv6: "діапазон IPv6",
10374 base64: "рядок у кодуванні base64",
10375 base64url: "рядок у кодуванні base64url",
10376 json_string: "рядок JSON",
10377 e164: "номер E.164",
10378 jwt: "JWT",
10379 template_literal: "вхідні дані"
10380 };
10381 return (issue) => {
10382 switch (issue.code) {
10383 case "invalid_type": return `Неправильні вхідні дані: очікується ${issue.expected}, отримано ${parsedType(issue.input)}`;
10384 case "invalid_value":
10385 if (issue.values.length === 1) return `Неправильні вхідні дані: очікується ${stringifyPrimitive(issue.values[0])}`;
10386 return `Неправильна опція: очікується одне з ${joinValues(issue.values, "|")}`;
10387 case "too_big": {
10388 const adj = issue.inclusive ? "<=" : "<";
10389 const sizing = getSizing(issue.origin);
10390 if (sizing) return `Занадто велике: очікується, що ${issue.origin ?? "значення"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "елементів"}`;
10391 return `Занадто велике: очікується, що ${issue.origin ?? "значення"} буде ${adj}${issue.maximum.toString()}`;
10392 }
10393 case "too_small": {
10394 const adj = issue.inclusive ? ">=" : ">";
10395 const sizing = getSizing(issue.origin);
10396 if (sizing) return `Занадто мале: очікується, що ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
10397 return `Занадто мале: очікується, що ${issue.origin} буде ${adj}${issue.minimum.toString()}`;
10398 }
10399 case "invalid_format": {
10400 const _issue = issue;
10401 if (_issue.format === "starts_with") return `Неправильний рядок: повинен починатися з "${_issue.prefix}"`;
10402 if (_issue.format === "ends_with") return `Неправильний рядок: повинен закінчуватися на "${_issue.suffix}"`;
10403 if (_issue.format === "includes") return `Неправильний рядок: повинен містити "${_issue.includes}"`;
10404 if (_issue.format === "regex") return `Неправильний рядок: повинен відповідати шаблону ${_issue.pattern}`;
10405 return `Неправильний ${Nouns[_issue.format] ?? issue.format}`;
10406 }
10407 case "not_multiple_of": return `Неправильне число: повинно бути кратним ${issue.divisor}`;
10408 case "unrecognized_keys": return `Нерозпізнаний ключ${issue.keys.length > 1 ? "і" : ""}: ${joinValues(issue.keys, ", ")}`;
10409 case "invalid_key": return `Неправильний ключ у ${issue.origin}`;
10410 case "invalid_union": return "Неправильні вхідні дані";
10411 case "invalid_element": return `Неправильне значення у ${issue.origin}`;
10412 default: return `Неправильні вхідні дані`;
10413 }
10414 };
10415 }, "error");
10416 function ua_default() {
10417 return { localeError: error$4() };
10418 }
10419 __name(ua_default, "default");
10420
10421 //#endregion
10422 //#region node_modules/zod/v4/locales/ur.js
10423 var error$3 = /* @__PURE__ */ __name(() => {
10424 const Sizable = {
10425 string: {
10426 unit: "حروف",
10427 verb: "ہونا"
10428 },
10429 file: {
10430 unit: "بائٹس",
10431 verb: "ہونا"
10432 },
10433 array: {
10434 unit: "آئٹمز",
10435 verb: "ہونا"
10436 },
10437 set: {
10438 unit: "آئٹمز",
10439 verb: "ہونا"
10440 }
10441 };
10442 function getSizing(origin) {
10443 return Sizable[origin] ?? null;
10444 }
10445 const parsedType = (data) => {
10446 const t = typeof data;
10447 switch (t) {
10448 case "number": return Number.isNaN(data) ? "NaN" : "نمبر";
10449 case "object":
10450 if (Array.isArray(data)) return "آرے";
10451 if (data === null) return "نل";
10452 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
10453 }
10454 return t;
10455 };
10456 const Nouns = {
10457 regex: "ان پٹ",
10458 email: "ای میل ایڈریس",
10459 url: "یو آر ایل",
10460 emoji: "ایموجی",
10461 uuid: "یو یو آئی ڈی",
10462 uuidv4: "یو یو آئی ڈی وی 4",
10463 uuidv6: "یو یو آئی ڈی وی 6",
10464 nanoid: "نینو آئی ڈی",
10465 guid: "جی یو آئی ڈی",
10466 cuid: "سی یو آئی ڈی",
10467 cuid2: "سی یو آئی ڈی 2",
10468 ulid: "یو ایل آئی ڈی",
10469 xid: "ایکس آئی ڈی",
10470 ksuid: "کے ایس یو آئی ڈی",
10471 datetime: "آئی ایس او ڈیٹ ٹائم",
10472 date: "آئی ایس او تاریخ",
10473 time: "آئی ایس او وقت",
10474 duration: "آئی ایس او مدت",
10475 ipv4: "آئی پی وی 4 ایڈریس",
10476 ipv6: "آئی پی وی 6 ایڈریس",
10477 cidrv4: "آئی پی وی 4 رینج",
10478 cidrv6: "آئی پی وی 6 رینج",
10479 base64: "بیس 64 ان کوڈڈ سٹرنگ",
10480 base64url: "بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",
10481 json_string: "جے ایس او این سٹرنگ",
10482 e164: "ای 164 نمبر",
10483 jwt: "جے ڈبلیو ٹی",
10484 template_literal: "ان پٹ"
10485 };
10486 return (issue) => {
10487 switch (issue.code) {
10488 case "invalid_type": return `غلط ان پٹ: ${issue.expected} متوقع تھا، ${parsedType(issue.input)} موصول ہوا`;
10489 case "invalid_value":
10490 if (issue.values.length === 1) return `غلط ان پٹ: ${stringifyPrimitive(issue.values[0])} متوقع تھا`;
10491 return `غلط آپشن: ${joinValues(issue.values, "|")} میں سے ایک متوقع تھا`;
10492 case "too_big": {
10493 const adj = issue.inclusive ? "<=" : "<";
10494 const sizing = getSizing(issue.origin);
10495 if (sizing) return `بہت بڑا: ${issue.origin ?? "ویلیو"} کے ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عناصر"} ہونے متوقع تھے`;
10496 return `بہت بڑا: ${issue.origin ?? "ویلیو"} کا ${adj}${issue.maximum.toString()} ہونا متوقع تھا`;
10497 }
10498 case "too_small": {
10499 const adj = issue.inclusive ? ">=" : ">";
10500 const sizing = getSizing(issue.origin);
10501 if (sizing) return `بہت چھوٹا: ${issue.origin} کے ${adj}${issue.minimum.toString()} ${sizing.unit} ہونے متوقع تھے`;
10502 return `بہت چھوٹا: ${issue.origin} کا ${adj}${issue.minimum.toString()} ہونا متوقع تھا`;
10503 }
10504 case "invalid_format": {
10505 const _issue = issue;
10506 if (_issue.format === "starts_with") return `غلط سٹرنگ: "${_issue.prefix}" سے شروع ہونا چاہیے`;
10507 if (_issue.format === "ends_with") return `غلط سٹرنگ: "${_issue.suffix}" پر ختم ہونا چاہیے`;
10508 if (_issue.format === "includes") return `غلط سٹرنگ: "${_issue.includes}" شامل ہونا چاہیے`;
10509 if (_issue.format === "regex") return `غلط سٹرنگ: پیٹرن ${_issue.pattern} سے میچ ہونا چاہیے`;
10510 return `غلط ${Nouns[_issue.format] ?? issue.format}`;
10511 }
10512 case "not_multiple_of": return `غلط نمبر: ${issue.divisor} کا مضاعف ہونا چاہیے`;
10513 case "unrecognized_keys": return `غیر تسلیم شدہ کی${issue.keys.length > 1 ? "ز" : ""}: ${joinValues(issue.keys, "، ")}`;
10514 case "invalid_key": return `${issue.origin} میں غلط کی`;
10515 case "invalid_union": return "غلط ان پٹ";
10516 case "invalid_element": return `${issue.origin} میں غلط ویلیو`;
10517 default: return `غلط ان پٹ`;
10518 }
10519 };
10520 }, "error");
10521 function ur_default() {
10522 return { localeError: error$3() };
10523 }
10524 __name(ur_default, "default");
10525
10526 //#endregion
10527 //#region node_modules/zod/v4/locales/vi.js
10528 var error$2 = /* @__PURE__ */ __name(() => {
10529 const Sizable = {
10530 string: {
10531 unit: "ký tự",
10532 verb: "có"
10533 },
10534 file: {
10535 unit: "byte",
10536 verb: "có"
10537 },
10538 array: {
10539 unit: "phần tử",
10540 verb: "có"
10541 },
10542 set: {
10543 unit: "phần tử",
10544 verb: "có"
10545 }
10546 };
10547 function getSizing(origin) {
10548 return Sizable[origin] ?? null;
10549 }
10550 const parsedType = (data) => {
10551 const t = typeof data;
10552 switch (t) {
10553 case "number": return Number.isNaN(data) ? "NaN" : "số";
10554 case "object":
10555 if (Array.isArray(data)) return "mảng";
10556 if (data === null) return "null";
10557 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
10558 }
10559 return t;
10560 };
10561 const Nouns = {
10562 regex: "đầu vào",
10563 email: "địa chỉ email",
10564 url: "URL",
10565 emoji: "emoji",
10566 uuid: "UUID",
10567 uuidv4: "UUIDv4",
10568 uuidv6: "UUIDv6",
10569 nanoid: "nanoid",
10570 guid: "GUID",
10571 cuid: "cuid",
10572 cuid2: "cuid2",
10573 ulid: "ULID",
10574 xid: "XID",
10575 ksuid: "KSUID",
10576 datetime: "ngày giờ ISO",
10577 date: "ngày ISO",
10578 time: "giờ ISO",
10579 duration: "khoảng thời gian ISO",
10580 ipv4: "địa chỉ IPv4",
10581 ipv6: "địa chỉ IPv6",
10582 cidrv4: "dải IPv4",
10583 cidrv6: "dải IPv6",
10584 base64: "chuỗi mã hóa base64",
10585 base64url: "chuỗi mã hóa base64url",
10586 json_string: "chuỗi JSON",
10587 e164: "số E.164",
10588 jwt: "JWT",
10589 template_literal: "đầu vào"
10590 };
10591 return (issue) => {
10592 switch (issue.code) {
10593 case "invalid_type": return `Đầu vào không hợp lệ: mong đợi ${issue.expected}, nhận được ${parsedType(issue.input)}`;
10594 case "invalid_value":
10595 if (issue.values.length === 1) return `Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(issue.values[0])}`;
10596 return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${joinValues(issue.values, "|")}`;
10597 case "too_big": {
10598 const adj = issue.inclusive ? "<=" : "<";
10599 const sizing = getSizing(issue.origin);
10600 if (sizing) return `Quá lớn: mong đợi ${issue.origin ?? "giá trị"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "phần tử"}`;
10601 return `Quá lớn: mong đợi ${issue.origin ?? "giá trị"} ${adj}${issue.maximum.toString()}`;
10602 }
10603 case "too_small": {
10604 const adj = issue.inclusive ? ">=" : ">";
10605 const sizing = getSizing(issue.origin);
10606 if (sizing) return `Quá nhỏ: mong đợi ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
10607 return `Quá nhỏ: mong đợi ${issue.origin} ${adj}${issue.minimum.toString()}`;
10608 }
10609 case "invalid_format": {
10610 const _issue = issue;
10611 if (_issue.format === "starts_with") return `Chuỗi không hợp lệ: phải bắt đầu bằng "${_issue.prefix}"`;
10612 if (_issue.format === "ends_with") return `Chuỗi không hợp lệ: phải kết thúc bằng "${_issue.suffix}"`;
10613 if (_issue.format === "includes") return `Chuỗi không hợp lệ: phải bao gồm "${_issue.includes}"`;
10614 if (_issue.format === "regex") return `Chuỗi không hợp lệ: phải khớp với mẫu ${_issue.pattern}`;
10615 return `${Nouns[_issue.format] ?? issue.format} không hợp lệ`;
10616 }
10617 case "not_multiple_of": return `Số không hợp lệ: phải là bội số của ${issue.divisor}`;
10618 case "unrecognized_keys": return `Khóa không được nhận dạng: ${joinValues(issue.keys, ", ")}`;
10619 case "invalid_key": return `Khóa không hợp lệ trong ${issue.origin}`;
10620 case "invalid_union": return "Đầu vào không hợp lệ";
10621 case "invalid_element": return `Giá trị không hợp lệ trong ${issue.origin}`;
10622 default: return `Đầu vào không hợp lệ`;
10623 }
10624 };
10625 }, "error");
10626 function vi_default() {
10627 return { localeError: error$2() };
10628 }
10629 __name(vi_default, "default");
10630
10631 //#endregion
10632 //#region node_modules/zod/v4/locales/zh-CN.js
10633 var error$1 = /* @__PURE__ */ __name(() => {
10634 const Sizable = {
10635 string: {
10636 unit: "字符",
10637 verb: "包含"
10638 },
10639 file: {
10640 unit: "字节",
10641 verb: "包含"
10642 },
10643 array: {
10644 unit: "项",
10645 verb: "包含"
10646 },
10647 set: {
10648 unit: "项",
10649 verb: "包含"
10650 }
10651 };
10652 function getSizing(origin) {
10653 return Sizable[origin] ?? null;
10654 }
10655 const parsedType = (data) => {
10656 const t = typeof data;
10657 switch (t) {
10658 case "number": return Number.isNaN(data) ? "非数字(NaN)" : "数字";
10659 case "object":
10660 if (Array.isArray(data)) return "数组";
10661 if (data === null) return "空值(null)";
10662 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
10663 }
10664 return t;
10665 };
10666 const Nouns = {
10667 regex: "输入",
10668 email: "电子邮件",
10669 url: "URL",
10670 emoji: "表情符号",
10671 uuid: "UUID",
10672 uuidv4: "UUIDv4",
10673 uuidv6: "UUIDv6",
10674 nanoid: "nanoid",
10675 guid: "GUID",
10676 cuid: "cuid",
10677 cuid2: "cuid2",
10678 ulid: "ULID",
10679 xid: "XID",
10680 ksuid: "KSUID",
10681 datetime: "ISO日期时间",
10682 date: "ISO日期",
10683 time: "ISO时间",
10684 duration: "ISO时长",
10685 ipv4: "IPv4地址",
10686 ipv6: "IPv6地址",
10687 cidrv4: "IPv4网段",
10688 cidrv6: "IPv6网段",
10689 base64: "base64编码字符串",
10690 base64url: "base64url编码字符串",
10691 json_string: "JSON字符串",
10692 e164: "E.164号码",
10693 jwt: "JWT",
10694 template_literal: "输入"
10695 };
10696 return (issue) => {
10697 switch (issue.code) {
10698 case "invalid_type": return `无效输入:期望 ${issue.expected},实际接收 ${parsedType(issue.input)}`;
10699 case "invalid_value":
10700 if (issue.values.length === 1) return `无效输入:期望 ${stringifyPrimitive(issue.values[0])}`;
10701 return `无效选项:期望以下之一 ${joinValues(issue.values, "|")}`;
10702 case "too_big": {
10703 const adj = issue.inclusive ? "<=" : "<";
10704 const sizing = getSizing(issue.origin);
10705 if (sizing) return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "个元素"}`;
10706 return `数值过大:期望 ${issue.origin ?? "值"} ${adj}${issue.maximum.toString()}`;
10707 }
10708 case "too_small": {
10709 const adj = issue.inclusive ? ">=" : ">";
10710 const sizing = getSizing(issue.origin);
10711 if (sizing) return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
10712 return `数值过小:期望 ${issue.origin} ${adj}${issue.minimum.toString()}`;
10713 }
10714 case "invalid_format": {
10715 const _issue = issue;
10716 if (_issue.format === "starts_with") return `无效字符串:必须以 "${_issue.prefix}" 开头`;
10717 if (_issue.format === "ends_with") return `无效字符串:必须以 "${_issue.suffix}" 结尾`;
10718 if (_issue.format === "includes") return `无效字符串:必须包含 "${_issue.includes}"`;
10719 if (_issue.format === "regex") return `无效字符串:必须满足正则表达式 ${_issue.pattern}`;
10720 return `无效${Nouns[_issue.format] ?? issue.format}`;
10721 }
10722 case "not_multiple_of": return `无效数字:必须是 ${issue.divisor} 的倍数`;
10723 case "unrecognized_keys": return `出现未知的键(key): ${joinValues(issue.keys, ", ")}`;
10724 case "invalid_key": return `${issue.origin} 中的键(key)无效`;
10725 case "invalid_union": return "无效输入";
10726 case "invalid_element": return `${issue.origin} 中包含无效值(value)`;
10727 default: return `无效输入`;
10728 }
10729 };
10730 }, "error");
10731 function zh_CN_default() {
10732 return { localeError: error$1() };
10733 }
10734 __name(zh_CN_default, "default");
10735
10736 //#endregion
10737 //#region node_modules/zod/v4/locales/zh-TW.js
10738 var error = () => {
10739 const Sizable = {
10740 string: {
10741 unit: "字元",
10742 verb: "擁有"
10743 },
10744 file: {
10745 unit: "位元組",
10746 verb: "擁有"
10747 },
10748 array: {
10749 unit: "項目",
10750 verb: "擁有"
10751 },
10752 set: {
10753 unit: "項目",
10754 verb: "擁有"
10755 }
10756 };
10757 function getSizing(origin) {
10758 return Sizable[origin] ?? null;
10759 }
10760 const parsedType = (data) => {
10761 const t = typeof data;
10762 switch (t) {
10763 case "number": return Number.isNaN(data) ? "NaN" : "number";
10764 case "object":
10765 if (Array.isArray(data)) return "array";
10766 if (data === null) return "null";
10767 if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
10768 }
10769 return t;
10770 };
10771 const Nouns = {
10772 regex: "輸入",
10773 email: "郵件地址",
10774 url: "URL",
10775 emoji: "emoji",
10776 uuid: "UUID",
10777 uuidv4: "UUIDv4",
10778 uuidv6: "UUIDv6",
10779 nanoid: "nanoid",
10780 guid: "GUID",
10781 cuid: "cuid",
10782 cuid2: "cuid2",
10783 ulid: "ULID",
10784 xid: "XID",
10785 ksuid: "KSUID",
10786 datetime: "ISO 日期時間",
10787 date: "ISO 日期",
10788 time: "ISO 時間",
10789 duration: "ISO 期間",
10790 ipv4: "IPv4 位址",
10791 ipv6: "IPv6 位址",
10792 cidrv4: "IPv4 範圍",
10793 cidrv6: "IPv6 範圍",
10794 base64: "base64 編碼字串",
10795 base64url: "base64url 編碼字串",
10796 json_string: "JSON 字串",
10797 e164: "E.164 數值",
10798 jwt: "JWT",
10799 template_literal: "輸入"
10800 };
10801 return (issue) => {
10802 switch (issue.code) {
10803 case "invalid_type": return `無效的輸入值:預期為 ${issue.expected},但收到 ${parsedType(issue.input)}`;
10804 case "invalid_value":
10805 if (issue.values.length === 1) return `無效的輸入值:預期為 ${stringifyPrimitive(issue.values[0])}`;
10806 return `無效的選項:預期為以下其中之一 ${joinValues(issue.values, "|")}`;
10807 case "too_big": {
10808 const adj = issue.inclusive ? "<=" : "<";
10809 const sizing = getSizing(issue.origin);
10810 if (sizing) return `數值過大:預期 ${issue.origin ?? "值"} 應為 ${adj}${issue.maximum.toString()} ${sizing.unit ?? "個元素"}`;
10811 return `數值過大:預期 ${issue.origin ?? "值"} 應為 ${adj}${issue.maximum.toString()}`;
10812 }
10813 case "too_small": {
10814 const adj = issue.inclusive ? ">=" : ">";
10815 const sizing = getSizing(issue.origin);
10816 if (sizing) return `數值過小:預期 ${issue.origin} 應為 ${adj}${issue.minimum.toString()} ${sizing.unit}`;
10817 return `數值過小:預期 ${issue.origin} 應為 ${adj}${issue.minimum.toString()}`;
10818 }
10819 case "invalid_format": {
10820 const _issue = issue;
10821 if (_issue.format === "starts_with") return `無效的字串:必須以 "${_issue.prefix}" 開頭`;
10822 if (_issue.format === "ends_with") return `無效的字串:必須以 "${_issue.suffix}" 結尾`;
10823 if (_issue.format === "includes") return `無效的字串:必須包含 "${_issue.includes}"`;
10824 if (_issue.format === "regex") return `無效的字串:必須符合格式 ${_issue.pattern}`;
10825 return `無效的 ${Nouns[_issue.format] ?? issue.format}`;
10826 }
10827 case "not_multiple_of": return `無效的數字:必須為 ${issue.divisor} 的倍數`;
10828 case "unrecognized_keys": return `無法識別的鍵值${issue.keys.length > 1 ? "們" : ""}:${joinValues(issue.keys, "、")}`;
10829 case "invalid_key": return `${issue.origin} 中有無效的鍵值`;
10830 case "invalid_union": return "無效的輸入值";
10831 case "invalid_element": return `${issue.origin} 中有無效的值`;
10832 default: return `無效的輸入值`;
10833 }
10834 };
10835 };
10836 function zh_TW_default() {
10837 return { localeError: error() };
10838 }
10839 __name(zh_TW_default, "default");
10840
10841 //#endregion
10842 //#region node_modules/zod/v4/locales/index.js
10843 var locales_exports = /* @__PURE__ */ __exportAll({
10844 ar: () => ar_default,
10845 az: () => az_default,
10846 be: () => be_default,
10847 ca: () => ca_default,
10848 cs: () => cs_default,
10849 de: () => de_default,
10850 en: () => en_default,
10851 eo: () => eo_default,
10852 es: () => es_default,
10853 fa: () => fa_default,
10854 fi: () => fi_default,
10855 fr: () => fr_default,
10856 frCA: () => fr_CA_default,
10857 he: () => he_default,
10858 hu: () => hu_default,
10859 id: () => id_default,
10860 it: () => it_default,
10861 ja: () => ja_default,
10862 kh: () => kh_default,
10863 ko: () => ko_default,
10864 mk: () => mk_default,
10865 ms: () => ms_default,
10866 nl: () => nl_default,
10867 no: () => no_default,
10868 ota: () => ota_default,
10869 pl: () => pl_default,
10870 ps: () => ps_default,
10871 pt: () => pt_default,
10872 ru: () => ru_default,
10873 sl: () => sl_default,
10874 sv: () => sv_default,
10875 ta: () => ta_default,
10876 th: () => th_default,
10877 tr: () => tr_default,
10878 ua: () => ua_default,
10879 ur: () => ur_default,
10880 vi: () => vi_default,
10881 zhCN: () => zh_CN_default,
10882 zhTW: () => zh_TW_default
10883 });
10884
10885 //#endregion
10886 //#region node_modules/zod/v4/core/registries.js
10887 var $output = Symbol("ZodOutput");
10888 var $input = Symbol("ZodInput");
10889 var $ZodRegistry = class {
10890 constructor() {
10891 this._map = /* @__PURE__ */ new Map();
10892 this._idmap = /* @__PURE__ */ new Map();
10893 }
10894 add(schema, ..._meta) {
10895 const meta = _meta[0];
10896 this._map.set(schema, meta);
10897 if (meta && typeof meta === "object" && "id" in meta) {
10898 if (this._idmap.has(meta.id)) throw new Error(`ID ${meta.id} already exists in the registry`);
10899 this._idmap.set(meta.id, schema);
10900 }
10901 return this;
10902 }
10903 clear() {
10904 this._map = /* @__PURE__ */ new Map();
10905 this._idmap = /* @__PURE__ */ new Map();
10906 return this;
10907 }
10908 remove(schema) {
10909 const meta = this._map.get(schema);
10910 if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
10911 this._map.delete(schema);
10912 return this;
10913 }
10914 get(schema) {
10915 const p = schema._zod.parent;
10916 if (p) {
10917 const pm = { ...this.get(p) ?? {} };
10918 delete pm.id;
10919 return {
10920 ...pm,
10921 ...this._map.get(schema)
10922 };
10923 }
10924 return this._map.get(schema);
10925 }
10926 has(schema) {
10927 return this._map.has(schema);
10928 }
10929 };
10930 function registry() {
10931 return new $ZodRegistry();
10932 }
10933 var globalRegistry = /*@__PURE__*/ registry();
10934
10935 //#endregion
10936 //#region node_modules/zod/v4/core/api.js
10937 function _string(Class, params) {
10938 return new Class({
10939 type: "string",
10940 ...normalizeParams(params)
10941 });
10942 }
10943 function _coercedString(Class, params) {
10944 return new Class({
10945 type: "string",
10946 coerce: true,
10947 ...normalizeParams(params)
10948 });
10949 }
10950 function _email(Class, params) {
10951 return new Class({
10952 type: "string",
10953 format: "email",
10954 check: "string_format",
10955 abort: false,
10956 ...normalizeParams(params)
10957 });
10958 }
10959 function _guid(Class, params) {
10960 return new Class({
10961 type: "string",
10962 format: "guid",
10963 check: "string_format",
10964 abort: false,
10965 ...normalizeParams(params)
10966 });
10967 }
10968 function _uuid(Class, params) {
10969 return new Class({
10970 type: "string",
10971 format: "uuid",
10972 check: "string_format",
10973 abort: false,
10974 ...normalizeParams(params)
10975 });
10976 }
10977 function _uuidv4(Class, params) {
10978 return new Class({
10979 type: "string",
10980 format: "uuid",
10981 check: "string_format",
10982 abort: false,
10983 version: "v4",
10984 ...normalizeParams(params)
10985 });
10986 }
10987 function _uuidv6(Class, params) {
10988 return new Class({
10989 type: "string",
10990 format: "uuid",
10991 check: "string_format",
10992 abort: false,
10993 version: "v6",
10994 ...normalizeParams(params)
10995 });
10996 }
10997 function _uuidv7(Class, params) {
10998 return new Class({
10999 type: "string",
11000 format: "uuid",
11001 check: "string_format",
11002 abort: false,
11003 version: "v7",
11004 ...normalizeParams(params)
11005 });
11006 }
11007 function _url(Class, params) {
11008 return new Class({
11009 type: "string",
11010 format: "url",
11011 check: "string_format",
11012 abort: false,
11013 ...normalizeParams(params)
11014 });
11015 }
11016 function _emoji(Class, params) {
11017 return new Class({
11018 type: "string",
11019 format: "emoji",
11020 check: "string_format",
11021 abort: false,
11022 ...normalizeParams(params)
11023 });
11024 }
11025 function _nanoid(Class, params) {
11026 return new Class({
11027 type: "string",
11028 format: "nanoid",
11029 check: "string_format",
11030 abort: false,
11031 ...normalizeParams(params)
11032 });
11033 }
11034 function _cuid(Class, params) {
11035 return new Class({
11036 type: "string",
11037 format: "cuid",
11038 check: "string_format",
11039 abort: false,
11040 ...normalizeParams(params)
11041 });
11042 }
11043 function _cuid2(Class, params) {
11044 return new Class({
11045 type: "string",
11046 format: "cuid2",
11047 check: "string_format",
11048 abort: false,
11049 ...normalizeParams(params)
11050 });
11051 }
11052 function _ulid(Class, params) {
11053 return new Class({
11054 type: "string",
11055 format: "ulid",
11056 check: "string_format",
11057 abort: false,
11058 ...normalizeParams(params)
11059 });
11060 }
11061 function _xid(Class, params) {
11062 return new Class({
11063 type: "string",
11064 format: "xid",
11065 check: "string_format",
11066 abort: false,
11067 ...normalizeParams(params)
11068 });
11069 }
11070 function _ksuid(Class, params) {
11071 return new Class({
11072 type: "string",
11073 format: "ksuid",
11074 check: "string_format",
11075 abort: false,
11076 ...normalizeParams(params)
11077 });
11078 }
11079 function _ipv4(Class, params) {
11080 return new Class({
11081 type: "string",
11082 format: "ipv4",
11083 check: "string_format",
11084 abort: false,
11085 ...normalizeParams(params)
11086 });
11087 }
11088 function _ipv6(Class, params) {
11089 return new Class({
11090 type: "string",
11091 format: "ipv6",
11092 check: "string_format",
11093 abort: false,
11094 ...normalizeParams(params)
11095 });
11096 }
11097 function _cidrv4(Class, params) {
11098 return new Class({
11099 type: "string",
11100 format: "cidrv4",
11101 check: "string_format",
11102 abort: false,
11103 ...normalizeParams(params)
11104 });
11105 }
11106 function _cidrv6(Class, params) {
11107 return new Class({
11108 type: "string",
11109 format: "cidrv6",
11110 check: "string_format",
11111 abort: false,
11112 ...normalizeParams(params)
11113 });
11114 }
11115 function _base64(Class, params) {
11116 return new Class({
11117 type: "string",
11118 format: "base64",
11119 check: "string_format",
11120 abort: false,
11121 ...normalizeParams(params)
11122 });
11123 }
11124 function _base64url(Class, params) {
11125 return new Class({
11126 type: "string",
11127 format: "base64url",
11128 check: "string_format",
11129 abort: false,
11130 ...normalizeParams(params)
11131 });
11132 }
11133 function _e164(Class, params) {
11134 return new Class({
11135 type: "string",
11136 format: "e164",
11137 check: "string_format",
11138 abort: false,
11139 ...normalizeParams(params)
11140 });
11141 }
11142 function _jwt(Class, params) {
11143 return new Class({
11144 type: "string",
11145 format: "jwt",
11146 check: "string_format",
11147 abort: false,
11148 ...normalizeParams(params)
11149 });
11150 }
11151 var TimePrecision = {
11152 Any: null,
11153 Minute: -1,
11154 Second: 0,
11155 Millisecond: 3,
11156 Microsecond: 6
11157 };
11158 function _isoDateTime(Class, params) {
11159 return new Class({
11160 type: "string",
11161 format: "datetime",
11162 check: "string_format",
11163 offset: false,
11164 local: false,
11165 precision: null,
11166 ...normalizeParams(params)
11167 });
11168 }
11169 function _isoDate(Class, params) {
11170 return new Class({
11171 type: "string",
11172 format: "date",
11173 check: "string_format",
11174 ...normalizeParams(params)
11175 });
11176 }
11177 function _isoTime(Class, params) {
11178 return new Class({
11179 type: "string",
11180 format: "time",
11181 check: "string_format",
11182 precision: null,
11183 ...normalizeParams(params)
11184 });
11185 }
11186 function _isoDuration(Class, params) {
11187 return new Class({
11188 type: "string",
11189 format: "duration",
11190 check: "string_format",
11191 ...normalizeParams(params)
11192 });
11193 }
11194 function _number(Class, params) {
11195 return new Class({
11196 type: "number",
11197 checks: [],
11198 ...normalizeParams(params)
11199 });
11200 }
11201 function _coercedNumber(Class, params) {
11202 return new Class({
11203 type: "number",
11204 coerce: true,
11205 checks: [],
11206 ...normalizeParams(params)
11207 });
11208 }
11209 function _int(Class, params) {
11210 return new Class({
11211 type: "number",
11212 check: "number_format",
11213 abort: false,
11214 format: "safeint",
11215 ...normalizeParams(params)
11216 });
11217 }
11218 function _float32(Class, params) {
11219 return new Class({
11220 type: "number",
11221 check: "number_format",
11222 abort: false,
11223 format: "float32",
11224 ...normalizeParams(params)
11225 });
11226 }
11227 function _float64(Class, params) {
11228 return new Class({
11229 type: "number",
11230 check: "number_format",
11231 abort: false,
11232 format: "float64",
11233 ...normalizeParams(params)
11234 });
11235 }
11236 function _int32(Class, params) {
11237 return new Class({
11238 type: "number",
11239 check: "number_format",
11240 abort: false,
11241 format: "int32",
11242 ...normalizeParams(params)
11243 });
11244 }
11245 function _uint32(Class, params) {
11246 return new Class({
11247 type: "number",
11248 check: "number_format",
11249 abort: false,
11250 format: "uint32",
11251 ...normalizeParams(params)
11252 });
11253 }
11254 function _boolean(Class, params) {
11255 return new Class({
11256 type: "boolean",
11257 ...normalizeParams(params)
11258 });
11259 }
11260 function _coercedBoolean(Class, params) {
11261 return new Class({
11262 type: "boolean",
11263 coerce: true,
11264 ...normalizeParams(params)
11265 });
11266 }
11267 function _bigint(Class, params) {
11268 return new Class({
11269 type: "bigint",
11270 ...normalizeParams(params)
11271 });
11272 }
11273 function _coercedBigint(Class, params) {
11274 return new Class({
11275 type: "bigint",
11276 coerce: true,
11277 ...normalizeParams(params)
11278 });
11279 }
11280 function _int64(Class, params) {
11281 return new Class({
11282 type: "bigint",
11283 check: "bigint_format",
11284 abort: false,
11285 format: "int64",
11286 ...normalizeParams(params)
11287 });
11288 }
11289 function _uint64(Class, params) {
11290 return new Class({
11291 type: "bigint",
11292 check: "bigint_format",
11293 abort: false,
11294 format: "uint64",
11295 ...normalizeParams(params)
11296 });
11297 }
11298 function _symbol(Class, params) {
11299 return new Class({
11300 type: "symbol",
11301 ...normalizeParams(params)
11302 });
11303 }
11304 function _undefined$1(Class, params) {
11305 return new Class({
11306 type: "undefined",
11307 ...normalizeParams(params)
11308 });
11309 }
11310 __name(_undefined$1, "_undefined");
11311 function _null$1(Class, params) {
11312 return new Class({
11313 type: "null",
11314 ...normalizeParams(params)
11315 });
11316 }
11317 __name(_null$1, "_null");
11318 function _any(Class) {
11319 return new Class({ type: "any" });
11320 }
11321 function _unknown(Class) {
11322 return new Class({ type: "unknown" });
11323 }
11324 function _never(Class, params) {
11325 return new Class({
11326 type: "never",
11327 ...normalizeParams(params)
11328 });
11329 }
11330 function _void$1(Class, params) {
11331 return new Class({
11332 type: "void",
11333 ...normalizeParams(params)
11334 });
11335 }
11336 __name(_void$1, "_void");
11337 function _date(Class, params) {
11338 return new Class({
11339 type: "date",
11340 ...normalizeParams(params)
11341 });
11342 }
11343 function _coercedDate(Class, params) {
11344 return new Class({
11345 type: "date",
11346 coerce: true,
11347 ...normalizeParams(params)
11348 });
11349 }
11350 function _nan(Class, params) {
11351 return new Class({
11352 type: "nan",
11353 ...normalizeParams(params)
11354 });
11355 }
11356 function _lt(value, params) {
11357 return new $ZodCheckLessThan({
11358 check: "less_than",
11359 ...normalizeParams(params),
11360 value,
11361 inclusive: false
11362 });
11363 }
11364 function _lte(value, params) {
11365 return new $ZodCheckLessThan({
11366 check: "less_than",
11367 ...normalizeParams(params),
11368 value,
11369 inclusive: true
11370 });
11371 }
11372 function _gt(value, params) {
11373 return new $ZodCheckGreaterThan({
11374 check: "greater_than",
11375 ...normalizeParams(params),
11376 value,
11377 inclusive: false
11378 });
11379 }
11380 function _gte(value, params) {
11381 return new $ZodCheckGreaterThan({
11382 check: "greater_than",
11383 ...normalizeParams(params),
11384 value,
11385 inclusive: true
11386 });
11387 }
11388 function _positive(params) {
11389 return _gt(0, params);
11390 }
11391 function _negative(params) {
11392 return _lt(0, params);
11393 }
11394 function _nonpositive(params) {
11395 return _lte(0, params);
11396 }
11397 function _nonnegative(params) {
11398 return _gte(0, params);
11399 }
11400 function _multipleOf(value, params) {
11401 return new $ZodCheckMultipleOf({
11402 check: "multiple_of",
11403 ...normalizeParams(params),
11404 value
11405 });
11406 }
11407 function _maxSize(maximum, params) {
11408 return new $ZodCheckMaxSize({
11409 check: "max_size",
11410 ...normalizeParams(params),
11411 maximum
11412 });
11413 }
11414 function _minSize(minimum, params) {
11415 return new $ZodCheckMinSize({
11416 check: "min_size",
11417 ...normalizeParams(params),
11418 minimum
11419 });
11420 }
11421 function _size(size, params) {
11422 return new $ZodCheckSizeEquals({
11423 check: "size_equals",
11424 ...normalizeParams(params),
11425 size
11426 });
11427 }
11428 function _maxLength(maximum, params) {
11429 return new $ZodCheckMaxLength({
11430 check: "max_length",
11431 ...normalizeParams(params),
11432 maximum
11433 });
11434 }
11435 function _minLength(minimum, params) {
11436 return new $ZodCheckMinLength({
11437 check: "min_length",
11438 ...normalizeParams(params),
11439 minimum
11440 });
11441 }
11442 function _length(length, params) {
11443 return new $ZodCheckLengthEquals({
11444 check: "length_equals",
11445 ...normalizeParams(params),
11446 length
11447 });
11448 }
11449 function _regex(pattern, params) {
11450 return new $ZodCheckRegex({
11451 check: "string_format",
11452 format: "regex",
11453 ...normalizeParams(params),
11454 pattern
11455 });
11456 }
11457 function _lowercase(params) {
11458 return new $ZodCheckLowerCase({
11459 check: "string_format",
11460 format: "lowercase",
11461 ...normalizeParams(params)
11462 });
11463 }
11464 function _uppercase(params) {
11465 return new $ZodCheckUpperCase({
11466 check: "string_format",
11467 format: "uppercase",
11468 ...normalizeParams(params)
11469 });
11470 }
11471 function _includes(includes, params) {
11472 return new $ZodCheckIncludes({
11473 check: "string_format",
11474 format: "includes",
11475 ...normalizeParams(params),
11476 includes
11477 });
11478 }
11479 function _startsWith(prefix, params) {
11480 return new $ZodCheckStartsWith({
11481 check: "string_format",
11482 format: "starts_with",
11483 ...normalizeParams(params),
11484 prefix
11485 });
11486 }
11487 function _endsWith(suffix, params) {
11488 return new $ZodCheckEndsWith({
11489 check: "string_format",
11490 format: "ends_with",
11491 ...normalizeParams(params),
11492 suffix
11493 });
11494 }
11495 function _property(property, schema, params) {
11496 return new $ZodCheckProperty({
11497 check: "property",
11498 property,
11499 schema,
11500 ...normalizeParams(params)
11501 });
11502 }
11503 function _mime(types, params) {
11504 return new $ZodCheckMimeType({
11505 check: "mime_type",
11506 mime: types,
11507 ...normalizeParams(params)
11508 });
11509 }
11510 function _overwrite(tx) {
11511 return new $ZodCheckOverwrite({
11512 check: "overwrite",
11513 tx
11514 });
11515 }
11516 function _normalize(form) {
11517 return _overwrite((input) => input.normalize(form));
11518 }
11519 function _trim() {
11520 return _overwrite((input) => input.trim());
11521 }
11522 function _toLowerCase() {
11523 return _overwrite((input) => input.toLowerCase());
11524 }
11525 function _toUpperCase() {
11526 return _overwrite((input) => input.toUpperCase());
11527 }
11528 function _array(Class, element, params) {
11529 return new Class({
11530 type: "array",
11531 element,
11532 ...normalizeParams(params)
11533 });
11534 }
11535 function _union(Class, options, params) {
11536 return new Class({
11537 type: "union",
11538 options,
11539 ...normalizeParams(params)
11540 });
11541 }
11542 function _discriminatedUnion(Class, discriminator, options, params) {
11543 return new Class({
11544 type: "union",
11545 options,
11546 discriminator,
11547 ...normalizeParams(params)
11548 });
11549 }
11550 function _intersection(Class, left, right) {
11551 return new Class({
11552 type: "intersection",
11553 left,
11554 right
11555 });
11556 }
11557 function _tuple(Class, items, _paramsOrRest, _params) {
11558 const hasRest = _paramsOrRest instanceof $ZodType;
11559 const params = hasRest ? _params : _paramsOrRest;
11560 return new Class({
11561 type: "tuple",
11562 items,
11563 rest: hasRest ? _paramsOrRest : null,
11564 ...normalizeParams(params)
11565 });
11566 }
11567 function _record(Class, keyType, valueType, params) {
11568 return new Class({
11569 type: "record",
11570 keyType,
11571 valueType,
11572 ...normalizeParams(params)
11573 });
11574 }
11575 function _map(Class, keyType, valueType, params) {
11576 return new Class({
11577 type: "map",
11578 keyType,
11579 valueType,
11580 ...normalizeParams(params)
11581 });
11582 }
11583 function _set(Class, valueType, params) {
11584 return new Class({
11585 type: "set",
11586 valueType,
11587 ...normalizeParams(params)
11588 });
11589 }
11590 function _enum$1(Class, values, params) {
11591 return new Class({
11592 type: "enum",
11593 entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
11594 ...normalizeParams(params)
11595 });
11596 }
11597 __name(_enum$1, "_enum");
11598 /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
11599 *
11600 * ```ts
11601 * enum Colors { red, green, blue }
11602 * z.enum(Colors);
11603 * ```
11604 */
11605 function _nativeEnum(Class, entries, params) {
11606 return new Class({
11607 type: "enum",
11608 entries,
11609 ...normalizeParams(params)
11610 });
11611 }
11612 function _literal(Class, value, params) {
11613 return new Class({
11614 type: "literal",
11615 values: Array.isArray(value) ? value : [value],
11616 ...normalizeParams(params)
11617 });
11618 }
11619 function _file(Class, params) {
11620 return new Class({
11621 type: "file",
11622 ...normalizeParams(params)
11623 });
11624 }
11625 function _transform(Class, fn) {
11626 return new Class({
11627 type: "transform",
11628 transform: fn
11629 });
11630 }
11631 function _optional(Class, innerType) {
11632 return new Class({
11633 type: "optional",
11634 innerType
11635 });
11636 }
11637 function _nullable(Class, innerType) {
11638 return new Class({
11639 type: "nullable",
11640 innerType
11641 });
11642 }
11643 function _default$1(Class, innerType, defaultValue) {
11644 return new Class({
11645 type: "default",
11646 innerType,
11647 get defaultValue() {
11648 return typeof defaultValue === "function" ? defaultValue() : defaultValue;
11649 }
11650 });
11651 }
11652 __name(_default$1, "_default");
11653 function _nonoptional(Class, innerType, params) {
11654 return new Class({
11655 type: "nonoptional",
11656 innerType,
11657 ...normalizeParams(params)
11658 });
11659 }
11660 function _success(Class, innerType) {
11661 return new Class({
11662 type: "success",
11663 innerType
11664 });
11665 }
11666 function _catch$1(Class, innerType, catchValue) {
11667 return new Class({
11668 type: "catch",
11669 innerType,
11670 catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
11671 });
11672 }
11673 __name(_catch$1, "_catch");
11674 function _pipe(Class, in_, out) {
11675 return new Class({
11676 type: "pipe",
11677 in: in_,
11678 out
11679 });
11680 }
11681 function _readonly(Class, innerType) {
11682 return new Class({
11683 type: "readonly",
11684 innerType
11685 });
11686 }
11687 function _templateLiteral(Class, parts, params) {
11688 return new Class({
11689 type: "template_literal",
11690 parts,
11691 ...normalizeParams(params)
11692 });
11693 }
11694 function _lazy(Class, getter) {
11695 return new Class({
11696 type: "lazy",
11697 getter
11698 });
11699 }
11700 function _promise(Class, innerType) {
11701 return new Class({
11702 type: "promise",
11703 innerType
11704 });
11705 }
11706 function _custom(Class, fn, _params) {
11707 const norm = normalizeParams(_params);
11708 norm.abort ?? (norm.abort = true);
11709 return new Class({
11710 type: "custom",
11711 check: "custom",
11712 fn,
11713 ...norm
11714 });
11715 }
11716 function _refine(Class, fn, _params) {
11717 return new Class({
11718 type: "custom",
11719 check: "custom",
11720 fn,
11721 ...normalizeParams(_params)
11722 });
11723 }
11724 function _stringbool(Classes, _params) {
11725 const params = normalizeParams(_params);
11726 let truthyArray = params.truthy ?? [
11727 "true",
11728 "1",
11729 "yes",
11730 "on",
11731 "y",
11732 "enabled"
11733 ];
11734 let falsyArray = params.falsy ?? [
11735 "false",
11736 "0",
11737 "no",
11738 "off",
11739 "n",
11740 "disabled"
11741 ];
11742 if (params.case !== "sensitive") {
11743 truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
11744 falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
11745 }
11746 const truthySet = new Set(truthyArray);
11747 const falsySet = new Set(falsyArray);
11748 const _Pipe = Classes.Pipe ?? $ZodPipe;
11749 const _Boolean = Classes.Boolean ?? $ZodBoolean;
11750 const _String = Classes.String ?? $ZodString;
11751 const tx = new (Classes.Transform ?? $ZodTransform)({
11752 type: "transform",
11753 transform: (input, payload) => {
11754 let data = input;
11755 if (params.case !== "sensitive") data = data.toLowerCase();
11756 if (truthySet.has(data)) return true;
11757 else if (falsySet.has(data)) return false;
11758 else {
11759 payload.issues.push({
11760 code: "invalid_value",
11761 expected: "stringbool",
11762 values: [...truthySet, ...falsySet],
11763 input: payload.value,
11764 inst: tx
11765 });
11766 return {};
11767 }
11768 },
11769 error: params.error
11770 });
11771 return new _Pipe({
11772 type: "pipe",
11773 in: new _Pipe({
11774 type: "pipe",
11775 in: new _String({
11776 type: "string",
11777 error: params.error
11778 }),
11779 out: tx,
11780 error: params.error
11781 }),
11782 out: new _Boolean({
11783 type: "boolean",
11784 error: params.error
11785 }),
11786 error: params.error
11787 });
11788 }
11789 function _stringFormat(Class, format, fnOrRegex, _params = {}) {
11790 const params = normalizeParams(_params);
11791 const def = {
11792 ...normalizeParams(_params),
11793 check: "string_format",
11794 type: "string",
11795 format,
11796 fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
11797 ...params
11798 };
11799 if (fnOrRegex instanceof RegExp) def.pattern = fnOrRegex;
11800 return new Class(def);
11801 }
11802
11803 //#endregion
11804 //#region node_modules/zod/v4/core/function.js
11805 var $ZodFunction = class {
11806 constructor(def) {
11807 this._def = def;
11808 this.def = def;
11809 }
11810 implement(func) {
11811 if (typeof func !== "function") throw new Error("implement() must be called with a function");
11812 const impl = ((...args) => {
11813 const parsedArgs = this._def.input ? parse$1(this._def.input, args, void 0, { callee: impl }) : args;
11814 if (!Array.isArray(parsedArgs)) throw new Error("Invalid arguments schema: not an array or tuple schema.");
11815 const output = func(...parsedArgs);
11816 return this._def.output ? parse$1(this._def.output, output, void 0, { callee: impl }) : output;
11817 });
11818 return impl;
11819 }
11820 implementAsync(func) {
11821 if (typeof func !== "function") throw new Error("implement() must be called with a function");
11822 const impl = (async (...args) => {
11823 const parsedArgs = this._def.input ? await parseAsync$1(this._def.input, args, void 0, { callee: impl }) : args;
11824 if (!Array.isArray(parsedArgs)) throw new Error("Invalid arguments schema: not an array or tuple schema.");
11825 const output = await func(...parsedArgs);
11826 return this._def.output ? parseAsync$1(this._def.output, output, void 0, { callee: impl }) : output;
11827 });
11828 return impl;
11829 }
11830 input(...args) {
11831 const F = this.constructor;
11832 if (Array.isArray(args[0])) return new F({
11833 type: "function",
11834 input: new $ZodTuple({
11835 type: "tuple",
11836 items: args[0],
11837 rest: args[1]
11838 }),
11839 output: this._def.output
11840 });
11841 return new F({
11842 type: "function",
11843 input: args[0],
11844 output: this._def.output
11845 });
11846 }
11847 output(output) {
11848 const F = this.constructor;
11849 return new F({
11850 type: "function",
11851 input: this._def.input,
11852 output
11853 });
11854 }
11855 };
11856 function _function(params) {
11857 return new $ZodFunction({
11858 type: "function",
11859 input: Array.isArray(params?.input) ? _tuple($ZodTuple, params?.input) : params?.input ?? _array($ZodArray, _unknown($ZodUnknown)),
11860 output: params?.output ?? _unknown($ZodUnknown)
11861 });
11862 }
11863
11864 //#endregion
11865 //#region node_modules/zod/v4/core/to-json-schema.js
11866 var JSONSchemaGenerator = class {
11867 constructor(params) {
11868 this.counter = 0;
11869 this.metadataRegistry = params?.metadata ?? globalRegistry;
11870 this.target = params?.target ?? "draft-2020-12";
11871 this.unrepresentable = params?.unrepresentable ?? "throw";
11872 this.override = params?.override ?? (() => {});
11873 this.io = params?.io ?? "output";
11874 this.seen = /* @__PURE__ */ new Map();
11875 }
11876 process(schema, _params = {
11877 path: [],
11878 schemaPath: []
11879 }) {
11880 var _a;
11881 const def = schema._zod.def;
11882 const formatMap = {
11883 guid: "uuid",
11884 url: "uri",
11885 datetime: "date-time",
11886 json_string: "json-string",
11887 regex: ""
11888 };
11889 const seen = this.seen.get(schema);
11890 if (seen) {
11891 seen.count++;
11892 if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
11893 return seen.schema;
11894 }
11895 const result = {
11896 schema: {},
11897 count: 1,
11898 cycle: void 0,
11899 path: _params.path
11900 };
11901 this.seen.set(schema, result);
11902 const overrideSchema = schema._zod.toJSONSchema?.();
11903 if (overrideSchema) result.schema = overrideSchema;
11904 else {
11905 const params = {
11906 ..._params,
11907 schemaPath: [..._params.schemaPath, schema],
11908 path: _params.path
11909 };
11910 const parent = schema._zod.parent;
11911 if (parent) {
11912 result.ref = parent;
11913 this.process(parent, params);
11914 this.seen.get(parent).isParent = true;
11915 } else {
11916 const _json = result.schema;
11917 switch (def.type) {
11918 case "string": {
11919 const json = _json;
11920 json.type = "string";
11921 const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
11922 if (typeof minimum === "number") json.minLength = minimum;
11923 if (typeof maximum === "number") json.maxLength = maximum;
11924 if (format) {
11925 json.format = formatMap[format] ?? format;
11926 if (json.format === "") delete json.format;
11927 }
11928 if (contentEncoding) json.contentEncoding = contentEncoding;
11929 if (patterns && patterns.size > 0) {
11930 const regexes = [...patterns];
11931 if (regexes.length === 1) json.pattern = regexes[0].source;
11932 else if (regexes.length > 1) result.schema.allOf = [...regexes.map((regex) => ({
11933 ...this.target === "draft-7" ? { type: "string" } : {},
11934 pattern: regex.source
11935 }))];
11936 }
11937 break;
11938 }
11939 case "number": {
11940 const json = _json;
11941 const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
11942 if (typeof format === "string" && format.includes("int")) json.type = "integer";
11943 else json.type = "number";
11944 if (typeof exclusiveMinimum === "number") json.exclusiveMinimum = exclusiveMinimum;
11945 if (typeof minimum === "number") {
11946 json.minimum = minimum;
11947 if (typeof exclusiveMinimum === "number") if (exclusiveMinimum >= minimum) delete json.minimum;
11948 else delete json.exclusiveMinimum;
11949 }
11950 if (typeof exclusiveMaximum === "number") json.exclusiveMaximum = exclusiveMaximum;
11951 if (typeof maximum === "number") {
11952 json.maximum = maximum;
11953 if (typeof exclusiveMaximum === "number") if (exclusiveMaximum <= maximum) delete json.maximum;
11954 else delete json.exclusiveMaximum;
11955 }
11956 if (typeof multipleOf === "number") json.multipleOf = multipleOf;
11957 break;
11958 }
11959 case "boolean": {
11960 const json = _json;
11961 json.type = "boolean";
11962 break;
11963 }
11964 case "bigint":
11965 if (this.unrepresentable === "throw") throw new Error("BigInt cannot be represented in JSON Schema");
11966 break;
11967 case "symbol":
11968 if (this.unrepresentable === "throw") throw new Error("Symbols cannot be represented in JSON Schema");
11969 break;
11970 case "null":
11971 _json.type = "null";
11972 break;
11973 case "any": break;
11974 case "unknown": break;
11975 case "undefined":
11976 if (this.unrepresentable === "throw") throw new Error("Undefined cannot be represented in JSON Schema");
11977 break;
11978 case "void":
11979 if (this.unrepresentable === "throw") throw new Error("Void cannot be represented in JSON Schema");
11980 break;
11981 case "never":
11982 _json.not = {};
11983 break;
11984 case "date":
11985 if (this.unrepresentable === "throw") throw new Error("Date cannot be represented in JSON Schema");
11986 break;
11987 case "array": {
11988 const json = _json;
11989 const { minimum, maximum } = schema._zod.bag;
11990 if (typeof minimum === "number") json.minItems = minimum;
11991 if (typeof maximum === "number") json.maxItems = maximum;
11992 json.type = "array";
11993 json.items = this.process(def.element, {
11994 ...params,
11995 path: [...params.path, "items"]
11996 });
11997 break;
11998 }
11999 case "object": {
12000 const json = _json;
12001 json.type = "object";
12002 json.properties = {};
12003 const shape = def.shape;
12004 for (const key in shape) json.properties[key] = this.process(shape[key], {
12005 ...params,
12006 path: [
12007 ...params.path,
12008 "properties",
12009 key
12010 ]
12011 });
12012 const allKeys = new Set(Object.keys(shape));
12013 const requiredKeys = new Set([...allKeys].filter((key) => {
12014 const v = def.shape[key]._zod;
12015 if (this.io === "input") return v.optin === void 0;
12016 else return v.optout === void 0;
12017 }));
12018 if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
12019 if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
12020 else if (!def.catchall) {
12021 if (this.io === "output") json.additionalProperties = false;
12022 } else if (def.catchall) json.additionalProperties = this.process(def.catchall, {
12023 ...params,
12024 path: [...params.path, "additionalProperties"]
12025 });
12026 break;
12027 }
12028 case "union": {
12029 const json = _json;
12030 json.anyOf = def.options.map((x, i) => this.process(x, {
12031 ...params,
12032 path: [
12033 ...params.path,
12034 "anyOf",
12035 i
12036 ]
12037 }));
12038 break;
12039 }
12040 case "intersection": {
12041 const json = _json;
12042 const a = this.process(def.left, {
12043 ...params,
12044 path: [
12045 ...params.path,
12046 "allOf",
12047 0
12048 ]
12049 });
12050 const b = this.process(def.right, {
12051 ...params,
12052 path: [
12053 ...params.path,
12054 "allOf",
12055 1
12056 ]
12057 });
12058 const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
12059 json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
12060 break;
12061 }
12062 case "tuple": {
12063 const json = _json;
12064 json.type = "array";
12065 const prefixItems = def.items.map((x, i) => this.process(x, {
12066 ...params,
12067 path: [
12068 ...params.path,
12069 "prefixItems",
12070 i
12071 ]
12072 }));
12073 if (this.target === "draft-2020-12") json.prefixItems = prefixItems;
12074 else json.items = prefixItems;
12075 if (def.rest) {
12076 const rest = this.process(def.rest, {
12077 ...params,
12078 path: [...params.path, "items"]
12079 });
12080 if (this.target === "draft-2020-12") json.items = rest;
12081 else json.additionalItems = rest;
12082 }
12083 if (def.rest) json.items = this.process(def.rest, {
12084 ...params,
12085 path: [...params.path, "items"]
12086 });
12087 const { minimum, maximum } = schema._zod.bag;
12088 if (typeof minimum === "number") json.minItems = minimum;
12089 if (typeof maximum === "number") json.maxItems = maximum;
12090 break;
12091 }
12092 case "record": {
12093 const json = _json;
12094 json.type = "object";
12095 json.propertyNames = this.process(def.keyType, {
12096 ...params,
12097 path: [...params.path, "propertyNames"]
12098 });
12099 json.additionalProperties = this.process(def.valueType, {
12100 ...params,
12101 path: [...params.path, "additionalProperties"]
12102 });
12103 break;
12104 }
12105 case "map":
12106 if (this.unrepresentable === "throw") throw new Error("Map cannot be represented in JSON Schema");
12107 break;
12108 case "set":
12109 if (this.unrepresentable === "throw") throw new Error("Set cannot be represented in JSON Schema");
12110 break;
12111 case "enum": {
12112 const json = _json;
12113 const values = getEnumValues(def.entries);
12114 if (values.every((v) => typeof v === "number")) json.type = "number";
12115 if (values.every((v) => typeof v === "string")) json.type = "string";
12116 json.enum = values;
12117 break;
12118 }
12119 case "literal": {
12120 const json = _json;
12121 const vals = [];
12122 for (const val of def.values) if (val === void 0) {
12123 if (this.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
12124 } else if (typeof val === "bigint") if (this.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
12125 else vals.push(Number(val));
12126 else vals.push(val);
12127 if (vals.length === 0) {} else if (vals.length === 1) {
12128 const val = vals[0];
12129 json.type = val === null ? "null" : typeof val;
12130 json.const = val;
12131 } else {
12132 if (vals.every((v) => typeof v === "number")) json.type = "number";
12133 if (vals.every((v) => typeof v === "string")) json.type = "string";
12134 if (vals.every((v) => typeof v === "boolean")) json.type = "string";
12135 if (vals.every((v) => v === null)) json.type = "null";
12136 json.enum = vals;
12137 }
12138 break;
12139 }
12140 case "file": {
12141 const json = _json;
12142 const file = {
12143 type: "string",
12144 format: "binary",
12145 contentEncoding: "binary"
12146 };
12147 const { minimum, maximum, mime } = schema._zod.bag;
12148 if (minimum !== void 0) file.minLength = minimum;
12149 if (maximum !== void 0) file.maxLength = maximum;
12150 if (mime) if (mime.length === 1) {
12151 file.contentMediaType = mime[0];
12152 Object.assign(json, file);
12153 } else json.anyOf = mime.map((m) => {
12154 return {
12155 ...file,
12156 contentMediaType: m
12157 };
12158 });
12159 else Object.assign(json, file);
12160 break;
12161 }
12162 case "transform":
12163 if (this.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
12164 break;
12165 case "nullable":
12166 _json.anyOf = [this.process(def.innerType, params), { type: "null" }];
12167 break;
12168 case "nonoptional":
12169 this.process(def.innerType, params);
12170 result.ref = def.innerType;
12171 break;
12172 case "success": {
12173 const json = _json;
12174 json.type = "boolean";
12175 break;
12176 }
12177 case "default":
12178 this.process(def.innerType, params);
12179 result.ref = def.innerType;
12180 _json.default = JSON.parse(JSON.stringify(def.defaultValue));
12181 break;
12182 case "prefault":
12183 this.process(def.innerType, params);
12184 result.ref = def.innerType;
12185 if (this.io === "input") _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
12186 break;
12187 case "catch": {
12188 this.process(def.innerType, params);
12189 result.ref = def.innerType;
12190 let catchValue;
12191 try {
12192 catchValue = def.catchValue(void 0);
12193 } catch {
12194 throw new Error("Dynamic catch values are not supported in JSON Schema");
12195 }
12196 _json.default = catchValue;
12197 break;
12198 }
12199 case "nan":
12200 if (this.unrepresentable === "throw") throw new Error("NaN cannot be represented in JSON Schema");
12201 break;
12202 case "template_literal": {
12203 const json = _json;
12204 const pattern = schema._zod.pattern;
12205 if (!pattern) throw new Error("Pattern not found in template literal");
12206 json.type = "string";
12207 json.pattern = pattern.source;
12208 break;
12209 }
12210 case "pipe": {
12211 const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
12212 this.process(innerType, params);
12213 result.ref = innerType;
12214 break;
12215 }
12216 case "readonly":
12217 this.process(def.innerType, params);
12218 result.ref = def.innerType;
12219 _json.readOnly = true;
12220 break;
12221 case "promise":
12222 this.process(def.innerType, params);
12223 result.ref = def.innerType;
12224 break;
12225 case "optional":
12226 this.process(def.innerType, params);
12227 result.ref = def.innerType;
12228 break;
12229 case "lazy": {
12230 const innerType = schema._zod.innerType;
12231 this.process(innerType, params);
12232 result.ref = innerType;
12233 break;
12234 }
12235 case "custom":
12236 if (this.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
12237 break;
12238 default:
12239 }
12240 }
12241 }
12242 const meta = this.metadataRegistry.get(schema);
12243 if (meta) Object.assign(result.schema, meta);
12244 if (this.io === "input" && isTransforming(schema)) {
12245 delete result.schema.examples;
12246 delete result.schema.default;
12247 }
12248 if (this.io === "input" && result.schema._prefault) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
12249 delete result.schema._prefault;
12250 return this.seen.get(schema).schema;
12251 }
12252 emit(schema, _params) {
12253 const params = {
12254 cycles: _params?.cycles ?? "ref",
12255 reused: _params?.reused ?? "inline",
12256 external: _params?.external ?? void 0
12257 };
12258 const root = this.seen.get(schema);
12259 if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
12260 const makeURI = (entry) => {
12261 const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
12262 if (params.external) {
12263 const externalId = params.external.registry.get(entry[0])?.id;
12264 const uriGenerator = params.external.uri ?? ((id) => id);
12265 if (externalId) return { ref: uriGenerator(externalId) };
12266 const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
12267 entry[1].defId = id;
12268 return {
12269 defId: id,
12270 ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
12271 };
12272 }
12273 if (entry[1] === root) return { ref: "#" };
12274 const defUriPrefix = `#/${defsSegment}/`;
12275 const defId = entry[1].schema.id ?? `__schema${this.counter++}`;
12276 return {
12277 defId,
12278 ref: defUriPrefix + defId
12279 };
12280 };
12281 const extractToDef = (entry) => {
12282 if (entry[1].schema.$ref) return;
12283 const seen = entry[1];
12284 const { ref, defId } = makeURI(entry);
12285 seen.def = { ...seen.schema };
12286 if (defId) seen.defId = defId;
12287 const schema = seen.schema;
12288 for (const key in schema) delete schema[key];
12289 schema.$ref = ref;
12290 };
12291 if (params.cycles === "throw") for (const entry of this.seen.entries()) {
12292 const seen = entry[1];
12293 if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
12294
12295 Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
12296 }
12297 for (const entry of this.seen.entries()) {
12298 const seen = entry[1];
12299 if (schema === entry[0]) {
12300 extractToDef(entry);
12301 continue;
12302 }
12303 if (params.external) {
12304 const ext = params.external.registry.get(entry[0])?.id;
12305 if (schema !== entry[0] && ext) {
12306 extractToDef(entry);
12307 continue;
12308 }
12309 }
12310 if (this.metadataRegistry.get(entry[0])?.id) {
12311 extractToDef(entry);
12312 continue;
12313 }
12314 if (seen.cycle) {
12315 extractToDef(entry);
12316 continue;
12317 }
12318 if (seen.count > 1) {
12319 if (params.reused === "ref") {
12320 extractToDef(entry);
12321 continue;
12322 }
12323 }
12324 }
12325 const flattenRef = (zodSchema, params) => {
12326 const seen = this.seen.get(zodSchema);
12327 const schema = seen.def ?? seen.schema;
12328 const _cached = { ...schema };
12329 if (seen.ref === null) return;
12330 const ref = seen.ref;
12331 seen.ref = null;
12332 if (ref) {
12333 flattenRef(ref, params);
12334 const refSchema = this.seen.get(ref).schema;
12335 if (refSchema.$ref && params.target === "draft-7") {
12336 schema.allOf = schema.allOf ?? [];
12337 schema.allOf.push(refSchema);
12338 } else {
12339 Object.assign(schema, refSchema);
12340 Object.assign(schema, _cached);
12341 }
12342 }
12343 if (!seen.isParent) this.override({
12344 zodSchema,
12345 jsonSchema: schema,
12346 path: seen.path ?? []
12347 });
12348 };
12349 for (const entry of [...this.seen.entries()].reverse()) flattenRef(entry[0], { target: this.target });
12350 const result = {};
12351 if (this.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
12352 else if (this.target === "draft-7") result.$schema = "http://json-schema.org/draft-07/schema#";
12353 else console.warn(`Invalid target: ${this.target}`);
12354 if (params.external?.uri) {
12355 const id = params.external.registry.get(schema)?.id;
12356 if (!id) throw new Error("Schema is missing an `id` property");
12357 result.$id = params.external.uri(id);
12358 }
12359 Object.assign(result, root.def);
12360 const defs = params.external?.defs ?? {};
12361 for (const entry of this.seen.entries()) {
12362 const seen = entry[1];
12363 if (seen.def && seen.defId) defs[seen.defId] = seen.def;
12364 }
12365 if (params.external) {} else if (Object.keys(defs).length > 0) if (this.target === "draft-2020-12") result.$defs = defs;
12366 else result.definitions = defs;
12367 try {
12368 return JSON.parse(JSON.stringify(result));
12369 } catch (_err) {
12370 throw new Error("Error converting schema to JSON.");
12371 }
12372 }
12373 };
12374 function toJSONSchema(input, _params) {
12375 if (input instanceof $ZodRegistry) {
12376 const gen = new JSONSchemaGenerator(_params);
12377 const defs = {};
12378 for (const entry of input._idmap.entries()) {
12379 const [_, schema] = entry;
12380 gen.process(schema);
12381 }
12382 const schemas = {};
12383 const external = {
12384 registry: input,
12385 uri: _params?.uri,
12386 defs
12387 };
12388 for (const entry of input._idmap.entries()) {
12389 const [key, schema] = entry;
12390 schemas[key] = gen.emit(schema, {
12391 ..._params,
12392 external
12393 });
12394 }
12395 if (Object.keys(defs).length > 0) schemas.__shared = { [gen.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
12396 return { schemas };
12397 }
12398 const gen = new JSONSchemaGenerator(_params);
12399 gen.process(input);
12400 return gen.emit(input, _params);
12401 }
12402 function isTransforming(_schema, _ctx) {
12403 const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
12404 if (ctx.seen.has(_schema)) return false;
12405 ctx.seen.add(_schema);
12406 const def = _schema._zod.def;
12407 switch (def.type) {
12408 case "string":
12409 case "number":
12410 case "bigint":
12411 case "boolean":
12412 case "date":
12413 case "symbol":
12414 case "undefined":
12415 case "null":
12416 case "any":
12417 case "unknown":
12418 case "never":
12419 case "void":
12420 case "literal":
12421 case "enum":
12422 case "nan":
12423 case "file":
12424 case "template_literal": return false;
12425 case "array": return isTransforming(def.element, ctx);
12426 case "object":
12427 for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true;
12428 return false;
12429 case "union":
12430 for (const option of def.options) if (isTransforming(option, ctx)) return true;
12431 return false;
12432 case "intersection": return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
12433 case "tuple":
12434 for (const item of def.items) if (isTransforming(item, ctx)) return true;
12435 if (def.rest && isTransforming(def.rest, ctx)) return true;
12436 return false;
12437 case "record": return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
12438 case "map": return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
12439 case "set": return isTransforming(def.valueType, ctx);
12440 case "promise":
12441 case "optional":
12442 case "nonoptional":
12443 case "nullable":
12444 case "readonly": return isTransforming(def.innerType, ctx);
12445 case "lazy": return isTransforming(def.getter(), ctx);
12446 case "default": return isTransforming(def.innerType, ctx);
12447 case "prefault": return isTransforming(def.innerType, ctx);
12448 case "custom": return false;
12449 case "transform": return true;
12450 case "pipe": return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
12451 case "success": return false;
12452 case "catch": return false;
12453 default:
12454 }
12455 throw new Error(`Unknown schema type: ${def.type}`);
12456 }
12457
12458 //#endregion
12459 //#region node_modules/zod/v4/core/json-schema.js
12460 var json_schema_exports = /* @__PURE__ */ __exportAll({});
12461
12462 //#endregion
12463 //#region node_modules/zod/v4/core/index.js
12464 var core_exports = /* @__PURE__ */ __exportAll({
12465 $ZodAny: () => $ZodAny,
12466 $ZodArray: () => $ZodArray,
12467 $ZodAsyncError: () => $ZodAsyncError,
12468 $ZodBase64: () => $ZodBase64,
12469 $ZodBase64URL: () => $ZodBase64URL,
12470 $ZodBigInt: () => $ZodBigInt,
12471 $ZodBigIntFormat: () => $ZodBigIntFormat,
12472 $ZodBoolean: () => $ZodBoolean,
12473 $ZodCIDRv4: () => $ZodCIDRv4,
12474 $ZodCIDRv6: () => $ZodCIDRv6,
12475 $ZodCUID: () => $ZodCUID,
12476 $ZodCUID2: () => $ZodCUID2,
12477 $ZodCatch: () => $ZodCatch,
12478 $ZodCheck: () => $ZodCheck,
12479 $ZodCheckBigIntFormat: () => $ZodCheckBigIntFormat,
12480 $ZodCheckEndsWith: () => $ZodCheckEndsWith,
12481 $ZodCheckGreaterThan: () => $ZodCheckGreaterThan,
12482 $ZodCheckIncludes: () => $ZodCheckIncludes,
12483 $ZodCheckLengthEquals: () => $ZodCheckLengthEquals,
12484 $ZodCheckLessThan: () => $ZodCheckLessThan,
12485 $ZodCheckLowerCase: () => $ZodCheckLowerCase,
12486 $ZodCheckMaxLength: () => $ZodCheckMaxLength,
12487 $ZodCheckMaxSize: () => $ZodCheckMaxSize,
12488 $ZodCheckMimeType: () => $ZodCheckMimeType,
12489 $ZodCheckMinLength: () => $ZodCheckMinLength,
12490 $ZodCheckMinSize: () => $ZodCheckMinSize,
12491 $ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
12492 $ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
12493 $ZodCheckOverwrite: () => $ZodCheckOverwrite,
12494 $ZodCheckProperty: () => $ZodCheckProperty,
12495 $ZodCheckRegex: () => $ZodCheckRegex,
12496 $ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
12497 $ZodCheckStartsWith: () => $ZodCheckStartsWith,
12498 $ZodCheckStringFormat: () => $ZodCheckStringFormat,
12499 $ZodCheckUpperCase: () => $ZodCheckUpperCase,
12500 $ZodCustom: () => $ZodCustom,
12501 $ZodCustomStringFormat: () => $ZodCustomStringFormat,
12502 $ZodDate: () => $ZodDate,
12503 $ZodDefault: () => $ZodDefault,
12504 $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion,
12505 $ZodE164: () => $ZodE164,
12506 $ZodEmail: () => $ZodEmail,
12507 $ZodEmoji: () => $ZodEmoji,
12508 $ZodEnum: () => $ZodEnum,
12509 $ZodError: () => $ZodError,
12510 $ZodFile: () => $ZodFile,
12511 $ZodFunction: () => $ZodFunction,
12512 $ZodGUID: () => $ZodGUID,
12513 $ZodIPv4: () => $ZodIPv4,
12514 $ZodIPv6: () => $ZodIPv6,
12515 $ZodISODate: () => $ZodISODate,
12516 $ZodISODateTime: () => $ZodISODateTime,
12517 $ZodISODuration: () => $ZodISODuration,
12518 $ZodISOTime: () => $ZodISOTime,
12519 $ZodIntersection: () => $ZodIntersection,
12520 $ZodJWT: () => $ZodJWT,
12521 $ZodKSUID: () => $ZodKSUID,
12522 $ZodLazy: () => $ZodLazy,
12523 $ZodLiteral: () => $ZodLiteral,
12524 $ZodMap: () => $ZodMap,
12525 $ZodNaN: () => $ZodNaN,
12526 $ZodNanoID: () => $ZodNanoID,
12527 $ZodNever: () => $ZodNever,
12528 $ZodNonOptional: () => $ZodNonOptional,
12529 $ZodNull: () => $ZodNull,
12530 $ZodNullable: () => $ZodNullable,
12531 $ZodNumber: () => $ZodNumber,
12532 $ZodNumberFormat: () => $ZodNumberFormat,
12533 $ZodObject: () => $ZodObject,
12534 $ZodOptional: () => $ZodOptional,
12535 $ZodPipe: () => $ZodPipe,
12536 $ZodPrefault: () => $ZodPrefault,
12537 $ZodPromise: () => $ZodPromise,
12538 $ZodReadonly: () => $ZodReadonly,
12539 $ZodRealError: () => $ZodRealError,
12540 $ZodRecord: () => $ZodRecord,
12541 $ZodRegistry: () => $ZodRegistry,
12542 $ZodSet: () => $ZodSet,
12543 $ZodString: () => $ZodString,
12544 $ZodStringFormat: () => $ZodStringFormat,
12545 $ZodSuccess: () => $ZodSuccess,
12546 $ZodSymbol: () => $ZodSymbol,
12547 $ZodTemplateLiteral: () => $ZodTemplateLiteral,
12548 $ZodTransform: () => $ZodTransform,
12549 $ZodTuple: () => $ZodTuple,
12550 $ZodType: () => $ZodType,
12551 $ZodULID: () => $ZodULID,
12552 $ZodURL: () => $ZodURL,
12553 $ZodUUID: () => $ZodUUID,
12554 $ZodUndefined: () => $ZodUndefined,
12555 $ZodUnion: () => $ZodUnion,
12556 $ZodUnknown: () => $ZodUnknown,
12557 $ZodVoid: () => $ZodVoid,
12558 $ZodXID: () => $ZodXID,
12559 $brand: () => $brand,
12560 $constructor: () => $constructor,
12561 $input: () => $input,
12562 $output: () => $output,
12563 Doc: () => Doc,
12564 JSONSchema: () => json_schema_exports,
12565 JSONSchemaGenerator: () => JSONSchemaGenerator,
12566 NEVER: () => NEVER,
12567 TimePrecision: () => TimePrecision,
12568 _any: () => _any,
12569 _array: () => _array,
12570 _base64: () => _base64,
12571 _base64url: () => _base64url,
12572 _bigint: () => _bigint,
12573 _boolean: () => _boolean,
12574 _catch: () => _catch$1,
12575 _cidrv4: () => _cidrv4,
12576 _cidrv6: () => _cidrv6,
12577 _coercedBigint: () => _coercedBigint,
12578 _coercedBoolean: () => _coercedBoolean,
12579 _coercedDate: () => _coercedDate,
12580 _coercedNumber: () => _coercedNumber,
12581 _coercedString: () => _coercedString,
12582 _cuid: () => _cuid,
12583 _cuid2: () => _cuid2,
12584 _custom: () => _custom,
12585 _date: () => _date,
12586 _default: () => _default$1,
12587 _discriminatedUnion: () => _discriminatedUnion,
12588 _e164: () => _e164,
12589 _email: () => _email,
12590 _emoji: () => _emoji,
12591 _endsWith: () => _endsWith,
12592 _enum: () => _enum$1,
12593 _file: () => _file,
12594 _float32: () => _float32,
12595 _float64: () => _float64,
12596 _gt: () => _gt,
12597 _gte: () => _gte,
12598 _guid: () => _guid,
12599 _includes: () => _includes,
12600 _int: () => _int,
12601 _int32: () => _int32,
12602 _int64: () => _int64,
12603 _intersection: () => _intersection,
12604 _ipv4: () => _ipv4,
12605 _ipv6: () => _ipv6,
12606 _isoDate: () => _isoDate,
12607 _isoDateTime: () => _isoDateTime,
12608 _isoDuration: () => _isoDuration,
12609 _isoTime: () => _isoTime,
12610 _jwt: () => _jwt,
12611 _ksuid: () => _ksuid,
12612 _lazy: () => _lazy,
12613 _length: () => _length,
12614 _literal: () => _literal,
12615 _lowercase: () => _lowercase,
12616 _lt: () => _lt,
12617 _lte: () => _lte,
12618 _map: () => _map,
12619 _max: () => _lte,
12620 _maxLength: () => _maxLength,
12621 _maxSize: () => _maxSize,
12622 _mime: () => _mime,
12623 _min: () => _gte,
12624 _minLength: () => _minLength,
12625 _minSize: () => _minSize,
12626 _multipleOf: () => _multipleOf,
12627 _nan: () => _nan,
12628 _nanoid: () => _nanoid,
12629 _nativeEnum: () => _nativeEnum,
12630 _negative: () => _negative,
12631 _never: () => _never,
12632 _nonnegative: () => _nonnegative,
12633 _nonoptional: () => _nonoptional,
12634 _nonpositive: () => _nonpositive,
12635 _normalize: () => _normalize,
12636 _null: () => _null$1,
12637 _nullable: () => _nullable,
12638 _number: () => _number,
12639 _optional: () => _optional,
12640 _overwrite: () => _overwrite,
12641 _parse: () => _parse,
12642 _parseAsync: () => _parseAsync,
12643 _pipe: () => _pipe,
12644 _positive: () => _positive,
12645 _promise: () => _promise,
12646 _property: () => _property,
12647 _readonly: () => _readonly,
12648 _record: () => _record,
12649 _refine: () => _refine,
12650 _regex: () => _regex,
12651 _safeParse: () => _safeParse,
12652 _safeParseAsync: () => _safeParseAsync,
12653 _set: () => _set,
12654 _size: () => _size,
12655 _startsWith: () => _startsWith,
12656 _string: () => _string,
12657 _stringFormat: () => _stringFormat,
12658 _stringbool: () => _stringbool,
12659 _success: () => _success,
12660 _symbol: () => _symbol,
12661 _templateLiteral: () => _templateLiteral,
12662 _toLowerCase: () => _toLowerCase,
12663 _toUpperCase: () => _toUpperCase,
12664 _transform: () => _transform,
12665 _trim: () => _trim,
12666 _tuple: () => _tuple,
12667 _uint32: () => _uint32,
12668 _uint64: () => _uint64,
12669 _ulid: () => _ulid,
12670 _undefined: () => _undefined$1,
12671 _union: () => _union,
12672 _unknown: () => _unknown,
12673 _uppercase: () => _uppercase,
12674 _url: () => _url,
12675 _uuid: () => _uuid,
12676 _uuidv4: () => _uuidv4,
12677 _uuidv6: () => _uuidv6,
12678 _uuidv7: () => _uuidv7,
12679 _void: () => _void$1,
12680 _xid: () => _xid,
12681 clone: () => clone,
12682 config: () => config,
12683 flattenError: () => flattenError,
12684 formatError: () => formatError,
12685 function: () => _function,
12686 globalConfig: () => globalConfig,
12687 globalRegistry: () => globalRegistry,
12688 isValidBase64: () => isValidBase64,
12689 isValidBase64URL: () => isValidBase64URL,
12690 isValidJWT: () => isValidJWT,
12691 locales: () => locales_exports,
12692 parse: () => parse$1,
12693 parseAsync: () => parseAsync$1,
12694 prettifyError: () => prettifyError,
12695 regexes: () => regexes_exports,
12696 registry: () => registry,
12697 safeParse: () => safeParse$1,
12698 safeParseAsync: () => safeParseAsync$1,
12699 toDotPath: () => toDotPath,
12700 toJSONSchema: () => toJSONSchema,
12701 treeifyError: () => treeifyError,
12702 util: () => util_exports,
12703 version: () => version
12704 });
12705
12706 //#endregion
12707 //#region node_modules/zod/v4/classic/iso.js
12708 var iso_exports = /* @__PURE__ */ __exportAll({
12709 ZodISODate: () => ZodISODate,
12710 ZodISODateTime: () => ZodISODateTime,
12711 ZodISODuration: () => ZodISODuration,
12712 ZodISOTime: () => ZodISOTime,
12713 date: () => date$2,
12714 datetime: () => datetime,
12715 duration: () => duration,
12716 time: () => time
12717 });
12718 var ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
12719 $ZodISODateTime.init(inst, def);
12720 ZodStringFormat.init(inst, def);
12721 });
12722 function datetime(params) {
12723 return _isoDateTime(ZodISODateTime, params);
12724 }
12725 var ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
12726 $ZodISODate.init(inst, def);
12727 ZodStringFormat.init(inst, def);
12728 });
12729 function date$2(params) {
12730 return _isoDate(ZodISODate, params);
12731 }
12732 __name(date$2, "date");
12733 var ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
12734 $ZodISOTime.init(inst, def);
12735 ZodStringFormat.init(inst, def);
12736 });
12737 function time(params) {
12738 return _isoTime(ZodISOTime, params);
12739 }
12740 var ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
12741 $ZodISODuration.init(inst, def);
12742 ZodStringFormat.init(inst, def);
12743 });
12744 function duration(params) {
12745 return _isoDuration(ZodISODuration, params);
12746 }
12747
12748 //#endregion
12749 //#region node_modules/zod/v4/classic/errors.js
12750 var initializer = (inst, issues) => {
12751 $ZodError.init(inst, issues);
12752 inst.name = "ZodError";
12753 Object.defineProperties(inst, {
12754 format: { value: (mapper) => formatError(inst, mapper) },
12755 flatten: { value: (mapper) => flattenError(inst, mapper) },
12756 addIssue: { value: (issue) => inst.issues.push(issue) },
12757 addIssues: { value: (issues) => inst.issues.push(...issues) },
12758 isEmpty: { get() {
12759 return inst.issues.length === 0;
12760 } }
12761 });
12762 };
12763 var ZodError = $constructor("ZodError", initializer);
12764 var ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
12765
12766 //#endregion
12767 //#region node_modules/zod/v4/classic/parse.js
12768 var parse = /* @__PURE__ */ _parse(ZodRealError);
12769 var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
12770 var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
12771 var safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
12772
12773 //#endregion
12774 //#region node_modules/zod/v4/classic/schemas.js
12775 var ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
12776 $ZodType.init(inst, def);
12777 inst.def = def;
12778 Object.defineProperty(inst, "_def", { value: def });
12779 inst.check = (...checks) => {
12780 return inst.clone({
12781 ...def,
12782 checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
12783 check: ch,
12784 def: { check: "custom" },
12785 onattach: []
12786 } } : ch)]
12787 });
12788 };
12789 inst.clone = (def, params) => clone(inst, def, params);
12790 inst.brand = () => inst;
12791 inst.register = ((reg, meta) => {
12792 reg.add(inst, meta);
12793 return inst;
12794 });
12795 inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
12796 inst.safeParse = (data, params) => safeParse(inst, data, params);
12797 inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
12798 inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
12799 inst.spa = inst.safeParseAsync;
12800 inst.refine = (check, params) => inst.check(refine(check, params));
12801 inst.superRefine = (refinement) => inst.check(superRefine(refinement));
12802 inst.overwrite = (fn) => inst.check(_overwrite(fn));
12803 inst.optional = () => optional(inst);
12804 inst.nullable = () => nullable(inst);
12805 inst.nullish = () => optional(nullable(inst));
12806 inst.nonoptional = (params) => nonoptional(inst, params);
12807 inst.array = () => array(inst);
12808 inst.or = (arg) => union([inst, arg]);
12809 inst.and = (arg) => intersection(inst, arg);
12810 inst.transform = (tx) => pipe(inst, transform(tx));
12811 inst.default = (def) => _default(inst, def);
12812 inst.prefault = (def) => prefault(inst, def);
12813 inst.catch = (params) => _catch(inst, params);
12814 inst.pipe = (target) => pipe(inst, target);
12815 inst.readonly = () => readonly(inst);
12816 inst.describe = (description) => {
12817 const cl = inst.clone();
12818 globalRegistry.add(cl, { description });
12819 return cl;
12820 };
12821 Object.defineProperty(inst, "description", {
12822 get() {
12823 return globalRegistry.get(inst)?.description;
12824 },
12825 configurable: true
12826 });
12827 inst.meta = (...args) => {
12828 if (args.length === 0) return globalRegistry.get(inst);
12829 const cl = inst.clone();
12830 globalRegistry.add(cl, args[0]);
12831 return cl;
12832 };
12833 inst.isOptional = () => inst.safeParse(void 0).success;
12834 inst.isNullable = () => inst.safeParse(null).success;
12835 return inst;
12836 });
12837 /** @internal */
12838 var _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
12839 $ZodString.init(inst, def);
12840 ZodType.init(inst, def);
12841 const bag = inst._zod.bag;
12842 inst.format = bag.format ?? null;
12843 inst.minLength = bag.minimum ?? null;
12844 inst.maxLength = bag.maximum ?? null;
12845 inst.regex = (...args) => inst.check(_regex(...args));
12846 inst.includes = (...args) => inst.check(_includes(...args));
12847 inst.startsWith = (...args) => inst.check(_startsWith(...args));
12848 inst.endsWith = (...args) => inst.check(_endsWith(...args));
12849 inst.min = (...args) => inst.check(_minLength(...args));
12850 inst.max = (...args) => inst.check(_maxLength(...args));
12851 inst.length = (...args) => inst.check(_length(...args));
12852 inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
12853 inst.lowercase = (params) => inst.check(_lowercase(params));
12854 inst.uppercase = (params) => inst.check(_uppercase(params));
12855 inst.trim = () => inst.check(_trim());
12856 inst.normalize = (...args) => inst.check(_normalize(...args));
12857 inst.toLowerCase = () => inst.check(_toLowerCase());
12858 inst.toUpperCase = () => inst.check(_toUpperCase());
12859 });
12860 var ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
12861 $ZodString.init(inst, def);
12862 _ZodString.init(inst, def);
12863 inst.email = (params) => inst.check(_email(ZodEmail, params));
12864 inst.url = (params) => inst.check(_url(ZodURL, params));
12865 inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
12866 inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
12867 inst.guid = (params) => inst.check(_guid(ZodGUID, params));
12868 inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
12869 inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
12870 inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
12871 inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
12872 inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
12873 inst.guid = (params) => inst.check(_guid(ZodGUID, params));
12874 inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
12875 inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
12876 inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
12877 inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
12878 inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
12879 inst.xid = (params) => inst.check(_xid(ZodXID, params));
12880 inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
12881 inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
12882 inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
12883 inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
12884 inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
12885 inst.e164 = (params) => inst.check(_e164(ZodE164, params));
12886 inst.datetime = (params) => inst.check(datetime(params));
12887 inst.date = (params) => inst.check(date$2(params));
12888 inst.time = (params) => inst.check(time(params));
12889 inst.duration = (params) => inst.check(duration(params));
12890 });
12891 function string$1(params) {
12892 return _string(ZodString, params);
12893 }
12894 __name(string$1, "string");
12895 var ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => {
12896 $ZodStringFormat.init(inst, def);
12897 _ZodString.init(inst, def);
12898 });
12899 var ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
12900 $ZodEmail.init(inst, def);
12901 ZodStringFormat.init(inst, def);
12902 });
12903 function email(params) {
12904 return _email(ZodEmail, params);
12905 }
12906 var ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
12907 $ZodGUID.init(inst, def);
12908 ZodStringFormat.init(inst, def);
12909 });
12910 function guid(params) {
12911 return _guid(ZodGUID, params);
12912 }
12913 var ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
12914 $ZodUUID.init(inst, def);
12915 ZodStringFormat.init(inst, def);
12916 });
12917 function uuid(params) {
12918 return _uuid(ZodUUID, params);
12919 }
12920 function uuidv4(params) {
12921 return _uuidv4(ZodUUID, params);
12922 }
12923 function uuidv6(params) {
12924 return _uuidv6(ZodUUID, params);
12925 }
12926 function uuidv7(params) {
12927 return _uuidv7(ZodUUID, params);
12928 }
12929 var ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
12930 $ZodURL.init(inst, def);
12931 ZodStringFormat.init(inst, def);
12932 });
12933 function url(params) {
12934 return _url(ZodURL, params);
12935 }
12936 var ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
12937 $ZodEmoji.init(inst, def);
12938 ZodStringFormat.init(inst, def);
12939 });
12940 function emoji(params) {
12941 return _emoji(ZodEmoji, params);
12942 }
12943 var ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
12944 $ZodNanoID.init(inst, def);
12945 ZodStringFormat.init(inst, def);
12946 });
12947 function nanoid(params) {
12948 return _nanoid(ZodNanoID, params);
12949 }
12950 var ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
12951 $ZodCUID.init(inst, def);
12952 ZodStringFormat.init(inst, def);
12953 });
12954 function cuid(params) {
12955 return _cuid(ZodCUID, params);
12956 }
12957 var ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => {
12958 $ZodCUID2.init(inst, def);
12959 ZodStringFormat.init(inst, def);
12960 });
12961 function cuid2(params) {
12962 return _cuid2(ZodCUID2, params);
12963 }
12964 var ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => {
12965 $ZodULID.init(inst, def);
12966 ZodStringFormat.init(inst, def);
12967 });
12968 function ulid(params) {
12969 return _ulid(ZodULID, params);
12970 }
12971 var ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => {
12972 $ZodXID.init(inst, def);
12973 ZodStringFormat.init(inst, def);
12974 });
12975 function xid(params) {
12976 return _xid(ZodXID, params);
12977 }
12978 var ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => {
12979 $ZodKSUID.init(inst, def);
12980 ZodStringFormat.init(inst, def);
12981 });
12982 function ksuid(params) {
12983 return _ksuid(ZodKSUID, params);
12984 }
12985 var ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
12986 $ZodIPv4.init(inst, def);
12987 ZodStringFormat.init(inst, def);
12988 });
12989 function ipv4(params) {
12990 return _ipv4(ZodIPv4, params);
12991 }
12992 var ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
12993 $ZodIPv6.init(inst, def);
12994 ZodStringFormat.init(inst, def);
12995 });
12996 function ipv6(params) {
12997 return _ipv6(ZodIPv6, params);
12998 }
12999 var ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
13000 $ZodCIDRv4.init(inst, def);
13001 ZodStringFormat.init(inst, def);
13002 });
13003 function cidrv4(params) {
13004 return _cidrv4(ZodCIDRv4, params);
13005 }
13006 var ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => {
13007 $ZodCIDRv6.init(inst, def);
13008 ZodStringFormat.init(inst, def);
13009 });
13010 function cidrv6(params) {
13011 return _cidrv6(ZodCIDRv6, params);
13012 }
13013 var ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => {
13014 $ZodBase64.init(inst, def);
13015 ZodStringFormat.init(inst, def);
13016 });
13017 function base64(params) {
13018 return _base64(ZodBase64, params);
13019 }
13020 var ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => {
13021 $ZodBase64URL.init(inst, def);
13022 ZodStringFormat.init(inst, def);
13023 });
13024 function base64url(params) {
13025 return _base64url(ZodBase64URL, params);
13026 }
13027 var ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => {
13028 $ZodE164.init(inst, def);
13029 ZodStringFormat.init(inst, def);
13030 });
13031 function e164(params) {
13032 return _e164(ZodE164, params);
13033 }
13034 var ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
13035 $ZodJWT.init(inst, def);
13036 ZodStringFormat.init(inst, def);
13037 });
13038 function jwt(params) {
13039 return _jwt(ZodJWT, params);
13040 }
13041 var ZodCustomStringFormat = /*@__PURE__*/ $constructor("ZodCustomStringFormat", (inst, def) => {
13042 $ZodCustomStringFormat.init(inst, def);
13043 ZodStringFormat.init(inst, def);
13044 });
13045 function stringFormat(format, fnOrRegex, _params = {}) {
13046 return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
13047 }
13048 var ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
13049 $ZodNumber.init(inst, def);
13050 ZodType.init(inst, def);
13051 inst.gt = (value, params) => inst.check(_gt(value, params));
13052 inst.gte = (value, params) => inst.check(_gte(value, params));
13053 inst.min = (value, params) => inst.check(_gte(value, params));
13054 inst.lt = (value, params) => inst.check(_lt(value, params));
13055 inst.lte = (value, params) => inst.check(_lte(value, params));
13056 inst.max = (value, params) => inst.check(_lte(value, params));
13057 inst.int = (params) => inst.check(int(params));
13058 inst.safe = (params) => inst.check(int(params));
13059 inst.positive = (params) => inst.check(_gt(0, params));
13060 inst.nonnegative = (params) => inst.check(_gte(0, params));
13061 inst.negative = (params) => inst.check(_lt(0, params));
13062 inst.nonpositive = (params) => inst.check(_lte(0, params));
13063 inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
13064 inst.step = (value, params) => inst.check(_multipleOf(value, params));
13065 inst.finite = () => inst;
13066 const bag = inst._zod.bag;
13067 inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
13068 inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
13069 inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
13070 inst.isFinite = true;
13071 inst.format = bag.format ?? null;
13072 });
13073 function number$1(params) {
13074 return _number(ZodNumber, params);
13075 }
13076 __name(number$1, "number");
13077 var ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
13078 $ZodNumberFormat.init(inst, def);
13079 ZodNumber.init(inst, def);
13080 });
13081 function int(params) {
13082 return _int(ZodNumberFormat, params);
13083 }
13084 function float32(params) {
13085 return _float32(ZodNumberFormat, params);
13086 }
13087 function float64(params) {
13088 return _float64(ZodNumberFormat, params);
13089 }
13090 function int32(params) {
13091 return _int32(ZodNumberFormat, params);
13092 }
13093 function uint32(params) {
13094 return _uint32(ZodNumberFormat, params);
13095 }
13096 var ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
13097 $ZodBoolean.init(inst, def);
13098 ZodType.init(inst, def);
13099 });
13100 function boolean$1(params) {
13101 return _boolean(ZodBoolean, params);
13102 }
13103 __name(boolean$1, "boolean");
13104 var ZodBigInt = /*@__PURE__*/ $constructor("ZodBigInt", (inst, def) => {
13105 $ZodBigInt.init(inst, def);
13106 ZodType.init(inst, def);
13107 inst.gte = (value, params) => inst.check(_gte(value, params));
13108 inst.min = (value, params) => inst.check(_gte(value, params));
13109 inst.gt = (value, params) => inst.check(_gt(value, params));
13110 inst.gte = (value, params) => inst.check(_gte(value, params));
13111 inst.min = (value, params) => inst.check(_gte(value, params));
13112 inst.lt = (value, params) => inst.check(_lt(value, params));
13113 inst.lte = (value, params) => inst.check(_lte(value, params));
13114 inst.max = (value, params) => inst.check(_lte(value, params));
13115 inst.positive = (params) => inst.check(_gt(BigInt(0), params));
13116 inst.negative = (params) => inst.check(_lt(BigInt(0), params));
13117 inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
13118 inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
13119 inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
13120 const bag = inst._zod.bag;
13121 inst.minValue = bag.minimum ?? null;
13122 inst.maxValue = bag.maximum ?? null;
13123 inst.format = bag.format ?? null;
13124 });
13125 function bigint$1(params) {
13126 return _bigint(ZodBigInt, params);
13127 }
13128 __name(bigint$1, "bigint");
13129 var ZodBigIntFormat = /*@__PURE__*/ $constructor("ZodBigIntFormat", (inst, def) => {
13130 $ZodBigIntFormat.init(inst, def);
13131 ZodBigInt.init(inst, def);
13132 });
13133 function int64(params) {
13134 return _int64(ZodBigIntFormat, params);
13135 }
13136 function uint64(params) {
13137 return _uint64(ZodBigIntFormat, params);
13138 }
13139 var ZodSymbol = /*@__PURE__*/ $constructor("ZodSymbol", (inst, def) => {
13140 $ZodSymbol.init(inst, def);
13141 ZodType.init(inst, def);
13142 });
13143 function symbol(params) {
13144 return _symbol(ZodSymbol, params);
13145 }
13146 var ZodUndefined = /*@__PURE__*/ $constructor("ZodUndefined", (inst, def) => {
13147 $ZodUndefined.init(inst, def);
13148 ZodType.init(inst, def);
13149 });
13150 function _undefined(params) {
13151 return _undefined$1(ZodUndefined, params);
13152 }
13153 var ZodNull = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => {
13154 $ZodNull.init(inst, def);
13155 ZodType.init(inst, def);
13156 });
13157 function _null(params) {
13158 return _null$1(ZodNull, params);
13159 }
13160 var ZodAny = /*@__PURE__*/ $constructor("ZodAny", (inst, def) => {
13161 $ZodAny.init(inst, def);
13162 ZodType.init(inst, def);
13163 });
13164 function any() {
13165 return _any(ZodAny);
13166 }
13167 var ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
13168 $ZodUnknown.init(inst, def);
13169 ZodType.init(inst, def);
13170 });
13171 function unknown() {
13172 return _unknown(ZodUnknown);
13173 }
13174 var ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
13175 $ZodNever.init(inst, def);
13176 ZodType.init(inst, def);
13177 });
13178 function never(params) {
13179 return _never(ZodNever, params);
13180 }
13181 var ZodVoid = /*@__PURE__*/ $constructor("ZodVoid", (inst, def) => {
13182 $ZodVoid.init(inst, def);
13183 ZodType.init(inst, def);
13184 });
13185 function _void(params) {
13186 return _void$1(ZodVoid, params);
13187 }
13188 var ZodDate = /*@__PURE__*/ $constructor("ZodDate", (inst, def) => {
13189 $ZodDate.init(inst, def);
13190 ZodType.init(inst, def);
13191 inst.min = (value, params) => inst.check(_gte(value, params));
13192 inst.max = (value, params) => inst.check(_lte(value, params));
13193 const c = inst._zod.bag;
13194 inst.minDate = c.minimum ? new Date(c.minimum) : null;
13195 inst.maxDate = c.maximum ? new Date(c.maximum) : null;
13196 });
13197 function date$1(params) {
13198 return _date(ZodDate, params);
13199 }
13200 __name(date$1, "date");
13201 var ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
13202 $ZodArray.init(inst, def);
13203 ZodType.init(inst, def);
13204 inst.element = def.element;
13205 inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
13206 inst.nonempty = (params) => inst.check(_minLength(1, params));
13207 inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
13208 inst.length = (len, params) => inst.check(_length(len, params));
13209 inst.unwrap = () => inst.element;
13210 });
13211 function array(element, params) {
13212 return _array(ZodArray, element, params);
13213 }
13214 function keyof(schema) {
13215 const shape = schema._zod.def.shape;
13216 return literal(Object.keys(shape));
13217 }
13218 var ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
13219 $ZodObject.init(inst, def);
13220 ZodType.init(inst, def);
13221 defineLazy(inst, "shape", () => def.shape);
13222 inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
13223 inst.catchall = (catchall) => inst.clone({
13224 ...inst._zod.def,
13225 catchall
13226 });
13227 inst.passthrough = () => inst.clone({
13228 ...inst._zod.def,
13229 catchall: unknown()
13230 });
13231 inst.loose = () => inst.clone({
13232 ...inst._zod.def,
13233 catchall: unknown()
13234 });
13235 inst.strict = () => inst.clone({
13236 ...inst._zod.def,
13237 catchall: never()
13238 });
13239 inst.strip = () => inst.clone({
13240 ...inst._zod.def,
13241 catchall: void 0
13242 });
13243 inst.extend = (incoming) => {
13244 return extend(inst, incoming);
13245 };
13246 inst.merge = (other) => merge(inst, other);
13247 inst.pick = (mask) => pick(inst, mask);
13248 inst.omit = (mask) => omit(inst, mask);
13249 inst.partial = (...args) => partial(ZodOptional, inst, args[0]);
13250 inst.required = (...args) => required(ZodNonOptional, inst, args[0]);
13251 });
13252 function object(shape, params) {
13253 const def = {
13254 type: "object",
13255 get shape() {
13256 assignProp(this, "shape", { ...shape });
13257 return this.shape;
13258 },
13259 ...normalizeParams(params)
13260 };
13261 return new ZodObject(def);
13262 }
13263 function strictObject(shape, params) {
13264 return new ZodObject({
13265 type: "object",
13266 get shape() {
13267 assignProp(this, "shape", { ...shape });
13268 return this.shape;
13269 },
13270 catchall: never(),
13271 ...normalizeParams(params)
13272 });
13273 }
13274 function looseObject(shape, params) {
13275 return new ZodObject({
13276 type: "object",
13277 get shape() {
13278 assignProp(this, "shape", { ...shape });
13279 return this.shape;
13280 },
13281 catchall: unknown(),
13282 ...normalizeParams(params)
13283 });
13284 }
13285 var ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
13286 $ZodUnion.init(inst, def);
13287 ZodType.init(inst, def);
13288 inst.options = def.options;
13289 });
13290 function union(options, params) {
13291 return new ZodUnion({
13292 type: "union",
13293 options,
13294 ...normalizeParams(params)
13295 });
13296 }
13297 var ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("ZodDiscriminatedUnion", (inst, def) => {
13298 ZodUnion.init(inst, def);
13299 $ZodDiscriminatedUnion.init(inst, def);
13300 });
13301 function discriminatedUnion(discriminator, options, params) {
13302 return new ZodDiscriminatedUnion({
13303 type: "union",
13304 options,
13305 discriminator,
13306 ...normalizeParams(params)
13307 });
13308 }
13309 var ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
13310 $ZodIntersection.init(inst, def);
13311 ZodType.init(inst, def);
13312 });
13313 function intersection(left, right) {
13314 return new ZodIntersection({
13315 type: "intersection",
13316 left,
13317 right
13318 });
13319 }
13320 var ZodTuple = /*@__PURE__*/ $constructor("ZodTuple", (inst, def) => {
13321 $ZodTuple.init(inst, def);
13322 ZodType.init(inst, def);
13323 inst.rest = (rest) => inst.clone({
13324 ...inst._zod.def,
13325 rest
13326 });
13327 });
13328 function tuple(items, _paramsOrRest, _params) {
13329 const hasRest = _paramsOrRest instanceof $ZodType;
13330 const params = hasRest ? _params : _paramsOrRest;
13331 return new ZodTuple({
13332 type: "tuple",
13333 items,
13334 rest: hasRest ? _paramsOrRest : null,
13335 ...normalizeParams(params)
13336 });
13337 }
13338 var ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
13339 $ZodRecord.init(inst, def);
13340 ZodType.init(inst, def);
13341 inst.keyType = def.keyType;
13342 inst.valueType = def.valueType;
13343 });
13344 function record(keyType, valueType, params) {
13345 return new ZodRecord({
13346 type: "record",
13347 keyType,
13348 valueType,
13349 ...normalizeParams(params)
13350 });
13351 }
13352 function partialRecord(keyType, valueType, params) {
13353 return new ZodRecord({
13354 type: "record",
13355 keyType: union([keyType, never()]),
13356 valueType,
13357 ...normalizeParams(params)
13358 });
13359 }
13360 var ZodMap = /*@__PURE__*/ $constructor("ZodMap", (inst, def) => {
13361 $ZodMap.init(inst, def);
13362 ZodType.init(inst, def);
13363 inst.keyType = def.keyType;
13364 inst.valueType = def.valueType;
13365 });
13366 function map(keyType, valueType, params) {
13367 return new ZodMap({
13368 type: "map",
13369 keyType,
13370 valueType,
13371 ...normalizeParams(params)
13372 });
13373 }
13374 var ZodSet = /*@__PURE__*/ $constructor("ZodSet", (inst, def) => {
13375 $ZodSet.init(inst, def);
13376 ZodType.init(inst, def);
13377 inst.min = (...args) => inst.check(_minSize(...args));
13378 inst.nonempty = (params) => inst.check(_minSize(1, params));
13379 inst.max = (...args) => inst.check(_maxSize(...args));
13380 inst.size = (...args) => inst.check(_size(...args));
13381 });
13382 function set(valueType, params) {
13383 return new ZodSet({
13384 type: "set",
13385 valueType,
13386 ...normalizeParams(params)
13387 });
13388 }
13389 var ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
13390 $ZodEnum.init(inst, def);
13391 ZodType.init(inst, def);
13392 inst.enum = def.entries;
13393 inst.options = Object.values(def.entries);
13394 const keys = new Set(Object.keys(def.entries));
13395 inst.extract = (values, params) => {
13396 const newEntries = {};
13397 for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
13398 else throw new Error(`Key ${value} not found in enum`);
13399 return new ZodEnum({
13400 ...def,
13401 checks: [],
13402 ...normalizeParams(params),
13403 entries: newEntries
13404 });
13405 };
13406 inst.exclude = (values, params) => {
13407 const newEntries = { ...def.entries };
13408 for (const value of values) if (keys.has(value)) delete newEntries[value];
13409 else throw new Error(`Key ${value} not found in enum`);
13410 return new ZodEnum({
13411 ...def,
13412 checks: [],
13413 ...normalizeParams(params),
13414 entries: newEntries
13415 });
13416 };
13417 });
13418 function _enum(values, params) {
13419 const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
13420 return new ZodEnum({
13421 type: "enum",
13422 entries,
13423 ...normalizeParams(params)
13424 });
13425 }
13426 /** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
13427 *
13428 * ```ts
13429 * enum Colors { red, green, blue }
13430 * z.enum(Colors);
13431 * ```
13432 */
13433 function nativeEnum(entries, params) {
13434 return new ZodEnum({
13435 type: "enum",
13436 entries,
13437 ...normalizeParams(params)
13438 });
13439 }
13440 var ZodLiteral = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
13441 $ZodLiteral.init(inst, def);
13442 ZodType.init(inst, def);
13443 inst.values = new Set(def.values);
13444 Object.defineProperty(inst, "value", { get() {
13445 if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
13446 return def.values[0];
13447 } });
13448 });
13449 function literal(value, params) {
13450 return new ZodLiteral({
13451 type: "literal",
13452 values: Array.isArray(value) ? value : [value],
13453 ...normalizeParams(params)
13454 });
13455 }
13456 var ZodFile = /*@__PURE__*/ $constructor("ZodFile", (inst, def) => {
13457 $ZodFile.init(inst, def);
13458 ZodType.init(inst, def);
13459 inst.min = (size, params) => inst.check(_minSize(size, params));
13460 inst.max = (size, params) => inst.check(_maxSize(size, params));
13461 inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
13462 });
13463 function file(params) {
13464 return _file(ZodFile, params);
13465 }
13466 var ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
13467 $ZodTransform.init(inst, def);
13468 ZodType.init(inst, def);
13469 inst._zod.parse = (payload, _ctx) => {
13470 payload.addIssue = (issue$2) => {
13471 if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, def));
13472 else {
13473 const _issue = issue$2;
13474 if (_issue.fatal) _issue.continue = false;
13475 _issue.code ?? (_issue.code = "custom");
13476 _issue.input ?? (_issue.input = payload.value);
13477 _issue.inst ?? (_issue.inst = inst);
13478 _issue.continue ?? (_issue.continue = true);
13479 payload.issues.push(issue(_issue));
13480 }
13481 };
13482 const output = def.transform(payload.value, payload);
13483 if (output instanceof Promise) return output.then((output) => {
13484 payload.value = output;
13485 return payload;
13486 });
13487 payload.value = output;
13488 return payload;
13489 };
13490 });
13491 function transform(fn) {
13492 return new ZodTransform({
13493 type: "transform",
13494 transform: fn
13495 });
13496 }
13497 var ZodOptional = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => {
13498 $ZodOptional.init(inst, def);
13499 ZodType.init(inst, def);
13500 inst.unwrap = () => inst._zod.def.innerType;
13501 });
13502 function optional(innerType) {
13503 return new ZodOptional({
13504 type: "optional",
13505 innerType
13506 });
13507 }
13508 var ZodNullable = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => {
13509 $ZodNullable.init(inst, def);
13510 ZodType.init(inst, def);
13511 inst.unwrap = () => inst._zod.def.innerType;
13512 });
13513 function nullable(innerType) {
13514 return new ZodNullable({
13515 type: "nullable",
13516 innerType
13517 });
13518 }
13519 function nullish(innerType) {
13520 return optional(nullable(innerType));
13521 }
13522 var ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
13523 $ZodDefault.init(inst, def);
13524 ZodType.init(inst, def);
13525 inst.unwrap = () => inst._zod.def.innerType;
13526 inst.removeDefault = inst.unwrap;
13527 });
13528 function _default(innerType, defaultValue) {
13529 return new ZodDefault({
13530 type: "default",
13531 innerType,
13532 get defaultValue() {
13533 return typeof defaultValue === "function" ? defaultValue() : defaultValue;
13534 }
13535 });
13536 }
13537 var ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => {
13538 $ZodPrefault.init(inst, def);
13539 ZodType.init(inst, def);
13540 inst.unwrap = () => inst._zod.def.innerType;
13541 });
13542 function prefault(innerType, defaultValue) {
13543 return new ZodPrefault({
13544 type: "prefault",
13545 innerType,
13546 get defaultValue() {
13547 return typeof defaultValue === "function" ? defaultValue() : defaultValue;
13548 }
13549 });
13550 }
13551 var ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
13552 $ZodNonOptional.init(inst, def);
13553 ZodType.init(inst, def);
13554 inst.unwrap = () => inst._zod.def.innerType;
13555 });
13556 function nonoptional(innerType, params) {
13557 return new ZodNonOptional({
13558 type: "nonoptional",
13559 innerType,
13560 ...normalizeParams(params)
13561 });
13562 }
13563 var ZodSuccess = /*@__PURE__*/ $constructor("ZodSuccess", (inst, def) => {
13564 $ZodSuccess.init(inst, def);
13565 ZodType.init(inst, def);
13566 inst.unwrap = () => inst._zod.def.innerType;
13567 });
13568 function success(innerType) {
13569 return new ZodSuccess({
13570 type: "success",
13571 innerType
13572 });
13573 }
13574 var ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
13575 $ZodCatch.init(inst, def);
13576 ZodType.init(inst, def);
13577 inst.unwrap = () => inst._zod.def.innerType;
13578 inst.removeCatch = inst.unwrap;
13579 });
13580 function _catch(innerType, catchValue) {
13581 return new ZodCatch({
13582 type: "catch",
13583 innerType,
13584 catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
13585 });
13586 }
13587 var ZodNaN = /*@__PURE__*/ $constructor("ZodNaN", (inst, def) => {
13588 $ZodNaN.init(inst, def);
13589 ZodType.init(inst, def);
13590 });
13591 function nan(params) {
13592 return _nan(ZodNaN, params);
13593 }
13594 var ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
13595 $ZodPipe.init(inst, def);
13596 ZodType.init(inst, def);
13597 inst.in = def.in;
13598 inst.out = def.out;
13599 });
13600 function pipe(in_, out) {
13601 return new ZodPipe({
13602 type: "pipe",
13603 in: in_,
13604 out
13605 });
13606 }
13607 var ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
13608 $ZodReadonly.init(inst, def);
13609 ZodType.init(inst, def);
13610 });
13611 function readonly(innerType) {
13612 return new ZodReadonly({
13613 type: "readonly",
13614 innerType
13615 });
13616 }
13617 var ZodTemplateLiteral = /*@__PURE__*/ $constructor("ZodTemplateLiteral", (inst, def) => {
13618 $ZodTemplateLiteral.init(inst, def);
13619 ZodType.init(inst, def);
13620 });
13621 function templateLiteral(parts, params) {
13622 return new ZodTemplateLiteral({
13623 type: "template_literal",
13624 parts,
13625 ...normalizeParams(params)
13626 });
13627 }
13628 var ZodLazy = /*@__PURE__*/ $constructor("ZodLazy", (inst, def) => {
13629 $ZodLazy.init(inst, def);
13630 ZodType.init(inst, def);
13631 inst.unwrap = () => inst._zod.def.getter();
13632 });
13633 function lazy(getter) {
13634 return new ZodLazy({
13635 type: "lazy",
13636 getter
13637 });
13638 }
13639 var ZodPromise = /*@__PURE__*/ $constructor("ZodPromise", (inst, def) => {
13640 $ZodPromise.init(inst, def);
13641 ZodType.init(inst, def);
13642 inst.unwrap = () => inst._zod.def.innerType;
13643 });
13644 function promise(innerType) {
13645 return new ZodPromise({
13646 type: "promise",
13647 innerType
13648 });
13649 }
13650 var ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
13651 $ZodCustom.init(inst, def);
13652 ZodType.init(inst, def);
13653 });
13654 function check(fn) {
13655 const ch = new $ZodCheck({ check: "custom" });
13656 ch._zod.check = fn;
13657 return ch;
13658 }
13659 function custom(fn, _params) {
13660 return _custom(ZodCustom, fn ?? (() => true), _params);
13661 }
13662 function refine(fn, _params = {}) {
13663 return _refine(ZodCustom, fn, _params);
13664 }
13665 function superRefine(fn) {
13666 const ch = check((payload) => {
13667 payload.addIssue = (issue$1) => {
13668 if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
13669 else {
13670 const _issue = issue$1;
13671 if (_issue.fatal) _issue.continue = false;
13672 _issue.code ?? (_issue.code = "custom");
13673 _issue.input ?? (_issue.input = payload.value);
13674 _issue.inst ?? (_issue.inst = ch);
13675 _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
13676 payload.issues.push(issue(_issue));
13677 }
13678 };
13679 return fn(payload.value, payload);
13680 });
13681 return ch;
13682 }
13683 function _instanceof(cls, params = { error: `Input not instance of ${cls.name}` }) {
13684 const inst = new ZodCustom({
13685 type: "custom",
13686 check: "custom",
13687 fn: (data) => data instanceof cls,
13688 abort: true,
13689 ...normalizeParams(params)
13690 });
13691 inst._zod.bag.Class = cls;
13692 return inst;
13693 }
13694 var stringbool = (...args) => _stringbool({
13695 Pipe: ZodPipe,
13696 Boolean: ZodBoolean,
13697 String: ZodString,
13698 Transform: ZodTransform
13699 }, ...args);
13700 function json(params) {
13701 const jsonSchema = lazy(() => {
13702 return union([
13703 string$1(params),
13704 number$1(),
13705 boolean$1(),
13706 _null(),
13707 array(jsonSchema),
13708 record(string$1(), jsonSchema)
13709 ]);
13710 });
13711 return jsonSchema;
13712 }
13713 function preprocess(fn, schema) {
13714 return pipe(transform(fn), schema);
13715 }
13716
13717 //#endregion
13718 //#region node_modules/zod/v4/classic/compat.js
13719 /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
13720 var ZodIssueCode = {
13721 invalid_type: "invalid_type",
13722 too_big: "too_big",
13723 too_small: "too_small",
13724 invalid_format: "invalid_format",
13725 not_multiple_of: "not_multiple_of",
13726 unrecognized_keys: "unrecognized_keys",
13727 invalid_union: "invalid_union",
13728 invalid_key: "invalid_key",
13729 invalid_element: "invalid_element",
13730 invalid_value: "invalid_value",
13731 custom: "custom"
13732 };
13733 /** @deprecated Use `z.config(params)` instead. */
13734 function setErrorMap(map) {
13735 config({ customError: map });
13736 }
13737 /** @deprecated Use `z.config()` instead. */
13738 function getErrorMap() {
13739 return config().customError;
13740 }
13741
13742 //#endregion
13743 //#region node_modules/zod/v4/classic/coerce.js
13744 var coerce_exports = /* @__PURE__ */ __exportAll({
13745 bigint: () => bigint,
13746 boolean: () => boolean,
13747 date: () => date,
13748 number: () => number,
13749 string: () => string
13750 });
13751 function string(params) {
13752 return _coercedString(ZodString, params);
13753 }
13754 function number(params) {
13755 return _coercedNumber(ZodNumber, params);
13756 }
13757 function boolean(params) {
13758 return _coercedBoolean(ZodBoolean, params);
13759 }
13760 function bigint(params) {
13761 return _coercedBigint(ZodBigInt, params);
13762 }
13763 function date(params) {
13764 return _coercedDate(ZodDate, params);
13765 }
13766
13767 //#endregion
13768 //#region node_modules/zod/v4/classic/external.js
13769 var external_exports = /* @__PURE__ */ __exportAll({
13770 $brand: () => $brand,
13771 $input: () => $input,
13772 $output: () => $output,
13773 NEVER: () => NEVER,
13774 TimePrecision: () => TimePrecision,
13775 ZodAny: () => ZodAny,
13776 ZodArray: () => ZodArray,
13777 ZodBase64: () => ZodBase64,
13778 ZodBase64URL: () => ZodBase64URL,
13779 ZodBigInt: () => ZodBigInt,
13780 ZodBigIntFormat: () => ZodBigIntFormat,
13781 ZodBoolean: () => ZodBoolean,
13782 ZodCIDRv4: () => ZodCIDRv4,
13783 ZodCIDRv6: () => ZodCIDRv6,
13784 ZodCUID: () => ZodCUID,
13785 ZodCUID2: () => ZodCUID2,
13786 ZodCatch: () => ZodCatch,
13787 ZodCustom: () => ZodCustom,
13788 ZodCustomStringFormat: () => ZodCustomStringFormat,
13789 ZodDate: () => ZodDate,
13790 ZodDefault: () => ZodDefault,
13791 ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
13792 ZodE164: () => ZodE164,
13793 ZodEmail: () => ZodEmail,
13794 ZodEmoji: () => ZodEmoji,
13795 ZodEnum: () => ZodEnum,
13796 ZodError: () => ZodError,
13797 ZodFile: () => ZodFile,
13798 ZodGUID: () => ZodGUID,
13799 ZodIPv4: () => ZodIPv4,
13800 ZodIPv6: () => ZodIPv6,
13801 ZodISODate: () => ZodISODate,
13802 ZodISODateTime: () => ZodISODateTime,
13803 ZodISODuration: () => ZodISODuration,
13804 ZodISOTime: () => ZodISOTime,
13805 ZodIntersection: () => ZodIntersection,
13806 ZodIssueCode: () => ZodIssueCode,
13807 ZodJWT: () => ZodJWT,
13808 ZodKSUID: () => ZodKSUID,
13809 ZodLazy: () => ZodLazy,
13810 ZodLiteral: () => ZodLiteral,
13811 ZodMap: () => ZodMap,
13812 ZodNaN: () => ZodNaN,
13813 ZodNanoID: () => ZodNanoID,
13814 ZodNever: () => ZodNever,
13815 ZodNonOptional: () => ZodNonOptional,
13816 ZodNull: () => ZodNull,
13817 ZodNullable: () => ZodNullable,
13818 ZodNumber: () => ZodNumber,
13819 ZodNumberFormat: () => ZodNumberFormat,
13820 ZodObject: () => ZodObject,
13821 ZodOptional: () => ZodOptional,
13822 ZodPipe: () => ZodPipe,
13823 ZodPrefault: () => ZodPrefault,
13824 ZodPromise: () => ZodPromise,
13825 ZodReadonly: () => ZodReadonly,
13826 ZodRealError: () => ZodRealError,
13827 ZodRecord: () => ZodRecord,
13828 ZodSet: () => ZodSet,
13829 ZodString: () => ZodString,
13830 ZodStringFormat: () => ZodStringFormat,
13831 ZodSuccess: () => ZodSuccess,
13832 ZodSymbol: () => ZodSymbol,
13833 ZodTemplateLiteral: () => ZodTemplateLiteral,
13834 ZodTransform: () => ZodTransform,
13835 ZodTuple: () => ZodTuple,
13836 ZodType: () => ZodType,
13837 ZodULID: () => ZodULID,
13838 ZodURL: () => ZodURL,
13839 ZodUUID: () => ZodUUID,
13840 ZodUndefined: () => ZodUndefined,
13841 ZodUnion: () => ZodUnion,
13842 ZodUnknown: () => ZodUnknown,
13843 ZodVoid: () => ZodVoid,
13844 ZodXID: () => ZodXID,
13845 _ZodString: () => _ZodString,
13846 _default: () => _default,
13847 any: () => any,
13848 array: () => array,
13849 base64: () => base64,
13850 base64url: () => base64url,
13851 bigint: () => bigint$1,
13852 boolean: () => boolean$1,
13853 catch: () => _catch,
13854 check: () => check,
13855 cidrv4: () => cidrv4,
13856 cidrv6: () => cidrv6,
13857 clone: () => clone,
13858 coerce: () => coerce_exports,
13859 config: () => config,
13860 core: () => core_exports,
13861 cuid: () => cuid,
13862 cuid2: () => cuid2,
13863 custom: () => custom,
13864 date: () => date$1,
13865 discriminatedUnion: () => discriminatedUnion,
13866 e164: () => e164,
13867 email: () => email,
13868 emoji: () => emoji,
13869 endsWith: () => _endsWith,
13870 enum: () => _enum,
13871 file: () => file,
13872 flattenError: () => flattenError,
13873 float32: () => float32,
13874 float64: () => float64,
13875 formatError: () => formatError,
13876 function: () => _function,
13877 getErrorMap: () => getErrorMap,
13878 globalRegistry: () => globalRegistry,
13879 gt: () => _gt,
13880 gte: () => _gte,
13881 guid: () => guid,
13882 includes: () => _includes,
13883 instanceof: () => _instanceof,
13884 int: () => int,
13885 int32: () => int32,
13886 int64: () => int64,
13887 intersection: () => intersection,
13888 ipv4: () => ipv4,
13889 ipv6: () => ipv6,
13890 iso: () => iso_exports,
13891 json: () => json,
13892 jwt: () => jwt,
13893 keyof: () => keyof,
13894 ksuid: () => ksuid,
13895 lazy: () => lazy,
13896 length: () => _length,
13897 literal: () => literal,
13898 locales: () => locales_exports,
13899 looseObject: () => looseObject,
13900 lowercase: () => _lowercase,
13901 lt: () => _lt,
13902 lte: () => _lte,
13903 map: () => map,
13904 maxLength: () => _maxLength,
13905 maxSize: () => _maxSize,
13906 mime: () => _mime,
13907 minLength: () => _minLength,
13908 minSize: () => _minSize,
13909 multipleOf: () => _multipleOf,
13910 nan: () => nan,
13911 nanoid: () => nanoid,
13912 nativeEnum: () => nativeEnum,
13913 negative: () => _negative,
13914 never: () => never,
13915 nonnegative: () => _nonnegative,
13916 nonoptional: () => nonoptional,
13917 nonpositive: () => _nonpositive,
13918 normalize: () => _normalize,
13919 null: () => _null,
13920 nullable: () => nullable,
13921 nullish: () => nullish,
13922 number: () => number$1,
13923 object: () => object,
13924 optional: () => optional,
13925 overwrite: () => _overwrite,
13926 parse: () => parse,
13927 parseAsync: () => parseAsync,
13928 partialRecord: () => partialRecord,
13929 pipe: () => pipe,
13930 positive: () => _positive,
13931 prefault: () => prefault,
13932 preprocess: () => preprocess,
13933 prettifyError: () => prettifyError,
13934 promise: () => promise,
13935 property: () => _property,
13936 readonly: () => readonly,
13937 record: () => record,
13938 refine: () => refine,
13939 regex: () => _regex,
13940 regexes: () => regexes_exports,
13941 registry: () => registry,
13942 safeParse: () => safeParse,
13943 safeParseAsync: () => safeParseAsync,
13944 set: () => set,
13945 setErrorMap: () => setErrorMap,
13946 size: () => _size,
13947 startsWith: () => _startsWith,
13948 strictObject: () => strictObject,
13949 string: () => string$1,
13950 stringFormat: () => stringFormat,
13951 stringbool: () => stringbool,
13952 success: () => success,
13953 superRefine: () => superRefine,
13954 symbol: () => symbol,
13955 templateLiteral: () => templateLiteral,
13956 toJSONSchema: () => toJSONSchema,
13957 toLowerCase: () => _toLowerCase,
13958 toUpperCase: () => _toUpperCase,
13959 transform: () => transform,
13960 treeifyError: () => treeifyError,
13961 trim: () => _trim,
13962 tuple: () => tuple,
13963 uint32: () => uint32,
13964 uint64: () => uint64,
13965 ulid: () => ulid,
13966 undefined: () => _undefined,
13967 union: () => union,
13968 unknown: () => unknown,
13969 uppercase: () => _uppercase,
13970 url: () => url,
13971 uuid: () => uuid,
13972 uuidv4: () => uuidv4,
13973 uuidv6: () => uuidv6,
13974 uuidv7: () => uuidv7,
13975 void: () => _void,
13976 xid: () => xid
13977 });
13978 config(en_default());
13979
13980 //#endregion
13981 //#region packages/packages/libs/schema/src/index.ts
13982 var src_exports = /* @__PURE__ */ __exportAll({
13983 z: () => external_exports$1,
13984 z4: () => external_exports
13985 });
13986
13987 //#endregion
13988 //#region \0elementor-package-library-entry
13989 (window.elementorV2 = window.elementorV2 || {}).schema = src_exports;
13990
13991 //#endregion
13992 })();
13993 window.elementorV2.schema?.init?.();
13994 //# sourceMappingURL=schema.js.map